pptx-react-viewer 3.15.0 → 3.16.0
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 +22 -0
- package/dist/{AiChatPanel-TBIAQSZ7.mjs → AiChatPanel-FAAO6JYZ.mjs} +3 -3
- package/dist/AiChatPanel-FAAO6JYZ.mjs.br +0 -0
- package/dist/AiChatPanel-FAAO6JYZ.mjs.gz +0 -0
- package/dist/{AiChatPanel-7CWOJ3PS.js → AiChatPanel-WSH2K7T4.js} +24 -24
- package/dist/AiChatPanel-WSH2K7T4.js.br +0 -0
- package/dist/AiChatPanel-WSH2K7T4.js.gz +0 -0
- package/dist/{Area3DChartScene-6FFBYPHF.mjs → Area3DChartScene-LGLVVQEB.mjs} +1 -1
- package/dist/Area3DChartScene-LGLVVQEB.mjs.br +0 -0
- package/dist/Area3DChartScene-LGLVVQEB.mjs.gz +0 -0
- package/dist/{Area3DChartScene-ZJYR6K66.js → Area3DChartScene-PTKML4PN.js} +2 -2
- package/dist/Area3DChartScene-PTKML4PN.js.br +0 -0
- package/dist/Area3DChartScene-PTKML4PN.js.gz +0 -0
- package/dist/{Bar3DChartScene-42MWINQX.mjs → Bar3DChartScene-HCP7MA3A.mjs} +1 -1
- package/dist/Bar3DChartScene-HCP7MA3A.mjs.br +0 -0
- package/dist/Bar3DChartScene-HCP7MA3A.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-JP3BXEZW.js → Bar3DChartScene-UXC4LE44.js} +2 -2
- package/dist/Bar3DChartScene-UXC4LE44.js.br +0 -0
- package/dist/Bar3DChartScene-UXC4LE44.js.gz +0 -0
- package/dist/{Line3DChartScene-YVCSJMWK.mjs → Line3DChartScene-JF54KXMH.mjs} +1 -1
- package/dist/Line3DChartScene-JF54KXMH.mjs.br +0 -0
- package/dist/Line3DChartScene-JF54KXMH.mjs.gz +0 -0
- package/dist/{Line3DChartScene-JK3AELXZ.js → Line3DChartScene-Z2EVGX4C.js} +2 -2
- package/dist/Line3DChartScene-Z2EVGX4C.js.br +0 -0
- package/dist/Line3DChartScene-Z2EVGX4C.js.gz +0 -0
- package/dist/{Model3DScene-OXWSYHHK.mjs → Model3DScene-YWQBX477.mjs} +1 -1
- package/dist/Model3DScene-YWQBX477.mjs.br +0 -0
- package/dist/Model3DScene-YWQBX477.mjs.gz +0 -0
- package/dist/{Model3DScene-N6UIMN7T.js → Model3DScene-ZBOF56VV.js} +2 -2
- package/dist/Model3DScene-ZBOF56VV.js.br +0 -0
- package/dist/Model3DScene-ZBOF56VV.js.gz +0 -0
- package/dist/{PieChart3DScene-XK4ETZJC.mjs → PieChart3DScene-4TRQ4V3M.mjs} +1 -1
- package/dist/PieChart3DScene-4TRQ4V3M.mjs.br +0 -0
- package/dist/PieChart3DScene-4TRQ4V3M.mjs.gz +0 -0
- package/dist/{PieChart3DScene-Q2Z3ECL4.js → PieChart3DScene-JPQTAS34.js} +2 -2
- package/dist/PieChart3DScene-JPQTAS34.js.br +0 -0
- package/dist/PieChart3DScene-JPQTAS34.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-KNWMKMOL.mjs → SurfaceChart3DScene-N76RNCUY.mjs} +1 -1
- package/dist/SurfaceChart3DScene-N76RNCUY.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-N76RNCUY.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-ULBUIF7T.js → SurfaceChart3DScene-P3LX35OP.js} +2 -2
- package/dist/SurfaceChart3DScene-P3LX35OP.js.br +0 -0
- package/dist/SurfaceChart3DScene-P3LX35OP.js.gz +0 -0
- package/dist/{chunk-6547ZWC7.mjs → chunk-6B7A5JNM.mjs} +12 -12
- package/dist/chunk-6B7A5JNM.mjs.br +0 -0
- package/dist/chunk-6B7A5JNM.mjs.gz +0 -0
- package/dist/{chunk-AT4BJKON.mjs → chunk-A6UVUZUX.mjs} +1 -1
- package/dist/chunk-A6UVUZUX.mjs.br +0 -0
- package/dist/chunk-A6UVUZUX.mjs.gz +0 -0
- package/dist/{chunk-C4Q4WYAJ.mjs → chunk-BNR6YPW5.mjs} +12 -34
- package/dist/chunk-BNR6YPW5.mjs.br +0 -0
- package/dist/chunk-BNR6YPW5.mjs.gz +0 -0
- package/dist/{chunk-J7Q7AGN7.mjs → chunk-ERCY52HH.mjs} +1 -1
- package/dist/chunk-ERCY52HH.mjs.br +0 -0
- package/dist/chunk-ERCY52HH.mjs.gz +0 -0
- package/dist/{chunk-5KAMDV37.js → chunk-L2MOKP3E.js} +1057 -375
- package/dist/chunk-L2MOKP3E.js.br +0 -0
- package/dist/chunk-L2MOKP3E.js.gz +0 -0
- package/dist/{chunk-YNTZCMRI.mjs → chunk-QVEPXTUB.mjs} +1056 -371
- package/dist/chunk-QVEPXTUB.mjs.br +0 -0
- package/dist/chunk-QVEPXTUB.mjs.gz +0 -0
- package/dist/{chunk-LAB7WX2N.js → chunk-TJ4L42RA.js} +456 -478
- package/dist/chunk-TJ4L42RA.js.br +0 -0
- package/dist/chunk-TJ4L42RA.js.gz +0 -0
- package/dist/{chunk-GLY4OPMY.js → chunk-W5W75MFP.js} +167 -167
- package/dist/chunk-W5W75MFP.js.br +0 -0
- package/dist/chunk-W5W75MFP.js.gz +0 -0
- package/dist/{chunk-Q6CSZ7VM.js → chunk-WYGPSCMS.js} +1289 -1289
- package/dist/chunk-WYGPSCMS.js.br +0 -0
- package/dist/chunk-WYGPSCMS.js.gz +0 -0
- package/dist/{chunk-VVJTEFGP.js → chunk-Y2UFUL7P.js} +5 -5
- package/dist/chunk-Y2UFUL7P.js.br +0 -0
- package/dist/chunk-Y2UFUL7P.js.gz +0 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +45 -45
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +2 -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.d.ts +2 -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-7CWOJ3PS.js.br +0 -0
- package/dist/AiChatPanel-7CWOJ3PS.js.gz +0 -0
- package/dist/AiChatPanel-TBIAQSZ7.mjs.br +0 -0
- package/dist/AiChatPanel-TBIAQSZ7.mjs.gz +0 -0
- package/dist/Area3DChartScene-6FFBYPHF.mjs.br +0 -0
- package/dist/Area3DChartScene-6FFBYPHF.mjs.gz +0 -0
- package/dist/Area3DChartScene-ZJYR6K66.js.br +0 -0
- package/dist/Area3DChartScene-ZJYR6K66.js.gz +0 -0
- package/dist/Bar3DChartScene-42MWINQX.mjs.br +0 -0
- package/dist/Bar3DChartScene-42MWINQX.mjs.gz +0 -0
- package/dist/Bar3DChartScene-JP3BXEZW.js.br +0 -0
- package/dist/Bar3DChartScene-JP3BXEZW.js.gz +0 -0
- package/dist/Line3DChartScene-JK3AELXZ.js.br +0 -0
- package/dist/Line3DChartScene-JK3AELXZ.js.gz +0 -0
- package/dist/Line3DChartScene-YVCSJMWK.mjs.br +0 -0
- package/dist/Line3DChartScene-YVCSJMWK.mjs.gz +0 -0
- package/dist/Model3DScene-N6UIMN7T.js.br +0 -0
- package/dist/Model3DScene-N6UIMN7T.js.gz +0 -0
- package/dist/Model3DScene-OXWSYHHK.mjs.br +0 -0
- package/dist/Model3DScene-OXWSYHHK.mjs.gz +0 -0
- package/dist/PieChart3DScene-Q2Z3ECL4.js.br +0 -0
- package/dist/PieChart3DScene-Q2Z3ECL4.js.gz +0 -0
- package/dist/PieChart3DScene-XK4ETZJC.mjs.br +0 -0
- package/dist/PieChart3DScene-XK4ETZJC.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-KNWMKMOL.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-KNWMKMOL.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-ULBUIF7T.js.br +0 -0
- package/dist/SurfaceChart3DScene-ULBUIF7T.js.gz +0 -0
- package/dist/chunk-5KAMDV37.js.br +0 -0
- package/dist/chunk-5KAMDV37.js.gz +0 -0
- package/dist/chunk-6547ZWC7.mjs.br +0 -0
- package/dist/chunk-6547ZWC7.mjs.gz +0 -0
- package/dist/chunk-AT4BJKON.mjs.br +0 -0
- package/dist/chunk-AT4BJKON.mjs.gz +0 -0
- package/dist/chunk-C4Q4WYAJ.mjs.br +0 -0
- package/dist/chunk-C4Q4WYAJ.mjs.gz +0 -0
- package/dist/chunk-GLY4OPMY.js.br +0 -0
- package/dist/chunk-GLY4OPMY.js.gz +0 -0
- package/dist/chunk-J7Q7AGN7.mjs.br +0 -0
- package/dist/chunk-J7Q7AGN7.mjs.gz +0 -0
- package/dist/chunk-LAB7WX2N.js.br +0 -0
- package/dist/chunk-LAB7WX2N.js.gz +0 -0
- package/dist/chunk-Q6CSZ7VM.js.br +0 -0
- package/dist/chunk-Q6CSZ7VM.js.gz +0 -0
- package/dist/chunk-VVJTEFGP.js.br +0 -0
- package/dist/chunk-VVJTEFGP.js.gz +0 -0
- package/dist/chunk-YNTZCMRI.mjs.br +0 -0
- package/dist/chunk-YNTZCMRI.mjs.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkW5W75MFP_js = require('./chunk-W5W75MFP.js');
|
|
4
|
+
var chunkL2MOKP3E_js = require('./chunk-L2MOKP3E.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 = chunkL2MOKP3E_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 = chunkL2MOKP3E_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 ??= chunkL2MOKP3E_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 >= chunkL2MOKP3E_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
|
+
}, chunkL2MOKP3E_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 = chunkL2MOKP3E_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
|
+
chunkL2MOKP3E_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 = chunkL2MOKP3E_js.validateRoomId(config.roomId);
|
|
244
244
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
245
|
-
departureRef.current =
|
|
245
|
+
departureRef.current = chunkL2MOKP3E_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 = chunkL2MOKP3E_js.validateRoomId(config.roomId);
|
|
288
|
+
const transport = config.transport ?? chunkL2MOKP3E_js.resolveTransportForServerUrl(config.serverUrl);
|
|
289
289
|
if (transport === "webrtc") {
|
|
290
290
|
await initWebrtc();
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
293
|
+
if (chunkL2MOKP3E_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 = chunkL2MOKP3E_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
|
+
chunkL2MOKP3E_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
|
+
}, chunkL2MOKP3E_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
|
+
chunkL2MOKP3E_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 = chunkL2MOKP3E_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 = chunkL2MOKP3E_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(chunkL2MOKP3E_js.cloneSlide),
|
|
531
|
+
templateElementsBySlideId: chunkL2MOKP3E_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(chunkL2MOKP3E_js.cloneSlide));
|
|
545
545
|
setTemplateElementsBySlideId(
|
|
546
|
-
|
|
546
|
+
chunkL2MOKP3E_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 = chunkW5W75MFP_js.cloneHistorySnapshot(previousSnapshot);
|
|
586
|
+
lastHistorySnapshotRef.current = chunkW5W75MFP_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 = chunkW5W75MFP_js.cloneHistorySnapshot(nextSnapshot);
|
|
608
|
+
lastHistorySnapshotRef.current = chunkW5W75MFP_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 = chunkW5W75MFP_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 = chunkW5W75MFP_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(chunkW5W75MFP_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 = chunkW5W75MFP_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(chunkL2MOKP3E_js.createWheelStepBuffer());
|
|
747
747
|
const storeRef = react.useRef(null);
|
|
748
|
-
storeRef.current ??=
|
|
748
|
+
storeRef.current ??= chunkL2MOKP3E_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 = chunkL2MOKP3E_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, chunkW5W75MFP_js.MIN_ELEMENT_SIZE));
|
|
847
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkW5W75MFP_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, chunkW5W75MFP_js.MIN_ELEMENT_SIZE);
|
|
854
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkW5W75MFP_js.MIN_ELEMENT_SIZE);
|
|
855
855
|
const availableWidth = Math.max(
|
|
856
|
-
effectiveEditorDimensions.width -
|
|
857
|
-
|
|
856
|
+
effectiveEditorDimensions.width - chunkW5W75MFP_js.ZOOM_TO_SELECTION_PADDING,
|
|
857
|
+
chunkW5W75MFP_js.MIN_ELEMENT_SIZE
|
|
858
858
|
);
|
|
859
859
|
const availableHeight = Math.max(
|
|
860
|
-
effectiveEditorDimensions.height -
|
|
861
|
-
|
|
860
|
+
effectiveEditorDimensions.height - chunkW5W75MFP_js.ZOOM_TO_SELECTION_PADDING,
|
|
861
|
+
chunkW5W75MFP_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 = chunkL2MOKP3E_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 = chunkL2MOKP3E_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: chunkL2MOKP3E_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
|
+
chunkL2MOKP3E_js.playGroup(controller, group, ctx);
|
|
988
|
+
chunkL2MOKP3E_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 = chunkL2MOKP3E_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(chunkL2MOKP3E_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
|
+
chunkL2MOKP3E_js.cancelBuildReveal(buildRafRef);
|
|
1058
1058
|
};
|
|
1059
1059
|
}, []);
|
|
1060
1060
|
const clearPresentationTimers = react.useCallback(() => {
|
|
1061
|
-
|
|
1061
|
+
chunkL2MOKP3E_js.clearPlaybackTimers(buildPlaybackContext(), activeAnimationGroupRef.current);
|
|
1062
1062
|
}, [buildPlaybackContext]);
|
|
1063
1063
|
const resetSlideTimeline = react.useCallback(
|
|
1064
1064
|
(slideIndex) => {
|
|
1065
|
-
|
|
1065
|
+
chunkL2MOKP3E_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 = chunkL2MOKP3E_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 = chunkL2MOKP3E_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 chunkL2MOKP3E_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
|
+
chunkL2MOKP3E_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
|
+
chunkL2MOKP3E_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 = chunkL2MOKP3E_js.PRESENTATION_CHANNEL_NAME;
|
|
1214
|
+
var AUDIENCE_HASH = chunkL2MOKP3E_js.PRESENTATION_HASH;
|
|
1215
|
+
var PRESENTER_MSG_ORIGIN = chunkL2MOKP3E_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1216
|
+
var AUDIENCE_NONCE_KEY = chunkL2MOKP3E_js.PRESENTATION_NONCE_KEY;
|
|
1217
1217
|
function generateSessionId() {
|
|
1218
|
-
return
|
|
1218
|
+
return chunkL2MOKP3E_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 ? chunkL2MOKP3E_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 chunkL2MOKP3E_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 = chunkL2MOKP3E_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1337
|
+
void chunkL2MOKP3E_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1338
1338
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1339
|
-
|
|
1339
|
+
chunkL2MOKP3E_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 chunkL2MOKP3E_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 (chunkL2MOKP3E_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 chunkL2MOKP3E_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 (!chunkL2MOKP3E_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 chunkL2MOKP3E_js.clearAudienceContent(expectedSessionId);
|
|
1503
1503
|
}
|
|
1504
|
-
if (
|
|
1504
|
+
if (chunkL2MOKP3E_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: chunkL2MOKP3E_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(chunkL2MOKP3E_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(chunkL2MOKP3E_js.createPresentationKeyBuffer());
|
|
1547
1547
|
react.useEffect(() => {
|
|
1548
|
-
if (mode !== "present" || !
|
|
1549
|
-
keyBufferRef.current =
|
|
1548
|
+
if (mode !== "present" || !chunkL2MOKP3E_js.acceptsPresentationInput()) {
|
|
1549
|
+
keyBufferRef.current = chunkL2MOKP3E_js.createPresentationKeyBuffer();
|
|
1550
1550
|
return;
|
|
1551
1551
|
}
|
|
1552
1552
|
const handleKeyDown = (event) => {
|
|
1553
|
-
const mapped =
|
|
1553
|
+
const mapped = chunkL2MOKP3E_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 = chunkL2MOKP3E_js.firstShowSlideIndex(showSlideIndexes);
|
|
1574
1574
|
navigateToSlide(first ?? 0);
|
|
1575
1575
|
return;
|
|
1576
1576
|
}
|
|
1577
1577
|
case "last": {
|
|
1578
|
-
const last =
|
|
1578
|
+
const last = chunkL2MOKP3E_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" || !chunkL2MOKP3E_js.acceptsPresentationInput()) {
|
|
1617
1617
|
return;
|
|
1618
1618
|
}
|
|
1619
|
-
const mapped =
|
|
1619
|
+
const mapped = chunkL2MOKP3E_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
|
+
chunkL2MOKP3E_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 ? chunkL2MOKP3E_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 = chunkL2MOKP3E_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 = chunkL2MOKP3E_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 && !chunkL2MOKP3E_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 ? chunkL2MOKP3E_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1893
1893
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
1894
|
-
}) :
|
|
1894
|
+
}) : chunkL2MOKP3E_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 = chunkL2MOKP3E_js.firstShowSlideIndex(chunkL2MOKP3E_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
|
+
chunkL2MOKP3E_js.safeOpenUrl(target);
|
|
2154
2154
|
}, []);
|
|
2155
2155
|
const onOpenPresentation = react.useCallback((target) => {
|
|
2156
|
-
|
|
2156
|
+
chunkL2MOKP3E_js.safeOpenUrl(target);
|
|
2157
2157
|
}, []);
|
|
2158
2158
|
const onRunProgram = react.useCallback(
|
|
2159
2159
|
(target) => {
|
|
2160
|
-
onAddRunProgramNotice?.(
|
|
2160
|
+
onAddRunProgramNotice?.(chunkL2MOKP3E_js.buildRunProgramNotice(target));
|
|
2161
2161
|
},
|
|
2162
2162
|
[onAddRunProgramNotice]
|
|
2163
2163
|
);
|
|
2164
2164
|
const onPlayMedia = react.useCallback(
|
|
2165
2165
|
(elementId) => {
|
|
2166
|
-
|
|
2166
|
+
chunkL2MOKP3E_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 = chunkL2MOKP3E_js.resolveOleVerbTarget(slides[presentationSlideIndex], elementId, verb);
|
|
2173
2173
|
if (!target) {
|
|
2174
2174
|
return;
|
|
2175
2175
|
}
|
|
2176
2176
|
if (target.action === "download") {
|
|
2177
|
-
|
|
2177
|
+
chunkL2MOKP3E_js.downloadDataUrl(target.url, target.fileName ?? "download");
|
|
2178
2178
|
} else {
|
|
2179
|
-
|
|
2179
|
+
chunkL2MOKP3E_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(chunkL2MOKP3E_js.createPresenterTimer());
|
|
2211
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkL2MOKP3E_js.createInitialPresentationSnapshot(slideIndex));
|
|
2212
2212
|
const patch = react.useCallback((value) => {
|
|
2213
|
-
setSnapshot((current) =>
|
|
2213
|
+
setSnapshot((current) => chunkL2MOKP3E_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 = chunkL2MOKP3E_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: chunkL2MOKP3E_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 = chunkL2MOKP3E_js.togglePresenterTimer(timerRef.current);
|
|
2236
2236
|
patch({
|
|
2237
2237
|
paused: timerRef.current.paused,
|
|
2238
|
-
elapsedMs:
|
|
2238
|
+
elapsedMs: chunkL2MOKP3E_js.presenterElapsed(timerRef.current)
|
|
2239
2239
|
});
|
|
2240
2240
|
},
|
|
2241
2241
|
resetTimer: () => {
|
|
2242
|
-
timerRef.current =
|
|
2242
|
+
timerRef.current = chunkL2MOKP3E_js.resetPresenterTimer();
|
|
2243
2243
|
patch({ paused: false, elapsedMs: 0 });
|
|
2244
2244
|
},
|
|
2245
2245
|
stepZoom: (direction) => setSnapshot(
|
|
2246
|
-
(current) =>
|
|
2247
|
-
zoom:
|
|
2246
|
+
(current) => chunkL2MOKP3E_js.mergePresentationSnapshot(current, {
|
|
2247
|
+
zoom: chunkL2MOKP3E_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(() => chunkL2MOKP3E_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 (!chunkL2MOKP3E_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 = chunkL2MOKP3E_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 chunkL2MOKP3E_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 = chunkL2MOKP3E_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 chunkL2MOKP3E_js.buildMorphTransitionPlan(
|
|
2639
2639
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2640
2640
|
incoming,
|
|
2641
2641
|
transitionOverlay.durationMs,
|
|
2642
|
-
|
|
2642
|
+
chunkL2MOKP3E_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 = chunkL2MOKP3E_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 = chunkL2MOKP3E_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) => chunkL2MOKP3E_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 } = chunkL2MOKP3E_js.mapEditorKey(event, {
|
|
3021
3021
|
canEdit: mode === "edit",
|
|
3022
|
-
isTextInputTarget:
|
|
3022
|
+
isTextInputTarget: chunkL2MOKP3E_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 = chunkL2MOKP3E_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 = chunkL2MOKP3E_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 = chunkL2MOKP3E_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 = chunkL2MOKP3E_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 = chunkL2MOKP3E_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
|
+
...chunkL2MOKP3E_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(() => chunkL2MOKP3E_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: chunkW5W75MFP_js.DEFAULT_CANVAS_WIDTH,
|
|
3651
|
+
height: chunkW5W75MFP_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
|
+
chunkL2MOKP3E_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 chunkL2MOKP3E_js.GlyphOutlineFontCache();
|
|
3968
|
+
var getGlyphOutline = chunkL2MOKP3E_js.createGlyphOutlineLookup(glyphOutlineFontCache);
|
|
3969
3969
|
|
|
3970
3970
|
// src/viewer/hooks/useLoadContent.ts
|
|
3971
3971
|
function useLoadContent({
|
|
@@ -4038,7 +4038,7 @@ function useLoadContent({
|
|
|
4038
4038
|
);
|
|
4039
4039
|
}
|
|
4040
4040
|
const previousHandler = handlerRef.current;
|
|
4041
|
-
const handler = new
|
|
4041
|
+
const handler = new chunkL2MOKP3E_js.PptxHandler();
|
|
4042
4042
|
const parsed = await handler.load(buffer, { allowExternalImages });
|
|
4043
4043
|
if (cancelled || token !== renderTokenRef.current) {
|
|
4044
4044
|
handler.dispose();
|
|
@@ -4050,7 +4050,7 @@ function useLoadContent({
|
|
|
4050
4050
|
handlerRef.current = null;
|
|
4051
4051
|
const mediaElements = [];
|
|
4052
4052
|
for (const slide of parsed.slides) {
|
|
4053
|
-
|
|
4053
|
+
chunkL2MOKP3E_js.collectMediaElements(slide.elements, mediaElements);
|
|
4054
4054
|
}
|
|
4055
4055
|
for (const url of mediaDataUrls.values()) {
|
|
4056
4056
|
if (url.startsWith("blob:")) {
|
|
@@ -4060,7 +4060,7 @@ function useLoadContent({
|
|
|
4060
4060
|
mediaDataUrls.clear();
|
|
4061
4061
|
await Promise.all(
|
|
4062
4062
|
mediaElements.map(async (mediaElement) => {
|
|
4063
|
-
const resolved = await
|
|
4063
|
+
const resolved = await chunkL2MOKP3E_js.resolveMediaElementSource(mediaElement, handler);
|
|
4064
4064
|
if (resolved.missing || !resolved.mediaPath || !resolved.url) {
|
|
4065
4065
|
mediaElement.mediaMissing = true;
|
|
4066
4066
|
return;
|
|
@@ -4071,7 +4071,7 @@ function useLoadContent({
|
|
|
4071
4071
|
}
|
|
4072
4072
|
})
|
|
4073
4073
|
);
|
|
4074
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
4074
|
+
const { paths: imagePaths, refs: imageRefs } = chunkL2MOKP3E_js.collectImagePaths(parsed.slides);
|
|
4075
4075
|
let nextSlides = parsed.slides;
|
|
4076
4076
|
if (imagePaths.size > 0) {
|
|
4077
4077
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -4087,25 +4087,25 @@ function useLoadContent({
|
|
|
4087
4087
|
})
|
|
4088
4088
|
);
|
|
4089
4089
|
nextSlides = parsed.slides.map((s) => {
|
|
4090
|
-
const newElements =
|
|
4090
|
+
const newElements = chunkL2MOKP3E_js.applyImagePathPatches(s.elements, resolvedMap, imageRefs);
|
|
4091
4091
|
return newElements === s.elements ? s : { ...s, elements: newElements };
|
|
4092
4092
|
});
|
|
4093
4093
|
}
|
|
4094
|
-
nextSlides = await
|
|
4094
|
+
nextSlides = await chunkL2MOKP3E_js.resolveTableCellImageUrls(
|
|
4095
4095
|
nextSlides,
|
|
4096
4096
|
(path) => handler.getImageData(path)
|
|
4097
4097
|
);
|
|
4098
|
-
const nextTableStyleMap = await
|
|
4098
|
+
const nextTableStyleMap = await chunkL2MOKP3E_js.resolveTableStyleImageUrls(
|
|
4099
4099
|
parsed.tableStyleMap,
|
|
4100
4100
|
(path) => handler.getImageData(path)
|
|
4101
4101
|
);
|
|
4102
4102
|
handlerRef.current = handler;
|
|
4103
|
-
const partition =
|
|
4103
|
+
const partition = chunkL2MOKP3E_js.partitionTemplateElements(nextSlides);
|
|
4104
4104
|
setSlides(partition.slides);
|
|
4105
4105
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4106
4106
|
setCanvasSize({
|
|
4107
|
-
width: parsed.width ??
|
|
4108
|
-
height: parsed.height ??
|
|
4107
|
+
width: parsed.width ?? chunkW5W75MFP_js.DEFAULT_CANVAS_WIDTH,
|
|
4108
|
+
height: parsed.height ?? chunkW5W75MFP_js.DEFAULT_CANVAS_HEIGHT
|
|
4109
4109
|
});
|
|
4110
4110
|
setSlideSizeEmu(
|
|
4111
4111
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4118,7 +4118,7 @@ function useLoadContent({
|
|
|
4118
4118
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
4119
4119
|
setSlideMasters(parsed.slideMasters ?? []);
|
|
4120
4120
|
setModernCommentAuthors(parsed.modernCommentAuthors ?? []);
|
|
4121
|
-
setRecentColors(
|
|
4121
|
+
setRecentColors(chunkL2MOKP3E_js.seedRecentColors({ mruColors: parsed.mruColors }));
|
|
4122
4122
|
setTheme(parsed.theme);
|
|
4123
4123
|
setTableStyleMap(nextTableStyleMap);
|
|
4124
4124
|
setTableStylesDefaultId(parsed.tableStylesDefaultId);
|
|
@@ -4126,7 +4126,7 @@ function useLoadContent({
|
|
|
4126
4126
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
4127
4127
|
setCustomShows(parsed.customShows ?? []);
|
|
4128
4128
|
setActiveCustomShowId(
|
|
4129
|
-
|
|
4129
|
+
chunkL2MOKP3E_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
4130
4130
|
);
|
|
4131
4131
|
setSections(parsed.sections ?? []);
|
|
4132
4132
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -4150,11 +4150,11 @@ function useLoadContent({
|
|
|
4150
4150
|
setHasMacros(parsed.hasMacros === true);
|
|
4151
4151
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4152
4152
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4153
|
-
setGuides(
|
|
4154
|
-
setReadOnlyRecommendation(
|
|
4153
|
+
setGuides(chunkL2MOKP3E_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4154
|
+
setReadOnlyRecommendation(chunkL2MOKP3E_js.readOnlyRecommendation(parsed));
|
|
4155
4155
|
setModifyVerifier(parsed.modifyVerifier ?? void 0);
|
|
4156
4156
|
setCompatToasts(
|
|
4157
|
-
|
|
4157
|
+
chunkL2MOKP3E_js.compatibilityWarningToasts([
|
|
4158
4158
|
...parsed.warnings ?? [],
|
|
4159
4159
|
...parsed.slides.flatMap((slide) => slide.warnings ?? [])
|
|
4160
4160
|
])
|
|
@@ -4166,7 +4166,7 @@ function useLoadContent({
|
|
|
4166
4166
|
onContentApplied?.();
|
|
4167
4167
|
} catch (err) {
|
|
4168
4168
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4169
|
-
if (err instanceof
|
|
4169
|
+
if (err instanceof chunkL2MOKP3E_js.EncryptedFileError) {
|
|
4170
4170
|
setIsEncrypted(true);
|
|
4171
4171
|
} else {
|
|
4172
4172
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4194,7 +4194,7 @@ function useLoadContent({
|
|
|
4194
4194
|
}
|
|
4195
4195
|
function useAutosave(input) {
|
|
4196
4196
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4197
|
-
const intervalMs =
|
|
4197
|
+
const intervalMs = chunkL2MOKP3E_js.resolveAutosaveIntervalMs({
|
|
4198
4198
|
hostIntervalMs: input.intervalMs,
|
|
4199
4199
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4200
4200
|
});
|
|
@@ -4225,7 +4225,7 @@ function useAutosave(input) {
|
|
|
4225
4225
|
return;
|
|
4226
4226
|
}
|
|
4227
4227
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4228
|
-
if (!
|
|
4228
|
+
if (!chunkL2MOKP3E_js.shouldWriteAutosaveSnapshot({
|
|
4229
4229
|
filePath: path,
|
|
4230
4230
|
isDirty: isDirtyRef.current,
|
|
4231
4231
|
saving: isSavingRef.current,
|
|
@@ -4243,8 +4243,8 @@ function useAutosave(input) {
|
|
|
4243
4243
|
isSavingRef.current = false;
|
|
4244
4244
|
return;
|
|
4245
4245
|
}
|
|
4246
|
-
await
|
|
4247
|
-
lastSnapshotRef.current =
|
|
4246
|
+
await chunkL2MOKP3E_js.saveAutosaveSnapshot(path, data);
|
|
4247
|
+
lastSnapshotRef.current = chunkL2MOKP3E_js.autosaveSnapshotMark(path, sources);
|
|
4248
4248
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4249
4249
|
} catch (err) {
|
|
4250
4250
|
setAutosaveStatus({
|
|
@@ -4298,13 +4298,13 @@ function useElementOperations(input) {
|
|
|
4298
4298
|
inlineEditingText
|
|
4299
4299
|
} = input;
|
|
4300
4300
|
const liveTextSegments = react.useCallback(() => {
|
|
4301
|
-
if (!selectedElement || !
|
|
4301
|
+
if (!selectedElement || !chunkL2MOKP3E_js.hasTextProperties(selectedElement)) {
|
|
4302
4302
|
return void 0;
|
|
4303
4303
|
}
|
|
4304
4304
|
if (selectedElement.id !== inlineEditingElementId) {
|
|
4305
4305
|
return selectedElement.textSegments;
|
|
4306
4306
|
}
|
|
4307
|
-
return
|
|
4307
|
+
return chunkL2MOKP3E_js.remapTextToSegments(
|
|
4308
4308
|
inlineEditingText,
|
|
4309
4309
|
selectedElement.textSegments,
|
|
4310
4310
|
selectedElement.textStyle
|
|
@@ -4345,11 +4345,11 @@ function useElementOperations(input) {
|
|
|
4345
4345
|
(elementId, updates) => {
|
|
4346
4346
|
if (masterView?.target) {
|
|
4347
4347
|
applyMasterViewWrite(
|
|
4348
|
-
|
|
4348
|
+
chunkL2MOKP3E_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4349
4349
|
);
|
|
4350
4350
|
return;
|
|
4351
4351
|
}
|
|
4352
|
-
if (
|
|
4352
|
+
if (chunkL2MOKP3E_js.isTemplateElementId(elementId)) {
|
|
4353
4353
|
const slideId = activeSlide?.id;
|
|
4354
4354
|
if (slideId) {
|
|
4355
4355
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4360,7 +4360,7 @@ function useElementOperations(input) {
|
|
|
4360
4360
|
}));
|
|
4361
4361
|
}
|
|
4362
4362
|
} else {
|
|
4363
|
-
setSlides((prev) =>
|
|
4363
|
+
setSlides((prev) => chunkL2MOKP3E_js.updateElement(prev, activeSlideIndex, elementId, updates));
|
|
4364
4364
|
}
|
|
4365
4365
|
history.markDirty();
|
|
4366
4366
|
},
|
|
@@ -4385,7 +4385,7 @@ function useElementOperations(input) {
|
|
|
4385
4385
|
);
|
|
4386
4386
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4387
4387
|
(updates) => {
|
|
4388
|
-
if (!selectedElement || !
|
|
4388
|
+
if (!selectedElement || !chunkL2MOKP3E_js.hasShapeProperties(selectedElement)) {
|
|
4389
4389
|
return;
|
|
4390
4390
|
}
|
|
4391
4391
|
updateSelectedElement({
|
|
@@ -4396,19 +4396,19 @@ function useElementOperations(input) {
|
|
|
4396
4396
|
);
|
|
4397
4397
|
const updateSelectedTextStyle = react.useCallback(
|
|
4398
4398
|
(updates) => {
|
|
4399
|
-
if (!selectedElement || !
|
|
4399
|
+
if (!selectedElement || !chunkL2MOKP3E_js.hasTextProperties(selectedElement)) {
|
|
4400
4400
|
return;
|
|
4401
4401
|
}
|
|
4402
4402
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4403
4403
|
const currentSegments = liveTextSegments();
|
|
4404
|
-
const inlineSel =
|
|
4404
|
+
const inlineSel = chunkL2MOKP3E_js.getInlineEditorSelection(currentSegments);
|
|
4405
4405
|
if (inlineSel && currentSegments) {
|
|
4406
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4406
|
+
const { newSegments: newSegments2, newSelection } = chunkL2MOKP3E_js.applyStyleToSelectedSegments(
|
|
4407
4407
|
currentSegments,
|
|
4408
4408
|
inlineSel,
|
|
4409
4409
|
updates
|
|
4410
4410
|
);
|
|
4411
|
-
|
|
4411
|
+
chunkL2MOKP3E_js.setPendingSelectionRestore(newSelection);
|
|
4412
4412
|
updateSelectedElement({
|
|
4413
4413
|
textSegments: newSegments2,
|
|
4414
4414
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4436,14 +4436,14 @@ function useElementOperations(input) {
|
|
|
4436
4436
|
);
|
|
4437
4437
|
const updateSelectedTextCase = react.useCallback(
|
|
4438
4438
|
(mode) => {
|
|
4439
|
-
if (!selectedElement || !
|
|
4439
|
+
if (!selectedElement || !chunkL2MOKP3E_js.hasTextProperties(selectedElement)) {
|
|
4440
4440
|
return;
|
|
4441
4441
|
}
|
|
4442
4442
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4443
4443
|
const currentSegments = liveTextSegments();
|
|
4444
|
-
const inlineSel =
|
|
4444
|
+
const inlineSel = chunkL2MOKP3E_js.getInlineEditorSelection(currentSegments);
|
|
4445
4445
|
if (inlineSel && currentSegments) {
|
|
4446
|
-
const newSegments =
|
|
4446
|
+
const newSegments = chunkL2MOKP3E_js.applyCaseTransformToSegments(currentSegments, inlineSel, mode);
|
|
4447
4447
|
updateSelectedElement({
|
|
4448
4448
|
textSegments: newSegments,
|
|
4449
4449
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4452,7 +4452,7 @@ function useElementOperations(input) {
|
|
|
4452
4452
|
}
|
|
4453
4453
|
const updates = {};
|
|
4454
4454
|
if (currentSegments && currentSegments.length > 0) {
|
|
4455
|
-
updates.textSegments =
|
|
4455
|
+
updates.textSegments = chunkL2MOKP3E_js.applyCaseTransformToSegments(
|
|
4456
4456
|
currentSegments,
|
|
4457
4457
|
null,
|
|
4458
4458
|
mode
|
|
@@ -4460,7 +4460,7 @@ function useElementOperations(input) {
|
|
|
4460
4460
|
}
|
|
4461
4461
|
const baseText = isLiveEditing ? inlineEditingText : selectedElement.text;
|
|
4462
4462
|
if (typeof baseText === "string") {
|
|
4463
|
-
updates.text =
|
|
4463
|
+
updates.text = chunkL2MOKP3E_js.transformTextCase(baseText, mode);
|
|
4464
4464
|
}
|
|
4465
4465
|
updateSelectedElement(updates);
|
|
4466
4466
|
},
|
|
@@ -4479,15 +4479,15 @@ function useElementOperations(input) {
|
|
|
4479
4479
|
[setSlides]
|
|
4480
4480
|
);
|
|
4481
4481
|
const masterViewTarget = masterView?.target ?? null;
|
|
4482
|
-
const activeElements = masterViewTarget ?
|
|
4482
|
+
const activeElements = masterViewTarget ? chunkL2MOKP3E_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4483
4483
|
const updateActiveElements = react.useCallback(
|
|
4484
4484
|
(updater) => {
|
|
4485
4485
|
if (masterView?.target) {
|
|
4486
4486
|
applyMasterViewWrite(
|
|
4487
|
-
|
|
4487
|
+
chunkL2MOKP3E_js.replaceMasterViewElements(
|
|
4488
4488
|
masterView,
|
|
4489
4489
|
masterView.target,
|
|
4490
|
-
updater(
|
|
4490
|
+
updater(chunkL2MOKP3E_js.masterViewElements(masterView, masterView.target))
|
|
4491
4491
|
)
|
|
4492
4492
|
);
|
|
4493
4493
|
return;
|
|
@@ -4540,7 +4540,7 @@ function useSectionOperations(input) {
|
|
|
4540
4540
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4541
4541
|
const addSection2 = react.useCallback(
|
|
4542
4542
|
(name, afterSlideIndex) => {
|
|
4543
|
-
const result =
|
|
4543
|
+
const result = chunkL2MOKP3E_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4544
4544
|
setSlides(result.slides);
|
|
4545
4545
|
setSections(result.sections);
|
|
4546
4546
|
markDirty();
|
|
@@ -4549,7 +4549,7 @@ function useSectionOperations(input) {
|
|
|
4549
4549
|
);
|
|
4550
4550
|
const renameSection2 = react.useCallback(
|
|
4551
4551
|
(sectionId, newName) => {
|
|
4552
|
-
const result =
|
|
4552
|
+
const result = chunkL2MOKP3E_js.renameSection(sections, slides, sectionId, newName);
|
|
4553
4553
|
setSections(result.sections);
|
|
4554
4554
|
setSlides(result.slides);
|
|
4555
4555
|
markDirty();
|
|
@@ -4558,7 +4558,7 @@ function useSectionOperations(input) {
|
|
|
4558
4558
|
);
|
|
4559
4559
|
const deleteSection2 = react.useCallback(
|
|
4560
4560
|
(sectionId) => {
|
|
4561
|
-
const result =
|
|
4561
|
+
const result = chunkL2MOKP3E_js.deleteSection(sections, slides, sectionId);
|
|
4562
4562
|
setSections(result.sections);
|
|
4563
4563
|
setSlides(result.slides);
|
|
4564
4564
|
markDirty();
|
|
@@ -4567,21 +4567,21 @@ function useSectionOperations(input) {
|
|
|
4567
4567
|
);
|
|
4568
4568
|
const moveSectionUp2 = react.useCallback(
|
|
4569
4569
|
(sectionId) => {
|
|
4570
|
-
setSections(
|
|
4570
|
+
setSections(chunkL2MOKP3E_js.moveSectionUp(sections, sectionId));
|
|
4571
4571
|
markDirty();
|
|
4572
4572
|
},
|
|
4573
4573
|
[sections, setSections, markDirty]
|
|
4574
4574
|
);
|
|
4575
4575
|
const moveSectionDown2 = react.useCallback(
|
|
4576
4576
|
(sectionId) => {
|
|
4577
|
-
setSections(
|
|
4577
|
+
setSections(chunkL2MOKP3E_js.moveSectionDown(sections, sectionId));
|
|
4578
4578
|
markDirty();
|
|
4579
4579
|
},
|
|
4580
4580
|
[sections, setSections, markDirty]
|
|
4581
4581
|
);
|
|
4582
4582
|
const moveSlidesToSection2 = react.useCallback(
|
|
4583
4583
|
(slideIndexes, targetSectionId) => {
|
|
4584
|
-
const result =
|
|
4584
|
+
const result = chunkL2MOKP3E_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4585
4585
|
setSlides(result.slides);
|
|
4586
4586
|
setSections(result.sections);
|
|
4587
4587
|
markDirty();
|
|
@@ -4647,15 +4647,15 @@ function syncSelectionHandleOverlay(elementNode, elementId, geometry) {
|
|
|
4647
4647
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4648
4648
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
|
|
4649
4649
|
const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
|
|
4650
|
-
let resized =
|
|
4650
|
+
let resized = chunkL2MOKP3E_js.applyResize(startBox, handle, dx, dy, 1, { minSize: chunkW5W75MFP_js.MIN_ELEMENT_SIZE });
|
|
4651
4651
|
if (lockAspect) {
|
|
4652
|
-
resized =
|
|
4652
|
+
resized = chunkL2MOKP3E_js.lockResizeAspect(resized, startBox, handle, chunkW5W75MFP_js.MIN_ELEMENT_SIZE);
|
|
4653
4653
|
}
|
|
4654
4654
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4655
4655
|
if (!snapToGrid) {
|
|
4656
4656
|
return box;
|
|
4657
4657
|
}
|
|
4658
|
-
return
|
|
4658
|
+
return chunkL2MOKP3E_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkW5W75MFP_js.MIN_ELEMENT_SIZE);
|
|
4659
4659
|
}
|
|
4660
4660
|
function resolveLiveTarget(input) {
|
|
4661
4661
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4768,7 +4768,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4768
4768
|
width: el.width,
|
|
4769
4769
|
height: el.height
|
|
4770
4770
|
}));
|
|
4771
|
-
const snapResult =
|
|
4771
|
+
const snapResult = chunkL2MOKP3E_js.computeSnapToShape(
|
|
4772
4772
|
targetX,
|
|
4773
4773
|
targetY,
|
|
4774
4774
|
primaryEl.width,
|
|
@@ -4810,7 +4810,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4810
4810
|
if (live) {
|
|
4811
4811
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4812
4812
|
const start = drag.startPositionsById[id];
|
|
4813
|
-
|
|
4813
|
+
chunkL2MOKP3E_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4814
4814
|
x: start.x + appliedDx,
|
|
4815
4815
|
y: start.y + appliedDy
|
|
4816
4816
|
});
|
|
@@ -4842,8 +4842,8 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4842
4842
|
rs.lastY = geo.y;
|
|
4843
4843
|
rs.lastWidth = geo.width;
|
|
4844
4844
|
rs.lastHeight = geo.height;
|
|
4845
|
-
const width = Math.max(geo.width,
|
|
4846
|
-
const height = Math.max(geo.height,
|
|
4845
|
+
const width = Math.max(geo.width, chunkW5W75MFP_js.MIN_ELEMENT_SIZE);
|
|
4846
|
+
const height = Math.max(geo.height, chunkW5W75MFP_js.MIN_ELEMENT_SIZE);
|
|
4847
4847
|
if (rs.domEl) {
|
|
4848
4848
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4849
4849
|
rs.domEl.style.top = `${geo.y}px`;
|
|
@@ -4852,7 +4852,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4852
4852
|
syncSelectionHandleOverlay(rs.domEl, rs.elementId, { x: geo.x, y: geo.y, width, height });
|
|
4853
4853
|
}
|
|
4854
4854
|
if (live) {
|
|
4855
|
-
|
|
4855
|
+
chunkL2MOKP3E_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4856
4856
|
x: geo.x,
|
|
4857
4857
|
y: geo.y,
|
|
4858
4858
|
width,
|
|
@@ -4863,7 +4863,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4863
4863
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4864
4864
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4865
4865
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4866
|
-
const adjustments =
|
|
4866
|
+
const adjustments = chunkL2MOKP3E_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4867
4867
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4868
4868
|
adj.moved = true;
|
|
4869
4869
|
}
|
|
@@ -4938,13 +4938,13 @@ function processPointerUp(input) {
|
|
|
4938
4938
|
if (i !== activeSlideIndex) {
|
|
4939
4939
|
return s;
|
|
4940
4940
|
}
|
|
4941
|
-
const rerouted =
|
|
4941
|
+
const rerouted = chunkL2MOKP3E_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4942
4942
|
if (rerouted.length === 0) {
|
|
4943
4943
|
return s;
|
|
4944
4944
|
}
|
|
4945
4945
|
return {
|
|
4946
4946
|
...s,
|
|
4947
|
-
elements:
|
|
4947
|
+
elements: chunkL2MOKP3E_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4948
4948
|
};
|
|
4949
4949
|
})
|
|
4950
4950
|
);
|
|
@@ -4969,9 +4969,9 @@ function processPointerUp(input) {
|
|
|
4969
4969
|
}
|
|
4970
4970
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4971
4971
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4972
|
-
const hitIds =
|
|
4972
|
+
const hitIds = chunkL2MOKP3E_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4973
4973
|
if (marquee.additive) {
|
|
4974
|
-
const merged =
|
|
4974
|
+
const merged = chunkL2MOKP3E_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4975
4975
|
if (merged.length > 0) {
|
|
4976
4976
|
applySelection(merged[0], merged);
|
|
4977
4977
|
} else {
|
|
@@ -4994,8 +4994,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4994
4994
|
}
|
|
4995
4995
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4996
4996
|
});
|
|
4997
|
-
const rerouted =
|
|
4998
|
-
return
|
|
4997
|
+
const rerouted = chunkL2MOKP3E_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4998
|
+
return chunkL2MOKP3E_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4999
4999
|
};
|
|
5000
5000
|
if (editTemplateMode) {
|
|
5001
5001
|
const slideId = activeSlide?.id;
|
|
@@ -5151,17 +5151,17 @@ function useCanvasInteractions(input) {
|
|
|
5151
5151
|
return;
|
|
5152
5152
|
}
|
|
5153
5153
|
const el = elementLookup.get(editId);
|
|
5154
|
-
if (el &&
|
|
5154
|
+
if (el && chunkL2MOKP3E_js.hasTextProperties(el)) {
|
|
5155
5155
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
5156
|
-
const textPatch =
|
|
5156
|
+
const textPatch = chunkL2MOKP3E_js.buildInlineTextCommitPatch(el, committedText);
|
|
5157
5157
|
if (!textPatch) {
|
|
5158
5158
|
setInlineEditingElementId(null);
|
|
5159
5159
|
setInlineEditingText("");
|
|
5160
5160
|
return;
|
|
5161
5161
|
}
|
|
5162
5162
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
5163
|
-
const newHeight =
|
|
5164
|
-
const shrink =
|
|
5163
|
+
const newHeight = chunkL2MOKP3E_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
5164
|
+
const shrink = chunkL2MOKP3E_js.resolveInlineEditNormAutofitShrink(el.textStyle, el.height, editorEl);
|
|
5165
5165
|
ops.updateElementById(editId, {
|
|
5166
5166
|
...textPatch,
|
|
5167
5167
|
...newHeight !== void 0 ? { height: newHeight } : {},
|
|
@@ -5179,7 +5179,7 @@ function useCanvasInteractions(input) {
|
|
|
5179
5179
|
setInlineEditingText("");
|
|
5180
5180
|
};
|
|
5181
5181
|
const openEquationEditorForElement = (el) => {
|
|
5182
|
-
if (!
|
|
5182
|
+
if (!chunkL2MOKP3E_js.hasTextProperties(el)) {
|
|
5183
5183
|
return false;
|
|
5184
5184
|
}
|
|
5185
5185
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5209,7 +5209,7 @@ function useCanvasInteractions(input) {
|
|
|
5209
5209
|
justInteractedRef.current = false;
|
|
5210
5210
|
} else {
|
|
5211
5211
|
const el = elementLookup.get(elementId);
|
|
5212
|
-
if (el &&
|
|
5212
|
+
if (el && chunkL2MOKP3E_js.hasTextProperties(el) && chunkL2MOKP3E_js.canInteractWithElement(el, "textEdit")) {
|
|
5213
5213
|
if (!openEquationEditorForElement(el)) {
|
|
5214
5214
|
setInlineEditingElementId(elementId);
|
|
5215
5215
|
setInlineEditingText(el.text ?? "");
|
|
@@ -5228,7 +5228,7 @@ function useCanvasInteractions(input) {
|
|
|
5228
5228
|
if (openEquationEditorForElement(el)) {
|
|
5229
5229
|
return;
|
|
5230
5230
|
}
|
|
5231
|
-
if (
|
|
5231
|
+
if (chunkL2MOKP3E_js.hasTextProperties(el) && chunkL2MOKP3E_js.canInteractWithElement(el, "textEdit")) {
|
|
5232
5232
|
setInlineEditingElementId(elementId);
|
|
5233
5233
|
setInlineEditingText(el.text ?? "");
|
|
5234
5234
|
}
|
|
@@ -5251,7 +5251,7 @@ function useCanvasInteractions(input) {
|
|
|
5251
5251
|
justSelectedRef.current = false;
|
|
5252
5252
|
}
|
|
5253
5253
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
5254
|
-
const movableIds =
|
|
5254
|
+
const movableIds = chunkL2MOKP3E_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
5255
5255
|
if (movableIds.length === 0) {
|
|
5256
5256
|
return;
|
|
5257
5257
|
}
|
|
@@ -5321,7 +5321,7 @@ function useCanvasInteractions(input) {
|
|
|
5321
5321
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5322
5322
|
e.stopPropagation();
|
|
5323
5323
|
const el = elementLookup.get(elementId);
|
|
5324
|
-
if (!el || !
|
|
5324
|
+
if (!el || !chunkL2MOKP3E_js.canInteractWithElement(el, "resize")) {
|
|
5325
5325
|
return;
|
|
5326
5326
|
}
|
|
5327
5327
|
resizeStateRef.current = {
|
|
@@ -5343,7 +5343,7 @@ function useCanvasInteractions(input) {
|
|
|
5343
5343
|
};
|
|
5344
5344
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5345
5345
|
const el = elementLookup.get(elementId);
|
|
5346
|
-
if (!el || !
|
|
5346
|
+
if (!el || !chunkL2MOKP3E_js.canInteractWithElement(el, "rotate")) {
|
|
5347
5347
|
return;
|
|
5348
5348
|
}
|
|
5349
5349
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5363,10 +5363,10 @@ function useCanvasInteractions(input) {
|
|
|
5363
5363
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5364
5364
|
e.stopPropagation();
|
|
5365
5365
|
const el = elementLookup.get(elementId);
|
|
5366
|
-
if (!el || !
|
|
5366
|
+
if (!el || !chunkL2MOKP3E_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5367
5367
|
return;
|
|
5368
5368
|
}
|
|
5369
|
-
shapeAdjustmentDragStateRef.current =
|
|
5369
|
+
shapeAdjustmentDragStateRef.current = chunkL2MOKP3E_js.beginShapeAdjustment(
|
|
5370
5370
|
el,
|
|
5371
5371
|
descriptor,
|
|
5372
5372
|
e.clientX,
|
|
@@ -5413,7 +5413,7 @@ function createFileHandlers(deps) {
|
|
|
5413
5413
|
h = Math.round(h * scale);
|
|
5414
5414
|
}
|
|
5415
5415
|
addElement({
|
|
5416
|
-
id:
|
|
5416
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
5417
5417
|
type: "image",
|
|
5418
5418
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5419
5419
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5424,7 +5424,7 @@ function createFileHandlers(deps) {
|
|
|
5424
5424
|
};
|
|
5425
5425
|
img.onerror = () => {
|
|
5426
5426
|
addElement({
|
|
5427
|
-
id:
|
|
5427
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
5428
5428
|
type: "image",
|
|
5429
5429
|
x: 100,
|
|
5430
5430
|
y: 100,
|
|
@@ -5443,14 +5443,14 @@ function createFileHandlers(deps) {
|
|
|
5443
5443
|
return;
|
|
5444
5444
|
}
|
|
5445
5445
|
e.target.value = "";
|
|
5446
|
-
const mediaType =
|
|
5446
|
+
const mediaType = chunkL2MOKP3E_js.classifyMediaType(file.type);
|
|
5447
5447
|
if (!mediaType) {
|
|
5448
5448
|
return;
|
|
5449
5449
|
}
|
|
5450
5450
|
const elFilePath = file.path;
|
|
5451
5451
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5452
5452
|
addElement({
|
|
5453
|
-
id:
|
|
5453
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
5454
5454
|
type: "media",
|
|
5455
5455
|
mediaType,
|
|
5456
5456
|
mediaMimeType: file.type || void 0,
|
|
@@ -5625,13 +5625,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5625
5625
|
return;
|
|
5626
5626
|
}
|
|
5627
5627
|
addElement({
|
|
5628
|
-
id:
|
|
5628
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
5629
5629
|
type: "smartArt",
|
|
5630
5630
|
x: 100,
|
|
5631
5631
|
y: 120,
|
|
5632
5632
|
width: 600,
|
|
5633
5633
|
height: 340,
|
|
5634
|
-
smartArtData:
|
|
5634
|
+
smartArtData: chunkL2MOKP3E_js.buildSmartArtPresetData(
|
|
5635
5635
|
layout,
|
|
5636
5636
|
defaultItems,
|
|
5637
5637
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5643,7 +5643,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5643
5643
|
return;
|
|
5644
5644
|
}
|
|
5645
5645
|
addElement({
|
|
5646
|
-
id:
|
|
5646
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
5647
5647
|
type: "shape",
|
|
5648
5648
|
x: 120,
|
|
5649
5649
|
y: 200,
|
|
@@ -5681,7 +5681,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5681
5681
|
return;
|
|
5682
5682
|
}
|
|
5683
5683
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5684
|
-
if (resolved.url && !
|
|
5684
|
+
if (resolved.url && !chunkL2MOKP3E_js.isUrlSafe(resolved.url)) {
|
|
5685
5685
|
return;
|
|
5686
5686
|
}
|
|
5687
5687
|
const actionClick = {
|
|
@@ -5705,7 +5705,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5705
5705
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5706
5706
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5707
5707
|
addElement({
|
|
5708
|
-
id:
|
|
5708
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
5709
5709
|
type: "shape",
|
|
5710
5710
|
x: 120,
|
|
5711
5711
|
y: 200,
|
|
@@ -5727,11 +5727,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5727
5727
|
if (!activeSlide) {
|
|
5728
5728
|
return;
|
|
5729
5729
|
}
|
|
5730
|
-
const preset =
|
|
5730
|
+
const preset = chunkL2MOKP3E_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5731
5731
|
if (!preset) {
|
|
5732
5732
|
return;
|
|
5733
5733
|
}
|
|
5734
|
-
const defaultPptxAction =
|
|
5734
|
+
const defaultPptxAction = chunkL2MOKP3E_js.elementActionToPptxAction({
|
|
5735
5735
|
trigger: "click",
|
|
5736
5736
|
type: preset.defaultAction
|
|
5737
5737
|
});
|
|
@@ -5740,7 +5740,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5740
5740
|
defaultPptxAction.highlightClick = true;
|
|
5741
5741
|
}
|
|
5742
5742
|
addElement({
|
|
5743
|
-
id:
|
|
5743
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
5744
5744
|
type: "shape",
|
|
5745
5745
|
x: 150,
|
|
5746
5746
|
y: 150,
|
|
@@ -5807,14 +5807,14 @@ function useInsertElements(input) {
|
|
|
5807
5807
|
return;
|
|
5808
5808
|
}
|
|
5809
5809
|
addElement({
|
|
5810
|
-
id:
|
|
5810
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
5811
5811
|
type: "text",
|
|
5812
5812
|
x: 100,
|
|
5813
5813
|
y: 100,
|
|
5814
5814
|
width: 300,
|
|
5815
5815
|
height: 60,
|
|
5816
5816
|
text: "",
|
|
5817
|
-
textStyle: { fontSize:
|
|
5817
|
+
textStyle: { fontSize: chunkW5W75MFP_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5818
5818
|
});
|
|
5819
5819
|
};
|
|
5820
5820
|
const handleAddShape = () => {
|
|
@@ -5822,7 +5822,7 @@ function useInsertElements(input) {
|
|
|
5822
5822
|
return;
|
|
5823
5823
|
}
|
|
5824
5824
|
addElement({
|
|
5825
|
-
id:
|
|
5825
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
5826
5826
|
type: "shape",
|
|
5827
5827
|
x: 150,
|
|
5828
5828
|
y: 150,
|
|
@@ -5841,15 +5841,15 @@ function useInsertElements(input) {
|
|
|
5841
5841
|
return;
|
|
5842
5842
|
}
|
|
5843
5843
|
addElement({
|
|
5844
|
-
...
|
|
5845
|
-
id:
|
|
5844
|
+
...chunkL2MOKP3E_js.newTableElement(chunkW5W75MFP_js.DEFAULT_TABLE_ROWS, chunkW5W75MFP_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5845
|
+
id: chunkL2MOKP3E_js.generateElementId()
|
|
5846
5846
|
});
|
|
5847
5847
|
};
|
|
5848
5848
|
const handleAddChart = (chartKind) => {
|
|
5849
5849
|
if (!activeSlide) {
|
|
5850
5850
|
return;
|
|
5851
5851
|
}
|
|
5852
|
-
addElement(
|
|
5852
|
+
addElement(chunkL2MOKP3E_js.createDefaultChartElement(chartKind));
|
|
5853
5853
|
};
|
|
5854
5854
|
const structured = createStructuredElementHandlers({
|
|
5855
5855
|
activeSlide,
|
|
@@ -5919,7 +5919,7 @@ function useClipboardHandlers(input) {
|
|
|
5919
5919
|
if (!selectedElement) {
|
|
5920
5920
|
return;
|
|
5921
5921
|
}
|
|
5922
|
-
setClipboardPayload(
|
|
5922
|
+
setClipboardPayload(chunkL2MOKP3E_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5923
5923
|
};
|
|
5924
5924
|
const handleDelete = () => {
|
|
5925
5925
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5936,7 +5936,7 @@ function useClipboardHandlers(input) {
|
|
|
5936
5936
|
handleDelete();
|
|
5937
5937
|
};
|
|
5938
5938
|
const insertClone = (source) => {
|
|
5939
|
-
const clone =
|
|
5939
|
+
const clone = chunkL2MOKP3E_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5940
5940
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5941
5941
|
ops.applySelection(clone.id);
|
|
5942
5942
|
history.markDirty();
|
|
@@ -5971,7 +5971,7 @@ function resolveShapePath(el) {
|
|
|
5971
5971
|
return el.pathData;
|
|
5972
5972
|
}
|
|
5973
5973
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5974
|
-
const clipPath =
|
|
5974
|
+
const clipPath = chunkL2MOKP3E_js.getPresetShapeClipPath(el.shapeType);
|
|
5975
5975
|
if (clipPath) {
|
|
5976
5976
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5977
5977
|
if (svgPath) {
|
|
@@ -6022,7 +6022,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
6022
6022
|
return parts.join(" ");
|
|
6023
6023
|
}
|
|
6024
6024
|
function transformPathToGlobal(pathData, el) {
|
|
6025
|
-
const polys =
|
|
6025
|
+
const polys = chunkL2MOKP3E_js.svgPathToPolygons(pathData);
|
|
6026
6026
|
if (polys.length === 0) {
|
|
6027
6027
|
return pathData;
|
|
6028
6028
|
}
|
|
@@ -6042,10 +6042,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
6042
6042
|
y: pt.y * scaleY + el.y
|
|
6043
6043
|
}))
|
|
6044
6044
|
);
|
|
6045
|
-
return
|
|
6045
|
+
return chunkL2MOKP3E_js.polygonsToSvgPath(transformed);
|
|
6046
6046
|
}
|
|
6047
6047
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
6048
|
-
const polys =
|
|
6048
|
+
const polys = chunkL2MOKP3E_js.svgPathToPolygons(pathData);
|
|
6049
6049
|
if (polys.length === 0) {
|
|
6050
6050
|
return pathData;
|
|
6051
6051
|
}
|
|
@@ -6055,10 +6055,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
6055
6055
|
y: pt.y - y
|
|
6056
6056
|
}))
|
|
6057
6057
|
);
|
|
6058
|
-
return
|
|
6058
|
+
return chunkL2MOKP3E_js.polygonsToSvgPath(transformed);
|
|
6059
6059
|
}
|
|
6060
6060
|
function pathBounds(pathData) {
|
|
6061
|
-
const polys =
|
|
6061
|
+
const polys = chunkL2MOKP3E_js.svgPathToPolygons(pathData);
|
|
6062
6062
|
let minX = Infinity;
|
|
6063
6063
|
let minY = Infinity;
|
|
6064
6064
|
let maxX = -Infinity;
|
|
@@ -6117,7 +6117,7 @@ function useMergeShapesHandler(input) {
|
|
|
6117
6117
|
let allFragments = [];
|
|
6118
6118
|
let remaining = globalPaths[0];
|
|
6119
6119
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6120
|
-
const frags =
|
|
6120
|
+
const frags = chunkL2MOKP3E_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
6121
6121
|
if (Array.isArray(frags)) {
|
|
6122
6122
|
allFragments = frags;
|
|
6123
6123
|
}
|
|
@@ -6146,7 +6146,7 @@ function useMergeShapesHandler(input) {
|
|
|
6146
6146
|
bounds.height
|
|
6147
6147
|
);
|
|
6148
6148
|
const newEl = {
|
|
6149
|
-
id:
|
|
6149
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
6150
6150
|
type: "shape",
|
|
6151
6151
|
x: bounds.x,
|
|
6152
6152
|
y: bounds.y,
|
|
@@ -6184,7 +6184,7 @@ function useMergeShapesHandler(input) {
|
|
|
6184
6184
|
} else {
|
|
6185
6185
|
let resultPath = globalPaths[0];
|
|
6186
6186
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6187
|
-
const result =
|
|
6187
|
+
const result = chunkL2MOKP3E_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
6188
6188
|
if (typeof result === "string") {
|
|
6189
6189
|
resultPath = result;
|
|
6190
6190
|
}
|
|
@@ -6205,7 +6205,7 @@ function useMergeShapesHandler(input) {
|
|
|
6205
6205
|
);
|
|
6206
6206
|
const primary = targets[0];
|
|
6207
6207
|
const newEl = {
|
|
6208
|
-
id:
|
|
6208
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
6209
6209
|
type: "shape",
|
|
6210
6210
|
x: bounds.x,
|
|
6211
6211
|
y: bounds.y,
|
|
@@ -6268,10 +6268,10 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6268
6268
|
if (ids.length < 2 || !activeSlide) {
|
|
6269
6269
|
return;
|
|
6270
6270
|
}
|
|
6271
|
-
if (!selectedElements.every((el) =>
|
|
6271
|
+
if (!selectedElements.every((el) => chunkL2MOKP3E_js.canInteractWithElement(el, "group"))) {
|
|
6272
6272
|
return;
|
|
6273
6273
|
}
|
|
6274
|
-
const { elements, groupId } =
|
|
6274
|
+
const { elements, groupId } = chunkL2MOKP3E_js.groupElements(ops.activeElements, ids, chunkL2MOKP3E_js.generateElementId());
|
|
6275
6275
|
if (groupId === null) {
|
|
6276
6276
|
return;
|
|
6277
6277
|
}
|
|
@@ -6283,15 +6283,15 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6283
6283
|
if (!selectedElement || selectedElement.type !== "group" || !activeSlide) {
|
|
6284
6284
|
return;
|
|
6285
6285
|
}
|
|
6286
|
-
if (!
|
|
6286
|
+
if (!chunkL2MOKP3E_js.canInteractWithElement(selectedElement, "group")) {
|
|
6287
6287
|
return;
|
|
6288
6288
|
}
|
|
6289
6289
|
const group = selectedElement;
|
|
6290
|
-
const intoTemplate =
|
|
6290
|
+
const intoTemplate = chunkL2MOKP3E_js.isTemplateElementId(group.id);
|
|
6291
6291
|
const childIds = group.children.map(
|
|
6292
|
-
(child) => intoTemplate ?
|
|
6292
|
+
(child) => intoTemplate ? chunkL2MOKP3E_js.makeCloneId(true, child.id || group.id) : child.id || chunkL2MOKP3E_js.generateElementId()
|
|
6293
6293
|
);
|
|
6294
|
-
const { elements, childIds: usedIds } =
|
|
6294
|
+
const { elements, childIds: usedIds } = chunkL2MOKP3E_js.ungroupElements(
|
|
6295
6295
|
ops.activeElements,
|
|
6296
6296
|
group.id,
|
|
6297
6297
|
childIds,
|
|
@@ -6320,7 +6320,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6320
6320
|
if (!edge) {
|
|
6321
6321
|
return;
|
|
6322
6322
|
}
|
|
6323
|
-
const positions =
|
|
6323
|
+
const positions = chunkL2MOKP3E_js.alignElements(selectedElements, edge);
|
|
6324
6324
|
for (const [id, pos] of positions) {
|
|
6325
6325
|
const el = elementLookup.get(id);
|
|
6326
6326
|
if (!el) {
|
|
@@ -6338,7 +6338,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6338
6338
|
if (!distAxis) {
|
|
6339
6339
|
return;
|
|
6340
6340
|
}
|
|
6341
|
-
const positions =
|
|
6341
|
+
const positions = chunkL2MOKP3E_js.distributeElements(selectedElements, distAxis);
|
|
6342
6342
|
for (const [id, pos] of positions) {
|
|
6343
6343
|
const el = elementLookup.get(id);
|
|
6344
6344
|
if (!el) {
|
|
@@ -6349,14 +6349,14 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6349
6349
|
history.markDirty();
|
|
6350
6350
|
};
|
|
6351
6351
|
const canDistribute = selectedElements.length >= 3;
|
|
6352
|
-
const selectionGroupable = selectedElements.every((el) =>
|
|
6352
|
+
const selectionGroupable = selectedElements.every((el) => chunkL2MOKP3E_js.canInteractWithElement(el, "group"));
|
|
6353
6353
|
const handleMoveLayer = (direction) => {
|
|
6354
6354
|
if (!selectedElement || !activeSlide) {
|
|
6355
6355
|
return;
|
|
6356
6356
|
}
|
|
6357
6357
|
const id = selectedElement.id;
|
|
6358
6358
|
ops.updateActiveElements(
|
|
6359
|
-
(els) => direction === "forward" ?
|
|
6359
|
+
(els) => direction === "forward" ? chunkL2MOKP3E_js.bringForward(els, id) : direction === "backward" ? chunkL2MOKP3E_js.sendBackward(els, id) : els
|
|
6360
6360
|
);
|
|
6361
6361
|
history.markDirty();
|
|
6362
6362
|
};
|
|
@@ -6366,7 +6366,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6366
6366
|
}
|
|
6367
6367
|
const id = selectedElement.id;
|
|
6368
6368
|
ops.updateActiveElements(
|
|
6369
|
-
(els) => direction === "front" ?
|
|
6369
|
+
(els) => direction === "front" ? chunkL2MOKP3E_js.bringToFront(els, id) : chunkL2MOKP3E_js.sendToBack(els, id)
|
|
6370
6370
|
);
|
|
6371
6371
|
history.markDirty();
|
|
6372
6372
|
};
|
|
@@ -6501,7 +6501,7 @@ function useSlideManagement(input) {
|
|
|
6501
6501
|
} = input;
|
|
6502
6502
|
const handleAddSlideAfter = (afterIndex) => {
|
|
6503
6503
|
const insertAt = Math.max(0, Math.min(afterIndex + 1, slides.length));
|
|
6504
|
-
const newSlide =
|
|
6504
|
+
const newSlide = chunkL2MOKP3E_js.createBlankSlide(slides.length + 1);
|
|
6505
6505
|
ops.updateSlides((prev) => {
|
|
6506
6506
|
const next = [...prev];
|
|
6507
6507
|
next.splice(insertAt, 0, newSlide);
|
|
@@ -6565,7 +6565,7 @@ function useSlideManagement(input) {
|
|
|
6565
6565
|
}
|
|
6566
6566
|
const clone = {
|
|
6567
6567
|
...src,
|
|
6568
|
-
id:
|
|
6568
|
+
id: chunkL2MOKP3E_js.makeSlideId(),
|
|
6569
6569
|
elements: src.elements.map((el) => ({
|
|
6570
6570
|
...el,
|
|
6571
6571
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6597,7 +6597,7 @@ function useSlideManagement(input) {
|
|
|
6597
6597
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6598
6598
|
const insertAt = activeSlideIndex + 1;
|
|
6599
6599
|
const draft = {
|
|
6600
|
-
...
|
|
6600
|
+
...chunkL2MOKP3E_js.createBlankSlide(slides.length + 1),
|
|
6601
6601
|
layoutPath,
|
|
6602
6602
|
...layoutName ? { layoutName } : {}
|
|
6603
6603
|
};
|
|
@@ -6630,9 +6630,9 @@ function useSlideManagement(input) {
|
|
|
6630
6630
|
};
|
|
6631
6631
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6632
6632
|
const insertAt = activeSlideIndex + 1;
|
|
6633
|
-
const draft =
|
|
6633
|
+
const draft = chunkL2MOKP3E_js.buildSlideTemplateSlide(templateId, chunkL2MOKP3E_js.makeSlideId(), slides.length + 1, {
|
|
6634
6634
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6635
|
-
scheme:
|
|
6635
|
+
scheme: chunkL2MOKP3E_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6636
6636
|
});
|
|
6637
6637
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6638
6638
|
setActiveSlideIndex(insertAt);
|
|
@@ -6670,7 +6670,7 @@ function createTableMergeHandlers(input) {
|
|
|
6670
6670
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6671
6671
|
return;
|
|
6672
6672
|
}
|
|
6673
|
-
const newTableData =
|
|
6673
|
+
const newTableData = chunkL2MOKP3E_js.mergeCells(
|
|
6674
6674
|
[
|
|
6675
6675
|
{ row: rowIndex, col: columnIndex },
|
|
6676
6676
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6678,7 +6678,7 @@ function createTableMergeHandlers(input) {
|
|
|
6678
6678
|
td
|
|
6679
6679
|
);
|
|
6680
6680
|
const updates = { tableData: newTableData };
|
|
6681
|
-
const newRawXml =
|
|
6681
|
+
const newRawXml = chunkL2MOKP3E_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6682
6682
|
if (newRawXml) {
|
|
6683
6683
|
updates.rawXml = newRawXml;
|
|
6684
6684
|
}
|
|
@@ -6704,7 +6704,7 @@ function createTableMergeHandlers(input) {
|
|
|
6704
6704
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6705
6705
|
return;
|
|
6706
6706
|
}
|
|
6707
|
-
const newTableData =
|
|
6707
|
+
const newTableData = chunkL2MOKP3E_js.mergeCells(
|
|
6708
6708
|
[
|
|
6709
6709
|
{ row: rowIndex, col: columnIndex },
|
|
6710
6710
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6712,7 +6712,7 @@ function createTableMergeHandlers(input) {
|
|
|
6712
6712
|
td
|
|
6713
6713
|
);
|
|
6714
6714
|
const updates = { tableData: newTableData };
|
|
6715
|
-
const newRawXml =
|
|
6715
|
+
const newRawXml = chunkL2MOKP3E_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6716
6716
|
if (newRawXml) {
|
|
6717
6717
|
updates.rawXml = newRawXml;
|
|
6718
6718
|
}
|
|
@@ -6727,9 +6727,9 @@ function createTableMergeHandlers(input) {
|
|
|
6727
6727
|
return;
|
|
6728
6728
|
}
|
|
6729
6729
|
const td = selectedElement.tableData;
|
|
6730
|
-
const newTableData =
|
|
6730
|
+
const newTableData = chunkL2MOKP3E_js.mergeCells(ts.selectedCells, td);
|
|
6731
6731
|
const updates = { tableData: newTableData };
|
|
6732
|
-
const newRawXml =
|
|
6732
|
+
const newRawXml = chunkL2MOKP3E_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6733
6733
|
if (newRawXml) {
|
|
6734
6734
|
updates.rawXml = newRawXml;
|
|
6735
6735
|
}
|
|
@@ -6746,9 +6746,9 @@ function createTableMergeHandlers(input) {
|
|
|
6746
6746
|
}
|
|
6747
6747
|
const { rowIndex, columnIndex } = ts;
|
|
6748
6748
|
const td = selectedElement.tableData;
|
|
6749
|
-
const newTableData =
|
|
6749
|
+
const newTableData = chunkL2MOKP3E_js.splitCell(rowIndex, columnIndex, td);
|
|
6750
6750
|
const updates = { tableData: newTableData };
|
|
6751
|
-
const newRawXml =
|
|
6751
|
+
const newRawXml = chunkL2MOKP3E_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6752
6752
|
if (newRawXml) {
|
|
6753
6753
|
updates.rawXml = newRawXml;
|
|
6754
6754
|
}
|
|
@@ -6782,10 +6782,10 @@ function createTableStructHandlers(input) {
|
|
|
6782
6782
|
const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
|
|
6783
6783
|
const updates = {};
|
|
6784
6784
|
if (el.tableData) {
|
|
6785
|
-
updates.tableData =
|
|
6785
|
+
updates.tableData = chunkL2MOKP3E_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6786
6786
|
}
|
|
6787
6787
|
if (el.rawXml) {
|
|
6788
|
-
const newRawXml =
|
|
6788
|
+
const newRawXml = chunkL2MOKP3E_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6789
6789
|
if (newRawXml) {
|
|
6790
6790
|
updates.rawXml = newRawXml;
|
|
6791
6791
|
}
|
|
@@ -6809,7 +6809,7 @@ function createTableStructHandlers(input) {
|
|
|
6809
6809
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6810
6810
|
const updates = {};
|
|
6811
6811
|
if (selectedElement.rawXml) {
|
|
6812
|
-
const newRawXml =
|
|
6812
|
+
const newRawXml = chunkL2MOKP3E_js.updateCellTextStyleInRawXml(
|
|
6813
6813
|
selectedElement,
|
|
6814
6814
|
rowIndex,
|
|
6815
6815
|
colIndex,
|
|
@@ -6873,31 +6873,20 @@ function createTableStructHandlers(input) {
|
|
|
6873
6873
|
return;
|
|
6874
6874
|
}
|
|
6875
6875
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6876
|
-
const
|
|
6877
|
-
|
|
6878
|
-
const newRawXml = chunk5KAMDV37_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6879
|
-
if (newRawXml) {
|
|
6880
|
-
updates.rawXml = newRawXml;
|
|
6881
|
-
}
|
|
6882
|
-
ops.updateSelectedElement(updates);
|
|
6876
|
+
const next = chunkL2MOKP3E_js.insertTableElementRow(selectedElement, rowIdx, position);
|
|
6877
|
+
ops.updateSelectedElement({ tableData: next.tableData, rawXml: next.rawXml });
|
|
6883
6878
|
history.markDirty();
|
|
6884
6879
|
};
|
|
6885
6880
|
const handleDeleteTableRow = () => {
|
|
6886
6881
|
if (!selectedElement || selectedElement.type !== "table" || !selectedElement.tableData) {
|
|
6887
6882
|
return;
|
|
6888
6883
|
}
|
|
6889
|
-
const td = selectedElement.tableData;
|
|
6890
6884
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6891
|
-
const
|
|
6892
|
-
if (
|
|
6885
|
+
const next = chunkL2MOKP3E_js.removeTableElementRow(selectedElement, rowIdx);
|
|
6886
|
+
if (next === selectedElement) {
|
|
6893
6887
|
return;
|
|
6894
6888
|
}
|
|
6895
|
-
|
|
6896
|
-
const newRawXml = chunk5KAMDV37_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6897
|
-
if (newRawXml) {
|
|
6898
|
-
updates.rawXml = newRawXml;
|
|
6899
|
-
}
|
|
6900
|
-
ops.updateSelectedElement(updates);
|
|
6889
|
+
ops.updateSelectedElement({ tableData: next.tableData, rawXml: next.rawXml });
|
|
6901
6890
|
history.markDirty();
|
|
6902
6891
|
};
|
|
6903
6892
|
const handleInsertTableColumn = (position) => {
|
|
@@ -6905,31 +6894,20 @@ function createTableStructHandlers(input) {
|
|
|
6905
6894
|
return;
|
|
6906
6895
|
}
|
|
6907
6896
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6908
|
-
const
|
|
6909
|
-
|
|
6910
|
-
const newRawXml = chunk5KAMDV37_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6911
|
-
if (newRawXml) {
|
|
6912
|
-
updates.rawXml = newRawXml;
|
|
6913
|
-
}
|
|
6914
|
-
ops.updateSelectedElement(updates);
|
|
6897
|
+
const next = chunkL2MOKP3E_js.insertTableElementColumn(selectedElement, colIdx, position);
|
|
6898
|
+
ops.updateSelectedElement({ tableData: next.tableData, rawXml: next.rawXml });
|
|
6915
6899
|
history.markDirty();
|
|
6916
6900
|
};
|
|
6917
6901
|
const handleDeleteTableColumn = () => {
|
|
6918
6902
|
if (!selectedElement || selectedElement.type !== "table" || !selectedElement.tableData) {
|
|
6919
6903
|
return;
|
|
6920
6904
|
}
|
|
6921
|
-
const td = selectedElement.tableData;
|
|
6922
6905
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6923
|
-
const
|
|
6924
|
-
if (
|
|
6906
|
+
const next = chunkL2MOKP3E_js.removeTableElementColumn(selectedElement, colIdx);
|
|
6907
|
+
if (next === selectedElement) {
|
|
6925
6908
|
return;
|
|
6926
6909
|
}
|
|
6927
|
-
|
|
6928
|
-
const newRawXml = chunk5KAMDV37_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6929
|
-
if (newRawXml) {
|
|
6930
|
-
updates.rawXml = newRawXml;
|
|
6931
|
-
}
|
|
6932
|
-
ops.updateSelectedElement(updates);
|
|
6910
|
+
ops.updateSelectedElement({ tableData: next.tableData, rawXml: next.rawXml });
|
|
6933
6911
|
history.markDirty();
|
|
6934
6912
|
};
|
|
6935
6913
|
return {
|
|
@@ -6961,8 +6939,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6961
6939
|
return html2canvasPro(element, {
|
|
6962
6940
|
...options,
|
|
6963
6941
|
onclone: async (doc, clonedEl) => {
|
|
6964
|
-
await
|
|
6965
|
-
|
|
6942
|
+
await chunkL2MOKP3E_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6943
|
+
chunkL2MOKP3E_js.preprocessCssForCapture(clonedEl);
|
|
6966
6944
|
if (typeof userOnClone === "function") {
|
|
6967
6945
|
userOnClone(doc, clonedEl);
|
|
6968
6946
|
}
|
|
@@ -6992,7 +6970,7 @@ function useExportSaveAs(input) {
|
|
|
6992
6970
|
slideSizeEmu
|
|
6993
6971
|
} = input;
|
|
6994
6972
|
const handleSaveAsFormat = async (format) => {
|
|
6995
|
-
const downloadName =
|
|
6973
|
+
const downloadName = chunkL2MOKP3E_js.savedPresentationFileName(filePath, format);
|
|
6996
6974
|
try {
|
|
6997
6975
|
const data = await serializeSlides(format);
|
|
6998
6976
|
if (!data) {
|
|
@@ -7000,16 +6978,16 @@ function useExportSaveAs(input) {
|
|
|
7000
6978
|
}
|
|
7001
6979
|
const mimeType = format === "ppt" ? "application/vnd.ms-powerpoint" : "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
7002
6980
|
const blob = new Blob([data], { type: mimeType });
|
|
7003
|
-
|
|
6981
|
+
chunkL2MOKP3E_js.downloadBlob(blob, downloadName);
|
|
7004
6982
|
} catch (err) {
|
|
7005
6983
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
7006
6984
|
}
|
|
7007
6985
|
};
|
|
7008
6986
|
const handleExportJson = () => {
|
|
7009
6987
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7010
|
-
const slideSize =
|
|
6988
|
+
const slideSize = chunkL2MOKP3E_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7011
6989
|
const data = {
|
|
7012
|
-
slides:
|
|
6990
|
+
slides: chunkL2MOKP3E_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7013
6991
|
width: canvasSize.width,
|
|
7014
6992
|
height: canvasSize.height,
|
|
7015
6993
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7028,7 +7006,7 @@ function useExportSaveAs(input) {
|
|
|
7028
7006
|
handoutMaster
|
|
7029
7007
|
};
|
|
7030
7008
|
try {
|
|
7031
|
-
|
|
7009
|
+
chunkL2MOKP3E_js.exportDeckJson(data, sourceName);
|
|
7032
7010
|
} catch (err) {
|
|
7033
7011
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7034
7012
|
}
|
|
@@ -7093,7 +7071,7 @@ function buildRasterOptions(element, scale, backgroundColor, mode) {
|
|
|
7093
7071
|
}
|
|
7094
7072
|
async function renderElementToRaster(element, scale = 2, backgroundColor, mode = "auto") {
|
|
7095
7073
|
const { width, height } = measureNaturalSize(element);
|
|
7096
|
-
return
|
|
7074
|
+
return chunkL2MOKP3E_js.rasterizeElement(
|
|
7097
7075
|
element,
|
|
7098
7076
|
width,
|
|
7099
7077
|
height,
|
|
@@ -7103,7 +7081,7 @@ async function renderElementToRaster(element, scale = 2, backgroundColor, mode =
|
|
|
7103
7081
|
}
|
|
7104
7082
|
async function renderElementToTiles(element, scale = 2, backgroundColor, mode = "auto") {
|
|
7105
7083
|
const { width, height } = measureNaturalSize(element);
|
|
7106
|
-
return
|
|
7084
|
+
return chunkL2MOKP3E_js.rasterizeElementTiles(
|
|
7107
7085
|
element,
|
|
7108
7086
|
width,
|
|
7109
7087
|
height,
|
|
@@ -7113,7 +7091,7 @@ async function renderElementToTiles(element, scale = 2, backgroundColor, mode =
|
|
|
7113
7091
|
}
|
|
7114
7092
|
async function renderElementToTiledCanvas(element, scale = 2, backgroundColor, mode = "auto") {
|
|
7115
7093
|
const { width, height } = measureNaturalSize(element);
|
|
7116
|
-
return
|
|
7094
|
+
return chunkL2MOKP3E_js.rasterizeElementTiledToCanvas(
|
|
7117
7095
|
element,
|
|
7118
7096
|
width,
|
|
7119
7097
|
height,
|
|
@@ -7135,11 +7113,11 @@ function waitForRender(ms = 100) {
|
|
|
7135
7113
|
async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
7136
7114
|
const { scale = 2, backgroundColor } = options;
|
|
7137
7115
|
const result = await renderElementToRaster(slideElement, scale, backgroundColor);
|
|
7138
|
-
return
|
|
7116
|
+
return chunkL2MOKP3E_js.rasterResultToPngBlob(result);
|
|
7139
7117
|
}
|
|
7140
7118
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
7141
7119
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
7142
|
-
|
|
7120
|
+
chunkL2MOKP3E_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
7143
7121
|
}
|
|
7144
7122
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
7145
7123
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -7168,13 +7146,13 @@ async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActi
|
|
|
7168
7146
|
// src/viewer/utils/export-pdf.ts
|
|
7169
7147
|
function tilesToPdfPage(tilesResult) {
|
|
7170
7148
|
return tilesResult.tiles.map((tile) => ({
|
|
7171
|
-
image:
|
|
7172
|
-
placement:
|
|
7149
|
+
image: chunkL2MOKP3E_js.canvasToJpegData(tile.canvas),
|
|
7150
|
+
placement: chunkL2MOKP3E_js.placeTileOnPage(
|
|
7173
7151
|
tile,
|
|
7174
7152
|
tilesResult.fullWidth,
|
|
7175
7153
|
tilesResult.fullHeight,
|
|
7176
|
-
|
|
7177
|
-
|
|
7154
|
+
chunkL2MOKP3E_js.PDF_SLIDES_PAGE_WIDTH_PT,
|
|
7155
|
+
chunkL2MOKP3E_js.PDF_SLIDES_PAGE_HEIGHT_PT
|
|
7178
7156
|
)
|
|
7179
7157
|
}));
|
|
7180
7158
|
}
|
|
@@ -7201,8 +7179,8 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7201
7179
|
if (pages.length === 0) {
|
|
7202
7180
|
throw new Error(chunk3AJ54EAB_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7203
7181
|
}
|
|
7204
|
-
const pdfBlobUrl =
|
|
7205
|
-
|
|
7182
|
+
const pdfBlobUrl = chunkW5W75MFP_js.buildPdfFromTiledImageData(pages);
|
|
7183
|
+
chunkL2MOKP3E_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
7206
7184
|
}
|
|
7207
7185
|
async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, slideNotes, filename = "presentation-notes.pdf", options = {}) {
|
|
7208
7186
|
const { scale = 2, onProgress, signal } = options;
|
|
@@ -7231,8 +7209,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7231
7209
|
if (pages.length === 0) {
|
|
7232
7210
|
throw new Error(chunk3AJ54EAB_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7233
7211
|
}
|
|
7234
|
-
const pdfDataUrl =
|
|
7235
|
-
|
|
7212
|
+
const pdfDataUrl = chunkW5W75MFP_js.buildNotesPdf(pages);
|
|
7213
|
+
chunkL2MOKP3E_js.downloadDataUrl(pdfDataUrl, filename);
|
|
7236
7214
|
}
|
|
7237
7215
|
|
|
7238
7216
|
// src/viewer/utils/export-video.ts
|
|
@@ -7276,7 +7254,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7276
7254
|
const fps = 30;
|
|
7277
7255
|
const stream = recordingCanvas.captureStream(fps);
|
|
7278
7256
|
const recorder = new MediaRecorder(stream, {
|
|
7279
|
-
mimeType:
|
|
7257
|
+
mimeType: chunkL2MOKP3E_js.pickSupportedMimeType([...chunkL2MOKP3E_js.WEBM_MIME_CANDIDATES]),
|
|
7280
7258
|
videoBitsPerSecond: 5e6
|
|
7281
7259
|
});
|
|
7282
7260
|
const chunks = [];
|
|
@@ -7299,8 +7277,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7299
7277
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
7300
7278
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
7301
7279
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
7302
|
-
const frameInterval =
|
|
7303
|
-
const framesNeeded =
|
|
7280
|
+
const frameInterval = chunkL2MOKP3E_js.fpsToFrameIntervalMs(fps);
|
|
7281
|
+
const framesNeeded = chunkL2MOKP3E_js.segmentFrameCount(duration, fps);
|
|
7304
7282
|
for (let f = 0; f < framesNeeded; f++) {
|
|
7305
7283
|
if (signal?.aborted) {
|
|
7306
7284
|
recorder.stop();
|
|
@@ -7320,7 +7298,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7320
7298
|
|
|
7321
7299
|
// src/viewer/utils/export-gif.ts
|
|
7322
7300
|
function frameFromCanvas(canvas, maxSide) {
|
|
7323
|
-
const { width, height } =
|
|
7301
|
+
const { width, height } = chunkL2MOKP3E_js.clampGifDimensions(canvas.width, canvas.height, maxSide);
|
|
7324
7302
|
let source = canvas;
|
|
7325
7303
|
if (width !== canvas.width || height !== canvas.height) {
|
|
7326
7304
|
const scaled = canvas.ownerDocument.createElement("canvas");
|
|
@@ -7343,7 +7321,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7343
7321
|
const {
|
|
7344
7322
|
scale = 0.5,
|
|
7345
7323
|
slideDurationMs = 2e3,
|
|
7346
|
-
maxSide =
|
|
7324
|
+
maxSide = chunkL2MOKP3E_js.GIF_POST_CAPTURE_MAX_SIDE,
|
|
7347
7325
|
onProgress,
|
|
7348
7326
|
signal
|
|
7349
7327
|
} = options;
|
|
@@ -7370,7 +7348,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7370
7348
|
if (frames.length === 0) {
|
|
7371
7349
|
throw new Error(chunk3AJ54EAB_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
7372
7350
|
}
|
|
7373
|
-
const gifBytes =
|
|
7351
|
+
const gifBytes = chunkL2MOKP3E_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
7374
7352
|
onProgress?.(totalSlides, totalSlides);
|
|
7375
7353
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
7376
7354
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -7424,7 +7402,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7424
7402
|
continue;
|
|
7425
7403
|
}
|
|
7426
7404
|
onProgress?.(processedCount, data.slides.length);
|
|
7427
|
-
let svg =
|
|
7405
|
+
let svg = chunkL2MOKP3E_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7428
7406
|
if (embedFonts && fontFaces?.length) {
|
|
7429
7407
|
svg = injectFontFaces(svg, fontFaces);
|
|
7430
7408
|
}
|
|
@@ -7476,7 +7454,7 @@ function useExportMediaHandlers(input) {
|
|
|
7476
7454
|
setExportProgress(0);
|
|
7477
7455
|
setExportModalOpen(true);
|
|
7478
7456
|
try {
|
|
7479
|
-
const { scale } =
|
|
7457
|
+
const { scale } = chunkL2MOKP3E_js.resolveExportCaptureDecision(imageResolutionScale, "video");
|
|
7480
7458
|
const blob = await exportAllSlidesAsVideo(
|
|
7481
7459
|
canvasStageRef,
|
|
7482
7460
|
slides.length,
|
|
@@ -7486,22 +7464,22 @@ function useExportMediaHandlers(input) {
|
|
|
7486
7464
|
scale,
|
|
7487
7465
|
slideDurationMs: 3e3,
|
|
7488
7466
|
onProgress: (current, total) => {
|
|
7489
|
-
setExportProgress(
|
|
7490
|
-
setExportStatusMessage(
|
|
7467
|
+
setExportProgress(chunkL2MOKP3E_js.slideProgressPercent(current, total, 45));
|
|
7468
|
+
setExportStatusMessage(chunkL2MOKP3E_js.slideStatusLabel("Capturing", current, total));
|
|
7491
7469
|
},
|
|
7492
7470
|
onRecordProgress: (current, total) => {
|
|
7493
|
-
setExportProgress(
|
|
7494
|
-
setExportStatusMessage(
|
|
7471
|
+
setExportProgress(chunkL2MOKP3E_js.recordProgressPercent(current, total));
|
|
7472
|
+
setExportStatusMessage(chunkL2MOKP3E_js.slideStatusLabel("Recording", current, total));
|
|
7495
7473
|
},
|
|
7496
7474
|
signal: abortCtrl.signal
|
|
7497
7475
|
}
|
|
7498
7476
|
);
|
|
7499
|
-
setExportProgress(
|
|
7477
|
+
setExportProgress(chunkL2MOKP3E_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7500
7478
|
setExportStatusMessage("Saving file...");
|
|
7501
|
-
|
|
7502
|
-
setExportProgress(
|
|
7479
|
+
chunkL2MOKP3E_js.downloadBlob(blob, "presentation.webm");
|
|
7480
|
+
setExportProgress(chunkL2MOKP3E_js.EXPORT_DONE_PERCENT);
|
|
7503
7481
|
} catch (err) {
|
|
7504
|
-
if (!
|
|
7482
|
+
if (!chunkL2MOKP3E_js.isExportAbortError(err)) {
|
|
7505
7483
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7506
7484
|
}
|
|
7507
7485
|
} finally {
|
|
@@ -7531,7 +7509,7 @@ function useExportMediaHandlers(input) {
|
|
|
7531
7509
|
setExportProgress(0);
|
|
7532
7510
|
setExportModalOpen(true);
|
|
7533
7511
|
try {
|
|
7534
|
-
const { scale, postCaptureMaxSide } =
|
|
7512
|
+
const { scale, postCaptureMaxSide } = chunkL2MOKP3E_js.resolveExportCaptureDecision(
|
|
7535
7513
|
imageResolutionScale,
|
|
7536
7514
|
"gif"
|
|
7537
7515
|
);
|
|
@@ -7545,18 +7523,18 @@ function useExportMediaHandlers(input) {
|
|
|
7545
7523
|
maxSide: postCaptureMaxSide,
|
|
7546
7524
|
slideDurationMs: 2e3,
|
|
7547
7525
|
onProgress: (current, total) => {
|
|
7548
|
-
setExportProgress(
|
|
7549
|
-
setExportStatusMessage(
|
|
7526
|
+
setExportProgress(chunkL2MOKP3E_js.slideProgressPercent(current, total));
|
|
7527
|
+
setExportStatusMessage(chunkL2MOKP3E_js.slideStatusLabel("Encoding", current, total));
|
|
7550
7528
|
},
|
|
7551
7529
|
signal: abortCtrl.signal
|
|
7552
7530
|
}
|
|
7553
7531
|
);
|
|
7554
|
-
setExportProgress(
|
|
7532
|
+
setExportProgress(chunkL2MOKP3E_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7555
7533
|
setExportStatusMessage("Saving file...");
|
|
7556
|
-
|
|
7557
|
-
setExportProgress(
|
|
7534
|
+
chunkL2MOKP3E_js.downloadBlob(blob, "presentation.gif");
|
|
7535
|
+
setExportProgress(chunkL2MOKP3E_js.EXPORT_DONE_PERCENT);
|
|
7558
7536
|
} catch (err) {
|
|
7559
|
-
if (!
|
|
7537
|
+
if (!chunkL2MOKP3E_js.isExportAbortError(err)) {
|
|
7560
7538
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7561
7539
|
}
|
|
7562
7540
|
} finally {
|
|
@@ -7682,21 +7660,21 @@ function useExportHandlers(input) {
|
|
|
7682
7660
|
{
|
|
7683
7661
|
scale: imageExportScale,
|
|
7684
7662
|
onProgress: (current, total) => {
|
|
7685
|
-
setExportProgress(
|
|
7686
|
-
setExportStatusMessage(
|
|
7663
|
+
setExportProgress(chunkL2MOKP3E_js.slideProgressPercent(current, total));
|
|
7664
|
+
setExportStatusMessage(chunkL2MOKP3E_js.slideStatusLabel("Rendering", current, total));
|
|
7687
7665
|
},
|
|
7688
7666
|
signal: abortCtrl.signal
|
|
7689
7667
|
}
|
|
7690
7668
|
);
|
|
7691
|
-
setExportProgress(
|
|
7669
|
+
setExportProgress(chunkL2MOKP3E_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7692
7670
|
setExportStatusMessage("Building PDF...");
|
|
7693
7671
|
await new Promise((r) => {
|
|
7694
7672
|
setTimeout(r, 100);
|
|
7695
7673
|
});
|
|
7696
|
-
setExportProgress(
|
|
7674
|
+
setExportProgress(chunkL2MOKP3E_js.EXPORT_DONE_PERCENT);
|
|
7697
7675
|
setExportStatusMessage("Done!");
|
|
7698
7676
|
} catch (err) {
|
|
7699
|
-
if (!
|
|
7677
|
+
if (!chunkL2MOKP3E_js.isExportAbortError(err)) {
|
|
7700
7678
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7701
7679
|
}
|
|
7702
7680
|
} finally {
|
|
@@ -7726,21 +7704,21 @@ function useExportHandlers(input) {
|
|
|
7726
7704
|
{
|
|
7727
7705
|
scale: imageExportScale,
|
|
7728
7706
|
onProgress: (current, total) => {
|
|
7729
|
-
setExportProgress(
|
|
7730
|
-
setExportStatusMessage(
|
|
7707
|
+
setExportProgress(chunkL2MOKP3E_js.slideProgressPercent(current, total));
|
|
7708
|
+
setExportStatusMessage(chunkL2MOKP3E_js.slideStatusLabel("Rendering", current, total));
|
|
7731
7709
|
},
|
|
7732
7710
|
signal: abortCtrl.signal
|
|
7733
7711
|
}
|
|
7734
7712
|
);
|
|
7735
|
-
setExportProgress(
|
|
7713
|
+
setExportProgress(chunkL2MOKP3E_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7736
7714
|
setExportStatusMessage("Building PDF...");
|
|
7737
7715
|
await new Promise((r) => {
|
|
7738
7716
|
setTimeout(r, 100);
|
|
7739
7717
|
});
|
|
7740
|
-
setExportProgress(
|
|
7718
|
+
setExportProgress(chunkL2MOKP3E_js.EXPORT_DONE_PERCENT);
|
|
7741
7719
|
setExportStatusMessage("Done!");
|
|
7742
7720
|
} catch (err) {
|
|
7743
|
-
if (!
|
|
7721
|
+
if (!chunkL2MOKP3E_js.isExportAbortError(err)) {
|
|
7744
7722
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7745
7723
|
}
|
|
7746
7724
|
} finally {
|
|
@@ -7788,7 +7766,7 @@ function useExportHandlers(input) {
|
|
|
7788
7766
|
exportStatusMessage
|
|
7789
7767
|
};
|
|
7790
7768
|
}
|
|
7791
|
-
var ViewerOptionsContext = react.createContext(
|
|
7769
|
+
var ViewerOptionsContext = react.createContext(chunkL2MOKP3E_js.DEFAULT_VIEWER_OPTIONS);
|
|
7792
7770
|
function useViewerOptionsContext() {
|
|
7793
7771
|
return react.useContext(ViewerOptionsContext);
|
|
7794
7772
|
}
|
|
@@ -7800,13 +7778,13 @@ function usePrintHandlers(input) {
|
|
|
7800
7778
|
const { t } = reactI18next.useTranslation();
|
|
7801
7779
|
const viewerOptions = useViewerOptionsContext();
|
|
7802
7780
|
const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
|
|
7803
|
-
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) *
|
|
7781
|
+
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunkL2MOKP3E_js.resolveImageResolutionScale(viewerOptions);
|
|
7804
7782
|
const handlePrint = () => {
|
|
7805
7783
|
setIsPrintDialogOpen(true);
|
|
7806
7784
|
};
|
|
7807
7785
|
const handlePrintSvg = async (settings) => {
|
|
7808
7786
|
setIsPrintDialogOpen(false);
|
|
7809
|
-
const printWindow =
|
|
7787
|
+
const printWindow = chunkL2MOKP3E_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7810
7788
|
if (!printWindow) {
|
|
7811
7789
|
console.warn(
|
|
7812
7790
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7816,9 +7794,9 @@ function usePrintHandlers(input) {
|
|
|
7816
7794
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7817
7795
|
return runRasterPrint(printWindow, settings);
|
|
7818
7796
|
}
|
|
7819
|
-
const colorFilter =
|
|
7820
|
-
const slideIndices =
|
|
7821
|
-
|
|
7797
|
+
const colorFilter = chunkL2MOKP3E_js.computeColorFilter(settings.colorMode);
|
|
7798
|
+
const slideIndices = chunkL2MOKP3E_js.filterHiddenSlideIndices(
|
|
7799
|
+
chunkL2MOKP3E_js.computeSlideIndices(
|
|
7822
7800
|
settings.slideRange,
|
|
7823
7801
|
activeSlideIndex,
|
|
7824
7802
|
slides.length,
|
|
@@ -7836,22 +7814,22 @@ function usePrintHandlers(input) {
|
|
|
7836
7814
|
printWindow.close();
|
|
7837
7815
|
return;
|
|
7838
7816
|
}
|
|
7839
|
-
const printDoc =
|
|
7817
|
+
const printDoc = chunkL2MOKP3E_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7840
7818
|
title: "Slides (Vector)",
|
|
7841
7819
|
orientation: settings.orientation,
|
|
7842
7820
|
colorFilter,
|
|
7843
7821
|
scaleToFit: settings.scaleToFit
|
|
7844
7822
|
});
|
|
7845
|
-
|
|
7823
|
+
chunkL2MOKP3E_js.finishPrintWindow(printWindow, printDoc);
|
|
7846
7824
|
} catch (err) {
|
|
7847
7825
|
console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
|
|
7848
7826
|
return runRasterPrint(printWindow, settings);
|
|
7849
7827
|
}
|
|
7850
7828
|
};
|
|
7851
7829
|
const runRasterPrint = async (printWindow, settings) => {
|
|
7852
|
-
const colorFilter =
|
|
7853
|
-
const slideIndices =
|
|
7854
|
-
|
|
7830
|
+
const colorFilter = chunkL2MOKP3E_js.computeColorFilter(settings.colorMode);
|
|
7831
|
+
const slideIndices = chunkL2MOKP3E_js.filterHiddenSlideIndices(
|
|
7832
|
+
chunkL2MOKP3E_js.computeSlideIndices(
|
|
7855
7833
|
settings.slideRange,
|
|
7856
7834
|
activeSlideIndex,
|
|
7857
7835
|
slides.length,
|
|
@@ -7862,11 +7840,11 @@ function usePrintHandlers(input) {
|
|
|
7862
7840
|
includeHiddenSlides
|
|
7863
7841
|
);
|
|
7864
7842
|
if (settings.printWhat === "outline") {
|
|
7865
|
-
|
|
7843
|
+
chunkL2MOKP3E_js.finishPrintWindow(
|
|
7866
7844
|
printWindow,
|
|
7867
|
-
|
|
7845
|
+
chunkL2MOKP3E_js.buildPrintHtmlDocument({
|
|
7868
7846
|
title: "Outline",
|
|
7869
|
-
bodyHtml: `<div class="outline-page">${
|
|
7847
|
+
bodyHtml: `<div class="outline-page">${chunkL2MOKP3E_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7870
7848
|
orientation: settings.orientation,
|
|
7871
7849
|
colorFilter,
|
|
7872
7850
|
frameSlides: settings.frameSlides,
|
|
@@ -7893,11 +7871,11 @@ function usePrintHandlers(input) {
|
|
|
7893
7871
|
}
|
|
7894
7872
|
const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
|
|
7895
7873
|
if (settings.printWhat === "slides") {
|
|
7896
|
-
|
|
7874
|
+
chunkL2MOKP3E_js.finishPrintWindow(
|
|
7897
7875
|
printWindow,
|
|
7898
|
-
|
|
7876
|
+
chunkL2MOKP3E_js.buildPrintHtmlDocument({
|
|
7899
7877
|
title: "Slides",
|
|
7900
|
-
bodyHtml:
|
|
7878
|
+
bodyHtml: chunkL2MOKP3E_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7901
7879
|
orientation: settings.orientation,
|
|
7902
7880
|
colorFilter,
|
|
7903
7881
|
frameSlides: settings.frameSlides,
|
|
@@ -7907,11 +7885,11 @@ function usePrintHandlers(input) {
|
|
|
7907
7885
|
return;
|
|
7908
7886
|
}
|
|
7909
7887
|
if (settings.printWhat === "notes") {
|
|
7910
|
-
|
|
7888
|
+
chunkL2MOKP3E_js.finishPrintWindow(
|
|
7911
7889
|
printWindow,
|
|
7912
|
-
|
|
7890
|
+
chunkL2MOKP3E_js.buildPrintHtmlDocument({
|
|
7913
7891
|
title: "Notes Pages",
|
|
7914
|
-
bodyHtml:
|
|
7892
|
+
bodyHtml: chunkL2MOKP3E_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7915
7893
|
orientation: "portrait",
|
|
7916
7894
|
colorFilter,
|
|
7917
7895
|
frameSlides: settings.frameSlides,
|
|
@@ -7922,11 +7900,11 @@ function usePrintHandlers(input) {
|
|
|
7922
7900
|
}
|
|
7923
7901
|
if (settings.printWhat === "handouts") {
|
|
7924
7902
|
const spp = settings.slidesPerPage;
|
|
7925
|
-
|
|
7903
|
+
chunkL2MOKP3E_js.finishPrintWindow(
|
|
7926
7904
|
printWindow,
|
|
7927
|
-
|
|
7905
|
+
chunkL2MOKP3E_js.buildPrintHtmlDocument({
|
|
7928
7906
|
title: `Handout ${spp} per page`,
|
|
7929
|
-
bodyHtml:
|
|
7907
|
+
bodyHtml: chunkL2MOKP3E_js.buildHandoutsHtml(slideImages, slideIndices, spp, pptxData?.handoutMaster),
|
|
7930
7908
|
orientation: "portrait",
|
|
7931
7909
|
colorFilter,
|
|
7932
7910
|
frameSlides: settings.frameSlides,
|
|
@@ -7940,7 +7918,7 @@ function usePrintHandlers(input) {
|
|
|
7940
7918
|
};
|
|
7941
7919
|
const handlePrintWithSettings = async (settings) => {
|
|
7942
7920
|
setIsPrintDialogOpen(false);
|
|
7943
|
-
const printWindow =
|
|
7921
|
+
const printWindow = chunkL2MOKP3E_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7944
7922
|
if (!printWindow) {
|
|
7945
7923
|
console.warn(
|
|
7946
7924
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -8005,13 +7983,13 @@ function useThemeHandlers(input) {
|
|
|
8005
7983
|
return;
|
|
8006
7984
|
}
|
|
8007
7985
|
await handler.updateThemeColorScheme(colorScheme);
|
|
8008
|
-
const previousMap = theme?.colorScheme ?
|
|
8009
|
-
setSlides((prev) =>
|
|
7986
|
+
const previousMap = theme?.colorScheme ? chunkL2MOKP3E_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7987
|
+
setSlides((prev) => chunkL2MOKP3E_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
8010
7988
|
if (Object.keys(templateElementsBySlideId).length > 0) {
|
|
8011
7989
|
setTemplateElementsBySlideId((prev) => {
|
|
8012
7990
|
const next = {};
|
|
8013
7991
|
for (const [slideId, elements] of Object.entries(prev)) {
|
|
8014
|
-
next[slideId] =
|
|
7992
|
+
next[slideId] = chunkL2MOKP3E_js.reResolveElementColors(elements, previousMap, colorScheme);
|
|
8015
7993
|
}
|
|
8016
7994
|
return next;
|
|
8017
7995
|
});
|
|
@@ -8120,7 +8098,7 @@ function useThemeSwitching(input) {
|
|
|
8120
8098
|
}
|
|
8121
8099
|
try {
|
|
8122
8100
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
8123
|
-
const newData =
|
|
8101
|
+
const newData = chunkL2MOKP3E_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
8124
8102
|
onDataChange(newData);
|
|
8125
8103
|
onThemeChanged?.(preset);
|
|
8126
8104
|
} catch (error) {
|
|
@@ -8137,7 +8115,7 @@ function useThemeSwitching(input) {
|
|
|
8137
8115
|
}
|
|
8138
8116
|
try {
|
|
8139
8117
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
8140
|
-
const newData =
|
|
8118
|
+
const newData = chunkL2MOKP3E_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
8141
8119
|
onDataChange(newData);
|
|
8142
8120
|
} catch (error) {
|
|
8143
8121
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -8149,12 +8127,12 @@ function useThemeSwitching(input) {
|
|
|
8149
8127
|
if (!data?.theme?.colorScheme) {
|
|
8150
8128
|
return void 0;
|
|
8151
8129
|
}
|
|
8152
|
-
return
|
|
8153
|
-
(p) =>
|
|
8130
|
+
return chunkL2MOKP3E_js.THEME_PRESETS.find(
|
|
8131
|
+
(p) => chunkL2MOKP3E_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
8154
8132
|
);
|
|
8155
8133
|
}, [data?.theme?.colorScheme]);
|
|
8156
8134
|
return {
|
|
8157
|
-
presets:
|
|
8135
|
+
presets: chunkL2MOKP3E_js.THEME_PRESETS,
|
|
8158
8136
|
switchToPreset,
|
|
8159
8137
|
switchToCustom,
|
|
8160
8138
|
currentPreset
|
|
@@ -8229,7 +8207,7 @@ function usePropertyHandlers(input) {
|
|
|
8229
8207
|
}
|
|
8230
8208
|
try {
|
|
8231
8209
|
const ab = await file.arrayBuffer();
|
|
8232
|
-
const h = new
|
|
8210
|
+
const h = new chunkL2MOKP3E_js.PptxHandler();
|
|
8233
8211
|
const other = await h.load(ab);
|
|
8234
8212
|
if (!other) {
|
|
8235
8213
|
return;
|
|
@@ -8239,7 +8217,7 @@ function usePropertyHandlers(input) {
|
|
|
8239
8217
|
width: canvasSize.width,
|
|
8240
8218
|
height: canvasSize.height
|
|
8241
8219
|
};
|
|
8242
|
-
setCompareResult(
|
|
8220
|
+
setCompareResult(chunkL2MOKP3E_js.comparePresentation(cur, other));
|
|
8243
8221
|
setIsComparePanelOpen(true);
|
|
8244
8222
|
} catch (err) {
|
|
8245
8223
|
console.warn("Compare failed:", err);
|
|
@@ -8256,7 +8234,7 @@ function usePropertyHandlers(input) {
|
|
|
8256
8234
|
if (!diff || diff.status === "unchanged") {
|
|
8257
8235
|
return;
|
|
8258
8236
|
}
|
|
8259
|
-
setSlides((prev) =>
|
|
8237
|
+
setSlides((prev) => chunkL2MOKP3E_js.applyAcceptSlide(prev, diff));
|
|
8260
8238
|
setIsDirty(true);
|
|
8261
8239
|
},
|
|
8262
8240
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -8267,10 +8245,10 @@ function usePropertyHandlers(input) {
|
|
|
8267
8245
|
if (!compareResult) {
|
|
8268
8246
|
return;
|
|
8269
8247
|
}
|
|
8270
|
-
setSlides((prev) =>
|
|
8248
|
+
setSlides((prev) => chunkL2MOKP3E_js.applyAcceptAllSlides(prev, compareResult));
|
|
8271
8249
|
setIsDirty(true);
|
|
8272
8250
|
}, [compareResult, setSlides, setIsDirty]);
|
|
8273
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
8251
|
+
const usedFontFamilies = react.useMemo(() => chunkL2MOKP3E_js.collectUsedFonts(slides), [slides]);
|
|
8274
8252
|
return {
|
|
8275
8253
|
handleUpdateNotes,
|
|
8276
8254
|
handleUpdateSlide,
|
|
@@ -8425,7 +8403,7 @@ function useViewerDialogs(input) {
|
|
|
8425
8403
|
);
|
|
8426
8404
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8427
8405
|
const fontEmbedding = react.useMemo(
|
|
8428
|
-
() =>
|
|
8406
|
+
() => chunkL2MOKP3E_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8429
8407
|
[embeddedFontKey]
|
|
8430
8408
|
);
|
|
8431
8409
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8435,11 +8413,11 @@ function useViewerDialogs(input) {
|
|
|
8435
8413
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8436
8414
|
}
|
|
8437
8415
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8438
|
-
() => typeof window !== "undefined" ?
|
|
8416
|
+
() => typeof window !== "undefined" ? chunkL2MOKP3E_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8439
8417
|
);
|
|
8440
8418
|
react.useEffect(() => {
|
|
8441
8419
|
const handleWindow = () => setIsNarrowViewport(
|
|
8442
|
-
|
|
8420
|
+
chunkL2MOKP3E_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8443
8421
|
);
|
|
8444
8422
|
window.addEventListener("resize", handleWindow);
|
|
8445
8423
|
return () => window.removeEventListener("resize", handleWindow);
|
|
@@ -8592,16 +8570,16 @@ function useViewerDialogs(input) {
|
|
|
8592
8570
|
};
|
|
8593
8571
|
}
|
|
8594
8572
|
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8595
|
-
return
|
|
8573
|
+
return chunkL2MOKP3E_js.computeGridSpacingPx(documentGridSpacing, chunkW5W75MFP_js.GRID_SIZE);
|
|
8596
8574
|
}
|
|
8597
8575
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
8598
8576
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8599
|
-
const authoredRange =
|
|
8600
|
-
return
|
|
8577
|
+
const authoredRange = chunkL2MOKP3E_js.resolveAuthoredSlideRange(presentationProperties, slides.length);
|
|
8578
|
+
return chunkL2MOKP3E_js.resolveShowSlideIndexes(slides, activeShow, authoredRange);
|
|
8601
8579
|
}
|
|
8602
8580
|
function computeSlideSectionGroups(slides, sections) {
|
|
8603
|
-
return
|
|
8604
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8581
|
+
return chunkL2MOKP3E_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8582
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkW5W75MFP_js.UNGROUPED_SECTION_ID : chunkW5W75MFP_js.DEFAULT_SECTION_GROUP_ID),
|
|
8605
8583
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8606
8584
|
slideIndexes: group.slideIndexes,
|
|
8607
8585
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8613,7 +8591,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8613
8591
|
return void 0;
|
|
8614
8592
|
}
|
|
8615
8593
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8616
|
-
return
|
|
8594
|
+
return chunkL2MOKP3E_js.masterViewPseudoSlide(document2, {
|
|
8617
8595
|
tab: "slides",
|
|
8618
8596
|
masterIndex: 0,
|
|
8619
8597
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8641,15 +8619,15 @@ function useDerivedSlideState(input) {
|
|
|
8641
8619
|
[slides, activeCustomShowId, customShows, presentationProperties]
|
|
8642
8620
|
);
|
|
8643
8621
|
const authoredRange = react.useMemo(
|
|
8644
|
-
() =>
|
|
8622
|
+
() => chunkL2MOKP3E_js.resolveAuthoredSlideRange(presentationProperties, slides.length),
|
|
8645
8623
|
[presentationProperties, slides.length]
|
|
8646
8624
|
);
|
|
8647
8625
|
const slideSectionGroups = react.useMemo(
|
|
8648
8626
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8649
|
-
if (group.id ===
|
|
8627
|
+
if (group.id === chunkW5W75MFP_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8650
8628
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8651
8629
|
}
|
|
8652
|
-
if (group.id ===
|
|
8630
|
+
if (group.id === chunkW5W75MFP_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8653
8631
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8654
8632
|
}
|
|
8655
8633
|
return group;
|
|
@@ -8750,13 +8728,13 @@ function useAnnotationHandlers(input) {
|
|
|
8750
8728
|
}, [annotations, setMode, setSlides, history]);
|
|
8751
8729
|
const handleSetMode = react.useCallback(
|
|
8752
8730
|
(nextMode) => {
|
|
8753
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8731
|
+
if (mode === "present" && nextMode !== "present" && !chunkL2MOKP3E_js.mayLeaveSlideShow()) {
|
|
8754
8732
|
return;
|
|
8755
8733
|
}
|
|
8756
8734
|
if (nextMode === "present") {
|
|
8757
8735
|
presentation.enterPresentMode();
|
|
8758
8736
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8759
|
-
|
|
8737
|
+
chunkL2MOKP3E_js.stopAllPersistentAudio();
|
|
8760
8738
|
if (promptKeepInkAnnotations) {
|
|
8761
8739
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8762
8740
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8766,7 +8744,7 @@ function useAnnotationHandlers(input) {
|
|
|
8766
8744
|
}
|
|
8767
8745
|
} else {
|
|
8768
8746
|
if (mode === "present") {
|
|
8769
|
-
|
|
8747
|
+
chunkL2MOKP3E_js.stopAllPersistentAudio();
|
|
8770
8748
|
}
|
|
8771
8749
|
setMode(nextMode);
|
|
8772
8750
|
}
|
|
@@ -8835,13 +8813,13 @@ function useSerialize(input) {
|
|
|
8835
8813
|
let processedSlide = slide;
|
|
8836
8814
|
if (pendingEditId) {
|
|
8837
8815
|
const updatedElements = slide.elements.map((el) => {
|
|
8838
|
-
if (el.id !== pendingEditId || !
|
|
8816
|
+
if (el.id !== pendingEditId || !chunkL2MOKP3E_js.hasTextProperties(el)) {
|
|
8839
8817
|
return el;
|
|
8840
8818
|
}
|
|
8841
8819
|
return {
|
|
8842
8820
|
...el,
|
|
8843
8821
|
text: pendingEditText,
|
|
8844
|
-
textSegments:
|
|
8822
|
+
textSegments: chunkL2MOKP3E_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8845
8823
|
};
|
|
8846
8824
|
});
|
|
8847
8825
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8854,19 +8832,19 @@ function useSerialize(input) {
|
|
|
8854
8832
|
const pptxGuides = guides.map((g) => ({
|
|
8855
8833
|
id: g.id,
|
|
8856
8834
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8857
|
-
positionEmu:
|
|
8835
|
+
positionEmu: chunkL2MOKP3E_js.guidePxToEmu(g.position)
|
|
8858
8836
|
}));
|
|
8859
8837
|
return {
|
|
8860
8838
|
...processedSlide,
|
|
8861
8839
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8862
8840
|
};
|
|
8863
8841
|
});
|
|
8864
|
-
const slidesToSave =
|
|
8865
|
-
const saveOptions =
|
|
8842
|
+
const slidesToSave = chunkL2MOKP3E_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8843
|
+
const saveOptions = chunkL2MOKP3E_js.buildDeckSaveOptions({
|
|
8866
8844
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8867
8845
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8868
8846
|
// slide-size edit reaches the file.
|
|
8869
|
-
slideSize:
|
|
8847
|
+
slideSize: chunkL2MOKP3E_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8870
8848
|
headerFooter,
|
|
8871
8849
|
presentationProperties,
|
|
8872
8850
|
viewProperties,
|
|
@@ -8885,7 +8863,7 @@ function useSerialize(input) {
|
|
|
8885
8863
|
embedFonts,
|
|
8886
8864
|
outputFormat: format
|
|
8887
8865
|
});
|
|
8888
|
-
return
|
|
8866
|
+
return chunkL2MOKP3E_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8889
8867
|
},
|
|
8890
8868
|
[
|
|
8891
8869
|
slides,
|
|
@@ -8926,7 +8904,7 @@ function useRecoveryDetection(input) {
|
|
|
8926
8904
|
const onRestore = input.onRestore;
|
|
8927
8905
|
const openVersionHistory = input.openVersionHistory;
|
|
8928
8906
|
react.useEffect(() => {
|
|
8929
|
-
if (!
|
|
8907
|
+
if (!chunkL2MOKP3E_js.shouldProbeAutosaveRecovery({
|
|
8930
8908
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8931
8909
|
filePath,
|
|
8932
8910
|
loading,
|
|
@@ -8938,7 +8916,7 @@ function useRecoveryDetection(input) {
|
|
|
8938
8916
|
}
|
|
8939
8917
|
recoveryCheckedRef.current = true;
|
|
8940
8918
|
void (async () => {
|
|
8941
|
-
const offer = await
|
|
8919
|
+
const offer = await chunkL2MOKP3E_js.probeAutosaveRecovery(filePath);
|
|
8942
8920
|
if (!offer) {
|
|
8943
8921
|
return;
|
|
8944
8922
|
}
|
|
@@ -8951,7 +8929,7 @@ function useRecoveryDetection(input) {
|
|
|
8951
8929
|
const record = recordRef.current;
|
|
8952
8930
|
setPrompt(null);
|
|
8953
8931
|
if (record && onRestore) {
|
|
8954
|
-
onRestore(
|
|
8932
|
+
onRestore(chunkL2MOKP3E_js.acceptAutosaveRecovery(record));
|
|
8955
8933
|
}
|
|
8956
8934
|
recordRef.current = null;
|
|
8957
8935
|
}, [onRestore]);
|
|
@@ -8960,7 +8938,7 @@ function useRecoveryDetection(input) {
|
|
|
8960
8938
|
setPrompt(null);
|
|
8961
8939
|
recordRef.current = null;
|
|
8962
8940
|
if (record) {
|
|
8963
|
-
void
|
|
8941
|
+
void chunkL2MOKP3E_js.discardAutosaveRecovery(record);
|
|
8964
8942
|
}
|
|
8965
8943
|
}, []);
|
|
8966
8944
|
return { prompt, restore, discard };
|
|
@@ -9011,11 +8989,11 @@ function usePresentationSetup(input) {
|
|
|
9011
8989
|
containerRef,
|
|
9012
8990
|
content,
|
|
9013
8991
|
onSetMode: (nextMode) => {
|
|
9014
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8992
|
+
if (mode === "present" && nextMode !== "present" && !chunkL2MOKP3E_js.mayLeaveSlideShow()) {
|
|
9015
8993
|
return;
|
|
9016
8994
|
}
|
|
9017
8995
|
if (mode === "present" && nextMode !== "present") {
|
|
9018
|
-
|
|
8996
|
+
chunkL2MOKP3E_js.stopAllPersistentAudio();
|
|
9019
8997
|
stopAnimationSound();
|
|
9020
8998
|
const exitHandler = exitModeHandlerRef.current;
|
|
9021
8999
|
if (exitHandler) {
|
|
@@ -9083,10 +9061,10 @@ function usePresentationSetup(input) {
|
|
|
9083
9061
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
9084
9062
|
onToggleSubtitles,
|
|
9085
9063
|
onSaveRehearsalTimings: (timings) => {
|
|
9086
|
-
setSlides((prev) =>
|
|
9064
|
+
setSlides((prev) => chunkL2MOKP3E_js.applyRehearsalTimings(prev, timings));
|
|
9087
9065
|
history.markDirty();
|
|
9088
9066
|
},
|
|
9089
|
-
loopContinuously:
|
|
9067
|
+
loopContinuously: chunkL2MOKP3E_js.shouldLoopContinuously(presentationProperties),
|
|
9090
9068
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
9091
9069
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
9092
9070
|
endWithBlackSlide,
|
|
@@ -9293,7 +9271,7 @@ function useEditorOperations(input) {
|
|
|
9293
9271
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9294
9272
|
react.useEffect(() => {
|
|
9295
9273
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9296
|
-
copiedFormatRef.current =
|
|
9274
|
+
copiedFormatRef.current = chunkL2MOKP3E_js.copyFormatFromElement(selectedElement);
|
|
9297
9275
|
} else if (!formatPainterActive) {
|
|
9298
9276
|
copiedFormatRef.current = null;
|
|
9299
9277
|
}
|
|
@@ -9319,12 +9297,12 @@ function useEditorOperations(input) {
|
|
|
9319
9297
|
e.stopPropagation();
|
|
9320
9298
|
const element = elementLookup.get(elementId);
|
|
9321
9299
|
if (element) {
|
|
9322
|
-
const updated =
|
|
9300
|
+
const updated = chunkL2MOKP3E_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9323
9301
|
const updates = {};
|
|
9324
|
-
if (
|
|
9302
|
+
if (chunkL2MOKP3E_js.hasShapeProperties(updated)) {
|
|
9325
9303
|
updates.shapeStyle = updated.shapeStyle;
|
|
9326
9304
|
}
|
|
9327
|
-
if (
|
|
9305
|
+
if (chunkL2MOKP3E_js.hasTextProperties(updated)) {
|
|
9328
9306
|
updates.textStyle = updated.textStyle;
|
|
9329
9307
|
}
|
|
9330
9308
|
ops.updateElementById(elementId, updates);
|
|
@@ -9510,10 +9488,10 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9510
9488
|
}
|
|
9511
9489
|
};
|
|
9512
9490
|
}, [embeddedFonts]);
|
|
9513
|
-
const referencedFamilies = react.useMemo(() =>
|
|
9491
|
+
const referencedFamilies = react.useMemo(() => chunkL2MOKP3E_js.collectReferencedFontFamilies(slides), [slides]);
|
|
9514
9492
|
react.useEffect(() => {
|
|
9515
9493
|
let cancelled = false;
|
|
9516
|
-
void
|
|
9494
|
+
void chunkL2MOKP3E_js.resolveGoogleWebfontHref(slides, embeddedFonts).then((href) => {
|
|
9517
9495
|
if (cancelled) {
|
|
9518
9496
|
return null;
|
|
9519
9497
|
}
|
|
@@ -9538,15 +9516,15 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9538
9516
|
const [, setOutlineFontsTick] = react.useState(0);
|
|
9539
9517
|
react.useEffect(() => {
|
|
9540
9518
|
let cancelled = false;
|
|
9541
|
-
const referenced =
|
|
9542
|
-
const candidates =
|
|
9519
|
+
const referenced = chunkL2MOKP3E_js.collectReferencedFontFamilies(slides);
|
|
9520
|
+
const candidates = chunkL2MOKP3E_js.selectGoogleWebfontFamilies(
|
|
9543
9521
|
referenced,
|
|
9544
9522
|
embeddedFonts.map((font) => font.name)
|
|
9545
9523
|
);
|
|
9546
9524
|
if (candidates.length === 0) {
|
|
9547
9525
|
return;
|
|
9548
9526
|
}
|
|
9549
|
-
void
|
|
9527
|
+
void chunkL2MOKP3E_js.resolveGoogleWebfontHref(slides, embeddedFonts).then(async (href) => {
|
|
9550
9528
|
if (cancelled || !href) {
|
|
9551
9529
|
return;
|
|
9552
9530
|
}
|
|
@@ -9560,7 +9538,7 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9560
9538
|
if (cancelled) {
|
|
9561
9539
|
return;
|
|
9562
9540
|
}
|
|
9563
|
-
const bytes = await
|
|
9541
|
+
const bytes = await chunkL2MOKP3E_js.fetchGoogleWebfontOutlineBytes(
|
|
9564
9542
|
href,
|
|
9565
9543
|
family,
|
|
9566
9544
|
variant.bold,
|
|
@@ -9749,7 +9727,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9749
9727
|
inputRef.current = input;
|
|
9750
9728
|
const handleKeyDown = react.useCallback((e) => {
|
|
9751
9729
|
const current = inputRef.current;
|
|
9752
|
-
const startAction =
|
|
9730
|
+
const startAction = chunkL2MOKP3E_js.mapSlideShowStartKey(e, { isPresenting: current.mode === "present" });
|
|
9753
9731
|
if (startAction !== null) {
|
|
9754
9732
|
e.preventDefault();
|
|
9755
9733
|
if (startAction === "fromBeginning") {
|
|
@@ -9759,7 +9737,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9759
9737
|
}
|
|
9760
9738
|
return;
|
|
9761
9739
|
}
|
|
9762
|
-
const { action, dx, dy } =
|
|
9740
|
+
const { action, dx, dy } = chunkL2MOKP3E_js.mapEditorKey(e, {
|
|
9763
9741
|
canEdit: current.canEdit,
|
|
9764
9742
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9765
9743
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9772,7 +9750,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9772
9750
|
hasSelection: current.hasSelection,
|
|
9773
9751
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9774
9752
|
isDrawing: current.activeTool !== "select",
|
|
9775
|
-
isTextInputTarget:
|
|
9753
|
+
isTextInputTarget: chunkL2MOKP3E_js.isEditorTextInputTarget(e.target)
|
|
9776
9754
|
});
|
|
9777
9755
|
if (action === null) {
|
|
9778
9756
|
return;
|
|
@@ -10104,7 +10082,7 @@ function useViewerIntegration(input) {
|
|
|
10104
10082
|
return zoom.scale;
|
|
10105
10083
|
},
|
|
10106
10084
|
setZoom(level) {
|
|
10107
|
-
zoom.setScale(
|
|
10085
|
+
zoom.setScale(chunkL2MOKP3E_js.clampZoomScale(level));
|
|
10108
10086
|
},
|
|
10109
10087
|
zoomIn() {
|
|
10110
10088
|
zoom.handleZoomIn();
|
|
@@ -10326,7 +10304,7 @@ function useReducedMotion() {
|
|
|
10326
10304
|
}
|
|
10327
10305
|
function useViewerOptions() {
|
|
10328
10306
|
const storeRef = react.useRef(null);
|
|
10329
|
-
storeRef.current ??=
|
|
10307
|
+
storeRef.current ??= chunkL2MOKP3E_js.createViewerOptionsStore();
|
|
10330
10308
|
const store = storeRef.current;
|
|
10331
10309
|
const options = react.useSyncExternalStore(
|
|
10332
10310
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -10335,9 +10313,9 @@ function useViewerOptions() {
|
|
|
10335
10313
|
);
|
|
10336
10314
|
return { optionsStore: store, options };
|
|
10337
10315
|
}
|
|
10338
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10316
|
+
var KNOWN_TAB_IDS = new Set(chunkL2MOKP3E_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10339
10317
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
10340
|
-
const isHidden = (id) =>
|
|
10318
|
+
const isHidden = (id) => chunkL2MOKP3E_js.isActionHidden(id, hiddenActions);
|
|
10341
10319
|
const userHidden = new Set(hiddenTabIds);
|
|
10342
10320
|
userHidden.delete("file");
|
|
10343
10321
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
|
|
@@ -10430,12 +10408,12 @@ function useYjsDocumentSync({
|
|
|
10430
10408
|
return;
|
|
10431
10409
|
}
|
|
10432
10410
|
try {
|
|
10433
|
-
const handler = new
|
|
10411
|
+
const handler = new chunkL2MOKP3E_js.PptxHandler();
|
|
10434
10412
|
await handler.load(sourceBytes.buffer);
|
|
10435
|
-
const currentSlides =
|
|
10413
|
+
const currentSlides = chunkL2MOKP3E_js.readSlidesFromYDoc(
|
|
10436
10414
|
doc
|
|
10437
10415
|
);
|
|
10438
|
-
const slidesToSave =
|
|
10416
|
+
const slidesToSave = chunkL2MOKP3E_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10439
10417
|
const bytes = await handler.save(slidesToSave, getSaveOptions?.());
|
|
10440
10418
|
config.onWriteBack(bytes);
|
|
10441
10419
|
} catch {
|
|
@@ -10450,10 +10428,10 @@ function useYjsDocumentSync({
|
|
|
10450
10428
|
if (!doc || !isConnected) {
|
|
10451
10429
|
return;
|
|
10452
10430
|
}
|
|
10453
|
-
const docSlides =
|
|
10431
|
+
const docSlides = chunkL2MOKP3E_js.readSlidesFromYDoc(
|
|
10454
10432
|
doc
|
|
10455
10433
|
);
|
|
10456
|
-
if (!
|
|
10434
|
+
if (!chunkL2MOKP3E_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10457
10435
|
return;
|
|
10458
10436
|
}
|
|
10459
10437
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10472,11 +10450,11 @@ function useYjsDocumentSync({
|
|
|
10472
10450
|
lastSyncedRef.current = serialized;
|
|
10473
10451
|
void (async () => {
|
|
10474
10452
|
const factories = await getFactories();
|
|
10475
|
-
|
|
10453
|
+
chunkL2MOKP3E_js.reconcileSlidesInYDoc(
|
|
10476
10454
|
slides,
|
|
10477
10455
|
doc,
|
|
10478
10456
|
factories,
|
|
10479
|
-
|
|
10457
|
+
chunkL2MOKP3E_js.LOCAL_SYNC_ORIGIN
|
|
10480
10458
|
);
|
|
10481
10459
|
scheduleWriteBack();
|
|
10482
10460
|
})();
|
|
@@ -10490,10 +10468,10 @@ function useYjsDocumentSync({
|
|
|
10490
10468
|
return;
|
|
10491
10469
|
}
|
|
10492
10470
|
const handleChange = (_events, transaction) => {
|
|
10493
|
-
if (transaction?.origin ===
|
|
10471
|
+
if (transaction?.origin === chunkL2MOKP3E_js.LOCAL_SYNC_ORIGIN) {
|
|
10494
10472
|
return;
|
|
10495
10473
|
}
|
|
10496
|
-
const remoteSlides =
|
|
10474
|
+
const remoteSlides = chunkL2MOKP3E_js.readSlidesFromYDoc(
|
|
10497
10475
|
doc
|
|
10498
10476
|
);
|
|
10499
10477
|
if (remoteSlides.length === 0) {
|
|
@@ -10509,7 +10487,7 @@ function useYjsDocumentSync({
|
|
|
10509
10487
|
isApplyingRemoteRef.current = false;
|
|
10510
10488
|
scheduleWriteBack();
|
|
10511
10489
|
};
|
|
10512
|
-
const unobserve =
|
|
10490
|
+
const unobserve = chunkL2MOKP3E_js.observeYDocSlides(
|
|
10513
10491
|
doc,
|
|
10514
10492
|
handleChange
|
|
10515
10493
|
);
|
|
@@ -10547,7 +10525,7 @@ function useBroadcastFollower({
|
|
|
10547
10525
|
if (!broadcaster) {
|
|
10548
10526
|
return;
|
|
10549
10527
|
}
|
|
10550
|
-
if (!
|
|
10528
|
+
if (!chunkL2MOKP3E_js.shouldAutoFollowBroadcaster({
|
|
10551
10529
|
localRole: collab.config.role,
|
|
10552
10530
|
broadcasterRole: broadcaster.role
|
|
10553
10531
|
})) {
|
|
@@ -10705,7 +10683,7 @@ function useLayoutSwitching(input) {
|
|
|
10705
10683
|
currentLayoutPath
|
|
10706
10684
|
};
|
|
10707
10685
|
}
|
|
10708
|
-
var MIN_TOUCH_TARGET =
|
|
10686
|
+
var MIN_TOUCH_TARGET = chunkL2MOKP3E_js.MIN_TOUCH_TARGET_PX;
|
|
10709
10687
|
function subscribeTouchCapability(callback) {
|
|
10710
10688
|
if (typeof window === "undefined") {
|
|
10711
10689
|
return () => {
|
|
@@ -10718,7 +10696,7 @@ function subscribeTouchCapability(callback) {
|
|
|
10718
10696
|
function useIsMobile() {
|
|
10719
10697
|
const isTouchDevice = react.useSyncExternalStore(
|
|
10720
10698
|
subscribeTouchCapability,
|
|
10721
|
-
|
|
10699
|
+
chunkL2MOKP3E_js.detectTouchDevice,
|
|
10722
10700
|
() => false
|
|
10723
10701
|
// server snapshot
|
|
10724
10702
|
);
|
|
@@ -10728,7 +10706,7 @@ function useIsMobile() {
|
|
|
10728
10706
|
const [viewportHeight, setViewportHeight] = react.useState(
|
|
10729
10707
|
() => typeof window === "undefined" ? 768 : window.innerHeight
|
|
10730
10708
|
);
|
|
10731
|
-
const [orientation, setOrientation] = react.useState(
|
|
10709
|
+
const [orientation, setOrientation] = react.useState(chunkL2MOKP3E_js.detectOrientation);
|
|
10732
10710
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
10733
10711
|
const [initialViewportHeight] = react.useState(
|
|
10734
10712
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -10749,7 +10727,7 @@ function useIsMobile() {
|
|
|
10749
10727
|
return;
|
|
10750
10728
|
}
|
|
10751
10729
|
const handleOrientationChange = () => {
|
|
10752
|
-
setOrientation(
|
|
10730
|
+
setOrientation(chunkL2MOKP3E_js.detectOrientation());
|
|
10753
10731
|
};
|
|
10754
10732
|
if (screen.orientation) {
|
|
10755
10733
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -10779,7 +10757,7 @@ function useIsMobile() {
|
|
|
10779
10757
|
window.addEventListener("resize", handleResize);
|
|
10780
10758
|
return () => window.removeEventListener("resize", handleResize);
|
|
10781
10759
|
}, [isTouchDevice, initialViewportHeight]);
|
|
10782
|
-
const { isMobile, isTablet, isDesktop } =
|
|
10760
|
+
const { isMobile, isTablet, isDesktop } = chunkL2MOKP3E_js.deriveViewportBreakpoints(
|
|
10783
10761
|
viewportWidth,
|
|
10784
10762
|
viewportHeight,
|
|
10785
10763
|
isTouchDevice
|
|
@@ -10812,10 +10790,10 @@ function useTouchGestures(input) {
|
|
|
10812
10790
|
if (!el || !enabled) {
|
|
10813
10791
|
return;
|
|
10814
10792
|
}
|
|
10815
|
-
const recognizer =
|
|
10793
|
+
const recognizer = chunkL2MOKP3E_js.createTouchGestureRecognizer({
|
|
10816
10794
|
getScale: () => scaleRef.current,
|
|
10817
|
-
minScale:
|
|
10818
|
-
maxScale:
|
|
10795
|
+
minScale: chunkL2MOKP3E_js.MIN_ZOOM_SCALE,
|
|
10796
|
+
maxScale: chunkL2MOKP3E_js.MAX_ZOOM_SCALE,
|
|
10819
10797
|
callbacks: {
|
|
10820
10798
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10821
10799
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10855,7 +10833,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10855
10833
|
return;
|
|
10856
10834
|
}
|
|
10857
10835
|
const rect = active.getBoundingClientRect();
|
|
10858
|
-
const delta =
|
|
10836
|
+
const delta = chunkL2MOKP3E_js.computeScrollDelta(
|
|
10859
10837
|
{ top: rect.top, bottom: rect.bottom },
|
|
10860
10838
|
window.innerHeight,
|
|
10861
10839
|
keyboardInset
|
|
@@ -10875,8 +10853,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10875
10853
|
return;
|
|
10876
10854
|
}
|
|
10877
10855
|
const update = () => {
|
|
10878
|
-
const metrics =
|
|
10879
|
-
const inset = metrics ?
|
|
10856
|
+
const metrics = chunkL2MOKP3E_js.readViewportMetrics(window);
|
|
10857
|
+
const inset = metrics ? chunkL2MOKP3E_js.computeKeyboardInset(metrics) : 0;
|
|
10880
10858
|
setKeyboardInset(inset);
|
|
10881
10859
|
if (inset > 0) {
|
|
10882
10860
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10887,8 +10865,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10887
10865
|
vv.addEventListener("scroll", update);
|
|
10888
10866
|
const onFocusIn = () => {
|
|
10889
10867
|
window.requestAnimationFrame(() => {
|
|
10890
|
-
const metrics =
|
|
10891
|
-
const inset = metrics ?
|
|
10868
|
+
const metrics = chunkL2MOKP3E_js.readViewportMetrics(window);
|
|
10869
|
+
const inset = metrics ? chunkL2MOKP3E_js.computeKeyboardInset(metrics) : 0;
|
|
10892
10870
|
if (inset > 0) {
|
|
10893
10871
|
scrollFocusedIntoView(inset);
|
|
10894
10872
|
}
|
|
@@ -10901,7 +10879,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10901
10879
|
document.removeEventListener("focusin", onFocusIn);
|
|
10902
10880
|
};
|
|
10903
10881
|
}, [enabled]);
|
|
10904
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10882
|
+
return { keyboardInset, isKeyboardOpen: chunkL2MOKP3E_js.isKeyboardOpen(keyboardInset) };
|
|
10905
10883
|
}
|
|
10906
10884
|
|
|
10907
10885
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10930,21 +10908,21 @@ function buildCanvasProps(input) {
|
|
|
10930
10908
|
} = input;
|
|
10931
10909
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10932
10910
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10933
|
-
const fieldContext =
|
|
10911
|
+
const fieldContext = chunkL2MOKP3E_js.buildFieldSubstitutionContext({
|
|
10934
10912
|
headerFooter: s.headerFooter,
|
|
10935
10913
|
customProperties: s.customProperties,
|
|
10936
10914
|
slide: activeSlide
|
|
10937
10915
|
});
|
|
10938
10916
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10939
10917
|
const openExternalUrl = (url, target) => {
|
|
10940
|
-
if (
|
|
10918
|
+
if (chunkL2MOKP3E_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
10941
10919
|
return;
|
|
10942
10920
|
}
|
|
10943
|
-
|
|
10921
|
+
chunkL2MOKP3E_js.safeOpenUrl(url, target);
|
|
10944
10922
|
};
|
|
10945
10923
|
const handleActionClick = (elementId, action) => {
|
|
10946
10924
|
if (mode === "present") {
|
|
10947
|
-
const resolved =
|
|
10925
|
+
const resolved = chunkL2MOKP3E_js.resolvePresentationAction(action, { slideCount: slides.length });
|
|
10948
10926
|
if (resolved.intent.kind === "openUrl") {
|
|
10949
10927
|
openExternalUrl(resolved.intent.url);
|
|
10950
10928
|
return;
|
|
@@ -10955,9 +10933,9 @@ function buildCanvasProps(input) {
|
|
|
10955
10933
|
}
|
|
10956
10934
|
};
|
|
10957
10935
|
const handleHyperlinkClick = (url, target) => {
|
|
10958
|
-
if (
|
|
10936
|
+
if (chunkL2MOKP3E_js.isPpactionUrl(url)) {
|
|
10959
10937
|
if (mode === "present") {
|
|
10960
|
-
const parsed =
|
|
10938
|
+
const parsed = chunkL2MOKP3E_js.parsePpactionUrl(url);
|
|
10961
10939
|
if (parsed) {
|
|
10962
10940
|
presentation.handlePresentationAction({
|
|
10963
10941
|
action: parsed.action,
|
|
@@ -11063,7 +11041,7 @@ function buildCanvasProps(input) {
|
|
|
11063
11041
|
|
|
11064
11042
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
11065
11043
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
11066
|
-
return
|
|
11044
|
+
return chunkL2MOKP3E_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
11067
11045
|
}
|
|
11068
11046
|
|
|
11069
11047
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -11076,7 +11054,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
11076
11054
|
const current = activeSlide.animations ?? [];
|
|
11077
11055
|
if (group === "motionPath") {
|
|
11078
11056
|
propertyHandlers.handleUpdateSlide({
|
|
11079
|
-
animations:
|
|
11057
|
+
animations: chunkL2MOKP3E_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
11080
11058
|
});
|
|
11081
11059
|
return;
|
|
11082
11060
|
}
|
|
@@ -11272,7 +11250,7 @@ function buildToolbarProps(input) {
|
|
|
11272
11250
|
onOpenFile,
|
|
11273
11251
|
onOpenRecentFile,
|
|
11274
11252
|
onCreatePresentation: (templateId) => {
|
|
11275
|
-
s.setSlides(
|
|
11253
|
+
s.setSlides(chunkL2MOKP3E_js.createBackstagePresentation(templateId));
|
|
11276
11254
|
s.setActiveSlideIndex(0);
|
|
11277
11255
|
s.setSelectedElementId(null);
|
|
11278
11256
|
s.setSelectedElementIds([]);
|
|
@@ -11302,7 +11280,7 @@ function buildToolbarProps(input) {
|
|
|
11302
11280
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
11303
11281
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
11304
11282
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
11305
|
-
templateScheme:
|
|
11283
|
+
templateScheme: chunkL2MOKP3E_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
11306
11284
|
customShows: s.customShows,
|
|
11307
11285
|
activeCustomShowId: s.activeCustomShowId,
|
|
11308
11286
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -11343,7 +11321,7 @@ function buildToolbarProps(input) {
|
|
|
11343
11321
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
11344
11322
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
11345
11323
|
formatPainterActive: s.formatPainterActive,
|
|
11346
|
-
canActivateFormatPainter:
|
|
11324
|
+
canActivateFormatPainter: chunkL2MOKP3E_js.hasCopyableFormat(selectedElement),
|
|
11347
11325
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
11348
11326
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
11349
11327
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11421,7 +11399,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11421
11399
|
headerFooter: state.headerFooter,
|
|
11422
11400
|
loading,
|
|
11423
11401
|
error,
|
|
11424
|
-
maxHistoryEntries:
|
|
11402
|
+
maxHistoryEntries: chunkL2MOKP3E_js.resolveHistoryDepth(viewerOptions),
|
|
11425
11403
|
hasActivePointerInteraction,
|
|
11426
11404
|
pointerCommitNonce: state.pointerCommitNonce,
|
|
11427
11405
|
onDirty: markDocumentDirty,
|
|
@@ -11446,7 +11424,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11446
11424
|
documentGridSpacing: state.viewProperties?.gridSpacing
|
|
11447
11425
|
});
|
|
11448
11426
|
const themeColorMap = react.useMemo(
|
|
11449
|
-
() => state.theme?.colorScheme ?
|
|
11427
|
+
() => state.theme?.colorScheme ? chunkL2MOKP3E_js.buildThemeColorMap(state.theme.colorScheme) : void 0,
|
|
11450
11428
|
[state.theme?.colorScheme]
|
|
11451
11429
|
);
|
|
11452
11430
|
const { presentation, annotations, actionSoundHandlerRef, setExitModeHandler } = usePresentationSetup({
|
|
@@ -11495,8 +11473,8 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11495
11473
|
gridSpacingPx,
|
|
11496
11474
|
// Multiplied against the pre-existing 2x baseline; see the matching
|
|
11497
11475
|
// comment in `PowerPointViewer.tsx`.
|
|
11498
|
-
imageExportScale: 2 *
|
|
11499
|
-
imageResolutionScale:
|
|
11476
|
+
imageExportScale: 2 * chunkL2MOKP3E_js.resolveImageResolutionScale(viewerOptions),
|
|
11477
|
+
imageResolutionScale: chunkL2MOKP3E_js.resolveImageResolutionScale(viewerOptions),
|
|
11500
11478
|
viewerOptions
|
|
11501
11479
|
};
|
|
11502
11480
|
}
|
|
@@ -11512,7 +11490,7 @@ function useCompatibilityToastsState() {
|
|
|
11512
11490
|
}
|
|
11513
11491
|
function useReadOnlyRecommendationState(content) {
|
|
11514
11492
|
const [recommendation, setRecommendation] = react.useState(
|
|
11515
|
-
() =>
|
|
11493
|
+
() => chunkL2MOKP3E_js.readOnlyRecommendation(void 0)
|
|
11516
11494
|
);
|
|
11517
11495
|
const [modifyVerifier, setModifyVerifier] = react.useState(void 0);
|
|
11518
11496
|
const [bannerHidden, setBannerHidden] = react.useState(false);
|
|
@@ -11552,7 +11530,7 @@ function useReadOnlyRecommendationState(content) {
|
|
|
11552
11530
|
async (password) => {
|
|
11553
11531
|
setCheckingPassword(true);
|
|
11554
11532
|
try {
|
|
11555
|
-
const result = await
|
|
11533
|
+
const result = await chunkL2MOKP3E_js.checkModifyPassword(modifyVerifier, password);
|
|
11556
11534
|
if (result.ok) {
|
|
11557
11535
|
unlock();
|
|
11558
11536
|
} else {
|
|
@@ -11597,9 +11575,9 @@ function useViewPreferencesSync(input) {
|
|
|
11597
11575
|
setShowGuides
|
|
11598
11576
|
} = input;
|
|
11599
11577
|
react.useEffect(() => {
|
|
11600
|
-
const seeded =
|
|
11578
|
+
const seeded = chunkL2MOKP3E_js.viewerPreferencesFromViewProperties(
|
|
11601
11579
|
{ viewProperties },
|
|
11602
|
-
{ ...
|
|
11580
|
+
{ ...chunkL2MOKP3E_js.DEFAULT_VIEWER_PREFERENCES, snapToGrid, snapToObjects: snapToShape, showGuides }
|
|
11603
11581
|
);
|
|
11604
11582
|
setSnapToGrid(seeded.snapToGrid);
|
|
11605
11583
|
setSnapToShape(seeded.snapToObjects ?? snapToShape);
|
|
@@ -11609,7 +11587,7 @@ function useViewPreferencesSync(input) {
|
|
|
11609
11587
|
(prefsOverride) => {
|
|
11610
11588
|
setViewProperties((prev) => {
|
|
11611
11589
|
const merged = {
|
|
11612
|
-
...
|
|
11590
|
+
...chunkL2MOKP3E_js.DEFAULT_VIEWER_PREFERENCES,
|
|
11613
11591
|
snapToGrid,
|
|
11614
11592
|
snapToObjects: snapToShape,
|
|
11615
11593
|
showGuides,
|
|
@@ -11617,7 +11595,7 @@ function useViewPreferencesSync(input) {
|
|
|
11617
11595
|
gridSpacingCy: prev?.gridSpacing?.cy,
|
|
11618
11596
|
...prefsOverride
|
|
11619
11597
|
};
|
|
11620
|
-
const patch =
|
|
11598
|
+
const patch = chunkL2MOKP3E_js.viewPropertiesPatchFromPreferences(merged);
|
|
11621
11599
|
return {
|
|
11622
11600
|
...prev,
|
|
11623
11601
|
slideViewPr: { ...prev?.slideViewPr, ...patch.slideViewPr },
|
|
@@ -11838,7 +11816,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11838
11816
|
}, [incomingContent]);
|
|
11839
11817
|
const onOpenFile = react.useCallback(() => {
|
|
11840
11818
|
void (async () => {
|
|
11841
|
-
const picked = await
|
|
11819
|
+
const picked = await chunkL2MOKP3E_js.openPptxFile();
|
|
11842
11820
|
if (picked) {
|
|
11843
11821
|
setContent(picked.buffer);
|
|
11844
11822
|
}
|
|
@@ -11846,7 +11824,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11846
11824
|
}, []);
|
|
11847
11825
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11848
11826
|
void (async () => {
|
|
11849
|
-
const bytes = await
|
|
11827
|
+
const bytes = await chunkL2MOKP3E_js.readBackstageRecentFile(key);
|
|
11850
11828
|
if (bytes) {
|
|
11851
11829
|
setContent(bytes);
|
|
11852
11830
|
}
|