pptx-react-viewer 2.13.1 → 2.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/{AiChatPanel-FXPGFU6H.js → AiChatPanel-F4E3A2DE.js} +22 -22
- package/dist/AiChatPanel-F4E3A2DE.js.br +0 -0
- package/dist/AiChatPanel-F4E3A2DE.js.gz +0 -0
- package/dist/{AiChatPanel-WMGS5TNX.mjs → AiChatPanel-VEULATXX.mjs} +3 -3
- package/dist/AiChatPanel-VEULATXX.mjs.br +0 -0
- package/dist/AiChatPanel-VEULATXX.mjs.gz +0 -0
- package/dist/{Model3DScene-E2XRQAMR.mjs → Model3DScene-KIPEODEJ.mjs} +1 -1
- package/dist/{Model3DScene-E2XRQAMR.mjs.br → Model3DScene-KIPEODEJ.mjs.br} +0 -0
- package/dist/Model3DScene-KIPEODEJ.mjs.gz +0 -0
- package/dist/{Model3DScene-K5FPZTRG.js → Model3DScene-TD2LIHYP.js} +2 -2
- package/dist/Model3DScene-TD2LIHYP.js.br +0 -0
- package/dist/Model3DScene-TD2LIHYP.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-2W2IFPLE.mjs → SurfaceChart3DScene-GRBWZ52S.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-2W2IFPLE.mjs.br → SurfaceChart3DScene-GRBWZ52S.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-GRBWZ52S.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-JDCFTXYT.js → SurfaceChart3DScene-OTKXQH5O.js} +2 -2
- package/dist/SurfaceChart3DScene-OTKXQH5O.js.br +0 -0
- package/dist/SurfaceChart3DScene-OTKXQH5O.js.gz +0 -0
- package/dist/{chunk-3OV4FR6S.mjs → chunk-3HWE6QZG.mjs} +7 -7
- package/dist/chunk-3HWE6QZG.mjs.br +0 -0
- package/dist/chunk-3HWE6QZG.mjs.gz +0 -0
- package/dist/{chunk-QFNJCEMS.js → chunk-BNSCH4WT.js} +327 -327
- package/dist/chunk-BNSCH4WT.js.br +0 -0
- package/dist/chunk-BNSCH4WT.js.gz +0 -0
- package/dist/{chunk-66ZHD7Y4.js → chunk-DOS7NY7C.js} +244 -244
- package/dist/chunk-DOS7NY7C.js.br +0 -0
- package/dist/chunk-DOS7NY7C.js.gz +0 -0
- package/dist/{chunk-ZMIFFURL.js → chunk-EUQ2IER3.js} +1037 -1037
- package/dist/chunk-EUQ2IER3.js.br +0 -0
- package/dist/chunk-EUQ2IER3.js.gz +0 -0
- package/dist/{chunk-DD2YRS6Z.js → chunk-FDR5W67L.js} +160 -50
- package/dist/chunk-FDR5W67L.js.br +0 -0
- package/dist/chunk-FDR5W67L.js.gz +0 -0
- package/dist/{chunk-OWGPRVRK.mjs → chunk-GKOKCOXR.mjs} +160 -50
- package/dist/chunk-GKOKCOXR.mjs.br +0 -0
- package/dist/chunk-GKOKCOXR.mjs.gz +0 -0
- package/dist/{chunk-GJEH27GD.mjs → chunk-GZ6TXBEO.mjs} +2 -2
- package/dist/chunk-GZ6TXBEO.mjs.br +0 -0
- package/dist/{chunk-GJEH27GD.mjs.gz → chunk-GZ6TXBEO.mjs.gz} +0 -0
- package/dist/{chunk-CQ2CKMG4.mjs → chunk-L5YGPCQW.mjs} +1 -1
- package/dist/chunk-L5YGPCQW.mjs.br +0 -0
- package/dist/chunk-L5YGPCQW.mjs.gz +0 -0
- package/dist/{chunk-PTFCMG3A.js → chunk-VY3KLDJF.js} +3 -3
- package/dist/chunk-VY3KLDJF.js.br +0 -0
- package/dist/chunk-VY3KLDJF.js.gz +0 -0
- package/dist/{chunk-H5H57XMH.mjs → chunk-ZFRPPY2N.mjs} +2 -2
- package/dist/chunk-ZFRPPY2N.mjs.br +0 -0
- package/dist/chunk-ZFRPPY2N.mjs.gz +0 -0
- package/dist/index.js +34 -34
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.js +21 -21
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-FXPGFU6H.js.br +0 -0
- package/dist/AiChatPanel-FXPGFU6H.js.gz +0 -0
- package/dist/AiChatPanel-WMGS5TNX.mjs.br +0 -0
- package/dist/AiChatPanel-WMGS5TNX.mjs.gz +0 -0
- package/dist/Model3DScene-E2XRQAMR.mjs.gz +0 -0
- package/dist/Model3DScene-K5FPZTRG.js.br +0 -0
- package/dist/Model3DScene-K5FPZTRG.js.gz +0 -0
- package/dist/SurfaceChart3DScene-2W2IFPLE.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-JDCFTXYT.js.br +0 -0
- package/dist/SurfaceChart3DScene-JDCFTXYT.js.gz +0 -0
- package/dist/chunk-3OV4FR6S.mjs.br +0 -0
- package/dist/chunk-3OV4FR6S.mjs.gz +0 -0
- package/dist/chunk-66ZHD7Y4.js.br +0 -0
- package/dist/chunk-66ZHD7Y4.js.gz +0 -0
- package/dist/chunk-CQ2CKMG4.mjs.br +0 -0
- package/dist/chunk-CQ2CKMG4.mjs.gz +0 -0
- package/dist/chunk-DD2YRS6Z.js.br +0 -0
- package/dist/chunk-DD2YRS6Z.js.gz +0 -0
- package/dist/chunk-GJEH27GD.mjs.br +0 -0
- package/dist/chunk-H5H57XMH.mjs.br +0 -0
- package/dist/chunk-H5H57XMH.mjs.gz +0 -0
- package/dist/chunk-OWGPRVRK.mjs.br +0 -0
- package/dist/chunk-OWGPRVRK.mjs.gz +0 -0
- package/dist/chunk-PTFCMG3A.js.br +0 -0
- package/dist/chunk-PTFCMG3A.js.gz +0 -0
- package/dist/chunk-QFNJCEMS.js.br +0 -0
- package/dist/chunk-QFNJCEMS.js.gz +0 -0
- package/dist/chunk-ZMIFFURL.js.br +0 -0
- package/dist/chunk-ZMIFFURL.js.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkDOS7NY7C_js = require('./chunk-DOS7NY7C.js');
|
|
4
4
|
var chunkBXAK3JFM_js = require('./chunk-BXAK3JFM.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkFDR5W67L_js = require('./chunk-FDR5W67L.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 = chunkFDR5W67L_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 = chunkFDR5W67L_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 >= chunkFDR5W67L_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
|
+
}, chunkFDR5W67L_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 = chunkFDR5W67L_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 = chunkFDR5W67L_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
|
+
chunkFDR5W67L_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 = chunkFDR5W67L_js.validateRoomId(config.roomId);
|
|
243
243
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
244
|
-
departureRef.current =
|
|
244
|
+
departureRef.current = chunkFDR5W67L_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 = chunkFDR5W67L_js.validateRoomId(config.roomId);
|
|
287
|
+
const transport = config.transport ?? chunkFDR5W67L_js.resolveTransportForServerUrl(config.serverUrl);
|
|
288
288
|
if (transport === "webrtc") {
|
|
289
289
|
await initWebrtc();
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
if (
|
|
292
|
+
if (chunkFDR5W67L_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 = chunkFDR5W67L_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
|
+
chunkFDR5W67L_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
|
+
}, chunkFDR5W67L_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
|
+
chunkFDR5W67L_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 = chunkFDR5W67L_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 = chunkFDR5W67L_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
412
412
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
413
413
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
414
414
|
awareness,
|
|
@@ -517,8 +517,8 @@ function useEditorHistory(input) {
|
|
|
517
517
|
width: canvasSize.width,
|
|
518
518
|
height: canvasSize.height,
|
|
519
519
|
activeSlideIndex,
|
|
520
|
-
slides: slides.map(
|
|
521
|
-
templateElementsBySlideId:
|
|
520
|
+
slides: slides.map(chunkFDR5W67L_js.cloneSlide),
|
|
521
|
+
templateElementsBySlideId: chunkFDR5W67L_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(chunkFDR5W67L_js.cloneSlide));
|
|
535
535
|
setTemplateElementsBySlideId(
|
|
536
|
-
|
|
536
|
+
chunkFDR5W67L_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
537
537
|
);
|
|
538
538
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
539
539
|
setSelectedElementIds([]);
|
|
@@ -567,8 +567,8 @@ function useEditorHistory(input) {
|
|
|
567
567
|
const currentSnapshot = buildHistorySnapshot();
|
|
568
568
|
historyFutureRef.current.push(currentSnapshot);
|
|
569
569
|
isApplyingHistoryRef.current = true;
|
|
570
|
-
const nextSnapshot =
|
|
571
|
-
lastHistorySnapshotRef.current =
|
|
570
|
+
const nextSnapshot = chunkDOS7NY7C_js.cloneHistorySnapshot(previousSnapshot);
|
|
571
|
+
lastHistorySnapshotRef.current = chunkDOS7NY7C_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 = chunkDOS7NY7C_js.cloneHistorySnapshot(nextSnapshot);
|
|
593
|
+
lastHistorySnapshotRef.current = chunkDOS7NY7C_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 = chunkDOS7NY7C_js.cloneHistorySnapshot(initialSnapshot);
|
|
612
612
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
613
613
|
lastHistorySerializedRef.current = JSON.stringify(clonedInitial);
|
|
614
614
|
} else {
|
|
@@ -649,18 +649,18 @@ function useEditorHistory(input) {
|
|
|
649
649
|
}
|
|
650
650
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
651
651
|
if (!previousSnapshot) {
|
|
652
|
-
lastHistorySnapshotRef.current =
|
|
652
|
+
lastHistorySnapshotRef.current = chunkDOS7NY7C_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(chunkDOS7NY7C_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 = chunkDOS7NY7C_js.cloneHistorySnapshot(snapshot);
|
|
664
664
|
lastHistorySerializedRef.current = serialized;
|
|
665
665
|
lastCheapHashRef.current = cheapHash;
|
|
666
666
|
updateHistoryAvailability();
|
|
@@ -750,7 +750,7 @@ function useZoomViewport({
|
|
|
750
750
|
if (!wrapper || !canvasViewport) {
|
|
751
751
|
return;
|
|
752
752
|
}
|
|
753
|
-
const boundedScale =
|
|
753
|
+
const boundedScale = chunkFDR5W67L_js.clampZoomScale(nextScale);
|
|
754
754
|
const nextEditorScale = fitScale * boundedScale;
|
|
755
755
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
756
756
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -765,10 +765,10 @@ function useZoomViewport({
|
|
|
765
765
|
[fitScale]
|
|
766
766
|
);
|
|
767
767
|
const handleZoomIn = react.useCallback(() => {
|
|
768
|
-
setScale((currentScale) =>
|
|
768
|
+
setScale((currentScale) => chunkFDR5W67L_js.zoomInScale(currentScale));
|
|
769
769
|
}, []);
|
|
770
770
|
const handleZoomOut = react.useCallback(() => {
|
|
771
|
-
setScale((currentScale) =>
|
|
771
|
+
setScale((currentScale) => chunkFDR5W67L_js.zoomOutScale(currentScale));
|
|
772
772
|
}, []);
|
|
773
773
|
const handleResetZoom = react.useCallback(() => {
|
|
774
774
|
setScale(1);
|
|
@@ -787,29 +787,29 @@ function useZoomViewport({
|
|
|
787
787
|
selectedElements.forEach((element) => {
|
|
788
788
|
minX = Math.min(minX, element.x);
|
|
789
789
|
minY = Math.min(minY, element.y);
|
|
790
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
791
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
790
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkDOS7NY7C_js.MIN_ELEMENT_SIZE));
|
|
791
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkDOS7NY7C_js.MIN_ELEMENT_SIZE));
|
|
792
792
|
});
|
|
793
793
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
794
794
|
return;
|
|
795
795
|
}
|
|
796
796
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
797
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
798
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
797
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkDOS7NY7C_js.MIN_ELEMENT_SIZE);
|
|
798
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkDOS7NY7C_js.MIN_ELEMENT_SIZE);
|
|
799
799
|
const availableWidth = Math.max(
|
|
800
|
-
effectiveEditorDimensions.width -
|
|
801
|
-
|
|
800
|
+
effectiveEditorDimensions.width - chunkDOS7NY7C_js.ZOOM_TO_SELECTION_PADDING,
|
|
801
|
+
chunkDOS7NY7C_js.MIN_ELEMENT_SIZE
|
|
802
802
|
);
|
|
803
803
|
const availableHeight = Math.max(
|
|
804
|
-
effectiveEditorDimensions.height -
|
|
805
|
-
|
|
804
|
+
effectiveEditorDimensions.height - chunkDOS7NY7C_js.ZOOM_TO_SELECTION_PADDING,
|
|
805
|
+
chunkDOS7NY7C_js.MIN_ELEMENT_SIZE
|
|
806
806
|
);
|
|
807
807
|
const targetEditorScale = Math.min(
|
|
808
808
|
availableWidth / boundsWidth,
|
|
809
809
|
availableHeight / boundsHeight
|
|
810
810
|
);
|
|
811
811
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
812
|
-
const nextScale =
|
|
812
|
+
const nextScale = chunkFDR5W67L_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
813
813
|
setScale(nextScale);
|
|
814
814
|
window.requestAnimationFrame(() => {
|
|
815
815
|
window.requestAnimationFrame(() => {
|
|
@@ -829,7 +829,7 @@ function useZoomViewport({
|
|
|
829
829
|
}
|
|
830
830
|
event.preventDefault();
|
|
831
831
|
const delta = event.deltaY * -1e-3;
|
|
832
|
-
setScale((currentScale) =>
|
|
832
|
+
setScale((currentScale) => chunkFDR5W67L_js.clampZoomScale(currentScale + delta));
|
|
833
833
|
}, []);
|
|
834
834
|
react.useEffect(() => {
|
|
835
835
|
const viewport = canvasViewportRef.current;
|
|
@@ -906,7 +906,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
906
906
|
const command = step.command;
|
|
907
907
|
const timer = window.setTimeout(
|
|
908
908
|
() => {
|
|
909
|
-
|
|
909
|
+
chunkDOS7NY7C_js.executeMediaCommand(command);
|
|
910
910
|
},
|
|
911
911
|
Math.max(0, step.delayMs)
|
|
912
912
|
);
|
|
@@ -1022,7 +1022,7 @@ function useAnimationPlayback(input) {
|
|
|
1022
1022
|
(controller, group) => {
|
|
1023
1023
|
driveBuildReveal(
|
|
1024
1024
|
controller,
|
|
1025
|
-
|
|
1025
|
+
chunkFDR5W67L_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1026
1026
|
setPresentationElementStates,
|
|
1027
1027
|
buildRafRef
|
|
1028
1028
|
);
|
|
@@ -1085,7 +1085,7 @@ function useAnimationPlayback(input) {
|
|
|
1085
1085
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1086
1086
|
return;
|
|
1087
1087
|
}
|
|
1088
|
-
const controller =
|
|
1088
|
+
const controller = chunkFDR5W67L_js.PresentationAnimationController.fromSlide(slide);
|
|
1089
1089
|
controllerRef.current = controller;
|
|
1090
1090
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1091
1091
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1233,7 +1233,7 @@ function useAnimationPlayback(input) {
|
|
|
1233
1233
|
}))
|
|
1234
1234
|
);
|
|
1235
1235
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1236
|
-
const delay =
|
|
1236
|
+
const delay = chunkFDR5W67L_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1237
1237
|
const timer = window.setTimeout(() => {
|
|
1238
1238
|
setPresentationAnimations(
|
|
1239
1239
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1270,12 +1270,12 @@ function useAnimationPlayback(input) {
|
|
|
1270
1270
|
presentationTimersRef
|
|
1271
1271
|
};
|
|
1272
1272
|
}
|
|
1273
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1274
|
-
var AUDIENCE_HASH =
|
|
1275
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1276
|
-
var AUDIENCE_NONCE_KEY =
|
|
1273
|
+
var PRESENTER_CHANNEL_NAME = chunkFDR5W67L_js.PRESENTATION_CHANNEL_NAME;
|
|
1274
|
+
var AUDIENCE_HASH = chunkFDR5W67L_js.PRESENTATION_HASH;
|
|
1275
|
+
var PRESENTER_MSG_ORIGIN = chunkFDR5W67L_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1276
|
+
var AUDIENCE_NONCE_KEY = chunkFDR5W67L_js.PRESENTATION_NONCE_KEY;
|
|
1277
1277
|
function generateSessionId() {
|
|
1278
|
-
return
|
|
1278
|
+
return chunkFDR5W67L_js.createPresentationSessionId();
|
|
1279
1279
|
}
|
|
1280
1280
|
function parseAudienceNonce() {
|
|
1281
1281
|
const hash = window.location.hash;
|
|
@@ -1311,7 +1311,7 @@ function usePresenterWindow(input) {
|
|
|
1311
1311
|
}, []);
|
|
1312
1312
|
const swapDisplays = react.useCallback(async () => {
|
|
1313
1313
|
const audience = audienceWindowRef.current;
|
|
1314
|
-
return audience && !audience.closed ?
|
|
1314
|
+
return audience && !audience.closed ? chunkFDR5W67L_js.swapPresentationWindows(window, audience) : false;
|
|
1315
1315
|
}, []);
|
|
1316
1316
|
const syncSlideToAudience = react.useCallback(
|
|
1317
1317
|
(slideIndex) => {
|
|
@@ -1375,7 +1375,7 @@ function usePresenterWindow(input) {
|
|
|
1375
1375
|
pollTimerRef.current = null;
|
|
1376
1376
|
}
|
|
1377
1377
|
if (closingSessionId) {
|
|
1378
|
-
void
|
|
1378
|
+
void chunkFDR5W67L_js.clearAudienceContent(closingSessionId);
|
|
1379
1379
|
}
|
|
1380
1380
|
}, [getChannel]);
|
|
1381
1381
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1393,10 +1393,10 @@ function usePresenterWindow(input) {
|
|
|
1393
1393
|
audienceWindowRef.current = blankWin;
|
|
1394
1394
|
const sessionId = generateSessionId();
|
|
1395
1395
|
sessionIdRef.current = sessionId;
|
|
1396
|
-
const audienceUrl =
|
|
1397
|
-
void
|
|
1396
|
+
const audienceUrl = chunkFDR5W67L_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1397
|
+
void chunkFDR5W67L_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1398
1398
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1399
|
-
|
|
1399
|
+
chunkFDR5W67L_js.placeAudienceWindow(blankWin, placement);
|
|
1400
1400
|
}
|
|
1401
1401
|
return void 0;
|
|
1402
1402
|
});
|
|
@@ -1426,7 +1426,7 @@ function usePresenterWindow(input) {
|
|
|
1426
1426
|
}
|
|
1427
1427
|
};
|
|
1428
1428
|
if (content) {
|
|
1429
|
-
void
|
|
1429
|
+
void chunkFDR5W67L_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1430
1430
|
} else {
|
|
1431
1431
|
navigateOrClose(true);
|
|
1432
1432
|
}
|
|
@@ -1452,7 +1452,7 @@ function usePresenterWindow(input) {
|
|
|
1452
1452
|
}
|
|
1453
1453
|
const handleMessage = (event) => {
|
|
1454
1454
|
const message = event.data;
|
|
1455
|
-
if (
|
|
1455
|
+
if (chunkFDR5W67L_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1456
1456
|
syncStateToAudience(snapshotRef.current);
|
|
1457
1457
|
}
|
|
1458
1458
|
};
|
|
@@ -1481,7 +1481,7 @@ function usePresenterWindow(input) {
|
|
|
1481
1481
|
react.useEffect(() => {
|
|
1482
1482
|
const handleBeforeUnload = () => {
|
|
1483
1483
|
if (sessionIdRef.current) {
|
|
1484
|
-
void
|
|
1484
|
+
void chunkFDR5W67L_js.clearAudienceContent(sessionIdRef.current);
|
|
1485
1485
|
}
|
|
1486
1486
|
};
|
|
1487
1487
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1543,7 +1543,7 @@ function useAudienceMode(input) {
|
|
|
1543
1543
|
}
|
|
1544
1544
|
channel.onmessage = (event) => {
|
|
1545
1545
|
const data = event.data;
|
|
1546
|
-
if (!
|
|
1546
|
+
if (!chunkFDR5W67L_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1547
1547
|
return;
|
|
1548
1548
|
}
|
|
1549
1549
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1559,16 +1559,16 @@ function useAudienceMode(input) {
|
|
|
1559
1559
|
}
|
|
1560
1560
|
if (data.type === "presenter-exit") {
|
|
1561
1561
|
if (expectedSessionId) {
|
|
1562
|
-
void
|
|
1562
|
+
void chunkFDR5W67L_js.clearAudienceContent(expectedSessionId);
|
|
1563
1563
|
}
|
|
1564
|
-
if (
|
|
1564
|
+
if (chunkFDR5W67L_js.endAudienceDisplay(window)) {
|
|
1565
1565
|
handlers.onPresenterEnded?.();
|
|
1566
1566
|
}
|
|
1567
1567
|
}
|
|
1568
1568
|
};
|
|
1569
1569
|
if (expectedSessionId) {
|
|
1570
1570
|
channel.postMessage({
|
|
1571
|
-
origin:
|
|
1571
|
+
origin: chunkFDR5W67L_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1572
1572
|
type: "audience-ready",
|
|
1573
1573
|
sessionId: expectedSessionId
|
|
1574
1574
|
});
|
|
@@ -1601,14 +1601,14 @@ function usePresentationKeyboard(input) {
|
|
|
1601
1601
|
presentationSlideIndex,
|
|
1602
1602
|
setShowRehearsalSummary
|
|
1603
1603
|
} = input;
|
|
1604
|
-
const keyBufferRef = react.useRef(
|
|
1604
|
+
const keyBufferRef = react.useRef(chunkFDR5W67L_js.createPresentationKeyBuffer());
|
|
1605
1605
|
react.useEffect(() => {
|
|
1606
|
-
if (mode !== "present" || !
|
|
1607
|
-
keyBufferRef.current =
|
|
1606
|
+
if (mode !== "present" || !chunkFDR5W67L_js.acceptsPresentationInput()) {
|
|
1607
|
+
keyBufferRef.current = chunkFDR5W67L_js.createPresentationKeyBuffer();
|
|
1608
1608
|
return;
|
|
1609
1609
|
}
|
|
1610
1610
|
const handleKeyDown = (event) => {
|
|
1611
|
-
const mapped =
|
|
1611
|
+
const mapped = chunkFDR5W67L_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1612
1612
|
if (mapped.action === "none") {
|
|
1613
1613
|
return;
|
|
1614
1614
|
}
|
|
@@ -1628,12 +1628,12 @@ function usePresentationKeyboard(input) {
|
|
|
1628
1628
|
movePresentationSlide(-1);
|
|
1629
1629
|
return;
|
|
1630
1630
|
case "first": {
|
|
1631
|
-
const first =
|
|
1631
|
+
const first = chunkFDR5W67L_js.firstShowSlideIndex(showSlideIndexes);
|
|
1632
1632
|
navigateToSlide(first ?? 0);
|
|
1633
1633
|
return;
|
|
1634
1634
|
}
|
|
1635
1635
|
case "last": {
|
|
1636
|
-
const last =
|
|
1636
|
+
const last = chunkFDR5W67L_js.lastShowSlideIndex(showSlideIndexes);
|
|
1637
1637
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1638
1638
|
return;
|
|
1639
1639
|
}
|
|
@@ -1788,7 +1788,7 @@ function useRehearsalTimings(input) {
|
|
|
1788
1788
|
|
|
1789
1789
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1790
1790
|
function handlePresentationActionImpl(action, deps) {
|
|
1791
|
-
|
|
1791
|
+
chunkFDR5W67L_js.runPresentationAction(
|
|
1792
1792
|
action,
|
|
1793
1793
|
{ slideCount: deps.slidesLength },
|
|
1794
1794
|
{
|
|
@@ -1810,7 +1810,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1810
1810
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1811
1811
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1812
1812
|
const transition = incomingSlide?.transition;
|
|
1813
|
-
const durationMs = deps.playTransition ?
|
|
1813
|
+
const durationMs = deps.playTransition ? chunkFDR5W67L_js.resolveTransitionDurationMs(transition) : 0;
|
|
1814
1814
|
deps.clearPresentationTimers();
|
|
1815
1815
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1816
1816
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1869,7 +1869,7 @@ function useSlideNavigation(input) {
|
|
|
1869
1869
|
});
|
|
1870
1870
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1871
1871
|
(slideIndex) => {
|
|
1872
|
-
const delayMs =
|
|
1872
|
+
const delayMs = chunkFDR5W67L_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1873
1873
|
if (delayMs === void 0) {
|
|
1874
1874
|
return;
|
|
1875
1875
|
}
|
|
@@ -1892,7 +1892,7 @@ function useSlideNavigation(input) {
|
|
|
1892
1892
|
if (availableSlideIndexes.length === 0) {
|
|
1893
1893
|
return;
|
|
1894
1894
|
}
|
|
1895
|
-
const pastLastSlide = direction === 1 && !
|
|
1895
|
+
const pastLastSlide = direction === 1 && !chunkFDR5W67L_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1896
1896
|
if (rehearsing && pastLastSlide) {
|
|
1897
1897
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1898
1898
|
try {
|
|
@@ -1910,9 +1910,9 @@ function useSlideNavigation(input) {
|
|
|
1910
1910
|
onAdvancePastLastSlide();
|
|
1911
1911
|
return;
|
|
1912
1912
|
}
|
|
1913
|
-
const nextSlideIndex = direction === 1 ?
|
|
1913
|
+
const nextSlideIndex = direction === 1 ? chunkFDR5W67L_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1914
1914
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
1915
|
-
}) :
|
|
1915
|
+
}) : chunkFDR5W67L_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
1916
1916
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
1917
1917
|
return;
|
|
1918
1918
|
}
|
|
@@ -2053,17 +2053,17 @@ function useZoomNavigation(input) {
|
|
|
2053
2053
|
};
|
|
2054
2054
|
}
|
|
2055
2055
|
function usePresenterConsole(slideIndex) {
|
|
2056
|
-
const timerRef = react.useRef(
|
|
2057
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2056
|
+
const timerRef = react.useRef(chunkFDR5W67L_js.createPresenterTimer());
|
|
2057
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkFDR5W67L_js.createInitialPresentationSnapshot(slideIndex));
|
|
2058
2058
|
const patch = react.useCallback((value) => {
|
|
2059
|
-
setSnapshot((current) =>
|
|
2059
|
+
setSnapshot((current) => chunkFDR5W67L_js.mergePresentationSnapshot(current, value));
|
|
2060
2060
|
}, []);
|
|
2061
2061
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2062
2062
|
react.useEffect(() => {
|
|
2063
2063
|
const timer = window.setInterval(() => {
|
|
2064
2064
|
patch({
|
|
2065
2065
|
paused: timerRef.current.paused,
|
|
2066
|
-
elapsedMs:
|
|
2066
|
+
elapsedMs: chunkFDR5W67L_js.presenterElapsed(timerRef.current)
|
|
2067
2067
|
});
|
|
2068
2068
|
}, 1e3);
|
|
2069
2069
|
return () => window.clearInterval(timer);
|
|
@@ -2073,19 +2073,19 @@ function usePresenterConsole(slideIndex) {
|
|
|
2073
2073
|
applyAudienceSnapshot: setSnapshot,
|
|
2074
2074
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2075
2075
|
toggleTimer: () => {
|
|
2076
|
-
timerRef.current =
|
|
2076
|
+
timerRef.current = chunkFDR5W67L_js.togglePresenterTimer(timerRef.current);
|
|
2077
2077
|
patch({
|
|
2078
2078
|
paused: timerRef.current.paused,
|
|
2079
|
-
elapsedMs:
|
|
2079
|
+
elapsedMs: chunkFDR5W67L_js.presenterElapsed(timerRef.current)
|
|
2080
2080
|
});
|
|
2081
2081
|
},
|
|
2082
2082
|
resetTimer: () => {
|
|
2083
|
-
timerRef.current =
|
|
2083
|
+
timerRef.current = chunkFDR5W67L_js.resetPresenterTimer();
|
|
2084
2084
|
patch({ paused: false, elapsedMs: 0 });
|
|
2085
2085
|
},
|
|
2086
2086
|
stepZoom: (direction) => setSnapshot(
|
|
2087
|
-
(current) =>
|
|
2088
|
-
zoom:
|
|
2087
|
+
(current) => chunkFDR5W67L_js.mergePresentationSnapshot(current, {
|
|
2088
|
+
zoom: chunkFDR5W67L_js.stepPresenterZoom(
|
|
2089
2089
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2090
2090
|
direction
|
|
2091
2091
|
)
|
|
@@ -2130,7 +2130,7 @@ function usePresentationMode(input) {
|
|
|
2130
2130
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2131
2131
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2132
2132
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2133
|
-
const showGuard = react.useMemo(() =>
|
|
2133
|
+
const showGuard = react.useMemo(() => chunkFDR5W67L_js.createPresenterShowGuard(), []);
|
|
2134
2134
|
const {
|
|
2135
2135
|
presentationAnimations,
|
|
2136
2136
|
presentationElementStates,
|
|
@@ -2206,7 +2206,7 @@ function usePresentationMode(input) {
|
|
|
2206
2206
|
});
|
|
2207
2207
|
const movePresentationSlide = react.useCallback(
|
|
2208
2208
|
(direction, trigger = "explicit") => {
|
|
2209
|
-
if (!
|
|
2209
|
+
if (!chunkFDR5W67L_js.acceptsPresentationInput()) {
|
|
2210
2210
|
return;
|
|
2211
2211
|
}
|
|
2212
2212
|
if (endOfShowVisible) {
|
|
@@ -2343,7 +2343,7 @@ function usePresentationMode(input) {
|
|
|
2343
2343
|
if (mode !== "present") {
|
|
2344
2344
|
return;
|
|
2345
2345
|
}
|
|
2346
|
-
return
|
|
2346
|
+
return chunkFDR5W67L_js.attachPresentationVisibilityPause({
|
|
2347
2347
|
root: containerRef.current ?? void 0,
|
|
2348
2348
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2349
2349
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2423,11 +2423,11 @@ function usePresentationMode(input) {
|
|
|
2423
2423
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2424
2424
|
return void 0;
|
|
2425
2425
|
}
|
|
2426
|
-
return
|
|
2426
|
+
return chunkFDR5W67L_js.buildMorphTransitionPlan(
|
|
2427
2427
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2428
2428
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2429
2429
|
transitionOverlay.durationMs,
|
|
2430
|
-
|
|
2430
|
+
chunkFDR5W67L_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2431
2431
|
);
|
|
2432
2432
|
}, [transitionOverlay, slides]);
|
|
2433
2433
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2733,7 +2733,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2733
2733
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2734
2734
|
slides.forEach((slide, slideIndex) => {
|
|
2735
2735
|
for (const element of slide.elements || []) {
|
|
2736
|
-
if (!
|
|
2736
|
+
if (!chunkFDR5W67L_js.hasTextProperties(element)) {
|
|
2737
2737
|
continue;
|
|
2738
2738
|
}
|
|
2739
2739
|
const segments = element.textSegments ?? [];
|
|
@@ -2784,7 +2784,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2784
2784
|
continue;
|
|
2785
2785
|
}
|
|
2786
2786
|
const element = slide.elements[elIdx];
|
|
2787
|
-
if (!
|
|
2787
|
+
if (!chunkFDR5W67L_js.hasTextProperties(element)) {
|
|
2788
2788
|
continue;
|
|
2789
2789
|
}
|
|
2790
2790
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3382,7 +3382,7 @@ function useViewerCoreState(_input) {
|
|
|
3382
3382
|
const shapeAdjustmentDragStateRef = react.useRef(null);
|
|
3383
3383
|
const marqueeStateRef = react.useRef(null);
|
|
3384
3384
|
const isDrawingRef = react.useRef(false);
|
|
3385
|
-
const livePatcher = react.useMemo(() =>
|
|
3385
|
+
const livePatcher = react.useMemo(() => chunkFDR5W67L_js.createCollaborationLivePatcher(), []);
|
|
3386
3386
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3387
3387
|
const slidesRef = react.useRef([]);
|
|
3388
3388
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3391,8 +3391,8 @@ function useViewerCoreState(_input) {
|
|
|
3391
3391
|
const [slides, setSlides] = react.useState([]);
|
|
3392
3392
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3393
3393
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3394
|
-
width:
|
|
3395
|
-
height:
|
|
3394
|
+
width: chunkDOS7NY7C_js.DEFAULT_CANVAS_WIDTH,
|
|
3395
|
+
height: chunkDOS7NY7C_js.DEFAULT_CANVAS_HEIGHT
|
|
3396
3396
|
});
|
|
3397
3397
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
3398
3398
|
const [selectedElementId, setSelectedElementId] = react.useState(null);
|
|
@@ -3412,7 +3412,7 @@ function useViewerCoreState(_input) {
|
|
|
3412
3412
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3413
3413
|
inlineEditingTextRef.current = resolved;
|
|
3414
3414
|
setInlineEditingTextBase(value);
|
|
3415
|
-
|
|
3415
|
+
chunkFDR5W67L_js.publishLiveInlineText(
|
|
3416
3416
|
livePatcher,
|
|
3417
3417
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3418
3418
|
inlineEditingElementIdRef.current,
|
|
@@ -3746,7 +3746,7 @@ function useLoadContent({
|
|
|
3746
3746
|
);
|
|
3747
3747
|
}
|
|
3748
3748
|
const previousHandler = handlerRef.current;
|
|
3749
|
-
const handler = new
|
|
3749
|
+
const handler = new chunkFDR5W67L_js.PptxHandler();
|
|
3750
3750
|
const parsed = await handler.load(buffer);
|
|
3751
3751
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3752
3752
|
handler.dispose();
|
|
@@ -3758,7 +3758,7 @@ function useLoadContent({
|
|
|
3758
3758
|
handlerRef.current = null;
|
|
3759
3759
|
const mediaElements = [];
|
|
3760
3760
|
for (const slide of parsed.slides) {
|
|
3761
|
-
|
|
3761
|
+
chunkFDR5W67L_js.collectMediaElements(slide.elements, mediaElements);
|
|
3762
3762
|
}
|
|
3763
3763
|
for (const url of mediaDataUrls.values()) {
|
|
3764
3764
|
if (url.startsWith("blob:")) {
|
|
@@ -3799,7 +3799,7 @@ function useLoadContent({
|
|
|
3799
3799
|
}
|
|
3800
3800
|
})
|
|
3801
3801
|
);
|
|
3802
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3802
|
+
const { paths: imagePaths, refs: imageRefs } = chunkFDR5W67L_js.collectImagePaths(parsed.slides);
|
|
3803
3803
|
let nextSlides = parsed.slides;
|
|
3804
3804
|
if (imagePaths.size > 0) {
|
|
3805
3805
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3854,12 +3854,12 @@ function useLoadContent({
|
|
|
3854
3854
|
}
|
|
3855
3855
|
}
|
|
3856
3856
|
handlerRef.current = handler;
|
|
3857
|
-
const partition =
|
|
3857
|
+
const partition = chunkDOS7NY7C_js.partitionTemplateElements(nextSlides);
|
|
3858
3858
|
setSlides(partition.slides);
|
|
3859
3859
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3860
3860
|
setCanvasSize({
|
|
3861
|
-
width: parsed.width ??
|
|
3862
|
-
height: parsed.height ??
|
|
3861
|
+
width: parsed.width ?? chunkDOS7NY7C_js.DEFAULT_CANVAS_WIDTH,
|
|
3862
|
+
height: parsed.height ?? chunkDOS7NY7C_js.DEFAULT_CANVAS_HEIGHT
|
|
3863
3863
|
});
|
|
3864
3864
|
setHeaderFooter(parsed.headerFooter ?? {});
|
|
3865
3865
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
@@ -3888,7 +3888,7 @@ function useLoadContent({
|
|
|
3888
3888
|
setHasMacros(parsed.hasMacros === true);
|
|
3889
3889
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3890
3890
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3891
|
-
setGuides(
|
|
3891
|
+
setGuides(chunkFDR5W67L_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3892
3892
|
setActiveSlideIndex(0);
|
|
3893
3893
|
clearSelection();
|
|
3894
3894
|
setIsDirty(false);
|
|
@@ -3896,7 +3896,7 @@ function useLoadContent({
|
|
|
3896
3896
|
onContentApplied?.();
|
|
3897
3897
|
} catch (err) {
|
|
3898
3898
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3899
|
-
if (err instanceof
|
|
3899
|
+
if (err instanceof chunkFDR5W67L_js.EncryptedFileError) {
|
|
3900
3900
|
setIsEncrypted(true);
|
|
3901
3901
|
} else {
|
|
3902
3902
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3973,7 +3973,7 @@ function useAutosave(input) {
|
|
|
3973
3973
|
isSavingRef.current = false;
|
|
3974
3974
|
return;
|
|
3975
3975
|
}
|
|
3976
|
-
await
|
|
3976
|
+
await chunkFDR5W67L_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
3977
3977
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
3978
3978
|
} catch (err) {
|
|
3979
3979
|
setAutosaveStatus({
|
|
@@ -4038,7 +4038,7 @@ function useElementOperations(input) {
|
|
|
4038
4038
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
4039
4039
|
const updateElementById = react.useCallback(
|
|
4040
4040
|
(elementId, updates) => {
|
|
4041
|
-
if (
|
|
4041
|
+
if (chunkFDR5W67L_js.isTemplateElementId(elementId)) {
|
|
4042
4042
|
const slideId = activeSlide?.id;
|
|
4043
4043
|
if (slideId) {
|
|
4044
4044
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4078,7 +4078,7 @@ function useElementOperations(input) {
|
|
|
4078
4078
|
);
|
|
4079
4079
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4080
4080
|
(updates) => {
|
|
4081
|
-
if (!selectedElement || !
|
|
4081
|
+
if (!selectedElement || !chunkFDR5W67L_js.hasShapeProperties(selectedElement)) {
|
|
4082
4082
|
return;
|
|
4083
4083
|
}
|
|
4084
4084
|
updateSelectedElement({
|
|
@@ -4089,17 +4089,17 @@ function useElementOperations(input) {
|
|
|
4089
4089
|
);
|
|
4090
4090
|
const updateSelectedTextStyle = react.useCallback(
|
|
4091
4091
|
(updates) => {
|
|
4092
|
-
if (!selectedElement || !
|
|
4092
|
+
if (!selectedElement || !chunkFDR5W67L_js.hasTextProperties(selectedElement)) {
|
|
4093
4093
|
return;
|
|
4094
4094
|
}
|
|
4095
|
-
const inlineSel =
|
|
4095
|
+
const inlineSel = chunkFDR5W67L_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4096
4096
|
if (inlineSel && selectedElement.textSegments) {
|
|
4097
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4097
|
+
const { newSegments: newSegments2, newSelection } = chunkFDR5W67L_js.applyStyleToSelectedSegments(
|
|
4098
4098
|
selectedElement.textSegments,
|
|
4099
4099
|
inlineSel,
|
|
4100
4100
|
updates
|
|
4101
4101
|
);
|
|
4102
|
-
|
|
4102
|
+
chunkFDR5W67L_js.setPendingSelectionRestore(newSelection);
|
|
4103
4103
|
updateSelectedElement({
|
|
4104
4104
|
textSegments: newSegments2
|
|
4105
4105
|
});
|
|
@@ -4119,12 +4119,12 @@ function useElementOperations(input) {
|
|
|
4119
4119
|
);
|
|
4120
4120
|
const updateSelectedTextCase = react.useCallback(
|
|
4121
4121
|
(mode) => {
|
|
4122
|
-
if (!selectedElement || !
|
|
4122
|
+
if (!selectedElement || !chunkFDR5W67L_js.hasTextProperties(selectedElement)) {
|
|
4123
4123
|
return;
|
|
4124
4124
|
}
|
|
4125
|
-
const inlineSel =
|
|
4125
|
+
const inlineSel = chunkFDR5W67L_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4126
4126
|
if (inlineSel && selectedElement.textSegments) {
|
|
4127
|
-
const newSegments =
|
|
4127
|
+
const newSegments = chunkFDR5W67L_js.applyCaseTransformToSegments(
|
|
4128
4128
|
selectedElement.textSegments,
|
|
4129
4129
|
inlineSel,
|
|
4130
4130
|
mode
|
|
@@ -4134,14 +4134,14 @@ function useElementOperations(input) {
|
|
|
4134
4134
|
}
|
|
4135
4135
|
const updates = {};
|
|
4136
4136
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4137
|
-
updates.textSegments =
|
|
4137
|
+
updates.textSegments = chunkFDR5W67L_js.applyCaseTransformToSegments(
|
|
4138
4138
|
selectedElement.textSegments,
|
|
4139
4139
|
null,
|
|
4140
4140
|
mode
|
|
4141
4141
|
);
|
|
4142
4142
|
}
|
|
4143
4143
|
if (typeof selectedElement.text === "string") {
|
|
4144
|
-
updates.text =
|
|
4144
|
+
updates.text = chunkFDR5W67L_js.transformTextCase(selectedElement.text, mode);
|
|
4145
4145
|
}
|
|
4146
4146
|
updateSelectedElement(updates);
|
|
4147
4147
|
},
|
|
@@ -4196,7 +4196,7 @@ function useSectionOperations(input) {
|
|
|
4196
4196
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4197
4197
|
const addSection2 = react.useCallback(
|
|
4198
4198
|
(name, afterSlideIndex) => {
|
|
4199
|
-
const result =
|
|
4199
|
+
const result = chunkFDR5W67L_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4200
4200
|
setSlides(result.slides);
|
|
4201
4201
|
setSections(result.sections);
|
|
4202
4202
|
markDirty();
|
|
@@ -4205,7 +4205,7 @@ function useSectionOperations(input) {
|
|
|
4205
4205
|
);
|
|
4206
4206
|
const renameSection2 = react.useCallback(
|
|
4207
4207
|
(sectionId, newName) => {
|
|
4208
|
-
const result =
|
|
4208
|
+
const result = chunkFDR5W67L_js.renameSection(sections, slides, sectionId, newName);
|
|
4209
4209
|
setSections(result.sections);
|
|
4210
4210
|
setSlides(result.slides);
|
|
4211
4211
|
markDirty();
|
|
@@ -4214,7 +4214,7 @@ function useSectionOperations(input) {
|
|
|
4214
4214
|
);
|
|
4215
4215
|
const deleteSection2 = react.useCallback(
|
|
4216
4216
|
(sectionId) => {
|
|
4217
|
-
const result =
|
|
4217
|
+
const result = chunkFDR5W67L_js.deleteSection(sections, slides, sectionId);
|
|
4218
4218
|
setSections(result.sections);
|
|
4219
4219
|
setSlides(result.slides);
|
|
4220
4220
|
markDirty();
|
|
@@ -4223,21 +4223,21 @@ function useSectionOperations(input) {
|
|
|
4223
4223
|
);
|
|
4224
4224
|
const moveSectionUp2 = react.useCallback(
|
|
4225
4225
|
(sectionId) => {
|
|
4226
|
-
setSections(
|
|
4226
|
+
setSections(chunkFDR5W67L_js.moveSectionUp(sections, sectionId));
|
|
4227
4227
|
markDirty();
|
|
4228
4228
|
},
|
|
4229
4229
|
[sections, setSections, markDirty]
|
|
4230
4230
|
);
|
|
4231
4231
|
const moveSectionDown2 = react.useCallback(
|
|
4232
4232
|
(sectionId) => {
|
|
4233
|
-
setSections(
|
|
4233
|
+
setSections(chunkFDR5W67L_js.moveSectionDown(sections, sectionId));
|
|
4234
4234
|
markDirty();
|
|
4235
4235
|
},
|
|
4236
4236
|
[sections, setSections, markDirty]
|
|
4237
4237
|
);
|
|
4238
4238
|
const moveSlidesToSection2 = react.useCallback(
|
|
4239
4239
|
(slideIndexes, targetSectionId) => {
|
|
4240
|
-
const result =
|
|
4240
|
+
const result = chunkFDR5W67L_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4241
4241
|
setSlides(result.slides);
|
|
4242
4242
|
setSections(result.sections);
|
|
4243
4243
|
markDirty();
|
|
@@ -4256,19 +4256,19 @@ function useSectionOperations(input) {
|
|
|
4256
4256
|
|
|
4257
4257
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4258
4258
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4259
|
-
const resized =
|
|
4259
|
+
const resized = chunkFDR5W67L_js.applyResize(
|
|
4260
4260
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4261
4261
|
handle,
|
|
4262
4262
|
dx,
|
|
4263
4263
|
dy,
|
|
4264
4264
|
1,
|
|
4265
|
-
{ minSize:
|
|
4265
|
+
{ minSize: chunkDOS7NY7C_js.MIN_ELEMENT_SIZE }
|
|
4266
4266
|
);
|
|
4267
4267
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4268
4268
|
if (!snapToGrid) {
|
|
4269
4269
|
return box;
|
|
4270
4270
|
}
|
|
4271
|
-
return
|
|
4271
|
+
return chunkFDR5W67L_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkDOS7NY7C_js.MIN_ELEMENT_SIZE);
|
|
4272
4272
|
}
|
|
4273
4273
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
4274
4274
|
const range = startWidth || 200;
|
|
@@ -4386,7 +4386,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4386
4386
|
width: el.width,
|
|
4387
4387
|
height: el.height
|
|
4388
4388
|
}));
|
|
4389
|
-
const snapResult =
|
|
4389
|
+
const snapResult = chunkFDR5W67L_js.computeSnapToShape(
|
|
4390
4390
|
targetX,
|
|
4391
4391
|
targetY,
|
|
4392
4392
|
primaryEl.width,
|
|
@@ -4425,7 +4425,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4425
4425
|
if (live) {
|
|
4426
4426
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4427
4427
|
const start = drag.startPositionsById[id];
|
|
4428
|
-
|
|
4428
|
+
chunkFDR5W67L_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4429
4429
|
x: start.x + appliedDx,
|
|
4430
4430
|
y: start.y + appliedDy
|
|
4431
4431
|
});
|
|
@@ -4459,15 +4459,15 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4459
4459
|
if (rs.domEl) {
|
|
4460
4460
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4461
4461
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4462
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4463
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4462
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunkDOS7NY7C_js.MIN_ELEMENT_SIZE)}px`;
|
|
4463
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunkDOS7NY7C_js.MIN_ELEMENT_SIZE)}px`;
|
|
4464
4464
|
}
|
|
4465
4465
|
if (live) {
|
|
4466
|
-
|
|
4466
|
+
chunkFDR5W67L_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4467
4467
|
x: geo.x,
|
|
4468
4468
|
y: geo.y,
|
|
4469
|
-
width: Math.max(geo.width,
|
|
4470
|
-
height: Math.max(geo.height,
|
|
4469
|
+
width: Math.max(geo.width, chunkDOS7NY7C_js.MIN_ELEMENT_SIZE),
|
|
4470
|
+
height: Math.max(geo.height, chunkDOS7NY7C_js.MIN_ELEMENT_SIZE)
|
|
4471
4471
|
});
|
|
4472
4472
|
}
|
|
4473
4473
|
}
|
|
@@ -4547,13 +4547,13 @@ function processPointerUp(input) {
|
|
|
4547
4547
|
if (i !== activeSlideIndex) {
|
|
4548
4548
|
return s;
|
|
4549
4549
|
}
|
|
4550
|
-
const rerouted =
|
|
4550
|
+
const rerouted = chunkFDR5W67L_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4551
4551
|
if (rerouted.length === 0) {
|
|
4552
4552
|
return s;
|
|
4553
4553
|
}
|
|
4554
4554
|
return {
|
|
4555
4555
|
...s,
|
|
4556
|
-
elements:
|
|
4556
|
+
elements: chunkFDR5W67L_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4557
4557
|
};
|
|
4558
4558
|
})
|
|
4559
4559
|
);
|
|
@@ -4575,9 +4575,9 @@ function processPointerUp(input) {
|
|
|
4575
4575
|
}
|
|
4576
4576
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4577
4577
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4578
|
-
const hitIds =
|
|
4578
|
+
const hitIds = chunkFDR5W67L_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4579
4579
|
if (marquee.additive) {
|
|
4580
|
-
const merged =
|
|
4580
|
+
const merged = chunkFDR5W67L_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4581
4581
|
if (merged.length > 0) {
|
|
4582
4582
|
applySelection(merged[0], merged);
|
|
4583
4583
|
} else {
|
|
@@ -4600,8 +4600,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4600
4600
|
}
|
|
4601
4601
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4602
4602
|
});
|
|
4603
|
-
const rerouted =
|
|
4604
|
-
return
|
|
4603
|
+
const rerouted = chunkFDR5W67L_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4604
|
+
return chunkFDR5W67L_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4605
4605
|
};
|
|
4606
4606
|
if (editTemplateMode) {
|
|
4607
4607
|
const slideId = activeSlide?.id;
|
|
@@ -4757,9 +4757,9 @@ function useCanvasInteractions(input) {
|
|
|
4757
4757
|
return;
|
|
4758
4758
|
}
|
|
4759
4759
|
const el = elementLookup.get(editId);
|
|
4760
|
-
if (el &&
|
|
4760
|
+
if (el && chunkFDR5W67L_js.hasTextProperties(el)) {
|
|
4761
4761
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4762
|
-
const newSegments =
|
|
4762
|
+
const newSegments = chunkFDR5W67L_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4763
4763
|
ops.updateElementById(editId, {
|
|
4764
4764
|
text: committedText,
|
|
4765
4765
|
textSegments: newSegments
|
|
@@ -4770,7 +4770,7 @@ function useCanvasInteractions(input) {
|
|
|
4770
4770
|
setInlineEditingText("");
|
|
4771
4771
|
};
|
|
4772
4772
|
const openEquationEditorForElement = (el) => {
|
|
4773
|
-
if (!
|
|
4773
|
+
if (!chunkFDR5W67L_js.hasTextProperties(el)) {
|
|
4774
4774
|
return false;
|
|
4775
4775
|
}
|
|
4776
4776
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4799,7 +4799,7 @@ function useCanvasInteractions(input) {
|
|
|
4799
4799
|
justSelectedRef.current = false;
|
|
4800
4800
|
} else {
|
|
4801
4801
|
const el = elementLookup.get(elementId);
|
|
4802
|
-
if (el &&
|
|
4802
|
+
if (el && chunkFDR5W67L_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
4803
4803
|
if (!openEquationEditorForElement(el)) {
|
|
4804
4804
|
setInlineEditingElementId(elementId);
|
|
4805
4805
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4818,7 +4818,7 @@ function useCanvasInteractions(input) {
|
|
|
4818
4818
|
if (openEquationEditorForElement(el)) {
|
|
4819
4819
|
return;
|
|
4820
4820
|
}
|
|
4821
|
-
if (
|
|
4821
|
+
if (chunkFDR5W67L_js.hasTextProperties(el)) {
|
|
4822
4822
|
setInlineEditingElementId(elementId);
|
|
4823
4823
|
setInlineEditingText(el.text ?? "");
|
|
4824
4824
|
}
|
|
@@ -5011,7 +5011,7 @@ function createFileHandlers(deps) {
|
|
|
5011
5011
|
h = Math.round(h * scale);
|
|
5012
5012
|
}
|
|
5013
5013
|
addElement({
|
|
5014
|
-
id:
|
|
5014
|
+
id: chunkFDR5W67L_js.generateElementId(),
|
|
5015
5015
|
type: "image",
|
|
5016
5016
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5017
5017
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5022,7 +5022,7 @@ function createFileHandlers(deps) {
|
|
|
5022
5022
|
};
|
|
5023
5023
|
img.onerror = () => {
|
|
5024
5024
|
addElement({
|
|
5025
|
-
id:
|
|
5025
|
+
id: chunkFDR5W67L_js.generateElementId(),
|
|
5026
5026
|
type: "image",
|
|
5027
5027
|
x: 100,
|
|
5028
5028
|
y: 100,
|
|
@@ -5048,7 +5048,7 @@ function createFileHandlers(deps) {
|
|
|
5048
5048
|
const elFilePath = file.path;
|
|
5049
5049
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5050
5050
|
addElement({
|
|
5051
|
-
id:
|
|
5051
|
+
id: chunkFDR5W67L_js.generateElementId(),
|
|
5052
5052
|
type: "media",
|
|
5053
5053
|
mediaType,
|
|
5054
5054
|
mediaMimeType: file.type || void 0,
|
|
@@ -5223,13 +5223,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5223
5223
|
return;
|
|
5224
5224
|
}
|
|
5225
5225
|
addElement({
|
|
5226
|
-
id:
|
|
5226
|
+
id: chunkFDR5W67L_js.generateElementId(),
|
|
5227
5227
|
type: "smartArt",
|
|
5228
5228
|
x: 100,
|
|
5229
5229
|
y: 120,
|
|
5230
5230
|
width: 600,
|
|
5231
5231
|
height: 340,
|
|
5232
|
-
smartArtData:
|
|
5232
|
+
smartArtData: chunkFDR5W67L_js.buildSmartArtPresetData(
|
|
5233
5233
|
layout,
|
|
5234
5234
|
defaultItems,
|
|
5235
5235
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5241,7 +5241,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5241
5241
|
return;
|
|
5242
5242
|
}
|
|
5243
5243
|
addElement({
|
|
5244
|
-
id:
|
|
5244
|
+
id: chunkFDR5W67L_js.generateElementId(),
|
|
5245
5245
|
type: "shape",
|
|
5246
5246
|
x: 120,
|
|
5247
5247
|
y: 200,
|
|
@@ -5300,7 +5300,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5300
5300
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5301
5301
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5302
5302
|
addElement({
|
|
5303
|
-
id:
|
|
5303
|
+
id: chunkFDR5W67L_js.generateElementId(),
|
|
5304
5304
|
type: "shape",
|
|
5305
5305
|
x: 120,
|
|
5306
5306
|
y: 200,
|
|
@@ -5322,11 +5322,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5322
5322
|
if (!activeSlide) {
|
|
5323
5323
|
return;
|
|
5324
5324
|
}
|
|
5325
|
-
const preset =
|
|
5325
|
+
const preset = chunkFDR5W67L_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5326
5326
|
if (!preset) {
|
|
5327
5327
|
return;
|
|
5328
5328
|
}
|
|
5329
|
-
const defaultPptxAction =
|
|
5329
|
+
const defaultPptxAction = chunkFDR5W67L_js.elementActionToPptxAction({
|
|
5330
5330
|
trigger: "click",
|
|
5331
5331
|
type: preset.defaultAction
|
|
5332
5332
|
});
|
|
@@ -5335,7 +5335,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5335
5335
|
defaultPptxAction.highlightClick = true;
|
|
5336
5336
|
}
|
|
5337
5337
|
addElement({
|
|
5338
|
-
id:
|
|
5338
|
+
id: chunkFDR5W67L_js.generateElementId(),
|
|
5339
5339
|
type: "shape",
|
|
5340
5340
|
x: 150,
|
|
5341
5341
|
y: 150,
|
|
@@ -5402,14 +5402,14 @@ function useInsertElements(input) {
|
|
|
5402
5402
|
return;
|
|
5403
5403
|
}
|
|
5404
5404
|
addElement({
|
|
5405
|
-
id:
|
|
5405
|
+
id: chunkFDR5W67L_js.generateElementId(),
|
|
5406
5406
|
type: "text",
|
|
5407
5407
|
x: 100,
|
|
5408
5408
|
y: 100,
|
|
5409
5409
|
width: 300,
|
|
5410
5410
|
height: 60,
|
|
5411
5411
|
text: "",
|
|
5412
|
-
textStyle: { fontSize:
|
|
5412
|
+
textStyle: { fontSize: chunkDOS7NY7C_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5413
5413
|
});
|
|
5414
5414
|
};
|
|
5415
5415
|
const handleAddShape = () => {
|
|
@@ -5417,7 +5417,7 @@ function useInsertElements(input) {
|
|
|
5417
5417
|
return;
|
|
5418
5418
|
}
|
|
5419
5419
|
addElement({
|
|
5420
|
-
id:
|
|
5420
|
+
id: chunkFDR5W67L_js.generateElementId(),
|
|
5421
5421
|
type: "shape",
|
|
5422
5422
|
x: 150,
|
|
5423
5423
|
y: 150,
|
|
@@ -5436,15 +5436,15 @@ function useInsertElements(input) {
|
|
|
5436
5436
|
return;
|
|
5437
5437
|
}
|
|
5438
5438
|
addElement({
|
|
5439
|
-
...
|
|
5440
|
-
id:
|
|
5439
|
+
...chunkFDR5W67L_js.newTableElement(chunkDOS7NY7C_js.DEFAULT_TABLE_ROWS, chunkDOS7NY7C_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5440
|
+
id: chunkFDR5W67L_js.generateElementId()
|
|
5441
5441
|
});
|
|
5442
5442
|
};
|
|
5443
5443
|
const handleAddChart = (chartType) => {
|
|
5444
5444
|
if (!activeSlide) {
|
|
5445
5445
|
return;
|
|
5446
5446
|
}
|
|
5447
|
-
addElement(
|
|
5447
|
+
addElement(chunkFDR5W67L_js.createDefaultChartElement(chartType));
|
|
5448
5448
|
};
|
|
5449
5449
|
const structured = createStructuredElementHandlers({
|
|
5450
5450
|
activeSlide,
|
|
@@ -5514,7 +5514,7 @@ function useClipboardHandlers(input) {
|
|
|
5514
5514
|
if (!selectedElement) {
|
|
5515
5515
|
return;
|
|
5516
5516
|
}
|
|
5517
|
-
setClipboardPayload(
|
|
5517
|
+
setClipboardPayload(chunkFDR5W67L_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5518
5518
|
};
|
|
5519
5519
|
const handleDelete = () => {
|
|
5520
5520
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5531,7 +5531,7 @@ function useClipboardHandlers(input) {
|
|
|
5531
5531
|
handleDelete();
|
|
5532
5532
|
};
|
|
5533
5533
|
const insertClone = (source) => {
|
|
5534
|
-
const clone =
|
|
5534
|
+
const clone = chunkFDR5W67L_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5535
5535
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5536
5536
|
ops.applySelection(clone.id);
|
|
5537
5537
|
history.markDirty();
|
|
@@ -5566,7 +5566,7 @@ function resolveShapePath(el) {
|
|
|
5566
5566
|
return el.pathData;
|
|
5567
5567
|
}
|
|
5568
5568
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5569
|
-
const clipPath =
|
|
5569
|
+
const clipPath = chunkFDR5W67L_js.getPresetShapeClipPath(el.shapeType);
|
|
5570
5570
|
if (clipPath) {
|
|
5571
5571
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5572
5572
|
if (svgPath) {
|
|
@@ -5617,7 +5617,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5617
5617
|
return parts.join(" ");
|
|
5618
5618
|
}
|
|
5619
5619
|
function transformPathToGlobal(pathData, el) {
|
|
5620
|
-
const polys =
|
|
5620
|
+
const polys = chunkFDR5W67L_js.svgPathToPolygons(pathData);
|
|
5621
5621
|
if (polys.length === 0) {
|
|
5622
5622
|
return pathData;
|
|
5623
5623
|
}
|
|
@@ -5637,10 +5637,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5637
5637
|
y: pt.y * scaleY + el.y
|
|
5638
5638
|
}))
|
|
5639
5639
|
);
|
|
5640
|
-
return
|
|
5640
|
+
return chunkFDR5W67L_js.polygonsToSvgPath(transformed);
|
|
5641
5641
|
}
|
|
5642
5642
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5643
|
-
const polys =
|
|
5643
|
+
const polys = chunkFDR5W67L_js.svgPathToPolygons(pathData);
|
|
5644
5644
|
if (polys.length === 0) {
|
|
5645
5645
|
return pathData;
|
|
5646
5646
|
}
|
|
@@ -5650,10 +5650,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5650
5650
|
y: pt.y - y
|
|
5651
5651
|
}))
|
|
5652
5652
|
);
|
|
5653
|
-
return
|
|
5653
|
+
return chunkFDR5W67L_js.polygonsToSvgPath(transformed);
|
|
5654
5654
|
}
|
|
5655
5655
|
function pathBounds(pathData) {
|
|
5656
|
-
const polys =
|
|
5656
|
+
const polys = chunkFDR5W67L_js.svgPathToPolygons(pathData);
|
|
5657
5657
|
let minX = Infinity;
|
|
5658
5658
|
let minY = Infinity;
|
|
5659
5659
|
let maxX = -Infinity;
|
|
@@ -5712,7 +5712,7 @@ function useMergeShapesHandler(input) {
|
|
|
5712
5712
|
let allFragments = [];
|
|
5713
5713
|
let remaining = globalPaths[0];
|
|
5714
5714
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5715
|
-
const frags =
|
|
5715
|
+
const frags = chunkFDR5W67L_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5716
5716
|
if (Array.isArray(frags)) {
|
|
5717
5717
|
allFragments = frags;
|
|
5718
5718
|
}
|
|
@@ -5741,7 +5741,7 @@ function useMergeShapesHandler(input) {
|
|
|
5741
5741
|
bounds.height
|
|
5742
5742
|
);
|
|
5743
5743
|
const newEl = {
|
|
5744
|
-
id:
|
|
5744
|
+
id: chunkFDR5W67L_js.generateElementId(),
|
|
5745
5745
|
type: "shape",
|
|
5746
5746
|
x: bounds.x,
|
|
5747
5747
|
y: bounds.y,
|
|
@@ -5779,7 +5779,7 @@ function useMergeShapesHandler(input) {
|
|
|
5779
5779
|
} else {
|
|
5780
5780
|
let resultPath = globalPaths[0];
|
|
5781
5781
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5782
|
-
const result =
|
|
5782
|
+
const result = chunkFDR5W67L_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5783
5783
|
if (typeof result === "string") {
|
|
5784
5784
|
resultPath = result;
|
|
5785
5785
|
}
|
|
@@ -5800,7 +5800,7 @@ function useMergeShapesHandler(input) {
|
|
|
5800
5800
|
);
|
|
5801
5801
|
const primary = targets[0];
|
|
5802
5802
|
const newEl = {
|
|
5803
|
-
id:
|
|
5803
|
+
id: chunkFDR5W67L_js.generateElementId(),
|
|
5804
5804
|
type: "shape",
|
|
5805
5805
|
x: bounds.x,
|
|
5806
5806
|
y: bounds.y,
|
|
@@ -5863,7 +5863,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5863
5863
|
if (ids.length < 2 || !activeSlide) {
|
|
5864
5864
|
return;
|
|
5865
5865
|
}
|
|
5866
|
-
const { elements, groupId } =
|
|
5866
|
+
const { elements, groupId } = chunkFDR5W67L_js.groupElements(ops.activeElements, ids, chunkFDR5W67L_js.generateElementId());
|
|
5867
5867
|
if (groupId === null) {
|
|
5868
5868
|
return;
|
|
5869
5869
|
}
|
|
@@ -5876,12 +5876,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5876
5876
|
return;
|
|
5877
5877
|
}
|
|
5878
5878
|
const group = selectedElement;
|
|
5879
|
-
const intoTemplate =
|
|
5879
|
+
const intoTemplate = chunkFDR5W67L_js.isTemplateElementId(group.id);
|
|
5880
5880
|
const ungrouped = group.children.map((child) => ({
|
|
5881
5881
|
...structuredClone(child),
|
|
5882
5882
|
// Keep child ids in the same store as the group so later edits route
|
|
5883
5883
|
// correctly: template groups yield template-prefixed child ids.
|
|
5884
|
-
id: intoTemplate ?
|
|
5884
|
+
id: intoTemplate ? chunkFDR5W67L_js.makeCloneId(true, child.id || group.id) : child.id || chunkFDR5W67L_js.generateElementId(),
|
|
5885
5885
|
x: child.x + group.x,
|
|
5886
5886
|
y: child.y + group.y
|
|
5887
5887
|
}));
|
|
@@ -5905,7 +5905,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5905
5905
|
if (!edge) {
|
|
5906
5906
|
return;
|
|
5907
5907
|
}
|
|
5908
|
-
const positions =
|
|
5908
|
+
const positions = chunkFDR5W67L_js.alignElements(selectedElements, edge);
|
|
5909
5909
|
for (const [id, pos] of positions) {
|
|
5910
5910
|
const el = elementLookup.get(id);
|
|
5911
5911
|
if (!el) {
|
|
@@ -5923,7 +5923,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5923
5923
|
if (!distAxis) {
|
|
5924
5924
|
return;
|
|
5925
5925
|
}
|
|
5926
|
-
const positions =
|
|
5926
|
+
const positions = chunkFDR5W67L_js.distributeElements(selectedElements, distAxis);
|
|
5927
5927
|
for (const [id, pos] of positions) {
|
|
5928
5928
|
const el = elementLookup.get(id);
|
|
5929
5929
|
if (!el) {
|
|
@@ -5940,7 +5940,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5940
5940
|
}
|
|
5941
5941
|
const id = selectedElement.id;
|
|
5942
5942
|
ops.updateActiveElements(
|
|
5943
|
-
(els) => direction === "forward" ?
|
|
5943
|
+
(els) => direction === "forward" ? chunkFDR5W67L_js.bringForward(els, id) : direction === "backward" ? chunkFDR5W67L_js.sendBackward(els, id) : els
|
|
5944
5944
|
);
|
|
5945
5945
|
history.markDirty();
|
|
5946
5946
|
};
|
|
@@ -5950,7 +5950,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5950
5950
|
}
|
|
5951
5951
|
const id = selectedElement.id;
|
|
5952
5952
|
ops.updateActiveElements(
|
|
5953
|
-
(els) => direction === "front" ?
|
|
5953
|
+
(els) => direction === "front" ? chunkFDR5W67L_js.bringToFront(els, id) : chunkFDR5W67L_js.sendToBack(els, id)
|
|
5954
5954
|
);
|
|
5955
5955
|
history.markDirty();
|
|
5956
5956
|
};
|
|
@@ -6072,7 +6072,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
6072
6072
|
function useSlideManagement(input) {
|
|
6073
6073
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
6074
6074
|
const handleAddSlide = () => {
|
|
6075
|
-
const newSlide =
|
|
6075
|
+
const newSlide = chunkFDR5W67L_js.createBlankSlide(slides.length + 1);
|
|
6076
6076
|
ops.updateSlides((prev) => {
|
|
6077
6077
|
const next = [...prev];
|
|
6078
6078
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6135,7 +6135,7 @@ function useSlideManagement(input) {
|
|
|
6135
6135
|
}
|
|
6136
6136
|
const clone = {
|
|
6137
6137
|
...src,
|
|
6138
|
-
id:
|
|
6138
|
+
id: chunkFDR5W67L_js.makeSlideId(),
|
|
6139
6139
|
elements: src.elements.map((el) => ({
|
|
6140
6140
|
...el,
|
|
6141
6141
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6167,7 +6167,7 @@ function useSlideManagement(input) {
|
|
|
6167
6167
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6168
6168
|
const insertAt = activeSlideIndex + 1;
|
|
6169
6169
|
const draft = {
|
|
6170
|
-
...
|
|
6170
|
+
...chunkFDR5W67L_js.createBlankSlide(slides.length + 1),
|
|
6171
6171
|
layoutPath,
|
|
6172
6172
|
...layoutName ? { layoutName } : {}
|
|
6173
6173
|
};
|
|
@@ -6228,7 +6228,7 @@ function createTableMergeHandlers(input) {
|
|
|
6228
6228
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6229
6229
|
return;
|
|
6230
6230
|
}
|
|
6231
|
-
const newTableData =
|
|
6231
|
+
const newTableData = chunkFDR5W67L_js.mergeCells(
|
|
6232
6232
|
[
|
|
6233
6233
|
{ row: rowIndex, col: columnIndex },
|
|
6234
6234
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6236,7 +6236,7 @@ function createTableMergeHandlers(input) {
|
|
|
6236
6236
|
td
|
|
6237
6237
|
);
|
|
6238
6238
|
const updates = { tableData: newTableData };
|
|
6239
|
-
const newRawXml =
|
|
6239
|
+
const newRawXml = chunkFDR5W67L_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6240
6240
|
if (newRawXml) {
|
|
6241
6241
|
updates.rawXml = newRawXml;
|
|
6242
6242
|
}
|
|
@@ -6262,7 +6262,7 @@ function createTableMergeHandlers(input) {
|
|
|
6262
6262
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6263
6263
|
return;
|
|
6264
6264
|
}
|
|
6265
|
-
const newTableData =
|
|
6265
|
+
const newTableData = chunkFDR5W67L_js.mergeCells(
|
|
6266
6266
|
[
|
|
6267
6267
|
{ row: rowIndex, col: columnIndex },
|
|
6268
6268
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6270,7 +6270,7 @@ function createTableMergeHandlers(input) {
|
|
|
6270
6270
|
td
|
|
6271
6271
|
);
|
|
6272
6272
|
const updates = { tableData: newTableData };
|
|
6273
|
-
const newRawXml =
|
|
6273
|
+
const newRawXml = chunkFDR5W67L_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6274
6274
|
if (newRawXml) {
|
|
6275
6275
|
updates.rawXml = newRawXml;
|
|
6276
6276
|
}
|
|
@@ -6285,9 +6285,9 @@ function createTableMergeHandlers(input) {
|
|
|
6285
6285
|
return;
|
|
6286
6286
|
}
|
|
6287
6287
|
const td = selectedElement.tableData;
|
|
6288
|
-
const newTableData =
|
|
6288
|
+
const newTableData = chunkFDR5W67L_js.mergeCells(ts.selectedCells, td);
|
|
6289
6289
|
const updates = { tableData: newTableData };
|
|
6290
|
-
const newRawXml =
|
|
6290
|
+
const newRawXml = chunkFDR5W67L_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6291
6291
|
if (newRawXml) {
|
|
6292
6292
|
updates.rawXml = newRawXml;
|
|
6293
6293
|
}
|
|
@@ -6304,9 +6304,9 @@ function createTableMergeHandlers(input) {
|
|
|
6304
6304
|
}
|
|
6305
6305
|
const { rowIndex, columnIndex } = ts;
|
|
6306
6306
|
const td = selectedElement.tableData;
|
|
6307
|
-
const newTableData =
|
|
6307
|
+
const newTableData = chunkFDR5W67L_js.splitCell(rowIndex, columnIndex, td);
|
|
6308
6308
|
const updates = { tableData: newTableData };
|
|
6309
|
-
const newRawXml =
|
|
6309
|
+
const newRawXml = chunkFDR5W67L_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6310
6310
|
if (newRawXml) {
|
|
6311
6311
|
updates.rawXml = newRawXml;
|
|
6312
6312
|
}
|
|
@@ -6350,7 +6350,7 @@ function createTableStructHandlers(input) {
|
|
|
6350
6350
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
6351
6351
|
}
|
|
6352
6352
|
if (el.rawXml) {
|
|
6353
|
-
const newRawXml =
|
|
6353
|
+
const newRawXml = chunkFDR5W67L_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6354
6354
|
if (newRawXml) {
|
|
6355
6355
|
updates.rawXml = newRawXml;
|
|
6356
6356
|
}
|
|
@@ -6374,7 +6374,7 @@ function createTableStructHandlers(input) {
|
|
|
6374
6374
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6375
6375
|
const updates = {};
|
|
6376
6376
|
if (selectedElement.rawXml) {
|
|
6377
|
-
const newRawXml =
|
|
6377
|
+
const newRawXml = chunkFDR5W67L_js.updateCellTextStyleInRawXml(
|
|
6378
6378
|
selectedElement,
|
|
6379
6379
|
rowIndex,
|
|
6380
6380
|
colIndex,
|
|
@@ -6438,9 +6438,9 @@ function createTableStructHandlers(input) {
|
|
|
6438
6438
|
return;
|
|
6439
6439
|
}
|
|
6440
6440
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6441
|
-
const newTableData =
|
|
6441
|
+
const newTableData = chunkFDR5W67L_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6442
6442
|
const updates = { tableData: newTableData };
|
|
6443
|
-
const newRawXml =
|
|
6443
|
+
const newRawXml = chunkFDR5W67L_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6444
6444
|
if (newRawXml) {
|
|
6445
6445
|
updates.rawXml = newRawXml;
|
|
6446
6446
|
}
|
|
@@ -6453,12 +6453,12 @@ function createTableStructHandlers(input) {
|
|
|
6453
6453
|
}
|
|
6454
6454
|
const td = selectedElement.tableData;
|
|
6455
6455
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6456
|
-
const newTableData =
|
|
6456
|
+
const newTableData = chunkFDR5W67L_js.deleteTableRow(td, rowIdx);
|
|
6457
6457
|
if (newTableData === td) {
|
|
6458
6458
|
return;
|
|
6459
6459
|
}
|
|
6460
6460
|
const updates = { tableData: newTableData };
|
|
6461
|
-
const newRawXml =
|
|
6461
|
+
const newRawXml = chunkFDR5W67L_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6462
6462
|
if (newRawXml) {
|
|
6463
6463
|
updates.rawXml = newRawXml;
|
|
6464
6464
|
}
|
|
@@ -6470,9 +6470,9 @@ function createTableStructHandlers(input) {
|
|
|
6470
6470
|
return;
|
|
6471
6471
|
}
|
|
6472
6472
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6473
|
-
const newTableData =
|
|
6473
|
+
const newTableData = chunkFDR5W67L_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6474
6474
|
const updates = { tableData: newTableData };
|
|
6475
|
-
const newRawXml =
|
|
6475
|
+
const newRawXml = chunkFDR5W67L_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6476
6476
|
if (newRawXml) {
|
|
6477
6477
|
updates.rawXml = newRawXml;
|
|
6478
6478
|
}
|
|
@@ -6485,12 +6485,12 @@ function createTableStructHandlers(input) {
|
|
|
6485
6485
|
}
|
|
6486
6486
|
const td = selectedElement.tableData;
|
|
6487
6487
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6488
|
-
const newTableData =
|
|
6488
|
+
const newTableData = chunkFDR5W67L_js.deleteTableColumn(td, colIdx);
|
|
6489
6489
|
if (newTableData === td) {
|
|
6490
6490
|
return;
|
|
6491
6491
|
}
|
|
6492
6492
|
const updates = { tableData: newTableData };
|
|
6493
|
-
const newRawXml =
|
|
6493
|
+
const newRawXml = chunkFDR5W67L_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6494
6494
|
if (newRawXml) {
|
|
6495
6495
|
updates.rawXml = newRawXml;
|
|
6496
6496
|
}
|
|
@@ -6526,8 +6526,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6526
6526
|
return html2canvasPro(element, {
|
|
6527
6527
|
...options,
|
|
6528
6528
|
onclone: async (doc, clonedEl) => {
|
|
6529
|
-
await
|
|
6530
|
-
|
|
6529
|
+
await chunkFDR5W67L_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6530
|
+
chunkFDR5W67L_js.preprocessCssForCapture(clonedEl);
|
|
6531
6531
|
if (typeof userOnClone === "function") {
|
|
6532
6532
|
userOnClone(doc, clonedEl);
|
|
6533
6533
|
}
|
|
@@ -6583,7 +6583,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6583
6583
|
}
|
|
6584
6584
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6585
6585
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6586
|
-
|
|
6586
|
+
chunkFDR5W67L_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6587
6587
|
}
|
|
6588
6588
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6589
6589
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6605,15 +6605,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6605
6605
|
continue;
|
|
6606
6606
|
}
|
|
6607
6607
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6608
|
-
images.push(
|
|
6608
|
+
images.push(chunkFDR5W67L_js.canvasToJpegData(canvas));
|
|
6609
6609
|
}
|
|
6610
6610
|
onProgress?.(totalSlides, totalSlides);
|
|
6611
6611
|
setActiveSlide(currentSlideIndex);
|
|
6612
6612
|
if (images.length === 0) {
|
|
6613
6613
|
throw new Error(chunkBXAK3JFM_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6614
6614
|
}
|
|
6615
|
-
const pdfBlobUrl =
|
|
6616
|
-
|
|
6615
|
+
const pdfBlobUrl = chunkDOS7NY7C_js.buildPdfFromImageData(images);
|
|
6616
|
+
chunkFDR5W67L_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6617
6617
|
}
|
|
6618
6618
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6619
6619
|
const { scale = 2, onProgress } = options;
|
|
@@ -6661,8 +6661,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6661
6661
|
if (pages.length === 0) {
|
|
6662
6662
|
throw new Error(chunkBXAK3JFM_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6663
6663
|
}
|
|
6664
|
-
const pdfDataUrl =
|
|
6665
|
-
|
|
6664
|
+
const pdfDataUrl = chunkDOS7NY7C_js.buildNotesPdf(pages);
|
|
6665
|
+
chunkFDR5W67L_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6666
6666
|
}
|
|
6667
6667
|
|
|
6668
6668
|
// src/viewer/utils/export-video.ts
|
|
@@ -6706,7 +6706,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6706
6706
|
const fps = 30;
|
|
6707
6707
|
const stream = recordingCanvas.captureStream(fps);
|
|
6708
6708
|
const recorder = new MediaRecorder(stream, {
|
|
6709
|
-
mimeType:
|
|
6709
|
+
mimeType: chunkFDR5W67L_js.pickSupportedMimeType([...chunkFDR5W67L_js.WEBM_MIME_CANDIDATES]),
|
|
6710
6710
|
videoBitsPerSecond: 5e6
|
|
6711
6711
|
});
|
|
6712
6712
|
const chunks = [];
|
|
@@ -6729,8 +6729,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6729
6729
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6730
6730
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6731
6731
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6732
|
-
const frameInterval =
|
|
6733
|
-
const framesNeeded =
|
|
6732
|
+
const frameInterval = chunkFDR5W67L_js.fpsToFrameIntervalMs(fps);
|
|
6733
|
+
const framesNeeded = chunkFDR5W67L_js.segmentFrameCount(duration, fps);
|
|
6734
6734
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6735
6735
|
if (signal?.aborted) {
|
|
6736
6736
|
recorder.stop();
|
|
@@ -6779,7 +6779,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6779
6779
|
if (frames.length === 0) {
|
|
6780
6780
|
throw new Error(chunkBXAK3JFM_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6781
6781
|
}
|
|
6782
|
-
const gifBytes =
|
|
6782
|
+
const gifBytes = chunkFDR5W67L_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6783
6783
|
onProgress?.(totalSlides, totalSlides);
|
|
6784
6784
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6785
6785
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6833,7 +6833,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6833
6833
|
continue;
|
|
6834
6834
|
}
|
|
6835
6835
|
onProgress?.(processedCount, data.slides.length);
|
|
6836
|
-
let svg =
|
|
6836
|
+
let svg = chunkFDR5W67L_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6837
6837
|
if (embedFonts && fontFaces?.length) {
|
|
6838
6838
|
svg = injectFontFaces(svg, fontFaces);
|
|
6839
6839
|
}
|
|
@@ -6893,7 +6893,7 @@ function useExportSaveAs(input) {
|
|
|
6893
6893
|
}
|
|
6894
6894
|
setExportProgress(70);
|
|
6895
6895
|
setExportStatusMessage("Writing README...");
|
|
6896
|
-
const readme =
|
|
6896
|
+
const readme = chunkFDR5W67L_js.generatePackageReadme(pptxFilename);
|
|
6897
6897
|
pkgFolder.file("README.txt", readme);
|
|
6898
6898
|
if (abortCtrl.signal.aborted) {
|
|
6899
6899
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -6904,7 +6904,7 @@ function useExportSaveAs(input) {
|
|
|
6904
6904
|
setExportProgress(95);
|
|
6905
6905
|
setExportStatusMessage("Downloading...");
|
|
6906
6906
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
6907
|
-
|
|
6907
|
+
chunkFDR5W67L_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
6908
6908
|
setExportProgress(100);
|
|
6909
6909
|
} catch (err) {
|
|
6910
6910
|
if (err.name !== "AbortError") {
|
|
@@ -6927,7 +6927,7 @@ function useExportSaveAs(input) {
|
|
|
6927
6927
|
const blob = new Blob([data], {
|
|
6928
6928
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6929
6929
|
});
|
|
6930
|
-
|
|
6930
|
+
chunkFDR5W67L_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
6931
6931
|
} catch (err) {
|
|
6932
6932
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
6933
6933
|
}
|
|
@@ -6940,14 +6940,14 @@ function useExportSaveAs(input) {
|
|
|
6940
6940
|
const pptxGuides = guides.map((g) => ({
|
|
6941
6941
|
id: g.id,
|
|
6942
6942
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
6943
|
-
positionEmu:
|
|
6943
|
+
positionEmu: chunkFDR5W67L_js.guidePxToEmu(g.position)
|
|
6944
6944
|
}));
|
|
6945
6945
|
return {
|
|
6946
6946
|
...slide,
|
|
6947
6947
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
6948
6948
|
};
|
|
6949
6949
|
});
|
|
6950
|
-
const slidesToSave =
|
|
6950
|
+
const slidesToSave = chunkDOS7NY7C_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
6951
6951
|
const saveOptions = {
|
|
6952
6952
|
headerFooter,
|
|
6953
6953
|
presentationProperties,
|
|
@@ -7004,7 +7004,7 @@ function safeConfirm(message) {
|
|
|
7004
7004
|
}
|
|
7005
7005
|
}
|
|
7006
7006
|
function downloadBlob2(blob, filename) {
|
|
7007
|
-
|
|
7007
|
+
chunkFDR5W67L_js.downloadBlob(blob, chunkFDR5W67L_js.sanitizeDownloadFilename(filename));
|
|
7008
7008
|
}
|
|
7009
7009
|
|
|
7010
7010
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7105,21 +7105,21 @@ function useExportHandlers(input) {
|
|
|
7105
7105
|
{
|
|
7106
7106
|
scale: 2,
|
|
7107
7107
|
onProgress: (current, total) => {
|
|
7108
|
-
setExportProgress(
|
|
7109
|
-
setExportStatusMessage(
|
|
7108
|
+
setExportProgress(chunkFDR5W67L_js.slideProgressPercent(current, total));
|
|
7109
|
+
setExportStatusMessage(chunkFDR5W67L_js.slideStatusLabel("Rendering", current, total));
|
|
7110
7110
|
},
|
|
7111
7111
|
signal: abortCtrl.signal
|
|
7112
7112
|
}
|
|
7113
7113
|
);
|
|
7114
|
-
setExportProgress(
|
|
7114
|
+
setExportProgress(chunkFDR5W67L_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7115
7115
|
setExportStatusMessage("Building PDF...");
|
|
7116
7116
|
await new Promise((r) => {
|
|
7117
7117
|
setTimeout(r, 100);
|
|
7118
7118
|
});
|
|
7119
|
-
setExportProgress(
|
|
7119
|
+
setExportProgress(chunkFDR5W67L_js.EXPORT_DONE_PERCENT);
|
|
7120
7120
|
setExportStatusMessage("Done!");
|
|
7121
7121
|
} catch (err) {
|
|
7122
|
-
if (!
|
|
7122
|
+
if (!chunkFDR5W67L_js.isExportAbortError(err)) {
|
|
7123
7123
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7124
7124
|
}
|
|
7125
7125
|
} finally {
|
|
@@ -7149,21 +7149,21 @@ function useExportHandlers(input) {
|
|
|
7149
7149
|
{
|
|
7150
7150
|
scale: 2,
|
|
7151
7151
|
onProgress: (current, total) => {
|
|
7152
|
-
setExportProgress(
|
|
7153
|
-
setExportStatusMessage(
|
|
7152
|
+
setExportProgress(chunkFDR5W67L_js.slideProgressPercent(current, total));
|
|
7153
|
+
setExportStatusMessage(chunkFDR5W67L_js.slideStatusLabel("Rendering", current, total));
|
|
7154
7154
|
},
|
|
7155
7155
|
signal: abortCtrl.signal
|
|
7156
7156
|
}
|
|
7157
7157
|
);
|
|
7158
|
-
setExportProgress(
|
|
7158
|
+
setExportProgress(chunkFDR5W67L_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7159
7159
|
setExportStatusMessage("Building PDF...");
|
|
7160
7160
|
await new Promise((r) => {
|
|
7161
7161
|
setTimeout(r, 100);
|
|
7162
7162
|
});
|
|
7163
|
-
setExportProgress(
|
|
7163
|
+
setExportProgress(chunkFDR5W67L_js.EXPORT_DONE_PERCENT);
|
|
7164
7164
|
setExportStatusMessage("Done!");
|
|
7165
7165
|
} catch (err) {
|
|
7166
|
-
if (!
|
|
7166
|
+
if (!chunkFDR5W67L_js.isExportAbortError(err)) {
|
|
7167
7167
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7168
7168
|
}
|
|
7169
7169
|
} finally {
|
|
@@ -7204,22 +7204,22 @@ function useExportHandlers(input) {
|
|
|
7204
7204
|
scale: 1,
|
|
7205
7205
|
slideDurationMs: 3e3,
|
|
7206
7206
|
onProgress: (current, total) => {
|
|
7207
|
-
setExportProgress(
|
|
7208
|
-
setExportStatusMessage(
|
|
7207
|
+
setExportProgress(chunkFDR5W67L_js.slideProgressPercent(current, total, 45));
|
|
7208
|
+
setExportStatusMessage(chunkFDR5W67L_js.slideStatusLabel("Capturing", current, total));
|
|
7209
7209
|
},
|
|
7210
7210
|
onRecordProgress: (current, total) => {
|
|
7211
|
-
setExportProgress(
|
|
7212
|
-
setExportStatusMessage(
|
|
7211
|
+
setExportProgress(chunkFDR5W67L_js.recordProgressPercent(current, total));
|
|
7212
|
+
setExportStatusMessage(chunkFDR5W67L_js.slideStatusLabel("Recording", current, total));
|
|
7213
7213
|
},
|
|
7214
7214
|
signal: abortCtrl.signal
|
|
7215
7215
|
}
|
|
7216
7216
|
);
|
|
7217
|
-
setExportProgress(
|
|
7217
|
+
setExportProgress(chunkFDR5W67L_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7218
7218
|
setExportStatusMessage("Saving file...");
|
|
7219
7219
|
downloadBlob2(blob, "presentation.webm");
|
|
7220
|
-
setExportProgress(
|
|
7220
|
+
setExportProgress(chunkFDR5W67L_js.EXPORT_DONE_PERCENT);
|
|
7221
7221
|
} catch (err) {
|
|
7222
|
-
if (!
|
|
7222
|
+
if (!chunkFDR5W67L_js.isExportAbortError(err)) {
|
|
7223
7223
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7224
7224
|
}
|
|
7225
7225
|
} finally {
|
|
@@ -7247,18 +7247,18 @@ function useExportHandlers(input) {
|
|
|
7247
7247
|
scale: 0.5,
|
|
7248
7248
|
slideDurationMs: 2e3,
|
|
7249
7249
|
onProgress: (current, total) => {
|
|
7250
|
-
setExportProgress(
|
|
7251
|
-
setExportStatusMessage(
|
|
7250
|
+
setExportProgress(chunkFDR5W67L_js.slideProgressPercent(current, total));
|
|
7251
|
+
setExportStatusMessage(chunkFDR5W67L_js.slideStatusLabel("Encoding", current, total));
|
|
7252
7252
|
},
|
|
7253
7253
|
signal: abortCtrl.signal
|
|
7254
7254
|
}
|
|
7255
7255
|
);
|
|
7256
|
-
setExportProgress(
|
|
7256
|
+
setExportProgress(chunkFDR5W67L_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7257
7257
|
setExportStatusMessage("Saving file...");
|
|
7258
7258
|
downloadBlob2(blob, "presentation.gif");
|
|
7259
|
-
setExportProgress(
|
|
7259
|
+
setExportProgress(chunkFDR5W67L_js.EXPORT_DONE_PERCENT);
|
|
7260
7260
|
} catch (err) {
|
|
7261
|
-
if (!
|
|
7261
|
+
if (!chunkFDR5W67L_js.isExportAbortError(err)) {
|
|
7262
7262
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7263
7263
|
}
|
|
7264
7264
|
} finally {
|
|
@@ -7298,7 +7298,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7298
7298
|
}
|
|
7299
7299
|
printWindow.document.open();
|
|
7300
7300
|
printWindow.document.write(
|
|
7301
|
-
|
|
7301
|
+
chunkFDR5W67L_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7302
7302
|
);
|
|
7303
7303
|
printWindow.document.close();
|
|
7304
7304
|
printWindow.focus();
|
|
@@ -7359,7 +7359,7 @@ function usePrintHandlers(input) {
|
|
|
7359
7359
|
if (svgs.length === 0) {
|
|
7360
7360
|
return;
|
|
7361
7361
|
}
|
|
7362
|
-
const printDoc =
|
|
7362
|
+
const printDoc = chunkFDR5W67L_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7363
7363
|
title: "Slides (Vector)",
|
|
7364
7364
|
orientation: settings.orientation,
|
|
7365
7365
|
colorFilter
|
|
@@ -7395,7 +7395,7 @@ function usePrintHandlers(input) {
|
|
|
7395
7395
|
if (settings.printWhat === "outline") {
|
|
7396
7396
|
openPrintWindow(
|
|
7397
7397
|
"Outline",
|
|
7398
|
-
`<div class="outline-page">${
|
|
7398
|
+
`<div class="outline-page">${chunkFDR5W67L_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7399
7399
|
settings.orientation,
|
|
7400
7400
|
colorFilter,
|
|
7401
7401
|
settings.frameSlides
|
|
@@ -7420,7 +7420,7 @@ function usePrintHandlers(input) {
|
|
|
7420
7420
|
if (settings.printWhat === "slides") {
|
|
7421
7421
|
openPrintWindow(
|
|
7422
7422
|
"Slides",
|
|
7423
|
-
|
|
7423
|
+
chunkFDR5W67L_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7424
7424
|
settings.orientation,
|
|
7425
7425
|
colorFilter,
|
|
7426
7426
|
settings.frameSlides
|
|
@@ -7430,7 +7430,7 @@ function usePrintHandlers(input) {
|
|
|
7430
7430
|
if (settings.printWhat === "notes") {
|
|
7431
7431
|
openPrintWindow(
|
|
7432
7432
|
"Notes Pages",
|
|
7433
|
-
|
|
7433
|
+
chunkFDR5W67L_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7434
7434
|
"portrait",
|
|
7435
7435
|
colorFilter,
|
|
7436
7436
|
settings.frameSlides
|
|
@@ -7441,7 +7441,7 @@ function usePrintHandlers(input) {
|
|
|
7441
7441
|
const spp = settings.slidesPerPage;
|
|
7442
7442
|
openPrintWindow(
|
|
7443
7443
|
`Handout ${spp} per page`,
|
|
7444
|
-
|
|
7444
|
+
chunkFDR5W67L_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7445
7445
|
"portrait",
|
|
7446
7446
|
colorFilter,
|
|
7447
7447
|
settings.frameSlides
|
|
@@ -7505,8 +7505,8 @@ function useThemeHandlers(input) {
|
|
|
7505
7505
|
return;
|
|
7506
7506
|
}
|
|
7507
7507
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7508
|
-
const previousMap = theme?.colorScheme ?
|
|
7509
|
-
setSlides((prev) =>
|
|
7508
|
+
const previousMap = theme?.colorScheme ? chunkFDR5W67L_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7509
|
+
setSlides((prev) => chunkFDR5W67L_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7510
7510
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7511
7511
|
bumpHistory();
|
|
7512
7512
|
history.markDirty();
|
|
@@ -7611,7 +7611,7 @@ function useThemeSwitching(input) {
|
|
|
7611
7611
|
}
|
|
7612
7612
|
try {
|
|
7613
7613
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7614
|
-
const newData =
|
|
7614
|
+
const newData = chunkFDR5W67L_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7615
7615
|
onDataChange(newData);
|
|
7616
7616
|
onThemeChanged?.(preset);
|
|
7617
7617
|
} catch (error) {
|
|
@@ -7628,7 +7628,7 @@ function useThemeSwitching(input) {
|
|
|
7628
7628
|
}
|
|
7629
7629
|
try {
|
|
7630
7630
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7631
|
-
const newData =
|
|
7631
|
+
const newData = chunkFDR5W67L_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7632
7632
|
onDataChange(newData);
|
|
7633
7633
|
} catch (error) {
|
|
7634
7634
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7640,12 +7640,12 @@ function useThemeSwitching(input) {
|
|
|
7640
7640
|
if (!data?.theme?.colorScheme) {
|
|
7641
7641
|
return void 0;
|
|
7642
7642
|
}
|
|
7643
|
-
return
|
|
7644
|
-
(p) =>
|
|
7643
|
+
return chunkFDR5W67L_js.THEME_PRESETS.find(
|
|
7644
|
+
(p) => chunkFDR5W67L_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7645
7645
|
);
|
|
7646
7646
|
}, [data?.theme?.colorScheme]);
|
|
7647
7647
|
return {
|
|
7648
|
-
presets:
|
|
7648
|
+
presets: chunkFDR5W67L_js.THEME_PRESETS,
|
|
7649
7649
|
switchToPreset,
|
|
7650
7650
|
switchToCustom,
|
|
7651
7651
|
currentPreset
|
|
@@ -7720,7 +7720,7 @@ function usePropertyHandlers(input) {
|
|
|
7720
7720
|
}
|
|
7721
7721
|
try {
|
|
7722
7722
|
const ab = await file.arrayBuffer();
|
|
7723
|
-
const h = new
|
|
7723
|
+
const h = new chunkFDR5W67L_js.PptxHandler();
|
|
7724
7724
|
const other = await h.load(ab);
|
|
7725
7725
|
if (!other) {
|
|
7726
7726
|
return;
|
|
@@ -7730,7 +7730,7 @@ function usePropertyHandlers(input) {
|
|
|
7730
7730
|
width: canvasSize.width,
|
|
7731
7731
|
height: canvasSize.height
|
|
7732
7732
|
};
|
|
7733
|
-
setCompareResult(
|
|
7733
|
+
setCompareResult(chunkFDR5W67L_js.comparePresentation(cur, other));
|
|
7734
7734
|
setIsComparePanelOpen(true);
|
|
7735
7735
|
} catch (err) {
|
|
7736
7736
|
console.warn("Compare failed:", err);
|
|
@@ -7747,7 +7747,7 @@ function usePropertyHandlers(input) {
|
|
|
7747
7747
|
if (!diff || diff.status === "unchanged") {
|
|
7748
7748
|
return;
|
|
7749
7749
|
}
|
|
7750
|
-
setSlides((prev) =>
|
|
7750
|
+
setSlides((prev) => chunkFDR5W67L_js.applyAcceptSlide(prev, diff));
|
|
7751
7751
|
setIsDirty(true);
|
|
7752
7752
|
},
|
|
7753
7753
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7758,10 +7758,10 @@ function usePropertyHandlers(input) {
|
|
|
7758
7758
|
if (!compareResult) {
|
|
7759
7759
|
return;
|
|
7760
7760
|
}
|
|
7761
|
-
setSlides((prev) =>
|
|
7761
|
+
setSlides((prev) => chunkFDR5W67L_js.applyAcceptAllSlides(prev, compareResult));
|
|
7762
7762
|
setIsDirty(true);
|
|
7763
7763
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7764
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7764
|
+
const usedFontFamilies = react.useMemo(() => chunkFDR5W67L_js.collectUsedFonts(slides), [slides]);
|
|
7765
7765
|
return {
|
|
7766
7766
|
handleUpdateNotes,
|
|
7767
7767
|
handleUpdateSlide,
|
|
@@ -7880,7 +7880,7 @@ function useIsMobile(input) {
|
|
|
7880
7880
|
const containerRef = input?.containerRef;
|
|
7881
7881
|
const isTouchDevice = react.useSyncExternalStore(
|
|
7882
7882
|
subscribeTouchCapability,
|
|
7883
|
-
|
|
7883
|
+
chunkFDR5W67L_js.detectTouchDevice,
|
|
7884
7884
|
() => false
|
|
7885
7885
|
// server snapshot
|
|
7886
7886
|
);
|
|
@@ -7896,7 +7896,7 @@ function useIsMobile(input) {
|
|
|
7896
7896
|
}
|
|
7897
7897
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
7898
7898
|
});
|
|
7899
|
-
const [orientation, setOrientation] = react.useState(
|
|
7899
|
+
const [orientation, setOrientation] = react.useState(chunkFDR5W67L_js.detectOrientation);
|
|
7900
7900
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
7901
7901
|
const [initialViewportHeight] = react.useState(
|
|
7902
7902
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -7940,7 +7940,7 @@ function useIsMobile(input) {
|
|
|
7940
7940
|
return;
|
|
7941
7941
|
}
|
|
7942
7942
|
const handleOrientationChange = () => {
|
|
7943
|
-
setOrientation(
|
|
7943
|
+
setOrientation(chunkFDR5W67L_js.detectOrientation());
|
|
7944
7944
|
};
|
|
7945
7945
|
if (screen.orientation) {
|
|
7946
7946
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -7970,9 +7970,9 @@ function useIsMobile(input) {
|
|
|
7970
7970
|
window.addEventListener("resize", handleResize);
|
|
7971
7971
|
return () => window.removeEventListener("resize", handleResize);
|
|
7972
7972
|
}, [isTouchDevice, initialViewportHeight]);
|
|
7973
|
-
const isMobile =
|
|
7974
|
-
const isTablet = !isMobile && containerWidth >=
|
|
7975
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
7973
|
+
const isMobile = chunkFDR5W67L_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
7974
|
+
const isTablet = !isMobile && containerWidth >= chunkFDR5W67L_js.MOBILE_BREAKPOINT && containerWidth < chunkFDR5W67L_js.TABLET_BREAKPOINT;
|
|
7975
|
+
const isDesktop = !isMobile && containerWidth >= chunkFDR5W67L_js.TABLET_BREAKPOINT;
|
|
7976
7976
|
return {
|
|
7977
7977
|
isMobile,
|
|
7978
7978
|
isTablet,
|
|
@@ -8033,11 +8033,11 @@ function useViewerDialogs(input) {
|
|
|
8033
8033
|
);
|
|
8034
8034
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(false);
|
|
8035
8035
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8036
|
-
() => typeof window !== "undefined" ?
|
|
8036
|
+
() => typeof window !== "undefined" ? chunkFDR5W67L_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8037
8037
|
);
|
|
8038
8038
|
react.useEffect(() => {
|
|
8039
8039
|
const handleWindow = () => setIsNarrowViewport(
|
|
8040
|
-
|
|
8040
|
+
chunkFDR5W67L_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8041
8041
|
);
|
|
8042
8042
|
let observer = null;
|
|
8043
8043
|
let raf = 0;
|
|
@@ -8051,12 +8051,12 @@ function useViewerDialogs(input) {
|
|
|
8051
8051
|
const entry = entries[0];
|
|
8052
8052
|
if (entry) {
|
|
8053
8053
|
setIsNarrowViewport(
|
|
8054
|
-
|
|
8054
|
+
chunkFDR5W67L_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8055
8055
|
);
|
|
8056
8056
|
}
|
|
8057
8057
|
});
|
|
8058
8058
|
observer.observe(el);
|
|
8059
|
-
setIsNarrowViewport(
|
|
8059
|
+
setIsNarrowViewport(chunkFDR5W67L_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8060
8060
|
};
|
|
8061
8061
|
attach();
|
|
8062
8062
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8214,20 +8214,20 @@ function useViewerDialogs(input) {
|
|
|
8214
8214
|
}
|
|
8215
8215
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8216
8216
|
if (presentationGridSpacing) {
|
|
8217
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8217
|
+
const px = Math.round(presentationGridSpacing.cx / chunkDOS7NY7C_js.EMU_PER_PX);
|
|
8218
8218
|
if (px > 0) {
|
|
8219
8219
|
return px;
|
|
8220
8220
|
}
|
|
8221
8221
|
}
|
|
8222
|
-
return
|
|
8222
|
+
return chunkDOS7NY7C_js.GRID_SIZE;
|
|
8223
8223
|
}
|
|
8224
8224
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8225
8225
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8226
|
-
return
|
|
8226
|
+
return chunkFDR5W67L_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8227
8227
|
}
|
|
8228
8228
|
function computeSlideSectionGroups(slides, sections) {
|
|
8229
|
-
return
|
|
8230
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8229
|
+
return chunkFDR5W67L_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8230
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkDOS7NY7C_js.UNGROUPED_SECTION_ID : "default"),
|
|
8231
8231
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8232
8232
|
slideIndexes: group.slideIndexes,
|
|
8233
8233
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8282,7 +8282,7 @@ function useDerivedSlideState(input) {
|
|
|
8282
8282
|
);
|
|
8283
8283
|
const slideSectionGroups = react.useMemo(
|
|
8284
8284
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8285
|
-
if (group.id ===
|
|
8285
|
+
if (group.id === chunkDOS7NY7C_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8286
8286
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8287
8287
|
}
|
|
8288
8288
|
if (group.id === "default" && group.label === "Slides") {
|
|
@@ -8385,13 +8385,13 @@ function useAnnotationHandlers(input) {
|
|
|
8385
8385
|
}, [annotations, setMode, setSlides, history]);
|
|
8386
8386
|
const handleSetMode = react.useCallback(
|
|
8387
8387
|
(nextMode) => {
|
|
8388
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8388
|
+
if (mode === "present" && nextMode !== "present" && !chunkFDR5W67L_js.mayLeaveSlideShow()) {
|
|
8389
8389
|
return;
|
|
8390
8390
|
}
|
|
8391
8391
|
if (nextMode === "present") {
|
|
8392
8392
|
presentation.enterPresentMode();
|
|
8393
8393
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8394
|
-
|
|
8394
|
+
chunkFDR5W67L_js.stopAllPersistentAudio();
|
|
8395
8395
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8396
8396
|
if (promptKeepInkAnnotations) {
|
|
8397
8397
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8400,7 +8400,7 @@ function useAnnotationHandlers(input) {
|
|
|
8400
8400
|
}
|
|
8401
8401
|
} else {
|
|
8402
8402
|
if (mode === "present") {
|
|
8403
|
-
|
|
8403
|
+
chunkFDR5W67L_js.stopAllPersistentAudio();
|
|
8404
8404
|
}
|
|
8405
8405
|
setMode(nextMode);
|
|
8406
8406
|
}
|
|
@@ -8466,13 +8466,13 @@ function useSerialize(input) {
|
|
|
8466
8466
|
let processedSlide = slide;
|
|
8467
8467
|
if (pendingEditId) {
|
|
8468
8468
|
const updatedElements = slide.elements.map((el) => {
|
|
8469
|
-
if (el.id !== pendingEditId || !
|
|
8469
|
+
if (el.id !== pendingEditId || !chunkFDR5W67L_js.hasTextProperties(el)) {
|
|
8470
8470
|
return el;
|
|
8471
8471
|
}
|
|
8472
8472
|
return {
|
|
8473
8473
|
...el,
|
|
8474
8474
|
text: pendingEditText,
|
|
8475
|
-
textSegments:
|
|
8475
|
+
textSegments: chunkFDR5W67L_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8476
8476
|
};
|
|
8477
8477
|
});
|
|
8478
8478
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8485,14 +8485,14 @@ function useSerialize(input) {
|
|
|
8485
8485
|
const pptxGuides = guides.map((g) => ({
|
|
8486
8486
|
id: g.id,
|
|
8487
8487
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8488
|
-
positionEmu:
|
|
8488
|
+
positionEmu: chunkFDR5W67L_js.guidePxToEmu(g.position)
|
|
8489
8489
|
}));
|
|
8490
8490
|
return {
|
|
8491
8491
|
...processedSlide,
|
|
8492
8492
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8493
8493
|
};
|
|
8494
8494
|
});
|
|
8495
|
-
const slidesToSave =
|
|
8495
|
+
const slidesToSave = chunkDOS7NY7C_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8496
8496
|
const saveOptions = {
|
|
8497
8497
|
headerFooter,
|
|
8498
8498
|
presentationProperties,
|
|
@@ -8661,7 +8661,7 @@ function usePresentationSetup(input) {
|
|
|
8661
8661
|
containerRef,
|
|
8662
8662
|
content,
|
|
8663
8663
|
onSetMode: (nextMode) => {
|
|
8664
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8664
|
+
if (mode === "present" && nextMode !== "present" && !chunkFDR5W67L_js.mayLeaveSlideShow()) {
|
|
8665
8665
|
return;
|
|
8666
8666
|
}
|
|
8667
8667
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8669,7 +8669,7 @@ function usePresentationSetup(input) {
|
|
|
8669
8669
|
setShowKeepAnnotationsDialog(true);
|
|
8670
8670
|
} else {
|
|
8671
8671
|
if (mode === "present" && nextMode !== "present") {
|
|
8672
|
-
|
|
8672
|
+
chunkFDR5W67L_js.stopAllPersistentAudio();
|
|
8673
8673
|
stopAnimationSound();
|
|
8674
8674
|
}
|
|
8675
8675
|
setMode(nextMode);
|
|
@@ -8723,10 +8723,10 @@ function usePresentationSetup(input) {
|
|
|
8723
8723
|
onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
|
|
8724
8724
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8725
8725
|
onSaveRehearsalTimings: (timings) => {
|
|
8726
|
-
setSlides((prev) =>
|
|
8726
|
+
setSlides((prev) => chunkFDR5W67L_js.applyRehearsalTimings(prev, timings));
|
|
8727
8727
|
history.markDirty();
|
|
8728
8728
|
},
|
|
8729
|
-
loopContinuously:
|
|
8729
|
+
loopContinuously: chunkFDR5W67L_js.shouldLoopContinuously(presentationProperties),
|
|
8730
8730
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8731
8731
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8732
8732
|
endWithBlackSlide
|
|
@@ -8888,7 +8888,7 @@ function useEditorOperations(input) {
|
|
|
8888
8888
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
8889
8889
|
react.useEffect(() => {
|
|
8890
8890
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
8891
|
-
copiedFormatRef.current =
|
|
8891
|
+
copiedFormatRef.current = chunkFDR5W67L_js.copyFormatFromElement(selectedElement);
|
|
8892
8892
|
} else if (!formatPainterActive) {
|
|
8893
8893
|
copiedFormatRef.current = null;
|
|
8894
8894
|
}
|
|
@@ -8914,12 +8914,12 @@ function useEditorOperations(input) {
|
|
|
8914
8914
|
e.stopPropagation();
|
|
8915
8915
|
const element = elementLookup.get(elementId);
|
|
8916
8916
|
if (element) {
|
|
8917
|
-
const updated =
|
|
8917
|
+
const updated = chunkFDR5W67L_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
8918
8918
|
const updates = {};
|
|
8919
|
-
if (
|
|
8919
|
+
if (chunkFDR5W67L_js.hasShapeProperties(updated)) {
|
|
8920
8920
|
updates.shapeStyle = updated.shapeStyle;
|
|
8921
8921
|
}
|
|
8922
|
-
if (
|
|
8922
|
+
if (chunkFDR5W67L_js.hasTextProperties(updated)) {
|
|
8923
8923
|
updates.textStyle = updated.textStyle;
|
|
8924
8924
|
}
|
|
8925
8925
|
ops.updateElementById(elementId, updates);
|
|
@@ -9066,7 +9066,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9066
9066
|
const families = /* @__PURE__ */ new Set();
|
|
9067
9067
|
for (const slide of slides) {
|
|
9068
9068
|
for (const el of slide.elements) {
|
|
9069
|
-
if (
|
|
9069
|
+
if (chunkFDR5W67L_js.hasTextProperties(el) && el.textSegments) {
|
|
9070
9070
|
for (const seg of el.textSegments) {
|
|
9071
9071
|
if (seg.style.fontFamily) {
|
|
9072
9072
|
families.add(seg.style.fontFamily);
|
|
@@ -9278,13 +9278,13 @@ function useKeyboardShortcuts(input) {
|
|
|
9278
9278
|
inputRef.current = input;
|
|
9279
9279
|
const handleKeyDown = react.useCallback((e) => {
|
|
9280
9280
|
const current = inputRef.current;
|
|
9281
|
-
const { action, dx, dy } =
|
|
9281
|
+
const { action, dx, dy } = chunkFDR5W67L_js.mapEditorKey(e, {
|
|
9282
9282
|
canEdit: current.canEdit,
|
|
9283
9283
|
isPresenting: current.mode !== "edit",
|
|
9284
9284
|
hasSelection: current.hasSelection,
|
|
9285
9285
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9286
9286
|
isDrawing: current.activeTool !== "select",
|
|
9287
|
-
isTextInputTarget:
|
|
9287
|
+
isTextInputTarget: chunkFDR5W67L_js.isEditorTextInputTarget(e.target)
|
|
9288
9288
|
});
|
|
9289
9289
|
if (action === null) {
|
|
9290
9290
|
return;
|
|
@@ -9577,7 +9577,7 @@ function useViewerIntegration(input) {
|
|
|
9577
9577
|
return zoom.scale;
|
|
9578
9578
|
},
|
|
9579
9579
|
setZoom(level) {
|
|
9580
|
-
zoom.setScale(
|
|
9580
|
+
zoom.setScale(chunkFDR5W67L_js.clampZoomScale(level));
|
|
9581
9581
|
},
|
|
9582
9582
|
zoomIn() {
|
|
9583
9583
|
zoom.handleZoomIn();
|
|
@@ -9792,7 +9792,7 @@ function useReducedMotion() {
|
|
|
9792
9792
|
}
|
|
9793
9793
|
function useViewerOptions() {
|
|
9794
9794
|
const storeRef = react.useRef(null);
|
|
9795
|
-
storeRef.current ??=
|
|
9795
|
+
storeRef.current ??= chunkFDR5W67L_js.createViewerOptionsStore();
|
|
9796
9796
|
const store = storeRef.current;
|
|
9797
9797
|
const options = react.useSyncExternalStore(
|
|
9798
9798
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9801,9 +9801,9 @@ function useViewerOptions() {
|
|
|
9801
9801
|
);
|
|
9802
9802
|
return { optionsStore: store, options };
|
|
9803
9803
|
}
|
|
9804
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9804
|
+
var KNOWN_TAB_IDS = new Set(chunkFDR5W67L_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9805
9805
|
function computeToolbarVisibility(hiddenActions) {
|
|
9806
|
-
const isHidden = (id) =>
|
|
9806
|
+
const isHidden = (id) => chunkFDR5W67L_js.isActionHidden(id, hiddenActions);
|
|
9807
9807
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
9808
9808
|
return { isHidden, isTabVisible };
|
|
9809
9809
|
}
|
|
@@ -9888,12 +9888,12 @@ function useYjsDocumentSync({
|
|
|
9888
9888
|
return;
|
|
9889
9889
|
}
|
|
9890
9890
|
try {
|
|
9891
|
-
const handler = new
|
|
9891
|
+
const handler = new chunkFDR5W67L_js.PptxHandler();
|
|
9892
9892
|
await handler.load(sourceBytes.buffer);
|
|
9893
|
-
const currentSlides =
|
|
9893
|
+
const currentSlides = chunkFDR5W67L_js.readSlidesFromYDoc(
|
|
9894
9894
|
doc
|
|
9895
9895
|
);
|
|
9896
|
-
const slidesToSave =
|
|
9896
|
+
const slidesToSave = chunkDOS7NY7C_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
9897
9897
|
const bytes = await handler.save(slidesToSave);
|
|
9898
9898
|
config.onWriteBack(bytes);
|
|
9899
9899
|
} catch {
|
|
@@ -9908,7 +9908,7 @@ function useYjsDocumentSync({
|
|
|
9908
9908
|
if (!doc || !isConnected) {
|
|
9909
9909
|
return;
|
|
9910
9910
|
}
|
|
9911
|
-
const docSlides =
|
|
9911
|
+
const docSlides = chunkFDR5W67L_js.readSlidesFromYDoc(
|
|
9912
9912
|
doc
|
|
9913
9913
|
);
|
|
9914
9914
|
if (docSlides.length === 0) {
|
|
@@ -9930,11 +9930,11 @@ function useYjsDocumentSync({
|
|
|
9930
9930
|
lastSyncedRef.current = serialized;
|
|
9931
9931
|
void (async () => {
|
|
9932
9932
|
const factories = await getFactories();
|
|
9933
|
-
|
|
9933
|
+
chunkFDR5W67L_js.reconcileSlidesInYDoc(
|
|
9934
9934
|
slides,
|
|
9935
9935
|
doc,
|
|
9936
9936
|
factories,
|
|
9937
|
-
|
|
9937
|
+
chunkFDR5W67L_js.LOCAL_SYNC_ORIGIN
|
|
9938
9938
|
);
|
|
9939
9939
|
scheduleWriteBack();
|
|
9940
9940
|
})();
|
|
@@ -9948,10 +9948,10 @@ function useYjsDocumentSync({
|
|
|
9948
9948
|
return;
|
|
9949
9949
|
}
|
|
9950
9950
|
const handleChange = (_events, transaction) => {
|
|
9951
|
-
if (transaction?.origin ===
|
|
9951
|
+
if (transaction?.origin === chunkFDR5W67L_js.LOCAL_SYNC_ORIGIN) {
|
|
9952
9952
|
return;
|
|
9953
9953
|
}
|
|
9954
|
-
const remoteSlides =
|
|
9954
|
+
const remoteSlides = chunkFDR5W67L_js.readSlidesFromYDoc(
|
|
9955
9955
|
doc
|
|
9956
9956
|
);
|
|
9957
9957
|
if (remoteSlides.length === 0) {
|
|
@@ -9967,7 +9967,7 @@ function useYjsDocumentSync({
|
|
|
9967
9967
|
isApplyingRemoteRef.current = false;
|
|
9968
9968
|
scheduleWriteBack();
|
|
9969
9969
|
};
|
|
9970
|
-
const unobserve =
|
|
9970
|
+
const unobserve = chunkFDR5W67L_js.observeYDocSlides(
|
|
9971
9971
|
doc,
|
|
9972
9972
|
handleChange
|
|
9973
9973
|
);
|
|
@@ -10005,7 +10005,7 @@ function useBroadcastFollower({
|
|
|
10005
10005
|
if (!broadcaster) {
|
|
10006
10006
|
return;
|
|
10007
10007
|
}
|
|
10008
|
-
if (!
|
|
10008
|
+
if (!chunkFDR5W67L_js.shouldAutoFollowBroadcaster({
|
|
10009
10009
|
localRole: collab.config.role,
|
|
10010
10010
|
broadcasterRole: broadcaster.role
|
|
10011
10011
|
})) {
|
|
@@ -10165,10 +10165,10 @@ function useTouchGestures(input) {
|
|
|
10165
10165
|
if (!el || !enabled) {
|
|
10166
10166
|
return;
|
|
10167
10167
|
}
|
|
10168
|
-
const recognizer =
|
|
10168
|
+
const recognizer = chunkFDR5W67L_js.createTouchGestureRecognizer({
|
|
10169
10169
|
getScale: () => scaleRef.current,
|
|
10170
|
-
minScale:
|
|
10171
|
-
maxScale:
|
|
10170
|
+
minScale: chunkFDR5W67L_js.MIN_ZOOM_SCALE,
|
|
10171
|
+
maxScale: chunkFDR5W67L_js.MAX_ZOOM_SCALE,
|
|
10172
10172
|
callbacks: {
|
|
10173
10173
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10174
10174
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10208,7 +10208,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10208
10208
|
return;
|
|
10209
10209
|
}
|
|
10210
10210
|
const rect = active.getBoundingClientRect();
|
|
10211
|
-
const delta =
|
|
10211
|
+
const delta = chunkFDR5W67L_js.computeScrollDelta(
|
|
10212
10212
|
{ top: rect.top, bottom: rect.bottom },
|
|
10213
10213
|
window.innerHeight,
|
|
10214
10214
|
keyboardInset
|
|
@@ -10228,8 +10228,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10228
10228
|
return;
|
|
10229
10229
|
}
|
|
10230
10230
|
const update = () => {
|
|
10231
|
-
const metrics =
|
|
10232
|
-
const inset = metrics ?
|
|
10231
|
+
const metrics = chunkFDR5W67L_js.readViewportMetrics(window);
|
|
10232
|
+
const inset = metrics ? chunkFDR5W67L_js.computeKeyboardInset(metrics) : 0;
|
|
10233
10233
|
setKeyboardInset(inset);
|
|
10234
10234
|
if (inset > 0) {
|
|
10235
10235
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10240,8 +10240,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10240
10240
|
vv.addEventListener("scroll", update);
|
|
10241
10241
|
const onFocusIn = () => {
|
|
10242
10242
|
window.requestAnimationFrame(() => {
|
|
10243
|
-
const metrics =
|
|
10244
|
-
const inset = metrics ?
|
|
10243
|
+
const metrics = chunkFDR5W67L_js.readViewportMetrics(window);
|
|
10244
|
+
const inset = metrics ? chunkFDR5W67L_js.computeKeyboardInset(metrics) : 0;
|
|
10245
10245
|
if (inset > 0) {
|
|
10246
10246
|
scrollFocusedIntoView(inset);
|
|
10247
10247
|
}
|
|
@@ -10254,7 +10254,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10254
10254
|
document.removeEventListener("focusin", onFocusIn);
|
|
10255
10255
|
};
|
|
10256
10256
|
}, [enabled]);
|
|
10257
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10257
|
+
return { keyboardInset, isKeyboardOpen: chunkFDR5W67L_js.isKeyboardOpen(keyboardInset) };
|
|
10258
10258
|
}
|
|
10259
10259
|
|
|
10260
10260
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10281,7 +10281,7 @@ function buildCanvasProps(input) {
|
|
|
10281
10281
|
} = input;
|
|
10282
10282
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10283
10283
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10284
|
-
const fieldContext =
|
|
10284
|
+
const fieldContext = chunkFDR5W67L_js.buildFieldSubstitutionContext({
|
|
10285
10285
|
headerFooter: s.headerFooter,
|
|
10286
10286
|
customProperties: s.customProperties,
|
|
10287
10287
|
slide: activeSlide
|
|
@@ -10291,13 +10291,13 @@ function buildCanvasProps(input) {
|
|
|
10291
10291
|
if (mode === "present") {
|
|
10292
10292
|
presentation.handlePresentationAction(action);
|
|
10293
10293
|
} else if (action.url) {
|
|
10294
|
-
|
|
10294
|
+
chunkFDR5W67L_js.safeOpenUrl(action.url);
|
|
10295
10295
|
}
|
|
10296
10296
|
};
|
|
10297
10297
|
const handleHyperlinkClick = (url) => {
|
|
10298
|
-
if (
|
|
10298
|
+
if (chunkFDR5W67L_js.isPpactionUrl(url)) {
|
|
10299
10299
|
if (mode === "present") {
|
|
10300
|
-
const parsed =
|
|
10300
|
+
const parsed = chunkFDR5W67L_js.parsePpactionUrl(url);
|
|
10301
10301
|
if (parsed) {
|
|
10302
10302
|
presentation.handlePresentationAction({
|
|
10303
10303
|
action: parsed.action,
|
|
@@ -10307,7 +10307,7 @@ function buildCanvasProps(input) {
|
|
|
10307
10307
|
}
|
|
10308
10308
|
return;
|
|
10309
10309
|
}
|
|
10310
|
-
|
|
10310
|
+
chunkFDR5W67L_js.safeOpenUrl(url);
|
|
10311
10311
|
};
|
|
10312
10312
|
return {
|
|
10313
10313
|
activeSlide: effectiveSlide,
|
|
@@ -10450,7 +10450,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10450
10450
|
const current = activeSlide.animations ?? [];
|
|
10451
10451
|
if (group === "motionPath") {
|
|
10452
10452
|
propertyHandlers.handleUpdateSlide({
|
|
10453
|
-
animations:
|
|
10453
|
+
animations: chunkFDR5W67L_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10454
10454
|
});
|
|
10455
10455
|
return;
|
|
10456
10456
|
}
|
|
@@ -10644,7 +10644,7 @@ function buildToolbarProps(input) {
|
|
|
10644
10644
|
onOpenFile,
|
|
10645
10645
|
onOpenRecentFile,
|
|
10646
10646
|
onCreatePresentation: (templateId) => {
|
|
10647
|
-
s.setSlides(
|
|
10647
|
+
s.setSlides(chunkFDR5W67L_js.createBackstagePresentation(templateId));
|
|
10648
10648
|
s.setActiveSlideIndex(0);
|
|
10649
10649
|
s.setSelectedElementId(null);
|
|
10650
10650
|
s.setSelectedElementIds([]);
|
|
@@ -10701,7 +10701,7 @@ function buildToolbarProps(input) {
|
|
|
10701
10701
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10702
10702
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10703
10703
|
formatPainterActive: s.formatPainterActive,
|
|
10704
|
-
canActivateFormatPainter:
|
|
10704
|
+
canActivateFormatPainter: chunkFDR5W67L_js.hasCopyableFormat(selectedElement),
|
|
10705
10705
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10706
10706
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10707
10707
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -10970,7 +10970,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
10970
10970
|
}, [incomingContent]);
|
|
10971
10971
|
const onOpenFile = react.useCallback(() => {
|
|
10972
10972
|
void (async () => {
|
|
10973
|
-
const picked = await
|
|
10973
|
+
const picked = await chunkFDR5W67L_js.openPptxFile();
|
|
10974
10974
|
if (picked) {
|
|
10975
10975
|
setContent(picked.buffer);
|
|
10976
10976
|
}
|
|
@@ -10978,7 +10978,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
10978
10978
|
}, []);
|
|
10979
10979
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
10980
10980
|
void (async () => {
|
|
10981
|
-
const bytes = await
|
|
10981
|
+
const bytes = await chunkFDR5W67L_js.readBackstageRecentFile(key);
|
|
10982
10982
|
if (bytes) {
|
|
10983
10983
|
setContent(bytes);
|
|
10984
10984
|
}
|