pptx-react-viewer 2.1.0 → 2.2.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 +8 -0
- package/dist/{AiChatPanel-VCCVHAAI.js → AiChatPanel-O4NYWO3D.js} +24 -24
- package/dist/AiChatPanel-O4NYWO3D.js.br +0 -0
- package/dist/AiChatPanel-O4NYWO3D.js.gz +0 -0
- package/dist/{AiChatPanel-RFBZWMUE.mjs → AiChatPanel-XRKEPXAM.mjs} +5 -5
- package/dist/AiChatPanel-XRKEPXAM.mjs.br +0 -0
- package/dist/AiChatPanel-XRKEPXAM.mjs.gz +0 -0
- package/dist/{Model3DScene-RQIGSYGQ.js → Model3DScene-HYE6HA2C.js} +3 -3
- package/dist/{Model3DScene-RQIGSYGQ.js.br → Model3DScene-HYE6HA2C.js.br} +0 -0
- package/dist/Model3DScene-HYE6HA2C.js.gz +0 -0
- package/dist/{Model3DScene-2M6HVWTE.mjs → Model3DScene-JN5F5C4Z.mjs} +2 -2
- package/dist/Model3DScene-JN5F5C4Z.mjs.br +0 -0
- package/dist/Model3DScene-JN5F5C4Z.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-2FVASQGC.js → SurfaceChart3DScene-FDJ6LC4E.js} +3 -3
- package/dist/SurfaceChart3DScene-FDJ6LC4E.js.br +0 -0
- package/dist/SurfaceChart3DScene-FDJ6LC4E.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-EGMWY4CZ.mjs → SurfaceChart3DScene-V7P3LQVV.mjs} +2 -2
- package/dist/{SurfaceChart3DScene-EGMWY4CZ.mjs.br → SurfaceChart3DScene-V7P3LQVV.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-V7P3LQVV.mjs.gz +0 -0
- package/dist/{chunk-46Z6MNRS.js → chunk-2QHCOESN.js} +137 -42
- package/dist/chunk-2QHCOESN.js.br +0 -0
- package/dist/chunk-2QHCOESN.js.gz +0 -0
- package/dist/{chunk-LDF77JJD.js → chunk-2U243ZEP.js} +248 -248
- package/dist/chunk-2U243ZEP.js.br +0 -0
- package/dist/chunk-2U243ZEP.js.gz +0 -0
- package/dist/{chunk-27XBWVO5.mjs → chunk-6G6S7PEI.mjs} +95 -2
- package/dist/chunk-6G6S7PEI.mjs.br +0 -0
- package/dist/{chunk-27XBWVO5.mjs.gz → chunk-6G6S7PEI.mjs.gz} +0 -0
- package/dist/{chunk-NGE7YQTF.mjs → chunk-7NSLKNCT.mjs} +68 -74
- package/dist/chunk-7NSLKNCT.mjs.br +0 -0
- package/dist/chunk-7NSLKNCT.mjs.gz +0 -0
- package/dist/{chunk-BHVCED34.mjs → chunk-I2HF7ZPO.mjs} +1 -1
- package/dist/chunk-I2HF7ZPO.mjs.br +0 -0
- package/dist/chunk-I2HF7ZPO.mjs.gz +0 -0
- package/dist/{chunk-ZRY7NLKS.js → chunk-K2AW5UXT.js} +375 -381
- package/dist/chunk-K2AW5UXT.js.br +0 -0
- package/dist/chunk-K2AW5UXT.js.gz +0 -0
- package/dist/{chunk-7DQHWPIB.mjs → chunk-O75FHZQJ.mjs} +4 -4
- package/dist/chunk-O75FHZQJ.mjs.br +0 -0
- package/dist/chunk-O75FHZQJ.mjs.gz +0 -0
- package/dist/{chunk-6YXLGMTN.mjs → chunk-PE2I5L6R.mjs} +27 -12
- package/dist/chunk-PE2I5L6R.mjs.br +0 -0
- package/dist/{chunk-6YXLGMTN.mjs.gz → chunk-PE2I5L6R.mjs.gz} +0 -0
- package/dist/{chunk-2X72MOPZ.mjs → chunk-PZTPX3HK.mjs} +10 -1
- package/dist/chunk-PZTPX3HK.mjs.br +0 -0
- package/dist/chunk-PZTPX3HK.mjs.gz +0 -0
- package/dist/{chunk-VHO53ZXZ.js → chunk-QULJW7LU.js} +1190 -917
- package/dist/chunk-QULJW7LU.js.br +0 -0
- package/dist/chunk-QULJW7LU.js.gz +0 -0
- package/dist/{chunk-CLNGAVNH.js → chunk-R2H3FHK6.js} +27 -12
- package/dist/chunk-R2H3FHK6.js.br +0 -0
- package/dist/{chunk-CLNGAVNH.js.gz → chunk-R2H3FHK6.js.gz} +0 -0
- package/dist/{chunk-Y4OSELBT.mjs → chunk-RYHBWTPI.mjs} +350 -77
- package/dist/chunk-RYHBWTPI.mjs.br +0 -0
- package/dist/chunk-RYHBWTPI.mjs.gz +0 -0
- package/dist/{chunk-SYPHGLIB.js → chunk-XJTWUXXC.js} +3 -3
- package/dist/chunk-XJTWUXXC.js.br +0 -0
- package/dist/chunk-XJTWUXXC.js.gz +0 -0
- package/dist/{chunk-CUUYYYC5.js → chunk-YIFO3WQO.js} +10 -1
- package/dist/chunk-YIFO3WQO.js.br +0 -0
- package/dist/chunk-YIFO3WQO.js.gz +0 -0
- package/dist/{dist-J6PC54PZ.mjs → dist-VEWYRBTB.mjs} +1 -1
- package/dist/dist-VEWYRBTB.mjs.br +0 -0
- package/dist/dist-VEWYRBTB.mjs.gz +0 -0
- package/dist/{dist-4LUVI3SW.js → dist-ZCJLIRYG.js} +568 -568
- package/dist/dist-ZCJLIRYG.js.br +0 -0
- package/dist/dist-ZCJLIRYG.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-nAyIdGqF.d.ts → index-CDCSXtK3.d.ts} +32 -16
- package/dist/index-CDCSXtK3.d.ts.map +1 -0
- package/dist/index.js +37 -37
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +7 -7
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +42 -14
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +80 -80
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +5 -5
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/viewer/index.js +23 -23
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +7 -7
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-RFBZWMUE.mjs.br +0 -0
- package/dist/AiChatPanel-RFBZWMUE.mjs.gz +0 -0
- package/dist/AiChatPanel-VCCVHAAI.js.br +0 -0
- package/dist/AiChatPanel-VCCVHAAI.js.gz +0 -0
- package/dist/Model3DScene-2M6HVWTE.mjs.br +0 -0
- package/dist/Model3DScene-2M6HVWTE.mjs.gz +0 -0
- package/dist/Model3DScene-RQIGSYGQ.js.gz +0 -0
- package/dist/SurfaceChart3DScene-2FVASQGC.js.br +0 -0
- package/dist/SurfaceChart3DScene-2FVASQGC.js.gz +0 -0
- package/dist/SurfaceChart3DScene-EGMWY4CZ.mjs.gz +0 -0
- package/dist/chunk-27XBWVO5.mjs.br +0 -0
- package/dist/chunk-2X72MOPZ.mjs.br +0 -0
- package/dist/chunk-2X72MOPZ.mjs.gz +0 -0
- package/dist/chunk-46Z6MNRS.js.br +0 -0
- package/dist/chunk-46Z6MNRS.js.gz +0 -0
- package/dist/chunk-6YXLGMTN.mjs.br +0 -0
- package/dist/chunk-7DQHWPIB.mjs.br +0 -0
- package/dist/chunk-7DQHWPIB.mjs.gz +0 -0
- package/dist/chunk-BHVCED34.mjs.br +0 -0
- package/dist/chunk-BHVCED34.mjs.gz +0 -0
- package/dist/chunk-CLNGAVNH.js.br +0 -0
- package/dist/chunk-CUUYYYC5.js.br +0 -0
- package/dist/chunk-CUUYYYC5.js.gz +0 -0
- package/dist/chunk-LDF77JJD.js.br +0 -0
- package/dist/chunk-LDF77JJD.js.gz +0 -0
- package/dist/chunk-NGE7YQTF.mjs.br +0 -0
- package/dist/chunk-NGE7YQTF.mjs.gz +0 -0
- package/dist/chunk-SYPHGLIB.js.br +0 -0
- package/dist/chunk-SYPHGLIB.js.gz +0 -0
- package/dist/chunk-VHO53ZXZ.js.br +0 -0
- package/dist/chunk-VHO53ZXZ.js.gz +0 -0
- package/dist/chunk-Y4OSELBT.mjs.br +0 -0
- package/dist/chunk-Y4OSELBT.mjs.gz +0 -0
- package/dist/chunk-ZRY7NLKS.js.br +0 -0
- package/dist/chunk-ZRY7NLKS.js.gz +0 -0
- package/dist/dist-4LUVI3SW.js.br +0 -0
- package/dist/dist-4LUVI3SW.js.gz +0 -0
- package/dist/dist-J6PC54PZ.mjs.br +0 -0
- package/dist/dist-J6PC54PZ.mjs.gz +0 -0
- package/dist/index-nAyIdGqF.d.ts.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunk2U243ZEP_js = require('./chunk-2U243ZEP.js');
|
|
4
|
+
var chunk2QHCOESN_js = require('./chunk-2QHCOESN.js');
|
|
5
|
+
var chunkYIFO3WQO_js = require('./chunk-YIFO3WQO.js');
|
|
6
|
+
var chunkR2H3FHK6_js = require('./chunk-R2H3FHK6.js');
|
|
7
7
|
var react = require('react');
|
|
8
8
|
var JSZip = require('jszip');
|
|
9
9
|
var reactI18next = require('react-i18next');
|
|
@@ -15,7 +15,7 @@ var JSZip__default = /*#__PURE__*/_interopDefault(JSZip);
|
|
|
15
15
|
function useVirtualizedSlides({
|
|
16
16
|
totalItems,
|
|
17
17
|
itemHeight,
|
|
18
|
-
overscan =
|
|
18
|
+
overscan = chunk2QHCOESN_js.DEFAULT_VIRTUAL_OVERSCAN
|
|
19
19
|
}) {
|
|
20
20
|
const scrollContainerRef = react.useRef(null);
|
|
21
21
|
const [scrollTop, setScrollTop] = react.useState(0);
|
|
@@ -45,7 +45,7 @@ function useVirtualizedSlides({
|
|
|
45
45
|
resizeObserver?.disconnect();
|
|
46
46
|
};
|
|
47
47
|
}, []);
|
|
48
|
-
const range =
|
|
48
|
+
const range = chunk2QHCOESN_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
|
|
49
49
|
const safeItemHeight = Math.max(itemHeight, 1);
|
|
50
50
|
const scrollToIndex = react.useCallback(
|
|
51
51
|
(index, behavior = "smooth") => {
|
|
@@ -108,7 +108,7 @@ function usePresenceTracking({
|
|
|
108
108
|
awareness.setLocalStateField("presence", state);
|
|
109
109
|
lastBroadcastRef.current = Date.now();
|
|
110
110
|
};
|
|
111
|
-
if (elapsed >=
|
|
111
|
+
if (elapsed >= chunk2QHCOESN_js.BROADCAST_THROTTLE_MS) {
|
|
112
112
|
if (pendingBroadcastRef.current) {
|
|
113
113
|
clearTimeout(pendingBroadcastRef.current);
|
|
114
114
|
pendingBroadcastRef.current = null;
|
|
@@ -118,7 +118,7 @@ function usePresenceTracking({
|
|
|
118
118
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
119
119
|
pendingBroadcastRef.current = null;
|
|
120
120
|
flush();
|
|
121
|
-
},
|
|
121
|
+
}, chunk2QHCOESN_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
124
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -143,7 +143,7 @@ function usePresenceTracking({
|
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
145
|
const handleChange = () => {
|
|
146
|
-
const users =
|
|
146
|
+
const users = chunk2QHCOESN_js.derivePresenceList(
|
|
147
147
|
awareness.getStates(),
|
|
148
148
|
localClientId,
|
|
149
149
|
canvasWidth,
|
|
@@ -195,7 +195,7 @@ function useYjsProvider({ config }) {
|
|
|
195
195
|
const departureRef = react.useRef(null);
|
|
196
196
|
const gateRef = react.useRef(null);
|
|
197
197
|
if (!gateRef.current) {
|
|
198
|
-
gateRef.current =
|
|
198
|
+
gateRef.current = chunk2QHCOESN_js.createSyncGate(() => setSynced(true));
|
|
199
199
|
}
|
|
200
200
|
const teardown = react.useCallback(() => {
|
|
201
201
|
if (timeoutRef.current) {
|
|
@@ -215,7 +215,7 @@ function useYjsProvider({ config }) {
|
|
|
215
215
|
const buildCleanup = react.useCallback(
|
|
216
216
|
(provider, yDoc) => () => {
|
|
217
217
|
announceDeparture();
|
|
218
|
-
|
|
218
|
+
chunk2QHCOESN_js.clearLocalAwareness(provider.awareness);
|
|
219
219
|
provider.destroy();
|
|
220
220
|
yDoc.destroy();
|
|
221
221
|
setDoc(null);
|
|
@@ -240,9 +240,9 @@ function useYjsProvider({ config }) {
|
|
|
240
240
|
if (config.authToken) {
|
|
241
241
|
opts.password = config.authToken;
|
|
242
242
|
}
|
|
243
|
-
const roomId =
|
|
243
|
+
const roomId = chunk2QHCOESN_js.validateRoomId(config.roomId);
|
|
244
244
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
245
|
-
departureRef.current =
|
|
245
|
+
departureRef.current = chunk2QHCOESN_js.createDepartureChannel(roomId, provider.awareness);
|
|
246
246
|
setDoc(yDoc);
|
|
247
247
|
setAwareness(provider.awareness);
|
|
248
248
|
setClientId(provider.awareness.clientID);
|
|
@@ -284,13 +284,13 @@ function useYjsProvider({ config }) {
|
|
|
284
284
|
if (!config) {
|
|
285
285
|
return;
|
|
286
286
|
}
|
|
287
|
-
const roomId =
|
|
288
|
-
const transport = config.transport ??
|
|
287
|
+
const roomId = chunk2QHCOESN_js.validateRoomId(config.roomId);
|
|
288
|
+
const transport = config.transport ?? chunk2QHCOESN_js.resolveTransportForServerUrl(config.serverUrl);
|
|
289
289
|
if (transport === "webrtc") {
|
|
290
290
|
await initWebrtc();
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
293
|
+
if (chunk2QHCOESN_js.isMixedContentBlocked(config.serverUrl)) {
|
|
294
294
|
console.warn(
|
|
295
295
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
296
296
|
);
|
|
@@ -304,7 +304,7 @@ function useYjsProvider({ config }) {
|
|
|
304
304
|
const provider = new WebsocketProvider(config.serverUrl, roomId, yDoc, {
|
|
305
305
|
params: config.authToken ? { token: config.authToken } : void 0
|
|
306
306
|
});
|
|
307
|
-
departureRef.current =
|
|
307
|
+
departureRef.current = chunk2QHCOESN_js.createDepartureChannel(roomId, provider.awareness);
|
|
308
308
|
let connected = false;
|
|
309
309
|
const handleStatus = (event) => {
|
|
310
310
|
if (event.status === "connected") {
|
|
@@ -344,7 +344,7 @@ function useYjsProvider({ config }) {
|
|
|
344
344
|
provider.off("status", handleStatus);
|
|
345
345
|
provider.off("sync", handleSynced);
|
|
346
346
|
announceDeparture();
|
|
347
|
-
|
|
347
|
+
chunk2QHCOESN_js.clearLocalAwareness(provider.awareness);
|
|
348
348
|
provider.destroy();
|
|
349
349
|
yDoc.destroy();
|
|
350
350
|
setDoc(null);
|
|
@@ -353,7 +353,7 @@ function useYjsProvider({ config }) {
|
|
|
353
353
|
cleanupRef.current = null;
|
|
354
354
|
setStatus("error");
|
|
355
355
|
}
|
|
356
|
-
},
|
|
356
|
+
}, chunk2QHCOESN_js.CONNECTION_TIMEOUT_MS);
|
|
357
357
|
}
|
|
358
358
|
setDoc(yDoc);
|
|
359
359
|
setAwareness(provider.awareness);
|
|
@@ -362,7 +362,7 @@ function useYjsProvider({ config }) {
|
|
|
362
362
|
provider.off("status", handleStatus);
|
|
363
363
|
provider.off("sync", handleSynced);
|
|
364
364
|
announceDeparture();
|
|
365
|
-
|
|
365
|
+
chunk2QHCOESN_js.clearLocalAwareness(provider.awareness);
|
|
366
366
|
provider.destroy();
|
|
367
367
|
yDoc.destroy();
|
|
368
368
|
setDoc(null);
|
|
@@ -388,7 +388,7 @@ function useYjsProvider({ config }) {
|
|
|
388
388
|
]);
|
|
389
389
|
react.useEffect(() => {
|
|
390
390
|
init();
|
|
391
|
-
const disposeTeardown =
|
|
391
|
+
const disposeTeardown = chunk2QHCOESN_js.registerCollaborationTeardown({
|
|
392
392
|
leave: teardown,
|
|
393
393
|
rejoin: init
|
|
394
394
|
});
|
|
@@ -409,7 +409,7 @@ function useCollaborativeState({
|
|
|
409
409
|
canvasWidth,
|
|
410
410
|
canvasHeight
|
|
411
411
|
}) {
|
|
412
|
-
const userColor =
|
|
412
|
+
const userColor = chunk2QHCOESN_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
413
413
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
414
414
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
415
415
|
awareness,
|
|
@@ -518,8 +518,8 @@ function useEditorHistory(input) {
|
|
|
518
518
|
width: canvasSize.width,
|
|
519
519
|
height: canvasSize.height,
|
|
520
520
|
activeSlideIndex,
|
|
521
|
-
slides: slides.map(
|
|
522
|
-
templateElementsBySlideId:
|
|
521
|
+
slides: slides.map(chunk2QHCOESN_js.cloneSlide),
|
|
522
|
+
templateElementsBySlideId: chunk2QHCOESN_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
523
523
|
...actionLabel ? { actionLabel } : {}
|
|
524
524
|
};
|
|
525
525
|
},
|
|
@@ -532,9 +532,9 @@ function useEditorHistory(input) {
|
|
|
532
532
|
width: snapshot.width,
|
|
533
533
|
height: snapshot.height
|
|
534
534
|
});
|
|
535
|
-
setSlides(snapshot.slides.map(
|
|
535
|
+
setSlides(snapshot.slides.map(chunk2QHCOESN_js.cloneSlide));
|
|
536
536
|
setTemplateElementsBySlideId(
|
|
537
|
-
|
|
537
|
+
chunk2QHCOESN_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
538
538
|
);
|
|
539
539
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
540
540
|
setSelectedElementIds([]);
|
|
@@ -568,8 +568,8 @@ function useEditorHistory(input) {
|
|
|
568
568
|
const currentSnapshot = buildHistorySnapshot();
|
|
569
569
|
historyFutureRef.current.push(currentSnapshot);
|
|
570
570
|
isApplyingHistoryRef.current = true;
|
|
571
|
-
const nextSnapshot =
|
|
572
|
-
lastHistorySnapshotRef.current =
|
|
571
|
+
const nextSnapshot = chunk2U243ZEP_js.cloneHistorySnapshot(previousSnapshot);
|
|
572
|
+
lastHistorySnapshotRef.current = chunk2U243ZEP_js.cloneHistorySnapshot(nextSnapshot);
|
|
573
573
|
lastHistorySerializedRef.current = JSON.stringify(nextSnapshot);
|
|
574
574
|
applyHistorySnapshot(nextSnapshot);
|
|
575
575
|
updateHistoryAvailability();
|
|
@@ -590,8 +590,8 @@ function useEditorHistory(input) {
|
|
|
590
590
|
const currentSnapshot = buildHistorySnapshot();
|
|
591
591
|
historyPastRef.current.push(currentSnapshot);
|
|
592
592
|
isApplyingHistoryRef.current = true;
|
|
593
|
-
const targetSnapshot =
|
|
594
|
-
lastHistorySnapshotRef.current =
|
|
593
|
+
const targetSnapshot = chunk2U243ZEP_js.cloneHistorySnapshot(nextSnapshot);
|
|
594
|
+
lastHistorySnapshotRef.current = chunk2U243ZEP_js.cloneHistorySnapshot(targetSnapshot);
|
|
595
595
|
lastHistorySerializedRef.current = JSON.stringify(targetSnapshot);
|
|
596
596
|
applyHistorySnapshot(targetSnapshot);
|
|
597
597
|
updateHistoryAvailability();
|
|
@@ -609,7 +609,7 @@ function useEditorHistory(input) {
|
|
|
609
609
|
historyPastRef.current = [];
|
|
610
610
|
historyFutureRef.current = [];
|
|
611
611
|
if (initialSnapshot) {
|
|
612
|
-
const clonedInitial =
|
|
612
|
+
const clonedInitial = chunk2U243ZEP_js.cloneHistorySnapshot(initialSnapshot);
|
|
613
613
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
614
614
|
lastHistorySerializedRef.current = JSON.stringify(clonedInitial);
|
|
615
615
|
} else {
|
|
@@ -650,18 +650,18 @@ function useEditorHistory(input) {
|
|
|
650
650
|
}
|
|
651
651
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
652
652
|
if (!previousSnapshot) {
|
|
653
|
-
lastHistorySnapshotRef.current =
|
|
653
|
+
lastHistorySnapshotRef.current = chunk2U243ZEP_js.cloneHistorySnapshot(snapshot);
|
|
654
654
|
lastHistorySerializedRef.current = serialized;
|
|
655
655
|
lastCheapHashRef.current = cheapHash;
|
|
656
656
|
updateHistoryAvailability();
|
|
657
657
|
return;
|
|
658
658
|
}
|
|
659
|
-
historyPastRef.current.push(
|
|
659
|
+
historyPastRef.current.push(chunk2U243ZEP_js.cloneHistorySnapshot(previousSnapshot));
|
|
660
660
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
661
661
|
historyPastRef.current.shift();
|
|
662
662
|
}
|
|
663
663
|
historyFutureRef.current = [];
|
|
664
|
-
lastHistorySnapshotRef.current =
|
|
664
|
+
lastHistorySnapshotRef.current = chunk2U243ZEP_js.cloneHistorySnapshot(snapshot);
|
|
665
665
|
lastHistorySerializedRef.current = serialized;
|
|
666
666
|
lastCheapHashRef.current = cheapHash;
|
|
667
667
|
updateHistoryAvailability();
|
|
@@ -750,7 +750,7 @@ function useZoomViewport({
|
|
|
750
750
|
if (!wrapper || !canvasViewport) {
|
|
751
751
|
return;
|
|
752
752
|
}
|
|
753
|
-
const boundedScale = Math.min(Math.max(nextScale,
|
|
753
|
+
const boundedScale = Math.min(Math.max(nextScale, chunk2U243ZEP_js.MIN_ZOOM_SCALE), chunk2U243ZEP_js.MAX_ZOOM_SCALE);
|
|
754
754
|
const nextEditorScale = fitScale * boundedScale;
|
|
755
755
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
756
756
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -765,10 +765,10 @@ function useZoomViewport({
|
|
|
765
765
|
[fitScale]
|
|
766
766
|
);
|
|
767
767
|
const handleZoomIn = react.useCallback(() => {
|
|
768
|
-
setScale((currentScale) => Math.min(currentScale + 0.1,
|
|
768
|
+
setScale((currentScale) => Math.min(currentScale + 0.1, chunk2U243ZEP_js.MAX_ZOOM_SCALE));
|
|
769
769
|
}, []);
|
|
770
770
|
const handleZoomOut = react.useCallback(() => {
|
|
771
|
-
setScale((currentScale) => Math.max(currentScale - 0.1,
|
|
771
|
+
setScale((currentScale) => Math.max(currentScale - 0.1, chunk2U243ZEP_js.MIN_ZOOM_SCALE));
|
|
772
772
|
}, []);
|
|
773
773
|
const handleResetZoom = react.useCallback(() => {
|
|
774
774
|
setScale(1);
|
|
@@ -787,22 +787,22 @@ function useZoomViewport({
|
|
|
787
787
|
selectedElements.forEach((element) => {
|
|
788
788
|
minX = Math.min(minX, element.x);
|
|
789
789
|
minY = Math.min(minY, element.y);
|
|
790
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
791
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
790
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunk2U243ZEP_js.MIN_ELEMENT_SIZE));
|
|
791
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunk2U243ZEP_js.MIN_ELEMENT_SIZE));
|
|
792
792
|
});
|
|
793
793
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
794
794
|
return;
|
|
795
795
|
}
|
|
796
796
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
797
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
798
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
797
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunk2U243ZEP_js.MIN_ELEMENT_SIZE);
|
|
798
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunk2U243ZEP_js.MIN_ELEMENT_SIZE);
|
|
799
799
|
const availableWidth = Math.max(
|
|
800
|
-
effectiveEditorDimensions.width -
|
|
801
|
-
|
|
800
|
+
effectiveEditorDimensions.width - chunk2U243ZEP_js.ZOOM_TO_SELECTION_PADDING,
|
|
801
|
+
chunk2U243ZEP_js.MIN_ELEMENT_SIZE
|
|
802
802
|
);
|
|
803
803
|
const availableHeight = Math.max(
|
|
804
|
-
effectiveEditorDimensions.height -
|
|
805
|
-
|
|
804
|
+
effectiveEditorDimensions.height - chunk2U243ZEP_js.ZOOM_TO_SELECTION_PADDING,
|
|
805
|
+
chunk2U243ZEP_js.MIN_ELEMENT_SIZE
|
|
806
806
|
);
|
|
807
807
|
const targetEditorScale = Math.min(
|
|
808
808
|
availableWidth / boundsWidth,
|
|
@@ -810,8 +810,8 @@ function useZoomViewport({
|
|
|
810
810
|
);
|
|
811
811
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
812
812
|
const nextScale = Math.min(
|
|
813
|
-
Math.max(targetEditorScale / safeFitScale,
|
|
814
|
-
|
|
813
|
+
Math.max(targetEditorScale / safeFitScale, chunk2U243ZEP_js.MIN_ZOOM_SCALE),
|
|
814
|
+
chunk2U243ZEP_js.MAX_ZOOM_SCALE
|
|
815
815
|
);
|
|
816
816
|
setScale(nextScale);
|
|
817
817
|
window.requestAnimationFrame(() => {
|
|
@@ -833,7 +833,7 @@ function useZoomViewport({
|
|
|
833
833
|
event.preventDefault();
|
|
834
834
|
const delta = event.deltaY * -1e-3;
|
|
835
835
|
setScale(
|
|
836
|
-
(currentScale) => Math.min(Math.max(currentScale + delta,
|
|
836
|
+
(currentScale) => Math.min(Math.max(currentScale + delta, chunk2U243ZEP_js.MIN_ZOOM_SCALE), chunk2U243ZEP_js.MAX_ZOOM_SCALE)
|
|
837
837
|
);
|
|
838
838
|
}, []);
|
|
839
839
|
react.useEffect(() => {
|
|
@@ -911,7 +911,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
911
911
|
const command = step.command;
|
|
912
912
|
const timer = window.setTimeout(
|
|
913
913
|
() => {
|
|
914
|
-
|
|
914
|
+
chunk2U243ZEP_js.executeMediaCommand(command);
|
|
915
915
|
},
|
|
916
916
|
Math.max(0, step.delayMs)
|
|
917
917
|
);
|
|
@@ -1026,7 +1026,7 @@ function useAnimationPlayback(input) {
|
|
|
1026
1026
|
(controller, group) => {
|
|
1027
1027
|
driveBuildReveal(
|
|
1028
1028
|
controller,
|
|
1029
|
-
|
|
1029
|
+
chunk2QHCOESN_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1030
1030
|
setPresentationElementStates,
|
|
1031
1031
|
buildRafRef
|
|
1032
1032
|
);
|
|
@@ -1089,7 +1089,7 @@ function useAnimationPlayback(input) {
|
|
|
1089
1089
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1090
1090
|
return;
|
|
1091
1091
|
}
|
|
1092
|
-
const controller =
|
|
1092
|
+
const controller = chunk2QHCOESN_js.PresentationAnimationController.fromSlide(slide);
|
|
1093
1093
|
controllerRef.current = controller;
|
|
1094
1094
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1095
1095
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1226,7 +1226,7 @@ function useAnimationPlayback(input) {
|
|
|
1226
1226
|
}))
|
|
1227
1227
|
);
|
|
1228
1228
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1229
|
-
const delay =
|
|
1229
|
+
const delay = chunk2QHCOESN_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1230
1230
|
const timer = window.setTimeout(() => {
|
|
1231
1231
|
setPresentationAnimations(
|
|
1232
1232
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1262,12 +1262,12 @@ function useAnimationPlayback(input) {
|
|
|
1262
1262
|
presentationTimersRef
|
|
1263
1263
|
};
|
|
1264
1264
|
}
|
|
1265
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1266
|
-
var AUDIENCE_HASH =
|
|
1267
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1268
|
-
var AUDIENCE_NONCE_KEY =
|
|
1265
|
+
var PRESENTER_CHANNEL_NAME = chunk2QHCOESN_js.PRESENTATION_CHANNEL_NAME;
|
|
1266
|
+
var AUDIENCE_HASH = chunk2QHCOESN_js.PRESENTATION_HASH;
|
|
1267
|
+
var PRESENTER_MSG_ORIGIN = chunk2QHCOESN_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1268
|
+
var AUDIENCE_NONCE_KEY = chunk2QHCOESN_js.PRESENTATION_NONCE_KEY;
|
|
1269
1269
|
function generateSessionId() {
|
|
1270
|
-
return
|
|
1270
|
+
return chunk2QHCOESN_js.createPresentationSessionId();
|
|
1271
1271
|
}
|
|
1272
1272
|
function parseAudienceNonce() {
|
|
1273
1273
|
const hash = window.location.hash;
|
|
@@ -1303,7 +1303,7 @@ function usePresenterWindow(input) {
|
|
|
1303
1303
|
}, []);
|
|
1304
1304
|
const swapDisplays = react.useCallback(async () => {
|
|
1305
1305
|
const audience = audienceWindowRef.current;
|
|
1306
|
-
return audience && !audience.closed ?
|
|
1306
|
+
return audience && !audience.closed ? chunk2QHCOESN_js.swapPresentationWindows(window, audience) : false;
|
|
1307
1307
|
}, []);
|
|
1308
1308
|
const syncSlideToAudience = react.useCallback(
|
|
1309
1309
|
(slideIndex) => {
|
|
@@ -1367,7 +1367,7 @@ function usePresenterWindow(input) {
|
|
|
1367
1367
|
pollTimerRef.current = null;
|
|
1368
1368
|
}
|
|
1369
1369
|
if (closingSessionId) {
|
|
1370
|
-
void
|
|
1370
|
+
void chunk2QHCOESN_js.clearAudienceContent(closingSessionId);
|
|
1371
1371
|
}
|
|
1372
1372
|
}, [getChannel]);
|
|
1373
1373
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1385,10 +1385,10 @@ function usePresenterWindow(input) {
|
|
|
1385
1385
|
audienceWindowRef.current = blankWin;
|
|
1386
1386
|
const sessionId = generateSessionId();
|
|
1387
1387
|
sessionIdRef.current = sessionId;
|
|
1388
|
-
const audienceUrl =
|
|
1389
|
-
void
|
|
1388
|
+
const audienceUrl = chunk2QHCOESN_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1389
|
+
void chunk2QHCOESN_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1390
1390
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1391
|
-
|
|
1391
|
+
chunk2QHCOESN_js.placeAudienceWindow(blankWin, placement);
|
|
1392
1392
|
}
|
|
1393
1393
|
return void 0;
|
|
1394
1394
|
});
|
|
@@ -1418,7 +1418,7 @@ function usePresenterWindow(input) {
|
|
|
1418
1418
|
}
|
|
1419
1419
|
};
|
|
1420
1420
|
if (content) {
|
|
1421
|
-
void
|
|
1421
|
+
void chunk2QHCOESN_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1422
1422
|
} else {
|
|
1423
1423
|
navigateOrClose(true);
|
|
1424
1424
|
}
|
|
@@ -1444,7 +1444,7 @@ function usePresenterWindow(input) {
|
|
|
1444
1444
|
}
|
|
1445
1445
|
const handleMessage = (event) => {
|
|
1446
1446
|
const message = event.data;
|
|
1447
|
-
if (
|
|
1447
|
+
if (chunk2QHCOESN_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1448
1448
|
syncStateToAudience(snapshotRef.current);
|
|
1449
1449
|
}
|
|
1450
1450
|
};
|
|
@@ -1473,7 +1473,7 @@ function usePresenterWindow(input) {
|
|
|
1473
1473
|
react.useEffect(() => {
|
|
1474
1474
|
const handleBeforeUnload = () => {
|
|
1475
1475
|
if (sessionIdRef.current) {
|
|
1476
|
-
void
|
|
1476
|
+
void chunk2QHCOESN_js.clearAudienceContent(sessionIdRef.current);
|
|
1477
1477
|
}
|
|
1478
1478
|
};
|
|
1479
1479
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1526,7 +1526,7 @@ function useAudienceMode(input) {
|
|
|
1526
1526
|
}
|
|
1527
1527
|
channel.onmessage = (event) => {
|
|
1528
1528
|
const data = event.data;
|
|
1529
|
-
if (!
|
|
1529
|
+
if (!chunk2QHCOESN_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1530
1530
|
return;
|
|
1531
1531
|
}
|
|
1532
1532
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1541,7 +1541,7 @@ function useAudienceMode(input) {
|
|
|
1541
1541
|
}
|
|
1542
1542
|
if (data.type === "presenter-exit") {
|
|
1543
1543
|
if (expectedSessionId) {
|
|
1544
|
-
void
|
|
1544
|
+
void chunk2QHCOESN_js.clearAudienceContent(expectedSessionId);
|
|
1545
1545
|
}
|
|
1546
1546
|
onSetMode("edit");
|
|
1547
1547
|
try {
|
|
@@ -1552,7 +1552,7 @@ function useAudienceMode(input) {
|
|
|
1552
1552
|
};
|
|
1553
1553
|
if (expectedSessionId) {
|
|
1554
1554
|
channel.postMessage({
|
|
1555
|
-
origin:
|
|
1555
|
+
origin: chunk2QHCOESN_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1556
1556
|
type: "audience-ready",
|
|
1557
1557
|
sessionId: expectedSessionId
|
|
1558
1558
|
});
|
|
@@ -1565,53 +1565,18 @@ function useAudienceMode(input) {
|
|
|
1565
1565
|
};
|
|
1566
1566
|
}, [onSetMode, onSetActiveSlideIndex, onSnapshot]);
|
|
1567
1567
|
}
|
|
1568
|
-
|
|
1569
|
-
// src/viewer/hooks/presentation-mode/keyboard-helpers.ts
|
|
1570
|
-
function mapKeyToPresentationAction(key, ctrlKey) {
|
|
1571
|
-
if (key === "Escape") {
|
|
1572
|
-
return { action: "exit" };
|
|
1573
|
-
}
|
|
1574
|
-
if (key === "ArrowRight" || key === "PageDown" || key === " ") {
|
|
1575
|
-
return { action: "next" };
|
|
1576
|
-
}
|
|
1577
|
-
if (key === "ArrowLeft" || key === "PageUp") {
|
|
1578
|
-
return { action: "prev" };
|
|
1579
|
-
}
|
|
1580
|
-
if (key === "l" || key === "L") {
|
|
1581
|
-
return { action: "toggleLaser" };
|
|
1582
|
-
}
|
|
1583
|
-
if (key === "p" || key === "P") {
|
|
1584
|
-
return { action: "togglePen" };
|
|
1585
|
-
}
|
|
1586
|
-
if (key === "e" || key === "E") {
|
|
1587
|
-
return { action: "toggleEraser" };
|
|
1588
|
-
}
|
|
1589
|
-
if (key === "b" || key === "B") {
|
|
1590
|
-
return { action: "toggleBlackScreen" };
|
|
1591
|
-
}
|
|
1592
|
-
if (key === "w" || key === "W") {
|
|
1593
|
-
return { action: "toggleWhiteScreen" };
|
|
1594
|
-
}
|
|
1595
|
-
if (key === "m" && ctrlKey) {
|
|
1596
|
-
return { action: "toggleToolbar" };
|
|
1597
|
-
}
|
|
1598
|
-
if (key === "n" || key === "N") {
|
|
1599
|
-
return { action: "togglePresenterView" };
|
|
1600
|
-
}
|
|
1601
|
-
return { action: "none" };
|
|
1602
|
-
}
|
|
1603
|
-
|
|
1604
|
-
// src/viewer/hooks/presentation-mode/usePresentationKeyboard.ts
|
|
1605
1568
|
function usePresentationKeyboard(input) {
|
|
1606
1569
|
const {
|
|
1607
1570
|
mode,
|
|
1608
1571
|
movePresentationSlide,
|
|
1572
|
+
navigateToSlide,
|
|
1573
|
+
slideCount,
|
|
1609
1574
|
onSetMode,
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1575
|
+
onSetPointerTool,
|
|
1576
|
+
onEraseAnnotations,
|
|
1577
|
+
onToggleInkMarkup,
|
|
1613
1578
|
onToggleToolbar,
|
|
1614
|
-
|
|
1579
|
+
onShowAllSlides,
|
|
1615
1580
|
onToggleBlackScreen,
|
|
1616
1581
|
onToggleWhiteScreen,
|
|
1617
1582
|
rehearsing,
|
|
@@ -1619,18 +1584,20 @@ function usePresentationKeyboard(input) {
|
|
|
1619
1584
|
presentationSlideIndex,
|
|
1620
1585
|
setShowRehearsalSummary
|
|
1621
1586
|
} = input;
|
|
1587
|
+
const keyBufferRef = react.useRef(chunk2QHCOESN_js.createPresentationKeyBuffer());
|
|
1622
1588
|
react.useEffect(() => {
|
|
1623
1589
|
if (mode !== "present") {
|
|
1590
|
+
keyBufferRef.current = chunk2QHCOESN_js.createPresentationKeyBuffer();
|
|
1624
1591
|
return;
|
|
1625
1592
|
}
|
|
1626
1593
|
const handleKeyDown = (event) => {
|
|
1627
|
-
const mapped =
|
|
1594
|
+
const mapped = chunk2QHCOESN_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1628
1595
|
if (mapped.action === "none") {
|
|
1629
1596
|
return;
|
|
1630
1597
|
}
|
|
1631
1598
|
event.preventDefault();
|
|
1632
1599
|
switch (mapped.action) {
|
|
1633
|
-
case "
|
|
1600
|
+
case "end":
|
|
1634
1601
|
if (rehearsing) {
|
|
1635
1602
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1636
1603
|
setShowRehearsalSummary(true);
|
|
@@ -1640,27 +1607,40 @@ function usePresentationKeyboard(input) {
|
|
|
1640
1607
|
case "next":
|
|
1641
1608
|
movePresentationSlide(1);
|
|
1642
1609
|
return;
|
|
1643
|
-
case "
|
|
1610
|
+
case "previous":
|
|
1644
1611
|
movePresentationSlide(-1);
|
|
1645
1612
|
return;
|
|
1646
|
-
case "
|
|
1647
|
-
|
|
1613
|
+
case "first":
|
|
1614
|
+
navigateToSlide(0);
|
|
1615
|
+
return;
|
|
1616
|
+
case "last":
|
|
1617
|
+
navigateToSlide(Math.max(0, slideCount - 1));
|
|
1648
1618
|
return;
|
|
1649
|
-
case "
|
|
1650
|
-
|
|
1619
|
+
case "goto": {
|
|
1620
|
+
const index = mapped.slideNumber - 1;
|
|
1621
|
+
if (index >= 0 && index < slideCount) {
|
|
1622
|
+
navigateToSlide(index);
|
|
1623
|
+
}
|
|
1651
1624
|
return;
|
|
1652
|
-
|
|
1653
|
-
|
|
1625
|
+
}
|
|
1626
|
+
case "pointerTool":
|
|
1627
|
+
onSetPointerTool?.(mapped.tool);
|
|
1654
1628
|
return;
|
|
1655
|
-
case "
|
|
1629
|
+
case "eraseAnnotations":
|
|
1630
|
+
onEraseAnnotations?.();
|
|
1631
|
+
return;
|
|
1632
|
+
case "toggleInkMarkup":
|
|
1633
|
+
onToggleInkMarkup?.();
|
|
1634
|
+
return;
|
|
1635
|
+
case "toggleChrome":
|
|
1656
1636
|
onToggleToolbar?.();
|
|
1657
1637
|
return;
|
|
1658
|
-
case "
|
|
1659
|
-
|
|
1660
|
-
|
|
1638
|
+
case "showAllSlides":
|
|
1639
|
+
onShowAllSlides?.();
|
|
1640
|
+
return;
|
|
1661
1641
|
case "toggleBlackScreen":
|
|
1662
1642
|
onToggleBlackScreen?.();
|
|
1663
|
-
|
|
1643
|
+
return;
|
|
1664
1644
|
case "toggleWhiteScreen":
|
|
1665
1645
|
onToggleWhiteScreen?.();
|
|
1666
1646
|
break;
|
|
@@ -1673,12 +1653,14 @@ function usePresentationKeyboard(input) {
|
|
|
1673
1653
|
}, [
|
|
1674
1654
|
mode,
|
|
1675
1655
|
movePresentationSlide,
|
|
1656
|
+
navigateToSlide,
|
|
1657
|
+
slideCount,
|
|
1676
1658
|
onSetMode,
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1659
|
+
onSetPointerTool,
|
|
1660
|
+
onEraseAnnotations,
|
|
1661
|
+
onToggleInkMarkup,
|
|
1680
1662
|
onToggleToolbar,
|
|
1681
|
-
|
|
1663
|
+
onShowAllSlides,
|
|
1682
1664
|
onToggleBlackScreen,
|
|
1683
1665
|
onToggleWhiteScreen,
|
|
1684
1666
|
rehearsing,
|
|
@@ -1817,7 +1799,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1817
1799
|
return;
|
|
1818
1800
|
}
|
|
1819
1801
|
if (action.url && !actionStr.includes("hlinksldjump")) {
|
|
1820
|
-
if (
|
|
1802
|
+
if (chunk2QHCOESN_js.isUrlSafe(action.url)) {
|
|
1821
1803
|
window.open(action.url, "_blank", "noopener,noreferrer");
|
|
1822
1804
|
}
|
|
1823
1805
|
}
|
|
@@ -1827,7 +1809,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1827
1809
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1828
1810
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1829
1811
|
const transition = incomingSlide?.transition;
|
|
1830
|
-
const durationMs = deps.playTransition ?
|
|
1812
|
+
const durationMs = deps.playTransition ? chunk2QHCOESN_js.resolveTransitionDurationMs(transition) : 0;
|
|
1831
1813
|
deps.clearPresentationTimers();
|
|
1832
1814
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1833
1815
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -2073,17 +2055,17 @@ function useZoomNavigation(input) {
|
|
|
2073
2055
|
};
|
|
2074
2056
|
}
|
|
2075
2057
|
function usePresenterConsole(slideIndex) {
|
|
2076
|
-
const timerRef = react.useRef(
|
|
2077
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2058
|
+
const timerRef = react.useRef(chunk2QHCOESN_js.createPresenterTimer());
|
|
2059
|
+
const [snapshot, setSnapshot] = react.useState(() => chunk2QHCOESN_js.createInitialPresentationSnapshot(slideIndex));
|
|
2078
2060
|
const patch = react.useCallback((value) => {
|
|
2079
|
-
setSnapshot((current) =>
|
|
2061
|
+
setSnapshot((current) => chunk2QHCOESN_js.mergePresentationSnapshot(current, value));
|
|
2080
2062
|
}, []);
|
|
2081
2063
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2082
2064
|
react.useEffect(() => {
|
|
2083
2065
|
const timer = window.setInterval(() => {
|
|
2084
2066
|
patch({
|
|
2085
2067
|
paused: timerRef.current.paused,
|
|
2086
|
-
elapsedMs:
|
|
2068
|
+
elapsedMs: chunk2QHCOESN_js.presenterElapsed(timerRef.current)
|
|
2087
2069
|
});
|
|
2088
2070
|
}, 1e3);
|
|
2089
2071
|
return () => window.clearInterval(timer);
|
|
@@ -2093,19 +2075,19 @@ function usePresenterConsole(slideIndex) {
|
|
|
2093
2075
|
applyAudienceSnapshot: setSnapshot,
|
|
2094
2076
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2095
2077
|
toggleTimer: () => {
|
|
2096
|
-
timerRef.current =
|
|
2078
|
+
timerRef.current = chunk2QHCOESN_js.togglePresenterTimer(timerRef.current);
|
|
2097
2079
|
patch({
|
|
2098
2080
|
paused: timerRef.current.paused,
|
|
2099
|
-
elapsedMs:
|
|
2081
|
+
elapsedMs: chunk2QHCOESN_js.presenterElapsed(timerRef.current)
|
|
2100
2082
|
});
|
|
2101
2083
|
},
|
|
2102
2084
|
resetTimer: () => {
|
|
2103
|
-
timerRef.current =
|
|
2085
|
+
timerRef.current = chunk2QHCOESN_js.resetPresenterTimer();
|
|
2104
2086
|
patch({ paused: false, elapsedMs: 0 });
|
|
2105
2087
|
},
|
|
2106
2088
|
stepZoom: (direction) => setSnapshot(
|
|
2107
|
-
(current) =>
|
|
2108
|
-
zoom:
|
|
2089
|
+
(current) => chunk2QHCOESN_js.mergePresentationSnapshot(current, {
|
|
2090
|
+
zoom: chunk2QHCOESN_js.stepPresenterZoom(
|
|
2109
2091
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2110
2092
|
direction
|
|
2111
2093
|
)
|
|
@@ -2130,9 +2112,9 @@ function usePresentationMode(input) {
|
|
|
2130
2112
|
onSetMode,
|
|
2131
2113
|
onSetActiveSlideIndex,
|
|
2132
2114
|
onPlayActionSound,
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2115
|
+
onSetPointerTool,
|
|
2116
|
+
onEraseAnnotations,
|
|
2117
|
+
onToggleInkMarkup,
|
|
2136
2118
|
onToggleToolbar,
|
|
2137
2119
|
onSaveRehearsalTimings,
|
|
2138
2120
|
loopContinuously,
|
|
@@ -2147,6 +2129,7 @@ function usePresentationMode(input) {
|
|
|
2147
2129
|
setTransitionOverlay(null);
|
|
2148
2130
|
}, []);
|
|
2149
2131
|
const [presenterMode, setPresenterMode] = react.useState(false);
|
|
2132
|
+
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2150
2133
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2151
2134
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2152
2135
|
const switchingToPresenterRef = react.useRef(false);
|
|
@@ -2231,6 +2214,8 @@ function usePresentationMode(input) {
|
|
|
2231
2214
|
[endOfShowVisible, moveNavigationSlide, onSetMode]
|
|
2232
2215
|
);
|
|
2233
2216
|
const { handleZoomClick, zoomReturnSlideIndex, returnToZoomSlide, clearZoomReturn } = useZoomNavigation({ navigateToSlide });
|
|
2217
|
+
const openAllSlides = react.useCallback(() => setAllSlidesOpen(true), []);
|
|
2218
|
+
const closeAllSlides = react.useCallback(() => setAllSlidesOpen(false), []);
|
|
2234
2219
|
const presenterConsole = usePresenterConsole(presentationSlideIndex);
|
|
2235
2220
|
const {
|
|
2236
2221
|
openAudienceWindow,
|
|
@@ -2303,12 +2288,14 @@ function usePresentationMode(input) {
|
|
|
2303
2288
|
usePresentationKeyboard({
|
|
2304
2289
|
mode,
|
|
2305
2290
|
movePresentationSlide,
|
|
2291
|
+
navigateToSlide,
|
|
2292
|
+
slideCount: slides.length,
|
|
2306
2293
|
onSetMode,
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2294
|
+
onSetPointerTool,
|
|
2295
|
+
onEraseAnnotations,
|
|
2296
|
+
onToggleInkMarkup,
|
|
2310
2297
|
onToggleToolbar,
|
|
2311
|
-
|
|
2298
|
+
onShowAllSlides: openAllSlides,
|
|
2312
2299
|
onToggleBlackScreen: () => presenterConsole.setBlackout(
|
|
2313
2300
|
presenterConsole.snapshot.blackout === "black" ? "none" : "black"
|
|
2314
2301
|
),
|
|
@@ -2408,6 +2395,9 @@ function usePresentationMode(input) {
|
|
|
2408
2395
|
clearPresentationTimers,
|
|
2409
2396
|
runPresentationEntranceAnimations,
|
|
2410
2397
|
endOfShowVisible,
|
|
2398
|
+
allSlidesOpen,
|
|
2399
|
+
openAllSlides,
|
|
2400
|
+
closeAllSlides,
|
|
2411
2401
|
movePresentationSlide,
|
|
2412
2402
|
navigateToSlide,
|
|
2413
2403
|
handlePresentationAction,
|
|
@@ -2468,6 +2458,7 @@ function usePresentationAnnotations(input) {
|
|
|
2468
2458
|
const [currentStroke, setCurrentStroke] = react.useState(null);
|
|
2469
2459
|
const [laserPosition, setLaserPosition] = react.useState(null);
|
|
2470
2460
|
const [toolbarVisible, setToolbarVisible] = react.useState(false);
|
|
2461
|
+
const [inkMarkupVisible, setInkMarkupVisible] = react.useState(true);
|
|
2471
2462
|
const slideAnnotationsRef = react.useRef(/* @__PURE__ */ new Map());
|
|
2472
2463
|
const [annotationStrokes, setAnnotationStrokes] = react.useState([]);
|
|
2473
2464
|
const [annotationVersion, setAnnotationVersion] = react.useState(0);
|
|
@@ -2653,6 +2644,8 @@ function usePresentationAnnotations(input) {
|
|
|
2653
2644
|
laserPosition,
|
|
2654
2645
|
toolbarVisible,
|
|
2655
2646
|
setToolbarVisible,
|
|
2647
|
+
inkMarkupVisible,
|
|
2648
|
+
setInkMarkupVisible,
|
|
2656
2649
|
handlePointerDown,
|
|
2657
2650
|
handlePointerMove,
|
|
2658
2651
|
handlePointerUp,
|
|
@@ -2673,7 +2666,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2673
2666
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2674
2667
|
slides.forEach((slide, slideIndex) => {
|
|
2675
2668
|
for (const element of slide.elements || []) {
|
|
2676
|
-
if (!
|
|
2669
|
+
if (!chunkR2H3FHK6_js.hasTextProperties(element)) {
|
|
2677
2670
|
continue;
|
|
2678
2671
|
}
|
|
2679
2672
|
const segments = element.textSegments ?? [];
|
|
@@ -2724,7 +2717,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2724
2717
|
continue;
|
|
2725
2718
|
}
|
|
2726
2719
|
const element = slide.elements[elIdx];
|
|
2727
|
-
if (!
|
|
2720
|
+
if (!chunkR2H3FHK6_js.hasTextProperties(element)) {
|
|
2728
2721
|
continue;
|
|
2729
2722
|
}
|
|
2730
2723
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3322,7 +3315,7 @@ function useViewerCoreState(_input) {
|
|
|
3322
3315
|
const shapeAdjustmentDragStateRef = react.useRef(null);
|
|
3323
3316
|
const marqueeStateRef = react.useRef(null);
|
|
3324
3317
|
const isDrawingRef = react.useRef(false);
|
|
3325
|
-
const livePatcher = react.useMemo(() =>
|
|
3318
|
+
const livePatcher = react.useMemo(() => chunk2QHCOESN_js.createCollaborationLivePatcher(), []);
|
|
3326
3319
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3327
3320
|
const slidesRef = react.useRef([]);
|
|
3328
3321
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3331,8 +3324,8 @@ function useViewerCoreState(_input) {
|
|
|
3331
3324
|
const [slides, setSlides] = react.useState([]);
|
|
3332
3325
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3333
3326
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3334
|
-
width:
|
|
3335
|
-
height:
|
|
3327
|
+
width: chunk2U243ZEP_js.DEFAULT_CANVAS_WIDTH,
|
|
3328
|
+
height: chunk2U243ZEP_js.DEFAULT_CANVAS_HEIGHT
|
|
3336
3329
|
});
|
|
3337
3330
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
3338
3331
|
const [selectedElementId, setSelectedElementId] = react.useState(null);
|
|
@@ -3352,7 +3345,7 @@ function useViewerCoreState(_input) {
|
|
|
3352
3345
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3353
3346
|
inlineEditingTextRef.current = resolved;
|
|
3354
3347
|
setInlineEditingTextBase(value);
|
|
3355
|
-
|
|
3348
|
+
chunk2QHCOESN_js.publishLiveInlineText(
|
|
3356
3349
|
livePatcher,
|
|
3357
3350
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3358
3351
|
inlineEditingElementIdRef.current,
|
|
@@ -3677,7 +3670,7 @@ function useLoadContent({
|
|
|
3677
3670
|
);
|
|
3678
3671
|
}
|
|
3679
3672
|
const previousHandler = handlerRef.current;
|
|
3680
|
-
const handler = new
|
|
3673
|
+
const handler = new chunkR2H3FHK6_js.PptxHandler();
|
|
3681
3674
|
const parsed = await handler.load(buffer);
|
|
3682
3675
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3683
3676
|
handler.dispose();
|
|
@@ -3689,7 +3682,7 @@ function useLoadContent({
|
|
|
3689
3682
|
handlerRef.current = null;
|
|
3690
3683
|
const mediaElements = [];
|
|
3691
3684
|
for (const slide of parsed.slides) {
|
|
3692
|
-
|
|
3685
|
+
chunk2QHCOESN_js.collectMediaElements(slide.elements, mediaElements);
|
|
3693
3686
|
}
|
|
3694
3687
|
for (const url of mediaDataUrls.values()) {
|
|
3695
3688
|
if (url.startsWith("blob:")) {
|
|
@@ -3730,7 +3723,7 @@ function useLoadContent({
|
|
|
3730
3723
|
}
|
|
3731
3724
|
})
|
|
3732
3725
|
);
|
|
3733
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3726
|
+
const { paths: imagePaths, refs: imageRefs } = chunk2QHCOESN_js.collectImagePaths(parsed.slides);
|
|
3734
3727
|
let nextSlides = parsed.slides;
|
|
3735
3728
|
if (imagePaths.size > 0) {
|
|
3736
3729
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3785,12 +3778,12 @@ function useLoadContent({
|
|
|
3785
3778
|
}
|
|
3786
3779
|
}
|
|
3787
3780
|
handlerRef.current = handler;
|
|
3788
|
-
const partition =
|
|
3781
|
+
const partition = chunk2U243ZEP_js.partitionTemplateElements(nextSlides);
|
|
3789
3782
|
setSlides(partition.slides);
|
|
3790
3783
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3791
3784
|
setCanvasSize({
|
|
3792
|
-
width: parsed.width ??
|
|
3793
|
-
height: parsed.height ??
|
|
3785
|
+
width: parsed.width ?? chunk2U243ZEP_js.DEFAULT_CANVAS_WIDTH,
|
|
3786
|
+
height: parsed.height ?? chunk2U243ZEP_js.DEFAULT_CANVAS_HEIGHT
|
|
3794
3787
|
});
|
|
3795
3788
|
setHeaderFooter(parsed.headerFooter ?? {});
|
|
3796
3789
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
@@ -3819,7 +3812,7 @@ function useLoadContent({
|
|
|
3819
3812
|
setHasMacros(parsed.hasMacros === true);
|
|
3820
3813
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3821
3814
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3822
|
-
setGuides(
|
|
3815
|
+
setGuides(chunk2QHCOESN_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3823
3816
|
setActiveSlideIndex(0);
|
|
3824
3817
|
clearSelection();
|
|
3825
3818
|
setIsDirty(false);
|
|
@@ -3827,7 +3820,7 @@ function useLoadContent({
|
|
|
3827
3820
|
onContentApplied?.();
|
|
3828
3821
|
} catch (err) {
|
|
3829
3822
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3830
|
-
if (err instanceof
|
|
3823
|
+
if (err instanceof chunkR2H3FHK6_js.EncryptedFileError) {
|
|
3831
3824
|
setIsEncrypted(true);
|
|
3832
3825
|
} else {
|
|
3833
3826
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3904,7 +3897,7 @@ function useAutosave(input) {
|
|
|
3904
3897
|
isSavingRef.current = false;
|
|
3905
3898
|
return;
|
|
3906
3899
|
}
|
|
3907
|
-
await
|
|
3900
|
+
await chunk2QHCOESN_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
3908
3901
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
3909
3902
|
} catch (err) {
|
|
3910
3903
|
setAutosaveStatus({
|
|
@@ -3969,7 +3962,7 @@ function useElementOperations(input) {
|
|
|
3969
3962
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
3970
3963
|
const updateElementById = react.useCallback(
|
|
3971
3964
|
(elementId, updates) => {
|
|
3972
|
-
if (
|
|
3965
|
+
if (chunk2QHCOESN_js.isTemplateElementId(elementId)) {
|
|
3973
3966
|
const slideId = activeSlide?.id;
|
|
3974
3967
|
if (slideId) {
|
|
3975
3968
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4009,7 +4002,7 @@ function useElementOperations(input) {
|
|
|
4009
4002
|
);
|
|
4010
4003
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4011
4004
|
(updates) => {
|
|
4012
|
-
if (!selectedElement || !
|
|
4005
|
+
if (!selectedElement || !chunkR2H3FHK6_js.hasShapeProperties(selectedElement)) {
|
|
4013
4006
|
return;
|
|
4014
4007
|
}
|
|
4015
4008
|
updateSelectedElement({
|
|
@@ -4020,17 +4013,17 @@ function useElementOperations(input) {
|
|
|
4020
4013
|
);
|
|
4021
4014
|
const updateSelectedTextStyle = react.useCallback(
|
|
4022
4015
|
(updates) => {
|
|
4023
|
-
if (!selectedElement || !
|
|
4016
|
+
if (!selectedElement || !chunkR2H3FHK6_js.hasTextProperties(selectedElement)) {
|
|
4024
4017
|
return;
|
|
4025
4018
|
}
|
|
4026
|
-
const inlineSel =
|
|
4019
|
+
const inlineSel = chunk2QHCOESN_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4027
4020
|
if (inlineSel && selectedElement.textSegments) {
|
|
4028
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4021
|
+
const { newSegments: newSegments2, newSelection } = chunk2QHCOESN_js.applyStyleToSelectedSegments(
|
|
4029
4022
|
selectedElement.textSegments,
|
|
4030
4023
|
inlineSel,
|
|
4031
4024
|
updates
|
|
4032
4025
|
);
|
|
4033
|
-
|
|
4026
|
+
chunk2QHCOESN_js.setPendingSelectionRestore(newSelection);
|
|
4034
4027
|
updateSelectedElement({
|
|
4035
4028
|
textSegments: newSegments2
|
|
4036
4029
|
});
|
|
@@ -4050,12 +4043,12 @@ function useElementOperations(input) {
|
|
|
4050
4043
|
);
|
|
4051
4044
|
const updateSelectedTextCase = react.useCallback(
|
|
4052
4045
|
(mode) => {
|
|
4053
|
-
if (!selectedElement || !
|
|
4046
|
+
if (!selectedElement || !chunkR2H3FHK6_js.hasTextProperties(selectedElement)) {
|
|
4054
4047
|
return;
|
|
4055
4048
|
}
|
|
4056
|
-
const inlineSel =
|
|
4049
|
+
const inlineSel = chunk2QHCOESN_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4057
4050
|
if (inlineSel && selectedElement.textSegments) {
|
|
4058
|
-
const newSegments =
|
|
4051
|
+
const newSegments = chunk2QHCOESN_js.applyCaseTransformToSegments(
|
|
4059
4052
|
selectedElement.textSegments,
|
|
4060
4053
|
inlineSel,
|
|
4061
4054
|
mode
|
|
@@ -4065,14 +4058,14 @@ function useElementOperations(input) {
|
|
|
4065
4058
|
}
|
|
4066
4059
|
const updates = {};
|
|
4067
4060
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4068
|
-
updates.textSegments =
|
|
4061
|
+
updates.textSegments = chunk2QHCOESN_js.applyCaseTransformToSegments(
|
|
4069
4062
|
selectedElement.textSegments,
|
|
4070
4063
|
null,
|
|
4071
4064
|
mode
|
|
4072
4065
|
);
|
|
4073
4066
|
}
|
|
4074
4067
|
if (typeof selectedElement.text === "string") {
|
|
4075
|
-
updates.text =
|
|
4068
|
+
updates.text = chunk2QHCOESN_js.transformTextCase(selectedElement.text, mode);
|
|
4076
4069
|
}
|
|
4077
4070
|
updateSelectedElement(updates);
|
|
4078
4071
|
},
|
|
@@ -4127,7 +4120,7 @@ function useSectionOperations(input) {
|
|
|
4127
4120
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4128
4121
|
const addSection2 = react.useCallback(
|
|
4129
4122
|
(name, afterSlideIndex) => {
|
|
4130
|
-
const result =
|
|
4123
|
+
const result = chunk2QHCOESN_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4131
4124
|
setSlides(result.slides);
|
|
4132
4125
|
setSections(result.sections);
|
|
4133
4126
|
markDirty();
|
|
@@ -4136,7 +4129,7 @@ function useSectionOperations(input) {
|
|
|
4136
4129
|
);
|
|
4137
4130
|
const renameSection2 = react.useCallback(
|
|
4138
4131
|
(sectionId, newName) => {
|
|
4139
|
-
const result =
|
|
4132
|
+
const result = chunk2QHCOESN_js.renameSection(sections, slides, sectionId, newName);
|
|
4140
4133
|
setSections(result.sections);
|
|
4141
4134
|
setSlides(result.slides);
|
|
4142
4135
|
markDirty();
|
|
@@ -4145,7 +4138,7 @@ function useSectionOperations(input) {
|
|
|
4145
4138
|
);
|
|
4146
4139
|
const deleteSection2 = react.useCallback(
|
|
4147
4140
|
(sectionId) => {
|
|
4148
|
-
const result =
|
|
4141
|
+
const result = chunk2QHCOESN_js.deleteSection(sections, slides, sectionId);
|
|
4149
4142
|
setSections(result.sections);
|
|
4150
4143
|
setSlides(result.slides);
|
|
4151
4144
|
markDirty();
|
|
@@ -4154,21 +4147,21 @@ function useSectionOperations(input) {
|
|
|
4154
4147
|
);
|
|
4155
4148
|
const moveSectionUp2 = react.useCallback(
|
|
4156
4149
|
(sectionId) => {
|
|
4157
|
-
setSections(
|
|
4150
|
+
setSections(chunk2QHCOESN_js.moveSectionUp(sections, sectionId));
|
|
4158
4151
|
markDirty();
|
|
4159
4152
|
},
|
|
4160
4153
|
[sections, setSections, markDirty]
|
|
4161
4154
|
);
|
|
4162
4155
|
const moveSectionDown2 = react.useCallback(
|
|
4163
4156
|
(sectionId) => {
|
|
4164
|
-
setSections(
|
|
4157
|
+
setSections(chunk2QHCOESN_js.moveSectionDown(sections, sectionId));
|
|
4165
4158
|
markDirty();
|
|
4166
4159
|
},
|
|
4167
4160
|
[sections, setSections, markDirty]
|
|
4168
4161
|
);
|
|
4169
4162
|
const moveSlidesToSection2 = react.useCallback(
|
|
4170
4163
|
(slideIndexes, targetSectionId) => {
|
|
4171
|
-
const result =
|
|
4164
|
+
const result = chunk2QHCOESN_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4172
4165
|
setSlides(result.slides);
|
|
4173
4166
|
setSections(result.sections);
|
|
4174
4167
|
markDirty();
|
|
@@ -4187,19 +4180,19 @@ function useSectionOperations(input) {
|
|
|
4187
4180
|
|
|
4188
4181
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4189
4182
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4190
|
-
const resized =
|
|
4183
|
+
const resized = chunk2QHCOESN_js.applyResize(
|
|
4191
4184
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4192
4185
|
handle,
|
|
4193
4186
|
dx,
|
|
4194
4187
|
dy,
|
|
4195
4188
|
1,
|
|
4196
|
-
{ minSize:
|
|
4189
|
+
{ minSize: chunk2U243ZEP_js.MIN_ELEMENT_SIZE }
|
|
4197
4190
|
);
|
|
4198
4191
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4199
4192
|
if (!snapToGrid) {
|
|
4200
4193
|
return box;
|
|
4201
4194
|
}
|
|
4202
|
-
return
|
|
4195
|
+
return chunk2QHCOESN_js.snapBoxToGrid(box, handle, gridSpacingPx, chunk2U243ZEP_js.MIN_ELEMENT_SIZE);
|
|
4203
4196
|
}
|
|
4204
4197
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
4205
4198
|
const range = startWidth || 200;
|
|
@@ -4317,7 +4310,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4317
4310
|
width: el.width,
|
|
4318
4311
|
height: el.height
|
|
4319
4312
|
}));
|
|
4320
|
-
const snapResult =
|
|
4313
|
+
const snapResult = chunk2QHCOESN_js.computeSnapToShape(
|
|
4321
4314
|
targetX,
|
|
4322
4315
|
targetY,
|
|
4323
4316
|
primaryEl.width,
|
|
@@ -4356,7 +4349,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4356
4349
|
if (live) {
|
|
4357
4350
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4358
4351
|
const start = drag.startPositionsById[id];
|
|
4359
|
-
|
|
4352
|
+
chunk2QHCOESN_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4360
4353
|
x: start.x + appliedDx,
|
|
4361
4354
|
y: start.y + appliedDy
|
|
4362
4355
|
});
|
|
@@ -4390,15 +4383,15 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4390
4383
|
if (rs.domEl) {
|
|
4391
4384
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4392
4385
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4393
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4394
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4386
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunk2U243ZEP_js.MIN_ELEMENT_SIZE)}px`;
|
|
4387
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunk2U243ZEP_js.MIN_ELEMENT_SIZE)}px`;
|
|
4395
4388
|
}
|
|
4396
4389
|
if (live) {
|
|
4397
|
-
|
|
4390
|
+
chunk2QHCOESN_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4398
4391
|
x: geo.x,
|
|
4399
4392
|
y: geo.y,
|
|
4400
|
-
width: Math.max(geo.width,
|
|
4401
|
-
height: Math.max(geo.height,
|
|
4393
|
+
width: Math.max(geo.width, chunk2U243ZEP_js.MIN_ELEMENT_SIZE),
|
|
4394
|
+
height: Math.max(geo.height, chunk2U243ZEP_js.MIN_ELEMENT_SIZE)
|
|
4402
4395
|
});
|
|
4403
4396
|
}
|
|
4404
4397
|
}
|
|
@@ -4478,13 +4471,13 @@ function processPointerUp(input) {
|
|
|
4478
4471
|
if (i !== activeSlideIndex) {
|
|
4479
4472
|
return s;
|
|
4480
4473
|
}
|
|
4481
|
-
const rerouted =
|
|
4474
|
+
const rerouted = chunk2QHCOESN_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4482
4475
|
if (rerouted.length === 0) {
|
|
4483
4476
|
return s;
|
|
4484
4477
|
}
|
|
4485
4478
|
return {
|
|
4486
4479
|
...s,
|
|
4487
|
-
elements:
|
|
4480
|
+
elements: chunk2QHCOESN_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4488
4481
|
};
|
|
4489
4482
|
})
|
|
4490
4483
|
);
|
|
@@ -4506,9 +4499,9 @@ function processPointerUp(input) {
|
|
|
4506
4499
|
}
|
|
4507
4500
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4508
4501
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4509
|
-
const hitIds =
|
|
4502
|
+
const hitIds = chunk2QHCOESN_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4510
4503
|
if (marquee.additive) {
|
|
4511
|
-
const merged =
|
|
4504
|
+
const merged = chunk2QHCOESN_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4512
4505
|
if (merged.length > 0) {
|
|
4513
4506
|
applySelection(merged[0], merged);
|
|
4514
4507
|
} else {
|
|
@@ -4531,8 +4524,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4531
4524
|
}
|
|
4532
4525
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4533
4526
|
});
|
|
4534
|
-
const rerouted =
|
|
4535
|
-
return
|
|
4527
|
+
const rerouted = chunk2QHCOESN_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4528
|
+
return chunk2QHCOESN_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4536
4529
|
};
|
|
4537
4530
|
if (editTemplateMode) {
|
|
4538
4531
|
const slideId = activeSlide?.id;
|
|
@@ -4685,9 +4678,9 @@ function useCanvasInteractions(input) {
|
|
|
4685
4678
|
return;
|
|
4686
4679
|
}
|
|
4687
4680
|
const el = elementLookup.get(editId);
|
|
4688
|
-
if (el &&
|
|
4681
|
+
if (el && chunkR2H3FHK6_js.hasTextProperties(el)) {
|
|
4689
4682
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4690
|
-
const newSegments =
|
|
4683
|
+
const newSegments = chunk2QHCOESN_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4691
4684
|
ops.updateElementById(editId, {
|
|
4692
4685
|
text: committedText,
|
|
4693
4686
|
textSegments: newSegments
|
|
@@ -4698,7 +4691,7 @@ function useCanvasInteractions(input) {
|
|
|
4698
4691
|
setInlineEditingText("");
|
|
4699
4692
|
};
|
|
4700
4693
|
const openEquationEditorForElement = (el) => {
|
|
4701
|
-
if (!
|
|
4694
|
+
if (!chunkR2H3FHK6_js.hasTextProperties(el)) {
|
|
4702
4695
|
return false;
|
|
4703
4696
|
}
|
|
4704
4697
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4727,7 +4720,7 @@ function useCanvasInteractions(input) {
|
|
|
4727
4720
|
justSelectedRef.current = false;
|
|
4728
4721
|
} else {
|
|
4729
4722
|
const el = elementLookup.get(elementId);
|
|
4730
|
-
if (el &&
|
|
4723
|
+
if (el && chunkR2H3FHK6_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
4731
4724
|
if (!openEquationEditorForElement(el)) {
|
|
4732
4725
|
setInlineEditingElementId(elementId);
|
|
4733
4726
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4746,7 +4739,7 @@ function useCanvasInteractions(input) {
|
|
|
4746
4739
|
if (openEquationEditorForElement(el)) {
|
|
4747
4740
|
return;
|
|
4748
4741
|
}
|
|
4749
|
-
if (
|
|
4742
|
+
if (chunkR2H3FHK6_js.hasTextProperties(el)) {
|
|
4750
4743
|
setInlineEditingElementId(elementId);
|
|
4751
4744
|
setInlineEditingText(el.text ?? "");
|
|
4752
4745
|
}
|
|
@@ -4936,7 +4929,7 @@ function createFileHandlers(deps) {
|
|
|
4936
4929
|
h = Math.round(h * scale);
|
|
4937
4930
|
}
|
|
4938
4931
|
addElement({
|
|
4939
|
-
id:
|
|
4932
|
+
id: chunk2QHCOESN_js.generateElementId(),
|
|
4940
4933
|
type: "image",
|
|
4941
4934
|
x: Math.round((canvasSize.width - w) / 2),
|
|
4942
4935
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -4947,7 +4940,7 @@ function createFileHandlers(deps) {
|
|
|
4947
4940
|
};
|
|
4948
4941
|
img.onerror = () => {
|
|
4949
4942
|
addElement({
|
|
4950
|
-
id:
|
|
4943
|
+
id: chunk2QHCOESN_js.generateElementId(),
|
|
4951
4944
|
type: "image",
|
|
4952
4945
|
x: 100,
|
|
4953
4946
|
y: 100,
|
|
@@ -4973,7 +4966,7 @@ function createFileHandlers(deps) {
|
|
|
4973
4966
|
const elFilePath = file.path;
|
|
4974
4967
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
4975
4968
|
addElement({
|
|
4976
|
-
id:
|
|
4969
|
+
id: chunk2QHCOESN_js.generateElementId(),
|
|
4977
4970
|
type: "media",
|
|
4978
4971
|
mediaType,
|
|
4979
4972
|
mediaMimeType: file.type || void 0,
|
|
@@ -5148,13 +5141,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5148
5141
|
return;
|
|
5149
5142
|
}
|
|
5150
5143
|
addElement({
|
|
5151
|
-
id:
|
|
5144
|
+
id: chunk2QHCOESN_js.generateElementId(),
|
|
5152
5145
|
type: "smartArt",
|
|
5153
5146
|
x: 100,
|
|
5154
5147
|
y: 120,
|
|
5155
5148
|
width: 600,
|
|
5156
5149
|
height: 340,
|
|
5157
|
-
smartArtData:
|
|
5150
|
+
smartArtData: chunk2QHCOESN_js.buildSmartArtPresetData(
|
|
5158
5151
|
layout,
|
|
5159
5152
|
defaultItems,
|
|
5160
5153
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5166,7 +5159,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5166
5159
|
return;
|
|
5167
5160
|
}
|
|
5168
5161
|
addElement({
|
|
5169
|
-
id:
|
|
5162
|
+
id: chunk2QHCOESN_js.generateElementId(),
|
|
5170
5163
|
type: "shape",
|
|
5171
5164
|
x: 120,
|
|
5172
5165
|
y: 200,
|
|
@@ -5225,7 +5218,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5225
5218
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5226
5219
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5227
5220
|
addElement({
|
|
5228
|
-
id:
|
|
5221
|
+
id: chunk2QHCOESN_js.generateElementId(),
|
|
5229
5222
|
type: "shape",
|
|
5230
5223
|
x: 120,
|
|
5231
5224
|
y: 200,
|
|
@@ -5247,11 +5240,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5247
5240
|
if (!activeSlide) {
|
|
5248
5241
|
return;
|
|
5249
5242
|
}
|
|
5250
|
-
const preset =
|
|
5243
|
+
const preset = chunk2QHCOESN_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5251
5244
|
if (!preset) {
|
|
5252
5245
|
return;
|
|
5253
5246
|
}
|
|
5254
|
-
const defaultPptxAction =
|
|
5247
|
+
const defaultPptxAction = chunkR2H3FHK6_js.elementActionToPptxAction({
|
|
5255
5248
|
trigger: "click",
|
|
5256
5249
|
type: preset.defaultAction
|
|
5257
5250
|
});
|
|
@@ -5260,7 +5253,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5260
5253
|
defaultPptxAction.highlightClick = true;
|
|
5261
5254
|
}
|
|
5262
5255
|
addElement({
|
|
5263
|
-
id:
|
|
5256
|
+
id: chunk2QHCOESN_js.generateElementId(),
|
|
5264
5257
|
type: "shape",
|
|
5265
5258
|
x: 150,
|
|
5266
5259
|
y: 150,
|
|
@@ -5327,14 +5320,14 @@ function useInsertElements(input) {
|
|
|
5327
5320
|
return;
|
|
5328
5321
|
}
|
|
5329
5322
|
addElement({
|
|
5330
|
-
id:
|
|
5323
|
+
id: chunk2QHCOESN_js.generateElementId(),
|
|
5331
5324
|
type: "text",
|
|
5332
5325
|
x: 100,
|
|
5333
5326
|
y: 100,
|
|
5334
5327
|
width: 300,
|
|
5335
5328
|
height: 60,
|
|
5336
5329
|
text: "",
|
|
5337
|
-
textStyle: { fontSize:
|
|
5330
|
+
textStyle: { fontSize: chunk2U243ZEP_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5338
5331
|
});
|
|
5339
5332
|
};
|
|
5340
5333
|
const handleAddShape = () => {
|
|
@@ -5342,7 +5335,7 @@ function useInsertElements(input) {
|
|
|
5342
5335
|
return;
|
|
5343
5336
|
}
|
|
5344
5337
|
addElement({
|
|
5345
|
-
id:
|
|
5338
|
+
id: chunk2QHCOESN_js.generateElementId(),
|
|
5346
5339
|
type: "shape",
|
|
5347
5340
|
x: 150,
|
|
5348
5341
|
y: 150,
|
|
@@ -5361,15 +5354,15 @@ function useInsertElements(input) {
|
|
|
5361
5354
|
return;
|
|
5362
5355
|
}
|
|
5363
5356
|
addElement({
|
|
5364
|
-
...
|
|
5365
|
-
id:
|
|
5357
|
+
...chunk2QHCOESN_js.newTableElement(chunk2U243ZEP_js.DEFAULT_TABLE_ROWS, chunk2U243ZEP_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5358
|
+
id: chunk2QHCOESN_js.generateElementId()
|
|
5366
5359
|
});
|
|
5367
5360
|
};
|
|
5368
5361
|
const handleAddChart = (chartType) => {
|
|
5369
5362
|
if (!activeSlide) {
|
|
5370
5363
|
return;
|
|
5371
5364
|
}
|
|
5372
|
-
addElement(
|
|
5365
|
+
addElement(chunk2QHCOESN_js.createDefaultChartElement(chartType));
|
|
5373
5366
|
};
|
|
5374
5367
|
const structured = createStructuredElementHandlers({
|
|
5375
5368
|
activeSlide,
|
|
@@ -5439,7 +5432,7 @@ function useClipboardHandlers(input) {
|
|
|
5439
5432
|
if (!selectedElement) {
|
|
5440
5433
|
return;
|
|
5441
5434
|
}
|
|
5442
|
-
setClipboardPayload(
|
|
5435
|
+
setClipboardPayload(chunk2QHCOESN_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5443
5436
|
};
|
|
5444
5437
|
const handleDelete = () => {
|
|
5445
5438
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5456,7 +5449,7 @@ function useClipboardHandlers(input) {
|
|
|
5456
5449
|
handleDelete();
|
|
5457
5450
|
};
|
|
5458
5451
|
const insertClone = (source) => {
|
|
5459
|
-
const clone =
|
|
5452
|
+
const clone = chunk2QHCOESN_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5460
5453
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5461
5454
|
ops.applySelection(clone.id);
|
|
5462
5455
|
history.markDirty();
|
|
@@ -5491,7 +5484,7 @@ function resolveShapePath(el) {
|
|
|
5491
5484
|
return el.pathData;
|
|
5492
5485
|
}
|
|
5493
5486
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5494
|
-
const clipPath =
|
|
5487
|
+
const clipPath = chunkR2H3FHK6_js.getPresetShapeClipPath(el.shapeType);
|
|
5495
5488
|
if (clipPath) {
|
|
5496
5489
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5497
5490
|
if (svgPath) {
|
|
@@ -5542,7 +5535,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5542
5535
|
return parts.join(" ");
|
|
5543
5536
|
}
|
|
5544
5537
|
function transformPathToGlobal(pathData, el) {
|
|
5545
|
-
const polys =
|
|
5538
|
+
const polys = chunkR2H3FHK6_js.svgPathToPolygons(pathData);
|
|
5546
5539
|
if (polys.length === 0) {
|
|
5547
5540
|
return pathData;
|
|
5548
5541
|
}
|
|
@@ -5562,10 +5555,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5562
5555
|
y: pt.y * scaleY + el.y
|
|
5563
5556
|
}))
|
|
5564
5557
|
);
|
|
5565
|
-
return
|
|
5558
|
+
return chunkR2H3FHK6_js.polygonsToSvgPath(transformed);
|
|
5566
5559
|
}
|
|
5567
5560
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5568
|
-
const polys =
|
|
5561
|
+
const polys = chunkR2H3FHK6_js.svgPathToPolygons(pathData);
|
|
5569
5562
|
if (polys.length === 0) {
|
|
5570
5563
|
return pathData;
|
|
5571
5564
|
}
|
|
@@ -5575,10 +5568,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5575
5568
|
y: pt.y - y
|
|
5576
5569
|
}))
|
|
5577
5570
|
);
|
|
5578
|
-
return
|
|
5571
|
+
return chunkR2H3FHK6_js.polygonsToSvgPath(transformed);
|
|
5579
5572
|
}
|
|
5580
5573
|
function pathBounds(pathData) {
|
|
5581
|
-
const polys =
|
|
5574
|
+
const polys = chunkR2H3FHK6_js.svgPathToPolygons(pathData);
|
|
5582
5575
|
let minX = Infinity;
|
|
5583
5576
|
let minY = Infinity;
|
|
5584
5577
|
let maxX = -Infinity;
|
|
@@ -5637,7 +5630,7 @@ function useMergeShapesHandler(input) {
|
|
|
5637
5630
|
let allFragments = [];
|
|
5638
5631
|
let remaining = globalPaths[0];
|
|
5639
5632
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5640
|
-
const frags =
|
|
5633
|
+
const frags = chunkR2H3FHK6_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5641
5634
|
if (Array.isArray(frags)) {
|
|
5642
5635
|
allFragments = frags;
|
|
5643
5636
|
}
|
|
@@ -5666,7 +5659,7 @@ function useMergeShapesHandler(input) {
|
|
|
5666
5659
|
bounds.height
|
|
5667
5660
|
);
|
|
5668
5661
|
const newEl = {
|
|
5669
|
-
id:
|
|
5662
|
+
id: chunk2QHCOESN_js.generateElementId(),
|
|
5670
5663
|
type: "shape",
|
|
5671
5664
|
x: bounds.x,
|
|
5672
5665
|
y: bounds.y,
|
|
@@ -5704,7 +5697,7 @@ function useMergeShapesHandler(input) {
|
|
|
5704
5697
|
} else {
|
|
5705
5698
|
let resultPath = globalPaths[0];
|
|
5706
5699
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5707
|
-
const result =
|
|
5700
|
+
const result = chunkR2H3FHK6_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5708
5701
|
if (typeof result === "string") {
|
|
5709
5702
|
resultPath = result;
|
|
5710
5703
|
}
|
|
@@ -5725,7 +5718,7 @@ function useMergeShapesHandler(input) {
|
|
|
5725
5718
|
);
|
|
5726
5719
|
const primary = targets[0];
|
|
5727
5720
|
const newEl = {
|
|
5728
|
-
id:
|
|
5721
|
+
id: chunk2QHCOESN_js.generateElementId(),
|
|
5729
5722
|
type: "shape",
|
|
5730
5723
|
x: bounds.x,
|
|
5731
5724
|
y: bounds.y,
|
|
@@ -5788,7 +5781,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5788
5781
|
if (ids.length < 2 || !activeSlide) {
|
|
5789
5782
|
return;
|
|
5790
5783
|
}
|
|
5791
|
-
const { elements, groupId } =
|
|
5784
|
+
const { elements, groupId } = chunk2QHCOESN_js.groupElements(ops.activeElements, ids, chunk2QHCOESN_js.generateElementId());
|
|
5792
5785
|
if (groupId === null) {
|
|
5793
5786
|
return;
|
|
5794
5787
|
}
|
|
@@ -5801,12 +5794,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5801
5794
|
return;
|
|
5802
5795
|
}
|
|
5803
5796
|
const group = selectedElement;
|
|
5804
|
-
const intoTemplate =
|
|
5797
|
+
const intoTemplate = chunk2QHCOESN_js.isTemplateElementId(group.id);
|
|
5805
5798
|
const ungrouped = group.children.map((child) => ({
|
|
5806
5799
|
...structuredClone(child),
|
|
5807
5800
|
// Keep child ids in the same store as the group so later edits route
|
|
5808
5801
|
// correctly: template groups yield template-prefixed child ids.
|
|
5809
|
-
id: intoTemplate ?
|
|
5802
|
+
id: intoTemplate ? chunk2QHCOESN_js.makeCloneId(true, child.id || group.id) : child.id || chunk2QHCOESN_js.generateElementId(),
|
|
5810
5803
|
x: child.x + group.x,
|
|
5811
5804
|
y: child.y + group.y
|
|
5812
5805
|
}));
|
|
@@ -5830,7 +5823,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5830
5823
|
if (!edge) {
|
|
5831
5824
|
return;
|
|
5832
5825
|
}
|
|
5833
|
-
const positions =
|
|
5826
|
+
const positions = chunk2QHCOESN_js.alignElements(selectedElements, edge);
|
|
5834
5827
|
for (const [id, pos] of positions) {
|
|
5835
5828
|
const el = elementLookup.get(id);
|
|
5836
5829
|
if (!el) {
|
|
@@ -5848,7 +5841,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5848
5841
|
if (!distAxis) {
|
|
5849
5842
|
return;
|
|
5850
5843
|
}
|
|
5851
|
-
const positions =
|
|
5844
|
+
const positions = chunk2QHCOESN_js.distributeElements(selectedElements, distAxis);
|
|
5852
5845
|
for (const [id, pos] of positions) {
|
|
5853
5846
|
const el = elementLookup.get(id);
|
|
5854
5847
|
if (!el) {
|
|
@@ -5865,7 +5858,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5865
5858
|
}
|
|
5866
5859
|
const id = selectedElement.id;
|
|
5867
5860
|
ops.updateActiveElements(
|
|
5868
|
-
(els) => direction === "forward" ?
|
|
5861
|
+
(els) => direction === "forward" ? chunk2QHCOESN_js.bringForward(els, id) : direction === "backward" ? chunk2QHCOESN_js.sendBackward(els, id) : els
|
|
5869
5862
|
);
|
|
5870
5863
|
history.markDirty();
|
|
5871
5864
|
};
|
|
@@ -5875,7 +5868,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5875
5868
|
}
|
|
5876
5869
|
const id = selectedElement.id;
|
|
5877
5870
|
ops.updateActiveElements(
|
|
5878
|
-
(els) => direction === "front" ?
|
|
5871
|
+
(els) => direction === "front" ? chunk2QHCOESN_js.bringToFront(els, id) : chunk2QHCOESN_js.sendToBack(els, id)
|
|
5879
5872
|
);
|
|
5880
5873
|
history.markDirty();
|
|
5881
5874
|
};
|
|
@@ -5997,7 +5990,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
5997
5990
|
function useSlideManagement(input) {
|
|
5998
5991
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
5999
5992
|
const handleAddSlide = () => {
|
|
6000
|
-
const newSlide =
|
|
5993
|
+
const newSlide = chunk2QHCOESN_js.createBlankSlide(slides.length + 1);
|
|
6001
5994
|
ops.updateSlides((prev) => {
|
|
6002
5995
|
const next = [...prev];
|
|
6003
5996
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6060,7 +6053,7 @@ function useSlideManagement(input) {
|
|
|
6060
6053
|
}
|
|
6061
6054
|
const clone = {
|
|
6062
6055
|
...src,
|
|
6063
|
-
id:
|
|
6056
|
+
id: chunk2QHCOESN_js.makeSlideId(),
|
|
6064
6057
|
elements: src.elements.map((el) => ({
|
|
6065
6058
|
...el,
|
|
6066
6059
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6092,7 +6085,7 @@ function useSlideManagement(input) {
|
|
|
6092
6085
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6093
6086
|
const insertAt = activeSlideIndex + 1;
|
|
6094
6087
|
const draft = {
|
|
6095
|
-
...
|
|
6088
|
+
...chunk2QHCOESN_js.createBlankSlide(slides.length + 1),
|
|
6096
6089
|
layoutPath,
|
|
6097
6090
|
...layoutName ? { layoutName } : {}
|
|
6098
6091
|
};
|
|
@@ -6153,7 +6146,7 @@ function createTableMergeHandlers(input) {
|
|
|
6153
6146
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6154
6147
|
return;
|
|
6155
6148
|
}
|
|
6156
|
-
const newTableData =
|
|
6149
|
+
const newTableData = chunk2QHCOESN_js.mergeCells(
|
|
6157
6150
|
[
|
|
6158
6151
|
{ row: rowIndex, col: columnIndex },
|
|
6159
6152
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6161,7 +6154,7 @@ function createTableMergeHandlers(input) {
|
|
|
6161
6154
|
td
|
|
6162
6155
|
);
|
|
6163
6156
|
const updates = { tableData: newTableData };
|
|
6164
|
-
const newRawXml =
|
|
6157
|
+
const newRawXml = chunkR2H3FHK6_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6165
6158
|
if (newRawXml) {
|
|
6166
6159
|
updates.rawXml = newRawXml;
|
|
6167
6160
|
}
|
|
@@ -6187,7 +6180,7 @@ function createTableMergeHandlers(input) {
|
|
|
6187
6180
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6188
6181
|
return;
|
|
6189
6182
|
}
|
|
6190
|
-
const newTableData =
|
|
6183
|
+
const newTableData = chunk2QHCOESN_js.mergeCells(
|
|
6191
6184
|
[
|
|
6192
6185
|
{ row: rowIndex, col: columnIndex },
|
|
6193
6186
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6195,7 +6188,7 @@ function createTableMergeHandlers(input) {
|
|
|
6195
6188
|
td
|
|
6196
6189
|
);
|
|
6197
6190
|
const updates = { tableData: newTableData };
|
|
6198
|
-
const newRawXml =
|
|
6191
|
+
const newRawXml = chunkR2H3FHK6_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6199
6192
|
if (newRawXml) {
|
|
6200
6193
|
updates.rawXml = newRawXml;
|
|
6201
6194
|
}
|
|
@@ -6210,9 +6203,9 @@ function createTableMergeHandlers(input) {
|
|
|
6210
6203
|
return;
|
|
6211
6204
|
}
|
|
6212
6205
|
const td = selectedElement.tableData;
|
|
6213
|
-
const newTableData =
|
|
6206
|
+
const newTableData = chunk2QHCOESN_js.mergeCells(ts.selectedCells, td);
|
|
6214
6207
|
const updates = { tableData: newTableData };
|
|
6215
|
-
const newRawXml =
|
|
6208
|
+
const newRawXml = chunkR2H3FHK6_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6216
6209
|
if (newRawXml) {
|
|
6217
6210
|
updates.rawXml = newRawXml;
|
|
6218
6211
|
}
|
|
@@ -6229,9 +6222,9 @@ function createTableMergeHandlers(input) {
|
|
|
6229
6222
|
}
|
|
6230
6223
|
const { rowIndex, columnIndex } = ts;
|
|
6231
6224
|
const td = selectedElement.tableData;
|
|
6232
|
-
const newTableData =
|
|
6225
|
+
const newTableData = chunk2QHCOESN_js.splitCell(rowIndex, columnIndex, td);
|
|
6233
6226
|
const updates = { tableData: newTableData };
|
|
6234
|
-
const newRawXml =
|
|
6227
|
+
const newRawXml = chunkR2H3FHK6_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6235
6228
|
if (newRawXml) {
|
|
6236
6229
|
updates.rawXml = newRawXml;
|
|
6237
6230
|
}
|
|
@@ -6275,7 +6268,7 @@ function createTableStructHandlers(input) {
|
|
|
6275
6268
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
6276
6269
|
}
|
|
6277
6270
|
if (el.rawXml) {
|
|
6278
|
-
const newRawXml =
|
|
6271
|
+
const newRawXml = chunkR2H3FHK6_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6279
6272
|
if (newRawXml) {
|
|
6280
6273
|
updates.rawXml = newRawXml;
|
|
6281
6274
|
}
|
|
@@ -6299,7 +6292,7 @@ function createTableStructHandlers(input) {
|
|
|
6299
6292
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6300
6293
|
const updates = {};
|
|
6301
6294
|
if (selectedElement.rawXml) {
|
|
6302
|
-
const newRawXml =
|
|
6295
|
+
const newRawXml = chunkR2H3FHK6_js.updateCellTextStyleInRawXml(
|
|
6303
6296
|
selectedElement,
|
|
6304
6297
|
rowIndex,
|
|
6305
6298
|
colIndex,
|
|
@@ -6363,9 +6356,9 @@ function createTableStructHandlers(input) {
|
|
|
6363
6356
|
return;
|
|
6364
6357
|
}
|
|
6365
6358
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6366
|
-
const newTableData =
|
|
6359
|
+
const newTableData = chunk2QHCOESN_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6367
6360
|
const updates = { tableData: newTableData };
|
|
6368
|
-
const newRawXml =
|
|
6361
|
+
const newRawXml = chunkR2H3FHK6_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6369
6362
|
if (newRawXml) {
|
|
6370
6363
|
updates.rawXml = newRawXml;
|
|
6371
6364
|
}
|
|
@@ -6378,12 +6371,12 @@ function createTableStructHandlers(input) {
|
|
|
6378
6371
|
}
|
|
6379
6372
|
const td = selectedElement.tableData;
|
|
6380
6373
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6381
|
-
const newTableData =
|
|
6374
|
+
const newTableData = chunk2QHCOESN_js.deleteTableRow(td, rowIdx);
|
|
6382
6375
|
if (newTableData === td) {
|
|
6383
6376
|
return;
|
|
6384
6377
|
}
|
|
6385
6378
|
const updates = { tableData: newTableData };
|
|
6386
|
-
const newRawXml =
|
|
6379
|
+
const newRawXml = chunkR2H3FHK6_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6387
6380
|
if (newRawXml) {
|
|
6388
6381
|
updates.rawXml = newRawXml;
|
|
6389
6382
|
}
|
|
@@ -6395,9 +6388,9 @@ function createTableStructHandlers(input) {
|
|
|
6395
6388
|
return;
|
|
6396
6389
|
}
|
|
6397
6390
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6398
|
-
const newTableData =
|
|
6391
|
+
const newTableData = chunk2QHCOESN_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6399
6392
|
const updates = { tableData: newTableData };
|
|
6400
|
-
const newRawXml =
|
|
6393
|
+
const newRawXml = chunkR2H3FHK6_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6401
6394
|
if (newRawXml) {
|
|
6402
6395
|
updates.rawXml = newRawXml;
|
|
6403
6396
|
}
|
|
@@ -6410,12 +6403,12 @@ function createTableStructHandlers(input) {
|
|
|
6410
6403
|
}
|
|
6411
6404
|
const td = selectedElement.tableData;
|
|
6412
6405
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6413
|
-
const newTableData =
|
|
6406
|
+
const newTableData = chunk2QHCOESN_js.deleteTableColumn(td, colIdx);
|
|
6414
6407
|
if (newTableData === td) {
|
|
6415
6408
|
return;
|
|
6416
6409
|
}
|
|
6417
6410
|
const updates = { tableData: newTableData };
|
|
6418
|
-
const newRawXml =
|
|
6411
|
+
const newRawXml = chunkR2H3FHK6_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6419
6412
|
if (newRawXml) {
|
|
6420
6413
|
updates.rawXml = newRawXml;
|
|
6421
6414
|
}
|
|
@@ -6451,8 +6444,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6451
6444
|
return html2canvasPro(element, {
|
|
6452
6445
|
...options,
|
|
6453
6446
|
onclone: async (doc, clonedEl) => {
|
|
6454
|
-
await
|
|
6455
|
-
|
|
6447
|
+
await chunk2QHCOESN_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6448
|
+
chunk2QHCOESN_js.preprocessCssForCapture(clonedEl);
|
|
6456
6449
|
if (typeof userOnClone === "function") {
|
|
6457
6450
|
userOnClone(doc, clonedEl);
|
|
6458
6451
|
}
|
|
@@ -6508,7 +6501,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6508
6501
|
}
|
|
6509
6502
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6510
6503
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6511
|
-
|
|
6504
|
+
chunk2QHCOESN_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6512
6505
|
}
|
|
6513
6506
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6514
6507
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6530,15 +6523,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6530
6523
|
continue;
|
|
6531
6524
|
}
|
|
6532
6525
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6533
|
-
images.push(
|
|
6526
|
+
images.push(chunk2QHCOESN_js.canvasToJpegData(canvas));
|
|
6534
6527
|
}
|
|
6535
6528
|
onProgress?.(totalSlides, totalSlides);
|
|
6536
6529
|
setActiveSlide(currentSlideIndex);
|
|
6537
6530
|
if (images.length === 0) {
|
|
6538
|
-
throw new Error(
|
|
6531
|
+
throw new Error(chunkYIFO3WQO_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6539
6532
|
}
|
|
6540
|
-
const pdfBlobUrl =
|
|
6541
|
-
|
|
6533
|
+
const pdfBlobUrl = chunk2U243ZEP_js.buildPdfFromImageData(images);
|
|
6534
|
+
chunk2QHCOESN_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6542
6535
|
}
|
|
6543
6536
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6544
6537
|
const { scale = 2, onProgress } = options;
|
|
@@ -6584,10 +6577,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6584
6577
|
onProgress?.(totalSlides, totalSlides);
|
|
6585
6578
|
setActiveSlide(currentSlideIndex);
|
|
6586
6579
|
if (pages.length === 0) {
|
|
6587
|
-
throw new Error(
|
|
6580
|
+
throw new Error(chunkYIFO3WQO_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6588
6581
|
}
|
|
6589
|
-
const pdfDataUrl =
|
|
6590
|
-
|
|
6582
|
+
const pdfDataUrl = chunk2U243ZEP_js.buildNotesPdf(pages);
|
|
6583
|
+
chunk2QHCOESN_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6591
6584
|
}
|
|
6592
6585
|
|
|
6593
6586
|
// src/viewer/utils/export-video.ts
|
|
@@ -6618,7 +6611,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6618
6611
|
}
|
|
6619
6612
|
setActiveSlide(currentSlideIndex);
|
|
6620
6613
|
if (slideCanvases.length === 0) {
|
|
6621
|
-
throw new Error(
|
|
6614
|
+
throw new Error(chunkYIFO3WQO_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
6622
6615
|
}
|
|
6623
6616
|
const firstCanvas = slideCanvases[0];
|
|
6624
6617
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -6626,12 +6619,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6626
6619
|
recordingCanvas.height = firstCanvas.height;
|
|
6627
6620
|
const ctx = recordingCanvas.getContext("2d");
|
|
6628
6621
|
if (!ctx) {
|
|
6629
|
-
throw new Error(
|
|
6622
|
+
throw new Error(chunkYIFO3WQO_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
6630
6623
|
}
|
|
6631
6624
|
const fps = 30;
|
|
6632
6625
|
const stream = recordingCanvas.captureStream(fps);
|
|
6633
6626
|
const recorder = new MediaRecorder(stream, {
|
|
6634
|
-
mimeType:
|
|
6627
|
+
mimeType: chunk2QHCOESN_js.pickSupportedMimeType([...chunk2QHCOESN_js.WEBM_MIME_CANDIDATES]),
|
|
6635
6628
|
videoBitsPerSecond: 5e6
|
|
6636
6629
|
});
|
|
6637
6630
|
const chunks = [];
|
|
@@ -6654,8 +6647,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6654
6647
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6655
6648
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6656
6649
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6657
|
-
const frameInterval =
|
|
6658
|
-
const framesNeeded =
|
|
6650
|
+
const frameInterval = chunk2QHCOESN_js.fpsToFrameIntervalMs(fps);
|
|
6651
|
+
const framesNeeded = chunk2QHCOESN_js.segmentFrameCount(duration, fps);
|
|
6659
6652
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6660
6653
|
if (signal?.aborted) {
|
|
6661
6654
|
recorder.stop();
|
|
@@ -6702,9 +6695,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6702
6695
|
}
|
|
6703
6696
|
setActiveSlide(currentSlideIndex);
|
|
6704
6697
|
if (frames.length === 0) {
|
|
6705
|
-
throw new Error(
|
|
6698
|
+
throw new Error(chunkYIFO3WQO_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6706
6699
|
}
|
|
6707
|
-
const gifBytes =
|
|
6700
|
+
const gifBytes = chunk2QHCOESN_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6708
6701
|
onProgress?.(totalSlides, totalSlides);
|
|
6709
6702
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6710
6703
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6758,7 +6751,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6758
6751
|
continue;
|
|
6759
6752
|
}
|
|
6760
6753
|
onProgress?.(processedCount, data.slides.length);
|
|
6761
|
-
let svg =
|
|
6754
|
+
let svg = chunkR2H3FHK6_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6762
6755
|
if (embedFonts && fontFaces?.length) {
|
|
6763
6756
|
svg = injectFontFaces(svg, fontFaces);
|
|
6764
6757
|
}
|
|
@@ -6818,7 +6811,7 @@ function useExportSaveAs(input) {
|
|
|
6818
6811
|
}
|
|
6819
6812
|
setExportProgress(70);
|
|
6820
6813
|
setExportStatusMessage("Writing README...");
|
|
6821
|
-
const readme =
|
|
6814
|
+
const readme = chunk2QHCOESN_js.generatePackageReadme(pptxFilename);
|
|
6822
6815
|
pkgFolder.file("README.txt", readme);
|
|
6823
6816
|
if (abortCtrl.signal.aborted) {
|
|
6824
6817
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -6829,7 +6822,7 @@ function useExportSaveAs(input) {
|
|
|
6829
6822
|
setExportProgress(95);
|
|
6830
6823
|
setExportStatusMessage("Downloading...");
|
|
6831
6824
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
6832
|
-
|
|
6825
|
+
chunk2QHCOESN_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
6833
6826
|
setExportProgress(100);
|
|
6834
6827
|
} catch (err) {
|
|
6835
6828
|
if (err.name !== "AbortError") {
|
|
@@ -6852,7 +6845,7 @@ function useExportSaveAs(input) {
|
|
|
6852
6845
|
const blob = new Blob([data], {
|
|
6853
6846
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6854
6847
|
});
|
|
6855
|
-
|
|
6848
|
+
chunk2QHCOESN_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
6856
6849
|
} catch (err) {
|
|
6857
6850
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
6858
6851
|
}
|
|
@@ -6865,14 +6858,14 @@ function useExportSaveAs(input) {
|
|
|
6865
6858
|
const pptxGuides = guides.map((g) => ({
|
|
6866
6859
|
id: g.id,
|
|
6867
6860
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
6868
|
-
positionEmu:
|
|
6861
|
+
positionEmu: chunkR2H3FHK6_js.guidePxToEmu(g.position)
|
|
6869
6862
|
}));
|
|
6870
6863
|
return {
|
|
6871
6864
|
...slide,
|
|
6872
6865
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
6873
6866
|
};
|
|
6874
6867
|
});
|
|
6875
|
-
const slidesToSave =
|
|
6868
|
+
const slidesToSave = chunk2U243ZEP_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
6876
6869
|
const saveOptions = {
|
|
6877
6870
|
headerFooter,
|
|
6878
6871
|
presentationProperties,
|
|
@@ -6929,7 +6922,7 @@ function safeConfirm(message) {
|
|
|
6929
6922
|
}
|
|
6930
6923
|
}
|
|
6931
6924
|
function downloadBlob2(blob, filename) {
|
|
6932
|
-
|
|
6925
|
+
chunk2QHCOESN_js.downloadBlob(blob, chunk2QHCOESN_js.sanitizeDownloadFilename(filename));
|
|
6933
6926
|
}
|
|
6934
6927
|
|
|
6935
6928
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7030,21 +7023,21 @@ function useExportHandlers(input) {
|
|
|
7030
7023
|
{
|
|
7031
7024
|
scale: 2,
|
|
7032
7025
|
onProgress: (current, total) => {
|
|
7033
|
-
setExportProgress(
|
|
7034
|
-
setExportStatusMessage(
|
|
7026
|
+
setExportProgress(chunk2QHCOESN_js.slideProgressPercent(current, total));
|
|
7027
|
+
setExportStatusMessage(chunk2QHCOESN_js.slideStatusLabel("Rendering", current, total));
|
|
7035
7028
|
},
|
|
7036
7029
|
signal: abortCtrl.signal
|
|
7037
7030
|
}
|
|
7038
7031
|
);
|
|
7039
|
-
setExportProgress(
|
|
7032
|
+
setExportProgress(chunk2QHCOESN_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7040
7033
|
setExportStatusMessage("Building PDF...");
|
|
7041
7034
|
await new Promise((r) => {
|
|
7042
7035
|
setTimeout(r, 100);
|
|
7043
7036
|
});
|
|
7044
|
-
setExportProgress(
|
|
7037
|
+
setExportProgress(chunk2QHCOESN_js.EXPORT_DONE_PERCENT);
|
|
7045
7038
|
setExportStatusMessage("Done!");
|
|
7046
7039
|
} catch (err) {
|
|
7047
|
-
if (!
|
|
7040
|
+
if (!chunk2QHCOESN_js.isExportAbortError(err)) {
|
|
7048
7041
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7049
7042
|
}
|
|
7050
7043
|
} finally {
|
|
@@ -7074,21 +7067,21 @@ function useExportHandlers(input) {
|
|
|
7074
7067
|
{
|
|
7075
7068
|
scale: 2,
|
|
7076
7069
|
onProgress: (current, total) => {
|
|
7077
|
-
setExportProgress(
|
|
7078
|
-
setExportStatusMessage(
|
|
7070
|
+
setExportProgress(chunk2QHCOESN_js.slideProgressPercent(current, total));
|
|
7071
|
+
setExportStatusMessage(chunk2QHCOESN_js.slideStatusLabel("Rendering", current, total));
|
|
7079
7072
|
},
|
|
7080
7073
|
signal: abortCtrl.signal
|
|
7081
7074
|
}
|
|
7082
7075
|
);
|
|
7083
|
-
setExportProgress(
|
|
7076
|
+
setExportProgress(chunk2QHCOESN_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7084
7077
|
setExportStatusMessage("Building PDF...");
|
|
7085
7078
|
await new Promise((r) => {
|
|
7086
7079
|
setTimeout(r, 100);
|
|
7087
7080
|
});
|
|
7088
|
-
setExportProgress(
|
|
7081
|
+
setExportProgress(chunk2QHCOESN_js.EXPORT_DONE_PERCENT);
|
|
7089
7082
|
setExportStatusMessage("Done!");
|
|
7090
7083
|
} catch (err) {
|
|
7091
|
-
if (!
|
|
7084
|
+
if (!chunk2QHCOESN_js.isExportAbortError(err)) {
|
|
7092
7085
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7093
7086
|
}
|
|
7094
7087
|
} finally {
|
|
@@ -7129,22 +7122,22 @@ function useExportHandlers(input) {
|
|
|
7129
7122
|
scale: 1,
|
|
7130
7123
|
slideDurationMs: 3e3,
|
|
7131
7124
|
onProgress: (current, total) => {
|
|
7132
|
-
setExportProgress(
|
|
7133
|
-
setExportStatusMessage(
|
|
7125
|
+
setExportProgress(chunk2QHCOESN_js.slideProgressPercent(current, total, 45));
|
|
7126
|
+
setExportStatusMessage(chunk2QHCOESN_js.slideStatusLabel("Capturing", current, total));
|
|
7134
7127
|
},
|
|
7135
7128
|
onRecordProgress: (current, total) => {
|
|
7136
|
-
setExportProgress(
|
|
7137
|
-
setExportStatusMessage(
|
|
7129
|
+
setExportProgress(chunk2QHCOESN_js.recordProgressPercent(current, total));
|
|
7130
|
+
setExportStatusMessage(chunk2QHCOESN_js.slideStatusLabel("Recording", current, total));
|
|
7138
7131
|
},
|
|
7139
7132
|
signal: abortCtrl.signal
|
|
7140
7133
|
}
|
|
7141
7134
|
);
|
|
7142
|
-
setExportProgress(
|
|
7135
|
+
setExportProgress(chunk2QHCOESN_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7143
7136
|
setExportStatusMessage("Saving file...");
|
|
7144
7137
|
downloadBlob2(blob, "presentation.webm");
|
|
7145
|
-
setExportProgress(
|
|
7138
|
+
setExportProgress(chunk2QHCOESN_js.EXPORT_DONE_PERCENT);
|
|
7146
7139
|
} catch (err) {
|
|
7147
|
-
if (!
|
|
7140
|
+
if (!chunk2QHCOESN_js.isExportAbortError(err)) {
|
|
7148
7141
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7149
7142
|
}
|
|
7150
7143
|
} finally {
|
|
@@ -7172,18 +7165,18 @@ function useExportHandlers(input) {
|
|
|
7172
7165
|
scale: 0.5,
|
|
7173
7166
|
slideDurationMs: 2e3,
|
|
7174
7167
|
onProgress: (current, total) => {
|
|
7175
|
-
setExportProgress(
|
|
7176
|
-
setExportStatusMessage(
|
|
7168
|
+
setExportProgress(chunk2QHCOESN_js.slideProgressPercent(current, total));
|
|
7169
|
+
setExportStatusMessage(chunk2QHCOESN_js.slideStatusLabel("Encoding", current, total));
|
|
7177
7170
|
},
|
|
7178
7171
|
signal: abortCtrl.signal
|
|
7179
7172
|
}
|
|
7180
7173
|
);
|
|
7181
|
-
setExportProgress(
|
|
7174
|
+
setExportProgress(chunk2QHCOESN_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7182
7175
|
setExportStatusMessage("Saving file...");
|
|
7183
7176
|
downloadBlob2(blob, "presentation.gif");
|
|
7184
|
-
setExportProgress(
|
|
7177
|
+
setExportProgress(chunk2QHCOESN_js.EXPORT_DONE_PERCENT);
|
|
7185
7178
|
} catch (err) {
|
|
7186
|
-
if (!
|
|
7179
|
+
if (!chunk2QHCOESN_js.isExportAbortError(err)) {
|
|
7187
7180
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7188
7181
|
}
|
|
7189
7182
|
} finally {
|
|
@@ -7223,7 +7216,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7223
7216
|
}
|
|
7224
7217
|
printWindow.document.open();
|
|
7225
7218
|
printWindow.document.write(
|
|
7226
|
-
|
|
7219
|
+
chunk2QHCOESN_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7227
7220
|
);
|
|
7228
7221
|
printWindow.document.close();
|
|
7229
7222
|
printWindow.focus();
|
|
@@ -7284,7 +7277,7 @@ function usePrintHandlers(input) {
|
|
|
7284
7277
|
if (svgs.length === 0) {
|
|
7285
7278
|
return;
|
|
7286
7279
|
}
|
|
7287
|
-
const printDoc =
|
|
7280
|
+
const printDoc = chunk2QHCOESN_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7288
7281
|
title: "Slides (Vector)",
|
|
7289
7282
|
orientation: settings.orientation,
|
|
7290
7283
|
colorFilter
|
|
@@ -7320,7 +7313,7 @@ function usePrintHandlers(input) {
|
|
|
7320
7313
|
if (settings.printWhat === "outline") {
|
|
7321
7314
|
openPrintWindow(
|
|
7322
7315
|
"Outline",
|
|
7323
|
-
`<div class="outline-page">${
|
|
7316
|
+
`<div class="outline-page">${chunk2QHCOESN_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7324
7317
|
settings.orientation,
|
|
7325
7318
|
colorFilter,
|
|
7326
7319
|
settings.frameSlides
|
|
@@ -7345,7 +7338,7 @@ function usePrintHandlers(input) {
|
|
|
7345
7338
|
if (settings.printWhat === "slides") {
|
|
7346
7339
|
openPrintWindow(
|
|
7347
7340
|
"Slides",
|
|
7348
|
-
|
|
7341
|
+
chunk2QHCOESN_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7349
7342
|
settings.orientation,
|
|
7350
7343
|
colorFilter,
|
|
7351
7344
|
settings.frameSlides
|
|
@@ -7355,7 +7348,7 @@ function usePrintHandlers(input) {
|
|
|
7355
7348
|
if (settings.printWhat === "notes") {
|
|
7356
7349
|
openPrintWindow(
|
|
7357
7350
|
"Notes Pages",
|
|
7358
|
-
|
|
7351
|
+
chunk2QHCOESN_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7359
7352
|
"portrait",
|
|
7360
7353
|
colorFilter,
|
|
7361
7354
|
settings.frameSlides
|
|
@@ -7366,7 +7359,7 @@ function usePrintHandlers(input) {
|
|
|
7366
7359
|
const spp = settings.slidesPerPage;
|
|
7367
7360
|
openPrintWindow(
|
|
7368
7361
|
`Handout ${spp} per page`,
|
|
7369
|
-
|
|
7362
|
+
chunk2QHCOESN_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7370
7363
|
"portrait",
|
|
7371
7364
|
colorFilter,
|
|
7372
7365
|
settings.frameSlides
|
|
@@ -7430,8 +7423,8 @@ function useThemeHandlers(input) {
|
|
|
7430
7423
|
return;
|
|
7431
7424
|
}
|
|
7432
7425
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7433
|
-
const previousMap = theme?.colorScheme ?
|
|
7434
|
-
setSlides((prev) =>
|
|
7426
|
+
const previousMap = theme?.colorScheme ? chunkR2H3FHK6_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7427
|
+
setSlides((prev) => chunkR2H3FHK6_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7435
7428
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7436
7429
|
bumpHistory();
|
|
7437
7430
|
history.markDirty();
|
|
@@ -7536,7 +7529,7 @@ function useThemeSwitching(input) {
|
|
|
7536
7529
|
}
|
|
7537
7530
|
try {
|
|
7538
7531
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7539
|
-
const newData =
|
|
7532
|
+
const newData = chunkR2H3FHK6_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7540
7533
|
onDataChange(newData);
|
|
7541
7534
|
onThemeChanged?.(preset);
|
|
7542
7535
|
} catch (error) {
|
|
@@ -7553,7 +7546,7 @@ function useThemeSwitching(input) {
|
|
|
7553
7546
|
}
|
|
7554
7547
|
try {
|
|
7555
7548
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7556
|
-
const newData =
|
|
7549
|
+
const newData = chunkR2H3FHK6_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7557
7550
|
onDataChange(newData);
|
|
7558
7551
|
} catch (error) {
|
|
7559
7552
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7565,12 +7558,12 @@ function useThemeSwitching(input) {
|
|
|
7565
7558
|
if (!data?.theme?.colorScheme) {
|
|
7566
7559
|
return void 0;
|
|
7567
7560
|
}
|
|
7568
|
-
return
|
|
7569
|
-
(p) =>
|
|
7561
|
+
return chunkR2H3FHK6_js.THEME_PRESETS.find(
|
|
7562
|
+
(p) => chunkR2H3FHK6_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7570
7563
|
);
|
|
7571
7564
|
}, [data?.theme?.colorScheme]);
|
|
7572
7565
|
return {
|
|
7573
|
-
presets:
|
|
7566
|
+
presets: chunkR2H3FHK6_js.THEME_PRESETS,
|
|
7574
7567
|
switchToPreset,
|
|
7575
7568
|
switchToCustom,
|
|
7576
7569
|
currentPreset
|
|
@@ -7645,7 +7638,7 @@ function usePropertyHandlers(input) {
|
|
|
7645
7638
|
}
|
|
7646
7639
|
try {
|
|
7647
7640
|
const ab = await file.arrayBuffer();
|
|
7648
|
-
const h = new
|
|
7641
|
+
const h = new chunkR2H3FHK6_js.PptxHandler();
|
|
7649
7642
|
const other = await h.load(ab);
|
|
7650
7643
|
if (!other) {
|
|
7651
7644
|
return;
|
|
@@ -7655,7 +7648,7 @@ function usePropertyHandlers(input) {
|
|
|
7655
7648
|
width: canvasSize.width,
|
|
7656
7649
|
height: canvasSize.height
|
|
7657
7650
|
};
|
|
7658
|
-
setCompareResult(
|
|
7651
|
+
setCompareResult(chunk2QHCOESN_js.comparePresentation(cur, other));
|
|
7659
7652
|
setIsComparePanelOpen(true);
|
|
7660
7653
|
} catch (err) {
|
|
7661
7654
|
console.warn("Compare failed:", err);
|
|
@@ -7672,7 +7665,7 @@ function usePropertyHandlers(input) {
|
|
|
7672
7665
|
if (!diff || diff.status === "unchanged") {
|
|
7673
7666
|
return;
|
|
7674
7667
|
}
|
|
7675
|
-
setSlides((prev) =>
|
|
7668
|
+
setSlides((prev) => chunk2QHCOESN_js.applyAcceptSlide(prev, diff));
|
|
7676
7669
|
setIsDirty(true);
|
|
7677
7670
|
},
|
|
7678
7671
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7683,10 +7676,10 @@ function usePropertyHandlers(input) {
|
|
|
7683
7676
|
if (!compareResult) {
|
|
7684
7677
|
return;
|
|
7685
7678
|
}
|
|
7686
|
-
setSlides((prev) =>
|
|
7679
|
+
setSlides((prev) => chunk2QHCOESN_js.applyAcceptAllSlides(prev, compareResult));
|
|
7687
7680
|
setIsDirty(true);
|
|
7688
7681
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7689
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7682
|
+
const usedFontFamilies = react.useMemo(() => chunk2QHCOESN_js.collectUsedFonts(slides), [slides]);
|
|
7690
7683
|
return {
|
|
7691
7684
|
handleUpdateNotes,
|
|
7692
7685
|
handleUpdateSlide,
|
|
@@ -7805,7 +7798,7 @@ function useIsMobile(input) {
|
|
|
7805
7798
|
const containerRef = input?.containerRef;
|
|
7806
7799
|
const isTouchDevice = react.useSyncExternalStore(
|
|
7807
7800
|
subscribeTouchCapability,
|
|
7808
|
-
|
|
7801
|
+
chunk2QHCOESN_js.detectTouchDevice,
|
|
7809
7802
|
() => false
|
|
7810
7803
|
// server snapshot
|
|
7811
7804
|
);
|
|
@@ -7821,7 +7814,7 @@ function useIsMobile(input) {
|
|
|
7821
7814
|
}
|
|
7822
7815
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
7823
7816
|
});
|
|
7824
|
-
const [orientation, setOrientation] = react.useState(
|
|
7817
|
+
const [orientation, setOrientation] = react.useState(chunk2QHCOESN_js.detectOrientation);
|
|
7825
7818
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
7826
7819
|
const [initialViewportHeight] = react.useState(
|
|
7827
7820
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -7865,7 +7858,7 @@ function useIsMobile(input) {
|
|
|
7865
7858
|
return;
|
|
7866
7859
|
}
|
|
7867
7860
|
const handleOrientationChange = () => {
|
|
7868
|
-
setOrientation(
|
|
7861
|
+
setOrientation(chunk2QHCOESN_js.detectOrientation());
|
|
7869
7862
|
};
|
|
7870
7863
|
if (screen.orientation) {
|
|
7871
7864
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -7895,9 +7888,9 @@ function useIsMobile(input) {
|
|
|
7895
7888
|
window.addEventListener("resize", handleResize);
|
|
7896
7889
|
return () => window.removeEventListener("resize", handleResize);
|
|
7897
7890
|
}, [isTouchDevice, initialViewportHeight]);
|
|
7898
|
-
const isMobile =
|
|
7899
|
-
const isTablet = !isMobile && containerWidth >=
|
|
7900
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
7891
|
+
const isMobile = chunk2QHCOESN_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
7892
|
+
const isTablet = !isMobile && containerWidth >= chunk2QHCOESN_js.MOBILE_BREAKPOINT && containerWidth < chunk2QHCOESN_js.TABLET_BREAKPOINT;
|
|
7893
|
+
const isDesktop = !isMobile && containerWidth >= chunk2QHCOESN_js.TABLET_BREAKPOINT;
|
|
7901
7894
|
return {
|
|
7902
7895
|
isMobile,
|
|
7903
7896
|
isTablet,
|
|
@@ -7958,11 +7951,11 @@ function useViewerDialogs(input) {
|
|
|
7958
7951
|
);
|
|
7959
7952
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(false);
|
|
7960
7953
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
7961
|
-
() => typeof window !== "undefined" ?
|
|
7954
|
+
() => typeof window !== "undefined" ? chunk2QHCOESN_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
7962
7955
|
);
|
|
7963
7956
|
react.useEffect(() => {
|
|
7964
7957
|
const handleWindow = () => setIsNarrowViewport(
|
|
7965
|
-
|
|
7958
|
+
chunk2QHCOESN_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
7966
7959
|
);
|
|
7967
7960
|
let observer = null;
|
|
7968
7961
|
let raf = 0;
|
|
@@ -7976,12 +7969,12 @@ function useViewerDialogs(input) {
|
|
|
7976
7969
|
const entry = entries[0];
|
|
7977
7970
|
if (entry) {
|
|
7978
7971
|
setIsNarrowViewport(
|
|
7979
|
-
|
|
7972
|
+
chunk2QHCOESN_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
7980
7973
|
);
|
|
7981
7974
|
}
|
|
7982
7975
|
});
|
|
7983
7976
|
observer.observe(el);
|
|
7984
|
-
setIsNarrowViewport(
|
|
7977
|
+
setIsNarrowViewport(chunk2QHCOESN_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
7985
7978
|
};
|
|
7986
7979
|
attach();
|
|
7987
7980
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8139,12 +8132,12 @@ function useViewerDialogs(input) {
|
|
|
8139
8132
|
}
|
|
8140
8133
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8141
8134
|
if (presentationGridSpacing) {
|
|
8142
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8135
|
+
const px = Math.round(presentationGridSpacing.cx / chunk2U243ZEP_js.EMU_PER_PX);
|
|
8143
8136
|
if (px > 0) {
|
|
8144
8137
|
return px;
|
|
8145
8138
|
}
|
|
8146
8139
|
}
|
|
8147
|
-
return
|
|
8140
|
+
return chunk2U243ZEP_js.GRID_SIZE;
|
|
8148
8141
|
}
|
|
8149
8142
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8150
8143
|
if (activeCustomShowId) {
|
|
@@ -8158,8 +8151,8 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
|
8158
8151
|
return slides.map((_, i) => i).filter((i) => !slides[i]?.hidden);
|
|
8159
8152
|
}
|
|
8160
8153
|
function computeSlideSectionGroups(slides, sections) {
|
|
8161
|
-
return
|
|
8162
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8154
|
+
return chunk2QHCOESN_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8155
|
+
id: group.section?.id ?? (sections.length > 0 ? chunk2U243ZEP_js.UNGROUPED_SECTION_ID : "default"),
|
|
8163
8156
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8164
8157
|
slideIndexes: group.slideIndexes,
|
|
8165
8158
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8214,7 +8207,7 @@ function useDerivedSlideState(input) {
|
|
|
8214
8207
|
);
|
|
8215
8208
|
const slideSectionGroups = react.useMemo(
|
|
8216
8209
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8217
|
-
if (group.id ===
|
|
8210
|
+
if (group.id === chunk2U243ZEP_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8218
8211
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8219
8212
|
}
|
|
8220
8213
|
if (group.id === "default" && group.label === "Slides") {
|
|
@@ -8320,7 +8313,7 @@ function useAnnotationHandlers(input) {
|
|
|
8320
8313
|
if (nextMode === "present") {
|
|
8321
8314
|
presentation.enterPresentMode();
|
|
8322
8315
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8323
|
-
|
|
8316
|
+
chunk2U243ZEP_js.stopAllPersistentAudio();
|
|
8324
8317
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8325
8318
|
if (promptKeepInkAnnotations) {
|
|
8326
8319
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8329,7 +8322,7 @@ function useAnnotationHandlers(input) {
|
|
|
8329
8322
|
}
|
|
8330
8323
|
} else {
|
|
8331
8324
|
if (mode === "present") {
|
|
8332
|
-
|
|
8325
|
+
chunk2U243ZEP_js.stopAllPersistentAudio();
|
|
8333
8326
|
}
|
|
8334
8327
|
setMode(nextMode);
|
|
8335
8328
|
}
|
|
@@ -8395,13 +8388,13 @@ function useSerialize(input) {
|
|
|
8395
8388
|
let processedSlide = slide;
|
|
8396
8389
|
if (pendingEditId) {
|
|
8397
8390
|
const updatedElements = slide.elements.map((el) => {
|
|
8398
|
-
if (el.id !== pendingEditId || !
|
|
8391
|
+
if (el.id !== pendingEditId || !chunkR2H3FHK6_js.hasTextProperties(el)) {
|
|
8399
8392
|
return el;
|
|
8400
8393
|
}
|
|
8401
8394
|
return {
|
|
8402
8395
|
...el,
|
|
8403
8396
|
text: pendingEditText,
|
|
8404
|
-
textSegments:
|
|
8397
|
+
textSegments: chunk2QHCOESN_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8405
8398
|
};
|
|
8406
8399
|
});
|
|
8407
8400
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8414,14 +8407,14 @@ function useSerialize(input) {
|
|
|
8414
8407
|
const pptxGuides = guides.map((g) => ({
|
|
8415
8408
|
id: g.id,
|
|
8416
8409
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8417
|
-
positionEmu:
|
|
8410
|
+
positionEmu: chunkR2H3FHK6_js.guidePxToEmu(g.position)
|
|
8418
8411
|
}));
|
|
8419
8412
|
return {
|
|
8420
8413
|
...processedSlide,
|
|
8421
8414
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8422
8415
|
};
|
|
8423
8416
|
});
|
|
8424
|
-
const slidesToSave =
|
|
8417
|
+
const slidesToSave = chunk2U243ZEP_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8425
8418
|
const saveOptions = {
|
|
8426
8419
|
headerFooter,
|
|
8427
8420
|
presentationProperties,
|
|
@@ -8595,7 +8588,7 @@ function usePresentationSetup(input) {
|
|
|
8595
8588
|
setShowKeepAnnotationsDialog(true);
|
|
8596
8589
|
} else {
|
|
8597
8590
|
if (mode === "present" && nextMode !== "present") {
|
|
8598
|
-
|
|
8591
|
+
chunk2U243ZEP_js.stopAllPersistentAudio();
|
|
8599
8592
|
stopAnimationSound();
|
|
8600
8593
|
}
|
|
8601
8594
|
setMode(nextMode);
|
|
@@ -8643,15 +8636,16 @@ function usePresentationSetup(input) {
|
|
|
8643
8636
|
}
|
|
8644
8637
|
})();
|
|
8645
8638
|
},
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8639
|
+
// PowerPoint's Ctrl+A "arrow" is the plain pointer, i.e. no active tool.
|
|
8640
|
+
onSetPointerTool: (tool) => annotations.setPresentationTool(tool === "arrow" ? "none" : tool),
|
|
8641
|
+
onEraseAnnotations: () => annotations.clearAnnotations(),
|
|
8642
|
+
onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
|
|
8649
8643
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8650
8644
|
onSaveRehearsalTimings: (timings) => {
|
|
8651
|
-
setSlides((prev) =>
|
|
8645
|
+
setSlides((prev) => chunk2QHCOESN_js.applyRehearsalTimings(prev, timings));
|
|
8652
8646
|
history.markDirty();
|
|
8653
8647
|
},
|
|
8654
|
-
loopContinuously:
|
|
8648
|
+
loopContinuously: chunk2QHCOESN_js.shouldLoopContinuously(presentationProperties),
|
|
8655
8649
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8656
8650
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8657
8651
|
endWithBlackSlide
|
|
@@ -8813,7 +8807,7 @@ function useEditorOperations(input) {
|
|
|
8813
8807
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
8814
8808
|
react.useEffect(() => {
|
|
8815
8809
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
8816
|
-
copiedFormatRef.current =
|
|
8810
|
+
copiedFormatRef.current = chunk2QHCOESN_js.copyFormatFromElement(selectedElement);
|
|
8817
8811
|
} else if (!formatPainterActive) {
|
|
8818
8812
|
copiedFormatRef.current = null;
|
|
8819
8813
|
}
|
|
@@ -8839,12 +8833,12 @@ function useEditorOperations(input) {
|
|
|
8839
8833
|
e.stopPropagation();
|
|
8840
8834
|
const element = elementLookup.get(elementId);
|
|
8841
8835
|
if (element) {
|
|
8842
|
-
const updated =
|
|
8836
|
+
const updated = chunk2QHCOESN_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
8843
8837
|
const updates = {};
|
|
8844
|
-
if (
|
|
8838
|
+
if (chunkR2H3FHK6_js.hasShapeProperties(updated)) {
|
|
8845
8839
|
updates.shapeStyle = updated.shapeStyle;
|
|
8846
8840
|
}
|
|
8847
|
-
if (
|
|
8841
|
+
if (chunkR2H3FHK6_js.hasTextProperties(updated)) {
|
|
8848
8842
|
updates.textStyle = updated.textStyle;
|
|
8849
8843
|
}
|
|
8850
8844
|
ops.updateElementById(elementId, updates);
|
|
@@ -8991,7 +8985,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
8991
8985
|
const families = /* @__PURE__ */ new Set();
|
|
8992
8986
|
for (const slide of slides) {
|
|
8993
8987
|
for (const el of slide.elements) {
|
|
8994
|
-
if (
|
|
8988
|
+
if (chunkR2H3FHK6_js.hasTextProperties(el) && el.textSegments) {
|
|
8995
8989
|
for (const seg of el.textSegments) {
|
|
8996
8990
|
if (seg.style.fontFamily) {
|
|
8997
8991
|
families.add(seg.style.fontFamily);
|
|
@@ -9560,7 +9554,7 @@ function useViewerIntegration(input) {
|
|
|
9560
9554
|
return zoom.scale;
|
|
9561
9555
|
},
|
|
9562
9556
|
setZoom(level) {
|
|
9563
|
-
zoom.setScale(Math.min(Math.max(level,
|
|
9557
|
+
zoom.setScale(Math.min(Math.max(level, chunk2U243ZEP_js.MIN_ZOOM_SCALE), chunk2U243ZEP_js.MAX_ZOOM_SCALE));
|
|
9564
9558
|
},
|
|
9565
9559
|
zoomIn() {
|
|
9566
9560
|
zoom.handleZoomIn();
|
|
@@ -9775,7 +9769,7 @@ function useReducedMotion() {
|
|
|
9775
9769
|
}
|
|
9776
9770
|
function useViewerOptions() {
|
|
9777
9771
|
const storeRef = react.useRef(null);
|
|
9778
|
-
storeRef.current ??=
|
|
9772
|
+
storeRef.current ??= chunk2QHCOESN_js.createViewerOptionsStore();
|
|
9779
9773
|
const store = storeRef.current;
|
|
9780
9774
|
const options = react.useSyncExternalStore(
|
|
9781
9775
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9784,9 +9778,9 @@ function useViewerOptions() {
|
|
|
9784
9778
|
);
|
|
9785
9779
|
return { optionsStore: store, options };
|
|
9786
9780
|
}
|
|
9787
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9781
|
+
var KNOWN_TAB_IDS = new Set(chunk2QHCOESN_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9788
9782
|
function computeToolbarVisibility(hiddenActions) {
|
|
9789
|
-
const isHidden = (id) =>
|
|
9783
|
+
const isHidden = (id) => chunk2QHCOESN_js.isActionHidden(id, hiddenActions);
|
|
9790
9784
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
9791
9785
|
return { isHidden, isTabVisible };
|
|
9792
9786
|
}
|
|
@@ -9871,13 +9865,13 @@ function useYjsDocumentSync({
|
|
|
9871
9865
|
return;
|
|
9872
9866
|
}
|
|
9873
9867
|
try {
|
|
9874
|
-
const { PptxHandler: PptxHandler2 } = await import('./dist-
|
|
9868
|
+
const { PptxHandler: PptxHandler2 } = await import('./dist-ZCJLIRYG.js');
|
|
9875
9869
|
const handler = new PptxHandler2();
|
|
9876
9870
|
await handler.load(sourceBytes.buffer);
|
|
9877
|
-
const currentSlides =
|
|
9871
|
+
const currentSlides = chunk2QHCOESN_js.readSlidesFromYDoc(
|
|
9878
9872
|
doc
|
|
9879
9873
|
);
|
|
9880
|
-
const slidesToSave =
|
|
9874
|
+
const slidesToSave = chunk2U243ZEP_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
9881
9875
|
const bytes = await handler.save(slidesToSave);
|
|
9882
9876
|
config.onWriteBack(bytes);
|
|
9883
9877
|
} catch {
|
|
@@ -9892,7 +9886,7 @@ function useYjsDocumentSync({
|
|
|
9892
9886
|
if (!doc || !isConnected) {
|
|
9893
9887
|
return;
|
|
9894
9888
|
}
|
|
9895
|
-
const docSlides =
|
|
9889
|
+
const docSlides = chunk2QHCOESN_js.readSlidesFromYDoc(
|
|
9896
9890
|
doc
|
|
9897
9891
|
);
|
|
9898
9892
|
if (docSlides.length === 0) {
|
|
@@ -9914,11 +9908,11 @@ function useYjsDocumentSync({
|
|
|
9914
9908
|
lastSyncedRef.current = serialized;
|
|
9915
9909
|
void (async () => {
|
|
9916
9910
|
const factories = await getFactories();
|
|
9917
|
-
|
|
9911
|
+
chunk2QHCOESN_js.reconcileSlidesInYDoc(
|
|
9918
9912
|
slides,
|
|
9919
9913
|
doc,
|
|
9920
9914
|
factories,
|
|
9921
|
-
|
|
9915
|
+
chunk2QHCOESN_js.LOCAL_SYNC_ORIGIN
|
|
9922
9916
|
);
|
|
9923
9917
|
scheduleWriteBack();
|
|
9924
9918
|
})();
|
|
@@ -9932,10 +9926,10 @@ function useYjsDocumentSync({
|
|
|
9932
9926
|
return;
|
|
9933
9927
|
}
|
|
9934
9928
|
const handleChange = (_events, transaction) => {
|
|
9935
|
-
if (transaction?.origin ===
|
|
9929
|
+
if (transaction?.origin === chunk2QHCOESN_js.LOCAL_SYNC_ORIGIN) {
|
|
9936
9930
|
return;
|
|
9937
9931
|
}
|
|
9938
|
-
const remoteSlides =
|
|
9932
|
+
const remoteSlides = chunk2QHCOESN_js.readSlidesFromYDoc(
|
|
9939
9933
|
doc
|
|
9940
9934
|
);
|
|
9941
9935
|
if (remoteSlides.length === 0) {
|
|
@@ -9951,7 +9945,7 @@ function useYjsDocumentSync({
|
|
|
9951
9945
|
isApplyingRemoteRef.current = false;
|
|
9952
9946
|
scheduleWriteBack();
|
|
9953
9947
|
};
|
|
9954
|
-
const unobserve =
|
|
9948
|
+
const unobserve = chunk2QHCOESN_js.observeYDocSlides(
|
|
9955
9949
|
doc,
|
|
9956
9950
|
handleChange
|
|
9957
9951
|
);
|
|
@@ -9989,7 +9983,7 @@ function useBroadcastFollower({
|
|
|
9989
9983
|
if (!broadcaster) {
|
|
9990
9984
|
return;
|
|
9991
9985
|
}
|
|
9992
|
-
if (!
|
|
9986
|
+
if (!chunk2QHCOESN_js.shouldAutoFollowBroadcaster({
|
|
9993
9987
|
localRole: collab.config.role,
|
|
9994
9988
|
broadcasterRole: broadcaster.role
|
|
9995
9989
|
})) {
|
|
@@ -10149,10 +10143,10 @@ function useTouchGestures(input) {
|
|
|
10149
10143
|
if (!el || !enabled) {
|
|
10150
10144
|
return;
|
|
10151
10145
|
}
|
|
10152
|
-
const recognizer =
|
|
10146
|
+
const recognizer = chunk2QHCOESN_js.createTouchGestureRecognizer({
|
|
10153
10147
|
getScale: () => scaleRef.current,
|
|
10154
|
-
minScale:
|
|
10155
|
-
maxScale:
|
|
10148
|
+
minScale: chunk2U243ZEP_js.MIN_ZOOM_SCALE,
|
|
10149
|
+
maxScale: chunk2U243ZEP_js.MAX_ZOOM_SCALE,
|
|
10156
10150
|
callbacks: {
|
|
10157
10151
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10158
10152
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10192,7 +10186,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10192
10186
|
return;
|
|
10193
10187
|
}
|
|
10194
10188
|
const rect = active.getBoundingClientRect();
|
|
10195
|
-
const delta =
|
|
10189
|
+
const delta = chunk2QHCOESN_js.computeScrollDelta(
|
|
10196
10190
|
{ top: rect.top, bottom: rect.bottom },
|
|
10197
10191
|
window.innerHeight,
|
|
10198
10192
|
keyboardInset
|
|
@@ -10212,8 +10206,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10212
10206
|
return;
|
|
10213
10207
|
}
|
|
10214
10208
|
const update = () => {
|
|
10215
|
-
const metrics =
|
|
10216
|
-
const inset = metrics ?
|
|
10209
|
+
const metrics = chunk2QHCOESN_js.readViewportMetrics(window);
|
|
10210
|
+
const inset = metrics ? chunk2QHCOESN_js.computeKeyboardInset(metrics) : 0;
|
|
10217
10211
|
setKeyboardInset(inset);
|
|
10218
10212
|
if (inset > 0) {
|
|
10219
10213
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10224,8 +10218,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10224
10218
|
vv.addEventListener("scroll", update);
|
|
10225
10219
|
const onFocusIn = () => {
|
|
10226
10220
|
window.requestAnimationFrame(() => {
|
|
10227
|
-
const metrics =
|
|
10228
|
-
const inset = metrics ?
|
|
10221
|
+
const metrics = chunk2QHCOESN_js.readViewportMetrics(window);
|
|
10222
|
+
const inset = metrics ? chunk2QHCOESN_js.computeKeyboardInset(metrics) : 0;
|
|
10229
10223
|
if (inset > 0) {
|
|
10230
10224
|
scrollFocusedIntoView(inset);
|
|
10231
10225
|
}
|
|
@@ -10238,7 +10232,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10238
10232
|
document.removeEventListener("focusin", onFocusIn);
|
|
10239
10233
|
};
|
|
10240
10234
|
}, [enabled]);
|
|
10241
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10235
|
+
return { keyboardInset, isKeyboardOpen: chunk2QHCOESN_js.isKeyboardOpen(keyboardInset) };
|
|
10242
10236
|
}
|
|
10243
10237
|
|
|
10244
10238
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10293,13 +10287,13 @@ function buildCanvasProps(input) {
|
|
|
10293
10287
|
if (mode === "present") {
|
|
10294
10288
|
presentation.handlePresentationAction(action);
|
|
10295
10289
|
} else if (action.url) {
|
|
10296
|
-
|
|
10290
|
+
chunk2QHCOESN_js.safeOpenUrl(action.url);
|
|
10297
10291
|
}
|
|
10298
10292
|
};
|
|
10299
10293
|
const handleHyperlinkClick = (url) => {
|
|
10300
|
-
if (
|
|
10294
|
+
if (chunk2QHCOESN_js.isPpactionUrl(url)) {
|
|
10301
10295
|
if (mode === "present") {
|
|
10302
|
-
const parsed =
|
|
10296
|
+
const parsed = chunk2QHCOESN_js.parsePpactionUrl(url);
|
|
10303
10297
|
if (parsed) {
|
|
10304
10298
|
presentation.handlePresentationAction({
|
|
10305
10299
|
action: parsed.action,
|
|
@@ -10309,7 +10303,7 @@ function buildCanvasProps(input) {
|
|
|
10309
10303
|
}
|
|
10310
10304
|
return;
|
|
10311
10305
|
}
|
|
10312
|
-
|
|
10306
|
+
chunk2QHCOESN_js.safeOpenUrl(url);
|
|
10313
10307
|
};
|
|
10314
10308
|
return {
|
|
10315
10309
|
activeSlide: effectiveSlide,
|
|
@@ -10629,7 +10623,7 @@ function buildToolbarProps(input) {
|
|
|
10629
10623
|
onOpenFile,
|
|
10630
10624
|
onOpenRecentFile,
|
|
10631
10625
|
onCreatePresentation: (templateId) => {
|
|
10632
|
-
s.setSlides(
|
|
10626
|
+
s.setSlides(chunk2QHCOESN_js.createBackstagePresentation(templateId));
|
|
10633
10627
|
s.setActiveSlideIndex(0);
|
|
10634
10628
|
s.setSelectedElementId(null);
|
|
10635
10629
|
s.setSelectedElementIds([]);
|
|
@@ -10684,7 +10678,7 @@ function buildToolbarProps(input) {
|
|
|
10684
10678
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10685
10679
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10686
10680
|
formatPainterActive: s.formatPainterActive,
|
|
10687
|
-
canActivateFormatPainter:
|
|
10681
|
+
canActivateFormatPainter: chunk2QHCOESN_js.hasCopyableFormat(selectedElement),
|
|
10688
10682
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10689
10683
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10690
10684
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -10947,7 +10941,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
10947
10941
|
}, [incomingContent]);
|
|
10948
10942
|
const onOpenFile = react.useCallback(() => {
|
|
10949
10943
|
void (async () => {
|
|
10950
|
-
const picked = await
|
|
10944
|
+
const picked = await chunk2QHCOESN_js.openPptxFile();
|
|
10951
10945
|
if (picked) {
|
|
10952
10946
|
setContent(picked.buffer);
|
|
10953
10947
|
}
|
|
@@ -10955,7 +10949,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
10955
10949
|
}, []);
|
|
10956
10950
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
10957
10951
|
void (async () => {
|
|
10958
|
-
const bytes = await
|
|
10952
|
+
const bytes = await chunk2QHCOESN_js.readBackstageRecentFile(key);
|
|
10959
10953
|
if (bytes) {
|
|
10960
10954
|
setContent(bytes);
|
|
10961
10955
|
}
|