pptx-react-viewer 2.11.1 → 2.12.1
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-RMQIJDUJ.mjs → AiChatPanel-CGGUPVQX.mjs} +4 -4
- package/dist/AiChatPanel-CGGUPVQX.mjs.br +0 -0
- package/dist/AiChatPanel-CGGUPVQX.mjs.gz +0 -0
- package/dist/{AiChatPanel-E6W3EACA.js → AiChatPanel-UEFYTUJN.js} +23 -23
- package/dist/AiChatPanel-UEFYTUJN.js.br +0 -0
- package/dist/AiChatPanel-UEFYTUJN.js.gz +0 -0
- package/dist/{Model3DScene-U4B4NZJT.js → Model3DScene-QYXJNALP.js} +2 -2
- package/dist/{Model3DScene-U4B4NZJT.js.br → Model3DScene-QYXJNALP.js.br} +0 -0
- package/dist/Model3DScene-QYXJNALP.js.gz +0 -0
- package/dist/{Model3DScene-WHSHBMR5.mjs → Model3DScene-TU4NTHRM.mjs} +1 -1
- package/dist/Model3DScene-TU4NTHRM.mjs.br +0 -0
- package/dist/Model3DScene-TU4NTHRM.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-5S43UBRD.js → SurfaceChart3DScene-4VCO3DRP.js} +2 -2
- package/dist/SurfaceChart3DScene-4VCO3DRP.js.br +0 -0
- package/dist/SurfaceChart3DScene-4VCO3DRP.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-77JP5XH5.mjs → SurfaceChart3DScene-VTJBKUQY.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-77JP5XH5.mjs.br → SurfaceChart3DScene-VTJBKUQY.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-VTJBKUQY.mjs.gz +0 -0
- package/dist/{chunk-NJ4PTG4F.mjs → chunk-4GYNTY2G.mjs} +28 -48
- package/dist/chunk-4GYNTY2G.mjs.br +0 -0
- package/dist/chunk-4GYNTY2G.mjs.gz +0 -0
- package/dist/{chunk-PXYZFWDA.mjs → chunk-4SGXEGVL.mjs} +339 -256
- package/dist/chunk-4SGXEGVL.mjs.br +0 -0
- package/dist/chunk-4SGXEGVL.mjs.gz +0 -0
- package/dist/{chunk-IOVOQ6ZJ.js → chunk-BXAK3JFM.js} +301 -1
- package/dist/chunk-BXAK3JFM.js.br +0 -0
- package/dist/chunk-BXAK3JFM.js.gz +0 -0
- package/dist/{chunk-FV7HEYCX.mjs → chunk-CABQXGPI.mjs} +621 -70
- package/dist/chunk-CABQXGPI.mjs.br +0 -0
- package/dist/chunk-CABQXGPI.mjs.gz +0 -0
- package/dist/{chunk-IXBM3HWH.js → chunk-GBKIWNW6.js} +2047 -1964
- package/dist/chunk-GBKIWNW6.js.br +0 -0
- package/dist/chunk-GBKIWNW6.js.gz +0 -0
- package/dist/{chunk-FAP6OPLL.js → chunk-LE6YA5WB.js} +262 -296
- package/dist/chunk-LE6YA5WB.js.br +0 -0
- package/dist/chunk-LE6YA5WB.js.gz +0 -0
- package/dist/{chunk-HF6L2CTF.mjs → chunk-N3NKU7SC.mjs} +1 -1
- package/dist/chunk-N3NKU7SC.mjs.br +0 -0
- package/dist/{chunk-HF6L2CTF.mjs.gz → chunk-N3NKU7SC.mjs.gz} +0 -0
- package/dist/{chunk-QT6BPOZM.js → chunk-NUDH7TI2.js} +355 -375
- package/dist/chunk-NUDH7TI2.js.br +0 -0
- package/dist/chunk-NUDH7TI2.js.gz +0 -0
- package/dist/{chunk-KDJBWJJH.js → chunk-TDUDH7S4.js} +648 -71
- package/dist/chunk-TDUDH7S4.js.br +0 -0
- package/dist/chunk-TDUDH7S4.js.gz +0 -0
- package/dist/{chunk-RHR7GTDX.mjs → chunk-TEXIGSA6.mjs} +301 -1
- package/dist/chunk-TEXIGSA6.mjs.br +0 -0
- package/dist/chunk-TEXIGSA6.mjs.gz +0 -0
- package/dist/{chunk-X3SFCKAF.js → chunk-UIWY4XJT.js} +3 -3
- package/dist/chunk-UIWY4XJT.js.br +0 -0
- package/dist/chunk-UIWY4XJT.js.gz +0 -0
- package/dist/{chunk-DD54KUDG.mjs → chunk-YIPR3GKG.mjs} +24 -58
- package/dist/chunk-YIPR3GKG.mjs.br +0 -0
- package/dist/chunk-YIPR3GKG.mjs.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.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.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/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-E6W3EACA.js.br +0 -0
- package/dist/AiChatPanel-E6W3EACA.js.gz +0 -0
- package/dist/AiChatPanel-RMQIJDUJ.mjs.br +0 -0
- package/dist/AiChatPanel-RMQIJDUJ.mjs.gz +0 -0
- package/dist/Model3DScene-U4B4NZJT.js.gz +0 -0
- package/dist/Model3DScene-WHSHBMR5.mjs.br +0 -0
- package/dist/Model3DScene-WHSHBMR5.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-5S43UBRD.js.br +0 -0
- package/dist/SurfaceChart3DScene-5S43UBRD.js.gz +0 -0
- package/dist/SurfaceChart3DScene-77JP5XH5.mjs.gz +0 -0
- package/dist/chunk-DD54KUDG.mjs.br +0 -0
- package/dist/chunk-DD54KUDG.mjs.gz +0 -0
- package/dist/chunk-FAP6OPLL.js.br +0 -0
- package/dist/chunk-FAP6OPLL.js.gz +0 -0
- package/dist/chunk-FV7HEYCX.mjs.br +0 -0
- package/dist/chunk-FV7HEYCX.mjs.gz +0 -0
- package/dist/chunk-HF6L2CTF.mjs.br +0 -0
- package/dist/chunk-IOVOQ6ZJ.js.br +0 -0
- package/dist/chunk-IOVOQ6ZJ.js.gz +0 -0
- package/dist/chunk-IXBM3HWH.js.br +0 -0
- package/dist/chunk-IXBM3HWH.js.gz +0 -0
- package/dist/chunk-KDJBWJJH.js.br +0 -0
- package/dist/chunk-KDJBWJJH.js.gz +0 -0
- package/dist/chunk-NJ4PTG4F.mjs.br +0 -0
- package/dist/chunk-NJ4PTG4F.mjs.gz +0 -0
- package/dist/chunk-PXYZFWDA.mjs.br +0 -0
- package/dist/chunk-PXYZFWDA.mjs.gz +0 -0
- package/dist/chunk-QT6BPOZM.js.br +0 -0
- package/dist/chunk-QT6BPOZM.js.gz +0 -0
- package/dist/chunk-RHR7GTDX.mjs.br +0 -0
- package/dist/chunk-RHR7GTDX.mjs.gz +0 -0
- package/dist/chunk-X3SFCKAF.js.br +0 -0
- package/dist/chunk-X3SFCKAF.js.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkLE6YA5WB_js = require('./chunk-LE6YA5WB.js');
|
|
4
|
+
var chunkBXAK3JFM_js = require('./chunk-BXAK3JFM.js');
|
|
5
|
+
var chunkTDUDH7S4_js = require('./chunk-TDUDH7S4.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 = chunkTDUDH7S4_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 = chunkTDUDH7S4_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 >= chunkTDUDH7S4_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
|
+
}, chunkTDUDH7S4_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 = chunkTDUDH7S4_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 = chunkTDUDH7S4_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
|
+
chunkTDUDH7S4_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 = chunkTDUDH7S4_js.validateRoomId(config.roomId);
|
|
243
243
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
244
|
-
departureRef.current =
|
|
244
|
+
departureRef.current = chunkTDUDH7S4_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 = chunkTDUDH7S4_js.validateRoomId(config.roomId);
|
|
287
|
+
const transport = config.transport ?? chunkTDUDH7S4_js.resolveTransportForServerUrl(config.serverUrl);
|
|
288
288
|
if (transport === "webrtc") {
|
|
289
289
|
await initWebrtc();
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
if (
|
|
292
|
+
if (chunkTDUDH7S4_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 = chunkTDUDH7S4_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
|
+
chunkTDUDH7S4_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
|
+
}, chunkTDUDH7S4_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
|
+
chunkTDUDH7S4_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 = chunkTDUDH7S4_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 = chunkTDUDH7S4_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,
|
|
@@ -502,7 +502,7 @@ function useEditorHistory(input) {
|
|
|
502
502
|
const [canRedo, setCanRedo] = react.useState(false);
|
|
503
503
|
const [undoLabel, setUndoLabel] = react.useState(void 0);
|
|
504
504
|
const [redoLabel, setRedoLabel] = react.useState(void 0);
|
|
505
|
-
const [
|
|
505
|
+
const [editCommitNonce, setEditCommitNonce] = react.useState(0);
|
|
506
506
|
const updateHistoryAvailability = react.useCallback(() => {
|
|
507
507
|
setCanUndo(historyPastRef.current.length > 0);
|
|
508
508
|
setCanRedo(historyFutureRef.current.length > 0);
|
|
@@ -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(chunkTDUDH7S4_js.cloneSlide),
|
|
521
|
+
templateElementsBySlideId: chunkTDUDH7S4_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(chunkTDUDH7S4_js.cloneSlide));
|
|
535
535
|
setTemplateElementsBySlideId(
|
|
536
|
-
|
|
536
|
+
chunkTDUDH7S4_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
537
537
|
);
|
|
538
538
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
539
539
|
setSelectedElementIds([]);
|
|
@@ -557,7 +557,7 @@ function useEditorHistory(input) {
|
|
|
557
557
|
}, 0);
|
|
558
558
|
}, []);
|
|
559
559
|
const markDirty = react.useCallback(() => {
|
|
560
|
-
|
|
560
|
+
setEditCommitNonce((previous) => previous + 1);
|
|
561
561
|
}, []);
|
|
562
562
|
const handleUndo = react.useCallback(() => {
|
|
563
563
|
const previousSnapshot = historyPastRef.current.pop();
|
|
@@ -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 = chunkLE6YA5WB_js.cloneHistorySnapshot(previousSnapshot);
|
|
571
|
+
lastHistorySnapshotRef.current = chunkLE6YA5WB_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 = chunkLE6YA5WB_js.cloneHistorySnapshot(nextSnapshot);
|
|
593
|
+
lastHistorySnapshotRef.current = chunkLE6YA5WB_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 = chunkLE6YA5WB_js.cloneHistorySnapshot(initialSnapshot);
|
|
612
612
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
613
613
|
lastHistorySerializedRef.current = JSON.stringify(clonedInitial);
|
|
614
614
|
} else {
|
|
@@ -637,7 +637,7 @@ function useEditorHistory(input) {
|
|
|
637
637
|
if (hasActivePointerInteraction()) {
|
|
638
638
|
return;
|
|
639
639
|
}
|
|
640
|
-
const cheapHash = `${pointerCommitNonce}|${slides.length}|${activeSlideIndex}|${canvasSize.width}x${canvasSize.height}|${slides.map((s) => `${s.id}:${s.elements.length}`).join("/")}`;
|
|
640
|
+
const cheapHash = `${pointerCommitNonce}|${editCommitNonce}|${slides.length}|${activeSlideIndex}|${canvasSize.width}x${canvasSize.height}|${slides.map((s) => `${s.id}:${s.elements.length}`).join("/")}`;
|
|
641
641
|
if (cheapHash === lastCheapHashRef.current) {
|
|
642
642
|
return;
|
|
643
643
|
}
|
|
@@ -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 = chunkLE6YA5WB_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(chunkLE6YA5WB_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 = chunkLE6YA5WB_js.cloneHistorySnapshot(snapshot);
|
|
664
664
|
lastHistorySerializedRef.current = serialized;
|
|
665
665
|
lastCheapHashRef.current = cheapHash;
|
|
666
666
|
updateHistoryAvailability();
|
|
@@ -669,6 +669,7 @@ function useEditorHistory(input) {
|
|
|
669
669
|
buildHistorySnapshot,
|
|
670
670
|
canvasSize.height,
|
|
671
671
|
canvasSize.width,
|
|
672
|
+
editCommitNonce,
|
|
672
673
|
error,
|
|
673
674
|
hasActivePointerInteraction,
|
|
674
675
|
loading,
|
|
@@ -749,7 +750,7 @@ function useZoomViewport({
|
|
|
749
750
|
if (!wrapper || !canvasViewport) {
|
|
750
751
|
return;
|
|
751
752
|
}
|
|
752
|
-
const boundedScale =
|
|
753
|
+
const boundedScale = chunkTDUDH7S4_js.clampZoomScale(nextScale);
|
|
753
754
|
const nextEditorScale = fitScale * boundedScale;
|
|
754
755
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
755
756
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -764,10 +765,10 @@ function useZoomViewport({
|
|
|
764
765
|
[fitScale]
|
|
765
766
|
);
|
|
766
767
|
const handleZoomIn = react.useCallback(() => {
|
|
767
|
-
setScale((currentScale) =>
|
|
768
|
+
setScale((currentScale) => chunkTDUDH7S4_js.zoomInScale(currentScale));
|
|
768
769
|
}, []);
|
|
769
770
|
const handleZoomOut = react.useCallback(() => {
|
|
770
|
-
setScale((currentScale) =>
|
|
771
|
+
setScale((currentScale) => chunkTDUDH7S4_js.zoomOutScale(currentScale));
|
|
771
772
|
}, []);
|
|
772
773
|
const handleResetZoom = react.useCallback(() => {
|
|
773
774
|
setScale(1);
|
|
@@ -786,29 +787,29 @@ function useZoomViewport({
|
|
|
786
787
|
selectedElements.forEach((element) => {
|
|
787
788
|
minX = Math.min(minX, element.x);
|
|
788
789
|
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,
|
|
790
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkLE6YA5WB_js.MIN_ELEMENT_SIZE));
|
|
791
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkLE6YA5WB_js.MIN_ELEMENT_SIZE));
|
|
791
792
|
});
|
|
792
793
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
793
794
|
return;
|
|
794
795
|
}
|
|
795
796
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
796
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
797
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
797
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkLE6YA5WB_js.MIN_ELEMENT_SIZE);
|
|
798
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkLE6YA5WB_js.MIN_ELEMENT_SIZE);
|
|
798
799
|
const availableWidth = Math.max(
|
|
799
|
-
effectiveEditorDimensions.width -
|
|
800
|
-
|
|
800
|
+
effectiveEditorDimensions.width - chunkLE6YA5WB_js.ZOOM_TO_SELECTION_PADDING,
|
|
801
|
+
chunkLE6YA5WB_js.MIN_ELEMENT_SIZE
|
|
801
802
|
);
|
|
802
803
|
const availableHeight = Math.max(
|
|
803
|
-
effectiveEditorDimensions.height -
|
|
804
|
-
|
|
804
|
+
effectiveEditorDimensions.height - chunkLE6YA5WB_js.ZOOM_TO_SELECTION_PADDING,
|
|
805
|
+
chunkLE6YA5WB_js.MIN_ELEMENT_SIZE
|
|
805
806
|
);
|
|
806
807
|
const targetEditorScale = Math.min(
|
|
807
808
|
availableWidth / boundsWidth,
|
|
808
809
|
availableHeight / boundsHeight
|
|
809
810
|
);
|
|
810
811
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
811
|
-
const nextScale =
|
|
812
|
+
const nextScale = chunkTDUDH7S4_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
812
813
|
setScale(nextScale);
|
|
813
814
|
window.requestAnimationFrame(() => {
|
|
814
815
|
window.requestAnimationFrame(() => {
|
|
@@ -828,7 +829,7 @@ function useZoomViewport({
|
|
|
828
829
|
}
|
|
829
830
|
event.preventDefault();
|
|
830
831
|
const delta = event.deltaY * -1e-3;
|
|
831
|
-
setScale((currentScale) =>
|
|
832
|
+
setScale((currentScale) => chunkTDUDH7S4_js.clampZoomScale(currentScale + delta));
|
|
832
833
|
}, []);
|
|
833
834
|
react.useEffect(() => {
|
|
834
835
|
const viewport = canvasViewportRef.current;
|
|
@@ -905,7 +906,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
905
906
|
const command = step.command;
|
|
906
907
|
const timer = window.setTimeout(
|
|
907
908
|
() => {
|
|
908
|
-
|
|
909
|
+
chunkLE6YA5WB_js.executeMediaCommand(command);
|
|
909
910
|
},
|
|
910
911
|
Math.max(0, step.delayMs)
|
|
911
912
|
);
|
|
@@ -1021,7 +1022,7 @@ function useAnimationPlayback(input) {
|
|
|
1021
1022
|
(controller, group) => {
|
|
1022
1023
|
driveBuildReveal(
|
|
1023
1024
|
controller,
|
|
1024
|
-
|
|
1025
|
+
chunkTDUDH7S4_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1025
1026
|
setPresentationElementStates,
|
|
1026
1027
|
buildRafRef
|
|
1027
1028
|
);
|
|
@@ -1084,7 +1085,7 @@ function useAnimationPlayback(input) {
|
|
|
1084
1085
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1085
1086
|
return;
|
|
1086
1087
|
}
|
|
1087
|
-
const controller =
|
|
1088
|
+
const controller = chunkTDUDH7S4_js.PresentationAnimationController.fromSlide(slide);
|
|
1088
1089
|
controllerRef.current = controller;
|
|
1089
1090
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1090
1091
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1232,7 +1233,7 @@ function useAnimationPlayback(input) {
|
|
|
1232
1233
|
}))
|
|
1233
1234
|
);
|
|
1234
1235
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1235
|
-
const delay =
|
|
1236
|
+
const delay = chunkTDUDH7S4_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1236
1237
|
const timer = window.setTimeout(() => {
|
|
1237
1238
|
setPresentationAnimations(
|
|
1238
1239
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1269,12 +1270,12 @@ function useAnimationPlayback(input) {
|
|
|
1269
1270
|
presentationTimersRef
|
|
1270
1271
|
};
|
|
1271
1272
|
}
|
|
1272
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1273
|
-
var AUDIENCE_HASH =
|
|
1274
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1275
|
-
var AUDIENCE_NONCE_KEY =
|
|
1273
|
+
var PRESENTER_CHANNEL_NAME = chunkTDUDH7S4_js.PRESENTATION_CHANNEL_NAME;
|
|
1274
|
+
var AUDIENCE_HASH = chunkTDUDH7S4_js.PRESENTATION_HASH;
|
|
1275
|
+
var PRESENTER_MSG_ORIGIN = chunkTDUDH7S4_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1276
|
+
var AUDIENCE_NONCE_KEY = chunkTDUDH7S4_js.PRESENTATION_NONCE_KEY;
|
|
1276
1277
|
function generateSessionId() {
|
|
1277
|
-
return
|
|
1278
|
+
return chunkTDUDH7S4_js.createPresentationSessionId();
|
|
1278
1279
|
}
|
|
1279
1280
|
function parseAudienceNonce() {
|
|
1280
1281
|
const hash = window.location.hash;
|
|
@@ -1310,7 +1311,7 @@ function usePresenterWindow(input) {
|
|
|
1310
1311
|
}, []);
|
|
1311
1312
|
const swapDisplays = react.useCallback(async () => {
|
|
1312
1313
|
const audience = audienceWindowRef.current;
|
|
1313
|
-
return audience && !audience.closed ?
|
|
1314
|
+
return audience && !audience.closed ? chunkTDUDH7S4_js.swapPresentationWindows(window, audience) : false;
|
|
1314
1315
|
}, []);
|
|
1315
1316
|
const syncSlideToAudience = react.useCallback(
|
|
1316
1317
|
(slideIndex) => {
|
|
@@ -1374,7 +1375,7 @@ function usePresenterWindow(input) {
|
|
|
1374
1375
|
pollTimerRef.current = null;
|
|
1375
1376
|
}
|
|
1376
1377
|
if (closingSessionId) {
|
|
1377
|
-
void
|
|
1378
|
+
void chunkTDUDH7S4_js.clearAudienceContent(closingSessionId);
|
|
1378
1379
|
}
|
|
1379
1380
|
}, [getChannel]);
|
|
1380
1381
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1392,10 +1393,10 @@ function usePresenterWindow(input) {
|
|
|
1392
1393
|
audienceWindowRef.current = blankWin;
|
|
1393
1394
|
const sessionId = generateSessionId();
|
|
1394
1395
|
sessionIdRef.current = sessionId;
|
|
1395
|
-
const audienceUrl =
|
|
1396
|
-
void
|
|
1396
|
+
const audienceUrl = chunkTDUDH7S4_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1397
|
+
void chunkTDUDH7S4_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1397
1398
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1398
|
-
|
|
1399
|
+
chunkTDUDH7S4_js.placeAudienceWindow(blankWin, placement);
|
|
1399
1400
|
}
|
|
1400
1401
|
return void 0;
|
|
1401
1402
|
});
|
|
@@ -1425,7 +1426,7 @@ function usePresenterWindow(input) {
|
|
|
1425
1426
|
}
|
|
1426
1427
|
};
|
|
1427
1428
|
if (content) {
|
|
1428
|
-
void
|
|
1429
|
+
void chunkTDUDH7S4_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1429
1430
|
} else {
|
|
1430
1431
|
navigateOrClose(true);
|
|
1431
1432
|
}
|
|
@@ -1451,7 +1452,7 @@ function usePresenterWindow(input) {
|
|
|
1451
1452
|
}
|
|
1452
1453
|
const handleMessage = (event) => {
|
|
1453
1454
|
const message = event.data;
|
|
1454
|
-
if (
|
|
1455
|
+
if (chunkTDUDH7S4_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1455
1456
|
syncStateToAudience(snapshotRef.current);
|
|
1456
1457
|
}
|
|
1457
1458
|
};
|
|
@@ -1480,7 +1481,7 @@ function usePresenterWindow(input) {
|
|
|
1480
1481
|
react.useEffect(() => {
|
|
1481
1482
|
const handleBeforeUnload = () => {
|
|
1482
1483
|
if (sessionIdRef.current) {
|
|
1483
|
-
void
|
|
1484
|
+
void chunkTDUDH7S4_js.clearAudienceContent(sessionIdRef.current);
|
|
1484
1485
|
}
|
|
1485
1486
|
};
|
|
1486
1487
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1542,7 +1543,7 @@ function useAudienceMode(input) {
|
|
|
1542
1543
|
}
|
|
1543
1544
|
channel.onmessage = (event) => {
|
|
1544
1545
|
const data = event.data;
|
|
1545
|
-
if (!
|
|
1546
|
+
if (!chunkTDUDH7S4_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1546
1547
|
return;
|
|
1547
1548
|
}
|
|
1548
1549
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1558,16 +1559,16 @@ function useAudienceMode(input) {
|
|
|
1558
1559
|
}
|
|
1559
1560
|
if (data.type === "presenter-exit") {
|
|
1560
1561
|
if (expectedSessionId) {
|
|
1561
|
-
void
|
|
1562
|
+
void chunkTDUDH7S4_js.clearAudienceContent(expectedSessionId);
|
|
1562
1563
|
}
|
|
1563
|
-
if (
|
|
1564
|
+
if (chunkTDUDH7S4_js.endAudienceDisplay(window)) {
|
|
1564
1565
|
handlers.onPresenterEnded?.();
|
|
1565
1566
|
}
|
|
1566
1567
|
}
|
|
1567
1568
|
};
|
|
1568
1569
|
if (expectedSessionId) {
|
|
1569
1570
|
channel.postMessage({
|
|
1570
|
-
origin:
|
|
1571
|
+
origin: chunkTDUDH7S4_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1571
1572
|
type: "audience-ready",
|
|
1572
1573
|
sessionId: expectedSessionId
|
|
1573
1574
|
});
|
|
@@ -1600,14 +1601,14 @@ function usePresentationKeyboard(input) {
|
|
|
1600
1601
|
presentationSlideIndex,
|
|
1601
1602
|
setShowRehearsalSummary
|
|
1602
1603
|
} = input;
|
|
1603
|
-
const keyBufferRef = react.useRef(
|
|
1604
|
+
const keyBufferRef = react.useRef(chunkTDUDH7S4_js.createPresentationKeyBuffer());
|
|
1604
1605
|
react.useEffect(() => {
|
|
1605
|
-
if (mode !== "present" || !
|
|
1606
|
-
keyBufferRef.current =
|
|
1606
|
+
if (mode !== "present" || !chunkTDUDH7S4_js.acceptsPresentationInput()) {
|
|
1607
|
+
keyBufferRef.current = chunkTDUDH7S4_js.createPresentationKeyBuffer();
|
|
1607
1608
|
return;
|
|
1608
1609
|
}
|
|
1609
1610
|
const handleKeyDown = (event) => {
|
|
1610
|
-
const mapped =
|
|
1611
|
+
const mapped = chunkTDUDH7S4_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1611
1612
|
if (mapped.action === "none") {
|
|
1612
1613
|
return;
|
|
1613
1614
|
}
|
|
@@ -1627,12 +1628,12 @@ function usePresentationKeyboard(input) {
|
|
|
1627
1628
|
movePresentationSlide(-1);
|
|
1628
1629
|
return;
|
|
1629
1630
|
case "first": {
|
|
1630
|
-
const first =
|
|
1631
|
+
const first = chunkTDUDH7S4_js.firstShowSlideIndex(showSlideIndexes);
|
|
1631
1632
|
navigateToSlide(first ?? 0);
|
|
1632
1633
|
return;
|
|
1633
1634
|
}
|
|
1634
1635
|
case "last": {
|
|
1635
|
-
const last =
|
|
1636
|
+
const last = chunkTDUDH7S4_js.lastShowSlideIndex(showSlideIndexes);
|
|
1636
1637
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1637
1638
|
return;
|
|
1638
1639
|
}
|
|
@@ -1787,50 +1788,29 @@ function useRehearsalTimings(input) {
|
|
|
1787
1788
|
|
|
1788
1789
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1789
1790
|
function handlePresentationActionImpl(action, deps) {
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
deps.
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
if (actionStr.includes("hlinkshowjump")) {
|
|
1805
|
-
const lower = actionStr.toLowerCase();
|
|
1806
|
-
if (lower.includes("nextslide")) {
|
|
1807
|
-
deps.movePresentationSlide(1);
|
|
1808
|
-
} else if (lower.includes("previousslide")) {
|
|
1809
|
-
deps.movePresentationSlide(-1);
|
|
1810
|
-
} else if (lower.includes("firstslide")) {
|
|
1811
|
-
deps.navigateToSlide(0);
|
|
1812
|
-
} else if (lower.includes("lastslide")) {
|
|
1813
|
-
deps.navigateToSlide(deps.slidesLength - 1);
|
|
1814
|
-
} else if (lower.includes("endshow")) {
|
|
1815
|
-
deps.onSetMode("edit");
|
|
1816
|
-
}
|
|
1817
|
-
return;
|
|
1818
|
-
}
|
|
1819
|
-
if (actionStr.includes("hlinksldjump")) {
|
|
1820
|
-
return;
|
|
1821
|
-
}
|
|
1822
|
-
if (action.url && !actionStr.includes("hlinksldjump")) {
|
|
1823
|
-
if (chunkKDJBWJJH_js.isUrlSafe(action.url)) {
|
|
1824
|
-
window.open(action.url, "_blank", "noopener,noreferrer");
|
|
1791
|
+
chunkTDUDH7S4_js.runPresentationAction(
|
|
1792
|
+
action,
|
|
1793
|
+
{ slideCount: deps.slidesLength },
|
|
1794
|
+
{
|
|
1795
|
+
goToSlide: (slideIndex) => {
|
|
1796
|
+
deps.navigateToSlide(slideIndex);
|
|
1797
|
+
},
|
|
1798
|
+
move: (direction) => {
|
|
1799
|
+
deps.movePresentationSlide(direction);
|
|
1800
|
+
},
|
|
1801
|
+
endShow: () => {
|
|
1802
|
+
deps.onSetMode("edit");
|
|
1803
|
+
},
|
|
1804
|
+
playSound: deps.onPlayActionSound ? (soundPath) => deps.onPlayActionSound?.(soundPath) : void 0
|
|
1825
1805
|
}
|
|
1826
|
-
|
|
1806
|
+
);
|
|
1827
1807
|
}
|
|
1828
1808
|
|
|
1829
1809
|
// src/viewer/hooks/presentation-mode/slide-transition.ts
|
|
1830
1810
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1831
1811
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1832
1812
|
const transition = incomingSlide?.transition;
|
|
1833
|
-
const durationMs = deps.playTransition ?
|
|
1813
|
+
const durationMs = deps.playTransition ? chunkTDUDH7S4_js.resolveTransitionDurationMs(transition) : 0;
|
|
1834
1814
|
deps.clearPresentationTimers();
|
|
1835
1815
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1836
1816
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1889,7 +1869,7 @@ function useSlideNavigation(input) {
|
|
|
1889
1869
|
});
|
|
1890
1870
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1891
1871
|
(slideIndex) => {
|
|
1892
|
-
const delayMs =
|
|
1872
|
+
const delayMs = chunkTDUDH7S4_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1893
1873
|
if (delayMs === void 0) {
|
|
1894
1874
|
return;
|
|
1895
1875
|
}
|
|
@@ -1912,7 +1892,7 @@ function useSlideNavigation(input) {
|
|
|
1912
1892
|
if (availableSlideIndexes.length === 0) {
|
|
1913
1893
|
return;
|
|
1914
1894
|
}
|
|
1915
|
-
const pastLastSlide = direction === 1 && !
|
|
1895
|
+
const pastLastSlide = direction === 1 && !chunkTDUDH7S4_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1916
1896
|
if (rehearsing && pastLastSlide) {
|
|
1917
1897
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1918
1898
|
try {
|
|
@@ -1930,9 +1910,9 @@ function useSlideNavigation(input) {
|
|
|
1930
1910
|
onAdvancePastLastSlide();
|
|
1931
1911
|
return;
|
|
1932
1912
|
}
|
|
1933
|
-
const nextSlideIndex = direction === 1 ?
|
|
1913
|
+
const nextSlideIndex = direction === 1 ? chunkTDUDH7S4_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1934
1914
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
1935
|
-
}) :
|
|
1915
|
+
}) : chunkTDUDH7S4_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
1936
1916
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
1937
1917
|
return;
|
|
1938
1918
|
}
|
|
@@ -2073,17 +2053,17 @@ function useZoomNavigation(input) {
|
|
|
2073
2053
|
};
|
|
2074
2054
|
}
|
|
2075
2055
|
function usePresenterConsole(slideIndex) {
|
|
2076
|
-
const timerRef = react.useRef(
|
|
2077
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2056
|
+
const timerRef = react.useRef(chunkTDUDH7S4_js.createPresenterTimer());
|
|
2057
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkTDUDH7S4_js.createInitialPresentationSnapshot(slideIndex));
|
|
2078
2058
|
const patch = react.useCallback((value) => {
|
|
2079
|
-
setSnapshot((current) =>
|
|
2059
|
+
setSnapshot((current) => chunkTDUDH7S4_js.mergePresentationSnapshot(current, value));
|
|
2080
2060
|
}, []);
|
|
2081
2061
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2082
2062
|
react.useEffect(() => {
|
|
2083
2063
|
const timer = window.setInterval(() => {
|
|
2084
2064
|
patch({
|
|
2085
2065
|
paused: timerRef.current.paused,
|
|
2086
|
-
elapsedMs:
|
|
2066
|
+
elapsedMs: chunkTDUDH7S4_js.presenterElapsed(timerRef.current)
|
|
2087
2067
|
});
|
|
2088
2068
|
}, 1e3);
|
|
2089
2069
|
return () => window.clearInterval(timer);
|
|
@@ -2093,19 +2073,19 @@ function usePresenterConsole(slideIndex) {
|
|
|
2093
2073
|
applyAudienceSnapshot: setSnapshot,
|
|
2094
2074
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2095
2075
|
toggleTimer: () => {
|
|
2096
|
-
timerRef.current =
|
|
2076
|
+
timerRef.current = chunkTDUDH7S4_js.togglePresenterTimer(timerRef.current);
|
|
2097
2077
|
patch({
|
|
2098
2078
|
paused: timerRef.current.paused,
|
|
2099
|
-
elapsedMs:
|
|
2079
|
+
elapsedMs: chunkTDUDH7S4_js.presenterElapsed(timerRef.current)
|
|
2100
2080
|
});
|
|
2101
2081
|
},
|
|
2102
2082
|
resetTimer: () => {
|
|
2103
|
-
timerRef.current =
|
|
2083
|
+
timerRef.current = chunkTDUDH7S4_js.resetPresenterTimer();
|
|
2104
2084
|
patch({ paused: false, elapsedMs: 0 });
|
|
2105
2085
|
},
|
|
2106
2086
|
stepZoom: (direction) => setSnapshot(
|
|
2107
|
-
(current) =>
|
|
2108
|
-
zoom:
|
|
2087
|
+
(current) => chunkTDUDH7S4_js.mergePresentationSnapshot(current, {
|
|
2088
|
+
zoom: chunkTDUDH7S4_js.stepPresenterZoom(
|
|
2109
2089
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2110
2090
|
direction
|
|
2111
2091
|
)
|
|
@@ -2150,7 +2130,7 @@ function usePresentationMode(input) {
|
|
|
2150
2130
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2151
2131
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2152
2132
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2153
|
-
const
|
|
2133
|
+
const showGuard = react.useMemo(() => chunkTDUDH7S4_js.createPresenterShowGuard(), []);
|
|
2154
2134
|
const {
|
|
2155
2135
|
presentationAnimations,
|
|
2156
2136
|
presentationElementStates,
|
|
@@ -2226,7 +2206,7 @@ function usePresentationMode(input) {
|
|
|
2226
2206
|
});
|
|
2227
2207
|
const movePresentationSlide = react.useCallback(
|
|
2228
2208
|
(direction, trigger = "explicit") => {
|
|
2229
|
-
if (!
|
|
2209
|
+
if (!chunkTDUDH7S4_js.acceptsPresentationInput()) {
|
|
2230
2210
|
return;
|
|
2231
2211
|
}
|
|
2232
2212
|
if (endOfShowVisible) {
|
|
@@ -2302,7 +2282,7 @@ function usePresentationMode(input) {
|
|
|
2302
2282
|
}, [onSetMode, setRehearsing]);
|
|
2303
2283
|
const togglePresenterView = react.useCallback(() => {
|
|
2304
2284
|
if (!presenterMode) {
|
|
2305
|
-
|
|
2285
|
+
showGuard.expectAudienceBounce();
|
|
2306
2286
|
try {
|
|
2307
2287
|
if (document.fullscreenElement) {
|
|
2308
2288
|
void document.exitFullscreen().catch(() => {
|
|
@@ -2325,7 +2305,7 @@ function usePresentationMode(input) {
|
|
|
2325
2305
|
} catch {
|
|
2326
2306
|
}
|
|
2327
2307
|
}
|
|
2328
|
-
}, [presenterMode, presentationStartTime, containerRef]);
|
|
2308
|
+
}, [presenterMode, presentationStartTime, containerRef, showGuard]);
|
|
2329
2309
|
usePresentationKeyboard({
|
|
2330
2310
|
mode,
|
|
2331
2311
|
movePresentationSlide,
|
|
@@ -2389,8 +2369,7 @@ function usePresentationMode(input) {
|
|
|
2389
2369
|
}
|
|
2390
2370
|
let wasFullscreen = Boolean(document.fullscreenElement);
|
|
2391
2371
|
const handleFullscreenChange = () => {
|
|
2392
|
-
if (
|
|
2393
|
-
switchingToPresenterRef.current = false;
|
|
2372
|
+
if (showGuard.classifyFullscreenExit() === "restore-show") {
|
|
2394
2373
|
wasFullscreen = Boolean(document.fullscreenElement);
|
|
2395
2374
|
return;
|
|
2396
2375
|
}
|
|
@@ -2415,7 +2394,8 @@ function usePresentationMode(input) {
|
|
|
2415
2394
|
rehearsing,
|
|
2416
2395
|
recordCurrentSlideTime,
|
|
2417
2396
|
presentationSlideIndex,
|
|
2418
|
-
setShowRehearsalSummary
|
|
2397
|
+
setShowRehearsalSummary,
|
|
2398
|
+
showGuard
|
|
2419
2399
|
]);
|
|
2420
2400
|
react.useEffect(() => {
|
|
2421
2401
|
const timersRef = presentationTimersRef;
|
|
@@ -2429,11 +2409,11 @@ function usePresentationMode(input) {
|
|
|
2429
2409
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2430
2410
|
return void 0;
|
|
2431
2411
|
}
|
|
2432
|
-
return
|
|
2412
|
+
return chunkTDUDH7S4_js.buildMorphTransitionPlan(
|
|
2433
2413
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2434
2414
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2435
2415
|
transitionOverlay.durationMs,
|
|
2436
|
-
|
|
2416
|
+
chunkTDUDH7S4_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2437
2417
|
);
|
|
2438
2418
|
}, [transitionOverlay, slides]);
|
|
2439
2419
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2739,7 +2719,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2739
2719
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2740
2720
|
slides.forEach((slide, slideIndex) => {
|
|
2741
2721
|
for (const element of slide.elements || []) {
|
|
2742
|
-
if (!
|
|
2722
|
+
if (!chunkTDUDH7S4_js.hasTextProperties(element)) {
|
|
2743
2723
|
continue;
|
|
2744
2724
|
}
|
|
2745
2725
|
const segments = element.textSegments ?? [];
|
|
@@ -2790,7 +2770,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2790
2770
|
continue;
|
|
2791
2771
|
}
|
|
2792
2772
|
const element = slide.elements[elIdx];
|
|
2793
|
-
if (!
|
|
2773
|
+
if (!chunkTDUDH7S4_js.hasTextProperties(element)) {
|
|
2794
2774
|
continue;
|
|
2795
2775
|
}
|
|
2796
2776
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3388,7 +3368,7 @@ function useViewerCoreState(_input) {
|
|
|
3388
3368
|
const shapeAdjustmentDragStateRef = react.useRef(null);
|
|
3389
3369
|
const marqueeStateRef = react.useRef(null);
|
|
3390
3370
|
const isDrawingRef = react.useRef(false);
|
|
3391
|
-
const livePatcher = react.useMemo(() =>
|
|
3371
|
+
const livePatcher = react.useMemo(() => chunkTDUDH7S4_js.createCollaborationLivePatcher(), []);
|
|
3392
3372
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3393
3373
|
const slidesRef = react.useRef([]);
|
|
3394
3374
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3397,8 +3377,8 @@ function useViewerCoreState(_input) {
|
|
|
3397
3377
|
const [slides, setSlides] = react.useState([]);
|
|
3398
3378
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3399
3379
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3400
|
-
width:
|
|
3401
|
-
height:
|
|
3380
|
+
width: chunkLE6YA5WB_js.DEFAULT_CANVAS_WIDTH,
|
|
3381
|
+
height: chunkLE6YA5WB_js.DEFAULT_CANVAS_HEIGHT
|
|
3402
3382
|
});
|
|
3403
3383
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
3404
3384
|
const [selectedElementId, setSelectedElementId] = react.useState(null);
|
|
@@ -3418,7 +3398,7 @@ function useViewerCoreState(_input) {
|
|
|
3418
3398
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3419
3399
|
inlineEditingTextRef.current = resolved;
|
|
3420
3400
|
setInlineEditingTextBase(value);
|
|
3421
|
-
|
|
3401
|
+
chunkTDUDH7S4_js.publishLiveInlineText(
|
|
3422
3402
|
livePatcher,
|
|
3423
3403
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3424
3404
|
inlineEditingElementIdRef.current,
|
|
@@ -3752,7 +3732,7 @@ function useLoadContent({
|
|
|
3752
3732
|
);
|
|
3753
3733
|
}
|
|
3754
3734
|
const previousHandler = handlerRef.current;
|
|
3755
|
-
const handler = new
|
|
3735
|
+
const handler = new chunkTDUDH7S4_js.PptxHandler();
|
|
3756
3736
|
const parsed = await handler.load(buffer);
|
|
3757
3737
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3758
3738
|
handler.dispose();
|
|
@@ -3764,7 +3744,7 @@ function useLoadContent({
|
|
|
3764
3744
|
handlerRef.current = null;
|
|
3765
3745
|
const mediaElements = [];
|
|
3766
3746
|
for (const slide of parsed.slides) {
|
|
3767
|
-
|
|
3747
|
+
chunkTDUDH7S4_js.collectMediaElements(slide.elements, mediaElements);
|
|
3768
3748
|
}
|
|
3769
3749
|
for (const url of mediaDataUrls.values()) {
|
|
3770
3750
|
if (url.startsWith("blob:")) {
|
|
@@ -3805,7 +3785,7 @@ function useLoadContent({
|
|
|
3805
3785
|
}
|
|
3806
3786
|
})
|
|
3807
3787
|
);
|
|
3808
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3788
|
+
const { paths: imagePaths, refs: imageRefs } = chunkTDUDH7S4_js.collectImagePaths(parsed.slides);
|
|
3809
3789
|
let nextSlides = parsed.slides;
|
|
3810
3790
|
if (imagePaths.size > 0) {
|
|
3811
3791
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3860,12 +3840,12 @@ function useLoadContent({
|
|
|
3860
3840
|
}
|
|
3861
3841
|
}
|
|
3862
3842
|
handlerRef.current = handler;
|
|
3863
|
-
const partition =
|
|
3843
|
+
const partition = chunkLE6YA5WB_js.partitionTemplateElements(nextSlides);
|
|
3864
3844
|
setSlides(partition.slides);
|
|
3865
3845
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3866
3846
|
setCanvasSize({
|
|
3867
|
-
width: parsed.width ??
|
|
3868
|
-
height: parsed.height ??
|
|
3847
|
+
width: parsed.width ?? chunkLE6YA5WB_js.DEFAULT_CANVAS_WIDTH,
|
|
3848
|
+
height: parsed.height ?? chunkLE6YA5WB_js.DEFAULT_CANVAS_HEIGHT
|
|
3869
3849
|
});
|
|
3870
3850
|
setHeaderFooter(parsed.headerFooter ?? {});
|
|
3871
3851
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
@@ -3894,7 +3874,7 @@ function useLoadContent({
|
|
|
3894
3874
|
setHasMacros(parsed.hasMacros === true);
|
|
3895
3875
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3896
3876
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3897
|
-
setGuides(
|
|
3877
|
+
setGuides(chunkTDUDH7S4_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3898
3878
|
setActiveSlideIndex(0);
|
|
3899
3879
|
clearSelection();
|
|
3900
3880
|
setIsDirty(false);
|
|
@@ -3902,7 +3882,7 @@ function useLoadContent({
|
|
|
3902
3882
|
onContentApplied?.();
|
|
3903
3883
|
} catch (err) {
|
|
3904
3884
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3905
|
-
if (err instanceof
|
|
3885
|
+
if (err instanceof chunkTDUDH7S4_js.EncryptedFileError) {
|
|
3906
3886
|
setIsEncrypted(true);
|
|
3907
3887
|
} else {
|
|
3908
3888
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3979,7 +3959,7 @@ function useAutosave(input) {
|
|
|
3979
3959
|
isSavingRef.current = false;
|
|
3980
3960
|
return;
|
|
3981
3961
|
}
|
|
3982
|
-
await
|
|
3962
|
+
await chunkTDUDH7S4_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
3983
3963
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
3984
3964
|
} catch (err) {
|
|
3985
3965
|
setAutosaveStatus({
|
|
@@ -4044,7 +4024,7 @@ function useElementOperations(input) {
|
|
|
4044
4024
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
4045
4025
|
const updateElementById = react.useCallback(
|
|
4046
4026
|
(elementId, updates) => {
|
|
4047
|
-
if (
|
|
4027
|
+
if (chunkTDUDH7S4_js.isTemplateElementId(elementId)) {
|
|
4048
4028
|
const slideId = activeSlide?.id;
|
|
4049
4029
|
if (slideId) {
|
|
4050
4030
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4084,7 +4064,7 @@ function useElementOperations(input) {
|
|
|
4084
4064
|
);
|
|
4085
4065
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4086
4066
|
(updates) => {
|
|
4087
|
-
if (!selectedElement || !
|
|
4067
|
+
if (!selectedElement || !chunkTDUDH7S4_js.hasShapeProperties(selectedElement)) {
|
|
4088
4068
|
return;
|
|
4089
4069
|
}
|
|
4090
4070
|
updateSelectedElement({
|
|
@@ -4095,17 +4075,17 @@ function useElementOperations(input) {
|
|
|
4095
4075
|
);
|
|
4096
4076
|
const updateSelectedTextStyle = react.useCallback(
|
|
4097
4077
|
(updates) => {
|
|
4098
|
-
if (!selectedElement || !
|
|
4078
|
+
if (!selectedElement || !chunkTDUDH7S4_js.hasTextProperties(selectedElement)) {
|
|
4099
4079
|
return;
|
|
4100
4080
|
}
|
|
4101
|
-
const inlineSel =
|
|
4081
|
+
const inlineSel = chunkTDUDH7S4_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4102
4082
|
if (inlineSel && selectedElement.textSegments) {
|
|
4103
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4083
|
+
const { newSegments: newSegments2, newSelection } = chunkTDUDH7S4_js.applyStyleToSelectedSegments(
|
|
4104
4084
|
selectedElement.textSegments,
|
|
4105
4085
|
inlineSel,
|
|
4106
4086
|
updates
|
|
4107
4087
|
);
|
|
4108
|
-
|
|
4088
|
+
chunkTDUDH7S4_js.setPendingSelectionRestore(newSelection);
|
|
4109
4089
|
updateSelectedElement({
|
|
4110
4090
|
textSegments: newSegments2
|
|
4111
4091
|
});
|
|
@@ -4125,12 +4105,12 @@ function useElementOperations(input) {
|
|
|
4125
4105
|
);
|
|
4126
4106
|
const updateSelectedTextCase = react.useCallback(
|
|
4127
4107
|
(mode) => {
|
|
4128
|
-
if (!selectedElement || !
|
|
4108
|
+
if (!selectedElement || !chunkTDUDH7S4_js.hasTextProperties(selectedElement)) {
|
|
4129
4109
|
return;
|
|
4130
4110
|
}
|
|
4131
|
-
const inlineSel =
|
|
4111
|
+
const inlineSel = chunkTDUDH7S4_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4132
4112
|
if (inlineSel && selectedElement.textSegments) {
|
|
4133
|
-
const newSegments =
|
|
4113
|
+
const newSegments = chunkTDUDH7S4_js.applyCaseTransformToSegments(
|
|
4134
4114
|
selectedElement.textSegments,
|
|
4135
4115
|
inlineSel,
|
|
4136
4116
|
mode
|
|
@@ -4140,14 +4120,14 @@ function useElementOperations(input) {
|
|
|
4140
4120
|
}
|
|
4141
4121
|
const updates = {};
|
|
4142
4122
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4143
|
-
updates.textSegments =
|
|
4123
|
+
updates.textSegments = chunkTDUDH7S4_js.applyCaseTransformToSegments(
|
|
4144
4124
|
selectedElement.textSegments,
|
|
4145
4125
|
null,
|
|
4146
4126
|
mode
|
|
4147
4127
|
);
|
|
4148
4128
|
}
|
|
4149
4129
|
if (typeof selectedElement.text === "string") {
|
|
4150
|
-
updates.text =
|
|
4130
|
+
updates.text = chunkTDUDH7S4_js.transformTextCase(selectedElement.text, mode);
|
|
4151
4131
|
}
|
|
4152
4132
|
updateSelectedElement(updates);
|
|
4153
4133
|
},
|
|
@@ -4202,7 +4182,7 @@ function useSectionOperations(input) {
|
|
|
4202
4182
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4203
4183
|
const addSection2 = react.useCallback(
|
|
4204
4184
|
(name, afterSlideIndex) => {
|
|
4205
|
-
const result =
|
|
4185
|
+
const result = chunkTDUDH7S4_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4206
4186
|
setSlides(result.slides);
|
|
4207
4187
|
setSections(result.sections);
|
|
4208
4188
|
markDirty();
|
|
@@ -4211,7 +4191,7 @@ function useSectionOperations(input) {
|
|
|
4211
4191
|
);
|
|
4212
4192
|
const renameSection2 = react.useCallback(
|
|
4213
4193
|
(sectionId, newName) => {
|
|
4214
|
-
const result =
|
|
4194
|
+
const result = chunkTDUDH7S4_js.renameSection(sections, slides, sectionId, newName);
|
|
4215
4195
|
setSections(result.sections);
|
|
4216
4196
|
setSlides(result.slides);
|
|
4217
4197
|
markDirty();
|
|
@@ -4220,7 +4200,7 @@ function useSectionOperations(input) {
|
|
|
4220
4200
|
);
|
|
4221
4201
|
const deleteSection2 = react.useCallback(
|
|
4222
4202
|
(sectionId) => {
|
|
4223
|
-
const result =
|
|
4203
|
+
const result = chunkTDUDH7S4_js.deleteSection(sections, slides, sectionId);
|
|
4224
4204
|
setSections(result.sections);
|
|
4225
4205
|
setSlides(result.slides);
|
|
4226
4206
|
markDirty();
|
|
@@ -4229,21 +4209,21 @@ function useSectionOperations(input) {
|
|
|
4229
4209
|
);
|
|
4230
4210
|
const moveSectionUp2 = react.useCallback(
|
|
4231
4211
|
(sectionId) => {
|
|
4232
|
-
setSections(
|
|
4212
|
+
setSections(chunkTDUDH7S4_js.moveSectionUp(sections, sectionId));
|
|
4233
4213
|
markDirty();
|
|
4234
4214
|
},
|
|
4235
4215
|
[sections, setSections, markDirty]
|
|
4236
4216
|
);
|
|
4237
4217
|
const moveSectionDown2 = react.useCallback(
|
|
4238
4218
|
(sectionId) => {
|
|
4239
|
-
setSections(
|
|
4219
|
+
setSections(chunkTDUDH7S4_js.moveSectionDown(sections, sectionId));
|
|
4240
4220
|
markDirty();
|
|
4241
4221
|
},
|
|
4242
4222
|
[sections, setSections, markDirty]
|
|
4243
4223
|
);
|
|
4244
4224
|
const moveSlidesToSection2 = react.useCallback(
|
|
4245
4225
|
(slideIndexes, targetSectionId) => {
|
|
4246
|
-
const result =
|
|
4226
|
+
const result = chunkTDUDH7S4_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4247
4227
|
setSlides(result.slides);
|
|
4248
4228
|
setSections(result.sections);
|
|
4249
4229
|
markDirty();
|
|
@@ -4262,19 +4242,19 @@ function useSectionOperations(input) {
|
|
|
4262
4242
|
|
|
4263
4243
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4264
4244
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4265
|
-
const resized =
|
|
4245
|
+
const resized = chunkTDUDH7S4_js.applyResize(
|
|
4266
4246
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4267
4247
|
handle,
|
|
4268
4248
|
dx,
|
|
4269
4249
|
dy,
|
|
4270
4250
|
1,
|
|
4271
|
-
{ minSize:
|
|
4251
|
+
{ minSize: chunkLE6YA5WB_js.MIN_ELEMENT_SIZE }
|
|
4272
4252
|
);
|
|
4273
4253
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4274
4254
|
if (!snapToGrid) {
|
|
4275
4255
|
return box;
|
|
4276
4256
|
}
|
|
4277
|
-
return
|
|
4257
|
+
return chunkTDUDH7S4_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkLE6YA5WB_js.MIN_ELEMENT_SIZE);
|
|
4278
4258
|
}
|
|
4279
4259
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
4280
4260
|
const range = startWidth || 200;
|
|
@@ -4392,7 +4372,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4392
4372
|
width: el.width,
|
|
4393
4373
|
height: el.height
|
|
4394
4374
|
}));
|
|
4395
|
-
const snapResult =
|
|
4375
|
+
const snapResult = chunkTDUDH7S4_js.computeSnapToShape(
|
|
4396
4376
|
targetX,
|
|
4397
4377
|
targetY,
|
|
4398
4378
|
primaryEl.width,
|
|
@@ -4431,7 +4411,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4431
4411
|
if (live) {
|
|
4432
4412
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4433
4413
|
const start = drag.startPositionsById[id];
|
|
4434
|
-
|
|
4414
|
+
chunkTDUDH7S4_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4435
4415
|
x: start.x + appliedDx,
|
|
4436
4416
|
y: start.y + appliedDy
|
|
4437
4417
|
});
|
|
@@ -4465,15 +4445,15 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4465
4445
|
if (rs.domEl) {
|
|
4466
4446
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4467
4447
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4468
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4469
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4448
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunkLE6YA5WB_js.MIN_ELEMENT_SIZE)}px`;
|
|
4449
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunkLE6YA5WB_js.MIN_ELEMENT_SIZE)}px`;
|
|
4470
4450
|
}
|
|
4471
4451
|
if (live) {
|
|
4472
|
-
|
|
4452
|
+
chunkTDUDH7S4_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4473
4453
|
x: geo.x,
|
|
4474
4454
|
y: geo.y,
|
|
4475
|
-
width: Math.max(geo.width,
|
|
4476
|
-
height: Math.max(geo.height,
|
|
4455
|
+
width: Math.max(geo.width, chunkLE6YA5WB_js.MIN_ELEMENT_SIZE),
|
|
4456
|
+
height: Math.max(geo.height, chunkLE6YA5WB_js.MIN_ELEMENT_SIZE)
|
|
4477
4457
|
});
|
|
4478
4458
|
}
|
|
4479
4459
|
}
|
|
@@ -4553,13 +4533,13 @@ function processPointerUp(input) {
|
|
|
4553
4533
|
if (i !== activeSlideIndex) {
|
|
4554
4534
|
return s;
|
|
4555
4535
|
}
|
|
4556
|
-
const rerouted =
|
|
4536
|
+
const rerouted = chunkTDUDH7S4_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4557
4537
|
if (rerouted.length === 0) {
|
|
4558
4538
|
return s;
|
|
4559
4539
|
}
|
|
4560
4540
|
return {
|
|
4561
4541
|
...s,
|
|
4562
|
-
elements:
|
|
4542
|
+
elements: chunkTDUDH7S4_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4563
4543
|
};
|
|
4564
4544
|
})
|
|
4565
4545
|
);
|
|
@@ -4581,9 +4561,9 @@ function processPointerUp(input) {
|
|
|
4581
4561
|
}
|
|
4582
4562
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4583
4563
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4584
|
-
const hitIds =
|
|
4564
|
+
const hitIds = chunkTDUDH7S4_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4585
4565
|
if (marquee.additive) {
|
|
4586
|
-
const merged =
|
|
4566
|
+
const merged = chunkTDUDH7S4_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4587
4567
|
if (merged.length > 0) {
|
|
4588
4568
|
applySelection(merged[0], merged);
|
|
4589
4569
|
} else {
|
|
@@ -4606,8 +4586,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4606
4586
|
}
|
|
4607
4587
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4608
4588
|
});
|
|
4609
|
-
const rerouted =
|
|
4610
|
-
return
|
|
4589
|
+
const rerouted = chunkTDUDH7S4_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4590
|
+
return chunkTDUDH7S4_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4611
4591
|
};
|
|
4612
4592
|
if (editTemplateMode) {
|
|
4613
4593
|
const slideId = activeSlide?.id;
|
|
@@ -4763,9 +4743,9 @@ function useCanvasInteractions(input) {
|
|
|
4763
4743
|
return;
|
|
4764
4744
|
}
|
|
4765
4745
|
const el = elementLookup.get(editId);
|
|
4766
|
-
if (el &&
|
|
4746
|
+
if (el && chunkTDUDH7S4_js.hasTextProperties(el)) {
|
|
4767
4747
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4768
|
-
const newSegments =
|
|
4748
|
+
const newSegments = chunkTDUDH7S4_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4769
4749
|
ops.updateElementById(editId, {
|
|
4770
4750
|
text: committedText,
|
|
4771
4751
|
textSegments: newSegments
|
|
@@ -4776,7 +4756,7 @@ function useCanvasInteractions(input) {
|
|
|
4776
4756
|
setInlineEditingText("");
|
|
4777
4757
|
};
|
|
4778
4758
|
const openEquationEditorForElement = (el) => {
|
|
4779
|
-
if (!
|
|
4759
|
+
if (!chunkTDUDH7S4_js.hasTextProperties(el)) {
|
|
4780
4760
|
return false;
|
|
4781
4761
|
}
|
|
4782
4762
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4805,7 +4785,7 @@ function useCanvasInteractions(input) {
|
|
|
4805
4785
|
justSelectedRef.current = false;
|
|
4806
4786
|
} else {
|
|
4807
4787
|
const el = elementLookup.get(elementId);
|
|
4808
|
-
if (el &&
|
|
4788
|
+
if (el && chunkTDUDH7S4_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
4809
4789
|
if (!openEquationEditorForElement(el)) {
|
|
4810
4790
|
setInlineEditingElementId(elementId);
|
|
4811
4791
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4824,7 +4804,7 @@ function useCanvasInteractions(input) {
|
|
|
4824
4804
|
if (openEquationEditorForElement(el)) {
|
|
4825
4805
|
return;
|
|
4826
4806
|
}
|
|
4827
|
-
if (
|
|
4807
|
+
if (chunkTDUDH7S4_js.hasTextProperties(el)) {
|
|
4828
4808
|
setInlineEditingElementId(elementId);
|
|
4829
4809
|
setInlineEditingText(el.text ?? "");
|
|
4830
4810
|
}
|
|
@@ -5017,7 +4997,7 @@ function createFileHandlers(deps) {
|
|
|
5017
4997
|
h = Math.round(h * scale);
|
|
5018
4998
|
}
|
|
5019
4999
|
addElement({
|
|
5020
|
-
id:
|
|
5000
|
+
id: chunkTDUDH7S4_js.generateElementId(),
|
|
5021
5001
|
type: "image",
|
|
5022
5002
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5023
5003
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5028,7 +5008,7 @@ function createFileHandlers(deps) {
|
|
|
5028
5008
|
};
|
|
5029
5009
|
img.onerror = () => {
|
|
5030
5010
|
addElement({
|
|
5031
|
-
id:
|
|
5011
|
+
id: chunkTDUDH7S4_js.generateElementId(),
|
|
5032
5012
|
type: "image",
|
|
5033
5013
|
x: 100,
|
|
5034
5014
|
y: 100,
|
|
@@ -5054,7 +5034,7 @@ function createFileHandlers(deps) {
|
|
|
5054
5034
|
const elFilePath = file.path;
|
|
5055
5035
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5056
5036
|
addElement({
|
|
5057
|
-
id:
|
|
5037
|
+
id: chunkTDUDH7S4_js.generateElementId(),
|
|
5058
5038
|
type: "media",
|
|
5059
5039
|
mediaType,
|
|
5060
5040
|
mediaMimeType: file.type || void 0,
|
|
@@ -5229,13 +5209,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5229
5209
|
return;
|
|
5230
5210
|
}
|
|
5231
5211
|
addElement({
|
|
5232
|
-
id:
|
|
5212
|
+
id: chunkTDUDH7S4_js.generateElementId(),
|
|
5233
5213
|
type: "smartArt",
|
|
5234
5214
|
x: 100,
|
|
5235
5215
|
y: 120,
|
|
5236
5216
|
width: 600,
|
|
5237
5217
|
height: 340,
|
|
5238
|
-
smartArtData:
|
|
5218
|
+
smartArtData: chunkTDUDH7S4_js.buildSmartArtPresetData(
|
|
5239
5219
|
layout,
|
|
5240
5220
|
defaultItems,
|
|
5241
5221
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5247,7 +5227,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5247
5227
|
return;
|
|
5248
5228
|
}
|
|
5249
5229
|
addElement({
|
|
5250
|
-
id:
|
|
5230
|
+
id: chunkTDUDH7S4_js.generateElementId(),
|
|
5251
5231
|
type: "shape",
|
|
5252
5232
|
x: 120,
|
|
5253
5233
|
y: 200,
|
|
@@ -5306,7 +5286,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5306
5286
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5307
5287
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5308
5288
|
addElement({
|
|
5309
|
-
id:
|
|
5289
|
+
id: chunkTDUDH7S4_js.generateElementId(),
|
|
5310
5290
|
type: "shape",
|
|
5311
5291
|
x: 120,
|
|
5312
5292
|
y: 200,
|
|
@@ -5328,11 +5308,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5328
5308
|
if (!activeSlide) {
|
|
5329
5309
|
return;
|
|
5330
5310
|
}
|
|
5331
|
-
const preset =
|
|
5311
|
+
const preset = chunkTDUDH7S4_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5332
5312
|
if (!preset) {
|
|
5333
5313
|
return;
|
|
5334
5314
|
}
|
|
5335
|
-
const defaultPptxAction =
|
|
5315
|
+
const defaultPptxAction = chunkTDUDH7S4_js.elementActionToPptxAction({
|
|
5336
5316
|
trigger: "click",
|
|
5337
5317
|
type: preset.defaultAction
|
|
5338
5318
|
});
|
|
@@ -5341,7 +5321,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5341
5321
|
defaultPptxAction.highlightClick = true;
|
|
5342
5322
|
}
|
|
5343
5323
|
addElement({
|
|
5344
|
-
id:
|
|
5324
|
+
id: chunkTDUDH7S4_js.generateElementId(),
|
|
5345
5325
|
type: "shape",
|
|
5346
5326
|
x: 150,
|
|
5347
5327
|
y: 150,
|
|
@@ -5408,14 +5388,14 @@ function useInsertElements(input) {
|
|
|
5408
5388
|
return;
|
|
5409
5389
|
}
|
|
5410
5390
|
addElement({
|
|
5411
|
-
id:
|
|
5391
|
+
id: chunkTDUDH7S4_js.generateElementId(),
|
|
5412
5392
|
type: "text",
|
|
5413
5393
|
x: 100,
|
|
5414
5394
|
y: 100,
|
|
5415
5395
|
width: 300,
|
|
5416
5396
|
height: 60,
|
|
5417
5397
|
text: "",
|
|
5418
|
-
textStyle: { fontSize:
|
|
5398
|
+
textStyle: { fontSize: chunkLE6YA5WB_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5419
5399
|
});
|
|
5420
5400
|
};
|
|
5421
5401
|
const handleAddShape = () => {
|
|
@@ -5423,7 +5403,7 @@ function useInsertElements(input) {
|
|
|
5423
5403
|
return;
|
|
5424
5404
|
}
|
|
5425
5405
|
addElement({
|
|
5426
|
-
id:
|
|
5406
|
+
id: chunkTDUDH7S4_js.generateElementId(),
|
|
5427
5407
|
type: "shape",
|
|
5428
5408
|
x: 150,
|
|
5429
5409
|
y: 150,
|
|
@@ -5442,15 +5422,15 @@ function useInsertElements(input) {
|
|
|
5442
5422
|
return;
|
|
5443
5423
|
}
|
|
5444
5424
|
addElement({
|
|
5445
|
-
...
|
|
5446
|
-
id:
|
|
5425
|
+
...chunkTDUDH7S4_js.newTableElement(chunkLE6YA5WB_js.DEFAULT_TABLE_ROWS, chunkLE6YA5WB_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5426
|
+
id: chunkTDUDH7S4_js.generateElementId()
|
|
5447
5427
|
});
|
|
5448
5428
|
};
|
|
5449
5429
|
const handleAddChart = (chartType) => {
|
|
5450
5430
|
if (!activeSlide) {
|
|
5451
5431
|
return;
|
|
5452
5432
|
}
|
|
5453
|
-
addElement(
|
|
5433
|
+
addElement(chunkTDUDH7S4_js.createDefaultChartElement(chartType));
|
|
5454
5434
|
};
|
|
5455
5435
|
const structured = createStructuredElementHandlers({
|
|
5456
5436
|
activeSlide,
|
|
@@ -5520,7 +5500,7 @@ function useClipboardHandlers(input) {
|
|
|
5520
5500
|
if (!selectedElement) {
|
|
5521
5501
|
return;
|
|
5522
5502
|
}
|
|
5523
|
-
setClipboardPayload(
|
|
5503
|
+
setClipboardPayload(chunkTDUDH7S4_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5524
5504
|
};
|
|
5525
5505
|
const handleDelete = () => {
|
|
5526
5506
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5537,7 +5517,7 @@ function useClipboardHandlers(input) {
|
|
|
5537
5517
|
handleDelete();
|
|
5538
5518
|
};
|
|
5539
5519
|
const insertClone = (source) => {
|
|
5540
|
-
const clone =
|
|
5520
|
+
const clone = chunkTDUDH7S4_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5541
5521
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5542
5522
|
ops.applySelection(clone.id);
|
|
5543
5523
|
history.markDirty();
|
|
@@ -5572,7 +5552,7 @@ function resolveShapePath(el) {
|
|
|
5572
5552
|
return el.pathData;
|
|
5573
5553
|
}
|
|
5574
5554
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5575
|
-
const clipPath =
|
|
5555
|
+
const clipPath = chunkTDUDH7S4_js.getPresetShapeClipPath(el.shapeType);
|
|
5576
5556
|
if (clipPath) {
|
|
5577
5557
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5578
5558
|
if (svgPath) {
|
|
@@ -5623,7 +5603,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5623
5603
|
return parts.join(" ");
|
|
5624
5604
|
}
|
|
5625
5605
|
function transformPathToGlobal(pathData, el) {
|
|
5626
|
-
const polys =
|
|
5606
|
+
const polys = chunkTDUDH7S4_js.svgPathToPolygons(pathData);
|
|
5627
5607
|
if (polys.length === 0) {
|
|
5628
5608
|
return pathData;
|
|
5629
5609
|
}
|
|
@@ -5643,10 +5623,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5643
5623
|
y: pt.y * scaleY + el.y
|
|
5644
5624
|
}))
|
|
5645
5625
|
);
|
|
5646
|
-
return
|
|
5626
|
+
return chunkTDUDH7S4_js.polygonsToSvgPath(transformed);
|
|
5647
5627
|
}
|
|
5648
5628
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5649
|
-
const polys =
|
|
5629
|
+
const polys = chunkTDUDH7S4_js.svgPathToPolygons(pathData);
|
|
5650
5630
|
if (polys.length === 0) {
|
|
5651
5631
|
return pathData;
|
|
5652
5632
|
}
|
|
@@ -5656,10 +5636,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5656
5636
|
y: pt.y - y
|
|
5657
5637
|
}))
|
|
5658
5638
|
);
|
|
5659
|
-
return
|
|
5639
|
+
return chunkTDUDH7S4_js.polygonsToSvgPath(transformed);
|
|
5660
5640
|
}
|
|
5661
5641
|
function pathBounds(pathData) {
|
|
5662
|
-
const polys =
|
|
5642
|
+
const polys = chunkTDUDH7S4_js.svgPathToPolygons(pathData);
|
|
5663
5643
|
let minX = Infinity;
|
|
5664
5644
|
let minY = Infinity;
|
|
5665
5645
|
let maxX = -Infinity;
|
|
@@ -5718,7 +5698,7 @@ function useMergeShapesHandler(input) {
|
|
|
5718
5698
|
let allFragments = [];
|
|
5719
5699
|
let remaining = globalPaths[0];
|
|
5720
5700
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5721
|
-
const frags =
|
|
5701
|
+
const frags = chunkTDUDH7S4_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5722
5702
|
if (Array.isArray(frags)) {
|
|
5723
5703
|
allFragments = frags;
|
|
5724
5704
|
}
|
|
@@ -5747,7 +5727,7 @@ function useMergeShapesHandler(input) {
|
|
|
5747
5727
|
bounds.height
|
|
5748
5728
|
);
|
|
5749
5729
|
const newEl = {
|
|
5750
|
-
id:
|
|
5730
|
+
id: chunkTDUDH7S4_js.generateElementId(),
|
|
5751
5731
|
type: "shape",
|
|
5752
5732
|
x: bounds.x,
|
|
5753
5733
|
y: bounds.y,
|
|
@@ -5785,7 +5765,7 @@ function useMergeShapesHandler(input) {
|
|
|
5785
5765
|
} else {
|
|
5786
5766
|
let resultPath = globalPaths[0];
|
|
5787
5767
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5788
|
-
const result =
|
|
5768
|
+
const result = chunkTDUDH7S4_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5789
5769
|
if (typeof result === "string") {
|
|
5790
5770
|
resultPath = result;
|
|
5791
5771
|
}
|
|
@@ -5806,7 +5786,7 @@ function useMergeShapesHandler(input) {
|
|
|
5806
5786
|
);
|
|
5807
5787
|
const primary = targets[0];
|
|
5808
5788
|
const newEl = {
|
|
5809
|
-
id:
|
|
5789
|
+
id: chunkTDUDH7S4_js.generateElementId(),
|
|
5810
5790
|
type: "shape",
|
|
5811
5791
|
x: bounds.x,
|
|
5812
5792
|
y: bounds.y,
|
|
@@ -5869,7 +5849,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5869
5849
|
if (ids.length < 2 || !activeSlide) {
|
|
5870
5850
|
return;
|
|
5871
5851
|
}
|
|
5872
|
-
const { elements, groupId } =
|
|
5852
|
+
const { elements, groupId } = chunkTDUDH7S4_js.groupElements(ops.activeElements, ids, chunkTDUDH7S4_js.generateElementId());
|
|
5873
5853
|
if (groupId === null) {
|
|
5874
5854
|
return;
|
|
5875
5855
|
}
|
|
@@ -5882,12 +5862,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5882
5862
|
return;
|
|
5883
5863
|
}
|
|
5884
5864
|
const group = selectedElement;
|
|
5885
|
-
const intoTemplate =
|
|
5865
|
+
const intoTemplate = chunkTDUDH7S4_js.isTemplateElementId(group.id);
|
|
5886
5866
|
const ungrouped = group.children.map((child) => ({
|
|
5887
5867
|
...structuredClone(child),
|
|
5888
5868
|
// Keep child ids in the same store as the group so later edits route
|
|
5889
5869
|
// correctly: template groups yield template-prefixed child ids.
|
|
5890
|
-
id: intoTemplate ?
|
|
5870
|
+
id: intoTemplate ? chunkTDUDH7S4_js.makeCloneId(true, child.id || group.id) : child.id || chunkTDUDH7S4_js.generateElementId(),
|
|
5891
5871
|
x: child.x + group.x,
|
|
5892
5872
|
y: child.y + group.y
|
|
5893
5873
|
}));
|
|
@@ -5911,7 +5891,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5911
5891
|
if (!edge) {
|
|
5912
5892
|
return;
|
|
5913
5893
|
}
|
|
5914
|
-
const positions =
|
|
5894
|
+
const positions = chunkTDUDH7S4_js.alignElements(selectedElements, edge);
|
|
5915
5895
|
for (const [id, pos] of positions) {
|
|
5916
5896
|
const el = elementLookup.get(id);
|
|
5917
5897
|
if (!el) {
|
|
@@ -5929,7 +5909,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5929
5909
|
if (!distAxis) {
|
|
5930
5910
|
return;
|
|
5931
5911
|
}
|
|
5932
|
-
const positions =
|
|
5912
|
+
const positions = chunkTDUDH7S4_js.distributeElements(selectedElements, distAxis);
|
|
5933
5913
|
for (const [id, pos] of positions) {
|
|
5934
5914
|
const el = elementLookup.get(id);
|
|
5935
5915
|
if (!el) {
|
|
@@ -5946,7 +5926,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5946
5926
|
}
|
|
5947
5927
|
const id = selectedElement.id;
|
|
5948
5928
|
ops.updateActiveElements(
|
|
5949
|
-
(els) => direction === "forward" ?
|
|
5929
|
+
(els) => direction === "forward" ? chunkTDUDH7S4_js.bringForward(els, id) : direction === "backward" ? chunkTDUDH7S4_js.sendBackward(els, id) : els
|
|
5950
5930
|
);
|
|
5951
5931
|
history.markDirty();
|
|
5952
5932
|
};
|
|
@@ -5956,7 +5936,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5956
5936
|
}
|
|
5957
5937
|
const id = selectedElement.id;
|
|
5958
5938
|
ops.updateActiveElements(
|
|
5959
|
-
(els) => direction === "front" ?
|
|
5939
|
+
(els) => direction === "front" ? chunkTDUDH7S4_js.bringToFront(els, id) : chunkTDUDH7S4_js.sendToBack(els, id)
|
|
5960
5940
|
);
|
|
5961
5941
|
history.markDirty();
|
|
5962
5942
|
};
|
|
@@ -6078,7 +6058,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
6078
6058
|
function useSlideManagement(input) {
|
|
6079
6059
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
6080
6060
|
const handleAddSlide = () => {
|
|
6081
|
-
const newSlide =
|
|
6061
|
+
const newSlide = chunkTDUDH7S4_js.createBlankSlide(slides.length + 1);
|
|
6082
6062
|
ops.updateSlides((prev) => {
|
|
6083
6063
|
const next = [...prev];
|
|
6084
6064
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6141,7 +6121,7 @@ function useSlideManagement(input) {
|
|
|
6141
6121
|
}
|
|
6142
6122
|
const clone = {
|
|
6143
6123
|
...src,
|
|
6144
|
-
id:
|
|
6124
|
+
id: chunkTDUDH7S4_js.makeSlideId(),
|
|
6145
6125
|
elements: src.elements.map((el) => ({
|
|
6146
6126
|
...el,
|
|
6147
6127
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6173,7 +6153,7 @@ function useSlideManagement(input) {
|
|
|
6173
6153
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6174
6154
|
const insertAt = activeSlideIndex + 1;
|
|
6175
6155
|
const draft = {
|
|
6176
|
-
...
|
|
6156
|
+
...chunkTDUDH7S4_js.createBlankSlide(slides.length + 1),
|
|
6177
6157
|
layoutPath,
|
|
6178
6158
|
...layoutName ? { layoutName } : {}
|
|
6179
6159
|
};
|
|
@@ -6234,7 +6214,7 @@ function createTableMergeHandlers(input) {
|
|
|
6234
6214
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6235
6215
|
return;
|
|
6236
6216
|
}
|
|
6237
|
-
const newTableData =
|
|
6217
|
+
const newTableData = chunkTDUDH7S4_js.mergeCells(
|
|
6238
6218
|
[
|
|
6239
6219
|
{ row: rowIndex, col: columnIndex },
|
|
6240
6220
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6242,7 +6222,7 @@ function createTableMergeHandlers(input) {
|
|
|
6242
6222
|
td
|
|
6243
6223
|
);
|
|
6244
6224
|
const updates = { tableData: newTableData };
|
|
6245
|
-
const newRawXml =
|
|
6225
|
+
const newRawXml = chunkTDUDH7S4_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6246
6226
|
if (newRawXml) {
|
|
6247
6227
|
updates.rawXml = newRawXml;
|
|
6248
6228
|
}
|
|
@@ -6268,7 +6248,7 @@ function createTableMergeHandlers(input) {
|
|
|
6268
6248
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6269
6249
|
return;
|
|
6270
6250
|
}
|
|
6271
|
-
const newTableData =
|
|
6251
|
+
const newTableData = chunkTDUDH7S4_js.mergeCells(
|
|
6272
6252
|
[
|
|
6273
6253
|
{ row: rowIndex, col: columnIndex },
|
|
6274
6254
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6276,7 +6256,7 @@ function createTableMergeHandlers(input) {
|
|
|
6276
6256
|
td
|
|
6277
6257
|
);
|
|
6278
6258
|
const updates = { tableData: newTableData };
|
|
6279
|
-
const newRawXml =
|
|
6259
|
+
const newRawXml = chunkTDUDH7S4_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6280
6260
|
if (newRawXml) {
|
|
6281
6261
|
updates.rawXml = newRawXml;
|
|
6282
6262
|
}
|
|
@@ -6291,9 +6271,9 @@ function createTableMergeHandlers(input) {
|
|
|
6291
6271
|
return;
|
|
6292
6272
|
}
|
|
6293
6273
|
const td = selectedElement.tableData;
|
|
6294
|
-
const newTableData =
|
|
6274
|
+
const newTableData = chunkTDUDH7S4_js.mergeCells(ts.selectedCells, td);
|
|
6295
6275
|
const updates = { tableData: newTableData };
|
|
6296
|
-
const newRawXml =
|
|
6276
|
+
const newRawXml = chunkTDUDH7S4_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6297
6277
|
if (newRawXml) {
|
|
6298
6278
|
updates.rawXml = newRawXml;
|
|
6299
6279
|
}
|
|
@@ -6310,9 +6290,9 @@ function createTableMergeHandlers(input) {
|
|
|
6310
6290
|
}
|
|
6311
6291
|
const { rowIndex, columnIndex } = ts;
|
|
6312
6292
|
const td = selectedElement.tableData;
|
|
6313
|
-
const newTableData =
|
|
6293
|
+
const newTableData = chunkTDUDH7S4_js.splitCell(rowIndex, columnIndex, td);
|
|
6314
6294
|
const updates = { tableData: newTableData };
|
|
6315
|
-
const newRawXml =
|
|
6295
|
+
const newRawXml = chunkTDUDH7S4_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6316
6296
|
if (newRawXml) {
|
|
6317
6297
|
updates.rawXml = newRawXml;
|
|
6318
6298
|
}
|
|
@@ -6356,7 +6336,7 @@ function createTableStructHandlers(input) {
|
|
|
6356
6336
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
6357
6337
|
}
|
|
6358
6338
|
if (el.rawXml) {
|
|
6359
|
-
const newRawXml =
|
|
6339
|
+
const newRawXml = chunkTDUDH7S4_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6360
6340
|
if (newRawXml) {
|
|
6361
6341
|
updates.rawXml = newRawXml;
|
|
6362
6342
|
}
|
|
@@ -6380,7 +6360,7 @@ function createTableStructHandlers(input) {
|
|
|
6380
6360
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6381
6361
|
const updates = {};
|
|
6382
6362
|
if (selectedElement.rawXml) {
|
|
6383
|
-
const newRawXml =
|
|
6363
|
+
const newRawXml = chunkTDUDH7S4_js.updateCellTextStyleInRawXml(
|
|
6384
6364
|
selectedElement,
|
|
6385
6365
|
rowIndex,
|
|
6386
6366
|
colIndex,
|
|
@@ -6444,9 +6424,9 @@ function createTableStructHandlers(input) {
|
|
|
6444
6424
|
return;
|
|
6445
6425
|
}
|
|
6446
6426
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6447
|
-
const newTableData =
|
|
6427
|
+
const newTableData = chunkTDUDH7S4_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6448
6428
|
const updates = { tableData: newTableData };
|
|
6449
|
-
const newRawXml =
|
|
6429
|
+
const newRawXml = chunkTDUDH7S4_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6450
6430
|
if (newRawXml) {
|
|
6451
6431
|
updates.rawXml = newRawXml;
|
|
6452
6432
|
}
|
|
@@ -6459,12 +6439,12 @@ function createTableStructHandlers(input) {
|
|
|
6459
6439
|
}
|
|
6460
6440
|
const td = selectedElement.tableData;
|
|
6461
6441
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6462
|
-
const newTableData =
|
|
6442
|
+
const newTableData = chunkTDUDH7S4_js.deleteTableRow(td, rowIdx);
|
|
6463
6443
|
if (newTableData === td) {
|
|
6464
6444
|
return;
|
|
6465
6445
|
}
|
|
6466
6446
|
const updates = { tableData: newTableData };
|
|
6467
|
-
const newRawXml =
|
|
6447
|
+
const newRawXml = chunkTDUDH7S4_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6468
6448
|
if (newRawXml) {
|
|
6469
6449
|
updates.rawXml = newRawXml;
|
|
6470
6450
|
}
|
|
@@ -6476,9 +6456,9 @@ function createTableStructHandlers(input) {
|
|
|
6476
6456
|
return;
|
|
6477
6457
|
}
|
|
6478
6458
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6479
|
-
const newTableData =
|
|
6459
|
+
const newTableData = chunkTDUDH7S4_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6480
6460
|
const updates = { tableData: newTableData };
|
|
6481
|
-
const newRawXml =
|
|
6461
|
+
const newRawXml = chunkTDUDH7S4_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6482
6462
|
if (newRawXml) {
|
|
6483
6463
|
updates.rawXml = newRawXml;
|
|
6484
6464
|
}
|
|
@@ -6491,12 +6471,12 @@ function createTableStructHandlers(input) {
|
|
|
6491
6471
|
}
|
|
6492
6472
|
const td = selectedElement.tableData;
|
|
6493
6473
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6494
|
-
const newTableData =
|
|
6474
|
+
const newTableData = chunkTDUDH7S4_js.deleteTableColumn(td, colIdx);
|
|
6495
6475
|
if (newTableData === td) {
|
|
6496
6476
|
return;
|
|
6497
6477
|
}
|
|
6498
6478
|
const updates = { tableData: newTableData };
|
|
6499
|
-
const newRawXml =
|
|
6479
|
+
const newRawXml = chunkTDUDH7S4_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6500
6480
|
if (newRawXml) {
|
|
6501
6481
|
updates.rawXml = newRawXml;
|
|
6502
6482
|
}
|
|
@@ -6532,8 +6512,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6532
6512
|
return html2canvasPro(element, {
|
|
6533
6513
|
...options,
|
|
6534
6514
|
onclone: async (doc, clonedEl) => {
|
|
6535
|
-
await
|
|
6536
|
-
|
|
6515
|
+
await chunkTDUDH7S4_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6516
|
+
chunkTDUDH7S4_js.preprocessCssForCapture(clonedEl);
|
|
6537
6517
|
if (typeof userOnClone === "function") {
|
|
6538
6518
|
userOnClone(doc, clonedEl);
|
|
6539
6519
|
}
|
|
@@ -6589,7 +6569,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6589
6569
|
}
|
|
6590
6570
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6591
6571
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6592
|
-
|
|
6572
|
+
chunkTDUDH7S4_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6593
6573
|
}
|
|
6594
6574
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6595
6575
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6611,15 +6591,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6611
6591
|
continue;
|
|
6612
6592
|
}
|
|
6613
6593
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6614
|
-
images.push(
|
|
6594
|
+
images.push(chunkTDUDH7S4_js.canvasToJpegData(canvas));
|
|
6615
6595
|
}
|
|
6616
6596
|
onProgress?.(totalSlides, totalSlides);
|
|
6617
6597
|
setActiveSlide(currentSlideIndex);
|
|
6618
6598
|
if (images.length === 0) {
|
|
6619
|
-
throw new Error(
|
|
6599
|
+
throw new Error(chunkBXAK3JFM_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6620
6600
|
}
|
|
6621
|
-
const pdfBlobUrl =
|
|
6622
|
-
|
|
6601
|
+
const pdfBlobUrl = chunkLE6YA5WB_js.buildPdfFromImageData(images);
|
|
6602
|
+
chunkTDUDH7S4_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6623
6603
|
}
|
|
6624
6604
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6625
6605
|
const { scale = 2, onProgress } = options;
|
|
@@ -6665,10 +6645,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6665
6645
|
onProgress?.(totalSlides, totalSlides);
|
|
6666
6646
|
setActiveSlide(currentSlideIndex);
|
|
6667
6647
|
if (pages.length === 0) {
|
|
6668
|
-
throw new Error(
|
|
6648
|
+
throw new Error(chunkBXAK3JFM_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6669
6649
|
}
|
|
6670
|
-
const pdfDataUrl =
|
|
6671
|
-
|
|
6650
|
+
const pdfDataUrl = chunkLE6YA5WB_js.buildNotesPdf(pages);
|
|
6651
|
+
chunkTDUDH7S4_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6672
6652
|
}
|
|
6673
6653
|
|
|
6674
6654
|
// src/viewer/utils/export-video.ts
|
|
@@ -6699,7 +6679,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6699
6679
|
}
|
|
6700
6680
|
setActiveSlide(currentSlideIndex);
|
|
6701
6681
|
if (slideCanvases.length === 0) {
|
|
6702
|
-
throw new Error(
|
|
6682
|
+
throw new Error(chunkBXAK3JFM_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
6703
6683
|
}
|
|
6704
6684
|
const firstCanvas = slideCanvases[0];
|
|
6705
6685
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -6707,12 +6687,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6707
6687
|
recordingCanvas.height = firstCanvas.height;
|
|
6708
6688
|
const ctx = recordingCanvas.getContext("2d");
|
|
6709
6689
|
if (!ctx) {
|
|
6710
|
-
throw new Error(
|
|
6690
|
+
throw new Error(chunkBXAK3JFM_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
6711
6691
|
}
|
|
6712
6692
|
const fps = 30;
|
|
6713
6693
|
const stream = recordingCanvas.captureStream(fps);
|
|
6714
6694
|
const recorder = new MediaRecorder(stream, {
|
|
6715
|
-
mimeType:
|
|
6695
|
+
mimeType: chunkTDUDH7S4_js.pickSupportedMimeType([...chunkTDUDH7S4_js.WEBM_MIME_CANDIDATES]),
|
|
6716
6696
|
videoBitsPerSecond: 5e6
|
|
6717
6697
|
});
|
|
6718
6698
|
const chunks = [];
|
|
@@ -6735,8 +6715,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6735
6715
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6736
6716
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6737
6717
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6738
|
-
const frameInterval =
|
|
6739
|
-
const framesNeeded =
|
|
6718
|
+
const frameInterval = chunkTDUDH7S4_js.fpsToFrameIntervalMs(fps);
|
|
6719
|
+
const framesNeeded = chunkTDUDH7S4_js.segmentFrameCount(duration, fps);
|
|
6740
6720
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6741
6721
|
if (signal?.aborted) {
|
|
6742
6722
|
recorder.stop();
|
|
@@ -6783,9 +6763,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6783
6763
|
}
|
|
6784
6764
|
setActiveSlide(currentSlideIndex);
|
|
6785
6765
|
if (frames.length === 0) {
|
|
6786
|
-
throw new Error(
|
|
6766
|
+
throw new Error(chunkBXAK3JFM_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6787
6767
|
}
|
|
6788
|
-
const gifBytes =
|
|
6768
|
+
const gifBytes = chunkTDUDH7S4_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6789
6769
|
onProgress?.(totalSlides, totalSlides);
|
|
6790
6770
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6791
6771
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6839,7 +6819,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6839
6819
|
continue;
|
|
6840
6820
|
}
|
|
6841
6821
|
onProgress?.(processedCount, data.slides.length);
|
|
6842
|
-
let svg =
|
|
6822
|
+
let svg = chunkTDUDH7S4_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6843
6823
|
if (embedFonts && fontFaces?.length) {
|
|
6844
6824
|
svg = injectFontFaces(svg, fontFaces);
|
|
6845
6825
|
}
|
|
@@ -6899,7 +6879,7 @@ function useExportSaveAs(input) {
|
|
|
6899
6879
|
}
|
|
6900
6880
|
setExportProgress(70);
|
|
6901
6881
|
setExportStatusMessage("Writing README...");
|
|
6902
|
-
const readme =
|
|
6882
|
+
const readme = chunkTDUDH7S4_js.generatePackageReadme(pptxFilename);
|
|
6903
6883
|
pkgFolder.file("README.txt", readme);
|
|
6904
6884
|
if (abortCtrl.signal.aborted) {
|
|
6905
6885
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -6910,7 +6890,7 @@ function useExportSaveAs(input) {
|
|
|
6910
6890
|
setExportProgress(95);
|
|
6911
6891
|
setExportStatusMessage("Downloading...");
|
|
6912
6892
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
6913
|
-
|
|
6893
|
+
chunkTDUDH7S4_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
6914
6894
|
setExportProgress(100);
|
|
6915
6895
|
} catch (err) {
|
|
6916
6896
|
if (err.name !== "AbortError") {
|
|
@@ -6933,7 +6913,7 @@ function useExportSaveAs(input) {
|
|
|
6933
6913
|
const blob = new Blob([data], {
|
|
6934
6914
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6935
6915
|
});
|
|
6936
|
-
|
|
6916
|
+
chunkTDUDH7S4_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
6937
6917
|
} catch (err) {
|
|
6938
6918
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
6939
6919
|
}
|
|
@@ -6946,14 +6926,14 @@ function useExportSaveAs(input) {
|
|
|
6946
6926
|
const pptxGuides = guides.map((g) => ({
|
|
6947
6927
|
id: g.id,
|
|
6948
6928
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
6949
|
-
positionEmu:
|
|
6929
|
+
positionEmu: chunkTDUDH7S4_js.guidePxToEmu(g.position)
|
|
6950
6930
|
}));
|
|
6951
6931
|
return {
|
|
6952
6932
|
...slide,
|
|
6953
6933
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
6954
6934
|
};
|
|
6955
6935
|
});
|
|
6956
|
-
const slidesToSave =
|
|
6936
|
+
const slidesToSave = chunkLE6YA5WB_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
6957
6937
|
const saveOptions = {
|
|
6958
6938
|
headerFooter,
|
|
6959
6939
|
presentationProperties,
|
|
@@ -7010,7 +6990,7 @@ function safeConfirm(message) {
|
|
|
7010
6990
|
}
|
|
7011
6991
|
}
|
|
7012
6992
|
function downloadBlob2(blob, filename) {
|
|
7013
|
-
|
|
6993
|
+
chunkTDUDH7S4_js.downloadBlob(blob, chunkTDUDH7S4_js.sanitizeDownloadFilename(filename));
|
|
7014
6994
|
}
|
|
7015
6995
|
|
|
7016
6996
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7111,21 +7091,21 @@ function useExportHandlers(input) {
|
|
|
7111
7091
|
{
|
|
7112
7092
|
scale: 2,
|
|
7113
7093
|
onProgress: (current, total) => {
|
|
7114
|
-
setExportProgress(
|
|
7115
|
-
setExportStatusMessage(
|
|
7094
|
+
setExportProgress(chunkTDUDH7S4_js.slideProgressPercent(current, total));
|
|
7095
|
+
setExportStatusMessage(chunkTDUDH7S4_js.slideStatusLabel("Rendering", current, total));
|
|
7116
7096
|
},
|
|
7117
7097
|
signal: abortCtrl.signal
|
|
7118
7098
|
}
|
|
7119
7099
|
);
|
|
7120
|
-
setExportProgress(
|
|
7100
|
+
setExportProgress(chunkTDUDH7S4_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7121
7101
|
setExportStatusMessage("Building PDF...");
|
|
7122
7102
|
await new Promise((r) => {
|
|
7123
7103
|
setTimeout(r, 100);
|
|
7124
7104
|
});
|
|
7125
|
-
setExportProgress(
|
|
7105
|
+
setExportProgress(chunkTDUDH7S4_js.EXPORT_DONE_PERCENT);
|
|
7126
7106
|
setExportStatusMessage("Done!");
|
|
7127
7107
|
} catch (err) {
|
|
7128
|
-
if (!
|
|
7108
|
+
if (!chunkTDUDH7S4_js.isExportAbortError(err)) {
|
|
7129
7109
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7130
7110
|
}
|
|
7131
7111
|
} finally {
|
|
@@ -7155,21 +7135,21 @@ function useExportHandlers(input) {
|
|
|
7155
7135
|
{
|
|
7156
7136
|
scale: 2,
|
|
7157
7137
|
onProgress: (current, total) => {
|
|
7158
|
-
setExportProgress(
|
|
7159
|
-
setExportStatusMessage(
|
|
7138
|
+
setExportProgress(chunkTDUDH7S4_js.slideProgressPercent(current, total));
|
|
7139
|
+
setExportStatusMessage(chunkTDUDH7S4_js.slideStatusLabel("Rendering", current, total));
|
|
7160
7140
|
},
|
|
7161
7141
|
signal: abortCtrl.signal
|
|
7162
7142
|
}
|
|
7163
7143
|
);
|
|
7164
|
-
setExportProgress(
|
|
7144
|
+
setExportProgress(chunkTDUDH7S4_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7165
7145
|
setExportStatusMessage("Building PDF...");
|
|
7166
7146
|
await new Promise((r) => {
|
|
7167
7147
|
setTimeout(r, 100);
|
|
7168
7148
|
});
|
|
7169
|
-
setExportProgress(
|
|
7149
|
+
setExportProgress(chunkTDUDH7S4_js.EXPORT_DONE_PERCENT);
|
|
7170
7150
|
setExportStatusMessage("Done!");
|
|
7171
7151
|
} catch (err) {
|
|
7172
|
-
if (!
|
|
7152
|
+
if (!chunkTDUDH7S4_js.isExportAbortError(err)) {
|
|
7173
7153
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7174
7154
|
}
|
|
7175
7155
|
} finally {
|
|
@@ -7210,22 +7190,22 @@ function useExportHandlers(input) {
|
|
|
7210
7190
|
scale: 1,
|
|
7211
7191
|
slideDurationMs: 3e3,
|
|
7212
7192
|
onProgress: (current, total) => {
|
|
7213
|
-
setExportProgress(
|
|
7214
|
-
setExportStatusMessage(
|
|
7193
|
+
setExportProgress(chunkTDUDH7S4_js.slideProgressPercent(current, total, 45));
|
|
7194
|
+
setExportStatusMessage(chunkTDUDH7S4_js.slideStatusLabel("Capturing", current, total));
|
|
7215
7195
|
},
|
|
7216
7196
|
onRecordProgress: (current, total) => {
|
|
7217
|
-
setExportProgress(
|
|
7218
|
-
setExportStatusMessage(
|
|
7197
|
+
setExportProgress(chunkTDUDH7S4_js.recordProgressPercent(current, total));
|
|
7198
|
+
setExportStatusMessage(chunkTDUDH7S4_js.slideStatusLabel("Recording", current, total));
|
|
7219
7199
|
},
|
|
7220
7200
|
signal: abortCtrl.signal
|
|
7221
7201
|
}
|
|
7222
7202
|
);
|
|
7223
|
-
setExportProgress(
|
|
7203
|
+
setExportProgress(chunkTDUDH7S4_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7224
7204
|
setExportStatusMessage("Saving file...");
|
|
7225
7205
|
downloadBlob2(blob, "presentation.webm");
|
|
7226
|
-
setExportProgress(
|
|
7206
|
+
setExportProgress(chunkTDUDH7S4_js.EXPORT_DONE_PERCENT);
|
|
7227
7207
|
} catch (err) {
|
|
7228
|
-
if (!
|
|
7208
|
+
if (!chunkTDUDH7S4_js.isExportAbortError(err)) {
|
|
7229
7209
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7230
7210
|
}
|
|
7231
7211
|
} finally {
|
|
@@ -7253,18 +7233,18 @@ function useExportHandlers(input) {
|
|
|
7253
7233
|
scale: 0.5,
|
|
7254
7234
|
slideDurationMs: 2e3,
|
|
7255
7235
|
onProgress: (current, total) => {
|
|
7256
|
-
setExportProgress(
|
|
7257
|
-
setExportStatusMessage(
|
|
7236
|
+
setExportProgress(chunkTDUDH7S4_js.slideProgressPercent(current, total));
|
|
7237
|
+
setExportStatusMessage(chunkTDUDH7S4_js.slideStatusLabel("Encoding", current, total));
|
|
7258
7238
|
},
|
|
7259
7239
|
signal: abortCtrl.signal
|
|
7260
7240
|
}
|
|
7261
7241
|
);
|
|
7262
|
-
setExportProgress(
|
|
7242
|
+
setExportProgress(chunkTDUDH7S4_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7263
7243
|
setExportStatusMessage("Saving file...");
|
|
7264
7244
|
downloadBlob2(blob, "presentation.gif");
|
|
7265
|
-
setExportProgress(
|
|
7245
|
+
setExportProgress(chunkTDUDH7S4_js.EXPORT_DONE_PERCENT);
|
|
7266
7246
|
} catch (err) {
|
|
7267
|
-
if (!
|
|
7247
|
+
if (!chunkTDUDH7S4_js.isExportAbortError(err)) {
|
|
7268
7248
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7269
7249
|
}
|
|
7270
7250
|
} finally {
|
|
@@ -7304,7 +7284,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7304
7284
|
}
|
|
7305
7285
|
printWindow.document.open();
|
|
7306
7286
|
printWindow.document.write(
|
|
7307
|
-
|
|
7287
|
+
chunkTDUDH7S4_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7308
7288
|
);
|
|
7309
7289
|
printWindow.document.close();
|
|
7310
7290
|
printWindow.focus();
|
|
@@ -7365,7 +7345,7 @@ function usePrintHandlers(input) {
|
|
|
7365
7345
|
if (svgs.length === 0) {
|
|
7366
7346
|
return;
|
|
7367
7347
|
}
|
|
7368
|
-
const printDoc =
|
|
7348
|
+
const printDoc = chunkTDUDH7S4_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7369
7349
|
title: "Slides (Vector)",
|
|
7370
7350
|
orientation: settings.orientation,
|
|
7371
7351
|
colorFilter
|
|
@@ -7401,7 +7381,7 @@ function usePrintHandlers(input) {
|
|
|
7401
7381
|
if (settings.printWhat === "outline") {
|
|
7402
7382
|
openPrintWindow(
|
|
7403
7383
|
"Outline",
|
|
7404
|
-
`<div class="outline-page">${
|
|
7384
|
+
`<div class="outline-page">${chunkTDUDH7S4_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7405
7385
|
settings.orientation,
|
|
7406
7386
|
colorFilter,
|
|
7407
7387
|
settings.frameSlides
|
|
@@ -7426,7 +7406,7 @@ function usePrintHandlers(input) {
|
|
|
7426
7406
|
if (settings.printWhat === "slides") {
|
|
7427
7407
|
openPrintWindow(
|
|
7428
7408
|
"Slides",
|
|
7429
|
-
|
|
7409
|
+
chunkTDUDH7S4_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7430
7410
|
settings.orientation,
|
|
7431
7411
|
colorFilter,
|
|
7432
7412
|
settings.frameSlides
|
|
@@ -7436,7 +7416,7 @@ function usePrintHandlers(input) {
|
|
|
7436
7416
|
if (settings.printWhat === "notes") {
|
|
7437
7417
|
openPrintWindow(
|
|
7438
7418
|
"Notes Pages",
|
|
7439
|
-
|
|
7419
|
+
chunkTDUDH7S4_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7440
7420
|
"portrait",
|
|
7441
7421
|
colorFilter,
|
|
7442
7422
|
settings.frameSlides
|
|
@@ -7447,7 +7427,7 @@ function usePrintHandlers(input) {
|
|
|
7447
7427
|
const spp = settings.slidesPerPage;
|
|
7448
7428
|
openPrintWindow(
|
|
7449
7429
|
`Handout ${spp} per page`,
|
|
7450
|
-
|
|
7430
|
+
chunkTDUDH7S4_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7451
7431
|
"portrait",
|
|
7452
7432
|
colorFilter,
|
|
7453
7433
|
settings.frameSlides
|
|
@@ -7511,8 +7491,8 @@ function useThemeHandlers(input) {
|
|
|
7511
7491
|
return;
|
|
7512
7492
|
}
|
|
7513
7493
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7514
|
-
const previousMap = theme?.colorScheme ?
|
|
7515
|
-
setSlides((prev) =>
|
|
7494
|
+
const previousMap = theme?.colorScheme ? chunkTDUDH7S4_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7495
|
+
setSlides((prev) => chunkTDUDH7S4_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7516
7496
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7517
7497
|
bumpHistory();
|
|
7518
7498
|
history.markDirty();
|
|
@@ -7617,7 +7597,7 @@ function useThemeSwitching(input) {
|
|
|
7617
7597
|
}
|
|
7618
7598
|
try {
|
|
7619
7599
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7620
|
-
const newData =
|
|
7600
|
+
const newData = chunkTDUDH7S4_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7621
7601
|
onDataChange(newData);
|
|
7622
7602
|
onThemeChanged?.(preset);
|
|
7623
7603
|
} catch (error) {
|
|
@@ -7634,7 +7614,7 @@ function useThemeSwitching(input) {
|
|
|
7634
7614
|
}
|
|
7635
7615
|
try {
|
|
7636
7616
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7637
|
-
const newData =
|
|
7617
|
+
const newData = chunkTDUDH7S4_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7638
7618
|
onDataChange(newData);
|
|
7639
7619
|
} catch (error) {
|
|
7640
7620
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7646,12 +7626,12 @@ function useThemeSwitching(input) {
|
|
|
7646
7626
|
if (!data?.theme?.colorScheme) {
|
|
7647
7627
|
return void 0;
|
|
7648
7628
|
}
|
|
7649
|
-
return
|
|
7650
|
-
(p) =>
|
|
7629
|
+
return chunkTDUDH7S4_js.THEME_PRESETS.find(
|
|
7630
|
+
(p) => chunkTDUDH7S4_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7651
7631
|
);
|
|
7652
7632
|
}, [data?.theme?.colorScheme]);
|
|
7653
7633
|
return {
|
|
7654
|
-
presets:
|
|
7634
|
+
presets: chunkTDUDH7S4_js.THEME_PRESETS,
|
|
7655
7635
|
switchToPreset,
|
|
7656
7636
|
switchToCustom,
|
|
7657
7637
|
currentPreset
|
|
@@ -7726,7 +7706,7 @@ function usePropertyHandlers(input) {
|
|
|
7726
7706
|
}
|
|
7727
7707
|
try {
|
|
7728
7708
|
const ab = await file.arrayBuffer();
|
|
7729
|
-
const h = new
|
|
7709
|
+
const h = new chunkTDUDH7S4_js.PptxHandler();
|
|
7730
7710
|
const other = await h.load(ab);
|
|
7731
7711
|
if (!other) {
|
|
7732
7712
|
return;
|
|
@@ -7736,7 +7716,7 @@ function usePropertyHandlers(input) {
|
|
|
7736
7716
|
width: canvasSize.width,
|
|
7737
7717
|
height: canvasSize.height
|
|
7738
7718
|
};
|
|
7739
|
-
setCompareResult(
|
|
7719
|
+
setCompareResult(chunkTDUDH7S4_js.comparePresentation(cur, other));
|
|
7740
7720
|
setIsComparePanelOpen(true);
|
|
7741
7721
|
} catch (err) {
|
|
7742
7722
|
console.warn("Compare failed:", err);
|
|
@@ -7753,7 +7733,7 @@ function usePropertyHandlers(input) {
|
|
|
7753
7733
|
if (!diff || diff.status === "unchanged") {
|
|
7754
7734
|
return;
|
|
7755
7735
|
}
|
|
7756
|
-
setSlides((prev) =>
|
|
7736
|
+
setSlides((prev) => chunkTDUDH7S4_js.applyAcceptSlide(prev, diff));
|
|
7757
7737
|
setIsDirty(true);
|
|
7758
7738
|
},
|
|
7759
7739
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7764,10 +7744,10 @@ function usePropertyHandlers(input) {
|
|
|
7764
7744
|
if (!compareResult) {
|
|
7765
7745
|
return;
|
|
7766
7746
|
}
|
|
7767
|
-
setSlides((prev) =>
|
|
7747
|
+
setSlides((prev) => chunkTDUDH7S4_js.applyAcceptAllSlides(prev, compareResult));
|
|
7768
7748
|
setIsDirty(true);
|
|
7769
7749
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7770
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7750
|
+
const usedFontFamilies = react.useMemo(() => chunkTDUDH7S4_js.collectUsedFonts(slides), [slides]);
|
|
7771
7751
|
return {
|
|
7772
7752
|
handleUpdateNotes,
|
|
7773
7753
|
handleUpdateSlide,
|
|
@@ -7886,7 +7866,7 @@ function useIsMobile(input) {
|
|
|
7886
7866
|
const containerRef = input?.containerRef;
|
|
7887
7867
|
const isTouchDevice = react.useSyncExternalStore(
|
|
7888
7868
|
subscribeTouchCapability,
|
|
7889
|
-
|
|
7869
|
+
chunkTDUDH7S4_js.detectTouchDevice,
|
|
7890
7870
|
() => false
|
|
7891
7871
|
// server snapshot
|
|
7892
7872
|
);
|
|
@@ -7902,7 +7882,7 @@ function useIsMobile(input) {
|
|
|
7902
7882
|
}
|
|
7903
7883
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
7904
7884
|
});
|
|
7905
|
-
const [orientation, setOrientation] = react.useState(
|
|
7885
|
+
const [orientation, setOrientation] = react.useState(chunkTDUDH7S4_js.detectOrientation);
|
|
7906
7886
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
7907
7887
|
const [initialViewportHeight] = react.useState(
|
|
7908
7888
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -7946,7 +7926,7 @@ function useIsMobile(input) {
|
|
|
7946
7926
|
return;
|
|
7947
7927
|
}
|
|
7948
7928
|
const handleOrientationChange = () => {
|
|
7949
|
-
setOrientation(
|
|
7929
|
+
setOrientation(chunkTDUDH7S4_js.detectOrientation());
|
|
7950
7930
|
};
|
|
7951
7931
|
if (screen.orientation) {
|
|
7952
7932
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -7976,9 +7956,9 @@ function useIsMobile(input) {
|
|
|
7976
7956
|
window.addEventListener("resize", handleResize);
|
|
7977
7957
|
return () => window.removeEventListener("resize", handleResize);
|
|
7978
7958
|
}, [isTouchDevice, initialViewportHeight]);
|
|
7979
|
-
const isMobile =
|
|
7980
|
-
const isTablet = !isMobile && containerWidth >=
|
|
7981
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
7959
|
+
const isMobile = chunkTDUDH7S4_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
7960
|
+
const isTablet = !isMobile && containerWidth >= chunkTDUDH7S4_js.MOBILE_BREAKPOINT && containerWidth < chunkTDUDH7S4_js.TABLET_BREAKPOINT;
|
|
7961
|
+
const isDesktop = !isMobile && containerWidth >= chunkTDUDH7S4_js.TABLET_BREAKPOINT;
|
|
7982
7962
|
return {
|
|
7983
7963
|
isMobile,
|
|
7984
7964
|
isTablet,
|
|
@@ -8039,11 +8019,11 @@ function useViewerDialogs(input) {
|
|
|
8039
8019
|
);
|
|
8040
8020
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(false);
|
|
8041
8021
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8042
|
-
() => typeof window !== "undefined" ?
|
|
8022
|
+
() => typeof window !== "undefined" ? chunkTDUDH7S4_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8043
8023
|
);
|
|
8044
8024
|
react.useEffect(() => {
|
|
8045
8025
|
const handleWindow = () => setIsNarrowViewport(
|
|
8046
|
-
|
|
8026
|
+
chunkTDUDH7S4_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8047
8027
|
);
|
|
8048
8028
|
let observer = null;
|
|
8049
8029
|
let raf = 0;
|
|
@@ -8057,12 +8037,12 @@ function useViewerDialogs(input) {
|
|
|
8057
8037
|
const entry = entries[0];
|
|
8058
8038
|
if (entry) {
|
|
8059
8039
|
setIsNarrowViewport(
|
|
8060
|
-
|
|
8040
|
+
chunkTDUDH7S4_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8061
8041
|
);
|
|
8062
8042
|
}
|
|
8063
8043
|
});
|
|
8064
8044
|
observer.observe(el);
|
|
8065
|
-
setIsNarrowViewport(
|
|
8045
|
+
setIsNarrowViewport(chunkTDUDH7S4_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8066
8046
|
};
|
|
8067
8047
|
attach();
|
|
8068
8048
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8220,20 +8200,20 @@ function useViewerDialogs(input) {
|
|
|
8220
8200
|
}
|
|
8221
8201
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8222
8202
|
if (presentationGridSpacing) {
|
|
8223
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8203
|
+
const px = Math.round(presentationGridSpacing.cx / chunkLE6YA5WB_js.EMU_PER_PX);
|
|
8224
8204
|
if (px > 0) {
|
|
8225
8205
|
return px;
|
|
8226
8206
|
}
|
|
8227
8207
|
}
|
|
8228
|
-
return
|
|
8208
|
+
return chunkLE6YA5WB_js.GRID_SIZE;
|
|
8229
8209
|
}
|
|
8230
8210
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8231
8211
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8232
|
-
return
|
|
8212
|
+
return chunkTDUDH7S4_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8233
8213
|
}
|
|
8234
8214
|
function computeSlideSectionGroups(slides, sections) {
|
|
8235
|
-
return
|
|
8236
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8215
|
+
return chunkTDUDH7S4_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8216
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkLE6YA5WB_js.UNGROUPED_SECTION_ID : "default"),
|
|
8237
8217
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8238
8218
|
slideIndexes: group.slideIndexes,
|
|
8239
8219
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8288,7 +8268,7 @@ function useDerivedSlideState(input) {
|
|
|
8288
8268
|
);
|
|
8289
8269
|
const slideSectionGroups = react.useMemo(
|
|
8290
8270
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8291
|
-
if (group.id ===
|
|
8271
|
+
if (group.id === chunkLE6YA5WB_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8292
8272
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8293
8273
|
}
|
|
8294
8274
|
if (group.id === "default" && group.label === "Slides") {
|
|
@@ -8391,13 +8371,13 @@ function useAnnotationHandlers(input) {
|
|
|
8391
8371
|
}, [annotations, setMode, setSlides, history]);
|
|
8392
8372
|
const handleSetMode = react.useCallback(
|
|
8393
8373
|
(nextMode) => {
|
|
8394
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8374
|
+
if (mode === "present" && nextMode !== "present" && !chunkTDUDH7S4_js.mayLeaveSlideShow()) {
|
|
8395
8375
|
return;
|
|
8396
8376
|
}
|
|
8397
8377
|
if (nextMode === "present") {
|
|
8398
8378
|
presentation.enterPresentMode();
|
|
8399
8379
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8400
|
-
|
|
8380
|
+
chunkLE6YA5WB_js.stopAllPersistentAudio();
|
|
8401
8381
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8402
8382
|
if (promptKeepInkAnnotations) {
|
|
8403
8383
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8406,7 +8386,7 @@ function useAnnotationHandlers(input) {
|
|
|
8406
8386
|
}
|
|
8407
8387
|
} else {
|
|
8408
8388
|
if (mode === "present") {
|
|
8409
|
-
|
|
8389
|
+
chunkLE6YA5WB_js.stopAllPersistentAudio();
|
|
8410
8390
|
}
|
|
8411
8391
|
setMode(nextMode);
|
|
8412
8392
|
}
|
|
@@ -8472,13 +8452,13 @@ function useSerialize(input) {
|
|
|
8472
8452
|
let processedSlide = slide;
|
|
8473
8453
|
if (pendingEditId) {
|
|
8474
8454
|
const updatedElements = slide.elements.map((el) => {
|
|
8475
|
-
if (el.id !== pendingEditId || !
|
|
8455
|
+
if (el.id !== pendingEditId || !chunkTDUDH7S4_js.hasTextProperties(el)) {
|
|
8476
8456
|
return el;
|
|
8477
8457
|
}
|
|
8478
8458
|
return {
|
|
8479
8459
|
...el,
|
|
8480
8460
|
text: pendingEditText,
|
|
8481
|
-
textSegments:
|
|
8461
|
+
textSegments: chunkTDUDH7S4_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8482
8462
|
};
|
|
8483
8463
|
});
|
|
8484
8464
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8491,14 +8471,14 @@ function useSerialize(input) {
|
|
|
8491
8471
|
const pptxGuides = guides.map((g) => ({
|
|
8492
8472
|
id: g.id,
|
|
8493
8473
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8494
|
-
positionEmu:
|
|
8474
|
+
positionEmu: chunkTDUDH7S4_js.guidePxToEmu(g.position)
|
|
8495
8475
|
}));
|
|
8496
8476
|
return {
|
|
8497
8477
|
...processedSlide,
|
|
8498
8478
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8499
8479
|
};
|
|
8500
8480
|
});
|
|
8501
|
-
const slidesToSave =
|
|
8481
|
+
const slidesToSave = chunkLE6YA5WB_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8502
8482
|
const saveOptions = {
|
|
8503
8483
|
headerFooter,
|
|
8504
8484
|
presentationProperties,
|
|
@@ -8667,7 +8647,7 @@ function usePresentationSetup(input) {
|
|
|
8667
8647
|
containerRef,
|
|
8668
8648
|
content,
|
|
8669
8649
|
onSetMode: (nextMode) => {
|
|
8670
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8650
|
+
if (mode === "present" && nextMode !== "present" && !chunkTDUDH7S4_js.mayLeaveSlideShow()) {
|
|
8671
8651
|
return;
|
|
8672
8652
|
}
|
|
8673
8653
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8675,7 +8655,7 @@ function usePresentationSetup(input) {
|
|
|
8675
8655
|
setShowKeepAnnotationsDialog(true);
|
|
8676
8656
|
} else {
|
|
8677
8657
|
if (mode === "present" && nextMode !== "present") {
|
|
8678
|
-
|
|
8658
|
+
chunkLE6YA5WB_js.stopAllPersistentAudio();
|
|
8679
8659
|
stopAnimationSound();
|
|
8680
8660
|
}
|
|
8681
8661
|
setMode(nextMode);
|
|
@@ -8729,10 +8709,10 @@ function usePresentationSetup(input) {
|
|
|
8729
8709
|
onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
|
|
8730
8710
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8731
8711
|
onSaveRehearsalTimings: (timings) => {
|
|
8732
|
-
setSlides((prev) =>
|
|
8712
|
+
setSlides((prev) => chunkTDUDH7S4_js.applyRehearsalTimings(prev, timings));
|
|
8733
8713
|
history.markDirty();
|
|
8734
8714
|
},
|
|
8735
|
-
loopContinuously:
|
|
8715
|
+
loopContinuously: chunkTDUDH7S4_js.shouldLoopContinuously(presentationProperties),
|
|
8736
8716
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8737
8717
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8738
8718
|
endWithBlackSlide
|
|
@@ -8894,7 +8874,7 @@ function useEditorOperations(input) {
|
|
|
8894
8874
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
8895
8875
|
react.useEffect(() => {
|
|
8896
8876
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
8897
|
-
copiedFormatRef.current =
|
|
8877
|
+
copiedFormatRef.current = chunkTDUDH7S4_js.copyFormatFromElement(selectedElement);
|
|
8898
8878
|
} else if (!formatPainterActive) {
|
|
8899
8879
|
copiedFormatRef.current = null;
|
|
8900
8880
|
}
|
|
@@ -8920,12 +8900,12 @@ function useEditorOperations(input) {
|
|
|
8920
8900
|
e.stopPropagation();
|
|
8921
8901
|
const element = elementLookup.get(elementId);
|
|
8922
8902
|
if (element) {
|
|
8923
|
-
const updated =
|
|
8903
|
+
const updated = chunkTDUDH7S4_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
8924
8904
|
const updates = {};
|
|
8925
|
-
if (
|
|
8905
|
+
if (chunkTDUDH7S4_js.hasShapeProperties(updated)) {
|
|
8926
8906
|
updates.shapeStyle = updated.shapeStyle;
|
|
8927
8907
|
}
|
|
8928
|
-
if (
|
|
8908
|
+
if (chunkTDUDH7S4_js.hasTextProperties(updated)) {
|
|
8929
8909
|
updates.textStyle = updated.textStyle;
|
|
8930
8910
|
}
|
|
8931
8911
|
ops.updateElementById(elementId, updates);
|
|
@@ -9072,7 +9052,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9072
9052
|
const families = /* @__PURE__ */ new Set();
|
|
9073
9053
|
for (const slide of slides) {
|
|
9074
9054
|
for (const el of slide.elements) {
|
|
9075
|
-
if (
|
|
9055
|
+
if (chunkTDUDH7S4_js.hasTextProperties(el) && el.textSegments) {
|
|
9076
9056
|
for (const seg of el.textSegments) {
|
|
9077
9057
|
if (seg.style.fontFamily) {
|
|
9078
9058
|
families.add(seg.style.fontFamily);
|
|
@@ -9284,13 +9264,13 @@ function useKeyboardShortcuts(input) {
|
|
|
9284
9264
|
inputRef.current = input;
|
|
9285
9265
|
const handleKeyDown = react.useCallback((e) => {
|
|
9286
9266
|
const current = inputRef.current;
|
|
9287
|
-
const { action, dx, dy } =
|
|
9267
|
+
const { action, dx, dy } = chunkTDUDH7S4_js.mapEditorKey(e, {
|
|
9288
9268
|
canEdit: current.canEdit,
|
|
9289
9269
|
isPresenting: current.mode !== "edit",
|
|
9290
9270
|
hasSelection: current.hasSelection,
|
|
9291
9271
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9292
9272
|
isDrawing: current.activeTool !== "select",
|
|
9293
|
-
isTextInputTarget:
|
|
9273
|
+
isTextInputTarget: chunkTDUDH7S4_js.isEditorTextInputTarget(e.target)
|
|
9294
9274
|
});
|
|
9295
9275
|
if (action === null) {
|
|
9296
9276
|
return;
|
|
@@ -9583,7 +9563,7 @@ function useViewerIntegration(input) {
|
|
|
9583
9563
|
return zoom.scale;
|
|
9584
9564
|
},
|
|
9585
9565
|
setZoom(level) {
|
|
9586
|
-
zoom.setScale(
|
|
9566
|
+
zoom.setScale(chunkTDUDH7S4_js.clampZoomScale(level));
|
|
9587
9567
|
},
|
|
9588
9568
|
zoomIn() {
|
|
9589
9569
|
zoom.handleZoomIn();
|
|
@@ -9798,7 +9778,7 @@ function useReducedMotion() {
|
|
|
9798
9778
|
}
|
|
9799
9779
|
function useViewerOptions() {
|
|
9800
9780
|
const storeRef = react.useRef(null);
|
|
9801
|
-
storeRef.current ??=
|
|
9781
|
+
storeRef.current ??= chunkTDUDH7S4_js.createViewerOptionsStore();
|
|
9802
9782
|
const store = storeRef.current;
|
|
9803
9783
|
const options = react.useSyncExternalStore(
|
|
9804
9784
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9807,9 +9787,9 @@ function useViewerOptions() {
|
|
|
9807
9787
|
);
|
|
9808
9788
|
return { optionsStore: store, options };
|
|
9809
9789
|
}
|
|
9810
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9790
|
+
var KNOWN_TAB_IDS = new Set(chunkTDUDH7S4_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9811
9791
|
function computeToolbarVisibility(hiddenActions) {
|
|
9812
|
-
const isHidden = (id) =>
|
|
9792
|
+
const isHidden = (id) => chunkTDUDH7S4_js.isActionHidden(id, hiddenActions);
|
|
9813
9793
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
9814
9794
|
return { isHidden, isTabVisible };
|
|
9815
9795
|
}
|
|
@@ -9894,12 +9874,12 @@ function useYjsDocumentSync({
|
|
|
9894
9874
|
return;
|
|
9895
9875
|
}
|
|
9896
9876
|
try {
|
|
9897
|
-
const handler = new
|
|
9877
|
+
const handler = new chunkTDUDH7S4_js.PptxHandler();
|
|
9898
9878
|
await handler.load(sourceBytes.buffer);
|
|
9899
|
-
const currentSlides =
|
|
9879
|
+
const currentSlides = chunkTDUDH7S4_js.readSlidesFromYDoc(
|
|
9900
9880
|
doc
|
|
9901
9881
|
);
|
|
9902
|
-
const slidesToSave =
|
|
9882
|
+
const slidesToSave = chunkLE6YA5WB_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
9903
9883
|
const bytes = await handler.save(slidesToSave);
|
|
9904
9884
|
config.onWriteBack(bytes);
|
|
9905
9885
|
} catch {
|
|
@@ -9914,7 +9894,7 @@ function useYjsDocumentSync({
|
|
|
9914
9894
|
if (!doc || !isConnected) {
|
|
9915
9895
|
return;
|
|
9916
9896
|
}
|
|
9917
|
-
const docSlides =
|
|
9897
|
+
const docSlides = chunkTDUDH7S4_js.readSlidesFromYDoc(
|
|
9918
9898
|
doc
|
|
9919
9899
|
);
|
|
9920
9900
|
if (docSlides.length === 0) {
|
|
@@ -9936,11 +9916,11 @@ function useYjsDocumentSync({
|
|
|
9936
9916
|
lastSyncedRef.current = serialized;
|
|
9937
9917
|
void (async () => {
|
|
9938
9918
|
const factories = await getFactories();
|
|
9939
|
-
|
|
9919
|
+
chunkTDUDH7S4_js.reconcileSlidesInYDoc(
|
|
9940
9920
|
slides,
|
|
9941
9921
|
doc,
|
|
9942
9922
|
factories,
|
|
9943
|
-
|
|
9923
|
+
chunkTDUDH7S4_js.LOCAL_SYNC_ORIGIN
|
|
9944
9924
|
);
|
|
9945
9925
|
scheduleWriteBack();
|
|
9946
9926
|
})();
|
|
@@ -9954,10 +9934,10 @@ function useYjsDocumentSync({
|
|
|
9954
9934
|
return;
|
|
9955
9935
|
}
|
|
9956
9936
|
const handleChange = (_events, transaction) => {
|
|
9957
|
-
if (transaction?.origin ===
|
|
9937
|
+
if (transaction?.origin === chunkTDUDH7S4_js.LOCAL_SYNC_ORIGIN) {
|
|
9958
9938
|
return;
|
|
9959
9939
|
}
|
|
9960
|
-
const remoteSlides =
|
|
9940
|
+
const remoteSlides = chunkTDUDH7S4_js.readSlidesFromYDoc(
|
|
9961
9941
|
doc
|
|
9962
9942
|
);
|
|
9963
9943
|
if (remoteSlides.length === 0) {
|
|
@@ -9973,7 +9953,7 @@ function useYjsDocumentSync({
|
|
|
9973
9953
|
isApplyingRemoteRef.current = false;
|
|
9974
9954
|
scheduleWriteBack();
|
|
9975
9955
|
};
|
|
9976
|
-
const unobserve =
|
|
9956
|
+
const unobserve = chunkTDUDH7S4_js.observeYDocSlides(
|
|
9977
9957
|
doc,
|
|
9978
9958
|
handleChange
|
|
9979
9959
|
);
|
|
@@ -10011,7 +9991,7 @@ function useBroadcastFollower({
|
|
|
10011
9991
|
if (!broadcaster) {
|
|
10012
9992
|
return;
|
|
10013
9993
|
}
|
|
10014
|
-
if (!
|
|
9994
|
+
if (!chunkTDUDH7S4_js.shouldAutoFollowBroadcaster({
|
|
10015
9995
|
localRole: collab.config.role,
|
|
10016
9996
|
broadcasterRole: broadcaster.role
|
|
10017
9997
|
})) {
|
|
@@ -10171,10 +10151,10 @@ function useTouchGestures(input) {
|
|
|
10171
10151
|
if (!el || !enabled) {
|
|
10172
10152
|
return;
|
|
10173
10153
|
}
|
|
10174
|
-
const recognizer =
|
|
10154
|
+
const recognizer = chunkTDUDH7S4_js.createTouchGestureRecognizer({
|
|
10175
10155
|
getScale: () => scaleRef.current,
|
|
10176
|
-
minScale:
|
|
10177
|
-
maxScale:
|
|
10156
|
+
minScale: chunkTDUDH7S4_js.MIN_ZOOM_SCALE,
|
|
10157
|
+
maxScale: chunkTDUDH7S4_js.MAX_ZOOM_SCALE,
|
|
10178
10158
|
callbacks: {
|
|
10179
10159
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10180
10160
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10214,7 +10194,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10214
10194
|
return;
|
|
10215
10195
|
}
|
|
10216
10196
|
const rect = active.getBoundingClientRect();
|
|
10217
|
-
const delta =
|
|
10197
|
+
const delta = chunkTDUDH7S4_js.computeScrollDelta(
|
|
10218
10198
|
{ top: rect.top, bottom: rect.bottom },
|
|
10219
10199
|
window.innerHeight,
|
|
10220
10200
|
keyboardInset
|
|
@@ -10234,8 +10214,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10234
10214
|
return;
|
|
10235
10215
|
}
|
|
10236
10216
|
const update = () => {
|
|
10237
|
-
const metrics =
|
|
10238
|
-
const inset = metrics ?
|
|
10217
|
+
const metrics = chunkTDUDH7S4_js.readViewportMetrics(window);
|
|
10218
|
+
const inset = metrics ? chunkTDUDH7S4_js.computeKeyboardInset(metrics) : 0;
|
|
10239
10219
|
setKeyboardInset(inset);
|
|
10240
10220
|
if (inset > 0) {
|
|
10241
10221
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10246,8 +10226,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10246
10226
|
vv.addEventListener("scroll", update);
|
|
10247
10227
|
const onFocusIn = () => {
|
|
10248
10228
|
window.requestAnimationFrame(() => {
|
|
10249
|
-
const metrics =
|
|
10250
|
-
const inset = metrics ?
|
|
10229
|
+
const metrics = chunkTDUDH7S4_js.readViewportMetrics(window);
|
|
10230
|
+
const inset = metrics ? chunkTDUDH7S4_js.computeKeyboardInset(metrics) : 0;
|
|
10251
10231
|
if (inset > 0) {
|
|
10252
10232
|
scrollFocusedIntoView(inset);
|
|
10253
10233
|
}
|
|
@@ -10260,7 +10240,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10260
10240
|
document.removeEventListener("focusin", onFocusIn);
|
|
10261
10241
|
};
|
|
10262
10242
|
}, [enabled]);
|
|
10263
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10243
|
+
return { keyboardInset, isKeyboardOpen: chunkTDUDH7S4_js.isKeyboardOpen(keyboardInset) };
|
|
10264
10244
|
}
|
|
10265
10245
|
|
|
10266
10246
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10287,7 +10267,7 @@ function buildCanvasProps(input) {
|
|
|
10287
10267
|
} = input;
|
|
10288
10268
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10289
10269
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10290
|
-
const fieldContext =
|
|
10270
|
+
const fieldContext = chunkTDUDH7S4_js.buildFieldSubstitutionContext({
|
|
10291
10271
|
headerFooter: s.headerFooter,
|
|
10292
10272
|
customProperties: s.customProperties,
|
|
10293
10273
|
slide: activeSlide
|
|
@@ -10297,13 +10277,13 @@ function buildCanvasProps(input) {
|
|
|
10297
10277
|
if (mode === "present") {
|
|
10298
10278
|
presentation.handlePresentationAction(action);
|
|
10299
10279
|
} else if (action.url) {
|
|
10300
|
-
|
|
10280
|
+
chunkTDUDH7S4_js.safeOpenUrl(action.url);
|
|
10301
10281
|
}
|
|
10302
10282
|
};
|
|
10303
10283
|
const handleHyperlinkClick = (url) => {
|
|
10304
|
-
if (
|
|
10284
|
+
if (chunkTDUDH7S4_js.isPpactionUrl(url)) {
|
|
10305
10285
|
if (mode === "present") {
|
|
10306
|
-
const parsed =
|
|
10286
|
+
const parsed = chunkTDUDH7S4_js.parsePpactionUrl(url);
|
|
10307
10287
|
if (parsed) {
|
|
10308
10288
|
presentation.handlePresentationAction({
|
|
10309
10289
|
action: parsed.action,
|
|
@@ -10313,7 +10293,7 @@ function buildCanvasProps(input) {
|
|
|
10313
10293
|
}
|
|
10314
10294
|
return;
|
|
10315
10295
|
}
|
|
10316
|
-
|
|
10296
|
+
chunkTDUDH7S4_js.safeOpenUrl(url);
|
|
10317
10297
|
};
|
|
10318
10298
|
return {
|
|
10319
10299
|
activeSlide: effectiveSlide,
|
|
@@ -10456,7 +10436,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10456
10436
|
const current = activeSlide.animations ?? [];
|
|
10457
10437
|
if (group === "motionPath") {
|
|
10458
10438
|
propertyHandlers.handleUpdateSlide({
|
|
10459
|
-
animations:
|
|
10439
|
+
animations: chunkTDUDH7S4_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10460
10440
|
});
|
|
10461
10441
|
return;
|
|
10462
10442
|
}
|
|
@@ -10650,7 +10630,7 @@ function buildToolbarProps(input) {
|
|
|
10650
10630
|
onOpenFile,
|
|
10651
10631
|
onOpenRecentFile,
|
|
10652
10632
|
onCreatePresentation: (templateId) => {
|
|
10653
|
-
s.setSlides(
|
|
10633
|
+
s.setSlides(chunkTDUDH7S4_js.createBackstagePresentation(templateId));
|
|
10654
10634
|
s.setActiveSlideIndex(0);
|
|
10655
10635
|
s.setSelectedElementId(null);
|
|
10656
10636
|
s.setSelectedElementIds([]);
|
|
@@ -10707,7 +10687,7 @@ function buildToolbarProps(input) {
|
|
|
10707
10687
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10708
10688
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10709
10689
|
formatPainterActive: s.formatPainterActive,
|
|
10710
|
-
canActivateFormatPainter:
|
|
10690
|
+
canActivateFormatPainter: chunkTDUDH7S4_js.hasCopyableFormat(selectedElement),
|
|
10711
10691
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10712
10692
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10713
10693
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -10976,7 +10956,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
10976
10956
|
}, [incomingContent]);
|
|
10977
10957
|
const onOpenFile = react.useCallback(() => {
|
|
10978
10958
|
void (async () => {
|
|
10979
|
-
const picked = await
|
|
10959
|
+
const picked = await chunkTDUDH7S4_js.openPptxFile();
|
|
10980
10960
|
if (picked) {
|
|
10981
10961
|
setContent(picked.buffer);
|
|
10982
10962
|
}
|
|
@@ -10984,7 +10964,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
10984
10964
|
}, []);
|
|
10985
10965
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
10986
10966
|
void (async () => {
|
|
10987
|
-
const bytes = await
|
|
10967
|
+
const bytes = await chunkTDUDH7S4_js.readBackstageRecentFile(key);
|
|
10988
10968
|
if (bytes) {
|
|
10989
10969
|
setContent(bytes);
|
|
10990
10970
|
}
|