pptx-react-viewer 3.6.0 → 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 +19 -0
- package/dist/{AiChatPanel-WRQGJJVD.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-LEOEDIW2.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-SJC2ZB6R.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-3TJ2GTGI.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-SPER4LQA.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-2ZGOMOZO.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-42FYFGLU.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-FH3YHPXE.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-EIU2GVUZ.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-2BCR2YYD.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-VQOHZPHI.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-QFQUJFDP.mjs → PieChart3DScene-VZI2VARG.mjs} +1 -1
- package/dist/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-CGXMRBCL.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-FTVXZN6O.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-ZWPHUPL4.js → chunk-3EJFZ7TE.js} +5 -5
- package/dist/chunk-3EJFZ7TE.js.br +0 -0
- package/dist/chunk-3EJFZ7TE.js.gz +0 -0
- package/dist/{chunk-AL2KLPOJ.js → chunk-DCNHUEWQ.js} +4058 -1841
- package/dist/chunk-DCNHUEWQ.js.br +0 -0
- package/dist/chunk-DCNHUEWQ.js.gz +0 -0
- package/dist/{chunk-TGCSZXOG.mjs → chunk-FGTMS7LR.mjs} +2 -23
- package/dist/chunk-FGTMS7LR.mjs.br +0 -0
- package/dist/chunk-FGTMS7LR.mjs.gz +0 -0
- package/dist/{chunk-WX7AFFBZ.mjs → chunk-JANUSAEK.mjs} +51 -68
- package/dist/chunk-JANUSAEK.mjs.br +0 -0
- package/dist/chunk-JANUSAEK.mjs.gz +0 -0
- package/dist/{chunk-ZUSYUWOV.mjs → chunk-NV55GU5V.mjs} +4046 -1839
- package/dist/chunk-NV55GU5V.mjs.br +0 -0
- package/dist/chunk-NV55GU5V.mjs.gz +0 -0
- package/dist/{chunk-ZHSBMG37.js → chunk-OBE4TB76.js} +447 -549
- package/dist/chunk-OBE4TB76.js.br +0 -0
- package/dist/chunk-OBE4TB76.js.gz +0 -0
- package/dist/{chunk-VYNICQ4O.mjs → chunk-PC62KGU3.mjs} +12 -114
- package/dist/chunk-PC62KGU3.mjs.br +0 -0
- package/dist/chunk-PC62KGU3.mjs.gz +0 -0
- package/dist/{chunk-NFOOONND.js → chunk-TUSALM3A.js} +1449 -1278
- package/dist/chunk-TUSALM3A.js.br +0 -0
- package/dist/chunk-TUSALM3A.js.gz +0 -0
- package/dist/{chunk-FG5VQFWP.mjs → chunk-TXY2E7VQ.mjs} +265 -94
- package/dist/chunk-TXY2E7VQ.mjs.br +0 -0
- package/dist/chunk-TXY2E7VQ.mjs.gz +0 -0
- package/dist/{chunk-7VPDHSWF.js → chunk-VIFDZIVX.js} +222 -240
- package/dist/chunk-VIFDZIVX.js.br +0 -0
- package/dist/chunk-VIFDZIVX.js.gz +0 -0
- package/dist/{chunk-MZI4DG3S.js → chunk-W24OJ7H5.js} +2 -23
- package/dist/chunk-W24OJ7H5.js.br +0 -0
- package/dist/chunk-W24OJ7H5.js.gz +0 -0
- package/dist/{chunk-T3V5FBXJ.mjs → chunk-WKODF5ZU.mjs} +1 -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 +419 -18
- 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 +419 -18
- 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/viewer/index.d.ts +387 -18
- package/dist/viewer/index.js +27 -27
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +2 -2
- package/dist/AiChatPanel-LEOEDIW2.js.br +0 -0
- package/dist/AiChatPanel-LEOEDIW2.js.gz +0 -0
- package/dist/AiChatPanel-WRQGJJVD.mjs.br +0 -0
- package/dist/AiChatPanel-WRQGJJVD.mjs.gz +0 -0
- package/dist/Area3DChartScene-3TJ2GTGI.js.br +0 -0
- package/dist/Area3DChartScene-3TJ2GTGI.js.gz +0 -0
- package/dist/Area3DChartScene-SJC2ZB6R.mjs.br +0 -2
- package/dist/Area3DChartScene-SJC2ZB6R.mjs.gz +0 -0
- package/dist/Bar3DChartScene-2ZGOMOZO.js.br +0 -0
- package/dist/Bar3DChartScene-2ZGOMOZO.js.gz +0 -0
- package/dist/Bar3DChartScene-SPER4LQA.mjs.br +0 -0
- package/dist/Bar3DChartScene-SPER4LQA.mjs.gz +0 -0
- package/dist/Line3DChartScene-42FYFGLU.js.br +0 -0
- package/dist/Line3DChartScene-42FYFGLU.js.gz +0 -0
- package/dist/Line3DChartScene-FH3YHPXE.mjs.br +0 -2
- package/dist/Line3DChartScene-FH3YHPXE.mjs.gz +0 -0
- package/dist/Model3DScene-2BCR2YYD.mjs.br +0 -0
- package/dist/Model3DScene-2BCR2YYD.mjs.gz +0 -0
- package/dist/Model3DScene-EIU2GVUZ.js.br +0 -0
- package/dist/Model3DScene-EIU2GVUZ.js.gz +0 -0
- package/dist/PieChart3DScene-QFQUJFDP.mjs.br +0 -0
- package/dist/PieChart3DScene-QFQUJFDP.mjs.gz +0 -0
- package/dist/PieChart3DScene-VQOHZPHI.js.br +0 -0
- package/dist/PieChart3DScene-VQOHZPHI.js.gz +0 -0
- package/dist/SurfaceChart3DScene-CGXMRBCL.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-CGXMRBCL.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-FTVXZN6O.js.br +0 -0
- package/dist/SurfaceChart3DScene-FTVXZN6O.js.gz +0 -0
- package/dist/chunk-7VPDHSWF.js.br +0 -0
- package/dist/chunk-7VPDHSWF.js.gz +0 -0
- package/dist/chunk-AL2KLPOJ.js.br +0 -0
- package/dist/chunk-AL2KLPOJ.js.gz +0 -0
- package/dist/chunk-FG5VQFWP.mjs.br +0 -0
- package/dist/chunk-FG5VQFWP.mjs.gz +0 -0
- package/dist/chunk-MZI4DG3S.js.br +0 -0
- package/dist/chunk-MZI4DG3S.js.gz +0 -0
- package/dist/chunk-NFOOONND.js.br +0 -0
- package/dist/chunk-NFOOONND.js.gz +0 -0
- package/dist/chunk-T3V5FBXJ.mjs.br +0 -0
- package/dist/chunk-T3V5FBXJ.mjs.gz +0 -0
- package/dist/chunk-TGCSZXOG.mjs.br +0 -0
- package/dist/chunk-TGCSZXOG.mjs.gz +0 -0
- package/dist/chunk-VYNICQ4O.mjs.br +0 -0
- package/dist/chunk-VYNICQ4O.mjs.gz +0 -0
- package/dist/chunk-WX7AFFBZ.mjs.br +0 -0
- package/dist/chunk-WX7AFFBZ.mjs.gz +0 -0
- package/dist/chunk-ZHSBMG37.js.br +0 -0
- package/dist/chunk-ZHSBMG37.js.gz +0 -0
- package/dist/chunk-ZUSYUWOV.mjs.br +0 -0
- package/dist/chunk-ZUSYUWOV.mjs.gz +0 -0
- package/dist/chunk-ZWPHUPL4.js.br +0 -0
- package/dist/chunk-ZWPHUPL4.js.gz +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var 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,8 +1030,7 @@ function useAnimationPlayback(input) {
|
|
|
1103
1030
|
const presentationTimersRef = react.useRef([]);
|
|
1104
1031
|
const controllerRef = react.useRef(null);
|
|
1105
1032
|
const buildRafRef = react.useRef(null);
|
|
1106
|
-
const activeAnimationGroupRef = react.useRef(
|
|
1107
|
-
const activeAnimationEndAtRef = react.useRef(0);
|
|
1033
|
+
const activeAnimationGroupRef = react.useRef(chunkDCNHUEWQ_js.createActiveAnimationGroup());
|
|
1108
1034
|
const seededCompletedRef = react.useRef(false);
|
|
1109
1035
|
const mediaTimeNodeElementIdsRef = react.useRef(/* @__PURE__ */ new Map());
|
|
1110
1036
|
const lastSeedCompletedRef = react.useRef(false);
|
|
@@ -1121,25 +1047,15 @@ function useAnimationPlayback(input) {
|
|
|
1121
1047
|
}, [onPlayActionSound]);
|
|
1122
1048
|
react.useEffect(() => {
|
|
1123
1049
|
return () => {
|
|
1124
|
-
|
|
1050
|
+
chunkDCNHUEWQ_js.cancelBuildReveal(buildRafRef);
|
|
1125
1051
|
};
|
|
1126
1052
|
}, []);
|
|
1127
1053
|
const clearPresentationTimers = react.useCallback(() => {
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
});
|
|
1131
|
-
presentationTimersRef.current = [];
|
|
1132
|
-
chunkAL2KLPOJ_js.cancelBuildReveal(buildRafRef);
|
|
1133
|
-
activeAnimationGroupRef.current = null;
|
|
1134
|
-
activeAnimationEndAtRef.current = 0;
|
|
1135
|
-
}, []);
|
|
1136
|
-
const markAnimationGroupActive = react.useCallback((group) => {
|
|
1137
|
-
activeAnimationGroupRef.current = group;
|
|
1138
|
-
activeAnimationEndAtRef.current = performance.now() + Math.max(0, group.totalDurationMs);
|
|
1139
|
-
}, []);
|
|
1054
|
+
chunkDCNHUEWQ_js.clearPlaybackTimers(buildPlaybackContext(), activeAnimationGroupRef.current);
|
|
1055
|
+
}, [buildPlaybackContext]);
|
|
1140
1056
|
const resetSlideTimeline = react.useCallback(
|
|
1141
1057
|
(slideIndex) => {
|
|
1142
|
-
|
|
1058
|
+
chunkDCNHUEWQ_js.cancelBuildReveal(buildRafRef);
|
|
1143
1059
|
const slide = slides[slideIndex];
|
|
1144
1060
|
if (!slide) {
|
|
1145
1061
|
controllerRef.current = null;
|
|
@@ -1150,9 +1066,9 @@ function useAnimationPlayback(input) {
|
|
|
1150
1066
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1151
1067
|
return;
|
|
1152
1068
|
}
|
|
1153
|
-
const controller =
|
|
1069
|
+
const controller = chunkDCNHUEWQ_js.PresentationAnimationController.fromSlide(slide);
|
|
1154
1070
|
controllerRef.current = controller;
|
|
1155
|
-
mediaTimeNodeElementIdsRef.current =
|
|
1071
|
+
mediaTimeNodeElementIdsRef.current = chunkDCNHUEWQ_js.resolveMediaTimeNodeElementIds(
|
|
1156
1072
|
slide.nativeAnimations ?? []
|
|
1157
1073
|
);
|
|
1158
1074
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
@@ -1166,30 +1082,12 @@ function useAnimationPlayback(input) {
|
|
|
1166
1082
|
if (!animationsEnabled) {
|
|
1167
1083
|
return false;
|
|
1168
1084
|
}
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
clearPresentationTimers();
|
|
1176
|
-
finishAnimationGroupSteps(activeGroup, setPresentationElementStates, completedStates);
|
|
1177
|
-
chunkAL2KLPOJ_js.scheduleAutoAdvanceChain(controller, buildPlaybackContext());
|
|
1178
|
-
return true;
|
|
1179
|
-
}
|
|
1180
|
-
if (!controller || !controller.hasMoreSteps()) {
|
|
1181
|
-
return false;
|
|
1182
|
-
}
|
|
1183
|
-
const group = controller.advance();
|
|
1184
|
-
if (!group) {
|
|
1185
|
-
return false;
|
|
1186
|
-
}
|
|
1187
|
-
const ctx = buildPlaybackContext();
|
|
1188
|
-
chunkAL2KLPOJ_js.playGroup(controller, group, ctx);
|
|
1189
|
-
markAnimationGroupActive(group);
|
|
1190
|
-
chunkAL2KLPOJ_js.scheduleAutoAdvanceChain(controller, ctx);
|
|
1191
|
-
return true;
|
|
1192
|
-
}, [animationsEnabled, buildPlaybackContext, clearPresentationTimers, markAnimationGroupActive]);
|
|
1085
|
+
return chunkDCNHUEWQ_js.advanceMainSequence(
|
|
1086
|
+
controllerRef.current,
|
|
1087
|
+
buildPlaybackContext(),
|
|
1088
|
+
activeAnimationGroupRef.current
|
|
1089
|
+
);
|
|
1090
|
+
}, [animationsEnabled, buildPlaybackContext]);
|
|
1193
1091
|
const handleInteractiveShapeClick = react.useCallback(
|
|
1194
1092
|
(shapeId) => {
|
|
1195
1093
|
const controller = controllerRef.current;
|
|
@@ -1200,7 +1098,7 @@ function useAnimationPlayback(input) {
|
|
|
1200
1098
|
if (!group) {
|
|
1201
1099
|
return false;
|
|
1202
1100
|
}
|
|
1203
|
-
|
|
1101
|
+
chunkDCNHUEWQ_js.playGroup(controller, group, buildPlaybackContext());
|
|
1204
1102
|
return true;
|
|
1205
1103
|
},
|
|
1206
1104
|
[buildPlaybackContext]
|
|
@@ -1219,7 +1117,7 @@ function useAnimationPlayback(input) {
|
|
|
1219
1117
|
if (!group) {
|
|
1220
1118
|
return false;
|
|
1221
1119
|
}
|
|
1222
|
-
|
|
1120
|
+
chunkDCNHUEWQ_js.playGroup(controller, group, buildPlaybackContext());
|
|
1223
1121
|
return true;
|
|
1224
1122
|
},
|
|
1225
1123
|
[animationsEnabled, buildPlaybackContext]
|
|
@@ -1300,12 +1198,12 @@ function useAnimationPlayback(input) {
|
|
|
1300
1198
|
presentationTimersRef
|
|
1301
1199
|
};
|
|
1302
1200
|
}
|
|
1303
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1304
|
-
var AUDIENCE_HASH =
|
|
1305
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1306
|
-
var AUDIENCE_NONCE_KEY =
|
|
1201
|
+
var PRESENTER_CHANNEL_NAME = 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;
|
|
1307
1205
|
function generateSessionId() {
|
|
1308
|
-
return
|
|
1206
|
+
return chunkDCNHUEWQ_js.createPresentationSessionId();
|
|
1309
1207
|
}
|
|
1310
1208
|
function parseAudienceNonce() {
|
|
1311
1209
|
const hash = window.location.hash;
|
|
@@ -1341,7 +1239,7 @@ function usePresenterWindow(input) {
|
|
|
1341
1239
|
}, []);
|
|
1342
1240
|
const swapDisplays = react.useCallback(async () => {
|
|
1343
1241
|
const audience = audienceWindowRef.current;
|
|
1344
|
-
return audience && !audience.closed ?
|
|
1242
|
+
return audience && !audience.closed ? chunkDCNHUEWQ_js.swapPresentationWindows(window, audience) : false;
|
|
1345
1243
|
}, []);
|
|
1346
1244
|
const syncSlideToAudience = react.useCallback(
|
|
1347
1245
|
(slideIndex) => {
|
|
@@ -1405,7 +1303,7 @@ function usePresenterWindow(input) {
|
|
|
1405
1303
|
pollTimerRef.current = null;
|
|
1406
1304
|
}
|
|
1407
1305
|
if (closingSessionId) {
|
|
1408
|
-
void
|
|
1306
|
+
void chunkDCNHUEWQ_js.clearAudienceContent(closingSessionId);
|
|
1409
1307
|
}
|
|
1410
1308
|
}, [getChannel]);
|
|
1411
1309
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1423,10 +1321,10 @@ function usePresenterWindow(input) {
|
|
|
1423
1321
|
audienceWindowRef.current = blankWin;
|
|
1424
1322
|
const sessionId = generateSessionId();
|
|
1425
1323
|
sessionIdRef.current = sessionId;
|
|
1426
|
-
const audienceUrl =
|
|
1427
|
-
void
|
|
1324
|
+
const audienceUrl = chunkDCNHUEWQ_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1325
|
+
void chunkDCNHUEWQ_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1428
1326
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1429
|
-
|
|
1327
|
+
chunkDCNHUEWQ_js.placeAudienceWindow(blankWin, placement);
|
|
1430
1328
|
}
|
|
1431
1329
|
return void 0;
|
|
1432
1330
|
});
|
|
@@ -1456,7 +1354,7 @@ function usePresenterWindow(input) {
|
|
|
1456
1354
|
}
|
|
1457
1355
|
};
|
|
1458
1356
|
if (content) {
|
|
1459
|
-
void
|
|
1357
|
+
void chunkDCNHUEWQ_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1460
1358
|
} else {
|
|
1461
1359
|
navigateOrClose(true);
|
|
1462
1360
|
}
|
|
@@ -1482,7 +1380,7 @@ function usePresenterWindow(input) {
|
|
|
1482
1380
|
}
|
|
1483
1381
|
const handleMessage = (event) => {
|
|
1484
1382
|
const message = event.data;
|
|
1485
|
-
if (
|
|
1383
|
+
if (chunkDCNHUEWQ_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1486
1384
|
syncStateToAudience(snapshotRef.current);
|
|
1487
1385
|
}
|
|
1488
1386
|
};
|
|
@@ -1511,7 +1409,7 @@ function usePresenterWindow(input) {
|
|
|
1511
1409
|
react.useEffect(() => {
|
|
1512
1410
|
const handleBeforeUnload = () => {
|
|
1513
1411
|
if (sessionIdRef.current) {
|
|
1514
|
-
void
|
|
1412
|
+
void chunkDCNHUEWQ_js.clearAudienceContent(sessionIdRef.current);
|
|
1515
1413
|
}
|
|
1516
1414
|
};
|
|
1517
1415
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1573,7 +1471,7 @@ function useAudienceMode(input) {
|
|
|
1573
1471
|
}
|
|
1574
1472
|
channel.onmessage = (event) => {
|
|
1575
1473
|
const data = event.data;
|
|
1576
|
-
if (!
|
|
1474
|
+
if (!chunkDCNHUEWQ_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1577
1475
|
return;
|
|
1578
1476
|
}
|
|
1579
1477
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1589,16 +1487,16 @@ function useAudienceMode(input) {
|
|
|
1589
1487
|
}
|
|
1590
1488
|
if (data.type === "presenter-exit") {
|
|
1591
1489
|
if (expectedSessionId) {
|
|
1592
|
-
void
|
|
1490
|
+
void chunkDCNHUEWQ_js.clearAudienceContent(expectedSessionId);
|
|
1593
1491
|
}
|
|
1594
|
-
if (
|
|
1492
|
+
if (chunkDCNHUEWQ_js.endAudienceDisplay(window)) {
|
|
1595
1493
|
handlers.onPresenterEnded?.();
|
|
1596
1494
|
}
|
|
1597
1495
|
}
|
|
1598
1496
|
};
|
|
1599
1497
|
if (expectedSessionId) {
|
|
1600
1498
|
channel.postMessage({
|
|
1601
|
-
origin:
|
|
1499
|
+
origin: chunkDCNHUEWQ_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1602
1500
|
type: "audience-ready",
|
|
1603
1501
|
sessionId: expectedSessionId
|
|
1604
1502
|
});
|
|
@@ -1612,7 +1510,7 @@ function useAudienceMode(input) {
|
|
|
1612
1510
|
}, []);
|
|
1613
1511
|
}
|
|
1614
1512
|
function usePresentationKeyboard(input) {
|
|
1615
|
-
const wheelBufferRef = react.useRef(
|
|
1513
|
+
const wheelBufferRef = react.useRef(chunkDCNHUEWQ_js.createWheelStepBuffer());
|
|
1616
1514
|
const {
|
|
1617
1515
|
mode,
|
|
1618
1516
|
movePresentationSlide,
|
|
@@ -1633,14 +1531,14 @@ function usePresentationKeyboard(input) {
|
|
|
1633
1531
|
presentationSlideIndex,
|
|
1634
1532
|
setShowRehearsalSummary
|
|
1635
1533
|
} = input;
|
|
1636
|
-
const keyBufferRef = react.useRef(
|
|
1534
|
+
const keyBufferRef = react.useRef(chunkDCNHUEWQ_js.createPresentationKeyBuffer());
|
|
1637
1535
|
react.useEffect(() => {
|
|
1638
|
-
if (mode !== "present" || !
|
|
1639
|
-
keyBufferRef.current =
|
|
1536
|
+
if (mode !== "present" || !chunkDCNHUEWQ_js.acceptsPresentationInput()) {
|
|
1537
|
+
keyBufferRef.current = chunkDCNHUEWQ_js.createPresentationKeyBuffer();
|
|
1640
1538
|
return;
|
|
1641
1539
|
}
|
|
1642
1540
|
const handleKeyDown = (event) => {
|
|
1643
|
-
const mapped =
|
|
1541
|
+
const mapped = chunkDCNHUEWQ_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1644
1542
|
if (mapped.action === "none") {
|
|
1645
1543
|
return;
|
|
1646
1544
|
}
|
|
@@ -1660,12 +1558,12 @@ function usePresentationKeyboard(input) {
|
|
|
1660
1558
|
movePresentationSlide(-1);
|
|
1661
1559
|
return;
|
|
1662
1560
|
case "first": {
|
|
1663
|
-
const first =
|
|
1561
|
+
const first = chunkDCNHUEWQ_js.firstShowSlideIndex(showSlideIndexes);
|
|
1664
1562
|
navigateToSlide(first ?? 0);
|
|
1665
1563
|
return;
|
|
1666
1564
|
}
|
|
1667
1565
|
case "last": {
|
|
1668
|
-
const last =
|
|
1566
|
+
const last = chunkDCNHUEWQ_js.lastShowSlideIndex(showSlideIndexes);
|
|
1669
1567
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1670
1568
|
return;
|
|
1671
1569
|
}
|
|
@@ -1703,10 +1601,10 @@ function usePresentationKeyboard(input) {
|
|
|
1703
1601
|
}
|
|
1704
1602
|
};
|
|
1705
1603
|
const handleWheel = (event) => {
|
|
1706
|
-
if (mode !== "present" || !
|
|
1604
|
+
if (mode !== "present" || !chunkDCNHUEWQ_js.acceptsPresentationInput()) {
|
|
1707
1605
|
return;
|
|
1708
1606
|
}
|
|
1709
|
-
const mapped =
|
|
1607
|
+
const mapped = chunkDCNHUEWQ_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1710
1608
|
if (mapped.intent === "next-slide") {
|
|
1711
1609
|
event.preventDefault();
|
|
1712
1610
|
movePresentationSlide(1);
|
|
@@ -1839,7 +1737,7 @@ function useRehearsalTimings(input) {
|
|
|
1839
1737
|
|
|
1840
1738
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1841
1739
|
function handlePresentationActionImpl(action, deps) {
|
|
1842
|
-
|
|
1740
|
+
chunkDCNHUEWQ_js.runPresentationAction(
|
|
1843
1741
|
action,
|
|
1844
1742
|
{ slideCount: deps.slidesLength, ...deps.elementId ? { elementId: deps.elementId } : {} },
|
|
1845
1743
|
{
|
|
@@ -1867,13 +1765,13 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1867
1765
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1868
1766
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1869
1767
|
const transition = deps.reverse ? deps.slides[deps.currentSlideIndex]?.transition : incomingSlide?.transition;
|
|
1870
|
-
const durationMs = deps.playTransition ?
|
|
1768
|
+
const durationMs = deps.playTransition ? chunkDCNHUEWQ_js.resolveTransitionDurationMs(transition) : 0;
|
|
1871
1769
|
deps.clearPresentationTimers();
|
|
1872
1770
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1873
1771
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
1874
1772
|
deps.setPresentationSlideVisible(true);
|
|
1875
1773
|
deps.seedSlideAnimations(nextSlideIndex, { completed: deps.seedCompleted });
|
|
1876
|
-
const soundAction =
|
|
1774
|
+
const soundAction = chunkDCNHUEWQ_js.resolveTransitionSoundAction(transition);
|
|
1877
1775
|
if (soundAction.kind === "play" && deps.onPlayActionSound) {
|
|
1878
1776
|
deps.onPlayActionSound(soundAction.soundPath, { loop: soundAction.loop });
|
|
1879
1777
|
} else if (soundAction.kind === "stop" && deps.onStopActionSound) {
|
|
@@ -1936,7 +1834,7 @@ function useSlideNavigation(input) {
|
|
|
1936
1834
|
});
|
|
1937
1835
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1938
1836
|
(slideIndex) => {
|
|
1939
|
-
const delayMs =
|
|
1837
|
+
const delayMs = chunkDCNHUEWQ_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1940
1838
|
if (delayMs === void 0) {
|
|
1941
1839
|
return;
|
|
1942
1840
|
}
|
|
@@ -1959,7 +1857,7 @@ function useSlideNavigation(input) {
|
|
|
1959
1857
|
if (availableSlideIndexes.length === 0) {
|
|
1960
1858
|
return;
|
|
1961
1859
|
}
|
|
1962
|
-
const pastLastSlide = direction === 1 && !
|
|
1860
|
+
const pastLastSlide = direction === 1 && !chunkDCNHUEWQ_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1963
1861
|
if (rehearsing && pastLastSlide) {
|
|
1964
1862
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1965
1863
|
try {
|
|
@@ -1977,9 +1875,9 @@ function useSlideNavigation(input) {
|
|
|
1977
1875
|
onAdvancePastLastSlide();
|
|
1978
1876
|
return;
|
|
1979
1877
|
}
|
|
1980
|
-
const nextSlideIndex = direction === 1 ?
|
|
1878
|
+
const nextSlideIndex = direction === 1 ? chunkDCNHUEWQ_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1981
1879
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
1982
|
-
}) :
|
|
1880
|
+
}) : chunkDCNHUEWQ_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
1983
1881
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
1984
1882
|
return;
|
|
1985
1883
|
}
|
|
@@ -2158,7 +2056,7 @@ function createCustomShowRunner(deps) {
|
|
|
2158
2056
|
return;
|
|
2159
2057
|
}
|
|
2160
2058
|
origin = returnAfter ? { showId: deps.getActiveCustomShowId(), slideIndex: deps.getPresentationSlideIndex() } : null;
|
|
2161
|
-
const first =
|
|
2059
|
+
const first = chunkDCNHUEWQ_js.firstShowSlideIndex(chunkDCNHUEWQ_js.resolveShowSlideIndexes(deps.getSlides(), target));
|
|
2162
2060
|
deps.setActiveCustomShowId(customShowId);
|
|
2163
2061
|
if (first !== void 0) {
|
|
2164
2062
|
deps.navigateToSlide(first);
|
|
@@ -2235,22 +2133,22 @@ function usePresentationActionExtensions(input) {
|
|
|
2235
2133
|
}
|
|
2236
2134
|
}, [navigateToSlideViaRef]);
|
|
2237
2135
|
const onOpenFile = react.useCallback((target) => {
|
|
2238
|
-
|
|
2136
|
+
chunkDCNHUEWQ_js.safeOpenUrl(target);
|
|
2239
2137
|
}, []);
|
|
2240
2138
|
const onOpenPresentation = react.useCallback((target) => {
|
|
2241
|
-
|
|
2139
|
+
chunkDCNHUEWQ_js.safeOpenUrl(target);
|
|
2242
2140
|
}, []);
|
|
2243
2141
|
const onPlayMedia = react.useCallback(
|
|
2244
2142
|
(elementId) => {
|
|
2245
|
-
|
|
2143
|
+
chunkDCNHUEWQ_js.toggleStageElementMedia(containerRef.current, elementId);
|
|
2246
2144
|
},
|
|
2247
2145
|
[containerRef]
|
|
2248
2146
|
);
|
|
2249
2147
|
const onOleVerb = react.useCallback(
|
|
2250
2148
|
(verb, elementId) => {
|
|
2251
|
-
const target =
|
|
2149
|
+
const target = chunkDCNHUEWQ_js.resolveOleVerbTarget(slides[presentationSlideIndex], elementId, verb);
|
|
2252
2150
|
if (target) {
|
|
2253
|
-
|
|
2151
|
+
chunkDCNHUEWQ_js.openUrlInNewTab(target.url);
|
|
2254
2152
|
}
|
|
2255
2153
|
},
|
|
2256
2154
|
[slides, presentationSlideIndex]
|
|
@@ -2280,22 +2178,22 @@ function usePresentationActionExtensions(input) {
|
|
|
2280
2178
|
};
|
|
2281
2179
|
}
|
|
2282
2180
|
function usePresenterConsole(slideIndex, active) {
|
|
2283
|
-
const timerRef = react.useRef(
|
|
2284
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2181
|
+
const timerRef = react.useRef(chunkDCNHUEWQ_js.createPresenterTimer());
|
|
2182
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkDCNHUEWQ_js.createInitialPresentationSnapshot(slideIndex));
|
|
2285
2183
|
const patch = react.useCallback((value) => {
|
|
2286
|
-
setSnapshot((current) =>
|
|
2184
|
+
setSnapshot((current) => chunkDCNHUEWQ_js.mergePresentationSnapshot(current, value));
|
|
2287
2185
|
}, []);
|
|
2288
2186
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2289
2187
|
react.useEffect(() => {
|
|
2290
2188
|
if (!active) {
|
|
2291
2189
|
return;
|
|
2292
2190
|
}
|
|
2293
|
-
timerRef.current =
|
|
2191
|
+
timerRef.current = chunkDCNHUEWQ_js.resetPresenterTimer();
|
|
2294
2192
|
patch({ paused: false, elapsedMs: 0 });
|
|
2295
2193
|
const timer = window.setInterval(() => {
|
|
2296
2194
|
patch({
|
|
2297
2195
|
paused: timerRef.current.paused,
|
|
2298
|
-
elapsedMs:
|
|
2196
|
+
elapsedMs: chunkDCNHUEWQ_js.presenterElapsed(timerRef.current)
|
|
2299
2197
|
});
|
|
2300
2198
|
}, 1e3);
|
|
2301
2199
|
return () => window.clearInterval(timer);
|
|
@@ -2305,19 +2203,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2305
2203
|
applyAudienceSnapshot: setSnapshot,
|
|
2306
2204
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2307
2205
|
toggleTimer: () => {
|
|
2308
|
-
timerRef.current =
|
|
2206
|
+
timerRef.current = chunkDCNHUEWQ_js.togglePresenterTimer(timerRef.current);
|
|
2309
2207
|
patch({
|
|
2310
2208
|
paused: timerRef.current.paused,
|
|
2311
|
-
elapsedMs:
|
|
2209
|
+
elapsedMs: chunkDCNHUEWQ_js.presenterElapsed(timerRef.current)
|
|
2312
2210
|
});
|
|
2313
2211
|
},
|
|
2314
2212
|
resetTimer: () => {
|
|
2315
|
-
timerRef.current =
|
|
2213
|
+
timerRef.current = chunkDCNHUEWQ_js.resetPresenterTimer();
|
|
2316
2214
|
patch({ paused: false, elapsedMs: 0 });
|
|
2317
2215
|
},
|
|
2318
2216
|
stepZoom: (direction) => setSnapshot(
|
|
2319
|
-
(current) =>
|
|
2320
|
-
zoom:
|
|
2217
|
+
(current) => chunkDCNHUEWQ_js.mergePresentationSnapshot(current, {
|
|
2218
|
+
zoom: chunkDCNHUEWQ_js.stepPresenterZoom(
|
|
2321
2219
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2322
2220
|
direction
|
|
2323
2221
|
)
|
|
@@ -2368,7 +2266,7 @@ function usePresentationMode(input) {
|
|
|
2368
2266
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2369
2267
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2370
2268
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2371
|
-
const showGuard = react.useMemo(() =>
|
|
2269
|
+
const showGuard = react.useMemo(() => chunkDCNHUEWQ_js.createPresenterShowGuard(), []);
|
|
2372
2270
|
const {
|
|
2373
2271
|
presentationAnimations,
|
|
2374
2272
|
presentationElementStates,
|
|
@@ -2459,7 +2357,7 @@ function usePresentationMode(input) {
|
|
|
2459
2357
|
actionExtensions.bindNavigateToSlide(navigateToSlide);
|
|
2460
2358
|
const movePresentationSlide = react.useCallback(
|
|
2461
2359
|
(direction, trigger = "explicit") => {
|
|
2462
|
-
if (!
|
|
2360
|
+
if (!chunkDCNHUEWQ_js.acceptsPresentationInput()) {
|
|
2463
2361
|
return;
|
|
2464
2362
|
}
|
|
2465
2363
|
if (endOfShowVisible) {
|
|
@@ -2528,7 +2426,7 @@ function usePresentationMode(input) {
|
|
|
2528
2426
|
onSetMode("present");
|
|
2529
2427
|
}, [containerRef, onSetMode, setRehearsing]);
|
|
2530
2428
|
const enterPresentModeFromBeginning = react.useCallback(() => {
|
|
2531
|
-
const first =
|
|
2429
|
+
const first = chunkDCNHUEWQ_js.firstShowSlideIndex(visibleSlideIndexes);
|
|
2532
2430
|
if (first !== void 0) {
|
|
2533
2431
|
onSetActiveSlideIndex(first);
|
|
2534
2432
|
}
|
|
@@ -2608,7 +2506,7 @@ function usePresentationMode(input) {
|
|
|
2608
2506
|
if (mode !== "present") {
|
|
2609
2507
|
return;
|
|
2610
2508
|
}
|
|
2611
|
-
return
|
|
2509
|
+
return chunkDCNHUEWQ_js.attachPresentationVisibilityPause({
|
|
2612
2510
|
root: containerRef.current ?? void 0,
|
|
2613
2511
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2614
2512
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2616,7 +2514,7 @@ function usePresentationMode(input) {
|
|
|
2616
2514
|
}, [mode, containerRef]);
|
|
2617
2515
|
react.useLayoutEffect(() => {
|
|
2618
2516
|
if (mode === "present") {
|
|
2619
|
-
const idx =
|
|
2517
|
+
const idx = chunkDCNHUEWQ_js.presentationEntrySlideIndex(
|
|
2620
2518
|
activeSlideIndexRef.current,
|
|
2621
2519
|
visibleSlideIndexesRef.current
|
|
2622
2520
|
);
|
|
@@ -2695,11 +2593,11 @@ function usePresentationMode(input) {
|
|
|
2695
2593
|
return void 0;
|
|
2696
2594
|
}
|
|
2697
2595
|
const incoming = slides[transitionOverlay.incomingSlideIndex];
|
|
2698
|
-
return
|
|
2596
|
+
return chunkDCNHUEWQ_js.buildMorphTransitionPlan(
|
|
2699
2597
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2700
2598
|
incoming,
|
|
2701
2599
|
transitionOverlay.durationMs,
|
|
2702
|
-
|
|
2600
|
+
chunkDCNHUEWQ_js.morphOptionToMode(transitionOverlay.transition.morphOption),
|
|
2703
2601
|
// `PresentationStage` stacks the incoming slide's elements above its
|
|
2704
2602
|
// template shapes (`zIndex = templateElements.length + index`), so a
|
|
2705
2603
|
// z-index journey has to start counting where the stage does.
|
|
@@ -2724,7 +2622,7 @@ function usePresentationMode(input) {
|
|
|
2724
2622
|
if (!morphPlan) {
|
|
2725
2623
|
return presentationKeyframesCss;
|
|
2726
2624
|
}
|
|
2727
|
-
const imageRules =
|
|
2625
|
+
const imageRules = chunkDCNHUEWQ_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2728
2626
|
return `${presentationKeyframesCss ?? ""}
|
|
2729
2627
|
${morphPlan.keyframesCss}
|
|
2730
2628
|
${imageRules}`;
|
|
@@ -3021,7 +2919,7 @@ function useFindReplace({
|
|
|
3021
2919
|
const [findResults, setFindResults] = react.useState([]);
|
|
3022
2920
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
3023
2921
|
const performFind = react.useCallback(() => {
|
|
3024
|
-
const results =
|
|
2922
|
+
const results = chunkDCNHUEWQ_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
3025
2923
|
if (!findQuery) {
|
|
3026
2924
|
setFindResults([]);
|
|
3027
2925
|
setFindResultIndex(-1);
|
|
@@ -3055,7 +2953,7 @@ function useFindReplace({
|
|
|
3055
2953
|
return;
|
|
3056
2954
|
}
|
|
3057
2955
|
onUpdateSlides(
|
|
3058
|
-
(prevSlides) =>
|
|
2956
|
+
(prevSlides) => chunkDCNHUEWQ_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
3059
2957
|
);
|
|
3060
2958
|
onMarkDirty();
|
|
3061
2959
|
},
|
|
@@ -3077,9 +2975,9 @@ function useFindReplace({
|
|
|
3077
2975
|
}, [findResults, applyReplacements, performFind]);
|
|
3078
2976
|
react.useEffect(() => {
|
|
3079
2977
|
const handler = (event) => {
|
|
3080
|
-
const { action } =
|
|
2978
|
+
const { action } = chunkDCNHUEWQ_js.mapEditorKey(event, {
|
|
3081
2979
|
canEdit: mode === "edit",
|
|
3082
|
-
isTextInputTarget:
|
|
2980
|
+
isTextInputTarget: chunkDCNHUEWQ_js.isEditorTextInputTarget(event.target)
|
|
3083
2981
|
});
|
|
3084
2982
|
if (action !== "find") {
|
|
3085
2983
|
return;
|
|
@@ -3190,7 +3088,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId, ment
|
|
|
3190
3088
|
if (!slide) {
|
|
3191
3089
|
return { slides, didAdd: false };
|
|
3192
3090
|
}
|
|
3193
|
-
const next =
|
|
3091
|
+
const next = chunkDCNHUEWQ_js.addCommentToList(
|
|
3194
3092
|
slide.comments || [],
|
|
3195
3093
|
text,
|
|
3196
3094
|
authorName,
|
|
@@ -3211,7 +3109,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
|
3211
3109
|
if (!slide) {
|
|
3212
3110
|
return { slides, didDelete: false };
|
|
3213
3111
|
}
|
|
3214
|
-
const next =
|
|
3112
|
+
const next = chunkDCNHUEWQ_js.removeCommentFromList(slide.comments || [], commentId);
|
|
3215
3113
|
if (!next) {
|
|
3216
3114
|
return { slides, didDelete: false };
|
|
3217
3115
|
}
|
|
@@ -3222,7 +3120,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
|
3222
3120
|
if (!slide) {
|
|
3223
3121
|
return { slides, didUpdate: false };
|
|
3224
3122
|
}
|
|
3225
|
-
const next =
|
|
3123
|
+
const next = chunkDCNHUEWQ_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
3226
3124
|
if (!next) {
|
|
3227
3125
|
return { slides, didUpdate: false };
|
|
3228
3126
|
}
|
|
@@ -3233,7 +3131,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
|
3233
3131
|
if (!slide) {
|
|
3234
3132
|
return { slides, didUpdate: false };
|
|
3235
3133
|
}
|
|
3236
|
-
const next =
|
|
3134
|
+
const next = chunkDCNHUEWQ_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
3237
3135
|
if (!next) {
|
|
3238
3136
|
return { slides, didUpdate: false };
|
|
3239
3137
|
}
|
|
@@ -3244,7 +3142,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName, mention
|
|
|
3244
3142
|
if (!slide) {
|
|
3245
3143
|
return { slides, didAdd: false };
|
|
3246
3144
|
}
|
|
3247
|
-
const next =
|
|
3145
|
+
const next = chunkDCNHUEWQ_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
3248
3146
|
if (!next) {
|
|
3249
3147
|
return { slides, didAdd: false };
|
|
3250
3148
|
}
|
|
@@ -3631,7 +3529,7 @@ function useDerivedElementState(input) {
|
|
|
3631
3529
|
return [];
|
|
3632
3530
|
}
|
|
3633
3531
|
return [
|
|
3634
|
-
...
|
|
3532
|
+
...chunkDCNHUEWQ_js.visibleTemplateElements(activeSlide, templateElementsBySlideId[activeSlide.id] ?? [])
|
|
3635
3533
|
];
|
|
3636
3534
|
}, [activeSlide, templateElementsBySlideId]);
|
|
3637
3535
|
const activeMaster = slideMasters[activeMasterIndex];
|
|
@@ -3698,7 +3596,7 @@ function useViewerCoreState(_input) {
|
|
|
3698
3596
|
const marqueeStateRef = react.useRef(null);
|
|
3699
3597
|
const isDrawingRef = react.useRef(false);
|
|
3700
3598
|
const justInteractedRef = react.useRef(false);
|
|
3701
|
-
const livePatcher = react.useMemo(() =>
|
|
3599
|
+
const livePatcher = react.useMemo(() => chunkDCNHUEWQ_js.createCollaborationLivePatcher(), []);
|
|
3702
3600
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3703
3601
|
const slidesRef = react.useRef([]);
|
|
3704
3602
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3707,8 +3605,8 @@ function useViewerCoreState(_input) {
|
|
|
3707
3605
|
const [slides, setSlides] = react.useState([]);
|
|
3708
3606
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3709
3607
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3710
|
-
width:
|
|
3711
|
-
height:
|
|
3608
|
+
width: chunkVIFDZIVX_js.DEFAULT_CANVAS_WIDTH,
|
|
3609
|
+
height: chunkVIFDZIVX_js.DEFAULT_CANVAS_HEIGHT
|
|
3712
3610
|
});
|
|
3713
3611
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3714
3612
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3729,7 +3627,7 @@ function useViewerCoreState(_input) {
|
|
|
3729
3627
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3730
3628
|
inlineEditingTextRef.current = resolved;
|
|
3731
3629
|
setInlineEditingTextBase(value);
|
|
3732
|
-
|
|
3630
|
+
chunkDCNHUEWQ_js.publishLiveInlineText(
|
|
3733
3631
|
livePatcher,
|
|
3734
3632
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3735
3633
|
inlineEditingElementIdRef.current,
|
|
@@ -4083,7 +3981,7 @@ function useLoadContent({
|
|
|
4083
3981
|
);
|
|
4084
3982
|
}
|
|
4085
3983
|
const previousHandler = handlerRef.current;
|
|
4086
|
-
const handler = new
|
|
3984
|
+
const handler = new chunkDCNHUEWQ_js.PptxHandler();
|
|
4087
3985
|
const parsed = await handler.load(buffer, { allowExternalImages });
|
|
4088
3986
|
if (cancelled || token !== renderTokenRef.current) {
|
|
4089
3987
|
handler.dispose();
|
|
@@ -4095,7 +3993,7 @@ function useLoadContent({
|
|
|
4095
3993
|
handlerRef.current = null;
|
|
4096
3994
|
const mediaElements = [];
|
|
4097
3995
|
for (const slide of parsed.slides) {
|
|
4098
|
-
|
|
3996
|
+
chunkDCNHUEWQ_js.collectMediaElements(slide.elements, mediaElements);
|
|
4099
3997
|
}
|
|
4100
3998
|
for (const url of mediaDataUrls.values()) {
|
|
4101
3999
|
if (url.startsWith("blob:")) {
|
|
@@ -4105,7 +4003,7 @@ function useLoadContent({
|
|
|
4105
4003
|
mediaDataUrls.clear();
|
|
4106
4004
|
await Promise.all(
|
|
4107
4005
|
mediaElements.map(async (mediaElement) => {
|
|
4108
|
-
const resolved = await
|
|
4006
|
+
const resolved = await chunkDCNHUEWQ_js.resolveMediaElementSource(mediaElement, handler);
|
|
4109
4007
|
if (resolved.missing || !resolved.mediaPath || !resolved.url) {
|
|
4110
4008
|
mediaElement.mediaMissing = true;
|
|
4111
4009
|
return;
|
|
@@ -4116,7 +4014,7 @@ function useLoadContent({
|
|
|
4116
4014
|
}
|
|
4117
4015
|
})
|
|
4118
4016
|
);
|
|
4119
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
4017
|
+
const { paths: imagePaths, refs: imageRefs } = chunkDCNHUEWQ_js.collectImagePaths(parsed.slides);
|
|
4120
4018
|
let nextSlides = parsed.slides;
|
|
4121
4019
|
if (imagePaths.size > 0) {
|
|
4122
4020
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -4132,25 +4030,25 @@ function useLoadContent({
|
|
|
4132
4030
|
})
|
|
4133
4031
|
);
|
|
4134
4032
|
nextSlides = parsed.slides.map((s) => {
|
|
4135
|
-
const newElements =
|
|
4033
|
+
const newElements = chunkDCNHUEWQ_js.applyImagePathPatches(s.elements, resolvedMap, imageRefs);
|
|
4136
4034
|
return newElements === s.elements ? s : { ...s, elements: newElements };
|
|
4137
4035
|
});
|
|
4138
4036
|
}
|
|
4139
|
-
nextSlides = await
|
|
4037
|
+
nextSlides = await chunkDCNHUEWQ_js.resolveTableCellImageUrls(
|
|
4140
4038
|
nextSlides,
|
|
4141
4039
|
(path) => handler.getImageData(path)
|
|
4142
4040
|
);
|
|
4143
|
-
const nextTableStyleMap = await
|
|
4041
|
+
const nextTableStyleMap = await chunkDCNHUEWQ_js.resolveTableStyleImageUrls(
|
|
4144
4042
|
parsed.tableStyleMap,
|
|
4145
4043
|
(path) => handler.getImageData(path)
|
|
4146
4044
|
);
|
|
4147
4045
|
handlerRef.current = handler;
|
|
4148
|
-
const partition =
|
|
4046
|
+
const partition = chunkDCNHUEWQ_js.partitionTemplateElements(nextSlides);
|
|
4149
4047
|
setSlides(partition.slides);
|
|
4150
4048
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4151
4049
|
setCanvasSize({
|
|
4152
|
-
width: parsed.width ??
|
|
4153
|
-
height: parsed.height ??
|
|
4050
|
+
width: parsed.width ?? chunkVIFDZIVX_js.DEFAULT_CANVAS_WIDTH,
|
|
4051
|
+
height: parsed.height ?? chunkVIFDZIVX_js.DEFAULT_CANVAS_HEIGHT
|
|
4154
4052
|
});
|
|
4155
4053
|
setSlideSizeEmu(
|
|
4156
4054
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4163,13 +4061,13 @@ function useLoadContent({
|
|
|
4163
4061
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
4164
4062
|
setSlideMasters(parsed.slideMasters ?? []);
|
|
4165
4063
|
setModernCommentAuthors(parsed.modernCommentAuthors ?? []);
|
|
4166
|
-
setRecentColors(
|
|
4064
|
+
setRecentColors(chunkDCNHUEWQ_js.seedRecentColors({ mruColors: parsed.mruColors }));
|
|
4167
4065
|
setTheme(parsed.theme);
|
|
4168
4066
|
setTableStyleMap(nextTableStyleMap);
|
|
4169
4067
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
4170
4068
|
setCustomShows(parsed.customShows ?? []);
|
|
4171
4069
|
setActiveCustomShowId(
|
|
4172
|
-
|
|
4070
|
+
chunkDCNHUEWQ_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
4173
4071
|
);
|
|
4174
4072
|
setSections(parsed.sections ?? []);
|
|
4175
4073
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -4192,10 +4090,10 @@ function useLoadContent({
|
|
|
4192
4090
|
setHasMacros(parsed.hasMacros === true);
|
|
4193
4091
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4194
4092
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4195
|
-
setGuides(
|
|
4196
|
-
setReadOnlyRecommendation(
|
|
4093
|
+
setGuides(chunkDCNHUEWQ_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4094
|
+
setReadOnlyRecommendation(chunkDCNHUEWQ_js.readOnlyRecommendation(parsed));
|
|
4197
4095
|
setCompatToasts(
|
|
4198
|
-
|
|
4096
|
+
chunkDCNHUEWQ_js.compatibilityWarningToasts([
|
|
4199
4097
|
...parsed.warnings ?? [],
|
|
4200
4098
|
...parsed.slides.flatMap((slide) => slide.warnings ?? [])
|
|
4201
4099
|
])
|
|
@@ -4207,7 +4105,7 @@ function useLoadContent({
|
|
|
4207
4105
|
onContentApplied?.();
|
|
4208
4106
|
} catch (err) {
|
|
4209
4107
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4210
|
-
if (err instanceof
|
|
4108
|
+
if (err instanceof chunkDCNHUEWQ_js.EncryptedFileError) {
|
|
4211
4109
|
setIsEncrypted(true);
|
|
4212
4110
|
} else {
|
|
4213
4111
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4235,7 +4133,7 @@ function useLoadContent({
|
|
|
4235
4133
|
}
|
|
4236
4134
|
function useAutosave(input) {
|
|
4237
4135
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4238
|
-
const intervalMs =
|
|
4136
|
+
const intervalMs = chunkDCNHUEWQ_js.resolveAutosaveIntervalMs({
|
|
4239
4137
|
hostIntervalMs: input.intervalMs,
|
|
4240
4138
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4241
4139
|
});
|
|
@@ -4266,7 +4164,7 @@ function useAutosave(input) {
|
|
|
4266
4164
|
return;
|
|
4267
4165
|
}
|
|
4268
4166
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4269
|
-
if (!
|
|
4167
|
+
if (!chunkDCNHUEWQ_js.shouldWriteAutosaveSnapshot({
|
|
4270
4168
|
filePath: path,
|
|
4271
4169
|
isDirty: isDirtyRef.current,
|
|
4272
4170
|
saving: isSavingRef.current,
|
|
@@ -4284,8 +4182,8 @@ function useAutosave(input) {
|
|
|
4284
4182
|
isSavingRef.current = false;
|
|
4285
4183
|
return;
|
|
4286
4184
|
}
|
|
4287
|
-
await
|
|
4288
|
-
lastSnapshotRef.current =
|
|
4185
|
+
await chunkDCNHUEWQ_js.saveAutosaveSnapshot(path, data);
|
|
4186
|
+
lastSnapshotRef.current = chunkDCNHUEWQ_js.autosaveSnapshotMark(path, sources);
|
|
4289
4187
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4290
4188
|
} catch (err) {
|
|
4291
4189
|
setAutosaveStatus({
|
|
@@ -4339,13 +4237,13 @@ function useElementOperations(input) {
|
|
|
4339
4237
|
inlineEditingText
|
|
4340
4238
|
} = input;
|
|
4341
4239
|
const liveTextSegments = react.useCallback(() => {
|
|
4342
|
-
if (!selectedElement || !
|
|
4240
|
+
if (!selectedElement || !chunkDCNHUEWQ_js.hasTextProperties(selectedElement)) {
|
|
4343
4241
|
return void 0;
|
|
4344
4242
|
}
|
|
4345
4243
|
if (selectedElement.id !== inlineEditingElementId) {
|
|
4346
4244
|
return selectedElement.textSegments;
|
|
4347
4245
|
}
|
|
4348
|
-
return
|
|
4246
|
+
return chunkDCNHUEWQ_js.remapTextToSegments(
|
|
4349
4247
|
inlineEditingText,
|
|
4350
4248
|
selectedElement.textSegments,
|
|
4351
4249
|
selectedElement.textStyle
|
|
@@ -4386,11 +4284,11 @@ function useElementOperations(input) {
|
|
|
4386
4284
|
(elementId, updates) => {
|
|
4387
4285
|
if (masterView?.target) {
|
|
4388
4286
|
applyMasterViewWrite(
|
|
4389
|
-
|
|
4287
|
+
chunkDCNHUEWQ_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4390
4288
|
);
|
|
4391
4289
|
return;
|
|
4392
4290
|
}
|
|
4393
|
-
if (
|
|
4291
|
+
if (chunkDCNHUEWQ_js.isTemplateElementId(elementId)) {
|
|
4394
4292
|
const slideId = activeSlide?.id;
|
|
4395
4293
|
if (slideId) {
|
|
4396
4294
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4401,7 +4299,7 @@ function useElementOperations(input) {
|
|
|
4401
4299
|
}));
|
|
4402
4300
|
}
|
|
4403
4301
|
} else {
|
|
4404
|
-
setSlides((prev) =>
|
|
4302
|
+
setSlides((prev) => chunkDCNHUEWQ_js.updateElement(prev, activeSlideIndex, elementId, updates));
|
|
4405
4303
|
}
|
|
4406
4304
|
history.markDirty();
|
|
4407
4305
|
},
|
|
@@ -4426,7 +4324,7 @@ function useElementOperations(input) {
|
|
|
4426
4324
|
);
|
|
4427
4325
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4428
4326
|
(updates) => {
|
|
4429
|
-
if (!selectedElement || !
|
|
4327
|
+
if (!selectedElement || !chunkDCNHUEWQ_js.hasShapeProperties(selectedElement)) {
|
|
4430
4328
|
return;
|
|
4431
4329
|
}
|
|
4432
4330
|
updateSelectedElement({
|
|
@@ -4437,19 +4335,19 @@ function useElementOperations(input) {
|
|
|
4437
4335
|
);
|
|
4438
4336
|
const updateSelectedTextStyle = react.useCallback(
|
|
4439
4337
|
(updates) => {
|
|
4440
|
-
if (!selectedElement || !
|
|
4338
|
+
if (!selectedElement || !chunkDCNHUEWQ_js.hasTextProperties(selectedElement)) {
|
|
4441
4339
|
return;
|
|
4442
4340
|
}
|
|
4443
4341
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4444
4342
|
const currentSegments = liveTextSegments();
|
|
4445
|
-
const inlineSel =
|
|
4343
|
+
const inlineSel = chunkDCNHUEWQ_js.getInlineEditorSelection(currentSegments);
|
|
4446
4344
|
if (inlineSel && currentSegments) {
|
|
4447
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4345
|
+
const { newSegments: newSegments2, newSelection } = chunkDCNHUEWQ_js.applyStyleToSelectedSegments(
|
|
4448
4346
|
currentSegments,
|
|
4449
4347
|
inlineSel,
|
|
4450
4348
|
updates
|
|
4451
4349
|
);
|
|
4452
|
-
|
|
4350
|
+
chunkDCNHUEWQ_js.setPendingSelectionRestore(newSelection);
|
|
4453
4351
|
updateSelectedElement({
|
|
4454
4352
|
textSegments: newSegments2,
|
|
4455
4353
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4477,14 +4375,14 @@ function useElementOperations(input) {
|
|
|
4477
4375
|
);
|
|
4478
4376
|
const updateSelectedTextCase = react.useCallback(
|
|
4479
4377
|
(mode) => {
|
|
4480
|
-
if (!selectedElement || !
|
|
4378
|
+
if (!selectedElement || !chunkDCNHUEWQ_js.hasTextProperties(selectedElement)) {
|
|
4481
4379
|
return;
|
|
4482
4380
|
}
|
|
4483
4381
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4484
4382
|
const currentSegments = liveTextSegments();
|
|
4485
|
-
const inlineSel =
|
|
4383
|
+
const inlineSel = chunkDCNHUEWQ_js.getInlineEditorSelection(currentSegments);
|
|
4486
4384
|
if (inlineSel && currentSegments) {
|
|
4487
|
-
const newSegments =
|
|
4385
|
+
const newSegments = chunkDCNHUEWQ_js.applyCaseTransformToSegments(currentSegments, inlineSel, mode);
|
|
4488
4386
|
updateSelectedElement({
|
|
4489
4387
|
textSegments: newSegments,
|
|
4490
4388
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4493,7 +4391,7 @@ function useElementOperations(input) {
|
|
|
4493
4391
|
}
|
|
4494
4392
|
const updates = {};
|
|
4495
4393
|
if (currentSegments && currentSegments.length > 0) {
|
|
4496
|
-
updates.textSegments =
|
|
4394
|
+
updates.textSegments = chunkDCNHUEWQ_js.applyCaseTransformToSegments(
|
|
4497
4395
|
currentSegments,
|
|
4498
4396
|
null,
|
|
4499
4397
|
mode
|
|
@@ -4501,7 +4399,7 @@ function useElementOperations(input) {
|
|
|
4501
4399
|
}
|
|
4502
4400
|
const baseText = isLiveEditing ? inlineEditingText : selectedElement.text;
|
|
4503
4401
|
if (typeof baseText === "string") {
|
|
4504
|
-
updates.text =
|
|
4402
|
+
updates.text = chunkDCNHUEWQ_js.transformTextCase(baseText, mode);
|
|
4505
4403
|
}
|
|
4506
4404
|
updateSelectedElement(updates);
|
|
4507
4405
|
},
|
|
@@ -4520,15 +4418,15 @@ function useElementOperations(input) {
|
|
|
4520
4418
|
[setSlides]
|
|
4521
4419
|
);
|
|
4522
4420
|
const masterViewTarget = masterView?.target ?? null;
|
|
4523
|
-
const activeElements = masterViewTarget ?
|
|
4421
|
+
const activeElements = masterViewTarget ? chunkDCNHUEWQ_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4524
4422
|
const updateActiveElements = react.useCallback(
|
|
4525
4423
|
(updater) => {
|
|
4526
4424
|
if (masterView?.target) {
|
|
4527
4425
|
applyMasterViewWrite(
|
|
4528
|
-
|
|
4426
|
+
chunkDCNHUEWQ_js.replaceMasterViewElements(
|
|
4529
4427
|
masterView,
|
|
4530
4428
|
masterView.target,
|
|
4531
|
-
updater(
|
|
4429
|
+
updater(chunkDCNHUEWQ_js.masterViewElements(masterView, masterView.target))
|
|
4532
4430
|
)
|
|
4533
4431
|
);
|
|
4534
4432
|
return;
|
|
@@ -4581,7 +4479,7 @@ function useSectionOperations(input) {
|
|
|
4581
4479
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4582
4480
|
const addSection2 = react.useCallback(
|
|
4583
4481
|
(name, afterSlideIndex) => {
|
|
4584
|
-
const result =
|
|
4482
|
+
const result = chunkDCNHUEWQ_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4585
4483
|
setSlides(result.slides);
|
|
4586
4484
|
setSections(result.sections);
|
|
4587
4485
|
markDirty();
|
|
@@ -4590,7 +4488,7 @@ function useSectionOperations(input) {
|
|
|
4590
4488
|
);
|
|
4591
4489
|
const renameSection2 = react.useCallback(
|
|
4592
4490
|
(sectionId, newName) => {
|
|
4593
|
-
const result =
|
|
4491
|
+
const result = chunkDCNHUEWQ_js.renameSection(sections, slides, sectionId, newName);
|
|
4594
4492
|
setSections(result.sections);
|
|
4595
4493
|
setSlides(result.slides);
|
|
4596
4494
|
markDirty();
|
|
@@ -4599,7 +4497,7 @@ function useSectionOperations(input) {
|
|
|
4599
4497
|
);
|
|
4600
4498
|
const deleteSection2 = react.useCallback(
|
|
4601
4499
|
(sectionId) => {
|
|
4602
|
-
const result =
|
|
4500
|
+
const result = chunkDCNHUEWQ_js.deleteSection(sections, slides, sectionId);
|
|
4603
4501
|
setSections(result.sections);
|
|
4604
4502
|
setSlides(result.slides);
|
|
4605
4503
|
markDirty();
|
|
@@ -4608,21 +4506,21 @@ function useSectionOperations(input) {
|
|
|
4608
4506
|
);
|
|
4609
4507
|
const moveSectionUp2 = react.useCallback(
|
|
4610
4508
|
(sectionId) => {
|
|
4611
|
-
setSections(
|
|
4509
|
+
setSections(chunkDCNHUEWQ_js.moveSectionUp(sections, sectionId));
|
|
4612
4510
|
markDirty();
|
|
4613
4511
|
},
|
|
4614
4512
|
[sections, setSections, markDirty]
|
|
4615
4513
|
);
|
|
4616
4514
|
const moveSectionDown2 = react.useCallback(
|
|
4617
4515
|
(sectionId) => {
|
|
4618
|
-
setSections(
|
|
4516
|
+
setSections(chunkDCNHUEWQ_js.moveSectionDown(sections, sectionId));
|
|
4619
4517
|
markDirty();
|
|
4620
4518
|
},
|
|
4621
4519
|
[sections, setSections, markDirty]
|
|
4622
4520
|
);
|
|
4623
4521
|
const moveSlidesToSection2 = react.useCallback(
|
|
4624
4522
|
(slideIndexes, targetSectionId) => {
|
|
4625
|
-
const result =
|
|
4523
|
+
const result = chunkDCNHUEWQ_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4626
4524
|
setSlides(result.slides);
|
|
4627
4525
|
setSections(result.sections);
|
|
4628
4526
|
markDirty();
|
|
@@ -4688,15 +4586,15 @@ function syncSelectionHandleOverlay(elementNode, elementId, geometry) {
|
|
|
4688
4586
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4689
4587
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
|
|
4690
4588
|
const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
|
|
4691
|
-
let resized =
|
|
4589
|
+
let resized = chunkDCNHUEWQ_js.applyResize(startBox, handle, dx, dy, 1, { minSize: chunkVIFDZIVX_js.MIN_ELEMENT_SIZE });
|
|
4692
4590
|
if (lockAspect) {
|
|
4693
|
-
resized =
|
|
4591
|
+
resized = chunkDCNHUEWQ_js.lockResizeAspect(resized, startBox, handle, chunkVIFDZIVX_js.MIN_ELEMENT_SIZE);
|
|
4694
4592
|
}
|
|
4695
4593
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4696
4594
|
if (!snapToGrid) {
|
|
4697
4595
|
return box;
|
|
4698
4596
|
}
|
|
4699
|
-
return
|
|
4597
|
+
return chunkDCNHUEWQ_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkVIFDZIVX_js.MIN_ELEMENT_SIZE);
|
|
4700
4598
|
}
|
|
4701
4599
|
function resolveLiveTarget(input) {
|
|
4702
4600
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4809,7 +4707,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4809
4707
|
width: el.width,
|
|
4810
4708
|
height: el.height
|
|
4811
4709
|
}));
|
|
4812
|
-
const snapResult =
|
|
4710
|
+
const snapResult = chunkDCNHUEWQ_js.computeSnapToShape(
|
|
4813
4711
|
targetX,
|
|
4814
4712
|
targetY,
|
|
4815
4713
|
primaryEl.width,
|
|
@@ -4851,7 +4749,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4851
4749
|
if (live) {
|
|
4852
4750
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4853
4751
|
const start = drag.startPositionsById[id];
|
|
4854
|
-
|
|
4752
|
+
chunkDCNHUEWQ_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4855
4753
|
x: start.x + appliedDx,
|
|
4856
4754
|
y: start.y + appliedDy
|
|
4857
4755
|
});
|
|
@@ -4883,8 +4781,8 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4883
4781
|
rs.lastY = geo.y;
|
|
4884
4782
|
rs.lastWidth = geo.width;
|
|
4885
4783
|
rs.lastHeight = geo.height;
|
|
4886
|
-
const width = Math.max(geo.width,
|
|
4887
|
-
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);
|
|
4888
4786
|
if (rs.domEl) {
|
|
4889
4787
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4890
4788
|
rs.domEl.style.top = `${geo.y}px`;
|
|
@@ -4893,7 +4791,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4893
4791
|
syncSelectionHandleOverlay(rs.domEl, rs.elementId, { x: geo.x, y: geo.y, width, height });
|
|
4894
4792
|
}
|
|
4895
4793
|
if (live) {
|
|
4896
|
-
|
|
4794
|
+
chunkDCNHUEWQ_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4897
4795
|
x: geo.x,
|
|
4898
4796
|
y: geo.y,
|
|
4899
4797
|
width,
|
|
@@ -4904,7 +4802,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4904
4802
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4905
4803
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4906
4804
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4907
|
-
const adjustments =
|
|
4805
|
+
const adjustments = chunkDCNHUEWQ_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4908
4806
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4909
4807
|
adj.moved = true;
|
|
4910
4808
|
}
|
|
@@ -4979,13 +4877,13 @@ function processPointerUp(input) {
|
|
|
4979
4877
|
if (i !== activeSlideIndex) {
|
|
4980
4878
|
return s;
|
|
4981
4879
|
}
|
|
4982
|
-
const rerouted =
|
|
4880
|
+
const rerouted = chunkDCNHUEWQ_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4983
4881
|
if (rerouted.length === 0) {
|
|
4984
4882
|
return s;
|
|
4985
4883
|
}
|
|
4986
4884
|
return {
|
|
4987
4885
|
...s,
|
|
4988
|
-
elements:
|
|
4886
|
+
elements: chunkDCNHUEWQ_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4989
4887
|
};
|
|
4990
4888
|
})
|
|
4991
4889
|
);
|
|
@@ -5010,9 +4908,9 @@ function processPointerUp(input) {
|
|
|
5010
4908
|
}
|
|
5011
4909
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
5012
4910
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
5013
|
-
const hitIds =
|
|
4911
|
+
const hitIds = chunkDCNHUEWQ_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
5014
4912
|
if (marquee.additive) {
|
|
5015
|
-
const merged =
|
|
4913
|
+
const merged = chunkDCNHUEWQ_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
5016
4914
|
if (merged.length > 0) {
|
|
5017
4915
|
applySelection(merged[0], merged);
|
|
5018
4916
|
} else {
|
|
@@ -5035,8 +4933,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
5035
4933
|
}
|
|
5036
4934
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
5037
4935
|
});
|
|
5038
|
-
const rerouted =
|
|
5039
|
-
return
|
|
4936
|
+
const rerouted = chunkDCNHUEWQ_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4937
|
+
return chunkDCNHUEWQ_js.applyReroutedConnectors(movedElements, rerouted);
|
|
5040
4938
|
};
|
|
5041
4939
|
if (editTemplateMode) {
|
|
5042
4940
|
const slideId = activeSlide?.id;
|
|
@@ -5192,12 +5090,12 @@ function useCanvasInteractions(input) {
|
|
|
5192
5090
|
return;
|
|
5193
5091
|
}
|
|
5194
5092
|
const el = elementLookup.get(editId);
|
|
5195
|
-
if (el &&
|
|
5093
|
+
if (el && chunkDCNHUEWQ_js.hasTextProperties(el)) {
|
|
5196
5094
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
5197
|
-
const newSegments =
|
|
5095
|
+
const newSegments = chunkDCNHUEWQ_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
5198
5096
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
5199
|
-
const newHeight =
|
|
5200
|
-
const shrink =
|
|
5097
|
+
const newHeight = chunkDCNHUEWQ_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
5098
|
+
const shrink = chunkDCNHUEWQ_js.resolveInlineEditNormAutofitShrink(el.textStyle, el.height, editorEl);
|
|
5201
5099
|
ops.updateElementById(editId, {
|
|
5202
5100
|
text: committedText,
|
|
5203
5101
|
textSegments: newSegments,
|
|
@@ -5216,7 +5114,7 @@ function useCanvasInteractions(input) {
|
|
|
5216
5114
|
setInlineEditingText("");
|
|
5217
5115
|
};
|
|
5218
5116
|
const openEquationEditorForElement = (el) => {
|
|
5219
|
-
if (!
|
|
5117
|
+
if (!chunkDCNHUEWQ_js.hasTextProperties(el)) {
|
|
5220
5118
|
return false;
|
|
5221
5119
|
}
|
|
5222
5120
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5246,7 +5144,7 @@ function useCanvasInteractions(input) {
|
|
|
5246
5144
|
justInteractedRef.current = false;
|
|
5247
5145
|
} else {
|
|
5248
5146
|
const el = elementLookup.get(elementId);
|
|
5249
|
-
if (el &&
|
|
5147
|
+
if (el && chunkDCNHUEWQ_js.hasTextProperties(el) && chunkDCNHUEWQ_js.canInteractWithElement(el, "textEdit")) {
|
|
5250
5148
|
if (!openEquationEditorForElement(el)) {
|
|
5251
5149
|
setInlineEditingElementId(elementId);
|
|
5252
5150
|
setInlineEditingText(el.text ?? "");
|
|
@@ -5265,7 +5163,7 @@ function useCanvasInteractions(input) {
|
|
|
5265
5163
|
if (openEquationEditorForElement(el)) {
|
|
5266
5164
|
return;
|
|
5267
5165
|
}
|
|
5268
|
-
if (
|
|
5166
|
+
if (chunkDCNHUEWQ_js.hasTextProperties(el) && chunkDCNHUEWQ_js.canInteractWithElement(el, "textEdit")) {
|
|
5269
5167
|
setInlineEditingElementId(elementId);
|
|
5270
5168
|
setInlineEditingText(el.text ?? "");
|
|
5271
5169
|
}
|
|
@@ -5288,7 +5186,7 @@ function useCanvasInteractions(input) {
|
|
|
5288
5186
|
justSelectedRef.current = false;
|
|
5289
5187
|
}
|
|
5290
5188
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
5291
|
-
const movableIds =
|
|
5189
|
+
const movableIds = chunkDCNHUEWQ_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
5292
5190
|
if (movableIds.length === 0) {
|
|
5293
5191
|
return;
|
|
5294
5192
|
}
|
|
@@ -5358,7 +5256,7 @@ function useCanvasInteractions(input) {
|
|
|
5358
5256
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5359
5257
|
e.stopPropagation();
|
|
5360
5258
|
const el = elementLookup.get(elementId);
|
|
5361
|
-
if (!el || !
|
|
5259
|
+
if (!el || !chunkDCNHUEWQ_js.canInteractWithElement(el, "resize")) {
|
|
5362
5260
|
return;
|
|
5363
5261
|
}
|
|
5364
5262
|
resizeStateRef.current = {
|
|
@@ -5380,7 +5278,7 @@ function useCanvasInteractions(input) {
|
|
|
5380
5278
|
};
|
|
5381
5279
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5382
5280
|
const el = elementLookup.get(elementId);
|
|
5383
|
-
if (!el || !
|
|
5281
|
+
if (!el || !chunkDCNHUEWQ_js.canInteractWithElement(el, "rotate")) {
|
|
5384
5282
|
return;
|
|
5385
5283
|
}
|
|
5386
5284
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5400,10 +5298,10 @@ function useCanvasInteractions(input) {
|
|
|
5400
5298
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5401
5299
|
e.stopPropagation();
|
|
5402
5300
|
const el = elementLookup.get(elementId);
|
|
5403
|
-
if (!el || !
|
|
5301
|
+
if (!el || !chunkDCNHUEWQ_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5404
5302
|
return;
|
|
5405
5303
|
}
|
|
5406
|
-
shapeAdjustmentDragStateRef.current =
|
|
5304
|
+
shapeAdjustmentDragStateRef.current = chunkDCNHUEWQ_js.beginShapeAdjustment(
|
|
5407
5305
|
el,
|
|
5408
5306
|
descriptor,
|
|
5409
5307
|
e.clientX,
|
|
@@ -5450,7 +5348,7 @@ function createFileHandlers(deps) {
|
|
|
5450
5348
|
h = Math.round(h * scale);
|
|
5451
5349
|
}
|
|
5452
5350
|
addElement({
|
|
5453
|
-
id:
|
|
5351
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
5454
5352
|
type: "image",
|
|
5455
5353
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5456
5354
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5461,7 +5359,7 @@ function createFileHandlers(deps) {
|
|
|
5461
5359
|
};
|
|
5462
5360
|
img.onerror = () => {
|
|
5463
5361
|
addElement({
|
|
5464
|
-
id:
|
|
5362
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
5465
5363
|
type: "image",
|
|
5466
5364
|
x: 100,
|
|
5467
5365
|
y: 100,
|
|
@@ -5480,14 +5378,14 @@ function createFileHandlers(deps) {
|
|
|
5480
5378
|
return;
|
|
5481
5379
|
}
|
|
5482
5380
|
e.target.value = "";
|
|
5483
|
-
const mediaType =
|
|
5381
|
+
const mediaType = chunkDCNHUEWQ_js.classifyMediaType(file.type);
|
|
5484
5382
|
if (!mediaType) {
|
|
5485
5383
|
return;
|
|
5486
5384
|
}
|
|
5487
5385
|
const elFilePath = file.path;
|
|
5488
5386
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5489
5387
|
addElement({
|
|
5490
|
-
id:
|
|
5388
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
5491
5389
|
type: "media",
|
|
5492
5390
|
mediaType,
|
|
5493
5391
|
mediaMimeType: file.type || void 0,
|
|
@@ -5662,13 +5560,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5662
5560
|
return;
|
|
5663
5561
|
}
|
|
5664
5562
|
addElement({
|
|
5665
|
-
id:
|
|
5563
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
5666
5564
|
type: "smartArt",
|
|
5667
5565
|
x: 100,
|
|
5668
5566
|
y: 120,
|
|
5669
5567
|
width: 600,
|
|
5670
5568
|
height: 340,
|
|
5671
|
-
smartArtData:
|
|
5569
|
+
smartArtData: chunkDCNHUEWQ_js.buildSmartArtPresetData(
|
|
5672
5570
|
layout,
|
|
5673
5571
|
defaultItems,
|
|
5674
5572
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5680,7 +5578,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5680
5578
|
return;
|
|
5681
5579
|
}
|
|
5682
5580
|
addElement({
|
|
5683
|
-
id:
|
|
5581
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
5684
5582
|
type: "shape",
|
|
5685
5583
|
x: 120,
|
|
5686
5584
|
y: 200,
|
|
@@ -5718,7 +5616,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5718
5616
|
return;
|
|
5719
5617
|
}
|
|
5720
5618
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5721
|
-
if (resolved.url && !
|
|
5619
|
+
if (resolved.url && !chunkDCNHUEWQ_js.isUrlSafe(resolved.url)) {
|
|
5722
5620
|
return;
|
|
5723
5621
|
}
|
|
5724
5622
|
const actionClick = {
|
|
@@ -5742,7 +5640,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5742
5640
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5743
5641
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5744
5642
|
addElement({
|
|
5745
|
-
id:
|
|
5643
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
5746
5644
|
type: "shape",
|
|
5747
5645
|
x: 120,
|
|
5748
5646
|
y: 200,
|
|
@@ -5764,11 +5662,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5764
5662
|
if (!activeSlide) {
|
|
5765
5663
|
return;
|
|
5766
5664
|
}
|
|
5767
|
-
const preset =
|
|
5665
|
+
const preset = chunkDCNHUEWQ_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5768
5666
|
if (!preset) {
|
|
5769
5667
|
return;
|
|
5770
5668
|
}
|
|
5771
|
-
const defaultPptxAction =
|
|
5669
|
+
const defaultPptxAction = chunkDCNHUEWQ_js.elementActionToPptxAction({
|
|
5772
5670
|
trigger: "click",
|
|
5773
5671
|
type: preset.defaultAction
|
|
5774
5672
|
});
|
|
@@ -5777,7 +5675,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5777
5675
|
defaultPptxAction.highlightClick = true;
|
|
5778
5676
|
}
|
|
5779
5677
|
addElement({
|
|
5780
|
-
id:
|
|
5678
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
5781
5679
|
type: "shape",
|
|
5782
5680
|
x: 150,
|
|
5783
5681
|
y: 150,
|
|
@@ -5844,14 +5742,14 @@ function useInsertElements(input) {
|
|
|
5844
5742
|
return;
|
|
5845
5743
|
}
|
|
5846
5744
|
addElement({
|
|
5847
|
-
id:
|
|
5745
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
5848
5746
|
type: "text",
|
|
5849
5747
|
x: 100,
|
|
5850
5748
|
y: 100,
|
|
5851
5749
|
width: 300,
|
|
5852
5750
|
height: 60,
|
|
5853
5751
|
text: "",
|
|
5854
|
-
textStyle: { fontSize:
|
|
5752
|
+
textStyle: { fontSize: chunkVIFDZIVX_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5855
5753
|
});
|
|
5856
5754
|
};
|
|
5857
5755
|
const handleAddShape = () => {
|
|
@@ -5859,7 +5757,7 @@ function useInsertElements(input) {
|
|
|
5859
5757
|
return;
|
|
5860
5758
|
}
|
|
5861
5759
|
addElement({
|
|
5862
|
-
id:
|
|
5760
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
5863
5761
|
type: "shape",
|
|
5864
5762
|
x: 150,
|
|
5865
5763
|
y: 150,
|
|
@@ -5878,15 +5776,15 @@ function useInsertElements(input) {
|
|
|
5878
5776
|
return;
|
|
5879
5777
|
}
|
|
5880
5778
|
addElement({
|
|
5881
|
-
...
|
|
5882
|
-
id:
|
|
5779
|
+
...chunkDCNHUEWQ_js.newTableElement(chunkVIFDZIVX_js.DEFAULT_TABLE_ROWS, chunkVIFDZIVX_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5780
|
+
id: chunkDCNHUEWQ_js.generateElementId()
|
|
5883
5781
|
});
|
|
5884
5782
|
};
|
|
5885
5783
|
const handleAddChart = (chartKind) => {
|
|
5886
5784
|
if (!activeSlide) {
|
|
5887
5785
|
return;
|
|
5888
5786
|
}
|
|
5889
|
-
addElement(
|
|
5787
|
+
addElement(chunkDCNHUEWQ_js.createDefaultChartElement(chartKind));
|
|
5890
5788
|
};
|
|
5891
5789
|
const structured = createStructuredElementHandlers({
|
|
5892
5790
|
activeSlide,
|
|
@@ -5956,7 +5854,7 @@ function useClipboardHandlers(input) {
|
|
|
5956
5854
|
if (!selectedElement) {
|
|
5957
5855
|
return;
|
|
5958
5856
|
}
|
|
5959
|
-
setClipboardPayload(
|
|
5857
|
+
setClipboardPayload(chunkDCNHUEWQ_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5960
5858
|
};
|
|
5961
5859
|
const handleDelete = () => {
|
|
5962
5860
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5973,7 +5871,7 @@ function useClipboardHandlers(input) {
|
|
|
5973
5871
|
handleDelete();
|
|
5974
5872
|
};
|
|
5975
5873
|
const insertClone = (source) => {
|
|
5976
|
-
const clone =
|
|
5874
|
+
const clone = chunkDCNHUEWQ_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5977
5875
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5978
5876
|
ops.applySelection(clone.id);
|
|
5979
5877
|
history.markDirty();
|
|
@@ -6008,7 +5906,7 @@ function resolveShapePath(el) {
|
|
|
6008
5906
|
return el.pathData;
|
|
6009
5907
|
}
|
|
6010
5908
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
6011
|
-
const clipPath =
|
|
5909
|
+
const clipPath = chunkDCNHUEWQ_js.getPresetShapeClipPath(el.shapeType);
|
|
6012
5910
|
if (clipPath) {
|
|
6013
5911
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
6014
5912
|
if (svgPath) {
|
|
@@ -6059,7 +5957,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
6059
5957
|
return parts.join(" ");
|
|
6060
5958
|
}
|
|
6061
5959
|
function transformPathToGlobal(pathData, el) {
|
|
6062
|
-
const polys =
|
|
5960
|
+
const polys = chunkDCNHUEWQ_js.svgPathToPolygons(pathData);
|
|
6063
5961
|
if (polys.length === 0) {
|
|
6064
5962
|
return pathData;
|
|
6065
5963
|
}
|
|
@@ -6079,10 +5977,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
6079
5977
|
y: pt.y * scaleY + el.y
|
|
6080
5978
|
}))
|
|
6081
5979
|
);
|
|
6082
|
-
return
|
|
5980
|
+
return chunkDCNHUEWQ_js.polygonsToSvgPath(transformed);
|
|
6083
5981
|
}
|
|
6084
5982
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
6085
|
-
const polys =
|
|
5983
|
+
const polys = chunkDCNHUEWQ_js.svgPathToPolygons(pathData);
|
|
6086
5984
|
if (polys.length === 0) {
|
|
6087
5985
|
return pathData;
|
|
6088
5986
|
}
|
|
@@ -6092,10 +5990,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
6092
5990
|
y: pt.y - y
|
|
6093
5991
|
}))
|
|
6094
5992
|
);
|
|
6095
|
-
return
|
|
5993
|
+
return chunkDCNHUEWQ_js.polygonsToSvgPath(transformed);
|
|
6096
5994
|
}
|
|
6097
5995
|
function pathBounds(pathData) {
|
|
6098
|
-
const polys =
|
|
5996
|
+
const polys = chunkDCNHUEWQ_js.svgPathToPolygons(pathData);
|
|
6099
5997
|
let minX = Infinity;
|
|
6100
5998
|
let minY = Infinity;
|
|
6101
5999
|
let maxX = -Infinity;
|
|
@@ -6154,7 +6052,7 @@ function useMergeShapesHandler(input) {
|
|
|
6154
6052
|
let allFragments = [];
|
|
6155
6053
|
let remaining = globalPaths[0];
|
|
6156
6054
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6157
|
-
const frags =
|
|
6055
|
+
const frags = chunkDCNHUEWQ_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
6158
6056
|
if (Array.isArray(frags)) {
|
|
6159
6057
|
allFragments = frags;
|
|
6160
6058
|
}
|
|
@@ -6183,7 +6081,7 @@ function useMergeShapesHandler(input) {
|
|
|
6183
6081
|
bounds.height
|
|
6184
6082
|
);
|
|
6185
6083
|
const newEl = {
|
|
6186
|
-
id:
|
|
6084
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
6187
6085
|
type: "shape",
|
|
6188
6086
|
x: bounds.x,
|
|
6189
6087
|
y: bounds.y,
|
|
@@ -6221,7 +6119,7 @@ function useMergeShapesHandler(input) {
|
|
|
6221
6119
|
} else {
|
|
6222
6120
|
let resultPath = globalPaths[0];
|
|
6223
6121
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6224
|
-
const result =
|
|
6122
|
+
const result = chunkDCNHUEWQ_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
6225
6123
|
if (typeof result === "string") {
|
|
6226
6124
|
resultPath = result;
|
|
6227
6125
|
}
|
|
@@ -6242,7 +6140,7 @@ function useMergeShapesHandler(input) {
|
|
|
6242
6140
|
);
|
|
6243
6141
|
const primary = targets[0];
|
|
6244
6142
|
const newEl = {
|
|
6245
|
-
id:
|
|
6143
|
+
id: chunkDCNHUEWQ_js.generateElementId(),
|
|
6246
6144
|
type: "shape",
|
|
6247
6145
|
x: bounds.x,
|
|
6248
6146
|
y: bounds.y,
|
|
@@ -6305,10 +6203,10 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6305
6203
|
if (ids.length < 2 || !activeSlide) {
|
|
6306
6204
|
return;
|
|
6307
6205
|
}
|
|
6308
|
-
if (!selectedElements.every((el) =>
|
|
6206
|
+
if (!selectedElements.every((el) => chunkDCNHUEWQ_js.canInteractWithElement(el, "group"))) {
|
|
6309
6207
|
return;
|
|
6310
6208
|
}
|
|
6311
|
-
const { elements, groupId } =
|
|
6209
|
+
const { elements, groupId } = chunkDCNHUEWQ_js.groupElements(ops.activeElements, ids, chunkDCNHUEWQ_js.generateElementId());
|
|
6312
6210
|
if (groupId === null) {
|
|
6313
6211
|
return;
|
|
6314
6212
|
}
|
|
@@ -6320,15 +6218,15 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6320
6218
|
if (!selectedElement || selectedElement.type !== "group" || !activeSlide) {
|
|
6321
6219
|
return;
|
|
6322
6220
|
}
|
|
6323
|
-
if (!
|
|
6221
|
+
if (!chunkDCNHUEWQ_js.canInteractWithElement(selectedElement, "group")) {
|
|
6324
6222
|
return;
|
|
6325
6223
|
}
|
|
6326
6224
|
const group = selectedElement;
|
|
6327
|
-
const intoTemplate =
|
|
6225
|
+
const intoTemplate = chunkDCNHUEWQ_js.isTemplateElementId(group.id);
|
|
6328
6226
|
const childIds = group.children.map(
|
|
6329
|
-
(child) => intoTemplate ?
|
|
6227
|
+
(child) => intoTemplate ? chunkDCNHUEWQ_js.makeCloneId(true, child.id || group.id) : child.id || chunkDCNHUEWQ_js.generateElementId()
|
|
6330
6228
|
);
|
|
6331
|
-
const { elements, childIds: usedIds } =
|
|
6229
|
+
const { elements, childIds: usedIds } = chunkDCNHUEWQ_js.ungroupElements(
|
|
6332
6230
|
ops.activeElements,
|
|
6333
6231
|
group.id,
|
|
6334
6232
|
childIds,
|
|
@@ -6357,7 +6255,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6357
6255
|
if (!edge) {
|
|
6358
6256
|
return;
|
|
6359
6257
|
}
|
|
6360
|
-
const positions =
|
|
6258
|
+
const positions = chunkDCNHUEWQ_js.alignElements(selectedElements, edge);
|
|
6361
6259
|
for (const [id, pos] of positions) {
|
|
6362
6260
|
const el = elementLookup.get(id);
|
|
6363
6261
|
if (!el) {
|
|
@@ -6375,7 +6273,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6375
6273
|
if (!distAxis) {
|
|
6376
6274
|
return;
|
|
6377
6275
|
}
|
|
6378
|
-
const positions =
|
|
6276
|
+
const positions = chunkDCNHUEWQ_js.distributeElements(selectedElements, distAxis);
|
|
6379
6277
|
for (const [id, pos] of positions) {
|
|
6380
6278
|
const el = elementLookup.get(id);
|
|
6381
6279
|
if (!el) {
|
|
@@ -6386,14 +6284,14 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6386
6284
|
history.markDirty();
|
|
6387
6285
|
};
|
|
6388
6286
|
const canDistribute = selectedElements.length >= 3;
|
|
6389
|
-
const selectionGroupable = selectedElements.every((el) =>
|
|
6287
|
+
const selectionGroupable = selectedElements.every((el) => chunkDCNHUEWQ_js.canInteractWithElement(el, "group"));
|
|
6390
6288
|
const handleMoveLayer = (direction) => {
|
|
6391
6289
|
if (!selectedElement || !activeSlide) {
|
|
6392
6290
|
return;
|
|
6393
6291
|
}
|
|
6394
6292
|
const id = selectedElement.id;
|
|
6395
6293
|
ops.updateActiveElements(
|
|
6396
|
-
(els) => direction === "forward" ?
|
|
6294
|
+
(els) => direction === "forward" ? chunkDCNHUEWQ_js.bringForward(els, id) : direction === "backward" ? chunkDCNHUEWQ_js.sendBackward(els, id) : els
|
|
6397
6295
|
);
|
|
6398
6296
|
history.markDirty();
|
|
6399
6297
|
};
|
|
@@ -6403,7 +6301,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6403
6301
|
}
|
|
6404
6302
|
const id = selectedElement.id;
|
|
6405
6303
|
ops.updateActiveElements(
|
|
6406
|
-
(els) => direction === "front" ?
|
|
6304
|
+
(els) => direction === "front" ? chunkDCNHUEWQ_js.bringToFront(els, id) : chunkDCNHUEWQ_js.sendToBack(els, id)
|
|
6407
6305
|
);
|
|
6408
6306
|
history.markDirty();
|
|
6409
6307
|
};
|
|
@@ -6537,7 +6435,7 @@ function useSlideManagement(input) {
|
|
|
6537
6435
|
theme
|
|
6538
6436
|
} = input;
|
|
6539
6437
|
const handleAddSlide = () => {
|
|
6540
|
-
const newSlide =
|
|
6438
|
+
const newSlide = chunkDCNHUEWQ_js.createBlankSlide(slides.length + 1);
|
|
6541
6439
|
ops.updateSlides((prev) => {
|
|
6542
6440
|
const next = [...prev];
|
|
6543
6441
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6600,7 +6498,7 @@ function useSlideManagement(input) {
|
|
|
6600
6498
|
}
|
|
6601
6499
|
const clone = {
|
|
6602
6500
|
...src,
|
|
6603
|
-
id:
|
|
6501
|
+
id: chunkDCNHUEWQ_js.makeSlideId(),
|
|
6604
6502
|
elements: src.elements.map((el) => ({
|
|
6605
6503
|
...el,
|
|
6606
6504
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6632,7 +6530,7 @@ function useSlideManagement(input) {
|
|
|
6632
6530
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6633
6531
|
const insertAt = activeSlideIndex + 1;
|
|
6634
6532
|
const draft = {
|
|
6635
|
-
...
|
|
6533
|
+
...chunkDCNHUEWQ_js.createBlankSlide(slides.length + 1),
|
|
6636
6534
|
layoutPath,
|
|
6637
6535
|
...layoutName ? { layoutName } : {}
|
|
6638
6536
|
};
|
|
@@ -6665,9 +6563,9 @@ function useSlideManagement(input) {
|
|
|
6665
6563
|
};
|
|
6666
6564
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6667
6565
|
const insertAt = activeSlideIndex + 1;
|
|
6668
|
-
const draft =
|
|
6566
|
+
const draft = chunkDCNHUEWQ_js.buildSlideTemplateSlide(templateId, chunkDCNHUEWQ_js.makeSlideId(), slides.length + 1, {
|
|
6669
6567
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6670
|
-
scheme:
|
|
6568
|
+
scheme: chunkDCNHUEWQ_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6671
6569
|
});
|
|
6672
6570
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6673
6571
|
setActiveSlideIndex(insertAt);
|
|
@@ -6704,7 +6602,7 @@ function createTableMergeHandlers(input) {
|
|
|
6704
6602
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6705
6603
|
return;
|
|
6706
6604
|
}
|
|
6707
|
-
const newTableData =
|
|
6605
|
+
const newTableData = chunkDCNHUEWQ_js.mergeCells(
|
|
6708
6606
|
[
|
|
6709
6607
|
{ row: rowIndex, col: columnIndex },
|
|
6710
6608
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6712,7 +6610,7 @@ function createTableMergeHandlers(input) {
|
|
|
6712
6610
|
td
|
|
6713
6611
|
);
|
|
6714
6612
|
const updates = { tableData: newTableData };
|
|
6715
|
-
const newRawXml =
|
|
6613
|
+
const newRawXml = chunkDCNHUEWQ_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6716
6614
|
if (newRawXml) {
|
|
6717
6615
|
updates.rawXml = newRawXml;
|
|
6718
6616
|
}
|
|
@@ -6738,7 +6636,7 @@ function createTableMergeHandlers(input) {
|
|
|
6738
6636
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6739
6637
|
return;
|
|
6740
6638
|
}
|
|
6741
|
-
const newTableData =
|
|
6639
|
+
const newTableData = chunkDCNHUEWQ_js.mergeCells(
|
|
6742
6640
|
[
|
|
6743
6641
|
{ row: rowIndex, col: columnIndex },
|
|
6744
6642
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6746,7 +6644,7 @@ function createTableMergeHandlers(input) {
|
|
|
6746
6644
|
td
|
|
6747
6645
|
);
|
|
6748
6646
|
const updates = { tableData: newTableData };
|
|
6749
|
-
const newRawXml =
|
|
6647
|
+
const newRawXml = chunkDCNHUEWQ_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6750
6648
|
if (newRawXml) {
|
|
6751
6649
|
updates.rawXml = newRawXml;
|
|
6752
6650
|
}
|
|
@@ -6761,9 +6659,9 @@ function createTableMergeHandlers(input) {
|
|
|
6761
6659
|
return;
|
|
6762
6660
|
}
|
|
6763
6661
|
const td = selectedElement.tableData;
|
|
6764
|
-
const newTableData =
|
|
6662
|
+
const newTableData = chunkDCNHUEWQ_js.mergeCells(ts.selectedCells, td);
|
|
6765
6663
|
const updates = { tableData: newTableData };
|
|
6766
|
-
const newRawXml =
|
|
6664
|
+
const newRawXml = chunkDCNHUEWQ_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6767
6665
|
if (newRawXml) {
|
|
6768
6666
|
updates.rawXml = newRawXml;
|
|
6769
6667
|
}
|
|
@@ -6780,9 +6678,9 @@ function createTableMergeHandlers(input) {
|
|
|
6780
6678
|
}
|
|
6781
6679
|
const { rowIndex, columnIndex } = ts;
|
|
6782
6680
|
const td = selectedElement.tableData;
|
|
6783
|
-
const newTableData =
|
|
6681
|
+
const newTableData = chunkDCNHUEWQ_js.splitCell(rowIndex, columnIndex, td);
|
|
6784
6682
|
const updates = { tableData: newTableData };
|
|
6785
|
-
const newRawXml =
|
|
6683
|
+
const newRawXml = chunkDCNHUEWQ_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6786
6684
|
if (newRawXml) {
|
|
6787
6685
|
updates.rawXml = newRawXml;
|
|
6788
6686
|
}
|
|
@@ -6816,10 +6714,10 @@ function createTableStructHandlers(input) {
|
|
|
6816
6714
|
const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
|
|
6817
6715
|
const updates = {};
|
|
6818
6716
|
if (el.tableData) {
|
|
6819
|
-
updates.tableData =
|
|
6717
|
+
updates.tableData = chunkDCNHUEWQ_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6820
6718
|
}
|
|
6821
6719
|
if (el.rawXml) {
|
|
6822
|
-
const newRawXml =
|
|
6720
|
+
const newRawXml = chunkDCNHUEWQ_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6823
6721
|
if (newRawXml) {
|
|
6824
6722
|
updates.rawXml = newRawXml;
|
|
6825
6723
|
}
|
|
@@ -6843,7 +6741,7 @@ function createTableStructHandlers(input) {
|
|
|
6843
6741
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6844
6742
|
const updates = {};
|
|
6845
6743
|
if (selectedElement.rawXml) {
|
|
6846
|
-
const newRawXml =
|
|
6744
|
+
const newRawXml = chunkDCNHUEWQ_js.updateCellTextStyleInRawXml(
|
|
6847
6745
|
selectedElement,
|
|
6848
6746
|
rowIndex,
|
|
6849
6747
|
colIndex,
|
|
@@ -6907,9 +6805,9 @@ function createTableStructHandlers(input) {
|
|
|
6907
6805
|
return;
|
|
6908
6806
|
}
|
|
6909
6807
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6910
|
-
const newTableData =
|
|
6808
|
+
const newTableData = chunkDCNHUEWQ_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6911
6809
|
const updates = { tableData: newTableData };
|
|
6912
|
-
const newRawXml =
|
|
6810
|
+
const newRawXml = chunkDCNHUEWQ_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6913
6811
|
if (newRawXml) {
|
|
6914
6812
|
updates.rawXml = newRawXml;
|
|
6915
6813
|
}
|
|
@@ -6922,12 +6820,12 @@ function createTableStructHandlers(input) {
|
|
|
6922
6820
|
}
|
|
6923
6821
|
const td = selectedElement.tableData;
|
|
6924
6822
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6925
|
-
const newTableData =
|
|
6823
|
+
const newTableData = chunkDCNHUEWQ_js.deleteTableRow(td, rowIdx);
|
|
6926
6824
|
if (newTableData === td) {
|
|
6927
6825
|
return;
|
|
6928
6826
|
}
|
|
6929
6827
|
const updates = { tableData: newTableData };
|
|
6930
|
-
const newRawXml =
|
|
6828
|
+
const newRawXml = chunkDCNHUEWQ_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6931
6829
|
if (newRawXml) {
|
|
6932
6830
|
updates.rawXml = newRawXml;
|
|
6933
6831
|
}
|
|
@@ -6939,9 +6837,9 @@ function createTableStructHandlers(input) {
|
|
|
6939
6837
|
return;
|
|
6940
6838
|
}
|
|
6941
6839
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6942
|
-
const newTableData =
|
|
6840
|
+
const newTableData = chunkDCNHUEWQ_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6943
6841
|
const updates = { tableData: newTableData };
|
|
6944
|
-
const newRawXml =
|
|
6842
|
+
const newRawXml = chunkDCNHUEWQ_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6945
6843
|
if (newRawXml) {
|
|
6946
6844
|
updates.rawXml = newRawXml;
|
|
6947
6845
|
}
|
|
@@ -6954,12 +6852,12 @@ function createTableStructHandlers(input) {
|
|
|
6954
6852
|
}
|
|
6955
6853
|
const td = selectedElement.tableData;
|
|
6956
6854
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6957
|
-
const newTableData =
|
|
6855
|
+
const newTableData = chunkDCNHUEWQ_js.deleteTableColumn(td, colIdx);
|
|
6958
6856
|
if (newTableData === td) {
|
|
6959
6857
|
return;
|
|
6960
6858
|
}
|
|
6961
6859
|
const updates = { tableData: newTableData };
|
|
6962
|
-
const newRawXml =
|
|
6860
|
+
const newRawXml = chunkDCNHUEWQ_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6963
6861
|
if (newRawXml) {
|
|
6964
6862
|
updates.rawXml = newRawXml;
|
|
6965
6863
|
}
|
|
@@ -6995,8 +6893,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6995
6893
|
return html2canvasPro(element, {
|
|
6996
6894
|
...options,
|
|
6997
6895
|
onclone: async (doc, clonedEl) => {
|
|
6998
|
-
await
|
|
6999
|
-
|
|
6896
|
+
await chunkDCNHUEWQ_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6897
|
+
chunkDCNHUEWQ_js.preprocessCssForCapture(clonedEl);
|
|
7000
6898
|
if (typeof userOnClone === "function") {
|
|
7001
6899
|
userOnClone(doc, clonedEl);
|
|
7002
6900
|
}
|
|
@@ -7034,13 +6932,13 @@ function useExportSaveAs(input) {
|
|
|
7034
6932
|
if (!handler) {
|
|
7035
6933
|
return;
|
|
7036
6934
|
}
|
|
7037
|
-
const downloadName =
|
|
6935
|
+
const downloadName = chunkDCNHUEWQ_js.savedPresentationFileName(filePath, format);
|
|
7038
6936
|
try {
|
|
7039
6937
|
const data = await buildSaveAsData(handler, format);
|
|
7040
6938
|
const blob = new Blob([data], {
|
|
7041
6939
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
7042
6940
|
});
|
|
7043
|
-
|
|
6941
|
+
chunkDCNHUEWQ_js.downloadBlob(blob, downloadName);
|
|
7044
6942
|
} catch (err) {
|
|
7045
6943
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
7046
6944
|
}
|
|
@@ -7053,18 +6951,18 @@ function useExportSaveAs(input) {
|
|
|
7053
6951
|
const pptxGuides = guides.map((g) => ({
|
|
7054
6952
|
id: g.id,
|
|
7055
6953
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7056
|
-
positionEmu:
|
|
6954
|
+
positionEmu: chunkDCNHUEWQ_js.guidePxToEmu(g.position)
|
|
7057
6955
|
}));
|
|
7058
6956
|
return {
|
|
7059
6957
|
...slide,
|
|
7060
6958
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7061
6959
|
};
|
|
7062
6960
|
});
|
|
7063
|
-
const slidesToSave =
|
|
6961
|
+
const slidesToSave = chunkDCNHUEWQ_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7064
6962
|
const saveOptions = {
|
|
7065
6963
|
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
7066
6964
|
// a preset picked in the inspector reached one save path and not the other.
|
|
7067
|
-
slideSize:
|
|
6965
|
+
slideSize: chunkDCNHUEWQ_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
7068
6966
|
headerFooter,
|
|
7069
6967
|
presentationProperties,
|
|
7070
6968
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -7078,13 +6976,13 @@ function useExportSaveAs(input) {
|
|
|
7078
6976
|
handoutMaster,
|
|
7079
6977
|
outputFormat: format
|
|
7080
6978
|
};
|
|
7081
|
-
return
|
|
6979
|
+
return chunkDCNHUEWQ_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
7082
6980
|
};
|
|
7083
6981
|
const handleExportJson = () => {
|
|
7084
6982
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7085
|
-
const slideSize =
|
|
6983
|
+
const slideSize = chunkDCNHUEWQ_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7086
6984
|
const data = {
|
|
7087
|
-
slides:
|
|
6985
|
+
slides: chunkDCNHUEWQ_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7088
6986
|
width: canvasSize.width,
|
|
7089
6987
|
height: canvasSize.height,
|
|
7090
6988
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7103,7 +7001,7 @@ function useExportSaveAs(input) {
|
|
|
7103
7001
|
handoutMaster
|
|
7104
7002
|
};
|
|
7105
7003
|
try {
|
|
7106
|
-
|
|
7004
|
+
chunkDCNHUEWQ_js.exportDeckJson(data, sourceName);
|
|
7107
7005
|
} catch (err) {
|
|
7108
7006
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7109
7007
|
}
|
|
@@ -7190,7 +7088,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
7190
7088
|
}
|
|
7191
7089
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
7192
7090
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
7193
|
-
|
|
7091
|
+
chunkDCNHUEWQ_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
7194
7092
|
}
|
|
7195
7093
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
7196
7094
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -7212,15 +7110,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7212
7110
|
continue;
|
|
7213
7111
|
}
|
|
7214
7112
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
7215
|
-
images.push(
|
|
7113
|
+
images.push(chunkDCNHUEWQ_js.canvasToJpegData(canvas));
|
|
7216
7114
|
}
|
|
7217
7115
|
onProgress?.(totalSlides, totalSlides);
|
|
7218
7116
|
setActiveSlide(currentSlideIndex);
|
|
7219
7117
|
if (images.length === 0) {
|
|
7220
|
-
throw new Error(
|
|
7118
|
+
throw new Error(chunkW24OJ7H5_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7221
7119
|
}
|
|
7222
|
-
const pdfBlobUrl =
|
|
7223
|
-
|
|
7120
|
+
const pdfBlobUrl = chunkVIFDZIVX_js.buildPdfFromImageData(images);
|
|
7121
|
+
chunkDCNHUEWQ_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
7224
7122
|
}
|
|
7225
7123
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
7226
7124
|
const { scale = 2, onProgress } = options;
|
|
@@ -7266,10 +7164,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7266
7164
|
onProgress?.(totalSlides, totalSlides);
|
|
7267
7165
|
setActiveSlide(currentSlideIndex);
|
|
7268
7166
|
if (pages.length === 0) {
|
|
7269
|
-
throw new Error(
|
|
7167
|
+
throw new Error(chunkW24OJ7H5_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7270
7168
|
}
|
|
7271
|
-
const pdfDataUrl =
|
|
7272
|
-
|
|
7169
|
+
const pdfDataUrl = chunkVIFDZIVX_js.buildNotesPdf(pages);
|
|
7170
|
+
chunkDCNHUEWQ_js.downloadDataUrl(pdfDataUrl, filename);
|
|
7273
7171
|
}
|
|
7274
7172
|
|
|
7275
7173
|
// src/viewer/utils/export-video.ts
|
|
@@ -7300,7 +7198,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7300
7198
|
}
|
|
7301
7199
|
setActiveSlide(currentSlideIndex);
|
|
7302
7200
|
if (slideCanvases.length === 0) {
|
|
7303
|
-
throw new Error(
|
|
7201
|
+
throw new Error(chunkW24OJ7H5_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
7304
7202
|
}
|
|
7305
7203
|
const firstCanvas = slideCanvases[0];
|
|
7306
7204
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -7308,12 +7206,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7308
7206
|
recordingCanvas.height = firstCanvas.height;
|
|
7309
7207
|
const ctx = recordingCanvas.getContext("2d");
|
|
7310
7208
|
if (!ctx) {
|
|
7311
|
-
throw new Error(
|
|
7209
|
+
throw new Error(chunkW24OJ7H5_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
7312
7210
|
}
|
|
7313
7211
|
const fps = 30;
|
|
7314
7212
|
const stream = recordingCanvas.captureStream(fps);
|
|
7315
7213
|
const recorder = new MediaRecorder(stream, {
|
|
7316
|
-
mimeType:
|
|
7214
|
+
mimeType: chunkDCNHUEWQ_js.pickSupportedMimeType([...chunkDCNHUEWQ_js.WEBM_MIME_CANDIDATES]),
|
|
7317
7215
|
videoBitsPerSecond: 5e6
|
|
7318
7216
|
});
|
|
7319
7217
|
const chunks = [];
|
|
@@ -7336,8 +7234,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7336
7234
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
7337
7235
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
7338
7236
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
7339
|
-
const frameInterval =
|
|
7340
|
-
const framesNeeded =
|
|
7237
|
+
const frameInterval = chunkDCNHUEWQ_js.fpsToFrameIntervalMs(fps);
|
|
7238
|
+
const framesNeeded = chunkDCNHUEWQ_js.segmentFrameCount(duration, fps);
|
|
7341
7239
|
for (let f = 0; f < framesNeeded; f++) {
|
|
7342
7240
|
if (signal?.aborted) {
|
|
7343
7241
|
recorder.stop();
|
|
@@ -7384,9 +7282,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7384
7282
|
}
|
|
7385
7283
|
setActiveSlide(currentSlideIndex);
|
|
7386
7284
|
if (frames.length === 0) {
|
|
7387
|
-
throw new Error(
|
|
7285
|
+
throw new Error(chunkW24OJ7H5_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
7388
7286
|
}
|
|
7389
|
-
const gifBytes =
|
|
7287
|
+
const gifBytes = chunkDCNHUEWQ_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
7390
7288
|
onProgress?.(totalSlides, totalSlides);
|
|
7391
7289
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
7392
7290
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -7440,7 +7338,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7440
7338
|
continue;
|
|
7441
7339
|
}
|
|
7442
7340
|
onProgress?.(processedCount, data.slides.length);
|
|
7443
|
-
let svg =
|
|
7341
|
+
let svg = chunkDCNHUEWQ_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7444
7342
|
if (embedFonts && fontFaces?.length) {
|
|
7445
7343
|
svg = injectFontFaces(svg, fontFaces);
|
|
7446
7344
|
}
|
|
@@ -7549,21 +7447,21 @@ function useExportHandlers(input) {
|
|
|
7549
7447
|
{
|
|
7550
7448
|
scale: imageExportScale,
|
|
7551
7449
|
onProgress: (current, total) => {
|
|
7552
|
-
setExportProgress(
|
|
7553
|
-
setExportStatusMessage(
|
|
7450
|
+
setExportProgress(chunkDCNHUEWQ_js.slideProgressPercent(current, total));
|
|
7451
|
+
setExportStatusMessage(chunkDCNHUEWQ_js.slideStatusLabel("Rendering", current, total));
|
|
7554
7452
|
},
|
|
7555
7453
|
signal: abortCtrl.signal
|
|
7556
7454
|
}
|
|
7557
7455
|
);
|
|
7558
|
-
setExportProgress(
|
|
7456
|
+
setExportProgress(chunkDCNHUEWQ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7559
7457
|
setExportStatusMessage("Building PDF...");
|
|
7560
7458
|
await new Promise((r) => {
|
|
7561
7459
|
setTimeout(r, 100);
|
|
7562
7460
|
});
|
|
7563
|
-
setExportProgress(
|
|
7461
|
+
setExportProgress(chunkDCNHUEWQ_js.EXPORT_DONE_PERCENT);
|
|
7564
7462
|
setExportStatusMessage("Done!");
|
|
7565
7463
|
} catch (err) {
|
|
7566
|
-
if (!
|
|
7464
|
+
if (!chunkDCNHUEWQ_js.isExportAbortError(err)) {
|
|
7567
7465
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7568
7466
|
}
|
|
7569
7467
|
} finally {
|
|
@@ -7593,21 +7491,21 @@ function useExportHandlers(input) {
|
|
|
7593
7491
|
{
|
|
7594
7492
|
scale: imageExportScale,
|
|
7595
7493
|
onProgress: (current, total) => {
|
|
7596
|
-
setExportProgress(
|
|
7597
|
-
setExportStatusMessage(
|
|
7494
|
+
setExportProgress(chunkDCNHUEWQ_js.slideProgressPercent(current, total));
|
|
7495
|
+
setExportStatusMessage(chunkDCNHUEWQ_js.slideStatusLabel("Rendering", current, total));
|
|
7598
7496
|
},
|
|
7599
7497
|
signal: abortCtrl.signal
|
|
7600
7498
|
}
|
|
7601
7499
|
);
|
|
7602
|
-
setExportProgress(
|
|
7500
|
+
setExportProgress(chunkDCNHUEWQ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7603
7501
|
setExportStatusMessage("Building PDF...");
|
|
7604
7502
|
await new Promise((r) => {
|
|
7605
7503
|
setTimeout(r, 100);
|
|
7606
7504
|
});
|
|
7607
|
-
setExportProgress(
|
|
7505
|
+
setExportProgress(chunkDCNHUEWQ_js.EXPORT_DONE_PERCENT);
|
|
7608
7506
|
setExportStatusMessage("Done!");
|
|
7609
7507
|
} catch (err) {
|
|
7610
|
-
if (!
|
|
7508
|
+
if (!chunkDCNHUEWQ_js.isExportAbortError(err)) {
|
|
7611
7509
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7612
7510
|
}
|
|
7613
7511
|
} finally {
|
|
@@ -7649,22 +7547,22 @@ function useExportHandlers(input) {
|
|
|
7649
7547
|
scale: 1,
|
|
7650
7548
|
slideDurationMs: 3e3,
|
|
7651
7549
|
onProgress: (current, total) => {
|
|
7652
|
-
setExportProgress(
|
|
7653
|
-
setExportStatusMessage(
|
|
7550
|
+
setExportProgress(chunkDCNHUEWQ_js.slideProgressPercent(current, total, 45));
|
|
7551
|
+
setExportStatusMessage(chunkDCNHUEWQ_js.slideStatusLabel("Capturing", current, total));
|
|
7654
7552
|
},
|
|
7655
7553
|
onRecordProgress: (current, total) => {
|
|
7656
|
-
setExportProgress(
|
|
7657
|
-
setExportStatusMessage(
|
|
7554
|
+
setExportProgress(chunkDCNHUEWQ_js.recordProgressPercent(current, total));
|
|
7555
|
+
setExportStatusMessage(chunkDCNHUEWQ_js.slideStatusLabel("Recording", current, total));
|
|
7658
7556
|
},
|
|
7659
7557
|
signal: abortCtrl.signal
|
|
7660
7558
|
}
|
|
7661
7559
|
);
|
|
7662
|
-
setExportProgress(
|
|
7560
|
+
setExportProgress(chunkDCNHUEWQ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7663
7561
|
setExportStatusMessage("Saving file...");
|
|
7664
|
-
|
|
7665
|
-
setExportProgress(
|
|
7562
|
+
chunkDCNHUEWQ_js.downloadBlob(blob, "presentation.webm");
|
|
7563
|
+
setExportProgress(chunkDCNHUEWQ_js.EXPORT_DONE_PERCENT);
|
|
7666
7564
|
} catch (err) {
|
|
7667
|
-
if (!
|
|
7565
|
+
if (!chunkDCNHUEWQ_js.isExportAbortError(err)) {
|
|
7668
7566
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7669
7567
|
}
|
|
7670
7568
|
} finally {
|
|
@@ -7692,18 +7590,18 @@ function useExportHandlers(input) {
|
|
|
7692
7590
|
scale: 0.5,
|
|
7693
7591
|
slideDurationMs: 2e3,
|
|
7694
7592
|
onProgress: (current, total) => {
|
|
7695
|
-
setExportProgress(
|
|
7696
|
-
setExportStatusMessage(
|
|
7593
|
+
setExportProgress(chunkDCNHUEWQ_js.slideProgressPercent(current, total));
|
|
7594
|
+
setExportStatusMessage(chunkDCNHUEWQ_js.slideStatusLabel("Encoding", current, total));
|
|
7697
7595
|
},
|
|
7698
7596
|
signal: abortCtrl.signal
|
|
7699
7597
|
}
|
|
7700
7598
|
);
|
|
7701
|
-
setExportProgress(
|
|
7599
|
+
setExportProgress(chunkDCNHUEWQ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7702
7600
|
setExportStatusMessage("Saving file...");
|
|
7703
|
-
|
|
7704
|
-
setExportProgress(
|
|
7601
|
+
chunkDCNHUEWQ_js.downloadBlob(blob, "presentation.gif");
|
|
7602
|
+
setExportProgress(chunkDCNHUEWQ_js.EXPORT_DONE_PERCENT);
|
|
7705
7603
|
} catch (err) {
|
|
7706
|
-
if (!
|
|
7604
|
+
if (!chunkDCNHUEWQ_js.isExportAbortError(err)) {
|
|
7707
7605
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7708
7606
|
}
|
|
7709
7607
|
} finally {
|
|
@@ -7736,7 +7634,7 @@ function useExportHandlers(input) {
|
|
|
7736
7634
|
exportStatusMessage
|
|
7737
7635
|
};
|
|
7738
7636
|
}
|
|
7739
|
-
var ViewerOptionsContext = react.createContext(
|
|
7637
|
+
var ViewerOptionsContext = react.createContext(chunkDCNHUEWQ_js.DEFAULT_VIEWER_OPTIONS);
|
|
7740
7638
|
function useViewerOptionsContext() {
|
|
7741
7639
|
return react.useContext(ViewerOptionsContext);
|
|
7742
7640
|
}
|
|
@@ -7748,13 +7646,13 @@ function usePrintHandlers(input) {
|
|
|
7748
7646
|
const { t } = reactI18next.useTranslation();
|
|
7749
7647
|
const viewerOptions = useViewerOptionsContext();
|
|
7750
7648
|
const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
|
|
7751
|
-
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) *
|
|
7649
|
+
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunkDCNHUEWQ_js.resolveImageResolutionScale(viewerOptions);
|
|
7752
7650
|
const handlePrint = () => {
|
|
7753
7651
|
setIsPrintDialogOpen(true);
|
|
7754
7652
|
};
|
|
7755
7653
|
const handlePrintSvg = async (settings) => {
|
|
7756
7654
|
setIsPrintDialogOpen(false);
|
|
7757
|
-
const printWindow =
|
|
7655
|
+
const printWindow = chunkDCNHUEWQ_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7758
7656
|
if (!printWindow) {
|
|
7759
7657
|
console.warn(
|
|
7760
7658
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7764,9 +7662,9 @@ function usePrintHandlers(input) {
|
|
|
7764
7662
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7765
7663
|
return runRasterPrint(printWindow, settings);
|
|
7766
7664
|
}
|
|
7767
|
-
const colorFilter =
|
|
7768
|
-
const slideIndices =
|
|
7769
|
-
|
|
7665
|
+
const colorFilter = chunkDCNHUEWQ_js.computeColorFilter(settings.colorMode);
|
|
7666
|
+
const slideIndices = chunkDCNHUEWQ_js.filterHiddenSlideIndices(
|
|
7667
|
+
chunkDCNHUEWQ_js.computeSlideIndices(
|
|
7770
7668
|
settings.slideRange,
|
|
7771
7669
|
activeSlideIndex,
|
|
7772
7670
|
slides.length,
|
|
@@ -7784,22 +7682,22 @@ function usePrintHandlers(input) {
|
|
|
7784
7682
|
printWindow.close();
|
|
7785
7683
|
return;
|
|
7786
7684
|
}
|
|
7787
|
-
const printDoc =
|
|
7685
|
+
const printDoc = chunkDCNHUEWQ_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7788
7686
|
title: "Slides (Vector)",
|
|
7789
7687
|
orientation: settings.orientation,
|
|
7790
7688
|
colorFilter,
|
|
7791
7689
|
scaleToFit: settings.scaleToFit
|
|
7792
7690
|
});
|
|
7793
|
-
|
|
7691
|
+
chunkDCNHUEWQ_js.finishPrintWindow(printWindow, printDoc);
|
|
7794
7692
|
} catch (err) {
|
|
7795
7693
|
console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
|
|
7796
7694
|
return runRasterPrint(printWindow, settings);
|
|
7797
7695
|
}
|
|
7798
7696
|
};
|
|
7799
7697
|
const runRasterPrint = async (printWindow, settings) => {
|
|
7800
|
-
const colorFilter =
|
|
7801
|
-
const slideIndices =
|
|
7802
|
-
|
|
7698
|
+
const colorFilter = chunkDCNHUEWQ_js.computeColorFilter(settings.colorMode);
|
|
7699
|
+
const slideIndices = chunkDCNHUEWQ_js.filterHiddenSlideIndices(
|
|
7700
|
+
chunkDCNHUEWQ_js.computeSlideIndices(
|
|
7803
7701
|
settings.slideRange,
|
|
7804
7702
|
activeSlideIndex,
|
|
7805
7703
|
slides.length,
|
|
@@ -7810,11 +7708,11 @@ function usePrintHandlers(input) {
|
|
|
7810
7708
|
includeHiddenSlides
|
|
7811
7709
|
);
|
|
7812
7710
|
if (settings.printWhat === "outline") {
|
|
7813
|
-
|
|
7711
|
+
chunkDCNHUEWQ_js.finishPrintWindow(
|
|
7814
7712
|
printWindow,
|
|
7815
|
-
|
|
7713
|
+
chunkDCNHUEWQ_js.buildPrintHtmlDocument({
|
|
7816
7714
|
title: "Outline",
|
|
7817
|
-
bodyHtml: `<div class="outline-page">${
|
|
7715
|
+
bodyHtml: `<div class="outline-page">${chunkDCNHUEWQ_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7818
7716
|
orientation: settings.orientation,
|
|
7819
7717
|
colorFilter,
|
|
7820
7718
|
frameSlides: settings.frameSlides,
|
|
@@ -7841,11 +7739,11 @@ function usePrintHandlers(input) {
|
|
|
7841
7739
|
}
|
|
7842
7740
|
const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
|
|
7843
7741
|
if (settings.printWhat === "slides") {
|
|
7844
|
-
|
|
7742
|
+
chunkDCNHUEWQ_js.finishPrintWindow(
|
|
7845
7743
|
printWindow,
|
|
7846
|
-
|
|
7744
|
+
chunkDCNHUEWQ_js.buildPrintHtmlDocument({
|
|
7847
7745
|
title: "Slides",
|
|
7848
|
-
bodyHtml:
|
|
7746
|
+
bodyHtml: chunkDCNHUEWQ_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7849
7747
|
orientation: settings.orientation,
|
|
7850
7748
|
colorFilter,
|
|
7851
7749
|
frameSlides: settings.frameSlides,
|
|
@@ -7855,11 +7753,11 @@ function usePrintHandlers(input) {
|
|
|
7855
7753
|
return;
|
|
7856
7754
|
}
|
|
7857
7755
|
if (settings.printWhat === "notes") {
|
|
7858
|
-
|
|
7756
|
+
chunkDCNHUEWQ_js.finishPrintWindow(
|
|
7859
7757
|
printWindow,
|
|
7860
|
-
|
|
7758
|
+
chunkDCNHUEWQ_js.buildPrintHtmlDocument({
|
|
7861
7759
|
title: "Notes Pages",
|
|
7862
|
-
bodyHtml:
|
|
7760
|
+
bodyHtml: chunkDCNHUEWQ_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7863
7761
|
orientation: "portrait",
|
|
7864
7762
|
colorFilter,
|
|
7865
7763
|
frameSlides: settings.frameSlides,
|
|
@@ -7870,11 +7768,11 @@ function usePrintHandlers(input) {
|
|
|
7870
7768
|
}
|
|
7871
7769
|
if (settings.printWhat === "handouts") {
|
|
7872
7770
|
const spp = settings.slidesPerPage;
|
|
7873
|
-
|
|
7771
|
+
chunkDCNHUEWQ_js.finishPrintWindow(
|
|
7874
7772
|
printWindow,
|
|
7875
|
-
|
|
7773
|
+
chunkDCNHUEWQ_js.buildPrintHtmlDocument({
|
|
7876
7774
|
title: `Handout ${spp} per page`,
|
|
7877
|
-
bodyHtml:
|
|
7775
|
+
bodyHtml: chunkDCNHUEWQ_js.buildHandoutsHtml(slideImages, slideIndices, spp, pptxData?.handoutMaster),
|
|
7878
7776
|
orientation: "portrait",
|
|
7879
7777
|
colorFilter,
|
|
7880
7778
|
frameSlides: settings.frameSlides,
|
|
@@ -7888,7 +7786,7 @@ function usePrintHandlers(input) {
|
|
|
7888
7786
|
};
|
|
7889
7787
|
const handlePrintWithSettings = async (settings) => {
|
|
7890
7788
|
setIsPrintDialogOpen(false);
|
|
7891
|
-
const printWindow =
|
|
7789
|
+
const printWindow = chunkDCNHUEWQ_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7892
7790
|
if (!printWindow) {
|
|
7893
7791
|
console.warn(
|
|
7894
7792
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7953,13 +7851,13 @@ function useThemeHandlers(input) {
|
|
|
7953
7851
|
return;
|
|
7954
7852
|
}
|
|
7955
7853
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7956
|
-
const previousMap = theme?.colorScheme ?
|
|
7957
|
-
setSlides((prev) =>
|
|
7854
|
+
const previousMap = theme?.colorScheme ? chunkDCNHUEWQ_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7855
|
+
setSlides((prev) => chunkDCNHUEWQ_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7958
7856
|
if (Object.keys(templateElementsBySlideId).length > 0) {
|
|
7959
7857
|
setTemplateElementsBySlideId((prev) => {
|
|
7960
7858
|
const next = {};
|
|
7961
7859
|
for (const [slideId, elements] of Object.entries(prev)) {
|
|
7962
|
-
next[slideId] =
|
|
7860
|
+
next[slideId] = chunkDCNHUEWQ_js.reResolveElementColors(elements, previousMap, colorScheme);
|
|
7963
7861
|
}
|
|
7964
7862
|
return next;
|
|
7965
7863
|
});
|
|
@@ -8068,7 +7966,7 @@ function useThemeSwitching(input) {
|
|
|
8068
7966
|
}
|
|
8069
7967
|
try {
|
|
8070
7968
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
8071
|
-
const newData =
|
|
7969
|
+
const newData = chunkDCNHUEWQ_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
8072
7970
|
onDataChange(newData);
|
|
8073
7971
|
onThemeChanged?.(preset);
|
|
8074
7972
|
} catch (error) {
|
|
@@ -8085,7 +7983,7 @@ function useThemeSwitching(input) {
|
|
|
8085
7983
|
}
|
|
8086
7984
|
try {
|
|
8087
7985
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
8088
|
-
const newData =
|
|
7986
|
+
const newData = chunkDCNHUEWQ_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
8089
7987
|
onDataChange(newData);
|
|
8090
7988
|
} catch (error) {
|
|
8091
7989
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -8097,12 +7995,12 @@ function useThemeSwitching(input) {
|
|
|
8097
7995
|
if (!data?.theme?.colorScheme) {
|
|
8098
7996
|
return void 0;
|
|
8099
7997
|
}
|
|
8100
|
-
return
|
|
8101
|
-
(p) =>
|
|
7998
|
+
return chunkDCNHUEWQ_js.THEME_PRESETS.find(
|
|
7999
|
+
(p) => chunkDCNHUEWQ_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
8102
8000
|
);
|
|
8103
8001
|
}, [data?.theme?.colorScheme]);
|
|
8104
8002
|
return {
|
|
8105
|
-
presets:
|
|
8003
|
+
presets: chunkDCNHUEWQ_js.THEME_PRESETS,
|
|
8106
8004
|
switchToPreset,
|
|
8107
8005
|
switchToCustom,
|
|
8108
8006
|
currentPreset
|
|
@@ -8177,7 +8075,7 @@ function usePropertyHandlers(input) {
|
|
|
8177
8075
|
}
|
|
8178
8076
|
try {
|
|
8179
8077
|
const ab = await file.arrayBuffer();
|
|
8180
|
-
const h = new
|
|
8078
|
+
const h = new chunkDCNHUEWQ_js.PptxHandler();
|
|
8181
8079
|
const other = await h.load(ab);
|
|
8182
8080
|
if (!other) {
|
|
8183
8081
|
return;
|
|
@@ -8187,7 +8085,7 @@ function usePropertyHandlers(input) {
|
|
|
8187
8085
|
width: canvasSize.width,
|
|
8188
8086
|
height: canvasSize.height
|
|
8189
8087
|
};
|
|
8190
|
-
setCompareResult(
|
|
8088
|
+
setCompareResult(chunkDCNHUEWQ_js.comparePresentation(cur, other));
|
|
8191
8089
|
setIsComparePanelOpen(true);
|
|
8192
8090
|
} catch (err) {
|
|
8193
8091
|
console.warn("Compare failed:", err);
|
|
@@ -8204,7 +8102,7 @@ function usePropertyHandlers(input) {
|
|
|
8204
8102
|
if (!diff || diff.status === "unchanged") {
|
|
8205
8103
|
return;
|
|
8206
8104
|
}
|
|
8207
|
-
setSlides((prev) =>
|
|
8105
|
+
setSlides((prev) => chunkDCNHUEWQ_js.applyAcceptSlide(prev, diff));
|
|
8208
8106
|
setIsDirty(true);
|
|
8209
8107
|
},
|
|
8210
8108
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -8215,10 +8113,10 @@ function usePropertyHandlers(input) {
|
|
|
8215
8113
|
if (!compareResult) {
|
|
8216
8114
|
return;
|
|
8217
8115
|
}
|
|
8218
|
-
setSlides((prev) =>
|
|
8116
|
+
setSlides((prev) => chunkDCNHUEWQ_js.applyAcceptAllSlides(prev, compareResult));
|
|
8219
8117
|
setIsDirty(true);
|
|
8220
8118
|
}, [compareResult, setSlides, setIsDirty]);
|
|
8221
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
8119
|
+
const usedFontFamilies = react.useMemo(() => chunkDCNHUEWQ_js.collectUsedFonts(slides), [slides]);
|
|
8222
8120
|
return {
|
|
8223
8121
|
handleUpdateNotes,
|
|
8224
8122
|
handleUpdateSlide,
|
|
@@ -8373,7 +8271,7 @@ function useViewerDialogs(input) {
|
|
|
8373
8271
|
);
|
|
8374
8272
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8375
8273
|
const fontEmbedding = react.useMemo(
|
|
8376
|
-
() =>
|
|
8274
|
+
() => chunkDCNHUEWQ_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8377
8275
|
[embeddedFontKey]
|
|
8378
8276
|
);
|
|
8379
8277
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8383,11 +8281,11 @@ function useViewerDialogs(input) {
|
|
|
8383
8281
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8384
8282
|
}
|
|
8385
8283
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8386
|
-
() => typeof window !== "undefined" ?
|
|
8284
|
+
() => typeof window !== "undefined" ? chunkDCNHUEWQ_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8387
8285
|
);
|
|
8388
8286
|
react.useEffect(() => {
|
|
8389
8287
|
const handleWindow = () => setIsNarrowViewport(
|
|
8390
|
-
|
|
8288
|
+
chunkDCNHUEWQ_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8391
8289
|
);
|
|
8392
8290
|
window.addEventListener("resize", handleWindow);
|
|
8393
8291
|
return () => window.removeEventListener("resize", handleWindow);
|
|
@@ -8540,16 +8438,16 @@ function useViewerDialogs(input) {
|
|
|
8540
8438
|
};
|
|
8541
8439
|
}
|
|
8542
8440
|
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8543
|
-
return
|
|
8441
|
+
return chunkDCNHUEWQ_js.computeGridSpacingPx(documentGridSpacing, chunkVIFDZIVX_js.GRID_SIZE);
|
|
8544
8442
|
}
|
|
8545
8443
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
8546
8444
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8547
|
-
const authoredRange =
|
|
8548
|
-
return
|
|
8445
|
+
const authoredRange = chunkDCNHUEWQ_js.resolveAuthoredSlideRange(presentationProperties, slides.length);
|
|
8446
|
+
return chunkDCNHUEWQ_js.resolveShowSlideIndexes(slides, activeShow, authoredRange);
|
|
8549
8447
|
}
|
|
8550
8448
|
function computeSlideSectionGroups(slides, sections) {
|
|
8551
|
-
return
|
|
8552
|
-
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),
|
|
8553
8451
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8554
8452
|
slideIndexes: group.slideIndexes,
|
|
8555
8453
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8561,7 +8459,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8561
8459
|
return void 0;
|
|
8562
8460
|
}
|
|
8563
8461
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8564
|
-
return
|
|
8462
|
+
return chunkDCNHUEWQ_js.masterViewPseudoSlide(document2, {
|
|
8565
8463
|
tab: "slides",
|
|
8566
8464
|
masterIndex: 0,
|
|
8567
8465
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8589,15 +8487,15 @@ function useDerivedSlideState(input) {
|
|
|
8589
8487
|
[slides, activeCustomShowId, customShows, presentationProperties]
|
|
8590
8488
|
);
|
|
8591
8489
|
const authoredRange = react.useMemo(
|
|
8592
|
-
() =>
|
|
8490
|
+
() => chunkDCNHUEWQ_js.resolveAuthoredSlideRange(presentationProperties, slides.length),
|
|
8593
8491
|
[presentationProperties, slides.length]
|
|
8594
8492
|
);
|
|
8595
8493
|
const slideSectionGroups = react.useMemo(
|
|
8596
8494
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8597
|
-
if (group.id ===
|
|
8495
|
+
if (group.id === chunkVIFDZIVX_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8598
8496
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8599
8497
|
}
|
|
8600
|
-
if (group.id ===
|
|
8498
|
+
if (group.id === chunkVIFDZIVX_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8601
8499
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8602
8500
|
}
|
|
8603
8501
|
return group;
|
|
@@ -8698,13 +8596,13 @@ function useAnnotationHandlers(input) {
|
|
|
8698
8596
|
}, [annotations, setMode, setSlides, history]);
|
|
8699
8597
|
const handleSetMode = react.useCallback(
|
|
8700
8598
|
(nextMode) => {
|
|
8701
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8599
|
+
if (mode === "present" && nextMode !== "present" && !chunkDCNHUEWQ_js.mayLeaveSlideShow()) {
|
|
8702
8600
|
return;
|
|
8703
8601
|
}
|
|
8704
8602
|
if (nextMode === "present") {
|
|
8705
8603
|
presentation.enterPresentMode();
|
|
8706
8604
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8707
|
-
|
|
8605
|
+
chunkDCNHUEWQ_js.stopAllPersistentAudio();
|
|
8708
8606
|
if (promptKeepInkAnnotations) {
|
|
8709
8607
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8710
8608
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8714,7 +8612,7 @@ function useAnnotationHandlers(input) {
|
|
|
8714
8612
|
}
|
|
8715
8613
|
} else {
|
|
8716
8614
|
if (mode === "present") {
|
|
8717
|
-
|
|
8615
|
+
chunkDCNHUEWQ_js.stopAllPersistentAudio();
|
|
8718
8616
|
}
|
|
8719
8617
|
setMode(nextMode);
|
|
8720
8618
|
}
|
|
@@ -8779,13 +8677,13 @@ function useSerialize(input) {
|
|
|
8779
8677
|
let processedSlide = slide;
|
|
8780
8678
|
if (pendingEditId) {
|
|
8781
8679
|
const updatedElements = slide.elements.map((el) => {
|
|
8782
|
-
if (el.id !== pendingEditId || !
|
|
8680
|
+
if (el.id !== pendingEditId || !chunkDCNHUEWQ_js.hasTextProperties(el)) {
|
|
8783
8681
|
return el;
|
|
8784
8682
|
}
|
|
8785
8683
|
return {
|
|
8786
8684
|
...el,
|
|
8787
8685
|
text: pendingEditText,
|
|
8788
|
-
textSegments:
|
|
8686
|
+
textSegments: chunkDCNHUEWQ_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8789
8687
|
};
|
|
8790
8688
|
});
|
|
8791
8689
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8798,19 +8696,19 @@ function useSerialize(input) {
|
|
|
8798
8696
|
const pptxGuides = guides.map((g) => ({
|
|
8799
8697
|
id: g.id,
|
|
8800
8698
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8801
|
-
positionEmu:
|
|
8699
|
+
positionEmu: chunkDCNHUEWQ_js.guidePxToEmu(g.position)
|
|
8802
8700
|
}));
|
|
8803
8701
|
return {
|
|
8804
8702
|
...processedSlide,
|
|
8805
8703
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8806
8704
|
};
|
|
8807
8705
|
});
|
|
8808
|
-
const slidesToSave =
|
|
8706
|
+
const slidesToSave = chunkDCNHUEWQ_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8809
8707
|
const saveOptions = {
|
|
8810
8708
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8811
8709
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8812
8710
|
// slide-size edit reaches the file.
|
|
8813
|
-
slideSize:
|
|
8711
|
+
slideSize: chunkDCNHUEWQ_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8814
8712
|
headerFooter,
|
|
8815
8713
|
presentationProperties,
|
|
8816
8714
|
viewProperties,
|
|
@@ -8823,9 +8721,9 @@ function useSerialize(input) {
|
|
|
8823
8721
|
slideMasters,
|
|
8824
8722
|
notesMaster,
|
|
8825
8723
|
handoutMaster,
|
|
8826
|
-
...
|
|
8724
|
+
...chunkDCNHUEWQ_js.embeddedFontSaveOptions(embedFonts)
|
|
8827
8725
|
};
|
|
8828
|
-
return
|
|
8726
|
+
return chunkDCNHUEWQ_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8829
8727
|
}, [
|
|
8830
8728
|
slides,
|
|
8831
8729
|
templateElementsBySlideId,
|
|
@@ -8861,7 +8759,7 @@ function useRecoveryDetection(input) {
|
|
|
8861
8759
|
const onRestore = input.onRestore;
|
|
8862
8760
|
const openVersionHistory = input.openVersionHistory;
|
|
8863
8761
|
react.useEffect(() => {
|
|
8864
|
-
if (!
|
|
8762
|
+
if (!chunkDCNHUEWQ_js.shouldProbeAutosaveRecovery({
|
|
8865
8763
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8866
8764
|
filePath,
|
|
8867
8765
|
loading,
|
|
@@ -8873,7 +8771,7 @@ function useRecoveryDetection(input) {
|
|
|
8873
8771
|
}
|
|
8874
8772
|
recoveryCheckedRef.current = true;
|
|
8875
8773
|
void (async () => {
|
|
8876
|
-
const offer = await
|
|
8774
|
+
const offer = await chunkDCNHUEWQ_js.probeAutosaveRecovery(filePath);
|
|
8877
8775
|
if (!offer) {
|
|
8878
8776
|
return;
|
|
8879
8777
|
}
|
|
@@ -8886,7 +8784,7 @@ function useRecoveryDetection(input) {
|
|
|
8886
8784
|
const record = recordRef.current;
|
|
8887
8785
|
setPrompt(null);
|
|
8888
8786
|
if (record && onRestore) {
|
|
8889
|
-
onRestore(
|
|
8787
|
+
onRestore(chunkDCNHUEWQ_js.acceptAutosaveRecovery(record));
|
|
8890
8788
|
}
|
|
8891
8789
|
recordRef.current = null;
|
|
8892
8790
|
}, [onRestore]);
|
|
@@ -8895,7 +8793,7 @@ function useRecoveryDetection(input) {
|
|
|
8895
8793
|
setPrompt(null);
|
|
8896
8794
|
recordRef.current = null;
|
|
8897
8795
|
if (record) {
|
|
8898
|
-
void
|
|
8796
|
+
void chunkDCNHUEWQ_js.discardAutosaveRecovery(record);
|
|
8899
8797
|
}
|
|
8900
8798
|
}, []);
|
|
8901
8799
|
return { prompt, restore, discard };
|
|
@@ -8939,11 +8837,11 @@ function usePresentationSetup(input) {
|
|
|
8939
8837
|
containerRef,
|
|
8940
8838
|
content,
|
|
8941
8839
|
onSetMode: (nextMode) => {
|
|
8942
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8840
|
+
if (mode === "present" && nextMode !== "present" && !chunkDCNHUEWQ_js.mayLeaveSlideShow()) {
|
|
8943
8841
|
return;
|
|
8944
8842
|
}
|
|
8945
8843
|
if (mode === "present" && nextMode !== "present") {
|
|
8946
|
-
|
|
8844
|
+
chunkDCNHUEWQ_js.stopAllPersistentAudio();
|
|
8947
8845
|
stopAnimationSound();
|
|
8948
8846
|
const exitHandler = exitModeHandlerRef.current;
|
|
8949
8847
|
if (exitHandler) {
|
|
@@ -9011,10 +8909,10 @@ function usePresentationSetup(input) {
|
|
|
9011
8909
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
9012
8910
|
onToggleSubtitles,
|
|
9013
8911
|
onSaveRehearsalTimings: (timings) => {
|
|
9014
|
-
setSlides((prev) =>
|
|
8912
|
+
setSlides((prev) => chunkDCNHUEWQ_js.applyRehearsalTimings(prev, timings));
|
|
9015
8913
|
history.markDirty();
|
|
9016
8914
|
},
|
|
9017
|
-
loopContinuously:
|
|
8915
|
+
loopContinuously: chunkDCNHUEWQ_js.shouldLoopContinuously(presentationProperties),
|
|
9018
8916
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
9019
8917
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
9020
8918
|
endWithBlackSlide,
|
|
@@ -9220,7 +9118,7 @@ function useEditorOperations(input) {
|
|
|
9220
9118
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9221
9119
|
react.useEffect(() => {
|
|
9222
9120
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9223
|
-
copiedFormatRef.current =
|
|
9121
|
+
copiedFormatRef.current = chunkDCNHUEWQ_js.copyFormatFromElement(selectedElement);
|
|
9224
9122
|
} else if (!formatPainterActive) {
|
|
9225
9123
|
copiedFormatRef.current = null;
|
|
9226
9124
|
}
|
|
@@ -9246,12 +9144,12 @@ function useEditorOperations(input) {
|
|
|
9246
9144
|
e.stopPropagation();
|
|
9247
9145
|
const element = elementLookup.get(elementId);
|
|
9248
9146
|
if (element) {
|
|
9249
|
-
const updated =
|
|
9147
|
+
const updated = chunkDCNHUEWQ_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9250
9148
|
const updates = {};
|
|
9251
|
-
if (
|
|
9149
|
+
if (chunkDCNHUEWQ_js.hasShapeProperties(updated)) {
|
|
9252
9150
|
updates.shapeStyle = updated.shapeStyle;
|
|
9253
9151
|
}
|
|
9254
|
-
if (
|
|
9152
|
+
if (chunkDCNHUEWQ_js.hasTextProperties(updated)) {
|
|
9255
9153
|
updates.textStyle = updated.textStyle;
|
|
9256
9154
|
}
|
|
9257
9155
|
ops.updateElementById(elementId, updates);
|
|
@@ -9439,10 +9337,10 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9439
9337
|
}
|
|
9440
9338
|
};
|
|
9441
9339
|
}, [embeddedFonts]);
|
|
9442
|
-
const referencedFamilies = react.useMemo(() =>
|
|
9340
|
+
const referencedFamilies = react.useMemo(() => chunkDCNHUEWQ_js.collectReferencedFontFamilies(slides), [slides]);
|
|
9443
9341
|
react.useEffect(() => {
|
|
9444
9342
|
let cancelled = false;
|
|
9445
|
-
void
|
|
9343
|
+
void chunkDCNHUEWQ_js.resolveGoogleWebfontHref(slides, embeddedFonts).then((href) => {
|
|
9446
9344
|
if (cancelled) {
|
|
9447
9345
|
return null;
|
|
9448
9346
|
}
|
|
@@ -9625,7 +9523,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9625
9523
|
inputRef.current = input;
|
|
9626
9524
|
const handleKeyDown = react.useCallback((e) => {
|
|
9627
9525
|
const current = inputRef.current;
|
|
9628
|
-
const startAction =
|
|
9526
|
+
const startAction = chunkDCNHUEWQ_js.mapSlideShowStartKey(e, { isPresenting: current.mode === "present" });
|
|
9629
9527
|
if (startAction !== null) {
|
|
9630
9528
|
e.preventDefault();
|
|
9631
9529
|
if (startAction === "fromBeginning") {
|
|
@@ -9635,7 +9533,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9635
9533
|
}
|
|
9636
9534
|
return;
|
|
9637
9535
|
}
|
|
9638
|
-
const { action, dx, dy } =
|
|
9536
|
+
const { action, dx, dy } = chunkDCNHUEWQ_js.mapEditorKey(e, {
|
|
9639
9537
|
canEdit: current.canEdit,
|
|
9640
9538
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9641
9539
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9648,7 +9546,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9648
9546
|
hasSelection: current.hasSelection,
|
|
9649
9547
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9650
9548
|
isDrawing: current.activeTool !== "select",
|
|
9651
|
-
isTextInputTarget:
|
|
9549
|
+
isTextInputTarget: chunkDCNHUEWQ_js.isEditorTextInputTarget(e.target)
|
|
9652
9550
|
});
|
|
9653
9551
|
if (action === null) {
|
|
9654
9552
|
return;
|
|
@@ -9976,7 +9874,7 @@ function useViewerIntegration(input) {
|
|
|
9976
9874
|
return zoom.scale;
|
|
9977
9875
|
},
|
|
9978
9876
|
setZoom(level) {
|
|
9979
|
-
zoom.setScale(
|
|
9877
|
+
zoom.setScale(chunkDCNHUEWQ_js.clampZoomScale(level));
|
|
9980
9878
|
},
|
|
9981
9879
|
zoomIn() {
|
|
9982
9880
|
zoom.handleZoomIn();
|
|
@@ -10194,7 +10092,7 @@ function useReducedMotion() {
|
|
|
10194
10092
|
}
|
|
10195
10093
|
function useViewerOptions() {
|
|
10196
10094
|
const storeRef = react.useRef(null);
|
|
10197
|
-
storeRef.current ??=
|
|
10095
|
+
storeRef.current ??= chunkDCNHUEWQ_js.createViewerOptionsStore();
|
|
10198
10096
|
const store = storeRef.current;
|
|
10199
10097
|
const options = react.useSyncExternalStore(
|
|
10200
10098
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -10203,9 +10101,9 @@ function useViewerOptions() {
|
|
|
10203
10101
|
);
|
|
10204
10102
|
return { optionsStore: store, options };
|
|
10205
10103
|
}
|
|
10206
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10104
|
+
var KNOWN_TAB_IDS = new Set(chunkDCNHUEWQ_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10207
10105
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
10208
|
-
const isHidden = (id) =>
|
|
10106
|
+
const isHidden = (id) => chunkDCNHUEWQ_js.isActionHidden(id, hiddenActions);
|
|
10209
10107
|
const userHidden = new Set(hiddenTabIds);
|
|
10210
10108
|
userHidden.delete("file");
|
|
10211
10109
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
|
|
@@ -10297,12 +10195,12 @@ function useYjsDocumentSync({
|
|
|
10297
10195
|
return;
|
|
10298
10196
|
}
|
|
10299
10197
|
try {
|
|
10300
|
-
const handler = new
|
|
10198
|
+
const handler = new chunkDCNHUEWQ_js.PptxHandler();
|
|
10301
10199
|
await handler.load(sourceBytes.buffer);
|
|
10302
|
-
const currentSlides =
|
|
10200
|
+
const currentSlides = chunkDCNHUEWQ_js.readSlidesFromYDoc(
|
|
10303
10201
|
doc
|
|
10304
10202
|
);
|
|
10305
|
-
const slidesToSave =
|
|
10203
|
+
const slidesToSave = chunkDCNHUEWQ_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10306
10204
|
const bytes = await handler.save(slidesToSave);
|
|
10307
10205
|
config.onWriteBack(bytes);
|
|
10308
10206
|
} catch {
|
|
@@ -10317,10 +10215,10 @@ function useYjsDocumentSync({
|
|
|
10317
10215
|
if (!doc || !isConnected) {
|
|
10318
10216
|
return;
|
|
10319
10217
|
}
|
|
10320
|
-
const docSlides =
|
|
10218
|
+
const docSlides = chunkDCNHUEWQ_js.readSlidesFromYDoc(
|
|
10321
10219
|
doc
|
|
10322
10220
|
);
|
|
10323
|
-
if (!
|
|
10221
|
+
if (!chunkDCNHUEWQ_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10324
10222
|
return;
|
|
10325
10223
|
}
|
|
10326
10224
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10339,11 +10237,11 @@ function useYjsDocumentSync({
|
|
|
10339
10237
|
lastSyncedRef.current = serialized;
|
|
10340
10238
|
void (async () => {
|
|
10341
10239
|
const factories = await getFactories();
|
|
10342
|
-
|
|
10240
|
+
chunkDCNHUEWQ_js.reconcileSlidesInYDoc(
|
|
10343
10241
|
slides,
|
|
10344
10242
|
doc,
|
|
10345
10243
|
factories,
|
|
10346
|
-
|
|
10244
|
+
chunkDCNHUEWQ_js.LOCAL_SYNC_ORIGIN
|
|
10347
10245
|
);
|
|
10348
10246
|
scheduleWriteBack();
|
|
10349
10247
|
})();
|
|
@@ -10357,10 +10255,10 @@ function useYjsDocumentSync({
|
|
|
10357
10255
|
return;
|
|
10358
10256
|
}
|
|
10359
10257
|
const handleChange = (_events, transaction) => {
|
|
10360
|
-
if (transaction?.origin ===
|
|
10258
|
+
if (transaction?.origin === chunkDCNHUEWQ_js.LOCAL_SYNC_ORIGIN) {
|
|
10361
10259
|
return;
|
|
10362
10260
|
}
|
|
10363
|
-
const remoteSlides =
|
|
10261
|
+
const remoteSlides = chunkDCNHUEWQ_js.readSlidesFromYDoc(
|
|
10364
10262
|
doc
|
|
10365
10263
|
);
|
|
10366
10264
|
if (remoteSlides.length === 0) {
|
|
@@ -10376,7 +10274,7 @@ function useYjsDocumentSync({
|
|
|
10376
10274
|
isApplyingRemoteRef.current = false;
|
|
10377
10275
|
scheduleWriteBack();
|
|
10378
10276
|
};
|
|
10379
|
-
const unobserve =
|
|
10277
|
+
const unobserve = chunkDCNHUEWQ_js.observeYDocSlides(
|
|
10380
10278
|
doc,
|
|
10381
10279
|
handleChange
|
|
10382
10280
|
);
|
|
@@ -10414,7 +10312,7 @@ function useBroadcastFollower({
|
|
|
10414
10312
|
if (!broadcaster) {
|
|
10415
10313
|
return;
|
|
10416
10314
|
}
|
|
10417
|
-
if (!
|
|
10315
|
+
if (!chunkDCNHUEWQ_js.shouldAutoFollowBroadcaster({
|
|
10418
10316
|
localRole: collab.config.role,
|
|
10419
10317
|
broadcasterRole: broadcaster.role
|
|
10420
10318
|
})) {
|
|
@@ -10585,7 +10483,7 @@ function subscribeTouchCapability(callback) {
|
|
|
10585
10483
|
function useIsMobile() {
|
|
10586
10484
|
const isTouchDevice = react.useSyncExternalStore(
|
|
10587
10485
|
subscribeTouchCapability,
|
|
10588
|
-
|
|
10486
|
+
chunkDCNHUEWQ_js.detectTouchDevice,
|
|
10589
10487
|
() => false
|
|
10590
10488
|
// server snapshot
|
|
10591
10489
|
);
|
|
@@ -10595,7 +10493,7 @@ function useIsMobile() {
|
|
|
10595
10493
|
const [viewportHeight, setViewportHeight] = react.useState(
|
|
10596
10494
|
() => typeof window === "undefined" ? 768 : window.innerHeight
|
|
10597
10495
|
);
|
|
10598
|
-
const [orientation, setOrientation] = react.useState(
|
|
10496
|
+
const [orientation, setOrientation] = react.useState(chunkDCNHUEWQ_js.detectOrientation);
|
|
10599
10497
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
10600
10498
|
const [initialViewportHeight] = react.useState(
|
|
10601
10499
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -10616,7 +10514,7 @@ function useIsMobile() {
|
|
|
10616
10514
|
return;
|
|
10617
10515
|
}
|
|
10618
10516
|
const handleOrientationChange = () => {
|
|
10619
|
-
setOrientation(
|
|
10517
|
+
setOrientation(chunkDCNHUEWQ_js.detectOrientation());
|
|
10620
10518
|
};
|
|
10621
10519
|
if (screen.orientation) {
|
|
10622
10520
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -10646,7 +10544,7 @@ function useIsMobile() {
|
|
|
10646
10544
|
window.addEventListener("resize", handleResize);
|
|
10647
10545
|
return () => window.removeEventListener("resize", handleResize);
|
|
10648
10546
|
}, [isTouchDevice, initialViewportHeight]);
|
|
10649
|
-
const { isMobile, isTablet, isDesktop } =
|
|
10547
|
+
const { isMobile, isTablet, isDesktop } = chunkDCNHUEWQ_js.deriveViewportBreakpoints(
|
|
10650
10548
|
viewportWidth,
|
|
10651
10549
|
viewportHeight,
|
|
10652
10550
|
isTouchDevice
|
|
@@ -10677,10 +10575,10 @@ function useTouchGestures(input) {
|
|
|
10677
10575
|
if (!el || !enabled) {
|
|
10678
10576
|
return;
|
|
10679
10577
|
}
|
|
10680
|
-
const recognizer =
|
|
10578
|
+
const recognizer = chunkDCNHUEWQ_js.createTouchGestureRecognizer({
|
|
10681
10579
|
getScale: () => scaleRef.current,
|
|
10682
|
-
minScale:
|
|
10683
|
-
maxScale:
|
|
10580
|
+
minScale: chunkDCNHUEWQ_js.MIN_ZOOM_SCALE,
|
|
10581
|
+
maxScale: chunkDCNHUEWQ_js.MAX_ZOOM_SCALE,
|
|
10684
10582
|
callbacks: {
|
|
10685
10583
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10686
10584
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10720,7 +10618,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10720
10618
|
return;
|
|
10721
10619
|
}
|
|
10722
10620
|
const rect = active.getBoundingClientRect();
|
|
10723
|
-
const delta =
|
|
10621
|
+
const delta = chunkDCNHUEWQ_js.computeScrollDelta(
|
|
10724
10622
|
{ top: rect.top, bottom: rect.bottom },
|
|
10725
10623
|
window.innerHeight,
|
|
10726
10624
|
keyboardInset
|
|
@@ -10740,8 +10638,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10740
10638
|
return;
|
|
10741
10639
|
}
|
|
10742
10640
|
const update = () => {
|
|
10743
|
-
const metrics =
|
|
10744
|
-
const inset = metrics ?
|
|
10641
|
+
const metrics = chunkDCNHUEWQ_js.readViewportMetrics(window);
|
|
10642
|
+
const inset = metrics ? chunkDCNHUEWQ_js.computeKeyboardInset(metrics) : 0;
|
|
10745
10643
|
setKeyboardInset(inset);
|
|
10746
10644
|
if (inset > 0) {
|
|
10747
10645
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10752,8 +10650,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10752
10650
|
vv.addEventListener("scroll", update);
|
|
10753
10651
|
const onFocusIn = () => {
|
|
10754
10652
|
window.requestAnimationFrame(() => {
|
|
10755
|
-
const metrics =
|
|
10756
|
-
const inset = metrics ?
|
|
10653
|
+
const metrics = chunkDCNHUEWQ_js.readViewportMetrics(window);
|
|
10654
|
+
const inset = metrics ? chunkDCNHUEWQ_js.computeKeyboardInset(metrics) : 0;
|
|
10757
10655
|
if (inset > 0) {
|
|
10758
10656
|
scrollFocusedIntoView(inset);
|
|
10759
10657
|
}
|
|
@@ -10766,7 +10664,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10766
10664
|
document.removeEventListener("focusin", onFocusIn);
|
|
10767
10665
|
};
|
|
10768
10666
|
}, [enabled]);
|
|
10769
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10667
|
+
return { keyboardInset, isKeyboardOpen: chunkDCNHUEWQ_js.isKeyboardOpen(keyboardInset) };
|
|
10770
10668
|
}
|
|
10771
10669
|
|
|
10772
10670
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10795,21 +10693,21 @@ function buildCanvasProps(input) {
|
|
|
10795
10693
|
} = input;
|
|
10796
10694
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10797
10695
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10798
|
-
const fieldContext =
|
|
10696
|
+
const fieldContext = chunkDCNHUEWQ_js.buildFieldSubstitutionContext({
|
|
10799
10697
|
headerFooter: s.headerFooter,
|
|
10800
10698
|
customProperties: s.customProperties,
|
|
10801
10699
|
slide: activeSlide
|
|
10802
10700
|
});
|
|
10803
10701
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10804
10702
|
const openExternalUrl = (url, target) => {
|
|
10805
|
-
if (
|
|
10703
|
+
if (chunkDCNHUEWQ_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
10806
10704
|
return;
|
|
10807
10705
|
}
|
|
10808
|
-
|
|
10706
|
+
chunkDCNHUEWQ_js.safeOpenUrl(url, target);
|
|
10809
10707
|
};
|
|
10810
10708
|
const handleActionClick = (elementId, action) => {
|
|
10811
10709
|
if (mode === "present") {
|
|
10812
|
-
const resolved =
|
|
10710
|
+
const resolved = chunkDCNHUEWQ_js.resolvePresentationAction(action, { slideCount: slides.length });
|
|
10813
10711
|
if (resolved.intent.kind === "openUrl") {
|
|
10814
10712
|
openExternalUrl(resolved.intent.url);
|
|
10815
10713
|
return;
|
|
@@ -10820,9 +10718,9 @@ function buildCanvasProps(input) {
|
|
|
10820
10718
|
}
|
|
10821
10719
|
};
|
|
10822
10720
|
const handleHyperlinkClick = (url, target) => {
|
|
10823
|
-
if (
|
|
10721
|
+
if (chunkDCNHUEWQ_js.isPpactionUrl(url)) {
|
|
10824
10722
|
if (mode === "present") {
|
|
10825
|
-
const parsed =
|
|
10723
|
+
const parsed = chunkDCNHUEWQ_js.parsePpactionUrl(url);
|
|
10826
10724
|
if (parsed) {
|
|
10827
10725
|
presentation.handlePresentationAction({
|
|
10828
10726
|
action: parsed.action,
|
|
@@ -10928,7 +10826,7 @@ function buildCanvasProps(input) {
|
|
|
10928
10826
|
|
|
10929
10827
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10930
10828
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10931
|
-
return
|
|
10829
|
+
return chunkDCNHUEWQ_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10932
10830
|
}
|
|
10933
10831
|
|
|
10934
10832
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10941,7 +10839,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10941
10839
|
const current = activeSlide.animations ?? [];
|
|
10942
10840
|
if (group === "motionPath") {
|
|
10943
10841
|
propertyHandlers.handleUpdateSlide({
|
|
10944
|
-
animations:
|
|
10842
|
+
animations: chunkDCNHUEWQ_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10945
10843
|
});
|
|
10946
10844
|
return;
|
|
10947
10845
|
}
|
|
@@ -11137,7 +11035,7 @@ function buildToolbarProps(input) {
|
|
|
11137
11035
|
onOpenFile,
|
|
11138
11036
|
onOpenRecentFile,
|
|
11139
11037
|
onCreatePresentation: (templateId) => {
|
|
11140
|
-
s.setSlides(
|
|
11038
|
+
s.setSlides(chunkDCNHUEWQ_js.createBackstagePresentation(templateId));
|
|
11141
11039
|
s.setActiveSlideIndex(0);
|
|
11142
11040
|
s.setSelectedElementId(null);
|
|
11143
11041
|
s.setSelectedElementIds([]);
|
|
@@ -11166,7 +11064,7 @@ function buildToolbarProps(input) {
|
|
|
11166
11064
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
11167
11065
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
11168
11066
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
11169
|
-
templateScheme:
|
|
11067
|
+
templateScheme: chunkDCNHUEWQ_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
11170
11068
|
customShows: s.customShows,
|
|
11171
11069
|
activeCustomShowId: s.activeCustomShowId,
|
|
11172
11070
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -11207,7 +11105,7 @@ function buildToolbarProps(input) {
|
|
|
11207
11105
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
11208
11106
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
11209
11107
|
formatPainterActive: s.formatPainterActive,
|
|
11210
|
-
canActivateFormatPainter:
|
|
11108
|
+
canActivateFormatPainter: chunkDCNHUEWQ_js.hasCopyableFormat(selectedElement),
|
|
11211
11109
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
11212
11110
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
11213
11111
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11285,7 +11183,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11285
11183
|
headerFooter: state.headerFooter,
|
|
11286
11184
|
loading,
|
|
11287
11185
|
error,
|
|
11288
|
-
maxHistoryEntries:
|
|
11186
|
+
maxHistoryEntries: chunkDCNHUEWQ_js.resolveHistoryDepth(viewerOptions),
|
|
11289
11187
|
hasActivePointerInteraction,
|
|
11290
11188
|
pointerCommitNonce: state.pointerCommitNonce,
|
|
11291
11189
|
onDirty: markDocumentDirty,
|
|
@@ -11353,7 +11251,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11353
11251
|
gridSpacingPx,
|
|
11354
11252
|
// Multiplied against the pre-existing 2x baseline; see the matching
|
|
11355
11253
|
// comment in `PowerPointViewer.tsx`.
|
|
11356
|
-
imageExportScale: 2 *
|
|
11254
|
+
imageExportScale: 2 * chunkDCNHUEWQ_js.resolveImageResolutionScale(viewerOptions),
|
|
11357
11255
|
viewerOptions
|
|
11358
11256
|
};
|
|
11359
11257
|
}
|
|
@@ -11369,7 +11267,7 @@ function useCompatibilityToastsState() {
|
|
|
11369
11267
|
}
|
|
11370
11268
|
function useReadOnlyRecommendationState(content) {
|
|
11371
11269
|
const [recommendation, setRecommendation] = react.useState(
|
|
11372
|
-
() =>
|
|
11270
|
+
() => chunkDCNHUEWQ_js.readOnlyRecommendation(void 0)
|
|
11373
11271
|
);
|
|
11374
11272
|
const [bannerHidden, setBannerHidden] = react.useState(false);
|
|
11375
11273
|
const [editAnywayActive, setEditAnywayActive] = react.useState(false);
|
|
@@ -11407,9 +11305,9 @@ function useViewPreferencesSync(input) {
|
|
|
11407
11305
|
setShowGuides
|
|
11408
11306
|
} = input;
|
|
11409
11307
|
react.useEffect(() => {
|
|
11410
|
-
const seeded =
|
|
11308
|
+
const seeded = chunkDCNHUEWQ_js.viewerPreferencesFromViewProperties(
|
|
11411
11309
|
{ viewProperties },
|
|
11412
|
-
{ ...
|
|
11310
|
+
{ ...chunkDCNHUEWQ_js.DEFAULT_VIEWER_PREFERENCES, snapToGrid, snapToObjects: snapToShape, showGuides }
|
|
11413
11311
|
);
|
|
11414
11312
|
setSnapToGrid(seeded.snapToGrid);
|
|
11415
11313
|
setSnapToShape(seeded.snapToObjects ?? snapToShape);
|
|
@@ -11419,7 +11317,7 @@ function useViewPreferencesSync(input) {
|
|
|
11419
11317
|
(prefsOverride) => {
|
|
11420
11318
|
setViewProperties((prev) => {
|
|
11421
11319
|
const merged = {
|
|
11422
|
-
...
|
|
11320
|
+
...chunkDCNHUEWQ_js.DEFAULT_VIEWER_PREFERENCES,
|
|
11423
11321
|
snapToGrid,
|
|
11424
11322
|
snapToObjects: snapToShape,
|
|
11425
11323
|
showGuides,
|
|
@@ -11427,7 +11325,7 @@ function useViewPreferencesSync(input) {
|
|
|
11427
11325
|
gridSpacingCy: prev?.gridSpacing?.cy,
|
|
11428
11326
|
...prefsOverride
|
|
11429
11327
|
};
|
|
11430
|
-
const patch =
|
|
11328
|
+
const patch = chunkDCNHUEWQ_js.viewPropertiesPatchFromPreferences(merged);
|
|
11431
11329
|
return {
|
|
11432
11330
|
...prev,
|
|
11433
11331
|
slideViewPr: { ...prev?.slideViewPr, ...patch.slideViewPr },
|
|
@@ -11645,7 +11543,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11645
11543
|
}, [incomingContent]);
|
|
11646
11544
|
const onOpenFile = react.useCallback(() => {
|
|
11647
11545
|
void (async () => {
|
|
11648
|
-
const picked = await
|
|
11546
|
+
const picked = await chunkDCNHUEWQ_js.openPptxFile();
|
|
11649
11547
|
if (picked) {
|
|
11650
11548
|
setContent(picked.buffer);
|
|
11651
11549
|
}
|
|
@@ -11653,7 +11551,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11653
11551
|
}, []);
|
|
11654
11552
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11655
11553
|
void (async () => {
|
|
11656
|
-
const bytes = await
|
|
11554
|
+
const bytes = await chunkDCNHUEWQ_js.readBackstageRecentFile(key);
|
|
11657
11555
|
if (bytes) {
|
|
11658
11556
|
setContent(bytes);
|
|
11659
11557
|
}
|