pptx-react-viewer 3.5.0 → 3.5.2
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 +23 -0
- package/dist/{AiChatPanel-M7RSMOZV.js → AiChatPanel-AR6FYCHC.js} +24 -24
- package/dist/AiChatPanel-AR6FYCHC.js.br +0 -0
- package/dist/AiChatPanel-AR6FYCHC.js.gz +0 -0
- package/dist/{AiChatPanel-KZX4NZ5R.mjs → AiChatPanel-GZCDFIGE.mjs} +3 -3
- package/dist/AiChatPanel-GZCDFIGE.mjs.br +0 -0
- package/dist/AiChatPanel-GZCDFIGE.mjs.gz +0 -0
- package/dist/{Area3DChartScene-AD6BO2VM.mjs → Area3DChartScene-EZFIY4YQ.mjs} +1 -1
- package/dist/Area3DChartScene-EZFIY4YQ.mjs.br +0 -0
- package/dist/Area3DChartScene-EZFIY4YQ.mjs.gz +0 -0
- package/dist/{Area3DChartScene-7AYWOGBC.js → Area3DChartScene-NB6Q6KNP.js} +2 -2
- package/dist/Area3DChartScene-NB6Q6KNP.js.br +0 -0
- package/dist/Area3DChartScene-NB6Q6KNP.js.gz +0 -0
- package/dist/{Bar3DChartScene-FWKMBT4O.js → Bar3DChartScene-3A6MUJW7.js} +2 -2
- package/dist/Bar3DChartScene-3A6MUJW7.js.br +0 -0
- package/dist/Bar3DChartScene-3A6MUJW7.js.gz +0 -0
- package/dist/{Bar3DChartScene-JOGF3C5E.mjs → Bar3DChartScene-ZVTJM5EB.mjs} +1 -1
- package/dist/Bar3DChartScene-ZVTJM5EB.mjs.br +0 -0
- package/dist/Bar3DChartScene-ZVTJM5EB.mjs.gz +0 -0
- package/dist/{Line3DChartScene-X2BJNGIK.js → Line3DChartScene-RQGOPRGY.js} +2 -2
- package/dist/Line3DChartScene-RQGOPRGY.js.br +0 -0
- package/dist/Line3DChartScene-RQGOPRGY.js.gz +0 -0
- package/dist/{Line3DChartScene-ADORAAXV.mjs → Line3DChartScene-XTWON2Q4.mjs} +1 -1
- package/dist/Line3DChartScene-XTWON2Q4.mjs.br +0 -0
- package/dist/Line3DChartScene-XTWON2Q4.mjs.gz +0 -0
- package/dist/{Model3DScene-RORDMQ6Q.mjs → Model3DScene-42VYK4DR.mjs} +1 -1
- package/dist/Model3DScene-42VYK4DR.mjs.br +0 -0
- package/dist/Model3DScene-42VYK4DR.mjs.gz +0 -0
- package/dist/{Model3DScene-KSZHZAVD.js → Model3DScene-V4WPP5CC.js} +2 -2
- package/dist/{Model3DScene-KSZHZAVD.js.br → Model3DScene-V4WPP5CC.js.br} +0 -0
- package/dist/Model3DScene-V4WPP5CC.js.gz +0 -0
- package/dist/{PieChart3DScene-IXJHU3MI.mjs → PieChart3DScene-GHNKD5TN.mjs} +1 -1
- package/dist/PieChart3DScene-GHNKD5TN.mjs.br +0 -0
- package/dist/PieChart3DScene-GHNKD5TN.mjs.gz +0 -0
- package/dist/{PieChart3DScene-BXMI7U2X.js → PieChart3DScene-UVYGUNRM.js} +2 -2
- package/dist/PieChart3DScene-UVYGUNRM.js.br +0 -0
- package/dist/PieChart3DScene-UVYGUNRM.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-SJ2IDLP6.mjs → SurfaceChart3DScene-AEKTCMYZ.mjs} +1 -1
- package/dist/SurfaceChart3DScene-AEKTCMYZ.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-AEKTCMYZ.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-TTBGVNYL.js → SurfaceChart3DScene-E7OHBIM3.js} +2 -2
- package/dist/{SurfaceChart3DScene-TTBGVNYL.js.br → SurfaceChart3DScene-E7OHBIM3.js.br} +0 -0
- package/dist/SurfaceChart3DScene-E7OHBIM3.js.gz +0 -0
- package/dist/{chunk-X6OJYCTW.mjs → chunk-3LYWPIRW.mjs} +1 -1
- package/dist/chunk-3LYWPIRW.mjs.br +0 -0
- package/dist/chunk-3LYWPIRW.mjs.gz +0 -0
- package/dist/{chunk-C7ZSRYF4.mjs → chunk-5F4RXVTA.mjs} +7 -2
- package/dist/chunk-5F4RXVTA.mjs.br +0 -0
- package/dist/chunk-5F4RXVTA.mjs.gz +0 -0
- package/dist/{chunk-AU5YFUUK.js → chunk-5FIC2LG3.js} +339 -206
- package/dist/chunk-5FIC2LG3.js.br +0 -0
- package/dist/chunk-5FIC2LG3.js.gz +0 -0
- package/dist/{chunk-24XC5C2B.mjs → chunk-HNTAGERM.mjs} +5 -1
- package/dist/chunk-HNTAGERM.mjs.br +0 -0
- package/dist/chunk-HNTAGERM.mjs.gz +0 -0
- package/dist/{chunk-AEP6X24D.js → chunk-LIIV45TR.js} +164 -160
- package/dist/chunk-LIIV45TR.js.br +0 -0
- package/dist/chunk-LIIV45TR.js.gz +0 -0
- package/dist/{chunk-X7L3RHFQ.mjs → chunk-OHNNWSCP.mjs} +337 -207
- package/dist/chunk-OHNNWSCP.mjs.br +0 -0
- package/dist/chunk-OHNNWSCP.mjs.gz +0 -0
- package/dist/{chunk-XSHYXVPD.js → chunk-OTKVJT4R.js} +1197 -1184
- package/dist/chunk-OTKVJT4R.js.br +0 -0
- package/dist/chunk-OTKVJT4R.js.gz +0 -0
- package/dist/{chunk-DUC32SQJ.mjs → chunk-RCPRMTPJ.mjs} +41 -28
- package/dist/chunk-RCPRMTPJ.mjs.br +0 -0
- package/dist/chunk-RCPRMTPJ.mjs.gz +0 -0
- package/dist/{chunk-JTS7AZYQ.js → chunk-VEU3QLEZ.js} +5 -5
- package/dist/chunk-VEU3QLEZ.js.br +0 -0
- package/dist/chunk-VEU3QLEZ.js.gz +0 -0
- package/dist/{chunk-HCTJCUGP.js → chunk-XGNK2IZ4.js} +435 -430
- package/dist/chunk-XGNK2IZ4.js.br +0 -0
- package/dist/chunk-XGNK2IZ4.js.gz +0 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +45 -45
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +1 -0
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.d.ts +1 -0
- package/dist/viewer/index.js +26 -26
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-KZX4NZ5R.mjs.br +0 -0
- package/dist/AiChatPanel-KZX4NZ5R.mjs.gz +0 -0
- package/dist/AiChatPanel-M7RSMOZV.js.br +0 -0
- package/dist/AiChatPanel-M7RSMOZV.js.gz +0 -0
- package/dist/Area3DChartScene-7AYWOGBC.js.br +0 -0
- package/dist/Area3DChartScene-7AYWOGBC.js.gz +0 -0
- package/dist/Area3DChartScene-AD6BO2VM.mjs.br +0 -3
- package/dist/Area3DChartScene-AD6BO2VM.mjs.gz +0 -0
- package/dist/Bar3DChartScene-FWKMBT4O.js.br +0 -0
- package/dist/Bar3DChartScene-FWKMBT4O.js.gz +0 -0
- package/dist/Bar3DChartScene-JOGF3C5E.mjs.br +0 -0
- package/dist/Bar3DChartScene-JOGF3C5E.mjs.gz +0 -0
- package/dist/Line3DChartScene-ADORAAXV.mjs.br +0 -3
- package/dist/Line3DChartScene-ADORAAXV.mjs.gz +0 -0
- package/dist/Line3DChartScene-X2BJNGIK.js.br +0 -0
- package/dist/Line3DChartScene-X2BJNGIK.js.gz +0 -0
- package/dist/Model3DScene-KSZHZAVD.js.gz +0 -0
- package/dist/Model3DScene-RORDMQ6Q.mjs.br +0 -0
- package/dist/Model3DScene-RORDMQ6Q.mjs.gz +0 -0
- package/dist/PieChart3DScene-BXMI7U2X.js.br +0 -0
- package/dist/PieChart3DScene-BXMI7U2X.js.gz +0 -0
- package/dist/PieChart3DScene-IXJHU3MI.mjs.br +0 -0
- package/dist/PieChart3DScene-IXJHU3MI.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-SJ2IDLP6.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-SJ2IDLP6.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-TTBGVNYL.js.gz +0 -0
- package/dist/chunk-24XC5C2B.mjs.br +0 -0
- package/dist/chunk-24XC5C2B.mjs.gz +0 -0
- package/dist/chunk-AEP6X24D.js.br +0 -0
- package/dist/chunk-AEP6X24D.js.gz +0 -0
- package/dist/chunk-AU5YFUUK.js.br +0 -0
- package/dist/chunk-AU5YFUUK.js.gz +0 -0
- package/dist/chunk-C7ZSRYF4.mjs.br +0 -0
- package/dist/chunk-C7ZSRYF4.mjs.gz +0 -0
- package/dist/chunk-DUC32SQJ.mjs.br +0 -0
- package/dist/chunk-DUC32SQJ.mjs.gz +0 -0
- package/dist/chunk-HCTJCUGP.js.br +0 -0
- package/dist/chunk-HCTJCUGP.js.gz +0 -0
- package/dist/chunk-JTS7AZYQ.js.br +0 -0
- package/dist/chunk-JTS7AZYQ.js.gz +0 -0
- package/dist/chunk-X6OJYCTW.mjs.br +0 -0
- package/dist/chunk-X6OJYCTW.mjs.gz +0 -0
- package/dist/chunk-X7L3RHFQ.mjs.br +0 -0
- package/dist/chunk-X7L3RHFQ.mjs.gz +0 -0
- package/dist/chunk-XSHYXVPD.js.br +0 -0
- package/dist/chunk-XSHYXVPD.js.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkLIIV45TR_js = require('./chunk-LIIV45TR.js');
|
|
4
|
+
var chunk5FIC2LG3_js = require('./chunk-5FIC2LG3.js');
|
|
5
5
|
var chunkUTIMT5CZ_js = require('./chunk-UTIMT5CZ.js');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var reactI18next = require('react-i18next');
|
|
@@ -9,7 +9,7 @@ var reactI18next = require('react-i18next');
|
|
|
9
9
|
function useVirtualizedSlides({
|
|
10
10
|
totalItems,
|
|
11
11
|
itemHeight,
|
|
12
|
-
overscan =
|
|
12
|
+
overscan = chunk5FIC2LG3_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 = chunk5FIC2LG3_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 ??= chunk5FIC2LG3_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 >= chunk5FIC2LG3_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
|
+
}, chunk5FIC2LG3_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 = chunk5FIC2LG3_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
|
+
chunk5FIC2LG3_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 = chunk5FIC2LG3_js.validateRoomId(config.roomId);
|
|
244
244
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
245
|
-
departureRef.current =
|
|
245
|
+
departureRef.current = chunk5FIC2LG3_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 = chunk5FIC2LG3_js.validateRoomId(config.roomId);
|
|
288
|
+
const transport = config.transport ?? chunk5FIC2LG3_js.resolveTransportForServerUrl(config.serverUrl);
|
|
289
289
|
if (transport === "webrtc") {
|
|
290
290
|
await initWebrtc();
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
293
|
+
if (chunk5FIC2LG3_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 = chunk5FIC2LG3_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
|
+
chunk5FIC2LG3_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
|
+
}, chunk5FIC2LG3_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
|
+
chunk5FIC2LG3_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 = chunk5FIC2LG3_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 = chunk5FIC2LG3_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(chunk5FIC2LG3_js.cloneSlide),
|
|
531
|
+
templateElementsBySlideId: chunk5FIC2LG3_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(chunk5FIC2LG3_js.cloneSlide));
|
|
545
545
|
setTemplateElementsBySlideId(
|
|
546
|
-
|
|
546
|
+
chunk5FIC2LG3_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 = chunkLIIV45TR_js.cloneHistorySnapshot(previousSnapshot);
|
|
586
|
+
lastHistorySnapshotRef.current = chunkLIIV45TR_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 = chunkLIIV45TR_js.cloneHistorySnapshot(nextSnapshot);
|
|
608
|
+
lastHistorySnapshotRef.current = chunkLIIV45TR_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 = chunkLIIV45TR_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 = chunkLIIV45TR_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(chunkLIIV45TR_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 = chunkLIIV45TR_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(chunk5FIC2LG3_js.createWheelStepBuffer());
|
|
747
747
|
const storeRef = react.useRef(null);
|
|
748
|
-
storeRef.current ??=
|
|
748
|
+
storeRef.current ??= chunk5FIC2LG3_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 = chunk5FIC2LG3_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, chunkLIIV45TR_js.MIN_ELEMENT_SIZE));
|
|
847
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkLIIV45TR_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, chunkLIIV45TR_js.MIN_ELEMENT_SIZE);
|
|
854
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkLIIV45TR_js.MIN_ELEMENT_SIZE);
|
|
855
855
|
const availableWidth = Math.max(
|
|
856
|
-
effectiveEditorDimensions.width -
|
|
857
|
-
|
|
856
|
+
effectiveEditorDimensions.width - chunkLIIV45TR_js.ZOOM_TO_SELECTION_PADDING,
|
|
857
|
+
chunkLIIV45TR_js.MIN_ELEMENT_SIZE
|
|
858
858
|
);
|
|
859
859
|
const availableHeight = Math.max(
|
|
860
|
-
effectiveEditorDimensions.height -
|
|
861
|
-
|
|
860
|
+
effectiveEditorDimensions.height - chunkLIIV45TR_js.ZOOM_TO_SELECTION_PADDING,
|
|
861
|
+
chunkLIIV45TR_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 = chunk5FIC2LG3_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 = chunk5FIC2LG3_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: chunk5FIC2LG3_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
|
|
893
893
|
});
|
|
894
894
|
},
|
|
895
895
|
[store]
|
|
@@ -1057,8 +1057,8 @@ function scheduleOpeningAutoPlayGroup(controller, ctx) {
|
|
|
1057
1057
|
if (!group) {
|
|
1058
1058
|
return;
|
|
1059
1059
|
}
|
|
1060
|
-
|
|
1061
|
-
|
|
1060
|
+
chunk5FIC2LG3_js.playGroup(controller, group, ctx);
|
|
1061
|
+
chunk5FIC2LG3_js.scheduleAutoAdvanceChain(controller, ctx);
|
|
1062
1062
|
}, firstGroup.autoAdvanceDelayMs ?? 0);
|
|
1063
1063
|
ctx.timers.push(timer);
|
|
1064
1064
|
}
|
|
@@ -1077,7 +1077,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1077
1077
|
}))
|
|
1078
1078
|
);
|
|
1079
1079
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1080
|
-
const delay =
|
|
1080
|
+
const delay = chunk5FIC2LG3_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1081
1081
|
const timer = window.setTimeout(() => {
|
|
1082
1082
|
setPresentationAnimations(
|
|
1083
1083
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1119,7 +1119,7 @@ function useAnimationPlayback(input) {
|
|
|
1119
1119
|
}, [onPlayActionSound]);
|
|
1120
1120
|
react.useEffect(() => {
|
|
1121
1121
|
return () => {
|
|
1122
|
-
|
|
1122
|
+
chunk5FIC2LG3_js.cancelBuildReveal(buildRafRef);
|
|
1123
1123
|
};
|
|
1124
1124
|
}, []);
|
|
1125
1125
|
const clearPresentationTimers = react.useCallback(() => {
|
|
@@ -1127,7 +1127,7 @@ function useAnimationPlayback(input) {
|
|
|
1127
1127
|
window.clearTimeout(timer);
|
|
1128
1128
|
});
|
|
1129
1129
|
presentationTimersRef.current = [];
|
|
1130
|
-
|
|
1130
|
+
chunk5FIC2LG3_js.cancelBuildReveal(buildRafRef);
|
|
1131
1131
|
activeAnimationGroupRef.current = null;
|
|
1132
1132
|
activeAnimationEndAtRef.current = 0;
|
|
1133
1133
|
}, []);
|
|
@@ -1137,7 +1137,7 @@ function useAnimationPlayback(input) {
|
|
|
1137
1137
|
}, []);
|
|
1138
1138
|
const resetSlideTimeline = react.useCallback(
|
|
1139
1139
|
(slideIndex) => {
|
|
1140
|
-
|
|
1140
|
+
chunk5FIC2LG3_js.cancelBuildReveal(buildRafRef);
|
|
1141
1141
|
const slide = slides[slideIndex];
|
|
1142
1142
|
if (!slide) {
|
|
1143
1143
|
controllerRef.current = null;
|
|
@@ -1147,7 +1147,7 @@ function useAnimationPlayback(input) {
|
|
|
1147
1147
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1148
1148
|
return;
|
|
1149
1149
|
}
|
|
1150
|
-
const controller =
|
|
1150
|
+
const controller = chunk5FIC2LG3_js.PresentationAnimationController.fromSlide(slide);
|
|
1151
1151
|
controllerRef.current = controller;
|
|
1152
1152
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1153
1153
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1164,11 +1164,11 @@ function useAnimationPlayback(input) {
|
|
|
1164
1164
|
const activeGroup = activeAnimationGroupRef.current;
|
|
1165
1165
|
if (controller && controller.hasMoreSteps() && shouldSeekAnimationGroup(activeGroup, activeAnimationEndAtRef.current, performance.now())) {
|
|
1166
1166
|
finishDomAnimationsForGroup(activeGroup);
|
|
1167
|
-
const buildIds =
|
|
1167
|
+
const buildIds = chunk5FIC2LG3_js.PresentationAnimationController.collectBuildStepIds(activeGroup);
|
|
1168
1168
|
const completedStates = controller.computeStatesFor(buildIds);
|
|
1169
1169
|
clearPresentationTimers();
|
|
1170
1170
|
finishAnimationGroupSteps(activeGroup, setPresentationElementStates, completedStates);
|
|
1171
|
-
|
|
1171
|
+
chunk5FIC2LG3_js.scheduleAutoAdvanceChain(controller, buildPlaybackContext());
|
|
1172
1172
|
return true;
|
|
1173
1173
|
}
|
|
1174
1174
|
if (!controller || !controller.hasMoreSteps()) {
|
|
@@ -1179,9 +1179,9 @@ function useAnimationPlayback(input) {
|
|
|
1179
1179
|
return false;
|
|
1180
1180
|
}
|
|
1181
1181
|
const ctx = buildPlaybackContext();
|
|
1182
|
-
|
|
1182
|
+
chunk5FIC2LG3_js.playGroup(controller, group, ctx);
|
|
1183
1183
|
markAnimationGroupActive(group);
|
|
1184
|
-
|
|
1184
|
+
chunk5FIC2LG3_js.scheduleAutoAdvanceChain(controller, ctx);
|
|
1185
1185
|
return true;
|
|
1186
1186
|
}, [animationsEnabled, buildPlaybackContext, clearPresentationTimers, markAnimationGroupActive]);
|
|
1187
1187
|
const handleInteractiveShapeClick = react.useCallback(
|
|
@@ -1194,7 +1194,7 @@ function useAnimationPlayback(input) {
|
|
|
1194
1194
|
if (!group) {
|
|
1195
1195
|
return false;
|
|
1196
1196
|
}
|
|
1197
|
-
|
|
1197
|
+
chunk5FIC2LG3_js.playGroup(controller, group, buildPlaybackContext());
|
|
1198
1198
|
return true;
|
|
1199
1199
|
},
|
|
1200
1200
|
[buildPlaybackContext]
|
|
@@ -1213,7 +1213,7 @@ function useAnimationPlayback(input) {
|
|
|
1213
1213
|
if (!group) {
|
|
1214
1214
|
return false;
|
|
1215
1215
|
}
|
|
1216
|
-
|
|
1216
|
+
chunk5FIC2LG3_js.playGroup(controller, group, buildPlaybackContext());
|
|
1217
1217
|
return true;
|
|
1218
1218
|
},
|
|
1219
1219
|
[animationsEnabled, buildPlaybackContext]
|
|
@@ -1294,12 +1294,12 @@ function useAnimationPlayback(input) {
|
|
|
1294
1294
|
presentationTimersRef
|
|
1295
1295
|
};
|
|
1296
1296
|
}
|
|
1297
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1298
|
-
var AUDIENCE_HASH =
|
|
1299
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1300
|
-
var AUDIENCE_NONCE_KEY =
|
|
1297
|
+
var PRESENTER_CHANNEL_NAME = chunk5FIC2LG3_js.PRESENTATION_CHANNEL_NAME;
|
|
1298
|
+
var AUDIENCE_HASH = chunk5FIC2LG3_js.PRESENTATION_HASH;
|
|
1299
|
+
var PRESENTER_MSG_ORIGIN = chunk5FIC2LG3_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1300
|
+
var AUDIENCE_NONCE_KEY = chunk5FIC2LG3_js.PRESENTATION_NONCE_KEY;
|
|
1301
1301
|
function generateSessionId() {
|
|
1302
|
-
return
|
|
1302
|
+
return chunk5FIC2LG3_js.createPresentationSessionId();
|
|
1303
1303
|
}
|
|
1304
1304
|
function parseAudienceNonce() {
|
|
1305
1305
|
const hash = window.location.hash;
|
|
@@ -1335,7 +1335,7 @@ function usePresenterWindow(input) {
|
|
|
1335
1335
|
}, []);
|
|
1336
1336
|
const swapDisplays = react.useCallback(async () => {
|
|
1337
1337
|
const audience = audienceWindowRef.current;
|
|
1338
|
-
return audience && !audience.closed ?
|
|
1338
|
+
return audience && !audience.closed ? chunk5FIC2LG3_js.swapPresentationWindows(window, audience) : false;
|
|
1339
1339
|
}, []);
|
|
1340
1340
|
const syncSlideToAudience = react.useCallback(
|
|
1341
1341
|
(slideIndex) => {
|
|
@@ -1399,7 +1399,7 @@ function usePresenterWindow(input) {
|
|
|
1399
1399
|
pollTimerRef.current = null;
|
|
1400
1400
|
}
|
|
1401
1401
|
if (closingSessionId) {
|
|
1402
|
-
void
|
|
1402
|
+
void chunk5FIC2LG3_js.clearAudienceContent(closingSessionId);
|
|
1403
1403
|
}
|
|
1404
1404
|
}, [getChannel]);
|
|
1405
1405
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1417,10 +1417,10 @@ function usePresenterWindow(input) {
|
|
|
1417
1417
|
audienceWindowRef.current = blankWin;
|
|
1418
1418
|
const sessionId = generateSessionId();
|
|
1419
1419
|
sessionIdRef.current = sessionId;
|
|
1420
|
-
const audienceUrl =
|
|
1421
|
-
void
|
|
1420
|
+
const audienceUrl = chunk5FIC2LG3_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1421
|
+
void chunk5FIC2LG3_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1422
1422
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1423
|
-
|
|
1423
|
+
chunk5FIC2LG3_js.placeAudienceWindow(blankWin, placement);
|
|
1424
1424
|
}
|
|
1425
1425
|
return void 0;
|
|
1426
1426
|
});
|
|
@@ -1450,7 +1450,7 @@ function usePresenterWindow(input) {
|
|
|
1450
1450
|
}
|
|
1451
1451
|
};
|
|
1452
1452
|
if (content) {
|
|
1453
|
-
void
|
|
1453
|
+
void chunk5FIC2LG3_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1454
1454
|
} else {
|
|
1455
1455
|
navigateOrClose(true);
|
|
1456
1456
|
}
|
|
@@ -1476,7 +1476,7 @@ function usePresenterWindow(input) {
|
|
|
1476
1476
|
}
|
|
1477
1477
|
const handleMessage = (event) => {
|
|
1478
1478
|
const message = event.data;
|
|
1479
|
-
if (
|
|
1479
|
+
if (chunk5FIC2LG3_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1480
1480
|
syncStateToAudience(snapshotRef.current);
|
|
1481
1481
|
}
|
|
1482
1482
|
};
|
|
@@ -1505,7 +1505,7 @@ function usePresenterWindow(input) {
|
|
|
1505
1505
|
react.useEffect(() => {
|
|
1506
1506
|
const handleBeforeUnload = () => {
|
|
1507
1507
|
if (sessionIdRef.current) {
|
|
1508
|
-
void
|
|
1508
|
+
void chunk5FIC2LG3_js.clearAudienceContent(sessionIdRef.current);
|
|
1509
1509
|
}
|
|
1510
1510
|
};
|
|
1511
1511
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1567,7 +1567,7 @@ function useAudienceMode(input) {
|
|
|
1567
1567
|
}
|
|
1568
1568
|
channel.onmessage = (event) => {
|
|
1569
1569
|
const data = event.data;
|
|
1570
|
-
if (!
|
|
1570
|
+
if (!chunk5FIC2LG3_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1571
1571
|
return;
|
|
1572
1572
|
}
|
|
1573
1573
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1583,16 +1583,16 @@ function useAudienceMode(input) {
|
|
|
1583
1583
|
}
|
|
1584
1584
|
if (data.type === "presenter-exit") {
|
|
1585
1585
|
if (expectedSessionId) {
|
|
1586
|
-
void
|
|
1586
|
+
void chunk5FIC2LG3_js.clearAudienceContent(expectedSessionId);
|
|
1587
1587
|
}
|
|
1588
|
-
if (
|
|
1588
|
+
if (chunk5FIC2LG3_js.endAudienceDisplay(window)) {
|
|
1589
1589
|
handlers.onPresenterEnded?.();
|
|
1590
1590
|
}
|
|
1591
1591
|
}
|
|
1592
1592
|
};
|
|
1593
1593
|
if (expectedSessionId) {
|
|
1594
1594
|
channel.postMessage({
|
|
1595
|
-
origin:
|
|
1595
|
+
origin: chunk5FIC2LG3_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1596
1596
|
type: "audience-ready",
|
|
1597
1597
|
sessionId: expectedSessionId
|
|
1598
1598
|
});
|
|
@@ -1606,7 +1606,7 @@ function useAudienceMode(input) {
|
|
|
1606
1606
|
}, []);
|
|
1607
1607
|
}
|
|
1608
1608
|
function usePresentationKeyboard(input) {
|
|
1609
|
-
const wheelBufferRef = react.useRef(
|
|
1609
|
+
const wheelBufferRef = react.useRef(chunk5FIC2LG3_js.createWheelStepBuffer());
|
|
1610
1610
|
const {
|
|
1611
1611
|
mode,
|
|
1612
1612
|
movePresentationSlide,
|
|
@@ -1627,14 +1627,14 @@ function usePresentationKeyboard(input) {
|
|
|
1627
1627
|
presentationSlideIndex,
|
|
1628
1628
|
setShowRehearsalSummary
|
|
1629
1629
|
} = input;
|
|
1630
|
-
const keyBufferRef = react.useRef(
|
|
1630
|
+
const keyBufferRef = react.useRef(chunk5FIC2LG3_js.createPresentationKeyBuffer());
|
|
1631
1631
|
react.useEffect(() => {
|
|
1632
|
-
if (mode !== "present" || !
|
|
1633
|
-
keyBufferRef.current =
|
|
1632
|
+
if (mode !== "present" || !chunk5FIC2LG3_js.acceptsPresentationInput()) {
|
|
1633
|
+
keyBufferRef.current = chunk5FIC2LG3_js.createPresentationKeyBuffer();
|
|
1634
1634
|
return;
|
|
1635
1635
|
}
|
|
1636
1636
|
const handleKeyDown = (event) => {
|
|
1637
|
-
const mapped =
|
|
1637
|
+
const mapped = chunk5FIC2LG3_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1638
1638
|
if (mapped.action === "none") {
|
|
1639
1639
|
return;
|
|
1640
1640
|
}
|
|
@@ -1654,12 +1654,12 @@ function usePresentationKeyboard(input) {
|
|
|
1654
1654
|
movePresentationSlide(-1);
|
|
1655
1655
|
return;
|
|
1656
1656
|
case "first": {
|
|
1657
|
-
const first =
|
|
1657
|
+
const first = chunk5FIC2LG3_js.firstShowSlideIndex(showSlideIndexes);
|
|
1658
1658
|
navigateToSlide(first ?? 0);
|
|
1659
1659
|
return;
|
|
1660
1660
|
}
|
|
1661
1661
|
case "last": {
|
|
1662
|
-
const last =
|
|
1662
|
+
const last = chunk5FIC2LG3_js.lastShowSlideIndex(showSlideIndexes);
|
|
1663
1663
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1664
1664
|
return;
|
|
1665
1665
|
}
|
|
@@ -1697,10 +1697,10 @@ function usePresentationKeyboard(input) {
|
|
|
1697
1697
|
}
|
|
1698
1698
|
};
|
|
1699
1699
|
const handleWheel = (event) => {
|
|
1700
|
-
if (mode !== "present" || !
|
|
1700
|
+
if (mode !== "present" || !chunk5FIC2LG3_js.acceptsPresentationInput()) {
|
|
1701
1701
|
return;
|
|
1702
1702
|
}
|
|
1703
|
-
const mapped =
|
|
1703
|
+
const mapped = chunk5FIC2LG3_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1704
1704
|
if (mapped.intent === "next-slide") {
|
|
1705
1705
|
event.preventDefault();
|
|
1706
1706
|
movePresentationSlide(1);
|
|
@@ -1833,7 +1833,7 @@ function useRehearsalTimings(input) {
|
|
|
1833
1833
|
|
|
1834
1834
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1835
1835
|
function handlePresentationActionImpl(action, deps) {
|
|
1836
|
-
|
|
1836
|
+
chunk5FIC2LG3_js.runPresentationAction(
|
|
1837
1837
|
action,
|
|
1838
1838
|
{ slideCount: deps.slidesLength, ...deps.elementId ? { elementId: deps.elementId } : {} },
|
|
1839
1839
|
{
|
|
@@ -1861,7 +1861,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1861
1861
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1862
1862
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1863
1863
|
const transition = deps.reverse ? deps.slides[deps.currentSlideIndex]?.transition : incomingSlide?.transition;
|
|
1864
|
-
const durationMs = deps.playTransition ?
|
|
1864
|
+
const durationMs = deps.playTransition ? chunk5FIC2LG3_js.resolveTransitionDurationMs(transition) : 0;
|
|
1865
1865
|
deps.clearPresentationTimers();
|
|
1866
1866
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1867
1867
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1926,7 +1926,7 @@ function useSlideNavigation(input) {
|
|
|
1926
1926
|
});
|
|
1927
1927
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1928
1928
|
(slideIndex) => {
|
|
1929
|
-
const delayMs =
|
|
1929
|
+
const delayMs = chunk5FIC2LG3_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1930
1930
|
if (delayMs === void 0) {
|
|
1931
1931
|
return;
|
|
1932
1932
|
}
|
|
@@ -1949,7 +1949,7 @@ function useSlideNavigation(input) {
|
|
|
1949
1949
|
if (availableSlideIndexes.length === 0) {
|
|
1950
1950
|
return;
|
|
1951
1951
|
}
|
|
1952
|
-
const pastLastSlide = direction === 1 && !
|
|
1952
|
+
const pastLastSlide = direction === 1 && !chunk5FIC2LG3_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1953
1953
|
if (rehearsing && pastLastSlide) {
|
|
1954
1954
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1955
1955
|
try {
|
|
@@ -1967,9 +1967,9 @@ function useSlideNavigation(input) {
|
|
|
1967
1967
|
onAdvancePastLastSlide();
|
|
1968
1968
|
return;
|
|
1969
1969
|
}
|
|
1970
|
-
const nextSlideIndex = direction === 1 ?
|
|
1970
|
+
const nextSlideIndex = direction === 1 ? chunk5FIC2LG3_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1971
1971
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
1972
|
-
}) :
|
|
1972
|
+
}) : chunk5FIC2LG3_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
1973
1973
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
1974
1974
|
return;
|
|
1975
1975
|
}
|
|
@@ -2144,7 +2144,7 @@ function createCustomShowRunner(deps) {
|
|
|
2144
2144
|
return;
|
|
2145
2145
|
}
|
|
2146
2146
|
origin = returnAfter ? { showId: deps.getActiveCustomShowId(), slideIndex: deps.getPresentationSlideIndex() } : null;
|
|
2147
|
-
const first =
|
|
2147
|
+
const first = chunk5FIC2LG3_js.firstShowSlideIndex(chunk5FIC2LG3_js.resolveShowSlideIndexes(deps.getSlides(), target));
|
|
2148
2148
|
deps.setActiveCustomShowId(customShowId);
|
|
2149
2149
|
if (first !== void 0) {
|
|
2150
2150
|
deps.navigateToSlide(first);
|
|
@@ -2221,22 +2221,22 @@ function usePresentationActionExtensions(input) {
|
|
|
2221
2221
|
}
|
|
2222
2222
|
}, [navigateToSlideViaRef]);
|
|
2223
2223
|
const onOpenFile = react.useCallback((target) => {
|
|
2224
|
-
|
|
2224
|
+
chunk5FIC2LG3_js.safeOpenUrl(target);
|
|
2225
2225
|
}, []);
|
|
2226
2226
|
const onOpenPresentation = react.useCallback((target) => {
|
|
2227
|
-
|
|
2227
|
+
chunk5FIC2LG3_js.safeOpenUrl(target);
|
|
2228
2228
|
}, []);
|
|
2229
2229
|
const onPlayMedia = react.useCallback(
|
|
2230
2230
|
(elementId) => {
|
|
2231
|
-
|
|
2231
|
+
chunk5FIC2LG3_js.toggleStageElementMedia(containerRef.current, elementId);
|
|
2232
2232
|
},
|
|
2233
2233
|
[containerRef]
|
|
2234
2234
|
);
|
|
2235
2235
|
const onOleVerb = react.useCallback(
|
|
2236
2236
|
(verb, elementId) => {
|
|
2237
|
-
const target =
|
|
2237
|
+
const target = chunk5FIC2LG3_js.resolveOleVerbTarget(slides[presentationSlideIndex], elementId, verb);
|
|
2238
2238
|
if (target) {
|
|
2239
|
-
|
|
2239
|
+
chunk5FIC2LG3_js.openUrlInNewTab(target.url);
|
|
2240
2240
|
}
|
|
2241
2241
|
},
|
|
2242
2242
|
[slides, presentationSlideIndex]
|
|
@@ -2266,22 +2266,22 @@ function usePresentationActionExtensions(input) {
|
|
|
2266
2266
|
};
|
|
2267
2267
|
}
|
|
2268
2268
|
function usePresenterConsole(slideIndex, active) {
|
|
2269
|
-
const timerRef = react.useRef(
|
|
2270
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2269
|
+
const timerRef = react.useRef(chunk5FIC2LG3_js.createPresenterTimer());
|
|
2270
|
+
const [snapshot, setSnapshot] = react.useState(() => chunk5FIC2LG3_js.createInitialPresentationSnapshot(slideIndex));
|
|
2271
2271
|
const patch = react.useCallback((value) => {
|
|
2272
|
-
setSnapshot((current) =>
|
|
2272
|
+
setSnapshot((current) => chunk5FIC2LG3_js.mergePresentationSnapshot(current, value));
|
|
2273
2273
|
}, []);
|
|
2274
2274
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2275
2275
|
react.useEffect(() => {
|
|
2276
2276
|
if (!active) {
|
|
2277
2277
|
return;
|
|
2278
2278
|
}
|
|
2279
|
-
timerRef.current =
|
|
2279
|
+
timerRef.current = chunk5FIC2LG3_js.resetPresenterTimer();
|
|
2280
2280
|
patch({ paused: false, elapsedMs: 0 });
|
|
2281
2281
|
const timer = window.setInterval(() => {
|
|
2282
2282
|
patch({
|
|
2283
2283
|
paused: timerRef.current.paused,
|
|
2284
|
-
elapsedMs:
|
|
2284
|
+
elapsedMs: chunk5FIC2LG3_js.presenterElapsed(timerRef.current)
|
|
2285
2285
|
});
|
|
2286
2286
|
}, 1e3);
|
|
2287
2287
|
return () => window.clearInterval(timer);
|
|
@@ -2291,19 +2291,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2291
2291
|
applyAudienceSnapshot: setSnapshot,
|
|
2292
2292
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2293
2293
|
toggleTimer: () => {
|
|
2294
|
-
timerRef.current =
|
|
2294
|
+
timerRef.current = chunk5FIC2LG3_js.togglePresenterTimer(timerRef.current);
|
|
2295
2295
|
patch({
|
|
2296
2296
|
paused: timerRef.current.paused,
|
|
2297
|
-
elapsedMs:
|
|
2297
|
+
elapsedMs: chunk5FIC2LG3_js.presenterElapsed(timerRef.current)
|
|
2298
2298
|
});
|
|
2299
2299
|
},
|
|
2300
2300
|
resetTimer: () => {
|
|
2301
|
-
timerRef.current =
|
|
2301
|
+
timerRef.current = chunk5FIC2LG3_js.resetPresenterTimer();
|
|
2302
2302
|
patch({ paused: false, elapsedMs: 0 });
|
|
2303
2303
|
},
|
|
2304
2304
|
stepZoom: (direction) => setSnapshot(
|
|
2305
|
-
(current) =>
|
|
2306
|
-
zoom:
|
|
2305
|
+
(current) => chunk5FIC2LG3_js.mergePresentationSnapshot(current, {
|
|
2306
|
+
zoom: chunk5FIC2LG3_js.stepPresenterZoom(
|
|
2307
2307
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2308
2308
|
direction
|
|
2309
2309
|
)
|
|
@@ -2353,7 +2353,7 @@ function usePresentationMode(input) {
|
|
|
2353
2353
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2354
2354
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2355
2355
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2356
|
-
const showGuard = react.useMemo(() =>
|
|
2356
|
+
const showGuard = react.useMemo(() => chunk5FIC2LG3_js.createPresenterShowGuard(), []);
|
|
2357
2357
|
const {
|
|
2358
2358
|
presentationAnimations,
|
|
2359
2359
|
presentationElementStates,
|
|
@@ -2443,7 +2443,7 @@ function usePresentationMode(input) {
|
|
|
2443
2443
|
actionExtensions.bindNavigateToSlide(navigateToSlide);
|
|
2444
2444
|
const movePresentationSlide = react.useCallback(
|
|
2445
2445
|
(direction, trigger = "explicit") => {
|
|
2446
|
-
if (!
|
|
2446
|
+
if (!chunk5FIC2LG3_js.acceptsPresentationInput()) {
|
|
2447
2447
|
return;
|
|
2448
2448
|
}
|
|
2449
2449
|
if (endOfShowVisible) {
|
|
@@ -2512,7 +2512,7 @@ function usePresentationMode(input) {
|
|
|
2512
2512
|
onSetMode("present");
|
|
2513
2513
|
}, [containerRef, onSetMode, setRehearsing]);
|
|
2514
2514
|
const enterPresentModeFromBeginning = react.useCallback(() => {
|
|
2515
|
-
const first =
|
|
2515
|
+
const first = chunk5FIC2LG3_js.firstShowSlideIndex(visibleSlideIndexes);
|
|
2516
2516
|
if (first !== void 0) {
|
|
2517
2517
|
onSetActiveSlideIndex(first);
|
|
2518
2518
|
}
|
|
@@ -2592,7 +2592,7 @@ function usePresentationMode(input) {
|
|
|
2592
2592
|
if (mode !== "present") {
|
|
2593
2593
|
return;
|
|
2594
2594
|
}
|
|
2595
|
-
return
|
|
2595
|
+
return chunk5FIC2LG3_js.attachPresentationVisibilityPause({
|
|
2596
2596
|
root: containerRef.current ?? void 0,
|
|
2597
2597
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2598
2598
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2600,7 +2600,7 @@ function usePresentationMode(input) {
|
|
|
2600
2600
|
}, [mode, containerRef]);
|
|
2601
2601
|
react.useLayoutEffect(() => {
|
|
2602
2602
|
if (mode === "present") {
|
|
2603
|
-
const idx =
|
|
2603
|
+
const idx = chunk5FIC2LG3_js.presentationEntrySlideIndex(
|
|
2604
2604
|
activeSlideIndexRef.current,
|
|
2605
2605
|
visibleSlideIndexesRef.current
|
|
2606
2606
|
);
|
|
@@ -2679,11 +2679,11 @@ function usePresentationMode(input) {
|
|
|
2679
2679
|
return void 0;
|
|
2680
2680
|
}
|
|
2681
2681
|
const incoming = slides[transitionOverlay.incomingSlideIndex];
|
|
2682
|
-
return
|
|
2682
|
+
return chunk5FIC2LG3_js.buildMorphTransitionPlan(
|
|
2683
2683
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2684
2684
|
incoming,
|
|
2685
2685
|
transitionOverlay.durationMs,
|
|
2686
|
-
|
|
2686
|
+
chunk5FIC2LG3_js.morphOptionToMode(transitionOverlay.transition.morphOption),
|
|
2687
2687
|
// `PresentationStage` stacks the incoming slide's elements above its
|
|
2688
2688
|
// template shapes (`zIndex = templateElements.length + index`), so a
|
|
2689
2689
|
// z-index journey has to start counting where the stage does.
|
|
@@ -2708,7 +2708,7 @@ function usePresentationMode(input) {
|
|
|
2708
2708
|
if (!morphPlan) {
|
|
2709
2709
|
return presentationKeyframesCss;
|
|
2710
2710
|
}
|
|
2711
|
-
const imageRules =
|
|
2711
|
+
const imageRules = chunk5FIC2LG3_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2712
2712
|
return `${presentationKeyframesCss ?? ""}
|
|
2713
2713
|
${morphPlan.keyframesCss}
|
|
2714
2714
|
${imageRules}`;
|
|
@@ -3005,7 +3005,7 @@ function useFindReplace({
|
|
|
3005
3005
|
const [findResults, setFindResults] = react.useState([]);
|
|
3006
3006
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
3007
3007
|
const performFind = react.useCallback(() => {
|
|
3008
|
-
const results =
|
|
3008
|
+
const results = chunk5FIC2LG3_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
3009
3009
|
if (!findQuery) {
|
|
3010
3010
|
setFindResults([]);
|
|
3011
3011
|
setFindResultIndex(-1);
|
|
@@ -3039,7 +3039,7 @@ function useFindReplace({
|
|
|
3039
3039
|
return;
|
|
3040
3040
|
}
|
|
3041
3041
|
onUpdateSlides(
|
|
3042
|
-
(prevSlides) =>
|
|
3042
|
+
(prevSlides) => chunk5FIC2LG3_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
3043
3043
|
);
|
|
3044
3044
|
onMarkDirty();
|
|
3045
3045
|
},
|
|
@@ -3061,9 +3061,9 @@ function useFindReplace({
|
|
|
3061
3061
|
}, [findResults, applyReplacements, performFind]);
|
|
3062
3062
|
react.useEffect(() => {
|
|
3063
3063
|
const handler = (event) => {
|
|
3064
|
-
const { action } =
|
|
3064
|
+
const { action } = chunk5FIC2LG3_js.mapEditorKey(event, {
|
|
3065
3065
|
canEdit: mode === "edit",
|
|
3066
|
-
isTextInputTarget:
|
|
3066
|
+
isTextInputTarget: chunk5FIC2LG3_js.isEditorTextInputTarget(event.target)
|
|
3067
3067
|
});
|
|
3068
3068
|
if (action !== "find") {
|
|
3069
3069
|
return;
|
|
@@ -3174,7 +3174,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId, ment
|
|
|
3174
3174
|
if (!slide) {
|
|
3175
3175
|
return { slides, didAdd: false };
|
|
3176
3176
|
}
|
|
3177
|
-
const next =
|
|
3177
|
+
const next = chunk5FIC2LG3_js.addCommentToList(
|
|
3178
3178
|
slide.comments || [],
|
|
3179
3179
|
text,
|
|
3180
3180
|
authorName,
|
|
@@ -3195,7 +3195,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
|
3195
3195
|
if (!slide) {
|
|
3196
3196
|
return { slides, didDelete: false };
|
|
3197
3197
|
}
|
|
3198
|
-
const next =
|
|
3198
|
+
const next = chunk5FIC2LG3_js.removeCommentFromList(slide.comments || [], commentId);
|
|
3199
3199
|
if (!next) {
|
|
3200
3200
|
return { slides, didDelete: false };
|
|
3201
3201
|
}
|
|
@@ -3206,7 +3206,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
|
3206
3206
|
if (!slide) {
|
|
3207
3207
|
return { slides, didUpdate: false };
|
|
3208
3208
|
}
|
|
3209
|
-
const next =
|
|
3209
|
+
const next = chunk5FIC2LG3_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
3210
3210
|
if (!next) {
|
|
3211
3211
|
return { slides, didUpdate: false };
|
|
3212
3212
|
}
|
|
@@ -3217,7 +3217,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
|
3217
3217
|
if (!slide) {
|
|
3218
3218
|
return { slides, didUpdate: false };
|
|
3219
3219
|
}
|
|
3220
|
-
const next =
|
|
3220
|
+
const next = chunk5FIC2LG3_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
3221
3221
|
if (!next) {
|
|
3222
3222
|
return { slides, didUpdate: false };
|
|
3223
3223
|
}
|
|
@@ -3228,7 +3228,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName, mention
|
|
|
3228
3228
|
if (!slide) {
|
|
3229
3229
|
return { slides, didAdd: false };
|
|
3230
3230
|
}
|
|
3231
|
-
const next =
|
|
3231
|
+
const next = chunk5FIC2LG3_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
3232
3232
|
if (!next) {
|
|
3233
3233
|
return { slides, didAdd: false };
|
|
3234
3234
|
}
|
|
@@ -3615,7 +3615,7 @@ function useDerivedElementState(input) {
|
|
|
3615
3615
|
return [];
|
|
3616
3616
|
}
|
|
3617
3617
|
return [
|
|
3618
|
-
...
|
|
3618
|
+
...chunk5FIC2LG3_js.visibleTemplateElements(activeSlide, templateElementsBySlideId[activeSlide.id] ?? [])
|
|
3619
3619
|
];
|
|
3620
3620
|
}, [activeSlide, templateElementsBySlideId]);
|
|
3621
3621
|
const activeMaster = slideMasters[activeMasterIndex];
|
|
@@ -3682,7 +3682,7 @@ function useViewerCoreState(_input) {
|
|
|
3682
3682
|
const marqueeStateRef = react.useRef(null);
|
|
3683
3683
|
const isDrawingRef = react.useRef(false);
|
|
3684
3684
|
const justInteractedRef = react.useRef(false);
|
|
3685
|
-
const livePatcher = react.useMemo(() =>
|
|
3685
|
+
const livePatcher = react.useMemo(() => chunk5FIC2LG3_js.createCollaborationLivePatcher(), []);
|
|
3686
3686
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3687
3687
|
const slidesRef = react.useRef([]);
|
|
3688
3688
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3691,8 +3691,8 @@ function useViewerCoreState(_input) {
|
|
|
3691
3691
|
const [slides, setSlides] = react.useState([]);
|
|
3692
3692
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3693
3693
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3694
|
-
width:
|
|
3695
|
-
height:
|
|
3694
|
+
width: chunkLIIV45TR_js.DEFAULT_CANVAS_WIDTH,
|
|
3695
|
+
height: chunkLIIV45TR_js.DEFAULT_CANVAS_HEIGHT
|
|
3696
3696
|
});
|
|
3697
3697
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3698
3698
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3713,7 +3713,7 @@ function useViewerCoreState(_input) {
|
|
|
3713
3713
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3714
3714
|
inlineEditingTextRef.current = resolved;
|
|
3715
3715
|
setInlineEditingTextBase(value);
|
|
3716
|
-
|
|
3716
|
+
chunk5FIC2LG3_js.publishLiveInlineText(
|
|
3717
3717
|
livePatcher,
|
|
3718
3718
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3719
3719
|
inlineEditingElementIdRef.current,
|
|
@@ -4067,7 +4067,7 @@ function useLoadContent({
|
|
|
4067
4067
|
);
|
|
4068
4068
|
}
|
|
4069
4069
|
const previousHandler = handlerRef.current;
|
|
4070
|
-
const handler = new
|
|
4070
|
+
const handler = new chunk5FIC2LG3_js.PptxHandler();
|
|
4071
4071
|
const parsed = await handler.load(buffer, { allowExternalImages });
|
|
4072
4072
|
if (cancelled || token !== renderTokenRef.current) {
|
|
4073
4073
|
handler.dispose();
|
|
@@ -4079,7 +4079,7 @@ function useLoadContent({
|
|
|
4079
4079
|
handlerRef.current = null;
|
|
4080
4080
|
const mediaElements = [];
|
|
4081
4081
|
for (const slide of parsed.slides) {
|
|
4082
|
-
|
|
4082
|
+
chunk5FIC2LG3_js.collectMediaElements(slide.elements, mediaElements);
|
|
4083
4083
|
}
|
|
4084
4084
|
for (const url of mediaDataUrls.values()) {
|
|
4085
4085
|
if (url.startsWith("blob:")) {
|
|
@@ -4120,7 +4120,7 @@ function useLoadContent({
|
|
|
4120
4120
|
}
|
|
4121
4121
|
})
|
|
4122
4122
|
);
|
|
4123
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
4123
|
+
const { paths: imagePaths, refs: imageRefs } = chunk5FIC2LG3_js.collectImagePaths(parsed.slides);
|
|
4124
4124
|
let nextSlides = parsed.slides;
|
|
4125
4125
|
if (imagePaths.size > 0) {
|
|
4126
4126
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -4136,25 +4136,25 @@ function useLoadContent({
|
|
|
4136
4136
|
})
|
|
4137
4137
|
);
|
|
4138
4138
|
nextSlides = parsed.slides.map((s) => {
|
|
4139
|
-
const newElements =
|
|
4139
|
+
const newElements = chunk5FIC2LG3_js.applyImagePathPatches(s.elements, resolvedMap, imageRefs);
|
|
4140
4140
|
return newElements === s.elements ? s : { ...s, elements: newElements };
|
|
4141
4141
|
});
|
|
4142
4142
|
}
|
|
4143
|
-
nextSlides = await
|
|
4143
|
+
nextSlides = await chunk5FIC2LG3_js.resolveTableCellImageUrls(
|
|
4144
4144
|
nextSlides,
|
|
4145
4145
|
(path) => handler.getImageData(path)
|
|
4146
4146
|
);
|
|
4147
|
-
const nextTableStyleMap = await
|
|
4147
|
+
const nextTableStyleMap = await chunk5FIC2LG3_js.resolveTableStyleImageUrls(
|
|
4148
4148
|
parsed.tableStyleMap,
|
|
4149
4149
|
(path) => handler.getImageData(path)
|
|
4150
4150
|
);
|
|
4151
4151
|
handlerRef.current = handler;
|
|
4152
|
-
const partition =
|
|
4152
|
+
const partition = chunk5FIC2LG3_js.partitionTemplateElements(nextSlides);
|
|
4153
4153
|
setSlides(partition.slides);
|
|
4154
4154
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4155
4155
|
setCanvasSize({
|
|
4156
|
-
width: parsed.width ??
|
|
4157
|
-
height: parsed.height ??
|
|
4156
|
+
width: parsed.width ?? chunkLIIV45TR_js.DEFAULT_CANVAS_WIDTH,
|
|
4157
|
+
height: parsed.height ?? chunkLIIV45TR_js.DEFAULT_CANVAS_HEIGHT
|
|
4158
4158
|
});
|
|
4159
4159
|
setSlideSizeEmu(
|
|
4160
4160
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4167,13 +4167,13 @@ function useLoadContent({
|
|
|
4167
4167
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
4168
4168
|
setSlideMasters(parsed.slideMasters ?? []);
|
|
4169
4169
|
setModernCommentAuthors(parsed.modernCommentAuthors ?? []);
|
|
4170
|
-
setRecentColors(
|
|
4170
|
+
setRecentColors(chunk5FIC2LG3_js.seedRecentColors({ mruColors: parsed.mruColors }));
|
|
4171
4171
|
setTheme(parsed.theme);
|
|
4172
4172
|
setTableStyleMap(nextTableStyleMap);
|
|
4173
4173
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
4174
4174
|
setCustomShows(parsed.customShows ?? []);
|
|
4175
4175
|
setActiveCustomShowId(
|
|
4176
|
-
|
|
4176
|
+
chunk5FIC2LG3_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
4177
4177
|
);
|
|
4178
4178
|
setSections(parsed.sections ?? []);
|
|
4179
4179
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -4196,10 +4196,10 @@ function useLoadContent({
|
|
|
4196
4196
|
setHasMacros(parsed.hasMacros === true);
|
|
4197
4197
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4198
4198
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4199
|
-
setGuides(
|
|
4200
|
-
setReadOnlyRecommendation(
|
|
4199
|
+
setGuides(chunk5FIC2LG3_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4200
|
+
setReadOnlyRecommendation(chunk5FIC2LG3_js.readOnlyRecommendation(parsed));
|
|
4201
4201
|
setCompatToasts(
|
|
4202
|
-
|
|
4202
|
+
chunk5FIC2LG3_js.compatibilityWarningToasts([
|
|
4203
4203
|
...parsed.warnings ?? [],
|
|
4204
4204
|
...parsed.slides.flatMap((slide) => slide.warnings ?? [])
|
|
4205
4205
|
])
|
|
@@ -4211,7 +4211,7 @@ function useLoadContent({
|
|
|
4211
4211
|
onContentApplied?.();
|
|
4212
4212
|
} catch (err) {
|
|
4213
4213
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4214
|
-
if (err instanceof
|
|
4214
|
+
if (err instanceof chunk5FIC2LG3_js.EncryptedFileError) {
|
|
4215
4215
|
setIsEncrypted(true);
|
|
4216
4216
|
} else {
|
|
4217
4217
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4239,7 +4239,7 @@ function useLoadContent({
|
|
|
4239
4239
|
}
|
|
4240
4240
|
function useAutosave(input) {
|
|
4241
4241
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4242
|
-
const intervalMs =
|
|
4242
|
+
const intervalMs = chunk5FIC2LG3_js.resolveAutosaveIntervalMs({
|
|
4243
4243
|
hostIntervalMs: input.intervalMs,
|
|
4244
4244
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4245
4245
|
});
|
|
@@ -4270,7 +4270,7 @@ function useAutosave(input) {
|
|
|
4270
4270
|
return;
|
|
4271
4271
|
}
|
|
4272
4272
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4273
|
-
if (!
|
|
4273
|
+
if (!chunk5FIC2LG3_js.shouldWriteAutosaveSnapshot({
|
|
4274
4274
|
filePath: path,
|
|
4275
4275
|
isDirty: isDirtyRef.current,
|
|
4276
4276
|
saving: isSavingRef.current,
|
|
@@ -4288,8 +4288,8 @@ function useAutosave(input) {
|
|
|
4288
4288
|
isSavingRef.current = false;
|
|
4289
4289
|
return;
|
|
4290
4290
|
}
|
|
4291
|
-
await
|
|
4292
|
-
lastSnapshotRef.current =
|
|
4291
|
+
await chunk5FIC2LG3_js.saveAutosaveSnapshot(path, data);
|
|
4292
|
+
lastSnapshotRef.current = chunk5FIC2LG3_js.autosaveSnapshotMark(path, sources);
|
|
4293
4293
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4294
4294
|
} catch (err) {
|
|
4295
4295
|
setAutosaveStatus({
|
|
@@ -4343,13 +4343,13 @@ function useElementOperations(input) {
|
|
|
4343
4343
|
inlineEditingText
|
|
4344
4344
|
} = input;
|
|
4345
4345
|
const liveTextSegments = react.useCallback(() => {
|
|
4346
|
-
if (!selectedElement || !
|
|
4346
|
+
if (!selectedElement || !chunk5FIC2LG3_js.hasTextProperties(selectedElement)) {
|
|
4347
4347
|
return void 0;
|
|
4348
4348
|
}
|
|
4349
4349
|
if (selectedElement.id !== inlineEditingElementId) {
|
|
4350
4350
|
return selectedElement.textSegments;
|
|
4351
4351
|
}
|
|
4352
|
-
return
|
|
4352
|
+
return chunk5FIC2LG3_js.remapTextToSegments(
|
|
4353
4353
|
inlineEditingText,
|
|
4354
4354
|
selectedElement.textSegments,
|
|
4355
4355
|
selectedElement.textStyle
|
|
@@ -4390,11 +4390,11 @@ function useElementOperations(input) {
|
|
|
4390
4390
|
(elementId, updates) => {
|
|
4391
4391
|
if (masterView?.target) {
|
|
4392
4392
|
applyMasterViewWrite(
|
|
4393
|
-
|
|
4393
|
+
chunk5FIC2LG3_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4394
4394
|
);
|
|
4395
4395
|
return;
|
|
4396
4396
|
}
|
|
4397
|
-
if (
|
|
4397
|
+
if (chunk5FIC2LG3_js.isTemplateElementId(elementId)) {
|
|
4398
4398
|
const slideId = activeSlide?.id;
|
|
4399
4399
|
if (slideId) {
|
|
4400
4400
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4405,7 +4405,7 @@ function useElementOperations(input) {
|
|
|
4405
4405
|
}));
|
|
4406
4406
|
}
|
|
4407
4407
|
} else {
|
|
4408
|
-
setSlides((prev) =>
|
|
4408
|
+
setSlides((prev) => chunk5FIC2LG3_js.updateElement(prev, activeSlideIndex, elementId, updates));
|
|
4409
4409
|
}
|
|
4410
4410
|
history.markDirty();
|
|
4411
4411
|
},
|
|
@@ -4430,7 +4430,7 @@ function useElementOperations(input) {
|
|
|
4430
4430
|
);
|
|
4431
4431
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4432
4432
|
(updates) => {
|
|
4433
|
-
if (!selectedElement || !
|
|
4433
|
+
if (!selectedElement || !chunk5FIC2LG3_js.hasShapeProperties(selectedElement)) {
|
|
4434
4434
|
return;
|
|
4435
4435
|
}
|
|
4436
4436
|
updateSelectedElement({
|
|
@@ -4441,19 +4441,19 @@ function useElementOperations(input) {
|
|
|
4441
4441
|
);
|
|
4442
4442
|
const updateSelectedTextStyle = react.useCallback(
|
|
4443
4443
|
(updates) => {
|
|
4444
|
-
if (!selectedElement || !
|
|
4444
|
+
if (!selectedElement || !chunk5FIC2LG3_js.hasTextProperties(selectedElement)) {
|
|
4445
4445
|
return;
|
|
4446
4446
|
}
|
|
4447
4447
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4448
4448
|
const currentSegments = liveTextSegments();
|
|
4449
|
-
const inlineSel =
|
|
4449
|
+
const inlineSel = chunk5FIC2LG3_js.getInlineEditorSelection(currentSegments);
|
|
4450
4450
|
if (inlineSel && currentSegments) {
|
|
4451
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4451
|
+
const { newSegments: newSegments2, newSelection } = chunk5FIC2LG3_js.applyStyleToSelectedSegments(
|
|
4452
4452
|
currentSegments,
|
|
4453
4453
|
inlineSel,
|
|
4454
4454
|
updates
|
|
4455
4455
|
);
|
|
4456
|
-
|
|
4456
|
+
chunk5FIC2LG3_js.setPendingSelectionRestore(newSelection);
|
|
4457
4457
|
updateSelectedElement({
|
|
4458
4458
|
textSegments: newSegments2,
|
|
4459
4459
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4481,14 +4481,14 @@ function useElementOperations(input) {
|
|
|
4481
4481
|
);
|
|
4482
4482
|
const updateSelectedTextCase = react.useCallback(
|
|
4483
4483
|
(mode) => {
|
|
4484
|
-
if (!selectedElement || !
|
|
4484
|
+
if (!selectedElement || !chunk5FIC2LG3_js.hasTextProperties(selectedElement)) {
|
|
4485
4485
|
return;
|
|
4486
4486
|
}
|
|
4487
4487
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4488
4488
|
const currentSegments = liveTextSegments();
|
|
4489
|
-
const inlineSel =
|
|
4489
|
+
const inlineSel = chunk5FIC2LG3_js.getInlineEditorSelection(currentSegments);
|
|
4490
4490
|
if (inlineSel && currentSegments) {
|
|
4491
|
-
const newSegments =
|
|
4491
|
+
const newSegments = chunk5FIC2LG3_js.applyCaseTransformToSegments(currentSegments, inlineSel, mode);
|
|
4492
4492
|
updateSelectedElement({
|
|
4493
4493
|
textSegments: newSegments,
|
|
4494
4494
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4497,7 +4497,7 @@ function useElementOperations(input) {
|
|
|
4497
4497
|
}
|
|
4498
4498
|
const updates = {};
|
|
4499
4499
|
if (currentSegments && currentSegments.length > 0) {
|
|
4500
|
-
updates.textSegments =
|
|
4500
|
+
updates.textSegments = chunk5FIC2LG3_js.applyCaseTransformToSegments(
|
|
4501
4501
|
currentSegments,
|
|
4502
4502
|
null,
|
|
4503
4503
|
mode
|
|
@@ -4505,7 +4505,7 @@ function useElementOperations(input) {
|
|
|
4505
4505
|
}
|
|
4506
4506
|
const baseText = isLiveEditing ? inlineEditingText : selectedElement.text;
|
|
4507
4507
|
if (typeof baseText === "string") {
|
|
4508
|
-
updates.text =
|
|
4508
|
+
updates.text = chunk5FIC2LG3_js.transformTextCase(baseText, mode);
|
|
4509
4509
|
}
|
|
4510
4510
|
updateSelectedElement(updates);
|
|
4511
4511
|
},
|
|
@@ -4524,15 +4524,15 @@ function useElementOperations(input) {
|
|
|
4524
4524
|
[setSlides]
|
|
4525
4525
|
);
|
|
4526
4526
|
const masterViewTarget = masterView?.target ?? null;
|
|
4527
|
-
const activeElements = masterViewTarget ?
|
|
4527
|
+
const activeElements = masterViewTarget ? chunk5FIC2LG3_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4528
4528
|
const updateActiveElements = react.useCallback(
|
|
4529
4529
|
(updater) => {
|
|
4530
4530
|
if (masterView?.target) {
|
|
4531
4531
|
applyMasterViewWrite(
|
|
4532
|
-
|
|
4532
|
+
chunk5FIC2LG3_js.replaceMasterViewElements(
|
|
4533
4533
|
masterView,
|
|
4534
4534
|
masterView.target,
|
|
4535
|
-
updater(
|
|
4535
|
+
updater(chunk5FIC2LG3_js.masterViewElements(masterView, masterView.target))
|
|
4536
4536
|
)
|
|
4537
4537
|
);
|
|
4538
4538
|
return;
|
|
@@ -4585,7 +4585,7 @@ function useSectionOperations(input) {
|
|
|
4585
4585
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4586
4586
|
const addSection2 = react.useCallback(
|
|
4587
4587
|
(name, afterSlideIndex) => {
|
|
4588
|
-
const result =
|
|
4588
|
+
const result = chunk5FIC2LG3_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4589
4589
|
setSlides(result.slides);
|
|
4590
4590
|
setSections(result.sections);
|
|
4591
4591
|
markDirty();
|
|
@@ -4594,7 +4594,7 @@ function useSectionOperations(input) {
|
|
|
4594
4594
|
);
|
|
4595
4595
|
const renameSection2 = react.useCallback(
|
|
4596
4596
|
(sectionId, newName) => {
|
|
4597
|
-
const result =
|
|
4597
|
+
const result = chunk5FIC2LG3_js.renameSection(sections, slides, sectionId, newName);
|
|
4598
4598
|
setSections(result.sections);
|
|
4599
4599
|
setSlides(result.slides);
|
|
4600
4600
|
markDirty();
|
|
@@ -4603,7 +4603,7 @@ function useSectionOperations(input) {
|
|
|
4603
4603
|
);
|
|
4604
4604
|
const deleteSection2 = react.useCallback(
|
|
4605
4605
|
(sectionId) => {
|
|
4606
|
-
const result =
|
|
4606
|
+
const result = chunk5FIC2LG3_js.deleteSection(sections, slides, sectionId);
|
|
4607
4607
|
setSections(result.sections);
|
|
4608
4608
|
setSlides(result.slides);
|
|
4609
4609
|
markDirty();
|
|
@@ -4612,21 +4612,21 @@ function useSectionOperations(input) {
|
|
|
4612
4612
|
);
|
|
4613
4613
|
const moveSectionUp2 = react.useCallback(
|
|
4614
4614
|
(sectionId) => {
|
|
4615
|
-
setSections(
|
|
4615
|
+
setSections(chunk5FIC2LG3_js.moveSectionUp(sections, sectionId));
|
|
4616
4616
|
markDirty();
|
|
4617
4617
|
},
|
|
4618
4618
|
[sections, setSections, markDirty]
|
|
4619
4619
|
);
|
|
4620
4620
|
const moveSectionDown2 = react.useCallback(
|
|
4621
4621
|
(sectionId) => {
|
|
4622
|
-
setSections(
|
|
4622
|
+
setSections(chunk5FIC2LG3_js.moveSectionDown(sections, sectionId));
|
|
4623
4623
|
markDirty();
|
|
4624
4624
|
},
|
|
4625
4625
|
[sections, setSections, markDirty]
|
|
4626
4626
|
);
|
|
4627
4627
|
const moveSlidesToSection2 = react.useCallback(
|
|
4628
4628
|
(slideIndexes, targetSectionId) => {
|
|
4629
|
-
const result =
|
|
4629
|
+
const result = chunk5FIC2LG3_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4630
4630
|
setSlides(result.slides);
|
|
4631
4631
|
setSections(result.sections);
|
|
4632
4632
|
markDirty();
|
|
@@ -4692,15 +4692,15 @@ function syncSelectionHandleOverlay(elementNode, elementId, geometry) {
|
|
|
4692
4692
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4693
4693
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
|
|
4694
4694
|
const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
|
|
4695
|
-
let resized =
|
|
4695
|
+
let resized = chunk5FIC2LG3_js.applyResize(startBox, handle, dx, dy, 1, { minSize: chunkLIIV45TR_js.MIN_ELEMENT_SIZE });
|
|
4696
4696
|
if (lockAspect) {
|
|
4697
|
-
resized =
|
|
4697
|
+
resized = chunk5FIC2LG3_js.lockResizeAspect(resized, startBox, handle, chunkLIIV45TR_js.MIN_ELEMENT_SIZE);
|
|
4698
4698
|
}
|
|
4699
4699
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4700
4700
|
if (!snapToGrid) {
|
|
4701
4701
|
return box;
|
|
4702
4702
|
}
|
|
4703
|
-
return
|
|
4703
|
+
return chunk5FIC2LG3_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkLIIV45TR_js.MIN_ELEMENT_SIZE);
|
|
4704
4704
|
}
|
|
4705
4705
|
function resolveLiveTarget(input) {
|
|
4706
4706
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4813,7 +4813,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4813
4813
|
width: el.width,
|
|
4814
4814
|
height: el.height
|
|
4815
4815
|
}));
|
|
4816
|
-
const snapResult =
|
|
4816
|
+
const snapResult = chunk5FIC2LG3_js.computeSnapToShape(
|
|
4817
4817
|
targetX,
|
|
4818
4818
|
targetY,
|
|
4819
4819
|
primaryEl.width,
|
|
@@ -4855,7 +4855,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4855
4855
|
if (live) {
|
|
4856
4856
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4857
4857
|
const start = drag.startPositionsById[id];
|
|
4858
|
-
|
|
4858
|
+
chunk5FIC2LG3_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4859
4859
|
x: start.x + appliedDx,
|
|
4860
4860
|
y: start.y + appliedDy
|
|
4861
4861
|
});
|
|
@@ -4887,8 +4887,8 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4887
4887
|
rs.lastY = geo.y;
|
|
4888
4888
|
rs.lastWidth = geo.width;
|
|
4889
4889
|
rs.lastHeight = geo.height;
|
|
4890
|
-
const width = Math.max(geo.width,
|
|
4891
|
-
const height = Math.max(geo.height,
|
|
4890
|
+
const width = Math.max(geo.width, chunkLIIV45TR_js.MIN_ELEMENT_SIZE);
|
|
4891
|
+
const height = Math.max(geo.height, chunkLIIV45TR_js.MIN_ELEMENT_SIZE);
|
|
4892
4892
|
if (rs.domEl) {
|
|
4893
4893
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4894
4894
|
rs.domEl.style.top = `${geo.y}px`;
|
|
@@ -4897,7 +4897,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4897
4897
|
syncSelectionHandleOverlay(rs.domEl, rs.elementId, { x: geo.x, y: geo.y, width, height });
|
|
4898
4898
|
}
|
|
4899
4899
|
if (live) {
|
|
4900
|
-
|
|
4900
|
+
chunk5FIC2LG3_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4901
4901
|
x: geo.x,
|
|
4902
4902
|
y: geo.y,
|
|
4903
4903
|
width,
|
|
@@ -4908,7 +4908,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4908
4908
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4909
4909
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4910
4910
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4911
|
-
const adjustments =
|
|
4911
|
+
const adjustments = chunk5FIC2LG3_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4912
4912
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4913
4913
|
adj.moved = true;
|
|
4914
4914
|
}
|
|
@@ -4983,13 +4983,13 @@ function processPointerUp(input) {
|
|
|
4983
4983
|
if (i !== activeSlideIndex) {
|
|
4984
4984
|
return s;
|
|
4985
4985
|
}
|
|
4986
|
-
const rerouted =
|
|
4986
|
+
const rerouted = chunk5FIC2LG3_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4987
4987
|
if (rerouted.length === 0) {
|
|
4988
4988
|
return s;
|
|
4989
4989
|
}
|
|
4990
4990
|
return {
|
|
4991
4991
|
...s,
|
|
4992
|
-
elements:
|
|
4992
|
+
elements: chunk5FIC2LG3_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4993
4993
|
};
|
|
4994
4994
|
})
|
|
4995
4995
|
);
|
|
@@ -5014,9 +5014,9 @@ function processPointerUp(input) {
|
|
|
5014
5014
|
}
|
|
5015
5015
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
5016
5016
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
5017
|
-
const hitIds =
|
|
5017
|
+
const hitIds = chunk5FIC2LG3_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
5018
5018
|
if (marquee.additive) {
|
|
5019
|
-
const merged =
|
|
5019
|
+
const merged = chunk5FIC2LG3_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
5020
5020
|
if (merged.length > 0) {
|
|
5021
5021
|
applySelection(merged[0], merged);
|
|
5022
5022
|
} else {
|
|
@@ -5039,8 +5039,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
5039
5039
|
}
|
|
5040
5040
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
5041
5041
|
});
|
|
5042
|
-
const rerouted =
|
|
5043
|
-
return
|
|
5042
|
+
const rerouted = chunk5FIC2LG3_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
5043
|
+
return chunk5FIC2LG3_js.applyReroutedConnectors(movedElements, rerouted);
|
|
5044
5044
|
};
|
|
5045
5045
|
if (editTemplateMode) {
|
|
5046
5046
|
const slideId = activeSlide?.id;
|
|
@@ -5196,11 +5196,11 @@ function useCanvasInteractions(input) {
|
|
|
5196
5196
|
return;
|
|
5197
5197
|
}
|
|
5198
5198
|
const el = elementLookup.get(editId);
|
|
5199
|
-
if (el &&
|
|
5199
|
+
if (el && chunk5FIC2LG3_js.hasTextProperties(el)) {
|
|
5200
5200
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
5201
|
-
const newSegments =
|
|
5201
|
+
const newSegments = chunk5FIC2LG3_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
5202
5202
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
5203
|
-
const newHeight =
|
|
5203
|
+
const newHeight = chunk5FIC2LG3_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
5204
5204
|
ops.updateElementById(editId, {
|
|
5205
5205
|
text: committedText,
|
|
5206
5206
|
textSegments: newSegments,
|
|
@@ -5212,7 +5212,7 @@ function useCanvasInteractions(input) {
|
|
|
5212
5212
|
setInlineEditingText("");
|
|
5213
5213
|
};
|
|
5214
5214
|
const openEquationEditorForElement = (el) => {
|
|
5215
|
-
if (!
|
|
5215
|
+
if (!chunk5FIC2LG3_js.hasTextProperties(el)) {
|
|
5216
5216
|
return false;
|
|
5217
5217
|
}
|
|
5218
5218
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5242,7 +5242,7 @@ function useCanvasInteractions(input) {
|
|
|
5242
5242
|
justInteractedRef.current = false;
|
|
5243
5243
|
} else {
|
|
5244
5244
|
const el = elementLookup.get(elementId);
|
|
5245
|
-
if (el &&
|
|
5245
|
+
if (el && chunk5FIC2LG3_js.hasTextProperties(el) && chunk5FIC2LG3_js.canInteractWithElement(el, "textEdit")) {
|
|
5246
5246
|
if (!openEquationEditorForElement(el)) {
|
|
5247
5247
|
setInlineEditingElementId(elementId);
|
|
5248
5248
|
setInlineEditingText(el.text ?? "");
|
|
@@ -5261,7 +5261,7 @@ function useCanvasInteractions(input) {
|
|
|
5261
5261
|
if (openEquationEditorForElement(el)) {
|
|
5262
5262
|
return;
|
|
5263
5263
|
}
|
|
5264
|
-
if (
|
|
5264
|
+
if (chunk5FIC2LG3_js.hasTextProperties(el) && chunk5FIC2LG3_js.canInteractWithElement(el, "textEdit")) {
|
|
5265
5265
|
setInlineEditingElementId(elementId);
|
|
5266
5266
|
setInlineEditingText(el.text ?? "");
|
|
5267
5267
|
}
|
|
@@ -5284,7 +5284,7 @@ function useCanvasInteractions(input) {
|
|
|
5284
5284
|
justSelectedRef.current = false;
|
|
5285
5285
|
}
|
|
5286
5286
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
5287
|
-
const movableIds =
|
|
5287
|
+
const movableIds = chunk5FIC2LG3_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
5288
5288
|
if (movableIds.length === 0) {
|
|
5289
5289
|
return;
|
|
5290
5290
|
}
|
|
@@ -5354,7 +5354,7 @@ function useCanvasInteractions(input) {
|
|
|
5354
5354
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5355
5355
|
e.stopPropagation();
|
|
5356
5356
|
const el = elementLookup.get(elementId);
|
|
5357
|
-
if (!el || !
|
|
5357
|
+
if (!el || !chunk5FIC2LG3_js.canInteractWithElement(el, "resize")) {
|
|
5358
5358
|
return;
|
|
5359
5359
|
}
|
|
5360
5360
|
resizeStateRef.current = {
|
|
@@ -5376,7 +5376,7 @@ function useCanvasInteractions(input) {
|
|
|
5376
5376
|
};
|
|
5377
5377
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5378
5378
|
const el = elementLookup.get(elementId);
|
|
5379
|
-
if (!el || !
|
|
5379
|
+
if (!el || !chunk5FIC2LG3_js.canInteractWithElement(el, "rotate")) {
|
|
5380
5380
|
return;
|
|
5381
5381
|
}
|
|
5382
5382
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5396,10 +5396,10 @@ function useCanvasInteractions(input) {
|
|
|
5396
5396
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5397
5397
|
e.stopPropagation();
|
|
5398
5398
|
const el = elementLookup.get(elementId);
|
|
5399
|
-
if (!el || !
|
|
5399
|
+
if (!el || !chunk5FIC2LG3_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5400
5400
|
return;
|
|
5401
5401
|
}
|
|
5402
|
-
shapeAdjustmentDragStateRef.current =
|
|
5402
|
+
shapeAdjustmentDragStateRef.current = chunk5FIC2LG3_js.beginShapeAdjustment(
|
|
5403
5403
|
el,
|
|
5404
5404
|
descriptor,
|
|
5405
5405
|
e.clientX,
|
|
@@ -5446,7 +5446,7 @@ function createFileHandlers(deps) {
|
|
|
5446
5446
|
h = Math.round(h * scale);
|
|
5447
5447
|
}
|
|
5448
5448
|
addElement({
|
|
5449
|
-
id:
|
|
5449
|
+
id: chunk5FIC2LG3_js.generateElementId(),
|
|
5450
5450
|
type: "image",
|
|
5451
5451
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5452
5452
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5457,7 +5457,7 @@ function createFileHandlers(deps) {
|
|
|
5457
5457
|
};
|
|
5458
5458
|
img.onerror = () => {
|
|
5459
5459
|
addElement({
|
|
5460
|
-
id:
|
|
5460
|
+
id: chunk5FIC2LG3_js.generateElementId(),
|
|
5461
5461
|
type: "image",
|
|
5462
5462
|
x: 100,
|
|
5463
5463
|
y: 100,
|
|
@@ -5476,14 +5476,14 @@ function createFileHandlers(deps) {
|
|
|
5476
5476
|
return;
|
|
5477
5477
|
}
|
|
5478
5478
|
e.target.value = "";
|
|
5479
|
-
const mediaType =
|
|
5479
|
+
const mediaType = chunk5FIC2LG3_js.classifyMediaType(file.type);
|
|
5480
5480
|
if (!mediaType) {
|
|
5481
5481
|
return;
|
|
5482
5482
|
}
|
|
5483
5483
|
const elFilePath = file.path;
|
|
5484
5484
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5485
5485
|
addElement({
|
|
5486
|
-
id:
|
|
5486
|
+
id: chunk5FIC2LG3_js.generateElementId(),
|
|
5487
5487
|
type: "media",
|
|
5488
5488
|
mediaType,
|
|
5489
5489
|
mediaMimeType: file.type || void 0,
|
|
@@ -5658,13 +5658,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5658
5658
|
return;
|
|
5659
5659
|
}
|
|
5660
5660
|
addElement({
|
|
5661
|
-
id:
|
|
5661
|
+
id: chunk5FIC2LG3_js.generateElementId(),
|
|
5662
5662
|
type: "smartArt",
|
|
5663
5663
|
x: 100,
|
|
5664
5664
|
y: 120,
|
|
5665
5665
|
width: 600,
|
|
5666
5666
|
height: 340,
|
|
5667
|
-
smartArtData:
|
|
5667
|
+
smartArtData: chunk5FIC2LG3_js.buildSmartArtPresetData(
|
|
5668
5668
|
layout,
|
|
5669
5669
|
defaultItems,
|
|
5670
5670
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5676,7 +5676,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5676
5676
|
return;
|
|
5677
5677
|
}
|
|
5678
5678
|
addElement({
|
|
5679
|
-
id:
|
|
5679
|
+
id: chunk5FIC2LG3_js.generateElementId(),
|
|
5680
5680
|
type: "shape",
|
|
5681
5681
|
x: 120,
|
|
5682
5682
|
y: 200,
|
|
@@ -5714,7 +5714,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5714
5714
|
return;
|
|
5715
5715
|
}
|
|
5716
5716
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5717
|
-
if (resolved.url && !
|
|
5717
|
+
if (resolved.url && !chunk5FIC2LG3_js.isUrlSafe(resolved.url)) {
|
|
5718
5718
|
return;
|
|
5719
5719
|
}
|
|
5720
5720
|
const actionClick = {
|
|
@@ -5738,7 +5738,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5738
5738
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5739
5739
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5740
5740
|
addElement({
|
|
5741
|
-
id:
|
|
5741
|
+
id: chunk5FIC2LG3_js.generateElementId(),
|
|
5742
5742
|
type: "shape",
|
|
5743
5743
|
x: 120,
|
|
5744
5744
|
y: 200,
|
|
@@ -5760,11 +5760,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5760
5760
|
if (!activeSlide) {
|
|
5761
5761
|
return;
|
|
5762
5762
|
}
|
|
5763
|
-
const preset =
|
|
5763
|
+
const preset = chunk5FIC2LG3_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5764
5764
|
if (!preset) {
|
|
5765
5765
|
return;
|
|
5766
5766
|
}
|
|
5767
|
-
const defaultPptxAction =
|
|
5767
|
+
const defaultPptxAction = chunk5FIC2LG3_js.elementActionToPptxAction({
|
|
5768
5768
|
trigger: "click",
|
|
5769
5769
|
type: preset.defaultAction
|
|
5770
5770
|
});
|
|
@@ -5773,7 +5773,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5773
5773
|
defaultPptxAction.highlightClick = true;
|
|
5774
5774
|
}
|
|
5775
5775
|
addElement({
|
|
5776
|
-
id:
|
|
5776
|
+
id: chunk5FIC2LG3_js.generateElementId(),
|
|
5777
5777
|
type: "shape",
|
|
5778
5778
|
x: 150,
|
|
5779
5779
|
y: 150,
|
|
@@ -5840,14 +5840,14 @@ function useInsertElements(input) {
|
|
|
5840
5840
|
return;
|
|
5841
5841
|
}
|
|
5842
5842
|
addElement({
|
|
5843
|
-
id:
|
|
5843
|
+
id: chunk5FIC2LG3_js.generateElementId(),
|
|
5844
5844
|
type: "text",
|
|
5845
5845
|
x: 100,
|
|
5846
5846
|
y: 100,
|
|
5847
5847
|
width: 300,
|
|
5848
5848
|
height: 60,
|
|
5849
5849
|
text: "",
|
|
5850
|
-
textStyle: { fontSize:
|
|
5850
|
+
textStyle: { fontSize: chunkLIIV45TR_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5851
5851
|
});
|
|
5852
5852
|
};
|
|
5853
5853
|
const handleAddShape = () => {
|
|
@@ -5855,7 +5855,7 @@ function useInsertElements(input) {
|
|
|
5855
5855
|
return;
|
|
5856
5856
|
}
|
|
5857
5857
|
addElement({
|
|
5858
|
-
id:
|
|
5858
|
+
id: chunk5FIC2LG3_js.generateElementId(),
|
|
5859
5859
|
type: "shape",
|
|
5860
5860
|
x: 150,
|
|
5861
5861
|
y: 150,
|
|
@@ -5874,15 +5874,15 @@ function useInsertElements(input) {
|
|
|
5874
5874
|
return;
|
|
5875
5875
|
}
|
|
5876
5876
|
addElement({
|
|
5877
|
-
...
|
|
5878
|
-
id:
|
|
5877
|
+
...chunk5FIC2LG3_js.newTableElement(chunkLIIV45TR_js.DEFAULT_TABLE_ROWS, chunkLIIV45TR_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5878
|
+
id: chunk5FIC2LG3_js.generateElementId()
|
|
5879
5879
|
});
|
|
5880
5880
|
};
|
|
5881
5881
|
const handleAddChart = (chartKind) => {
|
|
5882
5882
|
if (!activeSlide) {
|
|
5883
5883
|
return;
|
|
5884
5884
|
}
|
|
5885
|
-
addElement(
|
|
5885
|
+
addElement(chunk5FIC2LG3_js.createDefaultChartElement(chartKind));
|
|
5886
5886
|
};
|
|
5887
5887
|
const structured = createStructuredElementHandlers({
|
|
5888
5888
|
activeSlide,
|
|
@@ -5952,7 +5952,7 @@ function useClipboardHandlers(input) {
|
|
|
5952
5952
|
if (!selectedElement) {
|
|
5953
5953
|
return;
|
|
5954
5954
|
}
|
|
5955
|
-
setClipboardPayload(
|
|
5955
|
+
setClipboardPayload(chunk5FIC2LG3_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5956
5956
|
};
|
|
5957
5957
|
const handleDelete = () => {
|
|
5958
5958
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5969,7 +5969,7 @@ function useClipboardHandlers(input) {
|
|
|
5969
5969
|
handleDelete();
|
|
5970
5970
|
};
|
|
5971
5971
|
const insertClone = (source) => {
|
|
5972
|
-
const clone =
|
|
5972
|
+
const clone = chunk5FIC2LG3_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5973
5973
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5974
5974
|
ops.applySelection(clone.id);
|
|
5975
5975
|
history.markDirty();
|
|
@@ -6004,7 +6004,7 @@ function resolveShapePath(el) {
|
|
|
6004
6004
|
return el.pathData;
|
|
6005
6005
|
}
|
|
6006
6006
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
6007
|
-
const clipPath =
|
|
6007
|
+
const clipPath = chunk5FIC2LG3_js.getPresetShapeClipPath(el.shapeType);
|
|
6008
6008
|
if (clipPath) {
|
|
6009
6009
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
6010
6010
|
if (svgPath) {
|
|
@@ -6055,7 +6055,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
6055
6055
|
return parts.join(" ");
|
|
6056
6056
|
}
|
|
6057
6057
|
function transformPathToGlobal(pathData, el) {
|
|
6058
|
-
const polys =
|
|
6058
|
+
const polys = chunk5FIC2LG3_js.svgPathToPolygons(pathData);
|
|
6059
6059
|
if (polys.length === 0) {
|
|
6060
6060
|
return pathData;
|
|
6061
6061
|
}
|
|
@@ -6075,10 +6075,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
6075
6075
|
y: pt.y * scaleY + el.y
|
|
6076
6076
|
}))
|
|
6077
6077
|
);
|
|
6078
|
-
return
|
|
6078
|
+
return chunk5FIC2LG3_js.polygonsToSvgPath(transformed);
|
|
6079
6079
|
}
|
|
6080
6080
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
6081
|
-
const polys =
|
|
6081
|
+
const polys = chunk5FIC2LG3_js.svgPathToPolygons(pathData);
|
|
6082
6082
|
if (polys.length === 0) {
|
|
6083
6083
|
return pathData;
|
|
6084
6084
|
}
|
|
@@ -6088,10 +6088,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
6088
6088
|
y: pt.y - y
|
|
6089
6089
|
}))
|
|
6090
6090
|
);
|
|
6091
|
-
return
|
|
6091
|
+
return chunk5FIC2LG3_js.polygonsToSvgPath(transformed);
|
|
6092
6092
|
}
|
|
6093
6093
|
function pathBounds(pathData) {
|
|
6094
|
-
const polys =
|
|
6094
|
+
const polys = chunk5FIC2LG3_js.svgPathToPolygons(pathData);
|
|
6095
6095
|
let minX = Infinity;
|
|
6096
6096
|
let minY = Infinity;
|
|
6097
6097
|
let maxX = -Infinity;
|
|
@@ -6150,7 +6150,7 @@ function useMergeShapesHandler(input) {
|
|
|
6150
6150
|
let allFragments = [];
|
|
6151
6151
|
let remaining = globalPaths[0];
|
|
6152
6152
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6153
|
-
const frags =
|
|
6153
|
+
const frags = chunk5FIC2LG3_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
6154
6154
|
if (Array.isArray(frags)) {
|
|
6155
6155
|
allFragments = frags;
|
|
6156
6156
|
}
|
|
@@ -6179,7 +6179,7 @@ function useMergeShapesHandler(input) {
|
|
|
6179
6179
|
bounds.height
|
|
6180
6180
|
);
|
|
6181
6181
|
const newEl = {
|
|
6182
|
-
id:
|
|
6182
|
+
id: chunk5FIC2LG3_js.generateElementId(),
|
|
6183
6183
|
type: "shape",
|
|
6184
6184
|
x: bounds.x,
|
|
6185
6185
|
y: bounds.y,
|
|
@@ -6217,7 +6217,7 @@ function useMergeShapesHandler(input) {
|
|
|
6217
6217
|
} else {
|
|
6218
6218
|
let resultPath = globalPaths[0];
|
|
6219
6219
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6220
|
-
const result =
|
|
6220
|
+
const result = chunk5FIC2LG3_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
6221
6221
|
if (typeof result === "string") {
|
|
6222
6222
|
resultPath = result;
|
|
6223
6223
|
}
|
|
@@ -6238,7 +6238,7 @@ function useMergeShapesHandler(input) {
|
|
|
6238
6238
|
);
|
|
6239
6239
|
const primary = targets[0];
|
|
6240
6240
|
const newEl = {
|
|
6241
|
-
id:
|
|
6241
|
+
id: chunk5FIC2LG3_js.generateElementId(),
|
|
6242
6242
|
type: "shape",
|
|
6243
6243
|
x: bounds.x,
|
|
6244
6244
|
y: bounds.y,
|
|
@@ -6301,7 +6301,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6301
6301
|
if (ids.length < 2 || !activeSlide) {
|
|
6302
6302
|
return;
|
|
6303
6303
|
}
|
|
6304
|
-
const { elements, groupId } =
|
|
6304
|
+
const { elements, groupId } = chunk5FIC2LG3_js.groupElements(ops.activeElements, ids, chunk5FIC2LG3_js.generateElementId());
|
|
6305
6305
|
if (groupId === null) {
|
|
6306
6306
|
return;
|
|
6307
6307
|
}
|
|
@@ -6314,11 +6314,11 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6314
6314
|
return;
|
|
6315
6315
|
}
|
|
6316
6316
|
const group = selectedElement;
|
|
6317
|
-
const intoTemplate =
|
|
6317
|
+
const intoTemplate = chunk5FIC2LG3_js.isTemplateElementId(group.id);
|
|
6318
6318
|
const childIds = group.children.map(
|
|
6319
|
-
(child) => intoTemplate ?
|
|
6319
|
+
(child) => intoTemplate ? chunk5FIC2LG3_js.makeCloneId(true, child.id || group.id) : child.id || chunk5FIC2LG3_js.generateElementId()
|
|
6320
6320
|
);
|
|
6321
|
-
const { elements, childIds: usedIds } =
|
|
6321
|
+
const { elements, childIds: usedIds } = chunk5FIC2LG3_js.ungroupElements(
|
|
6322
6322
|
ops.activeElements,
|
|
6323
6323
|
group.id,
|
|
6324
6324
|
childIds,
|
|
@@ -6347,7 +6347,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6347
6347
|
if (!edge) {
|
|
6348
6348
|
return;
|
|
6349
6349
|
}
|
|
6350
|
-
const positions =
|
|
6350
|
+
const positions = chunk5FIC2LG3_js.alignElements(selectedElements, edge);
|
|
6351
6351
|
for (const [id, pos] of positions) {
|
|
6352
6352
|
const el = elementLookup.get(id);
|
|
6353
6353
|
if (!el) {
|
|
@@ -6365,7 +6365,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6365
6365
|
if (!distAxis) {
|
|
6366
6366
|
return;
|
|
6367
6367
|
}
|
|
6368
|
-
const positions =
|
|
6368
|
+
const positions = chunk5FIC2LG3_js.distributeElements(selectedElements, distAxis);
|
|
6369
6369
|
for (const [id, pos] of positions) {
|
|
6370
6370
|
const el = elementLookup.get(id);
|
|
6371
6371
|
if (!el) {
|
|
@@ -6382,7 +6382,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6382
6382
|
}
|
|
6383
6383
|
const id = selectedElement.id;
|
|
6384
6384
|
ops.updateActiveElements(
|
|
6385
|
-
(els) => direction === "forward" ?
|
|
6385
|
+
(els) => direction === "forward" ? chunk5FIC2LG3_js.bringForward(els, id) : direction === "backward" ? chunk5FIC2LG3_js.sendBackward(els, id) : els
|
|
6386
6386
|
);
|
|
6387
6387
|
history.markDirty();
|
|
6388
6388
|
};
|
|
@@ -6392,7 +6392,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6392
6392
|
}
|
|
6393
6393
|
const id = selectedElement.id;
|
|
6394
6394
|
ops.updateActiveElements(
|
|
6395
|
-
(els) => direction === "front" ?
|
|
6395
|
+
(els) => direction === "front" ? chunk5FIC2LG3_js.bringToFront(els, id) : chunk5FIC2LG3_js.sendToBack(els, id)
|
|
6396
6396
|
);
|
|
6397
6397
|
history.markDirty();
|
|
6398
6398
|
};
|
|
@@ -6523,7 +6523,7 @@ function useSlideManagement(input) {
|
|
|
6523
6523
|
theme
|
|
6524
6524
|
} = input;
|
|
6525
6525
|
const handleAddSlide = () => {
|
|
6526
|
-
const newSlide =
|
|
6526
|
+
const newSlide = chunk5FIC2LG3_js.createBlankSlide(slides.length + 1);
|
|
6527
6527
|
ops.updateSlides((prev) => {
|
|
6528
6528
|
const next = [...prev];
|
|
6529
6529
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6586,7 +6586,7 @@ function useSlideManagement(input) {
|
|
|
6586
6586
|
}
|
|
6587
6587
|
const clone = {
|
|
6588
6588
|
...src,
|
|
6589
|
-
id:
|
|
6589
|
+
id: chunk5FIC2LG3_js.makeSlideId(),
|
|
6590
6590
|
elements: src.elements.map((el) => ({
|
|
6591
6591
|
...el,
|
|
6592
6592
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6618,7 +6618,7 @@ function useSlideManagement(input) {
|
|
|
6618
6618
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6619
6619
|
const insertAt = activeSlideIndex + 1;
|
|
6620
6620
|
const draft = {
|
|
6621
|
-
...
|
|
6621
|
+
...chunk5FIC2LG3_js.createBlankSlide(slides.length + 1),
|
|
6622
6622
|
layoutPath,
|
|
6623
6623
|
...layoutName ? { layoutName } : {}
|
|
6624
6624
|
};
|
|
@@ -6651,9 +6651,9 @@ function useSlideManagement(input) {
|
|
|
6651
6651
|
};
|
|
6652
6652
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6653
6653
|
const insertAt = activeSlideIndex + 1;
|
|
6654
|
-
const draft =
|
|
6654
|
+
const draft = chunk5FIC2LG3_js.buildSlideTemplateSlide(templateId, chunk5FIC2LG3_js.makeSlideId(), slides.length + 1, {
|
|
6655
6655
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6656
|
-
scheme:
|
|
6656
|
+
scheme: chunk5FIC2LG3_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6657
6657
|
});
|
|
6658
6658
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6659
6659
|
setActiveSlideIndex(insertAt);
|
|
@@ -6690,7 +6690,7 @@ function createTableMergeHandlers(input) {
|
|
|
6690
6690
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6691
6691
|
return;
|
|
6692
6692
|
}
|
|
6693
|
-
const newTableData =
|
|
6693
|
+
const newTableData = chunk5FIC2LG3_js.mergeCells(
|
|
6694
6694
|
[
|
|
6695
6695
|
{ row: rowIndex, col: columnIndex },
|
|
6696
6696
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6698,7 +6698,7 @@ function createTableMergeHandlers(input) {
|
|
|
6698
6698
|
td
|
|
6699
6699
|
);
|
|
6700
6700
|
const updates = { tableData: newTableData };
|
|
6701
|
-
const newRawXml =
|
|
6701
|
+
const newRawXml = chunk5FIC2LG3_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6702
6702
|
if (newRawXml) {
|
|
6703
6703
|
updates.rawXml = newRawXml;
|
|
6704
6704
|
}
|
|
@@ -6724,7 +6724,7 @@ function createTableMergeHandlers(input) {
|
|
|
6724
6724
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6725
6725
|
return;
|
|
6726
6726
|
}
|
|
6727
|
-
const newTableData =
|
|
6727
|
+
const newTableData = chunk5FIC2LG3_js.mergeCells(
|
|
6728
6728
|
[
|
|
6729
6729
|
{ row: rowIndex, col: columnIndex },
|
|
6730
6730
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6732,7 +6732,7 @@ function createTableMergeHandlers(input) {
|
|
|
6732
6732
|
td
|
|
6733
6733
|
);
|
|
6734
6734
|
const updates = { tableData: newTableData };
|
|
6735
|
-
const newRawXml =
|
|
6735
|
+
const newRawXml = chunk5FIC2LG3_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6736
6736
|
if (newRawXml) {
|
|
6737
6737
|
updates.rawXml = newRawXml;
|
|
6738
6738
|
}
|
|
@@ -6747,9 +6747,9 @@ function createTableMergeHandlers(input) {
|
|
|
6747
6747
|
return;
|
|
6748
6748
|
}
|
|
6749
6749
|
const td = selectedElement.tableData;
|
|
6750
|
-
const newTableData =
|
|
6750
|
+
const newTableData = chunk5FIC2LG3_js.mergeCells(ts.selectedCells, td);
|
|
6751
6751
|
const updates = { tableData: newTableData };
|
|
6752
|
-
const newRawXml =
|
|
6752
|
+
const newRawXml = chunk5FIC2LG3_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6753
6753
|
if (newRawXml) {
|
|
6754
6754
|
updates.rawXml = newRawXml;
|
|
6755
6755
|
}
|
|
@@ -6766,9 +6766,9 @@ function createTableMergeHandlers(input) {
|
|
|
6766
6766
|
}
|
|
6767
6767
|
const { rowIndex, columnIndex } = ts;
|
|
6768
6768
|
const td = selectedElement.tableData;
|
|
6769
|
-
const newTableData =
|
|
6769
|
+
const newTableData = chunk5FIC2LG3_js.splitCell(rowIndex, columnIndex, td);
|
|
6770
6770
|
const updates = { tableData: newTableData };
|
|
6771
|
-
const newRawXml =
|
|
6771
|
+
const newRawXml = chunk5FIC2LG3_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6772
6772
|
if (newRawXml) {
|
|
6773
6773
|
updates.rawXml = newRawXml;
|
|
6774
6774
|
}
|
|
@@ -6802,10 +6802,10 @@ function createTableStructHandlers(input) {
|
|
|
6802
6802
|
const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
|
|
6803
6803
|
const updates = {};
|
|
6804
6804
|
if (el.tableData) {
|
|
6805
|
-
updates.tableData =
|
|
6805
|
+
updates.tableData = chunk5FIC2LG3_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6806
6806
|
}
|
|
6807
6807
|
if (el.rawXml) {
|
|
6808
|
-
const newRawXml =
|
|
6808
|
+
const newRawXml = chunk5FIC2LG3_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6809
6809
|
if (newRawXml) {
|
|
6810
6810
|
updates.rawXml = newRawXml;
|
|
6811
6811
|
}
|
|
@@ -6829,7 +6829,7 @@ function createTableStructHandlers(input) {
|
|
|
6829
6829
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6830
6830
|
const updates = {};
|
|
6831
6831
|
if (selectedElement.rawXml) {
|
|
6832
|
-
const newRawXml =
|
|
6832
|
+
const newRawXml = chunk5FIC2LG3_js.updateCellTextStyleInRawXml(
|
|
6833
6833
|
selectedElement,
|
|
6834
6834
|
rowIndex,
|
|
6835
6835
|
colIndex,
|
|
@@ -6893,9 +6893,9 @@ function createTableStructHandlers(input) {
|
|
|
6893
6893
|
return;
|
|
6894
6894
|
}
|
|
6895
6895
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6896
|
-
const newTableData =
|
|
6896
|
+
const newTableData = chunk5FIC2LG3_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6897
6897
|
const updates = { tableData: newTableData };
|
|
6898
|
-
const newRawXml =
|
|
6898
|
+
const newRawXml = chunk5FIC2LG3_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6899
6899
|
if (newRawXml) {
|
|
6900
6900
|
updates.rawXml = newRawXml;
|
|
6901
6901
|
}
|
|
@@ -6908,12 +6908,12 @@ function createTableStructHandlers(input) {
|
|
|
6908
6908
|
}
|
|
6909
6909
|
const td = selectedElement.tableData;
|
|
6910
6910
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6911
|
-
const newTableData =
|
|
6911
|
+
const newTableData = chunk5FIC2LG3_js.deleteTableRow(td, rowIdx);
|
|
6912
6912
|
if (newTableData === td) {
|
|
6913
6913
|
return;
|
|
6914
6914
|
}
|
|
6915
6915
|
const updates = { tableData: newTableData };
|
|
6916
|
-
const newRawXml =
|
|
6916
|
+
const newRawXml = chunk5FIC2LG3_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6917
6917
|
if (newRawXml) {
|
|
6918
6918
|
updates.rawXml = newRawXml;
|
|
6919
6919
|
}
|
|
@@ -6925,9 +6925,9 @@ function createTableStructHandlers(input) {
|
|
|
6925
6925
|
return;
|
|
6926
6926
|
}
|
|
6927
6927
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6928
|
-
const newTableData =
|
|
6928
|
+
const newTableData = chunk5FIC2LG3_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6929
6929
|
const updates = { tableData: newTableData };
|
|
6930
|
-
const newRawXml =
|
|
6930
|
+
const newRawXml = chunk5FIC2LG3_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6931
6931
|
if (newRawXml) {
|
|
6932
6932
|
updates.rawXml = newRawXml;
|
|
6933
6933
|
}
|
|
@@ -6940,12 +6940,12 @@ function createTableStructHandlers(input) {
|
|
|
6940
6940
|
}
|
|
6941
6941
|
const td = selectedElement.tableData;
|
|
6942
6942
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6943
|
-
const newTableData =
|
|
6943
|
+
const newTableData = chunk5FIC2LG3_js.deleteTableColumn(td, colIdx);
|
|
6944
6944
|
if (newTableData === td) {
|
|
6945
6945
|
return;
|
|
6946
6946
|
}
|
|
6947
6947
|
const updates = { tableData: newTableData };
|
|
6948
|
-
const newRawXml =
|
|
6948
|
+
const newRawXml = chunk5FIC2LG3_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6949
6949
|
if (newRawXml) {
|
|
6950
6950
|
updates.rawXml = newRawXml;
|
|
6951
6951
|
}
|
|
@@ -6981,8 +6981,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6981
6981
|
return html2canvasPro(element, {
|
|
6982
6982
|
...options,
|
|
6983
6983
|
onclone: async (doc, clonedEl) => {
|
|
6984
|
-
await
|
|
6985
|
-
|
|
6984
|
+
await chunk5FIC2LG3_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6985
|
+
chunk5FIC2LG3_js.preprocessCssForCapture(clonedEl);
|
|
6986
6986
|
if (typeof userOnClone === "function") {
|
|
6987
6987
|
userOnClone(doc, clonedEl);
|
|
6988
6988
|
}
|
|
@@ -7020,13 +7020,13 @@ function useExportSaveAs(input) {
|
|
|
7020
7020
|
if (!handler) {
|
|
7021
7021
|
return;
|
|
7022
7022
|
}
|
|
7023
|
-
const downloadName =
|
|
7023
|
+
const downloadName = chunk5FIC2LG3_js.savedPresentationFileName(filePath, format);
|
|
7024
7024
|
try {
|
|
7025
7025
|
const data = await buildSaveAsData(handler, format);
|
|
7026
7026
|
const blob = new Blob([data], {
|
|
7027
7027
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
7028
7028
|
});
|
|
7029
|
-
|
|
7029
|
+
chunk5FIC2LG3_js.downloadBlob(blob, downloadName);
|
|
7030
7030
|
} catch (err) {
|
|
7031
7031
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
7032
7032
|
}
|
|
@@ -7039,18 +7039,18 @@ function useExportSaveAs(input) {
|
|
|
7039
7039
|
const pptxGuides = guides.map((g) => ({
|
|
7040
7040
|
id: g.id,
|
|
7041
7041
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7042
|
-
positionEmu:
|
|
7042
|
+
positionEmu: chunk5FIC2LG3_js.guidePxToEmu(g.position)
|
|
7043
7043
|
}));
|
|
7044
7044
|
return {
|
|
7045
7045
|
...slide,
|
|
7046
7046
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7047
7047
|
};
|
|
7048
7048
|
});
|
|
7049
|
-
const slidesToSave =
|
|
7049
|
+
const slidesToSave = chunk5FIC2LG3_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7050
7050
|
const saveOptions = {
|
|
7051
7051
|
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
7052
7052
|
// a preset picked in the inspector reached one save path and not the other.
|
|
7053
|
-
slideSize:
|
|
7053
|
+
slideSize: chunk5FIC2LG3_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
7054
7054
|
headerFooter,
|
|
7055
7055
|
presentationProperties,
|
|
7056
7056
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -7064,13 +7064,13 @@ function useExportSaveAs(input) {
|
|
|
7064
7064
|
handoutMaster,
|
|
7065
7065
|
outputFormat: format
|
|
7066
7066
|
};
|
|
7067
|
-
return
|
|
7067
|
+
return chunk5FIC2LG3_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
7068
7068
|
};
|
|
7069
7069
|
const handleExportJson = () => {
|
|
7070
7070
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7071
|
-
const slideSize =
|
|
7071
|
+
const slideSize = chunk5FIC2LG3_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7072
7072
|
const data = {
|
|
7073
|
-
slides:
|
|
7073
|
+
slides: chunk5FIC2LG3_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7074
7074
|
width: canvasSize.width,
|
|
7075
7075
|
height: canvasSize.height,
|
|
7076
7076
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7089,7 +7089,7 @@ function useExportSaveAs(input) {
|
|
|
7089
7089
|
handoutMaster
|
|
7090
7090
|
};
|
|
7091
7091
|
try {
|
|
7092
|
-
|
|
7092
|
+
chunk5FIC2LG3_js.exportDeckJson(data, sourceName);
|
|
7093
7093
|
} catch (err) {
|
|
7094
7094
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7095
7095
|
}
|
|
@@ -7176,7 +7176,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
7176
7176
|
}
|
|
7177
7177
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
7178
7178
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
7179
|
-
|
|
7179
|
+
chunk5FIC2LG3_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
7180
7180
|
}
|
|
7181
7181
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
7182
7182
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -7198,15 +7198,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7198
7198
|
continue;
|
|
7199
7199
|
}
|
|
7200
7200
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
7201
|
-
images.push(
|
|
7201
|
+
images.push(chunk5FIC2LG3_js.canvasToJpegData(canvas));
|
|
7202
7202
|
}
|
|
7203
7203
|
onProgress?.(totalSlides, totalSlides);
|
|
7204
7204
|
setActiveSlide(currentSlideIndex);
|
|
7205
7205
|
if (images.length === 0) {
|
|
7206
7206
|
throw new Error(chunkUTIMT5CZ_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7207
7207
|
}
|
|
7208
|
-
const pdfBlobUrl =
|
|
7209
|
-
|
|
7208
|
+
const pdfBlobUrl = chunkLIIV45TR_js.buildPdfFromImageData(images);
|
|
7209
|
+
chunk5FIC2LG3_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
7210
7210
|
}
|
|
7211
7211
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
7212
7212
|
const { scale = 2, onProgress } = options;
|
|
@@ -7254,8 +7254,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7254
7254
|
if (pages.length === 0) {
|
|
7255
7255
|
throw new Error(chunkUTIMT5CZ_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7256
7256
|
}
|
|
7257
|
-
const pdfDataUrl =
|
|
7258
|
-
|
|
7257
|
+
const pdfDataUrl = chunkLIIV45TR_js.buildNotesPdf(pages);
|
|
7258
|
+
chunk5FIC2LG3_js.downloadDataUrl(pdfDataUrl, filename);
|
|
7259
7259
|
}
|
|
7260
7260
|
|
|
7261
7261
|
// src/viewer/utils/export-video.ts
|
|
@@ -7299,7 +7299,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7299
7299
|
const fps = 30;
|
|
7300
7300
|
const stream = recordingCanvas.captureStream(fps);
|
|
7301
7301
|
const recorder = new MediaRecorder(stream, {
|
|
7302
|
-
mimeType:
|
|
7302
|
+
mimeType: chunk5FIC2LG3_js.pickSupportedMimeType([...chunk5FIC2LG3_js.WEBM_MIME_CANDIDATES]),
|
|
7303
7303
|
videoBitsPerSecond: 5e6
|
|
7304
7304
|
});
|
|
7305
7305
|
const chunks = [];
|
|
@@ -7322,8 +7322,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7322
7322
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
7323
7323
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
7324
7324
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
7325
|
-
const frameInterval =
|
|
7326
|
-
const framesNeeded =
|
|
7325
|
+
const frameInterval = chunk5FIC2LG3_js.fpsToFrameIntervalMs(fps);
|
|
7326
|
+
const framesNeeded = chunk5FIC2LG3_js.segmentFrameCount(duration, fps);
|
|
7327
7327
|
for (let f = 0; f < framesNeeded; f++) {
|
|
7328
7328
|
if (signal?.aborted) {
|
|
7329
7329
|
recorder.stop();
|
|
@@ -7372,7 +7372,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7372
7372
|
if (frames.length === 0) {
|
|
7373
7373
|
throw new Error(chunkUTIMT5CZ_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
7374
7374
|
}
|
|
7375
|
-
const gifBytes =
|
|
7375
|
+
const gifBytes = chunk5FIC2LG3_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
7376
7376
|
onProgress?.(totalSlides, totalSlides);
|
|
7377
7377
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
7378
7378
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -7426,7 +7426,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7426
7426
|
continue;
|
|
7427
7427
|
}
|
|
7428
7428
|
onProgress?.(processedCount, data.slides.length);
|
|
7429
|
-
let svg =
|
|
7429
|
+
let svg = chunk5FIC2LG3_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7430
7430
|
if (embedFonts && fontFaces?.length) {
|
|
7431
7431
|
svg = injectFontFaces(svg, fontFaces);
|
|
7432
7432
|
}
|
|
@@ -7535,21 +7535,21 @@ function useExportHandlers(input) {
|
|
|
7535
7535
|
{
|
|
7536
7536
|
scale: imageExportScale,
|
|
7537
7537
|
onProgress: (current, total) => {
|
|
7538
|
-
setExportProgress(
|
|
7539
|
-
setExportStatusMessage(
|
|
7538
|
+
setExportProgress(chunk5FIC2LG3_js.slideProgressPercent(current, total));
|
|
7539
|
+
setExportStatusMessage(chunk5FIC2LG3_js.slideStatusLabel("Rendering", current, total));
|
|
7540
7540
|
},
|
|
7541
7541
|
signal: abortCtrl.signal
|
|
7542
7542
|
}
|
|
7543
7543
|
);
|
|
7544
|
-
setExportProgress(
|
|
7544
|
+
setExportProgress(chunk5FIC2LG3_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7545
7545
|
setExportStatusMessage("Building PDF...");
|
|
7546
7546
|
await new Promise((r) => {
|
|
7547
7547
|
setTimeout(r, 100);
|
|
7548
7548
|
});
|
|
7549
|
-
setExportProgress(
|
|
7549
|
+
setExportProgress(chunk5FIC2LG3_js.EXPORT_DONE_PERCENT);
|
|
7550
7550
|
setExportStatusMessage("Done!");
|
|
7551
7551
|
} catch (err) {
|
|
7552
|
-
if (!
|
|
7552
|
+
if (!chunk5FIC2LG3_js.isExportAbortError(err)) {
|
|
7553
7553
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7554
7554
|
}
|
|
7555
7555
|
} finally {
|
|
@@ -7579,21 +7579,21 @@ function useExportHandlers(input) {
|
|
|
7579
7579
|
{
|
|
7580
7580
|
scale: imageExportScale,
|
|
7581
7581
|
onProgress: (current, total) => {
|
|
7582
|
-
setExportProgress(
|
|
7583
|
-
setExportStatusMessage(
|
|
7582
|
+
setExportProgress(chunk5FIC2LG3_js.slideProgressPercent(current, total));
|
|
7583
|
+
setExportStatusMessage(chunk5FIC2LG3_js.slideStatusLabel("Rendering", current, total));
|
|
7584
7584
|
},
|
|
7585
7585
|
signal: abortCtrl.signal
|
|
7586
7586
|
}
|
|
7587
7587
|
);
|
|
7588
|
-
setExportProgress(
|
|
7588
|
+
setExportProgress(chunk5FIC2LG3_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7589
7589
|
setExportStatusMessage("Building PDF...");
|
|
7590
7590
|
await new Promise((r) => {
|
|
7591
7591
|
setTimeout(r, 100);
|
|
7592
7592
|
});
|
|
7593
|
-
setExportProgress(
|
|
7593
|
+
setExportProgress(chunk5FIC2LG3_js.EXPORT_DONE_PERCENT);
|
|
7594
7594
|
setExportStatusMessage("Done!");
|
|
7595
7595
|
} catch (err) {
|
|
7596
|
-
if (!
|
|
7596
|
+
if (!chunk5FIC2LG3_js.isExportAbortError(err)) {
|
|
7597
7597
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7598
7598
|
}
|
|
7599
7599
|
} finally {
|
|
@@ -7635,22 +7635,22 @@ function useExportHandlers(input) {
|
|
|
7635
7635
|
scale: 1,
|
|
7636
7636
|
slideDurationMs: 3e3,
|
|
7637
7637
|
onProgress: (current, total) => {
|
|
7638
|
-
setExportProgress(
|
|
7639
|
-
setExportStatusMessage(
|
|
7638
|
+
setExportProgress(chunk5FIC2LG3_js.slideProgressPercent(current, total, 45));
|
|
7639
|
+
setExportStatusMessage(chunk5FIC2LG3_js.slideStatusLabel("Capturing", current, total));
|
|
7640
7640
|
},
|
|
7641
7641
|
onRecordProgress: (current, total) => {
|
|
7642
|
-
setExportProgress(
|
|
7643
|
-
setExportStatusMessage(
|
|
7642
|
+
setExportProgress(chunk5FIC2LG3_js.recordProgressPercent(current, total));
|
|
7643
|
+
setExportStatusMessage(chunk5FIC2LG3_js.slideStatusLabel("Recording", current, total));
|
|
7644
7644
|
},
|
|
7645
7645
|
signal: abortCtrl.signal
|
|
7646
7646
|
}
|
|
7647
7647
|
);
|
|
7648
|
-
setExportProgress(
|
|
7648
|
+
setExportProgress(chunk5FIC2LG3_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7649
7649
|
setExportStatusMessage("Saving file...");
|
|
7650
|
-
|
|
7651
|
-
setExportProgress(
|
|
7650
|
+
chunk5FIC2LG3_js.downloadBlob(blob, "presentation.webm");
|
|
7651
|
+
setExportProgress(chunk5FIC2LG3_js.EXPORT_DONE_PERCENT);
|
|
7652
7652
|
} catch (err) {
|
|
7653
|
-
if (!
|
|
7653
|
+
if (!chunk5FIC2LG3_js.isExportAbortError(err)) {
|
|
7654
7654
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7655
7655
|
}
|
|
7656
7656
|
} finally {
|
|
@@ -7678,18 +7678,18 @@ function useExportHandlers(input) {
|
|
|
7678
7678
|
scale: 0.5,
|
|
7679
7679
|
slideDurationMs: 2e3,
|
|
7680
7680
|
onProgress: (current, total) => {
|
|
7681
|
-
setExportProgress(
|
|
7682
|
-
setExportStatusMessage(
|
|
7681
|
+
setExportProgress(chunk5FIC2LG3_js.slideProgressPercent(current, total));
|
|
7682
|
+
setExportStatusMessage(chunk5FIC2LG3_js.slideStatusLabel("Encoding", current, total));
|
|
7683
7683
|
},
|
|
7684
7684
|
signal: abortCtrl.signal
|
|
7685
7685
|
}
|
|
7686
7686
|
);
|
|
7687
|
-
setExportProgress(
|
|
7687
|
+
setExportProgress(chunk5FIC2LG3_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7688
7688
|
setExportStatusMessage("Saving file...");
|
|
7689
|
-
|
|
7690
|
-
setExportProgress(
|
|
7689
|
+
chunk5FIC2LG3_js.downloadBlob(blob, "presentation.gif");
|
|
7690
|
+
setExportProgress(chunk5FIC2LG3_js.EXPORT_DONE_PERCENT);
|
|
7691
7691
|
} catch (err) {
|
|
7692
|
-
if (!
|
|
7692
|
+
if (!chunk5FIC2LG3_js.isExportAbortError(err)) {
|
|
7693
7693
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7694
7694
|
}
|
|
7695
7695
|
} finally {
|
|
@@ -7722,7 +7722,7 @@ function useExportHandlers(input) {
|
|
|
7722
7722
|
exportStatusMessage
|
|
7723
7723
|
};
|
|
7724
7724
|
}
|
|
7725
|
-
var ViewerOptionsContext = react.createContext(
|
|
7725
|
+
var ViewerOptionsContext = react.createContext(chunk5FIC2LG3_js.DEFAULT_VIEWER_OPTIONS);
|
|
7726
7726
|
function useViewerOptionsContext() {
|
|
7727
7727
|
return react.useContext(ViewerOptionsContext);
|
|
7728
7728
|
}
|
|
@@ -7734,13 +7734,13 @@ function usePrintHandlers(input) {
|
|
|
7734
7734
|
const { t } = reactI18next.useTranslation();
|
|
7735
7735
|
const viewerOptions = useViewerOptionsContext();
|
|
7736
7736
|
const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
|
|
7737
|
-
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) *
|
|
7737
|
+
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunk5FIC2LG3_js.resolveImageResolutionScale(viewerOptions);
|
|
7738
7738
|
const handlePrint = () => {
|
|
7739
7739
|
setIsPrintDialogOpen(true);
|
|
7740
7740
|
};
|
|
7741
7741
|
const handlePrintSvg = async (settings) => {
|
|
7742
7742
|
setIsPrintDialogOpen(false);
|
|
7743
|
-
const printWindow =
|
|
7743
|
+
const printWindow = chunk5FIC2LG3_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7744
7744
|
if (!printWindow) {
|
|
7745
7745
|
console.warn(
|
|
7746
7746
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7750,9 +7750,9 @@ function usePrintHandlers(input) {
|
|
|
7750
7750
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7751
7751
|
return runRasterPrint(printWindow, settings);
|
|
7752
7752
|
}
|
|
7753
|
-
const colorFilter =
|
|
7754
|
-
const slideIndices =
|
|
7755
|
-
|
|
7753
|
+
const colorFilter = chunk5FIC2LG3_js.computeColorFilter(settings.colorMode);
|
|
7754
|
+
const slideIndices = chunk5FIC2LG3_js.filterHiddenSlideIndices(
|
|
7755
|
+
chunk5FIC2LG3_js.computeSlideIndices(
|
|
7756
7756
|
settings.slideRange,
|
|
7757
7757
|
activeSlideIndex,
|
|
7758
7758
|
slides.length,
|
|
@@ -7770,22 +7770,22 @@ function usePrintHandlers(input) {
|
|
|
7770
7770
|
printWindow.close();
|
|
7771
7771
|
return;
|
|
7772
7772
|
}
|
|
7773
|
-
const printDoc =
|
|
7773
|
+
const printDoc = chunk5FIC2LG3_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7774
7774
|
title: "Slides (Vector)",
|
|
7775
7775
|
orientation: settings.orientation,
|
|
7776
7776
|
colorFilter,
|
|
7777
7777
|
scaleToFit: settings.scaleToFit
|
|
7778
7778
|
});
|
|
7779
|
-
|
|
7779
|
+
chunk5FIC2LG3_js.finishPrintWindow(printWindow, printDoc);
|
|
7780
7780
|
} catch (err) {
|
|
7781
7781
|
console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
|
|
7782
7782
|
return runRasterPrint(printWindow, settings);
|
|
7783
7783
|
}
|
|
7784
7784
|
};
|
|
7785
7785
|
const runRasterPrint = async (printWindow, settings) => {
|
|
7786
|
-
const colorFilter =
|
|
7787
|
-
const slideIndices =
|
|
7788
|
-
|
|
7786
|
+
const colorFilter = chunk5FIC2LG3_js.computeColorFilter(settings.colorMode);
|
|
7787
|
+
const slideIndices = chunk5FIC2LG3_js.filterHiddenSlideIndices(
|
|
7788
|
+
chunk5FIC2LG3_js.computeSlideIndices(
|
|
7789
7789
|
settings.slideRange,
|
|
7790
7790
|
activeSlideIndex,
|
|
7791
7791
|
slides.length,
|
|
@@ -7796,11 +7796,11 @@ function usePrintHandlers(input) {
|
|
|
7796
7796
|
includeHiddenSlides
|
|
7797
7797
|
);
|
|
7798
7798
|
if (settings.printWhat === "outline") {
|
|
7799
|
-
|
|
7799
|
+
chunk5FIC2LG3_js.finishPrintWindow(
|
|
7800
7800
|
printWindow,
|
|
7801
|
-
|
|
7801
|
+
chunk5FIC2LG3_js.buildPrintHtmlDocument({
|
|
7802
7802
|
title: "Outline",
|
|
7803
|
-
bodyHtml: `<div class="outline-page">${
|
|
7803
|
+
bodyHtml: `<div class="outline-page">${chunk5FIC2LG3_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7804
7804
|
orientation: settings.orientation,
|
|
7805
7805
|
colorFilter,
|
|
7806
7806
|
frameSlides: settings.frameSlides,
|
|
@@ -7827,11 +7827,11 @@ function usePrintHandlers(input) {
|
|
|
7827
7827
|
}
|
|
7828
7828
|
const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
|
|
7829
7829
|
if (settings.printWhat === "slides") {
|
|
7830
|
-
|
|
7830
|
+
chunk5FIC2LG3_js.finishPrintWindow(
|
|
7831
7831
|
printWindow,
|
|
7832
|
-
|
|
7832
|
+
chunk5FIC2LG3_js.buildPrintHtmlDocument({
|
|
7833
7833
|
title: "Slides",
|
|
7834
|
-
bodyHtml:
|
|
7834
|
+
bodyHtml: chunk5FIC2LG3_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7835
7835
|
orientation: settings.orientation,
|
|
7836
7836
|
colorFilter,
|
|
7837
7837
|
frameSlides: settings.frameSlides,
|
|
@@ -7841,11 +7841,11 @@ function usePrintHandlers(input) {
|
|
|
7841
7841
|
return;
|
|
7842
7842
|
}
|
|
7843
7843
|
if (settings.printWhat === "notes") {
|
|
7844
|
-
|
|
7844
|
+
chunk5FIC2LG3_js.finishPrintWindow(
|
|
7845
7845
|
printWindow,
|
|
7846
|
-
|
|
7846
|
+
chunk5FIC2LG3_js.buildPrintHtmlDocument({
|
|
7847
7847
|
title: "Notes Pages",
|
|
7848
|
-
bodyHtml:
|
|
7848
|
+
bodyHtml: chunk5FIC2LG3_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7849
7849
|
orientation: "portrait",
|
|
7850
7850
|
colorFilter,
|
|
7851
7851
|
frameSlides: settings.frameSlides,
|
|
@@ -7856,11 +7856,11 @@ function usePrintHandlers(input) {
|
|
|
7856
7856
|
}
|
|
7857
7857
|
if (settings.printWhat === "handouts") {
|
|
7858
7858
|
const spp = settings.slidesPerPage;
|
|
7859
|
-
|
|
7859
|
+
chunk5FIC2LG3_js.finishPrintWindow(
|
|
7860
7860
|
printWindow,
|
|
7861
|
-
|
|
7861
|
+
chunk5FIC2LG3_js.buildPrintHtmlDocument({
|
|
7862
7862
|
title: `Handout ${spp} per page`,
|
|
7863
|
-
bodyHtml:
|
|
7863
|
+
bodyHtml: chunk5FIC2LG3_js.buildHandoutsHtml(slideImages, slideIndices, spp, pptxData?.handoutMaster),
|
|
7864
7864
|
orientation: "portrait",
|
|
7865
7865
|
colorFilter,
|
|
7866
7866
|
frameSlides: settings.frameSlides,
|
|
@@ -7874,7 +7874,7 @@ function usePrintHandlers(input) {
|
|
|
7874
7874
|
};
|
|
7875
7875
|
const handlePrintWithSettings = async (settings) => {
|
|
7876
7876
|
setIsPrintDialogOpen(false);
|
|
7877
|
-
const printWindow =
|
|
7877
|
+
const printWindow = chunk5FIC2LG3_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7878
7878
|
if (!printWindow) {
|
|
7879
7879
|
console.warn(
|
|
7880
7880
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7939,13 +7939,13 @@ function useThemeHandlers(input) {
|
|
|
7939
7939
|
return;
|
|
7940
7940
|
}
|
|
7941
7941
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7942
|
-
const previousMap = theme?.colorScheme ?
|
|
7943
|
-
setSlides((prev) =>
|
|
7942
|
+
const previousMap = theme?.colorScheme ? chunk5FIC2LG3_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7943
|
+
setSlides((prev) => chunk5FIC2LG3_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7944
7944
|
if (Object.keys(templateElementsBySlideId).length > 0) {
|
|
7945
7945
|
setTemplateElementsBySlideId((prev) => {
|
|
7946
7946
|
const next = {};
|
|
7947
7947
|
for (const [slideId, elements] of Object.entries(prev)) {
|
|
7948
|
-
next[slideId] =
|
|
7948
|
+
next[slideId] = chunk5FIC2LG3_js.reResolveElementColors(elements, previousMap, colorScheme);
|
|
7949
7949
|
}
|
|
7950
7950
|
return next;
|
|
7951
7951
|
});
|
|
@@ -8054,7 +8054,7 @@ function useThemeSwitching(input) {
|
|
|
8054
8054
|
}
|
|
8055
8055
|
try {
|
|
8056
8056
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
8057
|
-
const newData =
|
|
8057
|
+
const newData = chunk5FIC2LG3_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
8058
8058
|
onDataChange(newData);
|
|
8059
8059
|
onThemeChanged?.(preset);
|
|
8060
8060
|
} catch (error) {
|
|
@@ -8071,7 +8071,7 @@ function useThemeSwitching(input) {
|
|
|
8071
8071
|
}
|
|
8072
8072
|
try {
|
|
8073
8073
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
8074
|
-
const newData =
|
|
8074
|
+
const newData = chunk5FIC2LG3_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
8075
8075
|
onDataChange(newData);
|
|
8076
8076
|
} catch (error) {
|
|
8077
8077
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -8083,12 +8083,12 @@ function useThemeSwitching(input) {
|
|
|
8083
8083
|
if (!data?.theme?.colorScheme) {
|
|
8084
8084
|
return void 0;
|
|
8085
8085
|
}
|
|
8086
|
-
return
|
|
8087
|
-
(p) =>
|
|
8086
|
+
return chunk5FIC2LG3_js.THEME_PRESETS.find(
|
|
8087
|
+
(p) => chunk5FIC2LG3_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
8088
8088
|
);
|
|
8089
8089
|
}, [data?.theme?.colorScheme]);
|
|
8090
8090
|
return {
|
|
8091
|
-
presets:
|
|
8091
|
+
presets: chunk5FIC2LG3_js.THEME_PRESETS,
|
|
8092
8092
|
switchToPreset,
|
|
8093
8093
|
switchToCustom,
|
|
8094
8094
|
currentPreset
|
|
@@ -8163,7 +8163,7 @@ function usePropertyHandlers(input) {
|
|
|
8163
8163
|
}
|
|
8164
8164
|
try {
|
|
8165
8165
|
const ab = await file.arrayBuffer();
|
|
8166
|
-
const h = new
|
|
8166
|
+
const h = new chunk5FIC2LG3_js.PptxHandler();
|
|
8167
8167
|
const other = await h.load(ab);
|
|
8168
8168
|
if (!other) {
|
|
8169
8169
|
return;
|
|
@@ -8173,7 +8173,7 @@ function usePropertyHandlers(input) {
|
|
|
8173
8173
|
width: canvasSize.width,
|
|
8174
8174
|
height: canvasSize.height
|
|
8175
8175
|
};
|
|
8176
|
-
setCompareResult(
|
|
8176
|
+
setCompareResult(chunk5FIC2LG3_js.comparePresentation(cur, other));
|
|
8177
8177
|
setIsComparePanelOpen(true);
|
|
8178
8178
|
} catch (err) {
|
|
8179
8179
|
console.warn("Compare failed:", err);
|
|
@@ -8190,7 +8190,7 @@ function usePropertyHandlers(input) {
|
|
|
8190
8190
|
if (!diff || diff.status === "unchanged") {
|
|
8191
8191
|
return;
|
|
8192
8192
|
}
|
|
8193
|
-
setSlides((prev) =>
|
|
8193
|
+
setSlides((prev) => chunk5FIC2LG3_js.applyAcceptSlide(prev, diff));
|
|
8194
8194
|
setIsDirty(true);
|
|
8195
8195
|
},
|
|
8196
8196
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -8201,10 +8201,10 @@ function usePropertyHandlers(input) {
|
|
|
8201
8201
|
if (!compareResult) {
|
|
8202
8202
|
return;
|
|
8203
8203
|
}
|
|
8204
|
-
setSlides((prev) =>
|
|
8204
|
+
setSlides((prev) => chunk5FIC2LG3_js.applyAcceptAllSlides(prev, compareResult));
|
|
8205
8205
|
setIsDirty(true);
|
|
8206
8206
|
}, [compareResult, setSlides, setIsDirty]);
|
|
8207
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
8207
|
+
const usedFontFamilies = react.useMemo(() => chunk5FIC2LG3_js.collectUsedFonts(slides), [slides]);
|
|
8208
8208
|
return {
|
|
8209
8209
|
handleUpdateNotes,
|
|
8210
8210
|
handleUpdateSlide,
|
|
@@ -8359,7 +8359,7 @@ function useViewerDialogs(input) {
|
|
|
8359
8359
|
);
|
|
8360
8360
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8361
8361
|
const fontEmbedding = react.useMemo(
|
|
8362
|
-
() =>
|
|
8362
|
+
() => chunk5FIC2LG3_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8363
8363
|
[embeddedFontKey]
|
|
8364
8364
|
);
|
|
8365
8365
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8369,11 +8369,11 @@ function useViewerDialogs(input) {
|
|
|
8369
8369
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8370
8370
|
}
|
|
8371
8371
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8372
|
-
() => typeof window !== "undefined" ?
|
|
8372
|
+
() => typeof window !== "undefined" ? chunk5FIC2LG3_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8373
8373
|
);
|
|
8374
8374
|
react.useEffect(() => {
|
|
8375
8375
|
const handleWindow = () => setIsNarrowViewport(
|
|
8376
|
-
|
|
8376
|
+
chunk5FIC2LG3_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8377
8377
|
);
|
|
8378
8378
|
window.addEventListener("resize", handleWindow);
|
|
8379
8379
|
return () => window.removeEventListener("resize", handleWindow);
|
|
@@ -8526,16 +8526,16 @@ function useViewerDialogs(input) {
|
|
|
8526
8526
|
};
|
|
8527
8527
|
}
|
|
8528
8528
|
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8529
|
-
return
|
|
8529
|
+
return chunk5FIC2LG3_js.computeGridSpacingPx(documentGridSpacing, chunkLIIV45TR_js.GRID_SIZE);
|
|
8530
8530
|
}
|
|
8531
8531
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
8532
8532
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8533
|
-
const authoredRange =
|
|
8534
|
-
return
|
|
8533
|
+
const authoredRange = chunk5FIC2LG3_js.resolveAuthoredSlideRange(presentationProperties, slides.length);
|
|
8534
|
+
return chunk5FIC2LG3_js.resolveShowSlideIndexes(slides, activeShow, authoredRange);
|
|
8535
8535
|
}
|
|
8536
8536
|
function computeSlideSectionGroups(slides, sections) {
|
|
8537
|
-
return
|
|
8538
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8537
|
+
return chunk5FIC2LG3_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8538
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkLIIV45TR_js.UNGROUPED_SECTION_ID : chunkLIIV45TR_js.DEFAULT_SECTION_GROUP_ID),
|
|
8539
8539
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8540
8540
|
slideIndexes: group.slideIndexes,
|
|
8541
8541
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8547,7 +8547,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8547
8547
|
return void 0;
|
|
8548
8548
|
}
|
|
8549
8549
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8550
|
-
return
|
|
8550
|
+
return chunk5FIC2LG3_js.masterViewPseudoSlide(document2, {
|
|
8551
8551
|
tab: "slides",
|
|
8552
8552
|
masterIndex: 0,
|
|
8553
8553
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8575,15 +8575,15 @@ function useDerivedSlideState(input) {
|
|
|
8575
8575
|
[slides, activeCustomShowId, customShows, presentationProperties]
|
|
8576
8576
|
);
|
|
8577
8577
|
const authoredRange = react.useMemo(
|
|
8578
|
-
() =>
|
|
8578
|
+
() => chunk5FIC2LG3_js.resolveAuthoredSlideRange(presentationProperties, slides.length),
|
|
8579
8579
|
[presentationProperties, slides.length]
|
|
8580
8580
|
);
|
|
8581
8581
|
const slideSectionGroups = react.useMemo(
|
|
8582
8582
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8583
|
-
if (group.id ===
|
|
8583
|
+
if (group.id === chunkLIIV45TR_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8584
8584
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8585
8585
|
}
|
|
8586
|
-
if (group.id ===
|
|
8586
|
+
if (group.id === chunkLIIV45TR_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8587
8587
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8588
8588
|
}
|
|
8589
8589
|
return group;
|
|
@@ -8684,13 +8684,13 @@ function useAnnotationHandlers(input) {
|
|
|
8684
8684
|
}, [annotations, setMode, setSlides, history]);
|
|
8685
8685
|
const handleSetMode = react.useCallback(
|
|
8686
8686
|
(nextMode) => {
|
|
8687
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8687
|
+
if (mode === "present" && nextMode !== "present" && !chunk5FIC2LG3_js.mayLeaveSlideShow()) {
|
|
8688
8688
|
return;
|
|
8689
8689
|
}
|
|
8690
8690
|
if (nextMode === "present") {
|
|
8691
8691
|
presentation.enterPresentMode();
|
|
8692
8692
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8693
|
-
|
|
8693
|
+
chunk5FIC2LG3_js.stopAllPersistentAudio();
|
|
8694
8694
|
if (promptKeepInkAnnotations) {
|
|
8695
8695
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8696
8696
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8700,7 +8700,7 @@ function useAnnotationHandlers(input) {
|
|
|
8700
8700
|
}
|
|
8701
8701
|
} else {
|
|
8702
8702
|
if (mode === "present") {
|
|
8703
|
-
|
|
8703
|
+
chunk5FIC2LG3_js.stopAllPersistentAudio();
|
|
8704
8704
|
}
|
|
8705
8705
|
setMode(nextMode);
|
|
8706
8706
|
}
|
|
@@ -8765,13 +8765,13 @@ function useSerialize(input) {
|
|
|
8765
8765
|
let processedSlide = slide;
|
|
8766
8766
|
if (pendingEditId) {
|
|
8767
8767
|
const updatedElements = slide.elements.map((el) => {
|
|
8768
|
-
if (el.id !== pendingEditId || !
|
|
8768
|
+
if (el.id !== pendingEditId || !chunk5FIC2LG3_js.hasTextProperties(el)) {
|
|
8769
8769
|
return el;
|
|
8770
8770
|
}
|
|
8771
8771
|
return {
|
|
8772
8772
|
...el,
|
|
8773
8773
|
text: pendingEditText,
|
|
8774
|
-
textSegments:
|
|
8774
|
+
textSegments: chunk5FIC2LG3_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8775
8775
|
};
|
|
8776
8776
|
});
|
|
8777
8777
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8784,19 +8784,19 @@ function useSerialize(input) {
|
|
|
8784
8784
|
const pptxGuides = guides.map((g) => ({
|
|
8785
8785
|
id: g.id,
|
|
8786
8786
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8787
|
-
positionEmu:
|
|
8787
|
+
positionEmu: chunk5FIC2LG3_js.guidePxToEmu(g.position)
|
|
8788
8788
|
}));
|
|
8789
8789
|
return {
|
|
8790
8790
|
...processedSlide,
|
|
8791
8791
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8792
8792
|
};
|
|
8793
8793
|
});
|
|
8794
|
-
const slidesToSave =
|
|
8794
|
+
const slidesToSave = chunk5FIC2LG3_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8795
8795
|
const saveOptions = {
|
|
8796
8796
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8797
8797
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8798
8798
|
// slide-size edit reaches the file.
|
|
8799
|
-
slideSize:
|
|
8799
|
+
slideSize: chunk5FIC2LG3_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8800
8800
|
headerFooter,
|
|
8801
8801
|
presentationProperties,
|
|
8802
8802
|
viewProperties,
|
|
@@ -8809,9 +8809,9 @@ function useSerialize(input) {
|
|
|
8809
8809
|
slideMasters,
|
|
8810
8810
|
notesMaster,
|
|
8811
8811
|
handoutMaster,
|
|
8812
|
-
...
|
|
8812
|
+
...chunk5FIC2LG3_js.embeddedFontSaveOptions(embedFonts)
|
|
8813
8813
|
};
|
|
8814
|
-
return
|
|
8814
|
+
return chunk5FIC2LG3_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8815
8815
|
}, [
|
|
8816
8816
|
slides,
|
|
8817
8817
|
templateElementsBySlideId,
|
|
@@ -8847,7 +8847,7 @@ function useRecoveryDetection(input) {
|
|
|
8847
8847
|
const onRestore = input.onRestore;
|
|
8848
8848
|
const openVersionHistory = input.openVersionHistory;
|
|
8849
8849
|
react.useEffect(() => {
|
|
8850
|
-
if (!
|
|
8850
|
+
if (!chunk5FIC2LG3_js.shouldProbeAutosaveRecovery({
|
|
8851
8851
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8852
8852
|
filePath,
|
|
8853
8853
|
loading,
|
|
@@ -8859,7 +8859,7 @@ function useRecoveryDetection(input) {
|
|
|
8859
8859
|
}
|
|
8860
8860
|
recoveryCheckedRef.current = true;
|
|
8861
8861
|
void (async () => {
|
|
8862
|
-
const offer = await
|
|
8862
|
+
const offer = await chunk5FIC2LG3_js.probeAutosaveRecovery(filePath);
|
|
8863
8863
|
if (!offer) {
|
|
8864
8864
|
return;
|
|
8865
8865
|
}
|
|
@@ -8872,7 +8872,7 @@ function useRecoveryDetection(input) {
|
|
|
8872
8872
|
const record = recordRef.current;
|
|
8873
8873
|
setPrompt(null);
|
|
8874
8874
|
if (record && onRestore) {
|
|
8875
|
-
onRestore(
|
|
8875
|
+
onRestore(chunk5FIC2LG3_js.acceptAutosaveRecovery(record));
|
|
8876
8876
|
}
|
|
8877
8877
|
recordRef.current = null;
|
|
8878
8878
|
}, [onRestore]);
|
|
@@ -8881,7 +8881,7 @@ function useRecoveryDetection(input) {
|
|
|
8881
8881
|
setPrompt(null);
|
|
8882
8882
|
recordRef.current = null;
|
|
8883
8883
|
if (record) {
|
|
8884
|
-
void
|
|
8884
|
+
void chunk5FIC2LG3_js.discardAutosaveRecovery(record);
|
|
8885
8885
|
}
|
|
8886
8886
|
}, []);
|
|
8887
8887
|
return { prompt, restore, discard };
|
|
@@ -8925,11 +8925,11 @@ function usePresentationSetup(input) {
|
|
|
8925
8925
|
containerRef,
|
|
8926
8926
|
content,
|
|
8927
8927
|
onSetMode: (nextMode) => {
|
|
8928
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8928
|
+
if (mode === "present" && nextMode !== "present" && !chunk5FIC2LG3_js.mayLeaveSlideShow()) {
|
|
8929
8929
|
return;
|
|
8930
8930
|
}
|
|
8931
8931
|
if (mode === "present" && nextMode !== "present") {
|
|
8932
|
-
|
|
8932
|
+
chunk5FIC2LG3_js.stopAllPersistentAudio();
|
|
8933
8933
|
stopAnimationSound();
|
|
8934
8934
|
const exitHandler = exitModeHandlerRef.current;
|
|
8935
8935
|
if (exitHandler) {
|
|
@@ -8991,10 +8991,10 @@ function usePresentationSetup(input) {
|
|
|
8991
8991
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8992
8992
|
onToggleSubtitles,
|
|
8993
8993
|
onSaveRehearsalTimings: (timings) => {
|
|
8994
|
-
setSlides((prev) =>
|
|
8994
|
+
setSlides((prev) => chunk5FIC2LG3_js.applyRehearsalTimings(prev, timings));
|
|
8995
8995
|
history.markDirty();
|
|
8996
8996
|
},
|
|
8997
|
-
loopContinuously:
|
|
8997
|
+
loopContinuously: chunk5FIC2LG3_js.shouldLoopContinuously(presentationProperties),
|
|
8998
8998
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8999
8999
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
9000
9000
|
endWithBlackSlide,
|
|
@@ -9200,7 +9200,7 @@ function useEditorOperations(input) {
|
|
|
9200
9200
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9201
9201
|
react.useEffect(() => {
|
|
9202
9202
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9203
|
-
copiedFormatRef.current =
|
|
9203
|
+
copiedFormatRef.current = chunk5FIC2LG3_js.copyFormatFromElement(selectedElement);
|
|
9204
9204
|
} else if (!formatPainterActive) {
|
|
9205
9205
|
copiedFormatRef.current = null;
|
|
9206
9206
|
}
|
|
@@ -9226,12 +9226,12 @@ function useEditorOperations(input) {
|
|
|
9226
9226
|
e.stopPropagation();
|
|
9227
9227
|
const element = elementLookup.get(elementId);
|
|
9228
9228
|
if (element) {
|
|
9229
|
-
const updated =
|
|
9229
|
+
const updated = chunk5FIC2LG3_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9230
9230
|
const updates = {};
|
|
9231
|
-
if (
|
|
9231
|
+
if (chunk5FIC2LG3_js.hasShapeProperties(updated)) {
|
|
9232
9232
|
updates.shapeStyle = updated.shapeStyle;
|
|
9233
9233
|
}
|
|
9234
|
-
if (
|
|
9234
|
+
if (chunk5FIC2LG3_js.hasTextProperties(updated)) {
|
|
9235
9235
|
updates.textStyle = updated.textStyle;
|
|
9236
9236
|
}
|
|
9237
9237
|
ops.updateElementById(elementId, updates);
|
|
@@ -9419,10 +9419,10 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9419
9419
|
}
|
|
9420
9420
|
};
|
|
9421
9421
|
}, [embeddedFonts]);
|
|
9422
|
-
const referencedFamilies = react.useMemo(() =>
|
|
9422
|
+
const referencedFamilies = react.useMemo(() => chunk5FIC2LG3_js.collectReferencedFontFamilies(slides), [slides]);
|
|
9423
9423
|
react.useEffect(() => {
|
|
9424
9424
|
let cancelled = false;
|
|
9425
|
-
void
|
|
9425
|
+
void chunk5FIC2LG3_js.resolveGoogleWebfontHref(slides, embeddedFonts).then((href) => {
|
|
9426
9426
|
if (cancelled) {
|
|
9427
9427
|
return null;
|
|
9428
9428
|
}
|
|
@@ -9605,7 +9605,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9605
9605
|
inputRef.current = input;
|
|
9606
9606
|
const handleKeyDown = react.useCallback((e) => {
|
|
9607
9607
|
const current = inputRef.current;
|
|
9608
|
-
const startAction =
|
|
9608
|
+
const startAction = chunk5FIC2LG3_js.mapSlideShowStartKey(e, { isPresenting: current.mode === "present" });
|
|
9609
9609
|
if (startAction !== null) {
|
|
9610
9610
|
e.preventDefault();
|
|
9611
9611
|
if (startAction === "fromBeginning") {
|
|
@@ -9615,7 +9615,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9615
9615
|
}
|
|
9616
9616
|
return;
|
|
9617
9617
|
}
|
|
9618
|
-
const { action, dx, dy } =
|
|
9618
|
+
const { action, dx, dy } = chunk5FIC2LG3_js.mapEditorKey(e, {
|
|
9619
9619
|
canEdit: current.canEdit,
|
|
9620
9620
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9621
9621
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9628,7 +9628,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9628
9628
|
hasSelection: current.hasSelection,
|
|
9629
9629
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9630
9630
|
isDrawing: current.activeTool !== "select",
|
|
9631
|
-
isTextInputTarget:
|
|
9631
|
+
isTextInputTarget: chunk5FIC2LG3_js.isEditorTextInputTarget(e.target)
|
|
9632
9632
|
});
|
|
9633
9633
|
if (action === null) {
|
|
9634
9634
|
return;
|
|
@@ -9956,7 +9956,7 @@ function useViewerIntegration(input) {
|
|
|
9956
9956
|
return zoom.scale;
|
|
9957
9957
|
},
|
|
9958
9958
|
setZoom(level) {
|
|
9959
|
-
zoom.setScale(
|
|
9959
|
+
zoom.setScale(chunk5FIC2LG3_js.clampZoomScale(level));
|
|
9960
9960
|
},
|
|
9961
9961
|
zoomIn() {
|
|
9962
9962
|
zoom.handleZoomIn();
|
|
@@ -10174,7 +10174,7 @@ function useReducedMotion() {
|
|
|
10174
10174
|
}
|
|
10175
10175
|
function useViewerOptions() {
|
|
10176
10176
|
const storeRef = react.useRef(null);
|
|
10177
|
-
storeRef.current ??=
|
|
10177
|
+
storeRef.current ??= chunk5FIC2LG3_js.createViewerOptionsStore();
|
|
10178
10178
|
const store = storeRef.current;
|
|
10179
10179
|
const options = react.useSyncExternalStore(
|
|
10180
10180
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -10183,9 +10183,9 @@ function useViewerOptions() {
|
|
|
10183
10183
|
);
|
|
10184
10184
|
return { optionsStore: store, options };
|
|
10185
10185
|
}
|
|
10186
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10186
|
+
var KNOWN_TAB_IDS = new Set(chunk5FIC2LG3_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10187
10187
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
10188
|
-
const isHidden = (id) =>
|
|
10188
|
+
const isHidden = (id) => chunk5FIC2LG3_js.isActionHidden(id, hiddenActions);
|
|
10189
10189
|
const userHidden = new Set(hiddenTabIds);
|
|
10190
10190
|
userHidden.delete("file");
|
|
10191
10191
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
|
|
@@ -10277,12 +10277,12 @@ function useYjsDocumentSync({
|
|
|
10277
10277
|
return;
|
|
10278
10278
|
}
|
|
10279
10279
|
try {
|
|
10280
|
-
const handler = new
|
|
10280
|
+
const handler = new chunk5FIC2LG3_js.PptxHandler();
|
|
10281
10281
|
await handler.load(sourceBytes.buffer);
|
|
10282
|
-
const currentSlides =
|
|
10282
|
+
const currentSlides = chunk5FIC2LG3_js.readSlidesFromYDoc(
|
|
10283
10283
|
doc
|
|
10284
10284
|
);
|
|
10285
|
-
const slidesToSave =
|
|
10285
|
+
const slidesToSave = chunk5FIC2LG3_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10286
10286
|
const bytes = await handler.save(slidesToSave);
|
|
10287
10287
|
config.onWriteBack(bytes);
|
|
10288
10288
|
} catch {
|
|
@@ -10297,10 +10297,10 @@ function useYjsDocumentSync({
|
|
|
10297
10297
|
if (!doc || !isConnected) {
|
|
10298
10298
|
return;
|
|
10299
10299
|
}
|
|
10300
|
-
const docSlides =
|
|
10300
|
+
const docSlides = chunk5FIC2LG3_js.readSlidesFromYDoc(
|
|
10301
10301
|
doc
|
|
10302
10302
|
);
|
|
10303
|
-
if (!
|
|
10303
|
+
if (!chunk5FIC2LG3_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10304
10304
|
return;
|
|
10305
10305
|
}
|
|
10306
10306
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10319,11 +10319,11 @@ function useYjsDocumentSync({
|
|
|
10319
10319
|
lastSyncedRef.current = serialized;
|
|
10320
10320
|
void (async () => {
|
|
10321
10321
|
const factories = await getFactories();
|
|
10322
|
-
|
|
10322
|
+
chunk5FIC2LG3_js.reconcileSlidesInYDoc(
|
|
10323
10323
|
slides,
|
|
10324
10324
|
doc,
|
|
10325
10325
|
factories,
|
|
10326
|
-
|
|
10326
|
+
chunk5FIC2LG3_js.LOCAL_SYNC_ORIGIN
|
|
10327
10327
|
);
|
|
10328
10328
|
scheduleWriteBack();
|
|
10329
10329
|
})();
|
|
@@ -10337,10 +10337,10 @@ function useYjsDocumentSync({
|
|
|
10337
10337
|
return;
|
|
10338
10338
|
}
|
|
10339
10339
|
const handleChange = (_events, transaction) => {
|
|
10340
|
-
if (transaction?.origin ===
|
|
10340
|
+
if (transaction?.origin === chunk5FIC2LG3_js.LOCAL_SYNC_ORIGIN) {
|
|
10341
10341
|
return;
|
|
10342
10342
|
}
|
|
10343
|
-
const remoteSlides =
|
|
10343
|
+
const remoteSlides = chunk5FIC2LG3_js.readSlidesFromYDoc(
|
|
10344
10344
|
doc
|
|
10345
10345
|
);
|
|
10346
10346
|
if (remoteSlides.length === 0) {
|
|
@@ -10356,7 +10356,7 @@ function useYjsDocumentSync({
|
|
|
10356
10356
|
isApplyingRemoteRef.current = false;
|
|
10357
10357
|
scheduleWriteBack();
|
|
10358
10358
|
};
|
|
10359
|
-
const unobserve =
|
|
10359
|
+
const unobserve = chunk5FIC2LG3_js.observeYDocSlides(
|
|
10360
10360
|
doc,
|
|
10361
10361
|
handleChange
|
|
10362
10362
|
);
|
|
@@ -10394,7 +10394,7 @@ function useBroadcastFollower({
|
|
|
10394
10394
|
if (!broadcaster) {
|
|
10395
10395
|
return;
|
|
10396
10396
|
}
|
|
10397
|
-
if (!
|
|
10397
|
+
if (!chunk5FIC2LG3_js.shouldAutoFollowBroadcaster({
|
|
10398
10398
|
localRole: collab.config.role,
|
|
10399
10399
|
broadcasterRole: broadcaster.role
|
|
10400
10400
|
})) {
|
|
@@ -10565,7 +10565,7 @@ function subscribeTouchCapability(callback) {
|
|
|
10565
10565
|
function useIsMobile() {
|
|
10566
10566
|
const isTouchDevice = react.useSyncExternalStore(
|
|
10567
10567
|
subscribeTouchCapability,
|
|
10568
|
-
|
|
10568
|
+
chunk5FIC2LG3_js.detectTouchDevice,
|
|
10569
10569
|
() => false
|
|
10570
10570
|
// server snapshot
|
|
10571
10571
|
);
|
|
@@ -10575,7 +10575,7 @@ function useIsMobile() {
|
|
|
10575
10575
|
const [viewportHeight, setViewportHeight] = react.useState(
|
|
10576
10576
|
() => typeof window === "undefined" ? 768 : window.innerHeight
|
|
10577
10577
|
);
|
|
10578
|
-
const [orientation, setOrientation] = react.useState(
|
|
10578
|
+
const [orientation, setOrientation] = react.useState(chunk5FIC2LG3_js.detectOrientation);
|
|
10579
10579
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
10580
10580
|
const [initialViewportHeight] = react.useState(
|
|
10581
10581
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -10596,7 +10596,7 @@ function useIsMobile() {
|
|
|
10596
10596
|
return;
|
|
10597
10597
|
}
|
|
10598
10598
|
const handleOrientationChange = () => {
|
|
10599
|
-
setOrientation(
|
|
10599
|
+
setOrientation(chunk5FIC2LG3_js.detectOrientation());
|
|
10600
10600
|
};
|
|
10601
10601
|
if (screen.orientation) {
|
|
10602
10602
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -10626,7 +10626,7 @@ function useIsMobile() {
|
|
|
10626
10626
|
window.addEventListener("resize", handleResize);
|
|
10627
10627
|
return () => window.removeEventListener("resize", handleResize);
|
|
10628
10628
|
}, [isTouchDevice, initialViewportHeight]);
|
|
10629
|
-
const { isMobile, isTablet, isDesktop } =
|
|
10629
|
+
const { isMobile, isTablet, isDesktop } = chunk5FIC2LG3_js.deriveViewportBreakpoints(
|
|
10630
10630
|
viewportWidth,
|
|
10631
10631
|
viewportHeight,
|
|
10632
10632
|
isTouchDevice
|
|
@@ -10657,10 +10657,10 @@ function useTouchGestures(input) {
|
|
|
10657
10657
|
if (!el || !enabled) {
|
|
10658
10658
|
return;
|
|
10659
10659
|
}
|
|
10660
|
-
const recognizer =
|
|
10660
|
+
const recognizer = chunk5FIC2LG3_js.createTouchGestureRecognizer({
|
|
10661
10661
|
getScale: () => scaleRef.current,
|
|
10662
|
-
minScale:
|
|
10663
|
-
maxScale:
|
|
10662
|
+
minScale: chunk5FIC2LG3_js.MIN_ZOOM_SCALE,
|
|
10663
|
+
maxScale: chunk5FIC2LG3_js.MAX_ZOOM_SCALE,
|
|
10664
10664
|
callbacks: {
|
|
10665
10665
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10666
10666
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10700,7 +10700,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10700
10700
|
return;
|
|
10701
10701
|
}
|
|
10702
10702
|
const rect = active.getBoundingClientRect();
|
|
10703
|
-
const delta =
|
|
10703
|
+
const delta = chunk5FIC2LG3_js.computeScrollDelta(
|
|
10704
10704
|
{ top: rect.top, bottom: rect.bottom },
|
|
10705
10705
|
window.innerHeight,
|
|
10706
10706
|
keyboardInset
|
|
@@ -10720,8 +10720,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10720
10720
|
return;
|
|
10721
10721
|
}
|
|
10722
10722
|
const update = () => {
|
|
10723
|
-
const metrics =
|
|
10724
|
-
const inset = metrics ?
|
|
10723
|
+
const metrics = chunk5FIC2LG3_js.readViewportMetrics(window);
|
|
10724
|
+
const inset = metrics ? chunk5FIC2LG3_js.computeKeyboardInset(metrics) : 0;
|
|
10725
10725
|
setKeyboardInset(inset);
|
|
10726
10726
|
if (inset > 0) {
|
|
10727
10727
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10732,8 +10732,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10732
10732
|
vv.addEventListener("scroll", update);
|
|
10733
10733
|
const onFocusIn = () => {
|
|
10734
10734
|
window.requestAnimationFrame(() => {
|
|
10735
|
-
const metrics =
|
|
10736
|
-
const inset = metrics ?
|
|
10735
|
+
const metrics = chunk5FIC2LG3_js.readViewportMetrics(window);
|
|
10736
|
+
const inset = metrics ? chunk5FIC2LG3_js.computeKeyboardInset(metrics) : 0;
|
|
10737
10737
|
if (inset > 0) {
|
|
10738
10738
|
scrollFocusedIntoView(inset);
|
|
10739
10739
|
}
|
|
@@ -10746,7 +10746,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10746
10746
|
document.removeEventListener("focusin", onFocusIn);
|
|
10747
10747
|
};
|
|
10748
10748
|
}, [enabled]);
|
|
10749
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10749
|
+
return { keyboardInset, isKeyboardOpen: chunk5FIC2LG3_js.isKeyboardOpen(keyboardInset) };
|
|
10750
10750
|
}
|
|
10751
10751
|
|
|
10752
10752
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10775,21 +10775,21 @@ function buildCanvasProps(input) {
|
|
|
10775
10775
|
} = input;
|
|
10776
10776
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10777
10777
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10778
|
-
const fieldContext =
|
|
10778
|
+
const fieldContext = chunk5FIC2LG3_js.buildFieldSubstitutionContext({
|
|
10779
10779
|
headerFooter: s.headerFooter,
|
|
10780
10780
|
customProperties: s.customProperties,
|
|
10781
10781
|
slide: activeSlide
|
|
10782
10782
|
});
|
|
10783
10783
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10784
10784
|
const openExternalUrl = (url) => {
|
|
10785
|
-
if (
|
|
10785
|
+
if (chunk5FIC2LG3_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
10786
10786
|
return;
|
|
10787
10787
|
}
|
|
10788
|
-
|
|
10788
|
+
chunk5FIC2LG3_js.safeOpenUrl(url);
|
|
10789
10789
|
};
|
|
10790
10790
|
const handleActionClick = (elementId, action) => {
|
|
10791
10791
|
if (mode === "present") {
|
|
10792
|
-
const resolved =
|
|
10792
|
+
const resolved = chunk5FIC2LG3_js.resolvePresentationAction(action, { slideCount: slides.length });
|
|
10793
10793
|
if (resolved.intent.kind === "openUrl") {
|
|
10794
10794
|
openExternalUrl(resolved.intent.url);
|
|
10795
10795
|
return;
|
|
@@ -10800,9 +10800,9 @@ function buildCanvasProps(input) {
|
|
|
10800
10800
|
}
|
|
10801
10801
|
};
|
|
10802
10802
|
const handleHyperlinkClick = (url) => {
|
|
10803
|
-
if (
|
|
10803
|
+
if (chunk5FIC2LG3_js.isPpactionUrl(url)) {
|
|
10804
10804
|
if (mode === "present") {
|
|
10805
|
-
const parsed =
|
|
10805
|
+
const parsed = chunk5FIC2LG3_js.parsePpactionUrl(url);
|
|
10806
10806
|
if (parsed) {
|
|
10807
10807
|
presentation.handlePresentationAction({
|
|
10808
10808
|
action: parsed.action,
|
|
@@ -10908,7 +10908,7 @@ function buildCanvasProps(input) {
|
|
|
10908
10908
|
|
|
10909
10909
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10910
10910
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10911
|
-
return
|
|
10911
|
+
return chunk5FIC2LG3_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10912
10912
|
}
|
|
10913
10913
|
|
|
10914
10914
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10921,7 +10921,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10921
10921
|
const current = activeSlide.animations ?? [];
|
|
10922
10922
|
if (group === "motionPath") {
|
|
10923
10923
|
propertyHandlers.handleUpdateSlide({
|
|
10924
|
-
animations:
|
|
10924
|
+
animations: chunk5FIC2LG3_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10925
10925
|
});
|
|
10926
10926
|
return;
|
|
10927
10927
|
}
|
|
@@ -11116,7 +11116,7 @@ function buildToolbarProps(input) {
|
|
|
11116
11116
|
onOpenFile,
|
|
11117
11117
|
onOpenRecentFile,
|
|
11118
11118
|
onCreatePresentation: (templateId) => {
|
|
11119
|
-
s.setSlides(
|
|
11119
|
+
s.setSlides(chunk5FIC2LG3_js.createBackstagePresentation(templateId));
|
|
11120
11120
|
s.setActiveSlideIndex(0);
|
|
11121
11121
|
s.setSelectedElementId(null);
|
|
11122
11122
|
s.setSelectedElementIds([]);
|
|
@@ -11145,7 +11145,7 @@ function buildToolbarProps(input) {
|
|
|
11145
11145
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
11146
11146
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
11147
11147
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
11148
|
-
templateScheme:
|
|
11148
|
+
templateScheme: chunk5FIC2LG3_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
11149
11149
|
customShows: s.customShows,
|
|
11150
11150
|
activeCustomShowId: s.activeCustomShowId,
|
|
11151
11151
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -11186,7 +11186,7 @@ function buildToolbarProps(input) {
|
|
|
11186
11186
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
11187
11187
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
11188
11188
|
formatPainterActive: s.formatPainterActive,
|
|
11189
|
-
canActivateFormatPainter:
|
|
11189
|
+
canActivateFormatPainter: chunk5FIC2LG3_js.hasCopyableFormat(selectedElement),
|
|
11190
11190
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
11191
11191
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
11192
11192
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11251,6 +11251,10 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11251
11251
|
);
|
|
11252
11252
|
const zoom = useZoomViewport({ canvasSize, selectedElements: state.selectedElements });
|
|
11253
11253
|
const { options: viewerOptions } = useViewerOptions();
|
|
11254
|
+
const { setIsDirty } = state;
|
|
11255
|
+
const markDocumentDirty = react.useCallback(() => {
|
|
11256
|
+
setIsDirty(true);
|
|
11257
|
+
}, [setIsDirty]);
|
|
11254
11258
|
const history = useEditorHistory({
|
|
11255
11259
|
slides,
|
|
11256
11260
|
canvasSize,
|
|
@@ -11260,9 +11264,10 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11260
11264
|
headerFooter: state.headerFooter,
|
|
11261
11265
|
loading,
|
|
11262
11266
|
error,
|
|
11263
|
-
maxHistoryEntries:
|
|
11267
|
+
maxHistoryEntries: chunk5FIC2LG3_js.resolveHistoryDepth(viewerOptions),
|
|
11264
11268
|
hasActivePointerInteraction,
|
|
11265
11269
|
pointerCommitNonce: state.pointerCommitNonce,
|
|
11270
|
+
onDirty: markDocumentDirty,
|
|
11266
11271
|
setSlides: state.setSlides,
|
|
11267
11272
|
setCanvasSize: state.setCanvasSize,
|
|
11268
11273
|
setActiveSlideIndex: state.setActiveSlideIndex,
|
|
@@ -11327,7 +11332,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11327
11332
|
gridSpacingPx,
|
|
11328
11333
|
// Multiplied against the pre-existing 2x baseline; see the matching
|
|
11329
11334
|
// comment in `PowerPointViewer.tsx`.
|
|
11330
|
-
imageExportScale: 2 *
|
|
11335
|
+
imageExportScale: 2 * chunk5FIC2LG3_js.resolveImageResolutionScale(viewerOptions),
|
|
11331
11336
|
viewerOptions
|
|
11332
11337
|
};
|
|
11333
11338
|
}
|
|
@@ -11343,7 +11348,7 @@ function useCompatibilityToastsState() {
|
|
|
11343
11348
|
}
|
|
11344
11349
|
function useReadOnlyRecommendationState(content) {
|
|
11345
11350
|
const [recommendation, setRecommendation] = react.useState(
|
|
11346
|
-
() =>
|
|
11351
|
+
() => chunk5FIC2LG3_js.readOnlyRecommendation(void 0)
|
|
11347
11352
|
);
|
|
11348
11353
|
const [bannerHidden, setBannerHidden] = react.useState(false);
|
|
11349
11354
|
const [editAnywayActive, setEditAnywayActive] = react.useState(false);
|
|
@@ -11381,9 +11386,9 @@ function useViewPreferencesSync(input) {
|
|
|
11381
11386
|
setShowGuides
|
|
11382
11387
|
} = input;
|
|
11383
11388
|
react.useEffect(() => {
|
|
11384
|
-
const seeded =
|
|
11389
|
+
const seeded = chunk5FIC2LG3_js.viewerPreferencesFromViewProperties(
|
|
11385
11390
|
{ viewProperties },
|
|
11386
|
-
{ ...
|
|
11391
|
+
{ ...chunk5FIC2LG3_js.DEFAULT_VIEWER_PREFERENCES, snapToGrid, snapToObjects: snapToShape, showGuides }
|
|
11387
11392
|
);
|
|
11388
11393
|
setSnapToGrid(seeded.snapToGrid);
|
|
11389
11394
|
setSnapToShape(seeded.snapToObjects ?? snapToShape);
|
|
@@ -11393,7 +11398,7 @@ function useViewPreferencesSync(input) {
|
|
|
11393
11398
|
(prefsOverride) => {
|
|
11394
11399
|
setViewProperties((prev) => {
|
|
11395
11400
|
const merged = {
|
|
11396
|
-
...
|
|
11401
|
+
...chunk5FIC2LG3_js.DEFAULT_VIEWER_PREFERENCES,
|
|
11397
11402
|
snapToGrid,
|
|
11398
11403
|
snapToObjects: snapToShape,
|
|
11399
11404
|
showGuides,
|
|
@@ -11401,7 +11406,7 @@ function useViewPreferencesSync(input) {
|
|
|
11401
11406
|
gridSpacingCy: prev?.gridSpacing?.cy,
|
|
11402
11407
|
...prefsOverride
|
|
11403
11408
|
};
|
|
11404
|
-
const patch =
|
|
11409
|
+
const patch = chunk5FIC2LG3_js.viewPropertiesPatchFromPreferences(merged);
|
|
11405
11410
|
return {
|
|
11406
11411
|
...prev,
|
|
11407
11412
|
slideViewPr: { ...prev?.slideViewPr, ...patch.slideViewPr },
|
|
@@ -11619,7 +11624,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11619
11624
|
}, [incomingContent]);
|
|
11620
11625
|
const onOpenFile = react.useCallback(() => {
|
|
11621
11626
|
void (async () => {
|
|
11622
|
-
const picked = await
|
|
11627
|
+
const picked = await chunk5FIC2LG3_js.openPptxFile();
|
|
11623
11628
|
if (picked) {
|
|
11624
11629
|
setContent(picked.buffer);
|
|
11625
11630
|
}
|
|
@@ -11627,7 +11632,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11627
11632
|
}, []);
|
|
11628
11633
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11629
11634
|
void (async () => {
|
|
11630
|
-
const bytes = await
|
|
11635
|
+
const bytes = await chunk5FIC2LG3_js.readBackstageRecentFile(key);
|
|
11631
11636
|
if (bytes) {
|
|
11632
11637
|
setContent(bytes);
|
|
11633
11638
|
}
|