pptx-react-viewer 3.6.0 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/dist/{AiChatPanel-WRQGJJVD.mjs → AiChatPanel-A5DCEHTO.mjs} +4 -4
- package/dist/AiChatPanel-A5DCEHTO.mjs.br +0 -0
- package/dist/AiChatPanel-A5DCEHTO.mjs.gz +0 -0
- package/dist/{AiChatPanel-LEOEDIW2.js → AiChatPanel-XLQM4BQJ.js} +25 -25
- package/dist/AiChatPanel-XLQM4BQJ.js.br +0 -0
- package/dist/AiChatPanel-XLQM4BQJ.js.gz +0 -0
- package/dist/{Area3DChartScene-SJC2ZB6R.mjs → Area3DChartScene-5CMEMIBI.mjs} +1 -1
- package/dist/Area3DChartScene-5CMEMIBI.mjs.br +0 -0
- package/dist/Area3DChartScene-5CMEMIBI.mjs.gz +0 -0
- package/dist/{Area3DChartScene-3TJ2GTGI.js → Area3DChartScene-RZ3V3WOR.js} +2 -2
- package/dist/Area3DChartScene-RZ3V3WOR.js.br +0 -0
- package/dist/Area3DChartScene-RZ3V3WOR.js.gz +0 -0
- package/dist/{Bar3DChartScene-SPER4LQA.mjs → Bar3DChartScene-H3MYUJKV.mjs} +1 -1
- package/dist/Bar3DChartScene-H3MYUJKV.mjs.br +0 -0
- package/dist/Bar3DChartScene-H3MYUJKV.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-2ZGOMOZO.js → Bar3DChartScene-KHCQ6TEC.js} +2 -2
- package/dist/Bar3DChartScene-KHCQ6TEC.js.br +0 -0
- package/dist/Bar3DChartScene-KHCQ6TEC.js.gz +0 -0
- package/dist/{Line3DChartScene-42FYFGLU.js → Line3DChartScene-QEACF3U3.js} +2 -2
- package/dist/Line3DChartScene-QEACF3U3.js.br +0 -0
- package/dist/Line3DChartScene-QEACF3U3.js.gz +0 -0
- package/dist/{Line3DChartScene-FH3YHPXE.mjs → Line3DChartScene-YFRPJHDX.mjs} +1 -1
- package/dist/Line3DChartScene-YFRPJHDX.mjs.br +0 -0
- package/dist/Line3DChartScene-YFRPJHDX.mjs.gz +0 -0
- package/dist/{Model3DScene-2BCR2YYD.mjs → Model3DScene-O24KP723.mjs} +1 -1
- package/dist/Model3DScene-O24KP723.mjs.br +0 -0
- package/dist/Model3DScene-O24KP723.mjs.gz +0 -0
- package/dist/{Model3DScene-EIU2GVUZ.js → Model3DScene-QQWKGJ3T.js} +2 -2
- package/dist/Model3DScene-QQWKGJ3T.js.br +0 -0
- package/dist/Model3DScene-QQWKGJ3T.js.gz +0 -0
- package/dist/{PieChart3DScene-QFQUJFDP.mjs → PieChart3DScene-CI6CW22C.mjs} +1 -1
- package/dist/PieChart3DScene-CI6CW22C.mjs.br +0 -0
- package/dist/PieChart3DScene-CI6CW22C.mjs.gz +0 -0
- package/dist/{PieChart3DScene-VQOHZPHI.js → PieChart3DScene-L3MHKQHW.js} +2 -2
- package/dist/PieChart3DScene-L3MHKQHW.js.br +0 -0
- package/dist/PieChart3DScene-L3MHKQHW.js.gz +0 -0
- package/dist/PowerPointViewer-Cl6jBPNw.d.ts.map +1 -1
- package/dist/{SurfaceChart3DScene-FTVXZN6O.js → SurfaceChart3DScene-5IER6VFW.js} +2 -2
- package/dist/SurfaceChart3DScene-5IER6VFW.js.br +0 -0
- package/dist/SurfaceChart3DScene-5IER6VFW.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-CGXMRBCL.mjs → SurfaceChart3DScene-JUXRC3K2.mjs} +1 -1
- package/dist/SurfaceChart3DScene-JUXRC3K2.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-JUXRC3K2.mjs.gz +0 -0
- package/dist/{audience-content-store-bR7Gs_1S.d.ts → audience-content-store-CB2WVM1K.d.ts} +12 -3
- package/dist/{audience-content-store-bR7Gs_1S.d.ts.map → audience-content-store-CB2WVM1K.d.ts.map} +1 -1
- package/dist/{chunk-NFOOONND.js → chunk-4222CHFH.js} +1944 -1299
- package/dist/chunk-4222CHFH.js.br +0 -0
- package/dist/chunk-4222CHFH.js.gz +0 -0
- package/dist/{chunk-ZUSYUWOV.mjs → chunk-6IMB5DNJ.mjs} +8927 -4870
- package/dist/chunk-6IMB5DNJ.mjs.br +0 -0
- package/dist/chunk-6IMB5DNJ.mjs.gz +0 -0
- package/dist/{chunk-ZHSBMG37.js → chunk-DE3S3UHX.js} +557 -682
- package/dist/chunk-DE3S3UHX.js.br +0 -0
- package/dist/chunk-DE3S3UHX.js.gz +0 -0
- package/dist/{chunk-ZWPHUPL4.js → chunk-F5NPGNMA.js} +9 -5
- package/dist/chunk-F5NPGNMA.js.br +0 -0
- package/dist/chunk-F5NPGNMA.js.gz +0 -0
- package/dist/{chunk-TGCSZXOG.mjs → chunk-FRZIBZTE.mjs} +57 -27
- package/dist/chunk-FRZIBZTE.mjs.br +0 -0
- package/dist/chunk-FRZIBZTE.mjs.gz +0 -0
- package/dist/{chunk-MZI4DG3S.js → chunk-L3ZIBQEB.js} +57 -27
- package/dist/chunk-L3ZIBQEB.js.br +0 -0
- package/dist/chunk-L3ZIBQEB.js.gz +0 -0
- package/dist/{chunk-FG5VQFWP.mjs → chunk-PFPKBNNZ.mjs} +761 -116
- package/dist/chunk-PFPKBNNZ.mjs.br +0 -0
- package/dist/chunk-PFPKBNNZ.mjs.gz +0 -0
- package/dist/{chunk-7VPDHSWF.js → chunk-QWA5YEIZ.js} +234 -241
- package/dist/chunk-QWA5YEIZ.js.br +0 -0
- package/dist/chunk-QWA5YEIZ.js.gz +0 -0
- package/dist/{chunk-WX7AFFBZ.mjs → chunk-RHWQKZLB.mjs} +63 -69
- package/dist/chunk-RHWQKZLB.mjs.br +0 -0
- package/dist/chunk-RHWQKZLB.mjs.gz +0 -0
- package/dist/{chunk-T3V5FBXJ.mjs → chunk-RNP5HP4L.mjs} +5 -2
- package/dist/chunk-RNP5HP4L.mjs.br +0 -0
- package/dist/chunk-RNP5HP4L.mjs.gz +0 -0
- package/dist/{chunk-AL2KLPOJ.js → chunk-SN5EUDIT.js} +8959 -4873
- package/dist/chunk-SN5EUDIT.js.br +0 -0
- package/dist/chunk-SN5EUDIT.js.gz +0 -0
- package/dist/{chunk-VYNICQ4O.mjs → chunk-UPJW34YG.mjs} +133 -258
- package/dist/chunk-UPJW34YG.mjs.br +0 -0
- package/dist/chunk-UPJW34YG.mjs.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +595 -38
- package/dist/index.js +47 -47
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +768 -186
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/types-Bzdkiakq.d.ts.map +1 -1
- package/dist/viewer/index.d.ts +534 -38
- package/dist/viewer/index.js +27 -27
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +2 -2
- package/dist/AiChatPanel-LEOEDIW2.js.br +0 -0
- package/dist/AiChatPanel-LEOEDIW2.js.gz +0 -0
- package/dist/AiChatPanel-WRQGJJVD.mjs.br +0 -0
- package/dist/AiChatPanel-WRQGJJVD.mjs.gz +0 -0
- package/dist/Area3DChartScene-3TJ2GTGI.js.br +0 -0
- package/dist/Area3DChartScene-3TJ2GTGI.js.gz +0 -0
- package/dist/Area3DChartScene-SJC2ZB6R.mjs.br +0 -2
- package/dist/Area3DChartScene-SJC2ZB6R.mjs.gz +0 -0
- package/dist/Bar3DChartScene-2ZGOMOZO.js.br +0 -0
- package/dist/Bar3DChartScene-2ZGOMOZO.js.gz +0 -0
- package/dist/Bar3DChartScene-SPER4LQA.mjs.br +0 -0
- package/dist/Bar3DChartScene-SPER4LQA.mjs.gz +0 -0
- package/dist/Line3DChartScene-42FYFGLU.js.br +0 -0
- package/dist/Line3DChartScene-42FYFGLU.js.gz +0 -0
- package/dist/Line3DChartScene-FH3YHPXE.mjs.br +0 -2
- package/dist/Line3DChartScene-FH3YHPXE.mjs.gz +0 -0
- package/dist/Model3DScene-2BCR2YYD.mjs.br +0 -0
- package/dist/Model3DScene-2BCR2YYD.mjs.gz +0 -0
- package/dist/Model3DScene-EIU2GVUZ.js.br +0 -0
- package/dist/Model3DScene-EIU2GVUZ.js.gz +0 -0
- package/dist/PieChart3DScene-QFQUJFDP.mjs.br +0 -0
- package/dist/PieChart3DScene-QFQUJFDP.mjs.gz +0 -0
- package/dist/PieChart3DScene-VQOHZPHI.js.br +0 -0
- package/dist/PieChart3DScene-VQOHZPHI.js.gz +0 -0
- package/dist/SurfaceChart3DScene-CGXMRBCL.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-CGXMRBCL.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-FTVXZN6O.js.br +0 -0
- package/dist/SurfaceChart3DScene-FTVXZN6O.js.gz +0 -0
- package/dist/chunk-7VPDHSWF.js.br +0 -0
- package/dist/chunk-7VPDHSWF.js.gz +0 -0
- package/dist/chunk-AL2KLPOJ.js.br +0 -0
- package/dist/chunk-AL2KLPOJ.js.gz +0 -0
- package/dist/chunk-FG5VQFWP.mjs.br +0 -0
- package/dist/chunk-FG5VQFWP.mjs.gz +0 -0
- package/dist/chunk-MZI4DG3S.js.br +0 -0
- package/dist/chunk-MZI4DG3S.js.gz +0 -0
- package/dist/chunk-NFOOONND.js.br +0 -0
- package/dist/chunk-NFOOONND.js.gz +0 -0
- package/dist/chunk-T3V5FBXJ.mjs.br +0 -0
- package/dist/chunk-T3V5FBXJ.mjs.gz +0 -0
- package/dist/chunk-TGCSZXOG.mjs.br +0 -0
- package/dist/chunk-TGCSZXOG.mjs.gz +0 -0
- package/dist/chunk-VYNICQ4O.mjs.br +0 -0
- package/dist/chunk-VYNICQ4O.mjs.gz +0 -0
- package/dist/chunk-WX7AFFBZ.mjs.br +0 -0
- package/dist/chunk-WX7AFFBZ.mjs.gz +0 -0
- package/dist/chunk-ZHSBMG37.js.br +0 -0
- package/dist/chunk-ZHSBMG37.js.gz +0 -0
- package/dist/chunk-ZUSYUWOV.mjs.br +0 -0
- package/dist/chunk-ZUSYUWOV.mjs.gz +0 -0
- package/dist/chunk-ZWPHUPL4.js.br +0 -0
- package/dist/chunk-ZWPHUPL4.js.gz +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkQWA5YEIZ_js = require('./chunk-QWA5YEIZ.js');
|
|
4
|
+
var chunkSN5EUDIT_js = require('./chunk-SN5EUDIT.js');
|
|
5
|
+
var chunkL3ZIBQEB_js = require('./chunk-L3ZIBQEB.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 = chunkSN5EUDIT_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 = chunkSN5EUDIT_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 ??= chunkSN5EUDIT_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 >= chunkSN5EUDIT_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
|
+
}, chunkSN5EUDIT_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 = chunkSN5EUDIT_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
|
+
chunkSN5EUDIT_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 = chunkSN5EUDIT_js.validateRoomId(config.roomId);
|
|
244
244
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
245
|
-
departureRef.current =
|
|
245
|
+
departureRef.current = chunkSN5EUDIT_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 = chunkSN5EUDIT_js.validateRoomId(config.roomId);
|
|
288
|
+
const transport = config.transport ?? chunkSN5EUDIT_js.resolveTransportForServerUrl(config.serverUrl);
|
|
289
289
|
if (transport === "webrtc") {
|
|
290
290
|
await initWebrtc();
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
293
|
+
if (chunkSN5EUDIT_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 = chunkSN5EUDIT_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
|
+
chunkSN5EUDIT_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
|
+
}, chunkSN5EUDIT_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
|
+
chunkSN5EUDIT_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 = chunkSN5EUDIT_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 = chunkSN5EUDIT_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(chunkSN5EUDIT_js.cloneSlide),
|
|
531
|
+
templateElementsBySlideId: chunkSN5EUDIT_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(chunkSN5EUDIT_js.cloneSlide));
|
|
545
545
|
setTemplateElementsBySlideId(
|
|
546
|
-
|
|
546
|
+
chunkSN5EUDIT_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 = chunkQWA5YEIZ_js.cloneHistorySnapshot(previousSnapshot);
|
|
586
|
+
lastHistorySnapshotRef.current = chunkQWA5YEIZ_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 = chunkQWA5YEIZ_js.cloneHistorySnapshot(nextSnapshot);
|
|
608
|
+
lastHistorySnapshotRef.current = chunkQWA5YEIZ_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 = chunkQWA5YEIZ_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 = chunkQWA5YEIZ_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(chunkQWA5YEIZ_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 = chunkQWA5YEIZ_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(chunkSN5EUDIT_js.createWheelStepBuffer());
|
|
747
747
|
const storeRef = react.useRef(null);
|
|
748
|
-
storeRef.current ??=
|
|
748
|
+
storeRef.current ??= chunkSN5EUDIT_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 = chunkSN5EUDIT_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, chunkQWA5YEIZ_js.MIN_ELEMENT_SIZE));
|
|
847
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkQWA5YEIZ_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, chunkQWA5YEIZ_js.MIN_ELEMENT_SIZE);
|
|
854
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkQWA5YEIZ_js.MIN_ELEMENT_SIZE);
|
|
855
855
|
const availableWidth = Math.max(
|
|
856
|
-
effectiveEditorDimensions.width -
|
|
857
|
-
|
|
856
|
+
effectiveEditorDimensions.width - chunkQWA5YEIZ_js.ZOOM_TO_SELECTION_PADDING,
|
|
857
|
+
chunkQWA5YEIZ_js.MIN_ELEMENT_SIZE
|
|
858
858
|
);
|
|
859
859
|
const availableHeight = Math.max(
|
|
860
|
-
effectiveEditorDimensions.height -
|
|
861
|
-
|
|
860
|
+
effectiveEditorDimensions.height - chunkQWA5YEIZ_js.ZOOM_TO_SELECTION_PADDING,
|
|
861
|
+
chunkQWA5YEIZ_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 = chunkSN5EUDIT_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 = chunkSN5EUDIT_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: chunkSN5EUDIT_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
|
|
893
893
|
});
|
|
894
894
|
},
|
|
895
895
|
[store]
|
|
@@ -970,79 +970,6 @@ function stopAnimationSound() {
|
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
972
|
|
|
973
|
-
// src/viewer/hooks/presentation-mode/animation-helpers.ts
|
|
974
|
-
function shouldSeekAnimationGroup(group, endAtMs, nowMs) {
|
|
975
|
-
return group?.seqNextAction === "seek" && nowMs < endAtMs;
|
|
976
|
-
}
|
|
977
|
-
function finishDomAnimationsForGroup(group, root = document) {
|
|
978
|
-
const targetIds = new Set(
|
|
979
|
-
group.steps.filter((step) => !step.command).map((step) => step.elementId)
|
|
980
|
-
);
|
|
981
|
-
if (targetIds.size === 0) {
|
|
982
|
-
return 0;
|
|
983
|
-
}
|
|
984
|
-
const activeAnimations = /* @__PURE__ */ new Set();
|
|
985
|
-
const candidates = root.querySelectorAll(
|
|
986
|
-
'[data-element-id], [data-anim-id], [data-pptx-animation-layer="background"]'
|
|
987
|
-
);
|
|
988
|
-
for (const element of candidates) {
|
|
989
|
-
let animationElementId = element.dataset.animId ?? element.dataset.elementId;
|
|
990
|
-
if (element.dataset.pptxAnimationLayer === "background") {
|
|
991
|
-
const hostId = element.closest("[data-element-id]")?.dataset.elementId;
|
|
992
|
-
animationElementId = hostId ? `${hostId}::pptx-bg` : void 0;
|
|
993
|
-
}
|
|
994
|
-
if (!animationElementId || !targetIds.has(animationElementId)) {
|
|
995
|
-
continue;
|
|
996
|
-
}
|
|
997
|
-
if (typeof element.getAnimations !== "function") {
|
|
998
|
-
continue;
|
|
999
|
-
}
|
|
1000
|
-
for (const animation of element.getAnimations()) {
|
|
1001
|
-
activeAnimations.add(animation);
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
let finishedCount = 0;
|
|
1005
|
-
for (const animation of activeAnimations) {
|
|
1006
|
-
const iterations = animation.effect?.getTiming().iterations;
|
|
1007
|
-
if (animation.playState === "finished" || animation.playState === "idle") {
|
|
1008
|
-
continue;
|
|
1009
|
-
}
|
|
1010
|
-
if (iterations === Infinity) {
|
|
1011
|
-
continue;
|
|
1012
|
-
}
|
|
1013
|
-
try {
|
|
1014
|
-
animation.finish();
|
|
1015
|
-
finishedCount += 1;
|
|
1016
|
-
} catch {
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
return finishedCount;
|
|
1020
|
-
}
|
|
1021
|
-
function finishAnimationGroupSteps(group, setPresentationElementStates, completedStates) {
|
|
1022
|
-
setPresentationElementStates((previousStates) => {
|
|
1023
|
-
const nextStates = new Map(previousStates);
|
|
1024
|
-
for (const step of group.steps) {
|
|
1025
|
-
if (step.command) {
|
|
1026
|
-
continue;
|
|
1027
|
-
}
|
|
1028
|
-
const currentState = nextStates.get(step.elementId) ?? {
|
|
1029
|
-
visible: true,
|
|
1030
|
-
cssAnimation: void 0
|
|
1031
|
-
};
|
|
1032
|
-
const holdsAnimatedPaint = step.holdEndState && step.colorTargets !== void 0 && step.colorTargets.length > 0;
|
|
1033
|
-
nextStates.set(step.elementId, {
|
|
1034
|
-
...currentState,
|
|
1035
|
-
visible: step.presetClass !== "exit" && !step.hideAfterEffect,
|
|
1036
|
-
cssAnimation: step.holdEndState ? step.cssAnimation : void 0,
|
|
1037
|
-
build: completedStates?.get(step.elementId)?.build ?? currentState.build,
|
|
1038
|
-
animatesFill: holdsAnimatedPaint && step.colorTargets?.includes("fill") ? true : void 0,
|
|
1039
|
-
animatesStroke: holdsAnimatedPaint && step.colorTargets?.includes("stroke") ? true : void 0
|
|
1040
|
-
});
|
|
1041
|
-
}
|
|
1042
|
-
return nextStates;
|
|
1043
|
-
});
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
973
|
// src/viewer/hooks/presentation-mode/entrance-animation-timers.ts
|
|
1047
974
|
function scheduleOpeningAutoPlayGroup(controller, ctx) {
|
|
1048
975
|
if (!controller.hasMoreSteps()) {
|
|
@@ -1057,8 +984,8 @@ function scheduleOpeningAutoPlayGroup(controller, ctx) {
|
|
|
1057
984
|
if (!group) {
|
|
1058
985
|
return;
|
|
1059
986
|
}
|
|
1060
|
-
|
|
1061
|
-
|
|
987
|
+
chunkSN5EUDIT_js.playGroup(controller, group, ctx);
|
|
988
|
+
chunkSN5EUDIT_js.scheduleAutoAdvanceChain(controller, ctx);
|
|
1062
989
|
}, firstGroup.autoAdvanceDelayMs ?? 0);
|
|
1063
990
|
ctx.timers.push(timer);
|
|
1064
991
|
}
|
|
@@ -1077,7 +1004,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1077
1004
|
}))
|
|
1078
1005
|
);
|
|
1079
1006
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1080
|
-
const delay =
|
|
1007
|
+
const delay = chunkSN5EUDIT_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1081
1008
|
const timer = window.setTimeout(() => {
|
|
1082
1009
|
setPresentationAnimations(
|
|
1083
1010
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1103,8 +1030,7 @@ function useAnimationPlayback(input) {
|
|
|
1103
1030
|
const presentationTimersRef = react.useRef([]);
|
|
1104
1031
|
const controllerRef = react.useRef(null);
|
|
1105
1032
|
const buildRafRef = react.useRef(null);
|
|
1106
|
-
const activeAnimationGroupRef = react.useRef(
|
|
1107
|
-
const activeAnimationEndAtRef = react.useRef(0);
|
|
1033
|
+
const activeAnimationGroupRef = react.useRef(chunkSN5EUDIT_js.createActiveAnimationGroup());
|
|
1108
1034
|
const seededCompletedRef = react.useRef(false);
|
|
1109
1035
|
const mediaTimeNodeElementIdsRef = react.useRef(/* @__PURE__ */ new Map());
|
|
1110
1036
|
const lastSeedCompletedRef = react.useRef(false);
|
|
@@ -1121,25 +1047,15 @@ function useAnimationPlayback(input) {
|
|
|
1121
1047
|
}, [onPlayActionSound]);
|
|
1122
1048
|
react.useEffect(() => {
|
|
1123
1049
|
return () => {
|
|
1124
|
-
|
|
1050
|
+
chunkSN5EUDIT_js.cancelBuildReveal(buildRafRef);
|
|
1125
1051
|
};
|
|
1126
1052
|
}, []);
|
|
1127
1053
|
const clearPresentationTimers = react.useCallback(() => {
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
});
|
|
1131
|
-
presentationTimersRef.current = [];
|
|
1132
|
-
chunkAL2KLPOJ_js.cancelBuildReveal(buildRafRef);
|
|
1133
|
-
activeAnimationGroupRef.current = null;
|
|
1134
|
-
activeAnimationEndAtRef.current = 0;
|
|
1135
|
-
}, []);
|
|
1136
|
-
const markAnimationGroupActive = react.useCallback((group) => {
|
|
1137
|
-
activeAnimationGroupRef.current = group;
|
|
1138
|
-
activeAnimationEndAtRef.current = performance.now() + Math.max(0, group.totalDurationMs);
|
|
1139
|
-
}, []);
|
|
1054
|
+
chunkSN5EUDIT_js.clearPlaybackTimers(buildPlaybackContext(), activeAnimationGroupRef.current);
|
|
1055
|
+
}, [buildPlaybackContext]);
|
|
1140
1056
|
const resetSlideTimeline = react.useCallback(
|
|
1141
1057
|
(slideIndex) => {
|
|
1142
|
-
|
|
1058
|
+
chunkSN5EUDIT_js.cancelBuildReveal(buildRafRef);
|
|
1143
1059
|
const slide = slides[slideIndex];
|
|
1144
1060
|
if (!slide) {
|
|
1145
1061
|
controllerRef.current = null;
|
|
@@ -1150,9 +1066,9 @@ function useAnimationPlayback(input) {
|
|
|
1150
1066
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1151
1067
|
return;
|
|
1152
1068
|
}
|
|
1153
|
-
const controller =
|
|
1069
|
+
const controller = chunkSN5EUDIT_js.PresentationAnimationController.fromSlide(slide);
|
|
1154
1070
|
controllerRef.current = controller;
|
|
1155
|
-
mediaTimeNodeElementIdsRef.current =
|
|
1071
|
+
mediaTimeNodeElementIdsRef.current = chunkSN5EUDIT_js.resolveMediaTimeNodeElementIds(
|
|
1156
1072
|
slide.nativeAnimations ?? []
|
|
1157
1073
|
);
|
|
1158
1074
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
@@ -1166,30 +1082,12 @@ function useAnimationPlayback(input) {
|
|
|
1166
1082
|
if (!animationsEnabled) {
|
|
1167
1083
|
return false;
|
|
1168
1084
|
}
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
clearPresentationTimers();
|
|
1176
|
-
finishAnimationGroupSteps(activeGroup, setPresentationElementStates, completedStates);
|
|
1177
|
-
chunkAL2KLPOJ_js.scheduleAutoAdvanceChain(controller, buildPlaybackContext());
|
|
1178
|
-
return true;
|
|
1179
|
-
}
|
|
1180
|
-
if (!controller || !controller.hasMoreSteps()) {
|
|
1181
|
-
return false;
|
|
1182
|
-
}
|
|
1183
|
-
const group = controller.advance();
|
|
1184
|
-
if (!group) {
|
|
1185
|
-
return false;
|
|
1186
|
-
}
|
|
1187
|
-
const ctx = buildPlaybackContext();
|
|
1188
|
-
chunkAL2KLPOJ_js.playGroup(controller, group, ctx);
|
|
1189
|
-
markAnimationGroupActive(group);
|
|
1190
|
-
chunkAL2KLPOJ_js.scheduleAutoAdvanceChain(controller, ctx);
|
|
1191
|
-
return true;
|
|
1192
|
-
}, [animationsEnabled, buildPlaybackContext, clearPresentationTimers, markAnimationGroupActive]);
|
|
1085
|
+
return chunkSN5EUDIT_js.advanceMainSequence(
|
|
1086
|
+
controllerRef.current,
|
|
1087
|
+
buildPlaybackContext(),
|
|
1088
|
+
activeAnimationGroupRef.current
|
|
1089
|
+
);
|
|
1090
|
+
}, [animationsEnabled, buildPlaybackContext]);
|
|
1193
1091
|
const handleInteractiveShapeClick = react.useCallback(
|
|
1194
1092
|
(shapeId) => {
|
|
1195
1093
|
const controller = controllerRef.current;
|
|
@@ -1200,7 +1098,7 @@ function useAnimationPlayback(input) {
|
|
|
1200
1098
|
if (!group) {
|
|
1201
1099
|
return false;
|
|
1202
1100
|
}
|
|
1203
|
-
|
|
1101
|
+
chunkSN5EUDIT_js.playGroup(controller, group, buildPlaybackContext());
|
|
1204
1102
|
return true;
|
|
1205
1103
|
},
|
|
1206
1104
|
[buildPlaybackContext]
|
|
@@ -1219,7 +1117,7 @@ function useAnimationPlayback(input) {
|
|
|
1219
1117
|
if (!group) {
|
|
1220
1118
|
return false;
|
|
1221
1119
|
}
|
|
1222
|
-
|
|
1120
|
+
chunkSN5EUDIT_js.playGroup(controller, group, buildPlaybackContext());
|
|
1223
1121
|
return true;
|
|
1224
1122
|
},
|
|
1225
1123
|
[animationsEnabled, buildPlaybackContext]
|
|
@@ -1300,12 +1198,12 @@ function useAnimationPlayback(input) {
|
|
|
1300
1198
|
presentationTimersRef
|
|
1301
1199
|
};
|
|
1302
1200
|
}
|
|
1303
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1304
|
-
var AUDIENCE_HASH =
|
|
1305
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1306
|
-
var AUDIENCE_NONCE_KEY =
|
|
1201
|
+
var PRESENTER_CHANNEL_NAME = chunkSN5EUDIT_js.PRESENTATION_CHANNEL_NAME;
|
|
1202
|
+
var AUDIENCE_HASH = chunkSN5EUDIT_js.PRESENTATION_HASH;
|
|
1203
|
+
var PRESENTER_MSG_ORIGIN = chunkSN5EUDIT_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1204
|
+
var AUDIENCE_NONCE_KEY = chunkSN5EUDIT_js.PRESENTATION_NONCE_KEY;
|
|
1307
1205
|
function generateSessionId() {
|
|
1308
|
-
return
|
|
1206
|
+
return chunkSN5EUDIT_js.createPresentationSessionId();
|
|
1309
1207
|
}
|
|
1310
1208
|
function parseAudienceNonce() {
|
|
1311
1209
|
const hash = window.location.hash;
|
|
@@ -1341,7 +1239,7 @@ function usePresenterWindow(input) {
|
|
|
1341
1239
|
}, []);
|
|
1342
1240
|
const swapDisplays = react.useCallback(async () => {
|
|
1343
1241
|
const audience = audienceWindowRef.current;
|
|
1344
|
-
return audience && !audience.closed ?
|
|
1242
|
+
return audience && !audience.closed ? chunkSN5EUDIT_js.swapPresentationWindows(window, audience) : false;
|
|
1345
1243
|
}, []);
|
|
1346
1244
|
const syncSlideToAudience = react.useCallback(
|
|
1347
1245
|
(slideIndex) => {
|
|
@@ -1405,7 +1303,7 @@ function usePresenterWindow(input) {
|
|
|
1405
1303
|
pollTimerRef.current = null;
|
|
1406
1304
|
}
|
|
1407
1305
|
if (closingSessionId) {
|
|
1408
|
-
void
|
|
1306
|
+
void chunkSN5EUDIT_js.clearAudienceContent(closingSessionId);
|
|
1409
1307
|
}
|
|
1410
1308
|
}, [getChannel]);
|
|
1411
1309
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1423,10 +1321,10 @@ function usePresenterWindow(input) {
|
|
|
1423
1321
|
audienceWindowRef.current = blankWin;
|
|
1424
1322
|
const sessionId = generateSessionId();
|
|
1425
1323
|
sessionIdRef.current = sessionId;
|
|
1426
|
-
const audienceUrl =
|
|
1427
|
-
void
|
|
1324
|
+
const audienceUrl = chunkSN5EUDIT_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1325
|
+
void chunkSN5EUDIT_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1428
1326
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1429
|
-
|
|
1327
|
+
chunkSN5EUDIT_js.placeAudienceWindow(blankWin, placement);
|
|
1430
1328
|
}
|
|
1431
1329
|
return void 0;
|
|
1432
1330
|
});
|
|
@@ -1456,7 +1354,7 @@ function usePresenterWindow(input) {
|
|
|
1456
1354
|
}
|
|
1457
1355
|
};
|
|
1458
1356
|
if (content) {
|
|
1459
|
-
void
|
|
1357
|
+
void chunkSN5EUDIT_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1460
1358
|
} else {
|
|
1461
1359
|
navigateOrClose(true);
|
|
1462
1360
|
}
|
|
@@ -1482,7 +1380,7 @@ function usePresenterWindow(input) {
|
|
|
1482
1380
|
}
|
|
1483
1381
|
const handleMessage = (event) => {
|
|
1484
1382
|
const message = event.data;
|
|
1485
|
-
if (
|
|
1383
|
+
if (chunkSN5EUDIT_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1486
1384
|
syncStateToAudience(snapshotRef.current);
|
|
1487
1385
|
}
|
|
1488
1386
|
};
|
|
@@ -1511,7 +1409,7 @@ function usePresenterWindow(input) {
|
|
|
1511
1409
|
react.useEffect(() => {
|
|
1512
1410
|
const handleBeforeUnload = () => {
|
|
1513
1411
|
if (sessionIdRef.current) {
|
|
1514
|
-
void
|
|
1412
|
+
void chunkSN5EUDIT_js.clearAudienceContent(sessionIdRef.current);
|
|
1515
1413
|
}
|
|
1516
1414
|
};
|
|
1517
1415
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1573,7 +1471,7 @@ function useAudienceMode(input) {
|
|
|
1573
1471
|
}
|
|
1574
1472
|
channel.onmessage = (event) => {
|
|
1575
1473
|
const data = event.data;
|
|
1576
|
-
if (!
|
|
1474
|
+
if (!chunkSN5EUDIT_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1577
1475
|
return;
|
|
1578
1476
|
}
|
|
1579
1477
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1589,16 +1487,16 @@ function useAudienceMode(input) {
|
|
|
1589
1487
|
}
|
|
1590
1488
|
if (data.type === "presenter-exit") {
|
|
1591
1489
|
if (expectedSessionId) {
|
|
1592
|
-
void
|
|
1490
|
+
void chunkSN5EUDIT_js.clearAudienceContent(expectedSessionId);
|
|
1593
1491
|
}
|
|
1594
|
-
if (
|
|
1492
|
+
if (chunkSN5EUDIT_js.endAudienceDisplay(window)) {
|
|
1595
1493
|
handlers.onPresenterEnded?.();
|
|
1596
1494
|
}
|
|
1597
1495
|
}
|
|
1598
1496
|
};
|
|
1599
1497
|
if (expectedSessionId) {
|
|
1600
1498
|
channel.postMessage({
|
|
1601
|
-
origin:
|
|
1499
|
+
origin: chunkSN5EUDIT_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1602
1500
|
type: "audience-ready",
|
|
1603
1501
|
sessionId: expectedSessionId
|
|
1604
1502
|
});
|
|
@@ -1612,7 +1510,7 @@ function useAudienceMode(input) {
|
|
|
1612
1510
|
}, []);
|
|
1613
1511
|
}
|
|
1614
1512
|
function usePresentationKeyboard(input) {
|
|
1615
|
-
const wheelBufferRef = react.useRef(
|
|
1513
|
+
const wheelBufferRef = react.useRef(chunkSN5EUDIT_js.createWheelStepBuffer());
|
|
1616
1514
|
const {
|
|
1617
1515
|
mode,
|
|
1618
1516
|
movePresentationSlide,
|
|
@@ -1633,14 +1531,14 @@ function usePresentationKeyboard(input) {
|
|
|
1633
1531
|
presentationSlideIndex,
|
|
1634
1532
|
setShowRehearsalSummary
|
|
1635
1533
|
} = input;
|
|
1636
|
-
const keyBufferRef = react.useRef(
|
|
1534
|
+
const keyBufferRef = react.useRef(chunkSN5EUDIT_js.createPresentationKeyBuffer());
|
|
1637
1535
|
react.useEffect(() => {
|
|
1638
|
-
if (mode !== "present" || !
|
|
1639
|
-
keyBufferRef.current =
|
|
1536
|
+
if (mode !== "present" || !chunkSN5EUDIT_js.acceptsPresentationInput()) {
|
|
1537
|
+
keyBufferRef.current = chunkSN5EUDIT_js.createPresentationKeyBuffer();
|
|
1640
1538
|
return;
|
|
1641
1539
|
}
|
|
1642
1540
|
const handleKeyDown = (event) => {
|
|
1643
|
-
const mapped =
|
|
1541
|
+
const mapped = chunkSN5EUDIT_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1644
1542
|
if (mapped.action === "none") {
|
|
1645
1543
|
return;
|
|
1646
1544
|
}
|
|
@@ -1660,12 +1558,12 @@ function usePresentationKeyboard(input) {
|
|
|
1660
1558
|
movePresentationSlide(-1);
|
|
1661
1559
|
return;
|
|
1662
1560
|
case "first": {
|
|
1663
|
-
const first =
|
|
1561
|
+
const first = chunkSN5EUDIT_js.firstShowSlideIndex(showSlideIndexes);
|
|
1664
1562
|
navigateToSlide(first ?? 0);
|
|
1665
1563
|
return;
|
|
1666
1564
|
}
|
|
1667
1565
|
case "last": {
|
|
1668
|
-
const last =
|
|
1566
|
+
const last = chunkSN5EUDIT_js.lastShowSlideIndex(showSlideIndexes);
|
|
1669
1567
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1670
1568
|
return;
|
|
1671
1569
|
}
|
|
@@ -1703,10 +1601,10 @@ function usePresentationKeyboard(input) {
|
|
|
1703
1601
|
}
|
|
1704
1602
|
};
|
|
1705
1603
|
const handleWheel = (event) => {
|
|
1706
|
-
if (mode !== "present" || !
|
|
1604
|
+
if (mode !== "present" || !chunkSN5EUDIT_js.acceptsPresentationInput()) {
|
|
1707
1605
|
return;
|
|
1708
1606
|
}
|
|
1709
|
-
const mapped =
|
|
1607
|
+
const mapped = chunkSN5EUDIT_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1710
1608
|
if (mapped.intent === "next-slide") {
|
|
1711
1609
|
event.preventDefault();
|
|
1712
1610
|
movePresentationSlide(1);
|
|
@@ -1839,7 +1737,7 @@ function useRehearsalTimings(input) {
|
|
|
1839
1737
|
|
|
1840
1738
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1841
1739
|
function handlePresentationActionImpl(action, deps) {
|
|
1842
|
-
|
|
1740
|
+
chunkSN5EUDIT_js.runPresentationAction(
|
|
1843
1741
|
action,
|
|
1844
1742
|
{ slideCount: deps.slidesLength, ...deps.elementId ? { elementId: deps.elementId } : {} },
|
|
1845
1743
|
{
|
|
@@ -1867,13 +1765,13 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1867
1765
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1868
1766
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1869
1767
|
const transition = deps.reverse ? deps.slides[deps.currentSlideIndex]?.transition : incomingSlide?.transition;
|
|
1870
|
-
const durationMs = deps.playTransition ?
|
|
1768
|
+
const durationMs = deps.playTransition ? chunkSN5EUDIT_js.resolveTransitionDurationMs(transition) : 0;
|
|
1871
1769
|
deps.clearPresentationTimers();
|
|
1872
1770
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1873
1771
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
1874
1772
|
deps.setPresentationSlideVisible(true);
|
|
1875
1773
|
deps.seedSlideAnimations(nextSlideIndex, { completed: deps.seedCompleted });
|
|
1876
|
-
const soundAction =
|
|
1774
|
+
const soundAction = chunkSN5EUDIT_js.resolveTransitionSoundAction(transition);
|
|
1877
1775
|
if (soundAction.kind === "play" && deps.onPlayActionSound) {
|
|
1878
1776
|
deps.onPlayActionSound(soundAction.soundPath, { loop: soundAction.loop });
|
|
1879
1777
|
} else if (soundAction.kind === "stop" && deps.onStopActionSound) {
|
|
@@ -1936,7 +1834,7 @@ function useSlideNavigation(input) {
|
|
|
1936
1834
|
});
|
|
1937
1835
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1938
1836
|
(slideIndex) => {
|
|
1939
|
-
const delayMs =
|
|
1837
|
+
const delayMs = chunkSN5EUDIT_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1940
1838
|
if (delayMs === void 0) {
|
|
1941
1839
|
return;
|
|
1942
1840
|
}
|
|
@@ -1959,7 +1857,7 @@ function useSlideNavigation(input) {
|
|
|
1959
1857
|
if (availableSlideIndexes.length === 0) {
|
|
1960
1858
|
return;
|
|
1961
1859
|
}
|
|
1962
|
-
const pastLastSlide = direction === 1 && !
|
|
1860
|
+
const pastLastSlide = direction === 1 && !chunkSN5EUDIT_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1963
1861
|
if (rehearsing && pastLastSlide) {
|
|
1964
1862
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1965
1863
|
try {
|
|
@@ -1977,9 +1875,9 @@ function useSlideNavigation(input) {
|
|
|
1977
1875
|
onAdvancePastLastSlide();
|
|
1978
1876
|
return;
|
|
1979
1877
|
}
|
|
1980
|
-
const nextSlideIndex = direction === 1 ?
|
|
1878
|
+
const nextSlideIndex = direction === 1 ? chunkSN5EUDIT_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1981
1879
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
1982
|
-
}) :
|
|
1880
|
+
}) : chunkSN5EUDIT_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
1983
1881
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
1984
1882
|
return;
|
|
1985
1883
|
}
|
|
@@ -2158,7 +2056,7 @@ function createCustomShowRunner(deps) {
|
|
|
2158
2056
|
return;
|
|
2159
2057
|
}
|
|
2160
2058
|
origin = returnAfter ? { showId: deps.getActiveCustomShowId(), slideIndex: deps.getPresentationSlideIndex() } : null;
|
|
2161
|
-
const first =
|
|
2059
|
+
const first = chunkSN5EUDIT_js.firstShowSlideIndex(chunkSN5EUDIT_js.resolveShowSlideIndexes(deps.getSlides(), target));
|
|
2162
2060
|
deps.setActiveCustomShowId(customShowId);
|
|
2163
2061
|
if (first !== void 0) {
|
|
2164
2062
|
deps.navigateToSlide(first);
|
|
@@ -2235,22 +2133,22 @@ function usePresentationActionExtensions(input) {
|
|
|
2235
2133
|
}
|
|
2236
2134
|
}, [navigateToSlideViaRef]);
|
|
2237
2135
|
const onOpenFile = react.useCallback((target) => {
|
|
2238
|
-
|
|
2136
|
+
chunkSN5EUDIT_js.safeOpenUrl(target);
|
|
2239
2137
|
}, []);
|
|
2240
2138
|
const onOpenPresentation = react.useCallback((target) => {
|
|
2241
|
-
|
|
2139
|
+
chunkSN5EUDIT_js.safeOpenUrl(target);
|
|
2242
2140
|
}, []);
|
|
2243
2141
|
const onPlayMedia = react.useCallback(
|
|
2244
2142
|
(elementId) => {
|
|
2245
|
-
|
|
2143
|
+
chunkSN5EUDIT_js.toggleStageElementMedia(containerRef.current, elementId);
|
|
2246
2144
|
},
|
|
2247
2145
|
[containerRef]
|
|
2248
2146
|
);
|
|
2249
2147
|
const onOleVerb = react.useCallback(
|
|
2250
2148
|
(verb, elementId) => {
|
|
2251
|
-
const target =
|
|
2149
|
+
const target = chunkSN5EUDIT_js.resolveOleVerbTarget(slides[presentationSlideIndex], elementId, verb);
|
|
2252
2150
|
if (target) {
|
|
2253
|
-
|
|
2151
|
+
chunkSN5EUDIT_js.openUrlInNewTab(target.url);
|
|
2254
2152
|
}
|
|
2255
2153
|
},
|
|
2256
2154
|
[slides, presentationSlideIndex]
|
|
@@ -2280,22 +2178,22 @@ function usePresentationActionExtensions(input) {
|
|
|
2280
2178
|
};
|
|
2281
2179
|
}
|
|
2282
2180
|
function usePresenterConsole(slideIndex, active) {
|
|
2283
|
-
const timerRef = react.useRef(
|
|
2284
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2181
|
+
const timerRef = react.useRef(chunkSN5EUDIT_js.createPresenterTimer());
|
|
2182
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkSN5EUDIT_js.createInitialPresentationSnapshot(slideIndex));
|
|
2285
2183
|
const patch = react.useCallback((value) => {
|
|
2286
|
-
setSnapshot((current) =>
|
|
2184
|
+
setSnapshot((current) => chunkSN5EUDIT_js.mergePresentationSnapshot(current, value));
|
|
2287
2185
|
}, []);
|
|
2288
2186
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2289
2187
|
react.useEffect(() => {
|
|
2290
2188
|
if (!active) {
|
|
2291
2189
|
return;
|
|
2292
2190
|
}
|
|
2293
|
-
timerRef.current =
|
|
2191
|
+
timerRef.current = chunkSN5EUDIT_js.resetPresenterTimer();
|
|
2294
2192
|
patch({ paused: false, elapsedMs: 0 });
|
|
2295
2193
|
const timer = window.setInterval(() => {
|
|
2296
2194
|
patch({
|
|
2297
2195
|
paused: timerRef.current.paused,
|
|
2298
|
-
elapsedMs:
|
|
2196
|
+
elapsedMs: chunkSN5EUDIT_js.presenterElapsed(timerRef.current)
|
|
2299
2197
|
});
|
|
2300
2198
|
}, 1e3);
|
|
2301
2199
|
return () => window.clearInterval(timer);
|
|
@@ -2305,19 +2203,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2305
2203
|
applyAudienceSnapshot: setSnapshot,
|
|
2306
2204
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2307
2205
|
toggleTimer: () => {
|
|
2308
|
-
timerRef.current =
|
|
2206
|
+
timerRef.current = chunkSN5EUDIT_js.togglePresenterTimer(timerRef.current);
|
|
2309
2207
|
patch({
|
|
2310
2208
|
paused: timerRef.current.paused,
|
|
2311
|
-
elapsedMs:
|
|
2209
|
+
elapsedMs: chunkSN5EUDIT_js.presenterElapsed(timerRef.current)
|
|
2312
2210
|
});
|
|
2313
2211
|
},
|
|
2314
2212
|
resetTimer: () => {
|
|
2315
|
-
timerRef.current =
|
|
2213
|
+
timerRef.current = chunkSN5EUDIT_js.resetPresenterTimer();
|
|
2316
2214
|
patch({ paused: false, elapsedMs: 0 });
|
|
2317
2215
|
},
|
|
2318
2216
|
stepZoom: (direction) => setSnapshot(
|
|
2319
|
-
(current) =>
|
|
2320
|
-
zoom:
|
|
2217
|
+
(current) => chunkSN5EUDIT_js.mergePresentationSnapshot(current, {
|
|
2218
|
+
zoom: chunkSN5EUDIT_js.stepPresenterZoom(
|
|
2321
2219
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2322
2220
|
direction
|
|
2323
2221
|
)
|
|
@@ -2368,7 +2266,7 @@ function usePresentationMode(input) {
|
|
|
2368
2266
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2369
2267
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2370
2268
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2371
|
-
const showGuard = react.useMemo(() =>
|
|
2269
|
+
const showGuard = react.useMemo(() => chunkSN5EUDIT_js.createPresenterShowGuard(), []);
|
|
2372
2270
|
const {
|
|
2373
2271
|
presentationAnimations,
|
|
2374
2272
|
presentationElementStates,
|
|
@@ -2459,7 +2357,7 @@ function usePresentationMode(input) {
|
|
|
2459
2357
|
actionExtensions.bindNavigateToSlide(navigateToSlide);
|
|
2460
2358
|
const movePresentationSlide = react.useCallback(
|
|
2461
2359
|
(direction, trigger = "explicit") => {
|
|
2462
|
-
if (!
|
|
2360
|
+
if (!chunkSN5EUDIT_js.acceptsPresentationInput()) {
|
|
2463
2361
|
return;
|
|
2464
2362
|
}
|
|
2465
2363
|
if (endOfShowVisible) {
|
|
@@ -2528,7 +2426,7 @@ function usePresentationMode(input) {
|
|
|
2528
2426
|
onSetMode("present");
|
|
2529
2427
|
}, [containerRef, onSetMode, setRehearsing]);
|
|
2530
2428
|
const enterPresentModeFromBeginning = react.useCallback(() => {
|
|
2531
|
-
const first =
|
|
2429
|
+
const first = chunkSN5EUDIT_js.firstShowSlideIndex(visibleSlideIndexes);
|
|
2532
2430
|
if (first !== void 0) {
|
|
2533
2431
|
onSetActiveSlideIndex(first);
|
|
2534
2432
|
}
|
|
@@ -2608,7 +2506,7 @@ function usePresentationMode(input) {
|
|
|
2608
2506
|
if (mode !== "present") {
|
|
2609
2507
|
return;
|
|
2610
2508
|
}
|
|
2611
|
-
return
|
|
2509
|
+
return chunkSN5EUDIT_js.attachPresentationVisibilityPause({
|
|
2612
2510
|
root: containerRef.current ?? void 0,
|
|
2613
2511
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2614
2512
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2616,7 +2514,7 @@ function usePresentationMode(input) {
|
|
|
2616
2514
|
}, [mode, containerRef]);
|
|
2617
2515
|
react.useLayoutEffect(() => {
|
|
2618
2516
|
if (mode === "present") {
|
|
2619
|
-
const idx =
|
|
2517
|
+
const idx = chunkSN5EUDIT_js.presentationEntrySlideIndex(
|
|
2620
2518
|
activeSlideIndexRef.current,
|
|
2621
2519
|
visibleSlideIndexesRef.current
|
|
2622
2520
|
);
|
|
@@ -2695,11 +2593,11 @@ function usePresentationMode(input) {
|
|
|
2695
2593
|
return void 0;
|
|
2696
2594
|
}
|
|
2697
2595
|
const incoming = slides[transitionOverlay.incomingSlideIndex];
|
|
2698
|
-
return
|
|
2596
|
+
return chunkSN5EUDIT_js.buildMorphTransitionPlan(
|
|
2699
2597
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2700
2598
|
incoming,
|
|
2701
2599
|
transitionOverlay.durationMs,
|
|
2702
|
-
|
|
2600
|
+
chunkSN5EUDIT_js.morphOptionToMode(transitionOverlay.transition.morphOption),
|
|
2703
2601
|
// `PresentationStage` stacks the incoming slide's elements above its
|
|
2704
2602
|
// template shapes (`zIndex = templateElements.length + index`), so a
|
|
2705
2603
|
// z-index journey has to start counting where the stage does.
|
|
@@ -2724,7 +2622,7 @@ function usePresentationMode(input) {
|
|
|
2724
2622
|
if (!morphPlan) {
|
|
2725
2623
|
return presentationKeyframesCss;
|
|
2726
2624
|
}
|
|
2727
|
-
const imageRules =
|
|
2625
|
+
const imageRules = chunkSN5EUDIT_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2728
2626
|
return `${presentationKeyframesCss ?? ""}
|
|
2729
2627
|
${morphPlan.keyframesCss}
|
|
2730
2628
|
${imageRules}`;
|
|
@@ -3021,7 +2919,7 @@ function useFindReplace({
|
|
|
3021
2919
|
const [findResults, setFindResults] = react.useState([]);
|
|
3022
2920
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
3023
2921
|
const performFind = react.useCallback(() => {
|
|
3024
|
-
const results =
|
|
2922
|
+
const results = chunkSN5EUDIT_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
3025
2923
|
if (!findQuery) {
|
|
3026
2924
|
setFindResults([]);
|
|
3027
2925
|
setFindResultIndex(-1);
|
|
@@ -3055,7 +2953,7 @@ function useFindReplace({
|
|
|
3055
2953
|
return;
|
|
3056
2954
|
}
|
|
3057
2955
|
onUpdateSlides(
|
|
3058
|
-
(prevSlides) =>
|
|
2956
|
+
(prevSlides) => chunkSN5EUDIT_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
3059
2957
|
);
|
|
3060
2958
|
onMarkDirty();
|
|
3061
2959
|
},
|
|
@@ -3077,9 +2975,9 @@ function useFindReplace({
|
|
|
3077
2975
|
}, [findResults, applyReplacements, performFind]);
|
|
3078
2976
|
react.useEffect(() => {
|
|
3079
2977
|
const handler = (event) => {
|
|
3080
|
-
const { action } =
|
|
2978
|
+
const { action } = chunkSN5EUDIT_js.mapEditorKey(event, {
|
|
3081
2979
|
canEdit: mode === "edit",
|
|
3082
|
-
isTextInputTarget:
|
|
2980
|
+
isTextInputTarget: chunkSN5EUDIT_js.isEditorTextInputTarget(event.target)
|
|
3083
2981
|
});
|
|
3084
2982
|
if (action !== "find") {
|
|
3085
2983
|
return;
|
|
@@ -3190,7 +3088,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId, ment
|
|
|
3190
3088
|
if (!slide) {
|
|
3191
3089
|
return { slides, didAdd: false };
|
|
3192
3090
|
}
|
|
3193
|
-
const next =
|
|
3091
|
+
const next = chunkSN5EUDIT_js.addCommentToList(
|
|
3194
3092
|
slide.comments || [],
|
|
3195
3093
|
text,
|
|
3196
3094
|
authorName,
|
|
@@ -3211,7 +3109,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
|
3211
3109
|
if (!slide) {
|
|
3212
3110
|
return { slides, didDelete: false };
|
|
3213
3111
|
}
|
|
3214
|
-
const next =
|
|
3112
|
+
const next = chunkSN5EUDIT_js.removeCommentFromList(slide.comments || [], commentId);
|
|
3215
3113
|
if (!next) {
|
|
3216
3114
|
return { slides, didDelete: false };
|
|
3217
3115
|
}
|
|
@@ -3222,7 +3120,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
|
3222
3120
|
if (!slide) {
|
|
3223
3121
|
return { slides, didUpdate: false };
|
|
3224
3122
|
}
|
|
3225
|
-
const next =
|
|
3123
|
+
const next = chunkSN5EUDIT_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
3226
3124
|
if (!next) {
|
|
3227
3125
|
return { slides, didUpdate: false };
|
|
3228
3126
|
}
|
|
@@ -3233,7 +3131,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
|
3233
3131
|
if (!slide) {
|
|
3234
3132
|
return { slides, didUpdate: false };
|
|
3235
3133
|
}
|
|
3236
|
-
const next =
|
|
3134
|
+
const next = chunkSN5EUDIT_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
3237
3135
|
if (!next) {
|
|
3238
3136
|
return { slides, didUpdate: false };
|
|
3239
3137
|
}
|
|
@@ -3244,7 +3142,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName, mention
|
|
|
3244
3142
|
if (!slide) {
|
|
3245
3143
|
return { slides, didAdd: false };
|
|
3246
3144
|
}
|
|
3247
|
-
const next =
|
|
3145
|
+
const next = chunkSN5EUDIT_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
3248
3146
|
if (!next) {
|
|
3249
3147
|
return { slides, didAdd: false };
|
|
3250
3148
|
}
|
|
@@ -3631,7 +3529,7 @@ function useDerivedElementState(input) {
|
|
|
3631
3529
|
return [];
|
|
3632
3530
|
}
|
|
3633
3531
|
return [
|
|
3634
|
-
...
|
|
3532
|
+
...chunkSN5EUDIT_js.visibleTemplateElements(activeSlide, templateElementsBySlideId[activeSlide.id] ?? [])
|
|
3635
3533
|
];
|
|
3636
3534
|
}, [activeSlide, templateElementsBySlideId]);
|
|
3637
3535
|
const activeMaster = slideMasters[activeMasterIndex];
|
|
@@ -3698,7 +3596,7 @@ function useViewerCoreState(_input) {
|
|
|
3698
3596
|
const marqueeStateRef = react.useRef(null);
|
|
3699
3597
|
const isDrawingRef = react.useRef(false);
|
|
3700
3598
|
const justInteractedRef = react.useRef(false);
|
|
3701
|
-
const livePatcher = react.useMemo(() =>
|
|
3599
|
+
const livePatcher = react.useMemo(() => chunkSN5EUDIT_js.createCollaborationLivePatcher(), []);
|
|
3702
3600
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3703
3601
|
const slidesRef = react.useRef([]);
|
|
3704
3602
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3707,8 +3605,8 @@ function useViewerCoreState(_input) {
|
|
|
3707
3605
|
const [slides, setSlides] = react.useState([]);
|
|
3708
3606
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3709
3607
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3710
|
-
width:
|
|
3711
|
-
height:
|
|
3608
|
+
width: chunkQWA5YEIZ_js.DEFAULT_CANVAS_WIDTH,
|
|
3609
|
+
height: chunkQWA5YEIZ_js.DEFAULT_CANVAS_HEIGHT
|
|
3712
3610
|
});
|
|
3713
3611
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3714
3612
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3729,7 +3627,7 @@ function useViewerCoreState(_input) {
|
|
|
3729
3627
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3730
3628
|
inlineEditingTextRef.current = resolved;
|
|
3731
3629
|
setInlineEditingTextBase(value);
|
|
3732
|
-
|
|
3630
|
+
chunkSN5EUDIT_js.publishLiveInlineText(
|
|
3733
3631
|
livePatcher,
|
|
3734
3632
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3735
3633
|
inlineEditingElementIdRef.current,
|
|
@@ -3749,6 +3647,8 @@ function useViewerCoreState(_input) {
|
|
|
3749
3647
|
const [recentColors, setRecentColors] = react.useState([]);
|
|
3750
3648
|
const [theme, setTheme] = react.useState();
|
|
3751
3649
|
const [tableStyleMap, setTableStyleMap] = react.useState();
|
|
3650
|
+
const [tableStylesDefaultId, setTableStylesDefaultId] = react.useState();
|
|
3651
|
+
const [tableStylesToDelete, setTableStylesToDelete] = react.useState([]);
|
|
3752
3652
|
const [themeOptions, setThemeOptions] = react.useState([]);
|
|
3753
3653
|
const [customShows, setCustomShows] = react.useState([]);
|
|
3754
3654
|
const [activeCustomShowId, setActiveCustomShowId] = react.useState(null);
|
|
@@ -3848,6 +3748,10 @@ function useViewerCoreState(_input) {
|
|
|
3848
3748
|
setTheme,
|
|
3849
3749
|
tableStyleMap,
|
|
3850
3750
|
setTableStyleMap,
|
|
3751
|
+
tableStylesDefaultId,
|
|
3752
|
+
setTableStylesDefaultId,
|
|
3753
|
+
tableStylesToDelete,
|
|
3754
|
+
setTableStylesToDelete,
|
|
3851
3755
|
themeOptions,
|
|
3852
3756
|
setThemeOptions,
|
|
3853
3757
|
customShows,
|
|
@@ -4032,6 +3936,8 @@ function useLoadContent({
|
|
|
4032
3936
|
setRecentColors,
|
|
4033
3937
|
setTheme,
|
|
4034
3938
|
setTableStyleMap,
|
|
3939
|
+
setTableStylesDefaultId,
|
|
3940
|
+
setTableStylesToDelete,
|
|
4035
3941
|
setThemeOptions,
|
|
4036
3942
|
setCustomShows,
|
|
4037
3943
|
setActiveCustomShowId,
|
|
@@ -4083,7 +3989,7 @@ function useLoadContent({
|
|
|
4083
3989
|
);
|
|
4084
3990
|
}
|
|
4085
3991
|
const previousHandler = handlerRef.current;
|
|
4086
|
-
const handler = new
|
|
3992
|
+
const handler = new chunkSN5EUDIT_js.PptxHandler();
|
|
4087
3993
|
const parsed = await handler.load(buffer, { allowExternalImages });
|
|
4088
3994
|
if (cancelled || token !== renderTokenRef.current) {
|
|
4089
3995
|
handler.dispose();
|
|
@@ -4095,7 +4001,7 @@ function useLoadContent({
|
|
|
4095
4001
|
handlerRef.current = null;
|
|
4096
4002
|
const mediaElements = [];
|
|
4097
4003
|
for (const slide of parsed.slides) {
|
|
4098
|
-
|
|
4004
|
+
chunkSN5EUDIT_js.collectMediaElements(slide.elements, mediaElements);
|
|
4099
4005
|
}
|
|
4100
4006
|
for (const url of mediaDataUrls.values()) {
|
|
4101
4007
|
if (url.startsWith("blob:")) {
|
|
@@ -4105,7 +4011,7 @@ function useLoadContent({
|
|
|
4105
4011
|
mediaDataUrls.clear();
|
|
4106
4012
|
await Promise.all(
|
|
4107
4013
|
mediaElements.map(async (mediaElement) => {
|
|
4108
|
-
const resolved = await
|
|
4014
|
+
const resolved = await chunkSN5EUDIT_js.resolveMediaElementSource(mediaElement, handler);
|
|
4109
4015
|
if (resolved.missing || !resolved.mediaPath || !resolved.url) {
|
|
4110
4016
|
mediaElement.mediaMissing = true;
|
|
4111
4017
|
return;
|
|
@@ -4116,7 +4022,7 @@ function useLoadContent({
|
|
|
4116
4022
|
}
|
|
4117
4023
|
})
|
|
4118
4024
|
);
|
|
4119
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
4025
|
+
const { paths: imagePaths, refs: imageRefs } = chunkSN5EUDIT_js.collectImagePaths(parsed.slides);
|
|
4120
4026
|
let nextSlides = parsed.slides;
|
|
4121
4027
|
if (imagePaths.size > 0) {
|
|
4122
4028
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -4132,25 +4038,25 @@ function useLoadContent({
|
|
|
4132
4038
|
})
|
|
4133
4039
|
);
|
|
4134
4040
|
nextSlides = parsed.slides.map((s) => {
|
|
4135
|
-
const newElements =
|
|
4041
|
+
const newElements = chunkSN5EUDIT_js.applyImagePathPatches(s.elements, resolvedMap, imageRefs);
|
|
4136
4042
|
return newElements === s.elements ? s : { ...s, elements: newElements };
|
|
4137
4043
|
});
|
|
4138
4044
|
}
|
|
4139
|
-
nextSlides = await
|
|
4045
|
+
nextSlides = await chunkSN5EUDIT_js.resolveTableCellImageUrls(
|
|
4140
4046
|
nextSlides,
|
|
4141
4047
|
(path) => handler.getImageData(path)
|
|
4142
4048
|
);
|
|
4143
|
-
const nextTableStyleMap = await
|
|
4049
|
+
const nextTableStyleMap = await chunkSN5EUDIT_js.resolveTableStyleImageUrls(
|
|
4144
4050
|
parsed.tableStyleMap,
|
|
4145
4051
|
(path) => handler.getImageData(path)
|
|
4146
4052
|
);
|
|
4147
4053
|
handlerRef.current = handler;
|
|
4148
|
-
const partition =
|
|
4054
|
+
const partition = chunkSN5EUDIT_js.partitionTemplateElements(nextSlides);
|
|
4149
4055
|
setSlides(partition.slides);
|
|
4150
4056
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4151
4057
|
setCanvasSize({
|
|
4152
|
-
width: parsed.width ??
|
|
4153
|
-
height: parsed.height ??
|
|
4058
|
+
width: parsed.width ?? chunkQWA5YEIZ_js.DEFAULT_CANVAS_WIDTH,
|
|
4059
|
+
height: parsed.height ?? chunkQWA5YEIZ_js.DEFAULT_CANVAS_HEIGHT
|
|
4154
4060
|
});
|
|
4155
4061
|
setSlideSizeEmu(
|
|
4156
4062
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4163,13 +4069,15 @@ function useLoadContent({
|
|
|
4163
4069
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
4164
4070
|
setSlideMasters(parsed.slideMasters ?? []);
|
|
4165
4071
|
setModernCommentAuthors(parsed.modernCommentAuthors ?? []);
|
|
4166
|
-
setRecentColors(
|
|
4072
|
+
setRecentColors(chunkSN5EUDIT_js.seedRecentColors({ mruColors: parsed.mruColors }));
|
|
4167
4073
|
setTheme(parsed.theme);
|
|
4168
4074
|
setTableStyleMap(nextTableStyleMap);
|
|
4075
|
+
setTableStylesDefaultId(parsed.tableStylesDefaultId);
|
|
4076
|
+
setTableStylesToDelete([]);
|
|
4169
4077
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
4170
4078
|
setCustomShows(parsed.customShows ?? []);
|
|
4171
4079
|
setActiveCustomShowId(
|
|
4172
|
-
|
|
4080
|
+
chunkSN5EUDIT_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
4173
4081
|
);
|
|
4174
4082
|
setSections(parsed.sections ?? []);
|
|
4175
4083
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -4192,10 +4100,10 @@ function useLoadContent({
|
|
|
4192
4100
|
setHasMacros(parsed.hasMacros === true);
|
|
4193
4101
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4194
4102
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4195
|
-
setGuides(
|
|
4196
|
-
setReadOnlyRecommendation(
|
|
4103
|
+
setGuides(chunkSN5EUDIT_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4104
|
+
setReadOnlyRecommendation(chunkSN5EUDIT_js.readOnlyRecommendation(parsed));
|
|
4197
4105
|
setCompatToasts(
|
|
4198
|
-
|
|
4106
|
+
chunkSN5EUDIT_js.compatibilityWarningToasts([
|
|
4199
4107
|
...parsed.warnings ?? [],
|
|
4200
4108
|
...parsed.slides.flatMap((slide) => slide.warnings ?? [])
|
|
4201
4109
|
])
|
|
@@ -4207,7 +4115,7 @@ function useLoadContent({
|
|
|
4207
4115
|
onContentApplied?.();
|
|
4208
4116
|
} catch (err) {
|
|
4209
4117
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4210
|
-
if (err instanceof
|
|
4118
|
+
if (err instanceof chunkSN5EUDIT_js.EncryptedFileError) {
|
|
4211
4119
|
setIsEncrypted(true);
|
|
4212
4120
|
} else {
|
|
4213
4121
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4235,7 +4143,7 @@ function useLoadContent({
|
|
|
4235
4143
|
}
|
|
4236
4144
|
function useAutosave(input) {
|
|
4237
4145
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4238
|
-
const intervalMs =
|
|
4146
|
+
const intervalMs = chunkSN5EUDIT_js.resolveAutosaveIntervalMs({
|
|
4239
4147
|
hostIntervalMs: input.intervalMs,
|
|
4240
4148
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4241
4149
|
});
|
|
@@ -4266,7 +4174,7 @@ function useAutosave(input) {
|
|
|
4266
4174
|
return;
|
|
4267
4175
|
}
|
|
4268
4176
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4269
|
-
if (!
|
|
4177
|
+
if (!chunkSN5EUDIT_js.shouldWriteAutosaveSnapshot({
|
|
4270
4178
|
filePath: path,
|
|
4271
4179
|
isDirty: isDirtyRef.current,
|
|
4272
4180
|
saving: isSavingRef.current,
|
|
@@ -4284,8 +4192,8 @@ function useAutosave(input) {
|
|
|
4284
4192
|
isSavingRef.current = false;
|
|
4285
4193
|
return;
|
|
4286
4194
|
}
|
|
4287
|
-
await
|
|
4288
|
-
lastSnapshotRef.current =
|
|
4195
|
+
await chunkSN5EUDIT_js.saveAutosaveSnapshot(path, data);
|
|
4196
|
+
lastSnapshotRef.current = chunkSN5EUDIT_js.autosaveSnapshotMark(path, sources);
|
|
4289
4197
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4290
4198
|
} catch (err) {
|
|
4291
4199
|
setAutosaveStatus({
|
|
@@ -4339,13 +4247,13 @@ function useElementOperations(input) {
|
|
|
4339
4247
|
inlineEditingText
|
|
4340
4248
|
} = input;
|
|
4341
4249
|
const liveTextSegments = react.useCallback(() => {
|
|
4342
|
-
if (!selectedElement || !
|
|
4250
|
+
if (!selectedElement || !chunkSN5EUDIT_js.hasTextProperties(selectedElement)) {
|
|
4343
4251
|
return void 0;
|
|
4344
4252
|
}
|
|
4345
4253
|
if (selectedElement.id !== inlineEditingElementId) {
|
|
4346
4254
|
return selectedElement.textSegments;
|
|
4347
4255
|
}
|
|
4348
|
-
return
|
|
4256
|
+
return chunkSN5EUDIT_js.remapTextToSegments(
|
|
4349
4257
|
inlineEditingText,
|
|
4350
4258
|
selectedElement.textSegments,
|
|
4351
4259
|
selectedElement.textStyle
|
|
@@ -4386,11 +4294,11 @@ function useElementOperations(input) {
|
|
|
4386
4294
|
(elementId, updates) => {
|
|
4387
4295
|
if (masterView?.target) {
|
|
4388
4296
|
applyMasterViewWrite(
|
|
4389
|
-
|
|
4297
|
+
chunkSN5EUDIT_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4390
4298
|
);
|
|
4391
4299
|
return;
|
|
4392
4300
|
}
|
|
4393
|
-
if (
|
|
4301
|
+
if (chunkSN5EUDIT_js.isTemplateElementId(elementId)) {
|
|
4394
4302
|
const slideId = activeSlide?.id;
|
|
4395
4303
|
if (slideId) {
|
|
4396
4304
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4401,7 +4309,7 @@ function useElementOperations(input) {
|
|
|
4401
4309
|
}));
|
|
4402
4310
|
}
|
|
4403
4311
|
} else {
|
|
4404
|
-
setSlides((prev) =>
|
|
4312
|
+
setSlides((prev) => chunkSN5EUDIT_js.updateElement(prev, activeSlideIndex, elementId, updates));
|
|
4405
4313
|
}
|
|
4406
4314
|
history.markDirty();
|
|
4407
4315
|
},
|
|
@@ -4426,7 +4334,7 @@ function useElementOperations(input) {
|
|
|
4426
4334
|
);
|
|
4427
4335
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4428
4336
|
(updates) => {
|
|
4429
|
-
if (!selectedElement || !
|
|
4337
|
+
if (!selectedElement || !chunkSN5EUDIT_js.hasShapeProperties(selectedElement)) {
|
|
4430
4338
|
return;
|
|
4431
4339
|
}
|
|
4432
4340
|
updateSelectedElement({
|
|
@@ -4437,19 +4345,19 @@ function useElementOperations(input) {
|
|
|
4437
4345
|
);
|
|
4438
4346
|
const updateSelectedTextStyle = react.useCallback(
|
|
4439
4347
|
(updates) => {
|
|
4440
|
-
if (!selectedElement || !
|
|
4348
|
+
if (!selectedElement || !chunkSN5EUDIT_js.hasTextProperties(selectedElement)) {
|
|
4441
4349
|
return;
|
|
4442
4350
|
}
|
|
4443
4351
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4444
4352
|
const currentSegments = liveTextSegments();
|
|
4445
|
-
const inlineSel =
|
|
4353
|
+
const inlineSel = chunkSN5EUDIT_js.getInlineEditorSelection(currentSegments);
|
|
4446
4354
|
if (inlineSel && currentSegments) {
|
|
4447
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4355
|
+
const { newSegments: newSegments2, newSelection } = chunkSN5EUDIT_js.applyStyleToSelectedSegments(
|
|
4448
4356
|
currentSegments,
|
|
4449
4357
|
inlineSel,
|
|
4450
4358
|
updates
|
|
4451
4359
|
);
|
|
4452
|
-
|
|
4360
|
+
chunkSN5EUDIT_js.setPendingSelectionRestore(newSelection);
|
|
4453
4361
|
updateSelectedElement({
|
|
4454
4362
|
textSegments: newSegments2,
|
|
4455
4363
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4477,14 +4385,14 @@ function useElementOperations(input) {
|
|
|
4477
4385
|
);
|
|
4478
4386
|
const updateSelectedTextCase = react.useCallback(
|
|
4479
4387
|
(mode) => {
|
|
4480
|
-
if (!selectedElement || !
|
|
4388
|
+
if (!selectedElement || !chunkSN5EUDIT_js.hasTextProperties(selectedElement)) {
|
|
4481
4389
|
return;
|
|
4482
4390
|
}
|
|
4483
4391
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4484
4392
|
const currentSegments = liveTextSegments();
|
|
4485
|
-
const inlineSel =
|
|
4393
|
+
const inlineSel = chunkSN5EUDIT_js.getInlineEditorSelection(currentSegments);
|
|
4486
4394
|
if (inlineSel && currentSegments) {
|
|
4487
|
-
const newSegments =
|
|
4395
|
+
const newSegments = chunkSN5EUDIT_js.applyCaseTransformToSegments(currentSegments, inlineSel, mode);
|
|
4488
4396
|
updateSelectedElement({
|
|
4489
4397
|
textSegments: newSegments,
|
|
4490
4398
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4493,7 +4401,7 @@ function useElementOperations(input) {
|
|
|
4493
4401
|
}
|
|
4494
4402
|
const updates = {};
|
|
4495
4403
|
if (currentSegments && currentSegments.length > 0) {
|
|
4496
|
-
updates.textSegments =
|
|
4404
|
+
updates.textSegments = chunkSN5EUDIT_js.applyCaseTransformToSegments(
|
|
4497
4405
|
currentSegments,
|
|
4498
4406
|
null,
|
|
4499
4407
|
mode
|
|
@@ -4501,7 +4409,7 @@ function useElementOperations(input) {
|
|
|
4501
4409
|
}
|
|
4502
4410
|
const baseText = isLiveEditing ? inlineEditingText : selectedElement.text;
|
|
4503
4411
|
if (typeof baseText === "string") {
|
|
4504
|
-
updates.text =
|
|
4412
|
+
updates.text = chunkSN5EUDIT_js.transformTextCase(baseText, mode);
|
|
4505
4413
|
}
|
|
4506
4414
|
updateSelectedElement(updates);
|
|
4507
4415
|
},
|
|
@@ -4520,15 +4428,15 @@ function useElementOperations(input) {
|
|
|
4520
4428
|
[setSlides]
|
|
4521
4429
|
);
|
|
4522
4430
|
const masterViewTarget = masterView?.target ?? null;
|
|
4523
|
-
const activeElements = masterViewTarget ?
|
|
4431
|
+
const activeElements = masterViewTarget ? chunkSN5EUDIT_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4524
4432
|
const updateActiveElements = react.useCallback(
|
|
4525
4433
|
(updater) => {
|
|
4526
4434
|
if (masterView?.target) {
|
|
4527
4435
|
applyMasterViewWrite(
|
|
4528
|
-
|
|
4436
|
+
chunkSN5EUDIT_js.replaceMasterViewElements(
|
|
4529
4437
|
masterView,
|
|
4530
4438
|
masterView.target,
|
|
4531
|
-
updater(
|
|
4439
|
+
updater(chunkSN5EUDIT_js.masterViewElements(masterView, masterView.target))
|
|
4532
4440
|
)
|
|
4533
4441
|
);
|
|
4534
4442
|
return;
|
|
@@ -4581,7 +4489,7 @@ function useSectionOperations(input) {
|
|
|
4581
4489
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4582
4490
|
const addSection2 = react.useCallback(
|
|
4583
4491
|
(name, afterSlideIndex) => {
|
|
4584
|
-
const result =
|
|
4492
|
+
const result = chunkSN5EUDIT_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4585
4493
|
setSlides(result.slides);
|
|
4586
4494
|
setSections(result.sections);
|
|
4587
4495
|
markDirty();
|
|
@@ -4590,7 +4498,7 @@ function useSectionOperations(input) {
|
|
|
4590
4498
|
);
|
|
4591
4499
|
const renameSection2 = react.useCallback(
|
|
4592
4500
|
(sectionId, newName) => {
|
|
4593
|
-
const result =
|
|
4501
|
+
const result = chunkSN5EUDIT_js.renameSection(sections, slides, sectionId, newName);
|
|
4594
4502
|
setSections(result.sections);
|
|
4595
4503
|
setSlides(result.slides);
|
|
4596
4504
|
markDirty();
|
|
@@ -4599,7 +4507,7 @@ function useSectionOperations(input) {
|
|
|
4599
4507
|
);
|
|
4600
4508
|
const deleteSection2 = react.useCallback(
|
|
4601
4509
|
(sectionId) => {
|
|
4602
|
-
const result =
|
|
4510
|
+
const result = chunkSN5EUDIT_js.deleteSection(sections, slides, sectionId);
|
|
4603
4511
|
setSections(result.sections);
|
|
4604
4512
|
setSlides(result.slides);
|
|
4605
4513
|
markDirty();
|
|
@@ -4608,21 +4516,21 @@ function useSectionOperations(input) {
|
|
|
4608
4516
|
);
|
|
4609
4517
|
const moveSectionUp2 = react.useCallback(
|
|
4610
4518
|
(sectionId) => {
|
|
4611
|
-
setSections(
|
|
4519
|
+
setSections(chunkSN5EUDIT_js.moveSectionUp(sections, sectionId));
|
|
4612
4520
|
markDirty();
|
|
4613
4521
|
},
|
|
4614
4522
|
[sections, setSections, markDirty]
|
|
4615
4523
|
);
|
|
4616
4524
|
const moveSectionDown2 = react.useCallback(
|
|
4617
4525
|
(sectionId) => {
|
|
4618
|
-
setSections(
|
|
4526
|
+
setSections(chunkSN5EUDIT_js.moveSectionDown(sections, sectionId));
|
|
4619
4527
|
markDirty();
|
|
4620
4528
|
},
|
|
4621
4529
|
[sections, setSections, markDirty]
|
|
4622
4530
|
);
|
|
4623
4531
|
const moveSlidesToSection2 = react.useCallback(
|
|
4624
4532
|
(slideIndexes, targetSectionId) => {
|
|
4625
|
-
const result =
|
|
4533
|
+
const result = chunkSN5EUDIT_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4626
4534
|
setSlides(result.slides);
|
|
4627
4535
|
setSections(result.sections);
|
|
4628
4536
|
markDirty();
|
|
@@ -4688,15 +4596,15 @@ function syncSelectionHandleOverlay(elementNode, elementId, geometry) {
|
|
|
4688
4596
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4689
4597
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
|
|
4690
4598
|
const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
|
|
4691
|
-
let resized =
|
|
4599
|
+
let resized = chunkSN5EUDIT_js.applyResize(startBox, handle, dx, dy, 1, { minSize: chunkQWA5YEIZ_js.MIN_ELEMENT_SIZE });
|
|
4692
4600
|
if (lockAspect) {
|
|
4693
|
-
resized =
|
|
4601
|
+
resized = chunkSN5EUDIT_js.lockResizeAspect(resized, startBox, handle, chunkQWA5YEIZ_js.MIN_ELEMENT_SIZE);
|
|
4694
4602
|
}
|
|
4695
4603
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4696
4604
|
if (!snapToGrid) {
|
|
4697
4605
|
return box;
|
|
4698
4606
|
}
|
|
4699
|
-
return
|
|
4607
|
+
return chunkSN5EUDIT_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkQWA5YEIZ_js.MIN_ELEMENT_SIZE);
|
|
4700
4608
|
}
|
|
4701
4609
|
function resolveLiveTarget(input) {
|
|
4702
4610
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4809,7 +4717,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4809
4717
|
width: el.width,
|
|
4810
4718
|
height: el.height
|
|
4811
4719
|
}));
|
|
4812
|
-
const snapResult =
|
|
4720
|
+
const snapResult = chunkSN5EUDIT_js.computeSnapToShape(
|
|
4813
4721
|
targetX,
|
|
4814
4722
|
targetY,
|
|
4815
4723
|
primaryEl.width,
|
|
@@ -4851,7 +4759,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4851
4759
|
if (live) {
|
|
4852
4760
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4853
4761
|
const start = drag.startPositionsById[id];
|
|
4854
|
-
|
|
4762
|
+
chunkSN5EUDIT_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4855
4763
|
x: start.x + appliedDx,
|
|
4856
4764
|
y: start.y + appliedDy
|
|
4857
4765
|
});
|
|
@@ -4883,8 +4791,8 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4883
4791
|
rs.lastY = geo.y;
|
|
4884
4792
|
rs.lastWidth = geo.width;
|
|
4885
4793
|
rs.lastHeight = geo.height;
|
|
4886
|
-
const width = Math.max(geo.width,
|
|
4887
|
-
const height = Math.max(geo.height,
|
|
4794
|
+
const width = Math.max(geo.width, chunkQWA5YEIZ_js.MIN_ELEMENT_SIZE);
|
|
4795
|
+
const height = Math.max(geo.height, chunkQWA5YEIZ_js.MIN_ELEMENT_SIZE);
|
|
4888
4796
|
if (rs.domEl) {
|
|
4889
4797
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4890
4798
|
rs.domEl.style.top = `${geo.y}px`;
|
|
@@ -4893,7 +4801,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4893
4801
|
syncSelectionHandleOverlay(rs.domEl, rs.elementId, { x: geo.x, y: geo.y, width, height });
|
|
4894
4802
|
}
|
|
4895
4803
|
if (live) {
|
|
4896
|
-
|
|
4804
|
+
chunkSN5EUDIT_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4897
4805
|
x: geo.x,
|
|
4898
4806
|
y: geo.y,
|
|
4899
4807
|
width,
|
|
@@ -4904,7 +4812,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4904
4812
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4905
4813
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4906
4814
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4907
|
-
const adjustments =
|
|
4815
|
+
const adjustments = chunkSN5EUDIT_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4908
4816
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4909
4817
|
adj.moved = true;
|
|
4910
4818
|
}
|
|
@@ -4979,13 +4887,13 @@ function processPointerUp(input) {
|
|
|
4979
4887
|
if (i !== activeSlideIndex) {
|
|
4980
4888
|
return s;
|
|
4981
4889
|
}
|
|
4982
|
-
const rerouted =
|
|
4890
|
+
const rerouted = chunkSN5EUDIT_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4983
4891
|
if (rerouted.length === 0) {
|
|
4984
4892
|
return s;
|
|
4985
4893
|
}
|
|
4986
4894
|
return {
|
|
4987
4895
|
...s,
|
|
4988
|
-
elements:
|
|
4896
|
+
elements: chunkSN5EUDIT_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4989
4897
|
};
|
|
4990
4898
|
})
|
|
4991
4899
|
);
|
|
@@ -5010,9 +4918,9 @@ function processPointerUp(input) {
|
|
|
5010
4918
|
}
|
|
5011
4919
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
5012
4920
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
5013
|
-
const hitIds =
|
|
4921
|
+
const hitIds = chunkSN5EUDIT_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
5014
4922
|
if (marquee.additive) {
|
|
5015
|
-
const merged =
|
|
4923
|
+
const merged = chunkSN5EUDIT_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
5016
4924
|
if (merged.length > 0) {
|
|
5017
4925
|
applySelection(merged[0], merged);
|
|
5018
4926
|
} else {
|
|
@@ -5035,8 +4943,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
5035
4943
|
}
|
|
5036
4944
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
5037
4945
|
});
|
|
5038
|
-
const rerouted =
|
|
5039
|
-
return
|
|
4946
|
+
const rerouted = chunkSN5EUDIT_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4947
|
+
return chunkSN5EUDIT_js.applyReroutedConnectors(movedElements, rerouted);
|
|
5040
4948
|
};
|
|
5041
4949
|
if (editTemplateMode) {
|
|
5042
4950
|
const slideId = activeSlide?.id;
|
|
@@ -5192,12 +5100,12 @@ function useCanvasInteractions(input) {
|
|
|
5192
5100
|
return;
|
|
5193
5101
|
}
|
|
5194
5102
|
const el = elementLookup.get(editId);
|
|
5195
|
-
if (el &&
|
|
5103
|
+
if (el && chunkSN5EUDIT_js.hasTextProperties(el)) {
|
|
5196
5104
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
5197
|
-
const newSegments =
|
|
5105
|
+
const newSegments = chunkSN5EUDIT_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
5198
5106
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
5199
|
-
const newHeight =
|
|
5200
|
-
const shrink =
|
|
5107
|
+
const newHeight = chunkSN5EUDIT_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
5108
|
+
const shrink = chunkSN5EUDIT_js.resolveInlineEditNormAutofitShrink(el.textStyle, el.height, editorEl);
|
|
5201
5109
|
ops.updateElementById(editId, {
|
|
5202
5110
|
text: committedText,
|
|
5203
5111
|
textSegments: newSegments,
|
|
@@ -5216,7 +5124,7 @@ function useCanvasInteractions(input) {
|
|
|
5216
5124
|
setInlineEditingText("");
|
|
5217
5125
|
};
|
|
5218
5126
|
const openEquationEditorForElement = (el) => {
|
|
5219
|
-
if (!
|
|
5127
|
+
if (!chunkSN5EUDIT_js.hasTextProperties(el)) {
|
|
5220
5128
|
return false;
|
|
5221
5129
|
}
|
|
5222
5130
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5246,7 +5154,7 @@ function useCanvasInteractions(input) {
|
|
|
5246
5154
|
justInteractedRef.current = false;
|
|
5247
5155
|
} else {
|
|
5248
5156
|
const el = elementLookup.get(elementId);
|
|
5249
|
-
if (el &&
|
|
5157
|
+
if (el && chunkSN5EUDIT_js.hasTextProperties(el) && chunkSN5EUDIT_js.canInteractWithElement(el, "textEdit")) {
|
|
5250
5158
|
if (!openEquationEditorForElement(el)) {
|
|
5251
5159
|
setInlineEditingElementId(elementId);
|
|
5252
5160
|
setInlineEditingText(el.text ?? "");
|
|
@@ -5265,7 +5173,7 @@ function useCanvasInteractions(input) {
|
|
|
5265
5173
|
if (openEquationEditorForElement(el)) {
|
|
5266
5174
|
return;
|
|
5267
5175
|
}
|
|
5268
|
-
if (
|
|
5176
|
+
if (chunkSN5EUDIT_js.hasTextProperties(el) && chunkSN5EUDIT_js.canInteractWithElement(el, "textEdit")) {
|
|
5269
5177
|
setInlineEditingElementId(elementId);
|
|
5270
5178
|
setInlineEditingText(el.text ?? "");
|
|
5271
5179
|
}
|
|
@@ -5288,7 +5196,7 @@ function useCanvasInteractions(input) {
|
|
|
5288
5196
|
justSelectedRef.current = false;
|
|
5289
5197
|
}
|
|
5290
5198
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
5291
|
-
const movableIds =
|
|
5199
|
+
const movableIds = chunkSN5EUDIT_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
5292
5200
|
if (movableIds.length === 0) {
|
|
5293
5201
|
return;
|
|
5294
5202
|
}
|
|
@@ -5358,7 +5266,7 @@ function useCanvasInteractions(input) {
|
|
|
5358
5266
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5359
5267
|
e.stopPropagation();
|
|
5360
5268
|
const el = elementLookup.get(elementId);
|
|
5361
|
-
if (!el || !
|
|
5269
|
+
if (!el || !chunkSN5EUDIT_js.canInteractWithElement(el, "resize")) {
|
|
5362
5270
|
return;
|
|
5363
5271
|
}
|
|
5364
5272
|
resizeStateRef.current = {
|
|
@@ -5380,7 +5288,7 @@ function useCanvasInteractions(input) {
|
|
|
5380
5288
|
};
|
|
5381
5289
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5382
5290
|
const el = elementLookup.get(elementId);
|
|
5383
|
-
if (!el || !
|
|
5291
|
+
if (!el || !chunkSN5EUDIT_js.canInteractWithElement(el, "rotate")) {
|
|
5384
5292
|
return;
|
|
5385
5293
|
}
|
|
5386
5294
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5400,10 +5308,10 @@ function useCanvasInteractions(input) {
|
|
|
5400
5308
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5401
5309
|
e.stopPropagation();
|
|
5402
5310
|
const el = elementLookup.get(elementId);
|
|
5403
|
-
if (!el || !
|
|
5311
|
+
if (!el || !chunkSN5EUDIT_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5404
5312
|
return;
|
|
5405
5313
|
}
|
|
5406
|
-
shapeAdjustmentDragStateRef.current =
|
|
5314
|
+
shapeAdjustmentDragStateRef.current = chunkSN5EUDIT_js.beginShapeAdjustment(
|
|
5407
5315
|
el,
|
|
5408
5316
|
descriptor,
|
|
5409
5317
|
e.clientX,
|
|
@@ -5450,7 +5358,7 @@ function createFileHandlers(deps) {
|
|
|
5450
5358
|
h = Math.round(h * scale);
|
|
5451
5359
|
}
|
|
5452
5360
|
addElement({
|
|
5453
|
-
id:
|
|
5361
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
5454
5362
|
type: "image",
|
|
5455
5363
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5456
5364
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5461,7 +5369,7 @@ function createFileHandlers(deps) {
|
|
|
5461
5369
|
};
|
|
5462
5370
|
img.onerror = () => {
|
|
5463
5371
|
addElement({
|
|
5464
|
-
id:
|
|
5372
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
5465
5373
|
type: "image",
|
|
5466
5374
|
x: 100,
|
|
5467
5375
|
y: 100,
|
|
@@ -5480,14 +5388,14 @@ function createFileHandlers(deps) {
|
|
|
5480
5388
|
return;
|
|
5481
5389
|
}
|
|
5482
5390
|
e.target.value = "";
|
|
5483
|
-
const mediaType =
|
|
5391
|
+
const mediaType = chunkSN5EUDIT_js.classifyMediaType(file.type);
|
|
5484
5392
|
if (!mediaType) {
|
|
5485
5393
|
return;
|
|
5486
5394
|
}
|
|
5487
5395
|
const elFilePath = file.path;
|
|
5488
5396
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5489
5397
|
addElement({
|
|
5490
|
-
id:
|
|
5398
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
5491
5399
|
type: "media",
|
|
5492
5400
|
mediaType,
|
|
5493
5401
|
mediaMimeType: file.type || void 0,
|
|
@@ -5662,13 +5570,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5662
5570
|
return;
|
|
5663
5571
|
}
|
|
5664
5572
|
addElement({
|
|
5665
|
-
id:
|
|
5573
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
5666
5574
|
type: "smartArt",
|
|
5667
5575
|
x: 100,
|
|
5668
5576
|
y: 120,
|
|
5669
5577
|
width: 600,
|
|
5670
5578
|
height: 340,
|
|
5671
|
-
smartArtData:
|
|
5579
|
+
smartArtData: chunkSN5EUDIT_js.buildSmartArtPresetData(
|
|
5672
5580
|
layout,
|
|
5673
5581
|
defaultItems,
|
|
5674
5582
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5680,7 +5588,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5680
5588
|
return;
|
|
5681
5589
|
}
|
|
5682
5590
|
addElement({
|
|
5683
|
-
id:
|
|
5591
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
5684
5592
|
type: "shape",
|
|
5685
5593
|
x: 120,
|
|
5686
5594
|
y: 200,
|
|
@@ -5718,7 +5626,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5718
5626
|
return;
|
|
5719
5627
|
}
|
|
5720
5628
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5721
|
-
if (resolved.url && !
|
|
5629
|
+
if (resolved.url && !chunkSN5EUDIT_js.isUrlSafe(resolved.url)) {
|
|
5722
5630
|
return;
|
|
5723
5631
|
}
|
|
5724
5632
|
const actionClick = {
|
|
@@ -5742,7 +5650,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5742
5650
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5743
5651
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5744
5652
|
addElement({
|
|
5745
|
-
id:
|
|
5653
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
5746
5654
|
type: "shape",
|
|
5747
5655
|
x: 120,
|
|
5748
5656
|
y: 200,
|
|
@@ -5764,11 +5672,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5764
5672
|
if (!activeSlide) {
|
|
5765
5673
|
return;
|
|
5766
5674
|
}
|
|
5767
|
-
const preset =
|
|
5675
|
+
const preset = chunkSN5EUDIT_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5768
5676
|
if (!preset) {
|
|
5769
5677
|
return;
|
|
5770
5678
|
}
|
|
5771
|
-
const defaultPptxAction =
|
|
5679
|
+
const defaultPptxAction = chunkSN5EUDIT_js.elementActionToPptxAction({
|
|
5772
5680
|
trigger: "click",
|
|
5773
5681
|
type: preset.defaultAction
|
|
5774
5682
|
});
|
|
@@ -5777,7 +5685,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5777
5685
|
defaultPptxAction.highlightClick = true;
|
|
5778
5686
|
}
|
|
5779
5687
|
addElement({
|
|
5780
|
-
id:
|
|
5688
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
5781
5689
|
type: "shape",
|
|
5782
5690
|
x: 150,
|
|
5783
5691
|
y: 150,
|
|
@@ -5844,14 +5752,14 @@ function useInsertElements(input) {
|
|
|
5844
5752
|
return;
|
|
5845
5753
|
}
|
|
5846
5754
|
addElement({
|
|
5847
|
-
id:
|
|
5755
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
5848
5756
|
type: "text",
|
|
5849
5757
|
x: 100,
|
|
5850
5758
|
y: 100,
|
|
5851
5759
|
width: 300,
|
|
5852
5760
|
height: 60,
|
|
5853
5761
|
text: "",
|
|
5854
|
-
textStyle: { fontSize:
|
|
5762
|
+
textStyle: { fontSize: chunkQWA5YEIZ_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5855
5763
|
});
|
|
5856
5764
|
};
|
|
5857
5765
|
const handleAddShape = () => {
|
|
@@ -5859,7 +5767,7 @@ function useInsertElements(input) {
|
|
|
5859
5767
|
return;
|
|
5860
5768
|
}
|
|
5861
5769
|
addElement({
|
|
5862
|
-
id:
|
|
5770
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
5863
5771
|
type: "shape",
|
|
5864
5772
|
x: 150,
|
|
5865
5773
|
y: 150,
|
|
@@ -5878,15 +5786,15 @@ function useInsertElements(input) {
|
|
|
5878
5786
|
return;
|
|
5879
5787
|
}
|
|
5880
5788
|
addElement({
|
|
5881
|
-
...
|
|
5882
|
-
id:
|
|
5789
|
+
...chunkSN5EUDIT_js.newTableElement(chunkQWA5YEIZ_js.DEFAULT_TABLE_ROWS, chunkQWA5YEIZ_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5790
|
+
id: chunkSN5EUDIT_js.generateElementId()
|
|
5883
5791
|
});
|
|
5884
5792
|
};
|
|
5885
5793
|
const handleAddChart = (chartKind) => {
|
|
5886
5794
|
if (!activeSlide) {
|
|
5887
5795
|
return;
|
|
5888
5796
|
}
|
|
5889
|
-
addElement(
|
|
5797
|
+
addElement(chunkSN5EUDIT_js.createDefaultChartElement(chartKind));
|
|
5890
5798
|
};
|
|
5891
5799
|
const structured = createStructuredElementHandlers({
|
|
5892
5800
|
activeSlide,
|
|
@@ -5956,7 +5864,7 @@ function useClipboardHandlers(input) {
|
|
|
5956
5864
|
if (!selectedElement) {
|
|
5957
5865
|
return;
|
|
5958
5866
|
}
|
|
5959
|
-
setClipboardPayload(
|
|
5867
|
+
setClipboardPayload(chunkSN5EUDIT_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5960
5868
|
};
|
|
5961
5869
|
const handleDelete = () => {
|
|
5962
5870
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5973,7 +5881,7 @@ function useClipboardHandlers(input) {
|
|
|
5973
5881
|
handleDelete();
|
|
5974
5882
|
};
|
|
5975
5883
|
const insertClone = (source) => {
|
|
5976
|
-
const clone =
|
|
5884
|
+
const clone = chunkSN5EUDIT_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5977
5885
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5978
5886
|
ops.applySelection(clone.id);
|
|
5979
5887
|
history.markDirty();
|
|
@@ -6008,7 +5916,7 @@ function resolveShapePath(el) {
|
|
|
6008
5916
|
return el.pathData;
|
|
6009
5917
|
}
|
|
6010
5918
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
6011
|
-
const clipPath =
|
|
5919
|
+
const clipPath = chunkSN5EUDIT_js.getPresetShapeClipPath(el.shapeType);
|
|
6012
5920
|
if (clipPath) {
|
|
6013
5921
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
6014
5922
|
if (svgPath) {
|
|
@@ -6059,7 +5967,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
6059
5967
|
return parts.join(" ");
|
|
6060
5968
|
}
|
|
6061
5969
|
function transformPathToGlobal(pathData, el) {
|
|
6062
|
-
const polys =
|
|
5970
|
+
const polys = chunkSN5EUDIT_js.svgPathToPolygons(pathData);
|
|
6063
5971
|
if (polys.length === 0) {
|
|
6064
5972
|
return pathData;
|
|
6065
5973
|
}
|
|
@@ -6079,10 +5987,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
6079
5987
|
y: pt.y * scaleY + el.y
|
|
6080
5988
|
}))
|
|
6081
5989
|
);
|
|
6082
|
-
return
|
|
5990
|
+
return chunkSN5EUDIT_js.polygonsToSvgPath(transformed);
|
|
6083
5991
|
}
|
|
6084
5992
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
6085
|
-
const polys =
|
|
5993
|
+
const polys = chunkSN5EUDIT_js.svgPathToPolygons(pathData);
|
|
6086
5994
|
if (polys.length === 0) {
|
|
6087
5995
|
return pathData;
|
|
6088
5996
|
}
|
|
@@ -6092,10 +6000,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
6092
6000
|
y: pt.y - y
|
|
6093
6001
|
}))
|
|
6094
6002
|
);
|
|
6095
|
-
return
|
|
6003
|
+
return chunkSN5EUDIT_js.polygonsToSvgPath(transformed);
|
|
6096
6004
|
}
|
|
6097
6005
|
function pathBounds(pathData) {
|
|
6098
|
-
const polys =
|
|
6006
|
+
const polys = chunkSN5EUDIT_js.svgPathToPolygons(pathData);
|
|
6099
6007
|
let minX = Infinity;
|
|
6100
6008
|
let minY = Infinity;
|
|
6101
6009
|
let maxX = -Infinity;
|
|
@@ -6154,7 +6062,7 @@ function useMergeShapesHandler(input) {
|
|
|
6154
6062
|
let allFragments = [];
|
|
6155
6063
|
let remaining = globalPaths[0];
|
|
6156
6064
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6157
|
-
const frags =
|
|
6065
|
+
const frags = chunkSN5EUDIT_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
6158
6066
|
if (Array.isArray(frags)) {
|
|
6159
6067
|
allFragments = frags;
|
|
6160
6068
|
}
|
|
@@ -6183,7 +6091,7 @@ function useMergeShapesHandler(input) {
|
|
|
6183
6091
|
bounds.height
|
|
6184
6092
|
);
|
|
6185
6093
|
const newEl = {
|
|
6186
|
-
id:
|
|
6094
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
6187
6095
|
type: "shape",
|
|
6188
6096
|
x: bounds.x,
|
|
6189
6097
|
y: bounds.y,
|
|
@@ -6221,7 +6129,7 @@ function useMergeShapesHandler(input) {
|
|
|
6221
6129
|
} else {
|
|
6222
6130
|
let resultPath = globalPaths[0];
|
|
6223
6131
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6224
|
-
const result =
|
|
6132
|
+
const result = chunkSN5EUDIT_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
6225
6133
|
if (typeof result === "string") {
|
|
6226
6134
|
resultPath = result;
|
|
6227
6135
|
}
|
|
@@ -6242,7 +6150,7 @@ function useMergeShapesHandler(input) {
|
|
|
6242
6150
|
);
|
|
6243
6151
|
const primary = targets[0];
|
|
6244
6152
|
const newEl = {
|
|
6245
|
-
id:
|
|
6153
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
6246
6154
|
type: "shape",
|
|
6247
6155
|
x: bounds.x,
|
|
6248
6156
|
y: bounds.y,
|
|
@@ -6305,10 +6213,10 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6305
6213
|
if (ids.length < 2 || !activeSlide) {
|
|
6306
6214
|
return;
|
|
6307
6215
|
}
|
|
6308
|
-
if (!selectedElements.every((el) =>
|
|
6216
|
+
if (!selectedElements.every((el) => chunkSN5EUDIT_js.canInteractWithElement(el, "group"))) {
|
|
6309
6217
|
return;
|
|
6310
6218
|
}
|
|
6311
|
-
const { elements, groupId } =
|
|
6219
|
+
const { elements, groupId } = chunkSN5EUDIT_js.groupElements(ops.activeElements, ids, chunkSN5EUDIT_js.generateElementId());
|
|
6312
6220
|
if (groupId === null) {
|
|
6313
6221
|
return;
|
|
6314
6222
|
}
|
|
@@ -6320,15 +6228,15 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6320
6228
|
if (!selectedElement || selectedElement.type !== "group" || !activeSlide) {
|
|
6321
6229
|
return;
|
|
6322
6230
|
}
|
|
6323
|
-
if (!
|
|
6231
|
+
if (!chunkSN5EUDIT_js.canInteractWithElement(selectedElement, "group")) {
|
|
6324
6232
|
return;
|
|
6325
6233
|
}
|
|
6326
6234
|
const group = selectedElement;
|
|
6327
|
-
const intoTemplate =
|
|
6235
|
+
const intoTemplate = chunkSN5EUDIT_js.isTemplateElementId(group.id);
|
|
6328
6236
|
const childIds = group.children.map(
|
|
6329
|
-
(child) => intoTemplate ?
|
|
6237
|
+
(child) => intoTemplate ? chunkSN5EUDIT_js.makeCloneId(true, child.id || group.id) : child.id || chunkSN5EUDIT_js.generateElementId()
|
|
6330
6238
|
);
|
|
6331
|
-
const { elements, childIds: usedIds } =
|
|
6239
|
+
const { elements, childIds: usedIds } = chunkSN5EUDIT_js.ungroupElements(
|
|
6332
6240
|
ops.activeElements,
|
|
6333
6241
|
group.id,
|
|
6334
6242
|
childIds,
|
|
@@ -6357,7 +6265,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6357
6265
|
if (!edge) {
|
|
6358
6266
|
return;
|
|
6359
6267
|
}
|
|
6360
|
-
const positions =
|
|
6268
|
+
const positions = chunkSN5EUDIT_js.alignElements(selectedElements, edge);
|
|
6361
6269
|
for (const [id, pos] of positions) {
|
|
6362
6270
|
const el = elementLookup.get(id);
|
|
6363
6271
|
if (!el) {
|
|
@@ -6375,7 +6283,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6375
6283
|
if (!distAxis) {
|
|
6376
6284
|
return;
|
|
6377
6285
|
}
|
|
6378
|
-
const positions =
|
|
6286
|
+
const positions = chunkSN5EUDIT_js.distributeElements(selectedElements, distAxis);
|
|
6379
6287
|
for (const [id, pos] of positions) {
|
|
6380
6288
|
const el = elementLookup.get(id);
|
|
6381
6289
|
if (!el) {
|
|
@@ -6386,14 +6294,14 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6386
6294
|
history.markDirty();
|
|
6387
6295
|
};
|
|
6388
6296
|
const canDistribute = selectedElements.length >= 3;
|
|
6389
|
-
const selectionGroupable = selectedElements.every((el) =>
|
|
6297
|
+
const selectionGroupable = selectedElements.every((el) => chunkSN5EUDIT_js.canInteractWithElement(el, "group"));
|
|
6390
6298
|
const handleMoveLayer = (direction) => {
|
|
6391
6299
|
if (!selectedElement || !activeSlide) {
|
|
6392
6300
|
return;
|
|
6393
6301
|
}
|
|
6394
6302
|
const id = selectedElement.id;
|
|
6395
6303
|
ops.updateActiveElements(
|
|
6396
|
-
(els) => direction === "forward" ?
|
|
6304
|
+
(els) => direction === "forward" ? chunkSN5EUDIT_js.bringForward(els, id) : direction === "backward" ? chunkSN5EUDIT_js.sendBackward(els, id) : els
|
|
6397
6305
|
);
|
|
6398
6306
|
history.markDirty();
|
|
6399
6307
|
};
|
|
@@ -6403,7 +6311,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6403
6311
|
}
|
|
6404
6312
|
const id = selectedElement.id;
|
|
6405
6313
|
ops.updateActiveElements(
|
|
6406
|
-
(els) => direction === "front" ?
|
|
6314
|
+
(els) => direction === "front" ? chunkSN5EUDIT_js.bringToFront(els, id) : chunkSN5EUDIT_js.sendToBack(els, id)
|
|
6407
6315
|
);
|
|
6408
6316
|
history.markDirty();
|
|
6409
6317
|
};
|
|
@@ -6537,7 +6445,7 @@ function useSlideManagement(input) {
|
|
|
6537
6445
|
theme
|
|
6538
6446
|
} = input;
|
|
6539
6447
|
const handleAddSlide = () => {
|
|
6540
|
-
const newSlide =
|
|
6448
|
+
const newSlide = chunkSN5EUDIT_js.createBlankSlide(slides.length + 1);
|
|
6541
6449
|
ops.updateSlides((prev) => {
|
|
6542
6450
|
const next = [...prev];
|
|
6543
6451
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6600,7 +6508,7 @@ function useSlideManagement(input) {
|
|
|
6600
6508
|
}
|
|
6601
6509
|
const clone = {
|
|
6602
6510
|
...src,
|
|
6603
|
-
id:
|
|
6511
|
+
id: chunkSN5EUDIT_js.makeSlideId(),
|
|
6604
6512
|
elements: src.elements.map((el) => ({
|
|
6605
6513
|
...el,
|
|
6606
6514
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6632,7 +6540,7 @@ function useSlideManagement(input) {
|
|
|
6632
6540
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6633
6541
|
const insertAt = activeSlideIndex + 1;
|
|
6634
6542
|
const draft = {
|
|
6635
|
-
...
|
|
6543
|
+
...chunkSN5EUDIT_js.createBlankSlide(slides.length + 1),
|
|
6636
6544
|
layoutPath,
|
|
6637
6545
|
...layoutName ? { layoutName } : {}
|
|
6638
6546
|
};
|
|
@@ -6665,9 +6573,9 @@ function useSlideManagement(input) {
|
|
|
6665
6573
|
};
|
|
6666
6574
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6667
6575
|
const insertAt = activeSlideIndex + 1;
|
|
6668
|
-
const draft =
|
|
6576
|
+
const draft = chunkSN5EUDIT_js.buildSlideTemplateSlide(templateId, chunkSN5EUDIT_js.makeSlideId(), slides.length + 1, {
|
|
6669
6577
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6670
|
-
scheme:
|
|
6578
|
+
scheme: chunkSN5EUDIT_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6671
6579
|
});
|
|
6672
6580
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6673
6581
|
setActiveSlideIndex(insertAt);
|
|
@@ -6704,7 +6612,7 @@ function createTableMergeHandlers(input) {
|
|
|
6704
6612
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6705
6613
|
return;
|
|
6706
6614
|
}
|
|
6707
|
-
const newTableData =
|
|
6615
|
+
const newTableData = chunkSN5EUDIT_js.mergeCells(
|
|
6708
6616
|
[
|
|
6709
6617
|
{ row: rowIndex, col: columnIndex },
|
|
6710
6618
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6712,7 +6620,7 @@ function createTableMergeHandlers(input) {
|
|
|
6712
6620
|
td
|
|
6713
6621
|
);
|
|
6714
6622
|
const updates = { tableData: newTableData };
|
|
6715
|
-
const newRawXml =
|
|
6623
|
+
const newRawXml = chunkSN5EUDIT_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6716
6624
|
if (newRawXml) {
|
|
6717
6625
|
updates.rawXml = newRawXml;
|
|
6718
6626
|
}
|
|
@@ -6738,7 +6646,7 @@ function createTableMergeHandlers(input) {
|
|
|
6738
6646
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6739
6647
|
return;
|
|
6740
6648
|
}
|
|
6741
|
-
const newTableData =
|
|
6649
|
+
const newTableData = chunkSN5EUDIT_js.mergeCells(
|
|
6742
6650
|
[
|
|
6743
6651
|
{ row: rowIndex, col: columnIndex },
|
|
6744
6652
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6746,7 +6654,7 @@ function createTableMergeHandlers(input) {
|
|
|
6746
6654
|
td
|
|
6747
6655
|
);
|
|
6748
6656
|
const updates = { tableData: newTableData };
|
|
6749
|
-
const newRawXml =
|
|
6657
|
+
const newRawXml = chunkSN5EUDIT_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6750
6658
|
if (newRawXml) {
|
|
6751
6659
|
updates.rawXml = newRawXml;
|
|
6752
6660
|
}
|
|
@@ -6761,9 +6669,9 @@ function createTableMergeHandlers(input) {
|
|
|
6761
6669
|
return;
|
|
6762
6670
|
}
|
|
6763
6671
|
const td = selectedElement.tableData;
|
|
6764
|
-
const newTableData =
|
|
6672
|
+
const newTableData = chunkSN5EUDIT_js.mergeCells(ts.selectedCells, td);
|
|
6765
6673
|
const updates = { tableData: newTableData };
|
|
6766
|
-
const newRawXml =
|
|
6674
|
+
const newRawXml = chunkSN5EUDIT_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6767
6675
|
if (newRawXml) {
|
|
6768
6676
|
updates.rawXml = newRawXml;
|
|
6769
6677
|
}
|
|
@@ -6780,9 +6688,9 @@ function createTableMergeHandlers(input) {
|
|
|
6780
6688
|
}
|
|
6781
6689
|
const { rowIndex, columnIndex } = ts;
|
|
6782
6690
|
const td = selectedElement.tableData;
|
|
6783
|
-
const newTableData =
|
|
6691
|
+
const newTableData = chunkSN5EUDIT_js.splitCell(rowIndex, columnIndex, td);
|
|
6784
6692
|
const updates = { tableData: newTableData };
|
|
6785
|
-
const newRawXml =
|
|
6693
|
+
const newRawXml = chunkSN5EUDIT_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6786
6694
|
if (newRawXml) {
|
|
6787
6695
|
updates.rawXml = newRawXml;
|
|
6788
6696
|
}
|
|
@@ -6816,10 +6724,10 @@ function createTableStructHandlers(input) {
|
|
|
6816
6724
|
const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
|
|
6817
6725
|
const updates = {};
|
|
6818
6726
|
if (el.tableData) {
|
|
6819
|
-
updates.tableData =
|
|
6727
|
+
updates.tableData = chunkSN5EUDIT_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6820
6728
|
}
|
|
6821
6729
|
if (el.rawXml) {
|
|
6822
|
-
const newRawXml =
|
|
6730
|
+
const newRawXml = chunkSN5EUDIT_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6823
6731
|
if (newRawXml) {
|
|
6824
6732
|
updates.rawXml = newRawXml;
|
|
6825
6733
|
}
|
|
@@ -6843,7 +6751,7 @@ function createTableStructHandlers(input) {
|
|
|
6843
6751
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6844
6752
|
const updates = {};
|
|
6845
6753
|
if (selectedElement.rawXml) {
|
|
6846
|
-
const newRawXml =
|
|
6754
|
+
const newRawXml = chunkSN5EUDIT_js.updateCellTextStyleInRawXml(
|
|
6847
6755
|
selectedElement,
|
|
6848
6756
|
rowIndex,
|
|
6849
6757
|
colIndex,
|
|
@@ -6907,9 +6815,9 @@ function createTableStructHandlers(input) {
|
|
|
6907
6815
|
return;
|
|
6908
6816
|
}
|
|
6909
6817
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6910
|
-
const newTableData =
|
|
6818
|
+
const newTableData = chunkSN5EUDIT_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6911
6819
|
const updates = { tableData: newTableData };
|
|
6912
|
-
const newRawXml =
|
|
6820
|
+
const newRawXml = chunkSN5EUDIT_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6913
6821
|
if (newRawXml) {
|
|
6914
6822
|
updates.rawXml = newRawXml;
|
|
6915
6823
|
}
|
|
@@ -6922,12 +6830,12 @@ function createTableStructHandlers(input) {
|
|
|
6922
6830
|
}
|
|
6923
6831
|
const td = selectedElement.tableData;
|
|
6924
6832
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6925
|
-
const newTableData =
|
|
6833
|
+
const newTableData = chunkSN5EUDIT_js.deleteTableRow(td, rowIdx);
|
|
6926
6834
|
if (newTableData === td) {
|
|
6927
6835
|
return;
|
|
6928
6836
|
}
|
|
6929
6837
|
const updates = { tableData: newTableData };
|
|
6930
|
-
const newRawXml =
|
|
6838
|
+
const newRawXml = chunkSN5EUDIT_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6931
6839
|
if (newRawXml) {
|
|
6932
6840
|
updates.rawXml = newRawXml;
|
|
6933
6841
|
}
|
|
@@ -6939,9 +6847,9 @@ function createTableStructHandlers(input) {
|
|
|
6939
6847
|
return;
|
|
6940
6848
|
}
|
|
6941
6849
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6942
|
-
const newTableData =
|
|
6850
|
+
const newTableData = chunkSN5EUDIT_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6943
6851
|
const updates = { tableData: newTableData };
|
|
6944
|
-
const newRawXml =
|
|
6852
|
+
const newRawXml = chunkSN5EUDIT_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6945
6853
|
if (newRawXml) {
|
|
6946
6854
|
updates.rawXml = newRawXml;
|
|
6947
6855
|
}
|
|
@@ -6954,12 +6862,12 @@ function createTableStructHandlers(input) {
|
|
|
6954
6862
|
}
|
|
6955
6863
|
const td = selectedElement.tableData;
|
|
6956
6864
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6957
|
-
const newTableData =
|
|
6865
|
+
const newTableData = chunkSN5EUDIT_js.deleteTableColumn(td, colIdx);
|
|
6958
6866
|
if (newTableData === td) {
|
|
6959
6867
|
return;
|
|
6960
6868
|
}
|
|
6961
6869
|
const updates = { tableData: newTableData };
|
|
6962
|
-
const newRawXml =
|
|
6870
|
+
const newRawXml = chunkSN5EUDIT_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6963
6871
|
if (newRawXml) {
|
|
6964
6872
|
updates.rawXml = newRawXml;
|
|
6965
6873
|
}
|
|
@@ -6995,8 +6903,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6995
6903
|
return html2canvasPro(element, {
|
|
6996
6904
|
...options,
|
|
6997
6905
|
onclone: async (doc, clonedEl) => {
|
|
6998
|
-
await
|
|
6999
|
-
|
|
6906
|
+
await chunkSN5EUDIT_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6907
|
+
chunkSN5EUDIT_js.preprocessCssForCapture(clonedEl);
|
|
7000
6908
|
if (typeof userOnClone === "function") {
|
|
7001
6909
|
userOnClone(doc, clonedEl);
|
|
7002
6910
|
}
|
|
@@ -7010,7 +6918,7 @@ function useExportSaveAs(input) {
|
|
|
7010
6918
|
slides,
|
|
7011
6919
|
templateElementsBySlideId,
|
|
7012
6920
|
filePath,
|
|
7013
|
-
|
|
6921
|
+
serializeSlides,
|
|
7014
6922
|
headerFooter,
|
|
7015
6923
|
presentationProperties,
|
|
7016
6924
|
customShows,
|
|
@@ -7019,72 +6927,32 @@ function useExportSaveAs(input) {
|
|
|
7019
6927
|
appProperties,
|
|
7020
6928
|
customProperties,
|
|
7021
6929
|
tagCollections,
|
|
7022
|
-
slideMasters,
|
|
7023
6930
|
notesMaster,
|
|
7024
6931
|
handoutMaster,
|
|
7025
|
-
guides,
|
|
7026
|
-
activeSlideIndexForGuides,
|
|
7027
6932
|
theme,
|
|
7028
6933
|
canvasSize,
|
|
7029
|
-
slideSizeEmu
|
|
7030
|
-
password
|
|
6934
|
+
slideSizeEmu
|
|
7031
6935
|
} = input;
|
|
7032
6936
|
const handleSaveAsFormat = async (format) => {
|
|
7033
|
-
const
|
|
7034
|
-
if (!handler) {
|
|
7035
|
-
return;
|
|
7036
|
-
}
|
|
7037
|
-
const downloadName = chunkAL2KLPOJ_js.savedPresentationFileName(filePath, format);
|
|
6937
|
+
const downloadName = chunkSN5EUDIT_js.savedPresentationFileName(filePath, format);
|
|
7038
6938
|
try {
|
|
7039
|
-
const data = await
|
|
6939
|
+
const data = await serializeSlides(format);
|
|
6940
|
+
if (!data) {
|
|
6941
|
+
return;
|
|
6942
|
+
}
|
|
7040
6943
|
const blob = new Blob([data], {
|
|
7041
6944
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
7042
6945
|
});
|
|
7043
|
-
|
|
6946
|
+
chunkSN5EUDIT_js.downloadBlob(blob, downloadName);
|
|
7044
6947
|
} catch (err) {
|
|
7045
6948
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
7046
6949
|
}
|
|
7047
6950
|
};
|
|
7048
|
-
const buildSaveAsData = async (handler, format) => {
|
|
7049
|
-
const slidesWithGuides = slides.map((slide, idx) => {
|
|
7050
|
-
if (idx !== activeSlideIndexForGuides) {
|
|
7051
|
-
return slide;
|
|
7052
|
-
}
|
|
7053
|
-
const pptxGuides = guides.map((g) => ({
|
|
7054
|
-
id: g.id,
|
|
7055
|
-
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7056
|
-
positionEmu: chunkAL2KLPOJ_js.guidePxToEmu(g.position)
|
|
7057
|
-
}));
|
|
7058
|
-
return {
|
|
7059
|
-
...slide,
|
|
7060
|
-
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7061
|
-
};
|
|
7062
|
-
});
|
|
7063
|
-
const slidesToSave = chunkAL2KLPOJ_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7064
|
-
const saveOptions = {
|
|
7065
|
-
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
7066
|
-
// a preset picked in the inspector reached one save path and not the other.
|
|
7067
|
-
slideSize: chunkAL2KLPOJ_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
7068
|
-
headerFooter,
|
|
7069
|
-
presentationProperties,
|
|
7070
|
-
customShows: customShows.length > 0 ? customShows : void 0,
|
|
7071
|
-
sections: sections.length > 0 ? sections : void 0,
|
|
7072
|
-
coreProperties: coreProperties ?? void 0,
|
|
7073
|
-
appProperties: appProperties ?? void 0,
|
|
7074
|
-
customProperties: customProperties.length > 0 ? customProperties : void 0,
|
|
7075
|
-
tags: tagCollections.length > 0 ? tagCollections : void 0,
|
|
7076
|
-
slideMasters,
|
|
7077
|
-
notesMaster,
|
|
7078
|
-
handoutMaster,
|
|
7079
|
-
outputFormat: format
|
|
7080
|
-
};
|
|
7081
|
-
return chunkAL2KLPOJ_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
7082
|
-
};
|
|
7083
6951
|
const handleExportJson = () => {
|
|
7084
6952
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7085
|
-
const slideSize =
|
|
6953
|
+
const slideSize = chunkSN5EUDIT_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7086
6954
|
const data = {
|
|
7087
|
-
slides:
|
|
6955
|
+
slides: chunkSN5EUDIT_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7088
6956
|
width: canvasSize.width,
|
|
7089
6957
|
height: canvasSize.height,
|
|
7090
6958
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7095,15 +6963,15 @@ function useExportSaveAs(input) {
|
|
|
7095
6963
|
presentationProperties,
|
|
7096
6964
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
7097
6965
|
sections: sections.length > 0 ? sections : void 0,
|
|
7098
|
-
coreProperties
|
|
7099
|
-
appProperties
|
|
6966
|
+
coreProperties,
|
|
6967
|
+
appProperties,
|
|
7100
6968
|
customProperties: customProperties.length > 0 ? customProperties : void 0,
|
|
7101
6969
|
tags: tagCollections.length > 0 ? tagCollections : void 0,
|
|
7102
6970
|
notesMaster,
|
|
7103
6971
|
handoutMaster
|
|
7104
6972
|
};
|
|
7105
6973
|
try {
|
|
7106
|
-
|
|
6974
|
+
chunkSN5EUDIT_js.exportDeckJson(data, sourceName);
|
|
7107
6975
|
} catch (err) {
|
|
7108
6976
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7109
6977
|
}
|
|
@@ -7190,7 +7058,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
7190
7058
|
}
|
|
7191
7059
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
7192
7060
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
7193
|
-
|
|
7061
|
+
chunkSN5EUDIT_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
7194
7062
|
}
|
|
7195
7063
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
7196
7064
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -7212,15 +7080,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7212
7080
|
continue;
|
|
7213
7081
|
}
|
|
7214
7082
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
7215
|
-
images.push(
|
|
7083
|
+
images.push(chunkSN5EUDIT_js.canvasToJpegData(canvas));
|
|
7216
7084
|
}
|
|
7217
7085
|
onProgress?.(totalSlides, totalSlides);
|
|
7218
7086
|
setActiveSlide(currentSlideIndex);
|
|
7219
7087
|
if (images.length === 0) {
|
|
7220
|
-
throw new Error(
|
|
7088
|
+
throw new Error(chunkL3ZIBQEB_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7221
7089
|
}
|
|
7222
|
-
const pdfBlobUrl =
|
|
7223
|
-
|
|
7090
|
+
const pdfBlobUrl = chunkQWA5YEIZ_js.buildPdfFromImageData(images);
|
|
7091
|
+
chunkSN5EUDIT_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
7224
7092
|
}
|
|
7225
7093
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
7226
7094
|
const { scale = 2, onProgress } = options;
|
|
@@ -7266,10 +7134,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7266
7134
|
onProgress?.(totalSlides, totalSlides);
|
|
7267
7135
|
setActiveSlide(currentSlideIndex);
|
|
7268
7136
|
if (pages.length === 0) {
|
|
7269
|
-
throw new Error(
|
|
7137
|
+
throw new Error(chunkL3ZIBQEB_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7270
7138
|
}
|
|
7271
|
-
const pdfDataUrl =
|
|
7272
|
-
|
|
7139
|
+
const pdfDataUrl = chunkQWA5YEIZ_js.buildNotesPdf(pages);
|
|
7140
|
+
chunkSN5EUDIT_js.downloadDataUrl(pdfDataUrl, filename);
|
|
7273
7141
|
}
|
|
7274
7142
|
|
|
7275
7143
|
// src/viewer/utils/export-video.ts
|
|
@@ -7300,7 +7168,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7300
7168
|
}
|
|
7301
7169
|
setActiveSlide(currentSlideIndex);
|
|
7302
7170
|
if (slideCanvases.length === 0) {
|
|
7303
|
-
throw new Error(
|
|
7171
|
+
throw new Error(chunkL3ZIBQEB_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
7304
7172
|
}
|
|
7305
7173
|
const firstCanvas = slideCanvases[0];
|
|
7306
7174
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -7308,12 +7176,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7308
7176
|
recordingCanvas.height = firstCanvas.height;
|
|
7309
7177
|
const ctx = recordingCanvas.getContext("2d");
|
|
7310
7178
|
if (!ctx) {
|
|
7311
|
-
throw new Error(
|
|
7179
|
+
throw new Error(chunkL3ZIBQEB_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
7312
7180
|
}
|
|
7313
7181
|
const fps = 30;
|
|
7314
7182
|
const stream = recordingCanvas.captureStream(fps);
|
|
7315
7183
|
const recorder = new MediaRecorder(stream, {
|
|
7316
|
-
mimeType:
|
|
7184
|
+
mimeType: chunkSN5EUDIT_js.pickSupportedMimeType([...chunkSN5EUDIT_js.WEBM_MIME_CANDIDATES]),
|
|
7317
7185
|
videoBitsPerSecond: 5e6
|
|
7318
7186
|
});
|
|
7319
7187
|
const chunks = [];
|
|
@@ -7336,8 +7204,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7336
7204
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
7337
7205
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
7338
7206
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
7339
|
-
const frameInterval =
|
|
7340
|
-
const framesNeeded =
|
|
7207
|
+
const frameInterval = chunkSN5EUDIT_js.fpsToFrameIntervalMs(fps);
|
|
7208
|
+
const framesNeeded = chunkSN5EUDIT_js.segmentFrameCount(duration, fps);
|
|
7341
7209
|
for (let f = 0; f < framesNeeded; f++) {
|
|
7342
7210
|
if (signal?.aborted) {
|
|
7343
7211
|
recorder.stop();
|
|
@@ -7384,9 +7252,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7384
7252
|
}
|
|
7385
7253
|
setActiveSlide(currentSlideIndex);
|
|
7386
7254
|
if (frames.length === 0) {
|
|
7387
|
-
throw new Error(
|
|
7255
|
+
throw new Error(chunkL3ZIBQEB_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
7388
7256
|
}
|
|
7389
|
-
const gifBytes =
|
|
7257
|
+
const gifBytes = chunkSN5EUDIT_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
7390
7258
|
onProgress?.(totalSlides, totalSlides);
|
|
7391
7259
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
7392
7260
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -7440,7 +7308,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7440
7308
|
continue;
|
|
7441
7309
|
}
|
|
7442
7310
|
onProgress?.(processedCount, data.slides.length);
|
|
7443
|
-
let svg =
|
|
7311
|
+
let svg = chunkSN5EUDIT_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7444
7312
|
if (embedFonts && fontFaces?.length) {
|
|
7445
7313
|
svg = injectFontFaces(svg, fontFaces);
|
|
7446
7314
|
}
|
|
@@ -7461,7 +7329,7 @@ function useExportHandlers(input) {
|
|
|
7461
7329
|
filePath,
|
|
7462
7330
|
canvasStageRef,
|
|
7463
7331
|
setActiveSlideIndex,
|
|
7464
|
-
|
|
7332
|
+
serializeSlides,
|
|
7465
7333
|
headerFooter,
|
|
7466
7334
|
presentationProperties,
|
|
7467
7335
|
customShows,
|
|
@@ -7470,15 +7338,11 @@ function useExportHandlers(input) {
|
|
|
7470
7338
|
appProperties,
|
|
7471
7339
|
customProperties,
|
|
7472
7340
|
tagCollections,
|
|
7473
|
-
slideMasters,
|
|
7474
7341
|
notesMaster,
|
|
7475
7342
|
handoutMaster,
|
|
7476
|
-
guides,
|
|
7477
|
-
activeSlideIndexForGuides,
|
|
7478
7343
|
theme,
|
|
7479
7344
|
canvasSize,
|
|
7480
7345
|
slideSizeEmu,
|
|
7481
|
-
password,
|
|
7482
7346
|
imageExportScale
|
|
7483
7347
|
} = input;
|
|
7484
7348
|
const [exportModalOpen, setExportModalOpen] = react.useState(false);
|
|
@@ -7496,7 +7360,7 @@ function useExportHandlers(input) {
|
|
|
7496
7360
|
slides,
|
|
7497
7361
|
templateElementsBySlideId,
|
|
7498
7362
|
filePath,
|
|
7499
|
-
|
|
7363
|
+
serializeSlides,
|
|
7500
7364
|
headerFooter,
|
|
7501
7365
|
presentationProperties,
|
|
7502
7366
|
customShows,
|
|
@@ -7505,15 +7369,11 @@ function useExportHandlers(input) {
|
|
|
7505
7369
|
appProperties,
|
|
7506
7370
|
customProperties,
|
|
7507
7371
|
tagCollections,
|
|
7508
|
-
slideMasters,
|
|
7509
7372
|
notesMaster,
|
|
7510
7373
|
handoutMaster,
|
|
7511
|
-
guides,
|
|
7512
|
-
activeSlideIndexForGuides,
|
|
7513
7374
|
theme,
|
|
7514
7375
|
canvasSize,
|
|
7515
|
-
slideSizeEmu
|
|
7516
|
-
password
|
|
7376
|
+
slideSizeEmu
|
|
7517
7377
|
});
|
|
7518
7378
|
const handleExportPng = react.useCallback(async () => {
|
|
7519
7379
|
const stageEl = canvasStageRef.current;
|
|
@@ -7549,21 +7409,21 @@ function useExportHandlers(input) {
|
|
|
7549
7409
|
{
|
|
7550
7410
|
scale: imageExportScale,
|
|
7551
7411
|
onProgress: (current, total) => {
|
|
7552
|
-
setExportProgress(
|
|
7553
|
-
setExportStatusMessage(
|
|
7412
|
+
setExportProgress(chunkSN5EUDIT_js.slideProgressPercent(current, total));
|
|
7413
|
+
setExportStatusMessage(chunkSN5EUDIT_js.slideStatusLabel("Rendering", current, total));
|
|
7554
7414
|
},
|
|
7555
7415
|
signal: abortCtrl.signal
|
|
7556
7416
|
}
|
|
7557
7417
|
);
|
|
7558
|
-
setExportProgress(
|
|
7418
|
+
setExportProgress(chunkSN5EUDIT_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7559
7419
|
setExportStatusMessage("Building PDF...");
|
|
7560
7420
|
await new Promise((r) => {
|
|
7561
7421
|
setTimeout(r, 100);
|
|
7562
7422
|
});
|
|
7563
|
-
setExportProgress(
|
|
7423
|
+
setExportProgress(chunkSN5EUDIT_js.EXPORT_DONE_PERCENT);
|
|
7564
7424
|
setExportStatusMessage("Done!");
|
|
7565
7425
|
} catch (err) {
|
|
7566
|
-
if (!
|
|
7426
|
+
if (!chunkSN5EUDIT_js.isExportAbortError(err)) {
|
|
7567
7427
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7568
7428
|
}
|
|
7569
7429
|
} finally {
|
|
@@ -7593,21 +7453,21 @@ function useExportHandlers(input) {
|
|
|
7593
7453
|
{
|
|
7594
7454
|
scale: imageExportScale,
|
|
7595
7455
|
onProgress: (current, total) => {
|
|
7596
|
-
setExportProgress(
|
|
7597
|
-
setExportStatusMessage(
|
|
7456
|
+
setExportProgress(chunkSN5EUDIT_js.slideProgressPercent(current, total));
|
|
7457
|
+
setExportStatusMessage(chunkSN5EUDIT_js.slideStatusLabel("Rendering", current, total));
|
|
7598
7458
|
},
|
|
7599
7459
|
signal: abortCtrl.signal
|
|
7600
7460
|
}
|
|
7601
7461
|
);
|
|
7602
|
-
setExportProgress(
|
|
7462
|
+
setExportProgress(chunkSN5EUDIT_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7603
7463
|
setExportStatusMessage("Building PDF...");
|
|
7604
7464
|
await new Promise((r) => {
|
|
7605
7465
|
setTimeout(r, 100);
|
|
7606
7466
|
});
|
|
7607
|
-
setExportProgress(
|
|
7467
|
+
setExportProgress(chunkSN5EUDIT_js.EXPORT_DONE_PERCENT);
|
|
7608
7468
|
setExportStatusMessage("Done!");
|
|
7609
7469
|
} catch (err) {
|
|
7610
|
-
if (!
|
|
7470
|
+
if (!chunkSN5EUDIT_js.isExportAbortError(err)) {
|
|
7611
7471
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7612
7472
|
}
|
|
7613
7473
|
} finally {
|
|
@@ -7649,22 +7509,22 @@ function useExportHandlers(input) {
|
|
|
7649
7509
|
scale: 1,
|
|
7650
7510
|
slideDurationMs: 3e3,
|
|
7651
7511
|
onProgress: (current, total) => {
|
|
7652
|
-
setExportProgress(
|
|
7653
|
-
setExportStatusMessage(
|
|
7512
|
+
setExportProgress(chunkSN5EUDIT_js.slideProgressPercent(current, total, 45));
|
|
7513
|
+
setExportStatusMessage(chunkSN5EUDIT_js.slideStatusLabel("Capturing", current, total));
|
|
7654
7514
|
},
|
|
7655
7515
|
onRecordProgress: (current, total) => {
|
|
7656
|
-
setExportProgress(
|
|
7657
|
-
setExportStatusMessage(
|
|
7516
|
+
setExportProgress(chunkSN5EUDIT_js.recordProgressPercent(current, total));
|
|
7517
|
+
setExportStatusMessage(chunkSN5EUDIT_js.slideStatusLabel("Recording", current, total));
|
|
7658
7518
|
},
|
|
7659
7519
|
signal: abortCtrl.signal
|
|
7660
7520
|
}
|
|
7661
7521
|
);
|
|
7662
|
-
setExportProgress(
|
|
7522
|
+
setExportProgress(chunkSN5EUDIT_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7663
7523
|
setExportStatusMessage("Saving file...");
|
|
7664
|
-
|
|
7665
|
-
setExportProgress(
|
|
7524
|
+
chunkSN5EUDIT_js.downloadBlob(blob, "presentation.webm");
|
|
7525
|
+
setExportProgress(chunkSN5EUDIT_js.EXPORT_DONE_PERCENT);
|
|
7666
7526
|
} catch (err) {
|
|
7667
|
-
if (!
|
|
7527
|
+
if (!chunkSN5EUDIT_js.isExportAbortError(err)) {
|
|
7668
7528
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7669
7529
|
}
|
|
7670
7530
|
} finally {
|
|
@@ -7692,18 +7552,18 @@ function useExportHandlers(input) {
|
|
|
7692
7552
|
scale: 0.5,
|
|
7693
7553
|
slideDurationMs: 2e3,
|
|
7694
7554
|
onProgress: (current, total) => {
|
|
7695
|
-
setExportProgress(
|
|
7696
|
-
setExportStatusMessage(
|
|
7555
|
+
setExportProgress(chunkSN5EUDIT_js.slideProgressPercent(current, total));
|
|
7556
|
+
setExportStatusMessage(chunkSN5EUDIT_js.slideStatusLabel("Encoding", current, total));
|
|
7697
7557
|
},
|
|
7698
7558
|
signal: abortCtrl.signal
|
|
7699
7559
|
}
|
|
7700
7560
|
);
|
|
7701
|
-
setExportProgress(
|
|
7561
|
+
setExportProgress(chunkSN5EUDIT_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7702
7562
|
setExportStatusMessage("Saving file...");
|
|
7703
|
-
|
|
7704
|
-
setExportProgress(
|
|
7563
|
+
chunkSN5EUDIT_js.downloadBlob(blob, "presentation.gif");
|
|
7564
|
+
setExportProgress(chunkSN5EUDIT_js.EXPORT_DONE_PERCENT);
|
|
7705
7565
|
} catch (err) {
|
|
7706
|
-
if (!
|
|
7566
|
+
if (!chunkSN5EUDIT_js.isExportAbortError(err)) {
|
|
7707
7567
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7708
7568
|
}
|
|
7709
7569
|
} finally {
|
|
@@ -7736,7 +7596,7 @@ function useExportHandlers(input) {
|
|
|
7736
7596
|
exportStatusMessage
|
|
7737
7597
|
};
|
|
7738
7598
|
}
|
|
7739
|
-
var ViewerOptionsContext = react.createContext(
|
|
7599
|
+
var ViewerOptionsContext = react.createContext(chunkSN5EUDIT_js.DEFAULT_VIEWER_OPTIONS);
|
|
7740
7600
|
function useViewerOptionsContext() {
|
|
7741
7601
|
return react.useContext(ViewerOptionsContext);
|
|
7742
7602
|
}
|
|
@@ -7748,13 +7608,13 @@ function usePrintHandlers(input) {
|
|
|
7748
7608
|
const { t } = reactI18next.useTranslation();
|
|
7749
7609
|
const viewerOptions = useViewerOptionsContext();
|
|
7750
7610
|
const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
|
|
7751
|
-
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) *
|
|
7611
|
+
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunkSN5EUDIT_js.resolveImageResolutionScale(viewerOptions);
|
|
7752
7612
|
const handlePrint = () => {
|
|
7753
7613
|
setIsPrintDialogOpen(true);
|
|
7754
7614
|
};
|
|
7755
7615
|
const handlePrintSvg = async (settings) => {
|
|
7756
7616
|
setIsPrintDialogOpen(false);
|
|
7757
|
-
const printWindow =
|
|
7617
|
+
const printWindow = chunkSN5EUDIT_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7758
7618
|
if (!printWindow) {
|
|
7759
7619
|
console.warn(
|
|
7760
7620
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7764,9 +7624,9 @@ function usePrintHandlers(input) {
|
|
|
7764
7624
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7765
7625
|
return runRasterPrint(printWindow, settings);
|
|
7766
7626
|
}
|
|
7767
|
-
const colorFilter =
|
|
7768
|
-
const slideIndices =
|
|
7769
|
-
|
|
7627
|
+
const colorFilter = chunkSN5EUDIT_js.computeColorFilter(settings.colorMode);
|
|
7628
|
+
const slideIndices = chunkSN5EUDIT_js.filterHiddenSlideIndices(
|
|
7629
|
+
chunkSN5EUDIT_js.computeSlideIndices(
|
|
7770
7630
|
settings.slideRange,
|
|
7771
7631
|
activeSlideIndex,
|
|
7772
7632
|
slides.length,
|
|
@@ -7784,22 +7644,22 @@ function usePrintHandlers(input) {
|
|
|
7784
7644
|
printWindow.close();
|
|
7785
7645
|
return;
|
|
7786
7646
|
}
|
|
7787
|
-
const printDoc =
|
|
7647
|
+
const printDoc = chunkSN5EUDIT_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7788
7648
|
title: "Slides (Vector)",
|
|
7789
7649
|
orientation: settings.orientation,
|
|
7790
7650
|
colorFilter,
|
|
7791
7651
|
scaleToFit: settings.scaleToFit
|
|
7792
7652
|
});
|
|
7793
|
-
|
|
7653
|
+
chunkSN5EUDIT_js.finishPrintWindow(printWindow, printDoc);
|
|
7794
7654
|
} catch (err) {
|
|
7795
7655
|
console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
|
|
7796
7656
|
return runRasterPrint(printWindow, settings);
|
|
7797
7657
|
}
|
|
7798
7658
|
};
|
|
7799
7659
|
const runRasterPrint = async (printWindow, settings) => {
|
|
7800
|
-
const colorFilter =
|
|
7801
|
-
const slideIndices =
|
|
7802
|
-
|
|
7660
|
+
const colorFilter = chunkSN5EUDIT_js.computeColorFilter(settings.colorMode);
|
|
7661
|
+
const slideIndices = chunkSN5EUDIT_js.filterHiddenSlideIndices(
|
|
7662
|
+
chunkSN5EUDIT_js.computeSlideIndices(
|
|
7803
7663
|
settings.slideRange,
|
|
7804
7664
|
activeSlideIndex,
|
|
7805
7665
|
slides.length,
|
|
@@ -7810,11 +7670,11 @@ function usePrintHandlers(input) {
|
|
|
7810
7670
|
includeHiddenSlides
|
|
7811
7671
|
);
|
|
7812
7672
|
if (settings.printWhat === "outline") {
|
|
7813
|
-
|
|
7673
|
+
chunkSN5EUDIT_js.finishPrintWindow(
|
|
7814
7674
|
printWindow,
|
|
7815
|
-
|
|
7675
|
+
chunkSN5EUDIT_js.buildPrintHtmlDocument({
|
|
7816
7676
|
title: "Outline",
|
|
7817
|
-
bodyHtml: `<div class="outline-page">${
|
|
7677
|
+
bodyHtml: `<div class="outline-page">${chunkSN5EUDIT_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7818
7678
|
orientation: settings.orientation,
|
|
7819
7679
|
colorFilter,
|
|
7820
7680
|
frameSlides: settings.frameSlides,
|
|
@@ -7841,11 +7701,11 @@ function usePrintHandlers(input) {
|
|
|
7841
7701
|
}
|
|
7842
7702
|
const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
|
|
7843
7703
|
if (settings.printWhat === "slides") {
|
|
7844
|
-
|
|
7704
|
+
chunkSN5EUDIT_js.finishPrintWindow(
|
|
7845
7705
|
printWindow,
|
|
7846
|
-
|
|
7706
|
+
chunkSN5EUDIT_js.buildPrintHtmlDocument({
|
|
7847
7707
|
title: "Slides",
|
|
7848
|
-
bodyHtml:
|
|
7708
|
+
bodyHtml: chunkSN5EUDIT_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7849
7709
|
orientation: settings.orientation,
|
|
7850
7710
|
colorFilter,
|
|
7851
7711
|
frameSlides: settings.frameSlides,
|
|
@@ -7855,11 +7715,11 @@ function usePrintHandlers(input) {
|
|
|
7855
7715
|
return;
|
|
7856
7716
|
}
|
|
7857
7717
|
if (settings.printWhat === "notes") {
|
|
7858
|
-
|
|
7718
|
+
chunkSN5EUDIT_js.finishPrintWindow(
|
|
7859
7719
|
printWindow,
|
|
7860
|
-
|
|
7720
|
+
chunkSN5EUDIT_js.buildPrintHtmlDocument({
|
|
7861
7721
|
title: "Notes Pages",
|
|
7862
|
-
bodyHtml:
|
|
7722
|
+
bodyHtml: chunkSN5EUDIT_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7863
7723
|
orientation: "portrait",
|
|
7864
7724
|
colorFilter,
|
|
7865
7725
|
frameSlides: settings.frameSlides,
|
|
@@ -7870,11 +7730,11 @@ function usePrintHandlers(input) {
|
|
|
7870
7730
|
}
|
|
7871
7731
|
if (settings.printWhat === "handouts") {
|
|
7872
7732
|
const spp = settings.slidesPerPage;
|
|
7873
|
-
|
|
7733
|
+
chunkSN5EUDIT_js.finishPrintWindow(
|
|
7874
7734
|
printWindow,
|
|
7875
|
-
|
|
7735
|
+
chunkSN5EUDIT_js.buildPrintHtmlDocument({
|
|
7876
7736
|
title: `Handout ${spp} per page`,
|
|
7877
|
-
bodyHtml:
|
|
7737
|
+
bodyHtml: chunkSN5EUDIT_js.buildHandoutsHtml(slideImages, slideIndices, spp, pptxData?.handoutMaster),
|
|
7878
7738
|
orientation: "portrait",
|
|
7879
7739
|
colorFilter,
|
|
7880
7740
|
frameSlides: settings.frameSlides,
|
|
@@ -7888,7 +7748,7 @@ function usePrintHandlers(input) {
|
|
|
7888
7748
|
};
|
|
7889
7749
|
const handlePrintWithSettings = async (settings) => {
|
|
7890
7750
|
setIsPrintDialogOpen(false);
|
|
7891
|
-
const printWindow =
|
|
7751
|
+
const printWindow = chunkSN5EUDIT_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7892
7752
|
if (!printWindow) {
|
|
7893
7753
|
console.warn(
|
|
7894
7754
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7953,13 +7813,13 @@ function useThemeHandlers(input) {
|
|
|
7953
7813
|
return;
|
|
7954
7814
|
}
|
|
7955
7815
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7956
|
-
const previousMap = theme?.colorScheme ?
|
|
7957
|
-
setSlides((prev) =>
|
|
7816
|
+
const previousMap = theme?.colorScheme ? chunkSN5EUDIT_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7817
|
+
setSlides((prev) => chunkSN5EUDIT_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7958
7818
|
if (Object.keys(templateElementsBySlideId).length > 0) {
|
|
7959
7819
|
setTemplateElementsBySlideId((prev) => {
|
|
7960
7820
|
const next = {};
|
|
7961
7821
|
for (const [slideId, elements] of Object.entries(prev)) {
|
|
7962
|
-
next[slideId] =
|
|
7822
|
+
next[slideId] = chunkSN5EUDIT_js.reResolveElementColors(elements, previousMap, colorScheme);
|
|
7963
7823
|
}
|
|
7964
7824
|
return next;
|
|
7965
7825
|
});
|
|
@@ -8068,7 +7928,7 @@ function useThemeSwitching(input) {
|
|
|
8068
7928
|
}
|
|
8069
7929
|
try {
|
|
8070
7930
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
8071
|
-
const newData =
|
|
7931
|
+
const newData = chunkSN5EUDIT_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
8072
7932
|
onDataChange(newData);
|
|
8073
7933
|
onThemeChanged?.(preset);
|
|
8074
7934
|
} catch (error) {
|
|
@@ -8085,7 +7945,7 @@ function useThemeSwitching(input) {
|
|
|
8085
7945
|
}
|
|
8086
7946
|
try {
|
|
8087
7947
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
8088
|
-
const newData =
|
|
7948
|
+
const newData = chunkSN5EUDIT_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
8089
7949
|
onDataChange(newData);
|
|
8090
7950
|
} catch (error) {
|
|
8091
7951
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -8097,12 +7957,12 @@ function useThemeSwitching(input) {
|
|
|
8097
7957
|
if (!data?.theme?.colorScheme) {
|
|
8098
7958
|
return void 0;
|
|
8099
7959
|
}
|
|
8100
|
-
return
|
|
8101
|
-
(p) =>
|
|
7960
|
+
return chunkSN5EUDIT_js.THEME_PRESETS.find(
|
|
7961
|
+
(p) => chunkSN5EUDIT_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
8102
7962
|
);
|
|
8103
7963
|
}, [data?.theme?.colorScheme]);
|
|
8104
7964
|
return {
|
|
8105
|
-
presets:
|
|
7965
|
+
presets: chunkSN5EUDIT_js.THEME_PRESETS,
|
|
8106
7966
|
switchToPreset,
|
|
8107
7967
|
switchToCustom,
|
|
8108
7968
|
currentPreset
|
|
@@ -8177,7 +8037,7 @@ function usePropertyHandlers(input) {
|
|
|
8177
8037
|
}
|
|
8178
8038
|
try {
|
|
8179
8039
|
const ab = await file.arrayBuffer();
|
|
8180
|
-
const h = new
|
|
8040
|
+
const h = new chunkSN5EUDIT_js.PptxHandler();
|
|
8181
8041
|
const other = await h.load(ab);
|
|
8182
8042
|
if (!other) {
|
|
8183
8043
|
return;
|
|
@@ -8187,7 +8047,7 @@ function usePropertyHandlers(input) {
|
|
|
8187
8047
|
width: canvasSize.width,
|
|
8188
8048
|
height: canvasSize.height
|
|
8189
8049
|
};
|
|
8190
|
-
setCompareResult(
|
|
8050
|
+
setCompareResult(chunkSN5EUDIT_js.comparePresentation(cur, other));
|
|
8191
8051
|
setIsComparePanelOpen(true);
|
|
8192
8052
|
} catch (err) {
|
|
8193
8053
|
console.warn("Compare failed:", err);
|
|
@@ -8204,7 +8064,7 @@ function usePropertyHandlers(input) {
|
|
|
8204
8064
|
if (!diff || diff.status === "unchanged") {
|
|
8205
8065
|
return;
|
|
8206
8066
|
}
|
|
8207
|
-
setSlides((prev) =>
|
|
8067
|
+
setSlides((prev) => chunkSN5EUDIT_js.applyAcceptSlide(prev, diff));
|
|
8208
8068
|
setIsDirty(true);
|
|
8209
8069
|
},
|
|
8210
8070
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -8215,10 +8075,10 @@ function usePropertyHandlers(input) {
|
|
|
8215
8075
|
if (!compareResult) {
|
|
8216
8076
|
return;
|
|
8217
8077
|
}
|
|
8218
|
-
setSlides((prev) =>
|
|
8078
|
+
setSlides((prev) => chunkSN5EUDIT_js.applyAcceptAllSlides(prev, compareResult));
|
|
8219
8079
|
setIsDirty(true);
|
|
8220
8080
|
}, [compareResult, setSlides, setIsDirty]);
|
|
8221
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
8081
|
+
const usedFontFamilies = react.useMemo(() => chunkSN5EUDIT_js.collectUsedFonts(slides), [slides]);
|
|
8222
8082
|
return {
|
|
8223
8083
|
handleUpdateNotes,
|
|
8224
8084
|
handleUpdateSlide,
|
|
@@ -8373,7 +8233,7 @@ function useViewerDialogs(input) {
|
|
|
8373
8233
|
);
|
|
8374
8234
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8375
8235
|
const fontEmbedding = react.useMemo(
|
|
8376
|
-
() =>
|
|
8236
|
+
() => chunkSN5EUDIT_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8377
8237
|
[embeddedFontKey]
|
|
8378
8238
|
);
|
|
8379
8239
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8383,11 +8243,11 @@ function useViewerDialogs(input) {
|
|
|
8383
8243
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8384
8244
|
}
|
|
8385
8245
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8386
|
-
() => typeof window !== "undefined" ?
|
|
8246
|
+
() => typeof window !== "undefined" ? chunkSN5EUDIT_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8387
8247
|
);
|
|
8388
8248
|
react.useEffect(() => {
|
|
8389
8249
|
const handleWindow = () => setIsNarrowViewport(
|
|
8390
|
-
|
|
8250
|
+
chunkSN5EUDIT_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8391
8251
|
);
|
|
8392
8252
|
window.addEventListener("resize", handleWindow);
|
|
8393
8253
|
return () => window.removeEventListener("resize", handleWindow);
|
|
@@ -8540,16 +8400,16 @@ function useViewerDialogs(input) {
|
|
|
8540
8400
|
};
|
|
8541
8401
|
}
|
|
8542
8402
|
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8543
|
-
return
|
|
8403
|
+
return chunkSN5EUDIT_js.computeGridSpacingPx(documentGridSpacing, chunkQWA5YEIZ_js.GRID_SIZE);
|
|
8544
8404
|
}
|
|
8545
8405
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
8546
8406
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8547
|
-
const authoredRange =
|
|
8548
|
-
return
|
|
8407
|
+
const authoredRange = chunkSN5EUDIT_js.resolveAuthoredSlideRange(presentationProperties, slides.length);
|
|
8408
|
+
return chunkSN5EUDIT_js.resolveShowSlideIndexes(slides, activeShow, authoredRange);
|
|
8549
8409
|
}
|
|
8550
8410
|
function computeSlideSectionGroups(slides, sections) {
|
|
8551
|
-
return
|
|
8552
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8411
|
+
return chunkSN5EUDIT_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8412
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkQWA5YEIZ_js.UNGROUPED_SECTION_ID : chunkQWA5YEIZ_js.DEFAULT_SECTION_GROUP_ID),
|
|
8553
8413
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8554
8414
|
slideIndexes: group.slideIndexes,
|
|
8555
8415
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8561,7 +8421,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8561
8421
|
return void 0;
|
|
8562
8422
|
}
|
|
8563
8423
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8564
|
-
return
|
|
8424
|
+
return chunkSN5EUDIT_js.masterViewPseudoSlide(document2, {
|
|
8565
8425
|
tab: "slides",
|
|
8566
8426
|
masterIndex: 0,
|
|
8567
8427
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8589,15 +8449,15 @@ function useDerivedSlideState(input) {
|
|
|
8589
8449
|
[slides, activeCustomShowId, customShows, presentationProperties]
|
|
8590
8450
|
);
|
|
8591
8451
|
const authoredRange = react.useMemo(
|
|
8592
|
-
() =>
|
|
8452
|
+
() => chunkSN5EUDIT_js.resolveAuthoredSlideRange(presentationProperties, slides.length),
|
|
8593
8453
|
[presentationProperties, slides.length]
|
|
8594
8454
|
);
|
|
8595
8455
|
const slideSectionGroups = react.useMemo(
|
|
8596
8456
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8597
|
-
if (group.id ===
|
|
8457
|
+
if (group.id === chunkQWA5YEIZ_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8598
8458
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8599
8459
|
}
|
|
8600
|
-
if (group.id ===
|
|
8460
|
+
if (group.id === chunkQWA5YEIZ_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8601
8461
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8602
8462
|
}
|
|
8603
8463
|
return group;
|
|
@@ -8698,13 +8558,13 @@ function useAnnotationHandlers(input) {
|
|
|
8698
8558
|
}, [annotations, setMode, setSlides, history]);
|
|
8699
8559
|
const handleSetMode = react.useCallback(
|
|
8700
8560
|
(nextMode) => {
|
|
8701
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8561
|
+
if (mode === "present" && nextMode !== "present" && !chunkSN5EUDIT_js.mayLeaveSlideShow()) {
|
|
8702
8562
|
return;
|
|
8703
8563
|
}
|
|
8704
8564
|
if (nextMode === "present") {
|
|
8705
8565
|
presentation.enterPresentMode();
|
|
8706
8566
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8707
|
-
|
|
8567
|
+
chunkSN5EUDIT_js.stopAllPersistentAudio();
|
|
8708
8568
|
if (promptKeepInkAnnotations) {
|
|
8709
8569
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8710
8570
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8714,7 +8574,7 @@ function useAnnotationHandlers(input) {
|
|
|
8714
8574
|
}
|
|
8715
8575
|
} else {
|
|
8716
8576
|
if (mode === "present") {
|
|
8717
|
-
|
|
8577
|
+
chunkSN5EUDIT_js.stopAllPersistentAudio();
|
|
8718
8578
|
}
|
|
8719
8579
|
setMode(nextMode);
|
|
8720
8580
|
}
|
|
@@ -8752,6 +8612,9 @@ function useSerialize(input) {
|
|
|
8752
8612
|
headerFooter,
|
|
8753
8613
|
presentationProperties,
|
|
8754
8614
|
viewProperties,
|
|
8615
|
+
tableStyleMap,
|
|
8616
|
+
tableStylesDefaultId,
|
|
8617
|
+
tableStylesToDelete = [],
|
|
8755
8618
|
customShows,
|
|
8756
8619
|
sections,
|
|
8757
8620
|
coreProperties,
|
|
@@ -8768,90 +8631,100 @@ function useSerialize(input) {
|
|
|
8768
8631
|
embedFonts = true,
|
|
8769
8632
|
purpose
|
|
8770
8633
|
} = input;
|
|
8771
|
-
return react.useCallback(
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
|
|
8783
|
-
|
|
8634
|
+
return react.useCallback(
|
|
8635
|
+
async (format) => {
|
|
8636
|
+
const handler = handlerRef.current;
|
|
8637
|
+
if (!handler) {
|
|
8638
|
+
return null;
|
|
8639
|
+
}
|
|
8640
|
+
const pendingEditId = inlineEditingElementIdRef.current;
|
|
8641
|
+
const pendingEditText = inlineEditingTextRef.current;
|
|
8642
|
+
const slidesWithGuides = slides.map((slide, idx) => {
|
|
8643
|
+
let processedSlide = slide;
|
|
8644
|
+
if (pendingEditId) {
|
|
8645
|
+
const updatedElements = slide.elements.map((el) => {
|
|
8646
|
+
if (el.id !== pendingEditId || !chunkSN5EUDIT_js.hasTextProperties(el)) {
|
|
8647
|
+
return el;
|
|
8648
|
+
}
|
|
8649
|
+
return {
|
|
8650
|
+
...el,
|
|
8651
|
+
text: pendingEditText,
|
|
8652
|
+
textSegments: chunkSN5EUDIT_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8653
|
+
};
|
|
8654
|
+
});
|
|
8655
|
+
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
8656
|
+
processedSlide = { ...slide, elements: updatedElements };
|
|
8784
8657
|
}
|
|
8785
|
-
return {
|
|
8786
|
-
...el,
|
|
8787
|
-
text: pendingEditText,
|
|
8788
|
-
textSegments: chunkAL2KLPOJ_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8789
|
-
};
|
|
8790
|
-
});
|
|
8791
|
-
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
8792
|
-
processedSlide = { ...slide, elements: updatedElements };
|
|
8793
8658
|
}
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
|
|
8805
|
-
|
|
8806
|
-
};
|
|
8807
|
-
|
|
8808
|
-
|
|
8809
|
-
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8659
|
+
if (idx !== activeSlideIndex) {
|
|
8660
|
+
return processedSlide;
|
|
8661
|
+
}
|
|
8662
|
+
const pptxGuides = guides.map((g) => ({
|
|
8663
|
+
id: g.id,
|
|
8664
|
+
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8665
|
+
positionEmu: chunkSN5EUDIT_js.guidePxToEmu(g.position)
|
|
8666
|
+
}));
|
|
8667
|
+
return {
|
|
8668
|
+
...processedSlide,
|
|
8669
|
+
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8670
|
+
};
|
|
8671
|
+
});
|
|
8672
|
+
const slidesToSave = chunkSN5EUDIT_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8673
|
+
const saveOptions = chunkSN5EUDIT_js.buildDeckSaveOptions({
|
|
8674
|
+
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8675
|
+
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8676
|
+
// slide-size edit reaches the file.
|
|
8677
|
+
slideSize: chunkSN5EUDIT_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8678
|
+
headerFooter,
|
|
8679
|
+
presentationProperties,
|
|
8680
|
+
viewProperties,
|
|
8681
|
+
customShows,
|
|
8682
|
+
sections,
|
|
8683
|
+
coreProperties,
|
|
8684
|
+
appProperties,
|
|
8685
|
+
customProperties,
|
|
8686
|
+
tagCollections,
|
|
8687
|
+
slideMasters,
|
|
8688
|
+
notesMaster,
|
|
8689
|
+
handoutMaster,
|
|
8690
|
+
tableStyleMap,
|
|
8691
|
+
tableStylesDefaultId,
|
|
8692
|
+
tableStylesToDelete,
|
|
8693
|
+
embedFonts,
|
|
8694
|
+
outputFormat: format
|
|
8695
|
+
});
|
|
8696
|
+
return chunkSN5EUDIT_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8697
|
+
},
|
|
8698
|
+
[
|
|
8699
|
+
slides,
|
|
8700
|
+
templateElementsBySlideId,
|
|
8701
|
+
canvasSize,
|
|
8702
|
+
slideSizeEmu,
|
|
8814
8703
|
headerFooter,
|
|
8815
8704
|
presentationProperties,
|
|
8816
8705
|
viewProperties,
|
|
8817
|
-
|
|
8818
|
-
|
|
8706
|
+
tableStyleMap,
|
|
8707
|
+
tableStylesDefaultId,
|
|
8708
|
+
tableStylesToDelete,
|
|
8709
|
+
customShows,
|
|
8710
|
+
sections,
|
|
8819
8711
|
coreProperties,
|
|
8820
8712
|
appProperties,
|
|
8821
|
-
customProperties
|
|
8822
|
-
|
|
8713
|
+
customProperties,
|
|
8714
|
+
tagCollections,
|
|
8823
8715
|
slideMasters,
|
|
8824
8716
|
notesMaster,
|
|
8825
8717
|
handoutMaster,
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
|
|
8836
|
-
viewProperties,
|
|
8837
|
-
customShows,
|
|
8838
|
-
sections,
|
|
8839
|
-
coreProperties,
|
|
8840
|
-
appProperties,
|
|
8841
|
-
customProperties,
|
|
8842
|
-
tagCollections,
|
|
8843
|
-
slideMasters,
|
|
8844
|
-
notesMaster,
|
|
8845
|
-
handoutMaster,
|
|
8846
|
-
guides,
|
|
8847
|
-
activeSlideIndex,
|
|
8848
|
-
handlerRef,
|
|
8849
|
-
inlineEditingElementIdRef,
|
|
8850
|
-
inlineEditingTextRef,
|
|
8851
|
-
password,
|
|
8852
|
-
embedFonts,
|
|
8853
|
-
purpose
|
|
8854
|
-
]);
|
|
8718
|
+
guides,
|
|
8719
|
+
activeSlideIndex,
|
|
8720
|
+
handlerRef,
|
|
8721
|
+
inlineEditingElementIdRef,
|
|
8722
|
+
inlineEditingTextRef,
|
|
8723
|
+
password,
|
|
8724
|
+
embedFonts,
|
|
8725
|
+
purpose
|
|
8726
|
+
]
|
|
8727
|
+
);
|
|
8855
8728
|
}
|
|
8856
8729
|
function useRecoveryDetection(input) {
|
|
8857
8730
|
const { filePath, loading, error, slideCount, autosaveAllowed = true } = input;
|
|
@@ -8861,7 +8734,7 @@ function useRecoveryDetection(input) {
|
|
|
8861
8734
|
const onRestore = input.onRestore;
|
|
8862
8735
|
const openVersionHistory = input.openVersionHistory;
|
|
8863
8736
|
react.useEffect(() => {
|
|
8864
|
-
if (!
|
|
8737
|
+
if (!chunkSN5EUDIT_js.shouldProbeAutosaveRecovery({
|
|
8865
8738
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8866
8739
|
filePath,
|
|
8867
8740
|
loading,
|
|
@@ -8873,7 +8746,7 @@ function useRecoveryDetection(input) {
|
|
|
8873
8746
|
}
|
|
8874
8747
|
recoveryCheckedRef.current = true;
|
|
8875
8748
|
void (async () => {
|
|
8876
|
-
const offer = await
|
|
8749
|
+
const offer = await chunkSN5EUDIT_js.probeAutosaveRecovery(filePath);
|
|
8877
8750
|
if (!offer) {
|
|
8878
8751
|
return;
|
|
8879
8752
|
}
|
|
@@ -8886,7 +8759,7 @@ function useRecoveryDetection(input) {
|
|
|
8886
8759
|
const record = recordRef.current;
|
|
8887
8760
|
setPrompt(null);
|
|
8888
8761
|
if (record && onRestore) {
|
|
8889
|
-
onRestore(
|
|
8762
|
+
onRestore(chunkSN5EUDIT_js.acceptAutosaveRecovery(record));
|
|
8890
8763
|
}
|
|
8891
8764
|
recordRef.current = null;
|
|
8892
8765
|
}, [onRestore]);
|
|
@@ -8895,7 +8768,7 @@ function useRecoveryDetection(input) {
|
|
|
8895
8768
|
setPrompt(null);
|
|
8896
8769
|
recordRef.current = null;
|
|
8897
8770
|
if (record) {
|
|
8898
|
-
void
|
|
8771
|
+
void chunkSN5EUDIT_js.discardAutosaveRecovery(record);
|
|
8899
8772
|
}
|
|
8900
8773
|
}, []);
|
|
8901
8774
|
return { prompt, restore, discard };
|
|
@@ -8939,11 +8812,11 @@ function usePresentationSetup(input) {
|
|
|
8939
8812
|
containerRef,
|
|
8940
8813
|
content,
|
|
8941
8814
|
onSetMode: (nextMode) => {
|
|
8942
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8815
|
+
if (mode === "present" && nextMode !== "present" && !chunkSN5EUDIT_js.mayLeaveSlideShow()) {
|
|
8943
8816
|
return;
|
|
8944
8817
|
}
|
|
8945
8818
|
if (mode === "present" && nextMode !== "present") {
|
|
8946
|
-
|
|
8819
|
+
chunkSN5EUDIT_js.stopAllPersistentAudio();
|
|
8947
8820
|
stopAnimationSound();
|
|
8948
8821
|
const exitHandler = exitModeHandlerRef.current;
|
|
8949
8822
|
if (exitHandler) {
|
|
@@ -9011,10 +8884,10 @@ function usePresentationSetup(input) {
|
|
|
9011
8884
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
9012
8885
|
onToggleSubtitles,
|
|
9013
8886
|
onSaveRehearsalTimings: (timings) => {
|
|
9014
|
-
setSlides((prev) =>
|
|
8887
|
+
setSlides((prev) => chunkSN5EUDIT_js.applyRehearsalTimings(prev, timings));
|
|
9015
8888
|
history.markDirty();
|
|
9016
8889
|
},
|
|
9017
|
-
loopContinuously:
|
|
8890
|
+
loopContinuously: chunkSN5EUDIT_js.shouldLoopContinuously(presentationProperties),
|
|
9018
8891
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
9019
8892
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
9020
8893
|
endWithBlackSlide,
|
|
@@ -9220,7 +9093,7 @@ function useEditorOperations(input) {
|
|
|
9220
9093
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9221
9094
|
react.useEffect(() => {
|
|
9222
9095
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9223
|
-
copiedFormatRef.current =
|
|
9096
|
+
copiedFormatRef.current = chunkSN5EUDIT_js.copyFormatFromElement(selectedElement);
|
|
9224
9097
|
} else if (!formatPainterActive) {
|
|
9225
9098
|
copiedFormatRef.current = null;
|
|
9226
9099
|
}
|
|
@@ -9246,12 +9119,12 @@ function useEditorOperations(input) {
|
|
|
9246
9119
|
e.stopPropagation();
|
|
9247
9120
|
const element = elementLookup.get(elementId);
|
|
9248
9121
|
if (element) {
|
|
9249
|
-
const updated =
|
|
9122
|
+
const updated = chunkSN5EUDIT_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9250
9123
|
const updates = {};
|
|
9251
|
-
if (
|
|
9124
|
+
if (chunkSN5EUDIT_js.hasShapeProperties(updated)) {
|
|
9252
9125
|
updates.shapeStyle = updated.shapeStyle;
|
|
9253
9126
|
}
|
|
9254
|
-
if (
|
|
9127
|
+
if (chunkSN5EUDIT_js.hasTextProperties(updated)) {
|
|
9255
9128
|
updates.textStyle = updated.textStyle;
|
|
9256
9129
|
}
|
|
9257
9130
|
ops.updateElementById(elementId, updates);
|
|
@@ -9298,10 +9171,10 @@ function useIOHandlers(input) {
|
|
|
9298
9171
|
ops,
|
|
9299
9172
|
zoom,
|
|
9300
9173
|
handlerRef,
|
|
9174
|
+
serializeSlides,
|
|
9301
9175
|
serializeForRecovery,
|
|
9302
9176
|
setContent,
|
|
9303
9177
|
onContentChange,
|
|
9304
|
-
password,
|
|
9305
9178
|
imageExportScale
|
|
9306
9179
|
} = input;
|
|
9307
9180
|
const exportHandlers = useExportHandlers({
|
|
@@ -9312,24 +9185,20 @@ function useIOHandlers(input) {
|
|
|
9312
9185
|
filePath,
|
|
9313
9186
|
canvasStageRef: zoom.canvasStageRef,
|
|
9314
9187
|
setActiveSlideIndex: state.setActiveSlideIndex,
|
|
9315
|
-
|
|
9188
|
+
serializeSlides,
|
|
9316
9189
|
headerFooter: state.headerFooter,
|
|
9317
9190
|
presentationProperties: state.presentationProperties,
|
|
9318
9191
|
customShows: state.customShows,
|
|
9319
9192
|
sections: state.sections,
|
|
9320
|
-
coreProperties: state.coreProperties
|
|
9321
|
-
appProperties: state.appProperties
|
|
9193
|
+
coreProperties: state.coreProperties,
|
|
9194
|
+
appProperties: state.appProperties,
|
|
9322
9195
|
customProperties: state.customProperties,
|
|
9323
9196
|
tagCollections: state.tagCollections,
|
|
9324
|
-
slideMasters: state.slideMasters,
|
|
9325
9197
|
notesMaster: state.notesMaster,
|
|
9326
9198
|
handoutMaster: state.handoutMaster,
|
|
9327
|
-
guides: state.guides,
|
|
9328
|
-
activeSlideIndexForGuides: state.activeSlideIndex,
|
|
9329
9199
|
theme: state.theme,
|
|
9330
9200
|
canvasSize,
|
|
9331
9201
|
slideSizeEmu: state.slideSizeEmu,
|
|
9332
|
-
password,
|
|
9333
9202
|
imageExportScale
|
|
9334
9203
|
});
|
|
9335
9204
|
const printHandlers = usePrintHandlers({
|
|
@@ -9439,10 +9308,10 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9439
9308
|
}
|
|
9440
9309
|
};
|
|
9441
9310
|
}, [embeddedFonts]);
|
|
9442
|
-
const referencedFamilies = react.useMemo(() =>
|
|
9311
|
+
const referencedFamilies = react.useMemo(() => chunkSN5EUDIT_js.collectReferencedFontFamilies(slides), [slides]);
|
|
9443
9312
|
react.useEffect(() => {
|
|
9444
9313
|
let cancelled = false;
|
|
9445
|
-
void
|
|
9314
|
+
void chunkSN5EUDIT_js.resolveGoogleWebfontHref(slides, embeddedFonts).then((href) => {
|
|
9446
9315
|
if (cancelled) {
|
|
9447
9316
|
return null;
|
|
9448
9317
|
}
|
|
@@ -9528,6 +9397,8 @@ function useContentLifecycle(input) {
|
|
|
9528
9397
|
setRecentColors: state.setRecentColors,
|
|
9529
9398
|
setTheme: state.setTheme,
|
|
9530
9399
|
setTableStyleMap: state.setTableStyleMap,
|
|
9400
|
+
setTableStylesDefaultId: state.setTableStylesDefaultId,
|
|
9401
|
+
setTableStylesToDelete: state.setTableStylesToDelete,
|
|
9531
9402
|
setThemeOptions: state.setThemeOptions,
|
|
9532
9403
|
setCustomShows: state.setCustomShows,
|
|
9533
9404
|
setActiveCustomShowId: state.setActiveCustomShowId,
|
|
@@ -9570,6 +9441,9 @@ function useContentLifecycle(input) {
|
|
|
9570
9441
|
headerFooter: state.headerFooter,
|
|
9571
9442
|
presentationProperties: state.presentationProperties,
|
|
9572
9443
|
viewProperties: state.viewProperties,
|
|
9444
|
+
tableStyleMap: state.tableStyleMap,
|
|
9445
|
+
tableStylesDefaultId: state.tableStylesDefaultId,
|
|
9446
|
+
tableStylesToDelete: state.tableStylesToDelete,
|
|
9573
9447
|
customShows: state.customShows,
|
|
9574
9448
|
sections: state.sections,
|
|
9575
9449
|
coreProperties: state.coreProperties,
|
|
@@ -9625,7 +9499,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9625
9499
|
inputRef.current = input;
|
|
9626
9500
|
const handleKeyDown = react.useCallback((e) => {
|
|
9627
9501
|
const current = inputRef.current;
|
|
9628
|
-
const startAction =
|
|
9502
|
+
const startAction = chunkSN5EUDIT_js.mapSlideShowStartKey(e, { isPresenting: current.mode === "present" });
|
|
9629
9503
|
if (startAction !== null) {
|
|
9630
9504
|
e.preventDefault();
|
|
9631
9505
|
if (startAction === "fromBeginning") {
|
|
@@ -9635,7 +9509,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9635
9509
|
}
|
|
9636
9510
|
return;
|
|
9637
9511
|
}
|
|
9638
|
-
const { action, dx, dy } =
|
|
9512
|
+
const { action, dx, dy } = chunkSN5EUDIT_js.mapEditorKey(e, {
|
|
9639
9513
|
canEdit: current.canEdit,
|
|
9640
9514
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9641
9515
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9648,7 +9522,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9648
9522
|
hasSelection: current.hasSelection,
|
|
9649
9523
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9650
9524
|
isDrawing: current.activeTool !== "select",
|
|
9651
|
-
isTextInputTarget:
|
|
9525
|
+
isTextInputTarget: chunkSN5EUDIT_js.isEditorTextInputTarget(e.target)
|
|
9652
9526
|
});
|
|
9653
9527
|
if (action === null) {
|
|
9654
9528
|
return;
|
|
@@ -9903,10 +9777,10 @@ function useViewerIntegration(input) {
|
|
|
9903
9777
|
ops: editorOps.ops,
|
|
9904
9778
|
zoom,
|
|
9905
9779
|
handlerRef,
|
|
9780
|
+
serializeSlides,
|
|
9906
9781
|
serializeForRecovery,
|
|
9907
9782
|
setContent,
|
|
9908
9783
|
onContentChange,
|
|
9909
|
-
password: dialogs.presentationPassword ?? void 0,
|
|
9910
9784
|
imageExportScale
|
|
9911
9785
|
});
|
|
9912
9786
|
const {
|
|
@@ -9976,7 +9850,7 @@ function useViewerIntegration(input) {
|
|
|
9976
9850
|
return zoom.scale;
|
|
9977
9851
|
},
|
|
9978
9852
|
setZoom(level) {
|
|
9979
|
-
zoom.setScale(
|
|
9853
|
+
zoom.setScale(chunkSN5EUDIT_js.clampZoomScale(level));
|
|
9980
9854
|
},
|
|
9981
9855
|
zoomIn() {
|
|
9982
9856
|
zoom.handleZoomIn();
|
|
@@ -10194,7 +10068,7 @@ function useReducedMotion() {
|
|
|
10194
10068
|
}
|
|
10195
10069
|
function useViewerOptions() {
|
|
10196
10070
|
const storeRef = react.useRef(null);
|
|
10197
|
-
storeRef.current ??=
|
|
10071
|
+
storeRef.current ??= chunkSN5EUDIT_js.createViewerOptionsStore();
|
|
10198
10072
|
const store = storeRef.current;
|
|
10199
10073
|
const options = react.useSyncExternalStore(
|
|
10200
10074
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -10203,9 +10077,9 @@ function useViewerOptions() {
|
|
|
10203
10077
|
);
|
|
10204
10078
|
return { optionsStore: store, options };
|
|
10205
10079
|
}
|
|
10206
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10080
|
+
var KNOWN_TAB_IDS = new Set(chunkSN5EUDIT_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10207
10081
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
10208
|
-
const isHidden = (id) =>
|
|
10082
|
+
const isHidden = (id) => chunkSN5EUDIT_js.isActionHidden(id, hiddenActions);
|
|
10209
10083
|
const userHidden = new Set(hiddenTabIds);
|
|
10210
10084
|
userHidden.delete("file");
|
|
10211
10085
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
|
|
@@ -10257,6 +10131,7 @@ function useYjsDocumentSync({
|
|
|
10257
10131
|
isSynced = true,
|
|
10258
10132
|
config,
|
|
10259
10133
|
getSourceBytes,
|
|
10134
|
+
getSaveOptions,
|
|
10260
10135
|
loadVersion = 0,
|
|
10261
10136
|
loadOrigin = "user"
|
|
10262
10137
|
}) {
|
|
@@ -10297,18 +10172,18 @@ function useYjsDocumentSync({
|
|
|
10297
10172
|
return;
|
|
10298
10173
|
}
|
|
10299
10174
|
try {
|
|
10300
|
-
const handler = new
|
|
10175
|
+
const handler = new chunkSN5EUDIT_js.PptxHandler();
|
|
10301
10176
|
await handler.load(sourceBytes.buffer);
|
|
10302
|
-
const currentSlides =
|
|
10177
|
+
const currentSlides = chunkSN5EUDIT_js.readSlidesFromYDoc(
|
|
10303
10178
|
doc
|
|
10304
10179
|
);
|
|
10305
|
-
const slidesToSave =
|
|
10306
|
-
const bytes = await handler.save(slidesToSave);
|
|
10180
|
+
const slidesToSave = chunkSN5EUDIT_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10181
|
+
const bytes = await handler.save(slidesToSave, getSaveOptions?.());
|
|
10307
10182
|
config.onWriteBack(bytes);
|
|
10308
10183
|
} catch {
|
|
10309
10184
|
}
|
|
10310
10185
|
}, debounceMs);
|
|
10311
|
-
}, [doc, config, getSourceBytes, templateElementsBySlideId]);
|
|
10186
|
+
}, [doc, config, getSourceBytes, getSaveOptions, templateElementsBySlideId]);
|
|
10312
10187
|
react.useEffect(() => {
|
|
10313
10188
|
if (loadVersion === lastLoadVersionRef.current) {
|
|
10314
10189
|
return;
|
|
@@ -10317,10 +10192,10 @@ function useYjsDocumentSync({
|
|
|
10317
10192
|
if (!doc || !isConnected) {
|
|
10318
10193
|
return;
|
|
10319
10194
|
}
|
|
10320
|
-
const docSlides =
|
|
10195
|
+
const docSlides = chunkSN5EUDIT_js.readSlidesFromYDoc(
|
|
10321
10196
|
doc
|
|
10322
10197
|
);
|
|
10323
|
-
if (!
|
|
10198
|
+
if (!chunkSN5EUDIT_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10324
10199
|
return;
|
|
10325
10200
|
}
|
|
10326
10201
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10339,11 +10214,11 @@ function useYjsDocumentSync({
|
|
|
10339
10214
|
lastSyncedRef.current = serialized;
|
|
10340
10215
|
void (async () => {
|
|
10341
10216
|
const factories = await getFactories();
|
|
10342
|
-
|
|
10217
|
+
chunkSN5EUDIT_js.reconcileSlidesInYDoc(
|
|
10343
10218
|
slides,
|
|
10344
10219
|
doc,
|
|
10345
10220
|
factories,
|
|
10346
|
-
|
|
10221
|
+
chunkSN5EUDIT_js.LOCAL_SYNC_ORIGIN
|
|
10347
10222
|
);
|
|
10348
10223
|
scheduleWriteBack();
|
|
10349
10224
|
})();
|
|
@@ -10357,10 +10232,10 @@ function useYjsDocumentSync({
|
|
|
10357
10232
|
return;
|
|
10358
10233
|
}
|
|
10359
10234
|
const handleChange = (_events, transaction) => {
|
|
10360
|
-
if (transaction?.origin ===
|
|
10235
|
+
if (transaction?.origin === chunkSN5EUDIT_js.LOCAL_SYNC_ORIGIN) {
|
|
10361
10236
|
return;
|
|
10362
10237
|
}
|
|
10363
|
-
const remoteSlides =
|
|
10238
|
+
const remoteSlides = chunkSN5EUDIT_js.readSlidesFromYDoc(
|
|
10364
10239
|
doc
|
|
10365
10240
|
);
|
|
10366
10241
|
if (remoteSlides.length === 0) {
|
|
@@ -10376,7 +10251,7 @@ function useYjsDocumentSync({
|
|
|
10376
10251
|
isApplyingRemoteRef.current = false;
|
|
10377
10252
|
scheduleWriteBack();
|
|
10378
10253
|
};
|
|
10379
|
-
const unobserve =
|
|
10254
|
+
const unobserve = chunkSN5EUDIT_js.observeYDocSlides(
|
|
10380
10255
|
doc,
|
|
10381
10256
|
handleChange
|
|
10382
10257
|
);
|
|
@@ -10414,7 +10289,7 @@ function useBroadcastFollower({
|
|
|
10414
10289
|
if (!broadcaster) {
|
|
10415
10290
|
return;
|
|
10416
10291
|
}
|
|
10417
|
-
if (!
|
|
10292
|
+
if (!chunkSN5EUDIT_js.shouldAutoFollowBroadcaster({
|
|
10418
10293
|
localRole: collab.config.role,
|
|
10419
10294
|
broadcasterRole: broadcaster.role
|
|
10420
10295
|
})) {
|
|
@@ -10585,7 +10460,7 @@ function subscribeTouchCapability(callback) {
|
|
|
10585
10460
|
function useIsMobile() {
|
|
10586
10461
|
const isTouchDevice = react.useSyncExternalStore(
|
|
10587
10462
|
subscribeTouchCapability,
|
|
10588
|
-
|
|
10463
|
+
chunkSN5EUDIT_js.detectTouchDevice,
|
|
10589
10464
|
() => false
|
|
10590
10465
|
// server snapshot
|
|
10591
10466
|
);
|
|
@@ -10595,7 +10470,7 @@ function useIsMobile() {
|
|
|
10595
10470
|
const [viewportHeight, setViewportHeight] = react.useState(
|
|
10596
10471
|
() => typeof window === "undefined" ? 768 : window.innerHeight
|
|
10597
10472
|
);
|
|
10598
|
-
const [orientation, setOrientation] = react.useState(
|
|
10473
|
+
const [orientation, setOrientation] = react.useState(chunkSN5EUDIT_js.detectOrientation);
|
|
10599
10474
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
10600
10475
|
const [initialViewportHeight] = react.useState(
|
|
10601
10476
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -10616,7 +10491,7 @@ function useIsMobile() {
|
|
|
10616
10491
|
return;
|
|
10617
10492
|
}
|
|
10618
10493
|
const handleOrientationChange = () => {
|
|
10619
|
-
setOrientation(
|
|
10494
|
+
setOrientation(chunkSN5EUDIT_js.detectOrientation());
|
|
10620
10495
|
};
|
|
10621
10496
|
if (screen.orientation) {
|
|
10622
10497
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -10646,7 +10521,7 @@ function useIsMobile() {
|
|
|
10646
10521
|
window.addEventListener("resize", handleResize);
|
|
10647
10522
|
return () => window.removeEventListener("resize", handleResize);
|
|
10648
10523
|
}, [isTouchDevice, initialViewportHeight]);
|
|
10649
|
-
const { isMobile, isTablet, isDesktop } =
|
|
10524
|
+
const { isMobile, isTablet, isDesktop } = chunkSN5EUDIT_js.deriveViewportBreakpoints(
|
|
10650
10525
|
viewportWidth,
|
|
10651
10526
|
viewportHeight,
|
|
10652
10527
|
isTouchDevice
|
|
@@ -10677,10 +10552,10 @@ function useTouchGestures(input) {
|
|
|
10677
10552
|
if (!el || !enabled) {
|
|
10678
10553
|
return;
|
|
10679
10554
|
}
|
|
10680
|
-
const recognizer =
|
|
10555
|
+
const recognizer = chunkSN5EUDIT_js.createTouchGestureRecognizer({
|
|
10681
10556
|
getScale: () => scaleRef.current,
|
|
10682
|
-
minScale:
|
|
10683
|
-
maxScale:
|
|
10557
|
+
minScale: chunkSN5EUDIT_js.MIN_ZOOM_SCALE,
|
|
10558
|
+
maxScale: chunkSN5EUDIT_js.MAX_ZOOM_SCALE,
|
|
10684
10559
|
callbacks: {
|
|
10685
10560
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10686
10561
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10720,7 +10595,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10720
10595
|
return;
|
|
10721
10596
|
}
|
|
10722
10597
|
const rect = active.getBoundingClientRect();
|
|
10723
|
-
const delta =
|
|
10598
|
+
const delta = chunkSN5EUDIT_js.computeScrollDelta(
|
|
10724
10599
|
{ top: rect.top, bottom: rect.bottom },
|
|
10725
10600
|
window.innerHeight,
|
|
10726
10601
|
keyboardInset
|
|
@@ -10740,8 +10615,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10740
10615
|
return;
|
|
10741
10616
|
}
|
|
10742
10617
|
const update = () => {
|
|
10743
|
-
const metrics =
|
|
10744
|
-
const inset = metrics ?
|
|
10618
|
+
const metrics = chunkSN5EUDIT_js.readViewportMetrics(window);
|
|
10619
|
+
const inset = metrics ? chunkSN5EUDIT_js.computeKeyboardInset(metrics) : 0;
|
|
10745
10620
|
setKeyboardInset(inset);
|
|
10746
10621
|
if (inset > 0) {
|
|
10747
10622
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10752,8 +10627,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10752
10627
|
vv.addEventListener("scroll", update);
|
|
10753
10628
|
const onFocusIn = () => {
|
|
10754
10629
|
window.requestAnimationFrame(() => {
|
|
10755
|
-
const metrics =
|
|
10756
|
-
const inset = metrics ?
|
|
10630
|
+
const metrics = chunkSN5EUDIT_js.readViewportMetrics(window);
|
|
10631
|
+
const inset = metrics ? chunkSN5EUDIT_js.computeKeyboardInset(metrics) : 0;
|
|
10757
10632
|
if (inset > 0) {
|
|
10758
10633
|
scrollFocusedIntoView(inset);
|
|
10759
10634
|
}
|
|
@@ -10766,7 +10641,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10766
10641
|
document.removeEventListener("focusin", onFocusIn);
|
|
10767
10642
|
};
|
|
10768
10643
|
}, [enabled]);
|
|
10769
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10644
|
+
return { keyboardInset, isKeyboardOpen: chunkSN5EUDIT_js.isKeyboardOpen(keyboardInset) };
|
|
10770
10645
|
}
|
|
10771
10646
|
|
|
10772
10647
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10795,21 +10670,21 @@ function buildCanvasProps(input) {
|
|
|
10795
10670
|
} = input;
|
|
10796
10671
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10797
10672
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10798
|
-
const fieldContext =
|
|
10673
|
+
const fieldContext = chunkSN5EUDIT_js.buildFieldSubstitutionContext({
|
|
10799
10674
|
headerFooter: s.headerFooter,
|
|
10800
10675
|
customProperties: s.customProperties,
|
|
10801
10676
|
slide: activeSlide
|
|
10802
10677
|
});
|
|
10803
10678
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10804
10679
|
const openExternalUrl = (url, target) => {
|
|
10805
|
-
if (
|
|
10680
|
+
if (chunkSN5EUDIT_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
10806
10681
|
return;
|
|
10807
10682
|
}
|
|
10808
|
-
|
|
10683
|
+
chunkSN5EUDIT_js.safeOpenUrl(url, target);
|
|
10809
10684
|
};
|
|
10810
10685
|
const handleActionClick = (elementId, action) => {
|
|
10811
10686
|
if (mode === "present") {
|
|
10812
|
-
const resolved =
|
|
10687
|
+
const resolved = chunkSN5EUDIT_js.resolvePresentationAction(action, { slideCount: slides.length });
|
|
10813
10688
|
if (resolved.intent.kind === "openUrl") {
|
|
10814
10689
|
openExternalUrl(resolved.intent.url);
|
|
10815
10690
|
return;
|
|
@@ -10820,9 +10695,9 @@ function buildCanvasProps(input) {
|
|
|
10820
10695
|
}
|
|
10821
10696
|
};
|
|
10822
10697
|
const handleHyperlinkClick = (url, target) => {
|
|
10823
|
-
if (
|
|
10698
|
+
if (chunkSN5EUDIT_js.isPpactionUrl(url)) {
|
|
10824
10699
|
if (mode === "present") {
|
|
10825
|
-
const parsed =
|
|
10700
|
+
const parsed = chunkSN5EUDIT_js.parsePpactionUrl(url);
|
|
10826
10701
|
if (parsed) {
|
|
10827
10702
|
presentation.handlePresentationAction({
|
|
10828
10703
|
action: parsed.action,
|
|
@@ -10928,7 +10803,7 @@ function buildCanvasProps(input) {
|
|
|
10928
10803
|
|
|
10929
10804
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10930
10805
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10931
|
-
return
|
|
10806
|
+
return chunkSN5EUDIT_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10932
10807
|
}
|
|
10933
10808
|
|
|
10934
10809
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10941,7 +10816,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10941
10816
|
const current = activeSlide.animations ?? [];
|
|
10942
10817
|
if (group === "motionPath") {
|
|
10943
10818
|
propertyHandlers.handleUpdateSlide({
|
|
10944
|
-
animations:
|
|
10819
|
+
animations: chunkSN5EUDIT_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10945
10820
|
});
|
|
10946
10821
|
return;
|
|
10947
10822
|
}
|
|
@@ -11137,7 +11012,7 @@ function buildToolbarProps(input) {
|
|
|
11137
11012
|
onOpenFile,
|
|
11138
11013
|
onOpenRecentFile,
|
|
11139
11014
|
onCreatePresentation: (templateId) => {
|
|
11140
|
-
s.setSlides(
|
|
11015
|
+
s.setSlides(chunkSN5EUDIT_js.createBackstagePresentation(templateId));
|
|
11141
11016
|
s.setActiveSlideIndex(0);
|
|
11142
11017
|
s.setSelectedElementId(null);
|
|
11143
11018
|
s.setSelectedElementIds([]);
|
|
@@ -11166,7 +11041,7 @@ function buildToolbarProps(input) {
|
|
|
11166
11041
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
11167
11042
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
11168
11043
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
11169
|
-
templateScheme:
|
|
11044
|
+
templateScheme: chunkSN5EUDIT_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
11170
11045
|
customShows: s.customShows,
|
|
11171
11046
|
activeCustomShowId: s.activeCustomShowId,
|
|
11172
11047
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -11207,7 +11082,7 @@ function buildToolbarProps(input) {
|
|
|
11207
11082
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
11208
11083
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
11209
11084
|
formatPainterActive: s.formatPainterActive,
|
|
11210
|
-
canActivateFormatPainter:
|
|
11085
|
+
canActivateFormatPainter: chunkSN5EUDIT_js.hasCopyableFormat(selectedElement),
|
|
11211
11086
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
11212
11087
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
11213
11088
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11285,7 +11160,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11285
11160
|
headerFooter: state.headerFooter,
|
|
11286
11161
|
loading,
|
|
11287
11162
|
error,
|
|
11288
|
-
maxHistoryEntries:
|
|
11163
|
+
maxHistoryEntries: chunkSN5EUDIT_js.resolveHistoryDepth(viewerOptions),
|
|
11289
11164
|
hasActivePointerInteraction,
|
|
11290
11165
|
pointerCommitNonce: state.pointerCommitNonce,
|
|
11291
11166
|
onDirty: markDocumentDirty,
|
|
@@ -11353,7 +11228,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11353
11228
|
gridSpacingPx,
|
|
11354
11229
|
// Multiplied against the pre-existing 2x baseline; see the matching
|
|
11355
11230
|
// comment in `PowerPointViewer.tsx`.
|
|
11356
|
-
imageExportScale: 2 *
|
|
11231
|
+
imageExportScale: 2 * chunkSN5EUDIT_js.resolveImageResolutionScale(viewerOptions),
|
|
11357
11232
|
viewerOptions
|
|
11358
11233
|
};
|
|
11359
11234
|
}
|
|
@@ -11369,7 +11244,7 @@ function useCompatibilityToastsState() {
|
|
|
11369
11244
|
}
|
|
11370
11245
|
function useReadOnlyRecommendationState(content) {
|
|
11371
11246
|
const [recommendation, setRecommendation] = react.useState(
|
|
11372
|
-
() =>
|
|
11247
|
+
() => chunkSN5EUDIT_js.readOnlyRecommendation(void 0)
|
|
11373
11248
|
);
|
|
11374
11249
|
const [bannerHidden, setBannerHidden] = react.useState(false);
|
|
11375
11250
|
const [editAnywayActive, setEditAnywayActive] = react.useState(false);
|
|
@@ -11407,9 +11282,9 @@ function useViewPreferencesSync(input) {
|
|
|
11407
11282
|
setShowGuides
|
|
11408
11283
|
} = input;
|
|
11409
11284
|
react.useEffect(() => {
|
|
11410
|
-
const seeded =
|
|
11285
|
+
const seeded = chunkSN5EUDIT_js.viewerPreferencesFromViewProperties(
|
|
11411
11286
|
{ viewProperties },
|
|
11412
|
-
{ ...
|
|
11287
|
+
{ ...chunkSN5EUDIT_js.DEFAULT_VIEWER_PREFERENCES, snapToGrid, snapToObjects: snapToShape, showGuides }
|
|
11413
11288
|
);
|
|
11414
11289
|
setSnapToGrid(seeded.snapToGrid);
|
|
11415
11290
|
setSnapToShape(seeded.snapToObjects ?? snapToShape);
|
|
@@ -11419,7 +11294,7 @@ function useViewPreferencesSync(input) {
|
|
|
11419
11294
|
(prefsOverride) => {
|
|
11420
11295
|
setViewProperties((prev) => {
|
|
11421
11296
|
const merged = {
|
|
11422
|
-
...
|
|
11297
|
+
...chunkSN5EUDIT_js.DEFAULT_VIEWER_PREFERENCES,
|
|
11423
11298
|
snapToGrid,
|
|
11424
11299
|
snapToObjects: snapToShape,
|
|
11425
11300
|
showGuides,
|
|
@@ -11427,7 +11302,7 @@ function useViewPreferencesSync(input) {
|
|
|
11427
11302
|
gridSpacingCy: prev?.gridSpacing?.cy,
|
|
11428
11303
|
...prefsOverride
|
|
11429
11304
|
};
|
|
11430
|
-
const patch =
|
|
11305
|
+
const patch = chunkSN5EUDIT_js.viewPropertiesPatchFromPreferences(merged);
|
|
11431
11306
|
return {
|
|
11432
11307
|
...prev,
|
|
11433
11308
|
slideViewPr: { ...prev?.slideViewPr, ...patch.slideViewPr },
|
|
@@ -11645,7 +11520,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11645
11520
|
}, [incomingContent]);
|
|
11646
11521
|
const onOpenFile = react.useCallback(() => {
|
|
11647
11522
|
void (async () => {
|
|
11648
|
-
const picked = await
|
|
11523
|
+
const picked = await chunkSN5EUDIT_js.openPptxFile();
|
|
11649
11524
|
if (picked) {
|
|
11650
11525
|
setContent(picked.buffer);
|
|
11651
11526
|
}
|
|
@@ -11653,7 +11528,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11653
11528
|
}, []);
|
|
11654
11529
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11655
11530
|
void (async () => {
|
|
11656
|
-
const bytes = await
|
|
11531
|
+
const bytes = await chunkSN5EUDIT_js.readBackstageRecentFile(key);
|
|
11657
11532
|
if (bytes) {
|
|
11658
11533
|
setContent(bytes);
|
|
11659
11534
|
}
|