pptx-react-viewer 2.5.2 → 2.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/{AiChatPanel-OHSLJNYG.js → AiChatPanel-DPMHPOWF.js} +22 -22
- package/dist/AiChatPanel-DPMHPOWF.js.br +0 -0
- package/dist/AiChatPanel-DPMHPOWF.js.gz +0 -0
- package/dist/{AiChatPanel-EMF3UYCE.mjs → AiChatPanel-OFOOWR4U.mjs} +3 -3
- package/dist/AiChatPanel-OFOOWR4U.mjs.br +0 -0
- package/dist/AiChatPanel-OFOOWR4U.mjs.gz +0 -0
- package/dist/{Model3DScene-X6QJTWHV.mjs → Model3DScene-P4OKVQBF.mjs} +1 -1
- package/dist/Model3DScene-P4OKVQBF.mjs.br +0 -0
- package/dist/Model3DScene-P4OKVQBF.mjs.gz +0 -0
- package/dist/{Model3DScene-ULHIJPMU.js → Model3DScene-PD2MDBIE.js} +2 -2
- package/dist/Model3DScene-PD2MDBIE.js.br +0 -0
- package/dist/Model3DScene-PD2MDBIE.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-K7Q5NYZ4.js → SurfaceChart3DScene-FECS3THE.js} +2 -2
- package/dist/SurfaceChart3DScene-FECS3THE.js.br +0 -0
- package/dist/SurfaceChart3DScene-FECS3THE.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-PRCKQJQQ.mjs → SurfaceChart3DScene-TL4ZIOI4.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-PRCKQJQQ.mjs.br → SurfaceChart3DScene-TL4ZIOI4.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-TL4ZIOI4.mjs.gz +0 -0
- package/dist/{chunk-LTEDT475.js → chunk-23Q3I2LM.js} +17 -13
- package/dist/chunk-23Q3I2LM.js.br +0 -0
- package/dist/chunk-23Q3I2LM.js.gz +0 -0
- package/dist/{chunk-VOV2N3NY.mjs → chunk-6KOM27PS.mjs} +17 -13
- package/dist/chunk-6KOM27PS.mjs.br +0 -0
- package/dist/chunk-6KOM27PS.mjs.gz +0 -0
- package/dist/{chunk-HDKHZKSW.mjs → chunk-F3JUUSC4.mjs} +7 -7
- package/dist/chunk-F3JUUSC4.mjs.br +0 -0
- package/dist/chunk-F3JUUSC4.mjs.gz +0 -0
- package/dist/{chunk-NVH3RIN7.js → chunk-FFLUALX5.js} +235 -235
- package/dist/chunk-FFLUALX5.js.br +0 -0
- package/dist/chunk-FFLUALX5.js.gz +0 -0
- package/dist/{chunk-MJAEB43A.js → chunk-H2FZ2NJ7.js} +3 -3
- package/dist/chunk-H2FZ2NJ7.js.br +0 -0
- package/dist/chunk-H2FZ2NJ7.js.gz +0 -0
- package/dist/{chunk-TGVID6BB.mjs → chunk-QDIF3ZXF.mjs} +2 -2
- package/dist/chunk-QDIF3ZXF.mjs.br +0 -0
- package/dist/chunk-QDIF3ZXF.mjs.gz +0 -0
- package/dist/{chunk-WJKMTDXS.mjs → chunk-SAXG53MO.mjs} +1 -1
- package/dist/chunk-SAXG53MO.mjs.br +0 -0
- package/dist/chunk-SAXG53MO.mjs.gz +0 -0
- package/dist/{chunk-OSSVKJGF.js → chunk-USHZUHHG.js} +843 -843
- package/dist/chunk-USHZUHHG.js.br +0 -0
- package/dist/chunk-USHZUHHG.js.gz +0 -0
- package/dist/{chunk-7Q7AEPO7.js → chunk-UUS7QT22.js} +313 -313
- package/dist/chunk-UUS7QT22.js.br +0 -0
- package/dist/chunk-UUS7QT22.js.gz +0 -0
- package/dist/{chunk-LIQGO45T.mjs → chunk-ZZA62IND.mjs} +2 -2
- package/dist/chunk-ZZA62IND.mjs.br +0 -0
- package/dist/chunk-ZZA62IND.mjs.gz +0 -0
- package/dist/index.js +34 -34
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.js +21 -21
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +3 -3
- package/dist/AiChatPanel-EMF3UYCE.mjs.br +0 -0
- package/dist/AiChatPanel-EMF3UYCE.mjs.gz +0 -0
- package/dist/AiChatPanel-OHSLJNYG.js.br +0 -0
- package/dist/AiChatPanel-OHSLJNYG.js.gz +0 -0
- package/dist/Model3DScene-ULHIJPMU.js.br +0 -0
- package/dist/Model3DScene-ULHIJPMU.js.gz +0 -0
- package/dist/Model3DScene-X6QJTWHV.mjs.br +0 -0
- package/dist/Model3DScene-X6QJTWHV.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-K7Q5NYZ4.js.br +0 -0
- package/dist/SurfaceChart3DScene-K7Q5NYZ4.js.gz +0 -0
- package/dist/SurfaceChart3DScene-PRCKQJQQ.mjs.gz +0 -0
- package/dist/chunk-7Q7AEPO7.js.br +0 -0
- package/dist/chunk-7Q7AEPO7.js.gz +0 -0
- package/dist/chunk-HDKHZKSW.mjs.br +0 -0
- package/dist/chunk-HDKHZKSW.mjs.gz +0 -0
- package/dist/chunk-LIQGO45T.mjs.br +0 -0
- package/dist/chunk-LIQGO45T.mjs.gz +0 -0
- package/dist/chunk-LTEDT475.js.br +0 -0
- package/dist/chunk-LTEDT475.js.gz +0 -0
- package/dist/chunk-MJAEB43A.js.br +0 -0
- package/dist/chunk-MJAEB43A.js.gz +0 -0
- package/dist/chunk-NVH3RIN7.js.br +0 -0
- package/dist/chunk-NVH3RIN7.js.gz +0 -0
- package/dist/chunk-OSSVKJGF.js.br +0 -0
- package/dist/chunk-OSSVKJGF.js.gz +0 -0
- package/dist/chunk-TGVID6BB.mjs.br +0 -0
- package/dist/chunk-TGVID6BB.mjs.gz +0 -0
- package/dist/chunk-VOV2N3NY.mjs.br +0 -0
- package/dist/chunk-VOV2N3NY.mjs.gz +0 -0
- package/dist/chunk-WJKMTDXS.mjs.br +0 -0
- package/dist/chunk-WJKMTDXS.mjs.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkFFLUALX5_js = require('./chunk-FFLUALX5.js');
|
|
4
4
|
var chunk25VSL2BB_js = require('./chunk-25VSL2BB.js');
|
|
5
|
-
var
|
|
5
|
+
var chunk23Q3I2LM_js = require('./chunk-23Q3I2LM.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 = chunk23Q3I2LM_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 = chunk23Q3I2LM_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
|
|
48
48
|
const safeItemHeight = Math.max(itemHeight, 1);
|
|
49
49
|
const scrollToIndex = react.useCallback(
|
|
50
50
|
(index, behavior = "smooth") => {
|
|
@@ -107,7 +107,7 @@ function usePresenceTracking({
|
|
|
107
107
|
awareness.setLocalStateField("presence", state);
|
|
108
108
|
lastBroadcastRef.current = Date.now();
|
|
109
109
|
};
|
|
110
|
-
if (elapsed >=
|
|
110
|
+
if (elapsed >= chunk23Q3I2LM_js.BROADCAST_THROTTLE_MS) {
|
|
111
111
|
if (pendingBroadcastRef.current) {
|
|
112
112
|
clearTimeout(pendingBroadcastRef.current);
|
|
113
113
|
pendingBroadcastRef.current = null;
|
|
@@ -117,7 +117,7 @@ function usePresenceTracking({
|
|
|
117
117
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
118
118
|
pendingBroadcastRef.current = null;
|
|
119
119
|
flush();
|
|
120
|
-
},
|
|
120
|
+
}, chunk23Q3I2LM_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -142,7 +142,7 @@ function usePresenceTracking({
|
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
144
|
const handleChange = () => {
|
|
145
|
-
const users =
|
|
145
|
+
const users = chunk23Q3I2LM_js.derivePresenceList(
|
|
146
146
|
awareness.getStates(),
|
|
147
147
|
localClientId,
|
|
148
148
|
canvasWidth,
|
|
@@ -194,7 +194,7 @@ function useYjsProvider({ config }) {
|
|
|
194
194
|
const departureRef = react.useRef(null);
|
|
195
195
|
const gateRef = react.useRef(null);
|
|
196
196
|
if (!gateRef.current) {
|
|
197
|
-
gateRef.current =
|
|
197
|
+
gateRef.current = chunk23Q3I2LM_js.createSyncGate(() => setSynced(true));
|
|
198
198
|
}
|
|
199
199
|
const teardown = react.useCallback(() => {
|
|
200
200
|
if (timeoutRef.current) {
|
|
@@ -214,7 +214,7 @@ function useYjsProvider({ config }) {
|
|
|
214
214
|
const buildCleanup = react.useCallback(
|
|
215
215
|
(provider, yDoc) => () => {
|
|
216
216
|
announceDeparture();
|
|
217
|
-
|
|
217
|
+
chunk23Q3I2LM_js.clearLocalAwareness(provider.awareness);
|
|
218
218
|
provider.destroy();
|
|
219
219
|
yDoc.destroy();
|
|
220
220
|
setDoc(null);
|
|
@@ -239,9 +239,9 @@ function useYjsProvider({ config }) {
|
|
|
239
239
|
if (config.authToken) {
|
|
240
240
|
opts.password = config.authToken;
|
|
241
241
|
}
|
|
242
|
-
const roomId =
|
|
242
|
+
const roomId = chunk23Q3I2LM_js.validateRoomId(config.roomId);
|
|
243
243
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
244
|
-
departureRef.current =
|
|
244
|
+
departureRef.current = chunk23Q3I2LM_js.createDepartureChannel(roomId, provider.awareness);
|
|
245
245
|
setDoc(yDoc);
|
|
246
246
|
setAwareness(provider.awareness);
|
|
247
247
|
setClientId(provider.awareness.clientID);
|
|
@@ -283,13 +283,13 @@ function useYjsProvider({ config }) {
|
|
|
283
283
|
if (!config) {
|
|
284
284
|
return;
|
|
285
285
|
}
|
|
286
|
-
const roomId =
|
|
287
|
-
const transport = config.transport ??
|
|
286
|
+
const roomId = chunk23Q3I2LM_js.validateRoomId(config.roomId);
|
|
287
|
+
const transport = config.transport ?? chunk23Q3I2LM_js.resolveTransportForServerUrl(config.serverUrl);
|
|
288
288
|
if (transport === "webrtc") {
|
|
289
289
|
await initWebrtc();
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
if (
|
|
292
|
+
if (chunk23Q3I2LM_js.isMixedContentBlocked(config.serverUrl)) {
|
|
293
293
|
console.warn(
|
|
294
294
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
295
295
|
);
|
|
@@ -303,7 +303,7 @@ function useYjsProvider({ config }) {
|
|
|
303
303
|
const provider = new WebsocketProvider(config.serverUrl, roomId, yDoc, {
|
|
304
304
|
params: config.authToken ? { token: config.authToken } : void 0
|
|
305
305
|
});
|
|
306
|
-
departureRef.current =
|
|
306
|
+
departureRef.current = chunk23Q3I2LM_js.createDepartureChannel(roomId, provider.awareness);
|
|
307
307
|
let connected = false;
|
|
308
308
|
const handleStatus = (event) => {
|
|
309
309
|
if (event.status === "connected") {
|
|
@@ -343,7 +343,7 @@ function useYjsProvider({ config }) {
|
|
|
343
343
|
provider.off("status", handleStatus);
|
|
344
344
|
provider.off("sync", handleSynced);
|
|
345
345
|
announceDeparture();
|
|
346
|
-
|
|
346
|
+
chunk23Q3I2LM_js.clearLocalAwareness(provider.awareness);
|
|
347
347
|
provider.destroy();
|
|
348
348
|
yDoc.destroy();
|
|
349
349
|
setDoc(null);
|
|
@@ -352,7 +352,7 @@ function useYjsProvider({ config }) {
|
|
|
352
352
|
cleanupRef.current = null;
|
|
353
353
|
setStatus("error");
|
|
354
354
|
}
|
|
355
|
-
},
|
|
355
|
+
}, chunk23Q3I2LM_js.CONNECTION_TIMEOUT_MS);
|
|
356
356
|
}
|
|
357
357
|
setDoc(yDoc);
|
|
358
358
|
setAwareness(provider.awareness);
|
|
@@ -361,7 +361,7 @@ function useYjsProvider({ config }) {
|
|
|
361
361
|
provider.off("status", handleStatus);
|
|
362
362
|
provider.off("sync", handleSynced);
|
|
363
363
|
announceDeparture();
|
|
364
|
-
|
|
364
|
+
chunk23Q3I2LM_js.clearLocalAwareness(provider.awareness);
|
|
365
365
|
provider.destroy();
|
|
366
366
|
yDoc.destroy();
|
|
367
367
|
setDoc(null);
|
|
@@ -387,7 +387,7 @@ function useYjsProvider({ config }) {
|
|
|
387
387
|
]);
|
|
388
388
|
react.useEffect(() => {
|
|
389
389
|
init();
|
|
390
|
-
const disposeTeardown =
|
|
390
|
+
const disposeTeardown = chunk23Q3I2LM_js.registerCollaborationTeardown({
|
|
391
391
|
leave: teardown,
|
|
392
392
|
rejoin: init
|
|
393
393
|
});
|
|
@@ -408,7 +408,7 @@ function useCollaborativeState({
|
|
|
408
408
|
canvasWidth,
|
|
409
409
|
canvasHeight
|
|
410
410
|
}) {
|
|
411
|
-
const userColor =
|
|
411
|
+
const userColor = chunk23Q3I2LM_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
412
412
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
413
413
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
414
414
|
awareness,
|
|
@@ -517,8 +517,8 @@ function useEditorHistory(input) {
|
|
|
517
517
|
width: canvasSize.width,
|
|
518
518
|
height: canvasSize.height,
|
|
519
519
|
activeSlideIndex,
|
|
520
|
-
slides: slides.map(
|
|
521
|
-
templateElementsBySlideId:
|
|
520
|
+
slides: slides.map(chunk23Q3I2LM_js.cloneSlide),
|
|
521
|
+
templateElementsBySlideId: chunk23Q3I2LM_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
522
522
|
...actionLabel ? { actionLabel } : {}
|
|
523
523
|
};
|
|
524
524
|
},
|
|
@@ -531,9 +531,9 @@ function useEditorHistory(input) {
|
|
|
531
531
|
width: snapshot.width,
|
|
532
532
|
height: snapshot.height
|
|
533
533
|
});
|
|
534
|
-
setSlides(snapshot.slides.map(
|
|
534
|
+
setSlides(snapshot.slides.map(chunk23Q3I2LM_js.cloneSlide));
|
|
535
535
|
setTemplateElementsBySlideId(
|
|
536
|
-
|
|
536
|
+
chunk23Q3I2LM_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
537
537
|
);
|
|
538
538
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
539
539
|
setSelectedElementIds([]);
|
|
@@ -567,8 +567,8 @@ function useEditorHistory(input) {
|
|
|
567
567
|
const currentSnapshot = buildHistorySnapshot();
|
|
568
568
|
historyFutureRef.current.push(currentSnapshot);
|
|
569
569
|
isApplyingHistoryRef.current = true;
|
|
570
|
-
const nextSnapshot =
|
|
571
|
-
lastHistorySnapshotRef.current =
|
|
570
|
+
const nextSnapshot = chunkFFLUALX5_js.cloneHistorySnapshot(previousSnapshot);
|
|
571
|
+
lastHistorySnapshotRef.current = chunkFFLUALX5_js.cloneHistorySnapshot(nextSnapshot);
|
|
572
572
|
lastHistorySerializedRef.current = JSON.stringify(nextSnapshot);
|
|
573
573
|
applyHistorySnapshot(nextSnapshot);
|
|
574
574
|
updateHistoryAvailability();
|
|
@@ -589,8 +589,8 @@ function useEditorHistory(input) {
|
|
|
589
589
|
const currentSnapshot = buildHistorySnapshot();
|
|
590
590
|
historyPastRef.current.push(currentSnapshot);
|
|
591
591
|
isApplyingHistoryRef.current = true;
|
|
592
|
-
const targetSnapshot =
|
|
593
|
-
lastHistorySnapshotRef.current =
|
|
592
|
+
const targetSnapshot = chunkFFLUALX5_js.cloneHistorySnapshot(nextSnapshot);
|
|
593
|
+
lastHistorySnapshotRef.current = chunkFFLUALX5_js.cloneHistorySnapshot(targetSnapshot);
|
|
594
594
|
lastHistorySerializedRef.current = JSON.stringify(targetSnapshot);
|
|
595
595
|
applyHistorySnapshot(targetSnapshot);
|
|
596
596
|
updateHistoryAvailability();
|
|
@@ -608,7 +608,7 @@ function useEditorHistory(input) {
|
|
|
608
608
|
historyPastRef.current = [];
|
|
609
609
|
historyFutureRef.current = [];
|
|
610
610
|
if (initialSnapshot) {
|
|
611
|
-
const clonedInitial =
|
|
611
|
+
const clonedInitial = chunkFFLUALX5_js.cloneHistorySnapshot(initialSnapshot);
|
|
612
612
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
613
613
|
lastHistorySerializedRef.current = JSON.stringify(clonedInitial);
|
|
614
614
|
} else {
|
|
@@ -649,18 +649,18 @@ function useEditorHistory(input) {
|
|
|
649
649
|
}
|
|
650
650
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
651
651
|
if (!previousSnapshot) {
|
|
652
|
-
lastHistorySnapshotRef.current =
|
|
652
|
+
lastHistorySnapshotRef.current = chunkFFLUALX5_js.cloneHistorySnapshot(snapshot);
|
|
653
653
|
lastHistorySerializedRef.current = serialized;
|
|
654
654
|
lastCheapHashRef.current = cheapHash;
|
|
655
655
|
updateHistoryAvailability();
|
|
656
656
|
return;
|
|
657
657
|
}
|
|
658
|
-
historyPastRef.current.push(
|
|
658
|
+
historyPastRef.current.push(chunkFFLUALX5_js.cloneHistorySnapshot(previousSnapshot));
|
|
659
659
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
660
660
|
historyPastRef.current.shift();
|
|
661
661
|
}
|
|
662
662
|
historyFutureRef.current = [];
|
|
663
|
-
lastHistorySnapshotRef.current =
|
|
663
|
+
lastHistorySnapshotRef.current = chunkFFLUALX5_js.cloneHistorySnapshot(snapshot);
|
|
664
664
|
lastHistorySerializedRef.current = serialized;
|
|
665
665
|
lastCheapHashRef.current = cheapHash;
|
|
666
666
|
updateHistoryAvailability();
|
|
@@ -749,7 +749,7 @@ function useZoomViewport({
|
|
|
749
749
|
if (!wrapper || !canvasViewport) {
|
|
750
750
|
return;
|
|
751
751
|
}
|
|
752
|
-
const boundedScale = Math.min(Math.max(nextScale,
|
|
752
|
+
const boundedScale = Math.min(Math.max(nextScale, chunkFFLUALX5_js.MIN_ZOOM_SCALE), chunkFFLUALX5_js.MAX_ZOOM_SCALE);
|
|
753
753
|
const nextEditorScale = fitScale * boundedScale;
|
|
754
754
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
755
755
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -764,10 +764,10 @@ function useZoomViewport({
|
|
|
764
764
|
[fitScale]
|
|
765
765
|
);
|
|
766
766
|
const handleZoomIn = react.useCallback(() => {
|
|
767
|
-
setScale((currentScale) => Math.min(currentScale + 0.1,
|
|
767
|
+
setScale((currentScale) => Math.min(currentScale + 0.1, chunkFFLUALX5_js.MAX_ZOOM_SCALE));
|
|
768
768
|
}, []);
|
|
769
769
|
const handleZoomOut = react.useCallback(() => {
|
|
770
|
-
setScale((currentScale) => Math.max(currentScale - 0.1,
|
|
770
|
+
setScale((currentScale) => Math.max(currentScale - 0.1, chunkFFLUALX5_js.MIN_ZOOM_SCALE));
|
|
771
771
|
}, []);
|
|
772
772
|
const handleResetZoom = react.useCallback(() => {
|
|
773
773
|
setScale(1);
|
|
@@ -786,22 +786,22 @@ function useZoomViewport({
|
|
|
786
786
|
selectedElements.forEach((element) => {
|
|
787
787
|
minX = Math.min(minX, element.x);
|
|
788
788
|
minY = Math.min(minY, element.y);
|
|
789
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
790
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
789
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkFFLUALX5_js.MIN_ELEMENT_SIZE));
|
|
790
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkFFLUALX5_js.MIN_ELEMENT_SIZE));
|
|
791
791
|
});
|
|
792
792
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
793
793
|
return;
|
|
794
794
|
}
|
|
795
795
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
796
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
797
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
796
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkFFLUALX5_js.MIN_ELEMENT_SIZE);
|
|
797
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkFFLUALX5_js.MIN_ELEMENT_SIZE);
|
|
798
798
|
const availableWidth = Math.max(
|
|
799
|
-
effectiveEditorDimensions.width -
|
|
800
|
-
|
|
799
|
+
effectiveEditorDimensions.width - chunkFFLUALX5_js.ZOOM_TO_SELECTION_PADDING,
|
|
800
|
+
chunkFFLUALX5_js.MIN_ELEMENT_SIZE
|
|
801
801
|
);
|
|
802
802
|
const availableHeight = Math.max(
|
|
803
|
-
effectiveEditorDimensions.height -
|
|
804
|
-
|
|
803
|
+
effectiveEditorDimensions.height - chunkFFLUALX5_js.ZOOM_TO_SELECTION_PADDING,
|
|
804
|
+
chunkFFLUALX5_js.MIN_ELEMENT_SIZE
|
|
805
805
|
);
|
|
806
806
|
const targetEditorScale = Math.min(
|
|
807
807
|
availableWidth / boundsWidth,
|
|
@@ -809,8 +809,8 @@ function useZoomViewport({
|
|
|
809
809
|
);
|
|
810
810
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
811
811
|
const nextScale = Math.min(
|
|
812
|
-
Math.max(targetEditorScale / safeFitScale,
|
|
813
|
-
|
|
812
|
+
Math.max(targetEditorScale / safeFitScale, chunkFFLUALX5_js.MIN_ZOOM_SCALE),
|
|
813
|
+
chunkFFLUALX5_js.MAX_ZOOM_SCALE
|
|
814
814
|
);
|
|
815
815
|
setScale(nextScale);
|
|
816
816
|
window.requestAnimationFrame(() => {
|
|
@@ -832,7 +832,7 @@ function useZoomViewport({
|
|
|
832
832
|
event.preventDefault();
|
|
833
833
|
const delta = event.deltaY * -1e-3;
|
|
834
834
|
setScale(
|
|
835
|
-
(currentScale) => Math.min(Math.max(currentScale + delta,
|
|
835
|
+
(currentScale) => Math.min(Math.max(currentScale + delta, chunkFFLUALX5_js.MIN_ZOOM_SCALE), chunkFFLUALX5_js.MAX_ZOOM_SCALE)
|
|
836
836
|
);
|
|
837
837
|
}, []);
|
|
838
838
|
react.useEffect(() => {
|
|
@@ -910,7 +910,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
910
910
|
const command = step.command;
|
|
911
911
|
const timer = window.setTimeout(
|
|
912
912
|
() => {
|
|
913
|
-
|
|
913
|
+
chunkFFLUALX5_js.executeMediaCommand(command);
|
|
914
914
|
},
|
|
915
915
|
Math.max(0, step.delayMs)
|
|
916
916
|
);
|
|
@@ -1026,7 +1026,7 @@ function useAnimationPlayback(input) {
|
|
|
1026
1026
|
(controller, group) => {
|
|
1027
1027
|
driveBuildReveal(
|
|
1028
1028
|
controller,
|
|
1029
|
-
|
|
1029
|
+
chunk23Q3I2LM_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1030
1030
|
setPresentationElementStates,
|
|
1031
1031
|
buildRafRef
|
|
1032
1032
|
);
|
|
@@ -1089,7 +1089,7 @@ function useAnimationPlayback(input) {
|
|
|
1089
1089
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1090
1090
|
return;
|
|
1091
1091
|
}
|
|
1092
|
-
const controller =
|
|
1092
|
+
const controller = chunk23Q3I2LM_js.PresentationAnimationController.fromSlide(slide);
|
|
1093
1093
|
controllerRef.current = controller;
|
|
1094
1094
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1095
1095
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1237,7 +1237,7 @@ function useAnimationPlayback(input) {
|
|
|
1237
1237
|
}))
|
|
1238
1238
|
);
|
|
1239
1239
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1240
|
-
const delay =
|
|
1240
|
+
const delay = chunk23Q3I2LM_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1241
1241
|
const timer = window.setTimeout(() => {
|
|
1242
1242
|
setPresentationAnimations(
|
|
1243
1243
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1274,12 +1274,12 @@ function useAnimationPlayback(input) {
|
|
|
1274
1274
|
presentationTimersRef
|
|
1275
1275
|
};
|
|
1276
1276
|
}
|
|
1277
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1278
|
-
var AUDIENCE_HASH =
|
|
1279
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1280
|
-
var AUDIENCE_NONCE_KEY =
|
|
1277
|
+
var PRESENTER_CHANNEL_NAME = chunk23Q3I2LM_js.PRESENTATION_CHANNEL_NAME;
|
|
1278
|
+
var AUDIENCE_HASH = chunk23Q3I2LM_js.PRESENTATION_HASH;
|
|
1279
|
+
var PRESENTER_MSG_ORIGIN = chunk23Q3I2LM_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1280
|
+
var AUDIENCE_NONCE_KEY = chunk23Q3I2LM_js.PRESENTATION_NONCE_KEY;
|
|
1281
1281
|
function generateSessionId() {
|
|
1282
|
-
return
|
|
1282
|
+
return chunk23Q3I2LM_js.createPresentationSessionId();
|
|
1283
1283
|
}
|
|
1284
1284
|
function parseAudienceNonce() {
|
|
1285
1285
|
const hash = window.location.hash;
|
|
@@ -1315,7 +1315,7 @@ function usePresenterWindow(input) {
|
|
|
1315
1315
|
}, []);
|
|
1316
1316
|
const swapDisplays = react.useCallback(async () => {
|
|
1317
1317
|
const audience = audienceWindowRef.current;
|
|
1318
|
-
return audience && !audience.closed ?
|
|
1318
|
+
return audience && !audience.closed ? chunk23Q3I2LM_js.swapPresentationWindows(window, audience) : false;
|
|
1319
1319
|
}, []);
|
|
1320
1320
|
const syncSlideToAudience = react.useCallback(
|
|
1321
1321
|
(slideIndex) => {
|
|
@@ -1379,7 +1379,7 @@ function usePresenterWindow(input) {
|
|
|
1379
1379
|
pollTimerRef.current = null;
|
|
1380
1380
|
}
|
|
1381
1381
|
if (closingSessionId) {
|
|
1382
|
-
void
|
|
1382
|
+
void chunk23Q3I2LM_js.clearAudienceContent(closingSessionId);
|
|
1383
1383
|
}
|
|
1384
1384
|
}, [getChannel]);
|
|
1385
1385
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1397,10 +1397,10 @@ function usePresenterWindow(input) {
|
|
|
1397
1397
|
audienceWindowRef.current = blankWin;
|
|
1398
1398
|
const sessionId = generateSessionId();
|
|
1399
1399
|
sessionIdRef.current = sessionId;
|
|
1400
|
-
const audienceUrl =
|
|
1401
|
-
void
|
|
1400
|
+
const audienceUrl = chunk23Q3I2LM_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1401
|
+
void chunk23Q3I2LM_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1402
1402
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1403
|
-
|
|
1403
|
+
chunk23Q3I2LM_js.placeAudienceWindow(blankWin, placement);
|
|
1404
1404
|
}
|
|
1405
1405
|
return void 0;
|
|
1406
1406
|
});
|
|
@@ -1430,7 +1430,7 @@ function usePresenterWindow(input) {
|
|
|
1430
1430
|
}
|
|
1431
1431
|
};
|
|
1432
1432
|
if (content) {
|
|
1433
|
-
void
|
|
1433
|
+
void chunk23Q3I2LM_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1434
1434
|
} else {
|
|
1435
1435
|
navigateOrClose(true);
|
|
1436
1436
|
}
|
|
@@ -1456,7 +1456,7 @@ function usePresenterWindow(input) {
|
|
|
1456
1456
|
}
|
|
1457
1457
|
const handleMessage = (event) => {
|
|
1458
1458
|
const message = event.data;
|
|
1459
|
-
if (
|
|
1459
|
+
if (chunk23Q3I2LM_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1460
1460
|
syncStateToAudience(snapshotRef.current);
|
|
1461
1461
|
}
|
|
1462
1462
|
};
|
|
@@ -1485,7 +1485,7 @@ function usePresenterWindow(input) {
|
|
|
1485
1485
|
react.useEffect(() => {
|
|
1486
1486
|
const handleBeforeUnload = () => {
|
|
1487
1487
|
if (sessionIdRef.current) {
|
|
1488
|
-
void
|
|
1488
|
+
void chunk23Q3I2LM_js.clearAudienceContent(sessionIdRef.current);
|
|
1489
1489
|
}
|
|
1490
1490
|
};
|
|
1491
1491
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1547,7 +1547,7 @@ function useAudienceMode(input) {
|
|
|
1547
1547
|
}
|
|
1548
1548
|
channel.onmessage = (event) => {
|
|
1549
1549
|
const data = event.data;
|
|
1550
|
-
if (!
|
|
1550
|
+
if (!chunk23Q3I2LM_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1551
1551
|
return;
|
|
1552
1552
|
}
|
|
1553
1553
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1563,16 +1563,16 @@ function useAudienceMode(input) {
|
|
|
1563
1563
|
}
|
|
1564
1564
|
if (data.type === "presenter-exit") {
|
|
1565
1565
|
if (expectedSessionId) {
|
|
1566
|
-
void
|
|
1566
|
+
void chunk23Q3I2LM_js.clearAudienceContent(expectedSessionId);
|
|
1567
1567
|
}
|
|
1568
|
-
if (
|
|
1568
|
+
if (chunk23Q3I2LM_js.endAudienceDisplay(window)) {
|
|
1569
1569
|
handlers.onPresenterEnded?.();
|
|
1570
1570
|
}
|
|
1571
1571
|
}
|
|
1572
1572
|
};
|
|
1573
1573
|
if (expectedSessionId) {
|
|
1574
1574
|
channel.postMessage({
|
|
1575
|
-
origin:
|
|
1575
|
+
origin: chunk23Q3I2LM_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1576
1576
|
type: "audience-ready",
|
|
1577
1577
|
sessionId: expectedSessionId
|
|
1578
1578
|
});
|
|
@@ -1604,14 +1604,14 @@ function usePresentationKeyboard(input) {
|
|
|
1604
1604
|
presentationSlideIndex,
|
|
1605
1605
|
setShowRehearsalSummary
|
|
1606
1606
|
} = input;
|
|
1607
|
-
const keyBufferRef = react.useRef(
|
|
1607
|
+
const keyBufferRef = react.useRef(chunk23Q3I2LM_js.createPresentationKeyBuffer());
|
|
1608
1608
|
react.useEffect(() => {
|
|
1609
|
-
if (mode !== "present" || !
|
|
1610
|
-
keyBufferRef.current =
|
|
1609
|
+
if (mode !== "present" || !chunk23Q3I2LM_js.acceptsPresentationInput()) {
|
|
1610
|
+
keyBufferRef.current = chunk23Q3I2LM_js.createPresentationKeyBuffer();
|
|
1611
1611
|
return;
|
|
1612
1612
|
}
|
|
1613
1613
|
const handleKeyDown = (event) => {
|
|
1614
|
-
const mapped =
|
|
1614
|
+
const mapped = chunk23Q3I2LM_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1615
1615
|
if (mapped.action === "none") {
|
|
1616
1616
|
return;
|
|
1617
1617
|
}
|
|
@@ -1819,7 +1819,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1819
1819
|
return;
|
|
1820
1820
|
}
|
|
1821
1821
|
if (action.url && !actionStr.includes("hlinksldjump")) {
|
|
1822
|
-
if (
|
|
1822
|
+
if (chunk23Q3I2LM_js.isUrlSafe(action.url)) {
|
|
1823
1823
|
window.open(action.url, "_blank", "noopener,noreferrer");
|
|
1824
1824
|
}
|
|
1825
1825
|
}
|
|
@@ -1829,7 +1829,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1829
1829
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1830
1830
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1831
1831
|
const transition = incomingSlide?.transition;
|
|
1832
|
-
const durationMs = deps.playTransition ?
|
|
1832
|
+
const durationMs = deps.playTransition ? chunk23Q3I2LM_js.resolveTransitionDurationMs(transition) : 0;
|
|
1833
1833
|
deps.clearPresentationTimers();
|
|
1834
1834
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1835
1835
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -2079,17 +2079,17 @@ function useZoomNavigation(input) {
|
|
|
2079
2079
|
};
|
|
2080
2080
|
}
|
|
2081
2081
|
function usePresenterConsole(slideIndex) {
|
|
2082
|
-
const timerRef = react.useRef(
|
|
2083
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2082
|
+
const timerRef = react.useRef(chunk23Q3I2LM_js.createPresenterTimer());
|
|
2083
|
+
const [snapshot, setSnapshot] = react.useState(() => chunk23Q3I2LM_js.createInitialPresentationSnapshot(slideIndex));
|
|
2084
2084
|
const patch = react.useCallback((value) => {
|
|
2085
|
-
setSnapshot((current) =>
|
|
2085
|
+
setSnapshot((current) => chunk23Q3I2LM_js.mergePresentationSnapshot(current, value));
|
|
2086
2086
|
}, []);
|
|
2087
2087
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2088
2088
|
react.useEffect(() => {
|
|
2089
2089
|
const timer = window.setInterval(() => {
|
|
2090
2090
|
patch({
|
|
2091
2091
|
paused: timerRef.current.paused,
|
|
2092
|
-
elapsedMs:
|
|
2092
|
+
elapsedMs: chunk23Q3I2LM_js.presenterElapsed(timerRef.current)
|
|
2093
2093
|
});
|
|
2094
2094
|
}, 1e3);
|
|
2095
2095
|
return () => window.clearInterval(timer);
|
|
@@ -2099,19 +2099,19 @@ function usePresenterConsole(slideIndex) {
|
|
|
2099
2099
|
applyAudienceSnapshot: setSnapshot,
|
|
2100
2100
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2101
2101
|
toggleTimer: () => {
|
|
2102
|
-
timerRef.current =
|
|
2102
|
+
timerRef.current = chunk23Q3I2LM_js.togglePresenterTimer(timerRef.current);
|
|
2103
2103
|
patch({
|
|
2104
2104
|
paused: timerRef.current.paused,
|
|
2105
|
-
elapsedMs:
|
|
2105
|
+
elapsedMs: chunk23Q3I2LM_js.presenterElapsed(timerRef.current)
|
|
2106
2106
|
});
|
|
2107
2107
|
},
|
|
2108
2108
|
resetTimer: () => {
|
|
2109
|
-
timerRef.current =
|
|
2109
|
+
timerRef.current = chunk23Q3I2LM_js.resetPresenterTimer();
|
|
2110
2110
|
patch({ paused: false, elapsedMs: 0 });
|
|
2111
2111
|
},
|
|
2112
2112
|
stepZoom: (direction) => setSnapshot(
|
|
2113
|
-
(current) =>
|
|
2114
|
-
zoom:
|
|
2113
|
+
(current) => chunk23Q3I2LM_js.mergePresentationSnapshot(current, {
|
|
2114
|
+
zoom: chunk23Q3I2LM_js.stepPresenterZoom(
|
|
2115
2115
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2116
2116
|
direction
|
|
2117
2117
|
)
|
|
@@ -2232,7 +2232,7 @@ function usePresentationMode(input) {
|
|
|
2232
2232
|
});
|
|
2233
2233
|
const movePresentationSlide = react.useCallback(
|
|
2234
2234
|
(direction, trigger = "explicit") => {
|
|
2235
|
-
if (!
|
|
2235
|
+
if (!chunk23Q3I2LM_js.acceptsPresentationInput()) {
|
|
2236
2236
|
return;
|
|
2237
2237
|
}
|
|
2238
2238
|
if (endOfShowVisible) {
|
|
@@ -2713,7 +2713,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2713
2713
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2714
2714
|
slides.forEach((slide, slideIndex) => {
|
|
2715
2715
|
for (const element of slide.elements || []) {
|
|
2716
|
-
if (!
|
|
2716
|
+
if (!chunk23Q3I2LM_js.hasTextProperties(element)) {
|
|
2717
2717
|
continue;
|
|
2718
2718
|
}
|
|
2719
2719
|
const segments = element.textSegments ?? [];
|
|
@@ -2764,7 +2764,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2764
2764
|
continue;
|
|
2765
2765
|
}
|
|
2766
2766
|
const element = slide.elements[elIdx];
|
|
2767
|
-
if (!
|
|
2767
|
+
if (!chunk23Q3I2LM_js.hasTextProperties(element)) {
|
|
2768
2768
|
continue;
|
|
2769
2769
|
}
|
|
2770
2770
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3362,7 +3362,7 @@ function useViewerCoreState(_input) {
|
|
|
3362
3362
|
const shapeAdjustmentDragStateRef = react.useRef(null);
|
|
3363
3363
|
const marqueeStateRef = react.useRef(null);
|
|
3364
3364
|
const isDrawingRef = react.useRef(false);
|
|
3365
|
-
const livePatcher = react.useMemo(() =>
|
|
3365
|
+
const livePatcher = react.useMemo(() => chunk23Q3I2LM_js.createCollaborationLivePatcher(), []);
|
|
3366
3366
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3367
3367
|
const slidesRef = react.useRef([]);
|
|
3368
3368
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3371,8 +3371,8 @@ function useViewerCoreState(_input) {
|
|
|
3371
3371
|
const [slides, setSlides] = react.useState([]);
|
|
3372
3372
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3373
3373
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3374
|
-
width:
|
|
3375
|
-
height:
|
|
3374
|
+
width: chunkFFLUALX5_js.DEFAULT_CANVAS_WIDTH,
|
|
3375
|
+
height: chunkFFLUALX5_js.DEFAULT_CANVAS_HEIGHT
|
|
3376
3376
|
});
|
|
3377
3377
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
3378
3378
|
const [selectedElementId, setSelectedElementId] = react.useState(null);
|
|
@@ -3392,7 +3392,7 @@ function useViewerCoreState(_input) {
|
|
|
3392
3392
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3393
3393
|
inlineEditingTextRef.current = resolved;
|
|
3394
3394
|
setInlineEditingTextBase(value);
|
|
3395
|
-
|
|
3395
|
+
chunk23Q3I2LM_js.publishLiveInlineText(
|
|
3396
3396
|
livePatcher,
|
|
3397
3397
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3398
3398
|
inlineEditingElementIdRef.current,
|
|
@@ -3717,7 +3717,7 @@ function useLoadContent({
|
|
|
3717
3717
|
);
|
|
3718
3718
|
}
|
|
3719
3719
|
const previousHandler = handlerRef.current;
|
|
3720
|
-
const handler = new
|
|
3720
|
+
const handler = new chunk23Q3I2LM_js.PptxHandler();
|
|
3721
3721
|
const parsed = await handler.load(buffer);
|
|
3722
3722
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3723
3723
|
handler.dispose();
|
|
@@ -3729,7 +3729,7 @@ function useLoadContent({
|
|
|
3729
3729
|
handlerRef.current = null;
|
|
3730
3730
|
const mediaElements = [];
|
|
3731
3731
|
for (const slide of parsed.slides) {
|
|
3732
|
-
|
|
3732
|
+
chunk23Q3I2LM_js.collectMediaElements(slide.elements, mediaElements);
|
|
3733
3733
|
}
|
|
3734
3734
|
for (const url of mediaDataUrls.values()) {
|
|
3735
3735
|
if (url.startsWith("blob:")) {
|
|
@@ -3770,7 +3770,7 @@ function useLoadContent({
|
|
|
3770
3770
|
}
|
|
3771
3771
|
})
|
|
3772
3772
|
);
|
|
3773
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3773
|
+
const { paths: imagePaths, refs: imageRefs } = chunk23Q3I2LM_js.collectImagePaths(parsed.slides);
|
|
3774
3774
|
let nextSlides = parsed.slides;
|
|
3775
3775
|
if (imagePaths.size > 0) {
|
|
3776
3776
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3825,12 +3825,12 @@ function useLoadContent({
|
|
|
3825
3825
|
}
|
|
3826
3826
|
}
|
|
3827
3827
|
handlerRef.current = handler;
|
|
3828
|
-
const partition =
|
|
3828
|
+
const partition = chunkFFLUALX5_js.partitionTemplateElements(nextSlides);
|
|
3829
3829
|
setSlides(partition.slides);
|
|
3830
3830
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3831
3831
|
setCanvasSize({
|
|
3832
|
-
width: parsed.width ??
|
|
3833
|
-
height: parsed.height ??
|
|
3832
|
+
width: parsed.width ?? chunkFFLUALX5_js.DEFAULT_CANVAS_WIDTH,
|
|
3833
|
+
height: parsed.height ?? chunkFFLUALX5_js.DEFAULT_CANVAS_HEIGHT
|
|
3834
3834
|
});
|
|
3835
3835
|
setHeaderFooter(parsed.headerFooter ?? {});
|
|
3836
3836
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
@@ -3859,7 +3859,7 @@ function useLoadContent({
|
|
|
3859
3859
|
setHasMacros(parsed.hasMacros === true);
|
|
3860
3860
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3861
3861
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3862
|
-
setGuides(
|
|
3862
|
+
setGuides(chunk23Q3I2LM_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3863
3863
|
setActiveSlideIndex(0);
|
|
3864
3864
|
clearSelection();
|
|
3865
3865
|
setIsDirty(false);
|
|
@@ -3867,7 +3867,7 @@ function useLoadContent({
|
|
|
3867
3867
|
onContentApplied?.();
|
|
3868
3868
|
} catch (err) {
|
|
3869
3869
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3870
|
-
if (err instanceof
|
|
3870
|
+
if (err instanceof chunk23Q3I2LM_js.EncryptedFileError) {
|
|
3871
3871
|
setIsEncrypted(true);
|
|
3872
3872
|
} else {
|
|
3873
3873
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3944,7 +3944,7 @@ function useAutosave(input) {
|
|
|
3944
3944
|
isSavingRef.current = false;
|
|
3945
3945
|
return;
|
|
3946
3946
|
}
|
|
3947
|
-
await
|
|
3947
|
+
await chunk23Q3I2LM_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
3948
3948
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
3949
3949
|
} catch (err) {
|
|
3950
3950
|
setAutosaveStatus({
|
|
@@ -4009,7 +4009,7 @@ function useElementOperations(input) {
|
|
|
4009
4009
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
4010
4010
|
const updateElementById = react.useCallback(
|
|
4011
4011
|
(elementId, updates) => {
|
|
4012
|
-
if (
|
|
4012
|
+
if (chunk23Q3I2LM_js.isTemplateElementId(elementId)) {
|
|
4013
4013
|
const slideId = activeSlide?.id;
|
|
4014
4014
|
if (slideId) {
|
|
4015
4015
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4049,7 +4049,7 @@ function useElementOperations(input) {
|
|
|
4049
4049
|
);
|
|
4050
4050
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4051
4051
|
(updates) => {
|
|
4052
|
-
if (!selectedElement || !
|
|
4052
|
+
if (!selectedElement || !chunk23Q3I2LM_js.hasShapeProperties(selectedElement)) {
|
|
4053
4053
|
return;
|
|
4054
4054
|
}
|
|
4055
4055
|
updateSelectedElement({
|
|
@@ -4060,17 +4060,17 @@ function useElementOperations(input) {
|
|
|
4060
4060
|
);
|
|
4061
4061
|
const updateSelectedTextStyle = react.useCallback(
|
|
4062
4062
|
(updates) => {
|
|
4063
|
-
if (!selectedElement || !
|
|
4063
|
+
if (!selectedElement || !chunk23Q3I2LM_js.hasTextProperties(selectedElement)) {
|
|
4064
4064
|
return;
|
|
4065
4065
|
}
|
|
4066
|
-
const inlineSel =
|
|
4066
|
+
const inlineSel = chunk23Q3I2LM_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4067
4067
|
if (inlineSel && selectedElement.textSegments) {
|
|
4068
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4068
|
+
const { newSegments: newSegments2, newSelection } = chunk23Q3I2LM_js.applyStyleToSelectedSegments(
|
|
4069
4069
|
selectedElement.textSegments,
|
|
4070
4070
|
inlineSel,
|
|
4071
4071
|
updates
|
|
4072
4072
|
);
|
|
4073
|
-
|
|
4073
|
+
chunk23Q3I2LM_js.setPendingSelectionRestore(newSelection);
|
|
4074
4074
|
updateSelectedElement({
|
|
4075
4075
|
textSegments: newSegments2
|
|
4076
4076
|
});
|
|
@@ -4090,12 +4090,12 @@ function useElementOperations(input) {
|
|
|
4090
4090
|
);
|
|
4091
4091
|
const updateSelectedTextCase = react.useCallback(
|
|
4092
4092
|
(mode) => {
|
|
4093
|
-
if (!selectedElement || !
|
|
4093
|
+
if (!selectedElement || !chunk23Q3I2LM_js.hasTextProperties(selectedElement)) {
|
|
4094
4094
|
return;
|
|
4095
4095
|
}
|
|
4096
|
-
const inlineSel =
|
|
4096
|
+
const inlineSel = chunk23Q3I2LM_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4097
4097
|
if (inlineSel && selectedElement.textSegments) {
|
|
4098
|
-
const newSegments =
|
|
4098
|
+
const newSegments = chunk23Q3I2LM_js.applyCaseTransformToSegments(
|
|
4099
4099
|
selectedElement.textSegments,
|
|
4100
4100
|
inlineSel,
|
|
4101
4101
|
mode
|
|
@@ -4105,14 +4105,14 @@ function useElementOperations(input) {
|
|
|
4105
4105
|
}
|
|
4106
4106
|
const updates = {};
|
|
4107
4107
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4108
|
-
updates.textSegments =
|
|
4108
|
+
updates.textSegments = chunk23Q3I2LM_js.applyCaseTransformToSegments(
|
|
4109
4109
|
selectedElement.textSegments,
|
|
4110
4110
|
null,
|
|
4111
4111
|
mode
|
|
4112
4112
|
);
|
|
4113
4113
|
}
|
|
4114
4114
|
if (typeof selectedElement.text === "string") {
|
|
4115
|
-
updates.text =
|
|
4115
|
+
updates.text = chunk23Q3I2LM_js.transformTextCase(selectedElement.text, mode);
|
|
4116
4116
|
}
|
|
4117
4117
|
updateSelectedElement(updates);
|
|
4118
4118
|
},
|
|
@@ -4167,7 +4167,7 @@ function useSectionOperations(input) {
|
|
|
4167
4167
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4168
4168
|
const addSection2 = react.useCallback(
|
|
4169
4169
|
(name, afterSlideIndex) => {
|
|
4170
|
-
const result =
|
|
4170
|
+
const result = chunk23Q3I2LM_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4171
4171
|
setSlides(result.slides);
|
|
4172
4172
|
setSections(result.sections);
|
|
4173
4173
|
markDirty();
|
|
@@ -4176,7 +4176,7 @@ function useSectionOperations(input) {
|
|
|
4176
4176
|
);
|
|
4177
4177
|
const renameSection2 = react.useCallback(
|
|
4178
4178
|
(sectionId, newName) => {
|
|
4179
|
-
const result =
|
|
4179
|
+
const result = chunk23Q3I2LM_js.renameSection(sections, slides, sectionId, newName);
|
|
4180
4180
|
setSections(result.sections);
|
|
4181
4181
|
setSlides(result.slides);
|
|
4182
4182
|
markDirty();
|
|
@@ -4185,7 +4185,7 @@ function useSectionOperations(input) {
|
|
|
4185
4185
|
);
|
|
4186
4186
|
const deleteSection2 = react.useCallback(
|
|
4187
4187
|
(sectionId) => {
|
|
4188
|
-
const result =
|
|
4188
|
+
const result = chunk23Q3I2LM_js.deleteSection(sections, slides, sectionId);
|
|
4189
4189
|
setSections(result.sections);
|
|
4190
4190
|
setSlides(result.slides);
|
|
4191
4191
|
markDirty();
|
|
@@ -4194,21 +4194,21 @@ function useSectionOperations(input) {
|
|
|
4194
4194
|
);
|
|
4195
4195
|
const moveSectionUp2 = react.useCallback(
|
|
4196
4196
|
(sectionId) => {
|
|
4197
|
-
setSections(
|
|
4197
|
+
setSections(chunk23Q3I2LM_js.moveSectionUp(sections, sectionId));
|
|
4198
4198
|
markDirty();
|
|
4199
4199
|
},
|
|
4200
4200
|
[sections, setSections, markDirty]
|
|
4201
4201
|
);
|
|
4202
4202
|
const moveSectionDown2 = react.useCallback(
|
|
4203
4203
|
(sectionId) => {
|
|
4204
|
-
setSections(
|
|
4204
|
+
setSections(chunk23Q3I2LM_js.moveSectionDown(sections, sectionId));
|
|
4205
4205
|
markDirty();
|
|
4206
4206
|
},
|
|
4207
4207
|
[sections, setSections, markDirty]
|
|
4208
4208
|
);
|
|
4209
4209
|
const moveSlidesToSection2 = react.useCallback(
|
|
4210
4210
|
(slideIndexes, targetSectionId) => {
|
|
4211
|
-
const result =
|
|
4211
|
+
const result = chunk23Q3I2LM_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4212
4212
|
setSlides(result.slides);
|
|
4213
4213
|
setSections(result.sections);
|
|
4214
4214
|
markDirty();
|
|
@@ -4227,19 +4227,19 @@ function useSectionOperations(input) {
|
|
|
4227
4227
|
|
|
4228
4228
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4229
4229
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4230
|
-
const resized =
|
|
4230
|
+
const resized = chunk23Q3I2LM_js.applyResize(
|
|
4231
4231
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4232
4232
|
handle,
|
|
4233
4233
|
dx,
|
|
4234
4234
|
dy,
|
|
4235
4235
|
1,
|
|
4236
|
-
{ minSize:
|
|
4236
|
+
{ minSize: chunkFFLUALX5_js.MIN_ELEMENT_SIZE }
|
|
4237
4237
|
);
|
|
4238
4238
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4239
4239
|
if (!snapToGrid) {
|
|
4240
4240
|
return box;
|
|
4241
4241
|
}
|
|
4242
|
-
return
|
|
4242
|
+
return chunk23Q3I2LM_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkFFLUALX5_js.MIN_ELEMENT_SIZE);
|
|
4243
4243
|
}
|
|
4244
4244
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
4245
4245
|
const range = startWidth || 200;
|
|
@@ -4357,7 +4357,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4357
4357
|
width: el.width,
|
|
4358
4358
|
height: el.height
|
|
4359
4359
|
}));
|
|
4360
|
-
const snapResult =
|
|
4360
|
+
const snapResult = chunk23Q3I2LM_js.computeSnapToShape(
|
|
4361
4361
|
targetX,
|
|
4362
4362
|
targetY,
|
|
4363
4363
|
primaryEl.width,
|
|
@@ -4396,7 +4396,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4396
4396
|
if (live) {
|
|
4397
4397
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4398
4398
|
const start = drag.startPositionsById[id];
|
|
4399
|
-
|
|
4399
|
+
chunk23Q3I2LM_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4400
4400
|
x: start.x + appliedDx,
|
|
4401
4401
|
y: start.y + appliedDy
|
|
4402
4402
|
});
|
|
@@ -4430,15 +4430,15 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4430
4430
|
if (rs.domEl) {
|
|
4431
4431
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4432
4432
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4433
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4434
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4433
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunkFFLUALX5_js.MIN_ELEMENT_SIZE)}px`;
|
|
4434
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunkFFLUALX5_js.MIN_ELEMENT_SIZE)}px`;
|
|
4435
4435
|
}
|
|
4436
4436
|
if (live) {
|
|
4437
|
-
|
|
4437
|
+
chunk23Q3I2LM_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4438
4438
|
x: geo.x,
|
|
4439
4439
|
y: geo.y,
|
|
4440
|
-
width: Math.max(geo.width,
|
|
4441
|
-
height: Math.max(geo.height,
|
|
4440
|
+
width: Math.max(geo.width, chunkFFLUALX5_js.MIN_ELEMENT_SIZE),
|
|
4441
|
+
height: Math.max(geo.height, chunkFFLUALX5_js.MIN_ELEMENT_SIZE)
|
|
4442
4442
|
});
|
|
4443
4443
|
}
|
|
4444
4444
|
}
|
|
@@ -4518,13 +4518,13 @@ function processPointerUp(input) {
|
|
|
4518
4518
|
if (i !== activeSlideIndex) {
|
|
4519
4519
|
return s;
|
|
4520
4520
|
}
|
|
4521
|
-
const rerouted =
|
|
4521
|
+
const rerouted = chunk23Q3I2LM_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4522
4522
|
if (rerouted.length === 0) {
|
|
4523
4523
|
return s;
|
|
4524
4524
|
}
|
|
4525
4525
|
return {
|
|
4526
4526
|
...s,
|
|
4527
|
-
elements:
|
|
4527
|
+
elements: chunk23Q3I2LM_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4528
4528
|
};
|
|
4529
4529
|
})
|
|
4530
4530
|
);
|
|
@@ -4546,9 +4546,9 @@ function processPointerUp(input) {
|
|
|
4546
4546
|
}
|
|
4547
4547
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4548
4548
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4549
|
-
const hitIds =
|
|
4549
|
+
const hitIds = chunk23Q3I2LM_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4550
4550
|
if (marquee.additive) {
|
|
4551
|
-
const merged =
|
|
4551
|
+
const merged = chunk23Q3I2LM_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4552
4552
|
if (merged.length > 0) {
|
|
4553
4553
|
applySelection(merged[0], merged);
|
|
4554
4554
|
} else {
|
|
@@ -4571,8 +4571,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4571
4571
|
}
|
|
4572
4572
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4573
4573
|
});
|
|
4574
|
-
const rerouted =
|
|
4575
|
-
return
|
|
4574
|
+
const rerouted = chunk23Q3I2LM_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4575
|
+
return chunk23Q3I2LM_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4576
4576
|
};
|
|
4577
4577
|
if (editTemplateMode) {
|
|
4578
4578
|
const slideId = activeSlide?.id;
|
|
@@ -4725,9 +4725,9 @@ function useCanvasInteractions(input) {
|
|
|
4725
4725
|
return;
|
|
4726
4726
|
}
|
|
4727
4727
|
const el = elementLookup.get(editId);
|
|
4728
|
-
if (el &&
|
|
4728
|
+
if (el && chunk23Q3I2LM_js.hasTextProperties(el)) {
|
|
4729
4729
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4730
|
-
const newSegments =
|
|
4730
|
+
const newSegments = chunk23Q3I2LM_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4731
4731
|
ops.updateElementById(editId, {
|
|
4732
4732
|
text: committedText,
|
|
4733
4733
|
textSegments: newSegments
|
|
@@ -4738,7 +4738,7 @@ function useCanvasInteractions(input) {
|
|
|
4738
4738
|
setInlineEditingText("");
|
|
4739
4739
|
};
|
|
4740
4740
|
const openEquationEditorForElement = (el) => {
|
|
4741
|
-
if (!
|
|
4741
|
+
if (!chunk23Q3I2LM_js.hasTextProperties(el)) {
|
|
4742
4742
|
return false;
|
|
4743
4743
|
}
|
|
4744
4744
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4767,7 +4767,7 @@ function useCanvasInteractions(input) {
|
|
|
4767
4767
|
justSelectedRef.current = false;
|
|
4768
4768
|
} else {
|
|
4769
4769
|
const el = elementLookup.get(elementId);
|
|
4770
|
-
if (el &&
|
|
4770
|
+
if (el && chunk23Q3I2LM_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
4771
4771
|
if (!openEquationEditorForElement(el)) {
|
|
4772
4772
|
setInlineEditingElementId(elementId);
|
|
4773
4773
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4786,7 +4786,7 @@ function useCanvasInteractions(input) {
|
|
|
4786
4786
|
if (openEquationEditorForElement(el)) {
|
|
4787
4787
|
return;
|
|
4788
4788
|
}
|
|
4789
|
-
if (
|
|
4789
|
+
if (chunk23Q3I2LM_js.hasTextProperties(el)) {
|
|
4790
4790
|
setInlineEditingElementId(elementId);
|
|
4791
4791
|
setInlineEditingText(el.text ?? "");
|
|
4792
4792
|
}
|
|
@@ -4976,7 +4976,7 @@ function createFileHandlers(deps) {
|
|
|
4976
4976
|
h = Math.round(h * scale);
|
|
4977
4977
|
}
|
|
4978
4978
|
addElement({
|
|
4979
|
-
id:
|
|
4979
|
+
id: chunk23Q3I2LM_js.generateElementId(),
|
|
4980
4980
|
type: "image",
|
|
4981
4981
|
x: Math.round((canvasSize.width - w) / 2),
|
|
4982
4982
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -4987,7 +4987,7 @@ function createFileHandlers(deps) {
|
|
|
4987
4987
|
};
|
|
4988
4988
|
img.onerror = () => {
|
|
4989
4989
|
addElement({
|
|
4990
|
-
id:
|
|
4990
|
+
id: chunk23Q3I2LM_js.generateElementId(),
|
|
4991
4991
|
type: "image",
|
|
4992
4992
|
x: 100,
|
|
4993
4993
|
y: 100,
|
|
@@ -5013,7 +5013,7 @@ function createFileHandlers(deps) {
|
|
|
5013
5013
|
const elFilePath = file.path;
|
|
5014
5014
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5015
5015
|
addElement({
|
|
5016
|
-
id:
|
|
5016
|
+
id: chunk23Q3I2LM_js.generateElementId(),
|
|
5017
5017
|
type: "media",
|
|
5018
5018
|
mediaType,
|
|
5019
5019
|
mediaMimeType: file.type || void 0,
|
|
@@ -5188,13 +5188,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5188
5188
|
return;
|
|
5189
5189
|
}
|
|
5190
5190
|
addElement({
|
|
5191
|
-
id:
|
|
5191
|
+
id: chunk23Q3I2LM_js.generateElementId(),
|
|
5192
5192
|
type: "smartArt",
|
|
5193
5193
|
x: 100,
|
|
5194
5194
|
y: 120,
|
|
5195
5195
|
width: 600,
|
|
5196
5196
|
height: 340,
|
|
5197
|
-
smartArtData:
|
|
5197
|
+
smartArtData: chunk23Q3I2LM_js.buildSmartArtPresetData(
|
|
5198
5198
|
layout,
|
|
5199
5199
|
defaultItems,
|
|
5200
5200
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5206,7 +5206,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5206
5206
|
return;
|
|
5207
5207
|
}
|
|
5208
5208
|
addElement({
|
|
5209
|
-
id:
|
|
5209
|
+
id: chunk23Q3I2LM_js.generateElementId(),
|
|
5210
5210
|
type: "shape",
|
|
5211
5211
|
x: 120,
|
|
5212
5212
|
y: 200,
|
|
@@ -5265,7 +5265,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5265
5265
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5266
5266
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5267
5267
|
addElement({
|
|
5268
|
-
id:
|
|
5268
|
+
id: chunk23Q3I2LM_js.generateElementId(),
|
|
5269
5269
|
type: "shape",
|
|
5270
5270
|
x: 120,
|
|
5271
5271
|
y: 200,
|
|
@@ -5287,11 +5287,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5287
5287
|
if (!activeSlide) {
|
|
5288
5288
|
return;
|
|
5289
5289
|
}
|
|
5290
|
-
const preset =
|
|
5290
|
+
const preset = chunk23Q3I2LM_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5291
5291
|
if (!preset) {
|
|
5292
5292
|
return;
|
|
5293
5293
|
}
|
|
5294
|
-
const defaultPptxAction =
|
|
5294
|
+
const defaultPptxAction = chunk23Q3I2LM_js.elementActionToPptxAction({
|
|
5295
5295
|
trigger: "click",
|
|
5296
5296
|
type: preset.defaultAction
|
|
5297
5297
|
});
|
|
@@ -5300,7 +5300,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5300
5300
|
defaultPptxAction.highlightClick = true;
|
|
5301
5301
|
}
|
|
5302
5302
|
addElement({
|
|
5303
|
-
id:
|
|
5303
|
+
id: chunk23Q3I2LM_js.generateElementId(),
|
|
5304
5304
|
type: "shape",
|
|
5305
5305
|
x: 150,
|
|
5306
5306
|
y: 150,
|
|
@@ -5367,14 +5367,14 @@ function useInsertElements(input) {
|
|
|
5367
5367
|
return;
|
|
5368
5368
|
}
|
|
5369
5369
|
addElement({
|
|
5370
|
-
id:
|
|
5370
|
+
id: chunk23Q3I2LM_js.generateElementId(),
|
|
5371
5371
|
type: "text",
|
|
5372
5372
|
x: 100,
|
|
5373
5373
|
y: 100,
|
|
5374
5374
|
width: 300,
|
|
5375
5375
|
height: 60,
|
|
5376
5376
|
text: "",
|
|
5377
|
-
textStyle: { fontSize:
|
|
5377
|
+
textStyle: { fontSize: chunkFFLUALX5_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5378
5378
|
});
|
|
5379
5379
|
};
|
|
5380
5380
|
const handleAddShape = () => {
|
|
@@ -5382,7 +5382,7 @@ function useInsertElements(input) {
|
|
|
5382
5382
|
return;
|
|
5383
5383
|
}
|
|
5384
5384
|
addElement({
|
|
5385
|
-
id:
|
|
5385
|
+
id: chunk23Q3I2LM_js.generateElementId(),
|
|
5386
5386
|
type: "shape",
|
|
5387
5387
|
x: 150,
|
|
5388
5388
|
y: 150,
|
|
@@ -5401,15 +5401,15 @@ function useInsertElements(input) {
|
|
|
5401
5401
|
return;
|
|
5402
5402
|
}
|
|
5403
5403
|
addElement({
|
|
5404
|
-
...
|
|
5405
|
-
id:
|
|
5404
|
+
...chunk23Q3I2LM_js.newTableElement(chunkFFLUALX5_js.DEFAULT_TABLE_ROWS, chunkFFLUALX5_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5405
|
+
id: chunk23Q3I2LM_js.generateElementId()
|
|
5406
5406
|
});
|
|
5407
5407
|
};
|
|
5408
5408
|
const handleAddChart = (chartType) => {
|
|
5409
5409
|
if (!activeSlide) {
|
|
5410
5410
|
return;
|
|
5411
5411
|
}
|
|
5412
|
-
addElement(
|
|
5412
|
+
addElement(chunk23Q3I2LM_js.createDefaultChartElement(chartType));
|
|
5413
5413
|
};
|
|
5414
5414
|
const structured = createStructuredElementHandlers({
|
|
5415
5415
|
activeSlide,
|
|
@@ -5479,7 +5479,7 @@ function useClipboardHandlers(input) {
|
|
|
5479
5479
|
if (!selectedElement) {
|
|
5480
5480
|
return;
|
|
5481
5481
|
}
|
|
5482
|
-
setClipboardPayload(
|
|
5482
|
+
setClipboardPayload(chunk23Q3I2LM_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5483
5483
|
};
|
|
5484
5484
|
const handleDelete = () => {
|
|
5485
5485
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5496,7 +5496,7 @@ function useClipboardHandlers(input) {
|
|
|
5496
5496
|
handleDelete();
|
|
5497
5497
|
};
|
|
5498
5498
|
const insertClone = (source) => {
|
|
5499
|
-
const clone =
|
|
5499
|
+
const clone = chunk23Q3I2LM_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5500
5500
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5501
5501
|
ops.applySelection(clone.id);
|
|
5502
5502
|
history.markDirty();
|
|
@@ -5531,7 +5531,7 @@ function resolveShapePath(el) {
|
|
|
5531
5531
|
return el.pathData;
|
|
5532
5532
|
}
|
|
5533
5533
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5534
|
-
const clipPath =
|
|
5534
|
+
const clipPath = chunk23Q3I2LM_js.getPresetShapeClipPath(el.shapeType);
|
|
5535
5535
|
if (clipPath) {
|
|
5536
5536
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5537
5537
|
if (svgPath) {
|
|
@@ -5582,7 +5582,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5582
5582
|
return parts.join(" ");
|
|
5583
5583
|
}
|
|
5584
5584
|
function transformPathToGlobal(pathData, el) {
|
|
5585
|
-
const polys =
|
|
5585
|
+
const polys = chunk23Q3I2LM_js.svgPathToPolygons(pathData);
|
|
5586
5586
|
if (polys.length === 0) {
|
|
5587
5587
|
return pathData;
|
|
5588
5588
|
}
|
|
@@ -5602,10 +5602,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5602
5602
|
y: pt.y * scaleY + el.y
|
|
5603
5603
|
}))
|
|
5604
5604
|
);
|
|
5605
|
-
return
|
|
5605
|
+
return chunk23Q3I2LM_js.polygonsToSvgPath(transformed);
|
|
5606
5606
|
}
|
|
5607
5607
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5608
|
-
const polys =
|
|
5608
|
+
const polys = chunk23Q3I2LM_js.svgPathToPolygons(pathData);
|
|
5609
5609
|
if (polys.length === 0) {
|
|
5610
5610
|
return pathData;
|
|
5611
5611
|
}
|
|
@@ -5615,10 +5615,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5615
5615
|
y: pt.y - y
|
|
5616
5616
|
}))
|
|
5617
5617
|
);
|
|
5618
|
-
return
|
|
5618
|
+
return chunk23Q3I2LM_js.polygonsToSvgPath(transformed);
|
|
5619
5619
|
}
|
|
5620
5620
|
function pathBounds(pathData) {
|
|
5621
|
-
const polys =
|
|
5621
|
+
const polys = chunk23Q3I2LM_js.svgPathToPolygons(pathData);
|
|
5622
5622
|
let minX = Infinity;
|
|
5623
5623
|
let minY = Infinity;
|
|
5624
5624
|
let maxX = -Infinity;
|
|
@@ -5677,7 +5677,7 @@ function useMergeShapesHandler(input) {
|
|
|
5677
5677
|
let allFragments = [];
|
|
5678
5678
|
let remaining = globalPaths[0];
|
|
5679
5679
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5680
|
-
const frags =
|
|
5680
|
+
const frags = chunk23Q3I2LM_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5681
5681
|
if (Array.isArray(frags)) {
|
|
5682
5682
|
allFragments = frags;
|
|
5683
5683
|
}
|
|
@@ -5706,7 +5706,7 @@ function useMergeShapesHandler(input) {
|
|
|
5706
5706
|
bounds.height
|
|
5707
5707
|
);
|
|
5708
5708
|
const newEl = {
|
|
5709
|
-
id:
|
|
5709
|
+
id: chunk23Q3I2LM_js.generateElementId(),
|
|
5710
5710
|
type: "shape",
|
|
5711
5711
|
x: bounds.x,
|
|
5712
5712
|
y: bounds.y,
|
|
@@ -5744,7 +5744,7 @@ function useMergeShapesHandler(input) {
|
|
|
5744
5744
|
} else {
|
|
5745
5745
|
let resultPath = globalPaths[0];
|
|
5746
5746
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5747
|
-
const result =
|
|
5747
|
+
const result = chunk23Q3I2LM_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5748
5748
|
if (typeof result === "string") {
|
|
5749
5749
|
resultPath = result;
|
|
5750
5750
|
}
|
|
@@ -5765,7 +5765,7 @@ function useMergeShapesHandler(input) {
|
|
|
5765
5765
|
);
|
|
5766
5766
|
const primary = targets[0];
|
|
5767
5767
|
const newEl = {
|
|
5768
|
-
id:
|
|
5768
|
+
id: chunk23Q3I2LM_js.generateElementId(),
|
|
5769
5769
|
type: "shape",
|
|
5770
5770
|
x: bounds.x,
|
|
5771
5771
|
y: bounds.y,
|
|
@@ -5828,7 +5828,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5828
5828
|
if (ids.length < 2 || !activeSlide) {
|
|
5829
5829
|
return;
|
|
5830
5830
|
}
|
|
5831
|
-
const { elements, groupId } =
|
|
5831
|
+
const { elements, groupId } = chunk23Q3I2LM_js.groupElements(ops.activeElements, ids, chunk23Q3I2LM_js.generateElementId());
|
|
5832
5832
|
if (groupId === null) {
|
|
5833
5833
|
return;
|
|
5834
5834
|
}
|
|
@@ -5841,12 +5841,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5841
5841
|
return;
|
|
5842
5842
|
}
|
|
5843
5843
|
const group = selectedElement;
|
|
5844
|
-
const intoTemplate =
|
|
5844
|
+
const intoTemplate = chunk23Q3I2LM_js.isTemplateElementId(group.id);
|
|
5845
5845
|
const ungrouped = group.children.map((child) => ({
|
|
5846
5846
|
...structuredClone(child),
|
|
5847
5847
|
// Keep child ids in the same store as the group so later edits route
|
|
5848
5848
|
// correctly: template groups yield template-prefixed child ids.
|
|
5849
|
-
id: intoTemplate ?
|
|
5849
|
+
id: intoTemplate ? chunk23Q3I2LM_js.makeCloneId(true, child.id || group.id) : child.id || chunk23Q3I2LM_js.generateElementId(),
|
|
5850
5850
|
x: child.x + group.x,
|
|
5851
5851
|
y: child.y + group.y
|
|
5852
5852
|
}));
|
|
@@ -5870,7 +5870,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5870
5870
|
if (!edge) {
|
|
5871
5871
|
return;
|
|
5872
5872
|
}
|
|
5873
|
-
const positions =
|
|
5873
|
+
const positions = chunk23Q3I2LM_js.alignElements(selectedElements, edge);
|
|
5874
5874
|
for (const [id, pos] of positions) {
|
|
5875
5875
|
const el = elementLookup.get(id);
|
|
5876
5876
|
if (!el) {
|
|
@@ -5888,7 +5888,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5888
5888
|
if (!distAxis) {
|
|
5889
5889
|
return;
|
|
5890
5890
|
}
|
|
5891
|
-
const positions =
|
|
5891
|
+
const positions = chunk23Q3I2LM_js.distributeElements(selectedElements, distAxis);
|
|
5892
5892
|
for (const [id, pos] of positions) {
|
|
5893
5893
|
const el = elementLookup.get(id);
|
|
5894
5894
|
if (!el) {
|
|
@@ -5905,7 +5905,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5905
5905
|
}
|
|
5906
5906
|
const id = selectedElement.id;
|
|
5907
5907
|
ops.updateActiveElements(
|
|
5908
|
-
(els) => direction === "forward" ?
|
|
5908
|
+
(els) => direction === "forward" ? chunk23Q3I2LM_js.bringForward(els, id) : direction === "backward" ? chunk23Q3I2LM_js.sendBackward(els, id) : els
|
|
5909
5909
|
);
|
|
5910
5910
|
history.markDirty();
|
|
5911
5911
|
};
|
|
@@ -5915,7 +5915,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5915
5915
|
}
|
|
5916
5916
|
const id = selectedElement.id;
|
|
5917
5917
|
ops.updateActiveElements(
|
|
5918
|
-
(els) => direction === "front" ?
|
|
5918
|
+
(els) => direction === "front" ? chunk23Q3I2LM_js.bringToFront(els, id) : chunk23Q3I2LM_js.sendToBack(els, id)
|
|
5919
5919
|
);
|
|
5920
5920
|
history.markDirty();
|
|
5921
5921
|
};
|
|
@@ -6037,7 +6037,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
6037
6037
|
function useSlideManagement(input) {
|
|
6038
6038
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
6039
6039
|
const handleAddSlide = () => {
|
|
6040
|
-
const newSlide =
|
|
6040
|
+
const newSlide = chunk23Q3I2LM_js.createBlankSlide(slides.length + 1);
|
|
6041
6041
|
ops.updateSlides((prev) => {
|
|
6042
6042
|
const next = [...prev];
|
|
6043
6043
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6100,7 +6100,7 @@ function useSlideManagement(input) {
|
|
|
6100
6100
|
}
|
|
6101
6101
|
const clone = {
|
|
6102
6102
|
...src,
|
|
6103
|
-
id:
|
|
6103
|
+
id: chunk23Q3I2LM_js.makeSlideId(),
|
|
6104
6104
|
elements: src.elements.map((el) => ({
|
|
6105
6105
|
...el,
|
|
6106
6106
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6132,7 +6132,7 @@ function useSlideManagement(input) {
|
|
|
6132
6132
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6133
6133
|
const insertAt = activeSlideIndex + 1;
|
|
6134
6134
|
const draft = {
|
|
6135
|
-
...
|
|
6135
|
+
...chunk23Q3I2LM_js.createBlankSlide(slides.length + 1),
|
|
6136
6136
|
layoutPath,
|
|
6137
6137
|
...layoutName ? { layoutName } : {}
|
|
6138
6138
|
};
|
|
@@ -6193,7 +6193,7 @@ function createTableMergeHandlers(input) {
|
|
|
6193
6193
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6194
6194
|
return;
|
|
6195
6195
|
}
|
|
6196
|
-
const newTableData =
|
|
6196
|
+
const newTableData = chunk23Q3I2LM_js.mergeCells(
|
|
6197
6197
|
[
|
|
6198
6198
|
{ row: rowIndex, col: columnIndex },
|
|
6199
6199
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6201,7 +6201,7 @@ function createTableMergeHandlers(input) {
|
|
|
6201
6201
|
td
|
|
6202
6202
|
);
|
|
6203
6203
|
const updates = { tableData: newTableData };
|
|
6204
|
-
const newRawXml =
|
|
6204
|
+
const newRawXml = chunk23Q3I2LM_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6205
6205
|
if (newRawXml) {
|
|
6206
6206
|
updates.rawXml = newRawXml;
|
|
6207
6207
|
}
|
|
@@ -6227,7 +6227,7 @@ function createTableMergeHandlers(input) {
|
|
|
6227
6227
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6228
6228
|
return;
|
|
6229
6229
|
}
|
|
6230
|
-
const newTableData =
|
|
6230
|
+
const newTableData = chunk23Q3I2LM_js.mergeCells(
|
|
6231
6231
|
[
|
|
6232
6232
|
{ row: rowIndex, col: columnIndex },
|
|
6233
6233
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6235,7 +6235,7 @@ function createTableMergeHandlers(input) {
|
|
|
6235
6235
|
td
|
|
6236
6236
|
);
|
|
6237
6237
|
const updates = { tableData: newTableData };
|
|
6238
|
-
const newRawXml =
|
|
6238
|
+
const newRawXml = chunk23Q3I2LM_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6239
6239
|
if (newRawXml) {
|
|
6240
6240
|
updates.rawXml = newRawXml;
|
|
6241
6241
|
}
|
|
@@ -6250,9 +6250,9 @@ function createTableMergeHandlers(input) {
|
|
|
6250
6250
|
return;
|
|
6251
6251
|
}
|
|
6252
6252
|
const td = selectedElement.tableData;
|
|
6253
|
-
const newTableData =
|
|
6253
|
+
const newTableData = chunk23Q3I2LM_js.mergeCells(ts.selectedCells, td);
|
|
6254
6254
|
const updates = { tableData: newTableData };
|
|
6255
|
-
const newRawXml =
|
|
6255
|
+
const newRawXml = chunk23Q3I2LM_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6256
6256
|
if (newRawXml) {
|
|
6257
6257
|
updates.rawXml = newRawXml;
|
|
6258
6258
|
}
|
|
@@ -6269,9 +6269,9 @@ function createTableMergeHandlers(input) {
|
|
|
6269
6269
|
}
|
|
6270
6270
|
const { rowIndex, columnIndex } = ts;
|
|
6271
6271
|
const td = selectedElement.tableData;
|
|
6272
|
-
const newTableData =
|
|
6272
|
+
const newTableData = chunk23Q3I2LM_js.splitCell(rowIndex, columnIndex, td);
|
|
6273
6273
|
const updates = { tableData: newTableData };
|
|
6274
|
-
const newRawXml =
|
|
6274
|
+
const newRawXml = chunk23Q3I2LM_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6275
6275
|
if (newRawXml) {
|
|
6276
6276
|
updates.rawXml = newRawXml;
|
|
6277
6277
|
}
|
|
@@ -6315,7 +6315,7 @@ function createTableStructHandlers(input) {
|
|
|
6315
6315
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
6316
6316
|
}
|
|
6317
6317
|
if (el.rawXml) {
|
|
6318
|
-
const newRawXml =
|
|
6318
|
+
const newRawXml = chunk23Q3I2LM_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6319
6319
|
if (newRawXml) {
|
|
6320
6320
|
updates.rawXml = newRawXml;
|
|
6321
6321
|
}
|
|
@@ -6339,7 +6339,7 @@ function createTableStructHandlers(input) {
|
|
|
6339
6339
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6340
6340
|
const updates = {};
|
|
6341
6341
|
if (selectedElement.rawXml) {
|
|
6342
|
-
const newRawXml =
|
|
6342
|
+
const newRawXml = chunk23Q3I2LM_js.updateCellTextStyleInRawXml(
|
|
6343
6343
|
selectedElement,
|
|
6344
6344
|
rowIndex,
|
|
6345
6345
|
colIndex,
|
|
@@ -6403,9 +6403,9 @@ function createTableStructHandlers(input) {
|
|
|
6403
6403
|
return;
|
|
6404
6404
|
}
|
|
6405
6405
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6406
|
-
const newTableData =
|
|
6406
|
+
const newTableData = chunk23Q3I2LM_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6407
6407
|
const updates = { tableData: newTableData };
|
|
6408
|
-
const newRawXml =
|
|
6408
|
+
const newRawXml = chunk23Q3I2LM_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6409
6409
|
if (newRawXml) {
|
|
6410
6410
|
updates.rawXml = newRawXml;
|
|
6411
6411
|
}
|
|
@@ -6418,12 +6418,12 @@ function createTableStructHandlers(input) {
|
|
|
6418
6418
|
}
|
|
6419
6419
|
const td = selectedElement.tableData;
|
|
6420
6420
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6421
|
-
const newTableData =
|
|
6421
|
+
const newTableData = chunk23Q3I2LM_js.deleteTableRow(td, rowIdx);
|
|
6422
6422
|
if (newTableData === td) {
|
|
6423
6423
|
return;
|
|
6424
6424
|
}
|
|
6425
6425
|
const updates = { tableData: newTableData };
|
|
6426
|
-
const newRawXml =
|
|
6426
|
+
const newRawXml = chunk23Q3I2LM_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6427
6427
|
if (newRawXml) {
|
|
6428
6428
|
updates.rawXml = newRawXml;
|
|
6429
6429
|
}
|
|
@@ -6435,9 +6435,9 @@ function createTableStructHandlers(input) {
|
|
|
6435
6435
|
return;
|
|
6436
6436
|
}
|
|
6437
6437
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6438
|
-
const newTableData =
|
|
6438
|
+
const newTableData = chunk23Q3I2LM_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6439
6439
|
const updates = { tableData: newTableData };
|
|
6440
|
-
const newRawXml =
|
|
6440
|
+
const newRawXml = chunk23Q3I2LM_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6441
6441
|
if (newRawXml) {
|
|
6442
6442
|
updates.rawXml = newRawXml;
|
|
6443
6443
|
}
|
|
@@ -6450,12 +6450,12 @@ function createTableStructHandlers(input) {
|
|
|
6450
6450
|
}
|
|
6451
6451
|
const td = selectedElement.tableData;
|
|
6452
6452
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6453
|
-
const newTableData =
|
|
6453
|
+
const newTableData = chunk23Q3I2LM_js.deleteTableColumn(td, colIdx);
|
|
6454
6454
|
if (newTableData === td) {
|
|
6455
6455
|
return;
|
|
6456
6456
|
}
|
|
6457
6457
|
const updates = { tableData: newTableData };
|
|
6458
|
-
const newRawXml =
|
|
6458
|
+
const newRawXml = chunk23Q3I2LM_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6459
6459
|
if (newRawXml) {
|
|
6460
6460
|
updates.rawXml = newRawXml;
|
|
6461
6461
|
}
|
|
@@ -6491,8 +6491,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6491
6491
|
return html2canvasPro(element, {
|
|
6492
6492
|
...options,
|
|
6493
6493
|
onclone: async (doc, clonedEl) => {
|
|
6494
|
-
await
|
|
6495
|
-
|
|
6494
|
+
await chunk23Q3I2LM_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6495
|
+
chunk23Q3I2LM_js.preprocessCssForCapture(clonedEl);
|
|
6496
6496
|
if (typeof userOnClone === "function") {
|
|
6497
6497
|
userOnClone(doc, clonedEl);
|
|
6498
6498
|
}
|
|
@@ -6548,7 +6548,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6548
6548
|
}
|
|
6549
6549
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6550
6550
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6551
|
-
|
|
6551
|
+
chunk23Q3I2LM_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6552
6552
|
}
|
|
6553
6553
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6554
6554
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6570,15 +6570,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6570
6570
|
continue;
|
|
6571
6571
|
}
|
|
6572
6572
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6573
|
-
images.push(
|
|
6573
|
+
images.push(chunk23Q3I2LM_js.canvasToJpegData(canvas));
|
|
6574
6574
|
}
|
|
6575
6575
|
onProgress?.(totalSlides, totalSlides);
|
|
6576
6576
|
setActiveSlide(currentSlideIndex);
|
|
6577
6577
|
if (images.length === 0) {
|
|
6578
6578
|
throw new Error(chunk25VSL2BB_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6579
6579
|
}
|
|
6580
|
-
const pdfBlobUrl =
|
|
6581
|
-
|
|
6580
|
+
const pdfBlobUrl = chunkFFLUALX5_js.buildPdfFromImageData(images);
|
|
6581
|
+
chunk23Q3I2LM_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6582
6582
|
}
|
|
6583
6583
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6584
6584
|
const { scale = 2, onProgress } = options;
|
|
@@ -6626,8 +6626,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6626
6626
|
if (pages.length === 0) {
|
|
6627
6627
|
throw new Error(chunk25VSL2BB_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6628
6628
|
}
|
|
6629
|
-
const pdfDataUrl =
|
|
6630
|
-
|
|
6629
|
+
const pdfDataUrl = chunkFFLUALX5_js.buildNotesPdf(pages);
|
|
6630
|
+
chunk23Q3I2LM_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6631
6631
|
}
|
|
6632
6632
|
|
|
6633
6633
|
// src/viewer/utils/export-video.ts
|
|
@@ -6671,7 +6671,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6671
6671
|
const fps = 30;
|
|
6672
6672
|
const stream = recordingCanvas.captureStream(fps);
|
|
6673
6673
|
const recorder = new MediaRecorder(stream, {
|
|
6674
|
-
mimeType:
|
|
6674
|
+
mimeType: chunk23Q3I2LM_js.pickSupportedMimeType([...chunk23Q3I2LM_js.WEBM_MIME_CANDIDATES]),
|
|
6675
6675
|
videoBitsPerSecond: 5e6
|
|
6676
6676
|
});
|
|
6677
6677
|
const chunks = [];
|
|
@@ -6694,8 +6694,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6694
6694
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6695
6695
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6696
6696
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6697
|
-
const frameInterval =
|
|
6698
|
-
const framesNeeded =
|
|
6697
|
+
const frameInterval = chunk23Q3I2LM_js.fpsToFrameIntervalMs(fps);
|
|
6698
|
+
const framesNeeded = chunk23Q3I2LM_js.segmentFrameCount(duration, fps);
|
|
6699
6699
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6700
6700
|
if (signal?.aborted) {
|
|
6701
6701
|
recorder.stop();
|
|
@@ -6744,7 +6744,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6744
6744
|
if (frames.length === 0) {
|
|
6745
6745
|
throw new Error(chunk25VSL2BB_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6746
6746
|
}
|
|
6747
|
-
const gifBytes =
|
|
6747
|
+
const gifBytes = chunk23Q3I2LM_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6748
6748
|
onProgress?.(totalSlides, totalSlides);
|
|
6749
6749
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6750
6750
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6798,7 +6798,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6798
6798
|
continue;
|
|
6799
6799
|
}
|
|
6800
6800
|
onProgress?.(processedCount, data.slides.length);
|
|
6801
|
-
let svg =
|
|
6801
|
+
let svg = chunk23Q3I2LM_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6802
6802
|
if (embedFonts && fontFaces?.length) {
|
|
6803
6803
|
svg = injectFontFaces(svg, fontFaces);
|
|
6804
6804
|
}
|
|
@@ -6858,7 +6858,7 @@ function useExportSaveAs(input) {
|
|
|
6858
6858
|
}
|
|
6859
6859
|
setExportProgress(70);
|
|
6860
6860
|
setExportStatusMessage("Writing README...");
|
|
6861
|
-
const readme =
|
|
6861
|
+
const readme = chunk23Q3I2LM_js.generatePackageReadme(pptxFilename);
|
|
6862
6862
|
pkgFolder.file("README.txt", readme);
|
|
6863
6863
|
if (abortCtrl.signal.aborted) {
|
|
6864
6864
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -6869,7 +6869,7 @@ function useExportSaveAs(input) {
|
|
|
6869
6869
|
setExportProgress(95);
|
|
6870
6870
|
setExportStatusMessage("Downloading...");
|
|
6871
6871
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
6872
|
-
|
|
6872
|
+
chunk23Q3I2LM_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
6873
6873
|
setExportProgress(100);
|
|
6874
6874
|
} catch (err) {
|
|
6875
6875
|
if (err.name !== "AbortError") {
|
|
@@ -6892,7 +6892,7 @@ function useExportSaveAs(input) {
|
|
|
6892
6892
|
const blob = new Blob([data], {
|
|
6893
6893
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6894
6894
|
});
|
|
6895
|
-
|
|
6895
|
+
chunk23Q3I2LM_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
6896
6896
|
} catch (err) {
|
|
6897
6897
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
6898
6898
|
}
|
|
@@ -6905,14 +6905,14 @@ function useExportSaveAs(input) {
|
|
|
6905
6905
|
const pptxGuides = guides.map((g) => ({
|
|
6906
6906
|
id: g.id,
|
|
6907
6907
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
6908
|
-
positionEmu:
|
|
6908
|
+
positionEmu: chunk23Q3I2LM_js.guidePxToEmu(g.position)
|
|
6909
6909
|
}));
|
|
6910
6910
|
return {
|
|
6911
6911
|
...slide,
|
|
6912
6912
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
6913
6913
|
};
|
|
6914
6914
|
});
|
|
6915
|
-
const slidesToSave =
|
|
6915
|
+
const slidesToSave = chunkFFLUALX5_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
6916
6916
|
const saveOptions = {
|
|
6917
6917
|
headerFooter,
|
|
6918
6918
|
presentationProperties,
|
|
@@ -6969,7 +6969,7 @@ function safeConfirm(message) {
|
|
|
6969
6969
|
}
|
|
6970
6970
|
}
|
|
6971
6971
|
function downloadBlob2(blob, filename) {
|
|
6972
|
-
|
|
6972
|
+
chunk23Q3I2LM_js.downloadBlob(blob, chunk23Q3I2LM_js.sanitizeDownloadFilename(filename));
|
|
6973
6973
|
}
|
|
6974
6974
|
|
|
6975
6975
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7070,21 +7070,21 @@ function useExportHandlers(input) {
|
|
|
7070
7070
|
{
|
|
7071
7071
|
scale: 2,
|
|
7072
7072
|
onProgress: (current, total) => {
|
|
7073
|
-
setExportProgress(
|
|
7074
|
-
setExportStatusMessage(
|
|
7073
|
+
setExportProgress(chunk23Q3I2LM_js.slideProgressPercent(current, total));
|
|
7074
|
+
setExportStatusMessage(chunk23Q3I2LM_js.slideStatusLabel("Rendering", current, total));
|
|
7075
7075
|
},
|
|
7076
7076
|
signal: abortCtrl.signal
|
|
7077
7077
|
}
|
|
7078
7078
|
);
|
|
7079
|
-
setExportProgress(
|
|
7079
|
+
setExportProgress(chunk23Q3I2LM_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7080
7080
|
setExportStatusMessage("Building PDF...");
|
|
7081
7081
|
await new Promise((r) => {
|
|
7082
7082
|
setTimeout(r, 100);
|
|
7083
7083
|
});
|
|
7084
|
-
setExportProgress(
|
|
7084
|
+
setExportProgress(chunk23Q3I2LM_js.EXPORT_DONE_PERCENT);
|
|
7085
7085
|
setExportStatusMessage("Done!");
|
|
7086
7086
|
} catch (err) {
|
|
7087
|
-
if (!
|
|
7087
|
+
if (!chunk23Q3I2LM_js.isExportAbortError(err)) {
|
|
7088
7088
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7089
7089
|
}
|
|
7090
7090
|
} finally {
|
|
@@ -7114,21 +7114,21 @@ function useExportHandlers(input) {
|
|
|
7114
7114
|
{
|
|
7115
7115
|
scale: 2,
|
|
7116
7116
|
onProgress: (current, total) => {
|
|
7117
|
-
setExportProgress(
|
|
7118
|
-
setExportStatusMessage(
|
|
7117
|
+
setExportProgress(chunk23Q3I2LM_js.slideProgressPercent(current, total));
|
|
7118
|
+
setExportStatusMessage(chunk23Q3I2LM_js.slideStatusLabel("Rendering", current, total));
|
|
7119
7119
|
},
|
|
7120
7120
|
signal: abortCtrl.signal
|
|
7121
7121
|
}
|
|
7122
7122
|
);
|
|
7123
|
-
setExportProgress(
|
|
7123
|
+
setExportProgress(chunk23Q3I2LM_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7124
7124
|
setExportStatusMessage("Building PDF...");
|
|
7125
7125
|
await new Promise((r) => {
|
|
7126
7126
|
setTimeout(r, 100);
|
|
7127
7127
|
});
|
|
7128
|
-
setExportProgress(
|
|
7128
|
+
setExportProgress(chunk23Q3I2LM_js.EXPORT_DONE_PERCENT);
|
|
7129
7129
|
setExportStatusMessage("Done!");
|
|
7130
7130
|
} catch (err) {
|
|
7131
|
-
if (!
|
|
7131
|
+
if (!chunk23Q3I2LM_js.isExportAbortError(err)) {
|
|
7132
7132
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7133
7133
|
}
|
|
7134
7134
|
} finally {
|
|
@@ -7169,22 +7169,22 @@ function useExportHandlers(input) {
|
|
|
7169
7169
|
scale: 1,
|
|
7170
7170
|
slideDurationMs: 3e3,
|
|
7171
7171
|
onProgress: (current, total) => {
|
|
7172
|
-
setExportProgress(
|
|
7173
|
-
setExportStatusMessage(
|
|
7172
|
+
setExportProgress(chunk23Q3I2LM_js.slideProgressPercent(current, total, 45));
|
|
7173
|
+
setExportStatusMessage(chunk23Q3I2LM_js.slideStatusLabel("Capturing", current, total));
|
|
7174
7174
|
},
|
|
7175
7175
|
onRecordProgress: (current, total) => {
|
|
7176
|
-
setExportProgress(
|
|
7177
|
-
setExportStatusMessage(
|
|
7176
|
+
setExportProgress(chunk23Q3I2LM_js.recordProgressPercent(current, total));
|
|
7177
|
+
setExportStatusMessage(chunk23Q3I2LM_js.slideStatusLabel("Recording", current, total));
|
|
7178
7178
|
},
|
|
7179
7179
|
signal: abortCtrl.signal
|
|
7180
7180
|
}
|
|
7181
7181
|
);
|
|
7182
|
-
setExportProgress(
|
|
7182
|
+
setExportProgress(chunk23Q3I2LM_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7183
7183
|
setExportStatusMessage("Saving file...");
|
|
7184
7184
|
downloadBlob2(blob, "presentation.webm");
|
|
7185
|
-
setExportProgress(
|
|
7185
|
+
setExportProgress(chunk23Q3I2LM_js.EXPORT_DONE_PERCENT);
|
|
7186
7186
|
} catch (err) {
|
|
7187
|
-
if (!
|
|
7187
|
+
if (!chunk23Q3I2LM_js.isExportAbortError(err)) {
|
|
7188
7188
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7189
7189
|
}
|
|
7190
7190
|
} finally {
|
|
@@ -7212,18 +7212,18 @@ function useExportHandlers(input) {
|
|
|
7212
7212
|
scale: 0.5,
|
|
7213
7213
|
slideDurationMs: 2e3,
|
|
7214
7214
|
onProgress: (current, total) => {
|
|
7215
|
-
setExportProgress(
|
|
7216
|
-
setExportStatusMessage(
|
|
7215
|
+
setExportProgress(chunk23Q3I2LM_js.slideProgressPercent(current, total));
|
|
7216
|
+
setExportStatusMessage(chunk23Q3I2LM_js.slideStatusLabel("Encoding", current, total));
|
|
7217
7217
|
},
|
|
7218
7218
|
signal: abortCtrl.signal
|
|
7219
7219
|
}
|
|
7220
7220
|
);
|
|
7221
|
-
setExportProgress(
|
|
7221
|
+
setExportProgress(chunk23Q3I2LM_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7222
7222
|
setExportStatusMessage("Saving file...");
|
|
7223
7223
|
downloadBlob2(blob, "presentation.gif");
|
|
7224
|
-
setExportProgress(
|
|
7224
|
+
setExportProgress(chunk23Q3I2LM_js.EXPORT_DONE_PERCENT);
|
|
7225
7225
|
} catch (err) {
|
|
7226
|
-
if (!
|
|
7226
|
+
if (!chunk23Q3I2LM_js.isExportAbortError(err)) {
|
|
7227
7227
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7228
7228
|
}
|
|
7229
7229
|
} finally {
|
|
@@ -7263,7 +7263,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7263
7263
|
}
|
|
7264
7264
|
printWindow.document.open();
|
|
7265
7265
|
printWindow.document.write(
|
|
7266
|
-
|
|
7266
|
+
chunk23Q3I2LM_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7267
7267
|
);
|
|
7268
7268
|
printWindow.document.close();
|
|
7269
7269
|
printWindow.focus();
|
|
@@ -7324,7 +7324,7 @@ function usePrintHandlers(input) {
|
|
|
7324
7324
|
if (svgs.length === 0) {
|
|
7325
7325
|
return;
|
|
7326
7326
|
}
|
|
7327
|
-
const printDoc =
|
|
7327
|
+
const printDoc = chunk23Q3I2LM_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7328
7328
|
title: "Slides (Vector)",
|
|
7329
7329
|
orientation: settings.orientation,
|
|
7330
7330
|
colorFilter
|
|
@@ -7360,7 +7360,7 @@ function usePrintHandlers(input) {
|
|
|
7360
7360
|
if (settings.printWhat === "outline") {
|
|
7361
7361
|
openPrintWindow(
|
|
7362
7362
|
"Outline",
|
|
7363
|
-
`<div class="outline-page">${
|
|
7363
|
+
`<div class="outline-page">${chunk23Q3I2LM_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7364
7364
|
settings.orientation,
|
|
7365
7365
|
colorFilter,
|
|
7366
7366
|
settings.frameSlides
|
|
@@ -7385,7 +7385,7 @@ function usePrintHandlers(input) {
|
|
|
7385
7385
|
if (settings.printWhat === "slides") {
|
|
7386
7386
|
openPrintWindow(
|
|
7387
7387
|
"Slides",
|
|
7388
|
-
|
|
7388
|
+
chunk23Q3I2LM_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7389
7389
|
settings.orientation,
|
|
7390
7390
|
colorFilter,
|
|
7391
7391
|
settings.frameSlides
|
|
@@ -7395,7 +7395,7 @@ function usePrintHandlers(input) {
|
|
|
7395
7395
|
if (settings.printWhat === "notes") {
|
|
7396
7396
|
openPrintWindow(
|
|
7397
7397
|
"Notes Pages",
|
|
7398
|
-
|
|
7398
|
+
chunk23Q3I2LM_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7399
7399
|
"portrait",
|
|
7400
7400
|
colorFilter,
|
|
7401
7401
|
settings.frameSlides
|
|
@@ -7406,7 +7406,7 @@ function usePrintHandlers(input) {
|
|
|
7406
7406
|
const spp = settings.slidesPerPage;
|
|
7407
7407
|
openPrintWindow(
|
|
7408
7408
|
`Handout ${spp} per page`,
|
|
7409
|
-
|
|
7409
|
+
chunk23Q3I2LM_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7410
7410
|
"portrait",
|
|
7411
7411
|
colorFilter,
|
|
7412
7412
|
settings.frameSlides
|
|
@@ -7470,8 +7470,8 @@ function useThemeHandlers(input) {
|
|
|
7470
7470
|
return;
|
|
7471
7471
|
}
|
|
7472
7472
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7473
|
-
const previousMap = theme?.colorScheme ?
|
|
7474
|
-
setSlides((prev) =>
|
|
7473
|
+
const previousMap = theme?.colorScheme ? chunk23Q3I2LM_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7474
|
+
setSlides((prev) => chunk23Q3I2LM_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7475
7475
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7476
7476
|
bumpHistory();
|
|
7477
7477
|
history.markDirty();
|
|
@@ -7576,7 +7576,7 @@ function useThemeSwitching(input) {
|
|
|
7576
7576
|
}
|
|
7577
7577
|
try {
|
|
7578
7578
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7579
|
-
const newData =
|
|
7579
|
+
const newData = chunk23Q3I2LM_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7580
7580
|
onDataChange(newData);
|
|
7581
7581
|
onThemeChanged?.(preset);
|
|
7582
7582
|
} catch (error) {
|
|
@@ -7593,7 +7593,7 @@ function useThemeSwitching(input) {
|
|
|
7593
7593
|
}
|
|
7594
7594
|
try {
|
|
7595
7595
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7596
|
-
const newData =
|
|
7596
|
+
const newData = chunk23Q3I2LM_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7597
7597
|
onDataChange(newData);
|
|
7598
7598
|
} catch (error) {
|
|
7599
7599
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7605,12 +7605,12 @@ function useThemeSwitching(input) {
|
|
|
7605
7605
|
if (!data?.theme?.colorScheme) {
|
|
7606
7606
|
return void 0;
|
|
7607
7607
|
}
|
|
7608
|
-
return
|
|
7609
|
-
(p) =>
|
|
7608
|
+
return chunk23Q3I2LM_js.THEME_PRESETS.find(
|
|
7609
|
+
(p) => chunk23Q3I2LM_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7610
7610
|
);
|
|
7611
7611
|
}, [data?.theme?.colorScheme]);
|
|
7612
7612
|
return {
|
|
7613
|
-
presets:
|
|
7613
|
+
presets: chunk23Q3I2LM_js.THEME_PRESETS,
|
|
7614
7614
|
switchToPreset,
|
|
7615
7615
|
switchToCustom,
|
|
7616
7616
|
currentPreset
|
|
@@ -7685,7 +7685,7 @@ function usePropertyHandlers(input) {
|
|
|
7685
7685
|
}
|
|
7686
7686
|
try {
|
|
7687
7687
|
const ab = await file.arrayBuffer();
|
|
7688
|
-
const h = new
|
|
7688
|
+
const h = new chunk23Q3I2LM_js.PptxHandler();
|
|
7689
7689
|
const other = await h.load(ab);
|
|
7690
7690
|
if (!other) {
|
|
7691
7691
|
return;
|
|
@@ -7695,7 +7695,7 @@ function usePropertyHandlers(input) {
|
|
|
7695
7695
|
width: canvasSize.width,
|
|
7696
7696
|
height: canvasSize.height
|
|
7697
7697
|
};
|
|
7698
|
-
setCompareResult(
|
|
7698
|
+
setCompareResult(chunk23Q3I2LM_js.comparePresentation(cur, other));
|
|
7699
7699
|
setIsComparePanelOpen(true);
|
|
7700
7700
|
} catch (err) {
|
|
7701
7701
|
console.warn("Compare failed:", err);
|
|
@@ -7712,7 +7712,7 @@ function usePropertyHandlers(input) {
|
|
|
7712
7712
|
if (!diff || diff.status === "unchanged") {
|
|
7713
7713
|
return;
|
|
7714
7714
|
}
|
|
7715
|
-
setSlides((prev) =>
|
|
7715
|
+
setSlides((prev) => chunk23Q3I2LM_js.applyAcceptSlide(prev, diff));
|
|
7716
7716
|
setIsDirty(true);
|
|
7717
7717
|
},
|
|
7718
7718
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7723,10 +7723,10 @@ function usePropertyHandlers(input) {
|
|
|
7723
7723
|
if (!compareResult) {
|
|
7724
7724
|
return;
|
|
7725
7725
|
}
|
|
7726
|
-
setSlides((prev) =>
|
|
7726
|
+
setSlides((prev) => chunk23Q3I2LM_js.applyAcceptAllSlides(prev, compareResult));
|
|
7727
7727
|
setIsDirty(true);
|
|
7728
7728
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7729
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7729
|
+
const usedFontFamilies = react.useMemo(() => chunk23Q3I2LM_js.collectUsedFonts(slides), [slides]);
|
|
7730
7730
|
return {
|
|
7731
7731
|
handleUpdateNotes,
|
|
7732
7732
|
handleUpdateSlide,
|
|
@@ -7845,7 +7845,7 @@ function useIsMobile(input) {
|
|
|
7845
7845
|
const containerRef = input?.containerRef;
|
|
7846
7846
|
const isTouchDevice = react.useSyncExternalStore(
|
|
7847
7847
|
subscribeTouchCapability,
|
|
7848
|
-
|
|
7848
|
+
chunk23Q3I2LM_js.detectTouchDevice,
|
|
7849
7849
|
() => false
|
|
7850
7850
|
// server snapshot
|
|
7851
7851
|
);
|
|
@@ -7861,7 +7861,7 @@ function useIsMobile(input) {
|
|
|
7861
7861
|
}
|
|
7862
7862
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
7863
7863
|
});
|
|
7864
|
-
const [orientation, setOrientation] = react.useState(
|
|
7864
|
+
const [orientation, setOrientation] = react.useState(chunk23Q3I2LM_js.detectOrientation);
|
|
7865
7865
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
7866
7866
|
const [initialViewportHeight] = react.useState(
|
|
7867
7867
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -7905,7 +7905,7 @@ function useIsMobile(input) {
|
|
|
7905
7905
|
return;
|
|
7906
7906
|
}
|
|
7907
7907
|
const handleOrientationChange = () => {
|
|
7908
|
-
setOrientation(
|
|
7908
|
+
setOrientation(chunk23Q3I2LM_js.detectOrientation());
|
|
7909
7909
|
};
|
|
7910
7910
|
if (screen.orientation) {
|
|
7911
7911
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -7935,9 +7935,9 @@ function useIsMobile(input) {
|
|
|
7935
7935
|
window.addEventListener("resize", handleResize);
|
|
7936
7936
|
return () => window.removeEventListener("resize", handleResize);
|
|
7937
7937
|
}, [isTouchDevice, initialViewportHeight]);
|
|
7938
|
-
const isMobile =
|
|
7939
|
-
const isTablet = !isMobile && containerWidth >=
|
|
7940
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
7938
|
+
const isMobile = chunk23Q3I2LM_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
7939
|
+
const isTablet = !isMobile && containerWidth >= chunk23Q3I2LM_js.MOBILE_BREAKPOINT && containerWidth < chunk23Q3I2LM_js.TABLET_BREAKPOINT;
|
|
7940
|
+
const isDesktop = !isMobile && containerWidth >= chunk23Q3I2LM_js.TABLET_BREAKPOINT;
|
|
7941
7941
|
return {
|
|
7942
7942
|
isMobile,
|
|
7943
7943
|
isTablet,
|
|
@@ -7998,11 +7998,11 @@ function useViewerDialogs(input) {
|
|
|
7998
7998
|
);
|
|
7999
7999
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(false);
|
|
8000
8000
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8001
|
-
() => typeof window !== "undefined" ?
|
|
8001
|
+
() => typeof window !== "undefined" ? chunk23Q3I2LM_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8002
8002
|
);
|
|
8003
8003
|
react.useEffect(() => {
|
|
8004
8004
|
const handleWindow = () => setIsNarrowViewport(
|
|
8005
|
-
|
|
8005
|
+
chunk23Q3I2LM_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8006
8006
|
);
|
|
8007
8007
|
let observer = null;
|
|
8008
8008
|
let raf = 0;
|
|
@@ -8016,12 +8016,12 @@ function useViewerDialogs(input) {
|
|
|
8016
8016
|
const entry = entries[0];
|
|
8017
8017
|
if (entry) {
|
|
8018
8018
|
setIsNarrowViewport(
|
|
8019
|
-
|
|
8019
|
+
chunk23Q3I2LM_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8020
8020
|
);
|
|
8021
8021
|
}
|
|
8022
8022
|
});
|
|
8023
8023
|
observer.observe(el);
|
|
8024
|
-
setIsNarrowViewport(
|
|
8024
|
+
setIsNarrowViewport(chunk23Q3I2LM_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8025
8025
|
};
|
|
8026
8026
|
attach();
|
|
8027
8027
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8179,12 +8179,12 @@ function useViewerDialogs(input) {
|
|
|
8179
8179
|
}
|
|
8180
8180
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8181
8181
|
if (presentationGridSpacing) {
|
|
8182
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8182
|
+
const px = Math.round(presentationGridSpacing.cx / chunkFFLUALX5_js.EMU_PER_PX);
|
|
8183
8183
|
if (px > 0) {
|
|
8184
8184
|
return px;
|
|
8185
8185
|
}
|
|
8186
8186
|
}
|
|
8187
|
-
return
|
|
8187
|
+
return chunkFFLUALX5_js.GRID_SIZE;
|
|
8188
8188
|
}
|
|
8189
8189
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8190
8190
|
if (activeCustomShowId) {
|
|
@@ -8198,8 +8198,8 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
|
8198
8198
|
return slides.map((_, i) => i).filter((i) => !slides[i]?.hidden);
|
|
8199
8199
|
}
|
|
8200
8200
|
function computeSlideSectionGroups(slides, sections) {
|
|
8201
|
-
return
|
|
8202
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8201
|
+
return chunk23Q3I2LM_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8202
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkFFLUALX5_js.UNGROUPED_SECTION_ID : "default"),
|
|
8203
8203
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8204
8204
|
slideIndexes: group.slideIndexes,
|
|
8205
8205
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8254,7 +8254,7 @@ function useDerivedSlideState(input) {
|
|
|
8254
8254
|
);
|
|
8255
8255
|
const slideSectionGroups = react.useMemo(
|
|
8256
8256
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8257
|
-
if (group.id ===
|
|
8257
|
+
if (group.id === chunkFFLUALX5_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8258
8258
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8259
8259
|
}
|
|
8260
8260
|
if (group.id === "default" && group.label === "Slides") {
|
|
@@ -8357,13 +8357,13 @@ function useAnnotationHandlers(input) {
|
|
|
8357
8357
|
}, [annotations, setMode, setSlides, history]);
|
|
8358
8358
|
const handleSetMode = react.useCallback(
|
|
8359
8359
|
(nextMode) => {
|
|
8360
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8360
|
+
if (mode === "present" && nextMode !== "present" && !chunk23Q3I2LM_js.mayLeaveSlideShow()) {
|
|
8361
8361
|
return;
|
|
8362
8362
|
}
|
|
8363
8363
|
if (nextMode === "present") {
|
|
8364
8364
|
presentation.enterPresentMode();
|
|
8365
8365
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8366
|
-
|
|
8366
|
+
chunkFFLUALX5_js.stopAllPersistentAudio();
|
|
8367
8367
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8368
8368
|
if (promptKeepInkAnnotations) {
|
|
8369
8369
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8372,7 +8372,7 @@ function useAnnotationHandlers(input) {
|
|
|
8372
8372
|
}
|
|
8373
8373
|
} else {
|
|
8374
8374
|
if (mode === "present") {
|
|
8375
|
-
|
|
8375
|
+
chunkFFLUALX5_js.stopAllPersistentAudio();
|
|
8376
8376
|
}
|
|
8377
8377
|
setMode(nextMode);
|
|
8378
8378
|
}
|
|
@@ -8438,13 +8438,13 @@ function useSerialize(input) {
|
|
|
8438
8438
|
let processedSlide = slide;
|
|
8439
8439
|
if (pendingEditId) {
|
|
8440
8440
|
const updatedElements = slide.elements.map((el) => {
|
|
8441
|
-
if (el.id !== pendingEditId || !
|
|
8441
|
+
if (el.id !== pendingEditId || !chunk23Q3I2LM_js.hasTextProperties(el)) {
|
|
8442
8442
|
return el;
|
|
8443
8443
|
}
|
|
8444
8444
|
return {
|
|
8445
8445
|
...el,
|
|
8446
8446
|
text: pendingEditText,
|
|
8447
|
-
textSegments:
|
|
8447
|
+
textSegments: chunk23Q3I2LM_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8448
8448
|
};
|
|
8449
8449
|
});
|
|
8450
8450
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8457,14 +8457,14 @@ function useSerialize(input) {
|
|
|
8457
8457
|
const pptxGuides = guides.map((g) => ({
|
|
8458
8458
|
id: g.id,
|
|
8459
8459
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8460
|
-
positionEmu:
|
|
8460
|
+
positionEmu: chunk23Q3I2LM_js.guidePxToEmu(g.position)
|
|
8461
8461
|
}));
|
|
8462
8462
|
return {
|
|
8463
8463
|
...processedSlide,
|
|
8464
8464
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8465
8465
|
};
|
|
8466
8466
|
});
|
|
8467
|
-
const slidesToSave =
|
|
8467
|
+
const slidesToSave = chunkFFLUALX5_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8468
8468
|
const saveOptions = {
|
|
8469
8469
|
headerFooter,
|
|
8470
8470
|
presentationProperties,
|
|
@@ -8633,7 +8633,7 @@ function usePresentationSetup(input) {
|
|
|
8633
8633
|
containerRef,
|
|
8634
8634
|
content,
|
|
8635
8635
|
onSetMode: (nextMode) => {
|
|
8636
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8636
|
+
if (mode === "present" && nextMode !== "present" && !chunk23Q3I2LM_js.mayLeaveSlideShow()) {
|
|
8637
8637
|
return;
|
|
8638
8638
|
}
|
|
8639
8639
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8641,7 +8641,7 @@ function usePresentationSetup(input) {
|
|
|
8641
8641
|
setShowKeepAnnotationsDialog(true);
|
|
8642
8642
|
} else {
|
|
8643
8643
|
if (mode === "present" && nextMode !== "present") {
|
|
8644
|
-
|
|
8644
|
+
chunkFFLUALX5_js.stopAllPersistentAudio();
|
|
8645
8645
|
stopAnimationSound();
|
|
8646
8646
|
}
|
|
8647
8647
|
setMode(nextMode);
|
|
@@ -8695,10 +8695,10 @@ function usePresentationSetup(input) {
|
|
|
8695
8695
|
onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
|
|
8696
8696
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8697
8697
|
onSaveRehearsalTimings: (timings) => {
|
|
8698
|
-
setSlides((prev) =>
|
|
8698
|
+
setSlides((prev) => chunk23Q3I2LM_js.applyRehearsalTimings(prev, timings));
|
|
8699
8699
|
history.markDirty();
|
|
8700
8700
|
},
|
|
8701
|
-
loopContinuously:
|
|
8701
|
+
loopContinuously: chunk23Q3I2LM_js.shouldLoopContinuously(presentationProperties),
|
|
8702
8702
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8703
8703
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8704
8704
|
endWithBlackSlide
|
|
@@ -8860,7 +8860,7 @@ function useEditorOperations(input) {
|
|
|
8860
8860
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
8861
8861
|
react.useEffect(() => {
|
|
8862
8862
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
8863
|
-
copiedFormatRef.current =
|
|
8863
|
+
copiedFormatRef.current = chunk23Q3I2LM_js.copyFormatFromElement(selectedElement);
|
|
8864
8864
|
} else if (!formatPainterActive) {
|
|
8865
8865
|
copiedFormatRef.current = null;
|
|
8866
8866
|
}
|
|
@@ -8886,12 +8886,12 @@ function useEditorOperations(input) {
|
|
|
8886
8886
|
e.stopPropagation();
|
|
8887
8887
|
const element = elementLookup.get(elementId);
|
|
8888
8888
|
if (element) {
|
|
8889
|
-
const updated =
|
|
8889
|
+
const updated = chunk23Q3I2LM_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
8890
8890
|
const updates = {};
|
|
8891
|
-
if (
|
|
8891
|
+
if (chunk23Q3I2LM_js.hasShapeProperties(updated)) {
|
|
8892
8892
|
updates.shapeStyle = updated.shapeStyle;
|
|
8893
8893
|
}
|
|
8894
|
-
if (
|
|
8894
|
+
if (chunk23Q3I2LM_js.hasTextProperties(updated)) {
|
|
8895
8895
|
updates.textStyle = updated.textStyle;
|
|
8896
8896
|
}
|
|
8897
8897
|
ops.updateElementById(elementId, updates);
|
|
@@ -9038,7 +9038,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9038
9038
|
const families = /* @__PURE__ */ new Set();
|
|
9039
9039
|
for (const slide of slides) {
|
|
9040
9040
|
for (const el of slide.elements) {
|
|
9041
|
-
if (
|
|
9041
|
+
if (chunk23Q3I2LM_js.hasTextProperties(el) && el.textSegments) {
|
|
9042
9042
|
for (const seg of el.textSegments) {
|
|
9043
9043
|
if (seg.style.fontFamily) {
|
|
9044
9044
|
families.add(seg.style.fontFamily);
|
|
@@ -9607,7 +9607,7 @@ function useViewerIntegration(input) {
|
|
|
9607
9607
|
return zoom.scale;
|
|
9608
9608
|
},
|
|
9609
9609
|
setZoom(level) {
|
|
9610
|
-
zoom.setScale(Math.min(Math.max(level,
|
|
9610
|
+
zoom.setScale(Math.min(Math.max(level, chunkFFLUALX5_js.MIN_ZOOM_SCALE), chunkFFLUALX5_js.MAX_ZOOM_SCALE));
|
|
9611
9611
|
},
|
|
9612
9612
|
zoomIn() {
|
|
9613
9613
|
zoom.handleZoomIn();
|
|
@@ -9822,7 +9822,7 @@ function useReducedMotion() {
|
|
|
9822
9822
|
}
|
|
9823
9823
|
function useViewerOptions() {
|
|
9824
9824
|
const storeRef = react.useRef(null);
|
|
9825
|
-
storeRef.current ??=
|
|
9825
|
+
storeRef.current ??= chunk23Q3I2LM_js.createViewerOptionsStore();
|
|
9826
9826
|
const store = storeRef.current;
|
|
9827
9827
|
const options = react.useSyncExternalStore(
|
|
9828
9828
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9831,9 +9831,9 @@ function useViewerOptions() {
|
|
|
9831
9831
|
);
|
|
9832
9832
|
return { optionsStore: store, options };
|
|
9833
9833
|
}
|
|
9834
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9834
|
+
var KNOWN_TAB_IDS = new Set(chunk23Q3I2LM_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9835
9835
|
function computeToolbarVisibility(hiddenActions) {
|
|
9836
|
-
const isHidden = (id) =>
|
|
9836
|
+
const isHidden = (id) => chunk23Q3I2LM_js.isActionHidden(id, hiddenActions);
|
|
9837
9837
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
9838
9838
|
return { isHidden, isTabVisible };
|
|
9839
9839
|
}
|
|
@@ -9918,12 +9918,12 @@ function useYjsDocumentSync({
|
|
|
9918
9918
|
return;
|
|
9919
9919
|
}
|
|
9920
9920
|
try {
|
|
9921
|
-
const handler = new
|
|
9921
|
+
const handler = new chunk23Q3I2LM_js.PptxHandler();
|
|
9922
9922
|
await handler.load(sourceBytes.buffer);
|
|
9923
|
-
const currentSlides =
|
|
9923
|
+
const currentSlides = chunk23Q3I2LM_js.readSlidesFromYDoc(
|
|
9924
9924
|
doc
|
|
9925
9925
|
);
|
|
9926
|
-
const slidesToSave =
|
|
9926
|
+
const slidesToSave = chunkFFLUALX5_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
9927
9927
|
const bytes = await handler.save(slidesToSave);
|
|
9928
9928
|
config.onWriteBack(bytes);
|
|
9929
9929
|
} catch {
|
|
@@ -9938,7 +9938,7 @@ function useYjsDocumentSync({
|
|
|
9938
9938
|
if (!doc || !isConnected) {
|
|
9939
9939
|
return;
|
|
9940
9940
|
}
|
|
9941
|
-
const docSlides =
|
|
9941
|
+
const docSlides = chunk23Q3I2LM_js.readSlidesFromYDoc(
|
|
9942
9942
|
doc
|
|
9943
9943
|
);
|
|
9944
9944
|
if (docSlides.length === 0) {
|
|
@@ -9960,11 +9960,11 @@ function useYjsDocumentSync({
|
|
|
9960
9960
|
lastSyncedRef.current = serialized;
|
|
9961
9961
|
void (async () => {
|
|
9962
9962
|
const factories = await getFactories();
|
|
9963
|
-
|
|
9963
|
+
chunk23Q3I2LM_js.reconcileSlidesInYDoc(
|
|
9964
9964
|
slides,
|
|
9965
9965
|
doc,
|
|
9966
9966
|
factories,
|
|
9967
|
-
|
|
9967
|
+
chunk23Q3I2LM_js.LOCAL_SYNC_ORIGIN
|
|
9968
9968
|
);
|
|
9969
9969
|
scheduleWriteBack();
|
|
9970
9970
|
})();
|
|
@@ -9978,10 +9978,10 @@ function useYjsDocumentSync({
|
|
|
9978
9978
|
return;
|
|
9979
9979
|
}
|
|
9980
9980
|
const handleChange = (_events, transaction) => {
|
|
9981
|
-
if (transaction?.origin ===
|
|
9981
|
+
if (transaction?.origin === chunk23Q3I2LM_js.LOCAL_SYNC_ORIGIN) {
|
|
9982
9982
|
return;
|
|
9983
9983
|
}
|
|
9984
|
-
const remoteSlides =
|
|
9984
|
+
const remoteSlides = chunk23Q3I2LM_js.readSlidesFromYDoc(
|
|
9985
9985
|
doc
|
|
9986
9986
|
);
|
|
9987
9987
|
if (remoteSlides.length === 0) {
|
|
@@ -9997,7 +9997,7 @@ function useYjsDocumentSync({
|
|
|
9997
9997
|
isApplyingRemoteRef.current = false;
|
|
9998
9998
|
scheduleWriteBack();
|
|
9999
9999
|
};
|
|
10000
|
-
const unobserve =
|
|
10000
|
+
const unobserve = chunk23Q3I2LM_js.observeYDocSlides(
|
|
10001
10001
|
doc,
|
|
10002
10002
|
handleChange
|
|
10003
10003
|
);
|
|
@@ -10035,7 +10035,7 @@ function useBroadcastFollower({
|
|
|
10035
10035
|
if (!broadcaster) {
|
|
10036
10036
|
return;
|
|
10037
10037
|
}
|
|
10038
|
-
if (!
|
|
10038
|
+
if (!chunk23Q3I2LM_js.shouldAutoFollowBroadcaster({
|
|
10039
10039
|
localRole: collab.config.role,
|
|
10040
10040
|
broadcasterRole: broadcaster.role
|
|
10041
10041
|
})) {
|
|
@@ -10195,10 +10195,10 @@ function useTouchGestures(input) {
|
|
|
10195
10195
|
if (!el || !enabled) {
|
|
10196
10196
|
return;
|
|
10197
10197
|
}
|
|
10198
|
-
const recognizer =
|
|
10198
|
+
const recognizer = chunk23Q3I2LM_js.createTouchGestureRecognizer({
|
|
10199
10199
|
getScale: () => scaleRef.current,
|
|
10200
|
-
minScale:
|
|
10201
|
-
maxScale:
|
|
10200
|
+
minScale: chunkFFLUALX5_js.MIN_ZOOM_SCALE,
|
|
10201
|
+
maxScale: chunkFFLUALX5_js.MAX_ZOOM_SCALE,
|
|
10202
10202
|
callbacks: {
|
|
10203
10203
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10204
10204
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10238,7 +10238,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10238
10238
|
return;
|
|
10239
10239
|
}
|
|
10240
10240
|
const rect = active.getBoundingClientRect();
|
|
10241
|
-
const delta =
|
|
10241
|
+
const delta = chunk23Q3I2LM_js.computeScrollDelta(
|
|
10242
10242
|
{ top: rect.top, bottom: rect.bottom },
|
|
10243
10243
|
window.innerHeight,
|
|
10244
10244
|
keyboardInset
|
|
@@ -10258,8 +10258,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10258
10258
|
return;
|
|
10259
10259
|
}
|
|
10260
10260
|
const update = () => {
|
|
10261
|
-
const metrics =
|
|
10262
|
-
const inset = metrics ?
|
|
10261
|
+
const metrics = chunk23Q3I2LM_js.readViewportMetrics(window);
|
|
10262
|
+
const inset = metrics ? chunk23Q3I2LM_js.computeKeyboardInset(metrics) : 0;
|
|
10263
10263
|
setKeyboardInset(inset);
|
|
10264
10264
|
if (inset > 0) {
|
|
10265
10265
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10270,8 +10270,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10270
10270
|
vv.addEventListener("scroll", update);
|
|
10271
10271
|
const onFocusIn = () => {
|
|
10272
10272
|
window.requestAnimationFrame(() => {
|
|
10273
|
-
const metrics =
|
|
10274
|
-
const inset = metrics ?
|
|
10273
|
+
const metrics = chunk23Q3I2LM_js.readViewportMetrics(window);
|
|
10274
|
+
const inset = metrics ? chunk23Q3I2LM_js.computeKeyboardInset(metrics) : 0;
|
|
10275
10275
|
if (inset > 0) {
|
|
10276
10276
|
scrollFocusedIntoView(inset);
|
|
10277
10277
|
}
|
|
@@ -10284,7 +10284,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10284
10284
|
document.removeEventListener("focusin", onFocusIn);
|
|
10285
10285
|
};
|
|
10286
10286
|
}, [enabled]);
|
|
10287
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10287
|
+
return { keyboardInset, isKeyboardOpen: chunk23Q3I2LM_js.isKeyboardOpen(keyboardInset) };
|
|
10288
10288
|
}
|
|
10289
10289
|
|
|
10290
10290
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10339,13 +10339,13 @@ function buildCanvasProps(input) {
|
|
|
10339
10339
|
if (mode === "present") {
|
|
10340
10340
|
presentation.handlePresentationAction(action);
|
|
10341
10341
|
} else if (action.url) {
|
|
10342
|
-
|
|
10342
|
+
chunk23Q3I2LM_js.safeOpenUrl(action.url);
|
|
10343
10343
|
}
|
|
10344
10344
|
};
|
|
10345
10345
|
const handleHyperlinkClick = (url) => {
|
|
10346
|
-
if (
|
|
10346
|
+
if (chunk23Q3I2LM_js.isPpactionUrl(url)) {
|
|
10347
10347
|
if (mode === "present") {
|
|
10348
|
-
const parsed =
|
|
10348
|
+
const parsed = chunk23Q3I2LM_js.parsePpactionUrl(url);
|
|
10349
10349
|
if (parsed) {
|
|
10350
10350
|
presentation.handlePresentationAction({
|
|
10351
10351
|
action: parsed.action,
|
|
@@ -10355,7 +10355,7 @@ function buildCanvasProps(input) {
|
|
|
10355
10355
|
}
|
|
10356
10356
|
return;
|
|
10357
10357
|
}
|
|
10358
|
-
|
|
10358
|
+
chunk23Q3I2LM_js.safeOpenUrl(url);
|
|
10359
10359
|
};
|
|
10360
10360
|
return {
|
|
10361
10361
|
activeSlide: effectiveSlide,
|
|
@@ -10675,7 +10675,7 @@ function buildToolbarProps(input) {
|
|
|
10675
10675
|
onOpenFile,
|
|
10676
10676
|
onOpenRecentFile,
|
|
10677
10677
|
onCreatePresentation: (templateId) => {
|
|
10678
|
-
s.setSlides(
|
|
10678
|
+
s.setSlides(chunk23Q3I2LM_js.createBackstagePresentation(templateId));
|
|
10679
10679
|
s.setActiveSlideIndex(0);
|
|
10680
10680
|
s.setSelectedElementId(null);
|
|
10681
10681
|
s.setSelectedElementIds([]);
|
|
@@ -10730,7 +10730,7 @@ function buildToolbarProps(input) {
|
|
|
10730
10730
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10731
10731
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10732
10732
|
formatPainterActive: s.formatPainterActive,
|
|
10733
|
-
canActivateFormatPainter:
|
|
10733
|
+
canActivateFormatPainter: chunk23Q3I2LM_js.hasCopyableFormat(selectedElement),
|
|
10734
10734
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10735
10735
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10736
10736
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -10993,7 +10993,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
10993
10993
|
}, [incomingContent]);
|
|
10994
10994
|
const onOpenFile = react.useCallback(() => {
|
|
10995
10995
|
void (async () => {
|
|
10996
|
-
const picked = await
|
|
10996
|
+
const picked = await chunk23Q3I2LM_js.openPptxFile();
|
|
10997
10997
|
if (picked) {
|
|
10998
10998
|
setContent(picked.buffer);
|
|
10999
10999
|
}
|
|
@@ -11001,7 +11001,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11001
11001
|
}, []);
|
|
11002
11002
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11003
11003
|
void (async () => {
|
|
11004
|
-
const bytes = await
|
|
11004
|
+
const bytes = await chunk23Q3I2LM_js.readBackstageRecentFile(key);
|
|
11005
11005
|
if (bytes) {
|
|
11006
11006
|
setContent(bytes);
|
|
11007
11007
|
}
|