pptx-react-viewer 3.5.4 → 3.7.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 +25 -0
- package/dist/{AiChatPanel-CCJNQGER.mjs → AiChatPanel-L5QGWVZK.mjs} +4 -4
- package/dist/AiChatPanel-L5QGWVZK.mjs.br +0 -0
- package/dist/AiChatPanel-L5QGWVZK.mjs.gz +0 -0
- package/dist/{AiChatPanel-LPZWDNVU.js → AiChatPanel-M3AHKYPS.js} +25 -25
- package/dist/AiChatPanel-M3AHKYPS.js.br +0 -0
- package/dist/AiChatPanel-M3AHKYPS.js.gz +0 -0
- package/dist/{Area3DChartScene-P6YM6ZL7.mjs → Area3DChartScene-AE2XYKDW.mjs} +1 -1
- package/dist/Area3DChartScene-AE2XYKDW.mjs.br +1 -0
- package/dist/Area3DChartScene-AE2XYKDW.mjs.gz +0 -0
- package/dist/{Area3DChartScene-LJCWBNQ3.js → Area3DChartScene-ZQLQK6L4.js} +2 -2
- package/dist/Area3DChartScene-ZQLQK6L4.js.br +0 -0
- package/dist/Area3DChartScene-ZQLQK6L4.js.gz +0 -0
- package/dist/{Bar3DChartScene-DIVOJURZ.mjs → Bar3DChartScene-FQV62XOI.mjs} +1 -1
- package/dist/Bar3DChartScene-FQV62XOI.mjs.br +2 -0
- package/dist/Bar3DChartScene-FQV62XOI.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-7DNQ4X5T.js → Bar3DChartScene-TZ6ADFBS.js} +2 -2
- package/dist/Bar3DChartScene-TZ6ADFBS.js.br +0 -0
- package/dist/Bar3DChartScene-TZ6ADFBS.js.gz +0 -0
- package/dist/{Line3DChartScene-UF6DHP36.js → Line3DChartScene-5CKPAX63.js} +2 -2
- package/dist/Line3DChartScene-5CKPAX63.js.br +0 -0
- package/dist/Line3DChartScene-5CKPAX63.js.gz +0 -0
- package/dist/{Line3DChartScene-ZZVNUKIJ.mjs → Line3DChartScene-FEUY3PCE.mjs} +1 -1
- package/dist/Line3DChartScene-FEUY3PCE.mjs.br +1 -0
- package/dist/Line3DChartScene-FEUY3PCE.mjs.gz +0 -0
- package/dist/{Model3DScene-C7MZ22DH.js → Model3DScene-BLXEALM6.js} +2 -2
- package/dist/Model3DScene-BLXEALM6.js.br +0 -0
- package/dist/Model3DScene-BLXEALM6.js.gz +0 -0
- package/dist/{Model3DScene-XXMAAKBR.mjs → Model3DScene-V3DHIISV.mjs} +1 -1
- package/dist/Model3DScene-V3DHIISV.mjs.br +0 -0
- package/dist/Model3DScene-V3DHIISV.mjs.gz +0 -0
- package/dist/{PieChart3DScene-N2Y25VG5.js → PieChart3DScene-GHHT3PDV.js} +2 -2
- package/dist/PieChart3DScene-GHHT3PDV.js.br +0 -0
- package/dist/PieChart3DScene-GHHT3PDV.js.gz +0 -0
- package/dist/{PieChart3DScene-7LX3IL2Q.mjs → PieChart3DScene-VZI2VARG.mjs} +1 -1
- package/dist/{PieChart3DScene-7LX3IL2Q.mjs.br → PieChart3DScene-VZI2VARG.mjs.br} +0 -0
- package/dist/PieChart3DScene-VZI2VARG.mjs.gz +0 -0
- package/dist/PowerPointViewer-Cl6jBPNw.d.ts.map +1 -1
- package/dist/{SurfaceChart3DScene-ADA7NUIW.mjs → SurfaceChart3DScene-T36E2HBA.mjs} +1 -1
- package/dist/SurfaceChart3DScene-T36E2HBA.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-T36E2HBA.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-WXJHYOGJ.js → SurfaceChart3DScene-WWIMQ65D.js} +2 -2
- package/dist/SurfaceChart3DScene-WWIMQ65D.js.br +0 -0
- package/dist/SurfaceChart3DScene-WWIMQ65D.js.gz +0 -0
- package/dist/{chunk-UOMFINNJ.js → chunk-3EJFZ7TE.js} +33 -5
- package/dist/chunk-3EJFZ7TE.js.br +0 -0
- package/dist/chunk-3EJFZ7TE.js.gz +0 -0
- package/dist/{chunk-YQOK4E2A.js → chunk-DCNHUEWQ.js} +35917 -23497
- package/dist/chunk-DCNHUEWQ.js.br +0 -0
- package/dist/chunk-DCNHUEWQ.js.gz +0 -0
- package/dist/{chunk-JCJ3EPG6.mjs → chunk-FGTMS7LR.mjs} +14 -23
- package/dist/chunk-FGTMS7LR.mjs.br +0 -0
- package/dist/chunk-FGTMS7LR.mjs.gz +0 -0
- package/dist/{chunk-U52MKWVA.mjs → chunk-JANUSAEK.mjs} +189 -225
- package/dist/chunk-JANUSAEK.mjs.br +0 -0
- package/dist/chunk-JANUSAEK.mjs.gz +0 -0
- package/dist/{chunk-NM652EZS.mjs → chunk-NV55GU5V.mjs} +35881 -23494
- package/dist/chunk-NV55GU5V.mjs.br +0 -0
- package/dist/chunk-NV55GU5V.mjs.gz +0 -0
- package/dist/{chunk-2FMQ7M3L.js → chunk-OBE4TB76.js} +494 -575
- package/dist/chunk-OBE4TB76.js.br +0 -0
- package/dist/chunk-OBE4TB76.js.gz +0 -0
- package/dist/{chunk-EVVWCF2M.mjs → chunk-PC62KGU3.mjs} +67 -148
- package/dist/chunk-PC62KGU3.mjs.br +0 -0
- package/dist/chunk-PC62KGU3.mjs.gz +0 -0
- package/dist/{chunk-HHJZK26I.js → chunk-TUSALM3A.js} +1603 -1310
- package/dist/chunk-TUSALM3A.js.br +0 -0
- package/dist/chunk-TUSALM3A.js.gz +0 -0
- package/dist/{chunk-IWQSAKPM.mjs → chunk-TXY2E7VQ.mjs} +445 -152
- package/dist/chunk-TXY2E7VQ.mjs.br +0 -0
- package/dist/chunk-TXY2E7VQ.mjs.gz +0 -0
- package/dist/{chunk-UTMTXJGM.js → chunk-VIFDZIVX.js} +375 -412
- package/dist/chunk-VIFDZIVX.js.br +0 -0
- package/dist/chunk-VIFDZIVX.js.gz +0 -0
- package/dist/{chunk-UTIMT5CZ.js → chunk-W24OJ7H5.js} +14 -23
- package/dist/chunk-W24OJ7H5.js.br +0 -0
- package/dist/chunk-W24OJ7H5.js.gz +0 -0
- package/dist/{chunk-IVPT3U5C.mjs → chunk-WKODF5ZU.mjs} +29 -1
- package/dist/chunk-WKODF5ZU.mjs.br +0 -0
- package/dist/chunk-WKODF5ZU.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 +1012 -45
- 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 +1023 -45
- 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/{useViewerBuildingBlocks-f6oNGKMX.d.ts → useViewerBuildingBlocks-C8F_4Pzb.d.ts} +3 -1
- package/dist/useViewerBuildingBlocks-C8F_4Pzb.d.ts.map +1 -0
- package/dist/viewer/index.d.ts +933 -45
- 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-CCJNQGER.mjs.br +0 -0
- package/dist/AiChatPanel-CCJNQGER.mjs.gz +0 -0
- package/dist/AiChatPanel-LPZWDNVU.js.br +0 -0
- package/dist/AiChatPanel-LPZWDNVU.js.gz +0 -0
- package/dist/Area3DChartScene-LJCWBNQ3.js.br +0 -0
- package/dist/Area3DChartScene-LJCWBNQ3.js.gz +0 -0
- package/dist/Area3DChartScene-P6YM6ZL7.mjs.br +0 -0
- package/dist/Area3DChartScene-P6YM6ZL7.mjs.gz +0 -0
- package/dist/Bar3DChartScene-7DNQ4X5T.js.br +0 -1
- package/dist/Bar3DChartScene-7DNQ4X5T.js.gz +0 -0
- package/dist/Bar3DChartScene-DIVOJURZ.mjs.br +0 -0
- package/dist/Bar3DChartScene-DIVOJURZ.mjs.gz +0 -0
- package/dist/Line3DChartScene-UF6DHP36.js.br +0 -0
- package/dist/Line3DChartScene-UF6DHP36.js.gz +0 -0
- package/dist/Line3DChartScene-ZZVNUKIJ.mjs.br +0 -0
- package/dist/Line3DChartScene-ZZVNUKIJ.mjs.gz +0 -0
- package/dist/Model3DScene-C7MZ22DH.js.br +0 -0
- package/dist/Model3DScene-C7MZ22DH.js.gz +0 -0
- package/dist/Model3DScene-XXMAAKBR.mjs.br +0 -0
- package/dist/Model3DScene-XXMAAKBR.mjs.gz +0 -0
- package/dist/PieChart3DScene-7LX3IL2Q.mjs.gz +0 -0
- package/dist/PieChart3DScene-N2Y25VG5.js.br +0 -0
- package/dist/PieChart3DScene-N2Y25VG5.js.gz +0 -0
- package/dist/SurfaceChart3DScene-ADA7NUIW.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-ADA7NUIW.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-WXJHYOGJ.js.br +0 -0
- package/dist/SurfaceChart3DScene-WXJHYOGJ.js.gz +0 -0
- package/dist/chunk-2FMQ7M3L.js.br +0 -0
- package/dist/chunk-2FMQ7M3L.js.gz +0 -0
- package/dist/chunk-EVVWCF2M.mjs.br +0 -0
- package/dist/chunk-EVVWCF2M.mjs.gz +0 -0
- package/dist/chunk-HHJZK26I.js.br +0 -0
- package/dist/chunk-HHJZK26I.js.gz +0 -0
- package/dist/chunk-IVPT3U5C.mjs.br +0 -0
- package/dist/chunk-IVPT3U5C.mjs.gz +0 -0
- package/dist/chunk-IWQSAKPM.mjs.br +0 -0
- package/dist/chunk-IWQSAKPM.mjs.gz +0 -0
- package/dist/chunk-JCJ3EPG6.mjs.br +0 -0
- package/dist/chunk-JCJ3EPG6.mjs.gz +0 -0
- package/dist/chunk-NM652EZS.mjs.br +0 -0
- package/dist/chunk-NM652EZS.mjs.gz +0 -0
- package/dist/chunk-U52MKWVA.mjs.br +0 -0
- package/dist/chunk-U52MKWVA.mjs.gz +0 -0
- package/dist/chunk-UOMFINNJ.js.br +0 -0
- package/dist/chunk-UOMFINNJ.js.gz +0 -0
- package/dist/chunk-UTIMT5CZ.js.br +0 -0
- package/dist/chunk-UTIMT5CZ.js.gz +0 -0
- package/dist/chunk-UTMTXJGM.js.br +0 -0
- package/dist/chunk-UTMTXJGM.js.gz +0 -0
- package/dist/chunk-YQOK4E2A.js.br +0 -0
- package/dist/chunk-YQOK4E2A.js.gz +0 -0
- package/dist/useViewerBuildingBlocks-f6oNGKMX.d.ts.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkVIFDZIVX_js = require('./chunk-VIFDZIVX.js');
|
|
4
|
+
var chunkDCNHUEWQ_js = require('./chunk-DCNHUEWQ.js');
|
|
5
|
+
var chunkW24OJ7H5_js = require('./chunk-W24OJ7H5.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 = chunkDCNHUEWQ_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 = chunkDCNHUEWQ_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 ??= chunkDCNHUEWQ_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 >= chunkDCNHUEWQ_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
|
+
}, chunkDCNHUEWQ_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 = chunkDCNHUEWQ_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
|
+
chunkDCNHUEWQ_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 = chunkDCNHUEWQ_js.validateRoomId(config.roomId);
|
|
244
244
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
245
|
-
departureRef.current =
|
|
245
|
+
departureRef.current = chunkDCNHUEWQ_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 = chunkDCNHUEWQ_js.validateRoomId(config.roomId);
|
|
288
|
+
const transport = config.transport ?? chunkDCNHUEWQ_js.resolveTransportForServerUrl(config.serverUrl);
|
|
289
289
|
if (transport === "webrtc") {
|
|
290
290
|
await initWebrtc();
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
293
|
+
if (chunkDCNHUEWQ_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 = chunkDCNHUEWQ_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
|
+
chunkDCNHUEWQ_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
|
+
}, chunkDCNHUEWQ_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
|
+
chunkDCNHUEWQ_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 = chunkDCNHUEWQ_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 = chunkDCNHUEWQ_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(chunkDCNHUEWQ_js.cloneSlide),
|
|
531
|
+
templateElementsBySlideId: chunkDCNHUEWQ_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(chunkDCNHUEWQ_js.cloneSlide));
|
|
545
545
|
setTemplateElementsBySlideId(
|
|
546
|
-
|
|
546
|
+
chunkDCNHUEWQ_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 = chunkVIFDZIVX_js.cloneHistorySnapshot(previousSnapshot);
|
|
586
|
+
lastHistorySnapshotRef.current = chunkVIFDZIVX_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 = chunkVIFDZIVX_js.cloneHistorySnapshot(nextSnapshot);
|
|
608
|
+
lastHistorySnapshotRef.current = chunkVIFDZIVX_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 = chunkVIFDZIVX_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 = chunkVIFDZIVX_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(chunkVIFDZIVX_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 = chunkVIFDZIVX_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(chunkDCNHUEWQ_js.createWheelStepBuffer());
|
|
747
747
|
const storeRef = react.useRef(null);
|
|
748
|
-
storeRef.current ??=
|
|
748
|
+
storeRef.current ??= chunkDCNHUEWQ_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 = chunkDCNHUEWQ_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, chunkVIFDZIVX_js.MIN_ELEMENT_SIZE));
|
|
847
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkVIFDZIVX_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, chunkVIFDZIVX_js.MIN_ELEMENT_SIZE);
|
|
854
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkVIFDZIVX_js.MIN_ELEMENT_SIZE);
|
|
855
855
|
const availableWidth = Math.max(
|
|
856
|
-
effectiveEditorDimensions.width -
|
|
857
|
-
|
|
856
|
+
effectiveEditorDimensions.width - chunkVIFDZIVX_js.ZOOM_TO_SELECTION_PADDING,
|
|
857
|
+
chunkVIFDZIVX_js.MIN_ELEMENT_SIZE
|
|
858
858
|
);
|
|
859
859
|
const availableHeight = Math.max(
|
|
860
|
-
effectiveEditorDimensions.height -
|
|
861
|
-
|
|
860
|
+
effectiveEditorDimensions.height - chunkVIFDZIVX_js.ZOOM_TO_SELECTION_PADDING,
|
|
861
|
+
chunkVIFDZIVX_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 = chunkDCNHUEWQ_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 = chunkDCNHUEWQ_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: chunkDCNHUEWQ_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
|
|
893
893
|
});
|
|
894
894
|
},
|
|
895
895
|
[store]
|
|
@@ -970,79 +970,6 @@ function stopAnimationSound() {
|
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
972
|
|
|
973
|
-
// src/viewer/hooks/presentation-mode/animation-helpers.ts
|
|
974
|
-
function shouldSeekAnimationGroup(group, endAtMs, nowMs) {
|
|
975
|
-
return group?.seqNextAction === "seek" && nowMs < endAtMs;
|
|
976
|
-
}
|
|
977
|
-
function finishDomAnimationsForGroup(group, root = document) {
|
|
978
|
-
const targetIds = new Set(
|
|
979
|
-
group.steps.filter((step) => !step.command).map((step) => step.elementId)
|
|
980
|
-
);
|
|
981
|
-
if (targetIds.size === 0) {
|
|
982
|
-
return 0;
|
|
983
|
-
}
|
|
984
|
-
const activeAnimations = /* @__PURE__ */ new Set();
|
|
985
|
-
const candidates = root.querySelectorAll(
|
|
986
|
-
'[data-element-id], [data-anim-id], [data-pptx-animation-layer="background"]'
|
|
987
|
-
);
|
|
988
|
-
for (const element of candidates) {
|
|
989
|
-
let animationElementId = element.dataset.animId ?? element.dataset.elementId;
|
|
990
|
-
if (element.dataset.pptxAnimationLayer === "background") {
|
|
991
|
-
const hostId = element.closest("[data-element-id]")?.dataset.elementId;
|
|
992
|
-
animationElementId = hostId ? `${hostId}::pptx-bg` : void 0;
|
|
993
|
-
}
|
|
994
|
-
if (!animationElementId || !targetIds.has(animationElementId)) {
|
|
995
|
-
continue;
|
|
996
|
-
}
|
|
997
|
-
if (typeof element.getAnimations !== "function") {
|
|
998
|
-
continue;
|
|
999
|
-
}
|
|
1000
|
-
for (const animation of element.getAnimations()) {
|
|
1001
|
-
activeAnimations.add(animation);
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
let finishedCount = 0;
|
|
1005
|
-
for (const animation of activeAnimations) {
|
|
1006
|
-
const iterations = animation.effect?.getTiming().iterations;
|
|
1007
|
-
if (animation.playState === "finished" || animation.playState === "idle") {
|
|
1008
|
-
continue;
|
|
1009
|
-
}
|
|
1010
|
-
if (iterations === Infinity) {
|
|
1011
|
-
continue;
|
|
1012
|
-
}
|
|
1013
|
-
try {
|
|
1014
|
-
animation.finish();
|
|
1015
|
-
finishedCount += 1;
|
|
1016
|
-
} catch {
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
return finishedCount;
|
|
1020
|
-
}
|
|
1021
|
-
function finishAnimationGroupSteps(group, setPresentationElementStates, completedStates) {
|
|
1022
|
-
setPresentationElementStates((previousStates) => {
|
|
1023
|
-
const nextStates = new Map(previousStates);
|
|
1024
|
-
for (const step of group.steps) {
|
|
1025
|
-
if (step.command) {
|
|
1026
|
-
continue;
|
|
1027
|
-
}
|
|
1028
|
-
const currentState = nextStates.get(step.elementId) ?? {
|
|
1029
|
-
visible: true,
|
|
1030
|
-
cssAnimation: void 0
|
|
1031
|
-
};
|
|
1032
|
-
const holdsAnimatedPaint = step.holdEndState && step.colorTargets !== void 0 && step.colorTargets.length > 0;
|
|
1033
|
-
nextStates.set(step.elementId, {
|
|
1034
|
-
...currentState,
|
|
1035
|
-
visible: step.presetClass !== "exit" && !step.hideAfterEffect,
|
|
1036
|
-
cssAnimation: step.holdEndState ? step.cssAnimation : void 0,
|
|
1037
|
-
build: completedStates?.get(step.elementId)?.build ?? currentState.build,
|
|
1038
|
-
animatesFill: holdsAnimatedPaint && step.colorTargets?.includes("fill") ? true : void 0,
|
|
1039
|
-
animatesStroke: holdsAnimatedPaint && step.colorTargets?.includes("stroke") ? true : void 0
|
|
1040
|
-
});
|
|
1041
|
-
}
|
|
1042
|
-
return nextStates;
|
|
1043
|
-
});
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
973
|
// src/viewer/hooks/presentation-mode/entrance-animation-timers.ts
|
|
1047
974
|
function scheduleOpeningAutoPlayGroup(controller, ctx) {
|
|
1048
975
|
if (!controller.hasMoreSteps()) {
|
|
@@ -1057,8 +984,8 @@ function scheduleOpeningAutoPlayGroup(controller, ctx) {
|
|
|
1057
984
|
if (!group) {
|
|
1058
985
|
return;
|
|
1059
986
|
}
|
|
1060
|
-
|
|
1061
|
-
|
|
987
|
+
chunkDCNHUEWQ_js.playGroup(controller, group, ctx);
|
|
988
|
+
chunkDCNHUEWQ_js.scheduleAutoAdvanceChain(controller, ctx);
|
|
1062
989
|
}, firstGroup.autoAdvanceDelayMs ?? 0);
|
|
1063
990
|
ctx.timers.push(timer);
|
|
1064
991
|
}
|
|
@@ -1077,7 +1004,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1077
1004
|
}))
|
|
1078
1005
|
);
|
|
1079
1006
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1080
|
-
const delay =
|
|
1007
|
+
const delay = chunkDCNHUEWQ_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1081
1008
|
const timer = window.setTimeout(() => {
|
|
1082
1009
|
setPresentationAnimations(
|
|
1083
1010
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1103,9 +1030,9 @@ function useAnimationPlayback(input) {
|
|
|
1103
1030
|
const presentationTimersRef = react.useRef([]);
|
|
1104
1031
|
const controllerRef = react.useRef(null);
|
|
1105
1032
|
const buildRafRef = react.useRef(null);
|
|
1106
|
-
const activeAnimationGroupRef = react.useRef(
|
|
1107
|
-
const activeAnimationEndAtRef = react.useRef(0);
|
|
1033
|
+
const activeAnimationGroupRef = react.useRef(chunkDCNHUEWQ_js.createActiveAnimationGroup());
|
|
1108
1034
|
const seededCompletedRef = react.useRef(false);
|
|
1035
|
+
const mediaTimeNodeElementIdsRef = react.useRef(/* @__PURE__ */ new Map());
|
|
1109
1036
|
const lastSeedCompletedRef = react.useRef(false);
|
|
1110
1037
|
const buildPlaybackContext = react.useCallback(() => {
|
|
1111
1038
|
return {
|
|
@@ -1114,41 +1041,36 @@ function useAnimationPlayback(input) {
|
|
|
1114
1041
|
buildHandle: buildRafRef,
|
|
1115
1042
|
onPlayActionSound,
|
|
1116
1043
|
playSound: playAnimationSound,
|
|
1117
|
-
stopSound: stopAnimationSound
|
|
1044
|
+
stopSound: stopAnimationSound,
|
|
1045
|
+
mediaTimeNodeElementIds: mediaTimeNodeElementIdsRef.current
|
|
1118
1046
|
};
|
|
1119
1047
|
}, [onPlayActionSound]);
|
|
1120
1048
|
react.useEffect(() => {
|
|
1121
1049
|
return () => {
|
|
1122
|
-
|
|
1050
|
+
chunkDCNHUEWQ_js.cancelBuildReveal(buildRafRef);
|
|
1123
1051
|
};
|
|
1124
1052
|
}, []);
|
|
1125
1053
|
const clearPresentationTimers = react.useCallback(() => {
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
});
|
|
1129
|
-
presentationTimersRef.current = [];
|
|
1130
|
-
chunkYQOK4E2A_js.cancelBuildReveal(buildRafRef);
|
|
1131
|
-
activeAnimationGroupRef.current = null;
|
|
1132
|
-
activeAnimationEndAtRef.current = 0;
|
|
1133
|
-
}, []);
|
|
1134
|
-
const markAnimationGroupActive = react.useCallback((group) => {
|
|
1135
|
-
activeAnimationGroupRef.current = group;
|
|
1136
|
-
activeAnimationEndAtRef.current = performance.now() + Math.max(0, group.totalDurationMs);
|
|
1137
|
-
}, []);
|
|
1054
|
+
chunkDCNHUEWQ_js.clearPlaybackTimers(buildPlaybackContext(), activeAnimationGroupRef.current);
|
|
1055
|
+
}, [buildPlaybackContext]);
|
|
1138
1056
|
const resetSlideTimeline = react.useCallback(
|
|
1139
1057
|
(slideIndex) => {
|
|
1140
|
-
|
|
1058
|
+
chunkDCNHUEWQ_js.cancelBuildReveal(buildRafRef);
|
|
1141
1059
|
const slide = slides[slideIndex];
|
|
1142
1060
|
if (!slide) {
|
|
1143
1061
|
controllerRef.current = null;
|
|
1062
|
+
mediaTimeNodeElementIdsRef.current = /* @__PURE__ */ new Map();
|
|
1144
1063
|
setPresentationElementStates(/* @__PURE__ */ new Map());
|
|
1145
1064
|
setPresentationKeyframesCss("");
|
|
1146
1065
|
setInteractiveTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1147
1066
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1148
1067
|
return;
|
|
1149
1068
|
}
|
|
1150
|
-
const controller =
|
|
1069
|
+
const controller = chunkDCNHUEWQ_js.PresentationAnimationController.fromSlide(slide);
|
|
1151
1070
|
controllerRef.current = controller;
|
|
1071
|
+
mediaTimeNodeElementIdsRef.current = chunkDCNHUEWQ_js.resolveMediaTimeNodeElementIds(
|
|
1072
|
+
slide.nativeAnimations ?? []
|
|
1073
|
+
);
|
|
1152
1074
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1153
1075
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
1154
1076
|
setHoverTriggerShapeIds(controller.hoverTriggerShapeIds);
|
|
@@ -1160,30 +1082,12 @@ function useAnimationPlayback(input) {
|
|
|
1160
1082
|
if (!animationsEnabled) {
|
|
1161
1083
|
return false;
|
|
1162
1084
|
}
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
clearPresentationTimers();
|
|
1170
|
-
finishAnimationGroupSteps(activeGroup, setPresentationElementStates, completedStates);
|
|
1171
|
-
chunkYQOK4E2A_js.scheduleAutoAdvanceChain(controller, buildPlaybackContext());
|
|
1172
|
-
return true;
|
|
1173
|
-
}
|
|
1174
|
-
if (!controller || !controller.hasMoreSteps()) {
|
|
1175
|
-
return false;
|
|
1176
|
-
}
|
|
1177
|
-
const group = controller.advance();
|
|
1178
|
-
if (!group) {
|
|
1179
|
-
return false;
|
|
1180
|
-
}
|
|
1181
|
-
const ctx = buildPlaybackContext();
|
|
1182
|
-
chunkYQOK4E2A_js.playGroup(controller, group, ctx);
|
|
1183
|
-
markAnimationGroupActive(group);
|
|
1184
|
-
chunkYQOK4E2A_js.scheduleAutoAdvanceChain(controller, ctx);
|
|
1185
|
-
return true;
|
|
1186
|
-
}, [animationsEnabled, buildPlaybackContext, clearPresentationTimers, markAnimationGroupActive]);
|
|
1085
|
+
return chunkDCNHUEWQ_js.advanceMainSequence(
|
|
1086
|
+
controllerRef.current,
|
|
1087
|
+
buildPlaybackContext(),
|
|
1088
|
+
activeAnimationGroupRef.current
|
|
1089
|
+
);
|
|
1090
|
+
}, [animationsEnabled, buildPlaybackContext]);
|
|
1187
1091
|
const handleInteractiveShapeClick = react.useCallback(
|
|
1188
1092
|
(shapeId) => {
|
|
1189
1093
|
const controller = controllerRef.current;
|
|
@@ -1194,7 +1098,7 @@ function useAnimationPlayback(input) {
|
|
|
1194
1098
|
if (!group) {
|
|
1195
1099
|
return false;
|
|
1196
1100
|
}
|
|
1197
|
-
|
|
1101
|
+
chunkDCNHUEWQ_js.playGroup(controller, group, buildPlaybackContext());
|
|
1198
1102
|
return true;
|
|
1199
1103
|
},
|
|
1200
1104
|
[buildPlaybackContext]
|
|
@@ -1213,7 +1117,7 @@ function useAnimationPlayback(input) {
|
|
|
1213
1117
|
if (!group) {
|
|
1214
1118
|
return false;
|
|
1215
1119
|
}
|
|
1216
|
-
|
|
1120
|
+
chunkDCNHUEWQ_js.playGroup(controller, group, buildPlaybackContext());
|
|
1217
1121
|
return true;
|
|
1218
1122
|
},
|
|
1219
1123
|
[animationsEnabled, buildPlaybackContext]
|
|
@@ -1294,12 +1198,12 @@ function useAnimationPlayback(input) {
|
|
|
1294
1198
|
presentationTimersRef
|
|
1295
1199
|
};
|
|
1296
1200
|
}
|
|
1297
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1298
|
-
var AUDIENCE_HASH =
|
|
1299
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1300
|
-
var AUDIENCE_NONCE_KEY =
|
|
1201
|
+
var PRESENTER_CHANNEL_NAME = chunkDCNHUEWQ_js.PRESENTATION_CHANNEL_NAME;
|
|
1202
|
+
var AUDIENCE_HASH = chunkDCNHUEWQ_js.PRESENTATION_HASH;
|
|
1203
|
+
var PRESENTER_MSG_ORIGIN = chunkDCNHUEWQ_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1204
|
+
var AUDIENCE_NONCE_KEY = chunkDCNHUEWQ_js.PRESENTATION_NONCE_KEY;
|
|
1301
1205
|
function generateSessionId() {
|
|
1302
|
-
return
|
|
1206
|
+
return chunkDCNHUEWQ_js.createPresentationSessionId();
|
|
1303
1207
|
}
|
|
1304
1208
|
function parseAudienceNonce() {
|
|
1305
1209
|
const hash = window.location.hash;
|
|
@@ -1335,7 +1239,7 @@ function usePresenterWindow(input) {
|
|
|
1335
1239
|
}, []);
|
|
1336
1240
|
const swapDisplays = react.useCallback(async () => {
|
|
1337
1241
|
const audience = audienceWindowRef.current;
|
|
1338
|
-
return audience && !audience.closed ?
|
|
1242
|
+
return audience && !audience.closed ? chunkDCNHUEWQ_js.swapPresentationWindows(window, audience) : false;
|
|
1339
1243
|
}, []);
|
|
1340
1244
|
const syncSlideToAudience = react.useCallback(
|
|
1341
1245
|
(slideIndex) => {
|
|
@@ -1399,7 +1303,7 @@ function usePresenterWindow(input) {
|
|
|
1399
1303
|
pollTimerRef.current = null;
|
|
1400
1304
|
}
|
|
1401
1305
|
if (closingSessionId) {
|
|
1402
|
-
void
|
|
1306
|
+
void chunkDCNHUEWQ_js.clearAudienceContent(closingSessionId);
|
|
1403
1307
|
}
|
|
1404
1308
|
}, [getChannel]);
|
|
1405
1309
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1417,10 +1321,10 @@ function usePresenterWindow(input) {
|
|
|
1417
1321
|
audienceWindowRef.current = blankWin;
|
|
1418
1322
|
const sessionId = generateSessionId();
|
|
1419
1323
|
sessionIdRef.current = sessionId;
|
|
1420
|
-
const audienceUrl =
|
|
1421
|
-
void
|
|
1324
|
+
const audienceUrl = chunkDCNHUEWQ_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1325
|
+
void chunkDCNHUEWQ_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1422
1326
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1423
|
-
|
|
1327
|
+
chunkDCNHUEWQ_js.placeAudienceWindow(blankWin, placement);
|
|
1424
1328
|
}
|
|
1425
1329
|
return void 0;
|
|
1426
1330
|
});
|
|
@@ -1450,7 +1354,7 @@ function usePresenterWindow(input) {
|
|
|
1450
1354
|
}
|
|
1451
1355
|
};
|
|
1452
1356
|
if (content) {
|
|
1453
|
-
void
|
|
1357
|
+
void chunkDCNHUEWQ_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1454
1358
|
} else {
|
|
1455
1359
|
navigateOrClose(true);
|
|
1456
1360
|
}
|
|
@@ -1476,7 +1380,7 @@ function usePresenterWindow(input) {
|
|
|
1476
1380
|
}
|
|
1477
1381
|
const handleMessage = (event) => {
|
|
1478
1382
|
const message = event.data;
|
|
1479
|
-
if (
|
|
1383
|
+
if (chunkDCNHUEWQ_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1480
1384
|
syncStateToAudience(snapshotRef.current);
|
|
1481
1385
|
}
|
|
1482
1386
|
};
|
|
@@ -1505,7 +1409,7 @@ function usePresenterWindow(input) {
|
|
|
1505
1409
|
react.useEffect(() => {
|
|
1506
1410
|
const handleBeforeUnload = () => {
|
|
1507
1411
|
if (sessionIdRef.current) {
|
|
1508
|
-
void
|
|
1412
|
+
void chunkDCNHUEWQ_js.clearAudienceContent(sessionIdRef.current);
|
|
1509
1413
|
}
|
|
1510
1414
|
};
|
|
1511
1415
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1567,7 +1471,7 @@ function useAudienceMode(input) {
|
|
|
1567
1471
|
}
|
|
1568
1472
|
channel.onmessage = (event) => {
|
|
1569
1473
|
const data = event.data;
|
|
1570
|
-
if (!
|
|
1474
|
+
if (!chunkDCNHUEWQ_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1571
1475
|
return;
|
|
1572
1476
|
}
|
|
1573
1477
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1583,16 +1487,16 @@ function useAudienceMode(input) {
|
|
|
1583
1487
|
}
|
|
1584
1488
|
if (data.type === "presenter-exit") {
|
|
1585
1489
|
if (expectedSessionId) {
|
|
1586
|
-
void
|
|
1490
|
+
void chunkDCNHUEWQ_js.clearAudienceContent(expectedSessionId);
|
|
1587
1491
|
}
|
|
1588
|
-
if (
|
|
1492
|
+
if (chunkDCNHUEWQ_js.endAudienceDisplay(window)) {
|
|
1589
1493
|
handlers.onPresenterEnded?.();
|
|
1590
1494
|
}
|
|
1591
1495
|
}
|
|
1592
1496
|
};
|
|
1593
1497
|
if (expectedSessionId) {
|
|
1594
1498
|
channel.postMessage({
|
|
1595
|
-
origin:
|
|
1499
|
+
origin: chunkDCNHUEWQ_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1596
1500
|
type: "audience-ready",
|
|
1597
1501
|
sessionId: expectedSessionId
|
|
1598
1502
|
});
|
|
@@ -1606,7 +1510,7 @@ function useAudienceMode(input) {
|
|
|
1606
1510
|
}, []);
|
|
1607
1511
|
}
|
|
1608
1512
|
function usePresentationKeyboard(input) {
|
|
1609
|
-
const wheelBufferRef = react.useRef(
|
|
1513
|
+
const wheelBufferRef = react.useRef(chunkDCNHUEWQ_js.createWheelStepBuffer());
|
|
1610
1514
|
const {
|
|
1611
1515
|
mode,
|
|
1612
1516
|
movePresentationSlide,
|
|
@@ -1627,14 +1531,14 @@ function usePresentationKeyboard(input) {
|
|
|
1627
1531
|
presentationSlideIndex,
|
|
1628
1532
|
setShowRehearsalSummary
|
|
1629
1533
|
} = input;
|
|
1630
|
-
const keyBufferRef = react.useRef(
|
|
1534
|
+
const keyBufferRef = react.useRef(chunkDCNHUEWQ_js.createPresentationKeyBuffer());
|
|
1631
1535
|
react.useEffect(() => {
|
|
1632
|
-
if (mode !== "present" || !
|
|
1633
|
-
keyBufferRef.current =
|
|
1536
|
+
if (mode !== "present" || !chunkDCNHUEWQ_js.acceptsPresentationInput()) {
|
|
1537
|
+
keyBufferRef.current = chunkDCNHUEWQ_js.createPresentationKeyBuffer();
|
|
1634
1538
|
return;
|
|
1635
1539
|
}
|
|
1636
1540
|
const handleKeyDown = (event) => {
|
|
1637
|
-
const mapped =
|
|
1541
|
+
const mapped = chunkDCNHUEWQ_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1638
1542
|
if (mapped.action === "none") {
|
|
1639
1543
|
return;
|
|
1640
1544
|
}
|
|
@@ -1654,12 +1558,12 @@ function usePresentationKeyboard(input) {
|
|
|
1654
1558
|
movePresentationSlide(-1);
|
|
1655
1559
|
return;
|
|
1656
1560
|
case "first": {
|
|
1657
|
-
const first =
|
|
1561
|
+
const first = chunkDCNHUEWQ_js.firstShowSlideIndex(showSlideIndexes);
|
|
1658
1562
|
navigateToSlide(first ?? 0);
|
|
1659
1563
|
return;
|
|
1660
1564
|
}
|
|
1661
1565
|
case "last": {
|
|
1662
|
-
const last =
|
|
1566
|
+
const last = chunkDCNHUEWQ_js.lastShowSlideIndex(showSlideIndexes);
|
|
1663
1567
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1664
1568
|
return;
|
|
1665
1569
|
}
|
|
@@ -1697,10 +1601,10 @@ function usePresentationKeyboard(input) {
|
|
|
1697
1601
|
}
|
|
1698
1602
|
};
|
|
1699
1603
|
const handleWheel = (event) => {
|
|
1700
|
-
if (mode !== "present" || !
|
|
1604
|
+
if (mode !== "present" || !chunkDCNHUEWQ_js.acceptsPresentationInput()) {
|
|
1701
1605
|
return;
|
|
1702
1606
|
}
|
|
1703
|
-
const mapped =
|
|
1607
|
+
const mapped = chunkDCNHUEWQ_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1704
1608
|
if (mapped.intent === "next-slide") {
|
|
1705
1609
|
event.preventDefault();
|
|
1706
1610
|
movePresentationSlide(1);
|
|
@@ -1833,7 +1737,7 @@ function useRehearsalTimings(input) {
|
|
|
1833
1737
|
|
|
1834
1738
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1835
1739
|
function handlePresentationActionImpl(action, deps) {
|
|
1836
|
-
|
|
1740
|
+
chunkDCNHUEWQ_js.runPresentationAction(
|
|
1837
1741
|
action,
|
|
1838
1742
|
{ slideCount: deps.slidesLength, ...deps.elementId ? { elementId: deps.elementId } : {} },
|
|
1839
1743
|
{
|
|
@@ -1861,16 +1765,19 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1861
1765
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1862
1766
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1863
1767
|
const transition = deps.reverse ? deps.slides[deps.currentSlideIndex]?.transition : incomingSlide?.transition;
|
|
1864
|
-
const durationMs = deps.playTransition ?
|
|
1768
|
+
const durationMs = deps.playTransition ? chunkDCNHUEWQ_js.resolveTransitionDurationMs(transition) : 0;
|
|
1865
1769
|
deps.clearPresentationTimers();
|
|
1866
1770
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1867
1771
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
1868
1772
|
deps.setPresentationSlideVisible(true);
|
|
1869
1773
|
deps.seedSlideAnimations(nextSlideIndex, { completed: deps.seedCompleted });
|
|
1774
|
+
const soundAction = chunkDCNHUEWQ_js.resolveTransitionSoundAction(transition);
|
|
1775
|
+
if (soundAction.kind === "play" && deps.onPlayActionSound) {
|
|
1776
|
+
deps.onPlayActionSound(soundAction.soundPath, { loop: soundAction.loop });
|
|
1777
|
+
} else if (soundAction.kind === "stop" && deps.onStopActionSound) {
|
|
1778
|
+
deps.onStopActionSound();
|
|
1779
|
+
}
|
|
1870
1780
|
if (durationMs > 0 && transition) {
|
|
1871
|
-
if (transition.soundPath && deps.onPlayActionSound) {
|
|
1872
|
-
deps.onPlayActionSound(transition.soundPath, { loop: transition.soundLoop === true });
|
|
1873
|
-
}
|
|
1874
1781
|
deps.setTransitionOverlay({
|
|
1875
1782
|
outgoingSlideIndex: deps.currentSlideIndex,
|
|
1876
1783
|
incomingSlideIndex: nextSlideIndex,
|
|
@@ -1904,6 +1811,7 @@ function useSlideNavigation(input) {
|
|
|
1904
1811
|
onSetMode,
|
|
1905
1812
|
onSetActiveSlideIndex,
|
|
1906
1813
|
onPlayActionSound,
|
|
1814
|
+
onStopActionSound,
|
|
1907
1815
|
loopContinuously,
|
|
1908
1816
|
useTimings,
|
|
1909
1817
|
onAdvancePastLastSlide,
|
|
@@ -1926,7 +1834,7 @@ function useSlideNavigation(input) {
|
|
|
1926
1834
|
});
|
|
1927
1835
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1928
1836
|
(slideIndex) => {
|
|
1929
|
-
const delayMs =
|
|
1837
|
+
const delayMs = chunkDCNHUEWQ_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1930
1838
|
if (delayMs === void 0) {
|
|
1931
1839
|
return;
|
|
1932
1840
|
}
|
|
@@ -1949,7 +1857,7 @@ function useSlideNavigation(input) {
|
|
|
1949
1857
|
if (availableSlideIndexes.length === 0) {
|
|
1950
1858
|
return;
|
|
1951
1859
|
}
|
|
1952
|
-
const pastLastSlide = direction === 1 && !
|
|
1860
|
+
const pastLastSlide = direction === 1 && !chunkDCNHUEWQ_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1953
1861
|
if (rehearsing && pastLastSlide) {
|
|
1954
1862
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1955
1863
|
try {
|
|
@@ -1967,9 +1875,9 @@ function useSlideNavigation(input) {
|
|
|
1967
1875
|
onAdvancePastLastSlide();
|
|
1968
1876
|
return;
|
|
1969
1877
|
}
|
|
1970
|
-
const nextSlideIndex = direction === 1 ?
|
|
1878
|
+
const nextSlideIndex = direction === 1 ? chunkDCNHUEWQ_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1971
1879
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
1972
|
-
}) :
|
|
1880
|
+
}) : chunkDCNHUEWQ_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
1973
1881
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
1974
1882
|
return;
|
|
1975
1883
|
}
|
|
@@ -1980,6 +1888,7 @@ function useSlideNavigation(input) {
|
|
|
1980
1888
|
slides,
|
|
1981
1889
|
currentSlideIndex: presentationSlideIndex,
|
|
1982
1890
|
onPlayActionSound,
|
|
1891
|
+
onStopActionSound,
|
|
1983
1892
|
setPresentationSlideVisible,
|
|
1984
1893
|
clearPresentationTimers,
|
|
1985
1894
|
setPresentationSlideIndex,
|
|
@@ -2003,6 +1912,7 @@ function useSlideNavigation(input) {
|
|
|
2003
1912
|
loopContinuously,
|
|
2004
1913
|
onAdvancePastLastSlide,
|
|
2005
1914
|
onPlayActionSound,
|
|
1915
|
+
onStopActionSound,
|
|
2006
1916
|
onSetActiveSlideIndex,
|
|
2007
1917
|
onSetMode,
|
|
2008
1918
|
playNextAnimationGroup,
|
|
@@ -2034,6 +1944,7 @@ function useSlideNavigation(input) {
|
|
|
2034
1944
|
slides,
|
|
2035
1945
|
currentSlideIndex: presentationSlideIndex,
|
|
2036
1946
|
onPlayActionSound,
|
|
1947
|
+
onStopActionSound,
|
|
2037
1948
|
setPresentationSlideVisible,
|
|
2038
1949
|
clearPresentationTimers,
|
|
2039
1950
|
setPresentationSlideIndex,
|
|
@@ -2056,6 +1967,7 @@ function useSlideNavigation(input) {
|
|
|
2056
1967
|
[
|
|
2057
1968
|
clearPresentationTimers,
|
|
2058
1969
|
onPlayActionSound,
|
|
1970
|
+
onStopActionSound,
|
|
2059
1971
|
onSetActiveSlideIndex,
|
|
2060
1972
|
presentationSlideIndex,
|
|
2061
1973
|
presentationTimersRef,
|
|
@@ -2144,7 +2056,7 @@ function createCustomShowRunner(deps) {
|
|
|
2144
2056
|
return;
|
|
2145
2057
|
}
|
|
2146
2058
|
origin = returnAfter ? { showId: deps.getActiveCustomShowId(), slideIndex: deps.getPresentationSlideIndex() } : null;
|
|
2147
|
-
const first =
|
|
2059
|
+
const first = chunkDCNHUEWQ_js.firstShowSlideIndex(chunkDCNHUEWQ_js.resolveShowSlideIndexes(deps.getSlides(), target));
|
|
2148
2060
|
deps.setActiveCustomShowId(customShowId);
|
|
2149
2061
|
if (first !== void 0) {
|
|
2150
2062
|
deps.navigateToSlide(first);
|
|
@@ -2221,22 +2133,22 @@ function usePresentationActionExtensions(input) {
|
|
|
2221
2133
|
}
|
|
2222
2134
|
}, [navigateToSlideViaRef]);
|
|
2223
2135
|
const onOpenFile = react.useCallback((target) => {
|
|
2224
|
-
|
|
2136
|
+
chunkDCNHUEWQ_js.safeOpenUrl(target);
|
|
2225
2137
|
}, []);
|
|
2226
2138
|
const onOpenPresentation = react.useCallback((target) => {
|
|
2227
|
-
|
|
2139
|
+
chunkDCNHUEWQ_js.safeOpenUrl(target);
|
|
2228
2140
|
}, []);
|
|
2229
2141
|
const onPlayMedia = react.useCallback(
|
|
2230
2142
|
(elementId) => {
|
|
2231
|
-
|
|
2143
|
+
chunkDCNHUEWQ_js.toggleStageElementMedia(containerRef.current, elementId);
|
|
2232
2144
|
},
|
|
2233
2145
|
[containerRef]
|
|
2234
2146
|
);
|
|
2235
2147
|
const onOleVerb = react.useCallback(
|
|
2236
2148
|
(verb, elementId) => {
|
|
2237
|
-
const target =
|
|
2149
|
+
const target = chunkDCNHUEWQ_js.resolveOleVerbTarget(slides[presentationSlideIndex], elementId, verb);
|
|
2238
2150
|
if (target) {
|
|
2239
|
-
|
|
2151
|
+
chunkDCNHUEWQ_js.openUrlInNewTab(target.url);
|
|
2240
2152
|
}
|
|
2241
2153
|
},
|
|
2242
2154
|
[slides, presentationSlideIndex]
|
|
@@ -2266,22 +2178,22 @@ function usePresentationActionExtensions(input) {
|
|
|
2266
2178
|
};
|
|
2267
2179
|
}
|
|
2268
2180
|
function usePresenterConsole(slideIndex, active) {
|
|
2269
|
-
const timerRef = react.useRef(
|
|
2270
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2181
|
+
const timerRef = react.useRef(chunkDCNHUEWQ_js.createPresenterTimer());
|
|
2182
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkDCNHUEWQ_js.createInitialPresentationSnapshot(slideIndex));
|
|
2271
2183
|
const patch = react.useCallback((value) => {
|
|
2272
|
-
setSnapshot((current) =>
|
|
2184
|
+
setSnapshot((current) => chunkDCNHUEWQ_js.mergePresentationSnapshot(current, value));
|
|
2273
2185
|
}, []);
|
|
2274
2186
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2275
2187
|
react.useEffect(() => {
|
|
2276
2188
|
if (!active) {
|
|
2277
2189
|
return;
|
|
2278
2190
|
}
|
|
2279
|
-
timerRef.current =
|
|
2191
|
+
timerRef.current = chunkDCNHUEWQ_js.resetPresenterTimer();
|
|
2280
2192
|
patch({ paused: false, elapsedMs: 0 });
|
|
2281
2193
|
const timer = window.setInterval(() => {
|
|
2282
2194
|
patch({
|
|
2283
2195
|
paused: timerRef.current.paused,
|
|
2284
|
-
elapsedMs:
|
|
2196
|
+
elapsedMs: chunkDCNHUEWQ_js.presenterElapsed(timerRef.current)
|
|
2285
2197
|
});
|
|
2286
2198
|
}, 1e3);
|
|
2287
2199
|
return () => window.clearInterval(timer);
|
|
@@ -2291,19 +2203,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2291
2203
|
applyAudienceSnapshot: setSnapshot,
|
|
2292
2204
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2293
2205
|
toggleTimer: () => {
|
|
2294
|
-
timerRef.current =
|
|
2206
|
+
timerRef.current = chunkDCNHUEWQ_js.togglePresenterTimer(timerRef.current);
|
|
2295
2207
|
patch({
|
|
2296
2208
|
paused: timerRef.current.paused,
|
|
2297
|
-
elapsedMs:
|
|
2209
|
+
elapsedMs: chunkDCNHUEWQ_js.presenterElapsed(timerRef.current)
|
|
2298
2210
|
});
|
|
2299
2211
|
},
|
|
2300
2212
|
resetTimer: () => {
|
|
2301
|
-
timerRef.current =
|
|
2213
|
+
timerRef.current = chunkDCNHUEWQ_js.resetPresenterTimer();
|
|
2302
2214
|
patch({ paused: false, elapsedMs: 0 });
|
|
2303
2215
|
},
|
|
2304
2216
|
stepZoom: (direction) => setSnapshot(
|
|
2305
|
-
(current) =>
|
|
2306
|
-
zoom:
|
|
2217
|
+
(current) => chunkDCNHUEWQ_js.mergePresentationSnapshot(current, {
|
|
2218
|
+
zoom: chunkDCNHUEWQ_js.stepPresenterZoom(
|
|
2307
2219
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2308
2220
|
direction
|
|
2309
2221
|
)
|
|
@@ -2329,6 +2241,7 @@ function usePresentationMode(input) {
|
|
|
2329
2241
|
onSetMode,
|
|
2330
2242
|
onSetActiveSlideIndex,
|
|
2331
2243
|
onPlayActionSound,
|
|
2244
|
+
onStopActionSound,
|
|
2332
2245
|
onSetPointerTool,
|
|
2333
2246
|
onEraseAnnotations,
|
|
2334
2247
|
onToggleInkMarkup,
|
|
@@ -2353,7 +2266,7 @@ function usePresentationMode(input) {
|
|
|
2353
2266
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2354
2267
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2355
2268
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2356
|
-
const showGuard = react.useMemo(() =>
|
|
2269
|
+
const showGuard = react.useMemo(() => chunkDCNHUEWQ_js.createPresenterShowGuard(), []);
|
|
2357
2270
|
const {
|
|
2358
2271
|
presentationAnimations,
|
|
2359
2272
|
presentationElementStates,
|
|
@@ -2422,6 +2335,7 @@ function usePresentationMode(input) {
|
|
|
2422
2335
|
onSetMode,
|
|
2423
2336
|
onSetActiveSlideIndex,
|
|
2424
2337
|
onPlayActionSound,
|
|
2338
|
+
onStopActionSound,
|
|
2425
2339
|
loopContinuously,
|
|
2426
2340
|
useTimings,
|
|
2427
2341
|
onAdvancePastLastSlide: actionExtensions.handleAdvancePastLastSlide,
|
|
@@ -2443,7 +2357,7 @@ function usePresentationMode(input) {
|
|
|
2443
2357
|
actionExtensions.bindNavigateToSlide(navigateToSlide);
|
|
2444
2358
|
const movePresentationSlide = react.useCallback(
|
|
2445
2359
|
(direction, trigger = "explicit") => {
|
|
2446
|
-
if (!
|
|
2360
|
+
if (!chunkDCNHUEWQ_js.acceptsPresentationInput()) {
|
|
2447
2361
|
return;
|
|
2448
2362
|
}
|
|
2449
2363
|
if (endOfShowVisible) {
|
|
@@ -2512,7 +2426,7 @@ function usePresentationMode(input) {
|
|
|
2512
2426
|
onSetMode("present");
|
|
2513
2427
|
}, [containerRef, onSetMode, setRehearsing]);
|
|
2514
2428
|
const enterPresentModeFromBeginning = react.useCallback(() => {
|
|
2515
|
-
const first =
|
|
2429
|
+
const first = chunkDCNHUEWQ_js.firstShowSlideIndex(visibleSlideIndexes);
|
|
2516
2430
|
if (first !== void 0) {
|
|
2517
2431
|
onSetActiveSlideIndex(first);
|
|
2518
2432
|
}
|
|
@@ -2592,7 +2506,7 @@ function usePresentationMode(input) {
|
|
|
2592
2506
|
if (mode !== "present") {
|
|
2593
2507
|
return;
|
|
2594
2508
|
}
|
|
2595
|
-
return
|
|
2509
|
+
return chunkDCNHUEWQ_js.attachPresentationVisibilityPause({
|
|
2596
2510
|
root: containerRef.current ?? void 0,
|
|
2597
2511
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2598
2512
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2600,7 +2514,7 @@ function usePresentationMode(input) {
|
|
|
2600
2514
|
}, [mode, containerRef]);
|
|
2601
2515
|
react.useLayoutEffect(() => {
|
|
2602
2516
|
if (mode === "present") {
|
|
2603
|
-
const idx =
|
|
2517
|
+
const idx = chunkDCNHUEWQ_js.presentationEntrySlideIndex(
|
|
2604
2518
|
activeSlideIndexRef.current,
|
|
2605
2519
|
visibleSlideIndexesRef.current
|
|
2606
2520
|
);
|
|
@@ -2679,11 +2593,11 @@ function usePresentationMode(input) {
|
|
|
2679
2593
|
return void 0;
|
|
2680
2594
|
}
|
|
2681
2595
|
const incoming = slides[transitionOverlay.incomingSlideIndex];
|
|
2682
|
-
return
|
|
2596
|
+
return chunkDCNHUEWQ_js.buildMorphTransitionPlan(
|
|
2683
2597
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2684
2598
|
incoming,
|
|
2685
2599
|
transitionOverlay.durationMs,
|
|
2686
|
-
|
|
2600
|
+
chunkDCNHUEWQ_js.morphOptionToMode(transitionOverlay.transition.morphOption),
|
|
2687
2601
|
// `PresentationStage` stacks the incoming slide's elements above its
|
|
2688
2602
|
// template shapes (`zIndex = templateElements.length + index`), so a
|
|
2689
2603
|
// z-index journey has to start counting where the stage does.
|
|
@@ -2708,7 +2622,7 @@ function usePresentationMode(input) {
|
|
|
2708
2622
|
if (!morphPlan) {
|
|
2709
2623
|
return presentationKeyframesCss;
|
|
2710
2624
|
}
|
|
2711
|
-
const imageRules =
|
|
2625
|
+
const imageRules = chunkDCNHUEWQ_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2712
2626
|
return `${presentationKeyframesCss ?? ""}
|
|
2713
2627
|
${morphPlan.keyframesCss}
|
|
2714
2628
|
${imageRules}`;
|
|
@@ -3005,7 +2919,7 @@ function useFindReplace({
|
|
|
3005
2919
|
const [findResults, setFindResults] = react.useState([]);
|
|
3006
2920
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
3007
2921
|
const performFind = react.useCallback(() => {
|
|
3008
|
-
const results =
|
|
2922
|
+
const results = chunkDCNHUEWQ_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
3009
2923
|
if (!findQuery) {
|
|
3010
2924
|
setFindResults([]);
|
|
3011
2925
|
setFindResultIndex(-1);
|
|
@@ -3039,7 +2953,7 @@ function useFindReplace({
|
|
|
3039
2953
|
return;
|
|
3040
2954
|
}
|
|
3041
2955
|
onUpdateSlides(
|
|
3042
|
-
(prevSlides) =>
|
|
2956
|
+
(prevSlides) => chunkDCNHUEWQ_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
3043
2957
|
);
|
|
3044
2958
|
onMarkDirty();
|
|
3045
2959
|
},
|
|
@@ -3061,9 +2975,9 @@ function useFindReplace({
|
|
|
3061
2975
|
}, [findResults, applyReplacements, performFind]);
|
|
3062
2976
|
react.useEffect(() => {
|
|
3063
2977
|
const handler = (event) => {
|
|
3064
|
-
const { action } =
|
|
2978
|
+
const { action } = chunkDCNHUEWQ_js.mapEditorKey(event, {
|
|
3065
2979
|
canEdit: mode === "edit",
|
|
3066
|
-
isTextInputTarget:
|
|
2980
|
+
isTextInputTarget: chunkDCNHUEWQ_js.isEditorTextInputTarget(event.target)
|
|
3067
2981
|
});
|
|
3068
2982
|
if (action !== "find") {
|
|
3069
2983
|
return;
|
|
@@ -3174,7 +3088,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId, ment
|
|
|
3174
3088
|
if (!slide) {
|
|
3175
3089
|
return { slides, didAdd: false };
|
|
3176
3090
|
}
|
|
3177
|
-
const next =
|
|
3091
|
+
const next = chunkDCNHUEWQ_js.addCommentToList(
|
|
3178
3092
|
slide.comments || [],
|
|
3179
3093
|
text,
|
|
3180
3094
|
authorName,
|
|
@@ -3195,7 +3109,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
|
3195
3109
|
if (!slide) {
|
|
3196
3110
|
return { slides, didDelete: false };
|
|
3197
3111
|
}
|
|
3198
|
-
const next =
|
|
3112
|
+
const next = chunkDCNHUEWQ_js.removeCommentFromList(slide.comments || [], commentId);
|
|
3199
3113
|
if (!next) {
|
|
3200
3114
|
return { slides, didDelete: false };
|
|
3201
3115
|
}
|
|
@@ -3206,7 +3120,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
|
3206
3120
|
if (!slide) {
|
|
3207
3121
|
return { slides, didUpdate: false };
|
|
3208
3122
|
}
|
|
3209
|
-
const next =
|
|
3123
|
+
const next = chunkDCNHUEWQ_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
3210
3124
|
if (!next) {
|
|
3211
3125
|
return { slides, didUpdate: false };
|
|
3212
3126
|
}
|
|
@@ -3217,7 +3131,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
|
3217
3131
|
if (!slide) {
|
|
3218
3132
|
return { slides, didUpdate: false };
|
|
3219
3133
|
}
|
|
3220
|
-
const next =
|
|
3134
|
+
const next = chunkDCNHUEWQ_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
3221
3135
|
if (!next) {
|
|
3222
3136
|
return { slides, didUpdate: false };
|
|
3223
3137
|
}
|
|
@@ -3228,7 +3142,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName, mention
|
|
|
3228
3142
|
if (!slide) {
|
|
3229
3143
|
return { slides, didAdd: false };
|
|
3230
3144
|
}
|
|
3231
|
-
const next =
|
|
3145
|
+
const next = chunkDCNHUEWQ_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
3232
3146
|
if (!next) {
|
|
3233
3147
|
return { slides, didAdd: false };
|
|
3234
3148
|
}
|
|
@@ -3615,7 +3529,7 @@ function useDerivedElementState(input) {
|
|
|
3615
3529
|
return [];
|
|
3616
3530
|
}
|
|
3617
3531
|
return [
|
|
3618
|
-
...
|
|
3532
|
+
...chunkDCNHUEWQ_js.visibleTemplateElements(activeSlide, templateElementsBySlideId[activeSlide.id] ?? [])
|
|
3619
3533
|
];
|
|
3620
3534
|
}, [activeSlide, templateElementsBySlideId]);
|
|
3621
3535
|
const activeMaster = slideMasters[activeMasterIndex];
|
|
@@ -3682,7 +3596,7 @@ function useViewerCoreState(_input) {
|
|
|
3682
3596
|
const marqueeStateRef = react.useRef(null);
|
|
3683
3597
|
const isDrawingRef = react.useRef(false);
|
|
3684
3598
|
const justInteractedRef = react.useRef(false);
|
|
3685
|
-
const livePatcher = react.useMemo(() =>
|
|
3599
|
+
const livePatcher = react.useMemo(() => chunkDCNHUEWQ_js.createCollaborationLivePatcher(), []);
|
|
3686
3600
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3687
3601
|
const slidesRef = react.useRef([]);
|
|
3688
3602
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3691,8 +3605,8 @@ function useViewerCoreState(_input) {
|
|
|
3691
3605
|
const [slides, setSlides] = react.useState([]);
|
|
3692
3606
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3693
3607
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3694
|
-
width:
|
|
3695
|
-
height:
|
|
3608
|
+
width: chunkVIFDZIVX_js.DEFAULT_CANVAS_WIDTH,
|
|
3609
|
+
height: chunkVIFDZIVX_js.DEFAULT_CANVAS_HEIGHT
|
|
3696
3610
|
});
|
|
3697
3611
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3698
3612
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3713,7 +3627,7 @@ function useViewerCoreState(_input) {
|
|
|
3713
3627
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3714
3628
|
inlineEditingTextRef.current = resolved;
|
|
3715
3629
|
setInlineEditingTextBase(value);
|
|
3716
|
-
|
|
3630
|
+
chunkDCNHUEWQ_js.publishLiveInlineText(
|
|
3717
3631
|
livePatcher,
|
|
3718
3632
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3719
3633
|
inlineEditingElementIdRef.current,
|
|
@@ -4067,7 +3981,7 @@ function useLoadContent({
|
|
|
4067
3981
|
);
|
|
4068
3982
|
}
|
|
4069
3983
|
const previousHandler = handlerRef.current;
|
|
4070
|
-
const handler = new
|
|
3984
|
+
const handler = new chunkDCNHUEWQ_js.PptxHandler();
|
|
4071
3985
|
const parsed = await handler.load(buffer, { allowExternalImages });
|
|
4072
3986
|
if (cancelled || token !== renderTokenRef.current) {
|
|
4073
3987
|
handler.dispose();
|
|
@@ -4079,7 +3993,7 @@ function useLoadContent({
|
|
|
4079
3993
|
handlerRef.current = null;
|
|
4080
3994
|
const mediaElements = [];
|
|
4081
3995
|
for (const slide of parsed.slides) {
|
|
4082
|
-
|
|
3996
|
+
chunkDCNHUEWQ_js.collectMediaElements(slide.elements, mediaElements);
|
|
4083
3997
|
}
|
|
4084
3998
|
for (const url of mediaDataUrls.values()) {
|
|
4085
3999
|
if (url.startsWith("blob:")) {
|
|
@@ -4089,38 +4003,18 @@ function useLoadContent({
|
|
|
4089
4003
|
mediaDataUrls.clear();
|
|
4090
4004
|
await Promise.all(
|
|
4091
4005
|
mediaElements.map(async (mediaElement) => {
|
|
4092
|
-
const
|
|
4093
|
-
if (!mediaPath) {
|
|
4006
|
+
const resolved = await chunkDCNHUEWQ_js.resolveMediaElementSource(mediaElement, handler);
|
|
4007
|
+
if (resolved.missing || !resolved.mediaPath || !resolved.url) {
|
|
4094
4008
|
mediaElement.mediaMissing = true;
|
|
4095
4009
|
return;
|
|
4096
4010
|
}
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
const arrayBuffer = await handler.getMediaArrayBuffer(mediaPath);
|
|
4101
|
-
if (arrayBuffer) {
|
|
4102
|
-
const mimeType = mediaElement.mediaMimeType || "application/octet-stream";
|
|
4103
|
-
const blob = new Blob([arrayBuffer], { type: mimeType });
|
|
4104
|
-
const blobUrl = URL.createObjectURL(blob);
|
|
4105
|
-
loadBlobUrls.push(blobUrl);
|
|
4106
|
-
mediaDataUrls.set(mediaPath, blobUrl);
|
|
4107
|
-
} else {
|
|
4108
|
-
mediaElement.mediaMissing = true;
|
|
4109
|
-
}
|
|
4110
|
-
} else {
|
|
4111
|
-
const dataUrl = await handler.getImageData(mediaPath);
|
|
4112
|
-
if (dataUrl) {
|
|
4113
|
-
mediaDataUrls.set(mediaPath, dataUrl);
|
|
4114
|
-
} else {
|
|
4115
|
-
mediaElement.mediaMissing = true;
|
|
4116
|
-
}
|
|
4117
|
-
}
|
|
4118
|
-
} catch {
|
|
4119
|
-
mediaElement.mediaMissing = true;
|
|
4011
|
+
mediaDataUrls.set(resolved.mediaPath, resolved.url);
|
|
4012
|
+
if (resolved.isBlobUrl) {
|
|
4013
|
+
loadBlobUrls.push(resolved.url);
|
|
4120
4014
|
}
|
|
4121
4015
|
})
|
|
4122
4016
|
);
|
|
4123
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
4017
|
+
const { paths: imagePaths, refs: imageRefs } = chunkDCNHUEWQ_js.collectImagePaths(parsed.slides);
|
|
4124
4018
|
let nextSlides = parsed.slides;
|
|
4125
4019
|
if (imagePaths.size > 0) {
|
|
4126
4020
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -4136,25 +4030,25 @@ function useLoadContent({
|
|
|
4136
4030
|
})
|
|
4137
4031
|
);
|
|
4138
4032
|
nextSlides = parsed.slides.map((s) => {
|
|
4139
|
-
const newElements =
|
|
4033
|
+
const newElements = chunkDCNHUEWQ_js.applyImagePathPatches(s.elements, resolvedMap, imageRefs);
|
|
4140
4034
|
return newElements === s.elements ? s : { ...s, elements: newElements };
|
|
4141
4035
|
});
|
|
4142
4036
|
}
|
|
4143
|
-
nextSlides = await
|
|
4037
|
+
nextSlides = await chunkDCNHUEWQ_js.resolveTableCellImageUrls(
|
|
4144
4038
|
nextSlides,
|
|
4145
4039
|
(path) => handler.getImageData(path)
|
|
4146
4040
|
);
|
|
4147
|
-
const nextTableStyleMap = await
|
|
4041
|
+
const nextTableStyleMap = await chunkDCNHUEWQ_js.resolveTableStyleImageUrls(
|
|
4148
4042
|
parsed.tableStyleMap,
|
|
4149
4043
|
(path) => handler.getImageData(path)
|
|
4150
4044
|
);
|
|
4151
4045
|
handlerRef.current = handler;
|
|
4152
|
-
const partition =
|
|
4046
|
+
const partition = chunkDCNHUEWQ_js.partitionTemplateElements(nextSlides);
|
|
4153
4047
|
setSlides(partition.slides);
|
|
4154
4048
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4155
4049
|
setCanvasSize({
|
|
4156
|
-
width: parsed.width ??
|
|
4157
|
-
height: parsed.height ??
|
|
4050
|
+
width: parsed.width ?? chunkVIFDZIVX_js.DEFAULT_CANVAS_WIDTH,
|
|
4051
|
+
height: parsed.height ?? chunkVIFDZIVX_js.DEFAULT_CANVAS_HEIGHT
|
|
4158
4052
|
});
|
|
4159
4053
|
setSlideSizeEmu(
|
|
4160
4054
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4167,13 +4061,13 @@ function useLoadContent({
|
|
|
4167
4061
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
4168
4062
|
setSlideMasters(parsed.slideMasters ?? []);
|
|
4169
4063
|
setModernCommentAuthors(parsed.modernCommentAuthors ?? []);
|
|
4170
|
-
setRecentColors(
|
|
4064
|
+
setRecentColors(chunkDCNHUEWQ_js.seedRecentColors({ mruColors: parsed.mruColors }));
|
|
4171
4065
|
setTheme(parsed.theme);
|
|
4172
4066
|
setTableStyleMap(nextTableStyleMap);
|
|
4173
4067
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
4174
4068
|
setCustomShows(parsed.customShows ?? []);
|
|
4175
4069
|
setActiveCustomShowId(
|
|
4176
|
-
|
|
4070
|
+
chunkDCNHUEWQ_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
4177
4071
|
);
|
|
4178
4072
|
setSections(parsed.sections ?? []);
|
|
4179
4073
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -4196,10 +4090,10 @@ function useLoadContent({
|
|
|
4196
4090
|
setHasMacros(parsed.hasMacros === true);
|
|
4197
4091
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4198
4092
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4199
|
-
setGuides(
|
|
4200
|
-
setReadOnlyRecommendation(
|
|
4093
|
+
setGuides(chunkDCNHUEWQ_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4094
|
+
setReadOnlyRecommendation(chunkDCNHUEWQ_js.readOnlyRecommendation(parsed));
|
|
4201
4095
|
setCompatToasts(
|
|
4202
|
-
|
|
4096
|
+
chunkDCNHUEWQ_js.compatibilityWarningToasts([
|
|
4203
4097
|
...parsed.warnings ?? [],
|
|
4204
4098
|
...parsed.slides.flatMap((slide) => slide.warnings ?? [])
|
|
4205
4099
|
])
|
|
@@ -4211,7 +4105,7 @@ function useLoadContent({
|
|
|
4211
4105
|
onContentApplied?.();
|
|
4212
4106
|
} catch (err) {
|
|
4213
4107
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4214
|
-
if (err instanceof
|
|
4108
|
+
if (err instanceof chunkDCNHUEWQ_js.EncryptedFileError) {
|
|
4215
4109
|
setIsEncrypted(true);
|
|
4216
4110
|
} else {
|
|
4217
4111
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4239,7 +4133,7 @@ function useLoadContent({
|
|
|
4239
4133
|
}
|
|
4240
4134
|
function useAutosave(input) {
|
|
4241
4135
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4242
|
-
const intervalMs =
|
|
4136
|
+
const intervalMs = chunkDCNHUEWQ_js.resolveAutosaveIntervalMs({
|
|
4243
4137
|
hostIntervalMs: input.intervalMs,
|
|
4244
4138
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4245
4139
|
});
|
|
@@ -4270,7 +4164,7 @@ function useAutosave(input) {
|
|
|
4270
4164
|
return;
|
|
4271
4165
|
}
|
|
4272
4166
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4273
|
-
if (!
|
|
4167
|
+
if (!chunkDCNHUEWQ_js.shouldWriteAutosaveSnapshot({
|
|
4274
4168
|
filePath: path,
|
|
4275
4169
|
isDirty: isDirtyRef.current,
|
|
4276
4170
|
saving: isSavingRef.current,
|
|
@@ -4288,8 +4182,8 @@ function useAutosave(input) {
|
|
|
4288
4182
|
isSavingRef.current = false;
|
|
4289
4183
|
return;
|
|
4290
4184
|
}
|
|
4291
|
-
await
|
|
4292
|
-
lastSnapshotRef.current =
|
|
4185
|
+
await chunkDCNHUEWQ_js.saveAutosaveSnapshot(path, data);
|
|
4186
|
+
lastSnapshotRef.current = chunkDCNHUEWQ_js.autosaveSnapshotMark(path, sources);
|
|
4293
4187
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4294
4188
|
} catch (err) {
|
|
4295
4189
|
setAutosaveStatus({
|
|
@@ -4343,13 +4237,13 @@ function useElementOperations(input) {
|
|
|
4343
4237
|
inlineEditingText
|
|
4344
4238
|
} = input;
|
|
4345
4239
|
const liveTextSegments = react.useCallback(() => {
|
|
4346
|
-
if (!selectedElement || !
|
|
4240
|
+
if (!selectedElement || !chunkDCNHUEWQ_js.hasTextProperties(selectedElement)) {
|
|
4347
4241
|
return void 0;
|
|
4348
4242
|
}
|
|
4349
4243
|
if (selectedElement.id !== inlineEditingElementId) {
|
|
4350
4244
|
return selectedElement.textSegments;
|
|
4351
4245
|
}
|
|
4352
|
-
return
|
|
4246
|
+
return chunkDCNHUEWQ_js.remapTextToSegments(
|
|
4353
4247
|
inlineEditingText,
|
|
4354
4248
|
selectedElement.textSegments,
|
|
4355
4249
|
selectedElement.textStyle
|
|
@@ -4390,11 +4284,11 @@ function useElementOperations(input) {
|
|
|
4390
4284
|
(elementId, updates) => {
|
|
4391
4285
|
if (masterView?.target) {
|
|
4392
4286
|
applyMasterViewWrite(
|
|
4393
|
-
|
|
4287
|
+
chunkDCNHUEWQ_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4394
4288
|
);
|
|
4395
4289
|
return;
|
|
4396
4290
|
}
|
|
4397
|
-
if (
|
|
4291
|
+
if (chunkDCNHUEWQ_js.isTemplateElementId(elementId)) {
|
|
4398
4292
|
const slideId = activeSlide?.id;
|
|
4399
4293
|
if (slideId) {
|
|
4400
4294
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4405,7 +4299,7 @@ function useElementOperations(input) {
|
|
|
4405
4299
|
}));
|
|
4406
4300
|
}
|
|
4407
4301
|
} else {
|
|
4408
|
-
setSlides((prev) =>
|
|
4302
|
+
setSlides((prev) => chunkDCNHUEWQ_js.updateElement(prev, activeSlideIndex, elementId, updates));
|
|
4409
4303
|
}
|
|
4410
4304
|
history.markDirty();
|
|
4411
4305
|
},
|
|
@@ -4430,7 +4324,7 @@ function useElementOperations(input) {
|
|
|
4430
4324
|
);
|
|
4431
4325
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4432
4326
|
(updates) => {
|
|
4433
|
-
if (!selectedElement || !
|
|
4327
|
+
if (!selectedElement || !chunkDCNHUEWQ_js.hasShapeProperties(selectedElement)) {
|
|
4434
4328
|
return;
|
|
4435
4329
|
}
|
|
4436
4330
|
updateSelectedElement({
|
|
@@ -4441,19 +4335,19 @@ function useElementOperations(input) {
|
|
|
4441
4335
|
);
|
|
4442
4336
|
const updateSelectedTextStyle = react.useCallback(
|
|
4443
4337
|
(updates) => {
|
|
4444
|
-
if (!selectedElement || !
|
|
4338
|
+
if (!selectedElement || !chunkDCNHUEWQ_js.hasTextProperties(selectedElement)) {
|
|
4445
4339
|
return;
|
|
4446
4340
|
}
|
|
4447
4341
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4448
4342
|
const currentSegments = liveTextSegments();
|
|
4449
|
-
const inlineSel =
|
|
4343
|
+
const inlineSel = chunkDCNHUEWQ_js.getInlineEditorSelection(currentSegments);
|
|
4450
4344
|
if (inlineSel && currentSegments) {
|
|
4451
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4345
|
+
const { newSegments: newSegments2, newSelection } = chunkDCNHUEWQ_js.applyStyleToSelectedSegments(
|
|
4452
4346
|
currentSegments,
|
|
4453
4347
|
inlineSel,
|
|
4454
4348
|
updates
|
|
4455
4349
|
);
|
|
4456
|
-
|
|
4350
|
+
chunkDCNHUEWQ_js.setPendingSelectionRestore(newSelection);
|
|
4457
4351
|
updateSelectedElement({
|
|
4458
4352
|
textSegments: newSegments2,
|
|
4459
4353
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4481,14 +4375,14 @@ function useElementOperations(input) {
|
|
|
4481
4375
|
);
|
|
4482
4376
|
const updateSelectedTextCase = react.useCallback(
|
|
4483
4377
|
(mode) => {
|
|
4484
|
-
if (!selectedElement || !
|
|
4378
|
+
if (!selectedElement || !chunkDCNHUEWQ_js.hasTextProperties(selectedElement)) {
|
|
4485
4379
|
return;
|
|
4486
4380
|
}
|
|
4487
4381
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4488
4382
|
const currentSegments = liveTextSegments();
|
|
4489
|
-
const inlineSel =
|
|
4383
|
+
const inlineSel = chunkDCNHUEWQ_js.getInlineEditorSelection(currentSegments);
|
|
4490
4384
|
if (inlineSel && currentSegments) {
|
|
4491
|
-
const newSegments =
|
|
4385
|
+
const newSegments = chunkDCNHUEWQ_js.applyCaseTransformToSegments(currentSegments, inlineSel, mode);
|
|
4492
4386
|
updateSelectedElement({
|
|
4493
4387
|
textSegments: newSegments,
|
|
4494
4388
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4497,7 +4391,7 @@ function useElementOperations(input) {
|
|
|
4497
4391
|
}
|
|
4498
4392
|
const updates = {};
|
|
4499
4393
|
if (currentSegments && currentSegments.length > 0) {
|
|
4500
|
-
updates.textSegments =
|
|
4394
|
+
updates.textSegments = chunkDCNHUEWQ_js.applyCaseTransformToSegments(
|
|
4501
4395
|
currentSegments,
|
|
4502
4396
|
null,
|
|
4503
4397
|
mode
|
|
@@ -4505,7 +4399,7 @@ function useElementOperations(input) {
|
|
|
4505
4399
|
}
|
|
4506
4400
|
const baseText = isLiveEditing ? inlineEditingText : selectedElement.text;
|
|
4507
4401
|
if (typeof baseText === "string") {
|
|
4508
|
-
updates.text =
|
|
4402
|
+
updates.text = chunkDCNHUEWQ_js.transformTextCase(baseText, mode);
|
|
4509
4403
|
}
|
|
4510
4404
|
updateSelectedElement(updates);
|
|
4511
4405
|
},
|
|
@@ -4524,15 +4418,15 @@ function useElementOperations(input) {
|
|
|
4524
4418
|
[setSlides]
|
|
4525
4419
|
);
|
|
4526
4420
|
const masterViewTarget = masterView?.target ?? null;
|
|
4527
|
-
const activeElements = masterViewTarget ?
|
|
4421
|
+
const activeElements = masterViewTarget ? chunkDCNHUEWQ_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4528
4422
|
const updateActiveElements = react.useCallback(
|
|
4529
4423
|
(updater) => {
|
|
4530
4424
|
if (masterView?.target) {
|
|
4531
4425
|
applyMasterViewWrite(
|
|
4532
|
-
|
|
4426
|
+
chunkDCNHUEWQ_js.replaceMasterViewElements(
|
|
4533
4427
|
masterView,
|
|
4534
4428
|
masterView.target,
|
|
4535
|
-
updater(
|
|
4429
|
+
updater(chunkDCNHUEWQ_js.masterViewElements(masterView, masterView.target))
|
|
4536
4430
|
)
|
|
4537
4431
|
);
|
|
4538
4432
|
return;
|
|
@@ -4585,7 +4479,7 @@ function useSectionOperations(input) {
|
|
|
4585
4479
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4586
4480
|
const addSection2 = react.useCallback(
|
|
4587
4481
|
(name, afterSlideIndex) => {
|
|
4588
|
-
const result =
|
|
4482
|
+
const result = chunkDCNHUEWQ_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4589
4483
|
setSlides(result.slides);
|
|
4590
4484
|
setSections(result.sections);
|
|
4591
4485
|
markDirty();
|
|
@@ -4594,7 +4488,7 @@ function useSectionOperations(input) {
|
|
|
4594
4488
|
);
|
|
4595
4489
|
const renameSection2 = react.useCallback(
|
|
4596
4490
|
(sectionId, newName) => {
|
|
4597
|
-
const result =
|
|
4491
|
+
const result = chunkDCNHUEWQ_js.renameSection(sections, slides, sectionId, newName);
|
|
4598
4492
|
setSections(result.sections);
|
|
4599
4493
|
setSlides(result.slides);
|
|
4600
4494
|
markDirty();
|
|
@@ -4603,7 +4497,7 @@ function useSectionOperations(input) {
|
|
|
4603
4497
|
);
|
|
4604
4498
|
const deleteSection2 = react.useCallback(
|
|
4605
4499
|
(sectionId) => {
|
|
4606
|
-
const result =
|
|
4500
|
+
const result = chunkDCNHUEWQ_js.deleteSection(sections, slides, sectionId);
|
|
4607
4501
|
setSections(result.sections);
|
|
4608
4502
|
setSlides(result.slides);
|
|
4609
4503
|
markDirty();
|
|
@@ -4612,21 +4506,21 @@ function useSectionOperations(input) {
|
|
|
4612
4506
|
);
|
|
4613
4507
|
const moveSectionUp2 = react.useCallback(
|
|
4614
4508
|
(sectionId) => {
|
|
4615
|
-
setSections(
|
|
4509
|
+
setSections(chunkDCNHUEWQ_js.moveSectionUp(sections, sectionId));
|
|
4616
4510
|
markDirty();
|
|
4617
4511
|
},
|
|
4618
4512
|
[sections, setSections, markDirty]
|
|
4619
4513
|
);
|
|
4620
4514
|
const moveSectionDown2 = react.useCallback(
|
|
4621
4515
|
(sectionId) => {
|
|
4622
|
-
setSections(
|
|
4516
|
+
setSections(chunkDCNHUEWQ_js.moveSectionDown(sections, sectionId));
|
|
4623
4517
|
markDirty();
|
|
4624
4518
|
},
|
|
4625
4519
|
[sections, setSections, markDirty]
|
|
4626
4520
|
);
|
|
4627
4521
|
const moveSlidesToSection2 = react.useCallback(
|
|
4628
4522
|
(slideIndexes, targetSectionId) => {
|
|
4629
|
-
const result =
|
|
4523
|
+
const result = chunkDCNHUEWQ_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4630
4524
|
setSlides(result.slides);
|
|
4631
4525
|
setSections(result.sections);
|
|
4632
4526
|
markDirty();
|
|
@@ -4692,15 +4586,15 @@ function syncSelectionHandleOverlay(elementNode, elementId, geometry) {
|
|
|
4692
4586
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4693
4587
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
|
|
4694
4588
|
const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
|
|
4695
|
-
let resized =
|
|
4589
|
+
let resized = chunkDCNHUEWQ_js.applyResize(startBox, handle, dx, dy, 1, { minSize: chunkVIFDZIVX_js.MIN_ELEMENT_SIZE });
|
|
4696
4590
|
if (lockAspect) {
|
|
4697
|
-
resized =
|
|
4591
|
+
resized = chunkDCNHUEWQ_js.lockResizeAspect(resized, startBox, handle, chunkVIFDZIVX_js.MIN_ELEMENT_SIZE);
|
|
4698
4592
|
}
|
|
4699
4593
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4700
4594
|
if (!snapToGrid) {
|
|
4701
4595
|
return box;
|
|
4702
4596
|
}
|
|
4703
|
-
return
|
|
4597
|
+
return chunkDCNHUEWQ_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkVIFDZIVX_js.MIN_ELEMENT_SIZE);
|
|
4704
4598
|
}
|
|
4705
4599
|
function resolveLiveTarget(input) {
|
|
4706
4600
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4813,7 +4707,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4813
4707
|
width: el.width,
|
|
4814
4708
|
height: el.height
|
|
4815
4709
|
}));
|
|
4816
|
-
const snapResult =
|
|
4710
|
+
const snapResult = chunkDCNHUEWQ_js.computeSnapToShape(
|
|
4817
4711
|
targetX,
|
|
4818
4712
|
targetY,
|
|
4819
4713
|
primaryEl.width,
|
|
@@ -4855,7 +4749,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4855
4749
|
if (live) {
|
|
4856
4750
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4857
4751
|
const start = drag.startPositionsById[id];
|
|
4858
|
-
|
|
4752
|
+
chunkDCNHUEWQ_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4859
4753
|
x: start.x + appliedDx,
|
|
4860
4754
|
y: start.y + appliedDy
|
|
4861
4755
|
});
|
|
@@ -4887,8 +4781,8 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4887
4781
|
rs.lastY = geo.y;
|
|
4888
4782
|
rs.lastWidth = geo.width;
|
|
4889
4783
|
rs.lastHeight = geo.height;
|
|
4890
|
-
const width = Math.max(geo.width,
|
|
4891
|
-
const height = Math.max(geo.height,
|
|
4784
|
+
const width = Math.max(geo.width, chunkVIFDZIVX_js.MIN_ELEMENT_SIZE);
|
|
4785
|
+
const height = Math.max(geo.height, chunkVIFDZIVX_js.MIN_ELEMENT_SIZE);
|
|
4892
4786
|
if (rs.domEl) {
|
|
4893
4787
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4894
4788
|
rs.domEl.style.top = `${geo.y}px`;
|
|
@@ -4897,7 +4791,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4897
4791
|
syncSelectionHandleOverlay(rs.domEl, rs.elementId, { x: geo.x, y: geo.y, width, height });
|
|
4898
4792
|
}
|
|
4899
4793
|
if (live) {
|
|
4900
|
-
|
|
4794
|
+
chunkDCNHUEWQ_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4901
4795
|
x: geo.x,
|
|
4902
4796
|
y: geo.y,
|
|
4903
4797
|
width,
|
|
@@ -4908,7 +4802,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4908
4802
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4909
4803
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4910
4804
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4911
|
-
const adjustments =
|
|
4805
|
+
const adjustments = chunkDCNHUEWQ_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4912
4806
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4913
4807
|
adj.moved = true;
|
|
4914
4808
|
}
|
|
@@ -4983,13 +4877,13 @@ function processPointerUp(input) {
|
|
|
4983
4877
|
if (i !== activeSlideIndex) {
|
|
4984
4878
|
return s;
|
|
4985
4879
|
}
|
|
4986
|
-
const rerouted =
|
|
4880
|
+
const rerouted = chunkDCNHUEWQ_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4987
4881
|
if (rerouted.length === 0) {
|
|
4988
4882
|
return s;
|
|
4989
4883
|
}
|
|
4990
4884
|
return {
|
|
4991
4885
|
...s,
|
|
4992
|
-
elements:
|
|
4886
|
+
elements: chunkDCNHUEWQ_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4993
4887
|
};
|
|
4994
4888
|
})
|
|
4995
4889
|
);
|
|
@@ -5014,9 +4908,9 @@ function processPointerUp(input) {
|
|
|
5014
4908
|
}
|
|
5015
4909
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
5016
4910
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
5017
|
-
const hitIds =
|
|
4911
|
+
const hitIds = chunkDCNHUEWQ_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
5018
4912
|
if (marquee.additive) {
|
|
5019
|
-
const merged =
|
|
4913
|
+
const merged = chunkDCNHUEWQ_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
5020
4914
|
if (merged.length > 0) {
|
|
5021
4915
|
applySelection(merged[0], merged);
|
|
5022
4916
|
} else {
|
|
@@ -5039,8 +4933,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
5039
4933
|
}
|
|
5040
4934
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
5041
4935
|
});
|
|
5042
|
-
const rerouted =
|
|
5043
|
-
return
|
|
4936
|
+
const rerouted = chunkDCNHUEWQ_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4937
|
+
return chunkDCNHUEWQ_js.applyReroutedConnectors(movedElements, rerouted);
|
|
5044
4938
|
};
|
|
5045
4939
|
if (editTemplateMode) {
|
|
5046
4940
|
const slideId = activeSlide?.id;
|
|
@@ -5196,15 +5090,23 @@ function useCanvasInteractions(input) {
|
|
|
5196
5090
|
return;
|
|
5197
5091
|
}
|
|
5198
5092
|
const el = elementLookup.get(editId);
|
|
5199
|
-
if (el &&
|
|
5093
|
+
if (el && chunkDCNHUEWQ_js.hasTextProperties(el)) {
|
|
5200
5094
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
5201
|
-
const newSegments =
|
|
5095
|
+
const newSegments = chunkDCNHUEWQ_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
5202
5096
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
5203
|
-
const newHeight =
|
|
5097
|
+
const newHeight = chunkDCNHUEWQ_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
5098
|
+
const shrink = chunkDCNHUEWQ_js.resolveInlineEditNormAutofitShrink(el.textStyle, el.height, editorEl);
|
|
5204
5099
|
ops.updateElementById(editId, {
|
|
5205
5100
|
text: committedText,
|
|
5206
5101
|
textSegments: newSegments,
|
|
5207
|
-
...newHeight !== void 0 ? { height: newHeight } : {}
|
|
5102
|
+
...newHeight !== void 0 ? { height: newHeight } : {},
|
|
5103
|
+
...shrink !== "unchanged" ? {
|
|
5104
|
+
textStyle: {
|
|
5105
|
+
...el.textStyle,
|
|
5106
|
+
autoFitFontScale: shrink.fontScale,
|
|
5107
|
+
autoFitLineSpacingReduction: shrink.lnSpcReduction
|
|
5108
|
+
}
|
|
5109
|
+
} : {}
|
|
5208
5110
|
});
|
|
5209
5111
|
history.markDirty();
|
|
5210
5112
|
}
|
|
@@ -5212,7 +5114,7 @@ function useCanvasInteractions(input) {
|
|
|
5212
5114
|
setInlineEditingText("");
|
|
5213
5115
|
};
|
|
5214
5116
|
const openEquationEditorForElement = (el) => {
|
|
5215
|
-
if (!
|
|
5117
|
+
if (!chunkDCNHUEWQ_js.hasTextProperties(el)) {
|
|
5216
5118
|
return false;
|
|
5217
5119
|
}
|
|
5218
5120
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5242,7 +5144,7 @@ function useCanvasInteractions(input) {
|
|
|
5242
5144
|
justInteractedRef.current = false;
|
|
5243
5145
|
} else {
|
|
5244
5146
|
const el = elementLookup.get(elementId);
|
|
5245
|
-
if (el &&
|
|
5147
|
+
if (el && chunkDCNHUEWQ_js.hasTextProperties(el) && chunkDCNHUEWQ_js.canInteractWithElement(el, "textEdit")) {
|
|
5246
5148
|
if (!openEquationEditorForElement(el)) {
|
|
5247
5149
|
setInlineEditingElementId(elementId);
|
|
5248
5150
|
setInlineEditingText(el.text ?? "");
|
|
@@ -5261,7 +5163,7 @@ function useCanvasInteractions(input) {
|
|
|
5261
5163
|
if (openEquationEditorForElement(el)) {
|
|
5262
5164
|
return;
|
|
5263
5165
|
}
|
|
5264
|
-
if (
|
|
5166
|
+
if (chunkDCNHUEWQ_js.hasTextProperties(el) && chunkDCNHUEWQ_js.canInteractWithElement(el, "textEdit")) {
|
|
5265
5167
|
setInlineEditingElementId(elementId);
|
|
5266
5168
|
setInlineEditingText(el.text ?? "");
|
|
5267
5169
|
}
|
|
@@ -5284,7 +5186,7 @@ function useCanvasInteractions(input) {
|
|
|
5284
5186
|
justSelectedRef.current = false;
|
|
5285
5187
|
}
|
|
5286
5188
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
5287
|
-
const movableIds =
|
|
5189
|
+
const movableIds = chunkDCNHUEWQ_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
5288
5190
|
if (movableIds.length === 0) {
|
|
5289
5191
|
return;
|
|
5290
5192
|
}
|
|
@@ -5354,7 +5256,7 @@ function useCanvasInteractions(input) {
|
|
|
5354
5256
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5355
5257
|
e.stopPropagation();
|
|
5356
5258
|
const el = elementLookup.get(elementId);
|
|
5357
|
-
if (!el || !
|
|
5259
|
+
if (!el || !chunkDCNHUEWQ_js.canInteractWithElement(el, "resize")) {
|
|
5358
5260
|
return;
|
|
5359
5261
|
}
|
|
5360
5262
|
resizeStateRef.current = {
|
|
@@ -5376,7 +5278,7 @@ function useCanvasInteractions(input) {
|
|
|
5376
5278
|
};
|
|
5377
5279
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5378
5280
|
const el = elementLookup.get(elementId);
|
|
5379
|
-
if (!el || !
|
|
5281
|
+
if (!el || !chunkDCNHUEWQ_js.canInteractWithElement(el, "rotate")) {
|
|
5380
5282
|
return;
|
|
5381
5283
|
}
|
|
5382
5284
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5396,10 +5298,10 @@ function useCanvasInteractions(input) {
|
|
|
5396
5298
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5397
5299
|
e.stopPropagation();
|
|
5398
5300
|
const el = elementLookup.get(elementId);
|
|
5399
|
-
if (!el || !
|
|
5301
|
+
if (!el || !chunkDCNHUEWQ_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5400
5302
|
return;
|
|
5401
5303
|
}
|
|
5402
|
-
shapeAdjustmentDragStateRef.current =
|
|
5304
|
+
shapeAdjustmentDragStateRef.current = chunkDCNHUEWQ_js.beginShapeAdjustment(
|
|
5403
5305
|
el,
|
|
5404
5306
|
descriptor,
|
|
5405
5307
|
e.clientX,
|
|
@@ -5446,7 +5348,7 @@ function createFileHandlers(deps) {
|
|
|
5446
5348
|
h = Math.round(h * scale);
|
|
5447
5349
|
}
|
|
5448
5350
|
addElement({
|
|
5449
|
-
id:
|
|
5351
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
5450
5352
|
type: "image",
|
|
5451
5353
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5452
5354
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5457,7 +5359,7 @@ function createFileHandlers(deps) {
|
|
|
5457
5359
|
};
|
|
5458
5360
|
img.onerror = () => {
|
|
5459
5361
|
addElement({
|
|
5460
|
-
id:
|
|
5362
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
5461
5363
|
type: "image",
|
|
5462
5364
|
x: 100,
|
|
5463
5365
|
y: 100,
|
|
@@ -5476,14 +5378,14 @@ function createFileHandlers(deps) {
|
|
|
5476
5378
|
return;
|
|
5477
5379
|
}
|
|
5478
5380
|
e.target.value = "";
|
|
5479
|
-
const mediaType =
|
|
5381
|
+
const mediaType = chunkDCNHUEWQ_js.classifyMediaType(file.type);
|
|
5480
5382
|
if (!mediaType) {
|
|
5481
5383
|
return;
|
|
5482
5384
|
}
|
|
5483
5385
|
const elFilePath = file.path;
|
|
5484
5386
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5485
5387
|
addElement({
|
|
5486
|
-
id:
|
|
5388
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
5487
5389
|
type: "media",
|
|
5488
5390
|
mediaType,
|
|
5489
5391
|
mediaMimeType: file.type || void 0,
|
|
@@ -5658,13 +5560,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5658
5560
|
return;
|
|
5659
5561
|
}
|
|
5660
5562
|
addElement({
|
|
5661
|
-
id:
|
|
5563
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
5662
5564
|
type: "smartArt",
|
|
5663
5565
|
x: 100,
|
|
5664
5566
|
y: 120,
|
|
5665
5567
|
width: 600,
|
|
5666
5568
|
height: 340,
|
|
5667
|
-
smartArtData:
|
|
5569
|
+
smartArtData: chunkDCNHUEWQ_js.buildSmartArtPresetData(
|
|
5668
5570
|
layout,
|
|
5669
5571
|
defaultItems,
|
|
5670
5572
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5676,7 +5578,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5676
5578
|
return;
|
|
5677
5579
|
}
|
|
5678
5580
|
addElement({
|
|
5679
|
-
id:
|
|
5581
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
5680
5582
|
type: "shape",
|
|
5681
5583
|
x: 120,
|
|
5682
5584
|
y: 200,
|
|
@@ -5714,7 +5616,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5714
5616
|
return;
|
|
5715
5617
|
}
|
|
5716
5618
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5717
|
-
if (resolved.url && !
|
|
5619
|
+
if (resolved.url && !chunkDCNHUEWQ_js.isUrlSafe(resolved.url)) {
|
|
5718
5620
|
return;
|
|
5719
5621
|
}
|
|
5720
5622
|
const actionClick = {
|
|
@@ -5738,7 +5640,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5738
5640
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5739
5641
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5740
5642
|
addElement({
|
|
5741
|
-
id:
|
|
5643
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
5742
5644
|
type: "shape",
|
|
5743
5645
|
x: 120,
|
|
5744
5646
|
y: 200,
|
|
@@ -5760,11 +5662,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5760
5662
|
if (!activeSlide) {
|
|
5761
5663
|
return;
|
|
5762
5664
|
}
|
|
5763
|
-
const preset =
|
|
5665
|
+
const preset = chunkDCNHUEWQ_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5764
5666
|
if (!preset) {
|
|
5765
5667
|
return;
|
|
5766
5668
|
}
|
|
5767
|
-
const defaultPptxAction =
|
|
5669
|
+
const defaultPptxAction = chunkDCNHUEWQ_js.elementActionToPptxAction({
|
|
5768
5670
|
trigger: "click",
|
|
5769
5671
|
type: preset.defaultAction
|
|
5770
5672
|
});
|
|
@@ -5773,7 +5675,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5773
5675
|
defaultPptxAction.highlightClick = true;
|
|
5774
5676
|
}
|
|
5775
5677
|
addElement({
|
|
5776
|
-
id:
|
|
5678
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
5777
5679
|
type: "shape",
|
|
5778
5680
|
x: 150,
|
|
5779
5681
|
y: 150,
|
|
@@ -5840,14 +5742,14 @@ function useInsertElements(input) {
|
|
|
5840
5742
|
return;
|
|
5841
5743
|
}
|
|
5842
5744
|
addElement({
|
|
5843
|
-
id:
|
|
5745
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
5844
5746
|
type: "text",
|
|
5845
5747
|
x: 100,
|
|
5846
5748
|
y: 100,
|
|
5847
5749
|
width: 300,
|
|
5848
5750
|
height: 60,
|
|
5849
5751
|
text: "",
|
|
5850
|
-
textStyle: { fontSize:
|
|
5752
|
+
textStyle: { fontSize: chunkVIFDZIVX_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5851
5753
|
});
|
|
5852
5754
|
};
|
|
5853
5755
|
const handleAddShape = () => {
|
|
@@ -5855,7 +5757,7 @@ function useInsertElements(input) {
|
|
|
5855
5757
|
return;
|
|
5856
5758
|
}
|
|
5857
5759
|
addElement({
|
|
5858
|
-
id:
|
|
5760
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
5859
5761
|
type: "shape",
|
|
5860
5762
|
x: 150,
|
|
5861
5763
|
y: 150,
|
|
@@ -5874,15 +5776,15 @@ function useInsertElements(input) {
|
|
|
5874
5776
|
return;
|
|
5875
5777
|
}
|
|
5876
5778
|
addElement({
|
|
5877
|
-
...
|
|
5878
|
-
id:
|
|
5779
|
+
...chunkDCNHUEWQ_js.newTableElement(chunkVIFDZIVX_js.DEFAULT_TABLE_ROWS, chunkVIFDZIVX_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5780
|
+
id: chunkDCNHUEWQ_js.generateElementId()
|
|
5879
5781
|
});
|
|
5880
5782
|
};
|
|
5881
5783
|
const handleAddChart = (chartKind) => {
|
|
5882
5784
|
if (!activeSlide) {
|
|
5883
5785
|
return;
|
|
5884
5786
|
}
|
|
5885
|
-
addElement(
|
|
5787
|
+
addElement(chunkDCNHUEWQ_js.createDefaultChartElement(chartKind));
|
|
5886
5788
|
};
|
|
5887
5789
|
const structured = createStructuredElementHandlers({
|
|
5888
5790
|
activeSlide,
|
|
@@ -5952,7 +5854,7 @@ function useClipboardHandlers(input) {
|
|
|
5952
5854
|
if (!selectedElement) {
|
|
5953
5855
|
return;
|
|
5954
5856
|
}
|
|
5955
|
-
setClipboardPayload(
|
|
5857
|
+
setClipboardPayload(chunkDCNHUEWQ_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5956
5858
|
};
|
|
5957
5859
|
const handleDelete = () => {
|
|
5958
5860
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5969,7 +5871,7 @@ function useClipboardHandlers(input) {
|
|
|
5969
5871
|
handleDelete();
|
|
5970
5872
|
};
|
|
5971
5873
|
const insertClone = (source) => {
|
|
5972
|
-
const clone =
|
|
5874
|
+
const clone = chunkDCNHUEWQ_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5973
5875
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5974
5876
|
ops.applySelection(clone.id);
|
|
5975
5877
|
history.markDirty();
|
|
@@ -6004,7 +5906,7 @@ function resolveShapePath(el) {
|
|
|
6004
5906
|
return el.pathData;
|
|
6005
5907
|
}
|
|
6006
5908
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
6007
|
-
const clipPath =
|
|
5909
|
+
const clipPath = chunkDCNHUEWQ_js.getPresetShapeClipPath(el.shapeType);
|
|
6008
5910
|
if (clipPath) {
|
|
6009
5911
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
6010
5912
|
if (svgPath) {
|
|
@@ -6055,7 +5957,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
6055
5957
|
return parts.join(" ");
|
|
6056
5958
|
}
|
|
6057
5959
|
function transformPathToGlobal(pathData, el) {
|
|
6058
|
-
const polys =
|
|
5960
|
+
const polys = chunkDCNHUEWQ_js.svgPathToPolygons(pathData);
|
|
6059
5961
|
if (polys.length === 0) {
|
|
6060
5962
|
return pathData;
|
|
6061
5963
|
}
|
|
@@ -6075,10 +5977,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
6075
5977
|
y: pt.y * scaleY + el.y
|
|
6076
5978
|
}))
|
|
6077
5979
|
);
|
|
6078
|
-
return
|
|
5980
|
+
return chunkDCNHUEWQ_js.polygonsToSvgPath(transformed);
|
|
6079
5981
|
}
|
|
6080
5982
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
6081
|
-
const polys =
|
|
5983
|
+
const polys = chunkDCNHUEWQ_js.svgPathToPolygons(pathData);
|
|
6082
5984
|
if (polys.length === 0) {
|
|
6083
5985
|
return pathData;
|
|
6084
5986
|
}
|
|
@@ -6088,10 +5990,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
6088
5990
|
y: pt.y - y
|
|
6089
5991
|
}))
|
|
6090
5992
|
);
|
|
6091
|
-
return
|
|
5993
|
+
return chunkDCNHUEWQ_js.polygonsToSvgPath(transformed);
|
|
6092
5994
|
}
|
|
6093
5995
|
function pathBounds(pathData) {
|
|
6094
|
-
const polys =
|
|
5996
|
+
const polys = chunkDCNHUEWQ_js.svgPathToPolygons(pathData);
|
|
6095
5997
|
let minX = Infinity;
|
|
6096
5998
|
let minY = Infinity;
|
|
6097
5999
|
let maxX = -Infinity;
|
|
@@ -6150,7 +6052,7 @@ function useMergeShapesHandler(input) {
|
|
|
6150
6052
|
let allFragments = [];
|
|
6151
6053
|
let remaining = globalPaths[0];
|
|
6152
6054
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6153
|
-
const frags =
|
|
6055
|
+
const frags = chunkDCNHUEWQ_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
6154
6056
|
if (Array.isArray(frags)) {
|
|
6155
6057
|
allFragments = frags;
|
|
6156
6058
|
}
|
|
@@ -6179,7 +6081,7 @@ function useMergeShapesHandler(input) {
|
|
|
6179
6081
|
bounds.height
|
|
6180
6082
|
);
|
|
6181
6083
|
const newEl = {
|
|
6182
|
-
id:
|
|
6084
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
6183
6085
|
type: "shape",
|
|
6184
6086
|
x: bounds.x,
|
|
6185
6087
|
y: bounds.y,
|
|
@@ -6217,7 +6119,7 @@ function useMergeShapesHandler(input) {
|
|
|
6217
6119
|
} else {
|
|
6218
6120
|
let resultPath = globalPaths[0];
|
|
6219
6121
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6220
|
-
const result =
|
|
6122
|
+
const result = chunkDCNHUEWQ_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
6221
6123
|
if (typeof result === "string") {
|
|
6222
6124
|
resultPath = result;
|
|
6223
6125
|
}
|
|
@@ -6238,7 +6140,7 @@ function useMergeShapesHandler(input) {
|
|
|
6238
6140
|
);
|
|
6239
6141
|
const primary = targets[0];
|
|
6240
6142
|
const newEl = {
|
|
6241
|
-
id:
|
|
6143
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
6242
6144
|
type: "shape",
|
|
6243
6145
|
x: bounds.x,
|
|
6244
6146
|
y: bounds.y,
|
|
@@ -6301,7 +6203,10 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6301
6203
|
if (ids.length < 2 || !activeSlide) {
|
|
6302
6204
|
return;
|
|
6303
6205
|
}
|
|
6304
|
-
|
|
6206
|
+
if (!selectedElements.every((el) => chunkDCNHUEWQ_js.canInteractWithElement(el, "group"))) {
|
|
6207
|
+
return;
|
|
6208
|
+
}
|
|
6209
|
+
const { elements, groupId } = chunkDCNHUEWQ_js.groupElements(ops.activeElements, ids, chunkDCNHUEWQ_js.generateElementId());
|
|
6305
6210
|
if (groupId === null) {
|
|
6306
6211
|
return;
|
|
6307
6212
|
}
|
|
@@ -6313,12 +6218,15 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6313
6218
|
if (!selectedElement || selectedElement.type !== "group" || !activeSlide) {
|
|
6314
6219
|
return;
|
|
6315
6220
|
}
|
|
6221
|
+
if (!chunkDCNHUEWQ_js.canInteractWithElement(selectedElement, "group")) {
|
|
6222
|
+
return;
|
|
6223
|
+
}
|
|
6316
6224
|
const group = selectedElement;
|
|
6317
|
-
const intoTemplate =
|
|
6225
|
+
const intoTemplate = chunkDCNHUEWQ_js.isTemplateElementId(group.id);
|
|
6318
6226
|
const childIds = group.children.map(
|
|
6319
|
-
(child) => intoTemplate ?
|
|
6227
|
+
(child) => intoTemplate ? chunkDCNHUEWQ_js.makeCloneId(true, child.id || group.id) : child.id || chunkDCNHUEWQ_js.generateElementId()
|
|
6320
6228
|
);
|
|
6321
|
-
const { elements, childIds: usedIds } =
|
|
6229
|
+
const { elements, childIds: usedIds } = chunkDCNHUEWQ_js.ungroupElements(
|
|
6322
6230
|
ops.activeElements,
|
|
6323
6231
|
group.id,
|
|
6324
6232
|
childIds,
|
|
@@ -6347,7 +6255,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6347
6255
|
if (!edge) {
|
|
6348
6256
|
return;
|
|
6349
6257
|
}
|
|
6350
|
-
const positions =
|
|
6258
|
+
const positions = chunkDCNHUEWQ_js.alignElements(selectedElements, edge);
|
|
6351
6259
|
for (const [id, pos] of positions) {
|
|
6352
6260
|
const el = elementLookup.get(id);
|
|
6353
6261
|
if (!el) {
|
|
@@ -6365,7 +6273,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6365
6273
|
if (!distAxis) {
|
|
6366
6274
|
return;
|
|
6367
6275
|
}
|
|
6368
|
-
const positions =
|
|
6276
|
+
const positions = chunkDCNHUEWQ_js.distributeElements(selectedElements, distAxis);
|
|
6369
6277
|
for (const [id, pos] of positions) {
|
|
6370
6278
|
const el = elementLookup.get(id);
|
|
6371
6279
|
if (!el) {
|
|
@@ -6376,13 +6284,14 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6376
6284
|
history.markDirty();
|
|
6377
6285
|
};
|
|
6378
6286
|
const canDistribute = selectedElements.length >= 3;
|
|
6287
|
+
const selectionGroupable = selectedElements.every((el) => chunkDCNHUEWQ_js.canInteractWithElement(el, "group"));
|
|
6379
6288
|
const handleMoveLayer = (direction) => {
|
|
6380
6289
|
if (!selectedElement || !activeSlide) {
|
|
6381
6290
|
return;
|
|
6382
6291
|
}
|
|
6383
6292
|
const id = selectedElement.id;
|
|
6384
6293
|
ops.updateActiveElements(
|
|
6385
|
-
(els) => direction === "forward" ?
|
|
6294
|
+
(els) => direction === "forward" ? chunkDCNHUEWQ_js.bringForward(els, id) : direction === "backward" ? chunkDCNHUEWQ_js.sendBackward(els, id) : els
|
|
6386
6295
|
);
|
|
6387
6296
|
history.markDirty();
|
|
6388
6297
|
};
|
|
@@ -6392,7 +6301,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6392
6301
|
}
|
|
6393
6302
|
const id = selectedElement.id;
|
|
6394
6303
|
ops.updateActiveElements(
|
|
6395
|
-
(els) => direction === "front" ?
|
|
6304
|
+
(els) => direction === "front" ? chunkDCNHUEWQ_js.bringToFront(els, id) : chunkDCNHUEWQ_js.sendToBack(els, id)
|
|
6396
6305
|
);
|
|
6397
6306
|
history.markDirty();
|
|
6398
6307
|
};
|
|
@@ -6412,6 +6321,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6412
6321
|
handleAlignElements,
|
|
6413
6322
|
handleDistributeElements,
|
|
6414
6323
|
canDistribute,
|
|
6324
|
+
selectionGroupable,
|
|
6415
6325
|
handleMoveLayer,
|
|
6416
6326
|
handleMoveLayerToEdge,
|
|
6417
6327
|
handleMergeShapes,
|
|
@@ -6430,6 +6340,7 @@ function useElementManipulation(input) {
|
|
|
6430
6340
|
handleAlignElements,
|
|
6431
6341
|
handleDistributeElements,
|
|
6432
6342
|
canDistribute,
|
|
6343
|
+
selectionGroupable,
|
|
6433
6344
|
handleMoveLayer,
|
|
6434
6345
|
handleMoveLayerToEdge,
|
|
6435
6346
|
handleMergeShapes,
|
|
@@ -6496,6 +6407,7 @@ function useElementManipulation(input) {
|
|
|
6496
6407
|
handleAlignElements,
|
|
6497
6408
|
handleDistributeElements,
|
|
6498
6409
|
canDistribute,
|
|
6410
|
+
selectionGroupable,
|
|
6499
6411
|
handleMoveLayer,
|
|
6500
6412
|
handleMoveLayerToEdge,
|
|
6501
6413
|
handleMergeShapes,
|
|
@@ -6523,7 +6435,7 @@ function useSlideManagement(input) {
|
|
|
6523
6435
|
theme
|
|
6524
6436
|
} = input;
|
|
6525
6437
|
const handleAddSlide = () => {
|
|
6526
|
-
const newSlide =
|
|
6438
|
+
const newSlide = chunkDCNHUEWQ_js.createBlankSlide(slides.length + 1);
|
|
6527
6439
|
ops.updateSlides((prev) => {
|
|
6528
6440
|
const next = [...prev];
|
|
6529
6441
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6586,7 +6498,7 @@ function useSlideManagement(input) {
|
|
|
6586
6498
|
}
|
|
6587
6499
|
const clone = {
|
|
6588
6500
|
...src,
|
|
6589
|
-
id:
|
|
6501
|
+
id: chunkDCNHUEWQ_js.makeSlideId(),
|
|
6590
6502
|
elements: src.elements.map((el) => ({
|
|
6591
6503
|
...el,
|
|
6592
6504
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6618,7 +6530,7 @@ function useSlideManagement(input) {
|
|
|
6618
6530
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6619
6531
|
const insertAt = activeSlideIndex + 1;
|
|
6620
6532
|
const draft = {
|
|
6621
|
-
...
|
|
6533
|
+
...chunkDCNHUEWQ_js.createBlankSlide(slides.length + 1),
|
|
6622
6534
|
layoutPath,
|
|
6623
6535
|
...layoutName ? { layoutName } : {}
|
|
6624
6536
|
};
|
|
@@ -6651,9 +6563,9 @@ function useSlideManagement(input) {
|
|
|
6651
6563
|
};
|
|
6652
6564
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6653
6565
|
const insertAt = activeSlideIndex + 1;
|
|
6654
|
-
const draft =
|
|
6566
|
+
const draft = chunkDCNHUEWQ_js.buildSlideTemplateSlide(templateId, chunkDCNHUEWQ_js.makeSlideId(), slides.length + 1, {
|
|
6655
6567
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6656
|
-
scheme:
|
|
6568
|
+
scheme: chunkDCNHUEWQ_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6657
6569
|
});
|
|
6658
6570
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6659
6571
|
setActiveSlideIndex(insertAt);
|
|
@@ -6690,7 +6602,7 @@ function createTableMergeHandlers(input) {
|
|
|
6690
6602
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6691
6603
|
return;
|
|
6692
6604
|
}
|
|
6693
|
-
const newTableData =
|
|
6605
|
+
const newTableData = chunkDCNHUEWQ_js.mergeCells(
|
|
6694
6606
|
[
|
|
6695
6607
|
{ row: rowIndex, col: columnIndex },
|
|
6696
6608
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6698,7 +6610,7 @@ function createTableMergeHandlers(input) {
|
|
|
6698
6610
|
td
|
|
6699
6611
|
);
|
|
6700
6612
|
const updates = { tableData: newTableData };
|
|
6701
|
-
const newRawXml =
|
|
6613
|
+
const newRawXml = chunkDCNHUEWQ_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6702
6614
|
if (newRawXml) {
|
|
6703
6615
|
updates.rawXml = newRawXml;
|
|
6704
6616
|
}
|
|
@@ -6724,7 +6636,7 @@ function createTableMergeHandlers(input) {
|
|
|
6724
6636
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6725
6637
|
return;
|
|
6726
6638
|
}
|
|
6727
|
-
const newTableData =
|
|
6639
|
+
const newTableData = chunkDCNHUEWQ_js.mergeCells(
|
|
6728
6640
|
[
|
|
6729
6641
|
{ row: rowIndex, col: columnIndex },
|
|
6730
6642
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6732,7 +6644,7 @@ function createTableMergeHandlers(input) {
|
|
|
6732
6644
|
td
|
|
6733
6645
|
);
|
|
6734
6646
|
const updates = { tableData: newTableData };
|
|
6735
|
-
const newRawXml =
|
|
6647
|
+
const newRawXml = chunkDCNHUEWQ_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6736
6648
|
if (newRawXml) {
|
|
6737
6649
|
updates.rawXml = newRawXml;
|
|
6738
6650
|
}
|
|
@@ -6747,9 +6659,9 @@ function createTableMergeHandlers(input) {
|
|
|
6747
6659
|
return;
|
|
6748
6660
|
}
|
|
6749
6661
|
const td = selectedElement.tableData;
|
|
6750
|
-
const newTableData =
|
|
6662
|
+
const newTableData = chunkDCNHUEWQ_js.mergeCells(ts.selectedCells, td);
|
|
6751
6663
|
const updates = { tableData: newTableData };
|
|
6752
|
-
const newRawXml =
|
|
6664
|
+
const newRawXml = chunkDCNHUEWQ_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6753
6665
|
if (newRawXml) {
|
|
6754
6666
|
updates.rawXml = newRawXml;
|
|
6755
6667
|
}
|
|
@@ -6766,9 +6678,9 @@ function createTableMergeHandlers(input) {
|
|
|
6766
6678
|
}
|
|
6767
6679
|
const { rowIndex, columnIndex } = ts;
|
|
6768
6680
|
const td = selectedElement.tableData;
|
|
6769
|
-
const newTableData =
|
|
6681
|
+
const newTableData = chunkDCNHUEWQ_js.splitCell(rowIndex, columnIndex, td);
|
|
6770
6682
|
const updates = { tableData: newTableData };
|
|
6771
|
-
const newRawXml =
|
|
6683
|
+
const newRawXml = chunkDCNHUEWQ_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6772
6684
|
if (newRawXml) {
|
|
6773
6685
|
updates.rawXml = newRawXml;
|
|
6774
6686
|
}
|
|
@@ -6802,10 +6714,10 @@ function createTableStructHandlers(input) {
|
|
|
6802
6714
|
const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
|
|
6803
6715
|
const updates = {};
|
|
6804
6716
|
if (el.tableData) {
|
|
6805
|
-
updates.tableData =
|
|
6717
|
+
updates.tableData = chunkDCNHUEWQ_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6806
6718
|
}
|
|
6807
6719
|
if (el.rawXml) {
|
|
6808
|
-
const newRawXml =
|
|
6720
|
+
const newRawXml = chunkDCNHUEWQ_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6809
6721
|
if (newRawXml) {
|
|
6810
6722
|
updates.rawXml = newRawXml;
|
|
6811
6723
|
}
|
|
@@ -6829,7 +6741,7 @@ function createTableStructHandlers(input) {
|
|
|
6829
6741
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6830
6742
|
const updates = {};
|
|
6831
6743
|
if (selectedElement.rawXml) {
|
|
6832
|
-
const newRawXml =
|
|
6744
|
+
const newRawXml = chunkDCNHUEWQ_js.updateCellTextStyleInRawXml(
|
|
6833
6745
|
selectedElement,
|
|
6834
6746
|
rowIndex,
|
|
6835
6747
|
colIndex,
|
|
@@ -6893,9 +6805,9 @@ function createTableStructHandlers(input) {
|
|
|
6893
6805
|
return;
|
|
6894
6806
|
}
|
|
6895
6807
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6896
|
-
const newTableData =
|
|
6808
|
+
const newTableData = chunkDCNHUEWQ_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6897
6809
|
const updates = { tableData: newTableData };
|
|
6898
|
-
const newRawXml =
|
|
6810
|
+
const newRawXml = chunkDCNHUEWQ_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6899
6811
|
if (newRawXml) {
|
|
6900
6812
|
updates.rawXml = newRawXml;
|
|
6901
6813
|
}
|
|
@@ -6908,12 +6820,12 @@ function createTableStructHandlers(input) {
|
|
|
6908
6820
|
}
|
|
6909
6821
|
const td = selectedElement.tableData;
|
|
6910
6822
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6911
|
-
const newTableData =
|
|
6823
|
+
const newTableData = chunkDCNHUEWQ_js.deleteTableRow(td, rowIdx);
|
|
6912
6824
|
if (newTableData === td) {
|
|
6913
6825
|
return;
|
|
6914
6826
|
}
|
|
6915
6827
|
const updates = { tableData: newTableData };
|
|
6916
|
-
const newRawXml =
|
|
6828
|
+
const newRawXml = chunkDCNHUEWQ_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6917
6829
|
if (newRawXml) {
|
|
6918
6830
|
updates.rawXml = newRawXml;
|
|
6919
6831
|
}
|
|
@@ -6925,9 +6837,9 @@ function createTableStructHandlers(input) {
|
|
|
6925
6837
|
return;
|
|
6926
6838
|
}
|
|
6927
6839
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6928
|
-
const newTableData =
|
|
6840
|
+
const newTableData = chunkDCNHUEWQ_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6929
6841
|
const updates = { tableData: newTableData };
|
|
6930
|
-
const newRawXml =
|
|
6842
|
+
const newRawXml = chunkDCNHUEWQ_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6931
6843
|
if (newRawXml) {
|
|
6932
6844
|
updates.rawXml = newRawXml;
|
|
6933
6845
|
}
|
|
@@ -6940,12 +6852,12 @@ function createTableStructHandlers(input) {
|
|
|
6940
6852
|
}
|
|
6941
6853
|
const td = selectedElement.tableData;
|
|
6942
6854
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6943
|
-
const newTableData =
|
|
6855
|
+
const newTableData = chunkDCNHUEWQ_js.deleteTableColumn(td, colIdx);
|
|
6944
6856
|
if (newTableData === td) {
|
|
6945
6857
|
return;
|
|
6946
6858
|
}
|
|
6947
6859
|
const updates = { tableData: newTableData };
|
|
6948
|
-
const newRawXml =
|
|
6860
|
+
const newRawXml = chunkDCNHUEWQ_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6949
6861
|
if (newRawXml) {
|
|
6950
6862
|
updates.rawXml = newRawXml;
|
|
6951
6863
|
}
|
|
@@ -6981,8 +6893,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6981
6893
|
return html2canvasPro(element, {
|
|
6982
6894
|
...options,
|
|
6983
6895
|
onclone: async (doc, clonedEl) => {
|
|
6984
|
-
await
|
|
6985
|
-
|
|
6896
|
+
await chunkDCNHUEWQ_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6897
|
+
chunkDCNHUEWQ_js.preprocessCssForCapture(clonedEl);
|
|
6986
6898
|
if (typeof userOnClone === "function") {
|
|
6987
6899
|
userOnClone(doc, clonedEl);
|
|
6988
6900
|
}
|
|
@@ -7020,13 +6932,13 @@ function useExportSaveAs(input) {
|
|
|
7020
6932
|
if (!handler) {
|
|
7021
6933
|
return;
|
|
7022
6934
|
}
|
|
7023
|
-
const downloadName =
|
|
6935
|
+
const downloadName = chunkDCNHUEWQ_js.savedPresentationFileName(filePath, format);
|
|
7024
6936
|
try {
|
|
7025
6937
|
const data = await buildSaveAsData(handler, format);
|
|
7026
6938
|
const blob = new Blob([data], {
|
|
7027
6939
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
7028
6940
|
});
|
|
7029
|
-
|
|
6941
|
+
chunkDCNHUEWQ_js.downloadBlob(blob, downloadName);
|
|
7030
6942
|
} catch (err) {
|
|
7031
6943
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
7032
6944
|
}
|
|
@@ -7039,18 +6951,18 @@ function useExportSaveAs(input) {
|
|
|
7039
6951
|
const pptxGuides = guides.map((g) => ({
|
|
7040
6952
|
id: g.id,
|
|
7041
6953
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7042
|
-
positionEmu:
|
|
6954
|
+
positionEmu: chunkDCNHUEWQ_js.guidePxToEmu(g.position)
|
|
7043
6955
|
}));
|
|
7044
6956
|
return {
|
|
7045
6957
|
...slide,
|
|
7046
6958
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7047
6959
|
};
|
|
7048
6960
|
});
|
|
7049
|
-
const slidesToSave =
|
|
6961
|
+
const slidesToSave = chunkDCNHUEWQ_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7050
6962
|
const saveOptions = {
|
|
7051
6963
|
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
7052
6964
|
// a preset picked in the inspector reached one save path and not the other.
|
|
7053
|
-
slideSize:
|
|
6965
|
+
slideSize: chunkDCNHUEWQ_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
7054
6966
|
headerFooter,
|
|
7055
6967
|
presentationProperties,
|
|
7056
6968
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -7064,13 +6976,13 @@ function useExportSaveAs(input) {
|
|
|
7064
6976
|
handoutMaster,
|
|
7065
6977
|
outputFormat: format
|
|
7066
6978
|
};
|
|
7067
|
-
return
|
|
6979
|
+
return chunkDCNHUEWQ_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
7068
6980
|
};
|
|
7069
6981
|
const handleExportJson = () => {
|
|
7070
6982
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7071
|
-
const slideSize =
|
|
6983
|
+
const slideSize = chunkDCNHUEWQ_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7072
6984
|
const data = {
|
|
7073
|
-
slides:
|
|
6985
|
+
slides: chunkDCNHUEWQ_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7074
6986
|
width: canvasSize.width,
|
|
7075
6987
|
height: canvasSize.height,
|
|
7076
6988
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7089,7 +7001,7 @@ function useExportSaveAs(input) {
|
|
|
7089
7001
|
handoutMaster
|
|
7090
7002
|
};
|
|
7091
7003
|
try {
|
|
7092
|
-
|
|
7004
|
+
chunkDCNHUEWQ_js.exportDeckJson(data, sourceName);
|
|
7093
7005
|
} catch (err) {
|
|
7094
7006
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7095
7007
|
}
|
|
@@ -7176,7 +7088,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
7176
7088
|
}
|
|
7177
7089
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
7178
7090
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
7179
|
-
|
|
7091
|
+
chunkDCNHUEWQ_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
7180
7092
|
}
|
|
7181
7093
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
7182
7094
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -7198,15 +7110,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7198
7110
|
continue;
|
|
7199
7111
|
}
|
|
7200
7112
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
7201
|
-
images.push(
|
|
7113
|
+
images.push(chunkDCNHUEWQ_js.canvasToJpegData(canvas));
|
|
7202
7114
|
}
|
|
7203
7115
|
onProgress?.(totalSlides, totalSlides);
|
|
7204
7116
|
setActiveSlide(currentSlideIndex);
|
|
7205
7117
|
if (images.length === 0) {
|
|
7206
|
-
throw new Error(
|
|
7118
|
+
throw new Error(chunkW24OJ7H5_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7207
7119
|
}
|
|
7208
|
-
const pdfBlobUrl =
|
|
7209
|
-
|
|
7120
|
+
const pdfBlobUrl = chunkVIFDZIVX_js.buildPdfFromImageData(images);
|
|
7121
|
+
chunkDCNHUEWQ_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
7210
7122
|
}
|
|
7211
7123
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
7212
7124
|
const { scale = 2, onProgress } = options;
|
|
@@ -7252,10 +7164,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7252
7164
|
onProgress?.(totalSlides, totalSlides);
|
|
7253
7165
|
setActiveSlide(currentSlideIndex);
|
|
7254
7166
|
if (pages.length === 0) {
|
|
7255
|
-
throw new Error(
|
|
7167
|
+
throw new Error(chunkW24OJ7H5_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7256
7168
|
}
|
|
7257
|
-
const pdfDataUrl =
|
|
7258
|
-
|
|
7169
|
+
const pdfDataUrl = chunkVIFDZIVX_js.buildNotesPdf(pages);
|
|
7170
|
+
chunkDCNHUEWQ_js.downloadDataUrl(pdfDataUrl, filename);
|
|
7259
7171
|
}
|
|
7260
7172
|
|
|
7261
7173
|
// src/viewer/utils/export-video.ts
|
|
@@ -7286,7 +7198,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7286
7198
|
}
|
|
7287
7199
|
setActiveSlide(currentSlideIndex);
|
|
7288
7200
|
if (slideCanvases.length === 0) {
|
|
7289
|
-
throw new Error(
|
|
7201
|
+
throw new Error(chunkW24OJ7H5_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
7290
7202
|
}
|
|
7291
7203
|
const firstCanvas = slideCanvases[0];
|
|
7292
7204
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -7294,12 +7206,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7294
7206
|
recordingCanvas.height = firstCanvas.height;
|
|
7295
7207
|
const ctx = recordingCanvas.getContext("2d");
|
|
7296
7208
|
if (!ctx) {
|
|
7297
|
-
throw new Error(
|
|
7209
|
+
throw new Error(chunkW24OJ7H5_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
7298
7210
|
}
|
|
7299
7211
|
const fps = 30;
|
|
7300
7212
|
const stream = recordingCanvas.captureStream(fps);
|
|
7301
7213
|
const recorder = new MediaRecorder(stream, {
|
|
7302
|
-
mimeType:
|
|
7214
|
+
mimeType: chunkDCNHUEWQ_js.pickSupportedMimeType([...chunkDCNHUEWQ_js.WEBM_MIME_CANDIDATES]),
|
|
7303
7215
|
videoBitsPerSecond: 5e6
|
|
7304
7216
|
});
|
|
7305
7217
|
const chunks = [];
|
|
@@ -7322,8 +7234,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7322
7234
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
7323
7235
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
7324
7236
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
7325
|
-
const frameInterval =
|
|
7326
|
-
const framesNeeded =
|
|
7237
|
+
const frameInterval = chunkDCNHUEWQ_js.fpsToFrameIntervalMs(fps);
|
|
7238
|
+
const framesNeeded = chunkDCNHUEWQ_js.segmentFrameCount(duration, fps);
|
|
7327
7239
|
for (let f = 0; f < framesNeeded; f++) {
|
|
7328
7240
|
if (signal?.aborted) {
|
|
7329
7241
|
recorder.stop();
|
|
@@ -7370,9 +7282,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7370
7282
|
}
|
|
7371
7283
|
setActiveSlide(currentSlideIndex);
|
|
7372
7284
|
if (frames.length === 0) {
|
|
7373
|
-
throw new Error(
|
|
7285
|
+
throw new Error(chunkW24OJ7H5_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
7374
7286
|
}
|
|
7375
|
-
const gifBytes =
|
|
7287
|
+
const gifBytes = chunkDCNHUEWQ_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
7376
7288
|
onProgress?.(totalSlides, totalSlides);
|
|
7377
7289
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
7378
7290
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -7426,7 +7338,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7426
7338
|
continue;
|
|
7427
7339
|
}
|
|
7428
7340
|
onProgress?.(processedCount, data.slides.length);
|
|
7429
|
-
let svg =
|
|
7341
|
+
let svg = chunkDCNHUEWQ_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7430
7342
|
if (embedFonts && fontFaces?.length) {
|
|
7431
7343
|
svg = injectFontFaces(svg, fontFaces);
|
|
7432
7344
|
}
|
|
@@ -7535,21 +7447,21 @@ function useExportHandlers(input) {
|
|
|
7535
7447
|
{
|
|
7536
7448
|
scale: imageExportScale,
|
|
7537
7449
|
onProgress: (current, total) => {
|
|
7538
|
-
setExportProgress(
|
|
7539
|
-
setExportStatusMessage(
|
|
7450
|
+
setExportProgress(chunkDCNHUEWQ_js.slideProgressPercent(current, total));
|
|
7451
|
+
setExportStatusMessage(chunkDCNHUEWQ_js.slideStatusLabel("Rendering", current, total));
|
|
7540
7452
|
},
|
|
7541
7453
|
signal: abortCtrl.signal
|
|
7542
7454
|
}
|
|
7543
7455
|
);
|
|
7544
|
-
setExportProgress(
|
|
7456
|
+
setExportProgress(chunkDCNHUEWQ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7545
7457
|
setExportStatusMessage("Building PDF...");
|
|
7546
7458
|
await new Promise((r) => {
|
|
7547
7459
|
setTimeout(r, 100);
|
|
7548
7460
|
});
|
|
7549
|
-
setExportProgress(
|
|
7461
|
+
setExportProgress(chunkDCNHUEWQ_js.EXPORT_DONE_PERCENT);
|
|
7550
7462
|
setExportStatusMessage("Done!");
|
|
7551
7463
|
} catch (err) {
|
|
7552
|
-
if (!
|
|
7464
|
+
if (!chunkDCNHUEWQ_js.isExportAbortError(err)) {
|
|
7553
7465
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7554
7466
|
}
|
|
7555
7467
|
} finally {
|
|
@@ -7579,21 +7491,21 @@ function useExportHandlers(input) {
|
|
|
7579
7491
|
{
|
|
7580
7492
|
scale: imageExportScale,
|
|
7581
7493
|
onProgress: (current, total) => {
|
|
7582
|
-
setExportProgress(
|
|
7583
|
-
setExportStatusMessage(
|
|
7494
|
+
setExportProgress(chunkDCNHUEWQ_js.slideProgressPercent(current, total));
|
|
7495
|
+
setExportStatusMessage(chunkDCNHUEWQ_js.slideStatusLabel("Rendering", current, total));
|
|
7584
7496
|
},
|
|
7585
7497
|
signal: abortCtrl.signal
|
|
7586
7498
|
}
|
|
7587
7499
|
);
|
|
7588
|
-
setExportProgress(
|
|
7500
|
+
setExportProgress(chunkDCNHUEWQ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7589
7501
|
setExportStatusMessage("Building PDF...");
|
|
7590
7502
|
await new Promise((r) => {
|
|
7591
7503
|
setTimeout(r, 100);
|
|
7592
7504
|
});
|
|
7593
|
-
setExportProgress(
|
|
7505
|
+
setExportProgress(chunkDCNHUEWQ_js.EXPORT_DONE_PERCENT);
|
|
7594
7506
|
setExportStatusMessage("Done!");
|
|
7595
7507
|
} catch (err) {
|
|
7596
|
-
if (!
|
|
7508
|
+
if (!chunkDCNHUEWQ_js.isExportAbortError(err)) {
|
|
7597
7509
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7598
7510
|
}
|
|
7599
7511
|
} finally {
|
|
@@ -7635,22 +7547,22 @@ function useExportHandlers(input) {
|
|
|
7635
7547
|
scale: 1,
|
|
7636
7548
|
slideDurationMs: 3e3,
|
|
7637
7549
|
onProgress: (current, total) => {
|
|
7638
|
-
setExportProgress(
|
|
7639
|
-
setExportStatusMessage(
|
|
7550
|
+
setExportProgress(chunkDCNHUEWQ_js.slideProgressPercent(current, total, 45));
|
|
7551
|
+
setExportStatusMessage(chunkDCNHUEWQ_js.slideStatusLabel("Capturing", current, total));
|
|
7640
7552
|
},
|
|
7641
7553
|
onRecordProgress: (current, total) => {
|
|
7642
|
-
setExportProgress(
|
|
7643
|
-
setExportStatusMessage(
|
|
7554
|
+
setExportProgress(chunkDCNHUEWQ_js.recordProgressPercent(current, total));
|
|
7555
|
+
setExportStatusMessage(chunkDCNHUEWQ_js.slideStatusLabel("Recording", current, total));
|
|
7644
7556
|
},
|
|
7645
7557
|
signal: abortCtrl.signal
|
|
7646
7558
|
}
|
|
7647
7559
|
);
|
|
7648
|
-
setExportProgress(
|
|
7560
|
+
setExportProgress(chunkDCNHUEWQ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7649
7561
|
setExportStatusMessage("Saving file...");
|
|
7650
|
-
|
|
7651
|
-
setExportProgress(
|
|
7562
|
+
chunkDCNHUEWQ_js.downloadBlob(blob, "presentation.webm");
|
|
7563
|
+
setExportProgress(chunkDCNHUEWQ_js.EXPORT_DONE_PERCENT);
|
|
7652
7564
|
} catch (err) {
|
|
7653
|
-
if (!
|
|
7565
|
+
if (!chunkDCNHUEWQ_js.isExportAbortError(err)) {
|
|
7654
7566
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7655
7567
|
}
|
|
7656
7568
|
} finally {
|
|
@@ -7678,18 +7590,18 @@ function useExportHandlers(input) {
|
|
|
7678
7590
|
scale: 0.5,
|
|
7679
7591
|
slideDurationMs: 2e3,
|
|
7680
7592
|
onProgress: (current, total) => {
|
|
7681
|
-
setExportProgress(
|
|
7682
|
-
setExportStatusMessage(
|
|
7593
|
+
setExportProgress(chunkDCNHUEWQ_js.slideProgressPercent(current, total));
|
|
7594
|
+
setExportStatusMessage(chunkDCNHUEWQ_js.slideStatusLabel("Encoding", current, total));
|
|
7683
7595
|
},
|
|
7684
7596
|
signal: abortCtrl.signal
|
|
7685
7597
|
}
|
|
7686
7598
|
);
|
|
7687
|
-
setExportProgress(
|
|
7599
|
+
setExportProgress(chunkDCNHUEWQ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7688
7600
|
setExportStatusMessage("Saving file...");
|
|
7689
|
-
|
|
7690
|
-
setExportProgress(
|
|
7601
|
+
chunkDCNHUEWQ_js.downloadBlob(blob, "presentation.gif");
|
|
7602
|
+
setExportProgress(chunkDCNHUEWQ_js.EXPORT_DONE_PERCENT);
|
|
7691
7603
|
} catch (err) {
|
|
7692
|
-
if (!
|
|
7604
|
+
if (!chunkDCNHUEWQ_js.isExportAbortError(err)) {
|
|
7693
7605
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7694
7606
|
}
|
|
7695
7607
|
} finally {
|
|
@@ -7722,7 +7634,7 @@ function useExportHandlers(input) {
|
|
|
7722
7634
|
exportStatusMessage
|
|
7723
7635
|
};
|
|
7724
7636
|
}
|
|
7725
|
-
var ViewerOptionsContext = react.createContext(
|
|
7637
|
+
var ViewerOptionsContext = react.createContext(chunkDCNHUEWQ_js.DEFAULT_VIEWER_OPTIONS);
|
|
7726
7638
|
function useViewerOptionsContext() {
|
|
7727
7639
|
return react.useContext(ViewerOptionsContext);
|
|
7728
7640
|
}
|
|
@@ -7734,13 +7646,13 @@ function usePrintHandlers(input) {
|
|
|
7734
7646
|
const { t } = reactI18next.useTranslation();
|
|
7735
7647
|
const viewerOptions = useViewerOptionsContext();
|
|
7736
7648
|
const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
|
|
7737
|
-
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) *
|
|
7649
|
+
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunkDCNHUEWQ_js.resolveImageResolutionScale(viewerOptions);
|
|
7738
7650
|
const handlePrint = () => {
|
|
7739
7651
|
setIsPrintDialogOpen(true);
|
|
7740
7652
|
};
|
|
7741
7653
|
const handlePrintSvg = async (settings) => {
|
|
7742
7654
|
setIsPrintDialogOpen(false);
|
|
7743
|
-
const printWindow =
|
|
7655
|
+
const printWindow = chunkDCNHUEWQ_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7744
7656
|
if (!printWindow) {
|
|
7745
7657
|
console.warn(
|
|
7746
7658
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7750,9 +7662,9 @@ function usePrintHandlers(input) {
|
|
|
7750
7662
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7751
7663
|
return runRasterPrint(printWindow, settings);
|
|
7752
7664
|
}
|
|
7753
|
-
const colorFilter =
|
|
7754
|
-
const slideIndices =
|
|
7755
|
-
|
|
7665
|
+
const colorFilter = chunkDCNHUEWQ_js.computeColorFilter(settings.colorMode);
|
|
7666
|
+
const slideIndices = chunkDCNHUEWQ_js.filterHiddenSlideIndices(
|
|
7667
|
+
chunkDCNHUEWQ_js.computeSlideIndices(
|
|
7756
7668
|
settings.slideRange,
|
|
7757
7669
|
activeSlideIndex,
|
|
7758
7670
|
slides.length,
|
|
@@ -7770,22 +7682,22 @@ function usePrintHandlers(input) {
|
|
|
7770
7682
|
printWindow.close();
|
|
7771
7683
|
return;
|
|
7772
7684
|
}
|
|
7773
|
-
const printDoc =
|
|
7685
|
+
const printDoc = chunkDCNHUEWQ_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7774
7686
|
title: "Slides (Vector)",
|
|
7775
7687
|
orientation: settings.orientation,
|
|
7776
7688
|
colorFilter,
|
|
7777
7689
|
scaleToFit: settings.scaleToFit
|
|
7778
7690
|
});
|
|
7779
|
-
|
|
7691
|
+
chunkDCNHUEWQ_js.finishPrintWindow(printWindow, printDoc);
|
|
7780
7692
|
} catch (err) {
|
|
7781
7693
|
console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
|
|
7782
7694
|
return runRasterPrint(printWindow, settings);
|
|
7783
7695
|
}
|
|
7784
7696
|
};
|
|
7785
7697
|
const runRasterPrint = async (printWindow, settings) => {
|
|
7786
|
-
const colorFilter =
|
|
7787
|
-
const slideIndices =
|
|
7788
|
-
|
|
7698
|
+
const colorFilter = chunkDCNHUEWQ_js.computeColorFilter(settings.colorMode);
|
|
7699
|
+
const slideIndices = chunkDCNHUEWQ_js.filterHiddenSlideIndices(
|
|
7700
|
+
chunkDCNHUEWQ_js.computeSlideIndices(
|
|
7789
7701
|
settings.slideRange,
|
|
7790
7702
|
activeSlideIndex,
|
|
7791
7703
|
slides.length,
|
|
@@ -7796,11 +7708,11 @@ function usePrintHandlers(input) {
|
|
|
7796
7708
|
includeHiddenSlides
|
|
7797
7709
|
);
|
|
7798
7710
|
if (settings.printWhat === "outline") {
|
|
7799
|
-
|
|
7711
|
+
chunkDCNHUEWQ_js.finishPrintWindow(
|
|
7800
7712
|
printWindow,
|
|
7801
|
-
|
|
7713
|
+
chunkDCNHUEWQ_js.buildPrintHtmlDocument({
|
|
7802
7714
|
title: "Outline",
|
|
7803
|
-
bodyHtml: `<div class="outline-page">${
|
|
7715
|
+
bodyHtml: `<div class="outline-page">${chunkDCNHUEWQ_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7804
7716
|
orientation: settings.orientation,
|
|
7805
7717
|
colorFilter,
|
|
7806
7718
|
frameSlides: settings.frameSlides,
|
|
@@ -7827,11 +7739,11 @@ function usePrintHandlers(input) {
|
|
|
7827
7739
|
}
|
|
7828
7740
|
const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
|
|
7829
7741
|
if (settings.printWhat === "slides") {
|
|
7830
|
-
|
|
7742
|
+
chunkDCNHUEWQ_js.finishPrintWindow(
|
|
7831
7743
|
printWindow,
|
|
7832
|
-
|
|
7744
|
+
chunkDCNHUEWQ_js.buildPrintHtmlDocument({
|
|
7833
7745
|
title: "Slides",
|
|
7834
|
-
bodyHtml:
|
|
7746
|
+
bodyHtml: chunkDCNHUEWQ_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7835
7747
|
orientation: settings.orientation,
|
|
7836
7748
|
colorFilter,
|
|
7837
7749
|
frameSlides: settings.frameSlides,
|
|
@@ -7841,11 +7753,11 @@ function usePrintHandlers(input) {
|
|
|
7841
7753
|
return;
|
|
7842
7754
|
}
|
|
7843
7755
|
if (settings.printWhat === "notes") {
|
|
7844
|
-
|
|
7756
|
+
chunkDCNHUEWQ_js.finishPrintWindow(
|
|
7845
7757
|
printWindow,
|
|
7846
|
-
|
|
7758
|
+
chunkDCNHUEWQ_js.buildPrintHtmlDocument({
|
|
7847
7759
|
title: "Notes Pages",
|
|
7848
|
-
bodyHtml:
|
|
7760
|
+
bodyHtml: chunkDCNHUEWQ_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7849
7761
|
orientation: "portrait",
|
|
7850
7762
|
colorFilter,
|
|
7851
7763
|
frameSlides: settings.frameSlides,
|
|
@@ -7856,11 +7768,11 @@ function usePrintHandlers(input) {
|
|
|
7856
7768
|
}
|
|
7857
7769
|
if (settings.printWhat === "handouts") {
|
|
7858
7770
|
const spp = settings.slidesPerPage;
|
|
7859
|
-
|
|
7771
|
+
chunkDCNHUEWQ_js.finishPrintWindow(
|
|
7860
7772
|
printWindow,
|
|
7861
|
-
|
|
7773
|
+
chunkDCNHUEWQ_js.buildPrintHtmlDocument({
|
|
7862
7774
|
title: `Handout ${spp} per page`,
|
|
7863
|
-
bodyHtml:
|
|
7775
|
+
bodyHtml: chunkDCNHUEWQ_js.buildHandoutsHtml(slideImages, slideIndices, spp, pptxData?.handoutMaster),
|
|
7864
7776
|
orientation: "portrait",
|
|
7865
7777
|
colorFilter,
|
|
7866
7778
|
frameSlides: settings.frameSlides,
|
|
@@ -7874,7 +7786,7 @@ function usePrintHandlers(input) {
|
|
|
7874
7786
|
};
|
|
7875
7787
|
const handlePrintWithSettings = async (settings) => {
|
|
7876
7788
|
setIsPrintDialogOpen(false);
|
|
7877
|
-
const printWindow =
|
|
7789
|
+
const printWindow = chunkDCNHUEWQ_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7878
7790
|
if (!printWindow) {
|
|
7879
7791
|
console.warn(
|
|
7880
7792
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7939,13 +7851,13 @@ function useThemeHandlers(input) {
|
|
|
7939
7851
|
return;
|
|
7940
7852
|
}
|
|
7941
7853
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7942
|
-
const previousMap = theme?.colorScheme ?
|
|
7943
|
-
setSlides((prev) =>
|
|
7854
|
+
const previousMap = theme?.colorScheme ? chunkDCNHUEWQ_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7855
|
+
setSlides((prev) => chunkDCNHUEWQ_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7944
7856
|
if (Object.keys(templateElementsBySlideId).length > 0) {
|
|
7945
7857
|
setTemplateElementsBySlideId((prev) => {
|
|
7946
7858
|
const next = {};
|
|
7947
7859
|
for (const [slideId, elements] of Object.entries(prev)) {
|
|
7948
|
-
next[slideId] =
|
|
7860
|
+
next[slideId] = chunkDCNHUEWQ_js.reResolveElementColors(elements, previousMap, colorScheme);
|
|
7949
7861
|
}
|
|
7950
7862
|
return next;
|
|
7951
7863
|
});
|
|
@@ -8054,7 +7966,7 @@ function useThemeSwitching(input) {
|
|
|
8054
7966
|
}
|
|
8055
7967
|
try {
|
|
8056
7968
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
8057
|
-
const newData =
|
|
7969
|
+
const newData = chunkDCNHUEWQ_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
8058
7970
|
onDataChange(newData);
|
|
8059
7971
|
onThemeChanged?.(preset);
|
|
8060
7972
|
} catch (error) {
|
|
@@ -8071,7 +7983,7 @@ function useThemeSwitching(input) {
|
|
|
8071
7983
|
}
|
|
8072
7984
|
try {
|
|
8073
7985
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
8074
|
-
const newData =
|
|
7986
|
+
const newData = chunkDCNHUEWQ_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
8075
7987
|
onDataChange(newData);
|
|
8076
7988
|
} catch (error) {
|
|
8077
7989
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -8083,12 +7995,12 @@ function useThemeSwitching(input) {
|
|
|
8083
7995
|
if (!data?.theme?.colorScheme) {
|
|
8084
7996
|
return void 0;
|
|
8085
7997
|
}
|
|
8086
|
-
return
|
|
8087
|
-
(p) =>
|
|
7998
|
+
return chunkDCNHUEWQ_js.THEME_PRESETS.find(
|
|
7999
|
+
(p) => chunkDCNHUEWQ_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
8088
8000
|
);
|
|
8089
8001
|
}, [data?.theme?.colorScheme]);
|
|
8090
8002
|
return {
|
|
8091
|
-
presets:
|
|
8003
|
+
presets: chunkDCNHUEWQ_js.THEME_PRESETS,
|
|
8092
8004
|
switchToPreset,
|
|
8093
8005
|
switchToCustom,
|
|
8094
8006
|
currentPreset
|
|
@@ -8163,7 +8075,7 @@ function usePropertyHandlers(input) {
|
|
|
8163
8075
|
}
|
|
8164
8076
|
try {
|
|
8165
8077
|
const ab = await file.arrayBuffer();
|
|
8166
|
-
const h = new
|
|
8078
|
+
const h = new chunkDCNHUEWQ_js.PptxHandler();
|
|
8167
8079
|
const other = await h.load(ab);
|
|
8168
8080
|
if (!other) {
|
|
8169
8081
|
return;
|
|
@@ -8173,7 +8085,7 @@ function usePropertyHandlers(input) {
|
|
|
8173
8085
|
width: canvasSize.width,
|
|
8174
8086
|
height: canvasSize.height
|
|
8175
8087
|
};
|
|
8176
|
-
setCompareResult(
|
|
8088
|
+
setCompareResult(chunkDCNHUEWQ_js.comparePresentation(cur, other));
|
|
8177
8089
|
setIsComparePanelOpen(true);
|
|
8178
8090
|
} catch (err) {
|
|
8179
8091
|
console.warn("Compare failed:", err);
|
|
@@ -8190,7 +8102,7 @@ function usePropertyHandlers(input) {
|
|
|
8190
8102
|
if (!diff || diff.status === "unchanged") {
|
|
8191
8103
|
return;
|
|
8192
8104
|
}
|
|
8193
|
-
setSlides((prev) =>
|
|
8105
|
+
setSlides((prev) => chunkDCNHUEWQ_js.applyAcceptSlide(prev, diff));
|
|
8194
8106
|
setIsDirty(true);
|
|
8195
8107
|
},
|
|
8196
8108
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -8201,10 +8113,10 @@ function usePropertyHandlers(input) {
|
|
|
8201
8113
|
if (!compareResult) {
|
|
8202
8114
|
return;
|
|
8203
8115
|
}
|
|
8204
|
-
setSlides((prev) =>
|
|
8116
|
+
setSlides((prev) => chunkDCNHUEWQ_js.applyAcceptAllSlides(prev, compareResult));
|
|
8205
8117
|
setIsDirty(true);
|
|
8206
8118
|
}, [compareResult, setSlides, setIsDirty]);
|
|
8207
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
8119
|
+
const usedFontFamilies = react.useMemo(() => chunkDCNHUEWQ_js.collectUsedFonts(slides), [slides]);
|
|
8208
8120
|
return {
|
|
8209
8121
|
handleUpdateNotes,
|
|
8210
8122
|
handleUpdateSlide,
|
|
@@ -8359,7 +8271,7 @@ function useViewerDialogs(input) {
|
|
|
8359
8271
|
);
|
|
8360
8272
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8361
8273
|
const fontEmbedding = react.useMemo(
|
|
8362
|
-
() =>
|
|
8274
|
+
() => chunkDCNHUEWQ_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8363
8275
|
[embeddedFontKey]
|
|
8364
8276
|
);
|
|
8365
8277
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8369,11 +8281,11 @@ function useViewerDialogs(input) {
|
|
|
8369
8281
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8370
8282
|
}
|
|
8371
8283
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8372
|
-
() => typeof window !== "undefined" ?
|
|
8284
|
+
() => typeof window !== "undefined" ? chunkDCNHUEWQ_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8373
8285
|
);
|
|
8374
8286
|
react.useEffect(() => {
|
|
8375
8287
|
const handleWindow = () => setIsNarrowViewport(
|
|
8376
|
-
|
|
8288
|
+
chunkDCNHUEWQ_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8377
8289
|
);
|
|
8378
8290
|
window.addEventListener("resize", handleWindow);
|
|
8379
8291
|
return () => window.removeEventListener("resize", handleWindow);
|
|
@@ -8526,16 +8438,16 @@ function useViewerDialogs(input) {
|
|
|
8526
8438
|
};
|
|
8527
8439
|
}
|
|
8528
8440
|
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8529
|
-
return
|
|
8441
|
+
return chunkDCNHUEWQ_js.computeGridSpacingPx(documentGridSpacing, chunkVIFDZIVX_js.GRID_SIZE);
|
|
8530
8442
|
}
|
|
8531
8443
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
8532
8444
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8533
|
-
const authoredRange =
|
|
8534
|
-
return
|
|
8445
|
+
const authoredRange = chunkDCNHUEWQ_js.resolveAuthoredSlideRange(presentationProperties, slides.length);
|
|
8446
|
+
return chunkDCNHUEWQ_js.resolveShowSlideIndexes(slides, activeShow, authoredRange);
|
|
8535
8447
|
}
|
|
8536
8448
|
function computeSlideSectionGroups(slides, sections) {
|
|
8537
|
-
return
|
|
8538
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8449
|
+
return chunkDCNHUEWQ_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8450
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkVIFDZIVX_js.UNGROUPED_SECTION_ID : chunkVIFDZIVX_js.DEFAULT_SECTION_GROUP_ID),
|
|
8539
8451
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8540
8452
|
slideIndexes: group.slideIndexes,
|
|
8541
8453
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8547,7 +8459,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8547
8459
|
return void 0;
|
|
8548
8460
|
}
|
|
8549
8461
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8550
|
-
return
|
|
8462
|
+
return chunkDCNHUEWQ_js.masterViewPseudoSlide(document2, {
|
|
8551
8463
|
tab: "slides",
|
|
8552
8464
|
masterIndex: 0,
|
|
8553
8465
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8575,15 +8487,15 @@ function useDerivedSlideState(input) {
|
|
|
8575
8487
|
[slides, activeCustomShowId, customShows, presentationProperties]
|
|
8576
8488
|
);
|
|
8577
8489
|
const authoredRange = react.useMemo(
|
|
8578
|
-
() =>
|
|
8490
|
+
() => chunkDCNHUEWQ_js.resolveAuthoredSlideRange(presentationProperties, slides.length),
|
|
8579
8491
|
[presentationProperties, slides.length]
|
|
8580
8492
|
);
|
|
8581
8493
|
const slideSectionGroups = react.useMemo(
|
|
8582
8494
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8583
|
-
if (group.id ===
|
|
8495
|
+
if (group.id === chunkVIFDZIVX_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8584
8496
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8585
8497
|
}
|
|
8586
|
-
if (group.id ===
|
|
8498
|
+
if (group.id === chunkVIFDZIVX_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8587
8499
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8588
8500
|
}
|
|
8589
8501
|
return group;
|
|
@@ -8684,13 +8596,13 @@ function useAnnotationHandlers(input) {
|
|
|
8684
8596
|
}, [annotations, setMode, setSlides, history]);
|
|
8685
8597
|
const handleSetMode = react.useCallback(
|
|
8686
8598
|
(nextMode) => {
|
|
8687
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8599
|
+
if (mode === "present" && nextMode !== "present" && !chunkDCNHUEWQ_js.mayLeaveSlideShow()) {
|
|
8688
8600
|
return;
|
|
8689
8601
|
}
|
|
8690
8602
|
if (nextMode === "present") {
|
|
8691
8603
|
presentation.enterPresentMode();
|
|
8692
8604
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8693
|
-
|
|
8605
|
+
chunkDCNHUEWQ_js.stopAllPersistentAudio();
|
|
8694
8606
|
if (promptKeepInkAnnotations) {
|
|
8695
8607
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8696
8608
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8700,7 +8612,7 @@ function useAnnotationHandlers(input) {
|
|
|
8700
8612
|
}
|
|
8701
8613
|
} else {
|
|
8702
8614
|
if (mode === "present") {
|
|
8703
|
-
|
|
8615
|
+
chunkDCNHUEWQ_js.stopAllPersistentAudio();
|
|
8704
8616
|
}
|
|
8705
8617
|
setMode(nextMode);
|
|
8706
8618
|
}
|
|
@@ -8765,13 +8677,13 @@ function useSerialize(input) {
|
|
|
8765
8677
|
let processedSlide = slide;
|
|
8766
8678
|
if (pendingEditId) {
|
|
8767
8679
|
const updatedElements = slide.elements.map((el) => {
|
|
8768
|
-
if (el.id !== pendingEditId || !
|
|
8680
|
+
if (el.id !== pendingEditId || !chunkDCNHUEWQ_js.hasTextProperties(el)) {
|
|
8769
8681
|
return el;
|
|
8770
8682
|
}
|
|
8771
8683
|
return {
|
|
8772
8684
|
...el,
|
|
8773
8685
|
text: pendingEditText,
|
|
8774
|
-
textSegments:
|
|
8686
|
+
textSegments: chunkDCNHUEWQ_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8775
8687
|
};
|
|
8776
8688
|
});
|
|
8777
8689
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8784,19 +8696,19 @@ function useSerialize(input) {
|
|
|
8784
8696
|
const pptxGuides = guides.map((g) => ({
|
|
8785
8697
|
id: g.id,
|
|
8786
8698
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8787
|
-
positionEmu:
|
|
8699
|
+
positionEmu: chunkDCNHUEWQ_js.guidePxToEmu(g.position)
|
|
8788
8700
|
}));
|
|
8789
8701
|
return {
|
|
8790
8702
|
...processedSlide,
|
|
8791
8703
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8792
8704
|
};
|
|
8793
8705
|
});
|
|
8794
|
-
const slidesToSave =
|
|
8706
|
+
const slidesToSave = chunkDCNHUEWQ_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8795
8707
|
const saveOptions = {
|
|
8796
8708
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8797
8709
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8798
8710
|
// slide-size edit reaches the file.
|
|
8799
|
-
slideSize:
|
|
8711
|
+
slideSize: chunkDCNHUEWQ_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8800
8712
|
headerFooter,
|
|
8801
8713
|
presentationProperties,
|
|
8802
8714
|
viewProperties,
|
|
@@ -8809,9 +8721,9 @@ function useSerialize(input) {
|
|
|
8809
8721
|
slideMasters,
|
|
8810
8722
|
notesMaster,
|
|
8811
8723
|
handoutMaster,
|
|
8812
|
-
...
|
|
8724
|
+
...chunkDCNHUEWQ_js.embeddedFontSaveOptions(embedFonts)
|
|
8813
8725
|
};
|
|
8814
|
-
return
|
|
8726
|
+
return chunkDCNHUEWQ_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8815
8727
|
}, [
|
|
8816
8728
|
slides,
|
|
8817
8729
|
templateElementsBySlideId,
|
|
@@ -8847,7 +8759,7 @@ function useRecoveryDetection(input) {
|
|
|
8847
8759
|
const onRestore = input.onRestore;
|
|
8848
8760
|
const openVersionHistory = input.openVersionHistory;
|
|
8849
8761
|
react.useEffect(() => {
|
|
8850
|
-
if (!
|
|
8762
|
+
if (!chunkDCNHUEWQ_js.shouldProbeAutosaveRecovery({
|
|
8851
8763
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8852
8764
|
filePath,
|
|
8853
8765
|
loading,
|
|
@@ -8859,7 +8771,7 @@ function useRecoveryDetection(input) {
|
|
|
8859
8771
|
}
|
|
8860
8772
|
recoveryCheckedRef.current = true;
|
|
8861
8773
|
void (async () => {
|
|
8862
|
-
const offer = await
|
|
8774
|
+
const offer = await chunkDCNHUEWQ_js.probeAutosaveRecovery(filePath);
|
|
8863
8775
|
if (!offer) {
|
|
8864
8776
|
return;
|
|
8865
8777
|
}
|
|
@@ -8872,7 +8784,7 @@ function useRecoveryDetection(input) {
|
|
|
8872
8784
|
const record = recordRef.current;
|
|
8873
8785
|
setPrompt(null);
|
|
8874
8786
|
if (record && onRestore) {
|
|
8875
|
-
onRestore(
|
|
8787
|
+
onRestore(chunkDCNHUEWQ_js.acceptAutosaveRecovery(record));
|
|
8876
8788
|
}
|
|
8877
8789
|
recordRef.current = null;
|
|
8878
8790
|
}, [onRestore]);
|
|
@@ -8881,7 +8793,7 @@ function useRecoveryDetection(input) {
|
|
|
8881
8793
|
setPrompt(null);
|
|
8882
8794
|
recordRef.current = null;
|
|
8883
8795
|
if (record) {
|
|
8884
|
-
void
|
|
8796
|
+
void chunkDCNHUEWQ_js.discardAutosaveRecovery(record);
|
|
8885
8797
|
}
|
|
8886
8798
|
}, []);
|
|
8887
8799
|
return { prompt, restore, discard };
|
|
@@ -8925,11 +8837,11 @@ function usePresentationSetup(input) {
|
|
|
8925
8837
|
containerRef,
|
|
8926
8838
|
content,
|
|
8927
8839
|
onSetMode: (nextMode) => {
|
|
8928
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8840
|
+
if (mode === "present" && nextMode !== "present" && !chunkDCNHUEWQ_js.mayLeaveSlideShow()) {
|
|
8929
8841
|
return;
|
|
8930
8842
|
}
|
|
8931
8843
|
if (mode === "present" && nextMode !== "present") {
|
|
8932
|
-
|
|
8844
|
+
chunkDCNHUEWQ_js.stopAllPersistentAudio();
|
|
8933
8845
|
stopAnimationSound();
|
|
8934
8846
|
const exitHandler = exitModeHandlerRef.current;
|
|
8935
8847
|
if (exitHandler) {
|
|
@@ -8943,6 +8855,12 @@ function usePresentationSetup(input) {
|
|
|
8943
8855
|
setMode(nextMode);
|
|
8944
8856
|
},
|
|
8945
8857
|
onSetActiveSlideIndex: setActiveSlideIndex,
|
|
8858
|
+
// `p:sndAc/p:endSnd` ("Stop Previous Sound"): silences whatever transition
|
|
8859
|
+
// sound is currently looping. A non-looping transition sound plays through
|
|
8860
|
+
// its own ad hoc `Audio` below rather than this singleton (it finishes on
|
|
8861
|
+
// its own in a few seconds either way), so only the loop case is stoppable
|
|
8862
|
+
// here - matching the common "Loop Until Next Sound... then Stop" pairing.
|
|
8863
|
+
onStopActionSound: () => stopAnimationSound(),
|
|
8946
8864
|
onPlayActionSound: (soundPath, options) => {
|
|
8947
8865
|
void (async () => {
|
|
8948
8866
|
if (!soundPath) {
|
|
@@ -8991,10 +8909,10 @@ function usePresentationSetup(input) {
|
|
|
8991
8909
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8992
8910
|
onToggleSubtitles,
|
|
8993
8911
|
onSaveRehearsalTimings: (timings) => {
|
|
8994
|
-
setSlides((prev) =>
|
|
8912
|
+
setSlides((prev) => chunkDCNHUEWQ_js.applyRehearsalTimings(prev, timings));
|
|
8995
8913
|
history.markDirty();
|
|
8996
8914
|
},
|
|
8997
|
-
loopContinuously:
|
|
8915
|
+
loopContinuously: chunkDCNHUEWQ_js.shouldLoopContinuously(presentationProperties),
|
|
8998
8916
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8999
8917
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
9000
8918
|
endWithBlackSlide,
|
|
@@ -9200,7 +9118,7 @@ function useEditorOperations(input) {
|
|
|
9200
9118
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9201
9119
|
react.useEffect(() => {
|
|
9202
9120
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9203
|
-
copiedFormatRef.current =
|
|
9121
|
+
copiedFormatRef.current = chunkDCNHUEWQ_js.copyFormatFromElement(selectedElement);
|
|
9204
9122
|
} else if (!formatPainterActive) {
|
|
9205
9123
|
copiedFormatRef.current = null;
|
|
9206
9124
|
}
|
|
@@ -9226,12 +9144,12 @@ function useEditorOperations(input) {
|
|
|
9226
9144
|
e.stopPropagation();
|
|
9227
9145
|
const element = elementLookup.get(elementId);
|
|
9228
9146
|
if (element) {
|
|
9229
|
-
const updated =
|
|
9147
|
+
const updated = chunkDCNHUEWQ_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9230
9148
|
const updates = {};
|
|
9231
|
-
if (
|
|
9149
|
+
if (chunkDCNHUEWQ_js.hasShapeProperties(updated)) {
|
|
9232
9150
|
updates.shapeStyle = updated.shapeStyle;
|
|
9233
9151
|
}
|
|
9234
|
-
if (
|
|
9152
|
+
if (chunkDCNHUEWQ_js.hasTextProperties(updated)) {
|
|
9235
9153
|
updates.textStyle = updated.textStyle;
|
|
9236
9154
|
}
|
|
9237
9155
|
ops.updateElementById(elementId, updates);
|
|
@@ -9419,10 +9337,10 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9419
9337
|
}
|
|
9420
9338
|
};
|
|
9421
9339
|
}, [embeddedFonts]);
|
|
9422
|
-
const referencedFamilies = react.useMemo(() =>
|
|
9340
|
+
const referencedFamilies = react.useMemo(() => chunkDCNHUEWQ_js.collectReferencedFontFamilies(slides), [slides]);
|
|
9423
9341
|
react.useEffect(() => {
|
|
9424
9342
|
let cancelled = false;
|
|
9425
|
-
void
|
|
9343
|
+
void chunkDCNHUEWQ_js.resolveGoogleWebfontHref(slides, embeddedFonts).then((href) => {
|
|
9426
9344
|
if (cancelled) {
|
|
9427
9345
|
return null;
|
|
9428
9346
|
}
|
|
@@ -9605,7 +9523,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9605
9523
|
inputRef.current = input;
|
|
9606
9524
|
const handleKeyDown = react.useCallback((e) => {
|
|
9607
9525
|
const current = inputRef.current;
|
|
9608
|
-
const startAction =
|
|
9526
|
+
const startAction = chunkDCNHUEWQ_js.mapSlideShowStartKey(e, { isPresenting: current.mode === "present" });
|
|
9609
9527
|
if (startAction !== null) {
|
|
9610
9528
|
e.preventDefault();
|
|
9611
9529
|
if (startAction === "fromBeginning") {
|
|
@@ -9615,7 +9533,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9615
9533
|
}
|
|
9616
9534
|
return;
|
|
9617
9535
|
}
|
|
9618
|
-
const { action, dx, dy } =
|
|
9536
|
+
const { action, dx, dy } = chunkDCNHUEWQ_js.mapEditorKey(e, {
|
|
9619
9537
|
canEdit: current.canEdit,
|
|
9620
9538
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9621
9539
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9628,7 +9546,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9628
9546
|
hasSelection: current.hasSelection,
|
|
9629
9547
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9630
9548
|
isDrawing: current.activeTool !== "select",
|
|
9631
|
-
isTextInputTarget:
|
|
9549
|
+
isTextInputTarget: chunkDCNHUEWQ_js.isEditorTextInputTarget(e.target)
|
|
9632
9550
|
});
|
|
9633
9551
|
if (action === null) {
|
|
9634
9552
|
return;
|
|
@@ -9956,7 +9874,7 @@ function useViewerIntegration(input) {
|
|
|
9956
9874
|
return zoom.scale;
|
|
9957
9875
|
},
|
|
9958
9876
|
setZoom(level) {
|
|
9959
|
-
zoom.setScale(
|
|
9877
|
+
zoom.setScale(chunkDCNHUEWQ_js.clampZoomScale(level));
|
|
9960
9878
|
},
|
|
9961
9879
|
zoomIn() {
|
|
9962
9880
|
zoom.handleZoomIn();
|
|
@@ -10174,7 +10092,7 @@ function useReducedMotion() {
|
|
|
10174
10092
|
}
|
|
10175
10093
|
function useViewerOptions() {
|
|
10176
10094
|
const storeRef = react.useRef(null);
|
|
10177
|
-
storeRef.current ??=
|
|
10095
|
+
storeRef.current ??= chunkDCNHUEWQ_js.createViewerOptionsStore();
|
|
10178
10096
|
const store = storeRef.current;
|
|
10179
10097
|
const options = react.useSyncExternalStore(
|
|
10180
10098
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -10183,9 +10101,9 @@ function useViewerOptions() {
|
|
|
10183
10101
|
);
|
|
10184
10102
|
return { optionsStore: store, options };
|
|
10185
10103
|
}
|
|
10186
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10104
|
+
var KNOWN_TAB_IDS = new Set(chunkDCNHUEWQ_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10187
10105
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
10188
|
-
const isHidden = (id) =>
|
|
10106
|
+
const isHidden = (id) => chunkDCNHUEWQ_js.isActionHidden(id, hiddenActions);
|
|
10189
10107
|
const userHidden = new Set(hiddenTabIds);
|
|
10190
10108
|
userHidden.delete("file");
|
|
10191
10109
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
|
|
@@ -10277,12 +10195,12 @@ function useYjsDocumentSync({
|
|
|
10277
10195
|
return;
|
|
10278
10196
|
}
|
|
10279
10197
|
try {
|
|
10280
|
-
const handler = new
|
|
10198
|
+
const handler = new chunkDCNHUEWQ_js.PptxHandler();
|
|
10281
10199
|
await handler.load(sourceBytes.buffer);
|
|
10282
|
-
const currentSlides =
|
|
10200
|
+
const currentSlides = chunkDCNHUEWQ_js.readSlidesFromYDoc(
|
|
10283
10201
|
doc
|
|
10284
10202
|
);
|
|
10285
|
-
const slidesToSave =
|
|
10203
|
+
const slidesToSave = chunkDCNHUEWQ_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10286
10204
|
const bytes = await handler.save(slidesToSave);
|
|
10287
10205
|
config.onWriteBack(bytes);
|
|
10288
10206
|
} catch {
|
|
@@ -10297,10 +10215,10 @@ function useYjsDocumentSync({
|
|
|
10297
10215
|
if (!doc || !isConnected) {
|
|
10298
10216
|
return;
|
|
10299
10217
|
}
|
|
10300
|
-
const docSlides =
|
|
10218
|
+
const docSlides = chunkDCNHUEWQ_js.readSlidesFromYDoc(
|
|
10301
10219
|
doc
|
|
10302
10220
|
);
|
|
10303
|
-
if (!
|
|
10221
|
+
if (!chunkDCNHUEWQ_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10304
10222
|
return;
|
|
10305
10223
|
}
|
|
10306
10224
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10319,11 +10237,11 @@ function useYjsDocumentSync({
|
|
|
10319
10237
|
lastSyncedRef.current = serialized;
|
|
10320
10238
|
void (async () => {
|
|
10321
10239
|
const factories = await getFactories();
|
|
10322
|
-
|
|
10240
|
+
chunkDCNHUEWQ_js.reconcileSlidesInYDoc(
|
|
10323
10241
|
slides,
|
|
10324
10242
|
doc,
|
|
10325
10243
|
factories,
|
|
10326
|
-
|
|
10244
|
+
chunkDCNHUEWQ_js.LOCAL_SYNC_ORIGIN
|
|
10327
10245
|
);
|
|
10328
10246
|
scheduleWriteBack();
|
|
10329
10247
|
})();
|
|
@@ -10337,10 +10255,10 @@ function useYjsDocumentSync({
|
|
|
10337
10255
|
return;
|
|
10338
10256
|
}
|
|
10339
10257
|
const handleChange = (_events, transaction) => {
|
|
10340
|
-
if (transaction?.origin ===
|
|
10258
|
+
if (transaction?.origin === chunkDCNHUEWQ_js.LOCAL_SYNC_ORIGIN) {
|
|
10341
10259
|
return;
|
|
10342
10260
|
}
|
|
10343
|
-
const remoteSlides =
|
|
10261
|
+
const remoteSlides = chunkDCNHUEWQ_js.readSlidesFromYDoc(
|
|
10344
10262
|
doc
|
|
10345
10263
|
);
|
|
10346
10264
|
if (remoteSlides.length === 0) {
|
|
@@ -10356,7 +10274,7 @@ function useYjsDocumentSync({
|
|
|
10356
10274
|
isApplyingRemoteRef.current = false;
|
|
10357
10275
|
scheduleWriteBack();
|
|
10358
10276
|
};
|
|
10359
|
-
const unobserve =
|
|
10277
|
+
const unobserve = chunkDCNHUEWQ_js.observeYDocSlides(
|
|
10360
10278
|
doc,
|
|
10361
10279
|
handleChange
|
|
10362
10280
|
);
|
|
@@ -10394,7 +10312,7 @@ function useBroadcastFollower({
|
|
|
10394
10312
|
if (!broadcaster) {
|
|
10395
10313
|
return;
|
|
10396
10314
|
}
|
|
10397
|
-
if (!
|
|
10315
|
+
if (!chunkDCNHUEWQ_js.shouldAutoFollowBroadcaster({
|
|
10398
10316
|
localRole: collab.config.role,
|
|
10399
10317
|
broadcasterRole: broadcaster.role
|
|
10400
10318
|
})) {
|
|
@@ -10565,7 +10483,7 @@ function subscribeTouchCapability(callback) {
|
|
|
10565
10483
|
function useIsMobile() {
|
|
10566
10484
|
const isTouchDevice = react.useSyncExternalStore(
|
|
10567
10485
|
subscribeTouchCapability,
|
|
10568
|
-
|
|
10486
|
+
chunkDCNHUEWQ_js.detectTouchDevice,
|
|
10569
10487
|
() => false
|
|
10570
10488
|
// server snapshot
|
|
10571
10489
|
);
|
|
@@ -10575,7 +10493,7 @@ function useIsMobile() {
|
|
|
10575
10493
|
const [viewportHeight, setViewportHeight] = react.useState(
|
|
10576
10494
|
() => typeof window === "undefined" ? 768 : window.innerHeight
|
|
10577
10495
|
);
|
|
10578
|
-
const [orientation, setOrientation] = react.useState(
|
|
10496
|
+
const [orientation, setOrientation] = react.useState(chunkDCNHUEWQ_js.detectOrientation);
|
|
10579
10497
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
10580
10498
|
const [initialViewportHeight] = react.useState(
|
|
10581
10499
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -10596,7 +10514,7 @@ function useIsMobile() {
|
|
|
10596
10514
|
return;
|
|
10597
10515
|
}
|
|
10598
10516
|
const handleOrientationChange = () => {
|
|
10599
|
-
setOrientation(
|
|
10517
|
+
setOrientation(chunkDCNHUEWQ_js.detectOrientation());
|
|
10600
10518
|
};
|
|
10601
10519
|
if (screen.orientation) {
|
|
10602
10520
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -10626,7 +10544,7 @@ function useIsMobile() {
|
|
|
10626
10544
|
window.addEventListener("resize", handleResize);
|
|
10627
10545
|
return () => window.removeEventListener("resize", handleResize);
|
|
10628
10546
|
}, [isTouchDevice, initialViewportHeight]);
|
|
10629
|
-
const { isMobile, isTablet, isDesktop } =
|
|
10547
|
+
const { isMobile, isTablet, isDesktop } = chunkDCNHUEWQ_js.deriveViewportBreakpoints(
|
|
10630
10548
|
viewportWidth,
|
|
10631
10549
|
viewportHeight,
|
|
10632
10550
|
isTouchDevice
|
|
@@ -10657,10 +10575,10 @@ function useTouchGestures(input) {
|
|
|
10657
10575
|
if (!el || !enabled) {
|
|
10658
10576
|
return;
|
|
10659
10577
|
}
|
|
10660
|
-
const recognizer =
|
|
10578
|
+
const recognizer = chunkDCNHUEWQ_js.createTouchGestureRecognizer({
|
|
10661
10579
|
getScale: () => scaleRef.current,
|
|
10662
|
-
minScale:
|
|
10663
|
-
maxScale:
|
|
10580
|
+
minScale: chunkDCNHUEWQ_js.MIN_ZOOM_SCALE,
|
|
10581
|
+
maxScale: chunkDCNHUEWQ_js.MAX_ZOOM_SCALE,
|
|
10664
10582
|
callbacks: {
|
|
10665
10583
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10666
10584
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10700,7 +10618,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10700
10618
|
return;
|
|
10701
10619
|
}
|
|
10702
10620
|
const rect = active.getBoundingClientRect();
|
|
10703
|
-
const delta =
|
|
10621
|
+
const delta = chunkDCNHUEWQ_js.computeScrollDelta(
|
|
10704
10622
|
{ top: rect.top, bottom: rect.bottom },
|
|
10705
10623
|
window.innerHeight,
|
|
10706
10624
|
keyboardInset
|
|
@@ -10720,8 +10638,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10720
10638
|
return;
|
|
10721
10639
|
}
|
|
10722
10640
|
const update = () => {
|
|
10723
|
-
const metrics =
|
|
10724
|
-
const inset = metrics ?
|
|
10641
|
+
const metrics = chunkDCNHUEWQ_js.readViewportMetrics(window);
|
|
10642
|
+
const inset = metrics ? chunkDCNHUEWQ_js.computeKeyboardInset(metrics) : 0;
|
|
10725
10643
|
setKeyboardInset(inset);
|
|
10726
10644
|
if (inset > 0) {
|
|
10727
10645
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10732,8 +10650,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10732
10650
|
vv.addEventListener("scroll", update);
|
|
10733
10651
|
const onFocusIn = () => {
|
|
10734
10652
|
window.requestAnimationFrame(() => {
|
|
10735
|
-
const metrics =
|
|
10736
|
-
const inset = metrics ?
|
|
10653
|
+
const metrics = chunkDCNHUEWQ_js.readViewportMetrics(window);
|
|
10654
|
+
const inset = metrics ? chunkDCNHUEWQ_js.computeKeyboardInset(metrics) : 0;
|
|
10737
10655
|
if (inset > 0) {
|
|
10738
10656
|
scrollFocusedIntoView(inset);
|
|
10739
10657
|
}
|
|
@@ -10746,7 +10664,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10746
10664
|
document.removeEventListener("focusin", onFocusIn);
|
|
10747
10665
|
};
|
|
10748
10666
|
}, [enabled]);
|
|
10749
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10667
|
+
return { keyboardInset, isKeyboardOpen: chunkDCNHUEWQ_js.isKeyboardOpen(keyboardInset) };
|
|
10750
10668
|
}
|
|
10751
10669
|
|
|
10752
10670
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10775,21 +10693,21 @@ function buildCanvasProps(input) {
|
|
|
10775
10693
|
} = input;
|
|
10776
10694
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10777
10695
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10778
|
-
const fieldContext =
|
|
10696
|
+
const fieldContext = chunkDCNHUEWQ_js.buildFieldSubstitutionContext({
|
|
10779
10697
|
headerFooter: s.headerFooter,
|
|
10780
10698
|
customProperties: s.customProperties,
|
|
10781
10699
|
slide: activeSlide
|
|
10782
10700
|
});
|
|
10783
10701
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10784
|
-
const openExternalUrl = (url) => {
|
|
10785
|
-
if (
|
|
10702
|
+
const openExternalUrl = (url, target) => {
|
|
10703
|
+
if (chunkDCNHUEWQ_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
10786
10704
|
return;
|
|
10787
10705
|
}
|
|
10788
|
-
|
|
10706
|
+
chunkDCNHUEWQ_js.safeOpenUrl(url, target);
|
|
10789
10707
|
};
|
|
10790
10708
|
const handleActionClick = (elementId, action) => {
|
|
10791
10709
|
if (mode === "present") {
|
|
10792
|
-
const resolved =
|
|
10710
|
+
const resolved = chunkDCNHUEWQ_js.resolvePresentationAction(action, { slideCount: slides.length });
|
|
10793
10711
|
if (resolved.intent.kind === "openUrl") {
|
|
10794
10712
|
openExternalUrl(resolved.intent.url);
|
|
10795
10713
|
return;
|
|
@@ -10799,10 +10717,10 @@ function buildCanvasProps(input) {
|
|
|
10799
10717
|
openExternalUrl(action.url);
|
|
10800
10718
|
}
|
|
10801
10719
|
};
|
|
10802
|
-
const handleHyperlinkClick = (url) => {
|
|
10803
|
-
if (
|
|
10720
|
+
const handleHyperlinkClick = (url, target) => {
|
|
10721
|
+
if (chunkDCNHUEWQ_js.isPpactionUrl(url)) {
|
|
10804
10722
|
if (mode === "present") {
|
|
10805
|
-
const parsed =
|
|
10723
|
+
const parsed = chunkDCNHUEWQ_js.parsePpactionUrl(url);
|
|
10806
10724
|
if (parsed) {
|
|
10807
10725
|
presentation.handlePresentationAction({
|
|
10808
10726
|
action: parsed.action,
|
|
@@ -10812,7 +10730,7 @@ function buildCanvasProps(input) {
|
|
|
10812
10730
|
}
|
|
10813
10731
|
return;
|
|
10814
10732
|
}
|
|
10815
|
-
openExternalUrl(url);
|
|
10733
|
+
openExternalUrl(url, target);
|
|
10816
10734
|
};
|
|
10817
10735
|
return {
|
|
10818
10736
|
activeSlide: effectiveSlide,
|
|
@@ -10908,7 +10826,7 @@ function buildCanvasProps(input) {
|
|
|
10908
10826
|
|
|
10909
10827
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10910
10828
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10911
|
-
return
|
|
10829
|
+
return chunkDCNHUEWQ_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10912
10830
|
}
|
|
10913
10831
|
|
|
10914
10832
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10921,7 +10839,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10921
10839
|
const current = activeSlide.animations ?? [];
|
|
10922
10840
|
if (group === "motionPath") {
|
|
10923
10841
|
propertyHandlers.handleUpdateSlide({
|
|
10924
|
-
animations:
|
|
10842
|
+
animations: chunkDCNHUEWQ_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10925
10843
|
});
|
|
10926
10844
|
return;
|
|
10927
10845
|
}
|
|
@@ -11105,6 +11023,7 @@ function buildToolbarProps(input) {
|
|
|
11105
11023
|
onUngroupElement: manipulation.handleUngroupElement,
|
|
11106
11024
|
onUpdateElementStyle: ops.updateSelectedShapeStyle,
|
|
11107
11025
|
selectedCount: s.selectedElementIds.length > 0 ? s.selectedElementIds.length : selectionSize,
|
|
11026
|
+
selectionGroupable: manipulation.selectionGroupable,
|
|
11108
11027
|
onOpenHyperlinkDialog: () => dialogs.setIsHyperlinkDialogOpen(true),
|
|
11109
11028
|
onDuplicate: manipulation.handleDuplicate,
|
|
11110
11029
|
onDelete: manipulation.handleDelete,
|
|
@@ -11116,7 +11035,7 @@ function buildToolbarProps(input) {
|
|
|
11116
11035
|
onOpenFile,
|
|
11117
11036
|
onOpenRecentFile,
|
|
11118
11037
|
onCreatePresentation: (templateId) => {
|
|
11119
|
-
s.setSlides(
|
|
11038
|
+
s.setSlides(chunkDCNHUEWQ_js.createBackstagePresentation(templateId));
|
|
11120
11039
|
s.setActiveSlideIndex(0);
|
|
11121
11040
|
s.setSelectedElementId(null);
|
|
11122
11041
|
s.setSelectedElementIds([]);
|
|
@@ -11145,7 +11064,7 @@ function buildToolbarProps(input) {
|
|
|
11145
11064
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
11146
11065
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
11147
11066
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
11148
|
-
templateScheme:
|
|
11067
|
+
templateScheme: chunkDCNHUEWQ_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
11149
11068
|
customShows: s.customShows,
|
|
11150
11069
|
activeCustomShowId: s.activeCustomShowId,
|
|
11151
11070
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -11186,7 +11105,7 @@ function buildToolbarProps(input) {
|
|
|
11186
11105
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
11187
11106
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
11188
11107
|
formatPainterActive: s.formatPainterActive,
|
|
11189
|
-
canActivateFormatPainter:
|
|
11108
|
+
canActivateFormatPainter: chunkDCNHUEWQ_js.hasCopyableFormat(selectedElement),
|
|
11190
11109
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
11191
11110
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
11192
11111
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11264,7 +11183,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11264
11183
|
headerFooter: state.headerFooter,
|
|
11265
11184
|
loading,
|
|
11266
11185
|
error,
|
|
11267
|
-
maxHistoryEntries:
|
|
11186
|
+
maxHistoryEntries: chunkDCNHUEWQ_js.resolveHistoryDepth(viewerOptions),
|
|
11268
11187
|
hasActivePointerInteraction,
|
|
11269
11188
|
pointerCommitNonce: state.pointerCommitNonce,
|
|
11270
11189
|
onDirty: markDocumentDirty,
|
|
@@ -11332,7 +11251,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11332
11251
|
gridSpacingPx,
|
|
11333
11252
|
// Multiplied against the pre-existing 2x baseline; see the matching
|
|
11334
11253
|
// comment in `PowerPointViewer.tsx`.
|
|
11335
|
-
imageExportScale: 2 *
|
|
11254
|
+
imageExportScale: 2 * chunkDCNHUEWQ_js.resolveImageResolutionScale(viewerOptions),
|
|
11336
11255
|
viewerOptions
|
|
11337
11256
|
};
|
|
11338
11257
|
}
|
|
@@ -11348,7 +11267,7 @@ function useCompatibilityToastsState() {
|
|
|
11348
11267
|
}
|
|
11349
11268
|
function useReadOnlyRecommendationState(content) {
|
|
11350
11269
|
const [recommendation, setRecommendation] = react.useState(
|
|
11351
|
-
() =>
|
|
11270
|
+
() => chunkDCNHUEWQ_js.readOnlyRecommendation(void 0)
|
|
11352
11271
|
);
|
|
11353
11272
|
const [bannerHidden, setBannerHidden] = react.useState(false);
|
|
11354
11273
|
const [editAnywayActive, setEditAnywayActive] = react.useState(false);
|
|
@@ -11386,9 +11305,9 @@ function useViewPreferencesSync(input) {
|
|
|
11386
11305
|
setShowGuides
|
|
11387
11306
|
} = input;
|
|
11388
11307
|
react.useEffect(() => {
|
|
11389
|
-
const seeded =
|
|
11308
|
+
const seeded = chunkDCNHUEWQ_js.viewerPreferencesFromViewProperties(
|
|
11390
11309
|
{ viewProperties },
|
|
11391
|
-
{ ...
|
|
11310
|
+
{ ...chunkDCNHUEWQ_js.DEFAULT_VIEWER_PREFERENCES, snapToGrid, snapToObjects: snapToShape, showGuides }
|
|
11392
11311
|
);
|
|
11393
11312
|
setSnapToGrid(seeded.snapToGrid);
|
|
11394
11313
|
setSnapToShape(seeded.snapToObjects ?? snapToShape);
|
|
@@ -11398,7 +11317,7 @@ function useViewPreferencesSync(input) {
|
|
|
11398
11317
|
(prefsOverride) => {
|
|
11399
11318
|
setViewProperties((prev) => {
|
|
11400
11319
|
const merged = {
|
|
11401
|
-
...
|
|
11320
|
+
...chunkDCNHUEWQ_js.DEFAULT_VIEWER_PREFERENCES,
|
|
11402
11321
|
snapToGrid,
|
|
11403
11322
|
snapToObjects: snapToShape,
|
|
11404
11323
|
showGuides,
|
|
@@ -11406,7 +11325,7 @@ function useViewPreferencesSync(input) {
|
|
|
11406
11325
|
gridSpacingCy: prev?.gridSpacing?.cy,
|
|
11407
11326
|
...prefsOverride
|
|
11408
11327
|
};
|
|
11409
|
-
const patch =
|
|
11328
|
+
const patch = chunkDCNHUEWQ_js.viewPropertiesPatchFromPreferences(merged);
|
|
11410
11329
|
return {
|
|
11411
11330
|
...prev,
|
|
11412
11331
|
slideViewPr: { ...prev?.slideViewPr, ...patch.slideViewPr },
|
|
@@ -11624,7 +11543,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11624
11543
|
}, [incomingContent]);
|
|
11625
11544
|
const onOpenFile = react.useCallback(() => {
|
|
11626
11545
|
void (async () => {
|
|
11627
|
-
const picked = await
|
|
11546
|
+
const picked = await chunkDCNHUEWQ_js.openPptxFile();
|
|
11628
11547
|
if (picked) {
|
|
11629
11548
|
setContent(picked.buffer);
|
|
11630
11549
|
}
|
|
@@ -11632,7 +11551,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11632
11551
|
}, []);
|
|
11633
11552
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11634
11553
|
void (async () => {
|
|
11635
|
-
const bytes = await
|
|
11554
|
+
const bytes = await chunkDCNHUEWQ_js.readBackstageRecentFile(key);
|
|
11636
11555
|
if (bytes) {
|
|
11637
11556
|
setContent(bytes);
|
|
11638
11557
|
}
|