pptx-react-viewer 2.21.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/{AiChatPanel-E4NQEMEI.mjs → AiChatPanel-DMBQPAGB.mjs} +3 -3
- package/dist/AiChatPanel-DMBQPAGB.mjs.br +0 -0
- package/dist/AiChatPanel-DMBQPAGB.mjs.gz +0 -0
- package/dist/{AiChatPanel-VKR2IFFC.js → AiChatPanel-NLIUZ5RI.js} +23 -23
- package/dist/AiChatPanel-NLIUZ5RI.js.br +0 -0
- package/dist/AiChatPanel-NLIUZ5RI.js.gz +0 -0
- package/dist/{Model3DScene-JZKLB5YT.js → Model3DScene-JNZN42TU.js} +2 -2
- package/dist/Model3DScene-JNZN42TU.js.br +0 -0
- package/dist/Model3DScene-JNZN42TU.js.gz +0 -0
- package/dist/{Model3DScene-65J6IE5Q.mjs → Model3DScene-ZO6U7YVU.mjs} +1 -1
- package/dist/Model3DScene-ZO6U7YVU.mjs.br +0 -0
- package/dist/Model3DScene-ZO6U7YVU.mjs.gz +0 -0
- package/dist/{PowerPointViewer-DVFkeluD.d.ts → PowerPointViewer-SkkxAGKa.d.ts} +2 -2
- package/dist/PowerPointViewer-SkkxAGKa.d.ts.map +1 -0
- package/dist/SurfaceChart3DScene-P6CVRWDQ.mjs +47 -0
- package/dist/SurfaceChart3DScene-P6CVRWDQ.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-P6CVRWDQ.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-PGD4ZCLI.js +49 -0
- package/dist/SurfaceChart3DScene-PGD4ZCLI.js.br +0 -0
- package/dist/SurfaceChart3DScene-PGD4ZCLI.js.gz +0 -0
- package/dist/{audience-content-store-C4BFFhV5.d.ts → audience-content-store-Bx4Yj2pN.d.ts} +2 -2
- package/dist/{audience-content-store-C4BFFhV5.d.ts.map → audience-content-store-Bx4Yj2pN.d.ts.map} +1 -1
- package/dist/{chunk-GJHO6HPF.js → chunk-3MW6F3K7.js} +451 -399
- package/dist/chunk-3MW6F3K7.js.br +0 -0
- package/dist/chunk-3MW6F3K7.js.gz +0 -0
- package/dist/{chunk-2SNHVHHB.mjs → chunk-BGAJLL4N.mjs} +70 -18
- package/dist/chunk-BGAJLL4N.mjs.br +0 -0
- package/dist/chunk-BGAJLL4N.mjs.gz +0 -0
- package/dist/{chunk-CBGTLSY7.mjs → chunk-H2ONCGFZ.mjs} +218 -156
- package/dist/chunk-H2ONCGFZ.mjs.br +0 -0
- package/dist/chunk-H2ONCGFZ.mjs.gz +0 -0
- package/dist/{chunk-WRJ76D5S.mjs → chunk-OB4PKKIN.mjs} +1 -1
- package/dist/chunk-OB4PKKIN.mjs.br +0 -0
- package/dist/chunk-OB4PKKIN.mjs.gz +0 -0
- package/dist/{chunk-VWCUKKR3.mjs → chunk-OXPD2UYI.mjs} +14031 -7120
- package/dist/chunk-OXPD2UYI.mjs.br +0 -0
- package/dist/chunk-OXPD2UYI.mjs.gz +0 -0
- package/dist/{chunk-OSPNGQF3.js → chunk-RSEZYBKT.js} +2005 -1943
- package/dist/chunk-RSEZYBKT.js.br +0 -0
- package/dist/chunk-RSEZYBKT.js.gz +0 -0
- package/dist/{chunk-WX3HQHR5.mjs → chunk-S6PFSR7I.mjs} +108 -255
- package/dist/chunk-S6PFSR7I.mjs.br +0 -0
- package/dist/chunk-S6PFSR7I.mjs.gz +0 -0
- package/dist/{chunk-HYUJVSQJ.js → chunk-SDOQKSKI.js} +14051 -7126
- package/dist/chunk-SDOQKSKI.js.br +0 -0
- package/dist/chunk-SDOQKSKI.js.gz +0 -0
- package/dist/{chunk-C3JR7RMW.js → chunk-WFMSDYVQ.js} +3 -3
- package/dist/chunk-WFMSDYVQ.js.br +0 -0
- package/dist/chunk-WFMSDYVQ.js.gz +0 -0
- package/dist/{chunk-DA6DF3EU.js → chunk-XMLPTDPM.js} +248 -396
- package/dist/chunk-XMLPTDPM.js.br +0 -0
- package/dist/chunk-XMLPTDPM.js.gz +0 -0
- package/dist/index.d.ts +491 -20
- package/dist/index.js +45 -45
- 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.d.ts +498 -22
- package/dist/internals.d.ts.map +1 -1
- 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/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{types-TCH6icpi.d.ts → types-kLpvSPxq.d.ts} +11 -1
- package/dist/{types-TCH6icpi.d.ts.map → types-kLpvSPxq.d.ts.map} +1 -1
- package/dist/{useViewerBuildingBlocks-BKb0qs1j.d.ts → useViewerBuildingBlocks-fh7rq4jc.d.ts} +2 -2
- package/dist/{useViewerBuildingBlocks-BKb0qs1j.d.ts.map → useViewerBuildingBlocks-fh7rq4jc.d.ts.map} +1 -1
- package/dist/viewer/index.d.ts +488 -18
- 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 +2 -2
- package/dist/AiChatPanel-E4NQEMEI.mjs.br +0 -0
- package/dist/AiChatPanel-E4NQEMEI.mjs.gz +0 -0
- package/dist/AiChatPanel-VKR2IFFC.js.br +0 -0
- package/dist/AiChatPanel-VKR2IFFC.js.gz +0 -0
- package/dist/Model3DScene-65J6IE5Q.mjs.br +0 -0
- package/dist/Model3DScene-65J6IE5Q.mjs.gz +0 -0
- package/dist/Model3DScene-JZKLB5YT.js.br +0 -0
- package/dist/Model3DScene-JZKLB5YT.js.gz +0 -0
- package/dist/PowerPointViewer-DVFkeluD.d.ts.map +0 -1
- package/dist/chunk-2SNHVHHB.mjs.br +0 -0
- package/dist/chunk-2SNHVHHB.mjs.gz +0 -0
- package/dist/chunk-C3JR7RMW.js.br +0 -0
- package/dist/chunk-C3JR7RMW.js.gz +0 -0
- package/dist/chunk-CBGTLSY7.mjs.br +0 -0
- package/dist/chunk-CBGTLSY7.mjs.gz +0 -0
- package/dist/chunk-DA6DF3EU.js.br +0 -0
- package/dist/chunk-DA6DF3EU.js.gz +0 -0
- package/dist/chunk-GJHO6HPF.js.br +0 -0
- package/dist/chunk-GJHO6HPF.js.gz +0 -0
- package/dist/chunk-HYUJVSQJ.js.br +0 -0
- package/dist/chunk-HYUJVSQJ.js.gz +0 -0
- package/dist/chunk-OSPNGQF3.js.br +0 -0
- package/dist/chunk-OSPNGQF3.js.gz +0 -0
- package/dist/chunk-VWCUKKR3.mjs.br +0 -0
- package/dist/chunk-VWCUKKR3.mjs.gz +0 -0
- package/dist/chunk-WRJ76D5S.mjs.br +0 -0
- package/dist/chunk-WRJ76D5S.mjs.gz +0 -0
- package/dist/chunk-WX3HQHR5.mjs.br +0 -0
- package/dist/chunk-WX3HQHR5.mjs.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXMLPTDPM_js = require('./chunk-XMLPTDPM.js');
|
|
4
4
|
var chunkU6A5FWWE_js = require('./chunk-U6A5FWWE.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkSDOQKSKI_js = require('./chunk-SDOQKSKI.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 = chunkSDOQKSKI_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 = chunkSDOQKSKI_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 ??= chunkSDOQKSKI_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 >= chunkSDOQKSKI_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
|
+
}, chunkSDOQKSKI_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 = chunkSDOQKSKI_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
|
+
chunkSDOQKSKI_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 = chunkSDOQKSKI_js.validateRoomId(config.roomId);
|
|
249
249
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
250
|
-
departureRef.current =
|
|
250
|
+
departureRef.current = chunkSDOQKSKI_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 = chunkSDOQKSKI_js.validateRoomId(config.roomId);
|
|
293
|
+
const transport = config.transport ?? chunkSDOQKSKI_js.resolveTransportForServerUrl(config.serverUrl);
|
|
294
294
|
if (transport === "webrtc") {
|
|
295
295
|
await initWebrtc();
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
if (
|
|
298
|
+
if (chunkSDOQKSKI_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 = chunkSDOQKSKI_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
|
+
chunkSDOQKSKI_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
|
+
}, chunkSDOQKSKI_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
|
+
chunkSDOQKSKI_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 = chunkSDOQKSKI_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 = chunkSDOQKSKI_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,
|
|
@@ -532,8 +532,8 @@ function useEditorHistory(input) {
|
|
|
532
532
|
width: canvasSize.width,
|
|
533
533
|
height: canvasSize.height,
|
|
534
534
|
activeSlideIndex,
|
|
535
|
-
slides: slides.map(
|
|
536
|
-
templateElementsBySlideId:
|
|
535
|
+
slides: slides.map(chunkSDOQKSKI_js.cloneSlide),
|
|
536
|
+
templateElementsBySlideId: chunkSDOQKSKI_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
537
537
|
...actionLabel ? { actionLabel } : {}
|
|
538
538
|
};
|
|
539
539
|
},
|
|
@@ -546,9 +546,9 @@ function useEditorHistory(input) {
|
|
|
546
546
|
width: snapshot.width,
|
|
547
547
|
height: snapshot.height
|
|
548
548
|
});
|
|
549
|
-
setSlides(snapshot.slides.map(
|
|
549
|
+
setSlides(snapshot.slides.map(chunkSDOQKSKI_js.cloneSlide));
|
|
550
550
|
setTemplateElementsBySlideId(
|
|
551
|
-
|
|
551
|
+
chunkSDOQKSKI_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
552
552
|
);
|
|
553
553
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
554
554
|
setSelectedElementIds([]);
|
|
@@ -587,8 +587,8 @@ function useEditorHistory(input) {
|
|
|
587
587
|
const currentSnapshot = buildHistorySnapshot();
|
|
588
588
|
historyFutureRef.current.push(currentSnapshot);
|
|
589
589
|
isApplyingHistoryRef.current = true;
|
|
590
|
-
const nextSnapshot =
|
|
591
|
-
lastHistorySnapshotRef.current =
|
|
590
|
+
const nextSnapshot = chunkXMLPTDPM_js.cloneHistorySnapshot(previousSnapshot);
|
|
591
|
+
lastHistorySnapshotRef.current = chunkXMLPTDPM_js.cloneHistorySnapshot(nextSnapshot);
|
|
592
592
|
lastHistorySerializedRef.current = serializeDocument(nextSnapshot);
|
|
593
593
|
applyHistorySnapshot(nextSnapshot);
|
|
594
594
|
updateHistoryAvailability();
|
|
@@ -609,8 +609,8 @@ function useEditorHistory(input) {
|
|
|
609
609
|
const currentSnapshot = buildHistorySnapshot();
|
|
610
610
|
historyPastRef.current.push(currentSnapshot);
|
|
611
611
|
isApplyingHistoryRef.current = true;
|
|
612
|
-
const targetSnapshot =
|
|
613
|
-
lastHistorySnapshotRef.current =
|
|
612
|
+
const targetSnapshot = chunkXMLPTDPM_js.cloneHistorySnapshot(nextSnapshot);
|
|
613
|
+
lastHistorySnapshotRef.current = chunkXMLPTDPM_js.cloneHistorySnapshot(targetSnapshot);
|
|
614
614
|
lastHistorySerializedRef.current = serializeDocument(targetSnapshot);
|
|
615
615
|
applyHistorySnapshot(targetSnapshot);
|
|
616
616
|
updateHistoryAvailability();
|
|
@@ -628,7 +628,7 @@ function useEditorHistory(input) {
|
|
|
628
628
|
historyPastRef.current = [];
|
|
629
629
|
historyFutureRef.current = [];
|
|
630
630
|
if (initialSnapshot) {
|
|
631
|
-
const clonedInitial =
|
|
631
|
+
const clonedInitial = chunkXMLPTDPM_js.cloneHistorySnapshot(initialSnapshot);
|
|
632
632
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
633
633
|
lastHistorySerializedRef.current = serializeDocument(clonedInitial);
|
|
634
634
|
} else {
|
|
@@ -676,19 +676,19 @@ function useEditorHistory(input) {
|
|
|
676
676
|
}
|
|
677
677
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
678
678
|
if (!previousSnapshot) {
|
|
679
|
-
lastHistorySnapshotRef.current =
|
|
679
|
+
lastHistorySnapshotRef.current = chunkXMLPTDPM_js.cloneHistorySnapshot(snapshot);
|
|
680
680
|
lastHistorySerializedRef.current = serialized;
|
|
681
681
|
lastCheapHashRef.current = cheapHash;
|
|
682
682
|
updateHistoryAvailability();
|
|
683
683
|
return;
|
|
684
684
|
}
|
|
685
685
|
onDirtyRef.current?.();
|
|
686
|
-
historyPastRef.current.push(
|
|
686
|
+
historyPastRef.current.push(chunkXMLPTDPM_js.cloneHistorySnapshot(previousSnapshot));
|
|
687
687
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
688
688
|
historyPastRef.current.shift();
|
|
689
689
|
}
|
|
690
690
|
historyFutureRef.current = [];
|
|
691
|
-
lastHistorySnapshotRef.current =
|
|
691
|
+
lastHistorySnapshotRef.current = chunkXMLPTDPM_js.cloneHistorySnapshot(snapshot);
|
|
692
692
|
lastHistorySerializedRef.current = serialized;
|
|
693
693
|
lastCheapHashRef.current = cheapHash;
|
|
694
694
|
updateHistoryAvailability();
|
|
@@ -748,9 +748,9 @@ function useZoomViewport({
|
|
|
748
748
|
const canvasStageRef = react.useRef(null);
|
|
749
749
|
const canvasViewportRef = react.useRef(null);
|
|
750
750
|
const renderScaleRef = react.useRef(1);
|
|
751
|
-
const wheelBufferRef = react.useRef(
|
|
751
|
+
const wheelBufferRef = react.useRef(chunkSDOQKSKI_js.createWheelStepBuffer());
|
|
752
752
|
const storeRef = react.useRef(null);
|
|
753
|
-
storeRef.current ??=
|
|
753
|
+
storeRef.current ??= chunkSDOQKSKI_js.createViewerZoomStore();
|
|
754
754
|
const store = storeRef.current;
|
|
755
755
|
const scale = useViewerStore(store, selectZoom);
|
|
756
756
|
const setScale = react.useCallback(
|
|
@@ -811,7 +811,7 @@ function useZoomViewport({
|
|
|
811
811
|
if (!wrapper || !canvasViewport) {
|
|
812
812
|
return;
|
|
813
813
|
}
|
|
814
|
-
const boundedScale =
|
|
814
|
+
const boundedScale = chunkSDOQKSKI_js.clampZoomScale(nextScale);
|
|
815
815
|
const nextEditorScale = fitScale * boundedScale;
|
|
816
816
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
817
817
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -848,29 +848,29 @@ function useZoomViewport({
|
|
|
848
848
|
selectedElements.forEach((element) => {
|
|
849
849
|
minX = Math.min(minX, element.x);
|
|
850
850
|
minY = Math.min(minY, element.y);
|
|
851
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
852
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
851
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkXMLPTDPM_js.MIN_ELEMENT_SIZE));
|
|
852
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkXMLPTDPM_js.MIN_ELEMENT_SIZE));
|
|
853
853
|
});
|
|
854
854
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
855
855
|
return;
|
|
856
856
|
}
|
|
857
857
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
858
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
859
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
858
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkXMLPTDPM_js.MIN_ELEMENT_SIZE);
|
|
859
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkXMLPTDPM_js.MIN_ELEMENT_SIZE);
|
|
860
860
|
const availableWidth = Math.max(
|
|
861
|
-
effectiveEditorDimensions.width -
|
|
862
|
-
|
|
861
|
+
effectiveEditorDimensions.width - chunkXMLPTDPM_js.ZOOM_TO_SELECTION_PADDING,
|
|
862
|
+
chunkXMLPTDPM_js.MIN_ELEMENT_SIZE
|
|
863
863
|
);
|
|
864
864
|
const availableHeight = Math.max(
|
|
865
|
-
effectiveEditorDimensions.height -
|
|
866
|
-
|
|
865
|
+
effectiveEditorDimensions.height - chunkXMLPTDPM_js.ZOOM_TO_SELECTION_PADDING,
|
|
866
|
+
chunkXMLPTDPM_js.MIN_ELEMENT_SIZE
|
|
867
867
|
);
|
|
868
868
|
const targetEditorScale = Math.min(
|
|
869
869
|
availableWidth / boundsWidth,
|
|
870
870
|
availableHeight / boundsHeight
|
|
871
871
|
);
|
|
872
872
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
873
|
-
const nextScale =
|
|
873
|
+
const nextScale = chunkSDOQKSKI_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
874
874
|
setScale(nextScale);
|
|
875
875
|
window.requestAnimationFrame(() => {
|
|
876
876
|
window.requestAnimationFrame(() => {
|
|
@@ -887,14 +887,14 @@ function useZoomViewport({
|
|
|
887
887
|
]);
|
|
888
888
|
const handleWheel = react.useCallback(
|
|
889
889
|
(event) => {
|
|
890
|
-
const mapped =
|
|
890
|
+
const mapped = chunkSDOQKSKI_js.mapEditingWheel(event, wheelBufferRef.current, true);
|
|
891
891
|
if (mapped.intent !== "zoom") {
|
|
892
892
|
return;
|
|
893
893
|
}
|
|
894
894
|
event.preventDefault();
|
|
895
895
|
store.dispatch({
|
|
896
896
|
type: "set-zoom",
|
|
897
|
-
zoom:
|
|
897
|
+
zoom: chunkSDOQKSKI_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
|
|
898
898
|
});
|
|
899
899
|
},
|
|
900
900
|
[store]
|
|
@@ -982,7 +982,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
982
982
|
const command = step.command;
|
|
983
983
|
const timer = window.setTimeout(
|
|
984
984
|
() => {
|
|
985
|
-
|
|
985
|
+
chunkXMLPTDPM_js.executeMediaCommand(command);
|
|
986
986
|
},
|
|
987
987
|
Math.max(0, step.delayMs)
|
|
988
988
|
);
|
|
@@ -1024,10 +1024,10 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
1024
1024
|
const nextStates = new Map(previousStates);
|
|
1025
1025
|
const currentState = nextStates.get(step.elementId) ?? {
|
|
1026
1026
|
visible: true};
|
|
1027
|
-
const visibleAfterStep = step.presetClass === "exit" ? false : currentState.visible;
|
|
1027
|
+
const visibleAfterStep = step.presetClass === "exit" || step.hideAfterEffect ? false : currentState.visible;
|
|
1028
1028
|
nextStates.set(step.elementId, {
|
|
1029
1029
|
visible: visibleAfterStep,
|
|
1030
|
-
cssAnimation: void 0
|
|
1030
|
+
cssAnimation: step.holdEndState ? step.cssAnimation : void 0
|
|
1031
1031
|
});
|
|
1032
1032
|
return nextStates;
|
|
1033
1033
|
});
|
|
@@ -1119,7 +1119,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1119
1119
|
}))
|
|
1120
1120
|
);
|
|
1121
1121
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1122
|
-
const delay =
|
|
1122
|
+
const delay = chunkSDOQKSKI_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1123
1123
|
const timer = window.setTimeout(() => {
|
|
1124
1124
|
setPresentationAnimations(
|
|
1125
1125
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1151,7 +1151,7 @@ function useAnimationPlayback(input) {
|
|
|
1151
1151
|
(controller, group) => {
|
|
1152
1152
|
driveBuildReveal(
|
|
1153
1153
|
controller,
|
|
1154
|
-
|
|
1154
|
+
chunkSDOQKSKI_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1155
1155
|
setPresentationElementStates,
|
|
1156
1156
|
buildRafRef
|
|
1157
1157
|
);
|
|
@@ -1220,7 +1220,7 @@ function useAnimationPlayback(input) {
|
|
|
1220
1220
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1221
1221
|
return;
|
|
1222
1222
|
}
|
|
1223
|
-
const controller =
|
|
1223
|
+
const controller = chunkSDOQKSKI_js.PresentationAnimationController.fromSlide(slide);
|
|
1224
1224
|
controllerRef.current = controller;
|
|
1225
1225
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1226
1226
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1378,12 +1378,12 @@ function useAnimationPlayback(input) {
|
|
|
1378
1378
|
presentationTimersRef
|
|
1379
1379
|
};
|
|
1380
1380
|
}
|
|
1381
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1382
|
-
var AUDIENCE_HASH =
|
|
1383
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1384
|
-
var AUDIENCE_NONCE_KEY =
|
|
1381
|
+
var PRESENTER_CHANNEL_NAME = chunkSDOQKSKI_js.PRESENTATION_CHANNEL_NAME;
|
|
1382
|
+
var AUDIENCE_HASH = chunkSDOQKSKI_js.PRESENTATION_HASH;
|
|
1383
|
+
var PRESENTER_MSG_ORIGIN = chunkSDOQKSKI_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1384
|
+
var AUDIENCE_NONCE_KEY = chunkSDOQKSKI_js.PRESENTATION_NONCE_KEY;
|
|
1385
1385
|
function generateSessionId() {
|
|
1386
|
-
return
|
|
1386
|
+
return chunkSDOQKSKI_js.createPresentationSessionId();
|
|
1387
1387
|
}
|
|
1388
1388
|
function parseAudienceNonce() {
|
|
1389
1389
|
const hash = window.location.hash;
|
|
@@ -1419,7 +1419,7 @@ function usePresenterWindow(input) {
|
|
|
1419
1419
|
}, []);
|
|
1420
1420
|
const swapDisplays = react.useCallback(async () => {
|
|
1421
1421
|
const audience = audienceWindowRef.current;
|
|
1422
|
-
return audience && !audience.closed ?
|
|
1422
|
+
return audience && !audience.closed ? chunkSDOQKSKI_js.swapPresentationWindows(window, audience) : false;
|
|
1423
1423
|
}, []);
|
|
1424
1424
|
const syncSlideToAudience = react.useCallback(
|
|
1425
1425
|
(slideIndex) => {
|
|
@@ -1483,7 +1483,7 @@ function usePresenterWindow(input) {
|
|
|
1483
1483
|
pollTimerRef.current = null;
|
|
1484
1484
|
}
|
|
1485
1485
|
if (closingSessionId) {
|
|
1486
|
-
void
|
|
1486
|
+
void chunkSDOQKSKI_js.clearAudienceContent(closingSessionId);
|
|
1487
1487
|
}
|
|
1488
1488
|
}, [getChannel]);
|
|
1489
1489
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1501,10 +1501,10 @@ function usePresenterWindow(input) {
|
|
|
1501
1501
|
audienceWindowRef.current = blankWin;
|
|
1502
1502
|
const sessionId = generateSessionId();
|
|
1503
1503
|
sessionIdRef.current = sessionId;
|
|
1504
|
-
const audienceUrl =
|
|
1505
|
-
void
|
|
1504
|
+
const audienceUrl = chunkSDOQKSKI_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1505
|
+
void chunkSDOQKSKI_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1506
1506
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1507
|
-
|
|
1507
|
+
chunkSDOQKSKI_js.placeAudienceWindow(blankWin, placement);
|
|
1508
1508
|
}
|
|
1509
1509
|
return void 0;
|
|
1510
1510
|
});
|
|
@@ -1534,7 +1534,7 @@ function usePresenterWindow(input) {
|
|
|
1534
1534
|
}
|
|
1535
1535
|
};
|
|
1536
1536
|
if (content) {
|
|
1537
|
-
void
|
|
1537
|
+
void chunkSDOQKSKI_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1538
1538
|
} else {
|
|
1539
1539
|
navigateOrClose(true);
|
|
1540
1540
|
}
|
|
@@ -1560,7 +1560,7 @@ function usePresenterWindow(input) {
|
|
|
1560
1560
|
}
|
|
1561
1561
|
const handleMessage = (event) => {
|
|
1562
1562
|
const message = event.data;
|
|
1563
|
-
if (
|
|
1563
|
+
if (chunkSDOQKSKI_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1564
1564
|
syncStateToAudience(snapshotRef.current);
|
|
1565
1565
|
}
|
|
1566
1566
|
};
|
|
@@ -1589,7 +1589,7 @@ function usePresenterWindow(input) {
|
|
|
1589
1589
|
react.useEffect(() => {
|
|
1590
1590
|
const handleBeforeUnload = () => {
|
|
1591
1591
|
if (sessionIdRef.current) {
|
|
1592
|
-
void
|
|
1592
|
+
void chunkSDOQKSKI_js.clearAudienceContent(sessionIdRef.current);
|
|
1593
1593
|
}
|
|
1594
1594
|
};
|
|
1595
1595
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1651,7 +1651,7 @@ function useAudienceMode(input) {
|
|
|
1651
1651
|
}
|
|
1652
1652
|
channel.onmessage = (event) => {
|
|
1653
1653
|
const data = event.data;
|
|
1654
|
-
if (!
|
|
1654
|
+
if (!chunkSDOQKSKI_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1655
1655
|
return;
|
|
1656
1656
|
}
|
|
1657
1657
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1667,16 +1667,16 @@ function useAudienceMode(input) {
|
|
|
1667
1667
|
}
|
|
1668
1668
|
if (data.type === "presenter-exit") {
|
|
1669
1669
|
if (expectedSessionId) {
|
|
1670
|
-
void
|
|
1670
|
+
void chunkSDOQKSKI_js.clearAudienceContent(expectedSessionId);
|
|
1671
1671
|
}
|
|
1672
|
-
if (
|
|
1672
|
+
if (chunkSDOQKSKI_js.endAudienceDisplay(window)) {
|
|
1673
1673
|
handlers.onPresenterEnded?.();
|
|
1674
1674
|
}
|
|
1675
1675
|
}
|
|
1676
1676
|
};
|
|
1677
1677
|
if (expectedSessionId) {
|
|
1678
1678
|
channel.postMessage({
|
|
1679
|
-
origin:
|
|
1679
|
+
origin: chunkSDOQKSKI_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1680
1680
|
type: "audience-ready",
|
|
1681
1681
|
sessionId: expectedSessionId
|
|
1682
1682
|
});
|
|
@@ -1690,7 +1690,7 @@ function useAudienceMode(input) {
|
|
|
1690
1690
|
}, []);
|
|
1691
1691
|
}
|
|
1692
1692
|
function usePresentationKeyboard(input) {
|
|
1693
|
-
const wheelBufferRef = react.useRef(
|
|
1693
|
+
const wheelBufferRef = react.useRef(chunkSDOQKSKI_js.createWheelStepBuffer());
|
|
1694
1694
|
const {
|
|
1695
1695
|
mode,
|
|
1696
1696
|
movePresentationSlide,
|
|
@@ -1711,14 +1711,14 @@ function usePresentationKeyboard(input) {
|
|
|
1711
1711
|
presentationSlideIndex,
|
|
1712
1712
|
setShowRehearsalSummary
|
|
1713
1713
|
} = input;
|
|
1714
|
-
const keyBufferRef = react.useRef(
|
|
1714
|
+
const keyBufferRef = react.useRef(chunkSDOQKSKI_js.createPresentationKeyBuffer());
|
|
1715
1715
|
react.useEffect(() => {
|
|
1716
|
-
if (mode !== "present" || !
|
|
1717
|
-
keyBufferRef.current =
|
|
1716
|
+
if (mode !== "present" || !chunkSDOQKSKI_js.acceptsPresentationInput()) {
|
|
1717
|
+
keyBufferRef.current = chunkSDOQKSKI_js.createPresentationKeyBuffer();
|
|
1718
1718
|
return;
|
|
1719
1719
|
}
|
|
1720
1720
|
const handleKeyDown = (event) => {
|
|
1721
|
-
const mapped =
|
|
1721
|
+
const mapped = chunkSDOQKSKI_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1722
1722
|
if (mapped.action === "none") {
|
|
1723
1723
|
return;
|
|
1724
1724
|
}
|
|
@@ -1738,12 +1738,12 @@ function usePresentationKeyboard(input) {
|
|
|
1738
1738
|
movePresentationSlide(-1);
|
|
1739
1739
|
return;
|
|
1740
1740
|
case "first": {
|
|
1741
|
-
const first =
|
|
1741
|
+
const first = chunkSDOQKSKI_js.firstShowSlideIndex(showSlideIndexes);
|
|
1742
1742
|
navigateToSlide(first ?? 0);
|
|
1743
1743
|
return;
|
|
1744
1744
|
}
|
|
1745
1745
|
case "last": {
|
|
1746
|
-
const last =
|
|
1746
|
+
const last = chunkSDOQKSKI_js.lastShowSlideIndex(showSlideIndexes);
|
|
1747
1747
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1748
1748
|
return;
|
|
1749
1749
|
}
|
|
@@ -1781,10 +1781,10 @@ function usePresentationKeyboard(input) {
|
|
|
1781
1781
|
}
|
|
1782
1782
|
};
|
|
1783
1783
|
const handleWheel = (event) => {
|
|
1784
|
-
if (mode !== "present" || !
|
|
1784
|
+
if (mode !== "present" || !chunkSDOQKSKI_js.acceptsPresentationInput()) {
|
|
1785
1785
|
return;
|
|
1786
1786
|
}
|
|
1787
|
-
const mapped =
|
|
1787
|
+
const mapped = chunkSDOQKSKI_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1788
1788
|
if (mapped.intent === "next-slide") {
|
|
1789
1789
|
event.preventDefault();
|
|
1790
1790
|
movePresentationSlide(1);
|
|
@@ -1917,7 +1917,7 @@ function useRehearsalTimings(input) {
|
|
|
1917
1917
|
|
|
1918
1918
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1919
1919
|
function handlePresentationActionImpl(action, deps) {
|
|
1920
|
-
|
|
1920
|
+
chunkSDOQKSKI_js.runPresentationAction(
|
|
1921
1921
|
action,
|
|
1922
1922
|
{ slideCount: deps.slidesLength },
|
|
1923
1923
|
{
|
|
@@ -1939,7 +1939,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1939
1939
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1940
1940
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1941
1941
|
const transition = incomingSlide?.transition;
|
|
1942
|
-
const durationMs = deps.playTransition ?
|
|
1942
|
+
const durationMs = deps.playTransition ? chunkSDOQKSKI_js.resolveTransitionDurationMs(transition) : 0;
|
|
1943
1943
|
deps.clearPresentationTimers();
|
|
1944
1944
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1945
1945
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1998,7 +1998,7 @@ function useSlideNavigation(input) {
|
|
|
1998
1998
|
});
|
|
1999
1999
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
2000
2000
|
(slideIndex) => {
|
|
2001
|
-
const delayMs =
|
|
2001
|
+
const delayMs = chunkSDOQKSKI_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
2002
2002
|
if (delayMs === void 0) {
|
|
2003
2003
|
return;
|
|
2004
2004
|
}
|
|
@@ -2021,7 +2021,7 @@ function useSlideNavigation(input) {
|
|
|
2021
2021
|
if (availableSlideIndexes.length === 0) {
|
|
2022
2022
|
return;
|
|
2023
2023
|
}
|
|
2024
|
-
const pastLastSlide = direction === 1 && !
|
|
2024
|
+
const pastLastSlide = direction === 1 && !chunkSDOQKSKI_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
2025
2025
|
if (rehearsing && pastLastSlide) {
|
|
2026
2026
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
2027
2027
|
try {
|
|
@@ -2039,9 +2039,9 @@ function useSlideNavigation(input) {
|
|
|
2039
2039
|
onAdvancePastLastSlide();
|
|
2040
2040
|
return;
|
|
2041
2041
|
}
|
|
2042
|
-
const nextSlideIndex = direction === 1 ?
|
|
2042
|
+
const nextSlideIndex = direction === 1 ? chunkSDOQKSKI_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
2043
2043
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
2044
|
-
}) :
|
|
2044
|
+
}) : chunkSDOQKSKI_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
2045
2045
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
2046
2046
|
return;
|
|
2047
2047
|
}
|
|
@@ -2186,22 +2186,22 @@ function useZoomNavigation(input) {
|
|
|
2186
2186
|
};
|
|
2187
2187
|
}
|
|
2188
2188
|
function usePresenterConsole(slideIndex, active) {
|
|
2189
|
-
const timerRef = react.useRef(
|
|
2190
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2189
|
+
const timerRef = react.useRef(chunkSDOQKSKI_js.createPresenterTimer());
|
|
2190
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkSDOQKSKI_js.createInitialPresentationSnapshot(slideIndex));
|
|
2191
2191
|
const patch = react.useCallback((value) => {
|
|
2192
|
-
setSnapshot((current) =>
|
|
2192
|
+
setSnapshot((current) => chunkSDOQKSKI_js.mergePresentationSnapshot(current, value));
|
|
2193
2193
|
}, []);
|
|
2194
2194
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2195
2195
|
react.useEffect(() => {
|
|
2196
2196
|
if (!active) {
|
|
2197
2197
|
return;
|
|
2198
2198
|
}
|
|
2199
|
-
timerRef.current =
|
|
2199
|
+
timerRef.current = chunkSDOQKSKI_js.resetPresenterTimer();
|
|
2200
2200
|
patch({ paused: false, elapsedMs: 0 });
|
|
2201
2201
|
const timer = window.setInterval(() => {
|
|
2202
2202
|
patch({
|
|
2203
2203
|
paused: timerRef.current.paused,
|
|
2204
|
-
elapsedMs:
|
|
2204
|
+
elapsedMs: chunkSDOQKSKI_js.presenterElapsed(timerRef.current)
|
|
2205
2205
|
});
|
|
2206
2206
|
}, 1e3);
|
|
2207
2207
|
return () => window.clearInterval(timer);
|
|
@@ -2211,19 +2211,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2211
2211
|
applyAudienceSnapshot: setSnapshot,
|
|
2212
2212
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2213
2213
|
toggleTimer: () => {
|
|
2214
|
-
timerRef.current =
|
|
2214
|
+
timerRef.current = chunkSDOQKSKI_js.togglePresenterTimer(timerRef.current);
|
|
2215
2215
|
patch({
|
|
2216
2216
|
paused: timerRef.current.paused,
|
|
2217
|
-
elapsedMs:
|
|
2217
|
+
elapsedMs: chunkSDOQKSKI_js.presenterElapsed(timerRef.current)
|
|
2218
2218
|
});
|
|
2219
2219
|
},
|
|
2220
2220
|
resetTimer: () => {
|
|
2221
|
-
timerRef.current =
|
|
2221
|
+
timerRef.current = chunkSDOQKSKI_js.resetPresenterTimer();
|
|
2222
2222
|
patch({ paused: false, elapsedMs: 0 });
|
|
2223
2223
|
},
|
|
2224
2224
|
stepZoom: (direction) => setSnapshot(
|
|
2225
|
-
(current) =>
|
|
2226
|
-
zoom:
|
|
2225
|
+
(current) => chunkSDOQKSKI_js.mergePresentationSnapshot(current, {
|
|
2226
|
+
zoom: chunkSDOQKSKI_js.stepPresenterZoom(
|
|
2227
2227
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2228
2228
|
direction
|
|
2229
2229
|
)
|
|
@@ -2269,7 +2269,7 @@ function usePresentationMode(input) {
|
|
|
2269
2269
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2270
2270
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2271
2271
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2272
|
-
const showGuard = react.useMemo(() =>
|
|
2272
|
+
const showGuard = react.useMemo(() => chunkSDOQKSKI_js.createPresenterShowGuard(), []);
|
|
2273
2273
|
const {
|
|
2274
2274
|
presentationAnimations,
|
|
2275
2275
|
presentationElementStates,
|
|
@@ -2348,7 +2348,7 @@ function usePresentationMode(input) {
|
|
|
2348
2348
|
});
|
|
2349
2349
|
const movePresentationSlide = react.useCallback(
|
|
2350
2350
|
(direction, trigger = "explicit") => {
|
|
2351
|
-
if (!
|
|
2351
|
+
if (!chunkSDOQKSKI_js.acceptsPresentationInput()) {
|
|
2352
2352
|
return;
|
|
2353
2353
|
}
|
|
2354
2354
|
if (endOfShowVisible) {
|
|
@@ -2486,7 +2486,7 @@ function usePresentationMode(input) {
|
|
|
2486
2486
|
if (mode !== "present") {
|
|
2487
2487
|
return;
|
|
2488
2488
|
}
|
|
2489
|
-
return
|
|
2489
|
+
return chunkSDOQKSKI_js.attachPresentationVisibilityPause({
|
|
2490
2490
|
root: containerRef.current ?? void 0,
|
|
2491
2491
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2492
2492
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2566,11 +2566,11 @@ function usePresentationMode(input) {
|
|
|
2566
2566
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2567
2567
|
return void 0;
|
|
2568
2568
|
}
|
|
2569
|
-
return
|
|
2569
|
+
return chunkSDOQKSKI_js.buildMorphTransitionPlan(
|
|
2570
2570
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2571
2571
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2572
2572
|
transitionOverlay.durationMs,
|
|
2573
|
-
|
|
2573
|
+
chunkSDOQKSKI_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2574
2574
|
);
|
|
2575
2575
|
}, [transitionOverlay, slides]);
|
|
2576
2576
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2591,7 +2591,7 @@ function usePresentationMode(input) {
|
|
|
2591
2591
|
if (!morphPlan) {
|
|
2592
2592
|
return presentationKeyframesCss;
|
|
2593
2593
|
}
|
|
2594
|
-
const imageRules =
|
|
2594
|
+
const imageRules = chunkSDOQKSKI_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2595
2595
|
return `${presentationKeyframesCss ?? ""}
|
|
2596
2596
|
${morphPlan.keyframesCss}
|
|
2597
2597
|
${imageRules}`;
|
|
@@ -2887,7 +2887,7 @@ function useFindReplace({
|
|
|
2887
2887
|
const [findResults, setFindResults] = react.useState([]);
|
|
2888
2888
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
2889
2889
|
const performFind = react.useCallback(() => {
|
|
2890
|
-
const results =
|
|
2890
|
+
const results = chunkSDOQKSKI_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
2891
2891
|
if (!findQuery) {
|
|
2892
2892
|
setFindResults([]);
|
|
2893
2893
|
setFindResultIndex(-1);
|
|
@@ -2921,7 +2921,7 @@ function useFindReplace({
|
|
|
2921
2921
|
return;
|
|
2922
2922
|
}
|
|
2923
2923
|
onUpdateSlides(
|
|
2924
|
-
(prevSlides) =>
|
|
2924
|
+
(prevSlides) => chunkSDOQKSKI_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
2925
2925
|
);
|
|
2926
2926
|
onMarkDirty();
|
|
2927
2927
|
},
|
|
@@ -2943,9 +2943,9 @@ function useFindReplace({
|
|
|
2943
2943
|
}, [findResults, applyReplacements, performFind]);
|
|
2944
2944
|
react.useEffect(() => {
|
|
2945
2945
|
const handler = (event) => {
|
|
2946
|
-
const { action } =
|
|
2946
|
+
const { action } = chunkSDOQKSKI_js.mapEditorKey(event, {
|
|
2947
2947
|
canEdit: mode === "edit",
|
|
2948
|
-
isTextInputTarget:
|
|
2948
|
+
isTextInputTarget: chunkSDOQKSKI_js.isEditorTextInputTarget(event.target)
|
|
2949
2949
|
});
|
|
2950
2950
|
if (action !== "find") {
|
|
2951
2951
|
return;
|
|
@@ -3024,7 +3024,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId) {
|
|
|
3024
3024
|
if (!slide) {
|
|
3025
3025
|
return { slides, didAdd: false };
|
|
3026
3026
|
}
|
|
3027
|
-
const next =
|
|
3027
|
+
const next = chunkSDOQKSKI_js.addCommentToList(
|
|
3028
3028
|
slide.comments || [],
|
|
3029
3029
|
text,
|
|
3030
3030
|
authorName,
|
|
@@ -3042,7 +3042,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
|
3042
3042
|
if (!slide) {
|
|
3043
3043
|
return { slides, didDelete: false };
|
|
3044
3044
|
}
|
|
3045
|
-
const next =
|
|
3045
|
+
const next = chunkSDOQKSKI_js.removeCommentFromList(slide.comments || [], commentId);
|
|
3046
3046
|
if (!next) {
|
|
3047
3047
|
return { slides, didDelete: false };
|
|
3048
3048
|
}
|
|
@@ -3053,7 +3053,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
|
3053
3053
|
if (!slide) {
|
|
3054
3054
|
return { slides, didUpdate: false };
|
|
3055
3055
|
}
|
|
3056
|
-
const next =
|
|
3056
|
+
const next = chunkSDOQKSKI_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
3057
3057
|
if (!next) {
|
|
3058
3058
|
return { slides, didUpdate: false };
|
|
3059
3059
|
}
|
|
@@ -3064,7 +3064,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
|
3064
3064
|
if (!slide) {
|
|
3065
3065
|
return { slides, didUpdate: false };
|
|
3066
3066
|
}
|
|
3067
|
-
const next =
|
|
3067
|
+
const next = chunkSDOQKSKI_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
3068
3068
|
if (!next) {
|
|
3069
3069
|
return { slides, didUpdate: false };
|
|
3070
3070
|
}
|
|
@@ -3075,7 +3075,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName) {
|
|
|
3075
3075
|
if (!slide) {
|
|
3076
3076
|
return { slides, didAdd: false };
|
|
3077
3077
|
}
|
|
3078
|
-
const next =
|
|
3078
|
+
const next = chunkSDOQKSKI_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
3079
3079
|
if (!next) {
|
|
3080
3080
|
return { slides, didAdd: false };
|
|
3081
3081
|
}
|
|
@@ -3449,7 +3449,7 @@ function useViewerCoreState(_input) {
|
|
|
3449
3449
|
const marqueeStateRef = react.useRef(null);
|
|
3450
3450
|
const isDrawingRef = react.useRef(false);
|
|
3451
3451
|
const justInteractedRef = react.useRef(false);
|
|
3452
|
-
const livePatcher = react.useMemo(() =>
|
|
3452
|
+
const livePatcher = react.useMemo(() => chunkSDOQKSKI_js.createCollaborationLivePatcher(), []);
|
|
3453
3453
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3454
3454
|
const slidesRef = react.useRef([]);
|
|
3455
3455
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3458,8 +3458,8 @@ function useViewerCoreState(_input) {
|
|
|
3458
3458
|
const [slides, setSlides] = react.useState([]);
|
|
3459
3459
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3460
3460
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3461
|
-
width:
|
|
3462
|
-
height:
|
|
3461
|
+
width: chunkXMLPTDPM_js.DEFAULT_CANVAS_WIDTH,
|
|
3462
|
+
height: chunkXMLPTDPM_js.DEFAULT_CANVAS_HEIGHT
|
|
3463
3463
|
});
|
|
3464
3464
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3465
3465
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3480,7 +3480,7 @@ function useViewerCoreState(_input) {
|
|
|
3480
3480
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3481
3481
|
inlineEditingTextRef.current = resolved;
|
|
3482
3482
|
setInlineEditingTextBase(value);
|
|
3483
|
-
|
|
3483
|
+
chunkSDOQKSKI_js.publishLiveInlineText(
|
|
3484
3484
|
livePatcher,
|
|
3485
3485
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3486
3486
|
inlineEditingElementIdRef.current,
|
|
@@ -3505,6 +3505,7 @@ function useViewerCoreState(_input) {
|
|
|
3505
3505
|
const [presentationProperties, setPresentationProperties] = react.useState(
|
|
3506
3506
|
{}
|
|
3507
3507
|
);
|
|
3508
|
+
const [viewProperties, setViewProperties] = react.useState(void 0);
|
|
3508
3509
|
const [notesMaster, setNotesMaster] = react.useState();
|
|
3509
3510
|
const [handoutMaster, setHandoutMaster] = react.useState();
|
|
3510
3511
|
const [notesCanvasSize, setNotesCanvasSize] = react.useState();
|
|
@@ -3602,6 +3603,8 @@ function useViewerCoreState(_input) {
|
|
|
3602
3603
|
setSections,
|
|
3603
3604
|
presentationProperties,
|
|
3604
3605
|
setPresentationProperties,
|
|
3606
|
+
viewProperties,
|
|
3607
|
+
setViewProperties,
|
|
3605
3608
|
notesMaster,
|
|
3606
3609
|
setNotesMaster,
|
|
3607
3610
|
handoutMaster,
|
|
@@ -3777,6 +3780,7 @@ function useLoadContent({
|
|
|
3777
3780
|
setActiveCustomShowId,
|
|
3778
3781
|
setSections,
|
|
3779
3782
|
setPresentationProperties,
|
|
3783
|
+
setViewProperties,
|
|
3780
3784
|
setNotesMaster,
|
|
3781
3785
|
setHandoutMaster,
|
|
3782
3786
|
setNotesCanvasSize,
|
|
@@ -3819,7 +3823,7 @@ function useLoadContent({
|
|
|
3819
3823
|
);
|
|
3820
3824
|
}
|
|
3821
3825
|
const previousHandler = handlerRef.current;
|
|
3822
|
-
const handler = new
|
|
3826
|
+
const handler = new chunkSDOQKSKI_js.PptxHandler();
|
|
3823
3827
|
const parsed = await handler.load(buffer);
|
|
3824
3828
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3825
3829
|
handler.dispose();
|
|
@@ -3831,7 +3835,7 @@ function useLoadContent({
|
|
|
3831
3835
|
handlerRef.current = null;
|
|
3832
3836
|
const mediaElements = [];
|
|
3833
3837
|
for (const slide of parsed.slides) {
|
|
3834
|
-
|
|
3838
|
+
chunkSDOQKSKI_js.collectMediaElements(slide.elements, mediaElements);
|
|
3835
3839
|
}
|
|
3836
3840
|
for (const url of mediaDataUrls.values()) {
|
|
3837
3841
|
if (url.startsWith("blob:")) {
|
|
@@ -3872,7 +3876,7 @@ function useLoadContent({
|
|
|
3872
3876
|
}
|
|
3873
3877
|
})
|
|
3874
3878
|
);
|
|
3875
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3879
|
+
const { paths: imagePaths, refs: imageRefs } = chunkSDOQKSKI_js.collectImagePaths(parsed.slides);
|
|
3876
3880
|
let nextSlides = parsed.slides;
|
|
3877
3881
|
if (imagePaths.size > 0) {
|
|
3878
3882
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3926,13 +3930,61 @@ function useLoadContent({
|
|
|
3926
3930
|
});
|
|
3927
3931
|
}
|
|
3928
3932
|
}
|
|
3933
|
+
const { paths: tableImagePaths, refs: tableImageRefs } = chunkSDOQKSKI_js.collectTableCellImagePaths(nextSlides);
|
|
3934
|
+
if (tableImagePaths.size > 0) {
|
|
3935
|
+
const resolvedTableMap = /* @__PURE__ */ new Map();
|
|
3936
|
+
await Promise.all(
|
|
3937
|
+
Array.from(tableImagePaths).map(async (path) => {
|
|
3938
|
+
try {
|
|
3939
|
+
const url = await handler.getImageData(path);
|
|
3940
|
+
if (url) {
|
|
3941
|
+
resolvedTableMap.set(path, url);
|
|
3942
|
+
}
|
|
3943
|
+
} catch {
|
|
3944
|
+
}
|
|
3945
|
+
})
|
|
3946
|
+
);
|
|
3947
|
+
if (resolvedTableMap.size > 0) {
|
|
3948
|
+
nextSlides = nextSlides.map((s) => {
|
|
3949
|
+
const newElements = chunkSDOQKSKI_js.applyTableCellImagePatches(
|
|
3950
|
+
s.elements,
|
|
3951
|
+
resolvedTableMap,
|
|
3952
|
+
tableImageRefs
|
|
3953
|
+
);
|
|
3954
|
+
return newElements === s.elements ? s : { ...s, elements: newElements };
|
|
3955
|
+
});
|
|
3956
|
+
}
|
|
3957
|
+
}
|
|
3958
|
+
let nextTableStyleMap = parsed.tableStyleMap;
|
|
3959
|
+
const { paths: tableStyleImagePaths, refs: tableStyleImageRefs } = chunkSDOQKSKI_js.collectTableStyleImagePaths(nextTableStyleMap);
|
|
3960
|
+
if (tableStyleImagePaths.size > 0) {
|
|
3961
|
+
const resolvedStyleMap = /* @__PURE__ */ new Map();
|
|
3962
|
+
await Promise.all(
|
|
3963
|
+
Array.from(tableStyleImagePaths).map(async (path) => {
|
|
3964
|
+
try {
|
|
3965
|
+
const url = await handler.getImageData(path);
|
|
3966
|
+
if (url) {
|
|
3967
|
+
resolvedStyleMap.set(path, url);
|
|
3968
|
+
}
|
|
3969
|
+
} catch {
|
|
3970
|
+
}
|
|
3971
|
+
})
|
|
3972
|
+
);
|
|
3973
|
+
if (resolvedStyleMap.size > 0 && nextTableStyleMap) {
|
|
3974
|
+
nextTableStyleMap = chunkSDOQKSKI_js.applyTableStyleImagePatches(
|
|
3975
|
+
nextTableStyleMap,
|
|
3976
|
+
resolvedStyleMap,
|
|
3977
|
+
tableStyleImageRefs
|
|
3978
|
+
);
|
|
3979
|
+
}
|
|
3980
|
+
}
|
|
3929
3981
|
handlerRef.current = handler;
|
|
3930
|
-
const partition =
|
|
3982
|
+
const partition = chunkSDOQKSKI_js.partitionTemplateElements(nextSlides);
|
|
3931
3983
|
setSlides(partition.slides);
|
|
3932
3984
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3933
3985
|
setCanvasSize({
|
|
3934
|
-
width: parsed.width ??
|
|
3935
|
-
height: parsed.height ??
|
|
3986
|
+
width: parsed.width ?? chunkXMLPTDPM_js.DEFAULT_CANVAS_WIDTH,
|
|
3987
|
+
height: parsed.height ?? chunkXMLPTDPM_js.DEFAULT_CANVAS_HEIGHT
|
|
3936
3988
|
});
|
|
3937
3989
|
setSlideSizeEmu(
|
|
3938
3990
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -3945,14 +3997,15 @@ function useLoadContent({
|
|
|
3945
3997
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
3946
3998
|
setSlideMasters(parsed.slideMasters ?? []);
|
|
3947
3999
|
setTheme(parsed.theme);
|
|
3948
|
-
setTableStyleMap(
|
|
4000
|
+
setTableStyleMap(nextTableStyleMap);
|
|
3949
4001
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
3950
4002
|
setCustomShows(parsed.customShows ?? []);
|
|
3951
4003
|
setActiveCustomShowId(
|
|
3952
|
-
|
|
4004
|
+
chunkSDOQKSKI_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
3953
4005
|
);
|
|
3954
4006
|
setSections(parsed.sections ?? []);
|
|
3955
4007
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
4008
|
+
setViewProperties(parsed.viewProperties);
|
|
3956
4009
|
setNotesMaster(parsed.notesMaster);
|
|
3957
4010
|
setHandoutMaster(parsed.handoutMaster);
|
|
3958
4011
|
if (typeof parsed.notesWidthEmu === "number" && typeof parsed.notesHeightEmu === "number" && parsed.notesWidthEmu > 0 && parsed.notesHeightEmu > 0) {
|
|
@@ -3971,7 +4024,7 @@ function useLoadContent({
|
|
|
3971
4024
|
setHasMacros(parsed.hasMacros === true);
|
|
3972
4025
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3973
4026
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3974
|
-
setGuides(
|
|
4027
|
+
setGuides(chunkSDOQKSKI_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3975
4028
|
setActiveSlideIndex(0);
|
|
3976
4029
|
clearSelection();
|
|
3977
4030
|
setIsDirty(false);
|
|
@@ -3979,9 +4032,10 @@ function useLoadContent({
|
|
|
3979
4032
|
onContentApplied?.();
|
|
3980
4033
|
} catch (err) {
|
|
3981
4034
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3982
|
-
if (err instanceof
|
|
4035
|
+
if (err instanceof chunkSDOQKSKI_js.EncryptedFileError) {
|
|
3983
4036
|
setIsEncrypted(true);
|
|
3984
4037
|
} else {
|
|
4038
|
+
console.error("[pptx] Failed to load presentation content:", err);
|
|
3985
4039
|
setError(err instanceof Error ? err.message : String(err));
|
|
3986
4040
|
}
|
|
3987
4041
|
}
|
|
@@ -4006,7 +4060,7 @@ function useLoadContent({
|
|
|
4006
4060
|
}
|
|
4007
4061
|
function useAutosave(input) {
|
|
4008
4062
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4009
|
-
const intervalMs =
|
|
4063
|
+
const intervalMs = chunkSDOQKSKI_js.resolveAutosaveIntervalMs({
|
|
4010
4064
|
hostIntervalMs: input.intervalMs,
|
|
4011
4065
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4012
4066
|
});
|
|
@@ -4037,7 +4091,7 @@ function useAutosave(input) {
|
|
|
4037
4091
|
return;
|
|
4038
4092
|
}
|
|
4039
4093
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4040
|
-
if (!
|
|
4094
|
+
if (!chunkSDOQKSKI_js.shouldWriteAutosaveSnapshot({
|
|
4041
4095
|
filePath: path,
|
|
4042
4096
|
isDirty: isDirtyRef.current,
|
|
4043
4097
|
saving: isSavingRef.current,
|
|
@@ -4055,8 +4109,8 @@ function useAutosave(input) {
|
|
|
4055
4109
|
isSavingRef.current = false;
|
|
4056
4110
|
return;
|
|
4057
4111
|
}
|
|
4058
|
-
await
|
|
4059
|
-
lastSnapshotRef.current =
|
|
4112
|
+
await chunkSDOQKSKI_js.saveAutosaveSnapshot(path, data);
|
|
4113
|
+
lastSnapshotRef.current = chunkSDOQKSKI_js.autosaveSnapshotMark(path, sources);
|
|
4060
4114
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4061
4115
|
} catch (err) {
|
|
4062
4116
|
setAutosaveStatus({
|
|
@@ -4142,11 +4196,11 @@ function useElementOperations(input) {
|
|
|
4142
4196
|
(elementId, updates) => {
|
|
4143
4197
|
if (masterView?.target) {
|
|
4144
4198
|
applyMasterViewWrite(
|
|
4145
|
-
|
|
4199
|
+
chunkSDOQKSKI_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4146
4200
|
);
|
|
4147
4201
|
return;
|
|
4148
4202
|
}
|
|
4149
|
-
if (
|
|
4203
|
+
if (chunkSDOQKSKI_js.isTemplateElementId(elementId)) {
|
|
4150
4204
|
const slideId = activeSlide?.id;
|
|
4151
4205
|
if (slideId) {
|
|
4152
4206
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4194,7 +4248,7 @@ function useElementOperations(input) {
|
|
|
4194
4248
|
);
|
|
4195
4249
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4196
4250
|
(updates) => {
|
|
4197
|
-
if (!selectedElement || !
|
|
4251
|
+
if (!selectedElement || !chunkSDOQKSKI_js.hasShapeProperties(selectedElement)) {
|
|
4198
4252
|
return;
|
|
4199
4253
|
}
|
|
4200
4254
|
updateSelectedElement({
|
|
@@ -4205,17 +4259,17 @@ function useElementOperations(input) {
|
|
|
4205
4259
|
);
|
|
4206
4260
|
const updateSelectedTextStyle = react.useCallback(
|
|
4207
4261
|
(updates) => {
|
|
4208
|
-
if (!selectedElement || !
|
|
4262
|
+
if (!selectedElement || !chunkSDOQKSKI_js.hasTextProperties(selectedElement)) {
|
|
4209
4263
|
return;
|
|
4210
4264
|
}
|
|
4211
|
-
const inlineSel =
|
|
4265
|
+
const inlineSel = chunkSDOQKSKI_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4212
4266
|
if (inlineSel && selectedElement.textSegments) {
|
|
4213
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4267
|
+
const { newSegments: newSegments2, newSelection } = chunkSDOQKSKI_js.applyStyleToSelectedSegments(
|
|
4214
4268
|
selectedElement.textSegments,
|
|
4215
4269
|
inlineSel,
|
|
4216
4270
|
updates
|
|
4217
4271
|
);
|
|
4218
|
-
|
|
4272
|
+
chunkSDOQKSKI_js.setPendingSelectionRestore(newSelection);
|
|
4219
4273
|
updateSelectedElement({
|
|
4220
4274
|
textSegments: newSegments2
|
|
4221
4275
|
});
|
|
@@ -4235,12 +4289,12 @@ function useElementOperations(input) {
|
|
|
4235
4289
|
);
|
|
4236
4290
|
const updateSelectedTextCase = react.useCallback(
|
|
4237
4291
|
(mode) => {
|
|
4238
|
-
if (!selectedElement || !
|
|
4292
|
+
if (!selectedElement || !chunkSDOQKSKI_js.hasTextProperties(selectedElement)) {
|
|
4239
4293
|
return;
|
|
4240
4294
|
}
|
|
4241
|
-
const inlineSel =
|
|
4295
|
+
const inlineSel = chunkSDOQKSKI_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4242
4296
|
if (inlineSel && selectedElement.textSegments) {
|
|
4243
|
-
const newSegments =
|
|
4297
|
+
const newSegments = chunkSDOQKSKI_js.applyCaseTransformToSegments(
|
|
4244
4298
|
selectedElement.textSegments,
|
|
4245
4299
|
inlineSel,
|
|
4246
4300
|
mode
|
|
@@ -4250,14 +4304,14 @@ function useElementOperations(input) {
|
|
|
4250
4304
|
}
|
|
4251
4305
|
const updates = {};
|
|
4252
4306
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4253
|
-
updates.textSegments =
|
|
4307
|
+
updates.textSegments = chunkSDOQKSKI_js.applyCaseTransformToSegments(
|
|
4254
4308
|
selectedElement.textSegments,
|
|
4255
4309
|
null,
|
|
4256
4310
|
mode
|
|
4257
4311
|
);
|
|
4258
4312
|
}
|
|
4259
4313
|
if (typeof selectedElement.text === "string") {
|
|
4260
|
-
updates.text =
|
|
4314
|
+
updates.text = chunkSDOQKSKI_js.transformTextCase(selectedElement.text, mode);
|
|
4261
4315
|
}
|
|
4262
4316
|
updateSelectedElement(updates);
|
|
4263
4317
|
},
|
|
@@ -4270,15 +4324,15 @@ function useElementOperations(input) {
|
|
|
4270
4324
|
[setSlides]
|
|
4271
4325
|
);
|
|
4272
4326
|
const masterViewTarget = masterView?.target ?? null;
|
|
4273
|
-
const activeElements = masterViewTarget ?
|
|
4327
|
+
const activeElements = masterViewTarget ? chunkSDOQKSKI_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4274
4328
|
const updateActiveElements = react.useCallback(
|
|
4275
4329
|
(updater) => {
|
|
4276
4330
|
if (masterView?.target) {
|
|
4277
4331
|
applyMasterViewWrite(
|
|
4278
|
-
|
|
4332
|
+
chunkSDOQKSKI_js.replaceMasterViewElements(
|
|
4279
4333
|
masterView,
|
|
4280
4334
|
masterView.target,
|
|
4281
|
-
updater(
|
|
4335
|
+
updater(chunkSDOQKSKI_js.masterViewElements(masterView, masterView.target))
|
|
4282
4336
|
)
|
|
4283
4337
|
);
|
|
4284
4338
|
return;
|
|
@@ -4331,7 +4385,7 @@ function useSectionOperations(input) {
|
|
|
4331
4385
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4332
4386
|
const addSection2 = react.useCallback(
|
|
4333
4387
|
(name, afterSlideIndex) => {
|
|
4334
|
-
const result =
|
|
4388
|
+
const result = chunkSDOQKSKI_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4335
4389
|
setSlides(result.slides);
|
|
4336
4390
|
setSections(result.sections);
|
|
4337
4391
|
markDirty();
|
|
@@ -4340,7 +4394,7 @@ function useSectionOperations(input) {
|
|
|
4340
4394
|
);
|
|
4341
4395
|
const renameSection2 = react.useCallback(
|
|
4342
4396
|
(sectionId, newName) => {
|
|
4343
|
-
const result =
|
|
4397
|
+
const result = chunkSDOQKSKI_js.renameSection(sections, slides, sectionId, newName);
|
|
4344
4398
|
setSections(result.sections);
|
|
4345
4399
|
setSlides(result.slides);
|
|
4346
4400
|
markDirty();
|
|
@@ -4349,7 +4403,7 @@ function useSectionOperations(input) {
|
|
|
4349
4403
|
);
|
|
4350
4404
|
const deleteSection2 = react.useCallback(
|
|
4351
4405
|
(sectionId) => {
|
|
4352
|
-
const result =
|
|
4406
|
+
const result = chunkSDOQKSKI_js.deleteSection(sections, slides, sectionId);
|
|
4353
4407
|
setSections(result.sections);
|
|
4354
4408
|
setSlides(result.slides);
|
|
4355
4409
|
markDirty();
|
|
@@ -4358,21 +4412,21 @@ function useSectionOperations(input) {
|
|
|
4358
4412
|
);
|
|
4359
4413
|
const moveSectionUp2 = react.useCallback(
|
|
4360
4414
|
(sectionId) => {
|
|
4361
|
-
setSections(
|
|
4415
|
+
setSections(chunkSDOQKSKI_js.moveSectionUp(sections, sectionId));
|
|
4362
4416
|
markDirty();
|
|
4363
4417
|
},
|
|
4364
4418
|
[sections, setSections, markDirty]
|
|
4365
4419
|
);
|
|
4366
4420
|
const moveSectionDown2 = react.useCallback(
|
|
4367
4421
|
(sectionId) => {
|
|
4368
|
-
setSections(
|
|
4422
|
+
setSections(chunkSDOQKSKI_js.moveSectionDown(sections, sectionId));
|
|
4369
4423
|
markDirty();
|
|
4370
4424
|
},
|
|
4371
4425
|
[sections, setSections, markDirty]
|
|
4372
4426
|
);
|
|
4373
4427
|
const moveSlidesToSection2 = react.useCallback(
|
|
4374
4428
|
(slideIndexes, targetSectionId) => {
|
|
4375
|
-
const result =
|
|
4429
|
+
const result = chunkSDOQKSKI_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4376
4430
|
setSlides(result.slides);
|
|
4377
4431
|
setSections(result.sections);
|
|
4378
4432
|
markDirty();
|
|
@@ -4401,19 +4455,19 @@ function useSectionOperations(input) {
|
|
|
4401
4455
|
|
|
4402
4456
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4403
4457
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4404
|
-
const resized =
|
|
4458
|
+
const resized = chunkSDOQKSKI_js.applyResize(
|
|
4405
4459
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4406
4460
|
handle,
|
|
4407
4461
|
dx,
|
|
4408
4462
|
dy,
|
|
4409
4463
|
1,
|
|
4410
|
-
{ minSize:
|
|
4464
|
+
{ minSize: chunkXMLPTDPM_js.MIN_ELEMENT_SIZE }
|
|
4411
4465
|
);
|
|
4412
4466
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4413
4467
|
if (!snapToGrid) {
|
|
4414
4468
|
return box;
|
|
4415
4469
|
}
|
|
4416
|
-
return
|
|
4470
|
+
return chunkSDOQKSKI_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkXMLPTDPM_js.MIN_ELEMENT_SIZE);
|
|
4417
4471
|
}
|
|
4418
4472
|
function resolveLiveTarget(input) {
|
|
4419
4473
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4526,7 +4580,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4526
4580
|
width: el.width,
|
|
4527
4581
|
height: el.height
|
|
4528
4582
|
}));
|
|
4529
|
-
const snapResult =
|
|
4583
|
+
const snapResult = chunkSDOQKSKI_js.computeSnapToShape(
|
|
4530
4584
|
targetX,
|
|
4531
4585
|
targetY,
|
|
4532
4586
|
primaryEl.width,
|
|
@@ -4565,7 +4619,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4565
4619
|
if (live) {
|
|
4566
4620
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4567
4621
|
const start = drag.startPositionsById[id];
|
|
4568
|
-
|
|
4622
|
+
chunkSDOQKSKI_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4569
4623
|
x: start.x + appliedDx,
|
|
4570
4624
|
y: start.y + appliedDy
|
|
4571
4625
|
});
|
|
@@ -4599,22 +4653,22 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4599
4653
|
if (rs.domEl) {
|
|
4600
4654
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4601
4655
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4602
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4603
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4656
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunkXMLPTDPM_js.MIN_ELEMENT_SIZE)}px`;
|
|
4657
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunkXMLPTDPM_js.MIN_ELEMENT_SIZE)}px`;
|
|
4604
4658
|
}
|
|
4605
4659
|
if (live) {
|
|
4606
|
-
|
|
4660
|
+
chunkSDOQKSKI_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4607
4661
|
x: geo.x,
|
|
4608
4662
|
y: geo.y,
|
|
4609
|
-
width: Math.max(geo.width,
|
|
4610
|
-
height: Math.max(geo.height,
|
|
4663
|
+
width: Math.max(geo.width, chunkXMLPTDPM_js.MIN_ELEMENT_SIZE),
|
|
4664
|
+
height: Math.max(geo.height, chunkXMLPTDPM_js.MIN_ELEMENT_SIZE)
|
|
4611
4665
|
});
|
|
4612
4666
|
}
|
|
4613
4667
|
}
|
|
4614
4668
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4615
4669
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4616
4670
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4617
|
-
const adjustments =
|
|
4671
|
+
const adjustments = chunkSDOQKSKI_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4618
4672
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4619
4673
|
adj.moved = true;
|
|
4620
4674
|
}
|
|
@@ -4689,13 +4743,13 @@ function processPointerUp(input) {
|
|
|
4689
4743
|
if (i !== activeSlideIndex) {
|
|
4690
4744
|
return s;
|
|
4691
4745
|
}
|
|
4692
|
-
const rerouted =
|
|
4746
|
+
const rerouted = chunkSDOQKSKI_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4693
4747
|
if (rerouted.length === 0) {
|
|
4694
4748
|
return s;
|
|
4695
4749
|
}
|
|
4696
4750
|
return {
|
|
4697
4751
|
...s,
|
|
4698
|
-
elements:
|
|
4752
|
+
elements: chunkSDOQKSKI_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4699
4753
|
};
|
|
4700
4754
|
})
|
|
4701
4755
|
);
|
|
@@ -4720,9 +4774,9 @@ function processPointerUp(input) {
|
|
|
4720
4774
|
}
|
|
4721
4775
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4722
4776
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4723
|
-
const hitIds =
|
|
4777
|
+
const hitIds = chunkSDOQKSKI_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4724
4778
|
if (marquee.additive) {
|
|
4725
|
-
const merged =
|
|
4779
|
+
const merged = chunkSDOQKSKI_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4726
4780
|
if (merged.length > 0) {
|
|
4727
4781
|
applySelection(merged[0], merged);
|
|
4728
4782
|
} else {
|
|
@@ -4745,8 +4799,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4745
4799
|
}
|
|
4746
4800
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4747
4801
|
});
|
|
4748
|
-
const rerouted =
|
|
4749
|
-
return
|
|
4802
|
+
const rerouted = chunkSDOQKSKI_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4803
|
+
return chunkSDOQKSKI_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4750
4804
|
};
|
|
4751
4805
|
if (editTemplateMode) {
|
|
4752
4806
|
const slideId = activeSlide?.id;
|
|
@@ -4903,12 +4957,15 @@ function useCanvasInteractions(input) {
|
|
|
4903
4957
|
return;
|
|
4904
4958
|
}
|
|
4905
4959
|
const el = elementLookup.get(editId);
|
|
4906
|
-
if (el &&
|
|
4960
|
+
if (el && chunkSDOQKSKI_js.hasTextProperties(el)) {
|
|
4907
4961
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4908
|
-
const newSegments =
|
|
4962
|
+
const newSegments = chunkSDOQKSKI_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4963
|
+
const editorEl = document.querySelector("[data-inline-editor]");
|
|
4964
|
+
const newHeight = chunkSDOQKSKI_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
4909
4965
|
ops.updateElementById(editId, {
|
|
4910
4966
|
text: committedText,
|
|
4911
|
-
textSegments: newSegments
|
|
4967
|
+
textSegments: newSegments,
|
|
4968
|
+
...newHeight !== void 0 ? { height: newHeight } : {}
|
|
4912
4969
|
});
|
|
4913
4970
|
history.markDirty();
|
|
4914
4971
|
}
|
|
@@ -4916,7 +4973,7 @@ function useCanvasInteractions(input) {
|
|
|
4916
4973
|
setInlineEditingText("");
|
|
4917
4974
|
};
|
|
4918
4975
|
const openEquationEditorForElement = (el) => {
|
|
4919
|
-
if (!
|
|
4976
|
+
if (!chunkSDOQKSKI_js.hasTextProperties(el)) {
|
|
4920
4977
|
return false;
|
|
4921
4978
|
}
|
|
4922
4979
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4946,7 +5003,7 @@ function useCanvasInteractions(input) {
|
|
|
4946
5003
|
justInteractedRef.current = false;
|
|
4947
5004
|
} else {
|
|
4948
5005
|
const el = elementLookup.get(elementId);
|
|
4949
|
-
if (el &&
|
|
5006
|
+
if (el && chunkSDOQKSKI_js.hasTextProperties(el) && chunkSDOQKSKI_js.canInteractWithElement(el, "textEdit")) {
|
|
4950
5007
|
if (!openEquationEditorForElement(el)) {
|
|
4951
5008
|
setInlineEditingElementId(elementId);
|
|
4952
5009
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4965,7 +5022,7 @@ function useCanvasInteractions(input) {
|
|
|
4965
5022
|
if (openEquationEditorForElement(el)) {
|
|
4966
5023
|
return;
|
|
4967
5024
|
}
|
|
4968
|
-
if (
|
|
5025
|
+
if (chunkSDOQKSKI_js.hasTextProperties(el) && chunkSDOQKSKI_js.canInteractWithElement(el, "textEdit")) {
|
|
4969
5026
|
setInlineEditingElementId(elementId);
|
|
4970
5027
|
setInlineEditingText(el.text ?? "");
|
|
4971
5028
|
}
|
|
@@ -4988,7 +5045,7 @@ function useCanvasInteractions(input) {
|
|
|
4988
5045
|
justSelectedRef.current = false;
|
|
4989
5046
|
}
|
|
4990
5047
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
4991
|
-
const movableIds =
|
|
5048
|
+
const movableIds = chunkSDOQKSKI_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
4992
5049
|
if (movableIds.length === 0) {
|
|
4993
5050
|
return;
|
|
4994
5051
|
}
|
|
@@ -5058,7 +5115,7 @@ function useCanvasInteractions(input) {
|
|
|
5058
5115
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5059
5116
|
e.stopPropagation();
|
|
5060
5117
|
const el = elementLookup.get(elementId);
|
|
5061
|
-
if (!el || !
|
|
5118
|
+
if (!el || !chunkSDOQKSKI_js.canInteractWithElement(el, "resize")) {
|
|
5062
5119
|
return;
|
|
5063
5120
|
}
|
|
5064
5121
|
resizeStateRef.current = {
|
|
@@ -5080,7 +5137,7 @@ function useCanvasInteractions(input) {
|
|
|
5080
5137
|
};
|
|
5081
5138
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5082
5139
|
const el = elementLookup.get(elementId);
|
|
5083
|
-
if (!el || !
|
|
5140
|
+
if (!el || !chunkSDOQKSKI_js.canInteractWithElement(el, "rotate")) {
|
|
5084
5141
|
return;
|
|
5085
5142
|
}
|
|
5086
5143
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5100,10 +5157,10 @@ function useCanvasInteractions(input) {
|
|
|
5100
5157
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5101
5158
|
e.stopPropagation();
|
|
5102
5159
|
const el = elementLookup.get(elementId);
|
|
5103
|
-
if (!el || !
|
|
5160
|
+
if (!el || !chunkSDOQKSKI_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5104
5161
|
return;
|
|
5105
5162
|
}
|
|
5106
|
-
shapeAdjustmentDragStateRef.current =
|
|
5163
|
+
shapeAdjustmentDragStateRef.current = chunkSDOQKSKI_js.beginShapeAdjustment(
|
|
5107
5164
|
el,
|
|
5108
5165
|
descriptor,
|
|
5109
5166
|
e.clientX,
|
|
@@ -5150,7 +5207,7 @@ function createFileHandlers(deps) {
|
|
|
5150
5207
|
h = Math.round(h * scale);
|
|
5151
5208
|
}
|
|
5152
5209
|
addElement({
|
|
5153
|
-
id:
|
|
5210
|
+
id: chunkSDOQKSKI_js.generateElementId(),
|
|
5154
5211
|
type: "image",
|
|
5155
5212
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5156
5213
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5161,7 +5218,7 @@ function createFileHandlers(deps) {
|
|
|
5161
5218
|
};
|
|
5162
5219
|
img.onerror = () => {
|
|
5163
5220
|
addElement({
|
|
5164
|
-
id:
|
|
5221
|
+
id: chunkSDOQKSKI_js.generateElementId(),
|
|
5165
5222
|
type: "image",
|
|
5166
5223
|
x: 100,
|
|
5167
5224
|
y: 100,
|
|
@@ -5180,14 +5237,14 @@ function createFileHandlers(deps) {
|
|
|
5180
5237
|
return;
|
|
5181
5238
|
}
|
|
5182
5239
|
e.target.value = "";
|
|
5183
|
-
const mediaType =
|
|
5240
|
+
const mediaType = chunkSDOQKSKI_js.classifyMediaType(file.type);
|
|
5184
5241
|
if (!mediaType) {
|
|
5185
5242
|
return;
|
|
5186
5243
|
}
|
|
5187
5244
|
const elFilePath = file.path;
|
|
5188
5245
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5189
5246
|
addElement({
|
|
5190
|
-
id:
|
|
5247
|
+
id: chunkSDOQKSKI_js.generateElementId(),
|
|
5191
5248
|
type: "media",
|
|
5192
5249
|
mediaType,
|
|
5193
5250
|
mediaMimeType: file.type || void 0,
|
|
@@ -5362,13 +5419,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5362
5419
|
return;
|
|
5363
5420
|
}
|
|
5364
5421
|
addElement({
|
|
5365
|
-
id:
|
|
5422
|
+
id: chunkSDOQKSKI_js.generateElementId(),
|
|
5366
5423
|
type: "smartArt",
|
|
5367
5424
|
x: 100,
|
|
5368
5425
|
y: 120,
|
|
5369
5426
|
width: 600,
|
|
5370
5427
|
height: 340,
|
|
5371
|
-
smartArtData:
|
|
5428
|
+
smartArtData: chunkSDOQKSKI_js.buildSmartArtPresetData(
|
|
5372
5429
|
layout,
|
|
5373
5430
|
defaultItems,
|
|
5374
5431
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5380,7 +5437,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5380
5437
|
return;
|
|
5381
5438
|
}
|
|
5382
5439
|
addElement({
|
|
5383
|
-
id:
|
|
5440
|
+
id: chunkSDOQKSKI_js.generateElementId(),
|
|
5384
5441
|
type: "shape",
|
|
5385
5442
|
x: 120,
|
|
5386
5443
|
y: 200,
|
|
@@ -5418,7 +5475,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5418
5475
|
return;
|
|
5419
5476
|
}
|
|
5420
5477
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5421
|
-
if (resolved.url && !
|
|
5478
|
+
if (resolved.url && !chunkSDOQKSKI_js.isUrlSafe(resolved.url)) {
|
|
5422
5479
|
return;
|
|
5423
5480
|
}
|
|
5424
5481
|
const actionClick = {
|
|
@@ -5442,7 +5499,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5442
5499
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5443
5500
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5444
5501
|
addElement({
|
|
5445
|
-
id:
|
|
5502
|
+
id: chunkSDOQKSKI_js.generateElementId(),
|
|
5446
5503
|
type: "shape",
|
|
5447
5504
|
x: 120,
|
|
5448
5505
|
y: 200,
|
|
@@ -5464,11 +5521,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5464
5521
|
if (!activeSlide) {
|
|
5465
5522
|
return;
|
|
5466
5523
|
}
|
|
5467
|
-
const preset =
|
|
5524
|
+
const preset = chunkSDOQKSKI_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5468
5525
|
if (!preset) {
|
|
5469
5526
|
return;
|
|
5470
5527
|
}
|
|
5471
|
-
const defaultPptxAction =
|
|
5528
|
+
const defaultPptxAction = chunkSDOQKSKI_js.elementActionToPptxAction({
|
|
5472
5529
|
trigger: "click",
|
|
5473
5530
|
type: preset.defaultAction
|
|
5474
5531
|
});
|
|
@@ -5477,7 +5534,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5477
5534
|
defaultPptxAction.highlightClick = true;
|
|
5478
5535
|
}
|
|
5479
5536
|
addElement({
|
|
5480
|
-
id:
|
|
5537
|
+
id: chunkSDOQKSKI_js.generateElementId(),
|
|
5481
5538
|
type: "shape",
|
|
5482
5539
|
x: 150,
|
|
5483
5540
|
y: 150,
|
|
@@ -5544,14 +5601,14 @@ function useInsertElements(input) {
|
|
|
5544
5601
|
return;
|
|
5545
5602
|
}
|
|
5546
5603
|
addElement({
|
|
5547
|
-
id:
|
|
5604
|
+
id: chunkSDOQKSKI_js.generateElementId(),
|
|
5548
5605
|
type: "text",
|
|
5549
5606
|
x: 100,
|
|
5550
5607
|
y: 100,
|
|
5551
5608
|
width: 300,
|
|
5552
5609
|
height: 60,
|
|
5553
5610
|
text: "",
|
|
5554
|
-
textStyle: { fontSize:
|
|
5611
|
+
textStyle: { fontSize: chunkXMLPTDPM_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5555
5612
|
});
|
|
5556
5613
|
};
|
|
5557
5614
|
const handleAddShape = () => {
|
|
@@ -5559,7 +5616,7 @@ function useInsertElements(input) {
|
|
|
5559
5616
|
return;
|
|
5560
5617
|
}
|
|
5561
5618
|
addElement({
|
|
5562
|
-
id:
|
|
5619
|
+
id: chunkSDOQKSKI_js.generateElementId(),
|
|
5563
5620
|
type: "shape",
|
|
5564
5621
|
x: 150,
|
|
5565
5622
|
y: 150,
|
|
@@ -5578,15 +5635,15 @@ function useInsertElements(input) {
|
|
|
5578
5635
|
return;
|
|
5579
5636
|
}
|
|
5580
5637
|
addElement({
|
|
5581
|
-
...
|
|
5582
|
-
id:
|
|
5638
|
+
...chunkSDOQKSKI_js.newTableElement(chunkXMLPTDPM_js.DEFAULT_TABLE_ROWS, chunkXMLPTDPM_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5639
|
+
id: chunkSDOQKSKI_js.generateElementId()
|
|
5583
5640
|
});
|
|
5584
5641
|
};
|
|
5585
5642
|
const handleAddChart = (chartKind) => {
|
|
5586
5643
|
if (!activeSlide) {
|
|
5587
5644
|
return;
|
|
5588
5645
|
}
|
|
5589
|
-
addElement(
|
|
5646
|
+
addElement(chunkSDOQKSKI_js.createDefaultChartElement(chartKind));
|
|
5590
5647
|
};
|
|
5591
5648
|
const structured = createStructuredElementHandlers({
|
|
5592
5649
|
activeSlide,
|
|
@@ -5656,7 +5713,7 @@ function useClipboardHandlers(input) {
|
|
|
5656
5713
|
if (!selectedElement) {
|
|
5657
5714
|
return;
|
|
5658
5715
|
}
|
|
5659
|
-
setClipboardPayload(
|
|
5716
|
+
setClipboardPayload(chunkSDOQKSKI_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5660
5717
|
};
|
|
5661
5718
|
const handleDelete = () => {
|
|
5662
5719
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5673,7 +5730,7 @@ function useClipboardHandlers(input) {
|
|
|
5673
5730
|
handleDelete();
|
|
5674
5731
|
};
|
|
5675
5732
|
const insertClone = (source) => {
|
|
5676
|
-
const clone =
|
|
5733
|
+
const clone = chunkSDOQKSKI_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5677
5734
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5678
5735
|
ops.applySelection(clone.id);
|
|
5679
5736
|
history.markDirty();
|
|
@@ -5708,7 +5765,7 @@ function resolveShapePath(el) {
|
|
|
5708
5765
|
return el.pathData;
|
|
5709
5766
|
}
|
|
5710
5767
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5711
|
-
const clipPath =
|
|
5768
|
+
const clipPath = chunkSDOQKSKI_js.getPresetShapeClipPath(el.shapeType);
|
|
5712
5769
|
if (clipPath) {
|
|
5713
5770
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5714
5771
|
if (svgPath) {
|
|
@@ -5759,7 +5816,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5759
5816
|
return parts.join(" ");
|
|
5760
5817
|
}
|
|
5761
5818
|
function transformPathToGlobal(pathData, el) {
|
|
5762
|
-
const polys =
|
|
5819
|
+
const polys = chunkSDOQKSKI_js.svgPathToPolygons(pathData);
|
|
5763
5820
|
if (polys.length === 0) {
|
|
5764
5821
|
return pathData;
|
|
5765
5822
|
}
|
|
@@ -5779,10 +5836,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5779
5836
|
y: pt.y * scaleY + el.y
|
|
5780
5837
|
}))
|
|
5781
5838
|
);
|
|
5782
|
-
return
|
|
5839
|
+
return chunkSDOQKSKI_js.polygonsToSvgPath(transformed);
|
|
5783
5840
|
}
|
|
5784
5841
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5785
|
-
const polys =
|
|
5842
|
+
const polys = chunkSDOQKSKI_js.svgPathToPolygons(pathData);
|
|
5786
5843
|
if (polys.length === 0) {
|
|
5787
5844
|
return pathData;
|
|
5788
5845
|
}
|
|
@@ -5792,10 +5849,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5792
5849
|
y: pt.y - y
|
|
5793
5850
|
}))
|
|
5794
5851
|
);
|
|
5795
|
-
return
|
|
5852
|
+
return chunkSDOQKSKI_js.polygonsToSvgPath(transformed);
|
|
5796
5853
|
}
|
|
5797
5854
|
function pathBounds(pathData) {
|
|
5798
|
-
const polys =
|
|
5855
|
+
const polys = chunkSDOQKSKI_js.svgPathToPolygons(pathData);
|
|
5799
5856
|
let minX = Infinity;
|
|
5800
5857
|
let minY = Infinity;
|
|
5801
5858
|
let maxX = -Infinity;
|
|
@@ -5854,7 +5911,7 @@ function useMergeShapesHandler(input) {
|
|
|
5854
5911
|
let allFragments = [];
|
|
5855
5912
|
let remaining = globalPaths[0];
|
|
5856
5913
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5857
|
-
const frags =
|
|
5914
|
+
const frags = chunkSDOQKSKI_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5858
5915
|
if (Array.isArray(frags)) {
|
|
5859
5916
|
allFragments = frags;
|
|
5860
5917
|
}
|
|
@@ -5883,7 +5940,7 @@ function useMergeShapesHandler(input) {
|
|
|
5883
5940
|
bounds.height
|
|
5884
5941
|
);
|
|
5885
5942
|
const newEl = {
|
|
5886
|
-
id:
|
|
5943
|
+
id: chunkSDOQKSKI_js.generateElementId(),
|
|
5887
5944
|
type: "shape",
|
|
5888
5945
|
x: bounds.x,
|
|
5889
5946
|
y: bounds.y,
|
|
@@ -5921,7 +5978,7 @@ function useMergeShapesHandler(input) {
|
|
|
5921
5978
|
} else {
|
|
5922
5979
|
let resultPath = globalPaths[0];
|
|
5923
5980
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5924
|
-
const result =
|
|
5981
|
+
const result = chunkSDOQKSKI_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5925
5982
|
if (typeof result === "string") {
|
|
5926
5983
|
resultPath = result;
|
|
5927
5984
|
}
|
|
@@ -5942,7 +5999,7 @@ function useMergeShapesHandler(input) {
|
|
|
5942
5999
|
);
|
|
5943
6000
|
const primary = targets[0];
|
|
5944
6001
|
const newEl = {
|
|
5945
|
-
id:
|
|
6002
|
+
id: chunkSDOQKSKI_js.generateElementId(),
|
|
5946
6003
|
type: "shape",
|
|
5947
6004
|
x: bounds.x,
|
|
5948
6005
|
y: bounds.y,
|
|
@@ -6005,7 +6062,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6005
6062
|
if (ids.length < 2 || !activeSlide) {
|
|
6006
6063
|
return;
|
|
6007
6064
|
}
|
|
6008
|
-
const { elements, groupId } =
|
|
6065
|
+
const { elements, groupId } = chunkSDOQKSKI_js.groupElements(ops.activeElements, ids, chunkSDOQKSKI_js.generateElementId());
|
|
6009
6066
|
if (groupId === null) {
|
|
6010
6067
|
return;
|
|
6011
6068
|
}
|
|
@@ -6018,11 +6075,11 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6018
6075
|
return;
|
|
6019
6076
|
}
|
|
6020
6077
|
const group = selectedElement;
|
|
6021
|
-
const intoTemplate =
|
|
6078
|
+
const intoTemplate = chunkSDOQKSKI_js.isTemplateElementId(group.id);
|
|
6022
6079
|
const childIds = group.children.map(
|
|
6023
|
-
(child) => intoTemplate ?
|
|
6080
|
+
(child) => intoTemplate ? chunkSDOQKSKI_js.makeCloneId(true, child.id || group.id) : child.id || chunkSDOQKSKI_js.generateElementId()
|
|
6024
6081
|
);
|
|
6025
|
-
const { elements, childIds: usedIds } =
|
|
6082
|
+
const { elements, childIds: usedIds } = chunkSDOQKSKI_js.ungroupElements(
|
|
6026
6083
|
ops.activeElements,
|
|
6027
6084
|
group.id,
|
|
6028
6085
|
childIds,
|
|
@@ -6051,7 +6108,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6051
6108
|
if (!edge) {
|
|
6052
6109
|
return;
|
|
6053
6110
|
}
|
|
6054
|
-
const positions =
|
|
6111
|
+
const positions = chunkSDOQKSKI_js.alignElements(selectedElements, edge);
|
|
6055
6112
|
for (const [id, pos] of positions) {
|
|
6056
6113
|
const el = elementLookup.get(id);
|
|
6057
6114
|
if (!el) {
|
|
@@ -6069,7 +6126,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6069
6126
|
if (!distAxis) {
|
|
6070
6127
|
return;
|
|
6071
6128
|
}
|
|
6072
|
-
const positions =
|
|
6129
|
+
const positions = chunkSDOQKSKI_js.distributeElements(selectedElements, distAxis);
|
|
6073
6130
|
for (const [id, pos] of positions) {
|
|
6074
6131
|
const el = elementLookup.get(id);
|
|
6075
6132
|
if (!el) {
|
|
@@ -6086,7 +6143,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6086
6143
|
}
|
|
6087
6144
|
const id = selectedElement.id;
|
|
6088
6145
|
ops.updateActiveElements(
|
|
6089
|
-
(els) => direction === "forward" ?
|
|
6146
|
+
(els) => direction === "forward" ? chunkSDOQKSKI_js.bringForward(els, id) : direction === "backward" ? chunkSDOQKSKI_js.sendBackward(els, id) : els
|
|
6090
6147
|
);
|
|
6091
6148
|
history.markDirty();
|
|
6092
6149
|
};
|
|
@@ -6096,7 +6153,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6096
6153
|
}
|
|
6097
6154
|
const id = selectedElement.id;
|
|
6098
6155
|
ops.updateActiveElements(
|
|
6099
|
-
(els) => direction === "front" ?
|
|
6156
|
+
(els) => direction === "front" ? chunkSDOQKSKI_js.bringToFront(els, id) : chunkSDOQKSKI_js.sendToBack(els, id)
|
|
6100
6157
|
);
|
|
6101
6158
|
history.markDirty();
|
|
6102
6159
|
};
|
|
@@ -6227,7 +6284,7 @@ function useSlideManagement(input) {
|
|
|
6227
6284
|
theme
|
|
6228
6285
|
} = input;
|
|
6229
6286
|
const handleAddSlide = () => {
|
|
6230
|
-
const newSlide =
|
|
6287
|
+
const newSlide = chunkSDOQKSKI_js.createBlankSlide(slides.length + 1);
|
|
6231
6288
|
ops.updateSlides((prev) => {
|
|
6232
6289
|
const next = [...prev];
|
|
6233
6290
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6290,7 +6347,7 @@ function useSlideManagement(input) {
|
|
|
6290
6347
|
}
|
|
6291
6348
|
const clone = {
|
|
6292
6349
|
...src,
|
|
6293
|
-
id:
|
|
6350
|
+
id: chunkSDOQKSKI_js.makeSlideId(),
|
|
6294
6351
|
elements: src.elements.map((el) => ({
|
|
6295
6352
|
...el,
|
|
6296
6353
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6322,7 +6379,7 @@ function useSlideManagement(input) {
|
|
|
6322
6379
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6323
6380
|
const insertAt = activeSlideIndex + 1;
|
|
6324
6381
|
const draft = {
|
|
6325
|
-
...
|
|
6382
|
+
...chunkSDOQKSKI_js.createBlankSlide(slides.length + 1),
|
|
6326
6383
|
layoutPath,
|
|
6327
6384
|
...layoutName ? { layoutName } : {}
|
|
6328
6385
|
};
|
|
@@ -6355,9 +6412,9 @@ function useSlideManagement(input) {
|
|
|
6355
6412
|
};
|
|
6356
6413
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6357
6414
|
const insertAt = activeSlideIndex + 1;
|
|
6358
|
-
const draft =
|
|
6415
|
+
const draft = chunkSDOQKSKI_js.buildSlideTemplateSlide(templateId, chunkSDOQKSKI_js.makeSlideId(), slides.length + 1, {
|
|
6359
6416
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6360
|
-
scheme:
|
|
6417
|
+
scheme: chunkSDOQKSKI_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6361
6418
|
});
|
|
6362
6419
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6363
6420
|
setActiveSlideIndex(insertAt);
|
|
@@ -6394,7 +6451,7 @@ function createTableMergeHandlers(input) {
|
|
|
6394
6451
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6395
6452
|
return;
|
|
6396
6453
|
}
|
|
6397
|
-
const newTableData =
|
|
6454
|
+
const newTableData = chunkSDOQKSKI_js.mergeCells(
|
|
6398
6455
|
[
|
|
6399
6456
|
{ row: rowIndex, col: columnIndex },
|
|
6400
6457
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6402,7 +6459,7 @@ function createTableMergeHandlers(input) {
|
|
|
6402
6459
|
td
|
|
6403
6460
|
);
|
|
6404
6461
|
const updates = { tableData: newTableData };
|
|
6405
|
-
const newRawXml =
|
|
6462
|
+
const newRawXml = chunkSDOQKSKI_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6406
6463
|
if (newRawXml) {
|
|
6407
6464
|
updates.rawXml = newRawXml;
|
|
6408
6465
|
}
|
|
@@ -6428,7 +6485,7 @@ function createTableMergeHandlers(input) {
|
|
|
6428
6485
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6429
6486
|
return;
|
|
6430
6487
|
}
|
|
6431
|
-
const newTableData =
|
|
6488
|
+
const newTableData = chunkSDOQKSKI_js.mergeCells(
|
|
6432
6489
|
[
|
|
6433
6490
|
{ row: rowIndex, col: columnIndex },
|
|
6434
6491
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6436,7 +6493,7 @@ function createTableMergeHandlers(input) {
|
|
|
6436
6493
|
td
|
|
6437
6494
|
);
|
|
6438
6495
|
const updates = { tableData: newTableData };
|
|
6439
|
-
const newRawXml =
|
|
6496
|
+
const newRawXml = chunkSDOQKSKI_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6440
6497
|
if (newRawXml) {
|
|
6441
6498
|
updates.rawXml = newRawXml;
|
|
6442
6499
|
}
|
|
@@ -6451,9 +6508,9 @@ function createTableMergeHandlers(input) {
|
|
|
6451
6508
|
return;
|
|
6452
6509
|
}
|
|
6453
6510
|
const td = selectedElement.tableData;
|
|
6454
|
-
const newTableData =
|
|
6511
|
+
const newTableData = chunkSDOQKSKI_js.mergeCells(ts.selectedCells, td);
|
|
6455
6512
|
const updates = { tableData: newTableData };
|
|
6456
|
-
const newRawXml =
|
|
6513
|
+
const newRawXml = chunkSDOQKSKI_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6457
6514
|
if (newRawXml) {
|
|
6458
6515
|
updates.rawXml = newRawXml;
|
|
6459
6516
|
}
|
|
@@ -6470,9 +6527,9 @@ function createTableMergeHandlers(input) {
|
|
|
6470
6527
|
}
|
|
6471
6528
|
const { rowIndex, columnIndex } = ts;
|
|
6472
6529
|
const td = selectedElement.tableData;
|
|
6473
|
-
const newTableData =
|
|
6530
|
+
const newTableData = chunkSDOQKSKI_js.splitCell(rowIndex, columnIndex, td);
|
|
6474
6531
|
const updates = { tableData: newTableData };
|
|
6475
|
-
const newRawXml =
|
|
6532
|
+
const newRawXml = chunkSDOQKSKI_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6476
6533
|
if (newRawXml) {
|
|
6477
6534
|
updates.rawXml = newRawXml;
|
|
6478
6535
|
}
|
|
@@ -6504,10 +6561,10 @@ function createTableStructHandlers(input) {
|
|
|
6504
6561
|
}
|
|
6505
6562
|
const updates = {};
|
|
6506
6563
|
if (el.tableData) {
|
|
6507
|
-
updates.tableData =
|
|
6564
|
+
updates.tableData = chunkSDOQKSKI_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6508
6565
|
}
|
|
6509
6566
|
if (el.rawXml) {
|
|
6510
|
-
const newRawXml =
|
|
6567
|
+
const newRawXml = chunkSDOQKSKI_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6511
6568
|
if (newRawXml) {
|
|
6512
6569
|
updates.rawXml = newRawXml;
|
|
6513
6570
|
}
|
|
@@ -6531,7 +6588,7 @@ function createTableStructHandlers(input) {
|
|
|
6531
6588
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6532
6589
|
const updates = {};
|
|
6533
6590
|
if (selectedElement.rawXml) {
|
|
6534
|
-
const newRawXml =
|
|
6591
|
+
const newRawXml = chunkSDOQKSKI_js.updateCellTextStyleInRawXml(
|
|
6535
6592
|
selectedElement,
|
|
6536
6593
|
rowIndex,
|
|
6537
6594
|
colIndex,
|
|
@@ -6595,9 +6652,9 @@ function createTableStructHandlers(input) {
|
|
|
6595
6652
|
return;
|
|
6596
6653
|
}
|
|
6597
6654
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6598
|
-
const newTableData =
|
|
6655
|
+
const newTableData = chunkSDOQKSKI_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6599
6656
|
const updates = { tableData: newTableData };
|
|
6600
|
-
const newRawXml =
|
|
6657
|
+
const newRawXml = chunkSDOQKSKI_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6601
6658
|
if (newRawXml) {
|
|
6602
6659
|
updates.rawXml = newRawXml;
|
|
6603
6660
|
}
|
|
@@ -6610,12 +6667,12 @@ function createTableStructHandlers(input) {
|
|
|
6610
6667
|
}
|
|
6611
6668
|
const td = selectedElement.tableData;
|
|
6612
6669
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6613
|
-
const newTableData =
|
|
6670
|
+
const newTableData = chunkSDOQKSKI_js.deleteTableRow(td, rowIdx);
|
|
6614
6671
|
if (newTableData === td) {
|
|
6615
6672
|
return;
|
|
6616
6673
|
}
|
|
6617
6674
|
const updates = { tableData: newTableData };
|
|
6618
|
-
const newRawXml =
|
|
6675
|
+
const newRawXml = chunkSDOQKSKI_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6619
6676
|
if (newRawXml) {
|
|
6620
6677
|
updates.rawXml = newRawXml;
|
|
6621
6678
|
}
|
|
@@ -6627,9 +6684,9 @@ function createTableStructHandlers(input) {
|
|
|
6627
6684
|
return;
|
|
6628
6685
|
}
|
|
6629
6686
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6630
|
-
const newTableData =
|
|
6687
|
+
const newTableData = chunkSDOQKSKI_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6631
6688
|
const updates = { tableData: newTableData };
|
|
6632
|
-
const newRawXml =
|
|
6689
|
+
const newRawXml = chunkSDOQKSKI_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6633
6690
|
if (newRawXml) {
|
|
6634
6691
|
updates.rawXml = newRawXml;
|
|
6635
6692
|
}
|
|
@@ -6642,12 +6699,12 @@ function createTableStructHandlers(input) {
|
|
|
6642
6699
|
}
|
|
6643
6700
|
const td = selectedElement.tableData;
|
|
6644
6701
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6645
|
-
const newTableData =
|
|
6702
|
+
const newTableData = chunkSDOQKSKI_js.deleteTableColumn(td, colIdx);
|
|
6646
6703
|
if (newTableData === td) {
|
|
6647
6704
|
return;
|
|
6648
6705
|
}
|
|
6649
6706
|
const updates = { tableData: newTableData };
|
|
6650
|
-
const newRawXml =
|
|
6707
|
+
const newRawXml = chunkSDOQKSKI_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6651
6708
|
if (newRawXml) {
|
|
6652
6709
|
updates.rawXml = newRawXml;
|
|
6653
6710
|
}
|
|
@@ -6683,8 +6740,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6683
6740
|
return html2canvasPro(element, {
|
|
6684
6741
|
...options,
|
|
6685
6742
|
onclone: async (doc, clonedEl) => {
|
|
6686
|
-
await
|
|
6687
|
-
|
|
6743
|
+
await chunkSDOQKSKI_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6744
|
+
chunkSDOQKSKI_js.preprocessCssForCapture(clonedEl);
|
|
6688
6745
|
if (typeof userOnClone === "function") {
|
|
6689
6746
|
userOnClone(doc, clonedEl);
|
|
6690
6747
|
}
|
|
@@ -6740,7 +6797,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6740
6797
|
}
|
|
6741
6798
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6742
6799
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6743
|
-
|
|
6800
|
+
chunkSDOQKSKI_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6744
6801
|
}
|
|
6745
6802
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6746
6803
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6762,15 +6819,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6762
6819
|
continue;
|
|
6763
6820
|
}
|
|
6764
6821
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6765
|
-
images.push(
|
|
6822
|
+
images.push(chunkSDOQKSKI_js.canvasToJpegData(canvas));
|
|
6766
6823
|
}
|
|
6767
6824
|
onProgress?.(totalSlides, totalSlides);
|
|
6768
6825
|
setActiveSlide(currentSlideIndex);
|
|
6769
6826
|
if (images.length === 0) {
|
|
6770
6827
|
throw new Error(chunkU6A5FWWE_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6771
6828
|
}
|
|
6772
|
-
const pdfBlobUrl =
|
|
6773
|
-
|
|
6829
|
+
const pdfBlobUrl = chunkXMLPTDPM_js.buildPdfFromImageData(images);
|
|
6830
|
+
chunkSDOQKSKI_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6774
6831
|
}
|
|
6775
6832
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6776
6833
|
const { scale = 2, onProgress } = options;
|
|
@@ -6818,8 +6875,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6818
6875
|
if (pages.length === 0) {
|
|
6819
6876
|
throw new Error(chunkU6A5FWWE_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6820
6877
|
}
|
|
6821
|
-
const pdfDataUrl =
|
|
6822
|
-
|
|
6878
|
+
const pdfDataUrl = chunkXMLPTDPM_js.buildNotesPdf(pages);
|
|
6879
|
+
chunkSDOQKSKI_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6823
6880
|
}
|
|
6824
6881
|
|
|
6825
6882
|
// src/viewer/utils/export-video.ts
|
|
@@ -6863,7 +6920,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6863
6920
|
const fps = 30;
|
|
6864
6921
|
const stream = recordingCanvas.captureStream(fps);
|
|
6865
6922
|
const recorder = new MediaRecorder(stream, {
|
|
6866
|
-
mimeType:
|
|
6923
|
+
mimeType: chunkSDOQKSKI_js.pickSupportedMimeType([...chunkSDOQKSKI_js.WEBM_MIME_CANDIDATES]),
|
|
6867
6924
|
videoBitsPerSecond: 5e6
|
|
6868
6925
|
});
|
|
6869
6926
|
const chunks = [];
|
|
@@ -6886,8 +6943,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6886
6943
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6887
6944
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6888
6945
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6889
|
-
const frameInterval =
|
|
6890
|
-
const framesNeeded =
|
|
6946
|
+
const frameInterval = chunkSDOQKSKI_js.fpsToFrameIntervalMs(fps);
|
|
6947
|
+
const framesNeeded = chunkSDOQKSKI_js.segmentFrameCount(duration, fps);
|
|
6891
6948
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6892
6949
|
if (signal?.aborted) {
|
|
6893
6950
|
recorder.stop();
|
|
@@ -6936,7 +6993,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6936
6993
|
if (frames.length === 0) {
|
|
6937
6994
|
throw new Error(chunkU6A5FWWE_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6938
6995
|
}
|
|
6939
|
-
const gifBytes =
|
|
6996
|
+
const gifBytes = chunkSDOQKSKI_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6940
6997
|
onProgress?.(totalSlides, totalSlides);
|
|
6941
6998
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6942
6999
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6990,7 +7047,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6990
7047
|
continue;
|
|
6991
7048
|
}
|
|
6992
7049
|
onProgress?.(processedCount, data.slides.length);
|
|
6993
|
-
let svg =
|
|
7050
|
+
let svg = chunkSDOQKSKI_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6994
7051
|
if (embedFonts && fontFaces?.length) {
|
|
6995
7052
|
svg = injectFontFaces(svg, fontFaces);
|
|
6996
7053
|
}
|
|
@@ -7048,13 +7105,13 @@ function useExportSaveAs(input) {
|
|
|
7048
7105
|
setExportProgress(10);
|
|
7049
7106
|
setExportStatusMessage("Adding presentation...");
|
|
7050
7107
|
const pptxData = await serializeSlides();
|
|
7051
|
-
const pptxFilename =
|
|
7108
|
+
const pptxFilename = chunkSDOQKSKI_js.savedPresentationFileName(filePath);
|
|
7052
7109
|
if (pptxData) {
|
|
7053
7110
|
pkgFolder.file(pptxFilename, pptxData);
|
|
7054
7111
|
}
|
|
7055
7112
|
setExportProgress(70);
|
|
7056
7113
|
setExportStatusMessage("Writing README...");
|
|
7057
|
-
const readme =
|
|
7114
|
+
const readme = chunkSDOQKSKI_js.generatePackageReadme(pptxFilename);
|
|
7058
7115
|
pkgFolder.file("README.txt", readme);
|
|
7059
7116
|
if (abortCtrl.signal.aborted) {
|
|
7060
7117
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -7064,7 +7121,7 @@ function useExportSaveAs(input) {
|
|
|
7064
7121
|
const zipBlob = await zip.generateAsync({ type: "blob" });
|
|
7065
7122
|
setExportProgress(95);
|
|
7066
7123
|
setExportStatusMessage("Downloading...");
|
|
7067
|
-
|
|
7124
|
+
chunkSDOQKSKI_js.downloadBlob(zipBlob, `${chunkSDOQKSKI_js.presentationBaseName(pptxFilename)}-package.zip`);
|
|
7068
7125
|
setExportProgress(100);
|
|
7069
7126
|
} catch (err) {
|
|
7070
7127
|
if (err.name !== "AbortError") {
|
|
@@ -7080,13 +7137,13 @@ function useExportSaveAs(input) {
|
|
|
7080
7137
|
if (!handler) {
|
|
7081
7138
|
return;
|
|
7082
7139
|
}
|
|
7083
|
-
const downloadName =
|
|
7140
|
+
const downloadName = chunkSDOQKSKI_js.savedPresentationFileName(filePath, format);
|
|
7084
7141
|
try {
|
|
7085
7142
|
const data = await buildSaveAsData(handler, format);
|
|
7086
7143
|
const blob = new Blob([data], {
|
|
7087
7144
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
7088
7145
|
});
|
|
7089
|
-
|
|
7146
|
+
chunkSDOQKSKI_js.downloadBlob(blob, downloadName);
|
|
7090
7147
|
} catch (err) {
|
|
7091
7148
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
7092
7149
|
}
|
|
@@ -7099,18 +7156,18 @@ function useExportSaveAs(input) {
|
|
|
7099
7156
|
const pptxGuides = guides.map((g) => ({
|
|
7100
7157
|
id: g.id,
|
|
7101
7158
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7102
|
-
positionEmu:
|
|
7159
|
+
positionEmu: chunkSDOQKSKI_js.guidePxToEmu(g.position)
|
|
7103
7160
|
}));
|
|
7104
7161
|
return {
|
|
7105
7162
|
...slide,
|
|
7106
7163
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7107
7164
|
};
|
|
7108
7165
|
});
|
|
7109
|
-
const slidesToSave =
|
|
7166
|
+
const slidesToSave = chunkSDOQKSKI_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7110
7167
|
const saveOptions = {
|
|
7111
7168
|
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
7112
7169
|
// a preset picked in the inspector reached one save path and not the other.
|
|
7113
|
-
slideSize:
|
|
7170
|
+
slideSize: chunkSDOQKSKI_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
7114
7171
|
headerFooter,
|
|
7115
7172
|
presentationProperties,
|
|
7116
7173
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -7124,13 +7181,13 @@ function useExportSaveAs(input) {
|
|
|
7124
7181
|
handoutMaster,
|
|
7125
7182
|
outputFormat: format
|
|
7126
7183
|
};
|
|
7127
|
-
return
|
|
7184
|
+
return chunkSDOQKSKI_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
7128
7185
|
};
|
|
7129
7186
|
const handleExportJson = () => {
|
|
7130
7187
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7131
|
-
const slideSize =
|
|
7188
|
+
const slideSize = chunkSDOQKSKI_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7132
7189
|
const data = {
|
|
7133
|
-
slides:
|
|
7190
|
+
slides: chunkSDOQKSKI_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7134
7191
|
width: canvasSize.width,
|
|
7135
7192
|
height: canvasSize.height,
|
|
7136
7193
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7149,7 +7206,7 @@ function useExportSaveAs(input) {
|
|
|
7149
7206
|
handoutMaster
|
|
7150
7207
|
};
|
|
7151
7208
|
try {
|
|
7152
|
-
|
|
7209
|
+
chunkSDOQKSKI_js.exportDeckJson(data, sourceName);
|
|
7153
7210
|
} catch (err) {
|
|
7154
7211
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7155
7212
|
}
|
|
@@ -7296,21 +7353,21 @@ function useExportHandlers(input) {
|
|
|
7296
7353
|
{
|
|
7297
7354
|
scale: 2,
|
|
7298
7355
|
onProgress: (current, total) => {
|
|
7299
|
-
setExportProgress(
|
|
7300
|
-
setExportStatusMessage(
|
|
7356
|
+
setExportProgress(chunkSDOQKSKI_js.slideProgressPercent(current, total));
|
|
7357
|
+
setExportStatusMessage(chunkSDOQKSKI_js.slideStatusLabel("Rendering", current, total));
|
|
7301
7358
|
},
|
|
7302
7359
|
signal: abortCtrl.signal
|
|
7303
7360
|
}
|
|
7304
7361
|
);
|
|
7305
|
-
setExportProgress(
|
|
7362
|
+
setExportProgress(chunkSDOQKSKI_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7306
7363
|
setExportStatusMessage("Building PDF...");
|
|
7307
7364
|
await new Promise((r) => {
|
|
7308
7365
|
setTimeout(r, 100);
|
|
7309
7366
|
});
|
|
7310
|
-
setExportProgress(
|
|
7367
|
+
setExportProgress(chunkSDOQKSKI_js.EXPORT_DONE_PERCENT);
|
|
7311
7368
|
setExportStatusMessage("Done!");
|
|
7312
7369
|
} catch (err) {
|
|
7313
|
-
if (!
|
|
7370
|
+
if (!chunkSDOQKSKI_js.isExportAbortError(err)) {
|
|
7314
7371
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7315
7372
|
}
|
|
7316
7373
|
} finally {
|
|
@@ -7340,21 +7397,21 @@ function useExportHandlers(input) {
|
|
|
7340
7397
|
{
|
|
7341
7398
|
scale: 2,
|
|
7342
7399
|
onProgress: (current, total) => {
|
|
7343
|
-
setExportProgress(
|
|
7344
|
-
setExportStatusMessage(
|
|
7400
|
+
setExportProgress(chunkSDOQKSKI_js.slideProgressPercent(current, total));
|
|
7401
|
+
setExportStatusMessage(chunkSDOQKSKI_js.slideStatusLabel("Rendering", current, total));
|
|
7345
7402
|
},
|
|
7346
7403
|
signal: abortCtrl.signal
|
|
7347
7404
|
}
|
|
7348
7405
|
);
|
|
7349
|
-
setExportProgress(
|
|
7406
|
+
setExportProgress(chunkSDOQKSKI_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7350
7407
|
setExportStatusMessage("Building PDF...");
|
|
7351
7408
|
await new Promise((r) => {
|
|
7352
7409
|
setTimeout(r, 100);
|
|
7353
7410
|
});
|
|
7354
|
-
setExportProgress(
|
|
7411
|
+
setExportProgress(chunkSDOQKSKI_js.EXPORT_DONE_PERCENT);
|
|
7355
7412
|
setExportStatusMessage("Done!");
|
|
7356
7413
|
} catch (err) {
|
|
7357
|
-
if (!
|
|
7414
|
+
if (!chunkSDOQKSKI_js.isExportAbortError(err)) {
|
|
7358
7415
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7359
7416
|
}
|
|
7360
7417
|
} finally {
|
|
@@ -7395,22 +7452,22 @@ function useExportHandlers(input) {
|
|
|
7395
7452
|
scale: 1,
|
|
7396
7453
|
slideDurationMs: 3e3,
|
|
7397
7454
|
onProgress: (current, total) => {
|
|
7398
|
-
setExportProgress(
|
|
7399
|
-
setExportStatusMessage(
|
|
7455
|
+
setExportProgress(chunkSDOQKSKI_js.slideProgressPercent(current, total, 45));
|
|
7456
|
+
setExportStatusMessage(chunkSDOQKSKI_js.slideStatusLabel("Capturing", current, total));
|
|
7400
7457
|
},
|
|
7401
7458
|
onRecordProgress: (current, total) => {
|
|
7402
|
-
setExportProgress(
|
|
7403
|
-
setExportStatusMessage(
|
|
7459
|
+
setExportProgress(chunkSDOQKSKI_js.recordProgressPercent(current, total));
|
|
7460
|
+
setExportStatusMessage(chunkSDOQKSKI_js.slideStatusLabel("Recording", current, total));
|
|
7404
7461
|
},
|
|
7405
7462
|
signal: abortCtrl.signal
|
|
7406
7463
|
}
|
|
7407
7464
|
);
|
|
7408
|
-
setExportProgress(
|
|
7465
|
+
setExportProgress(chunkSDOQKSKI_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7409
7466
|
setExportStatusMessage("Saving file...");
|
|
7410
|
-
|
|
7411
|
-
setExportProgress(
|
|
7467
|
+
chunkSDOQKSKI_js.downloadBlob(blob, "presentation.webm");
|
|
7468
|
+
setExportProgress(chunkSDOQKSKI_js.EXPORT_DONE_PERCENT);
|
|
7412
7469
|
} catch (err) {
|
|
7413
|
-
if (!
|
|
7470
|
+
if (!chunkSDOQKSKI_js.isExportAbortError(err)) {
|
|
7414
7471
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7415
7472
|
}
|
|
7416
7473
|
} finally {
|
|
@@ -7438,18 +7495,18 @@ function useExportHandlers(input) {
|
|
|
7438
7495
|
scale: 0.5,
|
|
7439
7496
|
slideDurationMs: 2e3,
|
|
7440
7497
|
onProgress: (current, total) => {
|
|
7441
|
-
setExportProgress(
|
|
7442
|
-
setExportStatusMessage(
|
|
7498
|
+
setExportProgress(chunkSDOQKSKI_js.slideProgressPercent(current, total));
|
|
7499
|
+
setExportStatusMessage(chunkSDOQKSKI_js.slideStatusLabel("Encoding", current, total));
|
|
7443
7500
|
},
|
|
7444
7501
|
signal: abortCtrl.signal
|
|
7445
7502
|
}
|
|
7446
7503
|
);
|
|
7447
|
-
setExportProgress(
|
|
7504
|
+
setExportProgress(chunkSDOQKSKI_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7448
7505
|
setExportStatusMessage("Saving file...");
|
|
7449
|
-
|
|
7450
|
-
setExportProgress(
|
|
7506
|
+
chunkSDOQKSKI_js.downloadBlob(blob, "presentation.gif");
|
|
7507
|
+
setExportProgress(chunkSDOQKSKI_js.EXPORT_DONE_PERCENT);
|
|
7451
7508
|
} catch (err) {
|
|
7452
|
-
if (!
|
|
7509
|
+
if (!chunkSDOQKSKI_js.isExportAbortError(err)) {
|
|
7453
7510
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7454
7511
|
}
|
|
7455
7512
|
} finally {
|
|
@@ -7490,7 +7547,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7490
7547
|
}
|
|
7491
7548
|
printWindow.document.open();
|
|
7492
7549
|
printWindow.document.write(
|
|
7493
|
-
|
|
7550
|
+
chunkSDOQKSKI_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7494
7551
|
);
|
|
7495
7552
|
printWindow.document.close();
|
|
7496
7553
|
printWindow.focus();
|
|
@@ -7524,8 +7581,8 @@ function usePrintHandlers(input) {
|
|
|
7524
7581
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7525
7582
|
return handlePrintWithSettings(settings);
|
|
7526
7583
|
}
|
|
7527
|
-
const colorFilter =
|
|
7528
|
-
const slideIndices =
|
|
7584
|
+
const colorFilter = chunkSDOQKSKI_js.computeColorFilter(settings.colorMode);
|
|
7585
|
+
const slideIndices = chunkSDOQKSKI_js.computeSlideIndices(
|
|
7529
7586
|
settings.slideRange,
|
|
7530
7587
|
activeSlideIndex,
|
|
7531
7588
|
slides.length,
|
|
@@ -7539,7 +7596,7 @@ function usePrintHandlers(input) {
|
|
|
7539
7596
|
if (svgs.length === 0) {
|
|
7540
7597
|
return;
|
|
7541
7598
|
}
|
|
7542
|
-
const printDoc =
|
|
7599
|
+
const printDoc = chunkSDOQKSKI_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7543
7600
|
title: "Slides (Vector)",
|
|
7544
7601
|
orientation: settings.orientation,
|
|
7545
7602
|
colorFilter
|
|
@@ -7552,8 +7609,8 @@ function usePrintHandlers(input) {
|
|
|
7552
7609
|
};
|
|
7553
7610
|
const handlePrintWithSettings = async (settings) => {
|
|
7554
7611
|
setIsPrintDialogOpen(false);
|
|
7555
|
-
const colorFilter =
|
|
7556
|
-
const slideIndices =
|
|
7612
|
+
const colorFilter = chunkSDOQKSKI_js.computeColorFilter(settings.colorMode);
|
|
7613
|
+
const slideIndices = chunkSDOQKSKI_js.computeSlideIndices(
|
|
7557
7614
|
settings.slideRange,
|
|
7558
7615
|
activeSlideIndex,
|
|
7559
7616
|
slides.length,
|
|
@@ -7563,7 +7620,7 @@ function usePrintHandlers(input) {
|
|
|
7563
7620
|
if (settings.printWhat === "outline") {
|
|
7564
7621
|
openPrintWindow(
|
|
7565
7622
|
"Outline",
|
|
7566
|
-
`<div class="outline-page">${
|
|
7623
|
+
`<div class="outline-page">${chunkSDOQKSKI_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7567
7624
|
settings.orientation,
|
|
7568
7625
|
colorFilter,
|
|
7569
7626
|
settings.frameSlides
|
|
@@ -7588,7 +7645,7 @@ function usePrintHandlers(input) {
|
|
|
7588
7645
|
if (settings.printWhat === "slides") {
|
|
7589
7646
|
openPrintWindow(
|
|
7590
7647
|
"Slides",
|
|
7591
|
-
|
|
7648
|
+
chunkSDOQKSKI_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7592
7649
|
settings.orientation,
|
|
7593
7650
|
colorFilter,
|
|
7594
7651
|
settings.frameSlides
|
|
@@ -7598,7 +7655,7 @@ function usePrintHandlers(input) {
|
|
|
7598
7655
|
if (settings.printWhat === "notes") {
|
|
7599
7656
|
openPrintWindow(
|
|
7600
7657
|
"Notes Pages",
|
|
7601
|
-
|
|
7658
|
+
chunkSDOQKSKI_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7602
7659
|
"portrait",
|
|
7603
7660
|
colorFilter,
|
|
7604
7661
|
settings.frameSlides
|
|
@@ -7609,7 +7666,7 @@ function usePrintHandlers(input) {
|
|
|
7609
7666
|
const spp = settings.slidesPerPage;
|
|
7610
7667
|
openPrintWindow(
|
|
7611
7668
|
`Handout ${spp} per page`,
|
|
7612
|
-
|
|
7669
|
+
chunkSDOQKSKI_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7613
7670
|
"portrait",
|
|
7614
7671
|
colorFilter,
|
|
7615
7672
|
settings.frameSlides
|
|
@@ -7673,8 +7730,8 @@ function useThemeHandlers(input) {
|
|
|
7673
7730
|
return;
|
|
7674
7731
|
}
|
|
7675
7732
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7676
|
-
const previousMap = theme?.colorScheme ?
|
|
7677
|
-
setSlides((prev) =>
|
|
7733
|
+
const previousMap = theme?.colorScheme ? chunkSDOQKSKI_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7734
|
+
setSlides((prev) => chunkSDOQKSKI_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7678
7735
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7679
7736
|
bumpHistory();
|
|
7680
7737
|
history.markDirty();
|
|
@@ -7779,7 +7836,7 @@ function useThemeSwitching(input) {
|
|
|
7779
7836
|
}
|
|
7780
7837
|
try {
|
|
7781
7838
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7782
|
-
const newData =
|
|
7839
|
+
const newData = chunkSDOQKSKI_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7783
7840
|
onDataChange(newData);
|
|
7784
7841
|
onThemeChanged?.(preset);
|
|
7785
7842
|
} catch (error) {
|
|
@@ -7796,7 +7853,7 @@ function useThemeSwitching(input) {
|
|
|
7796
7853
|
}
|
|
7797
7854
|
try {
|
|
7798
7855
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7799
|
-
const newData =
|
|
7856
|
+
const newData = chunkSDOQKSKI_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7800
7857
|
onDataChange(newData);
|
|
7801
7858
|
} catch (error) {
|
|
7802
7859
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7808,12 +7865,12 @@ function useThemeSwitching(input) {
|
|
|
7808
7865
|
if (!data?.theme?.colorScheme) {
|
|
7809
7866
|
return void 0;
|
|
7810
7867
|
}
|
|
7811
|
-
return
|
|
7812
|
-
(p) =>
|
|
7868
|
+
return chunkSDOQKSKI_js.THEME_PRESETS.find(
|
|
7869
|
+
(p) => chunkSDOQKSKI_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7813
7870
|
);
|
|
7814
7871
|
}, [data?.theme?.colorScheme]);
|
|
7815
7872
|
return {
|
|
7816
|
-
presets:
|
|
7873
|
+
presets: chunkSDOQKSKI_js.THEME_PRESETS,
|
|
7817
7874
|
switchToPreset,
|
|
7818
7875
|
switchToCustom,
|
|
7819
7876
|
currentPreset
|
|
@@ -7888,7 +7945,7 @@ function usePropertyHandlers(input) {
|
|
|
7888
7945
|
}
|
|
7889
7946
|
try {
|
|
7890
7947
|
const ab = await file.arrayBuffer();
|
|
7891
|
-
const h = new
|
|
7948
|
+
const h = new chunkSDOQKSKI_js.PptxHandler();
|
|
7892
7949
|
const other = await h.load(ab);
|
|
7893
7950
|
if (!other) {
|
|
7894
7951
|
return;
|
|
@@ -7898,7 +7955,7 @@ function usePropertyHandlers(input) {
|
|
|
7898
7955
|
width: canvasSize.width,
|
|
7899
7956
|
height: canvasSize.height
|
|
7900
7957
|
};
|
|
7901
|
-
setCompareResult(
|
|
7958
|
+
setCompareResult(chunkSDOQKSKI_js.comparePresentation(cur, other));
|
|
7902
7959
|
setIsComparePanelOpen(true);
|
|
7903
7960
|
} catch (err) {
|
|
7904
7961
|
console.warn("Compare failed:", err);
|
|
@@ -7915,7 +7972,7 @@ function usePropertyHandlers(input) {
|
|
|
7915
7972
|
if (!diff || diff.status === "unchanged") {
|
|
7916
7973
|
return;
|
|
7917
7974
|
}
|
|
7918
|
-
setSlides((prev) =>
|
|
7975
|
+
setSlides((prev) => chunkSDOQKSKI_js.applyAcceptSlide(prev, diff));
|
|
7919
7976
|
setIsDirty(true);
|
|
7920
7977
|
},
|
|
7921
7978
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7926,10 +7983,10 @@ function usePropertyHandlers(input) {
|
|
|
7926
7983
|
if (!compareResult) {
|
|
7927
7984
|
return;
|
|
7928
7985
|
}
|
|
7929
|
-
setSlides((prev) =>
|
|
7986
|
+
setSlides((prev) => chunkSDOQKSKI_js.applyAcceptAllSlides(prev, compareResult));
|
|
7930
7987
|
setIsDirty(true);
|
|
7931
7988
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7932
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7989
|
+
const usedFontFamilies = react.useMemo(() => chunkSDOQKSKI_js.collectUsedFonts(slides), [slides]);
|
|
7933
7990
|
return {
|
|
7934
7991
|
handleUpdateNotes,
|
|
7935
7992
|
handleUpdateSlide,
|
|
@@ -8048,7 +8105,7 @@ function useIsMobile(input) {
|
|
|
8048
8105
|
const containerRef = input?.containerRef;
|
|
8049
8106
|
const isTouchDevice = react.useSyncExternalStore(
|
|
8050
8107
|
subscribeTouchCapability,
|
|
8051
|
-
|
|
8108
|
+
chunkSDOQKSKI_js.detectTouchDevice,
|
|
8052
8109
|
() => false
|
|
8053
8110
|
// server snapshot
|
|
8054
8111
|
);
|
|
@@ -8064,7 +8121,7 @@ function useIsMobile(input) {
|
|
|
8064
8121
|
}
|
|
8065
8122
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
8066
8123
|
});
|
|
8067
|
-
const [orientation, setOrientation] = react.useState(
|
|
8124
|
+
const [orientation, setOrientation] = react.useState(chunkSDOQKSKI_js.detectOrientation);
|
|
8068
8125
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
8069
8126
|
const [initialViewportHeight] = react.useState(
|
|
8070
8127
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -8108,7 +8165,7 @@ function useIsMobile(input) {
|
|
|
8108
8165
|
return;
|
|
8109
8166
|
}
|
|
8110
8167
|
const handleOrientationChange = () => {
|
|
8111
|
-
setOrientation(
|
|
8168
|
+
setOrientation(chunkSDOQKSKI_js.detectOrientation());
|
|
8112
8169
|
};
|
|
8113
8170
|
if (screen.orientation) {
|
|
8114
8171
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -8138,9 +8195,9 @@ function useIsMobile(input) {
|
|
|
8138
8195
|
window.addEventListener("resize", handleResize);
|
|
8139
8196
|
return () => window.removeEventListener("resize", handleResize);
|
|
8140
8197
|
}, [isTouchDevice, initialViewportHeight]);
|
|
8141
|
-
const isMobile =
|
|
8142
|
-
const isTablet = !isMobile && containerWidth >=
|
|
8143
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
8198
|
+
const isMobile = chunkSDOQKSKI_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
8199
|
+
const isTablet = !isMobile && containerWidth >= chunkSDOQKSKI_js.MOBILE_BREAKPOINT && containerWidth < chunkSDOQKSKI_js.TABLET_BREAKPOINT;
|
|
8200
|
+
const isDesktop = !isMobile && containerWidth >= chunkSDOQKSKI_js.TABLET_BREAKPOINT;
|
|
8144
8201
|
return {
|
|
8145
8202
|
isMobile,
|
|
8146
8203
|
isTablet,
|
|
@@ -8202,7 +8259,7 @@ function useViewerDialogs(input) {
|
|
|
8202
8259
|
);
|
|
8203
8260
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8204
8261
|
const fontEmbedding = react.useMemo(
|
|
8205
|
-
() =>
|
|
8262
|
+
() => chunkSDOQKSKI_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8206
8263
|
[embeddedFontKey]
|
|
8207
8264
|
);
|
|
8208
8265
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8210,11 +8267,11 @@ function useViewerDialogs(input) {
|
|
|
8210
8267
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8211
8268
|
}, [fontEmbedding]);
|
|
8212
8269
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8213
|
-
() => typeof window !== "undefined" ?
|
|
8270
|
+
() => typeof window !== "undefined" ? chunkSDOQKSKI_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8214
8271
|
);
|
|
8215
8272
|
react.useEffect(() => {
|
|
8216
8273
|
const handleWindow = () => setIsNarrowViewport(
|
|
8217
|
-
|
|
8274
|
+
chunkSDOQKSKI_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8218
8275
|
);
|
|
8219
8276
|
let observer = null;
|
|
8220
8277
|
let raf = 0;
|
|
@@ -8228,12 +8285,12 @@ function useViewerDialogs(input) {
|
|
|
8228
8285
|
const entry = entries[0];
|
|
8229
8286
|
if (entry) {
|
|
8230
8287
|
setIsNarrowViewport(
|
|
8231
|
-
|
|
8288
|
+
chunkSDOQKSKI_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8232
8289
|
);
|
|
8233
8290
|
}
|
|
8234
8291
|
});
|
|
8235
8292
|
observer.observe(el);
|
|
8236
|
-
setIsNarrowViewport(
|
|
8293
|
+
setIsNarrowViewport(chunkSDOQKSKI_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8237
8294
|
};
|
|
8238
8295
|
attach();
|
|
8239
8296
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8390,22 +8447,16 @@ function useViewerDialogs(input) {
|
|
|
8390
8447
|
handleRunAccessibilityCheck
|
|
8391
8448
|
};
|
|
8392
8449
|
}
|
|
8393
|
-
function
|
|
8394
|
-
|
|
8395
|
-
const px = Math.round(presentationGridSpacing.cx / chunkDA6DF3EU_js.EMU_PER_PX);
|
|
8396
|
-
if (px > 0) {
|
|
8397
|
-
return px;
|
|
8398
|
-
}
|
|
8399
|
-
}
|
|
8400
|
-
return chunkDA6DF3EU_js.GRID_SIZE;
|
|
8450
|
+
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8451
|
+
return chunkSDOQKSKI_js.computeGridSpacingPx(documentGridSpacing, chunkXMLPTDPM_js.GRID_SIZE);
|
|
8401
8452
|
}
|
|
8402
8453
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8403
8454
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8404
|
-
return
|
|
8455
|
+
return chunkSDOQKSKI_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8405
8456
|
}
|
|
8406
8457
|
function computeSlideSectionGroups(slides, sections) {
|
|
8407
|
-
return
|
|
8408
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8458
|
+
return chunkSDOQKSKI_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8459
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkXMLPTDPM_js.UNGROUPED_SECTION_ID : chunkXMLPTDPM_js.DEFAULT_SECTION_GROUP_ID),
|
|
8409
8460
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8410
8461
|
slideIndexes: group.slideIndexes,
|
|
8411
8462
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8417,7 +8468,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8417
8468
|
return void 0;
|
|
8418
8469
|
}
|
|
8419
8470
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8420
|
-
return
|
|
8471
|
+
return chunkSDOQKSKI_js.masterViewPseudoSlide(document2, {
|
|
8421
8472
|
tab: "slides",
|
|
8422
8473
|
masterIndex: 0,
|
|
8423
8474
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8433,11 +8484,11 @@ function useDerivedSlideState(input) {
|
|
|
8433
8484
|
mode,
|
|
8434
8485
|
activeLayout,
|
|
8435
8486
|
activeMaster,
|
|
8436
|
-
|
|
8487
|
+
documentGridSpacing
|
|
8437
8488
|
} = input;
|
|
8438
8489
|
const gridSpacingPx = react.useMemo(
|
|
8439
|
-
() =>
|
|
8440
|
-
[
|
|
8490
|
+
() => computeGridSpacingPx2(documentGridSpacing),
|
|
8491
|
+
[documentGridSpacing]
|
|
8441
8492
|
);
|
|
8442
8493
|
const visibleSlideIndexes = react.useMemo(
|
|
8443
8494
|
() => computeVisibleSlideIndexes(slides, activeCustomShowId, customShows),
|
|
@@ -8445,10 +8496,10 @@ function useDerivedSlideState(input) {
|
|
|
8445
8496
|
);
|
|
8446
8497
|
const slideSectionGroups = react.useMemo(
|
|
8447
8498
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8448
|
-
if (group.id ===
|
|
8499
|
+
if (group.id === chunkXMLPTDPM_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8449
8500
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8450
8501
|
}
|
|
8451
|
-
if (group.id ===
|
|
8502
|
+
if (group.id === chunkXMLPTDPM_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8452
8503
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8453
8504
|
}
|
|
8454
8505
|
return group;
|
|
@@ -8548,13 +8599,13 @@ function useAnnotationHandlers(input) {
|
|
|
8548
8599
|
}, [annotations, setMode, setSlides, history]);
|
|
8549
8600
|
const handleSetMode = react.useCallback(
|
|
8550
8601
|
(nextMode) => {
|
|
8551
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8602
|
+
if (mode === "present" && nextMode !== "present" && !chunkSDOQKSKI_js.mayLeaveSlideShow()) {
|
|
8552
8603
|
return;
|
|
8553
8604
|
}
|
|
8554
8605
|
if (nextMode === "present") {
|
|
8555
8606
|
presentation.enterPresentMode();
|
|
8556
8607
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8557
|
-
|
|
8608
|
+
chunkSDOQKSKI_js.stopAllPersistentAudio();
|
|
8558
8609
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8559
8610
|
if (promptKeepInkAnnotations) {
|
|
8560
8611
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8563,7 +8614,7 @@ function useAnnotationHandlers(input) {
|
|
|
8563
8614
|
}
|
|
8564
8615
|
} else {
|
|
8565
8616
|
if (mode === "present") {
|
|
8566
|
-
|
|
8617
|
+
chunkSDOQKSKI_js.stopAllPersistentAudio();
|
|
8567
8618
|
}
|
|
8568
8619
|
setMode(nextMode);
|
|
8569
8620
|
}
|
|
@@ -8634,13 +8685,13 @@ function useSerialize(input) {
|
|
|
8634
8685
|
let processedSlide = slide;
|
|
8635
8686
|
if (pendingEditId) {
|
|
8636
8687
|
const updatedElements = slide.elements.map((el) => {
|
|
8637
|
-
if (el.id !== pendingEditId || !
|
|
8688
|
+
if (el.id !== pendingEditId || !chunkSDOQKSKI_js.hasTextProperties(el)) {
|
|
8638
8689
|
return el;
|
|
8639
8690
|
}
|
|
8640
8691
|
return {
|
|
8641
8692
|
...el,
|
|
8642
8693
|
text: pendingEditText,
|
|
8643
|
-
textSegments:
|
|
8694
|
+
textSegments: chunkSDOQKSKI_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8644
8695
|
};
|
|
8645
8696
|
});
|
|
8646
8697
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8653,19 +8704,19 @@ function useSerialize(input) {
|
|
|
8653
8704
|
const pptxGuides = guides.map((g) => ({
|
|
8654
8705
|
id: g.id,
|
|
8655
8706
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8656
|
-
positionEmu:
|
|
8707
|
+
positionEmu: chunkSDOQKSKI_js.guidePxToEmu(g.position)
|
|
8657
8708
|
}));
|
|
8658
8709
|
return {
|
|
8659
8710
|
...processedSlide,
|
|
8660
8711
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8661
8712
|
};
|
|
8662
8713
|
});
|
|
8663
|
-
const slidesToSave =
|
|
8714
|
+
const slidesToSave = chunkSDOQKSKI_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8664
8715
|
const saveOptions = {
|
|
8665
8716
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8666
8717
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8667
8718
|
// slide-size edit reaches the file.
|
|
8668
|
-
slideSize:
|
|
8719
|
+
slideSize: chunkSDOQKSKI_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8669
8720
|
headerFooter,
|
|
8670
8721
|
presentationProperties,
|
|
8671
8722
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -8677,9 +8728,9 @@ function useSerialize(input) {
|
|
|
8677
8728
|
slideMasters,
|
|
8678
8729
|
notesMaster,
|
|
8679
8730
|
handoutMaster,
|
|
8680
|
-
...
|
|
8731
|
+
...chunkSDOQKSKI_js.embeddedFontSaveOptions(embedFonts)
|
|
8681
8732
|
};
|
|
8682
|
-
return
|
|
8733
|
+
return chunkSDOQKSKI_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8683
8734
|
}, [
|
|
8684
8735
|
slides,
|
|
8685
8736
|
templateElementsBySlideId,
|
|
@@ -8714,7 +8765,7 @@ function useRecoveryDetection(input) {
|
|
|
8714
8765
|
const onRestore = input.onRestore;
|
|
8715
8766
|
const openVersionHistory = input.openVersionHistory;
|
|
8716
8767
|
react.useEffect(() => {
|
|
8717
|
-
if (!
|
|
8768
|
+
if (!chunkSDOQKSKI_js.shouldProbeAutosaveRecovery({
|
|
8718
8769
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8719
8770
|
filePath,
|
|
8720
8771
|
loading,
|
|
@@ -8726,7 +8777,7 @@ function useRecoveryDetection(input) {
|
|
|
8726
8777
|
}
|
|
8727
8778
|
recoveryCheckedRef.current = true;
|
|
8728
8779
|
void (async () => {
|
|
8729
|
-
const offer = await
|
|
8780
|
+
const offer = await chunkSDOQKSKI_js.probeAutosaveRecovery(filePath);
|
|
8730
8781
|
if (!offer) {
|
|
8731
8782
|
return;
|
|
8732
8783
|
}
|
|
@@ -8739,7 +8790,7 @@ function useRecoveryDetection(input) {
|
|
|
8739
8790
|
const record = recordRef.current;
|
|
8740
8791
|
setPrompt(null);
|
|
8741
8792
|
if (record && onRestore) {
|
|
8742
|
-
onRestore(
|
|
8793
|
+
onRestore(chunkSDOQKSKI_js.acceptAutosaveRecovery(record));
|
|
8743
8794
|
}
|
|
8744
8795
|
recordRef.current = null;
|
|
8745
8796
|
}, [onRestore]);
|
|
@@ -8748,7 +8799,7 @@ function useRecoveryDetection(input) {
|
|
|
8748
8799
|
setPrompt(null);
|
|
8749
8800
|
recordRef.current = null;
|
|
8750
8801
|
if (record) {
|
|
8751
|
-
void
|
|
8802
|
+
void chunkSDOQKSKI_js.discardAutosaveRecovery(record);
|
|
8752
8803
|
}
|
|
8753
8804
|
}, []);
|
|
8754
8805
|
return { prompt, restore, discard };
|
|
@@ -8788,7 +8839,7 @@ function usePresentationSetup(input) {
|
|
|
8788
8839
|
containerRef,
|
|
8789
8840
|
content,
|
|
8790
8841
|
onSetMode: (nextMode) => {
|
|
8791
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8842
|
+
if (mode === "present" && nextMode !== "present" && !chunkSDOQKSKI_js.mayLeaveSlideShow()) {
|
|
8792
8843
|
return;
|
|
8793
8844
|
}
|
|
8794
8845
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8796,7 +8847,7 @@ function usePresentationSetup(input) {
|
|
|
8796
8847
|
setShowKeepAnnotationsDialog(true);
|
|
8797
8848
|
} else {
|
|
8798
8849
|
if (mode === "present" && nextMode !== "present") {
|
|
8799
|
-
|
|
8850
|
+
chunkSDOQKSKI_js.stopAllPersistentAudio();
|
|
8800
8851
|
stopAnimationSound();
|
|
8801
8852
|
}
|
|
8802
8853
|
setMode(nextMode);
|
|
@@ -8851,10 +8902,10 @@ function usePresentationSetup(input) {
|
|
|
8851
8902
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8852
8903
|
onToggleSubtitles,
|
|
8853
8904
|
onSaveRehearsalTimings: (timings) => {
|
|
8854
|
-
setSlides((prev) =>
|
|
8905
|
+
setSlides((prev) => chunkSDOQKSKI_js.applyRehearsalTimings(prev, timings));
|
|
8855
8906
|
history.markDirty();
|
|
8856
8907
|
},
|
|
8857
|
-
loopContinuously:
|
|
8908
|
+
loopContinuously: chunkSDOQKSKI_js.shouldLoopContinuously(presentationProperties),
|
|
8858
8909
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8859
8910
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8860
8911
|
endWithBlackSlide
|
|
@@ -9047,7 +9098,7 @@ function useEditorOperations(input) {
|
|
|
9047
9098
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9048
9099
|
react.useEffect(() => {
|
|
9049
9100
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9050
|
-
copiedFormatRef.current =
|
|
9101
|
+
copiedFormatRef.current = chunkSDOQKSKI_js.copyFormatFromElement(selectedElement);
|
|
9051
9102
|
} else if (!formatPainterActive) {
|
|
9052
9103
|
copiedFormatRef.current = null;
|
|
9053
9104
|
}
|
|
@@ -9073,12 +9124,12 @@ function useEditorOperations(input) {
|
|
|
9073
9124
|
e.stopPropagation();
|
|
9074
9125
|
const element = elementLookup.get(elementId);
|
|
9075
9126
|
if (element) {
|
|
9076
|
-
const updated =
|
|
9127
|
+
const updated = chunkSDOQKSKI_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9077
9128
|
const updates = {};
|
|
9078
|
-
if (
|
|
9129
|
+
if (chunkSDOQKSKI_js.hasShapeProperties(updated)) {
|
|
9079
9130
|
updates.shapeStyle = updated.shapeStyle;
|
|
9080
9131
|
}
|
|
9081
|
-
if (
|
|
9132
|
+
if (chunkSDOQKSKI_js.hasTextProperties(updated)) {
|
|
9082
9133
|
updates.textStyle = updated.textStyle;
|
|
9083
9134
|
}
|
|
9084
9135
|
ops.updateElementById(elementId, updates);
|
|
@@ -9232,7 +9283,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9232
9283
|
const families = /* @__PURE__ */ new Set();
|
|
9233
9284
|
for (const slide of slides) {
|
|
9234
9285
|
for (const el of slide.elements) {
|
|
9235
|
-
if (
|
|
9286
|
+
if (chunkSDOQKSKI_js.hasTextProperties(el) && el.textSegments) {
|
|
9236
9287
|
for (const seg of el.textSegments) {
|
|
9237
9288
|
if (seg.style.fontFamily) {
|
|
9238
9289
|
families.add(seg.style.fontFamily);
|
|
@@ -9392,6 +9443,7 @@ function useContentLifecycle(input) {
|
|
|
9392
9443
|
setActiveCustomShowId: state.setActiveCustomShowId,
|
|
9393
9444
|
setSections: state.setSections,
|
|
9394
9445
|
setPresentationProperties: state.setPresentationProperties,
|
|
9446
|
+
setViewProperties: state.setViewProperties,
|
|
9395
9447
|
setNotesMaster: state.setNotesMaster,
|
|
9396
9448
|
setHandoutMaster: state.setHandoutMaster,
|
|
9397
9449
|
setNotesCanvasSize: state.setNotesCanvasSize,
|
|
@@ -9479,7 +9531,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9479
9531
|
inputRef.current = input;
|
|
9480
9532
|
const handleKeyDown = react.useCallback((e) => {
|
|
9481
9533
|
const current = inputRef.current;
|
|
9482
|
-
const { action, dx, dy } =
|
|
9534
|
+
const { action, dx, dy } = chunkSDOQKSKI_js.mapEditorKey(e, {
|
|
9483
9535
|
canEdit: current.canEdit,
|
|
9484
9536
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9485
9537
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9492,7 +9544,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9492
9544
|
hasSelection: current.hasSelection,
|
|
9493
9545
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9494
9546
|
isDrawing: current.activeTool !== "select",
|
|
9495
|
-
isTextInputTarget:
|
|
9547
|
+
isTextInputTarget: chunkSDOQKSKI_js.isEditorTextInputTarget(e.target)
|
|
9496
9548
|
});
|
|
9497
9549
|
if (action === null) {
|
|
9498
9550
|
return;
|
|
@@ -9798,7 +9850,7 @@ function useViewerIntegration(input) {
|
|
|
9798
9850
|
return zoom.scale;
|
|
9799
9851
|
},
|
|
9800
9852
|
setZoom(level) {
|
|
9801
|
-
zoom.setScale(
|
|
9853
|
+
zoom.setScale(chunkSDOQKSKI_js.clampZoomScale(level));
|
|
9802
9854
|
},
|
|
9803
9855
|
zoomIn() {
|
|
9804
9856
|
zoom.handleZoomIn();
|
|
@@ -10014,7 +10066,7 @@ function useReducedMotion() {
|
|
|
10014
10066
|
}
|
|
10015
10067
|
function useViewerOptions() {
|
|
10016
10068
|
const storeRef = react.useRef(null);
|
|
10017
|
-
storeRef.current ??=
|
|
10069
|
+
storeRef.current ??= chunkSDOQKSKI_js.createViewerOptionsStore();
|
|
10018
10070
|
const store = storeRef.current;
|
|
10019
10071
|
const options = react.useSyncExternalStore(
|
|
10020
10072
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -10023,9 +10075,9 @@ function useViewerOptions() {
|
|
|
10023
10075
|
);
|
|
10024
10076
|
return { optionsStore: store, options };
|
|
10025
10077
|
}
|
|
10026
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10078
|
+
var KNOWN_TAB_IDS = new Set(chunkSDOQKSKI_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10027
10079
|
function computeToolbarVisibility(hiddenActions) {
|
|
10028
|
-
const isHidden = (id) =>
|
|
10080
|
+
const isHidden = (id) => chunkSDOQKSKI_js.isActionHidden(id, hiddenActions);
|
|
10029
10081
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
10030
10082
|
return { isHidden, isTabVisible };
|
|
10031
10083
|
}
|
|
@@ -10111,12 +10163,12 @@ function useYjsDocumentSync({
|
|
|
10111
10163
|
return;
|
|
10112
10164
|
}
|
|
10113
10165
|
try {
|
|
10114
|
-
const handler = new
|
|
10166
|
+
const handler = new chunkSDOQKSKI_js.PptxHandler();
|
|
10115
10167
|
await handler.load(sourceBytes.buffer);
|
|
10116
|
-
const currentSlides =
|
|
10168
|
+
const currentSlides = chunkSDOQKSKI_js.readSlidesFromYDoc(
|
|
10117
10169
|
doc
|
|
10118
10170
|
);
|
|
10119
|
-
const slidesToSave =
|
|
10171
|
+
const slidesToSave = chunkSDOQKSKI_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10120
10172
|
const bytes = await handler.save(slidesToSave);
|
|
10121
10173
|
config.onWriteBack(bytes);
|
|
10122
10174
|
} catch {
|
|
@@ -10131,10 +10183,10 @@ function useYjsDocumentSync({
|
|
|
10131
10183
|
if (!doc || !isConnected) {
|
|
10132
10184
|
return;
|
|
10133
10185
|
}
|
|
10134
|
-
const docSlides =
|
|
10186
|
+
const docSlides = chunkSDOQKSKI_js.readSlidesFromYDoc(
|
|
10135
10187
|
doc
|
|
10136
10188
|
);
|
|
10137
|
-
if (!
|
|
10189
|
+
if (!chunkSDOQKSKI_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10138
10190
|
return;
|
|
10139
10191
|
}
|
|
10140
10192
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10153,11 +10205,11 @@ function useYjsDocumentSync({
|
|
|
10153
10205
|
lastSyncedRef.current = serialized;
|
|
10154
10206
|
void (async () => {
|
|
10155
10207
|
const factories = await getFactories();
|
|
10156
|
-
|
|
10208
|
+
chunkSDOQKSKI_js.reconcileSlidesInYDoc(
|
|
10157
10209
|
slides,
|
|
10158
10210
|
doc,
|
|
10159
10211
|
factories,
|
|
10160
|
-
|
|
10212
|
+
chunkSDOQKSKI_js.LOCAL_SYNC_ORIGIN
|
|
10161
10213
|
);
|
|
10162
10214
|
scheduleWriteBack();
|
|
10163
10215
|
})();
|
|
@@ -10171,10 +10223,10 @@ function useYjsDocumentSync({
|
|
|
10171
10223
|
return;
|
|
10172
10224
|
}
|
|
10173
10225
|
const handleChange = (_events, transaction) => {
|
|
10174
|
-
if (transaction?.origin ===
|
|
10226
|
+
if (transaction?.origin === chunkSDOQKSKI_js.LOCAL_SYNC_ORIGIN) {
|
|
10175
10227
|
return;
|
|
10176
10228
|
}
|
|
10177
|
-
const remoteSlides =
|
|
10229
|
+
const remoteSlides = chunkSDOQKSKI_js.readSlidesFromYDoc(
|
|
10178
10230
|
doc
|
|
10179
10231
|
);
|
|
10180
10232
|
if (remoteSlides.length === 0) {
|
|
@@ -10190,7 +10242,7 @@ function useYjsDocumentSync({
|
|
|
10190
10242
|
isApplyingRemoteRef.current = false;
|
|
10191
10243
|
scheduleWriteBack();
|
|
10192
10244
|
};
|
|
10193
|
-
const unobserve =
|
|
10245
|
+
const unobserve = chunkSDOQKSKI_js.observeYDocSlides(
|
|
10194
10246
|
doc,
|
|
10195
10247
|
handleChange
|
|
10196
10248
|
);
|
|
@@ -10228,7 +10280,7 @@ function useBroadcastFollower({
|
|
|
10228
10280
|
if (!broadcaster) {
|
|
10229
10281
|
return;
|
|
10230
10282
|
}
|
|
10231
|
-
if (!
|
|
10283
|
+
if (!chunkSDOQKSKI_js.shouldAutoFollowBroadcaster({
|
|
10232
10284
|
localRole: collab.config.role,
|
|
10233
10285
|
broadcasterRole: broadcaster.role
|
|
10234
10286
|
})) {
|
|
@@ -10403,10 +10455,10 @@ function useTouchGestures(input) {
|
|
|
10403
10455
|
if (!el || !enabled) {
|
|
10404
10456
|
return;
|
|
10405
10457
|
}
|
|
10406
|
-
const recognizer =
|
|
10458
|
+
const recognizer = chunkSDOQKSKI_js.createTouchGestureRecognizer({
|
|
10407
10459
|
getScale: () => scaleRef.current,
|
|
10408
|
-
minScale:
|
|
10409
|
-
maxScale:
|
|
10460
|
+
minScale: chunkSDOQKSKI_js.MIN_ZOOM_SCALE,
|
|
10461
|
+
maxScale: chunkSDOQKSKI_js.MAX_ZOOM_SCALE,
|
|
10410
10462
|
callbacks: {
|
|
10411
10463
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10412
10464
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10446,7 +10498,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10446
10498
|
return;
|
|
10447
10499
|
}
|
|
10448
10500
|
const rect = active.getBoundingClientRect();
|
|
10449
|
-
const delta =
|
|
10501
|
+
const delta = chunkSDOQKSKI_js.computeScrollDelta(
|
|
10450
10502
|
{ top: rect.top, bottom: rect.bottom },
|
|
10451
10503
|
window.innerHeight,
|
|
10452
10504
|
keyboardInset
|
|
@@ -10466,8 +10518,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10466
10518
|
return;
|
|
10467
10519
|
}
|
|
10468
10520
|
const update = () => {
|
|
10469
|
-
const metrics =
|
|
10470
|
-
const inset = metrics ?
|
|
10521
|
+
const metrics = chunkSDOQKSKI_js.readViewportMetrics(window);
|
|
10522
|
+
const inset = metrics ? chunkSDOQKSKI_js.computeKeyboardInset(metrics) : 0;
|
|
10471
10523
|
setKeyboardInset(inset);
|
|
10472
10524
|
if (inset > 0) {
|
|
10473
10525
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10478,8 +10530,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10478
10530
|
vv.addEventListener("scroll", update);
|
|
10479
10531
|
const onFocusIn = () => {
|
|
10480
10532
|
window.requestAnimationFrame(() => {
|
|
10481
|
-
const metrics =
|
|
10482
|
-
const inset = metrics ?
|
|
10533
|
+
const metrics = chunkSDOQKSKI_js.readViewportMetrics(window);
|
|
10534
|
+
const inset = metrics ? chunkSDOQKSKI_js.computeKeyboardInset(metrics) : 0;
|
|
10483
10535
|
if (inset > 0) {
|
|
10484
10536
|
scrollFocusedIntoView(inset);
|
|
10485
10537
|
}
|
|
@@ -10492,7 +10544,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10492
10544
|
document.removeEventListener("focusin", onFocusIn);
|
|
10493
10545
|
};
|
|
10494
10546
|
}, [enabled]);
|
|
10495
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10547
|
+
return { keyboardInset, isKeyboardOpen: chunkSDOQKSKI_js.isKeyboardOpen(keyboardInset) };
|
|
10496
10548
|
}
|
|
10497
10549
|
|
|
10498
10550
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10519,7 +10571,7 @@ function buildCanvasProps(input) {
|
|
|
10519
10571
|
} = input;
|
|
10520
10572
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10521
10573
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10522
|
-
const fieldContext =
|
|
10574
|
+
const fieldContext = chunkSDOQKSKI_js.buildFieldSubstitutionContext({
|
|
10523
10575
|
headerFooter: s.headerFooter,
|
|
10524
10576
|
customProperties: s.customProperties,
|
|
10525
10577
|
slide: activeSlide
|
|
@@ -10529,13 +10581,13 @@ function buildCanvasProps(input) {
|
|
|
10529
10581
|
if (mode === "present") {
|
|
10530
10582
|
presentation.handlePresentationAction(action);
|
|
10531
10583
|
} else if (action.url) {
|
|
10532
|
-
|
|
10584
|
+
chunkSDOQKSKI_js.safeOpenUrl(action.url);
|
|
10533
10585
|
}
|
|
10534
10586
|
};
|
|
10535
10587
|
const handleHyperlinkClick = (url) => {
|
|
10536
|
-
if (
|
|
10588
|
+
if (chunkSDOQKSKI_js.isPpactionUrl(url)) {
|
|
10537
10589
|
if (mode === "present") {
|
|
10538
|
-
const parsed =
|
|
10590
|
+
const parsed = chunkSDOQKSKI_js.parsePpactionUrl(url);
|
|
10539
10591
|
if (parsed) {
|
|
10540
10592
|
presentation.handlePresentationAction({
|
|
10541
10593
|
action: parsed.action,
|
|
@@ -10545,7 +10597,7 @@ function buildCanvasProps(input) {
|
|
|
10545
10597
|
}
|
|
10546
10598
|
return;
|
|
10547
10599
|
}
|
|
10548
|
-
|
|
10600
|
+
chunkSDOQKSKI_js.safeOpenUrl(url);
|
|
10549
10601
|
};
|
|
10550
10602
|
return {
|
|
10551
10603
|
activeSlide: effectiveSlide,
|
|
@@ -10641,7 +10693,7 @@ function buildCanvasProps(input) {
|
|
|
10641
10693
|
|
|
10642
10694
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10643
10695
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10644
|
-
return
|
|
10696
|
+
return chunkSDOQKSKI_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10645
10697
|
}
|
|
10646
10698
|
|
|
10647
10699
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10654,7 +10706,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10654
10706
|
const current = activeSlide.animations ?? [];
|
|
10655
10707
|
if (group === "motionPath") {
|
|
10656
10708
|
propertyHandlers.handleUpdateSlide({
|
|
10657
|
-
animations:
|
|
10709
|
+
animations: chunkSDOQKSKI_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10658
10710
|
});
|
|
10659
10711
|
return;
|
|
10660
10712
|
}
|
|
@@ -10849,7 +10901,7 @@ function buildToolbarProps(input) {
|
|
|
10849
10901
|
onOpenFile,
|
|
10850
10902
|
onOpenRecentFile,
|
|
10851
10903
|
onCreatePresentation: (templateId) => {
|
|
10852
|
-
s.setSlides(
|
|
10904
|
+
s.setSlides(chunkSDOQKSKI_js.createBackstagePresentation(templateId));
|
|
10853
10905
|
s.setActiveSlideIndex(0);
|
|
10854
10906
|
s.setSelectedElementId(null);
|
|
10855
10907
|
s.setSelectedElementIds([]);
|
|
@@ -10878,7 +10930,7 @@ function buildToolbarProps(input) {
|
|
|
10878
10930
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
10879
10931
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10880
10932
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10881
|
-
templateScheme:
|
|
10933
|
+
templateScheme: chunkSDOQKSKI_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10882
10934
|
customShows: s.customShows,
|
|
10883
10935
|
activeCustomShowId: s.activeCustomShowId,
|
|
10884
10936
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -10919,7 +10971,7 @@ function buildToolbarProps(input) {
|
|
|
10919
10971
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10920
10972
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10921
10973
|
formatPainterActive: s.formatPainterActive,
|
|
10922
|
-
canActivateFormatPainter:
|
|
10974
|
+
canActivateFormatPainter: chunkSDOQKSKI_js.hasCopyableFormat(selectedElement),
|
|
10923
10975
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10924
10976
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10925
10977
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11011,7 +11063,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11011
11063
|
mode,
|
|
11012
11064
|
activeLayout: state.activeLayout,
|
|
11013
11065
|
activeMaster: state.activeMaster,
|
|
11014
|
-
|
|
11066
|
+
documentGridSpacing: state.viewProperties?.gridSpacing
|
|
11015
11067
|
});
|
|
11016
11068
|
const { options: viewerOptions } = useViewerOptions();
|
|
11017
11069
|
const { presentation, annotations, actionSoundHandlerRef } = usePresentationSetup({
|
|
@@ -11207,7 +11259,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11207
11259
|
}, [incomingContent]);
|
|
11208
11260
|
const onOpenFile = react.useCallback(() => {
|
|
11209
11261
|
void (async () => {
|
|
11210
|
-
const picked = await
|
|
11262
|
+
const picked = await chunkSDOQKSKI_js.openPptxFile();
|
|
11211
11263
|
if (picked) {
|
|
11212
11264
|
setContent(picked.buffer);
|
|
11213
11265
|
}
|
|
@@ -11215,7 +11267,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11215
11267
|
}, []);
|
|
11216
11268
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11217
11269
|
void (async () => {
|
|
11218
|
-
const bytes = await
|
|
11270
|
+
const bytes = await chunkSDOQKSKI_js.readBackstageRecentFile(key);
|
|
11219
11271
|
if (bytes) {
|
|
11220
11272
|
setContent(bytes);
|
|
11221
11273
|
}
|