pptx-react-viewer 3.1.2 → 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 +25 -0
- package/dist/{AiChatPanel-UCFQIWOQ.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-4EYZDQXM.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-YBMC6NKY.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-PMYXO4MR.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-CEOI6SU6.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-75DCA2ZA.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-STGX6N6V.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-EZZKWUZR.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-FGQJKWL6.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-DWRD63FH.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-R3Y7OVVO.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-DH6RSJO6.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-BMBU5RKI.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-UM5HA3VO.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-VLLZ3QL2.mjs → chunk-57MGKBJ4.mjs} +284 -81
- package/dist/chunk-57MGKBJ4.mjs.br +0 -0
- package/dist/chunk-57MGKBJ4.mjs.gz +0 -0
- package/dist/{chunk-4VVOTEQ4.mjs → chunk-A2UAUSJM.mjs} +114 -8
- package/dist/chunk-A2UAUSJM.mjs.br +0 -0
- package/dist/chunk-A2UAUSJM.mjs.gz +0 -0
- package/dist/{chunk-W3J6SNVE.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-YNUYFR2T.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-WVIKFMNS.js → chunk-LXYDXLKZ.js} +511 -405
- package/dist/chunk-LXYDXLKZ.js.br +0 -0
- package/dist/chunk-LXYDXLKZ.js.gz +0 -0
- package/dist/{chunk-O5DKWJDK.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-2HLDBQH7.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-MQEG5GOV.js → chunk-T44LBKF6.js} +1373 -1170
- package/dist/chunk-T44LBKF6.js.br +0 -0
- package/dist/chunk-T44LBKF6.js.gz +0 -0
- package/dist/{chunk-S546O4W2.mjs → chunk-XIHK52SB.mjs} +1526 -342
- package/dist/chunk-XIHK52SB.mjs.br +0 -0
- package/dist/chunk-XIHK52SB.mjs.gz +0 -0
- package/dist/{chunk-7ZQ2FZXE.js → chunk-YDEEINER.js} +1529 -344
- 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/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/viewer/index.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-4EYZDQXM.js.br +0 -0
- package/dist/AiChatPanel-4EYZDQXM.js.gz +0 -0
- package/dist/AiChatPanel-UCFQIWOQ.mjs.br +0 -0
- package/dist/AiChatPanel-UCFQIWOQ.mjs.gz +0 -0
- package/dist/Area3DChartScene-PMYXO4MR.mjs.br +0 -0
- package/dist/Area3DChartScene-PMYXO4MR.mjs.gz +0 -0
- package/dist/Area3DChartScene-YBMC6NKY.js.br +0 -0
- package/dist/Area3DChartScene-YBMC6NKY.js.gz +0 -0
- package/dist/Bar3DChartScene-75DCA2ZA.js.br +0 -0
- package/dist/Bar3DChartScene-75DCA2ZA.js.gz +0 -0
- package/dist/Bar3DChartScene-CEOI6SU6.mjs.br +0 -0
- package/dist/Bar3DChartScene-CEOI6SU6.mjs.gz +0 -0
- package/dist/Line3DChartScene-EZZKWUZR.mjs.br +0 -0
- package/dist/Line3DChartScene-EZZKWUZR.mjs.gz +0 -0
- package/dist/Line3DChartScene-STGX6N6V.js.br +0 -0
- package/dist/Line3DChartScene-STGX6N6V.js.gz +0 -0
- package/dist/Model3DScene-DWRD63FH.js.br +0 -0
- package/dist/Model3DScene-DWRD63FH.js.gz +0 -0
- package/dist/Model3DScene-FGQJKWL6.mjs.br +0 -0
- package/dist/Model3DScene-FGQJKWL6.mjs.gz +0 -0
- package/dist/PieChart3DScene-DH6RSJO6.mjs.br +0 -0
- package/dist/PieChart3DScene-DH6RSJO6.mjs.gz +0 -0
- package/dist/PieChart3DScene-R3Y7OVVO.js.br +0 -0
- package/dist/PieChart3DScene-R3Y7OVVO.js.gz +0 -0
- package/dist/SurfaceChart3DScene-BMBU5RKI.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-BMBU5RKI.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-UM5HA3VO.js.br +0 -0
- package/dist/SurfaceChart3DScene-UM5HA3VO.js.gz +0 -0
- package/dist/chunk-2HLDBQH7.js.br +0 -0
- package/dist/chunk-2HLDBQH7.js.gz +0 -0
- package/dist/chunk-4VVOTEQ4.mjs.br +0 -0
- package/dist/chunk-4VVOTEQ4.mjs.gz +0 -0
- package/dist/chunk-7ZQ2FZXE.js.br +0 -0
- package/dist/chunk-7ZQ2FZXE.js.gz +0 -0
- package/dist/chunk-MQEG5GOV.js.br +0 -0
- package/dist/chunk-MQEG5GOV.js.gz +0 -0
- package/dist/chunk-O5DKWJDK.mjs.br +0 -0
- package/dist/chunk-O5DKWJDK.mjs.gz +0 -0
- package/dist/chunk-S546O4W2.mjs.br +0 -0
- package/dist/chunk-S546O4W2.mjs.gz +0 -0
- package/dist/chunk-VLLZ3QL2.mjs.br +0 -0
- package/dist/chunk-VLLZ3QL2.mjs.gz +0 -0
- package/dist/chunk-W3J6SNVE.mjs.br +0 -0
- package/dist/chunk-W3J6SNVE.mjs.gz +0 -0
- package/dist/chunk-WVIKFMNS.js.br +0 -0
- package/dist/chunk-WVIKFMNS.js.gz +0 -0
- package/dist/chunk-YNUYFR2T.js.br +0 -0
- package/dist/chunk-YNUYFR2T.js.gz +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var 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 chunk7ZQ2FZXE_js = require('./chunk-7ZQ2FZXE.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;
|
|
@@ -4906,8 +5013,7 @@ function usePointerHandlers(input) {
|
|
|
4906
5013
|
updateSlides,
|
|
4907
5014
|
updateElementById,
|
|
4908
5015
|
markDirty,
|
|
4909
|
-
livePatcher
|
|
4910
|
-
input
|
|
5016
|
+
livePatcher
|
|
4911
5017
|
]);
|
|
4912
5018
|
}
|
|
4913
5019
|
function mouseDownStartsSelectionDrag(event) {
|
|
@@ -4953,11 +5059,11 @@ function useCanvasInteractions(input) {
|
|
|
4953
5059
|
return;
|
|
4954
5060
|
}
|
|
4955
5061
|
const el = elementLookup.get(editId);
|
|
4956
|
-
if (el &&
|
|
5062
|
+
if (el && chunkYDEEINER_js.hasTextProperties(el)) {
|
|
4957
5063
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4958
|
-
const newSegments =
|
|
5064
|
+
const newSegments = chunkYDEEINER_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4959
5065
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
4960
|
-
const newHeight =
|
|
5066
|
+
const newHeight = chunkYDEEINER_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
4961
5067
|
ops.updateElementById(editId, {
|
|
4962
5068
|
text: committedText,
|
|
4963
5069
|
textSegments: newSegments,
|
|
@@ -4969,7 +5075,7 @@ function useCanvasInteractions(input) {
|
|
|
4969
5075
|
setInlineEditingText("");
|
|
4970
5076
|
};
|
|
4971
5077
|
const openEquationEditorForElement = (el) => {
|
|
4972
|
-
if (!
|
|
5078
|
+
if (!chunkYDEEINER_js.hasTextProperties(el)) {
|
|
4973
5079
|
return false;
|
|
4974
5080
|
}
|
|
4975
5081
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4999,7 +5105,7 @@ function useCanvasInteractions(input) {
|
|
|
4999
5105
|
justInteractedRef.current = false;
|
|
5000
5106
|
} else {
|
|
5001
5107
|
const el = elementLookup.get(elementId);
|
|
5002
|
-
if (el &&
|
|
5108
|
+
if (el && chunkYDEEINER_js.hasTextProperties(el) && chunkYDEEINER_js.canInteractWithElement(el, "textEdit")) {
|
|
5003
5109
|
if (!openEquationEditorForElement(el)) {
|
|
5004
5110
|
setInlineEditingElementId(elementId);
|
|
5005
5111
|
setInlineEditingText(el.text ?? "");
|
|
@@ -5018,7 +5124,7 @@ function useCanvasInteractions(input) {
|
|
|
5018
5124
|
if (openEquationEditorForElement(el)) {
|
|
5019
5125
|
return;
|
|
5020
5126
|
}
|
|
5021
|
-
if (
|
|
5127
|
+
if (chunkYDEEINER_js.hasTextProperties(el) && chunkYDEEINER_js.canInteractWithElement(el, "textEdit")) {
|
|
5022
5128
|
setInlineEditingElementId(elementId);
|
|
5023
5129
|
setInlineEditingText(el.text ?? "");
|
|
5024
5130
|
}
|
|
@@ -5041,7 +5147,7 @@ function useCanvasInteractions(input) {
|
|
|
5041
5147
|
justSelectedRef.current = false;
|
|
5042
5148
|
}
|
|
5043
5149
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
5044
|
-
const movableIds =
|
|
5150
|
+
const movableIds = chunkYDEEINER_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
5045
5151
|
if (movableIds.length === 0) {
|
|
5046
5152
|
return;
|
|
5047
5153
|
}
|
|
@@ -5111,7 +5217,7 @@ function useCanvasInteractions(input) {
|
|
|
5111
5217
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5112
5218
|
e.stopPropagation();
|
|
5113
5219
|
const el = elementLookup.get(elementId);
|
|
5114
|
-
if (!el || !
|
|
5220
|
+
if (!el || !chunkYDEEINER_js.canInteractWithElement(el, "resize")) {
|
|
5115
5221
|
return;
|
|
5116
5222
|
}
|
|
5117
5223
|
resizeStateRef.current = {
|
|
@@ -5133,7 +5239,7 @@ function useCanvasInteractions(input) {
|
|
|
5133
5239
|
};
|
|
5134
5240
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5135
5241
|
const el = elementLookup.get(elementId);
|
|
5136
|
-
if (!el || !
|
|
5242
|
+
if (!el || !chunkYDEEINER_js.canInteractWithElement(el, "rotate")) {
|
|
5137
5243
|
return;
|
|
5138
5244
|
}
|
|
5139
5245
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5153,10 +5259,10 @@ function useCanvasInteractions(input) {
|
|
|
5153
5259
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5154
5260
|
e.stopPropagation();
|
|
5155
5261
|
const el = elementLookup.get(elementId);
|
|
5156
|
-
if (!el || !
|
|
5262
|
+
if (!el || !chunkYDEEINER_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5157
5263
|
return;
|
|
5158
5264
|
}
|
|
5159
|
-
shapeAdjustmentDragStateRef.current =
|
|
5265
|
+
shapeAdjustmentDragStateRef.current = chunkYDEEINER_js.beginShapeAdjustment(
|
|
5160
5266
|
el,
|
|
5161
5267
|
descriptor,
|
|
5162
5268
|
e.clientX,
|
|
@@ -5203,7 +5309,7 @@ function createFileHandlers(deps) {
|
|
|
5203
5309
|
h = Math.round(h * scale);
|
|
5204
5310
|
}
|
|
5205
5311
|
addElement({
|
|
5206
|
-
id:
|
|
5312
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5207
5313
|
type: "image",
|
|
5208
5314
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5209
5315
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5214,7 +5320,7 @@ function createFileHandlers(deps) {
|
|
|
5214
5320
|
};
|
|
5215
5321
|
img.onerror = () => {
|
|
5216
5322
|
addElement({
|
|
5217
|
-
id:
|
|
5323
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5218
5324
|
type: "image",
|
|
5219
5325
|
x: 100,
|
|
5220
5326
|
y: 100,
|
|
@@ -5233,14 +5339,14 @@ function createFileHandlers(deps) {
|
|
|
5233
5339
|
return;
|
|
5234
5340
|
}
|
|
5235
5341
|
e.target.value = "";
|
|
5236
|
-
const mediaType =
|
|
5342
|
+
const mediaType = chunkYDEEINER_js.classifyMediaType(file.type);
|
|
5237
5343
|
if (!mediaType) {
|
|
5238
5344
|
return;
|
|
5239
5345
|
}
|
|
5240
5346
|
const elFilePath = file.path;
|
|
5241
5347
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5242
5348
|
addElement({
|
|
5243
|
-
id:
|
|
5349
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5244
5350
|
type: "media",
|
|
5245
5351
|
mediaType,
|
|
5246
5352
|
mediaMimeType: file.type || void 0,
|
|
@@ -5415,13 +5521,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5415
5521
|
return;
|
|
5416
5522
|
}
|
|
5417
5523
|
addElement({
|
|
5418
|
-
id:
|
|
5524
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5419
5525
|
type: "smartArt",
|
|
5420
5526
|
x: 100,
|
|
5421
5527
|
y: 120,
|
|
5422
5528
|
width: 600,
|
|
5423
5529
|
height: 340,
|
|
5424
|
-
smartArtData:
|
|
5530
|
+
smartArtData: chunkYDEEINER_js.buildSmartArtPresetData(
|
|
5425
5531
|
layout,
|
|
5426
5532
|
defaultItems,
|
|
5427
5533
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5433,7 +5539,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5433
5539
|
return;
|
|
5434
5540
|
}
|
|
5435
5541
|
addElement({
|
|
5436
|
-
id:
|
|
5542
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5437
5543
|
type: "shape",
|
|
5438
5544
|
x: 120,
|
|
5439
5545
|
y: 200,
|
|
@@ -5471,7 +5577,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5471
5577
|
return;
|
|
5472
5578
|
}
|
|
5473
5579
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5474
|
-
if (resolved.url && !
|
|
5580
|
+
if (resolved.url && !chunkYDEEINER_js.isUrlSafe(resolved.url)) {
|
|
5475
5581
|
return;
|
|
5476
5582
|
}
|
|
5477
5583
|
const actionClick = {
|
|
@@ -5495,7 +5601,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5495
5601
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5496
5602
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5497
5603
|
addElement({
|
|
5498
|
-
id:
|
|
5604
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5499
5605
|
type: "shape",
|
|
5500
5606
|
x: 120,
|
|
5501
5607
|
y: 200,
|
|
@@ -5517,11 +5623,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5517
5623
|
if (!activeSlide) {
|
|
5518
5624
|
return;
|
|
5519
5625
|
}
|
|
5520
|
-
const preset =
|
|
5626
|
+
const preset = chunkYDEEINER_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5521
5627
|
if (!preset) {
|
|
5522
5628
|
return;
|
|
5523
5629
|
}
|
|
5524
|
-
const defaultPptxAction =
|
|
5630
|
+
const defaultPptxAction = chunkYDEEINER_js.elementActionToPptxAction({
|
|
5525
5631
|
trigger: "click",
|
|
5526
5632
|
type: preset.defaultAction
|
|
5527
5633
|
});
|
|
@@ -5530,7 +5636,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5530
5636
|
defaultPptxAction.highlightClick = true;
|
|
5531
5637
|
}
|
|
5532
5638
|
addElement({
|
|
5533
|
-
id:
|
|
5639
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5534
5640
|
type: "shape",
|
|
5535
5641
|
x: 150,
|
|
5536
5642
|
y: 150,
|
|
@@ -5597,14 +5703,14 @@ function useInsertElements(input) {
|
|
|
5597
5703
|
return;
|
|
5598
5704
|
}
|
|
5599
5705
|
addElement({
|
|
5600
|
-
id:
|
|
5706
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5601
5707
|
type: "text",
|
|
5602
5708
|
x: 100,
|
|
5603
5709
|
y: 100,
|
|
5604
5710
|
width: 300,
|
|
5605
5711
|
height: 60,
|
|
5606
5712
|
text: "",
|
|
5607
|
-
textStyle: { fontSize:
|
|
5713
|
+
textStyle: { fontSize: chunkT2QG2HD5_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5608
5714
|
});
|
|
5609
5715
|
};
|
|
5610
5716
|
const handleAddShape = () => {
|
|
@@ -5612,7 +5718,7 @@ function useInsertElements(input) {
|
|
|
5612
5718
|
return;
|
|
5613
5719
|
}
|
|
5614
5720
|
addElement({
|
|
5615
|
-
id:
|
|
5721
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5616
5722
|
type: "shape",
|
|
5617
5723
|
x: 150,
|
|
5618
5724
|
y: 150,
|
|
@@ -5631,15 +5737,15 @@ function useInsertElements(input) {
|
|
|
5631
5737
|
return;
|
|
5632
5738
|
}
|
|
5633
5739
|
addElement({
|
|
5634
|
-
...
|
|
5635
|
-
id:
|
|
5740
|
+
...chunkYDEEINER_js.newTableElement(chunkT2QG2HD5_js.DEFAULT_TABLE_ROWS, chunkT2QG2HD5_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5741
|
+
id: chunkYDEEINER_js.generateElementId()
|
|
5636
5742
|
});
|
|
5637
5743
|
};
|
|
5638
5744
|
const handleAddChart = (chartKind) => {
|
|
5639
5745
|
if (!activeSlide) {
|
|
5640
5746
|
return;
|
|
5641
5747
|
}
|
|
5642
|
-
addElement(
|
|
5748
|
+
addElement(chunkYDEEINER_js.createDefaultChartElement(chartKind));
|
|
5643
5749
|
};
|
|
5644
5750
|
const structured = createStructuredElementHandlers({
|
|
5645
5751
|
activeSlide,
|
|
@@ -5709,7 +5815,7 @@ function useClipboardHandlers(input) {
|
|
|
5709
5815
|
if (!selectedElement) {
|
|
5710
5816
|
return;
|
|
5711
5817
|
}
|
|
5712
|
-
setClipboardPayload(
|
|
5818
|
+
setClipboardPayload(chunkYDEEINER_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5713
5819
|
};
|
|
5714
5820
|
const handleDelete = () => {
|
|
5715
5821
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5726,7 +5832,7 @@ function useClipboardHandlers(input) {
|
|
|
5726
5832
|
handleDelete();
|
|
5727
5833
|
};
|
|
5728
5834
|
const insertClone = (source) => {
|
|
5729
|
-
const clone =
|
|
5835
|
+
const clone = chunkYDEEINER_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5730
5836
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5731
5837
|
ops.applySelection(clone.id);
|
|
5732
5838
|
history.markDirty();
|
|
@@ -5761,7 +5867,7 @@ function resolveShapePath(el) {
|
|
|
5761
5867
|
return el.pathData;
|
|
5762
5868
|
}
|
|
5763
5869
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5764
|
-
const clipPath =
|
|
5870
|
+
const clipPath = chunkYDEEINER_js.getPresetShapeClipPath(el.shapeType);
|
|
5765
5871
|
if (clipPath) {
|
|
5766
5872
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5767
5873
|
if (svgPath) {
|
|
@@ -5812,7 +5918,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5812
5918
|
return parts.join(" ");
|
|
5813
5919
|
}
|
|
5814
5920
|
function transformPathToGlobal(pathData, el) {
|
|
5815
|
-
const polys =
|
|
5921
|
+
const polys = chunkYDEEINER_js.svgPathToPolygons(pathData);
|
|
5816
5922
|
if (polys.length === 0) {
|
|
5817
5923
|
return pathData;
|
|
5818
5924
|
}
|
|
@@ -5832,10 +5938,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5832
5938
|
y: pt.y * scaleY + el.y
|
|
5833
5939
|
}))
|
|
5834
5940
|
);
|
|
5835
|
-
return
|
|
5941
|
+
return chunkYDEEINER_js.polygonsToSvgPath(transformed);
|
|
5836
5942
|
}
|
|
5837
5943
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5838
|
-
const polys =
|
|
5944
|
+
const polys = chunkYDEEINER_js.svgPathToPolygons(pathData);
|
|
5839
5945
|
if (polys.length === 0) {
|
|
5840
5946
|
return pathData;
|
|
5841
5947
|
}
|
|
@@ -5845,10 +5951,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5845
5951
|
y: pt.y - y
|
|
5846
5952
|
}))
|
|
5847
5953
|
);
|
|
5848
|
-
return
|
|
5954
|
+
return chunkYDEEINER_js.polygonsToSvgPath(transformed);
|
|
5849
5955
|
}
|
|
5850
5956
|
function pathBounds(pathData) {
|
|
5851
|
-
const polys =
|
|
5957
|
+
const polys = chunkYDEEINER_js.svgPathToPolygons(pathData);
|
|
5852
5958
|
let minX = Infinity;
|
|
5853
5959
|
let minY = Infinity;
|
|
5854
5960
|
let maxX = -Infinity;
|
|
@@ -5907,7 +6013,7 @@ function useMergeShapesHandler(input) {
|
|
|
5907
6013
|
let allFragments = [];
|
|
5908
6014
|
let remaining = globalPaths[0];
|
|
5909
6015
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5910
|
-
const frags =
|
|
6016
|
+
const frags = chunkYDEEINER_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5911
6017
|
if (Array.isArray(frags)) {
|
|
5912
6018
|
allFragments = frags;
|
|
5913
6019
|
}
|
|
@@ -5936,7 +6042,7 @@ function useMergeShapesHandler(input) {
|
|
|
5936
6042
|
bounds.height
|
|
5937
6043
|
);
|
|
5938
6044
|
const newEl = {
|
|
5939
|
-
id:
|
|
6045
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5940
6046
|
type: "shape",
|
|
5941
6047
|
x: bounds.x,
|
|
5942
6048
|
y: bounds.y,
|
|
@@ -5974,7 +6080,7 @@ function useMergeShapesHandler(input) {
|
|
|
5974
6080
|
} else {
|
|
5975
6081
|
let resultPath = globalPaths[0];
|
|
5976
6082
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5977
|
-
const result =
|
|
6083
|
+
const result = chunkYDEEINER_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5978
6084
|
if (typeof result === "string") {
|
|
5979
6085
|
resultPath = result;
|
|
5980
6086
|
}
|
|
@@ -5995,7 +6101,7 @@ function useMergeShapesHandler(input) {
|
|
|
5995
6101
|
);
|
|
5996
6102
|
const primary = targets[0];
|
|
5997
6103
|
const newEl = {
|
|
5998
|
-
id:
|
|
6104
|
+
id: chunkYDEEINER_js.generateElementId(),
|
|
5999
6105
|
type: "shape",
|
|
6000
6106
|
x: bounds.x,
|
|
6001
6107
|
y: bounds.y,
|
|
@@ -6058,7 +6164,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6058
6164
|
if (ids.length < 2 || !activeSlide) {
|
|
6059
6165
|
return;
|
|
6060
6166
|
}
|
|
6061
|
-
const { elements, groupId } =
|
|
6167
|
+
const { elements, groupId } = chunkYDEEINER_js.groupElements(ops.activeElements, ids, chunkYDEEINER_js.generateElementId());
|
|
6062
6168
|
if (groupId === null) {
|
|
6063
6169
|
return;
|
|
6064
6170
|
}
|
|
@@ -6071,11 +6177,11 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6071
6177
|
return;
|
|
6072
6178
|
}
|
|
6073
6179
|
const group = selectedElement;
|
|
6074
|
-
const intoTemplate =
|
|
6180
|
+
const intoTemplate = chunkYDEEINER_js.isTemplateElementId(group.id);
|
|
6075
6181
|
const childIds = group.children.map(
|
|
6076
|
-
(child) => intoTemplate ?
|
|
6182
|
+
(child) => intoTemplate ? chunkYDEEINER_js.makeCloneId(true, child.id || group.id) : child.id || chunkYDEEINER_js.generateElementId()
|
|
6077
6183
|
);
|
|
6078
|
-
const { elements, childIds: usedIds } =
|
|
6184
|
+
const { elements, childIds: usedIds } = chunkYDEEINER_js.ungroupElements(
|
|
6079
6185
|
ops.activeElements,
|
|
6080
6186
|
group.id,
|
|
6081
6187
|
childIds,
|
|
@@ -6104,7 +6210,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6104
6210
|
if (!edge) {
|
|
6105
6211
|
return;
|
|
6106
6212
|
}
|
|
6107
|
-
const positions =
|
|
6213
|
+
const positions = chunkYDEEINER_js.alignElements(selectedElements, edge);
|
|
6108
6214
|
for (const [id, pos] of positions) {
|
|
6109
6215
|
const el = elementLookup.get(id);
|
|
6110
6216
|
if (!el) {
|
|
@@ -6122,7 +6228,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6122
6228
|
if (!distAxis) {
|
|
6123
6229
|
return;
|
|
6124
6230
|
}
|
|
6125
|
-
const positions =
|
|
6231
|
+
const positions = chunkYDEEINER_js.distributeElements(selectedElements, distAxis);
|
|
6126
6232
|
for (const [id, pos] of positions) {
|
|
6127
6233
|
const el = elementLookup.get(id);
|
|
6128
6234
|
if (!el) {
|
|
@@ -6139,7 +6245,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6139
6245
|
}
|
|
6140
6246
|
const id = selectedElement.id;
|
|
6141
6247
|
ops.updateActiveElements(
|
|
6142
|
-
(els) => direction === "forward" ?
|
|
6248
|
+
(els) => direction === "forward" ? chunkYDEEINER_js.bringForward(els, id) : direction === "backward" ? chunkYDEEINER_js.sendBackward(els, id) : els
|
|
6143
6249
|
);
|
|
6144
6250
|
history.markDirty();
|
|
6145
6251
|
};
|
|
@@ -6149,7 +6255,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6149
6255
|
}
|
|
6150
6256
|
const id = selectedElement.id;
|
|
6151
6257
|
ops.updateActiveElements(
|
|
6152
|
-
(els) => direction === "front" ?
|
|
6258
|
+
(els) => direction === "front" ? chunkYDEEINER_js.bringToFront(els, id) : chunkYDEEINER_js.sendToBack(els, id)
|
|
6153
6259
|
);
|
|
6154
6260
|
history.markDirty();
|
|
6155
6261
|
};
|
|
@@ -6280,7 +6386,7 @@ function useSlideManagement(input) {
|
|
|
6280
6386
|
theme
|
|
6281
6387
|
} = input;
|
|
6282
6388
|
const handleAddSlide = () => {
|
|
6283
|
-
const newSlide =
|
|
6389
|
+
const newSlide = chunkYDEEINER_js.createBlankSlide(slides.length + 1);
|
|
6284
6390
|
ops.updateSlides((prev) => {
|
|
6285
6391
|
const next = [...prev];
|
|
6286
6392
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6343,7 +6449,7 @@ function useSlideManagement(input) {
|
|
|
6343
6449
|
}
|
|
6344
6450
|
const clone = {
|
|
6345
6451
|
...src,
|
|
6346
|
-
id:
|
|
6452
|
+
id: chunkYDEEINER_js.makeSlideId(),
|
|
6347
6453
|
elements: src.elements.map((el) => ({
|
|
6348
6454
|
...el,
|
|
6349
6455
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6375,7 +6481,7 @@ function useSlideManagement(input) {
|
|
|
6375
6481
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6376
6482
|
const insertAt = activeSlideIndex + 1;
|
|
6377
6483
|
const draft = {
|
|
6378
|
-
...
|
|
6484
|
+
...chunkYDEEINER_js.createBlankSlide(slides.length + 1),
|
|
6379
6485
|
layoutPath,
|
|
6380
6486
|
...layoutName ? { layoutName } : {}
|
|
6381
6487
|
};
|
|
@@ -6408,9 +6514,9 @@ function useSlideManagement(input) {
|
|
|
6408
6514
|
};
|
|
6409
6515
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6410
6516
|
const insertAt = activeSlideIndex + 1;
|
|
6411
|
-
const draft =
|
|
6517
|
+
const draft = chunkYDEEINER_js.buildSlideTemplateSlide(templateId, chunkYDEEINER_js.makeSlideId(), slides.length + 1, {
|
|
6412
6518
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6413
|
-
scheme:
|
|
6519
|
+
scheme: chunkYDEEINER_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6414
6520
|
});
|
|
6415
6521
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6416
6522
|
setActiveSlideIndex(insertAt);
|
|
@@ -6447,7 +6553,7 @@ function createTableMergeHandlers(input) {
|
|
|
6447
6553
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6448
6554
|
return;
|
|
6449
6555
|
}
|
|
6450
|
-
const newTableData =
|
|
6556
|
+
const newTableData = chunkYDEEINER_js.mergeCells(
|
|
6451
6557
|
[
|
|
6452
6558
|
{ row: rowIndex, col: columnIndex },
|
|
6453
6559
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6455,7 +6561,7 @@ function createTableMergeHandlers(input) {
|
|
|
6455
6561
|
td
|
|
6456
6562
|
);
|
|
6457
6563
|
const updates = { tableData: newTableData };
|
|
6458
|
-
const newRawXml =
|
|
6564
|
+
const newRawXml = chunkYDEEINER_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6459
6565
|
if (newRawXml) {
|
|
6460
6566
|
updates.rawXml = newRawXml;
|
|
6461
6567
|
}
|
|
@@ -6481,7 +6587,7 @@ function createTableMergeHandlers(input) {
|
|
|
6481
6587
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6482
6588
|
return;
|
|
6483
6589
|
}
|
|
6484
|
-
const newTableData =
|
|
6590
|
+
const newTableData = chunkYDEEINER_js.mergeCells(
|
|
6485
6591
|
[
|
|
6486
6592
|
{ row: rowIndex, col: columnIndex },
|
|
6487
6593
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6489,7 +6595,7 @@ function createTableMergeHandlers(input) {
|
|
|
6489
6595
|
td
|
|
6490
6596
|
);
|
|
6491
6597
|
const updates = { tableData: newTableData };
|
|
6492
|
-
const newRawXml =
|
|
6598
|
+
const newRawXml = chunkYDEEINER_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6493
6599
|
if (newRawXml) {
|
|
6494
6600
|
updates.rawXml = newRawXml;
|
|
6495
6601
|
}
|
|
@@ -6504,9 +6610,9 @@ function createTableMergeHandlers(input) {
|
|
|
6504
6610
|
return;
|
|
6505
6611
|
}
|
|
6506
6612
|
const td = selectedElement.tableData;
|
|
6507
|
-
const newTableData =
|
|
6613
|
+
const newTableData = chunkYDEEINER_js.mergeCells(ts.selectedCells, td);
|
|
6508
6614
|
const updates = { tableData: newTableData };
|
|
6509
|
-
const newRawXml =
|
|
6615
|
+
const newRawXml = chunkYDEEINER_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6510
6616
|
if (newRawXml) {
|
|
6511
6617
|
updates.rawXml = newRawXml;
|
|
6512
6618
|
}
|
|
@@ -6523,9 +6629,9 @@ function createTableMergeHandlers(input) {
|
|
|
6523
6629
|
}
|
|
6524
6630
|
const { rowIndex, columnIndex } = ts;
|
|
6525
6631
|
const td = selectedElement.tableData;
|
|
6526
|
-
const newTableData =
|
|
6632
|
+
const newTableData = chunkYDEEINER_js.splitCell(rowIndex, columnIndex, td);
|
|
6527
6633
|
const updates = { tableData: newTableData };
|
|
6528
|
-
const newRawXml =
|
|
6634
|
+
const newRawXml = chunkYDEEINER_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6529
6635
|
if (newRawXml) {
|
|
6530
6636
|
updates.rawXml = newRawXml;
|
|
6531
6637
|
}
|
|
@@ -6559,10 +6665,10 @@ function createTableStructHandlers(input) {
|
|
|
6559
6665
|
const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
|
|
6560
6666
|
const updates = {};
|
|
6561
6667
|
if (el.tableData) {
|
|
6562
|
-
updates.tableData =
|
|
6668
|
+
updates.tableData = chunkYDEEINER_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6563
6669
|
}
|
|
6564
6670
|
if (el.rawXml) {
|
|
6565
|
-
const newRawXml =
|
|
6671
|
+
const newRawXml = chunkYDEEINER_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6566
6672
|
if (newRawXml) {
|
|
6567
6673
|
updates.rawXml = newRawXml;
|
|
6568
6674
|
}
|
|
@@ -6586,7 +6692,7 @@ function createTableStructHandlers(input) {
|
|
|
6586
6692
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6587
6693
|
const updates = {};
|
|
6588
6694
|
if (selectedElement.rawXml) {
|
|
6589
|
-
const newRawXml =
|
|
6695
|
+
const newRawXml = chunkYDEEINER_js.updateCellTextStyleInRawXml(
|
|
6590
6696
|
selectedElement,
|
|
6591
6697
|
rowIndex,
|
|
6592
6698
|
colIndex,
|
|
@@ -6650,9 +6756,9 @@ function createTableStructHandlers(input) {
|
|
|
6650
6756
|
return;
|
|
6651
6757
|
}
|
|
6652
6758
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6653
|
-
const newTableData =
|
|
6759
|
+
const newTableData = chunkYDEEINER_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6654
6760
|
const updates = { tableData: newTableData };
|
|
6655
|
-
const newRawXml =
|
|
6761
|
+
const newRawXml = chunkYDEEINER_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6656
6762
|
if (newRawXml) {
|
|
6657
6763
|
updates.rawXml = newRawXml;
|
|
6658
6764
|
}
|
|
@@ -6665,12 +6771,12 @@ function createTableStructHandlers(input) {
|
|
|
6665
6771
|
}
|
|
6666
6772
|
const td = selectedElement.tableData;
|
|
6667
6773
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6668
|
-
const newTableData =
|
|
6774
|
+
const newTableData = chunkYDEEINER_js.deleteTableRow(td, rowIdx);
|
|
6669
6775
|
if (newTableData === td) {
|
|
6670
6776
|
return;
|
|
6671
6777
|
}
|
|
6672
6778
|
const updates = { tableData: newTableData };
|
|
6673
|
-
const newRawXml =
|
|
6779
|
+
const newRawXml = chunkYDEEINER_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6674
6780
|
if (newRawXml) {
|
|
6675
6781
|
updates.rawXml = newRawXml;
|
|
6676
6782
|
}
|
|
@@ -6682,9 +6788,9 @@ function createTableStructHandlers(input) {
|
|
|
6682
6788
|
return;
|
|
6683
6789
|
}
|
|
6684
6790
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6685
|
-
const newTableData =
|
|
6791
|
+
const newTableData = chunkYDEEINER_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6686
6792
|
const updates = { tableData: newTableData };
|
|
6687
|
-
const newRawXml =
|
|
6793
|
+
const newRawXml = chunkYDEEINER_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6688
6794
|
if (newRawXml) {
|
|
6689
6795
|
updates.rawXml = newRawXml;
|
|
6690
6796
|
}
|
|
@@ -6697,12 +6803,12 @@ function createTableStructHandlers(input) {
|
|
|
6697
6803
|
}
|
|
6698
6804
|
const td = selectedElement.tableData;
|
|
6699
6805
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6700
|
-
const newTableData =
|
|
6806
|
+
const newTableData = chunkYDEEINER_js.deleteTableColumn(td, colIdx);
|
|
6701
6807
|
if (newTableData === td) {
|
|
6702
6808
|
return;
|
|
6703
6809
|
}
|
|
6704
6810
|
const updates = { tableData: newTableData };
|
|
6705
|
-
const newRawXml =
|
|
6811
|
+
const newRawXml = chunkYDEEINER_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6706
6812
|
if (newRawXml) {
|
|
6707
6813
|
updates.rawXml = newRawXml;
|
|
6708
6814
|
}
|
|
@@ -6738,8 +6844,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6738
6844
|
return html2canvasPro(element, {
|
|
6739
6845
|
...options,
|
|
6740
6846
|
onclone: async (doc, clonedEl) => {
|
|
6741
|
-
await
|
|
6742
|
-
|
|
6847
|
+
await chunkYDEEINER_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6848
|
+
chunkYDEEINER_js.preprocessCssForCapture(clonedEl);
|
|
6743
6849
|
if (typeof userOnClone === "function") {
|
|
6744
6850
|
userOnClone(doc, clonedEl);
|
|
6745
6851
|
}
|
|
@@ -6777,13 +6883,13 @@ function useExportSaveAs(input) {
|
|
|
6777
6883
|
if (!handler) {
|
|
6778
6884
|
return;
|
|
6779
6885
|
}
|
|
6780
|
-
const downloadName =
|
|
6886
|
+
const downloadName = chunkYDEEINER_js.savedPresentationFileName(filePath, format);
|
|
6781
6887
|
try {
|
|
6782
6888
|
const data = await buildSaveAsData(handler, format);
|
|
6783
6889
|
const blob = new Blob([data], {
|
|
6784
6890
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6785
6891
|
});
|
|
6786
|
-
|
|
6892
|
+
chunkYDEEINER_js.downloadBlob(blob, downloadName);
|
|
6787
6893
|
} catch (err) {
|
|
6788
6894
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
6789
6895
|
}
|
|
@@ -6796,18 +6902,18 @@ function useExportSaveAs(input) {
|
|
|
6796
6902
|
const pptxGuides = guides.map((g) => ({
|
|
6797
6903
|
id: g.id,
|
|
6798
6904
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
6799
|
-
positionEmu:
|
|
6905
|
+
positionEmu: chunkYDEEINER_js.guidePxToEmu(g.position)
|
|
6800
6906
|
}));
|
|
6801
6907
|
return {
|
|
6802
6908
|
...slide,
|
|
6803
6909
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
6804
6910
|
};
|
|
6805
6911
|
});
|
|
6806
|
-
const slidesToSave =
|
|
6912
|
+
const slidesToSave = chunkYDEEINER_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
6807
6913
|
const saveOptions = {
|
|
6808
6914
|
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
6809
6915
|
// a preset picked in the inspector reached one save path and not the other.
|
|
6810
|
-
slideSize:
|
|
6916
|
+
slideSize: chunkYDEEINER_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
6811
6917
|
headerFooter,
|
|
6812
6918
|
presentationProperties,
|
|
6813
6919
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -6821,13 +6927,13 @@ function useExportSaveAs(input) {
|
|
|
6821
6927
|
handoutMaster,
|
|
6822
6928
|
outputFormat: format
|
|
6823
6929
|
};
|
|
6824
|
-
return
|
|
6930
|
+
return chunkYDEEINER_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
6825
6931
|
};
|
|
6826
6932
|
const handleExportJson = () => {
|
|
6827
6933
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
6828
|
-
const slideSize =
|
|
6934
|
+
const slideSize = chunkYDEEINER_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
6829
6935
|
const data = {
|
|
6830
|
-
slides:
|
|
6936
|
+
slides: chunkYDEEINER_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
6831
6937
|
width: canvasSize.width,
|
|
6832
6938
|
height: canvasSize.height,
|
|
6833
6939
|
widthEmu: slideSize.widthEmu,
|
|
@@ -6846,7 +6952,7 @@ function useExportSaveAs(input) {
|
|
|
6846
6952
|
handoutMaster
|
|
6847
6953
|
};
|
|
6848
6954
|
try {
|
|
6849
|
-
|
|
6955
|
+
chunkYDEEINER_js.exportDeckJson(data, sourceName);
|
|
6850
6956
|
} catch (err) {
|
|
6851
6957
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
6852
6958
|
}
|
|
@@ -6933,7 +7039,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6933
7039
|
}
|
|
6934
7040
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6935
7041
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6936
|
-
|
|
7042
|
+
chunkYDEEINER_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6937
7043
|
}
|
|
6938
7044
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6939
7045
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6955,15 +7061,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6955
7061
|
continue;
|
|
6956
7062
|
}
|
|
6957
7063
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6958
|
-
images.push(
|
|
7064
|
+
images.push(chunkYDEEINER_js.canvasToJpegData(canvas));
|
|
6959
7065
|
}
|
|
6960
7066
|
onProgress?.(totalSlides, totalSlides);
|
|
6961
7067
|
setActiveSlide(currentSlideIndex);
|
|
6962
7068
|
if (images.length === 0) {
|
|
6963
7069
|
throw new Error(chunkSWRY3SI5_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6964
7070
|
}
|
|
6965
|
-
const pdfBlobUrl =
|
|
6966
|
-
|
|
7071
|
+
const pdfBlobUrl = chunkT2QG2HD5_js.buildPdfFromImageData(images);
|
|
7072
|
+
chunkYDEEINER_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6967
7073
|
}
|
|
6968
7074
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6969
7075
|
const { scale = 2, onProgress } = options;
|
|
@@ -7011,8 +7117,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7011
7117
|
if (pages.length === 0) {
|
|
7012
7118
|
throw new Error(chunkSWRY3SI5_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7013
7119
|
}
|
|
7014
|
-
const pdfDataUrl =
|
|
7015
|
-
|
|
7120
|
+
const pdfDataUrl = chunkT2QG2HD5_js.buildNotesPdf(pages);
|
|
7121
|
+
chunkYDEEINER_js.downloadDataUrl(pdfDataUrl, filename);
|
|
7016
7122
|
}
|
|
7017
7123
|
|
|
7018
7124
|
// src/viewer/utils/export-video.ts
|
|
@@ -7056,7 +7162,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7056
7162
|
const fps = 30;
|
|
7057
7163
|
const stream = recordingCanvas.captureStream(fps);
|
|
7058
7164
|
const recorder = new MediaRecorder(stream, {
|
|
7059
|
-
mimeType:
|
|
7165
|
+
mimeType: chunkYDEEINER_js.pickSupportedMimeType([...chunkYDEEINER_js.WEBM_MIME_CANDIDATES]),
|
|
7060
7166
|
videoBitsPerSecond: 5e6
|
|
7061
7167
|
});
|
|
7062
7168
|
const chunks = [];
|
|
@@ -7079,8 +7185,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7079
7185
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
7080
7186
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
7081
7187
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
7082
|
-
const frameInterval =
|
|
7083
|
-
const framesNeeded =
|
|
7188
|
+
const frameInterval = chunkYDEEINER_js.fpsToFrameIntervalMs(fps);
|
|
7189
|
+
const framesNeeded = chunkYDEEINER_js.segmentFrameCount(duration, fps);
|
|
7084
7190
|
for (let f = 0; f < framesNeeded; f++) {
|
|
7085
7191
|
if (signal?.aborted) {
|
|
7086
7192
|
recorder.stop();
|
|
@@ -7129,7 +7235,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7129
7235
|
if (frames.length === 0) {
|
|
7130
7236
|
throw new Error(chunkSWRY3SI5_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
7131
7237
|
}
|
|
7132
|
-
const gifBytes =
|
|
7238
|
+
const gifBytes = chunkYDEEINER_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
7133
7239
|
onProgress?.(totalSlides, totalSlides);
|
|
7134
7240
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
7135
7241
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -7183,7 +7289,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7183
7289
|
continue;
|
|
7184
7290
|
}
|
|
7185
7291
|
onProgress?.(processedCount, data.slides.length);
|
|
7186
|
-
let svg =
|
|
7292
|
+
let svg = chunkYDEEINER_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7187
7293
|
if (embedFonts && fontFaces?.length) {
|
|
7188
7294
|
svg = injectFontFaces(svg, fontFaces);
|
|
7189
7295
|
}
|
|
@@ -7292,21 +7398,21 @@ function useExportHandlers(input) {
|
|
|
7292
7398
|
{
|
|
7293
7399
|
scale: imageExportScale,
|
|
7294
7400
|
onProgress: (current, total) => {
|
|
7295
|
-
setExportProgress(
|
|
7296
|
-
setExportStatusMessage(
|
|
7401
|
+
setExportProgress(chunkYDEEINER_js.slideProgressPercent(current, total));
|
|
7402
|
+
setExportStatusMessage(chunkYDEEINER_js.slideStatusLabel("Rendering", current, total));
|
|
7297
7403
|
},
|
|
7298
7404
|
signal: abortCtrl.signal
|
|
7299
7405
|
}
|
|
7300
7406
|
);
|
|
7301
|
-
setExportProgress(
|
|
7407
|
+
setExportProgress(chunkYDEEINER_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7302
7408
|
setExportStatusMessage("Building PDF...");
|
|
7303
7409
|
await new Promise((r) => {
|
|
7304
7410
|
setTimeout(r, 100);
|
|
7305
7411
|
});
|
|
7306
|
-
setExportProgress(
|
|
7412
|
+
setExportProgress(chunkYDEEINER_js.EXPORT_DONE_PERCENT);
|
|
7307
7413
|
setExportStatusMessage("Done!");
|
|
7308
7414
|
} catch (err) {
|
|
7309
|
-
if (!
|
|
7415
|
+
if (!chunkYDEEINER_js.isExportAbortError(err)) {
|
|
7310
7416
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7311
7417
|
}
|
|
7312
7418
|
} finally {
|
|
@@ -7336,21 +7442,21 @@ function useExportHandlers(input) {
|
|
|
7336
7442
|
{
|
|
7337
7443
|
scale: imageExportScale,
|
|
7338
7444
|
onProgress: (current, total) => {
|
|
7339
|
-
setExportProgress(
|
|
7340
|
-
setExportStatusMessage(
|
|
7445
|
+
setExportProgress(chunkYDEEINER_js.slideProgressPercent(current, total));
|
|
7446
|
+
setExportStatusMessage(chunkYDEEINER_js.slideStatusLabel("Rendering", current, total));
|
|
7341
7447
|
},
|
|
7342
7448
|
signal: abortCtrl.signal
|
|
7343
7449
|
}
|
|
7344
7450
|
);
|
|
7345
|
-
setExportProgress(
|
|
7451
|
+
setExportProgress(chunkYDEEINER_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7346
7452
|
setExportStatusMessage("Building PDF...");
|
|
7347
7453
|
await new Promise((r) => {
|
|
7348
7454
|
setTimeout(r, 100);
|
|
7349
7455
|
});
|
|
7350
|
-
setExportProgress(
|
|
7456
|
+
setExportProgress(chunkYDEEINER_js.EXPORT_DONE_PERCENT);
|
|
7351
7457
|
setExportStatusMessage("Done!");
|
|
7352
7458
|
} catch (err) {
|
|
7353
|
-
if (!
|
|
7459
|
+
if (!chunkYDEEINER_js.isExportAbortError(err)) {
|
|
7354
7460
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7355
7461
|
}
|
|
7356
7462
|
} finally {
|
|
@@ -7392,22 +7498,22 @@ function useExportHandlers(input) {
|
|
|
7392
7498
|
scale: 1,
|
|
7393
7499
|
slideDurationMs: 3e3,
|
|
7394
7500
|
onProgress: (current, total) => {
|
|
7395
|
-
setExportProgress(
|
|
7396
|
-
setExportStatusMessage(
|
|
7501
|
+
setExportProgress(chunkYDEEINER_js.slideProgressPercent(current, total, 45));
|
|
7502
|
+
setExportStatusMessage(chunkYDEEINER_js.slideStatusLabel("Capturing", current, total));
|
|
7397
7503
|
},
|
|
7398
7504
|
onRecordProgress: (current, total) => {
|
|
7399
|
-
setExportProgress(
|
|
7400
|
-
setExportStatusMessage(
|
|
7505
|
+
setExportProgress(chunkYDEEINER_js.recordProgressPercent(current, total));
|
|
7506
|
+
setExportStatusMessage(chunkYDEEINER_js.slideStatusLabel("Recording", current, total));
|
|
7401
7507
|
},
|
|
7402
7508
|
signal: abortCtrl.signal
|
|
7403
7509
|
}
|
|
7404
7510
|
);
|
|
7405
|
-
setExportProgress(
|
|
7511
|
+
setExportProgress(chunkYDEEINER_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7406
7512
|
setExportStatusMessage("Saving file...");
|
|
7407
|
-
|
|
7408
|
-
setExportProgress(
|
|
7513
|
+
chunkYDEEINER_js.downloadBlob(blob, "presentation.webm");
|
|
7514
|
+
setExportProgress(chunkYDEEINER_js.EXPORT_DONE_PERCENT);
|
|
7409
7515
|
} catch (err) {
|
|
7410
|
-
if (!
|
|
7516
|
+
if (!chunkYDEEINER_js.isExportAbortError(err)) {
|
|
7411
7517
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7412
7518
|
}
|
|
7413
7519
|
} finally {
|
|
@@ -7435,18 +7541,18 @@ function useExportHandlers(input) {
|
|
|
7435
7541
|
scale: 0.5,
|
|
7436
7542
|
slideDurationMs: 2e3,
|
|
7437
7543
|
onProgress: (current, total) => {
|
|
7438
|
-
setExportProgress(
|
|
7439
|
-
setExportStatusMessage(
|
|
7544
|
+
setExportProgress(chunkYDEEINER_js.slideProgressPercent(current, total));
|
|
7545
|
+
setExportStatusMessage(chunkYDEEINER_js.slideStatusLabel("Encoding", current, total));
|
|
7440
7546
|
},
|
|
7441
7547
|
signal: abortCtrl.signal
|
|
7442
7548
|
}
|
|
7443
7549
|
);
|
|
7444
|
-
setExportProgress(
|
|
7550
|
+
setExportProgress(chunkYDEEINER_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7445
7551
|
setExportStatusMessage("Saving file...");
|
|
7446
|
-
|
|
7447
|
-
setExportProgress(
|
|
7552
|
+
chunkYDEEINER_js.downloadBlob(blob, "presentation.gif");
|
|
7553
|
+
setExportProgress(chunkYDEEINER_js.EXPORT_DONE_PERCENT);
|
|
7448
7554
|
} catch (err) {
|
|
7449
|
-
if (!
|
|
7555
|
+
if (!chunkYDEEINER_js.isExportAbortError(err)) {
|
|
7450
7556
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7451
7557
|
}
|
|
7452
7558
|
} finally {
|
|
@@ -7479,7 +7585,7 @@ function useExportHandlers(input) {
|
|
|
7479
7585
|
exportStatusMessage
|
|
7480
7586
|
};
|
|
7481
7587
|
}
|
|
7482
|
-
var ViewerOptionsContext = react.createContext(
|
|
7588
|
+
var ViewerOptionsContext = react.createContext(chunkYDEEINER_js.DEFAULT_VIEWER_OPTIONS);
|
|
7483
7589
|
function useViewerOptionsContext() {
|
|
7484
7590
|
return react.useContext(ViewerOptionsContext);
|
|
7485
7591
|
}
|
|
@@ -7491,13 +7597,13 @@ function usePrintHandlers(input) {
|
|
|
7491
7597
|
const { t } = reactI18next.useTranslation();
|
|
7492
7598
|
const viewerOptions = useViewerOptionsContext();
|
|
7493
7599
|
const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
|
|
7494
|
-
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) *
|
|
7600
|
+
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunkYDEEINER_js.resolveImageResolutionScale(viewerOptions);
|
|
7495
7601
|
const handlePrint = () => {
|
|
7496
7602
|
setIsPrintDialogOpen(true);
|
|
7497
7603
|
};
|
|
7498
7604
|
const handlePrintSvg = async (settings) => {
|
|
7499
7605
|
setIsPrintDialogOpen(false);
|
|
7500
|
-
const printWindow =
|
|
7606
|
+
const printWindow = chunkYDEEINER_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7501
7607
|
if (!printWindow) {
|
|
7502
7608
|
console.warn(
|
|
7503
7609
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7507,9 +7613,9 @@ function usePrintHandlers(input) {
|
|
|
7507
7613
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7508
7614
|
return runRasterPrint(printWindow, settings);
|
|
7509
7615
|
}
|
|
7510
|
-
const colorFilter =
|
|
7511
|
-
const slideIndices =
|
|
7512
|
-
|
|
7616
|
+
const colorFilter = chunkYDEEINER_js.computeColorFilter(settings.colorMode);
|
|
7617
|
+
const slideIndices = chunkYDEEINER_js.filterHiddenSlideIndices(
|
|
7618
|
+
chunkYDEEINER_js.computeSlideIndices(
|
|
7513
7619
|
settings.slideRange,
|
|
7514
7620
|
activeSlideIndex,
|
|
7515
7621
|
slides.length,
|
|
@@ -7527,22 +7633,22 @@ function usePrintHandlers(input) {
|
|
|
7527
7633
|
printWindow.close();
|
|
7528
7634
|
return;
|
|
7529
7635
|
}
|
|
7530
|
-
const printDoc =
|
|
7636
|
+
const printDoc = chunkYDEEINER_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7531
7637
|
title: "Slides (Vector)",
|
|
7532
7638
|
orientation: settings.orientation,
|
|
7533
7639
|
colorFilter,
|
|
7534
7640
|
scaleToFit: settings.scaleToFit
|
|
7535
7641
|
});
|
|
7536
|
-
|
|
7642
|
+
chunkYDEEINER_js.finishPrintWindow(printWindow, printDoc);
|
|
7537
7643
|
} catch (err) {
|
|
7538
7644
|
console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
|
|
7539
7645
|
return runRasterPrint(printWindow, settings);
|
|
7540
7646
|
}
|
|
7541
7647
|
};
|
|
7542
7648
|
const runRasterPrint = async (printWindow, settings) => {
|
|
7543
|
-
const colorFilter =
|
|
7544
|
-
const slideIndices =
|
|
7545
|
-
|
|
7649
|
+
const colorFilter = chunkYDEEINER_js.computeColorFilter(settings.colorMode);
|
|
7650
|
+
const slideIndices = chunkYDEEINER_js.filterHiddenSlideIndices(
|
|
7651
|
+
chunkYDEEINER_js.computeSlideIndices(
|
|
7546
7652
|
settings.slideRange,
|
|
7547
7653
|
activeSlideIndex,
|
|
7548
7654
|
slides.length,
|
|
@@ -7553,11 +7659,11 @@ function usePrintHandlers(input) {
|
|
|
7553
7659
|
includeHiddenSlides
|
|
7554
7660
|
);
|
|
7555
7661
|
if (settings.printWhat === "outline") {
|
|
7556
|
-
|
|
7662
|
+
chunkYDEEINER_js.finishPrintWindow(
|
|
7557
7663
|
printWindow,
|
|
7558
|
-
|
|
7664
|
+
chunkYDEEINER_js.buildPrintHtmlDocument({
|
|
7559
7665
|
title: "Outline",
|
|
7560
|
-
bodyHtml: `<div class="outline-page">${
|
|
7666
|
+
bodyHtml: `<div class="outline-page">${chunkYDEEINER_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7561
7667
|
orientation: settings.orientation,
|
|
7562
7668
|
colorFilter,
|
|
7563
7669
|
frameSlides: settings.frameSlides,
|
|
@@ -7584,11 +7690,11 @@ function usePrintHandlers(input) {
|
|
|
7584
7690
|
}
|
|
7585
7691
|
const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
|
|
7586
7692
|
if (settings.printWhat === "slides") {
|
|
7587
|
-
|
|
7693
|
+
chunkYDEEINER_js.finishPrintWindow(
|
|
7588
7694
|
printWindow,
|
|
7589
|
-
|
|
7695
|
+
chunkYDEEINER_js.buildPrintHtmlDocument({
|
|
7590
7696
|
title: "Slides",
|
|
7591
|
-
bodyHtml:
|
|
7697
|
+
bodyHtml: chunkYDEEINER_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7592
7698
|
orientation: settings.orientation,
|
|
7593
7699
|
colorFilter,
|
|
7594
7700
|
frameSlides: settings.frameSlides,
|
|
@@ -7598,11 +7704,11 @@ function usePrintHandlers(input) {
|
|
|
7598
7704
|
return;
|
|
7599
7705
|
}
|
|
7600
7706
|
if (settings.printWhat === "notes") {
|
|
7601
|
-
|
|
7707
|
+
chunkYDEEINER_js.finishPrintWindow(
|
|
7602
7708
|
printWindow,
|
|
7603
|
-
|
|
7709
|
+
chunkYDEEINER_js.buildPrintHtmlDocument({
|
|
7604
7710
|
title: "Notes Pages",
|
|
7605
|
-
bodyHtml:
|
|
7711
|
+
bodyHtml: chunkYDEEINER_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7606
7712
|
orientation: "portrait",
|
|
7607
7713
|
colorFilter,
|
|
7608
7714
|
frameSlides: settings.frameSlides,
|
|
@@ -7613,11 +7719,11 @@ function usePrintHandlers(input) {
|
|
|
7613
7719
|
}
|
|
7614
7720
|
if (settings.printWhat === "handouts") {
|
|
7615
7721
|
const spp = settings.slidesPerPage;
|
|
7616
|
-
|
|
7722
|
+
chunkYDEEINER_js.finishPrintWindow(
|
|
7617
7723
|
printWindow,
|
|
7618
|
-
|
|
7724
|
+
chunkYDEEINER_js.buildPrintHtmlDocument({
|
|
7619
7725
|
title: `Handout ${spp} per page`,
|
|
7620
|
-
bodyHtml:
|
|
7726
|
+
bodyHtml: chunkYDEEINER_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7621
7727
|
orientation: "portrait",
|
|
7622
7728
|
colorFilter,
|
|
7623
7729
|
frameSlides: settings.frameSlides,
|
|
@@ -7631,7 +7737,7 @@ function usePrintHandlers(input) {
|
|
|
7631
7737
|
};
|
|
7632
7738
|
const handlePrintWithSettings = async (settings) => {
|
|
7633
7739
|
setIsPrintDialogOpen(false);
|
|
7634
|
-
const printWindow =
|
|
7740
|
+
const printWindow = chunkYDEEINER_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7635
7741
|
if (!printWindow) {
|
|
7636
7742
|
console.warn(
|
|
7637
7743
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7694,8 +7800,8 @@ function useThemeHandlers(input) {
|
|
|
7694
7800
|
return;
|
|
7695
7801
|
}
|
|
7696
7802
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7697
|
-
const previousMap = theme?.colorScheme ?
|
|
7698
|
-
setSlides((prev) =>
|
|
7803
|
+
const previousMap = theme?.colorScheme ? chunkYDEEINER_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7804
|
+
setSlides((prev) => chunkYDEEINER_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7699
7805
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7700
7806
|
bumpHistory();
|
|
7701
7807
|
history.markDirty();
|
|
@@ -7800,7 +7906,7 @@ function useThemeSwitching(input) {
|
|
|
7800
7906
|
}
|
|
7801
7907
|
try {
|
|
7802
7908
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7803
|
-
const newData =
|
|
7909
|
+
const newData = chunkYDEEINER_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7804
7910
|
onDataChange(newData);
|
|
7805
7911
|
onThemeChanged?.(preset);
|
|
7806
7912
|
} catch (error) {
|
|
@@ -7817,7 +7923,7 @@ function useThemeSwitching(input) {
|
|
|
7817
7923
|
}
|
|
7818
7924
|
try {
|
|
7819
7925
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7820
|
-
const newData =
|
|
7926
|
+
const newData = chunkYDEEINER_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7821
7927
|
onDataChange(newData);
|
|
7822
7928
|
} catch (error) {
|
|
7823
7929
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7829,12 +7935,12 @@ function useThemeSwitching(input) {
|
|
|
7829
7935
|
if (!data?.theme?.colorScheme) {
|
|
7830
7936
|
return void 0;
|
|
7831
7937
|
}
|
|
7832
|
-
return
|
|
7833
|
-
(p) =>
|
|
7938
|
+
return chunkYDEEINER_js.THEME_PRESETS.find(
|
|
7939
|
+
(p) => chunkYDEEINER_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7834
7940
|
);
|
|
7835
7941
|
}, [data?.theme?.colorScheme]);
|
|
7836
7942
|
return {
|
|
7837
|
-
presets:
|
|
7943
|
+
presets: chunkYDEEINER_js.THEME_PRESETS,
|
|
7838
7944
|
switchToPreset,
|
|
7839
7945
|
switchToCustom,
|
|
7840
7946
|
currentPreset
|
|
@@ -7909,7 +8015,7 @@ function usePropertyHandlers(input) {
|
|
|
7909
8015
|
}
|
|
7910
8016
|
try {
|
|
7911
8017
|
const ab = await file.arrayBuffer();
|
|
7912
|
-
const h = new
|
|
8018
|
+
const h = new chunkYDEEINER_js.PptxHandler();
|
|
7913
8019
|
const other = await h.load(ab);
|
|
7914
8020
|
if (!other) {
|
|
7915
8021
|
return;
|
|
@@ -7919,7 +8025,7 @@ function usePropertyHandlers(input) {
|
|
|
7919
8025
|
width: canvasSize.width,
|
|
7920
8026
|
height: canvasSize.height
|
|
7921
8027
|
};
|
|
7922
|
-
setCompareResult(
|
|
8028
|
+
setCompareResult(chunkYDEEINER_js.comparePresentation(cur, other));
|
|
7923
8029
|
setIsComparePanelOpen(true);
|
|
7924
8030
|
} catch (err) {
|
|
7925
8031
|
console.warn("Compare failed:", err);
|
|
@@ -7936,7 +8042,7 @@ function usePropertyHandlers(input) {
|
|
|
7936
8042
|
if (!diff || diff.status === "unchanged") {
|
|
7937
8043
|
return;
|
|
7938
8044
|
}
|
|
7939
|
-
setSlides((prev) =>
|
|
8045
|
+
setSlides((prev) => chunkYDEEINER_js.applyAcceptSlide(prev, diff));
|
|
7940
8046
|
setIsDirty(true);
|
|
7941
8047
|
},
|
|
7942
8048
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7947,10 +8053,10 @@ function usePropertyHandlers(input) {
|
|
|
7947
8053
|
if (!compareResult) {
|
|
7948
8054
|
return;
|
|
7949
8055
|
}
|
|
7950
|
-
setSlides((prev) =>
|
|
8056
|
+
setSlides((prev) => chunkYDEEINER_js.applyAcceptAllSlides(prev, compareResult));
|
|
7951
8057
|
setIsDirty(true);
|
|
7952
8058
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7953
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
8059
|
+
const usedFontFamilies = react.useMemo(() => chunkYDEEINER_js.collectUsedFonts(slides), [slides]);
|
|
7954
8060
|
return {
|
|
7955
8061
|
handleUpdateNotes,
|
|
7956
8062
|
handleUpdateSlide,
|
|
@@ -8105,7 +8211,7 @@ function useViewerDialogs(input) {
|
|
|
8105
8211
|
);
|
|
8106
8212
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8107
8213
|
const fontEmbedding = react.useMemo(
|
|
8108
|
-
() =>
|
|
8214
|
+
() => chunkYDEEINER_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8109
8215
|
[embeddedFontKey]
|
|
8110
8216
|
);
|
|
8111
8217
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8115,11 +8221,11 @@ function useViewerDialogs(input) {
|
|
|
8115
8221
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8116
8222
|
}
|
|
8117
8223
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8118
|
-
() => typeof window !== "undefined" ?
|
|
8224
|
+
() => typeof window !== "undefined" ? chunkYDEEINER_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8119
8225
|
);
|
|
8120
8226
|
react.useEffect(() => {
|
|
8121
8227
|
const handleWindow = () => setIsNarrowViewport(
|
|
8122
|
-
|
|
8228
|
+
chunkYDEEINER_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8123
8229
|
);
|
|
8124
8230
|
window.addEventListener("resize", handleWindow);
|
|
8125
8231
|
return () => window.removeEventListener("resize", handleWindow);
|
|
@@ -8272,15 +8378,15 @@ function useViewerDialogs(input) {
|
|
|
8272
8378
|
};
|
|
8273
8379
|
}
|
|
8274
8380
|
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8275
|
-
return
|
|
8381
|
+
return chunkYDEEINER_js.computeGridSpacingPx(documentGridSpacing, chunkT2QG2HD5_js.GRID_SIZE);
|
|
8276
8382
|
}
|
|
8277
8383
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8278
8384
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8279
|
-
return
|
|
8385
|
+
return chunkYDEEINER_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8280
8386
|
}
|
|
8281
8387
|
function computeSlideSectionGroups(slides, sections) {
|
|
8282
|
-
return
|
|
8283
|
-
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),
|
|
8284
8390
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8285
8391
|
slideIndexes: group.slideIndexes,
|
|
8286
8392
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8292,7 +8398,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8292
8398
|
return void 0;
|
|
8293
8399
|
}
|
|
8294
8400
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8295
|
-
return
|
|
8401
|
+
return chunkYDEEINER_js.masterViewPseudoSlide(document2, {
|
|
8296
8402
|
tab: "slides",
|
|
8297
8403
|
masterIndex: 0,
|
|
8298
8404
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8320,10 +8426,10 @@ function useDerivedSlideState(input) {
|
|
|
8320
8426
|
);
|
|
8321
8427
|
const slideSectionGroups = react.useMemo(
|
|
8322
8428
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8323
|
-
if (group.id ===
|
|
8429
|
+
if (group.id === chunkT2QG2HD5_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8324
8430
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8325
8431
|
}
|
|
8326
|
-
if (group.id ===
|
|
8432
|
+
if (group.id === chunkT2QG2HD5_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8327
8433
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8328
8434
|
}
|
|
8329
8435
|
return group;
|
|
@@ -8423,13 +8529,13 @@ function useAnnotationHandlers(input) {
|
|
|
8423
8529
|
}, [annotations, setMode, setSlides, history]);
|
|
8424
8530
|
const handleSetMode = react.useCallback(
|
|
8425
8531
|
(nextMode) => {
|
|
8426
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8532
|
+
if (mode === "present" && nextMode !== "present" && !chunkYDEEINER_js.mayLeaveSlideShow()) {
|
|
8427
8533
|
return;
|
|
8428
8534
|
}
|
|
8429
8535
|
if (nextMode === "present") {
|
|
8430
8536
|
presentation.enterPresentMode();
|
|
8431
8537
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8432
|
-
|
|
8538
|
+
chunkYDEEINER_js.stopAllPersistentAudio();
|
|
8433
8539
|
if (promptKeepInkAnnotations) {
|
|
8434
8540
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8435
8541
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8439,7 +8545,7 @@ function useAnnotationHandlers(input) {
|
|
|
8439
8545
|
}
|
|
8440
8546
|
} else {
|
|
8441
8547
|
if (mode === "present") {
|
|
8442
|
-
|
|
8548
|
+
chunkYDEEINER_js.stopAllPersistentAudio();
|
|
8443
8549
|
}
|
|
8444
8550
|
setMode(nextMode);
|
|
8445
8551
|
}
|
|
@@ -8503,13 +8609,13 @@ function useSerialize(input) {
|
|
|
8503
8609
|
let processedSlide = slide;
|
|
8504
8610
|
if (pendingEditId) {
|
|
8505
8611
|
const updatedElements = slide.elements.map((el) => {
|
|
8506
|
-
if (el.id !== pendingEditId || !
|
|
8612
|
+
if (el.id !== pendingEditId || !chunkYDEEINER_js.hasTextProperties(el)) {
|
|
8507
8613
|
return el;
|
|
8508
8614
|
}
|
|
8509
8615
|
return {
|
|
8510
8616
|
...el,
|
|
8511
8617
|
text: pendingEditText,
|
|
8512
|
-
textSegments:
|
|
8618
|
+
textSegments: chunkYDEEINER_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8513
8619
|
};
|
|
8514
8620
|
});
|
|
8515
8621
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8522,19 +8628,19 @@ function useSerialize(input) {
|
|
|
8522
8628
|
const pptxGuides = guides.map((g) => ({
|
|
8523
8629
|
id: g.id,
|
|
8524
8630
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8525
|
-
positionEmu:
|
|
8631
|
+
positionEmu: chunkYDEEINER_js.guidePxToEmu(g.position)
|
|
8526
8632
|
}));
|
|
8527
8633
|
return {
|
|
8528
8634
|
...processedSlide,
|
|
8529
8635
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8530
8636
|
};
|
|
8531
8637
|
});
|
|
8532
|
-
const slidesToSave =
|
|
8638
|
+
const slidesToSave = chunkYDEEINER_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8533
8639
|
const saveOptions = {
|
|
8534
8640
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8535
8641
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8536
8642
|
// slide-size edit reaches the file.
|
|
8537
|
-
slideSize:
|
|
8643
|
+
slideSize: chunkYDEEINER_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8538
8644
|
headerFooter,
|
|
8539
8645
|
presentationProperties,
|
|
8540
8646
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -8546,9 +8652,9 @@ function useSerialize(input) {
|
|
|
8546
8652
|
slideMasters,
|
|
8547
8653
|
notesMaster,
|
|
8548
8654
|
handoutMaster,
|
|
8549
|
-
...
|
|
8655
|
+
...chunkYDEEINER_js.embeddedFontSaveOptions(embedFonts)
|
|
8550
8656
|
};
|
|
8551
|
-
return
|
|
8657
|
+
return chunkYDEEINER_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8552
8658
|
}, [
|
|
8553
8659
|
slides,
|
|
8554
8660
|
templateElementsBySlideId,
|
|
@@ -8583,7 +8689,7 @@ function useRecoveryDetection(input) {
|
|
|
8583
8689
|
const onRestore = input.onRestore;
|
|
8584
8690
|
const openVersionHistory = input.openVersionHistory;
|
|
8585
8691
|
react.useEffect(() => {
|
|
8586
|
-
if (!
|
|
8692
|
+
if (!chunkYDEEINER_js.shouldProbeAutosaveRecovery({
|
|
8587
8693
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8588
8694
|
filePath,
|
|
8589
8695
|
loading,
|
|
@@ -8595,7 +8701,7 @@ function useRecoveryDetection(input) {
|
|
|
8595
8701
|
}
|
|
8596
8702
|
recoveryCheckedRef.current = true;
|
|
8597
8703
|
void (async () => {
|
|
8598
|
-
const offer = await
|
|
8704
|
+
const offer = await chunkYDEEINER_js.probeAutosaveRecovery(filePath);
|
|
8599
8705
|
if (!offer) {
|
|
8600
8706
|
return;
|
|
8601
8707
|
}
|
|
@@ -8608,7 +8714,7 @@ function useRecoveryDetection(input) {
|
|
|
8608
8714
|
const record = recordRef.current;
|
|
8609
8715
|
setPrompt(null);
|
|
8610
8716
|
if (record && onRestore) {
|
|
8611
|
-
onRestore(
|
|
8717
|
+
onRestore(chunkYDEEINER_js.acceptAutosaveRecovery(record));
|
|
8612
8718
|
}
|
|
8613
8719
|
recordRef.current = null;
|
|
8614
8720
|
}, [onRestore]);
|
|
@@ -8617,7 +8723,7 @@ function useRecoveryDetection(input) {
|
|
|
8617
8723
|
setPrompt(null);
|
|
8618
8724
|
recordRef.current = null;
|
|
8619
8725
|
if (record) {
|
|
8620
|
-
void
|
|
8726
|
+
void chunkYDEEINER_js.discardAutosaveRecovery(record);
|
|
8621
8727
|
}
|
|
8622
8728
|
}, []);
|
|
8623
8729
|
return { prompt, restore, discard };
|
|
@@ -8656,11 +8762,11 @@ function usePresentationSetup(input) {
|
|
|
8656
8762
|
containerRef,
|
|
8657
8763
|
content,
|
|
8658
8764
|
onSetMode: (nextMode) => {
|
|
8659
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8765
|
+
if (mode === "present" && nextMode !== "present" && !chunkYDEEINER_js.mayLeaveSlideShow()) {
|
|
8660
8766
|
return;
|
|
8661
8767
|
}
|
|
8662
8768
|
if (mode === "present" && nextMode !== "present") {
|
|
8663
|
-
|
|
8769
|
+
chunkYDEEINER_js.stopAllPersistentAudio();
|
|
8664
8770
|
stopAnimationSound();
|
|
8665
8771
|
const exitHandler = exitModeHandlerRef.current;
|
|
8666
8772
|
if (exitHandler) {
|
|
@@ -8722,10 +8828,10 @@ function usePresentationSetup(input) {
|
|
|
8722
8828
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8723
8829
|
onToggleSubtitles,
|
|
8724
8830
|
onSaveRehearsalTimings: (timings) => {
|
|
8725
|
-
setSlides((prev) =>
|
|
8831
|
+
setSlides((prev) => chunkYDEEINER_js.applyRehearsalTimings(prev, timings));
|
|
8726
8832
|
history.markDirty();
|
|
8727
8833
|
},
|
|
8728
|
-
loopContinuously:
|
|
8834
|
+
loopContinuously: chunkYDEEINER_js.shouldLoopContinuously(presentationProperties),
|
|
8729
8835
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8730
8836
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8731
8837
|
endWithBlackSlide
|
|
@@ -8926,7 +9032,7 @@ function useEditorOperations(input) {
|
|
|
8926
9032
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
8927
9033
|
react.useEffect(() => {
|
|
8928
9034
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
8929
|
-
copiedFormatRef.current =
|
|
9035
|
+
copiedFormatRef.current = chunkYDEEINER_js.copyFormatFromElement(selectedElement);
|
|
8930
9036
|
} else if (!formatPainterActive) {
|
|
8931
9037
|
copiedFormatRef.current = null;
|
|
8932
9038
|
}
|
|
@@ -8952,12 +9058,12 @@ function useEditorOperations(input) {
|
|
|
8952
9058
|
e.stopPropagation();
|
|
8953
9059
|
const element = elementLookup.get(elementId);
|
|
8954
9060
|
if (element) {
|
|
8955
|
-
const updated =
|
|
9061
|
+
const updated = chunkYDEEINER_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
8956
9062
|
const updates = {};
|
|
8957
|
-
if (
|
|
9063
|
+
if (chunkYDEEINER_js.hasShapeProperties(updated)) {
|
|
8958
9064
|
updates.shapeStyle = updated.shapeStyle;
|
|
8959
9065
|
}
|
|
8960
|
-
if (
|
|
9066
|
+
if (chunkYDEEINER_js.hasTextProperties(updated)) {
|
|
8961
9067
|
updates.textStyle = updated.textStyle;
|
|
8962
9068
|
}
|
|
8963
9069
|
ops.updateElementById(elementId, updates);
|
|
@@ -9111,7 +9217,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9111
9217
|
const families = /* @__PURE__ */ new Set();
|
|
9112
9218
|
for (const slide of slides) {
|
|
9113
9219
|
for (const el of slide.elements) {
|
|
9114
|
-
if (
|
|
9220
|
+
if (chunkYDEEINER_js.hasTextProperties(el) && el.textSegments) {
|
|
9115
9221
|
for (const seg of el.textSegments) {
|
|
9116
9222
|
if (seg.style.fontFamily) {
|
|
9117
9223
|
families.add(seg.style.fontFamily);
|
|
@@ -9361,7 +9467,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9361
9467
|
inputRef.current = input;
|
|
9362
9468
|
const handleKeyDown = react.useCallback((e) => {
|
|
9363
9469
|
const current = inputRef.current;
|
|
9364
|
-
const { action, dx, dy } =
|
|
9470
|
+
const { action, dx, dy } = chunkYDEEINER_js.mapEditorKey(e, {
|
|
9365
9471
|
canEdit: current.canEdit,
|
|
9366
9472
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9367
9473
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9374,7 +9480,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9374
9480
|
hasSelection: current.hasSelection,
|
|
9375
9481
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9376
9482
|
isDrawing: current.activeTool !== "select",
|
|
9377
|
-
isTextInputTarget:
|
|
9483
|
+
isTextInputTarget: chunkYDEEINER_js.isEditorTextInputTarget(e.target)
|
|
9378
9484
|
});
|
|
9379
9485
|
if (action === null) {
|
|
9380
9486
|
return;
|
|
@@ -9685,7 +9791,7 @@ function useViewerIntegration(input) {
|
|
|
9685
9791
|
return zoom.scale;
|
|
9686
9792
|
},
|
|
9687
9793
|
setZoom(level) {
|
|
9688
|
-
zoom.setScale(
|
|
9794
|
+
zoom.setScale(chunkYDEEINER_js.clampZoomScale(level));
|
|
9689
9795
|
},
|
|
9690
9796
|
zoomIn() {
|
|
9691
9797
|
zoom.handleZoomIn();
|
|
@@ -9901,7 +10007,7 @@ function useReducedMotion() {
|
|
|
9901
10007
|
}
|
|
9902
10008
|
function useViewerOptions() {
|
|
9903
10009
|
const storeRef = react.useRef(null);
|
|
9904
|
-
storeRef.current ??=
|
|
10010
|
+
storeRef.current ??= chunkYDEEINER_js.createViewerOptionsStore();
|
|
9905
10011
|
const store = storeRef.current;
|
|
9906
10012
|
const options = react.useSyncExternalStore(
|
|
9907
10013
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9910,9 +10016,9 @@ function useViewerOptions() {
|
|
|
9910
10016
|
);
|
|
9911
10017
|
return { optionsStore: store, options };
|
|
9912
10018
|
}
|
|
9913
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10019
|
+
var KNOWN_TAB_IDS = new Set(chunkYDEEINER_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9914
10020
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
9915
|
-
const isHidden = (id) =>
|
|
10021
|
+
const isHidden = (id) => chunkYDEEINER_js.isActionHidden(id, hiddenActions);
|
|
9916
10022
|
const userHidden = new Set(hiddenTabIds);
|
|
9917
10023
|
userHidden.delete("file");
|
|
9918
10024
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
|
|
@@ -10004,12 +10110,12 @@ function useYjsDocumentSync({
|
|
|
10004
10110
|
return;
|
|
10005
10111
|
}
|
|
10006
10112
|
try {
|
|
10007
|
-
const handler = new
|
|
10113
|
+
const handler = new chunkYDEEINER_js.PptxHandler();
|
|
10008
10114
|
await handler.load(sourceBytes.buffer);
|
|
10009
|
-
const currentSlides =
|
|
10115
|
+
const currentSlides = chunkYDEEINER_js.readSlidesFromYDoc(
|
|
10010
10116
|
doc
|
|
10011
10117
|
);
|
|
10012
|
-
const slidesToSave =
|
|
10118
|
+
const slidesToSave = chunkYDEEINER_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10013
10119
|
const bytes = await handler.save(slidesToSave);
|
|
10014
10120
|
config.onWriteBack(bytes);
|
|
10015
10121
|
} catch {
|
|
@@ -10024,10 +10130,10 @@ function useYjsDocumentSync({
|
|
|
10024
10130
|
if (!doc || !isConnected) {
|
|
10025
10131
|
return;
|
|
10026
10132
|
}
|
|
10027
|
-
const docSlides =
|
|
10133
|
+
const docSlides = chunkYDEEINER_js.readSlidesFromYDoc(
|
|
10028
10134
|
doc
|
|
10029
10135
|
);
|
|
10030
|
-
if (!
|
|
10136
|
+
if (!chunkYDEEINER_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10031
10137
|
return;
|
|
10032
10138
|
}
|
|
10033
10139
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10046,11 +10152,11 @@ function useYjsDocumentSync({
|
|
|
10046
10152
|
lastSyncedRef.current = serialized;
|
|
10047
10153
|
void (async () => {
|
|
10048
10154
|
const factories = await getFactories();
|
|
10049
|
-
|
|
10155
|
+
chunkYDEEINER_js.reconcileSlidesInYDoc(
|
|
10050
10156
|
slides,
|
|
10051
10157
|
doc,
|
|
10052
10158
|
factories,
|
|
10053
|
-
|
|
10159
|
+
chunkYDEEINER_js.LOCAL_SYNC_ORIGIN
|
|
10054
10160
|
);
|
|
10055
10161
|
scheduleWriteBack();
|
|
10056
10162
|
})();
|
|
@@ -10064,10 +10170,10 @@ function useYjsDocumentSync({
|
|
|
10064
10170
|
return;
|
|
10065
10171
|
}
|
|
10066
10172
|
const handleChange = (_events, transaction) => {
|
|
10067
|
-
if (transaction?.origin ===
|
|
10173
|
+
if (transaction?.origin === chunkYDEEINER_js.LOCAL_SYNC_ORIGIN) {
|
|
10068
10174
|
return;
|
|
10069
10175
|
}
|
|
10070
|
-
const remoteSlides =
|
|
10176
|
+
const remoteSlides = chunkYDEEINER_js.readSlidesFromYDoc(
|
|
10071
10177
|
doc
|
|
10072
10178
|
);
|
|
10073
10179
|
if (remoteSlides.length === 0) {
|
|
@@ -10083,7 +10189,7 @@ function useYjsDocumentSync({
|
|
|
10083
10189
|
isApplyingRemoteRef.current = false;
|
|
10084
10190
|
scheduleWriteBack();
|
|
10085
10191
|
};
|
|
10086
|
-
const unobserve =
|
|
10192
|
+
const unobserve = chunkYDEEINER_js.observeYDocSlides(
|
|
10087
10193
|
doc,
|
|
10088
10194
|
handleChange
|
|
10089
10195
|
);
|
|
@@ -10121,7 +10227,7 @@ function useBroadcastFollower({
|
|
|
10121
10227
|
if (!broadcaster) {
|
|
10122
10228
|
return;
|
|
10123
10229
|
}
|
|
10124
|
-
if (!
|
|
10230
|
+
if (!chunkYDEEINER_js.shouldAutoFollowBroadcaster({
|
|
10125
10231
|
localRole: collab.config.role,
|
|
10126
10232
|
broadcasterRole: broadcaster.role
|
|
10127
10233
|
})) {
|
|
@@ -10292,7 +10398,7 @@ function subscribeTouchCapability(callback) {
|
|
|
10292
10398
|
function useIsMobile() {
|
|
10293
10399
|
const isTouchDevice = react.useSyncExternalStore(
|
|
10294
10400
|
subscribeTouchCapability,
|
|
10295
|
-
|
|
10401
|
+
chunkYDEEINER_js.detectTouchDevice,
|
|
10296
10402
|
() => false
|
|
10297
10403
|
// server snapshot
|
|
10298
10404
|
);
|
|
@@ -10302,7 +10408,7 @@ function useIsMobile() {
|
|
|
10302
10408
|
const [viewportHeight, setViewportHeight] = react.useState(
|
|
10303
10409
|
() => typeof window === "undefined" ? 768 : window.innerHeight
|
|
10304
10410
|
);
|
|
10305
|
-
const [orientation, setOrientation] = react.useState(
|
|
10411
|
+
const [orientation, setOrientation] = react.useState(chunkYDEEINER_js.detectOrientation);
|
|
10306
10412
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
10307
10413
|
const [initialViewportHeight] = react.useState(
|
|
10308
10414
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -10323,7 +10429,7 @@ function useIsMobile() {
|
|
|
10323
10429
|
return;
|
|
10324
10430
|
}
|
|
10325
10431
|
const handleOrientationChange = () => {
|
|
10326
|
-
setOrientation(
|
|
10432
|
+
setOrientation(chunkYDEEINER_js.detectOrientation());
|
|
10327
10433
|
};
|
|
10328
10434
|
if (screen.orientation) {
|
|
10329
10435
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -10353,7 +10459,7 @@ function useIsMobile() {
|
|
|
10353
10459
|
window.addEventListener("resize", handleResize);
|
|
10354
10460
|
return () => window.removeEventListener("resize", handleResize);
|
|
10355
10461
|
}, [isTouchDevice, initialViewportHeight]);
|
|
10356
|
-
const { isMobile, isTablet, isDesktop } =
|
|
10462
|
+
const { isMobile, isTablet, isDesktop } = chunkYDEEINER_js.deriveViewportBreakpoints(
|
|
10357
10463
|
viewportWidth,
|
|
10358
10464
|
viewportHeight,
|
|
10359
10465
|
isTouchDevice
|
|
@@ -10384,10 +10490,10 @@ function useTouchGestures(input) {
|
|
|
10384
10490
|
if (!el || !enabled) {
|
|
10385
10491
|
return;
|
|
10386
10492
|
}
|
|
10387
|
-
const recognizer =
|
|
10493
|
+
const recognizer = chunkYDEEINER_js.createTouchGestureRecognizer({
|
|
10388
10494
|
getScale: () => scaleRef.current,
|
|
10389
|
-
minScale:
|
|
10390
|
-
maxScale:
|
|
10495
|
+
minScale: chunkYDEEINER_js.MIN_ZOOM_SCALE,
|
|
10496
|
+
maxScale: chunkYDEEINER_js.MAX_ZOOM_SCALE,
|
|
10391
10497
|
callbacks: {
|
|
10392
10498
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10393
10499
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10427,7 +10533,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10427
10533
|
return;
|
|
10428
10534
|
}
|
|
10429
10535
|
const rect = active.getBoundingClientRect();
|
|
10430
|
-
const delta =
|
|
10536
|
+
const delta = chunkYDEEINER_js.computeScrollDelta(
|
|
10431
10537
|
{ top: rect.top, bottom: rect.bottom },
|
|
10432
10538
|
window.innerHeight,
|
|
10433
10539
|
keyboardInset
|
|
@@ -10447,8 +10553,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10447
10553
|
return;
|
|
10448
10554
|
}
|
|
10449
10555
|
const update = () => {
|
|
10450
|
-
const metrics =
|
|
10451
|
-
const inset = metrics ?
|
|
10556
|
+
const metrics = chunkYDEEINER_js.readViewportMetrics(window);
|
|
10557
|
+
const inset = metrics ? chunkYDEEINER_js.computeKeyboardInset(metrics) : 0;
|
|
10452
10558
|
setKeyboardInset(inset);
|
|
10453
10559
|
if (inset > 0) {
|
|
10454
10560
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10459,8 +10565,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10459
10565
|
vv.addEventListener("scroll", update);
|
|
10460
10566
|
const onFocusIn = () => {
|
|
10461
10567
|
window.requestAnimationFrame(() => {
|
|
10462
|
-
const metrics =
|
|
10463
|
-
const inset = metrics ?
|
|
10568
|
+
const metrics = chunkYDEEINER_js.readViewportMetrics(window);
|
|
10569
|
+
const inset = metrics ? chunkYDEEINER_js.computeKeyboardInset(metrics) : 0;
|
|
10464
10570
|
if (inset > 0) {
|
|
10465
10571
|
scrollFocusedIntoView(inset);
|
|
10466
10572
|
}
|
|
@@ -10473,7 +10579,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10473
10579
|
document.removeEventListener("focusin", onFocusIn);
|
|
10474
10580
|
};
|
|
10475
10581
|
}, [enabled]);
|
|
10476
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10582
|
+
return { keyboardInset, isKeyboardOpen: chunkYDEEINER_js.isKeyboardOpen(keyboardInset) };
|
|
10477
10583
|
}
|
|
10478
10584
|
|
|
10479
10585
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10502,21 +10608,21 @@ function buildCanvasProps(input) {
|
|
|
10502
10608
|
} = input;
|
|
10503
10609
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10504
10610
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10505
|
-
const fieldContext =
|
|
10611
|
+
const fieldContext = chunkYDEEINER_js.buildFieldSubstitutionContext({
|
|
10506
10612
|
headerFooter: s.headerFooter,
|
|
10507
10613
|
customProperties: s.customProperties,
|
|
10508
10614
|
slide: activeSlide
|
|
10509
10615
|
});
|
|
10510
10616
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10511
10617
|
const openExternalUrl = (url) => {
|
|
10512
|
-
if (
|
|
10618
|
+
if (chunkYDEEINER_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
10513
10619
|
return;
|
|
10514
10620
|
}
|
|
10515
|
-
|
|
10621
|
+
chunkYDEEINER_js.safeOpenUrl(url);
|
|
10516
10622
|
};
|
|
10517
10623
|
const handleActionClick = (_elementId, action) => {
|
|
10518
10624
|
if (mode === "present") {
|
|
10519
|
-
const resolved =
|
|
10625
|
+
const resolved = chunkYDEEINER_js.resolvePresentationAction(action, { slideCount: slides.length });
|
|
10520
10626
|
if (resolved.intent.kind === "openUrl") {
|
|
10521
10627
|
openExternalUrl(resolved.intent.url);
|
|
10522
10628
|
return;
|
|
@@ -10527,9 +10633,9 @@ function buildCanvasProps(input) {
|
|
|
10527
10633
|
}
|
|
10528
10634
|
};
|
|
10529
10635
|
const handleHyperlinkClick = (url) => {
|
|
10530
|
-
if (
|
|
10636
|
+
if (chunkYDEEINER_js.isPpactionUrl(url)) {
|
|
10531
10637
|
if (mode === "present") {
|
|
10532
|
-
const parsed =
|
|
10638
|
+
const parsed = chunkYDEEINER_js.parsePpactionUrl(url);
|
|
10533
10639
|
if (parsed) {
|
|
10534
10640
|
presentation.handlePresentationAction({
|
|
10535
10641
|
action: parsed.action,
|
|
@@ -10635,7 +10741,7 @@ function buildCanvasProps(input) {
|
|
|
10635
10741
|
|
|
10636
10742
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10637
10743
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10638
|
-
return
|
|
10744
|
+
return chunkYDEEINER_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10639
10745
|
}
|
|
10640
10746
|
|
|
10641
10747
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10648,7 +10754,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10648
10754
|
const current = activeSlide.animations ?? [];
|
|
10649
10755
|
if (group === "motionPath") {
|
|
10650
10756
|
propertyHandlers.handleUpdateSlide({
|
|
10651
|
-
animations:
|
|
10757
|
+
animations: chunkYDEEINER_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10652
10758
|
});
|
|
10653
10759
|
return;
|
|
10654
10760
|
}
|
|
@@ -10842,7 +10948,7 @@ function buildToolbarProps(input) {
|
|
|
10842
10948
|
onOpenFile,
|
|
10843
10949
|
onOpenRecentFile,
|
|
10844
10950
|
onCreatePresentation: (templateId) => {
|
|
10845
|
-
s.setSlides(
|
|
10951
|
+
s.setSlides(chunkYDEEINER_js.createBackstagePresentation(templateId));
|
|
10846
10952
|
s.setActiveSlideIndex(0);
|
|
10847
10953
|
s.setSelectedElementId(null);
|
|
10848
10954
|
s.setSelectedElementIds([]);
|
|
@@ -10871,7 +10977,7 @@ function buildToolbarProps(input) {
|
|
|
10871
10977
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
10872
10978
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10873
10979
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10874
|
-
templateScheme:
|
|
10980
|
+
templateScheme: chunkYDEEINER_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10875
10981
|
customShows: s.customShows,
|
|
10876
10982
|
activeCustomShowId: s.activeCustomShowId,
|
|
10877
10983
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -10912,7 +11018,7 @@ function buildToolbarProps(input) {
|
|
|
10912
11018
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10913
11019
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10914
11020
|
formatPainterActive: s.formatPainterActive,
|
|
10915
|
-
canActivateFormatPainter:
|
|
11021
|
+
canActivateFormatPainter: chunkYDEEINER_js.hasCopyableFormat(selectedElement),
|
|
10916
11022
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10917
11023
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10918
11024
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -10986,7 +11092,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
10986
11092
|
headerFooter: state.headerFooter,
|
|
10987
11093
|
loading,
|
|
10988
11094
|
error,
|
|
10989
|
-
maxHistoryEntries:
|
|
11095
|
+
maxHistoryEntries: chunkYDEEINER_js.resolveHistoryDepth(viewerOptions),
|
|
10990
11096
|
hasActivePointerInteraction,
|
|
10991
11097
|
pointerCommitNonce: state.pointerCommitNonce,
|
|
10992
11098
|
setSlides: state.setSlides,
|
|
@@ -11051,7 +11157,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11051
11157
|
gridSpacingPx,
|
|
11052
11158
|
// Multiplied against the pre-existing 2x baseline; see the matching
|
|
11053
11159
|
// comment in `PowerPointViewer.tsx`.
|
|
11054
|
-
imageExportScale: 2 *
|
|
11160
|
+
imageExportScale: 2 * chunkYDEEINER_js.resolveImageResolutionScale(viewerOptions),
|
|
11055
11161
|
viewerOptions
|
|
11056
11162
|
};
|
|
11057
11163
|
}
|
|
@@ -11221,7 +11327,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11221
11327
|
}, [incomingContent]);
|
|
11222
11328
|
const onOpenFile = react.useCallback(() => {
|
|
11223
11329
|
void (async () => {
|
|
11224
|
-
const picked = await
|
|
11330
|
+
const picked = await chunkYDEEINER_js.openPptxFile();
|
|
11225
11331
|
if (picked) {
|
|
11226
11332
|
setContent(picked.buffer);
|
|
11227
11333
|
}
|
|
@@ -11229,7 +11335,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11229
11335
|
}, []);
|
|
11230
11336
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11231
11337
|
void (async () => {
|
|
11232
|
-
const bytes = await
|
|
11338
|
+
const bytes = await chunkYDEEINER_js.readBackstageRecentFile(key);
|
|
11233
11339
|
if (bytes) {
|
|
11234
11340
|
setContent(bytes);
|
|
11235
11341
|
}
|