pptx-react-viewer 2.20.0 → 2.20.2
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 +43 -0
- package/dist/{AiChatPanel-S5UYFWT2.mjs → AiChatPanel-NRWACXJ7.mjs} +3 -3
- package/dist/AiChatPanel-NRWACXJ7.mjs.br +0 -0
- package/dist/AiChatPanel-NRWACXJ7.mjs.gz +0 -0
- package/dist/{AiChatPanel-KOKEVIOQ.js → AiChatPanel-ZSVNVRM5.js} +23 -23
- package/dist/AiChatPanel-ZSVNVRM5.js.br +0 -0
- package/dist/AiChatPanel-ZSVNVRM5.js.gz +0 -0
- package/dist/{Model3DScene-T5372GIJ.js → Model3DScene-3HGARMTA.js} +2 -2
- package/dist/Model3DScene-3HGARMTA.js.br +0 -0
- package/dist/Model3DScene-3HGARMTA.js.gz +0 -0
- package/dist/{Model3DScene-T6QOOVLN.mjs → Model3DScene-IFYFOD6F.mjs} +1 -1
- package/dist/Model3DScene-IFYFOD6F.mjs.br +0 -0
- package/dist/Model3DScene-IFYFOD6F.mjs.gz +0 -0
- package/dist/{chunk-QLELFH7A.mjs → chunk-2MENHAYJ.mjs} +229 -1
- package/dist/chunk-2MENHAYJ.mjs.br +0 -0
- package/dist/{chunk-QLELFH7A.mjs.gz → chunk-2MENHAYJ.mjs.gz} +0 -0
- package/dist/{chunk-J56DMNSD.js → chunk-4Z4HEIP5.js} +243 -4
- package/dist/chunk-4Z4HEIP5.js.br +0 -0
- package/dist/{chunk-J56DMNSD.js.gz → chunk-4Z4HEIP5.js.gz} +0 -0
- package/dist/{chunk-XWCN4TGE.mjs → chunk-EDJ4TZML.mjs} +93 -117
- package/dist/chunk-EDJ4TZML.mjs.br +0 -0
- package/dist/chunk-EDJ4TZML.mjs.gz +0 -0
- package/dist/{chunk-SAKMXLW2.js → chunk-GKOJO67G.js} +472 -502
- package/dist/chunk-GKOJO67G.js.br +0 -0
- package/dist/chunk-GKOJO67G.js.gz +0 -0
- package/dist/{chunk-AFAAKYYB.js → chunk-GUKUV7D4.js} +1119 -1143
- package/dist/chunk-GUKUV7D4.js.br +0 -0
- package/dist/chunk-GUKUV7D4.js.gz +0 -0
- package/dist/{chunk-BW3ZS73U.js → chunk-LLZ25OVR.js} +147 -147
- package/dist/chunk-LLZ25OVR.js.br +0 -0
- package/dist/chunk-LLZ25OVR.js.gz +0 -0
- package/dist/{chunk-U2UIJRSW.mjs → chunk-O5BR276S.mjs} +1 -1
- package/dist/chunk-O5BR276S.mjs.br +0 -0
- package/dist/chunk-O5BR276S.mjs.gz +0 -0
- package/dist/{chunk-T7OUKBWK.js → chunk-QJJX2E6I.js} +3 -3
- package/dist/chunk-QJJX2E6I.js.br +0 -0
- package/dist/chunk-QJJX2E6I.js.gz +0 -0
- package/dist/{chunk-2T7J57AC.mjs → chunk-RJ26DQIM.mjs} +1 -1
- package/dist/chunk-RJ26DQIM.mjs.br +0 -0
- package/dist/chunk-RJ26DQIM.mjs.gz +0 -0
- package/dist/{chunk-YMNURZ22.mjs → chunk-SZJLZWEX.mjs} +100 -130
- package/dist/chunk-SZJLZWEX.mjs.br +0 -0
- package/dist/chunk-SZJLZWEX.mjs.gz +0 -0
- package/dist/index.js +45 -45
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.js +26 -26
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-KOKEVIOQ.js.br +0 -0
- package/dist/AiChatPanel-KOKEVIOQ.js.gz +0 -0
- package/dist/AiChatPanel-S5UYFWT2.mjs.br +0 -0
- package/dist/AiChatPanel-S5UYFWT2.mjs.gz +0 -0
- package/dist/Model3DScene-T5372GIJ.js.br +0 -0
- package/dist/Model3DScene-T5372GIJ.js.gz +0 -0
- package/dist/Model3DScene-T6QOOVLN.mjs.br +0 -0
- package/dist/Model3DScene-T6QOOVLN.mjs.gz +0 -0
- package/dist/chunk-2T7J57AC.mjs.br +0 -0
- package/dist/chunk-2T7J57AC.mjs.gz +0 -0
- package/dist/chunk-AFAAKYYB.js.br +0 -0
- package/dist/chunk-AFAAKYYB.js.gz +0 -0
- package/dist/chunk-BW3ZS73U.js.br +0 -0
- package/dist/chunk-BW3ZS73U.js.gz +0 -0
- package/dist/chunk-J56DMNSD.js.br +0 -0
- package/dist/chunk-QLELFH7A.mjs.br +0 -0
- package/dist/chunk-SAKMXLW2.js.br +0 -0
- package/dist/chunk-SAKMXLW2.js.gz +0 -0
- package/dist/chunk-T7OUKBWK.js.br +0 -0
- package/dist/chunk-T7OUKBWK.js.gz +0 -0
- package/dist/chunk-U2UIJRSW.mjs.br +0 -0
- package/dist/chunk-U2UIJRSW.mjs.gz +0 -0
- package/dist/chunk-XWCN4TGE.mjs.br +0 -0
- package/dist/chunk-XWCN4TGE.mjs.gz +0 -0
- package/dist/chunk-YMNURZ22.mjs.br +0 -0
- package/dist/chunk-YMNURZ22.mjs.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkLLZ25OVR_js = require('./chunk-LLZ25OVR.js');
|
|
4
4
|
var chunk6CPUGAK7_js = require('./chunk-6CPUGAK7.js');
|
|
5
|
-
var
|
|
5
|
+
var chunk4Z4HEIP5_js = require('./chunk-4Z4HEIP5.js');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var JSZip = require('jszip');
|
|
8
8
|
var reactI18next = require('react-i18next');
|
|
@@ -14,7 +14,7 @@ var JSZip__default = /*#__PURE__*/_interopDefault(JSZip);
|
|
|
14
14
|
function useVirtualizedSlides({
|
|
15
15
|
totalItems,
|
|
16
16
|
itemHeight,
|
|
17
|
-
overscan =
|
|
17
|
+
overscan = chunk4Z4HEIP5_js.DEFAULT_VIRTUAL_OVERSCAN
|
|
18
18
|
}) {
|
|
19
19
|
const scrollContainerRef = react.useRef(null);
|
|
20
20
|
const [scrollTop, setScrollTop] = react.useState(0);
|
|
@@ -44,7 +44,7 @@ function useVirtualizedSlides({
|
|
|
44
44
|
resizeObserver?.disconnect();
|
|
45
45
|
};
|
|
46
46
|
}, []);
|
|
47
|
-
const range =
|
|
47
|
+
const range = chunk4Z4HEIP5_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
|
|
48
48
|
const safeItemHeight = Math.max(itemHeight, 1);
|
|
49
49
|
const scrollToIndex = react.useCallback(
|
|
50
50
|
(index, behavior = "smooth") => {
|
|
@@ -85,7 +85,7 @@ function usePresenceTracking({
|
|
|
85
85
|
}) {
|
|
86
86
|
const [remoteUsers, setRemoteUsers] = react.useState([]);
|
|
87
87
|
const projectorRef = react.useRef(null);
|
|
88
|
-
projectorRef.current ??=
|
|
88
|
+
projectorRef.current ??= chunk4Z4HEIP5_js.createPresenceProjector();
|
|
89
89
|
const projector = projectorRef.current;
|
|
90
90
|
const lastBroadcastRef = react.useRef(0);
|
|
91
91
|
const pendingBroadcastRef = react.useRef(null);
|
|
@@ -110,7 +110,7 @@ function usePresenceTracking({
|
|
|
110
110
|
awareness.setLocalStateField("presence", state);
|
|
111
111
|
lastBroadcastRef.current = Date.now();
|
|
112
112
|
};
|
|
113
|
-
if (elapsed >=
|
|
113
|
+
if (elapsed >= chunk4Z4HEIP5_js.BROADCAST_THROTTLE_MS) {
|
|
114
114
|
if (pendingBroadcastRef.current) {
|
|
115
115
|
clearTimeout(pendingBroadcastRef.current);
|
|
116
116
|
pendingBroadcastRef.current = null;
|
|
@@ -120,7 +120,7 @@ function usePresenceTracking({
|
|
|
120
120
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
121
121
|
pendingBroadcastRef.current = null;
|
|
122
122
|
flush();
|
|
123
|
-
},
|
|
123
|
+
}, chunk4Z4HEIP5_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
124
124
|
}
|
|
125
125
|
},
|
|
126
126
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -200,7 +200,7 @@ function useYjsProvider({ config }) {
|
|
|
200
200
|
const departureRef = react.useRef(null);
|
|
201
201
|
const gateRef = react.useRef(null);
|
|
202
202
|
if (!gateRef.current) {
|
|
203
|
-
gateRef.current =
|
|
203
|
+
gateRef.current = chunk4Z4HEIP5_js.createSyncGate(() => setSynced(true));
|
|
204
204
|
}
|
|
205
205
|
const teardown = react.useCallback(() => {
|
|
206
206
|
if (timeoutRef.current) {
|
|
@@ -220,7 +220,7 @@ function useYjsProvider({ config }) {
|
|
|
220
220
|
const buildCleanup = react.useCallback(
|
|
221
221
|
(provider, yDoc) => () => {
|
|
222
222
|
announceDeparture();
|
|
223
|
-
|
|
223
|
+
chunk4Z4HEIP5_js.clearLocalAwareness(provider.awareness);
|
|
224
224
|
provider.destroy();
|
|
225
225
|
yDoc.destroy();
|
|
226
226
|
setDoc(null);
|
|
@@ -245,9 +245,9 @@ function useYjsProvider({ config }) {
|
|
|
245
245
|
if (config.authToken) {
|
|
246
246
|
opts.password = config.authToken;
|
|
247
247
|
}
|
|
248
|
-
const roomId =
|
|
248
|
+
const roomId = chunk4Z4HEIP5_js.validateRoomId(config.roomId);
|
|
249
249
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
250
|
-
departureRef.current =
|
|
250
|
+
departureRef.current = chunk4Z4HEIP5_js.createDepartureChannel(roomId, provider.awareness);
|
|
251
251
|
setDoc(yDoc);
|
|
252
252
|
setAwareness(provider.awareness);
|
|
253
253
|
setClientId(provider.awareness.clientID);
|
|
@@ -289,13 +289,13 @@ function useYjsProvider({ config }) {
|
|
|
289
289
|
if (!config) {
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
const roomId =
|
|
293
|
-
const transport = config.transport ??
|
|
292
|
+
const roomId = chunk4Z4HEIP5_js.validateRoomId(config.roomId);
|
|
293
|
+
const transport = config.transport ?? chunk4Z4HEIP5_js.resolveTransportForServerUrl(config.serverUrl);
|
|
294
294
|
if (transport === "webrtc") {
|
|
295
295
|
await initWebrtc();
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
if (
|
|
298
|
+
if (chunk4Z4HEIP5_js.isMixedContentBlocked(config.serverUrl)) {
|
|
299
299
|
console.warn(
|
|
300
300
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
301
301
|
);
|
|
@@ -309,7 +309,7 @@ function useYjsProvider({ config }) {
|
|
|
309
309
|
const provider = new WebsocketProvider(config.serverUrl, roomId, yDoc, {
|
|
310
310
|
params: config.authToken ? { token: config.authToken } : void 0
|
|
311
311
|
});
|
|
312
|
-
departureRef.current =
|
|
312
|
+
departureRef.current = chunk4Z4HEIP5_js.createDepartureChannel(roomId, provider.awareness);
|
|
313
313
|
let connected = false;
|
|
314
314
|
const handleStatus = (event) => {
|
|
315
315
|
if (event.status === "connected") {
|
|
@@ -349,7 +349,7 @@ function useYjsProvider({ config }) {
|
|
|
349
349
|
provider.off("status", handleStatus);
|
|
350
350
|
provider.off("sync", handleSynced);
|
|
351
351
|
announceDeparture();
|
|
352
|
-
|
|
352
|
+
chunk4Z4HEIP5_js.clearLocalAwareness(provider.awareness);
|
|
353
353
|
provider.destroy();
|
|
354
354
|
yDoc.destroy();
|
|
355
355
|
setDoc(null);
|
|
@@ -358,7 +358,7 @@ function useYjsProvider({ config }) {
|
|
|
358
358
|
cleanupRef.current = null;
|
|
359
359
|
setStatus("error");
|
|
360
360
|
}
|
|
361
|
-
},
|
|
361
|
+
}, chunk4Z4HEIP5_js.CONNECTION_TIMEOUT_MS);
|
|
362
362
|
}
|
|
363
363
|
setDoc(yDoc);
|
|
364
364
|
setAwareness(provider.awareness);
|
|
@@ -367,7 +367,7 @@ function useYjsProvider({ config }) {
|
|
|
367
367
|
provider.off("status", handleStatus);
|
|
368
368
|
provider.off("sync", handleSynced);
|
|
369
369
|
announceDeparture();
|
|
370
|
-
|
|
370
|
+
chunk4Z4HEIP5_js.clearLocalAwareness(provider.awareness);
|
|
371
371
|
provider.destroy();
|
|
372
372
|
yDoc.destroy();
|
|
373
373
|
setDoc(null);
|
|
@@ -393,7 +393,7 @@ function useYjsProvider({ config }) {
|
|
|
393
393
|
]);
|
|
394
394
|
react.useEffect(() => {
|
|
395
395
|
init();
|
|
396
|
-
const disposeTeardown =
|
|
396
|
+
const disposeTeardown = chunk4Z4HEIP5_js.registerCollaborationTeardown({
|
|
397
397
|
leave: teardown,
|
|
398
398
|
rejoin: init
|
|
399
399
|
});
|
|
@@ -414,7 +414,7 @@ function useCollaborativeState({
|
|
|
414
414
|
canvasWidth,
|
|
415
415
|
canvasHeight
|
|
416
416
|
}) {
|
|
417
|
-
const userColor =
|
|
417
|
+
const userColor = chunk4Z4HEIP5_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
418
418
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
419
419
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
420
420
|
awareness,
|
|
@@ -532,8 +532,8 @@ function useEditorHistory(input) {
|
|
|
532
532
|
width: canvasSize.width,
|
|
533
533
|
height: canvasSize.height,
|
|
534
534
|
activeSlideIndex,
|
|
535
|
-
slides: slides.map(
|
|
536
|
-
templateElementsBySlideId:
|
|
535
|
+
slides: slides.map(chunk4Z4HEIP5_js.cloneSlide),
|
|
536
|
+
templateElementsBySlideId: chunk4Z4HEIP5_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
537
537
|
...actionLabel ? { actionLabel } : {}
|
|
538
538
|
};
|
|
539
539
|
},
|
|
@@ -546,9 +546,9 @@ function useEditorHistory(input) {
|
|
|
546
546
|
width: snapshot.width,
|
|
547
547
|
height: snapshot.height
|
|
548
548
|
});
|
|
549
|
-
setSlides(snapshot.slides.map(
|
|
549
|
+
setSlides(snapshot.slides.map(chunk4Z4HEIP5_js.cloneSlide));
|
|
550
550
|
setTemplateElementsBySlideId(
|
|
551
|
-
|
|
551
|
+
chunk4Z4HEIP5_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
552
552
|
);
|
|
553
553
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
554
554
|
setSelectedElementIds([]);
|
|
@@ -587,8 +587,8 @@ function useEditorHistory(input) {
|
|
|
587
587
|
const currentSnapshot = buildHistorySnapshot();
|
|
588
588
|
historyFutureRef.current.push(currentSnapshot);
|
|
589
589
|
isApplyingHistoryRef.current = true;
|
|
590
|
-
const nextSnapshot =
|
|
591
|
-
lastHistorySnapshotRef.current =
|
|
590
|
+
const nextSnapshot = chunkLLZ25OVR_js.cloneHistorySnapshot(previousSnapshot);
|
|
591
|
+
lastHistorySnapshotRef.current = chunkLLZ25OVR_js.cloneHistorySnapshot(nextSnapshot);
|
|
592
592
|
lastHistorySerializedRef.current = serializeDocument(nextSnapshot);
|
|
593
593
|
applyHistorySnapshot(nextSnapshot);
|
|
594
594
|
updateHistoryAvailability();
|
|
@@ -609,8 +609,8 @@ function useEditorHistory(input) {
|
|
|
609
609
|
const currentSnapshot = buildHistorySnapshot();
|
|
610
610
|
historyPastRef.current.push(currentSnapshot);
|
|
611
611
|
isApplyingHistoryRef.current = true;
|
|
612
|
-
const targetSnapshot =
|
|
613
|
-
lastHistorySnapshotRef.current =
|
|
612
|
+
const targetSnapshot = chunkLLZ25OVR_js.cloneHistorySnapshot(nextSnapshot);
|
|
613
|
+
lastHistorySnapshotRef.current = chunkLLZ25OVR_js.cloneHistorySnapshot(targetSnapshot);
|
|
614
614
|
lastHistorySerializedRef.current = serializeDocument(targetSnapshot);
|
|
615
615
|
applyHistorySnapshot(targetSnapshot);
|
|
616
616
|
updateHistoryAvailability();
|
|
@@ -628,7 +628,7 @@ function useEditorHistory(input) {
|
|
|
628
628
|
historyPastRef.current = [];
|
|
629
629
|
historyFutureRef.current = [];
|
|
630
630
|
if (initialSnapshot) {
|
|
631
|
-
const clonedInitial =
|
|
631
|
+
const clonedInitial = chunkLLZ25OVR_js.cloneHistorySnapshot(initialSnapshot);
|
|
632
632
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
633
633
|
lastHistorySerializedRef.current = serializeDocument(clonedInitial);
|
|
634
634
|
} else {
|
|
@@ -676,19 +676,19 @@ function useEditorHistory(input) {
|
|
|
676
676
|
}
|
|
677
677
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
678
678
|
if (!previousSnapshot) {
|
|
679
|
-
lastHistorySnapshotRef.current =
|
|
679
|
+
lastHistorySnapshotRef.current = chunkLLZ25OVR_js.cloneHistorySnapshot(snapshot);
|
|
680
680
|
lastHistorySerializedRef.current = serialized;
|
|
681
681
|
lastCheapHashRef.current = cheapHash;
|
|
682
682
|
updateHistoryAvailability();
|
|
683
683
|
return;
|
|
684
684
|
}
|
|
685
685
|
onDirtyRef.current?.();
|
|
686
|
-
historyPastRef.current.push(
|
|
686
|
+
historyPastRef.current.push(chunkLLZ25OVR_js.cloneHistorySnapshot(previousSnapshot));
|
|
687
687
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
688
688
|
historyPastRef.current.shift();
|
|
689
689
|
}
|
|
690
690
|
historyFutureRef.current = [];
|
|
691
|
-
lastHistorySnapshotRef.current =
|
|
691
|
+
lastHistorySnapshotRef.current = chunkLLZ25OVR_js.cloneHistorySnapshot(snapshot);
|
|
692
692
|
lastHistorySerializedRef.current = serialized;
|
|
693
693
|
lastCheapHashRef.current = cheapHash;
|
|
694
694
|
updateHistoryAvailability();
|
|
@@ -748,9 +748,9 @@ function useZoomViewport({
|
|
|
748
748
|
const canvasStageRef = react.useRef(null);
|
|
749
749
|
const canvasViewportRef = react.useRef(null);
|
|
750
750
|
const renderScaleRef = react.useRef(1);
|
|
751
|
-
const wheelBufferRef = react.useRef(
|
|
751
|
+
const wheelBufferRef = react.useRef(chunk4Z4HEIP5_js.createWheelStepBuffer());
|
|
752
752
|
const storeRef = react.useRef(null);
|
|
753
|
-
storeRef.current ??=
|
|
753
|
+
storeRef.current ??= chunk4Z4HEIP5_js.createViewerZoomStore();
|
|
754
754
|
const store = storeRef.current;
|
|
755
755
|
const scale = useViewerStore(store, selectZoom);
|
|
756
756
|
const setScale = react.useCallback(
|
|
@@ -811,7 +811,7 @@ function useZoomViewport({
|
|
|
811
811
|
if (!wrapper || !canvasViewport) {
|
|
812
812
|
return;
|
|
813
813
|
}
|
|
814
|
-
const boundedScale =
|
|
814
|
+
const boundedScale = chunk4Z4HEIP5_js.clampZoomScale(nextScale);
|
|
815
815
|
const nextEditorScale = fitScale * boundedScale;
|
|
816
816
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
817
817
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -848,29 +848,29 @@ function useZoomViewport({
|
|
|
848
848
|
selectedElements.forEach((element) => {
|
|
849
849
|
minX = Math.min(minX, element.x);
|
|
850
850
|
minY = Math.min(minY, element.y);
|
|
851
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
852
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
851
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkLLZ25OVR_js.MIN_ELEMENT_SIZE));
|
|
852
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkLLZ25OVR_js.MIN_ELEMENT_SIZE));
|
|
853
853
|
});
|
|
854
854
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
855
855
|
return;
|
|
856
856
|
}
|
|
857
857
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
858
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
859
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
858
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkLLZ25OVR_js.MIN_ELEMENT_SIZE);
|
|
859
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkLLZ25OVR_js.MIN_ELEMENT_SIZE);
|
|
860
860
|
const availableWidth = Math.max(
|
|
861
|
-
effectiveEditorDimensions.width -
|
|
862
|
-
|
|
861
|
+
effectiveEditorDimensions.width - chunkLLZ25OVR_js.ZOOM_TO_SELECTION_PADDING,
|
|
862
|
+
chunkLLZ25OVR_js.MIN_ELEMENT_SIZE
|
|
863
863
|
);
|
|
864
864
|
const availableHeight = Math.max(
|
|
865
|
-
effectiveEditorDimensions.height -
|
|
866
|
-
|
|
865
|
+
effectiveEditorDimensions.height - chunkLLZ25OVR_js.ZOOM_TO_SELECTION_PADDING,
|
|
866
|
+
chunkLLZ25OVR_js.MIN_ELEMENT_SIZE
|
|
867
867
|
);
|
|
868
868
|
const targetEditorScale = Math.min(
|
|
869
869
|
availableWidth / boundsWidth,
|
|
870
870
|
availableHeight / boundsHeight
|
|
871
871
|
);
|
|
872
872
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
873
|
-
const nextScale =
|
|
873
|
+
const nextScale = chunk4Z4HEIP5_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
874
874
|
setScale(nextScale);
|
|
875
875
|
window.requestAnimationFrame(() => {
|
|
876
876
|
window.requestAnimationFrame(() => {
|
|
@@ -887,14 +887,14 @@ function useZoomViewport({
|
|
|
887
887
|
]);
|
|
888
888
|
const handleWheel = react.useCallback(
|
|
889
889
|
(event) => {
|
|
890
|
-
const mapped =
|
|
890
|
+
const mapped = chunk4Z4HEIP5_js.mapEditingWheel(event, wheelBufferRef.current, true);
|
|
891
891
|
if (mapped.intent !== "zoom") {
|
|
892
892
|
return;
|
|
893
893
|
}
|
|
894
894
|
event.preventDefault();
|
|
895
895
|
store.dispatch({
|
|
896
896
|
type: "set-zoom",
|
|
897
|
-
zoom:
|
|
897
|
+
zoom: chunk4Z4HEIP5_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
|
|
898
898
|
});
|
|
899
899
|
},
|
|
900
900
|
[store]
|
|
@@ -982,7 +982,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
982
982
|
const command = step.command;
|
|
983
983
|
const timer = window.setTimeout(
|
|
984
984
|
() => {
|
|
985
|
-
|
|
985
|
+
chunkLLZ25OVR_js.executeMediaCommand(command);
|
|
986
986
|
},
|
|
987
987
|
Math.max(0, step.delayMs)
|
|
988
988
|
);
|
|
@@ -1119,7 +1119,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1119
1119
|
}))
|
|
1120
1120
|
);
|
|
1121
1121
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1122
|
-
const delay =
|
|
1122
|
+
const delay = chunk4Z4HEIP5_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1123
1123
|
const timer = window.setTimeout(() => {
|
|
1124
1124
|
setPresentationAnimations(
|
|
1125
1125
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1151,7 +1151,7 @@ function useAnimationPlayback(input) {
|
|
|
1151
1151
|
(controller, group) => {
|
|
1152
1152
|
driveBuildReveal(
|
|
1153
1153
|
controller,
|
|
1154
|
-
|
|
1154
|
+
chunk4Z4HEIP5_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1155
1155
|
setPresentationElementStates,
|
|
1156
1156
|
buildRafRef
|
|
1157
1157
|
);
|
|
@@ -1214,7 +1214,7 @@ function useAnimationPlayback(input) {
|
|
|
1214
1214
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1215
1215
|
return;
|
|
1216
1216
|
}
|
|
1217
|
-
const controller =
|
|
1217
|
+
const controller = chunk4Z4HEIP5_js.PresentationAnimationController.fromSlide(slide);
|
|
1218
1218
|
controllerRef.current = controller;
|
|
1219
1219
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1220
1220
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1372,12 +1372,12 @@ function useAnimationPlayback(input) {
|
|
|
1372
1372
|
presentationTimersRef
|
|
1373
1373
|
};
|
|
1374
1374
|
}
|
|
1375
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1376
|
-
var AUDIENCE_HASH =
|
|
1377
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1378
|
-
var AUDIENCE_NONCE_KEY =
|
|
1375
|
+
var PRESENTER_CHANNEL_NAME = chunk4Z4HEIP5_js.PRESENTATION_CHANNEL_NAME;
|
|
1376
|
+
var AUDIENCE_HASH = chunk4Z4HEIP5_js.PRESENTATION_HASH;
|
|
1377
|
+
var PRESENTER_MSG_ORIGIN = chunk4Z4HEIP5_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1378
|
+
var AUDIENCE_NONCE_KEY = chunk4Z4HEIP5_js.PRESENTATION_NONCE_KEY;
|
|
1379
1379
|
function generateSessionId() {
|
|
1380
|
-
return
|
|
1380
|
+
return chunk4Z4HEIP5_js.createPresentationSessionId();
|
|
1381
1381
|
}
|
|
1382
1382
|
function parseAudienceNonce() {
|
|
1383
1383
|
const hash = window.location.hash;
|
|
@@ -1413,7 +1413,7 @@ function usePresenterWindow(input) {
|
|
|
1413
1413
|
}, []);
|
|
1414
1414
|
const swapDisplays = react.useCallback(async () => {
|
|
1415
1415
|
const audience = audienceWindowRef.current;
|
|
1416
|
-
return audience && !audience.closed ?
|
|
1416
|
+
return audience && !audience.closed ? chunk4Z4HEIP5_js.swapPresentationWindows(window, audience) : false;
|
|
1417
1417
|
}, []);
|
|
1418
1418
|
const syncSlideToAudience = react.useCallback(
|
|
1419
1419
|
(slideIndex) => {
|
|
@@ -1477,7 +1477,7 @@ function usePresenterWindow(input) {
|
|
|
1477
1477
|
pollTimerRef.current = null;
|
|
1478
1478
|
}
|
|
1479
1479
|
if (closingSessionId) {
|
|
1480
|
-
void
|
|
1480
|
+
void chunk4Z4HEIP5_js.clearAudienceContent(closingSessionId);
|
|
1481
1481
|
}
|
|
1482
1482
|
}, [getChannel]);
|
|
1483
1483
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1495,10 +1495,10 @@ function usePresenterWindow(input) {
|
|
|
1495
1495
|
audienceWindowRef.current = blankWin;
|
|
1496
1496
|
const sessionId = generateSessionId();
|
|
1497
1497
|
sessionIdRef.current = sessionId;
|
|
1498
|
-
const audienceUrl =
|
|
1499
|
-
void
|
|
1498
|
+
const audienceUrl = chunk4Z4HEIP5_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1499
|
+
void chunk4Z4HEIP5_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1500
1500
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1501
|
-
|
|
1501
|
+
chunk4Z4HEIP5_js.placeAudienceWindow(blankWin, placement);
|
|
1502
1502
|
}
|
|
1503
1503
|
return void 0;
|
|
1504
1504
|
});
|
|
@@ -1528,7 +1528,7 @@ function usePresenterWindow(input) {
|
|
|
1528
1528
|
}
|
|
1529
1529
|
};
|
|
1530
1530
|
if (content) {
|
|
1531
|
-
void
|
|
1531
|
+
void chunk4Z4HEIP5_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1532
1532
|
} else {
|
|
1533
1533
|
navigateOrClose(true);
|
|
1534
1534
|
}
|
|
@@ -1554,7 +1554,7 @@ function usePresenterWindow(input) {
|
|
|
1554
1554
|
}
|
|
1555
1555
|
const handleMessage = (event) => {
|
|
1556
1556
|
const message = event.data;
|
|
1557
|
-
if (
|
|
1557
|
+
if (chunk4Z4HEIP5_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1558
1558
|
syncStateToAudience(snapshotRef.current);
|
|
1559
1559
|
}
|
|
1560
1560
|
};
|
|
@@ -1583,7 +1583,7 @@ function usePresenterWindow(input) {
|
|
|
1583
1583
|
react.useEffect(() => {
|
|
1584
1584
|
const handleBeforeUnload = () => {
|
|
1585
1585
|
if (sessionIdRef.current) {
|
|
1586
|
-
void
|
|
1586
|
+
void chunk4Z4HEIP5_js.clearAudienceContent(sessionIdRef.current);
|
|
1587
1587
|
}
|
|
1588
1588
|
};
|
|
1589
1589
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1645,7 +1645,7 @@ function useAudienceMode(input) {
|
|
|
1645
1645
|
}
|
|
1646
1646
|
channel.onmessage = (event) => {
|
|
1647
1647
|
const data = event.data;
|
|
1648
|
-
if (!
|
|
1648
|
+
if (!chunk4Z4HEIP5_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1649
1649
|
return;
|
|
1650
1650
|
}
|
|
1651
1651
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1661,16 +1661,16 @@ function useAudienceMode(input) {
|
|
|
1661
1661
|
}
|
|
1662
1662
|
if (data.type === "presenter-exit") {
|
|
1663
1663
|
if (expectedSessionId) {
|
|
1664
|
-
void
|
|
1664
|
+
void chunk4Z4HEIP5_js.clearAudienceContent(expectedSessionId);
|
|
1665
1665
|
}
|
|
1666
|
-
if (
|
|
1666
|
+
if (chunk4Z4HEIP5_js.endAudienceDisplay(window)) {
|
|
1667
1667
|
handlers.onPresenterEnded?.();
|
|
1668
1668
|
}
|
|
1669
1669
|
}
|
|
1670
1670
|
};
|
|
1671
1671
|
if (expectedSessionId) {
|
|
1672
1672
|
channel.postMessage({
|
|
1673
|
-
origin:
|
|
1673
|
+
origin: chunk4Z4HEIP5_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1674
1674
|
type: "audience-ready",
|
|
1675
1675
|
sessionId: expectedSessionId
|
|
1676
1676
|
});
|
|
@@ -1684,7 +1684,7 @@ function useAudienceMode(input) {
|
|
|
1684
1684
|
}, []);
|
|
1685
1685
|
}
|
|
1686
1686
|
function usePresentationKeyboard(input) {
|
|
1687
|
-
const wheelBufferRef = react.useRef(
|
|
1687
|
+
const wheelBufferRef = react.useRef(chunk4Z4HEIP5_js.createWheelStepBuffer());
|
|
1688
1688
|
const {
|
|
1689
1689
|
mode,
|
|
1690
1690
|
movePresentationSlide,
|
|
@@ -1705,14 +1705,14 @@ function usePresentationKeyboard(input) {
|
|
|
1705
1705
|
presentationSlideIndex,
|
|
1706
1706
|
setShowRehearsalSummary
|
|
1707
1707
|
} = input;
|
|
1708
|
-
const keyBufferRef = react.useRef(
|
|
1708
|
+
const keyBufferRef = react.useRef(chunk4Z4HEIP5_js.createPresentationKeyBuffer());
|
|
1709
1709
|
react.useEffect(() => {
|
|
1710
|
-
if (mode !== "present" || !
|
|
1711
|
-
keyBufferRef.current =
|
|
1710
|
+
if (mode !== "present" || !chunk4Z4HEIP5_js.acceptsPresentationInput()) {
|
|
1711
|
+
keyBufferRef.current = chunk4Z4HEIP5_js.createPresentationKeyBuffer();
|
|
1712
1712
|
return;
|
|
1713
1713
|
}
|
|
1714
1714
|
const handleKeyDown = (event) => {
|
|
1715
|
-
const mapped =
|
|
1715
|
+
const mapped = chunk4Z4HEIP5_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1716
1716
|
if (mapped.action === "none") {
|
|
1717
1717
|
return;
|
|
1718
1718
|
}
|
|
@@ -1732,12 +1732,12 @@ function usePresentationKeyboard(input) {
|
|
|
1732
1732
|
movePresentationSlide(-1);
|
|
1733
1733
|
return;
|
|
1734
1734
|
case "first": {
|
|
1735
|
-
const first =
|
|
1735
|
+
const first = chunk4Z4HEIP5_js.firstShowSlideIndex(showSlideIndexes);
|
|
1736
1736
|
navigateToSlide(first ?? 0);
|
|
1737
1737
|
return;
|
|
1738
1738
|
}
|
|
1739
1739
|
case "last": {
|
|
1740
|
-
const last =
|
|
1740
|
+
const last = chunk4Z4HEIP5_js.lastShowSlideIndex(showSlideIndexes);
|
|
1741
1741
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1742
1742
|
return;
|
|
1743
1743
|
}
|
|
@@ -1775,10 +1775,10 @@ function usePresentationKeyboard(input) {
|
|
|
1775
1775
|
}
|
|
1776
1776
|
};
|
|
1777
1777
|
const handleWheel = (event) => {
|
|
1778
|
-
if (mode !== "present" || !
|
|
1778
|
+
if (mode !== "present" || !chunk4Z4HEIP5_js.acceptsPresentationInput()) {
|
|
1779
1779
|
return;
|
|
1780
1780
|
}
|
|
1781
|
-
const mapped =
|
|
1781
|
+
const mapped = chunk4Z4HEIP5_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1782
1782
|
if (mapped.intent === "next-slide") {
|
|
1783
1783
|
event.preventDefault();
|
|
1784
1784
|
movePresentationSlide(1);
|
|
@@ -1911,7 +1911,7 @@ function useRehearsalTimings(input) {
|
|
|
1911
1911
|
|
|
1912
1912
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1913
1913
|
function handlePresentationActionImpl(action, deps) {
|
|
1914
|
-
|
|
1914
|
+
chunk4Z4HEIP5_js.runPresentationAction(
|
|
1915
1915
|
action,
|
|
1916
1916
|
{ slideCount: deps.slidesLength },
|
|
1917
1917
|
{
|
|
@@ -1933,7 +1933,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1933
1933
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1934
1934
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1935
1935
|
const transition = incomingSlide?.transition;
|
|
1936
|
-
const durationMs = deps.playTransition ?
|
|
1936
|
+
const durationMs = deps.playTransition ? chunk4Z4HEIP5_js.resolveTransitionDurationMs(transition) : 0;
|
|
1937
1937
|
deps.clearPresentationTimers();
|
|
1938
1938
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1939
1939
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1992,7 +1992,7 @@ function useSlideNavigation(input) {
|
|
|
1992
1992
|
});
|
|
1993
1993
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1994
1994
|
(slideIndex) => {
|
|
1995
|
-
const delayMs =
|
|
1995
|
+
const delayMs = chunk4Z4HEIP5_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1996
1996
|
if (delayMs === void 0) {
|
|
1997
1997
|
return;
|
|
1998
1998
|
}
|
|
@@ -2015,7 +2015,7 @@ function useSlideNavigation(input) {
|
|
|
2015
2015
|
if (availableSlideIndexes.length === 0) {
|
|
2016
2016
|
return;
|
|
2017
2017
|
}
|
|
2018
|
-
const pastLastSlide = direction === 1 && !
|
|
2018
|
+
const pastLastSlide = direction === 1 && !chunk4Z4HEIP5_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
2019
2019
|
if (rehearsing && pastLastSlide) {
|
|
2020
2020
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
2021
2021
|
try {
|
|
@@ -2033,9 +2033,9 @@ function useSlideNavigation(input) {
|
|
|
2033
2033
|
onAdvancePastLastSlide();
|
|
2034
2034
|
return;
|
|
2035
2035
|
}
|
|
2036
|
-
const nextSlideIndex = direction === 1 ?
|
|
2036
|
+
const nextSlideIndex = direction === 1 ? chunk4Z4HEIP5_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
2037
2037
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
2038
|
-
}) :
|
|
2038
|
+
}) : chunk4Z4HEIP5_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
2039
2039
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
2040
2040
|
return;
|
|
2041
2041
|
}
|
|
@@ -2180,22 +2180,22 @@ function useZoomNavigation(input) {
|
|
|
2180
2180
|
};
|
|
2181
2181
|
}
|
|
2182
2182
|
function usePresenterConsole(slideIndex, active) {
|
|
2183
|
-
const timerRef = react.useRef(
|
|
2184
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2183
|
+
const timerRef = react.useRef(chunk4Z4HEIP5_js.createPresenterTimer());
|
|
2184
|
+
const [snapshot, setSnapshot] = react.useState(() => chunk4Z4HEIP5_js.createInitialPresentationSnapshot(slideIndex));
|
|
2185
2185
|
const patch = react.useCallback((value) => {
|
|
2186
|
-
setSnapshot((current) =>
|
|
2186
|
+
setSnapshot((current) => chunk4Z4HEIP5_js.mergePresentationSnapshot(current, value));
|
|
2187
2187
|
}, []);
|
|
2188
2188
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2189
2189
|
react.useEffect(() => {
|
|
2190
2190
|
if (!active) {
|
|
2191
2191
|
return;
|
|
2192
2192
|
}
|
|
2193
|
-
timerRef.current =
|
|
2193
|
+
timerRef.current = chunk4Z4HEIP5_js.resetPresenterTimer();
|
|
2194
2194
|
patch({ paused: false, elapsedMs: 0 });
|
|
2195
2195
|
const timer = window.setInterval(() => {
|
|
2196
2196
|
patch({
|
|
2197
2197
|
paused: timerRef.current.paused,
|
|
2198
|
-
elapsedMs:
|
|
2198
|
+
elapsedMs: chunk4Z4HEIP5_js.presenterElapsed(timerRef.current)
|
|
2199
2199
|
});
|
|
2200
2200
|
}, 1e3);
|
|
2201
2201
|
return () => window.clearInterval(timer);
|
|
@@ -2205,19 +2205,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2205
2205
|
applyAudienceSnapshot: setSnapshot,
|
|
2206
2206
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2207
2207
|
toggleTimer: () => {
|
|
2208
|
-
timerRef.current =
|
|
2208
|
+
timerRef.current = chunk4Z4HEIP5_js.togglePresenterTimer(timerRef.current);
|
|
2209
2209
|
patch({
|
|
2210
2210
|
paused: timerRef.current.paused,
|
|
2211
|
-
elapsedMs:
|
|
2211
|
+
elapsedMs: chunk4Z4HEIP5_js.presenterElapsed(timerRef.current)
|
|
2212
2212
|
});
|
|
2213
2213
|
},
|
|
2214
2214
|
resetTimer: () => {
|
|
2215
|
-
timerRef.current =
|
|
2215
|
+
timerRef.current = chunk4Z4HEIP5_js.resetPresenterTimer();
|
|
2216
2216
|
patch({ paused: false, elapsedMs: 0 });
|
|
2217
2217
|
},
|
|
2218
2218
|
stepZoom: (direction) => setSnapshot(
|
|
2219
|
-
(current) =>
|
|
2220
|
-
zoom:
|
|
2219
|
+
(current) => chunk4Z4HEIP5_js.mergePresentationSnapshot(current, {
|
|
2220
|
+
zoom: chunk4Z4HEIP5_js.stepPresenterZoom(
|
|
2221
2221
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2222
2222
|
direction
|
|
2223
2223
|
)
|
|
@@ -2263,7 +2263,7 @@ function usePresentationMode(input) {
|
|
|
2263
2263
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2264
2264
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2265
2265
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2266
|
-
const showGuard = react.useMemo(() =>
|
|
2266
|
+
const showGuard = react.useMemo(() => chunk4Z4HEIP5_js.createPresenterShowGuard(), []);
|
|
2267
2267
|
const {
|
|
2268
2268
|
presentationAnimations,
|
|
2269
2269
|
presentationElementStates,
|
|
@@ -2342,7 +2342,7 @@ function usePresentationMode(input) {
|
|
|
2342
2342
|
});
|
|
2343
2343
|
const movePresentationSlide = react.useCallback(
|
|
2344
2344
|
(direction, trigger = "explicit") => {
|
|
2345
|
-
if (!
|
|
2345
|
+
if (!chunk4Z4HEIP5_js.acceptsPresentationInput()) {
|
|
2346
2346
|
return;
|
|
2347
2347
|
}
|
|
2348
2348
|
if (endOfShowVisible) {
|
|
@@ -2480,7 +2480,7 @@ function usePresentationMode(input) {
|
|
|
2480
2480
|
if (mode !== "present") {
|
|
2481
2481
|
return;
|
|
2482
2482
|
}
|
|
2483
|
-
return
|
|
2483
|
+
return chunk4Z4HEIP5_js.attachPresentationVisibilityPause({
|
|
2484
2484
|
root: containerRef.current ?? void 0,
|
|
2485
2485
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2486
2486
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2560,11 +2560,11 @@ function usePresentationMode(input) {
|
|
|
2560
2560
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2561
2561
|
return void 0;
|
|
2562
2562
|
}
|
|
2563
|
-
return
|
|
2563
|
+
return chunk4Z4HEIP5_js.buildMorphTransitionPlan(
|
|
2564
2564
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2565
2565
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2566
2566
|
transitionOverlay.durationMs,
|
|
2567
|
-
|
|
2567
|
+
chunk4Z4HEIP5_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2568
2568
|
);
|
|
2569
2569
|
}, [transitionOverlay, slides]);
|
|
2570
2570
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2585,7 +2585,7 @@ function usePresentationMode(input) {
|
|
|
2585
2585
|
if (!morphPlan) {
|
|
2586
2586
|
return presentationKeyframesCss;
|
|
2587
2587
|
}
|
|
2588
|
-
const imageRules =
|
|
2588
|
+
const imageRules = chunk4Z4HEIP5_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2589
2589
|
return `${presentationKeyframesCss ?? ""}
|
|
2590
2590
|
${morphPlan.keyframesCss}
|
|
2591
2591
|
${imageRules}`;
|
|
@@ -2881,7 +2881,7 @@ function useFindReplace({
|
|
|
2881
2881
|
const [findResults, setFindResults] = react.useState([]);
|
|
2882
2882
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
2883
2883
|
const performFind = react.useCallback(() => {
|
|
2884
|
-
const results =
|
|
2884
|
+
const results = chunk4Z4HEIP5_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
2885
2885
|
if (!findQuery) {
|
|
2886
2886
|
setFindResults([]);
|
|
2887
2887
|
setFindResultIndex(-1);
|
|
@@ -2915,7 +2915,7 @@ function useFindReplace({
|
|
|
2915
2915
|
return;
|
|
2916
2916
|
}
|
|
2917
2917
|
onUpdateSlides(
|
|
2918
|
-
(prevSlides) =>
|
|
2918
|
+
(prevSlides) => chunk4Z4HEIP5_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
2919
2919
|
);
|
|
2920
2920
|
onMarkDirty();
|
|
2921
2921
|
},
|
|
@@ -2937,9 +2937,9 @@ function useFindReplace({
|
|
|
2937
2937
|
}, [findResults, applyReplacements, performFind]);
|
|
2938
2938
|
react.useEffect(() => {
|
|
2939
2939
|
const handler = (event) => {
|
|
2940
|
-
const { action } =
|
|
2940
|
+
const { action } = chunk4Z4HEIP5_js.mapEditorKey(event, {
|
|
2941
2941
|
canEdit: mode === "edit",
|
|
2942
|
-
isTextInputTarget:
|
|
2942
|
+
isTextInputTarget: chunk4Z4HEIP5_js.isEditorTextInputTarget(event.target)
|
|
2943
2943
|
});
|
|
2944
2944
|
if (action !== "find") {
|
|
2945
2945
|
return;
|
|
@@ -3008,65 +3008,72 @@ function useModalDismissDrag(onClose, threshold = 120) {
|
|
|
3008
3008
|
}
|
|
3009
3009
|
|
|
3010
3010
|
// src/viewer/hooks/useComments-helpers.ts
|
|
3011
|
-
function
|
|
3012
|
-
return `comment-${crypto.randomUUID()}`;
|
|
3013
|
-
}
|
|
3014
|
-
function addCommentToSlide(slides, slideIndex, comment) {
|
|
3011
|
+
function replaceCommentsOnSlide(slides, slideIndex, next) {
|
|
3015
3012
|
return slides.map(
|
|
3016
|
-
(entry, index) => index === slideIndex ? { ...entry, comments:
|
|
3013
|
+
(entry, index) => index === slideIndex ? { ...entry, comments: next } : entry
|
|
3014
|
+
);
|
|
3015
|
+
}
|
|
3016
|
+
function addCommentToSlide(slides, slideIndex, text, authorName, elementId) {
|
|
3017
|
+
const slide = slides[slideIndex];
|
|
3018
|
+
if (!slide) {
|
|
3019
|
+
return { slides, didAdd: false };
|
|
3020
|
+
}
|
|
3021
|
+
const next = chunk4Z4HEIP5_js.addCommentToList(
|
|
3022
|
+
slide.comments || [],
|
|
3023
|
+
text,
|
|
3024
|
+
authorName,
|
|
3025
|
+
void 0,
|
|
3026
|
+
void 0,
|
|
3027
|
+
elementId
|
|
3017
3028
|
);
|
|
3029
|
+
if (!next) {
|
|
3030
|
+
return { slides, didAdd: false };
|
|
3031
|
+
}
|
|
3032
|
+
return { slides: replaceCommentsOnSlide(slides, slideIndex, next), didAdd: true };
|
|
3018
3033
|
}
|
|
3019
3034
|
function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
didDelete = true;
|
|
3030
|
-
}
|
|
3031
|
-
return keep;
|
|
3032
|
-
});
|
|
3033
|
-
return next.length === existing.length ? entry : { ...entry, comments: next };
|
|
3034
|
-
});
|
|
3035
|
-
return { slides: updated, didDelete };
|
|
3035
|
+
const slide = slides[slideIndex];
|
|
3036
|
+
if (!slide) {
|
|
3037
|
+
return { slides, didDelete: false };
|
|
3038
|
+
}
|
|
3039
|
+
const next = chunk4Z4HEIP5_js.removeCommentFromList(slide.comments || [], commentId);
|
|
3040
|
+
if (!next) {
|
|
3041
|
+
return { slides, didDelete: false };
|
|
3042
|
+
}
|
|
3043
|
+
return { slides: replaceCommentsOnSlide(slides, slideIndex, next), didDelete: true };
|
|
3036
3044
|
}
|
|
3037
3045
|
function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
didUpdate = true;
|
|
3048
|
-
return { ...c, text: newText };
|
|
3049
|
-
});
|
|
3050
|
-
return didUpdate ? { ...entry, comments: next } : entry;
|
|
3051
|
-
});
|
|
3052
|
-
return { slides: updated, didUpdate };
|
|
3046
|
+
const slide = slides[slideIndex];
|
|
3047
|
+
if (!slide) {
|
|
3048
|
+
return { slides, didUpdate: false };
|
|
3049
|
+
}
|
|
3050
|
+
const next = chunk4Z4HEIP5_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
3051
|
+
if (!next) {
|
|
3052
|
+
return { slides, didUpdate: false };
|
|
3053
|
+
}
|
|
3054
|
+
return { slides: replaceCommentsOnSlide(slides, slideIndex, next), didUpdate: true };
|
|
3053
3055
|
}
|
|
3054
3056
|
function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3057
|
+
const slide = slides[slideIndex];
|
|
3058
|
+
if (!slide) {
|
|
3059
|
+
return { slides, didUpdate: false };
|
|
3060
|
+
}
|
|
3061
|
+
const next = chunk4Z4HEIP5_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
3062
|
+
if (!next) {
|
|
3063
|
+
return { slides, didUpdate: false };
|
|
3064
|
+
}
|
|
3065
|
+
return { slides: replaceCommentsOnSlide(slides, slideIndex, next), didUpdate: true };
|
|
3066
|
+
}
|
|
3067
|
+
function addReplyToSlide(slides, slideIndex, parentId, text, authorName) {
|
|
3068
|
+
const slide = slides[slideIndex];
|
|
3069
|
+
if (!slide) {
|
|
3070
|
+
return { slides, didAdd: false };
|
|
3071
|
+
}
|
|
3072
|
+
const next = chunk4Z4HEIP5_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
3073
|
+
if (!next) {
|
|
3074
|
+
return { slides, didAdd: false };
|
|
3075
|
+
}
|
|
3076
|
+
return { slides: replaceCommentsOnSlide(slides, slideIndex, next), didAdd: true };
|
|
3070
3077
|
}
|
|
3071
3078
|
function pruneSlideDrafts(drafts, slideIds) {
|
|
3072
3079
|
const next = {};
|
|
@@ -3117,14 +3124,21 @@ function useComments({
|
|
|
3117
3124
|
if (draft.length === 0) {
|
|
3118
3125
|
return;
|
|
3119
3126
|
}
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3127
|
+
let didAdd = false;
|
|
3128
|
+
onUpdateSlides((prev) => {
|
|
3129
|
+
const result = addCommentToSlide(
|
|
3130
|
+
prev,
|
|
3131
|
+
slideIndex,
|
|
3132
|
+
draft,
|
|
3133
|
+
userName,
|
|
3134
|
+
selectedElementId ?? void 0
|
|
3135
|
+
);
|
|
3136
|
+
didAdd = result.didAdd;
|
|
3137
|
+
return result.slides;
|
|
3138
|
+
});
|
|
3139
|
+
if (!didAdd) {
|
|
3140
|
+
return;
|
|
3141
|
+
}
|
|
3128
3142
|
setCommentDraftBySlideId((prev) => ({
|
|
3129
3143
|
...prev,
|
|
3130
3144
|
[slide.id]: ""
|
|
@@ -3264,39 +3278,19 @@ function useComments({
|
|
|
3264
3278
|
if (!slide) {
|
|
3265
3279
|
return;
|
|
3266
3280
|
}
|
|
3267
|
-
const parentComment = (slide.comments || []).find((c) => c.id === commentId);
|
|
3268
|
-
if (!parentComment) {
|
|
3269
|
-
return;
|
|
3270
|
-
}
|
|
3271
3281
|
const replyText = String(replyDraftByCommentId[commentId] || "").trim();
|
|
3272
3282
|
if (replyText.length === 0) {
|
|
3273
3283
|
return;
|
|
3274
3284
|
}
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
(prev) => prev.map((entry, index) => {
|
|
3285
|
-
if (index !== slideIndex) {
|
|
3286
|
-
return entry;
|
|
3287
|
-
}
|
|
3288
|
-
const updatedComments = (entry.comments || []).map((c) => {
|
|
3289
|
-
if (c.id !== commentId) {
|
|
3290
|
-
return c;
|
|
3291
|
-
}
|
|
3292
|
-
return {
|
|
3293
|
-
...c,
|
|
3294
|
-
replies: [...c.replies || [], replyComment]
|
|
3295
|
-
};
|
|
3296
|
-
});
|
|
3297
|
-
return { ...entry, comments: updatedComments };
|
|
3298
|
-
})
|
|
3299
|
-
);
|
|
3285
|
+
let didAdd = false;
|
|
3286
|
+
onUpdateSlides((prev) => {
|
|
3287
|
+
const result = addReplyToSlide(prev, slideIndex, commentId, replyText, userName);
|
|
3288
|
+
didAdd = result.didAdd;
|
|
3289
|
+
return result.slides;
|
|
3290
|
+
});
|
|
3291
|
+
if (!didAdd) {
|
|
3292
|
+
return;
|
|
3293
|
+
}
|
|
3300
3294
|
setReplyingToCommentId(null);
|
|
3301
3295
|
setReplyDraftByCommentId((prev) => {
|
|
3302
3296
|
const next = { ...prev };
|
|
@@ -3449,7 +3443,7 @@ function useViewerCoreState(_input) {
|
|
|
3449
3443
|
const marqueeStateRef = react.useRef(null);
|
|
3450
3444
|
const isDrawingRef = react.useRef(false);
|
|
3451
3445
|
const justInteractedRef = react.useRef(false);
|
|
3452
|
-
const livePatcher = react.useMemo(() =>
|
|
3446
|
+
const livePatcher = react.useMemo(() => chunk4Z4HEIP5_js.createCollaborationLivePatcher(), []);
|
|
3453
3447
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3454
3448
|
const slidesRef = react.useRef([]);
|
|
3455
3449
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3458,8 +3452,8 @@ function useViewerCoreState(_input) {
|
|
|
3458
3452
|
const [slides, setSlides] = react.useState([]);
|
|
3459
3453
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3460
3454
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3461
|
-
width:
|
|
3462
|
-
height:
|
|
3455
|
+
width: chunkLLZ25OVR_js.DEFAULT_CANVAS_WIDTH,
|
|
3456
|
+
height: chunkLLZ25OVR_js.DEFAULT_CANVAS_HEIGHT
|
|
3463
3457
|
});
|
|
3464
3458
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3465
3459
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3480,7 +3474,7 @@ function useViewerCoreState(_input) {
|
|
|
3480
3474
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3481
3475
|
inlineEditingTextRef.current = resolved;
|
|
3482
3476
|
setInlineEditingTextBase(value);
|
|
3483
|
-
|
|
3477
|
+
chunk4Z4HEIP5_js.publishLiveInlineText(
|
|
3484
3478
|
livePatcher,
|
|
3485
3479
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3486
3480
|
inlineEditingElementIdRef.current,
|
|
@@ -3819,7 +3813,7 @@ function useLoadContent({
|
|
|
3819
3813
|
);
|
|
3820
3814
|
}
|
|
3821
3815
|
const previousHandler = handlerRef.current;
|
|
3822
|
-
const handler = new
|
|
3816
|
+
const handler = new chunk4Z4HEIP5_js.PptxHandler();
|
|
3823
3817
|
const parsed = await handler.load(buffer);
|
|
3824
3818
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3825
3819
|
handler.dispose();
|
|
@@ -3831,7 +3825,7 @@ function useLoadContent({
|
|
|
3831
3825
|
handlerRef.current = null;
|
|
3832
3826
|
const mediaElements = [];
|
|
3833
3827
|
for (const slide of parsed.slides) {
|
|
3834
|
-
|
|
3828
|
+
chunk4Z4HEIP5_js.collectMediaElements(slide.elements, mediaElements);
|
|
3835
3829
|
}
|
|
3836
3830
|
for (const url of mediaDataUrls.values()) {
|
|
3837
3831
|
if (url.startsWith("blob:")) {
|
|
@@ -3872,7 +3866,7 @@ function useLoadContent({
|
|
|
3872
3866
|
}
|
|
3873
3867
|
})
|
|
3874
3868
|
);
|
|
3875
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3869
|
+
const { paths: imagePaths, refs: imageRefs } = chunk4Z4HEIP5_js.collectImagePaths(parsed.slides);
|
|
3876
3870
|
let nextSlides = parsed.slides;
|
|
3877
3871
|
if (imagePaths.size > 0) {
|
|
3878
3872
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3927,12 +3921,12 @@ function useLoadContent({
|
|
|
3927
3921
|
}
|
|
3928
3922
|
}
|
|
3929
3923
|
handlerRef.current = handler;
|
|
3930
|
-
const partition =
|
|
3924
|
+
const partition = chunk4Z4HEIP5_js.partitionTemplateElements(nextSlides);
|
|
3931
3925
|
setSlides(partition.slides);
|
|
3932
3926
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3933
3927
|
setCanvasSize({
|
|
3934
|
-
width: parsed.width ??
|
|
3935
|
-
height: parsed.height ??
|
|
3928
|
+
width: parsed.width ?? chunkLLZ25OVR_js.DEFAULT_CANVAS_WIDTH,
|
|
3929
|
+
height: parsed.height ?? chunkLLZ25OVR_js.DEFAULT_CANVAS_HEIGHT
|
|
3936
3930
|
});
|
|
3937
3931
|
setSlideSizeEmu(
|
|
3938
3932
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -3949,7 +3943,7 @@ function useLoadContent({
|
|
|
3949
3943
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
3950
3944
|
setCustomShows(parsed.customShows ?? []);
|
|
3951
3945
|
setActiveCustomShowId(
|
|
3952
|
-
|
|
3946
|
+
chunk4Z4HEIP5_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
3953
3947
|
);
|
|
3954
3948
|
setSections(parsed.sections ?? []);
|
|
3955
3949
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -3971,7 +3965,7 @@ function useLoadContent({
|
|
|
3971
3965
|
setHasMacros(parsed.hasMacros === true);
|
|
3972
3966
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3973
3967
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3974
|
-
setGuides(
|
|
3968
|
+
setGuides(chunk4Z4HEIP5_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3975
3969
|
setActiveSlideIndex(0);
|
|
3976
3970
|
clearSelection();
|
|
3977
3971
|
setIsDirty(false);
|
|
@@ -3979,7 +3973,7 @@ function useLoadContent({
|
|
|
3979
3973
|
onContentApplied?.();
|
|
3980
3974
|
} catch (err) {
|
|
3981
3975
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3982
|
-
if (err instanceof
|
|
3976
|
+
if (err instanceof chunk4Z4HEIP5_js.EncryptedFileError) {
|
|
3983
3977
|
setIsEncrypted(true);
|
|
3984
3978
|
} else {
|
|
3985
3979
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -4006,7 +4000,7 @@ function useLoadContent({
|
|
|
4006
4000
|
}
|
|
4007
4001
|
function useAutosave(input) {
|
|
4008
4002
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4009
|
-
const intervalMs =
|
|
4003
|
+
const intervalMs = chunk4Z4HEIP5_js.resolveAutosaveIntervalMs({
|
|
4010
4004
|
hostIntervalMs: input.intervalMs,
|
|
4011
4005
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4012
4006
|
});
|
|
@@ -4037,7 +4031,7 @@ function useAutosave(input) {
|
|
|
4037
4031
|
return;
|
|
4038
4032
|
}
|
|
4039
4033
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4040
|
-
if (!
|
|
4034
|
+
if (!chunk4Z4HEIP5_js.shouldWriteAutosaveSnapshot({
|
|
4041
4035
|
filePath: path,
|
|
4042
4036
|
isDirty: isDirtyRef.current,
|
|
4043
4037
|
saving: isSavingRef.current,
|
|
@@ -4055,8 +4049,8 @@ function useAutosave(input) {
|
|
|
4055
4049
|
isSavingRef.current = false;
|
|
4056
4050
|
return;
|
|
4057
4051
|
}
|
|
4058
|
-
await
|
|
4059
|
-
lastSnapshotRef.current =
|
|
4052
|
+
await chunk4Z4HEIP5_js.saveAutosaveSnapshot(path, data);
|
|
4053
|
+
lastSnapshotRef.current = chunk4Z4HEIP5_js.autosaveSnapshotMark(path, sources);
|
|
4060
4054
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4061
4055
|
} catch (err) {
|
|
4062
4056
|
setAutosaveStatus({
|
|
@@ -4142,11 +4136,11 @@ function useElementOperations(input) {
|
|
|
4142
4136
|
(elementId, updates) => {
|
|
4143
4137
|
if (masterView?.target) {
|
|
4144
4138
|
applyMasterViewWrite(
|
|
4145
|
-
|
|
4139
|
+
chunk4Z4HEIP5_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4146
4140
|
);
|
|
4147
4141
|
return;
|
|
4148
4142
|
}
|
|
4149
|
-
if (
|
|
4143
|
+
if (chunk4Z4HEIP5_js.isTemplateElementId(elementId)) {
|
|
4150
4144
|
const slideId = activeSlide?.id;
|
|
4151
4145
|
if (slideId) {
|
|
4152
4146
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4194,7 +4188,7 @@ function useElementOperations(input) {
|
|
|
4194
4188
|
);
|
|
4195
4189
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4196
4190
|
(updates) => {
|
|
4197
|
-
if (!selectedElement || !
|
|
4191
|
+
if (!selectedElement || !chunk4Z4HEIP5_js.hasShapeProperties(selectedElement)) {
|
|
4198
4192
|
return;
|
|
4199
4193
|
}
|
|
4200
4194
|
updateSelectedElement({
|
|
@@ -4205,17 +4199,17 @@ function useElementOperations(input) {
|
|
|
4205
4199
|
);
|
|
4206
4200
|
const updateSelectedTextStyle = react.useCallback(
|
|
4207
4201
|
(updates) => {
|
|
4208
|
-
if (!selectedElement || !
|
|
4202
|
+
if (!selectedElement || !chunk4Z4HEIP5_js.hasTextProperties(selectedElement)) {
|
|
4209
4203
|
return;
|
|
4210
4204
|
}
|
|
4211
|
-
const inlineSel =
|
|
4205
|
+
const inlineSel = chunk4Z4HEIP5_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4212
4206
|
if (inlineSel && selectedElement.textSegments) {
|
|
4213
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4207
|
+
const { newSegments: newSegments2, newSelection } = chunk4Z4HEIP5_js.applyStyleToSelectedSegments(
|
|
4214
4208
|
selectedElement.textSegments,
|
|
4215
4209
|
inlineSel,
|
|
4216
4210
|
updates
|
|
4217
4211
|
);
|
|
4218
|
-
|
|
4212
|
+
chunk4Z4HEIP5_js.setPendingSelectionRestore(newSelection);
|
|
4219
4213
|
updateSelectedElement({
|
|
4220
4214
|
textSegments: newSegments2
|
|
4221
4215
|
});
|
|
@@ -4235,12 +4229,12 @@ function useElementOperations(input) {
|
|
|
4235
4229
|
);
|
|
4236
4230
|
const updateSelectedTextCase = react.useCallback(
|
|
4237
4231
|
(mode) => {
|
|
4238
|
-
if (!selectedElement || !
|
|
4232
|
+
if (!selectedElement || !chunk4Z4HEIP5_js.hasTextProperties(selectedElement)) {
|
|
4239
4233
|
return;
|
|
4240
4234
|
}
|
|
4241
|
-
const inlineSel =
|
|
4235
|
+
const inlineSel = chunk4Z4HEIP5_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4242
4236
|
if (inlineSel && selectedElement.textSegments) {
|
|
4243
|
-
const newSegments =
|
|
4237
|
+
const newSegments = chunk4Z4HEIP5_js.applyCaseTransformToSegments(
|
|
4244
4238
|
selectedElement.textSegments,
|
|
4245
4239
|
inlineSel,
|
|
4246
4240
|
mode
|
|
@@ -4250,14 +4244,14 @@ function useElementOperations(input) {
|
|
|
4250
4244
|
}
|
|
4251
4245
|
const updates = {};
|
|
4252
4246
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4253
|
-
updates.textSegments =
|
|
4247
|
+
updates.textSegments = chunk4Z4HEIP5_js.applyCaseTransformToSegments(
|
|
4254
4248
|
selectedElement.textSegments,
|
|
4255
4249
|
null,
|
|
4256
4250
|
mode
|
|
4257
4251
|
);
|
|
4258
4252
|
}
|
|
4259
4253
|
if (typeof selectedElement.text === "string") {
|
|
4260
|
-
updates.text =
|
|
4254
|
+
updates.text = chunk4Z4HEIP5_js.transformTextCase(selectedElement.text, mode);
|
|
4261
4255
|
}
|
|
4262
4256
|
updateSelectedElement(updates);
|
|
4263
4257
|
},
|
|
@@ -4270,15 +4264,15 @@ function useElementOperations(input) {
|
|
|
4270
4264
|
[setSlides]
|
|
4271
4265
|
);
|
|
4272
4266
|
const masterViewTarget = masterView?.target ?? null;
|
|
4273
|
-
const activeElements = masterViewTarget ?
|
|
4267
|
+
const activeElements = masterViewTarget ? chunk4Z4HEIP5_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4274
4268
|
const updateActiveElements = react.useCallback(
|
|
4275
4269
|
(updater) => {
|
|
4276
4270
|
if (masterView?.target) {
|
|
4277
4271
|
applyMasterViewWrite(
|
|
4278
|
-
|
|
4272
|
+
chunk4Z4HEIP5_js.replaceMasterViewElements(
|
|
4279
4273
|
masterView,
|
|
4280
4274
|
masterView.target,
|
|
4281
|
-
updater(
|
|
4275
|
+
updater(chunk4Z4HEIP5_js.masterViewElements(masterView, masterView.target))
|
|
4282
4276
|
)
|
|
4283
4277
|
);
|
|
4284
4278
|
return;
|
|
@@ -4331,7 +4325,7 @@ function useSectionOperations(input) {
|
|
|
4331
4325
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4332
4326
|
const addSection2 = react.useCallback(
|
|
4333
4327
|
(name, afterSlideIndex) => {
|
|
4334
|
-
const result =
|
|
4328
|
+
const result = chunk4Z4HEIP5_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4335
4329
|
setSlides(result.slides);
|
|
4336
4330
|
setSections(result.sections);
|
|
4337
4331
|
markDirty();
|
|
@@ -4340,7 +4334,7 @@ function useSectionOperations(input) {
|
|
|
4340
4334
|
);
|
|
4341
4335
|
const renameSection2 = react.useCallback(
|
|
4342
4336
|
(sectionId, newName) => {
|
|
4343
|
-
const result =
|
|
4337
|
+
const result = chunk4Z4HEIP5_js.renameSection(sections, slides, sectionId, newName);
|
|
4344
4338
|
setSections(result.sections);
|
|
4345
4339
|
setSlides(result.slides);
|
|
4346
4340
|
markDirty();
|
|
@@ -4349,7 +4343,7 @@ function useSectionOperations(input) {
|
|
|
4349
4343
|
);
|
|
4350
4344
|
const deleteSection2 = react.useCallback(
|
|
4351
4345
|
(sectionId) => {
|
|
4352
|
-
const result =
|
|
4346
|
+
const result = chunk4Z4HEIP5_js.deleteSection(sections, slides, sectionId);
|
|
4353
4347
|
setSections(result.sections);
|
|
4354
4348
|
setSlides(result.slides);
|
|
4355
4349
|
markDirty();
|
|
@@ -4358,21 +4352,21 @@ function useSectionOperations(input) {
|
|
|
4358
4352
|
);
|
|
4359
4353
|
const moveSectionUp2 = react.useCallback(
|
|
4360
4354
|
(sectionId) => {
|
|
4361
|
-
setSections(
|
|
4355
|
+
setSections(chunk4Z4HEIP5_js.moveSectionUp(sections, sectionId));
|
|
4362
4356
|
markDirty();
|
|
4363
4357
|
},
|
|
4364
4358
|
[sections, setSections, markDirty]
|
|
4365
4359
|
);
|
|
4366
4360
|
const moveSectionDown2 = react.useCallback(
|
|
4367
4361
|
(sectionId) => {
|
|
4368
|
-
setSections(
|
|
4362
|
+
setSections(chunk4Z4HEIP5_js.moveSectionDown(sections, sectionId));
|
|
4369
4363
|
markDirty();
|
|
4370
4364
|
},
|
|
4371
4365
|
[sections, setSections, markDirty]
|
|
4372
4366
|
);
|
|
4373
4367
|
const moveSlidesToSection2 = react.useCallback(
|
|
4374
4368
|
(slideIndexes, targetSectionId) => {
|
|
4375
|
-
const result =
|
|
4369
|
+
const result = chunk4Z4HEIP5_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4376
4370
|
setSlides(result.slides);
|
|
4377
4371
|
setSections(result.sections);
|
|
4378
4372
|
markDirty();
|
|
@@ -4401,19 +4395,19 @@ function useSectionOperations(input) {
|
|
|
4401
4395
|
|
|
4402
4396
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4403
4397
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4404
|
-
const resized =
|
|
4398
|
+
const resized = chunk4Z4HEIP5_js.applyResize(
|
|
4405
4399
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4406
4400
|
handle,
|
|
4407
4401
|
dx,
|
|
4408
4402
|
dy,
|
|
4409
4403
|
1,
|
|
4410
|
-
{ minSize:
|
|
4404
|
+
{ minSize: chunkLLZ25OVR_js.MIN_ELEMENT_SIZE }
|
|
4411
4405
|
);
|
|
4412
4406
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4413
4407
|
if (!snapToGrid) {
|
|
4414
4408
|
return box;
|
|
4415
4409
|
}
|
|
4416
|
-
return
|
|
4410
|
+
return chunk4Z4HEIP5_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkLLZ25OVR_js.MIN_ELEMENT_SIZE);
|
|
4417
4411
|
}
|
|
4418
4412
|
function resolveLiveTarget(input) {
|
|
4419
4413
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4526,7 +4520,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4526
4520
|
width: el.width,
|
|
4527
4521
|
height: el.height
|
|
4528
4522
|
}));
|
|
4529
|
-
const snapResult =
|
|
4523
|
+
const snapResult = chunk4Z4HEIP5_js.computeSnapToShape(
|
|
4530
4524
|
targetX,
|
|
4531
4525
|
targetY,
|
|
4532
4526
|
primaryEl.width,
|
|
@@ -4565,7 +4559,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4565
4559
|
if (live) {
|
|
4566
4560
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4567
4561
|
const start = drag.startPositionsById[id];
|
|
4568
|
-
|
|
4562
|
+
chunk4Z4HEIP5_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4569
4563
|
x: start.x + appliedDx,
|
|
4570
4564
|
y: start.y + appliedDy
|
|
4571
4565
|
});
|
|
@@ -4599,22 +4593,22 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4599
4593
|
if (rs.domEl) {
|
|
4600
4594
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4601
4595
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4602
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4603
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4596
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunkLLZ25OVR_js.MIN_ELEMENT_SIZE)}px`;
|
|
4597
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunkLLZ25OVR_js.MIN_ELEMENT_SIZE)}px`;
|
|
4604
4598
|
}
|
|
4605
4599
|
if (live) {
|
|
4606
|
-
|
|
4600
|
+
chunk4Z4HEIP5_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4607
4601
|
x: geo.x,
|
|
4608
4602
|
y: geo.y,
|
|
4609
|
-
width: Math.max(geo.width,
|
|
4610
|
-
height: Math.max(geo.height,
|
|
4603
|
+
width: Math.max(geo.width, chunkLLZ25OVR_js.MIN_ELEMENT_SIZE),
|
|
4604
|
+
height: Math.max(geo.height, chunkLLZ25OVR_js.MIN_ELEMENT_SIZE)
|
|
4611
4605
|
});
|
|
4612
4606
|
}
|
|
4613
4607
|
}
|
|
4614
4608
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4615
4609
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4616
4610
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4617
|
-
const adjustments =
|
|
4611
|
+
const adjustments = chunk4Z4HEIP5_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4618
4612
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4619
4613
|
adj.moved = true;
|
|
4620
4614
|
}
|
|
@@ -4689,13 +4683,13 @@ function processPointerUp(input) {
|
|
|
4689
4683
|
if (i !== activeSlideIndex) {
|
|
4690
4684
|
return s;
|
|
4691
4685
|
}
|
|
4692
|
-
const rerouted =
|
|
4686
|
+
const rerouted = chunk4Z4HEIP5_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4693
4687
|
if (rerouted.length === 0) {
|
|
4694
4688
|
return s;
|
|
4695
4689
|
}
|
|
4696
4690
|
return {
|
|
4697
4691
|
...s,
|
|
4698
|
-
elements:
|
|
4692
|
+
elements: chunk4Z4HEIP5_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4699
4693
|
};
|
|
4700
4694
|
})
|
|
4701
4695
|
);
|
|
@@ -4720,9 +4714,9 @@ function processPointerUp(input) {
|
|
|
4720
4714
|
}
|
|
4721
4715
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4722
4716
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4723
|
-
const hitIds =
|
|
4717
|
+
const hitIds = chunk4Z4HEIP5_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4724
4718
|
if (marquee.additive) {
|
|
4725
|
-
const merged =
|
|
4719
|
+
const merged = chunk4Z4HEIP5_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4726
4720
|
if (merged.length > 0) {
|
|
4727
4721
|
applySelection(merged[0], merged);
|
|
4728
4722
|
} else {
|
|
@@ -4745,8 +4739,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4745
4739
|
}
|
|
4746
4740
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4747
4741
|
});
|
|
4748
|
-
const rerouted =
|
|
4749
|
-
return
|
|
4742
|
+
const rerouted = chunk4Z4HEIP5_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4743
|
+
return chunk4Z4HEIP5_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4750
4744
|
};
|
|
4751
4745
|
if (editTemplateMode) {
|
|
4752
4746
|
const slideId = activeSlide?.id;
|
|
@@ -4903,9 +4897,9 @@ function useCanvasInteractions(input) {
|
|
|
4903
4897
|
return;
|
|
4904
4898
|
}
|
|
4905
4899
|
const el = elementLookup.get(editId);
|
|
4906
|
-
if (el &&
|
|
4900
|
+
if (el && chunk4Z4HEIP5_js.hasTextProperties(el)) {
|
|
4907
4901
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4908
|
-
const newSegments =
|
|
4902
|
+
const newSegments = chunk4Z4HEIP5_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4909
4903
|
ops.updateElementById(editId, {
|
|
4910
4904
|
text: committedText,
|
|
4911
4905
|
textSegments: newSegments
|
|
@@ -4916,7 +4910,7 @@ function useCanvasInteractions(input) {
|
|
|
4916
4910
|
setInlineEditingText("");
|
|
4917
4911
|
};
|
|
4918
4912
|
const openEquationEditorForElement = (el) => {
|
|
4919
|
-
if (!
|
|
4913
|
+
if (!chunk4Z4HEIP5_js.hasTextProperties(el)) {
|
|
4920
4914
|
return false;
|
|
4921
4915
|
}
|
|
4922
4916
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4946,7 +4940,7 @@ function useCanvasInteractions(input) {
|
|
|
4946
4940
|
justInteractedRef.current = false;
|
|
4947
4941
|
} else {
|
|
4948
4942
|
const el = elementLookup.get(elementId);
|
|
4949
|
-
if (el &&
|
|
4943
|
+
if (el && chunk4Z4HEIP5_js.hasTextProperties(el) && chunk4Z4HEIP5_js.canInteractWithElement(el, "textEdit")) {
|
|
4950
4944
|
if (!openEquationEditorForElement(el)) {
|
|
4951
4945
|
setInlineEditingElementId(elementId);
|
|
4952
4946
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4965,7 +4959,7 @@ function useCanvasInteractions(input) {
|
|
|
4965
4959
|
if (openEquationEditorForElement(el)) {
|
|
4966
4960
|
return;
|
|
4967
4961
|
}
|
|
4968
|
-
if (
|
|
4962
|
+
if (chunk4Z4HEIP5_js.hasTextProperties(el) && chunk4Z4HEIP5_js.canInteractWithElement(el, "textEdit")) {
|
|
4969
4963
|
setInlineEditingElementId(elementId);
|
|
4970
4964
|
setInlineEditingText(el.text ?? "");
|
|
4971
4965
|
}
|
|
@@ -4988,7 +4982,7 @@ function useCanvasInteractions(input) {
|
|
|
4988
4982
|
justSelectedRef.current = false;
|
|
4989
4983
|
}
|
|
4990
4984
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
4991
|
-
const movableIds =
|
|
4985
|
+
const movableIds = chunk4Z4HEIP5_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
4992
4986
|
if (movableIds.length === 0) {
|
|
4993
4987
|
return;
|
|
4994
4988
|
}
|
|
@@ -5058,7 +5052,7 @@ function useCanvasInteractions(input) {
|
|
|
5058
5052
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5059
5053
|
e.stopPropagation();
|
|
5060
5054
|
const el = elementLookup.get(elementId);
|
|
5061
|
-
if (!el || !
|
|
5055
|
+
if (!el || !chunk4Z4HEIP5_js.canInteractWithElement(el, "resize")) {
|
|
5062
5056
|
return;
|
|
5063
5057
|
}
|
|
5064
5058
|
resizeStateRef.current = {
|
|
@@ -5080,7 +5074,7 @@ function useCanvasInteractions(input) {
|
|
|
5080
5074
|
};
|
|
5081
5075
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5082
5076
|
const el = elementLookup.get(elementId);
|
|
5083
|
-
if (!el || !
|
|
5077
|
+
if (!el || !chunk4Z4HEIP5_js.canInteractWithElement(el, "rotate")) {
|
|
5084
5078
|
return;
|
|
5085
5079
|
}
|
|
5086
5080
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5100,10 +5094,10 @@ function useCanvasInteractions(input) {
|
|
|
5100
5094
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5101
5095
|
e.stopPropagation();
|
|
5102
5096
|
const el = elementLookup.get(elementId);
|
|
5103
|
-
if (!el || !
|
|
5097
|
+
if (!el || !chunk4Z4HEIP5_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5104
5098
|
return;
|
|
5105
5099
|
}
|
|
5106
|
-
shapeAdjustmentDragStateRef.current =
|
|
5100
|
+
shapeAdjustmentDragStateRef.current = chunk4Z4HEIP5_js.beginShapeAdjustment(
|
|
5107
5101
|
el,
|
|
5108
5102
|
descriptor,
|
|
5109
5103
|
e.clientX,
|
|
@@ -5150,7 +5144,7 @@ function createFileHandlers(deps) {
|
|
|
5150
5144
|
h = Math.round(h * scale);
|
|
5151
5145
|
}
|
|
5152
5146
|
addElement({
|
|
5153
|
-
id:
|
|
5147
|
+
id: chunk4Z4HEIP5_js.generateElementId(),
|
|
5154
5148
|
type: "image",
|
|
5155
5149
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5156
5150
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5161,7 +5155,7 @@ function createFileHandlers(deps) {
|
|
|
5161
5155
|
};
|
|
5162
5156
|
img.onerror = () => {
|
|
5163
5157
|
addElement({
|
|
5164
|
-
id:
|
|
5158
|
+
id: chunk4Z4HEIP5_js.generateElementId(),
|
|
5165
5159
|
type: "image",
|
|
5166
5160
|
x: 100,
|
|
5167
5161
|
y: 100,
|
|
@@ -5187,7 +5181,7 @@ function createFileHandlers(deps) {
|
|
|
5187
5181
|
const elFilePath = file.path;
|
|
5188
5182
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5189
5183
|
addElement({
|
|
5190
|
-
id:
|
|
5184
|
+
id: chunk4Z4HEIP5_js.generateElementId(),
|
|
5191
5185
|
type: "media",
|
|
5192
5186
|
mediaType,
|
|
5193
5187
|
mediaMimeType: file.type || void 0,
|
|
@@ -5362,13 +5356,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5362
5356
|
return;
|
|
5363
5357
|
}
|
|
5364
5358
|
addElement({
|
|
5365
|
-
id:
|
|
5359
|
+
id: chunk4Z4HEIP5_js.generateElementId(),
|
|
5366
5360
|
type: "smartArt",
|
|
5367
5361
|
x: 100,
|
|
5368
5362
|
y: 120,
|
|
5369
5363
|
width: 600,
|
|
5370
5364
|
height: 340,
|
|
5371
|
-
smartArtData:
|
|
5365
|
+
smartArtData: chunk4Z4HEIP5_js.buildSmartArtPresetData(
|
|
5372
5366
|
layout,
|
|
5373
5367
|
defaultItems,
|
|
5374
5368
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5380,7 +5374,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5380
5374
|
return;
|
|
5381
5375
|
}
|
|
5382
5376
|
addElement({
|
|
5383
|
-
id:
|
|
5377
|
+
id: chunk4Z4HEIP5_js.generateElementId(),
|
|
5384
5378
|
type: "shape",
|
|
5385
5379
|
x: 120,
|
|
5386
5380
|
y: 200,
|
|
@@ -5418,7 +5412,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5418
5412
|
return;
|
|
5419
5413
|
}
|
|
5420
5414
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5421
|
-
if (resolved.url && !
|
|
5415
|
+
if (resolved.url && !chunk4Z4HEIP5_js.isUrlSafe(resolved.url)) {
|
|
5422
5416
|
return;
|
|
5423
5417
|
}
|
|
5424
5418
|
const actionClick = {
|
|
@@ -5442,7 +5436,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5442
5436
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5443
5437
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5444
5438
|
addElement({
|
|
5445
|
-
id:
|
|
5439
|
+
id: chunk4Z4HEIP5_js.generateElementId(),
|
|
5446
5440
|
type: "shape",
|
|
5447
5441
|
x: 120,
|
|
5448
5442
|
y: 200,
|
|
@@ -5464,11 +5458,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5464
5458
|
if (!activeSlide) {
|
|
5465
5459
|
return;
|
|
5466
5460
|
}
|
|
5467
|
-
const preset =
|
|
5461
|
+
const preset = chunk4Z4HEIP5_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5468
5462
|
if (!preset) {
|
|
5469
5463
|
return;
|
|
5470
5464
|
}
|
|
5471
|
-
const defaultPptxAction =
|
|
5465
|
+
const defaultPptxAction = chunk4Z4HEIP5_js.elementActionToPptxAction({
|
|
5472
5466
|
trigger: "click",
|
|
5473
5467
|
type: preset.defaultAction
|
|
5474
5468
|
});
|
|
@@ -5477,7 +5471,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5477
5471
|
defaultPptxAction.highlightClick = true;
|
|
5478
5472
|
}
|
|
5479
5473
|
addElement({
|
|
5480
|
-
id:
|
|
5474
|
+
id: chunk4Z4HEIP5_js.generateElementId(),
|
|
5481
5475
|
type: "shape",
|
|
5482
5476
|
x: 150,
|
|
5483
5477
|
y: 150,
|
|
@@ -5544,14 +5538,14 @@ function useInsertElements(input) {
|
|
|
5544
5538
|
return;
|
|
5545
5539
|
}
|
|
5546
5540
|
addElement({
|
|
5547
|
-
id:
|
|
5541
|
+
id: chunk4Z4HEIP5_js.generateElementId(),
|
|
5548
5542
|
type: "text",
|
|
5549
5543
|
x: 100,
|
|
5550
5544
|
y: 100,
|
|
5551
5545
|
width: 300,
|
|
5552
5546
|
height: 60,
|
|
5553
5547
|
text: "",
|
|
5554
|
-
textStyle: { fontSize:
|
|
5548
|
+
textStyle: { fontSize: chunkLLZ25OVR_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5555
5549
|
});
|
|
5556
5550
|
};
|
|
5557
5551
|
const handleAddShape = () => {
|
|
@@ -5559,7 +5553,7 @@ function useInsertElements(input) {
|
|
|
5559
5553
|
return;
|
|
5560
5554
|
}
|
|
5561
5555
|
addElement({
|
|
5562
|
-
id:
|
|
5556
|
+
id: chunk4Z4HEIP5_js.generateElementId(),
|
|
5563
5557
|
type: "shape",
|
|
5564
5558
|
x: 150,
|
|
5565
5559
|
y: 150,
|
|
@@ -5578,15 +5572,15 @@ function useInsertElements(input) {
|
|
|
5578
5572
|
return;
|
|
5579
5573
|
}
|
|
5580
5574
|
addElement({
|
|
5581
|
-
...
|
|
5582
|
-
id:
|
|
5575
|
+
...chunk4Z4HEIP5_js.newTableElement(chunkLLZ25OVR_js.DEFAULT_TABLE_ROWS, chunkLLZ25OVR_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5576
|
+
id: chunk4Z4HEIP5_js.generateElementId()
|
|
5583
5577
|
});
|
|
5584
5578
|
};
|
|
5585
5579
|
const handleAddChart = (chartKind) => {
|
|
5586
5580
|
if (!activeSlide) {
|
|
5587
5581
|
return;
|
|
5588
5582
|
}
|
|
5589
|
-
addElement(
|
|
5583
|
+
addElement(chunk4Z4HEIP5_js.createDefaultChartElement(chartKind));
|
|
5590
5584
|
};
|
|
5591
5585
|
const structured = createStructuredElementHandlers({
|
|
5592
5586
|
activeSlide,
|
|
@@ -5656,7 +5650,7 @@ function useClipboardHandlers(input) {
|
|
|
5656
5650
|
if (!selectedElement) {
|
|
5657
5651
|
return;
|
|
5658
5652
|
}
|
|
5659
|
-
setClipboardPayload(
|
|
5653
|
+
setClipboardPayload(chunk4Z4HEIP5_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5660
5654
|
};
|
|
5661
5655
|
const handleDelete = () => {
|
|
5662
5656
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5673,7 +5667,7 @@ function useClipboardHandlers(input) {
|
|
|
5673
5667
|
handleDelete();
|
|
5674
5668
|
};
|
|
5675
5669
|
const insertClone = (source) => {
|
|
5676
|
-
const clone =
|
|
5670
|
+
const clone = chunk4Z4HEIP5_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5677
5671
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5678
5672
|
ops.applySelection(clone.id);
|
|
5679
5673
|
history.markDirty();
|
|
@@ -5708,7 +5702,7 @@ function resolveShapePath(el) {
|
|
|
5708
5702
|
return el.pathData;
|
|
5709
5703
|
}
|
|
5710
5704
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5711
|
-
const clipPath =
|
|
5705
|
+
const clipPath = chunk4Z4HEIP5_js.getPresetShapeClipPath(el.shapeType);
|
|
5712
5706
|
if (clipPath) {
|
|
5713
5707
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5714
5708
|
if (svgPath) {
|
|
@@ -5759,7 +5753,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5759
5753
|
return parts.join(" ");
|
|
5760
5754
|
}
|
|
5761
5755
|
function transformPathToGlobal(pathData, el) {
|
|
5762
|
-
const polys =
|
|
5756
|
+
const polys = chunk4Z4HEIP5_js.svgPathToPolygons(pathData);
|
|
5763
5757
|
if (polys.length === 0) {
|
|
5764
5758
|
return pathData;
|
|
5765
5759
|
}
|
|
@@ -5779,10 +5773,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5779
5773
|
y: pt.y * scaleY + el.y
|
|
5780
5774
|
}))
|
|
5781
5775
|
);
|
|
5782
|
-
return
|
|
5776
|
+
return chunk4Z4HEIP5_js.polygonsToSvgPath(transformed);
|
|
5783
5777
|
}
|
|
5784
5778
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5785
|
-
const polys =
|
|
5779
|
+
const polys = chunk4Z4HEIP5_js.svgPathToPolygons(pathData);
|
|
5786
5780
|
if (polys.length === 0) {
|
|
5787
5781
|
return pathData;
|
|
5788
5782
|
}
|
|
@@ -5792,10 +5786,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5792
5786
|
y: pt.y - y
|
|
5793
5787
|
}))
|
|
5794
5788
|
);
|
|
5795
|
-
return
|
|
5789
|
+
return chunk4Z4HEIP5_js.polygonsToSvgPath(transformed);
|
|
5796
5790
|
}
|
|
5797
5791
|
function pathBounds(pathData) {
|
|
5798
|
-
const polys =
|
|
5792
|
+
const polys = chunk4Z4HEIP5_js.svgPathToPolygons(pathData);
|
|
5799
5793
|
let minX = Infinity;
|
|
5800
5794
|
let minY = Infinity;
|
|
5801
5795
|
let maxX = -Infinity;
|
|
@@ -5854,7 +5848,7 @@ function useMergeShapesHandler(input) {
|
|
|
5854
5848
|
let allFragments = [];
|
|
5855
5849
|
let remaining = globalPaths[0];
|
|
5856
5850
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5857
|
-
const frags =
|
|
5851
|
+
const frags = chunk4Z4HEIP5_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5858
5852
|
if (Array.isArray(frags)) {
|
|
5859
5853
|
allFragments = frags;
|
|
5860
5854
|
}
|
|
@@ -5883,7 +5877,7 @@ function useMergeShapesHandler(input) {
|
|
|
5883
5877
|
bounds.height
|
|
5884
5878
|
);
|
|
5885
5879
|
const newEl = {
|
|
5886
|
-
id:
|
|
5880
|
+
id: chunk4Z4HEIP5_js.generateElementId(),
|
|
5887
5881
|
type: "shape",
|
|
5888
5882
|
x: bounds.x,
|
|
5889
5883
|
y: bounds.y,
|
|
@@ -5921,7 +5915,7 @@ function useMergeShapesHandler(input) {
|
|
|
5921
5915
|
} else {
|
|
5922
5916
|
let resultPath = globalPaths[0];
|
|
5923
5917
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5924
|
-
const result =
|
|
5918
|
+
const result = chunk4Z4HEIP5_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5925
5919
|
if (typeof result === "string") {
|
|
5926
5920
|
resultPath = result;
|
|
5927
5921
|
}
|
|
@@ -5942,7 +5936,7 @@ function useMergeShapesHandler(input) {
|
|
|
5942
5936
|
);
|
|
5943
5937
|
const primary = targets[0];
|
|
5944
5938
|
const newEl = {
|
|
5945
|
-
id:
|
|
5939
|
+
id: chunk4Z4HEIP5_js.generateElementId(),
|
|
5946
5940
|
type: "shape",
|
|
5947
5941
|
x: bounds.x,
|
|
5948
5942
|
y: bounds.y,
|
|
@@ -6005,7 +5999,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6005
5999
|
if (ids.length < 2 || !activeSlide) {
|
|
6006
6000
|
return;
|
|
6007
6001
|
}
|
|
6008
|
-
const { elements, groupId } =
|
|
6002
|
+
const { elements, groupId } = chunk4Z4HEIP5_js.groupElements(ops.activeElements, ids, chunk4Z4HEIP5_js.generateElementId());
|
|
6009
6003
|
if (groupId === null) {
|
|
6010
6004
|
return;
|
|
6011
6005
|
}
|
|
@@ -6018,11 +6012,11 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6018
6012
|
return;
|
|
6019
6013
|
}
|
|
6020
6014
|
const group = selectedElement;
|
|
6021
|
-
const intoTemplate =
|
|
6015
|
+
const intoTemplate = chunk4Z4HEIP5_js.isTemplateElementId(group.id);
|
|
6022
6016
|
const childIds = group.children.map(
|
|
6023
|
-
(child) => intoTemplate ?
|
|
6017
|
+
(child) => intoTemplate ? chunk4Z4HEIP5_js.makeCloneId(true, child.id || group.id) : child.id || chunk4Z4HEIP5_js.generateElementId()
|
|
6024
6018
|
);
|
|
6025
|
-
const { elements, childIds: usedIds } =
|
|
6019
|
+
const { elements, childIds: usedIds } = chunk4Z4HEIP5_js.ungroupElements(
|
|
6026
6020
|
ops.activeElements,
|
|
6027
6021
|
group.id,
|
|
6028
6022
|
childIds,
|
|
@@ -6051,7 +6045,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6051
6045
|
if (!edge) {
|
|
6052
6046
|
return;
|
|
6053
6047
|
}
|
|
6054
|
-
const positions =
|
|
6048
|
+
const positions = chunk4Z4HEIP5_js.alignElements(selectedElements, edge);
|
|
6055
6049
|
for (const [id, pos] of positions) {
|
|
6056
6050
|
const el = elementLookup.get(id);
|
|
6057
6051
|
if (!el) {
|
|
@@ -6069,7 +6063,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6069
6063
|
if (!distAxis) {
|
|
6070
6064
|
return;
|
|
6071
6065
|
}
|
|
6072
|
-
const positions =
|
|
6066
|
+
const positions = chunk4Z4HEIP5_js.distributeElements(selectedElements, distAxis);
|
|
6073
6067
|
for (const [id, pos] of positions) {
|
|
6074
6068
|
const el = elementLookup.get(id);
|
|
6075
6069
|
if (!el) {
|
|
@@ -6086,7 +6080,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6086
6080
|
}
|
|
6087
6081
|
const id = selectedElement.id;
|
|
6088
6082
|
ops.updateActiveElements(
|
|
6089
|
-
(els) => direction === "forward" ?
|
|
6083
|
+
(els) => direction === "forward" ? chunk4Z4HEIP5_js.bringForward(els, id) : direction === "backward" ? chunk4Z4HEIP5_js.sendBackward(els, id) : els
|
|
6090
6084
|
);
|
|
6091
6085
|
history.markDirty();
|
|
6092
6086
|
};
|
|
@@ -6096,7 +6090,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6096
6090
|
}
|
|
6097
6091
|
const id = selectedElement.id;
|
|
6098
6092
|
ops.updateActiveElements(
|
|
6099
|
-
(els) => direction === "front" ?
|
|
6093
|
+
(els) => direction === "front" ? chunk4Z4HEIP5_js.bringToFront(els, id) : chunk4Z4HEIP5_js.sendToBack(els, id)
|
|
6100
6094
|
);
|
|
6101
6095
|
history.markDirty();
|
|
6102
6096
|
};
|
|
@@ -6227,7 +6221,7 @@ function useSlideManagement(input) {
|
|
|
6227
6221
|
theme
|
|
6228
6222
|
} = input;
|
|
6229
6223
|
const handleAddSlide = () => {
|
|
6230
|
-
const newSlide =
|
|
6224
|
+
const newSlide = chunk4Z4HEIP5_js.createBlankSlide(slides.length + 1);
|
|
6231
6225
|
ops.updateSlides((prev) => {
|
|
6232
6226
|
const next = [...prev];
|
|
6233
6227
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6290,7 +6284,7 @@ function useSlideManagement(input) {
|
|
|
6290
6284
|
}
|
|
6291
6285
|
const clone = {
|
|
6292
6286
|
...src,
|
|
6293
|
-
id:
|
|
6287
|
+
id: chunk4Z4HEIP5_js.makeSlideId(),
|
|
6294
6288
|
elements: src.elements.map((el) => ({
|
|
6295
6289
|
...el,
|
|
6296
6290
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6322,7 +6316,7 @@ function useSlideManagement(input) {
|
|
|
6322
6316
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6323
6317
|
const insertAt = activeSlideIndex + 1;
|
|
6324
6318
|
const draft = {
|
|
6325
|
-
...
|
|
6319
|
+
...chunk4Z4HEIP5_js.createBlankSlide(slides.length + 1),
|
|
6326
6320
|
layoutPath,
|
|
6327
6321
|
...layoutName ? { layoutName } : {}
|
|
6328
6322
|
};
|
|
@@ -6355,9 +6349,9 @@ function useSlideManagement(input) {
|
|
|
6355
6349
|
};
|
|
6356
6350
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6357
6351
|
const insertAt = activeSlideIndex + 1;
|
|
6358
|
-
const draft =
|
|
6352
|
+
const draft = chunk4Z4HEIP5_js.buildSlideTemplateSlide(templateId, chunk4Z4HEIP5_js.makeSlideId(), slides.length + 1, {
|
|
6359
6353
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6360
|
-
scheme:
|
|
6354
|
+
scheme: chunk4Z4HEIP5_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6361
6355
|
});
|
|
6362
6356
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6363
6357
|
setActiveSlideIndex(insertAt);
|
|
@@ -6394,7 +6388,7 @@ function createTableMergeHandlers(input) {
|
|
|
6394
6388
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6395
6389
|
return;
|
|
6396
6390
|
}
|
|
6397
|
-
const newTableData =
|
|
6391
|
+
const newTableData = chunk4Z4HEIP5_js.mergeCells(
|
|
6398
6392
|
[
|
|
6399
6393
|
{ row: rowIndex, col: columnIndex },
|
|
6400
6394
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6402,7 +6396,7 @@ function createTableMergeHandlers(input) {
|
|
|
6402
6396
|
td
|
|
6403
6397
|
);
|
|
6404
6398
|
const updates = { tableData: newTableData };
|
|
6405
|
-
const newRawXml =
|
|
6399
|
+
const newRawXml = chunk4Z4HEIP5_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6406
6400
|
if (newRawXml) {
|
|
6407
6401
|
updates.rawXml = newRawXml;
|
|
6408
6402
|
}
|
|
@@ -6428,7 +6422,7 @@ function createTableMergeHandlers(input) {
|
|
|
6428
6422
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6429
6423
|
return;
|
|
6430
6424
|
}
|
|
6431
|
-
const newTableData =
|
|
6425
|
+
const newTableData = chunk4Z4HEIP5_js.mergeCells(
|
|
6432
6426
|
[
|
|
6433
6427
|
{ row: rowIndex, col: columnIndex },
|
|
6434
6428
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6436,7 +6430,7 @@ function createTableMergeHandlers(input) {
|
|
|
6436
6430
|
td
|
|
6437
6431
|
);
|
|
6438
6432
|
const updates = { tableData: newTableData };
|
|
6439
|
-
const newRawXml =
|
|
6433
|
+
const newRawXml = chunk4Z4HEIP5_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6440
6434
|
if (newRawXml) {
|
|
6441
6435
|
updates.rawXml = newRawXml;
|
|
6442
6436
|
}
|
|
@@ -6451,9 +6445,9 @@ function createTableMergeHandlers(input) {
|
|
|
6451
6445
|
return;
|
|
6452
6446
|
}
|
|
6453
6447
|
const td = selectedElement.tableData;
|
|
6454
|
-
const newTableData =
|
|
6448
|
+
const newTableData = chunk4Z4HEIP5_js.mergeCells(ts.selectedCells, td);
|
|
6455
6449
|
const updates = { tableData: newTableData };
|
|
6456
|
-
const newRawXml =
|
|
6450
|
+
const newRawXml = chunk4Z4HEIP5_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6457
6451
|
if (newRawXml) {
|
|
6458
6452
|
updates.rawXml = newRawXml;
|
|
6459
6453
|
}
|
|
@@ -6470,9 +6464,9 @@ function createTableMergeHandlers(input) {
|
|
|
6470
6464
|
}
|
|
6471
6465
|
const { rowIndex, columnIndex } = ts;
|
|
6472
6466
|
const td = selectedElement.tableData;
|
|
6473
|
-
const newTableData =
|
|
6467
|
+
const newTableData = chunk4Z4HEIP5_js.splitCell(rowIndex, columnIndex, td);
|
|
6474
6468
|
const updates = { tableData: newTableData };
|
|
6475
|
-
const newRawXml =
|
|
6469
|
+
const newRawXml = chunk4Z4HEIP5_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6476
6470
|
if (newRawXml) {
|
|
6477
6471
|
updates.rawXml = newRawXml;
|
|
6478
6472
|
}
|
|
@@ -6504,10 +6498,10 @@ function createTableStructHandlers(input) {
|
|
|
6504
6498
|
}
|
|
6505
6499
|
const updates = {};
|
|
6506
6500
|
if (el.tableData) {
|
|
6507
|
-
updates.tableData =
|
|
6501
|
+
updates.tableData = chunk4Z4HEIP5_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6508
6502
|
}
|
|
6509
6503
|
if (el.rawXml) {
|
|
6510
|
-
const newRawXml =
|
|
6504
|
+
const newRawXml = chunk4Z4HEIP5_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6511
6505
|
if (newRawXml) {
|
|
6512
6506
|
updates.rawXml = newRawXml;
|
|
6513
6507
|
}
|
|
@@ -6531,7 +6525,7 @@ function createTableStructHandlers(input) {
|
|
|
6531
6525
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6532
6526
|
const updates = {};
|
|
6533
6527
|
if (selectedElement.rawXml) {
|
|
6534
|
-
const newRawXml =
|
|
6528
|
+
const newRawXml = chunk4Z4HEIP5_js.updateCellTextStyleInRawXml(
|
|
6535
6529
|
selectedElement,
|
|
6536
6530
|
rowIndex,
|
|
6537
6531
|
colIndex,
|
|
@@ -6595,9 +6589,9 @@ function createTableStructHandlers(input) {
|
|
|
6595
6589
|
return;
|
|
6596
6590
|
}
|
|
6597
6591
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6598
|
-
const newTableData =
|
|
6592
|
+
const newTableData = chunk4Z4HEIP5_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6599
6593
|
const updates = { tableData: newTableData };
|
|
6600
|
-
const newRawXml =
|
|
6594
|
+
const newRawXml = chunk4Z4HEIP5_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6601
6595
|
if (newRawXml) {
|
|
6602
6596
|
updates.rawXml = newRawXml;
|
|
6603
6597
|
}
|
|
@@ -6610,12 +6604,12 @@ function createTableStructHandlers(input) {
|
|
|
6610
6604
|
}
|
|
6611
6605
|
const td = selectedElement.tableData;
|
|
6612
6606
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6613
|
-
const newTableData =
|
|
6607
|
+
const newTableData = chunk4Z4HEIP5_js.deleteTableRow(td, rowIdx);
|
|
6614
6608
|
if (newTableData === td) {
|
|
6615
6609
|
return;
|
|
6616
6610
|
}
|
|
6617
6611
|
const updates = { tableData: newTableData };
|
|
6618
|
-
const newRawXml =
|
|
6612
|
+
const newRawXml = chunk4Z4HEIP5_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6619
6613
|
if (newRawXml) {
|
|
6620
6614
|
updates.rawXml = newRawXml;
|
|
6621
6615
|
}
|
|
@@ -6627,9 +6621,9 @@ function createTableStructHandlers(input) {
|
|
|
6627
6621
|
return;
|
|
6628
6622
|
}
|
|
6629
6623
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6630
|
-
const newTableData =
|
|
6624
|
+
const newTableData = chunk4Z4HEIP5_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6631
6625
|
const updates = { tableData: newTableData };
|
|
6632
|
-
const newRawXml =
|
|
6626
|
+
const newRawXml = chunk4Z4HEIP5_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6633
6627
|
if (newRawXml) {
|
|
6634
6628
|
updates.rawXml = newRawXml;
|
|
6635
6629
|
}
|
|
@@ -6642,12 +6636,12 @@ function createTableStructHandlers(input) {
|
|
|
6642
6636
|
}
|
|
6643
6637
|
const td = selectedElement.tableData;
|
|
6644
6638
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6645
|
-
const newTableData =
|
|
6639
|
+
const newTableData = chunk4Z4HEIP5_js.deleteTableColumn(td, colIdx);
|
|
6646
6640
|
if (newTableData === td) {
|
|
6647
6641
|
return;
|
|
6648
6642
|
}
|
|
6649
6643
|
const updates = { tableData: newTableData };
|
|
6650
|
-
const newRawXml =
|
|
6644
|
+
const newRawXml = chunk4Z4HEIP5_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6651
6645
|
if (newRawXml) {
|
|
6652
6646
|
updates.rawXml = newRawXml;
|
|
6653
6647
|
}
|
|
@@ -6683,8 +6677,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6683
6677
|
return html2canvasPro(element, {
|
|
6684
6678
|
...options,
|
|
6685
6679
|
onclone: async (doc, clonedEl) => {
|
|
6686
|
-
await
|
|
6687
|
-
|
|
6680
|
+
await chunk4Z4HEIP5_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6681
|
+
chunk4Z4HEIP5_js.preprocessCssForCapture(clonedEl);
|
|
6688
6682
|
if (typeof userOnClone === "function") {
|
|
6689
6683
|
userOnClone(doc, clonedEl);
|
|
6690
6684
|
}
|
|
@@ -6740,7 +6734,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6740
6734
|
}
|
|
6741
6735
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6742
6736
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6743
|
-
|
|
6737
|
+
chunk4Z4HEIP5_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6744
6738
|
}
|
|
6745
6739
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6746
6740
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6762,15 +6756,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6762
6756
|
continue;
|
|
6763
6757
|
}
|
|
6764
6758
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6765
|
-
images.push(
|
|
6759
|
+
images.push(chunk4Z4HEIP5_js.canvasToJpegData(canvas));
|
|
6766
6760
|
}
|
|
6767
6761
|
onProgress?.(totalSlides, totalSlides);
|
|
6768
6762
|
setActiveSlide(currentSlideIndex);
|
|
6769
6763
|
if (images.length === 0) {
|
|
6770
6764
|
throw new Error(chunk6CPUGAK7_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6771
6765
|
}
|
|
6772
|
-
const pdfBlobUrl =
|
|
6773
|
-
|
|
6766
|
+
const pdfBlobUrl = chunkLLZ25OVR_js.buildPdfFromImageData(images);
|
|
6767
|
+
chunk4Z4HEIP5_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6774
6768
|
}
|
|
6775
6769
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6776
6770
|
const { scale = 2, onProgress } = options;
|
|
@@ -6818,8 +6812,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6818
6812
|
if (pages.length === 0) {
|
|
6819
6813
|
throw new Error(chunk6CPUGAK7_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6820
6814
|
}
|
|
6821
|
-
const pdfDataUrl =
|
|
6822
|
-
|
|
6815
|
+
const pdfDataUrl = chunkLLZ25OVR_js.buildNotesPdf(pages);
|
|
6816
|
+
chunk4Z4HEIP5_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6823
6817
|
}
|
|
6824
6818
|
|
|
6825
6819
|
// src/viewer/utils/export-video.ts
|
|
@@ -6863,7 +6857,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6863
6857
|
const fps = 30;
|
|
6864
6858
|
const stream = recordingCanvas.captureStream(fps);
|
|
6865
6859
|
const recorder = new MediaRecorder(stream, {
|
|
6866
|
-
mimeType:
|
|
6860
|
+
mimeType: chunk4Z4HEIP5_js.pickSupportedMimeType([...chunk4Z4HEIP5_js.WEBM_MIME_CANDIDATES]),
|
|
6867
6861
|
videoBitsPerSecond: 5e6
|
|
6868
6862
|
});
|
|
6869
6863
|
const chunks = [];
|
|
@@ -6886,8 +6880,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6886
6880
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6887
6881
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6888
6882
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6889
|
-
const frameInterval =
|
|
6890
|
-
const framesNeeded =
|
|
6883
|
+
const frameInterval = chunk4Z4HEIP5_js.fpsToFrameIntervalMs(fps);
|
|
6884
|
+
const framesNeeded = chunk4Z4HEIP5_js.segmentFrameCount(duration, fps);
|
|
6891
6885
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6892
6886
|
if (signal?.aborted) {
|
|
6893
6887
|
recorder.stop();
|
|
@@ -6936,7 +6930,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6936
6930
|
if (frames.length === 0) {
|
|
6937
6931
|
throw new Error(chunk6CPUGAK7_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6938
6932
|
}
|
|
6939
|
-
const gifBytes =
|
|
6933
|
+
const gifBytes = chunk4Z4HEIP5_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6940
6934
|
onProgress?.(totalSlides, totalSlides);
|
|
6941
6935
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6942
6936
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6990,7 +6984,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6990
6984
|
continue;
|
|
6991
6985
|
}
|
|
6992
6986
|
onProgress?.(processedCount, data.slides.length);
|
|
6993
|
-
let svg =
|
|
6987
|
+
let svg = chunk4Z4HEIP5_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6994
6988
|
if (embedFonts && fontFaces?.length) {
|
|
6995
6989
|
svg = injectFontFaces(svg, fontFaces);
|
|
6996
6990
|
}
|
|
@@ -7048,13 +7042,13 @@ function useExportSaveAs(input) {
|
|
|
7048
7042
|
setExportProgress(10);
|
|
7049
7043
|
setExportStatusMessage("Adding presentation...");
|
|
7050
7044
|
const pptxData = await serializeSlides();
|
|
7051
|
-
const pptxFilename =
|
|
7045
|
+
const pptxFilename = chunk4Z4HEIP5_js.savedPresentationFileName(filePath);
|
|
7052
7046
|
if (pptxData) {
|
|
7053
7047
|
pkgFolder.file(pptxFilename, pptxData);
|
|
7054
7048
|
}
|
|
7055
7049
|
setExportProgress(70);
|
|
7056
7050
|
setExportStatusMessage("Writing README...");
|
|
7057
|
-
const readme =
|
|
7051
|
+
const readme = chunk4Z4HEIP5_js.generatePackageReadme(pptxFilename);
|
|
7058
7052
|
pkgFolder.file("README.txt", readme);
|
|
7059
7053
|
if (abortCtrl.signal.aborted) {
|
|
7060
7054
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -7064,7 +7058,7 @@ function useExportSaveAs(input) {
|
|
|
7064
7058
|
const zipBlob = await zip.generateAsync({ type: "blob" });
|
|
7065
7059
|
setExportProgress(95);
|
|
7066
7060
|
setExportStatusMessage("Downloading...");
|
|
7067
|
-
|
|
7061
|
+
chunk4Z4HEIP5_js.downloadBlob(zipBlob, `${chunk4Z4HEIP5_js.presentationBaseName(pptxFilename)}-package.zip`);
|
|
7068
7062
|
setExportProgress(100);
|
|
7069
7063
|
} catch (err) {
|
|
7070
7064
|
if (err.name !== "AbortError") {
|
|
@@ -7080,13 +7074,13 @@ function useExportSaveAs(input) {
|
|
|
7080
7074
|
if (!handler) {
|
|
7081
7075
|
return;
|
|
7082
7076
|
}
|
|
7083
|
-
const downloadName =
|
|
7077
|
+
const downloadName = chunk4Z4HEIP5_js.savedPresentationFileName(filePath, format);
|
|
7084
7078
|
try {
|
|
7085
7079
|
const data = await buildSaveAsData(handler, format);
|
|
7086
7080
|
const blob = new Blob([data], {
|
|
7087
7081
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
7088
7082
|
});
|
|
7089
|
-
|
|
7083
|
+
chunk4Z4HEIP5_js.downloadBlob(blob, downloadName);
|
|
7090
7084
|
} catch (err) {
|
|
7091
7085
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
7092
7086
|
}
|
|
@@ -7099,18 +7093,18 @@ function useExportSaveAs(input) {
|
|
|
7099
7093
|
const pptxGuides = guides.map((g) => ({
|
|
7100
7094
|
id: g.id,
|
|
7101
7095
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7102
|
-
positionEmu:
|
|
7096
|
+
positionEmu: chunk4Z4HEIP5_js.guidePxToEmu(g.position)
|
|
7103
7097
|
}));
|
|
7104
7098
|
return {
|
|
7105
7099
|
...slide,
|
|
7106
7100
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7107
7101
|
};
|
|
7108
7102
|
});
|
|
7109
|
-
const slidesToSave =
|
|
7103
|
+
const slidesToSave = chunk4Z4HEIP5_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7110
7104
|
const saveOptions = {
|
|
7111
7105
|
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
7112
7106
|
// a preset picked in the inspector reached one save path and not the other.
|
|
7113
|
-
slideSize:
|
|
7107
|
+
slideSize: chunk4Z4HEIP5_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
7114
7108
|
headerFooter,
|
|
7115
7109
|
presentationProperties,
|
|
7116
7110
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -7124,13 +7118,13 @@ function useExportSaveAs(input) {
|
|
|
7124
7118
|
handoutMaster,
|
|
7125
7119
|
outputFormat: format
|
|
7126
7120
|
};
|
|
7127
|
-
return
|
|
7121
|
+
return chunk4Z4HEIP5_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
7128
7122
|
};
|
|
7129
7123
|
const handleExportJson = () => {
|
|
7130
7124
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7131
|
-
const slideSize =
|
|
7125
|
+
const slideSize = chunk4Z4HEIP5_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7132
7126
|
const data = {
|
|
7133
|
-
slides:
|
|
7127
|
+
slides: chunk4Z4HEIP5_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7134
7128
|
width: canvasSize.width,
|
|
7135
7129
|
height: canvasSize.height,
|
|
7136
7130
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7149,7 +7143,7 @@ function useExportSaveAs(input) {
|
|
|
7149
7143
|
handoutMaster
|
|
7150
7144
|
};
|
|
7151
7145
|
try {
|
|
7152
|
-
|
|
7146
|
+
chunk4Z4HEIP5_js.exportDeckJson(data, sourceName);
|
|
7153
7147
|
} catch (err) {
|
|
7154
7148
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7155
7149
|
}
|
|
@@ -7189,7 +7183,7 @@ function safeConfirm(message) {
|
|
|
7189
7183
|
}
|
|
7190
7184
|
}
|
|
7191
7185
|
function downloadBlob2(blob, filename) {
|
|
7192
|
-
|
|
7186
|
+
chunk4Z4HEIP5_js.downloadBlob(blob, chunk4Z4HEIP5_js.sanitizeDownloadFilename(filename));
|
|
7193
7187
|
}
|
|
7194
7188
|
|
|
7195
7189
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7299,21 +7293,21 @@ function useExportHandlers(input) {
|
|
|
7299
7293
|
{
|
|
7300
7294
|
scale: 2,
|
|
7301
7295
|
onProgress: (current, total) => {
|
|
7302
|
-
setExportProgress(
|
|
7303
|
-
setExportStatusMessage(
|
|
7296
|
+
setExportProgress(chunk4Z4HEIP5_js.slideProgressPercent(current, total));
|
|
7297
|
+
setExportStatusMessage(chunk4Z4HEIP5_js.slideStatusLabel("Rendering", current, total));
|
|
7304
7298
|
},
|
|
7305
7299
|
signal: abortCtrl.signal
|
|
7306
7300
|
}
|
|
7307
7301
|
);
|
|
7308
|
-
setExportProgress(
|
|
7302
|
+
setExportProgress(chunk4Z4HEIP5_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7309
7303
|
setExportStatusMessage("Building PDF...");
|
|
7310
7304
|
await new Promise((r) => {
|
|
7311
7305
|
setTimeout(r, 100);
|
|
7312
7306
|
});
|
|
7313
|
-
setExportProgress(
|
|
7307
|
+
setExportProgress(chunk4Z4HEIP5_js.EXPORT_DONE_PERCENT);
|
|
7314
7308
|
setExportStatusMessage("Done!");
|
|
7315
7309
|
} catch (err) {
|
|
7316
|
-
if (!
|
|
7310
|
+
if (!chunk4Z4HEIP5_js.isExportAbortError(err)) {
|
|
7317
7311
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7318
7312
|
}
|
|
7319
7313
|
} finally {
|
|
@@ -7343,21 +7337,21 @@ function useExportHandlers(input) {
|
|
|
7343
7337
|
{
|
|
7344
7338
|
scale: 2,
|
|
7345
7339
|
onProgress: (current, total) => {
|
|
7346
|
-
setExportProgress(
|
|
7347
|
-
setExportStatusMessage(
|
|
7340
|
+
setExportProgress(chunk4Z4HEIP5_js.slideProgressPercent(current, total));
|
|
7341
|
+
setExportStatusMessage(chunk4Z4HEIP5_js.slideStatusLabel("Rendering", current, total));
|
|
7348
7342
|
},
|
|
7349
7343
|
signal: abortCtrl.signal
|
|
7350
7344
|
}
|
|
7351
7345
|
);
|
|
7352
|
-
setExportProgress(
|
|
7346
|
+
setExportProgress(chunk4Z4HEIP5_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7353
7347
|
setExportStatusMessage("Building PDF...");
|
|
7354
7348
|
await new Promise((r) => {
|
|
7355
7349
|
setTimeout(r, 100);
|
|
7356
7350
|
});
|
|
7357
|
-
setExportProgress(
|
|
7351
|
+
setExportProgress(chunk4Z4HEIP5_js.EXPORT_DONE_PERCENT);
|
|
7358
7352
|
setExportStatusMessage("Done!");
|
|
7359
7353
|
} catch (err) {
|
|
7360
|
-
if (!
|
|
7354
|
+
if (!chunk4Z4HEIP5_js.isExportAbortError(err)) {
|
|
7361
7355
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7362
7356
|
}
|
|
7363
7357
|
} finally {
|
|
@@ -7398,22 +7392,22 @@ function useExportHandlers(input) {
|
|
|
7398
7392
|
scale: 1,
|
|
7399
7393
|
slideDurationMs: 3e3,
|
|
7400
7394
|
onProgress: (current, total) => {
|
|
7401
|
-
setExportProgress(
|
|
7402
|
-
setExportStatusMessage(
|
|
7395
|
+
setExportProgress(chunk4Z4HEIP5_js.slideProgressPercent(current, total, 45));
|
|
7396
|
+
setExportStatusMessage(chunk4Z4HEIP5_js.slideStatusLabel("Capturing", current, total));
|
|
7403
7397
|
},
|
|
7404
7398
|
onRecordProgress: (current, total) => {
|
|
7405
|
-
setExportProgress(
|
|
7406
|
-
setExportStatusMessage(
|
|
7399
|
+
setExportProgress(chunk4Z4HEIP5_js.recordProgressPercent(current, total));
|
|
7400
|
+
setExportStatusMessage(chunk4Z4HEIP5_js.slideStatusLabel("Recording", current, total));
|
|
7407
7401
|
},
|
|
7408
7402
|
signal: abortCtrl.signal
|
|
7409
7403
|
}
|
|
7410
7404
|
);
|
|
7411
|
-
setExportProgress(
|
|
7405
|
+
setExportProgress(chunk4Z4HEIP5_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7412
7406
|
setExportStatusMessage("Saving file...");
|
|
7413
7407
|
downloadBlob2(blob, "presentation.webm");
|
|
7414
|
-
setExportProgress(
|
|
7408
|
+
setExportProgress(chunk4Z4HEIP5_js.EXPORT_DONE_PERCENT);
|
|
7415
7409
|
} catch (err) {
|
|
7416
|
-
if (!
|
|
7410
|
+
if (!chunk4Z4HEIP5_js.isExportAbortError(err)) {
|
|
7417
7411
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7418
7412
|
}
|
|
7419
7413
|
} finally {
|
|
@@ -7441,18 +7435,18 @@ function useExportHandlers(input) {
|
|
|
7441
7435
|
scale: 0.5,
|
|
7442
7436
|
slideDurationMs: 2e3,
|
|
7443
7437
|
onProgress: (current, total) => {
|
|
7444
|
-
setExportProgress(
|
|
7445
|
-
setExportStatusMessage(
|
|
7438
|
+
setExportProgress(chunk4Z4HEIP5_js.slideProgressPercent(current, total));
|
|
7439
|
+
setExportStatusMessage(chunk4Z4HEIP5_js.slideStatusLabel("Encoding", current, total));
|
|
7446
7440
|
},
|
|
7447
7441
|
signal: abortCtrl.signal
|
|
7448
7442
|
}
|
|
7449
7443
|
);
|
|
7450
|
-
setExportProgress(
|
|
7444
|
+
setExportProgress(chunk4Z4HEIP5_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7451
7445
|
setExportStatusMessage("Saving file...");
|
|
7452
7446
|
downloadBlob2(blob, "presentation.gif");
|
|
7453
|
-
setExportProgress(
|
|
7447
|
+
setExportProgress(chunk4Z4HEIP5_js.EXPORT_DONE_PERCENT);
|
|
7454
7448
|
} catch (err) {
|
|
7455
|
-
if (!
|
|
7449
|
+
if (!chunk4Z4HEIP5_js.isExportAbortError(err)) {
|
|
7456
7450
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7457
7451
|
}
|
|
7458
7452
|
} finally {
|
|
@@ -7493,7 +7487,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7493
7487
|
}
|
|
7494
7488
|
printWindow.document.open();
|
|
7495
7489
|
printWindow.document.write(
|
|
7496
|
-
|
|
7490
|
+
chunk4Z4HEIP5_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7497
7491
|
);
|
|
7498
7492
|
printWindow.document.close();
|
|
7499
7493
|
printWindow.focus();
|
|
@@ -7527,26 +7521,14 @@ function usePrintHandlers(input) {
|
|
|
7527
7521
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7528
7522
|
return handlePrintWithSettings(settings);
|
|
7529
7523
|
}
|
|
7530
|
-
const colorFilter = (
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
|
|
7534
|
-
|
|
7535
|
-
|
|
7536
|
-
|
|
7537
|
-
|
|
7538
|
-
})();
|
|
7539
|
-
const slideIndices = (() => {
|
|
7540
|
-
if (settings.slideRange === "current") {
|
|
7541
|
-
return [activeSlideIndex];
|
|
7542
|
-
}
|
|
7543
|
-
if (settings.slideRange === "custom") {
|
|
7544
|
-
const from = Math.max(0, settings.customRangeFrom - 1);
|
|
7545
|
-
const to = Math.min(slides.length - 1, settings.customRangeTo - 1);
|
|
7546
|
-
return Array.from({ length: to - from + 1 }, (_, i) => from + i);
|
|
7547
|
-
}
|
|
7548
|
-
return Array.from({ length: slides.length }, (_, i) => i);
|
|
7549
|
-
})();
|
|
7524
|
+
const colorFilter = chunk4Z4HEIP5_js.computeColorFilter(settings.colorMode);
|
|
7525
|
+
const slideIndices = chunk4Z4HEIP5_js.computeSlideIndices(
|
|
7526
|
+
settings.slideRange,
|
|
7527
|
+
activeSlideIndex,
|
|
7528
|
+
slides.length,
|
|
7529
|
+
settings.customRangeFrom,
|
|
7530
|
+
settings.customRangeTo
|
|
7531
|
+
);
|
|
7550
7532
|
try {
|
|
7551
7533
|
const svgs = exportAllSlidesToSvg(pptxData, {
|
|
7552
7534
|
slideIndices
|
|
@@ -7554,7 +7536,7 @@ function usePrintHandlers(input) {
|
|
|
7554
7536
|
if (svgs.length === 0) {
|
|
7555
7537
|
return;
|
|
7556
7538
|
}
|
|
7557
|
-
const printDoc =
|
|
7539
|
+
const printDoc = chunk4Z4HEIP5_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7558
7540
|
title: "Slides (Vector)",
|
|
7559
7541
|
orientation: settings.orientation,
|
|
7560
7542
|
colorFilter
|
|
@@ -7567,30 +7549,18 @@ function usePrintHandlers(input) {
|
|
|
7567
7549
|
};
|
|
7568
7550
|
const handlePrintWithSettings = async (settings) => {
|
|
7569
7551
|
setIsPrintDialogOpen(false);
|
|
7570
|
-
const colorFilter = (
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
})();
|
|
7579
|
-
const slideIndices = (() => {
|
|
7580
|
-
if (settings.slideRange === "current") {
|
|
7581
|
-
return [activeSlideIndex];
|
|
7582
|
-
}
|
|
7583
|
-
if (settings.slideRange === "custom") {
|
|
7584
|
-
const from = Math.max(0, settings.customRangeFrom - 1);
|
|
7585
|
-
const to = Math.min(slides.length - 1, settings.customRangeTo - 1);
|
|
7586
|
-
return Array.from({ length: to - from + 1 }, (_, i) => from + i);
|
|
7587
|
-
}
|
|
7588
|
-
return Array.from({ length: slides.length }, (_, i) => i);
|
|
7589
|
-
})();
|
|
7552
|
+
const colorFilter = chunk4Z4HEIP5_js.computeColorFilter(settings.colorMode);
|
|
7553
|
+
const slideIndices = chunk4Z4HEIP5_js.computeSlideIndices(
|
|
7554
|
+
settings.slideRange,
|
|
7555
|
+
activeSlideIndex,
|
|
7556
|
+
slides.length,
|
|
7557
|
+
settings.customRangeFrom,
|
|
7558
|
+
settings.customRangeTo
|
|
7559
|
+
);
|
|
7590
7560
|
if (settings.printWhat === "outline") {
|
|
7591
7561
|
openPrintWindow(
|
|
7592
7562
|
"Outline",
|
|
7593
|
-
`<div class="outline-page">${
|
|
7563
|
+
`<div class="outline-page">${chunk4Z4HEIP5_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7594
7564
|
settings.orientation,
|
|
7595
7565
|
colorFilter,
|
|
7596
7566
|
settings.frameSlides
|
|
@@ -7615,7 +7585,7 @@ function usePrintHandlers(input) {
|
|
|
7615
7585
|
if (settings.printWhat === "slides") {
|
|
7616
7586
|
openPrintWindow(
|
|
7617
7587
|
"Slides",
|
|
7618
|
-
|
|
7588
|
+
chunk4Z4HEIP5_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7619
7589
|
settings.orientation,
|
|
7620
7590
|
colorFilter,
|
|
7621
7591
|
settings.frameSlides
|
|
@@ -7625,7 +7595,7 @@ function usePrintHandlers(input) {
|
|
|
7625
7595
|
if (settings.printWhat === "notes") {
|
|
7626
7596
|
openPrintWindow(
|
|
7627
7597
|
"Notes Pages",
|
|
7628
|
-
|
|
7598
|
+
chunk4Z4HEIP5_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7629
7599
|
"portrait",
|
|
7630
7600
|
colorFilter,
|
|
7631
7601
|
settings.frameSlides
|
|
@@ -7636,7 +7606,7 @@ function usePrintHandlers(input) {
|
|
|
7636
7606
|
const spp = settings.slidesPerPage;
|
|
7637
7607
|
openPrintWindow(
|
|
7638
7608
|
`Handout ${spp} per page`,
|
|
7639
|
-
|
|
7609
|
+
chunk4Z4HEIP5_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7640
7610
|
"portrait",
|
|
7641
7611
|
colorFilter,
|
|
7642
7612
|
settings.frameSlides
|
|
@@ -7700,8 +7670,8 @@ function useThemeHandlers(input) {
|
|
|
7700
7670
|
return;
|
|
7701
7671
|
}
|
|
7702
7672
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7703
|
-
const previousMap = theme?.colorScheme ?
|
|
7704
|
-
setSlides((prev) =>
|
|
7673
|
+
const previousMap = theme?.colorScheme ? chunk4Z4HEIP5_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7674
|
+
setSlides((prev) => chunk4Z4HEIP5_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7705
7675
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7706
7676
|
bumpHistory();
|
|
7707
7677
|
history.markDirty();
|
|
@@ -7806,7 +7776,7 @@ function useThemeSwitching(input) {
|
|
|
7806
7776
|
}
|
|
7807
7777
|
try {
|
|
7808
7778
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7809
|
-
const newData =
|
|
7779
|
+
const newData = chunk4Z4HEIP5_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7810
7780
|
onDataChange(newData);
|
|
7811
7781
|
onThemeChanged?.(preset);
|
|
7812
7782
|
} catch (error) {
|
|
@@ -7823,7 +7793,7 @@ function useThemeSwitching(input) {
|
|
|
7823
7793
|
}
|
|
7824
7794
|
try {
|
|
7825
7795
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7826
|
-
const newData =
|
|
7796
|
+
const newData = chunk4Z4HEIP5_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7827
7797
|
onDataChange(newData);
|
|
7828
7798
|
} catch (error) {
|
|
7829
7799
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7835,12 +7805,12 @@ function useThemeSwitching(input) {
|
|
|
7835
7805
|
if (!data?.theme?.colorScheme) {
|
|
7836
7806
|
return void 0;
|
|
7837
7807
|
}
|
|
7838
|
-
return
|
|
7839
|
-
(p) =>
|
|
7808
|
+
return chunk4Z4HEIP5_js.THEME_PRESETS.find(
|
|
7809
|
+
(p) => chunk4Z4HEIP5_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7840
7810
|
);
|
|
7841
7811
|
}, [data?.theme?.colorScheme]);
|
|
7842
7812
|
return {
|
|
7843
|
-
presets:
|
|
7813
|
+
presets: chunk4Z4HEIP5_js.THEME_PRESETS,
|
|
7844
7814
|
switchToPreset,
|
|
7845
7815
|
switchToCustom,
|
|
7846
7816
|
currentPreset
|
|
@@ -7915,7 +7885,7 @@ function usePropertyHandlers(input) {
|
|
|
7915
7885
|
}
|
|
7916
7886
|
try {
|
|
7917
7887
|
const ab = await file.arrayBuffer();
|
|
7918
|
-
const h = new
|
|
7888
|
+
const h = new chunk4Z4HEIP5_js.PptxHandler();
|
|
7919
7889
|
const other = await h.load(ab);
|
|
7920
7890
|
if (!other) {
|
|
7921
7891
|
return;
|
|
@@ -7925,7 +7895,7 @@ function usePropertyHandlers(input) {
|
|
|
7925
7895
|
width: canvasSize.width,
|
|
7926
7896
|
height: canvasSize.height
|
|
7927
7897
|
};
|
|
7928
|
-
setCompareResult(
|
|
7898
|
+
setCompareResult(chunk4Z4HEIP5_js.comparePresentation(cur, other));
|
|
7929
7899
|
setIsComparePanelOpen(true);
|
|
7930
7900
|
} catch (err) {
|
|
7931
7901
|
console.warn("Compare failed:", err);
|
|
@@ -7942,7 +7912,7 @@ function usePropertyHandlers(input) {
|
|
|
7942
7912
|
if (!diff || diff.status === "unchanged") {
|
|
7943
7913
|
return;
|
|
7944
7914
|
}
|
|
7945
|
-
setSlides((prev) =>
|
|
7915
|
+
setSlides((prev) => chunk4Z4HEIP5_js.applyAcceptSlide(prev, diff));
|
|
7946
7916
|
setIsDirty(true);
|
|
7947
7917
|
},
|
|
7948
7918
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7953,10 +7923,10 @@ function usePropertyHandlers(input) {
|
|
|
7953
7923
|
if (!compareResult) {
|
|
7954
7924
|
return;
|
|
7955
7925
|
}
|
|
7956
|
-
setSlides((prev) =>
|
|
7926
|
+
setSlides((prev) => chunk4Z4HEIP5_js.applyAcceptAllSlides(prev, compareResult));
|
|
7957
7927
|
setIsDirty(true);
|
|
7958
7928
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7959
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7929
|
+
const usedFontFamilies = react.useMemo(() => chunk4Z4HEIP5_js.collectUsedFonts(slides), [slides]);
|
|
7960
7930
|
return {
|
|
7961
7931
|
handleUpdateNotes,
|
|
7962
7932
|
handleUpdateSlide,
|
|
@@ -8075,7 +8045,7 @@ function useIsMobile(input) {
|
|
|
8075
8045
|
const containerRef = input?.containerRef;
|
|
8076
8046
|
const isTouchDevice = react.useSyncExternalStore(
|
|
8077
8047
|
subscribeTouchCapability,
|
|
8078
|
-
|
|
8048
|
+
chunk4Z4HEIP5_js.detectTouchDevice,
|
|
8079
8049
|
() => false
|
|
8080
8050
|
// server snapshot
|
|
8081
8051
|
);
|
|
@@ -8091,7 +8061,7 @@ function useIsMobile(input) {
|
|
|
8091
8061
|
}
|
|
8092
8062
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
8093
8063
|
});
|
|
8094
|
-
const [orientation, setOrientation] = react.useState(
|
|
8064
|
+
const [orientation, setOrientation] = react.useState(chunk4Z4HEIP5_js.detectOrientation);
|
|
8095
8065
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
8096
8066
|
const [initialViewportHeight] = react.useState(
|
|
8097
8067
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -8135,7 +8105,7 @@ function useIsMobile(input) {
|
|
|
8135
8105
|
return;
|
|
8136
8106
|
}
|
|
8137
8107
|
const handleOrientationChange = () => {
|
|
8138
|
-
setOrientation(
|
|
8108
|
+
setOrientation(chunk4Z4HEIP5_js.detectOrientation());
|
|
8139
8109
|
};
|
|
8140
8110
|
if (screen.orientation) {
|
|
8141
8111
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -8165,9 +8135,9 @@ function useIsMobile(input) {
|
|
|
8165
8135
|
window.addEventListener("resize", handleResize);
|
|
8166
8136
|
return () => window.removeEventListener("resize", handleResize);
|
|
8167
8137
|
}, [isTouchDevice, initialViewportHeight]);
|
|
8168
|
-
const isMobile =
|
|
8169
|
-
const isTablet = !isMobile && containerWidth >=
|
|
8170
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
8138
|
+
const isMobile = chunk4Z4HEIP5_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
8139
|
+
const isTablet = !isMobile && containerWidth >= chunk4Z4HEIP5_js.MOBILE_BREAKPOINT && containerWidth < chunk4Z4HEIP5_js.TABLET_BREAKPOINT;
|
|
8140
|
+
const isDesktop = !isMobile && containerWidth >= chunk4Z4HEIP5_js.TABLET_BREAKPOINT;
|
|
8171
8141
|
return {
|
|
8172
8142
|
isMobile,
|
|
8173
8143
|
isTablet,
|
|
@@ -8229,7 +8199,7 @@ function useViewerDialogs(input) {
|
|
|
8229
8199
|
);
|
|
8230
8200
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8231
8201
|
const fontEmbedding = react.useMemo(
|
|
8232
|
-
() =>
|
|
8202
|
+
() => chunk4Z4HEIP5_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8233
8203
|
[embeddedFontKey]
|
|
8234
8204
|
);
|
|
8235
8205
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8237,11 +8207,11 @@ function useViewerDialogs(input) {
|
|
|
8237
8207
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8238
8208
|
}, [fontEmbedding]);
|
|
8239
8209
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8240
|
-
() => typeof window !== "undefined" ?
|
|
8210
|
+
() => typeof window !== "undefined" ? chunk4Z4HEIP5_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8241
8211
|
);
|
|
8242
8212
|
react.useEffect(() => {
|
|
8243
8213
|
const handleWindow = () => setIsNarrowViewport(
|
|
8244
|
-
|
|
8214
|
+
chunk4Z4HEIP5_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8245
8215
|
);
|
|
8246
8216
|
let observer = null;
|
|
8247
8217
|
let raf = 0;
|
|
@@ -8255,12 +8225,12 @@ function useViewerDialogs(input) {
|
|
|
8255
8225
|
const entry = entries[0];
|
|
8256
8226
|
if (entry) {
|
|
8257
8227
|
setIsNarrowViewport(
|
|
8258
|
-
|
|
8228
|
+
chunk4Z4HEIP5_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8259
8229
|
);
|
|
8260
8230
|
}
|
|
8261
8231
|
});
|
|
8262
8232
|
observer.observe(el);
|
|
8263
|
-
setIsNarrowViewport(
|
|
8233
|
+
setIsNarrowViewport(chunk4Z4HEIP5_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8264
8234
|
};
|
|
8265
8235
|
attach();
|
|
8266
8236
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8419,20 +8389,20 @@ function useViewerDialogs(input) {
|
|
|
8419
8389
|
}
|
|
8420
8390
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8421
8391
|
if (presentationGridSpacing) {
|
|
8422
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8392
|
+
const px = Math.round(presentationGridSpacing.cx / chunkLLZ25OVR_js.EMU_PER_PX);
|
|
8423
8393
|
if (px > 0) {
|
|
8424
8394
|
return px;
|
|
8425
8395
|
}
|
|
8426
8396
|
}
|
|
8427
|
-
return
|
|
8397
|
+
return chunkLLZ25OVR_js.GRID_SIZE;
|
|
8428
8398
|
}
|
|
8429
8399
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8430
8400
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8431
|
-
return
|
|
8401
|
+
return chunk4Z4HEIP5_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8432
8402
|
}
|
|
8433
8403
|
function computeSlideSectionGroups(slides, sections) {
|
|
8434
|
-
return
|
|
8435
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8404
|
+
return chunk4Z4HEIP5_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8405
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkLLZ25OVR_js.UNGROUPED_SECTION_ID : chunkLLZ25OVR_js.DEFAULT_SECTION_GROUP_ID),
|
|
8436
8406
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8437
8407
|
slideIndexes: group.slideIndexes,
|
|
8438
8408
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8444,7 +8414,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8444
8414
|
return void 0;
|
|
8445
8415
|
}
|
|
8446
8416
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8447
|
-
return
|
|
8417
|
+
return chunk4Z4HEIP5_js.masterViewPseudoSlide(document2, {
|
|
8448
8418
|
tab: "slides",
|
|
8449
8419
|
masterIndex: 0,
|
|
8450
8420
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8472,10 +8442,10 @@ function useDerivedSlideState(input) {
|
|
|
8472
8442
|
);
|
|
8473
8443
|
const slideSectionGroups = react.useMemo(
|
|
8474
8444
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8475
|
-
if (group.id ===
|
|
8445
|
+
if (group.id === chunkLLZ25OVR_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8476
8446
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8477
8447
|
}
|
|
8478
|
-
if (group.id ===
|
|
8448
|
+
if (group.id === chunkLLZ25OVR_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8479
8449
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8480
8450
|
}
|
|
8481
8451
|
return group;
|
|
@@ -8575,13 +8545,13 @@ function useAnnotationHandlers(input) {
|
|
|
8575
8545
|
}, [annotations, setMode, setSlides, history]);
|
|
8576
8546
|
const handleSetMode = react.useCallback(
|
|
8577
8547
|
(nextMode) => {
|
|
8578
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8548
|
+
if (mode === "present" && nextMode !== "present" && !chunk4Z4HEIP5_js.mayLeaveSlideShow()) {
|
|
8579
8549
|
return;
|
|
8580
8550
|
}
|
|
8581
8551
|
if (nextMode === "present") {
|
|
8582
8552
|
presentation.enterPresentMode();
|
|
8583
8553
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8584
|
-
|
|
8554
|
+
chunk4Z4HEIP5_js.stopAllPersistentAudio();
|
|
8585
8555
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8586
8556
|
if (promptKeepInkAnnotations) {
|
|
8587
8557
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8590,7 +8560,7 @@ function useAnnotationHandlers(input) {
|
|
|
8590
8560
|
}
|
|
8591
8561
|
} else {
|
|
8592
8562
|
if (mode === "present") {
|
|
8593
|
-
|
|
8563
|
+
chunk4Z4HEIP5_js.stopAllPersistentAudio();
|
|
8594
8564
|
}
|
|
8595
8565
|
setMode(nextMode);
|
|
8596
8566
|
}
|
|
@@ -8661,13 +8631,13 @@ function useSerialize(input) {
|
|
|
8661
8631
|
let processedSlide = slide;
|
|
8662
8632
|
if (pendingEditId) {
|
|
8663
8633
|
const updatedElements = slide.elements.map((el) => {
|
|
8664
|
-
if (el.id !== pendingEditId || !
|
|
8634
|
+
if (el.id !== pendingEditId || !chunk4Z4HEIP5_js.hasTextProperties(el)) {
|
|
8665
8635
|
return el;
|
|
8666
8636
|
}
|
|
8667
8637
|
return {
|
|
8668
8638
|
...el,
|
|
8669
8639
|
text: pendingEditText,
|
|
8670
|
-
textSegments:
|
|
8640
|
+
textSegments: chunk4Z4HEIP5_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8671
8641
|
};
|
|
8672
8642
|
});
|
|
8673
8643
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8680,19 +8650,19 @@ function useSerialize(input) {
|
|
|
8680
8650
|
const pptxGuides = guides.map((g) => ({
|
|
8681
8651
|
id: g.id,
|
|
8682
8652
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8683
|
-
positionEmu:
|
|
8653
|
+
positionEmu: chunk4Z4HEIP5_js.guidePxToEmu(g.position)
|
|
8684
8654
|
}));
|
|
8685
8655
|
return {
|
|
8686
8656
|
...processedSlide,
|
|
8687
8657
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8688
8658
|
};
|
|
8689
8659
|
});
|
|
8690
|
-
const slidesToSave =
|
|
8660
|
+
const slidesToSave = chunk4Z4HEIP5_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8691
8661
|
const saveOptions = {
|
|
8692
8662
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8693
8663
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8694
8664
|
// slide-size edit reaches the file.
|
|
8695
|
-
slideSize:
|
|
8665
|
+
slideSize: chunk4Z4HEIP5_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8696
8666
|
headerFooter,
|
|
8697
8667
|
presentationProperties,
|
|
8698
8668
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -8704,9 +8674,9 @@ function useSerialize(input) {
|
|
|
8704
8674
|
slideMasters,
|
|
8705
8675
|
notesMaster,
|
|
8706
8676
|
handoutMaster,
|
|
8707
|
-
...
|
|
8677
|
+
...chunk4Z4HEIP5_js.embeddedFontSaveOptions(embedFonts)
|
|
8708
8678
|
};
|
|
8709
|
-
return
|
|
8679
|
+
return chunk4Z4HEIP5_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8710
8680
|
}, [
|
|
8711
8681
|
slides,
|
|
8712
8682
|
templateElementsBySlideId,
|
|
@@ -8741,7 +8711,7 @@ function useRecoveryDetection(input) {
|
|
|
8741
8711
|
const onRestore = input.onRestore;
|
|
8742
8712
|
const openVersionHistory = input.openVersionHistory;
|
|
8743
8713
|
react.useEffect(() => {
|
|
8744
|
-
if (!
|
|
8714
|
+
if (!chunk4Z4HEIP5_js.shouldProbeAutosaveRecovery({
|
|
8745
8715
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8746
8716
|
filePath,
|
|
8747
8717
|
loading,
|
|
@@ -8753,7 +8723,7 @@ function useRecoveryDetection(input) {
|
|
|
8753
8723
|
}
|
|
8754
8724
|
recoveryCheckedRef.current = true;
|
|
8755
8725
|
void (async () => {
|
|
8756
|
-
const offer = await
|
|
8726
|
+
const offer = await chunk4Z4HEIP5_js.probeAutosaveRecovery(filePath);
|
|
8757
8727
|
if (!offer) {
|
|
8758
8728
|
return;
|
|
8759
8729
|
}
|
|
@@ -8766,7 +8736,7 @@ function useRecoveryDetection(input) {
|
|
|
8766
8736
|
const record = recordRef.current;
|
|
8767
8737
|
setPrompt(null);
|
|
8768
8738
|
if (record && onRestore) {
|
|
8769
|
-
onRestore(
|
|
8739
|
+
onRestore(chunk4Z4HEIP5_js.acceptAutosaveRecovery(record));
|
|
8770
8740
|
}
|
|
8771
8741
|
recordRef.current = null;
|
|
8772
8742
|
}, [onRestore]);
|
|
@@ -8775,7 +8745,7 @@ function useRecoveryDetection(input) {
|
|
|
8775
8745
|
setPrompt(null);
|
|
8776
8746
|
recordRef.current = null;
|
|
8777
8747
|
if (record) {
|
|
8778
|
-
void
|
|
8748
|
+
void chunk4Z4HEIP5_js.discardAutosaveRecovery(record);
|
|
8779
8749
|
}
|
|
8780
8750
|
}, []);
|
|
8781
8751
|
return { prompt, restore, discard };
|
|
@@ -8815,7 +8785,7 @@ function usePresentationSetup(input) {
|
|
|
8815
8785
|
containerRef,
|
|
8816
8786
|
content,
|
|
8817
8787
|
onSetMode: (nextMode) => {
|
|
8818
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8788
|
+
if (mode === "present" && nextMode !== "present" && !chunk4Z4HEIP5_js.mayLeaveSlideShow()) {
|
|
8819
8789
|
return;
|
|
8820
8790
|
}
|
|
8821
8791
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8823,7 +8793,7 @@ function usePresentationSetup(input) {
|
|
|
8823
8793
|
setShowKeepAnnotationsDialog(true);
|
|
8824
8794
|
} else {
|
|
8825
8795
|
if (mode === "present" && nextMode !== "present") {
|
|
8826
|
-
|
|
8796
|
+
chunk4Z4HEIP5_js.stopAllPersistentAudio();
|
|
8827
8797
|
stopAnimationSound();
|
|
8828
8798
|
}
|
|
8829
8799
|
setMode(nextMode);
|
|
@@ -8878,10 +8848,10 @@ function usePresentationSetup(input) {
|
|
|
8878
8848
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8879
8849
|
onToggleSubtitles,
|
|
8880
8850
|
onSaveRehearsalTimings: (timings) => {
|
|
8881
|
-
setSlides((prev) =>
|
|
8851
|
+
setSlides((prev) => chunk4Z4HEIP5_js.applyRehearsalTimings(prev, timings));
|
|
8882
8852
|
history.markDirty();
|
|
8883
8853
|
},
|
|
8884
|
-
loopContinuously:
|
|
8854
|
+
loopContinuously: chunk4Z4HEIP5_js.shouldLoopContinuously(presentationProperties),
|
|
8885
8855
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8886
8856
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8887
8857
|
endWithBlackSlide
|
|
@@ -9074,7 +9044,7 @@ function useEditorOperations(input) {
|
|
|
9074
9044
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9075
9045
|
react.useEffect(() => {
|
|
9076
9046
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9077
|
-
copiedFormatRef.current =
|
|
9047
|
+
copiedFormatRef.current = chunk4Z4HEIP5_js.copyFormatFromElement(selectedElement);
|
|
9078
9048
|
} else if (!formatPainterActive) {
|
|
9079
9049
|
copiedFormatRef.current = null;
|
|
9080
9050
|
}
|
|
@@ -9100,12 +9070,12 @@ function useEditorOperations(input) {
|
|
|
9100
9070
|
e.stopPropagation();
|
|
9101
9071
|
const element = elementLookup.get(elementId);
|
|
9102
9072
|
if (element) {
|
|
9103
|
-
const updated =
|
|
9073
|
+
const updated = chunk4Z4HEIP5_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9104
9074
|
const updates = {};
|
|
9105
|
-
if (
|
|
9075
|
+
if (chunk4Z4HEIP5_js.hasShapeProperties(updated)) {
|
|
9106
9076
|
updates.shapeStyle = updated.shapeStyle;
|
|
9107
9077
|
}
|
|
9108
|
-
if (
|
|
9078
|
+
if (chunk4Z4HEIP5_js.hasTextProperties(updated)) {
|
|
9109
9079
|
updates.textStyle = updated.textStyle;
|
|
9110
9080
|
}
|
|
9111
9081
|
ops.updateElementById(elementId, updates);
|
|
@@ -9259,7 +9229,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9259
9229
|
const families = /* @__PURE__ */ new Set();
|
|
9260
9230
|
for (const slide of slides) {
|
|
9261
9231
|
for (const el of slide.elements) {
|
|
9262
|
-
if (
|
|
9232
|
+
if (chunk4Z4HEIP5_js.hasTextProperties(el) && el.textSegments) {
|
|
9263
9233
|
for (const seg of el.textSegments) {
|
|
9264
9234
|
if (seg.style.fontFamily) {
|
|
9265
9235
|
families.add(seg.style.fontFamily);
|
|
@@ -9506,7 +9476,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9506
9476
|
inputRef.current = input;
|
|
9507
9477
|
const handleKeyDown = react.useCallback((e) => {
|
|
9508
9478
|
const current = inputRef.current;
|
|
9509
|
-
const { action, dx, dy } =
|
|
9479
|
+
const { action, dx, dy } = chunk4Z4HEIP5_js.mapEditorKey(e, {
|
|
9510
9480
|
canEdit: current.canEdit,
|
|
9511
9481
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9512
9482
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9519,7 +9489,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9519
9489
|
hasSelection: current.hasSelection,
|
|
9520
9490
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9521
9491
|
isDrawing: current.activeTool !== "select",
|
|
9522
|
-
isTextInputTarget:
|
|
9492
|
+
isTextInputTarget: chunk4Z4HEIP5_js.isEditorTextInputTarget(e.target)
|
|
9523
9493
|
});
|
|
9524
9494
|
if (action === null) {
|
|
9525
9495
|
return;
|
|
@@ -9825,7 +9795,7 @@ function useViewerIntegration(input) {
|
|
|
9825
9795
|
return zoom.scale;
|
|
9826
9796
|
},
|
|
9827
9797
|
setZoom(level) {
|
|
9828
|
-
zoom.setScale(
|
|
9798
|
+
zoom.setScale(chunk4Z4HEIP5_js.clampZoomScale(level));
|
|
9829
9799
|
},
|
|
9830
9800
|
zoomIn() {
|
|
9831
9801
|
zoom.handleZoomIn();
|
|
@@ -10041,7 +10011,7 @@ function useReducedMotion() {
|
|
|
10041
10011
|
}
|
|
10042
10012
|
function useViewerOptions() {
|
|
10043
10013
|
const storeRef = react.useRef(null);
|
|
10044
|
-
storeRef.current ??=
|
|
10014
|
+
storeRef.current ??= chunk4Z4HEIP5_js.createViewerOptionsStore();
|
|
10045
10015
|
const store = storeRef.current;
|
|
10046
10016
|
const options = react.useSyncExternalStore(
|
|
10047
10017
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -10050,9 +10020,9 @@ function useViewerOptions() {
|
|
|
10050
10020
|
);
|
|
10051
10021
|
return { optionsStore: store, options };
|
|
10052
10022
|
}
|
|
10053
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10023
|
+
var KNOWN_TAB_IDS = new Set(chunk4Z4HEIP5_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10054
10024
|
function computeToolbarVisibility(hiddenActions) {
|
|
10055
|
-
const isHidden = (id) =>
|
|
10025
|
+
const isHidden = (id) => chunk4Z4HEIP5_js.isActionHidden(id, hiddenActions);
|
|
10056
10026
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
10057
10027
|
return { isHidden, isTabVisible };
|
|
10058
10028
|
}
|
|
@@ -10138,12 +10108,12 @@ function useYjsDocumentSync({
|
|
|
10138
10108
|
return;
|
|
10139
10109
|
}
|
|
10140
10110
|
try {
|
|
10141
|
-
const handler = new
|
|
10111
|
+
const handler = new chunk4Z4HEIP5_js.PptxHandler();
|
|
10142
10112
|
await handler.load(sourceBytes.buffer);
|
|
10143
|
-
const currentSlides =
|
|
10113
|
+
const currentSlides = chunk4Z4HEIP5_js.readSlidesFromYDoc(
|
|
10144
10114
|
doc
|
|
10145
10115
|
);
|
|
10146
|
-
const slidesToSave =
|
|
10116
|
+
const slidesToSave = chunk4Z4HEIP5_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10147
10117
|
const bytes = await handler.save(slidesToSave);
|
|
10148
10118
|
config.onWriteBack(bytes);
|
|
10149
10119
|
} catch {
|
|
@@ -10158,10 +10128,10 @@ function useYjsDocumentSync({
|
|
|
10158
10128
|
if (!doc || !isConnected) {
|
|
10159
10129
|
return;
|
|
10160
10130
|
}
|
|
10161
|
-
const docSlides =
|
|
10131
|
+
const docSlides = chunk4Z4HEIP5_js.readSlidesFromYDoc(
|
|
10162
10132
|
doc
|
|
10163
10133
|
);
|
|
10164
|
-
if (!
|
|
10134
|
+
if (!chunk4Z4HEIP5_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10165
10135
|
return;
|
|
10166
10136
|
}
|
|
10167
10137
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10180,11 +10150,11 @@ function useYjsDocumentSync({
|
|
|
10180
10150
|
lastSyncedRef.current = serialized;
|
|
10181
10151
|
void (async () => {
|
|
10182
10152
|
const factories = await getFactories();
|
|
10183
|
-
|
|
10153
|
+
chunk4Z4HEIP5_js.reconcileSlidesInYDoc(
|
|
10184
10154
|
slides,
|
|
10185
10155
|
doc,
|
|
10186
10156
|
factories,
|
|
10187
|
-
|
|
10157
|
+
chunk4Z4HEIP5_js.LOCAL_SYNC_ORIGIN
|
|
10188
10158
|
);
|
|
10189
10159
|
scheduleWriteBack();
|
|
10190
10160
|
})();
|
|
@@ -10198,10 +10168,10 @@ function useYjsDocumentSync({
|
|
|
10198
10168
|
return;
|
|
10199
10169
|
}
|
|
10200
10170
|
const handleChange = (_events, transaction) => {
|
|
10201
|
-
if (transaction?.origin ===
|
|
10171
|
+
if (transaction?.origin === chunk4Z4HEIP5_js.LOCAL_SYNC_ORIGIN) {
|
|
10202
10172
|
return;
|
|
10203
10173
|
}
|
|
10204
|
-
const remoteSlides =
|
|
10174
|
+
const remoteSlides = chunk4Z4HEIP5_js.readSlidesFromYDoc(
|
|
10205
10175
|
doc
|
|
10206
10176
|
);
|
|
10207
10177
|
if (remoteSlides.length === 0) {
|
|
@@ -10217,7 +10187,7 @@ function useYjsDocumentSync({
|
|
|
10217
10187
|
isApplyingRemoteRef.current = false;
|
|
10218
10188
|
scheduleWriteBack();
|
|
10219
10189
|
};
|
|
10220
|
-
const unobserve =
|
|
10190
|
+
const unobserve = chunk4Z4HEIP5_js.observeYDocSlides(
|
|
10221
10191
|
doc,
|
|
10222
10192
|
handleChange
|
|
10223
10193
|
);
|
|
@@ -10255,7 +10225,7 @@ function useBroadcastFollower({
|
|
|
10255
10225
|
if (!broadcaster) {
|
|
10256
10226
|
return;
|
|
10257
10227
|
}
|
|
10258
|
-
if (!
|
|
10228
|
+
if (!chunk4Z4HEIP5_js.shouldAutoFollowBroadcaster({
|
|
10259
10229
|
localRole: collab.config.role,
|
|
10260
10230
|
broadcasterRole: broadcaster.role
|
|
10261
10231
|
})) {
|
|
@@ -10426,10 +10396,10 @@ function useTouchGestures(input) {
|
|
|
10426
10396
|
if (!el || !enabled) {
|
|
10427
10397
|
return;
|
|
10428
10398
|
}
|
|
10429
|
-
const recognizer =
|
|
10399
|
+
const recognizer = chunk4Z4HEIP5_js.createTouchGestureRecognizer({
|
|
10430
10400
|
getScale: () => scaleRef.current,
|
|
10431
|
-
minScale:
|
|
10432
|
-
maxScale:
|
|
10401
|
+
minScale: chunk4Z4HEIP5_js.MIN_ZOOM_SCALE,
|
|
10402
|
+
maxScale: chunk4Z4HEIP5_js.MAX_ZOOM_SCALE,
|
|
10433
10403
|
callbacks: {
|
|
10434
10404
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10435
10405
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10469,7 +10439,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10469
10439
|
return;
|
|
10470
10440
|
}
|
|
10471
10441
|
const rect = active.getBoundingClientRect();
|
|
10472
|
-
const delta =
|
|
10442
|
+
const delta = chunk4Z4HEIP5_js.computeScrollDelta(
|
|
10473
10443
|
{ top: rect.top, bottom: rect.bottom },
|
|
10474
10444
|
window.innerHeight,
|
|
10475
10445
|
keyboardInset
|
|
@@ -10489,8 +10459,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10489
10459
|
return;
|
|
10490
10460
|
}
|
|
10491
10461
|
const update = () => {
|
|
10492
|
-
const metrics =
|
|
10493
|
-
const inset = metrics ?
|
|
10462
|
+
const metrics = chunk4Z4HEIP5_js.readViewportMetrics(window);
|
|
10463
|
+
const inset = metrics ? chunk4Z4HEIP5_js.computeKeyboardInset(metrics) : 0;
|
|
10494
10464
|
setKeyboardInset(inset);
|
|
10495
10465
|
if (inset > 0) {
|
|
10496
10466
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10501,8 +10471,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10501
10471
|
vv.addEventListener("scroll", update);
|
|
10502
10472
|
const onFocusIn = () => {
|
|
10503
10473
|
window.requestAnimationFrame(() => {
|
|
10504
|
-
const metrics =
|
|
10505
|
-
const inset = metrics ?
|
|
10474
|
+
const metrics = chunk4Z4HEIP5_js.readViewportMetrics(window);
|
|
10475
|
+
const inset = metrics ? chunk4Z4HEIP5_js.computeKeyboardInset(metrics) : 0;
|
|
10506
10476
|
if (inset > 0) {
|
|
10507
10477
|
scrollFocusedIntoView(inset);
|
|
10508
10478
|
}
|
|
@@ -10515,7 +10485,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10515
10485
|
document.removeEventListener("focusin", onFocusIn);
|
|
10516
10486
|
};
|
|
10517
10487
|
}, [enabled]);
|
|
10518
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10488
|
+
return { keyboardInset, isKeyboardOpen: chunk4Z4HEIP5_js.isKeyboardOpen(keyboardInset) };
|
|
10519
10489
|
}
|
|
10520
10490
|
|
|
10521
10491
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10542,7 +10512,7 @@ function buildCanvasProps(input) {
|
|
|
10542
10512
|
} = input;
|
|
10543
10513
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10544
10514
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10545
|
-
const fieldContext =
|
|
10515
|
+
const fieldContext = chunk4Z4HEIP5_js.buildFieldSubstitutionContext({
|
|
10546
10516
|
headerFooter: s.headerFooter,
|
|
10547
10517
|
customProperties: s.customProperties,
|
|
10548
10518
|
slide: activeSlide
|
|
@@ -10552,13 +10522,13 @@ function buildCanvasProps(input) {
|
|
|
10552
10522
|
if (mode === "present") {
|
|
10553
10523
|
presentation.handlePresentationAction(action);
|
|
10554
10524
|
} else if (action.url) {
|
|
10555
|
-
|
|
10525
|
+
chunk4Z4HEIP5_js.safeOpenUrl(action.url);
|
|
10556
10526
|
}
|
|
10557
10527
|
};
|
|
10558
10528
|
const handleHyperlinkClick = (url) => {
|
|
10559
|
-
if (
|
|
10529
|
+
if (chunk4Z4HEIP5_js.isPpactionUrl(url)) {
|
|
10560
10530
|
if (mode === "present") {
|
|
10561
|
-
const parsed =
|
|
10531
|
+
const parsed = chunk4Z4HEIP5_js.parsePpactionUrl(url);
|
|
10562
10532
|
if (parsed) {
|
|
10563
10533
|
presentation.handlePresentationAction({
|
|
10564
10534
|
action: parsed.action,
|
|
@@ -10568,7 +10538,7 @@ function buildCanvasProps(input) {
|
|
|
10568
10538
|
}
|
|
10569
10539
|
return;
|
|
10570
10540
|
}
|
|
10571
|
-
|
|
10541
|
+
chunk4Z4HEIP5_js.safeOpenUrl(url);
|
|
10572
10542
|
};
|
|
10573
10543
|
return {
|
|
10574
10544
|
activeSlide: effectiveSlide,
|
|
@@ -10664,7 +10634,7 @@ function buildCanvasProps(input) {
|
|
|
10664
10634
|
|
|
10665
10635
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10666
10636
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10667
|
-
return
|
|
10637
|
+
return chunk4Z4HEIP5_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10668
10638
|
}
|
|
10669
10639
|
|
|
10670
10640
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10677,7 +10647,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10677
10647
|
const current = activeSlide.animations ?? [];
|
|
10678
10648
|
if (group === "motionPath") {
|
|
10679
10649
|
propertyHandlers.handleUpdateSlide({
|
|
10680
|
-
animations:
|
|
10650
|
+
animations: chunk4Z4HEIP5_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10681
10651
|
});
|
|
10682
10652
|
return;
|
|
10683
10653
|
}
|
|
@@ -10872,7 +10842,7 @@ function buildToolbarProps(input) {
|
|
|
10872
10842
|
onOpenFile,
|
|
10873
10843
|
onOpenRecentFile,
|
|
10874
10844
|
onCreatePresentation: (templateId) => {
|
|
10875
|
-
s.setSlides(
|
|
10845
|
+
s.setSlides(chunk4Z4HEIP5_js.createBackstagePresentation(templateId));
|
|
10876
10846
|
s.setActiveSlideIndex(0);
|
|
10877
10847
|
s.setSelectedElementId(null);
|
|
10878
10848
|
s.setSelectedElementIds([]);
|
|
@@ -10901,7 +10871,7 @@ function buildToolbarProps(input) {
|
|
|
10901
10871
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
10902
10872
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10903
10873
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10904
|
-
templateScheme:
|
|
10874
|
+
templateScheme: chunk4Z4HEIP5_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10905
10875
|
customShows: s.customShows,
|
|
10906
10876
|
activeCustomShowId: s.activeCustomShowId,
|
|
10907
10877
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -10942,7 +10912,7 @@ function buildToolbarProps(input) {
|
|
|
10942
10912
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10943
10913
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10944
10914
|
formatPainterActive: s.formatPainterActive,
|
|
10945
|
-
canActivateFormatPainter:
|
|
10915
|
+
canActivateFormatPainter: chunk4Z4HEIP5_js.hasCopyableFormat(selectedElement),
|
|
10946
10916
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10947
10917
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10948
10918
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11230,7 +11200,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11230
11200
|
}, [incomingContent]);
|
|
11231
11201
|
const onOpenFile = react.useCallback(() => {
|
|
11232
11202
|
void (async () => {
|
|
11233
|
-
const picked = await
|
|
11203
|
+
const picked = await chunk4Z4HEIP5_js.openPptxFile();
|
|
11234
11204
|
if (picked) {
|
|
11235
11205
|
setContent(picked.buffer);
|
|
11236
11206
|
}
|
|
@@ -11238,7 +11208,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11238
11208
|
}, []);
|
|
11239
11209
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11240
11210
|
void (async () => {
|
|
11241
|
-
const bytes = await
|
|
11211
|
+
const bytes = await chunk4Z4HEIP5_js.readBackstageRecentFile(key);
|
|
11242
11212
|
if (bytes) {
|
|
11243
11213
|
setContent(bytes);
|
|
11244
11214
|
}
|