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