pptx-react-viewer 3.16.6 → 3.16.7
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 +13 -0
- package/dist/{AiChatPanel-6IBPORZC.mjs → AiChatPanel-GLDW5OK4.mjs} +3 -3
- package/dist/AiChatPanel-GLDW5OK4.mjs.br +0 -0
- package/dist/AiChatPanel-GLDW5OK4.mjs.gz +0 -0
- package/dist/{AiChatPanel-WDNBYHX7.js → AiChatPanel-N25STHYW.js} +24 -24
- package/dist/AiChatPanel-N25STHYW.js.br +0 -0
- package/dist/AiChatPanel-N25STHYW.js.gz +0 -0
- package/dist/{Area3DChartScene-MRPRTJWY.js → Area3DChartScene-5POI5LF7.js} +2 -2
- package/dist/Area3DChartScene-5POI5LF7.js.br +0 -0
- package/dist/Area3DChartScene-5POI5LF7.js.gz +0 -0
- package/dist/{Area3DChartScene-EMOWMHHK.mjs → Area3DChartScene-FCHO4SK6.mjs} +1 -1
- package/dist/Area3DChartScene-FCHO4SK6.mjs.br +0 -0
- package/dist/Area3DChartScene-FCHO4SK6.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-THALZEYK.js → Bar3DChartScene-5CY5GRV5.js} +2 -2
- package/dist/Bar3DChartScene-5CY5GRV5.js.br +0 -0
- package/dist/Bar3DChartScene-5CY5GRV5.js.gz +0 -0
- package/dist/{Bar3DChartScene-J3GJEGDJ.mjs → Bar3DChartScene-M3LLHXAL.mjs} +1 -1
- package/dist/Bar3DChartScene-M3LLHXAL.mjs.br +0 -0
- package/dist/Bar3DChartScene-M3LLHXAL.mjs.gz +0 -0
- package/dist/{Line3DChartScene-B26WZNO3.js → Line3DChartScene-3TP7OUIP.js} +2 -2
- package/dist/Line3DChartScene-3TP7OUIP.js.br +0 -0
- package/dist/Line3DChartScene-3TP7OUIP.js.gz +0 -0
- package/dist/{Line3DChartScene-Y7MODOK2.mjs → Line3DChartScene-77TZRLJY.mjs} +1 -1
- package/dist/Line3DChartScene-77TZRLJY.mjs.br +0 -0
- package/dist/Line3DChartScene-77TZRLJY.mjs.gz +0 -0
- package/dist/{Model3DScene-27GN3D3U.js → Model3DScene-CBETCFMI.js} +2 -2
- package/dist/Model3DScene-CBETCFMI.js.br +0 -0
- package/dist/Model3DScene-CBETCFMI.js.gz +0 -0
- package/dist/{Model3DScene-XM3JN7M6.mjs → Model3DScene-QINKUHM2.mjs} +1 -1
- package/dist/Model3DScene-QINKUHM2.mjs.br +0 -0
- package/dist/Model3DScene-QINKUHM2.mjs.gz +0 -0
- package/dist/{PieChart3DScene-4GP2B3PY.mjs → PieChart3DScene-H2DJSHW7.mjs} +1 -1
- package/dist/PieChart3DScene-H2DJSHW7.mjs.br +0 -0
- package/dist/PieChart3DScene-H2DJSHW7.mjs.gz +0 -0
- package/dist/{PieChart3DScene-URSRUABE.js → PieChart3DScene-NFXFVG7R.js} +2 -2
- package/dist/PieChart3DScene-NFXFVG7R.js.br +0 -0
- package/dist/PieChart3DScene-NFXFVG7R.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-4OQNB3JY.js → SurfaceChart3DScene-2IN5YKKE.js} +2 -2
- package/dist/SurfaceChart3DScene-2IN5YKKE.js.br +0 -0
- package/dist/SurfaceChart3DScene-2IN5YKKE.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-YJ4EYMWQ.mjs → SurfaceChart3DScene-4AGI4O3L.mjs} +1 -1
- package/dist/SurfaceChart3DScene-4AGI4O3L.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-4AGI4O3L.mjs.gz +0 -0
- package/dist/{chunk-VRMITIZZ.js → chunk-3FVOKV4E.js} +135 -42
- package/dist/chunk-3FVOKV4E.js.br +0 -0
- package/dist/chunk-3FVOKV4E.js.gz +0 -0
- package/dist/{chunk-QLZHTIH6.mjs → chunk-3PUFHKXW.mjs} +6 -3
- package/dist/chunk-3PUFHKXW.mjs.br +0 -0
- package/dist/chunk-3PUFHKXW.mjs.gz +0 -0
- package/dist/{chunk-BJL5MJ7A.js → chunk-4NSDMKFE.js} +169 -169
- package/dist/chunk-4NSDMKFE.js.br +0 -0
- package/dist/chunk-4NSDMKFE.js.gz +0 -0
- package/dist/{chunk-TTCWWF47.js → chunk-4Q6VIX6M.js} +455 -452
- package/dist/chunk-4Q6VIX6M.js.br +0 -0
- package/dist/chunk-4Q6VIX6M.js.gz +0 -0
- package/dist/{chunk-YUIXPWFT.mjs → chunk-7ELFYC6K.mjs} +1 -1
- package/dist/chunk-7ELFYC6K.mjs.br +0 -0
- package/dist/chunk-7ELFYC6K.mjs.gz +0 -0
- package/dist/{chunk-U2H7CQ34.mjs → chunk-B3YVURJB.mjs} +1 -1
- package/dist/chunk-B3YVURJB.mjs.br +0 -0
- package/dist/chunk-B3YVURJB.mjs.gz +0 -0
- package/dist/{chunk-RWVMSJ7C.mjs → chunk-I5YSAIL5.mjs} +12 -12
- package/dist/chunk-I5YSAIL5.mjs.br +0 -0
- package/dist/chunk-I5YSAIL5.mjs.gz +0 -0
- package/dist/{chunk-LTQRC4WB.js → chunk-SQNEE6AM.js} +1291 -1291
- package/dist/chunk-SQNEE6AM.js.br +0 -0
- package/dist/chunk-SQNEE6AM.js.gz +0 -0
- package/dist/{chunk-C7H7NM2W.js → chunk-TYVSLRC7.js} +5 -5
- package/dist/chunk-TYVSLRC7.js.br +0 -0
- package/dist/chunk-TYVSLRC7.js.gz +0 -0
- package/dist/{chunk-PO2PYVHF.mjs → chunk-XMD6ZWUO.mjs} +135 -42
- package/dist/chunk-XMD6ZWUO.mjs.br +0 -0
- package/dist/chunk-XMD6ZWUO.mjs.gz +0 -0
- package/dist/index.js +45 -45
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.js +26 -26
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-6IBPORZC.mjs.br +0 -0
- package/dist/AiChatPanel-6IBPORZC.mjs.gz +0 -0
- package/dist/AiChatPanel-WDNBYHX7.js.br +0 -0
- package/dist/AiChatPanel-WDNBYHX7.js.gz +0 -0
- package/dist/Area3DChartScene-EMOWMHHK.mjs.br +0 -0
- package/dist/Area3DChartScene-EMOWMHHK.mjs.gz +0 -0
- package/dist/Area3DChartScene-MRPRTJWY.js.br +0 -0
- package/dist/Area3DChartScene-MRPRTJWY.js.gz +0 -0
- package/dist/Bar3DChartScene-J3GJEGDJ.mjs.br +0 -0
- package/dist/Bar3DChartScene-J3GJEGDJ.mjs.gz +0 -0
- package/dist/Bar3DChartScene-THALZEYK.js.br +0 -0
- package/dist/Bar3DChartScene-THALZEYK.js.gz +0 -0
- package/dist/Line3DChartScene-B26WZNO3.js.br +0 -0
- package/dist/Line3DChartScene-B26WZNO3.js.gz +0 -0
- package/dist/Line3DChartScene-Y7MODOK2.mjs.br +0 -0
- package/dist/Line3DChartScene-Y7MODOK2.mjs.gz +0 -0
- package/dist/Model3DScene-27GN3D3U.js.br +0 -0
- package/dist/Model3DScene-27GN3D3U.js.gz +0 -0
- package/dist/Model3DScene-XM3JN7M6.mjs.br +0 -0
- package/dist/Model3DScene-XM3JN7M6.mjs.gz +0 -0
- package/dist/PieChart3DScene-4GP2B3PY.mjs.br +0 -0
- package/dist/PieChart3DScene-4GP2B3PY.mjs.gz +0 -0
- package/dist/PieChart3DScene-URSRUABE.js.br +0 -0
- package/dist/PieChart3DScene-URSRUABE.js.gz +0 -0
- package/dist/SurfaceChart3DScene-4OQNB3JY.js.br +0 -0
- package/dist/SurfaceChart3DScene-4OQNB3JY.js.gz +0 -0
- package/dist/SurfaceChart3DScene-YJ4EYMWQ.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-YJ4EYMWQ.mjs.gz +0 -0
- package/dist/chunk-BJL5MJ7A.js.br +0 -0
- package/dist/chunk-BJL5MJ7A.js.gz +0 -0
- package/dist/chunk-C7H7NM2W.js.br +0 -0
- package/dist/chunk-C7H7NM2W.js.gz +0 -0
- package/dist/chunk-LTQRC4WB.js.br +0 -0
- package/dist/chunk-LTQRC4WB.js.gz +0 -0
- package/dist/chunk-PO2PYVHF.mjs.br +0 -0
- package/dist/chunk-PO2PYVHF.mjs.gz +0 -0
- package/dist/chunk-QLZHTIH6.mjs.br +0 -0
- package/dist/chunk-QLZHTIH6.mjs.gz +0 -0
- package/dist/chunk-RWVMSJ7C.mjs.br +0 -0
- package/dist/chunk-RWVMSJ7C.mjs.gz +0 -0
- package/dist/chunk-TTCWWF47.js.br +0 -0
- package/dist/chunk-TTCWWF47.js.gz +0 -0
- package/dist/chunk-U2H7CQ34.mjs.br +0 -0
- package/dist/chunk-U2H7CQ34.mjs.gz +0 -0
- package/dist/chunk-VRMITIZZ.js.br +0 -0
- package/dist/chunk-VRMITIZZ.js.gz +0 -0
- package/dist/chunk-YUIXPWFT.mjs.br +0 -0
- package/dist/chunk-YUIXPWFT.mjs.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk4NSDMKFE_js = require('./chunk-4NSDMKFE.js');
|
|
4
|
+
var chunk3FVOKV4E_js = require('./chunk-3FVOKV4E.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 = chunk3FVOKV4E_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 = chunk3FVOKV4E_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 ??= chunk3FVOKV4E_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 >= chunk3FVOKV4E_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
|
+
}, chunk3FVOKV4E_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 = chunk3FVOKV4E_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
|
+
chunk3FVOKV4E_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 = chunk3FVOKV4E_js.validateRoomId(config.roomId);
|
|
244
244
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
245
|
-
departureRef.current =
|
|
245
|
+
departureRef.current = chunk3FVOKV4E_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 = chunk3FVOKV4E_js.validateRoomId(config.roomId);
|
|
288
|
+
const transport = config.transport ?? chunk3FVOKV4E_js.resolveTransportForServerUrl(config.serverUrl);
|
|
289
289
|
if (transport === "webrtc") {
|
|
290
290
|
await initWebrtc();
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
293
|
+
if (chunk3FVOKV4E_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 = chunk3FVOKV4E_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
|
+
chunk3FVOKV4E_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
|
+
}, chunk3FVOKV4E_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
|
+
chunk3FVOKV4E_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 = chunk3FVOKV4E_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 = chunk3FVOKV4E_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(chunk3FVOKV4E_js.cloneSlide),
|
|
531
|
+
templateElementsBySlideId: chunk3FVOKV4E_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(chunk3FVOKV4E_js.cloneSlide));
|
|
545
545
|
setTemplateElementsBySlideId(
|
|
546
|
-
|
|
546
|
+
chunk3FVOKV4E_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 = chunk4NSDMKFE_js.cloneHistorySnapshot(previousSnapshot);
|
|
586
|
+
lastHistorySnapshotRef.current = chunk4NSDMKFE_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 = chunk4NSDMKFE_js.cloneHistorySnapshot(nextSnapshot);
|
|
608
|
+
lastHistorySnapshotRef.current = chunk4NSDMKFE_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 = chunk4NSDMKFE_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 = chunk4NSDMKFE_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(chunk4NSDMKFE_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 = chunk4NSDMKFE_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(chunk3FVOKV4E_js.createWheelStepBuffer());
|
|
747
747
|
const storeRef = react.useRef(null);
|
|
748
|
-
storeRef.current ??=
|
|
748
|
+
storeRef.current ??= chunk3FVOKV4E_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 = chunk3FVOKV4E_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, chunk4NSDMKFE_js.MIN_ELEMENT_SIZE));
|
|
847
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunk4NSDMKFE_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, chunk4NSDMKFE_js.MIN_ELEMENT_SIZE);
|
|
854
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunk4NSDMKFE_js.MIN_ELEMENT_SIZE);
|
|
855
855
|
const availableWidth = Math.max(
|
|
856
|
-
effectiveEditorDimensions.width -
|
|
857
|
-
|
|
856
|
+
effectiveEditorDimensions.width - chunk4NSDMKFE_js.ZOOM_TO_SELECTION_PADDING,
|
|
857
|
+
chunk4NSDMKFE_js.MIN_ELEMENT_SIZE
|
|
858
858
|
);
|
|
859
859
|
const availableHeight = Math.max(
|
|
860
|
-
effectiveEditorDimensions.height -
|
|
861
|
-
|
|
860
|
+
effectiveEditorDimensions.height - chunk4NSDMKFE_js.ZOOM_TO_SELECTION_PADDING,
|
|
861
|
+
chunk4NSDMKFE_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 = chunk3FVOKV4E_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 = chunk3FVOKV4E_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: chunk3FVOKV4E_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
|
+
chunk3FVOKV4E_js.playGroup(controller, group, ctx);
|
|
988
|
+
chunk3FVOKV4E_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 = chunk3FVOKV4E_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(chunk3FVOKV4E_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
|
+
chunk3FVOKV4E_js.cancelBuildReveal(buildRafRef);
|
|
1058
1058
|
};
|
|
1059
1059
|
}, []);
|
|
1060
1060
|
const clearPresentationTimers = react.useCallback(() => {
|
|
1061
|
-
|
|
1061
|
+
chunk3FVOKV4E_js.clearPlaybackTimers(buildPlaybackContext(), activeAnimationGroupRef.current);
|
|
1062
1062
|
}, [buildPlaybackContext]);
|
|
1063
1063
|
const resetSlideTimeline = react.useCallback(
|
|
1064
1064
|
(slideIndex) => {
|
|
1065
|
-
|
|
1065
|
+
chunk3FVOKV4E_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 = chunk3FVOKV4E_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 = chunk3FVOKV4E_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 chunk3FVOKV4E_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
|
+
chunk3FVOKV4E_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
|
+
chunk3FVOKV4E_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 = chunk3FVOKV4E_js.PRESENTATION_CHANNEL_NAME;
|
|
1214
|
+
var AUDIENCE_HASH = chunk3FVOKV4E_js.PRESENTATION_HASH;
|
|
1215
|
+
var PRESENTER_MSG_ORIGIN = chunk3FVOKV4E_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1216
|
+
var AUDIENCE_NONCE_KEY = chunk3FVOKV4E_js.PRESENTATION_NONCE_KEY;
|
|
1217
1217
|
function generateSessionId() {
|
|
1218
|
-
return
|
|
1218
|
+
return chunk3FVOKV4E_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 ? chunk3FVOKV4E_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 chunk3FVOKV4E_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 = chunk3FVOKV4E_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1337
|
+
void chunk3FVOKV4E_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1338
1338
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1339
|
-
|
|
1339
|
+
chunk3FVOKV4E_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 chunk3FVOKV4E_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 (chunk3FVOKV4E_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 chunk3FVOKV4E_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 (!chunk3FVOKV4E_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 chunk3FVOKV4E_js.clearAudienceContent(expectedSessionId);
|
|
1503
1503
|
}
|
|
1504
|
-
if (
|
|
1504
|
+
if (chunk3FVOKV4E_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: chunk3FVOKV4E_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(chunk3FVOKV4E_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(chunk3FVOKV4E_js.createPresentationKeyBuffer());
|
|
1547
1547
|
react.useEffect(() => {
|
|
1548
|
-
if (mode !== "present" || !
|
|
1549
|
-
keyBufferRef.current =
|
|
1548
|
+
if (mode !== "present" || !chunk3FVOKV4E_js.acceptsPresentationInput()) {
|
|
1549
|
+
keyBufferRef.current = chunk3FVOKV4E_js.createPresentationKeyBuffer();
|
|
1550
1550
|
return;
|
|
1551
1551
|
}
|
|
1552
1552
|
const handleKeyDown = (event) => {
|
|
1553
|
-
const mapped =
|
|
1553
|
+
const mapped = chunk3FVOKV4E_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 = chunk3FVOKV4E_js.firstShowSlideIndex(showSlideIndexes);
|
|
1574
1574
|
navigateToSlide(first ?? 0);
|
|
1575
1575
|
return;
|
|
1576
1576
|
}
|
|
1577
1577
|
case "last": {
|
|
1578
|
-
const last =
|
|
1578
|
+
const last = chunk3FVOKV4E_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" || !chunk3FVOKV4E_js.acceptsPresentationInput()) {
|
|
1617
1617
|
return;
|
|
1618
1618
|
}
|
|
1619
|
-
const mapped =
|
|
1619
|
+
const mapped = chunk3FVOKV4E_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
|
+
chunk3FVOKV4E_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 ? chunk3FVOKV4E_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 = chunk3FVOKV4E_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 = chunk3FVOKV4E_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 && !chunk3FVOKV4E_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 ? chunk3FVOKV4E_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1893
1893
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
1894
|
-
}) :
|
|
1894
|
+
}) : chunk3FVOKV4E_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 = chunk3FVOKV4E_js.firstShowSlideIndex(chunk3FVOKV4E_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
|
+
chunk3FVOKV4E_js.safeOpenUrl(target);
|
|
2154
2154
|
}, []);
|
|
2155
2155
|
const onOpenPresentation = react.useCallback((target) => {
|
|
2156
|
-
|
|
2156
|
+
chunk3FVOKV4E_js.safeOpenUrl(target);
|
|
2157
2157
|
}, []);
|
|
2158
2158
|
const onRunProgram = react.useCallback(
|
|
2159
2159
|
(target) => {
|
|
2160
|
-
onAddRunProgramNotice?.(
|
|
2160
|
+
onAddRunProgramNotice?.(chunk3FVOKV4E_js.buildRunProgramNotice(target));
|
|
2161
2161
|
},
|
|
2162
2162
|
[onAddRunProgramNotice]
|
|
2163
2163
|
);
|
|
2164
2164
|
const onPlayMedia = react.useCallback(
|
|
2165
2165
|
(elementId) => {
|
|
2166
|
-
|
|
2166
|
+
chunk3FVOKV4E_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 = chunk3FVOKV4E_js.resolveOleVerbTarget(slides[presentationSlideIndex], elementId, verb);
|
|
2173
2173
|
if (!target) {
|
|
2174
2174
|
return;
|
|
2175
2175
|
}
|
|
2176
2176
|
if (target.action === "download") {
|
|
2177
|
-
|
|
2177
|
+
chunk3FVOKV4E_js.downloadDataUrl(target.url, target.fileName ?? "download");
|
|
2178
2178
|
} else {
|
|
2179
|
-
|
|
2179
|
+
chunk3FVOKV4E_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(chunk3FVOKV4E_js.createPresenterTimer());
|
|
2211
|
+
const [snapshot, setSnapshot] = react.useState(() => chunk3FVOKV4E_js.createInitialPresentationSnapshot(slideIndex));
|
|
2212
2212
|
const patch = react.useCallback((value) => {
|
|
2213
|
-
setSnapshot((current) =>
|
|
2213
|
+
setSnapshot((current) => chunk3FVOKV4E_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 = chunk3FVOKV4E_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: chunk3FVOKV4E_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 = chunk3FVOKV4E_js.togglePresenterTimer(timerRef.current);
|
|
2236
2236
|
patch({
|
|
2237
2237
|
paused: timerRef.current.paused,
|
|
2238
|
-
elapsedMs:
|
|
2238
|
+
elapsedMs: chunk3FVOKV4E_js.presenterElapsed(timerRef.current)
|
|
2239
2239
|
});
|
|
2240
2240
|
},
|
|
2241
2241
|
resetTimer: () => {
|
|
2242
|
-
timerRef.current =
|
|
2242
|
+
timerRef.current = chunk3FVOKV4E_js.resetPresenterTimer();
|
|
2243
2243
|
patch({ paused: false, elapsedMs: 0 });
|
|
2244
2244
|
},
|
|
2245
2245
|
stepZoom: (direction) => setSnapshot(
|
|
2246
|
-
(current) =>
|
|
2247
|
-
zoom:
|
|
2246
|
+
(current) => chunk3FVOKV4E_js.mergePresentationSnapshot(current, {
|
|
2247
|
+
zoom: chunk3FVOKV4E_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(() => chunk3FVOKV4E_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 (!chunk3FVOKV4E_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 = chunk3FVOKV4E_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 chunk3FVOKV4E_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 = chunk3FVOKV4E_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 chunk3FVOKV4E_js.buildMorphTransitionPlan(
|
|
2639
2639
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2640
2640
|
incoming,
|
|
2641
2641
|
transitionOverlay.durationMs,
|
|
2642
|
-
|
|
2642
|
+
chunk3FVOKV4E_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 = chunk3FVOKV4E_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 = chunk3FVOKV4E_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) => chunk3FVOKV4E_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 } = chunk3FVOKV4E_js.mapEditorKey(event, {
|
|
3021
3021
|
canEdit: mode === "edit",
|
|
3022
|
-
isTextInputTarget:
|
|
3022
|
+
isTextInputTarget: chunk3FVOKV4E_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 = chunk3FVOKV4E_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 = chunk3FVOKV4E_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 = chunk3FVOKV4E_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 = chunk3FVOKV4E_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 = chunk3FVOKV4E_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
|
+
...chunk3FVOKV4E_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(() => chunk3FVOKV4E_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: chunk4NSDMKFE_js.DEFAULT_CANVAS_WIDTH,
|
|
3651
|
+
height: chunk4NSDMKFE_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
|
+
chunk3FVOKV4E_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 chunk3FVOKV4E_js.GlyphOutlineFontCache();
|
|
3968
|
+
var getGlyphOutline = chunk3FVOKV4E_js.createGlyphOutlineLookup(glyphOutlineFontCache);
|
|
3969
3969
|
|
|
3970
3970
|
// src/viewer/hooks/useLoadContent.ts
|
|
3971
3971
|
function useLoadContent({
|
|
@@ -4024,8 +4024,8 @@ function useLoadContent({
|
|
|
4024
4024
|
}
|
|
4025
4025
|
let cancelled = false;
|
|
4026
4026
|
const token = ++renderTokenRef.current;
|
|
4027
|
-
const handler = new
|
|
4028
|
-
const resources =
|
|
4027
|
+
const handler = new chunk3FVOKV4E_js.PptxHandler();
|
|
4028
|
+
const resources = chunk3FVOKV4E_js.createPresentationLoadResources(handler);
|
|
4029
4029
|
const loadBlobUrls = resources.blobUrls;
|
|
4030
4030
|
(async () => {
|
|
4031
4031
|
try {
|
|
@@ -4046,12 +4046,12 @@ function useLoadContent({
|
|
|
4046
4046
|
}
|
|
4047
4047
|
const mediaElements = [];
|
|
4048
4048
|
for (const slide of parsed.slides) {
|
|
4049
|
-
|
|
4049
|
+
chunk3FVOKV4E_js.collectMediaElements(slide.elements, mediaElements);
|
|
4050
4050
|
}
|
|
4051
4051
|
const nextMediaUrls = /* @__PURE__ */ new Map();
|
|
4052
4052
|
await Promise.all(
|
|
4053
4053
|
mediaElements.map(async (mediaElement) => {
|
|
4054
|
-
const resolved = await
|
|
4054
|
+
const resolved = await chunk3FVOKV4E_js.resolveMediaElementSource(mediaElement, handler);
|
|
4055
4055
|
if (resolved.missing || !resolved.mediaPath || !resolved.url) {
|
|
4056
4056
|
mediaElement.mediaMissing = true;
|
|
4057
4057
|
return;
|
|
@@ -4062,7 +4062,7 @@ function useLoadContent({
|
|
|
4062
4062
|
}
|
|
4063
4063
|
})
|
|
4064
4064
|
);
|
|
4065
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
4065
|
+
const { paths: imagePaths, refs: imageRefs } = chunk3FVOKV4E_js.collectImagePaths(parsed.slides);
|
|
4066
4066
|
let nextSlides = parsed.slides;
|
|
4067
4067
|
if (imagePaths.size > 0) {
|
|
4068
4068
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -4078,15 +4078,15 @@ function useLoadContent({
|
|
|
4078
4078
|
})
|
|
4079
4079
|
);
|
|
4080
4080
|
nextSlides = parsed.slides.map((s) => {
|
|
4081
|
-
const newElements =
|
|
4081
|
+
const newElements = chunk3FVOKV4E_js.applyImagePathPatches(s.elements, resolvedMap, imageRefs);
|
|
4082
4082
|
return newElements === s.elements ? s : { ...s, elements: newElements };
|
|
4083
4083
|
});
|
|
4084
4084
|
}
|
|
4085
|
-
nextSlides = await
|
|
4085
|
+
nextSlides = await chunk3FVOKV4E_js.resolveTableCellImageUrls(
|
|
4086
4086
|
nextSlides,
|
|
4087
4087
|
(path) => handler.getImageData(path)
|
|
4088
4088
|
);
|
|
4089
|
-
const nextTableStyleMap = await
|
|
4089
|
+
const nextTableStyleMap = await chunk3FVOKV4E_js.resolveTableStyleImageUrls(
|
|
4090
4090
|
parsed.tableStyleMap,
|
|
4091
4091
|
(path) => handler.getImageData(path)
|
|
4092
4092
|
);
|
|
@@ -4105,12 +4105,12 @@ function useLoadContent({
|
|
|
4105
4105
|
}
|
|
4106
4106
|
resources.commit();
|
|
4107
4107
|
handlerRef.current = handler;
|
|
4108
|
-
const partition =
|
|
4108
|
+
const partition = chunk3FVOKV4E_js.partitionTemplateElements(nextSlides);
|
|
4109
4109
|
setSlides(partition.slides);
|
|
4110
4110
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4111
4111
|
setCanvasSize({
|
|
4112
|
-
width: parsed.width ??
|
|
4113
|
-
height: parsed.height ??
|
|
4112
|
+
width: parsed.width ?? chunk4NSDMKFE_js.DEFAULT_CANVAS_WIDTH,
|
|
4113
|
+
height: parsed.height ?? chunk4NSDMKFE_js.DEFAULT_CANVAS_HEIGHT
|
|
4114
4114
|
});
|
|
4115
4115
|
setSlideSizeEmu(
|
|
4116
4116
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4123,7 +4123,7 @@ function useLoadContent({
|
|
|
4123
4123
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
4124
4124
|
setSlideMasters(parsed.slideMasters ?? []);
|
|
4125
4125
|
setModernCommentAuthors(parsed.modernCommentAuthors ?? []);
|
|
4126
|
-
setRecentColors(
|
|
4126
|
+
setRecentColors(chunk3FVOKV4E_js.seedRecentColors({ mruColors: parsed.mruColors }));
|
|
4127
4127
|
setTheme(parsed.theme);
|
|
4128
4128
|
setTableStyleMap(nextTableStyleMap);
|
|
4129
4129
|
setTableStylesDefaultId(parsed.tableStylesDefaultId);
|
|
@@ -4131,7 +4131,7 @@ function useLoadContent({
|
|
|
4131
4131
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
4132
4132
|
setCustomShows(parsed.customShows ?? []);
|
|
4133
4133
|
setActiveCustomShowId(
|
|
4134
|
-
|
|
4134
|
+
chunk3FVOKV4E_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
4135
4135
|
);
|
|
4136
4136
|
setSections(parsed.sections ?? []);
|
|
4137
4137
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -4155,11 +4155,11 @@ function useLoadContent({
|
|
|
4155
4155
|
setHasMacros(parsed.hasMacros === true);
|
|
4156
4156
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4157
4157
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4158
|
-
setGuides(
|
|
4159
|
-
setReadOnlyRecommendation(
|
|
4158
|
+
setGuides(chunk3FVOKV4E_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4159
|
+
setReadOnlyRecommendation(chunk3FVOKV4E_js.readOnlyRecommendation(parsed));
|
|
4160
4160
|
setModifyVerifier(parsed.modifyVerifier ?? void 0);
|
|
4161
4161
|
setCompatToasts(
|
|
4162
|
-
|
|
4162
|
+
chunk3FVOKV4E_js.compatibilityWarningToasts([
|
|
4163
4163
|
...parsed.warnings ?? [],
|
|
4164
4164
|
...parsed.slides.flatMap((slide) => slide.warnings ?? [])
|
|
4165
4165
|
])
|
|
@@ -4171,7 +4171,7 @@ function useLoadContent({
|
|
|
4171
4171
|
onContentApplied?.();
|
|
4172
4172
|
} catch (err) {
|
|
4173
4173
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4174
|
-
if (err instanceof
|
|
4174
|
+
if (err instanceof chunk3FVOKV4E_js.EncryptedFileError) {
|
|
4175
4175
|
setIsEncrypted(true);
|
|
4176
4176
|
} else {
|
|
4177
4177
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4200,7 +4200,7 @@ function useLoadContent({
|
|
|
4200
4200
|
}
|
|
4201
4201
|
function useAutosave(input) {
|
|
4202
4202
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4203
|
-
const intervalMs =
|
|
4203
|
+
const intervalMs = chunk3FVOKV4E_js.resolveAutosaveIntervalMs({
|
|
4204
4204
|
hostIntervalMs: input.intervalMs,
|
|
4205
4205
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4206
4206
|
});
|
|
@@ -4231,7 +4231,7 @@ function useAutosave(input) {
|
|
|
4231
4231
|
return;
|
|
4232
4232
|
}
|
|
4233
4233
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4234
|
-
if (!
|
|
4234
|
+
if (!chunk3FVOKV4E_js.shouldWriteAutosaveSnapshot({
|
|
4235
4235
|
filePath: path,
|
|
4236
4236
|
isDirty: isDirtyRef.current,
|
|
4237
4237
|
saving: isSavingRef.current,
|
|
@@ -4249,8 +4249,8 @@ function useAutosave(input) {
|
|
|
4249
4249
|
isSavingRef.current = false;
|
|
4250
4250
|
return;
|
|
4251
4251
|
}
|
|
4252
|
-
await
|
|
4253
|
-
lastSnapshotRef.current =
|
|
4252
|
+
await chunk3FVOKV4E_js.saveAutosaveSnapshot(path, data);
|
|
4253
|
+
lastSnapshotRef.current = chunk3FVOKV4E_js.autosaveSnapshotMark(path, sources);
|
|
4254
4254
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4255
4255
|
} catch (err) {
|
|
4256
4256
|
setAutosaveStatus({
|
|
@@ -4304,13 +4304,13 @@ function useElementOperations(input) {
|
|
|
4304
4304
|
inlineEditingText
|
|
4305
4305
|
} = input;
|
|
4306
4306
|
const liveTextSegments = react.useCallback(() => {
|
|
4307
|
-
if (!selectedElement || !
|
|
4307
|
+
if (!selectedElement || !chunk3FVOKV4E_js.hasTextProperties(selectedElement)) {
|
|
4308
4308
|
return void 0;
|
|
4309
4309
|
}
|
|
4310
4310
|
if (selectedElement.id !== inlineEditingElementId) {
|
|
4311
4311
|
return selectedElement.textSegments;
|
|
4312
4312
|
}
|
|
4313
|
-
return
|
|
4313
|
+
return chunk3FVOKV4E_js.remapTextToSegments(
|
|
4314
4314
|
inlineEditingText,
|
|
4315
4315
|
selectedElement.textSegments,
|
|
4316
4316
|
selectedElement.textStyle
|
|
@@ -4351,11 +4351,11 @@ function useElementOperations(input) {
|
|
|
4351
4351
|
(elementId, updates) => {
|
|
4352
4352
|
if (masterView?.target) {
|
|
4353
4353
|
applyMasterViewWrite(
|
|
4354
|
-
|
|
4354
|
+
chunk3FVOKV4E_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4355
4355
|
);
|
|
4356
4356
|
return;
|
|
4357
4357
|
}
|
|
4358
|
-
if (
|
|
4358
|
+
if (chunk3FVOKV4E_js.isTemplateElementId(elementId)) {
|
|
4359
4359
|
const slideId = activeSlide?.id;
|
|
4360
4360
|
if (slideId) {
|
|
4361
4361
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4366,7 +4366,7 @@ function useElementOperations(input) {
|
|
|
4366
4366
|
}));
|
|
4367
4367
|
}
|
|
4368
4368
|
} else {
|
|
4369
|
-
setSlides((prev) =>
|
|
4369
|
+
setSlides((prev) => chunk3FVOKV4E_js.updateElement(prev, activeSlideIndex, elementId, updates));
|
|
4370
4370
|
}
|
|
4371
4371
|
history.markDirty();
|
|
4372
4372
|
},
|
|
@@ -4391,7 +4391,7 @@ function useElementOperations(input) {
|
|
|
4391
4391
|
);
|
|
4392
4392
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4393
4393
|
(updates) => {
|
|
4394
|
-
if (!selectedElement || !
|
|
4394
|
+
if (!selectedElement || !chunk3FVOKV4E_js.hasShapeProperties(selectedElement)) {
|
|
4395
4395
|
return;
|
|
4396
4396
|
}
|
|
4397
4397
|
updateSelectedElement({
|
|
@@ -4402,19 +4402,19 @@ function useElementOperations(input) {
|
|
|
4402
4402
|
);
|
|
4403
4403
|
const updateSelectedTextStyle = react.useCallback(
|
|
4404
4404
|
(updates) => {
|
|
4405
|
-
if (!selectedElement || !
|
|
4405
|
+
if (!selectedElement || !chunk3FVOKV4E_js.hasTextProperties(selectedElement)) {
|
|
4406
4406
|
return;
|
|
4407
4407
|
}
|
|
4408
4408
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4409
4409
|
const currentSegments = liveTextSegments();
|
|
4410
|
-
const inlineSel =
|
|
4410
|
+
const inlineSel = chunk3FVOKV4E_js.getInlineEditorSelection(currentSegments);
|
|
4411
4411
|
if (inlineSel && currentSegments) {
|
|
4412
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4412
|
+
const { newSegments: newSegments2, newSelection } = chunk3FVOKV4E_js.applyStyleToSelectedSegments(
|
|
4413
4413
|
currentSegments,
|
|
4414
4414
|
inlineSel,
|
|
4415
4415
|
updates
|
|
4416
4416
|
);
|
|
4417
|
-
|
|
4417
|
+
chunk3FVOKV4E_js.setPendingSelectionRestore(newSelection);
|
|
4418
4418
|
updateSelectedElement({
|
|
4419
4419
|
textSegments: newSegments2,
|
|
4420
4420
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4442,14 +4442,14 @@ function useElementOperations(input) {
|
|
|
4442
4442
|
);
|
|
4443
4443
|
const updateSelectedTextCase = react.useCallback(
|
|
4444
4444
|
(mode) => {
|
|
4445
|
-
if (!selectedElement || !
|
|
4445
|
+
if (!selectedElement || !chunk3FVOKV4E_js.hasTextProperties(selectedElement)) {
|
|
4446
4446
|
return;
|
|
4447
4447
|
}
|
|
4448
4448
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4449
4449
|
const currentSegments = liveTextSegments();
|
|
4450
|
-
const inlineSel =
|
|
4450
|
+
const inlineSel = chunk3FVOKV4E_js.getInlineEditorSelection(currentSegments);
|
|
4451
4451
|
if (inlineSel && currentSegments) {
|
|
4452
|
-
const newSegments =
|
|
4452
|
+
const newSegments = chunk3FVOKV4E_js.applyCaseTransformToSegments(currentSegments, inlineSel, mode);
|
|
4453
4453
|
updateSelectedElement({
|
|
4454
4454
|
textSegments: newSegments,
|
|
4455
4455
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4458,7 +4458,7 @@ function useElementOperations(input) {
|
|
|
4458
4458
|
}
|
|
4459
4459
|
const updates = {};
|
|
4460
4460
|
if (currentSegments && currentSegments.length > 0) {
|
|
4461
|
-
updates.textSegments =
|
|
4461
|
+
updates.textSegments = chunk3FVOKV4E_js.applyCaseTransformToSegments(
|
|
4462
4462
|
currentSegments,
|
|
4463
4463
|
null,
|
|
4464
4464
|
mode
|
|
@@ -4466,7 +4466,7 @@ function useElementOperations(input) {
|
|
|
4466
4466
|
}
|
|
4467
4467
|
const baseText = isLiveEditing ? inlineEditingText : selectedElement.text;
|
|
4468
4468
|
if (typeof baseText === "string") {
|
|
4469
|
-
updates.text =
|
|
4469
|
+
updates.text = chunk3FVOKV4E_js.transformTextCase(baseText, mode);
|
|
4470
4470
|
}
|
|
4471
4471
|
updateSelectedElement(updates);
|
|
4472
4472
|
},
|
|
@@ -4485,15 +4485,15 @@ function useElementOperations(input) {
|
|
|
4485
4485
|
[setSlides]
|
|
4486
4486
|
);
|
|
4487
4487
|
const masterViewTarget = masterView?.target ?? null;
|
|
4488
|
-
const activeElements = masterViewTarget ?
|
|
4488
|
+
const activeElements = masterViewTarget ? chunk3FVOKV4E_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4489
4489
|
const updateActiveElements = react.useCallback(
|
|
4490
4490
|
(updater) => {
|
|
4491
4491
|
if (masterView?.target) {
|
|
4492
4492
|
applyMasterViewWrite(
|
|
4493
|
-
|
|
4493
|
+
chunk3FVOKV4E_js.replaceMasterViewElements(
|
|
4494
4494
|
masterView,
|
|
4495
4495
|
masterView.target,
|
|
4496
|
-
updater(
|
|
4496
|
+
updater(chunk3FVOKV4E_js.masterViewElements(masterView, masterView.target))
|
|
4497
4497
|
)
|
|
4498
4498
|
);
|
|
4499
4499
|
return;
|
|
@@ -4546,7 +4546,7 @@ function useSectionOperations(input) {
|
|
|
4546
4546
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4547
4547
|
const addSection2 = react.useCallback(
|
|
4548
4548
|
(name, afterSlideIndex) => {
|
|
4549
|
-
const result =
|
|
4549
|
+
const result = chunk3FVOKV4E_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4550
4550
|
setSlides(result.slides);
|
|
4551
4551
|
setSections(result.sections);
|
|
4552
4552
|
markDirty();
|
|
@@ -4555,7 +4555,7 @@ function useSectionOperations(input) {
|
|
|
4555
4555
|
);
|
|
4556
4556
|
const renameSection2 = react.useCallback(
|
|
4557
4557
|
(sectionId, newName) => {
|
|
4558
|
-
const result =
|
|
4558
|
+
const result = chunk3FVOKV4E_js.renameSection(sections, slides, sectionId, newName);
|
|
4559
4559
|
setSections(result.sections);
|
|
4560
4560
|
setSlides(result.slides);
|
|
4561
4561
|
markDirty();
|
|
@@ -4564,7 +4564,7 @@ function useSectionOperations(input) {
|
|
|
4564
4564
|
);
|
|
4565
4565
|
const deleteSection2 = react.useCallback(
|
|
4566
4566
|
(sectionId) => {
|
|
4567
|
-
const result =
|
|
4567
|
+
const result = chunk3FVOKV4E_js.deleteSection(sections, slides, sectionId);
|
|
4568
4568
|
setSections(result.sections);
|
|
4569
4569
|
setSlides(result.slides);
|
|
4570
4570
|
markDirty();
|
|
@@ -4573,21 +4573,21 @@ function useSectionOperations(input) {
|
|
|
4573
4573
|
);
|
|
4574
4574
|
const moveSectionUp2 = react.useCallback(
|
|
4575
4575
|
(sectionId) => {
|
|
4576
|
-
setSections(
|
|
4576
|
+
setSections(chunk3FVOKV4E_js.moveSectionUp(sections, sectionId));
|
|
4577
4577
|
markDirty();
|
|
4578
4578
|
},
|
|
4579
4579
|
[sections, setSections, markDirty]
|
|
4580
4580
|
);
|
|
4581
4581
|
const moveSectionDown2 = react.useCallback(
|
|
4582
4582
|
(sectionId) => {
|
|
4583
|
-
setSections(
|
|
4583
|
+
setSections(chunk3FVOKV4E_js.moveSectionDown(sections, sectionId));
|
|
4584
4584
|
markDirty();
|
|
4585
4585
|
},
|
|
4586
4586
|
[sections, setSections, markDirty]
|
|
4587
4587
|
);
|
|
4588
4588
|
const moveSlidesToSection2 = react.useCallback(
|
|
4589
4589
|
(slideIndexes, targetSectionId) => {
|
|
4590
|
-
const result =
|
|
4590
|
+
const result = chunk3FVOKV4E_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4591
4591
|
setSlides(result.slides);
|
|
4592
4592
|
setSections(result.sections);
|
|
4593
4593
|
markDirty();
|
|
@@ -4653,15 +4653,15 @@ function syncSelectionHandleOverlay(elementNode, elementId, geometry) {
|
|
|
4653
4653
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4654
4654
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
|
|
4655
4655
|
const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
|
|
4656
|
-
let resized =
|
|
4656
|
+
let resized = chunk3FVOKV4E_js.applyResize(startBox, handle, dx, dy, 1, { minSize: chunk4NSDMKFE_js.MIN_ELEMENT_SIZE });
|
|
4657
4657
|
if (lockAspect) {
|
|
4658
|
-
resized =
|
|
4658
|
+
resized = chunk3FVOKV4E_js.lockResizeAspect(resized, startBox, handle, chunk4NSDMKFE_js.MIN_ELEMENT_SIZE);
|
|
4659
4659
|
}
|
|
4660
4660
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4661
4661
|
if (!snapToGrid) {
|
|
4662
4662
|
return box;
|
|
4663
4663
|
}
|
|
4664
|
-
return
|
|
4664
|
+
return chunk3FVOKV4E_js.snapBoxToGrid(box, handle, gridSpacingPx, chunk4NSDMKFE_js.MIN_ELEMENT_SIZE);
|
|
4665
4665
|
}
|
|
4666
4666
|
function resolveLiveTarget(input) {
|
|
4667
4667
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4774,7 +4774,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4774
4774
|
width: el.width,
|
|
4775
4775
|
height: el.height
|
|
4776
4776
|
}));
|
|
4777
|
-
const snapResult =
|
|
4777
|
+
const snapResult = chunk3FVOKV4E_js.computeSnapToShape(
|
|
4778
4778
|
targetX,
|
|
4779
4779
|
targetY,
|
|
4780
4780
|
primaryEl.width,
|
|
@@ -4816,7 +4816,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4816
4816
|
if (live) {
|
|
4817
4817
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4818
4818
|
const start = drag.startPositionsById[id];
|
|
4819
|
-
|
|
4819
|
+
chunk3FVOKV4E_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4820
4820
|
x: start.x + appliedDx,
|
|
4821
4821
|
y: start.y + appliedDy
|
|
4822
4822
|
});
|
|
@@ -4848,8 +4848,8 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4848
4848
|
rs.lastY = geo.y;
|
|
4849
4849
|
rs.lastWidth = geo.width;
|
|
4850
4850
|
rs.lastHeight = geo.height;
|
|
4851
|
-
const width = Math.max(geo.width,
|
|
4852
|
-
const height = Math.max(geo.height,
|
|
4851
|
+
const width = Math.max(geo.width, chunk4NSDMKFE_js.MIN_ELEMENT_SIZE);
|
|
4852
|
+
const height = Math.max(geo.height, chunk4NSDMKFE_js.MIN_ELEMENT_SIZE);
|
|
4853
4853
|
if (rs.domEl) {
|
|
4854
4854
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4855
4855
|
rs.domEl.style.top = `${geo.y}px`;
|
|
@@ -4858,7 +4858,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4858
4858
|
syncSelectionHandleOverlay(rs.domEl, rs.elementId, { x: geo.x, y: geo.y, width, height });
|
|
4859
4859
|
}
|
|
4860
4860
|
if (live) {
|
|
4861
|
-
|
|
4861
|
+
chunk3FVOKV4E_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4862
4862
|
x: geo.x,
|
|
4863
4863
|
y: geo.y,
|
|
4864
4864
|
width,
|
|
@@ -4869,7 +4869,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4869
4869
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4870
4870
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4871
4871
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4872
|
-
const adjustments =
|
|
4872
|
+
const adjustments = chunk3FVOKV4E_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4873
4873
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4874
4874
|
adj.moved = true;
|
|
4875
4875
|
}
|
|
@@ -4944,13 +4944,13 @@ function processPointerUp(input) {
|
|
|
4944
4944
|
if (i !== activeSlideIndex) {
|
|
4945
4945
|
return s;
|
|
4946
4946
|
}
|
|
4947
|
-
const rerouted =
|
|
4947
|
+
const rerouted = chunk3FVOKV4E_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4948
4948
|
if (rerouted.length === 0) {
|
|
4949
4949
|
return s;
|
|
4950
4950
|
}
|
|
4951
4951
|
return {
|
|
4952
4952
|
...s,
|
|
4953
|
-
elements:
|
|
4953
|
+
elements: chunk3FVOKV4E_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4954
4954
|
};
|
|
4955
4955
|
})
|
|
4956
4956
|
);
|
|
@@ -4970,14 +4970,16 @@ function processPointerUp(input) {
|
|
|
4970
4970
|
setSnapLines([]);
|
|
4971
4971
|
if (wasMoved) {
|
|
4972
4972
|
markDirty();
|
|
4973
|
+
}
|
|
4974
|
+
if (drag || rs || adj || marquee) {
|
|
4973
4975
|
setPointerCommitNonce((n) => n + 1);
|
|
4974
4976
|
}
|
|
4975
4977
|
}
|
|
4976
4978
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4977
4979
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4978
|
-
const hitIds =
|
|
4980
|
+
const hitIds = chunk3FVOKV4E_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4979
4981
|
if (marquee.additive) {
|
|
4980
|
-
const merged =
|
|
4982
|
+
const merged = chunk3FVOKV4E_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4981
4983
|
if (merged.length > 0) {
|
|
4982
4984
|
applySelection(merged[0], merged);
|
|
4983
4985
|
} else {
|
|
@@ -5000,8 +5002,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
5000
5002
|
}
|
|
5001
5003
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
5002
5004
|
});
|
|
5003
|
-
const rerouted =
|
|
5004
|
-
return
|
|
5005
|
+
const rerouted = chunk3FVOKV4E_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
5006
|
+
return chunk3FVOKV4E_js.applyReroutedConnectors(movedElements, rerouted);
|
|
5005
5007
|
};
|
|
5006
5008
|
if (editTemplateMode) {
|
|
5007
5009
|
const slideId = activeSlide?.id;
|
|
@@ -5157,17 +5159,17 @@ function useCanvasInteractions(input) {
|
|
|
5157
5159
|
return;
|
|
5158
5160
|
}
|
|
5159
5161
|
const el = elementLookup.get(editId);
|
|
5160
|
-
if (el &&
|
|
5162
|
+
if (el && chunk3FVOKV4E_js.hasTextProperties(el)) {
|
|
5161
5163
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
5162
|
-
const textPatch =
|
|
5164
|
+
const textPatch = chunk3FVOKV4E_js.buildInlineTextCommitPatch(el, committedText);
|
|
5163
5165
|
if (!textPatch) {
|
|
5164
5166
|
setInlineEditingElementId(null);
|
|
5165
5167
|
setInlineEditingText("");
|
|
5166
5168
|
return;
|
|
5167
5169
|
}
|
|
5168
5170
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
5169
|
-
const newHeight =
|
|
5170
|
-
const shrink =
|
|
5171
|
+
const newHeight = chunk3FVOKV4E_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
5172
|
+
const shrink = chunk3FVOKV4E_js.resolveInlineEditNormAutofitShrink(el.textStyle, el.height, editorEl);
|
|
5171
5173
|
ops.updateElementById(editId, {
|
|
5172
5174
|
...textPatch,
|
|
5173
5175
|
...newHeight !== void 0 ? { height: newHeight } : {},
|
|
@@ -5185,7 +5187,7 @@ function useCanvasInteractions(input) {
|
|
|
5185
5187
|
setInlineEditingText("");
|
|
5186
5188
|
};
|
|
5187
5189
|
const openEquationEditorForElement = (el) => {
|
|
5188
|
-
if (!
|
|
5190
|
+
if (!chunk3FVOKV4E_js.hasTextProperties(el)) {
|
|
5189
5191
|
return false;
|
|
5190
5192
|
}
|
|
5191
5193
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5215,7 +5217,7 @@ function useCanvasInteractions(input) {
|
|
|
5215
5217
|
justInteractedRef.current = false;
|
|
5216
5218
|
} else {
|
|
5217
5219
|
const el = elementLookup.get(elementId);
|
|
5218
|
-
if (el &&
|
|
5220
|
+
if (el && chunk3FVOKV4E_js.hasTextProperties(el) && chunk3FVOKV4E_js.canInteractWithElement(el, "textEdit")) {
|
|
5219
5221
|
if (!openEquationEditorForElement(el)) {
|
|
5220
5222
|
setInlineEditingElementId(elementId);
|
|
5221
5223
|
setInlineEditingText(el.text ?? "");
|
|
@@ -5234,7 +5236,7 @@ function useCanvasInteractions(input) {
|
|
|
5234
5236
|
if (openEquationEditorForElement(el)) {
|
|
5235
5237
|
return;
|
|
5236
5238
|
}
|
|
5237
|
-
if (
|
|
5239
|
+
if (chunk3FVOKV4E_js.hasTextProperties(el) && chunk3FVOKV4E_js.canInteractWithElement(el, "textEdit")) {
|
|
5238
5240
|
setInlineEditingElementId(elementId);
|
|
5239
5241
|
setInlineEditingText(el.text ?? "");
|
|
5240
5242
|
}
|
|
@@ -5257,7 +5259,7 @@ function useCanvasInteractions(input) {
|
|
|
5257
5259
|
justSelectedRef.current = false;
|
|
5258
5260
|
}
|
|
5259
5261
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
5260
|
-
const movableIds =
|
|
5262
|
+
const movableIds = chunk3FVOKV4E_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
5261
5263
|
if (movableIds.length === 0) {
|
|
5262
5264
|
return;
|
|
5263
5265
|
}
|
|
@@ -5327,7 +5329,7 @@ function useCanvasInteractions(input) {
|
|
|
5327
5329
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5328
5330
|
e.stopPropagation();
|
|
5329
5331
|
const el = elementLookup.get(elementId);
|
|
5330
|
-
if (!el || !
|
|
5332
|
+
if (!el || !chunk3FVOKV4E_js.canInteractWithElement(el, "resize")) {
|
|
5331
5333
|
return;
|
|
5332
5334
|
}
|
|
5333
5335
|
resizeStateRef.current = {
|
|
@@ -5349,7 +5351,7 @@ function useCanvasInteractions(input) {
|
|
|
5349
5351
|
};
|
|
5350
5352
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5351
5353
|
const el = elementLookup.get(elementId);
|
|
5352
|
-
if (!el || !
|
|
5354
|
+
if (!el || !chunk3FVOKV4E_js.canInteractWithElement(el, "rotate")) {
|
|
5353
5355
|
return;
|
|
5354
5356
|
}
|
|
5355
5357
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5369,10 +5371,10 @@ function useCanvasInteractions(input) {
|
|
|
5369
5371
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5370
5372
|
e.stopPropagation();
|
|
5371
5373
|
const el = elementLookup.get(elementId);
|
|
5372
|
-
if (!el || !
|
|
5374
|
+
if (!el || !chunk3FVOKV4E_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5373
5375
|
return;
|
|
5374
5376
|
}
|
|
5375
|
-
shapeAdjustmentDragStateRef.current =
|
|
5377
|
+
shapeAdjustmentDragStateRef.current = chunk3FVOKV4E_js.beginShapeAdjustment(
|
|
5376
5378
|
el,
|
|
5377
5379
|
descriptor,
|
|
5378
5380
|
e.clientX,
|
|
@@ -5419,7 +5421,7 @@ function createFileHandlers(deps) {
|
|
|
5419
5421
|
h = Math.round(h * scale);
|
|
5420
5422
|
}
|
|
5421
5423
|
addElement({
|
|
5422
|
-
id:
|
|
5424
|
+
id: chunk3FVOKV4E_js.generateElementId(),
|
|
5423
5425
|
type: "image",
|
|
5424
5426
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5425
5427
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5430,7 +5432,7 @@ function createFileHandlers(deps) {
|
|
|
5430
5432
|
};
|
|
5431
5433
|
img.onerror = () => {
|
|
5432
5434
|
addElement({
|
|
5433
|
-
id:
|
|
5435
|
+
id: chunk3FVOKV4E_js.generateElementId(),
|
|
5434
5436
|
type: "image",
|
|
5435
5437
|
x: 100,
|
|
5436
5438
|
y: 100,
|
|
@@ -5449,14 +5451,14 @@ function createFileHandlers(deps) {
|
|
|
5449
5451
|
return;
|
|
5450
5452
|
}
|
|
5451
5453
|
e.target.value = "";
|
|
5452
|
-
const mediaType =
|
|
5454
|
+
const mediaType = chunk3FVOKV4E_js.classifyMediaType(file.type);
|
|
5453
5455
|
if (!mediaType) {
|
|
5454
5456
|
return;
|
|
5455
5457
|
}
|
|
5456
5458
|
const elFilePath = file.path;
|
|
5457
5459
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5458
5460
|
addElement({
|
|
5459
|
-
id:
|
|
5461
|
+
id: chunk3FVOKV4E_js.generateElementId(),
|
|
5460
5462
|
type: "media",
|
|
5461
5463
|
mediaType,
|
|
5462
5464
|
mediaMimeType: file.type || void 0,
|
|
@@ -5631,13 +5633,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5631
5633
|
return;
|
|
5632
5634
|
}
|
|
5633
5635
|
addElement({
|
|
5634
|
-
id:
|
|
5636
|
+
id: chunk3FVOKV4E_js.generateElementId(),
|
|
5635
5637
|
type: "smartArt",
|
|
5636
5638
|
x: 100,
|
|
5637
5639
|
y: 120,
|
|
5638
5640
|
width: 600,
|
|
5639
5641
|
height: 340,
|
|
5640
|
-
smartArtData:
|
|
5642
|
+
smartArtData: chunk3FVOKV4E_js.buildSmartArtPresetData(
|
|
5641
5643
|
layout,
|
|
5642
5644
|
defaultItems,
|
|
5643
5645
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5649,7 +5651,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5649
5651
|
return;
|
|
5650
5652
|
}
|
|
5651
5653
|
addElement({
|
|
5652
|
-
id:
|
|
5654
|
+
id: chunk3FVOKV4E_js.generateElementId(),
|
|
5653
5655
|
type: "shape",
|
|
5654
5656
|
x: 120,
|
|
5655
5657
|
y: 200,
|
|
@@ -5687,7 +5689,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5687
5689
|
return;
|
|
5688
5690
|
}
|
|
5689
5691
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5690
|
-
if (resolved.url && !
|
|
5692
|
+
if (resolved.url && !chunk3FVOKV4E_js.isUrlSafe(resolved.url)) {
|
|
5691
5693
|
return;
|
|
5692
5694
|
}
|
|
5693
5695
|
const actionClick = {
|
|
@@ -5711,7 +5713,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5711
5713
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5712
5714
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5713
5715
|
addElement({
|
|
5714
|
-
id:
|
|
5716
|
+
id: chunk3FVOKV4E_js.generateElementId(),
|
|
5715
5717
|
type: "shape",
|
|
5716
5718
|
x: 120,
|
|
5717
5719
|
y: 200,
|
|
@@ -5733,11 +5735,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5733
5735
|
if (!activeSlide) {
|
|
5734
5736
|
return;
|
|
5735
5737
|
}
|
|
5736
|
-
const preset =
|
|
5738
|
+
const preset = chunk3FVOKV4E_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5737
5739
|
if (!preset) {
|
|
5738
5740
|
return;
|
|
5739
5741
|
}
|
|
5740
|
-
const defaultPptxAction =
|
|
5742
|
+
const defaultPptxAction = chunk3FVOKV4E_js.elementActionToPptxAction({
|
|
5741
5743
|
trigger: "click",
|
|
5742
5744
|
type: preset.defaultAction
|
|
5743
5745
|
});
|
|
@@ -5746,7 +5748,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5746
5748
|
defaultPptxAction.highlightClick = true;
|
|
5747
5749
|
}
|
|
5748
5750
|
addElement({
|
|
5749
|
-
id:
|
|
5751
|
+
id: chunk3FVOKV4E_js.generateElementId(),
|
|
5750
5752
|
type: "shape",
|
|
5751
5753
|
x: 150,
|
|
5752
5754
|
y: 150,
|
|
@@ -5813,14 +5815,14 @@ function useInsertElements(input) {
|
|
|
5813
5815
|
return;
|
|
5814
5816
|
}
|
|
5815
5817
|
addElement({
|
|
5816
|
-
id:
|
|
5818
|
+
id: chunk3FVOKV4E_js.generateElementId(),
|
|
5817
5819
|
type: "text",
|
|
5818
5820
|
x: 100,
|
|
5819
5821
|
y: 100,
|
|
5820
5822
|
width: 300,
|
|
5821
5823
|
height: 60,
|
|
5822
5824
|
text: "",
|
|
5823
|
-
textStyle: { fontSize:
|
|
5825
|
+
textStyle: { fontSize: chunk4NSDMKFE_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5824
5826
|
});
|
|
5825
5827
|
};
|
|
5826
5828
|
const handleAddShape = () => {
|
|
@@ -5828,7 +5830,7 @@ function useInsertElements(input) {
|
|
|
5828
5830
|
return;
|
|
5829
5831
|
}
|
|
5830
5832
|
addElement({
|
|
5831
|
-
id:
|
|
5833
|
+
id: chunk3FVOKV4E_js.generateElementId(),
|
|
5832
5834
|
type: "shape",
|
|
5833
5835
|
x: 150,
|
|
5834
5836
|
y: 150,
|
|
@@ -5847,15 +5849,15 @@ function useInsertElements(input) {
|
|
|
5847
5849
|
return;
|
|
5848
5850
|
}
|
|
5849
5851
|
addElement({
|
|
5850
|
-
...
|
|
5851
|
-
id:
|
|
5852
|
+
...chunk3FVOKV4E_js.newTableElement(chunk4NSDMKFE_js.DEFAULT_TABLE_ROWS, chunk4NSDMKFE_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5853
|
+
id: chunk3FVOKV4E_js.generateElementId()
|
|
5852
5854
|
});
|
|
5853
5855
|
};
|
|
5854
5856
|
const handleAddChart = (chartKind) => {
|
|
5855
5857
|
if (!activeSlide) {
|
|
5856
5858
|
return;
|
|
5857
5859
|
}
|
|
5858
|
-
addElement(
|
|
5860
|
+
addElement(chunk3FVOKV4E_js.createDefaultChartElement(chartKind));
|
|
5859
5861
|
};
|
|
5860
5862
|
const structured = createStructuredElementHandlers({
|
|
5861
5863
|
activeSlide,
|
|
@@ -5925,7 +5927,7 @@ function useClipboardHandlers(input) {
|
|
|
5925
5927
|
if (!selectedElement) {
|
|
5926
5928
|
return;
|
|
5927
5929
|
}
|
|
5928
|
-
setClipboardPayload(
|
|
5930
|
+
setClipboardPayload(chunk3FVOKV4E_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5929
5931
|
};
|
|
5930
5932
|
const handleDelete = () => {
|
|
5931
5933
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5942,7 +5944,7 @@ function useClipboardHandlers(input) {
|
|
|
5942
5944
|
handleDelete();
|
|
5943
5945
|
};
|
|
5944
5946
|
const insertClone = (source) => {
|
|
5945
|
-
const clone =
|
|
5947
|
+
const clone = chunk3FVOKV4E_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5946
5948
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5947
5949
|
ops.applySelection(clone.id);
|
|
5948
5950
|
history.markDirty();
|
|
@@ -5977,7 +5979,7 @@ function resolveShapePath(el) {
|
|
|
5977
5979
|
return el.pathData;
|
|
5978
5980
|
}
|
|
5979
5981
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5980
|
-
const clipPath =
|
|
5982
|
+
const clipPath = chunk3FVOKV4E_js.getPresetShapeClipPath(el.shapeType);
|
|
5981
5983
|
if (clipPath) {
|
|
5982
5984
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5983
5985
|
if (svgPath) {
|
|
@@ -6028,7 +6030,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
6028
6030
|
return parts.join(" ");
|
|
6029
6031
|
}
|
|
6030
6032
|
function transformPathToGlobal(pathData, el) {
|
|
6031
|
-
const polys =
|
|
6033
|
+
const polys = chunk3FVOKV4E_js.svgPathToPolygons(pathData);
|
|
6032
6034
|
if (polys.length === 0) {
|
|
6033
6035
|
return pathData;
|
|
6034
6036
|
}
|
|
@@ -6048,10 +6050,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
6048
6050
|
y: pt.y * scaleY + el.y
|
|
6049
6051
|
}))
|
|
6050
6052
|
);
|
|
6051
|
-
return
|
|
6053
|
+
return chunk3FVOKV4E_js.polygonsToSvgPath(transformed);
|
|
6052
6054
|
}
|
|
6053
6055
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
6054
|
-
const polys =
|
|
6056
|
+
const polys = chunk3FVOKV4E_js.svgPathToPolygons(pathData);
|
|
6055
6057
|
if (polys.length === 0) {
|
|
6056
6058
|
return pathData;
|
|
6057
6059
|
}
|
|
@@ -6061,10 +6063,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
6061
6063
|
y: pt.y - y
|
|
6062
6064
|
}))
|
|
6063
6065
|
);
|
|
6064
|
-
return
|
|
6066
|
+
return chunk3FVOKV4E_js.polygonsToSvgPath(transformed);
|
|
6065
6067
|
}
|
|
6066
6068
|
function pathBounds(pathData) {
|
|
6067
|
-
const polys =
|
|
6069
|
+
const polys = chunk3FVOKV4E_js.svgPathToPolygons(pathData);
|
|
6068
6070
|
let minX = Infinity;
|
|
6069
6071
|
let minY = Infinity;
|
|
6070
6072
|
let maxX = -Infinity;
|
|
@@ -6123,7 +6125,7 @@ function useMergeShapesHandler(input) {
|
|
|
6123
6125
|
let allFragments = [];
|
|
6124
6126
|
let remaining = globalPaths[0];
|
|
6125
6127
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6126
|
-
const frags =
|
|
6128
|
+
const frags = chunk3FVOKV4E_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
6127
6129
|
if (Array.isArray(frags)) {
|
|
6128
6130
|
allFragments = frags;
|
|
6129
6131
|
}
|
|
@@ -6152,7 +6154,7 @@ function useMergeShapesHandler(input) {
|
|
|
6152
6154
|
bounds.height
|
|
6153
6155
|
);
|
|
6154
6156
|
const newEl = {
|
|
6155
|
-
id:
|
|
6157
|
+
id: chunk3FVOKV4E_js.generateElementId(),
|
|
6156
6158
|
type: "shape",
|
|
6157
6159
|
x: bounds.x,
|
|
6158
6160
|
y: bounds.y,
|
|
@@ -6190,7 +6192,7 @@ function useMergeShapesHandler(input) {
|
|
|
6190
6192
|
} else {
|
|
6191
6193
|
let resultPath = globalPaths[0];
|
|
6192
6194
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6193
|
-
const result =
|
|
6195
|
+
const result = chunk3FVOKV4E_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
6194
6196
|
if (typeof result === "string") {
|
|
6195
6197
|
resultPath = result;
|
|
6196
6198
|
}
|
|
@@ -6211,7 +6213,7 @@ function useMergeShapesHandler(input) {
|
|
|
6211
6213
|
);
|
|
6212
6214
|
const primary = targets[0];
|
|
6213
6215
|
const newEl = {
|
|
6214
|
-
id:
|
|
6216
|
+
id: chunk3FVOKV4E_js.generateElementId(),
|
|
6215
6217
|
type: "shape",
|
|
6216
6218
|
x: bounds.x,
|
|
6217
6219
|
y: bounds.y,
|
|
@@ -6274,10 +6276,10 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6274
6276
|
if (ids.length < 2 || !activeSlide) {
|
|
6275
6277
|
return;
|
|
6276
6278
|
}
|
|
6277
|
-
if (!selectedElements.every((el) =>
|
|
6279
|
+
if (!selectedElements.every((el) => chunk3FVOKV4E_js.canInteractWithElement(el, "group"))) {
|
|
6278
6280
|
return;
|
|
6279
6281
|
}
|
|
6280
|
-
const { elements, groupId } =
|
|
6282
|
+
const { elements, groupId } = chunk3FVOKV4E_js.groupElements(ops.activeElements, ids, chunk3FVOKV4E_js.generateElementId());
|
|
6281
6283
|
if (groupId === null) {
|
|
6282
6284
|
return;
|
|
6283
6285
|
}
|
|
@@ -6289,15 +6291,15 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6289
6291
|
if (!selectedElement || selectedElement.type !== "group" || !activeSlide) {
|
|
6290
6292
|
return;
|
|
6291
6293
|
}
|
|
6292
|
-
if (!
|
|
6294
|
+
if (!chunk3FVOKV4E_js.canInteractWithElement(selectedElement, "group")) {
|
|
6293
6295
|
return;
|
|
6294
6296
|
}
|
|
6295
6297
|
const group = selectedElement;
|
|
6296
|
-
const intoTemplate =
|
|
6298
|
+
const intoTemplate = chunk3FVOKV4E_js.isTemplateElementId(group.id);
|
|
6297
6299
|
const childIds = group.children.map(
|
|
6298
|
-
(child) => intoTemplate ?
|
|
6300
|
+
(child) => intoTemplate ? chunk3FVOKV4E_js.makeCloneId(true, child.id || group.id) : child.id || chunk3FVOKV4E_js.generateElementId()
|
|
6299
6301
|
);
|
|
6300
|
-
const { elements, childIds: usedIds } =
|
|
6302
|
+
const { elements, childIds: usedIds } = chunk3FVOKV4E_js.ungroupElements(
|
|
6301
6303
|
ops.activeElements,
|
|
6302
6304
|
group.id,
|
|
6303
6305
|
childIds,
|
|
@@ -6326,7 +6328,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6326
6328
|
if (!edge) {
|
|
6327
6329
|
return;
|
|
6328
6330
|
}
|
|
6329
|
-
const positions =
|
|
6331
|
+
const positions = chunk3FVOKV4E_js.alignElements(selectedElements, edge);
|
|
6330
6332
|
for (const [id, pos] of positions) {
|
|
6331
6333
|
const el = elementLookup.get(id);
|
|
6332
6334
|
if (!el) {
|
|
@@ -6344,7 +6346,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6344
6346
|
if (!distAxis) {
|
|
6345
6347
|
return;
|
|
6346
6348
|
}
|
|
6347
|
-
const positions =
|
|
6349
|
+
const positions = chunk3FVOKV4E_js.distributeElements(selectedElements, distAxis);
|
|
6348
6350
|
for (const [id, pos] of positions) {
|
|
6349
6351
|
const el = elementLookup.get(id);
|
|
6350
6352
|
if (!el) {
|
|
@@ -6355,14 +6357,14 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6355
6357
|
history.markDirty();
|
|
6356
6358
|
};
|
|
6357
6359
|
const canDistribute = selectedElements.length >= 3;
|
|
6358
|
-
const selectionGroupable = selectedElements.every((el) =>
|
|
6360
|
+
const selectionGroupable = selectedElements.every((el) => chunk3FVOKV4E_js.canInteractWithElement(el, "group"));
|
|
6359
6361
|
const handleMoveLayer = (direction) => {
|
|
6360
6362
|
if (!selectedElement || !activeSlide) {
|
|
6361
6363
|
return;
|
|
6362
6364
|
}
|
|
6363
6365
|
const id = selectedElement.id;
|
|
6364
6366
|
ops.updateActiveElements(
|
|
6365
|
-
(els) => direction === "forward" ?
|
|
6367
|
+
(els) => direction === "forward" ? chunk3FVOKV4E_js.bringForward(els, id) : direction === "backward" ? chunk3FVOKV4E_js.sendBackward(els, id) : els
|
|
6366
6368
|
);
|
|
6367
6369
|
history.markDirty();
|
|
6368
6370
|
};
|
|
@@ -6372,7 +6374,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6372
6374
|
}
|
|
6373
6375
|
const id = selectedElement.id;
|
|
6374
6376
|
ops.updateActiveElements(
|
|
6375
|
-
(els) => direction === "front" ?
|
|
6377
|
+
(els) => direction === "front" ? chunk3FVOKV4E_js.bringToFront(els, id) : chunk3FVOKV4E_js.sendToBack(els, id)
|
|
6376
6378
|
);
|
|
6377
6379
|
history.markDirty();
|
|
6378
6380
|
};
|
|
@@ -6507,7 +6509,7 @@ function useSlideManagement(input) {
|
|
|
6507
6509
|
} = input;
|
|
6508
6510
|
const handleAddSlideAfter = (afterIndex) => {
|
|
6509
6511
|
const insertAt = Math.max(0, Math.min(afterIndex + 1, slides.length));
|
|
6510
|
-
const newSlide =
|
|
6512
|
+
const newSlide = chunk3FVOKV4E_js.createBlankSlide(slides.length + 1);
|
|
6511
6513
|
ops.updateSlides((prev) => {
|
|
6512
6514
|
const next = [...prev];
|
|
6513
6515
|
next.splice(insertAt, 0, newSlide);
|
|
@@ -6571,7 +6573,7 @@ function useSlideManagement(input) {
|
|
|
6571
6573
|
}
|
|
6572
6574
|
const clone = {
|
|
6573
6575
|
...src,
|
|
6574
|
-
id:
|
|
6576
|
+
id: chunk3FVOKV4E_js.makeSlideId(),
|
|
6575
6577
|
elements: src.elements.map((el) => ({
|
|
6576
6578
|
...el,
|
|
6577
6579
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6603,7 +6605,7 @@ function useSlideManagement(input) {
|
|
|
6603
6605
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6604
6606
|
const insertAt = activeSlideIndex + 1;
|
|
6605
6607
|
const draft = {
|
|
6606
|
-
...
|
|
6608
|
+
...chunk3FVOKV4E_js.createBlankSlide(slides.length + 1),
|
|
6607
6609
|
layoutPath,
|
|
6608
6610
|
...layoutName ? { layoutName } : {}
|
|
6609
6611
|
};
|
|
@@ -6636,9 +6638,9 @@ function useSlideManagement(input) {
|
|
|
6636
6638
|
};
|
|
6637
6639
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6638
6640
|
const insertAt = activeSlideIndex + 1;
|
|
6639
|
-
const draft =
|
|
6641
|
+
const draft = chunk3FVOKV4E_js.buildSlideTemplateSlide(templateId, chunk3FVOKV4E_js.makeSlideId(), slides.length + 1, {
|
|
6640
6642
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6641
|
-
scheme:
|
|
6643
|
+
scheme: chunk3FVOKV4E_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6642
6644
|
});
|
|
6643
6645
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6644
6646
|
setActiveSlideIndex(insertAt);
|
|
@@ -6676,7 +6678,7 @@ function createTableMergeHandlers(input) {
|
|
|
6676
6678
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6677
6679
|
return;
|
|
6678
6680
|
}
|
|
6679
|
-
const newTableData =
|
|
6681
|
+
const newTableData = chunk3FVOKV4E_js.mergeCells(
|
|
6680
6682
|
[
|
|
6681
6683
|
{ row: rowIndex, col: columnIndex },
|
|
6682
6684
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6684,7 +6686,7 @@ function createTableMergeHandlers(input) {
|
|
|
6684
6686
|
td
|
|
6685
6687
|
);
|
|
6686
6688
|
const updates = { tableData: newTableData };
|
|
6687
|
-
const newRawXml =
|
|
6689
|
+
const newRawXml = chunk3FVOKV4E_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6688
6690
|
if (newRawXml) {
|
|
6689
6691
|
updates.rawXml = newRawXml;
|
|
6690
6692
|
}
|
|
@@ -6710,7 +6712,7 @@ function createTableMergeHandlers(input) {
|
|
|
6710
6712
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6711
6713
|
return;
|
|
6712
6714
|
}
|
|
6713
|
-
const newTableData =
|
|
6715
|
+
const newTableData = chunk3FVOKV4E_js.mergeCells(
|
|
6714
6716
|
[
|
|
6715
6717
|
{ row: rowIndex, col: columnIndex },
|
|
6716
6718
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6718,7 +6720,7 @@ function createTableMergeHandlers(input) {
|
|
|
6718
6720
|
td
|
|
6719
6721
|
);
|
|
6720
6722
|
const updates = { tableData: newTableData };
|
|
6721
|
-
const newRawXml =
|
|
6723
|
+
const newRawXml = chunk3FVOKV4E_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6722
6724
|
if (newRawXml) {
|
|
6723
6725
|
updates.rawXml = newRawXml;
|
|
6724
6726
|
}
|
|
@@ -6733,9 +6735,9 @@ function createTableMergeHandlers(input) {
|
|
|
6733
6735
|
return;
|
|
6734
6736
|
}
|
|
6735
6737
|
const td = selectedElement.tableData;
|
|
6736
|
-
const newTableData =
|
|
6738
|
+
const newTableData = chunk3FVOKV4E_js.mergeCells(ts.selectedCells, td);
|
|
6737
6739
|
const updates = { tableData: newTableData };
|
|
6738
|
-
const newRawXml =
|
|
6740
|
+
const newRawXml = chunk3FVOKV4E_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6739
6741
|
if (newRawXml) {
|
|
6740
6742
|
updates.rawXml = newRawXml;
|
|
6741
6743
|
}
|
|
@@ -6752,9 +6754,9 @@ function createTableMergeHandlers(input) {
|
|
|
6752
6754
|
}
|
|
6753
6755
|
const { rowIndex, columnIndex } = ts;
|
|
6754
6756
|
const td = selectedElement.tableData;
|
|
6755
|
-
const newTableData =
|
|
6757
|
+
const newTableData = chunk3FVOKV4E_js.splitCell(rowIndex, columnIndex, td);
|
|
6756
6758
|
const updates = { tableData: newTableData };
|
|
6757
|
-
const newRawXml =
|
|
6759
|
+
const newRawXml = chunk3FVOKV4E_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6758
6760
|
if (newRawXml) {
|
|
6759
6761
|
updates.rawXml = newRawXml;
|
|
6760
6762
|
}
|
|
@@ -6788,10 +6790,10 @@ function createTableStructHandlers(input) {
|
|
|
6788
6790
|
const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
|
|
6789
6791
|
const updates = {};
|
|
6790
6792
|
if (el.tableData) {
|
|
6791
|
-
updates.tableData =
|
|
6793
|
+
updates.tableData = chunk3FVOKV4E_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6792
6794
|
}
|
|
6793
6795
|
if (el.rawXml) {
|
|
6794
|
-
const newRawXml =
|
|
6796
|
+
const newRawXml = chunk3FVOKV4E_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6795
6797
|
if (newRawXml) {
|
|
6796
6798
|
updates.rawXml = newRawXml;
|
|
6797
6799
|
}
|
|
@@ -6815,7 +6817,7 @@ function createTableStructHandlers(input) {
|
|
|
6815
6817
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6816
6818
|
const updates = {};
|
|
6817
6819
|
if (selectedElement.rawXml) {
|
|
6818
|
-
const newRawXml =
|
|
6820
|
+
const newRawXml = chunk3FVOKV4E_js.updateCellTextStyleInRawXml(
|
|
6819
6821
|
selectedElement,
|
|
6820
6822
|
rowIndex,
|
|
6821
6823
|
colIndex,
|
|
@@ -6879,7 +6881,7 @@ function createTableStructHandlers(input) {
|
|
|
6879
6881
|
return;
|
|
6880
6882
|
}
|
|
6881
6883
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6882
|
-
const next =
|
|
6884
|
+
const next = chunk3FVOKV4E_js.insertTableElementRow(selectedElement, rowIdx, position);
|
|
6883
6885
|
ops.updateSelectedElement({ tableData: next.tableData, rawXml: next.rawXml });
|
|
6884
6886
|
history.markDirty();
|
|
6885
6887
|
};
|
|
@@ -6888,7 +6890,7 @@ function createTableStructHandlers(input) {
|
|
|
6888
6890
|
return;
|
|
6889
6891
|
}
|
|
6890
6892
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6891
|
-
const next =
|
|
6893
|
+
const next = chunk3FVOKV4E_js.removeTableElementRow(selectedElement, rowIdx);
|
|
6892
6894
|
if (next === selectedElement) {
|
|
6893
6895
|
return;
|
|
6894
6896
|
}
|
|
@@ -6900,7 +6902,7 @@ function createTableStructHandlers(input) {
|
|
|
6900
6902
|
return;
|
|
6901
6903
|
}
|
|
6902
6904
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6903
|
-
const next =
|
|
6905
|
+
const next = chunk3FVOKV4E_js.insertTableElementColumn(selectedElement, colIdx, position);
|
|
6904
6906
|
ops.updateSelectedElement({ tableData: next.tableData, rawXml: next.rawXml });
|
|
6905
6907
|
history.markDirty();
|
|
6906
6908
|
};
|
|
@@ -6909,7 +6911,7 @@ function createTableStructHandlers(input) {
|
|
|
6909
6911
|
return;
|
|
6910
6912
|
}
|
|
6911
6913
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6912
|
-
const next =
|
|
6914
|
+
const next = chunk3FVOKV4E_js.removeTableElementColumn(selectedElement, colIdx);
|
|
6913
6915
|
if (next === selectedElement) {
|
|
6914
6916
|
return;
|
|
6915
6917
|
}
|
|
@@ -6945,8 +6947,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6945
6947
|
return html2canvasPro(element, {
|
|
6946
6948
|
...options,
|
|
6947
6949
|
onclone: async (doc, clonedEl) => {
|
|
6948
|
-
await
|
|
6949
|
-
|
|
6950
|
+
await chunk3FVOKV4E_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6951
|
+
chunk3FVOKV4E_js.preprocessCssForCapture(clonedEl);
|
|
6950
6952
|
if (typeof userOnClone === "function") {
|
|
6951
6953
|
userOnClone(doc, clonedEl);
|
|
6952
6954
|
}
|
|
@@ -6976,7 +6978,7 @@ function useExportSaveAs(input) {
|
|
|
6976
6978
|
slideSizeEmu
|
|
6977
6979
|
} = input;
|
|
6978
6980
|
const handleSaveAsFormat = async (format) => {
|
|
6979
|
-
const downloadName =
|
|
6981
|
+
const downloadName = chunk3FVOKV4E_js.savedPresentationFileName(filePath, format);
|
|
6980
6982
|
try {
|
|
6981
6983
|
const data = await serializeSlides(format);
|
|
6982
6984
|
if (!data) {
|
|
@@ -6984,16 +6986,16 @@ function useExportSaveAs(input) {
|
|
|
6984
6986
|
}
|
|
6985
6987
|
const mimeType = format === "ppt" ? "application/vnd.ms-powerpoint" : "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
6986
6988
|
const blob = new Blob([data], { type: mimeType });
|
|
6987
|
-
|
|
6989
|
+
chunk3FVOKV4E_js.downloadBlob(blob, downloadName);
|
|
6988
6990
|
} catch (err) {
|
|
6989
6991
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
6990
6992
|
}
|
|
6991
6993
|
};
|
|
6992
6994
|
const handleExportJson = () => {
|
|
6993
6995
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
6994
|
-
const slideSize =
|
|
6996
|
+
const slideSize = chunk3FVOKV4E_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
6995
6997
|
const data = {
|
|
6996
|
-
slides:
|
|
6998
|
+
slides: chunk3FVOKV4E_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
6997
6999
|
width: canvasSize.width,
|
|
6998
7000
|
height: canvasSize.height,
|
|
6999
7001
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7012,7 +7014,7 @@ function useExportSaveAs(input) {
|
|
|
7012
7014
|
handoutMaster
|
|
7013
7015
|
};
|
|
7014
7016
|
try {
|
|
7015
|
-
|
|
7017
|
+
chunk3FVOKV4E_js.exportDeckJson(data, sourceName);
|
|
7016
7018
|
} catch (err) {
|
|
7017
7019
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7018
7020
|
}
|
|
@@ -7077,7 +7079,7 @@ function buildRasterOptions(element, scale, backgroundColor, mode) {
|
|
|
7077
7079
|
}
|
|
7078
7080
|
async function renderElementToRaster(element, scale = 2, backgroundColor, mode = "auto") {
|
|
7079
7081
|
const { width, height } = measureNaturalSize(element);
|
|
7080
|
-
return
|
|
7082
|
+
return chunk3FVOKV4E_js.rasterizeElement(
|
|
7081
7083
|
element,
|
|
7082
7084
|
width,
|
|
7083
7085
|
height,
|
|
@@ -7087,7 +7089,7 @@ async function renderElementToRaster(element, scale = 2, backgroundColor, mode =
|
|
|
7087
7089
|
}
|
|
7088
7090
|
async function renderElementToTiles(element, scale = 2, backgroundColor, mode = "auto") {
|
|
7089
7091
|
const { width, height } = measureNaturalSize(element);
|
|
7090
|
-
return
|
|
7092
|
+
return chunk3FVOKV4E_js.rasterizeElementTiles(
|
|
7091
7093
|
element,
|
|
7092
7094
|
width,
|
|
7093
7095
|
height,
|
|
@@ -7097,7 +7099,7 @@ async function renderElementToTiles(element, scale = 2, backgroundColor, mode =
|
|
|
7097
7099
|
}
|
|
7098
7100
|
async function renderElementToTiledCanvas(element, scale = 2, backgroundColor, mode = "auto") {
|
|
7099
7101
|
const { width, height } = measureNaturalSize(element);
|
|
7100
|
-
return
|
|
7102
|
+
return chunk3FVOKV4E_js.rasterizeElementTiledToCanvas(
|
|
7101
7103
|
element,
|
|
7102
7104
|
width,
|
|
7103
7105
|
height,
|
|
@@ -7119,11 +7121,11 @@ function waitForRender(ms = 100) {
|
|
|
7119
7121
|
async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
7120
7122
|
const { scale = 2, backgroundColor } = options;
|
|
7121
7123
|
const result = await renderElementToRaster(slideElement, scale, backgroundColor);
|
|
7122
|
-
return
|
|
7124
|
+
return chunk3FVOKV4E_js.rasterResultToPngBlob(result);
|
|
7123
7125
|
}
|
|
7124
7126
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
7125
7127
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
7126
|
-
|
|
7128
|
+
chunk3FVOKV4E_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
7127
7129
|
}
|
|
7128
7130
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
7129
7131
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -7152,13 +7154,13 @@ async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActi
|
|
|
7152
7154
|
// src/viewer/utils/export-pdf.ts
|
|
7153
7155
|
function tilesToPdfPage(tilesResult) {
|
|
7154
7156
|
return tilesResult.tiles.map((tile) => ({
|
|
7155
|
-
image:
|
|
7156
|
-
placement:
|
|
7157
|
+
image: chunk3FVOKV4E_js.canvasToJpegData(tile.canvas),
|
|
7158
|
+
placement: chunk3FVOKV4E_js.placeTileOnPage(
|
|
7157
7159
|
tile,
|
|
7158
7160
|
tilesResult.fullWidth,
|
|
7159
7161
|
tilesResult.fullHeight,
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
+
chunk3FVOKV4E_js.PDF_SLIDES_PAGE_WIDTH_PT,
|
|
7163
|
+
chunk3FVOKV4E_js.PDF_SLIDES_PAGE_HEIGHT_PT
|
|
7162
7164
|
)
|
|
7163
7165
|
}));
|
|
7164
7166
|
}
|
|
@@ -7185,8 +7187,8 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7185
7187
|
if (pages.length === 0) {
|
|
7186
7188
|
throw new Error(chunk3AJ54EAB_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7187
7189
|
}
|
|
7188
|
-
const pdfBlobUrl =
|
|
7189
|
-
|
|
7190
|
+
const pdfBlobUrl = chunk4NSDMKFE_js.buildPdfFromTiledImageData(pages);
|
|
7191
|
+
chunk3FVOKV4E_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
7190
7192
|
}
|
|
7191
7193
|
async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, slideNotes, filename = "presentation-notes.pdf", options = {}) {
|
|
7192
7194
|
const { scale = 2, onProgress, signal } = options;
|
|
@@ -7215,8 +7217,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7215
7217
|
if (pages.length === 0) {
|
|
7216
7218
|
throw new Error(chunk3AJ54EAB_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7217
7219
|
}
|
|
7218
|
-
const pdfDataUrl =
|
|
7219
|
-
|
|
7220
|
+
const pdfDataUrl = chunk4NSDMKFE_js.buildNotesPdf(pages);
|
|
7221
|
+
chunk3FVOKV4E_js.downloadDataUrl(pdfDataUrl, filename);
|
|
7220
7222
|
}
|
|
7221
7223
|
|
|
7222
7224
|
// src/viewer/utils/export-video.ts
|
|
@@ -7260,7 +7262,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7260
7262
|
const fps = 30;
|
|
7261
7263
|
const stream = recordingCanvas.captureStream(fps);
|
|
7262
7264
|
const recorder = new MediaRecorder(stream, {
|
|
7263
|
-
mimeType:
|
|
7265
|
+
mimeType: chunk3FVOKV4E_js.pickSupportedMimeType([...chunk3FVOKV4E_js.WEBM_MIME_CANDIDATES]),
|
|
7264
7266
|
videoBitsPerSecond: 5e6
|
|
7265
7267
|
});
|
|
7266
7268
|
const chunks = [];
|
|
@@ -7283,8 +7285,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7283
7285
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
7284
7286
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
7285
7287
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
7286
|
-
const frameInterval =
|
|
7287
|
-
const framesNeeded =
|
|
7288
|
+
const frameInterval = chunk3FVOKV4E_js.fpsToFrameIntervalMs(fps);
|
|
7289
|
+
const framesNeeded = chunk3FVOKV4E_js.segmentFrameCount(duration, fps);
|
|
7288
7290
|
for (let f = 0; f < framesNeeded; f++) {
|
|
7289
7291
|
if (signal?.aborted) {
|
|
7290
7292
|
recorder.stop();
|
|
@@ -7304,7 +7306,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7304
7306
|
|
|
7305
7307
|
// src/viewer/utils/export-gif.ts
|
|
7306
7308
|
function frameFromCanvas(canvas, maxSide) {
|
|
7307
|
-
const { width, height } =
|
|
7309
|
+
const { width, height } = chunk3FVOKV4E_js.clampGifDimensions(canvas.width, canvas.height, maxSide);
|
|
7308
7310
|
let source = canvas;
|
|
7309
7311
|
if (width !== canvas.width || height !== canvas.height) {
|
|
7310
7312
|
const scaled = canvas.ownerDocument.createElement("canvas");
|
|
@@ -7327,7 +7329,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7327
7329
|
const {
|
|
7328
7330
|
scale = 0.5,
|
|
7329
7331
|
slideDurationMs = 2e3,
|
|
7330
|
-
maxSide =
|
|
7332
|
+
maxSide = chunk3FVOKV4E_js.GIF_POST_CAPTURE_MAX_SIDE,
|
|
7331
7333
|
onProgress,
|
|
7332
7334
|
signal
|
|
7333
7335
|
} = options;
|
|
@@ -7354,7 +7356,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7354
7356
|
if (frames.length === 0) {
|
|
7355
7357
|
throw new Error(chunk3AJ54EAB_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
7356
7358
|
}
|
|
7357
|
-
const gifBytes =
|
|
7359
|
+
const gifBytes = chunk3FVOKV4E_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
7358
7360
|
onProgress?.(totalSlides, totalSlides);
|
|
7359
7361
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
7360
7362
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -7408,7 +7410,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7408
7410
|
continue;
|
|
7409
7411
|
}
|
|
7410
7412
|
onProgress?.(processedCount, data.slides.length);
|
|
7411
|
-
let svg =
|
|
7413
|
+
let svg = chunk3FVOKV4E_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7412
7414
|
if (embedFonts && fontFaces?.length) {
|
|
7413
7415
|
svg = injectFontFaces(svg, fontFaces);
|
|
7414
7416
|
}
|
|
@@ -7460,7 +7462,7 @@ function useExportMediaHandlers(input) {
|
|
|
7460
7462
|
setExportProgress(0);
|
|
7461
7463
|
setExportModalOpen(true);
|
|
7462
7464
|
try {
|
|
7463
|
-
const { scale } =
|
|
7465
|
+
const { scale } = chunk3FVOKV4E_js.resolveExportCaptureDecision(imageResolutionScale, "video");
|
|
7464
7466
|
const blob = await exportAllSlidesAsVideo(
|
|
7465
7467
|
canvasStageRef,
|
|
7466
7468
|
slides.length,
|
|
@@ -7470,22 +7472,22 @@ function useExportMediaHandlers(input) {
|
|
|
7470
7472
|
scale,
|
|
7471
7473
|
slideDurationMs: 3e3,
|
|
7472
7474
|
onProgress: (current, total) => {
|
|
7473
|
-
setExportProgress(
|
|
7474
|
-
setExportStatusMessage(
|
|
7475
|
+
setExportProgress(chunk3FVOKV4E_js.slideProgressPercent(current, total, 45));
|
|
7476
|
+
setExportStatusMessage(chunk3FVOKV4E_js.slideStatusLabel("Capturing", current, total));
|
|
7475
7477
|
},
|
|
7476
7478
|
onRecordProgress: (current, total) => {
|
|
7477
|
-
setExportProgress(
|
|
7478
|
-
setExportStatusMessage(
|
|
7479
|
+
setExportProgress(chunk3FVOKV4E_js.recordProgressPercent(current, total));
|
|
7480
|
+
setExportStatusMessage(chunk3FVOKV4E_js.slideStatusLabel("Recording", current, total));
|
|
7479
7481
|
},
|
|
7480
7482
|
signal: abortCtrl.signal
|
|
7481
7483
|
}
|
|
7482
7484
|
);
|
|
7483
|
-
setExportProgress(
|
|
7485
|
+
setExportProgress(chunk3FVOKV4E_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7484
7486
|
setExportStatusMessage("Saving file...");
|
|
7485
|
-
|
|
7486
|
-
setExportProgress(
|
|
7487
|
+
chunk3FVOKV4E_js.downloadBlob(blob, "presentation.webm");
|
|
7488
|
+
setExportProgress(chunk3FVOKV4E_js.EXPORT_DONE_PERCENT);
|
|
7487
7489
|
} catch (err) {
|
|
7488
|
-
if (!
|
|
7490
|
+
if (!chunk3FVOKV4E_js.isExportAbortError(err)) {
|
|
7489
7491
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7490
7492
|
}
|
|
7491
7493
|
} finally {
|
|
@@ -7515,7 +7517,7 @@ function useExportMediaHandlers(input) {
|
|
|
7515
7517
|
setExportProgress(0);
|
|
7516
7518
|
setExportModalOpen(true);
|
|
7517
7519
|
try {
|
|
7518
|
-
const { scale, postCaptureMaxSide } =
|
|
7520
|
+
const { scale, postCaptureMaxSide } = chunk3FVOKV4E_js.resolveExportCaptureDecision(
|
|
7519
7521
|
imageResolutionScale,
|
|
7520
7522
|
"gif"
|
|
7521
7523
|
);
|
|
@@ -7529,18 +7531,18 @@ function useExportMediaHandlers(input) {
|
|
|
7529
7531
|
maxSide: postCaptureMaxSide,
|
|
7530
7532
|
slideDurationMs: 2e3,
|
|
7531
7533
|
onProgress: (current, total) => {
|
|
7532
|
-
setExportProgress(
|
|
7533
|
-
setExportStatusMessage(
|
|
7534
|
+
setExportProgress(chunk3FVOKV4E_js.slideProgressPercent(current, total));
|
|
7535
|
+
setExportStatusMessage(chunk3FVOKV4E_js.slideStatusLabel("Encoding", current, total));
|
|
7534
7536
|
},
|
|
7535
7537
|
signal: abortCtrl.signal
|
|
7536
7538
|
}
|
|
7537
7539
|
);
|
|
7538
|
-
setExportProgress(
|
|
7540
|
+
setExportProgress(chunk3FVOKV4E_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7539
7541
|
setExportStatusMessage("Saving file...");
|
|
7540
|
-
|
|
7541
|
-
setExportProgress(
|
|
7542
|
+
chunk3FVOKV4E_js.downloadBlob(blob, "presentation.gif");
|
|
7543
|
+
setExportProgress(chunk3FVOKV4E_js.EXPORT_DONE_PERCENT);
|
|
7542
7544
|
} catch (err) {
|
|
7543
|
-
if (!
|
|
7545
|
+
if (!chunk3FVOKV4E_js.isExportAbortError(err)) {
|
|
7544
7546
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7545
7547
|
}
|
|
7546
7548
|
} finally {
|
|
@@ -7666,21 +7668,21 @@ function useExportHandlers(input) {
|
|
|
7666
7668
|
{
|
|
7667
7669
|
scale: imageExportScale,
|
|
7668
7670
|
onProgress: (current, total) => {
|
|
7669
|
-
setExportProgress(
|
|
7670
|
-
setExportStatusMessage(
|
|
7671
|
+
setExportProgress(chunk3FVOKV4E_js.slideProgressPercent(current, total));
|
|
7672
|
+
setExportStatusMessage(chunk3FVOKV4E_js.slideStatusLabel("Rendering", current, total));
|
|
7671
7673
|
},
|
|
7672
7674
|
signal: abortCtrl.signal
|
|
7673
7675
|
}
|
|
7674
7676
|
);
|
|
7675
|
-
setExportProgress(
|
|
7677
|
+
setExportProgress(chunk3FVOKV4E_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7676
7678
|
setExportStatusMessage("Building PDF...");
|
|
7677
7679
|
await new Promise((r) => {
|
|
7678
7680
|
setTimeout(r, 100);
|
|
7679
7681
|
});
|
|
7680
|
-
setExportProgress(
|
|
7682
|
+
setExportProgress(chunk3FVOKV4E_js.EXPORT_DONE_PERCENT);
|
|
7681
7683
|
setExportStatusMessage("Done!");
|
|
7682
7684
|
} catch (err) {
|
|
7683
|
-
if (!
|
|
7685
|
+
if (!chunk3FVOKV4E_js.isExportAbortError(err)) {
|
|
7684
7686
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7685
7687
|
}
|
|
7686
7688
|
} finally {
|
|
@@ -7710,21 +7712,21 @@ function useExportHandlers(input) {
|
|
|
7710
7712
|
{
|
|
7711
7713
|
scale: imageExportScale,
|
|
7712
7714
|
onProgress: (current, total) => {
|
|
7713
|
-
setExportProgress(
|
|
7714
|
-
setExportStatusMessage(
|
|
7715
|
+
setExportProgress(chunk3FVOKV4E_js.slideProgressPercent(current, total));
|
|
7716
|
+
setExportStatusMessage(chunk3FVOKV4E_js.slideStatusLabel("Rendering", current, total));
|
|
7715
7717
|
},
|
|
7716
7718
|
signal: abortCtrl.signal
|
|
7717
7719
|
}
|
|
7718
7720
|
);
|
|
7719
|
-
setExportProgress(
|
|
7721
|
+
setExportProgress(chunk3FVOKV4E_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7720
7722
|
setExportStatusMessage("Building PDF...");
|
|
7721
7723
|
await new Promise((r) => {
|
|
7722
7724
|
setTimeout(r, 100);
|
|
7723
7725
|
});
|
|
7724
|
-
setExportProgress(
|
|
7726
|
+
setExportProgress(chunk3FVOKV4E_js.EXPORT_DONE_PERCENT);
|
|
7725
7727
|
setExportStatusMessage("Done!");
|
|
7726
7728
|
} catch (err) {
|
|
7727
|
-
if (!
|
|
7729
|
+
if (!chunk3FVOKV4E_js.isExportAbortError(err)) {
|
|
7728
7730
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7729
7731
|
}
|
|
7730
7732
|
} finally {
|
|
@@ -7772,7 +7774,7 @@ function useExportHandlers(input) {
|
|
|
7772
7774
|
exportStatusMessage
|
|
7773
7775
|
};
|
|
7774
7776
|
}
|
|
7775
|
-
var ViewerOptionsContext = react.createContext(
|
|
7777
|
+
var ViewerOptionsContext = react.createContext(chunk3FVOKV4E_js.DEFAULT_VIEWER_OPTIONS);
|
|
7776
7778
|
function useViewerOptionsContext() {
|
|
7777
7779
|
return react.useContext(ViewerOptionsContext);
|
|
7778
7780
|
}
|
|
@@ -7784,13 +7786,13 @@ function usePrintHandlers(input) {
|
|
|
7784
7786
|
const { t } = reactI18next.useTranslation();
|
|
7785
7787
|
const viewerOptions = useViewerOptionsContext();
|
|
7786
7788
|
const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
|
|
7787
|
-
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) *
|
|
7789
|
+
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunk3FVOKV4E_js.resolveImageResolutionScale(viewerOptions);
|
|
7788
7790
|
const handlePrint = () => {
|
|
7789
7791
|
setIsPrintDialogOpen(true);
|
|
7790
7792
|
};
|
|
7791
7793
|
const handlePrintSvg = async (settings) => {
|
|
7792
7794
|
setIsPrintDialogOpen(false);
|
|
7793
|
-
const printWindow =
|
|
7795
|
+
const printWindow = chunk3FVOKV4E_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7794
7796
|
if (!printWindow) {
|
|
7795
7797
|
console.warn(
|
|
7796
7798
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7800,9 +7802,9 @@ function usePrintHandlers(input) {
|
|
|
7800
7802
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7801
7803
|
return runRasterPrint(printWindow, settings);
|
|
7802
7804
|
}
|
|
7803
|
-
const colorFilter =
|
|
7804
|
-
const slideIndices =
|
|
7805
|
-
|
|
7805
|
+
const colorFilter = chunk3FVOKV4E_js.computeColorFilter(settings.colorMode);
|
|
7806
|
+
const slideIndices = chunk3FVOKV4E_js.filterHiddenSlideIndices(
|
|
7807
|
+
chunk3FVOKV4E_js.computeSlideIndices(
|
|
7806
7808
|
settings.slideRange,
|
|
7807
7809
|
activeSlideIndex,
|
|
7808
7810
|
slides.length,
|
|
@@ -7820,22 +7822,22 @@ function usePrintHandlers(input) {
|
|
|
7820
7822
|
printWindow.close();
|
|
7821
7823
|
return;
|
|
7822
7824
|
}
|
|
7823
|
-
const printDoc =
|
|
7825
|
+
const printDoc = chunk3FVOKV4E_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7824
7826
|
title: "Slides (Vector)",
|
|
7825
7827
|
orientation: settings.orientation,
|
|
7826
7828
|
colorFilter,
|
|
7827
7829
|
scaleToFit: settings.scaleToFit
|
|
7828
7830
|
});
|
|
7829
|
-
|
|
7831
|
+
chunk3FVOKV4E_js.finishPrintWindow(printWindow, printDoc);
|
|
7830
7832
|
} catch (err) {
|
|
7831
7833
|
console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
|
|
7832
7834
|
return runRasterPrint(printWindow, settings);
|
|
7833
7835
|
}
|
|
7834
7836
|
};
|
|
7835
7837
|
const runRasterPrint = async (printWindow, settings) => {
|
|
7836
|
-
const colorFilter =
|
|
7837
|
-
const slideIndices =
|
|
7838
|
-
|
|
7838
|
+
const colorFilter = chunk3FVOKV4E_js.computeColorFilter(settings.colorMode);
|
|
7839
|
+
const slideIndices = chunk3FVOKV4E_js.filterHiddenSlideIndices(
|
|
7840
|
+
chunk3FVOKV4E_js.computeSlideIndices(
|
|
7839
7841
|
settings.slideRange,
|
|
7840
7842
|
activeSlideIndex,
|
|
7841
7843
|
slides.length,
|
|
@@ -7846,11 +7848,11 @@ function usePrintHandlers(input) {
|
|
|
7846
7848
|
includeHiddenSlides
|
|
7847
7849
|
);
|
|
7848
7850
|
if (settings.printWhat === "outline") {
|
|
7849
|
-
|
|
7851
|
+
chunk3FVOKV4E_js.finishPrintWindow(
|
|
7850
7852
|
printWindow,
|
|
7851
|
-
|
|
7853
|
+
chunk3FVOKV4E_js.buildPrintHtmlDocument({
|
|
7852
7854
|
title: "Outline",
|
|
7853
|
-
bodyHtml: `<div class="outline-page">${
|
|
7855
|
+
bodyHtml: `<div class="outline-page">${chunk3FVOKV4E_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7854
7856
|
orientation: settings.orientation,
|
|
7855
7857
|
colorFilter,
|
|
7856
7858
|
frameSlides: settings.frameSlides,
|
|
@@ -7877,11 +7879,11 @@ function usePrintHandlers(input) {
|
|
|
7877
7879
|
}
|
|
7878
7880
|
const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
|
|
7879
7881
|
if (settings.printWhat === "slides") {
|
|
7880
|
-
|
|
7882
|
+
chunk3FVOKV4E_js.finishPrintWindow(
|
|
7881
7883
|
printWindow,
|
|
7882
|
-
|
|
7884
|
+
chunk3FVOKV4E_js.buildPrintHtmlDocument({
|
|
7883
7885
|
title: "Slides",
|
|
7884
|
-
bodyHtml:
|
|
7886
|
+
bodyHtml: chunk3FVOKV4E_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7885
7887
|
orientation: settings.orientation,
|
|
7886
7888
|
colorFilter,
|
|
7887
7889
|
frameSlides: settings.frameSlides,
|
|
@@ -7891,11 +7893,11 @@ function usePrintHandlers(input) {
|
|
|
7891
7893
|
return;
|
|
7892
7894
|
}
|
|
7893
7895
|
if (settings.printWhat === "notes") {
|
|
7894
|
-
|
|
7896
|
+
chunk3FVOKV4E_js.finishPrintWindow(
|
|
7895
7897
|
printWindow,
|
|
7896
|
-
|
|
7898
|
+
chunk3FVOKV4E_js.buildPrintHtmlDocument({
|
|
7897
7899
|
title: "Notes Pages",
|
|
7898
|
-
bodyHtml:
|
|
7900
|
+
bodyHtml: chunk3FVOKV4E_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7899
7901
|
orientation: "portrait",
|
|
7900
7902
|
colorFilter,
|
|
7901
7903
|
frameSlides: settings.frameSlides,
|
|
@@ -7906,11 +7908,11 @@ function usePrintHandlers(input) {
|
|
|
7906
7908
|
}
|
|
7907
7909
|
if (settings.printWhat === "handouts") {
|
|
7908
7910
|
const spp = settings.slidesPerPage;
|
|
7909
|
-
|
|
7911
|
+
chunk3FVOKV4E_js.finishPrintWindow(
|
|
7910
7912
|
printWindow,
|
|
7911
|
-
|
|
7913
|
+
chunk3FVOKV4E_js.buildPrintHtmlDocument({
|
|
7912
7914
|
title: `Handout ${spp} per page`,
|
|
7913
|
-
bodyHtml:
|
|
7915
|
+
bodyHtml: chunk3FVOKV4E_js.buildHandoutsHtml(slideImages, slideIndices, spp, pptxData?.handoutMaster),
|
|
7914
7916
|
orientation: "portrait",
|
|
7915
7917
|
colorFilter,
|
|
7916
7918
|
frameSlides: settings.frameSlides,
|
|
@@ -7924,7 +7926,7 @@ function usePrintHandlers(input) {
|
|
|
7924
7926
|
};
|
|
7925
7927
|
const handlePrintWithSettings = async (settings) => {
|
|
7926
7928
|
setIsPrintDialogOpen(false);
|
|
7927
|
-
const printWindow =
|
|
7929
|
+
const printWindow = chunk3FVOKV4E_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7928
7930
|
if (!printWindow) {
|
|
7929
7931
|
console.warn(
|
|
7930
7932
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7989,13 +7991,13 @@ function useThemeHandlers(input) {
|
|
|
7989
7991
|
return;
|
|
7990
7992
|
}
|
|
7991
7993
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7992
|
-
const previousMap = theme?.colorScheme ?
|
|
7993
|
-
setSlides((prev) =>
|
|
7994
|
+
const previousMap = theme?.colorScheme ? chunk3FVOKV4E_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7995
|
+
setSlides((prev) => chunk3FVOKV4E_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7994
7996
|
if (Object.keys(templateElementsBySlideId).length > 0) {
|
|
7995
7997
|
setTemplateElementsBySlideId((prev) => {
|
|
7996
7998
|
const next = {};
|
|
7997
7999
|
for (const [slideId, elements] of Object.entries(prev)) {
|
|
7998
|
-
next[slideId] =
|
|
8000
|
+
next[slideId] = chunk3FVOKV4E_js.reResolveElementColors(elements, previousMap, colorScheme);
|
|
7999
8001
|
}
|
|
8000
8002
|
return next;
|
|
8001
8003
|
});
|
|
@@ -8104,7 +8106,7 @@ function useThemeSwitching(input) {
|
|
|
8104
8106
|
}
|
|
8105
8107
|
try {
|
|
8106
8108
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
8107
|
-
const newData =
|
|
8109
|
+
const newData = chunk3FVOKV4E_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
8108
8110
|
onDataChange(newData);
|
|
8109
8111
|
onThemeChanged?.(preset);
|
|
8110
8112
|
} catch (error) {
|
|
@@ -8121,7 +8123,7 @@ function useThemeSwitching(input) {
|
|
|
8121
8123
|
}
|
|
8122
8124
|
try {
|
|
8123
8125
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
8124
|
-
const newData =
|
|
8126
|
+
const newData = chunk3FVOKV4E_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
8125
8127
|
onDataChange(newData);
|
|
8126
8128
|
} catch (error) {
|
|
8127
8129
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -8133,12 +8135,12 @@ function useThemeSwitching(input) {
|
|
|
8133
8135
|
if (!data?.theme?.colorScheme) {
|
|
8134
8136
|
return void 0;
|
|
8135
8137
|
}
|
|
8136
|
-
return
|
|
8137
|
-
(p) =>
|
|
8138
|
+
return chunk3FVOKV4E_js.THEME_PRESETS.find(
|
|
8139
|
+
(p) => chunk3FVOKV4E_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
8138
8140
|
);
|
|
8139
8141
|
}, [data?.theme?.colorScheme]);
|
|
8140
8142
|
return {
|
|
8141
|
-
presets:
|
|
8143
|
+
presets: chunk3FVOKV4E_js.THEME_PRESETS,
|
|
8142
8144
|
switchToPreset,
|
|
8143
8145
|
switchToCustom,
|
|
8144
8146
|
currentPreset
|
|
@@ -8213,7 +8215,7 @@ function usePropertyHandlers(input) {
|
|
|
8213
8215
|
}
|
|
8214
8216
|
try {
|
|
8215
8217
|
const ab = await file.arrayBuffer();
|
|
8216
|
-
const h = new
|
|
8218
|
+
const h = new chunk3FVOKV4E_js.PptxHandler();
|
|
8217
8219
|
const other = await h.load(ab);
|
|
8218
8220
|
if (!other) {
|
|
8219
8221
|
return;
|
|
@@ -8223,7 +8225,7 @@ function usePropertyHandlers(input) {
|
|
|
8223
8225
|
width: canvasSize.width,
|
|
8224
8226
|
height: canvasSize.height
|
|
8225
8227
|
};
|
|
8226
|
-
setCompareResult(
|
|
8228
|
+
setCompareResult(chunk3FVOKV4E_js.comparePresentation(cur, other));
|
|
8227
8229
|
setIsComparePanelOpen(true);
|
|
8228
8230
|
} catch (err) {
|
|
8229
8231
|
console.warn("Compare failed:", err);
|
|
@@ -8240,7 +8242,7 @@ function usePropertyHandlers(input) {
|
|
|
8240
8242
|
if (!diff || diff.status === "unchanged") {
|
|
8241
8243
|
return;
|
|
8242
8244
|
}
|
|
8243
|
-
setSlides((prev) =>
|
|
8245
|
+
setSlides((prev) => chunk3FVOKV4E_js.applyAcceptSlide(prev, diff));
|
|
8244
8246
|
setIsDirty(true);
|
|
8245
8247
|
},
|
|
8246
8248
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -8251,10 +8253,10 @@ function usePropertyHandlers(input) {
|
|
|
8251
8253
|
if (!compareResult) {
|
|
8252
8254
|
return;
|
|
8253
8255
|
}
|
|
8254
|
-
setSlides((prev) =>
|
|
8256
|
+
setSlides((prev) => chunk3FVOKV4E_js.applyAcceptAllSlides(prev, compareResult));
|
|
8255
8257
|
setIsDirty(true);
|
|
8256
8258
|
}, [compareResult, setSlides, setIsDirty]);
|
|
8257
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
8259
|
+
const usedFontFamilies = react.useMemo(() => chunk3FVOKV4E_js.collectUsedFonts(slides), [slides]);
|
|
8258
8260
|
return {
|
|
8259
8261
|
handleUpdateNotes,
|
|
8260
8262
|
handleUpdateSlide,
|
|
@@ -8409,7 +8411,7 @@ function useViewerDialogs(input) {
|
|
|
8409
8411
|
);
|
|
8410
8412
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8411
8413
|
const fontEmbedding = react.useMemo(
|
|
8412
|
-
() =>
|
|
8414
|
+
() => chunk3FVOKV4E_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8413
8415
|
[embeddedFontKey]
|
|
8414
8416
|
);
|
|
8415
8417
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8419,11 +8421,11 @@ function useViewerDialogs(input) {
|
|
|
8419
8421
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8420
8422
|
}
|
|
8421
8423
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8422
|
-
() => typeof window !== "undefined" ?
|
|
8424
|
+
() => typeof window !== "undefined" ? chunk3FVOKV4E_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8423
8425
|
);
|
|
8424
8426
|
react.useEffect(() => {
|
|
8425
8427
|
const handleWindow = () => setIsNarrowViewport(
|
|
8426
|
-
|
|
8428
|
+
chunk3FVOKV4E_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8427
8429
|
);
|
|
8428
8430
|
window.addEventListener("resize", handleWindow);
|
|
8429
8431
|
return () => window.removeEventListener("resize", handleWindow);
|
|
@@ -8576,16 +8578,16 @@ function useViewerDialogs(input) {
|
|
|
8576
8578
|
};
|
|
8577
8579
|
}
|
|
8578
8580
|
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8579
|
-
return
|
|
8581
|
+
return chunk3FVOKV4E_js.computeGridSpacingPx(documentGridSpacing, chunk4NSDMKFE_js.GRID_SIZE);
|
|
8580
8582
|
}
|
|
8581
8583
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
8582
8584
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8583
|
-
const authoredRange =
|
|
8584
|
-
return
|
|
8585
|
+
const authoredRange = chunk3FVOKV4E_js.resolveAuthoredSlideRange(presentationProperties, slides.length);
|
|
8586
|
+
return chunk3FVOKV4E_js.resolveShowSlideIndexes(slides, activeShow, authoredRange);
|
|
8585
8587
|
}
|
|
8586
8588
|
function computeSlideSectionGroups(slides, sections) {
|
|
8587
|
-
return
|
|
8588
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8589
|
+
return chunk3FVOKV4E_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8590
|
+
id: group.section?.id ?? (sections.length > 0 ? chunk4NSDMKFE_js.UNGROUPED_SECTION_ID : chunk4NSDMKFE_js.DEFAULT_SECTION_GROUP_ID),
|
|
8589
8591
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8590
8592
|
slideIndexes: group.slideIndexes,
|
|
8591
8593
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8597,7 +8599,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8597
8599
|
return void 0;
|
|
8598
8600
|
}
|
|
8599
8601
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8600
|
-
return
|
|
8602
|
+
return chunk3FVOKV4E_js.masterViewPseudoSlide(document2, {
|
|
8601
8603
|
tab: "slides",
|
|
8602
8604
|
masterIndex: 0,
|
|
8603
8605
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8625,15 +8627,15 @@ function useDerivedSlideState(input) {
|
|
|
8625
8627
|
[slides, activeCustomShowId, customShows, presentationProperties]
|
|
8626
8628
|
);
|
|
8627
8629
|
const authoredRange = react.useMemo(
|
|
8628
|
-
() =>
|
|
8630
|
+
() => chunk3FVOKV4E_js.resolveAuthoredSlideRange(presentationProperties, slides.length),
|
|
8629
8631
|
[presentationProperties, slides.length]
|
|
8630
8632
|
);
|
|
8631
8633
|
const slideSectionGroups = react.useMemo(
|
|
8632
8634
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8633
|
-
if (group.id ===
|
|
8635
|
+
if (group.id === chunk4NSDMKFE_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8634
8636
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8635
8637
|
}
|
|
8636
|
-
if (group.id ===
|
|
8638
|
+
if (group.id === chunk4NSDMKFE_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8637
8639
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8638
8640
|
}
|
|
8639
8641
|
return group;
|
|
@@ -8734,13 +8736,13 @@ function useAnnotationHandlers(input) {
|
|
|
8734
8736
|
}, [annotations, setMode, setSlides, history]);
|
|
8735
8737
|
const handleSetMode = react.useCallback(
|
|
8736
8738
|
(nextMode) => {
|
|
8737
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8739
|
+
if (mode === "present" && nextMode !== "present" && !chunk3FVOKV4E_js.mayLeaveSlideShow()) {
|
|
8738
8740
|
return;
|
|
8739
8741
|
}
|
|
8740
8742
|
if (nextMode === "present") {
|
|
8741
8743
|
presentation.enterPresentMode();
|
|
8742
8744
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8743
|
-
|
|
8745
|
+
chunk3FVOKV4E_js.stopAllPersistentAudio();
|
|
8744
8746
|
if (promptKeepInkAnnotations) {
|
|
8745
8747
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8746
8748
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8750,7 +8752,7 @@ function useAnnotationHandlers(input) {
|
|
|
8750
8752
|
}
|
|
8751
8753
|
} else {
|
|
8752
8754
|
if (mode === "present") {
|
|
8753
|
-
|
|
8755
|
+
chunk3FVOKV4E_js.stopAllPersistentAudio();
|
|
8754
8756
|
}
|
|
8755
8757
|
setMode(nextMode);
|
|
8756
8758
|
}
|
|
@@ -8819,13 +8821,13 @@ function useSerialize(input) {
|
|
|
8819
8821
|
let processedSlide = slide;
|
|
8820
8822
|
if (pendingEditId) {
|
|
8821
8823
|
const updatedElements = slide.elements.map((el) => {
|
|
8822
|
-
if (el.id !== pendingEditId || !
|
|
8824
|
+
if (el.id !== pendingEditId || !chunk3FVOKV4E_js.hasTextProperties(el)) {
|
|
8823
8825
|
return el;
|
|
8824
8826
|
}
|
|
8825
8827
|
return {
|
|
8826
8828
|
...el,
|
|
8827
8829
|
text: pendingEditText,
|
|
8828
|
-
textSegments:
|
|
8830
|
+
textSegments: chunk3FVOKV4E_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8829
8831
|
};
|
|
8830
8832
|
});
|
|
8831
8833
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8838,19 +8840,19 @@ function useSerialize(input) {
|
|
|
8838
8840
|
const pptxGuides = guides.map((g) => ({
|
|
8839
8841
|
id: g.id,
|
|
8840
8842
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8841
|
-
positionEmu:
|
|
8843
|
+
positionEmu: chunk3FVOKV4E_js.guidePxToEmu(g.position)
|
|
8842
8844
|
}));
|
|
8843
8845
|
return {
|
|
8844
8846
|
...processedSlide,
|
|
8845
8847
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8846
8848
|
};
|
|
8847
8849
|
});
|
|
8848
|
-
const slidesToSave =
|
|
8849
|
-
const saveOptions =
|
|
8850
|
+
const slidesToSave = chunk3FVOKV4E_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8851
|
+
const saveOptions = chunk3FVOKV4E_js.buildDeckSaveOptions({
|
|
8850
8852
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8851
8853
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8852
8854
|
// slide-size edit reaches the file.
|
|
8853
|
-
slideSize:
|
|
8855
|
+
slideSize: chunk3FVOKV4E_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8854
8856
|
headerFooter,
|
|
8855
8857
|
presentationProperties,
|
|
8856
8858
|
viewProperties,
|
|
@@ -8869,7 +8871,7 @@ function useSerialize(input) {
|
|
|
8869
8871
|
embedFonts,
|
|
8870
8872
|
outputFormat: format
|
|
8871
8873
|
});
|
|
8872
|
-
return
|
|
8874
|
+
return chunk3FVOKV4E_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8873
8875
|
},
|
|
8874
8876
|
[
|
|
8875
8877
|
slides,
|
|
@@ -8910,7 +8912,7 @@ function useRecoveryDetection(input) {
|
|
|
8910
8912
|
const onRestore = input.onRestore;
|
|
8911
8913
|
const openVersionHistory = input.openVersionHistory;
|
|
8912
8914
|
react.useEffect(() => {
|
|
8913
|
-
if (!
|
|
8915
|
+
if (!chunk3FVOKV4E_js.shouldProbeAutosaveRecovery({
|
|
8914
8916
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8915
8917
|
filePath,
|
|
8916
8918
|
loading,
|
|
@@ -8922,7 +8924,7 @@ function useRecoveryDetection(input) {
|
|
|
8922
8924
|
}
|
|
8923
8925
|
recoveryCheckedRef.current = true;
|
|
8924
8926
|
void (async () => {
|
|
8925
|
-
const offer = await
|
|
8927
|
+
const offer = await chunk3FVOKV4E_js.probeAutosaveRecovery(filePath);
|
|
8926
8928
|
if (!offer) {
|
|
8927
8929
|
return;
|
|
8928
8930
|
}
|
|
@@ -8935,7 +8937,7 @@ function useRecoveryDetection(input) {
|
|
|
8935
8937
|
const record = recordRef.current;
|
|
8936
8938
|
setPrompt(null);
|
|
8937
8939
|
if (record && onRestore) {
|
|
8938
|
-
onRestore(
|
|
8940
|
+
onRestore(chunk3FVOKV4E_js.acceptAutosaveRecovery(record));
|
|
8939
8941
|
}
|
|
8940
8942
|
recordRef.current = null;
|
|
8941
8943
|
}, [onRestore]);
|
|
@@ -8944,7 +8946,7 @@ function useRecoveryDetection(input) {
|
|
|
8944
8946
|
setPrompt(null);
|
|
8945
8947
|
recordRef.current = null;
|
|
8946
8948
|
if (record) {
|
|
8947
|
-
void
|
|
8949
|
+
void chunk3FVOKV4E_js.discardAutosaveRecovery(record);
|
|
8948
8950
|
}
|
|
8949
8951
|
}, []);
|
|
8950
8952
|
return { prompt, restore, discard };
|
|
@@ -8995,11 +8997,11 @@ function usePresentationSetup(input) {
|
|
|
8995
8997
|
containerRef,
|
|
8996
8998
|
content,
|
|
8997
8999
|
onSetMode: (nextMode) => {
|
|
8998
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
9000
|
+
if (mode === "present" && nextMode !== "present" && !chunk3FVOKV4E_js.mayLeaveSlideShow()) {
|
|
8999
9001
|
return;
|
|
9000
9002
|
}
|
|
9001
9003
|
if (mode === "present" && nextMode !== "present") {
|
|
9002
|
-
|
|
9004
|
+
chunk3FVOKV4E_js.stopAllPersistentAudio();
|
|
9003
9005
|
stopAnimationSound();
|
|
9004
9006
|
const exitHandler = exitModeHandlerRef.current;
|
|
9005
9007
|
if (exitHandler) {
|
|
@@ -9067,10 +9069,10 @@ function usePresentationSetup(input) {
|
|
|
9067
9069
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
9068
9070
|
onToggleSubtitles,
|
|
9069
9071
|
onSaveRehearsalTimings: (timings) => {
|
|
9070
|
-
setSlides((prev) =>
|
|
9072
|
+
setSlides((prev) => chunk3FVOKV4E_js.applyRehearsalTimings(prev, timings));
|
|
9071
9073
|
history.markDirty();
|
|
9072
9074
|
},
|
|
9073
|
-
loopContinuously:
|
|
9075
|
+
loopContinuously: chunk3FVOKV4E_js.shouldLoopContinuously(presentationProperties),
|
|
9074
9076
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
9075
9077
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
9076
9078
|
endWithBlackSlide,
|
|
@@ -9277,7 +9279,7 @@ function useEditorOperations(input) {
|
|
|
9277
9279
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9278
9280
|
react.useEffect(() => {
|
|
9279
9281
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9280
|
-
copiedFormatRef.current =
|
|
9282
|
+
copiedFormatRef.current = chunk3FVOKV4E_js.copyFormatFromElement(selectedElement);
|
|
9281
9283
|
} else if (!formatPainterActive) {
|
|
9282
9284
|
copiedFormatRef.current = null;
|
|
9283
9285
|
}
|
|
@@ -9303,12 +9305,12 @@ function useEditorOperations(input) {
|
|
|
9303
9305
|
e.stopPropagation();
|
|
9304
9306
|
const element = elementLookup.get(elementId);
|
|
9305
9307
|
if (element) {
|
|
9306
|
-
const updated =
|
|
9308
|
+
const updated = chunk3FVOKV4E_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9307
9309
|
const updates = {};
|
|
9308
|
-
if (
|
|
9310
|
+
if (chunk3FVOKV4E_js.hasShapeProperties(updated)) {
|
|
9309
9311
|
updates.shapeStyle = updated.shapeStyle;
|
|
9310
9312
|
}
|
|
9311
|
-
if (
|
|
9313
|
+
if (chunk3FVOKV4E_js.hasTextProperties(updated)) {
|
|
9312
9314
|
updates.textStyle = updated.textStyle;
|
|
9313
9315
|
}
|
|
9314
9316
|
ops.updateElementById(elementId, updates);
|
|
@@ -9494,10 +9496,10 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9494
9496
|
}
|
|
9495
9497
|
};
|
|
9496
9498
|
}, [embeddedFonts]);
|
|
9497
|
-
const referencedFamilies = react.useMemo(() =>
|
|
9499
|
+
const referencedFamilies = react.useMemo(() => chunk3FVOKV4E_js.collectReferencedFontFamilies(slides), [slides]);
|
|
9498
9500
|
react.useEffect(() => {
|
|
9499
9501
|
let cancelled = false;
|
|
9500
|
-
void
|
|
9502
|
+
void chunk3FVOKV4E_js.resolveGoogleWebfontHref(slides, embeddedFonts).then((href) => {
|
|
9501
9503
|
if (cancelled) {
|
|
9502
9504
|
return null;
|
|
9503
9505
|
}
|
|
@@ -9522,15 +9524,15 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9522
9524
|
const [, setOutlineFontsTick] = react.useState(0);
|
|
9523
9525
|
react.useEffect(() => {
|
|
9524
9526
|
let cancelled = false;
|
|
9525
|
-
const referenced =
|
|
9526
|
-
const candidates =
|
|
9527
|
+
const referenced = chunk3FVOKV4E_js.collectReferencedFontFamilies(slides);
|
|
9528
|
+
const candidates = chunk3FVOKV4E_js.selectGoogleWebfontFamilies(
|
|
9527
9529
|
referenced,
|
|
9528
9530
|
embeddedFonts.map((font) => font.name)
|
|
9529
9531
|
);
|
|
9530
9532
|
if (candidates.length === 0) {
|
|
9531
9533
|
return;
|
|
9532
9534
|
}
|
|
9533
|
-
void
|
|
9535
|
+
void chunk3FVOKV4E_js.resolveGoogleWebfontHref(slides, embeddedFonts).then(async (href) => {
|
|
9534
9536
|
if (cancelled || !href) {
|
|
9535
9537
|
return;
|
|
9536
9538
|
}
|
|
@@ -9544,7 +9546,7 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9544
9546
|
if (cancelled) {
|
|
9545
9547
|
return;
|
|
9546
9548
|
}
|
|
9547
|
-
const bytes = await
|
|
9549
|
+
const bytes = await chunk3FVOKV4E_js.fetchGoogleWebfontOutlineBytes(
|
|
9548
9550
|
href,
|
|
9549
9551
|
family,
|
|
9550
9552
|
variant.bold,
|
|
@@ -9733,7 +9735,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9733
9735
|
inputRef.current = input;
|
|
9734
9736
|
const handleKeyDown = react.useCallback((e) => {
|
|
9735
9737
|
const current = inputRef.current;
|
|
9736
|
-
const startAction =
|
|
9738
|
+
const startAction = chunk3FVOKV4E_js.mapSlideShowStartKey(e, { isPresenting: current.mode === "present" });
|
|
9737
9739
|
if (startAction !== null) {
|
|
9738
9740
|
e.preventDefault();
|
|
9739
9741
|
if (startAction === "fromBeginning") {
|
|
@@ -9743,7 +9745,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9743
9745
|
}
|
|
9744
9746
|
return;
|
|
9745
9747
|
}
|
|
9746
|
-
const { action, dx, dy } =
|
|
9748
|
+
const { action, dx, dy } = chunk3FVOKV4E_js.mapEditorKey(e, {
|
|
9747
9749
|
canEdit: current.canEdit,
|
|
9748
9750
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9749
9751
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9756,7 +9758,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9756
9758
|
hasSelection: current.hasSelection,
|
|
9757
9759
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9758
9760
|
isDrawing: current.activeTool !== "select",
|
|
9759
|
-
isTextInputTarget:
|
|
9761
|
+
isTextInputTarget: chunk3FVOKV4E_js.isEditorTextInputTarget(e.target)
|
|
9760
9762
|
});
|
|
9761
9763
|
if (action === null) {
|
|
9762
9764
|
return;
|
|
@@ -10088,7 +10090,7 @@ function useViewerIntegration(input) {
|
|
|
10088
10090
|
return zoom.scale;
|
|
10089
10091
|
},
|
|
10090
10092
|
setZoom(level) {
|
|
10091
|
-
zoom.setScale(
|
|
10093
|
+
zoom.setScale(chunk3FVOKV4E_js.clampZoomScale(level));
|
|
10092
10094
|
},
|
|
10093
10095
|
zoomIn() {
|
|
10094
10096
|
zoom.handleZoomIn();
|
|
@@ -10310,7 +10312,7 @@ function useReducedMotion() {
|
|
|
10310
10312
|
}
|
|
10311
10313
|
function useViewerOptions() {
|
|
10312
10314
|
const storeRef = react.useRef(null);
|
|
10313
|
-
storeRef.current ??=
|
|
10315
|
+
storeRef.current ??= chunk3FVOKV4E_js.createViewerOptionsStore();
|
|
10314
10316
|
const store = storeRef.current;
|
|
10315
10317
|
const options = react.useSyncExternalStore(
|
|
10316
10318
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -10319,9 +10321,9 @@ function useViewerOptions() {
|
|
|
10319
10321
|
);
|
|
10320
10322
|
return { optionsStore: store, options };
|
|
10321
10323
|
}
|
|
10322
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10324
|
+
var KNOWN_TAB_IDS = new Set(chunk3FVOKV4E_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10323
10325
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
10324
|
-
const isHidden = (id) =>
|
|
10326
|
+
const isHidden = (id) => chunk3FVOKV4E_js.isActionHidden(id, hiddenActions);
|
|
10325
10327
|
const userHidden = new Set(hiddenTabIds);
|
|
10326
10328
|
userHidden.delete("file");
|
|
10327
10329
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
|
|
@@ -10414,12 +10416,12 @@ function useYjsDocumentSync({
|
|
|
10414
10416
|
return;
|
|
10415
10417
|
}
|
|
10416
10418
|
try {
|
|
10417
|
-
const handler = new
|
|
10419
|
+
const handler = new chunk3FVOKV4E_js.PptxHandler();
|
|
10418
10420
|
await handler.load(sourceBytes.buffer);
|
|
10419
|
-
const currentSlides =
|
|
10421
|
+
const currentSlides = chunk3FVOKV4E_js.readSlidesFromYDoc(
|
|
10420
10422
|
doc
|
|
10421
10423
|
);
|
|
10422
|
-
const slidesToSave =
|
|
10424
|
+
const slidesToSave = chunk3FVOKV4E_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10423
10425
|
const bytes = await handler.save(slidesToSave, getSaveOptions?.());
|
|
10424
10426
|
config.onWriteBack(bytes);
|
|
10425
10427
|
} catch {
|
|
@@ -10434,10 +10436,10 @@ function useYjsDocumentSync({
|
|
|
10434
10436
|
if (!doc || !isConnected) {
|
|
10435
10437
|
return;
|
|
10436
10438
|
}
|
|
10437
|
-
const docSlides =
|
|
10439
|
+
const docSlides = chunk3FVOKV4E_js.readSlidesFromYDoc(
|
|
10438
10440
|
doc
|
|
10439
10441
|
);
|
|
10440
|
-
if (!
|
|
10442
|
+
if (!chunk3FVOKV4E_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10441
10443
|
return;
|
|
10442
10444
|
}
|
|
10443
10445
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10456,11 +10458,11 @@ function useYjsDocumentSync({
|
|
|
10456
10458
|
lastSyncedRef.current = serialized;
|
|
10457
10459
|
void (async () => {
|
|
10458
10460
|
const factories = await getFactories();
|
|
10459
|
-
|
|
10461
|
+
chunk3FVOKV4E_js.reconcileSlidesInYDoc(
|
|
10460
10462
|
slides,
|
|
10461
10463
|
doc,
|
|
10462
10464
|
factories,
|
|
10463
|
-
|
|
10465
|
+
chunk3FVOKV4E_js.LOCAL_SYNC_ORIGIN
|
|
10464
10466
|
);
|
|
10465
10467
|
scheduleWriteBack();
|
|
10466
10468
|
})();
|
|
@@ -10474,10 +10476,10 @@ function useYjsDocumentSync({
|
|
|
10474
10476
|
return;
|
|
10475
10477
|
}
|
|
10476
10478
|
const handleChange = (_events, transaction) => {
|
|
10477
|
-
if (transaction?.origin ===
|
|
10479
|
+
if (transaction?.origin === chunk3FVOKV4E_js.LOCAL_SYNC_ORIGIN) {
|
|
10478
10480
|
return;
|
|
10479
10481
|
}
|
|
10480
|
-
const remoteSlides =
|
|
10482
|
+
const remoteSlides = chunk3FVOKV4E_js.readSlidesFromYDoc(
|
|
10481
10483
|
doc
|
|
10482
10484
|
);
|
|
10483
10485
|
if (remoteSlides.length === 0) {
|
|
@@ -10493,7 +10495,7 @@ function useYjsDocumentSync({
|
|
|
10493
10495
|
isApplyingRemoteRef.current = false;
|
|
10494
10496
|
scheduleWriteBack();
|
|
10495
10497
|
};
|
|
10496
|
-
const unobserve =
|
|
10498
|
+
const unobserve = chunk3FVOKV4E_js.observeYDocSlides(
|
|
10497
10499
|
doc,
|
|
10498
10500
|
handleChange
|
|
10499
10501
|
);
|
|
@@ -10531,7 +10533,7 @@ function useBroadcastFollower({
|
|
|
10531
10533
|
if (!broadcaster) {
|
|
10532
10534
|
return;
|
|
10533
10535
|
}
|
|
10534
|
-
if (!
|
|
10536
|
+
if (!chunk3FVOKV4E_js.shouldAutoFollowBroadcaster({
|
|
10535
10537
|
localRole: collab.config.role,
|
|
10536
10538
|
broadcasterRole: broadcaster.role
|
|
10537
10539
|
})) {
|
|
@@ -10689,7 +10691,7 @@ function useLayoutSwitching(input) {
|
|
|
10689
10691
|
currentLayoutPath
|
|
10690
10692
|
};
|
|
10691
10693
|
}
|
|
10692
|
-
var MIN_TOUCH_TARGET =
|
|
10694
|
+
var MIN_TOUCH_TARGET = chunk3FVOKV4E_js.MIN_TOUCH_TARGET_PX;
|
|
10693
10695
|
function subscribeTouchCapability(callback) {
|
|
10694
10696
|
if (typeof window === "undefined") {
|
|
10695
10697
|
return () => {
|
|
@@ -10702,7 +10704,7 @@ function subscribeTouchCapability(callback) {
|
|
|
10702
10704
|
function useIsMobile() {
|
|
10703
10705
|
const isTouchDevice = react.useSyncExternalStore(
|
|
10704
10706
|
subscribeTouchCapability,
|
|
10705
|
-
|
|
10707
|
+
chunk3FVOKV4E_js.detectTouchDevice,
|
|
10706
10708
|
() => false
|
|
10707
10709
|
// server snapshot
|
|
10708
10710
|
);
|
|
@@ -10712,7 +10714,7 @@ function useIsMobile() {
|
|
|
10712
10714
|
const [viewportHeight, setViewportHeight] = react.useState(
|
|
10713
10715
|
() => typeof window === "undefined" ? 768 : window.innerHeight
|
|
10714
10716
|
);
|
|
10715
|
-
const [orientation, setOrientation] = react.useState(
|
|
10717
|
+
const [orientation, setOrientation] = react.useState(chunk3FVOKV4E_js.detectOrientation);
|
|
10716
10718
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
10717
10719
|
const [initialViewportHeight] = react.useState(
|
|
10718
10720
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -10733,7 +10735,7 @@ function useIsMobile() {
|
|
|
10733
10735
|
return;
|
|
10734
10736
|
}
|
|
10735
10737
|
const handleOrientationChange = () => {
|
|
10736
|
-
setOrientation(
|
|
10738
|
+
setOrientation(chunk3FVOKV4E_js.detectOrientation());
|
|
10737
10739
|
};
|
|
10738
10740
|
if (screen.orientation) {
|
|
10739
10741
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -10763,7 +10765,7 @@ function useIsMobile() {
|
|
|
10763
10765
|
window.addEventListener("resize", handleResize);
|
|
10764
10766
|
return () => window.removeEventListener("resize", handleResize);
|
|
10765
10767
|
}, [isTouchDevice, initialViewportHeight]);
|
|
10766
|
-
const { isMobile, isTablet, isDesktop } =
|
|
10768
|
+
const { isMobile, isTablet, isDesktop } = chunk3FVOKV4E_js.deriveViewportBreakpoints(
|
|
10767
10769
|
viewportWidth,
|
|
10768
10770
|
viewportHeight,
|
|
10769
10771
|
isTouchDevice
|
|
@@ -10796,10 +10798,10 @@ function useTouchGestures(input) {
|
|
|
10796
10798
|
if (!el || !enabled) {
|
|
10797
10799
|
return;
|
|
10798
10800
|
}
|
|
10799
|
-
const recognizer =
|
|
10801
|
+
const recognizer = chunk3FVOKV4E_js.createTouchGestureRecognizer({
|
|
10800
10802
|
getScale: () => scaleRef.current,
|
|
10801
|
-
minScale:
|
|
10802
|
-
maxScale:
|
|
10803
|
+
minScale: chunk3FVOKV4E_js.MIN_ZOOM_SCALE,
|
|
10804
|
+
maxScale: chunk3FVOKV4E_js.MAX_ZOOM_SCALE,
|
|
10803
10805
|
callbacks: {
|
|
10804
10806
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10805
10807
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10839,7 +10841,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10839
10841
|
return;
|
|
10840
10842
|
}
|
|
10841
10843
|
const rect = active.getBoundingClientRect();
|
|
10842
|
-
const delta =
|
|
10844
|
+
const delta = chunk3FVOKV4E_js.computeScrollDelta(
|
|
10843
10845
|
{ top: rect.top, bottom: rect.bottom },
|
|
10844
10846
|
window.innerHeight,
|
|
10845
10847
|
keyboardInset
|
|
@@ -10859,8 +10861,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10859
10861
|
return;
|
|
10860
10862
|
}
|
|
10861
10863
|
const update = () => {
|
|
10862
|
-
const metrics =
|
|
10863
|
-
const inset = metrics ?
|
|
10864
|
+
const metrics = chunk3FVOKV4E_js.readViewportMetrics(window);
|
|
10865
|
+
const inset = metrics ? chunk3FVOKV4E_js.computeKeyboardInset(metrics) : 0;
|
|
10864
10866
|
setKeyboardInset(inset);
|
|
10865
10867
|
if (inset > 0) {
|
|
10866
10868
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10871,8 +10873,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10871
10873
|
vv.addEventListener("scroll", update);
|
|
10872
10874
|
const onFocusIn = () => {
|
|
10873
10875
|
window.requestAnimationFrame(() => {
|
|
10874
|
-
const metrics =
|
|
10875
|
-
const inset = metrics ?
|
|
10876
|
+
const metrics = chunk3FVOKV4E_js.readViewportMetrics(window);
|
|
10877
|
+
const inset = metrics ? chunk3FVOKV4E_js.computeKeyboardInset(metrics) : 0;
|
|
10876
10878
|
if (inset > 0) {
|
|
10877
10879
|
scrollFocusedIntoView(inset);
|
|
10878
10880
|
}
|
|
@@ -10885,7 +10887,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10885
10887
|
document.removeEventListener("focusin", onFocusIn);
|
|
10886
10888
|
};
|
|
10887
10889
|
}, [enabled]);
|
|
10888
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10890
|
+
return { keyboardInset, isKeyboardOpen: chunk3FVOKV4E_js.isKeyboardOpen(keyboardInset) };
|
|
10889
10891
|
}
|
|
10890
10892
|
|
|
10891
10893
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10914,21 +10916,21 @@ function buildCanvasProps(input) {
|
|
|
10914
10916
|
} = input;
|
|
10915
10917
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10916
10918
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10917
|
-
const fieldContext =
|
|
10919
|
+
const fieldContext = chunk3FVOKV4E_js.buildFieldSubstitutionContext({
|
|
10918
10920
|
headerFooter: s.headerFooter,
|
|
10919
10921
|
customProperties: s.customProperties,
|
|
10920
10922
|
slide: activeSlide
|
|
10921
10923
|
});
|
|
10922
10924
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10923
10925
|
const openExternalUrl = (url, target) => {
|
|
10924
|
-
if (
|
|
10926
|
+
if (chunk3FVOKV4E_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
10925
10927
|
return;
|
|
10926
10928
|
}
|
|
10927
|
-
|
|
10929
|
+
chunk3FVOKV4E_js.safeOpenUrl(url, target);
|
|
10928
10930
|
};
|
|
10929
10931
|
const handleActionClick = (elementId, action) => {
|
|
10930
10932
|
if (mode === "present") {
|
|
10931
|
-
const resolved =
|
|
10933
|
+
const resolved = chunk3FVOKV4E_js.resolvePresentationAction(action, { slideCount: slides.length });
|
|
10932
10934
|
if (resolved.intent.kind === "openUrl") {
|
|
10933
10935
|
openExternalUrl(resolved.intent.url);
|
|
10934
10936
|
return;
|
|
@@ -10939,9 +10941,9 @@ function buildCanvasProps(input) {
|
|
|
10939
10941
|
}
|
|
10940
10942
|
};
|
|
10941
10943
|
const handleHyperlinkClick = (url, target) => {
|
|
10942
|
-
if (
|
|
10944
|
+
if (chunk3FVOKV4E_js.isPpactionUrl(url)) {
|
|
10943
10945
|
if (mode === "present") {
|
|
10944
|
-
const parsed =
|
|
10946
|
+
const parsed = chunk3FVOKV4E_js.parsePpactionUrl(url);
|
|
10945
10947
|
if (parsed) {
|
|
10946
10948
|
presentation.handlePresentationAction({
|
|
10947
10949
|
action: parsed.action,
|
|
@@ -11047,7 +11049,7 @@ function buildCanvasProps(input) {
|
|
|
11047
11049
|
|
|
11048
11050
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
11049
11051
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
11050
|
-
return
|
|
11052
|
+
return chunk3FVOKV4E_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
11051
11053
|
}
|
|
11052
11054
|
|
|
11053
11055
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -11060,7 +11062,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
11060
11062
|
const current = activeSlide.animations ?? [];
|
|
11061
11063
|
if (group === "motionPath") {
|
|
11062
11064
|
propertyHandlers.handleUpdateSlide({
|
|
11063
|
-
animations:
|
|
11065
|
+
animations: chunk3FVOKV4E_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
11064
11066
|
});
|
|
11065
11067
|
return;
|
|
11066
11068
|
}
|
|
@@ -11256,7 +11258,7 @@ function buildToolbarProps(input) {
|
|
|
11256
11258
|
onOpenFile,
|
|
11257
11259
|
onOpenRecentFile,
|
|
11258
11260
|
onCreatePresentation: (templateId) => {
|
|
11259
|
-
s.setSlides(
|
|
11261
|
+
s.setSlides(chunk3FVOKV4E_js.createBackstagePresentation(templateId));
|
|
11260
11262
|
s.setActiveSlideIndex(0);
|
|
11261
11263
|
s.setSelectedElementId(null);
|
|
11262
11264
|
s.setSelectedElementIds([]);
|
|
@@ -11286,7 +11288,7 @@ function buildToolbarProps(input) {
|
|
|
11286
11288
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
11287
11289
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
11288
11290
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
11289
|
-
templateScheme:
|
|
11291
|
+
templateScheme: chunk3FVOKV4E_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
11290
11292
|
customShows: s.customShows,
|
|
11291
11293
|
activeCustomShowId: s.activeCustomShowId,
|
|
11292
11294
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -11327,7 +11329,7 @@ function buildToolbarProps(input) {
|
|
|
11327
11329
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
11328
11330
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
11329
11331
|
formatPainterActive: s.formatPainterActive,
|
|
11330
|
-
canActivateFormatPainter:
|
|
11332
|
+
canActivateFormatPainter: chunk3FVOKV4E_js.hasCopyableFormat(selectedElement),
|
|
11331
11333
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
11332
11334
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
11333
11335
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11405,7 +11407,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11405
11407
|
headerFooter: state.headerFooter,
|
|
11406
11408
|
loading,
|
|
11407
11409
|
error,
|
|
11408
|
-
maxHistoryEntries:
|
|
11410
|
+
maxHistoryEntries: chunk3FVOKV4E_js.resolveHistoryDepth(viewerOptions),
|
|
11409
11411
|
hasActivePointerInteraction,
|
|
11410
11412
|
pointerCommitNonce: state.pointerCommitNonce,
|
|
11411
11413
|
onDirty: markDocumentDirty,
|
|
@@ -11430,7 +11432,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11430
11432
|
documentGridSpacing: state.viewProperties?.gridSpacing
|
|
11431
11433
|
});
|
|
11432
11434
|
const themeColorMap = react.useMemo(
|
|
11433
|
-
() => state.theme?.colorScheme ?
|
|
11435
|
+
() => state.theme?.colorScheme ? chunk3FVOKV4E_js.buildThemeColorMap(state.theme.colorScheme) : void 0,
|
|
11434
11436
|
[state.theme?.colorScheme]
|
|
11435
11437
|
);
|
|
11436
11438
|
const { presentation, annotations, actionSoundHandlerRef, setExitModeHandler } = usePresentationSetup({
|
|
@@ -11479,8 +11481,8 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11479
11481
|
gridSpacingPx,
|
|
11480
11482
|
// Multiplied against the pre-existing 2x baseline; see the matching
|
|
11481
11483
|
// comment in `PowerPointViewer.tsx`.
|
|
11482
|
-
imageExportScale: 2 *
|
|
11483
|
-
imageResolutionScale:
|
|
11484
|
+
imageExportScale: 2 * chunk3FVOKV4E_js.resolveImageResolutionScale(viewerOptions),
|
|
11485
|
+
imageResolutionScale: chunk3FVOKV4E_js.resolveImageResolutionScale(viewerOptions),
|
|
11484
11486
|
viewerOptions
|
|
11485
11487
|
};
|
|
11486
11488
|
}
|
|
@@ -11496,7 +11498,7 @@ function useCompatibilityToastsState() {
|
|
|
11496
11498
|
}
|
|
11497
11499
|
function useReadOnlyRecommendationState(content) {
|
|
11498
11500
|
const [recommendation, setRecommendation] = react.useState(
|
|
11499
|
-
() =>
|
|
11501
|
+
() => chunk3FVOKV4E_js.readOnlyRecommendation(void 0)
|
|
11500
11502
|
);
|
|
11501
11503
|
const [modifyVerifier, setModifyVerifier] = react.useState(void 0);
|
|
11502
11504
|
const [bannerHidden, setBannerHidden] = react.useState(false);
|
|
@@ -11536,7 +11538,7 @@ function useReadOnlyRecommendationState(content) {
|
|
|
11536
11538
|
async (password) => {
|
|
11537
11539
|
setCheckingPassword(true);
|
|
11538
11540
|
try {
|
|
11539
|
-
const result = await
|
|
11541
|
+
const result = await chunk3FVOKV4E_js.checkModifyPassword(modifyVerifier, password);
|
|
11540
11542
|
if (result.ok) {
|
|
11541
11543
|
unlock();
|
|
11542
11544
|
} else {
|
|
@@ -11581,9 +11583,9 @@ function useViewPreferencesSync(input) {
|
|
|
11581
11583
|
setShowGuides
|
|
11582
11584
|
} = input;
|
|
11583
11585
|
react.useEffect(() => {
|
|
11584
|
-
const seeded =
|
|
11586
|
+
const seeded = chunk3FVOKV4E_js.viewerPreferencesFromViewProperties(
|
|
11585
11587
|
{ viewProperties },
|
|
11586
|
-
{ ...
|
|
11588
|
+
{ ...chunk3FVOKV4E_js.DEFAULT_VIEWER_PREFERENCES, snapToGrid, snapToObjects: snapToShape, showGuides }
|
|
11587
11589
|
);
|
|
11588
11590
|
setSnapToGrid(seeded.snapToGrid);
|
|
11589
11591
|
setSnapToShape(seeded.snapToObjects ?? snapToShape);
|
|
@@ -11593,7 +11595,7 @@ function useViewPreferencesSync(input) {
|
|
|
11593
11595
|
(prefsOverride) => {
|
|
11594
11596
|
setViewProperties((prev) => {
|
|
11595
11597
|
const merged = {
|
|
11596
|
-
...
|
|
11598
|
+
...chunk3FVOKV4E_js.DEFAULT_VIEWER_PREFERENCES,
|
|
11597
11599
|
snapToGrid,
|
|
11598
11600
|
snapToObjects: snapToShape,
|
|
11599
11601
|
showGuides,
|
|
@@ -11601,7 +11603,7 @@ function useViewPreferencesSync(input) {
|
|
|
11601
11603
|
gridSpacingCy: prev?.gridSpacing?.cy,
|
|
11602
11604
|
...prefsOverride
|
|
11603
11605
|
};
|
|
11604
|
-
const patch =
|
|
11606
|
+
const patch = chunk3FVOKV4E_js.viewPropertiesPatchFromPreferences(merged);
|
|
11605
11607
|
return {
|
|
11606
11608
|
...prev,
|
|
11607
11609
|
slideViewPr: { ...prev?.slideViewPr, ...patch.slideViewPr },
|
|
@@ -11690,7 +11692,8 @@ function useViewerBuildingBlocksState(input) {
|
|
|
11690
11692
|
preMasterMode: state.preMasterMode,
|
|
11691
11693
|
hasDigitalSignatures: state.hasDigitalSignatures,
|
|
11692
11694
|
isDirty: state.isDirty,
|
|
11693
|
-
history
|
|
11695
|
+
history,
|
|
11696
|
+
embeddedFontFamilies: state.embeddedFonts.map((font) => font.name)
|
|
11694
11697
|
});
|
|
11695
11698
|
const readOnlyRec = useReadOnlyRecommendationState(content);
|
|
11696
11699
|
const compatToastsState = useCompatibilityToastsState();
|
|
@@ -11822,7 +11825,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11822
11825
|
}, [incomingContent]);
|
|
11823
11826
|
const onOpenFile = react.useCallback(() => {
|
|
11824
11827
|
void (async () => {
|
|
11825
|
-
const picked = await
|
|
11828
|
+
const picked = await chunk3FVOKV4E_js.openPptxFile();
|
|
11826
11829
|
if (picked) {
|
|
11827
11830
|
setContent(picked.buffer);
|
|
11828
11831
|
}
|
|
@@ -11830,7 +11833,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11830
11833
|
}, []);
|
|
11831
11834
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11832
11835
|
void (async () => {
|
|
11833
|
-
const bytes = await
|
|
11836
|
+
const bytes = await chunk3FVOKV4E_js.readBackstageRecentFile(key);
|
|
11834
11837
|
if (bytes) {
|
|
11835
11838
|
setContent(bytes);
|
|
11836
11839
|
}
|