pptx-react-viewer 2.5.3 → 2.6.1
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 +9 -0
- package/dist/{AiChatPanel-DPMHPOWF.js → AiChatPanel-LBK6YRKH.js} +22 -22
- package/dist/AiChatPanel-LBK6YRKH.js.br +0 -0
- package/dist/AiChatPanel-LBK6YRKH.js.gz +0 -0
- package/dist/{AiChatPanel-OFOOWR4U.mjs → AiChatPanel-RVZOGGFK.mjs} +3 -3
- package/dist/AiChatPanel-RVZOGGFK.mjs.br +0 -0
- package/dist/AiChatPanel-RVZOGGFK.mjs.gz +0 -0
- package/dist/{Model3DScene-PD2MDBIE.js → Model3DScene-L46RNRU5.js} +2 -2
- package/dist/Model3DScene-L46RNRU5.js.br +0 -0
- package/dist/Model3DScene-L46RNRU5.js.gz +0 -0
- package/dist/{Model3DScene-P4OKVQBF.mjs → Model3DScene-WBUZ74G3.mjs} +1 -1
- package/dist/Model3DScene-WBUZ74G3.mjs.br +0 -0
- package/dist/Model3DScene-WBUZ74G3.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-TL4ZIOI4.mjs → SurfaceChart3DScene-CB32AJS4.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-TL4ZIOI4.mjs.br → SurfaceChart3DScene-CB32AJS4.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-CB32AJS4.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-FECS3THE.js → SurfaceChart3DScene-RWMGMREC.js} +2 -2
- package/dist/SurfaceChart3DScene-RWMGMREC.js.br +0 -0
- package/dist/SurfaceChart3DScene-RWMGMREC.js.gz +0 -0
- package/dist/{chunk-UUS7QT22.js → chunk-2VE3LVKZ.js} +346 -315
- package/dist/chunk-2VE3LVKZ.js.br +0 -0
- package/dist/chunk-2VE3LVKZ.js.gz +0 -0
- package/dist/{chunk-FFLUALX5.js → chunk-4O7PPQ2V.js} +260 -240
- package/dist/chunk-4O7PPQ2V.js.br +0 -0
- package/dist/chunk-4O7PPQ2V.js.gz +0 -0
- package/dist/{chunk-ZZA62IND.mjs → chunk-54FSVX3O.mjs} +35 -4
- package/dist/chunk-54FSVX3O.mjs.br +0 -0
- package/dist/chunk-54FSVX3O.mjs.gz +0 -0
- package/dist/{chunk-H2FZ2NJ7.js → chunk-AX4Q5JWN.js} +3 -3
- package/dist/chunk-AX4Q5JWN.js.br +0 -0
- package/dist/chunk-AX4Q5JWN.js.gz +0 -0
- package/dist/{chunk-F3JUUSC4.mjs → chunk-BL3WW2BS.mjs} +95 -15
- package/dist/chunk-BL3WW2BS.mjs.br +0 -0
- package/dist/chunk-BL3WW2BS.mjs.gz +0 -0
- package/dist/{chunk-6KOM27PS.mjs → chunk-EI456HZK.mjs} +964 -64
- package/dist/chunk-EI456HZK.mjs.br +0 -0
- package/dist/chunk-EI456HZK.mjs.gz +0 -0
- package/dist/{chunk-SAXG53MO.mjs → chunk-GC6HQMVG.mjs} +1 -1
- package/dist/chunk-GC6HQMVG.mjs.br +0 -0
- package/dist/chunk-GC6HQMVG.mjs.gz +0 -0
- package/dist/{chunk-USHZUHHG.js → chunk-IEFH47TF.js} +929 -849
- package/dist/chunk-IEFH47TF.js.br +0 -0
- package/dist/chunk-IEFH47TF.js.gz +0 -0
- package/dist/{chunk-23Q3I2LM.js → chunk-T7AMP24E.js} +966 -63
- package/dist/chunk-T7AMP24E.js.br +0 -0
- package/dist/chunk-T7AMP24E.js.gz +0 -0
- package/dist/{chunk-QDIF3ZXF.mjs → chunk-ZUNDIOGD.mjs} +28 -8
- package/dist/chunk-ZUNDIOGD.mjs.br +0 -0
- package/dist/chunk-ZUNDIOGD.mjs.gz +0 -0
- package/dist/index.d.ts +15 -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.d.ts +44 -0
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/viewer/index.d.ts +15 -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 +1 -1
- package/dist/AiChatPanel-DPMHPOWF.js.br +0 -0
- package/dist/AiChatPanel-DPMHPOWF.js.gz +0 -0
- package/dist/AiChatPanel-OFOOWR4U.mjs.br +0 -0
- package/dist/AiChatPanel-OFOOWR4U.mjs.gz +0 -0
- package/dist/Model3DScene-P4OKVQBF.mjs.br +0 -0
- package/dist/Model3DScene-P4OKVQBF.mjs.gz +0 -0
- package/dist/Model3DScene-PD2MDBIE.js.br +0 -0
- package/dist/Model3DScene-PD2MDBIE.js.gz +0 -0
- package/dist/SurfaceChart3DScene-FECS3THE.js.br +0 -0
- package/dist/SurfaceChart3DScene-FECS3THE.js.gz +0 -0
- package/dist/SurfaceChart3DScene-TL4ZIOI4.mjs.gz +0 -0
- package/dist/chunk-23Q3I2LM.js.br +0 -0
- package/dist/chunk-23Q3I2LM.js.gz +0 -0
- package/dist/chunk-6KOM27PS.mjs.br +0 -0
- package/dist/chunk-6KOM27PS.mjs.gz +0 -0
- package/dist/chunk-F3JUUSC4.mjs.br +0 -0
- package/dist/chunk-F3JUUSC4.mjs.gz +0 -0
- package/dist/chunk-FFLUALX5.js.br +0 -0
- package/dist/chunk-FFLUALX5.js.gz +0 -0
- package/dist/chunk-H2FZ2NJ7.js.br +0 -0
- package/dist/chunk-H2FZ2NJ7.js.gz +0 -0
- package/dist/chunk-QDIF3ZXF.mjs.br +0 -0
- package/dist/chunk-QDIF3ZXF.mjs.gz +0 -0
- package/dist/chunk-SAXG53MO.mjs.br +0 -0
- package/dist/chunk-SAXG53MO.mjs.gz +0 -0
- package/dist/chunk-USHZUHHG.js.br +0 -0
- package/dist/chunk-USHZUHHG.js.gz +0 -0
- package/dist/chunk-UUS7QT22.js.br +0 -0
- package/dist/chunk-UUS7QT22.js.gz +0 -0
- package/dist/chunk-ZZA62IND.mjs.br +0 -0
- package/dist/chunk-ZZA62IND.mjs.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk4O7PPQ2V_js = require('./chunk-4O7PPQ2V.js');
|
|
4
4
|
var chunk25VSL2BB_js = require('./chunk-25VSL2BB.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkT7AMP24E_js = require('./chunk-T7AMP24E.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 = chunkT7AMP24E_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 = chunkT7AMP24E_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 >= chunkT7AMP24E_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
|
+
}, chunkT7AMP24E_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 = chunkT7AMP24E_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 = chunkT7AMP24E_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
|
+
chunkT7AMP24E_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 = chunkT7AMP24E_js.validateRoomId(config.roomId);
|
|
243
243
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
244
|
-
departureRef.current =
|
|
244
|
+
departureRef.current = chunkT7AMP24E_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 = chunkT7AMP24E_js.validateRoomId(config.roomId);
|
|
287
|
+
const transport = config.transport ?? chunkT7AMP24E_js.resolveTransportForServerUrl(config.serverUrl);
|
|
288
288
|
if (transport === "webrtc") {
|
|
289
289
|
await initWebrtc();
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
if (
|
|
292
|
+
if (chunkT7AMP24E_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 = chunkT7AMP24E_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
|
+
chunkT7AMP24E_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
|
+
}, chunkT7AMP24E_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
|
+
chunkT7AMP24E_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 = chunkT7AMP24E_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 = chunkT7AMP24E_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(chunkT7AMP24E_js.cloneSlide),
|
|
521
|
+
templateElementsBySlideId: chunkT7AMP24E_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(chunkT7AMP24E_js.cloneSlide));
|
|
535
535
|
setTemplateElementsBySlideId(
|
|
536
|
-
|
|
536
|
+
chunkT7AMP24E_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 = chunk4O7PPQ2V_js.cloneHistorySnapshot(previousSnapshot);
|
|
571
|
+
lastHistorySnapshotRef.current = chunk4O7PPQ2V_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 = chunk4O7PPQ2V_js.cloneHistorySnapshot(nextSnapshot);
|
|
593
|
+
lastHistorySnapshotRef.current = chunk4O7PPQ2V_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 = chunk4O7PPQ2V_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 = chunk4O7PPQ2V_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(chunk4O7PPQ2V_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 = chunk4O7PPQ2V_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, chunk4O7PPQ2V_js.MIN_ZOOM_SCALE), chunk4O7PPQ2V_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, chunk4O7PPQ2V_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, chunk4O7PPQ2V_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, chunk4O7PPQ2V_js.MIN_ELEMENT_SIZE));
|
|
790
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunk4O7PPQ2V_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, chunk4O7PPQ2V_js.MIN_ELEMENT_SIZE);
|
|
797
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunk4O7PPQ2V_js.MIN_ELEMENT_SIZE);
|
|
798
798
|
const availableWidth = Math.max(
|
|
799
|
-
effectiveEditorDimensions.width -
|
|
800
|
-
|
|
799
|
+
effectiveEditorDimensions.width - chunk4O7PPQ2V_js.ZOOM_TO_SELECTION_PADDING,
|
|
800
|
+
chunk4O7PPQ2V_js.MIN_ELEMENT_SIZE
|
|
801
801
|
);
|
|
802
802
|
const availableHeight = Math.max(
|
|
803
|
-
effectiveEditorDimensions.height -
|
|
804
|
-
|
|
803
|
+
effectiveEditorDimensions.height - chunk4O7PPQ2V_js.ZOOM_TO_SELECTION_PADDING,
|
|
804
|
+
chunk4O7PPQ2V_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, chunk4O7PPQ2V_js.MIN_ZOOM_SCALE),
|
|
813
|
+
chunk4O7PPQ2V_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, chunk4O7PPQ2V_js.MIN_ZOOM_SCALE), chunk4O7PPQ2V_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
|
+
chunk4O7PPQ2V_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
|
+
chunkT7AMP24E_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 = chunkT7AMP24E_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 = chunkT7AMP24E_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 = chunkT7AMP24E_js.PRESENTATION_CHANNEL_NAME;
|
|
1278
|
+
var AUDIENCE_HASH = chunkT7AMP24E_js.PRESENTATION_HASH;
|
|
1279
|
+
var PRESENTER_MSG_ORIGIN = chunkT7AMP24E_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1280
|
+
var AUDIENCE_NONCE_KEY = chunkT7AMP24E_js.PRESENTATION_NONCE_KEY;
|
|
1281
1281
|
function generateSessionId() {
|
|
1282
|
-
return
|
|
1282
|
+
return chunkT7AMP24E_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 ? chunkT7AMP24E_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 chunkT7AMP24E_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 = chunkT7AMP24E_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1401
|
+
void chunkT7AMP24E_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1402
1402
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1403
|
-
|
|
1403
|
+
chunkT7AMP24E_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 chunkT7AMP24E_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 (chunkT7AMP24E_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 chunkT7AMP24E_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 (!chunkT7AMP24E_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 chunkT7AMP24E_js.clearAudienceContent(expectedSessionId);
|
|
1567
1567
|
}
|
|
1568
|
-
if (
|
|
1568
|
+
if (chunkT7AMP24E_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: chunkT7AMP24E_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(chunkT7AMP24E_js.createPresentationKeyBuffer());
|
|
1608
1608
|
react.useEffect(() => {
|
|
1609
|
-
if (mode !== "present" || !
|
|
1610
|
-
keyBufferRef.current =
|
|
1609
|
+
if (mode !== "present" || !chunkT7AMP24E_js.acceptsPresentationInput()) {
|
|
1610
|
+
keyBufferRef.current = chunkT7AMP24E_js.createPresentationKeyBuffer();
|
|
1611
1611
|
return;
|
|
1612
1612
|
}
|
|
1613
1613
|
const handleKeyDown = (event) => {
|
|
1614
|
-
const mapped =
|
|
1614
|
+
const mapped = chunkT7AMP24E_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 (chunkT7AMP24E_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 ? chunkT7AMP24E_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(chunkT7AMP24E_js.createPresenterTimer());
|
|
2083
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkT7AMP24E_js.createInitialPresentationSnapshot(slideIndex));
|
|
2084
2084
|
const patch = react.useCallback((value) => {
|
|
2085
|
-
setSnapshot((current) =>
|
|
2085
|
+
setSnapshot((current) => chunkT7AMP24E_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: chunkT7AMP24E_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 = chunkT7AMP24E_js.togglePresenterTimer(timerRef.current);
|
|
2103
2103
|
patch({
|
|
2104
2104
|
paused: timerRef.current.paused,
|
|
2105
|
-
elapsedMs:
|
|
2105
|
+
elapsedMs: chunkT7AMP24E_js.presenterElapsed(timerRef.current)
|
|
2106
2106
|
});
|
|
2107
2107
|
},
|
|
2108
2108
|
resetTimer: () => {
|
|
2109
|
-
timerRef.current =
|
|
2109
|
+
timerRef.current = chunkT7AMP24E_js.resetPresenterTimer();
|
|
2110
2110
|
patch({ paused: false, elapsedMs: 0 });
|
|
2111
2111
|
},
|
|
2112
2112
|
stepZoom: (direction) => setSnapshot(
|
|
2113
|
-
(current) =>
|
|
2114
|
-
zoom:
|
|
2113
|
+
(current) => chunkT7AMP24E_js.mergePresentationSnapshot(current, {
|
|
2114
|
+
zoom: chunkT7AMP24E_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 (!chunkT7AMP24E_js.acceptsPresentationInput()) {
|
|
2236
2236
|
return;
|
|
2237
2237
|
}
|
|
2238
2238
|
if (endOfShowVisible) {
|
|
@@ -2430,15 +2430,46 @@ function usePresentationMode(input) {
|
|
|
2430
2430
|
});
|
|
2431
2431
|
};
|
|
2432
2432
|
}, [presentationTimersRef]);
|
|
2433
|
+
const morphPlan = react.useMemo(() => {
|
|
2434
|
+
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2435
|
+
return void 0;
|
|
2436
|
+
}
|
|
2437
|
+
return chunkT7AMP24E_js.buildMorphTransitionPlan(
|
|
2438
|
+
slides[transitionOverlay.outgoingSlideIndex],
|
|
2439
|
+
slides[transitionOverlay.incomingSlideIndex],
|
|
2440
|
+
transitionOverlay.durationMs,
|
|
2441
|
+
chunkT7AMP24E_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2442
|
+
);
|
|
2443
|
+
}, [transitionOverlay, slides]);
|
|
2444
|
+
const morphedElementStates = react.useMemo(() => {
|
|
2445
|
+
if (!morphPlan || morphPlan.incomingAnimations.size === 0) {
|
|
2446
|
+
return presentationElementStates;
|
|
2447
|
+
}
|
|
2448
|
+
const merged = new Map(presentationElementStates);
|
|
2449
|
+
for (const [elementId, animation] of morphPlan.incomingAnimations) {
|
|
2450
|
+
const existing = merged.get(elementId);
|
|
2451
|
+
if (existing?.cssAnimation) {
|
|
2452
|
+
continue;
|
|
2453
|
+
}
|
|
2454
|
+
merged.set(elementId, { ...existing, visible: true, cssAnimation: animation });
|
|
2455
|
+
}
|
|
2456
|
+
return merged;
|
|
2457
|
+
}, [morphPlan, presentationElementStates]);
|
|
2458
|
+
const morphedKeyframesCss = react.useMemo(
|
|
2459
|
+
() => morphPlan ? `${presentationKeyframesCss ?? ""}
|
|
2460
|
+
${morphPlan.keyframesCss}` : presentationKeyframesCss,
|
|
2461
|
+
[morphPlan, presentationKeyframesCss]
|
|
2462
|
+
);
|
|
2433
2463
|
return {
|
|
2434
2464
|
presentationSlideIndex,
|
|
2435
2465
|
setPresentationSlideIndex,
|
|
2436
2466
|
presentationSlideVisible,
|
|
2437
2467
|
transitionOverlay,
|
|
2438
2468
|
handleTransitionOverlayComplete,
|
|
2469
|
+
morphPlan,
|
|
2439
2470
|
presentationAnimations,
|
|
2440
|
-
presentationElementStates,
|
|
2441
|
-
presentationKeyframesCss,
|
|
2471
|
+
presentationElementStates: morphedElementStates,
|
|
2472
|
+
presentationKeyframesCss: morphedKeyframesCss,
|
|
2442
2473
|
clearPresentationTimers,
|
|
2443
2474
|
runPresentationEntranceAnimations,
|
|
2444
2475
|
endOfShowVisible,
|
|
@@ -2713,7 +2744,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2713
2744
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2714
2745
|
slides.forEach((slide, slideIndex) => {
|
|
2715
2746
|
for (const element of slide.elements || []) {
|
|
2716
|
-
if (!
|
|
2747
|
+
if (!chunkT7AMP24E_js.hasTextProperties(element)) {
|
|
2717
2748
|
continue;
|
|
2718
2749
|
}
|
|
2719
2750
|
const segments = element.textSegments ?? [];
|
|
@@ -2764,7 +2795,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2764
2795
|
continue;
|
|
2765
2796
|
}
|
|
2766
2797
|
const element = slide.elements[elIdx];
|
|
2767
|
-
if (!
|
|
2798
|
+
if (!chunkT7AMP24E_js.hasTextProperties(element)) {
|
|
2768
2799
|
continue;
|
|
2769
2800
|
}
|
|
2770
2801
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3362,7 +3393,7 @@ function useViewerCoreState(_input) {
|
|
|
3362
3393
|
const shapeAdjustmentDragStateRef = react.useRef(null);
|
|
3363
3394
|
const marqueeStateRef = react.useRef(null);
|
|
3364
3395
|
const isDrawingRef = react.useRef(false);
|
|
3365
|
-
const livePatcher = react.useMemo(() =>
|
|
3396
|
+
const livePatcher = react.useMemo(() => chunkT7AMP24E_js.createCollaborationLivePatcher(), []);
|
|
3366
3397
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3367
3398
|
const slidesRef = react.useRef([]);
|
|
3368
3399
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3371,8 +3402,8 @@ function useViewerCoreState(_input) {
|
|
|
3371
3402
|
const [slides, setSlides] = react.useState([]);
|
|
3372
3403
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3373
3404
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3374
|
-
width:
|
|
3375
|
-
height:
|
|
3405
|
+
width: chunk4O7PPQ2V_js.DEFAULT_CANVAS_WIDTH,
|
|
3406
|
+
height: chunk4O7PPQ2V_js.DEFAULT_CANVAS_HEIGHT
|
|
3376
3407
|
});
|
|
3377
3408
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
3378
3409
|
const [selectedElementId, setSelectedElementId] = react.useState(null);
|
|
@@ -3392,7 +3423,7 @@ function useViewerCoreState(_input) {
|
|
|
3392
3423
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3393
3424
|
inlineEditingTextRef.current = resolved;
|
|
3394
3425
|
setInlineEditingTextBase(value);
|
|
3395
|
-
|
|
3426
|
+
chunkT7AMP24E_js.publishLiveInlineText(
|
|
3396
3427
|
livePatcher,
|
|
3397
3428
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3398
3429
|
inlineEditingElementIdRef.current,
|
|
@@ -3717,7 +3748,7 @@ function useLoadContent({
|
|
|
3717
3748
|
);
|
|
3718
3749
|
}
|
|
3719
3750
|
const previousHandler = handlerRef.current;
|
|
3720
|
-
const handler = new
|
|
3751
|
+
const handler = new chunkT7AMP24E_js.PptxHandler();
|
|
3721
3752
|
const parsed = await handler.load(buffer);
|
|
3722
3753
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3723
3754
|
handler.dispose();
|
|
@@ -3729,7 +3760,7 @@ function useLoadContent({
|
|
|
3729
3760
|
handlerRef.current = null;
|
|
3730
3761
|
const mediaElements = [];
|
|
3731
3762
|
for (const slide of parsed.slides) {
|
|
3732
|
-
|
|
3763
|
+
chunkT7AMP24E_js.collectMediaElements(slide.elements, mediaElements);
|
|
3733
3764
|
}
|
|
3734
3765
|
for (const url of mediaDataUrls.values()) {
|
|
3735
3766
|
if (url.startsWith("blob:")) {
|
|
@@ -3770,7 +3801,7 @@ function useLoadContent({
|
|
|
3770
3801
|
}
|
|
3771
3802
|
})
|
|
3772
3803
|
);
|
|
3773
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3804
|
+
const { paths: imagePaths, refs: imageRefs } = chunkT7AMP24E_js.collectImagePaths(parsed.slides);
|
|
3774
3805
|
let nextSlides = parsed.slides;
|
|
3775
3806
|
if (imagePaths.size > 0) {
|
|
3776
3807
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3825,12 +3856,12 @@ function useLoadContent({
|
|
|
3825
3856
|
}
|
|
3826
3857
|
}
|
|
3827
3858
|
handlerRef.current = handler;
|
|
3828
|
-
const partition =
|
|
3859
|
+
const partition = chunk4O7PPQ2V_js.partitionTemplateElements(nextSlides);
|
|
3829
3860
|
setSlides(partition.slides);
|
|
3830
3861
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3831
3862
|
setCanvasSize({
|
|
3832
|
-
width: parsed.width ??
|
|
3833
|
-
height: parsed.height ??
|
|
3863
|
+
width: parsed.width ?? chunk4O7PPQ2V_js.DEFAULT_CANVAS_WIDTH,
|
|
3864
|
+
height: parsed.height ?? chunk4O7PPQ2V_js.DEFAULT_CANVAS_HEIGHT
|
|
3834
3865
|
});
|
|
3835
3866
|
setHeaderFooter(parsed.headerFooter ?? {});
|
|
3836
3867
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
@@ -3859,7 +3890,7 @@ function useLoadContent({
|
|
|
3859
3890
|
setHasMacros(parsed.hasMacros === true);
|
|
3860
3891
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3861
3892
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3862
|
-
setGuides(
|
|
3893
|
+
setGuides(chunkT7AMP24E_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3863
3894
|
setActiveSlideIndex(0);
|
|
3864
3895
|
clearSelection();
|
|
3865
3896
|
setIsDirty(false);
|
|
@@ -3867,7 +3898,7 @@ function useLoadContent({
|
|
|
3867
3898
|
onContentApplied?.();
|
|
3868
3899
|
} catch (err) {
|
|
3869
3900
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3870
|
-
if (err instanceof
|
|
3901
|
+
if (err instanceof chunkT7AMP24E_js.EncryptedFileError) {
|
|
3871
3902
|
setIsEncrypted(true);
|
|
3872
3903
|
} else {
|
|
3873
3904
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3944,7 +3975,7 @@ function useAutosave(input) {
|
|
|
3944
3975
|
isSavingRef.current = false;
|
|
3945
3976
|
return;
|
|
3946
3977
|
}
|
|
3947
|
-
await
|
|
3978
|
+
await chunkT7AMP24E_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
3948
3979
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
3949
3980
|
} catch (err) {
|
|
3950
3981
|
setAutosaveStatus({
|
|
@@ -4009,7 +4040,7 @@ function useElementOperations(input) {
|
|
|
4009
4040
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
4010
4041
|
const updateElementById = react.useCallback(
|
|
4011
4042
|
(elementId, updates) => {
|
|
4012
|
-
if (
|
|
4043
|
+
if (chunkT7AMP24E_js.isTemplateElementId(elementId)) {
|
|
4013
4044
|
const slideId = activeSlide?.id;
|
|
4014
4045
|
if (slideId) {
|
|
4015
4046
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4049,7 +4080,7 @@ function useElementOperations(input) {
|
|
|
4049
4080
|
);
|
|
4050
4081
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4051
4082
|
(updates) => {
|
|
4052
|
-
if (!selectedElement || !
|
|
4083
|
+
if (!selectedElement || !chunkT7AMP24E_js.hasShapeProperties(selectedElement)) {
|
|
4053
4084
|
return;
|
|
4054
4085
|
}
|
|
4055
4086
|
updateSelectedElement({
|
|
@@ -4060,17 +4091,17 @@ function useElementOperations(input) {
|
|
|
4060
4091
|
);
|
|
4061
4092
|
const updateSelectedTextStyle = react.useCallback(
|
|
4062
4093
|
(updates) => {
|
|
4063
|
-
if (!selectedElement || !
|
|
4094
|
+
if (!selectedElement || !chunkT7AMP24E_js.hasTextProperties(selectedElement)) {
|
|
4064
4095
|
return;
|
|
4065
4096
|
}
|
|
4066
|
-
const inlineSel =
|
|
4097
|
+
const inlineSel = chunkT7AMP24E_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4067
4098
|
if (inlineSel && selectedElement.textSegments) {
|
|
4068
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4099
|
+
const { newSegments: newSegments2, newSelection } = chunkT7AMP24E_js.applyStyleToSelectedSegments(
|
|
4069
4100
|
selectedElement.textSegments,
|
|
4070
4101
|
inlineSel,
|
|
4071
4102
|
updates
|
|
4072
4103
|
);
|
|
4073
|
-
|
|
4104
|
+
chunkT7AMP24E_js.setPendingSelectionRestore(newSelection);
|
|
4074
4105
|
updateSelectedElement({
|
|
4075
4106
|
textSegments: newSegments2
|
|
4076
4107
|
});
|
|
@@ -4090,12 +4121,12 @@ function useElementOperations(input) {
|
|
|
4090
4121
|
);
|
|
4091
4122
|
const updateSelectedTextCase = react.useCallback(
|
|
4092
4123
|
(mode) => {
|
|
4093
|
-
if (!selectedElement || !
|
|
4124
|
+
if (!selectedElement || !chunkT7AMP24E_js.hasTextProperties(selectedElement)) {
|
|
4094
4125
|
return;
|
|
4095
4126
|
}
|
|
4096
|
-
const inlineSel =
|
|
4127
|
+
const inlineSel = chunkT7AMP24E_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4097
4128
|
if (inlineSel && selectedElement.textSegments) {
|
|
4098
|
-
const newSegments =
|
|
4129
|
+
const newSegments = chunkT7AMP24E_js.applyCaseTransformToSegments(
|
|
4099
4130
|
selectedElement.textSegments,
|
|
4100
4131
|
inlineSel,
|
|
4101
4132
|
mode
|
|
@@ -4105,14 +4136,14 @@ function useElementOperations(input) {
|
|
|
4105
4136
|
}
|
|
4106
4137
|
const updates = {};
|
|
4107
4138
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4108
|
-
updates.textSegments =
|
|
4139
|
+
updates.textSegments = chunkT7AMP24E_js.applyCaseTransformToSegments(
|
|
4109
4140
|
selectedElement.textSegments,
|
|
4110
4141
|
null,
|
|
4111
4142
|
mode
|
|
4112
4143
|
);
|
|
4113
4144
|
}
|
|
4114
4145
|
if (typeof selectedElement.text === "string") {
|
|
4115
|
-
updates.text =
|
|
4146
|
+
updates.text = chunkT7AMP24E_js.transformTextCase(selectedElement.text, mode);
|
|
4116
4147
|
}
|
|
4117
4148
|
updateSelectedElement(updates);
|
|
4118
4149
|
},
|
|
@@ -4167,7 +4198,7 @@ function useSectionOperations(input) {
|
|
|
4167
4198
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4168
4199
|
const addSection2 = react.useCallback(
|
|
4169
4200
|
(name, afterSlideIndex) => {
|
|
4170
|
-
const result =
|
|
4201
|
+
const result = chunkT7AMP24E_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4171
4202
|
setSlides(result.slides);
|
|
4172
4203
|
setSections(result.sections);
|
|
4173
4204
|
markDirty();
|
|
@@ -4176,7 +4207,7 @@ function useSectionOperations(input) {
|
|
|
4176
4207
|
);
|
|
4177
4208
|
const renameSection2 = react.useCallback(
|
|
4178
4209
|
(sectionId, newName) => {
|
|
4179
|
-
const result =
|
|
4210
|
+
const result = chunkT7AMP24E_js.renameSection(sections, slides, sectionId, newName);
|
|
4180
4211
|
setSections(result.sections);
|
|
4181
4212
|
setSlides(result.slides);
|
|
4182
4213
|
markDirty();
|
|
@@ -4185,7 +4216,7 @@ function useSectionOperations(input) {
|
|
|
4185
4216
|
);
|
|
4186
4217
|
const deleteSection2 = react.useCallback(
|
|
4187
4218
|
(sectionId) => {
|
|
4188
|
-
const result =
|
|
4219
|
+
const result = chunkT7AMP24E_js.deleteSection(sections, slides, sectionId);
|
|
4189
4220
|
setSections(result.sections);
|
|
4190
4221
|
setSlides(result.slides);
|
|
4191
4222
|
markDirty();
|
|
@@ -4194,21 +4225,21 @@ function useSectionOperations(input) {
|
|
|
4194
4225
|
);
|
|
4195
4226
|
const moveSectionUp2 = react.useCallback(
|
|
4196
4227
|
(sectionId) => {
|
|
4197
|
-
setSections(
|
|
4228
|
+
setSections(chunkT7AMP24E_js.moveSectionUp(sections, sectionId));
|
|
4198
4229
|
markDirty();
|
|
4199
4230
|
},
|
|
4200
4231
|
[sections, setSections, markDirty]
|
|
4201
4232
|
);
|
|
4202
4233
|
const moveSectionDown2 = react.useCallback(
|
|
4203
4234
|
(sectionId) => {
|
|
4204
|
-
setSections(
|
|
4235
|
+
setSections(chunkT7AMP24E_js.moveSectionDown(sections, sectionId));
|
|
4205
4236
|
markDirty();
|
|
4206
4237
|
},
|
|
4207
4238
|
[sections, setSections, markDirty]
|
|
4208
4239
|
);
|
|
4209
4240
|
const moveSlidesToSection2 = react.useCallback(
|
|
4210
4241
|
(slideIndexes, targetSectionId) => {
|
|
4211
|
-
const result =
|
|
4242
|
+
const result = chunkT7AMP24E_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4212
4243
|
setSlides(result.slides);
|
|
4213
4244
|
setSections(result.sections);
|
|
4214
4245
|
markDirty();
|
|
@@ -4227,19 +4258,19 @@ function useSectionOperations(input) {
|
|
|
4227
4258
|
|
|
4228
4259
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4229
4260
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4230
|
-
const resized =
|
|
4261
|
+
const resized = chunkT7AMP24E_js.applyResize(
|
|
4231
4262
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4232
4263
|
handle,
|
|
4233
4264
|
dx,
|
|
4234
4265
|
dy,
|
|
4235
4266
|
1,
|
|
4236
|
-
{ minSize:
|
|
4267
|
+
{ minSize: chunk4O7PPQ2V_js.MIN_ELEMENT_SIZE }
|
|
4237
4268
|
);
|
|
4238
4269
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4239
4270
|
if (!snapToGrid) {
|
|
4240
4271
|
return box;
|
|
4241
4272
|
}
|
|
4242
|
-
return
|
|
4273
|
+
return chunkT7AMP24E_js.snapBoxToGrid(box, handle, gridSpacingPx, chunk4O7PPQ2V_js.MIN_ELEMENT_SIZE);
|
|
4243
4274
|
}
|
|
4244
4275
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
4245
4276
|
const range = startWidth || 200;
|
|
@@ -4357,7 +4388,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4357
4388
|
width: el.width,
|
|
4358
4389
|
height: el.height
|
|
4359
4390
|
}));
|
|
4360
|
-
const snapResult =
|
|
4391
|
+
const snapResult = chunkT7AMP24E_js.computeSnapToShape(
|
|
4361
4392
|
targetX,
|
|
4362
4393
|
targetY,
|
|
4363
4394
|
primaryEl.width,
|
|
@@ -4396,7 +4427,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4396
4427
|
if (live) {
|
|
4397
4428
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4398
4429
|
const start = drag.startPositionsById[id];
|
|
4399
|
-
|
|
4430
|
+
chunkT7AMP24E_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4400
4431
|
x: start.x + appliedDx,
|
|
4401
4432
|
y: start.y + appliedDy
|
|
4402
4433
|
});
|
|
@@ -4430,15 +4461,15 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4430
4461
|
if (rs.domEl) {
|
|
4431
4462
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4432
4463
|
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,
|
|
4464
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunk4O7PPQ2V_js.MIN_ELEMENT_SIZE)}px`;
|
|
4465
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunk4O7PPQ2V_js.MIN_ELEMENT_SIZE)}px`;
|
|
4435
4466
|
}
|
|
4436
4467
|
if (live) {
|
|
4437
|
-
|
|
4468
|
+
chunkT7AMP24E_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4438
4469
|
x: geo.x,
|
|
4439
4470
|
y: geo.y,
|
|
4440
|
-
width: Math.max(geo.width,
|
|
4441
|
-
height: Math.max(geo.height,
|
|
4471
|
+
width: Math.max(geo.width, chunk4O7PPQ2V_js.MIN_ELEMENT_SIZE),
|
|
4472
|
+
height: Math.max(geo.height, chunk4O7PPQ2V_js.MIN_ELEMENT_SIZE)
|
|
4442
4473
|
});
|
|
4443
4474
|
}
|
|
4444
4475
|
}
|
|
@@ -4518,13 +4549,13 @@ function processPointerUp(input) {
|
|
|
4518
4549
|
if (i !== activeSlideIndex) {
|
|
4519
4550
|
return s;
|
|
4520
4551
|
}
|
|
4521
|
-
const rerouted =
|
|
4552
|
+
const rerouted = chunkT7AMP24E_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4522
4553
|
if (rerouted.length === 0) {
|
|
4523
4554
|
return s;
|
|
4524
4555
|
}
|
|
4525
4556
|
return {
|
|
4526
4557
|
...s,
|
|
4527
|
-
elements:
|
|
4558
|
+
elements: chunkT7AMP24E_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4528
4559
|
};
|
|
4529
4560
|
})
|
|
4530
4561
|
);
|
|
@@ -4546,9 +4577,9 @@ function processPointerUp(input) {
|
|
|
4546
4577
|
}
|
|
4547
4578
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4548
4579
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4549
|
-
const hitIds =
|
|
4580
|
+
const hitIds = chunkT7AMP24E_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4550
4581
|
if (marquee.additive) {
|
|
4551
|
-
const merged =
|
|
4582
|
+
const merged = chunkT7AMP24E_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4552
4583
|
if (merged.length > 0) {
|
|
4553
4584
|
applySelection(merged[0], merged);
|
|
4554
4585
|
} else {
|
|
@@ -4571,8 +4602,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4571
4602
|
}
|
|
4572
4603
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4573
4604
|
});
|
|
4574
|
-
const rerouted =
|
|
4575
|
-
return
|
|
4605
|
+
const rerouted = chunkT7AMP24E_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4606
|
+
return chunkT7AMP24E_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4576
4607
|
};
|
|
4577
4608
|
if (editTemplateMode) {
|
|
4578
4609
|
const slideId = activeSlide?.id;
|
|
@@ -4725,9 +4756,9 @@ function useCanvasInteractions(input) {
|
|
|
4725
4756
|
return;
|
|
4726
4757
|
}
|
|
4727
4758
|
const el = elementLookup.get(editId);
|
|
4728
|
-
if (el &&
|
|
4759
|
+
if (el && chunkT7AMP24E_js.hasTextProperties(el)) {
|
|
4729
4760
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4730
|
-
const newSegments =
|
|
4761
|
+
const newSegments = chunkT7AMP24E_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4731
4762
|
ops.updateElementById(editId, {
|
|
4732
4763
|
text: committedText,
|
|
4733
4764
|
textSegments: newSegments
|
|
@@ -4738,7 +4769,7 @@ function useCanvasInteractions(input) {
|
|
|
4738
4769
|
setInlineEditingText("");
|
|
4739
4770
|
};
|
|
4740
4771
|
const openEquationEditorForElement = (el) => {
|
|
4741
|
-
if (!
|
|
4772
|
+
if (!chunkT7AMP24E_js.hasTextProperties(el)) {
|
|
4742
4773
|
return false;
|
|
4743
4774
|
}
|
|
4744
4775
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4767,7 +4798,7 @@ function useCanvasInteractions(input) {
|
|
|
4767
4798
|
justSelectedRef.current = false;
|
|
4768
4799
|
} else {
|
|
4769
4800
|
const el = elementLookup.get(elementId);
|
|
4770
|
-
if (el &&
|
|
4801
|
+
if (el && chunkT7AMP24E_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
4771
4802
|
if (!openEquationEditorForElement(el)) {
|
|
4772
4803
|
setInlineEditingElementId(elementId);
|
|
4773
4804
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4786,7 +4817,7 @@ function useCanvasInteractions(input) {
|
|
|
4786
4817
|
if (openEquationEditorForElement(el)) {
|
|
4787
4818
|
return;
|
|
4788
4819
|
}
|
|
4789
|
-
if (
|
|
4820
|
+
if (chunkT7AMP24E_js.hasTextProperties(el)) {
|
|
4790
4821
|
setInlineEditingElementId(elementId);
|
|
4791
4822
|
setInlineEditingText(el.text ?? "");
|
|
4792
4823
|
}
|
|
@@ -4976,7 +5007,7 @@ function createFileHandlers(deps) {
|
|
|
4976
5007
|
h = Math.round(h * scale);
|
|
4977
5008
|
}
|
|
4978
5009
|
addElement({
|
|
4979
|
-
id:
|
|
5010
|
+
id: chunkT7AMP24E_js.generateElementId(),
|
|
4980
5011
|
type: "image",
|
|
4981
5012
|
x: Math.round((canvasSize.width - w) / 2),
|
|
4982
5013
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -4987,7 +5018,7 @@ function createFileHandlers(deps) {
|
|
|
4987
5018
|
};
|
|
4988
5019
|
img.onerror = () => {
|
|
4989
5020
|
addElement({
|
|
4990
|
-
id:
|
|
5021
|
+
id: chunkT7AMP24E_js.generateElementId(),
|
|
4991
5022
|
type: "image",
|
|
4992
5023
|
x: 100,
|
|
4993
5024
|
y: 100,
|
|
@@ -5013,7 +5044,7 @@ function createFileHandlers(deps) {
|
|
|
5013
5044
|
const elFilePath = file.path;
|
|
5014
5045
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5015
5046
|
addElement({
|
|
5016
|
-
id:
|
|
5047
|
+
id: chunkT7AMP24E_js.generateElementId(),
|
|
5017
5048
|
type: "media",
|
|
5018
5049
|
mediaType,
|
|
5019
5050
|
mediaMimeType: file.type || void 0,
|
|
@@ -5188,13 +5219,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5188
5219
|
return;
|
|
5189
5220
|
}
|
|
5190
5221
|
addElement({
|
|
5191
|
-
id:
|
|
5222
|
+
id: chunkT7AMP24E_js.generateElementId(),
|
|
5192
5223
|
type: "smartArt",
|
|
5193
5224
|
x: 100,
|
|
5194
5225
|
y: 120,
|
|
5195
5226
|
width: 600,
|
|
5196
5227
|
height: 340,
|
|
5197
|
-
smartArtData:
|
|
5228
|
+
smartArtData: chunkT7AMP24E_js.buildSmartArtPresetData(
|
|
5198
5229
|
layout,
|
|
5199
5230
|
defaultItems,
|
|
5200
5231
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5206,7 +5237,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5206
5237
|
return;
|
|
5207
5238
|
}
|
|
5208
5239
|
addElement({
|
|
5209
|
-
id:
|
|
5240
|
+
id: chunkT7AMP24E_js.generateElementId(),
|
|
5210
5241
|
type: "shape",
|
|
5211
5242
|
x: 120,
|
|
5212
5243
|
y: 200,
|
|
@@ -5265,7 +5296,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5265
5296
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5266
5297
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5267
5298
|
addElement({
|
|
5268
|
-
id:
|
|
5299
|
+
id: chunkT7AMP24E_js.generateElementId(),
|
|
5269
5300
|
type: "shape",
|
|
5270
5301
|
x: 120,
|
|
5271
5302
|
y: 200,
|
|
@@ -5287,11 +5318,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5287
5318
|
if (!activeSlide) {
|
|
5288
5319
|
return;
|
|
5289
5320
|
}
|
|
5290
|
-
const preset =
|
|
5321
|
+
const preset = chunkT7AMP24E_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5291
5322
|
if (!preset) {
|
|
5292
5323
|
return;
|
|
5293
5324
|
}
|
|
5294
|
-
const defaultPptxAction =
|
|
5325
|
+
const defaultPptxAction = chunkT7AMP24E_js.elementActionToPptxAction({
|
|
5295
5326
|
trigger: "click",
|
|
5296
5327
|
type: preset.defaultAction
|
|
5297
5328
|
});
|
|
@@ -5300,7 +5331,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5300
5331
|
defaultPptxAction.highlightClick = true;
|
|
5301
5332
|
}
|
|
5302
5333
|
addElement({
|
|
5303
|
-
id:
|
|
5334
|
+
id: chunkT7AMP24E_js.generateElementId(),
|
|
5304
5335
|
type: "shape",
|
|
5305
5336
|
x: 150,
|
|
5306
5337
|
y: 150,
|
|
@@ -5367,14 +5398,14 @@ function useInsertElements(input) {
|
|
|
5367
5398
|
return;
|
|
5368
5399
|
}
|
|
5369
5400
|
addElement({
|
|
5370
|
-
id:
|
|
5401
|
+
id: chunkT7AMP24E_js.generateElementId(),
|
|
5371
5402
|
type: "text",
|
|
5372
5403
|
x: 100,
|
|
5373
5404
|
y: 100,
|
|
5374
5405
|
width: 300,
|
|
5375
5406
|
height: 60,
|
|
5376
5407
|
text: "",
|
|
5377
|
-
textStyle: { fontSize:
|
|
5408
|
+
textStyle: { fontSize: chunk4O7PPQ2V_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5378
5409
|
});
|
|
5379
5410
|
};
|
|
5380
5411
|
const handleAddShape = () => {
|
|
@@ -5382,7 +5413,7 @@ function useInsertElements(input) {
|
|
|
5382
5413
|
return;
|
|
5383
5414
|
}
|
|
5384
5415
|
addElement({
|
|
5385
|
-
id:
|
|
5416
|
+
id: chunkT7AMP24E_js.generateElementId(),
|
|
5386
5417
|
type: "shape",
|
|
5387
5418
|
x: 150,
|
|
5388
5419
|
y: 150,
|
|
@@ -5401,15 +5432,15 @@ function useInsertElements(input) {
|
|
|
5401
5432
|
return;
|
|
5402
5433
|
}
|
|
5403
5434
|
addElement({
|
|
5404
|
-
...
|
|
5405
|
-
id:
|
|
5435
|
+
...chunkT7AMP24E_js.newTableElement(chunk4O7PPQ2V_js.DEFAULT_TABLE_ROWS, chunk4O7PPQ2V_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5436
|
+
id: chunkT7AMP24E_js.generateElementId()
|
|
5406
5437
|
});
|
|
5407
5438
|
};
|
|
5408
5439
|
const handleAddChart = (chartType) => {
|
|
5409
5440
|
if (!activeSlide) {
|
|
5410
5441
|
return;
|
|
5411
5442
|
}
|
|
5412
|
-
addElement(
|
|
5443
|
+
addElement(chunkT7AMP24E_js.createDefaultChartElement(chartType));
|
|
5413
5444
|
};
|
|
5414
5445
|
const structured = createStructuredElementHandlers({
|
|
5415
5446
|
activeSlide,
|
|
@@ -5479,7 +5510,7 @@ function useClipboardHandlers(input) {
|
|
|
5479
5510
|
if (!selectedElement) {
|
|
5480
5511
|
return;
|
|
5481
5512
|
}
|
|
5482
|
-
setClipboardPayload(
|
|
5513
|
+
setClipboardPayload(chunkT7AMP24E_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5483
5514
|
};
|
|
5484
5515
|
const handleDelete = () => {
|
|
5485
5516
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5496,7 +5527,7 @@ function useClipboardHandlers(input) {
|
|
|
5496
5527
|
handleDelete();
|
|
5497
5528
|
};
|
|
5498
5529
|
const insertClone = (source) => {
|
|
5499
|
-
const clone =
|
|
5530
|
+
const clone = chunkT7AMP24E_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5500
5531
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5501
5532
|
ops.applySelection(clone.id);
|
|
5502
5533
|
history.markDirty();
|
|
@@ -5531,7 +5562,7 @@ function resolveShapePath(el) {
|
|
|
5531
5562
|
return el.pathData;
|
|
5532
5563
|
}
|
|
5533
5564
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5534
|
-
const clipPath =
|
|
5565
|
+
const clipPath = chunkT7AMP24E_js.getPresetShapeClipPath(el.shapeType);
|
|
5535
5566
|
if (clipPath) {
|
|
5536
5567
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5537
5568
|
if (svgPath) {
|
|
@@ -5582,7 +5613,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5582
5613
|
return parts.join(" ");
|
|
5583
5614
|
}
|
|
5584
5615
|
function transformPathToGlobal(pathData, el) {
|
|
5585
|
-
const polys =
|
|
5616
|
+
const polys = chunkT7AMP24E_js.svgPathToPolygons(pathData);
|
|
5586
5617
|
if (polys.length === 0) {
|
|
5587
5618
|
return pathData;
|
|
5588
5619
|
}
|
|
@@ -5602,10 +5633,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5602
5633
|
y: pt.y * scaleY + el.y
|
|
5603
5634
|
}))
|
|
5604
5635
|
);
|
|
5605
|
-
return
|
|
5636
|
+
return chunkT7AMP24E_js.polygonsToSvgPath(transformed);
|
|
5606
5637
|
}
|
|
5607
5638
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5608
|
-
const polys =
|
|
5639
|
+
const polys = chunkT7AMP24E_js.svgPathToPolygons(pathData);
|
|
5609
5640
|
if (polys.length === 0) {
|
|
5610
5641
|
return pathData;
|
|
5611
5642
|
}
|
|
@@ -5615,10 +5646,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5615
5646
|
y: pt.y - y
|
|
5616
5647
|
}))
|
|
5617
5648
|
);
|
|
5618
|
-
return
|
|
5649
|
+
return chunkT7AMP24E_js.polygonsToSvgPath(transformed);
|
|
5619
5650
|
}
|
|
5620
5651
|
function pathBounds(pathData) {
|
|
5621
|
-
const polys =
|
|
5652
|
+
const polys = chunkT7AMP24E_js.svgPathToPolygons(pathData);
|
|
5622
5653
|
let minX = Infinity;
|
|
5623
5654
|
let minY = Infinity;
|
|
5624
5655
|
let maxX = -Infinity;
|
|
@@ -5677,7 +5708,7 @@ function useMergeShapesHandler(input) {
|
|
|
5677
5708
|
let allFragments = [];
|
|
5678
5709
|
let remaining = globalPaths[0];
|
|
5679
5710
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5680
|
-
const frags =
|
|
5711
|
+
const frags = chunkT7AMP24E_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5681
5712
|
if (Array.isArray(frags)) {
|
|
5682
5713
|
allFragments = frags;
|
|
5683
5714
|
}
|
|
@@ -5706,7 +5737,7 @@ function useMergeShapesHandler(input) {
|
|
|
5706
5737
|
bounds.height
|
|
5707
5738
|
);
|
|
5708
5739
|
const newEl = {
|
|
5709
|
-
id:
|
|
5740
|
+
id: chunkT7AMP24E_js.generateElementId(),
|
|
5710
5741
|
type: "shape",
|
|
5711
5742
|
x: bounds.x,
|
|
5712
5743
|
y: bounds.y,
|
|
@@ -5744,7 +5775,7 @@ function useMergeShapesHandler(input) {
|
|
|
5744
5775
|
} else {
|
|
5745
5776
|
let resultPath = globalPaths[0];
|
|
5746
5777
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5747
|
-
const result =
|
|
5778
|
+
const result = chunkT7AMP24E_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5748
5779
|
if (typeof result === "string") {
|
|
5749
5780
|
resultPath = result;
|
|
5750
5781
|
}
|
|
@@ -5765,7 +5796,7 @@ function useMergeShapesHandler(input) {
|
|
|
5765
5796
|
);
|
|
5766
5797
|
const primary = targets[0];
|
|
5767
5798
|
const newEl = {
|
|
5768
|
-
id:
|
|
5799
|
+
id: chunkT7AMP24E_js.generateElementId(),
|
|
5769
5800
|
type: "shape",
|
|
5770
5801
|
x: bounds.x,
|
|
5771
5802
|
y: bounds.y,
|
|
@@ -5828,7 +5859,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5828
5859
|
if (ids.length < 2 || !activeSlide) {
|
|
5829
5860
|
return;
|
|
5830
5861
|
}
|
|
5831
|
-
const { elements, groupId } =
|
|
5862
|
+
const { elements, groupId } = chunkT7AMP24E_js.groupElements(ops.activeElements, ids, chunkT7AMP24E_js.generateElementId());
|
|
5832
5863
|
if (groupId === null) {
|
|
5833
5864
|
return;
|
|
5834
5865
|
}
|
|
@@ -5841,12 +5872,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5841
5872
|
return;
|
|
5842
5873
|
}
|
|
5843
5874
|
const group = selectedElement;
|
|
5844
|
-
const intoTemplate =
|
|
5875
|
+
const intoTemplate = chunkT7AMP24E_js.isTemplateElementId(group.id);
|
|
5845
5876
|
const ungrouped = group.children.map((child) => ({
|
|
5846
5877
|
...structuredClone(child),
|
|
5847
5878
|
// Keep child ids in the same store as the group so later edits route
|
|
5848
5879
|
// correctly: template groups yield template-prefixed child ids.
|
|
5849
|
-
id: intoTemplate ?
|
|
5880
|
+
id: intoTemplate ? chunkT7AMP24E_js.makeCloneId(true, child.id || group.id) : child.id || chunkT7AMP24E_js.generateElementId(),
|
|
5850
5881
|
x: child.x + group.x,
|
|
5851
5882
|
y: child.y + group.y
|
|
5852
5883
|
}));
|
|
@@ -5870,7 +5901,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5870
5901
|
if (!edge) {
|
|
5871
5902
|
return;
|
|
5872
5903
|
}
|
|
5873
|
-
const positions =
|
|
5904
|
+
const positions = chunkT7AMP24E_js.alignElements(selectedElements, edge);
|
|
5874
5905
|
for (const [id, pos] of positions) {
|
|
5875
5906
|
const el = elementLookup.get(id);
|
|
5876
5907
|
if (!el) {
|
|
@@ -5888,7 +5919,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5888
5919
|
if (!distAxis) {
|
|
5889
5920
|
return;
|
|
5890
5921
|
}
|
|
5891
|
-
const positions =
|
|
5922
|
+
const positions = chunkT7AMP24E_js.distributeElements(selectedElements, distAxis);
|
|
5892
5923
|
for (const [id, pos] of positions) {
|
|
5893
5924
|
const el = elementLookup.get(id);
|
|
5894
5925
|
if (!el) {
|
|
@@ -5905,7 +5936,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5905
5936
|
}
|
|
5906
5937
|
const id = selectedElement.id;
|
|
5907
5938
|
ops.updateActiveElements(
|
|
5908
|
-
(els) => direction === "forward" ?
|
|
5939
|
+
(els) => direction === "forward" ? chunkT7AMP24E_js.bringForward(els, id) : direction === "backward" ? chunkT7AMP24E_js.sendBackward(els, id) : els
|
|
5909
5940
|
);
|
|
5910
5941
|
history.markDirty();
|
|
5911
5942
|
};
|
|
@@ -5915,7 +5946,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5915
5946
|
}
|
|
5916
5947
|
const id = selectedElement.id;
|
|
5917
5948
|
ops.updateActiveElements(
|
|
5918
|
-
(els) => direction === "front" ?
|
|
5949
|
+
(els) => direction === "front" ? chunkT7AMP24E_js.bringToFront(els, id) : chunkT7AMP24E_js.sendToBack(els, id)
|
|
5919
5950
|
);
|
|
5920
5951
|
history.markDirty();
|
|
5921
5952
|
};
|
|
@@ -6037,7 +6068,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
6037
6068
|
function useSlideManagement(input) {
|
|
6038
6069
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
6039
6070
|
const handleAddSlide = () => {
|
|
6040
|
-
const newSlide =
|
|
6071
|
+
const newSlide = chunkT7AMP24E_js.createBlankSlide(slides.length + 1);
|
|
6041
6072
|
ops.updateSlides((prev) => {
|
|
6042
6073
|
const next = [...prev];
|
|
6043
6074
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6100,7 +6131,7 @@ function useSlideManagement(input) {
|
|
|
6100
6131
|
}
|
|
6101
6132
|
const clone = {
|
|
6102
6133
|
...src,
|
|
6103
|
-
id:
|
|
6134
|
+
id: chunkT7AMP24E_js.makeSlideId(),
|
|
6104
6135
|
elements: src.elements.map((el) => ({
|
|
6105
6136
|
...el,
|
|
6106
6137
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6132,7 +6163,7 @@ function useSlideManagement(input) {
|
|
|
6132
6163
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6133
6164
|
const insertAt = activeSlideIndex + 1;
|
|
6134
6165
|
const draft = {
|
|
6135
|
-
...
|
|
6166
|
+
...chunkT7AMP24E_js.createBlankSlide(slides.length + 1),
|
|
6136
6167
|
layoutPath,
|
|
6137
6168
|
...layoutName ? { layoutName } : {}
|
|
6138
6169
|
};
|
|
@@ -6193,7 +6224,7 @@ function createTableMergeHandlers(input) {
|
|
|
6193
6224
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6194
6225
|
return;
|
|
6195
6226
|
}
|
|
6196
|
-
const newTableData =
|
|
6227
|
+
const newTableData = chunkT7AMP24E_js.mergeCells(
|
|
6197
6228
|
[
|
|
6198
6229
|
{ row: rowIndex, col: columnIndex },
|
|
6199
6230
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6201,7 +6232,7 @@ function createTableMergeHandlers(input) {
|
|
|
6201
6232
|
td
|
|
6202
6233
|
);
|
|
6203
6234
|
const updates = { tableData: newTableData };
|
|
6204
|
-
const newRawXml =
|
|
6235
|
+
const newRawXml = chunkT7AMP24E_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6205
6236
|
if (newRawXml) {
|
|
6206
6237
|
updates.rawXml = newRawXml;
|
|
6207
6238
|
}
|
|
@@ -6227,7 +6258,7 @@ function createTableMergeHandlers(input) {
|
|
|
6227
6258
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6228
6259
|
return;
|
|
6229
6260
|
}
|
|
6230
|
-
const newTableData =
|
|
6261
|
+
const newTableData = chunkT7AMP24E_js.mergeCells(
|
|
6231
6262
|
[
|
|
6232
6263
|
{ row: rowIndex, col: columnIndex },
|
|
6233
6264
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6235,7 +6266,7 @@ function createTableMergeHandlers(input) {
|
|
|
6235
6266
|
td
|
|
6236
6267
|
);
|
|
6237
6268
|
const updates = { tableData: newTableData };
|
|
6238
|
-
const newRawXml =
|
|
6269
|
+
const newRawXml = chunkT7AMP24E_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6239
6270
|
if (newRawXml) {
|
|
6240
6271
|
updates.rawXml = newRawXml;
|
|
6241
6272
|
}
|
|
@@ -6250,9 +6281,9 @@ function createTableMergeHandlers(input) {
|
|
|
6250
6281
|
return;
|
|
6251
6282
|
}
|
|
6252
6283
|
const td = selectedElement.tableData;
|
|
6253
|
-
const newTableData =
|
|
6284
|
+
const newTableData = chunkT7AMP24E_js.mergeCells(ts.selectedCells, td);
|
|
6254
6285
|
const updates = { tableData: newTableData };
|
|
6255
|
-
const newRawXml =
|
|
6286
|
+
const newRawXml = chunkT7AMP24E_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6256
6287
|
if (newRawXml) {
|
|
6257
6288
|
updates.rawXml = newRawXml;
|
|
6258
6289
|
}
|
|
@@ -6269,9 +6300,9 @@ function createTableMergeHandlers(input) {
|
|
|
6269
6300
|
}
|
|
6270
6301
|
const { rowIndex, columnIndex } = ts;
|
|
6271
6302
|
const td = selectedElement.tableData;
|
|
6272
|
-
const newTableData =
|
|
6303
|
+
const newTableData = chunkT7AMP24E_js.splitCell(rowIndex, columnIndex, td);
|
|
6273
6304
|
const updates = { tableData: newTableData };
|
|
6274
|
-
const newRawXml =
|
|
6305
|
+
const newRawXml = chunkT7AMP24E_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6275
6306
|
if (newRawXml) {
|
|
6276
6307
|
updates.rawXml = newRawXml;
|
|
6277
6308
|
}
|
|
@@ -6315,7 +6346,7 @@ function createTableStructHandlers(input) {
|
|
|
6315
6346
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
6316
6347
|
}
|
|
6317
6348
|
if (el.rawXml) {
|
|
6318
|
-
const newRawXml =
|
|
6349
|
+
const newRawXml = chunkT7AMP24E_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6319
6350
|
if (newRawXml) {
|
|
6320
6351
|
updates.rawXml = newRawXml;
|
|
6321
6352
|
}
|
|
@@ -6339,7 +6370,7 @@ function createTableStructHandlers(input) {
|
|
|
6339
6370
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6340
6371
|
const updates = {};
|
|
6341
6372
|
if (selectedElement.rawXml) {
|
|
6342
|
-
const newRawXml =
|
|
6373
|
+
const newRawXml = chunkT7AMP24E_js.updateCellTextStyleInRawXml(
|
|
6343
6374
|
selectedElement,
|
|
6344
6375
|
rowIndex,
|
|
6345
6376
|
colIndex,
|
|
@@ -6403,9 +6434,9 @@ function createTableStructHandlers(input) {
|
|
|
6403
6434
|
return;
|
|
6404
6435
|
}
|
|
6405
6436
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6406
|
-
const newTableData =
|
|
6437
|
+
const newTableData = chunkT7AMP24E_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6407
6438
|
const updates = { tableData: newTableData };
|
|
6408
|
-
const newRawXml =
|
|
6439
|
+
const newRawXml = chunkT7AMP24E_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6409
6440
|
if (newRawXml) {
|
|
6410
6441
|
updates.rawXml = newRawXml;
|
|
6411
6442
|
}
|
|
@@ -6418,12 +6449,12 @@ function createTableStructHandlers(input) {
|
|
|
6418
6449
|
}
|
|
6419
6450
|
const td = selectedElement.tableData;
|
|
6420
6451
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6421
|
-
const newTableData =
|
|
6452
|
+
const newTableData = chunkT7AMP24E_js.deleteTableRow(td, rowIdx);
|
|
6422
6453
|
if (newTableData === td) {
|
|
6423
6454
|
return;
|
|
6424
6455
|
}
|
|
6425
6456
|
const updates = { tableData: newTableData };
|
|
6426
|
-
const newRawXml =
|
|
6457
|
+
const newRawXml = chunkT7AMP24E_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6427
6458
|
if (newRawXml) {
|
|
6428
6459
|
updates.rawXml = newRawXml;
|
|
6429
6460
|
}
|
|
@@ -6435,9 +6466,9 @@ function createTableStructHandlers(input) {
|
|
|
6435
6466
|
return;
|
|
6436
6467
|
}
|
|
6437
6468
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6438
|
-
const newTableData =
|
|
6469
|
+
const newTableData = chunkT7AMP24E_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6439
6470
|
const updates = { tableData: newTableData };
|
|
6440
|
-
const newRawXml =
|
|
6471
|
+
const newRawXml = chunkT7AMP24E_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6441
6472
|
if (newRawXml) {
|
|
6442
6473
|
updates.rawXml = newRawXml;
|
|
6443
6474
|
}
|
|
@@ -6450,12 +6481,12 @@ function createTableStructHandlers(input) {
|
|
|
6450
6481
|
}
|
|
6451
6482
|
const td = selectedElement.tableData;
|
|
6452
6483
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6453
|
-
const newTableData =
|
|
6484
|
+
const newTableData = chunkT7AMP24E_js.deleteTableColumn(td, colIdx);
|
|
6454
6485
|
if (newTableData === td) {
|
|
6455
6486
|
return;
|
|
6456
6487
|
}
|
|
6457
6488
|
const updates = { tableData: newTableData };
|
|
6458
|
-
const newRawXml =
|
|
6489
|
+
const newRawXml = chunkT7AMP24E_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6459
6490
|
if (newRawXml) {
|
|
6460
6491
|
updates.rawXml = newRawXml;
|
|
6461
6492
|
}
|
|
@@ -6491,8 +6522,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6491
6522
|
return html2canvasPro(element, {
|
|
6492
6523
|
...options,
|
|
6493
6524
|
onclone: async (doc, clonedEl) => {
|
|
6494
|
-
await
|
|
6495
|
-
|
|
6525
|
+
await chunkT7AMP24E_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6526
|
+
chunkT7AMP24E_js.preprocessCssForCapture(clonedEl);
|
|
6496
6527
|
if (typeof userOnClone === "function") {
|
|
6497
6528
|
userOnClone(doc, clonedEl);
|
|
6498
6529
|
}
|
|
@@ -6548,7 +6579,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6548
6579
|
}
|
|
6549
6580
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6550
6581
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6551
|
-
|
|
6582
|
+
chunkT7AMP24E_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6552
6583
|
}
|
|
6553
6584
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6554
6585
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6570,15 +6601,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6570
6601
|
continue;
|
|
6571
6602
|
}
|
|
6572
6603
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6573
|
-
images.push(
|
|
6604
|
+
images.push(chunkT7AMP24E_js.canvasToJpegData(canvas));
|
|
6574
6605
|
}
|
|
6575
6606
|
onProgress?.(totalSlides, totalSlides);
|
|
6576
6607
|
setActiveSlide(currentSlideIndex);
|
|
6577
6608
|
if (images.length === 0) {
|
|
6578
6609
|
throw new Error(chunk25VSL2BB_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6579
6610
|
}
|
|
6580
|
-
const pdfBlobUrl =
|
|
6581
|
-
|
|
6611
|
+
const pdfBlobUrl = chunk4O7PPQ2V_js.buildPdfFromImageData(images);
|
|
6612
|
+
chunkT7AMP24E_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6582
6613
|
}
|
|
6583
6614
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6584
6615
|
const { scale = 2, onProgress } = options;
|
|
@@ -6626,8 +6657,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6626
6657
|
if (pages.length === 0) {
|
|
6627
6658
|
throw new Error(chunk25VSL2BB_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6628
6659
|
}
|
|
6629
|
-
const pdfDataUrl =
|
|
6630
|
-
|
|
6660
|
+
const pdfDataUrl = chunk4O7PPQ2V_js.buildNotesPdf(pages);
|
|
6661
|
+
chunkT7AMP24E_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6631
6662
|
}
|
|
6632
6663
|
|
|
6633
6664
|
// src/viewer/utils/export-video.ts
|
|
@@ -6671,7 +6702,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6671
6702
|
const fps = 30;
|
|
6672
6703
|
const stream = recordingCanvas.captureStream(fps);
|
|
6673
6704
|
const recorder = new MediaRecorder(stream, {
|
|
6674
|
-
mimeType:
|
|
6705
|
+
mimeType: chunkT7AMP24E_js.pickSupportedMimeType([...chunkT7AMP24E_js.WEBM_MIME_CANDIDATES]),
|
|
6675
6706
|
videoBitsPerSecond: 5e6
|
|
6676
6707
|
});
|
|
6677
6708
|
const chunks = [];
|
|
@@ -6694,8 +6725,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6694
6725
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6695
6726
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6696
6727
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6697
|
-
const frameInterval =
|
|
6698
|
-
const framesNeeded =
|
|
6728
|
+
const frameInterval = chunkT7AMP24E_js.fpsToFrameIntervalMs(fps);
|
|
6729
|
+
const framesNeeded = chunkT7AMP24E_js.segmentFrameCount(duration, fps);
|
|
6699
6730
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6700
6731
|
if (signal?.aborted) {
|
|
6701
6732
|
recorder.stop();
|
|
@@ -6744,7 +6775,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6744
6775
|
if (frames.length === 0) {
|
|
6745
6776
|
throw new Error(chunk25VSL2BB_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6746
6777
|
}
|
|
6747
|
-
const gifBytes =
|
|
6778
|
+
const gifBytes = chunkT7AMP24E_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6748
6779
|
onProgress?.(totalSlides, totalSlides);
|
|
6749
6780
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6750
6781
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6798,7 +6829,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6798
6829
|
continue;
|
|
6799
6830
|
}
|
|
6800
6831
|
onProgress?.(processedCount, data.slides.length);
|
|
6801
|
-
let svg =
|
|
6832
|
+
let svg = chunkT7AMP24E_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6802
6833
|
if (embedFonts && fontFaces?.length) {
|
|
6803
6834
|
svg = injectFontFaces(svg, fontFaces);
|
|
6804
6835
|
}
|
|
@@ -6858,7 +6889,7 @@ function useExportSaveAs(input) {
|
|
|
6858
6889
|
}
|
|
6859
6890
|
setExportProgress(70);
|
|
6860
6891
|
setExportStatusMessage("Writing README...");
|
|
6861
|
-
const readme =
|
|
6892
|
+
const readme = chunkT7AMP24E_js.generatePackageReadme(pptxFilename);
|
|
6862
6893
|
pkgFolder.file("README.txt", readme);
|
|
6863
6894
|
if (abortCtrl.signal.aborted) {
|
|
6864
6895
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -6869,7 +6900,7 @@ function useExportSaveAs(input) {
|
|
|
6869
6900
|
setExportProgress(95);
|
|
6870
6901
|
setExportStatusMessage("Downloading...");
|
|
6871
6902
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
6872
|
-
|
|
6903
|
+
chunkT7AMP24E_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
6873
6904
|
setExportProgress(100);
|
|
6874
6905
|
} catch (err) {
|
|
6875
6906
|
if (err.name !== "AbortError") {
|
|
@@ -6892,7 +6923,7 @@ function useExportSaveAs(input) {
|
|
|
6892
6923
|
const blob = new Blob([data], {
|
|
6893
6924
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6894
6925
|
});
|
|
6895
|
-
|
|
6926
|
+
chunkT7AMP24E_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
6896
6927
|
} catch (err) {
|
|
6897
6928
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
6898
6929
|
}
|
|
@@ -6905,14 +6936,14 @@ function useExportSaveAs(input) {
|
|
|
6905
6936
|
const pptxGuides = guides.map((g) => ({
|
|
6906
6937
|
id: g.id,
|
|
6907
6938
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
6908
|
-
positionEmu:
|
|
6939
|
+
positionEmu: chunkT7AMP24E_js.guidePxToEmu(g.position)
|
|
6909
6940
|
}));
|
|
6910
6941
|
return {
|
|
6911
6942
|
...slide,
|
|
6912
6943
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
6913
6944
|
};
|
|
6914
6945
|
});
|
|
6915
|
-
const slidesToSave =
|
|
6946
|
+
const slidesToSave = chunk4O7PPQ2V_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
6916
6947
|
const saveOptions = {
|
|
6917
6948
|
headerFooter,
|
|
6918
6949
|
presentationProperties,
|
|
@@ -6969,7 +7000,7 @@ function safeConfirm(message) {
|
|
|
6969
7000
|
}
|
|
6970
7001
|
}
|
|
6971
7002
|
function downloadBlob2(blob, filename) {
|
|
6972
|
-
|
|
7003
|
+
chunkT7AMP24E_js.downloadBlob(blob, chunkT7AMP24E_js.sanitizeDownloadFilename(filename));
|
|
6973
7004
|
}
|
|
6974
7005
|
|
|
6975
7006
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7070,21 +7101,21 @@ function useExportHandlers(input) {
|
|
|
7070
7101
|
{
|
|
7071
7102
|
scale: 2,
|
|
7072
7103
|
onProgress: (current, total) => {
|
|
7073
|
-
setExportProgress(
|
|
7074
|
-
setExportStatusMessage(
|
|
7104
|
+
setExportProgress(chunkT7AMP24E_js.slideProgressPercent(current, total));
|
|
7105
|
+
setExportStatusMessage(chunkT7AMP24E_js.slideStatusLabel("Rendering", current, total));
|
|
7075
7106
|
},
|
|
7076
7107
|
signal: abortCtrl.signal
|
|
7077
7108
|
}
|
|
7078
7109
|
);
|
|
7079
|
-
setExportProgress(
|
|
7110
|
+
setExportProgress(chunkT7AMP24E_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7080
7111
|
setExportStatusMessage("Building PDF...");
|
|
7081
7112
|
await new Promise((r) => {
|
|
7082
7113
|
setTimeout(r, 100);
|
|
7083
7114
|
});
|
|
7084
|
-
setExportProgress(
|
|
7115
|
+
setExportProgress(chunkT7AMP24E_js.EXPORT_DONE_PERCENT);
|
|
7085
7116
|
setExportStatusMessage("Done!");
|
|
7086
7117
|
} catch (err) {
|
|
7087
|
-
if (!
|
|
7118
|
+
if (!chunkT7AMP24E_js.isExportAbortError(err)) {
|
|
7088
7119
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7089
7120
|
}
|
|
7090
7121
|
} finally {
|
|
@@ -7114,21 +7145,21 @@ function useExportHandlers(input) {
|
|
|
7114
7145
|
{
|
|
7115
7146
|
scale: 2,
|
|
7116
7147
|
onProgress: (current, total) => {
|
|
7117
|
-
setExportProgress(
|
|
7118
|
-
setExportStatusMessage(
|
|
7148
|
+
setExportProgress(chunkT7AMP24E_js.slideProgressPercent(current, total));
|
|
7149
|
+
setExportStatusMessage(chunkT7AMP24E_js.slideStatusLabel("Rendering", current, total));
|
|
7119
7150
|
},
|
|
7120
7151
|
signal: abortCtrl.signal
|
|
7121
7152
|
}
|
|
7122
7153
|
);
|
|
7123
|
-
setExportProgress(
|
|
7154
|
+
setExportProgress(chunkT7AMP24E_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7124
7155
|
setExportStatusMessage("Building PDF...");
|
|
7125
7156
|
await new Promise((r) => {
|
|
7126
7157
|
setTimeout(r, 100);
|
|
7127
7158
|
});
|
|
7128
|
-
setExportProgress(
|
|
7159
|
+
setExportProgress(chunkT7AMP24E_js.EXPORT_DONE_PERCENT);
|
|
7129
7160
|
setExportStatusMessage("Done!");
|
|
7130
7161
|
} catch (err) {
|
|
7131
|
-
if (!
|
|
7162
|
+
if (!chunkT7AMP24E_js.isExportAbortError(err)) {
|
|
7132
7163
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7133
7164
|
}
|
|
7134
7165
|
} finally {
|
|
@@ -7169,22 +7200,22 @@ function useExportHandlers(input) {
|
|
|
7169
7200
|
scale: 1,
|
|
7170
7201
|
slideDurationMs: 3e3,
|
|
7171
7202
|
onProgress: (current, total) => {
|
|
7172
|
-
setExportProgress(
|
|
7173
|
-
setExportStatusMessage(
|
|
7203
|
+
setExportProgress(chunkT7AMP24E_js.slideProgressPercent(current, total, 45));
|
|
7204
|
+
setExportStatusMessage(chunkT7AMP24E_js.slideStatusLabel("Capturing", current, total));
|
|
7174
7205
|
},
|
|
7175
7206
|
onRecordProgress: (current, total) => {
|
|
7176
|
-
setExportProgress(
|
|
7177
|
-
setExportStatusMessage(
|
|
7207
|
+
setExportProgress(chunkT7AMP24E_js.recordProgressPercent(current, total));
|
|
7208
|
+
setExportStatusMessage(chunkT7AMP24E_js.slideStatusLabel("Recording", current, total));
|
|
7178
7209
|
},
|
|
7179
7210
|
signal: abortCtrl.signal
|
|
7180
7211
|
}
|
|
7181
7212
|
);
|
|
7182
|
-
setExportProgress(
|
|
7213
|
+
setExportProgress(chunkT7AMP24E_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7183
7214
|
setExportStatusMessage("Saving file...");
|
|
7184
7215
|
downloadBlob2(blob, "presentation.webm");
|
|
7185
|
-
setExportProgress(
|
|
7216
|
+
setExportProgress(chunkT7AMP24E_js.EXPORT_DONE_PERCENT);
|
|
7186
7217
|
} catch (err) {
|
|
7187
|
-
if (!
|
|
7218
|
+
if (!chunkT7AMP24E_js.isExportAbortError(err)) {
|
|
7188
7219
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7189
7220
|
}
|
|
7190
7221
|
} finally {
|
|
@@ -7212,18 +7243,18 @@ function useExportHandlers(input) {
|
|
|
7212
7243
|
scale: 0.5,
|
|
7213
7244
|
slideDurationMs: 2e3,
|
|
7214
7245
|
onProgress: (current, total) => {
|
|
7215
|
-
setExportProgress(
|
|
7216
|
-
setExportStatusMessage(
|
|
7246
|
+
setExportProgress(chunkT7AMP24E_js.slideProgressPercent(current, total));
|
|
7247
|
+
setExportStatusMessage(chunkT7AMP24E_js.slideStatusLabel("Encoding", current, total));
|
|
7217
7248
|
},
|
|
7218
7249
|
signal: abortCtrl.signal
|
|
7219
7250
|
}
|
|
7220
7251
|
);
|
|
7221
|
-
setExportProgress(
|
|
7252
|
+
setExportProgress(chunkT7AMP24E_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7222
7253
|
setExportStatusMessage("Saving file...");
|
|
7223
7254
|
downloadBlob2(blob, "presentation.gif");
|
|
7224
|
-
setExportProgress(
|
|
7255
|
+
setExportProgress(chunkT7AMP24E_js.EXPORT_DONE_PERCENT);
|
|
7225
7256
|
} catch (err) {
|
|
7226
|
-
if (!
|
|
7257
|
+
if (!chunkT7AMP24E_js.isExportAbortError(err)) {
|
|
7227
7258
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7228
7259
|
}
|
|
7229
7260
|
} finally {
|
|
@@ -7263,7 +7294,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7263
7294
|
}
|
|
7264
7295
|
printWindow.document.open();
|
|
7265
7296
|
printWindow.document.write(
|
|
7266
|
-
|
|
7297
|
+
chunkT7AMP24E_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7267
7298
|
);
|
|
7268
7299
|
printWindow.document.close();
|
|
7269
7300
|
printWindow.focus();
|
|
@@ -7324,7 +7355,7 @@ function usePrintHandlers(input) {
|
|
|
7324
7355
|
if (svgs.length === 0) {
|
|
7325
7356
|
return;
|
|
7326
7357
|
}
|
|
7327
|
-
const printDoc =
|
|
7358
|
+
const printDoc = chunkT7AMP24E_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7328
7359
|
title: "Slides (Vector)",
|
|
7329
7360
|
orientation: settings.orientation,
|
|
7330
7361
|
colorFilter
|
|
@@ -7360,7 +7391,7 @@ function usePrintHandlers(input) {
|
|
|
7360
7391
|
if (settings.printWhat === "outline") {
|
|
7361
7392
|
openPrintWindow(
|
|
7362
7393
|
"Outline",
|
|
7363
|
-
`<div class="outline-page">${
|
|
7394
|
+
`<div class="outline-page">${chunkT7AMP24E_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7364
7395
|
settings.orientation,
|
|
7365
7396
|
colorFilter,
|
|
7366
7397
|
settings.frameSlides
|
|
@@ -7385,7 +7416,7 @@ function usePrintHandlers(input) {
|
|
|
7385
7416
|
if (settings.printWhat === "slides") {
|
|
7386
7417
|
openPrintWindow(
|
|
7387
7418
|
"Slides",
|
|
7388
|
-
|
|
7419
|
+
chunkT7AMP24E_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7389
7420
|
settings.orientation,
|
|
7390
7421
|
colorFilter,
|
|
7391
7422
|
settings.frameSlides
|
|
@@ -7395,7 +7426,7 @@ function usePrintHandlers(input) {
|
|
|
7395
7426
|
if (settings.printWhat === "notes") {
|
|
7396
7427
|
openPrintWindow(
|
|
7397
7428
|
"Notes Pages",
|
|
7398
|
-
|
|
7429
|
+
chunkT7AMP24E_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7399
7430
|
"portrait",
|
|
7400
7431
|
colorFilter,
|
|
7401
7432
|
settings.frameSlides
|
|
@@ -7406,7 +7437,7 @@ function usePrintHandlers(input) {
|
|
|
7406
7437
|
const spp = settings.slidesPerPage;
|
|
7407
7438
|
openPrintWindow(
|
|
7408
7439
|
`Handout ${spp} per page`,
|
|
7409
|
-
|
|
7440
|
+
chunkT7AMP24E_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7410
7441
|
"portrait",
|
|
7411
7442
|
colorFilter,
|
|
7412
7443
|
settings.frameSlides
|
|
@@ -7470,8 +7501,8 @@ function useThemeHandlers(input) {
|
|
|
7470
7501
|
return;
|
|
7471
7502
|
}
|
|
7472
7503
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7473
|
-
const previousMap = theme?.colorScheme ?
|
|
7474
|
-
setSlides((prev) =>
|
|
7504
|
+
const previousMap = theme?.colorScheme ? chunkT7AMP24E_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7505
|
+
setSlides((prev) => chunkT7AMP24E_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7475
7506
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7476
7507
|
bumpHistory();
|
|
7477
7508
|
history.markDirty();
|
|
@@ -7576,7 +7607,7 @@ function useThemeSwitching(input) {
|
|
|
7576
7607
|
}
|
|
7577
7608
|
try {
|
|
7578
7609
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7579
|
-
const newData =
|
|
7610
|
+
const newData = chunkT7AMP24E_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7580
7611
|
onDataChange(newData);
|
|
7581
7612
|
onThemeChanged?.(preset);
|
|
7582
7613
|
} catch (error) {
|
|
@@ -7593,7 +7624,7 @@ function useThemeSwitching(input) {
|
|
|
7593
7624
|
}
|
|
7594
7625
|
try {
|
|
7595
7626
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7596
|
-
const newData =
|
|
7627
|
+
const newData = chunkT7AMP24E_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7597
7628
|
onDataChange(newData);
|
|
7598
7629
|
} catch (error) {
|
|
7599
7630
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7605,12 +7636,12 @@ function useThemeSwitching(input) {
|
|
|
7605
7636
|
if (!data?.theme?.colorScheme) {
|
|
7606
7637
|
return void 0;
|
|
7607
7638
|
}
|
|
7608
|
-
return
|
|
7609
|
-
(p) =>
|
|
7639
|
+
return chunkT7AMP24E_js.THEME_PRESETS.find(
|
|
7640
|
+
(p) => chunkT7AMP24E_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7610
7641
|
);
|
|
7611
7642
|
}, [data?.theme?.colorScheme]);
|
|
7612
7643
|
return {
|
|
7613
|
-
presets:
|
|
7644
|
+
presets: chunkT7AMP24E_js.THEME_PRESETS,
|
|
7614
7645
|
switchToPreset,
|
|
7615
7646
|
switchToCustom,
|
|
7616
7647
|
currentPreset
|
|
@@ -7685,7 +7716,7 @@ function usePropertyHandlers(input) {
|
|
|
7685
7716
|
}
|
|
7686
7717
|
try {
|
|
7687
7718
|
const ab = await file.arrayBuffer();
|
|
7688
|
-
const h = new
|
|
7719
|
+
const h = new chunkT7AMP24E_js.PptxHandler();
|
|
7689
7720
|
const other = await h.load(ab);
|
|
7690
7721
|
if (!other) {
|
|
7691
7722
|
return;
|
|
@@ -7695,7 +7726,7 @@ function usePropertyHandlers(input) {
|
|
|
7695
7726
|
width: canvasSize.width,
|
|
7696
7727
|
height: canvasSize.height
|
|
7697
7728
|
};
|
|
7698
|
-
setCompareResult(
|
|
7729
|
+
setCompareResult(chunkT7AMP24E_js.comparePresentation(cur, other));
|
|
7699
7730
|
setIsComparePanelOpen(true);
|
|
7700
7731
|
} catch (err) {
|
|
7701
7732
|
console.warn("Compare failed:", err);
|
|
@@ -7712,7 +7743,7 @@ function usePropertyHandlers(input) {
|
|
|
7712
7743
|
if (!diff || diff.status === "unchanged") {
|
|
7713
7744
|
return;
|
|
7714
7745
|
}
|
|
7715
|
-
setSlides((prev) =>
|
|
7746
|
+
setSlides((prev) => chunkT7AMP24E_js.applyAcceptSlide(prev, diff));
|
|
7716
7747
|
setIsDirty(true);
|
|
7717
7748
|
},
|
|
7718
7749
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7723,10 +7754,10 @@ function usePropertyHandlers(input) {
|
|
|
7723
7754
|
if (!compareResult) {
|
|
7724
7755
|
return;
|
|
7725
7756
|
}
|
|
7726
|
-
setSlides((prev) =>
|
|
7757
|
+
setSlides((prev) => chunkT7AMP24E_js.applyAcceptAllSlides(prev, compareResult));
|
|
7727
7758
|
setIsDirty(true);
|
|
7728
7759
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7729
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7760
|
+
const usedFontFamilies = react.useMemo(() => chunkT7AMP24E_js.collectUsedFonts(slides), [slides]);
|
|
7730
7761
|
return {
|
|
7731
7762
|
handleUpdateNotes,
|
|
7732
7763
|
handleUpdateSlide,
|
|
@@ -7845,7 +7876,7 @@ function useIsMobile(input) {
|
|
|
7845
7876
|
const containerRef = input?.containerRef;
|
|
7846
7877
|
const isTouchDevice = react.useSyncExternalStore(
|
|
7847
7878
|
subscribeTouchCapability,
|
|
7848
|
-
|
|
7879
|
+
chunkT7AMP24E_js.detectTouchDevice,
|
|
7849
7880
|
() => false
|
|
7850
7881
|
// server snapshot
|
|
7851
7882
|
);
|
|
@@ -7861,7 +7892,7 @@ function useIsMobile(input) {
|
|
|
7861
7892
|
}
|
|
7862
7893
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
7863
7894
|
});
|
|
7864
|
-
const [orientation, setOrientation] = react.useState(
|
|
7895
|
+
const [orientation, setOrientation] = react.useState(chunkT7AMP24E_js.detectOrientation);
|
|
7865
7896
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
7866
7897
|
const [initialViewportHeight] = react.useState(
|
|
7867
7898
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -7905,7 +7936,7 @@ function useIsMobile(input) {
|
|
|
7905
7936
|
return;
|
|
7906
7937
|
}
|
|
7907
7938
|
const handleOrientationChange = () => {
|
|
7908
|
-
setOrientation(
|
|
7939
|
+
setOrientation(chunkT7AMP24E_js.detectOrientation());
|
|
7909
7940
|
};
|
|
7910
7941
|
if (screen.orientation) {
|
|
7911
7942
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -7935,9 +7966,9 @@ function useIsMobile(input) {
|
|
|
7935
7966
|
window.addEventListener("resize", handleResize);
|
|
7936
7967
|
return () => window.removeEventListener("resize", handleResize);
|
|
7937
7968
|
}, [isTouchDevice, initialViewportHeight]);
|
|
7938
|
-
const isMobile =
|
|
7939
|
-
const isTablet = !isMobile && containerWidth >=
|
|
7940
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
7969
|
+
const isMobile = chunkT7AMP24E_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
7970
|
+
const isTablet = !isMobile && containerWidth >= chunkT7AMP24E_js.MOBILE_BREAKPOINT && containerWidth < chunkT7AMP24E_js.TABLET_BREAKPOINT;
|
|
7971
|
+
const isDesktop = !isMobile && containerWidth >= chunkT7AMP24E_js.TABLET_BREAKPOINT;
|
|
7941
7972
|
return {
|
|
7942
7973
|
isMobile,
|
|
7943
7974
|
isTablet,
|
|
@@ -7998,11 +8029,11 @@ function useViewerDialogs(input) {
|
|
|
7998
8029
|
);
|
|
7999
8030
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(false);
|
|
8000
8031
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8001
|
-
() => typeof window !== "undefined" ?
|
|
8032
|
+
() => typeof window !== "undefined" ? chunkT7AMP24E_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8002
8033
|
);
|
|
8003
8034
|
react.useEffect(() => {
|
|
8004
8035
|
const handleWindow = () => setIsNarrowViewport(
|
|
8005
|
-
|
|
8036
|
+
chunkT7AMP24E_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8006
8037
|
);
|
|
8007
8038
|
let observer = null;
|
|
8008
8039
|
let raf = 0;
|
|
@@ -8016,12 +8047,12 @@ function useViewerDialogs(input) {
|
|
|
8016
8047
|
const entry = entries[0];
|
|
8017
8048
|
if (entry) {
|
|
8018
8049
|
setIsNarrowViewport(
|
|
8019
|
-
|
|
8050
|
+
chunkT7AMP24E_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8020
8051
|
);
|
|
8021
8052
|
}
|
|
8022
8053
|
});
|
|
8023
8054
|
observer.observe(el);
|
|
8024
|
-
setIsNarrowViewport(
|
|
8055
|
+
setIsNarrowViewport(chunkT7AMP24E_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8025
8056
|
};
|
|
8026
8057
|
attach();
|
|
8027
8058
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8179,12 +8210,12 @@ function useViewerDialogs(input) {
|
|
|
8179
8210
|
}
|
|
8180
8211
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8181
8212
|
if (presentationGridSpacing) {
|
|
8182
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8213
|
+
const px = Math.round(presentationGridSpacing.cx / chunk4O7PPQ2V_js.EMU_PER_PX);
|
|
8183
8214
|
if (px > 0) {
|
|
8184
8215
|
return px;
|
|
8185
8216
|
}
|
|
8186
8217
|
}
|
|
8187
|
-
return
|
|
8218
|
+
return chunk4O7PPQ2V_js.GRID_SIZE;
|
|
8188
8219
|
}
|
|
8189
8220
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8190
8221
|
if (activeCustomShowId) {
|
|
@@ -8198,8 +8229,8 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
|
8198
8229
|
return slides.map((_, i) => i).filter((i) => !slides[i]?.hidden);
|
|
8199
8230
|
}
|
|
8200
8231
|
function computeSlideSectionGroups(slides, sections) {
|
|
8201
|
-
return
|
|
8202
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8232
|
+
return chunkT7AMP24E_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8233
|
+
id: group.section?.id ?? (sections.length > 0 ? chunk4O7PPQ2V_js.UNGROUPED_SECTION_ID : "default"),
|
|
8203
8234
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8204
8235
|
slideIndexes: group.slideIndexes,
|
|
8205
8236
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8254,7 +8285,7 @@ function useDerivedSlideState(input) {
|
|
|
8254
8285
|
);
|
|
8255
8286
|
const slideSectionGroups = react.useMemo(
|
|
8256
8287
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8257
|
-
if (group.id ===
|
|
8288
|
+
if (group.id === chunk4O7PPQ2V_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8258
8289
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8259
8290
|
}
|
|
8260
8291
|
if (group.id === "default" && group.label === "Slides") {
|
|
@@ -8357,13 +8388,13 @@ function useAnnotationHandlers(input) {
|
|
|
8357
8388
|
}, [annotations, setMode, setSlides, history]);
|
|
8358
8389
|
const handleSetMode = react.useCallback(
|
|
8359
8390
|
(nextMode) => {
|
|
8360
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8391
|
+
if (mode === "present" && nextMode !== "present" && !chunkT7AMP24E_js.mayLeaveSlideShow()) {
|
|
8361
8392
|
return;
|
|
8362
8393
|
}
|
|
8363
8394
|
if (nextMode === "present") {
|
|
8364
8395
|
presentation.enterPresentMode();
|
|
8365
8396
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8366
|
-
|
|
8397
|
+
chunk4O7PPQ2V_js.stopAllPersistentAudio();
|
|
8367
8398
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8368
8399
|
if (promptKeepInkAnnotations) {
|
|
8369
8400
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8372,7 +8403,7 @@ function useAnnotationHandlers(input) {
|
|
|
8372
8403
|
}
|
|
8373
8404
|
} else {
|
|
8374
8405
|
if (mode === "present") {
|
|
8375
|
-
|
|
8406
|
+
chunk4O7PPQ2V_js.stopAllPersistentAudio();
|
|
8376
8407
|
}
|
|
8377
8408
|
setMode(nextMode);
|
|
8378
8409
|
}
|
|
@@ -8438,13 +8469,13 @@ function useSerialize(input) {
|
|
|
8438
8469
|
let processedSlide = slide;
|
|
8439
8470
|
if (pendingEditId) {
|
|
8440
8471
|
const updatedElements = slide.elements.map((el) => {
|
|
8441
|
-
if (el.id !== pendingEditId || !
|
|
8472
|
+
if (el.id !== pendingEditId || !chunkT7AMP24E_js.hasTextProperties(el)) {
|
|
8442
8473
|
return el;
|
|
8443
8474
|
}
|
|
8444
8475
|
return {
|
|
8445
8476
|
...el,
|
|
8446
8477
|
text: pendingEditText,
|
|
8447
|
-
textSegments:
|
|
8478
|
+
textSegments: chunkT7AMP24E_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8448
8479
|
};
|
|
8449
8480
|
});
|
|
8450
8481
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8457,14 +8488,14 @@ function useSerialize(input) {
|
|
|
8457
8488
|
const pptxGuides = guides.map((g) => ({
|
|
8458
8489
|
id: g.id,
|
|
8459
8490
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8460
|
-
positionEmu:
|
|
8491
|
+
positionEmu: chunkT7AMP24E_js.guidePxToEmu(g.position)
|
|
8461
8492
|
}));
|
|
8462
8493
|
return {
|
|
8463
8494
|
...processedSlide,
|
|
8464
8495
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8465
8496
|
};
|
|
8466
8497
|
});
|
|
8467
|
-
const slidesToSave =
|
|
8498
|
+
const slidesToSave = chunk4O7PPQ2V_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8468
8499
|
const saveOptions = {
|
|
8469
8500
|
headerFooter,
|
|
8470
8501
|
presentationProperties,
|
|
@@ -8633,7 +8664,7 @@ function usePresentationSetup(input) {
|
|
|
8633
8664
|
containerRef,
|
|
8634
8665
|
content,
|
|
8635
8666
|
onSetMode: (nextMode) => {
|
|
8636
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8667
|
+
if (mode === "present" && nextMode !== "present" && !chunkT7AMP24E_js.mayLeaveSlideShow()) {
|
|
8637
8668
|
return;
|
|
8638
8669
|
}
|
|
8639
8670
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8641,7 +8672,7 @@ function usePresentationSetup(input) {
|
|
|
8641
8672
|
setShowKeepAnnotationsDialog(true);
|
|
8642
8673
|
} else {
|
|
8643
8674
|
if (mode === "present" && nextMode !== "present") {
|
|
8644
|
-
|
|
8675
|
+
chunk4O7PPQ2V_js.stopAllPersistentAudio();
|
|
8645
8676
|
stopAnimationSound();
|
|
8646
8677
|
}
|
|
8647
8678
|
setMode(nextMode);
|
|
@@ -8695,10 +8726,10 @@ function usePresentationSetup(input) {
|
|
|
8695
8726
|
onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
|
|
8696
8727
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8697
8728
|
onSaveRehearsalTimings: (timings) => {
|
|
8698
|
-
setSlides((prev) =>
|
|
8729
|
+
setSlides((prev) => chunkT7AMP24E_js.applyRehearsalTimings(prev, timings));
|
|
8699
8730
|
history.markDirty();
|
|
8700
8731
|
},
|
|
8701
|
-
loopContinuously:
|
|
8732
|
+
loopContinuously: chunkT7AMP24E_js.shouldLoopContinuously(presentationProperties),
|
|
8702
8733
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8703
8734
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8704
8735
|
endWithBlackSlide
|
|
@@ -8860,7 +8891,7 @@ function useEditorOperations(input) {
|
|
|
8860
8891
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
8861
8892
|
react.useEffect(() => {
|
|
8862
8893
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
8863
|
-
copiedFormatRef.current =
|
|
8894
|
+
copiedFormatRef.current = chunkT7AMP24E_js.copyFormatFromElement(selectedElement);
|
|
8864
8895
|
} else if (!formatPainterActive) {
|
|
8865
8896
|
copiedFormatRef.current = null;
|
|
8866
8897
|
}
|
|
@@ -8886,12 +8917,12 @@ function useEditorOperations(input) {
|
|
|
8886
8917
|
e.stopPropagation();
|
|
8887
8918
|
const element = elementLookup.get(elementId);
|
|
8888
8919
|
if (element) {
|
|
8889
|
-
const updated =
|
|
8920
|
+
const updated = chunkT7AMP24E_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
8890
8921
|
const updates = {};
|
|
8891
|
-
if (
|
|
8922
|
+
if (chunkT7AMP24E_js.hasShapeProperties(updated)) {
|
|
8892
8923
|
updates.shapeStyle = updated.shapeStyle;
|
|
8893
8924
|
}
|
|
8894
|
-
if (
|
|
8925
|
+
if (chunkT7AMP24E_js.hasTextProperties(updated)) {
|
|
8895
8926
|
updates.textStyle = updated.textStyle;
|
|
8896
8927
|
}
|
|
8897
8928
|
ops.updateElementById(elementId, updates);
|
|
@@ -9038,7 +9069,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9038
9069
|
const families = /* @__PURE__ */ new Set();
|
|
9039
9070
|
for (const slide of slides) {
|
|
9040
9071
|
for (const el of slide.elements) {
|
|
9041
|
-
if (
|
|
9072
|
+
if (chunkT7AMP24E_js.hasTextProperties(el) && el.textSegments) {
|
|
9042
9073
|
for (const seg of el.textSegments) {
|
|
9043
9074
|
if (seg.style.fontFamily) {
|
|
9044
9075
|
families.add(seg.style.fontFamily);
|
|
@@ -9607,7 +9638,7 @@ function useViewerIntegration(input) {
|
|
|
9607
9638
|
return zoom.scale;
|
|
9608
9639
|
},
|
|
9609
9640
|
setZoom(level) {
|
|
9610
|
-
zoom.setScale(Math.min(Math.max(level,
|
|
9641
|
+
zoom.setScale(Math.min(Math.max(level, chunk4O7PPQ2V_js.MIN_ZOOM_SCALE), chunk4O7PPQ2V_js.MAX_ZOOM_SCALE));
|
|
9611
9642
|
},
|
|
9612
9643
|
zoomIn() {
|
|
9613
9644
|
zoom.handleZoomIn();
|
|
@@ -9822,7 +9853,7 @@ function useReducedMotion() {
|
|
|
9822
9853
|
}
|
|
9823
9854
|
function useViewerOptions() {
|
|
9824
9855
|
const storeRef = react.useRef(null);
|
|
9825
|
-
storeRef.current ??=
|
|
9856
|
+
storeRef.current ??= chunkT7AMP24E_js.createViewerOptionsStore();
|
|
9826
9857
|
const store = storeRef.current;
|
|
9827
9858
|
const options = react.useSyncExternalStore(
|
|
9828
9859
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9831,9 +9862,9 @@ function useViewerOptions() {
|
|
|
9831
9862
|
);
|
|
9832
9863
|
return { optionsStore: store, options };
|
|
9833
9864
|
}
|
|
9834
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9865
|
+
var KNOWN_TAB_IDS = new Set(chunkT7AMP24E_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9835
9866
|
function computeToolbarVisibility(hiddenActions) {
|
|
9836
|
-
const isHidden = (id) =>
|
|
9867
|
+
const isHidden = (id) => chunkT7AMP24E_js.isActionHidden(id, hiddenActions);
|
|
9837
9868
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
9838
9869
|
return { isHidden, isTabVisible };
|
|
9839
9870
|
}
|
|
@@ -9918,12 +9949,12 @@ function useYjsDocumentSync({
|
|
|
9918
9949
|
return;
|
|
9919
9950
|
}
|
|
9920
9951
|
try {
|
|
9921
|
-
const handler = new
|
|
9952
|
+
const handler = new chunkT7AMP24E_js.PptxHandler();
|
|
9922
9953
|
await handler.load(sourceBytes.buffer);
|
|
9923
|
-
const currentSlides =
|
|
9954
|
+
const currentSlides = chunkT7AMP24E_js.readSlidesFromYDoc(
|
|
9924
9955
|
doc
|
|
9925
9956
|
);
|
|
9926
|
-
const slidesToSave =
|
|
9957
|
+
const slidesToSave = chunk4O7PPQ2V_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
9927
9958
|
const bytes = await handler.save(slidesToSave);
|
|
9928
9959
|
config.onWriteBack(bytes);
|
|
9929
9960
|
} catch {
|
|
@@ -9938,7 +9969,7 @@ function useYjsDocumentSync({
|
|
|
9938
9969
|
if (!doc || !isConnected) {
|
|
9939
9970
|
return;
|
|
9940
9971
|
}
|
|
9941
|
-
const docSlides =
|
|
9972
|
+
const docSlides = chunkT7AMP24E_js.readSlidesFromYDoc(
|
|
9942
9973
|
doc
|
|
9943
9974
|
);
|
|
9944
9975
|
if (docSlides.length === 0) {
|
|
@@ -9960,11 +9991,11 @@ function useYjsDocumentSync({
|
|
|
9960
9991
|
lastSyncedRef.current = serialized;
|
|
9961
9992
|
void (async () => {
|
|
9962
9993
|
const factories = await getFactories();
|
|
9963
|
-
|
|
9994
|
+
chunkT7AMP24E_js.reconcileSlidesInYDoc(
|
|
9964
9995
|
slides,
|
|
9965
9996
|
doc,
|
|
9966
9997
|
factories,
|
|
9967
|
-
|
|
9998
|
+
chunkT7AMP24E_js.LOCAL_SYNC_ORIGIN
|
|
9968
9999
|
);
|
|
9969
10000
|
scheduleWriteBack();
|
|
9970
10001
|
})();
|
|
@@ -9978,10 +10009,10 @@ function useYjsDocumentSync({
|
|
|
9978
10009
|
return;
|
|
9979
10010
|
}
|
|
9980
10011
|
const handleChange = (_events, transaction) => {
|
|
9981
|
-
if (transaction?.origin ===
|
|
10012
|
+
if (transaction?.origin === chunkT7AMP24E_js.LOCAL_SYNC_ORIGIN) {
|
|
9982
10013
|
return;
|
|
9983
10014
|
}
|
|
9984
|
-
const remoteSlides =
|
|
10015
|
+
const remoteSlides = chunkT7AMP24E_js.readSlidesFromYDoc(
|
|
9985
10016
|
doc
|
|
9986
10017
|
);
|
|
9987
10018
|
if (remoteSlides.length === 0) {
|
|
@@ -9997,7 +10028,7 @@ function useYjsDocumentSync({
|
|
|
9997
10028
|
isApplyingRemoteRef.current = false;
|
|
9998
10029
|
scheduleWriteBack();
|
|
9999
10030
|
};
|
|
10000
|
-
const unobserve =
|
|
10031
|
+
const unobserve = chunkT7AMP24E_js.observeYDocSlides(
|
|
10001
10032
|
doc,
|
|
10002
10033
|
handleChange
|
|
10003
10034
|
);
|
|
@@ -10035,7 +10066,7 @@ function useBroadcastFollower({
|
|
|
10035
10066
|
if (!broadcaster) {
|
|
10036
10067
|
return;
|
|
10037
10068
|
}
|
|
10038
|
-
if (!
|
|
10069
|
+
if (!chunkT7AMP24E_js.shouldAutoFollowBroadcaster({
|
|
10039
10070
|
localRole: collab.config.role,
|
|
10040
10071
|
broadcasterRole: broadcaster.role
|
|
10041
10072
|
})) {
|
|
@@ -10195,10 +10226,10 @@ function useTouchGestures(input) {
|
|
|
10195
10226
|
if (!el || !enabled) {
|
|
10196
10227
|
return;
|
|
10197
10228
|
}
|
|
10198
|
-
const recognizer =
|
|
10229
|
+
const recognizer = chunkT7AMP24E_js.createTouchGestureRecognizer({
|
|
10199
10230
|
getScale: () => scaleRef.current,
|
|
10200
|
-
minScale:
|
|
10201
|
-
maxScale:
|
|
10231
|
+
minScale: chunk4O7PPQ2V_js.MIN_ZOOM_SCALE,
|
|
10232
|
+
maxScale: chunk4O7PPQ2V_js.MAX_ZOOM_SCALE,
|
|
10202
10233
|
callbacks: {
|
|
10203
10234
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10204
10235
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10238,7 +10269,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10238
10269
|
return;
|
|
10239
10270
|
}
|
|
10240
10271
|
const rect = active.getBoundingClientRect();
|
|
10241
|
-
const delta =
|
|
10272
|
+
const delta = chunkT7AMP24E_js.computeScrollDelta(
|
|
10242
10273
|
{ top: rect.top, bottom: rect.bottom },
|
|
10243
10274
|
window.innerHeight,
|
|
10244
10275
|
keyboardInset
|
|
@@ -10258,8 +10289,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10258
10289
|
return;
|
|
10259
10290
|
}
|
|
10260
10291
|
const update = () => {
|
|
10261
|
-
const metrics =
|
|
10262
|
-
const inset = metrics ?
|
|
10292
|
+
const metrics = chunkT7AMP24E_js.readViewportMetrics(window);
|
|
10293
|
+
const inset = metrics ? chunkT7AMP24E_js.computeKeyboardInset(metrics) : 0;
|
|
10263
10294
|
setKeyboardInset(inset);
|
|
10264
10295
|
if (inset > 0) {
|
|
10265
10296
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10270,8 +10301,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10270
10301
|
vv.addEventListener("scroll", update);
|
|
10271
10302
|
const onFocusIn = () => {
|
|
10272
10303
|
window.requestAnimationFrame(() => {
|
|
10273
|
-
const metrics =
|
|
10274
|
-
const inset = metrics ?
|
|
10304
|
+
const metrics = chunkT7AMP24E_js.readViewportMetrics(window);
|
|
10305
|
+
const inset = metrics ? chunkT7AMP24E_js.computeKeyboardInset(metrics) : 0;
|
|
10275
10306
|
if (inset > 0) {
|
|
10276
10307
|
scrollFocusedIntoView(inset);
|
|
10277
10308
|
}
|
|
@@ -10284,7 +10315,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10284
10315
|
document.removeEventListener("focusin", onFocusIn);
|
|
10285
10316
|
};
|
|
10286
10317
|
}, [enabled]);
|
|
10287
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10318
|
+
return { keyboardInset, isKeyboardOpen: chunkT7AMP24E_js.isKeyboardOpen(keyboardInset) };
|
|
10288
10319
|
}
|
|
10289
10320
|
|
|
10290
10321
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10339,13 +10370,13 @@ function buildCanvasProps(input) {
|
|
|
10339
10370
|
if (mode === "present") {
|
|
10340
10371
|
presentation.handlePresentationAction(action);
|
|
10341
10372
|
} else if (action.url) {
|
|
10342
|
-
|
|
10373
|
+
chunkT7AMP24E_js.safeOpenUrl(action.url);
|
|
10343
10374
|
}
|
|
10344
10375
|
};
|
|
10345
10376
|
const handleHyperlinkClick = (url) => {
|
|
10346
|
-
if (
|
|
10377
|
+
if (chunkT7AMP24E_js.isPpactionUrl(url)) {
|
|
10347
10378
|
if (mode === "present") {
|
|
10348
|
-
const parsed =
|
|
10379
|
+
const parsed = chunkT7AMP24E_js.parsePpactionUrl(url);
|
|
10349
10380
|
if (parsed) {
|
|
10350
10381
|
presentation.handlePresentationAction({
|
|
10351
10382
|
action: parsed.action,
|
|
@@ -10355,7 +10386,7 @@ function buildCanvasProps(input) {
|
|
|
10355
10386
|
}
|
|
10356
10387
|
return;
|
|
10357
10388
|
}
|
|
10358
|
-
|
|
10389
|
+
chunkT7AMP24E_js.safeOpenUrl(url);
|
|
10359
10390
|
};
|
|
10360
10391
|
return {
|
|
10361
10392
|
activeSlide: effectiveSlide,
|
|
@@ -10675,7 +10706,7 @@ function buildToolbarProps(input) {
|
|
|
10675
10706
|
onOpenFile,
|
|
10676
10707
|
onOpenRecentFile,
|
|
10677
10708
|
onCreatePresentation: (templateId) => {
|
|
10678
|
-
s.setSlides(
|
|
10709
|
+
s.setSlides(chunkT7AMP24E_js.createBackstagePresentation(templateId));
|
|
10679
10710
|
s.setActiveSlideIndex(0);
|
|
10680
10711
|
s.setSelectedElementId(null);
|
|
10681
10712
|
s.setSelectedElementIds([]);
|
|
@@ -10730,7 +10761,7 @@ function buildToolbarProps(input) {
|
|
|
10730
10761
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10731
10762
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10732
10763
|
formatPainterActive: s.formatPainterActive,
|
|
10733
|
-
canActivateFormatPainter:
|
|
10764
|
+
canActivateFormatPainter: chunkT7AMP24E_js.hasCopyableFormat(selectedElement),
|
|
10734
10765
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10735
10766
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10736
10767
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -10993,7 +11024,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
10993
11024
|
}, [incomingContent]);
|
|
10994
11025
|
const onOpenFile = react.useCallback(() => {
|
|
10995
11026
|
void (async () => {
|
|
10996
|
-
const picked = await
|
|
11027
|
+
const picked = await chunkT7AMP24E_js.openPptxFile();
|
|
10997
11028
|
if (picked) {
|
|
10998
11029
|
setContent(picked.buffer);
|
|
10999
11030
|
}
|
|
@@ -11001,7 +11032,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11001
11032
|
}, []);
|
|
11002
11033
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11003
11034
|
void (async () => {
|
|
11004
|
-
const bytes = await
|
|
11035
|
+
const bytes = await chunkT7AMP24E_js.readBackstageRecentFile(key);
|
|
11005
11036
|
if (bytes) {
|
|
11006
11037
|
setContent(bytes);
|
|
11007
11038
|
}
|