pptx-react-viewer 2.13.2 → 2.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/{AiChatPanel-F4E3A2DE.js → AiChatPanel-4WPZXJMM.js} +23 -23
- package/dist/AiChatPanel-4WPZXJMM.js.br +0 -0
- package/dist/AiChatPanel-4WPZXJMM.js.gz +0 -0
- package/dist/{AiChatPanel-VEULATXX.mjs → AiChatPanel-Q6D53GMZ.mjs} +4 -4
- package/dist/AiChatPanel-Q6D53GMZ.mjs.br +0 -0
- package/dist/AiChatPanel-Q6D53GMZ.mjs.gz +0 -0
- package/dist/{Model3DScene-TD2LIHYP.js → Model3DScene-CV3IGH6V.js} +2 -2
- package/dist/Model3DScene-CV3IGH6V.js.br +0 -0
- package/dist/Model3DScene-CV3IGH6V.js.gz +0 -0
- package/dist/{Model3DScene-KIPEODEJ.mjs → Model3DScene-N6PGFO2X.mjs} +1 -1
- package/dist/Model3DScene-N6PGFO2X.mjs.br +0 -0
- package/dist/Model3DScene-N6PGFO2X.mjs.gz +0 -0
- package/dist/{PowerPointViewer-Cjn1RgSz.d.ts → PowerPointViewer-Du7u4INi.d.ts} +2 -2
- package/dist/{PowerPointViewer-Cjn1RgSz.d.ts.map → PowerPointViewer-Du7u4INi.d.ts.map} +1 -1
- package/dist/{SurfaceChart3DScene-GRBWZ52S.mjs → SurfaceChart3DScene-H5ID4CUU.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-GRBWZ52S.mjs.br → SurfaceChart3DScene-H5ID4CUU.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-H5ID4CUU.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-OTKXQH5O.js → SurfaceChart3DScene-WXXMMXFZ.js} +2 -2
- package/dist/SurfaceChart3DScene-WXXMMXFZ.js.br +0 -0
- package/dist/SurfaceChart3DScene-WXXMMXFZ.js.gz +0 -0
- package/dist/{audience-content-store-BMlth_3U.d.ts → audience-content-store-DaABTAcQ.d.ts} +2 -2
- package/dist/{audience-content-store-BMlth_3U.d.ts.map → audience-content-store-DaABTAcQ.d.ts.map} +1 -1
- package/dist/{chunk-BXAK3JFM.js → chunk-3ISYPBSX.js} +74 -2
- package/dist/chunk-3ISYPBSX.js.br +0 -0
- package/dist/chunk-3ISYPBSX.js.gz +0 -0
- package/dist/{chunk-GKOKCOXR.mjs → chunk-3JTRZVYW.mjs} +8979 -949
- package/dist/chunk-3JTRZVYW.mjs.br +0 -0
- package/dist/chunk-3JTRZVYW.mjs.gz +0 -0
- package/dist/{chunk-GZ6TXBEO.mjs → chunk-56L4QYDT.mjs} +285 -325
- package/dist/chunk-56L4QYDT.mjs.br +0 -0
- package/dist/chunk-56L4QYDT.mjs.gz +0 -0
- package/dist/{chunk-TEXIGSA6.mjs → chunk-5YV26HMJ.mjs} +74 -2
- package/dist/chunk-5YV26HMJ.mjs.br +0 -0
- package/dist/chunk-5YV26HMJ.mjs.gz +0 -0
- package/dist/{chunk-VY3KLDJF.js → chunk-CUFEHK42.js} +39 -5
- package/dist/chunk-CUFEHK42.js.br +0 -0
- package/dist/chunk-CUFEHK42.js.gz +0 -0
- package/dist/{chunk-DOS7NY7C.js → chunk-HZSUTVDQ.js} +527 -567
- package/dist/chunk-HZSUTVDQ.js.br +0 -0
- package/dist/chunk-HZSUTVDQ.js.gz +0 -0
- package/dist/{chunk-FDR5W67L.js → chunk-KA35ZMIP.js} +9003 -955
- package/dist/chunk-KA35ZMIP.js.br +0 -0
- package/dist/chunk-KA35ZMIP.js.gz +0 -0
- package/dist/{chunk-EUQ2IER3.js → chunk-N6MSPBMO.js} +12317 -12036
- package/dist/chunk-N6MSPBMO.js.br +0 -0
- package/dist/chunk-N6MSPBMO.js.gz +0 -0
- package/dist/{chunk-ZFRPPY2N.mjs → chunk-PDUTW6MW.mjs} +249 -104
- package/dist/chunk-PDUTW6MW.mjs.br +0 -0
- package/dist/chunk-PDUTW6MW.mjs.gz +0 -0
- package/dist/{chunk-3HWE6QZG.mjs → chunk-SHICB6DW.mjs} +11168 -10889
- package/dist/chunk-SHICB6DW.mjs.br +0 -0
- package/dist/chunk-SHICB6DW.mjs.gz +0 -0
- package/dist/{chunk-BNSCH4WT.js → chunk-TQMJGYGQ.js} +572 -427
- package/dist/chunk-TQMJGYGQ.js.br +0 -0
- package/dist/chunk-TQMJGYGQ.js.gz +0 -0
- package/dist/{chunk-L5YGPCQW.mjs → chunk-WMZAM3UH.mjs} +37 -3
- package/dist/chunk-WMZAM3UH.mjs.br +0 -0
- package/dist/chunk-WMZAM3UH.mjs.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +139 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +56 -36
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +124 -4
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{types-DciBT90G.d.ts → types-DU35aAJK.d.ts} +2 -2
- package/dist/{types-DciBT90G.d.ts.map → types-DU35aAJK.d.ts.map} +1 -1
- package/dist/{useViewerBuildingBlocks-YvCYsxa3.d.ts → useViewerBuildingBlocks-CBZrHhxl.d.ts} +10 -5
- package/dist/useViewerBuildingBlocks-CBZrHhxl.d.ts.map +1 -0
- package/dist/viewer/index.d.ts +104 -4
- package/dist/viewer/index.d.ts.map +1 -1
- package/dist/viewer/index.js +42 -22
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +2 -2
- package/dist/AiChatPanel-F4E3A2DE.js.br +0 -0
- package/dist/AiChatPanel-F4E3A2DE.js.gz +0 -0
- package/dist/AiChatPanel-VEULATXX.mjs.br +0 -0
- package/dist/AiChatPanel-VEULATXX.mjs.gz +0 -0
- package/dist/Model3DScene-KIPEODEJ.mjs.br +0 -0
- package/dist/Model3DScene-KIPEODEJ.mjs.gz +0 -0
- package/dist/Model3DScene-TD2LIHYP.js.br +0 -0
- package/dist/Model3DScene-TD2LIHYP.js.gz +0 -0
- package/dist/SurfaceChart3DScene-GRBWZ52S.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-OTKXQH5O.js.br +0 -0
- package/dist/SurfaceChart3DScene-OTKXQH5O.js.gz +0 -0
- package/dist/chunk-3HWE6QZG.mjs.br +0 -0
- package/dist/chunk-3HWE6QZG.mjs.gz +0 -0
- package/dist/chunk-BNSCH4WT.js.br +0 -0
- package/dist/chunk-BNSCH4WT.js.gz +0 -0
- package/dist/chunk-BXAK3JFM.js.br +0 -0
- package/dist/chunk-BXAK3JFM.js.gz +0 -0
- package/dist/chunk-DOS7NY7C.js.br +0 -0
- package/dist/chunk-DOS7NY7C.js.gz +0 -0
- package/dist/chunk-EUQ2IER3.js.br +0 -0
- package/dist/chunk-EUQ2IER3.js.gz +0 -0
- package/dist/chunk-FDR5W67L.js.br +0 -0
- package/dist/chunk-FDR5W67L.js.gz +0 -0
- package/dist/chunk-GKOKCOXR.mjs.br +0 -0
- package/dist/chunk-GKOKCOXR.mjs.gz +0 -0
- package/dist/chunk-GZ6TXBEO.mjs.br +0 -0
- package/dist/chunk-GZ6TXBEO.mjs.gz +0 -0
- package/dist/chunk-L5YGPCQW.mjs.br +0 -0
- package/dist/chunk-L5YGPCQW.mjs.gz +0 -0
- package/dist/chunk-TEXIGSA6.mjs.br +0 -0
- package/dist/chunk-TEXIGSA6.mjs.gz +0 -0
- package/dist/chunk-VY3KLDJF.js.br +0 -0
- package/dist/chunk-VY3KLDJF.js.gz +0 -0
- package/dist/chunk-ZFRPPY2N.mjs.br +0 -0
- package/dist/chunk-ZFRPPY2N.mjs.gz +0 -0
- package/dist/useViewerBuildingBlocks-YvCYsxa3.d.ts.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkHZSUTVDQ_js = require('./chunk-HZSUTVDQ.js');
|
|
4
|
+
var chunk3ISYPBSX_js = require('./chunk-3ISYPBSX.js');
|
|
5
|
+
var chunkKA35ZMIP_js = require('./chunk-KA35ZMIP.js');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var JSZip = require('jszip');
|
|
8
8
|
var reactI18next = require('react-i18next');
|
|
@@ -14,7 +14,7 @@ var JSZip__default = /*#__PURE__*/_interopDefault(JSZip);
|
|
|
14
14
|
function useVirtualizedSlides({
|
|
15
15
|
totalItems,
|
|
16
16
|
itemHeight,
|
|
17
|
-
overscan =
|
|
17
|
+
overscan = chunkKA35ZMIP_js.DEFAULT_VIRTUAL_OVERSCAN
|
|
18
18
|
}) {
|
|
19
19
|
const scrollContainerRef = react.useRef(null);
|
|
20
20
|
const [scrollTop, setScrollTop] = react.useState(0);
|
|
@@ -44,7 +44,7 @@ function useVirtualizedSlides({
|
|
|
44
44
|
resizeObserver?.disconnect();
|
|
45
45
|
};
|
|
46
46
|
}, []);
|
|
47
|
-
const range =
|
|
47
|
+
const range = chunkKA35ZMIP_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
|
|
48
48
|
const safeItemHeight = Math.max(itemHeight, 1);
|
|
49
49
|
const scrollToIndex = react.useCallback(
|
|
50
50
|
(index, behavior = "smooth") => {
|
|
@@ -84,6 +84,9 @@ function usePresenceTracking({
|
|
|
84
84
|
canvasHeight
|
|
85
85
|
}) {
|
|
86
86
|
const [remoteUsers, setRemoteUsers] = react.useState([]);
|
|
87
|
+
const projectorRef = react.useRef(null);
|
|
88
|
+
projectorRef.current ??= chunkKA35ZMIP_js.createPresenceProjector();
|
|
89
|
+
const projector = projectorRef.current;
|
|
87
90
|
const lastBroadcastRef = react.useRef(0);
|
|
88
91
|
const pendingBroadcastRef = react.useRef(null);
|
|
89
92
|
const latestLocalState = react.useRef({});
|
|
@@ -107,7 +110,7 @@ function usePresenceTracking({
|
|
|
107
110
|
awareness.setLocalStateField("presence", state);
|
|
108
111
|
lastBroadcastRef.current = Date.now();
|
|
109
112
|
};
|
|
110
|
-
if (elapsed >=
|
|
113
|
+
if (elapsed >= chunkKA35ZMIP_js.BROADCAST_THROTTLE_MS) {
|
|
111
114
|
if (pendingBroadcastRef.current) {
|
|
112
115
|
clearTimeout(pendingBroadcastRef.current);
|
|
113
116
|
pendingBroadcastRef.current = null;
|
|
@@ -117,7 +120,7 @@ function usePresenceTracking({
|
|
|
117
120
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
118
121
|
pendingBroadcastRef.current = null;
|
|
119
122
|
flush();
|
|
120
|
-
},
|
|
123
|
+
}, chunkKA35ZMIP_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
121
124
|
}
|
|
122
125
|
},
|
|
123
126
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -142,13 +145,16 @@ function usePresenceTracking({
|
|
|
142
145
|
return;
|
|
143
146
|
}
|
|
144
147
|
const handleChange = () => {
|
|
145
|
-
const
|
|
148
|
+
const { list, changed } = projector.project(
|
|
146
149
|
awareness.getStates(),
|
|
147
150
|
localClientId,
|
|
148
151
|
canvasWidth,
|
|
149
152
|
canvasHeight
|
|
150
153
|
);
|
|
151
|
-
|
|
154
|
+
if (!changed) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
setRemoteUsers(list);
|
|
152
158
|
};
|
|
153
159
|
awareness.on("change", handleChange);
|
|
154
160
|
awareness.on("update", handleChange);
|
|
@@ -157,7 +163,7 @@ function usePresenceTracking({
|
|
|
157
163
|
awareness.off("change", handleChange);
|
|
158
164
|
awareness.off("update", handleChange);
|
|
159
165
|
};
|
|
160
|
-
}, [awareness, localClientId, canvasWidth, canvasHeight]);
|
|
166
|
+
}, [awareness, localClientId, canvasWidth, canvasHeight, projector]);
|
|
161
167
|
react.useEffect(() => {
|
|
162
168
|
if (!awareness) {
|
|
163
169
|
return;
|
|
@@ -194,7 +200,7 @@ function useYjsProvider({ config }) {
|
|
|
194
200
|
const departureRef = react.useRef(null);
|
|
195
201
|
const gateRef = react.useRef(null);
|
|
196
202
|
if (!gateRef.current) {
|
|
197
|
-
gateRef.current =
|
|
203
|
+
gateRef.current = chunkKA35ZMIP_js.createSyncGate(() => setSynced(true));
|
|
198
204
|
}
|
|
199
205
|
const teardown = react.useCallback(() => {
|
|
200
206
|
if (timeoutRef.current) {
|
|
@@ -214,7 +220,7 @@ function useYjsProvider({ config }) {
|
|
|
214
220
|
const buildCleanup = react.useCallback(
|
|
215
221
|
(provider, yDoc) => () => {
|
|
216
222
|
announceDeparture();
|
|
217
|
-
|
|
223
|
+
chunkKA35ZMIP_js.clearLocalAwareness(provider.awareness);
|
|
218
224
|
provider.destroy();
|
|
219
225
|
yDoc.destroy();
|
|
220
226
|
setDoc(null);
|
|
@@ -239,9 +245,9 @@ function useYjsProvider({ config }) {
|
|
|
239
245
|
if (config.authToken) {
|
|
240
246
|
opts.password = config.authToken;
|
|
241
247
|
}
|
|
242
|
-
const roomId =
|
|
248
|
+
const roomId = chunkKA35ZMIP_js.validateRoomId(config.roomId);
|
|
243
249
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
244
|
-
departureRef.current =
|
|
250
|
+
departureRef.current = chunkKA35ZMIP_js.createDepartureChannel(roomId, provider.awareness);
|
|
245
251
|
setDoc(yDoc);
|
|
246
252
|
setAwareness(provider.awareness);
|
|
247
253
|
setClientId(provider.awareness.clientID);
|
|
@@ -283,13 +289,13 @@ function useYjsProvider({ config }) {
|
|
|
283
289
|
if (!config) {
|
|
284
290
|
return;
|
|
285
291
|
}
|
|
286
|
-
const roomId =
|
|
287
|
-
const transport = config.transport ??
|
|
292
|
+
const roomId = chunkKA35ZMIP_js.validateRoomId(config.roomId);
|
|
293
|
+
const transport = config.transport ?? chunkKA35ZMIP_js.resolveTransportForServerUrl(config.serverUrl);
|
|
288
294
|
if (transport === "webrtc") {
|
|
289
295
|
await initWebrtc();
|
|
290
296
|
return;
|
|
291
297
|
}
|
|
292
|
-
if (
|
|
298
|
+
if (chunkKA35ZMIP_js.isMixedContentBlocked(config.serverUrl)) {
|
|
293
299
|
console.warn(
|
|
294
300
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
295
301
|
);
|
|
@@ -303,7 +309,7 @@ function useYjsProvider({ config }) {
|
|
|
303
309
|
const provider = new WebsocketProvider(config.serverUrl, roomId, yDoc, {
|
|
304
310
|
params: config.authToken ? { token: config.authToken } : void 0
|
|
305
311
|
});
|
|
306
|
-
departureRef.current =
|
|
312
|
+
departureRef.current = chunkKA35ZMIP_js.createDepartureChannel(roomId, provider.awareness);
|
|
307
313
|
let connected = false;
|
|
308
314
|
const handleStatus = (event) => {
|
|
309
315
|
if (event.status === "connected") {
|
|
@@ -343,7 +349,7 @@ function useYjsProvider({ config }) {
|
|
|
343
349
|
provider.off("status", handleStatus);
|
|
344
350
|
provider.off("sync", handleSynced);
|
|
345
351
|
announceDeparture();
|
|
346
|
-
|
|
352
|
+
chunkKA35ZMIP_js.clearLocalAwareness(provider.awareness);
|
|
347
353
|
provider.destroy();
|
|
348
354
|
yDoc.destroy();
|
|
349
355
|
setDoc(null);
|
|
@@ -352,7 +358,7 @@ function useYjsProvider({ config }) {
|
|
|
352
358
|
cleanupRef.current = null;
|
|
353
359
|
setStatus("error");
|
|
354
360
|
}
|
|
355
|
-
},
|
|
361
|
+
}, chunkKA35ZMIP_js.CONNECTION_TIMEOUT_MS);
|
|
356
362
|
}
|
|
357
363
|
setDoc(yDoc);
|
|
358
364
|
setAwareness(provider.awareness);
|
|
@@ -361,7 +367,7 @@ function useYjsProvider({ config }) {
|
|
|
361
367
|
provider.off("status", handleStatus);
|
|
362
368
|
provider.off("sync", handleSynced);
|
|
363
369
|
announceDeparture();
|
|
364
|
-
|
|
370
|
+
chunkKA35ZMIP_js.clearLocalAwareness(provider.awareness);
|
|
365
371
|
provider.destroy();
|
|
366
372
|
yDoc.destroy();
|
|
367
373
|
setDoc(null);
|
|
@@ -387,7 +393,7 @@ function useYjsProvider({ config }) {
|
|
|
387
393
|
]);
|
|
388
394
|
react.useEffect(() => {
|
|
389
395
|
init();
|
|
390
|
-
const disposeTeardown =
|
|
396
|
+
const disposeTeardown = chunkKA35ZMIP_js.registerCollaborationTeardown({
|
|
391
397
|
leave: teardown,
|
|
392
398
|
rejoin: init
|
|
393
399
|
});
|
|
@@ -408,7 +414,7 @@ function useCollaborativeState({
|
|
|
408
414
|
canvasWidth,
|
|
409
415
|
canvasHeight
|
|
410
416
|
}) {
|
|
411
|
-
const userColor =
|
|
417
|
+
const userColor = chunkKA35ZMIP_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
412
418
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
413
419
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
414
420
|
awareness,
|
|
@@ -517,8 +523,8 @@ function useEditorHistory(input) {
|
|
|
517
523
|
width: canvasSize.width,
|
|
518
524
|
height: canvasSize.height,
|
|
519
525
|
activeSlideIndex,
|
|
520
|
-
slides: slides.map(
|
|
521
|
-
templateElementsBySlideId:
|
|
526
|
+
slides: slides.map(chunkKA35ZMIP_js.cloneSlide),
|
|
527
|
+
templateElementsBySlideId: chunkKA35ZMIP_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
522
528
|
...actionLabel ? { actionLabel } : {}
|
|
523
529
|
};
|
|
524
530
|
},
|
|
@@ -531,9 +537,9 @@ function useEditorHistory(input) {
|
|
|
531
537
|
width: snapshot.width,
|
|
532
538
|
height: snapshot.height
|
|
533
539
|
});
|
|
534
|
-
setSlides(snapshot.slides.map(
|
|
540
|
+
setSlides(snapshot.slides.map(chunkKA35ZMIP_js.cloneSlide));
|
|
535
541
|
setTemplateElementsBySlideId(
|
|
536
|
-
|
|
542
|
+
chunkKA35ZMIP_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
537
543
|
);
|
|
538
544
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
539
545
|
setSelectedElementIds([]);
|
|
@@ -567,8 +573,8 @@ function useEditorHistory(input) {
|
|
|
567
573
|
const currentSnapshot = buildHistorySnapshot();
|
|
568
574
|
historyFutureRef.current.push(currentSnapshot);
|
|
569
575
|
isApplyingHistoryRef.current = true;
|
|
570
|
-
const nextSnapshot =
|
|
571
|
-
lastHistorySnapshotRef.current =
|
|
576
|
+
const nextSnapshot = chunkHZSUTVDQ_js.cloneHistorySnapshot(previousSnapshot);
|
|
577
|
+
lastHistorySnapshotRef.current = chunkHZSUTVDQ_js.cloneHistorySnapshot(nextSnapshot);
|
|
572
578
|
lastHistorySerializedRef.current = JSON.stringify(nextSnapshot);
|
|
573
579
|
applyHistorySnapshot(nextSnapshot);
|
|
574
580
|
updateHistoryAvailability();
|
|
@@ -589,8 +595,8 @@ function useEditorHistory(input) {
|
|
|
589
595
|
const currentSnapshot = buildHistorySnapshot();
|
|
590
596
|
historyPastRef.current.push(currentSnapshot);
|
|
591
597
|
isApplyingHistoryRef.current = true;
|
|
592
|
-
const targetSnapshot =
|
|
593
|
-
lastHistorySnapshotRef.current =
|
|
598
|
+
const targetSnapshot = chunkHZSUTVDQ_js.cloneHistorySnapshot(nextSnapshot);
|
|
599
|
+
lastHistorySnapshotRef.current = chunkHZSUTVDQ_js.cloneHistorySnapshot(targetSnapshot);
|
|
594
600
|
lastHistorySerializedRef.current = JSON.stringify(targetSnapshot);
|
|
595
601
|
applyHistorySnapshot(targetSnapshot);
|
|
596
602
|
updateHistoryAvailability();
|
|
@@ -608,7 +614,7 @@ function useEditorHistory(input) {
|
|
|
608
614
|
historyPastRef.current = [];
|
|
609
615
|
historyFutureRef.current = [];
|
|
610
616
|
if (initialSnapshot) {
|
|
611
|
-
const clonedInitial =
|
|
617
|
+
const clonedInitial = chunkHZSUTVDQ_js.cloneHistorySnapshot(initialSnapshot);
|
|
612
618
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
613
619
|
lastHistorySerializedRef.current = JSON.stringify(clonedInitial);
|
|
614
620
|
} else {
|
|
@@ -649,18 +655,18 @@ function useEditorHistory(input) {
|
|
|
649
655
|
}
|
|
650
656
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
651
657
|
if (!previousSnapshot) {
|
|
652
|
-
lastHistorySnapshotRef.current =
|
|
658
|
+
lastHistorySnapshotRef.current = chunkHZSUTVDQ_js.cloneHistorySnapshot(snapshot);
|
|
653
659
|
lastHistorySerializedRef.current = serialized;
|
|
654
660
|
lastCheapHashRef.current = cheapHash;
|
|
655
661
|
updateHistoryAvailability();
|
|
656
662
|
return;
|
|
657
663
|
}
|
|
658
|
-
historyPastRef.current.push(
|
|
664
|
+
historyPastRef.current.push(chunkHZSUTVDQ_js.cloneHistorySnapshot(previousSnapshot));
|
|
659
665
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
660
666
|
historyPastRef.current.shift();
|
|
661
667
|
}
|
|
662
668
|
historyFutureRef.current = [];
|
|
663
|
-
lastHistorySnapshotRef.current =
|
|
669
|
+
lastHistorySnapshotRef.current = chunkHZSUTVDQ_js.cloneHistorySnapshot(snapshot);
|
|
664
670
|
lastHistorySerializedRef.current = serialized;
|
|
665
671
|
lastCheapHashRef.current = cheapHash;
|
|
666
672
|
updateHistoryAvailability();
|
|
@@ -690,6 +696,28 @@ function useEditorHistory(input) {
|
|
|
690
696
|
buildHistorySnapshot
|
|
691
697
|
};
|
|
692
698
|
}
|
|
699
|
+
function useViewerStore(store, selector, isEqual = Object.is) {
|
|
700
|
+
const cache = react.useRef(null);
|
|
701
|
+
const getSnapshot2 = react.useCallback(() => {
|
|
702
|
+
const state = store.getState();
|
|
703
|
+
const last = cache.current;
|
|
704
|
+
if (last && Object.is(last.state, state)) {
|
|
705
|
+
return last.value;
|
|
706
|
+
}
|
|
707
|
+
const next = selector(state);
|
|
708
|
+
const value = last && isEqual(last.value, next) ? last.value : next;
|
|
709
|
+
cache.current = { state, value };
|
|
710
|
+
return value;
|
|
711
|
+
}, [store, selector, isEqual]);
|
|
712
|
+
const subscribe2 = react.useCallback(
|
|
713
|
+
(onStoreChange) => store.subscribe(onStoreChange),
|
|
714
|
+
[store]
|
|
715
|
+
);
|
|
716
|
+
return react.useSyncExternalStore(subscribe2, getSnapshot2, getSnapshot2);
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
// src/viewer/hooks/useZoomViewport.ts
|
|
720
|
+
var selectZoom = (state) => state.zoom;
|
|
693
721
|
function useZoomViewport({
|
|
694
722
|
canvasSize,
|
|
695
723
|
selectedElements
|
|
@@ -698,7 +726,14 @@ function useZoomViewport({
|
|
|
698
726
|
const canvasStageRef = react.useRef(null);
|
|
699
727
|
const canvasViewportRef = react.useRef(null);
|
|
700
728
|
const renderScaleRef = react.useRef(1);
|
|
701
|
-
const
|
|
729
|
+
const storeRef = react.useRef(null);
|
|
730
|
+
storeRef.current ??= chunkKA35ZMIP_js.createViewerZoomStore();
|
|
731
|
+
const store = storeRef.current;
|
|
732
|
+
const scale = useViewerStore(store, selectZoom);
|
|
733
|
+
const setScale = react.useCallback(
|
|
734
|
+
(next) => store.dispatch({ type: "set-zoom", zoom: next }),
|
|
735
|
+
[store]
|
|
736
|
+
);
|
|
702
737
|
const [editorDimensions, setEditorDimensions] = react.useState(null);
|
|
703
738
|
const effectiveEditorDimensions = editorDimensions || {
|
|
704
739
|
width: canvasSize.width,
|
|
@@ -716,6 +751,9 @@ function useZoomViewport({
|
|
|
716
751
|
react.useEffect(() => {
|
|
717
752
|
renderScaleRef.current = editorScale;
|
|
718
753
|
}, [editorScale]);
|
|
754
|
+
react.useEffect(() => {
|
|
755
|
+
store.dispatch({ type: "set-fit-scale", fitScale });
|
|
756
|
+
}, [store, fitScale]);
|
|
719
757
|
react.useEffect(() => {
|
|
720
758
|
let observer = null;
|
|
721
759
|
let raf = 0;
|
|
@@ -750,7 +788,7 @@ function useZoomViewport({
|
|
|
750
788
|
if (!wrapper || !canvasViewport) {
|
|
751
789
|
return;
|
|
752
790
|
}
|
|
753
|
-
const boundedScale =
|
|
791
|
+
const boundedScale = chunkKA35ZMIP_js.clampZoomScale(nextScale);
|
|
754
792
|
const nextEditorScale = fitScale * boundedScale;
|
|
755
793
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
756
794
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -765,17 +803,17 @@ function useZoomViewport({
|
|
|
765
803
|
[fitScale]
|
|
766
804
|
);
|
|
767
805
|
const handleZoomIn = react.useCallback(() => {
|
|
768
|
-
|
|
769
|
-
}, []);
|
|
806
|
+
store.dispatch({ type: "zoom-in" });
|
|
807
|
+
}, [store]);
|
|
770
808
|
const handleZoomOut = react.useCallback(() => {
|
|
771
|
-
|
|
772
|
-
}, []);
|
|
809
|
+
store.dispatch({ type: "zoom-out" });
|
|
810
|
+
}, [store]);
|
|
773
811
|
const handleResetZoom = react.useCallback(() => {
|
|
774
|
-
|
|
775
|
-
}, []);
|
|
812
|
+
store.dispatch({ type: "zoom-to-fit" });
|
|
813
|
+
}, [store]);
|
|
776
814
|
const handleZoomToFit = react.useCallback(() => {
|
|
777
|
-
|
|
778
|
-
}, []);
|
|
815
|
+
store.dispatch({ type: "zoom-to-fit" });
|
|
816
|
+
}, [store]);
|
|
779
817
|
const handleZoomToSelection = react.useCallback(() => {
|
|
780
818
|
if (selectedElements.length === 0) {
|
|
781
819
|
return;
|
|
@@ -787,29 +825,29 @@ function useZoomViewport({
|
|
|
787
825
|
selectedElements.forEach((element) => {
|
|
788
826
|
minX = Math.min(minX, element.x);
|
|
789
827
|
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,
|
|
828
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE));
|
|
829
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE));
|
|
792
830
|
});
|
|
793
831
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
794
832
|
return;
|
|
795
833
|
}
|
|
796
834
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
797
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
798
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
835
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE);
|
|
836
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE);
|
|
799
837
|
const availableWidth = Math.max(
|
|
800
|
-
effectiveEditorDimensions.width -
|
|
801
|
-
|
|
838
|
+
effectiveEditorDimensions.width - chunkHZSUTVDQ_js.ZOOM_TO_SELECTION_PADDING,
|
|
839
|
+
chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE
|
|
802
840
|
);
|
|
803
841
|
const availableHeight = Math.max(
|
|
804
|
-
effectiveEditorDimensions.height -
|
|
805
|
-
|
|
842
|
+
effectiveEditorDimensions.height - chunkHZSUTVDQ_js.ZOOM_TO_SELECTION_PADDING,
|
|
843
|
+
chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE
|
|
806
844
|
);
|
|
807
845
|
const targetEditorScale = Math.min(
|
|
808
846
|
availableWidth / boundsWidth,
|
|
809
847
|
availableHeight / boundsHeight
|
|
810
848
|
);
|
|
811
849
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
812
|
-
const nextScale =
|
|
850
|
+
const nextScale = chunkKA35ZMIP_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
813
851
|
setScale(nextScale);
|
|
814
852
|
window.requestAnimationFrame(() => {
|
|
815
853
|
window.requestAnimationFrame(() => {
|
|
@@ -821,16 +859,23 @@ function useZoomViewport({
|
|
|
821
859
|
effectiveEditorDimensions.height,
|
|
822
860
|
effectiveEditorDimensions.width,
|
|
823
861
|
fitScale,
|
|
824
|
-
selectedElements
|
|
862
|
+
selectedElements,
|
|
863
|
+
setScale
|
|
825
864
|
]);
|
|
826
|
-
const handleWheel = react.useCallback(
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
865
|
+
const handleWheel = react.useCallback(
|
|
866
|
+
(event) => {
|
|
867
|
+
if (!event.ctrlKey) {
|
|
868
|
+
return;
|
|
869
|
+
}
|
|
870
|
+
event.preventDefault();
|
|
871
|
+
const delta = event.deltaY * -1e-3;
|
|
872
|
+
store.dispatch({
|
|
873
|
+
type: "set-zoom",
|
|
874
|
+
zoom: chunkKA35ZMIP_js.clampZoomScale(store.getState().zoom + delta)
|
|
875
|
+
});
|
|
876
|
+
},
|
|
877
|
+
[store]
|
|
878
|
+
);
|
|
834
879
|
react.useEffect(() => {
|
|
835
880
|
const viewport = canvasViewportRef.current;
|
|
836
881
|
if (!viewport) {
|
|
@@ -906,7 +951,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
906
951
|
const command = step.command;
|
|
907
952
|
const timer = window.setTimeout(
|
|
908
953
|
() => {
|
|
909
|
-
|
|
954
|
+
chunkHZSUTVDQ_js.executeMediaCommand(command);
|
|
910
955
|
},
|
|
911
956
|
Math.max(0, step.delayMs)
|
|
912
957
|
);
|
|
@@ -1003,6 +1048,58 @@ function driveBuildReveal(controller, buildIds, setStates, handle) {
|
|
|
1003
1048
|
tick();
|
|
1004
1049
|
}
|
|
1005
1050
|
|
|
1051
|
+
// src/viewer/hooks/presentation-mode/entrance-animation-timers.ts
|
|
1052
|
+
function scheduleOpeningAutoPlayGroup(controller, deps) {
|
|
1053
|
+
if (!controller.hasMoreSteps()) {
|
|
1054
|
+
return;
|
|
1055
|
+
}
|
|
1056
|
+
const firstGroup = controller.peekNext();
|
|
1057
|
+
if (!firstGroup?.autoAdvance) {
|
|
1058
|
+
return;
|
|
1059
|
+
}
|
|
1060
|
+
const timer = window.setTimeout(() => {
|
|
1061
|
+
const group = controller.advance();
|
|
1062
|
+
if (!group) {
|
|
1063
|
+
return;
|
|
1064
|
+
}
|
|
1065
|
+
applyAnimationGroupSteps(
|
|
1066
|
+
group,
|
|
1067
|
+
deps.onPlayActionSound,
|
|
1068
|
+
deps.setPresentationElementStates,
|
|
1069
|
+
deps.presentationTimersRef
|
|
1070
|
+
);
|
|
1071
|
+
deps.startBuildReveal(controller, group);
|
|
1072
|
+
deps.scheduleAutoAdvanceChain(controller);
|
|
1073
|
+
}, firstGroup.autoAdvanceDelayMs ?? 0);
|
|
1074
|
+
deps.presentationTimersRef.current.push(timer);
|
|
1075
|
+
}
|
|
1076
|
+
function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, presentationTimersRef) {
|
|
1077
|
+
const entranceAnimations = [...slide.animations || []].filter((animation) => Boolean(animation.entrance)).sort(
|
|
1078
|
+
(left, right) => (left.order || Number.MAX_SAFE_INTEGER) - (right.order || Number.MAX_SAFE_INTEGER)
|
|
1079
|
+
);
|
|
1080
|
+
if (entranceAnimations.length === 0) {
|
|
1081
|
+
return;
|
|
1082
|
+
}
|
|
1083
|
+
setPresentationAnimations(
|
|
1084
|
+
entranceAnimations.map((animation) => ({
|
|
1085
|
+
elementId: animation.elementId,
|
|
1086
|
+
state: "hidden",
|
|
1087
|
+
animation
|
|
1088
|
+
}))
|
|
1089
|
+
);
|
|
1090
|
+
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1091
|
+
const delay = chunkKA35ZMIP_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1092
|
+
const timer = window.setTimeout(() => {
|
|
1093
|
+
setPresentationAnimations(
|
|
1094
|
+
(previousAnimations) => previousAnimations.map(
|
|
1095
|
+
(entry) => entry.elementId === animation.elementId ? { ...entry, state: "visible" } : entry
|
|
1096
|
+
)
|
|
1097
|
+
);
|
|
1098
|
+
}, delay);
|
|
1099
|
+
presentationTimersRef.current.push(timer);
|
|
1100
|
+
});
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1006
1103
|
// src/viewer/hooks/presentation-mode/useAnimationPlayback.ts
|
|
1007
1104
|
function useAnimationPlayback(input) {
|
|
1008
1105
|
const { slides, onPlayActionSound, showWithAnimation } = input;
|
|
@@ -1018,11 +1115,12 @@ function useAnimationPlayback(input) {
|
|
|
1018
1115
|
const controllerRef = react.useRef(null);
|
|
1019
1116
|
const buildRafRef = react.useRef(null);
|
|
1020
1117
|
const seededCompletedRef = react.useRef(false);
|
|
1118
|
+
const lastSeedCompletedRef = react.useRef(false);
|
|
1021
1119
|
const startBuildReveal = react.useCallback(
|
|
1022
1120
|
(controller, group) => {
|
|
1023
1121
|
driveBuildReveal(
|
|
1024
1122
|
controller,
|
|
1025
|
-
|
|
1123
|
+
chunkKA35ZMIP_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1026
1124
|
setPresentationElementStates,
|
|
1027
1125
|
buildRafRef
|
|
1028
1126
|
);
|
|
@@ -1085,7 +1183,7 @@ function useAnimationPlayback(input) {
|
|
|
1085
1183
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1086
1184
|
return;
|
|
1087
1185
|
}
|
|
1088
|
-
const controller =
|
|
1186
|
+
const controller = chunkKA35ZMIP_js.PresentationAnimationController.fromSlide(slide);
|
|
1089
1187
|
controllerRef.current = controller;
|
|
1090
1188
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1091
1189
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1169,12 +1267,12 @@ function useAnimationPlayback(input) {
|
|
|
1169
1267
|
}
|
|
1170
1268
|
controller.resetHover(shapeId);
|
|
1171
1269
|
}, []);
|
|
1172
|
-
const
|
|
1270
|
+
const seedSlideAnimations = react.useCallback(
|
|
1173
1271
|
(slideIndex, options) => {
|
|
1174
1272
|
clearPresentationTimers();
|
|
1273
|
+
setPresentationAnimations([]);
|
|
1175
1274
|
if (!animationsEnabled) {
|
|
1176
1275
|
controllerRef.current = null;
|
|
1177
|
-
setPresentationAnimations([]);
|
|
1178
1276
|
setPresentationElementStates(/* @__PURE__ */ new Map());
|
|
1179
1277
|
setPresentationKeyframesCss("");
|
|
1180
1278
|
setInteractiveTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
@@ -1182,12 +1280,8 @@ function useAnimationPlayback(input) {
|
|
|
1182
1280
|
return;
|
|
1183
1281
|
}
|
|
1184
1282
|
resetSlideTimeline(slideIndex);
|
|
1185
|
-
const slide = slides[slideIndex];
|
|
1186
|
-
if (!slide) {
|
|
1187
|
-
setPresentationAnimations([]);
|
|
1188
|
-
return;
|
|
1189
|
-
}
|
|
1190
1283
|
seededCompletedRef.current = false;
|
|
1284
|
+
lastSeedCompletedRef.current = options?.completed === true;
|
|
1191
1285
|
if (options?.completed) {
|
|
1192
1286
|
const seeded = controllerRef.current;
|
|
1193
1287
|
if (seeded) {
|
|
@@ -1195,64 +1289,39 @@ function useAnimationPlayback(input) {
|
|
|
1195
1289
|
seeded.completeAll();
|
|
1196
1290
|
setPresentationElementStates(seeded.computeStates());
|
|
1197
1291
|
}
|
|
1198
|
-
setPresentationAnimations([]);
|
|
1199
|
-
return;
|
|
1200
1292
|
}
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
applyAnimationGroupSteps(
|
|
1209
|
-
group,
|
|
1210
|
-
onPlayActionSound,
|
|
1211
|
-
setPresentationElementStates,
|
|
1212
|
-
presentationTimersRef
|
|
1213
|
-
);
|
|
1214
|
-
startBuildReveal(controller, group);
|
|
1215
|
-
scheduleAutoAdvanceChain(controller);
|
|
1216
|
-
}
|
|
1217
|
-
}, firstGroup.autoAdvanceDelayMs ?? 0);
|
|
1218
|
-
presentationTimersRef.current.push(timer);
|
|
1219
|
-
}
|
|
1293
|
+
},
|
|
1294
|
+
[animationsEnabled, clearPresentationTimers, resetSlideTimeline]
|
|
1295
|
+
);
|
|
1296
|
+
const startSlideAnimations = react.useCallback(
|
|
1297
|
+
(slideIndex) => {
|
|
1298
|
+
if (!animationsEnabled || lastSeedCompletedRef.current) {
|
|
1299
|
+
return;
|
|
1220
1300
|
}
|
|
1221
|
-
const
|
|
1222
|
-
|
|
1223
|
-
);
|
|
1224
|
-
if (entranceAnimations.length === 0) {
|
|
1225
|
-
setPresentationAnimations([]);
|
|
1301
|
+
const slide = slides[slideIndex];
|
|
1302
|
+
if (!slide) {
|
|
1226
1303
|
return;
|
|
1227
1304
|
}
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
(previousAnimations) => previousAnimations.map(
|
|
1240
|
-
(entry) => entry.elementId === animation.elementId ? { ...entry, state: "visible" } : entry
|
|
1241
|
-
)
|
|
1242
|
-
);
|
|
1243
|
-
}, delay);
|
|
1244
|
-
presentationTimersRef.current.push(timer);
|
|
1245
|
-
});
|
|
1305
|
+
const controller = controllerRef.current;
|
|
1306
|
+
if (controller) {
|
|
1307
|
+
scheduleOpeningAutoPlayGroup(controller, {
|
|
1308
|
+
onPlayActionSound,
|
|
1309
|
+
setPresentationElementStates,
|
|
1310
|
+
presentationTimersRef,
|
|
1311
|
+
startBuildReveal,
|
|
1312
|
+
scheduleAutoAdvanceChain
|
|
1313
|
+
});
|
|
1314
|
+
}
|
|
1315
|
+
scheduleEntranceAnimationTimers(slide, setPresentationAnimations, presentationTimersRef);
|
|
1246
1316
|
},
|
|
1247
|
-
[
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
]
|
|
1317
|
+
[animationsEnabled, slides, onPlayActionSound, scheduleAutoAdvanceChain, startBuildReveal]
|
|
1318
|
+
);
|
|
1319
|
+
const runPresentationEntranceAnimations = react.useCallback(
|
|
1320
|
+
(slideIndex, options) => {
|
|
1321
|
+
seedSlideAnimations(slideIndex, options);
|
|
1322
|
+
startSlideAnimations(slideIndex);
|
|
1323
|
+
},
|
|
1324
|
+
[seedSlideAnimations, startSlideAnimations]
|
|
1256
1325
|
);
|
|
1257
1326
|
return {
|
|
1258
1327
|
presentationAnimations,
|
|
@@ -1266,16 +1335,18 @@ function useAnimationPlayback(input) {
|
|
|
1266
1335
|
handleHoverStart,
|
|
1267
1336
|
handleHoverEnd,
|
|
1268
1337
|
runPresentationEntranceAnimations,
|
|
1338
|
+
seedSlideAnimations,
|
|
1339
|
+
startSlideAnimations,
|
|
1269
1340
|
isSeededCompleted: () => seededCompletedRef.current,
|
|
1270
1341
|
presentationTimersRef
|
|
1271
1342
|
};
|
|
1272
1343
|
}
|
|
1273
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1274
|
-
var AUDIENCE_HASH =
|
|
1275
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1276
|
-
var AUDIENCE_NONCE_KEY =
|
|
1344
|
+
var PRESENTER_CHANNEL_NAME = chunkKA35ZMIP_js.PRESENTATION_CHANNEL_NAME;
|
|
1345
|
+
var AUDIENCE_HASH = chunkKA35ZMIP_js.PRESENTATION_HASH;
|
|
1346
|
+
var PRESENTER_MSG_ORIGIN = chunkKA35ZMIP_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1347
|
+
var AUDIENCE_NONCE_KEY = chunkKA35ZMIP_js.PRESENTATION_NONCE_KEY;
|
|
1277
1348
|
function generateSessionId() {
|
|
1278
|
-
return
|
|
1349
|
+
return chunkKA35ZMIP_js.createPresentationSessionId();
|
|
1279
1350
|
}
|
|
1280
1351
|
function parseAudienceNonce() {
|
|
1281
1352
|
const hash = window.location.hash;
|
|
@@ -1311,7 +1382,7 @@ function usePresenterWindow(input) {
|
|
|
1311
1382
|
}, []);
|
|
1312
1383
|
const swapDisplays = react.useCallback(async () => {
|
|
1313
1384
|
const audience = audienceWindowRef.current;
|
|
1314
|
-
return audience && !audience.closed ?
|
|
1385
|
+
return audience && !audience.closed ? chunkKA35ZMIP_js.swapPresentationWindows(window, audience) : false;
|
|
1315
1386
|
}, []);
|
|
1316
1387
|
const syncSlideToAudience = react.useCallback(
|
|
1317
1388
|
(slideIndex) => {
|
|
@@ -1375,7 +1446,7 @@ function usePresenterWindow(input) {
|
|
|
1375
1446
|
pollTimerRef.current = null;
|
|
1376
1447
|
}
|
|
1377
1448
|
if (closingSessionId) {
|
|
1378
|
-
void
|
|
1449
|
+
void chunkKA35ZMIP_js.clearAudienceContent(closingSessionId);
|
|
1379
1450
|
}
|
|
1380
1451
|
}, [getChannel]);
|
|
1381
1452
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1393,10 +1464,10 @@ function usePresenterWindow(input) {
|
|
|
1393
1464
|
audienceWindowRef.current = blankWin;
|
|
1394
1465
|
const sessionId = generateSessionId();
|
|
1395
1466
|
sessionIdRef.current = sessionId;
|
|
1396
|
-
const audienceUrl =
|
|
1397
|
-
void
|
|
1467
|
+
const audienceUrl = chunkKA35ZMIP_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1468
|
+
void chunkKA35ZMIP_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1398
1469
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1399
|
-
|
|
1470
|
+
chunkKA35ZMIP_js.placeAudienceWindow(blankWin, placement);
|
|
1400
1471
|
}
|
|
1401
1472
|
return void 0;
|
|
1402
1473
|
});
|
|
@@ -1426,7 +1497,7 @@ function usePresenterWindow(input) {
|
|
|
1426
1497
|
}
|
|
1427
1498
|
};
|
|
1428
1499
|
if (content) {
|
|
1429
|
-
void
|
|
1500
|
+
void chunkKA35ZMIP_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1430
1501
|
} else {
|
|
1431
1502
|
navigateOrClose(true);
|
|
1432
1503
|
}
|
|
@@ -1452,7 +1523,7 @@ function usePresenterWindow(input) {
|
|
|
1452
1523
|
}
|
|
1453
1524
|
const handleMessage = (event) => {
|
|
1454
1525
|
const message = event.data;
|
|
1455
|
-
if (
|
|
1526
|
+
if (chunkKA35ZMIP_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1456
1527
|
syncStateToAudience(snapshotRef.current);
|
|
1457
1528
|
}
|
|
1458
1529
|
};
|
|
@@ -1481,7 +1552,7 @@ function usePresenterWindow(input) {
|
|
|
1481
1552
|
react.useEffect(() => {
|
|
1482
1553
|
const handleBeforeUnload = () => {
|
|
1483
1554
|
if (sessionIdRef.current) {
|
|
1484
|
-
void
|
|
1555
|
+
void chunkKA35ZMIP_js.clearAudienceContent(sessionIdRef.current);
|
|
1485
1556
|
}
|
|
1486
1557
|
};
|
|
1487
1558
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1543,7 +1614,7 @@ function useAudienceMode(input) {
|
|
|
1543
1614
|
}
|
|
1544
1615
|
channel.onmessage = (event) => {
|
|
1545
1616
|
const data = event.data;
|
|
1546
|
-
if (!
|
|
1617
|
+
if (!chunkKA35ZMIP_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1547
1618
|
return;
|
|
1548
1619
|
}
|
|
1549
1620
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1559,16 +1630,16 @@ function useAudienceMode(input) {
|
|
|
1559
1630
|
}
|
|
1560
1631
|
if (data.type === "presenter-exit") {
|
|
1561
1632
|
if (expectedSessionId) {
|
|
1562
|
-
void
|
|
1633
|
+
void chunkKA35ZMIP_js.clearAudienceContent(expectedSessionId);
|
|
1563
1634
|
}
|
|
1564
|
-
if (
|
|
1635
|
+
if (chunkKA35ZMIP_js.endAudienceDisplay(window)) {
|
|
1565
1636
|
handlers.onPresenterEnded?.();
|
|
1566
1637
|
}
|
|
1567
1638
|
}
|
|
1568
1639
|
};
|
|
1569
1640
|
if (expectedSessionId) {
|
|
1570
1641
|
channel.postMessage({
|
|
1571
|
-
origin:
|
|
1642
|
+
origin: chunkKA35ZMIP_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1572
1643
|
type: "audience-ready",
|
|
1573
1644
|
sessionId: expectedSessionId
|
|
1574
1645
|
});
|
|
@@ -1601,14 +1672,14 @@ function usePresentationKeyboard(input) {
|
|
|
1601
1672
|
presentationSlideIndex,
|
|
1602
1673
|
setShowRehearsalSummary
|
|
1603
1674
|
} = input;
|
|
1604
|
-
const keyBufferRef = react.useRef(
|
|
1675
|
+
const keyBufferRef = react.useRef(chunkKA35ZMIP_js.createPresentationKeyBuffer());
|
|
1605
1676
|
react.useEffect(() => {
|
|
1606
|
-
if (mode !== "present" || !
|
|
1607
|
-
keyBufferRef.current =
|
|
1677
|
+
if (mode !== "present" || !chunkKA35ZMIP_js.acceptsPresentationInput()) {
|
|
1678
|
+
keyBufferRef.current = chunkKA35ZMIP_js.createPresentationKeyBuffer();
|
|
1608
1679
|
return;
|
|
1609
1680
|
}
|
|
1610
1681
|
const handleKeyDown = (event) => {
|
|
1611
|
-
const mapped =
|
|
1682
|
+
const mapped = chunkKA35ZMIP_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1612
1683
|
if (mapped.action === "none") {
|
|
1613
1684
|
return;
|
|
1614
1685
|
}
|
|
@@ -1628,12 +1699,12 @@ function usePresentationKeyboard(input) {
|
|
|
1628
1699
|
movePresentationSlide(-1);
|
|
1629
1700
|
return;
|
|
1630
1701
|
case "first": {
|
|
1631
|
-
const first =
|
|
1702
|
+
const first = chunkKA35ZMIP_js.firstShowSlideIndex(showSlideIndexes);
|
|
1632
1703
|
navigateToSlide(first ?? 0);
|
|
1633
1704
|
return;
|
|
1634
1705
|
}
|
|
1635
1706
|
case "last": {
|
|
1636
|
-
const last =
|
|
1707
|
+
const last = chunkKA35ZMIP_js.lastShowSlideIndex(showSlideIndexes);
|
|
1637
1708
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1638
1709
|
return;
|
|
1639
1710
|
}
|
|
@@ -1788,7 +1859,7 @@ function useRehearsalTimings(input) {
|
|
|
1788
1859
|
|
|
1789
1860
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1790
1861
|
function handlePresentationActionImpl(action, deps) {
|
|
1791
|
-
|
|
1862
|
+
chunkKA35ZMIP_js.runPresentationAction(
|
|
1792
1863
|
action,
|
|
1793
1864
|
{ slideCount: deps.slidesLength },
|
|
1794
1865
|
{
|
|
@@ -1810,11 +1881,12 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1810
1881
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1811
1882
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1812
1883
|
const transition = incomingSlide?.transition;
|
|
1813
|
-
const durationMs = deps.playTransition ?
|
|
1884
|
+
const durationMs = deps.playTransition ? chunkKA35ZMIP_js.resolveTransitionDurationMs(transition) : 0;
|
|
1814
1885
|
deps.clearPresentationTimers();
|
|
1815
1886
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1816
1887
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
1817
1888
|
deps.setPresentationSlideVisible(true);
|
|
1889
|
+
deps.seedSlideAnimations(nextSlideIndex, { completed: deps.seedCompleted });
|
|
1818
1890
|
if (durationMs > 0 && transition) {
|
|
1819
1891
|
if (transition.soundPath && deps.onPlayActionSound) {
|
|
1820
1892
|
deps.onPlayActionSound(transition.soundPath, { loop: transition.soundLoop === true });
|
|
@@ -1826,16 +1898,14 @@ function executeSlideTransition(nextSlideIndex, deps) {
|
|
|
1826
1898
|
durationMs
|
|
1827
1899
|
});
|
|
1828
1900
|
const timer = window.setTimeout(() => {
|
|
1829
|
-
deps.
|
|
1830
|
-
completed: deps.seedCompleted
|
|
1831
|
-
});
|
|
1901
|
+
deps.startSlideAnimations(nextSlideIndex);
|
|
1832
1902
|
deps.scheduleAutoAdvanceForSlide?.(nextSlideIndex);
|
|
1833
1903
|
}, durationMs);
|
|
1834
1904
|
deps.presentationTimersRef.current.push(timer);
|
|
1835
1905
|
return;
|
|
1836
1906
|
}
|
|
1837
1907
|
deps.setTransitionOverlay(null);
|
|
1838
|
-
deps.
|
|
1908
|
+
deps.startSlideAnimations(nextSlideIndex);
|
|
1839
1909
|
deps.scheduleAutoAdvanceForSlide?.(nextSlideIndex);
|
|
1840
1910
|
}
|
|
1841
1911
|
|
|
@@ -1859,7 +1929,8 @@ function useSlideNavigation(input) {
|
|
|
1859
1929
|
onAdvancePastLastSlide,
|
|
1860
1930
|
playNextAnimationGroup,
|
|
1861
1931
|
clearPresentationTimers,
|
|
1862
|
-
|
|
1932
|
+
seedSlideAnimations,
|
|
1933
|
+
startSlideAnimations,
|
|
1863
1934
|
presentationTimersRef,
|
|
1864
1935
|
rehearsing,
|
|
1865
1936
|
recordCurrentSlideTime,
|
|
@@ -1869,7 +1940,7 @@ function useSlideNavigation(input) {
|
|
|
1869
1940
|
});
|
|
1870
1941
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1871
1942
|
(slideIndex) => {
|
|
1872
|
-
const delayMs =
|
|
1943
|
+
const delayMs = chunkKA35ZMIP_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1873
1944
|
if (delayMs === void 0) {
|
|
1874
1945
|
return;
|
|
1875
1946
|
}
|
|
@@ -1892,7 +1963,7 @@ function useSlideNavigation(input) {
|
|
|
1892
1963
|
if (availableSlideIndexes.length === 0) {
|
|
1893
1964
|
return;
|
|
1894
1965
|
}
|
|
1895
|
-
const pastLastSlide = direction === 1 && !
|
|
1966
|
+
const pastLastSlide = direction === 1 && !chunkKA35ZMIP_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1896
1967
|
if (rehearsing && pastLastSlide) {
|
|
1897
1968
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1898
1969
|
try {
|
|
@@ -1910,9 +1981,9 @@ function useSlideNavigation(input) {
|
|
|
1910
1981
|
onAdvancePastLastSlide();
|
|
1911
1982
|
return;
|
|
1912
1983
|
}
|
|
1913
|
-
const nextSlideIndex = direction === 1 ?
|
|
1984
|
+
const nextSlideIndex = direction === 1 ? chunkKA35ZMIP_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1914
1985
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
1915
|
-
}) :
|
|
1986
|
+
}) : chunkKA35ZMIP_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
1916
1987
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
1917
1988
|
return;
|
|
1918
1989
|
}
|
|
@@ -1927,7 +1998,8 @@ function useSlideNavigation(input) {
|
|
|
1927
1998
|
clearPresentationTimers,
|
|
1928
1999
|
setPresentationSlideIndex,
|
|
1929
2000
|
onSetActiveSlideIndex,
|
|
1930
|
-
|
|
2001
|
+
seedSlideAnimations,
|
|
2002
|
+
startSlideAnimations,
|
|
1931
2003
|
scheduleAutoAdvanceForSlide: rehearsing ? void 0 : scheduleAutoAdvanceForSlide,
|
|
1932
2004
|
presentationTimersRef,
|
|
1933
2005
|
setTransitionOverlay,
|
|
@@ -1949,7 +2021,8 @@ function useSlideNavigation(input) {
|
|
|
1949
2021
|
presentationTimersRef,
|
|
1950
2022
|
recordCurrentSlideTime,
|
|
1951
2023
|
rehearsing,
|
|
1952
|
-
|
|
2024
|
+
seedSlideAnimations,
|
|
2025
|
+
startSlideAnimations,
|
|
1953
2026
|
scheduleAutoAdvanceForSlide,
|
|
1954
2027
|
setShowRehearsalSummary,
|
|
1955
2028
|
slides,
|
|
@@ -1976,7 +2049,8 @@ function useSlideNavigation(input) {
|
|
|
1976
2049
|
clearPresentationTimers,
|
|
1977
2050
|
setPresentationSlideIndex,
|
|
1978
2051
|
onSetActiveSlideIndex,
|
|
1979
|
-
|
|
2052
|
+
seedSlideAnimations,
|
|
2053
|
+
startSlideAnimations,
|
|
1980
2054
|
scheduleAutoAdvanceForSlide,
|
|
1981
2055
|
presentationTimersRef,
|
|
1982
2056
|
setTransitionOverlay,
|
|
@@ -1996,7 +2070,8 @@ function useSlideNavigation(input) {
|
|
|
1996
2070
|
onSetActiveSlideIndex,
|
|
1997
2071
|
presentationSlideIndex,
|
|
1998
2072
|
presentationTimersRef,
|
|
1999
|
-
|
|
2073
|
+
seedSlideAnimations,
|
|
2074
|
+
startSlideAnimations,
|
|
2000
2075
|
scheduleAutoAdvanceForSlide,
|
|
2001
2076
|
slides,
|
|
2002
2077
|
setPresentationSlideIndex,
|
|
@@ -2052,40 +2127,45 @@ function useZoomNavigation(input) {
|
|
|
2052
2127
|
clearZoomReturn
|
|
2053
2128
|
};
|
|
2054
2129
|
}
|
|
2055
|
-
function usePresenterConsole(slideIndex) {
|
|
2056
|
-
const timerRef = react.useRef(
|
|
2057
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2130
|
+
function usePresenterConsole(slideIndex, active) {
|
|
2131
|
+
const timerRef = react.useRef(chunkKA35ZMIP_js.createPresenterTimer());
|
|
2132
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkKA35ZMIP_js.createInitialPresentationSnapshot(slideIndex));
|
|
2058
2133
|
const patch = react.useCallback((value) => {
|
|
2059
|
-
setSnapshot((current) =>
|
|
2134
|
+
setSnapshot((current) => chunkKA35ZMIP_js.mergePresentationSnapshot(current, value));
|
|
2060
2135
|
}, []);
|
|
2061
2136
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2062
2137
|
react.useEffect(() => {
|
|
2138
|
+
if (!active) {
|
|
2139
|
+
return;
|
|
2140
|
+
}
|
|
2141
|
+
timerRef.current = chunkKA35ZMIP_js.resetPresenterTimer();
|
|
2142
|
+
patch({ paused: false, elapsedMs: 0 });
|
|
2063
2143
|
const timer = window.setInterval(() => {
|
|
2064
2144
|
patch({
|
|
2065
2145
|
paused: timerRef.current.paused,
|
|
2066
|
-
elapsedMs:
|
|
2146
|
+
elapsedMs: chunkKA35ZMIP_js.presenterElapsed(timerRef.current)
|
|
2067
2147
|
});
|
|
2068
2148
|
}, 1e3);
|
|
2069
2149
|
return () => window.clearInterval(timer);
|
|
2070
|
-
}, [patch]);
|
|
2150
|
+
}, [active, patch]);
|
|
2071
2151
|
return {
|
|
2072
2152
|
snapshot,
|
|
2073
2153
|
applyAudienceSnapshot: setSnapshot,
|
|
2074
2154
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2075
2155
|
toggleTimer: () => {
|
|
2076
|
-
timerRef.current =
|
|
2156
|
+
timerRef.current = chunkKA35ZMIP_js.togglePresenterTimer(timerRef.current);
|
|
2077
2157
|
patch({
|
|
2078
2158
|
paused: timerRef.current.paused,
|
|
2079
|
-
elapsedMs:
|
|
2159
|
+
elapsedMs: chunkKA35ZMIP_js.presenterElapsed(timerRef.current)
|
|
2080
2160
|
});
|
|
2081
2161
|
},
|
|
2082
2162
|
resetTimer: () => {
|
|
2083
|
-
timerRef.current =
|
|
2163
|
+
timerRef.current = chunkKA35ZMIP_js.resetPresenterTimer();
|
|
2084
2164
|
patch({ paused: false, elapsedMs: 0 });
|
|
2085
2165
|
},
|
|
2086
2166
|
stepZoom: (direction) => setSnapshot(
|
|
2087
|
-
(current) =>
|
|
2088
|
-
zoom:
|
|
2167
|
+
(current) => chunkKA35ZMIP_js.mergePresentationSnapshot(current, {
|
|
2168
|
+
zoom: chunkKA35ZMIP_js.stepPresenterZoom(
|
|
2089
2169
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2090
2170
|
direction
|
|
2091
2171
|
)
|
|
@@ -2130,7 +2210,7 @@ function usePresentationMode(input) {
|
|
|
2130
2210
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2131
2211
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2132
2212
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2133
|
-
const showGuard = react.useMemo(() =>
|
|
2213
|
+
const showGuard = react.useMemo(() => chunkKA35ZMIP_js.createPresenterShowGuard(), []);
|
|
2134
2214
|
const {
|
|
2135
2215
|
presentationAnimations,
|
|
2136
2216
|
presentationElementStates,
|
|
@@ -2143,6 +2223,8 @@ function usePresentationMode(input) {
|
|
|
2143
2223
|
handleHoverStart,
|
|
2144
2224
|
handleHoverEnd,
|
|
2145
2225
|
runPresentationEntranceAnimations,
|
|
2226
|
+
seedSlideAnimations,
|
|
2227
|
+
startSlideAnimations,
|
|
2146
2228
|
isSeededCompleted,
|
|
2147
2229
|
presentationTimersRef
|
|
2148
2230
|
} = useAnimationPlayback({ slides, onPlayActionSound, showWithAnimation });
|
|
@@ -2198,7 +2280,8 @@ function usePresentationMode(input) {
|
|
|
2198
2280
|
onAdvancePastLastSlide: handleAdvancePastLastSlide,
|
|
2199
2281
|
playNextAnimationGroup,
|
|
2200
2282
|
clearPresentationTimers,
|
|
2201
|
-
|
|
2283
|
+
seedSlideAnimations,
|
|
2284
|
+
startSlideAnimations,
|
|
2202
2285
|
presentationTimersRef,
|
|
2203
2286
|
rehearsing,
|
|
2204
2287
|
recordCurrentSlideTime,
|
|
@@ -2206,7 +2289,7 @@ function usePresentationMode(input) {
|
|
|
2206
2289
|
});
|
|
2207
2290
|
const movePresentationSlide = react.useCallback(
|
|
2208
2291
|
(direction, trigger = "explicit") => {
|
|
2209
|
-
if (!
|
|
2292
|
+
if (!chunkKA35ZMIP_js.acceptsPresentationInput()) {
|
|
2210
2293
|
return;
|
|
2211
2294
|
}
|
|
2212
2295
|
if (endOfShowVisible) {
|
|
@@ -2234,7 +2317,7 @@ function usePresentationMode(input) {
|
|
|
2234
2317
|
const { handleZoomClick, zoomReturnSlideIndex, returnToZoomSlide, clearZoomReturn } = useZoomNavigation({ navigateToSlide });
|
|
2235
2318
|
const openAllSlides = react.useCallback(() => setAllSlidesOpen(true), []);
|
|
2236
2319
|
const closeAllSlides = react.useCallback(() => setAllSlidesOpen(false), []);
|
|
2237
|
-
const presenterConsole = usePresenterConsole(presentationSlideIndex);
|
|
2320
|
+
const presenterConsole = usePresenterConsole(presentationSlideIndex, mode === "present");
|
|
2238
2321
|
const {
|
|
2239
2322
|
openAudienceWindow,
|
|
2240
2323
|
closeAudienceWindow,
|
|
@@ -2343,13 +2426,13 @@ function usePresentationMode(input) {
|
|
|
2343
2426
|
if (mode !== "present") {
|
|
2344
2427
|
return;
|
|
2345
2428
|
}
|
|
2346
|
-
return
|
|
2429
|
+
return chunkKA35ZMIP_js.attachPresentationVisibilityPause({
|
|
2347
2430
|
root: containerRef.current ?? void 0,
|
|
2348
2431
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2349
2432
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
2350
2433
|
});
|
|
2351
2434
|
}, [mode, containerRef]);
|
|
2352
|
-
react.
|
|
2435
|
+
react.useLayoutEffect(() => {
|
|
2353
2436
|
if (mode === "present") {
|
|
2354
2437
|
const idx = activeSlideIndexRef.current;
|
|
2355
2438
|
setPresentationSlideIndex(idx);
|
|
@@ -2423,11 +2506,11 @@ function usePresentationMode(input) {
|
|
|
2423
2506
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2424
2507
|
return void 0;
|
|
2425
2508
|
}
|
|
2426
|
-
return
|
|
2509
|
+
return chunkKA35ZMIP_js.buildMorphTransitionPlan(
|
|
2427
2510
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2428
2511
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2429
2512
|
transitionOverlay.durationMs,
|
|
2430
|
-
|
|
2513
|
+
chunkKA35ZMIP_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2431
2514
|
);
|
|
2432
2515
|
}, [transitionOverlay, slides]);
|
|
2433
2516
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2733,7 +2816,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2733
2816
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2734
2817
|
slides.forEach((slide, slideIndex) => {
|
|
2735
2818
|
for (const element of slide.elements || []) {
|
|
2736
|
-
if (!
|
|
2819
|
+
if (!chunkKA35ZMIP_js.hasTextProperties(element)) {
|
|
2737
2820
|
continue;
|
|
2738
2821
|
}
|
|
2739
2822
|
const segments = element.textSegments ?? [];
|
|
@@ -2784,7 +2867,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2784
2867
|
continue;
|
|
2785
2868
|
}
|
|
2786
2869
|
const element = slide.elements[elIdx];
|
|
2787
|
-
if (!
|
|
2870
|
+
if (!chunkKA35ZMIP_js.hasTextProperties(element)) {
|
|
2788
2871
|
continue;
|
|
2789
2872
|
}
|
|
2790
2873
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3382,7 +3465,7 @@ function useViewerCoreState(_input) {
|
|
|
3382
3465
|
const shapeAdjustmentDragStateRef = react.useRef(null);
|
|
3383
3466
|
const marqueeStateRef = react.useRef(null);
|
|
3384
3467
|
const isDrawingRef = react.useRef(false);
|
|
3385
|
-
const livePatcher = react.useMemo(() =>
|
|
3468
|
+
const livePatcher = react.useMemo(() => chunkKA35ZMIP_js.createCollaborationLivePatcher(), []);
|
|
3386
3469
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3387
3470
|
const slidesRef = react.useRef([]);
|
|
3388
3471
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3391,8 +3474,8 @@ function useViewerCoreState(_input) {
|
|
|
3391
3474
|
const [slides, setSlides] = react.useState([]);
|
|
3392
3475
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3393
3476
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3394
|
-
width:
|
|
3395
|
-
height:
|
|
3477
|
+
width: chunkHZSUTVDQ_js.DEFAULT_CANVAS_WIDTH,
|
|
3478
|
+
height: chunkHZSUTVDQ_js.DEFAULT_CANVAS_HEIGHT
|
|
3396
3479
|
});
|
|
3397
3480
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
3398
3481
|
const [selectedElementId, setSelectedElementId] = react.useState(null);
|
|
@@ -3412,7 +3495,7 @@ function useViewerCoreState(_input) {
|
|
|
3412
3495
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3413
3496
|
inlineEditingTextRef.current = resolved;
|
|
3414
3497
|
setInlineEditingTextBase(value);
|
|
3415
|
-
|
|
3498
|
+
chunkKA35ZMIP_js.publishLiveInlineText(
|
|
3416
3499
|
livePatcher,
|
|
3417
3500
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3418
3501
|
inlineEditingElementIdRef.current,
|
|
@@ -3746,7 +3829,7 @@ function useLoadContent({
|
|
|
3746
3829
|
);
|
|
3747
3830
|
}
|
|
3748
3831
|
const previousHandler = handlerRef.current;
|
|
3749
|
-
const handler = new
|
|
3832
|
+
const handler = new chunkKA35ZMIP_js.PptxHandler();
|
|
3750
3833
|
const parsed = await handler.load(buffer);
|
|
3751
3834
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3752
3835
|
handler.dispose();
|
|
@@ -3758,7 +3841,7 @@ function useLoadContent({
|
|
|
3758
3841
|
handlerRef.current = null;
|
|
3759
3842
|
const mediaElements = [];
|
|
3760
3843
|
for (const slide of parsed.slides) {
|
|
3761
|
-
|
|
3844
|
+
chunkKA35ZMIP_js.collectMediaElements(slide.elements, mediaElements);
|
|
3762
3845
|
}
|
|
3763
3846
|
for (const url of mediaDataUrls.values()) {
|
|
3764
3847
|
if (url.startsWith("blob:")) {
|
|
@@ -3799,7 +3882,7 @@ function useLoadContent({
|
|
|
3799
3882
|
}
|
|
3800
3883
|
})
|
|
3801
3884
|
);
|
|
3802
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3885
|
+
const { paths: imagePaths, refs: imageRefs } = chunkKA35ZMIP_js.collectImagePaths(parsed.slides);
|
|
3803
3886
|
let nextSlides = parsed.slides;
|
|
3804
3887
|
if (imagePaths.size > 0) {
|
|
3805
3888
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3854,12 +3937,12 @@ function useLoadContent({
|
|
|
3854
3937
|
}
|
|
3855
3938
|
}
|
|
3856
3939
|
handlerRef.current = handler;
|
|
3857
|
-
const partition =
|
|
3940
|
+
const partition = chunkHZSUTVDQ_js.partitionTemplateElements(nextSlides);
|
|
3858
3941
|
setSlides(partition.slides);
|
|
3859
3942
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3860
3943
|
setCanvasSize({
|
|
3861
|
-
width: parsed.width ??
|
|
3862
|
-
height: parsed.height ??
|
|
3944
|
+
width: parsed.width ?? chunkHZSUTVDQ_js.DEFAULT_CANVAS_WIDTH,
|
|
3945
|
+
height: parsed.height ?? chunkHZSUTVDQ_js.DEFAULT_CANVAS_HEIGHT
|
|
3863
3946
|
});
|
|
3864
3947
|
setHeaderFooter(parsed.headerFooter ?? {});
|
|
3865
3948
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
@@ -3888,7 +3971,7 @@ function useLoadContent({
|
|
|
3888
3971
|
setHasMacros(parsed.hasMacros === true);
|
|
3889
3972
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3890
3973
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3891
|
-
setGuides(
|
|
3974
|
+
setGuides(chunkKA35ZMIP_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3892
3975
|
setActiveSlideIndex(0);
|
|
3893
3976
|
clearSelection();
|
|
3894
3977
|
setIsDirty(false);
|
|
@@ -3896,7 +3979,7 @@ function useLoadContent({
|
|
|
3896
3979
|
onContentApplied?.();
|
|
3897
3980
|
} catch (err) {
|
|
3898
3981
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3899
|
-
if (err instanceof
|
|
3982
|
+
if (err instanceof chunkKA35ZMIP_js.EncryptedFileError) {
|
|
3900
3983
|
setIsEncrypted(true);
|
|
3901
3984
|
} else {
|
|
3902
3985
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3973,7 +4056,7 @@ function useAutosave(input) {
|
|
|
3973
4056
|
isSavingRef.current = false;
|
|
3974
4057
|
return;
|
|
3975
4058
|
}
|
|
3976
|
-
await
|
|
4059
|
+
await chunkKA35ZMIP_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
3977
4060
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
3978
4061
|
} catch (err) {
|
|
3979
4062
|
setAutosaveStatus({
|
|
@@ -4038,7 +4121,7 @@ function useElementOperations(input) {
|
|
|
4038
4121
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
4039
4122
|
const updateElementById = react.useCallback(
|
|
4040
4123
|
(elementId, updates) => {
|
|
4041
|
-
if (
|
|
4124
|
+
if (chunkKA35ZMIP_js.isTemplateElementId(elementId)) {
|
|
4042
4125
|
const slideId = activeSlide?.id;
|
|
4043
4126
|
if (slideId) {
|
|
4044
4127
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4078,7 +4161,7 @@ function useElementOperations(input) {
|
|
|
4078
4161
|
);
|
|
4079
4162
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4080
4163
|
(updates) => {
|
|
4081
|
-
if (!selectedElement || !
|
|
4164
|
+
if (!selectedElement || !chunkKA35ZMIP_js.hasShapeProperties(selectedElement)) {
|
|
4082
4165
|
return;
|
|
4083
4166
|
}
|
|
4084
4167
|
updateSelectedElement({
|
|
@@ -4089,17 +4172,17 @@ function useElementOperations(input) {
|
|
|
4089
4172
|
);
|
|
4090
4173
|
const updateSelectedTextStyle = react.useCallback(
|
|
4091
4174
|
(updates) => {
|
|
4092
|
-
if (!selectedElement || !
|
|
4175
|
+
if (!selectedElement || !chunkKA35ZMIP_js.hasTextProperties(selectedElement)) {
|
|
4093
4176
|
return;
|
|
4094
4177
|
}
|
|
4095
|
-
const inlineSel =
|
|
4178
|
+
const inlineSel = chunkKA35ZMIP_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4096
4179
|
if (inlineSel && selectedElement.textSegments) {
|
|
4097
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4180
|
+
const { newSegments: newSegments2, newSelection } = chunkKA35ZMIP_js.applyStyleToSelectedSegments(
|
|
4098
4181
|
selectedElement.textSegments,
|
|
4099
4182
|
inlineSel,
|
|
4100
4183
|
updates
|
|
4101
4184
|
);
|
|
4102
|
-
|
|
4185
|
+
chunkKA35ZMIP_js.setPendingSelectionRestore(newSelection);
|
|
4103
4186
|
updateSelectedElement({
|
|
4104
4187
|
textSegments: newSegments2
|
|
4105
4188
|
});
|
|
@@ -4119,12 +4202,12 @@ function useElementOperations(input) {
|
|
|
4119
4202
|
);
|
|
4120
4203
|
const updateSelectedTextCase = react.useCallback(
|
|
4121
4204
|
(mode) => {
|
|
4122
|
-
if (!selectedElement || !
|
|
4205
|
+
if (!selectedElement || !chunkKA35ZMIP_js.hasTextProperties(selectedElement)) {
|
|
4123
4206
|
return;
|
|
4124
4207
|
}
|
|
4125
|
-
const inlineSel =
|
|
4208
|
+
const inlineSel = chunkKA35ZMIP_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4126
4209
|
if (inlineSel && selectedElement.textSegments) {
|
|
4127
|
-
const newSegments =
|
|
4210
|
+
const newSegments = chunkKA35ZMIP_js.applyCaseTransformToSegments(
|
|
4128
4211
|
selectedElement.textSegments,
|
|
4129
4212
|
inlineSel,
|
|
4130
4213
|
mode
|
|
@@ -4134,14 +4217,14 @@ function useElementOperations(input) {
|
|
|
4134
4217
|
}
|
|
4135
4218
|
const updates = {};
|
|
4136
4219
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4137
|
-
updates.textSegments =
|
|
4220
|
+
updates.textSegments = chunkKA35ZMIP_js.applyCaseTransformToSegments(
|
|
4138
4221
|
selectedElement.textSegments,
|
|
4139
4222
|
null,
|
|
4140
4223
|
mode
|
|
4141
4224
|
);
|
|
4142
4225
|
}
|
|
4143
4226
|
if (typeof selectedElement.text === "string") {
|
|
4144
|
-
updates.text =
|
|
4227
|
+
updates.text = chunkKA35ZMIP_js.transformTextCase(selectedElement.text, mode);
|
|
4145
4228
|
}
|
|
4146
4229
|
updateSelectedElement(updates);
|
|
4147
4230
|
},
|
|
@@ -4196,7 +4279,7 @@ function useSectionOperations(input) {
|
|
|
4196
4279
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4197
4280
|
const addSection2 = react.useCallback(
|
|
4198
4281
|
(name, afterSlideIndex) => {
|
|
4199
|
-
const result =
|
|
4282
|
+
const result = chunkKA35ZMIP_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4200
4283
|
setSlides(result.slides);
|
|
4201
4284
|
setSections(result.sections);
|
|
4202
4285
|
markDirty();
|
|
@@ -4205,7 +4288,7 @@ function useSectionOperations(input) {
|
|
|
4205
4288
|
);
|
|
4206
4289
|
const renameSection2 = react.useCallback(
|
|
4207
4290
|
(sectionId, newName) => {
|
|
4208
|
-
const result =
|
|
4291
|
+
const result = chunkKA35ZMIP_js.renameSection(sections, slides, sectionId, newName);
|
|
4209
4292
|
setSections(result.sections);
|
|
4210
4293
|
setSlides(result.slides);
|
|
4211
4294
|
markDirty();
|
|
@@ -4214,7 +4297,7 @@ function useSectionOperations(input) {
|
|
|
4214
4297
|
);
|
|
4215
4298
|
const deleteSection2 = react.useCallback(
|
|
4216
4299
|
(sectionId) => {
|
|
4217
|
-
const result =
|
|
4300
|
+
const result = chunkKA35ZMIP_js.deleteSection(sections, slides, sectionId);
|
|
4218
4301
|
setSections(result.sections);
|
|
4219
4302
|
setSlides(result.slides);
|
|
4220
4303
|
markDirty();
|
|
@@ -4223,21 +4306,21 @@ function useSectionOperations(input) {
|
|
|
4223
4306
|
);
|
|
4224
4307
|
const moveSectionUp2 = react.useCallback(
|
|
4225
4308
|
(sectionId) => {
|
|
4226
|
-
setSections(
|
|
4309
|
+
setSections(chunkKA35ZMIP_js.moveSectionUp(sections, sectionId));
|
|
4227
4310
|
markDirty();
|
|
4228
4311
|
},
|
|
4229
4312
|
[sections, setSections, markDirty]
|
|
4230
4313
|
);
|
|
4231
4314
|
const moveSectionDown2 = react.useCallback(
|
|
4232
4315
|
(sectionId) => {
|
|
4233
|
-
setSections(
|
|
4316
|
+
setSections(chunkKA35ZMIP_js.moveSectionDown(sections, sectionId));
|
|
4234
4317
|
markDirty();
|
|
4235
4318
|
},
|
|
4236
4319
|
[sections, setSections, markDirty]
|
|
4237
4320
|
);
|
|
4238
4321
|
const moveSlidesToSection2 = react.useCallback(
|
|
4239
4322
|
(slideIndexes, targetSectionId) => {
|
|
4240
|
-
const result =
|
|
4323
|
+
const result = chunkKA35ZMIP_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4241
4324
|
setSlides(result.slides);
|
|
4242
4325
|
setSections(result.sections);
|
|
4243
4326
|
markDirty();
|
|
@@ -4256,19 +4339,19 @@ function useSectionOperations(input) {
|
|
|
4256
4339
|
|
|
4257
4340
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4258
4341
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4259
|
-
const resized =
|
|
4342
|
+
const resized = chunkKA35ZMIP_js.applyResize(
|
|
4260
4343
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4261
4344
|
handle,
|
|
4262
4345
|
dx,
|
|
4263
4346
|
dy,
|
|
4264
4347
|
1,
|
|
4265
|
-
{ minSize:
|
|
4348
|
+
{ minSize: chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE }
|
|
4266
4349
|
);
|
|
4267
4350
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4268
4351
|
if (!snapToGrid) {
|
|
4269
4352
|
return box;
|
|
4270
4353
|
}
|
|
4271
|
-
return
|
|
4354
|
+
return chunkKA35ZMIP_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE);
|
|
4272
4355
|
}
|
|
4273
4356
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
4274
4357
|
const range = startWidth || 200;
|
|
@@ -4386,7 +4469,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4386
4469
|
width: el.width,
|
|
4387
4470
|
height: el.height
|
|
4388
4471
|
}));
|
|
4389
|
-
const snapResult =
|
|
4472
|
+
const snapResult = chunkKA35ZMIP_js.computeSnapToShape(
|
|
4390
4473
|
targetX,
|
|
4391
4474
|
targetY,
|
|
4392
4475
|
primaryEl.width,
|
|
@@ -4425,7 +4508,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4425
4508
|
if (live) {
|
|
4426
4509
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4427
4510
|
const start = drag.startPositionsById[id];
|
|
4428
|
-
|
|
4511
|
+
chunkKA35ZMIP_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4429
4512
|
x: start.x + appliedDx,
|
|
4430
4513
|
y: start.y + appliedDy
|
|
4431
4514
|
});
|
|
@@ -4459,15 +4542,15 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4459
4542
|
if (rs.domEl) {
|
|
4460
4543
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4461
4544
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4462
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4463
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4545
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE)}px`;
|
|
4546
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE)}px`;
|
|
4464
4547
|
}
|
|
4465
4548
|
if (live) {
|
|
4466
|
-
|
|
4549
|
+
chunkKA35ZMIP_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4467
4550
|
x: geo.x,
|
|
4468
4551
|
y: geo.y,
|
|
4469
|
-
width: Math.max(geo.width,
|
|
4470
|
-
height: Math.max(geo.height,
|
|
4552
|
+
width: Math.max(geo.width, chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE),
|
|
4553
|
+
height: Math.max(geo.height, chunkHZSUTVDQ_js.MIN_ELEMENT_SIZE)
|
|
4471
4554
|
});
|
|
4472
4555
|
}
|
|
4473
4556
|
}
|
|
@@ -4547,13 +4630,13 @@ function processPointerUp(input) {
|
|
|
4547
4630
|
if (i !== activeSlideIndex) {
|
|
4548
4631
|
return s;
|
|
4549
4632
|
}
|
|
4550
|
-
const rerouted =
|
|
4633
|
+
const rerouted = chunkKA35ZMIP_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4551
4634
|
if (rerouted.length === 0) {
|
|
4552
4635
|
return s;
|
|
4553
4636
|
}
|
|
4554
4637
|
return {
|
|
4555
4638
|
...s,
|
|
4556
|
-
elements:
|
|
4639
|
+
elements: chunkKA35ZMIP_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4557
4640
|
};
|
|
4558
4641
|
})
|
|
4559
4642
|
);
|
|
@@ -4575,9 +4658,9 @@ function processPointerUp(input) {
|
|
|
4575
4658
|
}
|
|
4576
4659
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4577
4660
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4578
|
-
const hitIds =
|
|
4661
|
+
const hitIds = chunkKA35ZMIP_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4579
4662
|
if (marquee.additive) {
|
|
4580
|
-
const merged =
|
|
4663
|
+
const merged = chunkKA35ZMIP_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4581
4664
|
if (merged.length > 0) {
|
|
4582
4665
|
applySelection(merged[0], merged);
|
|
4583
4666
|
} else {
|
|
@@ -4600,8 +4683,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4600
4683
|
}
|
|
4601
4684
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4602
4685
|
});
|
|
4603
|
-
const rerouted =
|
|
4604
|
-
return
|
|
4686
|
+
const rerouted = chunkKA35ZMIP_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4687
|
+
return chunkKA35ZMIP_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4605
4688
|
};
|
|
4606
4689
|
if (editTemplateMode) {
|
|
4607
4690
|
const slideId = activeSlide?.id;
|
|
@@ -4757,9 +4840,9 @@ function useCanvasInteractions(input) {
|
|
|
4757
4840
|
return;
|
|
4758
4841
|
}
|
|
4759
4842
|
const el = elementLookup.get(editId);
|
|
4760
|
-
if (el &&
|
|
4843
|
+
if (el && chunkKA35ZMIP_js.hasTextProperties(el)) {
|
|
4761
4844
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4762
|
-
const newSegments =
|
|
4845
|
+
const newSegments = chunkKA35ZMIP_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4763
4846
|
ops.updateElementById(editId, {
|
|
4764
4847
|
text: committedText,
|
|
4765
4848
|
textSegments: newSegments
|
|
@@ -4770,7 +4853,7 @@ function useCanvasInteractions(input) {
|
|
|
4770
4853
|
setInlineEditingText("");
|
|
4771
4854
|
};
|
|
4772
4855
|
const openEquationEditorForElement = (el) => {
|
|
4773
|
-
if (!
|
|
4856
|
+
if (!chunkKA35ZMIP_js.hasTextProperties(el)) {
|
|
4774
4857
|
return false;
|
|
4775
4858
|
}
|
|
4776
4859
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4799,7 +4882,7 @@ function useCanvasInteractions(input) {
|
|
|
4799
4882
|
justSelectedRef.current = false;
|
|
4800
4883
|
} else {
|
|
4801
4884
|
const el = elementLookup.get(elementId);
|
|
4802
|
-
if (el &&
|
|
4885
|
+
if (el && chunkKA35ZMIP_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
4803
4886
|
if (!openEquationEditorForElement(el)) {
|
|
4804
4887
|
setInlineEditingElementId(elementId);
|
|
4805
4888
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4818,7 +4901,7 @@ function useCanvasInteractions(input) {
|
|
|
4818
4901
|
if (openEquationEditorForElement(el)) {
|
|
4819
4902
|
return;
|
|
4820
4903
|
}
|
|
4821
|
-
if (
|
|
4904
|
+
if (chunkKA35ZMIP_js.hasTextProperties(el)) {
|
|
4822
4905
|
setInlineEditingElementId(elementId);
|
|
4823
4906
|
setInlineEditingText(el.text ?? "");
|
|
4824
4907
|
}
|
|
@@ -5011,7 +5094,7 @@ function createFileHandlers(deps) {
|
|
|
5011
5094
|
h = Math.round(h * scale);
|
|
5012
5095
|
}
|
|
5013
5096
|
addElement({
|
|
5014
|
-
id:
|
|
5097
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5015
5098
|
type: "image",
|
|
5016
5099
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5017
5100
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5022,7 +5105,7 @@ function createFileHandlers(deps) {
|
|
|
5022
5105
|
};
|
|
5023
5106
|
img.onerror = () => {
|
|
5024
5107
|
addElement({
|
|
5025
|
-
id:
|
|
5108
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5026
5109
|
type: "image",
|
|
5027
5110
|
x: 100,
|
|
5028
5111
|
y: 100,
|
|
@@ -5048,7 +5131,7 @@ function createFileHandlers(deps) {
|
|
|
5048
5131
|
const elFilePath = file.path;
|
|
5049
5132
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5050
5133
|
addElement({
|
|
5051
|
-
id:
|
|
5134
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5052
5135
|
type: "media",
|
|
5053
5136
|
mediaType,
|
|
5054
5137
|
mediaMimeType: file.type || void 0,
|
|
@@ -5223,13 +5306,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5223
5306
|
return;
|
|
5224
5307
|
}
|
|
5225
5308
|
addElement({
|
|
5226
|
-
id:
|
|
5309
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5227
5310
|
type: "smartArt",
|
|
5228
5311
|
x: 100,
|
|
5229
5312
|
y: 120,
|
|
5230
5313
|
width: 600,
|
|
5231
5314
|
height: 340,
|
|
5232
|
-
smartArtData:
|
|
5315
|
+
smartArtData: chunkKA35ZMIP_js.buildSmartArtPresetData(
|
|
5233
5316
|
layout,
|
|
5234
5317
|
defaultItems,
|
|
5235
5318
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5241,7 +5324,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5241
5324
|
return;
|
|
5242
5325
|
}
|
|
5243
5326
|
addElement({
|
|
5244
|
-
id:
|
|
5327
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5245
5328
|
type: "shape",
|
|
5246
5329
|
x: 120,
|
|
5247
5330
|
y: 200,
|
|
@@ -5300,7 +5383,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5300
5383
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5301
5384
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5302
5385
|
addElement({
|
|
5303
|
-
id:
|
|
5386
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5304
5387
|
type: "shape",
|
|
5305
5388
|
x: 120,
|
|
5306
5389
|
y: 200,
|
|
@@ -5322,11 +5405,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5322
5405
|
if (!activeSlide) {
|
|
5323
5406
|
return;
|
|
5324
5407
|
}
|
|
5325
|
-
const preset =
|
|
5408
|
+
const preset = chunkKA35ZMIP_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5326
5409
|
if (!preset) {
|
|
5327
5410
|
return;
|
|
5328
5411
|
}
|
|
5329
|
-
const defaultPptxAction =
|
|
5412
|
+
const defaultPptxAction = chunkKA35ZMIP_js.elementActionToPptxAction({
|
|
5330
5413
|
trigger: "click",
|
|
5331
5414
|
type: preset.defaultAction
|
|
5332
5415
|
});
|
|
@@ -5335,7 +5418,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5335
5418
|
defaultPptxAction.highlightClick = true;
|
|
5336
5419
|
}
|
|
5337
5420
|
addElement({
|
|
5338
|
-
id:
|
|
5421
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5339
5422
|
type: "shape",
|
|
5340
5423
|
x: 150,
|
|
5341
5424
|
y: 150,
|
|
@@ -5402,14 +5485,14 @@ function useInsertElements(input) {
|
|
|
5402
5485
|
return;
|
|
5403
5486
|
}
|
|
5404
5487
|
addElement({
|
|
5405
|
-
id:
|
|
5488
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5406
5489
|
type: "text",
|
|
5407
5490
|
x: 100,
|
|
5408
5491
|
y: 100,
|
|
5409
5492
|
width: 300,
|
|
5410
5493
|
height: 60,
|
|
5411
5494
|
text: "",
|
|
5412
|
-
textStyle: { fontSize:
|
|
5495
|
+
textStyle: { fontSize: chunkHZSUTVDQ_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5413
5496
|
});
|
|
5414
5497
|
};
|
|
5415
5498
|
const handleAddShape = () => {
|
|
@@ -5417,7 +5500,7 @@ function useInsertElements(input) {
|
|
|
5417
5500
|
return;
|
|
5418
5501
|
}
|
|
5419
5502
|
addElement({
|
|
5420
|
-
id:
|
|
5503
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5421
5504
|
type: "shape",
|
|
5422
5505
|
x: 150,
|
|
5423
5506
|
y: 150,
|
|
@@ -5436,15 +5519,15 @@ function useInsertElements(input) {
|
|
|
5436
5519
|
return;
|
|
5437
5520
|
}
|
|
5438
5521
|
addElement({
|
|
5439
|
-
...
|
|
5440
|
-
id:
|
|
5522
|
+
...chunkKA35ZMIP_js.newTableElement(chunkHZSUTVDQ_js.DEFAULT_TABLE_ROWS, chunkHZSUTVDQ_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5523
|
+
id: chunkKA35ZMIP_js.generateElementId()
|
|
5441
5524
|
});
|
|
5442
5525
|
};
|
|
5443
|
-
const handleAddChart = (
|
|
5526
|
+
const handleAddChart = (chartKind) => {
|
|
5444
5527
|
if (!activeSlide) {
|
|
5445
5528
|
return;
|
|
5446
5529
|
}
|
|
5447
|
-
addElement(
|
|
5530
|
+
addElement(chunkKA35ZMIP_js.createDefaultChartElement(chartKind));
|
|
5448
5531
|
};
|
|
5449
5532
|
const structured = createStructuredElementHandlers({
|
|
5450
5533
|
activeSlide,
|
|
@@ -5514,7 +5597,7 @@ function useClipboardHandlers(input) {
|
|
|
5514
5597
|
if (!selectedElement) {
|
|
5515
5598
|
return;
|
|
5516
5599
|
}
|
|
5517
|
-
setClipboardPayload(
|
|
5600
|
+
setClipboardPayload(chunkKA35ZMIP_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5518
5601
|
};
|
|
5519
5602
|
const handleDelete = () => {
|
|
5520
5603
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5531,7 +5614,7 @@ function useClipboardHandlers(input) {
|
|
|
5531
5614
|
handleDelete();
|
|
5532
5615
|
};
|
|
5533
5616
|
const insertClone = (source) => {
|
|
5534
|
-
const clone =
|
|
5617
|
+
const clone = chunkKA35ZMIP_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5535
5618
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5536
5619
|
ops.applySelection(clone.id);
|
|
5537
5620
|
history.markDirty();
|
|
@@ -5566,7 +5649,7 @@ function resolveShapePath(el) {
|
|
|
5566
5649
|
return el.pathData;
|
|
5567
5650
|
}
|
|
5568
5651
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5569
|
-
const clipPath =
|
|
5652
|
+
const clipPath = chunkKA35ZMIP_js.getPresetShapeClipPath(el.shapeType);
|
|
5570
5653
|
if (clipPath) {
|
|
5571
5654
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5572
5655
|
if (svgPath) {
|
|
@@ -5617,7 +5700,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5617
5700
|
return parts.join(" ");
|
|
5618
5701
|
}
|
|
5619
5702
|
function transformPathToGlobal(pathData, el) {
|
|
5620
|
-
const polys =
|
|
5703
|
+
const polys = chunkKA35ZMIP_js.svgPathToPolygons(pathData);
|
|
5621
5704
|
if (polys.length === 0) {
|
|
5622
5705
|
return pathData;
|
|
5623
5706
|
}
|
|
@@ -5637,10 +5720,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5637
5720
|
y: pt.y * scaleY + el.y
|
|
5638
5721
|
}))
|
|
5639
5722
|
);
|
|
5640
|
-
return
|
|
5723
|
+
return chunkKA35ZMIP_js.polygonsToSvgPath(transformed);
|
|
5641
5724
|
}
|
|
5642
5725
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5643
|
-
const polys =
|
|
5726
|
+
const polys = chunkKA35ZMIP_js.svgPathToPolygons(pathData);
|
|
5644
5727
|
if (polys.length === 0) {
|
|
5645
5728
|
return pathData;
|
|
5646
5729
|
}
|
|
@@ -5650,10 +5733,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5650
5733
|
y: pt.y - y
|
|
5651
5734
|
}))
|
|
5652
5735
|
);
|
|
5653
|
-
return
|
|
5736
|
+
return chunkKA35ZMIP_js.polygonsToSvgPath(transformed);
|
|
5654
5737
|
}
|
|
5655
5738
|
function pathBounds(pathData) {
|
|
5656
|
-
const polys =
|
|
5739
|
+
const polys = chunkKA35ZMIP_js.svgPathToPolygons(pathData);
|
|
5657
5740
|
let minX = Infinity;
|
|
5658
5741
|
let minY = Infinity;
|
|
5659
5742
|
let maxX = -Infinity;
|
|
@@ -5712,7 +5795,7 @@ function useMergeShapesHandler(input) {
|
|
|
5712
5795
|
let allFragments = [];
|
|
5713
5796
|
let remaining = globalPaths[0];
|
|
5714
5797
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5715
|
-
const frags =
|
|
5798
|
+
const frags = chunkKA35ZMIP_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5716
5799
|
if (Array.isArray(frags)) {
|
|
5717
5800
|
allFragments = frags;
|
|
5718
5801
|
}
|
|
@@ -5741,7 +5824,7 @@ function useMergeShapesHandler(input) {
|
|
|
5741
5824
|
bounds.height
|
|
5742
5825
|
);
|
|
5743
5826
|
const newEl = {
|
|
5744
|
-
id:
|
|
5827
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5745
5828
|
type: "shape",
|
|
5746
5829
|
x: bounds.x,
|
|
5747
5830
|
y: bounds.y,
|
|
@@ -5779,7 +5862,7 @@ function useMergeShapesHandler(input) {
|
|
|
5779
5862
|
} else {
|
|
5780
5863
|
let resultPath = globalPaths[0];
|
|
5781
5864
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5782
|
-
const result =
|
|
5865
|
+
const result = chunkKA35ZMIP_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5783
5866
|
if (typeof result === "string") {
|
|
5784
5867
|
resultPath = result;
|
|
5785
5868
|
}
|
|
@@ -5800,7 +5883,7 @@ function useMergeShapesHandler(input) {
|
|
|
5800
5883
|
);
|
|
5801
5884
|
const primary = targets[0];
|
|
5802
5885
|
const newEl = {
|
|
5803
|
-
id:
|
|
5886
|
+
id: chunkKA35ZMIP_js.generateElementId(),
|
|
5804
5887
|
type: "shape",
|
|
5805
5888
|
x: bounds.x,
|
|
5806
5889
|
y: bounds.y,
|
|
@@ -5863,7 +5946,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5863
5946
|
if (ids.length < 2 || !activeSlide) {
|
|
5864
5947
|
return;
|
|
5865
5948
|
}
|
|
5866
|
-
const { elements, groupId } =
|
|
5949
|
+
const { elements, groupId } = chunkKA35ZMIP_js.groupElements(ops.activeElements, ids, chunkKA35ZMIP_js.generateElementId());
|
|
5867
5950
|
if (groupId === null) {
|
|
5868
5951
|
return;
|
|
5869
5952
|
}
|
|
@@ -5876,12 +5959,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5876
5959
|
return;
|
|
5877
5960
|
}
|
|
5878
5961
|
const group = selectedElement;
|
|
5879
|
-
const intoTemplate =
|
|
5962
|
+
const intoTemplate = chunkKA35ZMIP_js.isTemplateElementId(group.id);
|
|
5880
5963
|
const ungrouped = group.children.map((child) => ({
|
|
5881
5964
|
...structuredClone(child),
|
|
5882
5965
|
// Keep child ids in the same store as the group so later edits route
|
|
5883
5966
|
// correctly: template groups yield template-prefixed child ids.
|
|
5884
|
-
id: intoTemplate ?
|
|
5967
|
+
id: intoTemplate ? chunkKA35ZMIP_js.makeCloneId(true, child.id || group.id) : child.id || chunkKA35ZMIP_js.generateElementId(),
|
|
5885
5968
|
x: child.x + group.x,
|
|
5886
5969
|
y: child.y + group.y
|
|
5887
5970
|
}));
|
|
@@ -5905,7 +5988,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5905
5988
|
if (!edge) {
|
|
5906
5989
|
return;
|
|
5907
5990
|
}
|
|
5908
|
-
const positions =
|
|
5991
|
+
const positions = chunkKA35ZMIP_js.alignElements(selectedElements, edge);
|
|
5909
5992
|
for (const [id, pos] of positions) {
|
|
5910
5993
|
const el = elementLookup.get(id);
|
|
5911
5994
|
if (!el) {
|
|
@@ -5923,7 +6006,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5923
6006
|
if (!distAxis) {
|
|
5924
6007
|
return;
|
|
5925
6008
|
}
|
|
5926
|
-
const positions =
|
|
6009
|
+
const positions = chunkKA35ZMIP_js.distributeElements(selectedElements, distAxis);
|
|
5927
6010
|
for (const [id, pos] of positions) {
|
|
5928
6011
|
const el = elementLookup.get(id);
|
|
5929
6012
|
if (!el) {
|
|
@@ -5940,7 +6023,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5940
6023
|
}
|
|
5941
6024
|
const id = selectedElement.id;
|
|
5942
6025
|
ops.updateActiveElements(
|
|
5943
|
-
(els) => direction === "forward" ?
|
|
6026
|
+
(els) => direction === "forward" ? chunkKA35ZMIP_js.bringForward(els, id) : direction === "backward" ? chunkKA35ZMIP_js.sendBackward(els, id) : els
|
|
5944
6027
|
);
|
|
5945
6028
|
history.markDirty();
|
|
5946
6029
|
};
|
|
@@ -5950,7 +6033,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5950
6033
|
}
|
|
5951
6034
|
const id = selectedElement.id;
|
|
5952
6035
|
ops.updateActiveElements(
|
|
5953
|
-
(els) => direction === "front" ?
|
|
6036
|
+
(els) => direction === "front" ? chunkKA35ZMIP_js.bringToFront(els, id) : chunkKA35ZMIP_js.sendToBack(els, id)
|
|
5954
6037
|
);
|
|
5955
6038
|
history.markDirty();
|
|
5956
6039
|
};
|
|
@@ -6070,9 +6153,18 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
6070
6153
|
return next;
|
|
6071
6154
|
}
|
|
6072
6155
|
function useSlideManagement(input) {
|
|
6073
|
-
const {
|
|
6156
|
+
const {
|
|
6157
|
+
slides,
|
|
6158
|
+
activeSlideIndex,
|
|
6159
|
+
setActiveSlideIndex,
|
|
6160
|
+
ops,
|
|
6161
|
+
history,
|
|
6162
|
+
handlerRef,
|
|
6163
|
+
canvasSize,
|
|
6164
|
+
theme
|
|
6165
|
+
} = input;
|
|
6074
6166
|
const handleAddSlide = () => {
|
|
6075
|
-
const newSlide =
|
|
6167
|
+
const newSlide = chunkKA35ZMIP_js.createBlankSlide(slides.length + 1);
|
|
6076
6168
|
ops.updateSlides((prev) => {
|
|
6077
6169
|
const next = [...prev];
|
|
6078
6170
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6135,7 +6227,7 @@ function useSlideManagement(input) {
|
|
|
6135
6227
|
}
|
|
6136
6228
|
const clone = {
|
|
6137
6229
|
...src,
|
|
6138
|
-
id:
|
|
6230
|
+
id: chunkKA35ZMIP_js.makeSlideId(),
|
|
6139
6231
|
elements: src.elements.map((el) => ({
|
|
6140
6232
|
...el,
|
|
6141
6233
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6167,7 +6259,7 @@ function useSlideManagement(input) {
|
|
|
6167
6259
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6168
6260
|
const insertAt = activeSlideIndex + 1;
|
|
6169
6261
|
const draft = {
|
|
6170
|
-
...
|
|
6262
|
+
...chunkKA35ZMIP_js.createBlankSlide(slides.length + 1),
|
|
6171
6263
|
layoutPath,
|
|
6172
6264
|
...layoutName ? { layoutName } : {}
|
|
6173
6265
|
};
|
|
@@ -6198,6 +6290,16 @@ function useSlideManagement(input) {
|
|
|
6198
6290
|
);
|
|
6199
6291
|
}
|
|
6200
6292
|
};
|
|
6293
|
+
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6294
|
+
const insertAt = activeSlideIndex + 1;
|
|
6295
|
+
const draft = chunkKA35ZMIP_js.buildSlideTemplateSlide(templateId, chunkKA35ZMIP_js.makeSlideId(), slides.length + 1, {
|
|
6296
|
+
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6297
|
+
scheme: chunkKA35ZMIP_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6298
|
+
});
|
|
6299
|
+
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6300
|
+
setActiveSlideIndex(insertAt);
|
|
6301
|
+
history.markDirty();
|
|
6302
|
+
};
|
|
6201
6303
|
return {
|
|
6202
6304
|
handleAddSlide,
|
|
6203
6305
|
handleMoveSlide,
|
|
@@ -6205,7 +6307,8 @@ function useSlideManagement(input) {
|
|
|
6205
6307
|
handleDeleteSlides,
|
|
6206
6308
|
handleDuplicateSlides,
|
|
6207
6309
|
handleToggleHideSlides,
|
|
6208
|
-
handleInsertSlideFromLayout
|
|
6310
|
+
handleInsertSlideFromLayout,
|
|
6311
|
+
handleInsertSlideFromTemplate
|
|
6209
6312
|
};
|
|
6210
6313
|
}
|
|
6211
6314
|
|
|
@@ -6228,7 +6331,7 @@ function createTableMergeHandlers(input) {
|
|
|
6228
6331
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6229
6332
|
return;
|
|
6230
6333
|
}
|
|
6231
|
-
const newTableData =
|
|
6334
|
+
const newTableData = chunkKA35ZMIP_js.mergeCells(
|
|
6232
6335
|
[
|
|
6233
6336
|
{ row: rowIndex, col: columnIndex },
|
|
6234
6337
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6236,7 +6339,7 @@ function createTableMergeHandlers(input) {
|
|
|
6236
6339
|
td
|
|
6237
6340
|
);
|
|
6238
6341
|
const updates = { tableData: newTableData };
|
|
6239
|
-
const newRawXml =
|
|
6342
|
+
const newRawXml = chunkKA35ZMIP_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6240
6343
|
if (newRawXml) {
|
|
6241
6344
|
updates.rawXml = newRawXml;
|
|
6242
6345
|
}
|
|
@@ -6262,7 +6365,7 @@ function createTableMergeHandlers(input) {
|
|
|
6262
6365
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6263
6366
|
return;
|
|
6264
6367
|
}
|
|
6265
|
-
const newTableData =
|
|
6368
|
+
const newTableData = chunkKA35ZMIP_js.mergeCells(
|
|
6266
6369
|
[
|
|
6267
6370
|
{ row: rowIndex, col: columnIndex },
|
|
6268
6371
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6270,7 +6373,7 @@ function createTableMergeHandlers(input) {
|
|
|
6270
6373
|
td
|
|
6271
6374
|
);
|
|
6272
6375
|
const updates = { tableData: newTableData };
|
|
6273
|
-
const newRawXml =
|
|
6376
|
+
const newRawXml = chunkKA35ZMIP_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6274
6377
|
if (newRawXml) {
|
|
6275
6378
|
updates.rawXml = newRawXml;
|
|
6276
6379
|
}
|
|
@@ -6285,9 +6388,9 @@ function createTableMergeHandlers(input) {
|
|
|
6285
6388
|
return;
|
|
6286
6389
|
}
|
|
6287
6390
|
const td = selectedElement.tableData;
|
|
6288
|
-
const newTableData =
|
|
6391
|
+
const newTableData = chunkKA35ZMIP_js.mergeCells(ts.selectedCells, td);
|
|
6289
6392
|
const updates = { tableData: newTableData };
|
|
6290
|
-
const newRawXml =
|
|
6393
|
+
const newRawXml = chunkKA35ZMIP_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6291
6394
|
if (newRawXml) {
|
|
6292
6395
|
updates.rawXml = newRawXml;
|
|
6293
6396
|
}
|
|
@@ -6304,9 +6407,9 @@ function createTableMergeHandlers(input) {
|
|
|
6304
6407
|
}
|
|
6305
6408
|
const { rowIndex, columnIndex } = ts;
|
|
6306
6409
|
const td = selectedElement.tableData;
|
|
6307
|
-
const newTableData =
|
|
6410
|
+
const newTableData = chunkKA35ZMIP_js.splitCell(rowIndex, columnIndex, td);
|
|
6308
6411
|
const updates = { tableData: newTableData };
|
|
6309
|
-
const newRawXml =
|
|
6412
|
+
const newRawXml = chunkKA35ZMIP_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6310
6413
|
if (newRawXml) {
|
|
6311
6414
|
updates.rawXml = newRawXml;
|
|
6312
6415
|
}
|
|
@@ -6350,7 +6453,7 @@ function createTableStructHandlers(input) {
|
|
|
6350
6453
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
6351
6454
|
}
|
|
6352
6455
|
if (el.rawXml) {
|
|
6353
|
-
const newRawXml =
|
|
6456
|
+
const newRawXml = chunkKA35ZMIP_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6354
6457
|
if (newRawXml) {
|
|
6355
6458
|
updates.rawXml = newRawXml;
|
|
6356
6459
|
}
|
|
@@ -6374,7 +6477,7 @@ function createTableStructHandlers(input) {
|
|
|
6374
6477
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6375
6478
|
const updates = {};
|
|
6376
6479
|
if (selectedElement.rawXml) {
|
|
6377
|
-
const newRawXml =
|
|
6480
|
+
const newRawXml = chunkKA35ZMIP_js.updateCellTextStyleInRawXml(
|
|
6378
6481
|
selectedElement,
|
|
6379
6482
|
rowIndex,
|
|
6380
6483
|
colIndex,
|
|
@@ -6438,9 +6541,9 @@ function createTableStructHandlers(input) {
|
|
|
6438
6541
|
return;
|
|
6439
6542
|
}
|
|
6440
6543
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6441
|
-
const newTableData =
|
|
6544
|
+
const newTableData = chunkKA35ZMIP_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6442
6545
|
const updates = { tableData: newTableData };
|
|
6443
|
-
const newRawXml =
|
|
6546
|
+
const newRawXml = chunkKA35ZMIP_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6444
6547
|
if (newRawXml) {
|
|
6445
6548
|
updates.rawXml = newRawXml;
|
|
6446
6549
|
}
|
|
@@ -6453,12 +6556,12 @@ function createTableStructHandlers(input) {
|
|
|
6453
6556
|
}
|
|
6454
6557
|
const td = selectedElement.tableData;
|
|
6455
6558
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6456
|
-
const newTableData =
|
|
6559
|
+
const newTableData = chunkKA35ZMIP_js.deleteTableRow(td, rowIdx);
|
|
6457
6560
|
if (newTableData === td) {
|
|
6458
6561
|
return;
|
|
6459
6562
|
}
|
|
6460
6563
|
const updates = { tableData: newTableData };
|
|
6461
|
-
const newRawXml =
|
|
6564
|
+
const newRawXml = chunkKA35ZMIP_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6462
6565
|
if (newRawXml) {
|
|
6463
6566
|
updates.rawXml = newRawXml;
|
|
6464
6567
|
}
|
|
@@ -6470,9 +6573,9 @@ function createTableStructHandlers(input) {
|
|
|
6470
6573
|
return;
|
|
6471
6574
|
}
|
|
6472
6575
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6473
|
-
const newTableData =
|
|
6576
|
+
const newTableData = chunkKA35ZMIP_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6474
6577
|
const updates = { tableData: newTableData };
|
|
6475
|
-
const newRawXml =
|
|
6578
|
+
const newRawXml = chunkKA35ZMIP_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6476
6579
|
if (newRawXml) {
|
|
6477
6580
|
updates.rawXml = newRawXml;
|
|
6478
6581
|
}
|
|
@@ -6485,12 +6588,12 @@ function createTableStructHandlers(input) {
|
|
|
6485
6588
|
}
|
|
6486
6589
|
const td = selectedElement.tableData;
|
|
6487
6590
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6488
|
-
const newTableData =
|
|
6591
|
+
const newTableData = chunkKA35ZMIP_js.deleteTableColumn(td, colIdx);
|
|
6489
6592
|
if (newTableData === td) {
|
|
6490
6593
|
return;
|
|
6491
6594
|
}
|
|
6492
6595
|
const updates = { tableData: newTableData };
|
|
6493
|
-
const newRawXml =
|
|
6596
|
+
const newRawXml = chunkKA35ZMIP_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6494
6597
|
if (newRawXml) {
|
|
6495
6598
|
updates.rawXml = newRawXml;
|
|
6496
6599
|
}
|
|
@@ -6526,8 +6629,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6526
6629
|
return html2canvasPro(element, {
|
|
6527
6630
|
...options,
|
|
6528
6631
|
onclone: async (doc, clonedEl) => {
|
|
6529
|
-
await
|
|
6530
|
-
|
|
6632
|
+
await chunkKA35ZMIP_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6633
|
+
chunkKA35ZMIP_js.preprocessCssForCapture(clonedEl);
|
|
6531
6634
|
if (typeof userOnClone === "function") {
|
|
6532
6635
|
userOnClone(doc, clonedEl);
|
|
6533
6636
|
}
|
|
@@ -6583,7 +6686,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6583
6686
|
}
|
|
6584
6687
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6585
6688
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6586
|
-
|
|
6689
|
+
chunkKA35ZMIP_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6587
6690
|
}
|
|
6588
6691
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6589
6692
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6605,15 +6708,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6605
6708
|
continue;
|
|
6606
6709
|
}
|
|
6607
6710
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6608
|
-
images.push(
|
|
6711
|
+
images.push(chunkKA35ZMIP_js.canvasToJpegData(canvas));
|
|
6609
6712
|
}
|
|
6610
6713
|
onProgress?.(totalSlides, totalSlides);
|
|
6611
6714
|
setActiveSlide(currentSlideIndex);
|
|
6612
6715
|
if (images.length === 0) {
|
|
6613
|
-
throw new Error(
|
|
6716
|
+
throw new Error(chunk3ISYPBSX_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6614
6717
|
}
|
|
6615
|
-
const pdfBlobUrl =
|
|
6616
|
-
|
|
6718
|
+
const pdfBlobUrl = chunkHZSUTVDQ_js.buildPdfFromImageData(images);
|
|
6719
|
+
chunkKA35ZMIP_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6617
6720
|
}
|
|
6618
6721
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6619
6722
|
const { scale = 2, onProgress } = options;
|
|
@@ -6659,10 +6762,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6659
6762
|
onProgress?.(totalSlides, totalSlides);
|
|
6660
6763
|
setActiveSlide(currentSlideIndex);
|
|
6661
6764
|
if (pages.length === 0) {
|
|
6662
|
-
throw new Error(
|
|
6765
|
+
throw new Error(chunk3ISYPBSX_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6663
6766
|
}
|
|
6664
|
-
const pdfDataUrl =
|
|
6665
|
-
|
|
6767
|
+
const pdfDataUrl = chunkHZSUTVDQ_js.buildNotesPdf(pages);
|
|
6768
|
+
chunkKA35ZMIP_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6666
6769
|
}
|
|
6667
6770
|
|
|
6668
6771
|
// src/viewer/utils/export-video.ts
|
|
@@ -6693,7 +6796,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6693
6796
|
}
|
|
6694
6797
|
setActiveSlide(currentSlideIndex);
|
|
6695
6798
|
if (slideCanvases.length === 0) {
|
|
6696
|
-
throw new Error(
|
|
6799
|
+
throw new Error(chunk3ISYPBSX_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
6697
6800
|
}
|
|
6698
6801
|
const firstCanvas = slideCanvases[0];
|
|
6699
6802
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -6701,12 +6804,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6701
6804
|
recordingCanvas.height = firstCanvas.height;
|
|
6702
6805
|
const ctx = recordingCanvas.getContext("2d");
|
|
6703
6806
|
if (!ctx) {
|
|
6704
|
-
throw new Error(
|
|
6807
|
+
throw new Error(chunk3ISYPBSX_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
6705
6808
|
}
|
|
6706
6809
|
const fps = 30;
|
|
6707
6810
|
const stream = recordingCanvas.captureStream(fps);
|
|
6708
6811
|
const recorder = new MediaRecorder(stream, {
|
|
6709
|
-
mimeType:
|
|
6812
|
+
mimeType: chunkKA35ZMIP_js.pickSupportedMimeType([...chunkKA35ZMIP_js.WEBM_MIME_CANDIDATES]),
|
|
6710
6813
|
videoBitsPerSecond: 5e6
|
|
6711
6814
|
});
|
|
6712
6815
|
const chunks = [];
|
|
@@ -6729,8 +6832,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6729
6832
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6730
6833
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6731
6834
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6732
|
-
const frameInterval =
|
|
6733
|
-
const framesNeeded =
|
|
6835
|
+
const frameInterval = chunkKA35ZMIP_js.fpsToFrameIntervalMs(fps);
|
|
6836
|
+
const framesNeeded = chunkKA35ZMIP_js.segmentFrameCount(duration, fps);
|
|
6734
6837
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6735
6838
|
if (signal?.aborted) {
|
|
6736
6839
|
recorder.stop();
|
|
@@ -6777,9 +6880,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6777
6880
|
}
|
|
6778
6881
|
setActiveSlide(currentSlideIndex);
|
|
6779
6882
|
if (frames.length === 0) {
|
|
6780
|
-
throw new Error(
|
|
6883
|
+
throw new Error(chunk3ISYPBSX_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6781
6884
|
}
|
|
6782
|
-
const gifBytes =
|
|
6885
|
+
const gifBytes = chunkKA35ZMIP_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6783
6886
|
onProgress?.(totalSlides, totalSlides);
|
|
6784
6887
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6785
6888
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6833,7 +6936,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6833
6936
|
continue;
|
|
6834
6937
|
}
|
|
6835
6938
|
onProgress?.(processedCount, data.slides.length);
|
|
6836
|
-
let svg =
|
|
6939
|
+
let svg = chunkKA35ZMIP_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6837
6940
|
if (embedFonts && fontFaces?.length) {
|
|
6838
6941
|
svg = injectFontFaces(svg, fontFaces);
|
|
6839
6942
|
}
|
|
@@ -6864,6 +6967,8 @@ function useExportSaveAs(input) {
|
|
|
6864
6967
|
handoutMaster,
|
|
6865
6968
|
guides,
|
|
6866
6969
|
activeSlideIndexForGuides,
|
|
6970
|
+
theme,
|
|
6971
|
+
canvasSize,
|
|
6867
6972
|
modalControls,
|
|
6868
6973
|
password
|
|
6869
6974
|
} = input;
|
|
@@ -6893,7 +6998,7 @@ function useExportSaveAs(input) {
|
|
|
6893
6998
|
}
|
|
6894
6999
|
setExportProgress(70);
|
|
6895
7000
|
setExportStatusMessage("Writing README...");
|
|
6896
|
-
const readme =
|
|
7001
|
+
const readme = chunkKA35ZMIP_js.generatePackageReadme(pptxFilename);
|
|
6897
7002
|
pkgFolder.file("README.txt", readme);
|
|
6898
7003
|
if (abortCtrl.signal.aborted) {
|
|
6899
7004
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -6904,7 +7009,7 @@ function useExportSaveAs(input) {
|
|
|
6904
7009
|
setExportProgress(95);
|
|
6905
7010
|
setExportStatusMessage("Downloading...");
|
|
6906
7011
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
6907
|
-
|
|
7012
|
+
chunkKA35ZMIP_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
6908
7013
|
setExportProgress(100);
|
|
6909
7014
|
} catch (err) {
|
|
6910
7015
|
if (err.name !== "AbortError") {
|
|
@@ -6927,7 +7032,7 @@ function useExportSaveAs(input) {
|
|
|
6927
7032
|
const blob = new Blob([data], {
|
|
6928
7033
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6929
7034
|
});
|
|
6930
|
-
|
|
7035
|
+
chunkKA35ZMIP_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
6931
7036
|
} catch (err) {
|
|
6932
7037
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
6933
7038
|
}
|
|
@@ -6940,14 +7045,14 @@ function useExportSaveAs(input) {
|
|
|
6940
7045
|
const pptxGuides = guides.map((g) => ({
|
|
6941
7046
|
id: g.id,
|
|
6942
7047
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
6943
|
-
positionEmu:
|
|
7048
|
+
positionEmu: chunkKA35ZMIP_js.guidePxToEmu(g.position)
|
|
6944
7049
|
}));
|
|
6945
7050
|
return {
|
|
6946
7051
|
...slide,
|
|
6947
7052
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
6948
7053
|
};
|
|
6949
7054
|
});
|
|
6950
|
-
const slidesToSave =
|
|
7055
|
+
const slidesToSave = chunkHZSUTVDQ_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
6951
7056
|
const saveOptions = {
|
|
6952
7057
|
headerFooter,
|
|
6953
7058
|
presentationProperties,
|
|
@@ -6970,6 +7075,32 @@ function useExportSaveAs(input) {
|
|
|
6970
7075
|
}
|
|
6971
7076
|
return handler.save(slidesToSave, saveOptions);
|
|
6972
7077
|
};
|
|
7078
|
+
const handleExportJson = () => {
|
|
7079
|
+
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7080
|
+
const data = {
|
|
7081
|
+
slides: chunkHZSUTVDQ_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7082
|
+
width: canvasSize.width,
|
|
7083
|
+
height: canvasSize.height,
|
|
7084
|
+
widthEmu: chunkKA35ZMIP_js.guidePxToEmu(canvasSize.width),
|
|
7085
|
+
heightEmu: chunkKA35ZMIP_js.guidePxToEmu(canvasSize.height),
|
|
7086
|
+
theme,
|
|
7087
|
+
headerFooter,
|
|
7088
|
+
presentationProperties,
|
|
7089
|
+
customShows: customShows.length > 0 ? customShows : void 0,
|
|
7090
|
+
sections: sections.length > 0 ? sections : void 0,
|
|
7091
|
+
coreProperties: coreProperties ?? void 0,
|
|
7092
|
+
appProperties: appProperties ?? void 0,
|
|
7093
|
+
customProperties: customProperties.length > 0 ? customProperties : void 0,
|
|
7094
|
+
tags: tagCollections.length > 0 ? tagCollections : void 0,
|
|
7095
|
+
notesMaster,
|
|
7096
|
+
handoutMaster
|
|
7097
|
+
};
|
|
7098
|
+
try {
|
|
7099
|
+
chunkKA35ZMIP_js.exportDeckJson(data, sourceName);
|
|
7100
|
+
} catch (err) {
|
|
7101
|
+
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7102
|
+
}
|
|
7103
|
+
};
|
|
6973
7104
|
const handleSaveAsPptx = () => {
|
|
6974
7105
|
void handleSaveAsFormat("pptx");
|
|
6975
7106
|
};
|
|
@@ -6980,6 +7111,7 @@ function useExportSaveAs(input) {
|
|
|
6980
7111
|
void handleSaveAsFormat("pptm");
|
|
6981
7112
|
};
|
|
6982
7113
|
return {
|
|
7114
|
+
handleExportJson,
|
|
6983
7115
|
handlePackageForSharing,
|
|
6984
7116
|
handleSaveAsFormat,
|
|
6985
7117
|
handleSaveAsPptx,
|
|
@@ -7004,7 +7136,7 @@ function safeConfirm(message) {
|
|
|
7004
7136
|
}
|
|
7005
7137
|
}
|
|
7006
7138
|
function downloadBlob2(blob, filename) {
|
|
7007
|
-
|
|
7139
|
+
chunkKA35ZMIP_js.downloadBlob(blob, chunkKA35ZMIP_js.sanitizeDownloadFilename(filename));
|
|
7008
7140
|
}
|
|
7009
7141
|
|
|
7010
7142
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7031,6 +7163,8 @@ function useExportHandlers(input) {
|
|
|
7031
7163
|
handoutMaster,
|
|
7032
7164
|
guides,
|
|
7033
7165
|
activeSlideIndexForGuides,
|
|
7166
|
+
theme,
|
|
7167
|
+
canvasSize,
|
|
7034
7168
|
password
|
|
7035
7169
|
} = input;
|
|
7036
7170
|
const [exportModalOpen, setExportModalOpen] = react.useState(false);
|
|
@@ -7046,6 +7180,7 @@ function useExportHandlers(input) {
|
|
|
7046
7180
|
exportAbortRef
|
|
7047
7181
|
};
|
|
7048
7182
|
const {
|
|
7183
|
+
handleExportJson,
|
|
7049
7184
|
handlePackageForSharing,
|
|
7050
7185
|
handleSaveAsFormat,
|
|
7051
7186
|
handleSaveAsPptx,
|
|
@@ -7069,6 +7204,8 @@ function useExportHandlers(input) {
|
|
|
7069
7204
|
handoutMaster,
|
|
7070
7205
|
guides,
|
|
7071
7206
|
activeSlideIndexForGuides,
|
|
7207
|
+
theme,
|
|
7208
|
+
canvasSize,
|
|
7072
7209
|
modalControls,
|
|
7073
7210
|
password
|
|
7074
7211
|
});
|
|
@@ -7105,21 +7242,21 @@ function useExportHandlers(input) {
|
|
|
7105
7242
|
{
|
|
7106
7243
|
scale: 2,
|
|
7107
7244
|
onProgress: (current, total) => {
|
|
7108
|
-
setExportProgress(
|
|
7109
|
-
setExportStatusMessage(
|
|
7245
|
+
setExportProgress(chunkKA35ZMIP_js.slideProgressPercent(current, total));
|
|
7246
|
+
setExportStatusMessage(chunkKA35ZMIP_js.slideStatusLabel("Rendering", current, total));
|
|
7110
7247
|
},
|
|
7111
7248
|
signal: abortCtrl.signal
|
|
7112
7249
|
}
|
|
7113
7250
|
);
|
|
7114
|
-
setExportProgress(
|
|
7251
|
+
setExportProgress(chunkKA35ZMIP_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7115
7252
|
setExportStatusMessage("Building PDF...");
|
|
7116
7253
|
await new Promise((r) => {
|
|
7117
7254
|
setTimeout(r, 100);
|
|
7118
7255
|
});
|
|
7119
|
-
setExportProgress(
|
|
7256
|
+
setExportProgress(chunkKA35ZMIP_js.EXPORT_DONE_PERCENT);
|
|
7120
7257
|
setExportStatusMessage("Done!");
|
|
7121
7258
|
} catch (err) {
|
|
7122
|
-
if (!
|
|
7259
|
+
if (!chunkKA35ZMIP_js.isExportAbortError(err)) {
|
|
7123
7260
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7124
7261
|
}
|
|
7125
7262
|
} finally {
|
|
@@ -7149,21 +7286,21 @@ function useExportHandlers(input) {
|
|
|
7149
7286
|
{
|
|
7150
7287
|
scale: 2,
|
|
7151
7288
|
onProgress: (current, total) => {
|
|
7152
|
-
setExportProgress(
|
|
7153
|
-
setExportStatusMessage(
|
|
7289
|
+
setExportProgress(chunkKA35ZMIP_js.slideProgressPercent(current, total));
|
|
7290
|
+
setExportStatusMessage(chunkKA35ZMIP_js.slideStatusLabel("Rendering", current, total));
|
|
7154
7291
|
},
|
|
7155
7292
|
signal: abortCtrl.signal
|
|
7156
7293
|
}
|
|
7157
7294
|
);
|
|
7158
|
-
setExportProgress(
|
|
7295
|
+
setExportProgress(chunkKA35ZMIP_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7159
7296
|
setExportStatusMessage("Building PDF...");
|
|
7160
7297
|
await new Promise((r) => {
|
|
7161
7298
|
setTimeout(r, 100);
|
|
7162
7299
|
});
|
|
7163
|
-
setExportProgress(
|
|
7300
|
+
setExportProgress(chunkKA35ZMIP_js.EXPORT_DONE_PERCENT);
|
|
7164
7301
|
setExportStatusMessage("Done!");
|
|
7165
7302
|
} catch (err) {
|
|
7166
|
-
if (!
|
|
7303
|
+
if (!chunkKA35ZMIP_js.isExportAbortError(err)) {
|
|
7167
7304
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7168
7305
|
}
|
|
7169
7306
|
} finally {
|
|
@@ -7204,22 +7341,22 @@ function useExportHandlers(input) {
|
|
|
7204
7341
|
scale: 1,
|
|
7205
7342
|
slideDurationMs: 3e3,
|
|
7206
7343
|
onProgress: (current, total) => {
|
|
7207
|
-
setExportProgress(
|
|
7208
|
-
setExportStatusMessage(
|
|
7344
|
+
setExportProgress(chunkKA35ZMIP_js.slideProgressPercent(current, total, 45));
|
|
7345
|
+
setExportStatusMessage(chunkKA35ZMIP_js.slideStatusLabel("Capturing", current, total));
|
|
7209
7346
|
},
|
|
7210
7347
|
onRecordProgress: (current, total) => {
|
|
7211
|
-
setExportProgress(
|
|
7212
|
-
setExportStatusMessage(
|
|
7348
|
+
setExportProgress(chunkKA35ZMIP_js.recordProgressPercent(current, total));
|
|
7349
|
+
setExportStatusMessage(chunkKA35ZMIP_js.slideStatusLabel("Recording", current, total));
|
|
7213
7350
|
},
|
|
7214
7351
|
signal: abortCtrl.signal
|
|
7215
7352
|
}
|
|
7216
7353
|
);
|
|
7217
|
-
setExportProgress(
|
|
7354
|
+
setExportProgress(chunkKA35ZMIP_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7218
7355
|
setExportStatusMessage("Saving file...");
|
|
7219
7356
|
downloadBlob2(blob, "presentation.webm");
|
|
7220
|
-
setExportProgress(
|
|
7357
|
+
setExportProgress(chunkKA35ZMIP_js.EXPORT_DONE_PERCENT);
|
|
7221
7358
|
} catch (err) {
|
|
7222
|
-
if (!
|
|
7359
|
+
if (!chunkKA35ZMIP_js.isExportAbortError(err)) {
|
|
7223
7360
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7224
7361
|
}
|
|
7225
7362
|
} finally {
|
|
@@ -7247,18 +7384,18 @@ function useExportHandlers(input) {
|
|
|
7247
7384
|
scale: 0.5,
|
|
7248
7385
|
slideDurationMs: 2e3,
|
|
7249
7386
|
onProgress: (current, total) => {
|
|
7250
|
-
setExportProgress(
|
|
7251
|
-
setExportStatusMessage(
|
|
7387
|
+
setExportProgress(chunkKA35ZMIP_js.slideProgressPercent(current, total));
|
|
7388
|
+
setExportStatusMessage(chunkKA35ZMIP_js.slideStatusLabel("Encoding", current, total));
|
|
7252
7389
|
},
|
|
7253
7390
|
signal: abortCtrl.signal
|
|
7254
7391
|
}
|
|
7255
7392
|
);
|
|
7256
|
-
setExportProgress(
|
|
7393
|
+
setExportProgress(chunkKA35ZMIP_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7257
7394
|
setExportStatusMessage("Saving file...");
|
|
7258
7395
|
downloadBlob2(blob, "presentation.gif");
|
|
7259
|
-
setExportProgress(
|
|
7396
|
+
setExportProgress(chunkKA35ZMIP_js.EXPORT_DONE_PERCENT);
|
|
7260
7397
|
} catch (err) {
|
|
7261
|
-
if (!
|
|
7398
|
+
if (!chunkKA35ZMIP_js.isExportAbortError(err)) {
|
|
7262
7399
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7263
7400
|
}
|
|
7264
7401
|
} finally {
|
|
@@ -7279,6 +7416,7 @@ function useExportHandlers(input) {
|
|
|
7279
7416
|
handleCopySlideAsImage,
|
|
7280
7417
|
handleExportVideo,
|
|
7281
7418
|
handleExportGif,
|
|
7419
|
+
handleExportJson,
|
|
7282
7420
|
handlePackageForSharing,
|
|
7283
7421
|
handleSaveAsFormat,
|
|
7284
7422
|
handleSaveAsPptx,
|
|
@@ -7298,7 +7436,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7298
7436
|
}
|
|
7299
7437
|
printWindow.document.open();
|
|
7300
7438
|
printWindow.document.write(
|
|
7301
|
-
|
|
7439
|
+
chunkKA35ZMIP_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7302
7440
|
);
|
|
7303
7441
|
printWindow.document.close();
|
|
7304
7442
|
printWindow.focus();
|
|
@@ -7359,7 +7497,7 @@ function usePrintHandlers(input) {
|
|
|
7359
7497
|
if (svgs.length === 0) {
|
|
7360
7498
|
return;
|
|
7361
7499
|
}
|
|
7362
|
-
const printDoc =
|
|
7500
|
+
const printDoc = chunkKA35ZMIP_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7363
7501
|
title: "Slides (Vector)",
|
|
7364
7502
|
orientation: settings.orientation,
|
|
7365
7503
|
colorFilter
|
|
@@ -7395,7 +7533,7 @@ function usePrintHandlers(input) {
|
|
|
7395
7533
|
if (settings.printWhat === "outline") {
|
|
7396
7534
|
openPrintWindow(
|
|
7397
7535
|
"Outline",
|
|
7398
|
-
`<div class="outline-page">${
|
|
7536
|
+
`<div class="outline-page">${chunkKA35ZMIP_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7399
7537
|
settings.orientation,
|
|
7400
7538
|
colorFilter,
|
|
7401
7539
|
settings.frameSlides
|
|
@@ -7420,7 +7558,7 @@ function usePrintHandlers(input) {
|
|
|
7420
7558
|
if (settings.printWhat === "slides") {
|
|
7421
7559
|
openPrintWindow(
|
|
7422
7560
|
"Slides",
|
|
7423
|
-
|
|
7561
|
+
chunkKA35ZMIP_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7424
7562
|
settings.orientation,
|
|
7425
7563
|
colorFilter,
|
|
7426
7564
|
settings.frameSlides
|
|
@@ -7430,7 +7568,7 @@ function usePrintHandlers(input) {
|
|
|
7430
7568
|
if (settings.printWhat === "notes") {
|
|
7431
7569
|
openPrintWindow(
|
|
7432
7570
|
"Notes Pages",
|
|
7433
|
-
|
|
7571
|
+
chunkKA35ZMIP_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7434
7572
|
"portrait",
|
|
7435
7573
|
colorFilter,
|
|
7436
7574
|
settings.frameSlides
|
|
@@ -7441,7 +7579,7 @@ function usePrintHandlers(input) {
|
|
|
7441
7579
|
const spp = settings.slidesPerPage;
|
|
7442
7580
|
openPrintWindow(
|
|
7443
7581
|
`Handout ${spp} per page`,
|
|
7444
|
-
|
|
7582
|
+
chunkKA35ZMIP_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7445
7583
|
"portrait",
|
|
7446
7584
|
colorFilter,
|
|
7447
7585
|
settings.frameSlides
|
|
@@ -7505,8 +7643,8 @@ function useThemeHandlers(input) {
|
|
|
7505
7643
|
return;
|
|
7506
7644
|
}
|
|
7507
7645
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7508
|
-
const previousMap = theme?.colorScheme ?
|
|
7509
|
-
setSlides((prev) =>
|
|
7646
|
+
const previousMap = theme?.colorScheme ? chunkKA35ZMIP_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7647
|
+
setSlides((prev) => chunkKA35ZMIP_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7510
7648
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7511
7649
|
bumpHistory();
|
|
7512
7650
|
history.markDirty();
|
|
@@ -7611,7 +7749,7 @@ function useThemeSwitching(input) {
|
|
|
7611
7749
|
}
|
|
7612
7750
|
try {
|
|
7613
7751
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7614
|
-
const newData =
|
|
7752
|
+
const newData = chunkKA35ZMIP_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7615
7753
|
onDataChange(newData);
|
|
7616
7754
|
onThemeChanged?.(preset);
|
|
7617
7755
|
} catch (error) {
|
|
@@ -7628,7 +7766,7 @@ function useThemeSwitching(input) {
|
|
|
7628
7766
|
}
|
|
7629
7767
|
try {
|
|
7630
7768
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7631
|
-
const newData =
|
|
7769
|
+
const newData = chunkKA35ZMIP_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7632
7770
|
onDataChange(newData);
|
|
7633
7771
|
} catch (error) {
|
|
7634
7772
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7640,12 +7778,12 @@ function useThemeSwitching(input) {
|
|
|
7640
7778
|
if (!data?.theme?.colorScheme) {
|
|
7641
7779
|
return void 0;
|
|
7642
7780
|
}
|
|
7643
|
-
return
|
|
7644
|
-
(p) =>
|
|
7781
|
+
return chunkKA35ZMIP_js.THEME_PRESETS.find(
|
|
7782
|
+
(p) => chunkKA35ZMIP_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7645
7783
|
);
|
|
7646
7784
|
}, [data?.theme?.colorScheme]);
|
|
7647
7785
|
return {
|
|
7648
|
-
presets:
|
|
7786
|
+
presets: chunkKA35ZMIP_js.THEME_PRESETS,
|
|
7649
7787
|
switchToPreset,
|
|
7650
7788
|
switchToCustom,
|
|
7651
7789
|
currentPreset
|
|
@@ -7720,7 +7858,7 @@ function usePropertyHandlers(input) {
|
|
|
7720
7858
|
}
|
|
7721
7859
|
try {
|
|
7722
7860
|
const ab = await file.arrayBuffer();
|
|
7723
|
-
const h = new
|
|
7861
|
+
const h = new chunkKA35ZMIP_js.PptxHandler();
|
|
7724
7862
|
const other = await h.load(ab);
|
|
7725
7863
|
if (!other) {
|
|
7726
7864
|
return;
|
|
@@ -7730,7 +7868,7 @@ function usePropertyHandlers(input) {
|
|
|
7730
7868
|
width: canvasSize.width,
|
|
7731
7869
|
height: canvasSize.height
|
|
7732
7870
|
};
|
|
7733
|
-
setCompareResult(
|
|
7871
|
+
setCompareResult(chunkKA35ZMIP_js.comparePresentation(cur, other));
|
|
7734
7872
|
setIsComparePanelOpen(true);
|
|
7735
7873
|
} catch (err) {
|
|
7736
7874
|
console.warn("Compare failed:", err);
|
|
@@ -7747,7 +7885,7 @@ function usePropertyHandlers(input) {
|
|
|
7747
7885
|
if (!diff || diff.status === "unchanged") {
|
|
7748
7886
|
return;
|
|
7749
7887
|
}
|
|
7750
|
-
setSlides((prev) =>
|
|
7888
|
+
setSlides((prev) => chunkKA35ZMIP_js.applyAcceptSlide(prev, diff));
|
|
7751
7889
|
setIsDirty(true);
|
|
7752
7890
|
},
|
|
7753
7891
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7758,10 +7896,10 @@ function usePropertyHandlers(input) {
|
|
|
7758
7896
|
if (!compareResult) {
|
|
7759
7897
|
return;
|
|
7760
7898
|
}
|
|
7761
|
-
setSlides((prev) =>
|
|
7899
|
+
setSlides((prev) => chunkKA35ZMIP_js.applyAcceptAllSlides(prev, compareResult));
|
|
7762
7900
|
setIsDirty(true);
|
|
7763
7901
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7764
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7902
|
+
const usedFontFamilies = react.useMemo(() => chunkKA35ZMIP_js.collectUsedFonts(slides), [slides]);
|
|
7765
7903
|
return {
|
|
7766
7904
|
handleUpdateNotes,
|
|
7767
7905
|
handleUpdateSlide,
|
|
@@ -7880,7 +8018,7 @@ function useIsMobile(input) {
|
|
|
7880
8018
|
const containerRef = input?.containerRef;
|
|
7881
8019
|
const isTouchDevice = react.useSyncExternalStore(
|
|
7882
8020
|
subscribeTouchCapability,
|
|
7883
|
-
|
|
8021
|
+
chunkKA35ZMIP_js.detectTouchDevice,
|
|
7884
8022
|
() => false
|
|
7885
8023
|
// server snapshot
|
|
7886
8024
|
);
|
|
@@ -7896,7 +8034,7 @@ function useIsMobile(input) {
|
|
|
7896
8034
|
}
|
|
7897
8035
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
7898
8036
|
});
|
|
7899
|
-
const [orientation, setOrientation] = react.useState(
|
|
8037
|
+
const [orientation, setOrientation] = react.useState(chunkKA35ZMIP_js.detectOrientation);
|
|
7900
8038
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
7901
8039
|
const [initialViewportHeight] = react.useState(
|
|
7902
8040
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -7940,7 +8078,7 @@ function useIsMobile(input) {
|
|
|
7940
8078
|
return;
|
|
7941
8079
|
}
|
|
7942
8080
|
const handleOrientationChange = () => {
|
|
7943
|
-
setOrientation(
|
|
8081
|
+
setOrientation(chunkKA35ZMIP_js.detectOrientation());
|
|
7944
8082
|
};
|
|
7945
8083
|
if (screen.orientation) {
|
|
7946
8084
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -7970,9 +8108,9 @@ function useIsMobile(input) {
|
|
|
7970
8108
|
window.addEventListener("resize", handleResize);
|
|
7971
8109
|
return () => window.removeEventListener("resize", handleResize);
|
|
7972
8110
|
}, [isTouchDevice, initialViewportHeight]);
|
|
7973
|
-
const isMobile =
|
|
7974
|
-
const isTablet = !isMobile && containerWidth >=
|
|
7975
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
8111
|
+
const isMobile = chunkKA35ZMIP_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
8112
|
+
const isTablet = !isMobile && containerWidth >= chunkKA35ZMIP_js.MOBILE_BREAKPOINT && containerWidth < chunkKA35ZMIP_js.TABLET_BREAKPOINT;
|
|
8113
|
+
const isDesktop = !isMobile && containerWidth >= chunkKA35ZMIP_js.TABLET_BREAKPOINT;
|
|
7976
8114
|
return {
|
|
7977
8115
|
isMobile,
|
|
7978
8116
|
isTablet,
|
|
@@ -8033,11 +8171,11 @@ function useViewerDialogs(input) {
|
|
|
8033
8171
|
);
|
|
8034
8172
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(false);
|
|
8035
8173
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8036
|
-
() => typeof window !== "undefined" ?
|
|
8174
|
+
() => typeof window !== "undefined" ? chunkKA35ZMIP_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8037
8175
|
);
|
|
8038
8176
|
react.useEffect(() => {
|
|
8039
8177
|
const handleWindow = () => setIsNarrowViewport(
|
|
8040
|
-
|
|
8178
|
+
chunkKA35ZMIP_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8041
8179
|
);
|
|
8042
8180
|
let observer = null;
|
|
8043
8181
|
let raf = 0;
|
|
@@ -8051,12 +8189,12 @@ function useViewerDialogs(input) {
|
|
|
8051
8189
|
const entry = entries[0];
|
|
8052
8190
|
if (entry) {
|
|
8053
8191
|
setIsNarrowViewport(
|
|
8054
|
-
|
|
8192
|
+
chunkKA35ZMIP_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8055
8193
|
);
|
|
8056
8194
|
}
|
|
8057
8195
|
});
|
|
8058
8196
|
observer.observe(el);
|
|
8059
|
-
setIsNarrowViewport(
|
|
8197
|
+
setIsNarrowViewport(chunkKA35ZMIP_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8060
8198
|
};
|
|
8061
8199
|
attach();
|
|
8062
8200
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8214,20 +8352,20 @@ function useViewerDialogs(input) {
|
|
|
8214
8352
|
}
|
|
8215
8353
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8216
8354
|
if (presentationGridSpacing) {
|
|
8217
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8355
|
+
const px = Math.round(presentationGridSpacing.cx / chunkHZSUTVDQ_js.EMU_PER_PX);
|
|
8218
8356
|
if (px > 0) {
|
|
8219
8357
|
return px;
|
|
8220
8358
|
}
|
|
8221
8359
|
}
|
|
8222
|
-
return
|
|
8360
|
+
return chunkHZSUTVDQ_js.GRID_SIZE;
|
|
8223
8361
|
}
|
|
8224
8362
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8225
8363
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8226
|
-
return
|
|
8364
|
+
return chunkKA35ZMIP_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8227
8365
|
}
|
|
8228
8366
|
function computeSlideSectionGroups(slides, sections) {
|
|
8229
|
-
return
|
|
8230
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8367
|
+
return chunkKA35ZMIP_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8368
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkHZSUTVDQ_js.UNGROUPED_SECTION_ID : "default"),
|
|
8231
8369
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8232
8370
|
slideIndexes: group.slideIndexes,
|
|
8233
8371
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8282,7 +8420,7 @@ function useDerivedSlideState(input) {
|
|
|
8282
8420
|
);
|
|
8283
8421
|
const slideSectionGroups = react.useMemo(
|
|
8284
8422
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8285
|
-
if (group.id ===
|
|
8423
|
+
if (group.id === chunkHZSUTVDQ_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8286
8424
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8287
8425
|
}
|
|
8288
8426
|
if (group.id === "default" && group.label === "Slides") {
|
|
@@ -8385,13 +8523,13 @@ function useAnnotationHandlers(input) {
|
|
|
8385
8523
|
}, [annotations, setMode, setSlides, history]);
|
|
8386
8524
|
const handleSetMode = react.useCallback(
|
|
8387
8525
|
(nextMode) => {
|
|
8388
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8526
|
+
if (mode === "present" && nextMode !== "present" && !chunkKA35ZMIP_js.mayLeaveSlideShow()) {
|
|
8389
8527
|
return;
|
|
8390
8528
|
}
|
|
8391
8529
|
if (nextMode === "present") {
|
|
8392
8530
|
presentation.enterPresentMode();
|
|
8393
8531
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8394
|
-
|
|
8532
|
+
chunkKA35ZMIP_js.stopAllPersistentAudio();
|
|
8395
8533
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8396
8534
|
if (promptKeepInkAnnotations) {
|
|
8397
8535
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8400,7 +8538,7 @@ function useAnnotationHandlers(input) {
|
|
|
8400
8538
|
}
|
|
8401
8539
|
} else {
|
|
8402
8540
|
if (mode === "present") {
|
|
8403
|
-
|
|
8541
|
+
chunkKA35ZMIP_js.stopAllPersistentAudio();
|
|
8404
8542
|
}
|
|
8405
8543
|
setMode(nextMode);
|
|
8406
8544
|
}
|
|
@@ -8466,13 +8604,13 @@ function useSerialize(input) {
|
|
|
8466
8604
|
let processedSlide = slide;
|
|
8467
8605
|
if (pendingEditId) {
|
|
8468
8606
|
const updatedElements = slide.elements.map((el) => {
|
|
8469
|
-
if (el.id !== pendingEditId || !
|
|
8607
|
+
if (el.id !== pendingEditId || !chunkKA35ZMIP_js.hasTextProperties(el)) {
|
|
8470
8608
|
return el;
|
|
8471
8609
|
}
|
|
8472
8610
|
return {
|
|
8473
8611
|
...el,
|
|
8474
8612
|
text: pendingEditText,
|
|
8475
|
-
textSegments:
|
|
8613
|
+
textSegments: chunkKA35ZMIP_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8476
8614
|
};
|
|
8477
8615
|
});
|
|
8478
8616
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8485,14 +8623,14 @@ function useSerialize(input) {
|
|
|
8485
8623
|
const pptxGuides = guides.map((g) => ({
|
|
8486
8624
|
id: g.id,
|
|
8487
8625
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8488
|
-
positionEmu:
|
|
8626
|
+
positionEmu: chunkKA35ZMIP_js.guidePxToEmu(g.position)
|
|
8489
8627
|
}));
|
|
8490
8628
|
return {
|
|
8491
8629
|
...processedSlide,
|
|
8492
8630
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8493
8631
|
};
|
|
8494
8632
|
});
|
|
8495
|
-
const slidesToSave =
|
|
8633
|
+
const slidesToSave = chunkHZSUTVDQ_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8496
8634
|
const saveOptions = {
|
|
8497
8635
|
headerFooter,
|
|
8498
8636
|
presentationProperties,
|
|
@@ -8661,7 +8799,7 @@ function usePresentationSetup(input) {
|
|
|
8661
8799
|
containerRef,
|
|
8662
8800
|
content,
|
|
8663
8801
|
onSetMode: (nextMode) => {
|
|
8664
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8802
|
+
if (mode === "present" && nextMode !== "present" && !chunkKA35ZMIP_js.mayLeaveSlideShow()) {
|
|
8665
8803
|
return;
|
|
8666
8804
|
}
|
|
8667
8805
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8669,7 +8807,7 @@ function usePresentationSetup(input) {
|
|
|
8669
8807
|
setShowKeepAnnotationsDialog(true);
|
|
8670
8808
|
} else {
|
|
8671
8809
|
if (mode === "present" && nextMode !== "present") {
|
|
8672
|
-
|
|
8810
|
+
chunkKA35ZMIP_js.stopAllPersistentAudio();
|
|
8673
8811
|
stopAnimationSound();
|
|
8674
8812
|
}
|
|
8675
8813
|
setMode(nextMode);
|
|
@@ -8723,10 +8861,10 @@ function usePresentationSetup(input) {
|
|
|
8723
8861
|
onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
|
|
8724
8862
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8725
8863
|
onSaveRehearsalTimings: (timings) => {
|
|
8726
|
-
setSlides((prev) =>
|
|
8864
|
+
setSlides((prev) => chunkKA35ZMIP_js.applyRehearsalTimings(prev, timings));
|
|
8727
8865
|
history.markDirty();
|
|
8728
8866
|
},
|
|
8729
|
-
loopContinuously:
|
|
8867
|
+
loopContinuously: chunkKA35ZMIP_js.shouldLoopContinuously(presentationProperties),
|
|
8730
8868
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8731
8869
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8732
8870
|
endWithBlackSlide
|
|
@@ -8856,7 +8994,9 @@ function useEditorOperations(input) {
|
|
|
8856
8994
|
setActiveSlideIndex: state.setActiveSlideIndex,
|
|
8857
8995
|
ops,
|
|
8858
8996
|
history,
|
|
8859
|
-
handlerRef
|
|
8997
|
+
handlerRef,
|
|
8998
|
+
canvasSize,
|
|
8999
|
+
theme: state.theme
|
|
8860
9000
|
});
|
|
8861
9001
|
const tableOps = useTableOperations({
|
|
8862
9002
|
selectedElement,
|
|
@@ -8888,7 +9028,7 @@ function useEditorOperations(input) {
|
|
|
8888
9028
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
8889
9029
|
react.useEffect(() => {
|
|
8890
9030
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
8891
|
-
copiedFormatRef.current =
|
|
9031
|
+
copiedFormatRef.current = chunkKA35ZMIP_js.copyFormatFromElement(selectedElement);
|
|
8892
9032
|
} else if (!formatPainterActive) {
|
|
8893
9033
|
copiedFormatRef.current = null;
|
|
8894
9034
|
}
|
|
@@ -8914,12 +9054,12 @@ function useEditorOperations(input) {
|
|
|
8914
9054
|
e.stopPropagation();
|
|
8915
9055
|
const element = elementLookup.get(elementId);
|
|
8916
9056
|
if (element) {
|
|
8917
|
-
const updated =
|
|
9057
|
+
const updated = chunkKA35ZMIP_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
8918
9058
|
const updates = {};
|
|
8919
|
-
if (
|
|
9059
|
+
if (chunkKA35ZMIP_js.hasShapeProperties(updated)) {
|
|
8920
9060
|
updates.shapeStyle = updated.shapeStyle;
|
|
8921
9061
|
}
|
|
8922
|
-
if (
|
|
9062
|
+
if (chunkKA35ZMIP_js.hasTextProperties(updated)) {
|
|
8923
9063
|
updates.textStyle = updated.textStyle;
|
|
8924
9064
|
}
|
|
8925
9065
|
ops.updateElementById(elementId, updates);
|
|
@@ -8993,6 +9133,8 @@ function useIOHandlers(input) {
|
|
|
8993
9133
|
handoutMaster: state.handoutMaster,
|
|
8994
9134
|
guides: state.guides,
|
|
8995
9135
|
activeSlideIndexForGuides: state.activeSlideIndex,
|
|
9136
|
+
theme: state.theme,
|
|
9137
|
+
canvasSize,
|
|
8996
9138
|
password
|
|
8997
9139
|
});
|
|
8998
9140
|
const printHandlers = usePrintHandlers({
|
|
@@ -9066,7 +9208,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9066
9208
|
const families = /* @__PURE__ */ new Set();
|
|
9067
9209
|
for (const slide of slides) {
|
|
9068
9210
|
for (const el of slide.elements) {
|
|
9069
|
-
if (
|
|
9211
|
+
if (chunkKA35ZMIP_js.hasTextProperties(el) && el.textSegments) {
|
|
9070
9212
|
for (const seg of el.textSegments) {
|
|
9071
9213
|
if (seg.style.fontFamily) {
|
|
9072
9214
|
families.add(seg.style.fontFamily);
|
|
@@ -9278,13 +9420,13 @@ function useKeyboardShortcuts(input) {
|
|
|
9278
9420
|
inputRef.current = input;
|
|
9279
9421
|
const handleKeyDown = react.useCallback((e) => {
|
|
9280
9422
|
const current = inputRef.current;
|
|
9281
|
-
const { action, dx, dy } =
|
|
9423
|
+
const { action, dx, dy } = chunkKA35ZMIP_js.mapEditorKey(e, {
|
|
9282
9424
|
canEdit: current.canEdit,
|
|
9283
9425
|
isPresenting: current.mode !== "edit",
|
|
9284
9426
|
hasSelection: current.hasSelection,
|
|
9285
9427
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9286
9428
|
isDrawing: current.activeTool !== "select",
|
|
9287
|
-
isTextInputTarget:
|
|
9429
|
+
isTextInputTarget: chunkKA35ZMIP_js.isEditorTextInputTarget(e.target)
|
|
9288
9430
|
});
|
|
9289
9431
|
if (action === null) {
|
|
9290
9432
|
return;
|
|
@@ -9577,7 +9719,7 @@ function useViewerIntegration(input) {
|
|
|
9577
9719
|
return zoom.scale;
|
|
9578
9720
|
},
|
|
9579
9721
|
setZoom(level) {
|
|
9580
|
-
zoom.setScale(
|
|
9722
|
+
zoom.setScale(chunkKA35ZMIP_js.clampZoomScale(level));
|
|
9581
9723
|
},
|
|
9582
9724
|
zoomIn() {
|
|
9583
9725
|
zoom.handleZoomIn();
|
|
@@ -9792,7 +9934,7 @@ function useReducedMotion() {
|
|
|
9792
9934
|
}
|
|
9793
9935
|
function useViewerOptions() {
|
|
9794
9936
|
const storeRef = react.useRef(null);
|
|
9795
|
-
storeRef.current ??=
|
|
9937
|
+
storeRef.current ??= chunkKA35ZMIP_js.createViewerOptionsStore();
|
|
9796
9938
|
const store = storeRef.current;
|
|
9797
9939
|
const options = react.useSyncExternalStore(
|
|
9798
9940
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9801,9 +9943,9 @@ function useViewerOptions() {
|
|
|
9801
9943
|
);
|
|
9802
9944
|
return { optionsStore: store, options };
|
|
9803
9945
|
}
|
|
9804
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9946
|
+
var KNOWN_TAB_IDS = new Set(chunkKA35ZMIP_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9805
9947
|
function computeToolbarVisibility(hiddenActions) {
|
|
9806
|
-
const isHidden = (id) =>
|
|
9948
|
+
const isHidden = (id) => chunkKA35ZMIP_js.isActionHidden(id, hiddenActions);
|
|
9807
9949
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
9808
9950
|
return { isHidden, isTabVisible };
|
|
9809
9951
|
}
|
|
@@ -9888,12 +10030,12 @@ function useYjsDocumentSync({
|
|
|
9888
10030
|
return;
|
|
9889
10031
|
}
|
|
9890
10032
|
try {
|
|
9891
|
-
const handler = new
|
|
10033
|
+
const handler = new chunkKA35ZMIP_js.PptxHandler();
|
|
9892
10034
|
await handler.load(sourceBytes.buffer);
|
|
9893
|
-
const currentSlides =
|
|
10035
|
+
const currentSlides = chunkKA35ZMIP_js.readSlidesFromYDoc(
|
|
9894
10036
|
doc
|
|
9895
10037
|
);
|
|
9896
|
-
const slidesToSave =
|
|
10038
|
+
const slidesToSave = chunkHZSUTVDQ_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
9897
10039
|
const bytes = await handler.save(slidesToSave);
|
|
9898
10040
|
config.onWriteBack(bytes);
|
|
9899
10041
|
} catch {
|
|
@@ -9908,7 +10050,7 @@ function useYjsDocumentSync({
|
|
|
9908
10050
|
if (!doc || !isConnected) {
|
|
9909
10051
|
return;
|
|
9910
10052
|
}
|
|
9911
|
-
const docSlides =
|
|
10053
|
+
const docSlides = chunkKA35ZMIP_js.readSlidesFromYDoc(
|
|
9912
10054
|
doc
|
|
9913
10055
|
);
|
|
9914
10056
|
if (docSlides.length === 0) {
|
|
@@ -9930,11 +10072,11 @@ function useYjsDocumentSync({
|
|
|
9930
10072
|
lastSyncedRef.current = serialized;
|
|
9931
10073
|
void (async () => {
|
|
9932
10074
|
const factories = await getFactories();
|
|
9933
|
-
|
|
10075
|
+
chunkKA35ZMIP_js.reconcileSlidesInYDoc(
|
|
9934
10076
|
slides,
|
|
9935
10077
|
doc,
|
|
9936
10078
|
factories,
|
|
9937
|
-
|
|
10079
|
+
chunkKA35ZMIP_js.LOCAL_SYNC_ORIGIN
|
|
9938
10080
|
);
|
|
9939
10081
|
scheduleWriteBack();
|
|
9940
10082
|
})();
|
|
@@ -9948,10 +10090,10 @@ function useYjsDocumentSync({
|
|
|
9948
10090
|
return;
|
|
9949
10091
|
}
|
|
9950
10092
|
const handleChange = (_events, transaction) => {
|
|
9951
|
-
if (transaction?.origin ===
|
|
10093
|
+
if (transaction?.origin === chunkKA35ZMIP_js.LOCAL_SYNC_ORIGIN) {
|
|
9952
10094
|
return;
|
|
9953
10095
|
}
|
|
9954
|
-
const remoteSlides =
|
|
10096
|
+
const remoteSlides = chunkKA35ZMIP_js.readSlidesFromYDoc(
|
|
9955
10097
|
doc
|
|
9956
10098
|
);
|
|
9957
10099
|
if (remoteSlides.length === 0) {
|
|
@@ -9967,7 +10109,7 @@ function useYjsDocumentSync({
|
|
|
9967
10109
|
isApplyingRemoteRef.current = false;
|
|
9968
10110
|
scheduleWriteBack();
|
|
9969
10111
|
};
|
|
9970
|
-
const unobserve =
|
|
10112
|
+
const unobserve = chunkKA35ZMIP_js.observeYDocSlides(
|
|
9971
10113
|
doc,
|
|
9972
10114
|
handleChange
|
|
9973
10115
|
);
|
|
@@ -10005,7 +10147,7 @@ function useBroadcastFollower({
|
|
|
10005
10147
|
if (!broadcaster) {
|
|
10006
10148
|
return;
|
|
10007
10149
|
}
|
|
10008
|
-
if (!
|
|
10150
|
+
if (!chunkKA35ZMIP_js.shouldAutoFollowBroadcaster({
|
|
10009
10151
|
localRole: collab.config.role,
|
|
10010
10152
|
broadcasterRole: broadcaster.role
|
|
10011
10153
|
})) {
|
|
@@ -10165,10 +10307,10 @@ function useTouchGestures(input) {
|
|
|
10165
10307
|
if (!el || !enabled) {
|
|
10166
10308
|
return;
|
|
10167
10309
|
}
|
|
10168
|
-
const recognizer =
|
|
10310
|
+
const recognizer = chunkKA35ZMIP_js.createTouchGestureRecognizer({
|
|
10169
10311
|
getScale: () => scaleRef.current,
|
|
10170
|
-
minScale:
|
|
10171
|
-
maxScale:
|
|
10312
|
+
minScale: chunkKA35ZMIP_js.MIN_ZOOM_SCALE,
|
|
10313
|
+
maxScale: chunkKA35ZMIP_js.MAX_ZOOM_SCALE,
|
|
10172
10314
|
callbacks: {
|
|
10173
10315
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10174
10316
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10208,7 +10350,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10208
10350
|
return;
|
|
10209
10351
|
}
|
|
10210
10352
|
const rect = active.getBoundingClientRect();
|
|
10211
|
-
const delta =
|
|
10353
|
+
const delta = chunkKA35ZMIP_js.computeScrollDelta(
|
|
10212
10354
|
{ top: rect.top, bottom: rect.bottom },
|
|
10213
10355
|
window.innerHeight,
|
|
10214
10356
|
keyboardInset
|
|
@@ -10228,8 +10370,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10228
10370
|
return;
|
|
10229
10371
|
}
|
|
10230
10372
|
const update = () => {
|
|
10231
|
-
const metrics =
|
|
10232
|
-
const inset = metrics ?
|
|
10373
|
+
const metrics = chunkKA35ZMIP_js.readViewportMetrics(window);
|
|
10374
|
+
const inset = metrics ? chunkKA35ZMIP_js.computeKeyboardInset(metrics) : 0;
|
|
10233
10375
|
setKeyboardInset(inset);
|
|
10234
10376
|
if (inset > 0) {
|
|
10235
10377
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10240,8 +10382,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10240
10382
|
vv.addEventListener("scroll", update);
|
|
10241
10383
|
const onFocusIn = () => {
|
|
10242
10384
|
window.requestAnimationFrame(() => {
|
|
10243
|
-
const metrics =
|
|
10244
|
-
const inset = metrics ?
|
|
10385
|
+
const metrics = chunkKA35ZMIP_js.readViewportMetrics(window);
|
|
10386
|
+
const inset = metrics ? chunkKA35ZMIP_js.computeKeyboardInset(metrics) : 0;
|
|
10245
10387
|
if (inset > 0) {
|
|
10246
10388
|
scrollFocusedIntoView(inset);
|
|
10247
10389
|
}
|
|
@@ -10254,7 +10396,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10254
10396
|
document.removeEventListener("focusin", onFocusIn);
|
|
10255
10397
|
};
|
|
10256
10398
|
}, [enabled]);
|
|
10257
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10399
|
+
return { keyboardInset, isKeyboardOpen: chunkKA35ZMIP_js.isKeyboardOpen(keyboardInset) };
|
|
10258
10400
|
}
|
|
10259
10401
|
|
|
10260
10402
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10281,7 +10423,7 @@ function buildCanvasProps(input) {
|
|
|
10281
10423
|
} = input;
|
|
10282
10424
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10283
10425
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10284
|
-
const fieldContext =
|
|
10426
|
+
const fieldContext = chunkKA35ZMIP_js.buildFieldSubstitutionContext({
|
|
10285
10427
|
headerFooter: s.headerFooter,
|
|
10286
10428
|
customProperties: s.customProperties,
|
|
10287
10429
|
slide: activeSlide
|
|
@@ -10291,13 +10433,13 @@ function buildCanvasProps(input) {
|
|
|
10291
10433
|
if (mode === "present") {
|
|
10292
10434
|
presentation.handlePresentationAction(action);
|
|
10293
10435
|
} else if (action.url) {
|
|
10294
|
-
|
|
10436
|
+
chunkKA35ZMIP_js.safeOpenUrl(action.url);
|
|
10295
10437
|
}
|
|
10296
10438
|
};
|
|
10297
10439
|
const handleHyperlinkClick = (url) => {
|
|
10298
|
-
if (
|
|
10440
|
+
if (chunkKA35ZMIP_js.isPpactionUrl(url)) {
|
|
10299
10441
|
if (mode === "present") {
|
|
10300
|
-
const parsed =
|
|
10442
|
+
const parsed = chunkKA35ZMIP_js.parsePpactionUrl(url);
|
|
10301
10443
|
if (parsed) {
|
|
10302
10444
|
presentation.handlePresentationAction({
|
|
10303
10445
|
action: parsed.action,
|
|
@@ -10307,7 +10449,7 @@ function buildCanvasProps(input) {
|
|
|
10307
10449
|
}
|
|
10308
10450
|
return;
|
|
10309
10451
|
}
|
|
10310
|
-
|
|
10452
|
+
chunkKA35ZMIP_js.safeOpenUrl(url);
|
|
10311
10453
|
};
|
|
10312
10454
|
return {
|
|
10313
10455
|
activeSlide: effectiveSlide,
|
|
@@ -10450,7 +10592,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10450
10592
|
const current = activeSlide.animations ?? [];
|
|
10451
10593
|
if (group === "motionPath") {
|
|
10452
10594
|
propertyHandlers.handleUpdateSlide({
|
|
10453
|
-
animations:
|
|
10595
|
+
animations: chunkKA35ZMIP_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10454
10596
|
});
|
|
10455
10597
|
return;
|
|
10456
10598
|
}
|
|
@@ -10640,11 +10782,12 @@ function buildToolbarProps(input) {
|
|
|
10640
10782
|
onExportPdf: exportHandlers.handleExportPdf,
|
|
10641
10783
|
onExportVideo: exportHandlers.handleExportVideo,
|
|
10642
10784
|
onExportGif: exportHandlers.handleExportGif,
|
|
10785
|
+
onExportJson: exportHandlers.handleExportJson,
|
|
10643
10786
|
onPackageForSharing: exportHandlers.handlePackageForSharing,
|
|
10644
10787
|
onOpenFile,
|
|
10645
10788
|
onOpenRecentFile,
|
|
10646
10789
|
onCreatePresentation: (templateId) => {
|
|
10647
|
-
s.setSlides(
|
|
10790
|
+
s.setSlides(chunkKA35ZMIP_js.createBackstagePresentation(templateId));
|
|
10648
10791
|
s.setActiveSlideIndex(0);
|
|
10649
10792
|
s.setSelectedElementId(null);
|
|
10650
10793
|
s.setSelectedElementIds([]);
|
|
@@ -10670,6 +10813,8 @@ function buildToolbarProps(input) {
|
|
|
10670
10813
|
onSetOverflowMenuOpen: s.setIsOverflowMenuOpen,
|
|
10671
10814
|
layoutOptions: scopedLayoutOptions,
|
|
10672
10815
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10816
|
+
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10817
|
+
templateScheme: chunkKA35ZMIP_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10673
10818
|
customShows: s.customShows,
|
|
10674
10819
|
activeCustomShowId: s.activeCustomShowId,
|
|
10675
10820
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -10701,7 +10846,7 @@ function buildToolbarProps(input) {
|
|
|
10701
10846
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10702
10847
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10703
10848
|
formatPainterActive: s.formatPainterActive,
|
|
10704
|
-
canActivateFormatPainter:
|
|
10849
|
+
canActivateFormatPainter: chunkKA35ZMIP_js.hasCopyableFormat(selectedElement),
|
|
10705
10850
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10706
10851
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10707
10852
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -10970,7 +11115,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
10970
11115
|
}, [incomingContent]);
|
|
10971
11116
|
const onOpenFile = react.useCallback(() => {
|
|
10972
11117
|
void (async () => {
|
|
10973
|
-
const picked = await
|
|
11118
|
+
const picked = await chunkKA35ZMIP_js.openPptxFile();
|
|
10974
11119
|
if (picked) {
|
|
10975
11120
|
setContent(picked.buffer);
|
|
10976
11121
|
}
|
|
@@ -10978,7 +11123,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
10978
11123
|
}, []);
|
|
10979
11124
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
10980
11125
|
void (async () => {
|
|
10981
|
-
const bytes = await
|
|
11126
|
+
const bytes = await chunkKA35ZMIP_js.readBackstageRecentFile(key);
|
|
10982
11127
|
if (bytes) {
|
|
10983
11128
|
setContent(bytes);
|
|
10984
11129
|
}
|