pptx-react-viewer 2.11.0 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/{AiChatPanel-EX2TBRJM.mjs → AiChatPanel-CS4CONUO.mjs} +4 -4
- package/dist/AiChatPanel-CS4CONUO.mjs.br +0 -0
- package/dist/AiChatPanel-CS4CONUO.mjs.gz +0 -0
- package/dist/{AiChatPanel-PJPSDMN4.js → AiChatPanel-JIXSOZXN.js} +23 -23
- package/dist/AiChatPanel-JIXSOZXN.js.br +0 -0
- package/dist/AiChatPanel-JIXSOZXN.js.gz +0 -0
- package/dist/{Model3DScene-UCBPTEAY.js → Model3DScene-5KMJ4JL6.js} +2 -2
- package/dist/Model3DScene-5KMJ4JL6.js.br +0 -0
- package/dist/Model3DScene-5KMJ4JL6.js.gz +0 -0
- package/dist/{Model3DScene-TTQFV7OS.mjs → Model3DScene-RWFPSN6B.mjs} +1 -1
- package/dist/Model3DScene-RWFPSN6B.mjs.br +0 -0
- package/dist/Model3DScene-RWFPSN6B.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-5SZCRHZI.mjs → SurfaceChart3DScene-2GZQM3LN.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-5SZCRHZI.mjs.br → SurfaceChart3DScene-2GZQM3LN.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-2GZQM3LN.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-ADKCYYOQ.js → SurfaceChart3DScene-BIOKIETC.js} +2 -2
- package/dist/SurfaceChart3DScene-BIOKIETC.js.br +0 -0
- package/dist/SurfaceChart3DScene-BIOKIETC.js.gz +0 -0
- package/dist/{chunk-MM5RMRSP.js → chunk-2VUHJNWM.js} +243 -284
- package/dist/chunk-2VUHJNWM.js.br +0 -0
- package/dist/chunk-2VUHJNWM.js.gz +0 -0
- package/dist/{chunk-N6IHR6PS.js → chunk-3GNSGGY2.js} +377 -2
- package/dist/chunk-3GNSGGY2.js.br +0 -0
- package/dist/chunk-3GNSGGY2.js.gz +0 -0
- package/dist/{chunk-HK2UERUX.mjs → chunk-AOED5MFM.mjs} +45 -64
- package/dist/chunk-AOED5MFM.mjs.br +0 -0
- package/dist/chunk-AOED5MFM.mjs.gz +0 -0
- package/dist/{chunk-L2CM5EUD.mjs → chunk-BJQSHVYH.mjs} +220 -156
- package/dist/chunk-BJQSHVYH.mjs.br +0 -0
- package/dist/chunk-BJQSHVYH.mjs.gz +0 -0
- package/dist/{chunk-RJEY2KZH.mjs → chunk-CEUHGUZ4.mjs} +5 -46
- package/dist/chunk-CEUHGUZ4.mjs.br +0 -0
- package/dist/chunk-CEUHGUZ4.mjs.gz +0 -0
- package/dist/{chunk-53NXKDMZ.mjs → chunk-ECDKYPQ2.mjs} +377 -2
- package/dist/chunk-ECDKYPQ2.mjs.br +0 -0
- package/dist/chunk-ECDKYPQ2.mjs.gz +0 -0
- package/dist/{chunk-UZVRM6LD.mjs → chunk-EJRHYYKE.mjs} +1 -1
- package/dist/chunk-EJRHYYKE.mjs.br +0 -0
- package/dist/chunk-EJRHYYKE.mjs.gz +0 -0
- package/dist/{chunk-HMQVOPQH.js → chunk-PJUQQF3I.js} +538 -42
- package/dist/chunk-PJUQQF3I.js.br +0 -0
- package/dist/chunk-PJUQQF3I.js.gz +0 -0
- package/dist/{chunk-4J7SPY64.js → chunk-PTGTFXPU.js} +366 -385
- package/dist/chunk-PTGTFXPU.js.br +0 -0
- package/dist/chunk-PTGTFXPU.js.gz +0 -0
- package/dist/{chunk-C2UWTH42.mjs → chunk-QGHC65C4.mjs} +518 -43
- package/dist/chunk-QGHC65C4.mjs.br +0 -0
- package/dist/chunk-QGHC65C4.mjs.gz +0 -0
- package/dist/{chunk-E367QIKR.js → chunk-SP7U34QM.js} +1186 -1122
- package/dist/chunk-SP7U34QM.js.br +0 -0
- package/dist/chunk-SP7U34QM.js.gz +0 -0
- package/dist/{chunk-VNP627O5.js → chunk-ZIXSSQAZ.js} +3 -3
- package/dist/chunk-ZIXSSQAZ.js.br +0 -0
- package/dist/chunk-ZIXSSQAZ.js.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +36 -36
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +12 -1
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{useViewerBuildingBlocks-Rqxm0pRS.d.ts → useViewerBuildingBlocks-YvCYsxa3.d.ts} +5 -1
- package/dist/useViewerBuildingBlocks-YvCYsxa3.d.ts.map +1 -0
- package/dist/viewer/index.js +22 -22
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-EX2TBRJM.mjs.br +0 -0
- package/dist/AiChatPanel-EX2TBRJM.mjs.gz +0 -0
- package/dist/AiChatPanel-PJPSDMN4.js.br +0 -0
- package/dist/AiChatPanel-PJPSDMN4.js.gz +0 -0
- package/dist/Model3DScene-TTQFV7OS.mjs.br +0 -0
- package/dist/Model3DScene-TTQFV7OS.mjs.gz +0 -0
- package/dist/Model3DScene-UCBPTEAY.js.br +0 -0
- package/dist/Model3DScene-UCBPTEAY.js.gz +0 -0
- package/dist/SurfaceChart3DScene-5SZCRHZI.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-ADKCYYOQ.js.br +0 -0
- package/dist/SurfaceChart3DScene-ADKCYYOQ.js.gz +0 -0
- package/dist/chunk-4J7SPY64.js.br +0 -0
- package/dist/chunk-4J7SPY64.js.gz +0 -0
- package/dist/chunk-53NXKDMZ.mjs.br +0 -0
- package/dist/chunk-53NXKDMZ.mjs.gz +0 -0
- package/dist/chunk-C2UWTH42.mjs.br +0 -0
- package/dist/chunk-C2UWTH42.mjs.gz +0 -0
- package/dist/chunk-E367QIKR.js.br +0 -0
- package/dist/chunk-E367QIKR.js.gz +0 -0
- package/dist/chunk-HK2UERUX.mjs.br +0 -0
- package/dist/chunk-HK2UERUX.mjs.gz +0 -0
- package/dist/chunk-HMQVOPQH.js.br +0 -0
- package/dist/chunk-HMQVOPQH.js.gz +0 -0
- package/dist/chunk-L2CM5EUD.mjs.br +0 -0
- package/dist/chunk-L2CM5EUD.mjs.gz +0 -0
- package/dist/chunk-MM5RMRSP.js.br +0 -0
- package/dist/chunk-MM5RMRSP.js.gz +0 -0
- package/dist/chunk-N6IHR6PS.js.br +0 -0
- package/dist/chunk-N6IHR6PS.js.gz +0 -0
- package/dist/chunk-RJEY2KZH.mjs.br +0 -0
- package/dist/chunk-RJEY2KZH.mjs.gz +0 -0
- package/dist/chunk-UZVRM6LD.mjs.br +0 -0
- package/dist/chunk-UZVRM6LD.mjs.gz +0 -0
- package/dist/chunk-VNP627O5.js.br +0 -0
- package/dist/chunk-VNP627O5.js.gz +0 -0
- package/dist/useViewerBuildingBlocks-Rqxm0pRS.d.ts.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunk2VUHJNWM_js = require('./chunk-2VUHJNWM.js');
|
|
4
|
+
var chunk3GNSGGY2_js = require('./chunk-3GNSGGY2.js');
|
|
5
|
+
var chunkPJUQQF3I_js = require('./chunk-PJUQQF3I.js');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var JSZip = require('jszip');
|
|
8
8
|
var reactI18next = require('react-i18next');
|
|
@@ -14,7 +14,7 @@ var JSZip__default = /*#__PURE__*/_interopDefault(JSZip);
|
|
|
14
14
|
function useVirtualizedSlides({
|
|
15
15
|
totalItems,
|
|
16
16
|
itemHeight,
|
|
17
|
-
overscan =
|
|
17
|
+
overscan = chunkPJUQQF3I_js.DEFAULT_VIRTUAL_OVERSCAN
|
|
18
18
|
}) {
|
|
19
19
|
const scrollContainerRef = react.useRef(null);
|
|
20
20
|
const [scrollTop, setScrollTop] = react.useState(0);
|
|
@@ -44,7 +44,7 @@ function useVirtualizedSlides({
|
|
|
44
44
|
resizeObserver?.disconnect();
|
|
45
45
|
};
|
|
46
46
|
}, []);
|
|
47
|
-
const range =
|
|
47
|
+
const range = chunkPJUQQF3I_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
|
|
48
48
|
const safeItemHeight = Math.max(itemHeight, 1);
|
|
49
49
|
const scrollToIndex = react.useCallback(
|
|
50
50
|
(index, behavior = "smooth") => {
|
|
@@ -107,7 +107,7 @@ function usePresenceTracking({
|
|
|
107
107
|
awareness.setLocalStateField("presence", state);
|
|
108
108
|
lastBroadcastRef.current = Date.now();
|
|
109
109
|
};
|
|
110
|
-
if (elapsed >=
|
|
110
|
+
if (elapsed >= chunkPJUQQF3I_js.BROADCAST_THROTTLE_MS) {
|
|
111
111
|
if (pendingBroadcastRef.current) {
|
|
112
112
|
clearTimeout(pendingBroadcastRef.current);
|
|
113
113
|
pendingBroadcastRef.current = null;
|
|
@@ -117,7 +117,7 @@ function usePresenceTracking({
|
|
|
117
117
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
118
118
|
pendingBroadcastRef.current = null;
|
|
119
119
|
flush();
|
|
120
|
-
},
|
|
120
|
+
}, chunkPJUQQF3I_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -142,7 +142,7 @@ function usePresenceTracking({
|
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
144
|
const handleChange = () => {
|
|
145
|
-
const users =
|
|
145
|
+
const users = chunkPJUQQF3I_js.derivePresenceList(
|
|
146
146
|
awareness.getStates(),
|
|
147
147
|
localClientId,
|
|
148
148
|
canvasWidth,
|
|
@@ -194,7 +194,7 @@ function useYjsProvider({ config }) {
|
|
|
194
194
|
const departureRef = react.useRef(null);
|
|
195
195
|
const gateRef = react.useRef(null);
|
|
196
196
|
if (!gateRef.current) {
|
|
197
|
-
gateRef.current =
|
|
197
|
+
gateRef.current = chunkPJUQQF3I_js.createSyncGate(() => setSynced(true));
|
|
198
198
|
}
|
|
199
199
|
const teardown = react.useCallback(() => {
|
|
200
200
|
if (timeoutRef.current) {
|
|
@@ -214,7 +214,7 @@ function useYjsProvider({ config }) {
|
|
|
214
214
|
const buildCleanup = react.useCallback(
|
|
215
215
|
(provider, yDoc) => () => {
|
|
216
216
|
announceDeparture();
|
|
217
|
-
|
|
217
|
+
chunkPJUQQF3I_js.clearLocalAwareness(provider.awareness);
|
|
218
218
|
provider.destroy();
|
|
219
219
|
yDoc.destroy();
|
|
220
220
|
setDoc(null);
|
|
@@ -239,9 +239,9 @@ function useYjsProvider({ config }) {
|
|
|
239
239
|
if (config.authToken) {
|
|
240
240
|
opts.password = config.authToken;
|
|
241
241
|
}
|
|
242
|
-
const roomId =
|
|
242
|
+
const roomId = chunkPJUQQF3I_js.validateRoomId(config.roomId);
|
|
243
243
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
244
|
-
departureRef.current =
|
|
244
|
+
departureRef.current = chunkPJUQQF3I_js.createDepartureChannel(roomId, provider.awareness);
|
|
245
245
|
setDoc(yDoc);
|
|
246
246
|
setAwareness(provider.awareness);
|
|
247
247
|
setClientId(provider.awareness.clientID);
|
|
@@ -283,13 +283,13 @@ function useYjsProvider({ config }) {
|
|
|
283
283
|
if (!config) {
|
|
284
284
|
return;
|
|
285
285
|
}
|
|
286
|
-
const roomId =
|
|
287
|
-
const transport = config.transport ??
|
|
286
|
+
const roomId = chunkPJUQQF3I_js.validateRoomId(config.roomId);
|
|
287
|
+
const transport = config.transport ?? chunkPJUQQF3I_js.resolveTransportForServerUrl(config.serverUrl);
|
|
288
288
|
if (transport === "webrtc") {
|
|
289
289
|
await initWebrtc();
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
if (
|
|
292
|
+
if (chunkPJUQQF3I_js.isMixedContentBlocked(config.serverUrl)) {
|
|
293
293
|
console.warn(
|
|
294
294
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
295
295
|
);
|
|
@@ -303,7 +303,7 @@ function useYjsProvider({ config }) {
|
|
|
303
303
|
const provider = new WebsocketProvider(config.serverUrl, roomId, yDoc, {
|
|
304
304
|
params: config.authToken ? { token: config.authToken } : void 0
|
|
305
305
|
});
|
|
306
|
-
departureRef.current =
|
|
306
|
+
departureRef.current = chunkPJUQQF3I_js.createDepartureChannel(roomId, provider.awareness);
|
|
307
307
|
let connected = false;
|
|
308
308
|
const handleStatus = (event) => {
|
|
309
309
|
if (event.status === "connected") {
|
|
@@ -343,7 +343,7 @@ function useYjsProvider({ config }) {
|
|
|
343
343
|
provider.off("status", handleStatus);
|
|
344
344
|
provider.off("sync", handleSynced);
|
|
345
345
|
announceDeparture();
|
|
346
|
-
|
|
346
|
+
chunkPJUQQF3I_js.clearLocalAwareness(provider.awareness);
|
|
347
347
|
provider.destroy();
|
|
348
348
|
yDoc.destroy();
|
|
349
349
|
setDoc(null);
|
|
@@ -352,7 +352,7 @@ function useYjsProvider({ config }) {
|
|
|
352
352
|
cleanupRef.current = null;
|
|
353
353
|
setStatus("error");
|
|
354
354
|
}
|
|
355
|
-
},
|
|
355
|
+
}, chunkPJUQQF3I_js.CONNECTION_TIMEOUT_MS);
|
|
356
356
|
}
|
|
357
357
|
setDoc(yDoc);
|
|
358
358
|
setAwareness(provider.awareness);
|
|
@@ -361,7 +361,7 @@ function useYjsProvider({ config }) {
|
|
|
361
361
|
provider.off("status", handleStatus);
|
|
362
362
|
provider.off("sync", handleSynced);
|
|
363
363
|
announceDeparture();
|
|
364
|
-
|
|
364
|
+
chunkPJUQQF3I_js.clearLocalAwareness(provider.awareness);
|
|
365
365
|
provider.destroy();
|
|
366
366
|
yDoc.destroy();
|
|
367
367
|
setDoc(null);
|
|
@@ -387,7 +387,7 @@ function useYjsProvider({ config }) {
|
|
|
387
387
|
]);
|
|
388
388
|
react.useEffect(() => {
|
|
389
389
|
init();
|
|
390
|
-
const disposeTeardown =
|
|
390
|
+
const disposeTeardown = chunkPJUQQF3I_js.registerCollaborationTeardown({
|
|
391
391
|
leave: teardown,
|
|
392
392
|
rejoin: init
|
|
393
393
|
});
|
|
@@ -408,7 +408,7 @@ function useCollaborativeState({
|
|
|
408
408
|
canvasWidth,
|
|
409
409
|
canvasHeight
|
|
410
410
|
}) {
|
|
411
|
-
const userColor =
|
|
411
|
+
const userColor = chunkPJUQQF3I_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
412
412
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
413
413
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
414
414
|
awareness,
|
|
@@ -517,8 +517,8 @@ function useEditorHistory(input) {
|
|
|
517
517
|
width: canvasSize.width,
|
|
518
518
|
height: canvasSize.height,
|
|
519
519
|
activeSlideIndex,
|
|
520
|
-
slides: slides.map(
|
|
521
|
-
templateElementsBySlideId:
|
|
520
|
+
slides: slides.map(chunkPJUQQF3I_js.cloneSlide),
|
|
521
|
+
templateElementsBySlideId: chunkPJUQQF3I_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
522
522
|
...actionLabel ? { actionLabel } : {}
|
|
523
523
|
};
|
|
524
524
|
},
|
|
@@ -531,9 +531,9 @@ function useEditorHistory(input) {
|
|
|
531
531
|
width: snapshot.width,
|
|
532
532
|
height: snapshot.height
|
|
533
533
|
});
|
|
534
|
-
setSlides(snapshot.slides.map(
|
|
534
|
+
setSlides(snapshot.slides.map(chunkPJUQQF3I_js.cloneSlide));
|
|
535
535
|
setTemplateElementsBySlideId(
|
|
536
|
-
|
|
536
|
+
chunkPJUQQF3I_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
537
537
|
);
|
|
538
538
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
539
539
|
setSelectedElementIds([]);
|
|
@@ -567,8 +567,8 @@ function useEditorHistory(input) {
|
|
|
567
567
|
const currentSnapshot = buildHistorySnapshot();
|
|
568
568
|
historyFutureRef.current.push(currentSnapshot);
|
|
569
569
|
isApplyingHistoryRef.current = true;
|
|
570
|
-
const nextSnapshot =
|
|
571
|
-
lastHistorySnapshotRef.current =
|
|
570
|
+
const nextSnapshot = chunk2VUHJNWM_js.cloneHistorySnapshot(previousSnapshot);
|
|
571
|
+
lastHistorySnapshotRef.current = chunk2VUHJNWM_js.cloneHistorySnapshot(nextSnapshot);
|
|
572
572
|
lastHistorySerializedRef.current = JSON.stringify(nextSnapshot);
|
|
573
573
|
applyHistorySnapshot(nextSnapshot);
|
|
574
574
|
updateHistoryAvailability();
|
|
@@ -589,8 +589,8 @@ function useEditorHistory(input) {
|
|
|
589
589
|
const currentSnapshot = buildHistorySnapshot();
|
|
590
590
|
historyPastRef.current.push(currentSnapshot);
|
|
591
591
|
isApplyingHistoryRef.current = true;
|
|
592
|
-
const targetSnapshot =
|
|
593
|
-
lastHistorySnapshotRef.current =
|
|
592
|
+
const targetSnapshot = chunk2VUHJNWM_js.cloneHistorySnapshot(nextSnapshot);
|
|
593
|
+
lastHistorySnapshotRef.current = chunk2VUHJNWM_js.cloneHistorySnapshot(targetSnapshot);
|
|
594
594
|
lastHistorySerializedRef.current = JSON.stringify(targetSnapshot);
|
|
595
595
|
applyHistorySnapshot(targetSnapshot);
|
|
596
596
|
updateHistoryAvailability();
|
|
@@ -608,7 +608,7 @@ function useEditorHistory(input) {
|
|
|
608
608
|
historyPastRef.current = [];
|
|
609
609
|
historyFutureRef.current = [];
|
|
610
610
|
if (initialSnapshot) {
|
|
611
|
-
const clonedInitial =
|
|
611
|
+
const clonedInitial = chunk2VUHJNWM_js.cloneHistorySnapshot(initialSnapshot);
|
|
612
612
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
613
613
|
lastHistorySerializedRef.current = JSON.stringify(clonedInitial);
|
|
614
614
|
} else {
|
|
@@ -649,18 +649,18 @@ function useEditorHistory(input) {
|
|
|
649
649
|
}
|
|
650
650
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
651
651
|
if (!previousSnapshot) {
|
|
652
|
-
lastHistorySnapshotRef.current =
|
|
652
|
+
lastHistorySnapshotRef.current = chunk2VUHJNWM_js.cloneHistorySnapshot(snapshot);
|
|
653
653
|
lastHistorySerializedRef.current = serialized;
|
|
654
654
|
lastCheapHashRef.current = cheapHash;
|
|
655
655
|
updateHistoryAvailability();
|
|
656
656
|
return;
|
|
657
657
|
}
|
|
658
|
-
historyPastRef.current.push(
|
|
658
|
+
historyPastRef.current.push(chunk2VUHJNWM_js.cloneHistorySnapshot(previousSnapshot));
|
|
659
659
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
660
660
|
historyPastRef.current.shift();
|
|
661
661
|
}
|
|
662
662
|
historyFutureRef.current = [];
|
|
663
|
-
lastHistorySnapshotRef.current =
|
|
663
|
+
lastHistorySnapshotRef.current = chunk2VUHJNWM_js.cloneHistorySnapshot(snapshot);
|
|
664
664
|
lastHistorySerializedRef.current = serialized;
|
|
665
665
|
lastCheapHashRef.current = cheapHash;
|
|
666
666
|
updateHistoryAvailability();
|
|
@@ -749,7 +749,7 @@ function useZoomViewport({
|
|
|
749
749
|
if (!wrapper || !canvasViewport) {
|
|
750
750
|
return;
|
|
751
751
|
}
|
|
752
|
-
const boundedScale =
|
|
752
|
+
const boundedScale = chunkPJUQQF3I_js.clampZoomScale(nextScale);
|
|
753
753
|
const nextEditorScale = fitScale * boundedScale;
|
|
754
754
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
755
755
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -764,10 +764,10 @@ function useZoomViewport({
|
|
|
764
764
|
[fitScale]
|
|
765
765
|
);
|
|
766
766
|
const handleZoomIn = react.useCallback(() => {
|
|
767
|
-
setScale((currentScale) =>
|
|
767
|
+
setScale((currentScale) => chunkPJUQQF3I_js.zoomInScale(currentScale));
|
|
768
768
|
}, []);
|
|
769
769
|
const handleZoomOut = react.useCallback(() => {
|
|
770
|
-
setScale((currentScale) =>
|
|
770
|
+
setScale((currentScale) => chunkPJUQQF3I_js.zoomOutScale(currentScale));
|
|
771
771
|
}, []);
|
|
772
772
|
const handleResetZoom = react.useCallback(() => {
|
|
773
773
|
setScale(1);
|
|
@@ -786,29 +786,29 @@ function useZoomViewport({
|
|
|
786
786
|
selectedElements.forEach((element) => {
|
|
787
787
|
minX = Math.min(minX, element.x);
|
|
788
788
|
minY = Math.min(minY, element.y);
|
|
789
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
790
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
789
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunk2VUHJNWM_js.MIN_ELEMENT_SIZE));
|
|
790
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunk2VUHJNWM_js.MIN_ELEMENT_SIZE));
|
|
791
791
|
});
|
|
792
792
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
793
793
|
return;
|
|
794
794
|
}
|
|
795
795
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
796
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
797
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
796
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunk2VUHJNWM_js.MIN_ELEMENT_SIZE);
|
|
797
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunk2VUHJNWM_js.MIN_ELEMENT_SIZE);
|
|
798
798
|
const availableWidth = Math.max(
|
|
799
|
-
effectiveEditorDimensions.width -
|
|
800
|
-
|
|
799
|
+
effectiveEditorDimensions.width - chunk2VUHJNWM_js.ZOOM_TO_SELECTION_PADDING,
|
|
800
|
+
chunk2VUHJNWM_js.MIN_ELEMENT_SIZE
|
|
801
801
|
);
|
|
802
802
|
const availableHeight = Math.max(
|
|
803
|
-
effectiveEditorDimensions.height -
|
|
804
|
-
|
|
803
|
+
effectiveEditorDimensions.height - chunk2VUHJNWM_js.ZOOM_TO_SELECTION_PADDING,
|
|
804
|
+
chunk2VUHJNWM_js.MIN_ELEMENT_SIZE
|
|
805
805
|
);
|
|
806
806
|
const targetEditorScale = Math.min(
|
|
807
807
|
availableWidth / boundsWidth,
|
|
808
808
|
availableHeight / boundsHeight
|
|
809
809
|
);
|
|
810
810
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
811
|
-
const nextScale =
|
|
811
|
+
const nextScale = chunkPJUQQF3I_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
812
812
|
setScale(nextScale);
|
|
813
813
|
window.requestAnimationFrame(() => {
|
|
814
814
|
window.requestAnimationFrame(() => {
|
|
@@ -828,7 +828,7 @@ function useZoomViewport({
|
|
|
828
828
|
}
|
|
829
829
|
event.preventDefault();
|
|
830
830
|
const delta = event.deltaY * -1e-3;
|
|
831
|
-
setScale((currentScale) =>
|
|
831
|
+
setScale((currentScale) => chunkPJUQQF3I_js.clampZoomScale(currentScale + delta));
|
|
832
832
|
}, []);
|
|
833
833
|
react.useEffect(() => {
|
|
834
834
|
const viewport = canvasViewportRef.current;
|
|
@@ -905,7 +905,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
905
905
|
const command = step.command;
|
|
906
906
|
const timer = window.setTimeout(
|
|
907
907
|
() => {
|
|
908
|
-
|
|
908
|
+
chunk2VUHJNWM_js.executeMediaCommand(command);
|
|
909
909
|
},
|
|
910
910
|
Math.max(0, step.delayMs)
|
|
911
911
|
);
|
|
@@ -1021,7 +1021,7 @@ function useAnimationPlayback(input) {
|
|
|
1021
1021
|
(controller, group) => {
|
|
1022
1022
|
driveBuildReveal(
|
|
1023
1023
|
controller,
|
|
1024
|
-
|
|
1024
|
+
chunkPJUQQF3I_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1025
1025
|
setPresentationElementStates,
|
|
1026
1026
|
buildRafRef
|
|
1027
1027
|
);
|
|
@@ -1084,7 +1084,7 @@ function useAnimationPlayback(input) {
|
|
|
1084
1084
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1085
1085
|
return;
|
|
1086
1086
|
}
|
|
1087
|
-
const controller =
|
|
1087
|
+
const controller = chunkPJUQQF3I_js.PresentationAnimationController.fromSlide(slide);
|
|
1088
1088
|
controllerRef.current = controller;
|
|
1089
1089
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1090
1090
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1232,7 +1232,7 @@ function useAnimationPlayback(input) {
|
|
|
1232
1232
|
}))
|
|
1233
1233
|
);
|
|
1234
1234
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1235
|
-
const delay =
|
|
1235
|
+
const delay = chunkPJUQQF3I_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1236
1236
|
const timer = window.setTimeout(() => {
|
|
1237
1237
|
setPresentationAnimations(
|
|
1238
1238
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1269,12 +1269,12 @@ function useAnimationPlayback(input) {
|
|
|
1269
1269
|
presentationTimersRef
|
|
1270
1270
|
};
|
|
1271
1271
|
}
|
|
1272
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1273
|
-
var AUDIENCE_HASH =
|
|
1274
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1275
|
-
var AUDIENCE_NONCE_KEY =
|
|
1272
|
+
var PRESENTER_CHANNEL_NAME = chunkPJUQQF3I_js.PRESENTATION_CHANNEL_NAME;
|
|
1273
|
+
var AUDIENCE_HASH = chunkPJUQQF3I_js.PRESENTATION_HASH;
|
|
1274
|
+
var PRESENTER_MSG_ORIGIN = chunkPJUQQF3I_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1275
|
+
var AUDIENCE_NONCE_KEY = chunkPJUQQF3I_js.PRESENTATION_NONCE_KEY;
|
|
1276
1276
|
function generateSessionId() {
|
|
1277
|
-
return
|
|
1277
|
+
return chunkPJUQQF3I_js.createPresentationSessionId();
|
|
1278
1278
|
}
|
|
1279
1279
|
function parseAudienceNonce() {
|
|
1280
1280
|
const hash = window.location.hash;
|
|
@@ -1310,7 +1310,7 @@ function usePresenterWindow(input) {
|
|
|
1310
1310
|
}, []);
|
|
1311
1311
|
const swapDisplays = react.useCallback(async () => {
|
|
1312
1312
|
const audience = audienceWindowRef.current;
|
|
1313
|
-
return audience && !audience.closed ?
|
|
1313
|
+
return audience && !audience.closed ? chunkPJUQQF3I_js.swapPresentationWindows(window, audience) : false;
|
|
1314
1314
|
}, []);
|
|
1315
1315
|
const syncSlideToAudience = react.useCallback(
|
|
1316
1316
|
(slideIndex) => {
|
|
@@ -1374,7 +1374,7 @@ function usePresenterWindow(input) {
|
|
|
1374
1374
|
pollTimerRef.current = null;
|
|
1375
1375
|
}
|
|
1376
1376
|
if (closingSessionId) {
|
|
1377
|
-
void
|
|
1377
|
+
void chunkPJUQQF3I_js.clearAudienceContent(closingSessionId);
|
|
1378
1378
|
}
|
|
1379
1379
|
}, [getChannel]);
|
|
1380
1380
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1392,10 +1392,10 @@ function usePresenterWindow(input) {
|
|
|
1392
1392
|
audienceWindowRef.current = blankWin;
|
|
1393
1393
|
const sessionId = generateSessionId();
|
|
1394
1394
|
sessionIdRef.current = sessionId;
|
|
1395
|
-
const audienceUrl =
|
|
1396
|
-
void
|
|
1395
|
+
const audienceUrl = chunkPJUQQF3I_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1396
|
+
void chunkPJUQQF3I_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1397
1397
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1398
|
-
|
|
1398
|
+
chunkPJUQQF3I_js.placeAudienceWindow(blankWin, placement);
|
|
1399
1399
|
}
|
|
1400
1400
|
return void 0;
|
|
1401
1401
|
});
|
|
@@ -1425,7 +1425,7 @@ function usePresenterWindow(input) {
|
|
|
1425
1425
|
}
|
|
1426
1426
|
};
|
|
1427
1427
|
if (content) {
|
|
1428
|
-
void
|
|
1428
|
+
void chunkPJUQQF3I_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1429
1429
|
} else {
|
|
1430
1430
|
navigateOrClose(true);
|
|
1431
1431
|
}
|
|
@@ -1451,7 +1451,7 @@ function usePresenterWindow(input) {
|
|
|
1451
1451
|
}
|
|
1452
1452
|
const handleMessage = (event) => {
|
|
1453
1453
|
const message = event.data;
|
|
1454
|
-
if (
|
|
1454
|
+
if (chunkPJUQQF3I_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1455
1455
|
syncStateToAudience(snapshotRef.current);
|
|
1456
1456
|
}
|
|
1457
1457
|
};
|
|
@@ -1480,7 +1480,7 @@ function usePresenterWindow(input) {
|
|
|
1480
1480
|
react.useEffect(() => {
|
|
1481
1481
|
const handleBeforeUnload = () => {
|
|
1482
1482
|
if (sessionIdRef.current) {
|
|
1483
|
-
void
|
|
1483
|
+
void chunkPJUQQF3I_js.clearAudienceContent(sessionIdRef.current);
|
|
1484
1484
|
}
|
|
1485
1485
|
};
|
|
1486
1486
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1542,7 +1542,7 @@ function useAudienceMode(input) {
|
|
|
1542
1542
|
}
|
|
1543
1543
|
channel.onmessage = (event) => {
|
|
1544
1544
|
const data = event.data;
|
|
1545
|
-
if (!
|
|
1545
|
+
if (!chunkPJUQQF3I_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1546
1546
|
return;
|
|
1547
1547
|
}
|
|
1548
1548
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1558,16 +1558,16 @@ function useAudienceMode(input) {
|
|
|
1558
1558
|
}
|
|
1559
1559
|
if (data.type === "presenter-exit") {
|
|
1560
1560
|
if (expectedSessionId) {
|
|
1561
|
-
void
|
|
1561
|
+
void chunkPJUQQF3I_js.clearAudienceContent(expectedSessionId);
|
|
1562
1562
|
}
|
|
1563
|
-
if (
|
|
1563
|
+
if (chunkPJUQQF3I_js.endAudienceDisplay(window)) {
|
|
1564
1564
|
handlers.onPresenterEnded?.();
|
|
1565
1565
|
}
|
|
1566
1566
|
}
|
|
1567
1567
|
};
|
|
1568
1568
|
if (expectedSessionId) {
|
|
1569
1569
|
channel.postMessage({
|
|
1570
|
-
origin:
|
|
1570
|
+
origin: chunkPJUQQF3I_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1571
1571
|
type: "audience-ready",
|
|
1572
1572
|
sessionId: expectedSessionId
|
|
1573
1573
|
});
|
|
@@ -1586,6 +1586,7 @@ function usePresentationKeyboard(input) {
|
|
|
1586
1586
|
movePresentationSlide,
|
|
1587
1587
|
navigateToSlide,
|
|
1588
1588
|
slideCount,
|
|
1589
|
+
showSlideIndexes,
|
|
1589
1590
|
onSetMode,
|
|
1590
1591
|
onSetPointerTool,
|
|
1591
1592
|
onEraseAnnotations,
|
|
@@ -1599,14 +1600,14 @@ function usePresentationKeyboard(input) {
|
|
|
1599
1600
|
presentationSlideIndex,
|
|
1600
1601
|
setShowRehearsalSummary
|
|
1601
1602
|
} = input;
|
|
1602
|
-
const keyBufferRef = react.useRef(
|
|
1603
|
+
const keyBufferRef = react.useRef(chunkPJUQQF3I_js.createPresentationKeyBuffer());
|
|
1603
1604
|
react.useEffect(() => {
|
|
1604
|
-
if (mode !== "present" || !
|
|
1605
|
-
keyBufferRef.current =
|
|
1605
|
+
if (mode !== "present" || !chunkPJUQQF3I_js.acceptsPresentationInput()) {
|
|
1606
|
+
keyBufferRef.current = chunkPJUQQF3I_js.createPresentationKeyBuffer();
|
|
1606
1607
|
return;
|
|
1607
1608
|
}
|
|
1608
1609
|
const handleKeyDown = (event) => {
|
|
1609
|
-
const mapped =
|
|
1610
|
+
const mapped = chunkPJUQQF3I_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1610
1611
|
if (mapped.action === "none") {
|
|
1611
1612
|
return;
|
|
1612
1613
|
}
|
|
@@ -1625,12 +1626,16 @@ function usePresentationKeyboard(input) {
|
|
|
1625
1626
|
case "previous":
|
|
1626
1627
|
movePresentationSlide(-1);
|
|
1627
1628
|
return;
|
|
1628
|
-
case "first":
|
|
1629
|
-
|
|
1629
|
+
case "first": {
|
|
1630
|
+
const first = chunkPJUQQF3I_js.firstShowSlideIndex(showSlideIndexes);
|
|
1631
|
+
navigateToSlide(first ?? 0);
|
|
1630
1632
|
return;
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
+
}
|
|
1634
|
+
case "last": {
|
|
1635
|
+
const last = chunkPJUQQF3I_js.lastShowSlideIndex(showSlideIndexes);
|
|
1636
|
+
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1633
1637
|
return;
|
|
1638
|
+
}
|
|
1634
1639
|
case "goto": {
|
|
1635
1640
|
const index = mapped.slideNumber - 1;
|
|
1636
1641
|
if (index >= 0 && index < slideCount) {
|
|
@@ -1670,6 +1675,7 @@ function usePresentationKeyboard(input) {
|
|
|
1670
1675
|
movePresentationSlide,
|
|
1671
1676
|
navigateToSlide,
|
|
1672
1677
|
slideCount,
|
|
1678
|
+
showSlideIndexes,
|
|
1673
1679
|
onSetMode,
|
|
1674
1680
|
onSetPointerTool,
|
|
1675
1681
|
onEraseAnnotations,
|
|
@@ -1781,50 +1787,29 @@ function useRehearsalTimings(input) {
|
|
|
1781
1787
|
|
|
1782
1788
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1783
1789
|
function handlePresentationActionImpl(action, deps) {
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
deps.
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
if (actionStr.includes("hlinkshowjump")) {
|
|
1799
|
-
const lower = actionStr.toLowerCase();
|
|
1800
|
-
if (lower.includes("nextslide")) {
|
|
1801
|
-
deps.movePresentationSlide(1);
|
|
1802
|
-
} else if (lower.includes("previousslide")) {
|
|
1803
|
-
deps.movePresentationSlide(-1);
|
|
1804
|
-
} else if (lower.includes("firstslide")) {
|
|
1805
|
-
deps.navigateToSlide(0);
|
|
1806
|
-
} else if (lower.includes("lastslide")) {
|
|
1807
|
-
deps.navigateToSlide(deps.slidesLength - 1);
|
|
1808
|
-
} else if (lower.includes("endshow")) {
|
|
1809
|
-
deps.onSetMode("edit");
|
|
1810
|
-
}
|
|
1811
|
-
return;
|
|
1812
|
-
}
|
|
1813
|
-
if (actionStr.includes("hlinksldjump")) {
|
|
1814
|
-
return;
|
|
1815
|
-
}
|
|
1816
|
-
if (action.url && !actionStr.includes("hlinksldjump")) {
|
|
1817
|
-
if (chunkHMQVOPQH_js.isUrlSafe(action.url)) {
|
|
1818
|
-
window.open(action.url, "_blank", "noopener,noreferrer");
|
|
1790
|
+
chunkPJUQQF3I_js.runPresentationAction(
|
|
1791
|
+
action,
|
|
1792
|
+
{ slideCount: deps.slidesLength },
|
|
1793
|
+
{
|
|
1794
|
+
goToSlide: (slideIndex) => {
|
|
1795
|
+
deps.navigateToSlide(slideIndex);
|
|
1796
|
+
},
|
|
1797
|
+
move: (direction) => {
|
|
1798
|
+
deps.movePresentationSlide(direction);
|
|
1799
|
+
},
|
|
1800
|
+
endShow: () => {
|
|
1801
|
+
deps.onSetMode("edit");
|
|
1802
|
+
},
|
|
1803
|
+
playSound: deps.onPlayActionSound ? (soundPath) => deps.onPlayActionSound?.(soundPath) : void 0
|
|
1819
1804
|
}
|
|
1820
|
-
|
|
1805
|
+
);
|
|
1821
1806
|
}
|
|
1822
1807
|
|
|
1823
1808
|
// src/viewer/hooks/presentation-mode/slide-transition.ts
|
|
1824
1809
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1825
1810
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1826
1811
|
const transition = incomingSlide?.transition;
|
|
1827
|
-
const durationMs = deps.playTransition ?
|
|
1812
|
+
const durationMs = deps.playTransition ? chunkPJUQQF3I_js.resolveTransitionDurationMs(transition) : 0;
|
|
1828
1813
|
deps.clearPresentationTimers();
|
|
1829
1814
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1830
1815
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1883,7 +1868,7 @@ function useSlideNavigation(input) {
|
|
|
1883
1868
|
});
|
|
1884
1869
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1885
1870
|
(slideIndex) => {
|
|
1886
|
-
const delayMs =
|
|
1871
|
+
const delayMs = chunkPJUQQF3I_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1887
1872
|
if (delayMs === void 0) {
|
|
1888
1873
|
return;
|
|
1889
1874
|
}
|
|
@@ -1906,10 +1891,8 @@ function useSlideNavigation(input) {
|
|
|
1906
1891
|
if (availableSlideIndexes.length === 0) {
|
|
1907
1892
|
return;
|
|
1908
1893
|
}
|
|
1909
|
-
const
|
|
1910
|
-
|
|
1911
|
-
const nextPosition = normalizedCurrentPosition + direction;
|
|
1912
|
-
if (rehearsing && direction === 1 && nextPosition >= availableSlideIndexes.length) {
|
|
1894
|
+
const pastLastSlide = direction === 1 && !chunkPJUQQF3I_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1895
|
+
if (rehearsing && pastLastSlide) {
|
|
1913
1896
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1914
1897
|
try {
|
|
1915
1898
|
if (document.fullscreenElement) {
|
|
@@ -1922,17 +1905,13 @@ function useSlideNavigation(input) {
|
|
|
1922
1905
|
setShowRehearsalSummary(true);
|
|
1923
1906
|
return;
|
|
1924
1907
|
}
|
|
1925
|
-
if (!loopContinuously && !rehearsing &&
|
|
1908
|
+
if (!loopContinuously && !rehearsing && pastLastSlide && onAdvancePastLastSlide) {
|
|
1926
1909
|
onAdvancePastLastSlide();
|
|
1927
1910
|
return;
|
|
1928
1911
|
}
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
} else {
|
|
1933
|
-
resolvedPosition = Math.min(availableSlideIndexes.length - 1, Math.max(0, nextPosition));
|
|
1934
|
-
}
|
|
1935
|
-
const nextSlideIndex = availableSlideIndexes[resolvedPosition];
|
|
1912
|
+
const nextSlideIndex = direction === 1 ? chunkPJUQQF3I_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1913
|
+
loop: Boolean(loopContinuously) && !rehearsing
|
|
1914
|
+
}) : chunkPJUQQF3I_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
1936
1915
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
1937
1916
|
return;
|
|
1938
1917
|
}
|
|
@@ -2073,17 +2052,17 @@ function useZoomNavigation(input) {
|
|
|
2073
2052
|
};
|
|
2074
2053
|
}
|
|
2075
2054
|
function usePresenterConsole(slideIndex) {
|
|
2076
|
-
const timerRef = react.useRef(
|
|
2077
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2055
|
+
const timerRef = react.useRef(chunkPJUQQF3I_js.createPresenterTimer());
|
|
2056
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkPJUQQF3I_js.createInitialPresentationSnapshot(slideIndex));
|
|
2078
2057
|
const patch = react.useCallback((value) => {
|
|
2079
|
-
setSnapshot((current) =>
|
|
2058
|
+
setSnapshot((current) => chunkPJUQQF3I_js.mergePresentationSnapshot(current, value));
|
|
2080
2059
|
}, []);
|
|
2081
2060
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2082
2061
|
react.useEffect(() => {
|
|
2083
2062
|
const timer = window.setInterval(() => {
|
|
2084
2063
|
patch({
|
|
2085
2064
|
paused: timerRef.current.paused,
|
|
2086
|
-
elapsedMs:
|
|
2065
|
+
elapsedMs: chunkPJUQQF3I_js.presenterElapsed(timerRef.current)
|
|
2087
2066
|
});
|
|
2088
2067
|
}, 1e3);
|
|
2089
2068
|
return () => window.clearInterval(timer);
|
|
@@ -2093,19 +2072,19 @@ function usePresenterConsole(slideIndex) {
|
|
|
2093
2072
|
applyAudienceSnapshot: setSnapshot,
|
|
2094
2073
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2095
2074
|
toggleTimer: () => {
|
|
2096
|
-
timerRef.current =
|
|
2075
|
+
timerRef.current = chunkPJUQQF3I_js.togglePresenterTimer(timerRef.current);
|
|
2097
2076
|
patch({
|
|
2098
2077
|
paused: timerRef.current.paused,
|
|
2099
|
-
elapsedMs:
|
|
2078
|
+
elapsedMs: chunkPJUQQF3I_js.presenterElapsed(timerRef.current)
|
|
2100
2079
|
});
|
|
2101
2080
|
},
|
|
2102
2081
|
resetTimer: () => {
|
|
2103
|
-
timerRef.current =
|
|
2082
|
+
timerRef.current = chunkPJUQQF3I_js.resetPresenterTimer();
|
|
2104
2083
|
patch({ paused: false, elapsedMs: 0 });
|
|
2105
2084
|
},
|
|
2106
2085
|
stepZoom: (direction) => setSnapshot(
|
|
2107
|
-
(current) =>
|
|
2108
|
-
zoom:
|
|
2086
|
+
(current) => chunkPJUQQF3I_js.mergePresentationSnapshot(current, {
|
|
2087
|
+
zoom: chunkPJUQQF3I_js.stepPresenterZoom(
|
|
2109
2088
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2110
2089
|
direction
|
|
2111
2090
|
)
|
|
@@ -2226,7 +2205,7 @@ function usePresentationMode(input) {
|
|
|
2226
2205
|
});
|
|
2227
2206
|
const movePresentationSlide = react.useCallback(
|
|
2228
2207
|
(direction, trigger = "explicit") => {
|
|
2229
|
-
if (!
|
|
2208
|
+
if (!chunkPJUQQF3I_js.acceptsPresentationInput()) {
|
|
2230
2209
|
return;
|
|
2231
2210
|
}
|
|
2232
2211
|
if (endOfShowVisible) {
|
|
@@ -2331,6 +2310,7 @@ function usePresentationMode(input) {
|
|
|
2331
2310
|
movePresentationSlide,
|
|
2332
2311
|
navigateToSlide,
|
|
2333
2312
|
slideCount: slides.length,
|
|
2313
|
+
showSlideIndexes: visibleSlideIndexes,
|
|
2334
2314
|
onSetMode,
|
|
2335
2315
|
onSetPointerTool,
|
|
2336
2316
|
onEraseAnnotations,
|
|
@@ -2428,11 +2408,11 @@ function usePresentationMode(input) {
|
|
|
2428
2408
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2429
2409
|
return void 0;
|
|
2430
2410
|
}
|
|
2431
|
-
return
|
|
2411
|
+
return chunkPJUQQF3I_js.buildMorphTransitionPlan(
|
|
2432
2412
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2433
2413
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2434
2414
|
transitionOverlay.durationMs,
|
|
2435
|
-
|
|
2415
|
+
chunkPJUQQF3I_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2436
2416
|
);
|
|
2437
2417
|
}, [transitionOverlay, slides]);
|
|
2438
2418
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2738,7 +2718,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2738
2718
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2739
2719
|
slides.forEach((slide, slideIndex) => {
|
|
2740
2720
|
for (const element of slide.elements || []) {
|
|
2741
|
-
if (!
|
|
2721
|
+
if (!chunkPJUQQF3I_js.hasTextProperties(element)) {
|
|
2742
2722
|
continue;
|
|
2743
2723
|
}
|
|
2744
2724
|
const segments = element.textSegments ?? [];
|
|
@@ -2789,7 +2769,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2789
2769
|
continue;
|
|
2790
2770
|
}
|
|
2791
2771
|
const element = slide.elements[elIdx];
|
|
2792
|
-
if (!
|
|
2772
|
+
if (!chunkPJUQQF3I_js.hasTextProperties(element)) {
|
|
2793
2773
|
continue;
|
|
2794
2774
|
}
|
|
2795
2775
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3387,7 +3367,7 @@ function useViewerCoreState(_input) {
|
|
|
3387
3367
|
const shapeAdjustmentDragStateRef = react.useRef(null);
|
|
3388
3368
|
const marqueeStateRef = react.useRef(null);
|
|
3389
3369
|
const isDrawingRef = react.useRef(false);
|
|
3390
|
-
const livePatcher = react.useMemo(() =>
|
|
3370
|
+
const livePatcher = react.useMemo(() => chunkPJUQQF3I_js.createCollaborationLivePatcher(), []);
|
|
3391
3371
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3392
3372
|
const slidesRef = react.useRef([]);
|
|
3393
3373
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3396,8 +3376,8 @@ function useViewerCoreState(_input) {
|
|
|
3396
3376
|
const [slides, setSlides] = react.useState([]);
|
|
3397
3377
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3398
3378
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3399
|
-
width:
|
|
3400
|
-
height:
|
|
3379
|
+
width: chunk2VUHJNWM_js.DEFAULT_CANVAS_WIDTH,
|
|
3380
|
+
height: chunk2VUHJNWM_js.DEFAULT_CANVAS_HEIGHT
|
|
3401
3381
|
});
|
|
3402
3382
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
3403
3383
|
const [selectedElementId, setSelectedElementId] = react.useState(null);
|
|
@@ -3417,7 +3397,7 @@ function useViewerCoreState(_input) {
|
|
|
3417
3397
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3418
3398
|
inlineEditingTextRef.current = resolved;
|
|
3419
3399
|
setInlineEditingTextBase(value);
|
|
3420
|
-
|
|
3400
|
+
chunkPJUQQF3I_js.publishLiveInlineText(
|
|
3421
3401
|
livePatcher,
|
|
3422
3402
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3423
3403
|
inlineEditingElementIdRef.current,
|
|
@@ -3751,7 +3731,7 @@ function useLoadContent({
|
|
|
3751
3731
|
);
|
|
3752
3732
|
}
|
|
3753
3733
|
const previousHandler = handlerRef.current;
|
|
3754
|
-
const handler = new
|
|
3734
|
+
const handler = new chunkPJUQQF3I_js.PptxHandler();
|
|
3755
3735
|
const parsed = await handler.load(buffer);
|
|
3756
3736
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3757
3737
|
handler.dispose();
|
|
@@ -3763,7 +3743,7 @@ function useLoadContent({
|
|
|
3763
3743
|
handlerRef.current = null;
|
|
3764
3744
|
const mediaElements = [];
|
|
3765
3745
|
for (const slide of parsed.slides) {
|
|
3766
|
-
|
|
3746
|
+
chunkPJUQQF3I_js.collectMediaElements(slide.elements, mediaElements);
|
|
3767
3747
|
}
|
|
3768
3748
|
for (const url of mediaDataUrls.values()) {
|
|
3769
3749
|
if (url.startsWith("blob:")) {
|
|
@@ -3804,7 +3784,7 @@ function useLoadContent({
|
|
|
3804
3784
|
}
|
|
3805
3785
|
})
|
|
3806
3786
|
);
|
|
3807
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3787
|
+
const { paths: imagePaths, refs: imageRefs } = chunkPJUQQF3I_js.collectImagePaths(parsed.slides);
|
|
3808
3788
|
let nextSlides = parsed.slides;
|
|
3809
3789
|
if (imagePaths.size > 0) {
|
|
3810
3790
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3859,12 +3839,12 @@ function useLoadContent({
|
|
|
3859
3839
|
}
|
|
3860
3840
|
}
|
|
3861
3841
|
handlerRef.current = handler;
|
|
3862
|
-
const partition =
|
|
3842
|
+
const partition = chunk2VUHJNWM_js.partitionTemplateElements(nextSlides);
|
|
3863
3843
|
setSlides(partition.slides);
|
|
3864
3844
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3865
3845
|
setCanvasSize({
|
|
3866
|
-
width: parsed.width ??
|
|
3867
|
-
height: parsed.height ??
|
|
3846
|
+
width: parsed.width ?? chunk2VUHJNWM_js.DEFAULT_CANVAS_WIDTH,
|
|
3847
|
+
height: parsed.height ?? chunk2VUHJNWM_js.DEFAULT_CANVAS_HEIGHT
|
|
3868
3848
|
});
|
|
3869
3849
|
setHeaderFooter(parsed.headerFooter ?? {});
|
|
3870
3850
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
@@ -3893,7 +3873,7 @@ function useLoadContent({
|
|
|
3893
3873
|
setHasMacros(parsed.hasMacros === true);
|
|
3894
3874
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3895
3875
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3896
|
-
setGuides(
|
|
3876
|
+
setGuides(chunkPJUQQF3I_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3897
3877
|
setActiveSlideIndex(0);
|
|
3898
3878
|
clearSelection();
|
|
3899
3879
|
setIsDirty(false);
|
|
@@ -3901,7 +3881,7 @@ function useLoadContent({
|
|
|
3901
3881
|
onContentApplied?.();
|
|
3902
3882
|
} catch (err) {
|
|
3903
3883
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3904
|
-
if (err instanceof
|
|
3884
|
+
if (err instanceof chunkPJUQQF3I_js.EncryptedFileError) {
|
|
3905
3885
|
setIsEncrypted(true);
|
|
3906
3886
|
} else {
|
|
3907
3887
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3978,7 +3958,7 @@ function useAutosave(input) {
|
|
|
3978
3958
|
isSavingRef.current = false;
|
|
3979
3959
|
return;
|
|
3980
3960
|
}
|
|
3981
|
-
await
|
|
3961
|
+
await chunkPJUQQF3I_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
3982
3962
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
3983
3963
|
} catch (err) {
|
|
3984
3964
|
setAutosaveStatus({
|
|
@@ -4043,7 +4023,7 @@ function useElementOperations(input) {
|
|
|
4043
4023
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
4044
4024
|
const updateElementById = react.useCallback(
|
|
4045
4025
|
(elementId, updates) => {
|
|
4046
|
-
if (
|
|
4026
|
+
if (chunkPJUQQF3I_js.isTemplateElementId(elementId)) {
|
|
4047
4027
|
const slideId = activeSlide?.id;
|
|
4048
4028
|
if (slideId) {
|
|
4049
4029
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4083,7 +4063,7 @@ function useElementOperations(input) {
|
|
|
4083
4063
|
);
|
|
4084
4064
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4085
4065
|
(updates) => {
|
|
4086
|
-
if (!selectedElement || !
|
|
4066
|
+
if (!selectedElement || !chunkPJUQQF3I_js.hasShapeProperties(selectedElement)) {
|
|
4087
4067
|
return;
|
|
4088
4068
|
}
|
|
4089
4069
|
updateSelectedElement({
|
|
@@ -4094,17 +4074,17 @@ function useElementOperations(input) {
|
|
|
4094
4074
|
);
|
|
4095
4075
|
const updateSelectedTextStyle = react.useCallback(
|
|
4096
4076
|
(updates) => {
|
|
4097
|
-
if (!selectedElement || !
|
|
4077
|
+
if (!selectedElement || !chunkPJUQQF3I_js.hasTextProperties(selectedElement)) {
|
|
4098
4078
|
return;
|
|
4099
4079
|
}
|
|
4100
|
-
const inlineSel =
|
|
4080
|
+
const inlineSel = chunkPJUQQF3I_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4101
4081
|
if (inlineSel && selectedElement.textSegments) {
|
|
4102
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4082
|
+
const { newSegments: newSegments2, newSelection } = chunkPJUQQF3I_js.applyStyleToSelectedSegments(
|
|
4103
4083
|
selectedElement.textSegments,
|
|
4104
4084
|
inlineSel,
|
|
4105
4085
|
updates
|
|
4106
4086
|
);
|
|
4107
|
-
|
|
4087
|
+
chunkPJUQQF3I_js.setPendingSelectionRestore(newSelection);
|
|
4108
4088
|
updateSelectedElement({
|
|
4109
4089
|
textSegments: newSegments2
|
|
4110
4090
|
});
|
|
@@ -4124,12 +4104,12 @@ function useElementOperations(input) {
|
|
|
4124
4104
|
);
|
|
4125
4105
|
const updateSelectedTextCase = react.useCallback(
|
|
4126
4106
|
(mode) => {
|
|
4127
|
-
if (!selectedElement || !
|
|
4107
|
+
if (!selectedElement || !chunkPJUQQF3I_js.hasTextProperties(selectedElement)) {
|
|
4128
4108
|
return;
|
|
4129
4109
|
}
|
|
4130
|
-
const inlineSel =
|
|
4110
|
+
const inlineSel = chunkPJUQQF3I_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4131
4111
|
if (inlineSel && selectedElement.textSegments) {
|
|
4132
|
-
const newSegments =
|
|
4112
|
+
const newSegments = chunkPJUQQF3I_js.applyCaseTransformToSegments(
|
|
4133
4113
|
selectedElement.textSegments,
|
|
4134
4114
|
inlineSel,
|
|
4135
4115
|
mode
|
|
@@ -4139,14 +4119,14 @@ function useElementOperations(input) {
|
|
|
4139
4119
|
}
|
|
4140
4120
|
const updates = {};
|
|
4141
4121
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4142
|
-
updates.textSegments =
|
|
4122
|
+
updates.textSegments = chunkPJUQQF3I_js.applyCaseTransformToSegments(
|
|
4143
4123
|
selectedElement.textSegments,
|
|
4144
4124
|
null,
|
|
4145
4125
|
mode
|
|
4146
4126
|
);
|
|
4147
4127
|
}
|
|
4148
4128
|
if (typeof selectedElement.text === "string") {
|
|
4149
|
-
updates.text =
|
|
4129
|
+
updates.text = chunkPJUQQF3I_js.transformTextCase(selectedElement.text, mode);
|
|
4150
4130
|
}
|
|
4151
4131
|
updateSelectedElement(updates);
|
|
4152
4132
|
},
|
|
@@ -4201,7 +4181,7 @@ function useSectionOperations(input) {
|
|
|
4201
4181
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4202
4182
|
const addSection2 = react.useCallback(
|
|
4203
4183
|
(name, afterSlideIndex) => {
|
|
4204
|
-
const result =
|
|
4184
|
+
const result = chunkPJUQQF3I_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4205
4185
|
setSlides(result.slides);
|
|
4206
4186
|
setSections(result.sections);
|
|
4207
4187
|
markDirty();
|
|
@@ -4210,7 +4190,7 @@ function useSectionOperations(input) {
|
|
|
4210
4190
|
);
|
|
4211
4191
|
const renameSection2 = react.useCallback(
|
|
4212
4192
|
(sectionId, newName) => {
|
|
4213
|
-
const result =
|
|
4193
|
+
const result = chunkPJUQQF3I_js.renameSection(sections, slides, sectionId, newName);
|
|
4214
4194
|
setSections(result.sections);
|
|
4215
4195
|
setSlides(result.slides);
|
|
4216
4196
|
markDirty();
|
|
@@ -4219,7 +4199,7 @@ function useSectionOperations(input) {
|
|
|
4219
4199
|
);
|
|
4220
4200
|
const deleteSection2 = react.useCallback(
|
|
4221
4201
|
(sectionId) => {
|
|
4222
|
-
const result =
|
|
4202
|
+
const result = chunkPJUQQF3I_js.deleteSection(sections, slides, sectionId);
|
|
4223
4203
|
setSections(result.sections);
|
|
4224
4204
|
setSlides(result.slides);
|
|
4225
4205
|
markDirty();
|
|
@@ -4228,21 +4208,21 @@ function useSectionOperations(input) {
|
|
|
4228
4208
|
);
|
|
4229
4209
|
const moveSectionUp2 = react.useCallback(
|
|
4230
4210
|
(sectionId) => {
|
|
4231
|
-
setSections(
|
|
4211
|
+
setSections(chunkPJUQQF3I_js.moveSectionUp(sections, sectionId));
|
|
4232
4212
|
markDirty();
|
|
4233
4213
|
},
|
|
4234
4214
|
[sections, setSections, markDirty]
|
|
4235
4215
|
);
|
|
4236
4216
|
const moveSectionDown2 = react.useCallback(
|
|
4237
4217
|
(sectionId) => {
|
|
4238
|
-
setSections(
|
|
4218
|
+
setSections(chunkPJUQQF3I_js.moveSectionDown(sections, sectionId));
|
|
4239
4219
|
markDirty();
|
|
4240
4220
|
},
|
|
4241
4221
|
[sections, setSections, markDirty]
|
|
4242
4222
|
);
|
|
4243
4223
|
const moveSlidesToSection2 = react.useCallback(
|
|
4244
4224
|
(slideIndexes, targetSectionId) => {
|
|
4245
|
-
const result =
|
|
4225
|
+
const result = chunkPJUQQF3I_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4246
4226
|
setSlides(result.slides);
|
|
4247
4227
|
setSections(result.sections);
|
|
4248
4228
|
markDirty();
|
|
@@ -4261,19 +4241,19 @@ function useSectionOperations(input) {
|
|
|
4261
4241
|
|
|
4262
4242
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4263
4243
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4264
|
-
const resized =
|
|
4244
|
+
const resized = chunkPJUQQF3I_js.applyResize(
|
|
4265
4245
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4266
4246
|
handle,
|
|
4267
4247
|
dx,
|
|
4268
4248
|
dy,
|
|
4269
4249
|
1,
|
|
4270
|
-
{ minSize:
|
|
4250
|
+
{ minSize: chunk2VUHJNWM_js.MIN_ELEMENT_SIZE }
|
|
4271
4251
|
);
|
|
4272
4252
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4273
4253
|
if (!snapToGrid) {
|
|
4274
4254
|
return box;
|
|
4275
4255
|
}
|
|
4276
|
-
return
|
|
4256
|
+
return chunkPJUQQF3I_js.snapBoxToGrid(box, handle, gridSpacingPx, chunk2VUHJNWM_js.MIN_ELEMENT_SIZE);
|
|
4277
4257
|
}
|
|
4278
4258
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
4279
4259
|
const range = startWidth || 200;
|
|
@@ -4391,7 +4371,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4391
4371
|
width: el.width,
|
|
4392
4372
|
height: el.height
|
|
4393
4373
|
}));
|
|
4394
|
-
const snapResult =
|
|
4374
|
+
const snapResult = chunkPJUQQF3I_js.computeSnapToShape(
|
|
4395
4375
|
targetX,
|
|
4396
4376
|
targetY,
|
|
4397
4377
|
primaryEl.width,
|
|
@@ -4430,7 +4410,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4430
4410
|
if (live) {
|
|
4431
4411
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4432
4412
|
const start = drag.startPositionsById[id];
|
|
4433
|
-
|
|
4413
|
+
chunkPJUQQF3I_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4434
4414
|
x: start.x + appliedDx,
|
|
4435
4415
|
y: start.y + appliedDy
|
|
4436
4416
|
});
|
|
@@ -4464,15 +4444,15 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4464
4444
|
if (rs.domEl) {
|
|
4465
4445
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4466
4446
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4467
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4468
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4447
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunk2VUHJNWM_js.MIN_ELEMENT_SIZE)}px`;
|
|
4448
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunk2VUHJNWM_js.MIN_ELEMENT_SIZE)}px`;
|
|
4469
4449
|
}
|
|
4470
4450
|
if (live) {
|
|
4471
|
-
|
|
4451
|
+
chunkPJUQQF3I_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4472
4452
|
x: geo.x,
|
|
4473
4453
|
y: geo.y,
|
|
4474
|
-
width: Math.max(geo.width,
|
|
4475
|
-
height: Math.max(geo.height,
|
|
4454
|
+
width: Math.max(geo.width, chunk2VUHJNWM_js.MIN_ELEMENT_SIZE),
|
|
4455
|
+
height: Math.max(geo.height, chunk2VUHJNWM_js.MIN_ELEMENT_SIZE)
|
|
4476
4456
|
});
|
|
4477
4457
|
}
|
|
4478
4458
|
}
|
|
@@ -4552,13 +4532,13 @@ function processPointerUp(input) {
|
|
|
4552
4532
|
if (i !== activeSlideIndex) {
|
|
4553
4533
|
return s;
|
|
4554
4534
|
}
|
|
4555
|
-
const rerouted =
|
|
4535
|
+
const rerouted = chunkPJUQQF3I_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4556
4536
|
if (rerouted.length === 0) {
|
|
4557
4537
|
return s;
|
|
4558
4538
|
}
|
|
4559
4539
|
return {
|
|
4560
4540
|
...s,
|
|
4561
|
-
elements:
|
|
4541
|
+
elements: chunkPJUQQF3I_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4562
4542
|
};
|
|
4563
4543
|
})
|
|
4564
4544
|
);
|
|
@@ -4580,9 +4560,9 @@ function processPointerUp(input) {
|
|
|
4580
4560
|
}
|
|
4581
4561
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4582
4562
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4583
|
-
const hitIds =
|
|
4563
|
+
const hitIds = chunkPJUQQF3I_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4584
4564
|
if (marquee.additive) {
|
|
4585
|
-
const merged =
|
|
4565
|
+
const merged = chunkPJUQQF3I_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4586
4566
|
if (merged.length > 0) {
|
|
4587
4567
|
applySelection(merged[0], merged);
|
|
4588
4568
|
} else {
|
|
@@ -4605,8 +4585,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4605
4585
|
}
|
|
4606
4586
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4607
4587
|
});
|
|
4608
|
-
const rerouted =
|
|
4609
|
-
return
|
|
4588
|
+
const rerouted = chunkPJUQQF3I_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4589
|
+
return chunkPJUQQF3I_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4610
4590
|
};
|
|
4611
4591
|
if (editTemplateMode) {
|
|
4612
4592
|
const slideId = activeSlide?.id;
|
|
@@ -4762,9 +4742,9 @@ function useCanvasInteractions(input) {
|
|
|
4762
4742
|
return;
|
|
4763
4743
|
}
|
|
4764
4744
|
const el = elementLookup.get(editId);
|
|
4765
|
-
if (el &&
|
|
4745
|
+
if (el && chunkPJUQQF3I_js.hasTextProperties(el)) {
|
|
4766
4746
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4767
|
-
const newSegments =
|
|
4747
|
+
const newSegments = chunkPJUQQF3I_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4768
4748
|
ops.updateElementById(editId, {
|
|
4769
4749
|
text: committedText,
|
|
4770
4750
|
textSegments: newSegments
|
|
@@ -4775,7 +4755,7 @@ function useCanvasInteractions(input) {
|
|
|
4775
4755
|
setInlineEditingText("");
|
|
4776
4756
|
};
|
|
4777
4757
|
const openEquationEditorForElement = (el) => {
|
|
4778
|
-
if (!
|
|
4758
|
+
if (!chunkPJUQQF3I_js.hasTextProperties(el)) {
|
|
4779
4759
|
return false;
|
|
4780
4760
|
}
|
|
4781
4761
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4804,7 +4784,7 @@ function useCanvasInteractions(input) {
|
|
|
4804
4784
|
justSelectedRef.current = false;
|
|
4805
4785
|
} else {
|
|
4806
4786
|
const el = elementLookup.get(elementId);
|
|
4807
|
-
if (el &&
|
|
4787
|
+
if (el && chunkPJUQQF3I_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
4808
4788
|
if (!openEquationEditorForElement(el)) {
|
|
4809
4789
|
setInlineEditingElementId(elementId);
|
|
4810
4790
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4823,7 +4803,7 @@ function useCanvasInteractions(input) {
|
|
|
4823
4803
|
if (openEquationEditorForElement(el)) {
|
|
4824
4804
|
return;
|
|
4825
4805
|
}
|
|
4826
|
-
if (
|
|
4806
|
+
if (chunkPJUQQF3I_js.hasTextProperties(el)) {
|
|
4827
4807
|
setInlineEditingElementId(elementId);
|
|
4828
4808
|
setInlineEditingText(el.text ?? "");
|
|
4829
4809
|
}
|
|
@@ -5016,7 +4996,7 @@ function createFileHandlers(deps) {
|
|
|
5016
4996
|
h = Math.round(h * scale);
|
|
5017
4997
|
}
|
|
5018
4998
|
addElement({
|
|
5019
|
-
id:
|
|
4999
|
+
id: chunkPJUQQF3I_js.generateElementId(),
|
|
5020
5000
|
type: "image",
|
|
5021
5001
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5022
5002
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5027,7 +5007,7 @@ function createFileHandlers(deps) {
|
|
|
5027
5007
|
};
|
|
5028
5008
|
img.onerror = () => {
|
|
5029
5009
|
addElement({
|
|
5030
|
-
id:
|
|
5010
|
+
id: chunkPJUQQF3I_js.generateElementId(),
|
|
5031
5011
|
type: "image",
|
|
5032
5012
|
x: 100,
|
|
5033
5013
|
y: 100,
|
|
@@ -5053,7 +5033,7 @@ function createFileHandlers(deps) {
|
|
|
5053
5033
|
const elFilePath = file.path;
|
|
5054
5034
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5055
5035
|
addElement({
|
|
5056
|
-
id:
|
|
5036
|
+
id: chunkPJUQQF3I_js.generateElementId(),
|
|
5057
5037
|
type: "media",
|
|
5058
5038
|
mediaType,
|
|
5059
5039
|
mediaMimeType: file.type || void 0,
|
|
@@ -5228,13 +5208,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5228
5208
|
return;
|
|
5229
5209
|
}
|
|
5230
5210
|
addElement({
|
|
5231
|
-
id:
|
|
5211
|
+
id: chunkPJUQQF3I_js.generateElementId(),
|
|
5232
5212
|
type: "smartArt",
|
|
5233
5213
|
x: 100,
|
|
5234
5214
|
y: 120,
|
|
5235
5215
|
width: 600,
|
|
5236
5216
|
height: 340,
|
|
5237
|
-
smartArtData:
|
|
5217
|
+
smartArtData: chunkPJUQQF3I_js.buildSmartArtPresetData(
|
|
5238
5218
|
layout,
|
|
5239
5219
|
defaultItems,
|
|
5240
5220
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5246,7 +5226,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5246
5226
|
return;
|
|
5247
5227
|
}
|
|
5248
5228
|
addElement({
|
|
5249
|
-
id:
|
|
5229
|
+
id: chunkPJUQQF3I_js.generateElementId(),
|
|
5250
5230
|
type: "shape",
|
|
5251
5231
|
x: 120,
|
|
5252
5232
|
y: 200,
|
|
@@ -5305,7 +5285,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5305
5285
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5306
5286
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5307
5287
|
addElement({
|
|
5308
|
-
id:
|
|
5288
|
+
id: chunkPJUQQF3I_js.generateElementId(),
|
|
5309
5289
|
type: "shape",
|
|
5310
5290
|
x: 120,
|
|
5311
5291
|
y: 200,
|
|
@@ -5327,11 +5307,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5327
5307
|
if (!activeSlide) {
|
|
5328
5308
|
return;
|
|
5329
5309
|
}
|
|
5330
|
-
const preset =
|
|
5310
|
+
const preset = chunkPJUQQF3I_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5331
5311
|
if (!preset) {
|
|
5332
5312
|
return;
|
|
5333
5313
|
}
|
|
5334
|
-
const defaultPptxAction =
|
|
5314
|
+
const defaultPptxAction = chunkPJUQQF3I_js.elementActionToPptxAction({
|
|
5335
5315
|
trigger: "click",
|
|
5336
5316
|
type: preset.defaultAction
|
|
5337
5317
|
});
|
|
@@ -5340,7 +5320,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5340
5320
|
defaultPptxAction.highlightClick = true;
|
|
5341
5321
|
}
|
|
5342
5322
|
addElement({
|
|
5343
|
-
id:
|
|
5323
|
+
id: chunkPJUQQF3I_js.generateElementId(),
|
|
5344
5324
|
type: "shape",
|
|
5345
5325
|
x: 150,
|
|
5346
5326
|
y: 150,
|
|
@@ -5407,14 +5387,14 @@ function useInsertElements(input) {
|
|
|
5407
5387
|
return;
|
|
5408
5388
|
}
|
|
5409
5389
|
addElement({
|
|
5410
|
-
id:
|
|
5390
|
+
id: chunkPJUQQF3I_js.generateElementId(),
|
|
5411
5391
|
type: "text",
|
|
5412
5392
|
x: 100,
|
|
5413
5393
|
y: 100,
|
|
5414
5394
|
width: 300,
|
|
5415
5395
|
height: 60,
|
|
5416
5396
|
text: "",
|
|
5417
|
-
textStyle: { fontSize:
|
|
5397
|
+
textStyle: { fontSize: chunk2VUHJNWM_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5418
5398
|
});
|
|
5419
5399
|
};
|
|
5420
5400
|
const handleAddShape = () => {
|
|
@@ -5422,7 +5402,7 @@ function useInsertElements(input) {
|
|
|
5422
5402
|
return;
|
|
5423
5403
|
}
|
|
5424
5404
|
addElement({
|
|
5425
|
-
id:
|
|
5405
|
+
id: chunkPJUQQF3I_js.generateElementId(),
|
|
5426
5406
|
type: "shape",
|
|
5427
5407
|
x: 150,
|
|
5428
5408
|
y: 150,
|
|
@@ -5441,15 +5421,15 @@ function useInsertElements(input) {
|
|
|
5441
5421
|
return;
|
|
5442
5422
|
}
|
|
5443
5423
|
addElement({
|
|
5444
|
-
...
|
|
5445
|
-
id:
|
|
5424
|
+
...chunkPJUQQF3I_js.newTableElement(chunk2VUHJNWM_js.DEFAULT_TABLE_ROWS, chunk2VUHJNWM_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5425
|
+
id: chunkPJUQQF3I_js.generateElementId()
|
|
5446
5426
|
});
|
|
5447
5427
|
};
|
|
5448
5428
|
const handleAddChart = (chartType) => {
|
|
5449
5429
|
if (!activeSlide) {
|
|
5450
5430
|
return;
|
|
5451
5431
|
}
|
|
5452
|
-
addElement(
|
|
5432
|
+
addElement(chunkPJUQQF3I_js.createDefaultChartElement(chartType));
|
|
5453
5433
|
};
|
|
5454
5434
|
const structured = createStructuredElementHandlers({
|
|
5455
5435
|
activeSlide,
|
|
@@ -5519,7 +5499,7 @@ function useClipboardHandlers(input) {
|
|
|
5519
5499
|
if (!selectedElement) {
|
|
5520
5500
|
return;
|
|
5521
5501
|
}
|
|
5522
|
-
setClipboardPayload(
|
|
5502
|
+
setClipboardPayload(chunkPJUQQF3I_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5523
5503
|
};
|
|
5524
5504
|
const handleDelete = () => {
|
|
5525
5505
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5536,7 +5516,7 @@ function useClipboardHandlers(input) {
|
|
|
5536
5516
|
handleDelete();
|
|
5537
5517
|
};
|
|
5538
5518
|
const insertClone = (source) => {
|
|
5539
|
-
const clone =
|
|
5519
|
+
const clone = chunkPJUQQF3I_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5540
5520
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5541
5521
|
ops.applySelection(clone.id);
|
|
5542
5522
|
history.markDirty();
|
|
@@ -5571,7 +5551,7 @@ function resolveShapePath(el) {
|
|
|
5571
5551
|
return el.pathData;
|
|
5572
5552
|
}
|
|
5573
5553
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5574
|
-
const clipPath =
|
|
5554
|
+
const clipPath = chunkPJUQQF3I_js.getPresetShapeClipPath(el.shapeType);
|
|
5575
5555
|
if (clipPath) {
|
|
5576
5556
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5577
5557
|
if (svgPath) {
|
|
@@ -5622,7 +5602,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5622
5602
|
return parts.join(" ");
|
|
5623
5603
|
}
|
|
5624
5604
|
function transformPathToGlobal(pathData, el) {
|
|
5625
|
-
const polys =
|
|
5605
|
+
const polys = chunkPJUQQF3I_js.svgPathToPolygons(pathData);
|
|
5626
5606
|
if (polys.length === 0) {
|
|
5627
5607
|
return pathData;
|
|
5628
5608
|
}
|
|
@@ -5642,10 +5622,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5642
5622
|
y: pt.y * scaleY + el.y
|
|
5643
5623
|
}))
|
|
5644
5624
|
);
|
|
5645
|
-
return
|
|
5625
|
+
return chunkPJUQQF3I_js.polygonsToSvgPath(transformed);
|
|
5646
5626
|
}
|
|
5647
5627
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5648
|
-
const polys =
|
|
5628
|
+
const polys = chunkPJUQQF3I_js.svgPathToPolygons(pathData);
|
|
5649
5629
|
if (polys.length === 0) {
|
|
5650
5630
|
return pathData;
|
|
5651
5631
|
}
|
|
@@ -5655,10 +5635,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5655
5635
|
y: pt.y - y
|
|
5656
5636
|
}))
|
|
5657
5637
|
);
|
|
5658
|
-
return
|
|
5638
|
+
return chunkPJUQQF3I_js.polygonsToSvgPath(transformed);
|
|
5659
5639
|
}
|
|
5660
5640
|
function pathBounds(pathData) {
|
|
5661
|
-
const polys =
|
|
5641
|
+
const polys = chunkPJUQQF3I_js.svgPathToPolygons(pathData);
|
|
5662
5642
|
let minX = Infinity;
|
|
5663
5643
|
let minY = Infinity;
|
|
5664
5644
|
let maxX = -Infinity;
|
|
@@ -5717,7 +5697,7 @@ function useMergeShapesHandler(input) {
|
|
|
5717
5697
|
let allFragments = [];
|
|
5718
5698
|
let remaining = globalPaths[0];
|
|
5719
5699
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5720
|
-
const frags =
|
|
5700
|
+
const frags = chunkPJUQQF3I_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5721
5701
|
if (Array.isArray(frags)) {
|
|
5722
5702
|
allFragments = frags;
|
|
5723
5703
|
}
|
|
@@ -5746,7 +5726,7 @@ function useMergeShapesHandler(input) {
|
|
|
5746
5726
|
bounds.height
|
|
5747
5727
|
);
|
|
5748
5728
|
const newEl = {
|
|
5749
|
-
id:
|
|
5729
|
+
id: chunkPJUQQF3I_js.generateElementId(),
|
|
5750
5730
|
type: "shape",
|
|
5751
5731
|
x: bounds.x,
|
|
5752
5732
|
y: bounds.y,
|
|
@@ -5784,7 +5764,7 @@ function useMergeShapesHandler(input) {
|
|
|
5784
5764
|
} else {
|
|
5785
5765
|
let resultPath = globalPaths[0];
|
|
5786
5766
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5787
|
-
const result =
|
|
5767
|
+
const result = chunkPJUQQF3I_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5788
5768
|
if (typeof result === "string") {
|
|
5789
5769
|
resultPath = result;
|
|
5790
5770
|
}
|
|
@@ -5805,7 +5785,7 @@ function useMergeShapesHandler(input) {
|
|
|
5805
5785
|
);
|
|
5806
5786
|
const primary = targets[0];
|
|
5807
5787
|
const newEl = {
|
|
5808
|
-
id:
|
|
5788
|
+
id: chunkPJUQQF3I_js.generateElementId(),
|
|
5809
5789
|
type: "shape",
|
|
5810
5790
|
x: bounds.x,
|
|
5811
5791
|
y: bounds.y,
|
|
@@ -5868,7 +5848,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5868
5848
|
if (ids.length < 2 || !activeSlide) {
|
|
5869
5849
|
return;
|
|
5870
5850
|
}
|
|
5871
|
-
const { elements, groupId } =
|
|
5851
|
+
const { elements, groupId } = chunkPJUQQF3I_js.groupElements(ops.activeElements, ids, chunkPJUQQF3I_js.generateElementId());
|
|
5872
5852
|
if (groupId === null) {
|
|
5873
5853
|
return;
|
|
5874
5854
|
}
|
|
@@ -5881,12 +5861,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5881
5861
|
return;
|
|
5882
5862
|
}
|
|
5883
5863
|
const group = selectedElement;
|
|
5884
|
-
const intoTemplate =
|
|
5864
|
+
const intoTemplate = chunkPJUQQF3I_js.isTemplateElementId(group.id);
|
|
5885
5865
|
const ungrouped = group.children.map((child) => ({
|
|
5886
5866
|
...structuredClone(child),
|
|
5887
5867
|
// Keep child ids in the same store as the group so later edits route
|
|
5888
5868
|
// correctly: template groups yield template-prefixed child ids.
|
|
5889
|
-
id: intoTemplate ?
|
|
5869
|
+
id: intoTemplate ? chunkPJUQQF3I_js.makeCloneId(true, child.id || group.id) : child.id || chunkPJUQQF3I_js.generateElementId(),
|
|
5890
5870
|
x: child.x + group.x,
|
|
5891
5871
|
y: child.y + group.y
|
|
5892
5872
|
}));
|
|
@@ -5910,7 +5890,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5910
5890
|
if (!edge) {
|
|
5911
5891
|
return;
|
|
5912
5892
|
}
|
|
5913
|
-
const positions =
|
|
5893
|
+
const positions = chunkPJUQQF3I_js.alignElements(selectedElements, edge);
|
|
5914
5894
|
for (const [id, pos] of positions) {
|
|
5915
5895
|
const el = elementLookup.get(id);
|
|
5916
5896
|
if (!el) {
|
|
@@ -5928,7 +5908,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5928
5908
|
if (!distAxis) {
|
|
5929
5909
|
return;
|
|
5930
5910
|
}
|
|
5931
|
-
const positions =
|
|
5911
|
+
const positions = chunkPJUQQF3I_js.distributeElements(selectedElements, distAxis);
|
|
5932
5912
|
for (const [id, pos] of positions) {
|
|
5933
5913
|
const el = elementLookup.get(id);
|
|
5934
5914
|
if (!el) {
|
|
@@ -5945,7 +5925,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5945
5925
|
}
|
|
5946
5926
|
const id = selectedElement.id;
|
|
5947
5927
|
ops.updateActiveElements(
|
|
5948
|
-
(els) => direction === "forward" ?
|
|
5928
|
+
(els) => direction === "forward" ? chunkPJUQQF3I_js.bringForward(els, id) : direction === "backward" ? chunkPJUQQF3I_js.sendBackward(els, id) : els
|
|
5949
5929
|
);
|
|
5950
5930
|
history.markDirty();
|
|
5951
5931
|
};
|
|
@@ -5955,7 +5935,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5955
5935
|
}
|
|
5956
5936
|
const id = selectedElement.id;
|
|
5957
5937
|
ops.updateActiveElements(
|
|
5958
|
-
(els) => direction === "front" ?
|
|
5938
|
+
(els) => direction === "front" ? chunkPJUQQF3I_js.bringToFront(els, id) : chunkPJUQQF3I_js.sendToBack(els, id)
|
|
5959
5939
|
);
|
|
5960
5940
|
history.markDirty();
|
|
5961
5941
|
};
|
|
@@ -6077,7 +6057,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
6077
6057
|
function useSlideManagement(input) {
|
|
6078
6058
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
6079
6059
|
const handleAddSlide = () => {
|
|
6080
|
-
const newSlide =
|
|
6060
|
+
const newSlide = chunkPJUQQF3I_js.createBlankSlide(slides.length + 1);
|
|
6081
6061
|
ops.updateSlides((prev) => {
|
|
6082
6062
|
const next = [...prev];
|
|
6083
6063
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6140,7 +6120,7 @@ function useSlideManagement(input) {
|
|
|
6140
6120
|
}
|
|
6141
6121
|
const clone = {
|
|
6142
6122
|
...src,
|
|
6143
|
-
id:
|
|
6123
|
+
id: chunkPJUQQF3I_js.makeSlideId(),
|
|
6144
6124
|
elements: src.elements.map((el) => ({
|
|
6145
6125
|
...el,
|
|
6146
6126
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6172,7 +6152,7 @@ function useSlideManagement(input) {
|
|
|
6172
6152
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6173
6153
|
const insertAt = activeSlideIndex + 1;
|
|
6174
6154
|
const draft = {
|
|
6175
|
-
...
|
|
6155
|
+
...chunkPJUQQF3I_js.createBlankSlide(slides.length + 1),
|
|
6176
6156
|
layoutPath,
|
|
6177
6157
|
...layoutName ? { layoutName } : {}
|
|
6178
6158
|
};
|
|
@@ -6233,7 +6213,7 @@ function createTableMergeHandlers(input) {
|
|
|
6233
6213
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6234
6214
|
return;
|
|
6235
6215
|
}
|
|
6236
|
-
const newTableData =
|
|
6216
|
+
const newTableData = chunkPJUQQF3I_js.mergeCells(
|
|
6237
6217
|
[
|
|
6238
6218
|
{ row: rowIndex, col: columnIndex },
|
|
6239
6219
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6241,7 +6221,7 @@ function createTableMergeHandlers(input) {
|
|
|
6241
6221
|
td
|
|
6242
6222
|
);
|
|
6243
6223
|
const updates = { tableData: newTableData };
|
|
6244
|
-
const newRawXml =
|
|
6224
|
+
const newRawXml = chunkPJUQQF3I_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6245
6225
|
if (newRawXml) {
|
|
6246
6226
|
updates.rawXml = newRawXml;
|
|
6247
6227
|
}
|
|
@@ -6267,7 +6247,7 @@ function createTableMergeHandlers(input) {
|
|
|
6267
6247
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6268
6248
|
return;
|
|
6269
6249
|
}
|
|
6270
|
-
const newTableData =
|
|
6250
|
+
const newTableData = chunkPJUQQF3I_js.mergeCells(
|
|
6271
6251
|
[
|
|
6272
6252
|
{ row: rowIndex, col: columnIndex },
|
|
6273
6253
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6275,7 +6255,7 @@ function createTableMergeHandlers(input) {
|
|
|
6275
6255
|
td
|
|
6276
6256
|
);
|
|
6277
6257
|
const updates = { tableData: newTableData };
|
|
6278
|
-
const newRawXml =
|
|
6258
|
+
const newRawXml = chunkPJUQQF3I_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6279
6259
|
if (newRawXml) {
|
|
6280
6260
|
updates.rawXml = newRawXml;
|
|
6281
6261
|
}
|
|
@@ -6290,9 +6270,9 @@ function createTableMergeHandlers(input) {
|
|
|
6290
6270
|
return;
|
|
6291
6271
|
}
|
|
6292
6272
|
const td = selectedElement.tableData;
|
|
6293
|
-
const newTableData =
|
|
6273
|
+
const newTableData = chunkPJUQQF3I_js.mergeCells(ts.selectedCells, td);
|
|
6294
6274
|
const updates = { tableData: newTableData };
|
|
6295
|
-
const newRawXml =
|
|
6275
|
+
const newRawXml = chunkPJUQQF3I_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6296
6276
|
if (newRawXml) {
|
|
6297
6277
|
updates.rawXml = newRawXml;
|
|
6298
6278
|
}
|
|
@@ -6309,9 +6289,9 @@ function createTableMergeHandlers(input) {
|
|
|
6309
6289
|
}
|
|
6310
6290
|
const { rowIndex, columnIndex } = ts;
|
|
6311
6291
|
const td = selectedElement.tableData;
|
|
6312
|
-
const newTableData =
|
|
6292
|
+
const newTableData = chunkPJUQQF3I_js.splitCell(rowIndex, columnIndex, td);
|
|
6313
6293
|
const updates = { tableData: newTableData };
|
|
6314
|
-
const newRawXml =
|
|
6294
|
+
const newRawXml = chunkPJUQQF3I_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6315
6295
|
if (newRawXml) {
|
|
6316
6296
|
updates.rawXml = newRawXml;
|
|
6317
6297
|
}
|
|
@@ -6355,7 +6335,7 @@ function createTableStructHandlers(input) {
|
|
|
6355
6335
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
6356
6336
|
}
|
|
6357
6337
|
if (el.rawXml) {
|
|
6358
|
-
const newRawXml =
|
|
6338
|
+
const newRawXml = chunkPJUQQF3I_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6359
6339
|
if (newRawXml) {
|
|
6360
6340
|
updates.rawXml = newRawXml;
|
|
6361
6341
|
}
|
|
@@ -6379,7 +6359,7 @@ function createTableStructHandlers(input) {
|
|
|
6379
6359
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6380
6360
|
const updates = {};
|
|
6381
6361
|
if (selectedElement.rawXml) {
|
|
6382
|
-
const newRawXml =
|
|
6362
|
+
const newRawXml = chunkPJUQQF3I_js.updateCellTextStyleInRawXml(
|
|
6383
6363
|
selectedElement,
|
|
6384
6364
|
rowIndex,
|
|
6385
6365
|
colIndex,
|
|
@@ -6443,9 +6423,9 @@ function createTableStructHandlers(input) {
|
|
|
6443
6423
|
return;
|
|
6444
6424
|
}
|
|
6445
6425
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6446
|
-
const newTableData =
|
|
6426
|
+
const newTableData = chunkPJUQQF3I_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6447
6427
|
const updates = { tableData: newTableData };
|
|
6448
|
-
const newRawXml =
|
|
6428
|
+
const newRawXml = chunkPJUQQF3I_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6449
6429
|
if (newRawXml) {
|
|
6450
6430
|
updates.rawXml = newRawXml;
|
|
6451
6431
|
}
|
|
@@ -6458,12 +6438,12 @@ function createTableStructHandlers(input) {
|
|
|
6458
6438
|
}
|
|
6459
6439
|
const td = selectedElement.tableData;
|
|
6460
6440
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6461
|
-
const newTableData =
|
|
6441
|
+
const newTableData = chunkPJUQQF3I_js.deleteTableRow(td, rowIdx);
|
|
6462
6442
|
if (newTableData === td) {
|
|
6463
6443
|
return;
|
|
6464
6444
|
}
|
|
6465
6445
|
const updates = { tableData: newTableData };
|
|
6466
|
-
const newRawXml =
|
|
6446
|
+
const newRawXml = chunkPJUQQF3I_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6467
6447
|
if (newRawXml) {
|
|
6468
6448
|
updates.rawXml = newRawXml;
|
|
6469
6449
|
}
|
|
@@ -6475,9 +6455,9 @@ function createTableStructHandlers(input) {
|
|
|
6475
6455
|
return;
|
|
6476
6456
|
}
|
|
6477
6457
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6478
|
-
const newTableData =
|
|
6458
|
+
const newTableData = chunkPJUQQF3I_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6479
6459
|
const updates = { tableData: newTableData };
|
|
6480
|
-
const newRawXml =
|
|
6460
|
+
const newRawXml = chunkPJUQQF3I_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6481
6461
|
if (newRawXml) {
|
|
6482
6462
|
updates.rawXml = newRawXml;
|
|
6483
6463
|
}
|
|
@@ -6490,12 +6470,12 @@ function createTableStructHandlers(input) {
|
|
|
6490
6470
|
}
|
|
6491
6471
|
const td = selectedElement.tableData;
|
|
6492
6472
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6493
|
-
const newTableData =
|
|
6473
|
+
const newTableData = chunkPJUQQF3I_js.deleteTableColumn(td, colIdx);
|
|
6494
6474
|
if (newTableData === td) {
|
|
6495
6475
|
return;
|
|
6496
6476
|
}
|
|
6497
6477
|
const updates = { tableData: newTableData };
|
|
6498
|
-
const newRawXml =
|
|
6478
|
+
const newRawXml = chunkPJUQQF3I_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6499
6479
|
if (newRawXml) {
|
|
6500
6480
|
updates.rawXml = newRawXml;
|
|
6501
6481
|
}
|
|
@@ -6531,8 +6511,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6531
6511
|
return html2canvasPro(element, {
|
|
6532
6512
|
...options,
|
|
6533
6513
|
onclone: async (doc, clonedEl) => {
|
|
6534
|
-
await
|
|
6535
|
-
|
|
6514
|
+
await chunkPJUQQF3I_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6515
|
+
chunkPJUQQF3I_js.preprocessCssForCapture(clonedEl);
|
|
6536
6516
|
if (typeof userOnClone === "function") {
|
|
6537
6517
|
userOnClone(doc, clonedEl);
|
|
6538
6518
|
}
|
|
@@ -6588,7 +6568,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6588
6568
|
}
|
|
6589
6569
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6590
6570
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6591
|
-
|
|
6571
|
+
chunkPJUQQF3I_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6592
6572
|
}
|
|
6593
6573
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6594
6574
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6610,15 +6590,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6610
6590
|
continue;
|
|
6611
6591
|
}
|
|
6612
6592
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6613
|
-
images.push(
|
|
6593
|
+
images.push(chunkPJUQQF3I_js.canvasToJpegData(canvas));
|
|
6614
6594
|
}
|
|
6615
6595
|
onProgress?.(totalSlides, totalSlides);
|
|
6616
6596
|
setActiveSlide(currentSlideIndex);
|
|
6617
6597
|
if (images.length === 0) {
|
|
6618
|
-
throw new Error(
|
|
6598
|
+
throw new Error(chunk3GNSGGY2_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6619
6599
|
}
|
|
6620
|
-
const pdfBlobUrl =
|
|
6621
|
-
|
|
6600
|
+
const pdfBlobUrl = chunk2VUHJNWM_js.buildPdfFromImageData(images);
|
|
6601
|
+
chunkPJUQQF3I_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6622
6602
|
}
|
|
6623
6603
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6624
6604
|
const { scale = 2, onProgress } = options;
|
|
@@ -6664,10 +6644,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6664
6644
|
onProgress?.(totalSlides, totalSlides);
|
|
6665
6645
|
setActiveSlide(currentSlideIndex);
|
|
6666
6646
|
if (pages.length === 0) {
|
|
6667
|
-
throw new Error(
|
|
6647
|
+
throw new Error(chunk3GNSGGY2_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6668
6648
|
}
|
|
6669
|
-
const pdfDataUrl =
|
|
6670
|
-
|
|
6649
|
+
const pdfDataUrl = chunk2VUHJNWM_js.buildNotesPdf(pages);
|
|
6650
|
+
chunkPJUQQF3I_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6671
6651
|
}
|
|
6672
6652
|
|
|
6673
6653
|
// src/viewer/utils/export-video.ts
|
|
@@ -6698,7 +6678,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6698
6678
|
}
|
|
6699
6679
|
setActiveSlide(currentSlideIndex);
|
|
6700
6680
|
if (slideCanvases.length === 0) {
|
|
6701
|
-
throw new Error(
|
|
6681
|
+
throw new Error(chunk3GNSGGY2_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
6702
6682
|
}
|
|
6703
6683
|
const firstCanvas = slideCanvases[0];
|
|
6704
6684
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -6706,12 +6686,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6706
6686
|
recordingCanvas.height = firstCanvas.height;
|
|
6707
6687
|
const ctx = recordingCanvas.getContext("2d");
|
|
6708
6688
|
if (!ctx) {
|
|
6709
|
-
throw new Error(
|
|
6689
|
+
throw new Error(chunk3GNSGGY2_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
6710
6690
|
}
|
|
6711
6691
|
const fps = 30;
|
|
6712
6692
|
const stream = recordingCanvas.captureStream(fps);
|
|
6713
6693
|
const recorder = new MediaRecorder(stream, {
|
|
6714
|
-
mimeType:
|
|
6694
|
+
mimeType: chunkPJUQQF3I_js.pickSupportedMimeType([...chunkPJUQQF3I_js.WEBM_MIME_CANDIDATES]),
|
|
6715
6695
|
videoBitsPerSecond: 5e6
|
|
6716
6696
|
});
|
|
6717
6697
|
const chunks = [];
|
|
@@ -6734,8 +6714,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6734
6714
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6735
6715
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6736
6716
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6737
|
-
const frameInterval =
|
|
6738
|
-
const framesNeeded =
|
|
6717
|
+
const frameInterval = chunkPJUQQF3I_js.fpsToFrameIntervalMs(fps);
|
|
6718
|
+
const framesNeeded = chunkPJUQQF3I_js.segmentFrameCount(duration, fps);
|
|
6739
6719
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6740
6720
|
if (signal?.aborted) {
|
|
6741
6721
|
recorder.stop();
|
|
@@ -6782,9 +6762,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6782
6762
|
}
|
|
6783
6763
|
setActiveSlide(currentSlideIndex);
|
|
6784
6764
|
if (frames.length === 0) {
|
|
6785
|
-
throw new Error(
|
|
6765
|
+
throw new Error(chunk3GNSGGY2_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6786
6766
|
}
|
|
6787
|
-
const gifBytes =
|
|
6767
|
+
const gifBytes = chunkPJUQQF3I_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6788
6768
|
onProgress?.(totalSlides, totalSlides);
|
|
6789
6769
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6790
6770
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6838,7 +6818,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6838
6818
|
continue;
|
|
6839
6819
|
}
|
|
6840
6820
|
onProgress?.(processedCount, data.slides.length);
|
|
6841
|
-
let svg =
|
|
6821
|
+
let svg = chunkPJUQQF3I_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6842
6822
|
if (embedFonts && fontFaces?.length) {
|
|
6843
6823
|
svg = injectFontFaces(svg, fontFaces);
|
|
6844
6824
|
}
|
|
@@ -6898,7 +6878,7 @@ function useExportSaveAs(input) {
|
|
|
6898
6878
|
}
|
|
6899
6879
|
setExportProgress(70);
|
|
6900
6880
|
setExportStatusMessage("Writing README...");
|
|
6901
|
-
const readme =
|
|
6881
|
+
const readme = chunkPJUQQF3I_js.generatePackageReadme(pptxFilename);
|
|
6902
6882
|
pkgFolder.file("README.txt", readme);
|
|
6903
6883
|
if (abortCtrl.signal.aborted) {
|
|
6904
6884
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -6909,7 +6889,7 @@ function useExportSaveAs(input) {
|
|
|
6909
6889
|
setExportProgress(95);
|
|
6910
6890
|
setExportStatusMessage("Downloading...");
|
|
6911
6891
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
6912
|
-
|
|
6892
|
+
chunkPJUQQF3I_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
6913
6893
|
setExportProgress(100);
|
|
6914
6894
|
} catch (err) {
|
|
6915
6895
|
if (err.name !== "AbortError") {
|
|
@@ -6932,7 +6912,7 @@ function useExportSaveAs(input) {
|
|
|
6932
6912
|
const blob = new Blob([data], {
|
|
6933
6913
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6934
6914
|
});
|
|
6935
|
-
|
|
6915
|
+
chunkPJUQQF3I_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
6936
6916
|
} catch (err) {
|
|
6937
6917
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
6938
6918
|
}
|
|
@@ -6945,14 +6925,14 @@ function useExportSaveAs(input) {
|
|
|
6945
6925
|
const pptxGuides = guides.map((g) => ({
|
|
6946
6926
|
id: g.id,
|
|
6947
6927
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
6948
|
-
positionEmu:
|
|
6928
|
+
positionEmu: chunkPJUQQF3I_js.guidePxToEmu(g.position)
|
|
6949
6929
|
}));
|
|
6950
6930
|
return {
|
|
6951
6931
|
...slide,
|
|
6952
6932
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
6953
6933
|
};
|
|
6954
6934
|
});
|
|
6955
|
-
const slidesToSave =
|
|
6935
|
+
const slidesToSave = chunk2VUHJNWM_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
6956
6936
|
const saveOptions = {
|
|
6957
6937
|
headerFooter,
|
|
6958
6938
|
presentationProperties,
|
|
@@ -7009,7 +6989,7 @@ function safeConfirm(message) {
|
|
|
7009
6989
|
}
|
|
7010
6990
|
}
|
|
7011
6991
|
function downloadBlob2(blob, filename) {
|
|
7012
|
-
|
|
6992
|
+
chunkPJUQQF3I_js.downloadBlob(blob, chunkPJUQQF3I_js.sanitizeDownloadFilename(filename));
|
|
7013
6993
|
}
|
|
7014
6994
|
|
|
7015
6995
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7110,21 +7090,21 @@ function useExportHandlers(input) {
|
|
|
7110
7090
|
{
|
|
7111
7091
|
scale: 2,
|
|
7112
7092
|
onProgress: (current, total) => {
|
|
7113
|
-
setExportProgress(
|
|
7114
|
-
setExportStatusMessage(
|
|
7093
|
+
setExportProgress(chunkPJUQQF3I_js.slideProgressPercent(current, total));
|
|
7094
|
+
setExportStatusMessage(chunkPJUQQF3I_js.slideStatusLabel("Rendering", current, total));
|
|
7115
7095
|
},
|
|
7116
7096
|
signal: abortCtrl.signal
|
|
7117
7097
|
}
|
|
7118
7098
|
);
|
|
7119
|
-
setExportProgress(
|
|
7099
|
+
setExportProgress(chunkPJUQQF3I_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7120
7100
|
setExportStatusMessage("Building PDF...");
|
|
7121
7101
|
await new Promise((r) => {
|
|
7122
7102
|
setTimeout(r, 100);
|
|
7123
7103
|
});
|
|
7124
|
-
setExportProgress(
|
|
7104
|
+
setExportProgress(chunkPJUQQF3I_js.EXPORT_DONE_PERCENT);
|
|
7125
7105
|
setExportStatusMessage("Done!");
|
|
7126
7106
|
} catch (err) {
|
|
7127
|
-
if (!
|
|
7107
|
+
if (!chunkPJUQQF3I_js.isExportAbortError(err)) {
|
|
7128
7108
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7129
7109
|
}
|
|
7130
7110
|
} finally {
|
|
@@ -7154,21 +7134,21 @@ function useExportHandlers(input) {
|
|
|
7154
7134
|
{
|
|
7155
7135
|
scale: 2,
|
|
7156
7136
|
onProgress: (current, total) => {
|
|
7157
|
-
setExportProgress(
|
|
7158
|
-
setExportStatusMessage(
|
|
7137
|
+
setExportProgress(chunkPJUQQF3I_js.slideProgressPercent(current, total));
|
|
7138
|
+
setExportStatusMessage(chunkPJUQQF3I_js.slideStatusLabel("Rendering", current, total));
|
|
7159
7139
|
},
|
|
7160
7140
|
signal: abortCtrl.signal
|
|
7161
7141
|
}
|
|
7162
7142
|
);
|
|
7163
|
-
setExportProgress(
|
|
7143
|
+
setExportProgress(chunkPJUQQF3I_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7164
7144
|
setExportStatusMessage("Building PDF...");
|
|
7165
7145
|
await new Promise((r) => {
|
|
7166
7146
|
setTimeout(r, 100);
|
|
7167
7147
|
});
|
|
7168
|
-
setExportProgress(
|
|
7148
|
+
setExportProgress(chunkPJUQQF3I_js.EXPORT_DONE_PERCENT);
|
|
7169
7149
|
setExportStatusMessage("Done!");
|
|
7170
7150
|
} catch (err) {
|
|
7171
|
-
if (!
|
|
7151
|
+
if (!chunkPJUQQF3I_js.isExportAbortError(err)) {
|
|
7172
7152
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7173
7153
|
}
|
|
7174
7154
|
} finally {
|
|
@@ -7209,22 +7189,22 @@ function useExportHandlers(input) {
|
|
|
7209
7189
|
scale: 1,
|
|
7210
7190
|
slideDurationMs: 3e3,
|
|
7211
7191
|
onProgress: (current, total) => {
|
|
7212
|
-
setExportProgress(
|
|
7213
|
-
setExportStatusMessage(
|
|
7192
|
+
setExportProgress(chunkPJUQQF3I_js.slideProgressPercent(current, total, 45));
|
|
7193
|
+
setExportStatusMessage(chunkPJUQQF3I_js.slideStatusLabel("Capturing", current, total));
|
|
7214
7194
|
},
|
|
7215
7195
|
onRecordProgress: (current, total) => {
|
|
7216
|
-
setExportProgress(
|
|
7217
|
-
setExportStatusMessage(
|
|
7196
|
+
setExportProgress(chunkPJUQQF3I_js.recordProgressPercent(current, total));
|
|
7197
|
+
setExportStatusMessage(chunkPJUQQF3I_js.slideStatusLabel("Recording", current, total));
|
|
7218
7198
|
},
|
|
7219
7199
|
signal: abortCtrl.signal
|
|
7220
7200
|
}
|
|
7221
7201
|
);
|
|
7222
|
-
setExportProgress(
|
|
7202
|
+
setExportProgress(chunkPJUQQF3I_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7223
7203
|
setExportStatusMessage("Saving file...");
|
|
7224
7204
|
downloadBlob2(blob, "presentation.webm");
|
|
7225
|
-
setExportProgress(
|
|
7205
|
+
setExportProgress(chunkPJUQQF3I_js.EXPORT_DONE_PERCENT);
|
|
7226
7206
|
} catch (err) {
|
|
7227
|
-
if (!
|
|
7207
|
+
if (!chunkPJUQQF3I_js.isExportAbortError(err)) {
|
|
7228
7208
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7229
7209
|
}
|
|
7230
7210
|
} finally {
|
|
@@ -7252,18 +7232,18 @@ function useExportHandlers(input) {
|
|
|
7252
7232
|
scale: 0.5,
|
|
7253
7233
|
slideDurationMs: 2e3,
|
|
7254
7234
|
onProgress: (current, total) => {
|
|
7255
|
-
setExportProgress(
|
|
7256
|
-
setExportStatusMessage(
|
|
7235
|
+
setExportProgress(chunkPJUQQF3I_js.slideProgressPercent(current, total));
|
|
7236
|
+
setExportStatusMessage(chunkPJUQQF3I_js.slideStatusLabel("Encoding", current, total));
|
|
7257
7237
|
},
|
|
7258
7238
|
signal: abortCtrl.signal
|
|
7259
7239
|
}
|
|
7260
7240
|
);
|
|
7261
|
-
setExportProgress(
|
|
7241
|
+
setExportProgress(chunkPJUQQF3I_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7262
7242
|
setExportStatusMessage("Saving file...");
|
|
7263
7243
|
downloadBlob2(blob, "presentation.gif");
|
|
7264
|
-
setExportProgress(
|
|
7244
|
+
setExportProgress(chunkPJUQQF3I_js.EXPORT_DONE_PERCENT);
|
|
7265
7245
|
} catch (err) {
|
|
7266
|
-
if (!
|
|
7246
|
+
if (!chunkPJUQQF3I_js.isExportAbortError(err)) {
|
|
7267
7247
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7268
7248
|
}
|
|
7269
7249
|
} finally {
|
|
@@ -7303,7 +7283,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7303
7283
|
}
|
|
7304
7284
|
printWindow.document.open();
|
|
7305
7285
|
printWindow.document.write(
|
|
7306
|
-
|
|
7286
|
+
chunkPJUQQF3I_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7307
7287
|
);
|
|
7308
7288
|
printWindow.document.close();
|
|
7309
7289
|
printWindow.focus();
|
|
@@ -7364,7 +7344,7 @@ function usePrintHandlers(input) {
|
|
|
7364
7344
|
if (svgs.length === 0) {
|
|
7365
7345
|
return;
|
|
7366
7346
|
}
|
|
7367
|
-
const printDoc =
|
|
7347
|
+
const printDoc = chunkPJUQQF3I_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7368
7348
|
title: "Slides (Vector)",
|
|
7369
7349
|
orientation: settings.orientation,
|
|
7370
7350
|
colorFilter
|
|
@@ -7400,7 +7380,7 @@ function usePrintHandlers(input) {
|
|
|
7400
7380
|
if (settings.printWhat === "outline") {
|
|
7401
7381
|
openPrintWindow(
|
|
7402
7382
|
"Outline",
|
|
7403
|
-
`<div class="outline-page">${
|
|
7383
|
+
`<div class="outline-page">${chunkPJUQQF3I_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7404
7384
|
settings.orientation,
|
|
7405
7385
|
colorFilter,
|
|
7406
7386
|
settings.frameSlides
|
|
@@ -7425,7 +7405,7 @@ function usePrintHandlers(input) {
|
|
|
7425
7405
|
if (settings.printWhat === "slides") {
|
|
7426
7406
|
openPrintWindow(
|
|
7427
7407
|
"Slides",
|
|
7428
|
-
|
|
7408
|
+
chunkPJUQQF3I_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7429
7409
|
settings.orientation,
|
|
7430
7410
|
colorFilter,
|
|
7431
7411
|
settings.frameSlides
|
|
@@ -7435,7 +7415,7 @@ function usePrintHandlers(input) {
|
|
|
7435
7415
|
if (settings.printWhat === "notes") {
|
|
7436
7416
|
openPrintWindow(
|
|
7437
7417
|
"Notes Pages",
|
|
7438
|
-
|
|
7418
|
+
chunkPJUQQF3I_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7439
7419
|
"portrait",
|
|
7440
7420
|
colorFilter,
|
|
7441
7421
|
settings.frameSlides
|
|
@@ -7446,7 +7426,7 @@ function usePrintHandlers(input) {
|
|
|
7446
7426
|
const spp = settings.slidesPerPage;
|
|
7447
7427
|
openPrintWindow(
|
|
7448
7428
|
`Handout ${spp} per page`,
|
|
7449
|
-
|
|
7429
|
+
chunkPJUQQF3I_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7450
7430
|
"portrait",
|
|
7451
7431
|
colorFilter,
|
|
7452
7432
|
settings.frameSlides
|
|
@@ -7510,8 +7490,8 @@ function useThemeHandlers(input) {
|
|
|
7510
7490
|
return;
|
|
7511
7491
|
}
|
|
7512
7492
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7513
|
-
const previousMap = theme?.colorScheme ?
|
|
7514
|
-
setSlides((prev) =>
|
|
7493
|
+
const previousMap = theme?.colorScheme ? chunkPJUQQF3I_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7494
|
+
setSlides((prev) => chunkPJUQQF3I_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7515
7495
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7516
7496
|
bumpHistory();
|
|
7517
7497
|
history.markDirty();
|
|
@@ -7616,7 +7596,7 @@ function useThemeSwitching(input) {
|
|
|
7616
7596
|
}
|
|
7617
7597
|
try {
|
|
7618
7598
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7619
|
-
const newData =
|
|
7599
|
+
const newData = chunkPJUQQF3I_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7620
7600
|
onDataChange(newData);
|
|
7621
7601
|
onThemeChanged?.(preset);
|
|
7622
7602
|
} catch (error) {
|
|
@@ -7633,7 +7613,7 @@ function useThemeSwitching(input) {
|
|
|
7633
7613
|
}
|
|
7634
7614
|
try {
|
|
7635
7615
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7636
|
-
const newData =
|
|
7616
|
+
const newData = chunkPJUQQF3I_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7637
7617
|
onDataChange(newData);
|
|
7638
7618
|
} catch (error) {
|
|
7639
7619
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7645,12 +7625,12 @@ function useThemeSwitching(input) {
|
|
|
7645
7625
|
if (!data?.theme?.colorScheme) {
|
|
7646
7626
|
return void 0;
|
|
7647
7627
|
}
|
|
7648
|
-
return
|
|
7649
|
-
(p) =>
|
|
7628
|
+
return chunkPJUQQF3I_js.THEME_PRESETS.find(
|
|
7629
|
+
(p) => chunkPJUQQF3I_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7650
7630
|
);
|
|
7651
7631
|
}, [data?.theme?.colorScheme]);
|
|
7652
7632
|
return {
|
|
7653
|
-
presets:
|
|
7633
|
+
presets: chunkPJUQQF3I_js.THEME_PRESETS,
|
|
7654
7634
|
switchToPreset,
|
|
7655
7635
|
switchToCustom,
|
|
7656
7636
|
currentPreset
|
|
@@ -7725,7 +7705,7 @@ function usePropertyHandlers(input) {
|
|
|
7725
7705
|
}
|
|
7726
7706
|
try {
|
|
7727
7707
|
const ab = await file.arrayBuffer();
|
|
7728
|
-
const h = new
|
|
7708
|
+
const h = new chunkPJUQQF3I_js.PptxHandler();
|
|
7729
7709
|
const other = await h.load(ab);
|
|
7730
7710
|
if (!other) {
|
|
7731
7711
|
return;
|
|
@@ -7735,7 +7715,7 @@ function usePropertyHandlers(input) {
|
|
|
7735
7715
|
width: canvasSize.width,
|
|
7736
7716
|
height: canvasSize.height
|
|
7737
7717
|
};
|
|
7738
|
-
setCompareResult(
|
|
7718
|
+
setCompareResult(chunkPJUQQF3I_js.comparePresentation(cur, other));
|
|
7739
7719
|
setIsComparePanelOpen(true);
|
|
7740
7720
|
} catch (err) {
|
|
7741
7721
|
console.warn("Compare failed:", err);
|
|
@@ -7752,7 +7732,7 @@ function usePropertyHandlers(input) {
|
|
|
7752
7732
|
if (!diff || diff.status === "unchanged") {
|
|
7753
7733
|
return;
|
|
7754
7734
|
}
|
|
7755
|
-
setSlides((prev) =>
|
|
7735
|
+
setSlides((prev) => chunkPJUQQF3I_js.applyAcceptSlide(prev, diff));
|
|
7756
7736
|
setIsDirty(true);
|
|
7757
7737
|
},
|
|
7758
7738
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7763,10 +7743,10 @@ function usePropertyHandlers(input) {
|
|
|
7763
7743
|
if (!compareResult) {
|
|
7764
7744
|
return;
|
|
7765
7745
|
}
|
|
7766
|
-
setSlides((prev) =>
|
|
7746
|
+
setSlides((prev) => chunkPJUQQF3I_js.applyAcceptAllSlides(prev, compareResult));
|
|
7767
7747
|
setIsDirty(true);
|
|
7768
7748
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7769
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7749
|
+
const usedFontFamilies = react.useMemo(() => chunkPJUQQF3I_js.collectUsedFonts(slides), [slides]);
|
|
7770
7750
|
return {
|
|
7771
7751
|
handleUpdateNotes,
|
|
7772
7752
|
handleUpdateSlide,
|
|
@@ -7885,7 +7865,7 @@ function useIsMobile(input) {
|
|
|
7885
7865
|
const containerRef = input?.containerRef;
|
|
7886
7866
|
const isTouchDevice = react.useSyncExternalStore(
|
|
7887
7867
|
subscribeTouchCapability,
|
|
7888
|
-
|
|
7868
|
+
chunkPJUQQF3I_js.detectTouchDevice,
|
|
7889
7869
|
() => false
|
|
7890
7870
|
// server snapshot
|
|
7891
7871
|
);
|
|
@@ -7901,7 +7881,7 @@ function useIsMobile(input) {
|
|
|
7901
7881
|
}
|
|
7902
7882
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
7903
7883
|
});
|
|
7904
|
-
const [orientation, setOrientation] = react.useState(
|
|
7884
|
+
const [orientation, setOrientation] = react.useState(chunkPJUQQF3I_js.detectOrientation);
|
|
7905
7885
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
7906
7886
|
const [initialViewportHeight] = react.useState(
|
|
7907
7887
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -7945,7 +7925,7 @@ function useIsMobile(input) {
|
|
|
7945
7925
|
return;
|
|
7946
7926
|
}
|
|
7947
7927
|
const handleOrientationChange = () => {
|
|
7948
|
-
setOrientation(
|
|
7928
|
+
setOrientation(chunkPJUQQF3I_js.detectOrientation());
|
|
7949
7929
|
};
|
|
7950
7930
|
if (screen.orientation) {
|
|
7951
7931
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -7975,9 +7955,9 @@ function useIsMobile(input) {
|
|
|
7975
7955
|
window.addEventListener("resize", handleResize);
|
|
7976
7956
|
return () => window.removeEventListener("resize", handleResize);
|
|
7977
7957
|
}, [isTouchDevice, initialViewportHeight]);
|
|
7978
|
-
const isMobile =
|
|
7979
|
-
const isTablet = !isMobile && containerWidth >=
|
|
7980
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
7958
|
+
const isMobile = chunkPJUQQF3I_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
7959
|
+
const isTablet = !isMobile && containerWidth >= chunkPJUQQF3I_js.MOBILE_BREAKPOINT && containerWidth < chunkPJUQQF3I_js.TABLET_BREAKPOINT;
|
|
7960
|
+
const isDesktop = !isMobile && containerWidth >= chunkPJUQQF3I_js.TABLET_BREAKPOINT;
|
|
7981
7961
|
return {
|
|
7982
7962
|
isMobile,
|
|
7983
7963
|
isTablet,
|
|
@@ -8038,11 +8018,11 @@ function useViewerDialogs(input) {
|
|
|
8038
8018
|
);
|
|
8039
8019
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(false);
|
|
8040
8020
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8041
|
-
() => typeof window !== "undefined" ?
|
|
8021
|
+
() => typeof window !== "undefined" ? chunkPJUQQF3I_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8042
8022
|
);
|
|
8043
8023
|
react.useEffect(() => {
|
|
8044
8024
|
const handleWindow = () => setIsNarrowViewport(
|
|
8045
|
-
|
|
8025
|
+
chunkPJUQQF3I_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8046
8026
|
);
|
|
8047
8027
|
let observer = null;
|
|
8048
8028
|
let raf = 0;
|
|
@@ -8056,12 +8036,12 @@ function useViewerDialogs(input) {
|
|
|
8056
8036
|
const entry = entries[0];
|
|
8057
8037
|
if (entry) {
|
|
8058
8038
|
setIsNarrowViewport(
|
|
8059
|
-
|
|
8039
|
+
chunkPJUQQF3I_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8060
8040
|
);
|
|
8061
8041
|
}
|
|
8062
8042
|
});
|
|
8063
8043
|
observer.observe(el);
|
|
8064
|
-
setIsNarrowViewport(
|
|
8044
|
+
setIsNarrowViewport(chunkPJUQQF3I_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8065
8045
|
};
|
|
8066
8046
|
attach();
|
|
8067
8047
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8219,27 +8199,20 @@ function useViewerDialogs(input) {
|
|
|
8219
8199
|
}
|
|
8220
8200
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8221
8201
|
if (presentationGridSpacing) {
|
|
8222
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8202
|
+
const px = Math.round(presentationGridSpacing.cx / chunk2VUHJNWM_js.EMU_PER_PX);
|
|
8223
8203
|
if (px > 0) {
|
|
8224
8204
|
return px;
|
|
8225
8205
|
}
|
|
8226
8206
|
}
|
|
8227
|
-
return
|
|
8207
|
+
return chunk2VUHJNWM_js.GRID_SIZE;
|
|
8228
8208
|
}
|
|
8229
8209
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
if (show) {
|
|
8233
|
-
const rIdToIndex = /* @__PURE__ */ new Map();
|
|
8234
|
-
slides.forEach((s, i) => rIdToIndex.set(s.rId, i));
|
|
8235
|
-
return show.slideRIds.map((rId) => rIdToIndex.get(rId)).filter((i) => i !== void 0);
|
|
8236
|
-
}
|
|
8237
|
-
}
|
|
8238
|
-
return slides.map((_, i) => i).filter((i) => !slides[i]?.hidden);
|
|
8210
|
+
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8211
|
+
return chunkPJUQQF3I_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8239
8212
|
}
|
|
8240
8213
|
function computeSlideSectionGroups(slides, sections) {
|
|
8241
|
-
return
|
|
8242
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8214
|
+
return chunkPJUQQF3I_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8215
|
+
id: group.section?.id ?? (sections.length > 0 ? chunk2VUHJNWM_js.UNGROUPED_SECTION_ID : "default"),
|
|
8243
8216
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8244
8217
|
slideIndexes: group.slideIndexes,
|
|
8245
8218
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8294,7 +8267,7 @@ function useDerivedSlideState(input) {
|
|
|
8294
8267
|
);
|
|
8295
8268
|
const slideSectionGroups = react.useMemo(
|
|
8296
8269
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8297
|
-
if (group.id ===
|
|
8270
|
+
if (group.id === chunk2VUHJNWM_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8298
8271
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8299
8272
|
}
|
|
8300
8273
|
if (group.id === "default" && group.label === "Slides") {
|
|
@@ -8397,13 +8370,13 @@ function useAnnotationHandlers(input) {
|
|
|
8397
8370
|
}, [annotations, setMode, setSlides, history]);
|
|
8398
8371
|
const handleSetMode = react.useCallback(
|
|
8399
8372
|
(nextMode) => {
|
|
8400
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8373
|
+
if (mode === "present" && nextMode !== "present" && !chunkPJUQQF3I_js.mayLeaveSlideShow()) {
|
|
8401
8374
|
return;
|
|
8402
8375
|
}
|
|
8403
8376
|
if (nextMode === "present") {
|
|
8404
8377
|
presentation.enterPresentMode();
|
|
8405
8378
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8406
|
-
|
|
8379
|
+
chunk2VUHJNWM_js.stopAllPersistentAudio();
|
|
8407
8380
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8408
8381
|
if (promptKeepInkAnnotations) {
|
|
8409
8382
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8412,7 +8385,7 @@ function useAnnotationHandlers(input) {
|
|
|
8412
8385
|
}
|
|
8413
8386
|
} else {
|
|
8414
8387
|
if (mode === "present") {
|
|
8415
|
-
|
|
8388
|
+
chunk2VUHJNWM_js.stopAllPersistentAudio();
|
|
8416
8389
|
}
|
|
8417
8390
|
setMode(nextMode);
|
|
8418
8391
|
}
|
|
@@ -8478,13 +8451,13 @@ function useSerialize(input) {
|
|
|
8478
8451
|
let processedSlide = slide;
|
|
8479
8452
|
if (pendingEditId) {
|
|
8480
8453
|
const updatedElements = slide.elements.map((el) => {
|
|
8481
|
-
if (el.id !== pendingEditId || !
|
|
8454
|
+
if (el.id !== pendingEditId || !chunkPJUQQF3I_js.hasTextProperties(el)) {
|
|
8482
8455
|
return el;
|
|
8483
8456
|
}
|
|
8484
8457
|
return {
|
|
8485
8458
|
...el,
|
|
8486
8459
|
text: pendingEditText,
|
|
8487
|
-
textSegments:
|
|
8460
|
+
textSegments: chunkPJUQQF3I_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8488
8461
|
};
|
|
8489
8462
|
});
|
|
8490
8463
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8497,14 +8470,14 @@ function useSerialize(input) {
|
|
|
8497
8470
|
const pptxGuides = guides.map((g) => ({
|
|
8498
8471
|
id: g.id,
|
|
8499
8472
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8500
|
-
positionEmu:
|
|
8473
|
+
positionEmu: chunkPJUQQF3I_js.guidePxToEmu(g.position)
|
|
8501
8474
|
}));
|
|
8502
8475
|
return {
|
|
8503
8476
|
...processedSlide,
|
|
8504
8477
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8505
8478
|
};
|
|
8506
8479
|
});
|
|
8507
|
-
const slidesToSave =
|
|
8480
|
+
const slidesToSave = chunk2VUHJNWM_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8508
8481
|
const saveOptions = {
|
|
8509
8482
|
headerFooter,
|
|
8510
8483
|
presentationProperties,
|
|
@@ -8673,7 +8646,7 @@ function usePresentationSetup(input) {
|
|
|
8673
8646
|
containerRef,
|
|
8674
8647
|
content,
|
|
8675
8648
|
onSetMode: (nextMode) => {
|
|
8676
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8649
|
+
if (mode === "present" && nextMode !== "present" && !chunkPJUQQF3I_js.mayLeaveSlideShow()) {
|
|
8677
8650
|
return;
|
|
8678
8651
|
}
|
|
8679
8652
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8681,7 +8654,7 @@ function usePresentationSetup(input) {
|
|
|
8681
8654
|
setShowKeepAnnotationsDialog(true);
|
|
8682
8655
|
} else {
|
|
8683
8656
|
if (mode === "present" && nextMode !== "present") {
|
|
8684
|
-
|
|
8657
|
+
chunk2VUHJNWM_js.stopAllPersistentAudio();
|
|
8685
8658
|
stopAnimationSound();
|
|
8686
8659
|
}
|
|
8687
8660
|
setMode(nextMode);
|
|
@@ -8735,10 +8708,10 @@ function usePresentationSetup(input) {
|
|
|
8735
8708
|
onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
|
|
8736
8709
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8737
8710
|
onSaveRehearsalTimings: (timings) => {
|
|
8738
|
-
setSlides((prev) =>
|
|
8711
|
+
setSlides((prev) => chunkPJUQQF3I_js.applyRehearsalTimings(prev, timings));
|
|
8739
8712
|
history.markDirty();
|
|
8740
8713
|
},
|
|
8741
|
-
loopContinuously:
|
|
8714
|
+
loopContinuously: chunkPJUQQF3I_js.shouldLoopContinuously(presentationProperties),
|
|
8742
8715
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8743
8716
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8744
8717
|
endWithBlackSlide
|
|
@@ -8900,7 +8873,7 @@ function useEditorOperations(input) {
|
|
|
8900
8873
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
8901
8874
|
react.useEffect(() => {
|
|
8902
8875
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
8903
|
-
copiedFormatRef.current =
|
|
8876
|
+
copiedFormatRef.current = chunkPJUQQF3I_js.copyFormatFromElement(selectedElement);
|
|
8904
8877
|
} else if (!formatPainterActive) {
|
|
8905
8878
|
copiedFormatRef.current = null;
|
|
8906
8879
|
}
|
|
@@ -8926,12 +8899,12 @@ function useEditorOperations(input) {
|
|
|
8926
8899
|
e.stopPropagation();
|
|
8927
8900
|
const element = elementLookup.get(elementId);
|
|
8928
8901
|
if (element) {
|
|
8929
|
-
const updated =
|
|
8902
|
+
const updated = chunkPJUQQF3I_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
8930
8903
|
const updates = {};
|
|
8931
|
-
if (
|
|
8904
|
+
if (chunkPJUQQF3I_js.hasShapeProperties(updated)) {
|
|
8932
8905
|
updates.shapeStyle = updated.shapeStyle;
|
|
8933
8906
|
}
|
|
8934
|
-
if (
|
|
8907
|
+
if (chunkPJUQQF3I_js.hasTextProperties(updated)) {
|
|
8935
8908
|
updates.textStyle = updated.textStyle;
|
|
8936
8909
|
}
|
|
8937
8910
|
ops.updateElementById(elementId, updates);
|
|
@@ -9078,7 +9051,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9078
9051
|
const families = /* @__PURE__ */ new Set();
|
|
9079
9052
|
for (const slide of slides) {
|
|
9080
9053
|
for (const el of slide.elements) {
|
|
9081
|
-
if (
|
|
9054
|
+
if (chunkPJUQQF3I_js.hasTextProperties(el) && el.textSegments) {
|
|
9082
9055
|
for (const seg of el.textSegments) {
|
|
9083
9056
|
if (seg.style.fontFamily) {
|
|
9084
9057
|
families.add(seg.style.fontFamily);
|
|
@@ -9290,13 +9263,13 @@ function useKeyboardShortcuts(input) {
|
|
|
9290
9263
|
inputRef.current = input;
|
|
9291
9264
|
const handleKeyDown = react.useCallback((e) => {
|
|
9292
9265
|
const current = inputRef.current;
|
|
9293
|
-
const { action, dx, dy } =
|
|
9266
|
+
const { action, dx, dy } = chunkPJUQQF3I_js.mapEditorKey(e, {
|
|
9294
9267
|
canEdit: current.canEdit,
|
|
9295
9268
|
isPresenting: current.mode !== "edit",
|
|
9296
9269
|
hasSelection: current.hasSelection,
|
|
9297
9270
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9298
9271
|
isDrawing: current.activeTool !== "select",
|
|
9299
|
-
isTextInputTarget:
|
|
9272
|
+
isTextInputTarget: chunkPJUQQF3I_js.isEditorTextInputTarget(e.target)
|
|
9300
9273
|
});
|
|
9301
9274
|
if (action === null) {
|
|
9302
9275
|
return;
|
|
@@ -9589,7 +9562,7 @@ function useViewerIntegration(input) {
|
|
|
9589
9562
|
return zoom.scale;
|
|
9590
9563
|
},
|
|
9591
9564
|
setZoom(level) {
|
|
9592
|
-
zoom.setScale(
|
|
9565
|
+
zoom.setScale(chunkPJUQQF3I_js.clampZoomScale(level));
|
|
9593
9566
|
},
|
|
9594
9567
|
zoomIn() {
|
|
9595
9568
|
zoom.handleZoomIn();
|
|
@@ -9804,7 +9777,7 @@ function useReducedMotion() {
|
|
|
9804
9777
|
}
|
|
9805
9778
|
function useViewerOptions() {
|
|
9806
9779
|
const storeRef = react.useRef(null);
|
|
9807
|
-
storeRef.current ??=
|
|
9780
|
+
storeRef.current ??= chunkPJUQQF3I_js.createViewerOptionsStore();
|
|
9808
9781
|
const store = storeRef.current;
|
|
9809
9782
|
const options = react.useSyncExternalStore(
|
|
9810
9783
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9813,9 +9786,9 @@ function useViewerOptions() {
|
|
|
9813
9786
|
);
|
|
9814
9787
|
return { optionsStore: store, options };
|
|
9815
9788
|
}
|
|
9816
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9789
|
+
var KNOWN_TAB_IDS = new Set(chunkPJUQQF3I_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9817
9790
|
function computeToolbarVisibility(hiddenActions) {
|
|
9818
|
-
const isHidden = (id) =>
|
|
9791
|
+
const isHidden = (id) => chunkPJUQQF3I_js.isActionHidden(id, hiddenActions);
|
|
9819
9792
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
9820
9793
|
return { isHidden, isTabVisible };
|
|
9821
9794
|
}
|
|
@@ -9900,12 +9873,12 @@ function useYjsDocumentSync({
|
|
|
9900
9873
|
return;
|
|
9901
9874
|
}
|
|
9902
9875
|
try {
|
|
9903
|
-
const handler = new
|
|
9876
|
+
const handler = new chunkPJUQQF3I_js.PptxHandler();
|
|
9904
9877
|
await handler.load(sourceBytes.buffer);
|
|
9905
|
-
const currentSlides =
|
|
9878
|
+
const currentSlides = chunkPJUQQF3I_js.readSlidesFromYDoc(
|
|
9906
9879
|
doc
|
|
9907
9880
|
);
|
|
9908
|
-
const slidesToSave =
|
|
9881
|
+
const slidesToSave = chunk2VUHJNWM_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
9909
9882
|
const bytes = await handler.save(slidesToSave);
|
|
9910
9883
|
config.onWriteBack(bytes);
|
|
9911
9884
|
} catch {
|
|
@@ -9920,7 +9893,7 @@ function useYjsDocumentSync({
|
|
|
9920
9893
|
if (!doc || !isConnected) {
|
|
9921
9894
|
return;
|
|
9922
9895
|
}
|
|
9923
|
-
const docSlides =
|
|
9896
|
+
const docSlides = chunkPJUQQF3I_js.readSlidesFromYDoc(
|
|
9924
9897
|
doc
|
|
9925
9898
|
);
|
|
9926
9899
|
if (docSlides.length === 0) {
|
|
@@ -9942,11 +9915,11 @@ function useYjsDocumentSync({
|
|
|
9942
9915
|
lastSyncedRef.current = serialized;
|
|
9943
9916
|
void (async () => {
|
|
9944
9917
|
const factories = await getFactories();
|
|
9945
|
-
|
|
9918
|
+
chunkPJUQQF3I_js.reconcileSlidesInYDoc(
|
|
9946
9919
|
slides,
|
|
9947
9920
|
doc,
|
|
9948
9921
|
factories,
|
|
9949
|
-
|
|
9922
|
+
chunkPJUQQF3I_js.LOCAL_SYNC_ORIGIN
|
|
9950
9923
|
);
|
|
9951
9924
|
scheduleWriteBack();
|
|
9952
9925
|
})();
|
|
@@ -9960,10 +9933,10 @@ function useYjsDocumentSync({
|
|
|
9960
9933
|
return;
|
|
9961
9934
|
}
|
|
9962
9935
|
const handleChange = (_events, transaction) => {
|
|
9963
|
-
if (transaction?.origin ===
|
|
9936
|
+
if (transaction?.origin === chunkPJUQQF3I_js.LOCAL_SYNC_ORIGIN) {
|
|
9964
9937
|
return;
|
|
9965
9938
|
}
|
|
9966
|
-
const remoteSlides =
|
|
9939
|
+
const remoteSlides = chunkPJUQQF3I_js.readSlidesFromYDoc(
|
|
9967
9940
|
doc
|
|
9968
9941
|
);
|
|
9969
9942
|
if (remoteSlides.length === 0) {
|
|
@@ -9979,7 +9952,7 @@ function useYjsDocumentSync({
|
|
|
9979
9952
|
isApplyingRemoteRef.current = false;
|
|
9980
9953
|
scheduleWriteBack();
|
|
9981
9954
|
};
|
|
9982
|
-
const unobserve =
|
|
9955
|
+
const unobserve = chunkPJUQQF3I_js.observeYDocSlides(
|
|
9983
9956
|
doc,
|
|
9984
9957
|
handleChange
|
|
9985
9958
|
);
|
|
@@ -10017,7 +9990,7 @@ function useBroadcastFollower({
|
|
|
10017
9990
|
if (!broadcaster) {
|
|
10018
9991
|
return;
|
|
10019
9992
|
}
|
|
10020
|
-
if (!
|
|
9993
|
+
if (!chunkPJUQQF3I_js.shouldAutoFollowBroadcaster({
|
|
10021
9994
|
localRole: collab.config.role,
|
|
10022
9995
|
broadcasterRole: broadcaster.role
|
|
10023
9996
|
})) {
|
|
@@ -10177,10 +10150,10 @@ function useTouchGestures(input) {
|
|
|
10177
10150
|
if (!el || !enabled) {
|
|
10178
10151
|
return;
|
|
10179
10152
|
}
|
|
10180
|
-
const recognizer =
|
|
10153
|
+
const recognizer = chunkPJUQQF3I_js.createTouchGestureRecognizer({
|
|
10181
10154
|
getScale: () => scaleRef.current,
|
|
10182
|
-
minScale:
|
|
10183
|
-
maxScale:
|
|
10155
|
+
minScale: chunkPJUQQF3I_js.MIN_ZOOM_SCALE,
|
|
10156
|
+
maxScale: chunkPJUQQF3I_js.MAX_ZOOM_SCALE,
|
|
10184
10157
|
callbacks: {
|
|
10185
10158
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10186
10159
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10220,7 +10193,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10220
10193
|
return;
|
|
10221
10194
|
}
|
|
10222
10195
|
const rect = active.getBoundingClientRect();
|
|
10223
|
-
const delta =
|
|
10196
|
+
const delta = chunkPJUQQF3I_js.computeScrollDelta(
|
|
10224
10197
|
{ top: rect.top, bottom: rect.bottom },
|
|
10225
10198
|
window.innerHeight,
|
|
10226
10199
|
keyboardInset
|
|
@@ -10240,8 +10213,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10240
10213
|
return;
|
|
10241
10214
|
}
|
|
10242
10215
|
const update = () => {
|
|
10243
|
-
const metrics =
|
|
10244
|
-
const inset = metrics ?
|
|
10216
|
+
const metrics = chunkPJUQQF3I_js.readViewportMetrics(window);
|
|
10217
|
+
const inset = metrics ? chunkPJUQQF3I_js.computeKeyboardInset(metrics) : 0;
|
|
10245
10218
|
setKeyboardInset(inset);
|
|
10246
10219
|
if (inset > 0) {
|
|
10247
10220
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10252,8 +10225,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10252
10225
|
vv.addEventListener("scroll", update);
|
|
10253
10226
|
const onFocusIn = () => {
|
|
10254
10227
|
window.requestAnimationFrame(() => {
|
|
10255
|
-
const metrics =
|
|
10256
|
-
const inset = metrics ?
|
|
10228
|
+
const metrics = chunkPJUQQF3I_js.readViewportMetrics(window);
|
|
10229
|
+
const inset = metrics ? chunkPJUQQF3I_js.computeKeyboardInset(metrics) : 0;
|
|
10257
10230
|
if (inset > 0) {
|
|
10258
10231
|
scrollFocusedIntoView(inset);
|
|
10259
10232
|
}
|
|
@@ -10266,7 +10239,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10266
10239
|
document.removeEventListener("focusin", onFocusIn);
|
|
10267
10240
|
};
|
|
10268
10241
|
}, [enabled]);
|
|
10269
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10242
|
+
return { keyboardInset, isKeyboardOpen: chunkPJUQQF3I_js.isKeyboardOpen(keyboardInset) };
|
|
10270
10243
|
}
|
|
10271
10244
|
|
|
10272
10245
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10293,7 +10266,7 @@ function buildCanvasProps(input) {
|
|
|
10293
10266
|
} = input;
|
|
10294
10267
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10295
10268
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10296
|
-
const fieldContext =
|
|
10269
|
+
const fieldContext = chunkPJUQQF3I_js.buildFieldSubstitutionContext({
|
|
10297
10270
|
headerFooter: s.headerFooter,
|
|
10298
10271
|
customProperties: s.customProperties,
|
|
10299
10272
|
slide: activeSlide
|
|
@@ -10303,13 +10276,13 @@ function buildCanvasProps(input) {
|
|
|
10303
10276
|
if (mode === "present") {
|
|
10304
10277
|
presentation.handlePresentationAction(action);
|
|
10305
10278
|
} else if (action.url) {
|
|
10306
|
-
|
|
10279
|
+
chunkPJUQQF3I_js.safeOpenUrl(action.url);
|
|
10307
10280
|
}
|
|
10308
10281
|
};
|
|
10309
10282
|
const handleHyperlinkClick = (url) => {
|
|
10310
|
-
if (
|
|
10283
|
+
if (chunkPJUQQF3I_js.isPpactionUrl(url)) {
|
|
10311
10284
|
if (mode === "present") {
|
|
10312
|
-
const parsed =
|
|
10285
|
+
const parsed = chunkPJUQQF3I_js.parsePpactionUrl(url);
|
|
10313
10286
|
if (parsed) {
|
|
10314
10287
|
presentation.handlePresentationAction({
|
|
10315
10288
|
action: parsed.action,
|
|
@@ -10319,7 +10292,7 @@ function buildCanvasProps(input) {
|
|
|
10319
10292
|
}
|
|
10320
10293
|
return;
|
|
10321
10294
|
}
|
|
10322
|
-
|
|
10295
|
+
chunkPJUQQF3I_js.safeOpenUrl(url);
|
|
10323
10296
|
};
|
|
10324
10297
|
return {
|
|
10325
10298
|
activeSlide: effectiveSlide,
|
|
@@ -10462,7 +10435,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10462
10435
|
const current = activeSlide.animations ?? [];
|
|
10463
10436
|
if (group === "motionPath") {
|
|
10464
10437
|
propertyHandlers.handleUpdateSlide({
|
|
10465
|
-
animations:
|
|
10438
|
+
animations: chunkPJUQQF3I_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10466
10439
|
});
|
|
10467
10440
|
return;
|
|
10468
10441
|
}
|
|
@@ -10523,6 +10496,7 @@ function buildToolbarProps(input) {
|
|
|
10523
10496
|
state: s,
|
|
10524
10497
|
selectedElement,
|
|
10525
10498
|
activeSlide,
|
|
10499
|
+
activeSlideIndex,
|
|
10526
10500
|
zoom,
|
|
10527
10501
|
history,
|
|
10528
10502
|
findReplace,
|
|
@@ -10655,7 +10629,7 @@ function buildToolbarProps(input) {
|
|
|
10655
10629
|
onOpenFile,
|
|
10656
10630
|
onOpenRecentFile,
|
|
10657
10631
|
onCreatePresentation: (templateId) => {
|
|
10658
|
-
s.setSlides(
|
|
10632
|
+
s.setSlides(chunkPJUQQF3I_js.createBackstagePresentation(templateId));
|
|
10659
10633
|
s.setActiveSlideIndex(0);
|
|
10660
10634
|
s.setSelectedElementId(null);
|
|
10661
10635
|
s.setSelectedElementIds([]);
|
|
@@ -10712,13 +10686,17 @@ function buildToolbarProps(input) {
|
|
|
10712
10686
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10713
10687
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10714
10688
|
formatPainterActive: s.formatPainterActive,
|
|
10715
|
-
canActivateFormatPainter:
|
|
10689
|
+
canActivateFormatPainter: chunkPJUQQF3I_js.hasCopyableFormat(selectedElement),
|
|
10716
10690
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10717
10691
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10718
10692
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
10719
10693
|
eyedropperActive: s.eyedropperActive,
|
|
10720
10694
|
onToggleEyedropper: () => s.setEyedropperActive((p) => !p),
|
|
10721
10695
|
onOpenSetUpSlideShow: () => dialogs.setIsSetUpSlideShowOpen(true),
|
|
10696
|
+
// PowerPoint's Hide Slide: skip the active slide during the show while
|
|
10697
|
+
// leaving it in the deck, the rail and the sorter.
|
|
10698
|
+
onToggleHideSlide: () => slideOps.handleToggleHideSlides([activeSlideIndex]),
|
|
10699
|
+
activeSlideHidden: Boolean(activeSlide?.hidden),
|
|
10722
10700
|
onOpenBroadcastDialog: () => dialogs.setIsBroadcastDialogOpen(true),
|
|
10723
10701
|
onToggleSubtitles: dialogs.handleToggleSubtitles,
|
|
10724
10702
|
showSubtitles: Boolean(s.presentationProperties.showSubtitles),
|
|
@@ -10788,10 +10766,12 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
10788
10766
|
activeMaster: state.activeMaster,
|
|
10789
10767
|
presentationGridSpacing: state.presentationProperties.gridSpacing
|
|
10790
10768
|
});
|
|
10769
|
+
const { options: viewerOptions } = useViewerOptions();
|
|
10791
10770
|
const { presentation, annotations, actionSoundHandlerRef } = usePresentationSetup({
|
|
10792
10771
|
mode,
|
|
10793
10772
|
slides,
|
|
10794
10773
|
visibleSlideIndexes,
|
|
10774
|
+
endWithBlackSlide: viewerOptions.advanced.slideShowEndWithBlackSlide,
|
|
10795
10775
|
activeSlideIndex,
|
|
10796
10776
|
containerRef,
|
|
10797
10777
|
content,
|
|
@@ -10975,7 +10955,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
10975
10955
|
}, [incomingContent]);
|
|
10976
10956
|
const onOpenFile = react.useCallback(() => {
|
|
10977
10957
|
void (async () => {
|
|
10978
|
-
const picked = await
|
|
10958
|
+
const picked = await chunkPJUQQF3I_js.openPptxFile();
|
|
10979
10959
|
if (picked) {
|
|
10980
10960
|
setContent(picked.buffer);
|
|
10981
10961
|
}
|
|
@@ -10983,7 +10963,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
10983
10963
|
}, []);
|
|
10984
10964
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
10985
10965
|
void (async () => {
|
|
10986
|
-
const bytes = await
|
|
10966
|
+
const bytes = await chunkPJUQQF3I_js.readBackstageRecentFile(key);
|
|
10987
10967
|
if (bytes) {
|
|
10988
10968
|
setContent(bytes);
|
|
10989
10969
|
}
|
|
@@ -11047,6 +11027,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11047
11027
|
printHandlers,
|
|
11048
11028
|
propertyHandlers,
|
|
11049
11029
|
dialogs,
|
|
11030
|
+
activeSlideIndex,
|
|
11050
11031
|
slideOps: editorOps.slideOps,
|
|
11051
11032
|
ops: editorOps.ops,
|
|
11052
11033
|
onSetMode: handleSetMode,
|