pptx-react-viewer 3.1.3 → 3.1.4
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 +11 -0
- package/dist/{AiChatPanel-5JAQBLTU.mjs → AiChatPanel-ITCVRVKP.mjs} +3 -3
- package/dist/AiChatPanel-ITCVRVKP.mjs.br +0 -0
- package/dist/AiChatPanel-ITCVRVKP.mjs.gz +0 -0
- package/dist/{AiChatPanel-C3E7UV7T.js → AiChatPanel-TO5PHBGW.js} +23 -23
- package/dist/AiChatPanel-TO5PHBGW.js.br +0 -0
- package/dist/AiChatPanel-TO5PHBGW.js.gz +0 -0
- package/dist/{Area3DChartScene-XY2PKRMA.js → Area3DChartScene-2UNQ3J3V.js} +2 -2
- package/dist/Area3DChartScene-2UNQ3J3V.js.br +0 -0
- package/dist/Area3DChartScene-2UNQ3J3V.js.gz +0 -0
- package/dist/{Area3DChartScene-KE434ERF.mjs → Area3DChartScene-7PHPDOTG.mjs} +1 -1
- package/dist/Area3DChartScene-7PHPDOTG.mjs.br +0 -0
- package/dist/Area3DChartScene-7PHPDOTG.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-2KQABQZM.mjs → Bar3DChartScene-BLPUHYRZ.mjs} +1 -1
- package/dist/Bar3DChartScene-BLPUHYRZ.mjs.br +0 -0
- package/dist/Bar3DChartScene-BLPUHYRZ.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-YMADUUZN.js → Bar3DChartScene-MC5S3AGT.js} +2 -2
- package/dist/Bar3DChartScene-MC5S3AGT.js.br +0 -0
- package/dist/Bar3DChartScene-MC5S3AGT.js.gz +0 -0
- package/dist/{Line3DChartScene-AB7N6ORX.js → Line3DChartScene-JVVZRIDD.js} +2 -2
- package/dist/Line3DChartScene-JVVZRIDD.js.br +0 -0
- package/dist/Line3DChartScene-JVVZRIDD.js.gz +0 -0
- package/dist/{Line3DChartScene-K3BSK6BB.mjs → Line3DChartScene-L5B4YFG3.mjs} +1 -1
- package/dist/Line3DChartScene-L5B4YFG3.mjs.br +0 -0
- package/dist/Line3DChartScene-L5B4YFG3.mjs.gz +0 -0
- package/dist/{Model3DScene-NT5RRIB5.mjs → Model3DScene-6TNWS5LV.mjs} +1 -1
- package/dist/Model3DScene-6TNWS5LV.mjs.br +0 -0
- package/dist/Model3DScene-6TNWS5LV.mjs.gz +0 -0
- package/dist/{Model3DScene-VSLGUWC7.js → Model3DScene-LRDNQNKJ.js} +2 -2
- package/dist/Model3DScene-LRDNQNKJ.js.br +0 -0
- package/dist/Model3DScene-LRDNQNKJ.js.gz +0 -0
- package/dist/{PieChart3DScene-6MUFRFYJ.js → PieChart3DScene-PZWZCXHX.js} +2 -2
- package/dist/PieChart3DScene-PZWZCXHX.js.br +0 -0
- package/dist/PieChart3DScene-PZWZCXHX.js.gz +0 -0
- package/dist/{PieChart3DScene-NFRBKII7.mjs → PieChart3DScene-XXAIVP4I.mjs} +1 -1
- package/dist/PieChart3DScene-XXAIVP4I.mjs.br +0 -0
- package/dist/PieChart3DScene-XXAIVP4I.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-UKIOTKJC.mjs → SurfaceChart3DScene-CRUGJSCY.mjs} +1 -1
- package/dist/SurfaceChart3DScene-CRUGJSCY.mjs.br +1 -0
- package/dist/SurfaceChart3DScene-CRUGJSCY.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-2UQOKVFB.js → SurfaceChart3DScene-UBQV3ZN2.js} +2 -2
- package/dist/SurfaceChart3DScene-UBQV3ZN2.js.br +0 -0
- package/dist/SurfaceChart3DScene-UBQV3ZN2.js.gz +0 -0
- package/dist/UTIF-LAD5QYGQ.mjs +6400 -0
- package/dist/UTIF-LAD5QYGQ.mjs.br +0 -0
- package/dist/UTIF-LAD5QYGQ.mjs.gz +0 -0
- package/dist/UTIF-POYWAAGO.js +6402 -0
- package/dist/UTIF-POYWAAGO.js.br +0 -0
- package/dist/UTIF-POYWAAGO.js.gz +0 -0
- package/dist/{chunk-5WH6UVWC.mjs → chunk-57MGKBJ4.mjs} +253 -77
- package/dist/chunk-57MGKBJ4.mjs.br +0 -0
- package/dist/chunk-57MGKBJ4.mjs.gz +0 -0
- package/dist/{chunk-BZ6OM3H5.mjs → chunk-A2UAUSJM.mjs} +113 -6
- package/dist/chunk-A2UAUSJM.mjs.br +0 -0
- package/dist/chunk-A2UAUSJM.mjs.gz +0 -0
- package/dist/{chunk-ACVLIDUS.mjs → chunk-BPWSJLLG.mjs} +158 -29
- package/dist/chunk-BPWSJLLG.mjs.br +0 -0
- package/dist/chunk-BPWSJLLG.mjs.gz +0 -0
- package/dist/{chunk-K4DUVYZ7.js → chunk-LGVNUG3G.js} +3 -3
- package/dist/chunk-LGVNUG3G.js.br +0 -0
- package/dist/chunk-LGVNUG3G.js.gz +0 -0
- package/dist/{chunk-XBR7W47W.js → chunk-LXYDXLKZ.js} +510 -403
- package/dist/chunk-LXYDXLKZ.js.br +0 -0
- package/dist/chunk-LXYDXLKZ.js.gz +0 -0
- package/dist/{chunk-Z3DEULRJ.mjs → chunk-QOLYY7E3.mjs} +1 -1
- package/dist/chunk-QOLYY7E3.mjs.br +0 -0
- package/dist/chunk-QOLYY7E3.mjs.gz +0 -0
- package/dist/{chunk-OABOL32L.js → chunk-T2QG2HD5.js} +302 -171
- package/dist/chunk-T2QG2HD5.js.br +0 -0
- package/dist/chunk-T2QG2HD5.js.gz +0 -0
- package/dist/{chunk-GCOGKBK3.js → chunk-T44LBKF6.js} +1342 -1166
- package/dist/chunk-T44LBKF6.js.br +0 -0
- package/dist/chunk-T44LBKF6.js.gz +0 -0
- package/dist/{chunk-SRAXNEJX.mjs → chunk-XIHK52SB.mjs} +1525 -341
- package/dist/chunk-XIHK52SB.mjs.br +0 -0
- package/dist/chunk-XIHK52SB.mjs.gz +0 -0
- package/dist/{chunk-HMZA25W2.js → chunk-YDEEINER.js} +1528 -343
- package/dist/chunk-YDEEINER.js.br +0 -0
- package/dist/chunk-YDEEINER.js.gz +0 -0
- package/dist/index.d.ts +139 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -49
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +139 -3
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.d.ts +139 -3
- 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 +2 -2
- package/dist/AiChatPanel-5JAQBLTU.mjs.br +0 -0
- package/dist/AiChatPanel-5JAQBLTU.mjs.gz +0 -0
- package/dist/AiChatPanel-C3E7UV7T.js.br +0 -0
- package/dist/AiChatPanel-C3E7UV7T.js.gz +0 -0
- package/dist/Area3DChartScene-KE434ERF.mjs.br +0 -0
- package/dist/Area3DChartScene-KE434ERF.mjs.gz +0 -0
- package/dist/Area3DChartScene-XY2PKRMA.js.br +0 -0
- package/dist/Area3DChartScene-XY2PKRMA.js.gz +0 -0
- package/dist/Bar3DChartScene-2KQABQZM.mjs.br +0 -0
- package/dist/Bar3DChartScene-2KQABQZM.mjs.gz +0 -0
- package/dist/Bar3DChartScene-YMADUUZN.js.br +0 -0
- package/dist/Bar3DChartScene-YMADUUZN.js.gz +0 -0
- package/dist/Line3DChartScene-AB7N6ORX.js.br +0 -0
- package/dist/Line3DChartScene-AB7N6ORX.js.gz +0 -0
- package/dist/Line3DChartScene-K3BSK6BB.mjs.br +0 -0
- package/dist/Line3DChartScene-K3BSK6BB.mjs.gz +0 -0
- package/dist/Model3DScene-NT5RRIB5.mjs.br +0 -0
- package/dist/Model3DScene-NT5RRIB5.mjs.gz +0 -0
- package/dist/Model3DScene-VSLGUWC7.js.br +0 -0
- package/dist/Model3DScene-VSLGUWC7.js.gz +0 -0
- package/dist/PieChart3DScene-6MUFRFYJ.js.br +0 -0
- package/dist/PieChart3DScene-6MUFRFYJ.js.gz +0 -0
- package/dist/PieChart3DScene-NFRBKII7.mjs.br +0 -0
- package/dist/PieChart3DScene-NFRBKII7.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-2UQOKVFB.js.br +0 -0
- package/dist/SurfaceChart3DScene-2UQOKVFB.js.gz +0 -0
- package/dist/SurfaceChart3DScene-UKIOTKJC.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-UKIOTKJC.mjs.gz +0 -0
- package/dist/chunk-5WH6UVWC.mjs.br +0 -0
- package/dist/chunk-5WH6UVWC.mjs.gz +0 -0
- package/dist/chunk-ACVLIDUS.mjs.br +0 -0
- package/dist/chunk-ACVLIDUS.mjs.gz +0 -0
- package/dist/chunk-BZ6OM3H5.mjs.br +0 -0
- package/dist/chunk-BZ6OM3H5.mjs.gz +0 -0
- package/dist/chunk-GCOGKBK3.js.br +0 -0
- package/dist/chunk-GCOGKBK3.js.gz +0 -0
- package/dist/chunk-HMZA25W2.js.br +0 -0
- package/dist/chunk-HMZA25W2.js.gz +0 -0
- package/dist/chunk-K4DUVYZ7.js.br +0 -0
- package/dist/chunk-K4DUVYZ7.js.gz +0 -0
- package/dist/chunk-OABOL32L.js.br +0 -0
- package/dist/chunk-OABOL32L.js.gz +0 -0
- package/dist/chunk-SRAXNEJX.mjs.br +0 -0
- package/dist/chunk-SRAXNEJX.mjs.gz +0 -0
- package/dist/chunk-XBR7W47W.js.br +0 -0
- package/dist/chunk-XBR7W47W.js.gz +0 -0
- package/dist/chunk-Z3DEULRJ.mjs.br +0 -0
- package/dist/chunk-Z3DEULRJ.mjs.gz +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkT2QG2HD5_js = require('./chunk-T2QG2HD5.js');
|
|
4
|
+
var chunkYDEEINER_js = require('./chunk-YDEEINER.js');
|
|
4
5
|
var chunkSWRY3SI5_js = require('./chunk-SWRY3SI5.js');
|
|
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 = chunkYDEEINER_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 = chunkYDEEINER_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 ??= chunkYDEEINER_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 >= chunkYDEEINER_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
|
+
}, chunkYDEEINER_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 = chunkYDEEINER_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
|
+
chunkYDEEINER_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 = chunkYDEEINER_js.validateRoomId(config.roomId);
|
|
244
244
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
245
|
-
departureRef.current =
|
|
245
|
+
departureRef.current = chunkYDEEINER_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 = chunkYDEEINER_js.validateRoomId(config.roomId);
|
|
288
|
+
const transport = config.transport ?? chunkYDEEINER_js.resolveTransportForServerUrl(config.serverUrl);
|
|
289
289
|
if (transport === "webrtc") {
|
|
290
290
|
await initWebrtc();
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
293
|
+
if (chunkYDEEINER_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 = chunkYDEEINER_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
|
+
chunkYDEEINER_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
|
+
}, chunkYDEEINER_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
|
+
chunkYDEEINER_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 = chunkYDEEINER_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 = chunkYDEEINER_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(chunkYDEEINER_js.cloneSlide),
|
|
531
|
+
templateElementsBySlideId: chunkYDEEINER_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(chunkYDEEINER_js.cloneSlide));
|
|
545
545
|
setTemplateElementsBySlideId(
|
|
546
|
-
|
|
546
|
+
chunkYDEEINER_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 = chunkT2QG2HD5_js.cloneHistorySnapshot(previousSnapshot);
|
|
586
|
+
lastHistorySnapshotRef.current = chunkT2QG2HD5_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 = chunkT2QG2HD5_js.cloneHistorySnapshot(nextSnapshot);
|
|
608
|
+
lastHistorySnapshotRef.current = chunkT2QG2HD5_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 = chunkT2QG2HD5_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 = chunkT2QG2HD5_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(chunkT2QG2HD5_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 = chunkT2QG2HD5_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(chunkYDEEINER_js.createWheelStepBuffer());
|
|
747
747
|
const storeRef = react.useRef(null);
|
|
748
|
-
storeRef.current ??=
|
|
748
|
+
storeRef.current ??= chunkYDEEINER_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 = chunkYDEEINER_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, chunkT2QG2HD5_js.MIN_ELEMENT_SIZE));
|
|
847
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkT2QG2HD5_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, chunkT2QG2HD5_js.MIN_ELEMENT_SIZE);
|
|
854
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkT2QG2HD5_js.MIN_ELEMENT_SIZE);
|
|
855
855
|
const availableWidth = Math.max(
|
|
856
|
-
effectiveEditorDimensions.width -
|
|
857
|
-
|
|
856
|
+
effectiveEditorDimensions.width - chunkT2QG2HD5_js.ZOOM_TO_SELECTION_PADDING,
|
|
857
|
+
chunkT2QG2HD5_js.MIN_ELEMENT_SIZE
|
|
858
858
|
);
|
|
859
859
|
const availableHeight = Math.max(
|
|
860
|
-
effectiveEditorDimensions.height -
|
|
861
|
-
|
|
860
|
+
effectiveEditorDimensions.height - chunkT2QG2HD5_js.ZOOM_TO_SELECTION_PADDING,
|
|
861
|
+
chunkT2QG2HD5_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 = chunkYDEEINER_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 = chunkYDEEINER_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: chunkYDEEINER_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
|
+
chunkT2QG2HD5_js.executeMediaCommand(command);
|
|
981
981
|
},
|
|
982
982
|
Math.max(0, step.delayMs)
|
|
983
983
|
);
|
|
@@ -1032,6 +1032,77 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
1032
1032
|
presentationTimersRef.current.push(timer);
|
|
1033
1033
|
}
|
|
1034
1034
|
}
|
|
1035
|
+
function shouldSeekAnimationGroup(group, endAtMs, nowMs) {
|
|
1036
|
+
return group?.seqNextAction === "seek" && nowMs < endAtMs;
|
|
1037
|
+
}
|
|
1038
|
+
function finishDomAnimationsForGroup(group, root = document) {
|
|
1039
|
+
const targetIds = new Set(
|
|
1040
|
+
group.steps.filter((step) => !step.command).map((step) => step.elementId)
|
|
1041
|
+
);
|
|
1042
|
+
if (targetIds.size === 0) {
|
|
1043
|
+
return 0;
|
|
1044
|
+
}
|
|
1045
|
+
const activeAnimations = /* @__PURE__ */ new Set();
|
|
1046
|
+
const candidates = root.querySelectorAll(
|
|
1047
|
+
'[data-element-id], [data-anim-id], [data-pptx-animation-layer="background"]'
|
|
1048
|
+
);
|
|
1049
|
+
for (const element of candidates) {
|
|
1050
|
+
let animationElementId = element.dataset.animId ?? element.dataset.elementId;
|
|
1051
|
+
if (element.dataset.pptxAnimationLayer === "background") {
|
|
1052
|
+
const hostId = element.closest("[data-element-id]")?.dataset.elementId;
|
|
1053
|
+
animationElementId = hostId ? `${hostId}::pptx-bg` : void 0;
|
|
1054
|
+
}
|
|
1055
|
+
if (!animationElementId || !targetIds.has(animationElementId)) {
|
|
1056
|
+
continue;
|
|
1057
|
+
}
|
|
1058
|
+
if (typeof element.getAnimations !== "function") {
|
|
1059
|
+
continue;
|
|
1060
|
+
}
|
|
1061
|
+
for (const animation of element.getAnimations()) {
|
|
1062
|
+
activeAnimations.add(animation);
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
let finishedCount = 0;
|
|
1066
|
+
for (const animation of activeAnimations) {
|
|
1067
|
+
const iterations = animation.effect?.getTiming().iterations;
|
|
1068
|
+
if (animation.playState === "finished" || animation.playState === "idle") {
|
|
1069
|
+
continue;
|
|
1070
|
+
}
|
|
1071
|
+
if (iterations === Infinity) {
|
|
1072
|
+
continue;
|
|
1073
|
+
}
|
|
1074
|
+
try {
|
|
1075
|
+
animation.finish();
|
|
1076
|
+
finishedCount += 1;
|
|
1077
|
+
} catch {
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
return finishedCount;
|
|
1081
|
+
}
|
|
1082
|
+
function finishAnimationGroupSteps(group, setPresentationElementStates, completedStates) {
|
|
1083
|
+
setPresentationElementStates((previousStates) => {
|
|
1084
|
+
const nextStates = new Map(previousStates);
|
|
1085
|
+
for (const step of group.steps) {
|
|
1086
|
+
if (step.command) {
|
|
1087
|
+
continue;
|
|
1088
|
+
}
|
|
1089
|
+
const currentState = nextStates.get(step.elementId) ?? {
|
|
1090
|
+
visible: true,
|
|
1091
|
+
cssAnimation: void 0
|
|
1092
|
+
};
|
|
1093
|
+
const holdsAnimatedPaint = step.holdEndState && step.colorTargets !== void 0 && step.colorTargets.length > 0;
|
|
1094
|
+
nextStates.set(step.elementId, {
|
|
1095
|
+
...currentState,
|
|
1096
|
+
visible: step.presetClass !== "exit" && !step.hideAfterEffect,
|
|
1097
|
+
cssAnimation: step.holdEndState ? step.cssAnimation : void 0,
|
|
1098
|
+
build: completedStates?.get(step.elementId)?.build ?? currentState.build,
|
|
1099
|
+
animatesFill: holdsAnimatedPaint && step.colorTargets?.includes("fill") ? true : void 0,
|
|
1100
|
+
animatesStroke: holdsAnimatedPaint && step.colorTargets?.includes("stroke") ? true : void 0
|
|
1101
|
+
});
|
|
1102
|
+
}
|
|
1103
|
+
return nextStates;
|
|
1104
|
+
});
|
|
1105
|
+
}
|
|
1035
1106
|
|
|
1036
1107
|
// src/viewer/hooks/presentation-mode/build-playback.ts
|
|
1037
1108
|
function cancelBuildReveal(handle) {
|
|
@@ -1094,6 +1165,7 @@ function scheduleOpeningAutoPlayGroup(controller, deps) {
|
|
|
1094
1165
|
deps.setPresentationElementStates,
|
|
1095
1166
|
deps.presentationTimersRef
|
|
1096
1167
|
);
|
|
1168
|
+
deps.markAnimationGroupActive(group);
|
|
1097
1169
|
deps.startBuildReveal(controller, group);
|
|
1098
1170
|
deps.scheduleAutoAdvanceChain(controller);
|
|
1099
1171
|
}, firstGroup.autoAdvanceDelayMs ?? 0);
|
|
@@ -1114,7 +1186,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1114
1186
|
}))
|
|
1115
1187
|
);
|
|
1116
1188
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1117
|
-
const delay =
|
|
1189
|
+
const delay = chunkYDEEINER_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1118
1190
|
const timer = window.setTimeout(() => {
|
|
1119
1191
|
setPresentationAnimations(
|
|
1120
1192
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1140,13 +1212,15 @@ function useAnimationPlayback(input) {
|
|
|
1140
1212
|
const presentationTimersRef = react.useRef([]);
|
|
1141
1213
|
const controllerRef = react.useRef(null);
|
|
1142
1214
|
const buildRafRef = react.useRef(null);
|
|
1215
|
+
const activeAnimationGroupRef = react.useRef(null);
|
|
1216
|
+
const activeAnimationEndAtRef = react.useRef(0);
|
|
1143
1217
|
const seededCompletedRef = react.useRef(false);
|
|
1144
1218
|
const lastSeedCompletedRef = react.useRef(false);
|
|
1145
1219
|
const startBuildReveal = react.useCallback(
|
|
1146
1220
|
(controller, group) => {
|
|
1147
1221
|
driveBuildReveal(
|
|
1148
1222
|
controller,
|
|
1149
|
-
|
|
1223
|
+
chunkYDEEINER_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1150
1224
|
setPresentationElementStates,
|
|
1151
1225
|
buildRafRef
|
|
1152
1226
|
);
|
|
@@ -1164,6 +1238,12 @@ function useAnimationPlayback(input) {
|
|
|
1164
1238
|
});
|
|
1165
1239
|
presentationTimersRef.current = [];
|
|
1166
1240
|
cancelBuildReveal(buildRafRef);
|
|
1241
|
+
activeAnimationGroupRef.current = null;
|
|
1242
|
+
activeAnimationEndAtRef.current = 0;
|
|
1243
|
+
}, []);
|
|
1244
|
+
const markAnimationGroupActive = react.useCallback((group) => {
|
|
1245
|
+
activeAnimationGroupRef.current = group;
|
|
1246
|
+
activeAnimationEndAtRef.current = performance.now() + Math.max(0, group.totalDurationMs);
|
|
1167
1247
|
}, []);
|
|
1168
1248
|
const scheduleAutoAdvanceChain = react.useCallback(
|
|
1169
1249
|
(controller) => {
|
|
@@ -1188,6 +1268,7 @@ function useAnimationPlayback(input) {
|
|
|
1188
1268
|
setPresentationElementStates,
|
|
1189
1269
|
presentationTimersRef
|
|
1190
1270
|
);
|
|
1271
|
+
markAnimationGroupActive(group);
|
|
1191
1272
|
startBuildReveal(controller, group);
|
|
1192
1273
|
scheduleAutoAdvanceChain(controller);
|
|
1193
1274
|
},
|
|
@@ -1201,7 +1282,7 @@ function useAnimationPlayback(input) {
|
|
|
1201
1282
|
// resolves correctly because the setTimeout callback only reads the binding
|
|
1202
1283
|
// once the outer const has been assigned.
|
|
1203
1284
|
// oxlint-disable-next-line react/memo-dependencies -- see comment above
|
|
1204
|
-
[onPlayActionSound, startBuildReveal]
|
|
1285
|
+
[markAnimationGroupActive, onPlayActionSound, startBuildReveal]
|
|
1205
1286
|
);
|
|
1206
1287
|
const resetSlideTimeline = react.useCallback(
|
|
1207
1288
|
(slideIndex) => {
|
|
@@ -1215,7 +1296,7 @@ function useAnimationPlayback(input) {
|
|
|
1215
1296
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1216
1297
|
return;
|
|
1217
1298
|
}
|
|
1218
|
-
const controller =
|
|
1299
|
+
const controller = chunkYDEEINER_js.PresentationAnimationController.fromSlide(slide);
|
|
1219
1300
|
controllerRef.current = controller;
|
|
1220
1301
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1221
1302
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1229,6 +1310,16 @@ function useAnimationPlayback(input) {
|
|
|
1229
1310
|
return false;
|
|
1230
1311
|
}
|
|
1231
1312
|
const controller = controllerRef.current;
|
|
1313
|
+
const activeGroup = activeAnimationGroupRef.current;
|
|
1314
|
+
if (controller && controller.hasMoreSteps() && shouldSeekAnimationGroup(activeGroup, activeAnimationEndAtRef.current, performance.now())) {
|
|
1315
|
+
finishDomAnimationsForGroup(activeGroup);
|
|
1316
|
+
const buildIds = chunkYDEEINER_js.PresentationAnimationController.collectBuildStepIds(activeGroup);
|
|
1317
|
+
const completedStates = controller.computeStatesFor(buildIds);
|
|
1318
|
+
clearPresentationTimers();
|
|
1319
|
+
finishAnimationGroupSteps(activeGroup, setPresentationElementStates, completedStates);
|
|
1320
|
+
scheduleAutoAdvanceChain(controller);
|
|
1321
|
+
return true;
|
|
1322
|
+
}
|
|
1232
1323
|
if (!controller || !controller.hasMoreSteps()) {
|
|
1233
1324
|
return false;
|
|
1234
1325
|
}
|
|
@@ -1242,10 +1333,18 @@ function useAnimationPlayback(input) {
|
|
|
1242
1333
|
setPresentationElementStates,
|
|
1243
1334
|
presentationTimersRef
|
|
1244
1335
|
);
|
|
1336
|
+
markAnimationGroupActive(group);
|
|
1245
1337
|
startBuildReveal(controller, group);
|
|
1246
1338
|
scheduleAutoAdvanceChain(controller);
|
|
1247
1339
|
return true;
|
|
1248
|
-
}, [
|
|
1340
|
+
}, [
|
|
1341
|
+
animationsEnabled,
|
|
1342
|
+
clearPresentationTimers,
|
|
1343
|
+
markAnimationGroupActive,
|
|
1344
|
+
onPlayActionSound,
|
|
1345
|
+
scheduleAutoAdvanceChain,
|
|
1346
|
+
startBuildReveal
|
|
1347
|
+
]);
|
|
1249
1348
|
const handleInteractiveShapeClick = react.useCallback(
|
|
1250
1349
|
(shapeId) => {
|
|
1251
1350
|
const controller = controllerRef.current;
|
|
@@ -1341,12 +1440,20 @@ function useAnimationPlayback(input) {
|
|
|
1341
1440
|
setPresentationElementStates,
|
|
1342
1441
|
presentationTimersRef,
|
|
1343
1442
|
startBuildReveal,
|
|
1344
|
-
scheduleAutoAdvanceChain
|
|
1443
|
+
scheduleAutoAdvanceChain,
|
|
1444
|
+
markAnimationGroupActive
|
|
1345
1445
|
});
|
|
1346
1446
|
}
|
|
1347
1447
|
scheduleEntranceAnimationTimers(slide, setPresentationAnimations, presentationTimersRef);
|
|
1348
1448
|
},
|
|
1349
|
-
[
|
|
1449
|
+
[
|
|
1450
|
+
animationsEnabled,
|
|
1451
|
+
slides,
|
|
1452
|
+
onPlayActionSound,
|
|
1453
|
+
markAnimationGroupActive,
|
|
1454
|
+
scheduleAutoAdvanceChain,
|
|
1455
|
+
startBuildReveal
|
|
1456
|
+
]
|
|
1350
1457
|
);
|
|
1351
1458
|
const runPresentationEntranceAnimations = react.useCallback(
|
|
1352
1459
|
(slideIndex, options) => {
|
|
@@ -1373,12 +1480,12 @@ function useAnimationPlayback(input) {
|
|
|
1373
1480
|
presentationTimersRef
|
|
1374
1481
|
};
|
|
1375
1482
|
}
|
|
1376
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1377
|
-
var AUDIENCE_HASH =
|
|
1378
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1379
|
-
var AUDIENCE_NONCE_KEY =
|
|
1483
|
+
var PRESENTER_CHANNEL_NAME = chunkYDEEINER_js.PRESENTATION_CHANNEL_NAME;
|
|
1484
|
+
var AUDIENCE_HASH = chunkYDEEINER_js.PRESENTATION_HASH;
|
|
1485
|
+
var PRESENTER_MSG_ORIGIN = chunkYDEEINER_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1486
|
+
var AUDIENCE_NONCE_KEY = chunkYDEEINER_js.PRESENTATION_NONCE_KEY;
|
|
1380
1487
|
function generateSessionId() {
|
|
1381
|
-
return
|
|
1488
|
+
return chunkYDEEINER_js.createPresentationSessionId();
|
|
1382
1489
|
}
|
|
1383
1490
|
function parseAudienceNonce() {
|
|
1384
1491
|
const hash = window.location.hash;
|
|
@@ -1414,7 +1521,7 @@ function usePresenterWindow(input) {
|
|
|
1414
1521
|
}, []);
|
|
1415
1522
|
const swapDisplays = react.useCallback(async () => {
|
|
1416
1523
|
const audience = audienceWindowRef.current;
|
|
1417
|
-
return audience && !audience.closed ?
|
|
1524
|
+
return audience && !audience.closed ? chunkYDEEINER_js.swapPresentationWindows(window, audience) : false;
|
|
1418
1525
|
}, []);
|
|
1419
1526
|
const syncSlideToAudience = react.useCallback(
|
|
1420
1527
|
(slideIndex) => {
|
|
@@ -1478,7 +1585,7 @@ function usePresenterWindow(input) {
|
|
|
1478
1585
|
pollTimerRef.current = null;
|
|
1479
1586
|
}
|
|
1480
1587
|
if (closingSessionId) {
|
|
1481
|
-
void
|
|
1588
|
+
void chunkYDEEINER_js.clearAudienceContent(closingSessionId);
|
|
1482
1589
|
}
|
|
1483
1590
|
}, [getChannel]);
|
|
1484
1591
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1496,10 +1603,10 @@ function usePresenterWindow(input) {
|
|
|
1496
1603
|
audienceWindowRef.current = blankWin;
|
|
1497
1604
|
const sessionId = generateSessionId();
|
|
1498
1605
|
sessionIdRef.current = sessionId;
|
|
1499
|
-
const audienceUrl =
|
|
1500
|
-
void
|
|
1606
|
+
const audienceUrl = chunkYDEEINER_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1607
|
+
void chunkYDEEINER_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1501
1608
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1502
|
-
|
|
1609
|
+
chunkYDEEINER_js.placeAudienceWindow(blankWin, placement);
|
|
1503
1610
|
}
|
|
1504
1611
|
return void 0;
|
|
1505
1612
|
});
|
|
@@ -1529,7 +1636,7 @@ function usePresenterWindow(input) {
|
|
|
1529
1636
|
}
|
|
1530
1637
|
};
|
|
1531
1638
|
if (content) {
|
|
1532
|
-
void
|
|
1639
|
+
void chunkYDEEINER_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1533
1640
|
} else {
|
|
1534
1641
|
navigateOrClose(true);
|
|
1535
1642
|
}
|
|
@@ -1555,7 +1662,7 @@ function usePresenterWindow(input) {
|
|
|
1555
1662
|
}
|
|
1556
1663
|
const handleMessage = (event) => {
|
|
1557
1664
|
const message = event.data;
|
|
1558
|
-
if (
|
|
1665
|
+
if (chunkYDEEINER_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1559
1666
|
syncStateToAudience(snapshotRef.current);
|
|
1560
1667
|
}
|
|
1561
1668
|
};
|
|
@@ -1584,7 +1691,7 @@ function usePresenterWindow(input) {
|
|
|
1584
1691
|
react.useEffect(() => {
|
|
1585
1692
|
const handleBeforeUnload = () => {
|
|
1586
1693
|
if (sessionIdRef.current) {
|
|
1587
|
-
void
|
|
1694
|
+
void chunkYDEEINER_js.clearAudienceContent(sessionIdRef.current);
|
|
1588
1695
|
}
|
|
1589
1696
|
};
|
|
1590
1697
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1646,7 +1753,7 @@ function useAudienceMode(input) {
|
|
|
1646
1753
|
}
|
|
1647
1754
|
channel.onmessage = (event) => {
|
|
1648
1755
|
const data = event.data;
|
|
1649
|
-
if (!
|
|
1756
|
+
if (!chunkYDEEINER_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1650
1757
|
return;
|
|
1651
1758
|
}
|
|
1652
1759
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1662,16 +1769,16 @@ function useAudienceMode(input) {
|
|
|
1662
1769
|
}
|
|
1663
1770
|
if (data.type === "presenter-exit") {
|
|
1664
1771
|
if (expectedSessionId) {
|
|
1665
|
-
void
|
|
1772
|
+
void chunkYDEEINER_js.clearAudienceContent(expectedSessionId);
|
|
1666
1773
|
}
|
|
1667
|
-
if (
|
|
1774
|
+
if (chunkYDEEINER_js.endAudienceDisplay(window)) {
|
|
1668
1775
|
handlers.onPresenterEnded?.();
|
|
1669
1776
|
}
|
|
1670
1777
|
}
|
|
1671
1778
|
};
|
|
1672
1779
|
if (expectedSessionId) {
|
|
1673
1780
|
channel.postMessage({
|
|
1674
|
-
origin:
|
|
1781
|
+
origin: chunkYDEEINER_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1675
1782
|
type: "audience-ready",
|
|
1676
1783
|
sessionId: expectedSessionId
|
|
1677
1784
|
});
|
|
@@ -1685,7 +1792,7 @@ function useAudienceMode(input) {
|
|
|
1685
1792
|
}, []);
|
|
1686
1793
|
}
|
|
1687
1794
|
function usePresentationKeyboard(input) {
|
|
1688
|
-
const wheelBufferRef = react.useRef(
|
|
1795
|
+
const wheelBufferRef = react.useRef(chunkYDEEINER_js.createWheelStepBuffer());
|
|
1689
1796
|
const {
|
|
1690
1797
|
mode,
|
|
1691
1798
|
movePresentationSlide,
|
|
@@ -1706,14 +1813,14 @@ function usePresentationKeyboard(input) {
|
|
|
1706
1813
|
presentationSlideIndex,
|
|
1707
1814
|
setShowRehearsalSummary
|
|
1708
1815
|
} = input;
|
|
1709
|
-
const keyBufferRef = react.useRef(
|
|
1816
|
+
const keyBufferRef = react.useRef(chunkYDEEINER_js.createPresentationKeyBuffer());
|
|
1710
1817
|
react.useEffect(() => {
|
|
1711
|
-
if (mode !== "present" || !
|
|
1712
|
-
keyBufferRef.current =
|
|
1818
|
+
if (mode !== "present" || !chunkYDEEINER_js.acceptsPresentationInput()) {
|
|
1819
|
+
keyBufferRef.current = chunkYDEEINER_js.createPresentationKeyBuffer();
|
|
1713
1820
|
return;
|
|
1714
1821
|
}
|
|
1715
1822
|
const handleKeyDown = (event) => {
|
|
1716
|
-
const mapped =
|
|
1823
|
+
const mapped = chunkYDEEINER_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1717
1824
|
if (mapped.action === "none") {
|
|
1718
1825
|
return;
|
|
1719
1826
|
}
|
|
@@ -1733,12 +1840,12 @@ function usePresentationKeyboard(input) {
|
|
|
1733
1840
|
movePresentationSlide(-1);
|
|
1734
1841
|
return;
|
|
1735
1842
|
case "first": {
|
|
1736
|
-
const first =
|
|
1843
|
+
const first = chunkYDEEINER_js.firstShowSlideIndex(showSlideIndexes);
|
|
1737
1844
|
navigateToSlide(first ?? 0);
|
|
1738
1845
|
return;
|
|
1739
1846
|
}
|
|
1740
1847
|
case "last": {
|
|
1741
|
-
const last =
|
|
1848
|
+
const last = chunkYDEEINER_js.lastShowSlideIndex(showSlideIndexes);
|
|
1742
1849
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1743
1850
|
return;
|
|
1744
1851
|
}
|
|
@@ -1776,10 +1883,10 @@ function usePresentationKeyboard(input) {
|
|
|
1776
1883
|
}
|
|
1777
1884
|
};
|
|
1778
1885
|
const handleWheel = (event) => {
|
|
1779
|
-
if (mode !== "present" || !
|
|
1886
|
+
if (mode !== "present" || !chunkYDEEINER_js.acceptsPresentationInput()) {
|
|
1780
1887
|
return;
|
|
1781
1888
|
}
|
|
1782
|
-
const mapped =
|
|
1889
|
+
const mapped = chunkYDEEINER_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1783
1890
|
if (mapped.intent === "next-slide") {
|
|
1784
1891
|
event.preventDefault();
|
|
1785
1892
|
movePresentationSlide(1);
|
|
@@ -1912,7 +2019,7 @@ function useRehearsalTimings(input) {
|
|
|
1912
2019
|
|
|
1913
2020
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1914
2021
|
function handlePresentationActionImpl(action, deps) {
|
|
1915
|
-
|
|
2022
|
+
chunkYDEEINER_js.runPresentationAction(
|
|
1916
2023
|
action,
|
|
1917
2024
|
{ slideCount: deps.slidesLength },
|
|
1918
2025
|
{
|
|
@@ -1934,7 +2041,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1934
2041
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1935
2042
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1936
2043
|
const transition = incomingSlide?.transition;
|
|
1937
|
-
const durationMs = deps.playTransition ?
|
|
2044
|
+
const durationMs = deps.playTransition ? chunkYDEEINER_js.resolveTransitionDurationMs(transition) : 0;
|
|
1938
2045
|
deps.clearPresentationTimers();
|
|
1939
2046
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1940
2047
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1993,7 +2100,7 @@ function useSlideNavigation(input) {
|
|
|
1993
2100
|
});
|
|
1994
2101
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1995
2102
|
(slideIndex) => {
|
|
1996
|
-
const delayMs =
|
|
2103
|
+
const delayMs = chunkYDEEINER_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1997
2104
|
if (delayMs === void 0) {
|
|
1998
2105
|
return;
|
|
1999
2106
|
}
|
|
@@ -2016,7 +2123,7 @@ function useSlideNavigation(input) {
|
|
|
2016
2123
|
if (availableSlideIndexes.length === 0) {
|
|
2017
2124
|
return;
|
|
2018
2125
|
}
|
|
2019
|
-
const pastLastSlide = direction === 1 && !
|
|
2126
|
+
const pastLastSlide = direction === 1 && !chunkYDEEINER_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
2020
2127
|
if (rehearsing && pastLastSlide) {
|
|
2021
2128
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
2022
2129
|
try {
|
|
@@ -2034,9 +2141,9 @@ function useSlideNavigation(input) {
|
|
|
2034
2141
|
onAdvancePastLastSlide();
|
|
2035
2142
|
return;
|
|
2036
2143
|
}
|
|
2037
|
-
const nextSlideIndex = direction === 1 ?
|
|
2144
|
+
const nextSlideIndex = direction === 1 ? chunkYDEEINER_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
2038
2145
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
2039
|
-
}) :
|
|
2146
|
+
}) : chunkYDEEINER_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
2040
2147
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
2041
2148
|
return;
|
|
2042
2149
|
}
|
|
@@ -2181,22 +2288,22 @@ function useZoomNavigation(input) {
|
|
|
2181
2288
|
};
|
|
2182
2289
|
}
|
|
2183
2290
|
function usePresenterConsole(slideIndex, active) {
|
|
2184
|
-
const timerRef = react.useRef(
|
|
2185
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2291
|
+
const timerRef = react.useRef(chunkYDEEINER_js.createPresenterTimer());
|
|
2292
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkYDEEINER_js.createInitialPresentationSnapshot(slideIndex));
|
|
2186
2293
|
const patch = react.useCallback((value) => {
|
|
2187
|
-
setSnapshot((current) =>
|
|
2294
|
+
setSnapshot((current) => chunkYDEEINER_js.mergePresentationSnapshot(current, value));
|
|
2188
2295
|
}, []);
|
|
2189
2296
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2190
2297
|
react.useEffect(() => {
|
|
2191
2298
|
if (!active) {
|
|
2192
2299
|
return;
|
|
2193
2300
|
}
|
|
2194
|
-
timerRef.current =
|
|
2301
|
+
timerRef.current = chunkYDEEINER_js.resetPresenterTimer();
|
|
2195
2302
|
patch({ paused: false, elapsedMs: 0 });
|
|
2196
2303
|
const timer = window.setInterval(() => {
|
|
2197
2304
|
patch({
|
|
2198
2305
|
paused: timerRef.current.paused,
|
|
2199
|
-
elapsedMs:
|
|
2306
|
+
elapsedMs: chunkYDEEINER_js.presenterElapsed(timerRef.current)
|
|
2200
2307
|
});
|
|
2201
2308
|
}, 1e3);
|
|
2202
2309
|
return () => window.clearInterval(timer);
|
|
@@ -2206,19 +2313,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2206
2313
|
applyAudienceSnapshot: setSnapshot,
|
|
2207
2314
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2208
2315
|
toggleTimer: () => {
|
|
2209
|
-
timerRef.current =
|
|
2316
|
+
timerRef.current = chunkYDEEINER_js.togglePresenterTimer(timerRef.current);
|
|
2210
2317
|
patch({
|
|
2211
2318
|
paused: timerRef.current.paused,
|
|
2212
|
-
elapsedMs:
|
|
2319
|
+
elapsedMs: chunkYDEEINER_js.presenterElapsed(timerRef.current)
|
|
2213
2320
|
});
|
|
2214
2321
|
},
|
|
2215
2322
|
resetTimer: () => {
|
|
2216
|
-
timerRef.current =
|
|
2323
|
+
timerRef.current = chunkYDEEINER_js.resetPresenterTimer();
|
|
2217
2324
|
patch({ paused: false, elapsedMs: 0 });
|
|
2218
2325
|
},
|
|
2219
2326
|
stepZoom: (direction) => setSnapshot(
|
|
2220
|
-
(current) =>
|
|
2221
|
-
zoom:
|
|
2327
|
+
(current) => chunkYDEEINER_js.mergePresentationSnapshot(current, {
|
|
2328
|
+
zoom: chunkYDEEINER_js.stepPresenterZoom(
|
|
2222
2329
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2223
2330
|
direction
|
|
2224
2331
|
)
|
|
@@ -2264,7 +2371,7 @@ function usePresentationMode(input) {
|
|
|
2264
2371
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2265
2372
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2266
2373
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2267
|
-
const showGuard = react.useMemo(() =>
|
|
2374
|
+
const showGuard = react.useMemo(() => chunkYDEEINER_js.createPresenterShowGuard(), []);
|
|
2268
2375
|
const {
|
|
2269
2376
|
presentationAnimations,
|
|
2270
2377
|
presentationElementStates,
|
|
@@ -2343,7 +2450,7 @@ function usePresentationMode(input) {
|
|
|
2343
2450
|
});
|
|
2344
2451
|
const movePresentationSlide = react.useCallback(
|
|
2345
2452
|
(direction, trigger = "explicit") => {
|
|
2346
|
-
if (!
|
|
2453
|
+
if (!chunkYDEEINER_js.acceptsPresentationInput()) {
|
|
2347
2454
|
return;
|
|
2348
2455
|
}
|
|
2349
2456
|
if (endOfShowVisible) {
|
|
@@ -2481,7 +2588,7 @@ function usePresentationMode(input) {
|
|
|
2481
2588
|
if (mode !== "present") {
|
|
2482
2589
|
return;
|
|
2483
2590
|
}
|
|
2484
|
-
return
|
|
2591
|
+
return chunkYDEEINER_js.attachPresentationVisibilityPause({
|
|
2485
2592
|
root: containerRef.current ?? void 0,
|
|
2486
2593
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2487
2594
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2561,11 +2668,11 @@ function usePresentationMode(input) {
|
|
|
2561
2668
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2562
2669
|
return void 0;
|
|
2563
2670
|
}
|
|
2564
|
-
return
|
|
2671
|
+
return chunkYDEEINER_js.buildMorphTransitionPlan(
|
|
2565
2672
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2566
2673
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2567
2674
|
transitionOverlay.durationMs,
|
|
2568
|
-
|
|
2675
|
+
chunkYDEEINER_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2569
2676
|
);
|
|
2570
2677
|
}, [transitionOverlay, slides]);
|
|
2571
2678
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2586,7 +2693,7 @@ function usePresentationMode(input) {
|
|
|
2586
2693
|
if (!morphPlan) {
|
|
2587
2694
|
return presentationKeyframesCss;
|
|
2588
2695
|
}
|
|
2589
|
-
const imageRules =
|
|
2696
|
+
const imageRules = chunkYDEEINER_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2590
2697
|
return `${presentationKeyframesCss ?? ""}
|
|
2591
2698
|
${morphPlan.keyframesCss}
|
|
2592
2699
|
${imageRules}`;
|
|
@@ -2882,7 +2989,7 @@ function useFindReplace({
|
|
|
2882
2989
|
const [findResults, setFindResults] = react.useState([]);
|
|
2883
2990
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
2884
2991
|
const performFind = react.useCallback(() => {
|
|
2885
|
-
const results =
|
|
2992
|
+
const results = chunkYDEEINER_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
2886
2993
|
if (!findQuery) {
|
|
2887
2994
|
setFindResults([]);
|
|
2888
2995
|
setFindResultIndex(-1);
|
|
@@ -2916,7 +3023,7 @@ function useFindReplace({
|
|
|
2916
3023
|
return;
|
|
2917
3024
|
}
|
|
2918
3025
|
onUpdateSlides(
|
|
2919
|
-
(prevSlides) =>
|
|
3026
|
+
(prevSlides) => chunkYDEEINER_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
2920
3027
|
);
|
|
2921
3028
|
onMarkDirty();
|
|
2922
3029
|
},
|
|
@@ -2938,9 +3045,9 @@ function useFindReplace({
|
|
|
2938
3045
|
}, [findResults, applyReplacements, performFind]);
|
|
2939
3046
|
react.useEffect(() => {
|
|
2940
3047
|
const handler = (event) => {
|
|
2941
|
-
const { action } =
|
|
3048
|
+
const { action } = chunkYDEEINER_js.mapEditorKey(event, {
|
|
2942
3049
|
canEdit: mode === "edit",
|
|
2943
|
-
isTextInputTarget:
|
|
3050
|
+
isTextInputTarget: chunkYDEEINER_js.isEditorTextInputTarget(event.target)
|
|
2944
3051
|
});
|
|
2945
3052
|
if (action !== "find") {
|
|
2946
3053
|
return;
|
|
@@ -3019,7 +3126,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId) {
|
|
|
3019
3126
|
if (!slide) {
|
|
3020
3127
|
return { slides, didAdd: false };
|
|
3021
3128
|
}
|
|
3022
|
-
const next =
|
|
3129
|
+
const next = chunkYDEEINER_js.addCommentToList(
|
|
3023
3130
|
slide.comments || [],
|
|
3024
3131
|
text,
|
|
3025
3132
|
authorName,
|
|
@@ -3037,7 +3144,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
|
3037
3144
|
if (!slide) {
|
|
3038
3145
|
return { slides, didDelete: false };
|
|
3039
3146
|
}
|
|
3040
|
-
const next =
|
|
3147
|
+
const next = chunkYDEEINER_js.removeCommentFromList(slide.comments || [], commentId);
|
|
3041
3148
|
if (!next) {
|
|
3042
3149
|
return { slides, didDelete: false };
|
|
3043
3150
|
}
|
|
@@ -3048,7 +3155,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
|
3048
3155
|
if (!slide) {
|
|
3049
3156
|
return { slides, didUpdate: false };
|
|
3050
3157
|
}
|
|
3051
|
-
const next =
|
|
3158
|
+
const next = chunkYDEEINER_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
3052
3159
|
if (!next) {
|
|
3053
3160
|
return { slides, didUpdate: false };
|
|
3054
3161
|
}
|
|
@@ -3059,7 +3166,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
|
3059
3166
|
if (!slide) {
|
|
3060
3167
|
return { slides, didUpdate: false };
|
|
3061
3168
|
}
|
|
3062
|
-
const next =
|
|
3169
|
+
const next = chunkYDEEINER_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
3063
3170
|
if (!next) {
|
|
3064
3171
|
return { slides, didUpdate: false };
|
|
3065
3172
|
}
|
|
@@ -3070,7 +3177,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName) {
|
|
|
3070
3177
|
if (!slide) {
|
|
3071
3178
|
return { slides, didAdd: false };
|
|
3072
3179
|
}
|
|
3073
|
-
const next =
|
|
3180
|
+
const next = chunkYDEEINER_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
3074
3181
|
if (!next) {
|
|
3075
3182
|
return { slides, didAdd: false };
|
|
3076
3183
|
}
|
|
@@ -3444,7 +3551,7 @@ function useViewerCoreState(_input) {
|
|
|
3444
3551
|
const marqueeStateRef = react.useRef(null);
|
|
3445
3552
|
const isDrawingRef = react.useRef(false);
|
|
3446
3553
|
const justInteractedRef = react.useRef(false);
|
|
3447
|
-
const livePatcher = react.useMemo(() =>
|
|
3554
|
+
const livePatcher = react.useMemo(() => chunkYDEEINER_js.createCollaborationLivePatcher(), []);
|
|
3448
3555
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3449
3556
|
const slidesRef = react.useRef([]);
|
|
3450
3557
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3453,8 +3560,8 @@ function useViewerCoreState(_input) {
|
|
|
3453
3560
|
const [slides, setSlides] = react.useState([]);
|
|
3454
3561
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3455
3562
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3456
|
-
width:
|
|
3457
|
-
height:
|
|
3563
|
+
width: chunkT2QG2HD5_js.DEFAULT_CANVAS_WIDTH,
|
|
3564
|
+
height: chunkT2QG2HD5_js.DEFAULT_CANVAS_HEIGHT
|
|
3458
3565
|
});
|
|
3459
3566
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3460
3567
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3475,7 +3582,7 @@ function useViewerCoreState(_input) {
|
|
|
3475
3582
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3476
3583
|
inlineEditingTextRef.current = resolved;
|
|
3477
3584
|
setInlineEditingTextBase(value);
|
|
3478
|
-
|
|
3585
|
+
chunkYDEEINER_js.publishLiveInlineText(
|
|
3479
3586
|
livePatcher,
|
|
3480
3587
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3481
3588
|
inlineEditingElementIdRef.current,
|
|
@@ -3819,7 +3926,7 @@ function useLoadContent({
|
|
|
3819
3926
|
);
|
|
3820
3927
|
}
|
|
3821
3928
|
const previousHandler = handlerRef.current;
|
|
3822
|
-
const handler = new
|
|
3929
|
+
const handler = new chunkYDEEINER_js.PptxHandler();
|
|
3823
3930
|
const parsed = await handler.load(buffer, { allowExternalImages });
|
|
3824
3931
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3825
3932
|
handler.dispose();
|
|
@@ -3831,7 +3938,7 @@ function useLoadContent({
|
|
|
3831
3938
|
handlerRef.current = null;
|
|
3832
3939
|
const mediaElements = [];
|
|
3833
3940
|
for (const slide of parsed.slides) {
|
|
3834
|
-
|
|
3941
|
+
chunkYDEEINER_js.collectMediaElements(slide.elements, mediaElements);
|
|
3835
3942
|
}
|
|
3836
3943
|
for (const url of mediaDataUrls.values()) {
|
|
3837
3944
|
if (url.startsWith("blob:")) {
|
|
@@ -3872,7 +3979,7 @@ function useLoadContent({
|
|
|
3872
3979
|
}
|
|
3873
3980
|
})
|
|
3874
3981
|
);
|
|
3875
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3982
|
+
const { paths: imagePaths, refs: imageRefs } = chunkYDEEINER_js.collectImagePaths(parsed.slides);
|
|
3876
3983
|
let nextSlides = parsed.slides;
|
|
3877
3984
|
if (imagePaths.size > 0) {
|
|
3878
3985
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3926,7 +4033,7 @@ function useLoadContent({
|
|
|
3926
4033
|
});
|
|
3927
4034
|
}
|
|
3928
4035
|
}
|
|
3929
|
-
const { paths: tableImagePaths, refs: tableImageRefs } =
|
|
4036
|
+
const { paths: tableImagePaths, refs: tableImageRefs } = chunkYDEEINER_js.collectTableCellImagePaths(nextSlides);
|
|
3930
4037
|
if (tableImagePaths.size > 0) {
|
|
3931
4038
|
const resolvedTableMap = /* @__PURE__ */ new Map();
|
|
3932
4039
|
await Promise.all(
|
|
@@ -3942,7 +4049,7 @@ function useLoadContent({
|
|
|
3942
4049
|
);
|
|
3943
4050
|
if (resolvedTableMap.size > 0) {
|
|
3944
4051
|
nextSlides = nextSlides.map((s) => {
|
|
3945
|
-
const newElements =
|
|
4052
|
+
const newElements = chunkYDEEINER_js.applyTableCellImagePatches(
|
|
3946
4053
|
s.elements,
|
|
3947
4054
|
resolvedTableMap,
|
|
3948
4055
|
tableImageRefs
|
|
@@ -3952,7 +4059,7 @@ function useLoadContent({
|
|
|
3952
4059
|
}
|
|
3953
4060
|
}
|
|
3954
4061
|
let nextTableStyleMap = parsed.tableStyleMap;
|
|
3955
|
-
const { paths: tableStyleImagePaths, refs: tableStyleImageRefs } =
|
|
4062
|
+
const { paths: tableStyleImagePaths, refs: tableStyleImageRefs } = chunkYDEEINER_js.collectTableStyleImagePaths(nextTableStyleMap);
|
|
3956
4063
|
if (tableStyleImagePaths.size > 0) {
|
|
3957
4064
|
const resolvedStyleMap = /* @__PURE__ */ new Map();
|
|
3958
4065
|
await Promise.all(
|
|
@@ -3967,7 +4074,7 @@ function useLoadContent({
|
|
|
3967
4074
|
})
|
|
3968
4075
|
);
|
|
3969
4076
|
if (resolvedStyleMap.size > 0 && nextTableStyleMap) {
|
|
3970
|
-
nextTableStyleMap =
|
|
4077
|
+
nextTableStyleMap = chunkYDEEINER_js.applyTableStyleImagePatches(
|
|
3971
4078
|
nextTableStyleMap,
|
|
3972
4079
|
resolvedStyleMap,
|
|
3973
4080
|
tableStyleImageRefs
|
|
@@ -3975,12 +4082,12 @@ function useLoadContent({
|
|
|
3975
4082
|
}
|
|
3976
4083
|
}
|
|
3977
4084
|
handlerRef.current = handler;
|
|
3978
|
-
const partition =
|
|
4085
|
+
const partition = chunkYDEEINER_js.partitionTemplateElements(nextSlides);
|
|
3979
4086
|
setSlides(partition.slides);
|
|
3980
4087
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3981
4088
|
setCanvasSize({
|
|
3982
|
-
width: parsed.width ??
|
|
3983
|
-
height: parsed.height ??
|
|
4089
|
+
width: parsed.width ?? chunkT2QG2HD5_js.DEFAULT_CANVAS_WIDTH,
|
|
4090
|
+
height: parsed.height ?? chunkT2QG2HD5_js.DEFAULT_CANVAS_HEIGHT
|
|
3984
4091
|
});
|
|
3985
4092
|
setSlideSizeEmu(
|
|
3986
4093
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -3997,7 +4104,7 @@ function useLoadContent({
|
|
|
3997
4104
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
3998
4105
|
setCustomShows(parsed.customShows ?? []);
|
|
3999
4106
|
setActiveCustomShowId(
|
|
4000
|
-
|
|
4107
|
+
chunkYDEEINER_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
4001
4108
|
);
|
|
4002
4109
|
setSections(parsed.sections ?? []);
|
|
4003
4110
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -4020,7 +4127,7 @@ function useLoadContent({
|
|
|
4020
4127
|
setHasMacros(parsed.hasMacros === true);
|
|
4021
4128
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4022
4129
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4023
|
-
setGuides(
|
|
4130
|
+
setGuides(chunkYDEEINER_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4024
4131
|
setActiveSlideIndex(0);
|
|
4025
4132
|
clearSelection();
|
|
4026
4133
|
setIsDirty(false);
|
|
@@ -4028,7 +4135,7 @@ function useLoadContent({
|
|
|
4028
4135
|
onContentApplied?.();
|
|
4029
4136
|
} catch (err) {
|
|
4030
4137
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4031
|
-
if (err instanceof
|
|
4138
|
+
if (err instanceof chunkYDEEINER_js.EncryptedFileError) {
|
|
4032
4139
|
setIsEncrypted(true);
|
|
4033
4140
|
} else {
|
|
4034
4141
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4056,7 +4163,7 @@ function useLoadContent({
|
|
|
4056
4163
|
}
|
|
4057
4164
|
function useAutosave(input) {
|
|
4058
4165
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4059
|
-
const intervalMs =
|
|
4166
|
+
const intervalMs = chunkYDEEINER_js.resolveAutosaveIntervalMs({
|
|
4060
4167
|
hostIntervalMs: input.intervalMs,
|
|
4061
4168
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4062
4169
|
});
|
|
@@ -4087,7 +4194,7 @@ function useAutosave(input) {
|
|
|
4087
4194
|
return;
|
|
4088
4195
|
}
|
|
4089
4196
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4090
|
-
if (!
|
|
4197
|
+
if (!chunkYDEEINER_js.shouldWriteAutosaveSnapshot({
|
|
4091
4198
|
filePath: path,
|
|
4092
4199
|
isDirty: isDirtyRef.current,
|
|
4093
4200
|
saving: isSavingRef.current,
|
|
@@ -4105,8 +4212,8 @@ function useAutosave(input) {
|
|
|
4105
4212
|
isSavingRef.current = false;
|
|
4106
4213
|
return;
|
|
4107
4214
|
}
|
|
4108
|
-
await
|
|
4109
|
-
lastSnapshotRef.current =
|
|
4215
|
+
await chunkYDEEINER_js.saveAutosaveSnapshot(path, data);
|
|
4216
|
+
lastSnapshotRef.current = chunkYDEEINER_js.autosaveSnapshotMark(path, sources);
|
|
4110
4217
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4111
4218
|
} catch (err) {
|
|
4112
4219
|
setAutosaveStatus({
|
|
@@ -4192,11 +4299,11 @@ function useElementOperations(input) {
|
|
|
4192
4299
|
(elementId, updates) => {
|
|
4193
4300
|
if (masterView?.target) {
|
|
4194
4301
|
applyMasterViewWrite(
|
|
4195
|
-
|
|
4302
|
+
chunkYDEEINER_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4196
4303
|
);
|
|
4197
4304
|
return;
|
|
4198
4305
|
}
|
|
4199
|
-
if (
|
|
4306
|
+
if (chunkYDEEINER_js.isTemplateElementId(elementId)) {
|
|
4200
4307
|
const slideId = activeSlide?.id;
|
|
4201
4308
|
if (slideId) {
|
|
4202
4309
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4244,7 +4351,7 @@ function useElementOperations(input) {
|
|
|
4244
4351
|
);
|
|
4245
4352
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4246
4353
|
(updates) => {
|
|
4247
|
-
if (!selectedElement || !
|
|
4354
|
+
if (!selectedElement || !chunkYDEEINER_js.hasShapeProperties(selectedElement)) {
|
|
4248
4355
|
return;
|
|
4249
4356
|
}
|
|
4250
4357
|
updateSelectedElement({
|
|
@@ -4255,17 +4362,17 @@ function useElementOperations(input) {
|
|
|
4255
4362
|
);
|
|
4256
4363
|
const updateSelectedTextStyle = react.useCallback(
|
|
4257
4364
|
(updates) => {
|
|
4258
|
-
if (!selectedElement || !
|
|
4365
|
+
if (!selectedElement || !chunkYDEEINER_js.hasTextProperties(selectedElement)) {
|
|
4259
4366
|
return;
|
|
4260
4367
|
}
|
|
4261
|
-
const inlineSel =
|
|
4368
|
+
const inlineSel = chunkYDEEINER_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4262
4369
|
if (inlineSel && selectedElement.textSegments) {
|
|
4263
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4370
|
+
const { newSegments: newSegments2, newSelection } = chunkYDEEINER_js.applyStyleToSelectedSegments(
|
|
4264
4371
|
selectedElement.textSegments,
|
|
4265
4372
|
inlineSel,
|
|
4266
4373
|
updates
|
|
4267
4374
|
);
|
|
4268
|
-
|
|
4375
|
+
chunkYDEEINER_js.setPendingSelectionRestore(newSelection);
|
|
4269
4376
|
updateSelectedElement({
|
|
4270
4377
|
textSegments: newSegments2
|
|
4271
4378
|
});
|
|
@@ -4285,12 +4392,12 @@ function useElementOperations(input) {
|
|
|
4285
4392
|
);
|
|
4286
4393
|
const updateSelectedTextCase = react.useCallback(
|
|
4287
4394
|
(mode) => {
|
|
4288
|
-
if (!selectedElement || !
|
|
4395
|
+
if (!selectedElement || !chunkYDEEINER_js.hasTextProperties(selectedElement)) {
|
|
4289
4396
|
return;
|
|
4290
4397
|
}
|
|
4291
|
-
const inlineSel =
|
|
4398
|
+
const inlineSel = chunkYDEEINER_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4292
4399
|
if (inlineSel && selectedElement.textSegments) {
|
|
4293
|
-
const newSegments =
|
|
4400
|
+
const newSegments = chunkYDEEINER_js.applyCaseTransformToSegments(
|
|
4294
4401
|
selectedElement.textSegments,
|
|
4295
4402
|
inlineSel,
|
|
4296
4403
|
mode
|
|
@@ -4300,14 +4407,14 @@ function useElementOperations(input) {
|
|
|
4300
4407
|
}
|
|
4301
4408
|
const updates = {};
|
|
4302
4409
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4303
|
-
updates.textSegments =
|
|
4410
|
+
updates.textSegments = chunkYDEEINER_js.applyCaseTransformToSegments(
|
|
4304
4411
|
selectedElement.textSegments,
|
|
4305
4412
|
null,
|
|
4306
4413
|
mode
|
|
4307
4414
|
);
|
|
4308
4415
|
}
|
|
4309
4416
|
if (typeof selectedElement.text === "string") {
|
|
4310
|
-
updates.text =
|
|
4417
|
+
updates.text = chunkYDEEINER_js.transformTextCase(selectedElement.text, mode);
|
|
4311
4418
|
}
|
|
4312
4419
|
updateSelectedElement(updates);
|
|
4313
4420
|
},
|
|
@@ -4320,15 +4427,15 @@ function useElementOperations(input) {
|
|
|
4320
4427
|
[setSlides]
|
|
4321
4428
|
);
|
|
4322
4429
|
const masterViewTarget = masterView?.target ?? null;
|
|
4323
|
-
const activeElements = masterViewTarget ?
|
|
4430
|
+
const activeElements = masterViewTarget ? chunkYDEEINER_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4324
4431
|
const updateActiveElements = react.useCallback(
|
|
4325
4432
|
(updater) => {
|
|
4326
4433
|
if (masterView?.target) {
|
|
4327
4434
|
applyMasterViewWrite(
|
|
4328
|
-
|
|
4435
|
+
chunkYDEEINER_js.replaceMasterViewElements(
|
|
4329
4436
|
masterView,
|
|
4330
4437
|
masterView.target,
|
|
4331
|
-
updater(
|
|
4438
|
+
updater(chunkYDEEINER_js.masterViewElements(masterView, masterView.target))
|
|
4332
4439
|
)
|
|
4333
4440
|
);
|
|
4334
4441
|
return;
|
|
@@ -4381,7 +4488,7 @@ function useSectionOperations(input) {
|
|
|
4381
4488
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4382
4489
|
const addSection2 = react.useCallback(
|
|
4383
4490
|
(name, afterSlideIndex) => {
|
|
4384
|
-
const result =
|
|
4491
|
+
const result = chunkYDEEINER_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4385
4492
|
setSlides(result.slides);
|
|
4386
4493
|
setSections(result.sections);
|
|
4387
4494
|
markDirty();
|
|
@@ -4390,7 +4497,7 @@ function useSectionOperations(input) {
|
|
|
4390
4497
|
);
|
|
4391
4498
|
const renameSection2 = react.useCallback(
|
|
4392
4499
|
(sectionId, newName) => {
|
|
4393
|
-
const result =
|
|
4500
|
+
const result = chunkYDEEINER_js.renameSection(sections, slides, sectionId, newName);
|
|
4394
4501
|
setSections(result.sections);
|
|
4395
4502
|
setSlides(result.slides);
|
|
4396
4503
|
markDirty();
|
|
@@ -4399,7 +4506,7 @@ function useSectionOperations(input) {
|
|
|
4399
4506
|
);
|
|
4400
4507
|
const deleteSection2 = react.useCallback(
|
|
4401
4508
|
(sectionId) => {
|
|
4402
|
-
const result =
|
|
4509
|
+
const result = chunkYDEEINER_js.deleteSection(sections, slides, sectionId);
|
|
4403
4510
|
setSections(result.sections);
|
|
4404
4511
|
setSlides(result.slides);
|
|
4405
4512
|
markDirty();
|
|
@@ -4408,21 +4515,21 @@ function useSectionOperations(input) {
|
|
|
4408
4515
|
);
|
|
4409
4516
|
const moveSectionUp2 = react.useCallback(
|
|
4410
4517
|
(sectionId) => {
|
|
4411
|
-
setSections(
|
|
4518
|
+
setSections(chunkYDEEINER_js.moveSectionUp(sections, sectionId));
|
|
4412
4519
|
markDirty();
|
|
4413
4520
|
},
|
|
4414
4521
|
[sections, setSections, markDirty]
|
|
4415
4522
|
);
|
|
4416
4523
|
const moveSectionDown2 = react.useCallback(
|
|
4417
4524
|
(sectionId) => {
|
|
4418
|
-
setSections(
|
|
4525
|
+
setSections(chunkYDEEINER_js.moveSectionDown(sections, sectionId));
|
|
4419
4526
|
markDirty();
|
|
4420
4527
|
},
|
|
4421
4528
|
[sections, setSections, markDirty]
|
|
4422
4529
|
);
|
|
4423
4530
|
const moveSlidesToSection2 = react.useCallback(
|
|
4424
4531
|
(slideIndexes, targetSectionId) => {
|
|
4425
|
-
const result =
|
|
4532
|
+
const result = chunkYDEEINER_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4426
4533
|
setSlides(result.slides);
|
|
4427
4534
|
setSections(result.sections);
|
|
4428
4535
|
markDirty();
|
|
@@ -4451,19 +4558,19 @@ function useSectionOperations(input) {
|
|
|
4451
4558
|
|
|
4452
4559
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4453
4560
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4454
|
-
const resized =
|
|
4561
|
+
const resized = chunkYDEEINER_js.applyResize(
|
|
4455
4562
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4456
4563
|
handle,
|
|
4457
4564
|
dx,
|
|
4458
4565
|
dy,
|
|
4459
4566
|
1,
|
|
4460
|
-
{ minSize:
|
|
4567
|
+
{ minSize: chunkT2QG2HD5_js.MIN_ELEMENT_SIZE }
|
|
4461
4568
|
);
|
|
4462
4569
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4463
4570
|
if (!snapToGrid) {
|
|
4464
4571
|
return box;
|
|
4465
4572
|
}
|
|
4466
|
-
return
|
|
4573
|
+
return chunkYDEEINER_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkT2QG2HD5_js.MIN_ELEMENT_SIZE);
|
|
4467
4574
|
}
|
|
4468
4575
|
function resolveLiveTarget(input) {
|
|
4469
4576
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4576,7 +4683,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4576
4683
|
width: el.width,
|
|
4577
4684
|
height: el.height
|
|
4578
4685
|
}));
|
|
4579
|
-
const snapResult =
|
|
4686
|
+
const snapResult = chunkYDEEINER_js.computeSnapToShape(
|
|
4580
4687
|
targetX,
|
|
4581
4688
|
targetY,
|
|
4582
4689
|
primaryEl.width,
|
|
@@ -4615,7 +4722,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4615
4722
|
if (live) {
|
|
4616
4723
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4617
4724
|
const start = drag.startPositionsById[id];
|
|
4618
|
-
|
|
4725
|
+
chunkYDEEINER_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4619
4726
|
x: start.x + appliedDx,
|
|
4620
4727
|
y: start.y + appliedDy
|
|
4621
4728
|
});
|
|
@@ -4649,22 +4756,22 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4649
4756
|
if (rs.domEl) {
|
|
4650
4757
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4651
4758
|
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,
|
|
4759
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunkT2QG2HD5_js.MIN_ELEMENT_SIZE)}px`;
|
|
4760
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunkT2QG2HD5_js.MIN_ELEMENT_SIZE)}px`;
|
|
4654
4761
|
}
|
|
4655
4762
|
if (live) {
|
|
4656
|
-
|
|
4763
|
+
chunkYDEEINER_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4657
4764
|
x: geo.x,
|
|
4658
4765
|
y: geo.y,
|
|
4659
|
-
width: Math.max(geo.width,
|
|
4660
|
-
height: Math.max(geo.height,
|
|
4766
|
+
width: Math.max(geo.width, chunkT2QG2HD5_js.MIN_ELEMENT_SIZE),
|
|
4767
|
+
height: Math.max(geo.height, chunkT2QG2HD5_js.MIN_ELEMENT_SIZE)
|
|
4661
4768
|
});
|
|
4662
4769
|
}
|
|
4663
4770
|
}
|
|
4664
4771
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4665
4772
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4666
4773
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4667
|
-
const adjustments =
|
|
4774
|
+
const adjustments = chunkYDEEINER_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4668
4775
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4669
4776
|
adj.moved = true;
|
|
4670
4777
|
}
|
|
@@ -4739,13 +4846,13 @@ function processPointerUp(input) {
|
|
|
4739
4846
|
if (i !== activeSlideIndex) {
|
|
4740
4847
|
return s;
|
|
4741
4848
|
}
|
|
4742
|
-
const rerouted =
|
|
4849
|
+
const rerouted = chunkYDEEINER_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4743
4850
|
if (rerouted.length === 0) {
|
|
4744
4851
|
return s;
|
|
4745
4852
|
}
|
|
4746
4853
|
return {
|
|
4747
4854
|
...s,
|
|
4748
|
-
elements:
|
|
4855
|
+
elements: chunkYDEEINER_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4749
4856
|
};
|
|
4750
4857
|
})
|
|
4751
4858
|
);
|
|
@@ -4770,9 +4877,9 @@ function processPointerUp(input) {
|
|
|
4770
4877
|
}
|
|
4771
4878
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4772
4879
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4773
|
-
const hitIds =
|
|
4880
|
+
const hitIds = chunkYDEEINER_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4774
4881
|
if (marquee.additive) {
|
|
4775
|
-
const merged =
|
|
4882
|
+
const merged = chunkYDEEINER_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4776
4883
|
if (merged.length > 0) {
|
|
4777
4884
|
applySelection(merged[0], merged);
|
|
4778
4885
|
} else {
|
|
@@ -4795,8 +4902,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4795
4902
|
}
|
|
4796
4903
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4797
4904
|
});
|
|
4798
|
-
const rerouted =
|
|
4799
|
-
return
|
|
4905
|
+
const rerouted = chunkYDEEINER_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4906
|
+
return chunkYDEEINER_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4800
4907
|
};
|
|
4801
4908
|
if (editTemplateMode) {
|
|
4802
4909
|
const slideId = activeSlide?.id;
|
|
@@ -4952,11 +5059,11 @@ function useCanvasInteractions(input) {
|
|
|
4952
5059
|
return;
|
|
4953
5060
|
}
|
|
4954
5061
|
const el = elementLookup.get(editId);
|
|
4955
|
-
if (el &&
|
|
5062
|
+
if (el && chunkYDEEINER_js.hasTextProperties(el)) {
|
|
4956
5063
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4957
|
-
const newSegments =
|
|
5064
|
+
const newSegments = chunkYDEEINER_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4958
5065
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
4959
|
-
const newHeight =
|
|
5066
|
+
const newHeight = chunkYDEEINER_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
4960
5067
|
ops.updateElementById(editId, {
|
|
4961
5068
|
text: committedText,
|
|
4962
5069
|
textSegments: newSegments,
|
|
@@ -4968,7 +5075,7 @@ function useCanvasInteractions(input) {
|
|
|
4968
5075
|
setInlineEditingText("");
|
|
4969
5076
|
};
|
|
4970
5077
|
const openEquationEditorForElement = (el) => {
|
|
4971
|
-
if (!
|
|
5078
|
+
if (!chunkYDEEINER_js.hasTextProperties(el)) {
|
|
4972
5079
|
return false;
|
|
4973
5080
|
}
|
|
4974
5081
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4998,7 +5105,7 @@ function useCanvasInteractions(input) {
|
|
|
4998
5105
|
justInteractedRef.current = false;
|
|
4999
5106
|
} else {
|
|
5000
5107
|
const el = elementLookup.get(elementId);
|
|
5001
|
-
if (el &&
|
|
5108
|
+
if (el && chunkYDEEINER_js.hasTextProperties(el) && chunkYDEEINER_js.canInteractWithElement(el, "textEdit")) {
|
|
5002
5109
|
if (!openEquationEditorForElement(el)) {
|
|
5003
5110
|
setInlineEditingElementId(elementId);
|
|
5004
5111
|
setInlineEditingText(el.text ?? "");
|
|
@@ -5017,7 +5124,7 @@ function useCanvasInteractions(input) {
|
|
|
5017
5124
|
if (openEquationEditorForElement(el)) {
|
|
5018
5125
|
return;
|
|
5019
5126
|
}
|
|
5020
|
-
if (
|
|
5127
|
+
if (chunkYDEEINER_js.hasTextProperties(el) && chunkYDEEINER_js.canInteractWithElement(el, "textEdit")) {
|
|
5021
5128
|
setInlineEditingElementId(elementId);
|
|
5022
5129
|
setInlineEditingText(el.text ?? "");
|
|
5023
5130
|
}
|
|
@@ -5040,7 +5147,7 @@ function useCanvasInteractions(input) {
|
|
|
5040
5147
|
justSelectedRef.current = false;
|
|
5041
5148
|
}
|
|
5042
5149
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
5043
|
-
const movableIds =
|
|
5150
|
+
const movableIds = chunkYDEEINER_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
5044
5151
|
if (movableIds.length === 0) {
|
|
5045
5152
|
return;
|
|
5046
5153
|
}
|
|
@@ -5110,7 +5217,7 @@ function useCanvasInteractions(input) {
|
|
|
5110
5217
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5111
5218
|
e.stopPropagation();
|
|
5112
5219
|
const el = elementLookup.get(elementId);
|
|
5113
|
-
if (!el || !
|
|
5220
|
+
if (!el || !chunkYDEEINER_js.canInteractWithElement(el, "resize")) {
|
|
5114
5221
|
return;
|
|
5115
5222
|
}
|
|
5116
5223
|
resizeStateRef.current = {
|
|
@@ -5132,7 +5239,7 @@ function useCanvasInteractions(input) {
|
|
|
5132
5239
|
};
|
|
5133
5240
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5134
5241
|
const el = elementLookup.get(elementId);
|
|
5135
|
-
if (!el || !
|
|
5242
|
+
if (!el || !chunkYDEEINER_js.canInteractWithElement(el, "rotate")) {
|
|
5136
5243
|
return;
|
|
5137
5244
|
}
|
|
5138
5245
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5152,10 +5259,10 @@ function useCanvasInteractions(input) {
|
|
|
5152
5259
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5153
5260
|
e.stopPropagation();
|
|
5154
5261
|
const el = elementLookup.get(elementId);
|
|
5155
|
-
if (!el || !
|
|
5262
|
+
if (!el || !chunkYDEEINER_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5156
5263
|
return;
|
|
5157
5264
|
}
|
|
5158
|
-
shapeAdjustmentDragStateRef.current =
|
|
5265
|
+
shapeAdjustmentDragStateRef.current = chunkYDEEINER_js.beginShapeAdjustment(
|
|
5159
5266
|
el,
|
|
5160
5267
|
descriptor,
|
|
5161
5268
|
e.clientX,
|
|
@@ -5202,7 +5309,7 @@ function createFileHandlers(deps) {
|
|
|
5202
5309
|
h = Math.round(h * scale);
|
|
5203
5310
|
}
|
|
5204
5311
|
addElement({
|
|
5205
|
-
id:
|
|
5312
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5206
5313
|
type: "image",
|
|
5207
5314
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5208
5315
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5213,7 +5320,7 @@ function createFileHandlers(deps) {
|
|
|
5213
5320
|
};
|
|
5214
5321
|
img.onerror = () => {
|
|
5215
5322
|
addElement({
|
|
5216
|
-
id:
|
|
5323
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5217
5324
|
type: "image",
|
|
5218
5325
|
x: 100,
|
|
5219
5326
|
y: 100,
|
|
@@ -5232,14 +5339,14 @@ function createFileHandlers(deps) {
|
|
|
5232
5339
|
return;
|
|
5233
5340
|
}
|
|
5234
5341
|
e.target.value = "";
|
|
5235
|
-
const mediaType =
|
|
5342
|
+
const mediaType = chunkYDEEINER_js.classifyMediaType(file.type);
|
|
5236
5343
|
if (!mediaType) {
|
|
5237
5344
|
return;
|
|
5238
5345
|
}
|
|
5239
5346
|
const elFilePath = file.path;
|
|
5240
5347
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5241
5348
|
addElement({
|
|
5242
|
-
id:
|
|
5349
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5243
5350
|
type: "media",
|
|
5244
5351
|
mediaType,
|
|
5245
5352
|
mediaMimeType: file.type || void 0,
|
|
@@ -5414,13 +5521,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5414
5521
|
return;
|
|
5415
5522
|
}
|
|
5416
5523
|
addElement({
|
|
5417
|
-
id:
|
|
5524
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5418
5525
|
type: "smartArt",
|
|
5419
5526
|
x: 100,
|
|
5420
5527
|
y: 120,
|
|
5421
5528
|
width: 600,
|
|
5422
5529
|
height: 340,
|
|
5423
|
-
smartArtData:
|
|
5530
|
+
smartArtData: chunkYDEEINER_js.buildSmartArtPresetData(
|
|
5424
5531
|
layout,
|
|
5425
5532
|
defaultItems,
|
|
5426
5533
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5432,7 +5539,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5432
5539
|
return;
|
|
5433
5540
|
}
|
|
5434
5541
|
addElement({
|
|
5435
|
-
id:
|
|
5542
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5436
5543
|
type: "shape",
|
|
5437
5544
|
x: 120,
|
|
5438
5545
|
y: 200,
|
|
@@ -5470,7 +5577,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5470
5577
|
return;
|
|
5471
5578
|
}
|
|
5472
5579
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5473
|
-
if (resolved.url && !
|
|
5580
|
+
if (resolved.url && !chunkYDEEINER_js.isUrlSafe(resolved.url)) {
|
|
5474
5581
|
return;
|
|
5475
5582
|
}
|
|
5476
5583
|
const actionClick = {
|
|
@@ -5494,7 +5601,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5494
5601
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5495
5602
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5496
5603
|
addElement({
|
|
5497
|
-
id:
|
|
5604
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5498
5605
|
type: "shape",
|
|
5499
5606
|
x: 120,
|
|
5500
5607
|
y: 200,
|
|
@@ -5516,11 +5623,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5516
5623
|
if (!activeSlide) {
|
|
5517
5624
|
return;
|
|
5518
5625
|
}
|
|
5519
|
-
const preset =
|
|
5626
|
+
const preset = chunkYDEEINER_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5520
5627
|
if (!preset) {
|
|
5521
5628
|
return;
|
|
5522
5629
|
}
|
|
5523
|
-
const defaultPptxAction =
|
|
5630
|
+
const defaultPptxAction = chunkYDEEINER_js.elementActionToPptxAction({
|
|
5524
5631
|
trigger: "click",
|
|
5525
5632
|
type: preset.defaultAction
|
|
5526
5633
|
});
|
|
@@ -5529,7 +5636,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5529
5636
|
defaultPptxAction.highlightClick = true;
|
|
5530
5637
|
}
|
|
5531
5638
|
addElement({
|
|
5532
|
-
id:
|
|
5639
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5533
5640
|
type: "shape",
|
|
5534
5641
|
x: 150,
|
|
5535
5642
|
y: 150,
|
|
@@ -5596,14 +5703,14 @@ function useInsertElements(input) {
|
|
|
5596
5703
|
return;
|
|
5597
5704
|
}
|
|
5598
5705
|
addElement({
|
|
5599
|
-
id:
|
|
5706
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5600
5707
|
type: "text",
|
|
5601
5708
|
x: 100,
|
|
5602
5709
|
y: 100,
|
|
5603
5710
|
width: 300,
|
|
5604
5711
|
height: 60,
|
|
5605
5712
|
text: "",
|
|
5606
|
-
textStyle: { fontSize:
|
|
5713
|
+
textStyle: { fontSize: chunkT2QG2HD5_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5607
5714
|
});
|
|
5608
5715
|
};
|
|
5609
5716
|
const handleAddShape = () => {
|
|
@@ -5611,7 +5718,7 @@ function useInsertElements(input) {
|
|
|
5611
5718
|
return;
|
|
5612
5719
|
}
|
|
5613
5720
|
addElement({
|
|
5614
|
-
id:
|
|
5721
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5615
5722
|
type: "shape",
|
|
5616
5723
|
x: 150,
|
|
5617
5724
|
y: 150,
|
|
@@ -5630,15 +5737,15 @@ function useInsertElements(input) {
|
|
|
5630
5737
|
return;
|
|
5631
5738
|
}
|
|
5632
5739
|
addElement({
|
|
5633
|
-
...
|
|
5634
|
-
id:
|
|
5740
|
+
...chunkYDEEINER_js.newTableElement(chunkT2QG2HD5_js.DEFAULT_TABLE_ROWS, chunkT2QG2HD5_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5741
|
+
id: chunkYDEEINER_js.generateElementId()
|
|
5635
5742
|
});
|
|
5636
5743
|
};
|
|
5637
5744
|
const handleAddChart = (chartKind) => {
|
|
5638
5745
|
if (!activeSlide) {
|
|
5639
5746
|
return;
|
|
5640
5747
|
}
|
|
5641
|
-
addElement(
|
|
5748
|
+
addElement(chunkYDEEINER_js.createDefaultChartElement(chartKind));
|
|
5642
5749
|
};
|
|
5643
5750
|
const structured = createStructuredElementHandlers({
|
|
5644
5751
|
activeSlide,
|
|
@@ -5708,7 +5815,7 @@ function useClipboardHandlers(input) {
|
|
|
5708
5815
|
if (!selectedElement) {
|
|
5709
5816
|
return;
|
|
5710
5817
|
}
|
|
5711
|
-
setClipboardPayload(
|
|
5818
|
+
setClipboardPayload(chunkYDEEINER_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5712
5819
|
};
|
|
5713
5820
|
const handleDelete = () => {
|
|
5714
5821
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5725,7 +5832,7 @@ function useClipboardHandlers(input) {
|
|
|
5725
5832
|
handleDelete();
|
|
5726
5833
|
};
|
|
5727
5834
|
const insertClone = (source) => {
|
|
5728
|
-
const clone =
|
|
5835
|
+
const clone = chunkYDEEINER_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5729
5836
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5730
5837
|
ops.applySelection(clone.id);
|
|
5731
5838
|
history.markDirty();
|
|
@@ -5760,7 +5867,7 @@ function resolveShapePath(el) {
|
|
|
5760
5867
|
return el.pathData;
|
|
5761
5868
|
}
|
|
5762
5869
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5763
|
-
const clipPath =
|
|
5870
|
+
const clipPath = chunkYDEEINER_js.getPresetShapeClipPath(el.shapeType);
|
|
5764
5871
|
if (clipPath) {
|
|
5765
5872
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5766
5873
|
if (svgPath) {
|
|
@@ -5811,7 +5918,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5811
5918
|
return parts.join(" ");
|
|
5812
5919
|
}
|
|
5813
5920
|
function transformPathToGlobal(pathData, el) {
|
|
5814
|
-
const polys =
|
|
5921
|
+
const polys = chunkYDEEINER_js.svgPathToPolygons(pathData);
|
|
5815
5922
|
if (polys.length === 0) {
|
|
5816
5923
|
return pathData;
|
|
5817
5924
|
}
|
|
@@ -5831,10 +5938,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5831
5938
|
y: pt.y * scaleY + el.y
|
|
5832
5939
|
}))
|
|
5833
5940
|
);
|
|
5834
|
-
return
|
|
5941
|
+
return chunkYDEEINER_js.polygonsToSvgPath(transformed);
|
|
5835
5942
|
}
|
|
5836
5943
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5837
|
-
const polys =
|
|
5944
|
+
const polys = chunkYDEEINER_js.svgPathToPolygons(pathData);
|
|
5838
5945
|
if (polys.length === 0) {
|
|
5839
5946
|
return pathData;
|
|
5840
5947
|
}
|
|
@@ -5844,10 +5951,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5844
5951
|
y: pt.y - y
|
|
5845
5952
|
}))
|
|
5846
5953
|
);
|
|
5847
|
-
return
|
|
5954
|
+
return chunkYDEEINER_js.polygonsToSvgPath(transformed);
|
|
5848
5955
|
}
|
|
5849
5956
|
function pathBounds(pathData) {
|
|
5850
|
-
const polys =
|
|
5957
|
+
const polys = chunkYDEEINER_js.svgPathToPolygons(pathData);
|
|
5851
5958
|
let minX = Infinity;
|
|
5852
5959
|
let minY = Infinity;
|
|
5853
5960
|
let maxX = -Infinity;
|
|
@@ -5906,7 +6013,7 @@ function useMergeShapesHandler(input) {
|
|
|
5906
6013
|
let allFragments = [];
|
|
5907
6014
|
let remaining = globalPaths[0];
|
|
5908
6015
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5909
|
-
const frags =
|
|
6016
|
+
const frags = chunkYDEEINER_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5910
6017
|
if (Array.isArray(frags)) {
|
|
5911
6018
|
allFragments = frags;
|
|
5912
6019
|
}
|
|
@@ -5935,7 +6042,7 @@ function useMergeShapesHandler(input) {
|
|
|
5935
6042
|
bounds.height
|
|
5936
6043
|
);
|
|
5937
6044
|
const newEl = {
|
|
5938
|
-
id:
|
|
6045
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5939
6046
|
type: "shape",
|
|
5940
6047
|
x: bounds.x,
|
|
5941
6048
|
y: bounds.y,
|
|
@@ -5973,7 +6080,7 @@ function useMergeShapesHandler(input) {
|
|
|
5973
6080
|
} else {
|
|
5974
6081
|
let resultPath = globalPaths[0];
|
|
5975
6082
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5976
|
-
const result =
|
|
6083
|
+
const result = chunkYDEEINER_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5977
6084
|
if (typeof result === "string") {
|
|
5978
6085
|
resultPath = result;
|
|
5979
6086
|
}
|
|
@@ -5994,7 +6101,7 @@ function useMergeShapesHandler(input) {
|
|
|
5994
6101
|
);
|
|
5995
6102
|
const primary = targets[0];
|
|
5996
6103
|
const newEl = {
|
|
5997
|
-
id:
|
|
6104
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5998
6105
|
type: "shape",
|
|
5999
6106
|
x: bounds.x,
|
|
6000
6107
|
y: bounds.y,
|
|
@@ -6057,7 +6164,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6057
6164
|
if (ids.length < 2 || !activeSlide) {
|
|
6058
6165
|
return;
|
|
6059
6166
|
}
|
|
6060
|
-
const { elements, groupId } =
|
|
6167
|
+
const { elements, groupId } = chunkYDEEINER_js.groupElements(ops.activeElements, ids, chunkYDEEINER_js.generateElementId());
|
|
6061
6168
|
if (groupId === null) {
|
|
6062
6169
|
return;
|
|
6063
6170
|
}
|
|
@@ -6070,11 +6177,11 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6070
6177
|
return;
|
|
6071
6178
|
}
|
|
6072
6179
|
const group = selectedElement;
|
|
6073
|
-
const intoTemplate =
|
|
6180
|
+
const intoTemplate = chunkYDEEINER_js.isTemplateElementId(group.id);
|
|
6074
6181
|
const childIds = group.children.map(
|
|
6075
|
-
(child) => intoTemplate ?
|
|
6182
|
+
(child) => intoTemplate ? chunkYDEEINER_js.makeCloneId(true, child.id || group.id) : child.id || chunkYDEEINER_js.generateElementId()
|
|
6076
6183
|
);
|
|
6077
|
-
const { elements, childIds: usedIds } =
|
|
6184
|
+
const { elements, childIds: usedIds } = chunkYDEEINER_js.ungroupElements(
|
|
6078
6185
|
ops.activeElements,
|
|
6079
6186
|
group.id,
|
|
6080
6187
|
childIds,
|
|
@@ -6103,7 +6210,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6103
6210
|
if (!edge) {
|
|
6104
6211
|
return;
|
|
6105
6212
|
}
|
|
6106
|
-
const positions =
|
|
6213
|
+
const positions = chunkYDEEINER_js.alignElements(selectedElements, edge);
|
|
6107
6214
|
for (const [id, pos] of positions) {
|
|
6108
6215
|
const el = elementLookup.get(id);
|
|
6109
6216
|
if (!el) {
|
|
@@ -6121,7 +6228,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6121
6228
|
if (!distAxis) {
|
|
6122
6229
|
return;
|
|
6123
6230
|
}
|
|
6124
|
-
const positions =
|
|
6231
|
+
const positions = chunkYDEEINER_js.distributeElements(selectedElements, distAxis);
|
|
6125
6232
|
for (const [id, pos] of positions) {
|
|
6126
6233
|
const el = elementLookup.get(id);
|
|
6127
6234
|
if (!el) {
|
|
@@ -6138,7 +6245,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6138
6245
|
}
|
|
6139
6246
|
const id = selectedElement.id;
|
|
6140
6247
|
ops.updateActiveElements(
|
|
6141
|
-
(els) => direction === "forward" ?
|
|
6248
|
+
(els) => direction === "forward" ? chunkYDEEINER_js.bringForward(els, id) : direction === "backward" ? chunkYDEEINER_js.sendBackward(els, id) : els
|
|
6142
6249
|
);
|
|
6143
6250
|
history.markDirty();
|
|
6144
6251
|
};
|
|
@@ -6148,7 +6255,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6148
6255
|
}
|
|
6149
6256
|
const id = selectedElement.id;
|
|
6150
6257
|
ops.updateActiveElements(
|
|
6151
|
-
(els) => direction === "front" ?
|
|
6258
|
+
(els) => direction === "front" ? chunkYDEEINER_js.bringToFront(els, id) : chunkYDEEINER_js.sendToBack(els, id)
|
|
6152
6259
|
);
|
|
6153
6260
|
history.markDirty();
|
|
6154
6261
|
};
|
|
@@ -6279,7 +6386,7 @@ function useSlideManagement(input) {
|
|
|
6279
6386
|
theme
|
|
6280
6387
|
} = input;
|
|
6281
6388
|
const handleAddSlide = () => {
|
|
6282
|
-
const newSlide =
|
|
6389
|
+
const newSlide = chunkYDEEINER_js.createBlankSlide(slides.length + 1);
|
|
6283
6390
|
ops.updateSlides((prev) => {
|
|
6284
6391
|
const next = [...prev];
|
|
6285
6392
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6342,7 +6449,7 @@ function useSlideManagement(input) {
|
|
|
6342
6449
|
}
|
|
6343
6450
|
const clone = {
|
|
6344
6451
|
...src,
|
|
6345
|
-
id:
|
|
6452
|
+
id: chunkYDEEINER_js.makeSlideId(),
|
|
6346
6453
|
elements: src.elements.map((el) => ({
|
|
6347
6454
|
...el,
|
|
6348
6455
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6374,7 +6481,7 @@ function useSlideManagement(input) {
|
|
|
6374
6481
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6375
6482
|
const insertAt = activeSlideIndex + 1;
|
|
6376
6483
|
const draft = {
|
|
6377
|
-
...
|
|
6484
|
+
...chunkYDEEINER_js.createBlankSlide(slides.length + 1),
|
|
6378
6485
|
layoutPath,
|
|
6379
6486
|
...layoutName ? { layoutName } : {}
|
|
6380
6487
|
};
|
|
@@ -6407,9 +6514,9 @@ function useSlideManagement(input) {
|
|
|
6407
6514
|
};
|
|
6408
6515
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6409
6516
|
const insertAt = activeSlideIndex + 1;
|
|
6410
|
-
const draft =
|
|
6517
|
+
const draft = chunkYDEEINER_js.buildSlideTemplateSlide(templateId, chunkYDEEINER_js.makeSlideId(), slides.length + 1, {
|
|
6411
6518
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6412
|
-
scheme:
|
|
6519
|
+
scheme: chunkYDEEINER_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6413
6520
|
});
|
|
6414
6521
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6415
6522
|
setActiveSlideIndex(insertAt);
|
|
@@ -6446,7 +6553,7 @@ function createTableMergeHandlers(input) {
|
|
|
6446
6553
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6447
6554
|
return;
|
|
6448
6555
|
}
|
|
6449
|
-
const newTableData =
|
|
6556
|
+
const newTableData = chunkYDEEINER_js.mergeCells(
|
|
6450
6557
|
[
|
|
6451
6558
|
{ row: rowIndex, col: columnIndex },
|
|
6452
6559
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6454,7 +6561,7 @@ function createTableMergeHandlers(input) {
|
|
|
6454
6561
|
td
|
|
6455
6562
|
);
|
|
6456
6563
|
const updates = { tableData: newTableData };
|
|
6457
|
-
const newRawXml =
|
|
6564
|
+
const newRawXml = chunkYDEEINER_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6458
6565
|
if (newRawXml) {
|
|
6459
6566
|
updates.rawXml = newRawXml;
|
|
6460
6567
|
}
|
|
@@ -6480,7 +6587,7 @@ function createTableMergeHandlers(input) {
|
|
|
6480
6587
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6481
6588
|
return;
|
|
6482
6589
|
}
|
|
6483
|
-
const newTableData =
|
|
6590
|
+
const newTableData = chunkYDEEINER_js.mergeCells(
|
|
6484
6591
|
[
|
|
6485
6592
|
{ row: rowIndex, col: columnIndex },
|
|
6486
6593
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6488,7 +6595,7 @@ function createTableMergeHandlers(input) {
|
|
|
6488
6595
|
td
|
|
6489
6596
|
);
|
|
6490
6597
|
const updates = { tableData: newTableData };
|
|
6491
|
-
const newRawXml =
|
|
6598
|
+
const newRawXml = chunkYDEEINER_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6492
6599
|
if (newRawXml) {
|
|
6493
6600
|
updates.rawXml = newRawXml;
|
|
6494
6601
|
}
|
|
@@ -6503,9 +6610,9 @@ function createTableMergeHandlers(input) {
|
|
|
6503
6610
|
return;
|
|
6504
6611
|
}
|
|
6505
6612
|
const td = selectedElement.tableData;
|
|
6506
|
-
const newTableData =
|
|
6613
|
+
const newTableData = chunkYDEEINER_js.mergeCells(ts.selectedCells, td);
|
|
6507
6614
|
const updates = { tableData: newTableData };
|
|
6508
|
-
const newRawXml =
|
|
6615
|
+
const newRawXml = chunkYDEEINER_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6509
6616
|
if (newRawXml) {
|
|
6510
6617
|
updates.rawXml = newRawXml;
|
|
6511
6618
|
}
|
|
@@ -6522,9 +6629,9 @@ function createTableMergeHandlers(input) {
|
|
|
6522
6629
|
}
|
|
6523
6630
|
const { rowIndex, columnIndex } = ts;
|
|
6524
6631
|
const td = selectedElement.tableData;
|
|
6525
|
-
const newTableData =
|
|
6632
|
+
const newTableData = chunkYDEEINER_js.splitCell(rowIndex, columnIndex, td);
|
|
6526
6633
|
const updates = { tableData: newTableData };
|
|
6527
|
-
const newRawXml =
|
|
6634
|
+
const newRawXml = chunkYDEEINER_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6528
6635
|
if (newRawXml) {
|
|
6529
6636
|
updates.rawXml = newRawXml;
|
|
6530
6637
|
}
|
|
@@ -6558,10 +6665,10 @@ function createTableStructHandlers(input) {
|
|
|
6558
6665
|
const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
|
|
6559
6666
|
const updates = {};
|
|
6560
6667
|
if (el.tableData) {
|
|
6561
|
-
updates.tableData =
|
|
6668
|
+
updates.tableData = chunkYDEEINER_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6562
6669
|
}
|
|
6563
6670
|
if (el.rawXml) {
|
|
6564
|
-
const newRawXml =
|
|
6671
|
+
const newRawXml = chunkYDEEINER_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6565
6672
|
if (newRawXml) {
|
|
6566
6673
|
updates.rawXml = newRawXml;
|
|
6567
6674
|
}
|
|
@@ -6585,7 +6692,7 @@ function createTableStructHandlers(input) {
|
|
|
6585
6692
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6586
6693
|
const updates = {};
|
|
6587
6694
|
if (selectedElement.rawXml) {
|
|
6588
|
-
const newRawXml =
|
|
6695
|
+
const newRawXml = chunkYDEEINER_js.updateCellTextStyleInRawXml(
|
|
6589
6696
|
selectedElement,
|
|
6590
6697
|
rowIndex,
|
|
6591
6698
|
colIndex,
|
|
@@ -6649,9 +6756,9 @@ function createTableStructHandlers(input) {
|
|
|
6649
6756
|
return;
|
|
6650
6757
|
}
|
|
6651
6758
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6652
|
-
const newTableData =
|
|
6759
|
+
const newTableData = chunkYDEEINER_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6653
6760
|
const updates = { tableData: newTableData };
|
|
6654
|
-
const newRawXml =
|
|
6761
|
+
const newRawXml = chunkYDEEINER_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6655
6762
|
if (newRawXml) {
|
|
6656
6763
|
updates.rawXml = newRawXml;
|
|
6657
6764
|
}
|
|
@@ -6664,12 +6771,12 @@ function createTableStructHandlers(input) {
|
|
|
6664
6771
|
}
|
|
6665
6772
|
const td = selectedElement.tableData;
|
|
6666
6773
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6667
|
-
const newTableData =
|
|
6774
|
+
const newTableData = chunkYDEEINER_js.deleteTableRow(td, rowIdx);
|
|
6668
6775
|
if (newTableData === td) {
|
|
6669
6776
|
return;
|
|
6670
6777
|
}
|
|
6671
6778
|
const updates = { tableData: newTableData };
|
|
6672
|
-
const newRawXml =
|
|
6779
|
+
const newRawXml = chunkYDEEINER_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6673
6780
|
if (newRawXml) {
|
|
6674
6781
|
updates.rawXml = newRawXml;
|
|
6675
6782
|
}
|
|
@@ -6681,9 +6788,9 @@ function createTableStructHandlers(input) {
|
|
|
6681
6788
|
return;
|
|
6682
6789
|
}
|
|
6683
6790
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6684
|
-
const newTableData =
|
|
6791
|
+
const newTableData = chunkYDEEINER_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6685
6792
|
const updates = { tableData: newTableData };
|
|
6686
|
-
const newRawXml =
|
|
6793
|
+
const newRawXml = chunkYDEEINER_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6687
6794
|
if (newRawXml) {
|
|
6688
6795
|
updates.rawXml = newRawXml;
|
|
6689
6796
|
}
|
|
@@ -6696,12 +6803,12 @@ function createTableStructHandlers(input) {
|
|
|
6696
6803
|
}
|
|
6697
6804
|
const td = selectedElement.tableData;
|
|
6698
6805
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6699
|
-
const newTableData =
|
|
6806
|
+
const newTableData = chunkYDEEINER_js.deleteTableColumn(td, colIdx);
|
|
6700
6807
|
if (newTableData === td) {
|
|
6701
6808
|
return;
|
|
6702
6809
|
}
|
|
6703
6810
|
const updates = { tableData: newTableData };
|
|
6704
|
-
const newRawXml =
|
|
6811
|
+
const newRawXml = chunkYDEEINER_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6705
6812
|
if (newRawXml) {
|
|
6706
6813
|
updates.rawXml = newRawXml;
|
|
6707
6814
|
}
|
|
@@ -6737,8 +6844,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6737
6844
|
return html2canvasPro(element, {
|
|
6738
6845
|
...options,
|
|
6739
6846
|
onclone: async (doc, clonedEl) => {
|
|
6740
|
-
await
|
|
6741
|
-
|
|
6847
|
+
await chunkYDEEINER_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6848
|
+
chunkYDEEINER_js.preprocessCssForCapture(clonedEl);
|
|
6742
6849
|
if (typeof userOnClone === "function") {
|
|
6743
6850
|
userOnClone(doc, clonedEl);
|
|
6744
6851
|
}
|
|
@@ -6776,13 +6883,13 @@ function useExportSaveAs(input) {
|
|
|
6776
6883
|
if (!handler) {
|
|
6777
6884
|
return;
|
|
6778
6885
|
}
|
|
6779
|
-
const downloadName =
|
|
6886
|
+
const downloadName = chunkYDEEINER_js.savedPresentationFileName(filePath, format);
|
|
6780
6887
|
try {
|
|
6781
6888
|
const data = await buildSaveAsData(handler, format);
|
|
6782
6889
|
const blob = new Blob([data], {
|
|
6783
6890
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6784
6891
|
});
|
|
6785
|
-
|
|
6892
|
+
chunkYDEEINER_js.downloadBlob(blob, downloadName);
|
|
6786
6893
|
} catch (err) {
|
|
6787
6894
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
6788
6895
|
}
|
|
@@ -6795,18 +6902,18 @@ function useExportSaveAs(input) {
|
|
|
6795
6902
|
const pptxGuides = guides.map((g) => ({
|
|
6796
6903
|
id: g.id,
|
|
6797
6904
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
6798
|
-
positionEmu:
|
|
6905
|
+
positionEmu: chunkYDEEINER_js.guidePxToEmu(g.position)
|
|
6799
6906
|
}));
|
|
6800
6907
|
return {
|
|
6801
6908
|
...slide,
|
|
6802
6909
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
6803
6910
|
};
|
|
6804
6911
|
});
|
|
6805
|
-
const slidesToSave =
|
|
6912
|
+
const slidesToSave = chunkYDEEINER_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
6806
6913
|
const saveOptions = {
|
|
6807
6914
|
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
6808
6915
|
// a preset picked in the inspector reached one save path and not the other.
|
|
6809
|
-
slideSize:
|
|
6916
|
+
slideSize: chunkYDEEINER_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
6810
6917
|
headerFooter,
|
|
6811
6918
|
presentationProperties,
|
|
6812
6919
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -6820,13 +6927,13 @@ function useExportSaveAs(input) {
|
|
|
6820
6927
|
handoutMaster,
|
|
6821
6928
|
outputFormat: format
|
|
6822
6929
|
};
|
|
6823
|
-
return
|
|
6930
|
+
return chunkYDEEINER_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
6824
6931
|
};
|
|
6825
6932
|
const handleExportJson = () => {
|
|
6826
6933
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
6827
|
-
const slideSize =
|
|
6934
|
+
const slideSize = chunkYDEEINER_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
6828
6935
|
const data = {
|
|
6829
|
-
slides:
|
|
6936
|
+
slides: chunkYDEEINER_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
6830
6937
|
width: canvasSize.width,
|
|
6831
6938
|
height: canvasSize.height,
|
|
6832
6939
|
widthEmu: slideSize.widthEmu,
|
|
@@ -6845,7 +6952,7 @@ function useExportSaveAs(input) {
|
|
|
6845
6952
|
handoutMaster
|
|
6846
6953
|
};
|
|
6847
6954
|
try {
|
|
6848
|
-
|
|
6955
|
+
chunkYDEEINER_js.exportDeckJson(data, sourceName);
|
|
6849
6956
|
} catch (err) {
|
|
6850
6957
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
6851
6958
|
}
|
|
@@ -6932,7 +7039,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6932
7039
|
}
|
|
6933
7040
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6934
7041
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6935
|
-
|
|
7042
|
+
chunkYDEEINER_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6936
7043
|
}
|
|
6937
7044
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6938
7045
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6954,15 +7061,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6954
7061
|
continue;
|
|
6955
7062
|
}
|
|
6956
7063
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6957
|
-
images.push(
|
|
7064
|
+
images.push(chunkYDEEINER_js.canvasToJpegData(canvas));
|
|
6958
7065
|
}
|
|
6959
7066
|
onProgress?.(totalSlides, totalSlides);
|
|
6960
7067
|
setActiveSlide(currentSlideIndex);
|
|
6961
7068
|
if (images.length === 0) {
|
|
6962
7069
|
throw new Error(chunkSWRY3SI5_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6963
7070
|
}
|
|
6964
|
-
const pdfBlobUrl =
|
|
6965
|
-
|
|
7071
|
+
const pdfBlobUrl = chunkT2QG2HD5_js.buildPdfFromImageData(images);
|
|
7072
|
+
chunkYDEEINER_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6966
7073
|
}
|
|
6967
7074
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6968
7075
|
const { scale = 2, onProgress } = options;
|
|
@@ -7010,8 +7117,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7010
7117
|
if (pages.length === 0) {
|
|
7011
7118
|
throw new Error(chunkSWRY3SI5_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7012
7119
|
}
|
|
7013
|
-
const pdfDataUrl =
|
|
7014
|
-
|
|
7120
|
+
const pdfDataUrl = chunkT2QG2HD5_js.buildNotesPdf(pages);
|
|
7121
|
+
chunkYDEEINER_js.downloadDataUrl(pdfDataUrl, filename);
|
|
7015
7122
|
}
|
|
7016
7123
|
|
|
7017
7124
|
// src/viewer/utils/export-video.ts
|
|
@@ -7055,7 +7162,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7055
7162
|
const fps = 30;
|
|
7056
7163
|
const stream = recordingCanvas.captureStream(fps);
|
|
7057
7164
|
const recorder = new MediaRecorder(stream, {
|
|
7058
|
-
mimeType:
|
|
7165
|
+
mimeType: chunkYDEEINER_js.pickSupportedMimeType([...chunkYDEEINER_js.WEBM_MIME_CANDIDATES]),
|
|
7059
7166
|
videoBitsPerSecond: 5e6
|
|
7060
7167
|
});
|
|
7061
7168
|
const chunks = [];
|
|
@@ -7078,8 +7185,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7078
7185
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
7079
7186
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
7080
7187
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
7081
|
-
const frameInterval =
|
|
7082
|
-
const framesNeeded =
|
|
7188
|
+
const frameInterval = chunkYDEEINER_js.fpsToFrameIntervalMs(fps);
|
|
7189
|
+
const framesNeeded = chunkYDEEINER_js.segmentFrameCount(duration, fps);
|
|
7083
7190
|
for (let f = 0; f < framesNeeded; f++) {
|
|
7084
7191
|
if (signal?.aborted) {
|
|
7085
7192
|
recorder.stop();
|
|
@@ -7128,7 +7235,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7128
7235
|
if (frames.length === 0) {
|
|
7129
7236
|
throw new Error(chunkSWRY3SI5_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
7130
7237
|
}
|
|
7131
|
-
const gifBytes =
|
|
7238
|
+
const gifBytes = chunkYDEEINER_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
7132
7239
|
onProgress?.(totalSlides, totalSlides);
|
|
7133
7240
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
7134
7241
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -7182,7 +7289,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7182
7289
|
continue;
|
|
7183
7290
|
}
|
|
7184
7291
|
onProgress?.(processedCount, data.slides.length);
|
|
7185
|
-
let svg =
|
|
7292
|
+
let svg = chunkYDEEINER_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7186
7293
|
if (embedFonts && fontFaces?.length) {
|
|
7187
7294
|
svg = injectFontFaces(svg, fontFaces);
|
|
7188
7295
|
}
|
|
@@ -7291,21 +7398,21 @@ function useExportHandlers(input) {
|
|
|
7291
7398
|
{
|
|
7292
7399
|
scale: imageExportScale,
|
|
7293
7400
|
onProgress: (current, total) => {
|
|
7294
|
-
setExportProgress(
|
|
7295
|
-
setExportStatusMessage(
|
|
7401
|
+
setExportProgress(chunkYDEEINER_js.slideProgressPercent(current, total));
|
|
7402
|
+
setExportStatusMessage(chunkYDEEINER_js.slideStatusLabel("Rendering", current, total));
|
|
7296
7403
|
},
|
|
7297
7404
|
signal: abortCtrl.signal
|
|
7298
7405
|
}
|
|
7299
7406
|
);
|
|
7300
|
-
setExportProgress(
|
|
7407
|
+
setExportProgress(chunkYDEEINER_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7301
7408
|
setExportStatusMessage("Building PDF...");
|
|
7302
7409
|
await new Promise((r) => {
|
|
7303
7410
|
setTimeout(r, 100);
|
|
7304
7411
|
});
|
|
7305
|
-
setExportProgress(
|
|
7412
|
+
setExportProgress(chunkYDEEINER_js.EXPORT_DONE_PERCENT);
|
|
7306
7413
|
setExportStatusMessage("Done!");
|
|
7307
7414
|
} catch (err) {
|
|
7308
|
-
if (!
|
|
7415
|
+
if (!chunkYDEEINER_js.isExportAbortError(err)) {
|
|
7309
7416
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7310
7417
|
}
|
|
7311
7418
|
} finally {
|
|
@@ -7335,21 +7442,21 @@ function useExportHandlers(input) {
|
|
|
7335
7442
|
{
|
|
7336
7443
|
scale: imageExportScale,
|
|
7337
7444
|
onProgress: (current, total) => {
|
|
7338
|
-
setExportProgress(
|
|
7339
|
-
setExportStatusMessage(
|
|
7445
|
+
setExportProgress(chunkYDEEINER_js.slideProgressPercent(current, total));
|
|
7446
|
+
setExportStatusMessage(chunkYDEEINER_js.slideStatusLabel("Rendering", current, total));
|
|
7340
7447
|
},
|
|
7341
7448
|
signal: abortCtrl.signal
|
|
7342
7449
|
}
|
|
7343
7450
|
);
|
|
7344
|
-
setExportProgress(
|
|
7451
|
+
setExportProgress(chunkYDEEINER_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7345
7452
|
setExportStatusMessage("Building PDF...");
|
|
7346
7453
|
await new Promise((r) => {
|
|
7347
7454
|
setTimeout(r, 100);
|
|
7348
7455
|
});
|
|
7349
|
-
setExportProgress(
|
|
7456
|
+
setExportProgress(chunkYDEEINER_js.EXPORT_DONE_PERCENT);
|
|
7350
7457
|
setExportStatusMessage("Done!");
|
|
7351
7458
|
} catch (err) {
|
|
7352
|
-
if (!
|
|
7459
|
+
if (!chunkYDEEINER_js.isExportAbortError(err)) {
|
|
7353
7460
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7354
7461
|
}
|
|
7355
7462
|
} finally {
|
|
@@ -7391,22 +7498,22 @@ function useExportHandlers(input) {
|
|
|
7391
7498
|
scale: 1,
|
|
7392
7499
|
slideDurationMs: 3e3,
|
|
7393
7500
|
onProgress: (current, total) => {
|
|
7394
|
-
setExportProgress(
|
|
7395
|
-
setExportStatusMessage(
|
|
7501
|
+
setExportProgress(chunkYDEEINER_js.slideProgressPercent(current, total, 45));
|
|
7502
|
+
setExportStatusMessage(chunkYDEEINER_js.slideStatusLabel("Capturing", current, total));
|
|
7396
7503
|
},
|
|
7397
7504
|
onRecordProgress: (current, total) => {
|
|
7398
|
-
setExportProgress(
|
|
7399
|
-
setExportStatusMessage(
|
|
7505
|
+
setExportProgress(chunkYDEEINER_js.recordProgressPercent(current, total));
|
|
7506
|
+
setExportStatusMessage(chunkYDEEINER_js.slideStatusLabel("Recording", current, total));
|
|
7400
7507
|
},
|
|
7401
7508
|
signal: abortCtrl.signal
|
|
7402
7509
|
}
|
|
7403
7510
|
);
|
|
7404
|
-
setExportProgress(
|
|
7511
|
+
setExportProgress(chunkYDEEINER_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7405
7512
|
setExportStatusMessage("Saving file...");
|
|
7406
|
-
|
|
7407
|
-
setExportProgress(
|
|
7513
|
+
chunkYDEEINER_js.downloadBlob(blob, "presentation.webm");
|
|
7514
|
+
setExportProgress(chunkYDEEINER_js.EXPORT_DONE_PERCENT);
|
|
7408
7515
|
} catch (err) {
|
|
7409
|
-
if (!
|
|
7516
|
+
if (!chunkYDEEINER_js.isExportAbortError(err)) {
|
|
7410
7517
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7411
7518
|
}
|
|
7412
7519
|
} finally {
|
|
@@ -7434,18 +7541,18 @@ function useExportHandlers(input) {
|
|
|
7434
7541
|
scale: 0.5,
|
|
7435
7542
|
slideDurationMs: 2e3,
|
|
7436
7543
|
onProgress: (current, total) => {
|
|
7437
|
-
setExportProgress(
|
|
7438
|
-
setExportStatusMessage(
|
|
7544
|
+
setExportProgress(chunkYDEEINER_js.slideProgressPercent(current, total));
|
|
7545
|
+
setExportStatusMessage(chunkYDEEINER_js.slideStatusLabel("Encoding", current, total));
|
|
7439
7546
|
},
|
|
7440
7547
|
signal: abortCtrl.signal
|
|
7441
7548
|
}
|
|
7442
7549
|
);
|
|
7443
|
-
setExportProgress(
|
|
7550
|
+
setExportProgress(chunkYDEEINER_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7444
7551
|
setExportStatusMessage("Saving file...");
|
|
7445
|
-
|
|
7446
|
-
setExportProgress(
|
|
7552
|
+
chunkYDEEINER_js.downloadBlob(blob, "presentation.gif");
|
|
7553
|
+
setExportProgress(chunkYDEEINER_js.EXPORT_DONE_PERCENT);
|
|
7447
7554
|
} catch (err) {
|
|
7448
|
-
if (!
|
|
7555
|
+
if (!chunkYDEEINER_js.isExportAbortError(err)) {
|
|
7449
7556
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7450
7557
|
}
|
|
7451
7558
|
} finally {
|
|
@@ -7478,7 +7585,7 @@ function useExportHandlers(input) {
|
|
|
7478
7585
|
exportStatusMessage
|
|
7479
7586
|
};
|
|
7480
7587
|
}
|
|
7481
|
-
var ViewerOptionsContext = react.createContext(
|
|
7588
|
+
var ViewerOptionsContext = react.createContext(chunkYDEEINER_js.DEFAULT_VIEWER_OPTIONS);
|
|
7482
7589
|
function useViewerOptionsContext() {
|
|
7483
7590
|
return react.useContext(ViewerOptionsContext);
|
|
7484
7591
|
}
|
|
@@ -7490,13 +7597,13 @@ function usePrintHandlers(input) {
|
|
|
7490
7597
|
const { t } = reactI18next.useTranslation();
|
|
7491
7598
|
const viewerOptions = useViewerOptionsContext();
|
|
7492
7599
|
const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
|
|
7493
|
-
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) *
|
|
7600
|
+
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunkYDEEINER_js.resolveImageResolutionScale(viewerOptions);
|
|
7494
7601
|
const handlePrint = () => {
|
|
7495
7602
|
setIsPrintDialogOpen(true);
|
|
7496
7603
|
};
|
|
7497
7604
|
const handlePrintSvg = async (settings) => {
|
|
7498
7605
|
setIsPrintDialogOpen(false);
|
|
7499
|
-
const printWindow =
|
|
7606
|
+
const printWindow = chunkYDEEINER_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7500
7607
|
if (!printWindow) {
|
|
7501
7608
|
console.warn(
|
|
7502
7609
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7506,9 +7613,9 @@ function usePrintHandlers(input) {
|
|
|
7506
7613
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7507
7614
|
return runRasterPrint(printWindow, settings);
|
|
7508
7615
|
}
|
|
7509
|
-
const colorFilter =
|
|
7510
|
-
const slideIndices =
|
|
7511
|
-
|
|
7616
|
+
const colorFilter = chunkYDEEINER_js.computeColorFilter(settings.colorMode);
|
|
7617
|
+
const slideIndices = chunkYDEEINER_js.filterHiddenSlideIndices(
|
|
7618
|
+
chunkYDEEINER_js.computeSlideIndices(
|
|
7512
7619
|
settings.slideRange,
|
|
7513
7620
|
activeSlideIndex,
|
|
7514
7621
|
slides.length,
|
|
@@ -7526,22 +7633,22 @@ function usePrintHandlers(input) {
|
|
|
7526
7633
|
printWindow.close();
|
|
7527
7634
|
return;
|
|
7528
7635
|
}
|
|
7529
|
-
const printDoc =
|
|
7636
|
+
const printDoc = chunkYDEEINER_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7530
7637
|
title: "Slides (Vector)",
|
|
7531
7638
|
orientation: settings.orientation,
|
|
7532
7639
|
colorFilter,
|
|
7533
7640
|
scaleToFit: settings.scaleToFit
|
|
7534
7641
|
});
|
|
7535
|
-
|
|
7642
|
+
chunkYDEEINER_js.finishPrintWindow(printWindow, printDoc);
|
|
7536
7643
|
} catch (err) {
|
|
7537
7644
|
console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
|
|
7538
7645
|
return runRasterPrint(printWindow, settings);
|
|
7539
7646
|
}
|
|
7540
7647
|
};
|
|
7541
7648
|
const runRasterPrint = async (printWindow, settings) => {
|
|
7542
|
-
const colorFilter =
|
|
7543
|
-
const slideIndices =
|
|
7544
|
-
|
|
7649
|
+
const colorFilter = chunkYDEEINER_js.computeColorFilter(settings.colorMode);
|
|
7650
|
+
const slideIndices = chunkYDEEINER_js.filterHiddenSlideIndices(
|
|
7651
|
+
chunkYDEEINER_js.computeSlideIndices(
|
|
7545
7652
|
settings.slideRange,
|
|
7546
7653
|
activeSlideIndex,
|
|
7547
7654
|
slides.length,
|
|
@@ -7552,11 +7659,11 @@ function usePrintHandlers(input) {
|
|
|
7552
7659
|
includeHiddenSlides
|
|
7553
7660
|
);
|
|
7554
7661
|
if (settings.printWhat === "outline") {
|
|
7555
|
-
|
|
7662
|
+
chunkYDEEINER_js.finishPrintWindow(
|
|
7556
7663
|
printWindow,
|
|
7557
|
-
|
|
7664
|
+
chunkYDEEINER_js.buildPrintHtmlDocument({
|
|
7558
7665
|
title: "Outline",
|
|
7559
|
-
bodyHtml: `<div class="outline-page">${
|
|
7666
|
+
bodyHtml: `<div class="outline-page">${chunkYDEEINER_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7560
7667
|
orientation: settings.orientation,
|
|
7561
7668
|
colorFilter,
|
|
7562
7669
|
frameSlides: settings.frameSlides,
|
|
@@ -7583,11 +7690,11 @@ function usePrintHandlers(input) {
|
|
|
7583
7690
|
}
|
|
7584
7691
|
const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
|
|
7585
7692
|
if (settings.printWhat === "slides") {
|
|
7586
|
-
|
|
7693
|
+
chunkYDEEINER_js.finishPrintWindow(
|
|
7587
7694
|
printWindow,
|
|
7588
|
-
|
|
7695
|
+
chunkYDEEINER_js.buildPrintHtmlDocument({
|
|
7589
7696
|
title: "Slides",
|
|
7590
|
-
bodyHtml:
|
|
7697
|
+
bodyHtml: chunkYDEEINER_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7591
7698
|
orientation: settings.orientation,
|
|
7592
7699
|
colorFilter,
|
|
7593
7700
|
frameSlides: settings.frameSlides,
|
|
@@ -7597,11 +7704,11 @@ function usePrintHandlers(input) {
|
|
|
7597
7704
|
return;
|
|
7598
7705
|
}
|
|
7599
7706
|
if (settings.printWhat === "notes") {
|
|
7600
|
-
|
|
7707
|
+
chunkYDEEINER_js.finishPrintWindow(
|
|
7601
7708
|
printWindow,
|
|
7602
|
-
|
|
7709
|
+
chunkYDEEINER_js.buildPrintHtmlDocument({
|
|
7603
7710
|
title: "Notes Pages",
|
|
7604
|
-
bodyHtml:
|
|
7711
|
+
bodyHtml: chunkYDEEINER_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7605
7712
|
orientation: "portrait",
|
|
7606
7713
|
colorFilter,
|
|
7607
7714
|
frameSlides: settings.frameSlides,
|
|
@@ -7612,11 +7719,11 @@ function usePrintHandlers(input) {
|
|
|
7612
7719
|
}
|
|
7613
7720
|
if (settings.printWhat === "handouts") {
|
|
7614
7721
|
const spp = settings.slidesPerPage;
|
|
7615
|
-
|
|
7722
|
+
chunkYDEEINER_js.finishPrintWindow(
|
|
7616
7723
|
printWindow,
|
|
7617
|
-
|
|
7724
|
+
chunkYDEEINER_js.buildPrintHtmlDocument({
|
|
7618
7725
|
title: `Handout ${spp} per page`,
|
|
7619
|
-
bodyHtml:
|
|
7726
|
+
bodyHtml: chunkYDEEINER_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7620
7727
|
orientation: "portrait",
|
|
7621
7728
|
colorFilter,
|
|
7622
7729
|
frameSlides: settings.frameSlides,
|
|
@@ -7630,7 +7737,7 @@ function usePrintHandlers(input) {
|
|
|
7630
7737
|
};
|
|
7631
7738
|
const handlePrintWithSettings = async (settings) => {
|
|
7632
7739
|
setIsPrintDialogOpen(false);
|
|
7633
|
-
const printWindow =
|
|
7740
|
+
const printWindow = chunkYDEEINER_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7634
7741
|
if (!printWindow) {
|
|
7635
7742
|
console.warn(
|
|
7636
7743
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7693,8 +7800,8 @@ function useThemeHandlers(input) {
|
|
|
7693
7800
|
return;
|
|
7694
7801
|
}
|
|
7695
7802
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7696
|
-
const previousMap = theme?.colorScheme ?
|
|
7697
|
-
setSlides((prev) =>
|
|
7803
|
+
const previousMap = theme?.colorScheme ? chunkYDEEINER_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7804
|
+
setSlides((prev) => chunkYDEEINER_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7698
7805
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7699
7806
|
bumpHistory();
|
|
7700
7807
|
history.markDirty();
|
|
@@ -7799,7 +7906,7 @@ function useThemeSwitching(input) {
|
|
|
7799
7906
|
}
|
|
7800
7907
|
try {
|
|
7801
7908
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7802
|
-
const newData =
|
|
7909
|
+
const newData = chunkYDEEINER_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7803
7910
|
onDataChange(newData);
|
|
7804
7911
|
onThemeChanged?.(preset);
|
|
7805
7912
|
} catch (error) {
|
|
@@ -7816,7 +7923,7 @@ function useThemeSwitching(input) {
|
|
|
7816
7923
|
}
|
|
7817
7924
|
try {
|
|
7818
7925
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7819
|
-
const newData =
|
|
7926
|
+
const newData = chunkYDEEINER_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7820
7927
|
onDataChange(newData);
|
|
7821
7928
|
} catch (error) {
|
|
7822
7929
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7828,12 +7935,12 @@ function useThemeSwitching(input) {
|
|
|
7828
7935
|
if (!data?.theme?.colorScheme) {
|
|
7829
7936
|
return void 0;
|
|
7830
7937
|
}
|
|
7831
|
-
return
|
|
7832
|
-
(p) =>
|
|
7938
|
+
return chunkYDEEINER_js.THEME_PRESETS.find(
|
|
7939
|
+
(p) => chunkYDEEINER_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7833
7940
|
);
|
|
7834
7941
|
}, [data?.theme?.colorScheme]);
|
|
7835
7942
|
return {
|
|
7836
|
-
presets:
|
|
7943
|
+
presets: chunkYDEEINER_js.THEME_PRESETS,
|
|
7837
7944
|
switchToPreset,
|
|
7838
7945
|
switchToCustom,
|
|
7839
7946
|
currentPreset
|
|
@@ -7908,7 +8015,7 @@ function usePropertyHandlers(input) {
|
|
|
7908
8015
|
}
|
|
7909
8016
|
try {
|
|
7910
8017
|
const ab = await file.arrayBuffer();
|
|
7911
|
-
const h = new
|
|
8018
|
+
const h = new chunkYDEEINER_js.PptxHandler();
|
|
7912
8019
|
const other = await h.load(ab);
|
|
7913
8020
|
if (!other) {
|
|
7914
8021
|
return;
|
|
@@ -7918,7 +8025,7 @@ function usePropertyHandlers(input) {
|
|
|
7918
8025
|
width: canvasSize.width,
|
|
7919
8026
|
height: canvasSize.height
|
|
7920
8027
|
};
|
|
7921
|
-
setCompareResult(
|
|
8028
|
+
setCompareResult(chunkYDEEINER_js.comparePresentation(cur, other));
|
|
7922
8029
|
setIsComparePanelOpen(true);
|
|
7923
8030
|
} catch (err) {
|
|
7924
8031
|
console.warn("Compare failed:", err);
|
|
@@ -7935,7 +8042,7 @@ function usePropertyHandlers(input) {
|
|
|
7935
8042
|
if (!diff || diff.status === "unchanged") {
|
|
7936
8043
|
return;
|
|
7937
8044
|
}
|
|
7938
|
-
setSlides((prev) =>
|
|
8045
|
+
setSlides((prev) => chunkYDEEINER_js.applyAcceptSlide(prev, diff));
|
|
7939
8046
|
setIsDirty(true);
|
|
7940
8047
|
},
|
|
7941
8048
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7946,10 +8053,10 @@ function usePropertyHandlers(input) {
|
|
|
7946
8053
|
if (!compareResult) {
|
|
7947
8054
|
return;
|
|
7948
8055
|
}
|
|
7949
|
-
setSlides((prev) =>
|
|
8056
|
+
setSlides((prev) => chunkYDEEINER_js.applyAcceptAllSlides(prev, compareResult));
|
|
7950
8057
|
setIsDirty(true);
|
|
7951
8058
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7952
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
8059
|
+
const usedFontFamilies = react.useMemo(() => chunkYDEEINER_js.collectUsedFonts(slides), [slides]);
|
|
7953
8060
|
return {
|
|
7954
8061
|
handleUpdateNotes,
|
|
7955
8062
|
handleUpdateSlide,
|
|
@@ -8104,7 +8211,7 @@ function useViewerDialogs(input) {
|
|
|
8104
8211
|
);
|
|
8105
8212
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8106
8213
|
const fontEmbedding = react.useMemo(
|
|
8107
|
-
() =>
|
|
8214
|
+
() => chunkYDEEINER_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8108
8215
|
[embeddedFontKey]
|
|
8109
8216
|
);
|
|
8110
8217
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8114,11 +8221,11 @@ function useViewerDialogs(input) {
|
|
|
8114
8221
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8115
8222
|
}
|
|
8116
8223
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8117
|
-
() => typeof window !== "undefined" ?
|
|
8224
|
+
() => typeof window !== "undefined" ? chunkYDEEINER_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8118
8225
|
);
|
|
8119
8226
|
react.useEffect(() => {
|
|
8120
8227
|
const handleWindow = () => setIsNarrowViewport(
|
|
8121
|
-
|
|
8228
|
+
chunkYDEEINER_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8122
8229
|
);
|
|
8123
8230
|
window.addEventListener("resize", handleWindow);
|
|
8124
8231
|
return () => window.removeEventListener("resize", handleWindow);
|
|
@@ -8271,15 +8378,15 @@ function useViewerDialogs(input) {
|
|
|
8271
8378
|
};
|
|
8272
8379
|
}
|
|
8273
8380
|
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8274
|
-
return
|
|
8381
|
+
return chunkYDEEINER_js.computeGridSpacingPx(documentGridSpacing, chunkT2QG2HD5_js.GRID_SIZE);
|
|
8275
8382
|
}
|
|
8276
8383
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8277
8384
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8278
|
-
return
|
|
8385
|
+
return chunkYDEEINER_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8279
8386
|
}
|
|
8280
8387
|
function computeSlideSectionGroups(slides, sections) {
|
|
8281
|
-
return
|
|
8282
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8388
|
+
return chunkYDEEINER_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8389
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkT2QG2HD5_js.UNGROUPED_SECTION_ID : chunkT2QG2HD5_js.DEFAULT_SECTION_GROUP_ID),
|
|
8283
8390
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8284
8391
|
slideIndexes: group.slideIndexes,
|
|
8285
8392
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8291,7 +8398,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8291
8398
|
return void 0;
|
|
8292
8399
|
}
|
|
8293
8400
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8294
|
-
return
|
|
8401
|
+
return chunkYDEEINER_js.masterViewPseudoSlide(document2, {
|
|
8295
8402
|
tab: "slides",
|
|
8296
8403
|
masterIndex: 0,
|
|
8297
8404
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8319,10 +8426,10 @@ function useDerivedSlideState(input) {
|
|
|
8319
8426
|
);
|
|
8320
8427
|
const slideSectionGroups = react.useMemo(
|
|
8321
8428
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8322
|
-
if (group.id ===
|
|
8429
|
+
if (group.id === chunkT2QG2HD5_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8323
8430
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8324
8431
|
}
|
|
8325
|
-
if (group.id ===
|
|
8432
|
+
if (group.id === chunkT2QG2HD5_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8326
8433
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8327
8434
|
}
|
|
8328
8435
|
return group;
|
|
@@ -8422,13 +8529,13 @@ function useAnnotationHandlers(input) {
|
|
|
8422
8529
|
}, [annotations, setMode, setSlides, history]);
|
|
8423
8530
|
const handleSetMode = react.useCallback(
|
|
8424
8531
|
(nextMode) => {
|
|
8425
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8532
|
+
if (mode === "present" && nextMode !== "present" && !chunkYDEEINER_js.mayLeaveSlideShow()) {
|
|
8426
8533
|
return;
|
|
8427
8534
|
}
|
|
8428
8535
|
if (nextMode === "present") {
|
|
8429
8536
|
presentation.enterPresentMode();
|
|
8430
8537
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8431
|
-
|
|
8538
|
+
chunkYDEEINER_js.stopAllPersistentAudio();
|
|
8432
8539
|
if (promptKeepInkAnnotations) {
|
|
8433
8540
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8434
8541
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8438,7 +8545,7 @@ function useAnnotationHandlers(input) {
|
|
|
8438
8545
|
}
|
|
8439
8546
|
} else {
|
|
8440
8547
|
if (mode === "present") {
|
|
8441
|
-
|
|
8548
|
+
chunkYDEEINER_js.stopAllPersistentAudio();
|
|
8442
8549
|
}
|
|
8443
8550
|
setMode(nextMode);
|
|
8444
8551
|
}
|
|
@@ -8502,13 +8609,13 @@ function useSerialize(input) {
|
|
|
8502
8609
|
let processedSlide = slide;
|
|
8503
8610
|
if (pendingEditId) {
|
|
8504
8611
|
const updatedElements = slide.elements.map((el) => {
|
|
8505
|
-
if (el.id !== pendingEditId || !
|
|
8612
|
+
if (el.id !== pendingEditId || !chunkYDEEINER_js.hasTextProperties(el)) {
|
|
8506
8613
|
return el;
|
|
8507
8614
|
}
|
|
8508
8615
|
return {
|
|
8509
8616
|
...el,
|
|
8510
8617
|
text: pendingEditText,
|
|
8511
|
-
textSegments:
|
|
8618
|
+
textSegments: chunkYDEEINER_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8512
8619
|
};
|
|
8513
8620
|
});
|
|
8514
8621
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8521,19 +8628,19 @@ function useSerialize(input) {
|
|
|
8521
8628
|
const pptxGuides = guides.map((g) => ({
|
|
8522
8629
|
id: g.id,
|
|
8523
8630
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8524
|
-
positionEmu:
|
|
8631
|
+
positionEmu: chunkYDEEINER_js.guidePxToEmu(g.position)
|
|
8525
8632
|
}));
|
|
8526
8633
|
return {
|
|
8527
8634
|
...processedSlide,
|
|
8528
8635
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8529
8636
|
};
|
|
8530
8637
|
});
|
|
8531
|
-
const slidesToSave =
|
|
8638
|
+
const slidesToSave = chunkYDEEINER_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8532
8639
|
const saveOptions = {
|
|
8533
8640
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8534
8641
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8535
8642
|
// slide-size edit reaches the file.
|
|
8536
|
-
slideSize:
|
|
8643
|
+
slideSize: chunkYDEEINER_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8537
8644
|
headerFooter,
|
|
8538
8645
|
presentationProperties,
|
|
8539
8646
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -8545,9 +8652,9 @@ function useSerialize(input) {
|
|
|
8545
8652
|
slideMasters,
|
|
8546
8653
|
notesMaster,
|
|
8547
8654
|
handoutMaster,
|
|
8548
|
-
...
|
|
8655
|
+
...chunkYDEEINER_js.embeddedFontSaveOptions(embedFonts)
|
|
8549
8656
|
};
|
|
8550
|
-
return
|
|
8657
|
+
return chunkYDEEINER_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8551
8658
|
}, [
|
|
8552
8659
|
slides,
|
|
8553
8660
|
templateElementsBySlideId,
|
|
@@ -8582,7 +8689,7 @@ function useRecoveryDetection(input) {
|
|
|
8582
8689
|
const onRestore = input.onRestore;
|
|
8583
8690
|
const openVersionHistory = input.openVersionHistory;
|
|
8584
8691
|
react.useEffect(() => {
|
|
8585
|
-
if (!
|
|
8692
|
+
if (!chunkYDEEINER_js.shouldProbeAutosaveRecovery({
|
|
8586
8693
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8587
8694
|
filePath,
|
|
8588
8695
|
loading,
|
|
@@ -8594,7 +8701,7 @@ function useRecoveryDetection(input) {
|
|
|
8594
8701
|
}
|
|
8595
8702
|
recoveryCheckedRef.current = true;
|
|
8596
8703
|
void (async () => {
|
|
8597
|
-
const offer = await
|
|
8704
|
+
const offer = await chunkYDEEINER_js.probeAutosaveRecovery(filePath);
|
|
8598
8705
|
if (!offer) {
|
|
8599
8706
|
return;
|
|
8600
8707
|
}
|
|
@@ -8607,7 +8714,7 @@ function useRecoveryDetection(input) {
|
|
|
8607
8714
|
const record = recordRef.current;
|
|
8608
8715
|
setPrompt(null);
|
|
8609
8716
|
if (record && onRestore) {
|
|
8610
|
-
onRestore(
|
|
8717
|
+
onRestore(chunkYDEEINER_js.acceptAutosaveRecovery(record));
|
|
8611
8718
|
}
|
|
8612
8719
|
recordRef.current = null;
|
|
8613
8720
|
}, [onRestore]);
|
|
@@ -8616,7 +8723,7 @@ function useRecoveryDetection(input) {
|
|
|
8616
8723
|
setPrompt(null);
|
|
8617
8724
|
recordRef.current = null;
|
|
8618
8725
|
if (record) {
|
|
8619
|
-
void
|
|
8726
|
+
void chunkYDEEINER_js.discardAutosaveRecovery(record);
|
|
8620
8727
|
}
|
|
8621
8728
|
}, []);
|
|
8622
8729
|
return { prompt, restore, discard };
|
|
@@ -8655,11 +8762,11 @@ function usePresentationSetup(input) {
|
|
|
8655
8762
|
containerRef,
|
|
8656
8763
|
content,
|
|
8657
8764
|
onSetMode: (nextMode) => {
|
|
8658
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8765
|
+
if (mode === "present" && nextMode !== "present" && !chunkYDEEINER_js.mayLeaveSlideShow()) {
|
|
8659
8766
|
return;
|
|
8660
8767
|
}
|
|
8661
8768
|
if (mode === "present" && nextMode !== "present") {
|
|
8662
|
-
|
|
8769
|
+
chunkYDEEINER_js.stopAllPersistentAudio();
|
|
8663
8770
|
stopAnimationSound();
|
|
8664
8771
|
const exitHandler = exitModeHandlerRef.current;
|
|
8665
8772
|
if (exitHandler) {
|
|
@@ -8721,10 +8828,10 @@ function usePresentationSetup(input) {
|
|
|
8721
8828
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8722
8829
|
onToggleSubtitles,
|
|
8723
8830
|
onSaveRehearsalTimings: (timings) => {
|
|
8724
|
-
setSlides((prev) =>
|
|
8831
|
+
setSlides((prev) => chunkYDEEINER_js.applyRehearsalTimings(prev, timings));
|
|
8725
8832
|
history.markDirty();
|
|
8726
8833
|
},
|
|
8727
|
-
loopContinuously:
|
|
8834
|
+
loopContinuously: chunkYDEEINER_js.shouldLoopContinuously(presentationProperties),
|
|
8728
8835
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8729
8836
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8730
8837
|
endWithBlackSlide
|
|
@@ -8925,7 +9032,7 @@ function useEditorOperations(input) {
|
|
|
8925
9032
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
8926
9033
|
react.useEffect(() => {
|
|
8927
9034
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
8928
|
-
copiedFormatRef.current =
|
|
9035
|
+
copiedFormatRef.current = chunkYDEEINER_js.copyFormatFromElement(selectedElement);
|
|
8929
9036
|
} else if (!formatPainterActive) {
|
|
8930
9037
|
copiedFormatRef.current = null;
|
|
8931
9038
|
}
|
|
@@ -8951,12 +9058,12 @@ function useEditorOperations(input) {
|
|
|
8951
9058
|
e.stopPropagation();
|
|
8952
9059
|
const element = elementLookup.get(elementId);
|
|
8953
9060
|
if (element) {
|
|
8954
|
-
const updated =
|
|
9061
|
+
const updated = chunkYDEEINER_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
8955
9062
|
const updates = {};
|
|
8956
|
-
if (
|
|
9063
|
+
if (chunkYDEEINER_js.hasShapeProperties(updated)) {
|
|
8957
9064
|
updates.shapeStyle = updated.shapeStyle;
|
|
8958
9065
|
}
|
|
8959
|
-
if (
|
|
9066
|
+
if (chunkYDEEINER_js.hasTextProperties(updated)) {
|
|
8960
9067
|
updates.textStyle = updated.textStyle;
|
|
8961
9068
|
}
|
|
8962
9069
|
ops.updateElementById(elementId, updates);
|
|
@@ -9110,7 +9217,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9110
9217
|
const families = /* @__PURE__ */ new Set();
|
|
9111
9218
|
for (const slide of slides) {
|
|
9112
9219
|
for (const el of slide.elements) {
|
|
9113
|
-
if (
|
|
9220
|
+
if (chunkYDEEINER_js.hasTextProperties(el) && el.textSegments) {
|
|
9114
9221
|
for (const seg of el.textSegments) {
|
|
9115
9222
|
if (seg.style.fontFamily) {
|
|
9116
9223
|
families.add(seg.style.fontFamily);
|
|
@@ -9360,7 +9467,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9360
9467
|
inputRef.current = input;
|
|
9361
9468
|
const handleKeyDown = react.useCallback((e) => {
|
|
9362
9469
|
const current = inputRef.current;
|
|
9363
|
-
const { action, dx, dy } =
|
|
9470
|
+
const { action, dx, dy } = chunkYDEEINER_js.mapEditorKey(e, {
|
|
9364
9471
|
canEdit: current.canEdit,
|
|
9365
9472
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9366
9473
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9373,7 +9480,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9373
9480
|
hasSelection: current.hasSelection,
|
|
9374
9481
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9375
9482
|
isDrawing: current.activeTool !== "select",
|
|
9376
|
-
isTextInputTarget:
|
|
9483
|
+
isTextInputTarget: chunkYDEEINER_js.isEditorTextInputTarget(e.target)
|
|
9377
9484
|
});
|
|
9378
9485
|
if (action === null) {
|
|
9379
9486
|
return;
|
|
@@ -9684,7 +9791,7 @@ function useViewerIntegration(input) {
|
|
|
9684
9791
|
return zoom.scale;
|
|
9685
9792
|
},
|
|
9686
9793
|
setZoom(level) {
|
|
9687
|
-
zoom.setScale(
|
|
9794
|
+
zoom.setScale(chunkYDEEINER_js.clampZoomScale(level));
|
|
9688
9795
|
},
|
|
9689
9796
|
zoomIn() {
|
|
9690
9797
|
zoom.handleZoomIn();
|
|
@@ -9900,7 +10007,7 @@ function useReducedMotion() {
|
|
|
9900
10007
|
}
|
|
9901
10008
|
function useViewerOptions() {
|
|
9902
10009
|
const storeRef = react.useRef(null);
|
|
9903
|
-
storeRef.current ??=
|
|
10010
|
+
storeRef.current ??= chunkYDEEINER_js.createViewerOptionsStore();
|
|
9904
10011
|
const store = storeRef.current;
|
|
9905
10012
|
const options = react.useSyncExternalStore(
|
|
9906
10013
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9909,9 +10016,9 @@ function useViewerOptions() {
|
|
|
9909
10016
|
);
|
|
9910
10017
|
return { optionsStore: store, options };
|
|
9911
10018
|
}
|
|
9912
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10019
|
+
var KNOWN_TAB_IDS = new Set(chunkYDEEINER_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9913
10020
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
9914
|
-
const isHidden = (id) =>
|
|
10021
|
+
const isHidden = (id) => chunkYDEEINER_js.isActionHidden(id, hiddenActions);
|
|
9915
10022
|
const userHidden = new Set(hiddenTabIds);
|
|
9916
10023
|
userHidden.delete("file");
|
|
9917
10024
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
|
|
@@ -10003,12 +10110,12 @@ function useYjsDocumentSync({
|
|
|
10003
10110
|
return;
|
|
10004
10111
|
}
|
|
10005
10112
|
try {
|
|
10006
|
-
const handler = new
|
|
10113
|
+
const handler = new chunkYDEEINER_js.PptxHandler();
|
|
10007
10114
|
await handler.load(sourceBytes.buffer);
|
|
10008
|
-
const currentSlides =
|
|
10115
|
+
const currentSlides = chunkYDEEINER_js.readSlidesFromYDoc(
|
|
10009
10116
|
doc
|
|
10010
10117
|
);
|
|
10011
|
-
const slidesToSave =
|
|
10118
|
+
const slidesToSave = chunkYDEEINER_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10012
10119
|
const bytes = await handler.save(slidesToSave);
|
|
10013
10120
|
config.onWriteBack(bytes);
|
|
10014
10121
|
} catch {
|
|
@@ -10023,10 +10130,10 @@ function useYjsDocumentSync({
|
|
|
10023
10130
|
if (!doc || !isConnected) {
|
|
10024
10131
|
return;
|
|
10025
10132
|
}
|
|
10026
|
-
const docSlides =
|
|
10133
|
+
const docSlides = chunkYDEEINER_js.readSlidesFromYDoc(
|
|
10027
10134
|
doc
|
|
10028
10135
|
);
|
|
10029
|
-
if (!
|
|
10136
|
+
if (!chunkYDEEINER_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10030
10137
|
return;
|
|
10031
10138
|
}
|
|
10032
10139
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10045,11 +10152,11 @@ function useYjsDocumentSync({
|
|
|
10045
10152
|
lastSyncedRef.current = serialized;
|
|
10046
10153
|
void (async () => {
|
|
10047
10154
|
const factories = await getFactories();
|
|
10048
|
-
|
|
10155
|
+
chunkYDEEINER_js.reconcileSlidesInYDoc(
|
|
10049
10156
|
slides,
|
|
10050
10157
|
doc,
|
|
10051
10158
|
factories,
|
|
10052
|
-
|
|
10159
|
+
chunkYDEEINER_js.LOCAL_SYNC_ORIGIN
|
|
10053
10160
|
);
|
|
10054
10161
|
scheduleWriteBack();
|
|
10055
10162
|
})();
|
|
@@ -10063,10 +10170,10 @@ function useYjsDocumentSync({
|
|
|
10063
10170
|
return;
|
|
10064
10171
|
}
|
|
10065
10172
|
const handleChange = (_events, transaction) => {
|
|
10066
|
-
if (transaction?.origin ===
|
|
10173
|
+
if (transaction?.origin === chunkYDEEINER_js.LOCAL_SYNC_ORIGIN) {
|
|
10067
10174
|
return;
|
|
10068
10175
|
}
|
|
10069
|
-
const remoteSlides =
|
|
10176
|
+
const remoteSlides = chunkYDEEINER_js.readSlidesFromYDoc(
|
|
10070
10177
|
doc
|
|
10071
10178
|
);
|
|
10072
10179
|
if (remoteSlides.length === 0) {
|
|
@@ -10082,7 +10189,7 @@ function useYjsDocumentSync({
|
|
|
10082
10189
|
isApplyingRemoteRef.current = false;
|
|
10083
10190
|
scheduleWriteBack();
|
|
10084
10191
|
};
|
|
10085
|
-
const unobserve =
|
|
10192
|
+
const unobserve = chunkYDEEINER_js.observeYDocSlides(
|
|
10086
10193
|
doc,
|
|
10087
10194
|
handleChange
|
|
10088
10195
|
);
|
|
@@ -10120,7 +10227,7 @@ function useBroadcastFollower({
|
|
|
10120
10227
|
if (!broadcaster) {
|
|
10121
10228
|
return;
|
|
10122
10229
|
}
|
|
10123
|
-
if (!
|
|
10230
|
+
if (!chunkYDEEINER_js.shouldAutoFollowBroadcaster({
|
|
10124
10231
|
localRole: collab.config.role,
|
|
10125
10232
|
broadcasterRole: broadcaster.role
|
|
10126
10233
|
})) {
|
|
@@ -10291,7 +10398,7 @@ function subscribeTouchCapability(callback) {
|
|
|
10291
10398
|
function useIsMobile() {
|
|
10292
10399
|
const isTouchDevice = react.useSyncExternalStore(
|
|
10293
10400
|
subscribeTouchCapability,
|
|
10294
|
-
|
|
10401
|
+
chunkYDEEINER_js.detectTouchDevice,
|
|
10295
10402
|
() => false
|
|
10296
10403
|
// server snapshot
|
|
10297
10404
|
);
|
|
@@ -10301,7 +10408,7 @@ function useIsMobile() {
|
|
|
10301
10408
|
const [viewportHeight, setViewportHeight] = react.useState(
|
|
10302
10409
|
() => typeof window === "undefined" ? 768 : window.innerHeight
|
|
10303
10410
|
);
|
|
10304
|
-
const [orientation, setOrientation] = react.useState(
|
|
10411
|
+
const [orientation, setOrientation] = react.useState(chunkYDEEINER_js.detectOrientation);
|
|
10305
10412
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
10306
10413
|
const [initialViewportHeight] = react.useState(
|
|
10307
10414
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -10322,7 +10429,7 @@ function useIsMobile() {
|
|
|
10322
10429
|
return;
|
|
10323
10430
|
}
|
|
10324
10431
|
const handleOrientationChange = () => {
|
|
10325
|
-
setOrientation(
|
|
10432
|
+
setOrientation(chunkYDEEINER_js.detectOrientation());
|
|
10326
10433
|
};
|
|
10327
10434
|
if (screen.orientation) {
|
|
10328
10435
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -10352,7 +10459,7 @@ function useIsMobile() {
|
|
|
10352
10459
|
window.addEventListener("resize", handleResize);
|
|
10353
10460
|
return () => window.removeEventListener("resize", handleResize);
|
|
10354
10461
|
}, [isTouchDevice, initialViewportHeight]);
|
|
10355
|
-
const { isMobile, isTablet, isDesktop } =
|
|
10462
|
+
const { isMobile, isTablet, isDesktop } = chunkYDEEINER_js.deriveViewportBreakpoints(
|
|
10356
10463
|
viewportWidth,
|
|
10357
10464
|
viewportHeight,
|
|
10358
10465
|
isTouchDevice
|
|
@@ -10383,10 +10490,10 @@ function useTouchGestures(input) {
|
|
|
10383
10490
|
if (!el || !enabled) {
|
|
10384
10491
|
return;
|
|
10385
10492
|
}
|
|
10386
|
-
const recognizer =
|
|
10493
|
+
const recognizer = chunkYDEEINER_js.createTouchGestureRecognizer({
|
|
10387
10494
|
getScale: () => scaleRef.current,
|
|
10388
|
-
minScale:
|
|
10389
|
-
maxScale:
|
|
10495
|
+
minScale: chunkYDEEINER_js.MIN_ZOOM_SCALE,
|
|
10496
|
+
maxScale: chunkYDEEINER_js.MAX_ZOOM_SCALE,
|
|
10390
10497
|
callbacks: {
|
|
10391
10498
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10392
10499
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10426,7 +10533,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10426
10533
|
return;
|
|
10427
10534
|
}
|
|
10428
10535
|
const rect = active.getBoundingClientRect();
|
|
10429
|
-
const delta =
|
|
10536
|
+
const delta = chunkYDEEINER_js.computeScrollDelta(
|
|
10430
10537
|
{ top: rect.top, bottom: rect.bottom },
|
|
10431
10538
|
window.innerHeight,
|
|
10432
10539
|
keyboardInset
|
|
@@ -10446,8 +10553,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10446
10553
|
return;
|
|
10447
10554
|
}
|
|
10448
10555
|
const update = () => {
|
|
10449
|
-
const metrics =
|
|
10450
|
-
const inset = metrics ?
|
|
10556
|
+
const metrics = chunkYDEEINER_js.readViewportMetrics(window);
|
|
10557
|
+
const inset = metrics ? chunkYDEEINER_js.computeKeyboardInset(metrics) : 0;
|
|
10451
10558
|
setKeyboardInset(inset);
|
|
10452
10559
|
if (inset > 0) {
|
|
10453
10560
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10458,8 +10565,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10458
10565
|
vv.addEventListener("scroll", update);
|
|
10459
10566
|
const onFocusIn = () => {
|
|
10460
10567
|
window.requestAnimationFrame(() => {
|
|
10461
|
-
const metrics =
|
|
10462
|
-
const inset = metrics ?
|
|
10568
|
+
const metrics = chunkYDEEINER_js.readViewportMetrics(window);
|
|
10569
|
+
const inset = metrics ? chunkYDEEINER_js.computeKeyboardInset(metrics) : 0;
|
|
10463
10570
|
if (inset > 0) {
|
|
10464
10571
|
scrollFocusedIntoView(inset);
|
|
10465
10572
|
}
|
|
@@ -10472,7 +10579,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10472
10579
|
document.removeEventListener("focusin", onFocusIn);
|
|
10473
10580
|
};
|
|
10474
10581
|
}, [enabled]);
|
|
10475
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10582
|
+
return { keyboardInset, isKeyboardOpen: chunkYDEEINER_js.isKeyboardOpen(keyboardInset) };
|
|
10476
10583
|
}
|
|
10477
10584
|
|
|
10478
10585
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10501,21 +10608,21 @@ function buildCanvasProps(input) {
|
|
|
10501
10608
|
} = input;
|
|
10502
10609
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10503
10610
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10504
|
-
const fieldContext =
|
|
10611
|
+
const fieldContext = chunkYDEEINER_js.buildFieldSubstitutionContext({
|
|
10505
10612
|
headerFooter: s.headerFooter,
|
|
10506
10613
|
customProperties: s.customProperties,
|
|
10507
10614
|
slide: activeSlide
|
|
10508
10615
|
});
|
|
10509
10616
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10510
10617
|
const openExternalUrl = (url) => {
|
|
10511
|
-
if (
|
|
10618
|
+
if (chunkYDEEINER_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
10512
10619
|
return;
|
|
10513
10620
|
}
|
|
10514
|
-
|
|
10621
|
+
chunkYDEEINER_js.safeOpenUrl(url);
|
|
10515
10622
|
};
|
|
10516
10623
|
const handleActionClick = (_elementId, action) => {
|
|
10517
10624
|
if (mode === "present") {
|
|
10518
|
-
const resolved =
|
|
10625
|
+
const resolved = chunkYDEEINER_js.resolvePresentationAction(action, { slideCount: slides.length });
|
|
10519
10626
|
if (resolved.intent.kind === "openUrl") {
|
|
10520
10627
|
openExternalUrl(resolved.intent.url);
|
|
10521
10628
|
return;
|
|
@@ -10526,9 +10633,9 @@ function buildCanvasProps(input) {
|
|
|
10526
10633
|
}
|
|
10527
10634
|
};
|
|
10528
10635
|
const handleHyperlinkClick = (url) => {
|
|
10529
|
-
if (
|
|
10636
|
+
if (chunkYDEEINER_js.isPpactionUrl(url)) {
|
|
10530
10637
|
if (mode === "present") {
|
|
10531
|
-
const parsed =
|
|
10638
|
+
const parsed = chunkYDEEINER_js.parsePpactionUrl(url);
|
|
10532
10639
|
if (parsed) {
|
|
10533
10640
|
presentation.handlePresentationAction({
|
|
10534
10641
|
action: parsed.action,
|
|
@@ -10634,7 +10741,7 @@ function buildCanvasProps(input) {
|
|
|
10634
10741
|
|
|
10635
10742
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10636
10743
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10637
|
-
return
|
|
10744
|
+
return chunkYDEEINER_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10638
10745
|
}
|
|
10639
10746
|
|
|
10640
10747
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10647,7 +10754,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10647
10754
|
const current = activeSlide.animations ?? [];
|
|
10648
10755
|
if (group === "motionPath") {
|
|
10649
10756
|
propertyHandlers.handleUpdateSlide({
|
|
10650
|
-
animations:
|
|
10757
|
+
animations: chunkYDEEINER_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10651
10758
|
});
|
|
10652
10759
|
return;
|
|
10653
10760
|
}
|
|
@@ -10841,7 +10948,7 @@ function buildToolbarProps(input) {
|
|
|
10841
10948
|
onOpenFile,
|
|
10842
10949
|
onOpenRecentFile,
|
|
10843
10950
|
onCreatePresentation: (templateId) => {
|
|
10844
|
-
s.setSlides(
|
|
10951
|
+
s.setSlides(chunkYDEEINER_js.createBackstagePresentation(templateId));
|
|
10845
10952
|
s.setActiveSlideIndex(0);
|
|
10846
10953
|
s.setSelectedElementId(null);
|
|
10847
10954
|
s.setSelectedElementIds([]);
|
|
@@ -10870,7 +10977,7 @@ function buildToolbarProps(input) {
|
|
|
10870
10977
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
10871
10978
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10872
10979
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10873
|
-
templateScheme:
|
|
10980
|
+
templateScheme: chunkYDEEINER_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10874
10981
|
customShows: s.customShows,
|
|
10875
10982
|
activeCustomShowId: s.activeCustomShowId,
|
|
10876
10983
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -10911,7 +11018,7 @@ function buildToolbarProps(input) {
|
|
|
10911
11018
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10912
11019
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10913
11020
|
formatPainterActive: s.formatPainterActive,
|
|
10914
|
-
canActivateFormatPainter:
|
|
11021
|
+
canActivateFormatPainter: chunkYDEEINER_js.hasCopyableFormat(selectedElement),
|
|
10915
11022
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10916
11023
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10917
11024
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -10985,7 +11092,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
10985
11092
|
headerFooter: state.headerFooter,
|
|
10986
11093
|
loading,
|
|
10987
11094
|
error,
|
|
10988
|
-
maxHistoryEntries:
|
|
11095
|
+
maxHistoryEntries: chunkYDEEINER_js.resolveHistoryDepth(viewerOptions),
|
|
10989
11096
|
hasActivePointerInteraction,
|
|
10990
11097
|
pointerCommitNonce: state.pointerCommitNonce,
|
|
10991
11098
|
setSlides: state.setSlides,
|
|
@@ -11050,7 +11157,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11050
11157
|
gridSpacingPx,
|
|
11051
11158
|
// Multiplied against the pre-existing 2x baseline; see the matching
|
|
11052
11159
|
// comment in `PowerPointViewer.tsx`.
|
|
11053
|
-
imageExportScale: 2 *
|
|
11160
|
+
imageExportScale: 2 * chunkYDEEINER_js.resolveImageResolutionScale(viewerOptions),
|
|
11054
11161
|
viewerOptions
|
|
11055
11162
|
};
|
|
11056
11163
|
}
|
|
@@ -11220,7 +11327,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11220
11327
|
}, [incomingContent]);
|
|
11221
11328
|
const onOpenFile = react.useCallback(() => {
|
|
11222
11329
|
void (async () => {
|
|
11223
|
-
const picked = await
|
|
11330
|
+
const picked = await chunkYDEEINER_js.openPptxFile();
|
|
11224
11331
|
if (picked) {
|
|
11225
11332
|
setContent(picked.buffer);
|
|
11226
11333
|
}
|
|
@@ -11228,7 +11335,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11228
11335
|
}, []);
|
|
11229
11336
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11230
11337
|
void (async () => {
|
|
11231
|
-
const bytes = await
|
|
11338
|
+
const bytes = await chunkYDEEINER_js.readBackstageRecentFile(key);
|
|
11232
11339
|
if (bytes) {
|
|
11233
11340
|
setContent(bytes);
|
|
11234
11341
|
}
|