pptx-react-viewer 2.6.3 → 2.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/dist/{AiChatPanel-XT26Z3KM.mjs → AiChatPanel-5JEL2M7L.mjs} +3 -3
- package/dist/AiChatPanel-5JEL2M7L.mjs.br +0 -0
- package/dist/AiChatPanel-5JEL2M7L.mjs.gz +0 -0
- package/dist/{AiChatPanel-Y4XJ4THX.js → AiChatPanel-GMP3TU7S.js} +22 -22
- package/dist/AiChatPanel-GMP3TU7S.js.br +0 -0
- package/dist/AiChatPanel-GMP3TU7S.js.gz +0 -0
- package/dist/{Model3DScene-OBG67YKJ.js → Model3DScene-E4WWASL7.js} +2 -2
- package/dist/Model3DScene-E4WWASL7.js.br +0 -0
- package/dist/Model3DScene-E4WWASL7.js.gz +0 -0
- package/dist/{Model3DScene-IQDJJZAM.mjs → Model3DScene-LPA4HGFY.mjs} +1 -1
- package/dist/Model3DScene-LPA4HGFY.mjs.br +0 -0
- package/dist/Model3DScene-LPA4HGFY.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-OJR7PBUU.js → SurfaceChart3DScene-EOJ6FO7H.js} +2 -2
- package/dist/SurfaceChart3DScene-EOJ6FO7H.js.br +0 -0
- package/dist/SurfaceChart3DScene-EOJ6FO7H.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-KFIHKHEB.mjs → SurfaceChart3DScene-JT64KYVP.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-KFIHKHEB.mjs.br → SurfaceChart3DScene-JT64KYVP.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-JT64KYVP.mjs.gz +0 -0
- package/dist/{chunk-77XK7DJE.mjs → chunk-A3WQ6JDW.mjs} +2 -2
- package/dist/chunk-A3WQ6JDW.mjs.br +0 -0
- package/dist/chunk-A3WQ6JDW.mjs.gz +0 -0
- package/dist/{chunk-JPACC7ZB.js → chunk-CZPAFVPN.js} +315 -315
- package/dist/chunk-CZPAFVPN.js.br +0 -0
- package/dist/chunk-CZPAFVPN.js.gz +0 -0
- package/dist/{chunk-AH5DPIY2.js → chunk-D754TQ4S.js} +3 -3
- package/dist/chunk-D754TQ4S.js.br +0 -0
- package/dist/chunk-D754TQ4S.js.gz +0 -0
- package/dist/{chunk-FV5GXJ4L.mjs → chunk-GMW7VRFD.mjs} +24 -18
- package/dist/chunk-GMW7VRFD.mjs.br +0 -0
- package/dist/{chunk-FV5GXJ4L.mjs.gz → chunk-GMW7VRFD.mjs.gz} +0 -0
- package/dist/{chunk-KYAV5V7C.mjs → chunk-HHUBO5OD.mjs} +1 -1
- package/dist/chunk-HHUBO5OD.mjs.br +0 -0
- package/dist/chunk-HHUBO5OD.mjs.gz +0 -0
- package/dist/{chunk-6W4AEXA3.js → chunk-K26WJWSH.js} +850 -851
- package/dist/chunk-K26WJWSH.js.br +0 -0
- package/dist/chunk-K26WJWSH.js.gz +0 -0
- package/dist/{chunk-I6XL525L.mjs → chunk-MVXW7BHH.mjs} +2 -2
- package/dist/chunk-MVXW7BHH.mjs.br +0 -0
- package/dist/chunk-MVXW7BHH.mjs.gz +0 -0
- package/dist/{chunk-5ZI2ZG5E.js → chunk-NZYSI3BL.js} +236 -236
- package/dist/chunk-NZYSI3BL.js.br +0 -0
- package/dist/chunk-NZYSI3BL.js.gz +0 -0
- package/dist/{chunk-V6HOH4XZ.mjs → chunk-PQDHPMQG.mjs} +14 -15
- package/dist/chunk-PQDHPMQG.mjs.br +0 -0
- package/dist/chunk-PQDHPMQG.mjs.gz +0 -0
- package/dist/{chunk-HHQRYCLW.js → chunk-Z2ZC5QTJ.js} +24 -18
- package/dist/chunk-Z2ZC5QTJ.js.br +0 -0
- package/dist/{chunk-HHQRYCLW.js.gz → chunk-Z2ZC5QTJ.js.gz} +0 -0
- package/dist/index.js +34 -34
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.js +21 -21
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-XT26Z3KM.mjs.br +0 -0
- package/dist/AiChatPanel-XT26Z3KM.mjs.gz +0 -0
- package/dist/AiChatPanel-Y4XJ4THX.js.br +0 -0
- package/dist/AiChatPanel-Y4XJ4THX.js.gz +0 -0
- package/dist/Model3DScene-IQDJJZAM.mjs.br +0 -0
- package/dist/Model3DScene-IQDJJZAM.mjs.gz +0 -0
- package/dist/Model3DScene-OBG67YKJ.js.br +0 -0
- package/dist/Model3DScene-OBG67YKJ.js.gz +0 -0
- package/dist/SurfaceChart3DScene-KFIHKHEB.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-OJR7PBUU.js.br +0 -0
- package/dist/SurfaceChart3DScene-OJR7PBUU.js.gz +0 -0
- package/dist/chunk-5ZI2ZG5E.js.br +0 -0
- package/dist/chunk-5ZI2ZG5E.js.gz +0 -0
- package/dist/chunk-6W4AEXA3.js.br +0 -0
- package/dist/chunk-6W4AEXA3.js.gz +0 -0
- package/dist/chunk-77XK7DJE.mjs.br +0 -0
- package/dist/chunk-77XK7DJE.mjs.gz +0 -0
- package/dist/chunk-AH5DPIY2.js.br +0 -0
- package/dist/chunk-AH5DPIY2.js.gz +0 -0
- package/dist/chunk-FV5GXJ4L.mjs.br +0 -0
- package/dist/chunk-HHQRYCLW.js.br +0 -0
- package/dist/chunk-I6XL525L.mjs.br +0 -0
- package/dist/chunk-I6XL525L.mjs.gz +0 -0
- package/dist/chunk-JPACC7ZB.js.br +0 -0
- package/dist/chunk-JPACC7ZB.js.gz +0 -0
- package/dist/chunk-KYAV5V7C.mjs.br +0 -0
- package/dist/chunk-KYAV5V7C.mjs.gz +0 -0
- package/dist/chunk-V6HOH4XZ.mjs.br +0 -0
- package/dist/chunk-V6HOH4XZ.mjs.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkNZYSI3BL_js = require('./chunk-NZYSI3BL.js');
|
|
4
4
|
var chunk25VSL2BB_js = require('./chunk-25VSL2BB.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkZ2ZC5QTJ_js = require('./chunk-Z2ZC5QTJ.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 = chunkZ2ZC5QTJ_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 = chunkZ2ZC5QTJ_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 >= chunkZ2ZC5QTJ_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
|
+
}, chunkZ2ZC5QTJ_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 = chunkZ2ZC5QTJ_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 = chunkZ2ZC5QTJ_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
|
+
chunkZ2ZC5QTJ_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 = chunkZ2ZC5QTJ_js.validateRoomId(config.roomId);
|
|
243
243
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
244
|
-
departureRef.current =
|
|
244
|
+
departureRef.current = chunkZ2ZC5QTJ_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 = chunkZ2ZC5QTJ_js.validateRoomId(config.roomId);
|
|
287
|
+
const transport = config.transport ?? chunkZ2ZC5QTJ_js.resolveTransportForServerUrl(config.serverUrl);
|
|
288
288
|
if (transport === "webrtc") {
|
|
289
289
|
await initWebrtc();
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
if (
|
|
292
|
+
if (chunkZ2ZC5QTJ_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 = chunkZ2ZC5QTJ_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
|
+
chunkZ2ZC5QTJ_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
|
+
}, chunkZ2ZC5QTJ_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
|
+
chunkZ2ZC5QTJ_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 = chunkZ2ZC5QTJ_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 = chunkZ2ZC5QTJ_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(chunkZ2ZC5QTJ_js.cloneSlide),
|
|
521
|
+
templateElementsBySlideId: chunkZ2ZC5QTJ_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(chunkZ2ZC5QTJ_js.cloneSlide));
|
|
535
535
|
setTemplateElementsBySlideId(
|
|
536
|
-
|
|
536
|
+
chunkZ2ZC5QTJ_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 = chunkNZYSI3BL_js.cloneHistorySnapshot(previousSnapshot);
|
|
571
|
+
lastHistorySnapshotRef.current = chunkNZYSI3BL_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 = chunkNZYSI3BL_js.cloneHistorySnapshot(nextSnapshot);
|
|
593
|
+
lastHistorySnapshotRef.current = chunkNZYSI3BL_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 = chunkNZYSI3BL_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 = chunkNZYSI3BL_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(chunkNZYSI3BL_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 = chunkNZYSI3BL_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, chunkNZYSI3BL_js.MIN_ZOOM_SCALE), chunkNZYSI3BL_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, chunkNZYSI3BL_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, chunkNZYSI3BL_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, chunkNZYSI3BL_js.MIN_ELEMENT_SIZE));
|
|
790
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkNZYSI3BL_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, chunkNZYSI3BL_js.MIN_ELEMENT_SIZE);
|
|
797
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkNZYSI3BL_js.MIN_ELEMENT_SIZE);
|
|
798
798
|
const availableWidth = Math.max(
|
|
799
|
-
effectiveEditorDimensions.width -
|
|
800
|
-
|
|
799
|
+
effectiveEditorDimensions.width - chunkNZYSI3BL_js.ZOOM_TO_SELECTION_PADDING,
|
|
800
|
+
chunkNZYSI3BL_js.MIN_ELEMENT_SIZE
|
|
801
801
|
);
|
|
802
802
|
const availableHeight = Math.max(
|
|
803
|
-
effectiveEditorDimensions.height -
|
|
804
|
-
|
|
803
|
+
effectiveEditorDimensions.height - chunkNZYSI3BL_js.ZOOM_TO_SELECTION_PADDING,
|
|
804
|
+
chunkNZYSI3BL_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, chunkNZYSI3BL_js.MIN_ZOOM_SCALE),
|
|
813
|
+
chunkNZYSI3BL_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, chunkNZYSI3BL_js.MIN_ZOOM_SCALE), chunkNZYSI3BL_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
|
+
chunkNZYSI3BL_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
|
+
chunkZ2ZC5QTJ_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 = chunkZ2ZC5QTJ_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 = chunkZ2ZC5QTJ_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 = chunkZ2ZC5QTJ_js.PRESENTATION_CHANNEL_NAME;
|
|
1278
|
+
var AUDIENCE_HASH = chunkZ2ZC5QTJ_js.PRESENTATION_HASH;
|
|
1279
|
+
var PRESENTER_MSG_ORIGIN = chunkZ2ZC5QTJ_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1280
|
+
var AUDIENCE_NONCE_KEY = chunkZ2ZC5QTJ_js.PRESENTATION_NONCE_KEY;
|
|
1281
1281
|
function generateSessionId() {
|
|
1282
|
-
return
|
|
1282
|
+
return chunkZ2ZC5QTJ_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 ? chunkZ2ZC5QTJ_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 chunkZ2ZC5QTJ_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 = chunkZ2ZC5QTJ_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1401
|
+
void chunkZ2ZC5QTJ_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1402
1402
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1403
|
-
|
|
1403
|
+
chunkZ2ZC5QTJ_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 chunkZ2ZC5QTJ_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 (chunkZ2ZC5QTJ_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 chunkZ2ZC5QTJ_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 (!chunkZ2ZC5QTJ_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 chunkZ2ZC5QTJ_js.clearAudienceContent(expectedSessionId);
|
|
1567
1567
|
}
|
|
1568
|
-
if (
|
|
1568
|
+
if (chunkZ2ZC5QTJ_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: chunkZ2ZC5QTJ_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(chunkZ2ZC5QTJ_js.createPresentationKeyBuffer());
|
|
1608
1608
|
react.useEffect(() => {
|
|
1609
|
-
if (mode !== "present" || !
|
|
1610
|
-
keyBufferRef.current =
|
|
1609
|
+
if (mode !== "present" || !chunkZ2ZC5QTJ_js.acceptsPresentationInput()) {
|
|
1610
|
+
keyBufferRef.current = chunkZ2ZC5QTJ_js.createPresentationKeyBuffer();
|
|
1611
1611
|
return;
|
|
1612
1612
|
}
|
|
1613
1613
|
const handleKeyDown = (event) => {
|
|
1614
|
-
const mapped =
|
|
1614
|
+
const mapped = chunkZ2ZC5QTJ_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 (chunkZ2ZC5QTJ_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 ? chunkZ2ZC5QTJ_js.resolveTransitionDurationMs(transition) : 0;
|
|
1833
1833
|
deps.clearPresentationTimers();
|
|
1834
1834
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1835
1835
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -2085,17 +2085,17 @@ function useZoomNavigation(input) {
|
|
|
2085
2085
|
};
|
|
2086
2086
|
}
|
|
2087
2087
|
function usePresenterConsole(slideIndex) {
|
|
2088
|
-
const timerRef = react.useRef(
|
|
2089
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2088
|
+
const timerRef = react.useRef(chunkZ2ZC5QTJ_js.createPresenterTimer());
|
|
2089
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkZ2ZC5QTJ_js.createInitialPresentationSnapshot(slideIndex));
|
|
2090
2090
|
const patch = react.useCallback((value) => {
|
|
2091
|
-
setSnapshot((current) =>
|
|
2091
|
+
setSnapshot((current) => chunkZ2ZC5QTJ_js.mergePresentationSnapshot(current, value));
|
|
2092
2092
|
}, []);
|
|
2093
2093
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2094
2094
|
react.useEffect(() => {
|
|
2095
2095
|
const timer = window.setInterval(() => {
|
|
2096
2096
|
patch({
|
|
2097
2097
|
paused: timerRef.current.paused,
|
|
2098
|
-
elapsedMs:
|
|
2098
|
+
elapsedMs: chunkZ2ZC5QTJ_js.presenterElapsed(timerRef.current)
|
|
2099
2099
|
});
|
|
2100
2100
|
}, 1e3);
|
|
2101
2101
|
return () => window.clearInterval(timer);
|
|
@@ -2105,19 +2105,19 @@ function usePresenterConsole(slideIndex) {
|
|
|
2105
2105
|
applyAudienceSnapshot: setSnapshot,
|
|
2106
2106
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2107
2107
|
toggleTimer: () => {
|
|
2108
|
-
timerRef.current =
|
|
2108
|
+
timerRef.current = chunkZ2ZC5QTJ_js.togglePresenterTimer(timerRef.current);
|
|
2109
2109
|
patch({
|
|
2110
2110
|
paused: timerRef.current.paused,
|
|
2111
|
-
elapsedMs:
|
|
2111
|
+
elapsedMs: chunkZ2ZC5QTJ_js.presenterElapsed(timerRef.current)
|
|
2112
2112
|
});
|
|
2113
2113
|
},
|
|
2114
2114
|
resetTimer: () => {
|
|
2115
|
-
timerRef.current =
|
|
2115
|
+
timerRef.current = chunkZ2ZC5QTJ_js.resetPresenterTimer();
|
|
2116
2116
|
patch({ paused: false, elapsedMs: 0 });
|
|
2117
2117
|
},
|
|
2118
2118
|
stepZoom: (direction) => setSnapshot(
|
|
2119
|
-
(current) =>
|
|
2120
|
-
zoom:
|
|
2119
|
+
(current) => chunkZ2ZC5QTJ_js.mergePresentationSnapshot(current, {
|
|
2120
|
+
zoom: chunkZ2ZC5QTJ_js.stepPresenterZoom(
|
|
2121
2121
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2122
2122
|
direction
|
|
2123
2123
|
)
|
|
@@ -2238,7 +2238,7 @@ function usePresentationMode(input) {
|
|
|
2238
2238
|
});
|
|
2239
2239
|
const movePresentationSlide = react.useCallback(
|
|
2240
2240
|
(direction, trigger = "explicit") => {
|
|
2241
|
-
if (!
|
|
2241
|
+
if (!chunkZ2ZC5QTJ_js.acceptsPresentationInput()) {
|
|
2242
2242
|
return;
|
|
2243
2243
|
}
|
|
2244
2244
|
if (endOfShowVisible) {
|
|
@@ -2440,11 +2440,11 @@ function usePresentationMode(input) {
|
|
|
2440
2440
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2441
2441
|
return void 0;
|
|
2442
2442
|
}
|
|
2443
|
-
return
|
|
2443
|
+
return chunkZ2ZC5QTJ_js.buildMorphTransitionPlan(
|
|
2444
2444
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2445
2445
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2446
2446
|
transitionOverlay.durationMs,
|
|
2447
|
-
|
|
2447
|
+
chunkZ2ZC5QTJ_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2448
2448
|
);
|
|
2449
2449
|
}, [transitionOverlay, slides]);
|
|
2450
2450
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2750,7 +2750,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2750
2750
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2751
2751
|
slides.forEach((slide, slideIndex) => {
|
|
2752
2752
|
for (const element of slide.elements || []) {
|
|
2753
|
-
if (!
|
|
2753
|
+
if (!chunkZ2ZC5QTJ_js.hasTextProperties(element)) {
|
|
2754
2754
|
continue;
|
|
2755
2755
|
}
|
|
2756
2756
|
const segments = element.textSegments ?? [];
|
|
@@ -2801,7 +2801,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2801
2801
|
continue;
|
|
2802
2802
|
}
|
|
2803
2803
|
const element = slide.elements[elIdx];
|
|
2804
|
-
if (!
|
|
2804
|
+
if (!chunkZ2ZC5QTJ_js.hasTextProperties(element)) {
|
|
2805
2805
|
continue;
|
|
2806
2806
|
}
|
|
2807
2807
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3399,7 +3399,7 @@ function useViewerCoreState(_input) {
|
|
|
3399
3399
|
const shapeAdjustmentDragStateRef = react.useRef(null);
|
|
3400
3400
|
const marqueeStateRef = react.useRef(null);
|
|
3401
3401
|
const isDrawingRef = react.useRef(false);
|
|
3402
|
-
const livePatcher = react.useMemo(() =>
|
|
3402
|
+
const livePatcher = react.useMemo(() => chunkZ2ZC5QTJ_js.createCollaborationLivePatcher(), []);
|
|
3403
3403
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3404
3404
|
const slidesRef = react.useRef([]);
|
|
3405
3405
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3408,8 +3408,8 @@ function useViewerCoreState(_input) {
|
|
|
3408
3408
|
const [slides, setSlides] = react.useState([]);
|
|
3409
3409
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3410
3410
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3411
|
-
width:
|
|
3412
|
-
height:
|
|
3411
|
+
width: chunkNZYSI3BL_js.DEFAULT_CANVAS_WIDTH,
|
|
3412
|
+
height: chunkNZYSI3BL_js.DEFAULT_CANVAS_HEIGHT
|
|
3413
3413
|
});
|
|
3414
3414
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
3415
3415
|
const [selectedElementId, setSelectedElementId] = react.useState(null);
|
|
@@ -3429,7 +3429,7 @@ function useViewerCoreState(_input) {
|
|
|
3429
3429
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3430
3430
|
inlineEditingTextRef.current = resolved;
|
|
3431
3431
|
setInlineEditingTextBase(value);
|
|
3432
|
-
|
|
3432
|
+
chunkZ2ZC5QTJ_js.publishLiveInlineText(
|
|
3433
3433
|
livePatcher,
|
|
3434
3434
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3435
3435
|
inlineEditingElementIdRef.current,
|
|
@@ -3754,7 +3754,7 @@ function useLoadContent({
|
|
|
3754
3754
|
);
|
|
3755
3755
|
}
|
|
3756
3756
|
const previousHandler = handlerRef.current;
|
|
3757
|
-
const handler = new
|
|
3757
|
+
const handler = new chunkZ2ZC5QTJ_js.PptxHandler();
|
|
3758
3758
|
const parsed = await handler.load(buffer);
|
|
3759
3759
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3760
3760
|
handler.dispose();
|
|
@@ -3766,7 +3766,7 @@ function useLoadContent({
|
|
|
3766
3766
|
handlerRef.current = null;
|
|
3767
3767
|
const mediaElements = [];
|
|
3768
3768
|
for (const slide of parsed.slides) {
|
|
3769
|
-
|
|
3769
|
+
chunkZ2ZC5QTJ_js.collectMediaElements(slide.elements, mediaElements);
|
|
3770
3770
|
}
|
|
3771
3771
|
for (const url of mediaDataUrls.values()) {
|
|
3772
3772
|
if (url.startsWith("blob:")) {
|
|
@@ -3807,7 +3807,7 @@ function useLoadContent({
|
|
|
3807
3807
|
}
|
|
3808
3808
|
})
|
|
3809
3809
|
);
|
|
3810
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3810
|
+
const { paths: imagePaths, refs: imageRefs } = chunkZ2ZC5QTJ_js.collectImagePaths(parsed.slides);
|
|
3811
3811
|
let nextSlides = parsed.slides;
|
|
3812
3812
|
if (imagePaths.size > 0) {
|
|
3813
3813
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3862,12 +3862,12 @@ function useLoadContent({
|
|
|
3862
3862
|
}
|
|
3863
3863
|
}
|
|
3864
3864
|
handlerRef.current = handler;
|
|
3865
|
-
const partition =
|
|
3865
|
+
const partition = chunkNZYSI3BL_js.partitionTemplateElements(nextSlides);
|
|
3866
3866
|
setSlides(partition.slides);
|
|
3867
3867
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3868
3868
|
setCanvasSize({
|
|
3869
|
-
width: parsed.width ??
|
|
3870
|
-
height: parsed.height ??
|
|
3869
|
+
width: parsed.width ?? chunkNZYSI3BL_js.DEFAULT_CANVAS_WIDTH,
|
|
3870
|
+
height: parsed.height ?? chunkNZYSI3BL_js.DEFAULT_CANVAS_HEIGHT
|
|
3871
3871
|
});
|
|
3872
3872
|
setHeaderFooter(parsed.headerFooter ?? {});
|
|
3873
3873
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
@@ -3896,7 +3896,7 @@ function useLoadContent({
|
|
|
3896
3896
|
setHasMacros(parsed.hasMacros === true);
|
|
3897
3897
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3898
3898
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3899
|
-
setGuides(
|
|
3899
|
+
setGuides(chunkZ2ZC5QTJ_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3900
3900
|
setActiveSlideIndex(0);
|
|
3901
3901
|
clearSelection();
|
|
3902
3902
|
setIsDirty(false);
|
|
@@ -3904,7 +3904,7 @@ function useLoadContent({
|
|
|
3904
3904
|
onContentApplied?.();
|
|
3905
3905
|
} catch (err) {
|
|
3906
3906
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3907
|
-
if (err instanceof
|
|
3907
|
+
if (err instanceof chunkZ2ZC5QTJ_js.EncryptedFileError) {
|
|
3908
3908
|
setIsEncrypted(true);
|
|
3909
3909
|
} else {
|
|
3910
3910
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3981,7 +3981,7 @@ function useAutosave(input) {
|
|
|
3981
3981
|
isSavingRef.current = false;
|
|
3982
3982
|
return;
|
|
3983
3983
|
}
|
|
3984
|
-
await
|
|
3984
|
+
await chunkZ2ZC5QTJ_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
3985
3985
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
3986
3986
|
} catch (err) {
|
|
3987
3987
|
setAutosaveStatus({
|
|
@@ -4046,7 +4046,7 @@ function useElementOperations(input) {
|
|
|
4046
4046
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
4047
4047
|
const updateElementById = react.useCallback(
|
|
4048
4048
|
(elementId, updates) => {
|
|
4049
|
-
if (
|
|
4049
|
+
if (chunkZ2ZC5QTJ_js.isTemplateElementId(elementId)) {
|
|
4050
4050
|
const slideId = activeSlide?.id;
|
|
4051
4051
|
if (slideId) {
|
|
4052
4052
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4086,7 +4086,7 @@ function useElementOperations(input) {
|
|
|
4086
4086
|
);
|
|
4087
4087
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4088
4088
|
(updates) => {
|
|
4089
|
-
if (!selectedElement || !
|
|
4089
|
+
if (!selectedElement || !chunkZ2ZC5QTJ_js.hasShapeProperties(selectedElement)) {
|
|
4090
4090
|
return;
|
|
4091
4091
|
}
|
|
4092
4092
|
updateSelectedElement({
|
|
@@ -4097,17 +4097,17 @@ function useElementOperations(input) {
|
|
|
4097
4097
|
);
|
|
4098
4098
|
const updateSelectedTextStyle = react.useCallback(
|
|
4099
4099
|
(updates) => {
|
|
4100
|
-
if (!selectedElement || !
|
|
4100
|
+
if (!selectedElement || !chunkZ2ZC5QTJ_js.hasTextProperties(selectedElement)) {
|
|
4101
4101
|
return;
|
|
4102
4102
|
}
|
|
4103
|
-
const inlineSel =
|
|
4103
|
+
const inlineSel = chunkZ2ZC5QTJ_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4104
4104
|
if (inlineSel && selectedElement.textSegments) {
|
|
4105
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4105
|
+
const { newSegments: newSegments2, newSelection } = chunkZ2ZC5QTJ_js.applyStyleToSelectedSegments(
|
|
4106
4106
|
selectedElement.textSegments,
|
|
4107
4107
|
inlineSel,
|
|
4108
4108
|
updates
|
|
4109
4109
|
);
|
|
4110
|
-
|
|
4110
|
+
chunkZ2ZC5QTJ_js.setPendingSelectionRestore(newSelection);
|
|
4111
4111
|
updateSelectedElement({
|
|
4112
4112
|
textSegments: newSegments2
|
|
4113
4113
|
});
|
|
@@ -4127,12 +4127,12 @@ function useElementOperations(input) {
|
|
|
4127
4127
|
);
|
|
4128
4128
|
const updateSelectedTextCase = react.useCallback(
|
|
4129
4129
|
(mode) => {
|
|
4130
|
-
if (!selectedElement || !
|
|
4130
|
+
if (!selectedElement || !chunkZ2ZC5QTJ_js.hasTextProperties(selectedElement)) {
|
|
4131
4131
|
return;
|
|
4132
4132
|
}
|
|
4133
|
-
const inlineSel =
|
|
4133
|
+
const inlineSel = chunkZ2ZC5QTJ_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4134
4134
|
if (inlineSel && selectedElement.textSegments) {
|
|
4135
|
-
const newSegments =
|
|
4135
|
+
const newSegments = chunkZ2ZC5QTJ_js.applyCaseTransformToSegments(
|
|
4136
4136
|
selectedElement.textSegments,
|
|
4137
4137
|
inlineSel,
|
|
4138
4138
|
mode
|
|
@@ -4142,14 +4142,14 @@ function useElementOperations(input) {
|
|
|
4142
4142
|
}
|
|
4143
4143
|
const updates = {};
|
|
4144
4144
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4145
|
-
updates.textSegments =
|
|
4145
|
+
updates.textSegments = chunkZ2ZC5QTJ_js.applyCaseTransformToSegments(
|
|
4146
4146
|
selectedElement.textSegments,
|
|
4147
4147
|
null,
|
|
4148
4148
|
mode
|
|
4149
4149
|
);
|
|
4150
4150
|
}
|
|
4151
4151
|
if (typeof selectedElement.text === "string") {
|
|
4152
|
-
updates.text =
|
|
4152
|
+
updates.text = chunkZ2ZC5QTJ_js.transformTextCase(selectedElement.text, mode);
|
|
4153
4153
|
}
|
|
4154
4154
|
updateSelectedElement(updates);
|
|
4155
4155
|
},
|
|
@@ -4204,7 +4204,7 @@ function useSectionOperations(input) {
|
|
|
4204
4204
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4205
4205
|
const addSection2 = react.useCallback(
|
|
4206
4206
|
(name, afterSlideIndex) => {
|
|
4207
|
-
const result =
|
|
4207
|
+
const result = chunkZ2ZC5QTJ_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4208
4208
|
setSlides(result.slides);
|
|
4209
4209
|
setSections(result.sections);
|
|
4210
4210
|
markDirty();
|
|
@@ -4213,7 +4213,7 @@ function useSectionOperations(input) {
|
|
|
4213
4213
|
);
|
|
4214
4214
|
const renameSection2 = react.useCallback(
|
|
4215
4215
|
(sectionId, newName) => {
|
|
4216
|
-
const result =
|
|
4216
|
+
const result = chunkZ2ZC5QTJ_js.renameSection(sections, slides, sectionId, newName);
|
|
4217
4217
|
setSections(result.sections);
|
|
4218
4218
|
setSlides(result.slides);
|
|
4219
4219
|
markDirty();
|
|
@@ -4222,7 +4222,7 @@ function useSectionOperations(input) {
|
|
|
4222
4222
|
);
|
|
4223
4223
|
const deleteSection2 = react.useCallback(
|
|
4224
4224
|
(sectionId) => {
|
|
4225
|
-
const result =
|
|
4225
|
+
const result = chunkZ2ZC5QTJ_js.deleteSection(sections, slides, sectionId);
|
|
4226
4226
|
setSections(result.sections);
|
|
4227
4227
|
setSlides(result.slides);
|
|
4228
4228
|
markDirty();
|
|
@@ -4231,21 +4231,21 @@ function useSectionOperations(input) {
|
|
|
4231
4231
|
);
|
|
4232
4232
|
const moveSectionUp2 = react.useCallback(
|
|
4233
4233
|
(sectionId) => {
|
|
4234
|
-
setSections(
|
|
4234
|
+
setSections(chunkZ2ZC5QTJ_js.moveSectionUp(sections, sectionId));
|
|
4235
4235
|
markDirty();
|
|
4236
4236
|
},
|
|
4237
4237
|
[sections, setSections, markDirty]
|
|
4238
4238
|
);
|
|
4239
4239
|
const moveSectionDown2 = react.useCallback(
|
|
4240
4240
|
(sectionId) => {
|
|
4241
|
-
setSections(
|
|
4241
|
+
setSections(chunkZ2ZC5QTJ_js.moveSectionDown(sections, sectionId));
|
|
4242
4242
|
markDirty();
|
|
4243
4243
|
},
|
|
4244
4244
|
[sections, setSections, markDirty]
|
|
4245
4245
|
);
|
|
4246
4246
|
const moveSlidesToSection2 = react.useCallback(
|
|
4247
4247
|
(slideIndexes, targetSectionId) => {
|
|
4248
|
-
const result =
|
|
4248
|
+
const result = chunkZ2ZC5QTJ_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4249
4249
|
setSlides(result.slides);
|
|
4250
4250
|
setSections(result.sections);
|
|
4251
4251
|
markDirty();
|
|
@@ -4264,19 +4264,19 @@ function useSectionOperations(input) {
|
|
|
4264
4264
|
|
|
4265
4265
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4266
4266
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4267
|
-
const resized =
|
|
4267
|
+
const resized = chunkZ2ZC5QTJ_js.applyResize(
|
|
4268
4268
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4269
4269
|
handle,
|
|
4270
4270
|
dx,
|
|
4271
4271
|
dy,
|
|
4272
4272
|
1,
|
|
4273
|
-
{ minSize:
|
|
4273
|
+
{ minSize: chunkNZYSI3BL_js.MIN_ELEMENT_SIZE }
|
|
4274
4274
|
);
|
|
4275
4275
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4276
4276
|
if (!snapToGrid) {
|
|
4277
4277
|
return box;
|
|
4278
4278
|
}
|
|
4279
|
-
return
|
|
4279
|
+
return chunkZ2ZC5QTJ_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkNZYSI3BL_js.MIN_ELEMENT_SIZE);
|
|
4280
4280
|
}
|
|
4281
4281
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
4282
4282
|
const range = startWidth || 200;
|
|
@@ -4394,7 +4394,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4394
4394
|
width: el.width,
|
|
4395
4395
|
height: el.height
|
|
4396
4396
|
}));
|
|
4397
|
-
const snapResult =
|
|
4397
|
+
const snapResult = chunkZ2ZC5QTJ_js.computeSnapToShape(
|
|
4398
4398
|
targetX,
|
|
4399
4399
|
targetY,
|
|
4400
4400
|
primaryEl.width,
|
|
@@ -4433,7 +4433,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4433
4433
|
if (live) {
|
|
4434
4434
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4435
4435
|
const start = drag.startPositionsById[id];
|
|
4436
|
-
|
|
4436
|
+
chunkZ2ZC5QTJ_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4437
4437
|
x: start.x + appliedDx,
|
|
4438
4438
|
y: start.y + appliedDy
|
|
4439
4439
|
});
|
|
@@ -4467,15 +4467,15 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4467
4467
|
if (rs.domEl) {
|
|
4468
4468
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4469
4469
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4470
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4471
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4470
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunkNZYSI3BL_js.MIN_ELEMENT_SIZE)}px`;
|
|
4471
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunkNZYSI3BL_js.MIN_ELEMENT_SIZE)}px`;
|
|
4472
4472
|
}
|
|
4473
4473
|
if (live) {
|
|
4474
|
-
|
|
4474
|
+
chunkZ2ZC5QTJ_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4475
4475
|
x: geo.x,
|
|
4476
4476
|
y: geo.y,
|
|
4477
|
-
width: Math.max(geo.width,
|
|
4478
|
-
height: Math.max(geo.height,
|
|
4477
|
+
width: Math.max(geo.width, chunkNZYSI3BL_js.MIN_ELEMENT_SIZE),
|
|
4478
|
+
height: Math.max(geo.height, chunkNZYSI3BL_js.MIN_ELEMENT_SIZE)
|
|
4479
4479
|
});
|
|
4480
4480
|
}
|
|
4481
4481
|
}
|
|
@@ -4555,13 +4555,13 @@ function processPointerUp(input) {
|
|
|
4555
4555
|
if (i !== activeSlideIndex) {
|
|
4556
4556
|
return s;
|
|
4557
4557
|
}
|
|
4558
|
-
const rerouted =
|
|
4558
|
+
const rerouted = chunkZ2ZC5QTJ_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4559
4559
|
if (rerouted.length === 0) {
|
|
4560
4560
|
return s;
|
|
4561
4561
|
}
|
|
4562
4562
|
return {
|
|
4563
4563
|
...s,
|
|
4564
|
-
elements:
|
|
4564
|
+
elements: chunkZ2ZC5QTJ_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4565
4565
|
};
|
|
4566
4566
|
})
|
|
4567
4567
|
);
|
|
@@ -4583,9 +4583,9 @@ function processPointerUp(input) {
|
|
|
4583
4583
|
}
|
|
4584
4584
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4585
4585
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4586
|
-
const hitIds =
|
|
4586
|
+
const hitIds = chunkZ2ZC5QTJ_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4587
4587
|
if (marquee.additive) {
|
|
4588
|
-
const merged =
|
|
4588
|
+
const merged = chunkZ2ZC5QTJ_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4589
4589
|
if (merged.length > 0) {
|
|
4590
4590
|
applySelection(merged[0], merged);
|
|
4591
4591
|
} else {
|
|
@@ -4608,8 +4608,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4608
4608
|
}
|
|
4609
4609
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4610
4610
|
});
|
|
4611
|
-
const rerouted =
|
|
4612
|
-
return
|
|
4611
|
+
const rerouted = chunkZ2ZC5QTJ_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4612
|
+
return chunkZ2ZC5QTJ_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4613
4613
|
};
|
|
4614
4614
|
if (editTemplateMode) {
|
|
4615
4615
|
const slideId = activeSlide?.id;
|
|
@@ -4762,9 +4762,9 @@ function useCanvasInteractions(input) {
|
|
|
4762
4762
|
return;
|
|
4763
4763
|
}
|
|
4764
4764
|
const el = elementLookup.get(editId);
|
|
4765
|
-
if (el &&
|
|
4765
|
+
if (el && chunkZ2ZC5QTJ_js.hasTextProperties(el)) {
|
|
4766
4766
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4767
|
-
const newSegments =
|
|
4767
|
+
const newSegments = chunkZ2ZC5QTJ_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4768
4768
|
ops.updateElementById(editId, {
|
|
4769
4769
|
text: committedText,
|
|
4770
4770
|
textSegments: newSegments
|
|
@@ -4775,7 +4775,7 @@ function useCanvasInteractions(input) {
|
|
|
4775
4775
|
setInlineEditingText("");
|
|
4776
4776
|
};
|
|
4777
4777
|
const openEquationEditorForElement = (el) => {
|
|
4778
|
-
if (!
|
|
4778
|
+
if (!chunkZ2ZC5QTJ_js.hasTextProperties(el)) {
|
|
4779
4779
|
return false;
|
|
4780
4780
|
}
|
|
4781
4781
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4804,7 +4804,7 @@ function useCanvasInteractions(input) {
|
|
|
4804
4804
|
justSelectedRef.current = false;
|
|
4805
4805
|
} else {
|
|
4806
4806
|
const el = elementLookup.get(elementId);
|
|
4807
|
-
if (el &&
|
|
4807
|
+
if (el && chunkZ2ZC5QTJ_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
4808
4808
|
if (!openEquationEditorForElement(el)) {
|
|
4809
4809
|
setInlineEditingElementId(elementId);
|
|
4810
4810
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4823,7 +4823,7 @@ function useCanvasInteractions(input) {
|
|
|
4823
4823
|
if (openEquationEditorForElement(el)) {
|
|
4824
4824
|
return;
|
|
4825
4825
|
}
|
|
4826
|
-
if (
|
|
4826
|
+
if (chunkZ2ZC5QTJ_js.hasTextProperties(el)) {
|
|
4827
4827
|
setInlineEditingElementId(elementId);
|
|
4828
4828
|
setInlineEditingText(el.text ?? "");
|
|
4829
4829
|
}
|
|
@@ -5013,7 +5013,7 @@ function createFileHandlers(deps) {
|
|
|
5013
5013
|
h = Math.round(h * scale);
|
|
5014
5014
|
}
|
|
5015
5015
|
addElement({
|
|
5016
|
-
id:
|
|
5016
|
+
id: chunkZ2ZC5QTJ_js.generateElementId(),
|
|
5017
5017
|
type: "image",
|
|
5018
5018
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5019
5019
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5024,7 +5024,7 @@ function createFileHandlers(deps) {
|
|
|
5024
5024
|
};
|
|
5025
5025
|
img.onerror = () => {
|
|
5026
5026
|
addElement({
|
|
5027
|
-
id:
|
|
5027
|
+
id: chunkZ2ZC5QTJ_js.generateElementId(),
|
|
5028
5028
|
type: "image",
|
|
5029
5029
|
x: 100,
|
|
5030
5030
|
y: 100,
|
|
@@ -5050,7 +5050,7 @@ function createFileHandlers(deps) {
|
|
|
5050
5050
|
const elFilePath = file.path;
|
|
5051
5051
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5052
5052
|
addElement({
|
|
5053
|
-
id:
|
|
5053
|
+
id: chunkZ2ZC5QTJ_js.generateElementId(),
|
|
5054
5054
|
type: "media",
|
|
5055
5055
|
mediaType,
|
|
5056
5056
|
mediaMimeType: file.type || void 0,
|
|
@@ -5225,13 +5225,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5225
5225
|
return;
|
|
5226
5226
|
}
|
|
5227
5227
|
addElement({
|
|
5228
|
-
id:
|
|
5228
|
+
id: chunkZ2ZC5QTJ_js.generateElementId(),
|
|
5229
5229
|
type: "smartArt",
|
|
5230
5230
|
x: 100,
|
|
5231
5231
|
y: 120,
|
|
5232
5232
|
width: 600,
|
|
5233
5233
|
height: 340,
|
|
5234
|
-
smartArtData:
|
|
5234
|
+
smartArtData: chunkZ2ZC5QTJ_js.buildSmartArtPresetData(
|
|
5235
5235
|
layout,
|
|
5236
5236
|
defaultItems,
|
|
5237
5237
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5243,7 +5243,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5243
5243
|
return;
|
|
5244
5244
|
}
|
|
5245
5245
|
addElement({
|
|
5246
|
-
id:
|
|
5246
|
+
id: chunkZ2ZC5QTJ_js.generateElementId(),
|
|
5247
5247
|
type: "shape",
|
|
5248
5248
|
x: 120,
|
|
5249
5249
|
y: 200,
|
|
@@ -5302,7 +5302,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5302
5302
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5303
5303
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5304
5304
|
addElement({
|
|
5305
|
-
id:
|
|
5305
|
+
id: chunkZ2ZC5QTJ_js.generateElementId(),
|
|
5306
5306
|
type: "shape",
|
|
5307
5307
|
x: 120,
|
|
5308
5308
|
y: 200,
|
|
@@ -5324,11 +5324,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5324
5324
|
if (!activeSlide) {
|
|
5325
5325
|
return;
|
|
5326
5326
|
}
|
|
5327
|
-
const preset =
|
|
5327
|
+
const preset = chunkZ2ZC5QTJ_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5328
5328
|
if (!preset) {
|
|
5329
5329
|
return;
|
|
5330
5330
|
}
|
|
5331
|
-
const defaultPptxAction =
|
|
5331
|
+
const defaultPptxAction = chunkZ2ZC5QTJ_js.elementActionToPptxAction({
|
|
5332
5332
|
trigger: "click",
|
|
5333
5333
|
type: preset.defaultAction
|
|
5334
5334
|
});
|
|
@@ -5337,7 +5337,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5337
5337
|
defaultPptxAction.highlightClick = true;
|
|
5338
5338
|
}
|
|
5339
5339
|
addElement({
|
|
5340
|
-
id:
|
|
5340
|
+
id: chunkZ2ZC5QTJ_js.generateElementId(),
|
|
5341
5341
|
type: "shape",
|
|
5342
5342
|
x: 150,
|
|
5343
5343
|
y: 150,
|
|
@@ -5404,14 +5404,14 @@ function useInsertElements(input) {
|
|
|
5404
5404
|
return;
|
|
5405
5405
|
}
|
|
5406
5406
|
addElement({
|
|
5407
|
-
id:
|
|
5407
|
+
id: chunkZ2ZC5QTJ_js.generateElementId(),
|
|
5408
5408
|
type: "text",
|
|
5409
5409
|
x: 100,
|
|
5410
5410
|
y: 100,
|
|
5411
5411
|
width: 300,
|
|
5412
5412
|
height: 60,
|
|
5413
5413
|
text: "",
|
|
5414
|
-
textStyle: { fontSize:
|
|
5414
|
+
textStyle: { fontSize: chunkNZYSI3BL_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5415
5415
|
});
|
|
5416
5416
|
};
|
|
5417
5417
|
const handleAddShape = () => {
|
|
@@ -5419,7 +5419,7 @@ function useInsertElements(input) {
|
|
|
5419
5419
|
return;
|
|
5420
5420
|
}
|
|
5421
5421
|
addElement({
|
|
5422
|
-
id:
|
|
5422
|
+
id: chunkZ2ZC5QTJ_js.generateElementId(),
|
|
5423
5423
|
type: "shape",
|
|
5424
5424
|
x: 150,
|
|
5425
5425
|
y: 150,
|
|
@@ -5438,15 +5438,15 @@ function useInsertElements(input) {
|
|
|
5438
5438
|
return;
|
|
5439
5439
|
}
|
|
5440
5440
|
addElement({
|
|
5441
|
-
...
|
|
5442
|
-
id:
|
|
5441
|
+
...chunkZ2ZC5QTJ_js.newTableElement(chunkNZYSI3BL_js.DEFAULT_TABLE_ROWS, chunkNZYSI3BL_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5442
|
+
id: chunkZ2ZC5QTJ_js.generateElementId()
|
|
5443
5443
|
});
|
|
5444
5444
|
};
|
|
5445
5445
|
const handleAddChart = (chartType) => {
|
|
5446
5446
|
if (!activeSlide) {
|
|
5447
5447
|
return;
|
|
5448
5448
|
}
|
|
5449
|
-
addElement(
|
|
5449
|
+
addElement(chunkZ2ZC5QTJ_js.createDefaultChartElement(chartType));
|
|
5450
5450
|
};
|
|
5451
5451
|
const structured = createStructuredElementHandlers({
|
|
5452
5452
|
activeSlide,
|
|
@@ -5516,7 +5516,7 @@ function useClipboardHandlers(input) {
|
|
|
5516
5516
|
if (!selectedElement) {
|
|
5517
5517
|
return;
|
|
5518
5518
|
}
|
|
5519
|
-
setClipboardPayload(
|
|
5519
|
+
setClipboardPayload(chunkZ2ZC5QTJ_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5520
5520
|
};
|
|
5521
5521
|
const handleDelete = () => {
|
|
5522
5522
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5533,7 +5533,7 @@ function useClipboardHandlers(input) {
|
|
|
5533
5533
|
handleDelete();
|
|
5534
5534
|
};
|
|
5535
5535
|
const insertClone = (source) => {
|
|
5536
|
-
const clone =
|
|
5536
|
+
const clone = chunkZ2ZC5QTJ_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5537
5537
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5538
5538
|
ops.applySelection(clone.id);
|
|
5539
5539
|
history.markDirty();
|
|
@@ -5568,7 +5568,7 @@ function resolveShapePath(el) {
|
|
|
5568
5568
|
return el.pathData;
|
|
5569
5569
|
}
|
|
5570
5570
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5571
|
-
const clipPath =
|
|
5571
|
+
const clipPath = chunkZ2ZC5QTJ_js.getPresetShapeClipPath(el.shapeType);
|
|
5572
5572
|
if (clipPath) {
|
|
5573
5573
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5574
5574
|
if (svgPath) {
|
|
@@ -5619,7 +5619,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5619
5619
|
return parts.join(" ");
|
|
5620
5620
|
}
|
|
5621
5621
|
function transformPathToGlobal(pathData, el) {
|
|
5622
|
-
const polys =
|
|
5622
|
+
const polys = chunkZ2ZC5QTJ_js.svgPathToPolygons(pathData);
|
|
5623
5623
|
if (polys.length === 0) {
|
|
5624
5624
|
return pathData;
|
|
5625
5625
|
}
|
|
@@ -5639,10 +5639,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5639
5639
|
y: pt.y * scaleY + el.y
|
|
5640
5640
|
}))
|
|
5641
5641
|
);
|
|
5642
|
-
return
|
|
5642
|
+
return chunkZ2ZC5QTJ_js.polygonsToSvgPath(transformed);
|
|
5643
5643
|
}
|
|
5644
5644
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5645
|
-
const polys =
|
|
5645
|
+
const polys = chunkZ2ZC5QTJ_js.svgPathToPolygons(pathData);
|
|
5646
5646
|
if (polys.length === 0) {
|
|
5647
5647
|
return pathData;
|
|
5648
5648
|
}
|
|
@@ -5652,10 +5652,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5652
5652
|
y: pt.y - y
|
|
5653
5653
|
}))
|
|
5654
5654
|
);
|
|
5655
|
-
return
|
|
5655
|
+
return chunkZ2ZC5QTJ_js.polygonsToSvgPath(transformed);
|
|
5656
5656
|
}
|
|
5657
5657
|
function pathBounds(pathData) {
|
|
5658
|
-
const polys =
|
|
5658
|
+
const polys = chunkZ2ZC5QTJ_js.svgPathToPolygons(pathData);
|
|
5659
5659
|
let minX = Infinity;
|
|
5660
5660
|
let minY = Infinity;
|
|
5661
5661
|
let maxX = -Infinity;
|
|
@@ -5714,7 +5714,7 @@ function useMergeShapesHandler(input) {
|
|
|
5714
5714
|
let allFragments = [];
|
|
5715
5715
|
let remaining = globalPaths[0];
|
|
5716
5716
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5717
|
-
const frags =
|
|
5717
|
+
const frags = chunkZ2ZC5QTJ_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5718
5718
|
if (Array.isArray(frags)) {
|
|
5719
5719
|
allFragments = frags;
|
|
5720
5720
|
}
|
|
@@ -5743,7 +5743,7 @@ function useMergeShapesHandler(input) {
|
|
|
5743
5743
|
bounds.height
|
|
5744
5744
|
);
|
|
5745
5745
|
const newEl = {
|
|
5746
|
-
id:
|
|
5746
|
+
id: chunkZ2ZC5QTJ_js.generateElementId(),
|
|
5747
5747
|
type: "shape",
|
|
5748
5748
|
x: bounds.x,
|
|
5749
5749
|
y: bounds.y,
|
|
@@ -5781,7 +5781,7 @@ function useMergeShapesHandler(input) {
|
|
|
5781
5781
|
} else {
|
|
5782
5782
|
let resultPath = globalPaths[0];
|
|
5783
5783
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5784
|
-
const result =
|
|
5784
|
+
const result = chunkZ2ZC5QTJ_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5785
5785
|
if (typeof result === "string") {
|
|
5786
5786
|
resultPath = result;
|
|
5787
5787
|
}
|
|
@@ -5802,7 +5802,7 @@ function useMergeShapesHandler(input) {
|
|
|
5802
5802
|
);
|
|
5803
5803
|
const primary = targets[0];
|
|
5804
5804
|
const newEl = {
|
|
5805
|
-
id:
|
|
5805
|
+
id: chunkZ2ZC5QTJ_js.generateElementId(),
|
|
5806
5806
|
type: "shape",
|
|
5807
5807
|
x: bounds.x,
|
|
5808
5808
|
y: bounds.y,
|
|
@@ -5865,7 +5865,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5865
5865
|
if (ids.length < 2 || !activeSlide) {
|
|
5866
5866
|
return;
|
|
5867
5867
|
}
|
|
5868
|
-
const { elements, groupId } =
|
|
5868
|
+
const { elements, groupId } = chunkZ2ZC5QTJ_js.groupElements(ops.activeElements, ids, chunkZ2ZC5QTJ_js.generateElementId());
|
|
5869
5869
|
if (groupId === null) {
|
|
5870
5870
|
return;
|
|
5871
5871
|
}
|
|
@@ -5878,12 +5878,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5878
5878
|
return;
|
|
5879
5879
|
}
|
|
5880
5880
|
const group = selectedElement;
|
|
5881
|
-
const intoTemplate =
|
|
5881
|
+
const intoTemplate = chunkZ2ZC5QTJ_js.isTemplateElementId(group.id);
|
|
5882
5882
|
const ungrouped = group.children.map((child) => ({
|
|
5883
5883
|
...structuredClone(child),
|
|
5884
5884
|
// Keep child ids in the same store as the group so later edits route
|
|
5885
5885
|
// correctly: template groups yield template-prefixed child ids.
|
|
5886
|
-
id: intoTemplate ?
|
|
5886
|
+
id: intoTemplate ? chunkZ2ZC5QTJ_js.makeCloneId(true, child.id || group.id) : child.id || chunkZ2ZC5QTJ_js.generateElementId(),
|
|
5887
5887
|
x: child.x + group.x,
|
|
5888
5888
|
y: child.y + group.y
|
|
5889
5889
|
}));
|
|
@@ -5907,7 +5907,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5907
5907
|
if (!edge) {
|
|
5908
5908
|
return;
|
|
5909
5909
|
}
|
|
5910
|
-
const positions =
|
|
5910
|
+
const positions = chunkZ2ZC5QTJ_js.alignElements(selectedElements, edge);
|
|
5911
5911
|
for (const [id, pos] of positions) {
|
|
5912
5912
|
const el = elementLookup.get(id);
|
|
5913
5913
|
if (!el) {
|
|
@@ -5925,7 +5925,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5925
5925
|
if (!distAxis) {
|
|
5926
5926
|
return;
|
|
5927
5927
|
}
|
|
5928
|
-
const positions =
|
|
5928
|
+
const positions = chunkZ2ZC5QTJ_js.distributeElements(selectedElements, distAxis);
|
|
5929
5929
|
for (const [id, pos] of positions) {
|
|
5930
5930
|
const el = elementLookup.get(id);
|
|
5931
5931
|
if (!el) {
|
|
@@ -5942,7 +5942,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5942
5942
|
}
|
|
5943
5943
|
const id = selectedElement.id;
|
|
5944
5944
|
ops.updateActiveElements(
|
|
5945
|
-
(els) => direction === "forward" ?
|
|
5945
|
+
(els) => direction === "forward" ? chunkZ2ZC5QTJ_js.bringForward(els, id) : direction === "backward" ? chunkZ2ZC5QTJ_js.sendBackward(els, id) : els
|
|
5946
5946
|
);
|
|
5947
5947
|
history.markDirty();
|
|
5948
5948
|
};
|
|
@@ -5952,7 +5952,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5952
5952
|
}
|
|
5953
5953
|
const id = selectedElement.id;
|
|
5954
5954
|
ops.updateActiveElements(
|
|
5955
|
-
(els) => direction === "front" ?
|
|
5955
|
+
(els) => direction === "front" ? chunkZ2ZC5QTJ_js.bringToFront(els, id) : chunkZ2ZC5QTJ_js.sendToBack(els, id)
|
|
5956
5956
|
);
|
|
5957
5957
|
history.markDirty();
|
|
5958
5958
|
};
|
|
@@ -6074,7 +6074,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
6074
6074
|
function useSlideManagement(input) {
|
|
6075
6075
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
6076
6076
|
const handleAddSlide = () => {
|
|
6077
|
-
const newSlide =
|
|
6077
|
+
const newSlide = chunkZ2ZC5QTJ_js.createBlankSlide(slides.length + 1);
|
|
6078
6078
|
ops.updateSlides((prev) => {
|
|
6079
6079
|
const next = [...prev];
|
|
6080
6080
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6137,7 +6137,7 @@ function useSlideManagement(input) {
|
|
|
6137
6137
|
}
|
|
6138
6138
|
const clone = {
|
|
6139
6139
|
...src,
|
|
6140
|
-
id:
|
|
6140
|
+
id: chunkZ2ZC5QTJ_js.makeSlideId(),
|
|
6141
6141
|
elements: src.elements.map((el) => ({
|
|
6142
6142
|
...el,
|
|
6143
6143
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6169,7 +6169,7 @@ function useSlideManagement(input) {
|
|
|
6169
6169
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6170
6170
|
const insertAt = activeSlideIndex + 1;
|
|
6171
6171
|
const draft = {
|
|
6172
|
-
...
|
|
6172
|
+
...chunkZ2ZC5QTJ_js.createBlankSlide(slides.length + 1),
|
|
6173
6173
|
layoutPath,
|
|
6174
6174
|
...layoutName ? { layoutName } : {}
|
|
6175
6175
|
};
|
|
@@ -6230,7 +6230,7 @@ function createTableMergeHandlers(input) {
|
|
|
6230
6230
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6231
6231
|
return;
|
|
6232
6232
|
}
|
|
6233
|
-
const newTableData =
|
|
6233
|
+
const newTableData = chunkZ2ZC5QTJ_js.mergeCells(
|
|
6234
6234
|
[
|
|
6235
6235
|
{ row: rowIndex, col: columnIndex },
|
|
6236
6236
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6238,7 +6238,7 @@ function createTableMergeHandlers(input) {
|
|
|
6238
6238
|
td
|
|
6239
6239
|
);
|
|
6240
6240
|
const updates = { tableData: newTableData };
|
|
6241
|
-
const newRawXml =
|
|
6241
|
+
const newRawXml = chunkZ2ZC5QTJ_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6242
6242
|
if (newRawXml) {
|
|
6243
6243
|
updates.rawXml = newRawXml;
|
|
6244
6244
|
}
|
|
@@ -6264,7 +6264,7 @@ function createTableMergeHandlers(input) {
|
|
|
6264
6264
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6265
6265
|
return;
|
|
6266
6266
|
}
|
|
6267
|
-
const newTableData =
|
|
6267
|
+
const newTableData = chunkZ2ZC5QTJ_js.mergeCells(
|
|
6268
6268
|
[
|
|
6269
6269
|
{ row: rowIndex, col: columnIndex },
|
|
6270
6270
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6272,7 +6272,7 @@ function createTableMergeHandlers(input) {
|
|
|
6272
6272
|
td
|
|
6273
6273
|
);
|
|
6274
6274
|
const updates = { tableData: newTableData };
|
|
6275
|
-
const newRawXml =
|
|
6275
|
+
const newRawXml = chunkZ2ZC5QTJ_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6276
6276
|
if (newRawXml) {
|
|
6277
6277
|
updates.rawXml = newRawXml;
|
|
6278
6278
|
}
|
|
@@ -6287,9 +6287,9 @@ function createTableMergeHandlers(input) {
|
|
|
6287
6287
|
return;
|
|
6288
6288
|
}
|
|
6289
6289
|
const td = selectedElement.tableData;
|
|
6290
|
-
const newTableData =
|
|
6290
|
+
const newTableData = chunkZ2ZC5QTJ_js.mergeCells(ts.selectedCells, td);
|
|
6291
6291
|
const updates = { tableData: newTableData };
|
|
6292
|
-
const newRawXml =
|
|
6292
|
+
const newRawXml = chunkZ2ZC5QTJ_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6293
6293
|
if (newRawXml) {
|
|
6294
6294
|
updates.rawXml = newRawXml;
|
|
6295
6295
|
}
|
|
@@ -6306,9 +6306,9 @@ function createTableMergeHandlers(input) {
|
|
|
6306
6306
|
}
|
|
6307
6307
|
const { rowIndex, columnIndex } = ts;
|
|
6308
6308
|
const td = selectedElement.tableData;
|
|
6309
|
-
const newTableData =
|
|
6309
|
+
const newTableData = chunkZ2ZC5QTJ_js.splitCell(rowIndex, columnIndex, td);
|
|
6310
6310
|
const updates = { tableData: newTableData };
|
|
6311
|
-
const newRawXml =
|
|
6311
|
+
const newRawXml = chunkZ2ZC5QTJ_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6312
6312
|
if (newRawXml) {
|
|
6313
6313
|
updates.rawXml = newRawXml;
|
|
6314
6314
|
}
|
|
@@ -6352,7 +6352,7 @@ function createTableStructHandlers(input) {
|
|
|
6352
6352
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
6353
6353
|
}
|
|
6354
6354
|
if (el.rawXml) {
|
|
6355
|
-
const newRawXml =
|
|
6355
|
+
const newRawXml = chunkZ2ZC5QTJ_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6356
6356
|
if (newRawXml) {
|
|
6357
6357
|
updates.rawXml = newRawXml;
|
|
6358
6358
|
}
|
|
@@ -6376,7 +6376,7 @@ function createTableStructHandlers(input) {
|
|
|
6376
6376
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6377
6377
|
const updates = {};
|
|
6378
6378
|
if (selectedElement.rawXml) {
|
|
6379
|
-
const newRawXml =
|
|
6379
|
+
const newRawXml = chunkZ2ZC5QTJ_js.updateCellTextStyleInRawXml(
|
|
6380
6380
|
selectedElement,
|
|
6381
6381
|
rowIndex,
|
|
6382
6382
|
colIndex,
|
|
@@ -6440,9 +6440,9 @@ function createTableStructHandlers(input) {
|
|
|
6440
6440
|
return;
|
|
6441
6441
|
}
|
|
6442
6442
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6443
|
-
const newTableData =
|
|
6443
|
+
const newTableData = chunkZ2ZC5QTJ_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6444
6444
|
const updates = { tableData: newTableData };
|
|
6445
|
-
const newRawXml =
|
|
6445
|
+
const newRawXml = chunkZ2ZC5QTJ_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6446
6446
|
if (newRawXml) {
|
|
6447
6447
|
updates.rawXml = newRawXml;
|
|
6448
6448
|
}
|
|
@@ -6455,12 +6455,12 @@ function createTableStructHandlers(input) {
|
|
|
6455
6455
|
}
|
|
6456
6456
|
const td = selectedElement.tableData;
|
|
6457
6457
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6458
|
-
const newTableData =
|
|
6458
|
+
const newTableData = chunkZ2ZC5QTJ_js.deleteTableRow(td, rowIdx);
|
|
6459
6459
|
if (newTableData === td) {
|
|
6460
6460
|
return;
|
|
6461
6461
|
}
|
|
6462
6462
|
const updates = { tableData: newTableData };
|
|
6463
|
-
const newRawXml =
|
|
6463
|
+
const newRawXml = chunkZ2ZC5QTJ_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6464
6464
|
if (newRawXml) {
|
|
6465
6465
|
updates.rawXml = newRawXml;
|
|
6466
6466
|
}
|
|
@@ -6472,9 +6472,9 @@ function createTableStructHandlers(input) {
|
|
|
6472
6472
|
return;
|
|
6473
6473
|
}
|
|
6474
6474
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6475
|
-
const newTableData =
|
|
6475
|
+
const newTableData = chunkZ2ZC5QTJ_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6476
6476
|
const updates = { tableData: newTableData };
|
|
6477
|
-
const newRawXml =
|
|
6477
|
+
const newRawXml = chunkZ2ZC5QTJ_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6478
6478
|
if (newRawXml) {
|
|
6479
6479
|
updates.rawXml = newRawXml;
|
|
6480
6480
|
}
|
|
@@ -6487,12 +6487,12 @@ function createTableStructHandlers(input) {
|
|
|
6487
6487
|
}
|
|
6488
6488
|
const td = selectedElement.tableData;
|
|
6489
6489
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6490
|
-
const newTableData =
|
|
6490
|
+
const newTableData = chunkZ2ZC5QTJ_js.deleteTableColumn(td, colIdx);
|
|
6491
6491
|
if (newTableData === td) {
|
|
6492
6492
|
return;
|
|
6493
6493
|
}
|
|
6494
6494
|
const updates = { tableData: newTableData };
|
|
6495
|
-
const newRawXml =
|
|
6495
|
+
const newRawXml = chunkZ2ZC5QTJ_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6496
6496
|
if (newRawXml) {
|
|
6497
6497
|
updates.rawXml = newRawXml;
|
|
6498
6498
|
}
|
|
@@ -6528,8 +6528,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6528
6528
|
return html2canvasPro(element, {
|
|
6529
6529
|
...options,
|
|
6530
6530
|
onclone: async (doc, clonedEl) => {
|
|
6531
|
-
await
|
|
6532
|
-
|
|
6531
|
+
await chunkZ2ZC5QTJ_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6532
|
+
chunkZ2ZC5QTJ_js.preprocessCssForCapture(clonedEl);
|
|
6533
6533
|
if (typeof userOnClone === "function") {
|
|
6534
6534
|
userOnClone(doc, clonedEl);
|
|
6535
6535
|
}
|
|
@@ -6585,7 +6585,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6585
6585
|
}
|
|
6586
6586
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6587
6587
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6588
|
-
|
|
6588
|
+
chunkZ2ZC5QTJ_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6589
6589
|
}
|
|
6590
6590
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6591
6591
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6607,15 +6607,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6607
6607
|
continue;
|
|
6608
6608
|
}
|
|
6609
6609
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6610
|
-
images.push(
|
|
6610
|
+
images.push(chunkZ2ZC5QTJ_js.canvasToJpegData(canvas));
|
|
6611
6611
|
}
|
|
6612
6612
|
onProgress?.(totalSlides, totalSlides);
|
|
6613
6613
|
setActiveSlide(currentSlideIndex);
|
|
6614
6614
|
if (images.length === 0) {
|
|
6615
6615
|
throw new Error(chunk25VSL2BB_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6616
6616
|
}
|
|
6617
|
-
const pdfBlobUrl =
|
|
6618
|
-
|
|
6617
|
+
const pdfBlobUrl = chunkNZYSI3BL_js.buildPdfFromImageData(images);
|
|
6618
|
+
chunkZ2ZC5QTJ_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6619
6619
|
}
|
|
6620
6620
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6621
6621
|
const { scale = 2, onProgress } = options;
|
|
@@ -6663,8 +6663,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6663
6663
|
if (pages.length === 0) {
|
|
6664
6664
|
throw new Error(chunk25VSL2BB_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6665
6665
|
}
|
|
6666
|
-
const pdfDataUrl =
|
|
6667
|
-
|
|
6666
|
+
const pdfDataUrl = chunkNZYSI3BL_js.buildNotesPdf(pages);
|
|
6667
|
+
chunkZ2ZC5QTJ_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6668
6668
|
}
|
|
6669
6669
|
|
|
6670
6670
|
// src/viewer/utils/export-video.ts
|
|
@@ -6708,7 +6708,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6708
6708
|
const fps = 30;
|
|
6709
6709
|
const stream = recordingCanvas.captureStream(fps);
|
|
6710
6710
|
const recorder = new MediaRecorder(stream, {
|
|
6711
|
-
mimeType:
|
|
6711
|
+
mimeType: chunkZ2ZC5QTJ_js.pickSupportedMimeType([...chunkZ2ZC5QTJ_js.WEBM_MIME_CANDIDATES]),
|
|
6712
6712
|
videoBitsPerSecond: 5e6
|
|
6713
6713
|
});
|
|
6714
6714
|
const chunks = [];
|
|
@@ -6731,8 +6731,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6731
6731
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6732
6732
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6733
6733
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6734
|
-
const frameInterval =
|
|
6735
|
-
const framesNeeded =
|
|
6734
|
+
const frameInterval = chunkZ2ZC5QTJ_js.fpsToFrameIntervalMs(fps);
|
|
6735
|
+
const framesNeeded = chunkZ2ZC5QTJ_js.segmentFrameCount(duration, fps);
|
|
6736
6736
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6737
6737
|
if (signal?.aborted) {
|
|
6738
6738
|
recorder.stop();
|
|
@@ -6781,7 +6781,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6781
6781
|
if (frames.length === 0) {
|
|
6782
6782
|
throw new Error(chunk25VSL2BB_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6783
6783
|
}
|
|
6784
|
-
const gifBytes =
|
|
6784
|
+
const gifBytes = chunkZ2ZC5QTJ_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6785
6785
|
onProgress?.(totalSlides, totalSlides);
|
|
6786
6786
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6787
6787
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6835,7 +6835,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6835
6835
|
continue;
|
|
6836
6836
|
}
|
|
6837
6837
|
onProgress?.(processedCount, data.slides.length);
|
|
6838
|
-
let svg =
|
|
6838
|
+
let svg = chunkZ2ZC5QTJ_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6839
6839
|
if (embedFonts && fontFaces?.length) {
|
|
6840
6840
|
svg = injectFontFaces(svg, fontFaces);
|
|
6841
6841
|
}
|
|
@@ -6895,7 +6895,7 @@ function useExportSaveAs(input) {
|
|
|
6895
6895
|
}
|
|
6896
6896
|
setExportProgress(70);
|
|
6897
6897
|
setExportStatusMessage("Writing README...");
|
|
6898
|
-
const readme =
|
|
6898
|
+
const readme = chunkZ2ZC5QTJ_js.generatePackageReadme(pptxFilename);
|
|
6899
6899
|
pkgFolder.file("README.txt", readme);
|
|
6900
6900
|
if (abortCtrl.signal.aborted) {
|
|
6901
6901
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -6906,7 +6906,7 @@ function useExportSaveAs(input) {
|
|
|
6906
6906
|
setExportProgress(95);
|
|
6907
6907
|
setExportStatusMessage("Downloading...");
|
|
6908
6908
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
6909
|
-
|
|
6909
|
+
chunkZ2ZC5QTJ_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
6910
6910
|
setExportProgress(100);
|
|
6911
6911
|
} catch (err) {
|
|
6912
6912
|
if (err.name !== "AbortError") {
|
|
@@ -6929,7 +6929,7 @@ function useExportSaveAs(input) {
|
|
|
6929
6929
|
const blob = new Blob([data], {
|
|
6930
6930
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6931
6931
|
});
|
|
6932
|
-
|
|
6932
|
+
chunkZ2ZC5QTJ_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
6933
6933
|
} catch (err) {
|
|
6934
6934
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
6935
6935
|
}
|
|
@@ -6942,14 +6942,14 @@ function useExportSaveAs(input) {
|
|
|
6942
6942
|
const pptxGuides = guides.map((g) => ({
|
|
6943
6943
|
id: g.id,
|
|
6944
6944
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
6945
|
-
positionEmu:
|
|
6945
|
+
positionEmu: chunkZ2ZC5QTJ_js.guidePxToEmu(g.position)
|
|
6946
6946
|
}));
|
|
6947
6947
|
return {
|
|
6948
6948
|
...slide,
|
|
6949
6949
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
6950
6950
|
};
|
|
6951
6951
|
});
|
|
6952
|
-
const slidesToSave =
|
|
6952
|
+
const slidesToSave = chunkNZYSI3BL_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
6953
6953
|
const saveOptions = {
|
|
6954
6954
|
headerFooter,
|
|
6955
6955
|
presentationProperties,
|
|
@@ -7006,7 +7006,7 @@ function safeConfirm(message) {
|
|
|
7006
7006
|
}
|
|
7007
7007
|
}
|
|
7008
7008
|
function downloadBlob2(blob, filename) {
|
|
7009
|
-
|
|
7009
|
+
chunkZ2ZC5QTJ_js.downloadBlob(blob, chunkZ2ZC5QTJ_js.sanitizeDownloadFilename(filename));
|
|
7010
7010
|
}
|
|
7011
7011
|
|
|
7012
7012
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7107,21 +7107,21 @@ function useExportHandlers(input) {
|
|
|
7107
7107
|
{
|
|
7108
7108
|
scale: 2,
|
|
7109
7109
|
onProgress: (current, total) => {
|
|
7110
|
-
setExportProgress(
|
|
7111
|
-
setExportStatusMessage(
|
|
7110
|
+
setExportProgress(chunkZ2ZC5QTJ_js.slideProgressPercent(current, total));
|
|
7111
|
+
setExportStatusMessage(chunkZ2ZC5QTJ_js.slideStatusLabel("Rendering", current, total));
|
|
7112
7112
|
},
|
|
7113
7113
|
signal: abortCtrl.signal
|
|
7114
7114
|
}
|
|
7115
7115
|
);
|
|
7116
|
-
setExportProgress(
|
|
7116
|
+
setExportProgress(chunkZ2ZC5QTJ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7117
7117
|
setExportStatusMessage("Building PDF...");
|
|
7118
7118
|
await new Promise((r) => {
|
|
7119
7119
|
setTimeout(r, 100);
|
|
7120
7120
|
});
|
|
7121
|
-
setExportProgress(
|
|
7121
|
+
setExportProgress(chunkZ2ZC5QTJ_js.EXPORT_DONE_PERCENT);
|
|
7122
7122
|
setExportStatusMessage("Done!");
|
|
7123
7123
|
} catch (err) {
|
|
7124
|
-
if (!
|
|
7124
|
+
if (!chunkZ2ZC5QTJ_js.isExportAbortError(err)) {
|
|
7125
7125
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7126
7126
|
}
|
|
7127
7127
|
} finally {
|
|
@@ -7151,21 +7151,21 @@ function useExportHandlers(input) {
|
|
|
7151
7151
|
{
|
|
7152
7152
|
scale: 2,
|
|
7153
7153
|
onProgress: (current, total) => {
|
|
7154
|
-
setExportProgress(
|
|
7155
|
-
setExportStatusMessage(
|
|
7154
|
+
setExportProgress(chunkZ2ZC5QTJ_js.slideProgressPercent(current, total));
|
|
7155
|
+
setExportStatusMessage(chunkZ2ZC5QTJ_js.slideStatusLabel("Rendering", current, total));
|
|
7156
7156
|
},
|
|
7157
7157
|
signal: abortCtrl.signal
|
|
7158
7158
|
}
|
|
7159
7159
|
);
|
|
7160
|
-
setExportProgress(
|
|
7160
|
+
setExportProgress(chunkZ2ZC5QTJ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7161
7161
|
setExportStatusMessage("Building PDF...");
|
|
7162
7162
|
await new Promise((r) => {
|
|
7163
7163
|
setTimeout(r, 100);
|
|
7164
7164
|
});
|
|
7165
|
-
setExportProgress(
|
|
7165
|
+
setExportProgress(chunkZ2ZC5QTJ_js.EXPORT_DONE_PERCENT);
|
|
7166
7166
|
setExportStatusMessage("Done!");
|
|
7167
7167
|
} catch (err) {
|
|
7168
|
-
if (!
|
|
7168
|
+
if (!chunkZ2ZC5QTJ_js.isExportAbortError(err)) {
|
|
7169
7169
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7170
7170
|
}
|
|
7171
7171
|
} finally {
|
|
@@ -7206,22 +7206,22 @@ function useExportHandlers(input) {
|
|
|
7206
7206
|
scale: 1,
|
|
7207
7207
|
slideDurationMs: 3e3,
|
|
7208
7208
|
onProgress: (current, total) => {
|
|
7209
|
-
setExportProgress(
|
|
7210
|
-
setExportStatusMessage(
|
|
7209
|
+
setExportProgress(chunkZ2ZC5QTJ_js.slideProgressPercent(current, total, 45));
|
|
7210
|
+
setExportStatusMessage(chunkZ2ZC5QTJ_js.slideStatusLabel("Capturing", current, total));
|
|
7211
7211
|
},
|
|
7212
7212
|
onRecordProgress: (current, total) => {
|
|
7213
|
-
setExportProgress(
|
|
7214
|
-
setExportStatusMessage(
|
|
7213
|
+
setExportProgress(chunkZ2ZC5QTJ_js.recordProgressPercent(current, total));
|
|
7214
|
+
setExportStatusMessage(chunkZ2ZC5QTJ_js.slideStatusLabel("Recording", current, total));
|
|
7215
7215
|
},
|
|
7216
7216
|
signal: abortCtrl.signal
|
|
7217
7217
|
}
|
|
7218
7218
|
);
|
|
7219
|
-
setExportProgress(
|
|
7219
|
+
setExportProgress(chunkZ2ZC5QTJ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7220
7220
|
setExportStatusMessage("Saving file...");
|
|
7221
7221
|
downloadBlob2(blob, "presentation.webm");
|
|
7222
|
-
setExportProgress(
|
|
7222
|
+
setExportProgress(chunkZ2ZC5QTJ_js.EXPORT_DONE_PERCENT);
|
|
7223
7223
|
} catch (err) {
|
|
7224
|
-
if (!
|
|
7224
|
+
if (!chunkZ2ZC5QTJ_js.isExportAbortError(err)) {
|
|
7225
7225
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7226
7226
|
}
|
|
7227
7227
|
} finally {
|
|
@@ -7249,18 +7249,18 @@ function useExportHandlers(input) {
|
|
|
7249
7249
|
scale: 0.5,
|
|
7250
7250
|
slideDurationMs: 2e3,
|
|
7251
7251
|
onProgress: (current, total) => {
|
|
7252
|
-
setExportProgress(
|
|
7253
|
-
setExportStatusMessage(
|
|
7252
|
+
setExportProgress(chunkZ2ZC5QTJ_js.slideProgressPercent(current, total));
|
|
7253
|
+
setExportStatusMessage(chunkZ2ZC5QTJ_js.slideStatusLabel("Encoding", current, total));
|
|
7254
7254
|
},
|
|
7255
7255
|
signal: abortCtrl.signal
|
|
7256
7256
|
}
|
|
7257
7257
|
);
|
|
7258
|
-
setExportProgress(
|
|
7258
|
+
setExportProgress(chunkZ2ZC5QTJ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7259
7259
|
setExportStatusMessage("Saving file...");
|
|
7260
7260
|
downloadBlob2(blob, "presentation.gif");
|
|
7261
|
-
setExportProgress(
|
|
7261
|
+
setExportProgress(chunkZ2ZC5QTJ_js.EXPORT_DONE_PERCENT);
|
|
7262
7262
|
} catch (err) {
|
|
7263
|
-
if (!
|
|
7263
|
+
if (!chunkZ2ZC5QTJ_js.isExportAbortError(err)) {
|
|
7264
7264
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7265
7265
|
}
|
|
7266
7266
|
} finally {
|
|
@@ -7300,7 +7300,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7300
7300
|
}
|
|
7301
7301
|
printWindow.document.open();
|
|
7302
7302
|
printWindow.document.write(
|
|
7303
|
-
|
|
7303
|
+
chunkZ2ZC5QTJ_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7304
7304
|
);
|
|
7305
7305
|
printWindow.document.close();
|
|
7306
7306
|
printWindow.focus();
|
|
@@ -7361,7 +7361,7 @@ function usePrintHandlers(input) {
|
|
|
7361
7361
|
if (svgs.length === 0) {
|
|
7362
7362
|
return;
|
|
7363
7363
|
}
|
|
7364
|
-
const printDoc =
|
|
7364
|
+
const printDoc = chunkZ2ZC5QTJ_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7365
7365
|
title: "Slides (Vector)",
|
|
7366
7366
|
orientation: settings.orientation,
|
|
7367
7367
|
colorFilter
|
|
@@ -7397,7 +7397,7 @@ function usePrintHandlers(input) {
|
|
|
7397
7397
|
if (settings.printWhat === "outline") {
|
|
7398
7398
|
openPrintWindow(
|
|
7399
7399
|
"Outline",
|
|
7400
|
-
`<div class="outline-page">${
|
|
7400
|
+
`<div class="outline-page">${chunkZ2ZC5QTJ_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7401
7401
|
settings.orientation,
|
|
7402
7402
|
colorFilter,
|
|
7403
7403
|
settings.frameSlides
|
|
@@ -7422,7 +7422,7 @@ function usePrintHandlers(input) {
|
|
|
7422
7422
|
if (settings.printWhat === "slides") {
|
|
7423
7423
|
openPrintWindow(
|
|
7424
7424
|
"Slides",
|
|
7425
|
-
|
|
7425
|
+
chunkZ2ZC5QTJ_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7426
7426
|
settings.orientation,
|
|
7427
7427
|
colorFilter,
|
|
7428
7428
|
settings.frameSlides
|
|
@@ -7432,7 +7432,7 @@ function usePrintHandlers(input) {
|
|
|
7432
7432
|
if (settings.printWhat === "notes") {
|
|
7433
7433
|
openPrintWindow(
|
|
7434
7434
|
"Notes Pages",
|
|
7435
|
-
|
|
7435
|
+
chunkZ2ZC5QTJ_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7436
7436
|
"portrait",
|
|
7437
7437
|
colorFilter,
|
|
7438
7438
|
settings.frameSlides
|
|
@@ -7443,7 +7443,7 @@ function usePrintHandlers(input) {
|
|
|
7443
7443
|
const spp = settings.slidesPerPage;
|
|
7444
7444
|
openPrintWindow(
|
|
7445
7445
|
`Handout ${spp} per page`,
|
|
7446
|
-
|
|
7446
|
+
chunkZ2ZC5QTJ_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7447
7447
|
"portrait",
|
|
7448
7448
|
colorFilter,
|
|
7449
7449
|
settings.frameSlides
|
|
@@ -7507,8 +7507,8 @@ function useThemeHandlers(input) {
|
|
|
7507
7507
|
return;
|
|
7508
7508
|
}
|
|
7509
7509
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7510
|
-
const previousMap = theme?.colorScheme ?
|
|
7511
|
-
setSlides((prev) =>
|
|
7510
|
+
const previousMap = theme?.colorScheme ? chunkZ2ZC5QTJ_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7511
|
+
setSlides((prev) => chunkZ2ZC5QTJ_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7512
7512
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7513
7513
|
bumpHistory();
|
|
7514
7514
|
history.markDirty();
|
|
@@ -7613,7 +7613,7 @@ function useThemeSwitching(input) {
|
|
|
7613
7613
|
}
|
|
7614
7614
|
try {
|
|
7615
7615
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7616
|
-
const newData =
|
|
7616
|
+
const newData = chunkZ2ZC5QTJ_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7617
7617
|
onDataChange(newData);
|
|
7618
7618
|
onThemeChanged?.(preset);
|
|
7619
7619
|
} catch (error) {
|
|
@@ -7630,7 +7630,7 @@ function useThemeSwitching(input) {
|
|
|
7630
7630
|
}
|
|
7631
7631
|
try {
|
|
7632
7632
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7633
|
-
const newData =
|
|
7633
|
+
const newData = chunkZ2ZC5QTJ_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7634
7634
|
onDataChange(newData);
|
|
7635
7635
|
} catch (error) {
|
|
7636
7636
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7642,12 +7642,12 @@ function useThemeSwitching(input) {
|
|
|
7642
7642
|
if (!data?.theme?.colorScheme) {
|
|
7643
7643
|
return void 0;
|
|
7644
7644
|
}
|
|
7645
|
-
return
|
|
7646
|
-
(p) =>
|
|
7645
|
+
return chunkZ2ZC5QTJ_js.THEME_PRESETS.find(
|
|
7646
|
+
(p) => chunkZ2ZC5QTJ_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7647
7647
|
);
|
|
7648
7648
|
}, [data?.theme?.colorScheme]);
|
|
7649
7649
|
return {
|
|
7650
|
-
presets:
|
|
7650
|
+
presets: chunkZ2ZC5QTJ_js.THEME_PRESETS,
|
|
7651
7651
|
switchToPreset,
|
|
7652
7652
|
switchToCustom,
|
|
7653
7653
|
currentPreset
|
|
@@ -7722,7 +7722,7 @@ function usePropertyHandlers(input) {
|
|
|
7722
7722
|
}
|
|
7723
7723
|
try {
|
|
7724
7724
|
const ab = await file.arrayBuffer();
|
|
7725
|
-
const h = new
|
|
7725
|
+
const h = new chunkZ2ZC5QTJ_js.PptxHandler();
|
|
7726
7726
|
const other = await h.load(ab);
|
|
7727
7727
|
if (!other) {
|
|
7728
7728
|
return;
|
|
@@ -7732,7 +7732,7 @@ function usePropertyHandlers(input) {
|
|
|
7732
7732
|
width: canvasSize.width,
|
|
7733
7733
|
height: canvasSize.height
|
|
7734
7734
|
};
|
|
7735
|
-
setCompareResult(
|
|
7735
|
+
setCompareResult(chunkZ2ZC5QTJ_js.comparePresentation(cur, other));
|
|
7736
7736
|
setIsComparePanelOpen(true);
|
|
7737
7737
|
} catch (err) {
|
|
7738
7738
|
console.warn("Compare failed:", err);
|
|
@@ -7749,7 +7749,7 @@ function usePropertyHandlers(input) {
|
|
|
7749
7749
|
if (!diff || diff.status === "unchanged") {
|
|
7750
7750
|
return;
|
|
7751
7751
|
}
|
|
7752
|
-
setSlides((prev) =>
|
|
7752
|
+
setSlides((prev) => chunkZ2ZC5QTJ_js.applyAcceptSlide(prev, diff));
|
|
7753
7753
|
setIsDirty(true);
|
|
7754
7754
|
},
|
|
7755
7755
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7760,10 +7760,10 @@ function usePropertyHandlers(input) {
|
|
|
7760
7760
|
if (!compareResult) {
|
|
7761
7761
|
return;
|
|
7762
7762
|
}
|
|
7763
|
-
setSlides((prev) =>
|
|
7763
|
+
setSlides((prev) => chunkZ2ZC5QTJ_js.applyAcceptAllSlides(prev, compareResult));
|
|
7764
7764
|
setIsDirty(true);
|
|
7765
7765
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7766
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7766
|
+
const usedFontFamilies = react.useMemo(() => chunkZ2ZC5QTJ_js.collectUsedFonts(slides), [slides]);
|
|
7767
7767
|
return {
|
|
7768
7768
|
handleUpdateNotes,
|
|
7769
7769
|
handleUpdateSlide,
|
|
@@ -7882,7 +7882,7 @@ function useIsMobile(input) {
|
|
|
7882
7882
|
const containerRef = input?.containerRef;
|
|
7883
7883
|
const isTouchDevice = react.useSyncExternalStore(
|
|
7884
7884
|
subscribeTouchCapability,
|
|
7885
|
-
|
|
7885
|
+
chunkZ2ZC5QTJ_js.detectTouchDevice,
|
|
7886
7886
|
() => false
|
|
7887
7887
|
// server snapshot
|
|
7888
7888
|
);
|
|
@@ -7898,7 +7898,7 @@ function useIsMobile(input) {
|
|
|
7898
7898
|
}
|
|
7899
7899
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
7900
7900
|
});
|
|
7901
|
-
const [orientation, setOrientation] = react.useState(
|
|
7901
|
+
const [orientation, setOrientation] = react.useState(chunkZ2ZC5QTJ_js.detectOrientation);
|
|
7902
7902
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
7903
7903
|
const [initialViewportHeight] = react.useState(
|
|
7904
7904
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -7942,7 +7942,7 @@ function useIsMobile(input) {
|
|
|
7942
7942
|
return;
|
|
7943
7943
|
}
|
|
7944
7944
|
const handleOrientationChange = () => {
|
|
7945
|
-
setOrientation(
|
|
7945
|
+
setOrientation(chunkZ2ZC5QTJ_js.detectOrientation());
|
|
7946
7946
|
};
|
|
7947
7947
|
if (screen.orientation) {
|
|
7948
7948
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -7972,9 +7972,9 @@ function useIsMobile(input) {
|
|
|
7972
7972
|
window.addEventListener("resize", handleResize);
|
|
7973
7973
|
return () => window.removeEventListener("resize", handleResize);
|
|
7974
7974
|
}, [isTouchDevice, initialViewportHeight]);
|
|
7975
|
-
const isMobile =
|
|
7976
|
-
const isTablet = !isMobile && containerWidth >=
|
|
7977
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
7975
|
+
const isMobile = chunkZ2ZC5QTJ_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
7976
|
+
const isTablet = !isMobile && containerWidth >= chunkZ2ZC5QTJ_js.MOBILE_BREAKPOINT && containerWidth < chunkZ2ZC5QTJ_js.TABLET_BREAKPOINT;
|
|
7977
|
+
const isDesktop = !isMobile && containerWidth >= chunkZ2ZC5QTJ_js.TABLET_BREAKPOINT;
|
|
7978
7978
|
return {
|
|
7979
7979
|
isMobile,
|
|
7980
7980
|
isTablet,
|
|
@@ -8035,11 +8035,11 @@ function useViewerDialogs(input) {
|
|
|
8035
8035
|
);
|
|
8036
8036
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(false);
|
|
8037
8037
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8038
|
-
() => typeof window !== "undefined" ?
|
|
8038
|
+
() => typeof window !== "undefined" ? chunkZ2ZC5QTJ_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8039
8039
|
);
|
|
8040
8040
|
react.useEffect(() => {
|
|
8041
8041
|
const handleWindow = () => setIsNarrowViewport(
|
|
8042
|
-
|
|
8042
|
+
chunkZ2ZC5QTJ_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8043
8043
|
);
|
|
8044
8044
|
let observer = null;
|
|
8045
8045
|
let raf = 0;
|
|
@@ -8053,12 +8053,12 @@ function useViewerDialogs(input) {
|
|
|
8053
8053
|
const entry = entries[0];
|
|
8054
8054
|
if (entry) {
|
|
8055
8055
|
setIsNarrowViewport(
|
|
8056
|
-
|
|
8056
|
+
chunkZ2ZC5QTJ_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8057
8057
|
);
|
|
8058
8058
|
}
|
|
8059
8059
|
});
|
|
8060
8060
|
observer.observe(el);
|
|
8061
|
-
setIsNarrowViewport(
|
|
8061
|
+
setIsNarrowViewport(chunkZ2ZC5QTJ_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8062
8062
|
};
|
|
8063
8063
|
attach();
|
|
8064
8064
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8216,12 +8216,12 @@ function useViewerDialogs(input) {
|
|
|
8216
8216
|
}
|
|
8217
8217
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8218
8218
|
if (presentationGridSpacing) {
|
|
8219
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8219
|
+
const px = Math.round(presentationGridSpacing.cx / chunkNZYSI3BL_js.EMU_PER_PX);
|
|
8220
8220
|
if (px > 0) {
|
|
8221
8221
|
return px;
|
|
8222
8222
|
}
|
|
8223
8223
|
}
|
|
8224
|
-
return
|
|
8224
|
+
return chunkNZYSI3BL_js.GRID_SIZE;
|
|
8225
8225
|
}
|
|
8226
8226
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8227
8227
|
if (activeCustomShowId) {
|
|
@@ -8235,8 +8235,8 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
|
8235
8235
|
return slides.map((_, i) => i).filter((i) => !slides[i]?.hidden);
|
|
8236
8236
|
}
|
|
8237
8237
|
function computeSlideSectionGroups(slides, sections) {
|
|
8238
|
-
return
|
|
8239
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8238
|
+
return chunkZ2ZC5QTJ_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8239
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkNZYSI3BL_js.UNGROUPED_SECTION_ID : "default"),
|
|
8240
8240
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8241
8241
|
slideIndexes: group.slideIndexes,
|
|
8242
8242
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8291,7 +8291,7 @@ function useDerivedSlideState(input) {
|
|
|
8291
8291
|
);
|
|
8292
8292
|
const slideSectionGroups = react.useMemo(
|
|
8293
8293
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8294
|
-
if (group.id ===
|
|
8294
|
+
if (group.id === chunkNZYSI3BL_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8295
8295
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8296
8296
|
}
|
|
8297
8297
|
if (group.id === "default" && group.label === "Slides") {
|
|
@@ -8394,13 +8394,13 @@ function useAnnotationHandlers(input) {
|
|
|
8394
8394
|
}, [annotations, setMode, setSlides, history]);
|
|
8395
8395
|
const handleSetMode = react.useCallback(
|
|
8396
8396
|
(nextMode) => {
|
|
8397
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8397
|
+
if (mode === "present" && nextMode !== "present" && !chunkZ2ZC5QTJ_js.mayLeaveSlideShow()) {
|
|
8398
8398
|
return;
|
|
8399
8399
|
}
|
|
8400
8400
|
if (nextMode === "present") {
|
|
8401
8401
|
presentation.enterPresentMode();
|
|
8402
8402
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8403
|
-
|
|
8403
|
+
chunkNZYSI3BL_js.stopAllPersistentAudio();
|
|
8404
8404
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8405
8405
|
if (promptKeepInkAnnotations) {
|
|
8406
8406
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8409,7 +8409,7 @@ function useAnnotationHandlers(input) {
|
|
|
8409
8409
|
}
|
|
8410
8410
|
} else {
|
|
8411
8411
|
if (mode === "present") {
|
|
8412
|
-
|
|
8412
|
+
chunkNZYSI3BL_js.stopAllPersistentAudio();
|
|
8413
8413
|
}
|
|
8414
8414
|
setMode(nextMode);
|
|
8415
8415
|
}
|
|
@@ -8475,13 +8475,13 @@ function useSerialize(input) {
|
|
|
8475
8475
|
let processedSlide = slide;
|
|
8476
8476
|
if (pendingEditId) {
|
|
8477
8477
|
const updatedElements = slide.elements.map((el) => {
|
|
8478
|
-
if (el.id !== pendingEditId || !
|
|
8478
|
+
if (el.id !== pendingEditId || !chunkZ2ZC5QTJ_js.hasTextProperties(el)) {
|
|
8479
8479
|
return el;
|
|
8480
8480
|
}
|
|
8481
8481
|
return {
|
|
8482
8482
|
...el,
|
|
8483
8483
|
text: pendingEditText,
|
|
8484
|
-
textSegments:
|
|
8484
|
+
textSegments: chunkZ2ZC5QTJ_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8485
8485
|
};
|
|
8486
8486
|
});
|
|
8487
8487
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8494,14 +8494,14 @@ function useSerialize(input) {
|
|
|
8494
8494
|
const pptxGuides = guides.map((g) => ({
|
|
8495
8495
|
id: g.id,
|
|
8496
8496
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8497
|
-
positionEmu:
|
|
8497
|
+
positionEmu: chunkZ2ZC5QTJ_js.guidePxToEmu(g.position)
|
|
8498
8498
|
}));
|
|
8499
8499
|
return {
|
|
8500
8500
|
...processedSlide,
|
|
8501
8501
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8502
8502
|
};
|
|
8503
8503
|
});
|
|
8504
|
-
const slidesToSave =
|
|
8504
|
+
const slidesToSave = chunkNZYSI3BL_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8505
8505
|
const saveOptions = {
|
|
8506
8506
|
headerFooter,
|
|
8507
8507
|
presentationProperties,
|
|
@@ -8670,7 +8670,7 @@ function usePresentationSetup(input) {
|
|
|
8670
8670
|
containerRef,
|
|
8671
8671
|
content,
|
|
8672
8672
|
onSetMode: (nextMode) => {
|
|
8673
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8673
|
+
if (mode === "present" && nextMode !== "present" && !chunkZ2ZC5QTJ_js.mayLeaveSlideShow()) {
|
|
8674
8674
|
return;
|
|
8675
8675
|
}
|
|
8676
8676
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8678,7 +8678,7 @@ function usePresentationSetup(input) {
|
|
|
8678
8678
|
setShowKeepAnnotationsDialog(true);
|
|
8679
8679
|
} else {
|
|
8680
8680
|
if (mode === "present" && nextMode !== "present") {
|
|
8681
|
-
|
|
8681
|
+
chunkNZYSI3BL_js.stopAllPersistentAudio();
|
|
8682
8682
|
stopAnimationSound();
|
|
8683
8683
|
}
|
|
8684
8684
|
setMode(nextMode);
|
|
@@ -8732,10 +8732,10 @@ function usePresentationSetup(input) {
|
|
|
8732
8732
|
onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
|
|
8733
8733
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8734
8734
|
onSaveRehearsalTimings: (timings) => {
|
|
8735
|
-
setSlides((prev) =>
|
|
8735
|
+
setSlides((prev) => chunkZ2ZC5QTJ_js.applyRehearsalTimings(prev, timings));
|
|
8736
8736
|
history.markDirty();
|
|
8737
8737
|
},
|
|
8738
|
-
loopContinuously:
|
|
8738
|
+
loopContinuously: chunkZ2ZC5QTJ_js.shouldLoopContinuously(presentationProperties),
|
|
8739
8739
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8740
8740
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8741
8741
|
endWithBlackSlide
|
|
@@ -8897,7 +8897,7 @@ function useEditorOperations(input) {
|
|
|
8897
8897
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
8898
8898
|
react.useEffect(() => {
|
|
8899
8899
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
8900
|
-
copiedFormatRef.current =
|
|
8900
|
+
copiedFormatRef.current = chunkZ2ZC5QTJ_js.copyFormatFromElement(selectedElement);
|
|
8901
8901
|
} else if (!formatPainterActive) {
|
|
8902
8902
|
copiedFormatRef.current = null;
|
|
8903
8903
|
}
|
|
@@ -8923,12 +8923,12 @@ function useEditorOperations(input) {
|
|
|
8923
8923
|
e.stopPropagation();
|
|
8924
8924
|
const element = elementLookup.get(elementId);
|
|
8925
8925
|
if (element) {
|
|
8926
|
-
const updated =
|
|
8926
|
+
const updated = chunkZ2ZC5QTJ_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
8927
8927
|
const updates = {};
|
|
8928
|
-
if (
|
|
8928
|
+
if (chunkZ2ZC5QTJ_js.hasShapeProperties(updated)) {
|
|
8929
8929
|
updates.shapeStyle = updated.shapeStyle;
|
|
8930
8930
|
}
|
|
8931
|
-
if (
|
|
8931
|
+
if (chunkZ2ZC5QTJ_js.hasTextProperties(updated)) {
|
|
8932
8932
|
updates.textStyle = updated.textStyle;
|
|
8933
8933
|
}
|
|
8934
8934
|
ops.updateElementById(elementId, updates);
|
|
@@ -9075,7 +9075,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9075
9075
|
const families = /* @__PURE__ */ new Set();
|
|
9076
9076
|
for (const slide of slides) {
|
|
9077
9077
|
for (const el of slide.elements) {
|
|
9078
|
-
if (
|
|
9078
|
+
if (chunkZ2ZC5QTJ_js.hasTextProperties(el) && el.textSegments) {
|
|
9079
9079
|
for (const seg of el.textSegments) {
|
|
9080
9080
|
if (seg.style.fontFamily) {
|
|
9081
9081
|
families.add(seg.style.fontFamily);
|
|
@@ -9644,7 +9644,7 @@ function useViewerIntegration(input) {
|
|
|
9644
9644
|
return zoom.scale;
|
|
9645
9645
|
},
|
|
9646
9646
|
setZoom(level) {
|
|
9647
|
-
zoom.setScale(Math.min(Math.max(level,
|
|
9647
|
+
zoom.setScale(Math.min(Math.max(level, chunkNZYSI3BL_js.MIN_ZOOM_SCALE), chunkNZYSI3BL_js.MAX_ZOOM_SCALE));
|
|
9648
9648
|
},
|
|
9649
9649
|
zoomIn() {
|
|
9650
9650
|
zoom.handleZoomIn();
|
|
@@ -9859,7 +9859,7 @@ function useReducedMotion() {
|
|
|
9859
9859
|
}
|
|
9860
9860
|
function useViewerOptions() {
|
|
9861
9861
|
const storeRef = react.useRef(null);
|
|
9862
|
-
storeRef.current ??=
|
|
9862
|
+
storeRef.current ??= chunkZ2ZC5QTJ_js.createViewerOptionsStore();
|
|
9863
9863
|
const store = storeRef.current;
|
|
9864
9864
|
const options = react.useSyncExternalStore(
|
|
9865
9865
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9868,9 +9868,9 @@ function useViewerOptions() {
|
|
|
9868
9868
|
);
|
|
9869
9869
|
return { optionsStore: store, options };
|
|
9870
9870
|
}
|
|
9871
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9871
|
+
var KNOWN_TAB_IDS = new Set(chunkZ2ZC5QTJ_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9872
9872
|
function computeToolbarVisibility(hiddenActions) {
|
|
9873
|
-
const isHidden = (id) =>
|
|
9873
|
+
const isHidden = (id) => chunkZ2ZC5QTJ_js.isActionHidden(id, hiddenActions);
|
|
9874
9874
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
9875
9875
|
return { isHidden, isTabVisible };
|
|
9876
9876
|
}
|
|
@@ -9955,12 +9955,12 @@ function useYjsDocumentSync({
|
|
|
9955
9955
|
return;
|
|
9956
9956
|
}
|
|
9957
9957
|
try {
|
|
9958
|
-
const handler = new
|
|
9958
|
+
const handler = new chunkZ2ZC5QTJ_js.PptxHandler();
|
|
9959
9959
|
await handler.load(sourceBytes.buffer);
|
|
9960
|
-
const currentSlides =
|
|
9960
|
+
const currentSlides = chunkZ2ZC5QTJ_js.readSlidesFromYDoc(
|
|
9961
9961
|
doc
|
|
9962
9962
|
);
|
|
9963
|
-
const slidesToSave =
|
|
9963
|
+
const slidesToSave = chunkNZYSI3BL_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
9964
9964
|
const bytes = await handler.save(slidesToSave);
|
|
9965
9965
|
config.onWriteBack(bytes);
|
|
9966
9966
|
} catch {
|
|
@@ -9975,7 +9975,7 @@ function useYjsDocumentSync({
|
|
|
9975
9975
|
if (!doc || !isConnected) {
|
|
9976
9976
|
return;
|
|
9977
9977
|
}
|
|
9978
|
-
const docSlides =
|
|
9978
|
+
const docSlides = chunkZ2ZC5QTJ_js.readSlidesFromYDoc(
|
|
9979
9979
|
doc
|
|
9980
9980
|
);
|
|
9981
9981
|
if (docSlides.length === 0) {
|
|
@@ -9997,11 +9997,11 @@ function useYjsDocumentSync({
|
|
|
9997
9997
|
lastSyncedRef.current = serialized;
|
|
9998
9998
|
void (async () => {
|
|
9999
9999
|
const factories = await getFactories();
|
|
10000
|
-
|
|
10000
|
+
chunkZ2ZC5QTJ_js.reconcileSlidesInYDoc(
|
|
10001
10001
|
slides,
|
|
10002
10002
|
doc,
|
|
10003
10003
|
factories,
|
|
10004
|
-
|
|
10004
|
+
chunkZ2ZC5QTJ_js.LOCAL_SYNC_ORIGIN
|
|
10005
10005
|
);
|
|
10006
10006
|
scheduleWriteBack();
|
|
10007
10007
|
})();
|
|
@@ -10015,10 +10015,10 @@ function useYjsDocumentSync({
|
|
|
10015
10015
|
return;
|
|
10016
10016
|
}
|
|
10017
10017
|
const handleChange = (_events, transaction) => {
|
|
10018
|
-
if (transaction?.origin ===
|
|
10018
|
+
if (transaction?.origin === chunkZ2ZC5QTJ_js.LOCAL_SYNC_ORIGIN) {
|
|
10019
10019
|
return;
|
|
10020
10020
|
}
|
|
10021
|
-
const remoteSlides =
|
|
10021
|
+
const remoteSlides = chunkZ2ZC5QTJ_js.readSlidesFromYDoc(
|
|
10022
10022
|
doc
|
|
10023
10023
|
);
|
|
10024
10024
|
if (remoteSlides.length === 0) {
|
|
@@ -10034,7 +10034,7 @@ function useYjsDocumentSync({
|
|
|
10034
10034
|
isApplyingRemoteRef.current = false;
|
|
10035
10035
|
scheduleWriteBack();
|
|
10036
10036
|
};
|
|
10037
|
-
const unobserve =
|
|
10037
|
+
const unobserve = chunkZ2ZC5QTJ_js.observeYDocSlides(
|
|
10038
10038
|
doc,
|
|
10039
10039
|
handleChange
|
|
10040
10040
|
);
|
|
@@ -10072,7 +10072,7 @@ function useBroadcastFollower({
|
|
|
10072
10072
|
if (!broadcaster) {
|
|
10073
10073
|
return;
|
|
10074
10074
|
}
|
|
10075
|
-
if (!
|
|
10075
|
+
if (!chunkZ2ZC5QTJ_js.shouldAutoFollowBroadcaster({
|
|
10076
10076
|
localRole: collab.config.role,
|
|
10077
10077
|
broadcasterRole: broadcaster.role
|
|
10078
10078
|
})) {
|
|
@@ -10232,10 +10232,10 @@ function useTouchGestures(input) {
|
|
|
10232
10232
|
if (!el || !enabled) {
|
|
10233
10233
|
return;
|
|
10234
10234
|
}
|
|
10235
|
-
const recognizer =
|
|
10235
|
+
const recognizer = chunkZ2ZC5QTJ_js.createTouchGestureRecognizer({
|
|
10236
10236
|
getScale: () => scaleRef.current,
|
|
10237
|
-
minScale:
|
|
10238
|
-
maxScale:
|
|
10237
|
+
minScale: chunkNZYSI3BL_js.MIN_ZOOM_SCALE,
|
|
10238
|
+
maxScale: chunkNZYSI3BL_js.MAX_ZOOM_SCALE,
|
|
10239
10239
|
callbacks: {
|
|
10240
10240
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10241
10241
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10275,7 +10275,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10275
10275
|
return;
|
|
10276
10276
|
}
|
|
10277
10277
|
const rect = active.getBoundingClientRect();
|
|
10278
|
-
const delta =
|
|
10278
|
+
const delta = chunkZ2ZC5QTJ_js.computeScrollDelta(
|
|
10279
10279
|
{ top: rect.top, bottom: rect.bottom },
|
|
10280
10280
|
window.innerHeight,
|
|
10281
10281
|
keyboardInset
|
|
@@ -10295,8 +10295,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10295
10295
|
return;
|
|
10296
10296
|
}
|
|
10297
10297
|
const update = () => {
|
|
10298
|
-
const metrics =
|
|
10299
|
-
const inset = metrics ?
|
|
10298
|
+
const metrics = chunkZ2ZC5QTJ_js.readViewportMetrics(window);
|
|
10299
|
+
const inset = metrics ? chunkZ2ZC5QTJ_js.computeKeyboardInset(metrics) : 0;
|
|
10300
10300
|
setKeyboardInset(inset);
|
|
10301
10301
|
if (inset > 0) {
|
|
10302
10302
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10307,8 +10307,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10307
10307
|
vv.addEventListener("scroll", update);
|
|
10308
10308
|
const onFocusIn = () => {
|
|
10309
10309
|
window.requestAnimationFrame(() => {
|
|
10310
|
-
const metrics =
|
|
10311
|
-
const inset = metrics ?
|
|
10310
|
+
const metrics = chunkZ2ZC5QTJ_js.readViewportMetrics(window);
|
|
10311
|
+
const inset = metrics ? chunkZ2ZC5QTJ_js.computeKeyboardInset(metrics) : 0;
|
|
10312
10312
|
if (inset > 0) {
|
|
10313
10313
|
scrollFocusedIntoView(inset);
|
|
10314
10314
|
}
|
|
@@ -10321,7 +10321,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10321
10321
|
document.removeEventListener("focusin", onFocusIn);
|
|
10322
10322
|
};
|
|
10323
10323
|
}, [enabled]);
|
|
10324
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10324
|
+
return { keyboardInset, isKeyboardOpen: chunkZ2ZC5QTJ_js.isKeyboardOpen(keyboardInset) };
|
|
10325
10325
|
}
|
|
10326
10326
|
|
|
10327
10327
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10376,13 +10376,13 @@ function buildCanvasProps(input) {
|
|
|
10376
10376
|
if (mode === "present") {
|
|
10377
10377
|
presentation.handlePresentationAction(action);
|
|
10378
10378
|
} else if (action.url) {
|
|
10379
|
-
|
|
10379
|
+
chunkZ2ZC5QTJ_js.safeOpenUrl(action.url);
|
|
10380
10380
|
}
|
|
10381
10381
|
};
|
|
10382
10382
|
const handleHyperlinkClick = (url) => {
|
|
10383
|
-
if (
|
|
10383
|
+
if (chunkZ2ZC5QTJ_js.isPpactionUrl(url)) {
|
|
10384
10384
|
if (mode === "present") {
|
|
10385
|
-
const parsed =
|
|
10385
|
+
const parsed = chunkZ2ZC5QTJ_js.parsePpactionUrl(url);
|
|
10386
10386
|
if (parsed) {
|
|
10387
10387
|
presentation.handlePresentationAction({
|
|
10388
10388
|
action: parsed.action,
|
|
@@ -10392,7 +10392,7 @@ function buildCanvasProps(input) {
|
|
|
10392
10392
|
}
|
|
10393
10393
|
return;
|
|
10394
10394
|
}
|
|
10395
|
-
|
|
10395
|
+
chunkZ2ZC5QTJ_js.safeOpenUrl(url);
|
|
10396
10396
|
};
|
|
10397
10397
|
return {
|
|
10398
10398
|
activeSlide: effectiveSlide,
|
|
@@ -10712,7 +10712,7 @@ function buildToolbarProps(input) {
|
|
|
10712
10712
|
onOpenFile,
|
|
10713
10713
|
onOpenRecentFile,
|
|
10714
10714
|
onCreatePresentation: (templateId) => {
|
|
10715
|
-
s.setSlides(
|
|
10715
|
+
s.setSlides(chunkZ2ZC5QTJ_js.createBackstagePresentation(templateId));
|
|
10716
10716
|
s.setActiveSlideIndex(0);
|
|
10717
10717
|
s.setSelectedElementId(null);
|
|
10718
10718
|
s.setSelectedElementIds([]);
|
|
@@ -10767,7 +10767,7 @@ function buildToolbarProps(input) {
|
|
|
10767
10767
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10768
10768
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10769
10769
|
formatPainterActive: s.formatPainterActive,
|
|
10770
|
-
canActivateFormatPainter:
|
|
10770
|
+
canActivateFormatPainter: chunkZ2ZC5QTJ_js.hasCopyableFormat(selectedElement),
|
|
10771
10771
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10772
10772
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10773
10773
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11030,7 +11030,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11030
11030
|
}, [incomingContent]);
|
|
11031
11031
|
const onOpenFile = react.useCallback(() => {
|
|
11032
11032
|
void (async () => {
|
|
11033
|
-
const picked = await
|
|
11033
|
+
const picked = await chunkZ2ZC5QTJ_js.openPptxFile();
|
|
11034
11034
|
if (picked) {
|
|
11035
11035
|
setContent(picked.buffer);
|
|
11036
11036
|
}
|
|
@@ -11038,7 +11038,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11038
11038
|
}, []);
|
|
11039
11039
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11040
11040
|
void (async () => {
|
|
11041
|
-
const bytes = await
|
|
11041
|
+
const bytes = await chunkZ2ZC5QTJ_js.readBackstageRecentFile(key);
|
|
11042
11042
|
if (bytes) {
|
|
11043
11043
|
setContent(bytes);
|
|
11044
11044
|
}
|