pptx-react-viewer 2.14.0 → 2.15.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 +2 -0
- package/dist/{AiChatPanel-BJDFFVJG.js → AiChatPanel-4WPZXJMM.js} +22 -22
- package/dist/AiChatPanel-4WPZXJMM.js.br +0 -0
- package/dist/AiChatPanel-4WPZXJMM.js.gz +0 -0
- package/dist/{AiChatPanel-UJUN6HB3.mjs → AiChatPanel-Q6D53GMZ.mjs} +3 -3
- package/dist/AiChatPanel-Q6D53GMZ.mjs.br +0 -0
- package/dist/AiChatPanel-Q6D53GMZ.mjs.gz +0 -0
- package/dist/{Model3DScene-F53NQFY7.js → Model3DScene-CV3IGH6V.js} +2 -2
- package/dist/Model3DScene-CV3IGH6V.js.br +0 -0
- package/dist/Model3DScene-CV3IGH6V.js.gz +0 -0
- package/dist/{Model3DScene-LVFHZUVF.mjs → Model3DScene-N6PGFO2X.mjs} +1 -1
- package/dist/Model3DScene-N6PGFO2X.mjs.br +0 -0
- package/dist/Model3DScene-N6PGFO2X.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-MVBQTD6J.mjs → SurfaceChart3DScene-H5ID4CUU.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-MVBQTD6J.mjs.br → SurfaceChart3DScene-H5ID4CUU.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-H5ID4CUU.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-IDJDIHVC.js → SurfaceChart3DScene-WXXMMXFZ.js} +2 -2
- package/dist/SurfaceChart3DScene-WXXMMXFZ.js.br +0 -0
- package/dist/SurfaceChart3DScene-WXXMMXFZ.js.gz +0 -0
- package/dist/{chunk-5MMC7ZR3.mjs → chunk-3JTRZVYW.mjs} +405 -221
- package/dist/chunk-3JTRZVYW.mjs.br +0 -0
- package/dist/{chunk-5MMC7ZR3.mjs.gz → chunk-3JTRZVYW.mjs.gz} +0 -0
- package/dist/{chunk-R7MGJCZN.mjs → chunk-56L4QYDT.mjs} +2 -2
- package/dist/chunk-56L4QYDT.mjs.br +0 -0
- package/dist/chunk-56L4QYDT.mjs.gz +0 -0
- package/dist/{chunk-QVQDC7HZ.js → chunk-CUFEHK42.js} +3 -3
- package/dist/chunk-CUFEHK42.js.br +0 -0
- package/dist/chunk-CUFEHK42.js.gz +0 -0
- package/dist/{chunk-SMECSYCT.js → chunk-HZSUTVDQ.js} +245 -245
- package/dist/chunk-HZSUTVDQ.js.br +0 -0
- package/dist/chunk-HZSUTVDQ.js.gz +0 -0
- package/dist/{chunk-PB7KVDNV.js → chunk-KA35ZMIP.js} +409 -220
- package/dist/chunk-KA35ZMIP.js.br +0 -0
- package/dist/{chunk-PB7KVDNV.js.gz → chunk-KA35ZMIP.js.gz} +0 -0
- package/dist/{chunk-HOIF5RQI.js → chunk-N6MSPBMO.js} +1052 -1052
- package/dist/chunk-N6MSPBMO.js.br +0 -0
- package/dist/chunk-N6MSPBMO.js.gz +0 -0
- package/dist/{chunk-T4NHPN76.mjs → chunk-PDUTW6MW.mjs} +2 -2
- package/dist/chunk-PDUTW6MW.mjs.br +0 -0
- package/dist/chunk-PDUTW6MW.mjs.gz +0 -0
- package/dist/{chunk-GROIHKI5.mjs → chunk-SHICB6DW.mjs} +9 -9
- package/dist/chunk-SHICB6DW.mjs.br +0 -0
- package/dist/chunk-SHICB6DW.mjs.gz +0 -0
- package/dist/{chunk-7TEZJZ2O.js → chunk-TQMJGYGQ.js} +334 -334
- package/dist/chunk-TQMJGYGQ.js.br +0 -0
- package/dist/chunk-TQMJGYGQ.js.gz +0 -0
- package/dist/{chunk-2KRHLUCG.mjs → chunk-WMZAM3UH.mjs} +1 -1
- package/dist/chunk-WMZAM3UH.mjs.br +0 -0
- package/dist/chunk-WMZAM3UH.mjs.gz +0 -0
- package/dist/index.js +39 -39
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.d.ts +60 -2
- package/dist/viewer/index.d.ts.map +1 -1
- package/dist/viewer/index.js +41 -21
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +2 -2
- package/dist/AiChatPanel-BJDFFVJG.js.br +0 -0
- package/dist/AiChatPanel-BJDFFVJG.js.gz +0 -0
- package/dist/AiChatPanel-UJUN6HB3.mjs.br +0 -0
- package/dist/AiChatPanel-UJUN6HB3.mjs.gz +0 -0
- package/dist/Model3DScene-F53NQFY7.js.br +0 -0
- package/dist/Model3DScene-F53NQFY7.js.gz +0 -0
- package/dist/Model3DScene-LVFHZUVF.mjs.br +0 -0
- package/dist/Model3DScene-LVFHZUVF.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-IDJDIHVC.js.br +0 -0
- package/dist/SurfaceChart3DScene-IDJDIHVC.js.gz +0 -0
- package/dist/SurfaceChart3DScene-MVBQTD6J.mjs.gz +0 -0
- package/dist/chunk-2KRHLUCG.mjs.br +0 -0
- package/dist/chunk-2KRHLUCG.mjs.gz +0 -0
- package/dist/chunk-5MMC7ZR3.mjs.br +0 -0
- package/dist/chunk-7TEZJZ2O.js.br +0 -0
- package/dist/chunk-7TEZJZ2O.js.gz +0 -0
- package/dist/chunk-GROIHKI5.mjs.br +0 -0
- package/dist/chunk-GROIHKI5.mjs.gz +0 -0
- package/dist/chunk-HOIF5RQI.js.br +0 -0
- package/dist/chunk-HOIF5RQI.js.gz +0 -0
- package/dist/chunk-PB7KVDNV.js.br +0 -0
- package/dist/chunk-QVQDC7HZ.js.br +0 -0
- package/dist/chunk-QVQDC7HZ.js.gz +0 -0
- package/dist/chunk-R7MGJCZN.mjs.br +0 -0
- package/dist/chunk-R7MGJCZN.mjs.gz +0 -0
- package/dist/chunk-SMECSYCT.js.br +0 -0
- package/dist/chunk-SMECSYCT.js.gz +0 -0
- package/dist/chunk-T4NHPN76.mjs.br +0 -0
- package/dist/chunk-T4NHPN76.mjs.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkHZSUTVDQ_js = require('./chunk-HZSUTVDQ.js');
|
|
4
4
|
var chunk3ISYPBSX_js = require('./chunk-3ISYPBSX.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkKA35ZMIP_js = require('./chunk-KA35ZMIP.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 = chunkKA35ZMIP_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 = chunkKA35ZMIP_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 ??= chunkKA35ZMIP_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 >= chunkKA35ZMIP_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
|
+
}, chunkKA35ZMIP_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 = chunkKA35ZMIP_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
|
+
chunkKA35ZMIP_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 = chunkKA35ZMIP_js.validateRoomId(config.roomId);
|
|
249
249
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
250
|
-
departureRef.current =
|
|
250
|
+
departureRef.current = chunkKA35ZMIP_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 = chunkKA35ZMIP_js.validateRoomId(config.roomId);
|
|
293
|
+
const transport = config.transport ?? chunkKA35ZMIP_js.resolveTransportForServerUrl(config.serverUrl);
|
|
294
294
|
if (transport === "webrtc") {
|
|
295
295
|
await initWebrtc();
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
if (
|
|
298
|
+
if (chunkKA35ZMIP_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 = chunkKA35ZMIP_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
|
+
chunkKA35ZMIP_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
|
+
}, chunkKA35ZMIP_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
|
+
chunkKA35ZMIP_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 = chunkKA35ZMIP_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 = chunkKA35ZMIP_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
418
418
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
419
419
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
420
420
|
awareness,
|
|
@@ -523,8 +523,8 @@ function useEditorHistory(input) {
|
|
|
523
523
|
width: canvasSize.width,
|
|
524
524
|
height: canvasSize.height,
|
|
525
525
|
activeSlideIndex,
|
|
526
|
-
slides: slides.map(
|
|
527
|
-
templateElementsBySlideId:
|
|
526
|
+
slides: slides.map(chunkKA35ZMIP_js.cloneSlide),
|
|
527
|
+
templateElementsBySlideId: chunkKA35ZMIP_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
528
528
|
...actionLabel ? { actionLabel } : {}
|
|
529
529
|
};
|
|
530
530
|
},
|
|
@@ -537,9 +537,9 @@ function useEditorHistory(input) {
|
|
|
537
537
|
width: snapshot.width,
|
|
538
538
|
height: snapshot.height
|
|
539
539
|
});
|
|
540
|
-
setSlides(snapshot.slides.map(
|
|
540
|
+
setSlides(snapshot.slides.map(chunkKA35ZMIP_js.cloneSlide));
|
|
541
541
|
setTemplateElementsBySlideId(
|
|
542
|
-
|
|
542
|
+
chunkKA35ZMIP_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
543
543
|
);
|
|
544
544
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
545
545
|
setSelectedElementIds([]);
|
|
@@ -573,8 +573,8 @@ function useEditorHistory(input) {
|
|
|
573
573
|
const currentSnapshot = buildHistorySnapshot();
|
|
574
574
|
historyFutureRef.current.push(currentSnapshot);
|
|
575
575
|
isApplyingHistoryRef.current = true;
|
|
576
|
-
const nextSnapshot =
|
|
577
|
-
lastHistorySnapshotRef.current =
|
|
576
|
+
const nextSnapshot = chunkHZSUTVDQ_js.cloneHistorySnapshot(previousSnapshot);
|
|
577
|
+
lastHistorySnapshotRef.current = chunkHZSUTVDQ_js.cloneHistorySnapshot(nextSnapshot);
|
|
578
578
|
lastHistorySerializedRef.current = JSON.stringify(nextSnapshot);
|
|
579
579
|
applyHistorySnapshot(nextSnapshot);
|
|
580
580
|
updateHistoryAvailability();
|
|
@@ -595,8 +595,8 @@ function useEditorHistory(input) {
|
|
|
595
595
|
const currentSnapshot = buildHistorySnapshot();
|
|
596
596
|
historyPastRef.current.push(currentSnapshot);
|
|
597
597
|
isApplyingHistoryRef.current = true;
|
|
598
|
-
const targetSnapshot =
|
|
599
|
-
lastHistorySnapshotRef.current =
|
|
598
|
+
const targetSnapshot = chunkHZSUTVDQ_js.cloneHistorySnapshot(nextSnapshot);
|
|
599
|
+
lastHistorySnapshotRef.current = chunkHZSUTVDQ_js.cloneHistorySnapshot(targetSnapshot);
|
|
600
600
|
lastHistorySerializedRef.current = JSON.stringify(targetSnapshot);
|
|
601
601
|
applyHistorySnapshot(targetSnapshot);
|
|
602
602
|
updateHistoryAvailability();
|
|
@@ -614,7 +614,7 @@ function useEditorHistory(input) {
|
|
|
614
614
|
historyPastRef.current = [];
|
|
615
615
|
historyFutureRef.current = [];
|
|
616
616
|
if (initialSnapshot) {
|
|
617
|
-
const clonedInitial =
|
|
617
|
+
const clonedInitial = chunkHZSUTVDQ_js.cloneHistorySnapshot(initialSnapshot);
|
|
618
618
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
619
619
|
lastHistorySerializedRef.current = JSON.stringify(clonedInitial);
|
|
620
620
|
} else {
|
|
@@ -655,18 +655,18 @@ function useEditorHistory(input) {
|
|
|
655
655
|
}
|
|
656
656
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
657
657
|
if (!previousSnapshot) {
|
|
658
|
-
lastHistorySnapshotRef.current =
|
|
658
|
+
lastHistorySnapshotRef.current = chunkHZSUTVDQ_js.cloneHistorySnapshot(snapshot);
|
|
659
659
|
lastHistorySerializedRef.current = serialized;
|
|
660
660
|
lastCheapHashRef.current = cheapHash;
|
|
661
661
|
updateHistoryAvailability();
|
|
662
662
|
return;
|
|
663
663
|
}
|
|
664
|
-
historyPastRef.current.push(
|
|
664
|
+
historyPastRef.current.push(chunkHZSUTVDQ_js.cloneHistorySnapshot(previousSnapshot));
|
|
665
665
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
666
666
|
historyPastRef.current.shift();
|
|
667
667
|
}
|
|
668
668
|
historyFutureRef.current = [];
|
|
669
|
-
lastHistorySnapshotRef.current =
|
|
669
|
+
lastHistorySnapshotRef.current = chunkHZSUTVDQ_js.cloneHistorySnapshot(snapshot);
|
|
670
670
|
lastHistorySerializedRef.current = serialized;
|
|
671
671
|
lastCheapHashRef.current = cheapHash;
|
|
672
672
|
updateHistoryAvailability();
|
|
@@ -727,7 +727,7 @@ function useZoomViewport({
|
|
|
727
727
|
const canvasViewportRef = react.useRef(null);
|
|
728
728
|
const renderScaleRef = react.useRef(1);
|
|
729
729
|
const storeRef = react.useRef(null);
|
|
730
|
-
storeRef.current ??=
|
|
730
|
+
storeRef.current ??= chunkKA35ZMIP_js.createViewerZoomStore();
|
|
731
731
|
const store = storeRef.current;
|
|
732
732
|
const scale = useViewerStore(store, selectZoom);
|
|
733
733
|
const setScale = react.useCallback(
|
|
@@ -788,7 +788,7 @@ function useZoomViewport({
|
|
|
788
788
|
if (!wrapper || !canvasViewport) {
|
|
789
789
|
return;
|
|
790
790
|
}
|
|
791
|
-
const boundedScale =
|
|
791
|
+
const boundedScale = chunkKA35ZMIP_js.clampZoomScale(nextScale);
|
|
792
792
|
const nextEditorScale = fitScale * boundedScale;
|
|
793
793
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
794
794
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -825,29 +825,29 @@ function useZoomViewport({
|
|
|
825
825
|
selectedElements.forEach((element) => {
|
|
826
826
|
minX = Math.min(minX, element.x);
|
|
827
827
|
minY = Math.min(minY, element.y);
|
|
828
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
829
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
828
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE));
|
|
829
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE));
|
|
830
830
|
});
|
|
831
831
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
832
832
|
return;
|
|
833
833
|
}
|
|
834
834
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
835
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
836
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
835
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE);
|
|
836
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE);
|
|
837
837
|
const availableWidth = Math.max(
|
|
838
|
-
effectiveEditorDimensions.width -
|
|
839
|
-
|
|
838
|
+
effectiveEditorDimensions.width - chunkHZSUTVDQ_js.ZOOM_TO_SELECTION_PADDING,
|
|
839
|
+
chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE
|
|
840
840
|
);
|
|
841
841
|
const availableHeight = Math.max(
|
|
842
|
-
effectiveEditorDimensions.height -
|
|
843
|
-
|
|
842
|
+
effectiveEditorDimensions.height - chunkHZSUTVDQ_js.ZOOM_TO_SELECTION_PADDING,
|
|
843
|
+
chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE
|
|
844
844
|
);
|
|
845
845
|
const targetEditorScale = Math.min(
|
|
846
846
|
availableWidth / boundsWidth,
|
|
847
847
|
availableHeight / boundsHeight
|
|
848
848
|
);
|
|
849
849
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
850
|
-
const nextScale =
|
|
850
|
+
const nextScale = chunkKA35ZMIP_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
851
851
|
setScale(nextScale);
|
|
852
852
|
window.requestAnimationFrame(() => {
|
|
853
853
|
window.requestAnimationFrame(() => {
|
|
@@ -871,7 +871,7 @@ function useZoomViewport({
|
|
|
871
871
|
const delta = event.deltaY * -1e-3;
|
|
872
872
|
store.dispatch({
|
|
873
873
|
type: "set-zoom",
|
|
874
|
-
zoom:
|
|
874
|
+
zoom: chunkKA35ZMIP_js.clampZoomScale(store.getState().zoom + delta)
|
|
875
875
|
});
|
|
876
876
|
},
|
|
877
877
|
[store]
|
|
@@ -951,7 +951,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
951
951
|
const command = step.command;
|
|
952
952
|
const timer = window.setTimeout(
|
|
953
953
|
() => {
|
|
954
|
-
|
|
954
|
+
chunkHZSUTVDQ_js.executeMediaCommand(command);
|
|
955
955
|
},
|
|
956
956
|
Math.max(0, step.delayMs)
|
|
957
957
|
);
|
|
@@ -1088,7 +1088,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1088
1088
|
}))
|
|
1089
1089
|
);
|
|
1090
1090
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1091
|
-
const delay =
|
|
1091
|
+
const delay = chunkKA35ZMIP_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1092
1092
|
const timer = window.setTimeout(() => {
|
|
1093
1093
|
setPresentationAnimations(
|
|
1094
1094
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1120,7 +1120,7 @@ function useAnimationPlayback(input) {
|
|
|
1120
1120
|
(controller, group) => {
|
|
1121
1121
|
driveBuildReveal(
|
|
1122
1122
|
controller,
|
|
1123
|
-
|
|
1123
|
+
chunkKA35ZMIP_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1124
1124
|
setPresentationElementStates,
|
|
1125
1125
|
buildRafRef
|
|
1126
1126
|
);
|
|
@@ -1183,7 +1183,7 @@ function useAnimationPlayback(input) {
|
|
|
1183
1183
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1184
1184
|
return;
|
|
1185
1185
|
}
|
|
1186
|
-
const controller =
|
|
1186
|
+
const controller = chunkKA35ZMIP_js.PresentationAnimationController.fromSlide(slide);
|
|
1187
1187
|
controllerRef.current = controller;
|
|
1188
1188
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1189
1189
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1341,12 +1341,12 @@ function useAnimationPlayback(input) {
|
|
|
1341
1341
|
presentationTimersRef
|
|
1342
1342
|
};
|
|
1343
1343
|
}
|
|
1344
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1345
|
-
var AUDIENCE_HASH =
|
|
1346
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1347
|
-
var AUDIENCE_NONCE_KEY =
|
|
1344
|
+
var PRESENTER_CHANNEL_NAME = chunkKA35ZMIP_js.PRESENTATION_CHANNEL_NAME;
|
|
1345
|
+
var AUDIENCE_HASH = chunkKA35ZMIP_js.PRESENTATION_HASH;
|
|
1346
|
+
var PRESENTER_MSG_ORIGIN = chunkKA35ZMIP_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1347
|
+
var AUDIENCE_NONCE_KEY = chunkKA35ZMIP_js.PRESENTATION_NONCE_KEY;
|
|
1348
1348
|
function generateSessionId() {
|
|
1349
|
-
return
|
|
1349
|
+
return chunkKA35ZMIP_js.createPresentationSessionId();
|
|
1350
1350
|
}
|
|
1351
1351
|
function parseAudienceNonce() {
|
|
1352
1352
|
const hash = window.location.hash;
|
|
@@ -1382,7 +1382,7 @@ function usePresenterWindow(input) {
|
|
|
1382
1382
|
}, []);
|
|
1383
1383
|
const swapDisplays = react.useCallback(async () => {
|
|
1384
1384
|
const audience = audienceWindowRef.current;
|
|
1385
|
-
return audience && !audience.closed ?
|
|
1385
|
+
return audience && !audience.closed ? chunkKA35ZMIP_js.swapPresentationWindows(window, audience) : false;
|
|
1386
1386
|
}, []);
|
|
1387
1387
|
const syncSlideToAudience = react.useCallback(
|
|
1388
1388
|
(slideIndex) => {
|
|
@@ -1446,7 +1446,7 @@ function usePresenterWindow(input) {
|
|
|
1446
1446
|
pollTimerRef.current = null;
|
|
1447
1447
|
}
|
|
1448
1448
|
if (closingSessionId) {
|
|
1449
|
-
void
|
|
1449
|
+
void chunkKA35ZMIP_js.clearAudienceContent(closingSessionId);
|
|
1450
1450
|
}
|
|
1451
1451
|
}, [getChannel]);
|
|
1452
1452
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1464,10 +1464,10 @@ function usePresenterWindow(input) {
|
|
|
1464
1464
|
audienceWindowRef.current = blankWin;
|
|
1465
1465
|
const sessionId = generateSessionId();
|
|
1466
1466
|
sessionIdRef.current = sessionId;
|
|
1467
|
-
const audienceUrl =
|
|
1468
|
-
void
|
|
1467
|
+
const audienceUrl = chunkKA35ZMIP_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1468
|
+
void chunkKA35ZMIP_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1469
1469
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1470
|
-
|
|
1470
|
+
chunkKA35ZMIP_js.placeAudienceWindow(blankWin, placement);
|
|
1471
1471
|
}
|
|
1472
1472
|
return void 0;
|
|
1473
1473
|
});
|
|
@@ -1497,7 +1497,7 @@ function usePresenterWindow(input) {
|
|
|
1497
1497
|
}
|
|
1498
1498
|
};
|
|
1499
1499
|
if (content) {
|
|
1500
|
-
void
|
|
1500
|
+
void chunkKA35ZMIP_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1501
1501
|
} else {
|
|
1502
1502
|
navigateOrClose(true);
|
|
1503
1503
|
}
|
|
@@ -1523,7 +1523,7 @@ function usePresenterWindow(input) {
|
|
|
1523
1523
|
}
|
|
1524
1524
|
const handleMessage = (event) => {
|
|
1525
1525
|
const message = event.data;
|
|
1526
|
-
if (
|
|
1526
|
+
if (chunkKA35ZMIP_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1527
1527
|
syncStateToAudience(snapshotRef.current);
|
|
1528
1528
|
}
|
|
1529
1529
|
};
|
|
@@ -1552,7 +1552,7 @@ function usePresenterWindow(input) {
|
|
|
1552
1552
|
react.useEffect(() => {
|
|
1553
1553
|
const handleBeforeUnload = () => {
|
|
1554
1554
|
if (sessionIdRef.current) {
|
|
1555
|
-
void
|
|
1555
|
+
void chunkKA35ZMIP_js.clearAudienceContent(sessionIdRef.current);
|
|
1556
1556
|
}
|
|
1557
1557
|
};
|
|
1558
1558
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1614,7 +1614,7 @@ function useAudienceMode(input) {
|
|
|
1614
1614
|
}
|
|
1615
1615
|
channel.onmessage = (event) => {
|
|
1616
1616
|
const data = event.data;
|
|
1617
|
-
if (!
|
|
1617
|
+
if (!chunkKA35ZMIP_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1618
1618
|
return;
|
|
1619
1619
|
}
|
|
1620
1620
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1630,16 +1630,16 @@ function useAudienceMode(input) {
|
|
|
1630
1630
|
}
|
|
1631
1631
|
if (data.type === "presenter-exit") {
|
|
1632
1632
|
if (expectedSessionId) {
|
|
1633
|
-
void
|
|
1633
|
+
void chunkKA35ZMIP_js.clearAudienceContent(expectedSessionId);
|
|
1634
1634
|
}
|
|
1635
|
-
if (
|
|
1635
|
+
if (chunkKA35ZMIP_js.endAudienceDisplay(window)) {
|
|
1636
1636
|
handlers.onPresenterEnded?.();
|
|
1637
1637
|
}
|
|
1638
1638
|
}
|
|
1639
1639
|
};
|
|
1640
1640
|
if (expectedSessionId) {
|
|
1641
1641
|
channel.postMessage({
|
|
1642
|
-
origin:
|
|
1642
|
+
origin: chunkKA35ZMIP_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1643
1643
|
type: "audience-ready",
|
|
1644
1644
|
sessionId: expectedSessionId
|
|
1645
1645
|
});
|
|
@@ -1672,14 +1672,14 @@ function usePresentationKeyboard(input) {
|
|
|
1672
1672
|
presentationSlideIndex,
|
|
1673
1673
|
setShowRehearsalSummary
|
|
1674
1674
|
} = input;
|
|
1675
|
-
const keyBufferRef = react.useRef(
|
|
1675
|
+
const keyBufferRef = react.useRef(chunkKA35ZMIP_js.createPresentationKeyBuffer());
|
|
1676
1676
|
react.useEffect(() => {
|
|
1677
|
-
if (mode !== "present" || !
|
|
1678
|
-
keyBufferRef.current =
|
|
1677
|
+
if (mode !== "present" || !chunkKA35ZMIP_js.acceptsPresentationInput()) {
|
|
1678
|
+
keyBufferRef.current = chunkKA35ZMIP_js.createPresentationKeyBuffer();
|
|
1679
1679
|
return;
|
|
1680
1680
|
}
|
|
1681
1681
|
const handleKeyDown = (event) => {
|
|
1682
|
-
const mapped =
|
|
1682
|
+
const mapped = chunkKA35ZMIP_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1683
1683
|
if (mapped.action === "none") {
|
|
1684
1684
|
return;
|
|
1685
1685
|
}
|
|
@@ -1699,12 +1699,12 @@ function usePresentationKeyboard(input) {
|
|
|
1699
1699
|
movePresentationSlide(-1);
|
|
1700
1700
|
return;
|
|
1701
1701
|
case "first": {
|
|
1702
|
-
const first =
|
|
1702
|
+
const first = chunkKA35ZMIP_js.firstShowSlideIndex(showSlideIndexes);
|
|
1703
1703
|
navigateToSlide(first ?? 0);
|
|
1704
1704
|
return;
|
|
1705
1705
|
}
|
|
1706
1706
|
case "last": {
|
|
1707
|
-
const last =
|
|
1707
|
+
const last = chunkKA35ZMIP_js.lastShowSlideIndex(showSlideIndexes);
|
|
1708
1708
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1709
1709
|
return;
|
|
1710
1710
|
}
|
|
@@ -1859,7 +1859,7 @@ function useRehearsalTimings(input) {
|
|
|
1859
1859
|
|
|
1860
1860
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1861
1861
|
function handlePresentationActionImpl(action, deps) {
|
|
1862
|
-
|
|
1862
|
+
chunkKA35ZMIP_js.runPresentationAction(
|
|
1863
1863
|
action,
|
|
1864
1864
|
{ slideCount: deps.slidesLength },
|
|
1865
1865
|
{
|
|
@@ -1881,7 +1881,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1881
1881
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1882
1882
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1883
1883
|
const transition = incomingSlide?.transition;
|
|
1884
|
-
const durationMs = deps.playTransition ?
|
|
1884
|
+
const durationMs = deps.playTransition ? chunkKA35ZMIP_js.resolveTransitionDurationMs(transition) : 0;
|
|
1885
1885
|
deps.clearPresentationTimers();
|
|
1886
1886
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1887
1887
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1940,7 +1940,7 @@ function useSlideNavigation(input) {
|
|
|
1940
1940
|
});
|
|
1941
1941
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1942
1942
|
(slideIndex) => {
|
|
1943
|
-
const delayMs =
|
|
1943
|
+
const delayMs = chunkKA35ZMIP_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1944
1944
|
if (delayMs === void 0) {
|
|
1945
1945
|
return;
|
|
1946
1946
|
}
|
|
@@ -1963,7 +1963,7 @@ function useSlideNavigation(input) {
|
|
|
1963
1963
|
if (availableSlideIndexes.length === 0) {
|
|
1964
1964
|
return;
|
|
1965
1965
|
}
|
|
1966
|
-
const pastLastSlide = direction === 1 && !
|
|
1966
|
+
const pastLastSlide = direction === 1 && !chunkKA35ZMIP_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1967
1967
|
if (rehearsing && pastLastSlide) {
|
|
1968
1968
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1969
1969
|
try {
|
|
@@ -1981,9 +1981,9 @@ function useSlideNavigation(input) {
|
|
|
1981
1981
|
onAdvancePastLastSlide();
|
|
1982
1982
|
return;
|
|
1983
1983
|
}
|
|
1984
|
-
const nextSlideIndex = direction === 1 ?
|
|
1984
|
+
const nextSlideIndex = direction === 1 ? chunkKA35ZMIP_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1985
1985
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
1986
|
-
}) :
|
|
1986
|
+
}) : chunkKA35ZMIP_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
1987
1987
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
1988
1988
|
return;
|
|
1989
1989
|
}
|
|
@@ -2128,22 +2128,22 @@ function useZoomNavigation(input) {
|
|
|
2128
2128
|
};
|
|
2129
2129
|
}
|
|
2130
2130
|
function usePresenterConsole(slideIndex, active) {
|
|
2131
|
-
const timerRef = react.useRef(
|
|
2132
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2131
|
+
const timerRef = react.useRef(chunkKA35ZMIP_js.createPresenterTimer());
|
|
2132
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkKA35ZMIP_js.createInitialPresentationSnapshot(slideIndex));
|
|
2133
2133
|
const patch = react.useCallback((value) => {
|
|
2134
|
-
setSnapshot((current) =>
|
|
2134
|
+
setSnapshot((current) => chunkKA35ZMIP_js.mergePresentationSnapshot(current, value));
|
|
2135
2135
|
}, []);
|
|
2136
2136
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2137
2137
|
react.useEffect(() => {
|
|
2138
2138
|
if (!active) {
|
|
2139
2139
|
return;
|
|
2140
2140
|
}
|
|
2141
|
-
timerRef.current =
|
|
2141
|
+
timerRef.current = chunkKA35ZMIP_js.resetPresenterTimer();
|
|
2142
2142
|
patch({ paused: false, elapsedMs: 0 });
|
|
2143
2143
|
const timer = window.setInterval(() => {
|
|
2144
2144
|
patch({
|
|
2145
2145
|
paused: timerRef.current.paused,
|
|
2146
|
-
elapsedMs:
|
|
2146
|
+
elapsedMs: chunkKA35ZMIP_js.presenterElapsed(timerRef.current)
|
|
2147
2147
|
});
|
|
2148
2148
|
}, 1e3);
|
|
2149
2149
|
return () => window.clearInterval(timer);
|
|
@@ -2153,19 +2153,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2153
2153
|
applyAudienceSnapshot: setSnapshot,
|
|
2154
2154
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2155
2155
|
toggleTimer: () => {
|
|
2156
|
-
timerRef.current =
|
|
2156
|
+
timerRef.current = chunkKA35ZMIP_js.togglePresenterTimer(timerRef.current);
|
|
2157
2157
|
patch({
|
|
2158
2158
|
paused: timerRef.current.paused,
|
|
2159
|
-
elapsedMs:
|
|
2159
|
+
elapsedMs: chunkKA35ZMIP_js.presenterElapsed(timerRef.current)
|
|
2160
2160
|
});
|
|
2161
2161
|
},
|
|
2162
2162
|
resetTimer: () => {
|
|
2163
|
-
timerRef.current =
|
|
2163
|
+
timerRef.current = chunkKA35ZMIP_js.resetPresenterTimer();
|
|
2164
2164
|
patch({ paused: false, elapsedMs: 0 });
|
|
2165
2165
|
},
|
|
2166
2166
|
stepZoom: (direction) => setSnapshot(
|
|
2167
|
-
(current) =>
|
|
2168
|
-
zoom:
|
|
2167
|
+
(current) => chunkKA35ZMIP_js.mergePresentationSnapshot(current, {
|
|
2168
|
+
zoom: chunkKA35ZMIP_js.stepPresenterZoom(
|
|
2169
2169
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2170
2170
|
direction
|
|
2171
2171
|
)
|
|
@@ -2210,7 +2210,7 @@ function usePresentationMode(input) {
|
|
|
2210
2210
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2211
2211
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2212
2212
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2213
|
-
const showGuard = react.useMemo(() =>
|
|
2213
|
+
const showGuard = react.useMemo(() => chunkKA35ZMIP_js.createPresenterShowGuard(), []);
|
|
2214
2214
|
const {
|
|
2215
2215
|
presentationAnimations,
|
|
2216
2216
|
presentationElementStates,
|
|
@@ -2289,7 +2289,7 @@ function usePresentationMode(input) {
|
|
|
2289
2289
|
});
|
|
2290
2290
|
const movePresentationSlide = react.useCallback(
|
|
2291
2291
|
(direction, trigger = "explicit") => {
|
|
2292
|
-
if (!
|
|
2292
|
+
if (!chunkKA35ZMIP_js.acceptsPresentationInput()) {
|
|
2293
2293
|
return;
|
|
2294
2294
|
}
|
|
2295
2295
|
if (endOfShowVisible) {
|
|
@@ -2426,7 +2426,7 @@ function usePresentationMode(input) {
|
|
|
2426
2426
|
if (mode !== "present") {
|
|
2427
2427
|
return;
|
|
2428
2428
|
}
|
|
2429
|
-
return
|
|
2429
|
+
return chunkKA35ZMIP_js.attachPresentationVisibilityPause({
|
|
2430
2430
|
root: containerRef.current ?? void 0,
|
|
2431
2431
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2432
2432
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2506,11 +2506,11 @@ function usePresentationMode(input) {
|
|
|
2506
2506
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2507
2507
|
return void 0;
|
|
2508
2508
|
}
|
|
2509
|
-
return
|
|
2509
|
+
return chunkKA35ZMIP_js.buildMorphTransitionPlan(
|
|
2510
2510
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2511
2511
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2512
2512
|
transitionOverlay.durationMs,
|
|
2513
|
-
|
|
2513
|
+
chunkKA35ZMIP_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2514
2514
|
);
|
|
2515
2515
|
}, [transitionOverlay, slides]);
|
|
2516
2516
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2816,7 +2816,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2816
2816
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2817
2817
|
slides.forEach((slide, slideIndex) => {
|
|
2818
2818
|
for (const element of slide.elements || []) {
|
|
2819
|
-
if (!
|
|
2819
|
+
if (!chunkKA35ZMIP_js.hasTextProperties(element)) {
|
|
2820
2820
|
continue;
|
|
2821
2821
|
}
|
|
2822
2822
|
const segments = element.textSegments ?? [];
|
|
@@ -2867,7 +2867,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2867
2867
|
continue;
|
|
2868
2868
|
}
|
|
2869
2869
|
const element = slide.elements[elIdx];
|
|
2870
|
-
if (!
|
|
2870
|
+
if (!chunkKA35ZMIP_js.hasTextProperties(element)) {
|
|
2871
2871
|
continue;
|
|
2872
2872
|
}
|
|
2873
2873
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3465,7 +3465,7 @@ function useViewerCoreState(_input) {
|
|
|
3465
3465
|
const shapeAdjustmentDragStateRef = react.useRef(null);
|
|
3466
3466
|
const marqueeStateRef = react.useRef(null);
|
|
3467
3467
|
const isDrawingRef = react.useRef(false);
|
|
3468
|
-
const livePatcher = react.useMemo(() =>
|
|
3468
|
+
const livePatcher = react.useMemo(() => chunkKA35ZMIP_js.createCollaborationLivePatcher(), []);
|
|
3469
3469
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3470
3470
|
const slidesRef = react.useRef([]);
|
|
3471
3471
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3474,8 +3474,8 @@ function useViewerCoreState(_input) {
|
|
|
3474
3474
|
const [slides, setSlides] = react.useState([]);
|
|
3475
3475
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3476
3476
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3477
|
-
width:
|
|
3478
|
-
height:
|
|
3477
|
+
width: chunkHZSUTVDQ_js.DEFAULT_CANVAS_WIDTH,
|
|
3478
|
+
height: chunkHZSUTVDQ_js.DEFAULT_CANVAS_HEIGHT
|
|
3479
3479
|
});
|
|
3480
3480
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
3481
3481
|
const [selectedElementId, setSelectedElementId] = react.useState(null);
|
|
@@ -3495,7 +3495,7 @@ function useViewerCoreState(_input) {
|
|
|
3495
3495
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3496
3496
|
inlineEditingTextRef.current = resolved;
|
|
3497
3497
|
setInlineEditingTextBase(value);
|
|
3498
|
-
|
|
3498
|
+
chunkKA35ZMIP_js.publishLiveInlineText(
|
|
3499
3499
|
livePatcher,
|
|
3500
3500
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3501
3501
|
inlineEditingElementIdRef.current,
|
|
@@ -3829,7 +3829,7 @@ function useLoadContent({
|
|
|
3829
3829
|
);
|
|
3830
3830
|
}
|
|
3831
3831
|
const previousHandler = handlerRef.current;
|
|
3832
|
-
const handler = new
|
|
3832
|
+
const handler = new chunkKA35ZMIP_js.PptxHandler();
|
|
3833
3833
|
const parsed = await handler.load(buffer);
|
|
3834
3834
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3835
3835
|
handler.dispose();
|
|
@@ -3841,7 +3841,7 @@ function useLoadContent({
|
|
|
3841
3841
|
handlerRef.current = null;
|
|
3842
3842
|
const mediaElements = [];
|
|
3843
3843
|
for (const slide of parsed.slides) {
|
|
3844
|
-
|
|
3844
|
+
chunkKA35ZMIP_js.collectMediaElements(slide.elements, mediaElements);
|
|
3845
3845
|
}
|
|
3846
3846
|
for (const url of mediaDataUrls.values()) {
|
|
3847
3847
|
if (url.startsWith("blob:")) {
|
|
@@ -3882,7 +3882,7 @@ function useLoadContent({
|
|
|
3882
3882
|
}
|
|
3883
3883
|
})
|
|
3884
3884
|
);
|
|
3885
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3885
|
+
const { paths: imagePaths, refs: imageRefs } = chunkKA35ZMIP_js.collectImagePaths(parsed.slides);
|
|
3886
3886
|
let nextSlides = parsed.slides;
|
|
3887
3887
|
if (imagePaths.size > 0) {
|
|
3888
3888
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3937,12 +3937,12 @@ function useLoadContent({
|
|
|
3937
3937
|
}
|
|
3938
3938
|
}
|
|
3939
3939
|
handlerRef.current = handler;
|
|
3940
|
-
const partition =
|
|
3940
|
+
const partition = chunkHZSUTVDQ_js.partitionTemplateElements(nextSlides);
|
|
3941
3941
|
setSlides(partition.slides);
|
|
3942
3942
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3943
3943
|
setCanvasSize({
|
|
3944
|
-
width: parsed.width ??
|
|
3945
|
-
height: parsed.height ??
|
|
3944
|
+
width: parsed.width ?? chunkHZSUTVDQ_js.DEFAULT_CANVAS_WIDTH,
|
|
3945
|
+
height: parsed.height ?? chunkHZSUTVDQ_js.DEFAULT_CANVAS_HEIGHT
|
|
3946
3946
|
});
|
|
3947
3947
|
setHeaderFooter(parsed.headerFooter ?? {});
|
|
3948
3948
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
@@ -3971,7 +3971,7 @@ function useLoadContent({
|
|
|
3971
3971
|
setHasMacros(parsed.hasMacros === true);
|
|
3972
3972
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3973
3973
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3974
|
-
setGuides(
|
|
3974
|
+
setGuides(chunkKA35ZMIP_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3975
3975
|
setActiveSlideIndex(0);
|
|
3976
3976
|
clearSelection();
|
|
3977
3977
|
setIsDirty(false);
|
|
@@ -3979,7 +3979,7 @@ function useLoadContent({
|
|
|
3979
3979
|
onContentApplied?.();
|
|
3980
3980
|
} catch (err) {
|
|
3981
3981
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3982
|
-
if (err instanceof
|
|
3982
|
+
if (err instanceof chunkKA35ZMIP_js.EncryptedFileError) {
|
|
3983
3983
|
setIsEncrypted(true);
|
|
3984
3984
|
} else {
|
|
3985
3985
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -4056,7 +4056,7 @@ function useAutosave(input) {
|
|
|
4056
4056
|
isSavingRef.current = false;
|
|
4057
4057
|
return;
|
|
4058
4058
|
}
|
|
4059
|
-
await
|
|
4059
|
+
await chunkKA35ZMIP_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
4060
4060
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4061
4061
|
} catch (err) {
|
|
4062
4062
|
setAutosaveStatus({
|
|
@@ -4121,7 +4121,7 @@ function useElementOperations(input) {
|
|
|
4121
4121
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
4122
4122
|
const updateElementById = react.useCallback(
|
|
4123
4123
|
(elementId, updates) => {
|
|
4124
|
-
if (
|
|
4124
|
+
if (chunkKA35ZMIP_js.isTemplateElementId(elementId)) {
|
|
4125
4125
|
const slideId = activeSlide?.id;
|
|
4126
4126
|
if (slideId) {
|
|
4127
4127
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4161,7 +4161,7 @@ function useElementOperations(input) {
|
|
|
4161
4161
|
);
|
|
4162
4162
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4163
4163
|
(updates) => {
|
|
4164
|
-
if (!selectedElement || !
|
|
4164
|
+
if (!selectedElement || !chunkKA35ZMIP_js.hasShapeProperties(selectedElement)) {
|
|
4165
4165
|
return;
|
|
4166
4166
|
}
|
|
4167
4167
|
updateSelectedElement({
|
|
@@ -4172,17 +4172,17 @@ function useElementOperations(input) {
|
|
|
4172
4172
|
);
|
|
4173
4173
|
const updateSelectedTextStyle = react.useCallback(
|
|
4174
4174
|
(updates) => {
|
|
4175
|
-
if (!selectedElement || !
|
|
4175
|
+
if (!selectedElement || !chunkKA35ZMIP_js.hasTextProperties(selectedElement)) {
|
|
4176
4176
|
return;
|
|
4177
4177
|
}
|
|
4178
|
-
const inlineSel =
|
|
4178
|
+
const inlineSel = chunkKA35ZMIP_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4179
4179
|
if (inlineSel && selectedElement.textSegments) {
|
|
4180
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4180
|
+
const { newSegments: newSegments2, newSelection } = chunkKA35ZMIP_js.applyStyleToSelectedSegments(
|
|
4181
4181
|
selectedElement.textSegments,
|
|
4182
4182
|
inlineSel,
|
|
4183
4183
|
updates
|
|
4184
4184
|
);
|
|
4185
|
-
|
|
4185
|
+
chunkKA35ZMIP_js.setPendingSelectionRestore(newSelection);
|
|
4186
4186
|
updateSelectedElement({
|
|
4187
4187
|
textSegments: newSegments2
|
|
4188
4188
|
});
|
|
@@ -4202,12 +4202,12 @@ function useElementOperations(input) {
|
|
|
4202
4202
|
);
|
|
4203
4203
|
const updateSelectedTextCase = react.useCallback(
|
|
4204
4204
|
(mode) => {
|
|
4205
|
-
if (!selectedElement || !
|
|
4205
|
+
if (!selectedElement || !chunkKA35ZMIP_js.hasTextProperties(selectedElement)) {
|
|
4206
4206
|
return;
|
|
4207
4207
|
}
|
|
4208
|
-
const inlineSel =
|
|
4208
|
+
const inlineSel = chunkKA35ZMIP_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4209
4209
|
if (inlineSel && selectedElement.textSegments) {
|
|
4210
|
-
const newSegments =
|
|
4210
|
+
const newSegments = chunkKA35ZMIP_js.applyCaseTransformToSegments(
|
|
4211
4211
|
selectedElement.textSegments,
|
|
4212
4212
|
inlineSel,
|
|
4213
4213
|
mode
|
|
@@ -4217,14 +4217,14 @@ function useElementOperations(input) {
|
|
|
4217
4217
|
}
|
|
4218
4218
|
const updates = {};
|
|
4219
4219
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4220
|
-
updates.textSegments =
|
|
4220
|
+
updates.textSegments = chunkKA35ZMIP_js.applyCaseTransformToSegments(
|
|
4221
4221
|
selectedElement.textSegments,
|
|
4222
4222
|
null,
|
|
4223
4223
|
mode
|
|
4224
4224
|
);
|
|
4225
4225
|
}
|
|
4226
4226
|
if (typeof selectedElement.text === "string") {
|
|
4227
|
-
updates.text =
|
|
4227
|
+
updates.text = chunkKA35ZMIP_js.transformTextCase(selectedElement.text, mode);
|
|
4228
4228
|
}
|
|
4229
4229
|
updateSelectedElement(updates);
|
|
4230
4230
|
},
|
|
@@ -4279,7 +4279,7 @@ function useSectionOperations(input) {
|
|
|
4279
4279
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4280
4280
|
const addSection2 = react.useCallback(
|
|
4281
4281
|
(name, afterSlideIndex) => {
|
|
4282
|
-
const result =
|
|
4282
|
+
const result = chunkKA35ZMIP_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4283
4283
|
setSlides(result.slides);
|
|
4284
4284
|
setSections(result.sections);
|
|
4285
4285
|
markDirty();
|
|
@@ -4288,7 +4288,7 @@ function useSectionOperations(input) {
|
|
|
4288
4288
|
);
|
|
4289
4289
|
const renameSection2 = react.useCallback(
|
|
4290
4290
|
(sectionId, newName) => {
|
|
4291
|
-
const result =
|
|
4291
|
+
const result = chunkKA35ZMIP_js.renameSection(sections, slides, sectionId, newName);
|
|
4292
4292
|
setSections(result.sections);
|
|
4293
4293
|
setSlides(result.slides);
|
|
4294
4294
|
markDirty();
|
|
@@ -4297,7 +4297,7 @@ function useSectionOperations(input) {
|
|
|
4297
4297
|
);
|
|
4298
4298
|
const deleteSection2 = react.useCallback(
|
|
4299
4299
|
(sectionId) => {
|
|
4300
|
-
const result =
|
|
4300
|
+
const result = chunkKA35ZMIP_js.deleteSection(sections, slides, sectionId);
|
|
4301
4301
|
setSections(result.sections);
|
|
4302
4302
|
setSlides(result.slides);
|
|
4303
4303
|
markDirty();
|
|
@@ -4306,21 +4306,21 @@ function useSectionOperations(input) {
|
|
|
4306
4306
|
);
|
|
4307
4307
|
const moveSectionUp2 = react.useCallback(
|
|
4308
4308
|
(sectionId) => {
|
|
4309
|
-
setSections(
|
|
4309
|
+
setSections(chunkKA35ZMIP_js.moveSectionUp(sections, sectionId));
|
|
4310
4310
|
markDirty();
|
|
4311
4311
|
},
|
|
4312
4312
|
[sections, setSections, markDirty]
|
|
4313
4313
|
);
|
|
4314
4314
|
const moveSectionDown2 = react.useCallback(
|
|
4315
4315
|
(sectionId) => {
|
|
4316
|
-
setSections(
|
|
4316
|
+
setSections(chunkKA35ZMIP_js.moveSectionDown(sections, sectionId));
|
|
4317
4317
|
markDirty();
|
|
4318
4318
|
},
|
|
4319
4319
|
[sections, setSections, markDirty]
|
|
4320
4320
|
);
|
|
4321
4321
|
const moveSlidesToSection2 = react.useCallback(
|
|
4322
4322
|
(slideIndexes, targetSectionId) => {
|
|
4323
|
-
const result =
|
|
4323
|
+
const result = chunkKA35ZMIP_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4324
4324
|
setSlides(result.slides);
|
|
4325
4325
|
setSections(result.sections);
|
|
4326
4326
|
markDirty();
|
|
@@ -4339,19 +4339,19 @@ function useSectionOperations(input) {
|
|
|
4339
4339
|
|
|
4340
4340
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4341
4341
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4342
|
-
const resized =
|
|
4342
|
+
const resized = chunkKA35ZMIP_js.applyResize(
|
|
4343
4343
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4344
4344
|
handle,
|
|
4345
4345
|
dx,
|
|
4346
4346
|
dy,
|
|
4347
4347
|
1,
|
|
4348
|
-
{ minSize:
|
|
4348
|
+
{ minSize: chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE }
|
|
4349
4349
|
);
|
|
4350
4350
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4351
4351
|
if (!snapToGrid) {
|
|
4352
4352
|
return box;
|
|
4353
4353
|
}
|
|
4354
|
-
return
|
|
4354
|
+
return chunkKA35ZMIP_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE);
|
|
4355
4355
|
}
|
|
4356
4356
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
4357
4357
|
const range = startWidth || 200;
|
|
@@ -4469,7 +4469,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4469
4469
|
width: el.width,
|
|
4470
4470
|
height: el.height
|
|
4471
4471
|
}));
|
|
4472
|
-
const snapResult =
|
|
4472
|
+
const snapResult = chunkKA35ZMIP_js.computeSnapToShape(
|
|
4473
4473
|
targetX,
|
|
4474
4474
|
targetY,
|
|
4475
4475
|
primaryEl.width,
|
|
@@ -4508,7 +4508,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4508
4508
|
if (live) {
|
|
4509
4509
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4510
4510
|
const start = drag.startPositionsById[id];
|
|
4511
|
-
|
|
4511
|
+
chunkKA35ZMIP_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4512
4512
|
x: start.x + appliedDx,
|
|
4513
4513
|
y: start.y + appliedDy
|
|
4514
4514
|
});
|
|
@@ -4542,15 +4542,15 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4542
4542
|
if (rs.domEl) {
|
|
4543
4543
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4544
4544
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4545
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4546
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4545
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE)}px`;
|
|
4546
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE)}px`;
|
|
4547
4547
|
}
|
|
4548
4548
|
if (live) {
|
|
4549
|
-
|
|
4549
|
+
chunkKA35ZMIP_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4550
4550
|
x: geo.x,
|
|
4551
4551
|
y: geo.y,
|
|
4552
|
-
width: Math.max(geo.width,
|
|
4553
|
-
height: Math.max(geo.height,
|
|
4552
|
+
width: Math.max(geo.width, chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE),
|
|
4553
|
+
height: Math.max(geo.height, chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE)
|
|
4554
4554
|
});
|
|
4555
4555
|
}
|
|
4556
4556
|
}
|
|
@@ -4630,13 +4630,13 @@ function processPointerUp(input) {
|
|
|
4630
4630
|
if (i !== activeSlideIndex) {
|
|
4631
4631
|
return s;
|
|
4632
4632
|
}
|
|
4633
|
-
const rerouted =
|
|
4633
|
+
const rerouted = chunkKA35ZMIP_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4634
4634
|
if (rerouted.length === 0) {
|
|
4635
4635
|
return s;
|
|
4636
4636
|
}
|
|
4637
4637
|
return {
|
|
4638
4638
|
...s,
|
|
4639
|
-
elements:
|
|
4639
|
+
elements: chunkKA35ZMIP_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4640
4640
|
};
|
|
4641
4641
|
})
|
|
4642
4642
|
);
|
|
@@ -4658,9 +4658,9 @@ function processPointerUp(input) {
|
|
|
4658
4658
|
}
|
|
4659
4659
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4660
4660
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4661
|
-
const hitIds =
|
|
4661
|
+
const hitIds = chunkKA35ZMIP_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4662
4662
|
if (marquee.additive) {
|
|
4663
|
-
const merged =
|
|
4663
|
+
const merged = chunkKA35ZMIP_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4664
4664
|
if (merged.length > 0) {
|
|
4665
4665
|
applySelection(merged[0], merged);
|
|
4666
4666
|
} else {
|
|
@@ -4683,8 +4683,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4683
4683
|
}
|
|
4684
4684
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4685
4685
|
});
|
|
4686
|
-
const rerouted =
|
|
4687
|
-
return
|
|
4686
|
+
const rerouted = chunkKA35ZMIP_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4687
|
+
return chunkKA35ZMIP_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4688
4688
|
};
|
|
4689
4689
|
if (editTemplateMode) {
|
|
4690
4690
|
const slideId = activeSlide?.id;
|
|
@@ -4840,9 +4840,9 @@ function useCanvasInteractions(input) {
|
|
|
4840
4840
|
return;
|
|
4841
4841
|
}
|
|
4842
4842
|
const el = elementLookup.get(editId);
|
|
4843
|
-
if (el &&
|
|
4843
|
+
if (el && chunkKA35ZMIP_js.hasTextProperties(el)) {
|
|
4844
4844
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4845
|
-
const newSegments =
|
|
4845
|
+
const newSegments = chunkKA35ZMIP_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4846
4846
|
ops.updateElementById(editId, {
|
|
4847
4847
|
text: committedText,
|
|
4848
4848
|
textSegments: newSegments
|
|
@@ -4853,7 +4853,7 @@ function useCanvasInteractions(input) {
|
|
|
4853
4853
|
setInlineEditingText("");
|
|
4854
4854
|
};
|
|
4855
4855
|
const openEquationEditorForElement = (el) => {
|
|
4856
|
-
if (!
|
|
4856
|
+
if (!chunkKA35ZMIP_js.hasTextProperties(el)) {
|
|
4857
4857
|
return false;
|
|
4858
4858
|
}
|
|
4859
4859
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4882,7 +4882,7 @@ function useCanvasInteractions(input) {
|
|
|
4882
4882
|
justSelectedRef.current = false;
|
|
4883
4883
|
} else {
|
|
4884
4884
|
const el = elementLookup.get(elementId);
|
|
4885
|
-
if (el &&
|
|
4885
|
+
if (el && chunkKA35ZMIP_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
4886
4886
|
if (!openEquationEditorForElement(el)) {
|
|
4887
4887
|
setInlineEditingElementId(elementId);
|
|
4888
4888
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4901,7 +4901,7 @@ function useCanvasInteractions(input) {
|
|
|
4901
4901
|
if (openEquationEditorForElement(el)) {
|
|
4902
4902
|
return;
|
|
4903
4903
|
}
|
|
4904
|
-
if (
|
|
4904
|
+
if (chunkKA35ZMIP_js.hasTextProperties(el)) {
|
|
4905
4905
|
setInlineEditingElementId(elementId);
|
|
4906
4906
|
setInlineEditingText(el.text ?? "");
|
|
4907
4907
|
}
|
|
@@ -5094,7 +5094,7 @@ function createFileHandlers(deps) {
|
|
|
5094
5094
|
h = Math.round(h * scale);
|
|
5095
5095
|
}
|
|
5096
5096
|
addElement({
|
|
5097
|
-
id:
|
|
5097
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5098
5098
|
type: "image",
|
|
5099
5099
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5100
5100
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5105,7 +5105,7 @@ function createFileHandlers(deps) {
|
|
|
5105
5105
|
};
|
|
5106
5106
|
img.onerror = () => {
|
|
5107
5107
|
addElement({
|
|
5108
|
-
id:
|
|
5108
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5109
5109
|
type: "image",
|
|
5110
5110
|
x: 100,
|
|
5111
5111
|
y: 100,
|
|
@@ -5131,7 +5131,7 @@ function createFileHandlers(deps) {
|
|
|
5131
5131
|
const elFilePath = file.path;
|
|
5132
5132
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5133
5133
|
addElement({
|
|
5134
|
-
id:
|
|
5134
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5135
5135
|
type: "media",
|
|
5136
5136
|
mediaType,
|
|
5137
5137
|
mediaMimeType: file.type || void 0,
|
|
@@ -5306,13 +5306,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5306
5306
|
return;
|
|
5307
5307
|
}
|
|
5308
5308
|
addElement({
|
|
5309
|
-
id:
|
|
5309
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5310
5310
|
type: "smartArt",
|
|
5311
5311
|
x: 100,
|
|
5312
5312
|
y: 120,
|
|
5313
5313
|
width: 600,
|
|
5314
5314
|
height: 340,
|
|
5315
|
-
smartArtData:
|
|
5315
|
+
smartArtData: chunkKA35ZMIP_js.buildSmartArtPresetData(
|
|
5316
5316
|
layout,
|
|
5317
5317
|
defaultItems,
|
|
5318
5318
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5324,7 +5324,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5324
5324
|
return;
|
|
5325
5325
|
}
|
|
5326
5326
|
addElement({
|
|
5327
|
-
id:
|
|
5327
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5328
5328
|
type: "shape",
|
|
5329
5329
|
x: 120,
|
|
5330
5330
|
y: 200,
|
|
@@ -5383,7 +5383,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5383
5383
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5384
5384
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5385
5385
|
addElement({
|
|
5386
|
-
id:
|
|
5386
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5387
5387
|
type: "shape",
|
|
5388
5388
|
x: 120,
|
|
5389
5389
|
y: 200,
|
|
@@ -5405,11 +5405,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5405
5405
|
if (!activeSlide) {
|
|
5406
5406
|
return;
|
|
5407
5407
|
}
|
|
5408
|
-
const preset =
|
|
5408
|
+
const preset = chunkKA35ZMIP_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5409
5409
|
if (!preset) {
|
|
5410
5410
|
return;
|
|
5411
5411
|
}
|
|
5412
|
-
const defaultPptxAction =
|
|
5412
|
+
const defaultPptxAction = chunkKA35ZMIP_js.elementActionToPptxAction({
|
|
5413
5413
|
trigger: "click",
|
|
5414
5414
|
type: preset.defaultAction
|
|
5415
5415
|
});
|
|
@@ -5418,7 +5418,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5418
5418
|
defaultPptxAction.highlightClick = true;
|
|
5419
5419
|
}
|
|
5420
5420
|
addElement({
|
|
5421
|
-
id:
|
|
5421
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5422
5422
|
type: "shape",
|
|
5423
5423
|
x: 150,
|
|
5424
5424
|
y: 150,
|
|
@@ -5485,14 +5485,14 @@ function useInsertElements(input) {
|
|
|
5485
5485
|
return;
|
|
5486
5486
|
}
|
|
5487
5487
|
addElement({
|
|
5488
|
-
id:
|
|
5488
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5489
5489
|
type: "text",
|
|
5490
5490
|
x: 100,
|
|
5491
5491
|
y: 100,
|
|
5492
5492
|
width: 300,
|
|
5493
5493
|
height: 60,
|
|
5494
5494
|
text: "",
|
|
5495
|
-
textStyle: { fontSize:
|
|
5495
|
+
textStyle: { fontSize: chunkHZSUTVDQ_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5496
5496
|
});
|
|
5497
5497
|
};
|
|
5498
5498
|
const handleAddShape = () => {
|
|
@@ -5500,7 +5500,7 @@ function useInsertElements(input) {
|
|
|
5500
5500
|
return;
|
|
5501
5501
|
}
|
|
5502
5502
|
addElement({
|
|
5503
|
-
id:
|
|
5503
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5504
5504
|
type: "shape",
|
|
5505
5505
|
x: 150,
|
|
5506
5506
|
y: 150,
|
|
@@ -5519,15 +5519,15 @@ function useInsertElements(input) {
|
|
|
5519
5519
|
return;
|
|
5520
5520
|
}
|
|
5521
5521
|
addElement({
|
|
5522
|
-
...
|
|
5523
|
-
id:
|
|
5522
|
+
...chunkKA35ZMIP_js.newTableElement(chunkHZSUTVDQ_js.DEFAULT_TABLE_ROWS, chunkHZSUTVDQ_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5523
|
+
id: chunkKA35ZMIP_js.generateElementId()
|
|
5524
5524
|
});
|
|
5525
5525
|
};
|
|
5526
5526
|
const handleAddChart = (chartKind) => {
|
|
5527
5527
|
if (!activeSlide) {
|
|
5528
5528
|
return;
|
|
5529
5529
|
}
|
|
5530
|
-
addElement(
|
|
5530
|
+
addElement(chunkKA35ZMIP_js.createDefaultChartElement(chartKind));
|
|
5531
5531
|
};
|
|
5532
5532
|
const structured = createStructuredElementHandlers({
|
|
5533
5533
|
activeSlide,
|
|
@@ -5597,7 +5597,7 @@ function useClipboardHandlers(input) {
|
|
|
5597
5597
|
if (!selectedElement) {
|
|
5598
5598
|
return;
|
|
5599
5599
|
}
|
|
5600
|
-
setClipboardPayload(
|
|
5600
|
+
setClipboardPayload(chunkKA35ZMIP_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5601
5601
|
};
|
|
5602
5602
|
const handleDelete = () => {
|
|
5603
5603
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5614,7 +5614,7 @@ function useClipboardHandlers(input) {
|
|
|
5614
5614
|
handleDelete();
|
|
5615
5615
|
};
|
|
5616
5616
|
const insertClone = (source) => {
|
|
5617
|
-
const clone =
|
|
5617
|
+
const clone = chunkKA35ZMIP_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5618
5618
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5619
5619
|
ops.applySelection(clone.id);
|
|
5620
5620
|
history.markDirty();
|
|
@@ -5649,7 +5649,7 @@ function resolveShapePath(el) {
|
|
|
5649
5649
|
return el.pathData;
|
|
5650
5650
|
}
|
|
5651
5651
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5652
|
-
const clipPath =
|
|
5652
|
+
const clipPath = chunkKA35ZMIP_js.getPresetShapeClipPath(el.shapeType);
|
|
5653
5653
|
if (clipPath) {
|
|
5654
5654
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5655
5655
|
if (svgPath) {
|
|
@@ -5700,7 +5700,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5700
5700
|
return parts.join(" ");
|
|
5701
5701
|
}
|
|
5702
5702
|
function transformPathToGlobal(pathData, el) {
|
|
5703
|
-
const polys =
|
|
5703
|
+
const polys = chunkKA35ZMIP_js.svgPathToPolygons(pathData);
|
|
5704
5704
|
if (polys.length === 0) {
|
|
5705
5705
|
return pathData;
|
|
5706
5706
|
}
|
|
@@ -5720,10 +5720,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5720
5720
|
y: pt.y * scaleY + el.y
|
|
5721
5721
|
}))
|
|
5722
5722
|
);
|
|
5723
|
-
return
|
|
5723
|
+
return chunkKA35ZMIP_js.polygonsToSvgPath(transformed);
|
|
5724
5724
|
}
|
|
5725
5725
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5726
|
-
const polys =
|
|
5726
|
+
const polys = chunkKA35ZMIP_js.svgPathToPolygons(pathData);
|
|
5727
5727
|
if (polys.length === 0) {
|
|
5728
5728
|
return pathData;
|
|
5729
5729
|
}
|
|
@@ -5733,10 +5733,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5733
5733
|
y: pt.y - y
|
|
5734
5734
|
}))
|
|
5735
5735
|
);
|
|
5736
|
-
return
|
|
5736
|
+
return chunkKA35ZMIP_js.polygonsToSvgPath(transformed);
|
|
5737
5737
|
}
|
|
5738
5738
|
function pathBounds(pathData) {
|
|
5739
|
-
const polys =
|
|
5739
|
+
const polys = chunkKA35ZMIP_js.svgPathToPolygons(pathData);
|
|
5740
5740
|
let minX = Infinity;
|
|
5741
5741
|
let minY = Infinity;
|
|
5742
5742
|
let maxX = -Infinity;
|
|
@@ -5795,7 +5795,7 @@ function useMergeShapesHandler(input) {
|
|
|
5795
5795
|
let allFragments = [];
|
|
5796
5796
|
let remaining = globalPaths[0];
|
|
5797
5797
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5798
|
-
const frags =
|
|
5798
|
+
const frags = chunkKA35ZMIP_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5799
5799
|
if (Array.isArray(frags)) {
|
|
5800
5800
|
allFragments = frags;
|
|
5801
5801
|
}
|
|
@@ -5824,7 +5824,7 @@ function useMergeShapesHandler(input) {
|
|
|
5824
5824
|
bounds.height
|
|
5825
5825
|
);
|
|
5826
5826
|
const newEl = {
|
|
5827
|
-
id:
|
|
5827
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5828
5828
|
type: "shape",
|
|
5829
5829
|
x: bounds.x,
|
|
5830
5830
|
y: bounds.y,
|
|
@@ -5862,7 +5862,7 @@ function useMergeShapesHandler(input) {
|
|
|
5862
5862
|
} else {
|
|
5863
5863
|
let resultPath = globalPaths[0];
|
|
5864
5864
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5865
|
-
const result =
|
|
5865
|
+
const result = chunkKA35ZMIP_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5866
5866
|
if (typeof result === "string") {
|
|
5867
5867
|
resultPath = result;
|
|
5868
5868
|
}
|
|
@@ -5883,7 +5883,7 @@ function useMergeShapesHandler(input) {
|
|
|
5883
5883
|
);
|
|
5884
5884
|
const primary = targets[0];
|
|
5885
5885
|
const newEl = {
|
|
5886
|
-
id:
|
|
5886
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5887
5887
|
type: "shape",
|
|
5888
5888
|
x: bounds.x,
|
|
5889
5889
|
y: bounds.y,
|
|
@@ -5946,7 +5946,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5946
5946
|
if (ids.length < 2 || !activeSlide) {
|
|
5947
5947
|
return;
|
|
5948
5948
|
}
|
|
5949
|
-
const { elements, groupId } =
|
|
5949
|
+
const { elements, groupId } = chunkKA35ZMIP_js.groupElements(ops.activeElements, ids, chunkKA35ZMIP_js.generateElementId());
|
|
5950
5950
|
if (groupId === null) {
|
|
5951
5951
|
return;
|
|
5952
5952
|
}
|
|
@@ -5959,12 +5959,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5959
5959
|
return;
|
|
5960
5960
|
}
|
|
5961
5961
|
const group = selectedElement;
|
|
5962
|
-
const intoTemplate =
|
|
5962
|
+
const intoTemplate = chunkKA35ZMIP_js.isTemplateElementId(group.id);
|
|
5963
5963
|
const ungrouped = group.children.map((child) => ({
|
|
5964
5964
|
...structuredClone(child),
|
|
5965
5965
|
// Keep child ids in the same store as the group so later edits route
|
|
5966
5966
|
// correctly: template groups yield template-prefixed child ids.
|
|
5967
|
-
id: intoTemplate ?
|
|
5967
|
+
id: intoTemplate ? chunkKA35ZMIP_js.makeCloneId(true, child.id || group.id) : child.id || chunkKA35ZMIP_js.generateElementId(),
|
|
5968
5968
|
x: child.x + group.x,
|
|
5969
5969
|
y: child.y + group.y
|
|
5970
5970
|
}));
|
|
@@ -5988,7 +5988,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5988
5988
|
if (!edge) {
|
|
5989
5989
|
return;
|
|
5990
5990
|
}
|
|
5991
|
-
const positions =
|
|
5991
|
+
const positions = chunkKA35ZMIP_js.alignElements(selectedElements, edge);
|
|
5992
5992
|
for (const [id, pos] of positions) {
|
|
5993
5993
|
const el = elementLookup.get(id);
|
|
5994
5994
|
if (!el) {
|
|
@@ -6006,7 +6006,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6006
6006
|
if (!distAxis) {
|
|
6007
6007
|
return;
|
|
6008
6008
|
}
|
|
6009
|
-
const positions =
|
|
6009
|
+
const positions = chunkKA35ZMIP_js.distributeElements(selectedElements, distAxis);
|
|
6010
6010
|
for (const [id, pos] of positions) {
|
|
6011
6011
|
const el = elementLookup.get(id);
|
|
6012
6012
|
if (!el) {
|
|
@@ -6023,7 +6023,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6023
6023
|
}
|
|
6024
6024
|
const id = selectedElement.id;
|
|
6025
6025
|
ops.updateActiveElements(
|
|
6026
|
-
(els) => direction === "forward" ?
|
|
6026
|
+
(els) => direction === "forward" ? chunkKA35ZMIP_js.bringForward(els, id) : direction === "backward" ? chunkKA35ZMIP_js.sendBackward(els, id) : els
|
|
6027
6027
|
);
|
|
6028
6028
|
history.markDirty();
|
|
6029
6029
|
};
|
|
@@ -6033,7 +6033,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6033
6033
|
}
|
|
6034
6034
|
const id = selectedElement.id;
|
|
6035
6035
|
ops.updateActiveElements(
|
|
6036
|
-
(els) => direction === "front" ?
|
|
6036
|
+
(els) => direction === "front" ? chunkKA35ZMIP_js.bringToFront(els, id) : chunkKA35ZMIP_js.sendToBack(els, id)
|
|
6037
6037
|
);
|
|
6038
6038
|
history.markDirty();
|
|
6039
6039
|
};
|
|
@@ -6164,7 +6164,7 @@ function useSlideManagement(input) {
|
|
|
6164
6164
|
theme
|
|
6165
6165
|
} = input;
|
|
6166
6166
|
const handleAddSlide = () => {
|
|
6167
|
-
const newSlide =
|
|
6167
|
+
const newSlide = chunkKA35ZMIP_js.createBlankSlide(slides.length + 1);
|
|
6168
6168
|
ops.updateSlides((prev) => {
|
|
6169
6169
|
const next = [...prev];
|
|
6170
6170
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6227,7 +6227,7 @@ function useSlideManagement(input) {
|
|
|
6227
6227
|
}
|
|
6228
6228
|
const clone = {
|
|
6229
6229
|
...src,
|
|
6230
|
-
id:
|
|
6230
|
+
id: chunkKA35ZMIP_js.makeSlideId(),
|
|
6231
6231
|
elements: src.elements.map((el) => ({
|
|
6232
6232
|
...el,
|
|
6233
6233
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6259,7 +6259,7 @@ function useSlideManagement(input) {
|
|
|
6259
6259
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6260
6260
|
const insertAt = activeSlideIndex + 1;
|
|
6261
6261
|
const draft = {
|
|
6262
|
-
...
|
|
6262
|
+
...chunkKA35ZMIP_js.createBlankSlide(slides.length + 1),
|
|
6263
6263
|
layoutPath,
|
|
6264
6264
|
...layoutName ? { layoutName } : {}
|
|
6265
6265
|
};
|
|
@@ -6292,9 +6292,9 @@ function useSlideManagement(input) {
|
|
|
6292
6292
|
};
|
|
6293
6293
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6294
6294
|
const insertAt = activeSlideIndex + 1;
|
|
6295
|
-
const draft =
|
|
6295
|
+
const draft = chunkKA35ZMIP_js.buildSlideTemplateSlide(templateId, chunkKA35ZMIP_js.makeSlideId(), slides.length + 1, {
|
|
6296
6296
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6297
|
-
scheme:
|
|
6297
|
+
scheme: chunkKA35ZMIP_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6298
6298
|
});
|
|
6299
6299
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6300
6300
|
setActiveSlideIndex(insertAt);
|
|
@@ -6331,7 +6331,7 @@ function createTableMergeHandlers(input) {
|
|
|
6331
6331
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6332
6332
|
return;
|
|
6333
6333
|
}
|
|
6334
|
-
const newTableData =
|
|
6334
|
+
const newTableData = chunkKA35ZMIP_js.mergeCells(
|
|
6335
6335
|
[
|
|
6336
6336
|
{ row: rowIndex, col: columnIndex },
|
|
6337
6337
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6339,7 +6339,7 @@ function createTableMergeHandlers(input) {
|
|
|
6339
6339
|
td
|
|
6340
6340
|
);
|
|
6341
6341
|
const updates = { tableData: newTableData };
|
|
6342
|
-
const newRawXml =
|
|
6342
|
+
const newRawXml = chunkKA35ZMIP_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6343
6343
|
if (newRawXml) {
|
|
6344
6344
|
updates.rawXml = newRawXml;
|
|
6345
6345
|
}
|
|
@@ -6365,7 +6365,7 @@ function createTableMergeHandlers(input) {
|
|
|
6365
6365
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6366
6366
|
return;
|
|
6367
6367
|
}
|
|
6368
|
-
const newTableData =
|
|
6368
|
+
const newTableData = chunkKA35ZMIP_js.mergeCells(
|
|
6369
6369
|
[
|
|
6370
6370
|
{ row: rowIndex, col: columnIndex },
|
|
6371
6371
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6373,7 +6373,7 @@ function createTableMergeHandlers(input) {
|
|
|
6373
6373
|
td
|
|
6374
6374
|
);
|
|
6375
6375
|
const updates = { tableData: newTableData };
|
|
6376
|
-
const newRawXml =
|
|
6376
|
+
const newRawXml = chunkKA35ZMIP_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6377
6377
|
if (newRawXml) {
|
|
6378
6378
|
updates.rawXml = newRawXml;
|
|
6379
6379
|
}
|
|
@@ -6388,9 +6388,9 @@ function createTableMergeHandlers(input) {
|
|
|
6388
6388
|
return;
|
|
6389
6389
|
}
|
|
6390
6390
|
const td = selectedElement.tableData;
|
|
6391
|
-
const newTableData =
|
|
6391
|
+
const newTableData = chunkKA35ZMIP_js.mergeCells(ts.selectedCells, td);
|
|
6392
6392
|
const updates = { tableData: newTableData };
|
|
6393
|
-
const newRawXml =
|
|
6393
|
+
const newRawXml = chunkKA35ZMIP_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6394
6394
|
if (newRawXml) {
|
|
6395
6395
|
updates.rawXml = newRawXml;
|
|
6396
6396
|
}
|
|
@@ -6407,9 +6407,9 @@ function createTableMergeHandlers(input) {
|
|
|
6407
6407
|
}
|
|
6408
6408
|
const { rowIndex, columnIndex } = ts;
|
|
6409
6409
|
const td = selectedElement.tableData;
|
|
6410
|
-
const newTableData =
|
|
6410
|
+
const newTableData = chunkKA35ZMIP_js.splitCell(rowIndex, columnIndex, td);
|
|
6411
6411
|
const updates = { tableData: newTableData };
|
|
6412
|
-
const newRawXml =
|
|
6412
|
+
const newRawXml = chunkKA35ZMIP_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6413
6413
|
if (newRawXml) {
|
|
6414
6414
|
updates.rawXml = newRawXml;
|
|
6415
6415
|
}
|
|
@@ -6453,7 +6453,7 @@ function createTableStructHandlers(input) {
|
|
|
6453
6453
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
6454
6454
|
}
|
|
6455
6455
|
if (el.rawXml) {
|
|
6456
|
-
const newRawXml =
|
|
6456
|
+
const newRawXml = chunkKA35ZMIP_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6457
6457
|
if (newRawXml) {
|
|
6458
6458
|
updates.rawXml = newRawXml;
|
|
6459
6459
|
}
|
|
@@ -6477,7 +6477,7 @@ function createTableStructHandlers(input) {
|
|
|
6477
6477
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6478
6478
|
const updates = {};
|
|
6479
6479
|
if (selectedElement.rawXml) {
|
|
6480
|
-
const newRawXml =
|
|
6480
|
+
const newRawXml = chunkKA35ZMIP_js.updateCellTextStyleInRawXml(
|
|
6481
6481
|
selectedElement,
|
|
6482
6482
|
rowIndex,
|
|
6483
6483
|
colIndex,
|
|
@@ -6541,9 +6541,9 @@ function createTableStructHandlers(input) {
|
|
|
6541
6541
|
return;
|
|
6542
6542
|
}
|
|
6543
6543
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6544
|
-
const newTableData =
|
|
6544
|
+
const newTableData = chunkKA35ZMIP_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6545
6545
|
const updates = { tableData: newTableData };
|
|
6546
|
-
const newRawXml =
|
|
6546
|
+
const newRawXml = chunkKA35ZMIP_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6547
6547
|
if (newRawXml) {
|
|
6548
6548
|
updates.rawXml = newRawXml;
|
|
6549
6549
|
}
|
|
@@ -6556,12 +6556,12 @@ function createTableStructHandlers(input) {
|
|
|
6556
6556
|
}
|
|
6557
6557
|
const td = selectedElement.tableData;
|
|
6558
6558
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6559
|
-
const newTableData =
|
|
6559
|
+
const newTableData = chunkKA35ZMIP_js.deleteTableRow(td, rowIdx);
|
|
6560
6560
|
if (newTableData === td) {
|
|
6561
6561
|
return;
|
|
6562
6562
|
}
|
|
6563
6563
|
const updates = { tableData: newTableData };
|
|
6564
|
-
const newRawXml =
|
|
6564
|
+
const newRawXml = chunkKA35ZMIP_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6565
6565
|
if (newRawXml) {
|
|
6566
6566
|
updates.rawXml = newRawXml;
|
|
6567
6567
|
}
|
|
@@ -6573,9 +6573,9 @@ function createTableStructHandlers(input) {
|
|
|
6573
6573
|
return;
|
|
6574
6574
|
}
|
|
6575
6575
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6576
|
-
const newTableData =
|
|
6576
|
+
const newTableData = chunkKA35ZMIP_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6577
6577
|
const updates = { tableData: newTableData };
|
|
6578
|
-
const newRawXml =
|
|
6578
|
+
const newRawXml = chunkKA35ZMIP_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6579
6579
|
if (newRawXml) {
|
|
6580
6580
|
updates.rawXml = newRawXml;
|
|
6581
6581
|
}
|
|
@@ -6588,12 +6588,12 @@ function createTableStructHandlers(input) {
|
|
|
6588
6588
|
}
|
|
6589
6589
|
const td = selectedElement.tableData;
|
|
6590
6590
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6591
|
-
const newTableData =
|
|
6591
|
+
const newTableData = chunkKA35ZMIP_js.deleteTableColumn(td, colIdx);
|
|
6592
6592
|
if (newTableData === td) {
|
|
6593
6593
|
return;
|
|
6594
6594
|
}
|
|
6595
6595
|
const updates = { tableData: newTableData };
|
|
6596
|
-
const newRawXml =
|
|
6596
|
+
const newRawXml = chunkKA35ZMIP_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6597
6597
|
if (newRawXml) {
|
|
6598
6598
|
updates.rawXml = newRawXml;
|
|
6599
6599
|
}
|
|
@@ -6629,8 +6629,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6629
6629
|
return html2canvasPro(element, {
|
|
6630
6630
|
...options,
|
|
6631
6631
|
onclone: async (doc, clonedEl) => {
|
|
6632
|
-
await
|
|
6633
|
-
|
|
6632
|
+
await chunkKA35ZMIP_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6633
|
+
chunkKA35ZMIP_js.preprocessCssForCapture(clonedEl);
|
|
6634
6634
|
if (typeof userOnClone === "function") {
|
|
6635
6635
|
userOnClone(doc, clonedEl);
|
|
6636
6636
|
}
|
|
@@ -6686,7 +6686,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6686
6686
|
}
|
|
6687
6687
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6688
6688
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6689
|
-
|
|
6689
|
+
chunkKA35ZMIP_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6690
6690
|
}
|
|
6691
6691
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6692
6692
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6708,15 +6708,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6708
6708
|
continue;
|
|
6709
6709
|
}
|
|
6710
6710
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6711
|
-
images.push(
|
|
6711
|
+
images.push(chunkKA35ZMIP_js.canvasToJpegData(canvas));
|
|
6712
6712
|
}
|
|
6713
6713
|
onProgress?.(totalSlides, totalSlides);
|
|
6714
6714
|
setActiveSlide(currentSlideIndex);
|
|
6715
6715
|
if (images.length === 0) {
|
|
6716
6716
|
throw new Error(chunk3ISYPBSX_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6717
6717
|
}
|
|
6718
|
-
const pdfBlobUrl =
|
|
6719
|
-
|
|
6718
|
+
const pdfBlobUrl = chunkHZSUTVDQ_js.buildPdfFromImageData(images);
|
|
6719
|
+
chunkKA35ZMIP_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6720
6720
|
}
|
|
6721
6721
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6722
6722
|
const { scale = 2, onProgress } = options;
|
|
@@ -6764,8 +6764,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6764
6764
|
if (pages.length === 0) {
|
|
6765
6765
|
throw new Error(chunk3ISYPBSX_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6766
6766
|
}
|
|
6767
|
-
const pdfDataUrl =
|
|
6768
|
-
|
|
6767
|
+
const pdfDataUrl = chunkHZSUTVDQ_js.buildNotesPdf(pages);
|
|
6768
|
+
chunkKA35ZMIP_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6769
6769
|
}
|
|
6770
6770
|
|
|
6771
6771
|
// src/viewer/utils/export-video.ts
|
|
@@ -6809,7 +6809,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6809
6809
|
const fps = 30;
|
|
6810
6810
|
const stream = recordingCanvas.captureStream(fps);
|
|
6811
6811
|
const recorder = new MediaRecorder(stream, {
|
|
6812
|
-
mimeType:
|
|
6812
|
+
mimeType: chunkKA35ZMIP_js.pickSupportedMimeType([...chunkKA35ZMIP_js.WEBM_MIME_CANDIDATES]),
|
|
6813
6813
|
videoBitsPerSecond: 5e6
|
|
6814
6814
|
});
|
|
6815
6815
|
const chunks = [];
|
|
@@ -6832,8 +6832,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6832
6832
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6833
6833
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6834
6834
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6835
|
-
const frameInterval =
|
|
6836
|
-
const framesNeeded =
|
|
6835
|
+
const frameInterval = chunkKA35ZMIP_js.fpsToFrameIntervalMs(fps);
|
|
6836
|
+
const framesNeeded = chunkKA35ZMIP_js.segmentFrameCount(duration, fps);
|
|
6837
6837
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6838
6838
|
if (signal?.aborted) {
|
|
6839
6839
|
recorder.stop();
|
|
@@ -6882,7 +6882,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6882
6882
|
if (frames.length === 0) {
|
|
6883
6883
|
throw new Error(chunk3ISYPBSX_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6884
6884
|
}
|
|
6885
|
-
const gifBytes =
|
|
6885
|
+
const gifBytes = chunkKA35ZMIP_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6886
6886
|
onProgress?.(totalSlides, totalSlides);
|
|
6887
6887
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6888
6888
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6936,7 +6936,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6936
6936
|
continue;
|
|
6937
6937
|
}
|
|
6938
6938
|
onProgress?.(processedCount, data.slides.length);
|
|
6939
|
-
let svg =
|
|
6939
|
+
let svg = chunkKA35ZMIP_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6940
6940
|
if (embedFonts && fontFaces?.length) {
|
|
6941
6941
|
svg = injectFontFaces(svg, fontFaces);
|
|
6942
6942
|
}
|
|
@@ -6998,7 +6998,7 @@ function useExportSaveAs(input) {
|
|
|
6998
6998
|
}
|
|
6999
6999
|
setExportProgress(70);
|
|
7000
7000
|
setExportStatusMessage("Writing README...");
|
|
7001
|
-
const readme =
|
|
7001
|
+
const readme = chunkKA35ZMIP_js.generatePackageReadme(pptxFilename);
|
|
7002
7002
|
pkgFolder.file("README.txt", readme);
|
|
7003
7003
|
if (abortCtrl.signal.aborted) {
|
|
7004
7004
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -7009,7 +7009,7 @@ function useExportSaveAs(input) {
|
|
|
7009
7009
|
setExportProgress(95);
|
|
7010
7010
|
setExportStatusMessage("Downloading...");
|
|
7011
7011
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
7012
|
-
|
|
7012
|
+
chunkKA35ZMIP_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
7013
7013
|
setExportProgress(100);
|
|
7014
7014
|
} catch (err) {
|
|
7015
7015
|
if (err.name !== "AbortError") {
|
|
@@ -7032,7 +7032,7 @@ function useExportSaveAs(input) {
|
|
|
7032
7032
|
const blob = new Blob([data], {
|
|
7033
7033
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
7034
7034
|
});
|
|
7035
|
-
|
|
7035
|
+
chunkKA35ZMIP_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
7036
7036
|
} catch (err) {
|
|
7037
7037
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
7038
7038
|
}
|
|
@@ -7045,14 +7045,14 @@ function useExportSaveAs(input) {
|
|
|
7045
7045
|
const pptxGuides = guides.map((g) => ({
|
|
7046
7046
|
id: g.id,
|
|
7047
7047
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7048
|
-
positionEmu:
|
|
7048
|
+
positionEmu: chunkKA35ZMIP_js.guidePxToEmu(g.position)
|
|
7049
7049
|
}));
|
|
7050
7050
|
return {
|
|
7051
7051
|
...slide,
|
|
7052
7052
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7053
7053
|
};
|
|
7054
7054
|
});
|
|
7055
|
-
const slidesToSave =
|
|
7055
|
+
const slidesToSave = chunkHZSUTVDQ_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7056
7056
|
const saveOptions = {
|
|
7057
7057
|
headerFooter,
|
|
7058
7058
|
presentationProperties,
|
|
@@ -7078,11 +7078,11 @@ function useExportSaveAs(input) {
|
|
|
7078
7078
|
const handleExportJson = () => {
|
|
7079
7079
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7080
7080
|
const data = {
|
|
7081
|
-
slides:
|
|
7081
|
+
slides: chunkHZSUTVDQ_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7082
7082
|
width: canvasSize.width,
|
|
7083
7083
|
height: canvasSize.height,
|
|
7084
|
-
widthEmu:
|
|
7085
|
-
heightEmu:
|
|
7084
|
+
widthEmu: chunkKA35ZMIP_js.guidePxToEmu(canvasSize.width),
|
|
7085
|
+
heightEmu: chunkKA35ZMIP_js.guidePxToEmu(canvasSize.height),
|
|
7086
7086
|
theme,
|
|
7087
7087
|
headerFooter,
|
|
7088
7088
|
presentationProperties,
|
|
@@ -7096,7 +7096,7 @@ function useExportSaveAs(input) {
|
|
|
7096
7096
|
handoutMaster
|
|
7097
7097
|
};
|
|
7098
7098
|
try {
|
|
7099
|
-
|
|
7099
|
+
chunkKA35ZMIP_js.exportDeckJson(data, sourceName);
|
|
7100
7100
|
} catch (err) {
|
|
7101
7101
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7102
7102
|
}
|
|
@@ -7136,7 +7136,7 @@ function safeConfirm(message) {
|
|
|
7136
7136
|
}
|
|
7137
7137
|
}
|
|
7138
7138
|
function downloadBlob2(blob, filename) {
|
|
7139
|
-
|
|
7139
|
+
chunkKA35ZMIP_js.downloadBlob(blob, chunkKA35ZMIP_js.sanitizeDownloadFilename(filename));
|
|
7140
7140
|
}
|
|
7141
7141
|
|
|
7142
7142
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7242,21 +7242,21 @@ function useExportHandlers(input) {
|
|
|
7242
7242
|
{
|
|
7243
7243
|
scale: 2,
|
|
7244
7244
|
onProgress: (current, total) => {
|
|
7245
|
-
setExportProgress(
|
|
7246
|
-
setExportStatusMessage(
|
|
7245
|
+
setExportProgress(chunkKA35ZMIP_js.slideProgressPercent(current, total));
|
|
7246
|
+
setExportStatusMessage(chunkKA35ZMIP_js.slideStatusLabel("Rendering", current, total));
|
|
7247
7247
|
},
|
|
7248
7248
|
signal: abortCtrl.signal
|
|
7249
7249
|
}
|
|
7250
7250
|
);
|
|
7251
|
-
setExportProgress(
|
|
7251
|
+
setExportProgress(chunkKA35ZMIP_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7252
7252
|
setExportStatusMessage("Building PDF...");
|
|
7253
7253
|
await new Promise((r) => {
|
|
7254
7254
|
setTimeout(r, 100);
|
|
7255
7255
|
});
|
|
7256
|
-
setExportProgress(
|
|
7256
|
+
setExportProgress(chunkKA35ZMIP_js.EXPORT_DONE_PERCENT);
|
|
7257
7257
|
setExportStatusMessage("Done!");
|
|
7258
7258
|
} catch (err) {
|
|
7259
|
-
if (!
|
|
7259
|
+
if (!chunkKA35ZMIP_js.isExportAbortError(err)) {
|
|
7260
7260
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7261
7261
|
}
|
|
7262
7262
|
} finally {
|
|
@@ -7286,21 +7286,21 @@ function useExportHandlers(input) {
|
|
|
7286
7286
|
{
|
|
7287
7287
|
scale: 2,
|
|
7288
7288
|
onProgress: (current, total) => {
|
|
7289
|
-
setExportProgress(
|
|
7290
|
-
setExportStatusMessage(
|
|
7289
|
+
setExportProgress(chunkKA35ZMIP_js.slideProgressPercent(current, total));
|
|
7290
|
+
setExportStatusMessage(chunkKA35ZMIP_js.slideStatusLabel("Rendering", current, total));
|
|
7291
7291
|
},
|
|
7292
7292
|
signal: abortCtrl.signal
|
|
7293
7293
|
}
|
|
7294
7294
|
);
|
|
7295
|
-
setExportProgress(
|
|
7295
|
+
setExportProgress(chunkKA35ZMIP_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7296
7296
|
setExportStatusMessage("Building PDF...");
|
|
7297
7297
|
await new Promise((r) => {
|
|
7298
7298
|
setTimeout(r, 100);
|
|
7299
7299
|
});
|
|
7300
|
-
setExportProgress(
|
|
7300
|
+
setExportProgress(chunkKA35ZMIP_js.EXPORT_DONE_PERCENT);
|
|
7301
7301
|
setExportStatusMessage("Done!");
|
|
7302
7302
|
} catch (err) {
|
|
7303
|
-
if (!
|
|
7303
|
+
if (!chunkKA35ZMIP_js.isExportAbortError(err)) {
|
|
7304
7304
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7305
7305
|
}
|
|
7306
7306
|
} finally {
|
|
@@ -7341,22 +7341,22 @@ function useExportHandlers(input) {
|
|
|
7341
7341
|
scale: 1,
|
|
7342
7342
|
slideDurationMs: 3e3,
|
|
7343
7343
|
onProgress: (current, total) => {
|
|
7344
|
-
setExportProgress(
|
|
7345
|
-
setExportStatusMessage(
|
|
7344
|
+
setExportProgress(chunkKA35ZMIP_js.slideProgressPercent(current, total, 45));
|
|
7345
|
+
setExportStatusMessage(chunkKA35ZMIP_js.slideStatusLabel("Capturing", current, total));
|
|
7346
7346
|
},
|
|
7347
7347
|
onRecordProgress: (current, total) => {
|
|
7348
|
-
setExportProgress(
|
|
7349
|
-
setExportStatusMessage(
|
|
7348
|
+
setExportProgress(chunkKA35ZMIP_js.recordProgressPercent(current, total));
|
|
7349
|
+
setExportStatusMessage(chunkKA35ZMIP_js.slideStatusLabel("Recording", current, total));
|
|
7350
7350
|
},
|
|
7351
7351
|
signal: abortCtrl.signal
|
|
7352
7352
|
}
|
|
7353
7353
|
);
|
|
7354
|
-
setExportProgress(
|
|
7354
|
+
setExportProgress(chunkKA35ZMIP_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7355
7355
|
setExportStatusMessage("Saving file...");
|
|
7356
7356
|
downloadBlob2(blob, "presentation.webm");
|
|
7357
|
-
setExportProgress(
|
|
7357
|
+
setExportProgress(chunkKA35ZMIP_js.EXPORT_DONE_PERCENT);
|
|
7358
7358
|
} catch (err) {
|
|
7359
|
-
if (!
|
|
7359
|
+
if (!chunkKA35ZMIP_js.isExportAbortError(err)) {
|
|
7360
7360
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7361
7361
|
}
|
|
7362
7362
|
} finally {
|
|
@@ -7384,18 +7384,18 @@ function useExportHandlers(input) {
|
|
|
7384
7384
|
scale: 0.5,
|
|
7385
7385
|
slideDurationMs: 2e3,
|
|
7386
7386
|
onProgress: (current, total) => {
|
|
7387
|
-
setExportProgress(
|
|
7388
|
-
setExportStatusMessage(
|
|
7387
|
+
setExportProgress(chunkKA35ZMIP_js.slideProgressPercent(current, total));
|
|
7388
|
+
setExportStatusMessage(chunkKA35ZMIP_js.slideStatusLabel("Encoding", current, total));
|
|
7389
7389
|
},
|
|
7390
7390
|
signal: abortCtrl.signal
|
|
7391
7391
|
}
|
|
7392
7392
|
);
|
|
7393
|
-
setExportProgress(
|
|
7393
|
+
setExportProgress(chunkKA35ZMIP_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7394
7394
|
setExportStatusMessage("Saving file...");
|
|
7395
7395
|
downloadBlob2(blob, "presentation.gif");
|
|
7396
|
-
setExportProgress(
|
|
7396
|
+
setExportProgress(chunkKA35ZMIP_js.EXPORT_DONE_PERCENT);
|
|
7397
7397
|
} catch (err) {
|
|
7398
|
-
if (!
|
|
7398
|
+
if (!chunkKA35ZMIP_js.isExportAbortError(err)) {
|
|
7399
7399
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7400
7400
|
}
|
|
7401
7401
|
} finally {
|
|
@@ -7436,7 +7436,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7436
7436
|
}
|
|
7437
7437
|
printWindow.document.open();
|
|
7438
7438
|
printWindow.document.write(
|
|
7439
|
-
|
|
7439
|
+
chunkKA35ZMIP_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7440
7440
|
);
|
|
7441
7441
|
printWindow.document.close();
|
|
7442
7442
|
printWindow.focus();
|
|
@@ -7497,7 +7497,7 @@ function usePrintHandlers(input) {
|
|
|
7497
7497
|
if (svgs.length === 0) {
|
|
7498
7498
|
return;
|
|
7499
7499
|
}
|
|
7500
|
-
const printDoc =
|
|
7500
|
+
const printDoc = chunkKA35ZMIP_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7501
7501
|
title: "Slides (Vector)",
|
|
7502
7502
|
orientation: settings.orientation,
|
|
7503
7503
|
colorFilter
|
|
@@ -7533,7 +7533,7 @@ function usePrintHandlers(input) {
|
|
|
7533
7533
|
if (settings.printWhat === "outline") {
|
|
7534
7534
|
openPrintWindow(
|
|
7535
7535
|
"Outline",
|
|
7536
|
-
`<div class="outline-page">${
|
|
7536
|
+
`<div class="outline-page">${chunkKA35ZMIP_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7537
7537
|
settings.orientation,
|
|
7538
7538
|
colorFilter,
|
|
7539
7539
|
settings.frameSlides
|
|
@@ -7558,7 +7558,7 @@ function usePrintHandlers(input) {
|
|
|
7558
7558
|
if (settings.printWhat === "slides") {
|
|
7559
7559
|
openPrintWindow(
|
|
7560
7560
|
"Slides",
|
|
7561
|
-
|
|
7561
|
+
chunkKA35ZMIP_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7562
7562
|
settings.orientation,
|
|
7563
7563
|
colorFilter,
|
|
7564
7564
|
settings.frameSlides
|
|
@@ -7568,7 +7568,7 @@ function usePrintHandlers(input) {
|
|
|
7568
7568
|
if (settings.printWhat === "notes") {
|
|
7569
7569
|
openPrintWindow(
|
|
7570
7570
|
"Notes Pages",
|
|
7571
|
-
|
|
7571
|
+
chunkKA35ZMIP_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7572
7572
|
"portrait",
|
|
7573
7573
|
colorFilter,
|
|
7574
7574
|
settings.frameSlides
|
|
@@ -7579,7 +7579,7 @@ function usePrintHandlers(input) {
|
|
|
7579
7579
|
const spp = settings.slidesPerPage;
|
|
7580
7580
|
openPrintWindow(
|
|
7581
7581
|
`Handout ${spp} per page`,
|
|
7582
|
-
|
|
7582
|
+
chunkKA35ZMIP_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7583
7583
|
"portrait",
|
|
7584
7584
|
colorFilter,
|
|
7585
7585
|
settings.frameSlides
|
|
@@ -7643,8 +7643,8 @@ function useThemeHandlers(input) {
|
|
|
7643
7643
|
return;
|
|
7644
7644
|
}
|
|
7645
7645
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7646
|
-
const previousMap = theme?.colorScheme ?
|
|
7647
|
-
setSlides((prev) =>
|
|
7646
|
+
const previousMap = theme?.colorScheme ? chunkKA35ZMIP_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7647
|
+
setSlides((prev) => chunkKA35ZMIP_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7648
7648
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7649
7649
|
bumpHistory();
|
|
7650
7650
|
history.markDirty();
|
|
@@ -7749,7 +7749,7 @@ function useThemeSwitching(input) {
|
|
|
7749
7749
|
}
|
|
7750
7750
|
try {
|
|
7751
7751
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7752
|
-
const newData =
|
|
7752
|
+
const newData = chunkKA35ZMIP_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7753
7753
|
onDataChange(newData);
|
|
7754
7754
|
onThemeChanged?.(preset);
|
|
7755
7755
|
} catch (error) {
|
|
@@ -7766,7 +7766,7 @@ function useThemeSwitching(input) {
|
|
|
7766
7766
|
}
|
|
7767
7767
|
try {
|
|
7768
7768
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7769
|
-
const newData =
|
|
7769
|
+
const newData = chunkKA35ZMIP_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7770
7770
|
onDataChange(newData);
|
|
7771
7771
|
} catch (error) {
|
|
7772
7772
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7778,12 +7778,12 @@ function useThemeSwitching(input) {
|
|
|
7778
7778
|
if (!data?.theme?.colorScheme) {
|
|
7779
7779
|
return void 0;
|
|
7780
7780
|
}
|
|
7781
|
-
return
|
|
7782
|
-
(p) =>
|
|
7781
|
+
return chunkKA35ZMIP_js.THEME_PRESETS.find(
|
|
7782
|
+
(p) => chunkKA35ZMIP_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7783
7783
|
);
|
|
7784
7784
|
}, [data?.theme?.colorScheme]);
|
|
7785
7785
|
return {
|
|
7786
|
-
presets:
|
|
7786
|
+
presets: chunkKA35ZMIP_js.THEME_PRESETS,
|
|
7787
7787
|
switchToPreset,
|
|
7788
7788
|
switchToCustom,
|
|
7789
7789
|
currentPreset
|
|
@@ -7858,7 +7858,7 @@ function usePropertyHandlers(input) {
|
|
|
7858
7858
|
}
|
|
7859
7859
|
try {
|
|
7860
7860
|
const ab = await file.arrayBuffer();
|
|
7861
|
-
const h = new
|
|
7861
|
+
const h = new chunkKA35ZMIP_js.PptxHandler();
|
|
7862
7862
|
const other = await h.load(ab);
|
|
7863
7863
|
if (!other) {
|
|
7864
7864
|
return;
|
|
@@ -7868,7 +7868,7 @@ function usePropertyHandlers(input) {
|
|
|
7868
7868
|
width: canvasSize.width,
|
|
7869
7869
|
height: canvasSize.height
|
|
7870
7870
|
};
|
|
7871
|
-
setCompareResult(
|
|
7871
|
+
setCompareResult(chunkKA35ZMIP_js.comparePresentation(cur, other));
|
|
7872
7872
|
setIsComparePanelOpen(true);
|
|
7873
7873
|
} catch (err) {
|
|
7874
7874
|
console.warn("Compare failed:", err);
|
|
@@ -7885,7 +7885,7 @@ function usePropertyHandlers(input) {
|
|
|
7885
7885
|
if (!diff || diff.status === "unchanged") {
|
|
7886
7886
|
return;
|
|
7887
7887
|
}
|
|
7888
|
-
setSlides((prev) =>
|
|
7888
|
+
setSlides((prev) => chunkKA35ZMIP_js.applyAcceptSlide(prev, diff));
|
|
7889
7889
|
setIsDirty(true);
|
|
7890
7890
|
},
|
|
7891
7891
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7896,10 +7896,10 @@ function usePropertyHandlers(input) {
|
|
|
7896
7896
|
if (!compareResult) {
|
|
7897
7897
|
return;
|
|
7898
7898
|
}
|
|
7899
|
-
setSlides((prev) =>
|
|
7899
|
+
setSlides((prev) => chunkKA35ZMIP_js.applyAcceptAllSlides(prev, compareResult));
|
|
7900
7900
|
setIsDirty(true);
|
|
7901
7901
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7902
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7902
|
+
const usedFontFamilies = react.useMemo(() => chunkKA35ZMIP_js.collectUsedFonts(slides), [slides]);
|
|
7903
7903
|
return {
|
|
7904
7904
|
handleUpdateNotes,
|
|
7905
7905
|
handleUpdateSlide,
|
|
@@ -8018,7 +8018,7 @@ function useIsMobile(input) {
|
|
|
8018
8018
|
const containerRef = input?.containerRef;
|
|
8019
8019
|
const isTouchDevice = react.useSyncExternalStore(
|
|
8020
8020
|
subscribeTouchCapability,
|
|
8021
|
-
|
|
8021
|
+
chunkKA35ZMIP_js.detectTouchDevice,
|
|
8022
8022
|
() => false
|
|
8023
8023
|
// server snapshot
|
|
8024
8024
|
);
|
|
@@ -8034,7 +8034,7 @@ function useIsMobile(input) {
|
|
|
8034
8034
|
}
|
|
8035
8035
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
8036
8036
|
});
|
|
8037
|
-
const [orientation, setOrientation] = react.useState(
|
|
8037
|
+
const [orientation, setOrientation] = react.useState(chunkKA35ZMIP_js.detectOrientation);
|
|
8038
8038
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
8039
8039
|
const [initialViewportHeight] = react.useState(
|
|
8040
8040
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -8078,7 +8078,7 @@ function useIsMobile(input) {
|
|
|
8078
8078
|
return;
|
|
8079
8079
|
}
|
|
8080
8080
|
const handleOrientationChange = () => {
|
|
8081
|
-
setOrientation(
|
|
8081
|
+
setOrientation(chunkKA35ZMIP_js.detectOrientation());
|
|
8082
8082
|
};
|
|
8083
8083
|
if (screen.orientation) {
|
|
8084
8084
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -8108,9 +8108,9 @@ function useIsMobile(input) {
|
|
|
8108
8108
|
window.addEventListener("resize", handleResize);
|
|
8109
8109
|
return () => window.removeEventListener("resize", handleResize);
|
|
8110
8110
|
}, [isTouchDevice, initialViewportHeight]);
|
|
8111
|
-
const isMobile =
|
|
8112
|
-
const isTablet = !isMobile && containerWidth >=
|
|
8113
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
8111
|
+
const isMobile = chunkKA35ZMIP_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
8112
|
+
const isTablet = !isMobile && containerWidth >= chunkKA35ZMIP_js.MOBILE_BREAKPOINT && containerWidth < chunkKA35ZMIP_js.TABLET_BREAKPOINT;
|
|
8113
|
+
const isDesktop = !isMobile && containerWidth >= chunkKA35ZMIP_js.TABLET_BREAKPOINT;
|
|
8114
8114
|
return {
|
|
8115
8115
|
isMobile,
|
|
8116
8116
|
isTablet,
|
|
@@ -8171,11 +8171,11 @@ function useViewerDialogs(input) {
|
|
|
8171
8171
|
);
|
|
8172
8172
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(false);
|
|
8173
8173
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8174
|
-
() => typeof window !== "undefined" ?
|
|
8174
|
+
() => typeof window !== "undefined" ? chunkKA35ZMIP_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8175
8175
|
);
|
|
8176
8176
|
react.useEffect(() => {
|
|
8177
8177
|
const handleWindow = () => setIsNarrowViewport(
|
|
8178
|
-
|
|
8178
|
+
chunkKA35ZMIP_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8179
8179
|
);
|
|
8180
8180
|
let observer = null;
|
|
8181
8181
|
let raf = 0;
|
|
@@ -8189,12 +8189,12 @@ function useViewerDialogs(input) {
|
|
|
8189
8189
|
const entry = entries[0];
|
|
8190
8190
|
if (entry) {
|
|
8191
8191
|
setIsNarrowViewport(
|
|
8192
|
-
|
|
8192
|
+
chunkKA35ZMIP_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8193
8193
|
);
|
|
8194
8194
|
}
|
|
8195
8195
|
});
|
|
8196
8196
|
observer.observe(el);
|
|
8197
|
-
setIsNarrowViewport(
|
|
8197
|
+
setIsNarrowViewport(chunkKA35ZMIP_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8198
8198
|
};
|
|
8199
8199
|
attach();
|
|
8200
8200
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8352,20 +8352,20 @@ function useViewerDialogs(input) {
|
|
|
8352
8352
|
}
|
|
8353
8353
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8354
8354
|
if (presentationGridSpacing) {
|
|
8355
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8355
|
+
const px = Math.round(presentationGridSpacing.cx / chunkHZSUTVDQ_js.EMU_PER_PX);
|
|
8356
8356
|
if (px > 0) {
|
|
8357
8357
|
return px;
|
|
8358
8358
|
}
|
|
8359
8359
|
}
|
|
8360
|
-
return
|
|
8360
|
+
return chunkHZSUTVDQ_js.GRID_SIZE;
|
|
8361
8361
|
}
|
|
8362
8362
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8363
8363
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8364
|
-
return
|
|
8364
|
+
return chunkKA35ZMIP_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8365
8365
|
}
|
|
8366
8366
|
function computeSlideSectionGroups(slides, sections) {
|
|
8367
|
-
return
|
|
8368
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8367
|
+
return chunkKA35ZMIP_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8368
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkHZSUTVDQ_js.UNGROUPED_SECTION_ID : "default"),
|
|
8369
8369
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8370
8370
|
slideIndexes: group.slideIndexes,
|
|
8371
8371
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8420,7 +8420,7 @@ function useDerivedSlideState(input) {
|
|
|
8420
8420
|
);
|
|
8421
8421
|
const slideSectionGroups = react.useMemo(
|
|
8422
8422
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8423
|
-
if (group.id ===
|
|
8423
|
+
if (group.id === chunkHZSUTVDQ_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8424
8424
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8425
8425
|
}
|
|
8426
8426
|
if (group.id === "default" && group.label === "Slides") {
|
|
@@ -8523,13 +8523,13 @@ function useAnnotationHandlers(input) {
|
|
|
8523
8523
|
}, [annotations, setMode, setSlides, history]);
|
|
8524
8524
|
const handleSetMode = react.useCallback(
|
|
8525
8525
|
(nextMode) => {
|
|
8526
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8526
|
+
if (mode === "present" && nextMode !== "present" && !chunkKA35ZMIP_js.mayLeaveSlideShow()) {
|
|
8527
8527
|
return;
|
|
8528
8528
|
}
|
|
8529
8529
|
if (nextMode === "present") {
|
|
8530
8530
|
presentation.enterPresentMode();
|
|
8531
8531
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8532
|
-
|
|
8532
|
+
chunkKA35ZMIP_js.stopAllPersistentAudio();
|
|
8533
8533
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8534
8534
|
if (promptKeepInkAnnotations) {
|
|
8535
8535
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8538,7 +8538,7 @@ function useAnnotationHandlers(input) {
|
|
|
8538
8538
|
}
|
|
8539
8539
|
} else {
|
|
8540
8540
|
if (mode === "present") {
|
|
8541
|
-
|
|
8541
|
+
chunkKA35ZMIP_js.stopAllPersistentAudio();
|
|
8542
8542
|
}
|
|
8543
8543
|
setMode(nextMode);
|
|
8544
8544
|
}
|
|
@@ -8604,13 +8604,13 @@ function useSerialize(input) {
|
|
|
8604
8604
|
let processedSlide = slide;
|
|
8605
8605
|
if (pendingEditId) {
|
|
8606
8606
|
const updatedElements = slide.elements.map((el) => {
|
|
8607
|
-
if (el.id !== pendingEditId || !
|
|
8607
|
+
if (el.id !== pendingEditId || !chunkKA35ZMIP_js.hasTextProperties(el)) {
|
|
8608
8608
|
return el;
|
|
8609
8609
|
}
|
|
8610
8610
|
return {
|
|
8611
8611
|
...el,
|
|
8612
8612
|
text: pendingEditText,
|
|
8613
|
-
textSegments:
|
|
8613
|
+
textSegments: chunkKA35ZMIP_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8614
8614
|
};
|
|
8615
8615
|
});
|
|
8616
8616
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8623,14 +8623,14 @@ function useSerialize(input) {
|
|
|
8623
8623
|
const pptxGuides = guides.map((g) => ({
|
|
8624
8624
|
id: g.id,
|
|
8625
8625
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8626
|
-
positionEmu:
|
|
8626
|
+
positionEmu: chunkKA35ZMIP_js.guidePxToEmu(g.position)
|
|
8627
8627
|
}));
|
|
8628
8628
|
return {
|
|
8629
8629
|
...processedSlide,
|
|
8630
8630
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8631
8631
|
};
|
|
8632
8632
|
});
|
|
8633
|
-
const slidesToSave =
|
|
8633
|
+
const slidesToSave = chunkHZSUTVDQ_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8634
8634
|
const saveOptions = {
|
|
8635
8635
|
headerFooter,
|
|
8636
8636
|
presentationProperties,
|
|
@@ -8799,7 +8799,7 @@ function usePresentationSetup(input) {
|
|
|
8799
8799
|
containerRef,
|
|
8800
8800
|
content,
|
|
8801
8801
|
onSetMode: (nextMode) => {
|
|
8802
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8802
|
+
if (mode === "present" && nextMode !== "present" && !chunkKA35ZMIP_js.mayLeaveSlideShow()) {
|
|
8803
8803
|
return;
|
|
8804
8804
|
}
|
|
8805
8805
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8807,7 +8807,7 @@ function usePresentationSetup(input) {
|
|
|
8807
8807
|
setShowKeepAnnotationsDialog(true);
|
|
8808
8808
|
} else {
|
|
8809
8809
|
if (mode === "present" && nextMode !== "present") {
|
|
8810
|
-
|
|
8810
|
+
chunkKA35ZMIP_js.stopAllPersistentAudio();
|
|
8811
8811
|
stopAnimationSound();
|
|
8812
8812
|
}
|
|
8813
8813
|
setMode(nextMode);
|
|
@@ -8861,10 +8861,10 @@ function usePresentationSetup(input) {
|
|
|
8861
8861
|
onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
|
|
8862
8862
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8863
8863
|
onSaveRehearsalTimings: (timings) => {
|
|
8864
|
-
setSlides((prev) =>
|
|
8864
|
+
setSlides((prev) => chunkKA35ZMIP_js.applyRehearsalTimings(prev, timings));
|
|
8865
8865
|
history.markDirty();
|
|
8866
8866
|
},
|
|
8867
|
-
loopContinuously:
|
|
8867
|
+
loopContinuously: chunkKA35ZMIP_js.shouldLoopContinuously(presentationProperties),
|
|
8868
8868
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8869
8869
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8870
8870
|
endWithBlackSlide
|
|
@@ -9028,7 +9028,7 @@ function useEditorOperations(input) {
|
|
|
9028
9028
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9029
9029
|
react.useEffect(() => {
|
|
9030
9030
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9031
|
-
copiedFormatRef.current =
|
|
9031
|
+
copiedFormatRef.current = chunkKA35ZMIP_js.copyFormatFromElement(selectedElement);
|
|
9032
9032
|
} else if (!formatPainterActive) {
|
|
9033
9033
|
copiedFormatRef.current = null;
|
|
9034
9034
|
}
|
|
@@ -9054,12 +9054,12 @@ function useEditorOperations(input) {
|
|
|
9054
9054
|
e.stopPropagation();
|
|
9055
9055
|
const element = elementLookup.get(elementId);
|
|
9056
9056
|
if (element) {
|
|
9057
|
-
const updated =
|
|
9057
|
+
const updated = chunkKA35ZMIP_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9058
9058
|
const updates = {};
|
|
9059
|
-
if (
|
|
9059
|
+
if (chunkKA35ZMIP_js.hasShapeProperties(updated)) {
|
|
9060
9060
|
updates.shapeStyle = updated.shapeStyle;
|
|
9061
9061
|
}
|
|
9062
|
-
if (
|
|
9062
|
+
if (chunkKA35ZMIP_js.hasTextProperties(updated)) {
|
|
9063
9063
|
updates.textStyle = updated.textStyle;
|
|
9064
9064
|
}
|
|
9065
9065
|
ops.updateElementById(elementId, updates);
|
|
@@ -9208,7 +9208,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9208
9208
|
const families = /* @__PURE__ */ new Set();
|
|
9209
9209
|
for (const slide of slides) {
|
|
9210
9210
|
for (const el of slide.elements) {
|
|
9211
|
-
if (
|
|
9211
|
+
if (chunkKA35ZMIP_js.hasTextProperties(el) && el.textSegments) {
|
|
9212
9212
|
for (const seg of el.textSegments) {
|
|
9213
9213
|
if (seg.style.fontFamily) {
|
|
9214
9214
|
families.add(seg.style.fontFamily);
|
|
@@ -9420,13 +9420,13 @@ function useKeyboardShortcuts(input) {
|
|
|
9420
9420
|
inputRef.current = input;
|
|
9421
9421
|
const handleKeyDown = react.useCallback((e) => {
|
|
9422
9422
|
const current = inputRef.current;
|
|
9423
|
-
const { action, dx, dy } =
|
|
9423
|
+
const { action, dx, dy } = chunkKA35ZMIP_js.mapEditorKey(e, {
|
|
9424
9424
|
canEdit: current.canEdit,
|
|
9425
9425
|
isPresenting: current.mode !== "edit",
|
|
9426
9426
|
hasSelection: current.hasSelection,
|
|
9427
9427
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9428
9428
|
isDrawing: current.activeTool !== "select",
|
|
9429
|
-
isTextInputTarget:
|
|
9429
|
+
isTextInputTarget: chunkKA35ZMIP_js.isEditorTextInputTarget(e.target)
|
|
9430
9430
|
});
|
|
9431
9431
|
if (action === null) {
|
|
9432
9432
|
return;
|
|
@@ -9719,7 +9719,7 @@ function useViewerIntegration(input) {
|
|
|
9719
9719
|
return zoom.scale;
|
|
9720
9720
|
},
|
|
9721
9721
|
setZoom(level) {
|
|
9722
|
-
zoom.setScale(
|
|
9722
|
+
zoom.setScale(chunkKA35ZMIP_js.clampZoomScale(level));
|
|
9723
9723
|
},
|
|
9724
9724
|
zoomIn() {
|
|
9725
9725
|
zoom.handleZoomIn();
|
|
@@ -9934,7 +9934,7 @@ function useReducedMotion() {
|
|
|
9934
9934
|
}
|
|
9935
9935
|
function useViewerOptions() {
|
|
9936
9936
|
const storeRef = react.useRef(null);
|
|
9937
|
-
storeRef.current ??=
|
|
9937
|
+
storeRef.current ??= chunkKA35ZMIP_js.createViewerOptionsStore();
|
|
9938
9938
|
const store = storeRef.current;
|
|
9939
9939
|
const options = react.useSyncExternalStore(
|
|
9940
9940
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9943,9 +9943,9 @@ function useViewerOptions() {
|
|
|
9943
9943
|
);
|
|
9944
9944
|
return { optionsStore: store, options };
|
|
9945
9945
|
}
|
|
9946
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9946
|
+
var KNOWN_TAB_IDS = new Set(chunkKA35ZMIP_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9947
9947
|
function computeToolbarVisibility(hiddenActions) {
|
|
9948
|
-
const isHidden = (id) =>
|
|
9948
|
+
const isHidden = (id) => chunkKA35ZMIP_js.isActionHidden(id, hiddenActions);
|
|
9949
9949
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
9950
9950
|
return { isHidden, isTabVisible };
|
|
9951
9951
|
}
|
|
@@ -10030,12 +10030,12 @@ function useYjsDocumentSync({
|
|
|
10030
10030
|
return;
|
|
10031
10031
|
}
|
|
10032
10032
|
try {
|
|
10033
|
-
const handler = new
|
|
10033
|
+
const handler = new chunkKA35ZMIP_js.PptxHandler();
|
|
10034
10034
|
await handler.load(sourceBytes.buffer);
|
|
10035
|
-
const currentSlides =
|
|
10035
|
+
const currentSlides = chunkKA35ZMIP_js.readSlidesFromYDoc(
|
|
10036
10036
|
doc
|
|
10037
10037
|
);
|
|
10038
|
-
const slidesToSave =
|
|
10038
|
+
const slidesToSave = chunkHZSUTVDQ_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10039
10039
|
const bytes = await handler.save(slidesToSave);
|
|
10040
10040
|
config.onWriteBack(bytes);
|
|
10041
10041
|
} catch {
|
|
@@ -10050,7 +10050,7 @@ function useYjsDocumentSync({
|
|
|
10050
10050
|
if (!doc || !isConnected) {
|
|
10051
10051
|
return;
|
|
10052
10052
|
}
|
|
10053
|
-
const docSlides =
|
|
10053
|
+
const docSlides = chunkKA35ZMIP_js.readSlidesFromYDoc(
|
|
10054
10054
|
doc
|
|
10055
10055
|
);
|
|
10056
10056
|
if (docSlides.length === 0) {
|
|
@@ -10072,11 +10072,11 @@ function useYjsDocumentSync({
|
|
|
10072
10072
|
lastSyncedRef.current = serialized;
|
|
10073
10073
|
void (async () => {
|
|
10074
10074
|
const factories = await getFactories();
|
|
10075
|
-
|
|
10075
|
+
chunkKA35ZMIP_js.reconcileSlidesInYDoc(
|
|
10076
10076
|
slides,
|
|
10077
10077
|
doc,
|
|
10078
10078
|
factories,
|
|
10079
|
-
|
|
10079
|
+
chunkKA35ZMIP_js.LOCAL_SYNC_ORIGIN
|
|
10080
10080
|
);
|
|
10081
10081
|
scheduleWriteBack();
|
|
10082
10082
|
})();
|
|
@@ -10090,10 +10090,10 @@ function useYjsDocumentSync({
|
|
|
10090
10090
|
return;
|
|
10091
10091
|
}
|
|
10092
10092
|
const handleChange = (_events, transaction) => {
|
|
10093
|
-
if (transaction?.origin ===
|
|
10093
|
+
if (transaction?.origin === chunkKA35ZMIP_js.LOCAL_SYNC_ORIGIN) {
|
|
10094
10094
|
return;
|
|
10095
10095
|
}
|
|
10096
|
-
const remoteSlides =
|
|
10096
|
+
const remoteSlides = chunkKA35ZMIP_js.readSlidesFromYDoc(
|
|
10097
10097
|
doc
|
|
10098
10098
|
);
|
|
10099
10099
|
if (remoteSlides.length === 0) {
|
|
@@ -10109,7 +10109,7 @@ function useYjsDocumentSync({
|
|
|
10109
10109
|
isApplyingRemoteRef.current = false;
|
|
10110
10110
|
scheduleWriteBack();
|
|
10111
10111
|
};
|
|
10112
|
-
const unobserve =
|
|
10112
|
+
const unobserve = chunkKA35ZMIP_js.observeYDocSlides(
|
|
10113
10113
|
doc,
|
|
10114
10114
|
handleChange
|
|
10115
10115
|
);
|
|
@@ -10147,7 +10147,7 @@ function useBroadcastFollower({
|
|
|
10147
10147
|
if (!broadcaster) {
|
|
10148
10148
|
return;
|
|
10149
10149
|
}
|
|
10150
|
-
if (!
|
|
10150
|
+
if (!chunkKA35ZMIP_js.shouldAutoFollowBroadcaster({
|
|
10151
10151
|
localRole: collab.config.role,
|
|
10152
10152
|
broadcasterRole: broadcaster.role
|
|
10153
10153
|
})) {
|
|
@@ -10307,10 +10307,10 @@ function useTouchGestures(input) {
|
|
|
10307
10307
|
if (!el || !enabled) {
|
|
10308
10308
|
return;
|
|
10309
10309
|
}
|
|
10310
|
-
const recognizer =
|
|
10310
|
+
const recognizer = chunkKA35ZMIP_js.createTouchGestureRecognizer({
|
|
10311
10311
|
getScale: () => scaleRef.current,
|
|
10312
|
-
minScale:
|
|
10313
|
-
maxScale:
|
|
10312
|
+
minScale: chunkKA35ZMIP_js.MIN_ZOOM_SCALE,
|
|
10313
|
+
maxScale: chunkKA35ZMIP_js.MAX_ZOOM_SCALE,
|
|
10314
10314
|
callbacks: {
|
|
10315
10315
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10316
10316
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10350,7 +10350,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10350
10350
|
return;
|
|
10351
10351
|
}
|
|
10352
10352
|
const rect = active.getBoundingClientRect();
|
|
10353
|
-
const delta =
|
|
10353
|
+
const delta = chunkKA35ZMIP_js.computeScrollDelta(
|
|
10354
10354
|
{ top: rect.top, bottom: rect.bottom },
|
|
10355
10355
|
window.innerHeight,
|
|
10356
10356
|
keyboardInset
|
|
@@ -10370,8 +10370,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10370
10370
|
return;
|
|
10371
10371
|
}
|
|
10372
10372
|
const update = () => {
|
|
10373
|
-
const metrics =
|
|
10374
|
-
const inset = metrics ?
|
|
10373
|
+
const metrics = chunkKA35ZMIP_js.readViewportMetrics(window);
|
|
10374
|
+
const inset = metrics ? chunkKA35ZMIP_js.computeKeyboardInset(metrics) : 0;
|
|
10375
10375
|
setKeyboardInset(inset);
|
|
10376
10376
|
if (inset > 0) {
|
|
10377
10377
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10382,8 +10382,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10382
10382
|
vv.addEventListener("scroll", update);
|
|
10383
10383
|
const onFocusIn = () => {
|
|
10384
10384
|
window.requestAnimationFrame(() => {
|
|
10385
|
-
const metrics =
|
|
10386
|
-
const inset = metrics ?
|
|
10385
|
+
const metrics = chunkKA35ZMIP_js.readViewportMetrics(window);
|
|
10386
|
+
const inset = metrics ? chunkKA35ZMIP_js.computeKeyboardInset(metrics) : 0;
|
|
10387
10387
|
if (inset > 0) {
|
|
10388
10388
|
scrollFocusedIntoView(inset);
|
|
10389
10389
|
}
|
|
@@ -10396,7 +10396,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10396
10396
|
document.removeEventListener("focusin", onFocusIn);
|
|
10397
10397
|
};
|
|
10398
10398
|
}, [enabled]);
|
|
10399
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10399
|
+
return { keyboardInset, isKeyboardOpen: chunkKA35ZMIP_js.isKeyboardOpen(keyboardInset) };
|
|
10400
10400
|
}
|
|
10401
10401
|
|
|
10402
10402
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10423,7 +10423,7 @@ function buildCanvasProps(input) {
|
|
|
10423
10423
|
} = input;
|
|
10424
10424
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10425
10425
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10426
|
-
const fieldContext =
|
|
10426
|
+
const fieldContext = chunkKA35ZMIP_js.buildFieldSubstitutionContext({
|
|
10427
10427
|
headerFooter: s.headerFooter,
|
|
10428
10428
|
customProperties: s.customProperties,
|
|
10429
10429
|
slide: activeSlide
|
|
@@ -10433,13 +10433,13 @@ function buildCanvasProps(input) {
|
|
|
10433
10433
|
if (mode === "present") {
|
|
10434
10434
|
presentation.handlePresentationAction(action);
|
|
10435
10435
|
} else if (action.url) {
|
|
10436
|
-
|
|
10436
|
+
chunkKA35ZMIP_js.safeOpenUrl(action.url);
|
|
10437
10437
|
}
|
|
10438
10438
|
};
|
|
10439
10439
|
const handleHyperlinkClick = (url) => {
|
|
10440
|
-
if (
|
|
10440
|
+
if (chunkKA35ZMIP_js.isPpactionUrl(url)) {
|
|
10441
10441
|
if (mode === "present") {
|
|
10442
|
-
const parsed =
|
|
10442
|
+
const parsed = chunkKA35ZMIP_js.parsePpactionUrl(url);
|
|
10443
10443
|
if (parsed) {
|
|
10444
10444
|
presentation.handlePresentationAction({
|
|
10445
10445
|
action: parsed.action,
|
|
@@ -10449,7 +10449,7 @@ function buildCanvasProps(input) {
|
|
|
10449
10449
|
}
|
|
10450
10450
|
return;
|
|
10451
10451
|
}
|
|
10452
|
-
|
|
10452
|
+
chunkKA35ZMIP_js.safeOpenUrl(url);
|
|
10453
10453
|
};
|
|
10454
10454
|
return {
|
|
10455
10455
|
activeSlide: effectiveSlide,
|
|
@@ -10592,7 +10592,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10592
10592
|
const current = activeSlide.animations ?? [];
|
|
10593
10593
|
if (group === "motionPath") {
|
|
10594
10594
|
propertyHandlers.handleUpdateSlide({
|
|
10595
|
-
animations:
|
|
10595
|
+
animations: chunkKA35ZMIP_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10596
10596
|
});
|
|
10597
10597
|
return;
|
|
10598
10598
|
}
|
|
@@ -10787,7 +10787,7 @@ function buildToolbarProps(input) {
|
|
|
10787
10787
|
onOpenFile,
|
|
10788
10788
|
onOpenRecentFile,
|
|
10789
10789
|
onCreatePresentation: (templateId) => {
|
|
10790
|
-
s.setSlides(
|
|
10790
|
+
s.setSlides(chunkKA35ZMIP_js.createBackstagePresentation(templateId));
|
|
10791
10791
|
s.setActiveSlideIndex(0);
|
|
10792
10792
|
s.setSelectedElementId(null);
|
|
10793
10793
|
s.setSelectedElementIds([]);
|
|
@@ -10814,7 +10814,7 @@ function buildToolbarProps(input) {
|
|
|
10814
10814
|
layoutOptions: scopedLayoutOptions,
|
|
10815
10815
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10816
10816
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10817
|
-
templateScheme:
|
|
10817
|
+
templateScheme: chunkKA35ZMIP_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10818
10818
|
customShows: s.customShows,
|
|
10819
10819
|
activeCustomShowId: s.activeCustomShowId,
|
|
10820
10820
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -10846,7 +10846,7 @@ function buildToolbarProps(input) {
|
|
|
10846
10846
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10847
10847
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10848
10848
|
formatPainterActive: s.formatPainterActive,
|
|
10849
|
-
canActivateFormatPainter:
|
|
10849
|
+
canActivateFormatPainter: chunkKA35ZMIP_js.hasCopyableFormat(selectedElement),
|
|
10850
10850
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10851
10851
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10852
10852
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11115,7 +11115,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11115
11115
|
}, [incomingContent]);
|
|
11116
11116
|
const onOpenFile = react.useCallback(() => {
|
|
11117
11117
|
void (async () => {
|
|
11118
|
-
const picked = await
|
|
11118
|
+
const picked = await chunkKA35ZMIP_js.openPptxFile();
|
|
11119
11119
|
if (picked) {
|
|
11120
11120
|
setContent(picked.buffer);
|
|
11121
11121
|
}
|
|
@@ -11123,7 +11123,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11123
11123
|
}, []);
|
|
11124
11124
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11125
11125
|
void (async () => {
|
|
11126
|
-
const bytes = await
|
|
11126
|
+
const bytes = await chunkKA35ZMIP_js.readBackstageRecentFile(key);
|
|
11127
11127
|
if (bytes) {
|
|
11128
11128
|
setContent(bytes);
|
|
11129
11129
|
}
|