pptx-react-viewer 3.7.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 +13 -0
- package/dist/{AiChatPanel-L5QGWVZK.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-M3AHKYPS.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-AE2XYKDW.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-ZQLQK6L4.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-FQV62XOI.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-TZ6ADFBS.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-5CKPAX63.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-FEUY3PCE.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-V3DHIISV.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-BLXEALM6.js → Model3DScene-QQWKGJ3T.js} +2 -2
- package/dist/{Model3DScene-BLXEALM6.js.br → Model3DScene-QQWKGJ3T.js.br} +0 -0
- package/dist/Model3DScene-QQWKGJ3T.js.gz +0 -0
- package/dist/{PieChart3DScene-VZI2VARG.mjs → PieChart3DScene-CI6CW22C.mjs} +1 -1
- package/dist/{PieChart3DScene-VZI2VARG.mjs.br → PieChart3DScene-CI6CW22C.mjs.br} +0 -0
- package/dist/PieChart3DScene-CI6CW22C.mjs.gz +0 -0
- package/dist/{PieChart3DScene-GHHT3PDV.js → PieChart3DScene-L3MHKQHW.js} +2 -2
- package/dist/{PieChart3DScene-GHHT3PDV.js.br → 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-WWIMQ65D.js → SurfaceChart3DScene-5IER6VFW.js} +2 -2
- package/dist/{SurfaceChart3DScene-WWIMQ65D.js.br → SurfaceChart3DScene-5IER6VFW.js.br} +0 -0
- package/dist/SurfaceChart3DScene-5IER6VFW.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-T36E2HBA.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-TUSALM3A.js → chunk-4222CHFH.js} +1709 -1235
- package/dist/chunk-4222CHFH.js.br +0 -0
- package/dist/chunk-4222CHFH.js.gz +0 -0
- package/dist/{chunk-NV55GU5V.mjs → chunk-6IMB5DNJ.mjs} +4953 -3103
- package/dist/chunk-6IMB5DNJ.mjs.br +0 -0
- package/dist/chunk-6IMB5DNJ.mjs.gz +0 -0
- package/dist/{chunk-OBE4TB76.js → chunk-DE3S3UHX.js} +551 -574
- package/dist/chunk-DE3S3UHX.js.br +0 -0
- package/dist/chunk-DE3S3UHX.js.gz +0 -0
- package/dist/{chunk-3EJFZ7TE.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-FGTMS7LR.mjs → chunk-FRZIBZTE.mjs} +55 -4
- package/dist/chunk-FRZIBZTE.mjs.br +0 -0
- package/dist/chunk-FRZIBZTE.mjs.gz +0 -0
- package/dist/{chunk-W24OJ7H5.js → chunk-L3ZIBQEB.js} +55 -4
- package/dist/chunk-L3ZIBQEB.js.br +0 -0
- package/dist/chunk-L3ZIBQEB.js.gz +0 -0
- package/dist/{chunk-TXY2E7VQ.mjs → chunk-PFPKBNNZ.mjs} +509 -35
- package/dist/chunk-PFPKBNNZ.mjs.br +0 -0
- package/dist/chunk-PFPKBNNZ.mjs.gz +0 -0
- package/dist/{chunk-VIFDZIVX.js → chunk-QWA5YEIZ.js} +187 -176
- package/dist/chunk-QWA5YEIZ.js.br +0 -0
- package/dist/chunk-QWA5YEIZ.js.gz +0 -0
- package/dist/{chunk-JANUSAEK.mjs → chunk-RHWQKZLB.mjs} +14 -3
- package/dist/chunk-RHWQKZLB.mjs.br +0 -0
- package/dist/chunk-RHWQKZLB.mjs.gz +0 -0
- package/dist/{chunk-WKODF5ZU.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-DCNHUEWQ.js → chunk-SN5EUDIT.js} +4972 -3103
- package/dist/chunk-SN5EUDIT.js.br +0 -0
- package/dist/chunk-SN5EUDIT.js.gz +0 -0
- package/dist/{chunk-PC62KGU3.mjs → chunk-UPJW34YG.mjs} +124 -147
- 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 +179 -23
- 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 +352 -171
- 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 +150 -23
- 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-L5QGWVZK.mjs.br +0 -0
- package/dist/AiChatPanel-L5QGWVZK.mjs.gz +0 -0
- package/dist/AiChatPanel-M3AHKYPS.js.br +0 -0
- package/dist/AiChatPanel-M3AHKYPS.js.gz +0 -0
- package/dist/Area3DChartScene-AE2XYKDW.mjs.br +0 -1
- package/dist/Area3DChartScene-AE2XYKDW.mjs.gz +0 -0
- package/dist/Area3DChartScene-ZQLQK6L4.js.br +0 -0
- package/dist/Area3DChartScene-ZQLQK6L4.js.gz +0 -0
- package/dist/Bar3DChartScene-FQV62XOI.mjs.br +0 -2
- package/dist/Bar3DChartScene-FQV62XOI.mjs.gz +0 -0
- package/dist/Bar3DChartScene-TZ6ADFBS.js.br +0 -0
- package/dist/Bar3DChartScene-TZ6ADFBS.js.gz +0 -0
- package/dist/Line3DChartScene-5CKPAX63.js.br +0 -0
- package/dist/Line3DChartScene-5CKPAX63.js.gz +0 -0
- package/dist/Line3DChartScene-FEUY3PCE.mjs.br +0 -1
- package/dist/Line3DChartScene-FEUY3PCE.mjs.gz +0 -0
- package/dist/Model3DScene-BLXEALM6.js.gz +0 -0
- package/dist/Model3DScene-V3DHIISV.mjs.br +0 -0
- package/dist/Model3DScene-V3DHIISV.mjs.gz +0 -0
- package/dist/PieChart3DScene-GHHT3PDV.js.gz +0 -0
- package/dist/PieChart3DScene-VZI2VARG.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-T36E2HBA.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-T36E2HBA.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-WWIMQ65D.js.gz +0 -0
- package/dist/chunk-3EJFZ7TE.js.br +0 -0
- package/dist/chunk-3EJFZ7TE.js.gz +0 -0
- package/dist/chunk-DCNHUEWQ.js.br +0 -0
- package/dist/chunk-DCNHUEWQ.js.gz +0 -0
- package/dist/chunk-FGTMS7LR.mjs.br +0 -0
- package/dist/chunk-FGTMS7LR.mjs.gz +0 -0
- package/dist/chunk-JANUSAEK.mjs.br +0 -0
- package/dist/chunk-JANUSAEK.mjs.gz +0 -0
- package/dist/chunk-NV55GU5V.mjs.br +0 -0
- package/dist/chunk-NV55GU5V.mjs.gz +0 -0
- package/dist/chunk-OBE4TB76.js.br +0 -0
- package/dist/chunk-OBE4TB76.js.gz +0 -0
- package/dist/chunk-PC62KGU3.mjs.br +0 -0
- package/dist/chunk-PC62KGU3.mjs.gz +0 -0
- package/dist/chunk-TUSALM3A.js.br +0 -0
- package/dist/chunk-TUSALM3A.js.gz +0 -0
- package/dist/chunk-TXY2E7VQ.mjs.br +0 -0
- package/dist/chunk-TXY2E7VQ.mjs.gz +0 -0
- package/dist/chunk-VIFDZIVX.js.br +0 -0
- package/dist/chunk-VIFDZIVX.js.gz +0 -0
- package/dist/chunk-W24OJ7H5.js.br +0 -0
- package/dist/chunk-W24OJ7H5.js.gz +0 -0
- package/dist/chunk-WKODF5ZU.mjs.br +0 -0
- package/dist/chunk-WKODF5ZU.mjs.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]
|
|
@@ -984,8 +984,8 @@ function scheduleOpeningAutoPlayGroup(controller, ctx) {
|
|
|
984
984
|
if (!group) {
|
|
985
985
|
return;
|
|
986
986
|
}
|
|
987
|
-
|
|
988
|
-
|
|
987
|
+
chunkSN5EUDIT_js.playGroup(controller, group, ctx);
|
|
988
|
+
chunkSN5EUDIT_js.scheduleAutoAdvanceChain(controller, ctx);
|
|
989
989
|
}, firstGroup.autoAdvanceDelayMs ?? 0);
|
|
990
990
|
ctx.timers.push(timer);
|
|
991
991
|
}
|
|
@@ -1004,7 +1004,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1004
1004
|
}))
|
|
1005
1005
|
);
|
|
1006
1006
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1007
|
-
const delay =
|
|
1007
|
+
const delay = chunkSN5EUDIT_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1008
1008
|
const timer = window.setTimeout(() => {
|
|
1009
1009
|
setPresentationAnimations(
|
|
1010
1010
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1030,7 +1030,7 @@ function useAnimationPlayback(input) {
|
|
|
1030
1030
|
const presentationTimersRef = react.useRef([]);
|
|
1031
1031
|
const controllerRef = react.useRef(null);
|
|
1032
1032
|
const buildRafRef = react.useRef(null);
|
|
1033
|
-
const activeAnimationGroupRef = react.useRef(
|
|
1033
|
+
const activeAnimationGroupRef = react.useRef(chunkSN5EUDIT_js.createActiveAnimationGroup());
|
|
1034
1034
|
const seededCompletedRef = react.useRef(false);
|
|
1035
1035
|
const mediaTimeNodeElementIdsRef = react.useRef(/* @__PURE__ */ new Map());
|
|
1036
1036
|
const lastSeedCompletedRef = react.useRef(false);
|
|
@@ -1047,15 +1047,15 @@ function useAnimationPlayback(input) {
|
|
|
1047
1047
|
}, [onPlayActionSound]);
|
|
1048
1048
|
react.useEffect(() => {
|
|
1049
1049
|
return () => {
|
|
1050
|
-
|
|
1050
|
+
chunkSN5EUDIT_js.cancelBuildReveal(buildRafRef);
|
|
1051
1051
|
};
|
|
1052
1052
|
}, []);
|
|
1053
1053
|
const clearPresentationTimers = react.useCallback(() => {
|
|
1054
|
-
|
|
1054
|
+
chunkSN5EUDIT_js.clearPlaybackTimers(buildPlaybackContext(), activeAnimationGroupRef.current);
|
|
1055
1055
|
}, [buildPlaybackContext]);
|
|
1056
1056
|
const resetSlideTimeline = react.useCallback(
|
|
1057
1057
|
(slideIndex) => {
|
|
1058
|
-
|
|
1058
|
+
chunkSN5EUDIT_js.cancelBuildReveal(buildRafRef);
|
|
1059
1059
|
const slide = slides[slideIndex];
|
|
1060
1060
|
if (!slide) {
|
|
1061
1061
|
controllerRef.current = null;
|
|
@@ -1066,9 +1066,9 @@ function useAnimationPlayback(input) {
|
|
|
1066
1066
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1067
1067
|
return;
|
|
1068
1068
|
}
|
|
1069
|
-
const controller =
|
|
1069
|
+
const controller = chunkSN5EUDIT_js.PresentationAnimationController.fromSlide(slide);
|
|
1070
1070
|
controllerRef.current = controller;
|
|
1071
|
-
mediaTimeNodeElementIdsRef.current =
|
|
1071
|
+
mediaTimeNodeElementIdsRef.current = chunkSN5EUDIT_js.resolveMediaTimeNodeElementIds(
|
|
1072
1072
|
slide.nativeAnimations ?? []
|
|
1073
1073
|
);
|
|
1074
1074
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
@@ -1082,7 +1082,7 @@ function useAnimationPlayback(input) {
|
|
|
1082
1082
|
if (!animationsEnabled) {
|
|
1083
1083
|
return false;
|
|
1084
1084
|
}
|
|
1085
|
-
return
|
|
1085
|
+
return chunkSN5EUDIT_js.advanceMainSequence(
|
|
1086
1086
|
controllerRef.current,
|
|
1087
1087
|
buildPlaybackContext(),
|
|
1088
1088
|
activeAnimationGroupRef.current
|
|
@@ -1098,7 +1098,7 @@ function useAnimationPlayback(input) {
|
|
|
1098
1098
|
if (!group) {
|
|
1099
1099
|
return false;
|
|
1100
1100
|
}
|
|
1101
|
-
|
|
1101
|
+
chunkSN5EUDIT_js.playGroup(controller, group, buildPlaybackContext());
|
|
1102
1102
|
return true;
|
|
1103
1103
|
},
|
|
1104
1104
|
[buildPlaybackContext]
|
|
@@ -1117,7 +1117,7 @@ function useAnimationPlayback(input) {
|
|
|
1117
1117
|
if (!group) {
|
|
1118
1118
|
return false;
|
|
1119
1119
|
}
|
|
1120
|
-
|
|
1120
|
+
chunkSN5EUDIT_js.playGroup(controller, group, buildPlaybackContext());
|
|
1121
1121
|
return true;
|
|
1122
1122
|
},
|
|
1123
1123
|
[animationsEnabled, buildPlaybackContext]
|
|
@@ -1198,12 +1198,12 @@ function useAnimationPlayback(input) {
|
|
|
1198
1198
|
presentationTimersRef
|
|
1199
1199
|
};
|
|
1200
1200
|
}
|
|
1201
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1202
|
-
var AUDIENCE_HASH =
|
|
1203
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1204
|
-
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;
|
|
1205
1205
|
function generateSessionId() {
|
|
1206
|
-
return
|
|
1206
|
+
return chunkSN5EUDIT_js.createPresentationSessionId();
|
|
1207
1207
|
}
|
|
1208
1208
|
function parseAudienceNonce() {
|
|
1209
1209
|
const hash = window.location.hash;
|
|
@@ -1239,7 +1239,7 @@ function usePresenterWindow(input) {
|
|
|
1239
1239
|
}, []);
|
|
1240
1240
|
const swapDisplays = react.useCallback(async () => {
|
|
1241
1241
|
const audience = audienceWindowRef.current;
|
|
1242
|
-
return audience && !audience.closed ?
|
|
1242
|
+
return audience && !audience.closed ? chunkSN5EUDIT_js.swapPresentationWindows(window, audience) : false;
|
|
1243
1243
|
}, []);
|
|
1244
1244
|
const syncSlideToAudience = react.useCallback(
|
|
1245
1245
|
(slideIndex) => {
|
|
@@ -1303,7 +1303,7 @@ function usePresenterWindow(input) {
|
|
|
1303
1303
|
pollTimerRef.current = null;
|
|
1304
1304
|
}
|
|
1305
1305
|
if (closingSessionId) {
|
|
1306
|
-
void
|
|
1306
|
+
void chunkSN5EUDIT_js.clearAudienceContent(closingSessionId);
|
|
1307
1307
|
}
|
|
1308
1308
|
}, [getChannel]);
|
|
1309
1309
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1321,10 +1321,10 @@ function usePresenterWindow(input) {
|
|
|
1321
1321
|
audienceWindowRef.current = blankWin;
|
|
1322
1322
|
const sessionId = generateSessionId();
|
|
1323
1323
|
sessionIdRef.current = sessionId;
|
|
1324
|
-
const audienceUrl =
|
|
1325
|
-
void
|
|
1324
|
+
const audienceUrl = chunkSN5EUDIT_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1325
|
+
void chunkSN5EUDIT_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1326
1326
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1327
|
-
|
|
1327
|
+
chunkSN5EUDIT_js.placeAudienceWindow(blankWin, placement);
|
|
1328
1328
|
}
|
|
1329
1329
|
return void 0;
|
|
1330
1330
|
});
|
|
@@ -1354,7 +1354,7 @@ function usePresenterWindow(input) {
|
|
|
1354
1354
|
}
|
|
1355
1355
|
};
|
|
1356
1356
|
if (content) {
|
|
1357
|
-
void
|
|
1357
|
+
void chunkSN5EUDIT_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1358
1358
|
} else {
|
|
1359
1359
|
navigateOrClose(true);
|
|
1360
1360
|
}
|
|
@@ -1380,7 +1380,7 @@ function usePresenterWindow(input) {
|
|
|
1380
1380
|
}
|
|
1381
1381
|
const handleMessage = (event) => {
|
|
1382
1382
|
const message = event.data;
|
|
1383
|
-
if (
|
|
1383
|
+
if (chunkSN5EUDIT_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1384
1384
|
syncStateToAudience(snapshotRef.current);
|
|
1385
1385
|
}
|
|
1386
1386
|
};
|
|
@@ -1409,7 +1409,7 @@ function usePresenterWindow(input) {
|
|
|
1409
1409
|
react.useEffect(() => {
|
|
1410
1410
|
const handleBeforeUnload = () => {
|
|
1411
1411
|
if (sessionIdRef.current) {
|
|
1412
|
-
void
|
|
1412
|
+
void chunkSN5EUDIT_js.clearAudienceContent(sessionIdRef.current);
|
|
1413
1413
|
}
|
|
1414
1414
|
};
|
|
1415
1415
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1471,7 +1471,7 @@ function useAudienceMode(input) {
|
|
|
1471
1471
|
}
|
|
1472
1472
|
channel.onmessage = (event) => {
|
|
1473
1473
|
const data = event.data;
|
|
1474
|
-
if (!
|
|
1474
|
+
if (!chunkSN5EUDIT_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1475
1475
|
return;
|
|
1476
1476
|
}
|
|
1477
1477
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1487,16 +1487,16 @@ function useAudienceMode(input) {
|
|
|
1487
1487
|
}
|
|
1488
1488
|
if (data.type === "presenter-exit") {
|
|
1489
1489
|
if (expectedSessionId) {
|
|
1490
|
-
void
|
|
1490
|
+
void chunkSN5EUDIT_js.clearAudienceContent(expectedSessionId);
|
|
1491
1491
|
}
|
|
1492
|
-
if (
|
|
1492
|
+
if (chunkSN5EUDIT_js.endAudienceDisplay(window)) {
|
|
1493
1493
|
handlers.onPresenterEnded?.();
|
|
1494
1494
|
}
|
|
1495
1495
|
}
|
|
1496
1496
|
};
|
|
1497
1497
|
if (expectedSessionId) {
|
|
1498
1498
|
channel.postMessage({
|
|
1499
|
-
origin:
|
|
1499
|
+
origin: chunkSN5EUDIT_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1500
1500
|
type: "audience-ready",
|
|
1501
1501
|
sessionId: expectedSessionId
|
|
1502
1502
|
});
|
|
@@ -1510,7 +1510,7 @@ function useAudienceMode(input) {
|
|
|
1510
1510
|
}, []);
|
|
1511
1511
|
}
|
|
1512
1512
|
function usePresentationKeyboard(input) {
|
|
1513
|
-
const wheelBufferRef = react.useRef(
|
|
1513
|
+
const wheelBufferRef = react.useRef(chunkSN5EUDIT_js.createWheelStepBuffer());
|
|
1514
1514
|
const {
|
|
1515
1515
|
mode,
|
|
1516
1516
|
movePresentationSlide,
|
|
@@ -1531,14 +1531,14 @@ function usePresentationKeyboard(input) {
|
|
|
1531
1531
|
presentationSlideIndex,
|
|
1532
1532
|
setShowRehearsalSummary
|
|
1533
1533
|
} = input;
|
|
1534
|
-
const keyBufferRef = react.useRef(
|
|
1534
|
+
const keyBufferRef = react.useRef(chunkSN5EUDIT_js.createPresentationKeyBuffer());
|
|
1535
1535
|
react.useEffect(() => {
|
|
1536
|
-
if (mode !== "present" || !
|
|
1537
|
-
keyBufferRef.current =
|
|
1536
|
+
if (mode !== "present" || !chunkSN5EUDIT_js.acceptsPresentationInput()) {
|
|
1537
|
+
keyBufferRef.current = chunkSN5EUDIT_js.createPresentationKeyBuffer();
|
|
1538
1538
|
return;
|
|
1539
1539
|
}
|
|
1540
1540
|
const handleKeyDown = (event) => {
|
|
1541
|
-
const mapped =
|
|
1541
|
+
const mapped = chunkSN5EUDIT_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1542
1542
|
if (mapped.action === "none") {
|
|
1543
1543
|
return;
|
|
1544
1544
|
}
|
|
@@ -1558,12 +1558,12 @@ function usePresentationKeyboard(input) {
|
|
|
1558
1558
|
movePresentationSlide(-1);
|
|
1559
1559
|
return;
|
|
1560
1560
|
case "first": {
|
|
1561
|
-
const first =
|
|
1561
|
+
const first = chunkSN5EUDIT_js.firstShowSlideIndex(showSlideIndexes);
|
|
1562
1562
|
navigateToSlide(first ?? 0);
|
|
1563
1563
|
return;
|
|
1564
1564
|
}
|
|
1565
1565
|
case "last": {
|
|
1566
|
-
const last =
|
|
1566
|
+
const last = chunkSN5EUDIT_js.lastShowSlideIndex(showSlideIndexes);
|
|
1567
1567
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1568
1568
|
return;
|
|
1569
1569
|
}
|
|
@@ -1601,10 +1601,10 @@ function usePresentationKeyboard(input) {
|
|
|
1601
1601
|
}
|
|
1602
1602
|
};
|
|
1603
1603
|
const handleWheel = (event) => {
|
|
1604
|
-
if (mode !== "present" || !
|
|
1604
|
+
if (mode !== "present" || !chunkSN5EUDIT_js.acceptsPresentationInput()) {
|
|
1605
1605
|
return;
|
|
1606
1606
|
}
|
|
1607
|
-
const mapped =
|
|
1607
|
+
const mapped = chunkSN5EUDIT_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1608
1608
|
if (mapped.intent === "next-slide") {
|
|
1609
1609
|
event.preventDefault();
|
|
1610
1610
|
movePresentationSlide(1);
|
|
@@ -1737,7 +1737,7 @@ function useRehearsalTimings(input) {
|
|
|
1737
1737
|
|
|
1738
1738
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1739
1739
|
function handlePresentationActionImpl(action, deps) {
|
|
1740
|
-
|
|
1740
|
+
chunkSN5EUDIT_js.runPresentationAction(
|
|
1741
1741
|
action,
|
|
1742
1742
|
{ slideCount: deps.slidesLength, ...deps.elementId ? { elementId: deps.elementId } : {} },
|
|
1743
1743
|
{
|
|
@@ -1765,13 +1765,13 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1765
1765
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1766
1766
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1767
1767
|
const transition = deps.reverse ? deps.slides[deps.currentSlideIndex]?.transition : incomingSlide?.transition;
|
|
1768
|
-
const durationMs = deps.playTransition ?
|
|
1768
|
+
const durationMs = deps.playTransition ? chunkSN5EUDIT_js.resolveTransitionDurationMs(transition) : 0;
|
|
1769
1769
|
deps.clearPresentationTimers();
|
|
1770
1770
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1771
1771
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
1772
1772
|
deps.setPresentationSlideVisible(true);
|
|
1773
1773
|
deps.seedSlideAnimations(nextSlideIndex, { completed: deps.seedCompleted });
|
|
1774
|
-
const soundAction =
|
|
1774
|
+
const soundAction = chunkSN5EUDIT_js.resolveTransitionSoundAction(transition);
|
|
1775
1775
|
if (soundAction.kind === "play" && deps.onPlayActionSound) {
|
|
1776
1776
|
deps.onPlayActionSound(soundAction.soundPath, { loop: soundAction.loop });
|
|
1777
1777
|
} else if (soundAction.kind === "stop" && deps.onStopActionSound) {
|
|
@@ -1834,7 +1834,7 @@ function useSlideNavigation(input) {
|
|
|
1834
1834
|
});
|
|
1835
1835
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1836
1836
|
(slideIndex) => {
|
|
1837
|
-
const delayMs =
|
|
1837
|
+
const delayMs = chunkSN5EUDIT_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1838
1838
|
if (delayMs === void 0) {
|
|
1839
1839
|
return;
|
|
1840
1840
|
}
|
|
@@ -1857,7 +1857,7 @@ function useSlideNavigation(input) {
|
|
|
1857
1857
|
if (availableSlideIndexes.length === 0) {
|
|
1858
1858
|
return;
|
|
1859
1859
|
}
|
|
1860
|
-
const pastLastSlide = direction === 1 && !
|
|
1860
|
+
const pastLastSlide = direction === 1 && !chunkSN5EUDIT_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1861
1861
|
if (rehearsing && pastLastSlide) {
|
|
1862
1862
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1863
1863
|
try {
|
|
@@ -1875,9 +1875,9 @@ function useSlideNavigation(input) {
|
|
|
1875
1875
|
onAdvancePastLastSlide();
|
|
1876
1876
|
return;
|
|
1877
1877
|
}
|
|
1878
|
-
const nextSlideIndex = direction === 1 ?
|
|
1878
|
+
const nextSlideIndex = direction === 1 ? chunkSN5EUDIT_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1879
1879
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
1880
|
-
}) :
|
|
1880
|
+
}) : chunkSN5EUDIT_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
1881
1881
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
1882
1882
|
return;
|
|
1883
1883
|
}
|
|
@@ -2056,7 +2056,7 @@ function createCustomShowRunner(deps) {
|
|
|
2056
2056
|
return;
|
|
2057
2057
|
}
|
|
2058
2058
|
origin = returnAfter ? { showId: deps.getActiveCustomShowId(), slideIndex: deps.getPresentationSlideIndex() } : null;
|
|
2059
|
-
const first =
|
|
2059
|
+
const first = chunkSN5EUDIT_js.firstShowSlideIndex(chunkSN5EUDIT_js.resolveShowSlideIndexes(deps.getSlides(), target));
|
|
2060
2060
|
deps.setActiveCustomShowId(customShowId);
|
|
2061
2061
|
if (first !== void 0) {
|
|
2062
2062
|
deps.navigateToSlide(first);
|
|
@@ -2133,22 +2133,22 @@ function usePresentationActionExtensions(input) {
|
|
|
2133
2133
|
}
|
|
2134
2134
|
}, [navigateToSlideViaRef]);
|
|
2135
2135
|
const onOpenFile = react.useCallback((target) => {
|
|
2136
|
-
|
|
2136
|
+
chunkSN5EUDIT_js.safeOpenUrl(target);
|
|
2137
2137
|
}, []);
|
|
2138
2138
|
const onOpenPresentation = react.useCallback((target) => {
|
|
2139
|
-
|
|
2139
|
+
chunkSN5EUDIT_js.safeOpenUrl(target);
|
|
2140
2140
|
}, []);
|
|
2141
2141
|
const onPlayMedia = react.useCallback(
|
|
2142
2142
|
(elementId) => {
|
|
2143
|
-
|
|
2143
|
+
chunkSN5EUDIT_js.toggleStageElementMedia(containerRef.current, elementId);
|
|
2144
2144
|
},
|
|
2145
2145
|
[containerRef]
|
|
2146
2146
|
);
|
|
2147
2147
|
const onOleVerb = react.useCallback(
|
|
2148
2148
|
(verb, elementId) => {
|
|
2149
|
-
const target =
|
|
2149
|
+
const target = chunkSN5EUDIT_js.resolveOleVerbTarget(slides[presentationSlideIndex], elementId, verb);
|
|
2150
2150
|
if (target) {
|
|
2151
|
-
|
|
2151
|
+
chunkSN5EUDIT_js.openUrlInNewTab(target.url);
|
|
2152
2152
|
}
|
|
2153
2153
|
},
|
|
2154
2154
|
[slides, presentationSlideIndex]
|
|
@@ -2178,22 +2178,22 @@ function usePresentationActionExtensions(input) {
|
|
|
2178
2178
|
};
|
|
2179
2179
|
}
|
|
2180
2180
|
function usePresenterConsole(slideIndex, active) {
|
|
2181
|
-
const timerRef = react.useRef(
|
|
2182
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2181
|
+
const timerRef = react.useRef(chunkSN5EUDIT_js.createPresenterTimer());
|
|
2182
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkSN5EUDIT_js.createInitialPresentationSnapshot(slideIndex));
|
|
2183
2183
|
const patch = react.useCallback((value) => {
|
|
2184
|
-
setSnapshot((current) =>
|
|
2184
|
+
setSnapshot((current) => chunkSN5EUDIT_js.mergePresentationSnapshot(current, value));
|
|
2185
2185
|
}, []);
|
|
2186
2186
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2187
2187
|
react.useEffect(() => {
|
|
2188
2188
|
if (!active) {
|
|
2189
2189
|
return;
|
|
2190
2190
|
}
|
|
2191
|
-
timerRef.current =
|
|
2191
|
+
timerRef.current = chunkSN5EUDIT_js.resetPresenterTimer();
|
|
2192
2192
|
patch({ paused: false, elapsedMs: 0 });
|
|
2193
2193
|
const timer = window.setInterval(() => {
|
|
2194
2194
|
patch({
|
|
2195
2195
|
paused: timerRef.current.paused,
|
|
2196
|
-
elapsedMs:
|
|
2196
|
+
elapsedMs: chunkSN5EUDIT_js.presenterElapsed(timerRef.current)
|
|
2197
2197
|
});
|
|
2198
2198
|
}, 1e3);
|
|
2199
2199
|
return () => window.clearInterval(timer);
|
|
@@ -2203,19 +2203,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2203
2203
|
applyAudienceSnapshot: setSnapshot,
|
|
2204
2204
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2205
2205
|
toggleTimer: () => {
|
|
2206
|
-
timerRef.current =
|
|
2206
|
+
timerRef.current = chunkSN5EUDIT_js.togglePresenterTimer(timerRef.current);
|
|
2207
2207
|
patch({
|
|
2208
2208
|
paused: timerRef.current.paused,
|
|
2209
|
-
elapsedMs:
|
|
2209
|
+
elapsedMs: chunkSN5EUDIT_js.presenterElapsed(timerRef.current)
|
|
2210
2210
|
});
|
|
2211
2211
|
},
|
|
2212
2212
|
resetTimer: () => {
|
|
2213
|
-
timerRef.current =
|
|
2213
|
+
timerRef.current = chunkSN5EUDIT_js.resetPresenterTimer();
|
|
2214
2214
|
patch({ paused: false, elapsedMs: 0 });
|
|
2215
2215
|
},
|
|
2216
2216
|
stepZoom: (direction) => setSnapshot(
|
|
2217
|
-
(current) =>
|
|
2218
|
-
zoom:
|
|
2217
|
+
(current) => chunkSN5EUDIT_js.mergePresentationSnapshot(current, {
|
|
2218
|
+
zoom: chunkSN5EUDIT_js.stepPresenterZoom(
|
|
2219
2219
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2220
2220
|
direction
|
|
2221
2221
|
)
|
|
@@ -2266,7 +2266,7 @@ function usePresentationMode(input) {
|
|
|
2266
2266
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2267
2267
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2268
2268
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2269
|
-
const showGuard = react.useMemo(() =>
|
|
2269
|
+
const showGuard = react.useMemo(() => chunkSN5EUDIT_js.createPresenterShowGuard(), []);
|
|
2270
2270
|
const {
|
|
2271
2271
|
presentationAnimations,
|
|
2272
2272
|
presentationElementStates,
|
|
@@ -2357,7 +2357,7 @@ function usePresentationMode(input) {
|
|
|
2357
2357
|
actionExtensions.bindNavigateToSlide(navigateToSlide);
|
|
2358
2358
|
const movePresentationSlide = react.useCallback(
|
|
2359
2359
|
(direction, trigger = "explicit") => {
|
|
2360
|
-
if (!
|
|
2360
|
+
if (!chunkSN5EUDIT_js.acceptsPresentationInput()) {
|
|
2361
2361
|
return;
|
|
2362
2362
|
}
|
|
2363
2363
|
if (endOfShowVisible) {
|
|
@@ -2426,7 +2426,7 @@ function usePresentationMode(input) {
|
|
|
2426
2426
|
onSetMode("present");
|
|
2427
2427
|
}, [containerRef, onSetMode, setRehearsing]);
|
|
2428
2428
|
const enterPresentModeFromBeginning = react.useCallback(() => {
|
|
2429
|
-
const first =
|
|
2429
|
+
const first = chunkSN5EUDIT_js.firstShowSlideIndex(visibleSlideIndexes);
|
|
2430
2430
|
if (first !== void 0) {
|
|
2431
2431
|
onSetActiveSlideIndex(first);
|
|
2432
2432
|
}
|
|
@@ -2506,7 +2506,7 @@ function usePresentationMode(input) {
|
|
|
2506
2506
|
if (mode !== "present") {
|
|
2507
2507
|
return;
|
|
2508
2508
|
}
|
|
2509
|
-
return
|
|
2509
|
+
return chunkSN5EUDIT_js.attachPresentationVisibilityPause({
|
|
2510
2510
|
root: containerRef.current ?? void 0,
|
|
2511
2511
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2512
2512
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2514,7 +2514,7 @@ function usePresentationMode(input) {
|
|
|
2514
2514
|
}, [mode, containerRef]);
|
|
2515
2515
|
react.useLayoutEffect(() => {
|
|
2516
2516
|
if (mode === "present") {
|
|
2517
|
-
const idx =
|
|
2517
|
+
const idx = chunkSN5EUDIT_js.presentationEntrySlideIndex(
|
|
2518
2518
|
activeSlideIndexRef.current,
|
|
2519
2519
|
visibleSlideIndexesRef.current
|
|
2520
2520
|
);
|
|
@@ -2593,11 +2593,11 @@ function usePresentationMode(input) {
|
|
|
2593
2593
|
return void 0;
|
|
2594
2594
|
}
|
|
2595
2595
|
const incoming = slides[transitionOverlay.incomingSlideIndex];
|
|
2596
|
-
return
|
|
2596
|
+
return chunkSN5EUDIT_js.buildMorphTransitionPlan(
|
|
2597
2597
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2598
2598
|
incoming,
|
|
2599
2599
|
transitionOverlay.durationMs,
|
|
2600
|
-
|
|
2600
|
+
chunkSN5EUDIT_js.morphOptionToMode(transitionOverlay.transition.morphOption),
|
|
2601
2601
|
// `PresentationStage` stacks the incoming slide's elements above its
|
|
2602
2602
|
// template shapes (`zIndex = templateElements.length + index`), so a
|
|
2603
2603
|
// z-index journey has to start counting where the stage does.
|
|
@@ -2622,7 +2622,7 @@ function usePresentationMode(input) {
|
|
|
2622
2622
|
if (!morphPlan) {
|
|
2623
2623
|
return presentationKeyframesCss;
|
|
2624
2624
|
}
|
|
2625
|
-
const imageRules =
|
|
2625
|
+
const imageRules = chunkSN5EUDIT_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2626
2626
|
return `${presentationKeyframesCss ?? ""}
|
|
2627
2627
|
${morphPlan.keyframesCss}
|
|
2628
2628
|
${imageRules}`;
|
|
@@ -2919,7 +2919,7 @@ function useFindReplace({
|
|
|
2919
2919
|
const [findResults, setFindResults] = react.useState([]);
|
|
2920
2920
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
2921
2921
|
const performFind = react.useCallback(() => {
|
|
2922
|
-
const results =
|
|
2922
|
+
const results = chunkSN5EUDIT_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
2923
2923
|
if (!findQuery) {
|
|
2924
2924
|
setFindResults([]);
|
|
2925
2925
|
setFindResultIndex(-1);
|
|
@@ -2953,7 +2953,7 @@ function useFindReplace({
|
|
|
2953
2953
|
return;
|
|
2954
2954
|
}
|
|
2955
2955
|
onUpdateSlides(
|
|
2956
|
-
(prevSlides) =>
|
|
2956
|
+
(prevSlides) => chunkSN5EUDIT_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
2957
2957
|
);
|
|
2958
2958
|
onMarkDirty();
|
|
2959
2959
|
},
|
|
@@ -2975,9 +2975,9 @@ function useFindReplace({
|
|
|
2975
2975
|
}, [findResults, applyReplacements, performFind]);
|
|
2976
2976
|
react.useEffect(() => {
|
|
2977
2977
|
const handler = (event) => {
|
|
2978
|
-
const { action } =
|
|
2978
|
+
const { action } = chunkSN5EUDIT_js.mapEditorKey(event, {
|
|
2979
2979
|
canEdit: mode === "edit",
|
|
2980
|
-
isTextInputTarget:
|
|
2980
|
+
isTextInputTarget: chunkSN5EUDIT_js.isEditorTextInputTarget(event.target)
|
|
2981
2981
|
});
|
|
2982
2982
|
if (action !== "find") {
|
|
2983
2983
|
return;
|
|
@@ -3088,7 +3088,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId, ment
|
|
|
3088
3088
|
if (!slide) {
|
|
3089
3089
|
return { slides, didAdd: false };
|
|
3090
3090
|
}
|
|
3091
|
-
const next =
|
|
3091
|
+
const next = chunkSN5EUDIT_js.addCommentToList(
|
|
3092
3092
|
slide.comments || [],
|
|
3093
3093
|
text,
|
|
3094
3094
|
authorName,
|
|
@@ -3109,7 +3109,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
|
3109
3109
|
if (!slide) {
|
|
3110
3110
|
return { slides, didDelete: false };
|
|
3111
3111
|
}
|
|
3112
|
-
const next =
|
|
3112
|
+
const next = chunkSN5EUDIT_js.removeCommentFromList(slide.comments || [], commentId);
|
|
3113
3113
|
if (!next) {
|
|
3114
3114
|
return { slides, didDelete: false };
|
|
3115
3115
|
}
|
|
@@ -3120,7 +3120,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
|
3120
3120
|
if (!slide) {
|
|
3121
3121
|
return { slides, didUpdate: false };
|
|
3122
3122
|
}
|
|
3123
|
-
const next =
|
|
3123
|
+
const next = chunkSN5EUDIT_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
3124
3124
|
if (!next) {
|
|
3125
3125
|
return { slides, didUpdate: false };
|
|
3126
3126
|
}
|
|
@@ -3131,7 +3131,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
|
3131
3131
|
if (!slide) {
|
|
3132
3132
|
return { slides, didUpdate: false };
|
|
3133
3133
|
}
|
|
3134
|
-
const next =
|
|
3134
|
+
const next = chunkSN5EUDIT_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
3135
3135
|
if (!next) {
|
|
3136
3136
|
return { slides, didUpdate: false };
|
|
3137
3137
|
}
|
|
@@ -3142,7 +3142,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName, mention
|
|
|
3142
3142
|
if (!slide) {
|
|
3143
3143
|
return { slides, didAdd: false };
|
|
3144
3144
|
}
|
|
3145
|
-
const next =
|
|
3145
|
+
const next = chunkSN5EUDIT_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
3146
3146
|
if (!next) {
|
|
3147
3147
|
return { slides, didAdd: false };
|
|
3148
3148
|
}
|
|
@@ -3529,7 +3529,7 @@ function useDerivedElementState(input) {
|
|
|
3529
3529
|
return [];
|
|
3530
3530
|
}
|
|
3531
3531
|
return [
|
|
3532
|
-
...
|
|
3532
|
+
...chunkSN5EUDIT_js.visibleTemplateElements(activeSlide, templateElementsBySlideId[activeSlide.id] ?? [])
|
|
3533
3533
|
];
|
|
3534
3534
|
}, [activeSlide, templateElementsBySlideId]);
|
|
3535
3535
|
const activeMaster = slideMasters[activeMasterIndex];
|
|
@@ -3596,7 +3596,7 @@ function useViewerCoreState(_input) {
|
|
|
3596
3596
|
const marqueeStateRef = react.useRef(null);
|
|
3597
3597
|
const isDrawingRef = react.useRef(false);
|
|
3598
3598
|
const justInteractedRef = react.useRef(false);
|
|
3599
|
-
const livePatcher = react.useMemo(() =>
|
|
3599
|
+
const livePatcher = react.useMemo(() => chunkSN5EUDIT_js.createCollaborationLivePatcher(), []);
|
|
3600
3600
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3601
3601
|
const slidesRef = react.useRef([]);
|
|
3602
3602
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3605,8 +3605,8 @@ function useViewerCoreState(_input) {
|
|
|
3605
3605
|
const [slides, setSlides] = react.useState([]);
|
|
3606
3606
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3607
3607
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3608
|
-
width:
|
|
3609
|
-
height:
|
|
3608
|
+
width: chunkQWA5YEIZ_js.DEFAULT_CANVAS_WIDTH,
|
|
3609
|
+
height: chunkQWA5YEIZ_js.DEFAULT_CANVAS_HEIGHT
|
|
3610
3610
|
});
|
|
3611
3611
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3612
3612
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3627,7 +3627,7 @@ function useViewerCoreState(_input) {
|
|
|
3627
3627
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3628
3628
|
inlineEditingTextRef.current = resolved;
|
|
3629
3629
|
setInlineEditingTextBase(value);
|
|
3630
|
-
|
|
3630
|
+
chunkSN5EUDIT_js.publishLiveInlineText(
|
|
3631
3631
|
livePatcher,
|
|
3632
3632
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3633
3633
|
inlineEditingElementIdRef.current,
|
|
@@ -3647,6 +3647,8 @@ function useViewerCoreState(_input) {
|
|
|
3647
3647
|
const [recentColors, setRecentColors] = react.useState([]);
|
|
3648
3648
|
const [theme, setTheme] = react.useState();
|
|
3649
3649
|
const [tableStyleMap, setTableStyleMap] = react.useState();
|
|
3650
|
+
const [tableStylesDefaultId, setTableStylesDefaultId] = react.useState();
|
|
3651
|
+
const [tableStylesToDelete, setTableStylesToDelete] = react.useState([]);
|
|
3650
3652
|
const [themeOptions, setThemeOptions] = react.useState([]);
|
|
3651
3653
|
const [customShows, setCustomShows] = react.useState([]);
|
|
3652
3654
|
const [activeCustomShowId, setActiveCustomShowId] = react.useState(null);
|
|
@@ -3746,6 +3748,10 @@ function useViewerCoreState(_input) {
|
|
|
3746
3748
|
setTheme,
|
|
3747
3749
|
tableStyleMap,
|
|
3748
3750
|
setTableStyleMap,
|
|
3751
|
+
tableStylesDefaultId,
|
|
3752
|
+
setTableStylesDefaultId,
|
|
3753
|
+
tableStylesToDelete,
|
|
3754
|
+
setTableStylesToDelete,
|
|
3749
3755
|
themeOptions,
|
|
3750
3756
|
setThemeOptions,
|
|
3751
3757
|
customShows,
|
|
@@ -3930,6 +3936,8 @@ function useLoadContent({
|
|
|
3930
3936
|
setRecentColors,
|
|
3931
3937
|
setTheme,
|
|
3932
3938
|
setTableStyleMap,
|
|
3939
|
+
setTableStylesDefaultId,
|
|
3940
|
+
setTableStylesToDelete,
|
|
3933
3941
|
setThemeOptions,
|
|
3934
3942
|
setCustomShows,
|
|
3935
3943
|
setActiveCustomShowId,
|
|
@@ -3981,7 +3989,7 @@ function useLoadContent({
|
|
|
3981
3989
|
);
|
|
3982
3990
|
}
|
|
3983
3991
|
const previousHandler = handlerRef.current;
|
|
3984
|
-
const handler = new
|
|
3992
|
+
const handler = new chunkSN5EUDIT_js.PptxHandler();
|
|
3985
3993
|
const parsed = await handler.load(buffer, { allowExternalImages });
|
|
3986
3994
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3987
3995
|
handler.dispose();
|
|
@@ -3993,7 +4001,7 @@ function useLoadContent({
|
|
|
3993
4001
|
handlerRef.current = null;
|
|
3994
4002
|
const mediaElements = [];
|
|
3995
4003
|
for (const slide of parsed.slides) {
|
|
3996
|
-
|
|
4004
|
+
chunkSN5EUDIT_js.collectMediaElements(slide.elements, mediaElements);
|
|
3997
4005
|
}
|
|
3998
4006
|
for (const url of mediaDataUrls.values()) {
|
|
3999
4007
|
if (url.startsWith("blob:")) {
|
|
@@ -4003,7 +4011,7 @@ function useLoadContent({
|
|
|
4003
4011
|
mediaDataUrls.clear();
|
|
4004
4012
|
await Promise.all(
|
|
4005
4013
|
mediaElements.map(async (mediaElement) => {
|
|
4006
|
-
const resolved = await
|
|
4014
|
+
const resolved = await chunkSN5EUDIT_js.resolveMediaElementSource(mediaElement, handler);
|
|
4007
4015
|
if (resolved.missing || !resolved.mediaPath || !resolved.url) {
|
|
4008
4016
|
mediaElement.mediaMissing = true;
|
|
4009
4017
|
return;
|
|
@@ -4014,7 +4022,7 @@ function useLoadContent({
|
|
|
4014
4022
|
}
|
|
4015
4023
|
})
|
|
4016
4024
|
);
|
|
4017
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
4025
|
+
const { paths: imagePaths, refs: imageRefs } = chunkSN5EUDIT_js.collectImagePaths(parsed.slides);
|
|
4018
4026
|
let nextSlides = parsed.slides;
|
|
4019
4027
|
if (imagePaths.size > 0) {
|
|
4020
4028
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -4030,25 +4038,25 @@ function useLoadContent({
|
|
|
4030
4038
|
})
|
|
4031
4039
|
);
|
|
4032
4040
|
nextSlides = parsed.slides.map((s) => {
|
|
4033
|
-
const newElements =
|
|
4041
|
+
const newElements = chunkSN5EUDIT_js.applyImagePathPatches(s.elements, resolvedMap, imageRefs);
|
|
4034
4042
|
return newElements === s.elements ? s : { ...s, elements: newElements };
|
|
4035
4043
|
});
|
|
4036
4044
|
}
|
|
4037
|
-
nextSlides = await
|
|
4045
|
+
nextSlides = await chunkSN5EUDIT_js.resolveTableCellImageUrls(
|
|
4038
4046
|
nextSlides,
|
|
4039
4047
|
(path) => handler.getImageData(path)
|
|
4040
4048
|
);
|
|
4041
|
-
const nextTableStyleMap = await
|
|
4049
|
+
const nextTableStyleMap = await chunkSN5EUDIT_js.resolveTableStyleImageUrls(
|
|
4042
4050
|
parsed.tableStyleMap,
|
|
4043
4051
|
(path) => handler.getImageData(path)
|
|
4044
4052
|
);
|
|
4045
4053
|
handlerRef.current = handler;
|
|
4046
|
-
const partition =
|
|
4054
|
+
const partition = chunkSN5EUDIT_js.partitionTemplateElements(nextSlides);
|
|
4047
4055
|
setSlides(partition.slides);
|
|
4048
4056
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4049
4057
|
setCanvasSize({
|
|
4050
|
-
width: parsed.width ??
|
|
4051
|
-
height: parsed.height ??
|
|
4058
|
+
width: parsed.width ?? chunkQWA5YEIZ_js.DEFAULT_CANVAS_WIDTH,
|
|
4059
|
+
height: parsed.height ?? chunkQWA5YEIZ_js.DEFAULT_CANVAS_HEIGHT
|
|
4052
4060
|
});
|
|
4053
4061
|
setSlideSizeEmu(
|
|
4054
4062
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4061,13 +4069,15 @@ function useLoadContent({
|
|
|
4061
4069
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
4062
4070
|
setSlideMasters(parsed.slideMasters ?? []);
|
|
4063
4071
|
setModernCommentAuthors(parsed.modernCommentAuthors ?? []);
|
|
4064
|
-
setRecentColors(
|
|
4072
|
+
setRecentColors(chunkSN5EUDIT_js.seedRecentColors({ mruColors: parsed.mruColors }));
|
|
4065
4073
|
setTheme(parsed.theme);
|
|
4066
4074
|
setTableStyleMap(nextTableStyleMap);
|
|
4075
|
+
setTableStylesDefaultId(parsed.tableStylesDefaultId);
|
|
4076
|
+
setTableStylesToDelete([]);
|
|
4067
4077
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
4068
4078
|
setCustomShows(parsed.customShows ?? []);
|
|
4069
4079
|
setActiveCustomShowId(
|
|
4070
|
-
|
|
4080
|
+
chunkSN5EUDIT_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
4071
4081
|
);
|
|
4072
4082
|
setSections(parsed.sections ?? []);
|
|
4073
4083
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -4090,10 +4100,10 @@ function useLoadContent({
|
|
|
4090
4100
|
setHasMacros(parsed.hasMacros === true);
|
|
4091
4101
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4092
4102
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4093
|
-
setGuides(
|
|
4094
|
-
setReadOnlyRecommendation(
|
|
4103
|
+
setGuides(chunkSN5EUDIT_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4104
|
+
setReadOnlyRecommendation(chunkSN5EUDIT_js.readOnlyRecommendation(parsed));
|
|
4095
4105
|
setCompatToasts(
|
|
4096
|
-
|
|
4106
|
+
chunkSN5EUDIT_js.compatibilityWarningToasts([
|
|
4097
4107
|
...parsed.warnings ?? [],
|
|
4098
4108
|
...parsed.slides.flatMap((slide) => slide.warnings ?? [])
|
|
4099
4109
|
])
|
|
@@ -4105,7 +4115,7 @@ function useLoadContent({
|
|
|
4105
4115
|
onContentApplied?.();
|
|
4106
4116
|
} catch (err) {
|
|
4107
4117
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4108
|
-
if (err instanceof
|
|
4118
|
+
if (err instanceof chunkSN5EUDIT_js.EncryptedFileError) {
|
|
4109
4119
|
setIsEncrypted(true);
|
|
4110
4120
|
} else {
|
|
4111
4121
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4133,7 +4143,7 @@ function useLoadContent({
|
|
|
4133
4143
|
}
|
|
4134
4144
|
function useAutosave(input) {
|
|
4135
4145
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4136
|
-
const intervalMs =
|
|
4146
|
+
const intervalMs = chunkSN5EUDIT_js.resolveAutosaveIntervalMs({
|
|
4137
4147
|
hostIntervalMs: input.intervalMs,
|
|
4138
4148
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4139
4149
|
});
|
|
@@ -4164,7 +4174,7 @@ function useAutosave(input) {
|
|
|
4164
4174
|
return;
|
|
4165
4175
|
}
|
|
4166
4176
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4167
|
-
if (!
|
|
4177
|
+
if (!chunkSN5EUDIT_js.shouldWriteAutosaveSnapshot({
|
|
4168
4178
|
filePath: path,
|
|
4169
4179
|
isDirty: isDirtyRef.current,
|
|
4170
4180
|
saving: isSavingRef.current,
|
|
@@ -4182,8 +4192,8 @@ function useAutosave(input) {
|
|
|
4182
4192
|
isSavingRef.current = false;
|
|
4183
4193
|
return;
|
|
4184
4194
|
}
|
|
4185
|
-
await
|
|
4186
|
-
lastSnapshotRef.current =
|
|
4195
|
+
await chunkSN5EUDIT_js.saveAutosaveSnapshot(path, data);
|
|
4196
|
+
lastSnapshotRef.current = chunkSN5EUDIT_js.autosaveSnapshotMark(path, sources);
|
|
4187
4197
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4188
4198
|
} catch (err) {
|
|
4189
4199
|
setAutosaveStatus({
|
|
@@ -4237,13 +4247,13 @@ function useElementOperations(input) {
|
|
|
4237
4247
|
inlineEditingText
|
|
4238
4248
|
} = input;
|
|
4239
4249
|
const liveTextSegments = react.useCallback(() => {
|
|
4240
|
-
if (!selectedElement || !
|
|
4250
|
+
if (!selectedElement || !chunkSN5EUDIT_js.hasTextProperties(selectedElement)) {
|
|
4241
4251
|
return void 0;
|
|
4242
4252
|
}
|
|
4243
4253
|
if (selectedElement.id !== inlineEditingElementId) {
|
|
4244
4254
|
return selectedElement.textSegments;
|
|
4245
4255
|
}
|
|
4246
|
-
return
|
|
4256
|
+
return chunkSN5EUDIT_js.remapTextToSegments(
|
|
4247
4257
|
inlineEditingText,
|
|
4248
4258
|
selectedElement.textSegments,
|
|
4249
4259
|
selectedElement.textStyle
|
|
@@ -4284,11 +4294,11 @@ function useElementOperations(input) {
|
|
|
4284
4294
|
(elementId, updates) => {
|
|
4285
4295
|
if (masterView?.target) {
|
|
4286
4296
|
applyMasterViewWrite(
|
|
4287
|
-
|
|
4297
|
+
chunkSN5EUDIT_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4288
4298
|
);
|
|
4289
4299
|
return;
|
|
4290
4300
|
}
|
|
4291
|
-
if (
|
|
4301
|
+
if (chunkSN5EUDIT_js.isTemplateElementId(elementId)) {
|
|
4292
4302
|
const slideId = activeSlide?.id;
|
|
4293
4303
|
if (slideId) {
|
|
4294
4304
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4299,7 +4309,7 @@ function useElementOperations(input) {
|
|
|
4299
4309
|
}));
|
|
4300
4310
|
}
|
|
4301
4311
|
} else {
|
|
4302
|
-
setSlides((prev) =>
|
|
4312
|
+
setSlides((prev) => chunkSN5EUDIT_js.updateElement(prev, activeSlideIndex, elementId, updates));
|
|
4303
4313
|
}
|
|
4304
4314
|
history.markDirty();
|
|
4305
4315
|
},
|
|
@@ -4324,7 +4334,7 @@ function useElementOperations(input) {
|
|
|
4324
4334
|
);
|
|
4325
4335
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4326
4336
|
(updates) => {
|
|
4327
|
-
if (!selectedElement || !
|
|
4337
|
+
if (!selectedElement || !chunkSN5EUDIT_js.hasShapeProperties(selectedElement)) {
|
|
4328
4338
|
return;
|
|
4329
4339
|
}
|
|
4330
4340
|
updateSelectedElement({
|
|
@@ -4335,19 +4345,19 @@ function useElementOperations(input) {
|
|
|
4335
4345
|
);
|
|
4336
4346
|
const updateSelectedTextStyle = react.useCallback(
|
|
4337
4347
|
(updates) => {
|
|
4338
|
-
if (!selectedElement || !
|
|
4348
|
+
if (!selectedElement || !chunkSN5EUDIT_js.hasTextProperties(selectedElement)) {
|
|
4339
4349
|
return;
|
|
4340
4350
|
}
|
|
4341
4351
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4342
4352
|
const currentSegments = liveTextSegments();
|
|
4343
|
-
const inlineSel =
|
|
4353
|
+
const inlineSel = chunkSN5EUDIT_js.getInlineEditorSelection(currentSegments);
|
|
4344
4354
|
if (inlineSel && currentSegments) {
|
|
4345
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4355
|
+
const { newSegments: newSegments2, newSelection } = chunkSN5EUDIT_js.applyStyleToSelectedSegments(
|
|
4346
4356
|
currentSegments,
|
|
4347
4357
|
inlineSel,
|
|
4348
4358
|
updates
|
|
4349
4359
|
);
|
|
4350
|
-
|
|
4360
|
+
chunkSN5EUDIT_js.setPendingSelectionRestore(newSelection);
|
|
4351
4361
|
updateSelectedElement({
|
|
4352
4362
|
textSegments: newSegments2,
|
|
4353
4363
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4375,14 +4385,14 @@ function useElementOperations(input) {
|
|
|
4375
4385
|
);
|
|
4376
4386
|
const updateSelectedTextCase = react.useCallback(
|
|
4377
4387
|
(mode) => {
|
|
4378
|
-
if (!selectedElement || !
|
|
4388
|
+
if (!selectedElement || !chunkSN5EUDIT_js.hasTextProperties(selectedElement)) {
|
|
4379
4389
|
return;
|
|
4380
4390
|
}
|
|
4381
4391
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4382
4392
|
const currentSegments = liveTextSegments();
|
|
4383
|
-
const inlineSel =
|
|
4393
|
+
const inlineSel = chunkSN5EUDIT_js.getInlineEditorSelection(currentSegments);
|
|
4384
4394
|
if (inlineSel && currentSegments) {
|
|
4385
|
-
const newSegments =
|
|
4395
|
+
const newSegments = chunkSN5EUDIT_js.applyCaseTransformToSegments(currentSegments, inlineSel, mode);
|
|
4386
4396
|
updateSelectedElement({
|
|
4387
4397
|
textSegments: newSegments,
|
|
4388
4398
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4391,7 +4401,7 @@ function useElementOperations(input) {
|
|
|
4391
4401
|
}
|
|
4392
4402
|
const updates = {};
|
|
4393
4403
|
if (currentSegments && currentSegments.length > 0) {
|
|
4394
|
-
updates.textSegments =
|
|
4404
|
+
updates.textSegments = chunkSN5EUDIT_js.applyCaseTransformToSegments(
|
|
4395
4405
|
currentSegments,
|
|
4396
4406
|
null,
|
|
4397
4407
|
mode
|
|
@@ -4399,7 +4409,7 @@ function useElementOperations(input) {
|
|
|
4399
4409
|
}
|
|
4400
4410
|
const baseText = isLiveEditing ? inlineEditingText : selectedElement.text;
|
|
4401
4411
|
if (typeof baseText === "string") {
|
|
4402
|
-
updates.text =
|
|
4412
|
+
updates.text = chunkSN5EUDIT_js.transformTextCase(baseText, mode);
|
|
4403
4413
|
}
|
|
4404
4414
|
updateSelectedElement(updates);
|
|
4405
4415
|
},
|
|
@@ -4418,15 +4428,15 @@ function useElementOperations(input) {
|
|
|
4418
4428
|
[setSlides]
|
|
4419
4429
|
);
|
|
4420
4430
|
const masterViewTarget = masterView?.target ?? null;
|
|
4421
|
-
const activeElements = masterViewTarget ?
|
|
4431
|
+
const activeElements = masterViewTarget ? chunkSN5EUDIT_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4422
4432
|
const updateActiveElements = react.useCallback(
|
|
4423
4433
|
(updater) => {
|
|
4424
4434
|
if (masterView?.target) {
|
|
4425
4435
|
applyMasterViewWrite(
|
|
4426
|
-
|
|
4436
|
+
chunkSN5EUDIT_js.replaceMasterViewElements(
|
|
4427
4437
|
masterView,
|
|
4428
4438
|
masterView.target,
|
|
4429
|
-
updater(
|
|
4439
|
+
updater(chunkSN5EUDIT_js.masterViewElements(masterView, masterView.target))
|
|
4430
4440
|
)
|
|
4431
4441
|
);
|
|
4432
4442
|
return;
|
|
@@ -4479,7 +4489,7 @@ function useSectionOperations(input) {
|
|
|
4479
4489
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4480
4490
|
const addSection2 = react.useCallback(
|
|
4481
4491
|
(name, afterSlideIndex) => {
|
|
4482
|
-
const result =
|
|
4492
|
+
const result = chunkSN5EUDIT_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4483
4493
|
setSlides(result.slides);
|
|
4484
4494
|
setSections(result.sections);
|
|
4485
4495
|
markDirty();
|
|
@@ -4488,7 +4498,7 @@ function useSectionOperations(input) {
|
|
|
4488
4498
|
);
|
|
4489
4499
|
const renameSection2 = react.useCallback(
|
|
4490
4500
|
(sectionId, newName) => {
|
|
4491
|
-
const result =
|
|
4501
|
+
const result = chunkSN5EUDIT_js.renameSection(sections, slides, sectionId, newName);
|
|
4492
4502
|
setSections(result.sections);
|
|
4493
4503
|
setSlides(result.slides);
|
|
4494
4504
|
markDirty();
|
|
@@ -4497,7 +4507,7 @@ function useSectionOperations(input) {
|
|
|
4497
4507
|
);
|
|
4498
4508
|
const deleteSection2 = react.useCallback(
|
|
4499
4509
|
(sectionId) => {
|
|
4500
|
-
const result =
|
|
4510
|
+
const result = chunkSN5EUDIT_js.deleteSection(sections, slides, sectionId);
|
|
4501
4511
|
setSections(result.sections);
|
|
4502
4512
|
setSlides(result.slides);
|
|
4503
4513
|
markDirty();
|
|
@@ -4506,21 +4516,21 @@ function useSectionOperations(input) {
|
|
|
4506
4516
|
);
|
|
4507
4517
|
const moveSectionUp2 = react.useCallback(
|
|
4508
4518
|
(sectionId) => {
|
|
4509
|
-
setSections(
|
|
4519
|
+
setSections(chunkSN5EUDIT_js.moveSectionUp(sections, sectionId));
|
|
4510
4520
|
markDirty();
|
|
4511
4521
|
},
|
|
4512
4522
|
[sections, setSections, markDirty]
|
|
4513
4523
|
);
|
|
4514
4524
|
const moveSectionDown2 = react.useCallback(
|
|
4515
4525
|
(sectionId) => {
|
|
4516
|
-
setSections(
|
|
4526
|
+
setSections(chunkSN5EUDIT_js.moveSectionDown(sections, sectionId));
|
|
4517
4527
|
markDirty();
|
|
4518
4528
|
},
|
|
4519
4529
|
[sections, setSections, markDirty]
|
|
4520
4530
|
);
|
|
4521
4531
|
const moveSlidesToSection2 = react.useCallback(
|
|
4522
4532
|
(slideIndexes, targetSectionId) => {
|
|
4523
|
-
const result =
|
|
4533
|
+
const result = chunkSN5EUDIT_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4524
4534
|
setSlides(result.slides);
|
|
4525
4535
|
setSections(result.sections);
|
|
4526
4536
|
markDirty();
|
|
@@ -4586,15 +4596,15 @@ function syncSelectionHandleOverlay(elementNode, elementId, geometry) {
|
|
|
4586
4596
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4587
4597
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
|
|
4588
4598
|
const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
|
|
4589
|
-
let resized =
|
|
4599
|
+
let resized = chunkSN5EUDIT_js.applyResize(startBox, handle, dx, dy, 1, { minSize: chunkQWA5YEIZ_js.MIN_ELEMENT_SIZE });
|
|
4590
4600
|
if (lockAspect) {
|
|
4591
|
-
resized =
|
|
4601
|
+
resized = chunkSN5EUDIT_js.lockResizeAspect(resized, startBox, handle, chunkQWA5YEIZ_js.MIN_ELEMENT_SIZE);
|
|
4592
4602
|
}
|
|
4593
4603
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4594
4604
|
if (!snapToGrid) {
|
|
4595
4605
|
return box;
|
|
4596
4606
|
}
|
|
4597
|
-
return
|
|
4607
|
+
return chunkSN5EUDIT_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkQWA5YEIZ_js.MIN_ELEMENT_SIZE);
|
|
4598
4608
|
}
|
|
4599
4609
|
function resolveLiveTarget(input) {
|
|
4600
4610
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4707,7 +4717,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4707
4717
|
width: el.width,
|
|
4708
4718
|
height: el.height
|
|
4709
4719
|
}));
|
|
4710
|
-
const snapResult =
|
|
4720
|
+
const snapResult = chunkSN5EUDIT_js.computeSnapToShape(
|
|
4711
4721
|
targetX,
|
|
4712
4722
|
targetY,
|
|
4713
4723
|
primaryEl.width,
|
|
@@ -4749,7 +4759,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4749
4759
|
if (live) {
|
|
4750
4760
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4751
4761
|
const start = drag.startPositionsById[id];
|
|
4752
|
-
|
|
4762
|
+
chunkSN5EUDIT_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4753
4763
|
x: start.x + appliedDx,
|
|
4754
4764
|
y: start.y + appliedDy
|
|
4755
4765
|
});
|
|
@@ -4781,8 +4791,8 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4781
4791
|
rs.lastY = geo.y;
|
|
4782
4792
|
rs.lastWidth = geo.width;
|
|
4783
4793
|
rs.lastHeight = geo.height;
|
|
4784
|
-
const width = Math.max(geo.width,
|
|
4785
|
-
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);
|
|
4786
4796
|
if (rs.domEl) {
|
|
4787
4797
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4788
4798
|
rs.domEl.style.top = `${geo.y}px`;
|
|
@@ -4791,7 +4801,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4791
4801
|
syncSelectionHandleOverlay(rs.domEl, rs.elementId, { x: geo.x, y: geo.y, width, height });
|
|
4792
4802
|
}
|
|
4793
4803
|
if (live) {
|
|
4794
|
-
|
|
4804
|
+
chunkSN5EUDIT_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4795
4805
|
x: geo.x,
|
|
4796
4806
|
y: geo.y,
|
|
4797
4807
|
width,
|
|
@@ -4802,7 +4812,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4802
4812
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4803
4813
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4804
4814
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4805
|
-
const adjustments =
|
|
4815
|
+
const adjustments = chunkSN5EUDIT_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4806
4816
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4807
4817
|
adj.moved = true;
|
|
4808
4818
|
}
|
|
@@ -4877,13 +4887,13 @@ function processPointerUp(input) {
|
|
|
4877
4887
|
if (i !== activeSlideIndex) {
|
|
4878
4888
|
return s;
|
|
4879
4889
|
}
|
|
4880
|
-
const rerouted =
|
|
4890
|
+
const rerouted = chunkSN5EUDIT_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4881
4891
|
if (rerouted.length === 0) {
|
|
4882
4892
|
return s;
|
|
4883
4893
|
}
|
|
4884
4894
|
return {
|
|
4885
4895
|
...s,
|
|
4886
|
-
elements:
|
|
4896
|
+
elements: chunkSN5EUDIT_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4887
4897
|
};
|
|
4888
4898
|
})
|
|
4889
4899
|
);
|
|
@@ -4908,9 +4918,9 @@ function processPointerUp(input) {
|
|
|
4908
4918
|
}
|
|
4909
4919
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4910
4920
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4911
|
-
const hitIds =
|
|
4921
|
+
const hitIds = chunkSN5EUDIT_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4912
4922
|
if (marquee.additive) {
|
|
4913
|
-
const merged =
|
|
4923
|
+
const merged = chunkSN5EUDIT_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4914
4924
|
if (merged.length > 0) {
|
|
4915
4925
|
applySelection(merged[0], merged);
|
|
4916
4926
|
} else {
|
|
@@ -4933,8 +4943,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4933
4943
|
}
|
|
4934
4944
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4935
4945
|
});
|
|
4936
|
-
const rerouted =
|
|
4937
|
-
return
|
|
4946
|
+
const rerouted = chunkSN5EUDIT_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4947
|
+
return chunkSN5EUDIT_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4938
4948
|
};
|
|
4939
4949
|
if (editTemplateMode) {
|
|
4940
4950
|
const slideId = activeSlide?.id;
|
|
@@ -5090,12 +5100,12 @@ function useCanvasInteractions(input) {
|
|
|
5090
5100
|
return;
|
|
5091
5101
|
}
|
|
5092
5102
|
const el = elementLookup.get(editId);
|
|
5093
|
-
if (el &&
|
|
5103
|
+
if (el && chunkSN5EUDIT_js.hasTextProperties(el)) {
|
|
5094
5104
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
5095
|
-
const newSegments =
|
|
5105
|
+
const newSegments = chunkSN5EUDIT_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
5096
5106
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
5097
|
-
const newHeight =
|
|
5098
|
-
const shrink =
|
|
5107
|
+
const newHeight = chunkSN5EUDIT_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
5108
|
+
const shrink = chunkSN5EUDIT_js.resolveInlineEditNormAutofitShrink(el.textStyle, el.height, editorEl);
|
|
5099
5109
|
ops.updateElementById(editId, {
|
|
5100
5110
|
text: committedText,
|
|
5101
5111
|
textSegments: newSegments,
|
|
@@ -5114,7 +5124,7 @@ function useCanvasInteractions(input) {
|
|
|
5114
5124
|
setInlineEditingText("");
|
|
5115
5125
|
};
|
|
5116
5126
|
const openEquationEditorForElement = (el) => {
|
|
5117
|
-
if (!
|
|
5127
|
+
if (!chunkSN5EUDIT_js.hasTextProperties(el)) {
|
|
5118
5128
|
return false;
|
|
5119
5129
|
}
|
|
5120
5130
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5144,7 +5154,7 @@ function useCanvasInteractions(input) {
|
|
|
5144
5154
|
justInteractedRef.current = false;
|
|
5145
5155
|
} else {
|
|
5146
5156
|
const el = elementLookup.get(elementId);
|
|
5147
|
-
if (el &&
|
|
5157
|
+
if (el && chunkSN5EUDIT_js.hasTextProperties(el) && chunkSN5EUDIT_js.canInteractWithElement(el, "textEdit")) {
|
|
5148
5158
|
if (!openEquationEditorForElement(el)) {
|
|
5149
5159
|
setInlineEditingElementId(elementId);
|
|
5150
5160
|
setInlineEditingText(el.text ?? "");
|
|
@@ -5163,7 +5173,7 @@ function useCanvasInteractions(input) {
|
|
|
5163
5173
|
if (openEquationEditorForElement(el)) {
|
|
5164
5174
|
return;
|
|
5165
5175
|
}
|
|
5166
|
-
if (
|
|
5176
|
+
if (chunkSN5EUDIT_js.hasTextProperties(el) && chunkSN5EUDIT_js.canInteractWithElement(el, "textEdit")) {
|
|
5167
5177
|
setInlineEditingElementId(elementId);
|
|
5168
5178
|
setInlineEditingText(el.text ?? "");
|
|
5169
5179
|
}
|
|
@@ -5186,7 +5196,7 @@ function useCanvasInteractions(input) {
|
|
|
5186
5196
|
justSelectedRef.current = false;
|
|
5187
5197
|
}
|
|
5188
5198
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
5189
|
-
const movableIds =
|
|
5199
|
+
const movableIds = chunkSN5EUDIT_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
5190
5200
|
if (movableIds.length === 0) {
|
|
5191
5201
|
return;
|
|
5192
5202
|
}
|
|
@@ -5256,7 +5266,7 @@ function useCanvasInteractions(input) {
|
|
|
5256
5266
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5257
5267
|
e.stopPropagation();
|
|
5258
5268
|
const el = elementLookup.get(elementId);
|
|
5259
|
-
if (!el || !
|
|
5269
|
+
if (!el || !chunkSN5EUDIT_js.canInteractWithElement(el, "resize")) {
|
|
5260
5270
|
return;
|
|
5261
5271
|
}
|
|
5262
5272
|
resizeStateRef.current = {
|
|
@@ -5278,7 +5288,7 @@ function useCanvasInteractions(input) {
|
|
|
5278
5288
|
};
|
|
5279
5289
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5280
5290
|
const el = elementLookup.get(elementId);
|
|
5281
|
-
if (!el || !
|
|
5291
|
+
if (!el || !chunkSN5EUDIT_js.canInteractWithElement(el, "rotate")) {
|
|
5282
5292
|
return;
|
|
5283
5293
|
}
|
|
5284
5294
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5298,10 +5308,10 @@ function useCanvasInteractions(input) {
|
|
|
5298
5308
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5299
5309
|
e.stopPropagation();
|
|
5300
5310
|
const el = elementLookup.get(elementId);
|
|
5301
|
-
if (!el || !
|
|
5311
|
+
if (!el || !chunkSN5EUDIT_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5302
5312
|
return;
|
|
5303
5313
|
}
|
|
5304
|
-
shapeAdjustmentDragStateRef.current =
|
|
5314
|
+
shapeAdjustmentDragStateRef.current = chunkSN5EUDIT_js.beginShapeAdjustment(
|
|
5305
5315
|
el,
|
|
5306
5316
|
descriptor,
|
|
5307
5317
|
e.clientX,
|
|
@@ -5348,7 +5358,7 @@ function createFileHandlers(deps) {
|
|
|
5348
5358
|
h = Math.round(h * scale);
|
|
5349
5359
|
}
|
|
5350
5360
|
addElement({
|
|
5351
|
-
id:
|
|
5361
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
5352
5362
|
type: "image",
|
|
5353
5363
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5354
5364
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5359,7 +5369,7 @@ function createFileHandlers(deps) {
|
|
|
5359
5369
|
};
|
|
5360
5370
|
img.onerror = () => {
|
|
5361
5371
|
addElement({
|
|
5362
|
-
id:
|
|
5372
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
5363
5373
|
type: "image",
|
|
5364
5374
|
x: 100,
|
|
5365
5375
|
y: 100,
|
|
@@ -5378,14 +5388,14 @@ function createFileHandlers(deps) {
|
|
|
5378
5388
|
return;
|
|
5379
5389
|
}
|
|
5380
5390
|
e.target.value = "";
|
|
5381
|
-
const mediaType =
|
|
5391
|
+
const mediaType = chunkSN5EUDIT_js.classifyMediaType(file.type);
|
|
5382
5392
|
if (!mediaType) {
|
|
5383
5393
|
return;
|
|
5384
5394
|
}
|
|
5385
5395
|
const elFilePath = file.path;
|
|
5386
5396
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5387
5397
|
addElement({
|
|
5388
|
-
id:
|
|
5398
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
5389
5399
|
type: "media",
|
|
5390
5400
|
mediaType,
|
|
5391
5401
|
mediaMimeType: file.type || void 0,
|
|
@@ -5560,13 +5570,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5560
5570
|
return;
|
|
5561
5571
|
}
|
|
5562
5572
|
addElement({
|
|
5563
|
-
id:
|
|
5573
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
5564
5574
|
type: "smartArt",
|
|
5565
5575
|
x: 100,
|
|
5566
5576
|
y: 120,
|
|
5567
5577
|
width: 600,
|
|
5568
5578
|
height: 340,
|
|
5569
|
-
smartArtData:
|
|
5579
|
+
smartArtData: chunkSN5EUDIT_js.buildSmartArtPresetData(
|
|
5570
5580
|
layout,
|
|
5571
5581
|
defaultItems,
|
|
5572
5582
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5578,7 +5588,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5578
5588
|
return;
|
|
5579
5589
|
}
|
|
5580
5590
|
addElement({
|
|
5581
|
-
id:
|
|
5591
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
5582
5592
|
type: "shape",
|
|
5583
5593
|
x: 120,
|
|
5584
5594
|
y: 200,
|
|
@@ -5616,7 +5626,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5616
5626
|
return;
|
|
5617
5627
|
}
|
|
5618
5628
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5619
|
-
if (resolved.url && !
|
|
5629
|
+
if (resolved.url && !chunkSN5EUDIT_js.isUrlSafe(resolved.url)) {
|
|
5620
5630
|
return;
|
|
5621
5631
|
}
|
|
5622
5632
|
const actionClick = {
|
|
@@ -5640,7 +5650,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5640
5650
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5641
5651
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5642
5652
|
addElement({
|
|
5643
|
-
id:
|
|
5653
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
5644
5654
|
type: "shape",
|
|
5645
5655
|
x: 120,
|
|
5646
5656
|
y: 200,
|
|
@@ -5662,11 +5672,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5662
5672
|
if (!activeSlide) {
|
|
5663
5673
|
return;
|
|
5664
5674
|
}
|
|
5665
|
-
const preset =
|
|
5675
|
+
const preset = chunkSN5EUDIT_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5666
5676
|
if (!preset) {
|
|
5667
5677
|
return;
|
|
5668
5678
|
}
|
|
5669
|
-
const defaultPptxAction =
|
|
5679
|
+
const defaultPptxAction = chunkSN5EUDIT_js.elementActionToPptxAction({
|
|
5670
5680
|
trigger: "click",
|
|
5671
5681
|
type: preset.defaultAction
|
|
5672
5682
|
});
|
|
@@ -5675,7 +5685,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5675
5685
|
defaultPptxAction.highlightClick = true;
|
|
5676
5686
|
}
|
|
5677
5687
|
addElement({
|
|
5678
|
-
id:
|
|
5688
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
5679
5689
|
type: "shape",
|
|
5680
5690
|
x: 150,
|
|
5681
5691
|
y: 150,
|
|
@@ -5742,14 +5752,14 @@ function useInsertElements(input) {
|
|
|
5742
5752
|
return;
|
|
5743
5753
|
}
|
|
5744
5754
|
addElement({
|
|
5745
|
-
id:
|
|
5755
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
5746
5756
|
type: "text",
|
|
5747
5757
|
x: 100,
|
|
5748
5758
|
y: 100,
|
|
5749
5759
|
width: 300,
|
|
5750
5760
|
height: 60,
|
|
5751
5761
|
text: "",
|
|
5752
|
-
textStyle: { fontSize:
|
|
5762
|
+
textStyle: { fontSize: chunkQWA5YEIZ_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5753
5763
|
});
|
|
5754
5764
|
};
|
|
5755
5765
|
const handleAddShape = () => {
|
|
@@ -5757,7 +5767,7 @@ function useInsertElements(input) {
|
|
|
5757
5767
|
return;
|
|
5758
5768
|
}
|
|
5759
5769
|
addElement({
|
|
5760
|
-
id:
|
|
5770
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
5761
5771
|
type: "shape",
|
|
5762
5772
|
x: 150,
|
|
5763
5773
|
y: 150,
|
|
@@ -5776,15 +5786,15 @@ function useInsertElements(input) {
|
|
|
5776
5786
|
return;
|
|
5777
5787
|
}
|
|
5778
5788
|
addElement({
|
|
5779
|
-
...
|
|
5780
|
-
id:
|
|
5789
|
+
...chunkSN5EUDIT_js.newTableElement(chunkQWA5YEIZ_js.DEFAULT_TABLE_ROWS, chunkQWA5YEIZ_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5790
|
+
id: chunkSN5EUDIT_js.generateElementId()
|
|
5781
5791
|
});
|
|
5782
5792
|
};
|
|
5783
5793
|
const handleAddChart = (chartKind) => {
|
|
5784
5794
|
if (!activeSlide) {
|
|
5785
5795
|
return;
|
|
5786
5796
|
}
|
|
5787
|
-
addElement(
|
|
5797
|
+
addElement(chunkSN5EUDIT_js.createDefaultChartElement(chartKind));
|
|
5788
5798
|
};
|
|
5789
5799
|
const structured = createStructuredElementHandlers({
|
|
5790
5800
|
activeSlide,
|
|
@@ -5854,7 +5864,7 @@ function useClipboardHandlers(input) {
|
|
|
5854
5864
|
if (!selectedElement) {
|
|
5855
5865
|
return;
|
|
5856
5866
|
}
|
|
5857
|
-
setClipboardPayload(
|
|
5867
|
+
setClipboardPayload(chunkSN5EUDIT_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5858
5868
|
};
|
|
5859
5869
|
const handleDelete = () => {
|
|
5860
5870
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5871,7 +5881,7 @@ function useClipboardHandlers(input) {
|
|
|
5871
5881
|
handleDelete();
|
|
5872
5882
|
};
|
|
5873
5883
|
const insertClone = (source) => {
|
|
5874
|
-
const clone =
|
|
5884
|
+
const clone = chunkSN5EUDIT_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5875
5885
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5876
5886
|
ops.applySelection(clone.id);
|
|
5877
5887
|
history.markDirty();
|
|
@@ -5906,7 +5916,7 @@ function resolveShapePath(el) {
|
|
|
5906
5916
|
return el.pathData;
|
|
5907
5917
|
}
|
|
5908
5918
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5909
|
-
const clipPath =
|
|
5919
|
+
const clipPath = chunkSN5EUDIT_js.getPresetShapeClipPath(el.shapeType);
|
|
5910
5920
|
if (clipPath) {
|
|
5911
5921
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5912
5922
|
if (svgPath) {
|
|
@@ -5957,7 +5967,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5957
5967
|
return parts.join(" ");
|
|
5958
5968
|
}
|
|
5959
5969
|
function transformPathToGlobal(pathData, el) {
|
|
5960
|
-
const polys =
|
|
5970
|
+
const polys = chunkSN5EUDIT_js.svgPathToPolygons(pathData);
|
|
5961
5971
|
if (polys.length === 0) {
|
|
5962
5972
|
return pathData;
|
|
5963
5973
|
}
|
|
@@ -5977,10 +5987,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5977
5987
|
y: pt.y * scaleY + el.y
|
|
5978
5988
|
}))
|
|
5979
5989
|
);
|
|
5980
|
-
return
|
|
5990
|
+
return chunkSN5EUDIT_js.polygonsToSvgPath(transformed);
|
|
5981
5991
|
}
|
|
5982
5992
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5983
|
-
const polys =
|
|
5993
|
+
const polys = chunkSN5EUDIT_js.svgPathToPolygons(pathData);
|
|
5984
5994
|
if (polys.length === 0) {
|
|
5985
5995
|
return pathData;
|
|
5986
5996
|
}
|
|
@@ -5990,10 +6000,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5990
6000
|
y: pt.y - y
|
|
5991
6001
|
}))
|
|
5992
6002
|
);
|
|
5993
|
-
return
|
|
6003
|
+
return chunkSN5EUDIT_js.polygonsToSvgPath(transformed);
|
|
5994
6004
|
}
|
|
5995
6005
|
function pathBounds(pathData) {
|
|
5996
|
-
const polys =
|
|
6006
|
+
const polys = chunkSN5EUDIT_js.svgPathToPolygons(pathData);
|
|
5997
6007
|
let minX = Infinity;
|
|
5998
6008
|
let minY = Infinity;
|
|
5999
6009
|
let maxX = -Infinity;
|
|
@@ -6052,7 +6062,7 @@ function useMergeShapesHandler(input) {
|
|
|
6052
6062
|
let allFragments = [];
|
|
6053
6063
|
let remaining = globalPaths[0];
|
|
6054
6064
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6055
|
-
const frags =
|
|
6065
|
+
const frags = chunkSN5EUDIT_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
6056
6066
|
if (Array.isArray(frags)) {
|
|
6057
6067
|
allFragments = frags;
|
|
6058
6068
|
}
|
|
@@ -6081,7 +6091,7 @@ function useMergeShapesHandler(input) {
|
|
|
6081
6091
|
bounds.height
|
|
6082
6092
|
);
|
|
6083
6093
|
const newEl = {
|
|
6084
|
-
id:
|
|
6094
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
6085
6095
|
type: "shape",
|
|
6086
6096
|
x: bounds.x,
|
|
6087
6097
|
y: bounds.y,
|
|
@@ -6119,7 +6129,7 @@ function useMergeShapesHandler(input) {
|
|
|
6119
6129
|
} else {
|
|
6120
6130
|
let resultPath = globalPaths[0];
|
|
6121
6131
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6122
|
-
const result =
|
|
6132
|
+
const result = chunkSN5EUDIT_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
6123
6133
|
if (typeof result === "string") {
|
|
6124
6134
|
resultPath = result;
|
|
6125
6135
|
}
|
|
@@ -6140,7 +6150,7 @@ function useMergeShapesHandler(input) {
|
|
|
6140
6150
|
);
|
|
6141
6151
|
const primary = targets[0];
|
|
6142
6152
|
const newEl = {
|
|
6143
|
-
id:
|
|
6153
|
+
id: chunkSN5EUDIT_js.generateElementId(),
|
|
6144
6154
|
type: "shape",
|
|
6145
6155
|
x: bounds.x,
|
|
6146
6156
|
y: bounds.y,
|
|
@@ -6203,10 +6213,10 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6203
6213
|
if (ids.length < 2 || !activeSlide) {
|
|
6204
6214
|
return;
|
|
6205
6215
|
}
|
|
6206
|
-
if (!selectedElements.every((el) =>
|
|
6216
|
+
if (!selectedElements.every((el) => chunkSN5EUDIT_js.canInteractWithElement(el, "group"))) {
|
|
6207
6217
|
return;
|
|
6208
6218
|
}
|
|
6209
|
-
const { elements, groupId } =
|
|
6219
|
+
const { elements, groupId } = chunkSN5EUDIT_js.groupElements(ops.activeElements, ids, chunkSN5EUDIT_js.generateElementId());
|
|
6210
6220
|
if (groupId === null) {
|
|
6211
6221
|
return;
|
|
6212
6222
|
}
|
|
@@ -6218,15 +6228,15 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6218
6228
|
if (!selectedElement || selectedElement.type !== "group" || !activeSlide) {
|
|
6219
6229
|
return;
|
|
6220
6230
|
}
|
|
6221
|
-
if (!
|
|
6231
|
+
if (!chunkSN5EUDIT_js.canInteractWithElement(selectedElement, "group")) {
|
|
6222
6232
|
return;
|
|
6223
6233
|
}
|
|
6224
6234
|
const group = selectedElement;
|
|
6225
|
-
const intoTemplate =
|
|
6235
|
+
const intoTemplate = chunkSN5EUDIT_js.isTemplateElementId(group.id);
|
|
6226
6236
|
const childIds = group.children.map(
|
|
6227
|
-
(child) => intoTemplate ?
|
|
6237
|
+
(child) => intoTemplate ? chunkSN5EUDIT_js.makeCloneId(true, child.id || group.id) : child.id || chunkSN5EUDIT_js.generateElementId()
|
|
6228
6238
|
);
|
|
6229
|
-
const { elements, childIds: usedIds } =
|
|
6239
|
+
const { elements, childIds: usedIds } = chunkSN5EUDIT_js.ungroupElements(
|
|
6230
6240
|
ops.activeElements,
|
|
6231
6241
|
group.id,
|
|
6232
6242
|
childIds,
|
|
@@ -6255,7 +6265,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6255
6265
|
if (!edge) {
|
|
6256
6266
|
return;
|
|
6257
6267
|
}
|
|
6258
|
-
const positions =
|
|
6268
|
+
const positions = chunkSN5EUDIT_js.alignElements(selectedElements, edge);
|
|
6259
6269
|
for (const [id, pos] of positions) {
|
|
6260
6270
|
const el = elementLookup.get(id);
|
|
6261
6271
|
if (!el) {
|
|
@@ -6273,7 +6283,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6273
6283
|
if (!distAxis) {
|
|
6274
6284
|
return;
|
|
6275
6285
|
}
|
|
6276
|
-
const positions =
|
|
6286
|
+
const positions = chunkSN5EUDIT_js.distributeElements(selectedElements, distAxis);
|
|
6277
6287
|
for (const [id, pos] of positions) {
|
|
6278
6288
|
const el = elementLookup.get(id);
|
|
6279
6289
|
if (!el) {
|
|
@@ -6284,14 +6294,14 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6284
6294
|
history.markDirty();
|
|
6285
6295
|
};
|
|
6286
6296
|
const canDistribute = selectedElements.length >= 3;
|
|
6287
|
-
const selectionGroupable = selectedElements.every((el) =>
|
|
6297
|
+
const selectionGroupable = selectedElements.every((el) => chunkSN5EUDIT_js.canInteractWithElement(el, "group"));
|
|
6288
6298
|
const handleMoveLayer = (direction) => {
|
|
6289
6299
|
if (!selectedElement || !activeSlide) {
|
|
6290
6300
|
return;
|
|
6291
6301
|
}
|
|
6292
6302
|
const id = selectedElement.id;
|
|
6293
6303
|
ops.updateActiveElements(
|
|
6294
|
-
(els) => direction === "forward" ?
|
|
6304
|
+
(els) => direction === "forward" ? chunkSN5EUDIT_js.bringForward(els, id) : direction === "backward" ? chunkSN5EUDIT_js.sendBackward(els, id) : els
|
|
6295
6305
|
);
|
|
6296
6306
|
history.markDirty();
|
|
6297
6307
|
};
|
|
@@ -6301,7 +6311,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6301
6311
|
}
|
|
6302
6312
|
const id = selectedElement.id;
|
|
6303
6313
|
ops.updateActiveElements(
|
|
6304
|
-
(els) => direction === "front" ?
|
|
6314
|
+
(els) => direction === "front" ? chunkSN5EUDIT_js.bringToFront(els, id) : chunkSN5EUDIT_js.sendToBack(els, id)
|
|
6305
6315
|
);
|
|
6306
6316
|
history.markDirty();
|
|
6307
6317
|
};
|
|
@@ -6435,7 +6445,7 @@ function useSlideManagement(input) {
|
|
|
6435
6445
|
theme
|
|
6436
6446
|
} = input;
|
|
6437
6447
|
const handleAddSlide = () => {
|
|
6438
|
-
const newSlide =
|
|
6448
|
+
const newSlide = chunkSN5EUDIT_js.createBlankSlide(slides.length + 1);
|
|
6439
6449
|
ops.updateSlides((prev) => {
|
|
6440
6450
|
const next = [...prev];
|
|
6441
6451
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6498,7 +6508,7 @@ function useSlideManagement(input) {
|
|
|
6498
6508
|
}
|
|
6499
6509
|
const clone = {
|
|
6500
6510
|
...src,
|
|
6501
|
-
id:
|
|
6511
|
+
id: chunkSN5EUDIT_js.makeSlideId(),
|
|
6502
6512
|
elements: src.elements.map((el) => ({
|
|
6503
6513
|
...el,
|
|
6504
6514
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6530,7 +6540,7 @@ function useSlideManagement(input) {
|
|
|
6530
6540
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6531
6541
|
const insertAt = activeSlideIndex + 1;
|
|
6532
6542
|
const draft = {
|
|
6533
|
-
...
|
|
6543
|
+
...chunkSN5EUDIT_js.createBlankSlide(slides.length + 1),
|
|
6534
6544
|
layoutPath,
|
|
6535
6545
|
...layoutName ? { layoutName } : {}
|
|
6536
6546
|
};
|
|
@@ -6563,9 +6573,9 @@ function useSlideManagement(input) {
|
|
|
6563
6573
|
};
|
|
6564
6574
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6565
6575
|
const insertAt = activeSlideIndex + 1;
|
|
6566
|
-
const draft =
|
|
6576
|
+
const draft = chunkSN5EUDIT_js.buildSlideTemplateSlide(templateId, chunkSN5EUDIT_js.makeSlideId(), slides.length + 1, {
|
|
6567
6577
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6568
|
-
scheme:
|
|
6578
|
+
scheme: chunkSN5EUDIT_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6569
6579
|
});
|
|
6570
6580
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6571
6581
|
setActiveSlideIndex(insertAt);
|
|
@@ -6602,7 +6612,7 @@ function createTableMergeHandlers(input) {
|
|
|
6602
6612
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6603
6613
|
return;
|
|
6604
6614
|
}
|
|
6605
|
-
const newTableData =
|
|
6615
|
+
const newTableData = chunkSN5EUDIT_js.mergeCells(
|
|
6606
6616
|
[
|
|
6607
6617
|
{ row: rowIndex, col: columnIndex },
|
|
6608
6618
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6610,7 +6620,7 @@ function createTableMergeHandlers(input) {
|
|
|
6610
6620
|
td
|
|
6611
6621
|
);
|
|
6612
6622
|
const updates = { tableData: newTableData };
|
|
6613
|
-
const newRawXml =
|
|
6623
|
+
const newRawXml = chunkSN5EUDIT_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6614
6624
|
if (newRawXml) {
|
|
6615
6625
|
updates.rawXml = newRawXml;
|
|
6616
6626
|
}
|
|
@@ -6636,7 +6646,7 @@ function createTableMergeHandlers(input) {
|
|
|
6636
6646
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6637
6647
|
return;
|
|
6638
6648
|
}
|
|
6639
|
-
const newTableData =
|
|
6649
|
+
const newTableData = chunkSN5EUDIT_js.mergeCells(
|
|
6640
6650
|
[
|
|
6641
6651
|
{ row: rowIndex, col: columnIndex },
|
|
6642
6652
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6644,7 +6654,7 @@ function createTableMergeHandlers(input) {
|
|
|
6644
6654
|
td
|
|
6645
6655
|
);
|
|
6646
6656
|
const updates = { tableData: newTableData };
|
|
6647
|
-
const newRawXml =
|
|
6657
|
+
const newRawXml = chunkSN5EUDIT_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6648
6658
|
if (newRawXml) {
|
|
6649
6659
|
updates.rawXml = newRawXml;
|
|
6650
6660
|
}
|
|
@@ -6659,9 +6669,9 @@ function createTableMergeHandlers(input) {
|
|
|
6659
6669
|
return;
|
|
6660
6670
|
}
|
|
6661
6671
|
const td = selectedElement.tableData;
|
|
6662
|
-
const newTableData =
|
|
6672
|
+
const newTableData = chunkSN5EUDIT_js.mergeCells(ts.selectedCells, td);
|
|
6663
6673
|
const updates = { tableData: newTableData };
|
|
6664
|
-
const newRawXml =
|
|
6674
|
+
const newRawXml = chunkSN5EUDIT_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6665
6675
|
if (newRawXml) {
|
|
6666
6676
|
updates.rawXml = newRawXml;
|
|
6667
6677
|
}
|
|
@@ -6678,9 +6688,9 @@ function createTableMergeHandlers(input) {
|
|
|
6678
6688
|
}
|
|
6679
6689
|
const { rowIndex, columnIndex } = ts;
|
|
6680
6690
|
const td = selectedElement.tableData;
|
|
6681
|
-
const newTableData =
|
|
6691
|
+
const newTableData = chunkSN5EUDIT_js.splitCell(rowIndex, columnIndex, td);
|
|
6682
6692
|
const updates = { tableData: newTableData };
|
|
6683
|
-
const newRawXml =
|
|
6693
|
+
const newRawXml = chunkSN5EUDIT_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6684
6694
|
if (newRawXml) {
|
|
6685
6695
|
updates.rawXml = newRawXml;
|
|
6686
6696
|
}
|
|
@@ -6714,10 +6724,10 @@ function createTableStructHandlers(input) {
|
|
|
6714
6724
|
const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
|
|
6715
6725
|
const updates = {};
|
|
6716
6726
|
if (el.tableData) {
|
|
6717
|
-
updates.tableData =
|
|
6727
|
+
updates.tableData = chunkSN5EUDIT_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6718
6728
|
}
|
|
6719
6729
|
if (el.rawXml) {
|
|
6720
|
-
const newRawXml =
|
|
6730
|
+
const newRawXml = chunkSN5EUDIT_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6721
6731
|
if (newRawXml) {
|
|
6722
6732
|
updates.rawXml = newRawXml;
|
|
6723
6733
|
}
|
|
@@ -6741,7 +6751,7 @@ function createTableStructHandlers(input) {
|
|
|
6741
6751
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6742
6752
|
const updates = {};
|
|
6743
6753
|
if (selectedElement.rawXml) {
|
|
6744
|
-
const newRawXml =
|
|
6754
|
+
const newRawXml = chunkSN5EUDIT_js.updateCellTextStyleInRawXml(
|
|
6745
6755
|
selectedElement,
|
|
6746
6756
|
rowIndex,
|
|
6747
6757
|
colIndex,
|
|
@@ -6805,9 +6815,9 @@ function createTableStructHandlers(input) {
|
|
|
6805
6815
|
return;
|
|
6806
6816
|
}
|
|
6807
6817
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6808
|
-
const newTableData =
|
|
6818
|
+
const newTableData = chunkSN5EUDIT_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6809
6819
|
const updates = { tableData: newTableData };
|
|
6810
|
-
const newRawXml =
|
|
6820
|
+
const newRawXml = chunkSN5EUDIT_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6811
6821
|
if (newRawXml) {
|
|
6812
6822
|
updates.rawXml = newRawXml;
|
|
6813
6823
|
}
|
|
@@ -6820,12 +6830,12 @@ function createTableStructHandlers(input) {
|
|
|
6820
6830
|
}
|
|
6821
6831
|
const td = selectedElement.tableData;
|
|
6822
6832
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6823
|
-
const newTableData =
|
|
6833
|
+
const newTableData = chunkSN5EUDIT_js.deleteTableRow(td, rowIdx);
|
|
6824
6834
|
if (newTableData === td) {
|
|
6825
6835
|
return;
|
|
6826
6836
|
}
|
|
6827
6837
|
const updates = { tableData: newTableData };
|
|
6828
|
-
const newRawXml =
|
|
6838
|
+
const newRawXml = chunkSN5EUDIT_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6829
6839
|
if (newRawXml) {
|
|
6830
6840
|
updates.rawXml = newRawXml;
|
|
6831
6841
|
}
|
|
@@ -6837,9 +6847,9 @@ function createTableStructHandlers(input) {
|
|
|
6837
6847
|
return;
|
|
6838
6848
|
}
|
|
6839
6849
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6840
|
-
const newTableData =
|
|
6850
|
+
const newTableData = chunkSN5EUDIT_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6841
6851
|
const updates = { tableData: newTableData };
|
|
6842
|
-
const newRawXml =
|
|
6852
|
+
const newRawXml = chunkSN5EUDIT_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6843
6853
|
if (newRawXml) {
|
|
6844
6854
|
updates.rawXml = newRawXml;
|
|
6845
6855
|
}
|
|
@@ -6852,12 +6862,12 @@ function createTableStructHandlers(input) {
|
|
|
6852
6862
|
}
|
|
6853
6863
|
const td = selectedElement.tableData;
|
|
6854
6864
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6855
|
-
const newTableData =
|
|
6865
|
+
const newTableData = chunkSN5EUDIT_js.deleteTableColumn(td, colIdx);
|
|
6856
6866
|
if (newTableData === td) {
|
|
6857
6867
|
return;
|
|
6858
6868
|
}
|
|
6859
6869
|
const updates = { tableData: newTableData };
|
|
6860
|
-
const newRawXml =
|
|
6870
|
+
const newRawXml = chunkSN5EUDIT_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6861
6871
|
if (newRawXml) {
|
|
6862
6872
|
updates.rawXml = newRawXml;
|
|
6863
6873
|
}
|
|
@@ -6893,8 +6903,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6893
6903
|
return html2canvasPro(element, {
|
|
6894
6904
|
...options,
|
|
6895
6905
|
onclone: async (doc, clonedEl) => {
|
|
6896
|
-
await
|
|
6897
|
-
|
|
6906
|
+
await chunkSN5EUDIT_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6907
|
+
chunkSN5EUDIT_js.preprocessCssForCapture(clonedEl);
|
|
6898
6908
|
if (typeof userOnClone === "function") {
|
|
6899
6909
|
userOnClone(doc, clonedEl);
|
|
6900
6910
|
}
|
|
@@ -6908,7 +6918,7 @@ function useExportSaveAs(input) {
|
|
|
6908
6918
|
slides,
|
|
6909
6919
|
templateElementsBySlideId,
|
|
6910
6920
|
filePath,
|
|
6911
|
-
|
|
6921
|
+
serializeSlides,
|
|
6912
6922
|
headerFooter,
|
|
6913
6923
|
presentationProperties,
|
|
6914
6924
|
customShows,
|
|
@@ -6917,72 +6927,32 @@ function useExportSaveAs(input) {
|
|
|
6917
6927
|
appProperties,
|
|
6918
6928
|
customProperties,
|
|
6919
6929
|
tagCollections,
|
|
6920
|
-
slideMasters,
|
|
6921
6930
|
notesMaster,
|
|
6922
6931
|
handoutMaster,
|
|
6923
|
-
guides,
|
|
6924
|
-
activeSlideIndexForGuides,
|
|
6925
6932
|
theme,
|
|
6926
6933
|
canvasSize,
|
|
6927
|
-
slideSizeEmu
|
|
6928
|
-
password
|
|
6934
|
+
slideSizeEmu
|
|
6929
6935
|
} = input;
|
|
6930
6936
|
const handleSaveAsFormat = async (format) => {
|
|
6931
|
-
const
|
|
6932
|
-
if (!handler) {
|
|
6933
|
-
return;
|
|
6934
|
-
}
|
|
6935
|
-
const downloadName = chunkDCNHUEWQ_js.savedPresentationFileName(filePath, format);
|
|
6937
|
+
const downloadName = chunkSN5EUDIT_js.savedPresentationFileName(filePath, format);
|
|
6936
6938
|
try {
|
|
6937
|
-
const data = await
|
|
6939
|
+
const data = await serializeSlides(format);
|
|
6940
|
+
if (!data) {
|
|
6941
|
+
return;
|
|
6942
|
+
}
|
|
6938
6943
|
const blob = new Blob([data], {
|
|
6939
6944
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6940
6945
|
});
|
|
6941
|
-
|
|
6946
|
+
chunkSN5EUDIT_js.downloadBlob(blob, downloadName);
|
|
6942
6947
|
} catch (err) {
|
|
6943
6948
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
6944
6949
|
}
|
|
6945
6950
|
};
|
|
6946
|
-
const buildSaveAsData = async (handler, format) => {
|
|
6947
|
-
const slidesWithGuides = slides.map((slide, idx) => {
|
|
6948
|
-
if (idx !== activeSlideIndexForGuides) {
|
|
6949
|
-
return slide;
|
|
6950
|
-
}
|
|
6951
|
-
const pptxGuides = guides.map((g) => ({
|
|
6952
|
-
id: g.id,
|
|
6953
|
-
orientation: g.axis === "h" ? "horz" : "vert",
|
|
6954
|
-
positionEmu: chunkDCNHUEWQ_js.guidePxToEmu(g.position)
|
|
6955
|
-
}));
|
|
6956
|
-
return {
|
|
6957
|
-
...slide,
|
|
6958
|
-
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
6959
|
-
};
|
|
6960
|
-
});
|
|
6961
|
-
const slidesToSave = chunkDCNHUEWQ_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
6962
|
-
const saveOptions = {
|
|
6963
|
-
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
6964
|
-
// a preset picked in the inspector reached one save path and not the other.
|
|
6965
|
-
slideSize: chunkDCNHUEWQ_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
6966
|
-
headerFooter,
|
|
6967
|
-
presentationProperties,
|
|
6968
|
-
customShows: customShows.length > 0 ? customShows : void 0,
|
|
6969
|
-
sections: sections.length > 0 ? sections : void 0,
|
|
6970
|
-
coreProperties: coreProperties ?? void 0,
|
|
6971
|
-
appProperties: appProperties ?? void 0,
|
|
6972
|
-
customProperties: customProperties.length > 0 ? customProperties : void 0,
|
|
6973
|
-
tags: tagCollections.length > 0 ? tagCollections : void 0,
|
|
6974
|
-
slideMasters,
|
|
6975
|
-
notesMaster,
|
|
6976
|
-
handoutMaster,
|
|
6977
|
-
outputFormat: format
|
|
6978
|
-
};
|
|
6979
|
-
return chunkDCNHUEWQ_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
6980
|
-
};
|
|
6981
6951
|
const handleExportJson = () => {
|
|
6982
6952
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
6983
|
-
const slideSize =
|
|
6953
|
+
const slideSize = chunkSN5EUDIT_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
6984
6954
|
const data = {
|
|
6985
|
-
slides:
|
|
6955
|
+
slides: chunkSN5EUDIT_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
6986
6956
|
width: canvasSize.width,
|
|
6987
6957
|
height: canvasSize.height,
|
|
6988
6958
|
widthEmu: slideSize.widthEmu,
|
|
@@ -6993,15 +6963,15 @@ function useExportSaveAs(input) {
|
|
|
6993
6963
|
presentationProperties,
|
|
6994
6964
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
6995
6965
|
sections: sections.length > 0 ? sections : void 0,
|
|
6996
|
-
coreProperties
|
|
6997
|
-
appProperties
|
|
6966
|
+
coreProperties,
|
|
6967
|
+
appProperties,
|
|
6998
6968
|
customProperties: customProperties.length > 0 ? customProperties : void 0,
|
|
6999
6969
|
tags: tagCollections.length > 0 ? tagCollections : void 0,
|
|
7000
6970
|
notesMaster,
|
|
7001
6971
|
handoutMaster
|
|
7002
6972
|
};
|
|
7003
6973
|
try {
|
|
7004
|
-
|
|
6974
|
+
chunkSN5EUDIT_js.exportDeckJson(data, sourceName);
|
|
7005
6975
|
} catch (err) {
|
|
7006
6976
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7007
6977
|
}
|
|
@@ -7088,7 +7058,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
7088
7058
|
}
|
|
7089
7059
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
7090
7060
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
7091
|
-
|
|
7061
|
+
chunkSN5EUDIT_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
7092
7062
|
}
|
|
7093
7063
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
7094
7064
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -7110,15 +7080,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7110
7080
|
continue;
|
|
7111
7081
|
}
|
|
7112
7082
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
7113
|
-
images.push(
|
|
7083
|
+
images.push(chunkSN5EUDIT_js.canvasToJpegData(canvas));
|
|
7114
7084
|
}
|
|
7115
7085
|
onProgress?.(totalSlides, totalSlides);
|
|
7116
7086
|
setActiveSlide(currentSlideIndex);
|
|
7117
7087
|
if (images.length === 0) {
|
|
7118
|
-
throw new Error(
|
|
7088
|
+
throw new Error(chunkL3ZIBQEB_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7119
7089
|
}
|
|
7120
|
-
const pdfBlobUrl =
|
|
7121
|
-
|
|
7090
|
+
const pdfBlobUrl = chunkQWA5YEIZ_js.buildPdfFromImageData(images);
|
|
7091
|
+
chunkSN5EUDIT_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
7122
7092
|
}
|
|
7123
7093
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
7124
7094
|
const { scale = 2, onProgress } = options;
|
|
@@ -7164,10 +7134,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7164
7134
|
onProgress?.(totalSlides, totalSlides);
|
|
7165
7135
|
setActiveSlide(currentSlideIndex);
|
|
7166
7136
|
if (pages.length === 0) {
|
|
7167
|
-
throw new Error(
|
|
7137
|
+
throw new Error(chunkL3ZIBQEB_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7168
7138
|
}
|
|
7169
|
-
const pdfDataUrl =
|
|
7170
|
-
|
|
7139
|
+
const pdfDataUrl = chunkQWA5YEIZ_js.buildNotesPdf(pages);
|
|
7140
|
+
chunkSN5EUDIT_js.downloadDataUrl(pdfDataUrl, filename);
|
|
7171
7141
|
}
|
|
7172
7142
|
|
|
7173
7143
|
// src/viewer/utils/export-video.ts
|
|
@@ -7198,7 +7168,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7198
7168
|
}
|
|
7199
7169
|
setActiveSlide(currentSlideIndex);
|
|
7200
7170
|
if (slideCanvases.length === 0) {
|
|
7201
|
-
throw new Error(
|
|
7171
|
+
throw new Error(chunkL3ZIBQEB_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
7202
7172
|
}
|
|
7203
7173
|
const firstCanvas = slideCanvases[0];
|
|
7204
7174
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -7206,12 +7176,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7206
7176
|
recordingCanvas.height = firstCanvas.height;
|
|
7207
7177
|
const ctx = recordingCanvas.getContext("2d");
|
|
7208
7178
|
if (!ctx) {
|
|
7209
|
-
throw new Error(
|
|
7179
|
+
throw new Error(chunkL3ZIBQEB_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
7210
7180
|
}
|
|
7211
7181
|
const fps = 30;
|
|
7212
7182
|
const stream = recordingCanvas.captureStream(fps);
|
|
7213
7183
|
const recorder = new MediaRecorder(stream, {
|
|
7214
|
-
mimeType:
|
|
7184
|
+
mimeType: chunkSN5EUDIT_js.pickSupportedMimeType([...chunkSN5EUDIT_js.WEBM_MIME_CANDIDATES]),
|
|
7215
7185
|
videoBitsPerSecond: 5e6
|
|
7216
7186
|
});
|
|
7217
7187
|
const chunks = [];
|
|
@@ -7234,8 +7204,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7234
7204
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
7235
7205
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
7236
7206
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
7237
|
-
const frameInterval =
|
|
7238
|
-
const framesNeeded =
|
|
7207
|
+
const frameInterval = chunkSN5EUDIT_js.fpsToFrameIntervalMs(fps);
|
|
7208
|
+
const framesNeeded = chunkSN5EUDIT_js.segmentFrameCount(duration, fps);
|
|
7239
7209
|
for (let f = 0; f < framesNeeded; f++) {
|
|
7240
7210
|
if (signal?.aborted) {
|
|
7241
7211
|
recorder.stop();
|
|
@@ -7282,9 +7252,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7282
7252
|
}
|
|
7283
7253
|
setActiveSlide(currentSlideIndex);
|
|
7284
7254
|
if (frames.length === 0) {
|
|
7285
|
-
throw new Error(
|
|
7255
|
+
throw new Error(chunkL3ZIBQEB_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
7286
7256
|
}
|
|
7287
|
-
const gifBytes =
|
|
7257
|
+
const gifBytes = chunkSN5EUDIT_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
7288
7258
|
onProgress?.(totalSlides, totalSlides);
|
|
7289
7259
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
7290
7260
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -7338,7 +7308,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7338
7308
|
continue;
|
|
7339
7309
|
}
|
|
7340
7310
|
onProgress?.(processedCount, data.slides.length);
|
|
7341
|
-
let svg =
|
|
7311
|
+
let svg = chunkSN5EUDIT_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7342
7312
|
if (embedFonts && fontFaces?.length) {
|
|
7343
7313
|
svg = injectFontFaces(svg, fontFaces);
|
|
7344
7314
|
}
|
|
@@ -7359,7 +7329,7 @@ function useExportHandlers(input) {
|
|
|
7359
7329
|
filePath,
|
|
7360
7330
|
canvasStageRef,
|
|
7361
7331
|
setActiveSlideIndex,
|
|
7362
|
-
|
|
7332
|
+
serializeSlides,
|
|
7363
7333
|
headerFooter,
|
|
7364
7334
|
presentationProperties,
|
|
7365
7335
|
customShows,
|
|
@@ -7368,15 +7338,11 @@ function useExportHandlers(input) {
|
|
|
7368
7338
|
appProperties,
|
|
7369
7339
|
customProperties,
|
|
7370
7340
|
tagCollections,
|
|
7371
|
-
slideMasters,
|
|
7372
7341
|
notesMaster,
|
|
7373
7342
|
handoutMaster,
|
|
7374
|
-
guides,
|
|
7375
|
-
activeSlideIndexForGuides,
|
|
7376
7343
|
theme,
|
|
7377
7344
|
canvasSize,
|
|
7378
7345
|
slideSizeEmu,
|
|
7379
|
-
password,
|
|
7380
7346
|
imageExportScale
|
|
7381
7347
|
} = input;
|
|
7382
7348
|
const [exportModalOpen, setExportModalOpen] = react.useState(false);
|
|
@@ -7394,7 +7360,7 @@ function useExportHandlers(input) {
|
|
|
7394
7360
|
slides,
|
|
7395
7361
|
templateElementsBySlideId,
|
|
7396
7362
|
filePath,
|
|
7397
|
-
|
|
7363
|
+
serializeSlides,
|
|
7398
7364
|
headerFooter,
|
|
7399
7365
|
presentationProperties,
|
|
7400
7366
|
customShows,
|
|
@@ -7403,15 +7369,11 @@ function useExportHandlers(input) {
|
|
|
7403
7369
|
appProperties,
|
|
7404
7370
|
customProperties,
|
|
7405
7371
|
tagCollections,
|
|
7406
|
-
slideMasters,
|
|
7407
7372
|
notesMaster,
|
|
7408
7373
|
handoutMaster,
|
|
7409
|
-
guides,
|
|
7410
|
-
activeSlideIndexForGuides,
|
|
7411
7374
|
theme,
|
|
7412
7375
|
canvasSize,
|
|
7413
|
-
slideSizeEmu
|
|
7414
|
-
password
|
|
7376
|
+
slideSizeEmu
|
|
7415
7377
|
});
|
|
7416
7378
|
const handleExportPng = react.useCallback(async () => {
|
|
7417
7379
|
const stageEl = canvasStageRef.current;
|
|
@@ -7447,21 +7409,21 @@ function useExportHandlers(input) {
|
|
|
7447
7409
|
{
|
|
7448
7410
|
scale: imageExportScale,
|
|
7449
7411
|
onProgress: (current, total) => {
|
|
7450
|
-
setExportProgress(
|
|
7451
|
-
setExportStatusMessage(
|
|
7412
|
+
setExportProgress(chunkSN5EUDIT_js.slideProgressPercent(current, total));
|
|
7413
|
+
setExportStatusMessage(chunkSN5EUDIT_js.slideStatusLabel("Rendering", current, total));
|
|
7452
7414
|
},
|
|
7453
7415
|
signal: abortCtrl.signal
|
|
7454
7416
|
}
|
|
7455
7417
|
);
|
|
7456
|
-
setExportProgress(
|
|
7418
|
+
setExportProgress(chunkSN5EUDIT_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7457
7419
|
setExportStatusMessage("Building PDF...");
|
|
7458
7420
|
await new Promise((r) => {
|
|
7459
7421
|
setTimeout(r, 100);
|
|
7460
7422
|
});
|
|
7461
|
-
setExportProgress(
|
|
7423
|
+
setExportProgress(chunkSN5EUDIT_js.EXPORT_DONE_PERCENT);
|
|
7462
7424
|
setExportStatusMessage("Done!");
|
|
7463
7425
|
} catch (err) {
|
|
7464
|
-
if (!
|
|
7426
|
+
if (!chunkSN5EUDIT_js.isExportAbortError(err)) {
|
|
7465
7427
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7466
7428
|
}
|
|
7467
7429
|
} finally {
|
|
@@ -7491,21 +7453,21 @@ function useExportHandlers(input) {
|
|
|
7491
7453
|
{
|
|
7492
7454
|
scale: imageExportScale,
|
|
7493
7455
|
onProgress: (current, total) => {
|
|
7494
|
-
setExportProgress(
|
|
7495
|
-
setExportStatusMessage(
|
|
7456
|
+
setExportProgress(chunkSN5EUDIT_js.slideProgressPercent(current, total));
|
|
7457
|
+
setExportStatusMessage(chunkSN5EUDIT_js.slideStatusLabel("Rendering", current, total));
|
|
7496
7458
|
},
|
|
7497
7459
|
signal: abortCtrl.signal
|
|
7498
7460
|
}
|
|
7499
7461
|
);
|
|
7500
|
-
setExportProgress(
|
|
7462
|
+
setExportProgress(chunkSN5EUDIT_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7501
7463
|
setExportStatusMessage("Building PDF...");
|
|
7502
7464
|
await new Promise((r) => {
|
|
7503
7465
|
setTimeout(r, 100);
|
|
7504
7466
|
});
|
|
7505
|
-
setExportProgress(
|
|
7467
|
+
setExportProgress(chunkSN5EUDIT_js.EXPORT_DONE_PERCENT);
|
|
7506
7468
|
setExportStatusMessage("Done!");
|
|
7507
7469
|
} catch (err) {
|
|
7508
|
-
if (!
|
|
7470
|
+
if (!chunkSN5EUDIT_js.isExportAbortError(err)) {
|
|
7509
7471
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7510
7472
|
}
|
|
7511
7473
|
} finally {
|
|
@@ -7547,22 +7509,22 @@ function useExportHandlers(input) {
|
|
|
7547
7509
|
scale: 1,
|
|
7548
7510
|
slideDurationMs: 3e3,
|
|
7549
7511
|
onProgress: (current, total) => {
|
|
7550
|
-
setExportProgress(
|
|
7551
|
-
setExportStatusMessage(
|
|
7512
|
+
setExportProgress(chunkSN5EUDIT_js.slideProgressPercent(current, total, 45));
|
|
7513
|
+
setExportStatusMessage(chunkSN5EUDIT_js.slideStatusLabel("Capturing", current, total));
|
|
7552
7514
|
},
|
|
7553
7515
|
onRecordProgress: (current, total) => {
|
|
7554
|
-
setExportProgress(
|
|
7555
|
-
setExportStatusMessage(
|
|
7516
|
+
setExportProgress(chunkSN5EUDIT_js.recordProgressPercent(current, total));
|
|
7517
|
+
setExportStatusMessage(chunkSN5EUDIT_js.slideStatusLabel("Recording", current, total));
|
|
7556
7518
|
},
|
|
7557
7519
|
signal: abortCtrl.signal
|
|
7558
7520
|
}
|
|
7559
7521
|
);
|
|
7560
|
-
setExportProgress(
|
|
7522
|
+
setExportProgress(chunkSN5EUDIT_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7561
7523
|
setExportStatusMessage("Saving file...");
|
|
7562
|
-
|
|
7563
|
-
setExportProgress(
|
|
7524
|
+
chunkSN5EUDIT_js.downloadBlob(blob, "presentation.webm");
|
|
7525
|
+
setExportProgress(chunkSN5EUDIT_js.EXPORT_DONE_PERCENT);
|
|
7564
7526
|
} catch (err) {
|
|
7565
|
-
if (!
|
|
7527
|
+
if (!chunkSN5EUDIT_js.isExportAbortError(err)) {
|
|
7566
7528
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7567
7529
|
}
|
|
7568
7530
|
} finally {
|
|
@@ -7590,18 +7552,18 @@ function useExportHandlers(input) {
|
|
|
7590
7552
|
scale: 0.5,
|
|
7591
7553
|
slideDurationMs: 2e3,
|
|
7592
7554
|
onProgress: (current, total) => {
|
|
7593
|
-
setExportProgress(
|
|
7594
|
-
setExportStatusMessage(
|
|
7555
|
+
setExportProgress(chunkSN5EUDIT_js.slideProgressPercent(current, total));
|
|
7556
|
+
setExportStatusMessage(chunkSN5EUDIT_js.slideStatusLabel("Encoding", current, total));
|
|
7595
7557
|
},
|
|
7596
7558
|
signal: abortCtrl.signal
|
|
7597
7559
|
}
|
|
7598
7560
|
);
|
|
7599
|
-
setExportProgress(
|
|
7561
|
+
setExportProgress(chunkSN5EUDIT_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7600
7562
|
setExportStatusMessage("Saving file...");
|
|
7601
|
-
|
|
7602
|
-
setExportProgress(
|
|
7563
|
+
chunkSN5EUDIT_js.downloadBlob(blob, "presentation.gif");
|
|
7564
|
+
setExportProgress(chunkSN5EUDIT_js.EXPORT_DONE_PERCENT);
|
|
7603
7565
|
} catch (err) {
|
|
7604
|
-
if (!
|
|
7566
|
+
if (!chunkSN5EUDIT_js.isExportAbortError(err)) {
|
|
7605
7567
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7606
7568
|
}
|
|
7607
7569
|
} finally {
|
|
@@ -7634,7 +7596,7 @@ function useExportHandlers(input) {
|
|
|
7634
7596
|
exportStatusMessage
|
|
7635
7597
|
};
|
|
7636
7598
|
}
|
|
7637
|
-
var ViewerOptionsContext = react.createContext(
|
|
7599
|
+
var ViewerOptionsContext = react.createContext(chunkSN5EUDIT_js.DEFAULT_VIEWER_OPTIONS);
|
|
7638
7600
|
function useViewerOptionsContext() {
|
|
7639
7601
|
return react.useContext(ViewerOptionsContext);
|
|
7640
7602
|
}
|
|
@@ -7646,13 +7608,13 @@ function usePrintHandlers(input) {
|
|
|
7646
7608
|
const { t } = reactI18next.useTranslation();
|
|
7647
7609
|
const viewerOptions = useViewerOptionsContext();
|
|
7648
7610
|
const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
|
|
7649
|
-
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) *
|
|
7611
|
+
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunkSN5EUDIT_js.resolveImageResolutionScale(viewerOptions);
|
|
7650
7612
|
const handlePrint = () => {
|
|
7651
7613
|
setIsPrintDialogOpen(true);
|
|
7652
7614
|
};
|
|
7653
7615
|
const handlePrintSvg = async (settings) => {
|
|
7654
7616
|
setIsPrintDialogOpen(false);
|
|
7655
|
-
const printWindow =
|
|
7617
|
+
const printWindow = chunkSN5EUDIT_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7656
7618
|
if (!printWindow) {
|
|
7657
7619
|
console.warn(
|
|
7658
7620
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7662,9 +7624,9 @@ function usePrintHandlers(input) {
|
|
|
7662
7624
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7663
7625
|
return runRasterPrint(printWindow, settings);
|
|
7664
7626
|
}
|
|
7665
|
-
const colorFilter =
|
|
7666
|
-
const slideIndices =
|
|
7667
|
-
|
|
7627
|
+
const colorFilter = chunkSN5EUDIT_js.computeColorFilter(settings.colorMode);
|
|
7628
|
+
const slideIndices = chunkSN5EUDIT_js.filterHiddenSlideIndices(
|
|
7629
|
+
chunkSN5EUDIT_js.computeSlideIndices(
|
|
7668
7630
|
settings.slideRange,
|
|
7669
7631
|
activeSlideIndex,
|
|
7670
7632
|
slides.length,
|
|
@@ -7682,22 +7644,22 @@ function usePrintHandlers(input) {
|
|
|
7682
7644
|
printWindow.close();
|
|
7683
7645
|
return;
|
|
7684
7646
|
}
|
|
7685
|
-
const printDoc =
|
|
7647
|
+
const printDoc = chunkSN5EUDIT_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7686
7648
|
title: "Slides (Vector)",
|
|
7687
7649
|
orientation: settings.orientation,
|
|
7688
7650
|
colorFilter,
|
|
7689
7651
|
scaleToFit: settings.scaleToFit
|
|
7690
7652
|
});
|
|
7691
|
-
|
|
7653
|
+
chunkSN5EUDIT_js.finishPrintWindow(printWindow, printDoc);
|
|
7692
7654
|
} catch (err) {
|
|
7693
7655
|
console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
|
|
7694
7656
|
return runRasterPrint(printWindow, settings);
|
|
7695
7657
|
}
|
|
7696
7658
|
};
|
|
7697
7659
|
const runRasterPrint = async (printWindow, settings) => {
|
|
7698
|
-
const colorFilter =
|
|
7699
|
-
const slideIndices =
|
|
7700
|
-
|
|
7660
|
+
const colorFilter = chunkSN5EUDIT_js.computeColorFilter(settings.colorMode);
|
|
7661
|
+
const slideIndices = chunkSN5EUDIT_js.filterHiddenSlideIndices(
|
|
7662
|
+
chunkSN5EUDIT_js.computeSlideIndices(
|
|
7701
7663
|
settings.slideRange,
|
|
7702
7664
|
activeSlideIndex,
|
|
7703
7665
|
slides.length,
|
|
@@ -7708,11 +7670,11 @@ function usePrintHandlers(input) {
|
|
|
7708
7670
|
includeHiddenSlides
|
|
7709
7671
|
);
|
|
7710
7672
|
if (settings.printWhat === "outline") {
|
|
7711
|
-
|
|
7673
|
+
chunkSN5EUDIT_js.finishPrintWindow(
|
|
7712
7674
|
printWindow,
|
|
7713
|
-
|
|
7675
|
+
chunkSN5EUDIT_js.buildPrintHtmlDocument({
|
|
7714
7676
|
title: "Outline",
|
|
7715
|
-
bodyHtml: `<div class="outline-page">${
|
|
7677
|
+
bodyHtml: `<div class="outline-page">${chunkSN5EUDIT_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7716
7678
|
orientation: settings.orientation,
|
|
7717
7679
|
colorFilter,
|
|
7718
7680
|
frameSlides: settings.frameSlides,
|
|
@@ -7739,11 +7701,11 @@ function usePrintHandlers(input) {
|
|
|
7739
7701
|
}
|
|
7740
7702
|
const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
|
|
7741
7703
|
if (settings.printWhat === "slides") {
|
|
7742
|
-
|
|
7704
|
+
chunkSN5EUDIT_js.finishPrintWindow(
|
|
7743
7705
|
printWindow,
|
|
7744
|
-
|
|
7706
|
+
chunkSN5EUDIT_js.buildPrintHtmlDocument({
|
|
7745
7707
|
title: "Slides",
|
|
7746
|
-
bodyHtml:
|
|
7708
|
+
bodyHtml: chunkSN5EUDIT_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7747
7709
|
orientation: settings.orientation,
|
|
7748
7710
|
colorFilter,
|
|
7749
7711
|
frameSlides: settings.frameSlides,
|
|
@@ -7753,11 +7715,11 @@ function usePrintHandlers(input) {
|
|
|
7753
7715
|
return;
|
|
7754
7716
|
}
|
|
7755
7717
|
if (settings.printWhat === "notes") {
|
|
7756
|
-
|
|
7718
|
+
chunkSN5EUDIT_js.finishPrintWindow(
|
|
7757
7719
|
printWindow,
|
|
7758
|
-
|
|
7720
|
+
chunkSN5EUDIT_js.buildPrintHtmlDocument({
|
|
7759
7721
|
title: "Notes Pages",
|
|
7760
|
-
bodyHtml:
|
|
7722
|
+
bodyHtml: chunkSN5EUDIT_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7761
7723
|
orientation: "portrait",
|
|
7762
7724
|
colorFilter,
|
|
7763
7725
|
frameSlides: settings.frameSlides,
|
|
@@ -7768,11 +7730,11 @@ function usePrintHandlers(input) {
|
|
|
7768
7730
|
}
|
|
7769
7731
|
if (settings.printWhat === "handouts") {
|
|
7770
7732
|
const spp = settings.slidesPerPage;
|
|
7771
|
-
|
|
7733
|
+
chunkSN5EUDIT_js.finishPrintWindow(
|
|
7772
7734
|
printWindow,
|
|
7773
|
-
|
|
7735
|
+
chunkSN5EUDIT_js.buildPrintHtmlDocument({
|
|
7774
7736
|
title: `Handout ${spp} per page`,
|
|
7775
|
-
bodyHtml:
|
|
7737
|
+
bodyHtml: chunkSN5EUDIT_js.buildHandoutsHtml(slideImages, slideIndices, spp, pptxData?.handoutMaster),
|
|
7776
7738
|
orientation: "portrait",
|
|
7777
7739
|
colorFilter,
|
|
7778
7740
|
frameSlides: settings.frameSlides,
|
|
@@ -7786,7 +7748,7 @@ function usePrintHandlers(input) {
|
|
|
7786
7748
|
};
|
|
7787
7749
|
const handlePrintWithSettings = async (settings) => {
|
|
7788
7750
|
setIsPrintDialogOpen(false);
|
|
7789
|
-
const printWindow =
|
|
7751
|
+
const printWindow = chunkSN5EUDIT_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7790
7752
|
if (!printWindow) {
|
|
7791
7753
|
console.warn(
|
|
7792
7754
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7851,13 +7813,13 @@ function useThemeHandlers(input) {
|
|
|
7851
7813
|
return;
|
|
7852
7814
|
}
|
|
7853
7815
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7854
|
-
const previousMap = theme?.colorScheme ?
|
|
7855
|
-
setSlides((prev) =>
|
|
7816
|
+
const previousMap = theme?.colorScheme ? chunkSN5EUDIT_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7817
|
+
setSlides((prev) => chunkSN5EUDIT_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7856
7818
|
if (Object.keys(templateElementsBySlideId).length > 0) {
|
|
7857
7819
|
setTemplateElementsBySlideId((prev) => {
|
|
7858
7820
|
const next = {};
|
|
7859
7821
|
for (const [slideId, elements] of Object.entries(prev)) {
|
|
7860
|
-
next[slideId] =
|
|
7822
|
+
next[slideId] = chunkSN5EUDIT_js.reResolveElementColors(elements, previousMap, colorScheme);
|
|
7861
7823
|
}
|
|
7862
7824
|
return next;
|
|
7863
7825
|
});
|
|
@@ -7966,7 +7928,7 @@ function useThemeSwitching(input) {
|
|
|
7966
7928
|
}
|
|
7967
7929
|
try {
|
|
7968
7930
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7969
|
-
const newData =
|
|
7931
|
+
const newData = chunkSN5EUDIT_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7970
7932
|
onDataChange(newData);
|
|
7971
7933
|
onThemeChanged?.(preset);
|
|
7972
7934
|
} catch (error) {
|
|
@@ -7983,7 +7945,7 @@ function useThemeSwitching(input) {
|
|
|
7983
7945
|
}
|
|
7984
7946
|
try {
|
|
7985
7947
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7986
|
-
const newData =
|
|
7948
|
+
const newData = chunkSN5EUDIT_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7987
7949
|
onDataChange(newData);
|
|
7988
7950
|
} catch (error) {
|
|
7989
7951
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7995,12 +7957,12 @@ function useThemeSwitching(input) {
|
|
|
7995
7957
|
if (!data?.theme?.colorScheme) {
|
|
7996
7958
|
return void 0;
|
|
7997
7959
|
}
|
|
7998
|
-
return
|
|
7999
|
-
(p) =>
|
|
7960
|
+
return chunkSN5EUDIT_js.THEME_PRESETS.find(
|
|
7961
|
+
(p) => chunkSN5EUDIT_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
8000
7962
|
);
|
|
8001
7963
|
}, [data?.theme?.colorScheme]);
|
|
8002
7964
|
return {
|
|
8003
|
-
presets:
|
|
7965
|
+
presets: chunkSN5EUDIT_js.THEME_PRESETS,
|
|
8004
7966
|
switchToPreset,
|
|
8005
7967
|
switchToCustom,
|
|
8006
7968
|
currentPreset
|
|
@@ -8075,7 +8037,7 @@ function usePropertyHandlers(input) {
|
|
|
8075
8037
|
}
|
|
8076
8038
|
try {
|
|
8077
8039
|
const ab = await file.arrayBuffer();
|
|
8078
|
-
const h = new
|
|
8040
|
+
const h = new chunkSN5EUDIT_js.PptxHandler();
|
|
8079
8041
|
const other = await h.load(ab);
|
|
8080
8042
|
if (!other) {
|
|
8081
8043
|
return;
|
|
@@ -8085,7 +8047,7 @@ function usePropertyHandlers(input) {
|
|
|
8085
8047
|
width: canvasSize.width,
|
|
8086
8048
|
height: canvasSize.height
|
|
8087
8049
|
};
|
|
8088
|
-
setCompareResult(
|
|
8050
|
+
setCompareResult(chunkSN5EUDIT_js.comparePresentation(cur, other));
|
|
8089
8051
|
setIsComparePanelOpen(true);
|
|
8090
8052
|
} catch (err) {
|
|
8091
8053
|
console.warn("Compare failed:", err);
|
|
@@ -8102,7 +8064,7 @@ function usePropertyHandlers(input) {
|
|
|
8102
8064
|
if (!diff || diff.status === "unchanged") {
|
|
8103
8065
|
return;
|
|
8104
8066
|
}
|
|
8105
|
-
setSlides((prev) =>
|
|
8067
|
+
setSlides((prev) => chunkSN5EUDIT_js.applyAcceptSlide(prev, diff));
|
|
8106
8068
|
setIsDirty(true);
|
|
8107
8069
|
},
|
|
8108
8070
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -8113,10 +8075,10 @@ function usePropertyHandlers(input) {
|
|
|
8113
8075
|
if (!compareResult) {
|
|
8114
8076
|
return;
|
|
8115
8077
|
}
|
|
8116
|
-
setSlides((prev) =>
|
|
8078
|
+
setSlides((prev) => chunkSN5EUDIT_js.applyAcceptAllSlides(prev, compareResult));
|
|
8117
8079
|
setIsDirty(true);
|
|
8118
8080
|
}, [compareResult, setSlides, setIsDirty]);
|
|
8119
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
8081
|
+
const usedFontFamilies = react.useMemo(() => chunkSN5EUDIT_js.collectUsedFonts(slides), [slides]);
|
|
8120
8082
|
return {
|
|
8121
8083
|
handleUpdateNotes,
|
|
8122
8084
|
handleUpdateSlide,
|
|
@@ -8271,7 +8233,7 @@ function useViewerDialogs(input) {
|
|
|
8271
8233
|
);
|
|
8272
8234
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8273
8235
|
const fontEmbedding = react.useMemo(
|
|
8274
|
-
() =>
|
|
8236
|
+
() => chunkSN5EUDIT_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8275
8237
|
[embeddedFontKey]
|
|
8276
8238
|
);
|
|
8277
8239
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8281,11 +8243,11 @@ function useViewerDialogs(input) {
|
|
|
8281
8243
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8282
8244
|
}
|
|
8283
8245
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8284
|
-
() => typeof window !== "undefined" ?
|
|
8246
|
+
() => typeof window !== "undefined" ? chunkSN5EUDIT_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8285
8247
|
);
|
|
8286
8248
|
react.useEffect(() => {
|
|
8287
8249
|
const handleWindow = () => setIsNarrowViewport(
|
|
8288
|
-
|
|
8250
|
+
chunkSN5EUDIT_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8289
8251
|
);
|
|
8290
8252
|
window.addEventListener("resize", handleWindow);
|
|
8291
8253
|
return () => window.removeEventListener("resize", handleWindow);
|
|
@@ -8438,16 +8400,16 @@ function useViewerDialogs(input) {
|
|
|
8438
8400
|
};
|
|
8439
8401
|
}
|
|
8440
8402
|
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8441
|
-
return
|
|
8403
|
+
return chunkSN5EUDIT_js.computeGridSpacingPx(documentGridSpacing, chunkQWA5YEIZ_js.GRID_SIZE);
|
|
8442
8404
|
}
|
|
8443
8405
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
8444
8406
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8445
|
-
const authoredRange =
|
|
8446
|
-
return
|
|
8407
|
+
const authoredRange = chunkSN5EUDIT_js.resolveAuthoredSlideRange(presentationProperties, slides.length);
|
|
8408
|
+
return chunkSN5EUDIT_js.resolveShowSlideIndexes(slides, activeShow, authoredRange);
|
|
8447
8409
|
}
|
|
8448
8410
|
function computeSlideSectionGroups(slides, sections) {
|
|
8449
|
-
return
|
|
8450
|
-
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),
|
|
8451
8413
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8452
8414
|
slideIndexes: group.slideIndexes,
|
|
8453
8415
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8459,7 +8421,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8459
8421
|
return void 0;
|
|
8460
8422
|
}
|
|
8461
8423
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8462
|
-
return
|
|
8424
|
+
return chunkSN5EUDIT_js.masterViewPseudoSlide(document2, {
|
|
8463
8425
|
tab: "slides",
|
|
8464
8426
|
masterIndex: 0,
|
|
8465
8427
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8487,15 +8449,15 @@ function useDerivedSlideState(input) {
|
|
|
8487
8449
|
[slides, activeCustomShowId, customShows, presentationProperties]
|
|
8488
8450
|
);
|
|
8489
8451
|
const authoredRange = react.useMemo(
|
|
8490
|
-
() =>
|
|
8452
|
+
() => chunkSN5EUDIT_js.resolveAuthoredSlideRange(presentationProperties, slides.length),
|
|
8491
8453
|
[presentationProperties, slides.length]
|
|
8492
8454
|
);
|
|
8493
8455
|
const slideSectionGroups = react.useMemo(
|
|
8494
8456
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8495
|
-
if (group.id ===
|
|
8457
|
+
if (group.id === chunkQWA5YEIZ_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8496
8458
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8497
8459
|
}
|
|
8498
|
-
if (group.id ===
|
|
8460
|
+
if (group.id === chunkQWA5YEIZ_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8499
8461
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8500
8462
|
}
|
|
8501
8463
|
return group;
|
|
@@ -8596,13 +8558,13 @@ function useAnnotationHandlers(input) {
|
|
|
8596
8558
|
}, [annotations, setMode, setSlides, history]);
|
|
8597
8559
|
const handleSetMode = react.useCallback(
|
|
8598
8560
|
(nextMode) => {
|
|
8599
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8561
|
+
if (mode === "present" && nextMode !== "present" && !chunkSN5EUDIT_js.mayLeaveSlideShow()) {
|
|
8600
8562
|
return;
|
|
8601
8563
|
}
|
|
8602
8564
|
if (nextMode === "present") {
|
|
8603
8565
|
presentation.enterPresentMode();
|
|
8604
8566
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8605
|
-
|
|
8567
|
+
chunkSN5EUDIT_js.stopAllPersistentAudio();
|
|
8606
8568
|
if (promptKeepInkAnnotations) {
|
|
8607
8569
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8608
8570
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8612,7 +8574,7 @@ function useAnnotationHandlers(input) {
|
|
|
8612
8574
|
}
|
|
8613
8575
|
} else {
|
|
8614
8576
|
if (mode === "present") {
|
|
8615
|
-
|
|
8577
|
+
chunkSN5EUDIT_js.stopAllPersistentAudio();
|
|
8616
8578
|
}
|
|
8617
8579
|
setMode(nextMode);
|
|
8618
8580
|
}
|
|
@@ -8650,6 +8612,9 @@ function useSerialize(input) {
|
|
|
8650
8612
|
headerFooter,
|
|
8651
8613
|
presentationProperties,
|
|
8652
8614
|
viewProperties,
|
|
8615
|
+
tableStyleMap,
|
|
8616
|
+
tableStylesDefaultId,
|
|
8617
|
+
tableStylesToDelete = [],
|
|
8653
8618
|
customShows,
|
|
8654
8619
|
sections,
|
|
8655
8620
|
coreProperties,
|
|
@@ -8666,90 +8631,100 @@ function useSerialize(input) {
|
|
|
8666
8631
|
embedFonts = true,
|
|
8667
8632
|
purpose
|
|
8668
8633
|
} = input;
|
|
8669
|
-
return react.useCallback(
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
|
|
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 };
|
|
8682
8657
|
}
|
|
8683
|
-
return {
|
|
8684
|
-
...el,
|
|
8685
|
-
text: pendingEditText,
|
|
8686
|
-
textSegments: chunkDCNHUEWQ_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8687
|
-
};
|
|
8688
|
-
});
|
|
8689
|
-
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
8690
|
-
processedSlide = { ...slide, elements: updatedElements };
|
|
8691
8658
|
}
|
|
8692
|
-
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
|
|
8699
|
-
|
|
8700
|
-
|
|
8701
|
-
|
|
8702
|
-
|
|
8703
|
-
|
|
8704
|
-
};
|
|
8705
|
-
|
|
8706
|
-
|
|
8707
|
-
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
|
|
8711
|
-
|
|
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,
|
|
8712
8703
|
headerFooter,
|
|
8713
8704
|
presentationProperties,
|
|
8714
8705
|
viewProperties,
|
|
8715
|
-
|
|
8716
|
-
|
|
8706
|
+
tableStyleMap,
|
|
8707
|
+
tableStylesDefaultId,
|
|
8708
|
+
tableStylesToDelete,
|
|
8709
|
+
customShows,
|
|
8710
|
+
sections,
|
|
8717
8711
|
coreProperties,
|
|
8718
8712
|
appProperties,
|
|
8719
|
-
customProperties
|
|
8720
|
-
|
|
8713
|
+
customProperties,
|
|
8714
|
+
tagCollections,
|
|
8721
8715
|
slideMasters,
|
|
8722
8716
|
notesMaster,
|
|
8723
8717
|
handoutMaster,
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
|
|
8727
|
-
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
viewProperties,
|
|
8735
|
-
customShows,
|
|
8736
|
-
sections,
|
|
8737
|
-
coreProperties,
|
|
8738
|
-
appProperties,
|
|
8739
|
-
customProperties,
|
|
8740
|
-
tagCollections,
|
|
8741
|
-
slideMasters,
|
|
8742
|
-
notesMaster,
|
|
8743
|
-
handoutMaster,
|
|
8744
|
-
guides,
|
|
8745
|
-
activeSlideIndex,
|
|
8746
|
-
handlerRef,
|
|
8747
|
-
inlineEditingElementIdRef,
|
|
8748
|
-
inlineEditingTextRef,
|
|
8749
|
-
password,
|
|
8750
|
-
embedFonts,
|
|
8751
|
-
purpose
|
|
8752
|
-
]);
|
|
8718
|
+
guides,
|
|
8719
|
+
activeSlideIndex,
|
|
8720
|
+
handlerRef,
|
|
8721
|
+
inlineEditingElementIdRef,
|
|
8722
|
+
inlineEditingTextRef,
|
|
8723
|
+
password,
|
|
8724
|
+
embedFonts,
|
|
8725
|
+
purpose
|
|
8726
|
+
]
|
|
8727
|
+
);
|
|
8753
8728
|
}
|
|
8754
8729
|
function useRecoveryDetection(input) {
|
|
8755
8730
|
const { filePath, loading, error, slideCount, autosaveAllowed = true } = input;
|
|
@@ -8759,7 +8734,7 @@ function useRecoveryDetection(input) {
|
|
|
8759
8734
|
const onRestore = input.onRestore;
|
|
8760
8735
|
const openVersionHistory = input.openVersionHistory;
|
|
8761
8736
|
react.useEffect(() => {
|
|
8762
|
-
if (!
|
|
8737
|
+
if (!chunkSN5EUDIT_js.shouldProbeAutosaveRecovery({
|
|
8763
8738
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8764
8739
|
filePath,
|
|
8765
8740
|
loading,
|
|
@@ -8771,7 +8746,7 @@ function useRecoveryDetection(input) {
|
|
|
8771
8746
|
}
|
|
8772
8747
|
recoveryCheckedRef.current = true;
|
|
8773
8748
|
void (async () => {
|
|
8774
|
-
const offer = await
|
|
8749
|
+
const offer = await chunkSN5EUDIT_js.probeAutosaveRecovery(filePath);
|
|
8775
8750
|
if (!offer) {
|
|
8776
8751
|
return;
|
|
8777
8752
|
}
|
|
@@ -8784,7 +8759,7 @@ function useRecoveryDetection(input) {
|
|
|
8784
8759
|
const record = recordRef.current;
|
|
8785
8760
|
setPrompt(null);
|
|
8786
8761
|
if (record && onRestore) {
|
|
8787
|
-
onRestore(
|
|
8762
|
+
onRestore(chunkSN5EUDIT_js.acceptAutosaveRecovery(record));
|
|
8788
8763
|
}
|
|
8789
8764
|
recordRef.current = null;
|
|
8790
8765
|
}, [onRestore]);
|
|
@@ -8793,7 +8768,7 @@ function useRecoveryDetection(input) {
|
|
|
8793
8768
|
setPrompt(null);
|
|
8794
8769
|
recordRef.current = null;
|
|
8795
8770
|
if (record) {
|
|
8796
|
-
void
|
|
8771
|
+
void chunkSN5EUDIT_js.discardAutosaveRecovery(record);
|
|
8797
8772
|
}
|
|
8798
8773
|
}, []);
|
|
8799
8774
|
return { prompt, restore, discard };
|
|
@@ -8837,11 +8812,11 @@ function usePresentationSetup(input) {
|
|
|
8837
8812
|
containerRef,
|
|
8838
8813
|
content,
|
|
8839
8814
|
onSetMode: (nextMode) => {
|
|
8840
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8815
|
+
if (mode === "present" && nextMode !== "present" && !chunkSN5EUDIT_js.mayLeaveSlideShow()) {
|
|
8841
8816
|
return;
|
|
8842
8817
|
}
|
|
8843
8818
|
if (mode === "present" && nextMode !== "present") {
|
|
8844
|
-
|
|
8819
|
+
chunkSN5EUDIT_js.stopAllPersistentAudio();
|
|
8845
8820
|
stopAnimationSound();
|
|
8846
8821
|
const exitHandler = exitModeHandlerRef.current;
|
|
8847
8822
|
if (exitHandler) {
|
|
@@ -8909,10 +8884,10 @@ function usePresentationSetup(input) {
|
|
|
8909
8884
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8910
8885
|
onToggleSubtitles,
|
|
8911
8886
|
onSaveRehearsalTimings: (timings) => {
|
|
8912
|
-
setSlides((prev) =>
|
|
8887
|
+
setSlides((prev) => chunkSN5EUDIT_js.applyRehearsalTimings(prev, timings));
|
|
8913
8888
|
history.markDirty();
|
|
8914
8889
|
},
|
|
8915
|
-
loopContinuously:
|
|
8890
|
+
loopContinuously: chunkSN5EUDIT_js.shouldLoopContinuously(presentationProperties),
|
|
8916
8891
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8917
8892
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8918
8893
|
endWithBlackSlide,
|
|
@@ -9118,7 +9093,7 @@ function useEditorOperations(input) {
|
|
|
9118
9093
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9119
9094
|
react.useEffect(() => {
|
|
9120
9095
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9121
|
-
copiedFormatRef.current =
|
|
9096
|
+
copiedFormatRef.current = chunkSN5EUDIT_js.copyFormatFromElement(selectedElement);
|
|
9122
9097
|
} else if (!formatPainterActive) {
|
|
9123
9098
|
copiedFormatRef.current = null;
|
|
9124
9099
|
}
|
|
@@ -9144,12 +9119,12 @@ function useEditorOperations(input) {
|
|
|
9144
9119
|
e.stopPropagation();
|
|
9145
9120
|
const element = elementLookup.get(elementId);
|
|
9146
9121
|
if (element) {
|
|
9147
|
-
const updated =
|
|
9122
|
+
const updated = chunkSN5EUDIT_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9148
9123
|
const updates = {};
|
|
9149
|
-
if (
|
|
9124
|
+
if (chunkSN5EUDIT_js.hasShapeProperties(updated)) {
|
|
9150
9125
|
updates.shapeStyle = updated.shapeStyle;
|
|
9151
9126
|
}
|
|
9152
|
-
if (
|
|
9127
|
+
if (chunkSN5EUDIT_js.hasTextProperties(updated)) {
|
|
9153
9128
|
updates.textStyle = updated.textStyle;
|
|
9154
9129
|
}
|
|
9155
9130
|
ops.updateElementById(elementId, updates);
|
|
@@ -9196,10 +9171,10 @@ function useIOHandlers(input) {
|
|
|
9196
9171
|
ops,
|
|
9197
9172
|
zoom,
|
|
9198
9173
|
handlerRef,
|
|
9174
|
+
serializeSlides,
|
|
9199
9175
|
serializeForRecovery,
|
|
9200
9176
|
setContent,
|
|
9201
9177
|
onContentChange,
|
|
9202
|
-
password,
|
|
9203
9178
|
imageExportScale
|
|
9204
9179
|
} = input;
|
|
9205
9180
|
const exportHandlers = useExportHandlers({
|
|
@@ -9210,24 +9185,20 @@ function useIOHandlers(input) {
|
|
|
9210
9185
|
filePath,
|
|
9211
9186
|
canvasStageRef: zoom.canvasStageRef,
|
|
9212
9187
|
setActiveSlideIndex: state.setActiveSlideIndex,
|
|
9213
|
-
|
|
9188
|
+
serializeSlides,
|
|
9214
9189
|
headerFooter: state.headerFooter,
|
|
9215
9190
|
presentationProperties: state.presentationProperties,
|
|
9216
9191
|
customShows: state.customShows,
|
|
9217
9192
|
sections: state.sections,
|
|
9218
|
-
coreProperties: state.coreProperties
|
|
9219
|
-
appProperties: state.appProperties
|
|
9193
|
+
coreProperties: state.coreProperties,
|
|
9194
|
+
appProperties: state.appProperties,
|
|
9220
9195
|
customProperties: state.customProperties,
|
|
9221
9196
|
tagCollections: state.tagCollections,
|
|
9222
|
-
slideMasters: state.slideMasters,
|
|
9223
9197
|
notesMaster: state.notesMaster,
|
|
9224
9198
|
handoutMaster: state.handoutMaster,
|
|
9225
|
-
guides: state.guides,
|
|
9226
|
-
activeSlideIndexForGuides: state.activeSlideIndex,
|
|
9227
9199
|
theme: state.theme,
|
|
9228
9200
|
canvasSize,
|
|
9229
9201
|
slideSizeEmu: state.slideSizeEmu,
|
|
9230
|
-
password,
|
|
9231
9202
|
imageExportScale
|
|
9232
9203
|
});
|
|
9233
9204
|
const printHandlers = usePrintHandlers({
|
|
@@ -9337,10 +9308,10 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9337
9308
|
}
|
|
9338
9309
|
};
|
|
9339
9310
|
}, [embeddedFonts]);
|
|
9340
|
-
const referencedFamilies = react.useMemo(() =>
|
|
9311
|
+
const referencedFamilies = react.useMemo(() => chunkSN5EUDIT_js.collectReferencedFontFamilies(slides), [slides]);
|
|
9341
9312
|
react.useEffect(() => {
|
|
9342
9313
|
let cancelled = false;
|
|
9343
|
-
void
|
|
9314
|
+
void chunkSN5EUDIT_js.resolveGoogleWebfontHref(slides, embeddedFonts).then((href) => {
|
|
9344
9315
|
if (cancelled) {
|
|
9345
9316
|
return null;
|
|
9346
9317
|
}
|
|
@@ -9426,6 +9397,8 @@ function useContentLifecycle(input) {
|
|
|
9426
9397
|
setRecentColors: state.setRecentColors,
|
|
9427
9398
|
setTheme: state.setTheme,
|
|
9428
9399
|
setTableStyleMap: state.setTableStyleMap,
|
|
9400
|
+
setTableStylesDefaultId: state.setTableStylesDefaultId,
|
|
9401
|
+
setTableStylesToDelete: state.setTableStylesToDelete,
|
|
9429
9402
|
setThemeOptions: state.setThemeOptions,
|
|
9430
9403
|
setCustomShows: state.setCustomShows,
|
|
9431
9404
|
setActiveCustomShowId: state.setActiveCustomShowId,
|
|
@@ -9468,6 +9441,9 @@ function useContentLifecycle(input) {
|
|
|
9468
9441
|
headerFooter: state.headerFooter,
|
|
9469
9442
|
presentationProperties: state.presentationProperties,
|
|
9470
9443
|
viewProperties: state.viewProperties,
|
|
9444
|
+
tableStyleMap: state.tableStyleMap,
|
|
9445
|
+
tableStylesDefaultId: state.tableStylesDefaultId,
|
|
9446
|
+
tableStylesToDelete: state.tableStylesToDelete,
|
|
9471
9447
|
customShows: state.customShows,
|
|
9472
9448
|
sections: state.sections,
|
|
9473
9449
|
coreProperties: state.coreProperties,
|
|
@@ -9523,7 +9499,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9523
9499
|
inputRef.current = input;
|
|
9524
9500
|
const handleKeyDown = react.useCallback((e) => {
|
|
9525
9501
|
const current = inputRef.current;
|
|
9526
|
-
const startAction =
|
|
9502
|
+
const startAction = chunkSN5EUDIT_js.mapSlideShowStartKey(e, { isPresenting: current.mode === "present" });
|
|
9527
9503
|
if (startAction !== null) {
|
|
9528
9504
|
e.preventDefault();
|
|
9529
9505
|
if (startAction === "fromBeginning") {
|
|
@@ -9533,7 +9509,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9533
9509
|
}
|
|
9534
9510
|
return;
|
|
9535
9511
|
}
|
|
9536
|
-
const { action, dx, dy } =
|
|
9512
|
+
const { action, dx, dy } = chunkSN5EUDIT_js.mapEditorKey(e, {
|
|
9537
9513
|
canEdit: current.canEdit,
|
|
9538
9514
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9539
9515
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9546,7 +9522,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9546
9522
|
hasSelection: current.hasSelection,
|
|
9547
9523
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9548
9524
|
isDrawing: current.activeTool !== "select",
|
|
9549
|
-
isTextInputTarget:
|
|
9525
|
+
isTextInputTarget: chunkSN5EUDIT_js.isEditorTextInputTarget(e.target)
|
|
9550
9526
|
});
|
|
9551
9527
|
if (action === null) {
|
|
9552
9528
|
return;
|
|
@@ -9801,10 +9777,10 @@ function useViewerIntegration(input) {
|
|
|
9801
9777
|
ops: editorOps.ops,
|
|
9802
9778
|
zoom,
|
|
9803
9779
|
handlerRef,
|
|
9780
|
+
serializeSlides,
|
|
9804
9781
|
serializeForRecovery,
|
|
9805
9782
|
setContent,
|
|
9806
9783
|
onContentChange,
|
|
9807
|
-
password: dialogs.presentationPassword ?? void 0,
|
|
9808
9784
|
imageExportScale
|
|
9809
9785
|
});
|
|
9810
9786
|
const {
|
|
@@ -9874,7 +9850,7 @@ function useViewerIntegration(input) {
|
|
|
9874
9850
|
return zoom.scale;
|
|
9875
9851
|
},
|
|
9876
9852
|
setZoom(level) {
|
|
9877
|
-
zoom.setScale(
|
|
9853
|
+
zoom.setScale(chunkSN5EUDIT_js.clampZoomScale(level));
|
|
9878
9854
|
},
|
|
9879
9855
|
zoomIn() {
|
|
9880
9856
|
zoom.handleZoomIn();
|
|
@@ -10092,7 +10068,7 @@ function useReducedMotion() {
|
|
|
10092
10068
|
}
|
|
10093
10069
|
function useViewerOptions() {
|
|
10094
10070
|
const storeRef = react.useRef(null);
|
|
10095
|
-
storeRef.current ??=
|
|
10071
|
+
storeRef.current ??= chunkSN5EUDIT_js.createViewerOptionsStore();
|
|
10096
10072
|
const store = storeRef.current;
|
|
10097
10073
|
const options = react.useSyncExternalStore(
|
|
10098
10074
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -10101,9 +10077,9 @@ function useViewerOptions() {
|
|
|
10101
10077
|
);
|
|
10102
10078
|
return { optionsStore: store, options };
|
|
10103
10079
|
}
|
|
10104
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10080
|
+
var KNOWN_TAB_IDS = new Set(chunkSN5EUDIT_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10105
10081
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
10106
|
-
const isHidden = (id) =>
|
|
10082
|
+
const isHidden = (id) => chunkSN5EUDIT_js.isActionHidden(id, hiddenActions);
|
|
10107
10083
|
const userHidden = new Set(hiddenTabIds);
|
|
10108
10084
|
userHidden.delete("file");
|
|
10109
10085
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
|
|
@@ -10155,6 +10131,7 @@ function useYjsDocumentSync({
|
|
|
10155
10131
|
isSynced = true,
|
|
10156
10132
|
config,
|
|
10157
10133
|
getSourceBytes,
|
|
10134
|
+
getSaveOptions,
|
|
10158
10135
|
loadVersion = 0,
|
|
10159
10136
|
loadOrigin = "user"
|
|
10160
10137
|
}) {
|
|
@@ -10195,18 +10172,18 @@ function useYjsDocumentSync({
|
|
|
10195
10172
|
return;
|
|
10196
10173
|
}
|
|
10197
10174
|
try {
|
|
10198
|
-
const handler = new
|
|
10175
|
+
const handler = new chunkSN5EUDIT_js.PptxHandler();
|
|
10199
10176
|
await handler.load(sourceBytes.buffer);
|
|
10200
|
-
const currentSlides =
|
|
10177
|
+
const currentSlides = chunkSN5EUDIT_js.readSlidesFromYDoc(
|
|
10201
10178
|
doc
|
|
10202
10179
|
);
|
|
10203
|
-
const slidesToSave =
|
|
10204
|
-
const bytes = await handler.save(slidesToSave);
|
|
10180
|
+
const slidesToSave = chunkSN5EUDIT_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10181
|
+
const bytes = await handler.save(slidesToSave, getSaveOptions?.());
|
|
10205
10182
|
config.onWriteBack(bytes);
|
|
10206
10183
|
} catch {
|
|
10207
10184
|
}
|
|
10208
10185
|
}, debounceMs);
|
|
10209
|
-
}, [doc, config, getSourceBytes, templateElementsBySlideId]);
|
|
10186
|
+
}, [doc, config, getSourceBytes, getSaveOptions, templateElementsBySlideId]);
|
|
10210
10187
|
react.useEffect(() => {
|
|
10211
10188
|
if (loadVersion === lastLoadVersionRef.current) {
|
|
10212
10189
|
return;
|
|
@@ -10215,10 +10192,10 @@ function useYjsDocumentSync({
|
|
|
10215
10192
|
if (!doc || !isConnected) {
|
|
10216
10193
|
return;
|
|
10217
10194
|
}
|
|
10218
|
-
const docSlides =
|
|
10195
|
+
const docSlides = chunkSN5EUDIT_js.readSlidesFromYDoc(
|
|
10219
10196
|
doc
|
|
10220
10197
|
);
|
|
10221
|
-
if (!
|
|
10198
|
+
if (!chunkSN5EUDIT_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10222
10199
|
return;
|
|
10223
10200
|
}
|
|
10224
10201
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10237,11 +10214,11 @@ function useYjsDocumentSync({
|
|
|
10237
10214
|
lastSyncedRef.current = serialized;
|
|
10238
10215
|
void (async () => {
|
|
10239
10216
|
const factories = await getFactories();
|
|
10240
|
-
|
|
10217
|
+
chunkSN5EUDIT_js.reconcileSlidesInYDoc(
|
|
10241
10218
|
slides,
|
|
10242
10219
|
doc,
|
|
10243
10220
|
factories,
|
|
10244
|
-
|
|
10221
|
+
chunkSN5EUDIT_js.LOCAL_SYNC_ORIGIN
|
|
10245
10222
|
);
|
|
10246
10223
|
scheduleWriteBack();
|
|
10247
10224
|
})();
|
|
@@ -10255,10 +10232,10 @@ function useYjsDocumentSync({
|
|
|
10255
10232
|
return;
|
|
10256
10233
|
}
|
|
10257
10234
|
const handleChange = (_events, transaction) => {
|
|
10258
|
-
if (transaction?.origin ===
|
|
10235
|
+
if (transaction?.origin === chunkSN5EUDIT_js.LOCAL_SYNC_ORIGIN) {
|
|
10259
10236
|
return;
|
|
10260
10237
|
}
|
|
10261
|
-
const remoteSlides =
|
|
10238
|
+
const remoteSlides = chunkSN5EUDIT_js.readSlidesFromYDoc(
|
|
10262
10239
|
doc
|
|
10263
10240
|
);
|
|
10264
10241
|
if (remoteSlides.length === 0) {
|
|
@@ -10274,7 +10251,7 @@ function useYjsDocumentSync({
|
|
|
10274
10251
|
isApplyingRemoteRef.current = false;
|
|
10275
10252
|
scheduleWriteBack();
|
|
10276
10253
|
};
|
|
10277
|
-
const unobserve =
|
|
10254
|
+
const unobserve = chunkSN5EUDIT_js.observeYDocSlides(
|
|
10278
10255
|
doc,
|
|
10279
10256
|
handleChange
|
|
10280
10257
|
);
|
|
@@ -10312,7 +10289,7 @@ function useBroadcastFollower({
|
|
|
10312
10289
|
if (!broadcaster) {
|
|
10313
10290
|
return;
|
|
10314
10291
|
}
|
|
10315
|
-
if (!
|
|
10292
|
+
if (!chunkSN5EUDIT_js.shouldAutoFollowBroadcaster({
|
|
10316
10293
|
localRole: collab.config.role,
|
|
10317
10294
|
broadcasterRole: broadcaster.role
|
|
10318
10295
|
})) {
|
|
@@ -10483,7 +10460,7 @@ function subscribeTouchCapability(callback) {
|
|
|
10483
10460
|
function useIsMobile() {
|
|
10484
10461
|
const isTouchDevice = react.useSyncExternalStore(
|
|
10485
10462
|
subscribeTouchCapability,
|
|
10486
|
-
|
|
10463
|
+
chunkSN5EUDIT_js.detectTouchDevice,
|
|
10487
10464
|
() => false
|
|
10488
10465
|
// server snapshot
|
|
10489
10466
|
);
|
|
@@ -10493,7 +10470,7 @@ function useIsMobile() {
|
|
|
10493
10470
|
const [viewportHeight, setViewportHeight] = react.useState(
|
|
10494
10471
|
() => typeof window === "undefined" ? 768 : window.innerHeight
|
|
10495
10472
|
);
|
|
10496
|
-
const [orientation, setOrientation] = react.useState(
|
|
10473
|
+
const [orientation, setOrientation] = react.useState(chunkSN5EUDIT_js.detectOrientation);
|
|
10497
10474
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
10498
10475
|
const [initialViewportHeight] = react.useState(
|
|
10499
10476
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -10514,7 +10491,7 @@ function useIsMobile() {
|
|
|
10514
10491
|
return;
|
|
10515
10492
|
}
|
|
10516
10493
|
const handleOrientationChange = () => {
|
|
10517
|
-
setOrientation(
|
|
10494
|
+
setOrientation(chunkSN5EUDIT_js.detectOrientation());
|
|
10518
10495
|
};
|
|
10519
10496
|
if (screen.orientation) {
|
|
10520
10497
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -10544,7 +10521,7 @@ function useIsMobile() {
|
|
|
10544
10521
|
window.addEventListener("resize", handleResize);
|
|
10545
10522
|
return () => window.removeEventListener("resize", handleResize);
|
|
10546
10523
|
}, [isTouchDevice, initialViewportHeight]);
|
|
10547
|
-
const { isMobile, isTablet, isDesktop } =
|
|
10524
|
+
const { isMobile, isTablet, isDesktop } = chunkSN5EUDIT_js.deriveViewportBreakpoints(
|
|
10548
10525
|
viewportWidth,
|
|
10549
10526
|
viewportHeight,
|
|
10550
10527
|
isTouchDevice
|
|
@@ -10575,10 +10552,10 @@ function useTouchGestures(input) {
|
|
|
10575
10552
|
if (!el || !enabled) {
|
|
10576
10553
|
return;
|
|
10577
10554
|
}
|
|
10578
|
-
const recognizer =
|
|
10555
|
+
const recognizer = chunkSN5EUDIT_js.createTouchGestureRecognizer({
|
|
10579
10556
|
getScale: () => scaleRef.current,
|
|
10580
|
-
minScale:
|
|
10581
|
-
maxScale:
|
|
10557
|
+
minScale: chunkSN5EUDIT_js.MIN_ZOOM_SCALE,
|
|
10558
|
+
maxScale: chunkSN5EUDIT_js.MAX_ZOOM_SCALE,
|
|
10582
10559
|
callbacks: {
|
|
10583
10560
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10584
10561
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10618,7 +10595,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10618
10595
|
return;
|
|
10619
10596
|
}
|
|
10620
10597
|
const rect = active.getBoundingClientRect();
|
|
10621
|
-
const delta =
|
|
10598
|
+
const delta = chunkSN5EUDIT_js.computeScrollDelta(
|
|
10622
10599
|
{ top: rect.top, bottom: rect.bottom },
|
|
10623
10600
|
window.innerHeight,
|
|
10624
10601
|
keyboardInset
|
|
@@ -10638,8 +10615,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10638
10615
|
return;
|
|
10639
10616
|
}
|
|
10640
10617
|
const update = () => {
|
|
10641
|
-
const metrics =
|
|
10642
|
-
const inset = metrics ?
|
|
10618
|
+
const metrics = chunkSN5EUDIT_js.readViewportMetrics(window);
|
|
10619
|
+
const inset = metrics ? chunkSN5EUDIT_js.computeKeyboardInset(metrics) : 0;
|
|
10643
10620
|
setKeyboardInset(inset);
|
|
10644
10621
|
if (inset > 0) {
|
|
10645
10622
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10650,8 +10627,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10650
10627
|
vv.addEventListener("scroll", update);
|
|
10651
10628
|
const onFocusIn = () => {
|
|
10652
10629
|
window.requestAnimationFrame(() => {
|
|
10653
|
-
const metrics =
|
|
10654
|
-
const inset = metrics ?
|
|
10630
|
+
const metrics = chunkSN5EUDIT_js.readViewportMetrics(window);
|
|
10631
|
+
const inset = metrics ? chunkSN5EUDIT_js.computeKeyboardInset(metrics) : 0;
|
|
10655
10632
|
if (inset > 0) {
|
|
10656
10633
|
scrollFocusedIntoView(inset);
|
|
10657
10634
|
}
|
|
@@ -10664,7 +10641,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10664
10641
|
document.removeEventListener("focusin", onFocusIn);
|
|
10665
10642
|
};
|
|
10666
10643
|
}, [enabled]);
|
|
10667
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10644
|
+
return { keyboardInset, isKeyboardOpen: chunkSN5EUDIT_js.isKeyboardOpen(keyboardInset) };
|
|
10668
10645
|
}
|
|
10669
10646
|
|
|
10670
10647
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10693,21 +10670,21 @@ function buildCanvasProps(input) {
|
|
|
10693
10670
|
} = input;
|
|
10694
10671
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10695
10672
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10696
|
-
const fieldContext =
|
|
10673
|
+
const fieldContext = chunkSN5EUDIT_js.buildFieldSubstitutionContext({
|
|
10697
10674
|
headerFooter: s.headerFooter,
|
|
10698
10675
|
customProperties: s.customProperties,
|
|
10699
10676
|
slide: activeSlide
|
|
10700
10677
|
});
|
|
10701
10678
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10702
10679
|
const openExternalUrl = (url, target) => {
|
|
10703
|
-
if (
|
|
10680
|
+
if (chunkSN5EUDIT_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
10704
10681
|
return;
|
|
10705
10682
|
}
|
|
10706
|
-
|
|
10683
|
+
chunkSN5EUDIT_js.safeOpenUrl(url, target);
|
|
10707
10684
|
};
|
|
10708
10685
|
const handleActionClick = (elementId, action) => {
|
|
10709
10686
|
if (mode === "present") {
|
|
10710
|
-
const resolved =
|
|
10687
|
+
const resolved = chunkSN5EUDIT_js.resolvePresentationAction(action, { slideCount: slides.length });
|
|
10711
10688
|
if (resolved.intent.kind === "openUrl") {
|
|
10712
10689
|
openExternalUrl(resolved.intent.url);
|
|
10713
10690
|
return;
|
|
@@ -10718,9 +10695,9 @@ function buildCanvasProps(input) {
|
|
|
10718
10695
|
}
|
|
10719
10696
|
};
|
|
10720
10697
|
const handleHyperlinkClick = (url, target) => {
|
|
10721
|
-
if (
|
|
10698
|
+
if (chunkSN5EUDIT_js.isPpactionUrl(url)) {
|
|
10722
10699
|
if (mode === "present") {
|
|
10723
|
-
const parsed =
|
|
10700
|
+
const parsed = chunkSN5EUDIT_js.parsePpactionUrl(url);
|
|
10724
10701
|
if (parsed) {
|
|
10725
10702
|
presentation.handlePresentationAction({
|
|
10726
10703
|
action: parsed.action,
|
|
@@ -10826,7 +10803,7 @@ function buildCanvasProps(input) {
|
|
|
10826
10803
|
|
|
10827
10804
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10828
10805
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10829
|
-
return
|
|
10806
|
+
return chunkSN5EUDIT_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10830
10807
|
}
|
|
10831
10808
|
|
|
10832
10809
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10839,7 +10816,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10839
10816
|
const current = activeSlide.animations ?? [];
|
|
10840
10817
|
if (group === "motionPath") {
|
|
10841
10818
|
propertyHandlers.handleUpdateSlide({
|
|
10842
|
-
animations:
|
|
10819
|
+
animations: chunkSN5EUDIT_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10843
10820
|
});
|
|
10844
10821
|
return;
|
|
10845
10822
|
}
|
|
@@ -11035,7 +11012,7 @@ function buildToolbarProps(input) {
|
|
|
11035
11012
|
onOpenFile,
|
|
11036
11013
|
onOpenRecentFile,
|
|
11037
11014
|
onCreatePresentation: (templateId) => {
|
|
11038
|
-
s.setSlides(
|
|
11015
|
+
s.setSlides(chunkSN5EUDIT_js.createBackstagePresentation(templateId));
|
|
11039
11016
|
s.setActiveSlideIndex(0);
|
|
11040
11017
|
s.setSelectedElementId(null);
|
|
11041
11018
|
s.setSelectedElementIds([]);
|
|
@@ -11064,7 +11041,7 @@ function buildToolbarProps(input) {
|
|
|
11064
11041
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
11065
11042
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
11066
11043
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
11067
|
-
templateScheme:
|
|
11044
|
+
templateScheme: chunkSN5EUDIT_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
11068
11045
|
customShows: s.customShows,
|
|
11069
11046
|
activeCustomShowId: s.activeCustomShowId,
|
|
11070
11047
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -11105,7 +11082,7 @@ function buildToolbarProps(input) {
|
|
|
11105
11082
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
11106
11083
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
11107
11084
|
formatPainterActive: s.formatPainterActive,
|
|
11108
|
-
canActivateFormatPainter:
|
|
11085
|
+
canActivateFormatPainter: chunkSN5EUDIT_js.hasCopyableFormat(selectedElement),
|
|
11109
11086
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
11110
11087
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
11111
11088
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11183,7 +11160,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11183
11160
|
headerFooter: state.headerFooter,
|
|
11184
11161
|
loading,
|
|
11185
11162
|
error,
|
|
11186
|
-
maxHistoryEntries:
|
|
11163
|
+
maxHistoryEntries: chunkSN5EUDIT_js.resolveHistoryDepth(viewerOptions),
|
|
11187
11164
|
hasActivePointerInteraction,
|
|
11188
11165
|
pointerCommitNonce: state.pointerCommitNonce,
|
|
11189
11166
|
onDirty: markDocumentDirty,
|
|
@@ -11251,7 +11228,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11251
11228
|
gridSpacingPx,
|
|
11252
11229
|
// Multiplied against the pre-existing 2x baseline; see the matching
|
|
11253
11230
|
// comment in `PowerPointViewer.tsx`.
|
|
11254
|
-
imageExportScale: 2 *
|
|
11231
|
+
imageExportScale: 2 * chunkSN5EUDIT_js.resolveImageResolutionScale(viewerOptions),
|
|
11255
11232
|
viewerOptions
|
|
11256
11233
|
};
|
|
11257
11234
|
}
|
|
@@ -11267,7 +11244,7 @@ function useCompatibilityToastsState() {
|
|
|
11267
11244
|
}
|
|
11268
11245
|
function useReadOnlyRecommendationState(content) {
|
|
11269
11246
|
const [recommendation, setRecommendation] = react.useState(
|
|
11270
|
-
() =>
|
|
11247
|
+
() => chunkSN5EUDIT_js.readOnlyRecommendation(void 0)
|
|
11271
11248
|
);
|
|
11272
11249
|
const [bannerHidden, setBannerHidden] = react.useState(false);
|
|
11273
11250
|
const [editAnywayActive, setEditAnywayActive] = react.useState(false);
|
|
@@ -11305,9 +11282,9 @@ function useViewPreferencesSync(input) {
|
|
|
11305
11282
|
setShowGuides
|
|
11306
11283
|
} = input;
|
|
11307
11284
|
react.useEffect(() => {
|
|
11308
|
-
const seeded =
|
|
11285
|
+
const seeded = chunkSN5EUDIT_js.viewerPreferencesFromViewProperties(
|
|
11309
11286
|
{ viewProperties },
|
|
11310
|
-
{ ...
|
|
11287
|
+
{ ...chunkSN5EUDIT_js.DEFAULT_VIEWER_PREFERENCES, snapToGrid, snapToObjects: snapToShape, showGuides }
|
|
11311
11288
|
);
|
|
11312
11289
|
setSnapToGrid(seeded.snapToGrid);
|
|
11313
11290
|
setSnapToShape(seeded.snapToObjects ?? snapToShape);
|
|
@@ -11317,7 +11294,7 @@ function useViewPreferencesSync(input) {
|
|
|
11317
11294
|
(prefsOverride) => {
|
|
11318
11295
|
setViewProperties((prev) => {
|
|
11319
11296
|
const merged = {
|
|
11320
|
-
...
|
|
11297
|
+
...chunkSN5EUDIT_js.DEFAULT_VIEWER_PREFERENCES,
|
|
11321
11298
|
snapToGrid,
|
|
11322
11299
|
snapToObjects: snapToShape,
|
|
11323
11300
|
showGuides,
|
|
@@ -11325,7 +11302,7 @@ function useViewPreferencesSync(input) {
|
|
|
11325
11302
|
gridSpacingCy: prev?.gridSpacing?.cy,
|
|
11326
11303
|
...prefsOverride
|
|
11327
11304
|
};
|
|
11328
|
-
const patch =
|
|
11305
|
+
const patch = chunkSN5EUDIT_js.viewPropertiesPatchFromPreferences(merged);
|
|
11329
11306
|
return {
|
|
11330
11307
|
...prev,
|
|
11331
11308
|
slideViewPr: { ...prev?.slideViewPr, ...patch.slideViewPr },
|
|
@@ -11543,7 +11520,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11543
11520
|
}, [incomingContent]);
|
|
11544
11521
|
const onOpenFile = react.useCallback(() => {
|
|
11545
11522
|
void (async () => {
|
|
11546
|
-
const picked = await
|
|
11523
|
+
const picked = await chunkSN5EUDIT_js.openPptxFile();
|
|
11547
11524
|
if (picked) {
|
|
11548
11525
|
setContent(picked.buffer);
|
|
11549
11526
|
}
|
|
@@ -11551,7 +11528,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11551
11528
|
}, []);
|
|
11552
11529
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11553
11530
|
void (async () => {
|
|
11554
|
-
const bytes = await
|
|
11531
|
+
const bytes = await chunkSN5EUDIT_js.readBackstageRecentFile(key);
|
|
11555
11532
|
if (bytes) {
|
|
11556
11533
|
setContent(bytes);
|
|
11557
11534
|
}
|