pptx-react-viewer 3.7.0 → 3.9.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 +21 -0
- package/dist/{AiChatPanel-M3AHKYPS.js → AiChatPanel-3A42W7RW.js} +25 -25
- package/dist/AiChatPanel-3A42W7RW.js.br +0 -0
- package/dist/AiChatPanel-3A42W7RW.js.gz +0 -0
- package/dist/{AiChatPanel-L5QGWVZK.mjs → AiChatPanel-II6VOOAL.mjs} +4 -4
- package/dist/AiChatPanel-II6VOOAL.mjs.br +0 -0
- package/dist/AiChatPanel-II6VOOAL.mjs.gz +0 -0
- package/dist/{Area3DChartScene-AE2XYKDW.mjs → Area3DChartScene-JM3CQ3WQ.mjs} +21 -4
- package/dist/Area3DChartScene-JM3CQ3WQ.mjs.br +0 -0
- package/dist/Area3DChartScene-JM3CQ3WQ.mjs.gz +0 -0
- package/dist/{Area3DChartScene-ZQLQK6L4.js → Area3DChartScene-XJK4ZA4R.js} +21 -4
- package/dist/Area3DChartScene-XJK4ZA4R.js.br +0 -0
- package/dist/Area3DChartScene-XJK4ZA4R.js.gz +0 -0
- package/dist/{Bar3DChartScene-TZ6ADFBS.js → Bar3DChartScene-RGRZY5P6.js} +21 -4
- package/dist/Bar3DChartScene-RGRZY5P6.js.br +0 -0
- package/dist/Bar3DChartScene-RGRZY5P6.js.gz +0 -0
- package/dist/{Bar3DChartScene-FQV62XOI.mjs → Bar3DChartScene-VNFWI2QG.mjs} +21 -4
- package/dist/Bar3DChartScene-VNFWI2QG.mjs.br +0 -0
- package/dist/Bar3DChartScene-VNFWI2QG.mjs.gz +0 -0
- package/dist/{Line3DChartScene-FEUY3PCE.mjs → Line3DChartScene-GXOWGIFJ.mjs} +21 -4
- package/dist/Line3DChartScene-GXOWGIFJ.mjs.br +0 -0
- package/dist/Line3DChartScene-GXOWGIFJ.mjs.gz +0 -0
- package/dist/{Line3DChartScene-5CKPAX63.js → Line3DChartScene-MEY42DBF.js} +21 -4
- package/dist/Line3DChartScene-MEY42DBF.js.br +0 -0
- package/dist/Line3DChartScene-MEY42DBF.js.gz +0 -0
- package/dist/{Model3DScene-BLXEALM6.js → Model3DScene-MWXTGHDM.js} +2 -2
- package/dist/Model3DScene-MWXTGHDM.js.br +0 -0
- package/dist/Model3DScene-MWXTGHDM.js.gz +0 -0
- package/dist/{Model3DScene-V3DHIISV.mjs → Model3DScene-WJ3MMIZH.mjs} +1 -1
- package/dist/Model3DScene-WJ3MMIZH.mjs.br +0 -0
- package/dist/Model3DScene-WJ3MMIZH.mjs.gz +0 -0
- package/dist/{PieChart3DScene-GHHT3PDV.js → PieChart3DScene-FJJGOQIS.js} +15 -4
- package/dist/PieChart3DScene-FJJGOQIS.js.br +0 -0
- package/dist/PieChart3DScene-FJJGOQIS.js.gz +0 -0
- package/dist/{PieChart3DScene-VZI2VARG.mjs → PieChart3DScene-WXJEDYMK.mjs} +15 -4
- package/dist/PieChart3DScene-WXJEDYMK.mjs.br +0 -0
- package/dist/PieChart3DScene-WXJEDYMK.mjs.gz +0 -0
- package/dist/PowerPointViewer-Cl6jBPNw.d.ts.map +1 -1
- package/dist/{SmartArt3DScene-ZO3KFDI2.js → SmartArt3DScene-BK7QN3WT.js} +85 -23
- package/dist/SmartArt3DScene-BK7QN3WT.js.br +0 -0
- package/dist/SmartArt3DScene-BK7QN3WT.js.gz +0 -0
- package/dist/{SmartArt3DScene-XCFVGCXE.mjs → SmartArt3DScene-ODKCGJBO.mjs} +85 -23
- package/dist/SmartArt3DScene-ODKCGJBO.mjs.br +0 -0
- package/dist/SmartArt3DScene-ODKCGJBO.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-T36E2HBA.mjs → SurfaceChart3DScene-IKPE2SVE.mjs} +19 -4
- package/dist/SurfaceChart3DScene-IKPE2SVE.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-IKPE2SVE.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-WWIMQ65D.js → SurfaceChart3DScene-VDK3F224.js} +19 -4
- package/dist/SurfaceChart3DScene-VDK3F224.js.br +0 -0
- package/dist/SurfaceChart3DScene-VDK3F224.js.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-3NIJ5HIZ.js} +3650 -2503
- package/dist/chunk-3NIJ5HIZ.js.br +0 -0
- package/dist/chunk-3NIJ5HIZ.js.gz +0 -0
- package/dist/{chunk-WKODF5ZU.mjs → chunk-3Y63XPIN.mjs} +5 -2
- package/dist/chunk-3Y63XPIN.mjs.br +0 -0
- package/dist/chunk-3Y63XPIN.mjs.gz +0 -0
- package/dist/{chunk-OBE4TB76.js → chunk-5CPGDXD6.js} +632 -579
- package/dist/chunk-5CPGDXD6.js.br +0 -0
- package/dist/chunk-5CPGDXD6.js.gz +0 -0
- package/dist/{chunk-TXY2E7VQ.mjs → chunk-76Z3X6JX.mjs} +1684 -537
- package/dist/chunk-76Z3X6JX.mjs.br +0 -0
- package/dist/chunk-76Z3X6JX.mjs.gz +0 -0
- package/dist/chunk-DNR6CH6I.js +30 -0
- package/dist/chunk-DNR6CH6I.js.br +0 -0
- package/dist/chunk-DNR6CH6I.js.gz +0 -0
- package/dist/{chunk-DCNHUEWQ.js → chunk-G3JPCRKN.js} +18490 -10327
- package/dist/chunk-G3JPCRKN.js.br +0 -0
- package/dist/chunk-G3JPCRKN.js.gz +0 -0
- package/dist/{chunk-FGTMS7LR.mjs → chunk-JBSAKP4Z.mjs} +70 -4
- package/dist/chunk-JBSAKP4Z.mjs.br +0 -0
- package/dist/chunk-JBSAKP4Z.mjs.gz +0 -0
- package/dist/{chunk-3EJFZ7TE.js → chunk-K6Q6KLA6.js} +9 -5
- package/dist/chunk-K6Q6KLA6.js.br +0 -0
- package/dist/chunk-K6Q6KLA6.js.gz +0 -0
- package/dist/{chunk-VIFDZIVX.js → chunk-LBJAVP3H.js} +206 -179
- package/dist/chunk-LBJAVP3H.js.br +0 -0
- package/dist/chunk-LBJAVP3H.js.gz +0 -0
- package/dist/{chunk-JANUSAEK.mjs → chunk-NTWFXLZX.mjs} +35 -8
- package/dist/chunk-NTWFXLZX.mjs.br +0 -0
- package/dist/chunk-NTWFXLZX.mjs.gz +0 -0
- package/dist/{chunk-PC62KGU3.mjs → chunk-PCCM7NVY.mjs} +206 -153
- package/dist/chunk-PCCM7NVY.mjs.br +0 -0
- package/dist/chunk-PCCM7NVY.mjs.gz +0 -0
- package/dist/chunk-T6GFCLSM.mjs +27 -0
- package/dist/chunk-T6GFCLSM.mjs.br +4 -0
- package/dist/chunk-T6GFCLSM.mjs.gz +0 -0
- package/dist/{chunk-W24OJ7H5.js → chunk-TEVGDXVW.js} +70 -4
- package/dist/chunk-TEVGDXVW.js.br +0 -0
- package/dist/chunk-TEVGDXVW.js.gz +0 -0
- package/dist/{chunk-NV55GU5V.mjs → chunk-VQX7G75Z.mjs} +18447 -10316
- package/dist/chunk-VQX7G75Z.mjs.br +0 -0
- package/dist/chunk-VQX7G75Z.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 +545 -81
- 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 +774 -229
- 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/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/types-Bzdkiakq.d.ts.map +1 -1
- package/dist/viewer/index.d.ts +488 -66
- 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.br +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.br +0 -0
- package/dist/PieChart3DScene-GHHT3PDV.js.gz +0 -0
- package/dist/PieChart3DScene-VZI2VARG.mjs.br +0 -0
- package/dist/PieChart3DScene-VZI2VARG.mjs.gz +0 -0
- package/dist/SmartArt3DScene-XCFVGCXE.mjs.br +0 -0
- package/dist/SmartArt3DScene-XCFVGCXE.mjs.gz +0 -0
- package/dist/SmartArt3DScene-ZO3KFDI2.js.br +0 -0
- package/dist/SmartArt3DScene-ZO3KFDI2.js.gz +0 -0
- package/dist/SurfaceChart3DScene-T36E2HBA.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-T36E2HBA.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-WWIMQ65D.js.br +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 chunkLBJAVP3H_js = require('./chunk-LBJAVP3H.js');
|
|
4
|
+
var chunkG3JPCRKN_js = require('./chunk-G3JPCRKN.js');
|
|
5
|
+
var chunkTEVGDXVW_js = require('./chunk-TEVGDXVW.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 = chunkG3JPCRKN_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 = chunkG3JPCRKN_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 ??= chunkG3JPCRKN_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 >= chunkG3JPCRKN_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
|
+
}, chunkG3JPCRKN_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 = chunkG3JPCRKN_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
|
+
chunkG3JPCRKN_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 = chunkG3JPCRKN_js.validateRoomId(config.roomId);
|
|
244
244
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
245
|
-
departureRef.current =
|
|
245
|
+
departureRef.current = chunkG3JPCRKN_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 = chunkG3JPCRKN_js.validateRoomId(config.roomId);
|
|
288
|
+
const transport = config.transport ?? chunkG3JPCRKN_js.resolveTransportForServerUrl(config.serverUrl);
|
|
289
289
|
if (transport === "webrtc") {
|
|
290
290
|
await initWebrtc();
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
293
|
+
if (chunkG3JPCRKN_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 = chunkG3JPCRKN_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
|
+
chunkG3JPCRKN_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
|
+
}, chunkG3JPCRKN_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
|
+
chunkG3JPCRKN_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 = chunkG3JPCRKN_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 = chunkG3JPCRKN_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(chunkG3JPCRKN_js.cloneSlide),
|
|
531
|
+
templateElementsBySlideId: chunkG3JPCRKN_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(chunkG3JPCRKN_js.cloneSlide));
|
|
545
545
|
setTemplateElementsBySlideId(
|
|
546
|
-
|
|
546
|
+
chunkG3JPCRKN_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 = chunkLBJAVP3H_js.cloneHistorySnapshot(previousSnapshot);
|
|
586
|
+
lastHistorySnapshotRef.current = chunkLBJAVP3H_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 = chunkLBJAVP3H_js.cloneHistorySnapshot(nextSnapshot);
|
|
608
|
+
lastHistorySnapshotRef.current = chunkLBJAVP3H_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 = chunkLBJAVP3H_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 = chunkLBJAVP3H_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(chunkLBJAVP3H_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 = chunkLBJAVP3H_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(chunkG3JPCRKN_js.createWheelStepBuffer());
|
|
747
747
|
const storeRef = react.useRef(null);
|
|
748
|
-
storeRef.current ??=
|
|
748
|
+
storeRef.current ??= chunkG3JPCRKN_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 = chunkG3JPCRKN_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, chunkLBJAVP3H_js.MIN_ELEMENT_SIZE));
|
|
847
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkLBJAVP3H_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, chunkLBJAVP3H_js.MIN_ELEMENT_SIZE);
|
|
854
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkLBJAVP3H_js.MIN_ELEMENT_SIZE);
|
|
855
855
|
const availableWidth = Math.max(
|
|
856
|
-
effectiveEditorDimensions.width -
|
|
857
|
-
|
|
856
|
+
effectiveEditorDimensions.width - chunkLBJAVP3H_js.ZOOM_TO_SELECTION_PADDING,
|
|
857
|
+
chunkLBJAVP3H_js.MIN_ELEMENT_SIZE
|
|
858
858
|
);
|
|
859
859
|
const availableHeight = Math.max(
|
|
860
|
-
effectiveEditorDimensions.height -
|
|
861
|
-
|
|
860
|
+
effectiveEditorDimensions.height - chunkLBJAVP3H_js.ZOOM_TO_SELECTION_PADDING,
|
|
861
|
+
chunkLBJAVP3H_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 = chunkG3JPCRKN_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 = chunkG3JPCRKN_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: chunkG3JPCRKN_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
|
+
chunkG3JPCRKN_js.playGroup(controller, group, ctx);
|
|
988
|
+
chunkG3JPCRKN_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 = chunkG3JPCRKN_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1008
1008
|
const timer = window.setTimeout(() => {
|
|
1009
1009
|
setPresentationAnimations(
|
|
1010
1010
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1018,7 +1018,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1018
1018
|
|
|
1019
1019
|
// src/viewer/hooks/presentation-mode/useAnimationPlayback.ts
|
|
1020
1020
|
function useAnimationPlayback(input) {
|
|
1021
|
-
const { slides, onPlayActionSound, showWithAnimation } = input;
|
|
1021
|
+
const { slides, onPlayActionSound, showWithAnimation, canvasSize, themeColorMap } = input;
|
|
1022
1022
|
const animationsEnabled = showWithAnimation !== false;
|
|
1023
1023
|
const [presentationAnimations, setPresentationAnimations] = react.useState([]);
|
|
1024
1024
|
const [presentationElementStates, setPresentationElementStates] = react.useState(/* @__PURE__ */ new 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(chunkG3JPCRKN_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
|
+
chunkG3JPCRKN_js.cancelBuildReveal(buildRafRef);
|
|
1051
1051
|
};
|
|
1052
1052
|
}, []);
|
|
1053
1053
|
const clearPresentationTimers = react.useCallback(() => {
|
|
1054
|
-
|
|
1054
|
+
chunkG3JPCRKN_js.clearPlaybackTimers(buildPlaybackContext(), activeAnimationGroupRef.current);
|
|
1055
1055
|
}, [buildPlaybackContext]);
|
|
1056
1056
|
const resetSlideTimeline = react.useCallback(
|
|
1057
1057
|
(slideIndex) => {
|
|
1058
|
-
|
|
1058
|
+
chunkG3JPCRKN_js.cancelBuildReveal(buildRafRef);
|
|
1059
1059
|
const slide = slides[slideIndex];
|
|
1060
1060
|
if (!slide) {
|
|
1061
1061
|
controllerRef.current = null;
|
|
@@ -1066,9 +1066,13 @@ function useAnimationPlayback(input) {
|
|
|
1066
1066
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1067
1067
|
return;
|
|
1068
1068
|
}
|
|
1069
|
-
const controller =
|
|
1069
|
+
const controller = chunkG3JPCRKN_js.PresentationAnimationController.fromSlide(slide, {
|
|
1070
|
+
slideHeightPx: canvasSize?.height,
|
|
1071
|
+
slideWidthPx: canvasSize?.width,
|
|
1072
|
+
themeColorMap
|
|
1073
|
+
});
|
|
1070
1074
|
controllerRef.current = controller;
|
|
1071
|
-
mediaTimeNodeElementIdsRef.current =
|
|
1075
|
+
mediaTimeNodeElementIdsRef.current = chunkG3JPCRKN_js.resolveMediaTimeNodeElementIds(
|
|
1072
1076
|
slide.nativeAnimations ?? []
|
|
1073
1077
|
);
|
|
1074
1078
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
@@ -1076,13 +1080,13 @@ function useAnimationPlayback(input) {
|
|
|
1076
1080
|
setHoverTriggerShapeIds(controller.hoverTriggerShapeIds);
|
|
1077
1081
|
setPresentationElementStates(controller.computeStates());
|
|
1078
1082
|
},
|
|
1079
|
-
[slides]
|
|
1083
|
+
[slides, canvasSize, themeColorMap]
|
|
1080
1084
|
);
|
|
1081
1085
|
const playNextAnimationGroup = react.useCallback(() => {
|
|
1082
1086
|
if (!animationsEnabled) {
|
|
1083
1087
|
return false;
|
|
1084
1088
|
}
|
|
1085
|
-
return
|
|
1089
|
+
return chunkG3JPCRKN_js.advanceMainSequence(
|
|
1086
1090
|
controllerRef.current,
|
|
1087
1091
|
buildPlaybackContext(),
|
|
1088
1092
|
activeAnimationGroupRef.current
|
|
@@ -1098,7 +1102,7 @@ function useAnimationPlayback(input) {
|
|
|
1098
1102
|
if (!group) {
|
|
1099
1103
|
return false;
|
|
1100
1104
|
}
|
|
1101
|
-
|
|
1105
|
+
chunkG3JPCRKN_js.playGroup(controller, group, buildPlaybackContext());
|
|
1102
1106
|
return true;
|
|
1103
1107
|
},
|
|
1104
1108
|
[buildPlaybackContext]
|
|
@@ -1117,7 +1121,7 @@ function useAnimationPlayback(input) {
|
|
|
1117
1121
|
if (!group) {
|
|
1118
1122
|
return false;
|
|
1119
1123
|
}
|
|
1120
|
-
|
|
1124
|
+
chunkG3JPCRKN_js.playGroup(controller, group, buildPlaybackContext());
|
|
1121
1125
|
return true;
|
|
1122
1126
|
},
|
|
1123
1127
|
[animationsEnabled, buildPlaybackContext]
|
|
@@ -1198,12 +1202,12 @@ function useAnimationPlayback(input) {
|
|
|
1198
1202
|
presentationTimersRef
|
|
1199
1203
|
};
|
|
1200
1204
|
}
|
|
1201
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1202
|
-
var AUDIENCE_HASH =
|
|
1203
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1204
|
-
var AUDIENCE_NONCE_KEY =
|
|
1205
|
+
var PRESENTER_CHANNEL_NAME = chunkG3JPCRKN_js.PRESENTATION_CHANNEL_NAME;
|
|
1206
|
+
var AUDIENCE_HASH = chunkG3JPCRKN_js.PRESENTATION_HASH;
|
|
1207
|
+
var PRESENTER_MSG_ORIGIN = chunkG3JPCRKN_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1208
|
+
var AUDIENCE_NONCE_KEY = chunkG3JPCRKN_js.PRESENTATION_NONCE_KEY;
|
|
1205
1209
|
function generateSessionId() {
|
|
1206
|
-
return
|
|
1210
|
+
return chunkG3JPCRKN_js.createPresentationSessionId();
|
|
1207
1211
|
}
|
|
1208
1212
|
function parseAudienceNonce() {
|
|
1209
1213
|
const hash = window.location.hash;
|
|
@@ -1239,7 +1243,7 @@ function usePresenterWindow(input) {
|
|
|
1239
1243
|
}, []);
|
|
1240
1244
|
const swapDisplays = react.useCallback(async () => {
|
|
1241
1245
|
const audience = audienceWindowRef.current;
|
|
1242
|
-
return audience && !audience.closed ?
|
|
1246
|
+
return audience && !audience.closed ? chunkG3JPCRKN_js.swapPresentationWindows(window, audience) : false;
|
|
1243
1247
|
}, []);
|
|
1244
1248
|
const syncSlideToAudience = react.useCallback(
|
|
1245
1249
|
(slideIndex) => {
|
|
@@ -1303,7 +1307,7 @@ function usePresenterWindow(input) {
|
|
|
1303
1307
|
pollTimerRef.current = null;
|
|
1304
1308
|
}
|
|
1305
1309
|
if (closingSessionId) {
|
|
1306
|
-
void
|
|
1310
|
+
void chunkG3JPCRKN_js.clearAudienceContent(closingSessionId);
|
|
1307
1311
|
}
|
|
1308
1312
|
}, [getChannel]);
|
|
1309
1313
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1321,10 +1325,10 @@ function usePresenterWindow(input) {
|
|
|
1321
1325
|
audienceWindowRef.current = blankWin;
|
|
1322
1326
|
const sessionId = generateSessionId();
|
|
1323
1327
|
sessionIdRef.current = sessionId;
|
|
1324
|
-
const audienceUrl =
|
|
1325
|
-
void
|
|
1328
|
+
const audienceUrl = chunkG3JPCRKN_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1329
|
+
void chunkG3JPCRKN_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1326
1330
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1327
|
-
|
|
1331
|
+
chunkG3JPCRKN_js.placeAudienceWindow(blankWin, placement);
|
|
1328
1332
|
}
|
|
1329
1333
|
return void 0;
|
|
1330
1334
|
});
|
|
@@ -1354,7 +1358,7 @@ function usePresenterWindow(input) {
|
|
|
1354
1358
|
}
|
|
1355
1359
|
};
|
|
1356
1360
|
if (content) {
|
|
1357
|
-
void
|
|
1361
|
+
void chunkG3JPCRKN_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1358
1362
|
} else {
|
|
1359
1363
|
navigateOrClose(true);
|
|
1360
1364
|
}
|
|
@@ -1380,7 +1384,7 @@ function usePresenterWindow(input) {
|
|
|
1380
1384
|
}
|
|
1381
1385
|
const handleMessage = (event) => {
|
|
1382
1386
|
const message = event.data;
|
|
1383
|
-
if (
|
|
1387
|
+
if (chunkG3JPCRKN_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1384
1388
|
syncStateToAudience(snapshotRef.current);
|
|
1385
1389
|
}
|
|
1386
1390
|
};
|
|
@@ -1409,7 +1413,7 @@ function usePresenterWindow(input) {
|
|
|
1409
1413
|
react.useEffect(() => {
|
|
1410
1414
|
const handleBeforeUnload = () => {
|
|
1411
1415
|
if (sessionIdRef.current) {
|
|
1412
|
-
void
|
|
1416
|
+
void chunkG3JPCRKN_js.clearAudienceContent(sessionIdRef.current);
|
|
1413
1417
|
}
|
|
1414
1418
|
};
|
|
1415
1419
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1471,7 +1475,7 @@ function useAudienceMode(input) {
|
|
|
1471
1475
|
}
|
|
1472
1476
|
channel.onmessage = (event) => {
|
|
1473
1477
|
const data = event.data;
|
|
1474
|
-
if (!
|
|
1478
|
+
if (!chunkG3JPCRKN_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1475
1479
|
return;
|
|
1476
1480
|
}
|
|
1477
1481
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1487,16 +1491,16 @@ function useAudienceMode(input) {
|
|
|
1487
1491
|
}
|
|
1488
1492
|
if (data.type === "presenter-exit") {
|
|
1489
1493
|
if (expectedSessionId) {
|
|
1490
|
-
void
|
|
1494
|
+
void chunkG3JPCRKN_js.clearAudienceContent(expectedSessionId);
|
|
1491
1495
|
}
|
|
1492
|
-
if (
|
|
1496
|
+
if (chunkG3JPCRKN_js.endAudienceDisplay(window)) {
|
|
1493
1497
|
handlers.onPresenterEnded?.();
|
|
1494
1498
|
}
|
|
1495
1499
|
}
|
|
1496
1500
|
};
|
|
1497
1501
|
if (expectedSessionId) {
|
|
1498
1502
|
channel.postMessage({
|
|
1499
|
-
origin:
|
|
1503
|
+
origin: chunkG3JPCRKN_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1500
1504
|
type: "audience-ready",
|
|
1501
1505
|
sessionId: expectedSessionId
|
|
1502
1506
|
});
|
|
@@ -1510,7 +1514,7 @@ function useAudienceMode(input) {
|
|
|
1510
1514
|
}, []);
|
|
1511
1515
|
}
|
|
1512
1516
|
function usePresentationKeyboard(input) {
|
|
1513
|
-
const wheelBufferRef = react.useRef(
|
|
1517
|
+
const wheelBufferRef = react.useRef(chunkG3JPCRKN_js.createWheelStepBuffer());
|
|
1514
1518
|
const {
|
|
1515
1519
|
mode,
|
|
1516
1520
|
movePresentationSlide,
|
|
@@ -1531,14 +1535,14 @@ function usePresentationKeyboard(input) {
|
|
|
1531
1535
|
presentationSlideIndex,
|
|
1532
1536
|
setShowRehearsalSummary
|
|
1533
1537
|
} = input;
|
|
1534
|
-
const keyBufferRef = react.useRef(
|
|
1538
|
+
const keyBufferRef = react.useRef(chunkG3JPCRKN_js.createPresentationKeyBuffer());
|
|
1535
1539
|
react.useEffect(() => {
|
|
1536
|
-
if (mode !== "present" || !
|
|
1537
|
-
keyBufferRef.current =
|
|
1540
|
+
if (mode !== "present" || !chunkG3JPCRKN_js.acceptsPresentationInput()) {
|
|
1541
|
+
keyBufferRef.current = chunkG3JPCRKN_js.createPresentationKeyBuffer();
|
|
1538
1542
|
return;
|
|
1539
1543
|
}
|
|
1540
1544
|
const handleKeyDown = (event) => {
|
|
1541
|
-
const mapped =
|
|
1545
|
+
const mapped = chunkG3JPCRKN_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1542
1546
|
if (mapped.action === "none") {
|
|
1543
1547
|
return;
|
|
1544
1548
|
}
|
|
@@ -1558,12 +1562,12 @@ function usePresentationKeyboard(input) {
|
|
|
1558
1562
|
movePresentationSlide(-1);
|
|
1559
1563
|
return;
|
|
1560
1564
|
case "first": {
|
|
1561
|
-
const first =
|
|
1565
|
+
const first = chunkG3JPCRKN_js.firstShowSlideIndex(showSlideIndexes);
|
|
1562
1566
|
navigateToSlide(first ?? 0);
|
|
1563
1567
|
return;
|
|
1564
1568
|
}
|
|
1565
1569
|
case "last": {
|
|
1566
|
-
const last =
|
|
1570
|
+
const last = chunkG3JPCRKN_js.lastShowSlideIndex(showSlideIndexes);
|
|
1567
1571
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1568
1572
|
return;
|
|
1569
1573
|
}
|
|
@@ -1601,10 +1605,10 @@ function usePresentationKeyboard(input) {
|
|
|
1601
1605
|
}
|
|
1602
1606
|
};
|
|
1603
1607
|
const handleWheel = (event) => {
|
|
1604
|
-
if (mode !== "present" || !
|
|
1608
|
+
if (mode !== "present" || !chunkG3JPCRKN_js.acceptsPresentationInput()) {
|
|
1605
1609
|
return;
|
|
1606
1610
|
}
|
|
1607
|
-
const mapped =
|
|
1611
|
+
const mapped = chunkG3JPCRKN_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1608
1612
|
if (mapped.intent === "next-slide") {
|
|
1609
1613
|
event.preventDefault();
|
|
1610
1614
|
movePresentationSlide(1);
|
|
@@ -1737,7 +1741,7 @@ function useRehearsalTimings(input) {
|
|
|
1737
1741
|
|
|
1738
1742
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1739
1743
|
function handlePresentationActionImpl(action, deps) {
|
|
1740
|
-
|
|
1744
|
+
chunkG3JPCRKN_js.runPresentationAction(
|
|
1741
1745
|
action,
|
|
1742
1746
|
{ slideCount: deps.slidesLength, ...deps.elementId ? { elementId: deps.elementId } : {} },
|
|
1743
1747
|
{
|
|
@@ -1765,13 +1769,13 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1765
1769
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1766
1770
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1767
1771
|
const transition = deps.reverse ? deps.slides[deps.currentSlideIndex]?.transition : incomingSlide?.transition;
|
|
1768
|
-
const durationMs = deps.playTransition ?
|
|
1772
|
+
const durationMs = deps.playTransition ? chunkG3JPCRKN_js.resolveTransitionDurationMs(transition) : 0;
|
|
1769
1773
|
deps.clearPresentationTimers();
|
|
1770
1774
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1771
1775
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
1772
1776
|
deps.setPresentationSlideVisible(true);
|
|
1773
1777
|
deps.seedSlideAnimations(nextSlideIndex, { completed: deps.seedCompleted });
|
|
1774
|
-
const soundAction =
|
|
1778
|
+
const soundAction = chunkG3JPCRKN_js.resolveTransitionSoundAction(transition);
|
|
1775
1779
|
if (soundAction.kind === "play" && deps.onPlayActionSound) {
|
|
1776
1780
|
deps.onPlayActionSound(soundAction.soundPath, { loop: soundAction.loop });
|
|
1777
1781
|
} else if (soundAction.kind === "stop" && deps.onStopActionSound) {
|
|
@@ -1834,7 +1838,7 @@ function useSlideNavigation(input) {
|
|
|
1834
1838
|
});
|
|
1835
1839
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1836
1840
|
(slideIndex) => {
|
|
1837
|
-
const delayMs =
|
|
1841
|
+
const delayMs = chunkG3JPCRKN_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1838
1842
|
if (delayMs === void 0) {
|
|
1839
1843
|
return;
|
|
1840
1844
|
}
|
|
@@ -1857,7 +1861,7 @@ function useSlideNavigation(input) {
|
|
|
1857
1861
|
if (availableSlideIndexes.length === 0) {
|
|
1858
1862
|
return;
|
|
1859
1863
|
}
|
|
1860
|
-
const pastLastSlide = direction === 1 && !
|
|
1864
|
+
const pastLastSlide = direction === 1 && !chunkG3JPCRKN_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1861
1865
|
if (rehearsing && pastLastSlide) {
|
|
1862
1866
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1863
1867
|
try {
|
|
@@ -1875,9 +1879,9 @@ function useSlideNavigation(input) {
|
|
|
1875
1879
|
onAdvancePastLastSlide();
|
|
1876
1880
|
return;
|
|
1877
1881
|
}
|
|
1878
|
-
const nextSlideIndex = direction === 1 ?
|
|
1882
|
+
const nextSlideIndex = direction === 1 ? chunkG3JPCRKN_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1879
1883
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
1880
|
-
}) :
|
|
1884
|
+
}) : chunkG3JPCRKN_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
1881
1885
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
1882
1886
|
return;
|
|
1883
1887
|
}
|
|
@@ -2056,7 +2060,7 @@ function createCustomShowRunner(deps) {
|
|
|
2056
2060
|
return;
|
|
2057
2061
|
}
|
|
2058
2062
|
origin = returnAfter ? { showId: deps.getActiveCustomShowId(), slideIndex: deps.getPresentationSlideIndex() } : null;
|
|
2059
|
-
const first =
|
|
2063
|
+
const first = chunkG3JPCRKN_js.firstShowSlideIndex(chunkG3JPCRKN_js.resolveShowSlideIndexes(deps.getSlides(), target));
|
|
2060
2064
|
deps.setActiveCustomShowId(customShowId);
|
|
2061
2065
|
if (first !== void 0) {
|
|
2062
2066
|
deps.navigateToSlide(first);
|
|
@@ -2133,22 +2137,22 @@ function usePresentationActionExtensions(input) {
|
|
|
2133
2137
|
}
|
|
2134
2138
|
}, [navigateToSlideViaRef]);
|
|
2135
2139
|
const onOpenFile = react.useCallback((target) => {
|
|
2136
|
-
|
|
2140
|
+
chunkG3JPCRKN_js.safeOpenUrl(target);
|
|
2137
2141
|
}, []);
|
|
2138
2142
|
const onOpenPresentation = react.useCallback((target) => {
|
|
2139
|
-
|
|
2143
|
+
chunkG3JPCRKN_js.safeOpenUrl(target);
|
|
2140
2144
|
}, []);
|
|
2141
2145
|
const onPlayMedia = react.useCallback(
|
|
2142
2146
|
(elementId) => {
|
|
2143
|
-
|
|
2147
|
+
chunkG3JPCRKN_js.toggleStageElementMedia(containerRef.current, elementId);
|
|
2144
2148
|
},
|
|
2145
2149
|
[containerRef]
|
|
2146
2150
|
);
|
|
2147
2151
|
const onOleVerb = react.useCallback(
|
|
2148
2152
|
(verb, elementId) => {
|
|
2149
|
-
const target =
|
|
2153
|
+
const target = chunkG3JPCRKN_js.resolveOleVerbTarget(slides[presentationSlideIndex], elementId, verb);
|
|
2150
2154
|
if (target) {
|
|
2151
|
-
|
|
2155
|
+
chunkG3JPCRKN_js.openUrlInNewTab(target.url);
|
|
2152
2156
|
}
|
|
2153
2157
|
},
|
|
2154
2158
|
[slides, presentationSlideIndex]
|
|
@@ -2178,22 +2182,22 @@ function usePresentationActionExtensions(input) {
|
|
|
2178
2182
|
};
|
|
2179
2183
|
}
|
|
2180
2184
|
function usePresenterConsole(slideIndex, active) {
|
|
2181
|
-
const timerRef = react.useRef(
|
|
2182
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2185
|
+
const timerRef = react.useRef(chunkG3JPCRKN_js.createPresenterTimer());
|
|
2186
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkG3JPCRKN_js.createInitialPresentationSnapshot(slideIndex));
|
|
2183
2187
|
const patch = react.useCallback((value) => {
|
|
2184
|
-
setSnapshot((current) =>
|
|
2188
|
+
setSnapshot((current) => chunkG3JPCRKN_js.mergePresentationSnapshot(current, value));
|
|
2185
2189
|
}, []);
|
|
2186
2190
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2187
2191
|
react.useEffect(() => {
|
|
2188
2192
|
if (!active) {
|
|
2189
2193
|
return;
|
|
2190
2194
|
}
|
|
2191
|
-
timerRef.current =
|
|
2195
|
+
timerRef.current = chunkG3JPCRKN_js.resetPresenterTimer();
|
|
2192
2196
|
patch({ paused: false, elapsedMs: 0 });
|
|
2193
2197
|
const timer = window.setInterval(() => {
|
|
2194
2198
|
patch({
|
|
2195
2199
|
paused: timerRef.current.paused,
|
|
2196
|
-
elapsedMs:
|
|
2200
|
+
elapsedMs: chunkG3JPCRKN_js.presenterElapsed(timerRef.current)
|
|
2197
2201
|
});
|
|
2198
2202
|
}, 1e3);
|
|
2199
2203
|
return () => window.clearInterval(timer);
|
|
@@ -2203,19 +2207,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2203
2207
|
applyAudienceSnapshot: setSnapshot,
|
|
2204
2208
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2205
2209
|
toggleTimer: () => {
|
|
2206
|
-
timerRef.current =
|
|
2210
|
+
timerRef.current = chunkG3JPCRKN_js.togglePresenterTimer(timerRef.current);
|
|
2207
2211
|
patch({
|
|
2208
2212
|
paused: timerRef.current.paused,
|
|
2209
|
-
elapsedMs:
|
|
2213
|
+
elapsedMs: chunkG3JPCRKN_js.presenterElapsed(timerRef.current)
|
|
2210
2214
|
});
|
|
2211
2215
|
},
|
|
2212
2216
|
resetTimer: () => {
|
|
2213
|
-
timerRef.current =
|
|
2217
|
+
timerRef.current = chunkG3JPCRKN_js.resetPresenterTimer();
|
|
2214
2218
|
patch({ paused: false, elapsedMs: 0 });
|
|
2215
2219
|
},
|
|
2216
2220
|
stepZoom: (direction) => setSnapshot(
|
|
2217
|
-
(current) =>
|
|
2218
|
-
zoom:
|
|
2221
|
+
(current) => chunkG3JPCRKN_js.mergePresentationSnapshot(current, {
|
|
2222
|
+
zoom: chunkG3JPCRKN_js.stepPresenterZoom(
|
|
2219
2223
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2220
2224
|
direction
|
|
2221
2225
|
)
|
|
@@ -2235,6 +2239,8 @@ function usePresentationMode(input) {
|
|
|
2235
2239
|
slides,
|
|
2236
2240
|
templateElementsBySlideId,
|
|
2237
2241
|
visibleSlideIndexes,
|
|
2242
|
+
canvasSize,
|
|
2243
|
+
themeColorMap,
|
|
2238
2244
|
activeSlideIndex,
|
|
2239
2245
|
containerRef,
|
|
2240
2246
|
content,
|
|
@@ -2266,7 +2272,7 @@ function usePresentationMode(input) {
|
|
|
2266
2272
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2267
2273
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2268
2274
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2269
|
-
const showGuard = react.useMemo(() =>
|
|
2275
|
+
const showGuard = react.useMemo(() => chunkG3JPCRKN_js.createPresenterShowGuard(), []);
|
|
2270
2276
|
const {
|
|
2271
2277
|
presentationAnimations,
|
|
2272
2278
|
presentationElementStates,
|
|
@@ -2283,7 +2289,13 @@ function usePresentationMode(input) {
|
|
|
2283
2289
|
startSlideAnimations,
|
|
2284
2290
|
isSeededCompleted,
|
|
2285
2291
|
presentationTimersRef
|
|
2286
|
-
} = useAnimationPlayback({
|
|
2292
|
+
} = useAnimationPlayback({
|
|
2293
|
+
slides,
|
|
2294
|
+
onPlayActionSound,
|
|
2295
|
+
showWithAnimation,
|
|
2296
|
+
canvasSize,
|
|
2297
|
+
themeColorMap
|
|
2298
|
+
});
|
|
2287
2299
|
const {
|
|
2288
2300
|
rehearsing,
|
|
2289
2301
|
setRehearsing,
|
|
@@ -2357,7 +2369,7 @@ function usePresentationMode(input) {
|
|
|
2357
2369
|
actionExtensions.bindNavigateToSlide(navigateToSlide);
|
|
2358
2370
|
const movePresentationSlide = react.useCallback(
|
|
2359
2371
|
(direction, trigger = "explicit") => {
|
|
2360
|
-
if (!
|
|
2372
|
+
if (!chunkG3JPCRKN_js.acceptsPresentationInput()) {
|
|
2361
2373
|
return;
|
|
2362
2374
|
}
|
|
2363
2375
|
if (endOfShowVisible) {
|
|
@@ -2426,7 +2438,7 @@ function usePresentationMode(input) {
|
|
|
2426
2438
|
onSetMode("present");
|
|
2427
2439
|
}, [containerRef, onSetMode, setRehearsing]);
|
|
2428
2440
|
const enterPresentModeFromBeginning = react.useCallback(() => {
|
|
2429
|
-
const first =
|
|
2441
|
+
const first = chunkG3JPCRKN_js.firstShowSlideIndex(visibleSlideIndexes);
|
|
2430
2442
|
if (first !== void 0) {
|
|
2431
2443
|
onSetActiveSlideIndex(first);
|
|
2432
2444
|
}
|
|
@@ -2506,7 +2518,7 @@ function usePresentationMode(input) {
|
|
|
2506
2518
|
if (mode !== "present") {
|
|
2507
2519
|
return;
|
|
2508
2520
|
}
|
|
2509
|
-
return
|
|
2521
|
+
return chunkG3JPCRKN_js.attachPresentationVisibilityPause({
|
|
2510
2522
|
root: containerRef.current ?? void 0,
|
|
2511
2523
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2512
2524
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2514,7 +2526,7 @@ function usePresentationMode(input) {
|
|
|
2514
2526
|
}, [mode, containerRef]);
|
|
2515
2527
|
react.useLayoutEffect(() => {
|
|
2516
2528
|
if (mode === "present") {
|
|
2517
|
-
const idx =
|
|
2529
|
+
const idx = chunkG3JPCRKN_js.presentationEntrySlideIndex(
|
|
2518
2530
|
activeSlideIndexRef.current,
|
|
2519
2531
|
visibleSlideIndexesRef.current
|
|
2520
2532
|
);
|
|
@@ -2593,11 +2605,11 @@ function usePresentationMode(input) {
|
|
|
2593
2605
|
return void 0;
|
|
2594
2606
|
}
|
|
2595
2607
|
const incoming = slides[transitionOverlay.incomingSlideIndex];
|
|
2596
|
-
return
|
|
2608
|
+
return chunkG3JPCRKN_js.buildMorphTransitionPlan(
|
|
2597
2609
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2598
2610
|
incoming,
|
|
2599
2611
|
transitionOverlay.durationMs,
|
|
2600
|
-
|
|
2612
|
+
chunkG3JPCRKN_js.morphOptionToMode(transitionOverlay.transition.morphOption),
|
|
2601
2613
|
// `PresentationStage` stacks the incoming slide's elements above its
|
|
2602
2614
|
// template shapes (`zIndex = templateElements.length + index`), so a
|
|
2603
2615
|
// z-index journey has to start counting where the stage does.
|
|
@@ -2622,7 +2634,7 @@ function usePresentationMode(input) {
|
|
|
2622
2634
|
if (!morphPlan) {
|
|
2623
2635
|
return presentationKeyframesCss;
|
|
2624
2636
|
}
|
|
2625
|
-
const imageRules =
|
|
2637
|
+
const imageRules = chunkG3JPCRKN_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2626
2638
|
return `${presentationKeyframesCss ?? ""}
|
|
2627
2639
|
${morphPlan.keyframesCss}
|
|
2628
2640
|
${imageRules}`;
|
|
@@ -2919,7 +2931,7 @@ function useFindReplace({
|
|
|
2919
2931
|
const [findResults, setFindResults] = react.useState([]);
|
|
2920
2932
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
2921
2933
|
const performFind = react.useCallback(() => {
|
|
2922
|
-
const results =
|
|
2934
|
+
const results = chunkG3JPCRKN_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
2923
2935
|
if (!findQuery) {
|
|
2924
2936
|
setFindResults([]);
|
|
2925
2937
|
setFindResultIndex(-1);
|
|
@@ -2953,7 +2965,7 @@ function useFindReplace({
|
|
|
2953
2965
|
return;
|
|
2954
2966
|
}
|
|
2955
2967
|
onUpdateSlides(
|
|
2956
|
-
(prevSlides) =>
|
|
2968
|
+
(prevSlides) => chunkG3JPCRKN_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
2957
2969
|
);
|
|
2958
2970
|
onMarkDirty();
|
|
2959
2971
|
},
|
|
@@ -2975,9 +2987,9 @@ function useFindReplace({
|
|
|
2975
2987
|
}, [findResults, applyReplacements, performFind]);
|
|
2976
2988
|
react.useEffect(() => {
|
|
2977
2989
|
const handler = (event) => {
|
|
2978
|
-
const { action } =
|
|
2990
|
+
const { action } = chunkG3JPCRKN_js.mapEditorKey(event, {
|
|
2979
2991
|
canEdit: mode === "edit",
|
|
2980
|
-
isTextInputTarget:
|
|
2992
|
+
isTextInputTarget: chunkG3JPCRKN_js.isEditorTextInputTarget(event.target)
|
|
2981
2993
|
});
|
|
2982
2994
|
if (action !== "find") {
|
|
2983
2995
|
return;
|
|
@@ -3088,7 +3100,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId, ment
|
|
|
3088
3100
|
if (!slide) {
|
|
3089
3101
|
return { slides, didAdd: false };
|
|
3090
3102
|
}
|
|
3091
|
-
const next =
|
|
3103
|
+
const next = chunkG3JPCRKN_js.addCommentToList(
|
|
3092
3104
|
slide.comments || [],
|
|
3093
3105
|
text,
|
|
3094
3106
|
authorName,
|
|
@@ -3109,7 +3121,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
|
3109
3121
|
if (!slide) {
|
|
3110
3122
|
return { slides, didDelete: false };
|
|
3111
3123
|
}
|
|
3112
|
-
const next =
|
|
3124
|
+
const next = chunkG3JPCRKN_js.removeCommentFromList(slide.comments || [], commentId);
|
|
3113
3125
|
if (!next) {
|
|
3114
3126
|
return { slides, didDelete: false };
|
|
3115
3127
|
}
|
|
@@ -3120,7 +3132,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
|
3120
3132
|
if (!slide) {
|
|
3121
3133
|
return { slides, didUpdate: false };
|
|
3122
3134
|
}
|
|
3123
|
-
const next =
|
|
3135
|
+
const next = chunkG3JPCRKN_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
3124
3136
|
if (!next) {
|
|
3125
3137
|
return { slides, didUpdate: false };
|
|
3126
3138
|
}
|
|
@@ -3131,7 +3143,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
|
3131
3143
|
if (!slide) {
|
|
3132
3144
|
return { slides, didUpdate: false };
|
|
3133
3145
|
}
|
|
3134
|
-
const next =
|
|
3146
|
+
const next = chunkG3JPCRKN_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
3135
3147
|
if (!next) {
|
|
3136
3148
|
return { slides, didUpdate: false };
|
|
3137
3149
|
}
|
|
@@ -3142,7 +3154,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName, mention
|
|
|
3142
3154
|
if (!slide) {
|
|
3143
3155
|
return { slides, didAdd: false };
|
|
3144
3156
|
}
|
|
3145
|
-
const next =
|
|
3157
|
+
const next = chunkG3JPCRKN_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
3146
3158
|
if (!next) {
|
|
3147
3159
|
return { slides, didAdd: false };
|
|
3148
3160
|
}
|
|
@@ -3529,7 +3541,7 @@ function useDerivedElementState(input) {
|
|
|
3529
3541
|
return [];
|
|
3530
3542
|
}
|
|
3531
3543
|
return [
|
|
3532
|
-
...
|
|
3544
|
+
...chunkG3JPCRKN_js.visibleTemplateElements(activeSlide, templateElementsBySlideId[activeSlide.id] ?? [])
|
|
3533
3545
|
];
|
|
3534
3546
|
}, [activeSlide, templateElementsBySlideId]);
|
|
3535
3547
|
const activeMaster = slideMasters[activeMasterIndex];
|
|
@@ -3596,7 +3608,7 @@ function useViewerCoreState(_input) {
|
|
|
3596
3608
|
const marqueeStateRef = react.useRef(null);
|
|
3597
3609
|
const isDrawingRef = react.useRef(false);
|
|
3598
3610
|
const justInteractedRef = react.useRef(false);
|
|
3599
|
-
const livePatcher = react.useMemo(() =>
|
|
3611
|
+
const livePatcher = react.useMemo(() => chunkG3JPCRKN_js.createCollaborationLivePatcher(), []);
|
|
3600
3612
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3601
3613
|
const slidesRef = react.useRef([]);
|
|
3602
3614
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3605,8 +3617,8 @@ function useViewerCoreState(_input) {
|
|
|
3605
3617
|
const [slides, setSlides] = react.useState([]);
|
|
3606
3618
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3607
3619
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3608
|
-
width:
|
|
3609
|
-
height:
|
|
3620
|
+
width: chunkLBJAVP3H_js.DEFAULT_CANVAS_WIDTH,
|
|
3621
|
+
height: chunkLBJAVP3H_js.DEFAULT_CANVAS_HEIGHT
|
|
3610
3622
|
});
|
|
3611
3623
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3612
3624
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3627,7 +3639,7 @@ function useViewerCoreState(_input) {
|
|
|
3627
3639
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3628
3640
|
inlineEditingTextRef.current = resolved;
|
|
3629
3641
|
setInlineEditingTextBase(value);
|
|
3630
|
-
|
|
3642
|
+
chunkG3JPCRKN_js.publishLiveInlineText(
|
|
3631
3643
|
livePatcher,
|
|
3632
3644
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3633
3645
|
inlineEditingElementIdRef.current,
|
|
@@ -3647,6 +3659,8 @@ function useViewerCoreState(_input) {
|
|
|
3647
3659
|
const [recentColors, setRecentColors] = react.useState([]);
|
|
3648
3660
|
const [theme, setTheme] = react.useState();
|
|
3649
3661
|
const [tableStyleMap, setTableStyleMap] = react.useState();
|
|
3662
|
+
const [tableStylesDefaultId, setTableStylesDefaultId] = react.useState();
|
|
3663
|
+
const [tableStylesToDelete, setTableStylesToDelete] = react.useState([]);
|
|
3650
3664
|
const [themeOptions, setThemeOptions] = react.useState([]);
|
|
3651
3665
|
const [customShows, setCustomShows] = react.useState([]);
|
|
3652
3666
|
const [activeCustomShowId, setActiveCustomShowId] = react.useState(null);
|
|
@@ -3746,6 +3760,10 @@ function useViewerCoreState(_input) {
|
|
|
3746
3760
|
setTheme,
|
|
3747
3761
|
tableStyleMap,
|
|
3748
3762
|
setTableStyleMap,
|
|
3763
|
+
tableStylesDefaultId,
|
|
3764
|
+
setTableStylesDefaultId,
|
|
3765
|
+
tableStylesToDelete,
|
|
3766
|
+
setTableStylesToDelete,
|
|
3749
3767
|
themeOptions,
|
|
3750
3768
|
setThemeOptions,
|
|
3751
3769
|
customShows,
|
|
@@ -3930,6 +3948,8 @@ function useLoadContent({
|
|
|
3930
3948
|
setRecentColors,
|
|
3931
3949
|
setTheme,
|
|
3932
3950
|
setTableStyleMap,
|
|
3951
|
+
setTableStylesDefaultId,
|
|
3952
|
+
setTableStylesToDelete,
|
|
3933
3953
|
setThemeOptions,
|
|
3934
3954
|
setCustomShows,
|
|
3935
3955
|
setActiveCustomShowId,
|
|
@@ -3950,6 +3970,7 @@ function useLoadContent({
|
|
|
3950
3970
|
setDigitalSignatureCount,
|
|
3951
3971
|
setGuides,
|
|
3952
3972
|
setReadOnlyRecommendation,
|
|
3973
|
+
setModifyVerifier,
|
|
3953
3974
|
setCompatToasts,
|
|
3954
3975
|
setLoading,
|
|
3955
3976
|
setError,
|
|
@@ -3981,7 +4002,7 @@ function useLoadContent({
|
|
|
3981
4002
|
);
|
|
3982
4003
|
}
|
|
3983
4004
|
const previousHandler = handlerRef.current;
|
|
3984
|
-
const handler = new
|
|
4005
|
+
const handler = new chunkG3JPCRKN_js.PptxHandler();
|
|
3985
4006
|
const parsed = await handler.load(buffer, { allowExternalImages });
|
|
3986
4007
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3987
4008
|
handler.dispose();
|
|
@@ -3993,7 +4014,7 @@ function useLoadContent({
|
|
|
3993
4014
|
handlerRef.current = null;
|
|
3994
4015
|
const mediaElements = [];
|
|
3995
4016
|
for (const slide of parsed.slides) {
|
|
3996
|
-
|
|
4017
|
+
chunkG3JPCRKN_js.collectMediaElements(slide.elements, mediaElements);
|
|
3997
4018
|
}
|
|
3998
4019
|
for (const url of mediaDataUrls.values()) {
|
|
3999
4020
|
if (url.startsWith("blob:")) {
|
|
@@ -4003,7 +4024,7 @@ function useLoadContent({
|
|
|
4003
4024
|
mediaDataUrls.clear();
|
|
4004
4025
|
await Promise.all(
|
|
4005
4026
|
mediaElements.map(async (mediaElement) => {
|
|
4006
|
-
const resolved = await
|
|
4027
|
+
const resolved = await chunkG3JPCRKN_js.resolveMediaElementSource(mediaElement, handler);
|
|
4007
4028
|
if (resolved.missing || !resolved.mediaPath || !resolved.url) {
|
|
4008
4029
|
mediaElement.mediaMissing = true;
|
|
4009
4030
|
return;
|
|
@@ -4014,7 +4035,7 @@ function useLoadContent({
|
|
|
4014
4035
|
}
|
|
4015
4036
|
})
|
|
4016
4037
|
);
|
|
4017
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
4038
|
+
const { paths: imagePaths, refs: imageRefs } = chunkG3JPCRKN_js.collectImagePaths(parsed.slides);
|
|
4018
4039
|
let nextSlides = parsed.slides;
|
|
4019
4040
|
if (imagePaths.size > 0) {
|
|
4020
4041
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -4030,25 +4051,25 @@ function useLoadContent({
|
|
|
4030
4051
|
})
|
|
4031
4052
|
);
|
|
4032
4053
|
nextSlides = parsed.slides.map((s) => {
|
|
4033
|
-
const newElements =
|
|
4054
|
+
const newElements = chunkG3JPCRKN_js.applyImagePathPatches(s.elements, resolvedMap, imageRefs);
|
|
4034
4055
|
return newElements === s.elements ? s : { ...s, elements: newElements };
|
|
4035
4056
|
});
|
|
4036
4057
|
}
|
|
4037
|
-
nextSlides = await
|
|
4058
|
+
nextSlides = await chunkG3JPCRKN_js.resolveTableCellImageUrls(
|
|
4038
4059
|
nextSlides,
|
|
4039
4060
|
(path) => handler.getImageData(path)
|
|
4040
4061
|
);
|
|
4041
|
-
const nextTableStyleMap = await
|
|
4062
|
+
const nextTableStyleMap = await chunkG3JPCRKN_js.resolveTableStyleImageUrls(
|
|
4042
4063
|
parsed.tableStyleMap,
|
|
4043
4064
|
(path) => handler.getImageData(path)
|
|
4044
4065
|
);
|
|
4045
4066
|
handlerRef.current = handler;
|
|
4046
|
-
const partition =
|
|
4067
|
+
const partition = chunkG3JPCRKN_js.partitionTemplateElements(nextSlides);
|
|
4047
4068
|
setSlides(partition.slides);
|
|
4048
4069
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4049
4070
|
setCanvasSize({
|
|
4050
|
-
width: parsed.width ??
|
|
4051
|
-
height: parsed.height ??
|
|
4071
|
+
width: parsed.width ?? chunkLBJAVP3H_js.DEFAULT_CANVAS_WIDTH,
|
|
4072
|
+
height: parsed.height ?? chunkLBJAVP3H_js.DEFAULT_CANVAS_HEIGHT
|
|
4052
4073
|
});
|
|
4053
4074
|
setSlideSizeEmu(
|
|
4054
4075
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4061,13 +4082,15 @@ function useLoadContent({
|
|
|
4061
4082
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
4062
4083
|
setSlideMasters(parsed.slideMasters ?? []);
|
|
4063
4084
|
setModernCommentAuthors(parsed.modernCommentAuthors ?? []);
|
|
4064
|
-
setRecentColors(
|
|
4085
|
+
setRecentColors(chunkG3JPCRKN_js.seedRecentColors({ mruColors: parsed.mruColors }));
|
|
4065
4086
|
setTheme(parsed.theme);
|
|
4066
4087
|
setTableStyleMap(nextTableStyleMap);
|
|
4088
|
+
setTableStylesDefaultId(parsed.tableStylesDefaultId);
|
|
4089
|
+
setTableStylesToDelete([]);
|
|
4067
4090
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
4068
4091
|
setCustomShows(parsed.customShows ?? []);
|
|
4069
4092
|
setActiveCustomShowId(
|
|
4070
|
-
|
|
4093
|
+
chunkG3JPCRKN_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
4071
4094
|
);
|
|
4072
4095
|
setSections(parsed.sections ?? []);
|
|
4073
4096
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -4090,10 +4113,11 @@ function useLoadContent({
|
|
|
4090
4113
|
setHasMacros(parsed.hasMacros === true);
|
|
4091
4114
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4092
4115
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4093
|
-
setGuides(
|
|
4094
|
-
setReadOnlyRecommendation(
|
|
4116
|
+
setGuides(chunkG3JPCRKN_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4117
|
+
setReadOnlyRecommendation(chunkG3JPCRKN_js.readOnlyRecommendation(parsed));
|
|
4118
|
+
setModifyVerifier(parsed.modifyVerifier ?? void 0);
|
|
4095
4119
|
setCompatToasts(
|
|
4096
|
-
|
|
4120
|
+
chunkG3JPCRKN_js.compatibilityWarningToasts([
|
|
4097
4121
|
...parsed.warnings ?? [],
|
|
4098
4122
|
...parsed.slides.flatMap((slide) => slide.warnings ?? [])
|
|
4099
4123
|
])
|
|
@@ -4105,7 +4129,7 @@ function useLoadContent({
|
|
|
4105
4129
|
onContentApplied?.();
|
|
4106
4130
|
} catch (err) {
|
|
4107
4131
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4108
|
-
if (err instanceof
|
|
4132
|
+
if (err instanceof chunkG3JPCRKN_js.EncryptedFileError) {
|
|
4109
4133
|
setIsEncrypted(true);
|
|
4110
4134
|
} else {
|
|
4111
4135
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4133,7 +4157,7 @@ function useLoadContent({
|
|
|
4133
4157
|
}
|
|
4134
4158
|
function useAutosave(input) {
|
|
4135
4159
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4136
|
-
const intervalMs =
|
|
4160
|
+
const intervalMs = chunkG3JPCRKN_js.resolveAutosaveIntervalMs({
|
|
4137
4161
|
hostIntervalMs: input.intervalMs,
|
|
4138
4162
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4139
4163
|
});
|
|
@@ -4164,7 +4188,7 @@ function useAutosave(input) {
|
|
|
4164
4188
|
return;
|
|
4165
4189
|
}
|
|
4166
4190
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4167
|
-
if (!
|
|
4191
|
+
if (!chunkG3JPCRKN_js.shouldWriteAutosaveSnapshot({
|
|
4168
4192
|
filePath: path,
|
|
4169
4193
|
isDirty: isDirtyRef.current,
|
|
4170
4194
|
saving: isSavingRef.current,
|
|
@@ -4182,8 +4206,8 @@ function useAutosave(input) {
|
|
|
4182
4206
|
isSavingRef.current = false;
|
|
4183
4207
|
return;
|
|
4184
4208
|
}
|
|
4185
|
-
await
|
|
4186
|
-
lastSnapshotRef.current =
|
|
4209
|
+
await chunkG3JPCRKN_js.saveAutosaveSnapshot(path, data);
|
|
4210
|
+
lastSnapshotRef.current = chunkG3JPCRKN_js.autosaveSnapshotMark(path, sources);
|
|
4187
4211
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4188
4212
|
} catch (err) {
|
|
4189
4213
|
setAutosaveStatus({
|
|
@@ -4237,13 +4261,13 @@ function useElementOperations(input) {
|
|
|
4237
4261
|
inlineEditingText
|
|
4238
4262
|
} = input;
|
|
4239
4263
|
const liveTextSegments = react.useCallback(() => {
|
|
4240
|
-
if (!selectedElement || !
|
|
4264
|
+
if (!selectedElement || !chunkG3JPCRKN_js.hasTextProperties(selectedElement)) {
|
|
4241
4265
|
return void 0;
|
|
4242
4266
|
}
|
|
4243
4267
|
if (selectedElement.id !== inlineEditingElementId) {
|
|
4244
4268
|
return selectedElement.textSegments;
|
|
4245
4269
|
}
|
|
4246
|
-
return
|
|
4270
|
+
return chunkG3JPCRKN_js.remapTextToSegments(
|
|
4247
4271
|
inlineEditingText,
|
|
4248
4272
|
selectedElement.textSegments,
|
|
4249
4273
|
selectedElement.textStyle
|
|
@@ -4284,11 +4308,11 @@ function useElementOperations(input) {
|
|
|
4284
4308
|
(elementId, updates) => {
|
|
4285
4309
|
if (masterView?.target) {
|
|
4286
4310
|
applyMasterViewWrite(
|
|
4287
|
-
|
|
4311
|
+
chunkG3JPCRKN_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4288
4312
|
);
|
|
4289
4313
|
return;
|
|
4290
4314
|
}
|
|
4291
|
-
if (
|
|
4315
|
+
if (chunkG3JPCRKN_js.isTemplateElementId(elementId)) {
|
|
4292
4316
|
const slideId = activeSlide?.id;
|
|
4293
4317
|
if (slideId) {
|
|
4294
4318
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4299,7 +4323,7 @@ function useElementOperations(input) {
|
|
|
4299
4323
|
}));
|
|
4300
4324
|
}
|
|
4301
4325
|
} else {
|
|
4302
|
-
setSlides((prev) =>
|
|
4326
|
+
setSlides((prev) => chunkG3JPCRKN_js.updateElement(prev, activeSlideIndex, elementId, updates));
|
|
4303
4327
|
}
|
|
4304
4328
|
history.markDirty();
|
|
4305
4329
|
},
|
|
@@ -4324,7 +4348,7 @@ function useElementOperations(input) {
|
|
|
4324
4348
|
);
|
|
4325
4349
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4326
4350
|
(updates) => {
|
|
4327
|
-
if (!selectedElement || !
|
|
4351
|
+
if (!selectedElement || !chunkG3JPCRKN_js.hasShapeProperties(selectedElement)) {
|
|
4328
4352
|
return;
|
|
4329
4353
|
}
|
|
4330
4354
|
updateSelectedElement({
|
|
@@ -4335,19 +4359,19 @@ function useElementOperations(input) {
|
|
|
4335
4359
|
);
|
|
4336
4360
|
const updateSelectedTextStyle = react.useCallback(
|
|
4337
4361
|
(updates) => {
|
|
4338
|
-
if (!selectedElement || !
|
|
4362
|
+
if (!selectedElement || !chunkG3JPCRKN_js.hasTextProperties(selectedElement)) {
|
|
4339
4363
|
return;
|
|
4340
4364
|
}
|
|
4341
4365
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4342
4366
|
const currentSegments = liveTextSegments();
|
|
4343
|
-
const inlineSel =
|
|
4367
|
+
const inlineSel = chunkG3JPCRKN_js.getInlineEditorSelection(currentSegments);
|
|
4344
4368
|
if (inlineSel && currentSegments) {
|
|
4345
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4369
|
+
const { newSegments: newSegments2, newSelection } = chunkG3JPCRKN_js.applyStyleToSelectedSegments(
|
|
4346
4370
|
currentSegments,
|
|
4347
4371
|
inlineSel,
|
|
4348
4372
|
updates
|
|
4349
4373
|
);
|
|
4350
|
-
|
|
4374
|
+
chunkG3JPCRKN_js.setPendingSelectionRestore(newSelection);
|
|
4351
4375
|
updateSelectedElement({
|
|
4352
4376
|
textSegments: newSegments2,
|
|
4353
4377
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4375,14 +4399,14 @@ function useElementOperations(input) {
|
|
|
4375
4399
|
);
|
|
4376
4400
|
const updateSelectedTextCase = react.useCallback(
|
|
4377
4401
|
(mode) => {
|
|
4378
|
-
if (!selectedElement || !
|
|
4402
|
+
if (!selectedElement || !chunkG3JPCRKN_js.hasTextProperties(selectedElement)) {
|
|
4379
4403
|
return;
|
|
4380
4404
|
}
|
|
4381
4405
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4382
4406
|
const currentSegments = liveTextSegments();
|
|
4383
|
-
const inlineSel =
|
|
4407
|
+
const inlineSel = chunkG3JPCRKN_js.getInlineEditorSelection(currentSegments);
|
|
4384
4408
|
if (inlineSel && currentSegments) {
|
|
4385
|
-
const newSegments =
|
|
4409
|
+
const newSegments = chunkG3JPCRKN_js.applyCaseTransformToSegments(currentSegments, inlineSel, mode);
|
|
4386
4410
|
updateSelectedElement({
|
|
4387
4411
|
textSegments: newSegments,
|
|
4388
4412
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4391,7 +4415,7 @@ function useElementOperations(input) {
|
|
|
4391
4415
|
}
|
|
4392
4416
|
const updates = {};
|
|
4393
4417
|
if (currentSegments && currentSegments.length > 0) {
|
|
4394
|
-
updates.textSegments =
|
|
4418
|
+
updates.textSegments = chunkG3JPCRKN_js.applyCaseTransformToSegments(
|
|
4395
4419
|
currentSegments,
|
|
4396
4420
|
null,
|
|
4397
4421
|
mode
|
|
@@ -4399,7 +4423,7 @@ function useElementOperations(input) {
|
|
|
4399
4423
|
}
|
|
4400
4424
|
const baseText = isLiveEditing ? inlineEditingText : selectedElement.text;
|
|
4401
4425
|
if (typeof baseText === "string") {
|
|
4402
|
-
updates.text =
|
|
4426
|
+
updates.text = chunkG3JPCRKN_js.transformTextCase(baseText, mode);
|
|
4403
4427
|
}
|
|
4404
4428
|
updateSelectedElement(updates);
|
|
4405
4429
|
},
|
|
@@ -4418,15 +4442,15 @@ function useElementOperations(input) {
|
|
|
4418
4442
|
[setSlides]
|
|
4419
4443
|
);
|
|
4420
4444
|
const masterViewTarget = masterView?.target ?? null;
|
|
4421
|
-
const activeElements = masterViewTarget ?
|
|
4445
|
+
const activeElements = masterViewTarget ? chunkG3JPCRKN_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4422
4446
|
const updateActiveElements = react.useCallback(
|
|
4423
4447
|
(updater) => {
|
|
4424
4448
|
if (masterView?.target) {
|
|
4425
4449
|
applyMasterViewWrite(
|
|
4426
|
-
|
|
4450
|
+
chunkG3JPCRKN_js.replaceMasterViewElements(
|
|
4427
4451
|
masterView,
|
|
4428
4452
|
masterView.target,
|
|
4429
|
-
updater(
|
|
4453
|
+
updater(chunkG3JPCRKN_js.masterViewElements(masterView, masterView.target))
|
|
4430
4454
|
)
|
|
4431
4455
|
);
|
|
4432
4456
|
return;
|
|
@@ -4479,7 +4503,7 @@ function useSectionOperations(input) {
|
|
|
4479
4503
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4480
4504
|
const addSection2 = react.useCallback(
|
|
4481
4505
|
(name, afterSlideIndex) => {
|
|
4482
|
-
const result =
|
|
4506
|
+
const result = chunkG3JPCRKN_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4483
4507
|
setSlides(result.slides);
|
|
4484
4508
|
setSections(result.sections);
|
|
4485
4509
|
markDirty();
|
|
@@ -4488,7 +4512,7 @@ function useSectionOperations(input) {
|
|
|
4488
4512
|
);
|
|
4489
4513
|
const renameSection2 = react.useCallback(
|
|
4490
4514
|
(sectionId, newName) => {
|
|
4491
|
-
const result =
|
|
4515
|
+
const result = chunkG3JPCRKN_js.renameSection(sections, slides, sectionId, newName);
|
|
4492
4516
|
setSections(result.sections);
|
|
4493
4517
|
setSlides(result.slides);
|
|
4494
4518
|
markDirty();
|
|
@@ -4497,7 +4521,7 @@ function useSectionOperations(input) {
|
|
|
4497
4521
|
);
|
|
4498
4522
|
const deleteSection2 = react.useCallback(
|
|
4499
4523
|
(sectionId) => {
|
|
4500
|
-
const result =
|
|
4524
|
+
const result = chunkG3JPCRKN_js.deleteSection(sections, slides, sectionId);
|
|
4501
4525
|
setSections(result.sections);
|
|
4502
4526
|
setSlides(result.slides);
|
|
4503
4527
|
markDirty();
|
|
@@ -4506,21 +4530,21 @@ function useSectionOperations(input) {
|
|
|
4506
4530
|
);
|
|
4507
4531
|
const moveSectionUp2 = react.useCallback(
|
|
4508
4532
|
(sectionId) => {
|
|
4509
|
-
setSections(
|
|
4533
|
+
setSections(chunkG3JPCRKN_js.moveSectionUp(sections, sectionId));
|
|
4510
4534
|
markDirty();
|
|
4511
4535
|
},
|
|
4512
4536
|
[sections, setSections, markDirty]
|
|
4513
4537
|
);
|
|
4514
4538
|
const moveSectionDown2 = react.useCallback(
|
|
4515
4539
|
(sectionId) => {
|
|
4516
|
-
setSections(
|
|
4540
|
+
setSections(chunkG3JPCRKN_js.moveSectionDown(sections, sectionId));
|
|
4517
4541
|
markDirty();
|
|
4518
4542
|
},
|
|
4519
4543
|
[sections, setSections, markDirty]
|
|
4520
4544
|
);
|
|
4521
4545
|
const moveSlidesToSection2 = react.useCallback(
|
|
4522
4546
|
(slideIndexes, targetSectionId) => {
|
|
4523
|
-
const result =
|
|
4547
|
+
const result = chunkG3JPCRKN_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4524
4548
|
setSlides(result.slides);
|
|
4525
4549
|
setSections(result.sections);
|
|
4526
4550
|
markDirty();
|
|
@@ -4586,15 +4610,15 @@ function syncSelectionHandleOverlay(elementNode, elementId, geometry) {
|
|
|
4586
4610
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4587
4611
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
|
|
4588
4612
|
const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
|
|
4589
|
-
let resized =
|
|
4613
|
+
let resized = chunkG3JPCRKN_js.applyResize(startBox, handle, dx, dy, 1, { minSize: chunkLBJAVP3H_js.MIN_ELEMENT_SIZE });
|
|
4590
4614
|
if (lockAspect) {
|
|
4591
|
-
resized =
|
|
4615
|
+
resized = chunkG3JPCRKN_js.lockResizeAspect(resized, startBox, handle, chunkLBJAVP3H_js.MIN_ELEMENT_SIZE);
|
|
4592
4616
|
}
|
|
4593
4617
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4594
4618
|
if (!snapToGrid) {
|
|
4595
4619
|
return box;
|
|
4596
4620
|
}
|
|
4597
|
-
return
|
|
4621
|
+
return chunkG3JPCRKN_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkLBJAVP3H_js.MIN_ELEMENT_SIZE);
|
|
4598
4622
|
}
|
|
4599
4623
|
function resolveLiveTarget(input) {
|
|
4600
4624
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4707,7 +4731,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4707
4731
|
width: el.width,
|
|
4708
4732
|
height: el.height
|
|
4709
4733
|
}));
|
|
4710
|
-
const snapResult =
|
|
4734
|
+
const snapResult = chunkG3JPCRKN_js.computeSnapToShape(
|
|
4711
4735
|
targetX,
|
|
4712
4736
|
targetY,
|
|
4713
4737
|
primaryEl.width,
|
|
@@ -4749,7 +4773,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4749
4773
|
if (live) {
|
|
4750
4774
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4751
4775
|
const start = drag.startPositionsById[id];
|
|
4752
|
-
|
|
4776
|
+
chunkG3JPCRKN_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4753
4777
|
x: start.x + appliedDx,
|
|
4754
4778
|
y: start.y + appliedDy
|
|
4755
4779
|
});
|
|
@@ -4781,8 +4805,8 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4781
4805
|
rs.lastY = geo.y;
|
|
4782
4806
|
rs.lastWidth = geo.width;
|
|
4783
4807
|
rs.lastHeight = geo.height;
|
|
4784
|
-
const width = Math.max(geo.width,
|
|
4785
|
-
const height = Math.max(geo.height,
|
|
4808
|
+
const width = Math.max(geo.width, chunkLBJAVP3H_js.MIN_ELEMENT_SIZE);
|
|
4809
|
+
const height = Math.max(geo.height, chunkLBJAVP3H_js.MIN_ELEMENT_SIZE);
|
|
4786
4810
|
if (rs.domEl) {
|
|
4787
4811
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4788
4812
|
rs.domEl.style.top = `${geo.y}px`;
|
|
@@ -4791,7 +4815,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4791
4815
|
syncSelectionHandleOverlay(rs.domEl, rs.elementId, { x: geo.x, y: geo.y, width, height });
|
|
4792
4816
|
}
|
|
4793
4817
|
if (live) {
|
|
4794
|
-
|
|
4818
|
+
chunkG3JPCRKN_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4795
4819
|
x: geo.x,
|
|
4796
4820
|
y: geo.y,
|
|
4797
4821
|
width,
|
|
@@ -4802,7 +4826,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4802
4826
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4803
4827
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4804
4828
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4805
|
-
const adjustments =
|
|
4829
|
+
const adjustments = chunkG3JPCRKN_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4806
4830
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4807
4831
|
adj.moved = true;
|
|
4808
4832
|
}
|
|
@@ -4877,13 +4901,13 @@ function processPointerUp(input) {
|
|
|
4877
4901
|
if (i !== activeSlideIndex) {
|
|
4878
4902
|
return s;
|
|
4879
4903
|
}
|
|
4880
|
-
const rerouted =
|
|
4904
|
+
const rerouted = chunkG3JPCRKN_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4881
4905
|
if (rerouted.length === 0) {
|
|
4882
4906
|
return s;
|
|
4883
4907
|
}
|
|
4884
4908
|
return {
|
|
4885
4909
|
...s,
|
|
4886
|
-
elements:
|
|
4910
|
+
elements: chunkG3JPCRKN_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4887
4911
|
};
|
|
4888
4912
|
})
|
|
4889
4913
|
);
|
|
@@ -4908,9 +4932,9 @@ function processPointerUp(input) {
|
|
|
4908
4932
|
}
|
|
4909
4933
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4910
4934
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4911
|
-
const hitIds =
|
|
4935
|
+
const hitIds = chunkG3JPCRKN_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4912
4936
|
if (marquee.additive) {
|
|
4913
|
-
const merged =
|
|
4937
|
+
const merged = chunkG3JPCRKN_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4914
4938
|
if (merged.length > 0) {
|
|
4915
4939
|
applySelection(merged[0], merged);
|
|
4916
4940
|
} else {
|
|
@@ -4933,8 +4957,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4933
4957
|
}
|
|
4934
4958
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4935
4959
|
});
|
|
4936
|
-
const rerouted =
|
|
4937
|
-
return
|
|
4960
|
+
const rerouted = chunkG3JPCRKN_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4961
|
+
return chunkG3JPCRKN_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4938
4962
|
};
|
|
4939
4963
|
if (editTemplateMode) {
|
|
4940
4964
|
const slideId = activeSlide?.id;
|
|
@@ -5090,12 +5114,12 @@ function useCanvasInteractions(input) {
|
|
|
5090
5114
|
return;
|
|
5091
5115
|
}
|
|
5092
5116
|
const el = elementLookup.get(editId);
|
|
5093
|
-
if (el &&
|
|
5117
|
+
if (el && chunkG3JPCRKN_js.hasTextProperties(el)) {
|
|
5094
5118
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
5095
|
-
const newSegments =
|
|
5119
|
+
const newSegments = chunkG3JPCRKN_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
5096
5120
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
5097
|
-
const newHeight =
|
|
5098
|
-
const shrink =
|
|
5121
|
+
const newHeight = chunkG3JPCRKN_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
5122
|
+
const shrink = chunkG3JPCRKN_js.resolveInlineEditNormAutofitShrink(el.textStyle, el.height, editorEl);
|
|
5099
5123
|
ops.updateElementById(editId, {
|
|
5100
5124
|
text: committedText,
|
|
5101
5125
|
textSegments: newSegments,
|
|
@@ -5114,7 +5138,7 @@ function useCanvasInteractions(input) {
|
|
|
5114
5138
|
setInlineEditingText("");
|
|
5115
5139
|
};
|
|
5116
5140
|
const openEquationEditorForElement = (el) => {
|
|
5117
|
-
if (!
|
|
5141
|
+
if (!chunkG3JPCRKN_js.hasTextProperties(el)) {
|
|
5118
5142
|
return false;
|
|
5119
5143
|
}
|
|
5120
5144
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5144,7 +5168,7 @@ function useCanvasInteractions(input) {
|
|
|
5144
5168
|
justInteractedRef.current = false;
|
|
5145
5169
|
} else {
|
|
5146
5170
|
const el = elementLookup.get(elementId);
|
|
5147
|
-
if (el &&
|
|
5171
|
+
if (el && chunkG3JPCRKN_js.hasTextProperties(el) && chunkG3JPCRKN_js.canInteractWithElement(el, "textEdit")) {
|
|
5148
5172
|
if (!openEquationEditorForElement(el)) {
|
|
5149
5173
|
setInlineEditingElementId(elementId);
|
|
5150
5174
|
setInlineEditingText(el.text ?? "");
|
|
@@ -5163,7 +5187,7 @@ function useCanvasInteractions(input) {
|
|
|
5163
5187
|
if (openEquationEditorForElement(el)) {
|
|
5164
5188
|
return;
|
|
5165
5189
|
}
|
|
5166
|
-
if (
|
|
5190
|
+
if (chunkG3JPCRKN_js.hasTextProperties(el) && chunkG3JPCRKN_js.canInteractWithElement(el, "textEdit")) {
|
|
5167
5191
|
setInlineEditingElementId(elementId);
|
|
5168
5192
|
setInlineEditingText(el.text ?? "");
|
|
5169
5193
|
}
|
|
@@ -5186,7 +5210,7 @@ function useCanvasInteractions(input) {
|
|
|
5186
5210
|
justSelectedRef.current = false;
|
|
5187
5211
|
}
|
|
5188
5212
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
5189
|
-
const movableIds =
|
|
5213
|
+
const movableIds = chunkG3JPCRKN_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
5190
5214
|
if (movableIds.length === 0) {
|
|
5191
5215
|
return;
|
|
5192
5216
|
}
|
|
@@ -5256,7 +5280,7 @@ function useCanvasInteractions(input) {
|
|
|
5256
5280
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5257
5281
|
e.stopPropagation();
|
|
5258
5282
|
const el = elementLookup.get(elementId);
|
|
5259
|
-
if (!el || !
|
|
5283
|
+
if (!el || !chunkG3JPCRKN_js.canInteractWithElement(el, "resize")) {
|
|
5260
5284
|
return;
|
|
5261
5285
|
}
|
|
5262
5286
|
resizeStateRef.current = {
|
|
@@ -5278,7 +5302,7 @@ function useCanvasInteractions(input) {
|
|
|
5278
5302
|
};
|
|
5279
5303
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5280
5304
|
const el = elementLookup.get(elementId);
|
|
5281
|
-
if (!el || !
|
|
5305
|
+
if (!el || !chunkG3JPCRKN_js.canInteractWithElement(el, "rotate")) {
|
|
5282
5306
|
return;
|
|
5283
5307
|
}
|
|
5284
5308
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5298,10 +5322,10 @@ function useCanvasInteractions(input) {
|
|
|
5298
5322
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5299
5323
|
e.stopPropagation();
|
|
5300
5324
|
const el = elementLookup.get(elementId);
|
|
5301
|
-
if (!el || !
|
|
5325
|
+
if (!el || !chunkG3JPCRKN_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5302
5326
|
return;
|
|
5303
5327
|
}
|
|
5304
|
-
shapeAdjustmentDragStateRef.current =
|
|
5328
|
+
shapeAdjustmentDragStateRef.current = chunkG3JPCRKN_js.beginShapeAdjustment(
|
|
5305
5329
|
el,
|
|
5306
5330
|
descriptor,
|
|
5307
5331
|
e.clientX,
|
|
@@ -5348,7 +5372,7 @@ function createFileHandlers(deps) {
|
|
|
5348
5372
|
h = Math.round(h * scale);
|
|
5349
5373
|
}
|
|
5350
5374
|
addElement({
|
|
5351
|
-
id:
|
|
5375
|
+
id: chunkG3JPCRKN_js.generateElementId(),
|
|
5352
5376
|
type: "image",
|
|
5353
5377
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5354
5378
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5359,7 +5383,7 @@ function createFileHandlers(deps) {
|
|
|
5359
5383
|
};
|
|
5360
5384
|
img.onerror = () => {
|
|
5361
5385
|
addElement({
|
|
5362
|
-
id:
|
|
5386
|
+
id: chunkG3JPCRKN_js.generateElementId(),
|
|
5363
5387
|
type: "image",
|
|
5364
5388
|
x: 100,
|
|
5365
5389
|
y: 100,
|
|
@@ -5378,14 +5402,14 @@ function createFileHandlers(deps) {
|
|
|
5378
5402
|
return;
|
|
5379
5403
|
}
|
|
5380
5404
|
e.target.value = "";
|
|
5381
|
-
const mediaType =
|
|
5405
|
+
const mediaType = chunkG3JPCRKN_js.classifyMediaType(file.type);
|
|
5382
5406
|
if (!mediaType) {
|
|
5383
5407
|
return;
|
|
5384
5408
|
}
|
|
5385
5409
|
const elFilePath = file.path;
|
|
5386
5410
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5387
5411
|
addElement({
|
|
5388
|
-
id:
|
|
5412
|
+
id: chunkG3JPCRKN_js.generateElementId(),
|
|
5389
5413
|
type: "media",
|
|
5390
5414
|
mediaType,
|
|
5391
5415
|
mediaMimeType: file.type || void 0,
|
|
@@ -5560,13 +5584,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5560
5584
|
return;
|
|
5561
5585
|
}
|
|
5562
5586
|
addElement({
|
|
5563
|
-
id:
|
|
5587
|
+
id: chunkG3JPCRKN_js.generateElementId(),
|
|
5564
5588
|
type: "smartArt",
|
|
5565
5589
|
x: 100,
|
|
5566
5590
|
y: 120,
|
|
5567
5591
|
width: 600,
|
|
5568
5592
|
height: 340,
|
|
5569
|
-
smartArtData:
|
|
5593
|
+
smartArtData: chunkG3JPCRKN_js.buildSmartArtPresetData(
|
|
5570
5594
|
layout,
|
|
5571
5595
|
defaultItems,
|
|
5572
5596
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5578,7 +5602,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5578
5602
|
return;
|
|
5579
5603
|
}
|
|
5580
5604
|
addElement({
|
|
5581
|
-
id:
|
|
5605
|
+
id: chunkG3JPCRKN_js.generateElementId(),
|
|
5582
5606
|
type: "shape",
|
|
5583
5607
|
x: 120,
|
|
5584
5608
|
y: 200,
|
|
@@ -5616,7 +5640,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5616
5640
|
return;
|
|
5617
5641
|
}
|
|
5618
5642
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5619
|
-
if (resolved.url && !
|
|
5643
|
+
if (resolved.url && !chunkG3JPCRKN_js.isUrlSafe(resolved.url)) {
|
|
5620
5644
|
return;
|
|
5621
5645
|
}
|
|
5622
5646
|
const actionClick = {
|
|
@@ -5640,7 +5664,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5640
5664
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5641
5665
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5642
5666
|
addElement({
|
|
5643
|
-
id:
|
|
5667
|
+
id: chunkG3JPCRKN_js.generateElementId(),
|
|
5644
5668
|
type: "shape",
|
|
5645
5669
|
x: 120,
|
|
5646
5670
|
y: 200,
|
|
@@ -5662,11 +5686,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5662
5686
|
if (!activeSlide) {
|
|
5663
5687
|
return;
|
|
5664
5688
|
}
|
|
5665
|
-
const preset =
|
|
5689
|
+
const preset = chunkG3JPCRKN_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5666
5690
|
if (!preset) {
|
|
5667
5691
|
return;
|
|
5668
5692
|
}
|
|
5669
|
-
const defaultPptxAction =
|
|
5693
|
+
const defaultPptxAction = chunkG3JPCRKN_js.elementActionToPptxAction({
|
|
5670
5694
|
trigger: "click",
|
|
5671
5695
|
type: preset.defaultAction
|
|
5672
5696
|
});
|
|
@@ -5675,7 +5699,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5675
5699
|
defaultPptxAction.highlightClick = true;
|
|
5676
5700
|
}
|
|
5677
5701
|
addElement({
|
|
5678
|
-
id:
|
|
5702
|
+
id: chunkG3JPCRKN_js.generateElementId(),
|
|
5679
5703
|
type: "shape",
|
|
5680
5704
|
x: 150,
|
|
5681
5705
|
y: 150,
|
|
@@ -5742,14 +5766,14 @@ function useInsertElements(input) {
|
|
|
5742
5766
|
return;
|
|
5743
5767
|
}
|
|
5744
5768
|
addElement({
|
|
5745
|
-
id:
|
|
5769
|
+
id: chunkG3JPCRKN_js.generateElementId(),
|
|
5746
5770
|
type: "text",
|
|
5747
5771
|
x: 100,
|
|
5748
5772
|
y: 100,
|
|
5749
5773
|
width: 300,
|
|
5750
5774
|
height: 60,
|
|
5751
5775
|
text: "",
|
|
5752
|
-
textStyle: { fontSize:
|
|
5776
|
+
textStyle: { fontSize: chunkLBJAVP3H_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5753
5777
|
});
|
|
5754
5778
|
};
|
|
5755
5779
|
const handleAddShape = () => {
|
|
@@ -5757,7 +5781,7 @@ function useInsertElements(input) {
|
|
|
5757
5781
|
return;
|
|
5758
5782
|
}
|
|
5759
5783
|
addElement({
|
|
5760
|
-
id:
|
|
5784
|
+
id: chunkG3JPCRKN_js.generateElementId(),
|
|
5761
5785
|
type: "shape",
|
|
5762
5786
|
x: 150,
|
|
5763
5787
|
y: 150,
|
|
@@ -5776,15 +5800,15 @@ function useInsertElements(input) {
|
|
|
5776
5800
|
return;
|
|
5777
5801
|
}
|
|
5778
5802
|
addElement({
|
|
5779
|
-
...
|
|
5780
|
-
id:
|
|
5803
|
+
...chunkG3JPCRKN_js.newTableElement(chunkLBJAVP3H_js.DEFAULT_TABLE_ROWS, chunkLBJAVP3H_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5804
|
+
id: chunkG3JPCRKN_js.generateElementId()
|
|
5781
5805
|
});
|
|
5782
5806
|
};
|
|
5783
5807
|
const handleAddChart = (chartKind) => {
|
|
5784
5808
|
if (!activeSlide) {
|
|
5785
5809
|
return;
|
|
5786
5810
|
}
|
|
5787
|
-
addElement(
|
|
5811
|
+
addElement(chunkG3JPCRKN_js.createDefaultChartElement(chartKind));
|
|
5788
5812
|
};
|
|
5789
5813
|
const structured = createStructuredElementHandlers({
|
|
5790
5814
|
activeSlide,
|
|
@@ -5854,7 +5878,7 @@ function useClipboardHandlers(input) {
|
|
|
5854
5878
|
if (!selectedElement) {
|
|
5855
5879
|
return;
|
|
5856
5880
|
}
|
|
5857
|
-
setClipboardPayload(
|
|
5881
|
+
setClipboardPayload(chunkG3JPCRKN_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5858
5882
|
};
|
|
5859
5883
|
const handleDelete = () => {
|
|
5860
5884
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5871,7 +5895,7 @@ function useClipboardHandlers(input) {
|
|
|
5871
5895
|
handleDelete();
|
|
5872
5896
|
};
|
|
5873
5897
|
const insertClone = (source) => {
|
|
5874
|
-
const clone =
|
|
5898
|
+
const clone = chunkG3JPCRKN_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5875
5899
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5876
5900
|
ops.applySelection(clone.id);
|
|
5877
5901
|
history.markDirty();
|
|
@@ -5906,7 +5930,7 @@ function resolveShapePath(el) {
|
|
|
5906
5930
|
return el.pathData;
|
|
5907
5931
|
}
|
|
5908
5932
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5909
|
-
const clipPath =
|
|
5933
|
+
const clipPath = chunkG3JPCRKN_js.getPresetShapeClipPath(el.shapeType);
|
|
5910
5934
|
if (clipPath) {
|
|
5911
5935
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5912
5936
|
if (svgPath) {
|
|
@@ -5957,7 +5981,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5957
5981
|
return parts.join(" ");
|
|
5958
5982
|
}
|
|
5959
5983
|
function transformPathToGlobal(pathData, el) {
|
|
5960
|
-
const polys =
|
|
5984
|
+
const polys = chunkG3JPCRKN_js.svgPathToPolygons(pathData);
|
|
5961
5985
|
if (polys.length === 0) {
|
|
5962
5986
|
return pathData;
|
|
5963
5987
|
}
|
|
@@ -5977,10 +6001,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5977
6001
|
y: pt.y * scaleY + el.y
|
|
5978
6002
|
}))
|
|
5979
6003
|
);
|
|
5980
|
-
return
|
|
6004
|
+
return chunkG3JPCRKN_js.polygonsToSvgPath(transformed);
|
|
5981
6005
|
}
|
|
5982
6006
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5983
|
-
const polys =
|
|
6007
|
+
const polys = chunkG3JPCRKN_js.svgPathToPolygons(pathData);
|
|
5984
6008
|
if (polys.length === 0) {
|
|
5985
6009
|
return pathData;
|
|
5986
6010
|
}
|
|
@@ -5990,10 +6014,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5990
6014
|
y: pt.y - y
|
|
5991
6015
|
}))
|
|
5992
6016
|
);
|
|
5993
|
-
return
|
|
6017
|
+
return chunkG3JPCRKN_js.polygonsToSvgPath(transformed);
|
|
5994
6018
|
}
|
|
5995
6019
|
function pathBounds(pathData) {
|
|
5996
|
-
const polys =
|
|
6020
|
+
const polys = chunkG3JPCRKN_js.svgPathToPolygons(pathData);
|
|
5997
6021
|
let minX = Infinity;
|
|
5998
6022
|
let minY = Infinity;
|
|
5999
6023
|
let maxX = -Infinity;
|
|
@@ -6052,7 +6076,7 @@ function useMergeShapesHandler(input) {
|
|
|
6052
6076
|
let allFragments = [];
|
|
6053
6077
|
let remaining = globalPaths[0];
|
|
6054
6078
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6055
|
-
const frags =
|
|
6079
|
+
const frags = chunkG3JPCRKN_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
6056
6080
|
if (Array.isArray(frags)) {
|
|
6057
6081
|
allFragments = frags;
|
|
6058
6082
|
}
|
|
@@ -6081,7 +6105,7 @@ function useMergeShapesHandler(input) {
|
|
|
6081
6105
|
bounds.height
|
|
6082
6106
|
);
|
|
6083
6107
|
const newEl = {
|
|
6084
|
-
id:
|
|
6108
|
+
id: chunkG3JPCRKN_js.generateElementId(),
|
|
6085
6109
|
type: "shape",
|
|
6086
6110
|
x: bounds.x,
|
|
6087
6111
|
y: bounds.y,
|
|
@@ -6119,7 +6143,7 @@ function useMergeShapesHandler(input) {
|
|
|
6119
6143
|
} else {
|
|
6120
6144
|
let resultPath = globalPaths[0];
|
|
6121
6145
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6122
|
-
const result =
|
|
6146
|
+
const result = chunkG3JPCRKN_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
6123
6147
|
if (typeof result === "string") {
|
|
6124
6148
|
resultPath = result;
|
|
6125
6149
|
}
|
|
@@ -6140,7 +6164,7 @@ function useMergeShapesHandler(input) {
|
|
|
6140
6164
|
);
|
|
6141
6165
|
const primary = targets[0];
|
|
6142
6166
|
const newEl = {
|
|
6143
|
-
id:
|
|
6167
|
+
id: chunkG3JPCRKN_js.generateElementId(),
|
|
6144
6168
|
type: "shape",
|
|
6145
6169
|
x: bounds.x,
|
|
6146
6170
|
y: bounds.y,
|
|
@@ -6203,10 +6227,10 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6203
6227
|
if (ids.length < 2 || !activeSlide) {
|
|
6204
6228
|
return;
|
|
6205
6229
|
}
|
|
6206
|
-
if (!selectedElements.every((el) =>
|
|
6230
|
+
if (!selectedElements.every((el) => chunkG3JPCRKN_js.canInteractWithElement(el, "group"))) {
|
|
6207
6231
|
return;
|
|
6208
6232
|
}
|
|
6209
|
-
const { elements, groupId } =
|
|
6233
|
+
const { elements, groupId } = chunkG3JPCRKN_js.groupElements(ops.activeElements, ids, chunkG3JPCRKN_js.generateElementId());
|
|
6210
6234
|
if (groupId === null) {
|
|
6211
6235
|
return;
|
|
6212
6236
|
}
|
|
@@ -6218,15 +6242,15 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6218
6242
|
if (!selectedElement || selectedElement.type !== "group" || !activeSlide) {
|
|
6219
6243
|
return;
|
|
6220
6244
|
}
|
|
6221
|
-
if (!
|
|
6245
|
+
if (!chunkG3JPCRKN_js.canInteractWithElement(selectedElement, "group")) {
|
|
6222
6246
|
return;
|
|
6223
6247
|
}
|
|
6224
6248
|
const group = selectedElement;
|
|
6225
|
-
const intoTemplate =
|
|
6249
|
+
const intoTemplate = chunkG3JPCRKN_js.isTemplateElementId(group.id);
|
|
6226
6250
|
const childIds = group.children.map(
|
|
6227
|
-
(child) => intoTemplate ?
|
|
6251
|
+
(child) => intoTemplate ? chunkG3JPCRKN_js.makeCloneId(true, child.id || group.id) : child.id || chunkG3JPCRKN_js.generateElementId()
|
|
6228
6252
|
);
|
|
6229
|
-
const { elements, childIds: usedIds } =
|
|
6253
|
+
const { elements, childIds: usedIds } = chunkG3JPCRKN_js.ungroupElements(
|
|
6230
6254
|
ops.activeElements,
|
|
6231
6255
|
group.id,
|
|
6232
6256
|
childIds,
|
|
@@ -6255,7 +6279,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6255
6279
|
if (!edge) {
|
|
6256
6280
|
return;
|
|
6257
6281
|
}
|
|
6258
|
-
const positions =
|
|
6282
|
+
const positions = chunkG3JPCRKN_js.alignElements(selectedElements, edge);
|
|
6259
6283
|
for (const [id, pos] of positions) {
|
|
6260
6284
|
const el = elementLookup.get(id);
|
|
6261
6285
|
if (!el) {
|
|
@@ -6273,7 +6297,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6273
6297
|
if (!distAxis) {
|
|
6274
6298
|
return;
|
|
6275
6299
|
}
|
|
6276
|
-
const positions =
|
|
6300
|
+
const positions = chunkG3JPCRKN_js.distributeElements(selectedElements, distAxis);
|
|
6277
6301
|
for (const [id, pos] of positions) {
|
|
6278
6302
|
const el = elementLookup.get(id);
|
|
6279
6303
|
if (!el) {
|
|
@@ -6284,14 +6308,14 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6284
6308
|
history.markDirty();
|
|
6285
6309
|
};
|
|
6286
6310
|
const canDistribute = selectedElements.length >= 3;
|
|
6287
|
-
const selectionGroupable = selectedElements.every((el) =>
|
|
6311
|
+
const selectionGroupable = selectedElements.every((el) => chunkG3JPCRKN_js.canInteractWithElement(el, "group"));
|
|
6288
6312
|
const handleMoveLayer = (direction) => {
|
|
6289
6313
|
if (!selectedElement || !activeSlide) {
|
|
6290
6314
|
return;
|
|
6291
6315
|
}
|
|
6292
6316
|
const id = selectedElement.id;
|
|
6293
6317
|
ops.updateActiveElements(
|
|
6294
|
-
(els) => direction === "forward" ?
|
|
6318
|
+
(els) => direction === "forward" ? chunkG3JPCRKN_js.bringForward(els, id) : direction === "backward" ? chunkG3JPCRKN_js.sendBackward(els, id) : els
|
|
6295
6319
|
);
|
|
6296
6320
|
history.markDirty();
|
|
6297
6321
|
};
|
|
@@ -6301,7 +6325,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6301
6325
|
}
|
|
6302
6326
|
const id = selectedElement.id;
|
|
6303
6327
|
ops.updateActiveElements(
|
|
6304
|
-
(els) => direction === "front" ?
|
|
6328
|
+
(els) => direction === "front" ? chunkG3JPCRKN_js.bringToFront(els, id) : chunkG3JPCRKN_js.sendToBack(els, id)
|
|
6305
6329
|
);
|
|
6306
6330
|
history.markDirty();
|
|
6307
6331
|
};
|
|
@@ -6435,7 +6459,7 @@ function useSlideManagement(input) {
|
|
|
6435
6459
|
theme
|
|
6436
6460
|
} = input;
|
|
6437
6461
|
const handleAddSlide = () => {
|
|
6438
|
-
const newSlide =
|
|
6462
|
+
const newSlide = chunkG3JPCRKN_js.createBlankSlide(slides.length + 1);
|
|
6439
6463
|
ops.updateSlides((prev) => {
|
|
6440
6464
|
const next = [...prev];
|
|
6441
6465
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6498,7 +6522,7 @@ function useSlideManagement(input) {
|
|
|
6498
6522
|
}
|
|
6499
6523
|
const clone = {
|
|
6500
6524
|
...src,
|
|
6501
|
-
id:
|
|
6525
|
+
id: chunkG3JPCRKN_js.makeSlideId(),
|
|
6502
6526
|
elements: src.elements.map((el) => ({
|
|
6503
6527
|
...el,
|
|
6504
6528
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6530,7 +6554,7 @@ function useSlideManagement(input) {
|
|
|
6530
6554
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6531
6555
|
const insertAt = activeSlideIndex + 1;
|
|
6532
6556
|
const draft = {
|
|
6533
|
-
...
|
|
6557
|
+
...chunkG3JPCRKN_js.createBlankSlide(slides.length + 1),
|
|
6534
6558
|
layoutPath,
|
|
6535
6559
|
...layoutName ? { layoutName } : {}
|
|
6536
6560
|
};
|
|
@@ -6563,9 +6587,9 @@ function useSlideManagement(input) {
|
|
|
6563
6587
|
};
|
|
6564
6588
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6565
6589
|
const insertAt = activeSlideIndex + 1;
|
|
6566
|
-
const draft =
|
|
6590
|
+
const draft = chunkG3JPCRKN_js.buildSlideTemplateSlide(templateId, chunkG3JPCRKN_js.makeSlideId(), slides.length + 1, {
|
|
6567
6591
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6568
|
-
scheme:
|
|
6592
|
+
scheme: chunkG3JPCRKN_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6569
6593
|
});
|
|
6570
6594
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6571
6595
|
setActiveSlideIndex(insertAt);
|
|
@@ -6602,7 +6626,7 @@ function createTableMergeHandlers(input) {
|
|
|
6602
6626
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6603
6627
|
return;
|
|
6604
6628
|
}
|
|
6605
|
-
const newTableData =
|
|
6629
|
+
const newTableData = chunkG3JPCRKN_js.mergeCells(
|
|
6606
6630
|
[
|
|
6607
6631
|
{ row: rowIndex, col: columnIndex },
|
|
6608
6632
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6610,7 +6634,7 @@ function createTableMergeHandlers(input) {
|
|
|
6610
6634
|
td
|
|
6611
6635
|
);
|
|
6612
6636
|
const updates = { tableData: newTableData };
|
|
6613
|
-
const newRawXml =
|
|
6637
|
+
const newRawXml = chunkG3JPCRKN_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6614
6638
|
if (newRawXml) {
|
|
6615
6639
|
updates.rawXml = newRawXml;
|
|
6616
6640
|
}
|
|
@@ -6636,7 +6660,7 @@ function createTableMergeHandlers(input) {
|
|
|
6636
6660
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6637
6661
|
return;
|
|
6638
6662
|
}
|
|
6639
|
-
const newTableData =
|
|
6663
|
+
const newTableData = chunkG3JPCRKN_js.mergeCells(
|
|
6640
6664
|
[
|
|
6641
6665
|
{ row: rowIndex, col: columnIndex },
|
|
6642
6666
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6644,7 +6668,7 @@ function createTableMergeHandlers(input) {
|
|
|
6644
6668
|
td
|
|
6645
6669
|
);
|
|
6646
6670
|
const updates = { tableData: newTableData };
|
|
6647
|
-
const newRawXml =
|
|
6671
|
+
const newRawXml = chunkG3JPCRKN_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6648
6672
|
if (newRawXml) {
|
|
6649
6673
|
updates.rawXml = newRawXml;
|
|
6650
6674
|
}
|
|
@@ -6659,9 +6683,9 @@ function createTableMergeHandlers(input) {
|
|
|
6659
6683
|
return;
|
|
6660
6684
|
}
|
|
6661
6685
|
const td = selectedElement.tableData;
|
|
6662
|
-
const newTableData =
|
|
6686
|
+
const newTableData = chunkG3JPCRKN_js.mergeCells(ts.selectedCells, td);
|
|
6663
6687
|
const updates = { tableData: newTableData };
|
|
6664
|
-
const newRawXml =
|
|
6688
|
+
const newRawXml = chunkG3JPCRKN_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6665
6689
|
if (newRawXml) {
|
|
6666
6690
|
updates.rawXml = newRawXml;
|
|
6667
6691
|
}
|
|
@@ -6678,9 +6702,9 @@ function createTableMergeHandlers(input) {
|
|
|
6678
6702
|
}
|
|
6679
6703
|
const { rowIndex, columnIndex } = ts;
|
|
6680
6704
|
const td = selectedElement.tableData;
|
|
6681
|
-
const newTableData =
|
|
6705
|
+
const newTableData = chunkG3JPCRKN_js.splitCell(rowIndex, columnIndex, td);
|
|
6682
6706
|
const updates = { tableData: newTableData };
|
|
6683
|
-
const newRawXml =
|
|
6707
|
+
const newRawXml = chunkG3JPCRKN_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6684
6708
|
if (newRawXml) {
|
|
6685
6709
|
updates.rawXml = newRawXml;
|
|
6686
6710
|
}
|
|
@@ -6714,10 +6738,10 @@ function createTableStructHandlers(input) {
|
|
|
6714
6738
|
const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
|
|
6715
6739
|
const updates = {};
|
|
6716
6740
|
if (el.tableData) {
|
|
6717
|
-
updates.tableData =
|
|
6741
|
+
updates.tableData = chunkG3JPCRKN_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6718
6742
|
}
|
|
6719
6743
|
if (el.rawXml) {
|
|
6720
|
-
const newRawXml =
|
|
6744
|
+
const newRawXml = chunkG3JPCRKN_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6721
6745
|
if (newRawXml) {
|
|
6722
6746
|
updates.rawXml = newRawXml;
|
|
6723
6747
|
}
|
|
@@ -6741,7 +6765,7 @@ function createTableStructHandlers(input) {
|
|
|
6741
6765
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6742
6766
|
const updates = {};
|
|
6743
6767
|
if (selectedElement.rawXml) {
|
|
6744
|
-
const newRawXml =
|
|
6768
|
+
const newRawXml = chunkG3JPCRKN_js.updateCellTextStyleInRawXml(
|
|
6745
6769
|
selectedElement,
|
|
6746
6770
|
rowIndex,
|
|
6747
6771
|
colIndex,
|
|
@@ -6805,9 +6829,9 @@ function createTableStructHandlers(input) {
|
|
|
6805
6829
|
return;
|
|
6806
6830
|
}
|
|
6807
6831
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6808
|
-
const newTableData =
|
|
6832
|
+
const newTableData = chunkG3JPCRKN_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6809
6833
|
const updates = { tableData: newTableData };
|
|
6810
|
-
const newRawXml =
|
|
6834
|
+
const newRawXml = chunkG3JPCRKN_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6811
6835
|
if (newRawXml) {
|
|
6812
6836
|
updates.rawXml = newRawXml;
|
|
6813
6837
|
}
|
|
@@ -6820,12 +6844,12 @@ function createTableStructHandlers(input) {
|
|
|
6820
6844
|
}
|
|
6821
6845
|
const td = selectedElement.tableData;
|
|
6822
6846
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6823
|
-
const newTableData =
|
|
6847
|
+
const newTableData = chunkG3JPCRKN_js.deleteTableRow(td, rowIdx);
|
|
6824
6848
|
if (newTableData === td) {
|
|
6825
6849
|
return;
|
|
6826
6850
|
}
|
|
6827
6851
|
const updates = { tableData: newTableData };
|
|
6828
|
-
const newRawXml =
|
|
6852
|
+
const newRawXml = chunkG3JPCRKN_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6829
6853
|
if (newRawXml) {
|
|
6830
6854
|
updates.rawXml = newRawXml;
|
|
6831
6855
|
}
|
|
@@ -6837,9 +6861,9 @@ function createTableStructHandlers(input) {
|
|
|
6837
6861
|
return;
|
|
6838
6862
|
}
|
|
6839
6863
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6840
|
-
const newTableData =
|
|
6864
|
+
const newTableData = chunkG3JPCRKN_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6841
6865
|
const updates = { tableData: newTableData };
|
|
6842
|
-
const newRawXml =
|
|
6866
|
+
const newRawXml = chunkG3JPCRKN_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6843
6867
|
if (newRawXml) {
|
|
6844
6868
|
updates.rawXml = newRawXml;
|
|
6845
6869
|
}
|
|
@@ -6852,12 +6876,12 @@ function createTableStructHandlers(input) {
|
|
|
6852
6876
|
}
|
|
6853
6877
|
const td = selectedElement.tableData;
|
|
6854
6878
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6855
|
-
const newTableData =
|
|
6879
|
+
const newTableData = chunkG3JPCRKN_js.deleteTableColumn(td, colIdx);
|
|
6856
6880
|
if (newTableData === td) {
|
|
6857
6881
|
return;
|
|
6858
6882
|
}
|
|
6859
6883
|
const updates = { tableData: newTableData };
|
|
6860
|
-
const newRawXml =
|
|
6884
|
+
const newRawXml = chunkG3JPCRKN_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6861
6885
|
if (newRawXml) {
|
|
6862
6886
|
updates.rawXml = newRawXml;
|
|
6863
6887
|
}
|
|
@@ -6893,8 +6917,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6893
6917
|
return html2canvasPro(element, {
|
|
6894
6918
|
...options,
|
|
6895
6919
|
onclone: async (doc, clonedEl) => {
|
|
6896
|
-
await
|
|
6897
|
-
|
|
6920
|
+
await chunkG3JPCRKN_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6921
|
+
chunkG3JPCRKN_js.preprocessCssForCapture(clonedEl);
|
|
6898
6922
|
if (typeof userOnClone === "function") {
|
|
6899
6923
|
userOnClone(doc, clonedEl);
|
|
6900
6924
|
}
|
|
@@ -6908,7 +6932,7 @@ function useExportSaveAs(input) {
|
|
|
6908
6932
|
slides,
|
|
6909
6933
|
templateElementsBySlideId,
|
|
6910
6934
|
filePath,
|
|
6911
|
-
|
|
6935
|
+
serializeSlides,
|
|
6912
6936
|
headerFooter,
|
|
6913
6937
|
presentationProperties,
|
|
6914
6938
|
customShows,
|
|
@@ -6917,72 +6941,32 @@ function useExportSaveAs(input) {
|
|
|
6917
6941
|
appProperties,
|
|
6918
6942
|
customProperties,
|
|
6919
6943
|
tagCollections,
|
|
6920
|
-
slideMasters,
|
|
6921
6944
|
notesMaster,
|
|
6922
6945
|
handoutMaster,
|
|
6923
|
-
guides,
|
|
6924
|
-
activeSlideIndexForGuides,
|
|
6925
6946
|
theme,
|
|
6926
6947
|
canvasSize,
|
|
6927
|
-
slideSizeEmu
|
|
6928
|
-
password
|
|
6948
|
+
slideSizeEmu
|
|
6929
6949
|
} = input;
|
|
6930
6950
|
const handleSaveAsFormat = async (format) => {
|
|
6931
|
-
const
|
|
6932
|
-
if (!handler) {
|
|
6933
|
-
return;
|
|
6934
|
-
}
|
|
6935
|
-
const downloadName = chunkDCNHUEWQ_js.savedPresentationFileName(filePath, format);
|
|
6951
|
+
const downloadName = chunkG3JPCRKN_js.savedPresentationFileName(filePath, format);
|
|
6936
6952
|
try {
|
|
6937
|
-
const data = await
|
|
6953
|
+
const data = await serializeSlides(format);
|
|
6954
|
+
if (!data) {
|
|
6955
|
+
return;
|
|
6956
|
+
}
|
|
6938
6957
|
const blob = new Blob([data], {
|
|
6939
6958
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6940
6959
|
});
|
|
6941
|
-
|
|
6960
|
+
chunkG3JPCRKN_js.downloadBlob(blob, downloadName);
|
|
6942
6961
|
} catch (err) {
|
|
6943
6962
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
6944
6963
|
}
|
|
6945
6964
|
};
|
|
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
6965
|
const handleExportJson = () => {
|
|
6982
6966
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
6983
|
-
const slideSize =
|
|
6967
|
+
const slideSize = chunkG3JPCRKN_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
6984
6968
|
const data = {
|
|
6985
|
-
slides:
|
|
6969
|
+
slides: chunkG3JPCRKN_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
6986
6970
|
width: canvasSize.width,
|
|
6987
6971
|
height: canvasSize.height,
|
|
6988
6972
|
widthEmu: slideSize.widthEmu,
|
|
@@ -6993,15 +6977,15 @@ function useExportSaveAs(input) {
|
|
|
6993
6977
|
presentationProperties,
|
|
6994
6978
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
6995
6979
|
sections: sections.length > 0 ? sections : void 0,
|
|
6996
|
-
coreProperties
|
|
6997
|
-
appProperties
|
|
6980
|
+
coreProperties,
|
|
6981
|
+
appProperties,
|
|
6998
6982
|
customProperties: customProperties.length > 0 ? customProperties : void 0,
|
|
6999
6983
|
tags: tagCollections.length > 0 ? tagCollections : void 0,
|
|
7000
6984
|
notesMaster,
|
|
7001
6985
|
handoutMaster
|
|
7002
6986
|
};
|
|
7003
6987
|
try {
|
|
7004
|
-
|
|
6988
|
+
chunkG3JPCRKN_js.exportDeckJson(data, sourceName);
|
|
7005
6989
|
} catch (err) {
|
|
7006
6990
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7007
6991
|
}
|
|
@@ -7088,7 +7072,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
7088
7072
|
}
|
|
7089
7073
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
7090
7074
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
7091
|
-
|
|
7075
|
+
chunkG3JPCRKN_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
7092
7076
|
}
|
|
7093
7077
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
7094
7078
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -7110,15 +7094,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7110
7094
|
continue;
|
|
7111
7095
|
}
|
|
7112
7096
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
7113
|
-
images.push(
|
|
7097
|
+
images.push(chunkG3JPCRKN_js.canvasToJpegData(canvas));
|
|
7114
7098
|
}
|
|
7115
7099
|
onProgress?.(totalSlides, totalSlides);
|
|
7116
7100
|
setActiveSlide(currentSlideIndex);
|
|
7117
7101
|
if (images.length === 0) {
|
|
7118
|
-
throw new Error(
|
|
7102
|
+
throw new Error(chunkTEVGDXVW_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7119
7103
|
}
|
|
7120
|
-
const pdfBlobUrl =
|
|
7121
|
-
|
|
7104
|
+
const pdfBlobUrl = chunkLBJAVP3H_js.buildPdfFromImageData(images);
|
|
7105
|
+
chunkG3JPCRKN_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
7122
7106
|
}
|
|
7123
7107
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
7124
7108
|
const { scale = 2, onProgress } = options;
|
|
@@ -7164,10 +7148,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7164
7148
|
onProgress?.(totalSlides, totalSlides);
|
|
7165
7149
|
setActiveSlide(currentSlideIndex);
|
|
7166
7150
|
if (pages.length === 0) {
|
|
7167
|
-
throw new Error(
|
|
7151
|
+
throw new Error(chunkTEVGDXVW_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7168
7152
|
}
|
|
7169
|
-
const pdfDataUrl =
|
|
7170
|
-
|
|
7153
|
+
const pdfDataUrl = chunkLBJAVP3H_js.buildNotesPdf(pages);
|
|
7154
|
+
chunkG3JPCRKN_js.downloadDataUrl(pdfDataUrl, filename);
|
|
7171
7155
|
}
|
|
7172
7156
|
|
|
7173
7157
|
// src/viewer/utils/export-video.ts
|
|
@@ -7198,7 +7182,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7198
7182
|
}
|
|
7199
7183
|
setActiveSlide(currentSlideIndex);
|
|
7200
7184
|
if (slideCanvases.length === 0) {
|
|
7201
|
-
throw new Error(
|
|
7185
|
+
throw new Error(chunkTEVGDXVW_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
7202
7186
|
}
|
|
7203
7187
|
const firstCanvas = slideCanvases[0];
|
|
7204
7188
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -7206,12 +7190,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7206
7190
|
recordingCanvas.height = firstCanvas.height;
|
|
7207
7191
|
const ctx = recordingCanvas.getContext("2d");
|
|
7208
7192
|
if (!ctx) {
|
|
7209
|
-
throw new Error(
|
|
7193
|
+
throw new Error(chunkTEVGDXVW_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
7210
7194
|
}
|
|
7211
7195
|
const fps = 30;
|
|
7212
7196
|
const stream = recordingCanvas.captureStream(fps);
|
|
7213
7197
|
const recorder = new MediaRecorder(stream, {
|
|
7214
|
-
mimeType:
|
|
7198
|
+
mimeType: chunkG3JPCRKN_js.pickSupportedMimeType([...chunkG3JPCRKN_js.WEBM_MIME_CANDIDATES]),
|
|
7215
7199
|
videoBitsPerSecond: 5e6
|
|
7216
7200
|
});
|
|
7217
7201
|
const chunks = [];
|
|
@@ -7234,8 +7218,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7234
7218
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
7235
7219
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
7236
7220
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
7237
|
-
const frameInterval =
|
|
7238
|
-
const framesNeeded =
|
|
7221
|
+
const frameInterval = chunkG3JPCRKN_js.fpsToFrameIntervalMs(fps);
|
|
7222
|
+
const framesNeeded = chunkG3JPCRKN_js.segmentFrameCount(duration, fps);
|
|
7239
7223
|
for (let f = 0; f < framesNeeded; f++) {
|
|
7240
7224
|
if (signal?.aborted) {
|
|
7241
7225
|
recorder.stop();
|
|
@@ -7282,9 +7266,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7282
7266
|
}
|
|
7283
7267
|
setActiveSlide(currentSlideIndex);
|
|
7284
7268
|
if (frames.length === 0) {
|
|
7285
|
-
throw new Error(
|
|
7269
|
+
throw new Error(chunkTEVGDXVW_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
7286
7270
|
}
|
|
7287
|
-
const gifBytes =
|
|
7271
|
+
const gifBytes = chunkG3JPCRKN_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
7288
7272
|
onProgress?.(totalSlides, totalSlides);
|
|
7289
7273
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
7290
7274
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -7338,7 +7322,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7338
7322
|
continue;
|
|
7339
7323
|
}
|
|
7340
7324
|
onProgress?.(processedCount, data.slides.length);
|
|
7341
|
-
let svg =
|
|
7325
|
+
let svg = chunkG3JPCRKN_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7342
7326
|
if (embedFonts && fontFaces?.length) {
|
|
7343
7327
|
svg = injectFontFaces(svg, fontFaces);
|
|
7344
7328
|
}
|
|
@@ -7359,7 +7343,7 @@ function useExportHandlers(input) {
|
|
|
7359
7343
|
filePath,
|
|
7360
7344
|
canvasStageRef,
|
|
7361
7345
|
setActiveSlideIndex,
|
|
7362
|
-
|
|
7346
|
+
serializeSlides,
|
|
7363
7347
|
headerFooter,
|
|
7364
7348
|
presentationProperties,
|
|
7365
7349
|
customShows,
|
|
@@ -7368,15 +7352,11 @@ function useExportHandlers(input) {
|
|
|
7368
7352
|
appProperties,
|
|
7369
7353
|
customProperties,
|
|
7370
7354
|
tagCollections,
|
|
7371
|
-
slideMasters,
|
|
7372
7355
|
notesMaster,
|
|
7373
7356
|
handoutMaster,
|
|
7374
|
-
guides,
|
|
7375
|
-
activeSlideIndexForGuides,
|
|
7376
7357
|
theme,
|
|
7377
7358
|
canvasSize,
|
|
7378
7359
|
slideSizeEmu,
|
|
7379
|
-
password,
|
|
7380
7360
|
imageExportScale
|
|
7381
7361
|
} = input;
|
|
7382
7362
|
const [exportModalOpen, setExportModalOpen] = react.useState(false);
|
|
@@ -7394,7 +7374,7 @@ function useExportHandlers(input) {
|
|
|
7394
7374
|
slides,
|
|
7395
7375
|
templateElementsBySlideId,
|
|
7396
7376
|
filePath,
|
|
7397
|
-
|
|
7377
|
+
serializeSlides,
|
|
7398
7378
|
headerFooter,
|
|
7399
7379
|
presentationProperties,
|
|
7400
7380
|
customShows,
|
|
@@ -7403,15 +7383,11 @@ function useExportHandlers(input) {
|
|
|
7403
7383
|
appProperties,
|
|
7404
7384
|
customProperties,
|
|
7405
7385
|
tagCollections,
|
|
7406
|
-
slideMasters,
|
|
7407
7386
|
notesMaster,
|
|
7408
7387
|
handoutMaster,
|
|
7409
|
-
guides,
|
|
7410
|
-
activeSlideIndexForGuides,
|
|
7411
7388
|
theme,
|
|
7412
7389
|
canvasSize,
|
|
7413
|
-
slideSizeEmu
|
|
7414
|
-
password
|
|
7390
|
+
slideSizeEmu
|
|
7415
7391
|
});
|
|
7416
7392
|
const handleExportPng = react.useCallback(async () => {
|
|
7417
7393
|
const stageEl = canvasStageRef.current;
|
|
@@ -7447,21 +7423,21 @@ function useExportHandlers(input) {
|
|
|
7447
7423
|
{
|
|
7448
7424
|
scale: imageExportScale,
|
|
7449
7425
|
onProgress: (current, total) => {
|
|
7450
|
-
setExportProgress(
|
|
7451
|
-
setExportStatusMessage(
|
|
7426
|
+
setExportProgress(chunkG3JPCRKN_js.slideProgressPercent(current, total));
|
|
7427
|
+
setExportStatusMessage(chunkG3JPCRKN_js.slideStatusLabel("Rendering", current, total));
|
|
7452
7428
|
},
|
|
7453
7429
|
signal: abortCtrl.signal
|
|
7454
7430
|
}
|
|
7455
7431
|
);
|
|
7456
|
-
setExportProgress(
|
|
7432
|
+
setExportProgress(chunkG3JPCRKN_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7457
7433
|
setExportStatusMessage("Building PDF...");
|
|
7458
7434
|
await new Promise((r) => {
|
|
7459
7435
|
setTimeout(r, 100);
|
|
7460
7436
|
});
|
|
7461
|
-
setExportProgress(
|
|
7437
|
+
setExportProgress(chunkG3JPCRKN_js.EXPORT_DONE_PERCENT);
|
|
7462
7438
|
setExportStatusMessage("Done!");
|
|
7463
7439
|
} catch (err) {
|
|
7464
|
-
if (!
|
|
7440
|
+
if (!chunkG3JPCRKN_js.isExportAbortError(err)) {
|
|
7465
7441
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7466
7442
|
}
|
|
7467
7443
|
} finally {
|
|
@@ -7491,21 +7467,21 @@ function useExportHandlers(input) {
|
|
|
7491
7467
|
{
|
|
7492
7468
|
scale: imageExportScale,
|
|
7493
7469
|
onProgress: (current, total) => {
|
|
7494
|
-
setExportProgress(
|
|
7495
|
-
setExportStatusMessage(
|
|
7470
|
+
setExportProgress(chunkG3JPCRKN_js.slideProgressPercent(current, total));
|
|
7471
|
+
setExportStatusMessage(chunkG3JPCRKN_js.slideStatusLabel("Rendering", current, total));
|
|
7496
7472
|
},
|
|
7497
7473
|
signal: abortCtrl.signal
|
|
7498
7474
|
}
|
|
7499
7475
|
);
|
|
7500
|
-
setExportProgress(
|
|
7476
|
+
setExportProgress(chunkG3JPCRKN_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7501
7477
|
setExportStatusMessage("Building PDF...");
|
|
7502
7478
|
await new Promise((r) => {
|
|
7503
7479
|
setTimeout(r, 100);
|
|
7504
7480
|
});
|
|
7505
|
-
setExportProgress(
|
|
7481
|
+
setExportProgress(chunkG3JPCRKN_js.EXPORT_DONE_PERCENT);
|
|
7506
7482
|
setExportStatusMessage("Done!");
|
|
7507
7483
|
} catch (err) {
|
|
7508
|
-
if (!
|
|
7484
|
+
if (!chunkG3JPCRKN_js.isExportAbortError(err)) {
|
|
7509
7485
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7510
7486
|
}
|
|
7511
7487
|
} finally {
|
|
@@ -7547,22 +7523,22 @@ function useExportHandlers(input) {
|
|
|
7547
7523
|
scale: 1,
|
|
7548
7524
|
slideDurationMs: 3e3,
|
|
7549
7525
|
onProgress: (current, total) => {
|
|
7550
|
-
setExportProgress(
|
|
7551
|
-
setExportStatusMessage(
|
|
7526
|
+
setExportProgress(chunkG3JPCRKN_js.slideProgressPercent(current, total, 45));
|
|
7527
|
+
setExportStatusMessage(chunkG3JPCRKN_js.slideStatusLabel("Capturing", current, total));
|
|
7552
7528
|
},
|
|
7553
7529
|
onRecordProgress: (current, total) => {
|
|
7554
|
-
setExportProgress(
|
|
7555
|
-
setExportStatusMessage(
|
|
7530
|
+
setExportProgress(chunkG3JPCRKN_js.recordProgressPercent(current, total));
|
|
7531
|
+
setExportStatusMessage(chunkG3JPCRKN_js.slideStatusLabel("Recording", current, total));
|
|
7556
7532
|
},
|
|
7557
7533
|
signal: abortCtrl.signal
|
|
7558
7534
|
}
|
|
7559
7535
|
);
|
|
7560
|
-
setExportProgress(
|
|
7536
|
+
setExportProgress(chunkG3JPCRKN_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7561
7537
|
setExportStatusMessage("Saving file...");
|
|
7562
|
-
|
|
7563
|
-
setExportProgress(
|
|
7538
|
+
chunkG3JPCRKN_js.downloadBlob(blob, "presentation.webm");
|
|
7539
|
+
setExportProgress(chunkG3JPCRKN_js.EXPORT_DONE_PERCENT);
|
|
7564
7540
|
} catch (err) {
|
|
7565
|
-
if (!
|
|
7541
|
+
if (!chunkG3JPCRKN_js.isExportAbortError(err)) {
|
|
7566
7542
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7567
7543
|
}
|
|
7568
7544
|
} finally {
|
|
@@ -7590,18 +7566,18 @@ function useExportHandlers(input) {
|
|
|
7590
7566
|
scale: 0.5,
|
|
7591
7567
|
slideDurationMs: 2e3,
|
|
7592
7568
|
onProgress: (current, total) => {
|
|
7593
|
-
setExportProgress(
|
|
7594
|
-
setExportStatusMessage(
|
|
7569
|
+
setExportProgress(chunkG3JPCRKN_js.slideProgressPercent(current, total));
|
|
7570
|
+
setExportStatusMessage(chunkG3JPCRKN_js.slideStatusLabel("Encoding", current, total));
|
|
7595
7571
|
},
|
|
7596
7572
|
signal: abortCtrl.signal
|
|
7597
7573
|
}
|
|
7598
7574
|
);
|
|
7599
|
-
setExportProgress(
|
|
7575
|
+
setExportProgress(chunkG3JPCRKN_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7600
7576
|
setExportStatusMessage("Saving file...");
|
|
7601
|
-
|
|
7602
|
-
setExportProgress(
|
|
7577
|
+
chunkG3JPCRKN_js.downloadBlob(blob, "presentation.gif");
|
|
7578
|
+
setExportProgress(chunkG3JPCRKN_js.EXPORT_DONE_PERCENT);
|
|
7603
7579
|
} catch (err) {
|
|
7604
|
-
if (!
|
|
7580
|
+
if (!chunkG3JPCRKN_js.isExportAbortError(err)) {
|
|
7605
7581
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7606
7582
|
}
|
|
7607
7583
|
} finally {
|
|
@@ -7634,7 +7610,7 @@ function useExportHandlers(input) {
|
|
|
7634
7610
|
exportStatusMessage
|
|
7635
7611
|
};
|
|
7636
7612
|
}
|
|
7637
|
-
var ViewerOptionsContext = react.createContext(
|
|
7613
|
+
var ViewerOptionsContext = react.createContext(chunkG3JPCRKN_js.DEFAULT_VIEWER_OPTIONS);
|
|
7638
7614
|
function useViewerOptionsContext() {
|
|
7639
7615
|
return react.useContext(ViewerOptionsContext);
|
|
7640
7616
|
}
|
|
@@ -7646,13 +7622,13 @@ function usePrintHandlers(input) {
|
|
|
7646
7622
|
const { t } = reactI18next.useTranslation();
|
|
7647
7623
|
const viewerOptions = useViewerOptionsContext();
|
|
7648
7624
|
const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
|
|
7649
|
-
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) *
|
|
7625
|
+
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunkG3JPCRKN_js.resolveImageResolutionScale(viewerOptions);
|
|
7650
7626
|
const handlePrint = () => {
|
|
7651
7627
|
setIsPrintDialogOpen(true);
|
|
7652
7628
|
};
|
|
7653
7629
|
const handlePrintSvg = async (settings) => {
|
|
7654
7630
|
setIsPrintDialogOpen(false);
|
|
7655
|
-
const printWindow =
|
|
7631
|
+
const printWindow = chunkG3JPCRKN_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7656
7632
|
if (!printWindow) {
|
|
7657
7633
|
console.warn(
|
|
7658
7634
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7662,9 +7638,9 @@ function usePrintHandlers(input) {
|
|
|
7662
7638
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7663
7639
|
return runRasterPrint(printWindow, settings);
|
|
7664
7640
|
}
|
|
7665
|
-
const colorFilter =
|
|
7666
|
-
const slideIndices =
|
|
7667
|
-
|
|
7641
|
+
const colorFilter = chunkG3JPCRKN_js.computeColorFilter(settings.colorMode);
|
|
7642
|
+
const slideIndices = chunkG3JPCRKN_js.filterHiddenSlideIndices(
|
|
7643
|
+
chunkG3JPCRKN_js.computeSlideIndices(
|
|
7668
7644
|
settings.slideRange,
|
|
7669
7645
|
activeSlideIndex,
|
|
7670
7646
|
slides.length,
|
|
@@ -7682,22 +7658,22 @@ function usePrintHandlers(input) {
|
|
|
7682
7658
|
printWindow.close();
|
|
7683
7659
|
return;
|
|
7684
7660
|
}
|
|
7685
|
-
const printDoc =
|
|
7661
|
+
const printDoc = chunkG3JPCRKN_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7686
7662
|
title: "Slides (Vector)",
|
|
7687
7663
|
orientation: settings.orientation,
|
|
7688
7664
|
colorFilter,
|
|
7689
7665
|
scaleToFit: settings.scaleToFit
|
|
7690
7666
|
});
|
|
7691
|
-
|
|
7667
|
+
chunkG3JPCRKN_js.finishPrintWindow(printWindow, printDoc);
|
|
7692
7668
|
} catch (err) {
|
|
7693
7669
|
console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
|
|
7694
7670
|
return runRasterPrint(printWindow, settings);
|
|
7695
7671
|
}
|
|
7696
7672
|
};
|
|
7697
7673
|
const runRasterPrint = async (printWindow, settings) => {
|
|
7698
|
-
const colorFilter =
|
|
7699
|
-
const slideIndices =
|
|
7700
|
-
|
|
7674
|
+
const colorFilter = chunkG3JPCRKN_js.computeColorFilter(settings.colorMode);
|
|
7675
|
+
const slideIndices = chunkG3JPCRKN_js.filterHiddenSlideIndices(
|
|
7676
|
+
chunkG3JPCRKN_js.computeSlideIndices(
|
|
7701
7677
|
settings.slideRange,
|
|
7702
7678
|
activeSlideIndex,
|
|
7703
7679
|
slides.length,
|
|
@@ -7708,11 +7684,11 @@ function usePrintHandlers(input) {
|
|
|
7708
7684
|
includeHiddenSlides
|
|
7709
7685
|
);
|
|
7710
7686
|
if (settings.printWhat === "outline") {
|
|
7711
|
-
|
|
7687
|
+
chunkG3JPCRKN_js.finishPrintWindow(
|
|
7712
7688
|
printWindow,
|
|
7713
|
-
|
|
7689
|
+
chunkG3JPCRKN_js.buildPrintHtmlDocument({
|
|
7714
7690
|
title: "Outline",
|
|
7715
|
-
bodyHtml: `<div class="outline-page">${
|
|
7691
|
+
bodyHtml: `<div class="outline-page">${chunkG3JPCRKN_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7716
7692
|
orientation: settings.orientation,
|
|
7717
7693
|
colorFilter,
|
|
7718
7694
|
frameSlides: settings.frameSlides,
|
|
@@ -7739,11 +7715,11 @@ function usePrintHandlers(input) {
|
|
|
7739
7715
|
}
|
|
7740
7716
|
const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
|
|
7741
7717
|
if (settings.printWhat === "slides") {
|
|
7742
|
-
|
|
7718
|
+
chunkG3JPCRKN_js.finishPrintWindow(
|
|
7743
7719
|
printWindow,
|
|
7744
|
-
|
|
7720
|
+
chunkG3JPCRKN_js.buildPrintHtmlDocument({
|
|
7745
7721
|
title: "Slides",
|
|
7746
|
-
bodyHtml:
|
|
7722
|
+
bodyHtml: chunkG3JPCRKN_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7747
7723
|
orientation: settings.orientation,
|
|
7748
7724
|
colorFilter,
|
|
7749
7725
|
frameSlides: settings.frameSlides,
|
|
@@ -7753,11 +7729,11 @@ function usePrintHandlers(input) {
|
|
|
7753
7729
|
return;
|
|
7754
7730
|
}
|
|
7755
7731
|
if (settings.printWhat === "notes") {
|
|
7756
|
-
|
|
7732
|
+
chunkG3JPCRKN_js.finishPrintWindow(
|
|
7757
7733
|
printWindow,
|
|
7758
|
-
|
|
7734
|
+
chunkG3JPCRKN_js.buildPrintHtmlDocument({
|
|
7759
7735
|
title: "Notes Pages",
|
|
7760
|
-
bodyHtml:
|
|
7736
|
+
bodyHtml: chunkG3JPCRKN_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7761
7737
|
orientation: "portrait",
|
|
7762
7738
|
colorFilter,
|
|
7763
7739
|
frameSlides: settings.frameSlides,
|
|
@@ -7768,11 +7744,11 @@ function usePrintHandlers(input) {
|
|
|
7768
7744
|
}
|
|
7769
7745
|
if (settings.printWhat === "handouts") {
|
|
7770
7746
|
const spp = settings.slidesPerPage;
|
|
7771
|
-
|
|
7747
|
+
chunkG3JPCRKN_js.finishPrintWindow(
|
|
7772
7748
|
printWindow,
|
|
7773
|
-
|
|
7749
|
+
chunkG3JPCRKN_js.buildPrintHtmlDocument({
|
|
7774
7750
|
title: `Handout ${spp} per page`,
|
|
7775
|
-
bodyHtml:
|
|
7751
|
+
bodyHtml: chunkG3JPCRKN_js.buildHandoutsHtml(slideImages, slideIndices, spp, pptxData?.handoutMaster),
|
|
7776
7752
|
orientation: "portrait",
|
|
7777
7753
|
colorFilter,
|
|
7778
7754
|
frameSlides: settings.frameSlides,
|
|
@@ -7786,7 +7762,7 @@ function usePrintHandlers(input) {
|
|
|
7786
7762
|
};
|
|
7787
7763
|
const handlePrintWithSettings = async (settings) => {
|
|
7788
7764
|
setIsPrintDialogOpen(false);
|
|
7789
|
-
const printWindow =
|
|
7765
|
+
const printWindow = chunkG3JPCRKN_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7790
7766
|
if (!printWindow) {
|
|
7791
7767
|
console.warn(
|
|
7792
7768
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7851,13 +7827,13 @@ function useThemeHandlers(input) {
|
|
|
7851
7827
|
return;
|
|
7852
7828
|
}
|
|
7853
7829
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7854
|
-
const previousMap = theme?.colorScheme ?
|
|
7855
|
-
setSlides((prev) =>
|
|
7830
|
+
const previousMap = theme?.colorScheme ? chunkG3JPCRKN_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7831
|
+
setSlides((prev) => chunkG3JPCRKN_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7856
7832
|
if (Object.keys(templateElementsBySlideId).length > 0) {
|
|
7857
7833
|
setTemplateElementsBySlideId((prev) => {
|
|
7858
7834
|
const next = {};
|
|
7859
7835
|
for (const [slideId, elements] of Object.entries(prev)) {
|
|
7860
|
-
next[slideId] =
|
|
7836
|
+
next[slideId] = chunkG3JPCRKN_js.reResolveElementColors(elements, previousMap, colorScheme);
|
|
7861
7837
|
}
|
|
7862
7838
|
return next;
|
|
7863
7839
|
});
|
|
@@ -7966,7 +7942,7 @@ function useThemeSwitching(input) {
|
|
|
7966
7942
|
}
|
|
7967
7943
|
try {
|
|
7968
7944
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7969
|
-
const newData =
|
|
7945
|
+
const newData = chunkG3JPCRKN_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7970
7946
|
onDataChange(newData);
|
|
7971
7947
|
onThemeChanged?.(preset);
|
|
7972
7948
|
} catch (error) {
|
|
@@ -7983,7 +7959,7 @@ function useThemeSwitching(input) {
|
|
|
7983
7959
|
}
|
|
7984
7960
|
try {
|
|
7985
7961
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7986
|
-
const newData =
|
|
7962
|
+
const newData = chunkG3JPCRKN_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7987
7963
|
onDataChange(newData);
|
|
7988
7964
|
} catch (error) {
|
|
7989
7965
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7995,12 +7971,12 @@ function useThemeSwitching(input) {
|
|
|
7995
7971
|
if (!data?.theme?.colorScheme) {
|
|
7996
7972
|
return void 0;
|
|
7997
7973
|
}
|
|
7998
|
-
return
|
|
7999
|
-
(p) =>
|
|
7974
|
+
return chunkG3JPCRKN_js.THEME_PRESETS.find(
|
|
7975
|
+
(p) => chunkG3JPCRKN_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
8000
7976
|
);
|
|
8001
7977
|
}, [data?.theme?.colorScheme]);
|
|
8002
7978
|
return {
|
|
8003
|
-
presets:
|
|
7979
|
+
presets: chunkG3JPCRKN_js.THEME_PRESETS,
|
|
8004
7980
|
switchToPreset,
|
|
8005
7981
|
switchToCustom,
|
|
8006
7982
|
currentPreset
|
|
@@ -8075,7 +8051,7 @@ function usePropertyHandlers(input) {
|
|
|
8075
8051
|
}
|
|
8076
8052
|
try {
|
|
8077
8053
|
const ab = await file.arrayBuffer();
|
|
8078
|
-
const h = new
|
|
8054
|
+
const h = new chunkG3JPCRKN_js.PptxHandler();
|
|
8079
8055
|
const other = await h.load(ab);
|
|
8080
8056
|
if (!other) {
|
|
8081
8057
|
return;
|
|
@@ -8085,7 +8061,7 @@ function usePropertyHandlers(input) {
|
|
|
8085
8061
|
width: canvasSize.width,
|
|
8086
8062
|
height: canvasSize.height
|
|
8087
8063
|
};
|
|
8088
|
-
setCompareResult(
|
|
8064
|
+
setCompareResult(chunkG3JPCRKN_js.comparePresentation(cur, other));
|
|
8089
8065
|
setIsComparePanelOpen(true);
|
|
8090
8066
|
} catch (err) {
|
|
8091
8067
|
console.warn("Compare failed:", err);
|
|
@@ -8102,7 +8078,7 @@ function usePropertyHandlers(input) {
|
|
|
8102
8078
|
if (!diff || diff.status === "unchanged") {
|
|
8103
8079
|
return;
|
|
8104
8080
|
}
|
|
8105
|
-
setSlides((prev) =>
|
|
8081
|
+
setSlides((prev) => chunkG3JPCRKN_js.applyAcceptSlide(prev, diff));
|
|
8106
8082
|
setIsDirty(true);
|
|
8107
8083
|
},
|
|
8108
8084
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -8113,10 +8089,10 @@ function usePropertyHandlers(input) {
|
|
|
8113
8089
|
if (!compareResult) {
|
|
8114
8090
|
return;
|
|
8115
8091
|
}
|
|
8116
|
-
setSlides((prev) =>
|
|
8092
|
+
setSlides((prev) => chunkG3JPCRKN_js.applyAcceptAllSlides(prev, compareResult));
|
|
8117
8093
|
setIsDirty(true);
|
|
8118
8094
|
}, [compareResult, setSlides, setIsDirty]);
|
|
8119
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
8095
|
+
const usedFontFamilies = react.useMemo(() => chunkG3JPCRKN_js.collectUsedFonts(slides), [slides]);
|
|
8120
8096
|
return {
|
|
8121
8097
|
handleUpdateNotes,
|
|
8122
8098
|
handleUpdateSlide,
|
|
@@ -8271,7 +8247,7 @@ function useViewerDialogs(input) {
|
|
|
8271
8247
|
);
|
|
8272
8248
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8273
8249
|
const fontEmbedding = react.useMemo(
|
|
8274
|
-
() =>
|
|
8250
|
+
() => chunkG3JPCRKN_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8275
8251
|
[embeddedFontKey]
|
|
8276
8252
|
);
|
|
8277
8253
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8281,11 +8257,11 @@ function useViewerDialogs(input) {
|
|
|
8281
8257
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8282
8258
|
}
|
|
8283
8259
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8284
|
-
() => typeof window !== "undefined" ?
|
|
8260
|
+
() => typeof window !== "undefined" ? chunkG3JPCRKN_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8285
8261
|
);
|
|
8286
8262
|
react.useEffect(() => {
|
|
8287
8263
|
const handleWindow = () => setIsNarrowViewport(
|
|
8288
|
-
|
|
8264
|
+
chunkG3JPCRKN_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8289
8265
|
);
|
|
8290
8266
|
window.addEventListener("resize", handleWindow);
|
|
8291
8267
|
return () => window.removeEventListener("resize", handleWindow);
|
|
@@ -8438,16 +8414,16 @@ function useViewerDialogs(input) {
|
|
|
8438
8414
|
};
|
|
8439
8415
|
}
|
|
8440
8416
|
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8441
|
-
return
|
|
8417
|
+
return chunkG3JPCRKN_js.computeGridSpacingPx(documentGridSpacing, chunkLBJAVP3H_js.GRID_SIZE);
|
|
8442
8418
|
}
|
|
8443
8419
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
8444
8420
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8445
|
-
const authoredRange =
|
|
8446
|
-
return
|
|
8421
|
+
const authoredRange = chunkG3JPCRKN_js.resolveAuthoredSlideRange(presentationProperties, slides.length);
|
|
8422
|
+
return chunkG3JPCRKN_js.resolveShowSlideIndexes(slides, activeShow, authoredRange);
|
|
8447
8423
|
}
|
|
8448
8424
|
function computeSlideSectionGroups(slides, sections) {
|
|
8449
|
-
return
|
|
8450
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8425
|
+
return chunkG3JPCRKN_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8426
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkLBJAVP3H_js.UNGROUPED_SECTION_ID : chunkLBJAVP3H_js.DEFAULT_SECTION_GROUP_ID),
|
|
8451
8427
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8452
8428
|
slideIndexes: group.slideIndexes,
|
|
8453
8429
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8459,7 +8435,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8459
8435
|
return void 0;
|
|
8460
8436
|
}
|
|
8461
8437
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8462
|
-
return
|
|
8438
|
+
return chunkG3JPCRKN_js.masterViewPseudoSlide(document2, {
|
|
8463
8439
|
tab: "slides",
|
|
8464
8440
|
masterIndex: 0,
|
|
8465
8441
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8487,15 +8463,15 @@ function useDerivedSlideState(input) {
|
|
|
8487
8463
|
[slides, activeCustomShowId, customShows, presentationProperties]
|
|
8488
8464
|
);
|
|
8489
8465
|
const authoredRange = react.useMemo(
|
|
8490
|
-
() =>
|
|
8466
|
+
() => chunkG3JPCRKN_js.resolveAuthoredSlideRange(presentationProperties, slides.length),
|
|
8491
8467
|
[presentationProperties, slides.length]
|
|
8492
8468
|
);
|
|
8493
8469
|
const slideSectionGroups = react.useMemo(
|
|
8494
8470
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8495
|
-
if (group.id ===
|
|
8471
|
+
if (group.id === chunkLBJAVP3H_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8496
8472
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8497
8473
|
}
|
|
8498
|
-
if (group.id ===
|
|
8474
|
+
if (group.id === chunkLBJAVP3H_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8499
8475
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8500
8476
|
}
|
|
8501
8477
|
return group;
|
|
@@ -8596,13 +8572,13 @@ function useAnnotationHandlers(input) {
|
|
|
8596
8572
|
}, [annotations, setMode, setSlides, history]);
|
|
8597
8573
|
const handleSetMode = react.useCallback(
|
|
8598
8574
|
(nextMode) => {
|
|
8599
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8575
|
+
if (mode === "present" && nextMode !== "present" && !chunkG3JPCRKN_js.mayLeaveSlideShow()) {
|
|
8600
8576
|
return;
|
|
8601
8577
|
}
|
|
8602
8578
|
if (nextMode === "present") {
|
|
8603
8579
|
presentation.enterPresentMode();
|
|
8604
8580
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8605
|
-
|
|
8581
|
+
chunkG3JPCRKN_js.stopAllPersistentAudio();
|
|
8606
8582
|
if (promptKeepInkAnnotations) {
|
|
8607
8583
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8608
8584
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8612,7 +8588,7 @@ function useAnnotationHandlers(input) {
|
|
|
8612
8588
|
}
|
|
8613
8589
|
} else {
|
|
8614
8590
|
if (mode === "present") {
|
|
8615
|
-
|
|
8591
|
+
chunkG3JPCRKN_js.stopAllPersistentAudio();
|
|
8616
8592
|
}
|
|
8617
8593
|
setMode(nextMode);
|
|
8618
8594
|
}
|
|
@@ -8650,6 +8626,9 @@ function useSerialize(input) {
|
|
|
8650
8626
|
headerFooter,
|
|
8651
8627
|
presentationProperties,
|
|
8652
8628
|
viewProperties,
|
|
8629
|
+
tableStyleMap,
|
|
8630
|
+
tableStylesDefaultId,
|
|
8631
|
+
tableStylesToDelete = [],
|
|
8653
8632
|
customShows,
|
|
8654
8633
|
sections,
|
|
8655
8634
|
coreProperties,
|
|
@@ -8666,90 +8645,100 @@ function useSerialize(input) {
|
|
|
8666
8645
|
embedFonts = true,
|
|
8667
8646
|
purpose
|
|
8668
8647
|
} = input;
|
|
8669
|
-
return react.useCallback(
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
|
|
8648
|
+
return react.useCallback(
|
|
8649
|
+
async (format) => {
|
|
8650
|
+
const handler = handlerRef.current;
|
|
8651
|
+
if (!handler) {
|
|
8652
|
+
return null;
|
|
8653
|
+
}
|
|
8654
|
+
const pendingEditId = inlineEditingElementIdRef.current;
|
|
8655
|
+
const pendingEditText = inlineEditingTextRef.current;
|
|
8656
|
+
const slidesWithGuides = slides.map((slide, idx) => {
|
|
8657
|
+
let processedSlide = slide;
|
|
8658
|
+
if (pendingEditId) {
|
|
8659
|
+
const updatedElements = slide.elements.map((el) => {
|
|
8660
|
+
if (el.id !== pendingEditId || !chunkG3JPCRKN_js.hasTextProperties(el)) {
|
|
8661
|
+
return el;
|
|
8662
|
+
}
|
|
8663
|
+
return {
|
|
8664
|
+
...el,
|
|
8665
|
+
text: pendingEditText,
|
|
8666
|
+
textSegments: chunkG3JPCRKN_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8667
|
+
};
|
|
8668
|
+
});
|
|
8669
|
+
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
8670
|
+
processedSlide = { ...slide, elements: updatedElements };
|
|
8682
8671
|
}
|
|
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
8672
|
}
|
|
8692
|
-
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
|
|
8699
|
-
|
|
8700
|
-
|
|
8701
|
-
|
|
8702
|
-
|
|
8703
|
-
|
|
8704
|
-
};
|
|
8705
|
-
|
|
8706
|
-
|
|
8707
|
-
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
|
|
8711
|
-
|
|
8673
|
+
if (idx !== activeSlideIndex) {
|
|
8674
|
+
return processedSlide;
|
|
8675
|
+
}
|
|
8676
|
+
const pptxGuides = guides.map((g) => ({
|
|
8677
|
+
id: g.id,
|
|
8678
|
+
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8679
|
+
positionEmu: chunkG3JPCRKN_js.guidePxToEmu(g.position)
|
|
8680
|
+
}));
|
|
8681
|
+
return {
|
|
8682
|
+
...processedSlide,
|
|
8683
|
+
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8684
|
+
};
|
|
8685
|
+
});
|
|
8686
|
+
const slidesToSave = chunkG3JPCRKN_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8687
|
+
const saveOptions = chunkG3JPCRKN_js.buildDeckSaveOptions({
|
|
8688
|
+
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8689
|
+
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8690
|
+
// slide-size edit reaches the file.
|
|
8691
|
+
slideSize: chunkG3JPCRKN_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8692
|
+
headerFooter,
|
|
8693
|
+
presentationProperties,
|
|
8694
|
+
viewProperties,
|
|
8695
|
+
customShows,
|
|
8696
|
+
sections,
|
|
8697
|
+
coreProperties,
|
|
8698
|
+
appProperties,
|
|
8699
|
+
customProperties,
|
|
8700
|
+
tagCollections,
|
|
8701
|
+
slideMasters,
|
|
8702
|
+
notesMaster,
|
|
8703
|
+
handoutMaster,
|
|
8704
|
+
tableStyleMap,
|
|
8705
|
+
tableStylesDefaultId,
|
|
8706
|
+
tableStylesToDelete,
|
|
8707
|
+
embedFonts,
|
|
8708
|
+
outputFormat: format
|
|
8709
|
+
});
|
|
8710
|
+
return chunkG3JPCRKN_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8711
|
+
},
|
|
8712
|
+
[
|
|
8713
|
+
slides,
|
|
8714
|
+
templateElementsBySlideId,
|
|
8715
|
+
canvasSize,
|
|
8716
|
+
slideSizeEmu,
|
|
8712
8717
|
headerFooter,
|
|
8713
8718
|
presentationProperties,
|
|
8714
8719
|
viewProperties,
|
|
8715
|
-
|
|
8716
|
-
|
|
8720
|
+
tableStyleMap,
|
|
8721
|
+
tableStylesDefaultId,
|
|
8722
|
+
tableStylesToDelete,
|
|
8723
|
+
customShows,
|
|
8724
|
+
sections,
|
|
8717
8725
|
coreProperties,
|
|
8718
8726
|
appProperties,
|
|
8719
|
-
customProperties
|
|
8720
|
-
|
|
8727
|
+
customProperties,
|
|
8728
|
+
tagCollections,
|
|
8721
8729
|
slideMasters,
|
|
8722
8730
|
notesMaster,
|
|
8723
8731
|
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
|
-
]);
|
|
8732
|
+
guides,
|
|
8733
|
+
activeSlideIndex,
|
|
8734
|
+
handlerRef,
|
|
8735
|
+
inlineEditingElementIdRef,
|
|
8736
|
+
inlineEditingTextRef,
|
|
8737
|
+
password,
|
|
8738
|
+
embedFonts,
|
|
8739
|
+
purpose
|
|
8740
|
+
]
|
|
8741
|
+
);
|
|
8753
8742
|
}
|
|
8754
8743
|
function useRecoveryDetection(input) {
|
|
8755
8744
|
const { filePath, loading, error, slideCount, autosaveAllowed = true } = input;
|
|
@@ -8759,7 +8748,7 @@ function useRecoveryDetection(input) {
|
|
|
8759
8748
|
const onRestore = input.onRestore;
|
|
8760
8749
|
const openVersionHistory = input.openVersionHistory;
|
|
8761
8750
|
react.useEffect(() => {
|
|
8762
|
-
if (!
|
|
8751
|
+
if (!chunkG3JPCRKN_js.shouldProbeAutosaveRecovery({
|
|
8763
8752
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8764
8753
|
filePath,
|
|
8765
8754
|
loading,
|
|
@@ -8771,7 +8760,7 @@ function useRecoveryDetection(input) {
|
|
|
8771
8760
|
}
|
|
8772
8761
|
recoveryCheckedRef.current = true;
|
|
8773
8762
|
void (async () => {
|
|
8774
|
-
const offer = await
|
|
8763
|
+
const offer = await chunkG3JPCRKN_js.probeAutosaveRecovery(filePath);
|
|
8775
8764
|
if (!offer) {
|
|
8776
8765
|
return;
|
|
8777
8766
|
}
|
|
@@ -8784,7 +8773,7 @@ function useRecoveryDetection(input) {
|
|
|
8784
8773
|
const record = recordRef.current;
|
|
8785
8774
|
setPrompt(null);
|
|
8786
8775
|
if (record && onRestore) {
|
|
8787
|
-
onRestore(
|
|
8776
|
+
onRestore(chunkG3JPCRKN_js.acceptAutosaveRecovery(record));
|
|
8788
8777
|
}
|
|
8789
8778
|
recordRef.current = null;
|
|
8790
8779
|
}, [onRestore]);
|
|
@@ -8793,7 +8782,7 @@ function useRecoveryDetection(input) {
|
|
|
8793
8782
|
setPrompt(null);
|
|
8794
8783
|
recordRef.current = null;
|
|
8795
8784
|
if (record) {
|
|
8796
|
-
void
|
|
8785
|
+
void chunkG3JPCRKN_js.discardAutosaveRecovery(record);
|
|
8797
8786
|
}
|
|
8798
8787
|
}, []);
|
|
8799
8788
|
return { prompt, restore, discard };
|
|
@@ -8804,6 +8793,8 @@ function usePresentationSetup(input) {
|
|
|
8804
8793
|
slides,
|
|
8805
8794
|
templateElementsBySlideId,
|
|
8806
8795
|
visibleSlideIndexes,
|
|
8796
|
+
canvasSize,
|
|
8797
|
+
themeColorMap,
|
|
8807
8798
|
activeSlideIndex,
|
|
8808
8799
|
containerRef,
|
|
8809
8800
|
content,
|
|
@@ -8833,15 +8824,17 @@ function usePresentationSetup(input) {
|
|
|
8833
8824
|
slides,
|
|
8834
8825
|
templateElementsBySlideId,
|
|
8835
8826
|
visibleSlideIndexes,
|
|
8827
|
+
canvasSize,
|
|
8828
|
+
themeColorMap,
|
|
8836
8829
|
activeSlideIndex,
|
|
8837
8830
|
containerRef,
|
|
8838
8831
|
content,
|
|
8839
8832
|
onSetMode: (nextMode) => {
|
|
8840
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8833
|
+
if (mode === "present" && nextMode !== "present" && !chunkG3JPCRKN_js.mayLeaveSlideShow()) {
|
|
8841
8834
|
return;
|
|
8842
8835
|
}
|
|
8843
8836
|
if (mode === "present" && nextMode !== "present") {
|
|
8844
|
-
|
|
8837
|
+
chunkG3JPCRKN_js.stopAllPersistentAudio();
|
|
8845
8838
|
stopAnimationSound();
|
|
8846
8839
|
const exitHandler = exitModeHandlerRef.current;
|
|
8847
8840
|
if (exitHandler) {
|
|
@@ -8909,10 +8902,10 @@ function usePresentationSetup(input) {
|
|
|
8909
8902
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8910
8903
|
onToggleSubtitles,
|
|
8911
8904
|
onSaveRehearsalTimings: (timings) => {
|
|
8912
|
-
setSlides((prev) =>
|
|
8905
|
+
setSlides((prev) => chunkG3JPCRKN_js.applyRehearsalTimings(prev, timings));
|
|
8913
8906
|
history.markDirty();
|
|
8914
8907
|
},
|
|
8915
|
-
loopContinuously:
|
|
8908
|
+
loopContinuously: chunkG3JPCRKN_js.shouldLoopContinuously(presentationProperties),
|
|
8916
8909
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8917
8910
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8918
8911
|
endWithBlackSlide,
|
|
@@ -9118,7 +9111,7 @@ function useEditorOperations(input) {
|
|
|
9118
9111
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9119
9112
|
react.useEffect(() => {
|
|
9120
9113
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9121
|
-
copiedFormatRef.current =
|
|
9114
|
+
copiedFormatRef.current = chunkG3JPCRKN_js.copyFormatFromElement(selectedElement);
|
|
9122
9115
|
} else if (!formatPainterActive) {
|
|
9123
9116
|
copiedFormatRef.current = null;
|
|
9124
9117
|
}
|
|
@@ -9144,12 +9137,12 @@ function useEditorOperations(input) {
|
|
|
9144
9137
|
e.stopPropagation();
|
|
9145
9138
|
const element = elementLookup.get(elementId);
|
|
9146
9139
|
if (element) {
|
|
9147
|
-
const updated =
|
|
9140
|
+
const updated = chunkG3JPCRKN_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9148
9141
|
const updates = {};
|
|
9149
|
-
if (
|
|
9142
|
+
if (chunkG3JPCRKN_js.hasShapeProperties(updated)) {
|
|
9150
9143
|
updates.shapeStyle = updated.shapeStyle;
|
|
9151
9144
|
}
|
|
9152
|
-
if (
|
|
9145
|
+
if (chunkG3JPCRKN_js.hasTextProperties(updated)) {
|
|
9153
9146
|
updates.textStyle = updated.textStyle;
|
|
9154
9147
|
}
|
|
9155
9148
|
ops.updateElementById(elementId, updates);
|
|
@@ -9196,10 +9189,10 @@ function useIOHandlers(input) {
|
|
|
9196
9189
|
ops,
|
|
9197
9190
|
zoom,
|
|
9198
9191
|
handlerRef,
|
|
9192
|
+
serializeSlides,
|
|
9199
9193
|
serializeForRecovery,
|
|
9200
9194
|
setContent,
|
|
9201
9195
|
onContentChange,
|
|
9202
|
-
password,
|
|
9203
9196
|
imageExportScale
|
|
9204
9197
|
} = input;
|
|
9205
9198
|
const exportHandlers = useExportHandlers({
|
|
@@ -9210,24 +9203,20 @@ function useIOHandlers(input) {
|
|
|
9210
9203
|
filePath,
|
|
9211
9204
|
canvasStageRef: zoom.canvasStageRef,
|
|
9212
9205
|
setActiveSlideIndex: state.setActiveSlideIndex,
|
|
9213
|
-
|
|
9206
|
+
serializeSlides,
|
|
9214
9207
|
headerFooter: state.headerFooter,
|
|
9215
9208
|
presentationProperties: state.presentationProperties,
|
|
9216
9209
|
customShows: state.customShows,
|
|
9217
9210
|
sections: state.sections,
|
|
9218
|
-
coreProperties: state.coreProperties
|
|
9219
|
-
appProperties: state.appProperties
|
|
9211
|
+
coreProperties: state.coreProperties,
|
|
9212
|
+
appProperties: state.appProperties,
|
|
9220
9213
|
customProperties: state.customProperties,
|
|
9221
9214
|
tagCollections: state.tagCollections,
|
|
9222
|
-
slideMasters: state.slideMasters,
|
|
9223
9215
|
notesMaster: state.notesMaster,
|
|
9224
9216
|
handoutMaster: state.handoutMaster,
|
|
9225
|
-
guides: state.guides,
|
|
9226
|
-
activeSlideIndexForGuides: state.activeSlideIndex,
|
|
9227
9217
|
theme: state.theme,
|
|
9228
9218
|
canvasSize,
|
|
9229
9219
|
slideSizeEmu: state.slideSizeEmu,
|
|
9230
|
-
password,
|
|
9231
9220
|
imageExportScale
|
|
9232
9221
|
});
|
|
9233
9222
|
const printHandlers = usePrintHandlers({
|
|
@@ -9337,10 +9326,10 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9337
9326
|
}
|
|
9338
9327
|
};
|
|
9339
9328
|
}, [embeddedFonts]);
|
|
9340
|
-
const referencedFamilies = react.useMemo(() =>
|
|
9329
|
+
const referencedFamilies = react.useMemo(() => chunkG3JPCRKN_js.collectReferencedFontFamilies(slides), [slides]);
|
|
9341
9330
|
react.useEffect(() => {
|
|
9342
9331
|
let cancelled = false;
|
|
9343
|
-
void
|
|
9332
|
+
void chunkG3JPCRKN_js.resolveGoogleWebfontHref(slides, embeddedFonts).then((href) => {
|
|
9344
9333
|
if (cancelled) {
|
|
9345
9334
|
return null;
|
|
9346
9335
|
}
|
|
@@ -9408,6 +9397,7 @@ function useContentLifecycle(input) {
|
|
|
9408
9397
|
onContentApplied,
|
|
9409
9398
|
allowExternalImages,
|
|
9410
9399
|
setReadOnlyRecommendation,
|
|
9400
|
+
setModifyVerifier,
|
|
9411
9401
|
setCompatToasts
|
|
9412
9402
|
} = input;
|
|
9413
9403
|
const { handlerRef } = useLoadContent({
|
|
@@ -9426,6 +9416,8 @@ function useContentLifecycle(input) {
|
|
|
9426
9416
|
setRecentColors: state.setRecentColors,
|
|
9427
9417
|
setTheme: state.setTheme,
|
|
9428
9418
|
setTableStyleMap: state.setTableStyleMap,
|
|
9419
|
+
setTableStylesDefaultId: state.setTableStylesDefaultId,
|
|
9420
|
+
setTableStylesToDelete: state.setTableStylesToDelete,
|
|
9429
9421
|
setThemeOptions: state.setThemeOptions,
|
|
9430
9422
|
setCustomShows: state.setCustomShows,
|
|
9431
9423
|
setActiveCustomShowId: state.setActiveCustomShowId,
|
|
@@ -9446,6 +9438,7 @@ function useContentLifecycle(input) {
|
|
|
9446
9438
|
setDigitalSignatureCount: state.setDigitalSignatureCount,
|
|
9447
9439
|
setGuides: state.setGuides,
|
|
9448
9440
|
setReadOnlyRecommendation,
|
|
9441
|
+
setModifyVerifier,
|
|
9449
9442
|
setCompatToasts,
|
|
9450
9443
|
setLoading: state.setLoading,
|
|
9451
9444
|
setError: state.setError,
|
|
@@ -9468,6 +9461,9 @@ function useContentLifecycle(input) {
|
|
|
9468
9461
|
headerFooter: state.headerFooter,
|
|
9469
9462
|
presentationProperties: state.presentationProperties,
|
|
9470
9463
|
viewProperties: state.viewProperties,
|
|
9464
|
+
tableStyleMap: state.tableStyleMap,
|
|
9465
|
+
tableStylesDefaultId: state.tableStylesDefaultId,
|
|
9466
|
+
tableStylesToDelete: state.tableStylesToDelete,
|
|
9471
9467
|
customShows: state.customShows,
|
|
9472
9468
|
sections: state.sections,
|
|
9473
9469
|
coreProperties: state.coreProperties,
|
|
@@ -9523,7 +9519,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9523
9519
|
inputRef.current = input;
|
|
9524
9520
|
const handleKeyDown = react.useCallback((e) => {
|
|
9525
9521
|
const current = inputRef.current;
|
|
9526
|
-
const startAction =
|
|
9522
|
+
const startAction = chunkG3JPCRKN_js.mapSlideShowStartKey(e, { isPresenting: current.mode === "present" });
|
|
9527
9523
|
if (startAction !== null) {
|
|
9528
9524
|
e.preventDefault();
|
|
9529
9525
|
if (startAction === "fromBeginning") {
|
|
@@ -9533,7 +9529,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9533
9529
|
}
|
|
9534
9530
|
return;
|
|
9535
9531
|
}
|
|
9536
|
-
const { action, dx, dy } =
|
|
9532
|
+
const { action, dx, dy } = chunkG3JPCRKN_js.mapEditorKey(e, {
|
|
9537
9533
|
canEdit: current.canEdit,
|
|
9538
9534
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9539
9535
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9546,7 +9542,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9546
9542
|
hasSelection: current.hasSelection,
|
|
9547
9543
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9548
9544
|
isDrawing: current.activeTool !== "select",
|
|
9549
|
-
isTextInputTarget:
|
|
9545
|
+
isTextInputTarget: chunkG3JPCRKN_js.isEditorTextInputTarget(e.target)
|
|
9550
9546
|
});
|
|
9551
9547
|
if (action === null) {
|
|
9552
9548
|
return;
|
|
@@ -9717,6 +9713,7 @@ function useViewerIntegration(input) {
|
|
|
9717
9713
|
autosaveIntervalMs,
|
|
9718
9714
|
allowExternalImages,
|
|
9719
9715
|
setReadOnlyRecommendation,
|
|
9716
|
+
setModifyVerifier,
|
|
9720
9717
|
setCompatToasts,
|
|
9721
9718
|
canEdit,
|
|
9722
9719
|
promptKeepInkAnnotations,
|
|
@@ -9788,6 +9785,7 @@ function useViewerIntegration(input) {
|
|
|
9788
9785
|
onContentApplied: () => setLoadVersion((v) => v + 1),
|
|
9789
9786
|
allowExternalImages,
|
|
9790
9787
|
setReadOnlyRecommendation,
|
|
9788
|
+
setModifyVerifier,
|
|
9791
9789
|
setCompatToasts
|
|
9792
9790
|
}
|
|
9793
9791
|
);
|
|
@@ -9801,10 +9799,10 @@ function useViewerIntegration(input) {
|
|
|
9801
9799
|
ops: editorOps.ops,
|
|
9802
9800
|
zoom,
|
|
9803
9801
|
handlerRef,
|
|
9802
|
+
serializeSlides,
|
|
9804
9803
|
serializeForRecovery,
|
|
9805
9804
|
setContent,
|
|
9806
9805
|
onContentChange,
|
|
9807
|
-
password: dialogs.presentationPassword ?? void 0,
|
|
9808
9806
|
imageExportScale
|
|
9809
9807
|
});
|
|
9810
9808
|
const {
|
|
@@ -9874,7 +9872,7 @@ function useViewerIntegration(input) {
|
|
|
9874
9872
|
return zoom.scale;
|
|
9875
9873
|
},
|
|
9876
9874
|
setZoom(level) {
|
|
9877
|
-
zoom.setScale(
|
|
9875
|
+
zoom.setScale(chunkG3JPCRKN_js.clampZoomScale(level));
|
|
9878
9876
|
},
|
|
9879
9877
|
zoomIn() {
|
|
9880
9878
|
zoom.handleZoomIn();
|
|
@@ -10092,7 +10090,7 @@ function useReducedMotion() {
|
|
|
10092
10090
|
}
|
|
10093
10091
|
function useViewerOptions() {
|
|
10094
10092
|
const storeRef = react.useRef(null);
|
|
10095
|
-
storeRef.current ??=
|
|
10093
|
+
storeRef.current ??= chunkG3JPCRKN_js.createViewerOptionsStore();
|
|
10096
10094
|
const store = storeRef.current;
|
|
10097
10095
|
const options = react.useSyncExternalStore(
|
|
10098
10096
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -10101,9 +10099,9 @@ function useViewerOptions() {
|
|
|
10101
10099
|
);
|
|
10102
10100
|
return { optionsStore: store, options };
|
|
10103
10101
|
}
|
|
10104
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10102
|
+
var KNOWN_TAB_IDS = new Set(chunkG3JPCRKN_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10105
10103
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
10106
|
-
const isHidden = (id) =>
|
|
10104
|
+
const isHidden = (id) => chunkG3JPCRKN_js.isActionHidden(id, hiddenActions);
|
|
10107
10105
|
const userHidden = new Set(hiddenTabIds);
|
|
10108
10106
|
userHidden.delete("file");
|
|
10109
10107
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
|
|
@@ -10155,6 +10153,7 @@ function useYjsDocumentSync({
|
|
|
10155
10153
|
isSynced = true,
|
|
10156
10154
|
config,
|
|
10157
10155
|
getSourceBytes,
|
|
10156
|
+
getSaveOptions,
|
|
10158
10157
|
loadVersion = 0,
|
|
10159
10158
|
loadOrigin = "user"
|
|
10160
10159
|
}) {
|
|
@@ -10195,18 +10194,18 @@ function useYjsDocumentSync({
|
|
|
10195
10194
|
return;
|
|
10196
10195
|
}
|
|
10197
10196
|
try {
|
|
10198
|
-
const handler = new
|
|
10197
|
+
const handler = new chunkG3JPCRKN_js.PptxHandler();
|
|
10199
10198
|
await handler.load(sourceBytes.buffer);
|
|
10200
|
-
const currentSlides =
|
|
10199
|
+
const currentSlides = chunkG3JPCRKN_js.readSlidesFromYDoc(
|
|
10201
10200
|
doc
|
|
10202
10201
|
);
|
|
10203
|
-
const slidesToSave =
|
|
10204
|
-
const bytes = await handler.save(slidesToSave);
|
|
10202
|
+
const slidesToSave = chunkG3JPCRKN_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10203
|
+
const bytes = await handler.save(slidesToSave, getSaveOptions?.());
|
|
10205
10204
|
config.onWriteBack(bytes);
|
|
10206
10205
|
} catch {
|
|
10207
10206
|
}
|
|
10208
10207
|
}, debounceMs);
|
|
10209
|
-
}, [doc, config, getSourceBytes, templateElementsBySlideId]);
|
|
10208
|
+
}, [doc, config, getSourceBytes, getSaveOptions, templateElementsBySlideId]);
|
|
10210
10209
|
react.useEffect(() => {
|
|
10211
10210
|
if (loadVersion === lastLoadVersionRef.current) {
|
|
10212
10211
|
return;
|
|
@@ -10215,10 +10214,10 @@ function useYjsDocumentSync({
|
|
|
10215
10214
|
if (!doc || !isConnected) {
|
|
10216
10215
|
return;
|
|
10217
10216
|
}
|
|
10218
|
-
const docSlides =
|
|
10217
|
+
const docSlides = chunkG3JPCRKN_js.readSlidesFromYDoc(
|
|
10219
10218
|
doc
|
|
10220
10219
|
);
|
|
10221
|
-
if (!
|
|
10220
|
+
if (!chunkG3JPCRKN_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10222
10221
|
return;
|
|
10223
10222
|
}
|
|
10224
10223
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10237,11 +10236,11 @@ function useYjsDocumentSync({
|
|
|
10237
10236
|
lastSyncedRef.current = serialized;
|
|
10238
10237
|
void (async () => {
|
|
10239
10238
|
const factories = await getFactories();
|
|
10240
|
-
|
|
10239
|
+
chunkG3JPCRKN_js.reconcileSlidesInYDoc(
|
|
10241
10240
|
slides,
|
|
10242
10241
|
doc,
|
|
10243
10242
|
factories,
|
|
10244
|
-
|
|
10243
|
+
chunkG3JPCRKN_js.LOCAL_SYNC_ORIGIN
|
|
10245
10244
|
);
|
|
10246
10245
|
scheduleWriteBack();
|
|
10247
10246
|
})();
|
|
@@ -10255,10 +10254,10 @@ function useYjsDocumentSync({
|
|
|
10255
10254
|
return;
|
|
10256
10255
|
}
|
|
10257
10256
|
const handleChange = (_events, transaction) => {
|
|
10258
|
-
if (transaction?.origin ===
|
|
10257
|
+
if (transaction?.origin === chunkG3JPCRKN_js.LOCAL_SYNC_ORIGIN) {
|
|
10259
10258
|
return;
|
|
10260
10259
|
}
|
|
10261
|
-
const remoteSlides =
|
|
10260
|
+
const remoteSlides = chunkG3JPCRKN_js.readSlidesFromYDoc(
|
|
10262
10261
|
doc
|
|
10263
10262
|
);
|
|
10264
10263
|
if (remoteSlides.length === 0) {
|
|
@@ -10274,7 +10273,7 @@ function useYjsDocumentSync({
|
|
|
10274
10273
|
isApplyingRemoteRef.current = false;
|
|
10275
10274
|
scheduleWriteBack();
|
|
10276
10275
|
};
|
|
10277
|
-
const unobserve =
|
|
10276
|
+
const unobserve = chunkG3JPCRKN_js.observeYDocSlides(
|
|
10278
10277
|
doc,
|
|
10279
10278
|
handleChange
|
|
10280
10279
|
);
|
|
@@ -10312,7 +10311,7 @@ function useBroadcastFollower({
|
|
|
10312
10311
|
if (!broadcaster) {
|
|
10313
10312
|
return;
|
|
10314
10313
|
}
|
|
10315
|
-
if (!
|
|
10314
|
+
if (!chunkG3JPCRKN_js.shouldAutoFollowBroadcaster({
|
|
10316
10315
|
localRole: collab.config.role,
|
|
10317
10316
|
broadcasterRole: broadcaster.role
|
|
10318
10317
|
})) {
|
|
@@ -10483,7 +10482,7 @@ function subscribeTouchCapability(callback) {
|
|
|
10483
10482
|
function useIsMobile() {
|
|
10484
10483
|
const isTouchDevice = react.useSyncExternalStore(
|
|
10485
10484
|
subscribeTouchCapability,
|
|
10486
|
-
|
|
10485
|
+
chunkG3JPCRKN_js.detectTouchDevice,
|
|
10487
10486
|
() => false
|
|
10488
10487
|
// server snapshot
|
|
10489
10488
|
);
|
|
@@ -10493,7 +10492,7 @@ function useIsMobile() {
|
|
|
10493
10492
|
const [viewportHeight, setViewportHeight] = react.useState(
|
|
10494
10493
|
() => typeof window === "undefined" ? 768 : window.innerHeight
|
|
10495
10494
|
);
|
|
10496
|
-
const [orientation, setOrientation] = react.useState(
|
|
10495
|
+
const [orientation, setOrientation] = react.useState(chunkG3JPCRKN_js.detectOrientation);
|
|
10497
10496
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
10498
10497
|
const [initialViewportHeight] = react.useState(
|
|
10499
10498
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -10514,7 +10513,7 @@ function useIsMobile() {
|
|
|
10514
10513
|
return;
|
|
10515
10514
|
}
|
|
10516
10515
|
const handleOrientationChange = () => {
|
|
10517
|
-
setOrientation(
|
|
10516
|
+
setOrientation(chunkG3JPCRKN_js.detectOrientation());
|
|
10518
10517
|
};
|
|
10519
10518
|
if (screen.orientation) {
|
|
10520
10519
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -10544,7 +10543,7 @@ function useIsMobile() {
|
|
|
10544
10543
|
window.addEventListener("resize", handleResize);
|
|
10545
10544
|
return () => window.removeEventListener("resize", handleResize);
|
|
10546
10545
|
}, [isTouchDevice, initialViewportHeight]);
|
|
10547
|
-
const { isMobile, isTablet, isDesktop } =
|
|
10546
|
+
const { isMobile, isTablet, isDesktop } = chunkG3JPCRKN_js.deriveViewportBreakpoints(
|
|
10548
10547
|
viewportWidth,
|
|
10549
10548
|
viewportHeight,
|
|
10550
10549
|
isTouchDevice
|
|
@@ -10575,10 +10574,10 @@ function useTouchGestures(input) {
|
|
|
10575
10574
|
if (!el || !enabled) {
|
|
10576
10575
|
return;
|
|
10577
10576
|
}
|
|
10578
|
-
const recognizer =
|
|
10577
|
+
const recognizer = chunkG3JPCRKN_js.createTouchGestureRecognizer({
|
|
10579
10578
|
getScale: () => scaleRef.current,
|
|
10580
|
-
minScale:
|
|
10581
|
-
maxScale:
|
|
10579
|
+
minScale: chunkG3JPCRKN_js.MIN_ZOOM_SCALE,
|
|
10580
|
+
maxScale: chunkG3JPCRKN_js.MAX_ZOOM_SCALE,
|
|
10582
10581
|
callbacks: {
|
|
10583
10582
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10584
10583
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10618,7 +10617,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10618
10617
|
return;
|
|
10619
10618
|
}
|
|
10620
10619
|
const rect = active.getBoundingClientRect();
|
|
10621
|
-
const delta =
|
|
10620
|
+
const delta = chunkG3JPCRKN_js.computeScrollDelta(
|
|
10622
10621
|
{ top: rect.top, bottom: rect.bottom },
|
|
10623
10622
|
window.innerHeight,
|
|
10624
10623
|
keyboardInset
|
|
@@ -10638,8 +10637,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10638
10637
|
return;
|
|
10639
10638
|
}
|
|
10640
10639
|
const update = () => {
|
|
10641
|
-
const metrics =
|
|
10642
|
-
const inset = metrics ?
|
|
10640
|
+
const metrics = chunkG3JPCRKN_js.readViewportMetrics(window);
|
|
10641
|
+
const inset = metrics ? chunkG3JPCRKN_js.computeKeyboardInset(metrics) : 0;
|
|
10643
10642
|
setKeyboardInset(inset);
|
|
10644
10643
|
if (inset > 0) {
|
|
10645
10644
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10650,8 +10649,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10650
10649
|
vv.addEventListener("scroll", update);
|
|
10651
10650
|
const onFocusIn = () => {
|
|
10652
10651
|
window.requestAnimationFrame(() => {
|
|
10653
|
-
const metrics =
|
|
10654
|
-
const inset = metrics ?
|
|
10652
|
+
const metrics = chunkG3JPCRKN_js.readViewportMetrics(window);
|
|
10653
|
+
const inset = metrics ? chunkG3JPCRKN_js.computeKeyboardInset(metrics) : 0;
|
|
10655
10654
|
if (inset > 0) {
|
|
10656
10655
|
scrollFocusedIntoView(inset);
|
|
10657
10656
|
}
|
|
@@ -10664,7 +10663,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10664
10663
|
document.removeEventListener("focusin", onFocusIn);
|
|
10665
10664
|
};
|
|
10666
10665
|
}, [enabled]);
|
|
10667
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10666
|
+
return { keyboardInset, isKeyboardOpen: chunkG3JPCRKN_js.isKeyboardOpen(keyboardInset) };
|
|
10668
10667
|
}
|
|
10669
10668
|
|
|
10670
10669
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10693,21 +10692,21 @@ function buildCanvasProps(input) {
|
|
|
10693
10692
|
} = input;
|
|
10694
10693
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10695
10694
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10696
|
-
const fieldContext =
|
|
10695
|
+
const fieldContext = chunkG3JPCRKN_js.buildFieldSubstitutionContext({
|
|
10697
10696
|
headerFooter: s.headerFooter,
|
|
10698
10697
|
customProperties: s.customProperties,
|
|
10699
10698
|
slide: activeSlide
|
|
10700
10699
|
});
|
|
10701
10700
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10702
10701
|
const openExternalUrl = (url, target) => {
|
|
10703
|
-
if (
|
|
10702
|
+
if (chunkG3JPCRKN_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
10704
10703
|
return;
|
|
10705
10704
|
}
|
|
10706
|
-
|
|
10705
|
+
chunkG3JPCRKN_js.safeOpenUrl(url, target);
|
|
10707
10706
|
};
|
|
10708
10707
|
const handleActionClick = (elementId, action) => {
|
|
10709
10708
|
if (mode === "present") {
|
|
10710
|
-
const resolved =
|
|
10709
|
+
const resolved = chunkG3JPCRKN_js.resolvePresentationAction(action, { slideCount: slides.length });
|
|
10711
10710
|
if (resolved.intent.kind === "openUrl") {
|
|
10712
10711
|
openExternalUrl(resolved.intent.url);
|
|
10713
10712
|
return;
|
|
@@ -10718,9 +10717,9 @@ function buildCanvasProps(input) {
|
|
|
10718
10717
|
}
|
|
10719
10718
|
};
|
|
10720
10719
|
const handleHyperlinkClick = (url, target) => {
|
|
10721
|
-
if (
|
|
10720
|
+
if (chunkG3JPCRKN_js.isPpactionUrl(url)) {
|
|
10722
10721
|
if (mode === "present") {
|
|
10723
|
-
const parsed =
|
|
10722
|
+
const parsed = chunkG3JPCRKN_js.parsePpactionUrl(url);
|
|
10724
10723
|
if (parsed) {
|
|
10725
10724
|
presentation.handlePresentationAction({
|
|
10726
10725
|
action: parsed.action,
|
|
@@ -10826,7 +10825,7 @@ function buildCanvasProps(input) {
|
|
|
10826
10825
|
|
|
10827
10826
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10828
10827
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10829
|
-
return
|
|
10828
|
+
return chunkG3JPCRKN_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10830
10829
|
}
|
|
10831
10830
|
|
|
10832
10831
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10839,7 +10838,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10839
10838
|
const current = activeSlide.animations ?? [];
|
|
10840
10839
|
if (group === "motionPath") {
|
|
10841
10840
|
propertyHandlers.handleUpdateSlide({
|
|
10842
|
-
animations:
|
|
10841
|
+
animations: chunkG3JPCRKN_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10843
10842
|
});
|
|
10844
10843
|
return;
|
|
10845
10844
|
}
|
|
@@ -11035,7 +11034,7 @@ function buildToolbarProps(input) {
|
|
|
11035
11034
|
onOpenFile,
|
|
11036
11035
|
onOpenRecentFile,
|
|
11037
11036
|
onCreatePresentation: (templateId) => {
|
|
11038
|
-
s.setSlides(
|
|
11037
|
+
s.setSlides(chunkG3JPCRKN_js.createBackstagePresentation(templateId));
|
|
11039
11038
|
s.setActiveSlideIndex(0);
|
|
11040
11039
|
s.setSelectedElementId(null);
|
|
11041
11040
|
s.setSelectedElementIds([]);
|
|
@@ -11064,7 +11063,7 @@ function buildToolbarProps(input) {
|
|
|
11064
11063
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
11065
11064
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
11066
11065
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
11067
|
-
templateScheme:
|
|
11066
|
+
templateScheme: chunkG3JPCRKN_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
11068
11067
|
customShows: s.customShows,
|
|
11069
11068
|
activeCustomShowId: s.activeCustomShowId,
|
|
11070
11069
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -11105,7 +11104,7 @@ function buildToolbarProps(input) {
|
|
|
11105
11104
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
11106
11105
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
11107
11106
|
formatPainterActive: s.formatPainterActive,
|
|
11108
|
-
canActivateFormatPainter:
|
|
11107
|
+
canActivateFormatPainter: chunkG3JPCRKN_js.hasCopyableFormat(selectedElement),
|
|
11109
11108
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
11110
11109
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
11111
11110
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11183,7 +11182,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11183
11182
|
headerFooter: state.headerFooter,
|
|
11184
11183
|
loading,
|
|
11185
11184
|
error,
|
|
11186
|
-
maxHistoryEntries:
|
|
11185
|
+
maxHistoryEntries: chunkG3JPCRKN_js.resolveHistoryDepth(viewerOptions),
|
|
11187
11186
|
hasActivePointerInteraction,
|
|
11188
11187
|
pointerCommitNonce: state.pointerCommitNonce,
|
|
11189
11188
|
onDirty: markDocumentDirty,
|
|
@@ -11207,11 +11206,17 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11207
11206
|
activeMaster: state.activeMaster,
|
|
11208
11207
|
documentGridSpacing: state.viewProperties?.gridSpacing
|
|
11209
11208
|
});
|
|
11209
|
+
const themeColorMap = react.useMemo(
|
|
11210
|
+
() => state.theme?.colorScheme ? chunkG3JPCRKN_js.buildThemeColorMap(state.theme.colorScheme) : void 0,
|
|
11211
|
+
[state.theme?.colorScheme]
|
|
11212
|
+
);
|
|
11210
11213
|
const { presentation, annotations, actionSoundHandlerRef, setExitModeHandler } = usePresentationSetup({
|
|
11211
11214
|
mode,
|
|
11212
11215
|
slides,
|
|
11213
11216
|
templateElementsBySlideId,
|
|
11214
11217
|
visibleSlideIndexes,
|
|
11218
|
+
canvasSize,
|
|
11219
|
+
themeColorMap,
|
|
11215
11220
|
endWithBlackSlide: viewerOptions.advanced.slideShowEndWithBlackSlide,
|
|
11216
11221
|
// File > Options > Advanced > "Prompt to keep ink annotations when
|
|
11217
11222
|
// exiting" / "Show popup toolbar" while presenting.
|
|
@@ -11251,7 +11256,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11251
11256
|
gridSpacingPx,
|
|
11252
11257
|
// Multiplied against the pre-existing 2x baseline; see the matching
|
|
11253
11258
|
// comment in `PowerPointViewer.tsx`.
|
|
11254
|
-
imageExportScale: 2 *
|
|
11259
|
+
imageExportScale: 2 * chunkG3JPCRKN_js.resolveImageResolutionScale(viewerOptions),
|
|
11255
11260
|
viewerOptions
|
|
11256
11261
|
};
|
|
11257
11262
|
}
|
|
@@ -11267,29 +11272,76 @@ function useCompatibilityToastsState() {
|
|
|
11267
11272
|
}
|
|
11268
11273
|
function useReadOnlyRecommendationState(content) {
|
|
11269
11274
|
const [recommendation, setRecommendation] = react.useState(
|
|
11270
|
-
() =>
|
|
11275
|
+
() => chunkG3JPCRKN_js.readOnlyRecommendation(void 0)
|
|
11271
11276
|
);
|
|
11277
|
+
const [modifyVerifier, setModifyVerifier] = react.useState(void 0);
|
|
11272
11278
|
const [bannerHidden, setBannerHidden] = react.useState(false);
|
|
11273
11279
|
const [editAnywayActive, setEditAnywayActive] = react.useState(false);
|
|
11280
|
+
const [passwordPromptOpen, setPasswordPromptOpen] = react.useState(false);
|
|
11281
|
+
const [passwordError, setPasswordError] = react.useState(null);
|
|
11282
|
+
const [checkingPassword, setCheckingPassword] = react.useState(false);
|
|
11274
11283
|
react.useEffect(() => {
|
|
11275
11284
|
setBannerHidden(false);
|
|
11276
11285
|
setEditAnywayActive(false);
|
|
11286
|
+
setPasswordPromptOpen(false);
|
|
11287
|
+
setPasswordError(null);
|
|
11288
|
+
setCheckingPassword(false);
|
|
11277
11289
|
}, [content]);
|
|
11278
|
-
const
|
|
11290
|
+
const unlock = react.useCallback(() => {
|
|
11279
11291
|
setEditAnywayActive(true);
|
|
11280
11292
|
setBannerHidden(true);
|
|
11293
|
+
setPasswordPromptOpen(false);
|
|
11294
|
+
setPasswordError(null);
|
|
11281
11295
|
}, []);
|
|
11296
|
+
const editAnyway = react.useCallback(() => {
|
|
11297
|
+
if (recommendation.requiresPassword) {
|
|
11298
|
+
setPasswordPromptOpen(true);
|
|
11299
|
+
setPasswordError(null);
|
|
11300
|
+
return;
|
|
11301
|
+
}
|
|
11302
|
+
unlock();
|
|
11303
|
+
}, [recommendation.requiresPassword, unlock]);
|
|
11282
11304
|
const dismiss = react.useCallback(() => {
|
|
11283
11305
|
setBannerHidden(true);
|
|
11284
11306
|
}, []);
|
|
11307
|
+
const cancelPasswordPrompt = react.useCallback(() => {
|
|
11308
|
+
setPasswordPromptOpen(false);
|
|
11309
|
+
setPasswordError(null);
|
|
11310
|
+
}, []);
|
|
11311
|
+
const submitPassword = react.useCallback(
|
|
11312
|
+
async (password) => {
|
|
11313
|
+
setCheckingPassword(true);
|
|
11314
|
+
try {
|
|
11315
|
+
const result = await chunkG3JPCRKN_js.checkModifyPassword(modifyVerifier, password);
|
|
11316
|
+
if (result.ok) {
|
|
11317
|
+
unlock();
|
|
11318
|
+
} else {
|
|
11319
|
+
setPasswordError(result.reason);
|
|
11320
|
+
}
|
|
11321
|
+
} finally {
|
|
11322
|
+
setCheckingPassword(false);
|
|
11323
|
+
}
|
|
11324
|
+
},
|
|
11325
|
+
// oxlint-disable-next-line react/memo-dependencies -- see comment above
|
|
11326
|
+
[modifyVerifier, unlock]
|
|
11327
|
+
);
|
|
11285
11328
|
return {
|
|
11286
11329
|
recommendation,
|
|
11287
11330
|
setRecommendation,
|
|
11331
|
+
setModifyVerifier,
|
|
11288
11332
|
/** Whether the viewer's `canEdit` should be forced off. */
|
|
11289
11333
|
locked: recommendation.defaultReadOnly && !editAnywayActive,
|
|
11290
11334
|
bannerVisible: recommendation.kind !== null && !bannerHidden,
|
|
11291
11335
|
editAnyway,
|
|
11292
|
-
dismiss
|
|
11336
|
+
dismiss,
|
|
11337
|
+
/** Whether the inline password prompt should render in place of the banner's buttons. */
|
|
11338
|
+
passwordPromptOpen,
|
|
11339
|
+
/** Reason the last password attempt failed, or null before any attempt / after success. */
|
|
11340
|
+
passwordError,
|
|
11341
|
+
/** True while `submitPassword`'s check is in flight (disables the form). */
|
|
11342
|
+
checkingPassword,
|
|
11343
|
+
submitPassword,
|
|
11344
|
+
cancelPasswordPrompt
|
|
11293
11345
|
};
|
|
11294
11346
|
}
|
|
11295
11347
|
function useViewPreferencesSync(input) {
|
|
@@ -11305,9 +11357,9 @@ function useViewPreferencesSync(input) {
|
|
|
11305
11357
|
setShowGuides
|
|
11306
11358
|
} = input;
|
|
11307
11359
|
react.useEffect(() => {
|
|
11308
|
-
const seeded =
|
|
11360
|
+
const seeded = chunkG3JPCRKN_js.viewerPreferencesFromViewProperties(
|
|
11309
11361
|
{ viewProperties },
|
|
11310
|
-
{ ...
|
|
11362
|
+
{ ...chunkG3JPCRKN_js.DEFAULT_VIEWER_PREFERENCES, snapToGrid, snapToObjects: snapToShape, showGuides }
|
|
11311
11363
|
);
|
|
11312
11364
|
setSnapToGrid(seeded.snapToGrid);
|
|
11313
11365
|
setSnapToShape(seeded.snapToObjects ?? snapToShape);
|
|
@@ -11317,7 +11369,7 @@ function useViewPreferencesSync(input) {
|
|
|
11317
11369
|
(prefsOverride) => {
|
|
11318
11370
|
setViewProperties((prev) => {
|
|
11319
11371
|
const merged = {
|
|
11320
|
-
...
|
|
11372
|
+
...chunkG3JPCRKN_js.DEFAULT_VIEWER_PREFERENCES,
|
|
11321
11373
|
snapToGrid,
|
|
11322
11374
|
snapToObjects: snapToShape,
|
|
11323
11375
|
showGuides,
|
|
@@ -11325,7 +11377,7 @@ function useViewPreferencesSync(input) {
|
|
|
11325
11377
|
gridSpacingCy: prev?.gridSpacing?.cy,
|
|
11326
11378
|
...prefsOverride
|
|
11327
11379
|
};
|
|
11328
|
-
const patch =
|
|
11380
|
+
const patch = chunkG3JPCRKN_js.viewPropertiesPatchFromPreferences(merged);
|
|
11329
11381
|
return {
|
|
11330
11382
|
...prev,
|
|
11331
11383
|
slideViewPr: { ...prev?.slideViewPr, ...patch.slideViewPr },
|
|
@@ -11467,6 +11519,7 @@ function useViewerBuildingBlocksState(input) {
|
|
|
11467
11519
|
// under the same default-off, core-side SSRF/privacy guard.
|
|
11468
11520
|
allowExternalImages: viewerOptions.trust.allowExternalContent,
|
|
11469
11521
|
setReadOnlyRecommendation: readOnlyRec.setRecommendation,
|
|
11522
|
+
setModifyVerifier: readOnlyRec.setModifyVerifier,
|
|
11470
11523
|
setCompatToasts: compatToastsState.setToasts,
|
|
11471
11524
|
canEdit,
|
|
11472
11525
|
promptKeepInkAnnotations: viewerOptions.advanced.slideShowPromptKeepInkAnnotations,
|
|
@@ -11543,7 +11596,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11543
11596
|
}, [incomingContent]);
|
|
11544
11597
|
const onOpenFile = react.useCallback(() => {
|
|
11545
11598
|
void (async () => {
|
|
11546
|
-
const picked = await
|
|
11599
|
+
const picked = await chunkG3JPCRKN_js.openPptxFile();
|
|
11547
11600
|
if (picked) {
|
|
11548
11601
|
setContent(picked.buffer);
|
|
11549
11602
|
}
|
|
@@ -11551,7 +11604,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11551
11604
|
}, []);
|
|
11552
11605
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11553
11606
|
void (async () => {
|
|
11554
|
-
const bytes = await
|
|
11607
|
+
const bytes = await chunkG3JPCRKN_js.readBackstageRecentFile(key);
|
|
11555
11608
|
if (bytes) {
|
|
11556
11609
|
setContent(bytes);
|
|
11557
11610
|
}
|