pptx-react-viewer 2.15.1 → 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 +4 -0
- package/dist/{AiChatPanel-YDX2WONS.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-JWCGIYBL.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-4FFR5CF5.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-ZVWROBJT.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-PJLRTJLR.mjs → SurfaceChart3DScene-FXJ45DC5.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-PJLRTJLR.mjs.br → SurfaceChart3DScene-FXJ45DC5.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-FXJ45DC5.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-WEH6CLAU.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-OEK3VKSO.js → chunk-3XJODTAV.js} +348 -340
- package/dist/chunk-3XJODTAV.js.br +0 -0
- package/dist/chunk-3XJODTAV.js.gz +0 -0
- package/dist/{chunk-7TFVXCBY.mjs → chunk-6M6WP2TK.mjs} +214 -150
- package/dist/chunk-6M6WP2TK.mjs.br +0 -0
- package/dist/chunk-6M6WP2TK.mjs.gz +0 -0
- package/dist/{chunk-KFGVJONB.js → chunk-FHTEL3Q6.js} +253 -249
- package/dist/chunk-FHTEL3Q6.js.br +0 -0
- package/dist/chunk-FHTEL3Q6.js.gz +0 -0
- package/dist/{chunk-BHDUV2LM.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-LCDAL2JQ.mjs → chunk-OPX74QGH.mjs} +16 -8
- package/dist/chunk-OPX74QGH.mjs.br +0 -0
- package/dist/chunk-OPX74QGH.mjs.gz +0 -0
- package/dist/{chunk-ESUQSKGF.mjs → chunk-RPGAI65Z.mjs} +41 -9
- package/dist/chunk-RPGAI65Z.mjs.br +0 -0
- package/dist/chunk-RPGAI65Z.mjs.gz +0 -0
- package/dist/{chunk-LZDGIEN3.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-YAWRDLCV.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-YUPKCGB5.mjs → chunk-WJNWCKS7.mjs} +12 -8
- package/dist/chunk-WJNWCKS7.mjs.br +0 -0
- package/dist/chunk-WJNWCKS7.mjs.gz +0 -0
- package/dist/{chunk-Z3FYYUGI.js → chunk-YBTRSG74.js} +217 -150
- 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-JWCGIYBL.js.br +0 -0
- package/dist/AiChatPanel-JWCGIYBL.js.gz +0 -0
- package/dist/AiChatPanel-YDX2WONS.mjs.br +0 -0
- package/dist/AiChatPanel-YDX2WONS.mjs.gz +0 -0
- package/dist/Model3DScene-4FFR5CF5.js.br +0 -0
- package/dist/Model3DScene-4FFR5CF5.js.gz +0 -0
- package/dist/Model3DScene-ZVWROBJT.mjs.br +0 -0
- package/dist/Model3DScene-ZVWROBJT.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-PJLRTJLR.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-WEH6CLAU.js.br +0 -0
- package/dist/SurfaceChart3DScene-WEH6CLAU.js.gz +0 -0
- package/dist/chunk-7TFVXCBY.mjs.br +0 -0
- package/dist/chunk-7TFVXCBY.mjs.gz +0 -0
- package/dist/chunk-BHDUV2LM.js.br +0 -0
- package/dist/chunk-BHDUV2LM.js.gz +0 -0
- package/dist/chunk-ESUQSKGF.mjs.br +0 -0
- package/dist/chunk-ESUQSKGF.mjs.gz +0 -0
- package/dist/chunk-KFGVJONB.js.br +0 -0
- package/dist/chunk-KFGVJONB.js.gz +0 -0
- package/dist/chunk-LCDAL2JQ.mjs.br +0 -0
- package/dist/chunk-LCDAL2JQ.mjs.gz +0 -0
- package/dist/chunk-LZDGIEN3.js.br +0 -0
- package/dist/chunk-LZDGIEN3.js.gz +0 -0
- package/dist/chunk-OEK3VKSO.js.br +0 -0
- package/dist/chunk-OEK3VKSO.js.gz +0 -0
- package/dist/chunk-YAWRDLCV.mjs.br +0 -0
- package/dist/chunk-YAWRDLCV.mjs.gz +0 -0
- package/dist/chunk-YUPKCGB5.mjs.br +0 -0
- package/dist/chunk-YUPKCGB5.mjs.gz +0 -0
- package/dist/chunk-Z3FYYUGI.js.br +0 -0
- package/dist/chunk-Z3FYYUGI.js.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,19 +871,27 @@ 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]
|
|
878
878
|
);
|
|
879
879
|
react.useEffect(() => {
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
880
|
+
let raf = 0;
|
|
881
|
+
let attached = null;
|
|
882
|
+
const attach = () => {
|
|
883
|
+
const viewport = canvasViewportRef.current;
|
|
884
|
+
if (!viewport) {
|
|
885
|
+
raf = requestAnimationFrame(attach);
|
|
886
|
+
return;
|
|
887
|
+
}
|
|
888
|
+
attached = viewport;
|
|
889
|
+
viewport.addEventListener("wheel", handleWheel, { passive: false });
|
|
890
|
+
};
|
|
891
|
+
attach();
|
|
885
892
|
return () => {
|
|
886
|
-
|
|
893
|
+
cancelAnimationFrame(raf);
|
|
894
|
+
attached?.removeEventListener("wheel", handleWheel);
|
|
887
895
|
};
|
|
888
896
|
}, [handleWheel]);
|
|
889
897
|
const getCanvasPointFromClient = react.useCallback(
|
|
@@ -951,7 +959,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
951
959
|
const command = step.command;
|
|
952
960
|
const timer = window.setTimeout(
|
|
953
961
|
() => {
|
|
954
|
-
|
|
962
|
+
chunkFHTEL3Q6_js.executeMediaCommand(command);
|
|
955
963
|
},
|
|
956
964
|
Math.max(0, step.delayMs)
|
|
957
965
|
);
|
|
@@ -1088,7 +1096,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1088
1096
|
}))
|
|
1089
1097
|
);
|
|
1090
1098
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1091
|
-
const delay =
|
|
1099
|
+
const delay = chunkYBTRSG74_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1092
1100
|
const timer = window.setTimeout(() => {
|
|
1093
1101
|
setPresentationAnimations(
|
|
1094
1102
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1120,7 +1128,7 @@ function useAnimationPlayback(input) {
|
|
|
1120
1128
|
(controller, group) => {
|
|
1121
1129
|
driveBuildReveal(
|
|
1122
1130
|
controller,
|
|
1123
|
-
|
|
1131
|
+
chunkYBTRSG74_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1124
1132
|
setPresentationElementStates,
|
|
1125
1133
|
buildRafRef
|
|
1126
1134
|
);
|
|
@@ -1183,7 +1191,7 @@ function useAnimationPlayback(input) {
|
|
|
1183
1191
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1184
1192
|
return;
|
|
1185
1193
|
}
|
|
1186
|
-
const controller =
|
|
1194
|
+
const controller = chunkYBTRSG74_js.PresentationAnimationController.fromSlide(slide);
|
|
1187
1195
|
controllerRef.current = controller;
|
|
1188
1196
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1189
1197
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1341,12 +1349,12 @@ function useAnimationPlayback(input) {
|
|
|
1341
1349
|
presentationTimersRef
|
|
1342
1350
|
};
|
|
1343
1351
|
}
|
|
1344
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1345
|
-
var AUDIENCE_HASH =
|
|
1346
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1347
|
-
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;
|
|
1348
1356
|
function generateSessionId() {
|
|
1349
|
-
return
|
|
1357
|
+
return chunkYBTRSG74_js.createPresentationSessionId();
|
|
1350
1358
|
}
|
|
1351
1359
|
function parseAudienceNonce() {
|
|
1352
1360
|
const hash = window.location.hash;
|
|
@@ -1382,7 +1390,7 @@ function usePresenterWindow(input) {
|
|
|
1382
1390
|
}, []);
|
|
1383
1391
|
const swapDisplays = react.useCallback(async () => {
|
|
1384
1392
|
const audience = audienceWindowRef.current;
|
|
1385
|
-
return audience && !audience.closed ?
|
|
1393
|
+
return audience && !audience.closed ? chunkYBTRSG74_js.swapPresentationWindows(window, audience) : false;
|
|
1386
1394
|
}, []);
|
|
1387
1395
|
const syncSlideToAudience = react.useCallback(
|
|
1388
1396
|
(slideIndex) => {
|
|
@@ -1446,7 +1454,7 @@ function usePresenterWindow(input) {
|
|
|
1446
1454
|
pollTimerRef.current = null;
|
|
1447
1455
|
}
|
|
1448
1456
|
if (closingSessionId) {
|
|
1449
|
-
void
|
|
1457
|
+
void chunkYBTRSG74_js.clearAudienceContent(closingSessionId);
|
|
1450
1458
|
}
|
|
1451
1459
|
}, [getChannel]);
|
|
1452
1460
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1464,10 +1472,10 @@ function usePresenterWindow(input) {
|
|
|
1464
1472
|
audienceWindowRef.current = blankWin;
|
|
1465
1473
|
const sessionId = generateSessionId();
|
|
1466
1474
|
sessionIdRef.current = sessionId;
|
|
1467
|
-
const audienceUrl =
|
|
1468
|
-
void
|
|
1475
|
+
const audienceUrl = chunkYBTRSG74_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1476
|
+
void chunkYBTRSG74_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1469
1477
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1470
|
-
|
|
1478
|
+
chunkYBTRSG74_js.placeAudienceWindow(blankWin, placement);
|
|
1471
1479
|
}
|
|
1472
1480
|
return void 0;
|
|
1473
1481
|
});
|
|
@@ -1497,7 +1505,7 @@ function usePresenterWindow(input) {
|
|
|
1497
1505
|
}
|
|
1498
1506
|
};
|
|
1499
1507
|
if (content) {
|
|
1500
|
-
void
|
|
1508
|
+
void chunkYBTRSG74_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1501
1509
|
} else {
|
|
1502
1510
|
navigateOrClose(true);
|
|
1503
1511
|
}
|
|
@@ -1523,7 +1531,7 @@ function usePresenterWindow(input) {
|
|
|
1523
1531
|
}
|
|
1524
1532
|
const handleMessage = (event) => {
|
|
1525
1533
|
const message = event.data;
|
|
1526
|
-
if (
|
|
1534
|
+
if (chunkYBTRSG74_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1527
1535
|
syncStateToAudience(snapshotRef.current);
|
|
1528
1536
|
}
|
|
1529
1537
|
};
|
|
@@ -1552,7 +1560,7 @@ function usePresenterWindow(input) {
|
|
|
1552
1560
|
react.useEffect(() => {
|
|
1553
1561
|
const handleBeforeUnload = () => {
|
|
1554
1562
|
if (sessionIdRef.current) {
|
|
1555
|
-
void
|
|
1563
|
+
void chunkYBTRSG74_js.clearAudienceContent(sessionIdRef.current);
|
|
1556
1564
|
}
|
|
1557
1565
|
};
|
|
1558
1566
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1614,7 +1622,7 @@ function useAudienceMode(input) {
|
|
|
1614
1622
|
}
|
|
1615
1623
|
channel.onmessage = (event) => {
|
|
1616
1624
|
const data = event.data;
|
|
1617
|
-
if (!
|
|
1625
|
+
if (!chunkYBTRSG74_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1618
1626
|
return;
|
|
1619
1627
|
}
|
|
1620
1628
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1630,16 +1638,16 @@ function useAudienceMode(input) {
|
|
|
1630
1638
|
}
|
|
1631
1639
|
if (data.type === "presenter-exit") {
|
|
1632
1640
|
if (expectedSessionId) {
|
|
1633
|
-
void
|
|
1641
|
+
void chunkYBTRSG74_js.clearAudienceContent(expectedSessionId);
|
|
1634
1642
|
}
|
|
1635
|
-
if (
|
|
1643
|
+
if (chunkYBTRSG74_js.endAudienceDisplay(window)) {
|
|
1636
1644
|
handlers.onPresenterEnded?.();
|
|
1637
1645
|
}
|
|
1638
1646
|
}
|
|
1639
1647
|
};
|
|
1640
1648
|
if (expectedSessionId) {
|
|
1641
1649
|
channel.postMessage({
|
|
1642
|
-
origin:
|
|
1650
|
+
origin: chunkYBTRSG74_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1643
1651
|
type: "audience-ready",
|
|
1644
1652
|
sessionId: expectedSessionId
|
|
1645
1653
|
});
|
|
@@ -1672,14 +1680,14 @@ function usePresentationKeyboard(input) {
|
|
|
1672
1680
|
presentationSlideIndex,
|
|
1673
1681
|
setShowRehearsalSummary
|
|
1674
1682
|
} = input;
|
|
1675
|
-
const keyBufferRef = react.useRef(
|
|
1683
|
+
const keyBufferRef = react.useRef(chunkYBTRSG74_js.createPresentationKeyBuffer());
|
|
1676
1684
|
react.useEffect(() => {
|
|
1677
|
-
if (mode !== "present" || !
|
|
1678
|
-
keyBufferRef.current =
|
|
1685
|
+
if (mode !== "present" || !chunkYBTRSG74_js.acceptsPresentationInput()) {
|
|
1686
|
+
keyBufferRef.current = chunkYBTRSG74_js.createPresentationKeyBuffer();
|
|
1679
1687
|
return;
|
|
1680
1688
|
}
|
|
1681
1689
|
const handleKeyDown = (event) => {
|
|
1682
|
-
const mapped =
|
|
1690
|
+
const mapped = chunkYBTRSG74_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1683
1691
|
if (mapped.action === "none") {
|
|
1684
1692
|
return;
|
|
1685
1693
|
}
|
|
@@ -1699,12 +1707,12 @@ function usePresentationKeyboard(input) {
|
|
|
1699
1707
|
movePresentationSlide(-1);
|
|
1700
1708
|
return;
|
|
1701
1709
|
case "first": {
|
|
1702
|
-
const first =
|
|
1710
|
+
const first = chunkYBTRSG74_js.firstShowSlideIndex(showSlideIndexes);
|
|
1703
1711
|
navigateToSlide(first ?? 0);
|
|
1704
1712
|
return;
|
|
1705
1713
|
}
|
|
1706
1714
|
case "last": {
|
|
1707
|
-
const last =
|
|
1715
|
+
const last = chunkYBTRSG74_js.lastShowSlideIndex(showSlideIndexes);
|
|
1708
1716
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1709
1717
|
return;
|
|
1710
1718
|
}
|
|
@@ -1859,7 +1867,7 @@ function useRehearsalTimings(input) {
|
|
|
1859
1867
|
|
|
1860
1868
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1861
1869
|
function handlePresentationActionImpl(action, deps) {
|
|
1862
|
-
|
|
1870
|
+
chunkYBTRSG74_js.runPresentationAction(
|
|
1863
1871
|
action,
|
|
1864
1872
|
{ slideCount: deps.slidesLength },
|
|
1865
1873
|
{
|
|
@@ -1881,7 +1889,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1881
1889
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1882
1890
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1883
1891
|
const transition = incomingSlide?.transition;
|
|
1884
|
-
const durationMs = deps.playTransition ?
|
|
1892
|
+
const durationMs = deps.playTransition ? chunkYBTRSG74_js.resolveTransitionDurationMs(transition) : 0;
|
|
1885
1893
|
deps.clearPresentationTimers();
|
|
1886
1894
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1887
1895
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1940,7 +1948,7 @@ function useSlideNavigation(input) {
|
|
|
1940
1948
|
});
|
|
1941
1949
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1942
1950
|
(slideIndex) => {
|
|
1943
|
-
const delayMs =
|
|
1951
|
+
const delayMs = chunkYBTRSG74_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1944
1952
|
if (delayMs === void 0) {
|
|
1945
1953
|
return;
|
|
1946
1954
|
}
|
|
@@ -1963,7 +1971,7 @@ function useSlideNavigation(input) {
|
|
|
1963
1971
|
if (availableSlideIndexes.length === 0) {
|
|
1964
1972
|
return;
|
|
1965
1973
|
}
|
|
1966
|
-
const pastLastSlide = direction === 1 && !
|
|
1974
|
+
const pastLastSlide = direction === 1 && !chunkYBTRSG74_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1967
1975
|
if (rehearsing && pastLastSlide) {
|
|
1968
1976
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1969
1977
|
try {
|
|
@@ -1981,9 +1989,9 @@ function useSlideNavigation(input) {
|
|
|
1981
1989
|
onAdvancePastLastSlide();
|
|
1982
1990
|
return;
|
|
1983
1991
|
}
|
|
1984
|
-
const nextSlideIndex = direction === 1 ?
|
|
1992
|
+
const nextSlideIndex = direction === 1 ? chunkYBTRSG74_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1985
1993
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
1986
|
-
}) :
|
|
1994
|
+
}) : chunkYBTRSG74_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
1987
1995
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
1988
1996
|
return;
|
|
1989
1997
|
}
|
|
@@ -2128,22 +2136,22 @@ function useZoomNavigation(input) {
|
|
|
2128
2136
|
};
|
|
2129
2137
|
}
|
|
2130
2138
|
function usePresenterConsole(slideIndex, active) {
|
|
2131
|
-
const timerRef = react.useRef(
|
|
2132
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2139
|
+
const timerRef = react.useRef(chunkYBTRSG74_js.createPresenterTimer());
|
|
2140
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkYBTRSG74_js.createInitialPresentationSnapshot(slideIndex));
|
|
2133
2141
|
const patch = react.useCallback((value) => {
|
|
2134
|
-
setSnapshot((current) =>
|
|
2142
|
+
setSnapshot((current) => chunkYBTRSG74_js.mergePresentationSnapshot(current, value));
|
|
2135
2143
|
}, []);
|
|
2136
2144
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2137
2145
|
react.useEffect(() => {
|
|
2138
2146
|
if (!active) {
|
|
2139
2147
|
return;
|
|
2140
2148
|
}
|
|
2141
|
-
timerRef.current =
|
|
2149
|
+
timerRef.current = chunkYBTRSG74_js.resetPresenterTimer();
|
|
2142
2150
|
patch({ paused: false, elapsedMs: 0 });
|
|
2143
2151
|
const timer = window.setInterval(() => {
|
|
2144
2152
|
patch({
|
|
2145
2153
|
paused: timerRef.current.paused,
|
|
2146
|
-
elapsedMs:
|
|
2154
|
+
elapsedMs: chunkYBTRSG74_js.presenterElapsed(timerRef.current)
|
|
2147
2155
|
});
|
|
2148
2156
|
}, 1e3);
|
|
2149
2157
|
return () => window.clearInterval(timer);
|
|
@@ -2153,19 +2161,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2153
2161
|
applyAudienceSnapshot: setSnapshot,
|
|
2154
2162
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2155
2163
|
toggleTimer: () => {
|
|
2156
|
-
timerRef.current =
|
|
2164
|
+
timerRef.current = chunkYBTRSG74_js.togglePresenterTimer(timerRef.current);
|
|
2157
2165
|
patch({
|
|
2158
2166
|
paused: timerRef.current.paused,
|
|
2159
|
-
elapsedMs:
|
|
2167
|
+
elapsedMs: chunkYBTRSG74_js.presenterElapsed(timerRef.current)
|
|
2160
2168
|
});
|
|
2161
2169
|
},
|
|
2162
2170
|
resetTimer: () => {
|
|
2163
|
-
timerRef.current =
|
|
2171
|
+
timerRef.current = chunkYBTRSG74_js.resetPresenterTimer();
|
|
2164
2172
|
patch({ paused: false, elapsedMs: 0 });
|
|
2165
2173
|
},
|
|
2166
2174
|
stepZoom: (direction) => setSnapshot(
|
|
2167
|
-
(current) =>
|
|
2168
|
-
zoom:
|
|
2175
|
+
(current) => chunkYBTRSG74_js.mergePresentationSnapshot(current, {
|
|
2176
|
+
zoom: chunkYBTRSG74_js.stepPresenterZoom(
|
|
2169
2177
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2170
2178
|
direction
|
|
2171
2179
|
)
|
|
@@ -2210,7 +2218,7 @@ function usePresentationMode(input) {
|
|
|
2210
2218
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2211
2219
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2212
2220
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2213
|
-
const showGuard = react.useMemo(() =>
|
|
2221
|
+
const showGuard = react.useMemo(() => chunkYBTRSG74_js.createPresenterShowGuard(), []);
|
|
2214
2222
|
const {
|
|
2215
2223
|
presentationAnimations,
|
|
2216
2224
|
presentationElementStates,
|
|
@@ -2289,7 +2297,7 @@ function usePresentationMode(input) {
|
|
|
2289
2297
|
});
|
|
2290
2298
|
const movePresentationSlide = react.useCallback(
|
|
2291
2299
|
(direction, trigger = "explicit") => {
|
|
2292
|
-
if (!
|
|
2300
|
+
if (!chunkYBTRSG74_js.acceptsPresentationInput()) {
|
|
2293
2301
|
return;
|
|
2294
2302
|
}
|
|
2295
2303
|
if (endOfShowVisible) {
|
|
@@ -2426,7 +2434,7 @@ function usePresentationMode(input) {
|
|
|
2426
2434
|
if (mode !== "present") {
|
|
2427
2435
|
return;
|
|
2428
2436
|
}
|
|
2429
|
-
return
|
|
2437
|
+
return chunkYBTRSG74_js.attachPresentationVisibilityPause({
|
|
2430
2438
|
root: containerRef.current ?? void 0,
|
|
2431
2439
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2432
2440
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2506,11 +2514,11 @@ function usePresentationMode(input) {
|
|
|
2506
2514
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2507
2515
|
return void 0;
|
|
2508
2516
|
}
|
|
2509
|
-
return
|
|
2517
|
+
return chunkYBTRSG74_js.buildMorphTransitionPlan(
|
|
2510
2518
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2511
2519
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2512
2520
|
transitionOverlay.durationMs,
|
|
2513
|
-
|
|
2521
|
+
chunkYBTRSG74_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2514
2522
|
);
|
|
2515
2523
|
}, [transitionOverlay, slides]);
|
|
2516
2524
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2816,7 +2824,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2816
2824
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2817
2825
|
slides.forEach((slide, slideIndex) => {
|
|
2818
2826
|
for (const element of slide.elements || []) {
|
|
2819
|
-
if (!
|
|
2827
|
+
if (!chunkYBTRSG74_js.hasTextProperties(element)) {
|
|
2820
2828
|
continue;
|
|
2821
2829
|
}
|
|
2822
2830
|
const segments = element.textSegments ?? [];
|
|
@@ -2867,7 +2875,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2867
2875
|
continue;
|
|
2868
2876
|
}
|
|
2869
2877
|
const element = slide.elements[elIdx];
|
|
2870
|
-
if (!
|
|
2878
|
+
if (!chunkYBTRSG74_js.hasTextProperties(element)) {
|
|
2871
2879
|
continue;
|
|
2872
2880
|
}
|
|
2873
2881
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3465,7 +3473,7 @@ function useViewerCoreState(_input) {
|
|
|
3465
3473
|
const shapeAdjustmentDragStateRef = react.useRef(null);
|
|
3466
3474
|
const marqueeStateRef = react.useRef(null);
|
|
3467
3475
|
const isDrawingRef = react.useRef(false);
|
|
3468
|
-
const livePatcher = react.useMemo(() =>
|
|
3476
|
+
const livePatcher = react.useMemo(() => chunkYBTRSG74_js.createCollaborationLivePatcher(), []);
|
|
3469
3477
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3470
3478
|
const slidesRef = react.useRef([]);
|
|
3471
3479
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3474,8 +3482,8 @@ function useViewerCoreState(_input) {
|
|
|
3474
3482
|
const [slides, setSlides] = react.useState([]);
|
|
3475
3483
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3476
3484
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3477
|
-
width:
|
|
3478
|
-
height:
|
|
3485
|
+
width: chunkFHTEL3Q6_js.DEFAULT_CANVAS_WIDTH,
|
|
3486
|
+
height: chunkFHTEL3Q6_js.DEFAULT_CANVAS_HEIGHT
|
|
3479
3487
|
});
|
|
3480
3488
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
3481
3489
|
const [selectedElementId, setSelectedElementId] = react.useState(null);
|
|
@@ -3495,7 +3503,7 @@ function useViewerCoreState(_input) {
|
|
|
3495
3503
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3496
3504
|
inlineEditingTextRef.current = resolved;
|
|
3497
3505
|
setInlineEditingTextBase(value);
|
|
3498
|
-
|
|
3506
|
+
chunkYBTRSG74_js.publishLiveInlineText(
|
|
3499
3507
|
livePatcher,
|
|
3500
3508
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3501
3509
|
inlineEditingElementIdRef.current,
|
|
@@ -3829,7 +3837,7 @@ function useLoadContent({
|
|
|
3829
3837
|
);
|
|
3830
3838
|
}
|
|
3831
3839
|
const previousHandler = handlerRef.current;
|
|
3832
|
-
const handler = new
|
|
3840
|
+
const handler = new chunkYBTRSG74_js.PptxHandler();
|
|
3833
3841
|
const parsed = await handler.load(buffer);
|
|
3834
3842
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3835
3843
|
handler.dispose();
|
|
@@ -3841,7 +3849,7 @@ function useLoadContent({
|
|
|
3841
3849
|
handlerRef.current = null;
|
|
3842
3850
|
const mediaElements = [];
|
|
3843
3851
|
for (const slide of parsed.slides) {
|
|
3844
|
-
|
|
3852
|
+
chunkYBTRSG74_js.collectMediaElements(slide.elements, mediaElements);
|
|
3845
3853
|
}
|
|
3846
3854
|
for (const url of mediaDataUrls.values()) {
|
|
3847
3855
|
if (url.startsWith("blob:")) {
|
|
@@ -3882,7 +3890,7 @@ function useLoadContent({
|
|
|
3882
3890
|
}
|
|
3883
3891
|
})
|
|
3884
3892
|
);
|
|
3885
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3893
|
+
const { paths: imagePaths, refs: imageRefs } = chunkYBTRSG74_js.collectImagePaths(parsed.slides);
|
|
3886
3894
|
let nextSlides = parsed.slides;
|
|
3887
3895
|
if (imagePaths.size > 0) {
|
|
3888
3896
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3937,12 +3945,12 @@ function useLoadContent({
|
|
|
3937
3945
|
}
|
|
3938
3946
|
}
|
|
3939
3947
|
handlerRef.current = handler;
|
|
3940
|
-
const partition =
|
|
3948
|
+
const partition = chunkFHTEL3Q6_js.partitionTemplateElements(nextSlides);
|
|
3941
3949
|
setSlides(partition.slides);
|
|
3942
3950
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3943
3951
|
setCanvasSize({
|
|
3944
|
-
width: parsed.width ??
|
|
3945
|
-
height: parsed.height ??
|
|
3952
|
+
width: parsed.width ?? chunkFHTEL3Q6_js.DEFAULT_CANVAS_WIDTH,
|
|
3953
|
+
height: parsed.height ?? chunkFHTEL3Q6_js.DEFAULT_CANVAS_HEIGHT
|
|
3946
3954
|
});
|
|
3947
3955
|
setHeaderFooter(parsed.headerFooter ?? {});
|
|
3948
3956
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
@@ -3971,7 +3979,7 @@ function useLoadContent({
|
|
|
3971
3979
|
setHasMacros(parsed.hasMacros === true);
|
|
3972
3980
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3973
3981
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3974
|
-
setGuides(
|
|
3982
|
+
setGuides(chunkYBTRSG74_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3975
3983
|
setActiveSlideIndex(0);
|
|
3976
3984
|
clearSelection();
|
|
3977
3985
|
setIsDirty(false);
|
|
@@ -3979,7 +3987,7 @@ function useLoadContent({
|
|
|
3979
3987
|
onContentApplied?.();
|
|
3980
3988
|
} catch (err) {
|
|
3981
3989
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3982
|
-
if (err instanceof
|
|
3990
|
+
if (err instanceof chunkYBTRSG74_js.EncryptedFileError) {
|
|
3983
3991
|
setIsEncrypted(true);
|
|
3984
3992
|
} else {
|
|
3985
3993
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -4056,7 +4064,7 @@ function useAutosave(input) {
|
|
|
4056
4064
|
isSavingRef.current = false;
|
|
4057
4065
|
return;
|
|
4058
4066
|
}
|
|
4059
|
-
await
|
|
4067
|
+
await chunkYBTRSG74_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
4060
4068
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4061
4069
|
} catch (err) {
|
|
4062
4070
|
setAutosaveStatus({
|
|
@@ -4121,7 +4129,7 @@ function useElementOperations(input) {
|
|
|
4121
4129
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
4122
4130
|
const updateElementById = react.useCallback(
|
|
4123
4131
|
(elementId, updates) => {
|
|
4124
|
-
if (
|
|
4132
|
+
if (chunkYBTRSG74_js.isTemplateElementId(elementId)) {
|
|
4125
4133
|
const slideId = activeSlide?.id;
|
|
4126
4134
|
if (slideId) {
|
|
4127
4135
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4161,7 +4169,7 @@ function useElementOperations(input) {
|
|
|
4161
4169
|
);
|
|
4162
4170
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4163
4171
|
(updates) => {
|
|
4164
|
-
if (!selectedElement || !
|
|
4172
|
+
if (!selectedElement || !chunkYBTRSG74_js.hasShapeProperties(selectedElement)) {
|
|
4165
4173
|
return;
|
|
4166
4174
|
}
|
|
4167
4175
|
updateSelectedElement({
|
|
@@ -4172,17 +4180,17 @@ function useElementOperations(input) {
|
|
|
4172
4180
|
);
|
|
4173
4181
|
const updateSelectedTextStyle = react.useCallback(
|
|
4174
4182
|
(updates) => {
|
|
4175
|
-
if (!selectedElement || !
|
|
4183
|
+
if (!selectedElement || !chunkYBTRSG74_js.hasTextProperties(selectedElement)) {
|
|
4176
4184
|
return;
|
|
4177
4185
|
}
|
|
4178
|
-
const inlineSel =
|
|
4186
|
+
const inlineSel = chunkYBTRSG74_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4179
4187
|
if (inlineSel && selectedElement.textSegments) {
|
|
4180
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4188
|
+
const { newSegments: newSegments2, newSelection } = chunkYBTRSG74_js.applyStyleToSelectedSegments(
|
|
4181
4189
|
selectedElement.textSegments,
|
|
4182
4190
|
inlineSel,
|
|
4183
4191
|
updates
|
|
4184
4192
|
);
|
|
4185
|
-
|
|
4193
|
+
chunkYBTRSG74_js.setPendingSelectionRestore(newSelection);
|
|
4186
4194
|
updateSelectedElement({
|
|
4187
4195
|
textSegments: newSegments2
|
|
4188
4196
|
});
|
|
@@ -4202,12 +4210,12 @@ function useElementOperations(input) {
|
|
|
4202
4210
|
);
|
|
4203
4211
|
const updateSelectedTextCase = react.useCallback(
|
|
4204
4212
|
(mode) => {
|
|
4205
|
-
if (!selectedElement || !
|
|
4213
|
+
if (!selectedElement || !chunkYBTRSG74_js.hasTextProperties(selectedElement)) {
|
|
4206
4214
|
return;
|
|
4207
4215
|
}
|
|
4208
|
-
const inlineSel =
|
|
4216
|
+
const inlineSel = chunkYBTRSG74_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4209
4217
|
if (inlineSel && selectedElement.textSegments) {
|
|
4210
|
-
const newSegments =
|
|
4218
|
+
const newSegments = chunkYBTRSG74_js.applyCaseTransformToSegments(
|
|
4211
4219
|
selectedElement.textSegments,
|
|
4212
4220
|
inlineSel,
|
|
4213
4221
|
mode
|
|
@@ -4217,14 +4225,14 @@ function useElementOperations(input) {
|
|
|
4217
4225
|
}
|
|
4218
4226
|
const updates = {};
|
|
4219
4227
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4220
|
-
updates.textSegments =
|
|
4228
|
+
updates.textSegments = chunkYBTRSG74_js.applyCaseTransformToSegments(
|
|
4221
4229
|
selectedElement.textSegments,
|
|
4222
4230
|
null,
|
|
4223
4231
|
mode
|
|
4224
4232
|
);
|
|
4225
4233
|
}
|
|
4226
4234
|
if (typeof selectedElement.text === "string") {
|
|
4227
|
-
updates.text =
|
|
4235
|
+
updates.text = chunkYBTRSG74_js.transformTextCase(selectedElement.text, mode);
|
|
4228
4236
|
}
|
|
4229
4237
|
updateSelectedElement(updates);
|
|
4230
4238
|
},
|
|
@@ -4279,7 +4287,7 @@ function useSectionOperations(input) {
|
|
|
4279
4287
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4280
4288
|
const addSection2 = react.useCallback(
|
|
4281
4289
|
(name, afterSlideIndex) => {
|
|
4282
|
-
const result =
|
|
4290
|
+
const result = chunkYBTRSG74_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4283
4291
|
setSlides(result.slides);
|
|
4284
4292
|
setSections(result.sections);
|
|
4285
4293
|
markDirty();
|
|
@@ -4288,7 +4296,7 @@ function useSectionOperations(input) {
|
|
|
4288
4296
|
);
|
|
4289
4297
|
const renameSection2 = react.useCallback(
|
|
4290
4298
|
(sectionId, newName) => {
|
|
4291
|
-
const result =
|
|
4299
|
+
const result = chunkYBTRSG74_js.renameSection(sections, slides, sectionId, newName);
|
|
4292
4300
|
setSections(result.sections);
|
|
4293
4301
|
setSlides(result.slides);
|
|
4294
4302
|
markDirty();
|
|
@@ -4297,7 +4305,7 @@ function useSectionOperations(input) {
|
|
|
4297
4305
|
);
|
|
4298
4306
|
const deleteSection2 = react.useCallback(
|
|
4299
4307
|
(sectionId) => {
|
|
4300
|
-
const result =
|
|
4308
|
+
const result = chunkYBTRSG74_js.deleteSection(sections, slides, sectionId);
|
|
4301
4309
|
setSections(result.sections);
|
|
4302
4310
|
setSlides(result.slides);
|
|
4303
4311
|
markDirty();
|
|
@@ -4306,21 +4314,21 @@ function useSectionOperations(input) {
|
|
|
4306
4314
|
);
|
|
4307
4315
|
const moveSectionUp2 = react.useCallback(
|
|
4308
4316
|
(sectionId) => {
|
|
4309
|
-
setSections(
|
|
4317
|
+
setSections(chunkYBTRSG74_js.moveSectionUp(sections, sectionId));
|
|
4310
4318
|
markDirty();
|
|
4311
4319
|
},
|
|
4312
4320
|
[sections, setSections, markDirty]
|
|
4313
4321
|
);
|
|
4314
4322
|
const moveSectionDown2 = react.useCallback(
|
|
4315
4323
|
(sectionId) => {
|
|
4316
|
-
setSections(
|
|
4324
|
+
setSections(chunkYBTRSG74_js.moveSectionDown(sections, sectionId));
|
|
4317
4325
|
markDirty();
|
|
4318
4326
|
},
|
|
4319
4327
|
[sections, setSections, markDirty]
|
|
4320
4328
|
);
|
|
4321
4329
|
const moveSlidesToSection2 = react.useCallback(
|
|
4322
4330
|
(slideIndexes, targetSectionId) => {
|
|
4323
|
-
const result =
|
|
4331
|
+
const result = chunkYBTRSG74_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4324
4332
|
setSlides(result.slides);
|
|
4325
4333
|
setSections(result.sections);
|
|
4326
4334
|
markDirty();
|
|
@@ -4339,19 +4347,19 @@ function useSectionOperations(input) {
|
|
|
4339
4347
|
|
|
4340
4348
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4341
4349
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4342
|
-
const resized =
|
|
4350
|
+
const resized = chunkYBTRSG74_js.applyResize(
|
|
4343
4351
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4344
4352
|
handle,
|
|
4345
4353
|
dx,
|
|
4346
4354
|
dy,
|
|
4347
4355
|
1,
|
|
4348
|
-
{ minSize:
|
|
4356
|
+
{ minSize: chunkFHTEL3Q6_js.MIN_ELEMENT_SIZE }
|
|
4349
4357
|
);
|
|
4350
4358
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4351
4359
|
if (!snapToGrid) {
|
|
4352
4360
|
return box;
|
|
4353
4361
|
}
|
|
4354
|
-
return
|
|
4362
|
+
return chunkYBTRSG74_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkFHTEL3Q6_js.MIN_ELEMENT_SIZE);
|
|
4355
4363
|
}
|
|
4356
4364
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
4357
4365
|
const range = startWidth || 200;
|
|
@@ -4469,7 +4477,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4469
4477
|
width: el.width,
|
|
4470
4478
|
height: el.height
|
|
4471
4479
|
}));
|
|
4472
|
-
const snapResult =
|
|
4480
|
+
const snapResult = chunkYBTRSG74_js.computeSnapToShape(
|
|
4473
4481
|
targetX,
|
|
4474
4482
|
targetY,
|
|
4475
4483
|
primaryEl.width,
|
|
@@ -4508,7 +4516,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4508
4516
|
if (live) {
|
|
4509
4517
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4510
4518
|
const start = drag.startPositionsById[id];
|
|
4511
|
-
|
|
4519
|
+
chunkYBTRSG74_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4512
4520
|
x: start.x + appliedDx,
|
|
4513
4521
|
y: start.y + appliedDy
|
|
4514
4522
|
});
|
|
@@ -4542,15 +4550,15 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4542
4550
|
if (rs.domEl) {
|
|
4543
4551
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4544
4552
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4545
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4546
|
-
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`;
|
|
4547
4555
|
}
|
|
4548
4556
|
if (live) {
|
|
4549
|
-
|
|
4557
|
+
chunkYBTRSG74_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4550
4558
|
x: geo.x,
|
|
4551
4559
|
y: geo.y,
|
|
4552
|
-
width: Math.max(geo.width,
|
|
4553
|
-
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)
|
|
4554
4562
|
});
|
|
4555
4563
|
}
|
|
4556
4564
|
}
|
|
@@ -4630,13 +4638,13 @@ function processPointerUp(input) {
|
|
|
4630
4638
|
if (i !== activeSlideIndex) {
|
|
4631
4639
|
return s;
|
|
4632
4640
|
}
|
|
4633
|
-
const rerouted =
|
|
4641
|
+
const rerouted = chunkYBTRSG74_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4634
4642
|
if (rerouted.length === 0) {
|
|
4635
4643
|
return s;
|
|
4636
4644
|
}
|
|
4637
4645
|
return {
|
|
4638
4646
|
...s,
|
|
4639
|
-
elements:
|
|
4647
|
+
elements: chunkYBTRSG74_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4640
4648
|
};
|
|
4641
4649
|
})
|
|
4642
4650
|
);
|
|
@@ -4658,9 +4666,9 @@ function processPointerUp(input) {
|
|
|
4658
4666
|
}
|
|
4659
4667
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4660
4668
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4661
|
-
const hitIds =
|
|
4669
|
+
const hitIds = chunkYBTRSG74_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4662
4670
|
if (marquee.additive) {
|
|
4663
|
-
const merged =
|
|
4671
|
+
const merged = chunkYBTRSG74_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4664
4672
|
if (merged.length > 0) {
|
|
4665
4673
|
applySelection(merged[0], merged);
|
|
4666
4674
|
} else {
|
|
@@ -4683,8 +4691,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4683
4691
|
}
|
|
4684
4692
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4685
4693
|
});
|
|
4686
|
-
const rerouted =
|
|
4687
|
-
return
|
|
4694
|
+
const rerouted = chunkYBTRSG74_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4695
|
+
return chunkYBTRSG74_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4688
4696
|
};
|
|
4689
4697
|
if (editTemplateMode) {
|
|
4690
4698
|
const slideId = activeSlide?.id;
|
|
@@ -4840,9 +4848,9 @@ function useCanvasInteractions(input) {
|
|
|
4840
4848
|
return;
|
|
4841
4849
|
}
|
|
4842
4850
|
const el = elementLookup.get(editId);
|
|
4843
|
-
if (el &&
|
|
4851
|
+
if (el && chunkYBTRSG74_js.hasTextProperties(el)) {
|
|
4844
4852
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4845
|
-
const newSegments =
|
|
4853
|
+
const newSegments = chunkYBTRSG74_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4846
4854
|
ops.updateElementById(editId, {
|
|
4847
4855
|
text: committedText,
|
|
4848
4856
|
textSegments: newSegments
|
|
@@ -4853,7 +4861,7 @@ function useCanvasInteractions(input) {
|
|
|
4853
4861
|
setInlineEditingText("");
|
|
4854
4862
|
};
|
|
4855
4863
|
const openEquationEditorForElement = (el) => {
|
|
4856
|
-
if (!
|
|
4864
|
+
if (!chunkYBTRSG74_js.hasTextProperties(el)) {
|
|
4857
4865
|
return false;
|
|
4858
4866
|
}
|
|
4859
4867
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4882,7 +4890,7 @@ function useCanvasInteractions(input) {
|
|
|
4882
4890
|
justSelectedRef.current = false;
|
|
4883
4891
|
} else {
|
|
4884
4892
|
const el = elementLookup.get(elementId);
|
|
4885
|
-
if (el &&
|
|
4893
|
+
if (el && chunkYBTRSG74_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
4886
4894
|
if (!openEquationEditorForElement(el)) {
|
|
4887
4895
|
setInlineEditingElementId(elementId);
|
|
4888
4896
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4901,7 +4909,7 @@ function useCanvasInteractions(input) {
|
|
|
4901
4909
|
if (openEquationEditorForElement(el)) {
|
|
4902
4910
|
return;
|
|
4903
4911
|
}
|
|
4904
|
-
if (
|
|
4912
|
+
if (chunkYBTRSG74_js.hasTextProperties(el)) {
|
|
4905
4913
|
setInlineEditingElementId(elementId);
|
|
4906
4914
|
setInlineEditingText(el.text ?? "");
|
|
4907
4915
|
}
|
|
@@ -5094,7 +5102,7 @@ function createFileHandlers(deps) {
|
|
|
5094
5102
|
h = Math.round(h * scale);
|
|
5095
5103
|
}
|
|
5096
5104
|
addElement({
|
|
5097
|
-
id:
|
|
5105
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5098
5106
|
type: "image",
|
|
5099
5107
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5100
5108
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5105,7 +5113,7 @@ function createFileHandlers(deps) {
|
|
|
5105
5113
|
};
|
|
5106
5114
|
img.onerror = () => {
|
|
5107
5115
|
addElement({
|
|
5108
|
-
id:
|
|
5116
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5109
5117
|
type: "image",
|
|
5110
5118
|
x: 100,
|
|
5111
5119
|
y: 100,
|
|
@@ -5131,7 +5139,7 @@ function createFileHandlers(deps) {
|
|
|
5131
5139
|
const elFilePath = file.path;
|
|
5132
5140
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5133
5141
|
addElement({
|
|
5134
|
-
id:
|
|
5142
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5135
5143
|
type: "media",
|
|
5136
5144
|
mediaType,
|
|
5137
5145
|
mediaMimeType: file.type || void 0,
|
|
@@ -5306,13 +5314,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5306
5314
|
return;
|
|
5307
5315
|
}
|
|
5308
5316
|
addElement({
|
|
5309
|
-
id:
|
|
5317
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5310
5318
|
type: "smartArt",
|
|
5311
5319
|
x: 100,
|
|
5312
5320
|
y: 120,
|
|
5313
5321
|
width: 600,
|
|
5314
5322
|
height: 340,
|
|
5315
|
-
smartArtData:
|
|
5323
|
+
smartArtData: chunkYBTRSG74_js.buildSmartArtPresetData(
|
|
5316
5324
|
layout,
|
|
5317
5325
|
defaultItems,
|
|
5318
5326
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5324,7 +5332,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5324
5332
|
return;
|
|
5325
5333
|
}
|
|
5326
5334
|
addElement({
|
|
5327
|
-
id:
|
|
5335
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5328
5336
|
type: "shape",
|
|
5329
5337
|
x: 120,
|
|
5330
5338
|
y: 200,
|
|
@@ -5383,7 +5391,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5383
5391
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5384
5392
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5385
5393
|
addElement({
|
|
5386
|
-
id:
|
|
5394
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5387
5395
|
type: "shape",
|
|
5388
5396
|
x: 120,
|
|
5389
5397
|
y: 200,
|
|
@@ -5405,11 +5413,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5405
5413
|
if (!activeSlide) {
|
|
5406
5414
|
return;
|
|
5407
5415
|
}
|
|
5408
|
-
const preset =
|
|
5416
|
+
const preset = chunkYBTRSG74_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5409
5417
|
if (!preset) {
|
|
5410
5418
|
return;
|
|
5411
5419
|
}
|
|
5412
|
-
const defaultPptxAction =
|
|
5420
|
+
const defaultPptxAction = chunkYBTRSG74_js.elementActionToPptxAction({
|
|
5413
5421
|
trigger: "click",
|
|
5414
5422
|
type: preset.defaultAction
|
|
5415
5423
|
});
|
|
@@ -5418,7 +5426,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5418
5426
|
defaultPptxAction.highlightClick = true;
|
|
5419
5427
|
}
|
|
5420
5428
|
addElement({
|
|
5421
|
-
id:
|
|
5429
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5422
5430
|
type: "shape",
|
|
5423
5431
|
x: 150,
|
|
5424
5432
|
y: 150,
|
|
@@ -5485,14 +5493,14 @@ function useInsertElements(input) {
|
|
|
5485
5493
|
return;
|
|
5486
5494
|
}
|
|
5487
5495
|
addElement({
|
|
5488
|
-
id:
|
|
5496
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5489
5497
|
type: "text",
|
|
5490
5498
|
x: 100,
|
|
5491
5499
|
y: 100,
|
|
5492
5500
|
width: 300,
|
|
5493
5501
|
height: 60,
|
|
5494
5502
|
text: "",
|
|
5495
|
-
textStyle: { fontSize:
|
|
5503
|
+
textStyle: { fontSize: chunkFHTEL3Q6_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5496
5504
|
});
|
|
5497
5505
|
};
|
|
5498
5506
|
const handleAddShape = () => {
|
|
@@ -5500,7 +5508,7 @@ function useInsertElements(input) {
|
|
|
5500
5508
|
return;
|
|
5501
5509
|
}
|
|
5502
5510
|
addElement({
|
|
5503
|
-
id:
|
|
5511
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5504
5512
|
type: "shape",
|
|
5505
5513
|
x: 150,
|
|
5506
5514
|
y: 150,
|
|
@@ -5519,15 +5527,15 @@ function useInsertElements(input) {
|
|
|
5519
5527
|
return;
|
|
5520
5528
|
}
|
|
5521
5529
|
addElement({
|
|
5522
|
-
...
|
|
5523
|
-
id:
|
|
5530
|
+
...chunkYBTRSG74_js.newTableElement(chunkFHTEL3Q6_js.DEFAULT_TABLE_ROWS, chunkFHTEL3Q6_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5531
|
+
id: chunkYBTRSG74_js.generateElementId()
|
|
5524
5532
|
});
|
|
5525
5533
|
};
|
|
5526
5534
|
const handleAddChart = (chartKind) => {
|
|
5527
5535
|
if (!activeSlide) {
|
|
5528
5536
|
return;
|
|
5529
5537
|
}
|
|
5530
|
-
addElement(
|
|
5538
|
+
addElement(chunkYBTRSG74_js.createDefaultChartElement(chartKind));
|
|
5531
5539
|
};
|
|
5532
5540
|
const structured = createStructuredElementHandlers({
|
|
5533
5541
|
activeSlide,
|
|
@@ -5597,7 +5605,7 @@ function useClipboardHandlers(input) {
|
|
|
5597
5605
|
if (!selectedElement) {
|
|
5598
5606
|
return;
|
|
5599
5607
|
}
|
|
5600
|
-
setClipboardPayload(
|
|
5608
|
+
setClipboardPayload(chunkYBTRSG74_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5601
5609
|
};
|
|
5602
5610
|
const handleDelete = () => {
|
|
5603
5611
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5614,7 +5622,7 @@ function useClipboardHandlers(input) {
|
|
|
5614
5622
|
handleDelete();
|
|
5615
5623
|
};
|
|
5616
5624
|
const insertClone = (source) => {
|
|
5617
|
-
const clone =
|
|
5625
|
+
const clone = chunkYBTRSG74_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5618
5626
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5619
5627
|
ops.applySelection(clone.id);
|
|
5620
5628
|
history.markDirty();
|
|
@@ -5649,7 +5657,7 @@ function resolveShapePath(el) {
|
|
|
5649
5657
|
return el.pathData;
|
|
5650
5658
|
}
|
|
5651
5659
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5652
|
-
const clipPath =
|
|
5660
|
+
const clipPath = chunkYBTRSG74_js.getPresetShapeClipPath(el.shapeType);
|
|
5653
5661
|
if (clipPath) {
|
|
5654
5662
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5655
5663
|
if (svgPath) {
|
|
@@ -5700,7 +5708,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5700
5708
|
return parts.join(" ");
|
|
5701
5709
|
}
|
|
5702
5710
|
function transformPathToGlobal(pathData, el) {
|
|
5703
|
-
const polys =
|
|
5711
|
+
const polys = chunkYBTRSG74_js.svgPathToPolygons(pathData);
|
|
5704
5712
|
if (polys.length === 0) {
|
|
5705
5713
|
return pathData;
|
|
5706
5714
|
}
|
|
@@ -5720,10 +5728,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5720
5728
|
y: pt.y * scaleY + el.y
|
|
5721
5729
|
}))
|
|
5722
5730
|
);
|
|
5723
|
-
return
|
|
5731
|
+
return chunkYBTRSG74_js.polygonsToSvgPath(transformed);
|
|
5724
5732
|
}
|
|
5725
5733
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5726
|
-
const polys =
|
|
5734
|
+
const polys = chunkYBTRSG74_js.svgPathToPolygons(pathData);
|
|
5727
5735
|
if (polys.length === 0) {
|
|
5728
5736
|
return pathData;
|
|
5729
5737
|
}
|
|
@@ -5733,10 +5741,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5733
5741
|
y: pt.y - y
|
|
5734
5742
|
}))
|
|
5735
5743
|
);
|
|
5736
|
-
return
|
|
5744
|
+
return chunkYBTRSG74_js.polygonsToSvgPath(transformed);
|
|
5737
5745
|
}
|
|
5738
5746
|
function pathBounds(pathData) {
|
|
5739
|
-
const polys =
|
|
5747
|
+
const polys = chunkYBTRSG74_js.svgPathToPolygons(pathData);
|
|
5740
5748
|
let minX = Infinity;
|
|
5741
5749
|
let minY = Infinity;
|
|
5742
5750
|
let maxX = -Infinity;
|
|
@@ -5795,7 +5803,7 @@ function useMergeShapesHandler(input) {
|
|
|
5795
5803
|
let allFragments = [];
|
|
5796
5804
|
let remaining = globalPaths[0];
|
|
5797
5805
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5798
|
-
const frags =
|
|
5806
|
+
const frags = chunkYBTRSG74_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5799
5807
|
if (Array.isArray(frags)) {
|
|
5800
5808
|
allFragments = frags;
|
|
5801
5809
|
}
|
|
@@ -5824,7 +5832,7 @@ function useMergeShapesHandler(input) {
|
|
|
5824
5832
|
bounds.height
|
|
5825
5833
|
);
|
|
5826
5834
|
const newEl = {
|
|
5827
|
-
id:
|
|
5835
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5828
5836
|
type: "shape",
|
|
5829
5837
|
x: bounds.x,
|
|
5830
5838
|
y: bounds.y,
|
|
@@ -5862,7 +5870,7 @@ function useMergeShapesHandler(input) {
|
|
|
5862
5870
|
} else {
|
|
5863
5871
|
let resultPath = globalPaths[0];
|
|
5864
5872
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5865
|
-
const result =
|
|
5873
|
+
const result = chunkYBTRSG74_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5866
5874
|
if (typeof result === "string") {
|
|
5867
5875
|
resultPath = result;
|
|
5868
5876
|
}
|
|
@@ -5883,7 +5891,7 @@ function useMergeShapesHandler(input) {
|
|
|
5883
5891
|
);
|
|
5884
5892
|
const primary = targets[0];
|
|
5885
5893
|
const newEl = {
|
|
5886
|
-
id:
|
|
5894
|
+
id: chunkYBTRSG74_js.generateElementId(),
|
|
5887
5895
|
type: "shape",
|
|
5888
5896
|
x: bounds.x,
|
|
5889
5897
|
y: bounds.y,
|
|
@@ -5946,7 +5954,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5946
5954
|
if (ids.length < 2 || !activeSlide) {
|
|
5947
5955
|
return;
|
|
5948
5956
|
}
|
|
5949
|
-
const { elements, groupId } =
|
|
5957
|
+
const { elements, groupId } = chunkYBTRSG74_js.groupElements(ops.activeElements, ids, chunkYBTRSG74_js.generateElementId());
|
|
5950
5958
|
if (groupId === null) {
|
|
5951
5959
|
return;
|
|
5952
5960
|
}
|
|
@@ -5959,12 +5967,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5959
5967
|
return;
|
|
5960
5968
|
}
|
|
5961
5969
|
const group = selectedElement;
|
|
5962
|
-
const intoTemplate =
|
|
5970
|
+
const intoTemplate = chunkYBTRSG74_js.isTemplateElementId(group.id);
|
|
5963
5971
|
const ungrouped = group.children.map((child) => ({
|
|
5964
5972
|
...structuredClone(child),
|
|
5965
5973
|
// Keep child ids in the same store as the group so later edits route
|
|
5966
5974
|
// correctly: template groups yield template-prefixed child ids.
|
|
5967
|
-
id: intoTemplate ?
|
|
5975
|
+
id: intoTemplate ? chunkYBTRSG74_js.makeCloneId(true, child.id || group.id) : child.id || chunkYBTRSG74_js.generateElementId(),
|
|
5968
5976
|
x: child.x + group.x,
|
|
5969
5977
|
y: child.y + group.y
|
|
5970
5978
|
}));
|
|
@@ -5988,7 +5996,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5988
5996
|
if (!edge) {
|
|
5989
5997
|
return;
|
|
5990
5998
|
}
|
|
5991
|
-
const positions =
|
|
5999
|
+
const positions = chunkYBTRSG74_js.alignElements(selectedElements, edge);
|
|
5992
6000
|
for (const [id, pos] of positions) {
|
|
5993
6001
|
const el = elementLookup.get(id);
|
|
5994
6002
|
if (!el) {
|
|
@@ -6006,7 +6014,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6006
6014
|
if (!distAxis) {
|
|
6007
6015
|
return;
|
|
6008
6016
|
}
|
|
6009
|
-
const positions =
|
|
6017
|
+
const positions = chunkYBTRSG74_js.distributeElements(selectedElements, distAxis);
|
|
6010
6018
|
for (const [id, pos] of positions) {
|
|
6011
6019
|
const el = elementLookup.get(id);
|
|
6012
6020
|
if (!el) {
|
|
@@ -6023,7 +6031,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6023
6031
|
}
|
|
6024
6032
|
const id = selectedElement.id;
|
|
6025
6033
|
ops.updateActiveElements(
|
|
6026
|
-
(els) => direction === "forward" ?
|
|
6034
|
+
(els) => direction === "forward" ? chunkYBTRSG74_js.bringForward(els, id) : direction === "backward" ? chunkYBTRSG74_js.sendBackward(els, id) : els
|
|
6027
6035
|
);
|
|
6028
6036
|
history.markDirty();
|
|
6029
6037
|
};
|
|
@@ -6033,7 +6041,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6033
6041
|
}
|
|
6034
6042
|
const id = selectedElement.id;
|
|
6035
6043
|
ops.updateActiveElements(
|
|
6036
|
-
(els) => direction === "front" ?
|
|
6044
|
+
(els) => direction === "front" ? chunkYBTRSG74_js.bringToFront(els, id) : chunkYBTRSG74_js.sendToBack(els, id)
|
|
6037
6045
|
);
|
|
6038
6046
|
history.markDirty();
|
|
6039
6047
|
};
|
|
@@ -6164,7 +6172,7 @@ function useSlideManagement(input) {
|
|
|
6164
6172
|
theme
|
|
6165
6173
|
} = input;
|
|
6166
6174
|
const handleAddSlide = () => {
|
|
6167
|
-
const newSlide =
|
|
6175
|
+
const newSlide = chunkYBTRSG74_js.createBlankSlide(slides.length + 1);
|
|
6168
6176
|
ops.updateSlides((prev) => {
|
|
6169
6177
|
const next = [...prev];
|
|
6170
6178
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6227,7 +6235,7 @@ function useSlideManagement(input) {
|
|
|
6227
6235
|
}
|
|
6228
6236
|
const clone = {
|
|
6229
6237
|
...src,
|
|
6230
|
-
id:
|
|
6238
|
+
id: chunkYBTRSG74_js.makeSlideId(),
|
|
6231
6239
|
elements: src.elements.map((el) => ({
|
|
6232
6240
|
...el,
|
|
6233
6241
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6259,7 +6267,7 @@ function useSlideManagement(input) {
|
|
|
6259
6267
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6260
6268
|
const insertAt = activeSlideIndex + 1;
|
|
6261
6269
|
const draft = {
|
|
6262
|
-
...
|
|
6270
|
+
...chunkYBTRSG74_js.createBlankSlide(slides.length + 1),
|
|
6263
6271
|
layoutPath,
|
|
6264
6272
|
...layoutName ? { layoutName } : {}
|
|
6265
6273
|
};
|
|
@@ -6292,9 +6300,9 @@ function useSlideManagement(input) {
|
|
|
6292
6300
|
};
|
|
6293
6301
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6294
6302
|
const insertAt = activeSlideIndex + 1;
|
|
6295
|
-
const draft =
|
|
6303
|
+
const draft = chunkYBTRSG74_js.buildSlideTemplateSlide(templateId, chunkYBTRSG74_js.makeSlideId(), slides.length + 1, {
|
|
6296
6304
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6297
|
-
scheme:
|
|
6305
|
+
scheme: chunkYBTRSG74_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6298
6306
|
});
|
|
6299
6307
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6300
6308
|
setActiveSlideIndex(insertAt);
|
|
@@ -6331,7 +6339,7 @@ function createTableMergeHandlers(input) {
|
|
|
6331
6339
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6332
6340
|
return;
|
|
6333
6341
|
}
|
|
6334
|
-
const newTableData =
|
|
6342
|
+
const newTableData = chunkYBTRSG74_js.mergeCells(
|
|
6335
6343
|
[
|
|
6336
6344
|
{ row: rowIndex, col: columnIndex },
|
|
6337
6345
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6339,7 +6347,7 @@ function createTableMergeHandlers(input) {
|
|
|
6339
6347
|
td
|
|
6340
6348
|
);
|
|
6341
6349
|
const updates = { tableData: newTableData };
|
|
6342
|
-
const newRawXml =
|
|
6350
|
+
const newRawXml = chunkYBTRSG74_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6343
6351
|
if (newRawXml) {
|
|
6344
6352
|
updates.rawXml = newRawXml;
|
|
6345
6353
|
}
|
|
@@ -6365,7 +6373,7 @@ function createTableMergeHandlers(input) {
|
|
|
6365
6373
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6366
6374
|
return;
|
|
6367
6375
|
}
|
|
6368
|
-
const newTableData =
|
|
6376
|
+
const newTableData = chunkYBTRSG74_js.mergeCells(
|
|
6369
6377
|
[
|
|
6370
6378
|
{ row: rowIndex, col: columnIndex },
|
|
6371
6379
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6373,7 +6381,7 @@ function createTableMergeHandlers(input) {
|
|
|
6373
6381
|
td
|
|
6374
6382
|
);
|
|
6375
6383
|
const updates = { tableData: newTableData };
|
|
6376
|
-
const newRawXml =
|
|
6384
|
+
const newRawXml = chunkYBTRSG74_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6377
6385
|
if (newRawXml) {
|
|
6378
6386
|
updates.rawXml = newRawXml;
|
|
6379
6387
|
}
|
|
@@ -6388,9 +6396,9 @@ function createTableMergeHandlers(input) {
|
|
|
6388
6396
|
return;
|
|
6389
6397
|
}
|
|
6390
6398
|
const td = selectedElement.tableData;
|
|
6391
|
-
const newTableData =
|
|
6399
|
+
const newTableData = chunkYBTRSG74_js.mergeCells(ts.selectedCells, td);
|
|
6392
6400
|
const updates = { tableData: newTableData };
|
|
6393
|
-
const newRawXml =
|
|
6401
|
+
const newRawXml = chunkYBTRSG74_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6394
6402
|
if (newRawXml) {
|
|
6395
6403
|
updates.rawXml = newRawXml;
|
|
6396
6404
|
}
|
|
@@ -6407,9 +6415,9 @@ function createTableMergeHandlers(input) {
|
|
|
6407
6415
|
}
|
|
6408
6416
|
const { rowIndex, columnIndex } = ts;
|
|
6409
6417
|
const td = selectedElement.tableData;
|
|
6410
|
-
const newTableData =
|
|
6418
|
+
const newTableData = chunkYBTRSG74_js.splitCell(rowIndex, columnIndex, td);
|
|
6411
6419
|
const updates = { tableData: newTableData };
|
|
6412
|
-
const newRawXml =
|
|
6420
|
+
const newRawXml = chunkYBTRSG74_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6413
6421
|
if (newRawXml) {
|
|
6414
6422
|
updates.rawXml = newRawXml;
|
|
6415
6423
|
}
|
|
@@ -6453,7 +6461,7 @@ function createTableStructHandlers(input) {
|
|
|
6453
6461
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
6454
6462
|
}
|
|
6455
6463
|
if (el.rawXml) {
|
|
6456
|
-
const newRawXml =
|
|
6464
|
+
const newRawXml = chunkYBTRSG74_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6457
6465
|
if (newRawXml) {
|
|
6458
6466
|
updates.rawXml = newRawXml;
|
|
6459
6467
|
}
|
|
@@ -6477,7 +6485,7 @@ function createTableStructHandlers(input) {
|
|
|
6477
6485
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6478
6486
|
const updates = {};
|
|
6479
6487
|
if (selectedElement.rawXml) {
|
|
6480
|
-
const newRawXml =
|
|
6488
|
+
const newRawXml = chunkYBTRSG74_js.updateCellTextStyleInRawXml(
|
|
6481
6489
|
selectedElement,
|
|
6482
6490
|
rowIndex,
|
|
6483
6491
|
colIndex,
|
|
@@ -6541,9 +6549,9 @@ function createTableStructHandlers(input) {
|
|
|
6541
6549
|
return;
|
|
6542
6550
|
}
|
|
6543
6551
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6544
|
-
const newTableData =
|
|
6552
|
+
const newTableData = chunkYBTRSG74_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6545
6553
|
const updates = { tableData: newTableData };
|
|
6546
|
-
const newRawXml =
|
|
6554
|
+
const newRawXml = chunkYBTRSG74_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6547
6555
|
if (newRawXml) {
|
|
6548
6556
|
updates.rawXml = newRawXml;
|
|
6549
6557
|
}
|
|
@@ -6556,12 +6564,12 @@ function createTableStructHandlers(input) {
|
|
|
6556
6564
|
}
|
|
6557
6565
|
const td = selectedElement.tableData;
|
|
6558
6566
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6559
|
-
const newTableData =
|
|
6567
|
+
const newTableData = chunkYBTRSG74_js.deleteTableRow(td, rowIdx);
|
|
6560
6568
|
if (newTableData === td) {
|
|
6561
6569
|
return;
|
|
6562
6570
|
}
|
|
6563
6571
|
const updates = { tableData: newTableData };
|
|
6564
|
-
const newRawXml =
|
|
6572
|
+
const newRawXml = chunkYBTRSG74_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6565
6573
|
if (newRawXml) {
|
|
6566
6574
|
updates.rawXml = newRawXml;
|
|
6567
6575
|
}
|
|
@@ -6573,9 +6581,9 @@ function createTableStructHandlers(input) {
|
|
|
6573
6581
|
return;
|
|
6574
6582
|
}
|
|
6575
6583
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6576
|
-
const newTableData =
|
|
6584
|
+
const newTableData = chunkYBTRSG74_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6577
6585
|
const updates = { tableData: newTableData };
|
|
6578
|
-
const newRawXml =
|
|
6586
|
+
const newRawXml = chunkYBTRSG74_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6579
6587
|
if (newRawXml) {
|
|
6580
6588
|
updates.rawXml = newRawXml;
|
|
6581
6589
|
}
|
|
@@ -6588,12 +6596,12 @@ function createTableStructHandlers(input) {
|
|
|
6588
6596
|
}
|
|
6589
6597
|
const td = selectedElement.tableData;
|
|
6590
6598
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6591
|
-
const newTableData =
|
|
6599
|
+
const newTableData = chunkYBTRSG74_js.deleteTableColumn(td, colIdx);
|
|
6592
6600
|
if (newTableData === td) {
|
|
6593
6601
|
return;
|
|
6594
6602
|
}
|
|
6595
6603
|
const updates = { tableData: newTableData };
|
|
6596
|
-
const newRawXml =
|
|
6604
|
+
const newRawXml = chunkYBTRSG74_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6597
6605
|
if (newRawXml) {
|
|
6598
6606
|
updates.rawXml = newRawXml;
|
|
6599
6607
|
}
|
|
@@ -6629,8 +6637,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6629
6637
|
return html2canvasPro(element, {
|
|
6630
6638
|
...options,
|
|
6631
6639
|
onclone: async (doc, clonedEl) => {
|
|
6632
|
-
await
|
|
6633
|
-
|
|
6640
|
+
await chunkYBTRSG74_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6641
|
+
chunkYBTRSG74_js.preprocessCssForCapture(clonedEl);
|
|
6634
6642
|
if (typeof userOnClone === "function") {
|
|
6635
6643
|
userOnClone(doc, clonedEl);
|
|
6636
6644
|
}
|
|
@@ -6686,7 +6694,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6686
6694
|
}
|
|
6687
6695
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6688
6696
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6689
|
-
|
|
6697
|
+
chunkYBTRSG74_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6690
6698
|
}
|
|
6691
6699
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6692
6700
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6708,15 +6716,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6708
6716
|
continue;
|
|
6709
6717
|
}
|
|
6710
6718
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6711
|
-
images.push(
|
|
6719
|
+
images.push(chunkYBTRSG74_js.canvasToJpegData(canvas));
|
|
6712
6720
|
}
|
|
6713
6721
|
onProgress?.(totalSlides, totalSlides);
|
|
6714
6722
|
setActiveSlide(currentSlideIndex);
|
|
6715
6723
|
if (images.length === 0) {
|
|
6716
6724
|
throw new Error(chunk3ISYPBSX_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6717
6725
|
}
|
|
6718
|
-
const pdfBlobUrl =
|
|
6719
|
-
|
|
6726
|
+
const pdfBlobUrl = chunkFHTEL3Q6_js.buildPdfFromImageData(images);
|
|
6727
|
+
chunkYBTRSG74_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6720
6728
|
}
|
|
6721
6729
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6722
6730
|
const { scale = 2, onProgress } = options;
|
|
@@ -6764,8 +6772,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6764
6772
|
if (pages.length === 0) {
|
|
6765
6773
|
throw new Error(chunk3ISYPBSX_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6766
6774
|
}
|
|
6767
|
-
const pdfDataUrl =
|
|
6768
|
-
|
|
6775
|
+
const pdfDataUrl = chunkFHTEL3Q6_js.buildNotesPdf(pages);
|
|
6776
|
+
chunkYBTRSG74_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6769
6777
|
}
|
|
6770
6778
|
|
|
6771
6779
|
// src/viewer/utils/export-video.ts
|
|
@@ -6809,7 +6817,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6809
6817
|
const fps = 30;
|
|
6810
6818
|
const stream = recordingCanvas.captureStream(fps);
|
|
6811
6819
|
const recorder = new MediaRecorder(stream, {
|
|
6812
|
-
mimeType:
|
|
6820
|
+
mimeType: chunkYBTRSG74_js.pickSupportedMimeType([...chunkYBTRSG74_js.WEBM_MIME_CANDIDATES]),
|
|
6813
6821
|
videoBitsPerSecond: 5e6
|
|
6814
6822
|
});
|
|
6815
6823
|
const chunks = [];
|
|
@@ -6832,8 +6840,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6832
6840
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6833
6841
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6834
6842
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6835
|
-
const frameInterval =
|
|
6836
|
-
const framesNeeded =
|
|
6843
|
+
const frameInterval = chunkYBTRSG74_js.fpsToFrameIntervalMs(fps);
|
|
6844
|
+
const framesNeeded = chunkYBTRSG74_js.segmentFrameCount(duration, fps);
|
|
6837
6845
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6838
6846
|
if (signal?.aborted) {
|
|
6839
6847
|
recorder.stop();
|
|
@@ -6882,7 +6890,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6882
6890
|
if (frames.length === 0) {
|
|
6883
6891
|
throw new Error(chunk3ISYPBSX_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6884
6892
|
}
|
|
6885
|
-
const gifBytes =
|
|
6893
|
+
const gifBytes = chunkYBTRSG74_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6886
6894
|
onProgress?.(totalSlides, totalSlides);
|
|
6887
6895
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6888
6896
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6936,7 +6944,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6936
6944
|
continue;
|
|
6937
6945
|
}
|
|
6938
6946
|
onProgress?.(processedCount, data.slides.length);
|
|
6939
|
-
let svg =
|
|
6947
|
+
let svg = chunkYBTRSG74_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6940
6948
|
if (embedFonts && fontFaces?.length) {
|
|
6941
6949
|
svg = injectFontFaces(svg, fontFaces);
|
|
6942
6950
|
}
|
|
@@ -6998,7 +7006,7 @@ function useExportSaveAs(input) {
|
|
|
6998
7006
|
}
|
|
6999
7007
|
setExportProgress(70);
|
|
7000
7008
|
setExportStatusMessage("Writing README...");
|
|
7001
|
-
const readme =
|
|
7009
|
+
const readme = chunkYBTRSG74_js.generatePackageReadme(pptxFilename);
|
|
7002
7010
|
pkgFolder.file("README.txt", readme);
|
|
7003
7011
|
if (abortCtrl.signal.aborted) {
|
|
7004
7012
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -7009,7 +7017,7 @@ function useExportSaveAs(input) {
|
|
|
7009
7017
|
setExportProgress(95);
|
|
7010
7018
|
setExportStatusMessage("Downloading...");
|
|
7011
7019
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
7012
|
-
|
|
7020
|
+
chunkYBTRSG74_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
7013
7021
|
setExportProgress(100);
|
|
7014
7022
|
} catch (err) {
|
|
7015
7023
|
if (err.name !== "AbortError") {
|
|
@@ -7032,7 +7040,7 @@ function useExportSaveAs(input) {
|
|
|
7032
7040
|
const blob = new Blob([data], {
|
|
7033
7041
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
7034
7042
|
});
|
|
7035
|
-
|
|
7043
|
+
chunkYBTRSG74_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
7036
7044
|
} catch (err) {
|
|
7037
7045
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
7038
7046
|
}
|
|
@@ -7045,14 +7053,14 @@ function useExportSaveAs(input) {
|
|
|
7045
7053
|
const pptxGuides = guides.map((g) => ({
|
|
7046
7054
|
id: g.id,
|
|
7047
7055
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7048
|
-
positionEmu:
|
|
7056
|
+
positionEmu: chunkYBTRSG74_js.guidePxToEmu(g.position)
|
|
7049
7057
|
}));
|
|
7050
7058
|
return {
|
|
7051
7059
|
...slide,
|
|
7052
7060
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7053
7061
|
};
|
|
7054
7062
|
});
|
|
7055
|
-
const slidesToSave =
|
|
7063
|
+
const slidesToSave = chunkFHTEL3Q6_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7056
7064
|
const saveOptions = {
|
|
7057
7065
|
headerFooter,
|
|
7058
7066
|
presentationProperties,
|
|
@@ -7078,11 +7086,11 @@ function useExportSaveAs(input) {
|
|
|
7078
7086
|
const handleExportJson = () => {
|
|
7079
7087
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7080
7088
|
const data = {
|
|
7081
|
-
slides:
|
|
7089
|
+
slides: chunkFHTEL3Q6_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7082
7090
|
width: canvasSize.width,
|
|
7083
7091
|
height: canvasSize.height,
|
|
7084
|
-
widthEmu:
|
|
7085
|
-
heightEmu:
|
|
7092
|
+
widthEmu: chunkYBTRSG74_js.guidePxToEmu(canvasSize.width),
|
|
7093
|
+
heightEmu: chunkYBTRSG74_js.guidePxToEmu(canvasSize.height),
|
|
7086
7094
|
theme,
|
|
7087
7095
|
headerFooter,
|
|
7088
7096
|
presentationProperties,
|
|
@@ -7096,7 +7104,7 @@ function useExportSaveAs(input) {
|
|
|
7096
7104
|
handoutMaster
|
|
7097
7105
|
};
|
|
7098
7106
|
try {
|
|
7099
|
-
|
|
7107
|
+
chunkYBTRSG74_js.exportDeckJson(data, sourceName);
|
|
7100
7108
|
} catch (err) {
|
|
7101
7109
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7102
7110
|
}
|
|
@@ -7136,7 +7144,7 @@ function safeConfirm(message) {
|
|
|
7136
7144
|
}
|
|
7137
7145
|
}
|
|
7138
7146
|
function downloadBlob2(blob, filename) {
|
|
7139
|
-
|
|
7147
|
+
chunkYBTRSG74_js.downloadBlob(blob, chunkYBTRSG74_js.sanitizeDownloadFilename(filename));
|
|
7140
7148
|
}
|
|
7141
7149
|
|
|
7142
7150
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7242,21 +7250,21 @@ function useExportHandlers(input) {
|
|
|
7242
7250
|
{
|
|
7243
7251
|
scale: 2,
|
|
7244
7252
|
onProgress: (current, total) => {
|
|
7245
|
-
setExportProgress(
|
|
7246
|
-
setExportStatusMessage(
|
|
7253
|
+
setExportProgress(chunkYBTRSG74_js.slideProgressPercent(current, total));
|
|
7254
|
+
setExportStatusMessage(chunkYBTRSG74_js.slideStatusLabel("Rendering", current, total));
|
|
7247
7255
|
},
|
|
7248
7256
|
signal: abortCtrl.signal
|
|
7249
7257
|
}
|
|
7250
7258
|
);
|
|
7251
|
-
setExportProgress(
|
|
7259
|
+
setExportProgress(chunkYBTRSG74_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7252
7260
|
setExportStatusMessage("Building PDF...");
|
|
7253
7261
|
await new Promise((r) => {
|
|
7254
7262
|
setTimeout(r, 100);
|
|
7255
7263
|
});
|
|
7256
|
-
setExportProgress(
|
|
7264
|
+
setExportProgress(chunkYBTRSG74_js.EXPORT_DONE_PERCENT);
|
|
7257
7265
|
setExportStatusMessage("Done!");
|
|
7258
7266
|
} catch (err) {
|
|
7259
|
-
if (!
|
|
7267
|
+
if (!chunkYBTRSG74_js.isExportAbortError(err)) {
|
|
7260
7268
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7261
7269
|
}
|
|
7262
7270
|
} finally {
|
|
@@ -7286,21 +7294,21 @@ function useExportHandlers(input) {
|
|
|
7286
7294
|
{
|
|
7287
7295
|
scale: 2,
|
|
7288
7296
|
onProgress: (current, total) => {
|
|
7289
|
-
setExportProgress(
|
|
7290
|
-
setExportStatusMessage(
|
|
7297
|
+
setExportProgress(chunkYBTRSG74_js.slideProgressPercent(current, total));
|
|
7298
|
+
setExportStatusMessage(chunkYBTRSG74_js.slideStatusLabel("Rendering", current, total));
|
|
7291
7299
|
},
|
|
7292
7300
|
signal: abortCtrl.signal
|
|
7293
7301
|
}
|
|
7294
7302
|
);
|
|
7295
|
-
setExportProgress(
|
|
7303
|
+
setExportProgress(chunkYBTRSG74_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7296
7304
|
setExportStatusMessage("Building PDF...");
|
|
7297
7305
|
await new Promise((r) => {
|
|
7298
7306
|
setTimeout(r, 100);
|
|
7299
7307
|
});
|
|
7300
|
-
setExportProgress(
|
|
7308
|
+
setExportProgress(chunkYBTRSG74_js.EXPORT_DONE_PERCENT);
|
|
7301
7309
|
setExportStatusMessage("Done!");
|
|
7302
7310
|
} catch (err) {
|
|
7303
|
-
if (!
|
|
7311
|
+
if (!chunkYBTRSG74_js.isExportAbortError(err)) {
|
|
7304
7312
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7305
7313
|
}
|
|
7306
7314
|
} finally {
|
|
@@ -7341,22 +7349,22 @@ function useExportHandlers(input) {
|
|
|
7341
7349
|
scale: 1,
|
|
7342
7350
|
slideDurationMs: 3e3,
|
|
7343
7351
|
onProgress: (current, total) => {
|
|
7344
|
-
setExportProgress(
|
|
7345
|
-
setExportStatusMessage(
|
|
7352
|
+
setExportProgress(chunkYBTRSG74_js.slideProgressPercent(current, total, 45));
|
|
7353
|
+
setExportStatusMessage(chunkYBTRSG74_js.slideStatusLabel("Capturing", current, total));
|
|
7346
7354
|
},
|
|
7347
7355
|
onRecordProgress: (current, total) => {
|
|
7348
|
-
setExportProgress(
|
|
7349
|
-
setExportStatusMessage(
|
|
7356
|
+
setExportProgress(chunkYBTRSG74_js.recordProgressPercent(current, total));
|
|
7357
|
+
setExportStatusMessage(chunkYBTRSG74_js.slideStatusLabel("Recording", current, total));
|
|
7350
7358
|
},
|
|
7351
7359
|
signal: abortCtrl.signal
|
|
7352
7360
|
}
|
|
7353
7361
|
);
|
|
7354
|
-
setExportProgress(
|
|
7362
|
+
setExportProgress(chunkYBTRSG74_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7355
7363
|
setExportStatusMessage("Saving file...");
|
|
7356
7364
|
downloadBlob2(blob, "presentation.webm");
|
|
7357
|
-
setExportProgress(
|
|
7365
|
+
setExportProgress(chunkYBTRSG74_js.EXPORT_DONE_PERCENT);
|
|
7358
7366
|
} catch (err) {
|
|
7359
|
-
if (!
|
|
7367
|
+
if (!chunkYBTRSG74_js.isExportAbortError(err)) {
|
|
7360
7368
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7361
7369
|
}
|
|
7362
7370
|
} finally {
|
|
@@ -7384,18 +7392,18 @@ function useExportHandlers(input) {
|
|
|
7384
7392
|
scale: 0.5,
|
|
7385
7393
|
slideDurationMs: 2e3,
|
|
7386
7394
|
onProgress: (current, total) => {
|
|
7387
|
-
setExportProgress(
|
|
7388
|
-
setExportStatusMessage(
|
|
7395
|
+
setExportProgress(chunkYBTRSG74_js.slideProgressPercent(current, total));
|
|
7396
|
+
setExportStatusMessage(chunkYBTRSG74_js.slideStatusLabel("Encoding", current, total));
|
|
7389
7397
|
},
|
|
7390
7398
|
signal: abortCtrl.signal
|
|
7391
7399
|
}
|
|
7392
7400
|
);
|
|
7393
|
-
setExportProgress(
|
|
7401
|
+
setExportProgress(chunkYBTRSG74_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7394
7402
|
setExportStatusMessage("Saving file...");
|
|
7395
7403
|
downloadBlob2(blob, "presentation.gif");
|
|
7396
|
-
setExportProgress(
|
|
7404
|
+
setExportProgress(chunkYBTRSG74_js.EXPORT_DONE_PERCENT);
|
|
7397
7405
|
} catch (err) {
|
|
7398
|
-
if (!
|
|
7406
|
+
if (!chunkYBTRSG74_js.isExportAbortError(err)) {
|
|
7399
7407
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7400
7408
|
}
|
|
7401
7409
|
} finally {
|
|
@@ -7436,7 +7444,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7436
7444
|
}
|
|
7437
7445
|
printWindow.document.open();
|
|
7438
7446
|
printWindow.document.write(
|
|
7439
|
-
|
|
7447
|
+
chunkYBTRSG74_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7440
7448
|
);
|
|
7441
7449
|
printWindow.document.close();
|
|
7442
7450
|
printWindow.focus();
|
|
@@ -7497,7 +7505,7 @@ function usePrintHandlers(input) {
|
|
|
7497
7505
|
if (svgs.length === 0) {
|
|
7498
7506
|
return;
|
|
7499
7507
|
}
|
|
7500
|
-
const printDoc =
|
|
7508
|
+
const printDoc = chunkYBTRSG74_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7501
7509
|
title: "Slides (Vector)",
|
|
7502
7510
|
orientation: settings.orientation,
|
|
7503
7511
|
colorFilter
|
|
@@ -7533,7 +7541,7 @@ function usePrintHandlers(input) {
|
|
|
7533
7541
|
if (settings.printWhat === "outline") {
|
|
7534
7542
|
openPrintWindow(
|
|
7535
7543
|
"Outline",
|
|
7536
|
-
`<div class="outline-page">${
|
|
7544
|
+
`<div class="outline-page">${chunkYBTRSG74_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7537
7545
|
settings.orientation,
|
|
7538
7546
|
colorFilter,
|
|
7539
7547
|
settings.frameSlides
|
|
@@ -7558,7 +7566,7 @@ function usePrintHandlers(input) {
|
|
|
7558
7566
|
if (settings.printWhat === "slides") {
|
|
7559
7567
|
openPrintWindow(
|
|
7560
7568
|
"Slides",
|
|
7561
|
-
|
|
7569
|
+
chunkYBTRSG74_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7562
7570
|
settings.orientation,
|
|
7563
7571
|
colorFilter,
|
|
7564
7572
|
settings.frameSlides
|
|
@@ -7568,7 +7576,7 @@ function usePrintHandlers(input) {
|
|
|
7568
7576
|
if (settings.printWhat === "notes") {
|
|
7569
7577
|
openPrintWindow(
|
|
7570
7578
|
"Notes Pages",
|
|
7571
|
-
|
|
7579
|
+
chunkYBTRSG74_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7572
7580
|
"portrait",
|
|
7573
7581
|
colorFilter,
|
|
7574
7582
|
settings.frameSlides
|
|
@@ -7579,7 +7587,7 @@ function usePrintHandlers(input) {
|
|
|
7579
7587
|
const spp = settings.slidesPerPage;
|
|
7580
7588
|
openPrintWindow(
|
|
7581
7589
|
`Handout ${spp} per page`,
|
|
7582
|
-
|
|
7590
|
+
chunkYBTRSG74_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7583
7591
|
"portrait",
|
|
7584
7592
|
colorFilter,
|
|
7585
7593
|
settings.frameSlides
|
|
@@ -7643,8 +7651,8 @@ function useThemeHandlers(input) {
|
|
|
7643
7651
|
return;
|
|
7644
7652
|
}
|
|
7645
7653
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7646
|
-
const previousMap = theme?.colorScheme ?
|
|
7647
|
-
setSlides((prev) =>
|
|
7654
|
+
const previousMap = theme?.colorScheme ? chunkYBTRSG74_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7655
|
+
setSlides((prev) => chunkYBTRSG74_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7648
7656
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7649
7657
|
bumpHistory();
|
|
7650
7658
|
history.markDirty();
|
|
@@ -7749,7 +7757,7 @@ function useThemeSwitching(input) {
|
|
|
7749
7757
|
}
|
|
7750
7758
|
try {
|
|
7751
7759
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7752
|
-
const newData =
|
|
7760
|
+
const newData = chunkYBTRSG74_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7753
7761
|
onDataChange(newData);
|
|
7754
7762
|
onThemeChanged?.(preset);
|
|
7755
7763
|
} catch (error) {
|
|
@@ -7766,7 +7774,7 @@ function useThemeSwitching(input) {
|
|
|
7766
7774
|
}
|
|
7767
7775
|
try {
|
|
7768
7776
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7769
|
-
const newData =
|
|
7777
|
+
const newData = chunkYBTRSG74_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7770
7778
|
onDataChange(newData);
|
|
7771
7779
|
} catch (error) {
|
|
7772
7780
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7778,12 +7786,12 @@ function useThemeSwitching(input) {
|
|
|
7778
7786
|
if (!data?.theme?.colorScheme) {
|
|
7779
7787
|
return void 0;
|
|
7780
7788
|
}
|
|
7781
|
-
return
|
|
7782
|
-
(p) =>
|
|
7789
|
+
return chunkYBTRSG74_js.THEME_PRESETS.find(
|
|
7790
|
+
(p) => chunkYBTRSG74_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7783
7791
|
);
|
|
7784
7792
|
}, [data?.theme?.colorScheme]);
|
|
7785
7793
|
return {
|
|
7786
|
-
presets:
|
|
7794
|
+
presets: chunkYBTRSG74_js.THEME_PRESETS,
|
|
7787
7795
|
switchToPreset,
|
|
7788
7796
|
switchToCustom,
|
|
7789
7797
|
currentPreset
|
|
@@ -7858,7 +7866,7 @@ function usePropertyHandlers(input) {
|
|
|
7858
7866
|
}
|
|
7859
7867
|
try {
|
|
7860
7868
|
const ab = await file.arrayBuffer();
|
|
7861
|
-
const h = new
|
|
7869
|
+
const h = new chunkYBTRSG74_js.PptxHandler();
|
|
7862
7870
|
const other = await h.load(ab);
|
|
7863
7871
|
if (!other) {
|
|
7864
7872
|
return;
|
|
@@ -7868,7 +7876,7 @@ function usePropertyHandlers(input) {
|
|
|
7868
7876
|
width: canvasSize.width,
|
|
7869
7877
|
height: canvasSize.height
|
|
7870
7878
|
};
|
|
7871
|
-
setCompareResult(
|
|
7879
|
+
setCompareResult(chunkYBTRSG74_js.comparePresentation(cur, other));
|
|
7872
7880
|
setIsComparePanelOpen(true);
|
|
7873
7881
|
} catch (err) {
|
|
7874
7882
|
console.warn("Compare failed:", err);
|
|
@@ -7885,7 +7893,7 @@ function usePropertyHandlers(input) {
|
|
|
7885
7893
|
if (!diff || diff.status === "unchanged") {
|
|
7886
7894
|
return;
|
|
7887
7895
|
}
|
|
7888
|
-
setSlides((prev) =>
|
|
7896
|
+
setSlides((prev) => chunkYBTRSG74_js.applyAcceptSlide(prev, diff));
|
|
7889
7897
|
setIsDirty(true);
|
|
7890
7898
|
},
|
|
7891
7899
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7896,10 +7904,10 @@ function usePropertyHandlers(input) {
|
|
|
7896
7904
|
if (!compareResult) {
|
|
7897
7905
|
return;
|
|
7898
7906
|
}
|
|
7899
|
-
setSlides((prev) =>
|
|
7907
|
+
setSlides((prev) => chunkYBTRSG74_js.applyAcceptAllSlides(prev, compareResult));
|
|
7900
7908
|
setIsDirty(true);
|
|
7901
7909
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7902
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7910
|
+
const usedFontFamilies = react.useMemo(() => chunkYBTRSG74_js.collectUsedFonts(slides), [slides]);
|
|
7903
7911
|
return {
|
|
7904
7912
|
handleUpdateNotes,
|
|
7905
7913
|
handleUpdateSlide,
|
|
@@ -8018,7 +8026,7 @@ function useIsMobile(input) {
|
|
|
8018
8026
|
const containerRef = input?.containerRef;
|
|
8019
8027
|
const isTouchDevice = react.useSyncExternalStore(
|
|
8020
8028
|
subscribeTouchCapability,
|
|
8021
|
-
|
|
8029
|
+
chunkYBTRSG74_js.detectTouchDevice,
|
|
8022
8030
|
() => false
|
|
8023
8031
|
// server snapshot
|
|
8024
8032
|
);
|
|
@@ -8034,7 +8042,7 @@ function useIsMobile(input) {
|
|
|
8034
8042
|
}
|
|
8035
8043
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
8036
8044
|
});
|
|
8037
|
-
const [orientation, setOrientation] = react.useState(
|
|
8045
|
+
const [orientation, setOrientation] = react.useState(chunkYBTRSG74_js.detectOrientation);
|
|
8038
8046
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
8039
8047
|
const [initialViewportHeight] = react.useState(
|
|
8040
8048
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -8078,7 +8086,7 @@ function useIsMobile(input) {
|
|
|
8078
8086
|
return;
|
|
8079
8087
|
}
|
|
8080
8088
|
const handleOrientationChange = () => {
|
|
8081
|
-
setOrientation(
|
|
8089
|
+
setOrientation(chunkYBTRSG74_js.detectOrientation());
|
|
8082
8090
|
};
|
|
8083
8091
|
if (screen.orientation) {
|
|
8084
8092
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -8108,9 +8116,9 @@ function useIsMobile(input) {
|
|
|
8108
8116
|
window.addEventListener("resize", handleResize);
|
|
8109
8117
|
return () => window.removeEventListener("resize", handleResize);
|
|
8110
8118
|
}, [isTouchDevice, initialViewportHeight]);
|
|
8111
|
-
const isMobile =
|
|
8112
|
-
const isTablet = !isMobile && containerWidth >=
|
|
8113
|
-
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;
|
|
8114
8122
|
return {
|
|
8115
8123
|
isMobile,
|
|
8116
8124
|
isTablet,
|
|
@@ -8171,11 +8179,11 @@ function useViewerDialogs(input) {
|
|
|
8171
8179
|
);
|
|
8172
8180
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(false);
|
|
8173
8181
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8174
|
-
() => typeof window !== "undefined" ?
|
|
8182
|
+
() => typeof window !== "undefined" ? chunkYBTRSG74_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8175
8183
|
);
|
|
8176
8184
|
react.useEffect(() => {
|
|
8177
8185
|
const handleWindow = () => setIsNarrowViewport(
|
|
8178
|
-
|
|
8186
|
+
chunkYBTRSG74_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8179
8187
|
);
|
|
8180
8188
|
let observer = null;
|
|
8181
8189
|
let raf = 0;
|
|
@@ -8189,12 +8197,12 @@ function useViewerDialogs(input) {
|
|
|
8189
8197
|
const entry = entries[0];
|
|
8190
8198
|
if (entry) {
|
|
8191
8199
|
setIsNarrowViewport(
|
|
8192
|
-
|
|
8200
|
+
chunkYBTRSG74_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8193
8201
|
);
|
|
8194
8202
|
}
|
|
8195
8203
|
});
|
|
8196
8204
|
observer.observe(el);
|
|
8197
|
-
setIsNarrowViewport(
|
|
8205
|
+
setIsNarrowViewport(chunkYBTRSG74_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8198
8206
|
};
|
|
8199
8207
|
attach();
|
|
8200
8208
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8352,20 +8360,20 @@ function useViewerDialogs(input) {
|
|
|
8352
8360
|
}
|
|
8353
8361
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8354
8362
|
if (presentationGridSpacing) {
|
|
8355
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8363
|
+
const px = Math.round(presentationGridSpacing.cx / chunkFHTEL3Q6_js.EMU_PER_PX);
|
|
8356
8364
|
if (px > 0) {
|
|
8357
8365
|
return px;
|
|
8358
8366
|
}
|
|
8359
8367
|
}
|
|
8360
|
-
return
|
|
8368
|
+
return chunkFHTEL3Q6_js.GRID_SIZE;
|
|
8361
8369
|
}
|
|
8362
8370
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8363
8371
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8364
|
-
return
|
|
8372
|
+
return chunkYBTRSG74_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8365
8373
|
}
|
|
8366
8374
|
function computeSlideSectionGroups(slides, sections) {
|
|
8367
|
-
return
|
|
8368
|
-
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"),
|
|
8369
8377
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8370
8378
|
slideIndexes: group.slideIndexes,
|
|
8371
8379
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8420,7 +8428,7 @@ function useDerivedSlideState(input) {
|
|
|
8420
8428
|
);
|
|
8421
8429
|
const slideSectionGroups = react.useMemo(
|
|
8422
8430
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8423
|
-
if (group.id ===
|
|
8431
|
+
if (group.id === chunkFHTEL3Q6_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8424
8432
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8425
8433
|
}
|
|
8426
8434
|
if (group.id === "default" && group.label === "Slides") {
|
|
@@ -8523,13 +8531,13 @@ function useAnnotationHandlers(input) {
|
|
|
8523
8531
|
}, [annotations, setMode, setSlides, history]);
|
|
8524
8532
|
const handleSetMode = react.useCallback(
|
|
8525
8533
|
(nextMode) => {
|
|
8526
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8534
|
+
if (mode === "present" && nextMode !== "present" && !chunkYBTRSG74_js.mayLeaveSlideShow()) {
|
|
8527
8535
|
return;
|
|
8528
8536
|
}
|
|
8529
8537
|
if (nextMode === "present") {
|
|
8530
8538
|
presentation.enterPresentMode();
|
|
8531
8539
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8532
|
-
|
|
8540
|
+
chunkYBTRSG74_js.stopAllPersistentAudio();
|
|
8533
8541
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8534
8542
|
if (promptKeepInkAnnotations) {
|
|
8535
8543
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8538,7 +8546,7 @@ function useAnnotationHandlers(input) {
|
|
|
8538
8546
|
}
|
|
8539
8547
|
} else {
|
|
8540
8548
|
if (mode === "present") {
|
|
8541
|
-
|
|
8549
|
+
chunkYBTRSG74_js.stopAllPersistentAudio();
|
|
8542
8550
|
}
|
|
8543
8551
|
setMode(nextMode);
|
|
8544
8552
|
}
|
|
@@ -8604,13 +8612,13 @@ function useSerialize(input) {
|
|
|
8604
8612
|
let processedSlide = slide;
|
|
8605
8613
|
if (pendingEditId) {
|
|
8606
8614
|
const updatedElements = slide.elements.map((el) => {
|
|
8607
|
-
if (el.id !== pendingEditId || !
|
|
8615
|
+
if (el.id !== pendingEditId || !chunkYBTRSG74_js.hasTextProperties(el)) {
|
|
8608
8616
|
return el;
|
|
8609
8617
|
}
|
|
8610
8618
|
return {
|
|
8611
8619
|
...el,
|
|
8612
8620
|
text: pendingEditText,
|
|
8613
|
-
textSegments:
|
|
8621
|
+
textSegments: chunkYBTRSG74_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8614
8622
|
};
|
|
8615
8623
|
});
|
|
8616
8624
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8623,14 +8631,14 @@ function useSerialize(input) {
|
|
|
8623
8631
|
const pptxGuides = guides.map((g) => ({
|
|
8624
8632
|
id: g.id,
|
|
8625
8633
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8626
|
-
positionEmu:
|
|
8634
|
+
positionEmu: chunkYBTRSG74_js.guidePxToEmu(g.position)
|
|
8627
8635
|
}));
|
|
8628
8636
|
return {
|
|
8629
8637
|
...processedSlide,
|
|
8630
8638
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8631
8639
|
};
|
|
8632
8640
|
});
|
|
8633
|
-
const slidesToSave =
|
|
8641
|
+
const slidesToSave = chunkFHTEL3Q6_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8634
8642
|
const saveOptions = {
|
|
8635
8643
|
headerFooter,
|
|
8636
8644
|
presentationProperties,
|
|
@@ -8799,7 +8807,7 @@ function usePresentationSetup(input) {
|
|
|
8799
8807
|
containerRef,
|
|
8800
8808
|
content,
|
|
8801
8809
|
onSetMode: (nextMode) => {
|
|
8802
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8810
|
+
if (mode === "present" && nextMode !== "present" && !chunkYBTRSG74_js.mayLeaveSlideShow()) {
|
|
8803
8811
|
return;
|
|
8804
8812
|
}
|
|
8805
8813
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8807,7 +8815,7 @@ function usePresentationSetup(input) {
|
|
|
8807
8815
|
setShowKeepAnnotationsDialog(true);
|
|
8808
8816
|
} else {
|
|
8809
8817
|
if (mode === "present" && nextMode !== "present") {
|
|
8810
|
-
|
|
8818
|
+
chunkYBTRSG74_js.stopAllPersistentAudio();
|
|
8811
8819
|
stopAnimationSound();
|
|
8812
8820
|
}
|
|
8813
8821
|
setMode(nextMode);
|
|
@@ -8861,10 +8869,10 @@ function usePresentationSetup(input) {
|
|
|
8861
8869
|
onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
|
|
8862
8870
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8863
8871
|
onSaveRehearsalTimings: (timings) => {
|
|
8864
|
-
setSlides((prev) =>
|
|
8872
|
+
setSlides((prev) => chunkYBTRSG74_js.applyRehearsalTimings(prev, timings));
|
|
8865
8873
|
history.markDirty();
|
|
8866
8874
|
},
|
|
8867
|
-
loopContinuously:
|
|
8875
|
+
loopContinuously: chunkYBTRSG74_js.shouldLoopContinuously(presentationProperties),
|
|
8868
8876
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8869
8877
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8870
8878
|
endWithBlackSlide
|
|
@@ -9028,7 +9036,7 @@ function useEditorOperations(input) {
|
|
|
9028
9036
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9029
9037
|
react.useEffect(() => {
|
|
9030
9038
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9031
|
-
copiedFormatRef.current =
|
|
9039
|
+
copiedFormatRef.current = chunkYBTRSG74_js.copyFormatFromElement(selectedElement);
|
|
9032
9040
|
} else if (!formatPainterActive) {
|
|
9033
9041
|
copiedFormatRef.current = null;
|
|
9034
9042
|
}
|
|
@@ -9054,12 +9062,12 @@ function useEditorOperations(input) {
|
|
|
9054
9062
|
e.stopPropagation();
|
|
9055
9063
|
const element = elementLookup.get(elementId);
|
|
9056
9064
|
if (element) {
|
|
9057
|
-
const updated =
|
|
9065
|
+
const updated = chunkYBTRSG74_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9058
9066
|
const updates = {};
|
|
9059
|
-
if (
|
|
9067
|
+
if (chunkYBTRSG74_js.hasShapeProperties(updated)) {
|
|
9060
9068
|
updates.shapeStyle = updated.shapeStyle;
|
|
9061
9069
|
}
|
|
9062
|
-
if (
|
|
9070
|
+
if (chunkYBTRSG74_js.hasTextProperties(updated)) {
|
|
9063
9071
|
updates.textStyle = updated.textStyle;
|
|
9064
9072
|
}
|
|
9065
9073
|
ops.updateElementById(elementId, updates);
|
|
@@ -9208,7 +9216,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9208
9216
|
const families = /* @__PURE__ */ new Set();
|
|
9209
9217
|
for (const slide of slides) {
|
|
9210
9218
|
for (const el of slide.elements) {
|
|
9211
|
-
if (
|
|
9219
|
+
if (chunkYBTRSG74_js.hasTextProperties(el) && el.textSegments) {
|
|
9212
9220
|
for (const seg of el.textSegments) {
|
|
9213
9221
|
if (seg.style.fontFamily) {
|
|
9214
9222
|
families.add(seg.style.fontFamily);
|
|
@@ -9420,13 +9428,13 @@ function useKeyboardShortcuts(input) {
|
|
|
9420
9428
|
inputRef.current = input;
|
|
9421
9429
|
const handleKeyDown = react.useCallback((e) => {
|
|
9422
9430
|
const current = inputRef.current;
|
|
9423
|
-
const { action, dx, dy } =
|
|
9431
|
+
const { action, dx, dy } = chunkYBTRSG74_js.mapEditorKey(e, {
|
|
9424
9432
|
canEdit: current.canEdit,
|
|
9425
9433
|
isPresenting: current.mode !== "edit",
|
|
9426
9434
|
hasSelection: current.hasSelection,
|
|
9427
9435
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9428
9436
|
isDrawing: current.activeTool !== "select",
|
|
9429
|
-
isTextInputTarget:
|
|
9437
|
+
isTextInputTarget: chunkYBTRSG74_js.isEditorTextInputTarget(e.target)
|
|
9430
9438
|
});
|
|
9431
9439
|
if (action === null) {
|
|
9432
9440
|
return;
|
|
@@ -9719,7 +9727,7 @@ function useViewerIntegration(input) {
|
|
|
9719
9727
|
return zoom.scale;
|
|
9720
9728
|
},
|
|
9721
9729
|
setZoom(level) {
|
|
9722
|
-
zoom.setScale(
|
|
9730
|
+
zoom.setScale(chunkYBTRSG74_js.clampZoomScale(level));
|
|
9723
9731
|
},
|
|
9724
9732
|
zoomIn() {
|
|
9725
9733
|
zoom.handleZoomIn();
|
|
@@ -9934,7 +9942,7 @@ function useReducedMotion() {
|
|
|
9934
9942
|
}
|
|
9935
9943
|
function useViewerOptions() {
|
|
9936
9944
|
const storeRef = react.useRef(null);
|
|
9937
|
-
storeRef.current ??=
|
|
9945
|
+
storeRef.current ??= chunkYBTRSG74_js.createViewerOptionsStore();
|
|
9938
9946
|
const store = storeRef.current;
|
|
9939
9947
|
const options = react.useSyncExternalStore(
|
|
9940
9948
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9943,9 +9951,9 @@ function useViewerOptions() {
|
|
|
9943
9951
|
);
|
|
9944
9952
|
return { optionsStore: store, options };
|
|
9945
9953
|
}
|
|
9946
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9954
|
+
var KNOWN_TAB_IDS = new Set(chunkYBTRSG74_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9947
9955
|
function computeToolbarVisibility(hiddenActions) {
|
|
9948
|
-
const isHidden = (id) =>
|
|
9956
|
+
const isHidden = (id) => chunkYBTRSG74_js.isActionHidden(id, hiddenActions);
|
|
9949
9957
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
9950
9958
|
return { isHidden, isTabVisible };
|
|
9951
9959
|
}
|
|
@@ -10030,12 +10038,12 @@ function useYjsDocumentSync({
|
|
|
10030
10038
|
return;
|
|
10031
10039
|
}
|
|
10032
10040
|
try {
|
|
10033
|
-
const handler = new
|
|
10041
|
+
const handler = new chunkYBTRSG74_js.PptxHandler();
|
|
10034
10042
|
await handler.load(sourceBytes.buffer);
|
|
10035
|
-
const currentSlides =
|
|
10043
|
+
const currentSlides = chunkYBTRSG74_js.readSlidesFromYDoc(
|
|
10036
10044
|
doc
|
|
10037
10045
|
);
|
|
10038
|
-
const slidesToSave =
|
|
10046
|
+
const slidesToSave = chunkFHTEL3Q6_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10039
10047
|
const bytes = await handler.save(slidesToSave);
|
|
10040
10048
|
config.onWriteBack(bytes);
|
|
10041
10049
|
} catch {
|
|
@@ -10050,7 +10058,7 @@ function useYjsDocumentSync({
|
|
|
10050
10058
|
if (!doc || !isConnected) {
|
|
10051
10059
|
return;
|
|
10052
10060
|
}
|
|
10053
|
-
const docSlides =
|
|
10061
|
+
const docSlides = chunkYBTRSG74_js.readSlidesFromYDoc(
|
|
10054
10062
|
doc
|
|
10055
10063
|
);
|
|
10056
10064
|
if (docSlides.length === 0) {
|
|
@@ -10072,11 +10080,11 @@ function useYjsDocumentSync({
|
|
|
10072
10080
|
lastSyncedRef.current = serialized;
|
|
10073
10081
|
void (async () => {
|
|
10074
10082
|
const factories = await getFactories();
|
|
10075
|
-
|
|
10083
|
+
chunkYBTRSG74_js.reconcileSlidesInYDoc(
|
|
10076
10084
|
slides,
|
|
10077
10085
|
doc,
|
|
10078
10086
|
factories,
|
|
10079
|
-
|
|
10087
|
+
chunkYBTRSG74_js.LOCAL_SYNC_ORIGIN
|
|
10080
10088
|
);
|
|
10081
10089
|
scheduleWriteBack();
|
|
10082
10090
|
})();
|
|
@@ -10090,10 +10098,10 @@ function useYjsDocumentSync({
|
|
|
10090
10098
|
return;
|
|
10091
10099
|
}
|
|
10092
10100
|
const handleChange = (_events, transaction) => {
|
|
10093
|
-
if (transaction?.origin ===
|
|
10101
|
+
if (transaction?.origin === chunkYBTRSG74_js.LOCAL_SYNC_ORIGIN) {
|
|
10094
10102
|
return;
|
|
10095
10103
|
}
|
|
10096
|
-
const remoteSlides =
|
|
10104
|
+
const remoteSlides = chunkYBTRSG74_js.readSlidesFromYDoc(
|
|
10097
10105
|
doc
|
|
10098
10106
|
);
|
|
10099
10107
|
if (remoteSlides.length === 0) {
|
|
@@ -10109,7 +10117,7 @@ function useYjsDocumentSync({
|
|
|
10109
10117
|
isApplyingRemoteRef.current = false;
|
|
10110
10118
|
scheduleWriteBack();
|
|
10111
10119
|
};
|
|
10112
|
-
const unobserve =
|
|
10120
|
+
const unobserve = chunkYBTRSG74_js.observeYDocSlides(
|
|
10113
10121
|
doc,
|
|
10114
10122
|
handleChange
|
|
10115
10123
|
);
|
|
@@ -10147,7 +10155,7 @@ function useBroadcastFollower({
|
|
|
10147
10155
|
if (!broadcaster) {
|
|
10148
10156
|
return;
|
|
10149
10157
|
}
|
|
10150
|
-
if (!
|
|
10158
|
+
if (!chunkYBTRSG74_js.shouldAutoFollowBroadcaster({
|
|
10151
10159
|
localRole: collab.config.role,
|
|
10152
10160
|
broadcasterRole: broadcaster.role
|
|
10153
10161
|
})) {
|
|
@@ -10307,10 +10315,10 @@ function useTouchGestures(input) {
|
|
|
10307
10315
|
if (!el || !enabled) {
|
|
10308
10316
|
return;
|
|
10309
10317
|
}
|
|
10310
|
-
const recognizer =
|
|
10318
|
+
const recognizer = chunkYBTRSG74_js.createTouchGestureRecognizer({
|
|
10311
10319
|
getScale: () => scaleRef.current,
|
|
10312
|
-
minScale:
|
|
10313
|
-
maxScale:
|
|
10320
|
+
minScale: chunkYBTRSG74_js.MIN_ZOOM_SCALE,
|
|
10321
|
+
maxScale: chunkYBTRSG74_js.MAX_ZOOM_SCALE,
|
|
10314
10322
|
callbacks: {
|
|
10315
10323
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10316
10324
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10350,7 +10358,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10350
10358
|
return;
|
|
10351
10359
|
}
|
|
10352
10360
|
const rect = active.getBoundingClientRect();
|
|
10353
|
-
const delta =
|
|
10361
|
+
const delta = chunkYBTRSG74_js.computeScrollDelta(
|
|
10354
10362
|
{ top: rect.top, bottom: rect.bottom },
|
|
10355
10363
|
window.innerHeight,
|
|
10356
10364
|
keyboardInset
|
|
@@ -10370,8 +10378,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10370
10378
|
return;
|
|
10371
10379
|
}
|
|
10372
10380
|
const update = () => {
|
|
10373
|
-
const metrics =
|
|
10374
|
-
const inset = metrics ?
|
|
10381
|
+
const metrics = chunkYBTRSG74_js.readViewportMetrics(window);
|
|
10382
|
+
const inset = metrics ? chunkYBTRSG74_js.computeKeyboardInset(metrics) : 0;
|
|
10375
10383
|
setKeyboardInset(inset);
|
|
10376
10384
|
if (inset > 0) {
|
|
10377
10385
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10382,8 +10390,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10382
10390
|
vv.addEventListener("scroll", update);
|
|
10383
10391
|
const onFocusIn = () => {
|
|
10384
10392
|
window.requestAnimationFrame(() => {
|
|
10385
|
-
const metrics =
|
|
10386
|
-
const inset = metrics ?
|
|
10393
|
+
const metrics = chunkYBTRSG74_js.readViewportMetrics(window);
|
|
10394
|
+
const inset = metrics ? chunkYBTRSG74_js.computeKeyboardInset(metrics) : 0;
|
|
10387
10395
|
if (inset > 0) {
|
|
10388
10396
|
scrollFocusedIntoView(inset);
|
|
10389
10397
|
}
|
|
@@ -10396,7 +10404,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10396
10404
|
document.removeEventListener("focusin", onFocusIn);
|
|
10397
10405
|
};
|
|
10398
10406
|
}, [enabled]);
|
|
10399
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10407
|
+
return { keyboardInset, isKeyboardOpen: chunkYBTRSG74_js.isKeyboardOpen(keyboardInset) };
|
|
10400
10408
|
}
|
|
10401
10409
|
|
|
10402
10410
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10423,7 +10431,7 @@ function buildCanvasProps(input) {
|
|
|
10423
10431
|
} = input;
|
|
10424
10432
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10425
10433
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10426
|
-
const fieldContext =
|
|
10434
|
+
const fieldContext = chunkYBTRSG74_js.buildFieldSubstitutionContext({
|
|
10427
10435
|
headerFooter: s.headerFooter,
|
|
10428
10436
|
customProperties: s.customProperties,
|
|
10429
10437
|
slide: activeSlide
|
|
@@ -10433,13 +10441,13 @@ function buildCanvasProps(input) {
|
|
|
10433
10441
|
if (mode === "present") {
|
|
10434
10442
|
presentation.handlePresentationAction(action);
|
|
10435
10443
|
} else if (action.url) {
|
|
10436
|
-
|
|
10444
|
+
chunkYBTRSG74_js.safeOpenUrl(action.url);
|
|
10437
10445
|
}
|
|
10438
10446
|
};
|
|
10439
10447
|
const handleHyperlinkClick = (url) => {
|
|
10440
|
-
if (
|
|
10448
|
+
if (chunkYBTRSG74_js.isPpactionUrl(url)) {
|
|
10441
10449
|
if (mode === "present") {
|
|
10442
|
-
const parsed =
|
|
10450
|
+
const parsed = chunkYBTRSG74_js.parsePpactionUrl(url);
|
|
10443
10451
|
if (parsed) {
|
|
10444
10452
|
presentation.handlePresentationAction({
|
|
10445
10453
|
action: parsed.action,
|
|
@@ -10449,7 +10457,7 @@ function buildCanvasProps(input) {
|
|
|
10449
10457
|
}
|
|
10450
10458
|
return;
|
|
10451
10459
|
}
|
|
10452
|
-
|
|
10460
|
+
chunkYBTRSG74_js.safeOpenUrl(url);
|
|
10453
10461
|
};
|
|
10454
10462
|
return {
|
|
10455
10463
|
activeSlide: effectiveSlide,
|
|
@@ -10592,7 +10600,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10592
10600
|
const current = activeSlide.animations ?? [];
|
|
10593
10601
|
if (group === "motionPath") {
|
|
10594
10602
|
propertyHandlers.handleUpdateSlide({
|
|
10595
|
-
animations:
|
|
10603
|
+
animations: chunkYBTRSG74_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10596
10604
|
});
|
|
10597
10605
|
return;
|
|
10598
10606
|
}
|
|
@@ -10787,7 +10795,7 @@ function buildToolbarProps(input) {
|
|
|
10787
10795
|
onOpenFile,
|
|
10788
10796
|
onOpenRecentFile,
|
|
10789
10797
|
onCreatePresentation: (templateId) => {
|
|
10790
|
-
s.setSlides(
|
|
10798
|
+
s.setSlides(chunkYBTRSG74_js.createBackstagePresentation(templateId));
|
|
10791
10799
|
s.setActiveSlideIndex(0);
|
|
10792
10800
|
s.setSelectedElementId(null);
|
|
10793
10801
|
s.setSelectedElementIds([]);
|
|
@@ -10814,7 +10822,7 @@ function buildToolbarProps(input) {
|
|
|
10814
10822
|
layoutOptions: scopedLayoutOptions,
|
|
10815
10823
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10816
10824
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10817
|
-
templateScheme:
|
|
10825
|
+
templateScheme: chunkYBTRSG74_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10818
10826
|
customShows: s.customShows,
|
|
10819
10827
|
activeCustomShowId: s.activeCustomShowId,
|
|
10820
10828
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -10846,7 +10854,7 @@ function buildToolbarProps(input) {
|
|
|
10846
10854
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10847
10855
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10848
10856
|
formatPainterActive: s.formatPainterActive,
|
|
10849
|
-
canActivateFormatPainter:
|
|
10857
|
+
canActivateFormatPainter: chunkYBTRSG74_js.hasCopyableFormat(selectedElement),
|
|
10850
10858
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10851
10859
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10852
10860
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11115,7 +11123,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11115
11123
|
}, [incomingContent]);
|
|
11116
11124
|
const onOpenFile = react.useCallback(() => {
|
|
11117
11125
|
void (async () => {
|
|
11118
|
-
const picked = await
|
|
11126
|
+
const picked = await chunkYBTRSG74_js.openPptxFile();
|
|
11119
11127
|
if (picked) {
|
|
11120
11128
|
setContent(picked.buffer);
|
|
11121
11129
|
}
|
|
@@ -11123,7 +11131,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11123
11131
|
}, []);
|
|
11124
11132
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11125
11133
|
void (async () => {
|
|
11126
|
-
const bytes = await
|
|
11134
|
+
const bytes = await chunkYBTRSG74_js.readBackstageRecentFile(key);
|
|
11127
11135
|
if (bytes) {
|
|
11128
11136
|
setContent(bytes);
|
|
11129
11137
|
}
|