pptx-react-viewer 3.16.1 → 3.16.3
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 +17 -0
- package/dist/{AiChatPanel-BUKJCMUY.js → AiChatPanel-G33WODR7.js} +24 -24
- package/dist/AiChatPanel-G33WODR7.js.br +0 -0
- package/dist/AiChatPanel-G33WODR7.js.gz +0 -0
- package/dist/{AiChatPanel-US56QZBD.mjs → AiChatPanel-X7NUNEJO.mjs} +3 -3
- package/dist/AiChatPanel-X7NUNEJO.mjs.br +0 -0
- package/dist/AiChatPanel-X7NUNEJO.mjs.gz +0 -0
- package/dist/{Area3DChartScene-6E4QEVTU.mjs → Area3DChartScene-HBTW5EQP.mjs} +1 -1
- package/dist/Area3DChartScene-HBTW5EQP.mjs.br +0 -0
- package/dist/Area3DChartScene-HBTW5EQP.mjs.gz +0 -0
- package/dist/{Area3DChartScene-APGQOK5A.js → Area3DChartScene-R3P4NSR5.js} +2 -2
- package/dist/{Area3DChartScene-APGQOK5A.js.br → Area3DChartScene-R3P4NSR5.js.br} +0 -0
- package/dist/Area3DChartScene-R3P4NSR5.js.gz +0 -0
- package/dist/{Bar3DChartScene-F4B5TNJR.js → Bar3DChartScene-6IKIGGD7.js} +2 -2
- package/dist/Bar3DChartScene-6IKIGGD7.js.br +0 -0
- package/dist/Bar3DChartScene-6IKIGGD7.js.gz +0 -0
- package/dist/{Bar3DChartScene-5GRGZFE4.mjs → Bar3DChartScene-RTHG6TVC.mjs} +1 -1
- package/dist/Bar3DChartScene-RTHG6TVC.mjs.br +0 -0
- package/dist/Bar3DChartScene-RTHG6TVC.mjs.gz +0 -0
- package/dist/{Line3DChartScene-6FUMMX2T.js → Line3DChartScene-HNNC2O66.js} +2 -2
- package/dist/Line3DChartScene-HNNC2O66.js.br +0 -0
- package/dist/Line3DChartScene-HNNC2O66.js.gz +0 -0
- package/dist/{Line3DChartScene-2VRLE5RI.mjs → Line3DChartScene-WQIUFVLB.mjs} +1 -1
- package/dist/Line3DChartScene-WQIUFVLB.mjs.br +0 -0
- package/dist/Line3DChartScene-WQIUFVLB.mjs.gz +0 -0
- package/dist/{Model3DScene-2MGI3CB6.js → Model3DScene-AAMDGTRI.js} +2 -2
- package/dist/Model3DScene-AAMDGTRI.js.br +0 -0
- package/dist/Model3DScene-AAMDGTRI.js.gz +0 -0
- package/dist/{Model3DScene-TCIKWJ7R.mjs → Model3DScene-BPHGVJQG.mjs} +1 -1
- package/dist/Model3DScene-BPHGVJQG.mjs.br +0 -0
- package/dist/Model3DScene-BPHGVJQG.mjs.gz +0 -0
- package/dist/{PieChart3DScene-OFZEEZRO.js → PieChart3DScene-LO6IJAWY.js} +2 -2
- package/dist/{PieChart3DScene-OFZEEZRO.js.br → PieChart3DScene-LO6IJAWY.js.br} +0 -0
- package/dist/PieChart3DScene-LO6IJAWY.js.gz +0 -0
- package/dist/{PieChart3DScene-O5NZKI4T.mjs → PieChart3DScene-S5OWDFJN.mjs} +1 -1
- package/dist/{PieChart3DScene-O5NZKI4T.mjs.br → PieChart3DScene-S5OWDFJN.mjs.br} +0 -0
- package/dist/PieChart3DScene-S5OWDFJN.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-WXPQGMT3.mjs → SurfaceChart3DScene-7CKYX5HW.mjs} +1 -1
- package/dist/SurfaceChart3DScene-7CKYX5HW.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-7CKYX5HW.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-EK7KFNUQ.js → SurfaceChart3DScene-FLQRXC6F.js} +2 -2
- package/dist/{SurfaceChart3DScene-EK7KFNUQ.js.br → SurfaceChart3DScene-FLQRXC6F.js.br} +0 -0
- package/dist/SurfaceChart3DScene-FLQRXC6F.js.gz +0 -0
- package/dist/{chunk-GQVOQPNT.mjs → chunk-2G2MMJRA.mjs} +12 -12
- package/dist/chunk-2G2MMJRA.mjs.br +0 -0
- package/dist/chunk-2G2MMJRA.mjs.gz +0 -0
- package/dist/{chunk-LDFWF2KT.js → chunk-3TPQY6WR.js} +249 -242
- package/dist/chunk-3TPQY6WR.js.br +0 -0
- package/dist/chunk-3TPQY6WR.js.gz +0 -0
- package/dist/{chunk-2J64KPXY.js → chunk-4CLG3TRU.js} +169 -179
- package/dist/chunk-4CLG3TRU.js.br +0 -0
- package/dist/chunk-4CLG3TRU.js.gz +0 -0
- package/dist/{chunk-2DZJJ3VO.mjs → chunk-4U3OI6J3.mjs} +248 -243
- package/dist/chunk-4U3OI6J3.mjs.br +0 -0
- package/dist/chunk-4U3OI6J3.mjs.gz +0 -0
- package/dist/{chunk-CPWFKDGB.js → chunk-AAVKRMQA.js} +1290 -1290
- package/dist/chunk-AAVKRMQA.js.br +0 -0
- package/dist/chunk-AAVKRMQA.js.gz +0 -0
- package/dist/{chunk-C553GQRH.js → chunk-CVS2CHLU.js} +5 -5
- package/dist/chunk-CVS2CHLU.js.br +0 -0
- package/dist/chunk-CVS2CHLU.js.gz +0 -0
- package/dist/{chunk-Q2EGTNCU.js → chunk-QMLJFL7G.js} +469 -463
- package/dist/chunk-QMLJFL7G.js.br +0 -0
- package/dist/chunk-QMLJFL7G.js.gz +0 -0
- package/dist/{chunk-UISMOSNU.mjs → chunk-VA2JFII4.mjs} +1 -1
- package/dist/chunk-VA2JFII4.mjs.br +0 -0
- package/dist/chunk-VA2JFII4.mjs.gz +0 -0
- package/dist/{chunk-BDQBJ3AM.mjs → chunk-VVAXSNG5.mjs} +22 -16
- package/dist/chunk-VVAXSNG5.mjs.br +0 -0
- package/dist/chunk-VVAXSNG5.mjs.gz +0 -0
- package/dist/{chunk-VK3ASDDP.mjs → chunk-WTPGQ3K7.mjs} +3 -13
- package/dist/chunk-WTPGQ3K7.mjs.br +0 -0
- package/dist/chunk-WTPGQ3K7.mjs.gz +0 -0
- package/dist/index.js +45 -45
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.js +26 -26
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-BUKJCMUY.js.br +0 -0
- package/dist/AiChatPanel-BUKJCMUY.js.gz +0 -0
- package/dist/AiChatPanel-US56QZBD.mjs.br +0 -0
- package/dist/AiChatPanel-US56QZBD.mjs.gz +0 -0
- package/dist/Area3DChartScene-6E4QEVTU.mjs.br +0 -0
- package/dist/Area3DChartScene-6E4QEVTU.mjs.gz +0 -0
- package/dist/Area3DChartScene-APGQOK5A.js.gz +0 -0
- package/dist/Bar3DChartScene-5GRGZFE4.mjs.br +0 -0
- package/dist/Bar3DChartScene-5GRGZFE4.mjs.gz +0 -0
- package/dist/Bar3DChartScene-F4B5TNJR.js.br +0 -0
- package/dist/Bar3DChartScene-F4B5TNJR.js.gz +0 -0
- package/dist/Line3DChartScene-2VRLE5RI.mjs.br +0 -0
- package/dist/Line3DChartScene-2VRLE5RI.mjs.gz +0 -0
- package/dist/Line3DChartScene-6FUMMX2T.js.br +0 -0
- package/dist/Line3DChartScene-6FUMMX2T.js.gz +0 -0
- package/dist/Model3DScene-2MGI3CB6.js.br +0 -0
- package/dist/Model3DScene-2MGI3CB6.js.gz +0 -0
- package/dist/Model3DScene-TCIKWJ7R.mjs.br +0 -0
- package/dist/Model3DScene-TCIKWJ7R.mjs.gz +0 -0
- package/dist/PieChart3DScene-O5NZKI4T.mjs.gz +0 -0
- package/dist/PieChart3DScene-OFZEEZRO.js.gz +0 -0
- package/dist/SurfaceChart3DScene-EK7KFNUQ.js.gz +0 -0
- package/dist/SurfaceChart3DScene-WXPQGMT3.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-WXPQGMT3.mjs.gz +0 -0
- package/dist/chunk-2DZJJ3VO.mjs.br +0 -0
- package/dist/chunk-2DZJJ3VO.mjs.gz +0 -0
- package/dist/chunk-2J64KPXY.js.br +0 -0
- package/dist/chunk-2J64KPXY.js.gz +0 -0
- package/dist/chunk-BDQBJ3AM.mjs.br +0 -0
- package/dist/chunk-BDQBJ3AM.mjs.gz +0 -0
- package/dist/chunk-C553GQRH.js.br +0 -0
- package/dist/chunk-C553GQRH.js.gz +0 -0
- package/dist/chunk-CPWFKDGB.js.br +0 -0
- package/dist/chunk-CPWFKDGB.js.gz +0 -0
- package/dist/chunk-GQVOQPNT.mjs.br +0 -0
- package/dist/chunk-GQVOQPNT.mjs.gz +0 -0
- package/dist/chunk-LDFWF2KT.js.br +0 -0
- package/dist/chunk-LDFWF2KT.js.gz +0 -0
- package/dist/chunk-Q2EGTNCU.js.br +0 -0
- package/dist/chunk-Q2EGTNCU.js.gz +0 -0
- package/dist/chunk-UISMOSNU.mjs.br +0 -0
- package/dist/chunk-UISMOSNU.mjs.gz +0 -0
- package/dist/chunk-VK3ASDDP.mjs.br +0 -0
- package/dist/chunk-VK3ASDDP.mjs.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk4CLG3TRU_js = require('./chunk-4CLG3TRU.js');
|
|
4
|
+
var chunk3TPQY6WR_js = require('./chunk-3TPQY6WR.js');
|
|
5
5
|
var chunk3AJ54EAB_js = require('./chunk-3AJ54EAB.js');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var reactI18next = require('react-i18next');
|
|
@@ -9,7 +9,7 @@ var reactI18next = require('react-i18next');
|
|
|
9
9
|
function useVirtualizedSlides({
|
|
10
10
|
totalItems,
|
|
11
11
|
itemHeight,
|
|
12
|
-
overscan =
|
|
12
|
+
overscan = chunk3TPQY6WR_js.DEFAULT_VIRTUAL_OVERSCAN
|
|
13
13
|
}) {
|
|
14
14
|
const scrollContainerRef = react.useRef(null);
|
|
15
15
|
const [scrollTop, setScrollTop] = react.useState(0);
|
|
@@ -39,7 +39,7 @@ function useVirtualizedSlides({
|
|
|
39
39
|
resizeObserver?.disconnect();
|
|
40
40
|
};
|
|
41
41
|
}, []);
|
|
42
|
-
const range =
|
|
42
|
+
const range = chunk3TPQY6WR_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
|
|
43
43
|
const safeItemHeight = Math.max(itemHeight, 1);
|
|
44
44
|
const scrollToIndex = react.useCallback(
|
|
45
45
|
(index, behavior = "smooth") => {
|
|
@@ -80,7 +80,7 @@ function usePresenceTracking({
|
|
|
80
80
|
}) {
|
|
81
81
|
const [remoteUsers, setRemoteUsers] = react.useState([]);
|
|
82
82
|
const projectorRef = react.useRef(null);
|
|
83
|
-
projectorRef.current ??=
|
|
83
|
+
projectorRef.current ??= chunk3TPQY6WR_js.createPresenceProjector();
|
|
84
84
|
const projector = projectorRef.current;
|
|
85
85
|
const lastBroadcastRef = react.useRef(0);
|
|
86
86
|
const pendingBroadcastRef = react.useRef(null);
|
|
@@ -105,7 +105,7 @@ function usePresenceTracking({
|
|
|
105
105
|
awareness.setLocalStateField("presence", state);
|
|
106
106
|
lastBroadcastRef.current = Date.now();
|
|
107
107
|
};
|
|
108
|
-
if (elapsed >=
|
|
108
|
+
if (elapsed >= chunk3TPQY6WR_js.BROADCAST_THROTTLE_MS) {
|
|
109
109
|
if (pendingBroadcastRef.current) {
|
|
110
110
|
clearTimeout(pendingBroadcastRef.current);
|
|
111
111
|
pendingBroadcastRef.current = null;
|
|
@@ -115,7 +115,7 @@ function usePresenceTracking({
|
|
|
115
115
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
116
116
|
pendingBroadcastRef.current = null;
|
|
117
117
|
flush();
|
|
118
|
-
},
|
|
118
|
+
}, chunk3TPQY6WR_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -195,7 +195,7 @@ function useYjsProvider({ config }) {
|
|
|
195
195
|
const departureRef = react.useRef(null);
|
|
196
196
|
const gateRef = react.useRef(null);
|
|
197
197
|
if (!gateRef.current) {
|
|
198
|
-
gateRef.current =
|
|
198
|
+
gateRef.current = chunk3TPQY6WR_js.createSyncGate(() => setSynced(true));
|
|
199
199
|
}
|
|
200
200
|
const teardown = react.useCallback(() => {
|
|
201
201
|
if (timeoutRef.current) {
|
|
@@ -215,7 +215,7 @@ function useYjsProvider({ config }) {
|
|
|
215
215
|
const buildCleanup = react.useCallback(
|
|
216
216
|
(provider, yDoc) => () => {
|
|
217
217
|
announceDeparture();
|
|
218
|
-
|
|
218
|
+
chunk3TPQY6WR_js.clearLocalAwareness(provider.awareness);
|
|
219
219
|
provider.destroy();
|
|
220
220
|
yDoc.destroy();
|
|
221
221
|
setDoc(null);
|
|
@@ -240,9 +240,9 @@ function useYjsProvider({ config }) {
|
|
|
240
240
|
if (config.authToken) {
|
|
241
241
|
opts.password = config.authToken;
|
|
242
242
|
}
|
|
243
|
-
const roomId =
|
|
243
|
+
const roomId = chunk3TPQY6WR_js.validateRoomId(config.roomId);
|
|
244
244
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
245
|
-
departureRef.current =
|
|
245
|
+
departureRef.current = chunk3TPQY6WR_js.createDepartureChannel(roomId, provider.awareness);
|
|
246
246
|
setDoc(yDoc);
|
|
247
247
|
setAwareness(provider.awareness);
|
|
248
248
|
setClientId(provider.awareness.clientID);
|
|
@@ -284,13 +284,13 @@ function useYjsProvider({ config }) {
|
|
|
284
284
|
if (!config) {
|
|
285
285
|
return;
|
|
286
286
|
}
|
|
287
|
-
const roomId =
|
|
288
|
-
const transport = config.transport ??
|
|
287
|
+
const roomId = chunk3TPQY6WR_js.validateRoomId(config.roomId);
|
|
288
|
+
const transport = config.transport ?? chunk3TPQY6WR_js.resolveTransportForServerUrl(config.serverUrl);
|
|
289
289
|
if (transport === "webrtc") {
|
|
290
290
|
await initWebrtc();
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
293
|
+
if (chunk3TPQY6WR_js.isMixedContentBlocked(config.serverUrl)) {
|
|
294
294
|
console.warn(
|
|
295
295
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
296
296
|
);
|
|
@@ -304,7 +304,7 @@ function useYjsProvider({ config }) {
|
|
|
304
304
|
const provider = new WebsocketProvider(config.serverUrl, roomId, yDoc, {
|
|
305
305
|
params: config.authToken ? { token: config.authToken } : void 0
|
|
306
306
|
});
|
|
307
|
-
departureRef.current =
|
|
307
|
+
departureRef.current = chunk3TPQY6WR_js.createDepartureChannel(roomId, provider.awareness);
|
|
308
308
|
let connected = false;
|
|
309
309
|
const handleStatus = (event) => {
|
|
310
310
|
if (event.status === "connected") {
|
|
@@ -344,7 +344,7 @@ function useYjsProvider({ config }) {
|
|
|
344
344
|
provider.off("status", handleStatus);
|
|
345
345
|
provider.off("sync", handleSynced);
|
|
346
346
|
announceDeparture();
|
|
347
|
-
|
|
347
|
+
chunk3TPQY6WR_js.clearLocalAwareness(provider.awareness);
|
|
348
348
|
provider.destroy();
|
|
349
349
|
yDoc.destroy();
|
|
350
350
|
setDoc(null);
|
|
@@ -353,7 +353,7 @@ function useYjsProvider({ config }) {
|
|
|
353
353
|
cleanupRef.current = null;
|
|
354
354
|
setStatus("error");
|
|
355
355
|
}
|
|
356
|
-
},
|
|
356
|
+
}, chunk3TPQY6WR_js.CONNECTION_TIMEOUT_MS);
|
|
357
357
|
}
|
|
358
358
|
setDoc(yDoc);
|
|
359
359
|
setAwareness(provider.awareness);
|
|
@@ -362,7 +362,7 @@ function useYjsProvider({ config }) {
|
|
|
362
362
|
provider.off("status", handleStatus);
|
|
363
363
|
provider.off("sync", handleSynced);
|
|
364
364
|
announceDeparture();
|
|
365
|
-
|
|
365
|
+
chunk3TPQY6WR_js.clearLocalAwareness(provider.awareness);
|
|
366
366
|
provider.destroy();
|
|
367
367
|
yDoc.destroy();
|
|
368
368
|
setDoc(null);
|
|
@@ -388,7 +388,7 @@ function useYjsProvider({ config }) {
|
|
|
388
388
|
]);
|
|
389
389
|
react.useEffect(() => {
|
|
390
390
|
init();
|
|
391
|
-
const disposeTeardown =
|
|
391
|
+
const disposeTeardown = chunk3TPQY6WR_js.registerCollaborationTeardown({
|
|
392
392
|
leave: teardown,
|
|
393
393
|
rejoin: init
|
|
394
394
|
});
|
|
@@ -409,7 +409,7 @@ function useCollaborativeState({
|
|
|
409
409
|
canvasWidth,
|
|
410
410
|
canvasHeight
|
|
411
411
|
}) {
|
|
412
|
-
const userColor =
|
|
412
|
+
const userColor = chunk3TPQY6WR_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
413
413
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
414
414
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
415
415
|
awareness,
|
|
@@ -527,8 +527,8 @@ function useEditorHistory(input) {
|
|
|
527
527
|
width: canvasSize.width,
|
|
528
528
|
height: canvasSize.height,
|
|
529
529
|
activeSlideIndex,
|
|
530
|
-
slides: slides.map(
|
|
531
|
-
templateElementsBySlideId:
|
|
530
|
+
slides: slides.map(chunk3TPQY6WR_js.cloneSlide),
|
|
531
|
+
templateElementsBySlideId: chunk3TPQY6WR_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
532
532
|
...actionLabel ? { actionLabel } : {}
|
|
533
533
|
};
|
|
534
534
|
},
|
|
@@ -541,9 +541,9 @@ function useEditorHistory(input) {
|
|
|
541
541
|
width: snapshot.width,
|
|
542
542
|
height: snapshot.height
|
|
543
543
|
});
|
|
544
|
-
setSlides(snapshot.slides.map(
|
|
544
|
+
setSlides(snapshot.slides.map(chunk3TPQY6WR_js.cloneSlide));
|
|
545
545
|
setTemplateElementsBySlideId(
|
|
546
|
-
|
|
546
|
+
chunk3TPQY6WR_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
547
547
|
);
|
|
548
548
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
549
549
|
setSelectedElementIds([]);
|
|
@@ -582,8 +582,8 @@ function useEditorHistory(input) {
|
|
|
582
582
|
const currentSnapshot = buildHistorySnapshot();
|
|
583
583
|
historyFutureRef.current.push(currentSnapshot);
|
|
584
584
|
isApplyingHistoryRef.current = true;
|
|
585
|
-
const nextSnapshot =
|
|
586
|
-
lastHistorySnapshotRef.current =
|
|
585
|
+
const nextSnapshot = chunk4CLG3TRU_js.cloneHistorySnapshot(previousSnapshot);
|
|
586
|
+
lastHistorySnapshotRef.current = chunk4CLG3TRU_js.cloneHistorySnapshot(nextSnapshot);
|
|
587
587
|
lastHistorySerializedRef.current = serializeDocument(nextSnapshot);
|
|
588
588
|
applyHistorySnapshot(nextSnapshot);
|
|
589
589
|
updateHistoryAvailability();
|
|
@@ -604,8 +604,8 @@ function useEditorHistory(input) {
|
|
|
604
604
|
const currentSnapshot = buildHistorySnapshot();
|
|
605
605
|
historyPastRef.current.push(currentSnapshot);
|
|
606
606
|
isApplyingHistoryRef.current = true;
|
|
607
|
-
const targetSnapshot =
|
|
608
|
-
lastHistorySnapshotRef.current =
|
|
607
|
+
const targetSnapshot = chunk4CLG3TRU_js.cloneHistorySnapshot(nextSnapshot);
|
|
608
|
+
lastHistorySnapshotRef.current = chunk4CLG3TRU_js.cloneHistorySnapshot(targetSnapshot);
|
|
609
609
|
lastHistorySerializedRef.current = serializeDocument(targetSnapshot);
|
|
610
610
|
applyHistorySnapshot(targetSnapshot);
|
|
611
611
|
updateHistoryAvailability();
|
|
@@ -623,7 +623,7 @@ function useEditorHistory(input) {
|
|
|
623
623
|
historyPastRef.current = [];
|
|
624
624
|
historyFutureRef.current = [];
|
|
625
625
|
if (initialSnapshot) {
|
|
626
|
-
const clonedInitial =
|
|
626
|
+
const clonedInitial = chunk4CLG3TRU_js.cloneHistorySnapshot(initialSnapshot);
|
|
627
627
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
628
628
|
lastHistorySerializedRef.current = serializeDocument(clonedInitial);
|
|
629
629
|
} else {
|
|
@@ -671,19 +671,19 @@ function useEditorHistory(input) {
|
|
|
671
671
|
}
|
|
672
672
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
673
673
|
if (!previousSnapshot) {
|
|
674
|
-
lastHistorySnapshotRef.current =
|
|
674
|
+
lastHistorySnapshotRef.current = chunk4CLG3TRU_js.cloneHistorySnapshot(snapshot);
|
|
675
675
|
lastHistorySerializedRef.current = serialized;
|
|
676
676
|
lastCheapHashRef.current = cheapHash;
|
|
677
677
|
updateHistoryAvailability();
|
|
678
678
|
return;
|
|
679
679
|
}
|
|
680
680
|
onDirtyRef.current?.();
|
|
681
|
-
historyPastRef.current.push(
|
|
681
|
+
historyPastRef.current.push(chunk4CLG3TRU_js.cloneHistorySnapshot(previousSnapshot));
|
|
682
682
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
683
683
|
historyPastRef.current.shift();
|
|
684
684
|
}
|
|
685
685
|
historyFutureRef.current = [];
|
|
686
|
-
lastHistorySnapshotRef.current =
|
|
686
|
+
lastHistorySnapshotRef.current = chunk4CLG3TRU_js.cloneHistorySnapshot(snapshot);
|
|
687
687
|
lastHistorySerializedRef.current = serialized;
|
|
688
688
|
lastCheapHashRef.current = cheapHash;
|
|
689
689
|
updateHistoryAvailability();
|
|
@@ -743,9 +743,9 @@ function useZoomViewport({
|
|
|
743
743
|
const canvasStageRef = react.useRef(null);
|
|
744
744
|
const canvasViewportRef = react.useRef(null);
|
|
745
745
|
const renderScaleRef = react.useRef(1);
|
|
746
|
-
const wheelBufferRef = react.useRef(
|
|
746
|
+
const wheelBufferRef = react.useRef(chunk3TPQY6WR_js.createWheelStepBuffer());
|
|
747
747
|
const storeRef = react.useRef(null);
|
|
748
|
-
storeRef.current ??=
|
|
748
|
+
storeRef.current ??= chunk3TPQY6WR_js.createViewerZoomStore();
|
|
749
749
|
const store = storeRef.current;
|
|
750
750
|
const scale = useViewerStore(store, selectZoom);
|
|
751
751
|
const setScale = react.useCallback(
|
|
@@ -806,7 +806,7 @@ function useZoomViewport({
|
|
|
806
806
|
if (!wrapper || !canvasViewport) {
|
|
807
807
|
return;
|
|
808
808
|
}
|
|
809
|
-
const boundedScale =
|
|
809
|
+
const boundedScale = chunk3TPQY6WR_js.clampZoomScale(nextScale);
|
|
810
810
|
const nextEditorScale = fitScale * boundedScale;
|
|
811
811
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
812
812
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -843,29 +843,29 @@ function useZoomViewport({
|
|
|
843
843
|
selectedElements.forEach((element) => {
|
|
844
844
|
minX = Math.min(minX, element.x);
|
|
845
845
|
minY = Math.min(minY, element.y);
|
|
846
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
847
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
846
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunk4CLG3TRU_js.MIN_ELEMENT_SIZE));
|
|
847
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunk4CLG3TRU_js.MIN_ELEMENT_SIZE));
|
|
848
848
|
});
|
|
849
849
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
850
850
|
return;
|
|
851
851
|
}
|
|
852
852
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
853
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
854
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
853
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunk4CLG3TRU_js.MIN_ELEMENT_SIZE);
|
|
854
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunk4CLG3TRU_js.MIN_ELEMENT_SIZE);
|
|
855
855
|
const availableWidth = Math.max(
|
|
856
|
-
effectiveEditorDimensions.width -
|
|
857
|
-
|
|
856
|
+
effectiveEditorDimensions.width - chunk4CLG3TRU_js.ZOOM_TO_SELECTION_PADDING,
|
|
857
|
+
chunk4CLG3TRU_js.MIN_ELEMENT_SIZE
|
|
858
858
|
);
|
|
859
859
|
const availableHeight = Math.max(
|
|
860
|
-
effectiveEditorDimensions.height -
|
|
861
|
-
|
|
860
|
+
effectiveEditorDimensions.height - chunk4CLG3TRU_js.ZOOM_TO_SELECTION_PADDING,
|
|
861
|
+
chunk4CLG3TRU_js.MIN_ELEMENT_SIZE
|
|
862
862
|
);
|
|
863
863
|
const targetEditorScale = Math.min(
|
|
864
864
|
availableWidth / boundsWidth,
|
|
865
865
|
availableHeight / boundsHeight
|
|
866
866
|
);
|
|
867
867
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
868
|
-
const nextScale =
|
|
868
|
+
const nextScale = chunk3TPQY6WR_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
869
869
|
setScale(nextScale);
|
|
870
870
|
window.requestAnimationFrame(() => {
|
|
871
871
|
window.requestAnimationFrame(() => {
|
|
@@ -882,14 +882,14 @@ function useZoomViewport({
|
|
|
882
882
|
]);
|
|
883
883
|
const handleWheel = react.useCallback(
|
|
884
884
|
(event) => {
|
|
885
|
-
const mapped =
|
|
885
|
+
const mapped = chunk3TPQY6WR_js.mapEditingWheel(event, wheelBufferRef.current, true);
|
|
886
886
|
if (mapped.intent !== "zoom") {
|
|
887
887
|
return;
|
|
888
888
|
}
|
|
889
889
|
event.preventDefault();
|
|
890
890
|
store.dispatch({
|
|
891
891
|
type: "set-zoom",
|
|
892
|
-
zoom:
|
|
892
|
+
zoom: chunk3TPQY6WR_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
|
|
893
893
|
});
|
|
894
894
|
},
|
|
895
895
|
[store]
|
|
@@ -984,8 +984,8 @@ function scheduleOpeningAutoPlayGroup(controller, ctx) {
|
|
|
984
984
|
if (!group) {
|
|
985
985
|
return;
|
|
986
986
|
}
|
|
987
|
-
|
|
988
|
-
|
|
987
|
+
chunk3TPQY6WR_js.playGroup(controller, group, ctx);
|
|
988
|
+
chunk3TPQY6WR_js.scheduleAutoAdvanceChain(controller, ctx);
|
|
989
989
|
}, firstGroup.autoAdvanceDelayMs ?? 0);
|
|
990
990
|
ctx.timers.push(timer);
|
|
991
991
|
}
|
|
@@ -1004,7 +1004,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1004
1004
|
}))
|
|
1005
1005
|
);
|
|
1006
1006
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1007
|
-
const delay =
|
|
1007
|
+
const delay = chunk3TPQY6WR_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1008
1008
|
const timer = window.setTimeout(() => {
|
|
1009
1009
|
setPresentationAnimations(
|
|
1010
1010
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1037,7 +1037,7 @@ function useAnimationPlayback(input) {
|
|
|
1037
1037
|
const presentationTimersRef = react.useRef([]);
|
|
1038
1038
|
const controllerRef = react.useRef(null);
|
|
1039
1039
|
const buildRafRef = react.useRef(null);
|
|
1040
|
-
const activeAnimationGroupRef = react.useRef(
|
|
1040
|
+
const activeAnimationGroupRef = react.useRef(chunk3TPQY6WR_js.createActiveAnimationGroup());
|
|
1041
1041
|
const seededCompletedRef = react.useRef(false);
|
|
1042
1042
|
const mediaTimeNodeElementIdsRef = react.useRef(/* @__PURE__ */ new Map());
|
|
1043
1043
|
const lastSeedCompletedRef = react.useRef(false);
|
|
@@ -1054,15 +1054,15 @@ function useAnimationPlayback(input) {
|
|
|
1054
1054
|
}, [onPlayActionSound]);
|
|
1055
1055
|
react.useEffect(() => {
|
|
1056
1056
|
return () => {
|
|
1057
|
-
|
|
1057
|
+
chunk3TPQY6WR_js.cancelBuildReveal(buildRafRef);
|
|
1058
1058
|
};
|
|
1059
1059
|
}, []);
|
|
1060
1060
|
const clearPresentationTimers = react.useCallback(() => {
|
|
1061
|
-
|
|
1061
|
+
chunk3TPQY6WR_js.clearPlaybackTimers(buildPlaybackContext(), activeAnimationGroupRef.current);
|
|
1062
1062
|
}, [buildPlaybackContext]);
|
|
1063
1063
|
const resetSlideTimeline = react.useCallback(
|
|
1064
1064
|
(slideIndex) => {
|
|
1065
|
-
|
|
1065
|
+
chunk3TPQY6WR_js.cancelBuildReveal(buildRafRef);
|
|
1066
1066
|
const slide = slides[slideIndex];
|
|
1067
1067
|
if (!slide) {
|
|
1068
1068
|
controllerRef.current = null;
|
|
@@ -1073,14 +1073,14 @@ function useAnimationPlayback(input) {
|
|
|
1073
1073
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1074
1074
|
return;
|
|
1075
1075
|
}
|
|
1076
|
-
const controller =
|
|
1076
|
+
const controller = chunk3TPQY6WR_js.PresentationAnimationController.fromSlide(slide, {
|
|
1077
1077
|
slideHeightPx: canvasSize?.height,
|
|
1078
1078
|
slideWidthPx: canvasSize?.width,
|
|
1079
1079
|
themeColorMap,
|
|
1080
1080
|
pixelateMosaic: pixelateMosaicAnimation
|
|
1081
1081
|
});
|
|
1082
1082
|
controllerRef.current = controller;
|
|
1083
|
-
mediaTimeNodeElementIdsRef.current =
|
|
1083
|
+
mediaTimeNodeElementIdsRef.current = chunk3TPQY6WR_js.resolveMediaTimeNodeElementIds(
|
|
1084
1084
|
slide.nativeAnimations ?? []
|
|
1085
1085
|
);
|
|
1086
1086
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
@@ -1094,7 +1094,7 @@ function useAnimationPlayback(input) {
|
|
|
1094
1094
|
if (!animationsEnabled) {
|
|
1095
1095
|
return false;
|
|
1096
1096
|
}
|
|
1097
|
-
return
|
|
1097
|
+
return chunk3TPQY6WR_js.advanceMainSequence(
|
|
1098
1098
|
controllerRef.current,
|
|
1099
1099
|
buildPlaybackContext(),
|
|
1100
1100
|
activeAnimationGroupRef.current
|
|
@@ -1110,7 +1110,7 @@ function useAnimationPlayback(input) {
|
|
|
1110
1110
|
if (!group) {
|
|
1111
1111
|
return false;
|
|
1112
1112
|
}
|
|
1113
|
-
|
|
1113
|
+
chunk3TPQY6WR_js.playGroup(controller, group, buildPlaybackContext());
|
|
1114
1114
|
return true;
|
|
1115
1115
|
},
|
|
1116
1116
|
[buildPlaybackContext]
|
|
@@ -1129,7 +1129,7 @@ function useAnimationPlayback(input) {
|
|
|
1129
1129
|
if (!group) {
|
|
1130
1130
|
return false;
|
|
1131
1131
|
}
|
|
1132
|
-
|
|
1132
|
+
chunk3TPQY6WR_js.playGroup(controller, group, buildPlaybackContext());
|
|
1133
1133
|
return true;
|
|
1134
1134
|
},
|
|
1135
1135
|
[animationsEnabled, buildPlaybackContext]
|
|
@@ -1210,12 +1210,12 @@ function useAnimationPlayback(input) {
|
|
|
1210
1210
|
presentationTimersRef
|
|
1211
1211
|
};
|
|
1212
1212
|
}
|
|
1213
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1214
|
-
var AUDIENCE_HASH =
|
|
1215
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1216
|
-
var AUDIENCE_NONCE_KEY =
|
|
1213
|
+
var PRESENTER_CHANNEL_NAME = chunk3TPQY6WR_js.PRESENTATION_CHANNEL_NAME;
|
|
1214
|
+
var AUDIENCE_HASH = chunk3TPQY6WR_js.PRESENTATION_HASH;
|
|
1215
|
+
var PRESENTER_MSG_ORIGIN = chunk3TPQY6WR_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1216
|
+
var AUDIENCE_NONCE_KEY = chunk3TPQY6WR_js.PRESENTATION_NONCE_KEY;
|
|
1217
1217
|
function generateSessionId() {
|
|
1218
|
-
return
|
|
1218
|
+
return chunk3TPQY6WR_js.createPresentationSessionId();
|
|
1219
1219
|
}
|
|
1220
1220
|
function parseAudienceNonce() {
|
|
1221
1221
|
const hash = window.location.hash;
|
|
@@ -1251,7 +1251,7 @@ function usePresenterWindow(input) {
|
|
|
1251
1251
|
}, []);
|
|
1252
1252
|
const swapDisplays = react.useCallback(async () => {
|
|
1253
1253
|
const audience = audienceWindowRef.current;
|
|
1254
|
-
return audience && !audience.closed ?
|
|
1254
|
+
return audience && !audience.closed ? chunk3TPQY6WR_js.swapPresentationWindows(window, audience) : false;
|
|
1255
1255
|
}, []);
|
|
1256
1256
|
const syncSlideToAudience = react.useCallback(
|
|
1257
1257
|
(slideIndex) => {
|
|
@@ -1315,7 +1315,7 @@ function usePresenterWindow(input) {
|
|
|
1315
1315
|
pollTimerRef.current = null;
|
|
1316
1316
|
}
|
|
1317
1317
|
if (closingSessionId) {
|
|
1318
|
-
void
|
|
1318
|
+
void chunk3TPQY6WR_js.clearAudienceContent(closingSessionId);
|
|
1319
1319
|
}
|
|
1320
1320
|
}, [getChannel]);
|
|
1321
1321
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1333,10 +1333,10 @@ function usePresenterWindow(input) {
|
|
|
1333
1333
|
audienceWindowRef.current = blankWin;
|
|
1334
1334
|
const sessionId = generateSessionId();
|
|
1335
1335
|
sessionIdRef.current = sessionId;
|
|
1336
|
-
const audienceUrl =
|
|
1337
|
-
void
|
|
1336
|
+
const audienceUrl = chunk3TPQY6WR_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1337
|
+
void chunk3TPQY6WR_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1338
1338
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1339
|
-
|
|
1339
|
+
chunk3TPQY6WR_js.placeAudienceWindow(blankWin, placement);
|
|
1340
1340
|
}
|
|
1341
1341
|
return void 0;
|
|
1342
1342
|
});
|
|
@@ -1366,7 +1366,7 @@ function usePresenterWindow(input) {
|
|
|
1366
1366
|
}
|
|
1367
1367
|
};
|
|
1368
1368
|
if (content) {
|
|
1369
|
-
void
|
|
1369
|
+
void chunk3TPQY6WR_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1370
1370
|
} else {
|
|
1371
1371
|
navigateOrClose(true);
|
|
1372
1372
|
}
|
|
@@ -1392,7 +1392,7 @@ function usePresenterWindow(input) {
|
|
|
1392
1392
|
}
|
|
1393
1393
|
const handleMessage = (event) => {
|
|
1394
1394
|
const message = event.data;
|
|
1395
|
-
if (
|
|
1395
|
+
if (chunk3TPQY6WR_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1396
1396
|
syncStateToAudience(snapshotRef.current);
|
|
1397
1397
|
}
|
|
1398
1398
|
};
|
|
@@ -1421,7 +1421,7 @@ function usePresenterWindow(input) {
|
|
|
1421
1421
|
react.useEffect(() => {
|
|
1422
1422
|
const handleBeforeUnload = () => {
|
|
1423
1423
|
if (sessionIdRef.current) {
|
|
1424
|
-
void
|
|
1424
|
+
void chunk3TPQY6WR_js.clearAudienceContent(sessionIdRef.current);
|
|
1425
1425
|
}
|
|
1426
1426
|
};
|
|
1427
1427
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1483,7 +1483,7 @@ function useAudienceMode(input) {
|
|
|
1483
1483
|
}
|
|
1484
1484
|
channel.onmessage = (event) => {
|
|
1485
1485
|
const data = event.data;
|
|
1486
|
-
if (!
|
|
1486
|
+
if (!chunk3TPQY6WR_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1487
1487
|
return;
|
|
1488
1488
|
}
|
|
1489
1489
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1499,16 +1499,16 @@ function useAudienceMode(input) {
|
|
|
1499
1499
|
}
|
|
1500
1500
|
if (data.type === "presenter-exit") {
|
|
1501
1501
|
if (expectedSessionId) {
|
|
1502
|
-
void
|
|
1502
|
+
void chunk3TPQY6WR_js.clearAudienceContent(expectedSessionId);
|
|
1503
1503
|
}
|
|
1504
|
-
if (
|
|
1504
|
+
if (chunk3TPQY6WR_js.endAudienceDisplay(window)) {
|
|
1505
1505
|
handlers.onPresenterEnded?.();
|
|
1506
1506
|
}
|
|
1507
1507
|
}
|
|
1508
1508
|
};
|
|
1509
1509
|
if (expectedSessionId) {
|
|
1510
1510
|
channel.postMessage({
|
|
1511
|
-
origin:
|
|
1511
|
+
origin: chunk3TPQY6WR_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1512
1512
|
type: "audience-ready",
|
|
1513
1513
|
sessionId: expectedSessionId
|
|
1514
1514
|
});
|
|
@@ -1522,7 +1522,7 @@ function useAudienceMode(input) {
|
|
|
1522
1522
|
}, []);
|
|
1523
1523
|
}
|
|
1524
1524
|
function usePresentationKeyboard(input) {
|
|
1525
|
-
const wheelBufferRef = react.useRef(
|
|
1525
|
+
const wheelBufferRef = react.useRef(chunk3TPQY6WR_js.createWheelStepBuffer());
|
|
1526
1526
|
const {
|
|
1527
1527
|
mode,
|
|
1528
1528
|
movePresentationSlide,
|
|
@@ -1543,14 +1543,14 @@ function usePresentationKeyboard(input) {
|
|
|
1543
1543
|
presentationSlideIndex,
|
|
1544
1544
|
setShowRehearsalSummary
|
|
1545
1545
|
} = input;
|
|
1546
|
-
const keyBufferRef = react.useRef(
|
|
1546
|
+
const keyBufferRef = react.useRef(chunk3TPQY6WR_js.createPresentationKeyBuffer());
|
|
1547
1547
|
react.useEffect(() => {
|
|
1548
|
-
if (mode !== "present" || !
|
|
1549
|
-
keyBufferRef.current =
|
|
1548
|
+
if (mode !== "present" || !chunk3TPQY6WR_js.acceptsPresentationInput()) {
|
|
1549
|
+
keyBufferRef.current = chunk3TPQY6WR_js.createPresentationKeyBuffer();
|
|
1550
1550
|
return;
|
|
1551
1551
|
}
|
|
1552
1552
|
const handleKeyDown = (event) => {
|
|
1553
|
-
const mapped =
|
|
1553
|
+
const mapped = chunk3TPQY6WR_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1554
1554
|
if (mapped.action === "none") {
|
|
1555
1555
|
return;
|
|
1556
1556
|
}
|
|
@@ -1570,12 +1570,12 @@ function usePresentationKeyboard(input) {
|
|
|
1570
1570
|
movePresentationSlide(-1);
|
|
1571
1571
|
return;
|
|
1572
1572
|
case "first": {
|
|
1573
|
-
const first =
|
|
1573
|
+
const first = chunk3TPQY6WR_js.firstShowSlideIndex(showSlideIndexes);
|
|
1574
1574
|
navigateToSlide(first ?? 0);
|
|
1575
1575
|
return;
|
|
1576
1576
|
}
|
|
1577
1577
|
case "last": {
|
|
1578
|
-
const last =
|
|
1578
|
+
const last = chunk3TPQY6WR_js.lastShowSlideIndex(showSlideIndexes);
|
|
1579
1579
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1580
1580
|
return;
|
|
1581
1581
|
}
|
|
@@ -1613,10 +1613,10 @@ function usePresentationKeyboard(input) {
|
|
|
1613
1613
|
}
|
|
1614
1614
|
};
|
|
1615
1615
|
const handleWheel = (event) => {
|
|
1616
|
-
if (mode !== "present" || !
|
|
1616
|
+
if (mode !== "present" || !chunk3TPQY6WR_js.acceptsPresentationInput()) {
|
|
1617
1617
|
return;
|
|
1618
1618
|
}
|
|
1619
|
-
const mapped =
|
|
1619
|
+
const mapped = chunk3TPQY6WR_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1620
1620
|
if (mapped.intent === "next-slide") {
|
|
1621
1621
|
event.preventDefault();
|
|
1622
1622
|
movePresentationSlide(1);
|
|
@@ -1749,7 +1749,7 @@ function useRehearsalTimings(input) {
|
|
|
1749
1749
|
|
|
1750
1750
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1751
1751
|
function handlePresentationActionImpl(action, deps) {
|
|
1752
|
-
|
|
1752
|
+
chunk3TPQY6WR_js.runPresentationAction(
|
|
1753
1753
|
action,
|
|
1754
1754
|
{ slideCount: deps.slidesLength, ...deps.elementId ? { elementId: deps.elementId } : {} },
|
|
1755
1755
|
{
|
|
@@ -1778,13 +1778,13 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1778
1778
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1779
1779
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1780
1780
|
const transition = deps.reverse ? deps.slides[deps.currentSlideIndex]?.transition : incomingSlide?.transition;
|
|
1781
|
-
const durationMs = deps.playTransition ?
|
|
1781
|
+
const durationMs = deps.playTransition ? chunk3TPQY6WR_js.resolveTransitionDurationMs(transition) : 0;
|
|
1782
1782
|
deps.clearPresentationTimers();
|
|
1783
1783
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1784
1784
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
1785
1785
|
deps.setPresentationSlideVisible(true);
|
|
1786
1786
|
deps.seedSlideAnimations(nextSlideIndex, { completed: deps.seedCompleted });
|
|
1787
|
-
const soundAction =
|
|
1787
|
+
const soundAction = chunk3TPQY6WR_js.resolveTransitionSoundAction(transition);
|
|
1788
1788
|
if (soundAction.kind === "play" && deps.onPlayActionSound) {
|
|
1789
1789
|
deps.onPlayActionSound(soundAction.soundPath, { loop: soundAction.loop });
|
|
1790
1790
|
} else if (soundAction.kind === "stop" && deps.onStopActionSound) {
|
|
@@ -1848,7 +1848,7 @@ function useSlideNavigation(input) {
|
|
|
1848
1848
|
});
|
|
1849
1849
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1850
1850
|
(slideIndex) => {
|
|
1851
|
-
const delayMs =
|
|
1851
|
+
const delayMs = chunk3TPQY6WR_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1852
1852
|
if (delayMs === void 0) {
|
|
1853
1853
|
return;
|
|
1854
1854
|
}
|
|
@@ -1871,7 +1871,7 @@ function useSlideNavigation(input) {
|
|
|
1871
1871
|
if (availableSlideIndexes.length === 0) {
|
|
1872
1872
|
return;
|
|
1873
1873
|
}
|
|
1874
|
-
const pastLastSlide = direction === 1 && !
|
|
1874
|
+
const pastLastSlide = direction === 1 && !chunk3TPQY6WR_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1875
1875
|
if (rehearsing && pastLastSlide) {
|
|
1876
1876
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1877
1877
|
try {
|
|
@@ -1889,9 +1889,9 @@ function useSlideNavigation(input) {
|
|
|
1889
1889
|
onAdvancePastLastSlide();
|
|
1890
1890
|
return;
|
|
1891
1891
|
}
|
|
1892
|
-
const nextSlideIndex = direction === 1 ?
|
|
1892
|
+
const nextSlideIndex = direction === 1 ? chunk3TPQY6WR_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1893
1893
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
1894
|
-
}) :
|
|
1894
|
+
}) : chunk3TPQY6WR_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
1895
1895
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
1896
1896
|
return;
|
|
1897
1897
|
}
|
|
@@ -2072,7 +2072,7 @@ function createCustomShowRunner(deps) {
|
|
|
2072
2072
|
return;
|
|
2073
2073
|
}
|
|
2074
2074
|
origin = returnAfter ? { showId: deps.getActiveCustomShowId(), slideIndex: deps.getPresentationSlideIndex() } : null;
|
|
2075
|
-
const first =
|
|
2075
|
+
const first = chunk3TPQY6WR_js.firstShowSlideIndex(chunk3TPQY6WR_js.resolveShowSlideIndexes(deps.getSlides(), target));
|
|
2076
2076
|
deps.setActiveCustomShowId(customShowId);
|
|
2077
2077
|
if (first !== void 0) {
|
|
2078
2078
|
deps.navigateToSlide(first);
|
|
@@ -2150,33 +2150,33 @@ function usePresentationActionExtensions(input) {
|
|
|
2150
2150
|
}
|
|
2151
2151
|
}, [navigateToSlideViaRef]);
|
|
2152
2152
|
const onOpenFile = react.useCallback((target) => {
|
|
2153
|
-
|
|
2153
|
+
chunk3TPQY6WR_js.safeOpenUrl(target);
|
|
2154
2154
|
}, []);
|
|
2155
2155
|
const onOpenPresentation = react.useCallback((target) => {
|
|
2156
|
-
|
|
2156
|
+
chunk3TPQY6WR_js.safeOpenUrl(target);
|
|
2157
2157
|
}, []);
|
|
2158
2158
|
const onRunProgram = react.useCallback(
|
|
2159
2159
|
(target) => {
|
|
2160
|
-
onAddRunProgramNotice?.(
|
|
2160
|
+
onAddRunProgramNotice?.(chunk3TPQY6WR_js.buildRunProgramNotice(target));
|
|
2161
2161
|
},
|
|
2162
2162
|
[onAddRunProgramNotice]
|
|
2163
2163
|
);
|
|
2164
2164
|
const onPlayMedia = react.useCallback(
|
|
2165
2165
|
(elementId) => {
|
|
2166
|
-
|
|
2166
|
+
chunk3TPQY6WR_js.toggleStageElementMedia(containerRef.current, elementId);
|
|
2167
2167
|
},
|
|
2168
2168
|
[containerRef]
|
|
2169
2169
|
);
|
|
2170
2170
|
const onOleVerb = react.useCallback(
|
|
2171
2171
|
(verb, elementId) => {
|
|
2172
|
-
const target =
|
|
2172
|
+
const target = chunk3TPQY6WR_js.resolveOleVerbTarget(slides[presentationSlideIndex], elementId, verb);
|
|
2173
2173
|
if (!target) {
|
|
2174
2174
|
return;
|
|
2175
2175
|
}
|
|
2176
2176
|
if (target.action === "download") {
|
|
2177
|
-
|
|
2177
|
+
chunk3TPQY6WR_js.downloadDataUrl(target.url, target.fileName ?? "download");
|
|
2178
2178
|
} else {
|
|
2179
|
-
|
|
2179
|
+
chunk3TPQY6WR_js.openUrlInNewTab(target.url);
|
|
2180
2180
|
}
|
|
2181
2181
|
},
|
|
2182
2182
|
[slides, presentationSlideIndex]
|
|
@@ -2207,22 +2207,22 @@ function usePresentationActionExtensions(input) {
|
|
|
2207
2207
|
};
|
|
2208
2208
|
}
|
|
2209
2209
|
function usePresenterConsole(slideIndex, active) {
|
|
2210
|
-
const timerRef = react.useRef(
|
|
2211
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2210
|
+
const timerRef = react.useRef(chunk3TPQY6WR_js.createPresenterTimer());
|
|
2211
|
+
const [snapshot, setSnapshot] = react.useState(() => chunk3TPQY6WR_js.createInitialPresentationSnapshot(slideIndex));
|
|
2212
2212
|
const patch = react.useCallback((value) => {
|
|
2213
|
-
setSnapshot((current) =>
|
|
2213
|
+
setSnapshot((current) => chunk3TPQY6WR_js.mergePresentationSnapshot(current, value));
|
|
2214
2214
|
}, []);
|
|
2215
2215
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2216
2216
|
react.useEffect(() => {
|
|
2217
2217
|
if (!active) {
|
|
2218
2218
|
return;
|
|
2219
2219
|
}
|
|
2220
|
-
timerRef.current =
|
|
2220
|
+
timerRef.current = chunk3TPQY6WR_js.resetPresenterTimer();
|
|
2221
2221
|
patch({ paused: false, elapsedMs: 0 });
|
|
2222
2222
|
const timer = window.setInterval(() => {
|
|
2223
2223
|
patch({
|
|
2224
2224
|
paused: timerRef.current.paused,
|
|
2225
|
-
elapsedMs:
|
|
2225
|
+
elapsedMs: chunk3TPQY6WR_js.presenterElapsed(timerRef.current)
|
|
2226
2226
|
});
|
|
2227
2227
|
}, 1e3);
|
|
2228
2228
|
return () => window.clearInterval(timer);
|
|
@@ -2232,19 +2232,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2232
2232
|
applyAudienceSnapshot: setSnapshot,
|
|
2233
2233
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2234
2234
|
toggleTimer: () => {
|
|
2235
|
-
timerRef.current =
|
|
2235
|
+
timerRef.current = chunk3TPQY6WR_js.togglePresenterTimer(timerRef.current);
|
|
2236
2236
|
patch({
|
|
2237
2237
|
paused: timerRef.current.paused,
|
|
2238
|
-
elapsedMs:
|
|
2238
|
+
elapsedMs: chunk3TPQY6WR_js.presenterElapsed(timerRef.current)
|
|
2239
2239
|
});
|
|
2240
2240
|
},
|
|
2241
2241
|
resetTimer: () => {
|
|
2242
|
-
timerRef.current =
|
|
2242
|
+
timerRef.current = chunk3TPQY6WR_js.resetPresenterTimer();
|
|
2243
2243
|
patch({ paused: false, elapsedMs: 0 });
|
|
2244
2244
|
},
|
|
2245
2245
|
stepZoom: (direction) => setSnapshot(
|
|
2246
|
-
(current) =>
|
|
2247
|
-
zoom:
|
|
2246
|
+
(current) => chunk3TPQY6WR_js.mergePresentationSnapshot(current, {
|
|
2247
|
+
zoom: chunk3TPQY6WR_js.stepPresenterZoom(
|
|
2248
2248
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2249
2249
|
direction
|
|
2250
2250
|
)
|
|
@@ -2299,7 +2299,7 @@ function usePresentationMode(input) {
|
|
|
2299
2299
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2300
2300
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2301
2301
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2302
|
-
const showGuard = react.useMemo(() =>
|
|
2302
|
+
const showGuard = react.useMemo(() => chunk3TPQY6WR_js.createPresenterShowGuard(), []);
|
|
2303
2303
|
const {
|
|
2304
2304
|
presentationAnimations,
|
|
2305
2305
|
presentationElementStates,
|
|
@@ -2399,7 +2399,7 @@ function usePresentationMode(input) {
|
|
|
2399
2399
|
actionExtensions.bindNavigateToSlide(navigateToSlide);
|
|
2400
2400
|
const movePresentationSlide = react.useCallback(
|
|
2401
2401
|
(direction, trigger = "explicit") => {
|
|
2402
|
-
if (!
|
|
2402
|
+
if (!chunk3TPQY6WR_js.acceptsPresentationInput()) {
|
|
2403
2403
|
return;
|
|
2404
2404
|
}
|
|
2405
2405
|
if (endOfShowVisible) {
|
|
@@ -2468,7 +2468,7 @@ function usePresentationMode(input) {
|
|
|
2468
2468
|
onSetMode("present");
|
|
2469
2469
|
}, [containerRef, onSetMode, setRehearsing]);
|
|
2470
2470
|
const enterPresentModeFromBeginning = react.useCallback(() => {
|
|
2471
|
-
const first =
|
|
2471
|
+
const first = chunk3TPQY6WR_js.firstShowSlideIndex(visibleSlideIndexes);
|
|
2472
2472
|
if (first !== void 0) {
|
|
2473
2473
|
onSetActiveSlideIndex(first);
|
|
2474
2474
|
}
|
|
@@ -2548,7 +2548,7 @@ function usePresentationMode(input) {
|
|
|
2548
2548
|
if (mode !== "present") {
|
|
2549
2549
|
return;
|
|
2550
2550
|
}
|
|
2551
|
-
return
|
|
2551
|
+
return chunk3TPQY6WR_js.attachPresentationVisibilityPause({
|
|
2552
2552
|
root: containerRef.current ?? void 0,
|
|
2553
2553
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2554
2554
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2556,7 +2556,7 @@ function usePresentationMode(input) {
|
|
|
2556
2556
|
}, [mode, containerRef]);
|
|
2557
2557
|
react.useLayoutEffect(() => {
|
|
2558
2558
|
if (mode === "present") {
|
|
2559
|
-
const idx =
|
|
2559
|
+
const idx = chunk3TPQY6WR_js.presentationEntrySlideIndex(
|
|
2560
2560
|
activeSlideIndexRef.current,
|
|
2561
2561
|
visibleSlideIndexesRef.current
|
|
2562
2562
|
);
|
|
@@ -2635,11 +2635,11 @@ function usePresentationMode(input) {
|
|
|
2635
2635
|
return void 0;
|
|
2636
2636
|
}
|
|
2637
2637
|
const incoming = slides[transitionOverlay.incomingSlideIndex];
|
|
2638
|
-
return
|
|
2638
|
+
return chunk3TPQY6WR_js.buildMorphTransitionPlan(
|
|
2639
2639
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2640
2640
|
incoming,
|
|
2641
2641
|
transitionOverlay.durationMs,
|
|
2642
|
-
|
|
2642
|
+
chunk3TPQY6WR_js.morphOptionToMode(transitionOverlay.transition.morphOption),
|
|
2643
2643
|
// `PresentationStage` stacks the incoming slide's elements above its
|
|
2644
2644
|
// template shapes (`zIndex = templateElements.length + index`), so a
|
|
2645
2645
|
// z-index journey has to start counting where the stage does.
|
|
@@ -2664,7 +2664,7 @@ function usePresentationMode(input) {
|
|
|
2664
2664
|
if (!morphPlan) {
|
|
2665
2665
|
return presentationKeyframesCss;
|
|
2666
2666
|
}
|
|
2667
|
-
const imageRules =
|
|
2667
|
+
const imageRules = chunk3TPQY6WR_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2668
2668
|
return `${presentationKeyframesCss ?? ""}
|
|
2669
2669
|
${morphPlan.keyframesCss}
|
|
2670
2670
|
${imageRules}`;
|
|
@@ -2961,7 +2961,7 @@ function useFindReplace({
|
|
|
2961
2961
|
const [findResults, setFindResults] = react.useState([]);
|
|
2962
2962
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
2963
2963
|
const performFind = react.useCallback(() => {
|
|
2964
|
-
const results =
|
|
2964
|
+
const results = chunk3TPQY6WR_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
2965
2965
|
if (!findQuery) {
|
|
2966
2966
|
setFindResults([]);
|
|
2967
2967
|
setFindResultIndex(-1);
|
|
@@ -2995,7 +2995,7 @@ function useFindReplace({
|
|
|
2995
2995
|
return;
|
|
2996
2996
|
}
|
|
2997
2997
|
onUpdateSlides(
|
|
2998
|
-
(prevSlides) =>
|
|
2998
|
+
(prevSlides) => chunk3TPQY6WR_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
2999
2999
|
);
|
|
3000
3000
|
onMarkDirty();
|
|
3001
3001
|
},
|
|
@@ -3017,9 +3017,9 @@ function useFindReplace({
|
|
|
3017
3017
|
}, [findResults, applyReplacements, performFind]);
|
|
3018
3018
|
react.useEffect(() => {
|
|
3019
3019
|
const handler = (event) => {
|
|
3020
|
-
const { action } =
|
|
3020
|
+
const { action } = chunk3TPQY6WR_js.mapEditorKey(event, {
|
|
3021
3021
|
canEdit: mode === "edit",
|
|
3022
|
-
isTextInputTarget:
|
|
3022
|
+
isTextInputTarget: chunk3TPQY6WR_js.isEditorTextInputTarget(event.target)
|
|
3023
3023
|
});
|
|
3024
3024
|
if (action !== "find") {
|
|
3025
3025
|
return;
|
|
@@ -3130,7 +3130,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId, ment
|
|
|
3130
3130
|
if (!slide) {
|
|
3131
3131
|
return { slides, didAdd: false };
|
|
3132
3132
|
}
|
|
3133
|
-
const next =
|
|
3133
|
+
const next = chunk3TPQY6WR_js.addCommentToList(
|
|
3134
3134
|
slide.comments || [],
|
|
3135
3135
|
text,
|
|
3136
3136
|
authorName,
|
|
@@ -3151,7 +3151,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
|
3151
3151
|
if (!slide) {
|
|
3152
3152
|
return { slides, didDelete: false };
|
|
3153
3153
|
}
|
|
3154
|
-
const next =
|
|
3154
|
+
const next = chunk3TPQY6WR_js.removeCommentFromList(slide.comments || [], commentId);
|
|
3155
3155
|
if (!next) {
|
|
3156
3156
|
return { slides, didDelete: false };
|
|
3157
3157
|
}
|
|
@@ -3162,7 +3162,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
|
3162
3162
|
if (!slide) {
|
|
3163
3163
|
return { slides, didUpdate: false };
|
|
3164
3164
|
}
|
|
3165
|
-
const next =
|
|
3165
|
+
const next = chunk3TPQY6WR_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
3166
3166
|
if (!next) {
|
|
3167
3167
|
return { slides, didUpdate: false };
|
|
3168
3168
|
}
|
|
@@ -3173,7 +3173,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
|
3173
3173
|
if (!slide) {
|
|
3174
3174
|
return { slides, didUpdate: false };
|
|
3175
3175
|
}
|
|
3176
|
-
const next =
|
|
3176
|
+
const next = chunk3TPQY6WR_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
3177
3177
|
if (!next) {
|
|
3178
3178
|
return { slides, didUpdate: false };
|
|
3179
3179
|
}
|
|
@@ -3184,7 +3184,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName, mention
|
|
|
3184
3184
|
if (!slide) {
|
|
3185
3185
|
return { slides, didAdd: false };
|
|
3186
3186
|
}
|
|
3187
|
-
const next =
|
|
3187
|
+
const next = chunk3TPQY6WR_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
3188
3188
|
if (!next) {
|
|
3189
3189
|
return { slides, didAdd: false };
|
|
3190
3190
|
}
|
|
@@ -3571,7 +3571,7 @@ function useDerivedElementState(input) {
|
|
|
3571
3571
|
return [];
|
|
3572
3572
|
}
|
|
3573
3573
|
return [
|
|
3574
|
-
...
|
|
3574
|
+
...chunk3TPQY6WR_js.visibleTemplateElements(activeSlide, templateElementsBySlideId[activeSlide.id] ?? [])
|
|
3575
3575
|
];
|
|
3576
3576
|
}, [activeSlide, templateElementsBySlideId]);
|
|
3577
3577
|
const activeMaster = slideMasters[activeMasterIndex];
|
|
@@ -3638,7 +3638,7 @@ function useViewerCoreState(_input) {
|
|
|
3638
3638
|
const marqueeStateRef = react.useRef(null);
|
|
3639
3639
|
const isDrawingRef = react.useRef(false);
|
|
3640
3640
|
const justInteractedRef = react.useRef(false);
|
|
3641
|
-
const livePatcher = react.useMemo(() =>
|
|
3641
|
+
const livePatcher = react.useMemo(() => chunk3TPQY6WR_js.createCollaborationLivePatcher(), []);
|
|
3642
3642
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3643
3643
|
const slidesRef = react.useRef([]);
|
|
3644
3644
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3647,8 +3647,8 @@ function useViewerCoreState(_input) {
|
|
|
3647
3647
|
const [slides, setSlides] = react.useState([]);
|
|
3648
3648
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3649
3649
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3650
|
-
width:
|
|
3651
|
-
height:
|
|
3650
|
+
width: chunk4CLG3TRU_js.DEFAULT_CANVAS_WIDTH,
|
|
3651
|
+
height: chunk4CLG3TRU_js.DEFAULT_CANVAS_HEIGHT
|
|
3652
3652
|
});
|
|
3653
3653
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3654
3654
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3669,7 +3669,7 @@ function useViewerCoreState(_input) {
|
|
|
3669
3669
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3670
3670
|
inlineEditingTextRef.current = resolved;
|
|
3671
3671
|
setInlineEditingTextBase(value);
|
|
3672
|
-
|
|
3672
|
+
chunk3TPQY6WR_js.publishLiveInlineText(
|
|
3673
3673
|
livePatcher,
|
|
3674
3674
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3675
3675
|
inlineEditingElementIdRef.current,
|
|
@@ -3964,8 +3964,8 @@ function useViewerState(input) {
|
|
|
3964
3964
|
}
|
|
3965
3965
|
|
|
3966
3966
|
// src/viewer/utils/glyph-outline-cache.ts
|
|
3967
|
-
var glyphOutlineFontCache = new
|
|
3968
|
-
var getGlyphOutline =
|
|
3967
|
+
var glyphOutlineFontCache = new chunk3TPQY6WR_js.GlyphOutlineFontCache();
|
|
3968
|
+
var getGlyphOutline = chunk3TPQY6WR_js.createGlyphOutlineLookup(glyphOutlineFontCache);
|
|
3969
3969
|
|
|
3970
3970
|
// src/viewer/hooks/useLoadContent.ts
|
|
3971
3971
|
function useLoadContent({
|
|
@@ -4024,7 +4024,9 @@ function useLoadContent({
|
|
|
4024
4024
|
}
|
|
4025
4025
|
let cancelled = false;
|
|
4026
4026
|
const token = ++renderTokenRef.current;
|
|
4027
|
-
const
|
|
4027
|
+
const handler = new chunk3TPQY6WR_js.PptxHandler();
|
|
4028
|
+
const resources = chunk3TPQY6WR_js.createPresentationLoadResources(handler);
|
|
4029
|
+
const loadBlobUrls = resources.blobUrls;
|
|
4028
4030
|
(async () => {
|
|
4029
4031
|
try {
|
|
4030
4032
|
setLoading(true);
|
|
@@ -4038,40 +4040,29 @@ function useLoadContent({
|
|
|
4038
4040
|
);
|
|
4039
4041
|
}
|
|
4040
4042
|
const previousHandler = handlerRef.current;
|
|
4041
|
-
const handler = new chunkLDFWF2KT_js.PptxHandler();
|
|
4042
4043
|
const parsed = await handler.load(buffer, { allowExternalImages });
|
|
4043
4044
|
if (cancelled || token !== renderTokenRef.current) {
|
|
4044
|
-
handler.dispose();
|
|
4045
4045
|
return;
|
|
4046
4046
|
}
|
|
4047
|
-
if (previousHandler) {
|
|
4048
|
-
previousHandler.dispose();
|
|
4049
|
-
}
|
|
4050
|
-
handlerRef.current = null;
|
|
4051
4047
|
const mediaElements = [];
|
|
4052
4048
|
for (const slide of parsed.slides) {
|
|
4053
|
-
|
|
4049
|
+
chunk3TPQY6WR_js.collectMediaElements(slide.elements, mediaElements);
|
|
4054
4050
|
}
|
|
4055
|
-
|
|
4056
|
-
if (url.startsWith("blob:")) {
|
|
4057
|
-
URL.revokeObjectURL(url);
|
|
4058
|
-
}
|
|
4059
|
-
}
|
|
4060
|
-
mediaDataUrls.clear();
|
|
4051
|
+
const nextMediaUrls = /* @__PURE__ */ new Map();
|
|
4061
4052
|
await Promise.all(
|
|
4062
4053
|
mediaElements.map(async (mediaElement) => {
|
|
4063
|
-
const resolved = await
|
|
4054
|
+
const resolved = await chunk3TPQY6WR_js.resolveMediaElementSource(mediaElement, handler);
|
|
4064
4055
|
if (resolved.missing || !resolved.mediaPath || !resolved.url) {
|
|
4065
4056
|
mediaElement.mediaMissing = true;
|
|
4066
4057
|
return;
|
|
4067
4058
|
}
|
|
4068
|
-
|
|
4059
|
+
nextMediaUrls.set(resolved.mediaPath, resolved.url);
|
|
4069
4060
|
if (resolved.isBlobUrl) {
|
|
4070
4061
|
loadBlobUrls.push(resolved.url);
|
|
4071
4062
|
}
|
|
4072
4063
|
})
|
|
4073
4064
|
);
|
|
4074
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
4065
|
+
const { paths: imagePaths, refs: imageRefs } = chunk3TPQY6WR_js.collectImagePaths(parsed.slides);
|
|
4075
4066
|
let nextSlides = parsed.slides;
|
|
4076
4067
|
if (imagePaths.size > 0) {
|
|
4077
4068
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -4087,25 +4078,39 @@ function useLoadContent({
|
|
|
4087
4078
|
})
|
|
4088
4079
|
);
|
|
4089
4080
|
nextSlides = parsed.slides.map((s) => {
|
|
4090
|
-
const newElements =
|
|
4081
|
+
const newElements = chunk3TPQY6WR_js.applyImagePathPatches(s.elements, resolvedMap, imageRefs);
|
|
4091
4082
|
return newElements === s.elements ? s : { ...s, elements: newElements };
|
|
4092
4083
|
});
|
|
4093
4084
|
}
|
|
4094
|
-
nextSlides = await
|
|
4085
|
+
nextSlides = await chunk3TPQY6WR_js.resolveTableCellImageUrls(
|
|
4095
4086
|
nextSlides,
|
|
4096
4087
|
(path) => handler.getImageData(path)
|
|
4097
4088
|
);
|
|
4098
|
-
const nextTableStyleMap = await
|
|
4089
|
+
const nextTableStyleMap = await chunk3TPQY6WR_js.resolveTableStyleImageUrls(
|
|
4099
4090
|
parsed.tableStyleMap,
|
|
4100
4091
|
(path) => handler.getImageData(path)
|
|
4101
4092
|
);
|
|
4093
|
+
if (cancelled || token !== renderTokenRef.current) {
|
|
4094
|
+
return;
|
|
4095
|
+
}
|
|
4096
|
+
previousHandler?.dispose();
|
|
4097
|
+
for (const url of mediaDataUrls.values()) {
|
|
4098
|
+
if (url.startsWith("blob:")) {
|
|
4099
|
+
URL.revokeObjectURL(url);
|
|
4100
|
+
}
|
|
4101
|
+
}
|
|
4102
|
+
mediaDataUrls.clear();
|
|
4103
|
+
for (const [path, url] of nextMediaUrls) {
|
|
4104
|
+
mediaDataUrls.set(path, url);
|
|
4105
|
+
}
|
|
4106
|
+
resources.commit();
|
|
4102
4107
|
handlerRef.current = handler;
|
|
4103
|
-
const partition =
|
|
4108
|
+
const partition = chunk3TPQY6WR_js.partitionTemplateElements(nextSlides);
|
|
4104
4109
|
setSlides(partition.slides);
|
|
4105
4110
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4106
4111
|
setCanvasSize({
|
|
4107
|
-
width: parsed.width ??
|
|
4108
|
-
height: parsed.height ??
|
|
4112
|
+
width: parsed.width ?? chunk4CLG3TRU_js.DEFAULT_CANVAS_WIDTH,
|
|
4113
|
+
height: parsed.height ?? chunk4CLG3TRU_js.DEFAULT_CANVAS_HEIGHT
|
|
4109
4114
|
});
|
|
4110
4115
|
setSlideSizeEmu(
|
|
4111
4116
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4118,7 +4123,7 @@ function useLoadContent({
|
|
|
4118
4123
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
4119
4124
|
setSlideMasters(parsed.slideMasters ?? []);
|
|
4120
4125
|
setModernCommentAuthors(parsed.modernCommentAuthors ?? []);
|
|
4121
|
-
setRecentColors(
|
|
4126
|
+
setRecentColors(chunk3TPQY6WR_js.seedRecentColors({ mruColors: parsed.mruColors }));
|
|
4122
4127
|
setTheme(parsed.theme);
|
|
4123
4128
|
setTableStyleMap(nextTableStyleMap);
|
|
4124
4129
|
setTableStylesDefaultId(parsed.tableStylesDefaultId);
|
|
@@ -4126,7 +4131,7 @@ function useLoadContent({
|
|
|
4126
4131
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
4127
4132
|
setCustomShows(parsed.customShows ?? []);
|
|
4128
4133
|
setActiveCustomShowId(
|
|
4129
|
-
|
|
4134
|
+
chunk3TPQY6WR_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
4130
4135
|
);
|
|
4131
4136
|
setSections(parsed.sections ?? []);
|
|
4132
4137
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -4150,11 +4155,11 @@ function useLoadContent({
|
|
|
4150
4155
|
setHasMacros(parsed.hasMacros === true);
|
|
4151
4156
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4152
4157
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4153
|
-
setGuides(
|
|
4154
|
-
setReadOnlyRecommendation(
|
|
4158
|
+
setGuides(chunk3TPQY6WR_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4159
|
+
setReadOnlyRecommendation(chunk3TPQY6WR_js.readOnlyRecommendation(parsed));
|
|
4155
4160
|
setModifyVerifier(parsed.modifyVerifier ?? void 0);
|
|
4156
4161
|
setCompatToasts(
|
|
4157
|
-
|
|
4162
|
+
chunk3TPQY6WR_js.compatibilityWarningToasts([
|
|
4158
4163
|
...parsed.warnings ?? [],
|
|
4159
4164
|
...parsed.slides.flatMap((slide) => slide.warnings ?? [])
|
|
4160
4165
|
])
|
|
@@ -4166,7 +4171,7 @@ function useLoadContent({
|
|
|
4166
4171
|
onContentApplied?.();
|
|
4167
4172
|
} catch (err) {
|
|
4168
4173
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4169
|
-
if (err instanceof
|
|
4174
|
+
if (err instanceof chunk3TPQY6WR_js.EncryptedFileError) {
|
|
4170
4175
|
setIsEncrypted(true);
|
|
4171
4176
|
} else {
|
|
4172
4177
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4174,6 +4179,7 @@ function useLoadContent({
|
|
|
4174
4179
|
}
|
|
4175
4180
|
}
|
|
4176
4181
|
} finally {
|
|
4182
|
+
resources.releaseIfUncommitted();
|
|
4177
4183
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4178
4184
|
setLoading(false);
|
|
4179
4185
|
}
|
|
@@ -4194,7 +4200,7 @@ function useLoadContent({
|
|
|
4194
4200
|
}
|
|
4195
4201
|
function useAutosave(input) {
|
|
4196
4202
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4197
|
-
const intervalMs =
|
|
4203
|
+
const intervalMs = chunk3TPQY6WR_js.resolveAutosaveIntervalMs({
|
|
4198
4204
|
hostIntervalMs: input.intervalMs,
|
|
4199
4205
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4200
4206
|
});
|
|
@@ -4225,7 +4231,7 @@ function useAutosave(input) {
|
|
|
4225
4231
|
return;
|
|
4226
4232
|
}
|
|
4227
4233
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4228
|
-
if (!
|
|
4234
|
+
if (!chunk3TPQY6WR_js.shouldWriteAutosaveSnapshot({
|
|
4229
4235
|
filePath: path,
|
|
4230
4236
|
isDirty: isDirtyRef.current,
|
|
4231
4237
|
saving: isSavingRef.current,
|
|
@@ -4243,8 +4249,8 @@ function useAutosave(input) {
|
|
|
4243
4249
|
isSavingRef.current = false;
|
|
4244
4250
|
return;
|
|
4245
4251
|
}
|
|
4246
|
-
await
|
|
4247
|
-
lastSnapshotRef.current =
|
|
4252
|
+
await chunk3TPQY6WR_js.saveAutosaveSnapshot(path, data);
|
|
4253
|
+
lastSnapshotRef.current = chunk3TPQY6WR_js.autosaveSnapshotMark(path, sources);
|
|
4248
4254
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4249
4255
|
} catch (err) {
|
|
4250
4256
|
setAutosaveStatus({
|
|
@@ -4298,13 +4304,13 @@ function useElementOperations(input) {
|
|
|
4298
4304
|
inlineEditingText
|
|
4299
4305
|
} = input;
|
|
4300
4306
|
const liveTextSegments = react.useCallback(() => {
|
|
4301
|
-
if (!selectedElement || !
|
|
4307
|
+
if (!selectedElement || !chunk3TPQY6WR_js.hasTextProperties(selectedElement)) {
|
|
4302
4308
|
return void 0;
|
|
4303
4309
|
}
|
|
4304
4310
|
if (selectedElement.id !== inlineEditingElementId) {
|
|
4305
4311
|
return selectedElement.textSegments;
|
|
4306
4312
|
}
|
|
4307
|
-
return
|
|
4313
|
+
return chunk3TPQY6WR_js.remapTextToSegments(
|
|
4308
4314
|
inlineEditingText,
|
|
4309
4315
|
selectedElement.textSegments,
|
|
4310
4316
|
selectedElement.textStyle
|
|
@@ -4345,11 +4351,11 @@ function useElementOperations(input) {
|
|
|
4345
4351
|
(elementId, updates) => {
|
|
4346
4352
|
if (masterView?.target) {
|
|
4347
4353
|
applyMasterViewWrite(
|
|
4348
|
-
|
|
4354
|
+
chunk3TPQY6WR_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4349
4355
|
);
|
|
4350
4356
|
return;
|
|
4351
4357
|
}
|
|
4352
|
-
if (
|
|
4358
|
+
if (chunk3TPQY6WR_js.isTemplateElementId(elementId)) {
|
|
4353
4359
|
const slideId = activeSlide?.id;
|
|
4354
4360
|
if (slideId) {
|
|
4355
4361
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4360,7 +4366,7 @@ function useElementOperations(input) {
|
|
|
4360
4366
|
}));
|
|
4361
4367
|
}
|
|
4362
4368
|
} else {
|
|
4363
|
-
setSlides((prev) =>
|
|
4369
|
+
setSlides((prev) => chunk3TPQY6WR_js.updateElement(prev, activeSlideIndex, elementId, updates));
|
|
4364
4370
|
}
|
|
4365
4371
|
history.markDirty();
|
|
4366
4372
|
},
|
|
@@ -4385,7 +4391,7 @@ function useElementOperations(input) {
|
|
|
4385
4391
|
);
|
|
4386
4392
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4387
4393
|
(updates) => {
|
|
4388
|
-
if (!selectedElement || !
|
|
4394
|
+
if (!selectedElement || !chunk3TPQY6WR_js.hasShapeProperties(selectedElement)) {
|
|
4389
4395
|
return;
|
|
4390
4396
|
}
|
|
4391
4397
|
updateSelectedElement({
|
|
@@ -4396,19 +4402,19 @@ function useElementOperations(input) {
|
|
|
4396
4402
|
);
|
|
4397
4403
|
const updateSelectedTextStyle = react.useCallback(
|
|
4398
4404
|
(updates) => {
|
|
4399
|
-
if (!selectedElement || !
|
|
4405
|
+
if (!selectedElement || !chunk3TPQY6WR_js.hasTextProperties(selectedElement)) {
|
|
4400
4406
|
return;
|
|
4401
4407
|
}
|
|
4402
4408
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4403
4409
|
const currentSegments = liveTextSegments();
|
|
4404
|
-
const inlineSel =
|
|
4410
|
+
const inlineSel = chunk3TPQY6WR_js.getInlineEditorSelection(currentSegments);
|
|
4405
4411
|
if (inlineSel && currentSegments) {
|
|
4406
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4412
|
+
const { newSegments: newSegments2, newSelection } = chunk3TPQY6WR_js.applyStyleToSelectedSegments(
|
|
4407
4413
|
currentSegments,
|
|
4408
4414
|
inlineSel,
|
|
4409
4415
|
updates
|
|
4410
4416
|
);
|
|
4411
|
-
|
|
4417
|
+
chunk3TPQY6WR_js.setPendingSelectionRestore(newSelection);
|
|
4412
4418
|
updateSelectedElement({
|
|
4413
4419
|
textSegments: newSegments2,
|
|
4414
4420
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4436,14 +4442,14 @@ function useElementOperations(input) {
|
|
|
4436
4442
|
);
|
|
4437
4443
|
const updateSelectedTextCase = react.useCallback(
|
|
4438
4444
|
(mode) => {
|
|
4439
|
-
if (!selectedElement || !
|
|
4445
|
+
if (!selectedElement || !chunk3TPQY6WR_js.hasTextProperties(selectedElement)) {
|
|
4440
4446
|
return;
|
|
4441
4447
|
}
|
|
4442
4448
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4443
4449
|
const currentSegments = liveTextSegments();
|
|
4444
|
-
const inlineSel =
|
|
4450
|
+
const inlineSel = chunk3TPQY6WR_js.getInlineEditorSelection(currentSegments);
|
|
4445
4451
|
if (inlineSel && currentSegments) {
|
|
4446
|
-
const newSegments =
|
|
4452
|
+
const newSegments = chunk3TPQY6WR_js.applyCaseTransformToSegments(currentSegments, inlineSel, mode);
|
|
4447
4453
|
updateSelectedElement({
|
|
4448
4454
|
textSegments: newSegments,
|
|
4449
4455
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4452,7 +4458,7 @@ function useElementOperations(input) {
|
|
|
4452
4458
|
}
|
|
4453
4459
|
const updates = {};
|
|
4454
4460
|
if (currentSegments && currentSegments.length > 0) {
|
|
4455
|
-
updates.textSegments =
|
|
4461
|
+
updates.textSegments = chunk3TPQY6WR_js.applyCaseTransformToSegments(
|
|
4456
4462
|
currentSegments,
|
|
4457
4463
|
null,
|
|
4458
4464
|
mode
|
|
@@ -4460,7 +4466,7 @@ function useElementOperations(input) {
|
|
|
4460
4466
|
}
|
|
4461
4467
|
const baseText = isLiveEditing ? inlineEditingText : selectedElement.text;
|
|
4462
4468
|
if (typeof baseText === "string") {
|
|
4463
|
-
updates.text =
|
|
4469
|
+
updates.text = chunk3TPQY6WR_js.transformTextCase(baseText, mode);
|
|
4464
4470
|
}
|
|
4465
4471
|
updateSelectedElement(updates);
|
|
4466
4472
|
},
|
|
@@ -4479,15 +4485,15 @@ function useElementOperations(input) {
|
|
|
4479
4485
|
[setSlides]
|
|
4480
4486
|
);
|
|
4481
4487
|
const masterViewTarget = masterView?.target ?? null;
|
|
4482
|
-
const activeElements = masterViewTarget ?
|
|
4488
|
+
const activeElements = masterViewTarget ? chunk3TPQY6WR_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4483
4489
|
const updateActiveElements = react.useCallback(
|
|
4484
4490
|
(updater) => {
|
|
4485
4491
|
if (masterView?.target) {
|
|
4486
4492
|
applyMasterViewWrite(
|
|
4487
|
-
|
|
4493
|
+
chunk3TPQY6WR_js.replaceMasterViewElements(
|
|
4488
4494
|
masterView,
|
|
4489
4495
|
masterView.target,
|
|
4490
|
-
updater(
|
|
4496
|
+
updater(chunk3TPQY6WR_js.masterViewElements(masterView, masterView.target))
|
|
4491
4497
|
)
|
|
4492
4498
|
);
|
|
4493
4499
|
return;
|
|
@@ -4540,7 +4546,7 @@ function useSectionOperations(input) {
|
|
|
4540
4546
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4541
4547
|
const addSection2 = react.useCallback(
|
|
4542
4548
|
(name, afterSlideIndex) => {
|
|
4543
|
-
const result =
|
|
4549
|
+
const result = chunk3TPQY6WR_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4544
4550
|
setSlides(result.slides);
|
|
4545
4551
|
setSections(result.sections);
|
|
4546
4552
|
markDirty();
|
|
@@ -4549,7 +4555,7 @@ function useSectionOperations(input) {
|
|
|
4549
4555
|
);
|
|
4550
4556
|
const renameSection2 = react.useCallback(
|
|
4551
4557
|
(sectionId, newName) => {
|
|
4552
|
-
const result =
|
|
4558
|
+
const result = chunk3TPQY6WR_js.renameSection(sections, slides, sectionId, newName);
|
|
4553
4559
|
setSections(result.sections);
|
|
4554
4560
|
setSlides(result.slides);
|
|
4555
4561
|
markDirty();
|
|
@@ -4558,7 +4564,7 @@ function useSectionOperations(input) {
|
|
|
4558
4564
|
);
|
|
4559
4565
|
const deleteSection2 = react.useCallback(
|
|
4560
4566
|
(sectionId) => {
|
|
4561
|
-
const result =
|
|
4567
|
+
const result = chunk3TPQY6WR_js.deleteSection(sections, slides, sectionId);
|
|
4562
4568
|
setSections(result.sections);
|
|
4563
4569
|
setSlides(result.slides);
|
|
4564
4570
|
markDirty();
|
|
@@ -4567,21 +4573,21 @@ function useSectionOperations(input) {
|
|
|
4567
4573
|
);
|
|
4568
4574
|
const moveSectionUp2 = react.useCallback(
|
|
4569
4575
|
(sectionId) => {
|
|
4570
|
-
setSections(
|
|
4576
|
+
setSections(chunk3TPQY6WR_js.moveSectionUp(sections, sectionId));
|
|
4571
4577
|
markDirty();
|
|
4572
4578
|
},
|
|
4573
4579
|
[sections, setSections, markDirty]
|
|
4574
4580
|
);
|
|
4575
4581
|
const moveSectionDown2 = react.useCallback(
|
|
4576
4582
|
(sectionId) => {
|
|
4577
|
-
setSections(
|
|
4583
|
+
setSections(chunk3TPQY6WR_js.moveSectionDown(sections, sectionId));
|
|
4578
4584
|
markDirty();
|
|
4579
4585
|
},
|
|
4580
4586
|
[sections, setSections, markDirty]
|
|
4581
4587
|
);
|
|
4582
4588
|
const moveSlidesToSection2 = react.useCallback(
|
|
4583
4589
|
(slideIndexes, targetSectionId) => {
|
|
4584
|
-
const result =
|
|
4590
|
+
const result = chunk3TPQY6WR_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4585
4591
|
setSlides(result.slides);
|
|
4586
4592
|
setSections(result.sections);
|
|
4587
4593
|
markDirty();
|
|
@@ -4647,15 +4653,15 @@ function syncSelectionHandleOverlay(elementNode, elementId, geometry) {
|
|
|
4647
4653
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4648
4654
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
|
|
4649
4655
|
const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
|
|
4650
|
-
let resized =
|
|
4656
|
+
let resized = chunk3TPQY6WR_js.applyResize(startBox, handle, dx, dy, 1, { minSize: chunk4CLG3TRU_js.MIN_ELEMENT_SIZE });
|
|
4651
4657
|
if (lockAspect) {
|
|
4652
|
-
resized =
|
|
4658
|
+
resized = chunk3TPQY6WR_js.lockResizeAspect(resized, startBox, handle, chunk4CLG3TRU_js.MIN_ELEMENT_SIZE);
|
|
4653
4659
|
}
|
|
4654
4660
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4655
4661
|
if (!snapToGrid) {
|
|
4656
4662
|
return box;
|
|
4657
4663
|
}
|
|
4658
|
-
return
|
|
4664
|
+
return chunk3TPQY6WR_js.snapBoxToGrid(box, handle, gridSpacingPx, chunk4CLG3TRU_js.MIN_ELEMENT_SIZE);
|
|
4659
4665
|
}
|
|
4660
4666
|
function resolveLiveTarget(input) {
|
|
4661
4667
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4768,7 +4774,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4768
4774
|
width: el.width,
|
|
4769
4775
|
height: el.height
|
|
4770
4776
|
}));
|
|
4771
|
-
const snapResult =
|
|
4777
|
+
const snapResult = chunk3TPQY6WR_js.computeSnapToShape(
|
|
4772
4778
|
targetX,
|
|
4773
4779
|
targetY,
|
|
4774
4780
|
primaryEl.width,
|
|
@@ -4810,7 +4816,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4810
4816
|
if (live) {
|
|
4811
4817
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4812
4818
|
const start = drag.startPositionsById[id];
|
|
4813
|
-
|
|
4819
|
+
chunk3TPQY6WR_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4814
4820
|
x: start.x + appliedDx,
|
|
4815
4821
|
y: start.y + appliedDy
|
|
4816
4822
|
});
|
|
@@ -4842,8 +4848,8 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4842
4848
|
rs.lastY = geo.y;
|
|
4843
4849
|
rs.lastWidth = geo.width;
|
|
4844
4850
|
rs.lastHeight = geo.height;
|
|
4845
|
-
const width = Math.max(geo.width,
|
|
4846
|
-
const height = Math.max(geo.height,
|
|
4851
|
+
const width = Math.max(geo.width, chunk4CLG3TRU_js.MIN_ELEMENT_SIZE);
|
|
4852
|
+
const height = Math.max(geo.height, chunk4CLG3TRU_js.MIN_ELEMENT_SIZE);
|
|
4847
4853
|
if (rs.domEl) {
|
|
4848
4854
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4849
4855
|
rs.domEl.style.top = `${geo.y}px`;
|
|
@@ -4852,7 +4858,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4852
4858
|
syncSelectionHandleOverlay(rs.domEl, rs.elementId, { x: geo.x, y: geo.y, width, height });
|
|
4853
4859
|
}
|
|
4854
4860
|
if (live) {
|
|
4855
|
-
|
|
4861
|
+
chunk3TPQY6WR_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4856
4862
|
x: geo.x,
|
|
4857
4863
|
y: geo.y,
|
|
4858
4864
|
width,
|
|
@@ -4863,7 +4869,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4863
4869
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4864
4870
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4865
4871
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4866
|
-
const adjustments =
|
|
4872
|
+
const adjustments = chunk3TPQY6WR_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4867
4873
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4868
4874
|
adj.moved = true;
|
|
4869
4875
|
}
|
|
@@ -4938,13 +4944,13 @@ function processPointerUp(input) {
|
|
|
4938
4944
|
if (i !== activeSlideIndex) {
|
|
4939
4945
|
return s;
|
|
4940
4946
|
}
|
|
4941
|
-
const rerouted =
|
|
4947
|
+
const rerouted = chunk3TPQY6WR_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4942
4948
|
if (rerouted.length === 0) {
|
|
4943
4949
|
return s;
|
|
4944
4950
|
}
|
|
4945
4951
|
return {
|
|
4946
4952
|
...s,
|
|
4947
|
-
elements:
|
|
4953
|
+
elements: chunk3TPQY6WR_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4948
4954
|
};
|
|
4949
4955
|
})
|
|
4950
4956
|
);
|
|
@@ -4969,9 +4975,9 @@ function processPointerUp(input) {
|
|
|
4969
4975
|
}
|
|
4970
4976
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4971
4977
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4972
|
-
const hitIds =
|
|
4978
|
+
const hitIds = chunk3TPQY6WR_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4973
4979
|
if (marquee.additive) {
|
|
4974
|
-
const merged =
|
|
4980
|
+
const merged = chunk3TPQY6WR_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4975
4981
|
if (merged.length > 0) {
|
|
4976
4982
|
applySelection(merged[0], merged);
|
|
4977
4983
|
} else {
|
|
@@ -4994,8 +5000,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4994
5000
|
}
|
|
4995
5001
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4996
5002
|
});
|
|
4997
|
-
const rerouted =
|
|
4998
|
-
return
|
|
5003
|
+
const rerouted = chunk3TPQY6WR_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
5004
|
+
return chunk3TPQY6WR_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4999
5005
|
};
|
|
5000
5006
|
if (editTemplateMode) {
|
|
5001
5007
|
const slideId = activeSlide?.id;
|
|
@@ -5151,17 +5157,17 @@ function useCanvasInteractions(input) {
|
|
|
5151
5157
|
return;
|
|
5152
5158
|
}
|
|
5153
5159
|
const el = elementLookup.get(editId);
|
|
5154
|
-
if (el &&
|
|
5160
|
+
if (el && chunk3TPQY6WR_js.hasTextProperties(el)) {
|
|
5155
5161
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
5156
|
-
const textPatch =
|
|
5162
|
+
const textPatch = chunk3TPQY6WR_js.buildInlineTextCommitPatch(el, committedText);
|
|
5157
5163
|
if (!textPatch) {
|
|
5158
5164
|
setInlineEditingElementId(null);
|
|
5159
5165
|
setInlineEditingText("");
|
|
5160
5166
|
return;
|
|
5161
5167
|
}
|
|
5162
5168
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
5163
|
-
const newHeight =
|
|
5164
|
-
const shrink =
|
|
5169
|
+
const newHeight = chunk3TPQY6WR_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
5170
|
+
const shrink = chunk3TPQY6WR_js.resolveInlineEditNormAutofitShrink(el.textStyle, el.height, editorEl);
|
|
5165
5171
|
ops.updateElementById(editId, {
|
|
5166
5172
|
...textPatch,
|
|
5167
5173
|
...newHeight !== void 0 ? { height: newHeight } : {},
|
|
@@ -5179,7 +5185,7 @@ function useCanvasInteractions(input) {
|
|
|
5179
5185
|
setInlineEditingText("");
|
|
5180
5186
|
};
|
|
5181
5187
|
const openEquationEditorForElement = (el) => {
|
|
5182
|
-
if (!
|
|
5188
|
+
if (!chunk3TPQY6WR_js.hasTextProperties(el)) {
|
|
5183
5189
|
return false;
|
|
5184
5190
|
}
|
|
5185
5191
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5209,7 +5215,7 @@ function useCanvasInteractions(input) {
|
|
|
5209
5215
|
justInteractedRef.current = false;
|
|
5210
5216
|
} else {
|
|
5211
5217
|
const el = elementLookup.get(elementId);
|
|
5212
|
-
if (el &&
|
|
5218
|
+
if (el && chunk3TPQY6WR_js.hasTextProperties(el) && chunk3TPQY6WR_js.canInteractWithElement(el, "textEdit")) {
|
|
5213
5219
|
if (!openEquationEditorForElement(el)) {
|
|
5214
5220
|
setInlineEditingElementId(elementId);
|
|
5215
5221
|
setInlineEditingText(el.text ?? "");
|
|
@@ -5228,7 +5234,7 @@ function useCanvasInteractions(input) {
|
|
|
5228
5234
|
if (openEquationEditorForElement(el)) {
|
|
5229
5235
|
return;
|
|
5230
5236
|
}
|
|
5231
|
-
if (
|
|
5237
|
+
if (chunk3TPQY6WR_js.hasTextProperties(el) && chunk3TPQY6WR_js.canInteractWithElement(el, "textEdit")) {
|
|
5232
5238
|
setInlineEditingElementId(elementId);
|
|
5233
5239
|
setInlineEditingText(el.text ?? "");
|
|
5234
5240
|
}
|
|
@@ -5251,7 +5257,7 @@ function useCanvasInteractions(input) {
|
|
|
5251
5257
|
justSelectedRef.current = false;
|
|
5252
5258
|
}
|
|
5253
5259
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
5254
|
-
const movableIds =
|
|
5260
|
+
const movableIds = chunk3TPQY6WR_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
5255
5261
|
if (movableIds.length === 0) {
|
|
5256
5262
|
return;
|
|
5257
5263
|
}
|
|
@@ -5321,7 +5327,7 @@ function useCanvasInteractions(input) {
|
|
|
5321
5327
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5322
5328
|
e.stopPropagation();
|
|
5323
5329
|
const el = elementLookup.get(elementId);
|
|
5324
|
-
if (!el || !
|
|
5330
|
+
if (!el || !chunk3TPQY6WR_js.canInteractWithElement(el, "resize")) {
|
|
5325
5331
|
return;
|
|
5326
5332
|
}
|
|
5327
5333
|
resizeStateRef.current = {
|
|
@@ -5343,7 +5349,7 @@ function useCanvasInteractions(input) {
|
|
|
5343
5349
|
};
|
|
5344
5350
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5345
5351
|
const el = elementLookup.get(elementId);
|
|
5346
|
-
if (!el || !
|
|
5352
|
+
if (!el || !chunk3TPQY6WR_js.canInteractWithElement(el, "rotate")) {
|
|
5347
5353
|
return;
|
|
5348
5354
|
}
|
|
5349
5355
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5363,10 +5369,10 @@ function useCanvasInteractions(input) {
|
|
|
5363
5369
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5364
5370
|
e.stopPropagation();
|
|
5365
5371
|
const el = elementLookup.get(elementId);
|
|
5366
|
-
if (!el || !
|
|
5372
|
+
if (!el || !chunk3TPQY6WR_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5367
5373
|
return;
|
|
5368
5374
|
}
|
|
5369
|
-
shapeAdjustmentDragStateRef.current =
|
|
5375
|
+
shapeAdjustmentDragStateRef.current = chunk3TPQY6WR_js.beginShapeAdjustment(
|
|
5370
5376
|
el,
|
|
5371
5377
|
descriptor,
|
|
5372
5378
|
e.clientX,
|
|
@@ -5413,7 +5419,7 @@ function createFileHandlers(deps) {
|
|
|
5413
5419
|
h = Math.round(h * scale);
|
|
5414
5420
|
}
|
|
5415
5421
|
addElement({
|
|
5416
|
-
id:
|
|
5422
|
+
id: chunk3TPQY6WR_js.generateElementId(),
|
|
5417
5423
|
type: "image",
|
|
5418
5424
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5419
5425
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5424,7 +5430,7 @@ function createFileHandlers(deps) {
|
|
|
5424
5430
|
};
|
|
5425
5431
|
img.onerror = () => {
|
|
5426
5432
|
addElement({
|
|
5427
|
-
id:
|
|
5433
|
+
id: chunk3TPQY6WR_js.generateElementId(),
|
|
5428
5434
|
type: "image",
|
|
5429
5435
|
x: 100,
|
|
5430
5436
|
y: 100,
|
|
@@ -5443,14 +5449,14 @@ function createFileHandlers(deps) {
|
|
|
5443
5449
|
return;
|
|
5444
5450
|
}
|
|
5445
5451
|
e.target.value = "";
|
|
5446
|
-
const mediaType =
|
|
5452
|
+
const mediaType = chunk3TPQY6WR_js.classifyMediaType(file.type);
|
|
5447
5453
|
if (!mediaType) {
|
|
5448
5454
|
return;
|
|
5449
5455
|
}
|
|
5450
5456
|
const elFilePath = file.path;
|
|
5451
5457
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5452
5458
|
addElement({
|
|
5453
|
-
id:
|
|
5459
|
+
id: chunk3TPQY6WR_js.generateElementId(),
|
|
5454
5460
|
type: "media",
|
|
5455
5461
|
mediaType,
|
|
5456
5462
|
mediaMimeType: file.type || void 0,
|
|
@@ -5625,13 +5631,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5625
5631
|
return;
|
|
5626
5632
|
}
|
|
5627
5633
|
addElement({
|
|
5628
|
-
id:
|
|
5634
|
+
id: chunk3TPQY6WR_js.generateElementId(),
|
|
5629
5635
|
type: "smartArt",
|
|
5630
5636
|
x: 100,
|
|
5631
5637
|
y: 120,
|
|
5632
5638
|
width: 600,
|
|
5633
5639
|
height: 340,
|
|
5634
|
-
smartArtData:
|
|
5640
|
+
smartArtData: chunk3TPQY6WR_js.buildSmartArtPresetData(
|
|
5635
5641
|
layout,
|
|
5636
5642
|
defaultItems,
|
|
5637
5643
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5643,7 +5649,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5643
5649
|
return;
|
|
5644
5650
|
}
|
|
5645
5651
|
addElement({
|
|
5646
|
-
id:
|
|
5652
|
+
id: chunk3TPQY6WR_js.generateElementId(),
|
|
5647
5653
|
type: "shape",
|
|
5648
5654
|
x: 120,
|
|
5649
5655
|
y: 200,
|
|
@@ -5681,7 +5687,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5681
5687
|
return;
|
|
5682
5688
|
}
|
|
5683
5689
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5684
|
-
if (resolved.url && !
|
|
5690
|
+
if (resolved.url && !chunk3TPQY6WR_js.isUrlSafe(resolved.url)) {
|
|
5685
5691
|
return;
|
|
5686
5692
|
}
|
|
5687
5693
|
const actionClick = {
|
|
@@ -5705,7 +5711,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5705
5711
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5706
5712
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5707
5713
|
addElement({
|
|
5708
|
-
id:
|
|
5714
|
+
id: chunk3TPQY6WR_js.generateElementId(),
|
|
5709
5715
|
type: "shape",
|
|
5710
5716
|
x: 120,
|
|
5711
5717
|
y: 200,
|
|
@@ -5727,11 +5733,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5727
5733
|
if (!activeSlide) {
|
|
5728
5734
|
return;
|
|
5729
5735
|
}
|
|
5730
|
-
const preset =
|
|
5736
|
+
const preset = chunk3TPQY6WR_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5731
5737
|
if (!preset) {
|
|
5732
5738
|
return;
|
|
5733
5739
|
}
|
|
5734
|
-
const defaultPptxAction =
|
|
5740
|
+
const defaultPptxAction = chunk3TPQY6WR_js.elementActionToPptxAction({
|
|
5735
5741
|
trigger: "click",
|
|
5736
5742
|
type: preset.defaultAction
|
|
5737
5743
|
});
|
|
@@ -5740,7 +5746,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5740
5746
|
defaultPptxAction.highlightClick = true;
|
|
5741
5747
|
}
|
|
5742
5748
|
addElement({
|
|
5743
|
-
id:
|
|
5749
|
+
id: chunk3TPQY6WR_js.generateElementId(),
|
|
5744
5750
|
type: "shape",
|
|
5745
5751
|
x: 150,
|
|
5746
5752
|
y: 150,
|
|
@@ -5807,14 +5813,14 @@ function useInsertElements(input) {
|
|
|
5807
5813
|
return;
|
|
5808
5814
|
}
|
|
5809
5815
|
addElement({
|
|
5810
|
-
id:
|
|
5816
|
+
id: chunk3TPQY6WR_js.generateElementId(),
|
|
5811
5817
|
type: "text",
|
|
5812
5818
|
x: 100,
|
|
5813
5819
|
y: 100,
|
|
5814
5820
|
width: 300,
|
|
5815
5821
|
height: 60,
|
|
5816
5822
|
text: "",
|
|
5817
|
-
textStyle: { fontSize:
|
|
5823
|
+
textStyle: { fontSize: chunk4CLG3TRU_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5818
5824
|
});
|
|
5819
5825
|
};
|
|
5820
5826
|
const handleAddShape = () => {
|
|
@@ -5822,7 +5828,7 @@ function useInsertElements(input) {
|
|
|
5822
5828
|
return;
|
|
5823
5829
|
}
|
|
5824
5830
|
addElement({
|
|
5825
|
-
id:
|
|
5831
|
+
id: chunk3TPQY6WR_js.generateElementId(),
|
|
5826
5832
|
type: "shape",
|
|
5827
5833
|
x: 150,
|
|
5828
5834
|
y: 150,
|
|
@@ -5841,15 +5847,15 @@ function useInsertElements(input) {
|
|
|
5841
5847
|
return;
|
|
5842
5848
|
}
|
|
5843
5849
|
addElement({
|
|
5844
|
-
...
|
|
5845
|
-
id:
|
|
5850
|
+
...chunk3TPQY6WR_js.newTableElement(chunk4CLG3TRU_js.DEFAULT_TABLE_ROWS, chunk4CLG3TRU_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5851
|
+
id: chunk3TPQY6WR_js.generateElementId()
|
|
5846
5852
|
});
|
|
5847
5853
|
};
|
|
5848
5854
|
const handleAddChart = (chartKind) => {
|
|
5849
5855
|
if (!activeSlide) {
|
|
5850
5856
|
return;
|
|
5851
5857
|
}
|
|
5852
|
-
addElement(
|
|
5858
|
+
addElement(chunk3TPQY6WR_js.createDefaultChartElement(chartKind));
|
|
5853
5859
|
};
|
|
5854
5860
|
const structured = createStructuredElementHandlers({
|
|
5855
5861
|
activeSlide,
|
|
@@ -5919,7 +5925,7 @@ function useClipboardHandlers(input) {
|
|
|
5919
5925
|
if (!selectedElement) {
|
|
5920
5926
|
return;
|
|
5921
5927
|
}
|
|
5922
|
-
setClipboardPayload(
|
|
5928
|
+
setClipboardPayload(chunk3TPQY6WR_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5923
5929
|
};
|
|
5924
5930
|
const handleDelete = () => {
|
|
5925
5931
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5936,7 +5942,7 @@ function useClipboardHandlers(input) {
|
|
|
5936
5942
|
handleDelete();
|
|
5937
5943
|
};
|
|
5938
5944
|
const insertClone = (source) => {
|
|
5939
|
-
const clone =
|
|
5945
|
+
const clone = chunk3TPQY6WR_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5940
5946
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5941
5947
|
ops.applySelection(clone.id);
|
|
5942
5948
|
history.markDirty();
|
|
@@ -5971,7 +5977,7 @@ function resolveShapePath(el) {
|
|
|
5971
5977
|
return el.pathData;
|
|
5972
5978
|
}
|
|
5973
5979
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5974
|
-
const clipPath =
|
|
5980
|
+
const clipPath = chunk3TPQY6WR_js.getPresetShapeClipPath(el.shapeType);
|
|
5975
5981
|
if (clipPath) {
|
|
5976
5982
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5977
5983
|
if (svgPath) {
|
|
@@ -6022,7 +6028,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
6022
6028
|
return parts.join(" ");
|
|
6023
6029
|
}
|
|
6024
6030
|
function transformPathToGlobal(pathData, el) {
|
|
6025
|
-
const polys =
|
|
6031
|
+
const polys = chunk3TPQY6WR_js.svgPathToPolygons(pathData);
|
|
6026
6032
|
if (polys.length === 0) {
|
|
6027
6033
|
return pathData;
|
|
6028
6034
|
}
|
|
@@ -6042,10 +6048,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
6042
6048
|
y: pt.y * scaleY + el.y
|
|
6043
6049
|
}))
|
|
6044
6050
|
);
|
|
6045
|
-
return
|
|
6051
|
+
return chunk3TPQY6WR_js.polygonsToSvgPath(transformed);
|
|
6046
6052
|
}
|
|
6047
6053
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
6048
|
-
const polys =
|
|
6054
|
+
const polys = chunk3TPQY6WR_js.svgPathToPolygons(pathData);
|
|
6049
6055
|
if (polys.length === 0) {
|
|
6050
6056
|
return pathData;
|
|
6051
6057
|
}
|
|
@@ -6055,10 +6061,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
6055
6061
|
y: pt.y - y
|
|
6056
6062
|
}))
|
|
6057
6063
|
);
|
|
6058
|
-
return
|
|
6064
|
+
return chunk3TPQY6WR_js.polygonsToSvgPath(transformed);
|
|
6059
6065
|
}
|
|
6060
6066
|
function pathBounds(pathData) {
|
|
6061
|
-
const polys =
|
|
6067
|
+
const polys = chunk3TPQY6WR_js.svgPathToPolygons(pathData);
|
|
6062
6068
|
let minX = Infinity;
|
|
6063
6069
|
let minY = Infinity;
|
|
6064
6070
|
let maxX = -Infinity;
|
|
@@ -6117,7 +6123,7 @@ function useMergeShapesHandler(input) {
|
|
|
6117
6123
|
let allFragments = [];
|
|
6118
6124
|
let remaining = globalPaths[0];
|
|
6119
6125
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6120
|
-
const frags =
|
|
6126
|
+
const frags = chunk3TPQY6WR_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
6121
6127
|
if (Array.isArray(frags)) {
|
|
6122
6128
|
allFragments = frags;
|
|
6123
6129
|
}
|
|
@@ -6146,7 +6152,7 @@ function useMergeShapesHandler(input) {
|
|
|
6146
6152
|
bounds.height
|
|
6147
6153
|
);
|
|
6148
6154
|
const newEl = {
|
|
6149
|
-
id:
|
|
6155
|
+
id: chunk3TPQY6WR_js.generateElementId(),
|
|
6150
6156
|
type: "shape",
|
|
6151
6157
|
x: bounds.x,
|
|
6152
6158
|
y: bounds.y,
|
|
@@ -6184,7 +6190,7 @@ function useMergeShapesHandler(input) {
|
|
|
6184
6190
|
} else {
|
|
6185
6191
|
let resultPath = globalPaths[0];
|
|
6186
6192
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6187
|
-
const result =
|
|
6193
|
+
const result = chunk3TPQY6WR_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
6188
6194
|
if (typeof result === "string") {
|
|
6189
6195
|
resultPath = result;
|
|
6190
6196
|
}
|
|
@@ -6205,7 +6211,7 @@ function useMergeShapesHandler(input) {
|
|
|
6205
6211
|
);
|
|
6206
6212
|
const primary = targets[0];
|
|
6207
6213
|
const newEl = {
|
|
6208
|
-
id:
|
|
6214
|
+
id: chunk3TPQY6WR_js.generateElementId(),
|
|
6209
6215
|
type: "shape",
|
|
6210
6216
|
x: bounds.x,
|
|
6211
6217
|
y: bounds.y,
|
|
@@ -6268,10 +6274,10 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6268
6274
|
if (ids.length < 2 || !activeSlide) {
|
|
6269
6275
|
return;
|
|
6270
6276
|
}
|
|
6271
|
-
if (!selectedElements.every((el) =>
|
|
6277
|
+
if (!selectedElements.every((el) => chunk3TPQY6WR_js.canInteractWithElement(el, "group"))) {
|
|
6272
6278
|
return;
|
|
6273
6279
|
}
|
|
6274
|
-
const { elements, groupId } =
|
|
6280
|
+
const { elements, groupId } = chunk3TPQY6WR_js.groupElements(ops.activeElements, ids, chunk3TPQY6WR_js.generateElementId());
|
|
6275
6281
|
if (groupId === null) {
|
|
6276
6282
|
return;
|
|
6277
6283
|
}
|
|
@@ -6283,15 +6289,15 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6283
6289
|
if (!selectedElement || selectedElement.type !== "group" || !activeSlide) {
|
|
6284
6290
|
return;
|
|
6285
6291
|
}
|
|
6286
|
-
if (!
|
|
6292
|
+
if (!chunk3TPQY6WR_js.canInteractWithElement(selectedElement, "group")) {
|
|
6287
6293
|
return;
|
|
6288
6294
|
}
|
|
6289
6295
|
const group = selectedElement;
|
|
6290
|
-
const intoTemplate =
|
|
6296
|
+
const intoTemplate = chunk3TPQY6WR_js.isTemplateElementId(group.id);
|
|
6291
6297
|
const childIds = group.children.map(
|
|
6292
|
-
(child) => intoTemplate ?
|
|
6298
|
+
(child) => intoTemplate ? chunk3TPQY6WR_js.makeCloneId(true, child.id || group.id) : child.id || chunk3TPQY6WR_js.generateElementId()
|
|
6293
6299
|
);
|
|
6294
|
-
const { elements, childIds: usedIds } =
|
|
6300
|
+
const { elements, childIds: usedIds } = chunk3TPQY6WR_js.ungroupElements(
|
|
6295
6301
|
ops.activeElements,
|
|
6296
6302
|
group.id,
|
|
6297
6303
|
childIds,
|
|
@@ -6320,7 +6326,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6320
6326
|
if (!edge) {
|
|
6321
6327
|
return;
|
|
6322
6328
|
}
|
|
6323
|
-
const positions =
|
|
6329
|
+
const positions = chunk3TPQY6WR_js.alignElements(selectedElements, edge);
|
|
6324
6330
|
for (const [id, pos] of positions) {
|
|
6325
6331
|
const el = elementLookup.get(id);
|
|
6326
6332
|
if (!el) {
|
|
@@ -6338,7 +6344,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6338
6344
|
if (!distAxis) {
|
|
6339
6345
|
return;
|
|
6340
6346
|
}
|
|
6341
|
-
const positions =
|
|
6347
|
+
const positions = chunk3TPQY6WR_js.distributeElements(selectedElements, distAxis);
|
|
6342
6348
|
for (const [id, pos] of positions) {
|
|
6343
6349
|
const el = elementLookup.get(id);
|
|
6344
6350
|
if (!el) {
|
|
@@ -6349,14 +6355,14 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6349
6355
|
history.markDirty();
|
|
6350
6356
|
};
|
|
6351
6357
|
const canDistribute = selectedElements.length >= 3;
|
|
6352
|
-
const selectionGroupable = selectedElements.every((el) =>
|
|
6358
|
+
const selectionGroupable = selectedElements.every((el) => chunk3TPQY6WR_js.canInteractWithElement(el, "group"));
|
|
6353
6359
|
const handleMoveLayer = (direction) => {
|
|
6354
6360
|
if (!selectedElement || !activeSlide) {
|
|
6355
6361
|
return;
|
|
6356
6362
|
}
|
|
6357
6363
|
const id = selectedElement.id;
|
|
6358
6364
|
ops.updateActiveElements(
|
|
6359
|
-
(els) => direction === "forward" ?
|
|
6365
|
+
(els) => direction === "forward" ? chunk3TPQY6WR_js.bringForward(els, id) : direction === "backward" ? chunk3TPQY6WR_js.sendBackward(els, id) : els
|
|
6360
6366
|
);
|
|
6361
6367
|
history.markDirty();
|
|
6362
6368
|
};
|
|
@@ -6366,7 +6372,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6366
6372
|
}
|
|
6367
6373
|
const id = selectedElement.id;
|
|
6368
6374
|
ops.updateActiveElements(
|
|
6369
|
-
(els) => direction === "front" ?
|
|
6375
|
+
(els) => direction === "front" ? chunk3TPQY6WR_js.bringToFront(els, id) : chunk3TPQY6WR_js.sendToBack(els, id)
|
|
6370
6376
|
);
|
|
6371
6377
|
history.markDirty();
|
|
6372
6378
|
};
|
|
@@ -6501,7 +6507,7 @@ function useSlideManagement(input) {
|
|
|
6501
6507
|
} = input;
|
|
6502
6508
|
const handleAddSlideAfter = (afterIndex) => {
|
|
6503
6509
|
const insertAt = Math.max(0, Math.min(afterIndex + 1, slides.length));
|
|
6504
|
-
const newSlide =
|
|
6510
|
+
const newSlide = chunk3TPQY6WR_js.createBlankSlide(slides.length + 1);
|
|
6505
6511
|
ops.updateSlides((prev) => {
|
|
6506
6512
|
const next = [...prev];
|
|
6507
6513
|
next.splice(insertAt, 0, newSlide);
|
|
@@ -6565,7 +6571,7 @@ function useSlideManagement(input) {
|
|
|
6565
6571
|
}
|
|
6566
6572
|
const clone = {
|
|
6567
6573
|
...src,
|
|
6568
|
-
id:
|
|
6574
|
+
id: chunk3TPQY6WR_js.makeSlideId(),
|
|
6569
6575
|
elements: src.elements.map((el) => ({
|
|
6570
6576
|
...el,
|
|
6571
6577
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6597,7 +6603,7 @@ function useSlideManagement(input) {
|
|
|
6597
6603
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6598
6604
|
const insertAt = activeSlideIndex + 1;
|
|
6599
6605
|
const draft = {
|
|
6600
|
-
...
|
|
6606
|
+
...chunk3TPQY6WR_js.createBlankSlide(slides.length + 1),
|
|
6601
6607
|
layoutPath,
|
|
6602
6608
|
...layoutName ? { layoutName } : {}
|
|
6603
6609
|
};
|
|
@@ -6630,9 +6636,9 @@ function useSlideManagement(input) {
|
|
|
6630
6636
|
};
|
|
6631
6637
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6632
6638
|
const insertAt = activeSlideIndex + 1;
|
|
6633
|
-
const draft =
|
|
6639
|
+
const draft = chunk3TPQY6WR_js.buildSlideTemplateSlide(templateId, chunk3TPQY6WR_js.makeSlideId(), slides.length + 1, {
|
|
6634
6640
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6635
|
-
scheme:
|
|
6641
|
+
scheme: chunk3TPQY6WR_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6636
6642
|
});
|
|
6637
6643
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6638
6644
|
setActiveSlideIndex(insertAt);
|
|
@@ -6670,7 +6676,7 @@ function createTableMergeHandlers(input) {
|
|
|
6670
6676
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6671
6677
|
return;
|
|
6672
6678
|
}
|
|
6673
|
-
const newTableData =
|
|
6679
|
+
const newTableData = chunk3TPQY6WR_js.mergeCells(
|
|
6674
6680
|
[
|
|
6675
6681
|
{ row: rowIndex, col: columnIndex },
|
|
6676
6682
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6678,7 +6684,7 @@ function createTableMergeHandlers(input) {
|
|
|
6678
6684
|
td
|
|
6679
6685
|
);
|
|
6680
6686
|
const updates = { tableData: newTableData };
|
|
6681
|
-
const newRawXml =
|
|
6687
|
+
const newRawXml = chunk3TPQY6WR_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6682
6688
|
if (newRawXml) {
|
|
6683
6689
|
updates.rawXml = newRawXml;
|
|
6684
6690
|
}
|
|
@@ -6704,7 +6710,7 @@ function createTableMergeHandlers(input) {
|
|
|
6704
6710
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6705
6711
|
return;
|
|
6706
6712
|
}
|
|
6707
|
-
const newTableData =
|
|
6713
|
+
const newTableData = chunk3TPQY6WR_js.mergeCells(
|
|
6708
6714
|
[
|
|
6709
6715
|
{ row: rowIndex, col: columnIndex },
|
|
6710
6716
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6712,7 +6718,7 @@ function createTableMergeHandlers(input) {
|
|
|
6712
6718
|
td
|
|
6713
6719
|
);
|
|
6714
6720
|
const updates = { tableData: newTableData };
|
|
6715
|
-
const newRawXml =
|
|
6721
|
+
const newRawXml = chunk3TPQY6WR_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6716
6722
|
if (newRawXml) {
|
|
6717
6723
|
updates.rawXml = newRawXml;
|
|
6718
6724
|
}
|
|
@@ -6727,9 +6733,9 @@ function createTableMergeHandlers(input) {
|
|
|
6727
6733
|
return;
|
|
6728
6734
|
}
|
|
6729
6735
|
const td = selectedElement.tableData;
|
|
6730
|
-
const newTableData =
|
|
6736
|
+
const newTableData = chunk3TPQY6WR_js.mergeCells(ts.selectedCells, td);
|
|
6731
6737
|
const updates = { tableData: newTableData };
|
|
6732
|
-
const newRawXml =
|
|
6738
|
+
const newRawXml = chunk3TPQY6WR_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6733
6739
|
if (newRawXml) {
|
|
6734
6740
|
updates.rawXml = newRawXml;
|
|
6735
6741
|
}
|
|
@@ -6746,9 +6752,9 @@ function createTableMergeHandlers(input) {
|
|
|
6746
6752
|
}
|
|
6747
6753
|
const { rowIndex, columnIndex } = ts;
|
|
6748
6754
|
const td = selectedElement.tableData;
|
|
6749
|
-
const newTableData =
|
|
6755
|
+
const newTableData = chunk3TPQY6WR_js.splitCell(rowIndex, columnIndex, td);
|
|
6750
6756
|
const updates = { tableData: newTableData };
|
|
6751
|
-
const newRawXml =
|
|
6757
|
+
const newRawXml = chunk3TPQY6WR_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6752
6758
|
if (newRawXml) {
|
|
6753
6759
|
updates.rawXml = newRawXml;
|
|
6754
6760
|
}
|
|
@@ -6782,10 +6788,10 @@ function createTableStructHandlers(input) {
|
|
|
6782
6788
|
const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
|
|
6783
6789
|
const updates = {};
|
|
6784
6790
|
if (el.tableData) {
|
|
6785
|
-
updates.tableData =
|
|
6791
|
+
updates.tableData = chunk3TPQY6WR_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6786
6792
|
}
|
|
6787
6793
|
if (el.rawXml) {
|
|
6788
|
-
const newRawXml =
|
|
6794
|
+
const newRawXml = chunk3TPQY6WR_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6789
6795
|
if (newRawXml) {
|
|
6790
6796
|
updates.rawXml = newRawXml;
|
|
6791
6797
|
}
|
|
@@ -6809,7 +6815,7 @@ function createTableStructHandlers(input) {
|
|
|
6809
6815
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6810
6816
|
const updates = {};
|
|
6811
6817
|
if (selectedElement.rawXml) {
|
|
6812
|
-
const newRawXml =
|
|
6818
|
+
const newRawXml = chunk3TPQY6WR_js.updateCellTextStyleInRawXml(
|
|
6813
6819
|
selectedElement,
|
|
6814
6820
|
rowIndex,
|
|
6815
6821
|
colIndex,
|
|
@@ -6873,7 +6879,7 @@ function createTableStructHandlers(input) {
|
|
|
6873
6879
|
return;
|
|
6874
6880
|
}
|
|
6875
6881
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6876
|
-
const next =
|
|
6882
|
+
const next = chunk3TPQY6WR_js.insertTableElementRow(selectedElement, rowIdx, position);
|
|
6877
6883
|
ops.updateSelectedElement({ tableData: next.tableData, rawXml: next.rawXml });
|
|
6878
6884
|
history.markDirty();
|
|
6879
6885
|
};
|
|
@@ -6882,7 +6888,7 @@ function createTableStructHandlers(input) {
|
|
|
6882
6888
|
return;
|
|
6883
6889
|
}
|
|
6884
6890
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6885
|
-
const next =
|
|
6891
|
+
const next = chunk3TPQY6WR_js.removeTableElementRow(selectedElement, rowIdx);
|
|
6886
6892
|
if (next === selectedElement) {
|
|
6887
6893
|
return;
|
|
6888
6894
|
}
|
|
@@ -6894,7 +6900,7 @@ function createTableStructHandlers(input) {
|
|
|
6894
6900
|
return;
|
|
6895
6901
|
}
|
|
6896
6902
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6897
|
-
const next =
|
|
6903
|
+
const next = chunk3TPQY6WR_js.insertTableElementColumn(selectedElement, colIdx, position);
|
|
6898
6904
|
ops.updateSelectedElement({ tableData: next.tableData, rawXml: next.rawXml });
|
|
6899
6905
|
history.markDirty();
|
|
6900
6906
|
};
|
|
@@ -6903,7 +6909,7 @@ function createTableStructHandlers(input) {
|
|
|
6903
6909
|
return;
|
|
6904
6910
|
}
|
|
6905
6911
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6906
|
-
const next =
|
|
6912
|
+
const next = chunk3TPQY6WR_js.removeTableElementColumn(selectedElement, colIdx);
|
|
6907
6913
|
if (next === selectedElement) {
|
|
6908
6914
|
return;
|
|
6909
6915
|
}
|
|
@@ -6939,8 +6945,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6939
6945
|
return html2canvasPro(element, {
|
|
6940
6946
|
...options,
|
|
6941
6947
|
onclone: async (doc, clonedEl) => {
|
|
6942
|
-
await
|
|
6943
|
-
|
|
6948
|
+
await chunk3TPQY6WR_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6949
|
+
chunk3TPQY6WR_js.preprocessCssForCapture(clonedEl);
|
|
6944
6950
|
if (typeof userOnClone === "function") {
|
|
6945
6951
|
userOnClone(doc, clonedEl);
|
|
6946
6952
|
}
|
|
@@ -6970,7 +6976,7 @@ function useExportSaveAs(input) {
|
|
|
6970
6976
|
slideSizeEmu
|
|
6971
6977
|
} = input;
|
|
6972
6978
|
const handleSaveAsFormat = async (format) => {
|
|
6973
|
-
const downloadName =
|
|
6979
|
+
const downloadName = chunk3TPQY6WR_js.savedPresentationFileName(filePath, format);
|
|
6974
6980
|
try {
|
|
6975
6981
|
const data = await serializeSlides(format);
|
|
6976
6982
|
if (!data) {
|
|
@@ -6978,16 +6984,16 @@ function useExportSaveAs(input) {
|
|
|
6978
6984
|
}
|
|
6979
6985
|
const mimeType = format === "ppt" ? "application/vnd.ms-powerpoint" : "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
6980
6986
|
const blob = new Blob([data], { type: mimeType });
|
|
6981
|
-
|
|
6987
|
+
chunk3TPQY6WR_js.downloadBlob(blob, downloadName);
|
|
6982
6988
|
} catch (err) {
|
|
6983
6989
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
6984
6990
|
}
|
|
6985
6991
|
};
|
|
6986
6992
|
const handleExportJson = () => {
|
|
6987
6993
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
6988
|
-
const slideSize =
|
|
6994
|
+
const slideSize = chunk3TPQY6WR_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
6989
6995
|
const data = {
|
|
6990
|
-
slides:
|
|
6996
|
+
slides: chunk3TPQY6WR_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
6991
6997
|
width: canvasSize.width,
|
|
6992
6998
|
height: canvasSize.height,
|
|
6993
6999
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7006,7 +7012,7 @@ function useExportSaveAs(input) {
|
|
|
7006
7012
|
handoutMaster
|
|
7007
7013
|
};
|
|
7008
7014
|
try {
|
|
7009
|
-
|
|
7015
|
+
chunk3TPQY6WR_js.exportDeckJson(data, sourceName);
|
|
7010
7016
|
} catch (err) {
|
|
7011
7017
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7012
7018
|
}
|
|
@@ -7071,7 +7077,7 @@ function buildRasterOptions(element, scale, backgroundColor, mode) {
|
|
|
7071
7077
|
}
|
|
7072
7078
|
async function renderElementToRaster(element, scale = 2, backgroundColor, mode = "auto") {
|
|
7073
7079
|
const { width, height } = measureNaturalSize(element);
|
|
7074
|
-
return
|
|
7080
|
+
return chunk3TPQY6WR_js.rasterizeElement(
|
|
7075
7081
|
element,
|
|
7076
7082
|
width,
|
|
7077
7083
|
height,
|
|
@@ -7081,7 +7087,7 @@ async function renderElementToRaster(element, scale = 2, backgroundColor, mode =
|
|
|
7081
7087
|
}
|
|
7082
7088
|
async function renderElementToTiles(element, scale = 2, backgroundColor, mode = "auto") {
|
|
7083
7089
|
const { width, height } = measureNaturalSize(element);
|
|
7084
|
-
return
|
|
7090
|
+
return chunk3TPQY6WR_js.rasterizeElementTiles(
|
|
7085
7091
|
element,
|
|
7086
7092
|
width,
|
|
7087
7093
|
height,
|
|
@@ -7091,7 +7097,7 @@ async function renderElementToTiles(element, scale = 2, backgroundColor, mode =
|
|
|
7091
7097
|
}
|
|
7092
7098
|
async function renderElementToTiledCanvas(element, scale = 2, backgroundColor, mode = "auto") {
|
|
7093
7099
|
const { width, height } = measureNaturalSize(element);
|
|
7094
|
-
return
|
|
7100
|
+
return chunk3TPQY6WR_js.rasterizeElementTiledToCanvas(
|
|
7095
7101
|
element,
|
|
7096
7102
|
width,
|
|
7097
7103
|
height,
|
|
@@ -7113,11 +7119,11 @@ function waitForRender(ms = 100) {
|
|
|
7113
7119
|
async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
7114
7120
|
const { scale = 2, backgroundColor } = options;
|
|
7115
7121
|
const result = await renderElementToRaster(slideElement, scale, backgroundColor);
|
|
7116
|
-
return
|
|
7122
|
+
return chunk3TPQY6WR_js.rasterResultToPngBlob(result);
|
|
7117
7123
|
}
|
|
7118
7124
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
7119
7125
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
7120
|
-
|
|
7126
|
+
chunk3TPQY6WR_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
7121
7127
|
}
|
|
7122
7128
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
7123
7129
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -7146,13 +7152,13 @@ async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActi
|
|
|
7146
7152
|
// src/viewer/utils/export-pdf.ts
|
|
7147
7153
|
function tilesToPdfPage(tilesResult) {
|
|
7148
7154
|
return tilesResult.tiles.map((tile) => ({
|
|
7149
|
-
image:
|
|
7150
|
-
placement:
|
|
7155
|
+
image: chunk3TPQY6WR_js.canvasToJpegData(tile.canvas),
|
|
7156
|
+
placement: chunk3TPQY6WR_js.placeTileOnPage(
|
|
7151
7157
|
tile,
|
|
7152
7158
|
tilesResult.fullWidth,
|
|
7153
7159
|
tilesResult.fullHeight,
|
|
7154
|
-
|
|
7155
|
-
|
|
7160
|
+
chunk3TPQY6WR_js.PDF_SLIDES_PAGE_WIDTH_PT,
|
|
7161
|
+
chunk3TPQY6WR_js.PDF_SLIDES_PAGE_HEIGHT_PT
|
|
7156
7162
|
)
|
|
7157
7163
|
}));
|
|
7158
7164
|
}
|
|
@@ -7179,8 +7185,8 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7179
7185
|
if (pages.length === 0) {
|
|
7180
7186
|
throw new Error(chunk3AJ54EAB_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7181
7187
|
}
|
|
7182
|
-
const pdfBlobUrl =
|
|
7183
|
-
|
|
7188
|
+
const pdfBlobUrl = chunk4CLG3TRU_js.buildPdfFromTiledImageData(pages);
|
|
7189
|
+
chunk3TPQY6WR_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
7184
7190
|
}
|
|
7185
7191
|
async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, slideNotes, filename = "presentation-notes.pdf", options = {}) {
|
|
7186
7192
|
const { scale = 2, onProgress, signal } = options;
|
|
@@ -7209,8 +7215,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7209
7215
|
if (pages.length === 0) {
|
|
7210
7216
|
throw new Error(chunk3AJ54EAB_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7211
7217
|
}
|
|
7212
|
-
const pdfDataUrl =
|
|
7213
|
-
|
|
7218
|
+
const pdfDataUrl = chunk4CLG3TRU_js.buildNotesPdf(pages);
|
|
7219
|
+
chunk3TPQY6WR_js.downloadDataUrl(pdfDataUrl, filename);
|
|
7214
7220
|
}
|
|
7215
7221
|
|
|
7216
7222
|
// src/viewer/utils/export-video.ts
|
|
@@ -7254,7 +7260,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7254
7260
|
const fps = 30;
|
|
7255
7261
|
const stream = recordingCanvas.captureStream(fps);
|
|
7256
7262
|
const recorder = new MediaRecorder(stream, {
|
|
7257
|
-
mimeType:
|
|
7263
|
+
mimeType: chunk3TPQY6WR_js.pickSupportedMimeType([...chunk3TPQY6WR_js.WEBM_MIME_CANDIDATES]),
|
|
7258
7264
|
videoBitsPerSecond: 5e6
|
|
7259
7265
|
});
|
|
7260
7266
|
const chunks = [];
|
|
@@ -7277,8 +7283,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7277
7283
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
7278
7284
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
7279
7285
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
7280
|
-
const frameInterval =
|
|
7281
|
-
const framesNeeded =
|
|
7286
|
+
const frameInterval = chunk3TPQY6WR_js.fpsToFrameIntervalMs(fps);
|
|
7287
|
+
const framesNeeded = chunk3TPQY6WR_js.segmentFrameCount(duration, fps);
|
|
7282
7288
|
for (let f = 0; f < framesNeeded; f++) {
|
|
7283
7289
|
if (signal?.aborted) {
|
|
7284
7290
|
recorder.stop();
|
|
@@ -7298,7 +7304,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7298
7304
|
|
|
7299
7305
|
// src/viewer/utils/export-gif.ts
|
|
7300
7306
|
function frameFromCanvas(canvas, maxSide) {
|
|
7301
|
-
const { width, height } =
|
|
7307
|
+
const { width, height } = chunk3TPQY6WR_js.clampGifDimensions(canvas.width, canvas.height, maxSide);
|
|
7302
7308
|
let source = canvas;
|
|
7303
7309
|
if (width !== canvas.width || height !== canvas.height) {
|
|
7304
7310
|
const scaled = canvas.ownerDocument.createElement("canvas");
|
|
@@ -7321,7 +7327,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7321
7327
|
const {
|
|
7322
7328
|
scale = 0.5,
|
|
7323
7329
|
slideDurationMs = 2e3,
|
|
7324
|
-
maxSide =
|
|
7330
|
+
maxSide = chunk3TPQY6WR_js.GIF_POST_CAPTURE_MAX_SIDE,
|
|
7325
7331
|
onProgress,
|
|
7326
7332
|
signal
|
|
7327
7333
|
} = options;
|
|
@@ -7348,7 +7354,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7348
7354
|
if (frames.length === 0) {
|
|
7349
7355
|
throw new Error(chunk3AJ54EAB_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
7350
7356
|
}
|
|
7351
|
-
const gifBytes =
|
|
7357
|
+
const gifBytes = chunk3TPQY6WR_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
7352
7358
|
onProgress?.(totalSlides, totalSlides);
|
|
7353
7359
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
7354
7360
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -7402,7 +7408,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7402
7408
|
continue;
|
|
7403
7409
|
}
|
|
7404
7410
|
onProgress?.(processedCount, data.slides.length);
|
|
7405
|
-
let svg =
|
|
7411
|
+
let svg = chunk3TPQY6WR_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7406
7412
|
if (embedFonts && fontFaces?.length) {
|
|
7407
7413
|
svg = injectFontFaces(svg, fontFaces);
|
|
7408
7414
|
}
|
|
@@ -7454,7 +7460,7 @@ function useExportMediaHandlers(input) {
|
|
|
7454
7460
|
setExportProgress(0);
|
|
7455
7461
|
setExportModalOpen(true);
|
|
7456
7462
|
try {
|
|
7457
|
-
const { scale } =
|
|
7463
|
+
const { scale } = chunk3TPQY6WR_js.resolveExportCaptureDecision(imageResolutionScale, "video");
|
|
7458
7464
|
const blob = await exportAllSlidesAsVideo(
|
|
7459
7465
|
canvasStageRef,
|
|
7460
7466
|
slides.length,
|
|
@@ -7464,22 +7470,22 @@ function useExportMediaHandlers(input) {
|
|
|
7464
7470
|
scale,
|
|
7465
7471
|
slideDurationMs: 3e3,
|
|
7466
7472
|
onProgress: (current, total) => {
|
|
7467
|
-
setExportProgress(
|
|
7468
|
-
setExportStatusMessage(
|
|
7473
|
+
setExportProgress(chunk3TPQY6WR_js.slideProgressPercent(current, total, 45));
|
|
7474
|
+
setExportStatusMessage(chunk3TPQY6WR_js.slideStatusLabel("Capturing", current, total));
|
|
7469
7475
|
},
|
|
7470
7476
|
onRecordProgress: (current, total) => {
|
|
7471
|
-
setExportProgress(
|
|
7472
|
-
setExportStatusMessage(
|
|
7477
|
+
setExportProgress(chunk3TPQY6WR_js.recordProgressPercent(current, total));
|
|
7478
|
+
setExportStatusMessage(chunk3TPQY6WR_js.slideStatusLabel("Recording", current, total));
|
|
7473
7479
|
},
|
|
7474
7480
|
signal: abortCtrl.signal
|
|
7475
7481
|
}
|
|
7476
7482
|
);
|
|
7477
|
-
setExportProgress(
|
|
7483
|
+
setExportProgress(chunk3TPQY6WR_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7478
7484
|
setExportStatusMessage("Saving file...");
|
|
7479
|
-
|
|
7480
|
-
setExportProgress(
|
|
7485
|
+
chunk3TPQY6WR_js.downloadBlob(blob, "presentation.webm");
|
|
7486
|
+
setExportProgress(chunk3TPQY6WR_js.EXPORT_DONE_PERCENT);
|
|
7481
7487
|
} catch (err) {
|
|
7482
|
-
if (!
|
|
7488
|
+
if (!chunk3TPQY6WR_js.isExportAbortError(err)) {
|
|
7483
7489
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7484
7490
|
}
|
|
7485
7491
|
} finally {
|
|
@@ -7509,7 +7515,7 @@ function useExportMediaHandlers(input) {
|
|
|
7509
7515
|
setExportProgress(0);
|
|
7510
7516
|
setExportModalOpen(true);
|
|
7511
7517
|
try {
|
|
7512
|
-
const { scale, postCaptureMaxSide } =
|
|
7518
|
+
const { scale, postCaptureMaxSide } = chunk3TPQY6WR_js.resolveExportCaptureDecision(
|
|
7513
7519
|
imageResolutionScale,
|
|
7514
7520
|
"gif"
|
|
7515
7521
|
);
|
|
@@ -7523,18 +7529,18 @@ function useExportMediaHandlers(input) {
|
|
|
7523
7529
|
maxSide: postCaptureMaxSide,
|
|
7524
7530
|
slideDurationMs: 2e3,
|
|
7525
7531
|
onProgress: (current, total) => {
|
|
7526
|
-
setExportProgress(
|
|
7527
|
-
setExportStatusMessage(
|
|
7532
|
+
setExportProgress(chunk3TPQY6WR_js.slideProgressPercent(current, total));
|
|
7533
|
+
setExportStatusMessage(chunk3TPQY6WR_js.slideStatusLabel("Encoding", current, total));
|
|
7528
7534
|
},
|
|
7529
7535
|
signal: abortCtrl.signal
|
|
7530
7536
|
}
|
|
7531
7537
|
);
|
|
7532
|
-
setExportProgress(
|
|
7538
|
+
setExportProgress(chunk3TPQY6WR_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7533
7539
|
setExportStatusMessage("Saving file...");
|
|
7534
|
-
|
|
7535
|
-
setExportProgress(
|
|
7540
|
+
chunk3TPQY6WR_js.downloadBlob(blob, "presentation.gif");
|
|
7541
|
+
setExportProgress(chunk3TPQY6WR_js.EXPORT_DONE_PERCENT);
|
|
7536
7542
|
} catch (err) {
|
|
7537
|
-
if (!
|
|
7543
|
+
if (!chunk3TPQY6WR_js.isExportAbortError(err)) {
|
|
7538
7544
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7539
7545
|
}
|
|
7540
7546
|
} finally {
|
|
@@ -7660,21 +7666,21 @@ function useExportHandlers(input) {
|
|
|
7660
7666
|
{
|
|
7661
7667
|
scale: imageExportScale,
|
|
7662
7668
|
onProgress: (current, total) => {
|
|
7663
|
-
setExportProgress(
|
|
7664
|
-
setExportStatusMessage(
|
|
7669
|
+
setExportProgress(chunk3TPQY6WR_js.slideProgressPercent(current, total));
|
|
7670
|
+
setExportStatusMessage(chunk3TPQY6WR_js.slideStatusLabel("Rendering", current, total));
|
|
7665
7671
|
},
|
|
7666
7672
|
signal: abortCtrl.signal
|
|
7667
7673
|
}
|
|
7668
7674
|
);
|
|
7669
|
-
setExportProgress(
|
|
7675
|
+
setExportProgress(chunk3TPQY6WR_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7670
7676
|
setExportStatusMessage("Building PDF...");
|
|
7671
7677
|
await new Promise((r) => {
|
|
7672
7678
|
setTimeout(r, 100);
|
|
7673
7679
|
});
|
|
7674
|
-
setExportProgress(
|
|
7680
|
+
setExportProgress(chunk3TPQY6WR_js.EXPORT_DONE_PERCENT);
|
|
7675
7681
|
setExportStatusMessage("Done!");
|
|
7676
7682
|
} catch (err) {
|
|
7677
|
-
if (!
|
|
7683
|
+
if (!chunk3TPQY6WR_js.isExportAbortError(err)) {
|
|
7678
7684
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7679
7685
|
}
|
|
7680
7686
|
} finally {
|
|
@@ -7704,21 +7710,21 @@ function useExportHandlers(input) {
|
|
|
7704
7710
|
{
|
|
7705
7711
|
scale: imageExportScale,
|
|
7706
7712
|
onProgress: (current, total) => {
|
|
7707
|
-
setExportProgress(
|
|
7708
|
-
setExportStatusMessage(
|
|
7713
|
+
setExportProgress(chunk3TPQY6WR_js.slideProgressPercent(current, total));
|
|
7714
|
+
setExportStatusMessage(chunk3TPQY6WR_js.slideStatusLabel("Rendering", current, total));
|
|
7709
7715
|
},
|
|
7710
7716
|
signal: abortCtrl.signal
|
|
7711
7717
|
}
|
|
7712
7718
|
);
|
|
7713
|
-
setExportProgress(
|
|
7719
|
+
setExportProgress(chunk3TPQY6WR_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7714
7720
|
setExportStatusMessage("Building PDF...");
|
|
7715
7721
|
await new Promise((r) => {
|
|
7716
7722
|
setTimeout(r, 100);
|
|
7717
7723
|
});
|
|
7718
|
-
setExportProgress(
|
|
7724
|
+
setExportProgress(chunk3TPQY6WR_js.EXPORT_DONE_PERCENT);
|
|
7719
7725
|
setExportStatusMessage("Done!");
|
|
7720
7726
|
} catch (err) {
|
|
7721
|
-
if (!
|
|
7727
|
+
if (!chunk3TPQY6WR_js.isExportAbortError(err)) {
|
|
7722
7728
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7723
7729
|
}
|
|
7724
7730
|
} finally {
|
|
@@ -7766,7 +7772,7 @@ function useExportHandlers(input) {
|
|
|
7766
7772
|
exportStatusMessage
|
|
7767
7773
|
};
|
|
7768
7774
|
}
|
|
7769
|
-
var ViewerOptionsContext = react.createContext(
|
|
7775
|
+
var ViewerOptionsContext = react.createContext(chunk3TPQY6WR_js.DEFAULT_VIEWER_OPTIONS);
|
|
7770
7776
|
function useViewerOptionsContext() {
|
|
7771
7777
|
return react.useContext(ViewerOptionsContext);
|
|
7772
7778
|
}
|
|
@@ -7778,13 +7784,13 @@ function usePrintHandlers(input) {
|
|
|
7778
7784
|
const { t } = reactI18next.useTranslation();
|
|
7779
7785
|
const viewerOptions = useViewerOptionsContext();
|
|
7780
7786
|
const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
|
|
7781
|
-
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) *
|
|
7787
|
+
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunk3TPQY6WR_js.resolveImageResolutionScale(viewerOptions);
|
|
7782
7788
|
const handlePrint = () => {
|
|
7783
7789
|
setIsPrintDialogOpen(true);
|
|
7784
7790
|
};
|
|
7785
7791
|
const handlePrintSvg = async (settings) => {
|
|
7786
7792
|
setIsPrintDialogOpen(false);
|
|
7787
|
-
const printWindow =
|
|
7793
|
+
const printWindow = chunk3TPQY6WR_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7788
7794
|
if (!printWindow) {
|
|
7789
7795
|
console.warn(
|
|
7790
7796
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7794,9 +7800,9 @@ function usePrintHandlers(input) {
|
|
|
7794
7800
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7795
7801
|
return runRasterPrint(printWindow, settings);
|
|
7796
7802
|
}
|
|
7797
|
-
const colorFilter =
|
|
7798
|
-
const slideIndices =
|
|
7799
|
-
|
|
7803
|
+
const colorFilter = chunk3TPQY6WR_js.computeColorFilter(settings.colorMode);
|
|
7804
|
+
const slideIndices = chunk3TPQY6WR_js.filterHiddenSlideIndices(
|
|
7805
|
+
chunk3TPQY6WR_js.computeSlideIndices(
|
|
7800
7806
|
settings.slideRange,
|
|
7801
7807
|
activeSlideIndex,
|
|
7802
7808
|
slides.length,
|
|
@@ -7814,22 +7820,22 @@ function usePrintHandlers(input) {
|
|
|
7814
7820
|
printWindow.close();
|
|
7815
7821
|
return;
|
|
7816
7822
|
}
|
|
7817
|
-
const printDoc =
|
|
7823
|
+
const printDoc = chunk3TPQY6WR_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7818
7824
|
title: "Slides (Vector)",
|
|
7819
7825
|
orientation: settings.orientation,
|
|
7820
7826
|
colorFilter,
|
|
7821
7827
|
scaleToFit: settings.scaleToFit
|
|
7822
7828
|
});
|
|
7823
|
-
|
|
7829
|
+
chunk3TPQY6WR_js.finishPrintWindow(printWindow, printDoc);
|
|
7824
7830
|
} catch (err) {
|
|
7825
7831
|
console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
|
|
7826
7832
|
return runRasterPrint(printWindow, settings);
|
|
7827
7833
|
}
|
|
7828
7834
|
};
|
|
7829
7835
|
const runRasterPrint = async (printWindow, settings) => {
|
|
7830
|
-
const colorFilter =
|
|
7831
|
-
const slideIndices =
|
|
7832
|
-
|
|
7836
|
+
const colorFilter = chunk3TPQY6WR_js.computeColorFilter(settings.colorMode);
|
|
7837
|
+
const slideIndices = chunk3TPQY6WR_js.filterHiddenSlideIndices(
|
|
7838
|
+
chunk3TPQY6WR_js.computeSlideIndices(
|
|
7833
7839
|
settings.slideRange,
|
|
7834
7840
|
activeSlideIndex,
|
|
7835
7841
|
slides.length,
|
|
@@ -7840,11 +7846,11 @@ function usePrintHandlers(input) {
|
|
|
7840
7846
|
includeHiddenSlides
|
|
7841
7847
|
);
|
|
7842
7848
|
if (settings.printWhat === "outline") {
|
|
7843
|
-
|
|
7849
|
+
chunk3TPQY6WR_js.finishPrintWindow(
|
|
7844
7850
|
printWindow,
|
|
7845
|
-
|
|
7851
|
+
chunk3TPQY6WR_js.buildPrintHtmlDocument({
|
|
7846
7852
|
title: "Outline",
|
|
7847
|
-
bodyHtml: `<div class="outline-page">${
|
|
7853
|
+
bodyHtml: `<div class="outline-page">${chunk3TPQY6WR_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7848
7854
|
orientation: settings.orientation,
|
|
7849
7855
|
colorFilter,
|
|
7850
7856
|
frameSlides: settings.frameSlides,
|
|
@@ -7871,11 +7877,11 @@ function usePrintHandlers(input) {
|
|
|
7871
7877
|
}
|
|
7872
7878
|
const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
|
|
7873
7879
|
if (settings.printWhat === "slides") {
|
|
7874
|
-
|
|
7880
|
+
chunk3TPQY6WR_js.finishPrintWindow(
|
|
7875
7881
|
printWindow,
|
|
7876
|
-
|
|
7882
|
+
chunk3TPQY6WR_js.buildPrintHtmlDocument({
|
|
7877
7883
|
title: "Slides",
|
|
7878
|
-
bodyHtml:
|
|
7884
|
+
bodyHtml: chunk3TPQY6WR_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7879
7885
|
orientation: settings.orientation,
|
|
7880
7886
|
colorFilter,
|
|
7881
7887
|
frameSlides: settings.frameSlides,
|
|
@@ -7885,11 +7891,11 @@ function usePrintHandlers(input) {
|
|
|
7885
7891
|
return;
|
|
7886
7892
|
}
|
|
7887
7893
|
if (settings.printWhat === "notes") {
|
|
7888
|
-
|
|
7894
|
+
chunk3TPQY6WR_js.finishPrintWindow(
|
|
7889
7895
|
printWindow,
|
|
7890
|
-
|
|
7896
|
+
chunk3TPQY6WR_js.buildPrintHtmlDocument({
|
|
7891
7897
|
title: "Notes Pages",
|
|
7892
|
-
bodyHtml:
|
|
7898
|
+
bodyHtml: chunk3TPQY6WR_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7893
7899
|
orientation: "portrait",
|
|
7894
7900
|
colorFilter,
|
|
7895
7901
|
frameSlides: settings.frameSlides,
|
|
@@ -7900,11 +7906,11 @@ function usePrintHandlers(input) {
|
|
|
7900
7906
|
}
|
|
7901
7907
|
if (settings.printWhat === "handouts") {
|
|
7902
7908
|
const spp = settings.slidesPerPage;
|
|
7903
|
-
|
|
7909
|
+
chunk3TPQY6WR_js.finishPrintWindow(
|
|
7904
7910
|
printWindow,
|
|
7905
|
-
|
|
7911
|
+
chunk3TPQY6WR_js.buildPrintHtmlDocument({
|
|
7906
7912
|
title: `Handout ${spp} per page`,
|
|
7907
|
-
bodyHtml:
|
|
7913
|
+
bodyHtml: chunk3TPQY6WR_js.buildHandoutsHtml(slideImages, slideIndices, spp, pptxData?.handoutMaster),
|
|
7908
7914
|
orientation: "portrait",
|
|
7909
7915
|
colorFilter,
|
|
7910
7916
|
frameSlides: settings.frameSlides,
|
|
@@ -7918,7 +7924,7 @@ function usePrintHandlers(input) {
|
|
|
7918
7924
|
};
|
|
7919
7925
|
const handlePrintWithSettings = async (settings) => {
|
|
7920
7926
|
setIsPrintDialogOpen(false);
|
|
7921
|
-
const printWindow =
|
|
7927
|
+
const printWindow = chunk3TPQY6WR_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7922
7928
|
if (!printWindow) {
|
|
7923
7929
|
console.warn(
|
|
7924
7930
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7983,13 +7989,13 @@ function useThemeHandlers(input) {
|
|
|
7983
7989
|
return;
|
|
7984
7990
|
}
|
|
7985
7991
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7986
|
-
const previousMap = theme?.colorScheme ?
|
|
7987
|
-
setSlides((prev) =>
|
|
7992
|
+
const previousMap = theme?.colorScheme ? chunk3TPQY6WR_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7993
|
+
setSlides((prev) => chunk3TPQY6WR_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7988
7994
|
if (Object.keys(templateElementsBySlideId).length > 0) {
|
|
7989
7995
|
setTemplateElementsBySlideId((prev) => {
|
|
7990
7996
|
const next = {};
|
|
7991
7997
|
for (const [slideId, elements] of Object.entries(prev)) {
|
|
7992
|
-
next[slideId] =
|
|
7998
|
+
next[slideId] = chunk3TPQY6WR_js.reResolveElementColors(elements, previousMap, colorScheme);
|
|
7993
7999
|
}
|
|
7994
8000
|
return next;
|
|
7995
8001
|
});
|
|
@@ -8098,7 +8104,7 @@ function useThemeSwitching(input) {
|
|
|
8098
8104
|
}
|
|
8099
8105
|
try {
|
|
8100
8106
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
8101
|
-
const newData =
|
|
8107
|
+
const newData = chunk3TPQY6WR_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
8102
8108
|
onDataChange(newData);
|
|
8103
8109
|
onThemeChanged?.(preset);
|
|
8104
8110
|
} catch (error) {
|
|
@@ -8115,7 +8121,7 @@ function useThemeSwitching(input) {
|
|
|
8115
8121
|
}
|
|
8116
8122
|
try {
|
|
8117
8123
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
8118
|
-
const newData =
|
|
8124
|
+
const newData = chunk3TPQY6WR_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
8119
8125
|
onDataChange(newData);
|
|
8120
8126
|
} catch (error) {
|
|
8121
8127
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -8127,12 +8133,12 @@ function useThemeSwitching(input) {
|
|
|
8127
8133
|
if (!data?.theme?.colorScheme) {
|
|
8128
8134
|
return void 0;
|
|
8129
8135
|
}
|
|
8130
|
-
return
|
|
8131
|
-
(p) =>
|
|
8136
|
+
return chunk3TPQY6WR_js.THEME_PRESETS.find(
|
|
8137
|
+
(p) => chunk3TPQY6WR_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
8132
8138
|
);
|
|
8133
8139
|
}, [data?.theme?.colorScheme]);
|
|
8134
8140
|
return {
|
|
8135
|
-
presets:
|
|
8141
|
+
presets: chunk3TPQY6WR_js.THEME_PRESETS,
|
|
8136
8142
|
switchToPreset,
|
|
8137
8143
|
switchToCustom,
|
|
8138
8144
|
currentPreset
|
|
@@ -8207,7 +8213,7 @@ function usePropertyHandlers(input) {
|
|
|
8207
8213
|
}
|
|
8208
8214
|
try {
|
|
8209
8215
|
const ab = await file.arrayBuffer();
|
|
8210
|
-
const h = new
|
|
8216
|
+
const h = new chunk3TPQY6WR_js.PptxHandler();
|
|
8211
8217
|
const other = await h.load(ab);
|
|
8212
8218
|
if (!other) {
|
|
8213
8219
|
return;
|
|
@@ -8217,7 +8223,7 @@ function usePropertyHandlers(input) {
|
|
|
8217
8223
|
width: canvasSize.width,
|
|
8218
8224
|
height: canvasSize.height
|
|
8219
8225
|
};
|
|
8220
|
-
setCompareResult(
|
|
8226
|
+
setCompareResult(chunk3TPQY6WR_js.comparePresentation(cur, other));
|
|
8221
8227
|
setIsComparePanelOpen(true);
|
|
8222
8228
|
} catch (err) {
|
|
8223
8229
|
console.warn("Compare failed:", err);
|
|
@@ -8234,7 +8240,7 @@ function usePropertyHandlers(input) {
|
|
|
8234
8240
|
if (!diff || diff.status === "unchanged") {
|
|
8235
8241
|
return;
|
|
8236
8242
|
}
|
|
8237
|
-
setSlides((prev) =>
|
|
8243
|
+
setSlides((prev) => chunk3TPQY6WR_js.applyAcceptSlide(prev, diff));
|
|
8238
8244
|
setIsDirty(true);
|
|
8239
8245
|
},
|
|
8240
8246
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -8245,10 +8251,10 @@ function usePropertyHandlers(input) {
|
|
|
8245
8251
|
if (!compareResult) {
|
|
8246
8252
|
return;
|
|
8247
8253
|
}
|
|
8248
|
-
setSlides((prev) =>
|
|
8254
|
+
setSlides((prev) => chunk3TPQY6WR_js.applyAcceptAllSlides(prev, compareResult));
|
|
8249
8255
|
setIsDirty(true);
|
|
8250
8256
|
}, [compareResult, setSlides, setIsDirty]);
|
|
8251
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
8257
|
+
const usedFontFamilies = react.useMemo(() => chunk3TPQY6WR_js.collectUsedFonts(slides), [slides]);
|
|
8252
8258
|
return {
|
|
8253
8259
|
handleUpdateNotes,
|
|
8254
8260
|
handleUpdateSlide,
|
|
@@ -8403,7 +8409,7 @@ function useViewerDialogs(input) {
|
|
|
8403
8409
|
);
|
|
8404
8410
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8405
8411
|
const fontEmbedding = react.useMemo(
|
|
8406
|
-
() =>
|
|
8412
|
+
() => chunk3TPQY6WR_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8407
8413
|
[embeddedFontKey]
|
|
8408
8414
|
);
|
|
8409
8415
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8413,11 +8419,11 @@ function useViewerDialogs(input) {
|
|
|
8413
8419
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8414
8420
|
}
|
|
8415
8421
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8416
|
-
() => typeof window !== "undefined" ?
|
|
8422
|
+
() => typeof window !== "undefined" ? chunk3TPQY6WR_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8417
8423
|
);
|
|
8418
8424
|
react.useEffect(() => {
|
|
8419
8425
|
const handleWindow = () => setIsNarrowViewport(
|
|
8420
|
-
|
|
8426
|
+
chunk3TPQY6WR_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8421
8427
|
);
|
|
8422
8428
|
window.addEventListener("resize", handleWindow);
|
|
8423
8429
|
return () => window.removeEventListener("resize", handleWindow);
|
|
@@ -8570,16 +8576,16 @@ function useViewerDialogs(input) {
|
|
|
8570
8576
|
};
|
|
8571
8577
|
}
|
|
8572
8578
|
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8573
|
-
return
|
|
8579
|
+
return chunk3TPQY6WR_js.computeGridSpacingPx(documentGridSpacing, chunk4CLG3TRU_js.GRID_SIZE);
|
|
8574
8580
|
}
|
|
8575
8581
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
8576
8582
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8577
|
-
const authoredRange =
|
|
8578
|
-
return
|
|
8583
|
+
const authoredRange = chunk3TPQY6WR_js.resolveAuthoredSlideRange(presentationProperties, slides.length);
|
|
8584
|
+
return chunk3TPQY6WR_js.resolveShowSlideIndexes(slides, activeShow, authoredRange);
|
|
8579
8585
|
}
|
|
8580
8586
|
function computeSlideSectionGroups(slides, sections) {
|
|
8581
|
-
return
|
|
8582
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8587
|
+
return chunk3TPQY6WR_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8588
|
+
id: group.section?.id ?? (sections.length > 0 ? chunk4CLG3TRU_js.UNGROUPED_SECTION_ID : chunk4CLG3TRU_js.DEFAULT_SECTION_GROUP_ID),
|
|
8583
8589
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8584
8590
|
slideIndexes: group.slideIndexes,
|
|
8585
8591
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8591,7 +8597,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8591
8597
|
return void 0;
|
|
8592
8598
|
}
|
|
8593
8599
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8594
|
-
return
|
|
8600
|
+
return chunk3TPQY6WR_js.masterViewPseudoSlide(document2, {
|
|
8595
8601
|
tab: "slides",
|
|
8596
8602
|
masterIndex: 0,
|
|
8597
8603
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8619,15 +8625,15 @@ function useDerivedSlideState(input) {
|
|
|
8619
8625
|
[slides, activeCustomShowId, customShows, presentationProperties]
|
|
8620
8626
|
);
|
|
8621
8627
|
const authoredRange = react.useMemo(
|
|
8622
|
-
() =>
|
|
8628
|
+
() => chunk3TPQY6WR_js.resolveAuthoredSlideRange(presentationProperties, slides.length),
|
|
8623
8629
|
[presentationProperties, slides.length]
|
|
8624
8630
|
);
|
|
8625
8631
|
const slideSectionGroups = react.useMemo(
|
|
8626
8632
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8627
|
-
if (group.id ===
|
|
8633
|
+
if (group.id === chunk4CLG3TRU_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8628
8634
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8629
8635
|
}
|
|
8630
|
-
if (group.id ===
|
|
8636
|
+
if (group.id === chunk4CLG3TRU_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8631
8637
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8632
8638
|
}
|
|
8633
8639
|
return group;
|
|
@@ -8728,13 +8734,13 @@ function useAnnotationHandlers(input) {
|
|
|
8728
8734
|
}, [annotations, setMode, setSlides, history]);
|
|
8729
8735
|
const handleSetMode = react.useCallback(
|
|
8730
8736
|
(nextMode) => {
|
|
8731
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8737
|
+
if (mode === "present" && nextMode !== "present" && !chunk3TPQY6WR_js.mayLeaveSlideShow()) {
|
|
8732
8738
|
return;
|
|
8733
8739
|
}
|
|
8734
8740
|
if (nextMode === "present") {
|
|
8735
8741
|
presentation.enterPresentMode();
|
|
8736
8742
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8737
|
-
|
|
8743
|
+
chunk3TPQY6WR_js.stopAllPersistentAudio();
|
|
8738
8744
|
if (promptKeepInkAnnotations) {
|
|
8739
8745
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8740
8746
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8744,7 +8750,7 @@ function useAnnotationHandlers(input) {
|
|
|
8744
8750
|
}
|
|
8745
8751
|
} else {
|
|
8746
8752
|
if (mode === "present") {
|
|
8747
|
-
|
|
8753
|
+
chunk3TPQY6WR_js.stopAllPersistentAudio();
|
|
8748
8754
|
}
|
|
8749
8755
|
setMode(nextMode);
|
|
8750
8756
|
}
|
|
@@ -8813,13 +8819,13 @@ function useSerialize(input) {
|
|
|
8813
8819
|
let processedSlide = slide;
|
|
8814
8820
|
if (pendingEditId) {
|
|
8815
8821
|
const updatedElements = slide.elements.map((el) => {
|
|
8816
|
-
if (el.id !== pendingEditId || !
|
|
8822
|
+
if (el.id !== pendingEditId || !chunk3TPQY6WR_js.hasTextProperties(el)) {
|
|
8817
8823
|
return el;
|
|
8818
8824
|
}
|
|
8819
8825
|
return {
|
|
8820
8826
|
...el,
|
|
8821
8827
|
text: pendingEditText,
|
|
8822
|
-
textSegments:
|
|
8828
|
+
textSegments: chunk3TPQY6WR_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8823
8829
|
};
|
|
8824
8830
|
});
|
|
8825
8831
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8832,19 +8838,19 @@ function useSerialize(input) {
|
|
|
8832
8838
|
const pptxGuides = guides.map((g) => ({
|
|
8833
8839
|
id: g.id,
|
|
8834
8840
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8835
|
-
positionEmu:
|
|
8841
|
+
positionEmu: chunk3TPQY6WR_js.guidePxToEmu(g.position)
|
|
8836
8842
|
}));
|
|
8837
8843
|
return {
|
|
8838
8844
|
...processedSlide,
|
|
8839
8845
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8840
8846
|
};
|
|
8841
8847
|
});
|
|
8842
|
-
const slidesToSave =
|
|
8843
|
-
const saveOptions =
|
|
8848
|
+
const slidesToSave = chunk3TPQY6WR_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8849
|
+
const saveOptions = chunk3TPQY6WR_js.buildDeckSaveOptions({
|
|
8844
8850
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8845
8851
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8846
8852
|
// slide-size edit reaches the file.
|
|
8847
|
-
slideSize:
|
|
8853
|
+
slideSize: chunk3TPQY6WR_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8848
8854
|
headerFooter,
|
|
8849
8855
|
presentationProperties,
|
|
8850
8856
|
viewProperties,
|
|
@@ -8863,7 +8869,7 @@ function useSerialize(input) {
|
|
|
8863
8869
|
embedFonts,
|
|
8864
8870
|
outputFormat: format
|
|
8865
8871
|
});
|
|
8866
|
-
return
|
|
8872
|
+
return chunk3TPQY6WR_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8867
8873
|
},
|
|
8868
8874
|
[
|
|
8869
8875
|
slides,
|
|
@@ -8904,7 +8910,7 @@ function useRecoveryDetection(input) {
|
|
|
8904
8910
|
const onRestore = input.onRestore;
|
|
8905
8911
|
const openVersionHistory = input.openVersionHistory;
|
|
8906
8912
|
react.useEffect(() => {
|
|
8907
|
-
if (!
|
|
8913
|
+
if (!chunk3TPQY6WR_js.shouldProbeAutosaveRecovery({
|
|
8908
8914
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8909
8915
|
filePath,
|
|
8910
8916
|
loading,
|
|
@@ -8916,7 +8922,7 @@ function useRecoveryDetection(input) {
|
|
|
8916
8922
|
}
|
|
8917
8923
|
recoveryCheckedRef.current = true;
|
|
8918
8924
|
void (async () => {
|
|
8919
|
-
const offer = await
|
|
8925
|
+
const offer = await chunk3TPQY6WR_js.probeAutosaveRecovery(filePath);
|
|
8920
8926
|
if (!offer) {
|
|
8921
8927
|
return;
|
|
8922
8928
|
}
|
|
@@ -8929,7 +8935,7 @@ function useRecoveryDetection(input) {
|
|
|
8929
8935
|
const record = recordRef.current;
|
|
8930
8936
|
setPrompt(null);
|
|
8931
8937
|
if (record && onRestore) {
|
|
8932
|
-
onRestore(
|
|
8938
|
+
onRestore(chunk3TPQY6WR_js.acceptAutosaveRecovery(record));
|
|
8933
8939
|
}
|
|
8934
8940
|
recordRef.current = null;
|
|
8935
8941
|
}, [onRestore]);
|
|
@@ -8938,7 +8944,7 @@ function useRecoveryDetection(input) {
|
|
|
8938
8944
|
setPrompt(null);
|
|
8939
8945
|
recordRef.current = null;
|
|
8940
8946
|
if (record) {
|
|
8941
|
-
void
|
|
8947
|
+
void chunk3TPQY6WR_js.discardAutosaveRecovery(record);
|
|
8942
8948
|
}
|
|
8943
8949
|
}, []);
|
|
8944
8950
|
return { prompt, restore, discard };
|
|
@@ -8989,11 +8995,11 @@ function usePresentationSetup(input) {
|
|
|
8989
8995
|
containerRef,
|
|
8990
8996
|
content,
|
|
8991
8997
|
onSetMode: (nextMode) => {
|
|
8992
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8998
|
+
if (mode === "present" && nextMode !== "present" && !chunk3TPQY6WR_js.mayLeaveSlideShow()) {
|
|
8993
8999
|
return;
|
|
8994
9000
|
}
|
|
8995
9001
|
if (mode === "present" && nextMode !== "present") {
|
|
8996
|
-
|
|
9002
|
+
chunk3TPQY6WR_js.stopAllPersistentAudio();
|
|
8997
9003
|
stopAnimationSound();
|
|
8998
9004
|
const exitHandler = exitModeHandlerRef.current;
|
|
8999
9005
|
if (exitHandler) {
|
|
@@ -9061,10 +9067,10 @@ function usePresentationSetup(input) {
|
|
|
9061
9067
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
9062
9068
|
onToggleSubtitles,
|
|
9063
9069
|
onSaveRehearsalTimings: (timings) => {
|
|
9064
|
-
setSlides((prev) =>
|
|
9070
|
+
setSlides((prev) => chunk3TPQY6WR_js.applyRehearsalTimings(prev, timings));
|
|
9065
9071
|
history.markDirty();
|
|
9066
9072
|
},
|
|
9067
|
-
loopContinuously:
|
|
9073
|
+
loopContinuously: chunk3TPQY6WR_js.shouldLoopContinuously(presentationProperties),
|
|
9068
9074
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
9069
9075
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
9070
9076
|
endWithBlackSlide,
|
|
@@ -9271,7 +9277,7 @@ function useEditorOperations(input) {
|
|
|
9271
9277
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9272
9278
|
react.useEffect(() => {
|
|
9273
9279
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9274
|
-
copiedFormatRef.current =
|
|
9280
|
+
copiedFormatRef.current = chunk3TPQY6WR_js.copyFormatFromElement(selectedElement);
|
|
9275
9281
|
} else if (!formatPainterActive) {
|
|
9276
9282
|
copiedFormatRef.current = null;
|
|
9277
9283
|
}
|
|
@@ -9297,12 +9303,12 @@ function useEditorOperations(input) {
|
|
|
9297
9303
|
e.stopPropagation();
|
|
9298
9304
|
const element = elementLookup.get(elementId);
|
|
9299
9305
|
if (element) {
|
|
9300
|
-
const updated =
|
|
9306
|
+
const updated = chunk3TPQY6WR_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9301
9307
|
const updates = {};
|
|
9302
|
-
if (
|
|
9308
|
+
if (chunk3TPQY6WR_js.hasShapeProperties(updated)) {
|
|
9303
9309
|
updates.shapeStyle = updated.shapeStyle;
|
|
9304
9310
|
}
|
|
9305
|
-
if (
|
|
9311
|
+
if (chunk3TPQY6WR_js.hasTextProperties(updated)) {
|
|
9306
9312
|
updates.textStyle = updated.textStyle;
|
|
9307
9313
|
}
|
|
9308
9314
|
ops.updateElementById(elementId, updates);
|
|
@@ -9488,10 +9494,10 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9488
9494
|
}
|
|
9489
9495
|
};
|
|
9490
9496
|
}, [embeddedFonts]);
|
|
9491
|
-
const referencedFamilies = react.useMemo(() =>
|
|
9497
|
+
const referencedFamilies = react.useMemo(() => chunk3TPQY6WR_js.collectReferencedFontFamilies(slides), [slides]);
|
|
9492
9498
|
react.useEffect(() => {
|
|
9493
9499
|
let cancelled = false;
|
|
9494
|
-
void
|
|
9500
|
+
void chunk3TPQY6WR_js.resolveGoogleWebfontHref(slides, embeddedFonts).then((href) => {
|
|
9495
9501
|
if (cancelled) {
|
|
9496
9502
|
return null;
|
|
9497
9503
|
}
|
|
@@ -9516,15 +9522,15 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9516
9522
|
const [, setOutlineFontsTick] = react.useState(0);
|
|
9517
9523
|
react.useEffect(() => {
|
|
9518
9524
|
let cancelled = false;
|
|
9519
|
-
const referenced =
|
|
9520
|
-
const candidates =
|
|
9525
|
+
const referenced = chunk3TPQY6WR_js.collectReferencedFontFamilies(slides);
|
|
9526
|
+
const candidates = chunk3TPQY6WR_js.selectGoogleWebfontFamilies(
|
|
9521
9527
|
referenced,
|
|
9522
9528
|
embeddedFonts.map((font) => font.name)
|
|
9523
9529
|
);
|
|
9524
9530
|
if (candidates.length === 0) {
|
|
9525
9531
|
return;
|
|
9526
9532
|
}
|
|
9527
|
-
void
|
|
9533
|
+
void chunk3TPQY6WR_js.resolveGoogleWebfontHref(slides, embeddedFonts).then(async (href) => {
|
|
9528
9534
|
if (cancelled || !href) {
|
|
9529
9535
|
return;
|
|
9530
9536
|
}
|
|
@@ -9538,7 +9544,7 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9538
9544
|
if (cancelled) {
|
|
9539
9545
|
return;
|
|
9540
9546
|
}
|
|
9541
|
-
const bytes = await
|
|
9547
|
+
const bytes = await chunk3TPQY6WR_js.fetchGoogleWebfontOutlineBytes(
|
|
9542
9548
|
href,
|
|
9543
9549
|
family,
|
|
9544
9550
|
variant.bold,
|
|
@@ -9727,7 +9733,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9727
9733
|
inputRef.current = input;
|
|
9728
9734
|
const handleKeyDown = react.useCallback((e) => {
|
|
9729
9735
|
const current = inputRef.current;
|
|
9730
|
-
const startAction =
|
|
9736
|
+
const startAction = chunk3TPQY6WR_js.mapSlideShowStartKey(e, { isPresenting: current.mode === "present" });
|
|
9731
9737
|
if (startAction !== null) {
|
|
9732
9738
|
e.preventDefault();
|
|
9733
9739
|
if (startAction === "fromBeginning") {
|
|
@@ -9737,7 +9743,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9737
9743
|
}
|
|
9738
9744
|
return;
|
|
9739
9745
|
}
|
|
9740
|
-
const { action, dx, dy } =
|
|
9746
|
+
const { action, dx, dy } = chunk3TPQY6WR_js.mapEditorKey(e, {
|
|
9741
9747
|
canEdit: current.canEdit,
|
|
9742
9748
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9743
9749
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9750,7 +9756,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9750
9756
|
hasSelection: current.hasSelection,
|
|
9751
9757
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9752
9758
|
isDrawing: current.activeTool !== "select",
|
|
9753
|
-
isTextInputTarget:
|
|
9759
|
+
isTextInputTarget: chunk3TPQY6WR_js.isEditorTextInputTarget(e.target)
|
|
9754
9760
|
});
|
|
9755
9761
|
if (action === null) {
|
|
9756
9762
|
return;
|
|
@@ -10082,7 +10088,7 @@ function useViewerIntegration(input) {
|
|
|
10082
10088
|
return zoom.scale;
|
|
10083
10089
|
},
|
|
10084
10090
|
setZoom(level) {
|
|
10085
|
-
zoom.setScale(
|
|
10091
|
+
zoom.setScale(chunk3TPQY6WR_js.clampZoomScale(level));
|
|
10086
10092
|
},
|
|
10087
10093
|
zoomIn() {
|
|
10088
10094
|
zoom.handleZoomIn();
|
|
@@ -10304,7 +10310,7 @@ function useReducedMotion() {
|
|
|
10304
10310
|
}
|
|
10305
10311
|
function useViewerOptions() {
|
|
10306
10312
|
const storeRef = react.useRef(null);
|
|
10307
|
-
storeRef.current ??=
|
|
10313
|
+
storeRef.current ??= chunk3TPQY6WR_js.createViewerOptionsStore();
|
|
10308
10314
|
const store = storeRef.current;
|
|
10309
10315
|
const options = react.useSyncExternalStore(
|
|
10310
10316
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -10313,9 +10319,9 @@ function useViewerOptions() {
|
|
|
10313
10319
|
);
|
|
10314
10320
|
return { optionsStore: store, options };
|
|
10315
10321
|
}
|
|
10316
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10322
|
+
var KNOWN_TAB_IDS = new Set(chunk3TPQY6WR_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10317
10323
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
10318
|
-
const isHidden = (id) =>
|
|
10324
|
+
const isHidden = (id) => chunk3TPQY6WR_js.isActionHidden(id, hiddenActions);
|
|
10319
10325
|
const userHidden = new Set(hiddenTabIds);
|
|
10320
10326
|
userHidden.delete("file");
|
|
10321
10327
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
|
|
@@ -10408,12 +10414,12 @@ function useYjsDocumentSync({
|
|
|
10408
10414
|
return;
|
|
10409
10415
|
}
|
|
10410
10416
|
try {
|
|
10411
|
-
const handler = new
|
|
10417
|
+
const handler = new chunk3TPQY6WR_js.PptxHandler();
|
|
10412
10418
|
await handler.load(sourceBytes.buffer);
|
|
10413
|
-
const currentSlides =
|
|
10419
|
+
const currentSlides = chunk3TPQY6WR_js.readSlidesFromYDoc(
|
|
10414
10420
|
doc
|
|
10415
10421
|
);
|
|
10416
|
-
const slidesToSave =
|
|
10422
|
+
const slidesToSave = chunk3TPQY6WR_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10417
10423
|
const bytes = await handler.save(slidesToSave, getSaveOptions?.());
|
|
10418
10424
|
config.onWriteBack(bytes);
|
|
10419
10425
|
} catch {
|
|
@@ -10428,10 +10434,10 @@ function useYjsDocumentSync({
|
|
|
10428
10434
|
if (!doc || !isConnected) {
|
|
10429
10435
|
return;
|
|
10430
10436
|
}
|
|
10431
|
-
const docSlides =
|
|
10437
|
+
const docSlides = chunk3TPQY6WR_js.readSlidesFromYDoc(
|
|
10432
10438
|
doc
|
|
10433
10439
|
);
|
|
10434
|
-
if (!
|
|
10440
|
+
if (!chunk3TPQY6WR_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10435
10441
|
return;
|
|
10436
10442
|
}
|
|
10437
10443
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10450,11 +10456,11 @@ function useYjsDocumentSync({
|
|
|
10450
10456
|
lastSyncedRef.current = serialized;
|
|
10451
10457
|
void (async () => {
|
|
10452
10458
|
const factories = await getFactories();
|
|
10453
|
-
|
|
10459
|
+
chunk3TPQY6WR_js.reconcileSlidesInYDoc(
|
|
10454
10460
|
slides,
|
|
10455
10461
|
doc,
|
|
10456
10462
|
factories,
|
|
10457
|
-
|
|
10463
|
+
chunk3TPQY6WR_js.LOCAL_SYNC_ORIGIN
|
|
10458
10464
|
);
|
|
10459
10465
|
scheduleWriteBack();
|
|
10460
10466
|
})();
|
|
@@ -10468,10 +10474,10 @@ function useYjsDocumentSync({
|
|
|
10468
10474
|
return;
|
|
10469
10475
|
}
|
|
10470
10476
|
const handleChange = (_events, transaction) => {
|
|
10471
|
-
if (transaction?.origin ===
|
|
10477
|
+
if (transaction?.origin === chunk3TPQY6WR_js.LOCAL_SYNC_ORIGIN) {
|
|
10472
10478
|
return;
|
|
10473
10479
|
}
|
|
10474
|
-
const remoteSlides =
|
|
10480
|
+
const remoteSlides = chunk3TPQY6WR_js.readSlidesFromYDoc(
|
|
10475
10481
|
doc
|
|
10476
10482
|
);
|
|
10477
10483
|
if (remoteSlides.length === 0) {
|
|
@@ -10487,7 +10493,7 @@ function useYjsDocumentSync({
|
|
|
10487
10493
|
isApplyingRemoteRef.current = false;
|
|
10488
10494
|
scheduleWriteBack();
|
|
10489
10495
|
};
|
|
10490
|
-
const unobserve =
|
|
10496
|
+
const unobserve = chunk3TPQY6WR_js.observeYDocSlides(
|
|
10491
10497
|
doc,
|
|
10492
10498
|
handleChange
|
|
10493
10499
|
);
|
|
@@ -10525,7 +10531,7 @@ function useBroadcastFollower({
|
|
|
10525
10531
|
if (!broadcaster) {
|
|
10526
10532
|
return;
|
|
10527
10533
|
}
|
|
10528
|
-
if (!
|
|
10534
|
+
if (!chunk3TPQY6WR_js.shouldAutoFollowBroadcaster({
|
|
10529
10535
|
localRole: collab.config.role,
|
|
10530
10536
|
broadcasterRole: broadcaster.role
|
|
10531
10537
|
})) {
|
|
@@ -10683,7 +10689,7 @@ function useLayoutSwitching(input) {
|
|
|
10683
10689
|
currentLayoutPath
|
|
10684
10690
|
};
|
|
10685
10691
|
}
|
|
10686
|
-
var MIN_TOUCH_TARGET =
|
|
10692
|
+
var MIN_TOUCH_TARGET = chunk3TPQY6WR_js.MIN_TOUCH_TARGET_PX;
|
|
10687
10693
|
function subscribeTouchCapability(callback) {
|
|
10688
10694
|
if (typeof window === "undefined") {
|
|
10689
10695
|
return () => {
|
|
@@ -10696,7 +10702,7 @@ function subscribeTouchCapability(callback) {
|
|
|
10696
10702
|
function useIsMobile() {
|
|
10697
10703
|
const isTouchDevice = react.useSyncExternalStore(
|
|
10698
10704
|
subscribeTouchCapability,
|
|
10699
|
-
|
|
10705
|
+
chunk3TPQY6WR_js.detectTouchDevice,
|
|
10700
10706
|
() => false
|
|
10701
10707
|
// server snapshot
|
|
10702
10708
|
);
|
|
@@ -10706,7 +10712,7 @@ function useIsMobile() {
|
|
|
10706
10712
|
const [viewportHeight, setViewportHeight] = react.useState(
|
|
10707
10713
|
() => typeof window === "undefined" ? 768 : window.innerHeight
|
|
10708
10714
|
);
|
|
10709
|
-
const [orientation, setOrientation] = react.useState(
|
|
10715
|
+
const [orientation, setOrientation] = react.useState(chunk3TPQY6WR_js.detectOrientation);
|
|
10710
10716
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
10711
10717
|
const [initialViewportHeight] = react.useState(
|
|
10712
10718
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -10727,7 +10733,7 @@ function useIsMobile() {
|
|
|
10727
10733
|
return;
|
|
10728
10734
|
}
|
|
10729
10735
|
const handleOrientationChange = () => {
|
|
10730
|
-
setOrientation(
|
|
10736
|
+
setOrientation(chunk3TPQY6WR_js.detectOrientation());
|
|
10731
10737
|
};
|
|
10732
10738
|
if (screen.orientation) {
|
|
10733
10739
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -10757,7 +10763,7 @@ function useIsMobile() {
|
|
|
10757
10763
|
window.addEventListener("resize", handleResize);
|
|
10758
10764
|
return () => window.removeEventListener("resize", handleResize);
|
|
10759
10765
|
}, [isTouchDevice, initialViewportHeight]);
|
|
10760
|
-
const { isMobile, isTablet, isDesktop } =
|
|
10766
|
+
const { isMobile, isTablet, isDesktop } = chunk3TPQY6WR_js.deriveViewportBreakpoints(
|
|
10761
10767
|
viewportWidth,
|
|
10762
10768
|
viewportHeight,
|
|
10763
10769
|
isTouchDevice
|
|
@@ -10790,10 +10796,10 @@ function useTouchGestures(input) {
|
|
|
10790
10796
|
if (!el || !enabled) {
|
|
10791
10797
|
return;
|
|
10792
10798
|
}
|
|
10793
|
-
const recognizer =
|
|
10799
|
+
const recognizer = chunk3TPQY6WR_js.createTouchGestureRecognizer({
|
|
10794
10800
|
getScale: () => scaleRef.current,
|
|
10795
|
-
minScale:
|
|
10796
|
-
maxScale:
|
|
10801
|
+
minScale: chunk3TPQY6WR_js.MIN_ZOOM_SCALE,
|
|
10802
|
+
maxScale: chunk3TPQY6WR_js.MAX_ZOOM_SCALE,
|
|
10797
10803
|
callbacks: {
|
|
10798
10804
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10799
10805
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10833,7 +10839,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10833
10839
|
return;
|
|
10834
10840
|
}
|
|
10835
10841
|
const rect = active.getBoundingClientRect();
|
|
10836
|
-
const delta =
|
|
10842
|
+
const delta = chunk3TPQY6WR_js.computeScrollDelta(
|
|
10837
10843
|
{ top: rect.top, bottom: rect.bottom },
|
|
10838
10844
|
window.innerHeight,
|
|
10839
10845
|
keyboardInset
|
|
@@ -10853,8 +10859,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10853
10859
|
return;
|
|
10854
10860
|
}
|
|
10855
10861
|
const update = () => {
|
|
10856
|
-
const metrics =
|
|
10857
|
-
const inset = metrics ?
|
|
10862
|
+
const metrics = chunk3TPQY6WR_js.readViewportMetrics(window);
|
|
10863
|
+
const inset = metrics ? chunk3TPQY6WR_js.computeKeyboardInset(metrics) : 0;
|
|
10858
10864
|
setKeyboardInset(inset);
|
|
10859
10865
|
if (inset > 0) {
|
|
10860
10866
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10865,8 +10871,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10865
10871
|
vv.addEventListener("scroll", update);
|
|
10866
10872
|
const onFocusIn = () => {
|
|
10867
10873
|
window.requestAnimationFrame(() => {
|
|
10868
|
-
const metrics =
|
|
10869
|
-
const inset = metrics ?
|
|
10874
|
+
const metrics = chunk3TPQY6WR_js.readViewportMetrics(window);
|
|
10875
|
+
const inset = metrics ? chunk3TPQY6WR_js.computeKeyboardInset(metrics) : 0;
|
|
10870
10876
|
if (inset > 0) {
|
|
10871
10877
|
scrollFocusedIntoView(inset);
|
|
10872
10878
|
}
|
|
@@ -10879,7 +10885,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10879
10885
|
document.removeEventListener("focusin", onFocusIn);
|
|
10880
10886
|
};
|
|
10881
10887
|
}, [enabled]);
|
|
10882
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10888
|
+
return { keyboardInset, isKeyboardOpen: chunk3TPQY6WR_js.isKeyboardOpen(keyboardInset) };
|
|
10883
10889
|
}
|
|
10884
10890
|
|
|
10885
10891
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10908,21 +10914,21 @@ function buildCanvasProps(input) {
|
|
|
10908
10914
|
} = input;
|
|
10909
10915
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10910
10916
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10911
|
-
const fieldContext =
|
|
10917
|
+
const fieldContext = chunk3TPQY6WR_js.buildFieldSubstitutionContext({
|
|
10912
10918
|
headerFooter: s.headerFooter,
|
|
10913
10919
|
customProperties: s.customProperties,
|
|
10914
10920
|
slide: activeSlide
|
|
10915
10921
|
});
|
|
10916
10922
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10917
10923
|
const openExternalUrl = (url, target) => {
|
|
10918
|
-
if (
|
|
10924
|
+
if (chunk3TPQY6WR_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
10919
10925
|
return;
|
|
10920
10926
|
}
|
|
10921
|
-
|
|
10927
|
+
chunk3TPQY6WR_js.safeOpenUrl(url, target);
|
|
10922
10928
|
};
|
|
10923
10929
|
const handleActionClick = (elementId, action) => {
|
|
10924
10930
|
if (mode === "present") {
|
|
10925
|
-
const resolved =
|
|
10931
|
+
const resolved = chunk3TPQY6WR_js.resolvePresentationAction(action, { slideCount: slides.length });
|
|
10926
10932
|
if (resolved.intent.kind === "openUrl") {
|
|
10927
10933
|
openExternalUrl(resolved.intent.url);
|
|
10928
10934
|
return;
|
|
@@ -10933,9 +10939,9 @@ function buildCanvasProps(input) {
|
|
|
10933
10939
|
}
|
|
10934
10940
|
};
|
|
10935
10941
|
const handleHyperlinkClick = (url, target) => {
|
|
10936
|
-
if (
|
|
10942
|
+
if (chunk3TPQY6WR_js.isPpactionUrl(url)) {
|
|
10937
10943
|
if (mode === "present") {
|
|
10938
|
-
const parsed =
|
|
10944
|
+
const parsed = chunk3TPQY6WR_js.parsePpactionUrl(url);
|
|
10939
10945
|
if (parsed) {
|
|
10940
10946
|
presentation.handlePresentationAction({
|
|
10941
10947
|
action: parsed.action,
|
|
@@ -11041,7 +11047,7 @@ function buildCanvasProps(input) {
|
|
|
11041
11047
|
|
|
11042
11048
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
11043
11049
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
11044
|
-
return
|
|
11050
|
+
return chunk3TPQY6WR_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
11045
11051
|
}
|
|
11046
11052
|
|
|
11047
11053
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -11054,7 +11060,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
11054
11060
|
const current = activeSlide.animations ?? [];
|
|
11055
11061
|
if (group === "motionPath") {
|
|
11056
11062
|
propertyHandlers.handleUpdateSlide({
|
|
11057
|
-
animations:
|
|
11063
|
+
animations: chunk3TPQY6WR_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
11058
11064
|
});
|
|
11059
11065
|
return;
|
|
11060
11066
|
}
|
|
@@ -11250,7 +11256,7 @@ function buildToolbarProps(input) {
|
|
|
11250
11256
|
onOpenFile,
|
|
11251
11257
|
onOpenRecentFile,
|
|
11252
11258
|
onCreatePresentation: (templateId) => {
|
|
11253
|
-
s.setSlides(
|
|
11259
|
+
s.setSlides(chunk3TPQY6WR_js.createBackstagePresentation(templateId));
|
|
11254
11260
|
s.setActiveSlideIndex(0);
|
|
11255
11261
|
s.setSelectedElementId(null);
|
|
11256
11262
|
s.setSelectedElementIds([]);
|
|
@@ -11280,7 +11286,7 @@ function buildToolbarProps(input) {
|
|
|
11280
11286
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
11281
11287
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
11282
11288
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
11283
|
-
templateScheme:
|
|
11289
|
+
templateScheme: chunk3TPQY6WR_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
11284
11290
|
customShows: s.customShows,
|
|
11285
11291
|
activeCustomShowId: s.activeCustomShowId,
|
|
11286
11292
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -11321,7 +11327,7 @@ function buildToolbarProps(input) {
|
|
|
11321
11327
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
11322
11328
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
11323
11329
|
formatPainterActive: s.formatPainterActive,
|
|
11324
|
-
canActivateFormatPainter:
|
|
11330
|
+
canActivateFormatPainter: chunk3TPQY6WR_js.hasCopyableFormat(selectedElement),
|
|
11325
11331
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
11326
11332
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
11327
11333
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11399,7 +11405,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11399
11405
|
headerFooter: state.headerFooter,
|
|
11400
11406
|
loading,
|
|
11401
11407
|
error,
|
|
11402
|
-
maxHistoryEntries:
|
|
11408
|
+
maxHistoryEntries: chunk3TPQY6WR_js.resolveHistoryDepth(viewerOptions),
|
|
11403
11409
|
hasActivePointerInteraction,
|
|
11404
11410
|
pointerCommitNonce: state.pointerCommitNonce,
|
|
11405
11411
|
onDirty: markDocumentDirty,
|
|
@@ -11424,7 +11430,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11424
11430
|
documentGridSpacing: state.viewProperties?.gridSpacing
|
|
11425
11431
|
});
|
|
11426
11432
|
const themeColorMap = react.useMemo(
|
|
11427
|
-
() => state.theme?.colorScheme ?
|
|
11433
|
+
() => state.theme?.colorScheme ? chunk3TPQY6WR_js.buildThemeColorMap(state.theme.colorScheme) : void 0,
|
|
11428
11434
|
[state.theme?.colorScheme]
|
|
11429
11435
|
);
|
|
11430
11436
|
const { presentation, annotations, actionSoundHandlerRef, setExitModeHandler } = usePresentationSetup({
|
|
@@ -11473,8 +11479,8 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11473
11479
|
gridSpacingPx,
|
|
11474
11480
|
// Multiplied against the pre-existing 2x baseline; see the matching
|
|
11475
11481
|
// comment in `PowerPointViewer.tsx`.
|
|
11476
|
-
imageExportScale: 2 *
|
|
11477
|
-
imageResolutionScale:
|
|
11482
|
+
imageExportScale: 2 * chunk3TPQY6WR_js.resolveImageResolutionScale(viewerOptions),
|
|
11483
|
+
imageResolutionScale: chunk3TPQY6WR_js.resolveImageResolutionScale(viewerOptions),
|
|
11478
11484
|
viewerOptions
|
|
11479
11485
|
};
|
|
11480
11486
|
}
|
|
@@ -11490,7 +11496,7 @@ function useCompatibilityToastsState() {
|
|
|
11490
11496
|
}
|
|
11491
11497
|
function useReadOnlyRecommendationState(content) {
|
|
11492
11498
|
const [recommendation, setRecommendation] = react.useState(
|
|
11493
|
-
() =>
|
|
11499
|
+
() => chunk3TPQY6WR_js.readOnlyRecommendation(void 0)
|
|
11494
11500
|
);
|
|
11495
11501
|
const [modifyVerifier, setModifyVerifier] = react.useState(void 0);
|
|
11496
11502
|
const [bannerHidden, setBannerHidden] = react.useState(false);
|
|
@@ -11530,7 +11536,7 @@ function useReadOnlyRecommendationState(content) {
|
|
|
11530
11536
|
async (password) => {
|
|
11531
11537
|
setCheckingPassword(true);
|
|
11532
11538
|
try {
|
|
11533
|
-
const result = await
|
|
11539
|
+
const result = await chunk3TPQY6WR_js.checkModifyPassword(modifyVerifier, password);
|
|
11534
11540
|
if (result.ok) {
|
|
11535
11541
|
unlock();
|
|
11536
11542
|
} else {
|
|
@@ -11575,9 +11581,9 @@ function useViewPreferencesSync(input) {
|
|
|
11575
11581
|
setShowGuides
|
|
11576
11582
|
} = input;
|
|
11577
11583
|
react.useEffect(() => {
|
|
11578
|
-
const seeded =
|
|
11584
|
+
const seeded = chunk3TPQY6WR_js.viewerPreferencesFromViewProperties(
|
|
11579
11585
|
{ viewProperties },
|
|
11580
|
-
{ ...
|
|
11586
|
+
{ ...chunk3TPQY6WR_js.DEFAULT_VIEWER_PREFERENCES, snapToGrid, snapToObjects: snapToShape, showGuides }
|
|
11581
11587
|
);
|
|
11582
11588
|
setSnapToGrid(seeded.snapToGrid);
|
|
11583
11589
|
setSnapToShape(seeded.snapToObjects ?? snapToShape);
|
|
@@ -11587,7 +11593,7 @@ function useViewPreferencesSync(input) {
|
|
|
11587
11593
|
(prefsOverride) => {
|
|
11588
11594
|
setViewProperties((prev) => {
|
|
11589
11595
|
const merged = {
|
|
11590
|
-
...
|
|
11596
|
+
...chunk3TPQY6WR_js.DEFAULT_VIEWER_PREFERENCES,
|
|
11591
11597
|
snapToGrid,
|
|
11592
11598
|
snapToObjects: snapToShape,
|
|
11593
11599
|
showGuides,
|
|
@@ -11595,7 +11601,7 @@ function useViewPreferencesSync(input) {
|
|
|
11595
11601
|
gridSpacingCy: prev?.gridSpacing?.cy,
|
|
11596
11602
|
...prefsOverride
|
|
11597
11603
|
};
|
|
11598
|
-
const patch =
|
|
11604
|
+
const patch = chunk3TPQY6WR_js.viewPropertiesPatchFromPreferences(merged);
|
|
11599
11605
|
return {
|
|
11600
11606
|
...prev,
|
|
11601
11607
|
slideViewPr: { ...prev?.slideViewPr, ...patch.slideViewPr },
|
|
@@ -11816,7 +11822,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11816
11822
|
}, [incomingContent]);
|
|
11817
11823
|
const onOpenFile = react.useCallback(() => {
|
|
11818
11824
|
void (async () => {
|
|
11819
|
-
const picked = await
|
|
11825
|
+
const picked = await chunk3TPQY6WR_js.openPptxFile();
|
|
11820
11826
|
if (picked) {
|
|
11821
11827
|
setContent(picked.buffer);
|
|
11822
11828
|
}
|
|
@@ -11824,7 +11830,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11824
11830
|
}, []);
|
|
11825
11831
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11826
11832
|
void (async () => {
|
|
11827
|
-
const bytes = await
|
|
11833
|
+
const bytes = await chunk3TPQY6WR_js.readBackstageRecentFile(key);
|
|
11828
11834
|
if (bytes) {
|
|
11829
11835
|
setContent(bytes);
|
|
11830
11836
|
}
|