pptx-react-viewer 2.2.1 → 2.3.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 +2 -0
- package/dist/{AiChatPanel-O4NYWO3D.js → AiChatPanel-HC3CE3TL.js} +23 -23
- package/dist/AiChatPanel-HC3CE3TL.js.br +0 -0
- package/dist/AiChatPanel-HC3CE3TL.js.gz +0 -0
- package/dist/{AiChatPanel-XRKEPXAM.mjs → AiChatPanel-PXZYHJUB.mjs} +4 -4
- package/dist/AiChatPanel-PXZYHJUB.mjs.br +0 -0
- package/dist/AiChatPanel-PXZYHJUB.mjs.gz +0 -0
- package/dist/{Model3DScene-HYE6HA2C.js → Model3DScene-37QZRHV5.js} +3 -3
- package/dist/{Model3DScene-HYE6HA2C.js.br → Model3DScene-37QZRHV5.js.br} +0 -0
- package/dist/Model3DScene-37QZRHV5.js.gz +0 -0
- package/dist/{Model3DScene-JN5F5C4Z.mjs → Model3DScene-ZG4HTMPX.mjs} +2 -2
- package/dist/{Model3DScene-JN5F5C4Z.mjs.br → Model3DScene-ZG4HTMPX.mjs.br} +0 -0
- package/dist/Model3DScene-ZG4HTMPX.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-FDJ6LC4E.js → SurfaceChart3DScene-QIREQ66D.js} +3 -3
- package/dist/SurfaceChart3DScene-QIREQ66D.js.br +0 -0
- package/dist/SurfaceChart3DScene-QIREQ66D.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-V7P3LQVV.mjs → SurfaceChart3DScene-Z7R6DZXN.mjs} +2 -2
- package/dist/{SurfaceChart3DScene-V7P3LQVV.mjs.br → SurfaceChart3DScene-Z7R6DZXN.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-Z7R6DZXN.mjs.gz +0 -0
- package/dist/{chunk-R2H3FHK6.js → chunk-3TB45PVK.js} +42 -99
- package/dist/chunk-3TB45PVK.js.br +0 -0
- package/dist/chunk-3TB45PVK.js.gz +0 -0
- package/dist/{chunk-6G6S7PEI.mjs → chunk-4AAFZFGH.mjs} +36 -7
- package/dist/chunk-4AAFZFGH.mjs.br +0 -0
- package/dist/chunk-4AAFZFGH.mjs.gz +0 -0
- package/dist/{chunk-XJTWUXXC.js → chunk-EUIFPDXZ.js} +3 -3
- package/dist/chunk-EUIFPDXZ.js.br +0 -0
- package/dist/chunk-EUIFPDXZ.js.gz +0 -0
- package/dist/{chunk-7NSLKNCT.mjs → chunk-I5LEMC5C.mjs} +4 -4
- package/dist/chunk-I5LEMC5C.mjs.br +0 -0
- package/dist/chunk-I5LEMC5C.mjs.gz +0 -0
- package/dist/{chunk-RYHBWTPI.mjs → chunk-J5A22DZ7.mjs} +63 -38
- package/dist/chunk-J5A22DZ7.mjs.br +0 -0
- package/dist/chunk-J5A22DZ7.mjs.gz +0 -0
- package/dist/{chunk-PE2I5L6R.mjs → chunk-JFNMD6TM.mjs} +41 -100
- package/dist/chunk-JFNMD6TM.mjs.br +0 -0
- package/dist/chunk-JFNMD6TM.mjs.gz +0 -0
- package/dist/{chunk-2QHCOESN.js → chunk-KDW3LLG5.js} +77 -47
- package/dist/chunk-KDW3LLG5.js.br +0 -0
- package/dist/chunk-KDW3LLG5.js.gz +0 -0
- package/dist/{chunk-K2AW5UXT.js → chunk-L7JNCVTF.js} +309 -309
- package/dist/chunk-L7JNCVTF.js.br +0 -0
- package/dist/chunk-L7JNCVTF.js.gz +0 -0
- package/dist/{chunk-I2HF7ZPO.mjs → chunk-M5YR3QSB.mjs} +1 -1
- package/dist/chunk-M5YR3QSB.mjs.br +0 -0
- package/dist/chunk-M5YR3QSB.mjs.gz +0 -0
- package/dist/{chunk-2U243ZEP.js → chunk-P7UVBRFO.js} +257 -241
- package/dist/chunk-P7UVBRFO.js.br +0 -0
- package/dist/chunk-P7UVBRFO.js.gz +0 -0
- package/dist/{chunk-O75FHZQJ.mjs → chunk-VOHTAUN4.mjs} +23 -7
- package/dist/chunk-VOHTAUN4.mjs.br +0 -0
- package/dist/chunk-VOHTAUN4.mjs.gz +0 -0
- package/dist/{chunk-QULJW7LU.js → chunk-ZLSVW5GP.js} +898 -873
- package/dist/chunk-ZLSVW5GP.js.br +0 -0
- package/dist/chunk-ZLSVW5GP.js.gz +0 -0
- package/dist/{dist-ZCJLIRYG.js → dist-FTEVZZPM.js} +576 -568
- package/dist/dist-FTEVZZPM.js.br +0 -0
- package/dist/dist-FTEVZZPM.js.gz +0 -0
- package/dist/{dist-VEWYRBTB.mjs → dist-L7GZVBMG.mjs} +1 -1
- package/dist/dist-L7GZVBMG.mjs.br +0 -0
- package/dist/dist-L7GZVBMG.mjs.gz +0 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +35 -35
- 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 +13 -0
- 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/viewer/index.d.ts +13 -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-O4NYWO3D.js.br +0 -0
- package/dist/AiChatPanel-O4NYWO3D.js.gz +0 -0
- package/dist/AiChatPanel-XRKEPXAM.mjs.br +0 -0
- package/dist/AiChatPanel-XRKEPXAM.mjs.gz +0 -0
- package/dist/Model3DScene-HYE6HA2C.js.gz +0 -0
- package/dist/Model3DScene-JN5F5C4Z.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-FDJ6LC4E.js.br +0 -0
- package/dist/SurfaceChart3DScene-FDJ6LC4E.js.gz +0 -0
- package/dist/SurfaceChart3DScene-V7P3LQVV.mjs.gz +0 -0
- package/dist/chunk-2QHCOESN.js.br +0 -0
- package/dist/chunk-2QHCOESN.js.gz +0 -0
- package/dist/chunk-2U243ZEP.js.br +0 -0
- package/dist/chunk-2U243ZEP.js.gz +0 -0
- package/dist/chunk-6G6S7PEI.mjs.br +0 -0
- package/dist/chunk-6G6S7PEI.mjs.gz +0 -0
- package/dist/chunk-7NSLKNCT.mjs.br +0 -0
- package/dist/chunk-7NSLKNCT.mjs.gz +0 -0
- package/dist/chunk-I2HF7ZPO.mjs.br +0 -0
- package/dist/chunk-I2HF7ZPO.mjs.gz +0 -0
- package/dist/chunk-K2AW5UXT.js.br +0 -0
- package/dist/chunk-K2AW5UXT.js.gz +0 -0
- package/dist/chunk-O75FHZQJ.mjs.br +0 -0
- package/dist/chunk-O75FHZQJ.mjs.gz +0 -0
- package/dist/chunk-PE2I5L6R.mjs.br +0 -0
- package/dist/chunk-PE2I5L6R.mjs.gz +0 -0
- package/dist/chunk-QULJW7LU.js.br +0 -0
- package/dist/chunk-QULJW7LU.js.gz +0 -0
- package/dist/chunk-R2H3FHK6.js.br +0 -0
- package/dist/chunk-R2H3FHK6.js.gz +0 -0
- package/dist/chunk-RYHBWTPI.mjs.br +0 -0
- package/dist/chunk-RYHBWTPI.mjs.gz +0 -0
- package/dist/chunk-XJTWUXXC.js.br +0 -0
- package/dist/chunk-XJTWUXXC.js.gz +0 -0
- package/dist/dist-VEWYRBTB.mjs.br +0 -0
- package/dist/dist-VEWYRBTB.mjs.gz +0 -0
- package/dist/dist-ZCJLIRYG.js.br +0 -0
- package/dist/dist-ZCJLIRYG.js.gz +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkP7UVBRFO_js = require('./chunk-P7UVBRFO.js');
|
|
4
|
+
var chunkKDW3LLG5_js = require('./chunk-KDW3LLG5.js');
|
|
5
5
|
var chunkYIFO3WQO_js = require('./chunk-YIFO3WQO.js');
|
|
6
|
-
var
|
|
6
|
+
var chunk3TB45PVK_js = require('./chunk-3TB45PVK.js');
|
|
7
7
|
var react = require('react');
|
|
8
8
|
var JSZip = require('jszip');
|
|
9
9
|
var reactI18next = require('react-i18next');
|
|
@@ -15,7 +15,7 @@ var JSZip__default = /*#__PURE__*/_interopDefault(JSZip);
|
|
|
15
15
|
function useVirtualizedSlides({
|
|
16
16
|
totalItems,
|
|
17
17
|
itemHeight,
|
|
18
|
-
overscan =
|
|
18
|
+
overscan = chunkKDW3LLG5_js.DEFAULT_VIRTUAL_OVERSCAN
|
|
19
19
|
}) {
|
|
20
20
|
const scrollContainerRef = react.useRef(null);
|
|
21
21
|
const [scrollTop, setScrollTop] = react.useState(0);
|
|
@@ -45,7 +45,7 @@ function useVirtualizedSlides({
|
|
|
45
45
|
resizeObserver?.disconnect();
|
|
46
46
|
};
|
|
47
47
|
}, []);
|
|
48
|
-
const range =
|
|
48
|
+
const range = chunkKDW3LLG5_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
|
|
49
49
|
const safeItemHeight = Math.max(itemHeight, 1);
|
|
50
50
|
const scrollToIndex = react.useCallback(
|
|
51
51
|
(index, behavior = "smooth") => {
|
|
@@ -108,7 +108,7 @@ function usePresenceTracking({
|
|
|
108
108
|
awareness.setLocalStateField("presence", state);
|
|
109
109
|
lastBroadcastRef.current = Date.now();
|
|
110
110
|
};
|
|
111
|
-
if (elapsed >=
|
|
111
|
+
if (elapsed >= chunkKDW3LLG5_js.BROADCAST_THROTTLE_MS) {
|
|
112
112
|
if (pendingBroadcastRef.current) {
|
|
113
113
|
clearTimeout(pendingBroadcastRef.current);
|
|
114
114
|
pendingBroadcastRef.current = null;
|
|
@@ -118,7 +118,7 @@ function usePresenceTracking({
|
|
|
118
118
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
119
119
|
pendingBroadcastRef.current = null;
|
|
120
120
|
flush();
|
|
121
|
-
},
|
|
121
|
+
}, chunkKDW3LLG5_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
124
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -143,7 +143,7 @@ function usePresenceTracking({
|
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
145
|
const handleChange = () => {
|
|
146
|
-
const users =
|
|
146
|
+
const users = chunkKDW3LLG5_js.derivePresenceList(
|
|
147
147
|
awareness.getStates(),
|
|
148
148
|
localClientId,
|
|
149
149
|
canvasWidth,
|
|
@@ -195,7 +195,7 @@ function useYjsProvider({ config }) {
|
|
|
195
195
|
const departureRef = react.useRef(null);
|
|
196
196
|
const gateRef = react.useRef(null);
|
|
197
197
|
if (!gateRef.current) {
|
|
198
|
-
gateRef.current =
|
|
198
|
+
gateRef.current = chunkKDW3LLG5_js.createSyncGate(() => setSynced(true));
|
|
199
199
|
}
|
|
200
200
|
const teardown = react.useCallback(() => {
|
|
201
201
|
if (timeoutRef.current) {
|
|
@@ -215,7 +215,7 @@ function useYjsProvider({ config }) {
|
|
|
215
215
|
const buildCleanup = react.useCallback(
|
|
216
216
|
(provider, yDoc) => () => {
|
|
217
217
|
announceDeparture();
|
|
218
|
-
|
|
218
|
+
chunkKDW3LLG5_js.clearLocalAwareness(provider.awareness);
|
|
219
219
|
provider.destroy();
|
|
220
220
|
yDoc.destroy();
|
|
221
221
|
setDoc(null);
|
|
@@ -240,9 +240,9 @@ function useYjsProvider({ config }) {
|
|
|
240
240
|
if (config.authToken) {
|
|
241
241
|
opts.password = config.authToken;
|
|
242
242
|
}
|
|
243
|
-
const roomId =
|
|
243
|
+
const roomId = chunkKDW3LLG5_js.validateRoomId(config.roomId);
|
|
244
244
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
245
|
-
departureRef.current =
|
|
245
|
+
departureRef.current = chunkKDW3LLG5_js.createDepartureChannel(roomId, provider.awareness);
|
|
246
246
|
setDoc(yDoc);
|
|
247
247
|
setAwareness(provider.awareness);
|
|
248
248
|
setClientId(provider.awareness.clientID);
|
|
@@ -284,13 +284,13 @@ function useYjsProvider({ config }) {
|
|
|
284
284
|
if (!config) {
|
|
285
285
|
return;
|
|
286
286
|
}
|
|
287
|
-
const roomId =
|
|
288
|
-
const transport = config.transport ??
|
|
287
|
+
const roomId = chunkKDW3LLG5_js.validateRoomId(config.roomId);
|
|
288
|
+
const transport = config.transport ?? chunkKDW3LLG5_js.resolveTransportForServerUrl(config.serverUrl);
|
|
289
289
|
if (transport === "webrtc") {
|
|
290
290
|
await initWebrtc();
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
293
|
+
if (chunkKDW3LLG5_js.isMixedContentBlocked(config.serverUrl)) {
|
|
294
294
|
console.warn(
|
|
295
295
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
296
296
|
);
|
|
@@ -304,7 +304,7 @@ function useYjsProvider({ config }) {
|
|
|
304
304
|
const provider = new WebsocketProvider(config.serverUrl, roomId, yDoc, {
|
|
305
305
|
params: config.authToken ? { token: config.authToken } : void 0
|
|
306
306
|
});
|
|
307
|
-
departureRef.current =
|
|
307
|
+
departureRef.current = chunkKDW3LLG5_js.createDepartureChannel(roomId, provider.awareness);
|
|
308
308
|
let connected = false;
|
|
309
309
|
const handleStatus = (event) => {
|
|
310
310
|
if (event.status === "connected") {
|
|
@@ -344,7 +344,7 @@ function useYjsProvider({ config }) {
|
|
|
344
344
|
provider.off("status", handleStatus);
|
|
345
345
|
provider.off("sync", handleSynced);
|
|
346
346
|
announceDeparture();
|
|
347
|
-
|
|
347
|
+
chunkKDW3LLG5_js.clearLocalAwareness(provider.awareness);
|
|
348
348
|
provider.destroy();
|
|
349
349
|
yDoc.destroy();
|
|
350
350
|
setDoc(null);
|
|
@@ -353,7 +353,7 @@ function useYjsProvider({ config }) {
|
|
|
353
353
|
cleanupRef.current = null;
|
|
354
354
|
setStatus("error");
|
|
355
355
|
}
|
|
356
|
-
},
|
|
356
|
+
}, chunkKDW3LLG5_js.CONNECTION_TIMEOUT_MS);
|
|
357
357
|
}
|
|
358
358
|
setDoc(yDoc);
|
|
359
359
|
setAwareness(provider.awareness);
|
|
@@ -362,7 +362,7 @@ function useYjsProvider({ config }) {
|
|
|
362
362
|
provider.off("status", handleStatus);
|
|
363
363
|
provider.off("sync", handleSynced);
|
|
364
364
|
announceDeparture();
|
|
365
|
-
|
|
365
|
+
chunkKDW3LLG5_js.clearLocalAwareness(provider.awareness);
|
|
366
366
|
provider.destroy();
|
|
367
367
|
yDoc.destroy();
|
|
368
368
|
setDoc(null);
|
|
@@ -388,7 +388,7 @@ function useYjsProvider({ config }) {
|
|
|
388
388
|
]);
|
|
389
389
|
react.useEffect(() => {
|
|
390
390
|
init();
|
|
391
|
-
const disposeTeardown =
|
|
391
|
+
const disposeTeardown = chunkKDW3LLG5_js.registerCollaborationTeardown({
|
|
392
392
|
leave: teardown,
|
|
393
393
|
rejoin: init
|
|
394
394
|
});
|
|
@@ -409,7 +409,7 @@ function useCollaborativeState({
|
|
|
409
409
|
canvasWidth,
|
|
410
410
|
canvasHeight
|
|
411
411
|
}) {
|
|
412
|
-
const userColor =
|
|
412
|
+
const userColor = chunkKDW3LLG5_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
413
413
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
414
414
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
415
415
|
awareness,
|
|
@@ -518,8 +518,8 @@ function useEditorHistory(input) {
|
|
|
518
518
|
width: canvasSize.width,
|
|
519
519
|
height: canvasSize.height,
|
|
520
520
|
activeSlideIndex,
|
|
521
|
-
slides: slides.map(
|
|
522
|
-
templateElementsBySlideId:
|
|
521
|
+
slides: slides.map(chunkKDW3LLG5_js.cloneSlide),
|
|
522
|
+
templateElementsBySlideId: chunkKDW3LLG5_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
523
523
|
...actionLabel ? { actionLabel } : {}
|
|
524
524
|
};
|
|
525
525
|
},
|
|
@@ -532,9 +532,9 @@ function useEditorHistory(input) {
|
|
|
532
532
|
width: snapshot.width,
|
|
533
533
|
height: snapshot.height
|
|
534
534
|
});
|
|
535
|
-
setSlides(snapshot.slides.map(
|
|
535
|
+
setSlides(snapshot.slides.map(chunkKDW3LLG5_js.cloneSlide));
|
|
536
536
|
setTemplateElementsBySlideId(
|
|
537
|
-
|
|
537
|
+
chunkKDW3LLG5_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
538
538
|
);
|
|
539
539
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
540
540
|
setSelectedElementIds([]);
|
|
@@ -568,8 +568,8 @@ function useEditorHistory(input) {
|
|
|
568
568
|
const currentSnapshot = buildHistorySnapshot();
|
|
569
569
|
historyFutureRef.current.push(currentSnapshot);
|
|
570
570
|
isApplyingHistoryRef.current = true;
|
|
571
|
-
const nextSnapshot =
|
|
572
|
-
lastHistorySnapshotRef.current =
|
|
571
|
+
const nextSnapshot = chunkP7UVBRFO_js.cloneHistorySnapshot(previousSnapshot);
|
|
572
|
+
lastHistorySnapshotRef.current = chunkP7UVBRFO_js.cloneHistorySnapshot(nextSnapshot);
|
|
573
573
|
lastHistorySerializedRef.current = JSON.stringify(nextSnapshot);
|
|
574
574
|
applyHistorySnapshot(nextSnapshot);
|
|
575
575
|
updateHistoryAvailability();
|
|
@@ -590,8 +590,8 @@ function useEditorHistory(input) {
|
|
|
590
590
|
const currentSnapshot = buildHistorySnapshot();
|
|
591
591
|
historyPastRef.current.push(currentSnapshot);
|
|
592
592
|
isApplyingHistoryRef.current = true;
|
|
593
|
-
const targetSnapshot =
|
|
594
|
-
lastHistorySnapshotRef.current =
|
|
593
|
+
const targetSnapshot = chunkP7UVBRFO_js.cloneHistorySnapshot(nextSnapshot);
|
|
594
|
+
lastHistorySnapshotRef.current = chunkP7UVBRFO_js.cloneHistorySnapshot(targetSnapshot);
|
|
595
595
|
lastHistorySerializedRef.current = JSON.stringify(targetSnapshot);
|
|
596
596
|
applyHistorySnapshot(targetSnapshot);
|
|
597
597
|
updateHistoryAvailability();
|
|
@@ -609,7 +609,7 @@ function useEditorHistory(input) {
|
|
|
609
609
|
historyPastRef.current = [];
|
|
610
610
|
historyFutureRef.current = [];
|
|
611
611
|
if (initialSnapshot) {
|
|
612
|
-
const clonedInitial =
|
|
612
|
+
const clonedInitial = chunkP7UVBRFO_js.cloneHistorySnapshot(initialSnapshot);
|
|
613
613
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
614
614
|
lastHistorySerializedRef.current = JSON.stringify(clonedInitial);
|
|
615
615
|
} else {
|
|
@@ -650,18 +650,18 @@ function useEditorHistory(input) {
|
|
|
650
650
|
}
|
|
651
651
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
652
652
|
if (!previousSnapshot) {
|
|
653
|
-
lastHistorySnapshotRef.current =
|
|
653
|
+
lastHistorySnapshotRef.current = chunkP7UVBRFO_js.cloneHistorySnapshot(snapshot);
|
|
654
654
|
lastHistorySerializedRef.current = serialized;
|
|
655
655
|
lastCheapHashRef.current = cheapHash;
|
|
656
656
|
updateHistoryAvailability();
|
|
657
657
|
return;
|
|
658
658
|
}
|
|
659
|
-
historyPastRef.current.push(
|
|
659
|
+
historyPastRef.current.push(chunkP7UVBRFO_js.cloneHistorySnapshot(previousSnapshot));
|
|
660
660
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
661
661
|
historyPastRef.current.shift();
|
|
662
662
|
}
|
|
663
663
|
historyFutureRef.current = [];
|
|
664
|
-
lastHistorySnapshotRef.current =
|
|
664
|
+
lastHistorySnapshotRef.current = chunkP7UVBRFO_js.cloneHistorySnapshot(snapshot);
|
|
665
665
|
lastHistorySerializedRef.current = serialized;
|
|
666
666
|
lastCheapHashRef.current = cheapHash;
|
|
667
667
|
updateHistoryAvailability();
|
|
@@ -750,7 +750,7 @@ function useZoomViewport({
|
|
|
750
750
|
if (!wrapper || !canvasViewport) {
|
|
751
751
|
return;
|
|
752
752
|
}
|
|
753
|
-
const boundedScale = Math.min(Math.max(nextScale,
|
|
753
|
+
const boundedScale = Math.min(Math.max(nextScale, chunkP7UVBRFO_js.MIN_ZOOM_SCALE), chunkP7UVBRFO_js.MAX_ZOOM_SCALE);
|
|
754
754
|
const nextEditorScale = fitScale * boundedScale;
|
|
755
755
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
756
756
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -765,10 +765,10 @@ function useZoomViewport({
|
|
|
765
765
|
[fitScale]
|
|
766
766
|
);
|
|
767
767
|
const handleZoomIn = react.useCallback(() => {
|
|
768
|
-
setScale((currentScale) => Math.min(currentScale + 0.1,
|
|
768
|
+
setScale((currentScale) => Math.min(currentScale + 0.1, chunkP7UVBRFO_js.MAX_ZOOM_SCALE));
|
|
769
769
|
}, []);
|
|
770
770
|
const handleZoomOut = react.useCallback(() => {
|
|
771
|
-
setScale((currentScale) => Math.max(currentScale - 0.1,
|
|
771
|
+
setScale((currentScale) => Math.max(currentScale - 0.1, chunkP7UVBRFO_js.MIN_ZOOM_SCALE));
|
|
772
772
|
}, []);
|
|
773
773
|
const handleResetZoom = react.useCallback(() => {
|
|
774
774
|
setScale(1);
|
|
@@ -787,22 +787,22 @@ function useZoomViewport({
|
|
|
787
787
|
selectedElements.forEach((element) => {
|
|
788
788
|
minX = Math.min(minX, element.x);
|
|
789
789
|
minY = Math.min(minY, element.y);
|
|
790
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
791
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
790
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkP7UVBRFO_js.MIN_ELEMENT_SIZE));
|
|
791
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkP7UVBRFO_js.MIN_ELEMENT_SIZE));
|
|
792
792
|
});
|
|
793
793
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
794
794
|
return;
|
|
795
795
|
}
|
|
796
796
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
797
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
798
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
797
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkP7UVBRFO_js.MIN_ELEMENT_SIZE);
|
|
798
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkP7UVBRFO_js.MIN_ELEMENT_SIZE);
|
|
799
799
|
const availableWidth = Math.max(
|
|
800
|
-
effectiveEditorDimensions.width -
|
|
801
|
-
|
|
800
|
+
effectiveEditorDimensions.width - chunkP7UVBRFO_js.ZOOM_TO_SELECTION_PADDING,
|
|
801
|
+
chunkP7UVBRFO_js.MIN_ELEMENT_SIZE
|
|
802
802
|
);
|
|
803
803
|
const availableHeight = Math.max(
|
|
804
|
-
effectiveEditorDimensions.height -
|
|
805
|
-
|
|
804
|
+
effectiveEditorDimensions.height - chunkP7UVBRFO_js.ZOOM_TO_SELECTION_PADDING,
|
|
805
|
+
chunkP7UVBRFO_js.MIN_ELEMENT_SIZE
|
|
806
806
|
);
|
|
807
807
|
const targetEditorScale = Math.min(
|
|
808
808
|
availableWidth / boundsWidth,
|
|
@@ -810,8 +810,8 @@ function useZoomViewport({
|
|
|
810
810
|
);
|
|
811
811
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
812
812
|
const nextScale = Math.min(
|
|
813
|
-
Math.max(targetEditorScale / safeFitScale,
|
|
814
|
-
|
|
813
|
+
Math.max(targetEditorScale / safeFitScale, chunkP7UVBRFO_js.MIN_ZOOM_SCALE),
|
|
814
|
+
chunkP7UVBRFO_js.MAX_ZOOM_SCALE
|
|
815
815
|
);
|
|
816
816
|
setScale(nextScale);
|
|
817
817
|
window.requestAnimationFrame(() => {
|
|
@@ -833,7 +833,7 @@ function useZoomViewport({
|
|
|
833
833
|
event.preventDefault();
|
|
834
834
|
const delta = event.deltaY * -1e-3;
|
|
835
835
|
setScale(
|
|
836
|
-
(currentScale) => Math.min(Math.max(currentScale + delta,
|
|
836
|
+
(currentScale) => Math.min(Math.max(currentScale + delta, chunkP7UVBRFO_js.MIN_ZOOM_SCALE), chunkP7UVBRFO_js.MAX_ZOOM_SCALE)
|
|
837
837
|
);
|
|
838
838
|
}, []);
|
|
839
839
|
react.useEffect(() => {
|
|
@@ -911,7 +911,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
911
911
|
const command = step.command;
|
|
912
912
|
const timer = window.setTimeout(
|
|
913
913
|
() => {
|
|
914
|
-
|
|
914
|
+
chunkP7UVBRFO_js.executeMediaCommand(command);
|
|
915
915
|
},
|
|
916
916
|
Math.max(0, step.delayMs)
|
|
917
917
|
);
|
|
@@ -1026,7 +1026,7 @@ function useAnimationPlayback(input) {
|
|
|
1026
1026
|
(controller, group) => {
|
|
1027
1027
|
driveBuildReveal(
|
|
1028
1028
|
controller,
|
|
1029
|
-
|
|
1029
|
+
chunkKDW3LLG5_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1030
1030
|
setPresentationElementStates,
|
|
1031
1031
|
buildRafRef
|
|
1032
1032
|
);
|
|
@@ -1089,7 +1089,7 @@ function useAnimationPlayback(input) {
|
|
|
1089
1089
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1090
1090
|
return;
|
|
1091
1091
|
}
|
|
1092
|
-
const controller =
|
|
1092
|
+
const controller = chunkKDW3LLG5_js.PresentationAnimationController.fromSlide(slide);
|
|
1093
1093
|
controllerRef.current = controller;
|
|
1094
1094
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1095
1095
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1226,7 +1226,7 @@ function useAnimationPlayback(input) {
|
|
|
1226
1226
|
}))
|
|
1227
1227
|
);
|
|
1228
1228
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1229
|
-
const delay =
|
|
1229
|
+
const delay = chunkKDW3LLG5_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1230
1230
|
const timer = window.setTimeout(() => {
|
|
1231
1231
|
setPresentationAnimations(
|
|
1232
1232
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1262,12 +1262,12 @@ function useAnimationPlayback(input) {
|
|
|
1262
1262
|
presentationTimersRef
|
|
1263
1263
|
};
|
|
1264
1264
|
}
|
|
1265
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1266
|
-
var AUDIENCE_HASH =
|
|
1267
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1268
|
-
var AUDIENCE_NONCE_KEY =
|
|
1265
|
+
var PRESENTER_CHANNEL_NAME = chunkKDW3LLG5_js.PRESENTATION_CHANNEL_NAME;
|
|
1266
|
+
var AUDIENCE_HASH = chunkKDW3LLG5_js.PRESENTATION_HASH;
|
|
1267
|
+
var PRESENTER_MSG_ORIGIN = chunkKDW3LLG5_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1268
|
+
var AUDIENCE_NONCE_KEY = chunkKDW3LLG5_js.PRESENTATION_NONCE_KEY;
|
|
1269
1269
|
function generateSessionId() {
|
|
1270
|
-
return
|
|
1270
|
+
return chunkKDW3LLG5_js.createPresentationSessionId();
|
|
1271
1271
|
}
|
|
1272
1272
|
function parseAudienceNonce() {
|
|
1273
1273
|
const hash = window.location.hash;
|
|
@@ -1303,7 +1303,7 @@ function usePresenterWindow(input) {
|
|
|
1303
1303
|
}, []);
|
|
1304
1304
|
const swapDisplays = react.useCallback(async () => {
|
|
1305
1305
|
const audience = audienceWindowRef.current;
|
|
1306
|
-
return audience && !audience.closed ?
|
|
1306
|
+
return audience && !audience.closed ? chunkKDW3LLG5_js.swapPresentationWindows(window, audience) : false;
|
|
1307
1307
|
}, []);
|
|
1308
1308
|
const syncSlideToAudience = react.useCallback(
|
|
1309
1309
|
(slideIndex) => {
|
|
@@ -1367,7 +1367,7 @@ function usePresenterWindow(input) {
|
|
|
1367
1367
|
pollTimerRef.current = null;
|
|
1368
1368
|
}
|
|
1369
1369
|
if (closingSessionId) {
|
|
1370
|
-
void
|
|
1370
|
+
void chunkKDW3LLG5_js.clearAudienceContent(closingSessionId);
|
|
1371
1371
|
}
|
|
1372
1372
|
}, [getChannel]);
|
|
1373
1373
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1385,10 +1385,10 @@ function usePresenterWindow(input) {
|
|
|
1385
1385
|
audienceWindowRef.current = blankWin;
|
|
1386
1386
|
const sessionId = generateSessionId();
|
|
1387
1387
|
sessionIdRef.current = sessionId;
|
|
1388
|
-
const audienceUrl =
|
|
1389
|
-
void
|
|
1388
|
+
const audienceUrl = chunkKDW3LLG5_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1389
|
+
void chunkKDW3LLG5_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1390
1390
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1391
|
-
|
|
1391
|
+
chunkKDW3LLG5_js.placeAudienceWindow(blankWin, placement);
|
|
1392
1392
|
}
|
|
1393
1393
|
return void 0;
|
|
1394
1394
|
});
|
|
@@ -1418,7 +1418,7 @@ function usePresenterWindow(input) {
|
|
|
1418
1418
|
}
|
|
1419
1419
|
};
|
|
1420
1420
|
if (content) {
|
|
1421
|
-
void
|
|
1421
|
+
void chunkKDW3LLG5_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1422
1422
|
} else {
|
|
1423
1423
|
navigateOrClose(true);
|
|
1424
1424
|
}
|
|
@@ -1444,7 +1444,7 @@ function usePresenterWindow(input) {
|
|
|
1444
1444
|
}
|
|
1445
1445
|
const handleMessage = (event) => {
|
|
1446
1446
|
const message = event.data;
|
|
1447
|
-
if (
|
|
1447
|
+
if (chunkKDW3LLG5_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1448
1448
|
syncStateToAudience(snapshotRef.current);
|
|
1449
1449
|
}
|
|
1450
1450
|
};
|
|
@@ -1473,7 +1473,7 @@ function usePresenterWindow(input) {
|
|
|
1473
1473
|
react.useEffect(() => {
|
|
1474
1474
|
const handleBeforeUnload = () => {
|
|
1475
1475
|
if (sessionIdRef.current) {
|
|
1476
|
-
void
|
|
1476
|
+
void chunkKDW3LLG5_js.clearAudienceContent(sessionIdRef.current);
|
|
1477
1477
|
}
|
|
1478
1478
|
};
|
|
1479
1479
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1526,7 +1526,7 @@ function useAudienceMode(input) {
|
|
|
1526
1526
|
}
|
|
1527
1527
|
channel.onmessage = (event) => {
|
|
1528
1528
|
const data = event.data;
|
|
1529
|
-
if (!
|
|
1529
|
+
if (!chunkKDW3LLG5_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1530
1530
|
return;
|
|
1531
1531
|
}
|
|
1532
1532
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1541,7 +1541,7 @@ function useAudienceMode(input) {
|
|
|
1541
1541
|
}
|
|
1542
1542
|
if (data.type === "presenter-exit") {
|
|
1543
1543
|
if (expectedSessionId) {
|
|
1544
|
-
void
|
|
1544
|
+
void chunkKDW3LLG5_js.clearAudienceContent(expectedSessionId);
|
|
1545
1545
|
}
|
|
1546
1546
|
onSetMode("edit");
|
|
1547
1547
|
try {
|
|
@@ -1552,7 +1552,7 @@ function useAudienceMode(input) {
|
|
|
1552
1552
|
};
|
|
1553
1553
|
if (expectedSessionId) {
|
|
1554
1554
|
channel.postMessage({
|
|
1555
|
-
origin:
|
|
1555
|
+
origin: chunkKDW3LLG5_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1556
1556
|
type: "audience-ready",
|
|
1557
1557
|
sessionId: expectedSessionId
|
|
1558
1558
|
});
|
|
@@ -1584,14 +1584,14 @@ function usePresentationKeyboard(input) {
|
|
|
1584
1584
|
presentationSlideIndex,
|
|
1585
1585
|
setShowRehearsalSummary
|
|
1586
1586
|
} = input;
|
|
1587
|
-
const keyBufferRef = react.useRef(
|
|
1587
|
+
const keyBufferRef = react.useRef(chunkKDW3LLG5_js.createPresentationKeyBuffer());
|
|
1588
1588
|
react.useEffect(() => {
|
|
1589
1589
|
if (mode !== "present") {
|
|
1590
|
-
keyBufferRef.current =
|
|
1590
|
+
keyBufferRef.current = chunkKDW3LLG5_js.createPresentationKeyBuffer();
|
|
1591
1591
|
return;
|
|
1592
1592
|
}
|
|
1593
1593
|
const handleKeyDown = (event) => {
|
|
1594
|
-
const mapped =
|
|
1594
|
+
const mapped = chunkKDW3LLG5_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1595
1595
|
if (mapped.action === "none") {
|
|
1596
1596
|
return;
|
|
1597
1597
|
}
|
|
@@ -1799,7 +1799,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1799
1799
|
return;
|
|
1800
1800
|
}
|
|
1801
1801
|
if (action.url && !actionStr.includes("hlinksldjump")) {
|
|
1802
|
-
if (
|
|
1802
|
+
if (chunkKDW3LLG5_js.isUrlSafe(action.url)) {
|
|
1803
1803
|
window.open(action.url, "_blank", "noopener,noreferrer");
|
|
1804
1804
|
}
|
|
1805
1805
|
}
|
|
@@ -1809,7 +1809,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1809
1809
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1810
1810
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1811
1811
|
const transition = incomingSlide?.transition;
|
|
1812
|
-
const durationMs = deps.playTransition ?
|
|
1812
|
+
const durationMs = deps.playTransition ? chunkKDW3LLG5_js.resolveTransitionDurationMs(transition) : 0;
|
|
1813
1813
|
deps.clearPresentationTimers();
|
|
1814
1814
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1815
1815
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -2055,17 +2055,17 @@ function useZoomNavigation(input) {
|
|
|
2055
2055
|
};
|
|
2056
2056
|
}
|
|
2057
2057
|
function usePresenterConsole(slideIndex) {
|
|
2058
|
-
const timerRef = react.useRef(
|
|
2059
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2058
|
+
const timerRef = react.useRef(chunkKDW3LLG5_js.createPresenterTimer());
|
|
2059
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkKDW3LLG5_js.createInitialPresentationSnapshot(slideIndex));
|
|
2060
2060
|
const patch = react.useCallback((value) => {
|
|
2061
|
-
setSnapshot((current) =>
|
|
2061
|
+
setSnapshot((current) => chunkKDW3LLG5_js.mergePresentationSnapshot(current, value));
|
|
2062
2062
|
}, []);
|
|
2063
2063
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2064
2064
|
react.useEffect(() => {
|
|
2065
2065
|
const timer = window.setInterval(() => {
|
|
2066
2066
|
patch({
|
|
2067
2067
|
paused: timerRef.current.paused,
|
|
2068
|
-
elapsedMs:
|
|
2068
|
+
elapsedMs: chunkKDW3LLG5_js.presenterElapsed(timerRef.current)
|
|
2069
2069
|
});
|
|
2070
2070
|
}, 1e3);
|
|
2071
2071
|
return () => window.clearInterval(timer);
|
|
@@ -2075,19 +2075,19 @@ function usePresenterConsole(slideIndex) {
|
|
|
2075
2075
|
applyAudienceSnapshot: setSnapshot,
|
|
2076
2076
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2077
2077
|
toggleTimer: () => {
|
|
2078
|
-
timerRef.current =
|
|
2078
|
+
timerRef.current = chunkKDW3LLG5_js.togglePresenterTimer(timerRef.current);
|
|
2079
2079
|
patch({
|
|
2080
2080
|
paused: timerRef.current.paused,
|
|
2081
|
-
elapsedMs:
|
|
2081
|
+
elapsedMs: chunkKDW3LLG5_js.presenterElapsed(timerRef.current)
|
|
2082
2082
|
});
|
|
2083
2083
|
},
|
|
2084
2084
|
resetTimer: () => {
|
|
2085
|
-
timerRef.current =
|
|
2085
|
+
timerRef.current = chunkKDW3LLG5_js.resetPresenterTimer();
|
|
2086
2086
|
patch({ paused: false, elapsedMs: 0 });
|
|
2087
2087
|
},
|
|
2088
2088
|
stepZoom: (direction) => setSnapshot(
|
|
2089
|
-
(current) =>
|
|
2090
|
-
zoom:
|
|
2089
|
+
(current) => chunkKDW3LLG5_js.mergePresentationSnapshot(current, {
|
|
2090
|
+
zoom: chunkKDW3LLG5_js.stepPresenterZoom(
|
|
2091
2091
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2092
2092
|
direction
|
|
2093
2093
|
)
|
|
@@ -2666,7 +2666,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2666
2666
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2667
2667
|
slides.forEach((slide, slideIndex) => {
|
|
2668
2668
|
for (const element of slide.elements || []) {
|
|
2669
|
-
if (!
|
|
2669
|
+
if (!chunk3TB45PVK_js.hasTextProperties(element)) {
|
|
2670
2670
|
continue;
|
|
2671
2671
|
}
|
|
2672
2672
|
const segments = element.textSegments ?? [];
|
|
@@ -2717,7 +2717,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2717
2717
|
continue;
|
|
2718
2718
|
}
|
|
2719
2719
|
const element = slide.elements[elIdx];
|
|
2720
|
-
if (!
|
|
2720
|
+
if (!chunk3TB45PVK_js.hasTextProperties(element)) {
|
|
2721
2721
|
continue;
|
|
2722
2722
|
}
|
|
2723
2723
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3315,7 +3315,7 @@ function useViewerCoreState(_input) {
|
|
|
3315
3315
|
const shapeAdjustmentDragStateRef = react.useRef(null);
|
|
3316
3316
|
const marqueeStateRef = react.useRef(null);
|
|
3317
3317
|
const isDrawingRef = react.useRef(false);
|
|
3318
|
-
const livePatcher = react.useMemo(() =>
|
|
3318
|
+
const livePatcher = react.useMemo(() => chunkKDW3LLG5_js.createCollaborationLivePatcher(), []);
|
|
3319
3319
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3320
3320
|
const slidesRef = react.useRef([]);
|
|
3321
3321
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3324,8 +3324,8 @@ function useViewerCoreState(_input) {
|
|
|
3324
3324
|
const [slides, setSlides] = react.useState([]);
|
|
3325
3325
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3326
3326
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3327
|
-
width:
|
|
3328
|
-
height:
|
|
3327
|
+
width: chunkP7UVBRFO_js.DEFAULT_CANVAS_WIDTH,
|
|
3328
|
+
height: chunkP7UVBRFO_js.DEFAULT_CANVAS_HEIGHT
|
|
3329
3329
|
});
|
|
3330
3330
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
3331
3331
|
const [selectedElementId, setSelectedElementId] = react.useState(null);
|
|
@@ -3345,7 +3345,7 @@ function useViewerCoreState(_input) {
|
|
|
3345
3345
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3346
3346
|
inlineEditingTextRef.current = resolved;
|
|
3347
3347
|
setInlineEditingTextBase(value);
|
|
3348
|
-
|
|
3348
|
+
chunkKDW3LLG5_js.publishLiveInlineText(
|
|
3349
3349
|
livePatcher,
|
|
3350
3350
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3351
3351
|
inlineEditingElementIdRef.current,
|
|
@@ -3670,7 +3670,7 @@ function useLoadContent({
|
|
|
3670
3670
|
);
|
|
3671
3671
|
}
|
|
3672
3672
|
const previousHandler = handlerRef.current;
|
|
3673
|
-
const handler = new
|
|
3673
|
+
const handler = new chunk3TB45PVK_js.PptxHandler();
|
|
3674
3674
|
const parsed = await handler.load(buffer);
|
|
3675
3675
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3676
3676
|
handler.dispose();
|
|
@@ -3682,7 +3682,7 @@ function useLoadContent({
|
|
|
3682
3682
|
handlerRef.current = null;
|
|
3683
3683
|
const mediaElements = [];
|
|
3684
3684
|
for (const slide of parsed.slides) {
|
|
3685
|
-
|
|
3685
|
+
chunkKDW3LLG5_js.collectMediaElements(slide.elements, mediaElements);
|
|
3686
3686
|
}
|
|
3687
3687
|
for (const url of mediaDataUrls.values()) {
|
|
3688
3688
|
if (url.startsWith("blob:")) {
|
|
@@ -3723,7 +3723,7 @@ function useLoadContent({
|
|
|
3723
3723
|
}
|
|
3724
3724
|
})
|
|
3725
3725
|
);
|
|
3726
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3726
|
+
const { paths: imagePaths, refs: imageRefs } = chunkKDW3LLG5_js.collectImagePaths(parsed.slides);
|
|
3727
3727
|
let nextSlides = parsed.slides;
|
|
3728
3728
|
if (imagePaths.size > 0) {
|
|
3729
3729
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3778,12 +3778,12 @@ function useLoadContent({
|
|
|
3778
3778
|
}
|
|
3779
3779
|
}
|
|
3780
3780
|
handlerRef.current = handler;
|
|
3781
|
-
const partition =
|
|
3781
|
+
const partition = chunkP7UVBRFO_js.partitionTemplateElements(nextSlides);
|
|
3782
3782
|
setSlides(partition.slides);
|
|
3783
3783
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3784
3784
|
setCanvasSize({
|
|
3785
|
-
width: parsed.width ??
|
|
3786
|
-
height: parsed.height ??
|
|
3785
|
+
width: parsed.width ?? chunkP7UVBRFO_js.DEFAULT_CANVAS_WIDTH,
|
|
3786
|
+
height: parsed.height ?? chunkP7UVBRFO_js.DEFAULT_CANVAS_HEIGHT
|
|
3787
3787
|
});
|
|
3788
3788
|
setHeaderFooter(parsed.headerFooter ?? {});
|
|
3789
3789
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
@@ -3812,7 +3812,7 @@ function useLoadContent({
|
|
|
3812
3812
|
setHasMacros(parsed.hasMacros === true);
|
|
3813
3813
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3814
3814
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3815
|
-
setGuides(
|
|
3815
|
+
setGuides(chunkKDW3LLG5_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3816
3816
|
setActiveSlideIndex(0);
|
|
3817
3817
|
clearSelection();
|
|
3818
3818
|
setIsDirty(false);
|
|
@@ -3820,7 +3820,7 @@ function useLoadContent({
|
|
|
3820
3820
|
onContentApplied?.();
|
|
3821
3821
|
} catch (err) {
|
|
3822
3822
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3823
|
-
if (err instanceof
|
|
3823
|
+
if (err instanceof chunk3TB45PVK_js.EncryptedFileError) {
|
|
3824
3824
|
setIsEncrypted(true);
|
|
3825
3825
|
} else {
|
|
3826
3826
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3897,7 +3897,7 @@ function useAutosave(input) {
|
|
|
3897
3897
|
isSavingRef.current = false;
|
|
3898
3898
|
return;
|
|
3899
3899
|
}
|
|
3900
|
-
await
|
|
3900
|
+
await chunkKDW3LLG5_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
3901
3901
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
3902
3902
|
} catch (err) {
|
|
3903
3903
|
setAutosaveStatus({
|
|
@@ -3962,7 +3962,7 @@ function useElementOperations(input) {
|
|
|
3962
3962
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
3963
3963
|
const updateElementById = react.useCallback(
|
|
3964
3964
|
(elementId, updates) => {
|
|
3965
|
-
if (
|
|
3965
|
+
if (chunkKDW3LLG5_js.isTemplateElementId(elementId)) {
|
|
3966
3966
|
const slideId = activeSlide?.id;
|
|
3967
3967
|
if (slideId) {
|
|
3968
3968
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4002,7 +4002,7 @@ function useElementOperations(input) {
|
|
|
4002
4002
|
);
|
|
4003
4003
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4004
4004
|
(updates) => {
|
|
4005
|
-
if (!selectedElement || !
|
|
4005
|
+
if (!selectedElement || !chunk3TB45PVK_js.hasShapeProperties(selectedElement)) {
|
|
4006
4006
|
return;
|
|
4007
4007
|
}
|
|
4008
4008
|
updateSelectedElement({
|
|
@@ -4013,17 +4013,17 @@ function useElementOperations(input) {
|
|
|
4013
4013
|
);
|
|
4014
4014
|
const updateSelectedTextStyle = react.useCallback(
|
|
4015
4015
|
(updates) => {
|
|
4016
|
-
if (!selectedElement || !
|
|
4016
|
+
if (!selectedElement || !chunk3TB45PVK_js.hasTextProperties(selectedElement)) {
|
|
4017
4017
|
return;
|
|
4018
4018
|
}
|
|
4019
|
-
const inlineSel =
|
|
4019
|
+
const inlineSel = chunkKDW3LLG5_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4020
4020
|
if (inlineSel && selectedElement.textSegments) {
|
|
4021
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4021
|
+
const { newSegments: newSegments2, newSelection } = chunkKDW3LLG5_js.applyStyleToSelectedSegments(
|
|
4022
4022
|
selectedElement.textSegments,
|
|
4023
4023
|
inlineSel,
|
|
4024
4024
|
updates
|
|
4025
4025
|
);
|
|
4026
|
-
|
|
4026
|
+
chunkKDW3LLG5_js.setPendingSelectionRestore(newSelection);
|
|
4027
4027
|
updateSelectedElement({
|
|
4028
4028
|
textSegments: newSegments2
|
|
4029
4029
|
});
|
|
@@ -4043,12 +4043,12 @@ function useElementOperations(input) {
|
|
|
4043
4043
|
);
|
|
4044
4044
|
const updateSelectedTextCase = react.useCallback(
|
|
4045
4045
|
(mode) => {
|
|
4046
|
-
if (!selectedElement || !
|
|
4046
|
+
if (!selectedElement || !chunk3TB45PVK_js.hasTextProperties(selectedElement)) {
|
|
4047
4047
|
return;
|
|
4048
4048
|
}
|
|
4049
|
-
const inlineSel =
|
|
4049
|
+
const inlineSel = chunkKDW3LLG5_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4050
4050
|
if (inlineSel && selectedElement.textSegments) {
|
|
4051
|
-
const newSegments =
|
|
4051
|
+
const newSegments = chunkKDW3LLG5_js.applyCaseTransformToSegments(
|
|
4052
4052
|
selectedElement.textSegments,
|
|
4053
4053
|
inlineSel,
|
|
4054
4054
|
mode
|
|
@@ -4058,14 +4058,14 @@ function useElementOperations(input) {
|
|
|
4058
4058
|
}
|
|
4059
4059
|
const updates = {};
|
|
4060
4060
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4061
|
-
updates.textSegments =
|
|
4061
|
+
updates.textSegments = chunkKDW3LLG5_js.applyCaseTransformToSegments(
|
|
4062
4062
|
selectedElement.textSegments,
|
|
4063
4063
|
null,
|
|
4064
4064
|
mode
|
|
4065
4065
|
);
|
|
4066
4066
|
}
|
|
4067
4067
|
if (typeof selectedElement.text === "string") {
|
|
4068
|
-
updates.text =
|
|
4068
|
+
updates.text = chunkKDW3LLG5_js.transformTextCase(selectedElement.text, mode);
|
|
4069
4069
|
}
|
|
4070
4070
|
updateSelectedElement(updates);
|
|
4071
4071
|
},
|
|
@@ -4120,7 +4120,7 @@ function useSectionOperations(input) {
|
|
|
4120
4120
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4121
4121
|
const addSection2 = react.useCallback(
|
|
4122
4122
|
(name, afterSlideIndex) => {
|
|
4123
|
-
const result =
|
|
4123
|
+
const result = chunkKDW3LLG5_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4124
4124
|
setSlides(result.slides);
|
|
4125
4125
|
setSections(result.sections);
|
|
4126
4126
|
markDirty();
|
|
@@ -4129,7 +4129,7 @@ function useSectionOperations(input) {
|
|
|
4129
4129
|
);
|
|
4130
4130
|
const renameSection2 = react.useCallback(
|
|
4131
4131
|
(sectionId, newName) => {
|
|
4132
|
-
const result =
|
|
4132
|
+
const result = chunkKDW3LLG5_js.renameSection(sections, slides, sectionId, newName);
|
|
4133
4133
|
setSections(result.sections);
|
|
4134
4134
|
setSlides(result.slides);
|
|
4135
4135
|
markDirty();
|
|
@@ -4138,7 +4138,7 @@ function useSectionOperations(input) {
|
|
|
4138
4138
|
);
|
|
4139
4139
|
const deleteSection2 = react.useCallback(
|
|
4140
4140
|
(sectionId) => {
|
|
4141
|
-
const result =
|
|
4141
|
+
const result = chunkKDW3LLG5_js.deleteSection(sections, slides, sectionId);
|
|
4142
4142
|
setSections(result.sections);
|
|
4143
4143
|
setSlides(result.slides);
|
|
4144
4144
|
markDirty();
|
|
@@ -4147,21 +4147,21 @@ function useSectionOperations(input) {
|
|
|
4147
4147
|
);
|
|
4148
4148
|
const moveSectionUp2 = react.useCallback(
|
|
4149
4149
|
(sectionId) => {
|
|
4150
|
-
setSections(
|
|
4150
|
+
setSections(chunkKDW3LLG5_js.moveSectionUp(sections, sectionId));
|
|
4151
4151
|
markDirty();
|
|
4152
4152
|
},
|
|
4153
4153
|
[sections, setSections, markDirty]
|
|
4154
4154
|
);
|
|
4155
4155
|
const moveSectionDown2 = react.useCallback(
|
|
4156
4156
|
(sectionId) => {
|
|
4157
|
-
setSections(
|
|
4157
|
+
setSections(chunkKDW3LLG5_js.moveSectionDown(sections, sectionId));
|
|
4158
4158
|
markDirty();
|
|
4159
4159
|
},
|
|
4160
4160
|
[sections, setSections, markDirty]
|
|
4161
4161
|
);
|
|
4162
4162
|
const moveSlidesToSection2 = react.useCallback(
|
|
4163
4163
|
(slideIndexes, targetSectionId) => {
|
|
4164
|
-
const result =
|
|
4164
|
+
const result = chunkKDW3LLG5_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4165
4165
|
setSlides(result.slides);
|
|
4166
4166
|
setSections(result.sections);
|
|
4167
4167
|
markDirty();
|
|
@@ -4180,19 +4180,19 @@ function useSectionOperations(input) {
|
|
|
4180
4180
|
|
|
4181
4181
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4182
4182
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4183
|
-
const resized =
|
|
4183
|
+
const resized = chunkKDW3LLG5_js.applyResize(
|
|
4184
4184
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4185
4185
|
handle,
|
|
4186
4186
|
dx,
|
|
4187
4187
|
dy,
|
|
4188
4188
|
1,
|
|
4189
|
-
{ minSize:
|
|
4189
|
+
{ minSize: chunkP7UVBRFO_js.MIN_ELEMENT_SIZE }
|
|
4190
4190
|
);
|
|
4191
4191
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4192
4192
|
if (!snapToGrid) {
|
|
4193
4193
|
return box;
|
|
4194
4194
|
}
|
|
4195
|
-
return
|
|
4195
|
+
return chunkKDW3LLG5_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkP7UVBRFO_js.MIN_ELEMENT_SIZE);
|
|
4196
4196
|
}
|
|
4197
4197
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
4198
4198
|
const range = startWidth || 200;
|
|
@@ -4310,7 +4310,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4310
4310
|
width: el.width,
|
|
4311
4311
|
height: el.height
|
|
4312
4312
|
}));
|
|
4313
|
-
const snapResult =
|
|
4313
|
+
const snapResult = chunkKDW3LLG5_js.computeSnapToShape(
|
|
4314
4314
|
targetX,
|
|
4315
4315
|
targetY,
|
|
4316
4316
|
primaryEl.width,
|
|
@@ -4349,7 +4349,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4349
4349
|
if (live) {
|
|
4350
4350
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4351
4351
|
const start = drag.startPositionsById[id];
|
|
4352
|
-
|
|
4352
|
+
chunkKDW3LLG5_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4353
4353
|
x: start.x + appliedDx,
|
|
4354
4354
|
y: start.y + appliedDy
|
|
4355
4355
|
});
|
|
@@ -4383,15 +4383,15 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4383
4383
|
if (rs.domEl) {
|
|
4384
4384
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4385
4385
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4386
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4387
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4386
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunkP7UVBRFO_js.MIN_ELEMENT_SIZE)}px`;
|
|
4387
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunkP7UVBRFO_js.MIN_ELEMENT_SIZE)}px`;
|
|
4388
4388
|
}
|
|
4389
4389
|
if (live) {
|
|
4390
|
-
|
|
4390
|
+
chunkKDW3LLG5_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4391
4391
|
x: geo.x,
|
|
4392
4392
|
y: geo.y,
|
|
4393
|
-
width: Math.max(geo.width,
|
|
4394
|
-
height: Math.max(geo.height,
|
|
4393
|
+
width: Math.max(geo.width, chunkP7UVBRFO_js.MIN_ELEMENT_SIZE),
|
|
4394
|
+
height: Math.max(geo.height, chunkP7UVBRFO_js.MIN_ELEMENT_SIZE)
|
|
4395
4395
|
});
|
|
4396
4396
|
}
|
|
4397
4397
|
}
|
|
@@ -4471,13 +4471,13 @@ function processPointerUp(input) {
|
|
|
4471
4471
|
if (i !== activeSlideIndex) {
|
|
4472
4472
|
return s;
|
|
4473
4473
|
}
|
|
4474
|
-
const rerouted =
|
|
4474
|
+
const rerouted = chunkKDW3LLG5_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4475
4475
|
if (rerouted.length === 0) {
|
|
4476
4476
|
return s;
|
|
4477
4477
|
}
|
|
4478
4478
|
return {
|
|
4479
4479
|
...s,
|
|
4480
|
-
elements:
|
|
4480
|
+
elements: chunkKDW3LLG5_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4481
4481
|
};
|
|
4482
4482
|
})
|
|
4483
4483
|
);
|
|
@@ -4499,9 +4499,9 @@ function processPointerUp(input) {
|
|
|
4499
4499
|
}
|
|
4500
4500
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4501
4501
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4502
|
-
const hitIds =
|
|
4502
|
+
const hitIds = chunkKDW3LLG5_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4503
4503
|
if (marquee.additive) {
|
|
4504
|
-
const merged =
|
|
4504
|
+
const merged = chunkKDW3LLG5_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4505
4505
|
if (merged.length > 0) {
|
|
4506
4506
|
applySelection(merged[0], merged);
|
|
4507
4507
|
} else {
|
|
@@ -4524,8 +4524,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4524
4524
|
}
|
|
4525
4525
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4526
4526
|
});
|
|
4527
|
-
const rerouted =
|
|
4528
|
-
return
|
|
4527
|
+
const rerouted = chunkKDW3LLG5_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4528
|
+
return chunkKDW3LLG5_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4529
4529
|
};
|
|
4530
4530
|
if (editTemplateMode) {
|
|
4531
4531
|
const slideId = activeSlide?.id;
|
|
@@ -4678,9 +4678,9 @@ function useCanvasInteractions(input) {
|
|
|
4678
4678
|
return;
|
|
4679
4679
|
}
|
|
4680
4680
|
const el = elementLookup.get(editId);
|
|
4681
|
-
if (el &&
|
|
4681
|
+
if (el && chunk3TB45PVK_js.hasTextProperties(el)) {
|
|
4682
4682
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4683
|
-
const newSegments =
|
|
4683
|
+
const newSegments = chunkKDW3LLG5_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4684
4684
|
ops.updateElementById(editId, {
|
|
4685
4685
|
text: committedText,
|
|
4686
4686
|
textSegments: newSegments
|
|
@@ -4691,7 +4691,7 @@ function useCanvasInteractions(input) {
|
|
|
4691
4691
|
setInlineEditingText("");
|
|
4692
4692
|
};
|
|
4693
4693
|
const openEquationEditorForElement = (el) => {
|
|
4694
|
-
if (!
|
|
4694
|
+
if (!chunk3TB45PVK_js.hasTextProperties(el)) {
|
|
4695
4695
|
return false;
|
|
4696
4696
|
}
|
|
4697
4697
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4720,7 +4720,7 @@ function useCanvasInteractions(input) {
|
|
|
4720
4720
|
justSelectedRef.current = false;
|
|
4721
4721
|
} else {
|
|
4722
4722
|
const el = elementLookup.get(elementId);
|
|
4723
|
-
if (el &&
|
|
4723
|
+
if (el && chunk3TB45PVK_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
4724
4724
|
if (!openEquationEditorForElement(el)) {
|
|
4725
4725
|
setInlineEditingElementId(elementId);
|
|
4726
4726
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4739,7 +4739,7 @@ function useCanvasInteractions(input) {
|
|
|
4739
4739
|
if (openEquationEditorForElement(el)) {
|
|
4740
4740
|
return;
|
|
4741
4741
|
}
|
|
4742
|
-
if (
|
|
4742
|
+
if (chunk3TB45PVK_js.hasTextProperties(el)) {
|
|
4743
4743
|
setInlineEditingElementId(elementId);
|
|
4744
4744
|
setInlineEditingText(el.text ?? "");
|
|
4745
4745
|
}
|
|
@@ -4929,7 +4929,7 @@ function createFileHandlers(deps) {
|
|
|
4929
4929
|
h = Math.round(h * scale);
|
|
4930
4930
|
}
|
|
4931
4931
|
addElement({
|
|
4932
|
-
id:
|
|
4932
|
+
id: chunkKDW3LLG5_js.generateElementId(),
|
|
4933
4933
|
type: "image",
|
|
4934
4934
|
x: Math.round((canvasSize.width - w) / 2),
|
|
4935
4935
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -4940,7 +4940,7 @@ function createFileHandlers(deps) {
|
|
|
4940
4940
|
};
|
|
4941
4941
|
img.onerror = () => {
|
|
4942
4942
|
addElement({
|
|
4943
|
-
id:
|
|
4943
|
+
id: chunkKDW3LLG5_js.generateElementId(),
|
|
4944
4944
|
type: "image",
|
|
4945
4945
|
x: 100,
|
|
4946
4946
|
y: 100,
|
|
@@ -4966,7 +4966,7 @@ function createFileHandlers(deps) {
|
|
|
4966
4966
|
const elFilePath = file.path;
|
|
4967
4967
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
4968
4968
|
addElement({
|
|
4969
|
-
id:
|
|
4969
|
+
id: chunkKDW3LLG5_js.generateElementId(),
|
|
4970
4970
|
type: "media",
|
|
4971
4971
|
mediaType,
|
|
4972
4972
|
mediaMimeType: file.type || void 0,
|
|
@@ -5141,13 +5141,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5141
5141
|
return;
|
|
5142
5142
|
}
|
|
5143
5143
|
addElement({
|
|
5144
|
-
id:
|
|
5144
|
+
id: chunkKDW3LLG5_js.generateElementId(),
|
|
5145
5145
|
type: "smartArt",
|
|
5146
5146
|
x: 100,
|
|
5147
5147
|
y: 120,
|
|
5148
5148
|
width: 600,
|
|
5149
5149
|
height: 340,
|
|
5150
|
-
smartArtData:
|
|
5150
|
+
smartArtData: chunkKDW3LLG5_js.buildSmartArtPresetData(
|
|
5151
5151
|
layout,
|
|
5152
5152
|
defaultItems,
|
|
5153
5153
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5159,7 +5159,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5159
5159
|
return;
|
|
5160
5160
|
}
|
|
5161
5161
|
addElement({
|
|
5162
|
-
id:
|
|
5162
|
+
id: chunkKDW3LLG5_js.generateElementId(),
|
|
5163
5163
|
type: "shape",
|
|
5164
5164
|
x: 120,
|
|
5165
5165
|
y: 200,
|
|
@@ -5218,7 +5218,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5218
5218
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5219
5219
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5220
5220
|
addElement({
|
|
5221
|
-
id:
|
|
5221
|
+
id: chunkKDW3LLG5_js.generateElementId(),
|
|
5222
5222
|
type: "shape",
|
|
5223
5223
|
x: 120,
|
|
5224
5224
|
y: 200,
|
|
@@ -5240,11 +5240,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5240
5240
|
if (!activeSlide) {
|
|
5241
5241
|
return;
|
|
5242
5242
|
}
|
|
5243
|
-
const preset =
|
|
5243
|
+
const preset = chunkKDW3LLG5_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5244
5244
|
if (!preset) {
|
|
5245
5245
|
return;
|
|
5246
5246
|
}
|
|
5247
|
-
const defaultPptxAction =
|
|
5247
|
+
const defaultPptxAction = chunk3TB45PVK_js.elementActionToPptxAction({
|
|
5248
5248
|
trigger: "click",
|
|
5249
5249
|
type: preset.defaultAction
|
|
5250
5250
|
});
|
|
@@ -5253,7 +5253,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5253
5253
|
defaultPptxAction.highlightClick = true;
|
|
5254
5254
|
}
|
|
5255
5255
|
addElement({
|
|
5256
|
-
id:
|
|
5256
|
+
id: chunkKDW3LLG5_js.generateElementId(),
|
|
5257
5257
|
type: "shape",
|
|
5258
5258
|
x: 150,
|
|
5259
5259
|
y: 150,
|
|
@@ -5320,14 +5320,14 @@ function useInsertElements(input) {
|
|
|
5320
5320
|
return;
|
|
5321
5321
|
}
|
|
5322
5322
|
addElement({
|
|
5323
|
-
id:
|
|
5323
|
+
id: chunkKDW3LLG5_js.generateElementId(),
|
|
5324
5324
|
type: "text",
|
|
5325
5325
|
x: 100,
|
|
5326
5326
|
y: 100,
|
|
5327
5327
|
width: 300,
|
|
5328
5328
|
height: 60,
|
|
5329
5329
|
text: "",
|
|
5330
|
-
textStyle: { fontSize:
|
|
5330
|
+
textStyle: { fontSize: chunkP7UVBRFO_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5331
5331
|
});
|
|
5332
5332
|
};
|
|
5333
5333
|
const handleAddShape = () => {
|
|
@@ -5335,7 +5335,7 @@ function useInsertElements(input) {
|
|
|
5335
5335
|
return;
|
|
5336
5336
|
}
|
|
5337
5337
|
addElement({
|
|
5338
|
-
id:
|
|
5338
|
+
id: chunkKDW3LLG5_js.generateElementId(),
|
|
5339
5339
|
type: "shape",
|
|
5340
5340
|
x: 150,
|
|
5341
5341
|
y: 150,
|
|
@@ -5354,15 +5354,15 @@ function useInsertElements(input) {
|
|
|
5354
5354
|
return;
|
|
5355
5355
|
}
|
|
5356
5356
|
addElement({
|
|
5357
|
-
...
|
|
5358
|
-
id:
|
|
5357
|
+
...chunkKDW3LLG5_js.newTableElement(chunkP7UVBRFO_js.DEFAULT_TABLE_ROWS, chunkP7UVBRFO_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5358
|
+
id: chunkKDW3LLG5_js.generateElementId()
|
|
5359
5359
|
});
|
|
5360
5360
|
};
|
|
5361
5361
|
const handleAddChart = (chartType) => {
|
|
5362
5362
|
if (!activeSlide) {
|
|
5363
5363
|
return;
|
|
5364
5364
|
}
|
|
5365
|
-
addElement(
|
|
5365
|
+
addElement(chunkKDW3LLG5_js.createDefaultChartElement(chartType));
|
|
5366
5366
|
};
|
|
5367
5367
|
const structured = createStructuredElementHandlers({
|
|
5368
5368
|
activeSlide,
|
|
@@ -5432,7 +5432,7 @@ function useClipboardHandlers(input) {
|
|
|
5432
5432
|
if (!selectedElement) {
|
|
5433
5433
|
return;
|
|
5434
5434
|
}
|
|
5435
|
-
setClipboardPayload(
|
|
5435
|
+
setClipboardPayload(chunkKDW3LLG5_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5436
5436
|
};
|
|
5437
5437
|
const handleDelete = () => {
|
|
5438
5438
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5449,7 +5449,7 @@ function useClipboardHandlers(input) {
|
|
|
5449
5449
|
handleDelete();
|
|
5450
5450
|
};
|
|
5451
5451
|
const insertClone = (source) => {
|
|
5452
|
-
const clone =
|
|
5452
|
+
const clone = chunkKDW3LLG5_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5453
5453
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5454
5454
|
ops.applySelection(clone.id);
|
|
5455
5455
|
history.markDirty();
|
|
@@ -5484,7 +5484,7 @@ function resolveShapePath(el) {
|
|
|
5484
5484
|
return el.pathData;
|
|
5485
5485
|
}
|
|
5486
5486
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5487
|
-
const clipPath =
|
|
5487
|
+
const clipPath = chunk3TB45PVK_js.getPresetShapeClipPath(el.shapeType);
|
|
5488
5488
|
if (clipPath) {
|
|
5489
5489
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5490
5490
|
if (svgPath) {
|
|
@@ -5535,7 +5535,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5535
5535
|
return parts.join(" ");
|
|
5536
5536
|
}
|
|
5537
5537
|
function transformPathToGlobal(pathData, el) {
|
|
5538
|
-
const polys =
|
|
5538
|
+
const polys = chunk3TB45PVK_js.svgPathToPolygons(pathData);
|
|
5539
5539
|
if (polys.length === 0) {
|
|
5540
5540
|
return pathData;
|
|
5541
5541
|
}
|
|
@@ -5555,10 +5555,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5555
5555
|
y: pt.y * scaleY + el.y
|
|
5556
5556
|
}))
|
|
5557
5557
|
);
|
|
5558
|
-
return
|
|
5558
|
+
return chunk3TB45PVK_js.polygonsToSvgPath(transformed);
|
|
5559
5559
|
}
|
|
5560
5560
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5561
|
-
const polys =
|
|
5561
|
+
const polys = chunk3TB45PVK_js.svgPathToPolygons(pathData);
|
|
5562
5562
|
if (polys.length === 0) {
|
|
5563
5563
|
return pathData;
|
|
5564
5564
|
}
|
|
@@ -5568,10 +5568,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5568
5568
|
y: pt.y - y
|
|
5569
5569
|
}))
|
|
5570
5570
|
);
|
|
5571
|
-
return
|
|
5571
|
+
return chunk3TB45PVK_js.polygonsToSvgPath(transformed);
|
|
5572
5572
|
}
|
|
5573
5573
|
function pathBounds(pathData) {
|
|
5574
|
-
const polys =
|
|
5574
|
+
const polys = chunk3TB45PVK_js.svgPathToPolygons(pathData);
|
|
5575
5575
|
let minX = Infinity;
|
|
5576
5576
|
let minY = Infinity;
|
|
5577
5577
|
let maxX = -Infinity;
|
|
@@ -5630,7 +5630,7 @@ function useMergeShapesHandler(input) {
|
|
|
5630
5630
|
let allFragments = [];
|
|
5631
5631
|
let remaining = globalPaths[0];
|
|
5632
5632
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5633
|
-
const frags =
|
|
5633
|
+
const frags = chunk3TB45PVK_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5634
5634
|
if (Array.isArray(frags)) {
|
|
5635
5635
|
allFragments = frags;
|
|
5636
5636
|
}
|
|
@@ -5659,7 +5659,7 @@ function useMergeShapesHandler(input) {
|
|
|
5659
5659
|
bounds.height
|
|
5660
5660
|
);
|
|
5661
5661
|
const newEl = {
|
|
5662
|
-
id:
|
|
5662
|
+
id: chunkKDW3LLG5_js.generateElementId(),
|
|
5663
5663
|
type: "shape",
|
|
5664
5664
|
x: bounds.x,
|
|
5665
5665
|
y: bounds.y,
|
|
@@ -5697,7 +5697,7 @@ function useMergeShapesHandler(input) {
|
|
|
5697
5697
|
} else {
|
|
5698
5698
|
let resultPath = globalPaths[0];
|
|
5699
5699
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5700
|
-
const result =
|
|
5700
|
+
const result = chunk3TB45PVK_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5701
5701
|
if (typeof result === "string") {
|
|
5702
5702
|
resultPath = result;
|
|
5703
5703
|
}
|
|
@@ -5718,7 +5718,7 @@ function useMergeShapesHandler(input) {
|
|
|
5718
5718
|
);
|
|
5719
5719
|
const primary = targets[0];
|
|
5720
5720
|
const newEl = {
|
|
5721
|
-
id:
|
|
5721
|
+
id: chunkKDW3LLG5_js.generateElementId(),
|
|
5722
5722
|
type: "shape",
|
|
5723
5723
|
x: bounds.x,
|
|
5724
5724
|
y: bounds.y,
|
|
@@ -5781,7 +5781,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5781
5781
|
if (ids.length < 2 || !activeSlide) {
|
|
5782
5782
|
return;
|
|
5783
5783
|
}
|
|
5784
|
-
const { elements, groupId } =
|
|
5784
|
+
const { elements, groupId } = chunkKDW3LLG5_js.groupElements(ops.activeElements, ids, chunkKDW3LLG5_js.generateElementId());
|
|
5785
5785
|
if (groupId === null) {
|
|
5786
5786
|
return;
|
|
5787
5787
|
}
|
|
@@ -5794,12 +5794,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5794
5794
|
return;
|
|
5795
5795
|
}
|
|
5796
5796
|
const group = selectedElement;
|
|
5797
|
-
const intoTemplate =
|
|
5797
|
+
const intoTemplate = chunkKDW3LLG5_js.isTemplateElementId(group.id);
|
|
5798
5798
|
const ungrouped = group.children.map((child) => ({
|
|
5799
5799
|
...structuredClone(child),
|
|
5800
5800
|
// Keep child ids in the same store as the group so later edits route
|
|
5801
5801
|
// correctly: template groups yield template-prefixed child ids.
|
|
5802
|
-
id: intoTemplate ?
|
|
5802
|
+
id: intoTemplate ? chunkKDW3LLG5_js.makeCloneId(true, child.id || group.id) : child.id || chunkKDW3LLG5_js.generateElementId(),
|
|
5803
5803
|
x: child.x + group.x,
|
|
5804
5804
|
y: child.y + group.y
|
|
5805
5805
|
}));
|
|
@@ -5823,7 +5823,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5823
5823
|
if (!edge) {
|
|
5824
5824
|
return;
|
|
5825
5825
|
}
|
|
5826
|
-
const positions =
|
|
5826
|
+
const positions = chunkKDW3LLG5_js.alignElements(selectedElements, edge);
|
|
5827
5827
|
for (const [id, pos] of positions) {
|
|
5828
5828
|
const el = elementLookup.get(id);
|
|
5829
5829
|
if (!el) {
|
|
@@ -5841,7 +5841,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5841
5841
|
if (!distAxis) {
|
|
5842
5842
|
return;
|
|
5843
5843
|
}
|
|
5844
|
-
const positions =
|
|
5844
|
+
const positions = chunkKDW3LLG5_js.distributeElements(selectedElements, distAxis);
|
|
5845
5845
|
for (const [id, pos] of positions) {
|
|
5846
5846
|
const el = elementLookup.get(id);
|
|
5847
5847
|
if (!el) {
|
|
@@ -5858,7 +5858,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5858
5858
|
}
|
|
5859
5859
|
const id = selectedElement.id;
|
|
5860
5860
|
ops.updateActiveElements(
|
|
5861
|
-
(els) => direction === "forward" ?
|
|
5861
|
+
(els) => direction === "forward" ? chunkKDW3LLG5_js.bringForward(els, id) : direction === "backward" ? chunkKDW3LLG5_js.sendBackward(els, id) : els
|
|
5862
5862
|
);
|
|
5863
5863
|
history.markDirty();
|
|
5864
5864
|
};
|
|
@@ -5868,7 +5868,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5868
5868
|
}
|
|
5869
5869
|
const id = selectedElement.id;
|
|
5870
5870
|
ops.updateActiveElements(
|
|
5871
|
-
(els) => direction === "front" ?
|
|
5871
|
+
(els) => direction === "front" ? chunkKDW3LLG5_js.bringToFront(els, id) : chunkKDW3LLG5_js.sendToBack(els, id)
|
|
5872
5872
|
);
|
|
5873
5873
|
history.markDirty();
|
|
5874
5874
|
};
|
|
@@ -5990,7 +5990,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
5990
5990
|
function useSlideManagement(input) {
|
|
5991
5991
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
5992
5992
|
const handleAddSlide = () => {
|
|
5993
|
-
const newSlide =
|
|
5993
|
+
const newSlide = chunkKDW3LLG5_js.createBlankSlide(slides.length + 1);
|
|
5994
5994
|
ops.updateSlides((prev) => {
|
|
5995
5995
|
const next = [...prev];
|
|
5996
5996
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6053,7 +6053,7 @@ function useSlideManagement(input) {
|
|
|
6053
6053
|
}
|
|
6054
6054
|
const clone = {
|
|
6055
6055
|
...src,
|
|
6056
|
-
id:
|
|
6056
|
+
id: chunkKDW3LLG5_js.makeSlideId(),
|
|
6057
6057
|
elements: src.elements.map((el) => ({
|
|
6058
6058
|
...el,
|
|
6059
6059
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6085,7 +6085,7 @@ function useSlideManagement(input) {
|
|
|
6085
6085
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6086
6086
|
const insertAt = activeSlideIndex + 1;
|
|
6087
6087
|
const draft = {
|
|
6088
|
-
...
|
|
6088
|
+
...chunkKDW3LLG5_js.createBlankSlide(slides.length + 1),
|
|
6089
6089
|
layoutPath,
|
|
6090
6090
|
...layoutName ? { layoutName } : {}
|
|
6091
6091
|
};
|
|
@@ -6146,7 +6146,7 @@ function createTableMergeHandlers(input) {
|
|
|
6146
6146
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6147
6147
|
return;
|
|
6148
6148
|
}
|
|
6149
|
-
const newTableData =
|
|
6149
|
+
const newTableData = chunkKDW3LLG5_js.mergeCells(
|
|
6150
6150
|
[
|
|
6151
6151
|
{ row: rowIndex, col: columnIndex },
|
|
6152
6152
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6154,7 +6154,7 @@ function createTableMergeHandlers(input) {
|
|
|
6154
6154
|
td
|
|
6155
6155
|
);
|
|
6156
6156
|
const updates = { tableData: newTableData };
|
|
6157
|
-
const newRawXml =
|
|
6157
|
+
const newRawXml = chunk3TB45PVK_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6158
6158
|
if (newRawXml) {
|
|
6159
6159
|
updates.rawXml = newRawXml;
|
|
6160
6160
|
}
|
|
@@ -6180,7 +6180,7 @@ function createTableMergeHandlers(input) {
|
|
|
6180
6180
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6181
6181
|
return;
|
|
6182
6182
|
}
|
|
6183
|
-
const newTableData =
|
|
6183
|
+
const newTableData = chunkKDW3LLG5_js.mergeCells(
|
|
6184
6184
|
[
|
|
6185
6185
|
{ row: rowIndex, col: columnIndex },
|
|
6186
6186
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6188,7 +6188,7 @@ function createTableMergeHandlers(input) {
|
|
|
6188
6188
|
td
|
|
6189
6189
|
);
|
|
6190
6190
|
const updates = { tableData: newTableData };
|
|
6191
|
-
const newRawXml =
|
|
6191
|
+
const newRawXml = chunk3TB45PVK_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6192
6192
|
if (newRawXml) {
|
|
6193
6193
|
updates.rawXml = newRawXml;
|
|
6194
6194
|
}
|
|
@@ -6203,9 +6203,9 @@ function createTableMergeHandlers(input) {
|
|
|
6203
6203
|
return;
|
|
6204
6204
|
}
|
|
6205
6205
|
const td = selectedElement.tableData;
|
|
6206
|
-
const newTableData =
|
|
6206
|
+
const newTableData = chunkKDW3LLG5_js.mergeCells(ts.selectedCells, td);
|
|
6207
6207
|
const updates = { tableData: newTableData };
|
|
6208
|
-
const newRawXml =
|
|
6208
|
+
const newRawXml = chunk3TB45PVK_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6209
6209
|
if (newRawXml) {
|
|
6210
6210
|
updates.rawXml = newRawXml;
|
|
6211
6211
|
}
|
|
@@ -6222,9 +6222,9 @@ function createTableMergeHandlers(input) {
|
|
|
6222
6222
|
}
|
|
6223
6223
|
const { rowIndex, columnIndex } = ts;
|
|
6224
6224
|
const td = selectedElement.tableData;
|
|
6225
|
-
const newTableData =
|
|
6225
|
+
const newTableData = chunkKDW3LLG5_js.splitCell(rowIndex, columnIndex, td);
|
|
6226
6226
|
const updates = { tableData: newTableData };
|
|
6227
|
-
const newRawXml =
|
|
6227
|
+
const newRawXml = chunk3TB45PVK_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6228
6228
|
if (newRawXml) {
|
|
6229
6229
|
updates.rawXml = newRawXml;
|
|
6230
6230
|
}
|
|
@@ -6268,7 +6268,7 @@ function createTableStructHandlers(input) {
|
|
|
6268
6268
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
6269
6269
|
}
|
|
6270
6270
|
if (el.rawXml) {
|
|
6271
|
-
const newRawXml =
|
|
6271
|
+
const newRawXml = chunk3TB45PVK_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6272
6272
|
if (newRawXml) {
|
|
6273
6273
|
updates.rawXml = newRawXml;
|
|
6274
6274
|
}
|
|
@@ -6292,7 +6292,7 @@ function createTableStructHandlers(input) {
|
|
|
6292
6292
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6293
6293
|
const updates = {};
|
|
6294
6294
|
if (selectedElement.rawXml) {
|
|
6295
|
-
const newRawXml =
|
|
6295
|
+
const newRawXml = chunk3TB45PVK_js.updateCellTextStyleInRawXml(
|
|
6296
6296
|
selectedElement,
|
|
6297
6297
|
rowIndex,
|
|
6298
6298
|
colIndex,
|
|
@@ -6356,9 +6356,9 @@ function createTableStructHandlers(input) {
|
|
|
6356
6356
|
return;
|
|
6357
6357
|
}
|
|
6358
6358
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6359
|
-
const newTableData =
|
|
6359
|
+
const newTableData = chunkKDW3LLG5_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6360
6360
|
const updates = { tableData: newTableData };
|
|
6361
|
-
const newRawXml =
|
|
6361
|
+
const newRawXml = chunk3TB45PVK_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6362
6362
|
if (newRawXml) {
|
|
6363
6363
|
updates.rawXml = newRawXml;
|
|
6364
6364
|
}
|
|
@@ -6371,12 +6371,12 @@ function createTableStructHandlers(input) {
|
|
|
6371
6371
|
}
|
|
6372
6372
|
const td = selectedElement.tableData;
|
|
6373
6373
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6374
|
-
const newTableData =
|
|
6374
|
+
const newTableData = chunkKDW3LLG5_js.deleteTableRow(td, rowIdx);
|
|
6375
6375
|
if (newTableData === td) {
|
|
6376
6376
|
return;
|
|
6377
6377
|
}
|
|
6378
6378
|
const updates = { tableData: newTableData };
|
|
6379
|
-
const newRawXml =
|
|
6379
|
+
const newRawXml = chunk3TB45PVK_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6380
6380
|
if (newRawXml) {
|
|
6381
6381
|
updates.rawXml = newRawXml;
|
|
6382
6382
|
}
|
|
@@ -6388,9 +6388,9 @@ function createTableStructHandlers(input) {
|
|
|
6388
6388
|
return;
|
|
6389
6389
|
}
|
|
6390
6390
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6391
|
-
const newTableData =
|
|
6391
|
+
const newTableData = chunkKDW3LLG5_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6392
6392
|
const updates = { tableData: newTableData };
|
|
6393
|
-
const newRawXml =
|
|
6393
|
+
const newRawXml = chunk3TB45PVK_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6394
6394
|
if (newRawXml) {
|
|
6395
6395
|
updates.rawXml = newRawXml;
|
|
6396
6396
|
}
|
|
@@ -6403,12 +6403,12 @@ function createTableStructHandlers(input) {
|
|
|
6403
6403
|
}
|
|
6404
6404
|
const td = selectedElement.tableData;
|
|
6405
6405
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6406
|
-
const newTableData =
|
|
6406
|
+
const newTableData = chunkKDW3LLG5_js.deleteTableColumn(td, colIdx);
|
|
6407
6407
|
if (newTableData === td) {
|
|
6408
6408
|
return;
|
|
6409
6409
|
}
|
|
6410
6410
|
const updates = { tableData: newTableData };
|
|
6411
|
-
const newRawXml =
|
|
6411
|
+
const newRawXml = chunk3TB45PVK_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6412
6412
|
if (newRawXml) {
|
|
6413
6413
|
updates.rawXml = newRawXml;
|
|
6414
6414
|
}
|
|
@@ -6444,8 +6444,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6444
6444
|
return html2canvasPro(element, {
|
|
6445
6445
|
...options,
|
|
6446
6446
|
onclone: async (doc, clonedEl) => {
|
|
6447
|
-
await
|
|
6448
|
-
|
|
6447
|
+
await chunkKDW3LLG5_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6448
|
+
chunkKDW3LLG5_js.preprocessCssForCapture(clonedEl);
|
|
6449
6449
|
if (typeof userOnClone === "function") {
|
|
6450
6450
|
userOnClone(doc, clonedEl);
|
|
6451
6451
|
}
|
|
@@ -6501,7 +6501,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6501
6501
|
}
|
|
6502
6502
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6503
6503
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6504
|
-
|
|
6504
|
+
chunkKDW3LLG5_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6505
6505
|
}
|
|
6506
6506
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6507
6507
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6523,15 +6523,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6523
6523
|
continue;
|
|
6524
6524
|
}
|
|
6525
6525
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6526
|
-
images.push(
|
|
6526
|
+
images.push(chunkKDW3LLG5_js.canvasToJpegData(canvas));
|
|
6527
6527
|
}
|
|
6528
6528
|
onProgress?.(totalSlides, totalSlides);
|
|
6529
6529
|
setActiveSlide(currentSlideIndex);
|
|
6530
6530
|
if (images.length === 0) {
|
|
6531
6531
|
throw new Error(chunkYIFO3WQO_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6532
6532
|
}
|
|
6533
|
-
const pdfBlobUrl =
|
|
6534
|
-
|
|
6533
|
+
const pdfBlobUrl = chunkP7UVBRFO_js.buildPdfFromImageData(images);
|
|
6534
|
+
chunkKDW3LLG5_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6535
6535
|
}
|
|
6536
6536
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6537
6537
|
const { scale = 2, onProgress } = options;
|
|
@@ -6579,8 +6579,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6579
6579
|
if (pages.length === 0) {
|
|
6580
6580
|
throw new Error(chunkYIFO3WQO_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6581
6581
|
}
|
|
6582
|
-
const pdfDataUrl =
|
|
6583
|
-
|
|
6582
|
+
const pdfDataUrl = chunkP7UVBRFO_js.buildNotesPdf(pages);
|
|
6583
|
+
chunkKDW3LLG5_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6584
6584
|
}
|
|
6585
6585
|
|
|
6586
6586
|
// src/viewer/utils/export-video.ts
|
|
@@ -6624,7 +6624,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6624
6624
|
const fps = 30;
|
|
6625
6625
|
const stream = recordingCanvas.captureStream(fps);
|
|
6626
6626
|
const recorder = new MediaRecorder(stream, {
|
|
6627
|
-
mimeType:
|
|
6627
|
+
mimeType: chunkKDW3LLG5_js.pickSupportedMimeType([...chunkKDW3LLG5_js.WEBM_MIME_CANDIDATES]),
|
|
6628
6628
|
videoBitsPerSecond: 5e6
|
|
6629
6629
|
});
|
|
6630
6630
|
const chunks = [];
|
|
@@ -6647,8 +6647,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6647
6647
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6648
6648
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6649
6649
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6650
|
-
const frameInterval =
|
|
6651
|
-
const framesNeeded =
|
|
6650
|
+
const frameInterval = chunkKDW3LLG5_js.fpsToFrameIntervalMs(fps);
|
|
6651
|
+
const framesNeeded = chunkKDW3LLG5_js.segmentFrameCount(duration, fps);
|
|
6652
6652
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6653
6653
|
if (signal?.aborted) {
|
|
6654
6654
|
recorder.stop();
|
|
@@ -6697,7 +6697,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6697
6697
|
if (frames.length === 0) {
|
|
6698
6698
|
throw new Error(chunkYIFO3WQO_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6699
6699
|
}
|
|
6700
|
-
const gifBytes =
|
|
6700
|
+
const gifBytes = chunkKDW3LLG5_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6701
6701
|
onProgress?.(totalSlides, totalSlides);
|
|
6702
6702
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6703
6703
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6751,7 +6751,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6751
6751
|
continue;
|
|
6752
6752
|
}
|
|
6753
6753
|
onProgress?.(processedCount, data.slides.length);
|
|
6754
|
-
let svg =
|
|
6754
|
+
let svg = chunk3TB45PVK_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6755
6755
|
if (embedFonts && fontFaces?.length) {
|
|
6756
6756
|
svg = injectFontFaces(svg, fontFaces);
|
|
6757
6757
|
}
|
|
@@ -6811,7 +6811,7 @@ function useExportSaveAs(input) {
|
|
|
6811
6811
|
}
|
|
6812
6812
|
setExportProgress(70);
|
|
6813
6813
|
setExportStatusMessage("Writing README...");
|
|
6814
|
-
const readme =
|
|
6814
|
+
const readme = chunkKDW3LLG5_js.generatePackageReadme(pptxFilename);
|
|
6815
6815
|
pkgFolder.file("README.txt", readme);
|
|
6816
6816
|
if (abortCtrl.signal.aborted) {
|
|
6817
6817
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -6822,7 +6822,7 @@ function useExportSaveAs(input) {
|
|
|
6822
6822
|
setExportProgress(95);
|
|
6823
6823
|
setExportStatusMessage("Downloading...");
|
|
6824
6824
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
6825
|
-
|
|
6825
|
+
chunkKDW3LLG5_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
6826
6826
|
setExportProgress(100);
|
|
6827
6827
|
} catch (err) {
|
|
6828
6828
|
if (err.name !== "AbortError") {
|
|
@@ -6845,7 +6845,7 @@ function useExportSaveAs(input) {
|
|
|
6845
6845
|
const blob = new Blob([data], {
|
|
6846
6846
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6847
6847
|
});
|
|
6848
|
-
|
|
6848
|
+
chunkKDW3LLG5_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
6849
6849
|
} catch (err) {
|
|
6850
6850
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
6851
6851
|
}
|
|
@@ -6858,14 +6858,14 @@ function useExportSaveAs(input) {
|
|
|
6858
6858
|
const pptxGuides = guides.map((g) => ({
|
|
6859
6859
|
id: g.id,
|
|
6860
6860
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
6861
|
-
positionEmu:
|
|
6861
|
+
positionEmu: chunk3TB45PVK_js.guidePxToEmu(g.position)
|
|
6862
6862
|
}));
|
|
6863
6863
|
return {
|
|
6864
6864
|
...slide,
|
|
6865
6865
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
6866
6866
|
};
|
|
6867
6867
|
});
|
|
6868
|
-
const slidesToSave =
|
|
6868
|
+
const slidesToSave = chunkP7UVBRFO_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
6869
6869
|
const saveOptions = {
|
|
6870
6870
|
headerFooter,
|
|
6871
6871
|
presentationProperties,
|
|
@@ -6922,7 +6922,7 @@ function safeConfirm(message) {
|
|
|
6922
6922
|
}
|
|
6923
6923
|
}
|
|
6924
6924
|
function downloadBlob2(blob, filename) {
|
|
6925
|
-
|
|
6925
|
+
chunkKDW3LLG5_js.downloadBlob(blob, chunkKDW3LLG5_js.sanitizeDownloadFilename(filename));
|
|
6926
6926
|
}
|
|
6927
6927
|
|
|
6928
6928
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7023,21 +7023,21 @@ function useExportHandlers(input) {
|
|
|
7023
7023
|
{
|
|
7024
7024
|
scale: 2,
|
|
7025
7025
|
onProgress: (current, total) => {
|
|
7026
|
-
setExportProgress(
|
|
7027
|
-
setExportStatusMessage(
|
|
7026
|
+
setExportProgress(chunkKDW3LLG5_js.slideProgressPercent(current, total));
|
|
7027
|
+
setExportStatusMessage(chunkKDW3LLG5_js.slideStatusLabel("Rendering", current, total));
|
|
7028
7028
|
},
|
|
7029
7029
|
signal: abortCtrl.signal
|
|
7030
7030
|
}
|
|
7031
7031
|
);
|
|
7032
|
-
setExportProgress(
|
|
7032
|
+
setExportProgress(chunkKDW3LLG5_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7033
7033
|
setExportStatusMessage("Building PDF...");
|
|
7034
7034
|
await new Promise((r) => {
|
|
7035
7035
|
setTimeout(r, 100);
|
|
7036
7036
|
});
|
|
7037
|
-
setExportProgress(
|
|
7037
|
+
setExportProgress(chunkKDW3LLG5_js.EXPORT_DONE_PERCENT);
|
|
7038
7038
|
setExportStatusMessage("Done!");
|
|
7039
7039
|
} catch (err) {
|
|
7040
|
-
if (!
|
|
7040
|
+
if (!chunkKDW3LLG5_js.isExportAbortError(err)) {
|
|
7041
7041
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7042
7042
|
}
|
|
7043
7043
|
} finally {
|
|
@@ -7067,21 +7067,21 @@ function useExportHandlers(input) {
|
|
|
7067
7067
|
{
|
|
7068
7068
|
scale: 2,
|
|
7069
7069
|
onProgress: (current, total) => {
|
|
7070
|
-
setExportProgress(
|
|
7071
|
-
setExportStatusMessage(
|
|
7070
|
+
setExportProgress(chunkKDW3LLG5_js.slideProgressPercent(current, total));
|
|
7071
|
+
setExportStatusMessage(chunkKDW3LLG5_js.slideStatusLabel("Rendering", current, total));
|
|
7072
7072
|
},
|
|
7073
7073
|
signal: abortCtrl.signal
|
|
7074
7074
|
}
|
|
7075
7075
|
);
|
|
7076
|
-
setExportProgress(
|
|
7076
|
+
setExportProgress(chunkKDW3LLG5_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7077
7077
|
setExportStatusMessage("Building PDF...");
|
|
7078
7078
|
await new Promise((r) => {
|
|
7079
7079
|
setTimeout(r, 100);
|
|
7080
7080
|
});
|
|
7081
|
-
setExportProgress(
|
|
7081
|
+
setExportProgress(chunkKDW3LLG5_js.EXPORT_DONE_PERCENT);
|
|
7082
7082
|
setExportStatusMessage("Done!");
|
|
7083
7083
|
} catch (err) {
|
|
7084
|
-
if (!
|
|
7084
|
+
if (!chunkKDW3LLG5_js.isExportAbortError(err)) {
|
|
7085
7085
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7086
7086
|
}
|
|
7087
7087
|
} finally {
|
|
@@ -7122,22 +7122,22 @@ function useExportHandlers(input) {
|
|
|
7122
7122
|
scale: 1,
|
|
7123
7123
|
slideDurationMs: 3e3,
|
|
7124
7124
|
onProgress: (current, total) => {
|
|
7125
|
-
setExportProgress(
|
|
7126
|
-
setExportStatusMessage(
|
|
7125
|
+
setExportProgress(chunkKDW3LLG5_js.slideProgressPercent(current, total, 45));
|
|
7126
|
+
setExportStatusMessage(chunkKDW3LLG5_js.slideStatusLabel("Capturing", current, total));
|
|
7127
7127
|
},
|
|
7128
7128
|
onRecordProgress: (current, total) => {
|
|
7129
|
-
setExportProgress(
|
|
7130
|
-
setExportStatusMessage(
|
|
7129
|
+
setExportProgress(chunkKDW3LLG5_js.recordProgressPercent(current, total));
|
|
7130
|
+
setExportStatusMessage(chunkKDW3LLG5_js.slideStatusLabel("Recording", current, total));
|
|
7131
7131
|
},
|
|
7132
7132
|
signal: abortCtrl.signal
|
|
7133
7133
|
}
|
|
7134
7134
|
);
|
|
7135
|
-
setExportProgress(
|
|
7135
|
+
setExportProgress(chunkKDW3LLG5_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7136
7136
|
setExportStatusMessage("Saving file...");
|
|
7137
7137
|
downloadBlob2(blob, "presentation.webm");
|
|
7138
|
-
setExportProgress(
|
|
7138
|
+
setExportProgress(chunkKDW3LLG5_js.EXPORT_DONE_PERCENT);
|
|
7139
7139
|
} catch (err) {
|
|
7140
|
-
if (!
|
|
7140
|
+
if (!chunkKDW3LLG5_js.isExportAbortError(err)) {
|
|
7141
7141
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7142
7142
|
}
|
|
7143
7143
|
} finally {
|
|
@@ -7165,18 +7165,18 @@ function useExportHandlers(input) {
|
|
|
7165
7165
|
scale: 0.5,
|
|
7166
7166
|
slideDurationMs: 2e3,
|
|
7167
7167
|
onProgress: (current, total) => {
|
|
7168
|
-
setExportProgress(
|
|
7169
|
-
setExportStatusMessage(
|
|
7168
|
+
setExportProgress(chunkKDW3LLG5_js.slideProgressPercent(current, total));
|
|
7169
|
+
setExportStatusMessage(chunkKDW3LLG5_js.slideStatusLabel("Encoding", current, total));
|
|
7170
7170
|
},
|
|
7171
7171
|
signal: abortCtrl.signal
|
|
7172
7172
|
}
|
|
7173
7173
|
);
|
|
7174
|
-
setExportProgress(
|
|
7174
|
+
setExportProgress(chunkKDW3LLG5_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7175
7175
|
setExportStatusMessage("Saving file...");
|
|
7176
7176
|
downloadBlob2(blob, "presentation.gif");
|
|
7177
|
-
setExportProgress(
|
|
7177
|
+
setExportProgress(chunkKDW3LLG5_js.EXPORT_DONE_PERCENT);
|
|
7178
7178
|
} catch (err) {
|
|
7179
|
-
if (!
|
|
7179
|
+
if (!chunkKDW3LLG5_js.isExportAbortError(err)) {
|
|
7180
7180
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7181
7181
|
}
|
|
7182
7182
|
} finally {
|
|
@@ -7216,7 +7216,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7216
7216
|
}
|
|
7217
7217
|
printWindow.document.open();
|
|
7218
7218
|
printWindow.document.write(
|
|
7219
|
-
|
|
7219
|
+
chunkKDW3LLG5_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7220
7220
|
);
|
|
7221
7221
|
printWindow.document.close();
|
|
7222
7222
|
printWindow.focus();
|
|
@@ -7277,7 +7277,7 @@ function usePrintHandlers(input) {
|
|
|
7277
7277
|
if (svgs.length === 0) {
|
|
7278
7278
|
return;
|
|
7279
7279
|
}
|
|
7280
|
-
const printDoc =
|
|
7280
|
+
const printDoc = chunkKDW3LLG5_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7281
7281
|
title: "Slides (Vector)",
|
|
7282
7282
|
orientation: settings.orientation,
|
|
7283
7283
|
colorFilter
|
|
@@ -7313,7 +7313,7 @@ function usePrintHandlers(input) {
|
|
|
7313
7313
|
if (settings.printWhat === "outline") {
|
|
7314
7314
|
openPrintWindow(
|
|
7315
7315
|
"Outline",
|
|
7316
|
-
`<div class="outline-page">${
|
|
7316
|
+
`<div class="outline-page">${chunkKDW3LLG5_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7317
7317
|
settings.orientation,
|
|
7318
7318
|
colorFilter,
|
|
7319
7319
|
settings.frameSlides
|
|
@@ -7338,7 +7338,7 @@ function usePrintHandlers(input) {
|
|
|
7338
7338
|
if (settings.printWhat === "slides") {
|
|
7339
7339
|
openPrintWindow(
|
|
7340
7340
|
"Slides",
|
|
7341
|
-
|
|
7341
|
+
chunkKDW3LLG5_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7342
7342
|
settings.orientation,
|
|
7343
7343
|
colorFilter,
|
|
7344
7344
|
settings.frameSlides
|
|
@@ -7348,7 +7348,7 @@ function usePrintHandlers(input) {
|
|
|
7348
7348
|
if (settings.printWhat === "notes") {
|
|
7349
7349
|
openPrintWindow(
|
|
7350
7350
|
"Notes Pages",
|
|
7351
|
-
|
|
7351
|
+
chunkKDW3LLG5_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7352
7352
|
"portrait",
|
|
7353
7353
|
colorFilter,
|
|
7354
7354
|
settings.frameSlides
|
|
@@ -7359,7 +7359,7 @@ function usePrintHandlers(input) {
|
|
|
7359
7359
|
const spp = settings.slidesPerPage;
|
|
7360
7360
|
openPrintWindow(
|
|
7361
7361
|
`Handout ${spp} per page`,
|
|
7362
|
-
|
|
7362
|
+
chunkKDW3LLG5_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7363
7363
|
"portrait",
|
|
7364
7364
|
colorFilter,
|
|
7365
7365
|
settings.frameSlides
|
|
@@ -7423,8 +7423,8 @@ function useThemeHandlers(input) {
|
|
|
7423
7423
|
return;
|
|
7424
7424
|
}
|
|
7425
7425
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7426
|
-
const previousMap = theme?.colorScheme ?
|
|
7427
|
-
setSlides((prev) =>
|
|
7426
|
+
const previousMap = theme?.colorScheme ? chunk3TB45PVK_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7427
|
+
setSlides((prev) => chunk3TB45PVK_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7428
7428
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7429
7429
|
bumpHistory();
|
|
7430
7430
|
history.markDirty();
|
|
@@ -7529,7 +7529,7 @@ function useThemeSwitching(input) {
|
|
|
7529
7529
|
}
|
|
7530
7530
|
try {
|
|
7531
7531
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7532
|
-
const newData =
|
|
7532
|
+
const newData = chunk3TB45PVK_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7533
7533
|
onDataChange(newData);
|
|
7534
7534
|
onThemeChanged?.(preset);
|
|
7535
7535
|
} catch (error) {
|
|
@@ -7546,7 +7546,7 @@ function useThemeSwitching(input) {
|
|
|
7546
7546
|
}
|
|
7547
7547
|
try {
|
|
7548
7548
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7549
|
-
const newData =
|
|
7549
|
+
const newData = chunk3TB45PVK_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7550
7550
|
onDataChange(newData);
|
|
7551
7551
|
} catch (error) {
|
|
7552
7552
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7558,12 +7558,12 @@ function useThemeSwitching(input) {
|
|
|
7558
7558
|
if (!data?.theme?.colorScheme) {
|
|
7559
7559
|
return void 0;
|
|
7560
7560
|
}
|
|
7561
|
-
return
|
|
7562
|
-
(p) =>
|
|
7561
|
+
return chunk3TB45PVK_js.THEME_PRESETS.find(
|
|
7562
|
+
(p) => chunk3TB45PVK_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7563
7563
|
);
|
|
7564
7564
|
}, [data?.theme?.colorScheme]);
|
|
7565
7565
|
return {
|
|
7566
|
-
presets:
|
|
7566
|
+
presets: chunk3TB45PVK_js.THEME_PRESETS,
|
|
7567
7567
|
switchToPreset,
|
|
7568
7568
|
switchToCustom,
|
|
7569
7569
|
currentPreset
|
|
@@ -7638,7 +7638,7 @@ function usePropertyHandlers(input) {
|
|
|
7638
7638
|
}
|
|
7639
7639
|
try {
|
|
7640
7640
|
const ab = await file.arrayBuffer();
|
|
7641
|
-
const h = new
|
|
7641
|
+
const h = new chunk3TB45PVK_js.PptxHandler();
|
|
7642
7642
|
const other = await h.load(ab);
|
|
7643
7643
|
if (!other) {
|
|
7644
7644
|
return;
|
|
@@ -7648,7 +7648,7 @@ function usePropertyHandlers(input) {
|
|
|
7648
7648
|
width: canvasSize.width,
|
|
7649
7649
|
height: canvasSize.height
|
|
7650
7650
|
};
|
|
7651
|
-
setCompareResult(
|
|
7651
|
+
setCompareResult(chunkKDW3LLG5_js.comparePresentation(cur, other));
|
|
7652
7652
|
setIsComparePanelOpen(true);
|
|
7653
7653
|
} catch (err) {
|
|
7654
7654
|
console.warn("Compare failed:", err);
|
|
@@ -7665,7 +7665,7 @@ function usePropertyHandlers(input) {
|
|
|
7665
7665
|
if (!diff || diff.status === "unchanged") {
|
|
7666
7666
|
return;
|
|
7667
7667
|
}
|
|
7668
|
-
setSlides((prev) =>
|
|
7668
|
+
setSlides((prev) => chunkKDW3LLG5_js.applyAcceptSlide(prev, diff));
|
|
7669
7669
|
setIsDirty(true);
|
|
7670
7670
|
},
|
|
7671
7671
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7676,10 +7676,10 @@ function usePropertyHandlers(input) {
|
|
|
7676
7676
|
if (!compareResult) {
|
|
7677
7677
|
return;
|
|
7678
7678
|
}
|
|
7679
|
-
setSlides((prev) =>
|
|
7679
|
+
setSlides((prev) => chunkKDW3LLG5_js.applyAcceptAllSlides(prev, compareResult));
|
|
7680
7680
|
setIsDirty(true);
|
|
7681
7681
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7682
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7682
|
+
const usedFontFamilies = react.useMemo(() => chunkKDW3LLG5_js.collectUsedFonts(slides), [slides]);
|
|
7683
7683
|
return {
|
|
7684
7684
|
handleUpdateNotes,
|
|
7685
7685
|
handleUpdateSlide,
|
|
@@ -7798,7 +7798,7 @@ function useIsMobile(input) {
|
|
|
7798
7798
|
const containerRef = input?.containerRef;
|
|
7799
7799
|
const isTouchDevice = react.useSyncExternalStore(
|
|
7800
7800
|
subscribeTouchCapability,
|
|
7801
|
-
|
|
7801
|
+
chunkKDW3LLG5_js.detectTouchDevice,
|
|
7802
7802
|
() => false
|
|
7803
7803
|
// server snapshot
|
|
7804
7804
|
);
|
|
@@ -7814,7 +7814,7 @@ function useIsMobile(input) {
|
|
|
7814
7814
|
}
|
|
7815
7815
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
7816
7816
|
});
|
|
7817
|
-
const [orientation, setOrientation] = react.useState(
|
|
7817
|
+
const [orientation, setOrientation] = react.useState(chunkKDW3LLG5_js.detectOrientation);
|
|
7818
7818
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
7819
7819
|
const [initialViewportHeight] = react.useState(
|
|
7820
7820
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -7858,7 +7858,7 @@ function useIsMobile(input) {
|
|
|
7858
7858
|
return;
|
|
7859
7859
|
}
|
|
7860
7860
|
const handleOrientationChange = () => {
|
|
7861
|
-
setOrientation(
|
|
7861
|
+
setOrientation(chunkKDW3LLG5_js.detectOrientation());
|
|
7862
7862
|
};
|
|
7863
7863
|
if (screen.orientation) {
|
|
7864
7864
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -7888,9 +7888,9 @@ function useIsMobile(input) {
|
|
|
7888
7888
|
window.addEventListener("resize", handleResize);
|
|
7889
7889
|
return () => window.removeEventListener("resize", handleResize);
|
|
7890
7890
|
}, [isTouchDevice, initialViewportHeight]);
|
|
7891
|
-
const isMobile =
|
|
7892
|
-
const isTablet = !isMobile && containerWidth >=
|
|
7893
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
7891
|
+
const isMobile = chunkKDW3LLG5_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
7892
|
+
const isTablet = !isMobile && containerWidth >= chunkKDW3LLG5_js.MOBILE_BREAKPOINT && containerWidth < chunkKDW3LLG5_js.TABLET_BREAKPOINT;
|
|
7893
|
+
const isDesktop = !isMobile && containerWidth >= chunkKDW3LLG5_js.TABLET_BREAKPOINT;
|
|
7894
7894
|
return {
|
|
7895
7895
|
isMobile,
|
|
7896
7896
|
isTablet,
|
|
@@ -7951,11 +7951,11 @@ function useViewerDialogs(input) {
|
|
|
7951
7951
|
);
|
|
7952
7952
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(false);
|
|
7953
7953
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
7954
|
-
() => typeof window !== "undefined" ?
|
|
7954
|
+
() => typeof window !== "undefined" ? chunkKDW3LLG5_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
7955
7955
|
);
|
|
7956
7956
|
react.useEffect(() => {
|
|
7957
7957
|
const handleWindow = () => setIsNarrowViewport(
|
|
7958
|
-
|
|
7958
|
+
chunkKDW3LLG5_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
7959
7959
|
);
|
|
7960
7960
|
let observer = null;
|
|
7961
7961
|
let raf = 0;
|
|
@@ -7969,12 +7969,12 @@ function useViewerDialogs(input) {
|
|
|
7969
7969
|
const entry = entries[0];
|
|
7970
7970
|
if (entry) {
|
|
7971
7971
|
setIsNarrowViewport(
|
|
7972
|
-
|
|
7972
|
+
chunkKDW3LLG5_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
7973
7973
|
);
|
|
7974
7974
|
}
|
|
7975
7975
|
});
|
|
7976
7976
|
observer.observe(el);
|
|
7977
|
-
setIsNarrowViewport(
|
|
7977
|
+
setIsNarrowViewport(chunkKDW3LLG5_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
7978
7978
|
};
|
|
7979
7979
|
attach();
|
|
7980
7980
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8132,12 +8132,12 @@ function useViewerDialogs(input) {
|
|
|
8132
8132
|
}
|
|
8133
8133
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8134
8134
|
if (presentationGridSpacing) {
|
|
8135
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8135
|
+
const px = Math.round(presentationGridSpacing.cx / chunkP7UVBRFO_js.EMU_PER_PX);
|
|
8136
8136
|
if (px > 0) {
|
|
8137
8137
|
return px;
|
|
8138
8138
|
}
|
|
8139
8139
|
}
|
|
8140
|
-
return
|
|
8140
|
+
return chunkP7UVBRFO_js.GRID_SIZE;
|
|
8141
8141
|
}
|
|
8142
8142
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8143
8143
|
if (activeCustomShowId) {
|
|
@@ -8151,8 +8151,8 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
|
8151
8151
|
return slides.map((_, i) => i).filter((i) => !slides[i]?.hidden);
|
|
8152
8152
|
}
|
|
8153
8153
|
function computeSlideSectionGroups(slides, sections) {
|
|
8154
|
-
return
|
|
8155
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8154
|
+
return chunkKDW3LLG5_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8155
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkP7UVBRFO_js.UNGROUPED_SECTION_ID : "default"),
|
|
8156
8156
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8157
8157
|
slideIndexes: group.slideIndexes,
|
|
8158
8158
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8207,7 +8207,7 @@ function useDerivedSlideState(input) {
|
|
|
8207
8207
|
);
|
|
8208
8208
|
const slideSectionGroups = react.useMemo(
|
|
8209
8209
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8210
|
-
if (group.id ===
|
|
8210
|
+
if (group.id === chunkP7UVBRFO_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8211
8211
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8212
8212
|
}
|
|
8213
8213
|
if (group.id === "default" && group.label === "Slides") {
|
|
@@ -8313,7 +8313,7 @@ function useAnnotationHandlers(input) {
|
|
|
8313
8313
|
if (nextMode === "present") {
|
|
8314
8314
|
presentation.enterPresentMode();
|
|
8315
8315
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8316
|
-
|
|
8316
|
+
chunkP7UVBRFO_js.stopAllPersistentAudio();
|
|
8317
8317
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8318
8318
|
if (promptKeepInkAnnotations) {
|
|
8319
8319
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8322,7 +8322,7 @@ function useAnnotationHandlers(input) {
|
|
|
8322
8322
|
}
|
|
8323
8323
|
} else {
|
|
8324
8324
|
if (mode === "present") {
|
|
8325
|
-
|
|
8325
|
+
chunkP7UVBRFO_js.stopAllPersistentAudio();
|
|
8326
8326
|
}
|
|
8327
8327
|
setMode(nextMode);
|
|
8328
8328
|
}
|
|
@@ -8388,13 +8388,13 @@ function useSerialize(input) {
|
|
|
8388
8388
|
let processedSlide = slide;
|
|
8389
8389
|
if (pendingEditId) {
|
|
8390
8390
|
const updatedElements = slide.elements.map((el) => {
|
|
8391
|
-
if (el.id !== pendingEditId || !
|
|
8391
|
+
if (el.id !== pendingEditId || !chunk3TB45PVK_js.hasTextProperties(el)) {
|
|
8392
8392
|
return el;
|
|
8393
8393
|
}
|
|
8394
8394
|
return {
|
|
8395
8395
|
...el,
|
|
8396
8396
|
text: pendingEditText,
|
|
8397
|
-
textSegments:
|
|
8397
|
+
textSegments: chunkKDW3LLG5_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8398
8398
|
};
|
|
8399
8399
|
});
|
|
8400
8400
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8407,14 +8407,14 @@ function useSerialize(input) {
|
|
|
8407
8407
|
const pptxGuides = guides.map((g) => ({
|
|
8408
8408
|
id: g.id,
|
|
8409
8409
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8410
|
-
positionEmu:
|
|
8410
|
+
positionEmu: chunk3TB45PVK_js.guidePxToEmu(g.position)
|
|
8411
8411
|
}));
|
|
8412
8412
|
return {
|
|
8413
8413
|
...processedSlide,
|
|
8414
8414
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8415
8415
|
};
|
|
8416
8416
|
});
|
|
8417
|
-
const slidesToSave =
|
|
8417
|
+
const slidesToSave = chunkP7UVBRFO_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8418
8418
|
const saveOptions = {
|
|
8419
8419
|
headerFooter,
|
|
8420
8420
|
presentationProperties,
|
|
@@ -8588,7 +8588,7 @@ function usePresentationSetup(input) {
|
|
|
8588
8588
|
setShowKeepAnnotationsDialog(true);
|
|
8589
8589
|
} else {
|
|
8590
8590
|
if (mode === "present" && nextMode !== "present") {
|
|
8591
|
-
|
|
8591
|
+
chunkP7UVBRFO_js.stopAllPersistentAudio();
|
|
8592
8592
|
stopAnimationSound();
|
|
8593
8593
|
}
|
|
8594
8594
|
setMode(nextMode);
|
|
@@ -8642,10 +8642,10 @@ function usePresentationSetup(input) {
|
|
|
8642
8642
|
onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
|
|
8643
8643
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8644
8644
|
onSaveRehearsalTimings: (timings) => {
|
|
8645
|
-
setSlides((prev) =>
|
|
8645
|
+
setSlides((prev) => chunkKDW3LLG5_js.applyRehearsalTimings(prev, timings));
|
|
8646
8646
|
history.markDirty();
|
|
8647
8647
|
},
|
|
8648
|
-
loopContinuously:
|
|
8648
|
+
loopContinuously: chunkKDW3LLG5_js.shouldLoopContinuously(presentationProperties),
|
|
8649
8649
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8650
8650
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8651
8651
|
endWithBlackSlide
|
|
@@ -8807,7 +8807,7 @@ function useEditorOperations(input) {
|
|
|
8807
8807
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
8808
8808
|
react.useEffect(() => {
|
|
8809
8809
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
8810
|
-
copiedFormatRef.current =
|
|
8810
|
+
copiedFormatRef.current = chunkKDW3LLG5_js.copyFormatFromElement(selectedElement);
|
|
8811
8811
|
} else if (!formatPainterActive) {
|
|
8812
8812
|
copiedFormatRef.current = null;
|
|
8813
8813
|
}
|
|
@@ -8833,12 +8833,12 @@ function useEditorOperations(input) {
|
|
|
8833
8833
|
e.stopPropagation();
|
|
8834
8834
|
const element = elementLookup.get(elementId);
|
|
8835
8835
|
if (element) {
|
|
8836
|
-
const updated =
|
|
8836
|
+
const updated = chunkKDW3LLG5_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
8837
8837
|
const updates = {};
|
|
8838
|
-
if (
|
|
8838
|
+
if (chunk3TB45PVK_js.hasShapeProperties(updated)) {
|
|
8839
8839
|
updates.shapeStyle = updated.shapeStyle;
|
|
8840
8840
|
}
|
|
8841
|
-
if (
|
|
8841
|
+
if (chunk3TB45PVK_js.hasTextProperties(updated)) {
|
|
8842
8842
|
updates.textStyle = updated.textStyle;
|
|
8843
8843
|
}
|
|
8844
8844
|
ops.updateElementById(elementId, updates);
|
|
@@ -8985,7 +8985,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
8985
8985
|
const families = /* @__PURE__ */ new Set();
|
|
8986
8986
|
for (const slide of slides) {
|
|
8987
8987
|
for (const el of slide.elements) {
|
|
8988
|
-
if (
|
|
8988
|
+
if (chunk3TB45PVK_js.hasTextProperties(el) && el.textSegments) {
|
|
8989
8989
|
for (const seg of el.textSegments) {
|
|
8990
8990
|
if (seg.style.fontFamily) {
|
|
8991
8991
|
families.add(seg.style.fontFamily);
|
|
@@ -9554,7 +9554,7 @@ function useViewerIntegration(input) {
|
|
|
9554
9554
|
return zoom.scale;
|
|
9555
9555
|
},
|
|
9556
9556
|
setZoom(level) {
|
|
9557
|
-
zoom.setScale(Math.min(Math.max(level,
|
|
9557
|
+
zoom.setScale(Math.min(Math.max(level, chunkP7UVBRFO_js.MIN_ZOOM_SCALE), chunkP7UVBRFO_js.MAX_ZOOM_SCALE));
|
|
9558
9558
|
},
|
|
9559
9559
|
zoomIn() {
|
|
9560
9560
|
zoom.handleZoomIn();
|
|
@@ -9769,7 +9769,7 @@ function useReducedMotion() {
|
|
|
9769
9769
|
}
|
|
9770
9770
|
function useViewerOptions() {
|
|
9771
9771
|
const storeRef = react.useRef(null);
|
|
9772
|
-
storeRef.current ??=
|
|
9772
|
+
storeRef.current ??= chunkKDW3LLG5_js.createViewerOptionsStore();
|
|
9773
9773
|
const store = storeRef.current;
|
|
9774
9774
|
const options = react.useSyncExternalStore(
|
|
9775
9775
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9778,9 +9778,9 @@ function useViewerOptions() {
|
|
|
9778
9778
|
);
|
|
9779
9779
|
return { optionsStore: store, options };
|
|
9780
9780
|
}
|
|
9781
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9781
|
+
var KNOWN_TAB_IDS = new Set(chunkKDW3LLG5_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9782
9782
|
function computeToolbarVisibility(hiddenActions) {
|
|
9783
|
-
const isHidden = (id) =>
|
|
9783
|
+
const isHidden = (id) => chunkKDW3LLG5_js.isActionHidden(id, hiddenActions);
|
|
9784
9784
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
9785
9785
|
return { isHidden, isTabVisible };
|
|
9786
9786
|
}
|
|
@@ -9865,13 +9865,13 @@ function useYjsDocumentSync({
|
|
|
9865
9865
|
return;
|
|
9866
9866
|
}
|
|
9867
9867
|
try {
|
|
9868
|
-
const { PptxHandler: PptxHandler2 } = await import('./dist-
|
|
9868
|
+
const { PptxHandler: PptxHandler2 } = await import('./dist-FTEVZZPM.js');
|
|
9869
9869
|
const handler = new PptxHandler2();
|
|
9870
9870
|
await handler.load(sourceBytes.buffer);
|
|
9871
|
-
const currentSlides =
|
|
9871
|
+
const currentSlides = chunkKDW3LLG5_js.readSlidesFromYDoc(
|
|
9872
9872
|
doc
|
|
9873
9873
|
);
|
|
9874
|
-
const slidesToSave =
|
|
9874
|
+
const slidesToSave = chunkP7UVBRFO_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
9875
9875
|
const bytes = await handler.save(slidesToSave);
|
|
9876
9876
|
config.onWriteBack(bytes);
|
|
9877
9877
|
} catch {
|
|
@@ -9886,7 +9886,7 @@ function useYjsDocumentSync({
|
|
|
9886
9886
|
if (!doc || !isConnected) {
|
|
9887
9887
|
return;
|
|
9888
9888
|
}
|
|
9889
|
-
const docSlides =
|
|
9889
|
+
const docSlides = chunkKDW3LLG5_js.readSlidesFromYDoc(
|
|
9890
9890
|
doc
|
|
9891
9891
|
);
|
|
9892
9892
|
if (docSlides.length === 0) {
|
|
@@ -9908,11 +9908,11 @@ function useYjsDocumentSync({
|
|
|
9908
9908
|
lastSyncedRef.current = serialized;
|
|
9909
9909
|
void (async () => {
|
|
9910
9910
|
const factories = await getFactories();
|
|
9911
|
-
|
|
9911
|
+
chunkKDW3LLG5_js.reconcileSlidesInYDoc(
|
|
9912
9912
|
slides,
|
|
9913
9913
|
doc,
|
|
9914
9914
|
factories,
|
|
9915
|
-
|
|
9915
|
+
chunkKDW3LLG5_js.LOCAL_SYNC_ORIGIN
|
|
9916
9916
|
);
|
|
9917
9917
|
scheduleWriteBack();
|
|
9918
9918
|
})();
|
|
@@ -9926,10 +9926,10 @@ function useYjsDocumentSync({
|
|
|
9926
9926
|
return;
|
|
9927
9927
|
}
|
|
9928
9928
|
const handleChange = (_events, transaction) => {
|
|
9929
|
-
if (transaction?.origin ===
|
|
9929
|
+
if (transaction?.origin === chunkKDW3LLG5_js.LOCAL_SYNC_ORIGIN) {
|
|
9930
9930
|
return;
|
|
9931
9931
|
}
|
|
9932
|
-
const remoteSlides =
|
|
9932
|
+
const remoteSlides = chunkKDW3LLG5_js.readSlidesFromYDoc(
|
|
9933
9933
|
doc
|
|
9934
9934
|
);
|
|
9935
9935
|
if (remoteSlides.length === 0) {
|
|
@@ -9945,7 +9945,7 @@ function useYjsDocumentSync({
|
|
|
9945
9945
|
isApplyingRemoteRef.current = false;
|
|
9946
9946
|
scheduleWriteBack();
|
|
9947
9947
|
};
|
|
9948
|
-
const unobserve =
|
|
9948
|
+
const unobserve = chunkKDW3LLG5_js.observeYDocSlides(
|
|
9949
9949
|
doc,
|
|
9950
9950
|
handleChange
|
|
9951
9951
|
);
|
|
@@ -9983,7 +9983,7 @@ function useBroadcastFollower({
|
|
|
9983
9983
|
if (!broadcaster) {
|
|
9984
9984
|
return;
|
|
9985
9985
|
}
|
|
9986
|
-
if (!
|
|
9986
|
+
if (!chunkKDW3LLG5_js.shouldAutoFollowBroadcaster({
|
|
9987
9987
|
localRole: collab.config.role,
|
|
9988
9988
|
broadcasterRole: broadcaster.role
|
|
9989
9989
|
})) {
|
|
@@ -10143,10 +10143,10 @@ function useTouchGestures(input) {
|
|
|
10143
10143
|
if (!el || !enabled) {
|
|
10144
10144
|
return;
|
|
10145
10145
|
}
|
|
10146
|
-
const recognizer =
|
|
10146
|
+
const recognizer = chunkKDW3LLG5_js.createTouchGestureRecognizer({
|
|
10147
10147
|
getScale: () => scaleRef.current,
|
|
10148
|
-
minScale:
|
|
10149
|
-
maxScale:
|
|
10148
|
+
minScale: chunkP7UVBRFO_js.MIN_ZOOM_SCALE,
|
|
10149
|
+
maxScale: chunkP7UVBRFO_js.MAX_ZOOM_SCALE,
|
|
10150
10150
|
callbacks: {
|
|
10151
10151
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10152
10152
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10186,7 +10186,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10186
10186
|
return;
|
|
10187
10187
|
}
|
|
10188
10188
|
const rect = active.getBoundingClientRect();
|
|
10189
|
-
const delta =
|
|
10189
|
+
const delta = chunkKDW3LLG5_js.computeScrollDelta(
|
|
10190
10190
|
{ top: rect.top, bottom: rect.bottom },
|
|
10191
10191
|
window.innerHeight,
|
|
10192
10192
|
keyboardInset
|
|
@@ -10206,8 +10206,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10206
10206
|
return;
|
|
10207
10207
|
}
|
|
10208
10208
|
const update = () => {
|
|
10209
|
-
const metrics =
|
|
10210
|
-
const inset = metrics ?
|
|
10209
|
+
const metrics = chunkKDW3LLG5_js.readViewportMetrics(window);
|
|
10210
|
+
const inset = metrics ? chunkKDW3LLG5_js.computeKeyboardInset(metrics) : 0;
|
|
10211
10211
|
setKeyboardInset(inset);
|
|
10212
10212
|
if (inset > 0) {
|
|
10213
10213
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10218,8 +10218,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10218
10218
|
vv.addEventListener("scroll", update);
|
|
10219
10219
|
const onFocusIn = () => {
|
|
10220
10220
|
window.requestAnimationFrame(() => {
|
|
10221
|
-
const metrics =
|
|
10222
|
-
const inset = metrics ?
|
|
10221
|
+
const metrics = chunkKDW3LLG5_js.readViewportMetrics(window);
|
|
10222
|
+
const inset = metrics ? chunkKDW3LLG5_js.computeKeyboardInset(metrics) : 0;
|
|
10223
10223
|
if (inset > 0) {
|
|
10224
10224
|
scrollFocusedIntoView(inset);
|
|
10225
10225
|
}
|
|
@@ -10232,7 +10232,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10232
10232
|
document.removeEventListener("focusin", onFocusIn);
|
|
10233
10233
|
};
|
|
10234
10234
|
}, [enabled]);
|
|
10235
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10235
|
+
return { keyboardInset, isKeyboardOpen: chunkKDW3LLG5_js.isKeyboardOpen(keyboardInset) };
|
|
10236
10236
|
}
|
|
10237
10237
|
|
|
10238
10238
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10287,13 +10287,13 @@ function buildCanvasProps(input) {
|
|
|
10287
10287
|
if (mode === "present") {
|
|
10288
10288
|
presentation.handlePresentationAction(action);
|
|
10289
10289
|
} else if (action.url) {
|
|
10290
|
-
|
|
10290
|
+
chunkKDW3LLG5_js.safeOpenUrl(action.url);
|
|
10291
10291
|
}
|
|
10292
10292
|
};
|
|
10293
10293
|
const handleHyperlinkClick = (url) => {
|
|
10294
|
-
if (
|
|
10294
|
+
if (chunkKDW3LLG5_js.isPpactionUrl(url)) {
|
|
10295
10295
|
if (mode === "present") {
|
|
10296
|
-
const parsed =
|
|
10296
|
+
const parsed = chunkKDW3LLG5_js.parsePpactionUrl(url);
|
|
10297
10297
|
if (parsed) {
|
|
10298
10298
|
presentation.handlePresentationAction({
|
|
10299
10299
|
action: parsed.action,
|
|
@@ -10303,7 +10303,7 @@ function buildCanvasProps(input) {
|
|
|
10303
10303
|
}
|
|
10304
10304
|
return;
|
|
10305
10305
|
}
|
|
10306
|
-
|
|
10306
|
+
chunkKDW3LLG5_js.safeOpenUrl(url);
|
|
10307
10307
|
};
|
|
10308
10308
|
return {
|
|
10309
10309
|
activeSlide: effectiveSlide,
|
|
@@ -10623,7 +10623,7 @@ function buildToolbarProps(input) {
|
|
|
10623
10623
|
onOpenFile,
|
|
10624
10624
|
onOpenRecentFile,
|
|
10625
10625
|
onCreatePresentation: (templateId) => {
|
|
10626
|
-
s.setSlides(
|
|
10626
|
+
s.setSlides(chunkKDW3LLG5_js.createBackstagePresentation(templateId));
|
|
10627
10627
|
s.setActiveSlideIndex(0);
|
|
10628
10628
|
s.setSelectedElementId(null);
|
|
10629
10629
|
s.setSelectedElementIds([]);
|
|
@@ -10678,7 +10678,7 @@ function buildToolbarProps(input) {
|
|
|
10678
10678
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10679
10679
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10680
10680
|
formatPainterActive: s.formatPainterActive,
|
|
10681
|
-
canActivateFormatPainter:
|
|
10681
|
+
canActivateFormatPainter: chunkKDW3LLG5_js.hasCopyableFormat(selectedElement),
|
|
10682
10682
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10683
10683
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10684
10684
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -10941,7 +10941,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
10941
10941
|
}, [incomingContent]);
|
|
10942
10942
|
const onOpenFile = react.useCallback(() => {
|
|
10943
10943
|
void (async () => {
|
|
10944
|
-
const picked = await
|
|
10944
|
+
const picked = await chunkKDW3LLG5_js.openPptxFile();
|
|
10945
10945
|
if (picked) {
|
|
10946
10946
|
setContent(picked.buffer);
|
|
10947
10947
|
}
|
|
@@ -10949,7 +10949,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
10949
10949
|
}, []);
|
|
10950
10950
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
10951
10951
|
void (async () => {
|
|
10952
|
-
const bytes = await
|
|
10952
|
+
const bytes = await chunkKDW3LLG5_js.readBackstageRecentFile(key);
|
|
10953
10953
|
if (bytes) {
|
|
10954
10954
|
setContent(bytes);
|
|
10955
10955
|
}
|