pptx-react-viewer 3.1.2 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/{AiChatPanel-UCFQIWOQ.mjs → AiChatPanel-5JAQBLTU.mjs} +3 -3
- package/dist/AiChatPanel-5JAQBLTU.mjs.br +0 -0
- package/dist/AiChatPanel-5JAQBLTU.mjs.gz +0 -0
- package/dist/{AiChatPanel-4EYZDQXM.js → AiChatPanel-C3E7UV7T.js} +23 -23
- package/dist/AiChatPanel-C3E7UV7T.js.br +0 -0
- package/dist/AiChatPanel-C3E7UV7T.js.gz +0 -0
- package/dist/{Area3DChartScene-PMYXO4MR.mjs → Area3DChartScene-KE434ERF.mjs} +1 -1
- package/dist/Area3DChartScene-KE434ERF.mjs.br +0 -0
- package/dist/Area3DChartScene-KE434ERF.mjs.gz +0 -0
- package/dist/{Area3DChartScene-YBMC6NKY.js → Area3DChartScene-XY2PKRMA.js} +2 -2
- package/dist/Area3DChartScene-XY2PKRMA.js.br +0 -0
- package/dist/Area3DChartScene-XY2PKRMA.js.gz +0 -0
- package/dist/{Bar3DChartScene-CEOI6SU6.mjs → Bar3DChartScene-2KQABQZM.mjs} +1 -1
- package/dist/Bar3DChartScene-2KQABQZM.mjs.br +0 -0
- package/dist/Bar3DChartScene-2KQABQZM.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-75DCA2ZA.js → Bar3DChartScene-YMADUUZN.js} +2 -2
- package/dist/Bar3DChartScene-YMADUUZN.js.br +0 -0
- package/dist/Bar3DChartScene-YMADUUZN.js.gz +0 -0
- package/dist/{Line3DChartScene-STGX6N6V.js → Line3DChartScene-AB7N6ORX.js} +2 -2
- package/dist/Line3DChartScene-AB7N6ORX.js.br +0 -0
- package/dist/Line3DChartScene-AB7N6ORX.js.gz +0 -0
- package/dist/{Line3DChartScene-EZZKWUZR.mjs → Line3DChartScene-K3BSK6BB.mjs} +1 -1
- package/dist/Line3DChartScene-K3BSK6BB.mjs.br +0 -0
- package/dist/Line3DChartScene-K3BSK6BB.mjs.gz +0 -0
- package/dist/{Model3DScene-FGQJKWL6.mjs → Model3DScene-NT5RRIB5.mjs} +1 -1
- package/dist/Model3DScene-NT5RRIB5.mjs.br +0 -0
- package/dist/Model3DScene-NT5RRIB5.mjs.gz +0 -0
- package/dist/{Model3DScene-DWRD63FH.js → Model3DScene-VSLGUWC7.js} +2 -2
- package/dist/Model3DScene-VSLGUWC7.js.br +0 -0
- package/dist/Model3DScene-VSLGUWC7.js.gz +0 -0
- package/dist/{PieChart3DScene-R3Y7OVVO.js → PieChart3DScene-6MUFRFYJ.js} +2 -2
- package/dist/PieChart3DScene-6MUFRFYJ.js.br +0 -0
- package/dist/PieChart3DScene-6MUFRFYJ.js.gz +0 -0
- package/dist/{PieChart3DScene-DH6RSJO6.mjs → PieChart3DScene-NFRBKII7.mjs} +1 -1
- package/dist/PieChart3DScene-NFRBKII7.mjs.br +0 -0
- package/dist/PieChart3DScene-NFRBKII7.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-UM5HA3VO.js → SurfaceChart3DScene-2UQOKVFB.js} +2 -2
- package/dist/SurfaceChart3DScene-2UQOKVFB.js.br +0 -0
- package/dist/SurfaceChart3DScene-2UQOKVFB.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-BMBU5RKI.mjs → SurfaceChart3DScene-UKIOTKJC.mjs} +1 -1
- package/dist/SurfaceChart3DScene-UKIOTKJC.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-UKIOTKJC.mjs.gz +0 -0
- package/dist/{chunk-VLLZ3QL2.mjs → chunk-5WH6UVWC.mjs} +43 -16
- package/dist/chunk-5WH6UVWC.mjs.br +0 -0
- package/dist/chunk-5WH6UVWC.mjs.gz +0 -0
- package/dist/{chunk-W3J6SNVE.mjs → chunk-ACVLIDUS.mjs} +1 -1
- package/dist/chunk-ACVLIDUS.mjs.br +0 -0
- package/dist/chunk-ACVLIDUS.mjs.gz +0 -0
- package/dist/{chunk-4VVOTEQ4.mjs → chunk-BZ6OM3H5.mjs} +3 -4
- package/dist/chunk-BZ6OM3H5.mjs.br +0 -0
- package/dist/chunk-BZ6OM3H5.mjs.gz +0 -0
- package/dist/{chunk-MQEG5GOV.js → chunk-GCOGKBK3.js} +1144 -1117
- package/dist/chunk-GCOGKBK3.js.br +0 -0
- package/dist/chunk-GCOGKBK3.js.gz +0 -0
- package/dist/{chunk-7ZQ2FZXE.js → chunk-HMZA25W2.js} +1 -1
- package/dist/chunk-HMZA25W2.js.br +0 -0
- package/dist/{chunk-7ZQ2FZXE.js.gz → chunk-HMZA25W2.js.gz} +0 -0
- package/dist/{chunk-YNUYFR2T.js → chunk-K4DUVYZ7.js} +3 -3
- package/dist/chunk-K4DUVYZ7.js.br +0 -0
- package/dist/chunk-K4DUVYZ7.js.gz +0 -0
- package/dist/{chunk-2HLDBQH7.js → chunk-OABOL32L.js} +148 -148
- package/dist/chunk-OABOL32L.js.br +0 -0
- package/dist/chunk-OABOL32L.js.gz +0 -0
- package/dist/{chunk-S546O4W2.mjs → chunk-SRAXNEJX.mjs} +1 -1
- package/dist/chunk-SRAXNEJX.mjs.br +0 -0
- package/dist/{chunk-S546O4W2.mjs.gz → chunk-SRAXNEJX.mjs.gz} +0 -0
- package/dist/{chunk-WVIKFMNS.js → chunk-XBR7W47W.js} +400 -401
- package/dist/chunk-XBR7W47W.js.br +0 -0
- package/dist/chunk-XBR7W47W.js.gz +0 -0
- package/dist/{chunk-O5DKWJDK.mjs → chunk-Z3DEULRJ.mjs} +1 -1
- package/dist/chunk-Z3DEULRJ.mjs.br +0 -0
- package/dist/chunk-Z3DEULRJ.mjs.gz +0 -0
- package/dist/index.js +45 -45
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/viewer/index.js +26 -26
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-4EYZDQXM.js.br +0 -0
- package/dist/AiChatPanel-4EYZDQXM.js.gz +0 -0
- package/dist/AiChatPanel-UCFQIWOQ.mjs.br +0 -0
- package/dist/AiChatPanel-UCFQIWOQ.mjs.gz +0 -0
- package/dist/Area3DChartScene-PMYXO4MR.mjs.br +0 -0
- package/dist/Area3DChartScene-PMYXO4MR.mjs.gz +0 -0
- package/dist/Area3DChartScene-YBMC6NKY.js.br +0 -0
- package/dist/Area3DChartScene-YBMC6NKY.js.gz +0 -0
- package/dist/Bar3DChartScene-75DCA2ZA.js.br +0 -0
- package/dist/Bar3DChartScene-75DCA2ZA.js.gz +0 -0
- package/dist/Bar3DChartScene-CEOI6SU6.mjs.br +0 -0
- package/dist/Bar3DChartScene-CEOI6SU6.mjs.gz +0 -0
- package/dist/Line3DChartScene-EZZKWUZR.mjs.br +0 -0
- package/dist/Line3DChartScene-EZZKWUZR.mjs.gz +0 -0
- package/dist/Line3DChartScene-STGX6N6V.js.br +0 -0
- package/dist/Line3DChartScene-STGX6N6V.js.gz +0 -0
- package/dist/Model3DScene-DWRD63FH.js.br +0 -0
- package/dist/Model3DScene-DWRD63FH.js.gz +0 -0
- package/dist/Model3DScene-FGQJKWL6.mjs.br +0 -0
- package/dist/Model3DScene-FGQJKWL6.mjs.gz +0 -0
- package/dist/PieChart3DScene-DH6RSJO6.mjs.br +0 -0
- package/dist/PieChart3DScene-DH6RSJO6.mjs.gz +0 -0
- package/dist/PieChart3DScene-R3Y7OVVO.js.br +0 -0
- package/dist/PieChart3DScene-R3Y7OVVO.js.gz +0 -0
- package/dist/SurfaceChart3DScene-BMBU5RKI.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-BMBU5RKI.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-UM5HA3VO.js.br +0 -0
- package/dist/SurfaceChart3DScene-UM5HA3VO.js.gz +0 -0
- package/dist/chunk-2HLDBQH7.js.br +0 -0
- package/dist/chunk-2HLDBQH7.js.gz +0 -0
- package/dist/chunk-4VVOTEQ4.mjs.br +0 -0
- package/dist/chunk-4VVOTEQ4.mjs.gz +0 -0
- package/dist/chunk-7ZQ2FZXE.js.br +0 -0
- package/dist/chunk-MQEG5GOV.js.br +0 -0
- package/dist/chunk-MQEG5GOV.js.gz +0 -0
- package/dist/chunk-O5DKWJDK.mjs.br +0 -0
- package/dist/chunk-O5DKWJDK.mjs.gz +0 -0
- package/dist/chunk-S546O4W2.mjs.br +0 -0
- package/dist/chunk-VLLZ3QL2.mjs.br +0 -0
- package/dist/chunk-VLLZ3QL2.mjs.gz +0 -0
- package/dist/chunk-W3J6SNVE.mjs.br +0 -0
- package/dist/chunk-W3J6SNVE.mjs.gz +0 -0
- package/dist/chunk-WVIKFMNS.js.br +0 -0
- package/dist/chunk-WVIKFMNS.js.gz +0 -0
- package/dist/chunk-YNUYFR2T.js.br +0 -0
- package/dist/chunk-YNUYFR2T.js.gz +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkOABOL32L_js = require('./chunk-OABOL32L.js');
|
|
4
4
|
var chunkSWRY3SI5_js = require('./chunk-SWRY3SI5.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkHMZA25W2_js = require('./chunk-HMZA25W2.js');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var reactI18next = require('react-i18next');
|
|
8
8
|
|
|
9
9
|
function useVirtualizedSlides({
|
|
10
10
|
totalItems,
|
|
11
11
|
itemHeight,
|
|
12
|
-
overscan =
|
|
12
|
+
overscan = chunkHMZA25W2_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 = chunkHMZA25W2_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 ??= chunkHMZA25W2_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 >= chunkHMZA25W2_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
|
+
}, chunkHMZA25W2_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 = chunkHMZA25W2_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
|
+
chunkHMZA25W2_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 = chunkHMZA25W2_js.validateRoomId(config.roomId);
|
|
244
244
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
245
|
-
departureRef.current =
|
|
245
|
+
departureRef.current = chunkHMZA25W2_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 = chunkHMZA25W2_js.validateRoomId(config.roomId);
|
|
288
|
+
const transport = config.transport ?? chunkHMZA25W2_js.resolveTransportForServerUrl(config.serverUrl);
|
|
289
289
|
if (transport === "webrtc") {
|
|
290
290
|
await initWebrtc();
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
293
|
+
if (chunkHMZA25W2_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 = chunkHMZA25W2_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
|
+
chunkHMZA25W2_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
|
+
}, chunkHMZA25W2_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
|
+
chunkHMZA25W2_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 = chunkHMZA25W2_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 = chunkHMZA25W2_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(chunkHMZA25W2_js.cloneSlide),
|
|
531
|
+
templateElementsBySlideId: chunkHMZA25W2_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(chunkHMZA25W2_js.cloneSlide));
|
|
545
545
|
setTemplateElementsBySlideId(
|
|
546
|
-
|
|
546
|
+
chunkHMZA25W2_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 = chunkOABOL32L_js.cloneHistorySnapshot(previousSnapshot);
|
|
586
|
+
lastHistorySnapshotRef.current = chunkOABOL32L_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 = chunkOABOL32L_js.cloneHistorySnapshot(nextSnapshot);
|
|
608
|
+
lastHistorySnapshotRef.current = chunkOABOL32L_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 = chunkOABOL32L_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 = chunkOABOL32L_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(chunkOABOL32L_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 = chunkOABOL32L_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(chunkHMZA25W2_js.createWheelStepBuffer());
|
|
747
747
|
const storeRef = react.useRef(null);
|
|
748
|
-
storeRef.current ??=
|
|
748
|
+
storeRef.current ??= chunkHMZA25W2_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 = chunkHMZA25W2_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, chunkOABOL32L_js.MIN_ELEMENT_SIZE));
|
|
847
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkOABOL32L_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, chunkOABOL32L_js.MIN_ELEMENT_SIZE);
|
|
854
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkOABOL32L_js.MIN_ELEMENT_SIZE);
|
|
855
855
|
const availableWidth = Math.max(
|
|
856
|
-
effectiveEditorDimensions.width -
|
|
857
|
-
|
|
856
|
+
effectiveEditorDimensions.width - chunkOABOL32L_js.ZOOM_TO_SELECTION_PADDING,
|
|
857
|
+
chunkOABOL32L_js.MIN_ELEMENT_SIZE
|
|
858
858
|
);
|
|
859
859
|
const availableHeight = Math.max(
|
|
860
|
-
effectiveEditorDimensions.height -
|
|
861
|
-
|
|
860
|
+
effectiveEditorDimensions.height - chunkOABOL32L_js.ZOOM_TO_SELECTION_PADDING,
|
|
861
|
+
chunkOABOL32L_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 = chunkHMZA25W2_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 = chunkHMZA25W2_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: chunkHMZA25W2_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
|
|
893
893
|
});
|
|
894
894
|
},
|
|
895
895
|
[store]
|
|
@@ -977,7 +977,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
977
977
|
const command = step.command;
|
|
978
978
|
const timer = window.setTimeout(
|
|
979
979
|
() => {
|
|
980
|
-
|
|
980
|
+
chunkOABOL32L_js.executeMediaCommand(command);
|
|
981
981
|
},
|
|
982
982
|
Math.max(0, step.delayMs)
|
|
983
983
|
);
|
|
@@ -1114,7 +1114,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1114
1114
|
}))
|
|
1115
1115
|
);
|
|
1116
1116
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1117
|
-
const delay =
|
|
1117
|
+
const delay = chunkHMZA25W2_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1118
1118
|
const timer = window.setTimeout(() => {
|
|
1119
1119
|
setPresentationAnimations(
|
|
1120
1120
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1146,7 +1146,7 @@ function useAnimationPlayback(input) {
|
|
|
1146
1146
|
(controller, group) => {
|
|
1147
1147
|
driveBuildReveal(
|
|
1148
1148
|
controller,
|
|
1149
|
-
|
|
1149
|
+
chunkHMZA25W2_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1150
1150
|
setPresentationElementStates,
|
|
1151
1151
|
buildRafRef
|
|
1152
1152
|
);
|
|
@@ -1215,7 +1215,7 @@ function useAnimationPlayback(input) {
|
|
|
1215
1215
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1216
1216
|
return;
|
|
1217
1217
|
}
|
|
1218
|
-
const controller =
|
|
1218
|
+
const controller = chunkHMZA25W2_js.PresentationAnimationController.fromSlide(slide);
|
|
1219
1219
|
controllerRef.current = controller;
|
|
1220
1220
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1221
1221
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1373,12 +1373,12 @@ function useAnimationPlayback(input) {
|
|
|
1373
1373
|
presentationTimersRef
|
|
1374
1374
|
};
|
|
1375
1375
|
}
|
|
1376
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1377
|
-
var AUDIENCE_HASH =
|
|
1378
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1379
|
-
var AUDIENCE_NONCE_KEY =
|
|
1376
|
+
var PRESENTER_CHANNEL_NAME = chunkHMZA25W2_js.PRESENTATION_CHANNEL_NAME;
|
|
1377
|
+
var AUDIENCE_HASH = chunkHMZA25W2_js.PRESENTATION_HASH;
|
|
1378
|
+
var PRESENTER_MSG_ORIGIN = chunkHMZA25W2_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1379
|
+
var AUDIENCE_NONCE_KEY = chunkHMZA25W2_js.PRESENTATION_NONCE_KEY;
|
|
1380
1380
|
function generateSessionId() {
|
|
1381
|
-
return
|
|
1381
|
+
return chunkHMZA25W2_js.createPresentationSessionId();
|
|
1382
1382
|
}
|
|
1383
1383
|
function parseAudienceNonce() {
|
|
1384
1384
|
const hash = window.location.hash;
|
|
@@ -1414,7 +1414,7 @@ function usePresenterWindow(input) {
|
|
|
1414
1414
|
}, []);
|
|
1415
1415
|
const swapDisplays = react.useCallback(async () => {
|
|
1416
1416
|
const audience = audienceWindowRef.current;
|
|
1417
|
-
return audience && !audience.closed ?
|
|
1417
|
+
return audience && !audience.closed ? chunkHMZA25W2_js.swapPresentationWindows(window, audience) : false;
|
|
1418
1418
|
}, []);
|
|
1419
1419
|
const syncSlideToAudience = react.useCallback(
|
|
1420
1420
|
(slideIndex) => {
|
|
@@ -1478,7 +1478,7 @@ function usePresenterWindow(input) {
|
|
|
1478
1478
|
pollTimerRef.current = null;
|
|
1479
1479
|
}
|
|
1480
1480
|
if (closingSessionId) {
|
|
1481
|
-
void
|
|
1481
|
+
void chunkHMZA25W2_js.clearAudienceContent(closingSessionId);
|
|
1482
1482
|
}
|
|
1483
1483
|
}, [getChannel]);
|
|
1484
1484
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1496,10 +1496,10 @@ function usePresenterWindow(input) {
|
|
|
1496
1496
|
audienceWindowRef.current = blankWin;
|
|
1497
1497
|
const sessionId = generateSessionId();
|
|
1498
1498
|
sessionIdRef.current = sessionId;
|
|
1499
|
-
const audienceUrl =
|
|
1500
|
-
void
|
|
1499
|
+
const audienceUrl = chunkHMZA25W2_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1500
|
+
void chunkHMZA25W2_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1501
1501
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1502
|
-
|
|
1502
|
+
chunkHMZA25W2_js.placeAudienceWindow(blankWin, placement);
|
|
1503
1503
|
}
|
|
1504
1504
|
return void 0;
|
|
1505
1505
|
});
|
|
@@ -1529,7 +1529,7 @@ function usePresenterWindow(input) {
|
|
|
1529
1529
|
}
|
|
1530
1530
|
};
|
|
1531
1531
|
if (content) {
|
|
1532
|
-
void
|
|
1532
|
+
void chunkHMZA25W2_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1533
1533
|
} else {
|
|
1534
1534
|
navigateOrClose(true);
|
|
1535
1535
|
}
|
|
@@ -1555,7 +1555,7 @@ function usePresenterWindow(input) {
|
|
|
1555
1555
|
}
|
|
1556
1556
|
const handleMessage = (event) => {
|
|
1557
1557
|
const message = event.data;
|
|
1558
|
-
if (
|
|
1558
|
+
if (chunkHMZA25W2_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1559
1559
|
syncStateToAudience(snapshotRef.current);
|
|
1560
1560
|
}
|
|
1561
1561
|
};
|
|
@@ -1584,7 +1584,7 @@ function usePresenterWindow(input) {
|
|
|
1584
1584
|
react.useEffect(() => {
|
|
1585
1585
|
const handleBeforeUnload = () => {
|
|
1586
1586
|
if (sessionIdRef.current) {
|
|
1587
|
-
void
|
|
1587
|
+
void chunkHMZA25W2_js.clearAudienceContent(sessionIdRef.current);
|
|
1588
1588
|
}
|
|
1589
1589
|
};
|
|
1590
1590
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1646,7 +1646,7 @@ function useAudienceMode(input) {
|
|
|
1646
1646
|
}
|
|
1647
1647
|
channel.onmessage = (event) => {
|
|
1648
1648
|
const data = event.data;
|
|
1649
|
-
if (!
|
|
1649
|
+
if (!chunkHMZA25W2_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1650
1650
|
return;
|
|
1651
1651
|
}
|
|
1652
1652
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1662,16 +1662,16 @@ function useAudienceMode(input) {
|
|
|
1662
1662
|
}
|
|
1663
1663
|
if (data.type === "presenter-exit") {
|
|
1664
1664
|
if (expectedSessionId) {
|
|
1665
|
-
void
|
|
1665
|
+
void chunkHMZA25W2_js.clearAudienceContent(expectedSessionId);
|
|
1666
1666
|
}
|
|
1667
|
-
if (
|
|
1667
|
+
if (chunkHMZA25W2_js.endAudienceDisplay(window)) {
|
|
1668
1668
|
handlers.onPresenterEnded?.();
|
|
1669
1669
|
}
|
|
1670
1670
|
}
|
|
1671
1671
|
};
|
|
1672
1672
|
if (expectedSessionId) {
|
|
1673
1673
|
channel.postMessage({
|
|
1674
|
-
origin:
|
|
1674
|
+
origin: chunkHMZA25W2_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1675
1675
|
type: "audience-ready",
|
|
1676
1676
|
sessionId: expectedSessionId
|
|
1677
1677
|
});
|
|
@@ -1685,7 +1685,7 @@ function useAudienceMode(input) {
|
|
|
1685
1685
|
}, []);
|
|
1686
1686
|
}
|
|
1687
1687
|
function usePresentationKeyboard(input) {
|
|
1688
|
-
const wheelBufferRef = react.useRef(
|
|
1688
|
+
const wheelBufferRef = react.useRef(chunkHMZA25W2_js.createWheelStepBuffer());
|
|
1689
1689
|
const {
|
|
1690
1690
|
mode,
|
|
1691
1691
|
movePresentationSlide,
|
|
@@ -1706,14 +1706,14 @@ function usePresentationKeyboard(input) {
|
|
|
1706
1706
|
presentationSlideIndex,
|
|
1707
1707
|
setShowRehearsalSummary
|
|
1708
1708
|
} = input;
|
|
1709
|
-
const keyBufferRef = react.useRef(
|
|
1709
|
+
const keyBufferRef = react.useRef(chunkHMZA25W2_js.createPresentationKeyBuffer());
|
|
1710
1710
|
react.useEffect(() => {
|
|
1711
|
-
if (mode !== "present" || !
|
|
1712
|
-
keyBufferRef.current =
|
|
1711
|
+
if (mode !== "present" || !chunkHMZA25W2_js.acceptsPresentationInput()) {
|
|
1712
|
+
keyBufferRef.current = chunkHMZA25W2_js.createPresentationKeyBuffer();
|
|
1713
1713
|
return;
|
|
1714
1714
|
}
|
|
1715
1715
|
const handleKeyDown = (event) => {
|
|
1716
|
-
const mapped =
|
|
1716
|
+
const mapped = chunkHMZA25W2_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1717
1717
|
if (mapped.action === "none") {
|
|
1718
1718
|
return;
|
|
1719
1719
|
}
|
|
@@ -1733,12 +1733,12 @@ function usePresentationKeyboard(input) {
|
|
|
1733
1733
|
movePresentationSlide(-1);
|
|
1734
1734
|
return;
|
|
1735
1735
|
case "first": {
|
|
1736
|
-
const first =
|
|
1736
|
+
const first = chunkHMZA25W2_js.firstShowSlideIndex(showSlideIndexes);
|
|
1737
1737
|
navigateToSlide(first ?? 0);
|
|
1738
1738
|
return;
|
|
1739
1739
|
}
|
|
1740
1740
|
case "last": {
|
|
1741
|
-
const last =
|
|
1741
|
+
const last = chunkHMZA25W2_js.lastShowSlideIndex(showSlideIndexes);
|
|
1742
1742
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1743
1743
|
return;
|
|
1744
1744
|
}
|
|
@@ -1776,10 +1776,10 @@ function usePresentationKeyboard(input) {
|
|
|
1776
1776
|
}
|
|
1777
1777
|
};
|
|
1778
1778
|
const handleWheel = (event) => {
|
|
1779
|
-
if (mode !== "present" || !
|
|
1779
|
+
if (mode !== "present" || !chunkHMZA25W2_js.acceptsPresentationInput()) {
|
|
1780
1780
|
return;
|
|
1781
1781
|
}
|
|
1782
|
-
const mapped =
|
|
1782
|
+
const mapped = chunkHMZA25W2_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1783
1783
|
if (mapped.intent === "next-slide") {
|
|
1784
1784
|
event.preventDefault();
|
|
1785
1785
|
movePresentationSlide(1);
|
|
@@ -1912,7 +1912,7 @@ function useRehearsalTimings(input) {
|
|
|
1912
1912
|
|
|
1913
1913
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1914
1914
|
function handlePresentationActionImpl(action, deps) {
|
|
1915
|
-
|
|
1915
|
+
chunkHMZA25W2_js.runPresentationAction(
|
|
1916
1916
|
action,
|
|
1917
1917
|
{ slideCount: deps.slidesLength },
|
|
1918
1918
|
{
|
|
@@ -1934,7 +1934,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1934
1934
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1935
1935
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1936
1936
|
const transition = incomingSlide?.transition;
|
|
1937
|
-
const durationMs = deps.playTransition ?
|
|
1937
|
+
const durationMs = deps.playTransition ? chunkHMZA25W2_js.resolveTransitionDurationMs(transition) : 0;
|
|
1938
1938
|
deps.clearPresentationTimers();
|
|
1939
1939
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1940
1940
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1993,7 +1993,7 @@ function useSlideNavigation(input) {
|
|
|
1993
1993
|
});
|
|
1994
1994
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1995
1995
|
(slideIndex) => {
|
|
1996
|
-
const delayMs =
|
|
1996
|
+
const delayMs = chunkHMZA25W2_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1997
1997
|
if (delayMs === void 0) {
|
|
1998
1998
|
return;
|
|
1999
1999
|
}
|
|
@@ -2016,7 +2016,7 @@ function useSlideNavigation(input) {
|
|
|
2016
2016
|
if (availableSlideIndexes.length === 0) {
|
|
2017
2017
|
return;
|
|
2018
2018
|
}
|
|
2019
|
-
const pastLastSlide = direction === 1 && !
|
|
2019
|
+
const pastLastSlide = direction === 1 && !chunkHMZA25W2_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
2020
2020
|
if (rehearsing && pastLastSlide) {
|
|
2021
2021
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
2022
2022
|
try {
|
|
@@ -2034,9 +2034,9 @@ function useSlideNavigation(input) {
|
|
|
2034
2034
|
onAdvancePastLastSlide();
|
|
2035
2035
|
return;
|
|
2036
2036
|
}
|
|
2037
|
-
const nextSlideIndex = direction === 1 ?
|
|
2037
|
+
const nextSlideIndex = direction === 1 ? chunkHMZA25W2_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
2038
2038
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
2039
|
-
}) :
|
|
2039
|
+
}) : chunkHMZA25W2_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
2040
2040
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
2041
2041
|
return;
|
|
2042
2042
|
}
|
|
@@ -2181,22 +2181,22 @@ function useZoomNavigation(input) {
|
|
|
2181
2181
|
};
|
|
2182
2182
|
}
|
|
2183
2183
|
function usePresenterConsole(slideIndex, active) {
|
|
2184
|
-
const timerRef = react.useRef(
|
|
2185
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2184
|
+
const timerRef = react.useRef(chunkHMZA25W2_js.createPresenterTimer());
|
|
2185
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkHMZA25W2_js.createInitialPresentationSnapshot(slideIndex));
|
|
2186
2186
|
const patch = react.useCallback((value) => {
|
|
2187
|
-
setSnapshot((current) =>
|
|
2187
|
+
setSnapshot((current) => chunkHMZA25W2_js.mergePresentationSnapshot(current, value));
|
|
2188
2188
|
}, []);
|
|
2189
2189
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2190
2190
|
react.useEffect(() => {
|
|
2191
2191
|
if (!active) {
|
|
2192
2192
|
return;
|
|
2193
2193
|
}
|
|
2194
|
-
timerRef.current =
|
|
2194
|
+
timerRef.current = chunkHMZA25W2_js.resetPresenterTimer();
|
|
2195
2195
|
patch({ paused: false, elapsedMs: 0 });
|
|
2196
2196
|
const timer = window.setInterval(() => {
|
|
2197
2197
|
patch({
|
|
2198
2198
|
paused: timerRef.current.paused,
|
|
2199
|
-
elapsedMs:
|
|
2199
|
+
elapsedMs: chunkHMZA25W2_js.presenterElapsed(timerRef.current)
|
|
2200
2200
|
});
|
|
2201
2201
|
}, 1e3);
|
|
2202
2202
|
return () => window.clearInterval(timer);
|
|
@@ -2206,19 +2206,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2206
2206
|
applyAudienceSnapshot: setSnapshot,
|
|
2207
2207
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2208
2208
|
toggleTimer: () => {
|
|
2209
|
-
timerRef.current =
|
|
2209
|
+
timerRef.current = chunkHMZA25W2_js.togglePresenterTimer(timerRef.current);
|
|
2210
2210
|
patch({
|
|
2211
2211
|
paused: timerRef.current.paused,
|
|
2212
|
-
elapsedMs:
|
|
2212
|
+
elapsedMs: chunkHMZA25W2_js.presenterElapsed(timerRef.current)
|
|
2213
2213
|
});
|
|
2214
2214
|
},
|
|
2215
2215
|
resetTimer: () => {
|
|
2216
|
-
timerRef.current =
|
|
2216
|
+
timerRef.current = chunkHMZA25W2_js.resetPresenterTimer();
|
|
2217
2217
|
patch({ paused: false, elapsedMs: 0 });
|
|
2218
2218
|
},
|
|
2219
2219
|
stepZoom: (direction) => setSnapshot(
|
|
2220
|
-
(current) =>
|
|
2221
|
-
zoom:
|
|
2220
|
+
(current) => chunkHMZA25W2_js.mergePresentationSnapshot(current, {
|
|
2221
|
+
zoom: chunkHMZA25W2_js.stepPresenterZoom(
|
|
2222
2222
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2223
2223
|
direction
|
|
2224
2224
|
)
|
|
@@ -2264,7 +2264,7 @@ function usePresentationMode(input) {
|
|
|
2264
2264
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2265
2265
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2266
2266
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2267
|
-
const showGuard = react.useMemo(() =>
|
|
2267
|
+
const showGuard = react.useMemo(() => chunkHMZA25W2_js.createPresenterShowGuard(), []);
|
|
2268
2268
|
const {
|
|
2269
2269
|
presentationAnimations,
|
|
2270
2270
|
presentationElementStates,
|
|
@@ -2343,7 +2343,7 @@ function usePresentationMode(input) {
|
|
|
2343
2343
|
});
|
|
2344
2344
|
const movePresentationSlide = react.useCallback(
|
|
2345
2345
|
(direction, trigger = "explicit") => {
|
|
2346
|
-
if (!
|
|
2346
|
+
if (!chunkHMZA25W2_js.acceptsPresentationInput()) {
|
|
2347
2347
|
return;
|
|
2348
2348
|
}
|
|
2349
2349
|
if (endOfShowVisible) {
|
|
@@ -2481,7 +2481,7 @@ function usePresentationMode(input) {
|
|
|
2481
2481
|
if (mode !== "present") {
|
|
2482
2482
|
return;
|
|
2483
2483
|
}
|
|
2484
|
-
return
|
|
2484
|
+
return chunkHMZA25W2_js.attachPresentationVisibilityPause({
|
|
2485
2485
|
root: containerRef.current ?? void 0,
|
|
2486
2486
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2487
2487
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2561,11 +2561,11 @@ function usePresentationMode(input) {
|
|
|
2561
2561
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2562
2562
|
return void 0;
|
|
2563
2563
|
}
|
|
2564
|
-
return
|
|
2564
|
+
return chunkHMZA25W2_js.buildMorphTransitionPlan(
|
|
2565
2565
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2566
2566
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2567
2567
|
transitionOverlay.durationMs,
|
|
2568
|
-
|
|
2568
|
+
chunkHMZA25W2_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2569
2569
|
);
|
|
2570
2570
|
}, [transitionOverlay, slides]);
|
|
2571
2571
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2586,7 +2586,7 @@ function usePresentationMode(input) {
|
|
|
2586
2586
|
if (!morphPlan) {
|
|
2587
2587
|
return presentationKeyframesCss;
|
|
2588
2588
|
}
|
|
2589
|
-
const imageRules =
|
|
2589
|
+
const imageRules = chunkHMZA25W2_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2590
2590
|
return `${presentationKeyframesCss ?? ""}
|
|
2591
2591
|
${morphPlan.keyframesCss}
|
|
2592
2592
|
${imageRules}`;
|
|
@@ -2882,7 +2882,7 @@ function useFindReplace({
|
|
|
2882
2882
|
const [findResults, setFindResults] = react.useState([]);
|
|
2883
2883
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
2884
2884
|
const performFind = react.useCallback(() => {
|
|
2885
|
-
const results =
|
|
2885
|
+
const results = chunkHMZA25W2_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
2886
2886
|
if (!findQuery) {
|
|
2887
2887
|
setFindResults([]);
|
|
2888
2888
|
setFindResultIndex(-1);
|
|
@@ -2916,7 +2916,7 @@ function useFindReplace({
|
|
|
2916
2916
|
return;
|
|
2917
2917
|
}
|
|
2918
2918
|
onUpdateSlides(
|
|
2919
|
-
(prevSlides) =>
|
|
2919
|
+
(prevSlides) => chunkHMZA25W2_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
2920
2920
|
);
|
|
2921
2921
|
onMarkDirty();
|
|
2922
2922
|
},
|
|
@@ -2938,9 +2938,9 @@ function useFindReplace({
|
|
|
2938
2938
|
}, [findResults, applyReplacements, performFind]);
|
|
2939
2939
|
react.useEffect(() => {
|
|
2940
2940
|
const handler = (event) => {
|
|
2941
|
-
const { action } =
|
|
2941
|
+
const { action } = chunkHMZA25W2_js.mapEditorKey(event, {
|
|
2942
2942
|
canEdit: mode === "edit",
|
|
2943
|
-
isTextInputTarget:
|
|
2943
|
+
isTextInputTarget: chunkHMZA25W2_js.isEditorTextInputTarget(event.target)
|
|
2944
2944
|
});
|
|
2945
2945
|
if (action !== "find") {
|
|
2946
2946
|
return;
|
|
@@ -3019,7 +3019,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId) {
|
|
|
3019
3019
|
if (!slide) {
|
|
3020
3020
|
return { slides, didAdd: false };
|
|
3021
3021
|
}
|
|
3022
|
-
const next =
|
|
3022
|
+
const next = chunkHMZA25W2_js.addCommentToList(
|
|
3023
3023
|
slide.comments || [],
|
|
3024
3024
|
text,
|
|
3025
3025
|
authorName,
|
|
@@ -3037,7 +3037,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
|
3037
3037
|
if (!slide) {
|
|
3038
3038
|
return { slides, didDelete: false };
|
|
3039
3039
|
}
|
|
3040
|
-
const next =
|
|
3040
|
+
const next = chunkHMZA25W2_js.removeCommentFromList(slide.comments || [], commentId);
|
|
3041
3041
|
if (!next) {
|
|
3042
3042
|
return { slides, didDelete: false };
|
|
3043
3043
|
}
|
|
@@ -3048,7 +3048,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
|
3048
3048
|
if (!slide) {
|
|
3049
3049
|
return { slides, didUpdate: false };
|
|
3050
3050
|
}
|
|
3051
|
-
const next =
|
|
3051
|
+
const next = chunkHMZA25W2_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
3052
3052
|
if (!next) {
|
|
3053
3053
|
return { slides, didUpdate: false };
|
|
3054
3054
|
}
|
|
@@ -3059,7 +3059,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
|
3059
3059
|
if (!slide) {
|
|
3060
3060
|
return { slides, didUpdate: false };
|
|
3061
3061
|
}
|
|
3062
|
-
const next =
|
|
3062
|
+
const next = chunkHMZA25W2_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
3063
3063
|
if (!next) {
|
|
3064
3064
|
return { slides, didUpdate: false };
|
|
3065
3065
|
}
|
|
@@ -3070,7 +3070,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName) {
|
|
|
3070
3070
|
if (!slide) {
|
|
3071
3071
|
return { slides, didAdd: false };
|
|
3072
3072
|
}
|
|
3073
|
-
const next =
|
|
3073
|
+
const next = chunkHMZA25W2_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
3074
3074
|
if (!next) {
|
|
3075
3075
|
return { slides, didAdd: false };
|
|
3076
3076
|
}
|
|
@@ -3444,7 +3444,7 @@ function useViewerCoreState(_input) {
|
|
|
3444
3444
|
const marqueeStateRef = react.useRef(null);
|
|
3445
3445
|
const isDrawingRef = react.useRef(false);
|
|
3446
3446
|
const justInteractedRef = react.useRef(false);
|
|
3447
|
-
const livePatcher = react.useMemo(() =>
|
|
3447
|
+
const livePatcher = react.useMemo(() => chunkHMZA25W2_js.createCollaborationLivePatcher(), []);
|
|
3448
3448
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3449
3449
|
const slidesRef = react.useRef([]);
|
|
3450
3450
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3453,8 +3453,8 @@ function useViewerCoreState(_input) {
|
|
|
3453
3453
|
const [slides, setSlides] = react.useState([]);
|
|
3454
3454
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3455
3455
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3456
|
-
width:
|
|
3457
|
-
height:
|
|
3456
|
+
width: chunkOABOL32L_js.DEFAULT_CANVAS_WIDTH,
|
|
3457
|
+
height: chunkOABOL32L_js.DEFAULT_CANVAS_HEIGHT
|
|
3458
3458
|
});
|
|
3459
3459
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3460
3460
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3475,7 +3475,7 @@ function useViewerCoreState(_input) {
|
|
|
3475
3475
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3476
3476
|
inlineEditingTextRef.current = resolved;
|
|
3477
3477
|
setInlineEditingTextBase(value);
|
|
3478
|
-
|
|
3478
|
+
chunkHMZA25W2_js.publishLiveInlineText(
|
|
3479
3479
|
livePatcher,
|
|
3480
3480
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3481
3481
|
inlineEditingElementIdRef.current,
|
|
@@ -3819,7 +3819,7 @@ function useLoadContent({
|
|
|
3819
3819
|
);
|
|
3820
3820
|
}
|
|
3821
3821
|
const previousHandler = handlerRef.current;
|
|
3822
|
-
const handler = new
|
|
3822
|
+
const handler = new chunkHMZA25W2_js.PptxHandler();
|
|
3823
3823
|
const parsed = await handler.load(buffer, { allowExternalImages });
|
|
3824
3824
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3825
3825
|
handler.dispose();
|
|
@@ -3831,7 +3831,7 @@ function useLoadContent({
|
|
|
3831
3831
|
handlerRef.current = null;
|
|
3832
3832
|
const mediaElements = [];
|
|
3833
3833
|
for (const slide of parsed.slides) {
|
|
3834
|
-
|
|
3834
|
+
chunkHMZA25W2_js.collectMediaElements(slide.elements, mediaElements);
|
|
3835
3835
|
}
|
|
3836
3836
|
for (const url of mediaDataUrls.values()) {
|
|
3837
3837
|
if (url.startsWith("blob:")) {
|
|
@@ -3872,7 +3872,7 @@ function useLoadContent({
|
|
|
3872
3872
|
}
|
|
3873
3873
|
})
|
|
3874
3874
|
);
|
|
3875
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3875
|
+
const { paths: imagePaths, refs: imageRefs } = chunkHMZA25W2_js.collectImagePaths(parsed.slides);
|
|
3876
3876
|
let nextSlides = parsed.slides;
|
|
3877
3877
|
if (imagePaths.size > 0) {
|
|
3878
3878
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3926,7 +3926,7 @@ function useLoadContent({
|
|
|
3926
3926
|
});
|
|
3927
3927
|
}
|
|
3928
3928
|
}
|
|
3929
|
-
const { paths: tableImagePaths, refs: tableImageRefs } =
|
|
3929
|
+
const { paths: tableImagePaths, refs: tableImageRefs } = chunkHMZA25W2_js.collectTableCellImagePaths(nextSlides);
|
|
3930
3930
|
if (tableImagePaths.size > 0) {
|
|
3931
3931
|
const resolvedTableMap = /* @__PURE__ */ new Map();
|
|
3932
3932
|
await Promise.all(
|
|
@@ -3942,7 +3942,7 @@ function useLoadContent({
|
|
|
3942
3942
|
);
|
|
3943
3943
|
if (resolvedTableMap.size > 0) {
|
|
3944
3944
|
nextSlides = nextSlides.map((s) => {
|
|
3945
|
-
const newElements =
|
|
3945
|
+
const newElements = chunkHMZA25W2_js.applyTableCellImagePatches(
|
|
3946
3946
|
s.elements,
|
|
3947
3947
|
resolvedTableMap,
|
|
3948
3948
|
tableImageRefs
|
|
@@ -3952,7 +3952,7 @@ function useLoadContent({
|
|
|
3952
3952
|
}
|
|
3953
3953
|
}
|
|
3954
3954
|
let nextTableStyleMap = parsed.tableStyleMap;
|
|
3955
|
-
const { paths: tableStyleImagePaths, refs: tableStyleImageRefs } =
|
|
3955
|
+
const { paths: tableStyleImagePaths, refs: tableStyleImageRefs } = chunkHMZA25W2_js.collectTableStyleImagePaths(nextTableStyleMap);
|
|
3956
3956
|
if (tableStyleImagePaths.size > 0) {
|
|
3957
3957
|
const resolvedStyleMap = /* @__PURE__ */ new Map();
|
|
3958
3958
|
await Promise.all(
|
|
@@ -3967,7 +3967,7 @@ function useLoadContent({
|
|
|
3967
3967
|
})
|
|
3968
3968
|
);
|
|
3969
3969
|
if (resolvedStyleMap.size > 0 && nextTableStyleMap) {
|
|
3970
|
-
nextTableStyleMap =
|
|
3970
|
+
nextTableStyleMap = chunkHMZA25W2_js.applyTableStyleImagePatches(
|
|
3971
3971
|
nextTableStyleMap,
|
|
3972
3972
|
resolvedStyleMap,
|
|
3973
3973
|
tableStyleImageRefs
|
|
@@ -3975,12 +3975,12 @@ function useLoadContent({
|
|
|
3975
3975
|
}
|
|
3976
3976
|
}
|
|
3977
3977
|
handlerRef.current = handler;
|
|
3978
|
-
const partition =
|
|
3978
|
+
const partition = chunkHMZA25W2_js.partitionTemplateElements(nextSlides);
|
|
3979
3979
|
setSlides(partition.slides);
|
|
3980
3980
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3981
3981
|
setCanvasSize({
|
|
3982
|
-
width: parsed.width ??
|
|
3983
|
-
height: parsed.height ??
|
|
3982
|
+
width: parsed.width ?? chunkOABOL32L_js.DEFAULT_CANVAS_WIDTH,
|
|
3983
|
+
height: parsed.height ?? chunkOABOL32L_js.DEFAULT_CANVAS_HEIGHT
|
|
3984
3984
|
});
|
|
3985
3985
|
setSlideSizeEmu(
|
|
3986
3986
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -3997,7 +3997,7 @@ function useLoadContent({
|
|
|
3997
3997
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
3998
3998
|
setCustomShows(parsed.customShows ?? []);
|
|
3999
3999
|
setActiveCustomShowId(
|
|
4000
|
-
|
|
4000
|
+
chunkHMZA25W2_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
4001
4001
|
);
|
|
4002
4002
|
setSections(parsed.sections ?? []);
|
|
4003
4003
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -4020,7 +4020,7 @@ function useLoadContent({
|
|
|
4020
4020
|
setHasMacros(parsed.hasMacros === true);
|
|
4021
4021
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4022
4022
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4023
|
-
setGuides(
|
|
4023
|
+
setGuides(chunkHMZA25W2_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4024
4024
|
setActiveSlideIndex(0);
|
|
4025
4025
|
clearSelection();
|
|
4026
4026
|
setIsDirty(false);
|
|
@@ -4028,7 +4028,7 @@ function useLoadContent({
|
|
|
4028
4028
|
onContentApplied?.();
|
|
4029
4029
|
} catch (err) {
|
|
4030
4030
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4031
|
-
if (err instanceof
|
|
4031
|
+
if (err instanceof chunkHMZA25W2_js.EncryptedFileError) {
|
|
4032
4032
|
setIsEncrypted(true);
|
|
4033
4033
|
} else {
|
|
4034
4034
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4056,7 +4056,7 @@ function useLoadContent({
|
|
|
4056
4056
|
}
|
|
4057
4057
|
function useAutosave(input) {
|
|
4058
4058
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4059
|
-
const intervalMs =
|
|
4059
|
+
const intervalMs = chunkHMZA25W2_js.resolveAutosaveIntervalMs({
|
|
4060
4060
|
hostIntervalMs: input.intervalMs,
|
|
4061
4061
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4062
4062
|
});
|
|
@@ -4087,7 +4087,7 @@ function useAutosave(input) {
|
|
|
4087
4087
|
return;
|
|
4088
4088
|
}
|
|
4089
4089
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4090
|
-
if (!
|
|
4090
|
+
if (!chunkHMZA25W2_js.shouldWriteAutosaveSnapshot({
|
|
4091
4091
|
filePath: path,
|
|
4092
4092
|
isDirty: isDirtyRef.current,
|
|
4093
4093
|
saving: isSavingRef.current,
|
|
@@ -4105,8 +4105,8 @@ function useAutosave(input) {
|
|
|
4105
4105
|
isSavingRef.current = false;
|
|
4106
4106
|
return;
|
|
4107
4107
|
}
|
|
4108
|
-
await
|
|
4109
|
-
lastSnapshotRef.current =
|
|
4108
|
+
await chunkHMZA25W2_js.saveAutosaveSnapshot(path, data);
|
|
4109
|
+
lastSnapshotRef.current = chunkHMZA25W2_js.autosaveSnapshotMark(path, sources);
|
|
4110
4110
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4111
4111
|
} catch (err) {
|
|
4112
4112
|
setAutosaveStatus({
|
|
@@ -4192,11 +4192,11 @@ function useElementOperations(input) {
|
|
|
4192
4192
|
(elementId, updates) => {
|
|
4193
4193
|
if (masterView?.target) {
|
|
4194
4194
|
applyMasterViewWrite(
|
|
4195
|
-
|
|
4195
|
+
chunkHMZA25W2_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4196
4196
|
);
|
|
4197
4197
|
return;
|
|
4198
4198
|
}
|
|
4199
|
-
if (
|
|
4199
|
+
if (chunkHMZA25W2_js.isTemplateElementId(elementId)) {
|
|
4200
4200
|
const slideId = activeSlide?.id;
|
|
4201
4201
|
if (slideId) {
|
|
4202
4202
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4244,7 +4244,7 @@ function useElementOperations(input) {
|
|
|
4244
4244
|
);
|
|
4245
4245
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4246
4246
|
(updates) => {
|
|
4247
|
-
if (!selectedElement || !
|
|
4247
|
+
if (!selectedElement || !chunkHMZA25W2_js.hasShapeProperties(selectedElement)) {
|
|
4248
4248
|
return;
|
|
4249
4249
|
}
|
|
4250
4250
|
updateSelectedElement({
|
|
@@ -4255,17 +4255,17 @@ function useElementOperations(input) {
|
|
|
4255
4255
|
);
|
|
4256
4256
|
const updateSelectedTextStyle = react.useCallback(
|
|
4257
4257
|
(updates) => {
|
|
4258
|
-
if (!selectedElement || !
|
|
4258
|
+
if (!selectedElement || !chunkHMZA25W2_js.hasTextProperties(selectedElement)) {
|
|
4259
4259
|
return;
|
|
4260
4260
|
}
|
|
4261
|
-
const inlineSel =
|
|
4261
|
+
const inlineSel = chunkHMZA25W2_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4262
4262
|
if (inlineSel && selectedElement.textSegments) {
|
|
4263
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4263
|
+
const { newSegments: newSegments2, newSelection } = chunkHMZA25W2_js.applyStyleToSelectedSegments(
|
|
4264
4264
|
selectedElement.textSegments,
|
|
4265
4265
|
inlineSel,
|
|
4266
4266
|
updates
|
|
4267
4267
|
);
|
|
4268
|
-
|
|
4268
|
+
chunkHMZA25W2_js.setPendingSelectionRestore(newSelection);
|
|
4269
4269
|
updateSelectedElement({
|
|
4270
4270
|
textSegments: newSegments2
|
|
4271
4271
|
});
|
|
@@ -4285,12 +4285,12 @@ function useElementOperations(input) {
|
|
|
4285
4285
|
);
|
|
4286
4286
|
const updateSelectedTextCase = react.useCallback(
|
|
4287
4287
|
(mode) => {
|
|
4288
|
-
if (!selectedElement || !
|
|
4288
|
+
if (!selectedElement || !chunkHMZA25W2_js.hasTextProperties(selectedElement)) {
|
|
4289
4289
|
return;
|
|
4290
4290
|
}
|
|
4291
|
-
const inlineSel =
|
|
4291
|
+
const inlineSel = chunkHMZA25W2_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4292
4292
|
if (inlineSel && selectedElement.textSegments) {
|
|
4293
|
-
const newSegments =
|
|
4293
|
+
const newSegments = chunkHMZA25W2_js.applyCaseTransformToSegments(
|
|
4294
4294
|
selectedElement.textSegments,
|
|
4295
4295
|
inlineSel,
|
|
4296
4296
|
mode
|
|
@@ -4300,14 +4300,14 @@ function useElementOperations(input) {
|
|
|
4300
4300
|
}
|
|
4301
4301
|
const updates = {};
|
|
4302
4302
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4303
|
-
updates.textSegments =
|
|
4303
|
+
updates.textSegments = chunkHMZA25W2_js.applyCaseTransformToSegments(
|
|
4304
4304
|
selectedElement.textSegments,
|
|
4305
4305
|
null,
|
|
4306
4306
|
mode
|
|
4307
4307
|
);
|
|
4308
4308
|
}
|
|
4309
4309
|
if (typeof selectedElement.text === "string") {
|
|
4310
|
-
updates.text =
|
|
4310
|
+
updates.text = chunkHMZA25W2_js.transformTextCase(selectedElement.text, mode);
|
|
4311
4311
|
}
|
|
4312
4312
|
updateSelectedElement(updates);
|
|
4313
4313
|
},
|
|
@@ -4320,15 +4320,15 @@ function useElementOperations(input) {
|
|
|
4320
4320
|
[setSlides]
|
|
4321
4321
|
);
|
|
4322
4322
|
const masterViewTarget = masterView?.target ?? null;
|
|
4323
|
-
const activeElements = masterViewTarget ?
|
|
4323
|
+
const activeElements = masterViewTarget ? chunkHMZA25W2_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4324
4324
|
const updateActiveElements = react.useCallback(
|
|
4325
4325
|
(updater) => {
|
|
4326
4326
|
if (masterView?.target) {
|
|
4327
4327
|
applyMasterViewWrite(
|
|
4328
|
-
|
|
4328
|
+
chunkHMZA25W2_js.replaceMasterViewElements(
|
|
4329
4329
|
masterView,
|
|
4330
4330
|
masterView.target,
|
|
4331
|
-
updater(
|
|
4331
|
+
updater(chunkHMZA25W2_js.masterViewElements(masterView, masterView.target))
|
|
4332
4332
|
)
|
|
4333
4333
|
);
|
|
4334
4334
|
return;
|
|
@@ -4381,7 +4381,7 @@ function useSectionOperations(input) {
|
|
|
4381
4381
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4382
4382
|
const addSection2 = react.useCallback(
|
|
4383
4383
|
(name, afterSlideIndex) => {
|
|
4384
|
-
const result =
|
|
4384
|
+
const result = chunkHMZA25W2_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4385
4385
|
setSlides(result.slides);
|
|
4386
4386
|
setSections(result.sections);
|
|
4387
4387
|
markDirty();
|
|
@@ -4390,7 +4390,7 @@ function useSectionOperations(input) {
|
|
|
4390
4390
|
);
|
|
4391
4391
|
const renameSection2 = react.useCallback(
|
|
4392
4392
|
(sectionId, newName) => {
|
|
4393
|
-
const result =
|
|
4393
|
+
const result = chunkHMZA25W2_js.renameSection(sections, slides, sectionId, newName);
|
|
4394
4394
|
setSections(result.sections);
|
|
4395
4395
|
setSlides(result.slides);
|
|
4396
4396
|
markDirty();
|
|
@@ -4399,7 +4399,7 @@ function useSectionOperations(input) {
|
|
|
4399
4399
|
);
|
|
4400
4400
|
const deleteSection2 = react.useCallback(
|
|
4401
4401
|
(sectionId) => {
|
|
4402
|
-
const result =
|
|
4402
|
+
const result = chunkHMZA25W2_js.deleteSection(sections, slides, sectionId);
|
|
4403
4403
|
setSections(result.sections);
|
|
4404
4404
|
setSlides(result.slides);
|
|
4405
4405
|
markDirty();
|
|
@@ -4408,21 +4408,21 @@ function useSectionOperations(input) {
|
|
|
4408
4408
|
);
|
|
4409
4409
|
const moveSectionUp2 = react.useCallback(
|
|
4410
4410
|
(sectionId) => {
|
|
4411
|
-
setSections(
|
|
4411
|
+
setSections(chunkHMZA25W2_js.moveSectionUp(sections, sectionId));
|
|
4412
4412
|
markDirty();
|
|
4413
4413
|
},
|
|
4414
4414
|
[sections, setSections, markDirty]
|
|
4415
4415
|
);
|
|
4416
4416
|
const moveSectionDown2 = react.useCallback(
|
|
4417
4417
|
(sectionId) => {
|
|
4418
|
-
setSections(
|
|
4418
|
+
setSections(chunkHMZA25W2_js.moveSectionDown(sections, sectionId));
|
|
4419
4419
|
markDirty();
|
|
4420
4420
|
},
|
|
4421
4421
|
[sections, setSections, markDirty]
|
|
4422
4422
|
);
|
|
4423
4423
|
const moveSlidesToSection2 = react.useCallback(
|
|
4424
4424
|
(slideIndexes, targetSectionId) => {
|
|
4425
|
-
const result =
|
|
4425
|
+
const result = chunkHMZA25W2_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4426
4426
|
setSlides(result.slides);
|
|
4427
4427
|
setSections(result.sections);
|
|
4428
4428
|
markDirty();
|
|
@@ -4451,19 +4451,19 @@ function useSectionOperations(input) {
|
|
|
4451
4451
|
|
|
4452
4452
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4453
4453
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4454
|
-
const resized =
|
|
4454
|
+
const resized = chunkHMZA25W2_js.applyResize(
|
|
4455
4455
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4456
4456
|
handle,
|
|
4457
4457
|
dx,
|
|
4458
4458
|
dy,
|
|
4459
4459
|
1,
|
|
4460
|
-
{ minSize:
|
|
4460
|
+
{ minSize: chunkOABOL32L_js.MIN_ELEMENT_SIZE }
|
|
4461
4461
|
);
|
|
4462
4462
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4463
4463
|
if (!snapToGrid) {
|
|
4464
4464
|
return box;
|
|
4465
4465
|
}
|
|
4466
|
-
return
|
|
4466
|
+
return chunkHMZA25W2_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkOABOL32L_js.MIN_ELEMENT_SIZE);
|
|
4467
4467
|
}
|
|
4468
4468
|
function resolveLiveTarget(input) {
|
|
4469
4469
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4576,7 +4576,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4576
4576
|
width: el.width,
|
|
4577
4577
|
height: el.height
|
|
4578
4578
|
}));
|
|
4579
|
-
const snapResult =
|
|
4579
|
+
const snapResult = chunkHMZA25W2_js.computeSnapToShape(
|
|
4580
4580
|
targetX,
|
|
4581
4581
|
targetY,
|
|
4582
4582
|
primaryEl.width,
|
|
@@ -4615,7 +4615,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4615
4615
|
if (live) {
|
|
4616
4616
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4617
4617
|
const start = drag.startPositionsById[id];
|
|
4618
|
-
|
|
4618
|
+
chunkHMZA25W2_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4619
4619
|
x: start.x + appliedDx,
|
|
4620
4620
|
y: start.y + appliedDy
|
|
4621
4621
|
});
|
|
@@ -4649,22 +4649,22 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4649
4649
|
if (rs.domEl) {
|
|
4650
4650
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4651
4651
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4652
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4653
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4652
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunkOABOL32L_js.MIN_ELEMENT_SIZE)}px`;
|
|
4653
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunkOABOL32L_js.MIN_ELEMENT_SIZE)}px`;
|
|
4654
4654
|
}
|
|
4655
4655
|
if (live) {
|
|
4656
|
-
|
|
4656
|
+
chunkHMZA25W2_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4657
4657
|
x: geo.x,
|
|
4658
4658
|
y: geo.y,
|
|
4659
|
-
width: Math.max(geo.width,
|
|
4660
|
-
height: Math.max(geo.height,
|
|
4659
|
+
width: Math.max(geo.width, chunkOABOL32L_js.MIN_ELEMENT_SIZE),
|
|
4660
|
+
height: Math.max(geo.height, chunkOABOL32L_js.MIN_ELEMENT_SIZE)
|
|
4661
4661
|
});
|
|
4662
4662
|
}
|
|
4663
4663
|
}
|
|
4664
4664
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4665
4665
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4666
4666
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4667
|
-
const adjustments =
|
|
4667
|
+
const adjustments = chunkHMZA25W2_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4668
4668
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4669
4669
|
adj.moved = true;
|
|
4670
4670
|
}
|
|
@@ -4739,13 +4739,13 @@ function processPointerUp(input) {
|
|
|
4739
4739
|
if (i !== activeSlideIndex) {
|
|
4740
4740
|
return s;
|
|
4741
4741
|
}
|
|
4742
|
-
const rerouted =
|
|
4742
|
+
const rerouted = chunkHMZA25W2_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4743
4743
|
if (rerouted.length === 0) {
|
|
4744
4744
|
return s;
|
|
4745
4745
|
}
|
|
4746
4746
|
return {
|
|
4747
4747
|
...s,
|
|
4748
|
-
elements:
|
|
4748
|
+
elements: chunkHMZA25W2_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4749
4749
|
};
|
|
4750
4750
|
})
|
|
4751
4751
|
);
|
|
@@ -4770,9 +4770,9 @@ function processPointerUp(input) {
|
|
|
4770
4770
|
}
|
|
4771
4771
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4772
4772
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4773
|
-
const hitIds =
|
|
4773
|
+
const hitIds = chunkHMZA25W2_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4774
4774
|
if (marquee.additive) {
|
|
4775
|
-
const merged =
|
|
4775
|
+
const merged = chunkHMZA25W2_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4776
4776
|
if (merged.length > 0) {
|
|
4777
4777
|
applySelection(merged[0], merged);
|
|
4778
4778
|
} else {
|
|
@@ -4795,8 +4795,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4795
4795
|
}
|
|
4796
4796
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4797
4797
|
});
|
|
4798
|
-
const rerouted =
|
|
4799
|
-
return
|
|
4798
|
+
const rerouted = chunkHMZA25W2_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4799
|
+
return chunkHMZA25W2_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4800
4800
|
};
|
|
4801
4801
|
if (editTemplateMode) {
|
|
4802
4802
|
const slideId = activeSlide?.id;
|
|
@@ -4906,8 +4906,7 @@ function usePointerHandlers(input) {
|
|
|
4906
4906
|
updateSlides,
|
|
4907
4907
|
updateElementById,
|
|
4908
4908
|
markDirty,
|
|
4909
|
-
livePatcher
|
|
4910
|
-
input
|
|
4909
|
+
livePatcher
|
|
4911
4910
|
]);
|
|
4912
4911
|
}
|
|
4913
4912
|
function mouseDownStartsSelectionDrag(event) {
|
|
@@ -4953,11 +4952,11 @@ function useCanvasInteractions(input) {
|
|
|
4953
4952
|
return;
|
|
4954
4953
|
}
|
|
4955
4954
|
const el = elementLookup.get(editId);
|
|
4956
|
-
if (el &&
|
|
4955
|
+
if (el && chunkHMZA25W2_js.hasTextProperties(el)) {
|
|
4957
4956
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4958
|
-
const newSegments =
|
|
4957
|
+
const newSegments = chunkHMZA25W2_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4959
4958
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
4960
|
-
const newHeight =
|
|
4959
|
+
const newHeight = chunkHMZA25W2_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
4961
4960
|
ops.updateElementById(editId, {
|
|
4962
4961
|
text: committedText,
|
|
4963
4962
|
textSegments: newSegments,
|
|
@@ -4969,7 +4968,7 @@ function useCanvasInteractions(input) {
|
|
|
4969
4968
|
setInlineEditingText("");
|
|
4970
4969
|
};
|
|
4971
4970
|
const openEquationEditorForElement = (el) => {
|
|
4972
|
-
if (!
|
|
4971
|
+
if (!chunkHMZA25W2_js.hasTextProperties(el)) {
|
|
4973
4972
|
return false;
|
|
4974
4973
|
}
|
|
4975
4974
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4999,7 +4998,7 @@ function useCanvasInteractions(input) {
|
|
|
4999
4998
|
justInteractedRef.current = false;
|
|
5000
4999
|
} else {
|
|
5001
5000
|
const el = elementLookup.get(elementId);
|
|
5002
|
-
if (el &&
|
|
5001
|
+
if (el && chunkHMZA25W2_js.hasTextProperties(el) && chunkHMZA25W2_js.canInteractWithElement(el, "textEdit")) {
|
|
5003
5002
|
if (!openEquationEditorForElement(el)) {
|
|
5004
5003
|
setInlineEditingElementId(elementId);
|
|
5005
5004
|
setInlineEditingText(el.text ?? "");
|
|
@@ -5018,7 +5017,7 @@ function useCanvasInteractions(input) {
|
|
|
5018
5017
|
if (openEquationEditorForElement(el)) {
|
|
5019
5018
|
return;
|
|
5020
5019
|
}
|
|
5021
|
-
if (
|
|
5020
|
+
if (chunkHMZA25W2_js.hasTextProperties(el) && chunkHMZA25W2_js.canInteractWithElement(el, "textEdit")) {
|
|
5022
5021
|
setInlineEditingElementId(elementId);
|
|
5023
5022
|
setInlineEditingText(el.text ?? "");
|
|
5024
5023
|
}
|
|
@@ -5041,7 +5040,7 @@ function useCanvasInteractions(input) {
|
|
|
5041
5040
|
justSelectedRef.current = false;
|
|
5042
5041
|
}
|
|
5043
5042
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
5044
|
-
const movableIds =
|
|
5043
|
+
const movableIds = chunkHMZA25W2_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
5045
5044
|
if (movableIds.length === 0) {
|
|
5046
5045
|
return;
|
|
5047
5046
|
}
|
|
@@ -5111,7 +5110,7 @@ function useCanvasInteractions(input) {
|
|
|
5111
5110
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5112
5111
|
e.stopPropagation();
|
|
5113
5112
|
const el = elementLookup.get(elementId);
|
|
5114
|
-
if (!el || !
|
|
5113
|
+
if (!el || !chunkHMZA25W2_js.canInteractWithElement(el, "resize")) {
|
|
5115
5114
|
return;
|
|
5116
5115
|
}
|
|
5117
5116
|
resizeStateRef.current = {
|
|
@@ -5133,7 +5132,7 @@ function useCanvasInteractions(input) {
|
|
|
5133
5132
|
};
|
|
5134
5133
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5135
5134
|
const el = elementLookup.get(elementId);
|
|
5136
|
-
if (!el || !
|
|
5135
|
+
if (!el || !chunkHMZA25W2_js.canInteractWithElement(el, "rotate")) {
|
|
5137
5136
|
return;
|
|
5138
5137
|
}
|
|
5139
5138
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5153,10 +5152,10 @@ function useCanvasInteractions(input) {
|
|
|
5153
5152
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5154
5153
|
e.stopPropagation();
|
|
5155
5154
|
const el = elementLookup.get(elementId);
|
|
5156
|
-
if (!el || !
|
|
5155
|
+
if (!el || !chunkHMZA25W2_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5157
5156
|
return;
|
|
5158
5157
|
}
|
|
5159
|
-
shapeAdjustmentDragStateRef.current =
|
|
5158
|
+
shapeAdjustmentDragStateRef.current = chunkHMZA25W2_js.beginShapeAdjustment(
|
|
5160
5159
|
el,
|
|
5161
5160
|
descriptor,
|
|
5162
5161
|
e.clientX,
|
|
@@ -5203,7 +5202,7 @@ function createFileHandlers(deps) {
|
|
|
5203
5202
|
h = Math.round(h * scale);
|
|
5204
5203
|
}
|
|
5205
5204
|
addElement({
|
|
5206
|
-
id:
|
|
5205
|
+
id: chunkHMZA25W2_js.generateElementId(),
|
|
5207
5206
|
type: "image",
|
|
5208
5207
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5209
5208
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5214,7 +5213,7 @@ function createFileHandlers(deps) {
|
|
|
5214
5213
|
};
|
|
5215
5214
|
img.onerror = () => {
|
|
5216
5215
|
addElement({
|
|
5217
|
-
id:
|
|
5216
|
+
id: chunkHMZA25W2_js.generateElementId(),
|
|
5218
5217
|
type: "image",
|
|
5219
5218
|
x: 100,
|
|
5220
5219
|
y: 100,
|
|
@@ -5233,14 +5232,14 @@ function createFileHandlers(deps) {
|
|
|
5233
5232
|
return;
|
|
5234
5233
|
}
|
|
5235
5234
|
e.target.value = "";
|
|
5236
|
-
const mediaType =
|
|
5235
|
+
const mediaType = chunkHMZA25W2_js.classifyMediaType(file.type);
|
|
5237
5236
|
if (!mediaType) {
|
|
5238
5237
|
return;
|
|
5239
5238
|
}
|
|
5240
5239
|
const elFilePath = file.path;
|
|
5241
5240
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5242
5241
|
addElement({
|
|
5243
|
-
id:
|
|
5242
|
+
id: chunkHMZA25W2_js.generateElementId(),
|
|
5244
5243
|
type: "media",
|
|
5245
5244
|
mediaType,
|
|
5246
5245
|
mediaMimeType: file.type || void 0,
|
|
@@ -5415,13 +5414,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5415
5414
|
return;
|
|
5416
5415
|
}
|
|
5417
5416
|
addElement({
|
|
5418
|
-
id:
|
|
5417
|
+
id: chunkHMZA25W2_js.generateElementId(),
|
|
5419
5418
|
type: "smartArt",
|
|
5420
5419
|
x: 100,
|
|
5421
5420
|
y: 120,
|
|
5422
5421
|
width: 600,
|
|
5423
5422
|
height: 340,
|
|
5424
|
-
smartArtData:
|
|
5423
|
+
smartArtData: chunkHMZA25W2_js.buildSmartArtPresetData(
|
|
5425
5424
|
layout,
|
|
5426
5425
|
defaultItems,
|
|
5427
5426
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5433,7 +5432,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5433
5432
|
return;
|
|
5434
5433
|
}
|
|
5435
5434
|
addElement({
|
|
5436
|
-
id:
|
|
5435
|
+
id: chunkHMZA25W2_js.generateElementId(),
|
|
5437
5436
|
type: "shape",
|
|
5438
5437
|
x: 120,
|
|
5439
5438
|
y: 200,
|
|
@@ -5471,7 +5470,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5471
5470
|
return;
|
|
5472
5471
|
}
|
|
5473
5472
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5474
|
-
if (resolved.url && !
|
|
5473
|
+
if (resolved.url && !chunkHMZA25W2_js.isUrlSafe(resolved.url)) {
|
|
5475
5474
|
return;
|
|
5476
5475
|
}
|
|
5477
5476
|
const actionClick = {
|
|
@@ -5495,7 +5494,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5495
5494
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5496
5495
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5497
5496
|
addElement({
|
|
5498
|
-
id:
|
|
5497
|
+
id: chunkHMZA25W2_js.generateElementId(),
|
|
5499
5498
|
type: "shape",
|
|
5500
5499
|
x: 120,
|
|
5501
5500
|
y: 200,
|
|
@@ -5517,11 +5516,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5517
5516
|
if (!activeSlide) {
|
|
5518
5517
|
return;
|
|
5519
5518
|
}
|
|
5520
|
-
const preset =
|
|
5519
|
+
const preset = chunkHMZA25W2_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5521
5520
|
if (!preset) {
|
|
5522
5521
|
return;
|
|
5523
5522
|
}
|
|
5524
|
-
const defaultPptxAction =
|
|
5523
|
+
const defaultPptxAction = chunkHMZA25W2_js.elementActionToPptxAction({
|
|
5525
5524
|
trigger: "click",
|
|
5526
5525
|
type: preset.defaultAction
|
|
5527
5526
|
});
|
|
@@ -5530,7 +5529,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5530
5529
|
defaultPptxAction.highlightClick = true;
|
|
5531
5530
|
}
|
|
5532
5531
|
addElement({
|
|
5533
|
-
id:
|
|
5532
|
+
id: chunkHMZA25W2_js.generateElementId(),
|
|
5534
5533
|
type: "shape",
|
|
5535
5534
|
x: 150,
|
|
5536
5535
|
y: 150,
|
|
@@ -5597,14 +5596,14 @@ function useInsertElements(input) {
|
|
|
5597
5596
|
return;
|
|
5598
5597
|
}
|
|
5599
5598
|
addElement({
|
|
5600
|
-
id:
|
|
5599
|
+
id: chunkHMZA25W2_js.generateElementId(),
|
|
5601
5600
|
type: "text",
|
|
5602
5601
|
x: 100,
|
|
5603
5602
|
y: 100,
|
|
5604
5603
|
width: 300,
|
|
5605
5604
|
height: 60,
|
|
5606
5605
|
text: "",
|
|
5607
|
-
textStyle: { fontSize:
|
|
5606
|
+
textStyle: { fontSize: chunkOABOL32L_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5608
5607
|
});
|
|
5609
5608
|
};
|
|
5610
5609
|
const handleAddShape = () => {
|
|
@@ -5612,7 +5611,7 @@ function useInsertElements(input) {
|
|
|
5612
5611
|
return;
|
|
5613
5612
|
}
|
|
5614
5613
|
addElement({
|
|
5615
|
-
id:
|
|
5614
|
+
id: chunkHMZA25W2_js.generateElementId(),
|
|
5616
5615
|
type: "shape",
|
|
5617
5616
|
x: 150,
|
|
5618
5617
|
y: 150,
|
|
@@ -5631,15 +5630,15 @@ function useInsertElements(input) {
|
|
|
5631
5630
|
return;
|
|
5632
5631
|
}
|
|
5633
5632
|
addElement({
|
|
5634
|
-
...
|
|
5635
|
-
id:
|
|
5633
|
+
...chunkHMZA25W2_js.newTableElement(chunkOABOL32L_js.DEFAULT_TABLE_ROWS, chunkOABOL32L_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5634
|
+
id: chunkHMZA25W2_js.generateElementId()
|
|
5636
5635
|
});
|
|
5637
5636
|
};
|
|
5638
5637
|
const handleAddChart = (chartKind) => {
|
|
5639
5638
|
if (!activeSlide) {
|
|
5640
5639
|
return;
|
|
5641
5640
|
}
|
|
5642
|
-
addElement(
|
|
5641
|
+
addElement(chunkHMZA25W2_js.createDefaultChartElement(chartKind));
|
|
5643
5642
|
};
|
|
5644
5643
|
const structured = createStructuredElementHandlers({
|
|
5645
5644
|
activeSlide,
|
|
@@ -5709,7 +5708,7 @@ function useClipboardHandlers(input) {
|
|
|
5709
5708
|
if (!selectedElement) {
|
|
5710
5709
|
return;
|
|
5711
5710
|
}
|
|
5712
|
-
setClipboardPayload(
|
|
5711
|
+
setClipboardPayload(chunkHMZA25W2_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5713
5712
|
};
|
|
5714
5713
|
const handleDelete = () => {
|
|
5715
5714
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5726,7 +5725,7 @@ function useClipboardHandlers(input) {
|
|
|
5726
5725
|
handleDelete();
|
|
5727
5726
|
};
|
|
5728
5727
|
const insertClone = (source) => {
|
|
5729
|
-
const clone =
|
|
5728
|
+
const clone = chunkHMZA25W2_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5730
5729
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5731
5730
|
ops.applySelection(clone.id);
|
|
5732
5731
|
history.markDirty();
|
|
@@ -5761,7 +5760,7 @@ function resolveShapePath(el) {
|
|
|
5761
5760
|
return el.pathData;
|
|
5762
5761
|
}
|
|
5763
5762
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5764
|
-
const clipPath =
|
|
5763
|
+
const clipPath = chunkHMZA25W2_js.getPresetShapeClipPath(el.shapeType);
|
|
5765
5764
|
if (clipPath) {
|
|
5766
5765
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5767
5766
|
if (svgPath) {
|
|
@@ -5812,7 +5811,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5812
5811
|
return parts.join(" ");
|
|
5813
5812
|
}
|
|
5814
5813
|
function transformPathToGlobal(pathData, el) {
|
|
5815
|
-
const polys =
|
|
5814
|
+
const polys = chunkHMZA25W2_js.svgPathToPolygons(pathData);
|
|
5816
5815
|
if (polys.length === 0) {
|
|
5817
5816
|
return pathData;
|
|
5818
5817
|
}
|
|
@@ -5832,10 +5831,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5832
5831
|
y: pt.y * scaleY + el.y
|
|
5833
5832
|
}))
|
|
5834
5833
|
);
|
|
5835
|
-
return
|
|
5834
|
+
return chunkHMZA25W2_js.polygonsToSvgPath(transformed);
|
|
5836
5835
|
}
|
|
5837
5836
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5838
|
-
const polys =
|
|
5837
|
+
const polys = chunkHMZA25W2_js.svgPathToPolygons(pathData);
|
|
5839
5838
|
if (polys.length === 0) {
|
|
5840
5839
|
return pathData;
|
|
5841
5840
|
}
|
|
@@ -5845,10 +5844,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5845
5844
|
y: pt.y - y
|
|
5846
5845
|
}))
|
|
5847
5846
|
);
|
|
5848
|
-
return
|
|
5847
|
+
return chunkHMZA25W2_js.polygonsToSvgPath(transformed);
|
|
5849
5848
|
}
|
|
5850
5849
|
function pathBounds(pathData) {
|
|
5851
|
-
const polys =
|
|
5850
|
+
const polys = chunkHMZA25W2_js.svgPathToPolygons(pathData);
|
|
5852
5851
|
let minX = Infinity;
|
|
5853
5852
|
let minY = Infinity;
|
|
5854
5853
|
let maxX = -Infinity;
|
|
@@ -5907,7 +5906,7 @@ function useMergeShapesHandler(input) {
|
|
|
5907
5906
|
let allFragments = [];
|
|
5908
5907
|
let remaining = globalPaths[0];
|
|
5909
5908
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5910
|
-
const frags =
|
|
5909
|
+
const frags = chunkHMZA25W2_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5911
5910
|
if (Array.isArray(frags)) {
|
|
5912
5911
|
allFragments = frags;
|
|
5913
5912
|
}
|
|
@@ -5936,7 +5935,7 @@ function useMergeShapesHandler(input) {
|
|
|
5936
5935
|
bounds.height
|
|
5937
5936
|
);
|
|
5938
5937
|
const newEl = {
|
|
5939
|
-
id:
|
|
5938
|
+
id: chunkHMZA25W2_js.generateElementId(),
|
|
5940
5939
|
type: "shape",
|
|
5941
5940
|
x: bounds.x,
|
|
5942
5941
|
y: bounds.y,
|
|
@@ -5974,7 +5973,7 @@ function useMergeShapesHandler(input) {
|
|
|
5974
5973
|
} else {
|
|
5975
5974
|
let resultPath = globalPaths[0];
|
|
5976
5975
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5977
|
-
const result =
|
|
5976
|
+
const result = chunkHMZA25W2_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5978
5977
|
if (typeof result === "string") {
|
|
5979
5978
|
resultPath = result;
|
|
5980
5979
|
}
|
|
@@ -5995,7 +5994,7 @@ function useMergeShapesHandler(input) {
|
|
|
5995
5994
|
);
|
|
5996
5995
|
const primary = targets[0];
|
|
5997
5996
|
const newEl = {
|
|
5998
|
-
id:
|
|
5997
|
+
id: chunkHMZA25W2_js.generateElementId(),
|
|
5999
5998
|
type: "shape",
|
|
6000
5999
|
x: bounds.x,
|
|
6001
6000
|
y: bounds.y,
|
|
@@ -6058,7 +6057,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6058
6057
|
if (ids.length < 2 || !activeSlide) {
|
|
6059
6058
|
return;
|
|
6060
6059
|
}
|
|
6061
|
-
const { elements, groupId } =
|
|
6060
|
+
const { elements, groupId } = chunkHMZA25W2_js.groupElements(ops.activeElements, ids, chunkHMZA25W2_js.generateElementId());
|
|
6062
6061
|
if (groupId === null) {
|
|
6063
6062
|
return;
|
|
6064
6063
|
}
|
|
@@ -6071,11 +6070,11 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6071
6070
|
return;
|
|
6072
6071
|
}
|
|
6073
6072
|
const group = selectedElement;
|
|
6074
|
-
const intoTemplate =
|
|
6073
|
+
const intoTemplate = chunkHMZA25W2_js.isTemplateElementId(group.id);
|
|
6075
6074
|
const childIds = group.children.map(
|
|
6076
|
-
(child) => intoTemplate ?
|
|
6075
|
+
(child) => intoTemplate ? chunkHMZA25W2_js.makeCloneId(true, child.id || group.id) : child.id || chunkHMZA25W2_js.generateElementId()
|
|
6077
6076
|
);
|
|
6078
|
-
const { elements, childIds: usedIds } =
|
|
6077
|
+
const { elements, childIds: usedIds } = chunkHMZA25W2_js.ungroupElements(
|
|
6079
6078
|
ops.activeElements,
|
|
6080
6079
|
group.id,
|
|
6081
6080
|
childIds,
|
|
@@ -6104,7 +6103,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6104
6103
|
if (!edge) {
|
|
6105
6104
|
return;
|
|
6106
6105
|
}
|
|
6107
|
-
const positions =
|
|
6106
|
+
const positions = chunkHMZA25W2_js.alignElements(selectedElements, edge);
|
|
6108
6107
|
for (const [id, pos] of positions) {
|
|
6109
6108
|
const el = elementLookup.get(id);
|
|
6110
6109
|
if (!el) {
|
|
@@ -6122,7 +6121,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6122
6121
|
if (!distAxis) {
|
|
6123
6122
|
return;
|
|
6124
6123
|
}
|
|
6125
|
-
const positions =
|
|
6124
|
+
const positions = chunkHMZA25W2_js.distributeElements(selectedElements, distAxis);
|
|
6126
6125
|
for (const [id, pos] of positions) {
|
|
6127
6126
|
const el = elementLookup.get(id);
|
|
6128
6127
|
if (!el) {
|
|
@@ -6139,7 +6138,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6139
6138
|
}
|
|
6140
6139
|
const id = selectedElement.id;
|
|
6141
6140
|
ops.updateActiveElements(
|
|
6142
|
-
(els) => direction === "forward" ?
|
|
6141
|
+
(els) => direction === "forward" ? chunkHMZA25W2_js.bringForward(els, id) : direction === "backward" ? chunkHMZA25W2_js.sendBackward(els, id) : els
|
|
6143
6142
|
);
|
|
6144
6143
|
history.markDirty();
|
|
6145
6144
|
};
|
|
@@ -6149,7 +6148,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6149
6148
|
}
|
|
6150
6149
|
const id = selectedElement.id;
|
|
6151
6150
|
ops.updateActiveElements(
|
|
6152
|
-
(els) => direction === "front" ?
|
|
6151
|
+
(els) => direction === "front" ? chunkHMZA25W2_js.bringToFront(els, id) : chunkHMZA25W2_js.sendToBack(els, id)
|
|
6153
6152
|
);
|
|
6154
6153
|
history.markDirty();
|
|
6155
6154
|
};
|
|
@@ -6280,7 +6279,7 @@ function useSlideManagement(input) {
|
|
|
6280
6279
|
theme
|
|
6281
6280
|
} = input;
|
|
6282
6281
|
const handleAddSlide = () => {
|
|
6283
|
-
const newSlide =
|
|
6282
|
+
const newSlide = chunkHMZA25W2_js.createBlankSlide(slides.length + 1);
|
|
6284
6283
|
ops.updateSlides((prev) => {
|
|
6285
6284
|
const next = [...prev];
|
|
6286
6285
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6343,7 +6342,7 @@ function useSlideManagement(input) {
|
|
|
6343
6342
|
}
|
|
6344
6343
|
const clone = {
|
|
6345
6344
|
...src,
|
|
6346
|
-
id:
|
|
6345
|
+
id: chunkHMZA25W2_js.makeSlideId(),
|
|
6347
6346
|
elements: src.elements.map((el) => ({
|
|
6348
6347
|
...el,
|
|
6349
6348
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6375,7 +6374,7 @@ function useSlideManagement(input) {
|
|
|
6375
6374
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6376
6375
|
const insertAt = activeSlideIndex + 1;
|
|
6377
6376
|
const draft = {
|
|
6378
|
-
...
|
|
6377
|
+
...chunkHMZA25W2_js.createBlankSlide(slides.length + 1),
|
|
6379
6378
|
layoutPath,
|
|
6380
6379
|
...layoutName ? { layoutName } : {}
|
|
6381
6380
|
};
|
|
@@ -6408,9 +6407,9 @@ function useSlideManagement(input) {
|
|
|
6408
6407
|
};
|
|
6409
6408
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6410
6409
|
const insertAt = activeSlideIndex + 1;
|
|
6411
|
-
const draft =
|
|
6410
|
+
const draft = chunkHMZA25W2_js.buildSlideTemplateSlide(templateId, chunkHMZA25W2_js.makeSlideId(), slides.length + 1, {
|
|
6412
6411
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6413
|
-
scheme:
|
|
6412
|
+
scheme: chunkHMZA25W2_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6414
6413
|
});
|
|
6415
6414
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6416
6415
|
setActiveSlideIndex(insertAt);
|
|
@@ -6447,7 +6446,7 @@ function createTableMergeHandlers(input) {
|
|
|
6447
6446
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6448
6447
|
return;
|
|
6449
6448
|
}
|
|
6450
|
-
const newTableData =
|
|
6449
|
+
const newTableData = chunkHMZA25W2_js.mergeCells(
|
|
6451
6450
|
[
|
|
6452
6451
|
{ row: rowIndex, col: columnIndex },
|
|
6453
6452
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6455,7 +6454,7 @@ function createTableMergeHandlers(input) {
|
|
|
6455
6454
|
td
|
|
6456
6455
|
);
|
|
6457
6456
|
const updates = { tableData: newTableData };
|
|
6458
|
-
const newRawXml =
|
|
6457
|
+
const newRawXml = chunkHMZA25W2_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6459
6458
|
if (newRawXml) {
|
|
6460
6459
|
updates.rawXml = newRawXml;
|
|
6461
6460
|
}
|
|
@@ -6481,7 +6480,7 @@ function createTableMergeHandlers(input) {
|
|
|
6481
6480
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6482
6481
|
return;
|
|
6483
6482
|
}
|
|
6484
|
-
const newTableData =
|
|
6483
|
+
const newTableData = chunkHMZA25W2_js.mergeCells(
|
|
6485
6484
|
[
|
|
6486
6485
|
{ row: rowIndex, col: columnIndex },
|
|
6487
6486
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6489,7 +6488,7 @@ function createTableMergeHandlers(input) {
|
|
|
6489
6488
|
td
|
|
6490
6489
|
);
|
|
6491
6490
|
const updates = { tableData: newTableData };
|
|
6492
|
-
const newRawXml =
|
|
6491
|
+
const newRawXml = chunkHMZA25W2_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6493
6492
|
if (newRawXml) {
|
|
6494
6493
|
updates.rawXml = newRawXml;
|
|
6495
6494
|
}
|
|
@@ -6504,9 +6503,9 @@ function createTableMergeHandlers(input) {
|
|
|
6504
6503
|
return;
|
|
6505
6504
|
}
|
|
6506
6505
|
const td = selectedElement.tableData;
|
|
6507
|
-
const newTableData =
|
|
6506
|
+
const newTableData = chunkHMZA25W2_js.mergeCells(ts.selectedCells, td);
|
|
6508
6507
|
const updates = { tableData: newTableData };
|
|
6509
|
-
const newRawXml =
|
|
6508
|
+
const newRawXml = chunkHMZA25W2_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6510
6509
|
if (newRawXml) {
|
|
6511
6510
|
updates.rawXml = newRawXml;
|
|
6512
6511
|
}
|
|
@@ -6523,9 +6522,9 @@ function createTableMergeHandlers(input) {
|
|
|
6523
6522
|
}
|
|
6524
6523
|
const { rowIndex, columnIndex } = ts;
|
|
6525
6524
|
const td = selectedElement.tableData;
|
|
6526
|
-
const newTableData =
|
|
6525
|
+
const newTableData = chunkHMZA25W2_js.splitCell(rowIndex, columnIndex, td);
|
|
6527
6526
|
const updates = { tableData: newTableData };
|
|
6528
|
-
const newRawXml =
|
|
6527
|
+
const newRawXml = chunkHMZA25W2_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6529
6528
|
if (newRawXml) {
|
|
6530
6529
|
updates.rawXml = newRawXml;
|
|
6531
6530
|
}
|
|
@@ -6559,10 +6558,10 @@ function createTableStructHandlers(input) {
|
|
|
6559
6558
|
const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
|
|
6560
6559
|
const updates = {};
|
|
6561
6560
|
if (el.tableData) {
|
|
6562
|
-
updates.tableData =
|
|
6561
|
+
updates.tableData = chunkHMZA25W2_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6563
6562
|
}
|
|
6564
6563
|
if (el.rawXml) {
|
|
6565
|
-
const newRawXml =
|
|
6564
|
+
const newRawXml = chunkHMZA25W2_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6566
6565
|
if (newRawXml) {
|
|
6567
6566
|
updates.rawXml = newRawXml;
|
|
6568
6567
|
}
|
|
@@ -6586,7 +6585,7 @@ function createTableStructHandlers(input) {
|
|
|
6586
6585
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6587
6586
|
const updates = {};
|
|
6588
6587
|
if (selectedElement.rawXml) {
|
|
6589
|
-
const newRawXml =
|
|
6588
|
+
const newRawXml = chunkHMZA25W2_js.updateCellTextStyleInRawXml(
|
|
6590
6589
|
selectedElement,
|
|
6591
6590
|
rowIndex,
|
|
6592
6591
|
colIndex,
|
|
@@ -6650,9 +6649,9 @@ function createTableStructHandlers(input) {
|
|
|
6650
6649
|
return;
|
|
6651
6650
|
}
|
|
6652
6651
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6653
|
-
const newTableData =
|
|
6652
|
+
const newTableData = chunkHMZA25W2_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6654
6653
|
const updates = { tableData: newTableData };
|
|
6655
|
-
const newRawXml =
|
|
6654
|
+
const newRawXml = chunkHMZA25W2_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6656
6655
|
if (newRawXml) {
|
|
6657
6656
|
updates.rawXml = newRawXml;
|
|
6658
6657
|
}
|
|
@@ -6665,12 +6664,12 @@ function createTableStructHandlers(input) {
|
|
|
6665
6664
|
}
|
|
6666
6665
|
const td = selectedElement.tableData;
|
|
6667
6666
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6668
|
-
const newTableData =
|
|
6667
|
+
const newTableData = chunkHMZA25W2_js.deleteTableRow(td, rowIdx);
|
|
6669
6668
|
if (newTableData === td) {
|
|
6670
6669
|
return;
|
|
6671
6670
|
}
|
|
6672
6671
|
const updates = { tableData: newTableData };
|
|
6673
|
-
const newRawXml =
|
|
6672
|
+
const newRawXml = chunkHMZA25W2_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6674
6673
|
if (newRawXml) {
|
|
6675
6674
|
updates.rawXml = newRawXml;
|
|
6676
6675
|
}
|
|
@@ -6682,9 +6681,9 @@ function createTableStructHandlers(input) {
|
|
|
6682
6681
|
return;
|
|
6683
6682
|
}
|
|
6684
6683
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6685
|
-
const newTableData =
|
|
6684
|
+
const newTableData = chunkHMZA25W2_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6686
6685
|
const updates = { tableData: newTableData };
|
|
6687
|
-
const newRawXml =
|
|
6686
|
+
const newRawXml = chunkHMZA25W2_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6688
6687
|
if (newRawXml) {
|
|
6689
6688
|
updates.rawXml = newRawXml;
|
|
6690
6689
|
}
|
|
@@ -6697,12 +6696,12 @@ function createTableStructHandlers(input) {
|
|
|
6697
6696
|
}
|
|
6698
6697
|
const td = selectedElement.tableData;
|
|
6699
6698
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6700
|
-
const newTableData =
|
|
6699
|
+
const newTableData = chunkHMZA25W2_js.deleteTableColumn(td, colIdx);
|
|
6701
6700
|
if (newTableData === td) {
|
|
6702
6701
|
return;
|
|
6703
6702
|
}
|
|
6704
6703
|
const updates = { tableData: newTableData };
|
|
6705
|
-
const newRawXml =
|
|
6704
|
+
const newRawXml = chunkHMZA25W2_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6706
6705
|
if (newRawXml) {
|
|
6707
6706
|
updates.rawXml = newRawXml;
|
|
6708
6707
|
}
|
|
@@ -6738,8 +6737,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6738
6737
|
return html2canvasPro(element, {
|
|
6739
6738
|
...options,
|
|
6740
6739
|
onclone: async (doc, clonedEl) => {
|
|
6741
|
-
await
|
|
6742
|
-
|
|
6740
|
+
await chunkHMZA25W2_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6741
|
+
chunkHMZA25W2_js.preprocessCssForCapture(clonedEl);
|
|
6743
6742
|
if (typeof userOnClone === "function") {
|
|
6744
6743
|
userOnClone(doc, clonedEl);
|
|
6745
6744
|
}
|
|
@@ -6777,13 +6776,13 @@ function useExportSaveAs(input) {
|
|
|
6777
6776
|
if (!handler) {
|
|
6778
6777
|
return;
|
|
6779
6778
|
}
|
|
6780
|
-
const downloadName =
|
|
6779
|
+
const downloadName = chunkHMZA25W2_js.savedPresentationFileName(filePath, format);
|
|
6781
6780
|
try {
|
|
6782
6781
|
const data = await buildSaveAsData(handler, format);
|
|
6783
6782
|
const blob = new Blob([data], {
|
|
6784
6783
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6785
6784
|
});
|
|
6786
|
-
|
|
6785
|
+
chunkHMZA25W2_js.downloadBlob(blob, downloadName);
|
|
6787
6786
|
} catch (err) {
|
|
6788
6787
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
6789
6788
|
}
|
|
@@ -6796,18 +6795,18 @@ function useExportSaveAs(input) {
|
|
|
6796
6795
|
const pptxGuides = guides.map((g) => ({
|
|
6797
6796
|
id: g.id,
|
|
6798
6797
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
6799
|
-
positionEmu:
|
|
6798
|
+
positionEmu: chunkHMZA25W2_js.guidePxToEmu(g.position)
|
|
6800
6799
|
}));
|
|
6801
6800
|
return {
|
|
6802
6801
|
...slide,
|
|
6803
6802
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
6804
6803
|
};
|
|
6805
6804
|
});
|
|
6806
|
-
const slidesToSave =
|
|
6805
|
+
const slidesToSave = chunkHMZA25W2_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
6807
6806
|
const saveOptions = {
|
|
6808
6807
|
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
6809
6808
|
// a preset picked in the inspector reached one save path and not the other.
|
|
6810
|
-
slideSize:
|
|
6809
|
+
slideSize: chunkHMZA25W2_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
6811
6810
|
headerFooter,
|
|
6812
6811
|
presentationProperties,
|
|
6813
6812
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -6821,13 +6820,13 @@ function useExportSaveAs(input) {
|
|
|
6821
6820
|
handoutMaster,
|
|
6822
6821
|
outputFormat: format
|
|
6823
6822
|
};
|
|
6824
|
-
return
|
|
6823
|
+
return chunkHMZA25W2_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
6825
6824
|
};
|
|
6826
6825
|
const handleExportJson = () => {
|
|
6827
6826
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
6828
|
-
const slideSize =
|
|
6827
|
+
const slideSize = chunkHMZA25W2_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
6829
6828
|
const data = {
|
|
6830
|
-
slides:
|
|
6829
|
+
slides: chunkHMZA25W2_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
6831
6830
|
width: canvasSize.width,
|
|
6832
6831
|
height: canvasSize.height,
|
|
6833
6832
|
widthEmu: slideSize.widthEmu,
|
|
@@ -6846,7 +6845,7 @@ function useExportSaveAs(input) {
|
|
|
6846
6845
|
handoutMaster
|
|
6847
6846
|
};
|
|
6848
6847
|
try {
|
|
6849
|
-
|
|
6848
|
+
chunkHMZA25W2_js.exportDeckJson(data, sourceName);
|
|
6850
6849
|
} catch (err) {
|
|
6851
6850
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
6852
6851
|
}
|
|
@@ -6933,7 +6932,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6933
6932
|
}
|
|
6934
6933
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6935
6934
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6936
|
-
|
|
6935
|
+
chunkHMZA25W2_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6937
6936
|
}
|
|
6938
6937
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6939
6938
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6955,15 +6954,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6955
6954
|
continue;
|
|
6956
6955
|
}
|
|
6957
6956
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6958
|
-
images.push(
|
|
6957
|
+
images.push(chunkHMZA25W2_js.canvasToJpegData(canvas));
|
|
6959
6958
|
}
|
|
6960
6959
|
onProgress?.(totalSlides, totalSlides);
|
|
6961
6960
|
setActiveSlide(currentSlideIndex);
|
|
6962
6961
|
if (images.length === 0) {
|
|
6963
6962
|
throw new Error(chunkSWRY3SI5_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6964
6963
|
}
|
|
6965
|
-
const pdfBlobUrl =
|
|
6966
|
-
|
|
6964
|
+
const pdfBlobUrl = chunkOABOL32L_js.buildPdfFromImageData(images);
|
|
6965
|
+
chunkHMZA25W2_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6967
6966
|
}
|
|
6968
6967
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6969
6968
|
const { scale = 2, onProgress } = options;
|
|
@@ -7011,8 +7010,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7011
7010
|
if (pages.length === 0) {
|
|
7012
7011
|
throw new Error(chunkSWRY3SI5_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7013
7012
|
}
|
|
7014
|
-
const pdfDataUrl =
|
|
7015
|
-
|
|
7013
|
+
const pdfDataUrl = chunkOABOL32L_js.buildNotesPdf(pages);
|
|
7014
|
+
chunkHMZA25W2_js.downloadDataUrl(pdfDataUrl, filename);
|
|
7016
7015
|
}
|
|
7017
7016
|
|
|
7018
7017
|
// src/viewer/utils/export-video.ts
|
|
@@ -7056,7 +7055,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7056
7055
|
const fps = 30;
|
|
7057
7056
|
const stream = recordingCanvas.captureStream(fps);
|
|
7058
7057
|
const recorder = new MediaRecorder(stream, {
|
|
7059
|
-
mimeType:
|
|
7058
|
+
mimeType: chunkHMZA25W2_js.pickSupportedMimeType([...chunkHMZA25W2_js.WEBM_MIME_CANDIDATES]),
|
|
7060
7059
|
videoBitsPerSecond: 5e6
|
|
7061
7060
|
});
|
|
7062
7061
|
const chunks = [];
|
|
@@ -7079,8 +7078,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7079
7078
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
7080
7079
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
7081
7080
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
7082
|
-
const frameInterval =
|
|
7083
|
-
const framesNeeded =
|
|
7081
|
+
const frameInterval = chunkHMZA25W2_js.fpsToFrameIntervalMs(fps);
|
|
7082
|
+
const framesNeeded = chunkHMZA25W2_js.segmentFrameCount(duration, fps);
|
|
7084
7083
|
for (let f = 0; f < framesNeeded; f++) {
|
|
7085
7084
|
if (signal?.aborted) {
|
|
7086
7085
|
recorder.stop();
|
|
@@ -7129,7 +7128,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7129
7128
|
if (frames.length === 0) {
|
|
7130
7129
|
throw new Error(chunkSWRY3SI5_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
7131
7130
|
}
|
|
7132
|
-
const gifBytes =
|
|
7131
|
+
const gifBytes = chunkHMZA25W2_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
7133
7132
|
onProgress?.(totalSlides, totalSlides);
|
|
7134
7133
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
7135
7134
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -7183,7 +7182,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7183
7182
|
continue;
|
|
7184
7183
|
}
|
|
7185
7184
|
onProgress?.(processedCount, data.slides.length);
|
|
7186
|
-
let svg =
|
|
7185
|
+
let svg = chunkHMZA25W2_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7187
7186
|
if (embedFonts && fontFaces?.length) {
|
|
7188
7187
|
svg = injectFontFaces(svg, fontFaces);
|
|
7189
7188
|
}
|
|
@@ -7292,21 +7291,21 @@ function useExportHandlers(input) {
|
|
|
7292
7291
|
{
|
|
7293
7292
|
scale: imageExportScale,
|
|
7294
7293
|
onProgress: (current, total) => {
|
|
7295
|
-
setExportProgress(
|
|
7296
|
-
setExportStatusMessage(
|
|
7294
|
+
setExportProgress(chunkHMZA25W2_js.slideProgressPercent(current, total));
|
|
7295
|
+
setExportStatusMessage(chunkHMZA25W2_js.slideStatusLabel("Rendering", current, total));
|
|
7297
7296
|
},
|
|
7298
7297
|
signal: abortCtrl.signal
|
|
7299
7298
|
}
|
|
7300
7299
|
);
|
|
7301
|
-
setExportProgress(
|
|
7300
|
+
setExportProgress(chunkHMZA25W2_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7302
7301
|
setExportStatusMessage("Building PDF...");
|
|
7303
7302
|
await new Promise((r) => {
|
|
7304
7303
|
setTimeout(r, 100);
|
|
7305
7304
|
});
|
|
7306
|
-
setExportProgress(
|
|
7305
|
+
setExportProgress(chunkHMZA25W2_js.EXPORT_DONE_PERCENT);
|
|
7307
7306
|
setExportStatusMessage("Done!");
|
|
7308
7307
|
} catch (err) {
|
|
7309
|
-
if (!
|
|
7308
|
+
if (!chunkHMZA25W2_js.isExportAbortError(err)) {
|
|
7310
7309
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7311
7310
|
}
|
|
7312
7311
|
} finally {
|
|
@@ -7336,21 +7335,21 @@ function useExportHandlers(input) {
|
|
|
7336
7335
|
{
|
|
7337
7336
|
scale: imageExportScale,
|
|
7338
7337
|
onProgress: (current, total) => {
|
|
7339
|
-
setExportProgress(
|
|
7340
|
-
setExportStatusMessage(
|
|
7338
|
+
setExportProgress(chunkHMZA25W2_js.slideProgressPercent(current, total));
|
|
7339
|
+
setExportStatusMessage(chunkHMZA25W2_js.slideStatusLabel("Rendering", current, total));
|
|
7341
7340
|
},
|
|
7342
7341
|
signal: abortCtrl.signal
|
|
7343
7342
|
}
|
|
7344
7343
|
);
|
|
7345
|
-
setExportProgress(
|
|
7344
|
+
setExportProgress(chunkHMZA25W2_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7346
7345
|
setExportStatusMessage("Building PDF...");
|
|
7347
7346
|
await new Promise((r) => {
|
|
7348
7347
|
setTimeout(r, 100);
|
|
7349
7348
|
});
|
|
7350
|
-
setExportProgress(
|
|
7349
|
+
setExportProgress(chunkHMZA25W2_js.EXPORT_DONE_PERCENT);
|
|
7351
7350
|
setExportStatusMessage("Done!");
|
|
7352
7351
|
} catch (err) {
|
|
7353
|
-
if (!
|
|
7352
|
+
if (!chunkHMZA25W2_js.isExportAbortError(err)) {
|
|
7354
7353
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7355
7354
|
}
|
|
7356
7355
|
} finally {
|
|
@@ -7392,22 +7391,22 @@ function useExportHandlers(input) {
|
|
|
7392
7391
|
scale: 1,
|
|
7393
7392
|
slideDurationMs: 3e3,
|
|
7394
7393
|
onProgress: (current, total) => {
|
|
7395
|
-
setExportProgress(
|
|
7396
|
-
setExportStatusMessage(
|
|
7394
|
+
setExportProgress(chunkHMZA25W2_js.slideProgressPercent(current, total, 45));
|
|
7395
|
+
setExportStatusMessage(chunkHMZA25W2_js.slideStatusLabel("Capturing", current, total));
|
|
7397
7396
|
},
|
|
7398
7397
|
onRecordProgress: (current, total) => {
|
|
7399
|
-
setExportProgress(
|
|
7400
|
-
setExportStatusMessage(
|
|
7398
|
+
setExportProgress(chunkHMZA25W2_js.recordProgressPercent(current, total));
|
|
7399
|
+
setExportStatusMessage(chunkHMZA25W2_js.slideStatusLabel("Recording", current, total));
|
|
7401
7400
|
},
|
|
7402
7401
|
signal: abortCtrl.signal
|
|
7403
7402
|
}
|
|
7404
7403
|
);
|
|
7405
|
-
setExportProgress(
|
|
7404
|
+
setExportProgress(chunkHMZA25W2_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7406
7405
|
setExportStatusMessage("Saving file...");
|
|
7407
|
-
|
|
7408
|
-
setExportProgress(
|
|
7406
|
+
chunkHMZA25W2_js.downloadBlob(blob, "presentation.webm");
|
|
7407
|
+
setExportProgress(chunkHMZA25W2_js.EXPORT_DONE_PERCENT);
|
|
7409
7408
|
} catch (err) {
|
|
7410
|
-
if (!
|
|
7409
|
+
if (!chunkHMZA25W2_js.isExportAbortError(err)) {
|
|
7411
7410
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7412
7411
|
}
|
|
7413
7412
|
} finally {
|
|
@@ -7435,18 +7434,18 @@ function useExportHandlers(input) {
|
|
|
7435
7434
|
scale: 0.5,
|
|
7436
7435
|
slideDurationMs: 2e3,
|
|
7437
7436
|
onProgress: (current, total) => {
|
|
7438
|
-
setExportProgress(
|
|
7439
|
-
setExportStatusMessage(
|
|
7437
|
+
setExportProgress(chunkHMZA25W2_js.slideProgressPercent(current, total));
|
|
7438
|
+
setExportStatusMessage(chunkHMZA25W2_js.slideStatusLabel("Encoding", current, total));
|
|
7440
7439
|
},
|
|
7441
7440
|
signal: abortCtrl.signal
|
|
7442
7441
|
}
|
|
7443
7442
|
);
|
|
7444
|
-
setExportProgress(
|
|
7443
|
+
setExportProgress(chunkHMZA25W2_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7445
7444
|
setExportStatusMessage("Saving file...");
|
|
7446
|
-
|
|
7447
|
-
setExportProgress(
|
|
7445
|
+
chunkHMZA25W2_js.downloadBlob(blob, "presentation.gif");
|
|
7446
|
+
setExportProgress(chunkHMZA25W2_js.EXPORT_DONE_PERCENT);
|
|
7448
7447
|
} catch (err) {
|
|
7449
|
-
if (!
|
|
7448
|
+
if (!chunkHMZA25W2_js.isExportAbortError(err)) {
|
|
7450
7449
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7451
7450
|
}
|
|
7452
7451
|
} finally {
|
|
@@ -7479,7 +7478,7 @@ function useExportHandlers(input) {
|
|
|
7479
7478
|
exportStatusMessage
|
|
7480
7479
|
};
|
|
7481
7480
|
}
|
|
7482
|
-
var ViewerOptionsContext = react.createContext(
|
|
7481
|
+
var ViewerOptionsContext = react.createContext(chunkHMZA25W2_js.DEFAULT_VIEWER_OPTIONS);
|
|
7483
7482
|
function useViewerOptionsContext() {
|
|
7484
7483
|
return react.useContext(ViewerOptionsContext);
|
|
7485
7484
|
}
|
|
@@ -7491,13 +7490,13 @@ function usePrintHandlers(input) {
|
|
|
7491
7490
|
const { t } = reactI18next.useTranslation();
|
|
7492
7491
|
const viewerOptions = useViewerOptionsContext();
|
|
7493
7492
|
const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
|
|
7494
|
-
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) *
|
|
7493
|
+
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunkHMZA25W2_js.resolveImageResolutionScale(viewerOptions);
|
|
7495
7494
|
const handlePrint = () => {
|
|
7496
7495
|
setIsPrintDialogOpen(true);
|
|
7497
7496
|
};
|
|
7498
7497
|
const handlePrintSvg = async (settings) => {
|
|
7499
7498
|
setIsPrintDialogOpen(false);
|
|
7500
|
-
const printWindow =
|
|
7499
|
+
const printWindow = chunkHMZA25W2_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7501
7500
|
if (!printWindow) {
|
|
7502
7501
|
console.warn(
|
|
7503
7502
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7507,9 +7506,9 @@ function usePrintHandlers(input) {
|
|
|
7507
7506
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7508
7507
|
return runRasterPrint(printWindow, settings);
|
|
7509
7508
|
}
|
|
7510
|
-
const colorFilter =
|
|
7511
|
-
const slideIndices =
|
|
7512
|
-
|
|
7509
|
+
const colorFilter = chunkHMZA25W2_js.computeColorFilter(settings.colorMode);
|
|
7510
|
+
const slideIndices = chunkHMZA25W2_js.filterHiddenSlideIndices(
|
|
7511
|
+
chunkHMZA25W2_js.computeSlideIndices(
|
|
7513
7512
|
settings.slideRange,
|
|
7514
7513
|
activeSlideIndex,
|
|
7515
7514
|
slides.length,
|
|
@@ -7527,22 +7526,22 @@ function usePrintHandlers(input) {
|
|
|
7527
7526
|
printWindow.close();
|
|
7528
7527
|
return;
|
|
7529
7528
|
}
|
|
7530
|
-
const printDoc =
|
|
7529
|
+
const printDoc = chunkHMZA25W2_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7531
7530
|
title: "Slides (Vector)",
|
|
7532
7531
|
orientation: settings.orientation,
|
|
7533
7532
|
colorFilter,
|
|
7534
7533
|
scaleToFit: settings.scaleToFit
|
|
7535
7534
|
});
|
|
7536
|
-
|
|
7535
|
+
chunkHMZA25W2_js.finishPrintWindow(printWindow, printDoc);
|
|
7537
7536
|
} catch (err) {
|
|
7538
7537
|
console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
|
|
7539
7538
|
return runRasterPrint(printWindow, settings);
|
|
7540
7539
|
}
|
|
7541
7540
|
};
|
|
7542
7541
|
const runRasterPrint = async (printWindow, settings) => {
|
|
7543
|
-
const colorFilter =
|
|
7544
|
-
const slideIndices =
|
|
7545
|
-
|
|
7542
|
+
const colorFilter = chunkHMZA25W2_js.computeColorFilter(settings.colorMode);
|
|
7543
|
+
const slideIndices = chunkHMZA25W2_js.filterHiddenSlideIndices(
|
|
7544
|
+
chunkHMZA25W2_js.computeSlideIndices(
|
|
7546
7545
|
settings.slideRange,
|
|
7547
7546
|
activeSlideIndex,
|
|
7548
7547
|
slides.length,
|
|
@@ -7553,11 +7552,11 @@ function usePrintHandlers(input) {
|
|
|
7553
7552
|
includeHiddenSlides
|
|
7554
7553
|
);
|
|
7555
7554
|
if (settings.printWhat === "outline") {
|
|
7556
|
-
|
|
7555
|
+
chunkHMZA25W2_js.finishPrintWindow(
|
|
7557
7556
|
printWindow,
|
|
7558
|
-
|
|
7557
|
+
chunkHMZA25W2_js.buildPrintHtmlDocument({
|
|
7559
7558
|
title: "Outline",
|
|
7560
|
-
bodyHtml: `<div class="outline-page">${
|
|
7559
|
+
bodyHtml: `<div class="outline-page">${chunkHMZA25W2_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7561
7560
|
orientation: settings.orientation,
|
|
7562
7561
|
colorFilter,
|
|
7563
7562
|
frameSlides: settings.frameSlides,
|
|
@@ -7584,11 +7583,11 @@ function usePrintHandlers(input) {
|
|
|
7584
7583
|
}
|
|
7585
7584
|
const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
|
|
7586
7585
|
if (settings.printWhat === "slides") {
|
|
7587
|
-
|
|
7586
|
+
chunkHMZA25W2_js.finishPrintWindow(
|
|
7588
7587
|
printWindow,
|
|
7589
|
-
|
|
7588
|
+
chunkHMZA25W2_js.buildPrintHtmlDocument({
|
|
7590
7589
|
title: "Slides",
|
|
7591
|
-
bodyHtml:
|
|
7590
|
+
bodyHtml: chunkHMZA25W2_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7592
7591
|
orientation: settings.orientation,
|
|
7593
7592
|
colorFilter,
|
|
7594
7593
|
frameSlides: settings.frameSlides,
|
|
@@ -7598,11 +7597,11 @@ function usePrintHandlers(input) {
|
|
|
7598
7597
|
return;
|
|
7599
7598
|
}
|
|
7600
7599
|
if (settings.printWhat === "notes") {
|
|
7601
|
-
|
|
7600
|
+
chunkHMZA25W2_js.finishPrintWindow(
|
|
7602
7601
|
printWindow,
|
|
7603
|
-
|
|
7602
|
+
chunkHMZA25W2_js.buildPrintHtmlDocument({
|
|
7604
7603
|
title: "Notes Pages",
|
|
7605
|
-
bodyHtml:
|
|
7604
|
+
bodyHtml: chunkHMZA25W2_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7606
7605
|
orientation: "portrait",
|
|
7607
7606
|
colorFilter,
|
|
7608
7607
|
frameSlides: settings.frameSlides,
|
|
@@ -7613,11 +7612,11 @@ function usePrintHandlers(input) {
|
|
|
7613
7612
|
}
|
|
7614
7613
|
if (settings.printWhat === "handouts") {
|
|
7615
7614
|
const spp = settings.slidesPerPage;
|
|
7616
|
-
|
|
7615
|
+
chunkHMZA25W2_js.finishPrintWindow(
|
|
7617
7616
|
printWindow,
|
|
7618
|
-
|
|
7617
|
+
chunkHMZA25W2_js.buildPrintHtmlDocument({
|
|
7619
7618
|
title: `Handout ${spp} per page`,
|
|
7620
|
-
bodyHtml:
|
|
7619
|
+
bodyHtml: chunkHMZA25W2_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7621
7620
|
orientation: "portrait",
|
|
7622
7621
|
colorFilter,
|
|
7623
7622
|
frameSlides: settings.frameSlides,
|
|
@@ -7631,7 +7630,7 @@ function usePrintHandlers(input) {
|
|
|
7631
7630
|
};
|
|
7632
7631
|
const handlePrintWithSettings = async (settings) => {
|
|
7633
7632
|
setIsPrintDialogOpen(false);
|
|
7634
|
-
const printWindow =
|
|
7633
|
+
const printWindow = chunkHMZA25W2_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7635
7634
|
if (!printWindow) {
|
|
7636
7635
|
console.warn(
|
|
7637
7636
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7694,8 +7693,8 @@ function useThemeHandlers(input) {
|
|
|
7694
7693
|
return;
|
|
7695
7694
|
}
|
|
7696
7695
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7697
|
-
const previousMap = theme?.colorScheme ?
|
|
7698
|
-
setSlides((prev) =>
|
|
7696
|
+
const previousMap = theme?.colorScheme ? chunkHMZA25W2_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7697
|
+
setSlides((prev) => chunkHMZA25W2_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7699
7698
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7700
7699
|
bumpHistory();
|
|
7701
7700
|
history.markDirty();
|
|
@@ -7800,7 +7799,7 @@ function useThemeSwitching(input) {
|
|
|
7800
7799
|
}
|
|
7801
7800
|
try {
|
|
7802
7801
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7803
|
-
const newData =
|
|
7802
|
+
const newData = chunkHMZA25W2_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7804
7803
|
onDataChange(newData);
|
|
7805
7804
|
onThemeChanged?.(preset);
|
|
7806
7805
|
} catch (error) {
|
|
@@ -7817,7 +7816,7 @@ function useThemeSwitching(input) {
|
|
|
7817
7816
|
}
|
|
7818
7817
|
try {
|
|
7819
7818
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7820
|
-
const newData =
|
|
7819
|
+
const newData = chunkHMZA25W2_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7821
7820
|
onDataChange(newData);
|
|
7822
7821
|
} catch (error) {
|
|
7823
7822
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7829,12 +7828,12 @@ function useThemeSwitching(input) {
|
|
|
7829
7828
|
if (!data?.theme?.colorScheme) {
|
|
7830
7829
|
return void 0;
|
|
7831
7830
|
}
|
|
7832
|
-
return
|
|
7833
|
-
(p) =>
|
|
7831
|
+
return chunkHMZA25W2_js.THEME_PRESETS.find(
|
|
7832
|
+
(p) => chunkHMZA25W2_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7834
7833
|
);
|
|
7835
7834
|
}, [data?.theme?.colorScheme]);
|
|
7836
7835
|
return {
|
|
7837
|
-
presets:
|
|
7836
|
+
presets: chunkHMZA25W2_js.THEME_PRESETS,
|
|
7838
7837
|
switchToPreset,
|
|
7839
7838
|
switchToCustom,
|
|
7840
7839
|
currentPreset
|
|
@@ -7909,7 +7908,7 @@ function usePropertyHandlers(input) {
|
|
|
7909
7908
|
}
|
|
7910
7909
|
try {
|
|
7911
7910
|
const ab = await file.arrayBuffer();
|
|
7912
|
-
const h = new
|
|
7911
|
+
const h = new chunkHMZA25W2_js.PptxHandler();
|
|
7913
7912
|
const other = await h.load(ab);
|
|
7914
7913
|
if (!other) {
|
|
7915
7914
|
return;
|
|
@@ -7919,7 +7918,7 @@ function usePropertyHandlers(input) {
|
|
|
7919
7918
|
width: canvasSize.width,
|
|
7920
7919
|
height: canvasSize.height
|
|
7921
7920
|
};
|
|
7922
|
-
setCompareResult(
|
|
7921
|
+
setCompareResult(chunkHMZA25W2_js.comparePresentation(cur, other));
|
|
7923
7922
|
setIsComparePanelOpen(true);
|
|
7924
7923
|
} catch (err) {
|
|
7925
7924
|
console.warn("Compare failed:", err);
|
|
@@ -7936,7 +7935,7 @@ function usePropertyHandlers(input) {
|
|
|
7936
7935
|
if (!diff || diff.status === "unchanged") {
|
|
7937
7936
|
return;
|
|
7938
7937
|
}
|
|
7939
|
-
setSlides((prev) =>
|
|
7938
|
+
setSlides((prev) => chunkHMZA25W2_js.applyAcceptSlide(prev, diff));
|
|
7940
7939
|
setIsDirty(true);
|
|
7941
7940
|
},
|
|
7942
7941
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7947,10 +7946,10 @@ function usePropertyHandlers(input) {
|
|
|
7947
7946
|
if (!compareResult) {
|
|
7948
7947
|
return;
|
|
7949
7948
|
}
|
|
7950
|
-
setSlides((prev) =>
|
|
7949
|
+
setSlides((prev) => chunkHMZA25W2_js.applyAcceptAllSlides(prev, compareResult));
|
|
7951
7950
|
setIsDirty(true);
|
|
7952
7951
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7953
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7952
|
+
const usedFontFamilies = react.useMemo(() => chunkHMZA25W2_js.collectUsedFonts(slides), [slides]);
|
|
7954
7953
|
return {
|
|
7955
7954
|
handleUpdateNotes,
|
|
7956
7955
|
handleUpdateSlide,
|
|
@@ -8105,7 +8104,7 @@ function useViewerDialogs(input) {
|
|
|
8105
8104
|
);
|
|
8106
8105
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8107
8106
|
const fontEmbedding = react.useMemo(
|
|
8108
|
-
() =>
|
|
8107
|
+
() => chunkHMZA25W2_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8109
8108
|
[embeddedFontKey]
|
|
8110
8109
|
);
|
|
8111
8110
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8115,11 +8114,11 @@ function useViewerDialogs(input) {
|
|
|
8115
8114
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8116
8115
|
}
|
|
8117
8116
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8118
|
-
() => typeof window !== "undefined" ?
|
|
8117
|
+
() => typeof window !== "undefined" ? chunkHMZA25W2_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8119
8118
|
);
|
|
8120
8119
|
react.useEffect(() => {
|
|
8121
8120
|
const handleWindow = () => setIsNarrowViewport(
|
|
8122
|
-
|
|
8121
|
+
chunkHMZA25W2_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8123
8122
|
);
|
|
8124
8123
|
window.addEventListener("resize", handleWindow);
|
|
8125
8124
|
return () => window.removeEventListener("resize", handleWindow);
|
|
@@ -8272,15 +8271,15 @@ function useViewerDialogs(input) {
|
|
|
8272
8271
|
};
|
|
8273
8272
|
}
|
|
8274
8273
|
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8275
|
-
return
|
|
8274
|
+
return chunkHMZA25W2_js.computeGridSpacingPx(documentGridSpacing, chunkOABOL32L_js.GRID_SIZE);
|
|
8276
8275
|
}
|
|
8277
8276
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8278
8277
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8279
|
-
return
|
|
8278
|
+
return chunkHMZA25W2_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8280
8279
|
}
|
|
8281
8280
|
function computeSlideSectionGroups(slides, sections) {
|
|
8282
|
-
return
|
|
8283
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8281
|
+
return chunkHMZA25W2_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8282
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkOABOL32L_js.UNGROUPED_SECTION_ID : chunkOABOL32L_js.DEFAULT_SECTION_GROUP_ID),
|
|
8284
8283
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8285
8284
|
slideIndexes: group.slideIndexes,
|
|
8286
8285
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8292,7 +8291,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8292
8291
|
return void 0;
|
|
8293
8292
|
}
|
|
8294
8293
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8295
|
-
return
|
|
8294
|
+
return chunkHMZA25W2_js.masterViewPseudoSlide(document2, {
|
|
8296
8295
|
tab: "slides",
|
|
8297
8296
|
masterIndex: 0,
|
|
8298
8297
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8320,10 +8319,10 @@ function useDerivedSlideState(input) {
|
|
|
8320
8319
|
);
|
|
8321
8320
|
const slideSectionGroups = react.useMemo(
|
|
8322
8321
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8323
|
-
if (group.id ===
|
|
8322
|
+
if (group.id === chunkOABOL32L_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8324
8323
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8325
8324
|
}
|
|
8326
|
-
if (group.id ===
|
|
8325
|
+
if (group.id === chunkOABOL32L_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8327
8326
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8328
8327
|
}
|
|
8329
8328
|
return group;
|
|
@@ -8423,13 +8422,13 @@ function useAnnotationHandlers(input) {
|
|
|
8423
8422
|
}, [annotations, setMode, setSlides, history]);
|
|
8424
8423
|
const handleSetMode = react.useCallback(
|
|
8425
8424
|
(nextMode) => {
|
|
8426
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8425
|
+
if (mode === "present" && nextMode !== "present" && !chunkHMZA25W2_js.mayLeaveSlideShow()) {
|
|
8427
8426
|
return;
|
|
8428
8427
|
}
|
|
8429
8428
|
if (nextMode === "present") {
|
|
8430
8429
|
presentation.enterPresentMode();
|
|
8431
8430
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8432
|
-
|
|
8431
|
+
chunkHMZA25W2_js.stopAllPersistentAudio();
|
|
8433
8432
|
if (promptKeepInkAnnotations) {
|
|
8434
8433
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8435
8434
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8439,7 +8438,7 @@ function useAnnotationHandlers(input) {
|
|
|
8439
8438
|
}
|
|
8440
8439
|
} else {
|
|
8441
8440
|
if (mode === "present") {
|
|
8442
|
-
|
|
8441
|
+
chunkHMZA25W2_js.stopAllPersistentAudio();
|
|
8443
8442
|
}
|
|
8444
8443
|
setMode(nextMode);
|
|
8445
8444
|
}
|
|
@@ -8503,13 +8502,13 @@ function useSerialize(input) {
|
|
|
8503
8502
|
let processedSlide = slide;
|
|
8504
8503
|
if (pendingEditId) {
|
|
8505
8504
|
const updatedElements = slide.elements.map((el) => {
|
|
8506
|
-
if (el.id !== pendingEditId || !
|
|
8505
|
+
if (el.id !== pendingEditId || !chunkHMZA25W2_js.hasTextProperties(el)) {
|
|
8507
8506
|
return el;
|
|
8508
8507
|
}
|
|
8509
8508
|
return {
|
|
8510
8509
|
...el,
|
|
8511
8510
|
text: pendingEditText,
|
|
8512
|
-
textSegments:
|
|
8511
|
+
textSegments: chunkHMZA25W2_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8513
8512
|
};
|
|
8514
8513
|
});
|
|
8515
8514
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8522,19 +8521,19 @@ function useSerialize(input) {
|
|
|
8522
8521
|
const pptxGuides = guides.map((g) => ({
|
|
8523
8522
|
id: g.id,
|
|
8524
8523
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8525
|
-
positionEmu:
|
|
8524
|
+
positionEmu: chunkHMZA25W2_js.guidePxToEmu(g.position)
|
|
8526
8525
|
}));
|
|
8527
8526
|
return {
|
|
8528
8527
|
...processedSlide,
|
|
8529
8528
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8530
8529
|
};
|
|
8531
8530
|
});
|
|
8532
|
-
const slidesToSave =
|
|
8531
|
+
const slidesToSave = chunkHMZA25W2_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8533
8532
|
const saveOptions = {
|
|
8534
8533
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8535
8534
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8536
8535
|
// slide-size edit reaches the file.
|
|
8537
|
-
slideSize:
|
|
8536
|
+
slideSize: chunkHMZA25W2_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8538
8537
|
headerFooter,
|
|
8539
8538
|
presentationProperties,
|
|
8540
8539
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -8546,9 +8545,9 @@ function useSerialize(input) {
|
|
|
8546
8545
|
slideMasters,
|
|
8547
8546
|
notesMaster,
|
|
8548
8547
|
handoutMaster,
|
|
8549
|
-
...
|
|
8548
|
+
...chunkHMZA25W2_js.embeddedFontSaveOptions(embedFonts)
|
|
8550
8549
|
};
|
|
8551
|
-
return
|
|
8550
|
+
return chunkHMZA25W2_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8552
8551
|
}, [
|
|
8553
8552
|
slides,
|
|
8554
8553
|
templateElementsBySlideId,
|
|
@@ -8583,7 +8582,7 @@ function useRecoveryDetection(input) {
|
|
|
8583
8582
|
const onRestore = input.onRestore;
|
|
8584
8583
|
const openVersionHistory = input.openVersionHistory;
|
|
8585
8584
|
react.useEffect(() => {
|
|
8586
|
-
if (!
|
|
8585
|
+
if (!chunkHMZA25W2_js.shouldProbeAutosaveRecovery({
|
|
8587
8586
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8588
8587
|
filePath,
|
|
8589
8588
|
loading,
|
|
@@ -8595,7 +8594,7 @@ function useRecoveryDetection(input) {
|
|
|
8595
8594
|
}
|
|
8596
8595
|
recoveryCheckedRef.current = true;
|
|
8597
8596
|
void (async () => {
|
|
8598
|
-
const offer = await
|
|
8597
|
+
const offer = await chunkHMZA25W2_js.probeAutosaveRecovery(filePath);
|
|
8599
8598
|
if (!offer) {
|
|
8600
8599
|
return;
|
|
8601
8600
|
}
|
|
@@ -8608,7 +8607,7 @@ function useRecoveryDetection(input) {
|
|
|
8608
8607
|
const record = recordRef.current;
|
|
8609
8608
|
setPrompt(null);
|
|
8610
8609
|
if (record && onRestore) {
|
|
8611
|
-
onRestore(
|
|
8610
|
+
onRestore(chunkHMZA25W2_js.acceptAutosaveRecovery(record));
|
|
8612
8611
|
}
|
|
8613
8612
|
recordRef.current = null;
|
|
8614
8613
|
}, [onRestore]);
|
|
@@ -8617,7 +8616,7 @@ function useRecoveryDetection(input) {
|
|
|
8617
8616
|
setPrompt(null);
|
|
8618
8617
|
recordRef.current = null;
|
|
8619
8618
|
if (record) {
|
|
8620
|
-
void
|
|
8619
|
+
void chunkHMZA25W2_js.discardAutosaveRecovery(record);
|
|
8621
8620
|
}
|
|
8622
8621
|
}, []);
|
|
8623
8622
|
return { prompt, restore, discard };
|
|
@@ -8656,11 +8655,11 @@ function usePresentationSetup(input) {
|
|
|
8656
8655
|
containerRef,
|
|
8657
8656
|
content,
|
|
8658
8657
|
onSetMode: (nextMode) => {
|
|
8659
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8658
|
+
if (mode === "present" && nextMode !== "present" && !chunkHMZA25W2_js.mayLeaveSlideShow()) {
|
|
8660
8659
|
return;
|
|
8661
8660
|
}
|
|
8662
8661
|
if (mode === "present" && nextMode !== "present") {
|
|
8663
|
-
|
|
8662
|
+
chunkHMZA25W2_js.stopAllPersistentAudio();
|
|
8664
8663
|
stopAnimationSound();
|
|
8665
8664
|
const exitHandler = exitModeHandlerRef.current;
|
|
8666
8665
|
if (exitHandler) {
|
|
@@ -8722,10 +8721,10 @@ function usePresentationSetup(input) {
|
|
|
8722
8721
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8723
8722
|
onToggleSubtitles,
|
|
8724
8723
|
onSaveRehearsalTimings: (timings) => {
|
|
8725
|
-
setSlides((prev) =>
|
|
8724
|
+
setSlides((prev) => chunkHMZA25W2_js.applyRehearsalTimings(prev, timings));
|
|
8726
8725
|
history.markDirty();
|
|
8727
8726
|
},
|
|
8728
|
-
loopContinuously:
|
|
8727
|
+
loopContinuously: chunkHMZA25W2_js.shouldLoopContinuously(presentationProperties),
|
|
8729
8728
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8730
8729
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8731
8730
|
endWithBlackSlide
|
|
@@ -8926,7 +8925,7 @@ function useEditorOperations(input) {
|
|
|
8926
8925
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
8927
8926
|
react.useEffect(() => {
|
|
8928
8927
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
8929
|
-
copiedFormatRef.current =
|
|
8928
|
+
copiedFormatRef.current = chunkHMZA25W2_js.copyFormatFromElement(selectedElement);
|
|
8930
8929
|
} else if (!formatPainterActive) {
|
|
8931
8930
|
copiedFormatRef.current = null;
|
|
8932
8931
|
}
|
|
@@ -8952,12 +8951,12 @@ function useEditorOperations(input) {
|
|
|
8952
8951
|
e.stopPropagation();
|
|
8953
8952
|
const element = elementLookup.get(elementId);
|
|
8954
8953
|
if (element) {
|
|
8955
|
-
const updated =
|
|
8954
|
+
const updated = chunkHMZA25W2_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
8956
8955
|
const updates = {};
|
|
8957
|
-
if (
|
|
8956
|
+
if (chunkHMZA25W2_js.hasShapeProperties(updated)) {
|
|
8958
8957
|
updates.shapeStyle = updated.shapeStyle;
|
|
8959
8958
|
}
|
|
8960
|
-
if (
|
|
8959
|
+
if (chunkHMZA25W2_js.hasTextProperties(updated)) {
|
|
8961
8960
|
updates.textStyle = updated.textStyle;
|
|
8962
8961
|
}
|
|
8963
8962
|
ops.updateElementById(elementId, updates);
|
|
@@ -9111,7 +9110,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9111
9110
|
const families = /* @__PURE__ */ new Set();
|
|
9112
9111
|
for (const slide of slides) {
|
|
9113
9112
|
for (const el of slide.elements) {
|
|
9114
|
-
if (
|
|
9113
|
+
if (chunkHMZA25W2_js.hasTextProperties(el) && el.textSegments) {
|
|
9115
9114
|
for (const seg of el.textSegments) {
|
|
9116
9115
|
if (seg.style.fontFamily) {
|
|
9117
9116
|
families.add(seg.style.fontFamily);
|
|
@@ -9361,7 +9360,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9361
9360
|
inputRef.current = input;
|
|
9362
9361
|
const handleKeyDown = react.useCallback((e) => {
|
|
9363
9362
|
const current = inputRef.current;
|
|
9364
|
-
const { action, dx, dy } =
|
|
9363
|
+
const { action, dx, dy } = chunkHMZA25W2_js.mapEditorKey(e, {
|
|
9365
9364
|
canEdit: current.canEdit,
|
|
9366
9365
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9367
9366
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9374,7 +9373,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9374
9373
|
hasSelection: current.hasSelection,
|
|
9375
9374
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9376
9375
|
isDrawing: current.activeTool !== "select",
|
|
9377
|
-
isTextInputTarget:
|
|
9376
|
+
isTextInputTarget: chunkHMZA25W2_js.isEditorTextInputTarget(e.target)
|
|
9378
9377
|
});
|
|
9379
9378
|
if (action === null) {
|
|
9380
9379
|
return;
|
|
@@ -9685,7 +9684,7 @@ function useViewerIntegration(input) {
|
|
|
9685
9684
|
return zoom.scale;
|
|
9686
9685
|
},
|
|
9687
9686
|
setZoom(level) {
|
|
9688
|
-
zoom.setScale(
|
|
9687
|
+
zoom.setScale(chunkHMZA25W2_js.clampZoomScale(level));
|
|
9689
9688
|
},
|
|
9690
9689
|
zoomIn() {
|
|
9691
9690
|
zoom.handleZoomIn();
|
|
@@ -9901,7 +9900,7 @@ function useReducedMotion() {
|
|
|
9901
9900
|
}
|
|
9902
9901
|
function useViewerOptions() {
|
|
9903
9902
|
const storeRef = react.useRef(null);
|
|
9904
|
-
storeRef.current ??=
|
|
9903
|
+
storeRef.current ??= chunkHMZA25W2_js.createViewerOptionsStore();
|
|
9905
9904
|
const store = storeRef.current;
|
|
9906
9905
|
const options = react.useSyncExternalStore(
|
|
9907
9906
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9910,9 +9909,9 @@ function useViewerOptions() {
|
|
|
9910
9909
|
);
|
|
9911
9910
|
return { optionsStore: store, options };
|
|
9912
9911
|
}
|
|
9913
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9912
|
+
var KNOWN_TAB_IDS = new Set(chunkHMZA25W2_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9914
9913
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
9915
|
-
const isHidden = (id) =>
|
|
9914
|
+
const isHidden = (id) => chunkHMZA25W2_js.isActionHidden(id, hiddenActions);
|
|
9916
9915
|
const userHidden = new Set(hiddenTabIds);
|
|
9917
9916
|
userHidden.delete("file");
|
|
9918
9917
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
|
|
@@ -10004,12 +10003,12 @@ function useYjsDocumentSync({
|
|
|
10004
10003
|
return;
|
|
10005
10004
|
}
|
|
10006
10005
|
try {
|
|
10007
|
-
const handler = new
|
|
10006
|
+
const handler = new chunkHMZA25W2_js.PptxHandler();
|
|
10008
10007
|
await handler.load(sourceBytes.buffer);
|
|
10009
|
-
const currentSlides =
|
|
10008
|
+
const currentSlides = chunkHMZA25W2_js.readSlidesFromYDoc(
|
|
10010
10009
|
doc
|
|
10011
10010
|
);
|
|
10012
|
-
const slidesToSave =
|
|
10011
|
+
const slidesToSave = chunkHMZA25W2_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10013
10012
|
const bytes = await handler.save(slidesToSave);
|
|
10014
10013
|
config.onWriteBack(bytes);
|
|
10015
10014
|
} catch {
|
|
@@ -10024,10 +10023,10 @@ function useYjsDocumentSync({
|
|
|
10024
10023
|
if (!doc || !isConnected) {
|
|
10025
10024
|
return;
|
|
10026
10025
|
}
|
|
10027
|
-
const docSlides =
|
|
10026
|
+
const docSlides = chunkHMZA25W2_js.readSlidesFromYDoc(
|
|
10028
10027
|
doc
|
|
10029
10028
|
);
|
|
10030
|
-
if (!
|
|
10029
|
+
if (!chunkHMZA25W2_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10031
10030
|
return;
|
|
10032
10031
|
}
|
|
10033
10032
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10046,11 +10045,11 @@ function useYjsDocumentSync({
|
|
|
10046
10045
|
lastSyncedRef.current = serialized;
|
|
10047
10046
|
void (async () => {
|
|
10048
10047
|
const factories = await getFactories();
|
|
10049
|
-
|
|
10048
|
+
chunkHMZA25W2_js.reconcileSlidesInYDoc(
|
|
10050
10049
|
slides,
|
|
10051
10050
|
doc,
|
|
10052
10051
|
factories,
|
|
10053
|
-
|
|
10052
|
+
chunkHMZA25W2_js.LOCAL_SYNC_ORIGIN
|
|
10054
10053
|
);
|
|
10055
10054
|
scheduleWriteBack();
|
|
10056
10055
|
})();
|
|
@@ -10064,10 +10063,10 @@ function useYjsDocumentSync({
|
|
|
10064
10063
|
return;
|
|
10065
10064
|
}
|
|
10066
10065
|
const handleChange = (_events, transaction) => {
|
|
10067
|
-
if (transaction?.origin ===
|
|
10066
|
+
if (transaction?.origin === chunkHMZA25W2_js.LOCAL_SYNC_ORIGIN) {
|
|
10068
10067
|
return;
|
|
10069
10068
|
}
|
|
10070
|
-
const remoteSlides =
|
|
10069
|
+
const remoteSlides = chunkHMZA25W2_js.readSlidesFromYDoc(
|
|
10071
10070
|
doc
|
|
10072
10071
|
);
|
|
10073
10072
|
if (remoteSlides.length === 0) {
|
|
@@ -10083,7 +10082,7 @@ function useYjsDocumentSync({
|
|
|
10083
10082
|
isApplyingRemoteRef.current = false;
|
|
10084
10083
|
scheduleWriteBack();
|
|
10085
10084
|
};
|
|
10086
|
-
const unobserve =
|
|
10085
|
+
const unobserve = chunkHMZA25W2_js.observeYDocSlides(
|
|
10087
10086
|
doc,
|
|
10088
10087
|
handleChange
|
|
10089
10088
|
);
|
|
@@ -10121,7 +10120,7 @@ function useBroadcastFollower({
|
|
|
10121
10120
|
if (!broadcaster) {
|
|
10122
10121
|
return;
|
|
10123
10122
|
}
|
|
10124
|
-
if (!
|
|
10123
|
+
if (!chunkHMZA25W2_js.shouldAutoFollowBroadcaster({
|
|
10125
10124
|
localRole: collab.config.role,
|
|
10126
10125
|
broadcasterRole: broadcaster.role
|
|
10127
10126
|
})) {
|
|
@@ -10292,7 +10291,7 @@ function subscribeTouchCapability(callback) {
|
|
|
10292
10291
|
function useIsMobile() {
|
|
10293
10292
|
const isTouchDevice = react.useSyncExternalStore(
|
|
10294
10293
|
subscribeTouchCapability,
|
|
10295
|
-
|
|
10294
|
+
chunkHMZA25W2_js.detectTouchDevice,
|
|
10296
10295
|
() => false
|
|
10297
10296
|
// server snapshot
|
|
10298
10297
|
);
|
|
@@ -10302,7 +10301,7 @@ function useIsMobile() {
|
|
|
10302
10301
|
const [viewportHeight, setViewportHeight] = react.useState(
|
|
10303
10302
|
() => typeof window === "undefined" ? 768 : window.innerHeight
|
|
10304
10303
|
);
|
|
10305
|
-
const [orientation, setOrientation] = react.useState(
|
|
10304
|
+
const [orientation, setOrientation] = react.useState(chunkHMZA25W2_js.detectOrientation);
|
|
10306
10305
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
10307
10306
|
const [initialViewportHeight] = react.useState(
|
|
10308
10307
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -10323,7 +10322,7 @@ function useIsMobile() {
|
|
|
10323
10322
|
return;
|
|
10324
10323
|
}
|
|
10325
10324
|
const handleOrientationChange = () => {
|
|
10326
|
-
setOrientation(
|
|
10325
|
+
setOrientation(chunkHMZA25W2_js.detectOrientation());
|
|
10327
10326
|
};
|
|
10328
10327
|
if (screen.orientation) {
|
|
10329
10328
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -10353,7 +10352,7 @@ function useIsMobile() {
|
|
|
10353
10352
|
window.addEventListener("resize", handleResize);
|
|
10354
10353
|
return () => window.removeEventListener("resize", handleResize);
|
|
10355
10354
|
}, [isTouchDevice, initialViewportHeight]);
|
|
10356
|
-
const { isMobile, isTablet, isDesktop } =
|
|
10355
|
+
const { isMobile, isTablet, isDesktop } = chunkHMZA25W2_js.deriveViewportBreakpoints(
|
|
10357
10356
|
viewportWidth,
|
|
10358
10357
|
viewportHeight,
|
|
10359
10358
|
isTouchDevice
|
|
@@ -10384,10 +10383,10 @@ function useTouchGestures(input) {
|
|
|
10384
10383
|
if (!el || !enabled) {
|
|
10385
10384
|
return;
|
|
10386
10385
|
}
|
|
10387
|
-
const recognizer =
|
|
10386
|
+
const recognizer = chunkHMZA25W2_js.createTouchGestureRecognizer({
|
|
10388
10387
|
getScale: () => scaleRef.current,
|
|
10389
|
-
minScale:
|
|
10390
|
-
maxScale:
|
|
10388
|
+
minScale: chunkHMZA25W2_js.MIN_ZOOM_SCALE,
|
|
10389
|
+
maxScale: chunkHMZA25W2_js.MAX_ZOOM_SCALE,
|
|
10391
10390
|
callbacks: {
|
|
10392
10391
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10393
10392
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10427,7 +10426,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10427
10426
|
return;
|
|
10428
10427
|
}
|
|
10429
10428
|
const rect = active.getBoundingClientRect();
|
|
10430
|
-
const delta =
|
|
10429
|
+
const delta = chunkHMZA25W2_js.computeScrollDelta(
|
|
10431
10430
|
{ top: rect.top, bottom: rect.bottom },
|
|
10432
10431
|
window.innerHeight,
|
|
10433
10432
|
keyboardInset
|
|
@@ -10447,8 +10446,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10447
10446
|
return;
|
|
10448
10447
|
}
|
|
10449
10448
|
const update = () => {
|
|
10450
|
-
const metrics =
|
|
10451
|
-
const inset = metrics ?
|
|
10449
|
+
const metrics = chunkHMZA25W2_js.readViewportMetrics(window);
|
|
10450
|
+
const inset = metrics ? chunkHMZA25W2_js.computeKeyboardInset(metrics) : 0;
|
|
10452
10451
|
setKeyboardInset(inset);
|
|
10453
10452
|
if (inset > 0) {
|
|
10454
10453
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10459,8 +10458,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10459
10458
|
vv.addEventListener("scroll", update);
|
|
10460
10459
|
const onFocusIn = () => {
|
|
10461
10460
|
window.requestAnimationFrame(() => {
|
|
10462
|
-
const metrics =
|
|
10463
|
-
const inset = metrics ?
|
|
10461
|
+
const metrics = chunkHMZA25W2_js.readViewportMetrics(window);
|
|
10462
|
+
const inset = metrics ? chunkHMZA25W2_js.computeKeyboardInset(metrics) : 0;
|
|
10464
10463
|
if (inset > 0) {
|
|
10465
10464
|
scrollFocusedIntoView(inset);
|
|
10466
10465
|
}
|
|
@@ -10473,7 +10472,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10473
10472
|
document.removeEventListener("focusin", onFocusIn);
|
|
10474
10473
|
};
|
|
10475
10474
|
}, [enabled]);
|
|
10476
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10475
|
+
return { keyboardInset, isKeyboardOpen: chunkHMZA25W2_js.isKeyboardOpen(keyboardInset) };
|
|
10477
10476
|
}
|
|
10478
10477
|
|
|
10479
10478
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10502,21 +10501,21 @@ function buildCanvasProps(input) {
|
|
|
10502
10501
|
} = input;
|
|
10503
10502
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10504
10503
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10505
|
-
const fieldContext =
|
|
10504
|
+
const fieldContext = chunkHMZA25W2_js.buildFieldSubstitutionContext({
|
|
10506
10505
|
headerFooter: s.headerFooter,
|
|
10507
10506
|
customProperties: s.customProperties,
|
|
10508
10507
|
slide: activeSlide
|
|
10509
10508
|
});
|
|
10510
10509
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10511
10510
|
const openExternalUrl = (url) => {
|
|
10512
|
-
if (
|
|
10511
|
+
if (chunkHMZA25W2_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
10513
10512
|
return;
|
|
10514
10513
|
}
|
|
10515
|
-
|
|
10514
|
+
chunkHMZA25W2_js.safeOpenUrl(url);
|
|
10516
10515
|
};
|
|
10517
10516
|
const handleActionClick = (_elementId, action) => {
|
|
10518
10517
|
if (mode === "present") {
|
|
10519
|
-
const resolved =
|
|
10518
|
+
const resolved = chunkHMZA25W2_js.resolvePresentationAction(action, { slideCount: slides.length });
|
|
10520
10519
|
if (resolved.intent.kind === "openUrl") {
|
|
10521
10520
|
openExternalUrl(resolved.intent.url);
|
|
10522
10521
|
return;
|
|
@@ -10527,9 +10526,9 @@ function buildCanvasProps(input) {
|
|
|
10527
10526
|
}
|
|
10528
10527
|
};
|
|
10529
10528
|
const handleHyperlinkClick = (url) => {
|
|
10530
|
-
if (
|
|
10529
|
+
if (chunkHMZA25W2_js.isPpactionUrl(url)) {
|
|
10531
10530
|
if (mode === "present") {
|
|
10532
|
-
const parsed =
|
|
10531
|
+
const parsed = chunkHMZA25W2_js.parsePpactionUrl(url);
|
|
10533
10532
|
if (parsed) {
|
|
10534
10533
|
presentation.handlePresentationAction({
|
|
10535
10534
|
action: parsed.action,
|
|
@@ -10635,7 +10634,7 @@ function buildCanvasProps(input) {
|
|
|
10635
10634
|
|
|
10636
10635
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10637
10636
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10638
|
-
return
|
|
10637
|
+
return chunkHMZA25W2_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10639
10638
|
}
|
|
10640
10639
|
|
|
10641
10640
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10648,7 +10647,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10648
10647
|
const current = activeSlide.animations ?? [];
|
|
10649
10648
|
if (group === "motionPath") {
|
|
10650
10649
|
propertyHandlers.handleUpdateSlide({
|
|
10651
|
-
animations:
|
|
10650
|
+
animations: chunkHMZA25W2_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10652
10651
|
});
|
|
10653
10652
|
return;
|
|
10654
10653
|
}
|
|
@@ -10842,7 +10841,7 @@ function buildToolbarProps(input) {
|
|
|
10842
10841
|
onOpenFile,
|
|
10843
10842
|
onOpenRecentFile,
|
|
10844
10843
|
onCreatePresentation: (templateId) => {
|
|
10845
|
-
s.setSlides(
|
|
10844
|
+
s.setSlides(chunkHMZA25W2_js.createBackstagePresentation(templateId));
|
|
10846
10845
|
s.setActiveSlideIndex(0);
|
|
10847
10846
|
s.setSelectedElementId(null);
|
|
10848
10847
|
s.setSelectedElementIds([]);
|
|
@@ -10871,7 +10870,7 @@ function buildToolbarProps(input) {
|
|
|
10871
10870
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
10872
10871
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10873
10872
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10874
|
-
templateScheme:
|
|
10873
|
+
templateScheme: chunkHMZA25W2_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10875
10874
|
customShows: s.customShows,
|
|
10876
10875
|
activeCustomShowId: s.activeCustomShowId,
|
|
10877
10876
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -10912,7 +10911,7 @@ function buildToolbarProps(input) {
|
|
|
10912
10911
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10913
10912
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10914
10913
|
formatPainterActive: s.formatPainterActive,
|
|
10915
|
-
canActivateFormatPainter:
|
|
10914
|
+
canActivateFormatPainter: chunkHMZA25W2_js.hasCopyableFormat(selectedElement),
|
|
10916
10915
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10917
10916
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10918
10917
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -10986,7 +10985,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
10986
10985
|
headerFooter: state.headerFooter,
|
|
10987
10986
|
loading,
|
|
10988
10987
|
error,
|
|
10989
|
-
maxHistoryEntries:
|
|
10988
|
+
maxHistoryEntries: chunkHMZA25W2_js.resolveHistoryDepth(viewerOptions),
|
|
10990
10989
|
hasActivePointerInteraction,
|
|
10991
10990
|
pointerCommitNonce: state.pointerCommitNonce,
|
|
10992
10991
|
setSlides: state.setSlides,
|
|
@@ -11051,7 +11050,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11051
11050
|
gridSpacingPx,
|
|
11052
11051
|
// Multiplied against the pre-existing 2x baseline; see the matching
|
|
11053
11052
|
// comment in `PowerPointViewer.tsx`.
|
|
11054
|
-
imageExportScale: 2 *
|
|
11053
|
+
imageExportScale: 2 * chunkHMZA25W2_js.resolveImageResolutionScale(viewerOptions),
|
|
11055
11054
|
viewerOptions
|
|
11056
11055
|
};
|
|
11057
11056
|
}
|
|
@@ -11221,7 +11220,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11221
11220
|
}, [incomingContent]);
|
|
11222
11221
|
const onOpenFile = react.useCallback(() => {
|
|
11223
11222
|
void (async () => {
|
|
11224
|
-
const picked = await
|
|
11223
|
+
const picked = await chunkHMZA25W2_js.openPptxFile();
|
|
11225
11224
|
if (picked) {
|
|
11226
11225
|
setContent(picked.buffer);
|
|
11227
11226
|
}
|
|
@@ -11229,7 +11228,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11229
11228
|
}, []);
|
|
11230
11229
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11231
11230
|
void (async () => {
|
|
11232
|
-
const bytes = await
|
|
11231
|
+
const bytes = await chunkHMZA25W2_js.readBackstageRecentFile(key);
|
|
11233
11232
|
if (bytes) {
|
|
11234
11233
|
setContent(bytes);
|
|
11235
11234
|
}
|