pptx-react-viewer 2.8.0 → 2.10.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-UXPHPUQV.mjs → AiChatPanel-35CHYS5N.mjs} +4 -4
- package/dist/AiChatPanel-35CHYS5N.mjs.br +0 -0
- package/dist/AiChatPanel-35CHYS5N.mjs.gz +0 -0
- package/dist/{AiChatPanel-GTCK35EI.js → AiChatPanel-KTMWRUD5.js} +23 -23
- package/dist/AiChatPanel-KTMWRUD5.js.br +0 -0
- package/dist/AiChatPanel-KTMWRUD5.js.gz +0 -0
- package/dist/{Model3DScene-HDUHTKPF.mjs → Model3DScene-2VMN3B65.mjs} +1 -1
- package/dist/Model3DScene-2VMN3B65.mjs.br +0 -0
- package/dist/Model3DScene-2VMN3B65.mjs.gz +0 -0
- package/dist/{Model3DScene-USPBP3KE.js → Model3DScene-TMNUKCL6.js} +2 -2
- package/dist/Model3DScene-TMNUKCL6.js.br +0 -0
- package/dist/Model3DScene-TMNUKCL6.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-7SLM73XC.mjs → SurfaceChart3DScene-GKRDDN2U.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-7SLM73XC.mjs.br → SurfaceChart3DScene-GKRDDN2U.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-GKRDDN2U.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-NZ3K5CC6.js → SurfaceChart3DScene-KPNP3QD5.js} +2 -2
- package/dist/SurfaceChart3DScene-KPNP3QD5.js.br +0 -0
- package/dist/SurfaceChart3DScene-KPNP3QD5.js.gz +0 -0
- package/dist/{chunk-KGXDCDA5.js → chunk-A7HLINZU.js} +414 -472
- package/dist/chunk-A7HLINZU.js.br +0 -0
- package/dist/chunk-A7HLINZU.js.gz +0 -0
- package/dist/{chunk-AHPZGUL7.mjs → chunk-FY2AFXKP.mjs} +140 -174
- package/dist/chunk-FY2AFXKP.mjs.br +0 -0
- package/dist/chunk-FY2AFXKP.mjs.gz +0 -0
- package/dist/{chunk-MZJMOEEX.js → chunk-H74UXL4Q.js} +2914 -832
- package/dist/chunk-H74UXL4Q.js.br +0 -0
- package/dist/chunk-H74UXL4Q.js.gz +0 -0
- package/dist/{chunk-SMW4QYGK.js → chunk-IJVDNQLG.js} +374 -407
- package/dist/chunk-IJVDNQLG.js.br +0 -0
- package/dist/chunk-IJVDNQLG.js.gz +0 -0
- package/dist/{chunk-SOBKYMMR.js → chunk-JWMXOYSX.js} +5739 -3092
- package/dist/chunk-JWMXOYSX.js.br +0 -0
- package/dist/chunk-JWMXOYSX.js.gz +0 -0
- package/dist/{chunk-TJ5QMUUJ.mjs → chunk-LCG7WBAG.mjs} +4245 -1598
- package/dist/chunk-LCG7WBAG.mjs.br +0 -0
- package/dist/chunk-LCG7WBAG.mjs.gz +0 -0
- package/dist/{chunk-PVCUYPU7.mjs → chunk-LXTKPSIG.mjs} +1 -1
- package/dist/chunk-LXTKPSIG.mjs.br +0 -0
- package/dist/chunk-LXTKPSIG.mjs.gz +0 -0
- package/dist/{chunk-25VSL2BB.js → chunk-MMK4K3QI.js} +260 -17
- package/dist/chunk-MMK4K3QI.js.br +0 -0
- package/dist/chunk-MMK4K3QI.js.gz +0 -0
- package/dist/{chunk-OIH753PJ.mjs → chunk-OHPF2HTP.mjs} +102 -160
- package/dist/chunk-OHPF2HTP.mjs.br +0 -0
- package/dist/chunk-OHPF2HTP.mjs.gz +0 -0
- package/dist/{chunk-Z6HIZWIQ.mjs → chunk-SL3XPERE.mjs} +260 -17
- package/dist/chunk-SL3XPERE.mjs.br +0 -0
- package/dist/chunk-SL3XPERE.mjs.gz +0 -0
- package/dist/{chunk-VFLBLJ4G.js → chunk-SPJR6MPI.js} +3 -3
- package/dist/chunk-SPJR6MPI.js.br +0 -0
- package/dist/chunk-SPJR6MPI.js.gz +0 -0
- package/dist/{chunk-VH2QF5CT.mjs → chunk-TJ55KUWH.mjs} +2829 -824
- package/dist/chunk-TJ55KUWH.mjs.br +0 -0
- package/dist/chunk-TJ55KUWH.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 +36 -0
- package/dist/index.js +36 -36
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +48 -1
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{useViewerBuildingBlocks-DMDZRawe.d.ts → useViewerBuildingBlocks-CpUwhBD5.d.ts} +17 -2
- package/dist/useViewerBuildingBlocks-CpUwhBD5.d.ts.map +1 -0
- package/dist/viewer/index.d.ts +21 -0
- package/dist/viewer/index.js +22 -22
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-GTCK35EI.js.br +0 -0
- package/dist/AiChatPanel-GTCK35EI.js.gz +0 -0
- package/dist/AiChatPanel-UXPHPUQV.mjs.br +0 -0
- package/dist/AiChatPanel-UXPHPUQV.mjs.gz +0 -0
- package/dist/Model3DScene-HDUHTKPF.mjs.br +0 -0
- package/dist/Model3DScene-HDUHTKPF.mjs.gz +0 -0
- package/dist/Model3DScene-USPBP3KE.js.br +0 -0
- package/dist/Model3DScene-USPBP3KE.js.gz +0 -0
- package/dist/SurfaceChart3DScene-7SLM73XC.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-NZ3K5CC6.js.br +0 -0
- package/dist/SurfaceChart3DScene-NZ3K5CC6.js.gz +0 -0
- package/dist/chunk-25VSL2BB.js.br +0 -0
- package/dist/chunk-25VSL2BB.js.gz +0 -0
- package/dist/chunk-AHPZGUL7.mjs.br +0 -0
- package/dist/chunk-AHPZGUL7.mjs.gz +0 -0
- package/dist/chunk-KGXDCDA5.js.br +0 -0
- package/dist/chunk-KGXDCDA5.js.gz +0 -0
- package/dist/chunk-MZJMOEEX.js.br +0 -0
- package/dist/chunk-MZJMOEEX.js.gz +0 -0
- package/dist/chunk-OIH753PJ.mjs.br +0 -0
- package/dist/chunk-OIH753PJ.mjs.gz +0 -0
- package/dist/chunk-PVCUYPU7.mjs.br +0 -0
- package/dist/chunk-PVCUYPU7.mjs.gz +0 -0
- package/dist/chunk-SMW4QYGK.js.br +0 -0
- package/dist/chunk-SMW4QYGK.js.gz +0 -0
- package/dist/chunk-SOBKYMMR.js.br +0 -0
- package/dist/chunk-SOBKYMMR.js.gz +0 -0
- package/dist/chunk-TJ5QMUUJ.mjs.br +0 -0
- package/dist/chunk-TJ5QMUUJ.mjs.gz +0 -0
- package/dist/chunk-VFLBLJ4G.js.br +0 -0
- package/dist/chunk-VFLBLJ4G.js.gz +0 -0
- package/dist/chunk-VH2QF5CT.mjs.br +0 -0
- package/dist/chunk-VH2QF5CT.mjs.gz +0 -0
- package/dist/chunk-Z6HIZWIQ.mjs.br +0 -0
- package/dist/chunk-Z6HIZWIQ.mjs.gz +0 -0
- package/dist/useViewerBuildingBlocks-DMDZRawe.d.ts.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkIJVDNQLG_js = require('./chunk-IJVDNQLG.js');
|
|
4
|
+
var chunkMMK4K3QI_js = require('./chunk-MMK4K3QI.js');
|
|
5
|
+
var chunkH74UXL4Q_js = require('./chunk-H74UXL4Q.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 = chunkH74UXL4Q_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 = chunkH74UXL4Q_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
|
|
48
48
|
const safeItemHeight = Math.max(itemHeight, 1);
|
|
49
49
|
const scrollToIndex = react.useCallback(
|
|
50
50
|
(index, behavior = "smooth") => {
|
|
@@ -107,7 +107,7 @@ function usePresenceTracking({
|
|
|
107
107
|
awareness.setLocalStateField("presence", state);
|
|
108
108
|
lastBroadcastRef.current = Date.now();
|
|
109
109
|
};
|
|
110
|
-
if (elapsed >=
|
|
110
|
+
if (elapsed >= chunkH74UXL4Q_js.BROADCAST_THROTTLE_MS) {
|
|
111
111
|
if (pendingBroadcastRef.current) {
|
|
112
112
|
clearTimeout(pendingBroadcastRef.current);
|
|
113
113
|
pendingBroadcastRef.current = null;
|
|
@@ -117,7 +117,7 @@ function usePresenceTracking({
|
|
|
117
117
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
118
118
|
pendingBroadcastRef.current = null;
|
|
119
119
|
flush();
|
|
120
|
-
},
|
|
120
|
+
}, chunkH74UXL4Q_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -142,7 +142,7 @@ function usePresenceTracking({
|
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
144
|
const handleChange = () => {
|
|
145
|
-
const users =
|
|
145
|
+
const users = chunkH74UXL4Q_js.derivePresenceList(
|
|
146
146
|
awareness.getStates(),
|
|
147
147
|
localClientId,
|
|
148
148
|
canvasWidth,
|
|
@@ -194,7 +194,7 @@ function useYjsProvider({ config }) {
|
|
|
194
194
|
const departureRef = react.useRef(null);
|
|
195
195
|
const gateRef = react.useRef(null);
|
|
196
196
|
if (!gateRef.current) {
|
|
197
|
-
gateRef.current =
|
|
197
|
+
gateRef.current = chunkH74UXL4Q_js.createSyncGate(() => setSynced(true));
|
|
198
198
|
}
|
|
199
199
|
const teardown = react.useCallback(() => {
|
|
200
200
|
if (timeoutRef.current) {
|
|
@@ -214,7 +214,7 @@ function useYjsProvider({ config }) {
|
|
|
214
214
|
const buildCleanup = react.useCallback(
|
|
215
215
|
(provider, yDoc) => () => {
|
|
216
216
|
announceDeparture();
|
|
217
|
-
|
|
217
|
+
chunkH74UXL4Q_js.clearLocalAwareness(provider.awareness);
|
|
218
218
|
provider.destroy();
|
|
219
219
|
yDoc.destroy();
|
|
220
220
|
setDoc(null);
|
|
@@ -239,9 +239,9 @@ function useYjsProvider({ config }) {
|
|
|
239
239
|
if (config.authToken) {
|
|
240
240
|
opts.password = config.authToken;
|
|
241
241
|
}
|
|
242
|
-
const roomId =
|
|
242
|
+
const roomId = chunkH74UXL4Q_js.validateRoomId(config.roomId);
|
|
243
243
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
244
|
-
departureRef.current =
|
|
244
|
+
departureRef.current = chunkH74UXL4Q_js.createDepartureChannel(roomId, provider.awareness);
|
|
245
245
|
setDoc(yDoc);
|
|
246
246
|
setAwareness(provider.awareness);
|
|
247
247
|
setClientId(provider.awareness.clientID);
|
|
@@ -283,13 +283,13 @@ function useYjsProvider({ config }) {
|
|
|
283
283
|
if (!config) {
|
|
284
284
|
return;
|
|
285
285
|
}
|
|
286
|
-
const roomId =
|
|
287
|
-
const transport = config.transport ??
|
|
286
|
+
const roomId = chunkH74UXL4Q_js.validateRoomId(config.roomId);
|
|
287
|
+
const transport = config.transport ?? chunkH74UXL4Q_js.resolveTransportForServerUrl(config.serverUrl);
|
|
288
288
|
if (transport === "webrtc") {
|
|
289
289
|
await initWebrtc();
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
if (
|
|
292
|
+
if (chunkH74UXL4Q_js.isMixedContentBlocked(config.serverUrl)) {
|
|
293
293
|
console.warn(
|
|
294
294
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
295
295
|
);
|
|
@@ -303,7 +303,7 @@ function useYjsProvider({ config }) {
|
|
|
303
303
|
const provider = new WebsocketProvider(config.serverUrl, roomId, yDoc, {
|
|
304
304
|
params: config.authToken ? { token: config.authToken } : void 0
|
|
305
305
|
});
|
|
306
|
-
departureRef.current =
|
|
306
|
+
departureRef.current = chunkH74UXL4Q_js.createDepartureChannel(roomId, provider.awareness);
|
|
307
307
|
let connected = false;
|
|
308
308
|
const handleStatus = (event) => {
|
|
309
309
|
if (event.status === "connected") {
|
|
@@ -343,7 +343,7 @@ function useYjsProvider({ config }) {
|
|
|
343
343
|
provider.off("status", handleStatus);
|
|
344
344
|
provider.off("sync", handleSynced);
|
|
345
345
|
announceDeparture();
|
|
346
|
-
|
|
346
|
+
chunkH74UXL4Q_js.clearLocalAwareness(provider.awareness);
|
|
347
347
|
provider.destroy();
|
|
348
348
|
yDoc.destroy();
|
|
349
349
|
setDoc(null);
|
|
@@ -352,7 +352,7 @@ function useYjsProvider({ config }) {
|
|
|
352
352
|
cleanupRef.current = null;
|
|
353
353
|
setStatus("error");
|
|
354
354
|
}
|
|
355
|
-
},
|
|
355
|
+
}, chunkH74UXL4Q_js.CONNECTION_TIMEOUT_MS);
|
|
356
356
|
}
|
|
357
357
|
setDoc(yDoc);
|
|
358
358
|
setAwareness(provider.awareness);
|
|
@@ -361,7 +361,7 @@ function useYjsProvider({ config }) {
|
|
|
361
361
|
provider.off("status", handleStatus);
|
|
362
362
|
provider.off("sync", handleSynced);
|
|
363
363
|
announceDeparture();
|
|
364
|
-
|
|
364
|
+
chunkH74UXL4Q_js.clearLocalAwareness(provider.awareness);
|
|
365
365
|
provider.destroy();
|
|
366
366
|
yDoc.destroy();
|
|
367
367
|
setDoc(null);
|
|
@@ -387,7 +387,7 @@ function useYjsProvider({ config }) {
|
|
|
387
387
|
]);
|
|
388
388
|
react.useEffect(() => {
|
|
389
389
|
init();
|
|
390
|
-
const disposeTeardown =
|
|
390
|
+
const disposeTeardown = chunkH74UXL4Q_js.registerCollaborationTeardown({
|
|
391
391
|
leave: teardown,
|
|
392
392
|
rejoin: init
|
|
393
393
|
});
|
|
@@ -408,7 +408,7 @@ function useCollaborativeState({
|
|
|
408
408
|
canvasWidth,
|
|
409
409
|
canvasHeight
|
|
410
410
|
}) {
|
|
411
|
-
const userColor =
|
|
411
|
+
const userColor = chunkH74UXL4Q_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
412
412
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
413
413
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
414
414
|
awareness,
|
|
@@ -517,8 +517,8 @@ function useEditorHistory(input) {
|
|
|
517
517
|
width: canvasSize.width,
|
|
518
518
|
height: canvasSize.height,
|
|
519
519
|
activeSlideIndex,
|
|
520
|
-
slides: slides.map(
|
|
521
|
-
templateElementsBySlideId:
|
|
520
|
+
slides: slides.map(chunkH74UXL4Q_js.cloneSlide),
|
|
521
|
+
templateElementsBySlideId: chunkH74UXL4Q_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
522
522
|
...actionLabel ? { actionLabel } : {}
|
|
523
523
|
};
|
|
524
524
|
},
|
|
@@ -531,9 +531,9 @@ function useEditorHistory(input) {
|
|
|
531
531
|
width: snapshot.width,
|
|
532
532
|
height: snapshot.height
|
|
533
533
|
});
|
|
534
|
-
setSlides(snapshot.slides.map(
|
|
534
|
+
setSlides(snapshot.slides.map(chunkH74UXL4Q_js.cloneSlide));
|
|
535
535
|
setTemplateElementsBySlideId(
|
|
536
|
-
|
|
536
|
+
chunkH74UXL4Q_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
537
537
|
);
|
|
538
538
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
539
539
|
setSelectedElementIds([]);
|
|
@@ -567,8 +567,8 @@ function useEditorHistory(input) {
|
|
|
567
567
|
const currentSnapshot = buildHistorySnapshot();
|
|
568
568
|
historyFutureRef.current.push(currentSnapshot);
|
|
569
569
|
isApplyingHistoryRef.current = true;
|
|
570
|
-
const nextSnapshot =
|
|
571
|
-
lastHistorySnapshotRef.current =
|
|
570
|
+
const nextSnapshot = chunkIJVDNQLG_js.cloneHistorySnapshot(previousSnapshot);
|
|
571
|
+
lastHistorySnapshotRef.current = chunkIJVDNQLG_js.cloneHistorySnapshot(nextSnapshot);
|
|
572
572
|
lastHistorySerializedRef.current = JSON.stringify(nextSnapshot);
|
|
573
573
|
applyHistorySnapshot(nextSnapshot);
|
|
574
574
|
updateHistoryAvailability();
|
|
@@ -589,8 +589,8 @@ function useEditorHistory(input) {
|
|
|
589
589
|
const currentSnapshot = buildHistorySnapshot();
|
|
590
590
|
historyPastRef.current.push(currentSnapshot);
|
|
591
591
|
isApplyingHistoryRef.current = true;
|
|
592
|
-
const targetSnapshot =
|
|
593
|
-
lastHistorySnapshotRef.current =
|
|
592
|
+
const targetSnapshot = chunkIJVDNQLG_js.cloneHistorySnapshot(nextSnapshot);
|
|
593
|
+
lastHistorySnapshotRef.current = chunkIJVDNQLG_js.cloneHistorySnapshot(targetSnapshot);
|
|
594
594
|
lastHistorySerializedRef.current = JSON.stringify(targetSnapshot);
|
|
595
595
|
applyHistorySnapshot(targetSnapshot);
|
|
596
596
|
updateHistoryAvailability();
|
|
@@ -608,7 +608,7 @@ function useEditorHistory(input) {
|
|
|
608
608
|
historyPastRef.current = [];
|
|
609
609
|
historyFutureRef.current = [];
|
|
610
610
|
if (initialSnapshot) {
|
|
611
|
-
const clonedInitial =
|
|
611
|
+
const clonedInitial = chunkIJVDNQLG_js.cloneHistorySnapshot(initialSnapshot);
|
|
612
612
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
613
613
|
lastHistorySerializedRef.current = JSON.stringify(clonedInitial);
|
|
614
614
|
} else {
|
|
@@ -649,18 +649,18 @@ function useEditorHistory(input) {
|
|
|
649
649
|
}
|
|
650
650
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
651
651
|
if (!previousSnapshot) {
|
|
652
|
-
lastHistorySnapshotRef.current =
|
|
652
|
+
lastHistorySnapshotRef.current = chunkIJVDNQLG_js.cloneHistorySnapshot(snapshot);
|
|
653
653
|
lastHistorySerializedRef.current = serialized;
|
|
654
654
|
lastCheapHashRef.current = cheapHash;
|
|
655
655
|
updateHistoryAvailability();
|
|
656
656
|
return;
|
|
657
657
|
}
|
|
658
|
-
historyPastRef.current.push(
|
|
658
|
+
historyPastRef.current.push(chunkIJVDNQLG_js.cloneHistorySnapshot(previousSnapshot));
|
|
659
659
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
660
660
|
historyPastRef.current.shift();
|
|
661
661
|
}
|
|
662
662
|
historyFutureRef.current = [];
|
|
663
|
-
lastHistorySnapshotRef.current =
|
|
663
|
+
lastHistorySnapshotRef.current = chunkIJVDNQLG_js.cloneHistorySnapshot(snapshot);
|
|
664
664
|
lastHistorySerializedRef.current = serialized;
|
|
665
665
|
lastCheapHashRef.current = cheapHash;
|
|
666
666
|
updateHistoryAvailability();
|
|
@@ -749,7 +749,7 @@ function useZoomViewport({
|
|
|
749
749
|
if (!wrapper || !canvasViewport) {
|
|
750
750
|
return;
|
|
751
751
|
}
|
|
752
|
-
const boundedScale =
|
|
752
|
+
const boundedScale = chunkH74UXL4Q_js.clampZoomScale(nextScale);
|
|
753
753
|
const nextEditorScale = fitScale * boundedScale;
|
|
754
754
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
755
755
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -764,10 +764,10 @@ function useZoomViewport({
|
|
|
764
764
|
[fitScale]
|
|
765
765
|
);
|
|
766
766
|
const handleZoomIn = react.useCallback(() => {
|
|
767
|
-
setScale((currentScale) =>
|
|
767
|
+
setScale((currentScale) => chunkH74UXL4Q_js.zoomInScale(currentScale));
|
|
768
768
|
}, []);
|
|
769
769
|
const handleZoomOut = react.useCallback(() => {
|
|
770
|
-
setScale((currentScale) =>
|
|
770
|
+
setScale((currentScale) => chunkH74UXL4Q_js.zoomOutScale(currentScale));
|
|
771
771
|
}, []);
|
|
772
772
|
const handleResetZoom = react.useCallback(() => {
|
|
773
773
|
setScale(1);
|
|
@@ -786,32 +786,29 @@ function useZoomViewport({
|
|
|
786
786
|
selectedElements.forEach((element) => {
|
|
787
787
|
minX = Math.min(minX, element.x);
|
|
788
788
|
minY = Math.min(minY, element.y);
|
|
789
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
790
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
789
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkIJVDNQLG_js.MIN_ELEMENT_SIZE));
|
|
790
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkIJVDNQLG_js.MIN_ELEMENT_SIZE));
|
|
791
791
|
});
|
|
792
792
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
793
793
|
return;
|
|
794
794
|
}
|
|
795
795
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
796
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
797
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
796
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkIJVDNQLG_js.MIN_ELEMENT_SIZE);
|
|
797
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkIJVDNQLG_js.MIN_ELEMENT_SIZE);
|
|
798
798
|
const availableWidth = Math.max(
|
|
799
|
-
effectiveEditorDimensions.width -
|
|
800
|
-
|
|
799
|
+
effectiveEditorDimensions.width - chunkIJVDNQLG_js.ZOOM_TO_SELECTION_PADDING,
|
|
800
|
+
chunkIJVDNQLG_js.MIN_ELEMENT_SIZE
|
|
801
801
|
);
|
|
802
802
|
const availableHeight = Math.max(
|
|
803
|
-
effectiveEditorDimensions.height -
|
|
804
|
-
|
|
803
|
+
effectiveEditorDimensions.height - chunkIJVDNQLG_js.ZOOM_TO_SELECTION_PADDING,
|
|
804
|
+
chunkIJVDNQLG_js.MIN_ELEMENT_SIZE
|
|
805
805
|
);
|
|
806
806
|
const targetEditorScale = Math.min(
|
|
807
807
|
availableWidth / boundsWidth,
|
|
808
808
|
availableHeight / boundsHeight
|
|
809
809
|
);
|
|
810
810
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
811
|
-
const nextScale =
|
|
812
|
-
Math.max(targetEditorScale / safeFitScale, chunkSMW4QYGK_js.MIN_ZOOM_SCALE),
|
|
813
|
-
chunkSMW4QYGK_js.MAX_ZOOM_SCALE
|
|
814
|
-
);
|
|
811
|
+
const nextScale = chunkH74UXL4Q_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
815
812
|
setScale(nextScale);
|
|
816
813
|
window.requestAnimationFrame(() => {
|
|
817
814
|
window.requestAnimationFrame(() => {
|
|
@@ -831,9 +828,7 @@ function useZoomViewport({
|
|
|
831
828
|
}
|
|
832
829
|
event.preventDefault();
|
|
833
830
|
const delta = event.deltaY * -1e-3;
|
|
834
|
-
setScale(
|
|
835
|
-
(currentScale) => Math.min(Math.max(currentScale + delta, chunkSMW4QYGK_js.MIN_ZOOM_SCALE), chunkSMW4QYGK_js.MAX_ZOOM_SCALE)
|
|
836
|
-
);
|
|
831
|
+
setScale((currentScale) => chunkH74UXL4Q_js.clampZoomScale(currentScale + delta));
|
|
837
832
|
}, []);
|
|
838
833
|
react.useEffect(() => {
|
|
839
834
|
const viewport = canvasViewportRef.current;
|
|
@@ -910,7 +905,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
910
905
|
const command = step.command;
|
|
911
906
|
const timer = window.setTimeout(
|
|
912
907
|
() => {
|
|
913
|
-
|
|
908
|
+
chunkIJVDNQLG_js.executeMediaCommand(command);
|
|
914
909
|
},
|
|
915
910
|
Math.max(0, step.delayMs)
|
|
916
911
|
);
|
|
@@ -1026,7 +1021,7 @@ function useAnimationPlayback(input) {
|
|
|
1026
1021
|
(controller, group) => {
|
|
1027
1022
|
driveBuildReveal(
|
|
1028
1023
|
controller,
|
|
1029
|
-
|
|
1024
|
+
chunkH74UXL4Q_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1030
1025
|
setPresentationElementStates,
|
|
1031
1026
|
buildRafRef
|
|
1032
1027
|
);
|
|
@@ -1089,7 +1084,7 @@ function useAnimationPlayback(input) {
|
|
|
1089
1084
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1090
1085
|
return;
|
|
1091
1086
|
}
|
|
1092
|
-
const controller =
|
|
1087
|
+
const controller = chunkH74UXL4Q_js.PresentationAnimationController.fromSlide(slide);
|
|
1093
1088
|
controllerRef.current = controller;
|
|
1094
1089
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1095
1090
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1237,7 +1232,7 @@ function useAnimationPlayback(input) {
|
|
|
1237
1232
|
}))
|
|
1238
1233
|
);
|
|
1239
1234
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1240
|
-
const delay =
|
|
1235
|
+
const delay = chunkH74UXL4Q_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1241
1236
|
const timer = window.setTimeout(() => {
|
|
1242
1237
|
setPresentationAnimations(
|
|
1243
1238
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1274,12 +1269,12 @@ function useAnimationPlayback(input) {
|
|
|
1274
1269
|
presentationTimersRef
|
|
1275
1270
|
};
|
|
1276
1271
|
}
|
|
1277
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1278
|
-
var AUDIENCE_HASH =
|
|
1279
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1280
|
-
var AUDIENCE_NONCE_KEY =
|
|
1272
|
+
var PRESENTER_CHANNEL_NAME = chunkH74UXL4Q_js.PRESENTATION_CHANNEL_NAME;
|
|
1273
|
+
var AUDIENCE_HASH = chunkH74UXL4Q_js.PRESENTATION_HASH;
|
|
1274
|
+
var PRESENTER_MSG_ORIGIN = chunkH74UXL4Q_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1275
|
+
var AUDIENCE_NONCE_KEY = chunkH74UXL4Q_js.PRESENTATION_NONCE_KEY;
|
|
1281
1276
|
function generateSessionId() {
|
|
1282
|
-
return
|
|
1277
|
+
return chunkH74UXL4Q_js.createPresentationSessionId();
|
|
1283
1278
|
}
|
|
1284
1279
|
function parseAudienceNonce() {
|
|
1285
1280
|
const hash = window.location.hash;
|
|
@@ -1315,7 +1310,7 @@ function usePresenterWindow(input) {
|
|
|
1315
1310
|
}, []);
|
|
1316
1311
|
const swapDisplays = react.useCallback(async () => {
|
|
1317
1312
|
const audience = audienceWindowRef.current;
|
|
1318
|
-
return audience && !audience.closed ?
|
|
1313
|
+
return audience && !audience.closed ? chunkH74UXL4Q_js.swapPresentationWindows(window, audience) : false;
|
|
1319
1314
|
}, []);
|
|
1320
1315
|
const syncSlideToAudience = react.useCallback(
|
|
1321
1316
|
(slideIndex) => {
|
|
@@ -1379,7 +1374,7 @@ function usePresenterWindow(input) {
|
|
|
1379
1374
|
pollTimerRef.current = null;
|
|
1380
1375
|
}
|
|
1381
1376
|
if (closingSessionId) {
|
|
1382
|
-
void
|
|
1377
|
+
void chunkH74UXL4Q_js.clearAudienceContent(closingSessionId);
|
|
1383
1378
|
}
|
|
1384
1379
|
}, [getChannel]);
|
|
1385
1380
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1397,10 +1392,10 @@ function usePresenterWindow(input) {
|
|
|
1397
1392
|
audienceWindowRef.current = blankWin;
|
|
1398
1393
|
const sessionId = generateSessionId();
|
|
1399
1394
|
sessionIdRef.current = sessionId;
|
|
1400
|
-
const audienceUrl =
|
|
1401
|
-
void
|
|
1395
|
+
const audienceUrl = chunkH74UXL4Q_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1396
|
+
void chunkH74UXL4Q_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1402
1397
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1403
|
-
|
|
1398
|
+
chunkH74UXL4Q_js.placeAudienceWindow(blankWin, placement);
|
|
1404
1399
|
}
|
|
1405
1400
|
return void 0;
|
|
1406
1401
|
});
|
|
@@ -1430,7 +1425,7 @@ function usePresenterWindow(input) {
|
|
|
1430
1425
|
}
|
|
1431
1426
|
};
|
|
1432
1427
|
if (content) {
|
|
1433
|
-
void
|
|
1428
|
+
void chunkH74UXL4Q_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1434
1429
|
} else {
|
|
1435
1430
|
navigateOrClose(true);
|
|
1436
1431
|
}
|
|
@@ -1456,7 +1451,7 @@ function usePresenterWindow(input) {
|
|
|
1456
1451
|
}
|
|
1457
1452
|
const handleMessage = (event) => {
|
|
1458
1453
|
const message = event.data;
|
|
1459
|
-
if (
|
|
1454
|
+
if (chunkH74UXL4Q_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1460
1455
|
syncStateToAudience(snapshotRef.current);
|
|
1461
1456
|
}
|
|
1462
1457
|
};
|
|
@@ -1485,7 +1480,7 @@ function usePresenterWindow(input) {
|
|
|
1485
1480
|
react.useEffect(() => {
|
|
1486
1481
|
const handleBeforeUnload = () => {
|
|
1487
1482
|
if (sessionIdRef.current) {
|
|
1488
|
-
void
|
|
1483
|
+
void chunkH74UXL4Q_js.clearAudienceContent(sessionIdRef.current);
|
|
1489
1484
|
}
|
|
1490
1485
|
};
|
|
1491
1486
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1547,7 +1542,7 @@ function useAudienceMode(input) {
|
|
|
1547
1542
|
}
|
|
1548
1543
|
channel.onmessage = (event) => {
|
|
1549
1544
|
const data = event.data;
|
|
1550
|
-
if (!
|
|
1545
|
+
if (!chunkH74UXL4Q_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1551
1546
|
return;
|
|
1552
1547
|
}
|
|
1553
1548
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1563,16 +1558,16 @@ function useAudienceMode(input) {
|
|
|
1563
1558
|
}
|
|
1564
1559
|
if (data.type === "presenter-exit") {
|
|
1565
1560
|
if (expectedSessionId) {
|
|
1566
|
-
void
|
|
1561
|
+
void chunkH74UXL4Q_js.clearAudienceContent(expectedSessionId);
|
|
1567
1562
|
}
|
|
1568
|
-
if (
|
|
1563
|
+
if (chunkH74UXL4Q_js.endAudienceDisplay(window)) {
|
|
1569
1564
|
handlers.onPresenterEnded?.();
|
|
1570
1565
|
}
|
|
1571
1566
|
}
|
|
1572
1567
|
};
|
|
1573
1568
|
if (expectedSessionId) {
|
|
1574
1569
|
channel.postMessage({
|
|
1575
|
-
origin:
|
|
1570
|
+
origin: chunkH74UXL4Q_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1576
1571
|
type: "audience-ready",
|
|
1577
1572
|
sessionId: expectedSessionId
|
|
1578
1573
|
});
|
|
@@ -1604,14 +1599,14 @@ function usePresentationKeyboard(input) {
|
|
|
1604
1599
|
presentationSlideIndex,
|
|
1605
1600
|
setShowRehearsalSummary
|
|
1606
1601
|
} = input;
|
|
1607
|
-
const keyBufferRef = react.useRef(
|
|
1602
|
+
const keyBufferRef = react.useRef(chunkH74UXL4Q_js.createPresentationKeyBuffer());
|
|
1608
1603
|
react.useEffect(() => {
|
|
1609
|
-
if (mode !== "present" || !
|
|
1610
|
-
keyBufferRef.current =
|
|
1604
|
+
if (mode !== "present" || !chunkH74UXL4Q_js.acceptsPresentationInput()) {
|
|
1605
|
+
keyBufferRef.current = chunkH74UXL4Q_js.createPresentationKeyBuffer();
|
|
1611
1606
|
return;
|
|
1612
1607
|
}
|
|
1613
1608
|
const handleKeyDown = (event) => {
|
|
1614
|
-
const mapped =
|
|
1609
|
+
const mapped = chunkH74UXL4Q_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1615
1610
|
if (mapped.action === "none") {
|
|
1616
1611
|
return;
|
|
1617
1612
|
}
|
|
@@ -1819,7 +1814,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1819
1814
|
return;
|
|
1820
1815
|
}
|
|
1821
1816
|
if (action.url && !actionStr.includes("hlinksldjump")) {
|
|
1822
|
-
if (
|
|
1817
|
+
if (chunkH74UXL4Q_js.isUrlSafe(action.url)) {
|
|
1823
1818
|
window.open(action.url, "_blank", "noopener,noreferrer");
|
|
1824
1819
|
}
|
|
1825
1820
|
}
|
|
@@ -1829,7 +1824,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1829
1824
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1830
1825
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1831
1826
|
const transition = incomingSlide?.transition;
|
|
1832
|
-
const durationMs = deps.playTransition ?
|
|
1827
|
+
const durationMs = deps.playTransition ? chunkH74UXL4Q_js.resolveTransitionDurationMs(transition) : 0;
|
|
1833
1828
|
deps.clearPresentationTimers();
|
|
1834
1829
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1835
1830
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1888,7 +1883,7 @@ function useSlideNavigation(input) {
|
|
|
1888
1883
|
});
|
|
1889
1884
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1890
1885
|
(slideIndex) => {
|
|
1891
|
-
const delayMs =
|
|
1886
|
+
const delayMs = chunkH74UXL4Q_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1892
1887
|
if (delayMs === void 0) {
|
|
1893
1888
|
return;
|
|
1894
1889
|
}
|
|
@@ -2078,17 +2073,17 @@ function useZoomNavigation(input) {
|
|
|
2078
2073
|
};
|
|
2079
2074
|
}
|
|
2080
2075
|
function usePresenterConsole(slideIndex) {
|
|
2081
|
-
const timerRef = react.useRef(
|
|
2082
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2076
|
+
const timerRef = react.useRef(chunkH74UXL4Q_js.createPresenterTimer());
|
|
2077
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkH74UXL4Q_js.createInitialPresentationSnapshot(slideIndex));
|
|
2083
2078
|
const patch = react.useCallback((value) => {
|
|
2084
|
-
setSnapshot((current) =>
|
|
2079
|
+
setSnapshot((current) => chunkH74UXL4Q_js.mergePresentationSnapshot(current, value));
|
|
2085
2080
|
}, []);
|
|
2086
2081
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2087
2082
|
react.useEffect(() => {
|
|
2088
2083
|
const timer = window.setInterval(() => {
|
|
2089
2084
|
patch({
|
|
2090
2085
|
paused: timerRef.current.paused,
|
|
2091
|
-
elapsedMs:
|
|
2086
|
+
elapsedMs: chunkH74UXL4Q_js.presenterElapsed(timerRef.current)
|
|
2092
2087
|
});
|
|
2093
2088
|
}, 1e3);
|
|
2094
2089
|
return () => window.clearInterval(timer);
|
|
@@ -2098,19 +2093,19 @@ function usePresenterConsole(slideIndex) {
|
|
|
2098
2093
|
applyAudienceSnapshot: setSnapshot,
|
|
2099
2094
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2100
2095
|
toggleTimer: () => {
|
|
2101
|
-
timerRef.current =
|
|
2096
|
+
timerRef.current = chunkH74UXL4Q_js.togglePresenterTimer(timerRef.current);
|
|
2102
2097
|
patch({
|
|
2103
2098
|
paused: timerRef.current.paused,
|
|
2104
|
-
elapsedMs:
|
|
2099
|
+
elapsedMs: chunkH74UXL4Q_js.presenterElapsed(timerRef.current)
|
|
2105
2100
|
});
|
|
2106
2101
|
},
|
|
2107
2102
|
resetTimer: () => {
|
|
2108
|
-
timerRef.current =
|
|
2103
|
+
timerRef.current = chunkH74UXL4Q_js.resetPresenterTimer();
|
|
2109
2104
|
patch({ paused: false, elapsedMs: 0 });
|
|
2110
2105
|
},
|
|
2111
2106
|
stepZoom: (direction) => setSnapshot(
|
|
2112
|
-
(current) =>
|
|
2113
|
-
zoom:
|
|
2107
|
+
(current) => chunkH74UXL4Q_js.mergePresentationSnapshot(current, {
|
|
2108
|
+
zoom: chunkH74UXL4Q_js.stepPresenterZoom(
|
|
2114
2109
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2115
2110
|
direction
|
|
2116
2111
|
)
|
|
@@ -2231,7 +2226,7 @@ function usePresentationMode(input) {
|
|
|
2231
2226
|
});
|
|
2232
2227
|
const movePresentationSlide = react.useCallback(
|
|
2233
2228
|
(direction, trigger = "explicit") => {
|
|
2234
|
-
if (!
|
|
2229
|
+
if (!chunkH74UXL4Q_js.acceptsPresentationInput()) {
|
|
2235
2230
|
return;
|
|
2236
2231
|
}
|
|
2237
2232
|
if (endOfShowVisible) {
|
|
@@ -2433,11 +2428,11 @@ function usePresentationMode(input) {
|
|
|
2433
2428
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2434
2429
|
return void 0;
|
|
2435
2430
|
}
|
|
2436
|
-
return
|
|
2431
|
+
return chunkH74UXL4Q_js.buildMorphTransitionPlan(
|
|
2437
2432
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2438
2433
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2439
2434
|
transitionOverlay.durationMs,
|
|
2440
|
-
|
|
2435
|
+
chunkH74UXL4Q_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2441
2436
|
);
|
|
2442
2437
|
}, [transitionOverlay, slides]);
|
|
2443
2438
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2743,7 +2738,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2743
2738
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2744
2739
|
slides.forEach((slide, slideIndex) => {
|
|
2745
2740
|
for (const element of slide.elements || []) {
|
|
2746
|
-
if (!
|
|
2741
|
+
if (!chunkH74UXL4Q_js.hasTextProperties(element)) {
|
|
2747
2742
|
continue;
|
|
2748
2743
|
}
|
|
2749
2744
|
const segments = element.textSegments ?? [];
|
|
@@ -2794,7 +2789,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2794
2789
|
continue;
|
|
2795
2790
|
}
|
|
2796
2791
|
const element = slide.elements[elIdx];
|
|
2797
|
-
if (!
|
|
2792
|
+
if (!chunkH74UXL4Q_js.hasTextProperties(element)) {
|
|
2798
2793
|
continue;
|
|
2799
2794
|
}
|
|
2800
2795
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3392,7 +3387,7 @@ function useViewerCoreState(_input) {
|
|
|
3392
3387
|
const shapeAdjustmentDragStateRef = react.useRef(null);
|
|
3393
3388
|
const marqueeStateRef = react.useRef(null);
|
|
3394
3389
|
const isDrawingRef = react.useRef(false);
|
|
3395
|
-
const livePatcher = react.useMemo(() =>
|
|
3390
|
+
const livePatcher = react.useMemo(() => chunkH74UXL4Q_js.createCollaborationLivePatcher(), []);
|
|
3396
3391
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3397
3392
|
const slidesRef = react.useRef([]);
|
|
3398
3393
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3401,8 +3396,8 @@ function useViewerCoreState(_input) {
|
|
|
3401
3396
|
const [slides, setSlides] = react.useState([]);
|
|
3402
3397
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3403
3398
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3404
|
-
width:
|
|
3405
|
-
height:
|
|
3399
|
+
width: chunkIJVDNQLG_js.DEFAULT_CANVAS_WIDTH,
|
|
3400
|
+
height: chunkIJVDNQLG_js.DEFAULT_CANVAS_HEIGHT
|
|
3406
3401
|
});
|
|
3407
3402
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
3408
3403
|
const [selectedElementId, setSelectedElementId] = react.useState(null);
|
|
@@ -3422,7 +3417,7 @@ function useViewerCoreState(_input) {
|
|
|
3422
3417
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3423
3418
|
inlineEditingTextRef.current = resolved;
|
|
3424
3419
|
setInlineEditingTextBase(value);
|
|
3425
|
-
|
|
3420
|
+
chunkH74UXL4Q_js.publishLiveInlineText(
|
|
3426
3421
|
livePatcher,
|
|
3427
3422
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3428
3423
|
inlineEditingElementIdRef.current,
|
|
@@ -3590,6 +3585,7 @@ function useViewerUIState() {
|
|
|
3590
3585
|
const [isSidebarCollapsed, setIsSidebarCollapsed] = react.useState(false);
|
|
3591
3586
|
const [sidebarPanelMode, setSidebarPanelMode] = react.useState("properties");
|
|
3592
3587
|
const [showSlideSorter, setShowSlideSorter] = react.useState(false);
|
|
3588
|
+
const [showReadingView, setShowReadingView] = react.useState(false);
|
|
3593
3589
|
const [isShortcutHelpOpen, setIsShortcutHelpOpen] = react.useState(false);
|
|
3594
3590
|
const [isAccessibilityPanelOpen, setIsAccessibilityPanelOpen] = react.useState(false);
|
|
3595
3591
|
const [accessibilityIssues, setAccessibilityIssues] = react.useState([]);
|
|
@@ -3598,6 +3594,7 @@ function useViewerUIState() {
|
|
|
3598
3594
|
const [spellCheckEnabled, setSpellCheckEnabled] = react.useState(true);
|
|
3599
3595
|
const [showGrid, setShowGrid] = react.useState(false);
|
|
3600
3596
|
const [showRulers, setShowRulers] = react.useState(false);
|
|
3597
|
+
const [showGuides, setShowGuides] = react.useState(true);
|
|
3601
3598
|
const [snapToGrid, setSnapToGrid] = react.useState(true);
|
|
3602
3599
|
const [snapToShape, setSnapToShape] = react.useState(true);
|
|
3603
3600
|
const [guides, setGuides] = react.useState(
|
|
@@ -3635,6 +3632,8 @@ function useViewerUIState() {
|
|
|
3635
3632
|
setSidebarPanelMode,
|
|
3636
3633
|
showSlideSorter,
|
|
3637
3634
|
setShowSlideSorter,
|
|
3635
|
+
showReadingView,
|
|
3636
|
+
setShowReadingView,
|
|
3638
3637
|
isShortcutHelpOpen,
|
|
3639
3638
|
setIsShortcutHelpOpen,
|
|
3640
3639
|
isAccessibilityPanelOpen,
|
|
@@ -3651,6 +3650,8 @@ function useViewerUIState() {
|
|
|
3651
3650
|
setShowGrid,
|
|
3652
3651
|
showRulers,
|
|
3653
3652
|
setShowRulers,
|
|
3653
|
+
showGuides,
|
|
3654
|
+
setShowGuides,
|
|
3654
3655
|
snapToGrid,
|
|
3655
3656
|
setSnapToGrid,
|
|
3656
3657
|
snapToShape,
|
|
@@ -3747,7 +3748,7 @@ function useLoadContent({
|
|
|
3747
3748
|
);
|
|
3748
3749
|
}
|
|
3749
3750
|
const previousHandler = handlerRef.current;
|
|
3750
|
-
const handler = new
|
|
3751
|
+
const handler = new chunkH74UXL4Q_js.PptxHandler();
|
|
3751
3752
|
const parsed = await handler.load(buffer);
|
|
3752
3753
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3753
3754
|
handler.dispose();
|
|
@@ -3759,7 +3760,7 @@ function useLoadContent({
|
|
|
3759
3760
|
handlerRef.current = null;
|
|
3760
3761
|
const mediaElements = [];
|
|
3761
3762
|
for (const slide of parsed.slides) {
|
|
3762
|
-
|
|
3763
|
+
chunkH74UXL4Q_js.collectMediaElements(slide.elements, mediaElements);
|
|
3763
3764
|
}
|
|
3764
3765
|
for (const url of mediaDataUrls.values()) {
|
|
3765
3766
|
if (url.startsWith("blob:")) {
|
|
@@ -3800,7 +3801,7 @@ function useLoadContent({
|
|
|
3800
3801
|
}
|
|
3801
3802
|
})
|
|
3802
3803
|
);
|
|
3803
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3804
|
+
const { paths: imagePaths, refs: imageRefs } = chunkH74UXL4Q_js.collectImagePaths(parsed.slides);
|
|
3804
3805
|
let nextSlides = parsed.slides;
|
|
3805
3806
|
if (imagePaths.size > 0) {
|
|
3806
3807
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3855,12 +3856,12 @@ function useLoadContent({
|
|
|
3855
3856
|
}
|
|
3856
3857
|
}
|
|
3857
3858
|
handlerRef.current = handler;
|
|
3858
|
-
const partition =
|
|
3859
|
+
const partition = chunkIJVDNQLG_js.partitionTemplateElements(nextSlides);
|
|
3859
3860
|
setSlides(partition.slides);
|
|
3860
3861
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3861
3862
|
setCanvasSize({
|
|
3862
|
-
width: parsed.width ??
|
|
3863
|
-
height: parsed.height ??
|
|
3863
|
+
width: parsed.width ?? chunkIJVDNQLG_js.DEFAULT_CANVAS_WIDTH,
|
|
3864
|
+
height: parsed.height ?? chunkIJVDNQLG_js.DEFAULT_CANVAS_HEIGHT
|
|
3864
3865
|
});
|
|
3865
3866
|
setHeaderFooter(parsed.headerFooter ?? {});
|
|
3866
3867
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
@@ -3889,7 +3890,7 @@ function useLoadContent({
|
|
|
3889
3890
|
setHasMacros(parsed.hasMacros === true);
|
|
3890
3891
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3891
3892
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3892
|
-
setGuides(
|
|
3893
|
+
setGuides(chunkH74UXL4Q_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3893
3894
|
setActiveSlideIndex(0);
|
|
3894
3895
|
clearSelection();
|
|
3895
3896
|
setIsDirty(false);
|
|
@@ -3897,7 +3898,7 @@ function useLoadContent({
|
|
|
3897
3898
|
onContentApplied?.();
|
|
3898
3899
|
} catch (err) {
|
|
3899
3900
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3900
|
-
if (err instanceof
|
|
3901
|
+
if (err instanceof chunkH74UXL4Q_js.EncryptedFileError) {
|
|
3901
3902
|
setIsEncrypted(true);
|
|
3902
3903
|
} else {
|
|
3903
3904
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3974,7 +3975,7 @@ function useAutosave(input) {
|
|
|
3974
3975
|
isSavingRef.current = false;
|
|
3975
3976
|
return;
|
|
3976
3977
|
}
|
|
3977
|
-
await
|
|
3978
|
+
await chunkH74UXL4Q_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
3978
3979
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
3979
3980
|
} catch (err) {
|
|
3980
3981
|
setAutosaveStatus({
|
|
@@ -4039,7 +4040,7 @@ function useElementOperations(input) {
|
|
|
4039
4040
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
4040
4041
|
const updateElementById = react.useCallback(
|
|
4041
4042
|
(elementId, updates) => {
|
|
4042
|
-
if (
|
|
4043
|
+
if (chunkH74UXL4Q_js.isTemplateElementId(elementId)) {
|
|
4043
4044
|
const slideId = activeSlide?.id;
|
|
4044
4045
|
if (slideId) {
|
|
4045
4046
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4079,7 +4080,7 @@ function useElementOperations(input) {
|
|
|
4079
4080
|
);
|
|
4080
4081
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4081
4082
|
(updates) => {
|
|
4082
|
-
if (!selectedElement || !
|
|
4083
|
+
if (!selectedElement || !chunkH74UXL4Q_js.hasShapeProperties(selectedElement)) {
|
|
4083
4084
|
return;
|
|
4084
4085
|
}
|
|
4085
4086
|
updateSelectedElement({
|
|
@@ -4090,17 +4091,17 @@ function useElementOperations(input) {
|
|
|
4090
4091
|
);
|
|
4091
4092
|
const updateSelectedTextStyle = react.useCallback(
|
|
4092
4093
|
(updates) => {
|
|
4093
|
-
if (!selectedElement || !
|
|
4094
|
+
if (!selectedElement || !chunkH74UXL4Q_js.hasTextProperties(selectedElement)) {
|
|
4094
4095
|
return;
|
|
4095
4096
|
}
|
|
4096
|
-
const inlineSel =
|
|
4097
|
+
const inlineSel = chunkH74UXL4Q_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4097
4098
|
if (inlineSel && selectedElement.textSegments) {
|
|
4098
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4099
|
+
const { newSegments: newSegments2, newSelection } = chunkH74UXL4Q_js.applyStyleToSelectedSegments(
|
|
4099
4100
|
selectedElement.textSegments,
|
|
4100
4101
|
inlineSel,
|
|
4101
4102
|
updates
|
|
4102
4103
|
);
|
|
4103
|
-
|
|
4104
|
+
chunkH74UXL4Q_js.setPendingSelectionRestore(newSelection);
|
|
4104
4105
|
updateSelectedElement({
|
|
4105
4106
|
textSegments: newSegments2
|
|
4106
4107
|
});
|
|
@@ -4120,12 +4121,12 @@ function useElementOperations(input) {
|
|
|
4120
4121
|
);
|
|
4121
4122
|
const updateSelectedTextCase = react.useCallback(
|
|
4122
4123
|
(mode) => {
|
|
4123
|
-
if (!selectedElement || !
|
|
4124
|
+
if (!selectedElement || !chunkH74UXL4Q_js.hasTextProperties(selectedElement)) {
|
|
4124
4125
|
return;
|
|
4125
4126
|
}
|
|
4126
|
-
const inlineSel =
|
|
4127
|
+
const inlineSel = chunkH74UXL4Q_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4127
4128
|
if (inlineSel && selectedElement.textSegments) {
|
|
4128
|
-
const newSegments =
|
|
4129
|
+
const newSegments = chunkH74UXL4Q_js.applyCaseTransformToSegments(
|
|
4129
4130
|
selectedElement.textSegments,
|
|
4130
4131
|
inlineSel,
|
|
4131
4132
|
mode
|
|
@@ -4135,14 +4136,14 @@ function useElementOperations(input) {
|
|
|
4135
4136
|
}
|
|
4136
4137
|
const updates = {};
|
|
4137
4138
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4138
|
-
updates.textSegments =
|
|
4139
|
+
updates.textSegments = chunkH74UXL4Q_js.applyCaseTransformToSegments(
|
|
4139
4140
|
selectedElement.textSegments,
|
|
4140
4141
|
null,
|
|
4141
4142
|
mode
|
|
4142
4143
|
);
|
|
4143
4144
|
}
|
|
4144
4145
|
if (typeof selectedElement.text === "string") {
|
|
4145
|
-
updates.text =
|
|
4146
|
+
updates.text = chunkH74UXL4Q_js.transformTextCase(selectedElement.text, mode);
|
|
4146
4147
|
}
|
|
4147
4148
|
updateSelectedElement(updates);
|
|
4148
4149
|
},
|
|
@@ -4197,7 +4198,7 @@ function useSectionOperations(input) {
|
|
|
4197
4198
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4198
4199
|
const addSection2 = react.useCallback(
|
|
4199
4200
|
(name, afterSlideIndex) => {
|
|
4200
|
-
const result =
|
|
4201
|
+
const result = chunkH74UXL4Q_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4201
4202
|
setSlides(result.slides);
|
|
4202
4203
|
setSections(result.sections);
|
|
4203
4204
|
markDirty();
|
|
@@ -4206,7 +4207,7 @@ function useSectionOperations(input) {
|
|
|
4206
4207
|
);
|
|
4207
4208
|
const renameSection2 = react.useCallback(
|
|
4208
4209
|
(sectionId, newName) => {
|
|
4209
|
-
const result =
|
|
4210
|
+
const result = chunkH74UXL4Q_js.renameSection(sections, slides, sectionId, newName);
|
|
4210
4211
|
setSections(result.sections);
|
|
4211
4212
|
setSlides(result.slides);
|
|
4212
4213
|
markDirty();
|
|
@@ -4215,7 +4216,7 @@ function useSectionOperations(input) {
|
|
|
4215
4216
|
);
|
|
4216
4217
|
const deleteSection2 = react.useCallback(
|
|
4217
4218
|
(sectionId) => {
|
|
4218
|
-
const result =
|
|
4219
|
+
const result = chunkH74UXL4Q_js.deleteSection(sections, slides, sectionId);
|
|
4219
4220
|
setSections(result.sections);
|
|
4220
4221
|
setSlides(result.slides);
|
|
4221
4222
|
markDirty();
|
|
@@ -4224,21 +4225,21 @@ function useSectionOperations(input) {
|
|
|
4224
4225
|
);
|
|
4225
4226
|
const moveSectionUp2 = react.useCallback(
|
|
4226
4227
|
(sectionId) => {
|
|
4227
|
-
setSections(
|
|
4228
|
+
setSections(chunkH74UXL4Q_js.moveSectionUp(sections, sectionId));
|
|
4228
4229
|
markDirty();
|
|
4229
4230
|
},
|
|
4230
4231
|
[sections, setSections, markDirty]
|
|
4231
4232
|
);
|
|
4232
4233
|
const moveSectionDown2 = react.useCallback(
|
|
4233
4234
|
(sectionId) => {
|
|
4234
|
-
setSections(
|
|
4235
|
+
setSections(chunkH74UXL4Q_js.moveSectionDown(sections, sectionId));
|
|
4235
4236
|
markDirty();
|
|
4236
4237
|
},
|
|
4237
4238
|
[sections, setSections, markDirty]
|
|
4238
4239
|
);
|
|
4239
4240
|
const moveSlidesToSection2 = react.useCallback(
|
|
4240
4241
|
(slideIndexes, targetSectionId) => {
|
|
4241
|
-
const result =
|
|
4242
|
+
const result = chunkH74UXL4Q_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4242
4243
|
setSlides(result.slides);
|
|
4243
4244
|
setSections(result.sections);
|
|
4244
4245
|
markDirty();
|
|
@@ -4257,19 +4258,19 @@ function useSectionOperations(input) {
|
|
|
4257
4258
|
|
|
4258
4259
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4259
4260
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4260
|
-
const resized =
|
|
4261
|
+
const resized = chunkH74UXL4Q_js.applyResize(
|
|
4261
4262
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4262
4263
|
handle,
|
|
4263
4264
|
dx,
|
|
4264
4265
|
dy,
|
|
4265
4266
|
1,
|
|
4266
|
-
{ minSize:
|
|
4267
|
+
{ minSize: chunkIJVDNQLG_js.MIN_ELEMENT_SIZE }
|
|
4267
4268
|
);
|
|
4268
4269
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4269
4270
|
if (!snapToGrid) {
|
|
4270
4271
|
return box;
|
|
4271
4272
|
}
|
|
4272
|
-
return
|
|
4273
|
+
return chunkH74UXL4Q_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkIJVDNQLG_js.MIN_ELEMENT_SIZE);
|
|
4273
4274
|
}
|
|
4274
4275
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
4275
4276
|
const range = startWidth || 200;
|
|
@@ -4387,7 +4388,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4387
4388
|
width: el.width,
|
|
4388
4389
|
height: el.height
|
|
4389
4390
|
}));
|
|
4390
|
-
const snapResult =
|
|
4391
|
+
const snapResult = chunkH74UXL4Q_js.computeSnapToShape(
|
|
4391
4392
|
targetX,
|
|
4392
4393
|
targetY,
|
|
4393
4394
|
primaryEl.width,
|
|
@@ -4426,7 +4427,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4426
4427
|
if (live) {
|
|
4427
4428
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4428
4429
|
const start = drag.startPositionsById[id];
|
|
4429
|
-
|
|
4430
|
+
chunkH74UXL4Q_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4430
4431
|
x: start.x + appliedDx,
|
|
4431
4432
|
y: start.y + appliedDy
|
|
4432
4433
|
});
|
|
@@ -4460,15 +4461,15 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4460
4461
|
if (rs.domEl) {
|
|
4461
4462
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4462
4463
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4463
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4464
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4464
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunkIJVDNQLG_js.MIN_ELEMENT_SIZE)}px`;
|
|
4465
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunkIJVDNQLG_js.MIN_ELEMENT_SIZE)}px`;
|
|
4465
4466
|
}
|
|
4466
4467
|
if (live) {
|
|
4467
|
-
|
|
4468
|
+
chunkH74UXL4Q_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4468
4469
|
x: geo.x,
|
|
4469
4470
|
y: geo.y,
|
|
4470
|
-
width: Math.max(geo.width,
|
|
4471
|
-
height: Math.max(geo.height,
|
|
4471
|
+
width: Math.max(geo.width, chunkIJVDNQLG_js.MIN_ELEMENT_SIZE),
|
|
4472
|
+
height: Math.max(geo.height, chunkIJVDNQLG_js.MIN_ELEMENT_SIZE)
|
|
4472
4473
|
});
|
|
4473
4474
|
}
|
|
4474
4475
|
}
|
|
@@ -4548,13 +4549,13 @@ function processPointerUp(input) {
|
|
|
4548
4549
|
if (i !== activeSlideIndex) {
|
|
4549
4550
|
return s;
|
|
4550
4551
|
}
|
|
4551
|
-
const rerouted =
|
|
4552
|
+
const rerouted = chunkH74UXL4Q_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4552
4553
|
if (rerouted.length === 0) {
|
|
4553
4554
|
return s;
|
|
4554
4555
|
}
|
|
4555
4556
|
return {
|
|
4556
4557
|
...s,
|
|
4557
|
-
elements:
|
|
4558
|
+
elements: chunkH74UXL4Q_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4558
4559
|
};
|
|
4559
4560
|
})
|
|
4560
4561
|
);
|
|
@@ -4576,9 +4577,9 @@ function processPointerUp(input) {
|
|
|
4576
4577
|
}
|
|
4577
4578
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4578
4579
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4579
|
-
const hitIds =
|
|
4580
|
+
const hitIds = chunkH74UXL4Q_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4580
4581
|
if (marquee.additive) {
|
|
4581
|
-
const merged =
|
|
4582
|
+
const merged = chunkH74UXL4Q_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4582
4583
|
if (merged.length > 0) {
|
|
4583
4584
|
applySelection(merged[0], merged);
|
|
4584
4585
|
} else {
|
|
@@ -4601,8 +4602,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4601
4602
|
}
|
|
4602
4603
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4603
4604
|
});
|
|
4604
|
-
const rerouted =
|
|
4605
|
-
return
|
|
4605
|
+
const rerouted = chunkH74UXL4Q_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4606
|
+
return chunkH74UXL4Q_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4606
4607
|
};
|
|
4607
4608
|
if (editTemplateMode) {
|
|
4608
4609
|
const slideId = activeSlide?.id;
|
|
@@ -4716,6 +4717,9 @@ function usePointerHandlers(input) {
|
|
|
4716
4717
|
input
|
|
4717
4718
|
]);
|
|
4718
4719
|
}
|
|
4720
|
+
function mouseDownStartsSelectionDrag(event) {
|
|
4721
|
+
return !event.shiftKey && !event.metaKey;
|
|
4722
|
+
}
|
|
4719
4723
|
function useCanvasInteractions(input) {
|
|
4720
4724
|
const {
|
|
4721
4725
|
mode,
|
|
@@ -4755,9 +4759,9 @@ function useCanvasInteractions(input) {
|
|
|
4755
4759
|
return;
|
|
4756
4760
|
}
|
|
4757
4761
|
const el = elementLookup.get(editId);
|
|
4758
|
-
if (el &&
|
|
4762
|
+
if (el && chunkH74UXL4Q_js.hasTextProperties(el)) {
|
|
4759
4763
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4760
|
-
const newSegments =
|
|
4764
|
+
const newSegments = chunkH74UXL4Q_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4761
4765
|
ops.updateElementById(editId, {
|
|
4762
4766
|
text: committedText,
|
|
4763
4767
|
textSegments: newSegments
|
|
@@ -4768,7 +4772,7 @@ function useCanvasInteractions(input) {
|
|
|
4768
4772
|
setInlineEditingText("");
|
|
4769
4773
|
};
|
|
4770
4774
|
const openEquationEditorForElement = (el) => {
|
|
4771
|
-
if (!
|
|
4775
|
+
if (!chunkH74UXL4Q_js.hasTextProperties(el)) {
|
|
4772
4776
|
return false;
|
|
4773
4777
|
}
|
|
4774
4778
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4797,7 +4801,7 @@ function useCanvasInteractions(input) {
|
|
|
4797
4801
|
justSelectedRef.current = false;
|
|
4798
4802
|
} else {
|
|
4799
4803
|
const el = elementLookup.get(elementId);
|
|
4800
|
-
if (el &&
|
|
4804
|
+
if (el && chunkH74UXL4Q_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
4801
4805
|
if (!openEquationEditorForElement(el)) {
|
|
4802
4806
|
setInlineEditingElementId(elementId);
|
|
4803
4807
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4816,7 +4820,7 @@ function useCanvasInteractions(input) {
|
|
|
4816
4820
|
if (openEquationEditorForElement(el)) {
|
|
4817
4821
|
return;
|
|
4818
4822
|
}
|
|
4819
|
-
if (
|
|
4823
|
+
if (chunkH74UXL4Q_js.hasTextProperties(el)) {
|
|
4820
4824
|
setInlineEditingElementId(elementId);
|
|
4821
4825
|
setInlineEditingText(el.text ?? "");
|
|
4822
4826
|
}
|
|
@@ -4828,6 +4832,9 @@ function useCanvasInteractions(input) {
|
|
|
4828
4832
|
if (inlineEditingElementId && inlineEditingElementId !== elementId) {
|
|
4829
4833
|
handleInlineEditCommit();
|
|
4830
4834
|
}
|
|
4835
|
+
if (!mouseDownStartsSelectionDrag(e)) {
|
|
4836
|
+
return;
|
|
4837
|
+
}
|
|
4831
4838
|
const wasSelected = selectedElementIdSet.has(elementId);
|
|
4832
4839
|
if (!wasSelected) {
|
|
4833
4840
|
ops.applySelection(elementId);
|
|
@@ -5006,7 +5013,7 @@ function createFileHandlers(deps) {
|
|
|
5006
5013
|
h = Math.round(h * scale);
|
|
5007
5014
|
}
|
|
5008
5015
|
addElement({
|
|
5009
|
-
id:
|
|
5016
|
+
id: chunkH74UXL4Q_js.generateElementId(),
|
|
5010
5017
|
type: "image",
|
|
5011
5018
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5012
5019
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5017,7 +5024,7 @@ function createFileHandlers(deps) {
|
|
|
5017
5024
|
};
|
|
5018
5025
|
img.onerror = () => {
|
|
5019
5026
|
addElement({
|
|
5020
|
-
id:
|
|
5027
|
+
id: chunkH74UXL4Q_js.generateElementId(),
|
|
5021
5028
|
type: "image",
|
|
5022
5029
|
x: 100,
|
|
5023
5030
|
y: 100,
|
|
@@ -5043,7 +5050,7 @@ function createFileHandlers(deps) {
|
|
|
5043
5050
|
const elFilePath = file.path;
|
|
5044
5051
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5045
5052
|
addElement({
|
|
5046
|
-
id:
|
|
5053
|
+
id: chunkH74UXL4Q_js.generateElementId(),
|
|
5047
5054
|
type: "media",
|
|
5048
5055
|
mediaType,
|
|
5049
5056
|
mediaMimeType: file.type || void 0,
|
|
@@ -5218,13 +5225,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5218
5225
|
return;
|
|
5219
5226
|
}
|
|
5220
5227
|
addElement({
|
|
5221
|
-
id:
|
|
5228
|
+
id: chunkH74UXL4Q_js.generateElementId(),
|
|
5222
5229
|
type: "smartArt",
|
|
5223
5230
|
x: 100,
|
|
5224
5231
|
y: 120,
|
|
5225
5232
|
width: 600,
|
|
5226
5233
|
height: 340,
|
|
5227
|
-
smartArtData:
|
|
5234
|
+
smartArtData: chunkH74UXL4Q_js.buildSmartArtPresetData(
|
|
5228
5235
|
layout,
|
|
5229
5236
|
defaultItems,
|
|
5230
5237
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5236,7 +5243,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5236
5243
|
return;
|
|
5237
5244
|
}
|
|
5238
5245
|
addElement({
|
|
5239
|
-
id:
|
|
5246
|
+
id: chunkH74UXL4Q_js.generateElementId(),
|
|
5240
5247
|
type: "shape",
|
|
5241
5248
|
x: 120,
|
|
5242
5249
|
y: 200,
|
|
@@ -5295,7 +5302,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5295
5302
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5296
5303
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5297
5304
|
addElement({
|
|
5298
|
-
id:
|
|
5305
|
+
id: chunkH74UXL4Q_js.generateElementId(),
|
|
5299
5306
|
type: "shape",
|
|
5300
5307
|
x: 120,
|
|
5301
5308
|
y: 200,
|
|
@@ -5317,11 +5324,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5317
5324
|
if (!activeSlide) {
|
|
5318
5325
|
return;
|
|
5319
5326
|
}
|
|
5320
|
-
const preset =
|
|
5327
|
+
const preset = chunkH74UXL4Q_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5321
5328
|
if (!preset) {
|
|
5322
5329
|
return;
|
|
5323
5330
|
}
|
|
5324
|
-
const defaultPptxAction =
|
|
5331
|
+
const defaultPptxAction = chunkH74UXL4Q_js.elementActionToPptxAction({
|
|
5325
5332
|
trigger: "click",
|
|
5326
5333
|
type: preset.defaultAction
|
|
5327
5334
|
});
|
|
@@ -5330,7 +5337,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5330
5337
|
defaultPptxAction.highlightClick = true;
|
|
5331
5338
|
}
|
|
5332
5339
|
addElement({
|
|
5333
|
-
id:
|
|
5340
|
+
id: chunkH74UXL4Q_js.generateElementId(),
|
|
5334
5341
|
type: "shape",
|
|
5335
5342
|
x: 150,
|
|
5336
5343
|
y: 150,
|
|
@@ -5397,14 +5404,14 @@ function useInsertElements(input) {
|
|
|
5397
5404
|
return;
|
|
5398
5405
|
}
|
|
5399
5406
|
addElement({
|
|
5400
|
-
id:
|
|
5407
|
+
id: chunkH74UXL4Q_js.generateElementId(),
|
|
5401
5408
|
type: "text",
|
|
5402
5409
|
x: 100,
|
|
5403
5410
|
y: 100,
|
|
5404
5411
|
width: 300,
|
|
5405
5412
|
height: 60,
|
|
5406
5413
|
text: "",
|
|
5407
|
-
textStyle: { fontSize:
|
|
5414
|
+
textStyle: { fontSize: chunkIJVDNQLG_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5408
5415
|
});
|
|
5409
5416
|
};
|
|
5410
5417
|
const handleAddShape = () => {
|
|
@@ -5412,7 +5419,7 @@ function useInsertElements(input) {
|
|
|
5412
5419
|
return;
|
|
5413
5420
|
}
|
|
5414
5421
|
addElement({
|
|
5415
|
-
id:
|
|
5422
|
+
id: chunkH74UXL4Q_js.generateElementId(),
|
|
5416
5423
|
type: "shape",
|
|
5417
5424
|
x: 150,
|
|
5418
5425
|
y: 150,
|
|
@@ -5431,15 +5438,15 @@ function useInsertElements(input) {
|
|
|
5431
5438
|
return;
|
|
5432
5439
|
}
|
|
5433
5440
|
addElement({
|
|
5434
|
-
...
|
|
5435
|
-
id:
|
|
5441
|
+
...chunkH74UXL4Q_js.newTableElement(chunkIJVDNQLG_js.DEFAULT_TABLE_ROWS, chunkIJVDNQLG_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5442
|
+
id: chunkH74UXL4Q_js.generateElementId()
|
|
5436
5443
|
});
|
|
5437
5444
|
};
|
|
5438
5445
|
const handleAddChart = (chartType) => {
|
|
5439
5446
|
if (!activeSlide) {
|
|
5440
5447
|
return;
|
|
5441
5448
|
}
|
|
5442
|
-
addElement(
|
|
5449
|
+
addElement(chunkH74UXL4Q_js.createDefaultChartElement(chartType));
|
|
5443
5450
|
};
|
|
5444
5451
|
const structured = createStructuredElementHandlers({
|
|
5445
5452
|
activeSlide,
|
|
@@ -5509,7 +5516,7 @@ function useClipboardHandlers(input) {
|
|
|
5509
5516
|
if (!selectedElement) {
|
|
5510
5517
|
return;
|
|
5511
5518
|
}
|
|
5512
|
-
setClipboardPayload(
|
|
5519
|
+
setClipboardPayload(chunkH74UXL4Q_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5513
5520
|
};
|
|
5514
5521
|
const handleDelete = () => {
|
|
5515
5522
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5526,7 +5533,7 @@ function useClipboardHandlers(input) {
|
|
|
5526
5533
|
handleDelete();
|
|
5527
5534
|
};
|
|
5528
5535
|
const insertClone = (source) => {
|
|
5529
|
-
const clone =
|
|
5536
|
+
const clone = chunkH74UXL4Q_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5530
5537
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5531
5538
|
ops.applySelection(clone.id);
|
|
5532
5539
|
history.markDirty();
|
|
@@ -5561,7 +5568,7 @@ function resolveShapePath(el) {
|
|
|
5561
5568
|
return el.pathData;
|
|
5562
5569
|
}
|
|
5563
5570
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5564
|
-
const clipPath =
|
|
5571
|
+
const clipPath = chunkH74UXL4Q_js.getPresetShapeClipPath(el.shapeType);
|
|
5565
5572
|
if (clipPath) {
|
|
5566
5573
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5567
5574
|
if (svgPath) {
|
|
@@ -5612,7 +5619,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5612
5619
|
return parts.join(" ");
|
|
5613
5620
|
}
|
|
5614
5621
|
function transformPathToGlobal(pathData, el) {
|
|
5615
|
-
const polys =
|
|
5622
|
+
const polys = chunkH74UXL4Q_js.svgPathToPolygons(pathData);
|
|
5616
5623
|
if (polys.length === 0) {
|
|
5617
5624
|
return pathData;
|
|
5618
5625
|
}
|
|
@@ -5632,10 +5639,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5632
5639
|
y: pt.y * scaleY + el.y
|
|
5633
5640
|
}))
|
|
5634
5641
|
);
|
|
5635
|
-
return
|
|
5642
|
+
return chunkH74UXL4Q_js.polygonsToSvgPath(transformed);
|
|
5636
5643
|
}
|
|
5637
5644
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5638
|
-
const polys =
|
|
5645
|
+
const polys = chunkH74UXL4Q_js.svgPathToPolygons(pathData);
|
|
5639
5646
|
if (polys.length === 0) {
|
|
5640
5647
|
return pathData;
|
|
5641
5648
|
}
|
|
@@ -5645,10 +5652,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5645
5652
|
y: pt.y - y
|
|
5646
5653
|
}))
|
|
5647
5654
|
);
|
|
5648
|
-
return
|
|
5655
|
+
return chunkH74UXL4Q_js.polygonsToSvgPath(transformed);
|
|
5649
5656
|
}
|
|
5650
5657
|
function pathBounds(pathData) {
|
|
5651
|
-
const polys =
|
|
5658
|
+
const polys = chunkH74UXL4Q_js.svgPathToPolygons(pathData);
|
|
5652
5659
|
let minX = Infinity;
|
|
5653
5660
|
let minY = Infinity;
|
|
5654
5661
|
let maxX = -Infinity;
|
|
@@ -5707,7 +5714,7 @@ function useMergeShapesHandler(input) {
|
|
|
5707
5714
|
let allFragments = [];
|
|
5708
5715
|
let remaining = globalPaths[0];
|
|
5709
5716
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5710
|
-
const frags =
|
|
5717
|
+
const frags = chunkH74UXL4Q_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5711
5718
|
if (Array.isArray(frags)) {
|
|
5712
5719
|
allFragments = frags;
|
|
5713
5720
|
}
|
|
@@ -5736,7 +5743,7 @@ function useMergeShapesHandler(input) {
|
|
|
5736
5743
|
bounds.height
|
|
5737
5744
|
);
|
|
5738
5745
|
const newEl = {
|
|
5739
|
-
id:
|
|
5746
|
+
id: chunkH74UXL4Q_js.generateElementId(),
|
|
5740
5747
|
type: "shape",
|
|
5741
5748
|
x: bounds.x,
|
|
5742
5749
|
y: bounds.y,
|
|
@@ -5774,7 +5781,7 @@ function useMergeShapesHandler(input) {
|
|
|
5774
5781
|
} else {
|
|
5775
5782
|
let resultPath = globalPaths[0];
|
|
5776
5783
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5777
|
-
const result =
|
|
5784
|
+
const result = chunkH74UXL4Q_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5778
5785
|
if (typeof result === "string") {
|
|
5779
5786
|
resultPath = result;
|
|
5780
5787
|
}
|
|
@@ -5795,7 +5802,7 @@ function useMergeShapesHandler(input) {
|
|
|
5795
5802
|
);
|
|
5796
5803
|
const primary = targets[0];
|
|
5797
5804
|
const newEl = {
|
|
5798
|
-
id:
|
|
5805
|
+
id: chunkH74UXL4Q_js.generateElementId(),
|
|
5799
5806
|
type: "shape",
|
|
5800
5807
|
x: bounds.x,
|
|
5801
5808
|
y: bounds.y,
|
|
@@ -5858,7 +5865,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5858
5865
|
if (ids.length < 2 || !activeSlide) {
|
|
5859
5866
|
return;
|
|
5860
5867
|
}
|
|
5861
|
-
const { elements, groupId } =
|
|
5868
|
+
const { elements, groupId } = chunkH74UXL4Q_js.groupElements(ops.activeElements, ids, chunkH74UXL4Q_js.generateElementId());
|
|
5862
5869
|
if (groupId === null) {
|
|
5863
5870
|
return;
|
|
5864
5871
|
}
|
|
@@ -5871,12 +5878,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5871
5878
|
return;
|
|
5872
5879
|
}
|
|
5873
5880
|
const group = selectedElement;
|
|
5874
|
-
const intoTemplate =
|
|
5881
|
+
const intoTemplate = chunkH74UXL4Q_js.isTemplateElementId(group.id);
|
|
5875
5882
|
const ungrouped = group.children.map((child) => ({
|
|
5876
5883
|
...structuredClone(child),
|
|
5877
5884
|
// Keep child ids in the same store as the group so later edits route
|
|
5878
5885
|
// correctly: template groups yield template-prefixed child ids.
|
|
5879
|
-
id: intoTemplate ?
|
|
5886
|
+
id: intoTemplate ? chunkH74UXL4Q_js.makeCloneId(true, child.id || group.id) : child.id || chunkH74UXL4Q_js.generateElementId(),
|
|
5880
5887
|
x: child.x + group.x,
|
|
5881
5888
|
y: child.y + group.y
|
|
5882
5889
|
}));
|
|
@@ -5900,7 +5907,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5900
5907
|
if (!edge) {
|
|
5901
5908
|
return;
|
|
5902
5909
|
}
|
|
5903
|
-
const positions =
|
|
5910
|
+
const positions = chunkH74UXL4Q_js.alignElements(selectedElements, edge);
|
|
5904
5911
|
for (const [id, pos] of positions) {
|
|
5905
5912
|
const el = elementLookup.get(id);
|
|
5906
5913
|
if (!el) {
|
|
@@ -5918,7 +5925,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5918
5925
|
if (!distAxis) {
|
|
5919
5926
|
return;
|
|
5920
5927
|
}
|
|
5921
|
-
const positions =
|
|
5928
|
+
const positions = chunkH74UXL4Q_js.distributeElements(selectedElements, distAxis);
|
|
5922
5929
|
for (const [id, pos] of positions) {
|
|
5923
5930
|
const el = elementLookup.get(id);
|
|
5924
5931
|
if (!el) {
|
|
@@ -5935,7 +5942,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5935
5942
|
}
|
|
5936
5943
|
const id = selectedElement.id;
|
|
5937
5944
|
ops.updateActiveElements(
|
|
5938
|
-
(els) => direction === "forward" ?
|
|
5945
|
+
(els) => direction === "forward" ? chunkH74UXL4Q_js.bringForward(els, id) : direction === "backward" ? chunkH74UXL4Q_js.sendBackward(els, id) : els
|
|
5939
5946
|
);
|
|
5940
5947
|
history.markDirty();
|
|
5941
5948
|
};
|
|
@@ -5945,7 +5952,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5945
5952
|
}
|
|
5946
5953
|
const id = selectedElement.id;
|
|
5947
5954
|
ops.updateActiveElements(
|
|
5948
|
-
(els) => direction === "front" ?
|
|
5955
|
+
(els) => direction === "front" ? chunkH74UXL4Q_js.bringToFront(els, id) : chunkH74UXL4Q_js.sendToBack(els, id)
|
|
5949
5956
|
);
|
|
5950
5957
|
history.markDirty();
|
|
5951
5958
|
};
|
|
@@ -6067,7 +6074,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
6067
6074
|
function useSlideManagement(input) {
|
|
6068
6075
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
6069
6076
|
const handleAddSlide = () => {
|
|
6070
|
-
const newSlide =
|
|
6077
|
+
const newSlide = chunkH74UXL4Q_js.createBlankSlide(slides.length + 1);
|
|
6071
6078
|
ops.updateSlides((prev) => {
|
|
6072
6079
|
const next = [...prev];
|
|
6073
6080
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6130,7 +6137,7 @@ function useSlideManagement(input) {
|
|
|
6130
6137
|
}
|
|
6131
6138
|
const clone = {
|
|
6132
6139
|
...src,
|
|
6133
|
-
id:
|
|
6140
|
+
id: chunkH74UXL4Q_js.makeSlideId(),
|
|
6134
6141
|
elements: src.elements.map((el) => ({
|
|
6135
6142
|
...el,
|
|
6136
6143
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6162,7 +6169,7 @@ function useSlideManagement(input) {
|
|
|
6162
6169
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6163
6170
|
const insertAt = activeSlideIndex + 1;
|
|
6164
6171
|
const draft = {
|
|
6165
|
-
...
|
|
6172
|
+
...chunkH74UXL4Q_js.createBlankSlide(slides.length + 1),
|
|
6166
6173
|
layoutPath,
|
|
6167
6174
|
...layoutName ? { layoutName } : {}
|
|
6168
6175
|
};
|
|
@@ -6223,7 +6230,7 @@ function createTableMergeHandlers(input) {
|
|
|
6223
6230
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6224
6231
|
return;
|
|
6225
6232
|
}
|
|
6226
|
-
const newTableData =
|
|
6233
|
+
const newTableData = chunkH74UXL4Q_js.mergeCells(
|
|
6227
6234
|
[
|
|
6228
6235
|
{ row: rowIndex, col: columnIndex },
|
|
6229
6236
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6231,7 +6238,7 @@ function createTableMergeHandlers(input) {
|
|
|
6231
6238
|
td
|
|
6232
6239
|
);
|
|
6233
6240
|
const updates = { tableData: newTableData };
|
|
6234
|
-
const newRawXml =
|
|
6241
|
+
const newRawXml = chunkH74UXL4Q_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6235
6242
|
if (newRawXml) {
|
|
6236
6243
|
updates.rawXml = newRawXml;
|
|
6237
6244
|
}
|
|
@@ -6257,7 +6264,7 @@ function createTableMergeHandlers(input) {
|
|
|
6257
6264
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6258
6265
|
return;
|
|
6259
6266
|
}
|
|
6260
|
-
const newTableData =
|
|
6267
|
+
const newTableData = chunkH74UXL4Q_js.mergeCells(
|
|
6261
6268
|
[
|
|
6262
6269
|
{ row: rowIndex, col: columnIndex },
|
|
6263
6270
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6265,7 +6272,7 @@ function createTableMergeHandlers(input) {
|
|
|
6265
6272
|
td
|
|
6266
6273
|
);
|
|
6267
6274
|
const updates = { tableData: newTableData };
|
|
6268
|
-
const newRawXml =
|
|
6275
|
+
const newRawXml = chunkH74UXL4Q_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6269
6276
|
if (newRawXml) {
|
|
6270
6277
|
updates.rawXml = newRawXml;
|
|
6271
6278
|
}
|
|
@@ -6280,9 +6287,9 @@ function createTableMergeHandlers(input) {
|
|
|
6280
6287
|
return;
|
|
6281
6288
|
}
|
|
6282
6289
|
const td = selectedElement.tableData;
|
|
6283
|
-
const newTableData =
|
|
6290
|
+
const newTableData = chunkH74UXL4Q_js.mergeCells(ts.selectedCells, td);
|
|
6284
6291
|
const updates = { tableData: newTableData };
|
|
6285
|
-
const newRawXml =
|
|
6292
|
+
const newRawXml = chunkH74UXL4Q_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6286
6293
|
if (newRawXml) {
|
|
6287
6294
|
updates.rawXml = newRawXml;
|
|
6288
6295
|
}
|
|
@@ -6299,9 +6306,9 @@ function createTableMergeHandlers(input) {
|
|
|
6299
6306
|
}
|
|
6300
6307
|
const { rowIndex, columnIndex } = ts;
|
|
6301
6308
|
const td = selectedElement.tableData;
|
|
6302
|
-
const newTableData =
|
|
6309
|
+
const newTableData = chunkH74UXL4Q_js.splitCell(rowIndex, columnIndex, td);
|
|
6303
6310
|
const updates = { tableData: newTableData };
|
|
6304
|
-
const newRawXml =
|
|
6311
|
+
const newRawXml = chunkH74UXL4Q_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6305
6312
|
if (newRawXml) {
|
|
6306
6313
|
updates.rawXml = newRawXml;
|
|
6307
6314
|
}
|
|
@@ -6345,7 +6352,7 @@ function createTableStructHandlers(input) {
|
|
|
6345
6352
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
6346
6353
|
}
|
|
6347
6354
|
if (el.rawXml) {
|
|
6348
|
-
const newRawXml =
|
|
6355
|
+
const newRawXml = chunkH74UXL4Q_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6349
6356
|
if (newRawXml) {
|
|
6350
6357
|
updates.rawXml = newRawXml;
|
|
6351
6358
|
}
|
|
@@ -6369,7 +6376,7 @@ function createTableStructHandlers(input) {
|
|
|
6369
6376
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6370
6377
|
const updates = {};
|
|
6371
6378
|
if (selectedElement.rawXml) {
|
|
6372
|
-
const newRawXml =
|
|
6379
|
+
const newRawXml = chunkH74UXL4Q_js.updateCellTextStyleInRawXml(
|
|
6373
6380
|
selectedElement,
|
|
6374
6381
|
rowIndex,
|
|
6375
6382
|
colIndex,
|
|
@@ -6433,9 +6440,9 @@ function createTableStructHandlers(input) {
|
|
|
6433
6440
|
return;
|
|
6434
6441
|
}
|
|
6435
6442
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6436
|
-
const newTableData =
|
|
6443
|
+
const newTableData = chunkH74UXL4Q_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6437
6444
|
const updates = { tableData: newTableData };
|
|
6438
|
-
const newRawXml =
|
|
6445
|
+
const newRawXml = chunkH74UXL4Q_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6439
6446
|
if (newRawXml) {
|
|
6440
6447
|
updates.rawXml = newRawXml;
|
|
6441
6448
|
}
|
|
@@ -6448,12 +6455,12 @@ function createTableStructHandlers(input) {
|
|
|
6448
6455
|
}
|
|
6449
6456
|
const td = selectedElement.tableData;
|
|
6450
6457
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6451
|
-
const newTableData =
|
|
6458
|
+
const newTableData = chunkH74UXL4Q_js.deleteTableRow(td, rowIdx);
|
|
6452
6459
|
if (newTableData === td) {
|
|
6453
6460
|
return;
|
|
6454
6461
|
}
|
|
6455
6462
|
const updates = { tableData: newTableData };
|
|
6456
|
-
const newRawXml =
|
|
6463
|
+
const newRawXml = chunkH74UXL4Q_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6457
6464
|
if (newRawXml) {
|
|
6458
6465
|
updates.rawXml = newRawXml;
|
|
6459
6466
|
}
|
|
@@ -6465,9 +6472,9 @@ function createTableStructHandlers(input) {
|
|
|
6465
6472
|
return;
|
|
6466
6473
|
}
|
|
6467
6474
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6468
|
-
const newTableData =
|
|
6475
|
+
const newTableData = chunkH74UXL4Q_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6469
6476
|
const updates = { tableData: newTableData };
|
|
6470
|
-
const newRawXml =
|
|
6477
|
+
const newRawXml = chunkH74UXL4Q_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6471
6478
|
if (newRawXml) {
|
|
6472
6479
|
updates.rawXml = newRawXml;
|
|
6473
6480
|
}
|
|
@@ -6480,12 +6487,12 @@ function createTableStructHandlers(input) {
|
|
|
6480
6487
|
}
|
|
6481
6488
|
const td = selectedElement.tableData;
|
|
6482
6489
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6483
|
-
const newTableData =
|
|
6490
|
+
const newTableData = chunkH74UXL4Q_js.deleteTableColumn(td, colIdx);
|
|
6484
6491
|
if (newTableData === td) {
|
|
6485
6492
|
return;
|
|
6486
6493
|
}
|
|
6487
6494
|
const updates = { tableData: newTableData };
|
|
6488
|
-
const newRawXml =
|
|
6495
|
+
const newRawXml = chunkH74UXL4Q_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6489
6496
|
if (newRawXml) {
|
|
6490
6497
|
updates.rawXml = newRawXml;
|
|
6491
6498
|
}
|
|
@@ -6521,8 +6528,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6521
6528
|
return html2canvasPro(element, {
|
|
6522
6529
|
...options,
|
|
6523
6530
|
onclone: async (doc, clonedEl) => {
|
|
6524
|
-
await
|
|
6525
|
-
|
|
6531
|
+
await chunkH74UXL4Q_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6532
|
+
chunkH74UXL4Q_js.preprocessCssForCapture(clonedEl);
|
|
6526
6533
|
if (typeof userOnClone === "function") {
|
|
6527
6534
|
userOnClone(doc, clonedEl);
|
|
6528
6535
|
}
|
|
@@ -6578,7 +6585,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6578
6585
|
}
|
|
6579
6586
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6580
6587
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6581
|
-
|
|
6588
|
+
chunkH74UXL4Q_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6582
6589
|
}
|
|
6583
6590
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6584
6591
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6600,15 +6607,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6600
6607
|
continue;
|
|
6601
6608
|
}
|
|
6602
6609
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6603
|
-
images.push(
|
|
6610
|
+
images.push(chunkH74UXL4Q_js.canvasToJpegData(canvas));
|
|
6604
6611
|
}
|
|
6605
6612
|
onProgress?.(totalSlides, totalSlides);
|
|
6606
6613
|
setActiveSlide(currentSlideIndex);
|
|
6607
6614
|
if (images.length === 0) {
|
|
6608
|
-
throw new Error(
|
|
6615
|
+
throw new Error(chunkMMK4K3QI_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6609
6616
|
}
|
|
6610
|
-
const pdfBlobUrl =
|
|
6611
|
-
|
|
6617
|
+
const pdfBlobUrl = chunkIJVDNQLG_js.buildPdfFromImageData(images);
|
|
6618
|
+
chunkH74UXL4Q_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6612
6619
|
}
|
|
6613
6620
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6614
6621
|
const { scale = 2, onProgress } = options;
|
|
@@ -6654,10 +6661,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6654
6661
|
onProgress?.(totalSlides, totalSlides);
|
|
6655
6662
|
setActiveSlide(currentSlideIndex);
|
|
6656
6663
|
if (pages.length === 0) {
|
|
6657
|
-
throw new Error(
|
|
6664
|
+
throw new Error(chunkMMK4K3QI_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6658
6665
|
}
|
|
6659
|
-
const pdfDataUrl =
|
|
6660
|
-
|
|
6666
|
+
const pdfDataUrl = chunkIJVDNQLG_js.buildNotesPdf(pages);
|
|
6667
|
+
chunkH74UXL4Q_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6661
6668
|
}
|
|
6662
6669
|
|
|
6663
6670
|
// src/viewer/utils/export-video.ts
|
|
@@ -6688,7 +6695,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6688
6695
|
}
|
|
6689
6696
|
setActiveSlide(currentSlideIndex);
|
|
6690
6697
|
if (slideCanvases.length === 0) {
|
|
6691
|
-
throw new Error(
|
|
6698
|
+
throw new Error(chunkMMK4K3QI_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
6692
6699
|
}
|
|
6693
6700
|
const firstCanvas = slideCanvases[0];
|
|
6694
6701
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -6696,12 +6703,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6696
6703
|
recordingCanvas.height = firstCanvas.height;
|
|
6697
6704
|
const ctx = recordingCanvas.getContext("2d");
|
|
6698
6705
|
if (!ctx) {
|
|
6699
|
-
throw new Error(
|
|
6706
|
+
throw new Error(chunkMMK4K3QI_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
6700
6707
|
}
|
|
6701
6708
|
const fps = 30;
|
|
6702
6709
|
const stream = recordingCanvas.captureStream(fps);
|
|
6703
6710
|
const recorder = new MediaRecorder(stream, {
|
|
6704
|
-
mimeType:
|
|
6711
|
+
mimeType: chunkH74UXL4Q_js.pickSupportedMimeType([...chunkH74UXL4Q_js.WEBM_MIME_CANDIDATES]),
|
|
6705
6712
|
videoBitsPerSecond: 5e6
|
|
6706
6713
|
});
|
|
6707
6714
|
const chunks = [];
|
|
@@ -6724,8 +6731,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6724
6731
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6725
6732
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6726
6733
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6727
|
-
const frameInterval =
|
|
6728
|
-
const framesNeeded =
|
|
6734
|
+
const frameInterval = chunkH74UXL4Q_js.fpsToFrameIntervalMs(fps);
|
|
6735
|
+
const framesNeeded = chunkH74UXL4Q_js.segmentFrameCount(duration, fps);
|
|
6729
6736
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6730
6737
|
if (signal?.aborted) {
|
|
6731
6738
|
recorder.stop();
|
|
@@ -6772,9 +6779,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6772
6779
|
}
|
|
6773
6780
|
setActiveSlide(currentSlideIndex);
|
|
6774
6781
|
if (frames.length === 0) {
|
|
6775
|
-
throw new Error(
|
|
6782
|
+
throw new Error(chunkMMK4K3QI_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6776
6783
|
}
|
|
6777
|
-
const gifBytes =
|
|
6784
|
+
const gifBytes = chunkH74UXL4Q_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6778
6785
|
onProgress?.(totalSlides, totalSlides);
|
|
6779
6786
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6780
6787
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6828,7 +6835,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6828
6835
|
continue;
|
|
6829
6836
|
}
|
|
6830
6837
|
onProgress?.(processedCount, data.slides.length);
|
|
6831
|
-
let svg =
|
|
6838
|
+
let svg = chunkH74UXL4Q_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6832
6839
|
if (embedFonts && fontFaces?.length) {
|
|
6833
6840
|
svg = injectFontFaces(svg, fontFaces);
|
|
6834
6841
|
}
|
|
@@ -6888,7 +6895,7 @@ function useExportSaveAs(input) {
|
|
|
6888
6895
|
}
|
|
6889
6896
|
setExportProgress(70);
|
|
6890
6897
|
setExportStatusMessage("Writing README...");
|
|
6891
|
-
const readme =
|
|
6898
|
+
const readme = chunkH74UXL4Q_js.generatePackageReadme(pptxFilename);
|
|
6892
6899
|
pkgFolder.file("README.txt", readme);
|
|
6893
6900
|
if (abortCtrl.signal.aborted) {
|
|
6894
6901
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -6899,7 +6906,7 @@ function useExportSaveAs(input) {
|
|
|
6899
6906
|
setExportProgress(95);
|
|
6900
6907
|
setExportStatusMessage("Downloading...");
|
|
6901
6908
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
6902
|
-
|
|
6909
|
+
chunkH74UXL4Q_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
6903
6910
|
setExportProgress(100);
|
|
6904
6911
|
} catch (err) {
|
|
6905
6912
|
if (err.name !== "AbortError") {
|
|
@@ -6922,7 +6929,7 @@ function useExportSaveAs(input) {
|
|
|
6922
6929
|
const blob = new Blob([data], {
|
|
6923
6930
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6924
6931
|
});
|
|
6925
|
-
|
|
6932
|
+
chunkH74UXL4Q_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
6926
6933
|
} catch (err) {
|
|
6927
6934
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
6928
6935
|
}
|
|
@@ -6935,14 +6942,14 @@ function useExportSaveAs(input) {
|
|
|
6935
6942
|
const pptxGuides = guides.map((g) => ({
|
|
6936
6943
|
id: g.id,
|
|
6937
6944
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
6938
|
-
positionEmu:
|
|
6945
|
+
positionEmu: chunkH74UXL4Q_js.guidePxToEmu(g.position)
|
|
6939
6946
|
}));
|
|
6940
6947
|
return {
|
|
6941
6948
|
...slide,
|
|
6942
6949
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
6943
6950
|
};
|
|
6944
6951
|
});
|
|
6945
|
-
const slidesToSave =
|
|
6952
|
+
const slidesToSave = chunkIJVDNQLG_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
6946
6953
|
const saveOptions = {
|
|
6947
6954
|
headerFooter,
|
|
6948
6955
|
presentationProperties,
|
|
@@ -6999,7 +7006,7 @@ function safeConfirm(message) {
|
|
|
6999
7006
|
}
|
|
7000
7007
|
}
|
|
7001
7008
|
function downloadBlob2(blob, filename) {
|
|
7002
|
-
|
|
7009
|
+
chunkH74UXL4Q_js.downloadBlob(blob, chunkH74UXL4Q_js.sanitizeDownloadFilename(filename));
|
|
7003
7010
|
}
|
|
7004
7011
|
|
|
7005
7012
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7100,21 +7107,21 @@ function useExportHandlers(input) {
|
|
|
7100
7107
|
{
|
|
7101
7108
|
scale: 2,
|
|
7102
7109
|
onProgress: (current, total) => {
|
|
7103
|
-
setExportProgress(
|
|
7104
|
-
setExportStatusMessage(
|
|
7110
|
+
setExportProgress(chunkH74UXL4Q_js.slideProgressPercent(current, total));
|
|
7111
|
+
setExportStatusMessage(chunkH74UXL4Q_js.slideStatusLabel("Rendering", current, total));
|
|
7105
7112
|
},
|
|
7106
7113
|
signal: abortCtrl.signal
|
|
7107
7114
|
}
|
|
7108
7115
|
);
|
|
7109
|
-
setExportProgress(
|
|
7116
|
+
setExportProgress(chunkH74UXL4Q_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7110
7117
|
setExportStatusMessage("Building PDF...");
|
|
7111
7118
|
await new Promise((r) => {
|
|
7112
7119
|
setTimeout(r, 100);
|
|
7113
7120
|
});
|
|
7114
|
-
setExportProgress(
|
|
7121
|
+
setExportProgress(chunkH74UXL4Q_js.EXPORT_DONE_PERCENT);
|
|
7115
7122
|
setExportStatusMessage("Done!");
|
|
7116
7123
|
} catch (err) {
|
|
7117
|
-
if (!
|
|
7124
|
+
if (!chunkH74UXL4Q_js.isExportAbortError(err)) {
|
|
7118
7125
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7119
7126
|
}
|
|
7120
7127
|
} finally {
|
|
@@ -7144,21 +7151,21 @@ function useExportHandlers(input) {
|
|
|
7144
7151
|
{
|
|
7145
7152
|
scale: 2,
|
|
7146
7153
|
onProgress: (current, total) => {
|
|
7147
|
-
setExportProgress(
|
|
7148
|
-
setExportStatusMessage(
|
|
7154
|
+
setExportProgress(chunkH74UXL4Q_js.slideProgressPercent(current, total));
|
|
7155
|
+
setExportStatusMessage(chunkH74UXL4Q_js.slideStatusLabel("Rendering", current, total));
|
|
7149
7156
|
},
|
|
7150
7157
|
signal: abortCtrl.signal
|
|
7151
7158
|
}
|
|
7152
7159
|
);
|
|
7153
|
-
setExportProgress(
|
|
7160
|
+
setExportProgress(chunkH74UXL4Q_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7154
7161
|
setExportStatusMessage("Building PDF...");
|
|
7155
7162
|
await new Promise((r) => {
|
|
7156
7163
|
setTimeout(r, 100);
|
|
7157
7164
|
});
|
|
7158
|
-
setExportProgress(
|
|
7165
|
+
setExportProgress(chunkH74UXL4Q_js.EXPORT_DONE_PERCENT);
|
|
7159
7166
|
setExportStatusMessage("Done!");
|
|
7160
7167
|
} catch (err) {
|
|
7161
|
-
if (!
|
|
7168
|
+
if (!chunkH74UXL4Q_js.isExportAbortError(err)) {
|
|
7162
7169
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7163
7170
|
}
|
|
7164
7171
|
} finally {
|
|
@@ -7199,22 +7206,22 @@ function useExportHandlers(input) {
|
|
|
7199
7206
|
scale: 1,
|
|
7200
7207
|
slideDurationMs: 3e3,
|
|
7201
7208
|
onProgress: (current, total) => {
|
|
7202
|
-
setExportProgress(
|
|
7203
|
-
setExportStatusMessage(
|
|
7209
|
+
setExportProgress(chunkH74UXL4Q_js.slideProgressPercent(current, total, 45));
|
|
7210
|
+
setExportStatusMessage(chunkH74UXL4Q_js.slideStatusLabel("Capturing", current, total));
|
|
7204
7211
|
},
|
|
7205
7212
|
onRecordProgress: (current, total) => {
|
|
7206
|
-
setExportProgress(
|
|
7207
|
-
setExportStatusMessage(
|
|
7213
|
+
setExportProgress(chunkH74UXL4Q_js.recordProgressPercent(current, total));
|
|
7214
|
+
setExportStatusMessage(chunkH74UXL4Q_js.slideStatusLabel("Recording", current, total));
|
|
7208
7215
|
},
|
|
7209
7216
|
signal: abortCtrl.signal
|
|
7210
7217
|
}
|
|
7211
7218
|
);
|
|
7212
|
-
setExportProgress(
|
|
7219
|
+
setExportProgress(chunkH74UXL4Q_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7213
7220
|
setExportStatusMessage("Saving file...");
|
|
7214
7221
|
downloadBlob2(blob, "presentation.webm");
|
|
7215
|
-
setExportProgress(
|
|
7222
|
+
setExportProgress(chunkH74UXL4Q_js.EXPORT_DONE_PERCENT);
|
|
7216
7223
|
} catch (err) {
|
|
7217
|
-
if (!
|
|
7224
|
+
if (!chunkH74UXL4Q_js.isExportAbortError(err)) {
|
|
7218
7225
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7219
7226
|
}
|
|
7220
7227
|
} finally {
|
|
@@ -7242,18 +7249,18 @@ function useExportHandlers(input) {
|
|
|
7242
7249
|
scale: 0.5,
|
|
7243
7250
|
slideDurationMs: 2e3,
|
|
7244
7251
|
onProgress: (current, total) => {
|
|
7245
|
-
setExportProgress(
|
|
7246
|
-
setExportStatusMessage(
|
|
7252
|
+
setExportProgress(chunkH74UXL4Q_js.slideProgressPercent(current, total));
|
|
7253
|
+
setExportStatusMessage(chunkH74UXL4Q_js.slideStatusLabel("Encoding", current, total));
|
|
7247
7254
|
},
|
|
7248
7255
|
signal: abortCtrl.signal
|
|
7249
7256
|
}
|
|
7250
7257
|
);
|
|
7251
|
-
setExportProgress(
|
|
7258
|
+
setExportProgress(chunkH74UXL4Q_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7252
7259
|
setExportStatusMessage("Saving file...");
|
|
7253
7260
|
downloadBlob2(blob, "presentation.gif");
|
|
7254
|
-
setExportProgress(
|
|
7261
|
+
setExportProgress(chunkH74UXL4Q_js.EXPORT_DONE_PERCENT);
|
|
7255
7262
|
} catch (err) {
|
|
7256
|
-
if (!
|
|
7263
|
+
if (!chunkH74UXL4Q_js.isExportAbortError(err)) {
|
|
7257
7264
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7258
7265
|
}
|
|
7259
7266
|
} finally {
|
|
@@ -7293,7 +7300,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7293
7300
|
}
|
|
7294
7301
|
printWindow.document.open();
|
|
7295
7302
|
printWindow.document.write(
|
|
7296
|
-
|
|
7303
|
+
chunkH74UXL4Q_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7297
7304
|
);
|
|
7298
7305
|
printWindow.document.close();
|
|
7299
7306
|
printWindow.focus();
|
|
@@ -7354,7 +7361,7 @@ function usePrintHandlers(input) {
|
|
|
7354
7361
|
if (svgs.length === 0) {
|
|
7355
7362
|
return;
|
|
7356
7363
|
}
|
|
7357
|
-
const printDoc =
|
|
7364
|
+
const printDoc = chunkH74UXL4Q_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7358
7365
|
title: "Slides (Vector)",
|
|
7359
7366
|
orientation: settings.orientation,
|
|
7360
7367
|
colorFilter
|
|
@@ -7390,7 +7397,7 @@ function usePrintHandlers(input) {
|
|
|
7390
7397
|
if (settings.printWhat === "outline") {
|
|
7391
7398
|
openPrintWindow(
|
|
7392
7399
|
"Outline",
|
|
7393
|
-
`<div class="outline-page">${
|
|
7400
|
+
`<div class="outline-page">${chunkH74UXL4Q_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7394
7401
|
settings.orientation,
|
|
7395
7402
|
colorFilter,
|
|
7396
7403
|
settings.frameSlides
|
|
@@ -7415,7 +7422,7 @@ function usePrintHandlers(input) {
|
|
|
7415
7422
|
if (settings.printWhat === "slides") {
|
|
7416
7423
|
openPrintWindow(
|
|
7417
7424
|
"Slides",
|
|
7418
|
-
|
|
7425
|
+
chunkH74UXL4Q_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7419
7426
|
settings.orientation,
|
|
7420
7427
|
colorFilter,
|
|
7421
7428
|
settings.frameSlides
|
|
@@ -7425,7 +7432,7 @@ function usePrintHandlers(input) {
|
|
|
7425
7432
|
if (settings.printWhat === "notes") {
|
|
7426
7433
|
openPrintWindow(
|
|
7427
7434
|
"Notes Pages",
|
|
7428
|
-
|
|
7435
|
+
chunkH74UXL4Q_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7429
7436
|
"portrait",
|
|
7430
7437
|
colorFilter,
|
|
7431
7438
|
settings.frameSlides
|
|
@@ -7436,7 +7443,7 @@ function usePrintHandlers(input) {
|
|
|
7436
7443
|
const spp = settings.slidesPerPage;
|
|
7437
7444
|
openPrintWindow(
|
|
7438
7445
|
`Handout ${spp} per page`,
|
|
7439
|
-
|
|
7446
|
+
chunkH74UXL4Q_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7440
7447
|
"portrait",
|
|
7441
7448
|
colorFilter,
|
|
7442
7449
|
settings.frameSlides
|
|
@@ -7500,8 +7507,8 @@ function useThemeHandlers(input) {
|
|
|
7500
7507
|
return;
|
|
7501
7508
|
}
|
|
7502
7509
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7503
|
-
const previousMap = theme?.colorScheme ?
|
|
7504
|
-
setSlides((prev) =>
|
|
7510
|
+
const previousMap = theme?.colorScheme ? chunkH74UXL4Q_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7511
|
+
setSlides((prev) => chunkH74UXL4Q_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7505
7512
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7506
7513
|
bumpHistory();
|
|
7507
7514
|
history.markDirty();
|
|
@@ -7606,7 +7613,7 @@ function useThemeSwitching(input) {
|
|
|
7606
7613
|
}
|
|
7607
7614
|
try {
|
|
7608
7615
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7609
|
-
const newData =
|
|
7616
|
+
const newData = chunkH74UXL4Q_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7610
7617
|
onDataChange(newData);
|
|
7611
7618
|
onThemeChanged?.(preset);
|
|
7612
7619
|
} catch (error) {
|
|
@@ -7623,7 +7630,7 @@ function useThemeSwitching(input) {
|
|
|
7623
7630
|
}
|
|
7624
7631
|
try {
|
|
7625
7632
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7626
|
-
const newData =
|
|
7633
|
+
const newData = chunkH74UXL4Q_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7627
7634
|
onDataChange(newData);
|
|
7628
7635
|
} catch (error) {
|
|
7629
7636
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7635,12 +7642,12 @@ function useThemeSwitching(input) {
|
|
|
7635
7642
|
if (!data?.theme?.colorScheme) {
|
|
7636
7643
|
return void 0;
|
|
7637
7644
|
}
|
|
7638
|
-
return
|
|
7639
|
-
(p) =>
|
|
7645
|
+
return chunkH74UXL4Q_js.THEME_PRESETS.find(
|
|
7646
|
+
(p) => chunkH74UXL4Q_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7640
7647
|
);
|
|
7641
7648
|
}, [data?.theme?.colorScheme]);
|
|
7642
7649
|
return {
|
|
7643
|
-
presets:
|
|
7650
|
+
presets: chunkH74UXL4Q_js.THEME_PRESETS,
|
|
7644
7651
|
switchToPreset,
|
|
7645
7652
|
switchToCustom,
|
|
7646
7653
|
currentPreset
|
|
@@ -7715,7 +7722,7 @@ function usePropertyHandlers(input) {
|
|
|
7715
7722
|
}
|
|
7716
7723
|
try {
|
|
7717
7724
|
const ab = await file.arrayBuffer();
|
|
7718
|
-
const h = new
|
|
7725
|
+
const h = new chunkH74UXL4Q_js.PptxHandler();
|
|
7719
7726
|
const other = await h.load(ab);
|
|
7720
7727
|
if (!other) {
|
|
7721
7728
|
return;
|
|
@@ -7725,7 +7732,7 @@ function usePropertyHandlers(input) {
|
|
|
7725
7732
|
width: canvasSize.width,
|
|
7726
7733
|
height: canvasSize.height
|
|
7727
7734
|
};
|
|
7728
|
-
setCompareResult(
|
|
7735
|
+
setCompareResult(chunkH74UXL4Q_js.comparePresentation(cur, other));
|
|
7729
7736
|
setIsComparePanelOpen(true);
|
|
7730
7737
|
} catch (err) {
|
|
7731
7738
|
console.warn("Compare failed:", err);
|
|
@@ -7742,7 +7749,7 @@ function usePropertyHandlers(input) {
|
|
|
7742
7749
|
if (!diff || diff.status === "unchanged") {
|
|
7743
7750
|
return;
|
|
7744
7751
|
}
|
|
7745
|
-
setSlides((prev) =>
|
|
7752
|
+
setSlides((prev) => chunkH74UXL4Q_js.applyAcceptSlide(prev, diff));
|
|
7746
7753
|
setIsDirty(true);
|
|
7747
7754
|
},
|
|
7748
7755
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7753,10 +7760,10 @@ function usePropertyHandlers(input) {
|
|
|
7753
7760
|
if (!compareResult) {
|
|
7754
7761
|
return;
|
|
7755
7762
|
}
|
|
7756
|
-
setSlides((prev) =>
|
|
7763
|
+
setSlides((prev) => chunkH74UXL4Q_js.applyAcceptAllSlides(prev, compareResult));
|
|
7757
7764
|
setIsDirty(true);
|
|
7758
7765
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7759
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7766
|
+
const usedFontFamilies = react.useMemo(() => chunkH74UXL4Q_js.collectUsedFonts(slides), [slides]);
|
|
7760
7767
|
return {
|
|
7761
7768
|
handleUpdateNotes,
|
|
7762
7769
|
handleUpdateSlide,
|
|
@@ -7875,7 +7882,7 @@ function useIsMobile(input) {
|
|
|
7875
7882
|
const containerRef = input?.containerRef;
|
|
7876
7883
|
const isTouchDevice = react.useSyncExternalStore(
|
|
7877
7884
|
subscribeTouchCapability,
|
|
7878
|
-
|
|
7885
|
+
chunkH74UXL4Q_js.detectTouchDevice,
|
|
7879
7886
|
() => false
|
|
7880
7887
|
// server snapshot
|
|
7881
7888
|
);
|
|
@@ -7891,7 +7898,7 @@ function useIsMobile(input) {
|
|
|
7891
7898
|
}
|
|
7892
7899
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
7893
7900
|
});
|
|
7894
|
-
const [orientation, setOrientation] = react.useState(
|
|
7901
|
+
const [orientation, setOrientation] = react.useState(chunkH74UXL4Q_js.detectOrientation);
|
|
7895
7902
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
7896
7903
|
const [initialViewportHeight] = react.useState(
|
|
7897
7904
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -7935,7 +7942,7 @@ function useIsMobile(input) {
|
|
|
7935
7942
|
return;
|
|
7936
7943
|
}
|
|
7937
7944
|
const handleOrientationChange = () => {
|
|
7938
|
-
setOrientation(
|
|
7945
|
+
setOrientation(chunkH74UXL4Q_js.detectOrientation());
|
|
7939
7946
|
};
|
|
7940
7947
|
if (screen.orientation) {
|
|
7941
7948
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -7965,9 +7972,9 @@ function useIsMobile(input) {
|
|
|
7965
7972
|
window.addEventListener("resize", handleResize);
|
|
7966
7973
|
return () => window.removeEventListener("resize", handleResize);
|
|
7967
7974
|
}, [isTouchDevice, initialViewportHeight]);
|
|
7968
|
-
const isMobile =
|
|
7969
|
-
const isTablet = !isMobile && containerWidth >=
|
|
7970
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
7975
|
+
const isMobile = chunkH74UXL4Q_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
7976
|
+
const isTablet = !isMobile && containerWidth >= chunkH74UXL4Q_js.MOBILE_BREAKPOINT && containerWidth < chunkH74UXL4Q_js.TABLET_BREAKPOINT;
|
|
7977
|
+
const isDesktop = !isMobile && containerWidth >= chunkH74UXL4Q_js.TABLET_BREAKPOINT;
|
|
7971
7978
|
return {
|
|
7972
7979
|
isMobile,
|
|
7973
7980
|
isTablet,
|
|
@@ -8028,11 +8035,11 @@ function useViewerDialogs(input) {
|
|
|
8028
8035
|
);
|
|
8029
8036
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(false);
|
|
8030
8037
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8031
|
-
() => typeof window !== "undefined" ?
|
|
8038
|
+
() => typeof window !== "undefined" ? chunkH74UXL4Q_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8032
8039
|
);
|
|
8033
8040
|
react.useEffect(() => {
|
|
8034
8041
|
const handleWindow = () => setIsNarrowViewport(
|
|
8035
|
-
|
|
8042
|
+
chunkH74UXL4Q_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8036
8043
|
);
|
|
8037
8044
|
let observer = null;
|
|
8038
8045
|
let raf = 0;
|
|
@@ -8046,12 +8053,12 @@ function useViewerDialogs(input) {
|
|
|
8046
8053
|
const entry = entries[0];
|
|
8047
8054
|
if (entry) {
|
|
8048
8055
|
setIsNarrowViewport(
|
|
8049
|
-
|
|
8056
|
+
chunkH74UXL4Q_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8050
8057
|
);
|
|
8051
8058
|
}
|
|
8052
8059
|
});
|
|
8053
8060
|
observer.observe(el);
|
|
8054
|
-
setIsNarrowViewport(
|
|
8061
|
+
setIsNarrowViewport(chunkH74UXL4Q_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8055
8062
|
};
|
|
8056
8063
|
attach();
|
|
8057
8064
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8209,12 +8216,12 @@ function useViewerDialogs(input) {
|
|
|
8209
8216
|
}
|
|
8210
8217
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8211
8218
|
if (presentationGridSpacing) {
|
|
8212
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8219
|
+
const px = Math.round(presentationGridSpacing.cx / chunkIJVDNQLG_js.EMU_PER_PX);
|
|
8213
8220
|
if (px > 0) {
|
|
8214
8221
|
return px;
|
|
8215
8222
|
}
|
|
8216
8223
|
}
|
|
8217
|
-
return
|
|
8224
|
+
return chunkIJVDNQLG_js.GRID_SIZE;
|
|
8218
8225
|
}
|
|
8219
8226
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8220
8227
|
if (activeCustomShowId) {
|
|
@@ -8228,8 +8235,8 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
|
8228
8235
|
return slides.map((_, i) => i).filter((i) => !slides[i]?.hidden);
|
|
8229
8236
|
}
|
|
8230
8237
|
function computeSlideSectionGroups(slides, sections) {
|
|
8231
|
-
return
|
|
8232
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8238
|
+
return chunkH74UXL4Q_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8239
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkIJVDNQLG_js.UNGROUPED_SECTION_ID : "default"),
|
|
8233
8240
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8234
8241
|
slideIndexes: group.slideIndexes,
|
|
8235
8242
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8284,7 +8291,7 @@ function useDerivedSlideState(input) {
|
|
|
8284
8291
|
);
|
|
8285
8292
|
const slideSectionGroups = react.useMemo(
|
|
8286
8293
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8287
|
-
if (group.id ===
|
|
8294
|
+
if (group.id === chunkIJVDNQLG_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8288
8295
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8289
8296
|
}
|
|
8290
8297
|
if (group.id === "default" && group.label === "Slides") {
|
|
@@ -8387,13 +8394,13 @@ function useAnnotationHandlers(input) {
|
|
|
8387
8394
|
}, [annotations, setMode, setSlides, history]);
|
|
8388
8395
|
const handleSetMode = react.useCallback(
|
|
8389
8396
|
(nextMode) => {
|
|
8390
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8397
|
+
if (mode === "present" && nextMode !== "present" && !chunkH74UXL4Q_js.mayLeaveSlideShow()) {
|
|
8391
8398
|
return;
|
|
8392
8399
|
}
|
|
8393
8400
|
if (nextMode === "present") {
|
|
8394
8401
|
presentation.enterPresentMode();
|
|
8395
8402
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8396
|
-
|
|
8403
|
+
chunkIJVDNQLG_js.stopAllPersistentAudio();
|
|
8397
8404
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8398
8405
|
if (promptKeepInkAnnotations) {
|
|
8399
8406
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8402,7 +8409,7 @@ function useAnnotationHandlers(input) {
|
|
|
8402
8409
|
}
|
|
8403
8410
|
} else {
|
|
8404
8411
|
if (mode === "present") {
|
|
8405
|
-
|
|
8412
|
+
chunkIJVDNQLG_js.stopAllPersistentAudio();
|
|
8406
8413
|
}
|
|
8407
8414
|
setMode(nextMode);
|
|
8408
8415
|
}
|
|
@@ -8468,13 +8475,13 @@ function useSerialize(input) {
|
|
|
8468
8475
|
let processedSlide = slide;
|
|
8469
8476
|
if (pendingEditId) {
|
|
8470
8477
|
const updatedElements = slide.elements.map((el) => {
|
|
8471
|
-
if (el.id !== pendingEditId || !
|
|
8478
|
+
if (el.id !== pendingEditId || !chunkH74UXL4Q_js.hasTextProperties(el)) {
|
|
8472
8479
|
return el;
|
|
8473
8480
|
}
|
|
8474
8481
|
return {
|
|
8475
8482
|
...el,
|
|
8476
8483
|
text: pendingEditText,
|
|
8477
|
-
textSegments:
|
|
8484
|
+
textSegments: chunkH74UXL4Q_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8478
8485
|
};
|
|
8479
8486
|
});
|
|
8480
8487
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8487,14 +8494,14 @@ function useSerialize(input) {
|
|
|
8487
8494
|
const pptxGuides = guides.map((g) => ({
|
|
8488
8495
|
id: g.id,
|
|
8489
8496
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8490
|
-
positionEmu:
|
|
8497
|
+
positionEmu: chunkH74UXL4Q_js.guidePxToEmu(g.position)
|
|
8491
8498
|
}));
|
|
8492
8499
|
return {
|
|
8493
8500
|
...processedSlide,
|
|
8494
8501
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8495
8502
|
};
|
|
8496
8503
|
});
|
|
8497
|
-
const slidesToSave =
|
|
8504
|
+
const slidesToSave = chunkIJVDNQLG_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8498
8505
|
const saveOptions = {
|
|
8499
8506
|
headerFooter,
|
|
8500
8507
|
presentationProperties,
|
|
@@ -8663,7 +8670,7 @@ function usePresentationSetup(input) {
|
|
|
8663
8670
|
containerRef,
|
|
8664
8671
|
content,
|
|
8665
8672
|
onSetMode: (nextMode) => {
|
|
8666
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8673
|
+
if (mode === "present" && nextMode !== "present" && !chunkH74UXL4Q_js.mayLeaveSlideShow()) {
|
|
8667
8674
|
return;
|
|
8668
8675
|
}
|
|
8669
8676
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8671,7 +8678,7 @@ function usePresentationSetup(input) {
|
|
|
8671
8678
|
setShowKeepAnnotationsDialog(true);
|
|
8672
8679
|
} else {
|
|
8673
8680
|
if (mode === "present" && nextMode !== "present") {
|
|
8674
|
-
|
|
8681
|
+
chunkIJVDNQLG_js.stopAllPersistentAudio();
|
|
8675
8682
|
stopAnimationSound();
|
|
8676
8683
|
}
|
|
8677
8684
|
setMode(nextMode);
|
|
@@ -8725,10 +8732,10 @@ function usePresentationSetup(input) {
|
|
|
8725
8732
|
onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
|
|
8726
8733
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8727
8734
|
onSaveRehearsalTimings: (timings) => {
|
|
8728
|
-
setSlides((prev) =>
|
|
8735
|
+
setSlides((prev) => chunkH74UXL4Q_js.applyRehearsalTimings(prev, timings));
|
|
8729
8736
|
history.markDirty();
|
|
8730
8737
|
},
|
|
8731
|
-
loopContinuously:
|
|
8738
|
+
loopContinuously: chunkH74UXL4Q_js.shouldLoopContinuously(presentationProperties),
|
|
8732
8739
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8733
8740
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8734
8741
|
endWithBlackSlide
|
|
@@ -8890,7 +8897,7 @@ function useEditorOperations(input) {
|
|
|
8890
8897
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
8891
8898
|
react.useEffect(() => {
|
|
8892
8899
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
8893
|
-
copiedFormatRef.current =
|
|
8900
|
+
copiedFormatRef.current = chunkH74UXL4Q_js.copyFormatFromElement(selectedElement);
|
|
8894
8901
|
} else if (!formatPainterActive) {
|
|
8895
8902
|
copiedFormatRef.current = null;
|
|
8896
8903
|
}
|
|
@@ -8916,12 +8923,12 @@ function useEditorOperations(input) {
|
|
|
8916
8923
|
e.stopPropagation();
|
|
8917
8924
|
const element = elementLookup.get(elementId);
|
|
8918
8925
|
if (element) {
|
|
8919
|
-
const updated =
|
|
8926
|
+
const updated = chunkH74UXL4Q_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
8920
8927
|
const updates = {};
|
|
8921
|
-
if (
|
|
8928
|
+
if (chunkH74UXL4Q_js.hasShapeProperties(updated)) {
|
|
8922
8929
|
updates.shapeStyle = updated.shapeStyle;
|
|
8923
8930
|
}
|
|
8924
|
-
if (
|
|
8931
|
+
if (chunkH74UXL4Q_js.hasTextProperties(updated)) {
|
|
8925
8932
|
updates.textStyle = updated.textStyle;
|
|
8926
8933
|
}
|
|
8927
8934
|
ops.updateElementById(elementId, updates);
|
|
@@ -9068,7 +9075,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9068
9075
|
const families = /* @__PURE__ */ new Set();
|
|
9069
9076
|
for (const slide of slides) {
|
|
9070
9077
|
for (const el of slide.elements) {
|
|
9071
|
-
if (
|
|
9078
|
+
if (chunkH74UXL4Q_js.hasTextProperties(el) && el.textSegments) {
|
|
9072
9079
|
for (const seg of el.textSegments) {
|
|
9073
9080
|
if (seg.style.fontFamily) {
|
|
9074
9081
|
families.add(seg.style.fontFamily);
|
|
@@ -9275,140 +9282,77 @@ function useContentLifecycle(input) {
|
|
|
9275
9282
|
});
|
|
9276
9283
|
return { handlerRef, serializeSlides, autosaveStatus };
|
|
9277
9284
|
}
|
|
9278
|
-
var NUDGE_SMALL = 2;
|
|
9279
|
-
var NUDGE_LARGE = 20;
|
|
9280
9285
|
function useKeyboardShortcuts(input) {
|
|
9281
9286
|
const inputRef = react.useRef(input);
|
|
9282
9287
|
inputRef.current = input;
|
|
9283
9288
|
const handleKeyDown = react.useCallback((e) => {
|
|
9284
|
-
const
|
|
9285
|
-
|
|
9286
|
-
canEdit,
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
|
|
9294
|
-
onPaste,
|
|
9295
|
-
onDuplicate,
|
|
9296
|
-
onUndo,
|
|
9297
|
-
onRedo,
|
|
9298
|
-
onSelectAll,
|
|
9299
|
-
onEscape,
|
|
9300
|
-
onNudge,
|
|
9301
|
-
onPrevSlide,
|
|
9302
|
-
onNextSlide
|
|
9303
|
-
} = inputRef.current;
|
|
9304
|
-
if (mode !== "edit" || !canEdit) {
|
|
9305
|
-
return;
|
|
9306
|
-
}
|
|
9307
|
-
const target = e.target;
|
|
9308
|
-
const isTextInput = target?.tagName === "INPUT" || target?.tagName === "TEXTAREA" || target?.isContentEditable;
|
|
9309
|
-
if (e.key === "Escape") {
|
|
9310
|
-
e.preventDefault();
|
|
9311
|
-
onEscape();
|
|
9312
|
-
return;
|
|
9313
|
-
}
|
|
9314
|
-
if (inlineEditingElementId || tableEditorState?.isEditing || activeTool !== "select") {
|
|
9315
|
-
return;
|
|
9316
|
-
}
|
|
9317
|
-
if (isTextInput) {
|
|
9318
|
-
return;
|
|
9319
|
-
}
|
|
9320
|
-
const isMod = e.metaKey || e.ctrlKey;
|
|
9321
|
-
if ((e.key === "Delete" || e.key === "Backspace") && hasSelection) {
|
|
9322
|
-
e.preventDefault();
|
|
9323
|
-
onDelete();
|
|
9324
|
-
return;
|
|
9325
|
-
}
|
|
9326
|
-
if (isMod) {
|
|
9327
|
-
switch (e.key.toLowerCase()) {
|
|
9328
|
-
case "z":
|
|
9329
|
-
e.preventDefault();
|
|
9330
|
-
if (e.shiftKey) {
|
|
9331
|
-
onRedo();
|
|
9332
|
-
} else {
|
|
9333
|
-
onUndo();
|
|
9334
|
-
}
|
|
9335
|
-
return;
|
|
9336
|
-
case "y":
|
|
9337
|
-
e.preventDefault();
|
|
9338
|
-
onRedo();
|
|
9339
|
-
return;
|
|
9340
|
-
case "c":
|
|
9341
|
-
if (hasSelection) {
|
|
9342
|
-
e.preventDefault();
|
|
9343
|
-
onCopy();
|
|
9344
|
-
}
|
|
9345
|
-
return;
|
|
9346
|
-
case "x":
|
|
9347
|
-
if (hasSelection) {
|
|
9348
|
-
e.preventDefault();
|
|
9349
|
-
onCut();
|
|
9350
|
-
}
|
|
9351
|
-
return;
|
|
9352
|
-
case "v":
|
|
9353
|
-
e.preventDefault();
|
|
9354
|
-
onPaste();
|
|
9355
|
-
return;
|
|
9356
|
-
case "d":
|
|
9357
|
-
if (hasSelection) {
|
|
9358
|
-
e.preventDefault();
|
|
9359
|
-
onDuplicate();
|
|
9360
|
-
}
|
|
9361
|
-
return;
|
|
9362
|
-
case "a":
|
|
9363
|
-
e.preventDefault();
|
|
9364
|
-
onSelectAll();
|
|
9365
|
-
return;
|
|
9366
|
-
}
|
|
9367
|
-
}
|
|
9368
|
-
if (hasSelection && (e.key === "ArrowUp" || e.key === "ArrowDown" || e.key === "ArrowLeft" || e.key === "ArrowRight")) {
|
|
9369
|
-
e.preventDefault();
|
|
9370
|
-
const step = e.shiftKey ? NUDGE_LARGE : NUDGE_SMALL;
|
|
9371
|
-
let dx = 0;
|
|
9372
|
-
let dy = 0;
|
|
9373
|
-
switch (e.key) {
|
|
9374
|
-
case "ArrowUp":
|
|
9375
|
-
dy = -step;
|
|
9376
|
-
break;
|
|
9377
|
-
case "ArrowDown":
|
|
9378
|
-
dy = step;
|
|
9379
|
-
break;
|
|
9380
|
-
case "ArrowLeft":
|
|
9381
|
-
dx = -step;
|
|
9382
|
-
break;
|
|
9383
|
-
case "ArrowRight":
|
|
9384
|
-
dx = step;
|
|
9385
|
-
break;
|
|
9386
|
-
}
|
|
9387
|
-
onNudge(dx, dy);
|
|
9289
|
+
const current = inputRef.current;
|
|
9290
|
+
const { action, dx, dy } = chunkH74UXL4Q_js.mapEditorKey(e, {
|
|
9291
|
+
canEdit: current.canEdit,
|
|
9292
|
+
isPresenting: current.mode !== "edit",
|
|
9293
|
+
hasSelection: current.hasSelection,
|
|
9294
|
+
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9295
|
+
isDrawing: current.activeTool !== "select",
|
|
9296
|
+
isTextInputTarget: chunkH74UXL4Q_js.isEditorTextInputTarget(e.target)
|
|
9297
|
+
});
|
|
9298
|
+
if (action === null) {
|
|
9388
9299
|
return;
|
|
9389
9300
|
}
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9301
|
+
e.preventDefault();
|
|
9302
|
+
switch (action) {
|
|
9303
|
+
case "escape":
|
|
9304
|
+
current.onEscape();
|
|
9305
|
+
break;
|
|
9306
|
+
case "delete":
|
|
9307
|
+
current.onDelete();
|
|
9308
|
+
break;
|
|
9309
|
+
case "undo":
|
|
9310
|
+
current.onUndo();
|
|
9311
|
+
break;
|
|
9312
|
+
case "redo":
|
|
9313
|
+
current.onRedo();
|
|
9314
|
+
break;
|
|
9315
|
+
case "copy":
|
|
9316
|
+
current.onCopy();
|
|
9317
|
+
break;
|
|
9318
|
+
case "cut":
|
|
9319
|
+
current.onCut();
|
|
9320
|
+
break;
|
|
9321
|
+
case "paste":
|
|
9322
|
+
current.onPaste();
|
|
9323
|
+
break;
|
|
9324
|
+
case "duplicate":
|
|
9325
|
+
current.onDuplicate();
|
|
9326
|
+
break;
|
|
9327
|
+
case "selectAll":
|
|
9328
|
+
current.onSelectAll();
|
|
9329
|
+
break;
|
|
9330
|
+
case "group":
|
|
9331
|
+
current.onGroup?.();
|
|
9332
|
+
break;
|
|
9333
|
+
case "ungroup":
|
|
9334
|
+
current.onUngroup?.();
|
|
9335
|
+
break;
|
|
9336
|
+
case "toggleShortcuts":
|
|
9337
|
+
current.onToggleShortcuts?.();
|
|
9338
|
+
break;
|
|
9339
|
+
case "nudge":
|
|
9340
|
+
current.onNudge(dx ?? 0, dy ?? 0);
|
|
9341
|
+
break;
|
|
9342
|
+
case "prevSlide":
|
|
9343
|
+
current.onPrevSlide?.();
|
|
9344
|
+
break;
|
|
9345
|
+
case "nextSlide":
|
|
9346
|
+
current.onNextSlide?.();
|
|
9347
|
+
break;
|
|
9397
9348
|
}
|
|
9398
9349
|
}, []);
|
|
9399
9350
|
react.useEffect(() => {
|
|
9400
|
-
const container = input.containerRef.current;
|
|
9401
|
-
if (container) {
|
|
9402
|
-
container.addEventListener("keydown", handleKeyDown);
|
|
9403
|
-
}
|
|
9404
9351
|
window.addEventListener("keydown", handleKeyDown);
|
|
9405
9352
|
return () => {
|
|
9406
|
-
if (container) {
|
|
9407
|
-
container.removeEventListener("keydown", handleKeyDown);
|
|
9408
|
-
}
|
|
9409
9353
|
window.removeEventListener("keydown", handleKeyDown);
|
|
9410
9354
|
};
|
|
9411
|
-
}, [
|
|
9355
|
+
}, [handleKeyDown]);
|
|
9412
9356
|
}
|
|
9413
9357
|
|
|
9414
9358
|
// src/viewer/hooks/useKeyboardShortcutWiring.ts
|
|
@@ -9439,8 +9383,13 @@ function useKeyboardShortcutWiring(input) {
|
|
|
9439
9383
|
ops.applySelection(allIds[0], allIds);
|
|
9440
9384
|
}
|
|
9441
9385
|
},
|
|
9386
|
+
onGroup: manipulation.handleGroupElements,
|
|
9387
|
+
onUngroup: manipulation.handleUngroupElement,
|
|
9388
|
+
onToggleShortcuts: () => state.setIsShortcutHelpOpen((prev) => !prev),
|
|
9442
9389
|
onEscape: () => {
|
|
9443
|
-
if (state.
|
|
9390
|
+
if (state.isShortcutHelpOpen) {
|
|
9391
|
+
state.setIsShortcutHelpOpen(false);
|
|
9392
|
+
} else if (state.inlineEditingElementId) {
|
|
9444
9393
|
state.setInlineEditingElementId(null);
|
|
9445
9394
|
state.setInlineEditingText("");
|
|
9446
9395
|
} else if (state.contextMenuState) {
|
|
@@ -9637,7 +9586,7 @@ function useViewerIntegration(input) {
|
|
|
9637
9586
|
return zoom.scale;
|
|
9638
9587
|
},
|
|
9639
9588
|
setZoom(level) {
|
|
9640
|
-
zoom.setScale(
|
|
9589
|
+
zoom.setScale(chunkH74UXL4Q_js.clampZoomScale(level));
|
|
9641
9590
|
},
|
|
9642
9591
|
zoomIn() {
|
|
9643
9592
|
zoom.handleZoomIn();
|
|
@@ -9852,7 +9801,7 @@ function useReducedMotion() {
|
|
|
9852
9801
|
}
|
|
9853
9802
|
function useViewerOptions() {
|
|
9854
9803
|
const storeRef = react.useRef(null);
|
|
9855
|
-
storeRef.current ??=
|
|
9804
|
+
storeRef.current ??= chunkH74UXL4Q_js.createViewerOptionsStore();
|
|
9856
9805
|
const store = storeRef.current;
|
|
9857
9806
|
const options = react.useSyncExternalStore(
|
|
9858
9807
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9861,9 +9810,9 @@ function useViewerOptions() {
|
|
|
9861
9810
|
);
|
|
9862
9811
|
return { optionsStore: store, options };
|
|
9863
9812
|
}
|
|
9864
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9813
|
+
var KNOWN_TAB_IDS = new Set(chunkH74UXL4Q_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9865
9814
|
function computeToolbarVisibility(hiddenActions) {
|
|
9866
|
-
const isHidden = (id) =>
|
|
9815
|
+
const isHidden = (id) => chunkH74UXL4Q_js.isActionHidden(id, hiddenActions);
|
|
9867
9816
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
9868
9817
|
return { isHidden, isTabVisible };
|
|
9869
9818
|
}
|
|
@@ -9948,12 +9897,12 @@ function useYjsDocumentSync({
|
|
|
9948
9897
|
return;
|
|
9949
9898
|
}
|
|
9950
9899
|
try {
|
|
9951
|
-
const handler = new
|
|
9900
|
+
const handler = new chunkH74UXL4Q_js.PptxHandler();
|
|
9952
9901
|
await handler.load(sourceBytes.buffer);
|
|
9953
|
-
const currentSlides =
|
|
9902
|
+
const currentSlides = chunkH74UXL4Q_js.readSlidesFromYDoc(
|
|
9954
9903
|
doc
|
|
9955
9904
|
);
|
|
9956
|
-
const slidesToSave =
|
|
9905
|
+
const slidesToSave = chunkIJVDNQLG_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
9957
9906
|
const bytes = await handler.save(slidesToSave);
|
|
9958
9907
|
config.onWriteBack(bytes);
|
|
9959
9908
|
} catch {
|
|
@@ -9968,7 +9917,7 @@ function useYjsDocumentSync({
|
|
|
9968
9917
|
if (!doc || !isConnected) {
|
|
9969
9918
|
return;
|
|
9970
9919
|
}
|
|
9971
|
-
const docSlides =
|
|
9920
|
+
const docSlides = chunkH74UXL4Q_js.readSlidesFromYDoc(
|
|
9972
9921
|
doc
|
|
9973
9922
|
);
|
|
9974
9923
|
if (docSlides.length === 0) {
|
|
@@ -9990,11 +9939,11 @@ function useYjsDocumentSync({
|
|
|
9990
9939
|
lastSyncedRef.current = serialized;
|
|
9991
9940
|
void (async () => {
|
|
9992
9941
|
const factories = await getFactories();
|
|
9993
|
-
|
|
9942
|
+
chunkH74UXL4Q_js.reconcileSlidesInYDoc(
|
|
9994
9943
|
slides,
|
|
9995
9944
|
doc,
|
|
9996
9945
|
factories,
|
|
9997
|
-
|
|
9946
|
+
chunkH74UXL4Q_js.LOCAL_SYNC_ORIGIN
|
|
9998
9947
|
);
|
|
9999
9948
|
scheduleWriteBack();
|
|
10000
9949
|
})();
|
|
@@ -10008,10 +9957,10 @@ function useYjsDocumentSync({
|
|
|
10008
9957
|
return;
|
|
10009
9958
|
}
|
|
10010
9959
|
const handleChange = (_events, transaction) => {
|
|
10011
|
-
if (transaction?.origin ===
|
|
9960
|
+
if (transaction?.origin === chunkH74UXL4Q_js.LOCAL_SYNC_ORIGIN) {
|
|
10012
9961
|
return;
|
|
10013
9962
|
}
|
|
10014
|
-
const remoteSlides =
|
|
9963
|
+
const remoteSlides = chunkH74UXL4Q_js.readSlidesFromYDoc(
|
|
10015
9964
|
doc
|
|
10016
9965
|
);
|
|
10017
9966
|
if (remoteSlides.length === 0) {
|
|
@@ -10027,7 +9976,7 @@ function useYjsDocumentSync({
|
|
|
10027
9976
|
isApplyingRemoteRef.current = false;
|
|
10028
9977
|
scheduleWriteBack();
|
|
10029
9978
|
};
|
|
10030
|
-
const unobserve =
|
|
9979
|
+
const unobserve = chunkH74UXL4Q_js.observeYDocSlides(
|
|
10031
9980
|
doc,
|
|
10032
9981
|
handleChange
|
|
10033
9982
|
);
|
|
@@ -10065,7 +10014,7 @@ function useBroadcastFollower({
|
|
|
10065
10014
|
if (!broadcaster) {
|
|
10066
10015
|
return;
|
|
10067
10016
|
}
|
|
10068
|
-
if (!
|
|
10017
|
+
if (!chunkH74UXL4Q_js.shouldAutoFollowBroadcaster({
|
|
10069
10018
|
localRole: collab.config.role,
|
|
10070
10019
|
broadcasterRole: broadcaster.role
|
|
10071
10020
|
})) {
|
|
@@ -10225,10 +10174,10 @@ function useTouchGestures(input) {
|
|
|
10225
10174
|
if (!el || !enabled) {
|
|
10226
10175
|
return;
|
|
10227
10176
|
}
|
|
10228
|
-
const recognizer =
|
|
10177
|
+
const recognizer = chunkH74UXL4Q_js.createTouchGestureRecognizer({
|
|
10229
10178
|
getScale: () => scaleRef.current,
|
|
10230
|
-
minScale:
|
|
10231
|
-
maxScale:
|
|
10179
|
+
minScale: chunkH74UXL4Q_js.MIN_ZOOM_SCALE,
|
|
10180
|
+
maxScale: chunkH74UXL4Q_js.MAX_ZOOM_SCALE,
|
|
10232
10181
|
callbacks: {
|
|
10233
10182
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10234
10183
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10268,7 +10217,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10268
10217
|
return;
|
|
10269
10218
|
}
|
|
10270
10219
|
const rect = active.getBoundingClientRect();
|
|
10271
|
-
const delta =
|
|
10220
|
+
const delta = chunkH74UXL4Q_js.computeScrollDelta(
|
|
10272
10221
|
{ top: rect.top, bottom: rect.bottom },
|
|
10273
10222
|
window.innerHeight,
|
|
10274
10223
|
keyboardInset
|
|
@@ -10288,8 +10237,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10288
10237
|
return;
|
|
10289
10238
|
}
|
|
10290
10239
|
const update = () => {
|
|
10291
|
-
const metrics =
|
|
10292
|
-
const inset = metrics ?
|
|
10240
|
+
const metrics = chunkH74UXL4Q_js.readViewportMetrics(window);
|
|
10241
|
+
const inset = metrics ? chunkH74UXL4Q_js.computeKeyboardInset(metrics) : 0;
|
|
10293
10242
|
setKeyboardInset(inset);
|
|
10294
10243
|
if (inset > 0) {
|
|
10295
10244
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10300,8 +10249,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10300
10249
|
vv.addEventListener("scroll", update);
|
|
10301
10250
|
const onFocusIn = () => {
|
|
10302
10251
|
window.requestAnimationFrame(() => {
|
|
10303
|
-
const metrics =
|
|
10304
|
-
const inset = metrics ?
|
|
10252
|
+
const metrics = chunkH74UXL4Q_js.readViewportMetrics(window);
|
|
10253
|
+
const inset = metrics ? chunkH74UXL4Q_js.computeKeyboardInset(metrics) : 0;
|
|
10305
10254
|
if (inset > 0) {
|
|
10306
10255
|
scrollFocusedIntoView(inset);
|
|
10307
10256
|
}
|
|
@@ -10314,7 +10263,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10314
10263
|
document.removeEventListener("focusin", onFocusIn);
|
|
10315
10264
|
};
|
|
10316
10265
|
}, [enabled]);
|
|
10317
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10266
|
+
return { keyboardInset, isKeyboardOpen: chunkH74UXL4Q_js.isKeyboardOpen(keyboardInset) };
|
|
10318
10267
|
}
|
|
10319
10268
|
|
|
10320
10269
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10341,41 +10290,23 @@ function buildCanvasProps(input) {
|
|
|
10341
10290
|
} = input;
|
|
10342
10291
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10343
10292
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10344
|
-
|
|
10345
|
-
|
|
10346
|
-
|
|
10347
|
-
|
|
10348
|
-
|
|
10349
|
-
const txt = el.text;
|
|
10350
|
-
if (txt) {
|
|
10351
|
-
slideTitle = txt;
|
|
10352
|
-
break;
|
|
10353
|
-
}
|
|
10354
|
-
}
|
|
10355
|
-
}
|
|
10356
|
-
}
|
|
10357
|
-
const hf = s.headerFooter;
|
|
10358
|
-
const fieldContext = {
|
|
10359
|
-
slideNumber: activeSlide?.slideNumber,
|
|
10360
|
-
dateTimeText: hf.dateTimeText,
|
|
10361
|
-
dateFormat: hf.dateFormat,
|
|
10362
|
-
footerText: hf.footerText,
|
|
10363
|
-
headerText: hf.headerText,
|
|
10364
|
-
slideTitle,
|
|
10365
|
-
customProperties: s.customProperties.map((p) => ({ name: p.name, value: p.value }))
|
|
10366
|
-
};
|
|
10293
|
+
const fieldContext = chunkH74UXL4Q_js.buildFieldSubstitutionContext({
|
|
10294
|
+
headerFooter: s.headerFooter,
|
|
10295
|
+
customProperties: s.customProperties,
|
|
10296
|
+
slide: activeSlide
|
|
10297
|
+
});
|
|
10367
10298
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10368
10299
|
const handleActionClick = (_elementId, action) => {
|
|
10369
10300
|
if (mode === "present") {
|
|
10370
10301
|
presentation.handlePresentationAction(action);
|
|
10371
10302
|
} else if (action.url) {
|
|
10372
|
-
|
|
10303
|
+
chunkH74UXL4Q_js.safeOpenUrl(action.url);
|
|
10373
10304
|
}
|
|
10374
10305
|
};
|
|
10375
10306
|
const handleHyperlinkClick = (url) => {
|
|
10376
|
-
if (
|
|
10307
|
+
if (chunkH74UXL4Q_js.isPpactionUrl(url)) {
|
|
10377
10308
|
if (mode === "present") {
|
|
10378
|
-
const parsed =
|
|
10309
|
+
const parsed = chunkH74UXL4Q_js.parsePpactionUrl(url);
|
|
10379
10310
|
if (parsed) {
|
|
10380
10311
|
presentation.handlePresentationAction({
|
|
10381
10312
|
action: parsed.action,
|
|
@@ -10385,7 +10316,7 @@ function buildCanvasProps(input) {
|
|
|
10385
10316
|
}
|
|
10386
10317
|
return;
|
|
10387
10318
|
}
|
|
10388
|
-
|
|
10319
|
+
chunkH74UXL4Q_js.safeOpenUrl(url);
|
|
10389
10320
|
};
|
|
10390
10321
|
return {
|
|
10391
10322
|
activeSlide: effectiveSlide,
|
|
@@ -10407,7 +10338,9 @@ function buildCanvasProps(input) {
|
|
|
10407
10338
|
showGrid: s.showGrid,
|
|
10408
10339
|
gridSpacingPx,
|
|
10409
10340
|
showRulers: s.showRulers,
|
|
10410
|
-
guides:
|
|
10341
|
+
// View ▸ Guides hides the overlay without discarding the guides: they are
|
|
10342
|
+
// still snapped to while dragging and still round-trip on save.
|
|
10343
|
+
guides: s.showGuides ? s.guides : [],
|
|
10411
10344
|
presentationElementStates: mode === "present" ? presentation.presentationElementStates : void 0,
|
|
10412
10345
|
presentationKeyframesCss: mode === "present" ? presentation.presentationKeyframesCss : void 0,
|
|
10413
10346
|
onClick: canvasHandlers.handleElementClick,
|
|
@@ -10616,6 +10549,7 @@ function buildToolbarProps(input) {
|
|
|
10616
10549
|
history
|
|
10617
10550
|
});
|
|
10618
10551
|
const scopedLayoutOptions = scopeLayoutOptionsToActiveSlide(s.layoutOptions, activeSlide);
|
|
10552
|
+
const selectionSize = selectedElement === null ? 0 : 1;
|
|
10619
10553
|
return {
|
|
10620
10554
|
fileName,
|
|
10621
10555
|
mode,
|
|
@@ -10678,11 +10612,13 @@ function buildToolbarProps(input) {
|
|
|
10678
10612
|
spellCheckEnabled: s.spellCheckEnabled,
|
|
10679
10613
|
showGrid: s.showGrid,
|
|
10680
10614
|
showRulers: s.showRulers,
|
|
10615
|
+
showGuides: s.showGuides,
|
|
10681
10616
|
snapToGrid: s.snapToGrid,
|
|
10682
10617
|
snapToShape: s.snapToShape,
|
|
10683
10618
|
onSetSpellCheckEnabled: s.setSpellCheckEnabled,
|
|
10684
10619
|
onSetShowGrid: s.setShowGrid,
|
|
10685
10620
|
onSetShowRulers: s.setShowRulers,
|
|
10621
|
+
onSetShowGuides: s.setShowGuides,
|
|
10686
10622
|
onSetSnapToGrid: s.setSnapToGrid,
|
|
10687
10623
|
onSetSnapToShape: s.setSnapToShape,
|
|
10688
10624
|
onAddGuide: dialogs.handleAddGuide,
|
|
@@ -10695,6 +10631,11 @@ function buildToolbarProps(input) {
|
|
|
10695
10631
|
onFlip: manipulation.handleFlip,
|
|
10696
10632
|
onMoveLayer: manipulation.handleMoveLayer,
|
|
10697
10633
|
onMoveLayerToEdge: manipulation.handleMoveLayerToEdge,
|
|
10634
|
+
onGroupElements: manipulation.handleGroupElements,
|
|
10635
|
+
onUngroupElement: manipulation.handleUngroupElement,
|
|
10636
|
+
onUpdateElementStyle: ops.updateSelectedShapeStyle,
|
|
10637
|
+
selectedCount: s.selectedElementIds.length > 0 ? s.selectedElementIds.length : selectionSize,
|
|
10638
|
+
onOpenHyperlinkDialog: () => dialogs.setIsHyperlinkDialogOpen(true),
|
|
10698
10639
|
onDuplicate: manipulation.handleDuplicate,
|
|
10699
10640
|
onDelete: manipulation.handleDelete,
|
|
10700
10641
|
onExportPng: exportHandlers.handleExportPng,
|
|
@@ -10705,7 +10646,7 @@ function buildToolbarProps(input) {
|
|
|
10705
10646
|
onOpenFile,
|
|
10706
10647
|
onOpenRecentFile,
|
|
10707
10648
|
onCreatePresentation: (templateId) => {
|
|
10708
|
-
s.setSlides(
|
|
10649
|
+
s.setSlides(chunkH74UXL4Q_js.createBackstagePresentation(templateId));
|
|
10709
10650
|
s.setActiveSlideIndex(0);
|
|
10710
10651
|
s.setSelectedElementId(null);
|
|
10711
10652
|
s.setSelectedElementIds([]);
|
|
@@ -10723,6 +10664,7 @@ function buildToolbarProps(input) {
|
|
|
10723
10664
|
onOpenSettings,
|
|
10724
10665
|
onRunAccessibilityCheck: dialogs.handleRunAccessibilityCheck,
|
|
10725
10666
|
onToggleSlideSorter: () => s.setShowSlideSorter((p) => !p),
|
|
10667
|
+
onOpenReadingView: () => s.setShowReadingView(true),
|
|
10726
10668
|
onUpdateTextStyle: ops.updateSelectedTextStyle,
|
|
10727
10669
|
onTransformTextCase: ops.updateSelectedTextCase,
|
|
10728
10670
|
isOverflowMenuOpen: s.isOverflowMenuOpen,
|
|
@@ -10760,7 +10702,7 @@ function buildToolbarProps(input) {
|
|
|
10760
10702
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10761
10703
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10762
10704
|
formatPainterActive: s.formatPainterActive,
|
|
10763
|
-
canActivateFormatPainter:
|
|
10705
|
+
canActivateFormatPainter: chunkH74UXL4Q_js.hasCopyableFormat(selectedElement),
|
|
10764
10706
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10765
10707
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10766
10708
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11023,7 +10965,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11023
10965
|
}, [incomingContent]);
|
|
11024
10966
|
const onOpenFile = react.useCallback(() => {
|
|
11025
10967
|
void (async () => {
|
|
11026
|
-
const picked = await
|
|
10968
|
+
const picked = await chunkH74UXL4Q_js.openPptxFile();
|
|
11027
10969
|
if (picked) {
|
|
11028
10970
|
setContent(picked.buffer);
|
|
11029
10971
|
}
|
|
@@ -11031,7 +10973,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11031
10973
|
}, []);
|
|
11032
10974
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11033
10975
|
void (async () => {
|
|
11034
|
-
const bytes = await
|
|
10976
|
+
const bytes = await chunkH74UXL4Q_js.readBackstageRecentFile(key);
|
|
11035
10977
|
if (bytes) {
|
|
11036
10978
|
setContent(bytes);
|
|
11037
10979
|
}
|