pptx-react-viewer 2.10.0 → 2.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/{AiChatPanel-KTMWRUD5.js → AiChatPanel-E6W3EACA.js} +23 -23
- package/dist/AiChatPanel-E6W3EACA.js.br +0 -0
- package/dist/AiChatPanel-E6W3EACA.js.gz +0 -0
- package/dist/{AiChatPanel-35CHYS5N.mjs → AiChatPanel-RMQIJDUJ.mjs} +4 -4
- package/dist/AiChatPanel-RMQIJDUJ.mjs.br +0 -0
- package/dist/AiChatPanel-RMQIJDUJ.mjs.gz +0 -0
- package/dist/{Model3DScene-TMNUKCL6.js → Model3DScene-U4B4NZJT.js} +2 -2
- package/dist/Model3DScene-U4B4NZJT.js.br +0 -0
- package/dist/Model3DScene-U4B4NZJT.js.gz +0 -0
- package/dist/{Model3DScene-2VMN3B65.mjs → Model3DScene-WHSHBMR5.mjs} +1 -1
- package/dist/Model3DScene-WHSHBMR5.mjs.br +0 -0
- package/dist/Model3DScene-WHSHBMR5.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-KPNP3QD5.js → SurfaceChart3DScene-5S43UBRD.js} +2 -2
- package/dist/SurfaceChart3DScene-5S43UBRD.js.br +0 -0
- package/dist/SurfaceChart3DScene-5S43UBRD.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-GKRDDN2U.mjs → SurfaceChart3DScene-77JP5XH5.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-GKRDDN2U.mjs.br → SurfaceChart3DScene-77JP5XH5.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-77JP5XH5.mjs.gz +0 -0
- package/dist/{chunk-FY2AFXKP.mjs → chunk-DD54KUDG.mjs} +29 -4
- package/dist/chunk-DD54KUDG.mjs.br +0 -0
- package/dist/chunk-DD54KUDG.mjs.gz +0 -0
- package/dist/{chunk-IJVDNQLG.js → chunk-FAP6OPLL.js} +275 -249
- package/dist/chunk-FAP6OPLL.js.br +0 -0
- package/dist/chunk-FAP6OPLL.js.gz +0 -0
- package/dist/{chunk-TJ55KUWH.mjs → chunk-FV7HEYCX.mjs} +1069 -114
- package/dist/chunk-FV7HEYCX.mjs.br +0 -0
- package/dist/chunk-FV7HEYCX.mjs.gz +0 -0
- package/dist/{chunk-LXTKPSIG.mjs → chunk-HF6L2CTF.mjs} +1 -1
- package/dist/chunk-HF6L2CTF.mjs.br +0 -0
- package/dist/chunk-HF6L2CTF.mjs.gz +0 -0
- package/dist/{chunk-MMK4K3QI.js → chunk-IOVOQ6ZJ.js} +136 -1
- package/dist/chunk-IOVOQ6ZJ.js.br +0 -0
- package/dist/chunk-IOVOQ6ZJ.js.gz +0 -0
- package/dist/{chunk-JWMXOYSX.js → chunk-IXBM3HWH.js} +2289 -1824
- package/dist/chunk-IXBM3HWH.js.br +0 -0
- package/dist/chunk-IXBM3HWH.js.gz +0 -0
- package/dist/{chunk-H74UXL4Q.js → chunk-KDJBWJJH.js} +1102 -113
- package/dist/chunk-KDJBWJJH.js.br +0 -0
- package/dist/chunk-KDJBWJJH.js.gz +0 -0
- package/dist/{chunk-OHPF2HTP.mjs → chunk-NJ4PTG4F.mjs} +40 -28
- package/dist/chunk-NJ4PTG4F.mjs.br +0 -0
- package/dist/chunk-NJ4PTG4F.mjs.gz +0 -0
- package/dist/{chunk-LCG7WBAG.mjs → chunk-PXYZFWDA.mjs} +625 -160
- package/dist/chunk-PXYZFWDA.mjs.br +0 -0
- package/dist/chunk-PXYZFWDA.mjs.gz +0 -0
- package/dist/{chunk-A7HLINZU.js → chunk-QT6BPOZM.js} +361 -349
- package/dist/chunk-QT6BPOZM.js.br +0 -0
- package/dist/chunk-QT6BPOZM.js.gz +0 -0
- package/dist/{chunk-SL3XPERE.mjs → chunk-RHR7GTDX.mjs} +136 -1
- package/dist/chunk-RHR7GTDX.mjs.br +0 -0
- package/dist/chunk-RHR7GTDX.mjs.gz +0 -0
- package/dist/{chunk-SPJR6MPI.js → chunk-X3SFCKAF.js} +3 -3
- package/dist/chunk-X3SFCKAF.js.br +0 -0
- package/dist/chunk-X3SFCKAF.js.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +28 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -36
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +38 -3
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{useViewerBuildingBlocks-CpUwhBD5.d.ts → useViewerBuildingBlocks-YvCYsxa3.d.ts} +21 -5
- package/dist/useViewerBuildingBlocks-YvCYsxa3.d.ts.map +1 -0
- package/dist/viewer/index.js +22 -22
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-35CHYS5N.mjs.br +0 -0
- package/dist/AiChatPanel-35CHYS5N.mjs.gz +0 -0
- package/dist/AiChatPanel-KTMWRUD5.js.br +0 -0
- package/dist/AiChatPanel-KTMWRUD5.js.gz +0 -0
- package/dist/Model3DScene-2VMN3B65.mjs.br +0 -0
- package/dist/Model3DScene-2VMN3B65.mjs.gz +0 -0
- package/dist/Model3DScene-TMNUKCL6.js.br +0 -0
- package/dist/Model3DScene-TMNUKCL6.js.gz +0 -0
- package/dist/SurfaceChart3DScene-GKRDDN2U.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-KPNP3QD5.js.br +0 -0
- package/dist/SurfaceChart3DScene-KPNP3QD5.js.gz +0 -0
- package/dist/chunk-A7HLINZU.js.br +0 -0
- package/dist/chunk-A7HLINZU.js.gz +0 -0
- package/dist/chunk-FY2AFXKP.mjs.br +0 -0
- package/dist/chunk-FY2AFXKP.mjs.gz +0 -0
- package/dist/chunk-H74UXL4Q.js.br +0 -0
- package/dist/chunk-H74UXL4Q.js.gz +0 -0
- package/dist/chunk-IJVDNQLG.js.br +0 -0
- package/dist/chunk-IJVDNQLG.js.gz +0 -0
- package/dist/chunk-JWMXOYSX.js.br +0 -0
- package/dist/chunk-JWMXOYSX.js.gz +0 -0
- package/dist/chunk-LCG7WBAG.mjs.br +0 -0
- package/dist/chunk-LCG7WBAG.mjs.gz +0 -0
- package/dist/chunk-LXTKPSIG.mjs.br +0 -0
- package/dist/chunk-LXTKPSIG.mjs.gz +0 -0
- package/dist/chunk-MMK4K3QI.js.br +0 -0
- package/dist/chunk-MMK4K3QI.js.gz +0 -0
- package/dist/chunk-OHPF2HTP.mjs.br +0 -0
- package/dist/chunk-OHPF2HTP.mjs.gz +0 -0
- package/dist/chunk-SL3XPERE.mjs.br +0 -0
- package/dist/chunk-SL3XPERE.mjs.gz +0 -0
- package/dist/chunk-SPJR6MPI.js.br +0 -0
- package/dist/chunk-SPJR6MPI.js.gz +0 -0
- package/dist/chunk-TJ55KUWH.mjs.br +0 -0
- package/dist/chunk-TJ55KUWH.mjs.gz +0 -0
- package/dist/useViewerBuildingBlocks-CpUwhBD5.d.ts.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkFAP6OPLL_js = require('./chunk-FAP6OPLL.js');
|
|
4
|
+
var chunkIOVOQ6ZJ_js = require('./chunk-IOVOQ6ZJ.js');
|
|
5
|
+
var chunkKDJBWJJH_js = require('./chunk-KDJBWJJH.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 = chunkKDJBWJJH_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 = chunkKDJBWJJH_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 >= chunkKDJBWJJH_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
|
+
}, chunkKDJBWJJH_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 = chunkKDJBWJJH_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 = chunkKDJBWJJH_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
|
+
chunkKDJBWJJH_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 = chunkKDJBWJJH_js.validateRoomId(config.roomId);
|
|
243
243
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
244
|
-
departureRef.current =
|
|
244
|
+
departureRef.current = chunkKDJBWJJH_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 = chunkKDJBWJJH_js.validateRoomId(config.roomId);
|
|
287
|
+
const transport = config.transport ?? chunkKDJBWJJH_js.resolveTransportForServerUrl(config.serverUrl);
|
|
288
288
|
if (transport === "webrtc") {
|
|
289
289
|
await initWebrtc();
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
if (
|
|
292
|
+
if (chunkKDJBWJJH_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 = chunkKDJBWJJH_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
|
+
chunkKDJBWJJH_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
|
+
}, chunkKDJBWJJH_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
|
+
chunkKDJBWJJH_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 = chunkKDJBWJJH_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 = chunkKDJBWJJH_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(chunkKDJBWJJH_js.cloneSlide),
|
|
521
|
+
templateElementsBySlideId: chunkKDJBWJJH_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(chunkKDJBWJJH_js.cloneSlide));
|
|
535
535
|
setTemplateElementsBySlideId(
|
|
536
|
-
|
|
536
|
+
chunkKDJBWJJH_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 = chunkFAP6OPLL_js.cloneHistorySnapshot(previousSnapshot);
|
|
571
|
+
lastHistorySnapshotRef.current = chunkFAP6OPLL_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 = chunkFAP6OPLL_js.cloneHistorySnapshot(nextSnapshot);
|
|
593
|
+
lastHistorySnapshotRef.current = chunkFAP6OPLL_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 = chunkFAP6OPLL_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 = chunkFAP6OPLL_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(chunkFAP6OPLL_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 = chunkFAP6OPLL_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 =
|
|
752
|
+
const boundedScale = chunkKDJBWJJH_js.clampZoomScale(nextScale);
|
|
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) =>
|
|
767
|
+
setScale((currentScale) => chunkKDJBWJJH_js.zoomInScale(currentScale));
|
|
768
768
|
}, []);
|
|
769
769
|
const handleZoomOut = react.useCallback(() => {
|
|
770
|
-
setScale((currentScale) =>
|
|
770
|
+
setScale((currentScale) => chunkKDJBWJJH_js.zoomOutScale(currentScale));
|
|
771
771
|
}, []);
|
|
772
772
|
const handleResetZoom = react.useCallback(() => {
|
|
773
773
|
setScale(1);
|
|
@@ -786,29 +786,29 @@ 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, chunkFAP6OPLL_js.MIN_ELEMENT_SIZE));
|
|
790
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkFAP6OPLL_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, chunkFAP6OPLL_js.MIN_ELEMENT_SIZE);
|
|
797
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkFAP6OPLL_js.MIN_ELEMENT_SIZE);
|
|
798
798
|
const availableWidth = Math.max(
|
|
799
|
-
effectiveEditorDimensions.width -
|
|
800
|
-
|
|
799
|
+
effectiveEditorDimensions.width - chunkFAP6OPLL_js.ZOOM_TO_SELECTION_PADDING,
|
|
800
|
+
chunkFAP6OPLL_js.MIN_ELEMENT_SIZE
|
|
801
801
|
);
|
|
802
802
|
const availableHeight = Math.max(
|
|
803
|
-
effectiveEditorDimensions.height -
|
|
804
|
-
|
|
803
|
+
effectiveEditorDimensions.height - chunkFAP6OPLL_js.ZOOM_TO_SELECTION_PADDING,
|
|
804
|
+
chunkFAP6OPLL_js.MIN_ELEMENT_SIZE
|
|
805
805
|
);
|
|
806
806
|
const targetEditorScale = Math.min(
|
|
807
807
|
availableWidth / boundsWidth,
|
|
808
808
|
availableHeight / boundsHeight
|
|
809
809
|
);
|
|
810
810
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
811
|
-
const nextScale =
|
|
811
|
+
const nextScale = chunkKDJBWJJH_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
812
812
|
setScale(nextScale);
|
|
813
813
|
window.requestAnimationFrame(() => {
|
|
814
814
|
window.requestAnimationFrame(() => {
|
|
@@ -828,7 +828,7 @@ function useZoomViewport({
|
|
|
828
828
|
}
|
|
829
829
|
event.preventDefault();
|
|
830
830
|
const delta = event.deltaY * -1e-3;
|
|
831
|
-
setScale((currentScale) =>
|
|
831
|
+
setScale((currentScale) => chunkKDJBWJJH_js.clampZoomScale(currentScale + delta));
|
|
832
832
|
}, []);
|
|
833
833
|
react.useEffect(() => {
|
|
834
834
|
const viewport = canvasViewportRef.current;
|
|
@@ -905,7 +905,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
905
905
|
const command = step.command;
|
|
906
906
|
const timer = window.setTimeout(
|
|
907
907
|
() => {
|
|
908
|
-
|
|
908
|
+
chunkFAP6OPLL_js.executeMediaCommand(command);
|
|
909
909
|
},
|
|
910
910
|
Math.max(0, step.delayMs)
|
|
911
911
|
);
|
|
@@ -1021,7 +1021,7 @@ function useAnimationPlayback(input) {
|
|
|
1021
1021
|
(controller, group) => {
|
|
1022
1022
|
driveBuildReveal(
|
|
1023
1023
|
controller,
|
|
1024
|
-
|
|
1024
|
+
chunkKDJBWJJH_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1025
1025
|
setPresentationElementStates,
|
|
1026
1026
|
buildRafRef
|
|
1027
1027
|
);
|
|
@@ -1084,7 +1084,7 @@ function useAnimationPlayback(input) {
|
|
|
1084
1084
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1085
1085
|
return;
|
|
1086
1086
|
}
|
|
1087
|
-
const controller =
|
|
1087
|
+
const controller = chunkKDJBWJJH_js.PresentationAnimationController.fromSlide(slide);
|
|
1088
1088
|
controllerRef.current = controller;
|
|
1089
1089
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1090
1090
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1232,7 +1232,7 @@ function useAnimationPlayback(input) {
|
|
|
1232
1232
|
}))
|
|
1233
1233
|
);
|
|
1234
1234
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1235
|
-
const delay =
|
|
1235
|
+
const delay = chunkKDJBWJJH_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1236
1236
|
const timer = window.setTimeout(() => {
|
|
1237
1237
|
setPresentationAnimations(
|
|
1238
1238
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1269,12 +1269,12 @@ function useAnimationPlayback(input) {
|
|
|
1269
1269
|
presentationTimersRef
|
|
1270
1270
|
};
|
|
1271
1271
|
}
|
|
1272
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1273
|
-
var AUDIENCE_HASH =
|
|
1274
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1275
|
-
var AUDIENCE_NONCE_KEY =
|
|
1272
|
+
var PRESENTER_CHANNEL_NAME = chunkKDJBWJJH_js.PRESENTATION_CHANNEL_NAME;
|
|
1273
|
+
var AUDIENCE_HASH = chunkKDJBWJJH_js.PRESENTATION_HASH;
|
|
1274
|
+
var PRESENTER_MSG_ORIGIN = chunkKDJBWJJH_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1275
|
+
var AUDIENCE_NONCE_KEY = chunkKDJBWJJH_js.PRESENTATION_NONCE_KEY;
|
|
1276
1276
|
function generateSessionId() {
|
|
1277
|
-
return
|
|
1277
|
+
return chunkKDJBWJJH_js.createPresentationSessionId();
|
|
1278
1278
|
}
|
|
1279
1279
|
function parseAudienceNonce() {
|
|
1280
1280
|
const hash = window.location.hash;
|
|
@@ -1310,7 +1310,7 @@ function usePresenterWindow(input) {
|
|
|
1310
1310
|
}, []);
|
|
1311
1311
|
const swapDisplays = react.useCallback(async () => {
|
|
1312
1312
|
const audience = audienceWindowRef.current;
|
|
1313
|
-
return audience && !audience.closed ?
|
|
1313
|
+
return audience && !audience.closed ? chunkKDJBWJJH_js.swapPresentationWindows(window, audience) : false;
|
|
1314
1314
|
}, []);
|
|
1315
1315
|
const syncSlideToAudience = react.useCallback(
|
|
1316
1316
|
(slideIndex) => {
|
|
@@ -1374,7 +1374,7 @@ function usePresenterWindow(input) {
|
|
|
1374
1374
|
pollTimerRef.current = null;
|
|
1375
1375
|
}
|
|
1376
1376
|
if (closingSessionId) {
|
|
1377
|
-
void
|
|
1377
|
+
void chunkKDJBWJJH_js.clearAudienceContent(closingSessionId);
|
|
1378
1378
|
}
|
|
1379
1379
|
}, [getChannel]);
|
|
1380
1380
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1392,10 +1392,10 @@ function usePresenterWindow(input) {
|
|
|
1392
1392
|
audienceWindowRef.current = blankWin;
|
|
1393
1393
|
const sessionId = generateSessionId();
|
|
1394
1394
|
sessionIdRef.current = sessionId;
|
|
1395
|
-
const audienceUrl =
|
|
1396
|
-
void
|
|
1395
|
+
const audienceUrl = chunkKDJBWJJH_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1396
|
+
void chunkKDJBWJJH_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1397
1397
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1398
|
-
|
|
1398
|
+
chunkKDJBWJJH_js.placeAudienceWindow(blankWin, placement);
|
|
1399
1399
|
}
|
|
1400
1400
|
return void 0;
|
|
1401
1401
|
});
|
|
@@ -1425,7 +1425,7 @@ function usePresenterWindow(input) {
|
|
|
1425
1425
|
}
|
|
1426
1426
|
};
|
|
1427
1427
|
if (content) {
|
|
1428
|
-
void
|
|
1428
|
+
void chunkKDJBWJJH_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1429
1429
|
} else {
|
|
1430
1430
|
navigateOrClose(true);
|
|
1431
1431
|
}
|
|
@@ -1451,7 +1451,7 @@ function usePresenterWindow(input) {
|
|
|
1451
1451
|
}
|
|
1452
1452
|
const handleMessage = (event) => {
|
|
1453
1453
|
const message = event.data;
|
|
1454
|
-
if (
|
|
1454
|
+
if (chunkKDJBWJJH_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1455
1455
|
syncStateToAudience(snapshotRef.current);
|
|
1456
1456
|
}
|
|
1457
1457
|
};
|
|
@@ -1480,7 +1480,7 @@ function usePresenterWindow(input) {
|
|
|
1480
1480
|
react.useEffect(() => {
|
|
1481
1481
|
const handleBeforeUnload = () => {
|
|
1482
1482
|
if (sessionIdRef.current) {
|
|
1483
|
-
void
|
|
1483
|
+
void chunkKDJBWJJH_js.clearAudienceContent(sessionIdRef.current);
|
|
1484
1484
|
}
|
|
1485
1485
|
};
|
|
1486
1486
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1542,7 +1542,7 @@ function useAudienceMode(input) {
|
|
|
1542
1542
|
}
|
|
1543
1543
|
channel.onmessage = (event) => {
|
|
1544
1544
|
const data = event.data;
|
|
1545
|
-
if (!
|
|
1545
|
+
if (!chunkKDJBWJJH_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1546
1546
|
return;
|
|
1547
1547
|
}
|
|
1548
1548
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1558,16 +1558,16 @@ function useAudienceMode(input) {
|
|
|
1558
1558
|
}
|
|
1559
1559
|
if (data.type === "presenter-exit") {
|
|
1560
1560
|
if (expectedSessionId) {
|
|
1561
|
-
void
|
|
1561
|
+
void chunkKDJBWJJH_js.clearAudienceContent(expectedSessionId);
|
|
1562
1562
|
}
|
|
1563
|
-
if (
|
|
1563
|
+
if (chunkKDJBWJJH_js.endAudienceDisplay(window)) {
|
|
1564
1564
|
handlers.onPresenterEnded?.();
|
|
1565
1565
|
}
|
|
1566
1566
|
}
|
|
1567
1567
|
};
|
|
1568
1568
|
if (expectedSessionId) {
|
|
1569
1569
|
channel.postMessage({
|
|
1570
|
-
origin:
|
|
1570
|
+
origin: chunkKDJBWJJH_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1571
1571
|
type: "audience-ready",
|
|
1572
1572
|
sessionId: expectedSessionId
|
|
1573
1573
|
});
|
|
@@ -1586,6 +1586,7 @@ function usePresentationKeyboard(input) {
|
|
|
1586
1586
|
movePresentationSlide,
|
|
1587
1587
|
navigateToSlide,
|
|
1588
1588
|
slideCount,
|
|
1589
|
+
showSlideIndexes,
|
|
1589
1590
|
onSetMode,
|
|
1590
1591
|
onSetPointerTool,
|
|
1591
1592
|
onEraseAnnotations,
|
|
@@ -1599,14 +1600,14 @@ function usePresentationKeyboard(input) {
|
|
|
1599
1600
|
presentationSlideIndex,
|
|
1600
1601
|
setShowRehearsalSummary
|
|
1601
1602
|
} = input;
|
|
1602
|
-
const keyBufferRef = react.useRef(
|
|
1603
|
+
const keyBufferRef = react.useRef(chunkKDJBWJJH_js.createPresentationKeyBuffer());
|
|
1603
1604
|
react.useEffect(() => {
|
|
1604
|
-
if (mode !== "present" || !
|
|
1605
|
-
keyBufferRef.current =
|
|
1605
|
+
if (mode !== "present" || !chunkKDJBWJJH_js.acceptsPresentationInput()) {
|
|
1606
|
+
keyBufferRef.current = chunkKDJBWJJH_js.createPresentationKeyBuffer();
|
|
1606
1607
|
return;
|
|
1607
1608
|
}
|
|
1608
1609
|
const handleKeyDown = (event) => {
|
|
1609
|
-
const mapped =
|
|
1610
|
+
const mapped = chunkKDJBWJJH_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1610
1611
|
if (mapped.action === "none") {
|
|
1611
1612
|
return;
|
|
1612
1613
|
}
|
|
@@ -1625,12 +1626,16 @@ function usePresentationKeyboard(input) {
|
|
|
1625
1626
|
case "previous":
|
|
1626
1627
|
movePresentationSlide(-1);
|
|
1627
1628
|
return;
|
|
1628
|
-
case "first":
|
|
1629
|
-
|
|
1629
|
+
case "first": {
|
|
1630
|
+
const first = chunkKDJBWJJH_js.firstShowSlideIndex(showSlideIndexes);
|
|
1631
|
+
navigateToSlide(first ?? 0);
|
|
1630
1632
|
return;
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
+
}
|
|
1634
|
+
case "last": {
|
|
1635
|
+
const last = chunkKDJBWJJH_js.lastShowSlideIndex(showSlideIndexes);
|
|
1636
|
+
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1633
1637
|
return;
|
|
1638
|
+
}
|
|
1634
1639
|
case "goto": {
|
|
1635
1640
|
const index = mapped.slideNumber - 1;
|
|
1636
1641
|
if (index >= 0 && index < slideCount) {
|
|
@@ -1670,6 +1675,7 @@ function usePresentationKeyboard(input) {
|
|
|
1670
1675
|
movePresentationSlide,
|
|
1671
1676
|
navigateToSlide,
|
|
1672
1677
|
slideCount,
|
|
1678
|
+
showSlideIndexes,
|
|
1673
1679
|
onSetMode,
|
|
1674
1680
|
onSetPointerTool,
|
|
1675
1681
|
onEraseAnnotations,
|
|
@@ -1814,7 +1820,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1814
1820
|
return;
|
|
1815
1821
|
}
|
|
1816
1822
|
if (action.url && !actionStr.includes("hlinksldjump")) {
|
|
1817
|
-
if (
|
|
1823
|
+
if (chunkKDJBWJJH_js.isUrlSafe(action.url)) {
|
|
1818
1824
|
window.open(action.url, "_blank", "noopener,noreferrer");
|
|
1819
1825
|
}
|
|
1820
1826
|
}
|
|
@@ -1824,7 +1830,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1824
1830
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1825
1831
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1826
1832
|
const transition = incomingSlide?.transition;
|
|
1827
|
-
const durationMs = deps.playTransition ?
|
|
1833
|
+
const durationMs = deps.playTransition ? chunkKDJBWJJH_js.resolveTransitionDurationMs(transition) : 0;
|
|
1828
1834
|
deps.clearPresentationTimers();
|
|
1829
1835
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1830
1836
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1883,7 +1889,7 @@ function useSlideNavigation(input) {
|
|
|
1883
1889
|
});
|
|
1884
1890
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1885
1891
|
(slideIndex) => {
|
|
1886
|
-
const delayMs =
|
|
1892
|
+
const delayMs = chunkKDJBWJJH_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1887
1893
|
if (delayMs === void 0) {
|
|
1888
1894
|
return;
|
|
1889
1895
|
}
|
|
@@ -1906,10 +1912,8 @@ function useSlideNavigation(input) {
|
|
|
1906
1912
|
if (availableSlideIndexes.length === 0) {
|
|
1907
1913
|
return;
|
|
1908
1914
|
}
|
|
1909
|
-
const
|
|
1910
|
-
|
|
1911
|
-
const nextPosition = normalizedCurrentPosition + direction;
|
|
1912
|
-
if (rehearsing && direction === 1 && nextPosition >= availableSlideIndexes.length) {
|
|
1915
|
+
const pastLastSlide = direction === 1 && !chunkKDJBWJJH_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1916
|
+
if (rehearsing && pastLastSlide) {
|
|
1913
1917
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1914
1918
|
try {
|
|
1915
1919
|
if (document.fullscreenElement) {
|
|
@@ -1922,17 +1926,13 @@ function useSlideNavigation(input) {
|
|
|
1922
1926
|
setShowRehearsalSummary(true);
|
|
1923
1927
|
return;
|
|
1924
1928
|
}
|
|
1925
|
-
if (!loopContinuously && !rehearsing &&
|
|
1929
|
+
if (!loopContinuously && !rehearsing && pastLastSlide && onAdvancePastLastSlide) {
|
|
1926
1930
|
onAdvancePastLastSlide();
|
|
1927
1931
|
return;
|
|
1928
1932
|
}
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
} else {
|
|
1933
|
-
resolvedPosition = Math.min(availableSlideIndexes.length - 1, Math.max(0, nextPosition));
|
|
1934
|
-
}
|
|
1935
|
-
const nextSlideIndex = availableSlideIndexes[resolvedPosition];
|
|
1933
|
+
const nextSlideIndex = direction === 1 ? chunkKDJBWJJH_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1934
|
+
loop: Boolean(loopContinuously) && !rehearsing
|
|
1935
|
+
}) : chunkKDJBWJJH_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
1936
1936
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
1937
1937
|
return;
|
|
1938
1938
|
}
|
|
@@ -2073,17 +2073,17 @@ function useZoomNavigation(input) {
|
|
|
2073
2073
|
};
|
|
2074
2074
|
}
|
|
2075
2075
|
function usePresenterConsole(slideIndex) {
|
|
2076
|
-
const timerRef = react.useRef(
|
|
2077
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2076
|
+
const timerRef = react.useRef(chunkKDJBWJJH_js.createPresenterTimer());
|
|
2077
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkKDJBWJJH_js.createInitialPresentationSnapshot(slideIndex));
|
|
2078
2078
|
const patch = react.useCallback((value) => {
|
|
2079
|
-
setSnapshot((current) =>
|
|
2079
|
+
setSnapshot((current) => chunkKDJBWJJH_js.mergePresentationSnapshot(current, value));
|
|
2080
2080
|
}, []);
|
|
2081
2081
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2082
2082
|
react.useEffect(() => {
|
|
2083
2083
|
const timer = window.setInterval(() => {
|
|
2084
2084
|
patch({
|
|
2085
2085
|
paused: timerRef.current.paused,
|
|
2086
|
-
elapsedMs:
|
|
2086
|
+
elapsedMs: chunkKDJBWJJH_js.presenterElapsed(timerRef.current)
|
|
2087
2087
|
});
|
|
2088
2088
|
}, 1e3);
|
|
2089
2089
|
return () => window.clearInterval(timer);
|
|
@@ -2093,19 +2093,19 @@ function usePresenterConsole(slideIndex) {
|
|
|
2093
2093
|
applyAudienceSnapshot: setSnapshot,
|
|
2094
2094
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2095
2095
|
toggleTimer: () => {
|
|
2096
|
-
timerRef.current =
|
|
2096
|
+
timerRef.current = chunkKDJBWJJH_js.togglePresenterTimer(timerRef.current);
|
|
2097
2097
|
patch({
|
|
2098
2098
|
paused: timerRef.current.paused,
|
|
2099
|
-
elapsedMs:
|
|
2099
|
+
elapsedMs: chunkKDJBWJJH_js.presenterElapsed(timerRef.current)
|
|
2100
2100
|
});
|
|
2101
2101
|
},
|
|
2102
2102
|
resetTimer: () => {
|
|
2103
|
-
timerRef.current =
|
|
2103
|
+
timerRef.current = chunkKDJBWJJH_js.resetPresenterTimer();
|
|
2104
2104
|
patch({ paused: false, elapsedMs: 0 });
|
|
2105
2105
|
},
|
|
2106
2106
|
stepZoom: (direction) => setSnapshot(
|
|
2107
|
-
(current) =>
|
|
2108
|
-
zoom:
|
|
2107
|
+
(current) => chunkKDJBWJJH_js.mergePresentationSnapshot(current, {
|
|
2108
|
+
zoom: chunkKDJBWJJH_js.stepPresenterZoom(
|
|
2109
2109
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2110
2110
|
direction
|
|
2111
2111
|
)
|
|
@@ -2226,7 +2226,7 @@ function usePresentationMode(input) {
|
|
|
2226
2226
|
});
|
|
2227
2227
|
const movePresentationSlide = react.useCallback(
|
|
2228
2228
|
(direction, trigger = "explicit") => {
|
|
2229
|
-
if (!
|
|
2229
|
+
if (!chunkKDJBWJJH_js.acceptsPresentationInput()) {
|
|
2230
2230
|
return;
|
|
2231
2231
|
}
|
|
2232
2232
|
if (endOfShowVisible) {
|
|
@@ -2331,6 +2331,7 @@ function usePresentationMode(input) {
|
|
|
2331
2331
|
movePresentationSlide,
|
|
2332
2332
|
navigateToSlide,
|
|
2333
2333
|
slideCount: slides.length,
|
|
2334
|
+
showSlideIndexes: visibleSlideIndexes,
|
|
2334
2335
|
onSetMode,
|
|
2335
2336
|
onSetPointerTool,
|
|
2336
2337
|
onEraseAnnotations,
|
|
@@ -2428,11 +2429,11 @@ function usePresentationMode(input) {
|
|
|
2428
2429
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2429
2430
|
return void 0;
|
|
2430
2431
|
}
|
|
2431
|
-
return
|
|
2432
|
+
return chunkKDJBWJJH_js.buildMorphTransitionPlan(
|
|
2432
2433
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2433
2434
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2434
2435
|
transitionOverlay.durationMs,
|
|
2435
|
-
|
|
2436
|
+
chunkKDJBWJJH_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2436
2437
|
);
|
|
2437
2438
|
}, [transitionOverlay, slides]);
|
|
2438
2439
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2738,7 +2739,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2738
2739
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2739
2740
|
slides.forEach((slide, slideIndex) => {
|
|
2740
2741
|
for (const element of slide.elements || []) {
|
|
2741
|
-
if (!
|
|
2742
|
+
if (!chunkKDJBWJJH_js.hasTextProperties(element)) {
|
|
2742
2743
|
continue;
|
|
2743
2744
|
}
|
|
2744
2745
|
const segments = element.textSegments ?? [];
|
|
@@ -2789,7 +2790,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2789
2790
|
continue;
|
|
2790
2791
|
}
|
|
2791
2792
|
const element = slide.elements[elIdx];
|
|
2792
|
-
if (!
|
|
2793
|
+
if (!chunkKDJBWJJH_js.hasTextProperties(element)) {
|
|
2793
2794
|
continue;
|
|
2794
2795
|
}
|
|
2795
2796
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3387,7 +3388,7 @@ function useViewerCoreState(_input) {
|
|
|
3387
3388
|
const shapeAdjustmentDragStateRef = react.useRef(null);
|
|
3388
3389
|
const marqueeStateRef = react.useRef(null);
|
|
3389
3390
|
const isDrawingRef = react.useRef(false);
|
|
3390
|
-
const livePatcher = react.useMemo(() =>
|
|
3391
|
+
const livePatcher = react.useMemo(() => chunkKDJBWJJH_js.createCollaborationLivePatcher(), []);
|
|
3391
3392
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3392
3393
|
const slidesRef = react.useRef([]);
|
|
3393
3394
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3396,8 +3397,8 @@ function useViewerCoreState(_input) {
|
|
|
3396
3397
|
const [slides, setSlides] = react.useState([]);
|
|
3397
3398
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3398
3399
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3399
|
-
width:
|
|
3400
|
-
height:
|
|
3400
|
+
width: chunkFAP6OPLL_js.DEFAULT_CANVAS_WIDTH,
|
|
3401
|
+
height: chunkFAP6OPLL_js.DEFAULT_CANVAS_HEIGHT
|
|
3401
3402
|
});
|
|
3402
3403
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
3403
3404
|
const [selectedElementId, setSelectedElementId] = react.useState(null);
|
|
@@ -3417,7 +3418,7 @@ function useViewerCoreState(_input) {
|
|
|
3417
3418
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3418
3419
|
inlineEditingTextRef.current = resolved;
|
|
3419
3420
|
setInlineEditingTextBase(value);
|
|
3420
|
-
|
|
3421
|
+
chunkKDJBWJJH_js.publishLiveInlineText(
|
|
3421
3422
|
livePatcher,
|
|
3422
3423
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3423
3424
|
inlineEditingElementIdRef.current,
|
|
@@ -3586,6 +3587,7 @@ function useViewerUIState() {
|
|
|
3586
3587
|
const [sidebarPanelMode, setSidebarPanelMode] = react.useState("properties");
|
|
3587
3588
|
const [showSlideSorter, setShowSlideSorter] = react.useState(false);
|
|
3588
3589
|
const [showReadingView, setShowReadingView] = react.useState(false);
|
|
3590
|
+
const [showOutlineView, setShowOutlineView] = react.useState(false);
|
|
3589
3591
|
const [isShortcutHelpOpen, setIsShortcutHelpOpen] = react.useState(false);
|
|
3590
3592
|
const [isAccessibilityPanelOpen, setIsAccessibilityPanelOpen] = react.useState(false);
|
|
3591
3593
|
const [accessibilityIssues, setAccessibilityIssues] = react.useState([]);
|
|
@@ -3634,6 +3636,8 @@ function useViewerUIState() {
|
|
|
3634
3636
|
setShowSlideSorter,
|
|
3635
3637
|
showReadingView,
|
|
3636
3638
|
setShowReadingView,
|
|
3639
|
+
showOutlineView,
|
|
3640
|
+
setShowOutlineView,
|
|
3637
3641
|
isShortcutHelpOpen,
|
|
3638
3642
|
setIsShortcutHelpOpen,
|
|
3639
3643
|
isAccessibilityPanelOpen,
|
|
@@ -3748,7 +3752,7 @@ function useLoadContent({
|
|
|
3748
3752
|
);
|
|
3749
3753
|
}
|
|
3750
3754
|
const previousHandler = handlerRef.current;
|
|
3751
|
-
const handler = new
|
|
3755
|
+
const handler = new chunkKDJBWJJH_js.PptxHandler();
|
|
3752
3756
|
const parsed = await handler.load(buffer);
|
|
3753
3757
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3754
3758
|
handler.dispose();
|
|
@@ -3760,7 +3764,7 @@ function useLoadContent({
|
|
|
3760
3764
|
handlerRef.current = null;
|
|
3761
3765
|
const mediaElements = [];
|
|
3762
3766
|
for (const slide of parsed.slides) {
|
|
3763
|
-
|
|
3767
|
+
chunkKDJBWJJH_js.collectMediaElements(slide.elements, mediaElements);
|
|
3764
3768
|
}
|
|
3765
3769
|
for (const url of mediaDataUrls.values()) {
|
|
3766
3770
|
if (url.startsWith("blob:")) {
|
|
@@ -3801,7 +3805,7 @@ function useLoadContent({
|
|
|
3801
3805
|
}
|
|
3802
3806
|
})
|
|
3803
3807
|
);
|
|
3804
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3808
|
+
const { paths: imagePaths, refs: imageRefs } = chunkKDJBWJJH_js.collectImagePaths(parsed.slides);
|
|
3805
3809
|
let nextSlides = parsed.slides;
|
|
3806
3810
|
if (imagePaths.size > 0) {
|
|
3807
3811
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3856,12 +3860,12 @@ function useLoadContent({
|
|
|
3856
3860
|
}
|
|
3857
3861
|
}
|
|
3858
3862
|
handlerRef.current = handler;
|
|
3859
|
-
const partition =
|
|
3863
|
+
const partition = chunkFAP6OPLL_js.partitionTemplateElements(nextSlides);
|
|
3860
3864
|
setSlides(partition.slides);
|
|
3861
3865
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3862
3866
|
setCanvasSize({
|
|
3863
|
-
width: parsed.width ??
|
|
3864
|
-
height: parsed.height ??
|
|
3867
|
+
width: parsed.width ?? chunkFAP6OPLL_js.DEFAULT_CANVAS_WIDTH,
|
|
3868
|
+
height: parsed.height ?? chunkFAP6OPLL_js.DEFAULT_CANVAS_HEIGHT
|
|
3865
3869
|
});
|
|
3866
3870
|
setHeaderFooter(parsed.headerFooter ?? {});
|
|
3867
3871
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
@@ -3890,7 +3894,7 @@ function useLoadContent({
|
|
|
3890
3894
|
setHasMacros(parsed.hasMacros === true);
|
|
3891
3895
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3892
3896
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3893
|
-
setGuides(
|
|
3897
|
+
setGuides(chunkKDJBWJJH_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3894
3898
|
setActiveSlideIndex(0);
|
|
3895
3899
|
clearSelection();
|
|
3896
3900
|
setIsDirty(false);
|
|
@@ -3898,7 +3902,7 @@ function useLoadContent({
|
|
|
3898
3902
|
onContentApplied?.();
|
|
3899
3903
|
} catch (err) {
|
|
3900
3904
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3901
|
-
if (err instanceof
|
|
3905
|
+
if (err instanceof chunkKDJBWJJH_js.EncryptedFileError) {
|
|
3902
3906
|
setIsEncrypted(true);
|
|
3903
3907
|
} else {
|
|
3904
3908
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3975,7 +3979,7 @@ function useAutosave(input) {
|
|
|
3975
3979
|
isSavingRef.current = false;
|
|
3976
3980
|
return;
|
|
3977
3981
|
}
|
|
3978
|
-
await
|
|
3982
|
+
await chunkKDJBWJJH_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
3979
3983
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
3980
3984
|
} catch (err) {
|
|
3981
3985
|
setAutosaveStatus({
|
|
@@ -4040,7 +4044,7 @@ function useElementOperations(input) {
|
|
|
4040
4044
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
4041
4045
|
const updateElementById = react.useCallback(
|
|
4042
4046
|
(elementId, updates) => {
|
|
4043
|
-
if (
|
|
4047
|
+
if (chunkKDJBWJJH_js.isTemplateElementId(elementId)) {
|
|
4044
4048
|
const slideId = activeSlide?.id;
|
|
4045
4049
|
if (slideId) {
|
|
4046
4050
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4080,7 +4084,7 @@ function useElementOperations(input) {
|
|
|
4080
4084
|
);
|
|
4081
4085
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4082
4086
|
(updates) => {
|
|
4083
|
-
if (!selectedElement || !
|
|
4087
|
+
if (!selectedElement || !chunkKDJBWJJH_js.hasShapeProperties(selectedElement)) {
|
|
4084
4088
|
return;
|
|
4085
4089
|
}
|
|
4086
4090
|
updateSelectedElement({
|
|
@@ -4091,17 +4095,17 @@ function useElementOperations(input) {
|
|
|
4091
4095
|
);
|
|
4092
4096
|
const updateSelectedTextStyle = react.useCallback(
|
|
4093
4097
|
(updates) => {
|
|
4094
|
-
if (!selectedElement || !
|
|
4098
|
+
if (!selectedElement || !chunkKDJBWJJH_js.hasTextProperties(selectedElement)) {
|
|
4095
4099
|
return;
|
|
4096
4100
|
}
|
|
4097
|
-
const inlineSel =
|
|
4101
|
+
const inlineSel = chunkKDJBWJJH_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4098
4102
|
if (inlineSel && selectedElement.textSegments) {
|
|
4099
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4103
|
+
const { newSegments: newSegments2, newSelection } = chunkKDJBWJJH_js.applyStyleToSelectedSegments(
|
|
4100
4104
|
selectedElement.textSegments,
|
|
4101
4105
|
inlineSel,
|
|
4102
4106
|
updates
|
|
4103
4107
|
);
|
|
4104
|
-
|
|
4108
|
+
chunkKDJBWJJH_js.setPendingSelectionRestore(newSelection);
|
|
4105
4109
|
updateSelectedElement({
|
|
4106
4110
|
textSegments: newSegments2
|
|
4107
4111
|
});
|
|
@@ -4121,12 +4125,12 @@ function useElementOperations(input) {
|
|
|
4121
4125
|
);
|
|
4122
4126
|
const updateSelectedTextCase = react.useCallback(
|
|
4123
4127
|
(mode) => {
|
|
4124
|
-
if (!selectedElement || !
|
|
4128
|
+
if (!selectedElement || !chunkKDJBWJJH_js.hasTextProperties(selectedElement)) {
|
|
4125
4129
|
return;
|
|
4126
4130
|
}
|
|
4127
|
-
const inlineSel =
|
|
4131
|
+
const inlineSel = chunkKDJBWJJH_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4128
4132
|
if (inlineSel && selectedElement.textSegments) {
|
|
4129
|
-
const newSegments =
|
|
4133
|
+
const newSegments = chunkKDJBWJJH_js.applyCaseTransformToSegments(
|
|
4130
4134
|
selectedElement.textSegments,
|
|
4131
4135
|
inlineSel,
|
|
4132
4136
|
mode
|
|
@@ -4136,14 +4140,14 @@ function useElementOperations(input) {
|
|
|
4136
4140
|
}
|
|
4137
4141
|
const updates = {};
|
|
4138
4142
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4139
|
-
updates.textSegments =
|
|
4143
|
+
updates.textSegments = chunkKDJBWJJH_js.applyCaseTransformToSegments(
|
|
4140
4144
|
selectedElement.textSegments,
|
|
4141
4145
|
null,
|
|
4142
4146
|
mode
|
|
4143
4147
|
);
|
|
4144
4148
|
}
|
|
4145
4149
|
if (typeof selectedElement.text === "string") {
|
|
4146
|
-
updates.text =
|
|
4150
|
+
updates.text = chunkKDJBWJJH_js.transformTextCase(selectedElement.text, mode);
|
|
4147
4151
|
}
|
|
4148
4152
|
updateSelectedElement(updates);
|
|
4149
4153
|
},
|
|
@@ -4198,7 +4202,7 @@ function useSectionOperations(input) {
|
|
|
4198
4202
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4199
4203
|
const addSection2 = react.useCallback(
|
|
4200
4204
|
(name, afterSlideIndex) => {
|
|
4201
|
-
const result =
|
|
4205
|
+
const result = chunkKDJBWJJH_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4202
4206
|
setSlides(result.slides);
|
|
4203
4207
|
setSections(result.sections);
|
|
4204
4208
|
markDirty();
|
|
@@ -4207,7 +4211,7 @@ function useSectionOperations(input) {
|
|
|
4207
4211
|
);
|
|
4208
4212
|
const renameSection2 = react.useCallback(
|
|
4209
4213
|
(sectionId, newName) => {
|
|
4210
|
-
const result =
|
|
4214
|
+
const result = chunkKDJBWJJH_js.renameSection(sections, slides, sectionId, newName);
|
|
4211
4215
|
setSections(result.sections);
|
|
4212
4216
|
setSlides(result.slides);
|
|
4213
4217
|
markDirty();
|
|
@@ -4216,7 +4220,7 @@ function useSectionOperations(input) {
|
|
|
4216
4220
|
);
|
|
4217
4221
|
const deleteSection2 = react.useCallback(
|
|
4218
4222
|
(sectionId) => {
|
|
4219
|
-
const result =
|
|
4223
|
+
const result = chunkKDJBWJJH_js.deleteSection(sections, slides, sectionId);
|
|
4220
4224
|
setSections(result.sections);
|
|
4221
4225
|
setSlides(result.slides);
|
|
4222
4226
|
markDirty();
|
|
@@ -4225,21 +4229,21 @@ function useSectionOperations(input) {
|
|
|
4225
4229
|
);
|
|
4226
4230
|
const moveSectionUp2 = react.useCallback(
|
|
4227
4231
|
(sectionId) => {
|
|
4228
|
-
setSections(
|
|
4232
|
+
setSections(chunkKDJBWJJH_js.moveSectionUp(sections, sectionId));
|
|
4229
4233
|
markDirty();
|
|
4230
4234
|
},
|
|
4231
4235
|
[sections, setSections, markDirty]
|
|
4232
4236
|
);
|
|
4233
4237
|
const moveSectionDown2 = react.useCallback(
|
|
4234
4238
|
(sectionId) => {
|
|
4235
|
-
setSections(
|
|
4239
|
+
setSections(chunkKDJBWJJH_js.moveSectionDown(sections, sectionId));
|
|
4236
4240
|
markDirty();
|
|
4237
4241
|
},
|
|
4238
4242
|
[sections, setSections, markDirty]
|
|
4239
4243
|
);
|
|
4240
4244
|
const moveSlidesToSection2 = react.useCallback(
|
|
4241
4245
|
(slideIndexes, targetSectionId) => {
|
|
4242
|
-
const result =
|
|
4246
|
+
const result = chunkKDJBWJJH_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4243
4247
|
setSlides(result.slides);
|
|
4244
4248
|
setSections(result.sections);
|
|
4245
4249
|
markDirty();
|
|
@@ -4258,19 +4262,19 @@ function useSectionOperations(input) {
|
|
|
4258
4262
|
|
|
4259
4263
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4260
4264
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4261
|
-
const resized =
|
|
4265
|
+
const resized = chunkKDJBWJJH_js.applyResize(
|
|
4262
4266
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4263
4267
|
handle,
|
|
4264
4268
|
dx,
|
|
4265
4269
|
dy,
|
|
4266
4270
|
1,
|
|
4267
|
-
{ minSize:
|
|
4271
|
+
{ minSize: chunkFAP6OPLL_js.MIN_ELEMENT_SIZE }
|
|
4268
4272
|
);
|
|
4269
4273
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4270
4274
|
if (!snapToGrid) {
|
|
4271
4275
|
return box;
|
|
4272
4276
|
}
|
|
4273
|
-
return
|
|
4277
|
+
return chunkKDJBWJJH_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkFAP6OPLL_js.MIN_ELEMENT_SIZE);
|
|
4274
4278
|
}
|
|
4275
4279
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
4276
4280
|
const range = startWidth || 200;
|
|
@@ -4388,7 +4392,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4388
4392
|
width: el.width,
|
|
4389
4393
|
height: el.height
|
|
4390
4394
|
}));
|
|
4391
|
-
const snapResult =
|
|
4395
|
+
const snapResult = chunkKDJBWJJH_js.computeSnapToShape(
|
|
4392
4396
|
targetX,
|
|
4393
4397
|
targetY,
|
|
4394
4398
|
primaryEl.width,
|
|
@@ -4427,7 +4431,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4427
4431
|
if (live) {
|
|
4428
4432
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4429
4433
|
const start = drag.startPositionsById[id];
|
|
4430
|
-
|
|
4434
|
+
chunkKDJBWJJH_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4431
4435
|
x: start.x + appliedDx,
|
|
4432
4436
|
y: start.y + appliedDy
|
|
4433
4437
|
});
|
|
@@ -4461,15 +4465,15 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4461
4465
|
if (rs.domEl) {
|
|
4462
4466
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4463
4467
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4464
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4465
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4468
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunkFAP6OPLL_js.MIN_ELEMENT_SIZE)}px`;
|
|
4469
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunkFAP6OPLL_js.MIN_ELEMENT_SIZE)}px`;
|
|
4466
4470
|
}
|
|
4467
4471
|
if (live) {
|
|
4468
|
-
|
|
4472
|
+
chunkKDJBWJJH_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4469
4473
|
x: geo.x,
|
|
4470
4474
|
y: geo.y,
|
|
4471
|
-
width: Math.max(geo.width,
|
|
4472
|
-
height: Math.max(geo.height,
|
|
4475
|
+
width: Math.max(geo.width, chunkFAP6OPLL_js.MIN_ELEMENT_SIZE),
|
|
4476
|
+
height: Math.max(geo.height, chunkFAP6OPLL_js.MIN_ELEMENT_SIZE)
|
|
4473
4477
|
});
|
|
4474
4478
|
}
|
|
4475
4479
|
}
|
|
@@ -4549,13 +4553,13 @@ function processPointerUp(input) {
|
|
|
4549
4553
|
if (i !== activeSlideIndex) {
|
|
4550
4554
|
return s;
|
|
4551
4555
|
}
|
|
4552
|
-
const rerouted =
|
|
4556
|
+
const rerouted = chunkKDJBWJJH_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4553
4557
|
if (rerouted.length === 0) {
|
|
4554
4558
|
return s;
|
|
4555
4559
|
}
|
|
4556
4560
|
return {
|
|
4557
4561
|
...s,
|
|
4558
|
-
elements:
|
|
4562
|
+
elements: chunkKDJBWJJH_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4559
4563
|
};
|
|
4560
4564
|
})
|
|
4561
4565
|
);
|
|
@@ -4577,9 +4581,9 @@ function processPointerUp(input) {
|
|
|
4577
4581
|
}
|
|
4578
4582
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4579
4583
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4580
|
-
const hitIds =
|
|
4584
|
+
const hitIds = chunkKDJBWJJH_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4581
4585
|
if (marquee.additive) {
|
|
4582
|
-
const merged =
|
|
4586
|
+
const merged = chunkKDJBWJJH_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4583
4587
|
if (merged.length > 0) {
|
|
4584
4588
|
applySelection(merged[0], merged);
|
|
4585
4589
|
} else {
|
|
@@ -4602,8 +4606,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4602
4606
|
}
|
|
4603
4607
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4604
4608
|
});
|
|
4605
|
-
const rerouted =
|
|
4606
|
-
return
|
|
4609
|
+
const rerouted = chunkKDJBWJJH_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4610
|
+
return chunkKDJBWJJH_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4607
4611
|
};
|
|
4608
4612
|
if (editTemplateMode) {
|
|
4609
4613
|
const slideId = activeSlide?.id;
|
|
@@ -4759,9 +4763,9 @@ function useCanvasInteractions(input) {
|
|
|
4759
4763
|
return;
|
|
4760
4764
|
}
|
|
4761
4765
|
const el = elementLookup.get(editId);
|
|
4762
|
-
if (el &&
|
|
4766
|
+
if (el && chunkKDJBWJJH_js.hasTextProperties(el)) {
|
|
4763
4767
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4764
|
-
const newSegments =
|
|
4768
|
+
const newSegments = chunkKDJBWJJH_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4765
4769
|
ops.updateElementById(editId, {
|
|
4766
4770
|
text: committedText,
|
|
4767
4771
|
textSegments: newSegments
|
|
@@ -4772,7 +4776,7 @@ function useCanvasInteractions(input) {
|
|
|
4772
4776
|
setInlineEditingText("");
|
|
4773
4777
|
};
|
|
4774
4778
|
const openEquationEditorForElement = (el) => {
|
|
4775
|
-
if (!
|
|
4779
|
+
if (!chunkKDJBWJJH_js.hasTextProperties(el)) {
|
|
4776
4780
|
return false;
|
|
4777
4781
|
}
|
|
4778
4782
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4801,7 +4805,7 @@ function useCanvasInteractions(input) {
|
|
|
4801
4805
|
justSelectedRef.current = false;
|
|
4802
4806
|
} else {
|
|
4803
4807
|
const el = elementLookup.get(elementId);
|
|
4804
|
-
if (el &&
|
|
4808
|
+
if (el && chunkKDJBWJJH_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
4805
4809
|
if (!openEquationEditorForElement(el)) {
|
|
4806
4810
|
setInlineEditingElementId(elementId);
|
|
4807
4811
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4820,7 +4824,7 @@ function useCanvasInteractions(input) {
|
|
|
4820
4824
|
if (openEquationEditorForElement(el)) {
|
|
4821
4825
|
return;
|
|
4822
4826
|
}
|
|
4823
|
-
if (
|
|
4827
|
+
if (chunkKDJBWJJH_js.hasTextProperties(el)) {
|
|
4824
4828
|
setInlineEditingElementId(elementId);
|
|
4825
4829
|
setInlineEditingText(el.text ?? "");
|
|
4826
4830
|
}
|
|
@@ -5013,7 +5017,7 @@ function createFileHandlers(deps) {
|
|
|
5013
5017
|
h = Math.round(h * scale);
|
|
5014
5018
|
}
|
|
5015
5019
|
addElement({
|
|
5016
|
-
id:
|
|
5020
|
+
id: chunkKDJBWJJH_js.generateElementId(),
|
|
5017
5021
|
type: "image",
|
|
5018
5022
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5019
5023
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5024,7 +5028,7 @@ function createFileHandlers(deps) {
|
|
|
5024
5028
|
};
|
|
5025
5029
|
img.onerror = () => {
|
|
5026
5030
|
addElement({
|
|
5027
|
-
id:
|
|
5031
|
+
id: chunkKDJBWJJH_js.generateElementId(),
|
|
5028
5032
|
type: "image",
|
|
5029
5033
|
x: 100,
|
|
5030
5034
|
y: 100,
|
|
@@ -5050,7 +5054,7 @@ function createFileHandlers(deps) {
|
|
|
5050
5054
|
const elFilePath = file.path;
|
|
5051
5055
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5052
5056
|
addElement({
|
|
5053
|
-
id:
|
|
5057
|
+
id: chunkKDJBWJJH_js.generateElementId(),
|
|
5054
5058
|
type: "media",
|
|
5055
5059
|
mediaType,
|
|
5056
5060
|
mediaMimeType: file.type || void 0,
|
|
@@ -5225,13 +5229,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5225
5229
|
return;
|
|
5226
5230
|
}
|
|
5227
5231
|
addElement({
|
|
5228
|
-
id:
|
|
5232
|
+
id: chunkKDJBWJJH_js.generateElementId(),
|
|
5229
5233
|
type: "smartArt",
|
|
5230
5234
|
x: 100,
|
|
5231
5235
|
y: 120,
|
|
5232
5236
|
width: 600,
|
|
5233
5237
|
height: 340,
|
|
5234
|
-
smartArtData:
|
|
5238
|
+
smartArtData: chunkKDJBWJJH_js.buildSmartArtPresetData(
|
|
5235
5239
|
layout,
|
|
5236
5240
|
defaultItems,
|
|
5237
5241
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5243,7 +5247,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5243
5247
|
return;
|
|
5244
5248
|
}
|
|
5245
5249
|
addElement({
|
|
5246
|
-
id:
|
|
5250
|
+
id: chunkKDJBWJJH_js.generateElementId(),
|
|
5247
5251
|
type: "shape",
|
|
5248
5252
|
x: 120,
|
|
5249
5253
|
y: 200,
|
|
@@ -5302,7 +5306,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5302
5306
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5303
5307
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5304
5308
|
addElement({
|
|
5305
|
-
id:
|
|
5309
|
+
id: chunkKDJBWJJH_js.generateElementId(),
|
|
5306
5310
|
type: "shape",
|
|
5307
5311
|
x: 120,
|
|
5308
5312
|
y: 200,
|
|
@@ -5324,11 +5328,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5324
5328
|
if (!activeSlide) {
|
|
5325
5329
|
return;
|
|
5326
5330
|
}
|
|
5327
|
-
const preset =
|
|
5331
|
+
const preset = chunkKDJBWJJH_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5328
5332
|
if (!preset) {
|
|
5329
5333
|
return;
|
|
5330
5334
|
}
|
|
5331
|
-
const defaultPptxAction =
|
|
5335
|
+
const defaultPptxAction = chunkKDJBWJJH_js.elementActionToPptxAction({
|
|
5332
5336
|
trigger: "click",
|
|
5333
5337
|
type: preset.defaultAction
|
|
5334
5338
|
});
|
|
@@ -5337,7 +5341,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5337
5341
|
defaultPptxAction.highlightClick = true;
|
|
5338
5342
|
}
|
|
5339
5343
|
addElement({
|
|
5340
|
-
id:
|
|
5344
|
+
id: chunkKDJBWJJH_js.generateElementId(),
|
|
5341
5345
|
type: "shape",
|
|
5342
5346
|
x: 150,
|
|
5343
5347
|
y: 150,
|
|
@@ -5404,14 +5408,14 @@ function useInsertElements(input) {
|
|
|
5404
5408
|
return;
|
|
5405
5409
|
}
|
|
5406
5410
|
addElement({
|
|
5407
|
-
id:
|
|
5411
|
+
id: chunkKDJBWJJH_js.generateElementId(),
|
|
5408
5412
|
type: "text",
|
|
5409
5413
|
x: 100,
|
|
5410
5414
|
y: 100,
|
|
5411
5415
|
width: 300,
|
|
5412
5416
|
height: 60,
|
|
5413
5417
|
text: "",
|
|
5414
|
-
textStyle: { fontSize:
|
|
5418
|
+
textStyle: { fontSize: chunkFAP6OPLL_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5415
5419
|
});
|
|
5416
5420
|
};
|
|
5417
5421
|
const handleAddShape = () => {
|
|
@@ -5419,7 +5423,7 @@ function useInsertElements(input) {
|
|
|
5419
5423
|
return;
|
|
5420
5424
|
}
|
|
5421
5425
|
addElement({
|
|
5422
|
-
id:
|
|
5426
|
+
id: chunkKDJBWJJH_js.generateElementId(),
|
|
5423
5427
|
type: "shape",
|
|
5424
5428
|
x: 150,
|
|
5425
5429
|
y: 150,
|
|
@@ -5438,15 +5442,15 @@ function useInsertElements(input) {
|
|
|
5438
5442
|
return;
|
|
5439
5443
|
}
|
|
5440
5444
|
addElement({
|
|
5441
|
-
...
|
|
5442
|
-
id:
|
|
5445
|
+
...chunkKDJBWJJH_js.newTableElement(chunkFAP6OPLL_js.DEFAULT_TABLE_ROWS, chunkFAP6OPLL_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5446
|
+
id: chunkKDJBWJJH_js.generateElementId()
|
|
5443
5447
|
});
|
|
5444
5448
|
};
|
|
5445
5449
|
const handleAddChart = (chartType) => {
|
|
5446
5450
|
if (!activeSlide) {
|
|
5447
5451
|
return;
|
|
5448
5452
|
}
|
|
5449
|
-
addElement(
|
|
5453
|
+
addElement(chunkKDJBWJJH_js.createDefaultChartElement(chartType));
|
|
5450
5454
|
};
|
|
5451
5455
|
const structured = createStructuredElementHandlers({
|
|
5452
5456
|
activeSlide,
|
|
@@ -5516,7 +5520,7 @@ function useClipboardHandlers(input) {
|
|
|
5516
5520
|
if (!selectedElement) {
|
|
5517
5521
|
return;
|
|
5518
5522
|
}
|
|
5519
|
-
setClipboardPayload(
|
|
5523
|
+
setClipboardPayload(chunkKDJBWJJH_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5520
5524
|
};
|
|
5521
5525
|
const handleDelete = () => {
|
|
5522
5526
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5533,7 +5537,7 @@ function useClipboardHandlers(input) {
|
|
|
5533
5537
|
handleDelete();
|
|
5534
5538
|
};
|
|
5535
5539
|
const insertClone = (source) => {
|
|
5536
|
-
const clone =
|
|
5540
|
+
const clone = chunkKDJBWJJH_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5537
5541
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5538
5542
|
ops.applySelection(clone.id);
|
|
5539
5543
|
history.markDirty();
|
|
@@ -5568,7 +5572,7 @@ function resolveShapePath(el) {
|
|
|
5568
5572
|
return el.pathData;
|
|
5569
5573
|
}
|
|
5570
5574
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5571
|
-
const clipPath =
|
|
5575
|
+
const clipPath = chunkKDJBWJJH_js.getPresetShapeClipPath(el.shapeType);
|
|
5572
5576
|
if (clipPath) {
|
|
5573
5577
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5574
5578
|
if (svgPath) {
|
|
@@ -5619,7 +5623,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5619
5623
|
return parts.join(" ");
|
|
5620
5624
|
}
|
|
5621
5625
|
function transformPathToGlobal(pathData, el) {
|
|
5622
|
-
const polys =
|
|
5626
|
+
const polys = chunkKDJBWJJH_js.svgPathToPolygons(pathData);
|
|
5623
5627
|
if (polys.length === 0) {
|
|
5624
5628
|
return pathData;
|
|
5625
5629
|
}
|
|
@@ -5639,10 +5643,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5639
5643
|
y: pt.y * scaleY + el.y
|
|
5640
5644
|
}))
|
|
5641
5645
|
);
|
|
5642
|
-
return
|
|
5646
|
+
return chunkKDJBWJJH_js.polygonsToSvgPath(transformed);
|
|
5643
5647
|
}
|
|
5644
5648
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5645
|
-
const polys =
|
|
5649
|
+
const polys = chunkKDJBWJJH_js.svgPathToPolygons(pathData);
|
|
5646
5650
|
if (polys.length === 0) {
|
|
5647
5651
|
return pathData;
|
|
5648
5652
|
}
|
|
@@ -5652,10 +5656,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5652
5656
|
y: pt.y - y
|
|
5653
5657
|
}))
|
|
5654
5658
|
);
|
|
5655
|
-
return
|
|
5659
|
+
return chunkKDJBWJJH_js.polygonsToSvgPath(transformed);
|
|
5656
5660
|
}
|
|
5657
5661
|
function pathBounds(pathData) {
|
|
5658
|
-
const polys =
|
|
5662
|
+
const polys = chunkKDJBWJJH_js.svgPathToPolygons(pathData);
|
|
5659
5663
|
let minX = Infinity;
|
|
5660
5664
|
let minY = Infinity;
|
|
5661
5665
|
let maxX = -Infinity;
|
|
@@ -5714,7 +5718,7 @@ function useMergeShapesHandler(input) {
|
|
|
5714
5718
|
let allFragments = [];
|
|
5715
5719
|
let remaining = globalPaths[0];
|
|
5716
5720
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5717
|
-
const frags =
|
|
5721
|
+
const frags = chunkKDJBWJJH_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5718
5722
|
if (Array.isArray(frags)) {
|
|
5719
5723
|
allFragments = frags;
|
|
5720
5724
|
}
|
|
@@ -5743,7 +5747,7 @@ function useMergeShapesHandler(input) {
|
|
|
5743
5747
|
bounds.height
|
|
5744
5748
|
);
|
|
5745
5749
|
const newEl = {
|
|
5746
|
-
id:
|
|
5750
|
+
id: chunkKDJBWJJH_js.generateElementId(),
|
|
5747
5751
|
type: "shape",
|
|
5748
5752
|
x: bounds.x,
|
|
5749
5753
|
y: bounds.y,
|
|
@@ -5781,7 +5785,7 @@ function useMergeShapesHandler(input) {
|
|
|
5781
5785
|
} else {
|
|
5782
5786
|
let resultPath = globalPaths[0];
|
|
5783
5787
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5784
|
-
const result =
|
|
5788
|
+
const result = chunkKDJBWJJH_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5785
5789
|
if (typeof result === "string") {
|
|
5786
5790
|
resultPath = result;
|
|
5787
5791
|
}
|
|
@@ -5802,7 +5806,7 @@ function useMergeShapesHandler(input) {
|
|
|
5802
5806
|
);
|
|
5803
5807
|
const primary = targets[0];
|
|
5804
5808
|
const newEl = {
|
|
5805
|
-
id:
|
|
5809
|
+
id: chunkKDJBWJJH_js.generateElementId(),
|
|
5806
5810
|
type: "shape",
|
|
5807
5811
|
x: bounds.x,
|
|
5808
5812
|
y: bounds.y,
|
|
@@ -5865,7 +5869,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5865
5869
|
if (ids.length < 2 || !activeSlide) {
|
|
5866
5870
|
return;
|
|
5867
5871
|
}
|
|
5868
|
-
const { elements, groupId } =
|
|
5872
|
+
const { elements, groupId } = chunkKDJBWJJH_js.groupElements(ops.activeElements, ids, chunkKDJBWJJH_js.generateElementId());
|
|
5869
5873
|
if (groupId === null) {
|
|
5870
5874
|
return;
|
|
5871
5875
|
}
|
|
@@ -5878,12 +5882,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5878
5882
|
return;
|
|
5879
5883
|
}
|
|
5880
5884
|
const group = selectedElement;
|
|
5881
|
-
const intoTemplate =
|
|
5885
|
+
const intoTemplate = chunkKDJBWJJH_js.isTemplateElementId(group.id);
|
|
5882
5886
|
const ungrouped = group.children.map((child) => ({
|
|
5883
5887
|
...structuredClone(child),
|
|
5884
5888
|
// Keep child ids in the same store as the group so later edits route
|
|
5885
5889
|
// correctly: template groups yield template-prefixed child ids.
|
|
5886
|
-
id: intoTemplate ?
|
|
5890
|
+
id: intoTemplate ? chunkKDJBWJJH_js.makeCloneId(true, child.id || group.id) : child.id || chunkKDJBWJJH_js.generateElementId(),
|
|
5887
5891
|
x: child.x + group.x,
|
|
5888
5892
|
y: child.y + group.y
|
|
5889
5893
|
}));
|
|
@@ -5907,7 +5911,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5907
5911
|
if (!edge) {
|
|
5908
5912
|
return;
|
|
5909
5913
|
}
|
|
5910
|
-
const positions =
|
|
5914
|
+
const positions = chunkKDJBWJJH_js.alignElements(selectedElements, edge);
|
|
5911
5915
|
for (const [id, pos] of positions) {
|
|
5912
5916
|
const el = elementLookup.get(id);
|
|
5913
5917
|
if (!el) {
|
|
@@ -5925,7 +5929,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5925
5929
|
if (!distAxis) {
|
|
5926
5930
|
return;
|
|
5927
5931
|
}
|
|
5928
|
-
const positions =
|
|
5932
|
+
const positions = chunkKDJBWJJH_js.distributeElements(selectedElements, distAxis);
|
|
5929
5933
|
for (const [id, pos] of positions) {
|
|
5930
5934
|
const el = elementLookup.get(id);
|
|
5931
5935
|
if (!el) {
|
|
@@ -5942,7 +5946,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5942
5946
|
}
|
|
5943
5947
|
const id = selectedElement.id;
|
|
5944
5948
|
ops.updateActiveElements(
|
|
5945
|
-
(els) => direction === "forward" ?
|
|
5949
|
+
(els) => direction === "forward" ? chunkKDJBWJJH_js.bringForward(els, id) : direction === "backward" ? chunkKDJBWJJH_js.sendBackward(els, id) : els
|
|
5946
5950
|
);
|
|
5947
5951
|
history.markDirty();
|
|
5948
5952
|
};
|
|
@@ -5952,7 +5956,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5952
5956
|
}
|
|
5953
5957
|
const id = selectedElement.id;
|
|
5954
5958
|
ops.updateActiveElements(
|
|
5955
|
-
(els) => direction === "front" ?
|
|
5959
|
+
(els) => direction === "front" ? chunkKDJBWJJH_js.bringToFront(els, id) : chunkKDJBWJJH_js.sendToBack(els, id)
|
|
5956
5960
|
);
|
|
5957
5961
|
history.markDirty();
|
|
5958
5962
|
};
|
|
@@ -6074,7 +6078,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
6074
6078
|
function useSlideManagement(input) {
|
|
6075
6079
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
6076
6080
|
const handleAddSlide = () => {
|
|
6077
|
-
const newSlide =
|
|
6081
|
+
const newSlide = chunkKDJBWJJH_js.createBlankSlide(slides.length + 1);
|
|
6078
6082
|
ops.updateSlides((prev) => {
|
|
6079
6083
|
const next = [...prev];
|
|
6080
6084
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6137,7 +6141,7 @@ function useSlideManagement(input) {
|
|
|
6137
6141
|
}
|
|
6138
6142
|
const clone = {
|
|
6139
6143
|
...src,
|
|
6140
|
-
id:
|
|
6144
|
+
id: chunkKDJBWJJH_js.makeSlideId(),
|
|
6141
6145
|
elements: src.elements.map((el) => ({
|
|
6142
6146
|
...el,
|
|
6143
6147
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6169,7 +6173,7 @@ function useSlideManagement(input) {
|
|
|
6169
6173
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6170
6174
|
const insertAt = activeSlideIndex + 1;
|
|
6171
6175
|
const draft = {
|
|
6172
|
-
...
|
|
6176
|
+
...chunkKDJBWJJH_js.createBlankSlide(slides.length + 1),
|
|
6173
6177
|
layoutPath,
|
|
6174
6178
|
...layoutName ? { layoutName } : {}
|
|
6175
6179
|
};
|
|
@@ -6230,7 +6234,7 @@ function createTableMergeHandlers(input) {
|
|
|
6230
6234
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6231
6235
|
return;
|
|
6232
6236
|
}
|
|
6233
|
-
const newTableData =
|
|
6237
|
+
const newTableData = chunkKDJBWJJH_js.mergeCells(
|
|
6234
6238
|
[
|
|
6235
6239
|
{ row: rowIndex, col: columnIndex },
|
|
6236
6240
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6238,7 +6242,7 @@ function createTableMergeHandlers(input) {
|
|
|
6238
6242
|
td
|
|
6239
6243
|
);
|
|
6240
6244
|
const updates = { tableData: newTableData };
|
|
6241
|
-
const newRawXml =
|
|
6245
|
+
const newRawXml = chunkKDJBWJJH_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6242
6246
|
if (newRawXml) {
|
|
6243
6247
|
updates.rawXml = newRawXml;
|
|
6244
6248
|
}
|
|
@@ -6264,7 +6268,7 @@ function createTableMergeHandlers(input) {
|
|
|
6264
6268
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6265
6269
|
return;
|
|
6266
6270
|
}
|
|
6267
|
-
const newTableData =
|
|
6271
|
+
const newTableData = chunkKDJBWJJH_js.mergeCells(
|
|
6268
6272
|
[
|
|
6269
6273
|
{ row: rowIndex, col: columnIndex },
|
|
6270
6274
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6272,7 +6276,7 @@ function createTableMergeHandlers(input) {
|
|
|
6272
6276
|
td
|
|
6273
6277
|
);
|
|
6274
6278
|
const updates = { tableData: newTableData };
|
|
6275
|
-
const newRawXml =
|
|
6279
|
+
const newRawXml = chunkKDJBWJJH_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6276
6280
|
if (newRawXml) {
|
|
6277
6281
|
updates.rawXml = newRawXml;
|
|
6278
6282
|
}
|
|
@@ -6287,9 +6291,9 @@ function createTableMergeHandlers(input) {
|
|
|
6287
6291
|
return;
|
|
6288
6292
|
}
|
|
6289
6293
|
const td = selectedElement.tableData;
|
|
6290
|
-
const newTableData =
|
|
6294
|
+
const newTableData = chunkKDJBWJJH_js.mergeCells(ts.selectedCells, td);
|
|
6291
6295
|
const updates = { tableData: newTableData };
|
|
6292
|
-
const newRawXml =
|
|
6296
|
+
const newRawXml = chunkKDJBWJJH_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6293
6297
|
if (newRawXml) {
|
|
6294
6298
|
updates.rawXml = newRawXml;
|
|
6295
6299
|
}
|
|
@@ -6306,9 +6310,9 @@ function createTableMergeHandlers(input) {
|
|
|
6306
6310
|
}
|
|
6307
6311
|
const { rowIndex, columnIndex } = ts;
|
|
6308
6312
|
const td = selectedElement.tableData;
|
|
6309
|
-
const newTableData =
|
|
6313
|
+
const newTableData = chunkKDJBWJJH_js.splitCell(rowIndex, columnIndex, td);
|
|
6310
6314
|
const updates = { tableData: newTableData };
|
|
6311
|
-
const newRawXml =
|
|
6315
|
+
const newRawXml = chunkKDJBWJJH_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6312
6316
|
if (newRawXml) {
|
|
6313
6317
|
updates.rawXml = newRawXml;
|
|
6314
6318
|
}
|
|
@@ -6352,7 +6356,7 @@ function createTableStructHandlers(input) {
|
|
|
6352
6356
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
6353
6357
|
}
|
|
6354
6358
|
if (el.rawXml) {
|
|
6355
|
-
const newRawXml =
|
|
6359
|
+
const newRawXml = chunkKDJBWJJH_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6356
6360
|
if (newRawXml) {
|
|
6357
6361
|
updates.rawXml = newRawXml;
|
|
6358
6362
|
}
|
|
@@ -6376,7 +6380,7 @@ function createTableStructHandlers(input) {
|
|
|
6376
6380
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6377
6381
|
const updates = {};
|
|
6378
6382
|
if (selectedElement.rawXml) {
|
|
6379
|
-
const newRawXml =
|
|
6383
|
+
const newRawXml = chunkKDJBWJJH_js.updateCellTextStyleInRawXml(
|
|
6380
6384
|
selectedElement,
|
|
6381
6385
|
rowIndex,
|
|
6382
6386
|
colIndex,
|
|
@@ -6440,9 +6444,9 @@ function createTableStructHandlers(input) {
|
|
|
6440
6444
|
return;
|
|
6441
6445
|
}
|
|
6442
6446
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6443
|
-
const newTableData =
|
|
6447
|
+
const newTableData = chunkKDJBWJJH_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6444
6448
|
const updates = { tableData: newTableData };
|
|
6445
|
-
const newRawXml =
|
|
6449
|
+
const newRawXml = chunkKDJBWJJH_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6446
6450
|
if (newRawXml) {
|
|
6447
6451
|
updates.rawXml = newRawXml;
|
|
6448
6452
|
}
|
|
@@ -6455,12 +6459,12 @@ function createTableStructHandlers(input) {
|
|
|
6455
6459
|
}
|
|
6456
6460
|
const td = selectedElement.tableData;
|
|
6457
6461
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6458
|
-
const newTableData =
|
|
6462
|
+
const newTableData = chunkKDJBWJJH_js.deleteTableRow(td, rowIdx);
|
|
6459
6463
|
if (newTableData === td) {
|
|
6460
6464
|
return;
|
|
6461
6465
|
}
|
|
6462
6466
|
const updates = { tableData: newTableData };
|
|
6463
|
-
const newRawXml =
|
|
6467
|
+
const newRawXml = chunkKDJBWJJH_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6464
6468
|
if (newRawXml) {
|
|
6465
6469
|
updates.rawXml = newRawXml;
|
|
6466
6470
|
}
|
|
@@ -6472,9 +6476,9 @@ function createTableStructHandlers(input) {
|
|
|
6472
6476
|
return;
|
|
6473
6477
|
}
|
|
6474
6478
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6475
|
-
const newTableData =
|
|
6479
|
+
const newTableData = chunkKDJBWJJH_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6476
6480
|
const updates = { tableData: newTableData };
|
|
6477
|
-
const newRawXml =
|
|
6481
|
+
const newRawXml = chunkKDJBWJJH_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6478
6482
|
if (newRawXml) {
|
|
6479
6483
|
updates.rawXml = newRawXml;
|
|
6480
6484
|
}
|
|
@@ -6487,12 +6491,12 @@ function createTableStructHandlers(input) {
|
|
|
6487
6491
|
}
|
|
6488
6492
|
const td = selectedElement.tableData;
|
|
6489
6493
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6490
|
-
const newTableData =
|
|
6494
|
+
const newTableData = chunkKDJBWJJH_js.deleteTableColumn(td, colIdx);
|
|
6491
6495
|
if (newTableData === td) {
|
|
6492
6496
|
return;
|
|
6493
6497
|
}
|
|
6494
6498
|
const updates = { tableData: newTableData };
|
|
6495
|
-
const newRawXml =
|
|
6499
|
+
const newRawXml = chunkKDJBWJJH_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6496
6500
|
if (newRawXml) {
|
|
6497
6501
|
updates.rawXml = newRawXml;
|
|
6498
6502
|
}
|
|
@@ -6528,8 +6532,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6528
6532
|
return html2canvasPro(element, {
|
|
6529
6533
|
...options,
|
|
6530
6534
|
onclone: async (doc, clonedEl) => {
|
|
6531
|
-
await
|
|
6532
|
-
|
|
6535
|
+
await chunkKDJBWJJH_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6536
|
+
chunkKDJBWJJH_js.preprocessCssForCapture(clonedEl);
|
|
6533
6537
|
if (typeof userOnClone === "function") {
|
|
6534
6538
|
userOnClone(doc, clonedEl);
|
|
6535
6539
|
}
|
|
@@ -6585,7 +6589,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6585
6589
|
}
|
|
6586
6590
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6587
6591
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6588
|
-
|
|
6592
|
+
chunkKDJBWJJH_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6589
6593
|
}
|
|
6590
6594
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6591
6595
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6607,15 +6611,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6607
6611
|
continue;
|
|
6608
6612
|
}
|
|
6609
6613
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6610
|
-
images.push(
|
|
6614
|
+
images.push(chunkKDJBWJJH_js.canvasToJpegData(canvas));
|
|
6611
6615
|
}
|
|
6612
6616
|
onProgress?.(totalSlides, totalSlides);
|
|
6613
6617
|
setActiveSlide(currentSlideIndex);
|
|
6614
6618
|
if (images.length === 0) {
|
|
6615
|
-
throw new Error(
|
|
6619
|
+
throw new Error(chunkIOVOQ6ZJ_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6616
6620
|
}
|
|
6617
|
-
const pdfBlobUrl =
|
|
6618
|
-
|
|
6621
|
+
const pdfBlobUrl = chunkFAP6OPLL_js.buildPdfFromImageData(images);
|
|
6622
|
+
chunkKDJBWJJH_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6619
6623
|
}
|
|
6620
6624
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6621
6625
|
const { scale = 2, onProgress } = options;
|
|
@@ -6661,10 +6665,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6661
6665
|
onProgress?.(totalSlides, totalSlides);
|
|
6662
6666
|
setActiveSlide(currentSlideIndex);
|
|
6663
6667
|
if (pages.length === 0) {
|
|
6664
|
-
throw new Error(
|
|
6668
|
+
throw new Error(chunkIOVOQ6ZJ_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6665
6669
|
}
|
|
6666
|
-
const pdfDataUrl =
|
|
6667
|
-
|
|
6670
|
+
const pdfDataUrl = chunkFAP6OPLL_js.buildNotesPdf(pages);
|
|
6671
|
+
chunkKDJBWJJH_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6668
6672
|
}
|
|
6669
6673
|
|
|
6670
6674
|
// src/viewer/utils/export-video.ts
|
|
@@ -6695,7 +6699,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6695
6699
|
}
|
|
6696
6700
|
setActiveSlide(currentSlideIndex);
|
|
6697
6701
|
if (slideCanvases.length === 0) {
|
|
6698
|
-
throw new Error(
|
|
6702
|
+
throw new Error(chunkIOVOQ6ZJ_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
6699
6703
|
}
|
|
6700
6704
|
const firstCanvas = slideCanvases[0];
|
|
6701
6705
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -6703,12 +6707,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6703
6707
|
recordingCanvas.height = firstCanvas.height;
|
|
6704
6708
|
const ctx = recordingCanvas.getContext("2d");
|
|
6705
6709
|
if (!ctx) {
|
|
6706
|
-
throw new Error(
|
|
6710
|
+
throw new Error(chunkIOVOQ6ZJ_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
6707
6711
|
}
|
|
6708
6712
|
const fps = 30;
|
|
6709
6713
|
const stream = recordingCanvas.captureStream(fps);
|
|
6710
6714
|
const recorder = new MediaRecorder(stream, {
|
|
6711
|
-
mimeType:
|
|
6715
|
+
mimeType: chunkKDJBWJJH_js.pickSupportedMimeType([...chunkKDJBWJJH_js.WEBM_MIME_CANDIDATES]),
|
|
6712
6716
|
videoBitsPerSecond: 5e6
|
|
6713
6717
|
});
|
|
6714
6718
|
const chunks = [];
|
|
@@ -6731,8 +6735,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6731
6735
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6732
6736
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6733
6737
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6734
|
-
const frameInterval =
|
|
6735
|
-
const framesNeeded =
|
|
6738
|
+
const frameInterval = chunkKDJBWJJH_js.fpsToFrameIntervalMs(fps);
|
|
6739
|
+
const framesNeeded = chunkKDJBWJJH_js.segmentFrameCount(duration, fps);
|
|
6736
6740
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6737
6741
|
if (signal?.aborted) {
|
|
6738
6742
|
recorder.stop();
|
|
@@ -6779,9 +6783,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6779
6783
|
}
|
|
6780
6784
|
setActiveSlide(currentSlideIndex);
|
|
6781
6785
|
if (frames.length === 0) {
|
|
6782
|
-
throw new Error(
|
|
6786
|
+
throw new Error(chunkIOVOQ6ZJ_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6783
6787
|
}
|
|
6784
|
-
const gifBytes =
|
|
6788
|
+
const gifBytes = chunkKDJBWJJH_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6785
6789
|
onProgress?.(totalSlides, totalSlides);
|
|
6786
6790
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6787
6791
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6835,7 +6839,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6835
6839
|
continue;
|
|
6836
6840
|
}
|
|
6837
6841
|
onProgress?.(processedCount, data.slides.length);
|
|
6838
|
-
let svg =
|
|
6842
|
+
let svg = chunkKDJBWJJH_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6839
6843
|
if (embedFonts && fontFaces?.length) {
|
|
6840
6844
|
svg = injectFontFaces(svg, fontFaces);
|
|
6841
6845
|
}
|
|
@@ -6895,7 +6899,7 @@ function useExportSaveAs(input) {
|
|
|
6895
6899
|
}
|
|
6896
6900
|
setExportProgress(70);
|
|
6897
6901
|
setExportStatusMessage("Writing README...");
|
|
6898
|
-
const readme =
|
|
6902
|
+
const readme = chunkKDJBWJJH_js.generatePackageReadme(pptxFilename);
|
|
6899
6903
|
pkgFolder.file("README.txt", readme);
|
|
6900
6904
|
if (abortCtrl.signal.aborted) {
|
|
6901
6905
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -6906,7 +6910,7 @@ function useExportSaveAs(input) {
|
|
|
6906
6910
|
setExportProgress(95);
|
|
6907
6911
|
setExportStatusMessage("Downloading...");
|
|
6908
6912
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
6909
|
-
|
|
6913
|
+
chunkKDJBWJJH_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
6910
6914
|
setExportProgress(100);
|
|
6911
6915
|
} catch (err) {
|
|
6912
6916
|
if (err.name !== "AbortError") {
|
|
@@ -6929,7 +6933,7 @@ function useExportSaveAs(input) {
|
|
|
6929
6933
|
const blob = new Blob([data], {
|
|
6930
6934
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6931
6935
|
});
|
|
6932
|
-
|
|
6936
|
+
chunkKDJBWJJH_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
6933
6937
|
} catch (err) {
|
|
6934
6938
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
6935
6939
|
}
|
|
@@ -6942,14 +6946,14 @@ function useExportSaveAs(input) {
|
|
|
6942
6946
|
const pptxGuides = guides.map((g) => ({
|
|
6943
6947
|
id: g.id,
|
|
6944
6948
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
6945
|
-
positionEmu:
|
|
6949
|
+
positionEmu: chunkKDJBWJJH_js.guidePxToEmu(g.position)
|
|
6946
6950
|
}));
|
|
6947
6951
|
return {
|
|
6948
6952
|
...slide,
|
|
6949
6953
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
6950
6954
|
};
|
|
6951
6955
|
});
|
|
6952
|
-
const slidesToSave =
|
|
6956
|
+
const slidesToSave = chunkFAP6OPLL_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
6953
6957
|
const saveOptions = {
|
|
6954
6958
|
headerFooter,
|
|
6955
6959
|
presentationProperties,
|
|
@@ -7006,7 +7010,7 @@ function safeConfirm(message) {
|
|
|
7006
7010
|
}
|
|
7007
7011
|
}
|
|
7008
7012
|
function downloadBlob2(blob, filename) {
|
|
7009
|
-
|
|
7013
|
+
chunkKDJBWJJH_js.downloadBlob(blob, chunkKDJBWJJH_js.sanitizeDownloadFilename(filename));
|
|
7010
7014
|
}
|
|
7011
7015
|
|
|
7012
7016
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7107,21 +7111,21 @@ function useExportHandlers(input) {
|
|
|
7107
7111
|
{
|
|
7108
7112
|
scale: 2,
|
|
7109
7113
|
onProgress: (current, total) => {
|
|
7110
|
-
setExportProgress(
|
|
7111
|
-
setExportStatusMessage(
|
|
7114
|
+
setExportProgress(chunkKDJBWJJH_js.slideProgressPercent(current, total));
|
|
7115
|
+
setExportStatusMessage(chunkKDJBWJJH_js.slideStatusLabel("Rendering", current, total));
|
|
7112
7116
|
},
|
|
7113
7117
|
signal: abortCtrl.signal
|
|
7114
7118
|
}
|
|
7115
7119
|
);
|
|
7116
|
-
setExportProgress(
|
|
7120
|
+
setExportProgress(chunkKDJBWJJH_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7117
7121
|
setExportStatusMessage("Building PDF...");
|
|
7118
7122
|
await new Promise((r) => {
|
|
7119
7123
|
setTimeout(r, 100);
|
|
7120
7124
|
});
|
|
7121
|
-
setExportProgress(
|
|
7125
|
+
setExportProgress(chunkKDJBWJJH_js.EXPORT_DONE_PERCENT);
|
|
7122
7126
|
setExportStatusMessage("Done!");
|
|
7123
7127
|
} catch (err) {
|
|
7124
|
-
if (!
|
|
7128
|
+
if (!chunkKDJBWJJH_js.isExportAbortError(err)) {
|
|
7125
7129
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7126
7130
|
}
|
|
7127
7131
|
} finally {
|
|
@@ -7151,21 +7155,21 @@ function useExportHandlers(input) {
|
|
|
7151
7155
|
{
|
|
7152
7156
|
scale: 2,
|
|
7153
7157
|
onProgress: (current, total) => {
|
|
7154
|
-
setExportProgress(
|
|
7155
|
-
setExportStatusMessage(
|
|
7158
|
+
setExportProgress(chunkKDJBWJJH_js.slideProgressPercent(current, total));
|
|
7159
|
+
setExportStatusMessage(chunkKDJBWJJH_js.slideStatusLabel("Rendering", current, total));
|
|
7156
7160
|
},
|
|
7157
7161
|
signal: abortCtrl.signal
|
|
7158
7162
|
}
|
|
7159
7163
|
);
|
|
7160
|
-
setExportProgress(
|
|
7164
|
+
setExportProgress(chunkKDJBWJJH_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7161
7165
|
setExportStatusMessage("Building PDF...");
|
|
7162
7166
|
await new Promise((r) => {
|
|
7163
7167
|
setTimeout(r, 100);
|
|
7164
7168
|
});
|
|
7165
|
-
setExportProgress(
|
|
7169
|
+
setExportProgress(chunkKDJBWJJH_js.EXPORT_DONE_PERCENT);
|
|
7166
7170
|
setExportStatusMessage("Done!");
|
|
7167
7171
|
} catch (err) {
|
|
7168
|
-
if (!
|
|
7172
|
+
if (!chunkKDJBWJJH_js.isExportAbortError(err)) {
|
|
7169
7173
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7170
7174
|
}
|
|
7171
7175
|
} finally {
|
|
@@ -7206,22 +7210,22 @@ function useExportHandlers(input) {
|
|
|
7206
7210
|
scale: 1,
|
|
7207
7211
|
slideDurationMs: 3e3,
|
|
7208
7212
|
onProgress: (current, total) => {
|
|
7209
|
-
setExportProgress(
|
|
7210
|
-
setExportStatusMessage(
|
|
7213
|
+
setExportProgress(chunkKDJBWJJH_js.slideProgressPercent(current, total, 45));
|
|
7214
|
+
setExportStatusMessage(chunkKDJBWJJH_js.slideStatusLabel("Capturing", current, total));
|
|
7211
7215
|
},
|
|
7212
7216
|
onRecordProgress: (current, total) => {
|
|
7213
|
-
setExportProgress(
|
|
7214
|
-
setExportStatusMessage(
|
|
7217
|
+
setExportProgress(chunkKDJBWJJH_js.recordProgressPercent(current, total));
|
|
7218
|
+
setExportStatusMessage(chunkKDJBWJJH_js.slideStatusLabel("Recording", current, total));
|
|
7215
7219
|
},
|
|
7216
7220
|
signal: abortCtrl.signal
|
|
7217
7221
|
}
|
|
7218
7222
|
);
|
|
7219
|
-
setExportProgress(
|
|
7223
|
+
setExportProgress(chunkKDJBWJJH_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7220
7224
|
setExportStatusMessage("Saving file...");
|
|
7221
7225
|
downloadBlob2(blob, "presentation.webm");
|
|
7222
|
-
setExportProgress(
|
|
7226
|
+
setExportProgress(chunkKDJBWJJH_js.EXPORT_DONE_PERCENT);
|
|
7223
7227
|
} catch (err) {
|
|
7224
|
-
if (!
|
|
7228
|
+
if (!chunkKDJBWJJH_js.isExportAbortError(err)) {
|
|
7225
7229
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7226
7230
|
}
|
|
7227
7231
|
} finally {
|
|
@@ -7249,18 +7253,18 @@ function useExportHandlers(input) {
|
|
|
7249
7253
|
scale: 0.5,
|
|
7250
7254
|
slideDurationMs: 2e3,
|
|
7251
7255
|
onProgress: (current, total) => {
|
|
7252
|
-
setExportProgress(
|
|
7253
|
-
setExportStatusMessage(
|
|
7256
|
+
setExportProgress(chunkKDJBWJJH_js.slideProgressPercent(current, total));
|
|
7257
|
+
setExportStatusMessage(chunkKDJBWJJH_js.slideStatusLabel("Encoding", current, total));
|
|
7254
7258
|
},
|
|
7255
7259
|
signal: abortCtrl.signal
|
|
7256
7260
|
}
|
|
7257
7261
|
);
|
|
7258
|
-
setExportProgress(
|
|
7262
|
+
setExportProgress(chunkKDJBWJJH_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7259
7263
|
setExportStatusMessage("Saving file...");
|
|
7260
7264
|
downloadBlob2(blob, "presentation.gif");
|
|
7261
|
-
setExportProgress(
|
|
7265
|
+
setExportProgress(chunkKDJBWJJH_js.EXPORT_DONE_PERCENT);
|
|
7262
7266
|
} catch (err) {
|
|
7263
|
-
if (!
|
|
7267
|
+
if (!chunkKDJBWJJH_js.isExportAbortError(err)) {
|
|
7264
7268
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7265
7269
|
}
|
|
7266
7270
|
} finally {
|
|
@@ -7300,7 +7304,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7300
7304
|
}
|
|
7301
7305
|
printWindow.document.open();
|
|
7302
7306
|
printWindow.document.write(
|
|
7303
|
-
|
|
7307
|
+
chunkKDJBWJJH_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7304
7308
|
);
|
|
7305
7309
|
printWindow.document.close();
|
|
7306
7310
|
printWindow.focus();
|
|
@@ -7361,7 +7365,7 @@ function usePrintHandlers(input) {
|
|
|
7361
7365
|
if (svgs.length === 0) {
|
|
7362
7366
|
return;
|
|
7363
7367
|
}
|
|
7364
|
-
const printDoc =
|
|
7368
|
+
const printDoc = chunkKDJBWJJH_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7365
7369
|
title: "Slides (Vector)",
|
|
7366
7370
|
orientation: settings.orientation,
|
|
7367
7371
|
colorFilter
|
|
@@ -7397,7 +7401,7 @@ function usePrintHandlers(input) {
|
|
|
7397
7401
|
if (settings.printWhat === "outline") {
|
|
7398
7402
|
openPrintWindow(
|
|
7399
7403
|
"Outline",
|
|
7400
|
-
`<div class="outline-page">${
|
|
7404
|
+
`<div class="outline-page">${chunkKDJBWJJH_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7401
7405
|
settings.orientation,
|
|
7402
7406
|
colorFilter,
|
|
7403
7407
|
settings.frameSlides
|
|
@@ -7422,7 +7426,7 @@ function usePrintHandlers(input) {
|
|
|
7422
7426
|
if (settings.printWhat === "slides") {
|
|
7423
7427
|
openPrintWindow(
|
|
7424
7428
|
"Slides",
|
|
7425
|
-
|
|
7429
|
+
chunkKDJBWJJH_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7426
7430
|
settings.orientation,
|
|
7427
7431
|
colorFilter,
|
|
7428
7432
|
settings.frameSlides
|
|
@@ -7432,7 +7436,7 @@ function usePrintHandlers(input) {
|
|
|
7432
7436
|
if (settings.printWhat === "notes") {
|
|
7433
7437
|
openPrintWindow(
|
|
7434
7438
|
"Notes Pages",
|
|
7435
|
-
|
|
7439
|
+
chunkKDJBWJJH_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7436
7440
|
"portrait",
|
|
7437
7441
|
colorFilter,
|
|
7438
7442
|
settings.frameSlides
|
|
@@ -7443,7 +7447,7 @@ function usePrintHandlers(input) {
|
|
|
7443
7447
|
const spp = settings.slidesPerPage;
|
|
7444
7448
|
openPrintWindow(
|
|
7445
7449
|
`Handout ${spp} per page`,
|
|
7446
|
-
|
|
7450
|
+
chunkKDJBWJJH_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7447
7451
|
"portrait",
|
|
7448
7452
|
colorFilter,
|
|
7449
7453
|
settings.frameSlides
|
|
@@ -7507,8 +7511,8 @@ function useThemeHandlers(input) {
|
|
|
7507
7511
|
return;
|
|
7508
7512
|
}
|
|
7509
7513
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7510
|
-
const previousMap = theme?.colorScheme ?
|
|
7511
|
-
setSlides((prev) =>
|
|
7514
|
+
const previousMap = theme?.colorScheme ? chunkKDJBWJJH_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7515
|
+
setSlides((prev) => chunkKDJBWJJH_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7512
7516
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7513
7517
|
bumpHistory();
|
|
7514
7518
|
history.markDirty();
|
|
@@ -7613,7 +7617,7 @@ function useThemeSwitching(input) {
|
|
|
7613
7617
|
}
|
|
7614
7618
|
try {
|
|
7615
7619
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7616
|
-
const newData =
|
|
7620
|
+
const newData = chunkKDJBWJJH_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7617
7621
|
onDataChange(newData);
|
|
7618
7622
|
onThemeChanged?.(preset);
|
|
7619
7623
|
} catch (error) {
|
|
@@ -7630,7 +7634,7 @@ function useThemeSwitching(input) {
|
|
|
7630
7634
|
}
|
|
7631
7635
|
try {
|
|
7632
7636
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7633
|
-
const newData =
|
|
7637
|
+
const newData = chunkKDJBWJJH_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7634
7638
|
onDataChange(newData);
|
|
7635
7639
|
} catch (error) {
|
|
7636
7640
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7642,12 +7646,12 @@ function useThemeSwitching(input) {
|
|
|
7642
7646
|
if (!data?.theme?.colorScheme) {
|
|
7643
7647
|
return void 0;
|
|
7644
7648
|
}
|
|
7645
|
-
return
|
|
7646
|
-
(p) =>
|
|
7649
|
+
return chunkKDJBWJJH_js.THEME_PRESETS.find(
|
|
7650
|
+
(p) => chunkKDJBWJJH_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7647
7651
|
);
|
|
7648
7652
|
}, [data?.theme?.colorScheme]);
|
|
7649
7653
|
return {
|
|
7650
|
-
presets:
|
|
7654
|
+
presets: chunkKDJBWJJH_js.THEME_PRESETS,
|
|
7651
7655
|
switchToPreset,
|
|
7652
7656
|
switchToCustom,
|
|
7653
7657
|
currentPreset
|
|
@@ -7722,7 +7726,7 @@ function usePropertyHandlers(input) {
|
|
|
7722
7726
|
}
|
|
7723
7727
|
try {
|
|
7724
7728
|
const ab = await file.arrayBuffer();
|
|
7725
|
-
const h = new
|
|
7729
|
+
const h = new chunkKDJBWJJH_js.PptxHandler();
|
|
7726
7730
|
const other = await h.load(ab);
|
|
7727
7731
|
if (!other) {
|
|
7728
7732
|
return;
|
|
@@ -7732,7 +7736,7 @@ function usePropertyHandlers(input) {
|
|
|
7732
7736
|
width: canvasSize.width,
|
|
7733
7737
|
height: canvasSize.height
|
|
7734
7738
|
};
|
|
7735
|
-
setCompareResult(
|
|
7739
|
+
setCompareResult(chunkKDJBWJJH_js.comparePresentation(cur, other));
|
|
7736
7740
|
setIsComparePanelOpen(true);
|
|
7737
7741
|
} catch (err) {
|
|
7738
7742
|
console.warn("Compare failed:", err);
|
|
@@ -7749,7 +7753,7 @@ function usePropertyHandlers(input) {
|
|
|
7749
7753
|
if (!diff || diff.status === "unchanged") {
|
|
7750
7754
|
return;
|
|
7751
7755
|
}
|
|
7752
|
-
setSlides((prev) =>
|
|
7756
|
+
setSlides((prev) => chunkKDJBWJJH_js.applyAcceptSlide(prev, diff));
|
|
7753
7757
|
setIsDirty(true);
|
|
7754
7758
|
},
|
|
7755
7759
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7760,10 +7764,10 @@ function usePropertyHandlers(input) {
|
|
|
7760
7764
|
if (!compareResult) {
|
|
7761
7765
|
return;
|
|
7762
7766
|
}
|
|
7763
|
-
setSlides((prev) =>
|
|
7767
|
+
setSlides((prev) => chunkKDJBWJJH_js.applyAcceptAllSlides(prev, compareResult));
|
|
7764
7768
|
setIsDirty(true);
|
|
7765
7769
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7766
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7770
|
+
const usedFontFamilies = react.useMemo(() => chunkKDJBWJJH_js.collectUsedFonts(slides), [slides]);
|
|
7767
7771
|
return {
|
|
7768
7772
|
handleUpdateNotes,
|
|
7769
7773
|
handleUpdateSlide,
|
|
@@ -7882,7 +7886,7 @@ function useIsMobile(input) {
|
|
|
7882
7886
|
const containerRef = input?.containerRef;
|
|
7883
7887
|
const isTouchDevice = react.useSyncExternalStore(
|
|
7884
7888
|
subscribeTouchCapability,
|
|
7885
|
-
|
|
7889
|
+
chunkKDJBWJJH_js.detectTouchDevice,
|
|
7886
7890
|
() => false
|
|
7887
7891
|
// server snapshot
|
|
7888
7892
|
);
|
|
@@ -7898,7 +7902,7 @@ function useIsMobile(input) {
|
|
|
7898
7902
|
}
|
|
7899
7903
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
7900
7904
|
});
|
|
7901
|
-
const [orientation, setOrientation] = react.useState(
|
|
7905
|
+
const [orientation, setOrientation] = react.useState(chunkKDJBWJJH_js.detectOrientation);
|
|
7902
7906
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
7903
7907
|
const [initialViewportHeight] = react.useState(
|
|
7904
7908
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -7942,7 +7946,7 @@ function useIsMobile(input) {
|
|
|
7942
7946
|
return;
|
|
7943
7947
|
}
|
|
7944
7948
|
const handleOrientationChange = () => {
|
|
7945
|
-
setOrientation(
|
|
7949
|
+
setOrientation(chunkKDJBWJJH_js.detectOrientation());
|
|
7946
7950
|
};
|
|
7947
7951
|
if (screen.orientation) {
|
|
7948
7952
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -7972,9 +7976,9 @@ function useIsMobile(input) {
|
|
|
7972
7976
|
window.addEventListener("resize", handleResize);
|
|
7973
7977
|
return () => window.removeEventListener("resize", handleResize);
|
|
7974
7978
|
}, [isTouchDevice, initialViewportHeight]);
|
|
7975
|
-
const isMobile =
|
|
7976
|
-
const isTablet = !isMobile && containerWidth >=
|
|
7977
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
7979
|
+
const isMobile = chunkKDJBWJJH_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
7980
|
+
const isTablet = !isMobile && containerWidth >= chunkKDJBWJJH_js.MOBILE_BREAKPOINT && containerWidth < chunkKDJBWJJH_js.TABLET_BREAKPOINT;
|
|
7981
|
+
const isDesktop = !isMobile && containerWidth >= chunkKDJBWJJH_js.TABLET_BREAKPOINT;
|
|
7978
7982
|
return {
|
|
7979
7983
|
isMobile,
|
|
7980
7984
|
isTablet,
|
|
@@ -8035,11 +8039,11 @@ function useViewerDialogs(input) {
|
|
|
8035
8039
|
);
|
|
8036
8040
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(false);
|
|
8037
8041
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8038
|
-
() => typeof window !== "undefined" ?
|
|
8042
|
+
() => typeof window !== "undefined" ? chunkKDJBWJJH_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8039
8043
|
);
|
|
8040
8044
|
react.useEffect(() => {
|
|
8041
8045
|
const handleWindow = () => setIsNarrowViewport(
|
|
8042
|
-
|
|
8046
|
+
chunkKDJBWJJH_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8043
8047
|
);
|
|
8044
8048
|
let observer = null;
|
|
8045
8049
|
let raf = 0;
|
|
@@ -8053,12 +8057,12 @@ function useViewerDialogs(input) {
|
|
|
8053
8057
|
const entry = entries[0];
|
|
8054
8058
|
if (entry) {
|
|
8055
8059
|
setIsNarrowViewport(
|
|
8056
|
-
|
|
8060
|
+
chunkKDJBWJJH_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8057
8061
|
);
|
|
8058
8062
|
}
|
|
8059
8063
|
});
|
|
8060
8064
|
observer.observe(el);
|
|
8061
|
-
setIsNarrowViewport(
|
|
8065
|
+
setIsNarrowViewport(chunkKDJBWJJH_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8062
8066
|
};
|
|
8063
8067
|
attach();
|
|
8064
8068
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8216,27 +8220,20 @@ function useViewerDialogs(input) {
|
|
|
8216
8220
|
}
|
|
8217
8221
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8218
8222
|
if (presentationGridSpacing) {
|
|
8219
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8223
|
+
const px = Math.round(presentationGridSpacing.cx / chunkFAP6OPLL_js.EMU_PER_PX);
|
|
8220
8224
|
if (px > 0) {
|
|
8221
8225
|
return px;
|
|
8222
8226
|
}
|
|
8223
8227
|
}
|
|
8224
|
-
return
|
|
8228
|
+
return chunkFAP6OPLL_js.GRID_SIZE;
|
|
8225
8229
|
}
|
|
8226
8230
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
if (show) {
|
|
8230
|
-
const rIdToIndex = /* @__PURE__ */ new Map();
|
|
8231
|
-
slides.forEach((s, i) => rIdToIndex.set(s.rId, i));
|
|
8232
|
-
return show.slideRIds.map((rId) => rIdToIndex.get(rId)).filter((i) => i !== void 0);
|
|
8233
|
-
}
|
|
8234
|
-
}
|
|
8235
|
-
return slides.map((_, i) => i).filter((i) => !slides[i]?.hidden);
|
|
8231
|
+
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8232
|
+
return chunkKDJBWJJH_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8236
8233
|
}
|
|
8237
8234
|
function computeSlideSectionGroups(slides, sections) {
|
|
8238
|
-
return
|
|
8239
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8235
|
+
return chunkKDJBWJJH_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8236
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkFAP6OPLL_js.UNGROUPED_SECTION_ID : "default"),
|
|
8240
8237
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8241
8238
|
slideIndexes: group.slideIndexes,
|
|
8242
8239
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8291,7 +8288,7 @@ function useDerivedSlideState(input) {
|
|
|
8291
8288
|
);
|
|
8292
8289
|
const slideSectionGroups = react.useMemo(
|
|
8293
8290
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8294
|
-
if (group.id ===
|
|
8291
|
+
if (group.id === chunkFAP6OPLL_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8295
8292
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8296
8293
|
}
|
|
8297
8294
|
if (group.id === "default" && group.label === "Slides") {
|
|
@@ -8394,13 +8391,13 @@ function useAnnotationHandlers(input) {
|
|
|
8394
8391
|
}, [annotations, setMode, setSlides, history]);
|
|
8395
8392
|
const handleSetMode = react.useCallback(
|
|
8396
8393
|
(nextMode) => {
|
|
8397
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8394
|
+
if (mode === "present" && nextMode !== "present" && !chunkKDJBWJJH_js.mayLeaveSlideShow()) {
|
|
8398
8395
|
return;
|
|
8399
8396
|
}
|
|
8400
8397
|
if (nextMode === "present") {
|
|
8401
8398
|
presentation.enterPresentMode();
|
|
8402
8399
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8403
|
-
|
|
8400
|
+
chunkFAP6OPLL_js.stopAllPersistentAudio();
|
|
8404
8401
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8405
8402
|
if (promptKeepInkAnnotations) {
|
|
8406
8403
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8409,7 +8406,7 @@ function useAnnotationHandlers(input) {
|
|
|
8409
8406
|
}
|
|
8410
8407
|
} else {
|
|
8411
8408
|
if (mode === "present") {
|
|
8412
|
-
|
|
8409
|
+
chunkFAP6OPLL_js.stopAllPersistentAudio();
|
|
8413
8410
|
}
|
|
8414
8411
|
setMode(nextMode);
|
|
8415
8412
|
}
|
|
@@ -8475,13 +8472,13 @@ function useSerialize(input) {
|
|
|
8475
8472
|
let processedSlide = slide;
|
|
8476
8473
|
if (pendingEditId) {
|
|
8477
8474
|
const updatedElements = slide.elements.map((el) => {
|
|
8478
|
-
if (el.id !== pendingEditId || !
|
|
8475
|
+
if (el.id !== pendingEditId || !chunkKDJBWJJH_js.hasTextProperties(el)) {
|
|
8479
8476
|
return el;
|
|
8480
8477
|
}
|
|
8481
8478
|
return {
|
|
8482
8479
|
...el,
|
|
8483
8480
|
text: pendingEditText,
|
|
8484
|
-
textSegments:
|
|
8481
|
+
textSegments: chunkKDJBWJJH_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8485
8482
|
};
|
|
8486
8483
|
});
|
|
8487
8484
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8494,14 +8491,14 @@ function useSerialize(input) {
|
|
|
8494
8491
|
const pptxGuides = guides.map((g) => ({
|
|
8495
8492
|
id: g.id,
|
|
8496
8493
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8497
|
-
positionEmu:
|
|
8494
|
+
positionEmu: chunkKDJBWJJH_js.guidePxToEmu(g.position)
|
|
8498
8495
|
}));
|
|
8499
8496
|
return {
|
|
8500
8497
|
...processedSlide,
|
|
8501
8498
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8502
8499
|
};
|
|
8503
8500
|
});
|
|
8504
|
-
const slidesToSave =
|
|
8501
|
+
const slidesToSave = chunkFAP6OPLL_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8505
8502
|
const saveOptions = {
|
|
8506
8503
|
headerFooter,
|
|
8507
8504
|
presentationProperties,
|
|
@@ -8670,7 +8667,7 @@ function usePresentationSetup(input) {
|
|
|
8670
8667
|
containerRef,
|
|
8671
8668
|
content,
|
|
8672
8669
|
onSetMode: (nextMode) => {
|
|
8673
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8670
|
+
if (mode === "present" && nextMode !== "present" && !chunkKDJBWJJH_js.mayLeaveSlideShow()) {
|
|
8674
8671
|
return;
|
|
8675
8672
|
}
|
|
8676
8673
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8678,7 +8675,7 @@ function usePresentationSetup(input) {
|
|
|
8678
8675
|
setShowKeepAnnotationsDialog(true);
|
|
8679
8676
|
} else {
|
|
8680
8677
|
if (mode === "present" && nextMode !== "present") {
|
|
8681
|
-
|
|
8678
|
+
chunkFAP6OPLL_js.stopAllPersistentAudio();
|
|
8682
8679
|
stopAnimationSound();
|
|
8683
8680
|
}
|
|
8684
8681
|
setMode(nextMode);
|
|
@@ -8732,10 +8729,10 @@ function usePresentationSetup(input) {
|
|
|
8732
8729
|
onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
|
|
8733
8730
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8734
8731
|
onSaveRehearsalTimings: (timings) => {
|
|
8735
|
-
setSlides((prev) =>
|
|
8732
|
+
setSlides((prev) => chunkKDJBWJJH_js.applyRehearsalTimings(prev, timings));
|
|
8736
8733
|
history.markDirty();
|
|
8737
8734
|
},
|
|
8738
|
-
loopContinuously:
|
|
8735
|
+
loopContinuously: chunkKDJBWJJH_js.shouldLoopContinuously(presentationProperties),
|
|
8739
8736
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8740
8737
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8741
8738
|
endWithBlackSlide
|
|
@@ -8897,7 +8894,7 @@ function useEditorOperations(input) {
|
|
|
8897
8894
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
8898
8895
|
react.useEffect(() => {
|
|
8899
8896
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
8900
|
-
copiedFormatRef.current =
|
|
8897
|
+
copiedFormatRef.current = chunkKDJBWJJH_js.copyFormatFromElement(selectedElement);
|
|
8901
8898
|
} else if (!formatPainterActive) {
|
|
8902
8899
|
copiedFormatRef.current = null;
|
|
8903
8900
|
}
|
|
@@ -8923,12 +8920,12 @@ function useEditorOperations(input) {
|
|
|
8923
8920
|
e.stopPropagation();
|
|
8924
8921
|
const element = elementLookup.get(elementId);
|
|
8925
8922
|
if (element) {
|
|
8926
|
-
const updated =
|
|
8923
|
+
const updated = chunkKDJBWJJH_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
8927
8924
|
const updates = {};
|
|
8928
|
-
if (
|
|
8925
|
+
if (chunkKDJBWJJH_js.hasShapeProperties(updated)) {
|
|
8929
8926
|
updates.shapeStyle = updated.shapeStyle;
|
|
8930
8927
|
}
|
|
8931
|
-
if (
|
|
8928
|
+
if (chunkKDJBWJJH_js.hasTextProperties(updated)) {
|
|
8932
8929
|
updates.textStyle = updated.textStyle;
|
|
8933
8930
|
}
|
|
8934
8931
|
ops.updateElementById(elementId, updates);
|
|
@@ -9075,7 +9072,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9075
9072
|
const families = /* @__PURE__ */ new Set();
|
|
9076
9073
|
for (const slide of slides) {
|
|
9077
9074
|
for (const el of slide.elements) {
|
|
9078
|
-
if (
|
|
9075
|
+
if (chunkKDJBWJJH_js.hasTextProperties(el) && el.textSegments) {
|
|
9079
9076
|
for (const seg of el.textSegments) {
|
|
9080
9077
|
if (seg.style.fontFamily) {
|
|
9081
9078
|
families.add(seg.style.fontFamily);
|
|
@@ -9287,13 +9284,13 @@ function useKeyboardShortcuts(input) {
|
|
|
9287
9284
|
inputRef.current = input;
|
|
9288
9285
|
const handleKeyDown = react.useCallback((e) => {
|
|
9289
9286
|
const current = inputRef.current;
|
|
9290
|
-
const { action, dx, dy } =
|
|
9287
|
+
const { action, dx, dy } = chunkKDJBWJJH_js.mapEditorKey(e, {
|
|
9291
9288
|
canEdit: current.canEdit,
|
|
9292
9289
|
isPresenting: current.mode !== "edit",
|
|
9293
9290
|
hasSelection: current.hasSelection,
|
|
9294
9291
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9295
9292
|
isDrawing: current.activeTool !== "select",
|
|
9296
|
-
isTextInputTarget:
|
|
9293
|
+
isTextInputTarget: chunkKDJBWJJH_js.isEditorTextInputTarget(e.target)
|
|
9297
9294
|
});
|
|
9298
9295
|
if (action === null) {
|
|
9299
9296
|
return;
|
|
@@ -9586,7 +9583,7 @@ function useViewerIntegration(input) {
|
|
|
9586
9583
|
return zoom.scale;
|
|
9587
9584
|
},
|
|
9588
9585
|
setZoom(level) {
|
|
9589
|
-
zoom.setScale(
|
|
9586
|
+
zoom.setScale(chunkKDJBWJJH_js.clampZoomScale(level));
|
|
9590
9587
|
},
|
|
9591
9588
|
zoomIn() {
|
|
9592
9589
|
zoom.handleZoomIn();
|
|
@@ -9801,7 +9798,7 @@ function useReducedMotion() {
|
|
|
9801
9798
|
}
|
|
9802
9799
|
function useViewerOptions() {
|
|
9803
9800
|
const storeRef = react.useRef(null);
|
|
9804
|
-
storeRef.current ??=
|
|
9801
|
+
storeRef.current ??= chunkKDJBWJJH_js.createViewerOptionsStore();
|
|
9805
9802
|
const store = storeRef.current;
|
|
9806
9803
|
const options = react.useSyncExternalStore(
|
|
9807
9804
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9810,9 +9807,9 @@ function useViewerOptions() {
|
|
|
9810
9807
|
);
|
|
9811
9808
|
return { optionsStore: store, options };
|
|
9812
9809
|
}
|
|
9813
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9810
|
+
var KNOWN_TAB_IDS = new Set(chunkKDJBWJJH_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9814
9811
|
function computeToolbarVisibility(hiddenActions) {
|
|
9815
|
-
const isHidden = (id) =>
|
|
9812
|
+
const isHidden = (id) => chunkKDJBWJJH_js.isActionHidden(id, hiddenActions);
|
|
9816
9813
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
9817
9814
|
return { isHidden, isTabVisible };
|
|
9818
9815
|
}
|
|
@@ -9897,12 +9894,12 @@ function useYjsDocumentSync({
|
|
|
9897
9894
|
return;
|
|
9898
9895
|
}
|
|
9899
9896
|
try {
|
|
9900
|
-
const handler = new
|
|
9897
|
+
const handler = new chunkKDJBWJJH_js.PptxHandler();
|
|
9901
9898
|
await handler.load(sourceBytes.buffer);
|
|
9902
|
-
const currentSlides =
|
|
9899
|
+
const currentSlides = chunkKDJBWJJH_js.readSlidesFromYDoc(
|
|
9903
9900
|
doc
|
|
9904
9901
|
);
|
|
9905
|
-
const slidesToSave =
|
|
9902
|
+
const slidesToSave = chunkFAP6OPLL_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
9906
9903
|
const bytes = await handler.save(slidesToSave);
|
|
9907
9904
|
config.onWriteBack(bytes);
|
|
9908
9905
|
} catch {
|
|
@@ -9917,7 +9914,7 @@ function useYjsDocumentSync({
|
|
|
9917
9914
|
if (!doc || !isConnected) {
|
|
9918
9915
|
return;
|
|
9919
9916
|
}
|
|
9920
|
-
const docSlides =
|
|
9917
|
+
const docSlides = chunkKDJBWJJH_js.readSlidesFromYDoc(
|
|
9921
9918
|
doc
|
|
9922
9919
|
);
|
|
9923
9920
|
if (docSlides.length === 0) {
|
|
@@ -9939,11 +9936,11 @@ function useYjsDocumentSync({
|
|
|
9939
9936
|
lastSyncedRef.current = serialized;
|
|
9940
9937
|
void (async () => {
|
|
9941
9938
|
const factories = await getFactories();
|
|
9942
|
-
|
|
9939
|
+
chunkKDJBWJJH_js.reconcileSlidesInYDoc(
|
|
9943
9940
|
slides,
|
|
9944
9941
|
doc,
|
|
9945
9942
|
factories,
|
|
9946
|
-
|
|
9943
|
+
chunkKDJBWJJH_js.LOCAL_SYNC_ORIGIN
|
|
9947
9944
|
);
|
|
9948
9945
|
scheduleWriteBack();
|
|
9949
9946
|
})();
|
|
@@ -9957,10 +9954,10 @@ function useYjsDocumentSync({
|
|
|
9957
9954
|
return;
|
|
9958
9955
|
}
|
|
9959
9956
|
const handleChange = (_events, transaction) => {
|
|
9960
|
-
if (transaction?.origin ===
|
|
9957
|
+
if (transaction?.origin === chunkKDJBWJJH_js.LOCAL_SYNC_ORIGIN) {
|
|
9961
9958
|
return;
|
|
9962
9959
|
}
|
|
9963
|
-
const remoteSlides =
|
|
9960
|
+
const remoteSlides = chunkKDJBWJJH_js.readSlidesFromYDoc(
|
|
9964
9961
|
doc
|
|
9965
9962
|
);
|
|
9966
9963
|
if (remoteSlides.length === 0) {
|
|
@@ -9976,7 +9973,7 @@ function useYjsDocumentSync({
|
|
|
9976
9973
|
isApplyingRemoteRef.current = false;
|
|
9977
9974
|
scheduleWriteBack();
|
|
9978
9975
|
};
|
|
9979
|
-
const unobserve =
|
|
9976
|
+
const unobserve = chunkKDJBWJJH_js.observeYDocSlides(
|
|
9980
9977
|
doc,
|
|
9981
9978
|
handleChange
|
|
9982
9979
|
);
|
|
@@ -10014,7 +10011,7 @@ function useBroadcastFollower({
|
|
|
10014
10011
|
if (!broadcaster) {
|
|
10015
10012
|
return;
|
|
10016
10013
|
}
|
|
10017
|
-
if (!
|
|
10014
|
+
if (!chunkKDJBWJJH_js.shouldAutoFollowBroadcaster({
|
|
10018
10015
|
localRole: collab.config.role,
|
|
10019
10016
|
broadcasterRole: broadcaster.role
|
|
10020
10017
|
})) {
|
|
@@ -10174,10 +10171,10 @@ function useTouchGestures(input) {
|
|
|
10174
10171
|
if (!el || !enabled) {
|
|
10175
10172
|
return;
|
|
10176
10173
|
}
|
|
10177
|
-
const recognizer =
|
|
10174
|
+
const recognizer = chunkKDJBWJJH_js.createTouchGestureRecognizer({
|
|
10178
10175
|
getScale: () => scaleRef.current,
|
|
10179
|
-
minScale:
|
|
10180
|
-
maxScale:
|
|
10176
|
+
minScale: chunkKDJBWJJH_js.MIN_ZOOM_SCALE,
|
|
10177
|
+
maxScale: chunkKDJBWJJH_js.MAX_ZOOM_SCALE,
|
|
10181
10178
|
callbacks: {
|
|
10182
10179
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10183
10180
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10217,7 +10214,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10217
10214
|
return;
|
|
10218
10215
|
}
|
|
10219
10216
|
const rect = active.getBoundingClientRect();
|
|
10220
|
-
const delta =
|
|
10217
|
+
const delta = chunkKDJBWJJH_js.computeScrollDelta(
|
|
10221
10218
|
{ top: rect.top, bottom: rect.bottom },
|
|
10222
10219
|
window.innerHeight,
|
|
10223
10220
|
keyboardInset
|
|
@@ -10237,8 +10234,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10237
10234
|
return;
|
|
10238
10235
|
}
|
|
10239
10236
|
const update = () => {
|
|
10240
|
-
const metrics =
|
|
10241
|
-
const inset = metrics ?
|
|
10237
|
+
const metrics = chunkKDJBWJJH_js.readViewportMetrics(window);
|
|
10238
|
+
const inset = metrics ? chunkKDJBWJJH_js.computeKeyboardInset(metrics) : 0;
|
|
10242
10239
|
setKeyboardInset(inset);
|
|
10243
10240
|
if (inset > 0) {
|
|
10244
10241
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10249,8 +10246,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10249
10246
|
vv.addEventListener("scroll", update);
|
|
10250
10247
|
const onFocusIn = () => {
|
|
10251
10248
|
window.requestAnimationFrame(() => {
|
|
10252
|
-
const metrics =
|
|
10253
|
-
const inset = metrics ?
|
|
10249
|
+
const metrics = chunkKDJBWJJH_js.readViewportMetrics(window);
|
|
10250
|
+
const inset = metrics ? chunkKDJBWJJH_js.computeKeyboardInset(metrics) : 0;
|
|
10254
10251
|
if (inset > 0) {
|
|
10255
10252
|
scrollFocusedIntoView(inset);
|
|
10256
10253
|
}
|
|
@@ -10263,7 +10260,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10263
10260
|
document.removeEventListener("focusin", onFocusIn);
|
|
10264
10261
|
};
|
|
10265
10262
|
}, [enabled]);
|
|
10266
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10263
|
+
return { keyboardInset, isKeyboardOpen: chunkKDJBWJJH_js.isKeyboardOpen(keyboardInset) };
|
|
10267
10264
|
}
|
|
10268
10265
|
|
|
10269
10266
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10290,7 +10287,7 @@ function buildCanvasProps(input) {
|
|
|
10290
10287
|
} = input;
|
|
10291
10288
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10292
10289
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10293
|
-
const fieldContext =
|
|
10290
|
+
const fieldContext = chunkKDJBWJJH_js.buildFieldSubstitutionContext({
|
|
10294
10291
|
headerFooter: s.headerFooter,
|
|
10295
10292
|
customProperties: s.customProperties,
|
|
10296
10293
|
slide: activeSlide
|
|
@@ -10300,13 +10297,13 @@ function buildCanvasProps(input) {
|
|
|
10300
10297
|
if (mode === "present") {
|
|
10301
10298
|
presentation.handlePresentationAction(action);
|
|
10302
10299
|
} else if (action.url) {
|
|
10303
|
-
|
|
10300
|
+
chunkKDJBWJJH_js.safeOpenUrl(action.url);
|
|
10304
10301
|
}
|
|
10305
10302
|
};
|
|
10306
10303
|
const handleHyperlinkClick = (url) => {
|
|
10307
|
-
if (
|
|
10304
|
+
if (chunkKDJBWJJH_js.isPpactionUrl(url)) {
|
|
10308
10305
|
if (mode === "present") {
|
|
10309
|
-
const parsed =
|
|
10306
|
+
const parsed = chunkKDJBWJJH_js.parsePpactionUrl(url);
|
|
10310
10307
|
if (parsed) {
|
|
10311
10308
|
presentation.handlePresentationAction({
|
|
10312
10309
|
action: parsed.action,
|
|
@@ -10316,7 +10313,7 @@ function buildCanvasProps(input) {
|
|
|
10316
10313
|
}
|
|
10317
10314
|
return;
|
|
10318
10315
|
}
|
|
10319
|
-
|
|
10316
|
+
chunkKDJBWJJH_js.safeOpenUrl(url);
|
|
10320
10317
|
};
|
|
10321
10318
|
return {
|
|
10322
10319
|
activeSlide: effectiveSlide,
|
|
@@ -10457,6 +10454,12 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10457
10454
|
return;
|
|
10458
10455
|
}
|
|
10459
10456
|
const current = activeSlide.animations ?? [];
|
|
10457
|
+
if (group === "motionPath") {
|
|
10458
|
+
propertyHandlers.handleUpdateSlide({
|
|
10459
|
+
animations: chunkKDJBWJJH_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10460
|
+
});
|
|
10461
|
+
return;
|
|
10462
|
+
}
|
|
10460
10463
|
const existing = current.find((a) => a.elementId === selectedElement.id);
|
|
10461
10464
|
const presetValue = preset;
|
|
10462
10465
|
if (existing) {
|
|
@@ -10514,6 +10517,7 @@ function buildToolbarProps(input) {
|
|
|
10514
10517
|
state: s,
|
|
10515
10518
|
selectedElement,
|
|
10516
10519
|
activeSlide,
|
|
10520
|
+
activeSlideIndex,
|
|
10517
10521
|
zoom,
|
|
10518
10522
|
history,
|
|
10519
10523
|
findReplace,
|
|
@@ -10646,7 +10650,7 @@ function buildToolbarProps(input) {
|
|
|
10646
10650
|
onOpenFile,
|
|
10647
10651
|
onOpenRecentFile,
|
|
10648
10652
|
onCreatePresentation: (templateId) => {
|
|
10649
|
-
s.setSlides(
|
|
10653
|
+
s.setSlides(chunkKDJBWJJH_js.createBackstagePresentation(templateId));
|
|
10650
10654
|
s.setActiveSlideIndex(0);
|
|
10651
10655
|
s.setSelectedElementId(null);
|
|
10652
10656
|
s.setSelectedElementIds([]);
|
|
@@ -10665,6 +10669,7 @@ function buildToolbarProps(input) {
|
|
|
10665
10669
|
onRunAccessibilityCheck: dialogs.handleRunAccessibilityCheck,
|
|
10666
10670
|
onToggleSlideSorter: () => s.setShowSlideSorter((p) => !p),
|
|
10667
10671
|
onOpenReadingView: () => s.setShowReadingView(true),
|
|
10672
|
+
onOpenOutlineView: () => s.setShowOutlineView(true),
|
|
10668
10673
|
onUpdateTextStyle: ops.updateSelectedTextStyle,
|
|
10669
10674
|
onTransformTextCase: ops.updateSelectedTextCase,
|
|
10670
10675
|
isOverflowMenuOpen: s.isOverflowMenuOpen,
|
|
@@ -10702,13 +10707,17 @@ function buildToolbarProps(input) {
|
|
|
10702
10707
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10703
10708
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10704
10709
|
formatPainterActive: s.formatPainterActive,
|
|
10705
|
-
canActivateFormatPainter:
|
|
10710
|
+
canActivateFormatPainter: chunkKDJBWJJH_js.hasCopyableFormat(selectedElement),
|
|
10706
10711
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10707
10712
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10708
10713
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
10709
10714
|
eyedropperActive: s.eyedropperActive,
|
|
10710
10715
|
onToggleEyedropper: () => s.setEyedropperActive((p) => !p),
|
|
10711
10716
|
onOpenSetUpSlideShow: () => dialogs.setIsSetUpSlideShowOpen(true),
|
|
10717
|
+
// PowerPoint's Hide Slide: skip the active slide during the show while
|
|
10718
|
+
// leaving it in the deck, the rail and the sorter.
|
|
10719
|
+
onToggleHideSlide: () => slideOps.handleToggleHideSlides([activeSlideIndex]),
|
|
10720
|
+
activeSlideHidden: Boolean(activeSlide?.hidden),
|
|
10712
10721
|
onOpenBroadcastDialog: () => dialogs.setIsBroadcastDialogOpen(true),
|
|
10713
10722
|
onToggleSubtitles: dialogs.handleToggleSubtitles,
|
|
10714
10723
|
showSubtitles: Boolean(s.presentationProperties.showSubtitles),
|
|
@@ -10778,10 +10787,12 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
10778
10787
|
activeMaster: state.activeMaster,
|
|
10779
10788
|
presentationGridSpacing: state.presentationProperties.gridSpacing
|
|
10780
10789
|
});
|
|
10790
|
+
const { options: viewerOptions } = useViewerOptions();
|
|
10781
10791
|
const { presentation, annotations, actionSoundHandlerRef } = usePresentationSetup({
|
|
10782
10792
|
mode,
|
|
10783
10793
|
slides,
|
|
10784
10794
|
visibleSlideIndexes,
|
|
10795
|
+
endWithBlackSlide: viewerOptions.advanced.slideShowEndWithBlackSlide,
|
|
10785
10796
|
activeSlideIndex,
|
|
10786
10797
|
containerRef,
|
|
10787
10798
|
content,
|
|
@@ -10965,7 +10976,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
10965
10976
|
}, [incomingContent]);
|
|
10966
10977
|
const onOpenFile = react.useCallback(() => {
|
|
10967
10978
|
void (async () => {
|
|
10968
|
-
const picked = await
|
|
10979
|
+
const picked = await chunkKDJBWJJH_js.openPptxFile();
|
|
10969
10980
|
if (picked) {
|
|
10970
10981
|
setContent(picked.buffer);
|
|
10971
10982
|
}
|
|
@@ -10973,7 +10984,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
10973
10984
|
}, []);
|
|
10974
10985
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
10975
10986
|
void (async () => {
|
|
10976
|
-
const bytes = await
|
|
10987
|
+
const bytes = await chunkKDJBWJJH_js.readBackstageRecentFile(key);
|
|
10977
10988
|
if (bytes) {
|
|
10978
10989
|
setContent(bytes);
|
|
10979
10990
|
}
|
|
@@ -11037,6 +11048,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11037
11048
|
printHandlers,
|
|
11038
11049
|
propertyHandlers,
|
|
11039
11050
|
dialogs,
|
|
11051
|
+
activeSlideIndex,
|
|
11040
11052
|
slideOps: editorOps.slideOps,
|
|
11041
11053
|
ops: editorOps.ops,
|
|
11042
11054
|
onSetMode: handleSetMode,
|