pptx-react-viewer 2.15.2 → 2.15.3
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 +2 -0
- package/dist/{AiChatPanel-HSQLY6O7.mjs → AiChatPanel-OXAKUVYH.mjs} +3 -3
- package/dist/AiChatPanel-OXAKUVYH.mjs.br +0 -0
- package/dist/AiChatPanel-OXAKUVYH.mjs.gz +0 -0
- package/dist/{AiChatPanel-WGX7DUQE.js → AiChatPanel-R7BYGQX5.js} +22 -22
- package/dist/AiChatPanel-R7BYGQX5.js.br +0 -0
- package/dist/AiChatPanel-R7BYGQX5.js.gz +0 -0
- package/dist/{Model3DScene-DYWYNVLU.js → Model3DScene-BK7RWDCU.js} +2 -2
- package/dist/Model3DScene-BK7RWDCU.js.br +0 -0
- package/dist/Model3DScene-BK7RWDCU.js.gz +0 -0
- package/dist/{Model3DScene-3DOCQYAE.mjs → Model3DScene-TPUVF4FY.mjs} +1 -1
- package/dist/Model3DScene-TPUVF4FY.mjs.br +0 -0
- package/dist/Model3DScene-TPUVF4FY.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-GIKV3DXC.mjs → SurfaceChart3DScene-FXJ45DC5.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-GIKV3DXC.mjs.br → SurfaceChart3DScene-FXJ45DC5.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-FXJ45DC5.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-7UB5JE2W.js → SurfaceChart3DScene-WOLVZOW3.js} +2 -2
- package/dist/SurfaceChart3DScene-WOLVZOW3.js.br +0 -0
- package/dist/SurfaceChart3DScene-WOLVZOW3.js.gz +0 -0
- package/dist/{chunk-U47SG5XL.js → chunk-3XJODTAV.js} +334 -334
- package/dist/chunk-3XJODTAV.js.br +0 -0
- package/dist/chunk-3XJODTAV.js.gz +0 -0
- package/dist/{chunk-LVGFV42Z.mjs → chunk-6M6WP2TK.mjs} +188 -144
- package/dist/chunk-6M6WP2TK.mjs.br +0 -0
- package/dist/chunk-6M6WP2TK.mjs.gz +0 -0
- package/dist/{chunk-MQXKBH43.js → chunk-FHTEL3Q6.js} +247 -247
- package/dist/chunk-FHTEL3Q6.js.br +0 -0
- package/dist/chunk-FHTEL3Q6.js.gz +0 -0
- package/dist/{chunk-RSNAGJTQ.js → chunk-IEXZ2JSO.js} +1084 -1052
- package/dist/chunk-IEXZ2JSO.js.br +0 -0
- package/dist/chunk-IEXZ2JSO.js.gz +0 -0
- package/dist/{chunk-GLC2RPKN.mjs → chunk-OPX74QGH.mjs} +2 -2
- package/dist/chunk-OPX74QGH.mjs.br +0 -0
- package/dist/chunk-OPX74QGH.mjs.gz +0 -0
- package/dist/{chunk-IXEHYABF.mjs → chunk-RPGAI65Z.mjs} +40 -8
- package/dist/chunk-RPGAI65Z.mjs.br +0 -0
- package/dist/chunk-RPGAI65Z.mjs.gz +0 -0
- package/dist/{chunk-DC4GIE7E.js → chunk-T5IS3MGN.js} +3 -3
- package/dist/chunk-T5IS3MGN.js.br +0 -0
- package/dist/chunk-T5IS3MGN.js.gz +0 -0
- package/dist/{chunk-IXCNYPFK.mjs → chunk-U2UPBBJV.mjs} +1 -1
- package/dist/chunk-U2UPBBJV.mjs.br +0 -0
- package/dist/chunk-U2UPBBJV.mjs.gz +0 -0
- package/dist/{chunk-ZAO36XAK.mjs → chunk-WJNWCKS7.mjs} +5 -5
- package/dist/chunk-WJNWCKS7.mjs.br +0 -0
- package/dist/chunk-WJNWCKS7.mjs.gz +0 -0
- package/dist/{chunk-SBRSPTSA.js → chunk-YBTRSG74.js} +190 -144
- package/dist/chunk-YBTRSG74.js.br +0 -0
- package/dist/chunk-YBTRSG74.js.gz +0 -0
- package/dist/index.js +39 -39
- 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 +26 -26
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-HSQLY6O7.mjs.br +0 -0
- package/dist/AiChatPanel-HSQLY6O7.mjs.gz +0 -0
- package/dist/AiChatPanel-WGX7DUQE.js.br +0 -0
- package/dist/AiChatPanel-WGX7DUQE.js.gz +0 -0
- package/dist/Model3DScene-3DOCQYAE.mjs.br +0 -0
- package/dist/Model3DScene-3DOCQYAE.mjs.gz +0 -0
- package/dist/Model3DScene-DYWYNVLU.js.br +0 -0
- package/dist/Model3DScene-DYWYNVLU.js.gz +0 -0
- package/dist/SurfaceChart3DScene-7UB5JE2W.js.br +0 -0
- package/dist/SurfaceChart3DScene-7UB5JE2W.js.gz +0 -0
- package/dist/SurfaceChart3DScene-GIKV3DXC.mjs.gz +0 -0
- package/dist/chunk-DC4GIE7E.js.br +0 -0
- package/dist/chunk-DC4GIE7E.js.gz +0 -0
- package/dist/chunk-GLC2RPKN.mjs.br +0 -0
- package/dist/chunk-GLC2RPKN.mjs.gz +0 -0
- package/dist/chunk-IXCNYPFK.mjs.br +0 -0
- package/dist/chunk-IXCNYPFK.mjs.gz +0 -0
- package/dist/chunk-IXEHYABF.mjs.br +0 -0
- package/dist/chunk-IXEHYABF.mjs.gz +0 -0
- package/dist/chunk-LVGFV42Z.mjs.br +0 -0
- package/dist/chunk-LVGFV42Z.mjs.gz +0 -0
- package/dist/chunk-MQXKBH43.js.br +0 -0
- package/dist/chunk-MQXKBH43.js.gz +0 -0
- package/dist/chunk-RSNAGJTQ.js.br +0 -0
- package/dist/chunk-RSNAGJTQ.js.gz +0 -0
- package/dist/chunk-SBRSPTSA.js.br +0 -0
- package/dist/chunk-SBRSPTSA.js.gz +0 -0
- package/dist/chunk-U47SG5XL.js.br +0 -0
- package/dist/chunk-U47SG5XL.js.gz +0 -0
- package/dist/chunk-ZAO36XAK.mjs.br +0 -0
- package/dist/chunk-ZAO36XAK.mjs.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkFHTEL3Q6_js = require('./chunk-FHTEL3Q6.js');
|
|
4
4
|
var chunk3ISYPBSX_js = require('./chunk-3ISYPBSX.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkYBTRSG74_js = require('./chunk-YBTRSG74.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 = chunkYBTRSG74_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 = chunkYBTRSG74_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") => {
|
|
@@ -85,7 +85,7 @@ function usePresenceTracking({
|
|
|
85
85
|
}) {
|
|
86
86
|
const [remoteUsers, setRemoteUsers] = react.useState([]);
|
|
87
87
|
const projectorRef = react.useRef(null);
|
|
88
|
-
projectorRef.current ??=
|
|
88
|
+
projectorRef.current ??= chunkYBTRSG74_js.createPresenceProjector();
|
|
89
89
|
const projector = projectorRef.current;
|
|
90
90
|
const lastBroadcastRef = react.useRef(0);
|
|
91
91
|
const pendingBroadcastRef = react.useRef(null);
|
|
@@ -110,7 +110,7 @@ function usePresenceTracking({
|
|
|
110
110
|
awareness.setLocalStateField("presence", state);
|
|
111
111
|
lastBroadcastRef.current = Date.now();
|
|
112
112
|
};
|
|
113
|
-
if (elapsed >=
|
|
113
|
+
if (elapsed >= chunkYBTRSG74_js.BROADCAST_THROTTLE_MS) {
|
|
114
114
|
if (pendingBroadcastRef.current) {
|
|
115
115
|
clearTimeout(pendingBroadcastRef.current);
|
|
116
116
|
pendingBroadcastRef.current = null;
|
|
@@ -120,7 +120,7 @@ function usePresenceTracking({
|
|
|
120
120
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
121
121
|
pendingBroadcastRef.current = null;
|
|
122
122
|
flush();
|
|
123
|
-
},
|
|
123
|
+
}, chunkYBTRSG74_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
124
124
|
}
|
|
125
125
|
},
|
|
126
126
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -200,7 +200,7 @@ function useYjsProvider({ config }) {
|
|
|
200
200
|
const departureRef = react.useRef(null);
|
|
201
201
|
const gateRef = react.useRef(null);
|
|
202
202
|
if (!gateRef.current) {
|
|
203
|
-
gateRef.current =
|
|
203
|
+
gateRef.current = chunkYBTRSG74_js.createSyncGate(() => setSynced(true));
|
|
204
204
|
}
|
|
205
205
|
const teardown = react.useCallback(() => {
|
|
206
206
|
if (timeoutRef.current) {
|
|
@@ -220,7 +220,7 @@ function useYjsProvider({ config }) {
|
|
|
220
220
|
const buildCleanup = react.useCallback(
|
|
221
221
|
(provider, yDoc) => () => {
|
|
222
222
|
announceDeparture();
|
|
223
|
-
|
|
223
|
+
chunkYBTRSG74_js.clearLocalAwareness(provider.awareness);
|
|
224
224
|
provider.destroy();
|
|
225
225
|
yDoc.destroy();
|
|
226
226
|
setDoc(null);
|
|
@@ -245,9 +245,9 @@ function useYjsProvider({ config }) {
|
|
|
245
245
|
if (config.authToken) {
|
|
246
246
|
opts.password = config.authToken;
|
|
247
247
|
}
|
|
248
|
-
const roomId =
|
|
248
|
+
const roomId = chunkYBTRSG74_js.validateRoomId(config.roomId);
|
|
249
249
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
250
|
-
departureRef.current =
|
|
250
|
+
departureRef.current = chunkYBTRSG74_js.createDepartureChannel(roomId, provider.awareness);
|
|
251
251
|
setDoc(yDoc);
|
|
252
252
|
setAwareness(provider.awareness);
|
|
253
253
|
setClientId(provider.awareness.clientID);
|
|
@@ -289,13 +289,13 @@ function useYjsProvider({ config }) {
|
|
|
289
289
|
if (!config) {
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
const roomId =
|
|
293
|
-
const transport = config.transport ??
|
|
292
|
+
const roomId = chunkYBTRSG74_js.validateRoomId(config.roomId);
|
|
293
|
+
const transport = config.transport ?? chunkYBTRSG74_js.resolveTransportForServerUrl(config.serverUrl);
|
|
294
294
|
if (transport === "webrtc") {
|
|
295
295
|
await initWebrtc();
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
if (
|
|
298
|
+
if (chunkYBTRSG74_js.isMixedContentBlocked(config.serverUrl)) {
|
|
299
299
|
console.warn(
|
|
300
300
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
301
301
|
);
|
|
@@ -309,7 +309,7 @@ function useYjsProvider({ config }) {
|
|
|
309
309
|
const provider = new WebsocketProvider(config.serverUrl, roomId, yDoc, {
|
|
310
310
|
params: config.authToken ? { token: config.authToken } : void 0
|
|
311
311
|
});
|
|
312
|
-
departureRef.current =
|
|
312
|
+
departureRef.current = chunkYBTRSG74_js.createDepartureChannel(roomId, provider.awareness);
|
|
313
313
|
let connected = false;
|
|
314
314
|
const handleStatus = (event) => {
|
|
315
315
|
if (event.status === "connected") {
|
|
@@ -349,7 +349,7 @@ function useYjsProvider({ config }) {
|
|
|
349
349
|
provider.off("status", handleStatus);
|
|
350
350
|
provider.off("sync", handleSynced);
|
|
351
351
|
announceDeparture();
|
|
352
|
-
|
|
352
|
+
chunkYBTRSG74_js.clearLocalAwareness(provider.awareness);
|
|
353
353
|
provider.destroy();
|
|
354
354
|
yDoc.destroy();
|
|
355
355
|
setDoc(null);
|
|
@@ -358,7 +358,7 @@ function useYjsProvider({ config }) {
|
|
|
358
358
|
cleanupRef.current = null;
|
|
359
359
|
setStatus("error");
|
|
360
360
|
}
|
|
361
|
-
},
|
|
361
|
+
}, chunkYBTRSG74_js.CONNECTION_TIMEOUT_MS);
|
|
362
362
|
}
|
|
363
363
|
setDoc(yDoc);
|
|
364
364
|
setAwareness(provider.awareness);
|
|
@@ -367,7 +367,7 @@ function useYjsProvider({ config }) {
|
|
|
367
367
|
provider.off("status", handleStatus);
|
|
368
368
|
provider.off("sync", handleSynced);
|
|
369
369
|
announceDeparture();
|
|
370
|
-
|
|
370
|
+
chunkYBTRSG74_js.clearLocalAwareness(provider.awareness);
|
|
371
371
|
provider.destroy();
|
|
372
372
|
yDoc.destroy();
|
|
373
373
|
setDoc(null);
|
|
@@ -393,7 +393,7 @@ function useYjsProvider({ config }) {
|
|
|
393
393
|
]);
|
|
394
394
|
react.useEffect(() => {
|
|
395
395
|
init();
|
|
396
|
-
const disposeTeardown =
|
|
396
|
+
const disposeTeardown = chunkYBTRSG74_js.registerCollaborationTeardown({
|
|
397
397
|
leave: teardown,
|
|
398
398
|
rejoin: init
|
|
399
399
|
});
|
|
@@ -414,7 +414,7 @@ function useCollaborativeState({
|
|
|
414
414
|
canvasWidth,
|
|
415
415
|
canvasHeight
|
|
416
416
|
}) {
|
|
417
|
-
const userColor =
|
|
417
|
+
const userColor = chunkYBTRSG74_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
418
418
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
419
419
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
420
420
|
awareness,
|
|
@@ -523,8 +523,8 @@ function useEditorHistory(input) {
|
|
|
523
523
|
width: canvasSize.width,
|
|
524
524
|
height: canvasSize.height,
|
|
525
525
|
activeSlideIndex,
|
|
526
|
-
slides: slides.map(
|
|
527
|
-
templateElementsBySlideId:
|
|
526
|
+
slides: slides.map(chunkYBTRSG74_js.cloneSlide),
|
|
527
|
+
templateElementsBySlideId: chunkYBTRSG74_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
528
528
|
...actionLabel ? { actionLabel } : {}
|
|
529
529
|
};
|
|
530
530
|
},
|
|
@@ -537,9 +537,9 @@ function useEditorHistory(input) {
|
|
|
537
537
|
width: snapshot.width,
|
|
538
538
|
height: snapshot.height
|
|
539
539
|
});
|
|
540
|
-
setSlides(snapshot.slides.map(
|
|
540
|
+
setSlides(snapshot.slides.map(chunkYBTRSG74_js.cloneSlide));
|
|
541
541
|
setTemplateElementsBySlideId(
|
|
542
|
-
|
|
542
|
+
chunkYBTRSG74_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
543
543
|
);
|
|
544
544
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
545
545
|
setSelectedElementIds([]);
|
|
@@ -573,8 +573,8 @@ function useEditorHistory(input) {
|
|
|
573
573
|
const currentSnapshot = buildHistorySnapshot();
|
|
574
574
|
historyFutureRef.current.push(currentSnapshot);
|
|
575
575
|
isApplyingHistoryRef.current = true;
|
|
576
|
-
const nextSnapshot =
|
|
577
|
-
lastHistorySnapshotRef.current =
|
|
576
|
+
const nextSnapshot = chunkFHTEL3Q6_js.cloneHistorySnapshot(previousSnapshot);
|
|
577
|
+
lastHistorySnapshotRef.current = chunkFHTEL3Q6_js.cloneHistorySnapshot(nextSnapshot);
|
|
578
578
|
lastHistorySerializedRef.current = JSON.stringify(nextSnapshot);
|
|
579
579
|
applyHistorySnapshot(nextSnapshot);
|
|
580
580
|
updateHistoryAvailability();
|
|
@@ -595,8 +595,8 @@ function useEditorHistory(input) {
|
|
|
595
595
|
const currentSnapshot = buildHistorySnapshot();
|
|
596
596
|
historyPastRef.current.push(currentSnapshot);
|
|
597
597
|
isApplyingHistoryRef.current = true;
|
|
598
|
-
const targetSnapshot =
|
|
599
|
-
lastHistorySnapshotRef.current =
|
|
598
|
+
const targetSnapshot = chunkFHTEL3Q6_js.cloneHistorySnapshot(nextSnapshot);
|
|
599
|
+
lastHistorySnapshotRef.current = chunkFHTEL3Q6_js.cloneHistorySnapshot(targetSnapshot);
|
|
600
600
|
lastHistorySerializedRef.current = JSON.stringify(targetSnapshot);
|
|
601
601
|
applyHistorySnapshot(targetSnapshot);
|
|
602
602
|
updateHistoryAvailability();
|
|
@@ -614,7 +614,7 @@ function useEditorHistory(input) {
|
|
|
614
614
|
historyPastRef.current = [];
|
|
615
615
|
historyFutureRef.current = [];
|
|
616
616
|
if (initialSnapshot) {
|
|
617
|
-
const clonedInitial =
|
|
617
|
+
const clonedInitial = chunkFHTEL3Q6_js.cloneHistorySnapshot(initialSnapshot);
|
|
618
618
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
619
619
|
lastHistorySerializedRef.current = JSON.stringify(clonedInitial);
|
|
620
620
|
} else {
|
|
@@ -655,18 +655,18 @@ function useEditorHistory(input) {
|
|
|
655
655
|
}
|
|
656
656
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
657
657
|
if (!previousSnapshot) {
|
|
658
|
-
lastHistorySnapshotRef.current =
|
|
658
|
+
lastHistorySnapshotRef.current = chunkFHTEL3Q6_js.cloneHistorySnapshot(snapshot);
|
|
659
659
|
lastHistorySerializedRef.current = serialized;
|
|
660
660
|
lastCheapHashRef.current = cheapHash;
|
|
661
661
|
updateHistoryAvailability();
|
|
662
662
|
return;
|
|
663
663
|
}
|
|
664
|
-
historyPastRef.current.push(
|
|
664
|
+
historyPastRef.current.push(chunkFHTEL3Q6_js.cloneHistorySnapshot(previousSnapshot));
|
|
665
665
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
666
666
|
historyPastRef.current.shift();
|
|
667
667
|
}
|
|
668
668
|
historyFutureRef.current = [];
|
|
669
|
-
lastHistorySnapshotRef.current =
|
|
669
|
+
lastHistorySnapshotRef.current = chunkFHTEL3Q6_js.cloneHistorySnapshot(snapshot);
|
|
670
670
|
lastHistorySerializedRef.current = serialized;
|
|
671
671
|
lastCheapHashRef.current = cheapHash;
|
|
672
672
|
updateHistoryAvailability();
|
|
@@ -727,7 +727,7 @@ function useZoomViewport({
|
|
|
727
727
|
const canvasViewportRef = react.useRef(null);
|
|
728
728
|
const renderScaleRef = react.useRef(1);
|
|
729
729
|
const storeRef = react.useRef(null);
|
|
730
|
-
storeRef.current ??=
|
|
730
|
+
storeRef.current ??= chunkYBTRSG74_js.createViewerZoomStore();
|
|
731
731
|
const store = storeRef.current;
|
|
732
732
|
const scale = useViewerStore(store, selectZoom);
|
|
733
733
|
const setScale = react.useCallback(
|
|
@@ -788,7 +788,7 @@ function useZoomViewport({
|
|
|
788
788
|
if (!wrapper || !canvasViewport) {
|
|
789
789
|
return;
|
|
790
790
|
}
|
|
791
|
-
const boundedScale =
|
|
791
|
+
const boundedScale = chunkYBTRSG74_js.clampZoomScale(nextScale);
|
|
792
792
|
const nextEditorScale = fitScale * boundedScale;
|
|
793
793
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
794
794
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -825,29 +825,29 @@ function useZoomViewport({
|
|
|
825
825
|
selectedElements.forEach((element) => {
|
|
826
826
|
minX = Math.min(minX, element.x);
|
|
827
827
|
minY = Math.min(minY, element.y);
|
|
828
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
829
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
828
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkFHTEL3Q6_js.MIN_ELEMENT_SIZE));
|
|
829
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkFHTEL3Q6_js.MIN_ELEMENT_SIZE));
|
|
830
830
|
});
|
|
831
831
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
832
832
|
return;
|
|
833
833
|
}
|
|
834
834
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
835
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
836
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
835
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkFHTEL3Q6_js.MIN_ELEMENT_SIZE);
|
|
836
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkFHTEL3Q6_js.MIN_ELEMENT_SIZE);
|
|
837
837
|
const availableWidth = Math.max(
|
|
838
|
-
effectiveEditorDimensions.width -
|
|
839
|
-
|
|
838
|
+
effectiveEditorDimensions.width - chunkFHTEL3Q6_js.ZOOM_TO_SELECTION_PADDING,
|
|
839
|
+
chunkFHTEL3Q6_js.MIN_ELEMENT_SIZE
|
|
840
840
|
);
|
|
841
841
|
const availableHeight = Math.max(
|
|
842
|
-
effectiveEditorDimensions.height -
|
|
843
|
-
|
|
842
|
+
effectiveEditorDimensions.height - chunkFHTEL3Q6_js.ZOOM_TO_SELECTION_PADDING,
|
|
843
|
+
chunkFHTEL3Q6_js.MIN_ELEMENT_SIZE
|
|
844
844
|
);
|
|
845
845
|
const targetEditorScale = Math.min(
|
|
846
846
|
availableWidth / boundsWidth,
|
|
847
847
|
availableHeight / boundsHeight
|
|
848
848
|
);
|
|
849
849
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
850
|
-
const nextScale =
|
|
850
|
+
const nextScale = chunkYBTRSG74_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
851
851
|
setScale(nextScale);
|
|
852
852
|
window.requestAnimationFrame(() => {
|
|
853
853
|
window.requestAnimationFrame(() => {
|
|
@@ -871,7 +871,7 @@ function useZoomViewport({
|
|
|
871
871
|
const delta = event.deltaY * -1e-3;
|
|
872
872
|
store.dispatch({
|
|
873
873
|
type: "set-zoom",
|
|
874
|
-
zoom:
|
|
874
|
+
zoom: chunkYBTRSG74_js.clampZoomScale(store.getState().zoom + delta)
|
|
875
875
|
});
|
|
876
876
|
},
|
|
877
877
|
[store]
|
|
@@ -959,7 +959,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
959
959
|
const command = step.command;
|
|
960
960
|
const timer = window.setTimeout(
|
|
961
961
|
() => {
|
|
962
|
-
|
|
962
|
+
chunkFHTEL3Q6_js.executeMediaCommand(command);
|
|
963
963
|
},
|
|
964
964
|
Math.max(0, step.delayMs)
|
|
965
965
|
);
|
|
@@ -1096,7 +1096,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1096
1096
|
}))
|
|
1097
1097
|
);
|
|
1098
1098
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1099
|
-
const delay =
|
|
1099
|
+
const delay = chunkYBTRSG74_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1100
1100
|
const timer = window.setTimeout(() => {
|
|
1101
1101
|
setPresentationAnimations(
|
|
1102
1102
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1128,7 +1128,7 @@ function useAnimationPlayback(input) {
|
|
|
1128
1128
|
(controller, group) => {
|
|
1129
1129
|
driveBuildReveal(
|
|
1130
1130
|
controller,
|
|
1131
|
-
|
|
1131
|
+
chunkYBTRSG74_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1132
1132
|
setPresentationElementStates,
|
|
1133
1133
|
buildRafRef
|
|
1134
1134
|
);
|
|
@@ -1191,7 +1191,7 @@ function useAnimationPlayback(input) {
|
|
|
1191
1191
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1192
1192
|
return;
|
|
1193
1193
|
}
|
|
1194
|
-
const controller =
|
|
1194
|
+
const controller = chunkYBTRSG74_js.PresentationAnimationController.fromSlide(slide);
|
|
1195
1195
|
controllerRef.current = controller;
|
|
1196
1196
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1197
1197
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1349,12 +1349,12 @@ function useAnimationPlayback(input) {
|
|
|
1349
1349
|
presentationTimersRef
|
|
1350
1350
|
};
|
|
1351
1351
|
}
|
|
1352
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1353
|
-
var AUDIENCE_HASH =
|
|
1354
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1355
|
-
var AUDIENCE_NONCE_KEY =
|
|
1352
|
+
var PRESENTER_CHANNEL_NAME = chunkYBTRSG74_js.PRESENTATION_CHANNEL_NAME;
|
|
1353
|
+
var AUDIENCE_HASH = chunkYBTRSG74_js.PRESENTATION_HASH;
|
|
1354
|
+
var PRESENTER_MSG_ORIGIN = chunkYBTRSG74_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1355
|
+
var AUDIENCE_NONCE_KEY = chunkYBTRSG74_js.PRESENTATION_NONCE_KEY;
|
|
1356
1356
|
function generateSessionId() {
|
|
1357
|
-
return
|
|
1357
|
+
return chunkYBTRSG74_js.createPresentationSessionId();
|
|
1358
1358
|
}
|
|
1359
1359
|
function parseAudienceNonce() {
|
|
1360
1360
|
const hash = window.location.hash;
|
|
@@ -1390,7 +1390,7 @@ function usePresenterWindow(input) {
|
|
|
1390
1390
|
}, []);
|
|
1391
1391
|
const swapDisplays = react.useCallback(async () => {
|
|
1392
1392
|
const audience = audienceWindowRef.current;
|
|
1393
|
-
return audience && !audience.closed ?
|
|
1393
|
+
return audience && !audience.closed ? chunkYBTRSG74_js.swapPresentationWindows(window, audience) : false;
|
|
1394
1394
|
}, []);
|
|
1395
1395
|
const syncSlideToAudience = react.useCallback(
|
|
1396
1396
|
(slideIndex) => {
|
|
@@ -1454,7 +1454,7 @@ function usePresenterWindow(input) {
|
|
|
1454
1454
|
pollTimerRef.current = null;
|
|
1455
1455
|
}
|
|
1456
1456
|
if (closingSessionId) {
|
|
1457
|
-
void
|
|
1457
|
+
void chunkYBTRSG74_js.clearAudienceContent(closingSessionId);
|
|
1458
1458
|
}
|
|
1459
1459
|
}, [getChannel]);
|
|
1460
1460
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1472,10 +1472,10 @@ function usePresenterWindow(input) {
|
|
|
1472
1472
|
audienceWindowRef.current = blankWin;
|
|
1473
1473
|
const sessionId = generateSessionId();
|
|
1474
1474
|
sessionIdRef.current = sessionId;
|
|
1475
|
-
const audienceUrl =
|
|
1476
|
-
void
|
|
1475
|
+
const audienceUrl = chunkYBTRSG74_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1476
|
+
void chunkYBTRSG74_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1477
1477
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1478
|
-
|
|
1478
|
+
chunkYBTRSG74_js.placeAudienceWindow(blankWin, placement);
|
|
1479
1479
|
}
|
|
1480
1480
|
return void 0;
|
|
1481
1481
|
});
|
|
@@ -1505,7 +1505,7 @@ function usePresenterWindow(input) {
|
|
|
1505
1505
|
}
|
|
1506
1506
|
};
|
|
1507
1507
|
if (content) {
|
|
1508
|
-
void
|
|
1508
|
+
void chunkYBTRSG74_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1509
1509
|
} else {
|
|
1510
1510
|
navigateOrClose(true);
|
|
1511
1511
|
}
|
|
@@ -1531,7 +1531,7 @@ function usePresenterWindow(input) {
|
|
|
1531
1531
|
}
|
|
1532
1532
|
const handleMessage = (event) => {
|
|
1533
1533
|
const message = event.data;
|
|
1534
|
-
if (
|
|
1534
|
+
if (chunkYBTRSG74_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1535
1535
|
syncStateToAudience(snapshotRef.current);
|
|
1536
1536
|
}
|
|
1537
1537
|
};
|
|
@@ -1560,7 +1560,7 @@ function usePresenterWindow(input) {
|
|
|
1560
1560
|
react.useEffect(() => {
|
|
1561
1561
|
const handleBeforeUnload = () => {
|
|
1562
1562
|
if (sessionIdRef.current) {
|
|
1563
|
-
void
|
|
1563
|
+
void chunkYBTRSG74_js.clearAudienceContent(sessionIdRef.current);
|
|
1564
1564
|
}
|
|
1565
1565
|
};
|
|
1566
1566
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1622,7 +1622,7 @@ function useAudienceMode(input) {
|
|
|
1622
1622
|
}
|
|
1623
1623
|
channel.onmessage = (event) => {
|
|
1624
1624
|
const data = event.data;
|
|
1625
|
-
if (!
|
|
1625
|
+
if (!chunkYBTRSG74_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1626
1626
|
return;
|
|
1627
1627
|
}
|
|
1628
1628
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1638,16 +1638,16 @@ function useAudienceMode(input) {
|
|
|
1638
1638
|
}
|
|
1639
1639
|
if (data.type === "presenter-exit") {
|
|
1640
1640
|
if (expectedSessionId) {
|
|
1641
|
-
void
|
|
1641
|
+
void chunkYBTRSG74_js.clearAudienceContent(expectedSessionId);
|
|
1642
1642
|
}
|
|
1643
|
-
if (
|
|
1643
|
+
if (chunkYBTRSG74_js.endAudienceDisplay(window)) {
|
|
1644
1644
|
handlers.onPresenterEnded?.();
|
|
1645
1645
|
}
|
|
1646
1646
|
}
|
|
1647
1647
|
};
|
|
1648
1648
|
if (expectedSessionId) {
|
|
1649
1649
|
channel.postMessage({
|
|
1650
|
-
origin:
|
|
1650
|
+
origin: chunkYBTRSG74_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1651
1651
|
type: "audience-ready",
|
|
1652
1652
|
sessionId: expectedSessionId
|
|
1653
1653
|
});
|
|
@@ -1680,14 +1680,14 @@ function usePresentationKeyboard(input) {
|
|
|
1680
1680
|
presentationSlideIndex,
|
|
1681
1681
|
setShowRehearsalSummary
|
|
1682
1682
|
} = input;
|
|
1683
|
-
const keyBufferRef = react.useRef(
|
|
1683
|
+
const keyBufferRef = react.useRef(chunkYBTRSG74_js.createPresentationKeyBuffer());
|
|
1684
1684
|
react.useEffect(() => {
|
|
1685
|
-
if (mode !== "present" || !
|
|
1686
|
-
keyBufferRef.current =
|
|
1685
|
+
if (mode !== "present" || !chunkYBTRSG74_js.acceptsPresentationInput()) {
|
|
1686
|
+
keyBufferRef.current = chunkYBTRSG74_js.createPresentationKeyBuffer();
|
|
1687
1687
|
return;
|
|
1688
1688
|
}
|
|
1689
1689
|
const handleKeyDown = (event) => {
|
|
1690
|
-
const mapped =
|
|
1690
|
+
const mapped = chunkYBTRSG74_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1691
1691
|
if (mapped.action === "none") {
|
|
1692
1692
|
return;
|
|
1693
1693
|
}
|
|
@@ -1707,12 +1707,12 @@ function usePresentationKeyboard(input) {
|
|
|
1707
1707
|
movePresentationSlide(-1);
|
|
1708
1708
|
return;
|
|
1709
1709
|
case "first": {
|
|
1710
|
-
const first =
|
|
1710
|
+
const first = chunkYBTRSG74_js.firstShowSlideIndex(showSlideIndexes);
|
|
1711
1711
|
navigateToSlide(first ?? 0);
|
|
1712
1712
|
return;
|
|
1713
1713
|
}
|
|
1714
1714
|
case "last": {
|
|
1715
|
-
const last =
|
|
1715
|
+
const last = chunkYBTRSG74_js.lastShowSlideIndex(showSlideIndexes);
|
|
1716
1716
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1717
1717
|
return;
|
|
1718
1718
|
}
|
|
@@ -1867,7 +1867,7 @@ function useRehearsalTimings(input) {
|
|
|
1867
1867
|
|
|
1868
1868
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1869
1869
|
function handlePresentationActionImpl(action, deps) {
|
|
1870
|
-
|
|
1870
|
+
chunkYBTRSG74_js.runPresentationAction(
|
|
1871
1871
|
action,
|
|
1872
1872
|
{ slideCount: deps.slidesLength },
|
|
1873
1873
|
{
|
|
@@ -1889,7 +1889,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1889
1889
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1890
1890
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1891
1891
|
const transition = incomingSlide?.transition;
|
|
1892
|
-
const durationMs = deps.playTransition ?
|
|
1892
|
+
const durationMs = deps.playTransition ? chunkYBTRSG74_js.resolveTransitionDurationMs(transition) : 0;
|
|
1893
1893
|
deps.clearPresentationTimers();
|
|
1894
1894
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1895
1895
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1948,7 +1948,7 @@ function useSlideNavigation(input) {
|
|
|
1948
1948
|
});
|
|
1949
1949
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1950
1950
|
(slideIndex) => {
|
|
1951
|
-
const delayMs =
|
|
1951
|
+
const delayMs = chunkYBTRSG74_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1952
1952
|
if (delayMs === void 0) {
|
|
1953
1953
|
return;
|
|
1954
1954
|
}
|
|
@@ -1971,7 +1971,7 @@ function useSlideNavigation(input) {
|
|
|
1971
1971
|
if (availableSlideIndexes.length === 0) {
|
|
1972
1972
|
return;
|
|
1973
1973
|
}
|
|
1974
|
-
const pastLastSlide = direction === 1 && !
|
|
1974
|
+
const pastLastSlide = direction === 1 && !chunkYBTRSG74_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1975
1975
|
if (rehearsing && pastLastSlide) {
|
|
1976
1976
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1977
1977
|
try {
|
|
@@ -1989,9 +1989,9 @@ function useSlideNavigation(input) {
|
|
|
1989
1989
|
onAdvancePastLastSlide();
|
|
1990
1990
|
return;
|
|
1991
1991
|
}
|
|
1992
|
-
const nextSlideIndex = direction === 1 ?
|
|
1992
|
+
const nextSlideIndex = direction === 1 ? chunkYBTRSG74_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1993
1993
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
1994
|
-
}) :
|
|
1994
|
+
}) : chunkYBTRSG74_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
1995
1995
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
1996
1996
|
return;
|
|
1997
1997
|
}
|
|
@@ -2136,22 +2136,22 @@ function useZoomNavigation(input) {
|
|
|
2136
2136
|
};
|
|
2137
2137
|
}
|
|
2138
2138
|
function usePresenterConsole(slideIndex, active) {
|
|
2139
|
-
const timerRef = react.useRef(
|
|
2140
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2139
|
+
const timerRef = react.useRef(chunkYBTRSG74_js.createPresenterTimer());
|
|
2140
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkYBTRSG74_js.createInitialPresentationSnapshot(slideIndex));
|
|
2141
2141
|
const patch = react.useCallback((value) => {
|
|
2142
|
-
setSnapshot((current) =>
|
|
2142
|
+
setSnapshot((current) => chunkYBTRSG74_js.mergePresentationSnapshot(current, value));
|
|
2143
2143
|
}, []);
|
|
2144
2144
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2145
2145
|
react.useEffect(() => {
|
|
2146
2146
|
if (!active) {
|
|
2147
2147
|
return;
|
|
2148
2148
|
}
|
|
2149
|
-
timerRef.current =
|
|
2149
|
+
timerRef.current = chunkYBTRSG74_js.resetPresenterTimer();
|
|
2150
2150
|
patch({ paused: false, elapsedMs: 0 });
|
|
2151
2151
|
const timer = window.setInterval(() => {
|
|
2152
2152
|
patch({
|
|
2153
2153
|
paused: timerRef.current.paused,
|
|
2154
|
-
elapsedMs:
|
|
2154
|
+
elapsedMs: chunkYBTRSG74_js.presenterElapsed(timerRef.current)
|
|
2155
2155
|
});
|
|
2156
2156
|
}, 1e3);
|
|
2157
2157
|
return () => window.clearInterval(timer);
|
|
@@ -2161,19 +2161,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2161
2161
|
applyAudienceSnapshot: setSnapshot,
|
|
2162
2162
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2163
2163
|
toggleTimer: () => {
|
|
2164
|
-
timerRef.current =
|
|
2164
|
+
timerRef.current = chunkYBTRSG74_js.togglePresenterTimer(timerRef.current);
|
|
2165
2165
|
patch({
|
|
2166
2166
|
paused: timerRef.current.paused,
|
|
2167
|
-
elapsedMs:
|
|
2167
|
+
elapsedMs: chunkYBTRSG74_js.presenterElapsed(timerRef.current)
|
|
2168
2168
|
});
|
|
2169
2169
|
},
|
|
2170
2170
|
resetTimer: () => {
|
|
2171
|
-
timerRef.current =
|
|
2171
|
+
timerRef.current = chunkYBTRSG74_js.resetPresenterTimer();
|
|
2172
2172
|
patch({ paused: false, elapsedMs: 0 });
|
|
2173
2173
|
},
|
|
2174
2174
|
stepZoom: (direction) => setSnapshot(
|
|
2175
|
-
(current) =>
|
|
2176
|
-
zoom:
|
|
2175
|
+
(current) => chunkYBTRSG74_js.mergePresentationSnapshot(current, {
|
|
2176
|
+
zoom: chunkYBTRSG74_js.stepPresenterZoom(
|
|
2177
2177
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2178
2178
|
direction
|
|
2179
2179
|
)
|
|
@@ -2218,7 +2218,7 @@ function usePresentationMode(input) {
|
|
|
2218
2218
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2219
2219
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2220
2220
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2221
|
-
const showGuard = react.useMemo(() =>
|
|
2221
|
+
const showGuard = react.useMemo(() => chunkYBTRSG74_js.createPresenterShowGuard(), []);
|
|
2222
2222
|
const {
|
|
2223
2223
|
presentationAnimations,
|
|
2224
2224
|
presentationElementStates,
|
|
@@ -2297,7 +2297,7 @@ function usePresentationMode(input) {
|
|
|
2297
2297
|
});
|
|
2298
2298
|
const movePresentationSlide = react.useCallback(
|
|
2299
2299
|
(direction, trigger = "explicit") => {
|
|
2300
|
-
if (!
|
|
2300
|
+
if (!chunkYBTRSG74_js.acceptsPresentationInput()) {
|
|
2301
2301
|
return;
|
|
2302
2302
|
}
|
|
2303
2303
|
if (endOfShowVisible) {
|
|
@@ -2434,7 +2434,7 @@ function usePresentationMode(input) {
|
|
|
2434
2434
|
if (mode !== "present") {
|
|
2435
2435
|
return;
|
|
2436
2436
|
}
|
|
2437
|
-
return
|
|
2437
|
+
return chunkYBTRSG74_js.attachPresentationVisibilityPause({
|
|
2438
2438
|
root: containerRef.current ?? void 0,
|
|
2439
2439
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2440
2440
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2514,11 +2514,11 @@ function usePresentationMode(input) {
|
|
|
2514
2514
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2515
2515
|
return void 0;
|
|
2516
2516
|
}
|
|
2517
|
-
return
|
|
2517
|
+
return chunkYBTRSG74_js.buildMorphTransitionPlan(
|
|
2518
2518
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2519
2519
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2520
2520
|
transitionOverlay.durationMs,
|
|
2521
|
-
|
|
2521
|
+
chunkYBTRSG74_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2522
2522
|
);
|
|
2523
2523
|
}, [transitionOverlay, slides]);
|
|
2524
2524
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2824,7 +2824,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2824
2824
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2825
2825
|
slides.forEach((slide, slideIndex) => {
|
|
2826
2826
|
for (const element of slide.elements || []) {
|
|
2827
|
-
if (!
|
|
2827
|
+
if (!chunkYBTRSG74_js.hasTextProperties(element)) {
|
|
2828
2828
|
continue;
|
|
2829
2829
|
}
|
|
2830
2830
|
const segments = element.textSegments ?? [];
|
|
@@ -2875,7 +2875,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2875
2875
|
continue;
|
|
2876
2876
|
}
|
|
2877
2877
|
const element = slide.elements[elIdx];
|
|
2878
|
-
if (!
|
|
2878
|
+
if (!chunkYBTRSG74_js.hasTextProperties(element)) {
|
|
2879
2879
|
continue;
|
|
2880
2880
|
}
|
|
2881
2881
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3473,7 +3473,7 @@ function useViewerCoreState(_input) {
|
|
|
3473
3473
|
const shapeAdjustmentDragStateRef = react.useRef(null);
|
|
3474
3474
|
const marqueeStateRef = react.useRef(null);
|
|
3475
3475
|
const isDrawingRef = react.useRef(false);
|
|
3476
|
-
const livePatcher = react.useMemo(() =>
|
|
3476
|
+
const livePatcher = react.useMemo(() => chunkYBTRSG74_js.createCollaborationLivePatcher(), []);
|
|
3477
3477
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3478
3478
|
const slidesRef = react.useRef([]);
|
|
3479
3479
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3482,8 +3482,8 @@ function useViewerCoreState(_input) {
|
|
|
3482
3482
|
const [slides, setSlides] = react.useState([]);
|
|
3483
3483
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3484
3484
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3485
|
-
width:
|
|
3486
|
-
height:
|
|
3485
|
+
width: chunkFHTEL3Q6_js.DEFAULT_CANVAS_WIDTH,
|
|
3486
|
+
height: chunkFHTEL3Q6_js.DEFAULT_CANVAS_HEIGHT
|
|
3487
3487
|
});
|
|
3488
3488
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
3489
3489
|
const [selectedElementId, setSelectedElementId] = react.useState(null);
|
|
@@ -3503,7 +3503,7 @@ function useViewerCoreState(_input) {
|
|
|
3503
3503
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3504
3504
|
inlineEditingTextRef.current = resolved;
|
|
3505
3505
|
setInlineEditingTextBase(value);
|
|
3506
|
-
|
|
3506
|
+
chunkYBTRSG74_js.publishLiveInlineText(
|
|
3507
3507
|
livePatcher,
|
|
3508
3508
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3509
3509
|
inlineEditingElementIdRef.current,
|
|
@@ -3837,7 +3837,7 @@ function useLoadContent({
|
|
|
3837
3837
|
);
|
|
3838
3838
|
}
|
|
3839
3839
|
const previousHandler = handlerRef.current;
|
|
3840
|
-
const handler = new
|
|
3840
|
+
const handler = new chunkYBTRSG74_js.PptxHandler();
|
|
3841
3841
|
const parsed = await handler.load(buffer);
|
|
3842
3842
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3843
3843
|
handler.dispose();
|
|
@@ -3849,7 +3849,7 @@ function useLoadContent({
|
|
|
3849
3849
|
handlerRef.current = null;
|
|
3850
3850
|
const mediaElements = [];
|
|
3851
3851
|
for (const slide of parsed.slides) {
|
|
3852
|
-
|
|
3852
|
+
chunkYBTRSG74_js.collectMediaElements(slide.elements, mediaElements);
|
|
3853
3853
|
}
|
|
3854
3854
|
for (const url of mediaDataUrls.values()) {
|
|
3855
3855
|
if (url.startsWith("blob:")) {
|
|
@@ -3890,7 +3890,7 @@ function useLoadContent({
|
|
|
3890
3890
|
}
|
|
3891
3891
|
})
|
|
3892
3892
|
);
|
|
3893
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3893
|
+
const { paths: imagePaths, refs: imageRefs } = chunkYBTRSG74_js.collectImagePaths(parsed.slides);
|
|
3894
3894
|
let nextSlides = parsed.slides;
|
|
3895
3895
|
if (imagePaths.size > 0) {
|
|
3896
3896
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3945,12 +3945,12 @@ function useLoadContent({
|
|
|
3945
3945
|
}
|
|
3946
3946
|
}
|
|
3947
3947
|
handlerRef.current = handler;
|
|
3948
|
-
const partition =
|
|
3948
|
+
const partition = chunkFHTEL3Q6_js.partitionTemplateElements(nextSlides);
|
|
3949
3949
|
setSlides(partition.slides);
|
|
3950
3950
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3951
3951
|
setCanvasSize({
|
|
3952
|
-
width: parsed.width ??
|
|
3953
|
-
height: parsed.height ??
|
|
3952
|
+
width: parsed.width ?? chunkFHTEL3Q6_js.DEFAULT_CANVAS_WIDTH,
|
|
3953
|
+
height: parsed.height ?? chunkFHTEL3Q6_js.DEFAULT_CANVAS_HEIGHT
|
|
3954
3954
|
});
|
|
3955
3955
|
setHeaderFooter(parsed.headerFooter ?? {});
|
|
3956
3956
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
@@ -3979,7 +3979,7 @@ function useLoadContent({
|
|
|
3979
3979
|
setHasMacros(parsed.hasMacros === true);
|
|
3980
3980
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3981
3981
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3982
|
-
setGuides(
|
|
3982
|
+
setGuides(chunkYBTRSG74_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3983
3983
|
setActiveSlideIndex(0);
|
|
3984
3984
|
clearSelection();
|
|
3985
3985
|
setIsDirty(false);
|
|
@@ -3987,7 +3987,7 @@ function useLoadContent({
|
|
|
3987
3987
|
onContentApplied?.();
|
|
3988
3988
|
} catch (err) {
|
|
3989
3989
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3990
|
-
if (err instanceof
|
|
3990
|
+
if (err instanceof chunkYBTRSG74_js.EncryptedFileError) {
|
|
3991
3991
|
setIsEncrypted(true);
|
|
3992
3992
|
} else {
|
|
3993
3993
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -4064,7 +4064,7 @@ function useAutosave(input) {
|
|
|
4064
4064
|
isSavingRef.current = false;
|
|
4065
4065
|
return;
|
|
4066
4066
|
}
|
|
4067
|
-
await
|
|
4067
|
+
await chunkYBTRSG74_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
4068
4068
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4069
4069
|
} catch (err) {
|
|
4070
4070
|
setAutosaveStatus({
|
|
@@ -4129,7 +4129,7 @@ function useElementOperations(input) {
|
|
|
4129
4129
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
4130
4130
|
const updateElementById = react.useCallback(
|
|
4131
4131
|
(elementId, updates) => {
|
|
4132
|
-
if (
|
|
4132
|
+
if (chunkYBTRSG74_js.isTemplateElementId(elementId)) {
|
|
4133
4133
|
const slideId = activeSlide?.id;
|
|
4134
4134
|
if (slideId) {
|
|
4135
4135
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4169,7 +4169,7 @@ function useElementOperations(input) {
|
|
|
4169
4169
|
);
|
|
4170
4170
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4171
4171
|
(updates) => {
|
|
4172
|
-
if (!selectedElement || !
|
|
4172
|
+
if (!selectedElement || !chunkYBTRSG74_js.hasShapeProperties(selectedElement)) {
|
|
4173
4173
|
return;
|
|
4174
4174
|
}
|
|
4175
4175
|
updateSelectedElement({
|
|
@@ -4180,17 +4180,17 @@ function useElementOperations(input) {
|
|
|
4180
4180
|
);
|
|
4181
4181
|
const updateSelectedTextStyle = react.useCallback(
|
|
4182
4182
|
(updates) => {
|
|
4183
|
-
if (!selectedElement || !
|
|
4183
|
+
if (!selectedElement || !chunkYBTRSG74_js.hasTextProperties(selectedElement)) {
|
|
4184
4184
|
return;
|
|
4185
4185
|
}
|
|
4186
|
-
const inlineSel =
|
|
4186
|
+
const inlineSel = chunkYBTRSG74_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4187
4187
|
if (inlineSel && selectedElement.textSegments) {
|
|
4188
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4188
|
+
const { newSegments: newSegments2, newSelection } = chunkYBTRSG74_js.applyStyleToSelectedSegments(
|
|
4189
4189
|
selectedElement.textSegments,
|
|
4190
4190
|
inlineSel,
|
|
4191
4191
|
updates
|
|
4192
4192
|
);
|
|
4193
|
-
|
|
4193
|
+
chunkYBTRSG74_js.setPendingSelectionRestore(newSelection);
|
|
4194
4194
|
updateSelectedElement({
|
|
4195
4195
|
textSegments: newSegments2
|
|
4196
4196
|
});
|
|
@@ -4210,12 +4210,12 @@ function useElementOperations(input) {
|
|
|
4210
4210
|
);
|
|
4211
4211
|
const updateSelectedTextCase = react.useCallback(
|
|
4212
4212
|
(mode) => {
|
|
4213
|
-
if (!selectedElement || !
|
|
4213
|
+
if (!selectedElement || !chunkYBTRSG74_js.hasTextProperties(selectedElement)) {
|
|
4214
4214
|
return;
|
|
4215
4215
|
}
|
|
4216
|
-
const inlineSel =
|
|
4216
|
+
const inlineSel = chunkYBTRSG74_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4217
4217
|
if (inlineSel && selectedElement.textSegments) {
|
|
4218
|
-
const newSegments =
|
|
4218
|
+
const newSegments = chunkYBTRSG74_js.applyCaseTransformToSegments(
|
|
4219
4219
|
selectedElement.textSegments,
|
|
4220
4220
|
inlineSel,
|
|
4221
4221
|
mode
|
|
@@ -4225,14 +4225,14 @@ function useElementOperations(input) {
|
|
|
4225
4225
|
}
|
|
4226
4226
|
const updates = {};
|
|
4227
4227
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4228
|
-
updates.textSegments =
|
|
4228
|
+
updates.textSegments = chunkYBTRSG74_js.applyCaseTransformToSegments(
|
|
4229
4229
|
selectedElement.textSegments,
|
|
4230
4230
|
null,
|
|
4231
4231
|
mode
|
|
4232
4232
|
);
|
|
4233
4233
|
}
|
|
4234
4234
|
if (typeof selectedElement.text === "string") {
|
|
4235
|
-
updates.text =
|
|
4235
|
+
updates.text = chunkYBTRSG74_js.transformTextCase(selectedElement.text, mode);
|
|
4236
4236
|
}
|
|
4237
4237
|
updateSelectedElement(updates);
|
|
4238
4238
|
},
|
|
@@ -4287,7 +4287,7 @@ function useSectionOperations(input) {
|
|
|
4287
4287
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4288
4288
|
const addSection2 = react.useCallback(
|
|
4289
4289
|
(name, afterSlideIndex) => {
|
|
4290
|
-
const result =
|
|
4290
|
+
const result = chunkYBTRSG74_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4291
4291
|
setSlides(result.slides);
|
|
4292
4292
|
setSections(result.sections);
|
|
4293
4293
|
markDirty();
|
|
@@ -4296,7 +4296,7 @@ function useSectionOperations(input) {
|
|
|
4296
4296
|
);
|
|
4297
4297
|
const renameSection2 = react.useCallback(
|
|
4298
4298
|
(sectionId, newName) => {
|
|
4299
|
-
const result =
|
|
4299
|
+
const result = chunkYBTRSG74_js.renameSection(sections, slides, sectionId, newName);
|
|
4300
4300
|
setSections(result.sections);
|
|
4301
4301
|
setSlides(result.slides);
|
|
4302
4302
|
markDirty();
|
|
@@ -4305,7 +4305,7 @@ function useSectionOperations(input) {
|
|
|
4305
4305
|
);
|
|
4306
4306
|
const deleteSection2 = react.useCallback(
|
|
4307
4307
|
(sectionId) => {
|
|
4308
|
-
const result =
|
|
4308
|
+
const result = chunkYBTRSG74_js.deleteSection(sections, slides, sectionId);
|
|
4309
4309
|
setSections(result.sections);
|
|
4310
4310
|
setSlides(result.slides);
|
|
4311
4311
|
markDirty();
|
|
@@ -4314,21 +4314,21 @@ function useSectionOperations(input) {
|
|
|
4314
4314
|
);
|
|
4315
4315
|
const moveSectionUp2 = react.useCallback(
|
|
4316
4316
|
(sectionId) => {
|
|
4317
|
-
setSections(
|
|
4317
|
+
setSections(chunkYBTRSG74_js.moveSectionUp(sections, sectionId));
|
|
4318
4318
|
markDirty();
|
|
4319
4319
|
},
|
|
4320
4320
|
[sections, setSections, markDirty]
|
|
4321
4321
|
);
|
|
4322
4322
|
const moveSectionDown2 = react.useCallback(
|
|
4323
4323
|
(sectionId) => {
|
|
4324
|
-
setSections(
|
|
4324
|
+
setSections(chunkYBTRSG74_js.moveSectionDown(sections, sectionId));
|
|
4325
4325
|
markDirty();
|
|
4326
4326
|
},
|
|
4327
4327
|
[sections, setSections, markDirty]
|
|
4328
4328
|
);
|
|
4329
4329
|
const moveSlidesToSection2 = react.useCallback(
|
|
4330
4330
|
(slideIndexes, targetSectionId) => {
|
|
4331
|
-
const result =
|
|
4331
|
+
const result = chunkYBTRSG74_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4332
4332
|
setSlides(result.slides);
|
|
4333
4333
|
setSections(result.sections);
|
|
4334
4334
|
markDirty();
|
|
@@ -4347,19 +4347,19 @@ function useSectionOperations(input) {
|
|
|
4347
4347
|
|
|
4348
4348
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4349
4349
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4350
|
-
const resized =
|
|
4350
|
+
const resized = chunkYBTRSG74_js.applyResize(
|
|
4351
4351
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4352
4352
|
handle,
|
|
4353
4353
|
dx,
|
|
4354
4354
|
dy,
|
|
4355
4355
|
1,
|
|
4356
|
-
{ minSize:
|
|
4356
|
+
{ minSize: chunkFHTEL3Q6_js.MIN_ELEMENT_SIZE }
|
|
4357
4357
|
);
|
|
4358
4358
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4359
4359
|
if (!snapToGrid) {
|
|
4360
4360
|
return box;
|
|
4361
4361
|
}
|
|
4362
|
-
return
|
|
4362
|
+
return chunkYBTRSG74_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkFHTEL3Q6_js.MIN_ELEMENT_SIZE);
|
|
4363
4363
|
}
|
|
4364
4364
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
4365
4365
|
const range = startWidth || 200;
|
|
@@ -4477,7 +4477,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4477
4477
|
width: el.width,
|
|
4478
4478
|
height: el.height
|
|
4479
4479
|
}));
|
|
4480
|
-
const snapResult =
|
|
4480
|
+
const snapResult = chunkYBTRSG74_js.computeSnapToShape(
|
|
4481
4481
|
targetX,
|
|
4482
4482
|
targetY,
|
|
4483
4483
|
primaryEl.width,
|
|
@@ -4516,7 +4516,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4516
4516
|
if (live) {
|
|
4517
4517
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4518
4518
|
const start = drag.startPositionsById[id];
|
|
4519
|
-
|
|
4519
|
+
chunkYBTRSG74_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4520
4520
|
x: start.x + appliedDx,
|
|
4521
4521
|
y: start.y + appliedDy
|
|
4522
4522
|
});
|
|
@@ -4550,15 +4550,15 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4550
4550
|
if (rs.domEl) {
|
|
4551
4551
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4552
4552
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4553
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4554
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4553
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunkFHTEL3Q6_js.MIN_ELEMENT_SIZE)}px`;
|
|
4554
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunkFHTEL3Q6_js.MIN_ELEMENT_SIZE)}px`;
|
|
4555
4555
|
}
|
|
4556
4556
|
if (live) {
|
|
4557
|
-
|
|
4557
|
+
chunkYBTRSG74_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4558
4558
|
x: geo.x,
|
|
4559
4559
|
y: geo.y,
|
|
4560
|
-
width: Math.max(geo.width,
|
|
4561
|
-
height: Math.max(geo.height,
|
|
4560
|
+
width: Math.max(geo.width, chunkFHTEL3Q6_js.MIN_ELEMENT_SIZE),
|
|
4561
|
+
height: Math.max(geo.height, chunkFHTEL3Q6_js.MIN_ELEMENT_SIZE)
|
|
4562
4562
|
});
|
|
4563
4563
|
}
|
|
4564
4564
|
}
|
|
@@ -4638,13 +4638,13 @@ function processPointerUp(input) {
|
|
|
4638
4638
|
if (i !== activeSlideIndex) {
|
|
4639
4639
|
return s;
|
|
4640
4640
|
}
|
|
4641
|
-
const rerouted =
|
|
4641
|
+
const rerouted = chunkYBTRSG74_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4642
4642
|
if (rerouted.length === 0) {
|
|
4643
4643
|
return s;
|
|
4644
4644
|
}
|
|
4645
4645
|
return {
|
|
4646
4646
|
...s,
|
|
4647
|
-
elements:
|
|
4647
|
+
elements: chunkYBTRSG74_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4648
4648
|
};
|
|
4649
4649
|
})
|
|
4650
4650
|
);
|
|
@@ -4666,9 +4666,9 @@ function processPointerUp(input) {
|
|
|
4666
4666
|
}
|
|
4667
4667
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4668
4668
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4669
|
-
const hitIds =
|
|
4669
|
+
const hitIds = chunkYBTRSG74_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4670
4670
|
if (marquee.additive) {
|
|
4671
|
-
const merged =
|
|
4671
|
+
const merged = chunkYBTRSG74_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4672
4672
|
if (merged.length > 0) {
|
|
4673
4673
|
applySelection(merged[0], merged);
|
|
4674
4674
|
} else {
|
|
@@ -4691,8 +4691,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4691
4691
|
}
|
|
4692
4692
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4693
4693
|
});
|
|
4694
|
-
const rerouted =
|
|
4695
|
-
return
|
|
4694
|
+
const rerouted = chunkYBTRSG74_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4695
|
+
return chunkYBTRSG74_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4696
4696
|
};
|
|
4697
4697
|
if (editTemplateMode) {
|
|
4698
4698
|
const slideId = activeSlide?.id;
|
|
@@ -4848,9 +4848,9 @@ function useCanvasInteractions(input) {
|
|
|
4848
4848
|
return;
|
|
4849
4849
|
}
|
|
4850
4850
|
const el = elementLookup.get(editId);
|
|
4851
|
-
if (el &&
|
|
4851
|
+
if (el && chunkYBTRSG74_js.hasTextProperties(el)) {
|
|
4852
4852
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4853
|
-
const newSegments =
|
|
4853
|
+
const newSegments = chunkYBTRSG74_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4854
4854
|
ops.updateElementById(editId, {
|
|
4855
4855
|
text: committedText,
|
|
4856
4856
|
textSegments: newSegments
|
|
@@ -4861,7 +4861,7 @@ function useCanvasInteractions(input) {
|
|
|
4861
4861
|
setInlineEditingText("");
|
|
4862
4862
|
};
|
|
4863
4863
|
const openEquationEditorForElement = (el) => {
|
|
4864
|
-
if (!
|
|
4864
|
+
if (!chunkYBTRSG74_js.hasTextProperties(el)) {
|
|
4865
4865
|
return false;
|
|
4866
4866
|
}
|
|
4867
4867
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4890,7 +4890,7 @@ function useCanvasInteractions(input) {
|
|
|
4890
4890
|
justSelectedRef.current = false;
|
|
4891
4891
|
} else {
|
|
4892
4892
|
const el = elementLookup.get(elementId);
|
|
4893
|
-
if (el &&
|
|
4893
|
+
if (el && chunkYBTRSG74_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
4894
4894
|
if (!openEquationEditorForElement(el)) {
|
|
4895
4895
|
setInlineEditingElementId(elementId);
|
|
4896
4896
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4909,7 +4909,7 @@ function useCanvasInteractions(input) {
|
|
|
4909
4909
|
if (openEquationEditorForElement(el)) {
|
|
4910
4910
|
return;
|
|
4911
4911
|
}
|
|
4912
|
-
if (
|
|
4912
|
+
if (chunkYBTRSG74_js.hasTextProperties(el)) {
|
|
4913
4913
|
setInlineEditingElementId(elementId);
|
|
4914
4914
|
setInlineEditingText(el.text ?? "");
|
|
4915
4915
|
}
|
|
@@ -5102,7 +5102,7 @@ function createFileHandlers(deps) {
|
|
|
5102
5102
|
h = Math.round(h * scale);
|
|
5103
5103
|
}
|
|
5104
5104
|
addElement({
|
|
5105
|
-
id:
|
|
5105
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5106
5106
|
type: "image",
|
|
5107
5107
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5108
5108
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5113,7 +5113,7 @@ function createFileHandlers(deps) {
|
|
|
5113
5113
|
};
|
|
5114
5114
|
img.onerror = () => {
|
|
5115
5115
|
addElement({
|
|
5116
|
-
id:
|
|
5116
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5117
5117
|
type: "image",
|
|
5118
5118
|
x: 100,
|
|
5119
5119
|
y: 100,
|
|
@@ -5139,7 +5139,7 @@ function createFileHandlers(deps) {
|
|
|
5139
5139
|
const elFilePath = file.path;
|
|
5140
5140
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5141
5141
|
addElement({
|
|
5142
|
-
id:
|
|
5142
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5143
5143
|
type: "media",
|
|
5144
5144
|
mediaType,
|
|
5145
5145
|
mediaMimeType: file.type || void 0,
|
|
@@ -5314,13 +5314,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5314
5314
|
return;
|
|
5315
5315
|
}
|
|
5316
5316
|
addElement({
|
|
5317
|
-
id:
|
|
5317
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5318
5318
|
type: "smartArt",
|
|
5319
5319
|
x: 100,
|
|
5320
5320
|
y: 120,
|
|
5321
5321
|
width: 600,
|
|
5322
5322
|
height: 340,
|
|
5323
|
-
smartArtData:
|
|
5323
|
+
smartArtData: chunkYBTRSG74_js.buildSmartArtPresetData(
|
|
5324
5324
|
layout,
|
|
5325
5325
|
defaultItems,
|
|
5326
5326
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5332,7 +5332,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5332
5332
|
return;
|
|
5333
5333
|
}
|
|
5334
5334
|
addElement({
|
|
5335
|
-
id:
|
|
5335
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5336
5336
|
type: "shape",
|
|
5337
5337
|
x: 120,
|
|
5338
5338
|
y: 200,
|
|
@@ -5391,7 +5391,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5391
5391
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5392
5392
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5393
5393
|
addElement({
|
|
5394
|
-
id:
|
|
5394
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5395
5395
|
type: "shape",
|
|
5396
5396
|
x: 120,
|
|
5397
5397
|
y: 200,
|
|
@@ -5413,11 +5413,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5413
5413
|
if (!activeSlide) {
|
|
5414
5414
|
return;
|
|
5415
5415
|
}
|
|
5416
|
-
const preset =
|
|
5416
|
+
const preset = chunkYBTRSG74_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5417
5417
|
if (!preset) {
|
|
5418
5418
|
return;
|
|
5419
5419
|
}
|
|
5420
|
-
const defaultPptxAction =
|
|
5420
|
+
const defaultPptxAction = chunkYBTRSG74_js.elementActionToPptxAction({
|
|
5421
5421
|
trigger: "click",
|
|
5422
5422
|
type: preset.defaultAction
|
|
5423
5423
|
});
|
|
@@ -5426,7 +5426,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5426
5426
|
defaultPptxAction.highlightClick = true;
|
|
5427
5427
|
}
|
|
5428
5428
|
addElement({
|
|
5429
|
-
id:
|
|
5429
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5430
5430
|
type: "shape",
|
|
5431
5431
|
x: 150,
|
|
5432
5432
|
y: 150,
|
|
@@ -5493,14 +5493,14 @@ function useInsertElements(input) {
|
|
|
5493
5493
|
return;
|
|
5494
5494
|
}
|
|
5495
5495
|
addElement({
|
|
5496
|
-
id:
|
|
5496
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5497
5497
|
type: "text",
|
|
5498
5498
|
x: 100,
|
|
5499
5499
|
y: 100,
|
|
5500
5500
|
width: 300,
|
|
5501
5501
|
height: 60,
|
|
5502
5502
|
text: "",
|
|
5503
|
-
textStyle: { fontSize:
|
|
5503
|
+
textStyle: { fontSize: chunkFHTEL3Q6_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5504
5504
|
});
|
|
5505
5505
|
};
|
|
5506
5506
|
const handleAddShape = () => {
|
|
@@ -5508,7 +5508,7 @@ function useInsertElements(input) {
|
|
|
5508
5508
|
return;
|
|
5509
5509
|
}
|
|
5510
5510
|
addElement({
|
|
5511
|
-
id:
|
|
5511
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5512
5512
|
type: "shape",
|
|
5513
5513
|
x: 150,
|
|
5514
5514
|
y: 150,
|
|
@@ -5527,15 +5527,15 @@ function useInsertElements(input) {
|
|
|
5527
5527
|
return;
|
|
5528
5528
|
}
|
|
5529
5529
|
addElement({
|
|
5530
|
-
...
|
|
5531
|
-
id:
|
|
5530
|
+
...chunkYBTRSG74_js.newTableElement(chunkFHTEL3Q6_js.DEFAULT_TABLE_ROWS, chunkFHTEL3Q6_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5531
|
+
id: chunkYBTRSG74_js.generateElementId()
|
|
5532
5532
|
});
|
|
5533
5533
|
};
|
|
5534
5534
|
const handleAddChart = (chartKind) => {
|
|
5535
5535
|
if (!activeSlide) {
|
|
5536
5536
|
return;
|
|
5537
5537
|
}
|
|
5538
|
-
addElement(
|
|
5538
|
+
addElement(chunkYBTRSG74_js.createDefaultChartElement(chartKind));
|
|
5539
5539
|
};
|
|
5540
5540
|
const structured = createStructuredElementHandlers({
|
|
5541
5541
|
activeSlide,
|
|
@@ -5605,7 +5605,7 @@ function useClipboardHandlers(input) {
|
|
|
5605
5605
|
if (!selectedElement) {
|
|
5606
5606
|
return;
|
|
5607
5607
|
}
|
|
5608
|
-
setClipboardPayload(
|
|
5608
|
+
setClipboardPayload(chunkYBTRSG74_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5609
5609
|
};
|
|
5610
5610
|
const handleDelete = () => {
|
|
5611
5611
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5622,7 +5622,7 @@ function useClipboardHandlers(input) {
|
|
|
5622
5622
|
handleDelete();
|
|
5623
5623
|
};
|
|
5624
5624
|
const insertClone = (source) => {
|
|
5625
|
-
const clone =
|
|
5625
|
+
const clone = chunkYBTRSG74_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5626
5626
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5627
5627
|
ops.applySelection(clone.id);
|
|
5628
5628
|
history.markDirty();
|
|
@@ -5657,7 +5657,7 @@ function resolveShapePath(el) {
|
|
|
5657
5657
|
return el.pathData;
|
|
5658
5658
|
}
|
|
5659
5659
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5660
|
-
const clipPath =
|
|
5660
|
+
const clipPath = chunkYBTRSG74_js.getPresetShapeClipPath(el.shapeType);
|
|
5661
5661
|
if (clipPath) {
|
|
5662
5662
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5663
5663
|
if (svgPath) {
|
|
@@ -5708,7 +5708,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5708
5708
|
return parts.join(" ");
|
|
5709
5709
|
}
|
|
5710
5710
|
function transformPathToGlobal(pathData, el) {
|
|
5711
|
-
const polys =
|
|
5711
|
+
const polys = chunkYBTRSG74_js.svgPathToPolygons(pathData);
|
|
5712
5712
|
if (polys.length === 0) {
|
|
5713
5713
|
return pathData;
|
|
5714
5714
|
}
|
|
@@ -5728,10 +5728,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5728
5728
|
y: pt.y * scaleY + el.y
|
|
5729
5729
|
}))
|
|
5730
5730
|
);
|
|
5731
|
-
return
|
|
5731
|
+
return chunkYBTRSG74_js.polygonsToSvgPath(transformed);
|
|
5732
5732
|
}
|
|
5733
5733
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5734
|
-
const polys =
|
|
5734
|
+
const polys = chunkYBTRSG74_js.svgPathToPolygons(pathData);
|
|
5735
5735
|
if (polys.length === 0) {
|
|
5736
5736
|
return pathData;
|
|
5737
5737
|
}
|
|
@@ -5741,10 +5741,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5741
5741
|
y: pt.y - y
|
|
5742
5742
|
}))
|
|
5743
5743
|
);
|
|
5744
|
-
return
|
|
5744
|
+
return chunkYBTRSG74_js.polygonsToSvgPath(transformed);
|
|
5745
5745
|
}
|
|
5746
5746
|
function pathBounds(pathData) {
|
|
5747
|
-
const polys =
|
|
5747
|
+
const polys = chunkYBTRSG74_js.svgPathToPolygons(pathData);
|
|
5748
5748
|
let minX = Infinity;
|
|
5749
5749
|
let minY = Infinity;
|
|
5750
5750
|
let maxX = -Infinity;
|
|
@@ -5803,7 +5803,7 @@ function useMergeShapesHandler(input) {
|
|
|
5803
5803
|
let allFragments = [];
|
|
5804
5804
|
let remaining = globalPaths[0];
|
|
5805
5805
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5806
|
-
const frags =
|
|
5806
|
+
const frags = chunkYBTRSG74_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5807
5807
|
if (Array.isArray(frags)) {
|
|
5808
5808
|
allFragments = frags;
|
|
5809
5809
|
}
|
|
@@ -5832,7 +5832,7 @@ function useMergeShapesHandler(input) {
|
|
|
5832
5832
|
bounds.height
|
|
5833
5833
|
);
|
|
5834
5834
|
const newEl = {
|
|
5835
|
-
id:
|
|
5835
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5836
5836
|
type: "shape",
|
|
5837
5837
|
x: bounds.x,
|
|
5838
5838
|
y: bounds.y,
|
|
@@ -5870,7 +5870,7 @@ function useMergeShapesHandler(input) {
|
|
|
5870
5870
|
} else {
|
|
5871
5871
|
let resultPath = globalPaths[0];
|
|
5872
5872
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5873
|
-
const result =
|
|
5873
|
+
const result = chunkYBTRSG74_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5874
5874
|
if (typeof result === "string") {
|
|
5875
5875
|
resultPath = result;
|
|
5876
5876
|
}
|
|
@@ -5891,7 +5891,7 @@ function useMergeShapesHandler(input) {
|
|
|
5891
5891
|
);
|
|
5892
5892
|
const primary = targets[0];
|
|
5893
5893
|
const newEl = {
|
|
5894
|
-
id:
|
|
5894
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5895
5895
|
type: "shape",
|
|
5896
5896
|
x: bounds.x,
|
|
5897
5897
|
y: bounds.y,
|
|
@@ -5954,7 +5954,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5954
5954
|
if (ids.length < 2 || !activeSlide) {
|
|
5955
5955
|
return;
|
|
5956
5956
|
}
|
|
5957
|
-
const { elements, groupId } =
|
|
5957
|
+
const { elements, groupId } = chunkYBTRSG74_js.groupElements(ops.activeElements, ids, chunkYBTRSG74_js.generateElementId());
|
|
5958
5958
|
if (groupId === null) {
|
|
5959
5959
|
return;
|
|
5960
5960
|
}
|
|
@@ -5967,12 +5967,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5967
5967
|
return;
|
|
5968
5968
|
}
|
|
5969
5969
|
const group = selectedElement;
|
|
5970
|
-
const intoTemplate =
|
|
5970
|
+
const intoTemplate = chunkYBTRSG74_js.isTemplateElementId(group.id);
|
|
5971
5971
|
const ungrouped = group.children.map((child) => ({
|
|
5972
5972
|
...structuredClone(child),
|
|
5973
5973
|
// Keep child ids in the same store as the group so later edits route
|
|
5974
5974
|
// correctly: template groups yield template-prefixed child ids.
|
|
5975
|
-
id: intoTemplate ?
|
|
5975
|
+
id: intoTemplate ? chunkYBTRSG74_js.makeCloneId(true, child.id || group.id) : child.id || chunkYBTRSG74_js.generateElementId(),
|
|
5976
5976
|
x: child.x + group.x,
|
|
5977
5977
|
y: child.y + group.y
|
|
5978
5978
|
}));
|
|
@@ -5996,7 +5996,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5996
5996
|
if (!edge) {
|
|
5997
5997
|
return;
|
|
5998
5998
|
}
|
|
5999
|
-
const positions =
|
|
5999
|
+
const positions = chunkYBTRSG74_js.alignElements(selectedElements, edge);
|
|
6000
6000
|
for (const [id, pos] of positions) {
|
|
6001
6001
|
const el = elementLookup.get(id);
|
|
6002
6002
|
if (!el) {
|
|
@@ -6014,7 +6014,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6014
6014
|
if (!distAxis) {
|
|
6015
6015
|
return;
|
|
6016
6016
|
}
|
|
6017
|
-
const positions =
|
|
6017
|
+
const positions = chunkYBTRSG74_js.distributeElements(selectedElements, distAxis);
|
|
6018
6018
|
for (const [id, pos] of positions) {
|
|
6019
6019
|
const el = elementLookup.get(id);
|
|
6020
6020
|
if (!el) {
|
|
@@ -6031,7 +6031,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6031
6031
|
}
|
|
6032
6032
|
const id = selectedElement.id;
|
|
6033
6033
|
ops.updateActiveElements(
|
|
6034
|
-
(els) => direction === "forward" ?
|
|
6034
|
+
(els) => direction === "forward" ? chunkYBTRSG74_js.bringForward(els, id) : direction === "backward" ? chunkYBTRSG74_js.sendBackward(els, id) : els
|
|
6035
6035
|
);
|
|
6036
6036
|
history.markDirty();
|
|
6037
6037
|
};
|
|
@@ -6041,7 +6041,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6041
6041
|
}
|
|
6042
6042
|
const id = selectedElement.id;
|
|
6043
6043
|
ops.updateActiveElements(
|
|
6044
|
-
(els) => direction === "front" ?
|
|
6044
|
+
(els) => direction === "front" ? chunkYBTRSG74_js.bringToFront(els, id) : chunkYBTRSG74_js.sendToBack(els, id)
|
|
6045
6045
|
);
|
|
6046
6046
|
history.markDirty();
|
|
6047
6047
|
};
|
|
@@ -6172,7 +6172,7 @@ function useSlideManagement(input) {
|
|
|
6172
6172
|
theme
|
|
6173
6173
|
} = input;
|
|
6174
6174
|
const handleAddSlide = () => {
|
|
6175
|
-
const newSlide =
|
|
6175
|
+
const newSlide = chunkYBTRSG74_js.createBlankSlide(slides.length + 1);
|
|
6176
6176
|
ops.updateSlides((prev) => {
|
|
6177
6177
|
const next = [...prev];
|
|
6178
6178
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6235,7 +6235,7 @@ function useSlideManagement(input) {
|
|
|
6235
6235
|
}
|
|
6236
6236
|
const clone = {
|
|
6237
6237
|
...src,
|
|
6238
|
-
id:
|
|
6238
|
+
id: chunkYBTRSG74_js.makeSlideId(),
|
|
6239
6239
|
elements: src.elements.map((el) => ({
|
|
6240
6240
|
...el,
|
|
6241
6241
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6267,7 +6267,7 @@ function useSlideManagement(input) {
|
|
|
6267
6267
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6268
6268
|
const insertAt = activeSlideIndex + 1;
|
|
6269
6269
|
const draft = {
|
|
6270
|
-
...
|
|
6270
|
+
...chunkYBTRSG74_js.createBlankSlide(slides.length + 1),
|
|
6271
6271
|
layoutPath,
|
|
6272
6272
|
...layoutName ? { layoutName } : {}
|
|
6273
6273
|
};
|
|
@@ -6300,9 +6300,9 @@ function useSlideManagement(input) {
|
|
|
6300
6300
|
};
|
|
6301
6301
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6302
6302
|
const insertAt = activeSlideIndex + 1;
|
|
6303
|
-
const draft =
|
|
6303
|
+
const draft = chunkYBTRSG74_js.buildSlideTemplateSlide(templateId, chunkYBTRSG74_js.makeSlideId(), slides.length + 1, {
|
|
6304
6304
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6305
|
-
scheme:
|
|
6305
|
+
scheme: chunkYBTRSG74_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6306
6306
|
});
|
|
6307
6307
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6308
6308
|
setActiveSlideIndex(insertAt);
|
|
@@ -6339,7 +6339,7 @@ function createTableMergeHandlers(input) {
|
|
|
6339
6339
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6340
6340
|
return;
|
|
6341
6341
|
}
|
|
6342
|
-
const newTableData =
|
|
6342
|
+
const newTableData = chunkYBTRSG74_js.mergeCells(
|
|
6343
6343
|
[
|
|
6344
6344
|
{ row: rowIndex, col: columnIndex },
|
|
6345
6345
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6347,7 +6347,7 @@ function createTableMergeHandlers(input) {
|
|
|
6347
6347
|
td
|
|
6348
6348
|
);
|
|
6349
6349
|
const updates = { tableData: newTableData };
|
|
6350
|
-
const newRawXml =
|
|
6350
|
+
const newRawXml = chunkYBTRSG74_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6351
6351
|
if (newRawXml) {
|
|
6352
6352
|
updates.rawXml = newRawXml;
|
|
6353
6353
|
}
|
|
@@ -6373,7 +6373,7 @@ function createTableMergeHandlers(input) {
|
|
|
6373
6373
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6374
6374
|
return;
|
|
6375
6375
|
}
|
|
6376
|
-
const newTableData =
|
|
6376
|
+
const newTableData = chunkYBTRSG74_js.mergeCells(
|
|
6377
6377
|
[
|
|
6378
6378
|
{ row: rowIndex, col: columnIndex },
|
|
6379
6379
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6381,7 +6381,7 @@ function createTableMergeHandlers(input) {
|
|
|
6381
6381
|
td
|
|
6382
6382
|
);
|
|
6383
6383
|
const updates = { tableData: newTableData };
|
|
6384
|
-
const newRawXml =
|
|
6384
|
+
const newRawXml = chunkYBTRSG74_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6385
6385
|
if (newRawXml) {
|
|
6386
6386
|
updates.rawXml = newRawXml;
|
|
6387
6387
|
}
|
|
@@ -6396,9 +6396,9 @@ function createTableMergeHandlers(input) {
|
|
|
6396
6396
|
return;
|
|
6397
6397
|
}
|
|
6398
6398
|
const td = selectedElement.tableData;
|
|
6399
|
-
const newTableData =
|
|
6399
|
+
const newTableData = chunkYBTRSG74_js.mergeCells(ts.selectedCells, td);
|
|
6400
6400
|
const updates = { tableData: newTableData };
|
|
6401
|
-
const newRawXml =
|
|
6401
|
+
const newRawXml = chunkYBTRSG74_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6402
6402
|
if (newRawXml) {
|
|
6403
6403
|
updates.rawXml = newRawXml;
|
|
6404
6404
|
}
|
|
@@ -6415,9 +6415,9 @@ function createTableMergeHandlers(input) {
|
|
|
6415
6415
|
}
|
|
6416
6416
|
const { rowIndex, columnIndex } = ts;
|
|
6417
6417
|
const td = selectedElement.tableData;
|
|
6418
|
-
const newTableData =
|
|
6418
|
+
const newTableData = chunkYBTRSG74_js.splitCell(rowIndex, columnIndex, td);
|
|
6419
6419
|
const updates = { tableData: newTableData };
|
|
6420
|
-
const newRawXml =
|
|
6420
|
+
const newRawXml = chunkYBTRSG74_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6421
6421
|
if (newRawXml) {
|
|
6422
6422
|
updates.rawXml = newRawXml;
|
|
6423
6423
|
}
|
|
@@ -6461,7 +6461,7 @@ function createTableStructHandlers(input) {
|
|
|
6461
6461
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
6462
6462
|
}
|
|
6463
6463
|
if (el.rawXml) {
|
|
6464
|
-
const newRawXml =
|
|
6464
|
+
const newRawXml = chunkYBTRSG74_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6465
6465
|
if (newRawXml) {
|
|
6466
6466
|
updates.rawXml = newRawXml;
|
|
6467
6467
|
}
|
|
@@ -6485,7 +6485,7 @@ function createTableStructHandlers(input) {
|
|
|
6485
6485
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6486
6486
|
const updates = {};
|
|
6487
6487
|
if (selectedElement.rawXml) {
|
|
6488
|
-
const newRawXml =
|
|
6488
|
+
const newRawXml = chunkYBTRSG74_js.updateCellTextStyleInRawXml(
|
|
6489
6489
|
selectedElement,
|
|
6490
6490
|
rowIndex,
|
|
6491
6491
|
colIndex,
|
|
@@ -6549,9 +6549,9 @@ function createTableStructHandlers(input) {
|
|
|
6549
6549
|
return;
|
|
6550
6550
|
}
|
|
6551
6551
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6552
|
-
const newTableData =
|
|
6552
|
+
const newTableData = chunkYBTRSG74_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6553
6553
|
const updates = { tableData: newTableData };
|
|
6554
|
-
const newRawXml =
|
|
6554
|
+
const newRawXml = chunkYBTRSG74_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6555
6555
|
if (newRawXml) {
|
|
6556
6556
|
updates.rawXml = newRawXml;
|
|
6557
6557
|
}
|
|
@@ -6564,12 +6564,12 @@ function createTableStructHandlers(input) {
|
|
|
6564
6564
|
}
|
|
6565
6565
|
const td = selectedElement.tableData;
|
|
6566
6566
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6567
|
-
const newTableData =
|
|
6567
|
+
const newTableData = chunkYBTRSG74_js.deleteTableRow(td, rowIdx);
|
|
6568
6568
|
if (newTableData === td) {
|
|
6569
6569
|
return;
|
|
6570
6570
|
}
|
|
6571
6571
|
const updates = { tableData: newTableData };
|
|
6572
|
-
const newRawXml =
|
|
6572
|
+
const newRawXml = chunkYBTRSG74_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6573
6573
|
if (newRawXml) {
|
|
6574
6574
|
updates.rawXml = newRawXml;
|
|
6575
6575
|
}
|
|
@@ -6581,9 +6581,9 @@ function createTableStructHandlers(input) {
|
|
|
6581
6581
|
return;
|
|
6582
6582
|
}
|
|
6583
6583
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6584
|
-
const newTableData =
|
|
6584
|
+
const newTableData = chunkYBTRSG74_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6585
6585
|
const updates = { tableData: newTableData };
|
|
6586
|
-
const newRawXml =
|
|
6586
|
+
const newRawXml = chunkYBTRSG74_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6587
6587
|
if (newRawXml) {
|
|
6588
6588
|
updates.rawXml = newRawXml;
|
|
6589
6589
|
}
|
|
@@ -6596,12 +6596,12 @@ function createTableStructHandlers(input) {
|
|
|
6596
6596
|
}
|
|
6597
6597
|
const td = selectedElement.tableData;
|
|
6598
6598
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6599
|
-
const newTableData =
|
|
6599
|
+
const newTableData = chunkYBTRSG74_js.deleteTableColumn(td, colIdx);
|
|
6600
6600
|
if (newTableData === td) {
|
|
6601
6601
|
return;
|
|
6602
6602
|
}
|
|
6603
6603
|
const updates = { tableData: newTableData };
|
|
6604
|
-
const newRawXml =
|
|
6604
|
+
const newRawXml = chunkYBTRSG74_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6605
6605
|
if (newRawXml) {
|
|
6606
6606
|
updates.rawXml = newRawXml;
|
|
6607
6607
|
}
|
|
@@ -6637,8 +6637,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6637
6637
|
return html2canvasPro(element, {
|
|
6638
6638
|
...options,
|
|
6639
6639
|
onclone: async (doc, clonedEl) => {
|
|
6640
|
-
await
|
|
6641
|
-
|
|
6640
|
+
await chunkYBTRSG74_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6641
|
+
chunkYBTRSG74_js.preprocessCssForCapture(clonedEl);
|
|
6642
6642
|
if (typeof userOnClone === "function") {
|
|
6643
6643
|
userOnClone(doc, clonedEl);
|
|
6644
6644
|
}
|
|
@@ -6694,7 +6694,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6694
6694
|
}
|
|
6695
6695
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6696
6696
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6697
|
-
|
|
6697
|
+
chunkYBTRSG74_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6698
6698
|
}
|
|
6699
6699
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6700
6700
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6716,15 +6716,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6716
6716
|
continue;
|
|
6717
6717
|
}
|
|
6718
6718
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6719
|
-
images.push(
|
|
6719
|
+
images.push(chunkYBTRSG74_js.canvasToJpegData(canvas));
|
|
6720
6720
|
}
|
|
6721
6721
|
onProgress?.(totalSlides, totalSlides);
|
|
6722
6722
|
setActiveSlide(currentSlideIndex);
|
|
6723
6723
|
if (images.length === 0) {
|
|
6724
6724
|
throw new Error(chunk3ISYPBSX_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6725
6725
|
}
|
|
6726
|
-
const pdfBlobUrl =
|
|
6727
|
-
|
|
6726
|
+
const pdfBlobUrl = chunkFHTEL3Q6_js.buildPdfFromImageData(images);
|
|
6727
|
+
chunkYBTRSG74_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6728
6728
|
}
|
|
6729
6729
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6730
6730
|
const { scale = 2, onProgress } = options;
|
|
@@ -6772,8 +6772,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6772
6772
|
if (pages.length === 0) {
|
|
6773
6773
|
throw new Error(chunk3ISYPBSX_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6774
6774
|
}
|
|
6775
|
-
const pdfDataUrl =
|
|
6776
|
-
|
|
6775
|
+
const pdfDataUrl = chunkFHTEL3Q6_js.buildNotesPdf(pages);
|
|
6776
|
+
chunkYBTRSG74_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6777
6777
|
}
|
|
6778
6778
|
|
|
6779
6779
|
// src/viewer/utils/export-video.ts
|
|
@@ -6817,7 +6817,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6817
6817
|
const fps = 30;
|
|
6818
6818
|
const stream = recordingCanvas.captureStream(fps);
|
|
6819
6819
|
const recorder = new MediaRecorder(stream, {
|
|
6820
|
-
mimeType:
|
|
6820
|
+
mimeType: chunkYBTRSG74_js.pickSupportedMimeType([...chunkYBTRSG74_js.WEBM_MIME_CANDIDATES]),
|
|
6821
6821
|
videoBitsPerSecond: 5e6
|
|
6822
6822
|
});
|
|
6823
6823
|
const chunks = [];
|
|
@@ -6840,8 +6840,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6840
6840
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6841
6841
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6842
6842
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6843
|
-
const frameInterval =
|
|
6844
|
-
const framesNeeded =
|
|
6843
|
+
const frameInterval = chunkYBTRSG74_js.fpsToFrameIntervalMs(fps);
|
|
6844
|
+
const framesNeeded = chunkYBTRSG74_js.segmentFrameCount(duration, fps);
|
|
6845
6845
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6846
6846
|
if (signal?.aborted) {
|
|
6847
6847
|
recorder.stop();
|
|
@@ -6890,7 +6890,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6890
6890
|
if (frames.length === 0) {
|
|
6891
6891
|
throw new Error(chunk3ISYPBSX_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6892
6892
|
}
|
|
6893
|
-
const gifBytes =
|
|
6893
|
+
const gifBytes = chunkYBTRSG74_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6894
6894
|
onProgress?.(totalSlides, totalSlides);
|
|
6895
6895
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6896
6896
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6944,7 +6944,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6944
6944
|
continue;
|
|
6945
6945
|
}
|
|
6946
6946
|
onProgress?.(processedCount, data.slides.length);
|
|
6947
|
-
let svg =
|
|
6947
|
+
let svg = chunkYBTRSG74_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6948
6948
|
if (embedFonts && fontFaces?.length) {
|
|
6949
6949
|
svg = injectFontFaces(svg, fontFaces);
|
|
6950
6950
|
}
|
|
@@ -7006,7 +7006,7 @@ function useExportSaveAs(input) {
|
|
|
7006
7006
|
}
|
|
7007
7007
|
setExportProgress(70);
|
|
7008
7008
|
setExportStatusMessage("Writing README...");
|
|
7009
|
-
const readme =
|
|
7009
|
+
const readme = chunkYBTRSG74_js.generatePackageReadme(pptxFilename);
|
|
7010
7010
|
pkgFolder.file("README.txt", readme);
|
|
7011
7011
|
if (abortCtrl.signal.aborted) {
|
|
7012
7012
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -7017,7 +7017,7 @@ function useExportSaveAs(input) {
|
|
|
7017
7017
|
setExportProgress(95);
|
|
7018
7018
|
setExportStatusMessage("Downloading...");
|
|
7019
7019
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
7020
|
-
|
|
7020
|
+
chunkYBTRSG74_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
7021
7021
|
setExportProgress(100);
|
|
7022
7022
|
} catch (err) {
|
|
7023
7023
|
if (err.name !== "AbortError") {
|
|
@@ -7040,7 +7040,7 @@ function useExportSaveAs(input) {
|
|
|
7040
7040
|
const blob = new Blob([data], {
|
|
7041
7041
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
7042
7042
|
});
|
|
7043
|
-
|
|
7043
|
+
chunkYBTRSG74_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
7044
7044
|
} catch (err) {
|
|
7045
7045
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
7046
7046
|
}
|
|
@@ -7053,14 +7053,14 @@ function useExportSaveAs(input) {
|
|
|
7053
7053
|
const pptxGuides = guides.map((g) => ({
|
|
7054
7054
|
id: g.id,
|
|
7055
7055
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7056
|
-
positionEmu:
|
|
7056
|
+
positionEmu: chunkYBTRSG74_js.guidePxToEmu(g.position)
|
|
7057
7057
|
}));
|
|
7058
7058
|
return {
|
|
7059
7059
|
...slide,
|
|
7060
7060
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7061
7061
|
};
|
|
7062
7062
|
});
|
|
7063
|
-
const slidesToSave =
|
|
7063
|
+
const slidesToSave = chunkFHTEL3Q6_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7064
7064
|
const saveOptions = {
|
|
7065
7065
|
headerFooter,
|
|
7066
7066
|
presentationProperties,
|
|
@@ -7086,11 +7086,11 @@ function useExportSaveAs(input) {
|
|
|
7086
7086
|
const handleExportJson = () => {
|
|
7087
7087
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7088
7088
|
const data = {
|
|
7089
|
-
slides:
|
|
7089
|
+
slides: chunkFHTEL3Q6_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7090
7090
|
width: canvasSize.width,
|
|
7091
7091
|
height: canvasSize.height,
|
|
7092
|
-
widthEmu:
|
|
7093
|
-
heightEmu:
|
|
7092
|
+
widthEmu: chunkYBTRSG74_js.guidePxToEmu(canvasSize.width),
|
|
7093
|
+
heightEmu: chunkYBTRSG74_js.guidePxToEmu(canvasSize.height),
|
|
7094
7094
|
theme,
|
|
7095
7095
|
headerFooter,
|
|
7096
7096
|
presentationProperties,
|
|
@@ -7104,7 +7104,7 @@ function useExportSaveAs(input) {
|
|
|
7104
7104
|
handoutMaster
|
|
7105
7105
|
};
|
|
7106
7106
|
try {
|
|
7107
|
-
|
|
7107
|
+
chunkYBTRSG74_js.exportDeckJson(data, sourceName);
|
|
7108
7108
|
} catch (err) {
|
|
7109
7109
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7110
7110
|
}
|
|
@@ -7144,7 +7144,7 @@ function safeConfirm(message) {
|
|
|
7144
7144
|
}
|
|
7145
7145
|
}
|
|
7146
7146
|
function downloadBlob2(blob, filename) {
|
|
7147
|
-
|
|
7147
|
+
chunkYBTRSG74_js.downloadBlob(blob, chunkYBTRSG74_js.sanitizeDownloadFilename(filename));
|
|
7148
7148
|
}
|
|
7149
7149
|
|
|
7150
7150
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7250,21 +7250,21 @@ function useExportHandlers(input) {
|
|
|
7250
7250
|
{
|
|
7251
7251
|
scale: 2,
|
|
7252
7252
|
onProgress: (current, total) => {
|
|
7253
|
-
setExportProgress(
|
|
7254
|
-
setExportStatusMessage(
|
|
7253
|
+
setExportProgress(chunkYBTRSG74_js.slideProgressPercent(current, total));
|
|
7254
|
+
setExportStatusMessage(chunkYBTRSG74_js.slideStatusLabel("Rendering", current, total));
|
|
7255
7255
|
},
|
|
7256
7256
|
signal: abortCtrl.signal
|
|
7257
7257
|
}
|
|
7258
7258
|
);
|
|
7259
|
-
setExportProgress(
|
|
7259
|
+
setExportProgress(chunkYBTRSG74_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7260
7260
|
setExportStatusMessage("Building PDF...");
|
|
7261
7261
|
await new Promise((r) => {
|
|
7262
7262
|
setTimeout(r, 100);
|
|
7263
7263
|
});
|
|
7264
|
-
setExportProgress(
|
|
7264
|
+
setExportProgress(chunkYBTRSG74_js.EXPORT_DONE_PERCENT);
|
|
7265
7265
|
setExportStatusMessage("Done!");
|
|
7266
7266
|
} catch (err) {
|
|
7267
|
-
if (!
|
|
7267
|
+
if (!chunkYBTRSG74_js.isExportAbortError(err)) {
|
|
7268
7268
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7269
7269
|
}
|
|
7270
7270
|
} finally {
|
|
@@ -7294,21 +7294,21 @@ function useExportHandlers(input) {
|
|
|
7294
7294
|
{
|
|
7295
7295
|
scale: 2,
|
|
7296
7296
|
onProgress: (current, total) => {
|
|
7297
|
-
setExportProgress(
|
|
7298
|
-
setExportStatusMessage(
|
|
7297
|
+
setExportProgress(chunkYBTRSG74_js.slideProgressPercent(current, total));
|
|
7298
|
+
setExportStatusMessage(chunkYBTRSG74_js.slideStatusLabel("Rendering", current, total));
|
|
7299
7299
|
},
|
|
7300
7300
|
signal: abortCtrl.signal
|
|
7301
7301
|
}
|
|
7302
7302
|
);
|
|
7303
|
-
setExportProgress(
|
|
7303
|
+
setExportProgress(chunkYBTRSG74_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7304
7304
|
setExportStatusMessage("Building PDF...");
|
|
7305
7305
|
await new Promise((r) => {
|
|
7306
7306
|
setTimeout(r, 100);
|
|
7307
7307
|
});
|
|
7308
|
-
setExportProgress(
|
|
7308
|
+
setExportProgress(chunkYBTRSG74_js.EXPORT_DONE_PERCENT);
|
|
7309
7309
|
setExportStatusMessage("Done!");
|
|
7310
7310
|
} catch (err) {
|
|
7311
|
-
if (!
|
|
7311
|
+
if (!chunkYBTRSG74_js.isExportAbortError(err)) {
|
|
7312
7312
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7313
7313
|
}
|
|
7314
7314
|
} finally {
|
|
@@ -7349,22 +7349,22 @@ function useExportHandlers(input) {
|
|
|
7349
7349
|
scale: 1,
|
|
7350
7350
|
slideDurationMs: 3e3,
|
|
7351
7351
|
onProgress: (current, total) => {
|
|
7352
|
-
setExportProgress(
|
|
7353
|
-
setExportStatusMessage(
|
|
7352
|
+
setExportProgress(chunkYBTRSG74_js.slideProgressPercent(current, total, 45));
|
|
7353
|
+
setExportStatusMessage(chunkYBTRSG74_js.slideStatusLabel("Capturing", current, total));
|
|
7354
7354
|
},
|
|
7355
7355
|
onRecordProgress: (current, total) => {
|
|
7356
|
-
setExportProgress(
|
|
7357
|
-
setExportStatusMessage(
|
|
7356
|
+
setExportProgress(chunkYBTRSG74_js.recordProgressPercent(current, total));
|
|
7357
|
+
setExportStatusMessage(chunkYBTRSG74_js.slideStatusLabel("Recording", current, total));
|
|
7358
7358
|
},
|
|
7359
7359
|
signal: abortCtrl.signal
|
|
7360
7360
|
}
|
|
7361
7361
|
);
|
|
7362
|
-
setExportProgress(
|
|
7362
|
+
setExportProgress(chunkYBTRSG74_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7363
7363
|
setExportStatusMessage("Saving file...");
|
|
7364
7364
|
downloadBlob2(blob, "presentation.webm");
|
|
7365
|
-
setExportProgress(
|
|
7365
|
+
setExportProgress(chunkYBTRSG74_js.EXPORT_DONE_PERCENT);
|
|
7366
7366
|
} catch (err) {
|
|
7367
|
-
if (!
|
|
7367
|
+
if (!chunkYBTRSG74_js.isExportAbortError(err)) {
|
|
7368
7368
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7369
7369
|
}
|
|
7370
7370
|
} finally {
|
|
@@ -7392,18 +7392,18 @@ function useExportHandlers(input) {
|
|
|
7392
7392
|
scale: 0.5,
|
|
7393
7393
|
slideDurationMs: 2e3,
|
|
7394
7394
|
onProgress: (current, total) => {
|
|
7395
|
-
setExportProgress(
|
|
7396
|
-
setExportStatusMessage(
|
|
7395
|
+
setExportProgress(chunkYBTRSG74_js.slideProgressPercent(current, total));
|
|
7396
|
+
setExportStatusMessage(chunkYBTRSG74_js.slideStatusLabel("Encoding", current, total));
|
|
7397
7397
|
},
|
|
7398
7398
|
signal: abortCtrl.signal
|
|
7399
7399
|
}
|
|
7400
7400
|
);
|
|
7401
|
-
setExportProgress(
|
|
7401
|
+
setExportProgress(chunkYBTRSG74_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7402
7402
|
setExportStatusMessage("Saving file...");
|
|
7403
7403
|
downloadBlob2(blob, "presentation.gif");
|
|
7404
|
-
setExportProgress(
|
|
7404
|
+
setExportProgress(chunkYBTRSG74_js.EXPORT_DONE_PERCENT);
|
|
7405
7405
|
} catch (err) {
|
|
7406
|
-
if (!
|
|
7406
|
+
if (!chunkYBTRSG74_js.isExportAbortError(err)) {
|
|
7407
7407
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7408
7408
|
}
|
|
7409
7409
|
} finally {
|
|
@@ -7444,7 +7444,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7444
7444
|
}
|
|
7445
7445
|
printWindow.document.open();
|
|
7446
7446
|
printWindow.document.write(
|
|
7447
|
-
|
|
7447
|
+
chunkYBTRSG74_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7448
7448
|
);
|
|
7449
7449
|
printWindow.document.close();
|
|
7450
7450
|
printWindow.focus();
|
|
@@ -7505,7 +7505,7 @@ function usePrintHandlers(input) {
|
|
|
7505
7505
|
if (svgs.length === 0) {
|
|
7506
7506
|
return;
|
|
7507
7507
|
}
|
|
7508
|
-
const printDoc =
|
|
7508
|
+
const printDoc = chunkYBTRSG74_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7509
7509
|
title: "Slides (Vector)",
|
|
7510
7510
|
orientation: settings.orientation,
|
|
7511
7511
|
colorFilter
|
|
@@ -7541,7 +7541,7 @@ function usePrintHandlers(input) {
|
|
|
7541
7541
|
if (settings.printWhat === "outline") {
|
|
7542
7542
|
openPrintWindow(
|
|
7543
7543
|
"Outline",
|
|
7544
|
-
`<div class="outline-page">${
|
|
7544
|
+
`<div class="outline-page">${chunkYBTRSG74_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7545
7545
|
settings.orientation,
|
|
7546
7546
|
colorFilter,
|
|
7547
7547
|
settings.frameSlides
|
|
@@ -7566,7 +7566,7 @@ function usePrintHandlers(input) {
|
|
|
7566
7566
|
if (settings.printWhat === "slides") {
|
|
7567
7567
|
openPrintWindow(
|
|
7568
7568
|
"Slides",
|
|
7569
|
-
|
|
7569
|
+
chunkYBTRSG74_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7570
7570
|
settings.orientation,
|
|
7571
7571
|
colorFilter,
|
|
7572
7572
|
settings.frameSlides
|
|
@@ -7576,7 +7576,7 @@ function usePrintHandlers(input) {
|
|
|
7576
7576
|
if (settings.printWhat === "notes") {
|
|
7577
7577
|
openPrintWindow(
|
|
7578
7578
|
"Notes Pages",
|
|
7579
|
-
|
|
7579
|
+
chunkYBTRSG74_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7580
7580
|
"portrait",
|
|
7581
7581
|
colorFilter,
|
|
7582
7582
|
settings.frameSlides
|
|
@@ -7587,7 +7587,7 @@ function usePrintHandlers(input) {
|
|
|
7587
7587
|
const spp = settings.slidesPerPage;
|
|
7588
7588
|
openPrintWindow(
|
|
7589
7589
|
`Handout ${spp} per page`,
|
|
7590
|
-
|
|
7590
|
+
chunkYBTRSG74_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7591
7591
|
"portrait",
|
|
7592
7592
|
colorFilter,
|
|
7593
7593
|
settings.frameSlides
|
|
@@ -7651,8 +7651,8 @@ function useThemeHandlers(input) {
|
|
|
7651
7651
|
return;
|
|
7652
7652
|
}
|
|
7653
7653
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7654
|
-
const previousMap = theme?.colorScheme ?
|
|
7655
|
-
setSlides((prev) =>
|
|
7654
|
+
const previousMap = theme?.colorScheme ? chunkYBTRSG74_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7655
|
+
setSlides((prev) => chunkYBTRSG74_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7656
7656
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7657
7657
|
bumpHistory();
|
|
7658
7658
|
history.markDirty();
|
|
@@ -7757,7 +7757,7 @@ function useThemeSwitching(input) {
|
|
|
7757
7757
|
}
|
|
7758
7758
|
try {
|
|
7759
7759
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7760
|
-
const newData =
|
|
7760
|
+
const newData = chunkYBTRSG74_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7761
7761
|
onDataChange(newData);
|
|
7762
7762
|
onThemeChanged?.(preset);
|
|
7763
7763
|
} catch (error) {
|
|
@@ -7774,7 +7774,7 @@ function useThemeSwitching(input) {
|
|
|
7774
7774
|
}
|
|
7775
7775
|
try {
|
|
7776
7776
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7777
|
-
const newData =
|
|
7777
|
+
const newData = chunkYBTRSG74_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7778
7778
|
onDataChange(newData);
|
|
7779
7779
|
} catch (error) {
|
|
7780
7780
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7786,12 +7786,12 @@ function useThemeSwitching(input) {
|
|
|
7786
7786
|
if (!data?.theme?.colorScheme) {
|
|
7787
7787
|
return void 0;
|
|
7788
7788
|
}
|
|
7789
|
-
return
|
|
7790
|
-
(p) =>
|
|
7789
|
+
return chunkYBTRSG74_js.THEME_PRESETS.find(
|
|
7790
|
+
(p) => chunkYBTRSG74_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7791
7791
|
);
|
|
7792
7792
|
}, [data?.theme?.colorScheme]);
|
|
7793
7793
|
return {
|
|
7794
|
-
presets:
|
|
7794
|
+
presets: chunkYBTRSG74_js.THEME_PRESETS,
|
|
7795
7795
|
switchToPreset,
|
|
7796
7796
|
switchToCustom,
|
|
7797
7797
|
currentPreset
|
|
@@ -7866,7 +7866,7 @@ function usePropertyHandlers(input) {
|
|
|
7866
7866
|
}
|
|
7867
7867
|
try {
|
|
7868
7868
|
const ab = await file.arrayBuffer();
|
|
7869
|
-
const h = new
|
|
7869
|
+
const h = new chunkYBTRSG74_js.PptxHandler();
|
|
7870
7870
|
const other = await h.load(ab);
|
|
7871
7871
|
if (!other) {
|
|
7872
7872
|
return;
|
|
@@ -7876,7 +7876,7 @@ function usePropertyHandlers(input) {
|
|
|
7876
7876
|
width: canvasSize.width,
|
|
7877
7877
|
height: canvasSize.height
|
|
7878
7878
|
};
|
|
7879
|
-
setCompareResult(
|
|
7879
|
+
setCompareResult(chunkYBTRSG74_js.comparePresentation(cur, other));
|
|
7880
7880
|
setIsComparePanelOpen(true);
|
|
7881
7881
|
} catch (err) {
|
|
7882
7882
|
console.warn("Compare failed:", err);
|
|
@@ -7893,7 +7893,7 @@ function usePropertyHandlers(input) {
|
|
|
7893
7893
|
if (!diff || diff.status === "unchanged") {
|
|
7894
7894
|
return;
|
|
7895
7895
|
}
|
|
7896
|
-
setSlides((prev) =>
|
|
7896
|
+
setSlides((prev) => chunkYBTRSG74_js.applyAcceptSlide(prev, diff));
|
|
7897
7897
|
setIsDirty(true);
|
|
7898
7898
|
},
|
|
7899
7899
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7904,10 +7904,10 @@ function usePropertyHandlers(input) {
|
|
|
7904
7904
|
if (!compareResult) {
|
|
7905
7905
|
return;
|
|
7906
7906
|
}
|
|
7907
|
-
setSlides((prev) =>
|
|
7907
|
+
setSlides((prev) => chunkYBTRSG74_js.applyAcceptAllSlides(prev, compareResult));
|
|
7908
7908
|
setIsDirty(true);
|
|
7909
7909
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7910
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7910
|
+
const usedFontFamilies = react.useMemo(() => chunkYBTRSG74_js.collectUsedFonts(slides), [slides]);
|
|
7911
7911
|
return {
|
|
7912
7912
|
handleUpdateNotes,
|
|
7913
7913
|
handleUpdateSlide,
|
|
@@ -8026,7 +8026,7 @@ function useIsMobile(input) {
|
|
|
8026
8026
|
const containerRef = input?.containerRef;
|
|
8027
8027
|
const isTouchDevice = react.useSyncExternalStore(
|
|
8028
8028
|
subscribeTouchCapability,
|
|
8029
|
-
|
|
8029
|
+
chunkYBTRSG74_js.detectTouchDevice,
|
|
8030
8030
|
() => false
|
|
8031
8031
|
// server snapshot
|
|
8032
8032
|
);
|
|
@@ -8042,7 +8042,7 @@ function useIsMobile(input) {
|
|
|
8042
8042
|
}
|
|
8043
8043
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
8044
8044
|
});
|
|
8045
|
-
const [orientation, setOrientation] = react.useState(
|
|
8045
|
+
const [orientation, setOrientation] = react.useState(chunkYBTRSG74_js.detectOrientation);
|
|
8046
8046
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
8047
8047
|
const [initialViewportHeight] = react.useState(
|
|
8048
8048
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -8086,7 +8086,7 @@ function useIsMobile(input) {
|
|
|
8086
8086
|
return;
|
|
8087
8087
|
}
|
|
8088
8088
|
const handleOrientationChange = () => {
|
|
8089
|
-
setOrientation(
|
|
8089
|
+
setOrientation(chunkYBTRSG74_js.detectOrientation());
|
|
8090
8090
|
};
|
|
8091
8091
|
if (screen.orientation) {
|
|
8092
8092
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -8116,9 +8116,9 @@ function useIsMobile(input) {
|
|
|
8116
8116
|
window.addEventListener("resize", handleResize);
|
|
8117
8117
|
return () => window.removeEventListener("resize", handleResize);
|
|
8118
8118
|
}, [isTouchDevice, initialViewportHeight]);
|
|
8119
|
-
const isMobile =
|
|
8120
|
-
const isTablet = !isMobile && containerWidth >=
|
|
8121
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
8119
|
+
const isMobile = chunkYBTRSG74_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
8120
|
+
const isTablet = !isMobile && containerWidth >= chunkYBTRSG74_js.MOBILE_BREAKPOINT && containerWidth < chunkYBTRSG74_js.TABLET_BREAKPOINT;
|
|
8121
|
+
const isDesktop = !isMobile && containerWidth >= chunkYBTRSG74_js.TABLET_BREAKPOINT;
|
|
8122
8122
|
return {
|
|
8123
8123
|
isMobile,
|
|
8124
8124
|
isTablet,
|
|
@@ -8179,11 +8179,11 @@ function useViewerDialogs(input) {
|
|
|
8179
8179
|
);
|
|
8180
8180
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(false);
|
|
8181
8181
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8182
|
-
() => typeof window !== "undefined" ?
|
|
8182
|
+
() => typeof window !== "undefined" ? chunkYBTRSG74_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8183
8183
|
);
|
|
8184
8184
|
react.useEffect(() => {
|
|
8185
8185
|
const handleWindow = () => setIsNarrowViewport(
|
|
8186
|
-
|
|
8186
|
+
chunkYBTRSG74_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8187
8187
|
);
|
|
8188
8188
|
let observer = null;
|
|
8189
8189
|
let raf = 0;
|
|
@@ -8197,12 +8197,12 @@ function useViewerDialogs(input) {
|
|
|
8197
8197
|
const entry = entries[0];
|
|
8198
8198
|
if (entry) {
|
|
8199
8199
|
setIsNarrowViewport(
|
|
8200
|
-
|
|
8200
|
+
chunkYBTRSG74_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8201
8201
|
);
|
|
8202
8202
|
}
|
|
8203
8203
|
});
|
|
8204
8204
|
observer.observe(el);
|
|
8205
|
-
setIsNarrowViewport(
|
|
8205
|
+
setIsNarrowViewport(chunkYBTRSG74_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8206
8206
|
};
|
|
8207
8207
|
attach();
|
|
8208
8208
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8360,20 +8360,20 @@ function useViewerDialogs(input) {
|
|
|
8360
8360
|
}
|
|
8361
8361
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8362
8362
|
if (presentationGridSpacing) {
|
|
8363
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8363
|
+
const px = Math.round(presentationGridSpacing.cx / chunkFHTEL3Q6_js.EMU_PER_PX);
|
|
8364
8364
|
if (px > 0) {
|
|
8365
8365
|
return px;
|
|
8366
8366
|
}
|
|
8367
8367
|
}
|
|
8368
|
-
return
|
|
8368
|
+
return chunkFHTEL3Q6_js.GRID_SIZE;
|
|
8369
8369
|
}
|
|
8370
8370
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8371
8371
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8372
|
-
return
|
|
8372
|
+
return chunkYBTRSG74_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8373
8373
|
}
|
|
8374
8374
|
function computeSlideSectionGroups(slides, sections) {
|
|
8375
|
-
return
|
|
8376
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8375
|
+
return chunkYBTRSG74_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8376
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkFHTEL3Q6_js.UNGROUPED_SECTION_ID : "default"),
|
|
8377
8377
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8378
8378
|
slideIndexes: group.slideIndexes,
|
|
8379
8379
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8428,7 +8428,7 @@ function useDerivedSlideState(input) {
|
|
|
8428
8428
|
);
|
|
8429
8429
|
const slideSectionGroups = react.useMemo(
|
|
8430
8430
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8431
|
-
if (group.id ===
|
|
8431
|
+
if (group.id === chunkFHTEL3Q6_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8432
8432
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8433
8433
|
}
|
|
8434
8434
|
if (group.id === "default" && group.label === "Slides") {
|
|
@@ -8531,13 +8531,13 @@ function useAnnotationHandlers(input) {
|
|
|
8531
8531
|
}, [annotations, setMode, setSlides, history]);
|
|
8532
8532
|
const handleSetMode = react.useCallback(
|
|
8533
8533
|
(nextMode) => {
|
|
8534
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8534
|
+
if (mode === "present" && nextMode !== "present" && !chunkYBTRSG74_js.mayLeaveSlideShow()) {
|
|
8535
8535
|
return;
|
|
8536
8536
|
}
|
|
8537
8537
|
if (nextMode === "present") {
|
|
8538
8538
|
presentation.enterPresentMode();
|
|
8539
8539
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8540
|
-
|
|
8540
|
+
chunkYBTRSG74_js.stopAllPersistentAudio();
|
|
8541
8541
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8542
8542
|
if (promptKeepInkAnnotations) {
|
|
8543
8543
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8546,7 +8546,7 @@ function useAnnotationHandlers(input) {
|
|
|
8546
8546
|
}
|
|
8547
8547
|
} else {
|
|
8548
8548
|
if (mode === "present") {
|
|
8549
|
-
|
|
8549
|
+
chunkYBTRSG74_js.stopAllPersistentAudio();
|
|
8550
8550
|
}
|
|
8551
8551
|
setMode(nextMode);
|
|
8552
8552
|
}
|
|
@@ -8612,13 +8612,13 @@ function useSerialize(input) {
|
|
|
8612
8612
|
let processedSlide = slide;
|
|
8613
8613
|
if (pendingEditId) {
|
|
8614
8614
|
const updatedElements = slide.elements.map((el) => {
|
|
8615
|
-
if (el.id !== pendingEditId || !
|
|
8615
|
+
if (el.id !== pendingEditId || !chunkYBTRSG74_js.hasTextProperties(el)) {
|
|
8616
8616
|
return el;
|
|
8617
8617
|
}
|
|
8618
8618
|
return {
|
|
8619
8619
|
...el,
|
|
8620
8620
|
text: pendingEditText,
|
|
8621
|
-
textSegments:
|
|
8621
|
+
textSegments: chunkYBTRSG74_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8622
8622
|
};
|
|
8623
8623
|
});
|
|
8624
8624
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8631,14 +8631,14 @@ function useSerialize(input) {
|
|
|
8631
8631
|
const pptxGuides = guides.map((g) => ({
|
|
8632
8632
|
id: g.id,
|
|
8633
8633
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8634
|
-
positionEmu:
|
|
8634
|
+
positionEmu: chunkYBTRSG74_js.guidePxToEmu(g.position)
|
|
8635
8635
|
}));
|
|
8636
8636
|
return {
|
|
8637
8637
|
...processedSlide,
|
|
8638
8638
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8639
8639
|
};
|
|
8640
8640
|
});
|
|
8641
|
-
const slidesToSave =
|
|
8641
|
+
const slidesToSave = chunkFHTEL3Q6_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8642
8642
|
const saveOptions = {
|
|
8643
8643
|
headerFooter,
|
|
8644
8644
|
presentationProperties,
|
|
@@ -8807,7 +8807,7 @@ function usePresentationSetup(input) {
|
|
|
8807
8807
|
containerRef,
|
|
8808
8808
|
content,
|
|
8809
8809
|
onSetMode: (nextMode) => {
|
|
8810
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8810
|
+
if (mode === "present" && nextMode !== "present" && !chunkYBTRSG74_js.mayLeaveSlideShow()) {
|
|
8811
8811
|
return;
|
|
8812
8812
|
}
|
|
8813
8813
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8815,7 +8815,7 @@ function usePresentationSetup(input) {
|
|
|
8815
8815
|
setShowKeepAnnotationsDialog(true);
|
|
8816
8816
|
} else {
|
|
8817
8817
|
if (mode === "present" && nextMode !== "present") {
|
|
8818
|
-
|
|
8818
|
+
chunkYBTRSG74_js.stopAllPersistentAudio();
|
|
8819
8819
|
stopAnimationSound();
|
|
8820
8820
|
}
|
|
8821
8821
|
setMode(nextMode);
|
|
@@ -8869,10 +8869,10 @@ function usePresentationSetup(input) {
|
|
|
8869
8869
|
onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
|
|
8870
8870
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8871
8871
|
onSaveRehearsalTimings: (timings) => {
|
|
8872
|
-
setSlides((prev) =>
|
|
8872
|
+
setSlides((prev) => chunkYBTRSG74_js.applyRehearsalTimings(prev, timings));
|
|
8873
8873
|
history.markDirty();
|
|
8874
8874
|
},
|
|
8875
|
-
loopContinuously:
|
|
8875
|
+
loopContinuously: chunkYBTRSG74_js.shouldLoopContinuously(presentationProperties),
|
|
8876
8876
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8877
8877
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8878
8878
|
endWithBlackSlide
|
|
@@ -9036,7 +9036,7 @@ function useEditorOperations(input) {
|
|
|
9036
9036
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9037
9037
|
react.useEffect(() => {
|
|
9038
9038
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9039
|
-
copiedFormatRef.current =
|
|
9039
|
+
copiedFormatRef.current = chunkYBTRSG74_js.copyFormatFromElement(selectedElement);
|
|
9040
9040
|
} else if (!formatPainterActive) {
|
|
9041
9041
|
copiedFormatRef.current = null;
|
|
9042
9042
|
}
|
|
@@ -9062,12 +9062,12 @@ function useEditorOperations(input) {
|
|
|
9062
9062
|
e.stopPropagation();
|
|
9063
9063
|
const element = elementLookup.get(elementId);
|
|
9064
9064
|
if (element) {
|
|
9065
|
-
const updated =
|
|
9065
|
+
const updated = chunkYBTRSG74_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9066
9066
|
const updates = {};
|
|
9067
|
-
if (
|
|
9067
|
+
if (chunkYBTRSG74_js.hasShapeProperties(updated)) {
|
|
9068
9068
|
updates.shapeStyle = updated.shapeStyle;
|
|
9069
9069
|
}
|
|
9070
|
-
if (
|
|
9070
|
+
if (chunkYBTRSG74_js.hasTextProperties(updated)) {
|
|
9071
9071
|
updates.textStyle = updated.textStyle;
|
|
9072
9072
|
}
|
|
9073
9073
|
ops.updateElementById(elementId, updates);
|
|
@@ -9216,7 +9216,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9216
9216
|
const families = /* @__PURE__ */ new Set();
|
|
9217
9217
|
for (const slide of slides) {
|
|
9218
9218
|
for (const el of slide.elements) {
|
|
9219
|
-
if (
|
|
9219
|
+
if (chunkYBTRSG74_js.hasTextProperties(el) && el.textSegments) {
|
|
9220
9220
|
for (const seg of el.textSegments) {
|
|
9221
9221
|
if (seg.style.fontFamily) {
|
|
9222
9222
|
families.add(seg.style.fontFamily);
|
|
@@ -9428,13 +9428,13 @@ function useKeyboardShortcuts(input) {
|
|
|
9428
9428
|
inputRef.current = input;
|
|
9429
9429
|
const handleKeyDown = react.useCallback((e) => {
|
|
9430
9430
|
const current = inputRef.current;
|
|
9431
|
-
const { action, dx, dy } =
|
|
9431
|
+
const { action, dx, dy } = chunkYBTRSG74_js.mapEditorKey(e, {
|
|
9432
9432
|
canEdit: current.canEdit,
|
|
9433
9433
|
isPresenting: current.mode !== "edit",
|
|
9434
9434
|
hasSelection: current.hasSelection,
|
|
9435
9435
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9436
9436
|
isDrawing: current.activeTool !== "select",
|
|
9437
|
-
isTextInputTarget:
|
|
9437
|
+
isTextInputTarget: chunkYBTRSG74_js.isEditorTextInputTarget(e.target)
|
|
9438
9438
|
});
|
|
9439
9439
|
if (action === null) {
|
|
9440
9440
|
return;
|
|
@@ -9727,7 +9727,7 @@ function useViewerIntegration(input) {
|
|
|
9727
9727
|
return zoom.scale;
|
|
9728
9728
|
},
|
|
9729
9729
|
setZoom(level) {
|
|
9730
|
-
zoom.setScale(
|
|
9730
|
+
zoom.setScale(chunkYBTRSG74_js.clampZoomScale(level));
|
|
9731
9731
|
},
|
|
9732
9732
|
zoomIn() {
|
|
9733
9733
|
zoom.handleZoomIn();
|
|
@@ -9942,7 +9942,7 @@ function useReducedMotion() {
|
|
|
9942
9942
|
}
|
|
9943
9943
|
function useViewerOptions() {
|
|
9944
9944
|
const storeRef = react.useRef(null);
|
|
9945
|
-
storeRef.current ??=
|
|
9945
|
+
storeRef.current ??= chunkYBTRSG74_js.createViewerOptionsStore();
|
|
9946
9946
|
const store = storeRef.current;
|
|
9947
9947
|
const options = react.useSyncExternalStore(
|
|
9948
9948
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9951,9 +9951,9 @@ function useViewerOptions() {
|
|
|
9951
9951
|
);
|
|
9952
9952
|
return { optionsStore: store, options };
|
|
9953
9953
|
}
|
|
9954
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9954
|
+
var KNOWN_TAB_IDS = new Set(chunkYBTRSG74_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9955
9955
|
function computeToolbarVisibility(hiddenActions) {
|
|
9956
|
-
const isHidden = (id) =>
|
|
9956
|
+
const isHidden = (id) => chunkYBTRSG74_js.isActionHidden(id, hiddenActions);
|
|
9957
9957
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
9958
9958
|
return { isHidden, isTabVisible };
|
|
9959
9959
|
}
|
|
@@ -10038,12 +10038,12 @@ function useYjsDocumentSync({
|
|
|
10038
10038
|
return;
|
|
10039
10039
|
}
|
|
10040
10040
|
try {
|
|
10041
|
-
const handler = new
|
|
10041
|
+
const handler = new chunkYBTRSG74_js.PptxHandler();
|
|
10042
10042
|
await handler.load(sourceBytes.buffer);
|
|
10043
|
-
const currentSlides =
|
|
10043
|
+
const currentSlides = chunkYBTRSG74_js.readSlidesFromYDoc(
|
|
10044
10044
|
doc
|
|
10045
10045
|
);
|
|
10046
|
-
const slidesToSave =
|
|
10046
|
+
const slidesToSave = chunkFHTEL3Q6_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10047
10047
|
const bytes = await handler.save(slidesToSave);
|
|
10048
10048
|
config.onWriteBack(bytes);
|
|
10049
10049
|
} catch {
|
|
@@ -10058,7 +10058,7 @@ function useYjsDocumentSync({
|
|
|
10058
10058
|
if (!doc || !isConnected) {
|
|
10059
10059
|
return;
|
|
10060
10060
|
}
|
|
10061
|
-
const docSlides =
|
|
10061
|
+
const docSlides = chunkYBTRSG74_js.readSlidesFromYDoc(
|
|
10062
10062
|
doc
|
|
10063
10063
|
);
|
|
10064
10064
|
if (docSlides.length === 0) {
|
|
@@ -10080,11 +10080,11 @@ function useYjsDocumentSync({
|
|
|
10080
10080
|
lastSyncedRef.current = serialized;
|
|
10081
10081
|
void (async () => {
|
|
10082
10082
|
const factories = await getFactories();
|
|
10083
|
-
|
|
10083
|
+
chunkYBTRSG74_js.reconcileSlidesInYDoc(
|
|
10084
10084
|
slides,
|
|
10085
10085
|
doc,
|
|
10086
10086
|
factories,
|
|
10087
|
-
|
|
10087
|
+
chunkYBTRSG74_js.LOCAL_SYNC_ORIGIN
|
|
10088
10088
|
);
|
|
10089
10089
|
scheduleWriteBack();
|
|
10090
10090
|
})();
|
|
@@ -10098,10 +10098,10 @@ function useYjsDocumentSync({
|
|
|
10098
10098
|
return;
|
|
10099
10099
|
}
|
|
10100
10100
|
const handleChange = (_events, transaction) => {
|
|
10101
|
-
if (transaction?.origin ===
|
|
10101
|
+
if (transaction?.origin === chunkYBTRSG74_js.LOCAL_SYNC_ORIGIN) {
|
|
10102
10102
|
return;
|
|
10103
10103
|
}
|
|
10104
|
-
const remoteSlides =
|
|
10104
|
+
const remoteSlides = chunkYBTRSG74_js.readSlidesFromYDoc(
|
|
10105
10105
|
doc
|
|
10106
10106
|
);
|
|
10107
10107
|
if (remoteSlides.length === 0) {
|
|
@@ -10117,7 +10117,7 @@ function useYjsDocumentSync({
|
|
|
10117
10117
|
isApplyingRemoteRef.current = false;
|
|
10118
10118
|
scheduleWriteBack();
|
|
10119
10119
|
};
|
|
10120
|
-
const unobserve =
|
|
10120
|
+
const unobserve = chunkYBTRSG74_js.observeYDocSlides(
|
|
10121
10121
|
doc,
|
|
10122
10122
|
handleChange
|
|
10123
10123
|
);
|
|
@@ -10155,7 +10155,7 @@ function useBroadcastFollower({
|
|
|
10155
10155
|
if (!broadcaster) {
|
|
10156
10156
|
return;
|
|
10157
10157
|
}
|
|
10158
|
-
if (!
|
|
10158
|
+
if (!chunkYBTRSG74_js.shouldAutoFollowBroadcaster({
|
|
10159
10159
|
localRole: collab.config.role,
|
|
10160
10160
|
broadcasterRole: broadcaster.role
|
|
10161
10161
|
})) {
|
|
@@ -10315,10 +10315,10 @@ function useTouchGestures(input) {
|
|
|
10315
10315
|
if (!el || !enabled) {
|
|
10316
10316
|
return;
|
|
10317
10317
|
}
|
|
10318
|
-
const recognizer =
|
|
10318
|
+
const recognizer = chunkYBTRSG74_js.createTouchGestureRecognizer({
|
|
10319
10319
|
getScale: () => scaleRef.current,
|
|
10320
|
-
minScale:
|
|
10321
|
-
maxScale:
|
|
10320
|
+
minScale: chunkYBTRSG74_js.MIN_ZOOM_SCALE,
|
|
10321
|
+
maxScale: chunkYBTRSG74_js.MAX_ZOOM_SCALE,
|
|
10322
10322
|
callbacks: {
|
|
10323
10323
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10324
10324
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10358,7 +10358,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10358
10358
|
return;
|
|
10359
10359
|
}
|
|
10360
10360
|
const rect = active.getBoundingClientRect();
|
|
10361
|
-
const delta =
|
|
10361
|
+
const delta = chunkYBTRSG74_js.computeScrollDelta(
|
|
10362
10362
|
{ top: rect.top, bottom: rect.bottom },
|
|
10363
10363
|
window.innerHeight,
|
|
10364
10364
|
keyboardInset
|
|
@@ -10378,8 +10378,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10378
10378
|
return;
|
|
10379
10379
|
}
|
|
10380
10380
|
const update = () => {
|
|
10381
|
-
const metrics =
|
|
10382
|
-
const inset = metrics ?
|
|
10381
|
+
const metrics = chunkYBTRSG74_js.readViewportMetrics(window);
|
|
10382
|
+
const inset = metrics ? chunkYBTRSG74_js.computeKeyboardInset(metrics) : 0;
|
|
10383
10383
|
setKeyboardInset(inset);
|
|
10384
10384
|
if (inset > 0) {
|
|
10385
10385
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10390,8 +10390,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10390
10390
|
vv.addEventListener("scroll", update);
|
|
10391
10391
|
const onFocusIn = () => {
|
|
10392
10392
|
window.requestAnimationFrame(() => {
|
|
10393
|
-
const metrics =
|
|
10394
|
-
const inset = metrics ?
|
|
10393
|
+
const metrics = chunkYBTRSG74_js.readViewportMetrics(window);
|
|
10394
|
+
const inset = metrics ? chunkYBTRSG74_js.computeKeyboardInset(metrics) : 0;
|
|
10395
10395
|
if (inset > 0) {
|
|
10396
10396
|
scrollFocusedIntoView(inset);
|
|
10397
10397
|
}
|
|
@@ -10404,7 +10404,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10404
10404
|
document.removeEventListener("focusin", onFocusIn);
|
|
10405
10405
|
};
|
|
10406
10406
|
}, [enabled]);
|
|
10407
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10407
|
+
return { keyboardInset, isKeyboardOpen: chunkYBTRSG74_js.isKeyboardOpen(keyboardInset) };
|
|
10408
10408
|
}
|
|
10409
10409
|
|
|
10410
10410
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10431,7 +10431,7 @@ function buildCanvasProps(input) {
|
|
|
10431
10431
|
} = input;
|
|
10432
10432
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10433
10433
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10434
|
-
const fieldContext =
|
|
10434
|
+
const fieldContext = chunkYBTRSG74_js.buildFieldSubstitutionContext({
|
|
10435
10435
|
headerFooter: s.headerFooter,
|
|
10436
10436
|
customProperties: s.customProperties,
|
|
10437
10437
|
slide: activeSlide
|
|
@@ -10441,13 +10441,13 @@ function buildCanvasProps(input) {
|
|
|
10441
10441
|
if (mode === "present") {
|
|
10442
10442
|
presentation.handlePresentationAction(action);
|
|
10443
10443
|
} else if (action.url) {
|
|
10444
|
-
|
|
10444
|
+
chunkYBTRSG74_js.safeOpenUrl(action.url);
|
|
10445
10445
|
}
|
|
10446
10446
|
};
|
|
10447
10447
|
const handleHyperlinkClick = (url) => {
|
|
10448
|
-
if (
|
|
10448
|
+
if (chunkYBTRSG74_js.isPpactionUrl(url)) {
|
|
10449
10449
|
if (mode === "present") {
|
|
10450
|
-
const parsed =
|
|
10450
|
+
const parsed = chunkYBTRSG74_js.parsePpactionUrl(url);
|
|
10451
10451
|
if (parsed) {
|
|
10452
10452
|
presentation.handlePresentationAction({
|
|
10453
10453
|
action: parsed.action,
|
|
@@ -10457,7 +10457,7 @@ function buildCanvasProps(input) {
|
|
|
10457
10457
|
}
|
|
10458
10458
|
return;
|
|
10459
10459
|
}
|
|
10460
|
-
|
|
10460
|
+
chunkYBTRSG74_js.safeOpenUrl(url);
|
|
10461
10461
|
};
|
|
10462
10462
|
return {
|
|
10463
10463
|
activeSlide: effectiveSlide,
|
|
@@ -10600,7 +10600,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10600
10600
|
const current = activeSlide.animations ?? [];
|
|
10601
10601
|
if (group === "motionPath") {
|
|
10602
10602
|
propertyHandlers.handleUpdateSlide({
|
|
10603
|
-
animations:
|
|
10603
|
+
animations: chunkYBTRSG74_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10604
10604
|
});
|
|
10605
10605
|
return;
|
|
10606
10606
|
}
|
|
@@ -10795,7 +10795,7 @@ function buildToolbarProps(input) {
|
|
|
10795
10795
|
onOpenFile,
|
|
10796
10796
|
onOpenRecentFile,
|
|
10797
10797
|
onCreatePresentation: (templateId) => {
|
|
10798
|
-
s.setSlides(
|
|
10798
|
+
s.setSlides(chunkYBTRSG74_js.createBackstagePresentation(templateId));
|
|
10799
10799
|
s.setActiveSlideIndex(0);
|
|
10800
10800
|
s.setSelectedElementId(null);
|
|
10801
10801
|
s.setSelectedElementIds([]);
|
|
@@ -10822,7 +10822,7 @@ function buildToolbarProps(input) {
|
|
|
10822
10822
|
layoutOptions: scopedLayoutOptions,
|
|
10823
10823
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10824
10824
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10825
|
-
templateScheme:
|
|
10825
|
+
templateScheme: chunkYBTRSG74_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10826
10826
|
customShows: s.customShows,
|
|
10827
10827
|
activeCustomShowId: s.activeCustomShowId,
|
|
10828
10828
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -10854,7 +10854,7 @@ function buildToolbarProps(input) {
|
|
|
10854
10854
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10855
10855
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10856
10856
|
formatPainterActive: s.formatPainterActive,
|
|
10857
|
-
canActivateFormatPainter:
|
|
10857
|
+
canActivateFormatPainter: chunkYBTRSG74_js.hasCopyableFormat(selectedElement),
|
|
10858
10858
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10859
10859
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10860
10860
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11123,7 +11123,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11123
11123
|
}, [incomingContent]);
|
|
11124
11124
|
const onOpenFile = react.useCallback(() => {
|
|
11125
11125
|
void (async () => {
|
|
11126
|
-
const picked = await
|
|
11126
|
+
const picked = await chunkYBTRSG74_js.openPptxFile();
|
|
11127
11127
|
if (picked) {
|
|
11128
11128
|
setContent(picked.buffer);
|
|
11129
11129
|
}
|
|
@@ -11131,7 +11131,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11131
11131
|
}, []);
|
|
11132
11132
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11133
11133
|
void (async () => {
|
|
11134
|
-
const bytes = await
|
|
11134
|
+
const bytes = await chunkYBTRSG74_js.readBackstageRecentFile(key);
|
|
11135
11135
|
if (bytes) {
|
|
11136
11136
|
setContent(bytes);
|
|
11137
11137
|
}
|