pptx-react-viewer 3.1.5 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/dist/{AiChatPanel-ITCVRVKP.mjs → AiChatPanel-BNFDBP4S.mjs} +9 -8
- package/dist/AiChatPanel-BNFDBP4S.mjs.br +0 -0
- package/dist/AiChatPanel-BNFDBP4S.mjs.gz +0 -0
- package/dist/{AiChatPanel-TO5PHBGW.js → AiChatPanel-WNQCTQB5.js} +29 -28
- package/dist/AiChatPanel-WNQCTQB5.js.br +0 -0
- package/dist/AiChatPanel-WNQCTQB5.js.gz +0 -0
- package/dist/{Area3DChartScene-2UNQ3J3V.js → Area3DChartScene-FXBSLIGX.js} +2 -2
- package/dist/Area3DChartScene-FXBSLIGX.js.br +0 -0
- package/dist/Area3DChartScene-FXBSLIGX.js.gz +0 -0
- package/dist/{Area3DChartScene-7PHPDOTG.mjs → Area3DChartScene-SAQVRYOH.mjs} +1 -1
- package/dist/Area3DChartScene-SAQVRYOH.mjs.br +0 -0
- package/dist/Area3DChartScene-SAQVRYOH.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-MC5S3AGT.js → Bar3DChartScene-7HVUTP2E.js} +2 -2
- package/dist/Bar3DChartScene-7HVUTP2E.js.br +0 -0
- package/dist/Bar3DChartScene-7HVUTP2E.js.gz +0 -0
- package/dist/{Bar3DChartScene-BLPUHYRZ.mjs → Bar3DChartScene-LUA6E2K6.mjs} +1 -1
- package/dist/Bar3DChartScene-LUA6E2K6.mjs.br +3 -0
- package/dist/Bar3DChartScene-LUA6E2K6.mjs.gz +0 -0
- package/dist/{Line3DChartScene-L5B4YFG3.mjs → Line3DChartScene-IW4JGH57.mjs} +1 -1
- package/dist/Line3DChartScene-IW4JGH57.mjs.br +0 -0
- package/dist/Line3DChartScene-IW4JGH57.mjs.gz +0 -0
- package/dist/{Line3DChartScene-JVVZRIDD.js → Line3DChartScene-OVPULUTF.js} +2 -2
- package/dist/Line3DChartScene-OVPULUTF.js.br +0 -0
- package/dist/Line3DChartScene-OVPULUTF.js.gz +0 -0
- package/dist/{Model3DScene-LRDNQNKJ.js → Model3DScene-5KP6BVCV.js} +2 -2
- package/dist/Model3DScene-5KP6BVCV.js.br +0 -0
- package/dist/Model3DScene-5KP6BVCV.js.gz +0 -0
- package/dist/{Model3DScene-6TNWS5LV.mjs → Model3DScene-BERTZYCJ.mjs} +1 -1
- package/dist/Model3DScene-BERTZYCJ.mjs.br +0 -0
- package/dist/Model3DScene-BERTZYCJ.mjs.gz +0 -0
- package/dist/{PieChart3DScene-PZWZCXHX.js → PieChart3DScene-3R2ETTGA.js} +2 -2
- package/dist/PieChart3DScene-3R2ETTGA.js.br +0 -0
- package/dist/PieChart3DScene-3R2ETTGA.js.gz +0 -0
- package/dist/{PieChart3DScene-XXAIVP4I.mjs → PieChart3DScene-O6FFK5L7.mjs} +1 -1
- package/dist/PieChart3DScene-O6FFK5L7.mjs.br +0 -0
- package/dist/PieChart3DScene-O6FFK5L7.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-CRUGJSCY.mjs → SurfaceChart3DScene-OCR26R5D.mjs} +1 -1
- package/dist/SurfaceChart3DScene-OCR26R5D.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-OCR26R5D.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-UBQV3ZN2.js → SurfaceChart3DScene-TGFAOLHL.js} +2 -2
- package/dist/SurfaceChart3DScene-TGFAOLHL.js.br +0 -0
- package/dist/SurfaceChart3DScene-TGFAOLHL.js.gz +0 -0
- package/dist/{chunk-QOLYY7E3.mjs → chunk-2FTJAMFA.mjs} +300 -66
- package/dist/chunk-2FTJAMFA.mjs.br +0 -0
- package/dist/chunk-2FTJAMFA.mjs.gz +0 -0
- package/dist/{chunk-P3VXXUZM.mjs → chunk-3B5FRKYU.mjs} +137 -438
- package/dist/chunk-3B5FRKYU.mjs.br +0 -0
- package/dist/chunk-3B5FRKYU.mjs.gz +0 -0
- package/dist/{chunk-SWRY3SI5.js → chunk-3P7FYHJH.js} +47 -1
- package/dist/chunk-3P7FYHJH.js.br +0 -0
- package/dist/chunk-3P7FYHJH.js.gz +0 -0
- package/dist/{chunk-T2QG2HD5.js → chunk-44CQ67GQ.js} +173 -262
- package/dist/chunk-44CQ67GQ.js.br +0 -0
- package/dist/chunk-44CQ67GQ.js.gz +0 -0
- package/dist/{chunk-ARJE3V6V.mjs → chunk-AMRT3AE4.mjs} +47 -1
- package/dist/chunk-AMRT3AE4.mjs.br +0 -0
- package/dist/chunk-AMRT3AE4.mjs.gz +0 -0
- package/dist/{chunk-XIHK52SB.mjs → chunk-DM2IZCSD.mjs} +8499 -3404
- package/dist/chunk-DM2IZCSD.mjs.br +0 -0
- package/dist/chunk-DM2IZCSD.mjs.gz +0 -0
- package/dist/{chunk-LGVNUG3G.js → chunk-FSQCEAMG.js} +305 -68
- package/dist/chunk-FSQCEAMG.js.br +0 -0
- package/dist/chunk-FSQCEAMG.js.gz +0 -0
- package/dist/{chunk-LXYDXLKZ.js → chunk-GR6SJJIT.js} +463 -776
- package/dist/chunk-GR6SJJIT.js.br +0 -0
- package/dist/chunk-GR6SJJIT.js.gz +0 -0
- package/dist/{chunk-BPWSJLLG.mjs → chunk-ITN5NYYM.mjs} +10 -98
- package/dist/chunk-ITN5NYYM.mjs.br +0 -0
- package/dist/chunk-ITN5NYYM.mjs.gz +0 -0
- package/dist/{chunk-YDEEINER.js → chunk-K6R2JNCK.js} +8531 -3410
- package/dist/chunk-K6R2JNCK.js.br +0 -0
- package/dist/chunk-K6R2JNCK.js.gz +0 -0
- package/dist/{chunk-A2UAUSJM.mjs → chunk-QEEU4S4Z.mjs} +65 -378
- package/dist/chunk-QEEU4S4Z.mjs.br +0 -0
- package/dist/chunk-QEEU4S4Z.mjs.gz +0 -0
- package/dist/{chunk-ZPF4L6SD.js → chunk-QKSYKQEL.js} +1243 -1544
- package/dist/chunk-QKSYKQEL.js.br +0 -0
- package/dist/chunk-QKSYKQEL.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 +170 -17
- package/dist/index.js +47 -47
- 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 +170 -17
- 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/viewer/index.d.ts +170 -17
- package/dist/viewer/index.js +27 -27
- 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-ITCVRVKP.mjs.br +0 -0
- package/dist/AiChatPanel-ITCVRVKP.mjs.gz +0 -0
- package/dist/AiChatPanel-TO5PHBGW.js.br +0 -0
- package/dist/AiChatPanel-TO5PHBGW.js.gz +0 -0
- package/dist/Area3DChartScene-2UNQ3J3V.js.br +0 -0
- package/dist/Area3DChartScene-2UNQ3J3V.js.gz +0 -0
- package/dist/Area3DChartScene-7PHPDOTG.mjs.br +0 -0
- package/dist/Area3DChartScene-7PHPDOTG.mjs.gz +0 -0
- package/dist/Bar3DChartScene-BLPUHYRZ.mjs.br +0 -0
- package/dist/Bar3DChartScene-BLPUHYRZ.mjs.gz +0 -0
- package/dist/Bar3DChartScene-MC5S3AGT.js.br +0 -0
- package/dist/Bar3DChartScene-MC5S3AGT.js.gz +0 -0
- package/dist/Line3DChartScene-JVVZRIDD.js.br +0 -0
- package/dist/Line3DChartScene-JVVZRIDD.js.gz +0 -0
- package/dist/Line3DChartScene-L5B4YFG3.mjs.br +0 -0
- package/dist/Line3DChartScene-L5B4YFG3.mjs.gz +0 -0
- package/dist/Model3DScene-6TNWS5LV.mjs.br +0 -0
- package/dist/Model3DScene-6TNWS5LV.mjs.gz +0 -0
- package/dist/Model3DScene-LRDNQNKJ.js.br +0 -0
- package/dist/Model3DScene-LRDNQNKJ.js.gz +0 -0
- package/dist/PieChart3DScene-PZWZCXHX.js.br +0 -0
- package/dist/PieChart3DScene-PZWZCXHX.js.gz +0 -0
- package/dist/PieChart3DScene-XXAIVP4I.mjs.br +0 -0
- package/dist/PieChart3DScene-XXAIVP4I.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-CRUGJSCY.mjs.br +0 -1
- package/dist/SurfaceChart3DScene-CRUGJSCY.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-UBQV3ZN2.js.br +0 -0
- package/dist/SurfaceChart3DScene-UBQV3ZN2.js.gz +0 -0
- package/dist/chunk-A2UAUSJM.mjs.br +0 -0
- package/dist/chunk-A2UAUSJM.mjs.gz +0 -0
- package/dist/chunk-ARJE3V6V.mjs.br +0 -0
- package/dist/chunk-ARJE3V6V.mjs.gz +0 -0
- package/dist/chunk-BPWSJLLG.mjs.br +0 -0
- package/dist/chunk-BPWSJLLG.mjs.gz +0 -0
- package/dist/chunk-LGVNUG3G.js.br +0 -0
- package/dist/chunk-LGVNUG3G.js.gz +0 -0
- package/dist/chunk-LXYDXLKZ.js.br +0 -0
- package/dist/chunk-LXYDXLKZ.js.gz +0 -0
- package/dist/chunk-P3VXXUZM.mjs.br +0 -0
- package/dist/chunk-P3VXXUZM.mjs.gz +0 -0
- package/dist/chunk-QOLYY7E3.mjs.br +0 -0
- package/dist/chunk-QOLYY7E3.mjs.gz +0 -0
- package/dist/chunk-SWRY3SI5.js.br +0 -0
- package/dist/chunk-SWRY3SI5.js.gz +0 -0
- package/dist/chunk-T2QG2HD5.js.br +0 -0
- package/dist/chunk-T2QG2HD5.js.gz +0 -0
- package/dist/chunk-XIHK52SB.mjs.br +0 -0
- package/dist/chunk-XIHK52SB.mjs.gz +0 -0
- package/dist/chunk-YDEEINER.js.br +0 -0
- package/dist/chunk-YDEEINER.js.gz +0 -0
- package/dist/chunk-ZPF4L6SD.js.br +0 -0
- package/dist/chunk-ZPF4L6SD.js.gz +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunk44CQ67GQ_js = require('./chunk-44CQ67GQ.js');
|
|
4
|
+
var chunkK6R2JNCK_js = require('./chunk-K6R2JNCK.js');
|
|
5
|
+
var chunk3P7FYHJH_js = require('./chunk-3P7FYHJH.js');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var reactI18next = require('react-i18next');
|
|
8
8
|
|
|
9
9
|
function useVirtualizedSlides({
|
|
10
10
|
totalItems,
|
|
11
11
|
itemHeight,
|
|
12
|
-
overscan =
|
|
12
|
+
overscan = chunkK6R2JNCK_js.DEFAULT_VIRTUAL_OVERSCAN
|
|
13
13
|
}) {
|
|
14
14
|
const scrollContainerRef = react.useRef(null);
|
|
15
15
|
const [scrollTop, setScrollTop] = react.useState(0);
|
|
@@ -39,7 +39,7 @@ function useVirtualizedSlides({
|
|
|
39
39
|
resizeObserver?.disconnect();
|
|
40
40
|
};
|
|
41
41
|
}, []);
|
|
42
|
-
const range =
|
|
42
|
+
const range = chunkK6R2JNCK_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
|
|
43
43
|
const safeItemHeight = Math.max(itemHeight, 1);
|
|
44
44
|
const scrollToIndex = react.useCallback(
|
|
45
45
|
(index, behavior = "smooth") => {
|
|
@@ -80,7 +80,7 @@ function usePresenceTracking({
|
|
|
80
80
|
}) {
|
|
81
81
|
const [remoteUsers, setRemoteUsers] = react.useState([]);
|
|
82
82
|
const projectorRef = react.useRef(null);
|
|
83
|
-
projectorRef.current ??=
|
|
83
|
+
projectorRef.current ??= chunkK6R2JNCK_js.createPresenceProjector();
|
|
84
84
|
const projector = projectorRef.current;
|
|
85
85
|
const lastBroadcastRef = react.useRef(0);
|
|
86
86
|
const pendingBroadcastRef = react.useRef(null);
|
|
@@ -105,7 +105,7 @@ function usePresenceTracking({
|
|
|
105
105
|
awareness.setLocalStateField("presence", state);
|
|
106
106
|
lastBroadcastRef.current = Date.now();
|
|
107
107
|
};
|
|
108
|
-
if (elapsed >=
|
|
108
|
+
if (elapsed >= chunkK6R2JNCK_js.BROADCAST_THROTTLE_MS) {
|
|
109
109
|
if (pendingBroadcastRef.current) {
|
|
110
110
|
clearTimeout(pendingBroadcastRef.current);
|
|
111
111
|
pendingBroadcastRef.current = null;
|
|
@@ -115,7 +115,7 @@ function usePresenceTracking({
|
|
|
115
115
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
116
116
|
pendingBroadcastRef.current = null;
|
|
117
117
|
flush();
|
|
118
|
-
},
|
|
118
|
+
}, chunkK6R2JNCK_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -195,7 +195,7 @@ function useYjsProvider({ config }) {
|
|
|
195
195
|
const departureRef = react.useRef(null);
|
|
196
196
|
const gateRef = react.useRef(null);
|
|
197
197
|
if (!gateRef.current) {
|
|
198
|
-
gateRef.current =
|
|
198
|
+
gateRef.current = chunkK6R2JNCK_js.createSyncGate(() => setSynced(true));
|
|
199
199
|
}
|
|
200
200
|
const teardown = react.useCallback(() => {
|
|
201
201
|
if (timeoutRef.current) {
|
|
@@ -215,7 +215,7 @@ function useYjsProvider({ config }) {
|
|
|
215
215
|
const buildCleanup = react.useCallback(
|
|
216
216
|
(provider, yDoc) => () => {
|
|
217
217
|
announceDeparture();
|
|
218
|
-
|
|
218
|
+
chunkK6R2JNCK_js.clearLocalAwareness(provider.awareness);
|
|
219
219
|
provider.destroy();
|
|
220
220
|
yDoc.destroy();
|
|
221
221
|
setDoc(null);
|
|
@@ -240,9 +240,9 @@ function useYjsProvider({ config }) {
|
|
|
240
240
|
if (config.authToken) {
|
|
241
241
|
opts.password = config.authToken;
|
|
242
242
|
}
|
|
243
|
-
const roomId =
|
|
243
|
+
const roomId = chunkK6R2JNCK_js.validateRoomId(config.roomId);
|
|
244
244
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
245
|
-
departureRef.current =
|
|
245
|
+
departureRef.current = chunkK6R2JNCK_js.createDepartureChannel(roomId, provider.awareness);
|
|
246
246
|
setDoc(yDoc);
|
|
247
247
|
setAwareness(provider.awareness);
|
|
248
248
|
setClientId(provider.awareness.clientID);
|
|
@@ -284,13 +284,13 @@ function useYjsProvider({ config }) {
|
|
|
284
284
|
if (!config) {
|
|
285
285
|
return;
|
|
286
286
|
}
|
|
287
|
-
const roomId =
|
|
288
|
-
const transport = config.transport ??
|
|
287
|
+
const roomId = chunkK6R2JNCK_js.validateRoomId(config.roomId);
|
|
288
|
+
const transport = config.transport ?? chunkK6R2JNCK_js.resolveTransportForServerUrl(config.serverUrl);
|
|
289
289
|
if (transport === "webrtc") {
|
|
290
290
|
await initWebrtc();
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
293
|
+
if (chunkK6R2JNCK_js.isMixedContentBlocked(config.serverUrl)) {
|
|
294
294
|
console.warn(
|
|
295
295
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
296
296
|
);
|
|
@@ -304,7 +304,7 @@ function useYjsProvider({ config }) {
|
|
|
304
304
|
const provider = new WebsocketProvider(config.serverUrl, roomId, yDoc, {
|
|
305
305
|
params: config.authToken ? { token: config.authToken } : void 0
|
|
306
306
|
});
|
|
307
|
-
departureRef.current =
|
|
307
|
+
departureRef.current = chunkK6R2JNCK_js.createDepartureChannel(roomId, provider.awareness);
|
|
308
308
|
let connected = false;
|
|
309
309
|
const handleStatus = (event) => {
|
|
310
310
|
if (event.status === "connected") {
|
|
@@ -344,7 +344,7 @@ function useYjsProvider({ config }) {
|
|
|
344
344
|
provider.off("status", handleStatus);
|
|
345
345
|
provider.off("sync", handleSynced);
|
|
346
346
|
announceDeparture();
|
|
347
|
-
|
|
347
|
+
chunkK6R2JNCK_js.clearLocalAwareness(provider.awareness);
|
|
348
348
|
provider.destroy();
|
|
349
349
|
yDoc.destroy();
|
|
350
350
|
setDoc(null);
|
|
@@ -353,7 +353,7 @@ function useYjsProvider({ config }) {
|
|
|
353
353
|
cleanupRef.current = null;
|
|
354
354
|
setStatus("error");
|
|
355
355
|
}
|
|
356
|
-
},
|
|
356
|
+
}, chunkK6R2JNCK_js.CONNECTION_TIMEOUT_MS);
|
|
357
357
|
}
|
|
358
358
|
setDoc(yDoc);
|
|
359
359
|
setAwareness(provider.awareness);
|
|
@@ -362,7 +362,7 @@ function useYjsProvider({ config }) {
|
|
|
362
362
|
provider.off("status", handleStatus);
|
|
363
363
|
provider.off("sync", handleSynced);
|
|
364
364
|
announceDeparture();
|
|
365
|
-
|
|
365
|
+
chunkK6R2JNCK_js.clearLocalAwareness(provider.awareness);
|
|
366
366
|
provider.destroy();
|
|
367
367
|
yDoc.destroy();
|
|
368
368
|
setDoc(null);
|
|
@@ -388,7 +388,7 @@ function useYjsProvider({ config }) {
|
|
|
388
388
|
]);
|
|
389
389
|
react.useEffect(() => {
|
|
390
390
|
init();
|
|
391
|
-
const disposeTeardown =
|
|
391
|
+
const disposeTeardown = chunkK6R2JNCK_js.registerCollaborationTeardown({
|
|
392
392
|
leave: teardown,
|
|
393
393
|
rejoin: init
|
|
394
394
|
});
|
|
@@ -409,7 +409,7 @@ function useCollaborativeState({
|
|
|
409
409
|
canvasWidth,
|
|
410
410
|
canvasHeight
|
|
411
411
|
}) {
|
|
412
|
-
const userColor =
|
|
412
|
+
const userColor = chunkK6R2JNCK_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
413
413
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
414
414
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
415
415
|
awareness,
|
|
@@ -527,8 +527,8 @@ function useEditorHistory(input) {
|
|
|
527
527
|
width: canvasSize.width,
|
|
528
528
|
height: canvasSize.height,
|
|
529
529
|
activeSlideIndex,
|
|
530
|
-
slides: slides.map(
|
|
531
|
-
templateElementsBySlideId:
|
|
530
|
+
slides: slides.map(chunkK6R2JNCK_js.cloneSlide),
|
|
531
|
+
templateElementsBySlideId: chunkK6R2JNCK_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
532
532
|
...actionLabel ? { actionLabel } : {}
|
|
533
533
|
};
|
|
534
534
|
},
|
|
@@ -541,9 +541,9 @@ function useEditorHistory(input) {
|
|
|
541
541
|
width: snapshot.width,
|
|
542
542
|
height: snapshot.height
|
|
543
543
|
});
|
|
544
|
-
setSlides(snapshot.slides.map(
|
|
544
|
+
setSlides(snapshot.slides.map(chunkK6R2JNCK_js.cloneSlide));
|
|
545
545
|
setTemplateElementsBySlideId(
|
|
546
|
-
|
|
546
|
+
chunkK6R2JNCK_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
547
547
|
);
|
|
548
548
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
549
549
|
setSelectedElementIds([]);
|
|
@@ -582,8 +582,8 @@ function useEditorHistory(input) {
|
|
|
582
582
|
const currentSnapshot = buildHistorySnapshot();
|
|
583
583
|
historyFutureRef.current.push(currentSnapshot);
|
|
584
584
|
isApplyingHistoryRef.current = true;
|
|
585
|
-
const nextSnapshot =
|
|
586
|
-
lastHistorySnapshotRef.current =
|
|
585
|
+
const nextSnapshot = chunk44CQ67GQ_js.cloneHistorySnapshot(previousSnapshot);
|
|
586
|
+
lastHistorySnapshotRef.current = chunk44CQ67GQ_js.cloneHistorySnapshot(nextSnapshot);
|
|
587
587
|
lastHistorySerializedRef.current = serializeDocument(nextSnapshot);
|
|
588
588
|
applyHistorySnapshot(nextSnapshot);
|
|
589
589
|
updateHistoryAvailability();
|
|
@@ -604,8 +604,8 @@ function useEditorHistory(input) {
|
|
|
604
604
|
const currentSnapshot = buildHistorySnapshot();
|
|
605
605
|
historyPastRef.current.push(currentSnapshot);
|
|
606
606
|
isApplyingHistoryRef.current = true;
|
|
607
|
-
const targetSnapshot =
|
|
608
|
-
lastHistorySnapshotRef.current =
|
|
607
|
+
const targetSnapshot = chunk44CQ67GQ_js.cloneHistorySnapshot(nextSnapshot);
|
|
608
|
+
lastHistorySnapshotRef.current = chunk44CQ67GQ_js.cloneHistorySnapshot(targetSnapshot);
|
|
609
609
|
lastHistorySerializedRef.current = serializeDocument(targetSnapshot);
|
|
610
610
|
applyHistorySnapshot(targetSnapshot);
|
|
611
611
|
updateHistoryAvailability();
|
|
@@ -623,7 +623,7 @@ function useEditorHistory(input) {
|
|
|
623
623
|
historyPastRef.current = [];
|
|
624
624
|
historyFutureRef.current = [];
|
|
625
625
|
if (initialSnapshot) {
|
|
626
|
-
const clonedInitial =
|
|
626
|
+
const clonedInitial = chunk44CQ67GQ_js.cloneHistorySnapshot(initialSnapshot);
|
|
627
627
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
628
628
|
lastHistorySerializedRef.current = serializeDocument(clonedInitial);
|
|
629
629
|
} else {
|
|
@@ -671,19 +671,19 @@ function useEditorHistory(input) {
|
|
|
671
671
|
}
|
|
672
672
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
673
673
|
if (!previousSnapshot) {
|
|
674
|
-
lastHistorySnapshotRef.current =
|
|
674
|
+
lastHistorySnapshotRef.current = chunk44CQ67GQ_js.cloneHistorySnapshot(snapshot);
|
|
675
675
|
lastHistorySerializedRef.current = serialized;
|
|
676
676
|
lastCheapHashRef.current = cheapHash;
|
|
677
677
|
updateHistoryAvailability();
|
|
678
678
|
return;
|
|
679
679
|
}
|
|
680
680
|
onDirtyRef.current?.();
|
|
681
|
-
historyPastRef.current.push(
|
|
681
|
+
historyPastRef.current.push(chunk44CQ67GQ_js.cloneHistorySnapshot(previousSnapshot));
|
|
682
682
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
683
683
|
historyPastRef.current.shift();
|
|
684
684
|
}
|
|
685
685
|
historyFutureRef.current = [];
|
|
686
|
-
lastHistorySnapshotRef.current =
|
|
686
|
+
lastHistorySnapshotRef.current = chunk44CQ67GQ_js.cloneHistorySnapshot(snapshot);
|
|
687
687
|
lastHistorySerializedRef.current = serialized;
|
|
688
688
|
lastCheapHashRef.current = cheapHash;
|
|
689
689
|
updateHistoryAvailability();
|
|
@@ -743,9 +743,9 @@ function useZoomViewport({
|
|
|
743
743
|
const canvasStageRef = react.useRef(null);
|
|
744
744
|
const canvasViewportRef = react.useRef(null);
|
|
745
745
|
const renderScaleRef = react.useRef(1);
|
|
746
|
-
const wheelBufferRef = react.useRef(
|
|
746
|
+
const wheelBufferRef = react.useRef(chunkK6R2JNCK_js.createWheelStepBuffer());
|
|
747
747
|
const storeRef = react.useRef(null);
|
|
748
|
-
storeRef.current ??=
|
|
748
|
+
storeRef.current ??= chunkK6R2JNCK_js.createViewerZoomStore();
|
|
749
749
|
const store = storeRef.current;
|
|
750
750
|
const scale = useViewerStore(store, selectZoom);
|
|
751
751
|
const setScale = react.useCallback(
|
|
@@ -806,7 +806,7 @@ function useZoomViewport({
|
|
|
806
806
|
if (!wrapper || !canvasViewport) {
|
|
807
807
|
return;
|
|
808
808
|
}
|
|
809
|
-
const boundedScale =
|
|
809
|
+
const boundedScale = chunkK6R2JNCK_js.clampZoomScale(nextScale);
|
|
810
810
|
const nextEditorScale = fitScale * boundedScale;
|
|
811
811
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
812
812
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -843,29 +843,29 @@ function useZoomViewport({
|
|
|
843
843
|
selectedElements.forEach((element) => {
|
|
844
844
|
minX = Math.min(minX, element.x);
|
|
845
845
|
minY = Math.min(minY, element.y);
|
|
846
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
847
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
846
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE));
|
|
847
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE));
|
|
848
848
|
});
|
|
849
849
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
850
850
|
return;
|
|
851
851
|
}
|
|
852
852
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
853
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
854
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
853
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE);
|
|
854
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE);
|
|
855
855
|
const availableWidth = Math.max(
|
|
856
|
-
effectiveEditorDimensions.width -
|
|
857
|
-
|
|
856
|
+
effectiveEditorDimensions.width - chunk44CQ67GQ_js.ZOOM_TO_SELECTION_PADDING,
|
|
857
|
+
chunk44CQ67GQ_js.MIN_ELEMENT_SIZE
|
|
858
858
|
);
|
|
859
859
|
const availableHeight = Math.max(
|
|
860
|
-
effectiveEditorDimensions.height -
|
|
861
|
-
|
|
860
|
+
effectiveEditorDimensions.height - chunk44CQ67GQ_js.ZOOM_TO_SELECTION_PADDING,
|
|
861
|
+
chunk44CQ67GQ_js.MIN_ELEMENT_SIZE
|
|
862
862
|
);
|
|
863
863
|
const targetEditorScale = Math.min(
|
|
864
864
|
availableWidth / boundsWidth,
|
|
865
865
|
availableHeight / boundsHeight
|
|
866
866
|
);
|
|
867
867
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
868
|
-
const nextScale =
|
|
868
|
+
const nextScale = chunkK6R2JNCK_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
869
869
|
setScale(nextScale);
|
|
870
870
|
window.requestAnimationFrame(() => {
|
|
871
871
|
window.requestAnimationFrame(() => {
|
|
@@ -882,14 +882,14 @@ function useZoomViewport({
|
|
|
882
882
|
]);
|
|
883
883
|
const handleWheel = react.useCallback(
|
|
884
884
|
(event) => {
|
|
885
|
-
const mapped =
|
|
885
|
+
const mapped = chunkK6R2JNCK_js.mapEditingWheel(event, wheelBufferRef.current, true);
|
|
886
886
|
if (mapped.intent !== "zoom") {
|
|
887
887
|
return;
|
|
888
888
|
}
|
|
889
889
|
event.preventDefault();
|
|
890
890
|
store.dispatch({
|
|
891
891
|
type: "set-zoom",
|
|
892
|
-
zoom:
|
|
892
|
+
zoom: chunkK6R2JNCK_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
|
|
893
893
|
});
|
|
894
894
|
},
|
|
895
895
|
[store]
|
|
@@ -971,67 +971,6 @@ function stopAnimationSound() {
|
|
|
971
971
|
}
|
|
972
972
|
|
|
973
973
|
// src/viewer/hooks/presentation-mode/animation-helpers.ts
|
|
974
|
-
function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationElementStates, presentationTimersRef) {
|
|
975
|
-
for (const step of group.steps) {
|
|
976
|
-
if (step.command) {
|
|
977
|
-
const command = step.command;
|
|
978
|
-
const timer = window.setTimeout(
|
|
979
|
-
() => {
|
|
980
|
-
chunkT2QG2HD5_js.executeMediaCommand(command);
|
|
981
|
-
},
|
|
982
|
-
Math.max(0, step.delayMs)
|
|
983
|
-
);
|
|
984
|
-
presentationTimersRef.current.push(timer);
|
|
985
|
-
continue;
|
|
986
|
-
}
|
|
987
|
-
if (step.stopSound) {
|
|
988
|
-
stopAnimationSound();
|
|
989
|
-
} else if (step.soundPath && onPlayActionSound) {
|
|
990
|
-
onPlayActionSound(step.soundPath);
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
setPresentationElementStates((previousStates) => {
|
|
994
|
-
const nextStates = new Map(previousStates);
|
|
995
|
-
for (const step of group.steps) {
|
|
996
|
-
if (step.command) {
|
|
997
|
-
continue;
|
|
998
|
-
}
|
|
999
|
-
const currentState = nextStates.get(step.elementId) ?? {
|
|
1000
|
-
visible: true};
|
|
1001
|
-
const shouldBeVisible = step.presetClass === "exit" ? currentState.visible : true;
|
|
1002
|
-
const colorTargets = step.colorTargets;
|
|
1003
|
-
nextStates.set(step.elementId, {
|
|
1004
|
-
visible: shouldBeVisible,
|
|
1005
|
-
cssAnimation: step.cssAnimation,
|
|
1006
|
-
animatesFill: colorTargets?.includes("fill") ? true : void 0,
|
|
1007
|
-
animatesStroke: colorTargets?.includes("stroke") ? true : void 0
|
|
1008
|
-
});
|
|
1009
|
-
}
|
|
1010
|
-
return nextStates;
|
|
1011
|
-
});
|
|
1012
|
-
for (const step of group.steps) {
|
|
1013
|
-
if (step.command) {
|
|
1014
|
-
continue;
|
|
1015
|
-
}
|
|
1016
|
-
const timer = window.setTimeout(
|
|
1017
|
-
() => {
|
|
1018
|
-
setPresentationElementStates((previousStates) => {
|
|
1019
|
-
const nextStates = new Map(previousStates);
|
|
1020
|
-
const currentState = nextStates.get(step.elementId) ?? {
|
|
1021
|
-
visible: true};
|
|
1022
|
-
const visibleAfterStep = step.presetClass === "exit" || step.hideAfterEffect ? false : currentState.visible;
|
|
1023
|
-
nextStates.set(step.elementId, {
|
|
1024
|
-
visible: visibleAfterStep,
|
|
1025
|
-
cssAnimation: step.holdEndState ? step.cssAnimation : void 0
|
|
1026
|
-
});
|
|
1027
|
-
return nextStates;
|
|
1028
|
-
});
|
|
1029
|
-
},
|
|
1030
|
-
Math.max(0, step.delayMs + step.durationMs + 8)
|
|
1031
|
-
);
|
|
1032
|
-
presentationTimersRef.current.push(timer);
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
974
|
function shouldSeekAnimationGroup(group, endAtMs, nowMs) {
|
|
1036
975
|
return group?.seqNextAction === "seek" && nowMs < endAtMs;
|
|
1037
976
|
}
|
|
@@ -1104,49 +1043,8 @@ function finishAnimationGroupSteps(group, setPresentationElementStates, complete
|
|
|
1104
1043
|
});
|
|
1105
1044
|
}
|
|
1106
1045
|
|
|
1107
|
-
// src/viewer/hooks/presentation-mode/build-playback.ts
|
|
1108
|
-
function cancelBuildReveal(handle) {
|
|
1109
|
-
if (handle.current !== null) {
|
|
1110
|
-
cancelAnimationFrame(handle.current);
|
|
1111
|
-
handle.current = null;
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
function driveBuildReveal(controller, buildIds, setStates, handle) {
|
|
1115
|
-
cancelBuildReveal(handle);
|
|
1116
|
-
if (buildIds.length === 0 || typeof requestAnimationFrame !== "function") {
|
|
1117
|
-
return;
|
|
1118
|
-
}
|
|
1119
|
-
const start = performance.now();
|
|
1120
|
-
const tick = () => {
|
|
1121
|
-
const elapsedMs = performance.now() - start;
|
|
1122
|
-
const states = controller.computeStatesFor(buildIds, { elapsedMs });
|
|
1123
|
-
setStates((prev) => {
|
|
1124
|
-
const next = new Map(prev);
|
|
1125
|
-
for (const id of buildIds) {
|
|
1126
|
-
const build = states.get(id)?.build;
|
|
1127
|
-
if (!build) {
|
|
1128
|
-
continue;
|
|
1129
|
-
}
|
|
1130
|
-
const existing = next.get(id) ?? { visible: true, cssAnimation: void 0 };
|
|
1131
|
-
next.set(id, { ...existing, build });
|
|
1132
|
-
}
|
|
1133
|
-
return next;
|
|
1134
|
-
});
|
|
1135
|
-
let pending = false;
|
|
1136
|
-
for (const id of buildIds) {
|
|
1137
|
-
const build = states.get(id)?.build;
|
|
1138
|
-
if (build && build.progress < 1) {
|
|
1139
|
-
pending = true;
|
|
1140
|
-
break;
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
handle.current = pending ? requestAnimationFrame(tick) : null;
|
|
1144
|
-
};
|
|
1145
|
-
tick();
|
|
1146
|
-
}
|
|
1147
|
-
|
|
1148
1046
|
// src/viewer/hooks/presentation-mode/entrance-animation-timers.ts
|
|
1149
|
-
function scheduleOpeningAutoPlayGroup(controller,
|
|
1047
|
+
function scheduleOpeningAutoPlayGroup(controller, ctx) {
|
|
1150
1048
|
if (!controller.hasMoreSteps()) {
|
|
1151
1049
|
return;
|
|
1152
1050
|
}
|
|
@@ -1159,17 +1057,10 @@ function scheduleOpeningAutoPlayGroup(controller, deps) {
|
|
|
1159
1057
|
if (!group) {
|
|
1160
1058
|
return;
|
|
1161
1059
|
}
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
deps.onPlayActionSound,
|
|
1165
|
-
deps.setPresentationElementStates,
|
|
1166
|
-
deps.presentationTimersRef
|
|
1167
|
-
);
|
|
1168
|
-
deps.markAnimationGroupActive(group);
|
|
1169
|
-
deps.startBuildReveal(controller, group);
|
|
1170
|
-
deps.scheduleAutoAdvanceChain(controller);
|
|
1060
|
+
chunkK6R2JNCK_js.playGroup(controller, group, ctx);
|
|
1061
|
+
chunkK6R2JNCK_js.scheduleAutoAdvanceChain(controller, ctx);
|
|
1171
1062
|
}, firstGroup.autoAdvanceDelayMs ?? 0);
|
|
1172
|
-
|
|
1063
|
+
ctx.timers.push(timer);
|
|
1173
1064
|
}
|
|
1174
1065
|
function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, presentationTimersRef) {
|
|
1175
1066
|
const entranceAnimations = [...slide.animations || []].filter((animation) => Boolean(animation.entrance)).sort(
|
|
@@ -1186,7 +1077,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1186
1077
|
}))
|
|
1187
1078
|
);
|
|
1188
1079
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1189
|
-
const delay =
|
|
1080
|
+
const delay = chunkK6R2JNCK_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1190
1081
|
const timer = window.setTimeout(() => {
|
|
1191
1082
|
setPresentationAnimations(
|
|
1192
1083
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1216,20 +1107,19 @@ function useAnimationPlayback(input) {
|
|
|
1216
1107
|
const activeAnimationEndAtRef = react.useRef(0);
|
|
1217
1108
|
const seededCompletedRef = react.useRef(false);
|
|
1218
1109
|
const lastSeedCompletedRef = react.useRef(false);
|
|
1219
|
-
const
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
}
|
|
1228
|
-
|
|
1229
|
-
);
|
|
1110
|
+
const buildPlaybackContext = react.useCallback(() => {
|
|
1111
|
+
return {
|
|
1112
|
+
setStates: setPresentationElementStates,
|
|
1113
|
+
timers: presentationTimersRef.current,
|
|
1114
|
+
buildHandle: buildRafRef,
|
|
1115
|
+
onPlayActionSound,
|
|
1116
|
+
playSound: playAnimationSound,
|
|
1117
|
+
stopSound: stopAnimationSound
|
|
1118
|
+
};
|
|
1119
|
+
}, [onPlayActionSound]);
|
|
1230
1120
|
react.useEffect(() => {
|
|
1231
1121
|
return () => {
|
|
1232
|
-
cancelBuildReveal(buildRafRef);
|
|
1122
|
+
chunkK6R2JNCK_js.cancelBuildReveal(buildRafRef);
|
|
1233
1123
|
};
|
|
1234
1124
|
}, []);
|
|
1235
1125
|
const clearPresentationTimers = react.useCallback(() => {
|
|
@@ -1237,7 +1127,7 @@ function useAnimationPlayback(input) {
|
|
|
1237
1127
|
window.clearTimeout(timer);
|
|
1238
1128
|
});
|
|
1239
1129
|
presentationTimersRef.current = [];
|
|
1240
|
-
cancelBuildReveal(buildRafRef);
|
|
1130
|
+
chunkK6R2JNCK_js.cancelBuildReveal(buildRafRef);
|
|
1241
1131
|
activeAnimationGroupRef.current = null;
|
|
1242
1132
|
activeAnimationEndAtRef.current = 0;
|
|
1243
1133
|
}, []);
|
|
@@ -1245,48 +1135,9 @@ function useAnimationPlayback(input) {
|
|
|
1245
1135
|
activeAnimationGroupRef.current = group;
|
|
1246
1136
|
activeAnimationEndAtRef.current = performance.now() + Math.max(0, group.totalDurationMs);
|
|
1247
1137
|
}, []);
|
|
1248
|
-
const scheduleAutoAdvanceChain = react.useCallback(
|
|
1249
|
-
(controller) => {
|
|
1250
|
-
if (!controller.shouldAutoAdvance()) {
|
|
1251
|
-
return;
|
|
1252
|
-
}
|
|
1253
|
-
const delay = controller.getAutoAdvanceDelay();
|
|
1254
|
-
const previousGroup = controller.peekNext();
|
|
1255
|
-
if (!previousGroup) {
|
|
1256
|
-
return;
|
|
1257
|
-
}
|
|
1258
|
-
const totalDelay = delay + (previousGroup.autoAdvanceDelayMs ?? 0);
|
|
1259
|
-
const timer = window.setTimeout(
|
|
1260
|
-
() => {
|
|
1261
|
-
const group = controller.advance();
|
|
1262
|
-
if (!group) {
|
|
1263
|
-
return;
|
|
1264
|
-
}
|
|
1265
|
-
applyAnimationGroupSteps(
|
|
1266
|
-
group,
|
|
1267
|
-
onPlayActionSound,
|
|
1268
|
-
setPresentationElementStates,
|
|
1269
|
-
presentationTimersRef
|
|
1270
|
-
);
|
|
1271
|
-
markAnimationGroupActive(group);
|
|
1272
|
-
startBuildReveal(controller, group);
|
|
1273
|
-
scheduleAutoAdvanceChain(controller);
|
|
1274
|
-
},
|
|
1275
|
-
Math.max(0, totalDelay)
|
|
1276
|
-
);
|
|
1277
|
-
presentationTimersRef.current.push(timer);
|
|
1278
|
-
},
|
|
1279
|
-
// `scheduleAutoAdvanceChain` recursively calls itself (line 190) to walk the
|
|
1280
|
-
// auto-advance chain; it can't list itself as its own dependency (the const
|
|
1281
|
-
// isn't assigned yet when the array is evaluated). The recursive call still
|
|
1282
|
-
// resolves correctly because the setTimeout callback only reads the binding
|
|
1283
|
-
// once the outer const has been assigned.
|
|
1284
|
-
// oxlint-disable-next-line react/memo-dependencies -- see comment above
|
|
1285
|
-
[markAnimationGroupActive, onPlayActionSound, startBuildReveal]
|
|
1286
|
-
);
|
|
1287
1138
|
const resetSlideTimeline = react.useCallback(
|
|
1288
1139
|
(slideIndex) => {
|
|
1289
|
-
cancelBuildReveal(buildRafRef);
|
|
1140
|
+
chunkK6R2JNCK_js.cancelBuildReveal(buildRafRef);
|
|
1290
1141
|
const slide = slides[slideIndex];
|
|
1291
1142
|
if (!slide) {
|
|
1292
1143
|
controllerRef.current = null;
|
|
@@ -1296,7 +1147,7 @@ function useAnimationPlayback(input) {
|
|
|
1296
1147
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1297
1148
|
return;
|
|
1298
1149
|
}
|
|
1299
|
-
const controller =
|
|
1150
|
+
const controller = chunkK6R2JNCK_js.PresentationAnimationController.fromSlide(slide);
|
|
1300
1151
|
controllerRef.current = controller;
|
|
1301
1152
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1302
1153
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1313,11 +1164,11 @@ function useAnimationPlayback(input) {
|
|
|
1313
1164
|
const activeGroup = activeAnimationGroupRef.current;
|
|
1314
1165
|
if (controller && controller.hasMoreSteps() && shouldSeekAnimationGroup(activeGroup, activeAnimationEndAtRef.current, performance.now())) {
|
|
1315
1166
|
finishDomAnimationsForGroup(activeGroup);
|
|
1316
|
-
const buildIds =
|
|
1167
|
+
const buildIds = chunkK6R2JNCK_js.PresentationAnimationController.collectBuildStepIds(activeGroup);
|
|
1317
1168
|
const completedStates = controller.computeStatesFor(buildIds);
|
|
1318
1169
|
clearPresentationTimers();
|
|
1319
1170
|
finishAnimationGroupSteps(activeGroup, setPresentationElementStates, completedStates);
|
|
1320
|
-
scheduleAutoAdvanceChain(controller);
|
|
1171
|
+
chunkK6R2JNCK_js.scheduleAutoAdvanceChain(controller, buildPlaybackContext());
|
|
1321
1172
|
return true;
|
|
1322
1173
|
}
|
|
1323
1174
|
if (!controller || !controller.hasMoreSteps()) {
|
|
@@ -1327,24 +1178,12 @@ function useAnimationPlayback(input) {
|
|
|
1327
1178
|
if (!group) {
|
|
1328
1179
|
return false;
|
|
1329
1180
|
}
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
onPlayActionSound,
|
|
1333
|
-
setPresentationElementStates,
|
|
1334
|
-
presentationTimersRef
|
|
1335
|
-
);
|
|
1181
|
+
const ctx = buildPlaybackContext();
|
|
1182
|
+
chunkK6R2JNCK_js.playGroup(controller, group, ctx);
|
|
1336
1183
|
markAnimationGroupActive(group);
|
|
1337
|
-
|
|
1338
|
-
scheduleAutoAdvanceChain(controller);
|
|
1184
|
+
chunkK6R2JNCK_js.scheduleAutoAdvanceChain(controller, ctx);
|
|
1339
1185
|
return true;
|
|
1340
|
-
}, [
|
|
1341
|
-
animationsEnabled,
|
|
1342
|
-
clearPresentationTimers,
|
|
1343
|
-
markAnimationGroupActive,
|
|
1344
|
-
onPlayActionSound,
|
|
1345
|
-
scheduleAutoAdvanceChain,
|
|
1346
|
-
startBuildReveal
|
|
1347
|
-
]);
|
|
1186
|
+
}, [animationsEnabled, buildPlaybackContext, clearPresentationTimers, markAnimationGroupActive]);
|
|
1348
1187
|
const handleInteractiveShapeClick = react.useCallback(
|
|
1349
1188
|
(shapeId) => {
|
|
1350
1189
|
const controller = controllerRef.current;
|
|
@@ -1355,16 +1194,10 @@ function useAnimationPlayback(input) {
|
|
|
1355
1194
|
if (!group) {
|
|
1356
1195
|
return false;
|
|
1357
1196
|
}
|
|
1358
|
-
|
|
1359
|
-
group,
|
|
1360
|
-
onPlayActionSound,
|
|
1361
|
-
setPresentationElementStates,
|
|
1362
|
-
presentationTimersRef
|
|
1363
|
-
);
|
|
1364
|
-
startBuildReveal(controller, group);
|
|
1197
|
+
chunkK6R2JNCK_js.playGroup(controller, group, buildPlaybackContext());
|
|
1365
1198
|
return true;
|
|
1366
1199
|
},
|
|
1367
|
-
[
|
|
1200
|
+
[buildPlaybackContext]
|
|
1368
1201
|
);
|
|
1369
1202
|
const handleHoverStart = react.useCallback(
|
|
1370
1203
|
(shapeId) => {
|
|
@@ -1380,16 +1213,10 @@ function useAnimationPlayback(input) {
|
|
|
1380
1213
|
if (!group) {
|
|
1381
1214
|
return false;
|
|
1382
1215
|
}
|
|
1383
|
-
|
|
1384
|
-
group,
|
|
1385
|
-
onPlayActionSound,
|
|
1386
|
-
setPresentationElementStates,
|
|
1387
|
-
presentationTimersRef
|
|
1388
|
-
);
|
|
1389
|
-
startBuildReveal(controller, group);
|
|
1216
|
+
chunkK6R2JNCK_js.playGroup(controller, group, buildPlaybackContext());
|
|
1390
1217
|
return true;
|
|
1391
1218
|
},
|
|
1392
|
-
[animationsEnabled,
|
|
1219
|
+
[animationsEnabled, buildPlaybackContext]
|
|
1393
1220
|
);
|
|
1394
1221
|
const handleHoverEnd = react.useCallback((shapeId) => {
|
|
1395
1222
|
const controller = controllerRef.current;
|
|
@@ -1435,25 +1262,12 @@ function useAnimationPlayback(input) {
|
|
|
1435
1262
|
}
|
|
1436
1263
|
const controller = controllerRef.current;
|
|
1437
1264
|
if (controller) {
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
setPresentationElementStates,
|
|
1441
|
-
presentationTimersRef,
|
|
1442
|
-
startBuildReveal,
|
|
1443
|
-
scheduleAutoAdvanceChain,
|
|
1444
|
-
markAnimationGroupActive
|
|
1445
|
-
});
|
|
1265
|
+
const ctx = buildPlaybackContext();
|
|
1266
|
+
scheduleOpeningAutoPlayGroup(controller, ctx);
|
|
1446
1267
|
}
|
|
1447
1268
|
scheduleEntranceAnimationTimers(slide, setPresentationAnimations, presentationTimersRef);
|
|
1448
1269
|
},
|
|
1449
|
-
[
|
|
1450
|
-
animationsEnabled,
|
|
1451
|
-
slides,
|
|
1452
|
-
onPlayActionSound,
|
|
1453
|
-
markAnimationGroupActive,
|
|
1454
|
-
scheduleAutoAdvanceChain,
|
|
1455
|
-
startBuildReveal
|
|
1456
|
-
]
|
|
1270
|
+
[animationsEnabled, slides, buildPlaybackContext]
|
|
1457
1271
|
);
|
|
1458
1272
|
const runPresentationEntranceAnimations = react.useCallback(
|
|
1459
1273
|
(slideIndex, options) => {
|
|
@@ -1480,12 +1294,12 @@ function useAnimationPlayback(input) {
|
|
|
1480
1294
|
presentationTimersRef
|
|
1481
1295
|
};
|
|
1482
1296
|
}
|
|
1483
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1484
|
-
var AUDIENCE_HASH =
|
|
1485
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1486
|
-
var AUDIENCE_NONCE_KEY =
|
|
1297
|
+
var PRESENTER_CHANNEL_NAME = chunkK6R2JNCK_js.PRESENTATION_CHANNEL_NAME;
|
|
1298
|
+
var AUDIENCE_HASH = chunkK6R2JNCK_js.PRESENTATION_HASH;
|
|
1299
|
+
var PRESENTER_MSG_ORIGIN = chunkK6R2JNCK_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1300
|
+
var AUDIENCE_NONCE_KEY = chunkK6R2JNCK_js.PRESENTATION_NONCE_KEY;
|
|
1487
1301
|
function generateSessionId() {
|
|
1488
|
-
return
|
|
1302
|
+
return chunkK6R2JNCK_js.createPresentationSessionId();
|
|
1489
1303
|
}
|
|
1490
1304
|
function parseAudienceNonce() {
|
|
1491
1305
|
const hash = window.location.hash;
|
|
@@ -1521,7 +1335,7 @@ function usePresenterWindow(input) {
|
|
|
1521
1335
|
}, []);
|
|
1522
1336
|
const swapDisplays = react.useCallback(async () => {
|
|
1523
1337
|
const audience = audienceWindowRef.current;
|
|
1524
|
-
return audience && !audience.closed ?
|
|
1338
|
+
return audience && !audience.closed ? chunkK6R2JNCK_js.swapPresentationWindows(window, audience) : false;
|
|
1525
1339
|
}, []);
|
|
1526
1340
|
const syncSlideToAudience = react.useCallback(
|
|
1527
1341
|
(slideIndex) => {
|
|
@@ -1585,7 +1399,7 @@ function usePresenterWindow(input) {
|
|
|
1585
1399
|
pollTimerRef.current = null;
|
|
1586
1400
|
}
|
|
1587
1401
|
if (closingSessionId) {
|
|
1588
|
-
void
|
|
1402
|
+
void chunkK6R2JNCK_js.clearAudienceContent(closingSessionId);
|
|
1589
1403
|
}
|
|
1590
1404
|
}, [getChannel]);
|
|
1591
1405
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1603,10 +1417,10 @@ function usePresenterWindow(input) {
|
|
|
1603
1417
|
audienceWindowRef.current = blankWin;
|
|
1604
1418
|
const sessionId = generateSessionId();
|
|
1605
1419
|
sessionIdRef.current = sessionId;
|
|
1606
|
-
const audienceUrl =
|
|
1607
|
-
void
|
|
1420
|
+
const audienceUrl = chunkK6R2JNCK_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1421
|
+
void chunkK6R2JNCK_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1608
1422
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1609
|
-
|
|
1423
|
+
chunkK6R2JNCK_js.placeAudienceWindow(blankWin, placement);
|
|
1610
1424
|
}
|
|
1611
1425
|
return void 0;
|
|
1612
1426
|
});
|
|
@@ -1636,7 +1450,7 @@ function usePresenterWindow(input) {
|
|
|
1636
1450
|
}
|
|
1637
1451
|
};
|
|
1638
1452
|
if (content) {
|
|
1639
|
-
void
|
|
1453
|
+
void chunkK6R2JNCK_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1640
1454
|
} else {
|
|
1641
1455
|
navigateOrClose(true);
|
|
1642
1456
|
}
|
|
@@ -1662,7 +1476,7 @@ function usePresenterWindow(input) {
|
|
|
1662
1476
|
}
|
|
1663
1477
|
const handleMessage = (event) => {
|
|
1664
1478
|
const message = event.data;
|
|
1665
|
-
if (
|
|
1479
|
+
if (chunkK6R2JNCK_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1666
1480
|
syncStateToAudience(snapshotRef.current);
|
|
1667
1481
|
}
|
|
1668
1482
|
};
|
|
@@ -1691,7 +1505,7 @@ function usePresenterWindow(input) {
|
|
|
1691
1505
|
react.useEffect(() => {
|
|
1692
1506
|
const handleBeforeUnload = () => {
|
|
1693
1507
|
if (sessionIdRef.current) {
|
|
1694
|
-
void
|
|
1508
|
+
void chunkK6R2JNCK_js.clearAudienceContent(sessionIdRef.current);
|
|
1695
1509
|
}
|
|
1696
1510
|
};
|
|
1697
1511
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1753,7 +1567,7 @@ function useAudienceMode(input) {
|
|
|
1753
1567
|
}
|
|
1754
1568
|
channel.onmessage = (event) => {
|
|
1755
1569
|
const data = event.data;
|
|
1756
|
-
if (!
|
|
1570
|
+
if (!chunkK6R2JNCK_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1757
1571
|
return;
|
|
1758
1572
|
}
|
|
1759
1573
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1769,16 +1583,16 @@ function useAudienceMode(input) {
|
|
|
1769
1583
|
}
|
|
1770
1584
|
if (data.type === "presenter-exit") {
|
|
1771
1585
|
if (expectedSessionId) {
|
|
1772
|
-
void
|
|
1586
|
+
void chunkK6R2JNCK_js.clearAudienceContent(expectedSessionId);
|
|
1773
1587
|
}
|
|
1774
|
-
if (
|
|
1588
|
+
if (chunkK6R2JNCK_js.endAudienceDisplay(window)) {
|
|
1775
1589
|
handlers.onPresenterEnded?.();
|
|
1776
1590
|
}
|
|
1777
1591
|
}
|
|
1778
1592
|
};
|
|
1779
1593
|
if (expectedSessionId) {
|
|
1780
1594
|
channel.postMessage({
|
|
1781
|
-
origin:
|
|
1595
|
+
origin: chunkK6R2JNCK_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1782
1596
|
type: "audience-ready",
|
|
1783
1597
|
sessionId: expectedSessionId
|
|
1784
1598
|
});
|
|
@@ -1792,7 +1606,7 @@ function useAudienceMode(input) {
|
|
|
1792
1606
|
}, []);
|
|
1793
1607
|
}
|
|
1794
1608
|
function usePresentationKeyboard(input) {
|
|
1795
|
-
const wheelBufferRef = react.useRef(
|
|
1609
|
+
const wheelBufferRef = react.useRef(chunkK6R2JNCK_js.createWheelStepBuffer());
|
|
1796
1610
|
const {
|
|
1797
1611
|
mode,
|
|
1798
1612
|
movePresentationSlide,
|
|
@@ -1813,14 +1627,14 @@ function usePresentationKeyboard(input) {
|
|
|
1813
1627
|
presentationSlideIndex,
|
|
1814
1628
|
setShowRehearsalSummary
|
|
1815
1629
|
} = input;
|
|
1816
|
-
const keyBufferRef = react.useRef(
|
|
1630
|
+
const keyBufferRef = react.useRef(chunkK6R2JNCK_js.createPresentationKeyBuffer());
|
|
1817
1631
|
react.useEffect(() => {
|
|
1818
|
-
if (mode !== "present" || !
|
|
1819
|
-
keyBufferRef.current =
|
|
1632
|
+
if (mode !== "present" || !chunkK6R2JNCK_js.acceptsPresentationInput()) {
|
|
1633
|
+
keyBufferRef.current = chunkK6R2JNCK_js.createPresentationKeyBuffer();
|
|
1820
1634
|
return;
|
|
1821
1635
|
}
|
|
1822
1636
|
const handleKeyDown = (event) => {
|
|
1823
|
-
const mapped =
|
|
1637
|
+
const mapped = chunkK6R2JNCK_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1824
1638
|
if (mapped.action === "none") {
|
|
1825
1639
|
return;
|
|
1826
1640
|
}
|
|
@@ -1840,12 +1654,12 @@ function usePresentationKeyboard(input) {
|
|
|
1840
1654
|
movePresentationSlide(-1);
|
|
1841
1655
|
return;
|
|
1842
1656
|
case "first": {
|
|
1843
|
-
const first =
|
|
1657
|
+
const first = chunkK6R2JNCK_js.firstShowSlideIndex(showSlideIndexes);
|
|
1844
1658
|
navigateToSlide(first ?? 0);
|
|
1845
1659
|
return;
|
|
1846
1660
|
}
|
|
1847
1661
|
case "last": {
|
|
1848
|
-
const last =
|
|
1662
|
+
const last = chunkK6R2JNCK_js.lastShowSlideIndex(showSlideIndexes);
|
|
1849
1663
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1850
1664
|
return;
|
|
1851
1665
|
}
|
|
@@ -1883,10 +1697,10 @@ function usePresentationKeyboard(input) {
|
|
|
1883
1697
|
}
|
|
1884
1698
|
};
|
|
1885
1699
|
const handleWheel = (event) => {
|
|
1886
|
-
if (mode !== "present" || !
|
|
1700
|
+
if (mode !== "present" || !chunkK6R2JNCK_js.acceptsPresentationInput()) {
|
|
1887
1701
|
return;
|
|
1888
1702
|
}
|
|
1889
|
-
const mapped =
|
|
1703
|
+
const mapped = chunkK6R2JNCK_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1890
1704
|
if (mapped.intent === "next-slide") {
|
|
1891
1705
|
event.preventDefault();
|
|
1892
1706
|
movePresentationSlide(1);
|
|
@@ -2019,7 +1833,7 @@ function useRehearsalTimings(input) {
|
|
|
2019
1833
|
|
|
2020
1834
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
2021
1835
|
function handlePresentationActionImpl(action, deps) {
|
|
2022
|
-
|
|
1836
|
+
chunkK6R2JNCK_js.runPresentationAction(
|
|
2023
1837
|
action,
|
|
2024
1838
|
{ slideCount: deps.slidesLength },
|
|
2025
1839
|
{
|
|
@@ -2041,7 +1855,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
2041
1855
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
2042
1856
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
2043
1857
|
const transition = incomingSlide?.transition;
|
|
2044
|
-
const durationMs = deps.playTransition ?
|
|
1858
|
+
const durationMs = deps.playTransition ? chunkK6R2JNCK_js.resolveTransitionDurationMs(transition) : 0;
|
|
2045
1859
|
deps.clearPresentationTimers();
|
|
2046
1860
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
2047
1861
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -2100,7 +1914,7 @@ function useSlideNavigation(input) {
|
|
|
2100
1914
|
});
|
|
2101
1915
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
2102
1916
|
(slideIndex) => {
|
|
2103
|
-
const delayMs =
|
|
1917
|
+
const delayMs = chunkK6R2JNCK_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
2104
1918
|
if (delayMs === void 0) {
|
|
2105
1919
|
return;
|
|
2106
1920
|
}
|
|
@@ -2123,7 +1937,7 @@ function useSlideNavigation(input) {
|
|
|
2123
1937
|
if (availableSlideIndexes.length === 0) {
|
|
2124
1938
|
return;
|
|
2125
1939
|
}
|
|
2126
|
-
const pastLastSlide = direction === 1 && !
|
|
1940
|
+
const pastLastSlide = direction === 1 && !chunkK6R2JNCK_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
2127
1941
|
if (rehearsing && pastLastSlide) {
|
|
2128
1942
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
2129
1943
|
try {
|
|
@@ -2141,9 +1955,9 @@ function useSlideNavigation(input) {
|
|
|
2141
1955
|
onAdvancePastLastSlide();
|
|
2142
1956
|
return;
|
|
2143
1957
|
}
|
|
2144
|
-
const nextSlideIndex = direction === 1 ?
|
|
1958
|
+
const nextSlideIndex = direction === 1 ? chunkK6R2JNCK_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
2145
1959
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
2146
|
-
}) :
|
|
1960
|
+
}) : chunkK6R2JNCK_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
2147
1961
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
2148
1962
|
return;
|
|
2149
1963
|
}
|
|
@@ -2288,22 +2102,22 @@ function useZoomNavigation(input) {
|
|
|
2288
2102
|
};
|
|
2289
2103
|
}
|
|
2290
2104
|
function usePresenterConsole(slideIndex, active) {
|
|
2291
|
-
const timerRef = react.useRef(
|
|
2292
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2105
|
+
const timerRef = react.useRef(chunkK6R2JNCK_js.createPresenterTimer());
|
|
2106
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkK6R2JNCK_js.createInitialPresentationSnapshot(slideIndex));
|
|
2293
2107
|
const patch = react.useCallback((value) => {
|
|
2294
|
-
setSnapshot((current) =>
|
|
2108
|
+
setSnapshot((current) => chunkK6R2JNCK_js.mergePresentationSnapshot(current, value));
|
|
2295
2109
|
}, []);
|
|
2296
2110
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2297
2111
|
react.useEffect(() => {
|
|
2298
2112
|
if (!active) {
|
|
2299
2113
|
return;
|
|
2300
2114
|
}
|
|
2301
|
-
timerRef.current =
|
|
2115
|
+
timerRef.current = chunkK6R2JNCK_js.resetPresenterTimer();
|
|
2302
2116
|
patch({ paused: false, elapsedMs: 0 });
|
|
2303
2117
|
const timer = window.setInterval(() => {
|
|
2304
2118
|
patch({
|
|
2305
2119
|
paused: timerRef.current.paused,
|
|
2306
|
-
elapsedMs:
|
|
2120
|
+
elapsedMs: chunkK6R2JNCK_js.presenterElapsed(timerRef.current)
|
|
2307
2121
|
});
|
|
2308
2122
|
}, 1e3);
|
|
2309
2123
|
return () => window.clearInterval(timer);
|
|
@@ -2313,19 +2127,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2313
2127
|
applyAudienceSnapshot: setSnapshot,
|
|
2314
2128
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2315
2129
|
toggleTimer: () => {
|
|
2316
|
-
timerRef.current =
|
|
2130
|
+
timerRef.current = chunkK6R2JNCK_js.togglePresenterTimer(timerRef.current);
|
|
2317
2131
|
patch({
|
|
2318
2132
|
paused: timerRef.current.paused,
|
|
2319
|
-
elapsedMs:
|
|
2133
|
+
elapsedMs: chunkK6R2JNCK_js.presenterElapsed(timerRef.current)
|
|
2320
2134
|
});
|
|
2321
2135
|
},
|
|
2322
2136
|
resetTimer: () => {
|
|
2323
|
-
timerRef.current =
|
|
2137
|
+
timerRef.current = chunkK6R2JNCK_js.resetPresenterTimer();
|
|
2324
2138
|
patch({ paused: false, elapsedMs: 0 });
|
|
2325
2139
|
},
|
|
2326
2140
|
stepZoom: (direction) => setSnapshot(
|
|
2327
|
-
(current) =>
|
|
2328
|
-
zoom:
|
|
2141
|
+
(current) => chunkK6R2JNCK_js.mergePresentationSnapshot(current, {
|
|
2142
|
+
zoom: chunkK6R2JNCK_js.stepPresenterZoom(
|
|
2329
2143
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2330
2144
|
direction
|
|
2331
2145
|
)
|
|
@@ -2371,7 +2185,7 @@ function usePresentationMode(input) {
|
|
|
2371
2185
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2372
2186
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2373
2187
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2374
|
-
const showGuard = react.useMemo(() =>
|
|
2188
|
+
const showGuard = react.useMemo(() => chunkK6R2JNCK_js.createPresenterShowGuard(), []);
|
|
2375
2189
|
const {
|
|
2376
2190
|
presentationAnimations,
|
|
2377
2191
|
presentationElementStates,
|
|
@@ -2450,7 +2264,7 @@ function usePresentationMode(input) {
|
|
|
2450
2264
|
});
|
|
2451
2265
|
const movePresentationSlide = react.useCallback(
|
|
2452
2266
|
(direction, trigger = "explicit") => {
|
|
2453
|
-
if (!
|
|
2267
|
+
if (!chunkK6R2JNCK_js.acceptsPresentationInput()) {
|
|
2454
2268
|
return;
|
|
2455
2269
|
}
|
|
2456
2270
|
if (endOfShowVisible) {
|
|
@@ -2588,7 +2402,7 @@ function usePresentationMode(input) {
|
|
|
2588
2402
|
if (mode !== "present") {
|
|
2589
2403
|
return;
|
|
2590
2404
|
}
|
|
2591
|
-
return
|
|
2405
|
+
return chunkK6R2JNCK_js.attachPresentationVisibilityPause({
|
|
2592
2406
|
root: containerRef.current ?? void 0,
|
|
2593
2407
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2594
2408
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2668,11 +2482,11 @@ function usePresentationMode(input) {
|
|
|
2668
2482
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2669
2483
|
return void 0;
|
|
2670
2484
|
}
|
|
2671
|
-
return
|
|
2485
|
+
return chunkK6R2JNCK_js.buildMorphTransitionPlan(
|
|
2672
2486
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2673
2487
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2674
2488
|
transitionOverlay.durationMs,
|
|
2675
|
-
|
|
2489
|
+
chunkK6R2JNCK_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2676
2490
|
);
|
|
2677
2491
|
}, [transitionOverlay, slides]);
|
|
2678
2492
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2693,7 +2507,7 @@ function usePresentationMode(input) {
|
|
|
2693
2507
|
if (!morphPlan) {
|
|
2694
2508
|
return presentationKeyframesCss;
|
|
2695
2509
|
}
|
|
2696
|
-
const imageRules =
|
|
2510
|
+
const imageRules = chunkK6R2JNCK_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2697
2511
|
return `${presentationKeyframesCss ?? ""}
|
|
2698
2512
|
${morphPlan.keyframesCss}
|
|
2699
2513
|
${imageRules}`;
|
|
@@ -2989,7 +2803,7 @@ function useFindReplace({
|
|
|
2989
2803
|
const [findResults, setFindResults] = react.useState([]);
|
|
2990
2804
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
2991
2805
|
const performFind = react.useCallback(() => {
|
|
2992
|
-
const results =
|
|
2806
|
+
const results = chunkK6R2JNCK_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
2993
2807
|
if (!findQuery) {
|
|
2994
2808
|
setFindResults([]);
|
|
2995
2809
|
setFindResultIndex(-1);
|
|
@@ -3023,7 +2837,7 @@ function useFindReplace({
|
|
|
3023
2837
|
return;
|
|
3024
2838
|
}
|
|
3025
2839
|
onUpdateSlides(
|
|
3026
|
-
(prevSlides) =>
|
|
2840
|
+
(prevSlides) => chunkK6R2JNCK_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
3027
2841
|
);
|
|
3028
2842
|
onMarkDirty();
|
|
3029
2843
|
},
|
|
@@ -3045,9 +2859,9 @@ function useFindReplace({
|
|
|
3045
2859
|
}, [findResults, applyReplacements, performFind]);
|
|
3046
2860
|
react.useEffect(() => {
|
|
3047
2861
|
const handler = (event) => {
|
|
3048
|
-
const { action } =
|
|
2862
|
+
const { action } = chunkK6R2JNCK_js.mapEditorKey(event, {
|
|
3049
2863
|
canEdit: mode === "edit",
|
|
3050
|
-
isTextInputTarget:
|
|
2864
|
+
isTextInputTarget: chunkK6R2JNCK_js.isEditorTextInputTarget(event.target)
|
|
3051
2865
|
});
|
|
3052
2866
|
if (action !== "find") {
|
|
3053
2867
|
return;
|
|
@@ -3126,7 +2940,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId) {
|
|
|
3126
2940
|
if (!slide) {
|
|
3127
2941
|
return { slides, didAdd: false };
|
|
3128
2942
|
}
|
|
3129
|
-
const next =
|
|
2943
|
+
const next = chunkK6R2JNCK_js.addCommentToList(
|
|
3130
2944
|
slide.comments || [],
|
|
3131
2945
|
text,
|
|
3132
2946
|
authorName,
|
|
@@ -3144,7 +2958,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
|
3144
2958
|
if (!slide) {
|
|
3145
2959
|
return { slides, didDelete: false };
|
|
3146
2960
|
}
|
|
3147
|
-
const next =
|
|
2961
|
+
const next = chunkK6R2JNCK_js.removeCommentFromList(slide.comments || [], commentId);
|
|
3148
2962
|
if (!next) {
|
|
3149
2963
|
return { slides, didDelete: false };
|
|
3150
2964
|
}
|
|
@@ -3155,7 +2969,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
|
3155
2969
|
if (!slide) {
|
|
3156
2970
|
return { slides, didUpdate: false };
|
|
3157
2971
|
}
|
|
3158
|
-
const next =
|
|
2972
|
+
const next = chunkK6R2JNCK_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
3159
2973
|
if (!next) {
|
|
3160
2974
|
return { slides, didUpdate: false };
|
|
3161
2975
|
}
|
|
@@ -3166,7 +2980,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
|
3166
2980
|
if (!slide) {
|
|
3167
2981
|
return { slides, didUpdate: false };
|
|
3168
2982
|
}
|
|
3169
|
-
const next =
|
|
2983
|
+
const next = chunkK6R2JNCK_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
3170
2984
|
if (!next) {
|
|
3171
2985
|
return { slides, didUpdate: false };
|
|
3172
2986
|
}
|
|
@@ -3177,7 +2991,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName) {
|
|
|
3177
2991
|
if (!slide) {
|
|
3178
2992
|
return { slides, didAdd: false };
|
|
3179
2993
|
}
|
|
3180
|
-
const next =
|
|
2994
|
+
const next = chunkK6R2JNCK_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
3181
2995
|
if (!next) {
|
|
3182
2996
|
return { slides, didAdd: false };
|
|
3183
2997
|
}
|
|
@@ -3551,7 +3365,7 @@ function useViewerCoreState(_input) {
|
|
|
3551
3365
|
const marqueeStateRef = react.useRef(null);
|
|
3552
3366
|
const isDrawingRef = react.useRef(false);
|
|
3553
3367
|
const justInteractedRef = react.useRef(false);
|
|
3554
|
-
const livePatcher = react.useMemo(() =>
|
|
3368
|
+
const livePatcher = react.useMemo(() => chunkK6R2JNCK_js.createCollaborationLivePatcher(), []);
|
|
3555
3369
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3556
3370
|
const slidesRef = react.useRef([]);
|
|
3557
3371
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3560,8 +3374,8 @@ function useViewerCoreState(_input) {
|
|
|
3560
3374
|
const [slides, setSlides] = react.useState([]);
|
|
3561
3375
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3562
3376
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3563
|
-
width:
|
|
3564
|
-
height:
|
|
3377
|
+
width: chunk44CQ67GQ_js.DEFAULT_CANVAS_WIDTH,
|
|
3378
|
+
height: chunk44CQ67GQ_js.DEFAULT_CANVAS_HEIGHT
|
|
3565
3379
|
});
|
|
3566
3380
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3567
3381
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3582,7 +3396,7 @@ function useViewerCoreState(_input) {
|
|
|
3582
3396
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3583
3397
|
inlineEditingTextRef.current = resolved;
|
|
3584
3398
|
setInlineEditingTextBase(value);
|
|
3585
|
-
|
|
3399
|
+
chunkK6R2JNCK_js.publishLiveInlineText(
|
|
3586
3400
|
livePatcher,
|
|
3587
3401
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3588
3402
|
inlineEditingElementIdRef.current,
|
|
@@ -3926,7 +3740,7 @@ function useLoadContent({
|
|
|
3926
3740
|
);
|
|
3927
3741
|
}
|
|
3928
3742
|
const previousHandler = handlerRef.current;
|
|
3929
|
-
const handler = new
|
|
3743
|
+
const handler = new chunkK6R2JNCK_js.PptxHandler();
|
|
3930
3744
|
const parsed = await handler.load(buffer, { allowExternalImages });
|
|
3931
3745
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3932
3746
|
handler.dispose();
|
|
@@ -3938,7 +3752,7 @@ function useLoadContent({
|
|
|
3938
3752
|
handlerRef.current = null;
|
|
3939
3753
|
const mediaElements = [];
|
|
3940
3754
|
for (const slide of parsed.slides) {
|
|
3941
|
-
|
|
3755
|
+
chunkK6R2JNCK_js.collectMediaElements(slide.elements, mediaElements);
|
|
3942
3756
|
}
|
|
3943
3757
|
for (const url of mediaDataUrls.values()) {
|
|
3944
3758
|
if (url.startsWith("blob:")) {
|
|
@@ -3979,7 +3793,7 @@ function useLoadContent({
|
|
|
3979
3793
|
}
|
|
3980
3794
|
})
|
|
3981
3795
|
);
|
|
3982
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3796
|
+
const { paths: imagePaths, refs: imageRefs } = chunkK6R2JNCK_js.collectImagePaths(parsed.slides);
|
|
3983
3797
|
let nextSlides = parsed.slides;
|
|
3984
3798
|
if (imagePaths.size > 0) {
|
|
3985
3799
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3994,100 +3808,26 @@ function useLoadContent({
|
|
|
3994
3808
|
}
|
|
3995
3809
|
})
|
|
3996
3810
|
);
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
continue;
|
|
4002
|
-
}
|
|
4003
|
-
const id = ref.element.id;
|
|
4004
|
-
const existing = elementPatches.get(id) ?? {};
|
|
4005
|
-
existing[ref.field] = url;
|
|
4006
|
-
elementPatches.set(id, existing);
|
|
4007
|
-
}
|
|
4008
|
-
if (elementPatches.size > 0) {
|
|
4009
|
-
const patchElements = (elements) => {
|
|
4010
|
-
let mutated = false;
|
|
4011
|
-
const next = elements.map((el) => {
|
|
4012
|
-
let updated = el;
|
|
4013
|
-
const patch = elementPatches.get(el.id);
|
|
4014
|
-
if (patch) {
|
|
4015
|
-
updated = { ...el, ...patch };
|
|
4016
|
-
}
|
|
4017
|
-
if (updated.type === "group" && updated.children?.length) {
|
|
4018
|
-
const newChildren = patchElements(updated.children);
|
|
4019
|
-
if (newChildren !== updated.children) {
|
|
4020
|
-
updated = { ...updated, children: newChildren };
|
|
4021
|
-
}
|
|
4022
|
-
}
|
|
4023
|
-
if (updated !== el) {
|
|
4024
|
-
mutated = true;
|
|
4025
|
-
}
|
|
4026
|
-
return updated;
|
|
4027
|
-
});
|
|
4028
|
-
return mutated ? next : elements;
|
|
4029
|
-
};
|
|
4030
|
-
nextSlides = parsed.slides.map((s) => {
|
|
4031
|
-
const newElements = patchElements(s.elements);
|
|
4032
|
-
return newElements === s.elements ? s : { ...s, elements: newElements };
|
|
4033
|
-
});
|
|
4034
|
-
}
|
|
4035
|
-
}
|
|
4036
|
-
const { paths: tableImagePaths, refs: tableImageRefs } = chunkYDEEINER_js.collectTableCellImagePaths(nextSlides);
|
|
4037
|
-
if (tableImagePaths.size > 0) {
|
|
4038
|
-
const resolvedTableMap = /* @__PURE__ */ new Map();
|
|
4039
|
-
await Promise.all(
|
|
4040
|
-
Array.from(tableImagePaths).map(async (path) => {
|
|
4041
|
-
try {
|
|
4042
|
-
const url = await handler.getImageData(path);
|
|
4043
|
-
if (url) {
|
|
4044
|
-
resolvedTableMap.set(path, url);
|
|
4045
|
-
}
|
|
4046
|
-
} catch {
|
|
4047
|
-
}
|
|
4048
|
-
})
|
|
4049
|
-
);
|
|
4050
|
-
if (resolvedTableMap.size > 0) {
|
|
4051
|
-
nextSlides = nextSlides.map((s) => {
|
|
4052
|
-
const newElements = chunkYDEEINER_js.applyTableCellImagePatches(
|
|
4053
|
-
s.elements,
|
|
4054
|
-
resolvedTableMap,
|
|
4055
|
-
tableImageRefs
|
|
4056
|
-
);
|
|
4057
|
-
return newElements === s.elements ? s : { ...s, elements: newElements };
|
|
4058
|
-
});
|
|
4059
|
-
}
|
|
4060
|
-
}
|
|
4061
|
-
let nextTableStyleMap = parsed.tableStyleMap;
|
|
4062
|
-
const { paths: tableStyleImagePaths, refs: tableStyleImageRefs } = chunkYDEEINER_js.collectTableStyleImagePaths(nextTableStyleMap);
|
|
4063
|
-
if (tableStyleImagePaths.size > 0) {
|
|
4064
|
-
const resolvedStyleMap = /* @__PURE__ */ new Map();
|
|
4065
|
-
await Promise.all(
|
|
4066
|
-
Array.from(tableStyleImagePaths).map(async (path) => {
|
|
4067
|
-
try {
|
|
4068
|
-
const url = await handler.getImageData(path);
|
|
4069
|
-
if (url) {
|
|
4070
|
-
resolvedStyleMap.set(path, url);
|
|
4071
|
-
}
|
|
4072
|
-
} catch {
|
|
4073
|
-
}
|
|
4074
|
-
})
|
|
4075
|
-
);
|
|
4076
|
-
if (resolvedStyleMap.size > 0 && nextTableStyleMap) {
|
|
4077
|
-
nextTableStyleMap = chunkYDEEINER_js.applyTableStyleImagePatches(
|
|
4078
|
-
nextTableStyleMap,
|
|
4079
|
-
resolvedStyleMap,
|
|
4080
|
-
tableStyleImageRefs
|
|
4081
|
-
);
|
|
4082
|
-
}
|
|
3811
|
+
nextSlides = parsed.slides.map((s) => {
|
|
3812
|
+
const newElements = chunkK6R2JNCK_js.applyImagePathPatches(s.elements, resolvedMap, imageRefs);
|
|
3813
|
+
return newElements === s.elements ? s : { ...s, elements: newElements };
|
|
3814
|
+
});
|
|
4083
3815
|
}
|
|
3816
|
+
nextSlides = await chunkK6R2JNCK_js.resolveTableCellImageUrls(
|
|
3817
|
+
nextSlides,
|
|
3818
|
+
(path) => handler.getImageData(path)
|
|
3819
|
+
);
|
|
3820
|
+
const nextTableStyleMap = await chunkK6R2JNCK_js.resolveTableStyleImageUrls(
|
|
3821
|
+
parsed.tableStyleMap,
|
|
3822
|
+
(path) => handler.getImageData(path)
|
|
3823
|
+
);
|
|
4084
3824
|
handlerRef.current = handler;
|
|
4085
|
-
const partition =
|
|
3825
|
+
const partition = chunkK6R2JNCK_js.partitionTemplateElements(nextSlides);
|
|
4086
3826
|
setSlides(partition.slides);
|
|
4087
3827
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4088
3828
|
setCanvasSize({
|
|
4089
|
-
width: parsed.width ??
|
|
4090
|
-
height: parsed.height ??
|
|
3829
|
+
width: parsed.width ?? chunk44CQ67GQ_js.DEFAULT_CANVAS_WIDTH,
|
|
3830
|
+
height: parsed.height ?? chunk44CQ67GQ_js.DEFAULT_CANVAS_HEIGHT
|
|
4091
3831
|
});
|
|
4092
3832
|
setSlideSizeEmu(
|
|
4093
3833
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4104,7 +3844,7 @@ function useLoadContent({
|
|
|
4104
3844
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
4105
3845
|
setCustomShows(parsed.customShows ?? []);
|
|
4106
3846
|
setActiveCustomShowId(
|
|
4107
|
-
|
|
3847
|
+
chunkK6R2JNCK_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
4108
3848
|
);
|
|
4109
3849
|
setSections(parsed.sections ?? []);
|
|
4110
3850
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -4127,7 +3867,7 @@ function useLoadContent({
|
|
|
4127
3867
|
setHasMacros(parsed.hasMacros === true);
|
|
4128
3868
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4129
3869
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4130
|
-
setGuides(
|
|
3870
|
+
setGuides(chunkK6R2JNCK_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4131
3871
|
setActiveSlideIndex(0);
|
|
4132
3872
|
clearSelection();
|
|
4133
3873
|
setIsDirty(false);
|
|
@@ -4135,7 +3875,7 @@ function useLoadContent({
|
|
|
4135
3875
|
onContentApplied?.();
|
|
4136
3876
|
} catch (err) {
|
|
4137
3877
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4138
|
-
if (err instanceof
|
|
3878
|
+
if (err instanceof chunkK6R2JNCK_js.EncryptedFileError) {
|
|
4139
3879
|
setIsEncrypted(true);
|
|
4140
3880
|
} else {
|
|
4141
3881
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4163,7 +3903,7 @@ function useLoadContent({
|
|
|
4163
3903
|
}
|
|
4164
3904
|
function useAutosave(input) {
|
|
4165
3905
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4166
|
-
const intervalMs =
|
|
3906
|
+
const intervalMs = chunkK6R2JNCK_js.resolveAutosaveIntervalMs({
|
|
4167
3907
|
hostIntervalMs: input.intervalMs,
|
|
4168
3908
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4169
3909
|
});
|
|
@@ -4194,7 +3934,7 @@ function useAutosave(input) {
|
|
|
4194
3934
|
return;
|
|
4195
3935
|
}
|
|
4196
3936
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4197
|
-
if (!
|
|
3937
|
+
if (!chunkK6R2JNCK_js.shouldWriteAutosaveSnapshot({
|
|
4198
3938
|
filePath: path,
|
|
4199
3939
|
isDirty: isDirtyRef.current,
|
|
4200
3940
|
saving: isSavingRef.current,
|
|
@@ -4212,8 +3952,8 @@ function useAutosave(input) {
|
|
|
4212
3952
|
isSavingRef.current = false;
|
|
4213
3953
|
return;
|
|
4214
3954
|
}
|
|
4215
|
-
await
|
|
4216
|
-
lastSnapshotRef.current =
|
|
3955
|
+
await chunkK6R2JNCK_js.saveAutosaveSnapshot(path, data);
|
|
3956
|
+
lastSnapshotRef.current = chunkK6R2JNCK_js.autosaveSnapshotMark(path, sources);
|
|
4217
3957
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4218
3958
|
} catch (err) {
|
|
4219
3959
|
setAutosaveStatus({
|
|
@@ -4299,11 +4039,11 @@ function useElementOperations(input) {
|
|
|
4299
4039
|
(elementId, updates) => {
|
|
4300
4040
|
if (masterView?.target) {
|
|
4301
4041
|
applyMasterViewWrite(
|
|
4302
|
-
|
|
4042
|
+
chunkK6R2JNCK_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4303
4043
|
);
|
|
4304
4044
|
return;
|
|
4305
4045
|
}
|
|
4306
|
-
if (
|
|
4046
|
+
if (chunkK6R2JNCK_js.isTemplateElementId(elementId)) {
|
|
4307
4047
|
const slideId = activeSlide?.id;
|
|
4308
4048
|
if (slideId) {
|
|
4309
4049
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4314,19 +4054,7 @@ function useElementOperations(input) {
|
|
|
4314
4054
|
}));
|
|
4315
4055
|
}
|
|
4316
4056
|
} else {
|
|
4317
|
-
setSlides(
|
|
4318
|
-
(prev) => prev.map(
|
|
4319
|
-
(s, i) => i !== activeSlideIndex ? s : {
|
|
4320
|
-
...s,
|
|
4321
|
-
elements: s.elements.map(
|
|
4322
|
-
(el) => el.id === elementId ? {
|
|
4323
|
-
...el,
|
|
4324
|
-
...updates
|
|
4325
|
-
} : el
|
|
4326
|
-
)
|
|
4327
|
-
}
|
|
4328
|
-
)
|
|
4329
|
-
);
|
|
4057
|
+
setSlides((prev) => chunkK6R2JNCK_js.updateElement(prev, activeSlideIndex, elementId, updates));
|
|
4330
4058
|
}
|
|
4331
4059
|
history.markDirty();
|
|
4332
4060
|
},
|
|
@@ -4351,7 +4079,7 @@ function useElementOperations(input) {
|
|
|
4351
4079
|
);
|
|
4352
4080
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4353
4081
|
(updates) => {
|
|
4354
|
-
if (!selectedElement || !
|
|
4082
|
+
if (!selectedElement || !chunkK6R2JNCK_js.hasShapeProperties(selectedElement)) {
|
|
4355
4083
|
return;
|
|
4356
4084
|
}
|
|
4357
4085
|
updateSelectedElement({
|
|
@@ -4362,17 +4090,17 @@ function useElementOperations(input) {
|
|
|
4362
4090
|
);
|
|
4363
4091
|
const updateSelectedTextStyle = react.useCallback(
|
|
4364
4092
|
(updates) => {
|
|
4365
|
-
if (!selectedElement || !
|
|
4093
|
+
if (!selectedElement || !chunkK6R2JNCK_js.hasTextProperties(selectedElement)) {
|
|
4366
4094
|
return;
|
|
4367
4095
|
}
|
|
4368
|
-
const inlineSel =
|
|
4096
|
+
const inlineSel = chunkK6R2JNCK_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4369
4097
|
if (inlineSel && selectedElement.textSegments) {
|
|
4370
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4098
|
+
const { newSegments: newSegments2, newSelection } = chunkK6R2JNCK_js.applyStyleToSelectedSegments(
|
|
4371
4099
|
selectedElement.textSegments,
|
|
4372
4100
|
inlineSel,
|
|
4373
4101
|
updates
|
|
4374
4102
|
);
|
|
4375
|
-
|
|
4103
|
+
chunkK6R2JNCK_js.setPendingSelectionRestore(newSelection);
|
|
4376
4104
|
updateSelectedElement({
|
|
4377
4105
|
textSegments: newSegments2
|
|
4378
4106
|
});
|
|
@@ -4392,12 +4120,12 @@ function useElementOperations(input) {
|
|
|
4392
4120
|
);
|
|
4393
4121
|
const updateSelectedTextCase = react.useCallback(
|
|
4394
4122
|
(mode) => {
|
|
4395
|
-
if (!selectedElement || !
|
|
4123
|
+
if (!selectedElement || !chunkK6R2JNCK_js.hasTextProperties(selectedElement)) {
|
|
4396
4124
|
return;
|
|
4397
4125
|
}
|
|
4398
|
-
const inlineSel =
|
|
4126
|
+
const inlineSel = chunkK6R2JNCK_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4399
4127
|
if (inlineSel && selectedElement.textSegments) {
|
|
4400
|
-
const newSegments =
|
|
4128
|
+
const newSegments = chunkK6R2JNCK_js.applyCaseTransformToSegments(
|
|
4401
4129
|
selectedElement.textSegments,
|
|
4402
4130
|
inlineSel,
|
|
4403
4131
|
mode
|
|
@@ -4407,14 +4135,14 @@ function useElementOperations(input) {
|
|
|
4407
4135
|
}
|
|
4408
4136
|
const updates = {};
|
|
4409
4137
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4410
|
-
updates.textSegments =
|
|
4138
|
+
updates.textSegments = chunkK6R2JNCK_js.applyCaseTransformToSegments(
|
|
4411
4139
|
selectedElement.textSegments,
|
|
4412
4140
|
null,
|
|
4413
4141
|
mode
|
|
4414
4142
|
);
|
|
4415
4143
|
}
|
|
4416
4144
|
if (typeof selectedElement.text === "string") {
|
|
4417
|
-
updates.text =
|
|
4145
|
+
updates.text = chunkK6R2JNCK_js.transformTextCase(selectedElement.text, mode);
|
|
4418
4146
|
}
|
|
4419
4147
|
updateSelectedElement(updates);
|
|
4420
4148
|
},
|
|
@@ -4427,15 +4155,15 @@ function useElementOperations(input) {
|
|
|
4427
4155
|
[setSlides]
|
|
4428
4156
|
);
|
|
4429
4157
|
const masterViewTarget = masterView?.target ?? null;
|
|
4430
|
-
const activeElements = masterViewTarget ?
|
|
4158
|
+
const activeElements = masterViewTarget ? chunkK6R2JNCK_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4431
4159
|
const updateActiveElements = react.useCallback(
|
|
4432
4160
|
(updater) => {
|
|
4433
4161
|
if (masterView?.target) {
|
|
4434
4162
|
applyMasterViewWrite(
|
|
4435
|
-
|
|
4163
|
+
chunkK6R2JNCK_js.replaceMasterViewElements(
|
|
4436
4164
|
masterView,
|
|
4437
4165
|
masterView.target,
|
|
4438
|
-
updater(
|
|
4166
|
+
updater(chunkK6R2JNCK_js.masterViewElements(masterView, masterView.target))
|
|
4439
4167
|
)
|
|
4440
4168
|
);
|
|
4441
4169
|
return;
|
|
@@ -4488,7 +4216,7 @@ function useSectionOperations(input) {
|
|
|
4488
4216
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4489
4217
|
const addSection2 = react.useCallback(
|
|
4490
4218
|
(name, afterSlideIndex) => {
|
|
4491
|
-
const result =
|
|
4219
|
+
const result = chunkK6R2JNCK_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4492
4220
|
setSlides(result.slides);
|
|
4493
4221
|
setSections(result.sections);
|
|
4494
4222
|
markDirty();
|
|
@@ -4497,7 +4225,7 @@ function useSectionOperations(input) {
|
|
|
4497
4225
|
);
|
|
4498
4226
|
const renameSection2 = react.useCallback(
|
|
4499
4227
|
(sectionId, newName) => {
|
|
4500
|
-
const result =
|
|
4228
|
+
const result = chunkK6R2JNCK_js.renameSection(sections, slides, sectionId, newName);
|
|
4501
4229
|
setSections(result.sections);
|
|
4502
4230
|
setSlides(result.slides);
|
|
4503
4231
|
markDirty();
|
|
@@ -4506,7 +4234,7 @@ function useSectionOperations(input) {
|
|
|
4506
4234
|
);
|
|
4507
4235
|
const deleteSection2 = react.useCallback(
|
|
4508
4236
|
(sectionId) => {
|
|
4509
|
-
const result =
|
|
4237
|
+
const result = chunkK6R2JNCK_js.deleteSection(sections, slides, sectionId);
|
|
4510
4238
|
setSections(result.sections);
|
|
4511
4239
|
setSlides(result.slides);
|
|
4512
4240
|
markDirty();
|
|
@@ -4515,21 +4243,21 @@ function useSectionOperations(input) {
|
|
|
4515
4243
|
);
|
|
4516
4244
|
const moveSectionUp2 = react.useCallback(
|
|
4517
4245
|
(sectionId) => {
|
|
4518
|
-
setSections(
|
|
4246
|
+
setSections(chunkK6R2JNCK_js.moveSectionUp(sections, sectionId));
|
|
4519
4247
|
markDirty();
|
|
4520
4248
|
},
|
|
4521
4249
|
[sections, setSections, markDirty]
|
|
4522
4250
|
);
|
|
4523
4251
|
const moveSectionDown2 = react.useCallback(
|
|
4524
4252
|
(sectionId) => {
|
|
4525
|
-
setSections(
|
|
4253
|
+
setSections(chunkK6R2JNCK_js.moveSectionDown(sections, sectionId));
|
|
4526
4254
|
markDirty();
|
|
4527
4255
|
},
|
|
4528
4256
|
[sections, setSections, markDirty]
|
|
4529
4257
|
);
|
|
4530
4258
|
const moveSlidesToSection2 = react.useCallback(
|
|
4531
4259
|
(slideIndexes, targetSectionId) => {
|
|
4532
|
-
const result =
|
|
4260
|
+
const result = chunkK6R2JNCK_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4533
4261
|
setSlides(result.slides);
|
|
4534
4262
|
setSections(result.sections);
|
|
4535
4263
|
markDirty();
|
|
@@ -4557,20 +4285,17 @@ function useSectionOperations(input) {
|
|
|
4557
4285
|
}
|
|
4558
4286
|
|
|
4559
4287
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4560
|
-
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4561
|
-
const
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
1,
|
|
4567
|
-
{ minSize: chunkT2QG2HD5_js.MIN_ELEMENT_SIZE }
|
|
4568
|
-
);
|
|
4288
|
+
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
|
|
4289
|
+
const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
|
|
4290
|
+
let resized = chunkK6R2JNCK_js.applyResize(startBox, handle, dx, dy, 1, { minSize: chunk44CQ67GQ_js.MIN_ELEMENT_SIZE });
|
|
4291
|
+
if (lockAspect) {
|
|
4292
|
+
resized = chunkK6R2JNCK_js.lockResizeAspect(resized, startBox, handle, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE);
|
|
4293
|
+
}
|
|
4569
4294
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4570
4295
|
if (!snapToGrid) {
|
|
4571
4296
|
return box;
|
|
4572
4297
|
}
|
|
4573
|
-
return
|
|
4298
|
+
return chunkK6R2JNCK_js.snapBoxToGrid(box, handle, gridSpacingPx, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE);
|
|
4574
4299
|
}
|
|
4575
4300
|
function resolveLiveTarget(input) {
|
|
4576
4301
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4683,7 +4408,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4683
4408
|
width: el.width,
|
|
4684
4409
|
height: el.height
|
|
4685
4410
|
}));
|
|
4686
|
-
const snapResult =
|
|
4411
|
+
const snapResult = chunkK6R2JNCK_js.computeSnapToShape(
|
|
4687
4412
|
targetX,
|
|
4688
4413
|
targetY,
|
|
4689
4414
|
primaryEl.width,
|
|
@@ -4722,7 +4447,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4722
4447
|
if (live) {
|
|
4723
4448
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4724
4449
|
const start = drag.startPositionsById[id];
|
|
4725
|
-
|
|
4450
|
+
chunkK6R2JNCK_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4726
4451
|
x: start.x + appliedDx,
|
|
4727
4452
|
y: start.y + appliedDy
|
|
4728
4453
|
});
|
|
@@ -4747,7 +4472,8 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4747
4472
|
dx,
|
|
4748
4473
|
dy,
|
|
4749
4474
|
snapToGrid,
|
|
4750
|
-
gridSpacingPx
|
|
4475
|
+
gridSpacingPx,
|
|
4476
|
+
e.shiftKey
|
|
4751
4477
|
);
|
|
4752
4478
|
rs.lastX = geo.x;
|
|
4753
4479
|
rs.lastY = geo.y;
|
|
@@ -4756,22 +4482,22 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4756
4482
|
if (rs.domEl) {
|
|
4757
4483
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4758
4484
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4759
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4760
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4485
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE)}px`;
|
|
4486
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE)}px`;
|
|
4761
4487
|
}
|
|
4762
4488
|
if (live) {
|
|
4763
|
-
|
|
4489
|
+
chunkK6R2JNCK_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4764
4490
|
x: geo.x,
|
|
4765
4491
|
y: geo.y,
|
|
4766
|
-
width: Math.max(geo.width,
|
|
4767
|
-
height: Math.max(geo.height,
|
|
4492
|
+
width: Math.max(geo.width, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE),
|
|
4493
|
+
height: Math.max(geo.height, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE)
|
|
4768
4494
|
});
|
|
4769
4495
|
}
|
|
4770
4496
|
}
|
|
4771
4497
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4772
4498
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4773
4499
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4774
|
-
const adjustments =
|
|
4500
|
+
const adjustments = chunkK6R2JNCK_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4775
4501
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4776
4502
|
adj.moved = true;
|
|
4777
4503
|
}
|
|
@@ -4846,13 +4572,13 @@ function processPointerUp(input) {
|
|
|
4846
4572
|
if (i !== activeSlideIndex) {
|
|
4847
4573
|
return s;
|
|
4848
4574
|
}
|
|
4849
|
-
const rerouted =
|
|
4575
|
+
const rerouted = chunkK6R2JNCK_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4850
4576
|
if (rerouted.length === 0) {
|
|
4851
4577
|
return s;
|
|
4852
4578
|
}
|
|
4853
4579
|
return {
|
|
4854
4580
|
...s,
|
|
4855
|
-
elements:
|
|
4581
|
+
elements: chunkK6R2JNCK_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4856
4582
|
};
|
|
4857
4583
|
})
|
|
4858
4584
|
);
|
|
@@ -4877,9 +4603,9 @@ function processPointerUp(input) {
|
|
|
4877
4603
|
}
|
|
4878
4604
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4879
4605
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4880
|
-
const hitIds =
|
|
4606
|
+
const hitIds = chunkK6R2JNCK_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4881
4607
|
if (marquee.additive) {
|
|
4882
|
-
const merged =
|
|
4608
|
+
const merged = chunkK6R2JNCK_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4883
4609
|
if (merged.length > 0) {
|
|
4884
4610
|
applySelection(merged[0], merged);
|
|
4885
4611
|
} else {
|
|
@@ -4902,8 +4628,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4902
4628
|
}
|
|
4903
4629
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4904
4630
|
});
|
|
4905
|
-
const rerouted =
|
|
4906
|
-
return
|
|
4631
|
+
const rerouted = chunkK6R2JNCK_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4632
|
+
return chunkK6R2JNCK_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4907
4633
|
};
|
|
4908
4634
|
if (editTemplateMode) {
|
|
4909
4635
|
const slideId = activeSlide?.id;
|
|
@@ -5059,11 +4785,11 @@ function useCanvasInteractions(input) {
|
|
|
5059
4785
|
return;
|
|
5060
4786
|
}
|
|
5061
4787
|
const el = elementLookup.get(editId);
|
|
5062
|
-
if (el &&
|
|
4788
|
+
if (el && chunkK6R2JNCK_js.hasTextProperties(el)) {
|
|
5063
4789
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
5064
|
-
const newSegments =
|
|
4790
|
+
const newSegments = chunkK6R2JNCK_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
5065
4791
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
5066
|
-
const newHeight =
|
|
4792
|
+
const newHeight = chunkK6R2JNCK_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
5067
4793
|
ops.updateElementById(editId, {
|
|
5068
4794
|
text: committedText,
|
|
5069
4795
|
textSegments: newSegments,
|
|
@@ -5075,7 +4801,7 @@ function useCanvasInteractions(input) {
|
|
|
5075
4801
|
setInlineEditingText("");
|
|
5076
4802
|
};
|
|
5077
4803
|
const openEquationEditorForElement = (el) => {
|
|
5078
|
-
if (!
|
|
4804
|
+
if (!chunkK6R2JNCK_js.hasTextProperties(el)) {
|
|
5079
4805
|
return false;
|
|
5080
4806
|
}
|
|
5081
4807
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5105,7 +4831,7 @@ function useCanvasInteractions(input) {
|
|
|
5105
4831
|
justInteractedRef.current = false;
|
|
5106
4832
|
} else {
|
|
5107
4833
|
const el = elementLookup.get(elementId);
|
|
5108
|
-
if (el &&
|
|
4834
|
+
if (el && chunkK6R2JNCK_js.hasTextProperties(el) && chunkK6R2JNCK_js.canInteractWithElement(el, "textEdit")) {
|
|
5109
4835
|
if (!openEquationEditorForElement(el)) {
|
|
5110
4836
|
setInlineEditingElementId(elementId);
|
|
5111
4837
|
setInlineEditingText(el.text ?? "");
|
|
@@ -5124,7 +4850,7 @@ function useCanvasInteractions(input) {
|
|
|
5124
4850
|
if (openEquationEditorForElement(el)) {
|
|
5125
4851
|
return;
|
|
5126
4852
|
}
|
|
5127
|
-
if (
|
|
4853
|
+
if (chunkK6R2JNCK_js.hasTextProperties(el) && chunkK6R2JNCK_js.canInteractWithElement(el, "textEdit")) {
|
|
5128
4854
|
setInlineEditingElementId(elementId);
|
|
5129
4855
|
setInlineEditingText(el.text ?? "");
|
|
5130
4856
|
}
|
|
@@ -5147,7 +4873,7 @@ function useCanvasInteractions(input) {
|
|
|
5147
4873
|
justSelectedRef.current = false;
|
|
5148
4874
|
}
|
|
5149
4875
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
5150
|
-
const movableIds =
|
|
4876
|
+
const movableIds = chunkK6R2JNCK_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
5151
4877
|
if (movableIds.length === 0) {
|
|
5152
4878
|
return;
|
|
5153
4879
|
}
|
|
@@ -5217,7 +4943,7 @@ function useCanvasInteractions(input) {
|
|
|
5217
4943
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5218
4944
|
e.stopPropagation();
|
|
5219
4945
|
const el = elementLookup.get(elementId);
|
|
5220
|
-
if (!el || !
|
|
4946
|
+
if (!el || !chunkK6R2JNCK_js.canInteractWithElement(el, "resize")) {
|
|
5221
4947
|
return;
|
|
5222
4948
|
}
|
|
5223
4949
|
resizeStateRef.current = {
|
|
@@ -5239,7 +4965,7 @@ function useCanvasInteractions(input) {
|
|
|
5239
4965
|
};
|
|
5240
4966
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5241
4967
|
const el = elementLookup.get(elementId);
|
|
5242
|
-
if (!el || !
|
|
4968
|
+
if (!el || !chunkK6R2JNCK_js.canInteractWithElement(el, "rotate")) {
|
|
5243
4969
|
return;
|
|
5244
4970
|
}
|
|
5245
4971
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5259,10 +4985,10 @@ function useCanvasInteractions(input) {
|
|
|
5259
4985
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5260
4986
|
e.stopPropagation();
|
|
5261
4987
|
const el = elementLookup.get(elementId);
|
|
5262
|
-
if (!el || !
|
|
4988
|
+
if (!el || !chunkK6R2JNCK_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5263
4989
|
return;
|
|
5264
4990
|
}
|
|
5265
|
-
shapeAdjustmentDragStateRef.current =
|
|
4991
|
+
shapeAdjustmentDragStateRef.current = chunkK6R2JNCK_js.beginShapeAdjustment(
|
|
5266
4992
|
el,
|
|
5267
4993
|
descriptor,
|
|
5268
4994
|
e.clientX,
|
|
@@ -5309,7 +5035,7 @@ function createFileHandlers(deps) {
|
|
|
5309
5035
|
h = Math.round(h * scale);
|
|
5310
5036
|
}
|
|
5311
5037
|
addElement({
|
|
5312
|
-
id:
|
|
5038
|
+
id: chunkK6R2JNCK_js.generateElementId(),
|
|
5313
5039
|
type: "image",
|
|
5314
5040
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5315
5041
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5320,7 +5046,7 @@ function createFileHandlers(deps) {
|
|
|
5320
5046
|
};
|
|
5321
5047
|
img.onerror = () => {
|
|
5322
5048
|
addElement({
|
|
5323
|
-
id:
|
|
5049
|
+
id: chunkK6R2JNCK_js.generateElementId(),
|
|
5324
5050
|
type: "image",
|
|
5325
5051
|
x: 100,
|
|
5326
5052
|
y: 100,
|
|
@@ -5339,14 +5065,14 @@ function createFileHandlers(deps) {
|
|
|
5339
5065
|
return;
|
|
5340
5066
|
}
|
|
5341
5067
|
e.target.value = "";
|
|
5342
|
-
const mediaType =
|
|
5068
|
+
const mediaType = chunkK6R2JNCK_js.classifyMediaType(file.type);
|
|
5343
5069
|
if (!mediaType) {
|
|
5344
5070
|
return;
|
|
5345
5071
|
}
|
|
5346
5072
|
const elFilePath = file.path;
|
|
5347
5073
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5348
5074
|
addElement({
|
|
5349
|
-
id:
|
|
5075
|
+
id: chunkK6R2JNCK_js.generateElementId(),
|
|
5350
5076
|
type: "media",
|
|
5351
5077
|
mediaType,
|
|
5352
5078
|
mediaMimeType: file.type || void 0,
|
|
@@ -5521,13 +5247,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5521
5247
|
return;
|
|
5522
5248
|
}
|
|
5523
5249
|
addElement({
|
|
5524
|
-
id:
|
|
5250
|
+
id: chunkK6R2JNCK_js.generateElementId(),
|
|
5525
5251
|
type: "smartArt",
|
|
5526
5252
|
x: 100,
|
|
5527
5253
|
y: 120,
|
|
5528
5254
|
width: 600,
|
|
5529
5255
|
height: 340,
|
|
5530
|
-
smartArtData:
|
|
5256
|
+
smartArtData: chunkK6R2JNCK_js.buildSmartArtPresetData(
|
|
5531
5257
|
layout,
|
|
5532
5258
|
defaultItems,
|
|
5533
5259
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5539,7 +5265,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5539
5265
|
return;
|
|
5540
5266
|
}
|
|
5541
5267
|
addElement({
|
|
5542
|
-
id:
|
|
5268
|
+
id: chunkK6R2JNCK_js.generateElementId(),
|
|
5543
5269
|
type: "shape",
|
|
5544
5270
|
x: 120,
|
|
5545
5271
|
y: 200,
|
|
@@ -5577,7 +5303,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5577
5303
|
return;
|
|
5578
5304
|
}
|
|
5579
5305
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5580
|
-
if (resolved.url && !
|
|
5306
|
+
if (resolved.url && !chunkK6R2JNCK_js.isUrlSafe(resolved.url)) {
|
|
5581
5307
|
return;
|
|
5582
5308
|
}
|
|
5583
5309
|
const actionClick = {
|
|
@@ -5601,7 +5327,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5601
5327
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5602
5328
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5603
5329
|
addElement({
|
|
5604
|
-
id:
|
|
5330
|
+
id: chunkK6R2JNCK_js.generateElementId(),
|
|
5605
5331
|
type: "shape",
|
|
5606
5332
|
x: 120,
|
|
5607
5333
|
y: 200,
|
|
@@ -5623,11 +5349,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5623
5349
|
if (!activeSlide) {
|
|
5624
5350
|
return;
|
|
5625
5351
|
}
|
|
5626
|
-
const preset =
|
|
5352
|
+
const preset = chunkK6R2JNCK_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5627
5353
|
if (!preset) {
|
|
5628
5354
|
return;
|
|
5629
5355
|
}
|
|
5630
|
-
const defaultPptxAction =
|
|
5356
|
+
const defaultPptxAction = chunkK6R2JNCK_js.elementActionToPptxAction({
|
|
5631
5357
|
trigger: "click",
|
|
5632
5358
|
type: preset.defaultAction
|
|
5633
5359
|
});
|
|
@@ -5636,7 +5362,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5636
5362
|
defaultPptxAction.highlightClick = true;
|
|
5637
5363
|
}
|
|
5638
5364
|
addElement({
|
|
5639
|
-
id:
|
|
5365
|
+
id: chunkK6R2JNCK_js.generateElementId(),
|
|
5640
5366
|
type: "shape",
|
|
5641
5367
|
x: 150,
|
|
5642
5368
|
y: 150,
|
|
@@ -5703,14 +5429,14 @@ function useInsertElements(input) {
|
|
|
5703
5429
|
return;
|
|
5704
5430
|
}
|
|
5705
5431
|
addElement({
|
|
5706
|
-
id:
|
|
5432
|
+
id: chunkK6R2JNCK_js.generateElementId(),
|
|
5707
5433
|
type: "text",
|
|
5708
5434
|
x: 100,
|
|
5709
5435
|
y: 100,
|
|
5710
5436
|
width: 300,
|
|
5711
5437
|
height: 60,
|
|
5712
5438
|
text: "",
|
|
5713
|
-
textStyle: { fontSize:
|
|
5439
|
+
textStyle: { fontSize: chunk44CQ67GQ_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5714
5440
|
});
|
|
5715
5441
|
};
|
|
5716
5442
|
const handleAddShape = () => {
|
|
@@ -5718,7 +5444,7 @@ function useInsertElements(input) {
|
|
|
5718
5444
|
return;
|
|
5719
5445
|
}
|
|
5720
5446
|
addElement({
|
|
5721
|
-
id:
|
|
5447
|
+
id: chunkK6R2JNCK_js.generateElementId(),
|
|
5722
5448
|
type: "shape",
|
|
5723
5449
|
x: 150,
|
|
5724
5450
|
y: 150,
|
|
@@ -5737,15 +5463,15 @@ function useInsertElements(input) {
|
|
|
5737
5463
|
return;
|
|
5738
5464
|
}
|
|
5739
5465
|
addElement({
|
|
5740
|
-
...
|
|
5741
|
-
id:
|
|
5466
|
+
...chunkK6R2JNCK_js.newTableElement(chunk44CQ67GQ_js.DEFAULT_TABLE_ROWS, chunk44CQ67GQ_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5467
|
+
id: chunkK6R2JNCK_js.generateElementId()
|
|
5742
5468
|
});
|
|
5743
5469
|
};
|
|
5744
5470
|
const handleAddChart = (chartKind) => {
|
|
5745
5471
|
if (!activeSlide) {
|
|
5746
5472
|
return;
|
|
5747
5473
|
}
|
|
5748
|
-
addElement(
|
|
5474
|
+
addElement(chunkK6R2JNCK_js.createDefaultChartElement(chartKind));
|
|
5749
5475
|
};
|
|
5750
5476
|
const structured = createStructuredElementHandlers({
|
|
5751
5477
|
activeSlide,
|
|
@@ -5815,7 +5541,7 @@ function useClipboardHandlers(input) {
|
|
|
5815
5541
|
if (!selectedElement) {
|
|
5816
5542
|
return;
|
|
5817
5543
|
}
|
|
5818
|
-
setClipboardPayload(
|
|
5544
|
+
setClipboardPayload(chunkK6R2JNCK_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5819
5545
|
};
|
|
5820
5546
|
const handleDelete = () => {
|
|
5821
5547
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5832,7 +5558,7 @@ function useClipboardHandlers(input) {
|
|
|
5832
5558
|
handleDelete();
|
|
5833
5559
|
};
|
|
5834
5560
|
const insertClone = (source) => {
|
|
5835
|
-
const clone =
|
|
5561
|
+
const clone = chunkK6R2JNCK_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5836
5562
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5837
5563
|
ops.applySelection(clone.id);
|
|
5838
5564
|
history.markDirty();
|
|
@@ -5867,7 +5593,7 @@ function resolveShapePath(el) {
|
|
|
5867
5593
|
return el.pathData;
|
|
5868
5594
|
}
|
|
5869
5595
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5870
|
-
const clipPath =
|
|
5596
|
+
const clipPath = chunkK6R2JNCK_js.getPresetShapeClipPath(el.shapeType);
|
|
5871
5597
|
if (clipPath) {
|
|
5872
5598
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5873
5599
|
if (svgPath) {
|
|
@@ -5918,7 +5644,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5918
5644
|
return parts.join(" ");
|
|
5919
5645
|
}
|
|
5920
5646
|
function transformPathToGlobal(pathData, el) {
|
|
5921
|
-
const polys =
|
|
5647
|
+
const polys = chunkK6R2JNCK_js.svgPathToPolygons(pathData);
|
|
5922
5648
|
if (polys.length === 0) {
|
|
5923
5649
|
return pathData;
|
|
5924
5650
|
}
|
|
@@ -5938,10 +5664,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5938
5664
|
y: pt.y * scaleY + el.y
|
|
5939
5665
|
}))
|
|
5940
5666
|
);
|
|
5941
|
-
return
|
|
5667
|
+
return chunkK6R2JNCK_js.polygonsToSvgPath(transformed);
|
|
5942
5668
|
}
|
|
5943
5669
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5944
|
-
const polys =
|
|
5670
|
+
const polys = chunkK6R2JNCK_js.svgPathToPolygons(pathData);
|
|
5945
5671
|
if (polys.length === 0) {
|
|
5946
5672
|
return pathData;
|
|
5947
5673
|
}
|
|
@@ -5951,10 +5677,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5951
5677
|
y: pt.y - y
|
|
5952
5678
|
}))
|
|
5953
5679
|
);
|
|
5954
|
-
return
|
|
5680
|
+
return chunkK6R2JNCK_js.polygonsToSvgPath(transformed);
|
|
5955
5681
|
}
|
|
5956
5682
|
function pathBounds(pathData) {
|
|
5957
|
-
const polys =
|
|
5683
|
+
const polys = chunkK6R2JNCK_js.svgPathToPolygons(pathData);
|
|
5958
5684
|
let minX = Infinity;
|
|
5959
5685
|
let minY = Infinity;
|
|
5960
5686
|
let maxX = -Infinity;
|
|
@@ -6013,7 +5739,7 @@ function useMergeShapesHandler(input) {
|
|
|
6013
5739
|
let allFragments = [];
|
|
6014
5740
|
let remaining = globalPaths[0];
|
|
6015
5741
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6016
|
-
const frags =
|
|
5742
|
+
const frags = chunkK6R2JNCK_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
6017
5743
|
if (Array.isArray(frags)) {
|
|
6018
5744
|
allFragments = frags;
|
|
6019
5745
|
}
|
|
@@ -6042,7 +5768,7 @@ function useMergeShapesHandler(input) {
|
|
|
6042
5768
|
bounds.height
|
|
6043
5769
|
);
|
|
6044
5770
|
const newEl = {
|
|
6045
|
-
id:
|
|
5771
|
+
id: chunkK6R2JNCK_js.generateElementId(),
|
|
6046
5772
|
type: "shape",
|
|
6047
5773
|
x: bounds.x,
|
|
6048
5774
|
y: bounds.y,
|
|
@@ -6080,7 +5806,7 @@ function useMergeShapesHandler(input) {
|
|
|
6080
5806
|
} else {
|
|
6081
5807
|
let resultPath = globalPaths[0];
|
|
6082
5808
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6083
|
-
const result =
|
|
5809
|
+
const result = chunkK6R2JNCK_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
6084
5810
|
if (typeof result === "string") {
|
|
6085
5811
|
resultPath = result;
|
|
6086
5812
|
}
|
|
@@ -6101,7 +5827,7 @@ function useMergeShapesHandler(input) {
|
|
|
6101
5827
|
);
|
|
6102
5828
|
const primary = targets[0];
|
|
6103
5829
|
const newEl = {
|
|
6104
|
-
id:
|
|
5830
|
+
id: chunkK6R2JNCK_js.generateElementId(),
|
|
6105
5831
|
type: "shape",
|
|
6106
5832
|
x: bounds.x,
|
|
6107
5833
|
y: bounds.y,
|
|
@@ -6164,7 +5890,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6164
5890
|
if (ids.length < 2 || !activeSlide) {
|
|
6165
5891
|
return;
|
|
6166
5892
|
}
|
|
6167
|
-
const { elements, groupId } =
|
|
5893
|
+
const { elements, groupId } = chunkK6R2JNCK_js.groupElements(ops.activeElements, ids, chunkK6R2JNCK_js.generateElementId());
|
|
6168
5894
|
if (groupId === null) {
|
|
6169
5895
|
return;
|
|
6170
5896
|
}
|
|
@@ -6177,11 +5903,11 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6177
5903
|
return;
|
|
6178
5904
|
}
|
|
6179
5905
|
const group = selectedElement;
|
|
6180
|
-
const intoTemplate =
|
|
5906
|
+
const intoTemplate = chunkK6R2JNCK_js.isTemplateElementId(group.id);
|
|
6181
5907
|
const childIds = group.children.map(
|
|
6182
|
-
(child) => intoTemplate ?
|
|
5908
|
+
(child) => intoTemplate ? chunkK6R2JNCK_js.makeCloneId(true, child.id || group.id) : child.id || chunkK6R2JNCK_js.generateElementId()
|
|
6183
5909
|
);
|
|
6184
|
-
const { elements, childIds: usedIds } =
|
|
5910
|
+
const { elements, childIds: usedIds } = chunkK6R2JNCK_js.ungroupElements(
|
|
6185
5911
|
ops.activeElements,
|
|
6186
5912
|
group.id,
|
|
6187
5913
|
childIds,
|
|
@@ -6210,7 +5936,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6210
5936
|
if (!edge) {
|
|
6211
5937
|
return;
|
|
6212
5938
|
}
|
|
6213
|
-
const positions =
|
|
5939
|
+
const positions = chunkK6R2JNCK_js.alignElements(selectedElements, edge);
|
|
6214
5940
|
for (const [id, pos] of positions) {
|
|
6215
5941
|
const el = elementLookup.get(id);
|
|
6216
5942
|
if (!el) {
|
|
@@ -6228,7 +5954,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6228
5954
|
if (!distAxis) {
|
|
6229
5955
|
return;
|
|
6230
5956
|
}
|
|
6231
|
-
const positions =
|
|
5957
|
+
const positions = chunkK6R2JNCK_js.distributeElements(selectedElements, distAxis);
|
|
6232
5958
|
for (const [id, pos] of positions) {
|
|
6233
5959
|
const el = elementLookup.get(id);
|
|
6234
5960
|
if (!el) {
|
|
@@ -6245,7 +5971,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6245
5971
|
}
|
|
6246
5972
|
const id = selectedElement.id;
|
|
6247
5973
|
ops.updateActiveElements(
|
|
6248
|
-
(els) => direction === "forward" ?
|
|
5974
|
+
(els) => direction === "forward" ? chunkK6R2JNCK_js.bringForward(els, id) : direction === "backward" ? chunkK6R2JNCK_js.sendBackward(els, id) : els
|
|
6249
5975
|
);
|
|
6250
5976
|
history.markDirty();
|
|
6251
5977
|
};
|
|
@@ -6255,7 +5981,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6255
5981
|
}
|
|
6256
5982
|
const id = selectedElement.id;
|
|
6257
5983
|
ops.updateActiveElements(
|
|
6258
|
-
(els) => direction === "front" ?
|
|
5984
|
+
(els) => direction === "front" ? chunkK6R2JNCK_js.bringToFront(els, id) : chunkK6R2JNCK_js.sendToBack(els, id)
|
|
6259
5985
|
);
|
|
6260
5986
|
history.markDirty();
|
|
6261
5987
|
};
|
|
@@ -6386,7 +6112,7 @@ function useSlideManagement(input) {
|
|
|
6386
6112
|
theme
|
|
6387
6113
|
} = input;
|
|
6388
6114
|
const handleAddSlide = () => {
|
|
6389
|
-
const newSlide =
|
|
6115
|
+
const newSlide = chunkK6R2JNCK_js.createBlankSlide(slides.length + 1);
|
|
6390
6116
|
ops.updateSlides((prev) => {
|
|
6391
6117
|
const next = [...prev];
|
|
6392
6118
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6449,7 +6175,7 @@ function useSlideManagement(input) {
|
|
|
6449
6175
|
}
|
|
6450
6176
|
const clone = {
|
|
6451
6177
|
...src,
|
|
6452
|
-
id:
|
|
6178
|
+
id: chunkK6R2JNCK_js.makeSlideId(),
|
|
6453
6179
|
elements: src.elements.map((el) => ({
|
|
6454
6180
|
...el,
|
|
6455
6181
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6481,7 +6207,7 @@ function useSlideManagement(input) {
|
|
|
6481
6207
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6482
6208
|
const insertAt = activeSlideIndex + 1;
|
|
6483
6209
|
const draft = {
|
|
6484
|
-
...
|
|
6210
|
+
...chunkK6R2JNCK_js.createBlankSlide(slides.length + 1),
|
|
6485
6211
|
layoutPath,
|
|
6486
6212
|
...layoutName ? { layoutName } : {}
|
|
6487
6213
|
};
|
|
@@ -6514,9 +6240,9 @@ function useSlideManagement(input) {
|
|
|
6514
6240
|
};
|
|
6515
6241
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6516
6242
|
const insertAt = activeSlideIndex + 1;
|
|
6517
|
-
const draft =
|
|
6243
|
+
const draft = chunkK6R2JNCK_js.buildSlideTemplateSlide(templateId, chunkK6R2JNCK_js.makeSlideId(), slides.length + 1, {
|
|
6518
6244
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6519
|
-
scheme:
|
|
6245
|
+
scheme: chunkK6R2JNCK_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6520
6246
|
});
|
|
6521
6247
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6522
6248
|
setActiveSlideIndex(insertAt);
|
|
@@ -6553,7 +6279,7 @@ function createTableMergeHandlers(input) {
|
|
|
6553
6279
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6554
6280
|
return;
|
|
6555
6281
|
}
|
|
6556
|
-
const newTableData =
|
|
6282
|
+
const newTableData = chunkK6R2JNCK_js.mergeCells(
|
|
6557
6283
|
[
|
|
6558
6284
|
{ row: rowIndex, col: columnIndex },
|
|
6559
6285
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6561,7 +6287,7 @@ function createTableMergeHandlers(input) {
|
|
|
6561
6287
|
td
|
|
6562
6288
|
);
|
|
6563
6289
|
const updates = { tableData: newTableData };
|
|
6564
|
-
const newRawXml =
|
|
6290
|
+
const newRawXml = chunkK6R2JNCK_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6565
6291
|
if (newRawXml) {
|
|
6566
6292
|
updates.rawXml = newRawXml;
|
|
6567
6293
|
}
|
|
@@ -6587,7 +6313,7 @@ function createTableMergeHandlers(input) {
|
|
|
6587
6313
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6588
6314
|
return;
|
|
6589
6315
|
}
|
|
6590
|
-
const newTableData =
|
|
6316
|
+
const newTableData = chunkK6R2JNCK_js.mergeCells(
|
|
6591
6317
|
[
|
|
6592
6318
|
{ row: rowIndex, col: columnIndex },
|
|
6593
6319
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6595,7 +6321,7 @@ function createTableMergeHandlers(input) {
|
|
|
6595
6321
|
td
|
|
6596
6322
|
);
|
|
6597
6323
|
const updates = { tableData: newTableData };
|
|
6598
|
-
const newRawXml =
|
|
6324
|
+
const newRawXml = chunkK6R2JNCK_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6599
6325
|
if (newRawXml) {
|
|
6600
6326
|
updates.rawXml = newRawXml;
|
|
6601
6327
|
}
|
|
@@ -6610,9 +6336,9 @@ function createTableMergeHandlers(input) {
|
|
|
6610
6336
|
return;
|
|
6611
6337
|
}
|
|
6612
6338
|
const td = selectedElement.tableData;
|
|
6613
|
-
const newTableData =
|
|
6339
|
+
const newTableData = chunkK6R2JNCK_js.mergeCells(ts.selectedCells, td);
|
|
6614
6340
|
const updates = { tableData: newTableData };
|
|
6615
|
-
const newRawXml =
|
|
6341
|
+
const newRawXml = chunkK6R2JNCK_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6616
6342
|
if (newRawXml) {
|
|
6617
6343
|
updates.rawXml = newRawXml;
|
|
6618
6344
|
}
|
|
@@ -6629,9 +6355,9 @@ function createTableMergeHandlers(input) {
|
|
|
6629
6355
|
}
|
|
6630
6356
|
const { rowIndex, columnIndex } = ts;
|
|
6631
6357
|
const td = selectedElement.tableData;
|
|
6632
|
-
const newTableData =
|
|
6358
|
+
const newTableData = chunkK6R2JNCK_js.splitCell(rowIndex, columnIndex, td);
|
|
6633
6359
|
const updates = { tableData: newTableData };
|
|
6634
|
-
const newRawXml =
|
|
6360
|
+
const newRawXml = chunkK6R2JNCK_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6635
6361
|
if (newRawXml) {
|
|
6636
6362
|
updates.rawXml = newRawXml;
|
|
6637
6363
|
}
|
|
@@ -6665,10 +6391,10 @@ function createTableStructHandlers(input) {
|
|
|
6665
6391
|
const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
|
|
6666
6392
|
const updates = {};
|
|
6667
6393
|
if (el.tableData) {
|
|
6668
|
-
updates.tableData =
|
|
6394
|
+
updates.tableData = chunkK6R2JNCK_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6669
6395
|
}
|
|
6670
6396
|
if (el.rawXml) {
|
|
6671
|
-
const newRawXml =
|
|
6397
|
+
const newRawXml = chunkK6R2JNCK_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6672
6398
|
if (newRawXml) {
|
|
6673
6399
|
updates.rawXml = newRawXml;
|
|
6674
6400
|
}
|
|
@@ -6692,7 +6418,7 @@ function createTableStructHandlers(input) {
|
|
|
6692
6418
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6693
6419
|
const updates = {};
|
|
6694
6420
|
if (selectedElement.rawXml) {
|
|
6695
|
-
const newRawXml =
|
|
6421
|
+
const newRawXml = chunkK6R2JNCK_js.updateCellTextStyleInRawXml(
|
|
6696
6422
|
selectedElement,
|
|
6697
6423
|
rowIndex,
|
|
6698
6424
|
colIndex,
|
|
@@ -6756,9 +6482,9 @@ function createTableStructHandlers(input) {
|
|
|
6756
6482
|
return;
|
|
6757
6483
|
}
|
|
6758
6484
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6759
|
-
const newTableData =
|
|
6485
|
+
const newTableData = chunkK6R2JNCK_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6760
6486
|
const updates = { tableData: newTableData };
|
|
6761
|
-
const newRawXml =
|
|
6487
|
+
const newRawXml = chunkK6R2JNCK_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6762
6488
|
if (newRawXml) {
|
|
6763
6489
|
updates.rawXml = newRawXml;
|
|
6764
6490
|
}
|
|
@@ -6771,12 +6497,12 @@ function createTableStructHandlers(input) {
|
|
|
6771
6497
|
}
|
|
6772
6498
|
const td = selectedElement.tableData;
|
|
6773
6499
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6774
|
-
const newTableData =
|
|
6500
|
+
const newTableData = chunkK6R2JNCK_js.deleteTableRow(td, rowIdx);
|
|
6775
6501
|
if (newTableData === td) {
|
|
6776
6502
|
return;
|
|
6777
6503
|
}
|
|
6778
6504
|
const updates = { tableData: newTableData };
|
|
6779
|
-
const newRawXml =
|
|
6505
|
+
const newRawXml = chunkK6R2JNCK_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6780
6506
|
if (newRawXml) {
|
|
6781
6507
|
updates.rawXml = newRawXml;
|
|
6782
6508
|
}
|
|
@@ -6788,9 +6514,9 @@ function createTableStructHandlers(input) {
|
|
|
6788
6514
|
return;
|
|
6789
6515
|
}
|
|
6790
6516
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6791
|
-
const newTableData =
|
|
6517
|
+
const newTableData = chunkK6R2JNCK_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6792
6518
|
const updates = { tableData: newTableData };
|
|
6793
|
-
const newRawXml =
|
|
6519
|
+
const newRawXml = chunkK6R2JNCK_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6794
6520
|
if (newRawXml) {
|
|
6795
6521
|
updates.rawXml = newRawXml;
|
|
6796
6522
|
}
|
|
@@ -6803,12 +6529,12 @@ function createTableStructHandlers(input) {
|
|
|
6803
6529
|
}
|
|
6804
6530
|
const td = selectedElement.tableData;
|
|
6805
6531
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6806
|
-
const newTableData =
|
|
6532
|
+
const newTableData = chunkK6R2JNCK_js.deleteTableColumn(td, colIdx);
|
|
6807
6533
|
if (newTableData === td) {
|
|
6808
6534
|
return;
|
|
6809
6535
|
}
|
|
6810
6536
|
const updates = { tableData: newTableData };
|
|
6811
|
-
const newRawXml =
|
|
6537
|
+
const newRawXml = chunkK6R2JNCK_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6812
6538
|
if (newRawXml) {
|
|
6813
6539
|
updates.rawXml = newRawXml;
|
|
6814
6540
|
}
|
|
@@ -6844,8 +6570,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6844
6570
|
return html2canvasPro(element, {
|
|
6845
6571
|
...options,
|
|
6846
6572
|
onclone: async (doc, clonedEl) => {
|
|
6847
|
-
await
|
|
6848
|
-
|
|
6573
|
+
await chunkK6R2JNCK_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6574
|
+
chunkK6R2JNCK_js.preprocessCssForCapture(clonedEl);
|
|
6849
6575
|
if (typeof userOnClone === "function") {
|
|
6850
6576
|
userOnClone(doc, clonedEl);
|
|
6851
6577
|
}
|
|
@@ -6883,13 +6609,13 @@ function useExportSaveAs(input) {
|
|
|
6883
6609
|
if (!handler) {
|
|
6884
6610
|
return;
|
|
6885
6611
|
}
|
|
6886
|
-
const downloadName =
|
|
6612
|
+
const downloadName = chunkK6R2JNCK_js.savedPresentationFileName(filePath, format);
|
|
6887
6613
|
try {
|
|
6888
6614
|
const data = await buildSaveAsData(handler, format);
|
|
6889
6615
|
const blob = new Blob([data], {
|
|
6890
6616
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6891
6617
|
});
|
|
6892
|
-
|
|
6618
|
+
chunkK6R2JNCK_js.downloadBlob(blob, downloadName);
|
|
6893
6619
|
} catch (err) {
|
|
6894
6620
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
6895
6621
|
}
|
|
@@ -6902,18 +6628,18 @@ function useExportSaveAs(input) {
|
|
|
6902
6628
|
const pptxGuides = guides.map((g) => ({
|
|
6903
6629
|
id: g.id,
|
|
6904
6630
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
6905
|
-
positionEmu:
|
|
6631
|
+
positionEmu: chunkK6R2JNCK_js.guidePxToEmu(g.position)
|
|
6906
6632
|
}));
|
|
6907
6633
|
return {
|
|
6908
6634
|
...slide,
|
|
6909
6635
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
6910
6636
|
};
|
|
6911
6637
|
});
|
|
6912
|
-
const slidesToSave =
|
|
6638
|
+
const slidesToSave = chunkK6R2JNCK_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
6913
6639
|
const saveOptions = {
|
|
6914
6640
|
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
6915
6641
|
// a preset picked in the inspector reached one save path and not the other.
|
|
6916
|
-
slideSize:
|
|
6642
|
+
slideSize: chunkK6R2JNCK_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
6917
6643
|
headerFooter,
|
|
6918
6644
|
presentationProperties,
|
|
6919
6645
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -6927,13 +6653,13 @@ function useExportSaveAs(input) {
|
|
|
6927
6653
|
handoutMaster,
|
|
6928
6654
|
outputFormat: format
|
|
6929
6655
|
};
|
|
6930
|
-
return
|
|
6656
|
+
return chunkK6R2JNCK_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
6931
6657
|
};
|
|
6932
6658
|
const handleExportJson = () => {
|
|
6933
6659
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
6934
|
-
const slideSize =
|
|
6660
|
+
const slideSize = chunkK6R2JNCK_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
6935
6661
|
const data = {
|
|
6936
|
-
slides:
|
|
6662
|
+
slides: chunkK6R2JNCK_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
6937
6663
|
width: canvasSize.width,
|
|
6938
6664
|
height: canvasSize.height,
|
|
6939
6665
|
widthEmu: slideSize.widthEmu,
|
|
@@ -6952,7 +6678,7 @@ function useExportSaveAs(input) {
|
|
|
6952
6678
|
handoutMaster
|
|
6953
6679
|
};
|
|
6954
6680
|
try {
|
|
6955
|
-
|
|
6681
|
+
chunkK6R2JNCK_js.exportDeckJson(data, sourceName);
|
|
6956
6682
|
} catch (err) {
|
|
6957
6683
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
6958
6684
|
}
|
|
@@ -7039,7 +6765,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
7039
6765
|
}
|
|
7040
6766
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
7041
6767
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
7042
|
-
|
|
6768
|
+
chunkK6R2JNCK_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
7043
6769
|
}
|
|
7044
6770
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
7045
6771
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -7061,15 +6787,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7061
6787
|
continue;
|
|
7062
6788
|
}
|
|
7063
6789
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
7064
|
-
images.push(
|
|
6790
|
+
images.push(chunkK6R2JNCK_js.canvasToJpegData(canvas));
|
|
7065
6791
|
}
|
|
7066
6792
|
onProgress?.(totalSlides, totalSlides);
|
|
7067
6793
|
setActiveSlide(currentSlideIndex);
|
|
7068
6794
|
if (images.length === 0) {
|
|
7069
|
-
throw new Error(
|
|
6795
|
+
throw new Error(chunk3P7FYHJH_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7070
6796
|
}
|
|
7071
|
-
const pdfBlobUrl =
|
|
7072
|
-
|
|
6797
|
+
const pdfBlobUrl = chunk44CQ67GQ_js.buildPdfFromImageData(images);
|
|
6798
|
+
chunkK6R2JNCK_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
7073
6799
|
}
|
|
7074
6800
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
7075
6801
|
const { scale = 2, onProgress } = options;
|
|
@@ -7115,10 +6841,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7115
6841
|
onProgress?.(totalSlides, totalSlides);
|
|
7116
6842
|
setActiveSlide(currentSlideIndex);
|
|
7117
6843
|
if (pages.length === 0) {
|
|
7118
|
-
throw new Error(
|
|
6844
|
+
throw new Error(chunk3P7FYHJH_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7119
6845
|
}
|
|
7120
|
-
const pdfDataUrl =
|
|
7121
|
-
|
|
6846
|
+
const pdfDataUrl = chunk44CQ67GQ_js.buildNotesPdf(pages);
|
|
6847
|
+
chunkK6R2JNCK_js.downloadDataUrl(pdfDataUrl, filename);
|
|
7122
6848
|
}
|
|
7123
6849
|
|
|
7124
6850
|
// src/viewer/utils/export-video.ts
|
|
@@ -7149,7 +6875,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7149
6875
|
}
|
|
7150
6876
|
setActiveSlide(currentSlideIndex);
|
|
7151
6877
|
if (slideCanvases.length === 0) {
|
|
7152
|
-
throw new Error(
|
|
6878
|
+
throw new Error(chunk3P7FYHJH_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
7153
6879
|
}
|
|
7154
6880
|
const firstCanvas = slideCanvases[0];
|
|
7155
6881
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -7157,12 +6883,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7157
6883
|
recordingCanvas.height = firstCanvas.height;
|
|
7158
6884
|
const ctx = recordingCanvas.getContext("2d");
|
|
7159
6885
|
if (!ctx) {
|
|
7160
|
-
throw new Error(
|
|
6886
|
+
throw new Error(chunk3P7FYHJH_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
7161
6887
|
}
|
|
7162
6888
|
const fps = 30;
|
|
7163
6889
|
const stream = recordingCanvas.captureStream(fps);
|
|
7164
6890
|
const recorder = new MediaRecorder(stream, {
|
|
7165
|
-
mimeType:
|
|
6891
|
+
mimeType: chunkK6R2JNCK_js.pickSupportedMimeType([...chunkK6R2JNCK_js.WEBM_MIME_CANDIDATES]),
|
|
7166
6892
|
videoBitsPerSecond: 5e6
|
|
7167
6893
|
});
|
|
7168
6894
|
const chunks = [];
|
|
@@ -7185,8 +6911,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7185
6911
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
7186
6912
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
7187
6913
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
7188
|
-
const frameInterval =
|
|
7189
|
-
const framesNeeded =
|
|
6914
|
+
const frameInterval = chunkK6R2JNCK_js.fpsToFrameIntervalMs(fps);
|
|
6915
|
+
const framesNeeded = chunkK6R2JNCK_js.segmentFrameCount(duration, fps);
|
|
7190
6916
|
for (let f = 0; f < framesNeeded; f++) {
|
|
7191
6917
|
if (signal?.aborted) {
|
|
7192
6918
|
recorder.stop();
|
|
@@ -7233,9 +6959,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7233
6959
|
}
|
|
7234
6960
|
setActiveSlide(currentSlideIndex);
|
|
7235
6961
|
if (frames.length === 0) {
|
|
7236
|
-
throw new Error(
|
|
6962
|
+
throw new Error(chunk3P7FYHJH_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
7237
6963
|
}
|
|
7238
|
-
const gifBytes =
|
|
6964
|
+
const gifBytes = chunkK6R2JNCK_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
7239
6965
|
onProgress?.(totalSlides, totalSlides);
|
|
7240
6966
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
7241
6967
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -7289,7 +7015,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7289
7015
|
continue;
|
|
7290
7016
|
}
|
|
7291
7017
|
onProgress?.(processedCount, data.slides.length);
|
|
7292
|
-
let svg =
|
|
7018
|
+
let svg = chunkK6R2JNCK_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7293
7019
|
if (embedFonts && fontFaces?.length) {
|
|
7294
7020
|
svg = injectFontFaces(svg, fontFaces);
|
|
7295
7021
|
}
|
|
@@ -7398,21 +7124,21 @@ function useExportHandlers(input) {
|
|
|
7398
7124
|
{
|
|
7399
7125
|
scale: imageExportScale,
|
|
7400
7126
|
onProgress: (current, total) => {
|
|
7401
|
-
setExportProgress(
|
|
7402
|
-
setExportStatusMessage(
|
|
7127
|
+
setExportProgress(chunkK6R2JNCK_js.slideProgressPercent(current, total));
|
|
7128
|
+
setExportStatusMessage(chunkK6R2JNCK_js.slideStatusLabel("Rendering", current, total));
|
|
7403
7129
|
},
|
|
7404
7130
|
signal: abortCtrl.signal
|
|
7405
7131
|
}
|
|
7406
7132
|
);
|
|
7407
|
-
setExportProgress(
|
|
7133
|
+
setExportProgress(chunkK6R2JNCK_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7408
7134
|
setExportStatusMessage("Building PDF...");
|
|
7409
7135
|
await new Promise((r) => {
|
|
7410
7136
|
setTimeout(r, 100);
|
|
7411
7137
|
});
|
|
7412
|
-
setExportProgress(
|
|
7138
|
+
setExportProgress(chunkK6R2JNCK_js.EXPORT_DONE_PERCENT);
|
|
7413
7139
|
setExportStatusMessage("Done!");
|
|
7414
7140
|
} catch (err) {
|
|
7415
|
-
if (!
|
|
7141
|
+
if (!chunkK6R2JNCK_js.isExportAbortError(err)) {
|
|
7416
7142
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7417
7143
|
}
|
|
7418
7144
|
} finally {
|
|
@@ -7442,21 +7168,21 @@ function useExportHandlers(input) {
|
|
|
7442
7168
|
{
|
|
7443
7169
|
scale: imageExportScale,
|
|
7444
7170
|
onProgress: (current, total) => {
|
|
7445
|
-
setExportProgress(
|
|
7446
|
-
setExportStatusMessage(
|
|
7171
|
+
setExportProgress(chunkK6R2JNCK_js.slideProgressPercent(current, total));
|
|
7172
|
+
setExportStatusMessage(chunkK6R2JNCK_js.slideStatusLabel("Rendering", current, total));
|
|
7447
7173
|
},
|
|
7448
7174
|
signal: abortCtrl.signal
|
|
7449
7175
|
}
|
|
7450
7176
|
);
|
|
7451
|
-
setExportProgress(
|
|
7177
|
+
setExportProgress(chunkK6R2JNCK_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7452
7178
|
setExportStatusMessage("Building PDF...");
|
|
7453
7179
|
await new Promise((r) => {
|
|
7454
7180
|
setTimeout(r, 100);
|
|
7455
7181
|
});
|
|
7456
|
-
setExportProgress(
|
|
7182
|
+
setExportProgress(chunkK6R2JNCK_js.EXPORT_DONE_PERCENT);
|
|
7457
7183
|
setExportStatusMessage("Done!");
|
|
7458
7184
|
} catch (err) {
|
|
7459
|
-
if (!
|
|
7185
|
+
if (!chunkK6R2JNCK_js.isExportAbortError(err)) {
|
|
7460
7186
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7461
7187
|
}
|
|
7462
7188
|
} finally {
|
|
@@ -7498,22 +7224,22 @@ function useExportHandlers(input) {
|
|
|
7498
7224
|
scale: 1,
|
|
7499
7225
|
slideDurationMs: 3e3,
|
|
7500
7226
|
onProgress: (current, total) => {
|
|
7501
|
-
setExportProgress(
|
|
7502
|
-
setExportStatusMessage(
|
|
7227
|
+
setExportProgress(chunkK6R2JNCK_js.slideProgressPercent(current, total, 45));
|
|
7228
|
+
setExportStatusMessage(chunkK6R2JNCK_js.slideStatusLabel("Capturing", current, total));
|
|
7503
7229
|
},
|
|
7504
7230
|
onRecordProgress: (current, total) => {
|
|
7505
|
-
setExportProgress(
|
|
7506
|
-
setExportStatusMessage(
|
|
7231
|
+
setExportProgress(chunkK6R2JNCK_js.recordProgressPercent(current, total));
|
|
7232
|
+
setExportStatusMessage(chunkK6R2JNCK_js.slideStatusLabel("Recording", current, total));
|
|
7507
7233
|
},
|
|
7508
7234
|
signal: abortCtrl.signal
|
|
7509
7235
|
}
|
|
7510
7236
|
);
|
|
7511
|
-
setExportProgress(
|
|
7237
|
+
setExportProgress(chunkK6R2JNCK_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7512
7238
|
setExportStatusMessage("Saving file...");
|
|
7513
|
-
|
|
7514
|
-
setExportProgress(
|
|
7239
|
+
chunkK6R2JNCK_js.downloadBlob(blob, "presentation.webm");
|
|
7240
|
+
setExportProgress(chunkK6R2JNCK_js.EXPORT_DONE_PERCENT);
|
|
7515
7241
|
} catch (err) {
|
|
7516
|
-
if (!
|
|
7242
|
+
if (!chunkK6R2JNCK_js.isExportAbortError(err)) {
|
|
7517
7243
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7518
7244
|
}
|
|
7519
7245
|
} finally {
|
|
@@ -7541,18 +7267,18 @@ function useExportHandlers(input) {
|
|
|
7541
7267
|
scale: 0.5,
|
|
7542
7268
|
slideDurationMs: 2e3,
|
|
7543
7269
|
onProgress: (current, total) => {
|
|
7544
|
-
setExportProgress(
|
|
7545
|
-
setExportStatusMessage(
|
|
7270
|
+
setExportProgress(chunkK6R2JNCK_js.slideProgressPercent(current, total));
|
|
7271
|
+
setExportStatusMessage(chunkK6R2JNCK_js.slideStatusLabel("Encoding", current, total));
|
|
7546
7272
|
},
|
|
7547
7273
|
signal: abortCtrl.signal
|
|
7548
7274
|
}
|
|
7549
7275
|
);
|
|
7550
|
-
setExportProgress(
|
|
7276
|
+
setExportProgress(chunkK6R2JNCK_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7551
7277
|
setExportStatusMessage("Saving file...");
|
|
7552
|
-
|
|
7553
|
-
setExportProgress(
|
|
7278
|
+
chunkK6R2JNCK_js.downloadBlob(blob, "presentation.gif");
|
|
7279
|
+
setExportProgress(chunkK6R2JNCK_js.EXPORT_DONE_PERCENT);
|
|
7554
7280
|
} catch (err) {
|
|
7555
|
-
if (!
|
|
7281
|
+
if (!chunkK6R2JNCK_js.isExportAbortError(err)) {
|
|
7556
7282
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7557
7283
|
}
|
|
7558
7284
|
} finally {
|
|
@@ -7585,7 +7311,7 @@ function useExportHandlers(input) {
|
|
|
7585
7311
|
exportStatusMessage
|
|
7586
7312
|
};
|
|
7587
7313
|
}
|
|
7588
|
-
var ViewerOptionsContext = react.createContext(
|
|
7314
|
+
var ViewerOptionsContext = react.createContext(chunkK6R2JNCK_js.DEFAULT_VIEWER_OPTIONS);
|
|
7589
7315
|
function useViewerOptionsContext() {
|
|
7590
7316
|
return react.useContext(ViewerOptionsContext);
|
|
7591
7317
|
}
|
|
@@ -7597,13 +7323,13 @@ function usePrintHandlers(input) {
|
|
|
7597
7323
|
const { t } = reactI18next.useTranslation();
|
|
7598
7324
|
const viewerOptions = useViewerOptionsContext();
|
|
7599
7325
|
const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
|
|
7600
|
-
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) *
|
|
7326
|
+
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunkK6R2JNCK_js.resolveImageResolutionScale(viewerOptions);
|
|
7601
7327
|
const handlePrint = () => {
|
|
7602
7328
|
setIsPrintDialogOpen(true);
|
|
7603
7329
|
};
|
|
7604
7330
|
const handlePrintSvg = async (settings) => {
|
|
7605
7331
|
setIsPrintDialogOpen(false);
|
|
7606
|
-
const printWindow =
|
|
7332
|
+
const printWindow = chunkK6R2JNCK_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7607
7333
|
if (!printWindow) {
|
|
7608
7334
|
console.warn(
|
|
7609
7335
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7613,9 +7339,9 @@ function usePrintHandlers(input) {
|
|
|
7613
7339
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7614
7340
|
return runRasterPrint(printWindow, settings);
|
|
7615
7341
|
}
|
|
7616
|
-
const colorFilter =
|
|
7617
|
-
const slideIndices =
|
|
7618
|
-
|
|
7342
|
+
const colorFilter = chunkK6R2JNCK_js.computeColorFilter(settings.colorMode);
|
|
7343
|
+
const slideIndices = chunkK6R2JNCK_js.filterHiddenSlideIndices(
|
|
7344
|
+
chunkK6R2JNCK_js.computeSlideIndices(
|
|
7619
7345
|
settings.slideRange,
|
|
7620
7346
|
activeSlideIndex,
|
|
7621
7347
|
slides.length,
|
|
@@ -7633,22 +7359,22 @@ function usePrintHandlers(input) {
|
|
|
7633
7359
|
printWindow.close();
|
|
7634
7360
|
return;
|
|
7635
7361
|
}
|
|
7636
|
-
const printDoc =
|
|
7362
|
+
const printDoc = chunkK6R2JNCK_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7637
7363
|
title: "Slides (Vector)",
|
|
7638
7364
|
orientation: settings.orientation,
|
|
7639
7365
|
colorFilter,
|
|
7640
7366
|
scaleToFit: settings.scaleToFit
|
|
7641
7367
|
});
|
|
7642
|
-
|
|
7368
|
+
chunkK6R2JNCK_js.finishPrintWindow(printWindow, printDoc);
|
|
7643
7369
|
} catch (err) {
|
|
7644
7370
|
console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
|
|
7645
7371
|
return runRasterPrint(printWindow, settings);
|
|
7646
7372
|
}
|
|
7647
7373
|
};
|
|
7648
7374
|
const runRasterPrint = async (printWindow, settings) => {
|
|
7649
|
-
const colorFilter =
|
|
7650
|
-
const slideIndices =
|
|
7651
|
-
|
|
7375
|
+
const colorFilter = chunkK6R2JNCK_js.computeColorFilter(settings.colorMode);
|
|
7376
|
+
const slideIndices = chunkK6R2JNCK_js.filterHiddenSlideIndices(
|
|
7377
|
+
chunkK6R2JNCK_js.computeSlideIndices(
|
|
7652
7378
|
settings.slideRange,
|
|
7653
7379
|
activeSlideIndex,
|
|
7654
7380
|
slides.length,
|
|
@@ -7659,11 +7385,11 @@ function usePrintHandlers(input) {
|
|
|
7659
7385
|
includeHiddenSlides
|
|
7660
7386
|
);
|
|
7661
7387
|
if (settings.printWhat === "outline") {
|
|
7662
|
-
|
|
7388
|
+
chunkK6R2JNCK_js.finishPrintWindow(
|
|
7663
7389
|
printWindow,
|
|
7664
|
-
|
|
7390
|
+
chunkK6R2JNCK_js.buildPrintHtmlDocument({
|
|
7665
7391
|
title: "Outline",
|
|
7666
|
-
bodyHtml: `<div class="outline-page">${
|
|
7392
|
+
bodyHtml: `<div class="outline-page">${chunkK6R2JNCK_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7667
7393
|
orientation: settings.orientation,
|
|
7668
7394
|
colorFilter,
|
|
7669
7395
|
frameSlides: settings.frameSlides,
|
|
@@ -7690,11 +7416,11 @@ function usePrintHandlers(input) {
|
|
|
7690
7416
|
}
|
|
7691
7417
|
const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
|
|
7692
7418
|
if (settings.printWhat === "slides") {
|
|
7693
|
-
|
|
7419
|
+
chunkK6R2JNCK_js.finishPrintWindow(
|
|
7694
7420
|
printWindow,
|
|
7695
|
-
|
|
7421
|
+
chunkK6R2JNCK_js.buildPrintHtmlDocument({
|
|
7696
7422
|
title: "Slides",
|
|
7697
|
-
bodyHtml:
|
|
7423
|
+
bodyHtml: chunkK6R2JNCK_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7698
7424
|
orientation: settings.orientation,
|
|
7699
7425
|
colorFilter,
|
|
7700
7426
|
frameSlides: settings.frameSlides,
|
|
@@ -7704,11 +7430,11 @@ function usePrintHandlers(input) {
|
|
|
7704
7430
|
return;
|
|
7705
7431
|
}
|
|
7706
7432
|
if (settings.printWhat === "notes") {
|
|
7707
|
-
|
|
7433
|
+
chunkK6R2JNCK_js.finishPrintWindow(
|
|
7708
7434
|
printWindow,
|
|
7709
|
-
|
|
7435
|
+
chunkK6R2JNCK_js.buildPrintHtmlDocument({
|
|
7710
7436
|
title: "Notes Pages",
|
|
7711
|
-
bodyHtml:
|
|
7437
|
+
bodyHtml: chunkK6R2JNCK_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7712
7438
|
orientation: "portrait",
|
|
7713
7439
|
colorFilter,
|
|
7714
7440
|
frameSlides: settings.frameSlides,
|
|
@@ -7719,11 +7445,11 @@ function usePrintHandlers(input) {
|
|
|
7719
7445
|
}
|
|
7720
7446
|
if (settings.printWhat === "handouts") {
|
|
7721
7447
|
const spp = settings.slidesPerPage;
|
|
7722
|
-
|
|
7448
|
+
chunkK6R2JNCK_js.finishPrintWindow(
|
|
7723
7449
|
printWindow,
|
|
7724
|
-
|
|
7450
|
+
chunkK6R2JNCK_js.buildPrintHtmlDocument({
|
|
7725
7451
|
title: `Handout ${spp} per page`,
|
|
7726
|
-
bodyHtml:
|
|
7452
|
+
bodyHtml: chunkK6R2JNCK_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7727
7453
|
orientation: "portrait",
|
|
7728
7454
|
colorFilter,
|
|
7729
7455
|
frameSlides: settings.frameSlides,
|
|
@@ -7737,7 +7463,7 @@ function usePrintHandlers(input) {
|
|
|
7737
7463
|
};
|
|
7738
7464
|
const handlePrintWithSettings = async (settings) => {
|
|
7739
7465
|
setIsPrintDialogOpen(false);
|
|
7740
|
-
const printWindow =
|
|
7466
|
+
const printWindow = chunkK6R2JNCK_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7741
7467
|
if (!printWindow) {
|
|
7742
7468
|
console.warn(
|
|
7743
7469
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7800,8 +7526,8 @@ function useThemeHandlers(input) {
|
|
|
7800
7526
|
return;
|
|
7801
7527
|
}
|
|
7802
7528
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7803
|
-
const previousMap = theme?.colorScheme ?
|
|
7804
|
-
setSlides((prev) =>
|
|
7529
|
+
const previousMap = theme?.colorScheme ? chunkK6R2JNCK_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7530
|
+
setSlides((prev) => chunkK6R2JNCK_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7805
7531
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7806
7532
|
bumpHistory();
|
|
7807
7533
|
history.markDirty();
|
|
@@ -7906,7 +7632,7 @@ function useThemeSwitching(input) {
|
|
|
7906
7632
|
}
|
|
7907
7633
|
try {
|
|
7908
7634
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7909
|
-
const newData =
|
|
7635
|
+
const newData = chunkK6R2JNCK_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7910
7636
|
onDataChange(newData);
|
|
7911
7637
|
onThemeChanged?.(preset);
|
|
7912
7638
|
} catch (error) {
|
|
@@ -7923,7 +7649,7 @@ function useThemeSwitching(input) {
|
|
|
7923
7649
|
}
|
|
7924
7650
|
try {
|
|
7925
7651
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7926
|
-
const newData =
|
|
7652
|
+
const newData = chunkK6R2JNCK_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7927
7653
|
onDataChange(newData);
|
|
7928
7654
|
} catch (error) {
|
|
7929
7655
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7935,12 +7661,12 @@ function useThemeSwitching(input) {
|
|
|
7935
7661
|
if (!data?.theme?.colorScheme) {
|
|
7936
7662
|
return void 0;
|
|
7937
7663
|
}
|
|
7938
|
-
return
|
|
7939
|
-
(p) =>
|
|
7664
|
+
return chunkK6R2JNCK_js.THEME_PRESETS.find(
|
|
7665
|
+
(p) => chunkK6R2JNCK_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7940
7666
|
);
|
|
7941
7667
|
}, [data?.theme?.colorScheme]);
|
|
7942
7668
|
return {
|
|
7943
|
-
presets:
|
|
7669
|
+
presets: chunkK6R2JNCK_js.THEME_PRESETS,
|
|
7944
7670
|
switchToPreset,
|
|
7945
7671
|
switchToCustom,
|
|
7946
7672
|
currentPreset
|
|
@@ -8015,7 +7741,7 @@ function usePropertyHandlers(input) {
|
|
|
8015
7741
|
}
|
|
8016
7742
|
try {
|
|
8017
7743
|
const ab = await file.arrayBuffer();
|
|
8018
|
-
const h = new
|
|
7744
|
+
const h = new chunkK6R2JNCK_js.PptxHandler();
|
|
8019
7745
|
const other = await h.load(ab);
|
|
8020
7746
|
if (!other) {
|
|
8021
7747
|
return;
|
|
@@ -8025,7 +7751,7 @@ function usePropertyHandlers(input) {
|
|
|
8025
7751
|
width: canvasSize.width,
|
|
8026
7752
|
height: canvasSize.height
|
|
8027
7753
|
};
|
|
8028
|
-
setCompareResult(
|
|
7754
|
+
setCompareResult(chunkK6R2JNCK_js.comparePresentation(cur, other));
|
|
8029
7755
|
setIsComparePanelOpen(true);
|
|
8030
7756
|
} catch (err) {
|
|
8031
7757
|
console.warn("Compare failed:", err);
|
|
@@ -8042,7 +7768,7 @@ function usePropertyHandlers(input) {
|
|
|
8042
7768
|
if (!diff || diff.status === "unchanged") {
|
|
8043
7769
|
return;
|
|
8044
7770
|
}
|
|
8045
|
-
setSlides((prev) =>
|
|
7771
|
+
setSlides((prev) => chunkK6R2JNCK_js.applyAcceptSlide(prev, diff));
|
|
8046
7772
|
setIsDirty(true);
|
|
8047
7773
|
},
|
|
8048
7774
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -8053,10 +7779,10 @@ function usePropertyHandlers(input) {
|
|
|
8053
7779
|
if (!compareResult) {
|
|
8054
7780
|
return;
|
|
8055
7781
|
}
|
|
8056
|
-
setSlides((prev) =>
|
|
7782
|
+
setSlides((prev) => chunkK6R2JNCK_js.applyAcceptAllSlides(prev, compareResult));
|
|
8057
7783
|
setIsDirty(true);
|
|
8058
7784
|
}, [compareResult, setSlides, setIsDirty]);
|
|
8059
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7785
|
+
const usedFontFamilies = react.useMemo(() => chunkK6R2JNCK_js.collectUsedFonts(slides), [slides]);
|
|
8060
7786
|
return {
|
|
8061
7787
|
handleUpdateNotes,
|
|
8062
7788
|
handleUpdateSlide,
|
|
@@ -8211,7 +7937,7 @@ function useViewerDialogs(input) {
|
|
|
8211
7937
|
);
|
|
8212
7938
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8213
7939
|
const fontEmbedding = react.useMemo(
|
|
8214
|
-
() =>
|
|
7940
|
+
() => chunkK6R2JNCK_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8215
7941
|
[embeddedFontKey]
|
|
8216
7942
|
);
|
|
8217
7943
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8221,11 +7947,11 @@ function useViewerDialogs(input) {
|
|
|
8221
7947
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8222
7948
|
}
|
|
8223
7949
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8224
|
-
() => typeof window !== "undefined" ?
|
|
7950
|
+
() => typeof window !== "undefined" ? chunkK6R2JNCK_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8225
7951
|
);
|
|
8226
7952
|
react.useEffect(() => {
|
|
8227
7953
|
const handleWindow = () => setIsNarrowViewport(
|
|
8228
|
-
|
|
7954
|
+
chunkK6R2JNCK_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8229
7955
|
);
|
|
8230
7956
|
window.addEventListener("resize", handleWindow);
|
|
8231
7957
|
return () => window.removeEventListener("resize", handleWindow);
|
|
@@ -8378,15 +8104,15 @@ function useViewerDialogs(input) {
|
|
|
8378
8104
|
};
|
|
8379
8105
|
}
|
|
8380
8106
|
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8381
|
-
return
|
|
8107
|
+
return chunkK6R2JNCK_js.computeGridSpacingPx(documentGridSpacing, chunk44CQ67GQ_js.GRID_SIZE);
|
|
8382
8108
|
}
|
|
8383
8109
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8384
8110
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8385
|
-
return
|
|
8111
|
+
return chunkK6R2JNCK_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8386
8112
|
}
|
|
8387
8113
|
function computeSlideSectionGroups(slides, sections) {
|
|
8388
|
-
return
|
|
8389
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8114
|
+
return chunkK6R2JNCK_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8115
|
+
id: group.section?.id ?? (sections.length > 0 ? chunk44CQ67GQ_js.UNGROUPED_SECTION_ID : chunk44CQ67GQ_js.DEFAULT_SECTION_GROUP_ID),
|
|
8390
8116
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8391
8117
|
slideIndexes: group.slideIndexes,
|
|
8392
8118
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8398,7 +8124,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8398
8124
|
return void 0;
|
|
8399
8125
|
}
|
|
8400
8126
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8401
|
-
return
|
|
8127
|
+
return chunkK6R2JNCK_js.masterViewPseudoSlide(document2, {
|
|
8402
8128
|
tab: "slides",
|
|
8403
8129
|
masterIndex: 0,
|
|
8404
8130
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8426,10 +8152,10 @@ function useDerivedSlideState(input) {
|
|
|
8426
8152
|
);
|
|
8427
8153
|
const slideSectionGroups = react.useMemo(
|
|
8428
8154
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8429
|
-
if (group.id ===
|
|
8155
|
+
if (group.id === chunk44CQ67GQ_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8430
8156
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8431
8157
|
}
|
|
8432
|
-
if (group.id ===
|
|
8158
|
+
if (group.id === chunk44CQ67GQ_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8433
8159
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8434
8160
|
}
|
|
8435
8161
|
return group;
|
|
@@ -8529,13 +8255,13 @@ function useAnnotationHandlers(input) {
|
|
|
8529
8255
|
}, [annotations, setMode, setSlides, history]);
|
|
8530
8256
|
const handleSetMode = react.useCallback(
|
|
8531
8257
|
(nextMode) => {
|
|
8532
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8258
|
+
if (mode === "present" && nextMode !== "present" && !chunkK6R2JNCK_js.mayLeaveSlideShow()) {
|
|
8533
8259
|
return;
|
|
8534
8260
|
}
|
|
8535
8261
|
if (nextMode === "present") {
|
|
8536
8262
|
presentation.enterPresentMode();
|
|
8537
8263
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8538
|
-
|
|
8264
|
+
chunkK6R2JNCK_js.stopAllPersistentAudio();
|
|
8539
8265
|
if (promptKeepInkAnnotations) {
|
|
8540
8266
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8541
8267
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8545,7 +8271,7 @@ function useAnnotationHandlers(input) {
|
|
|
8545
8271
|
}
|
|
8546
8272
|
} else {
|
|
8547
8273
|
if (mode === "present") {
|
|
8548
|
-
|
|
8274
|
+
chunkK6R2JNCK_js.stopAllPersistentAudio();
|
|
8549
8275
|
}
|
|
8550
8276
|
setMode(nextMode);
|
|
8551
8277
|
}
|
|
@@ -8609,13 +8335,13 @@ function useSerialize(input) {
|
|
|
8609
8335
|
let processedSlide = slide;
|
|
8610
8336
|
if (pendingEditId) {
|
|
8611
8337
|
const updatedElements = slide.elements.map((el) => {
|
|
8612
|
-
if (el.id !== pendingEditId || !
|
|
8338
|
+
if (el.id !== pendingEditId || !chunkK6R2JNCK_js.hasTextProperties(el)) {
|
|
8613
8339
|
return el;
|
|
8614
8340
|
}
|
|
8615
8341
|
return {
|
|
8616
8342
|
...el,
|
|
8617
8343
|
text: pendingEditText,
|
|
8618
|
-
textSegments:
|
|
8344
|
+
textSegments: chunkK6R2JNCK_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8619
8345
|
};
|
|
8620
8346
|
});
|
|
8621
8347
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8628,19 +8354,19 @@ function useSerialize(input) {
|
|
|
8628
8354
|
const pptxGuides = guides.map((g) => ({
|
|
8629
8355
|
id: g.id,
|
|
8630
8356
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8631
|
-
positionEmu:
|
|
8357
|
+
positionEmu: chunkK6R2JNCK_js.guidePxToEmu(g.position)
|
|
8632
8358
|
}));
|
|
8633
8359
|
return {
|
|
8634
8360
|
...processedSlide,
|
|
8635
8361
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8636
8362
|
};
|
|
8637
8363
|
});
|
|
8638
|
-
const slidesToSave =
|
|
8364
|
+
const slidesToSave = chunkK6R2JNCK_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8639
8365
|
const saveOptions = {
|
|
8640
8366
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8641
8367
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8642
8368
|
// slide-size edit reaches the file.
|
|
8643
|
-
slideSize:
|
|
8369
|
+
slideSize: chunkK6R2JNCK_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8644
8370
|
headerFooter,
|
|
8645
8371
|
presentationProperties,
|
|
8646
8372
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -8652,9 +8378,9 @@ function useSerialize(input) {
|
|
|
8652
8378
|
slideMasters,
|
|
8653
8379
|
notesMaster,
|
|
8654
8380
|
handoutMaster,
|
|
8655
|
-
...
|
|
8381
|
+
...chunkK6R2JNCK_js.embeddedFontSaveOptions(embedFonts)
|
|
8656
8382
|
};
|
|
8657
|
-
return
|
|
8383
|
+
return chunkK6R2JNCK_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8658
8384
|
}, [
|
|
8659
8385
|
slides,
|
|
8660
8386
|
templateElementsBySlideId,
|
|
@@ -8689,7 +8415,7 @@ function useRecoveryDetection(input) {
|
|
|
8689
8415
|
const onRestore = input.onRestore;
|
|
8690
8416
|
const openVersionHistory = input.openVersionHistory;
|
|
8691
8417
|
react.useEffect(() => {
|
|
8692
|
-
if (!
|
|
8418
|
+
if (!chunkK6R2JNCK_js.shouldProbeAutosaveRecovery({
|
|
8693
8419
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8694
8420
|
filePath,
|
|
8695
8421
|
loading,
|
|
@@ -8701,7 +8427,7 @@ function useRecoveryDetection(input) {
|
|
|
8701
8427
|
}
|
|
8702
8428
|
recoveryCheckedRef.current = true;
|
|
8703
8429
|
void (async () => {
|
|
8704
|
-
const offer = await
|
|
8430
|
+
const offer = await chunkK6R2JNCK_js.probeAutosaveRecovery(filePath);
|
|
8705
8431
|
if (!offer) {
|
|
8706
8432
|
return;
|
|
8707
8433
|
}
|
|
@@ -8714,7 +8440,7 @@ function useRecoveryDetection(input) {
|
|
|
8714
8440
|
const record = recordRef.current;
|
|
8715
8441
|
setPrompt(null);
|
|
8716
8442
|
if (record && onRestore) {
|
|
8717
|
-
onRestore(
|
|
8443
|
+
onRestore(chunkK6R2JNCK_js.acceptAutosaveRecovery(record));
|
|
8718
8444
|
}
|
|
8719
8445
|
recordRef.current = null;
|
|
8720
8446
|
}, [onRestore]);
|
|
@@ -8723,7 +8449,7 @@ function useRecoveryDetection(input) {
|
|
|
8723
8449
|
setPrompt(null);
|
|
8724
8450
|
recordRef.current = null;
|
|
8725
8451
|
if (record) {
|
|
8726
|
-
void
|
|
8452
|
+
void chunkK6R2JNCK_js.discardAutosaveRecovery(record);
|
|
8727
8453
|
}
|
|
8728
8454
|
}, []);
|
|
8729
8455
|
return { prompt, restore, discard };
|
|
@@ -8762,11 +8488,11 @@ function usePresentationSetup(input) {
|
|
|
8762
8488
|
containerRef,
|
|
8763
8489
|
content,
|
|
8764
8490
|
onSetMode: (nextMode) => {
|
|
8765
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8491
|
+
if (mode === "present" && nextMode !== "present" && !chunkK6R2JNCK_js.mayLeaveSlideShow()) {
|
|
8766
8492
|
return;
|
|
8767
8493
|
}
|
|
8768
8494
|
if (mode === "present" && nextMode !== "present") {
|
|
8769
|
-
|
|
8495
|
+
chunkK6R2JNCK_js.stopAllPersistentAudio();
|
|
8770
8496
|
stopAnimationSound();
|
|
8771
8497
|
const exitHandler = exitModeHandlerRef.current;
|
|
8772
8498
|
if (exitHandler) {
|
|
@@ -8828,10 +8554,10 @@ function usePresentationSetup(input) {
|
|
|
8828
8554
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8829
8555
|
onToggleSubtitles,
|
|
8830
8556
|
onSaveRehearsalTimings: (timings) => {
|
|
8831
|
-
setSlides((prev) =>
|
|
8557
|
+
setSlides((prev) => chunkK6R2JNCK_js.applyRehearsalTimings(prev, timings));
|
|
8832
8558
|
history.markDirty();
|
|
8833
8559
|
},
|
|
8834
|
-
loopContinuously:
|
|
8560
|
+
loopContinuously: chunkK6R2JNCK_js.shouldLoopContinuously(presentationProperties),
|
|
8835
8561
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8836
8562
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8837
8563
|
endWithBlackSlide
|
|
@@ -9032,7 +8758,7 @@ function useEditorOperations(input) {
|
|
|
9032
8758
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9033
8759
|
react.useEffect(() => {
|
|
9034
8760
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9035
|
-
copiedFormatRef.current =
|
|
8761
|
+
copiedFormatRef.current = chunkK6R2JNCK_js.copyFormatFromElement(selectedElement);
|
|
9036
8762
|
} else if (!formatPainterActive) {
|
|
9037
8763
|
copiedFormatRef.current = null;
|
|
9038
8764
|
}
|
|
@@ -9058,12 +8784,12 @@ function useEditorOperations(input) {
|
|
|
9058
8784
|
e.stopPropagation();
|
|
9059
8785
|
const element = elementLookup.get(elementId);
|
|
9060
8786
|
if (element) {
|
|
9061
|
-
const updated =
|
|
8787
|
+
const updated = chunkK6R2JNCK_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9062
8788
|
const updates = {};
|
|
9063
|
-
if (
|
|
8789
|
+
if (chunkK6R2JNCK_js.hasShapeProperties(updated)) {
|
|
9064
8790
|
updates.shapeStyle = updated.shapeStyle;
|
|
9065
8791
|
}
|
|
9066
|
-
if (
|
|
8792
|
+
if (chunkK6R2JNCK_js.hasTextProperties(updated)) {
|
|
9067
8793
|
updates.textStyle = updated.textStyle;
|
|
9068
8794
|
}
|
|
9069
8795
|
ops.updateElementById(elementId, updates);
|
|
@@ -9181,28 +8907,6 @@ function useIOHandlers(input) {
|
|
|
9181
8907
|
});
|
|
9182
8908
|
return { exportHandlers, printHandlers, themeHandlers, propertyHandlers };
|
|
9183
8909
|
}
|
|
9184
|
-
var GOOGLE_FONTS_AVAILABLE = {
|
|
9185
|
-
"Atkinson Hyperlegible": "Atkinson+Hyperlegible:wght@400;700",
|
|
9186
|
-
Roboto: "Roboto:wght@400;700",
|
|
9187
|
-
"Open Sans": "Open+Sans:wght@400;700",
|
|
9188
|
-
Lato: "Lato:wght@400;700",
|
|
9189
|
-
Montserrat: "Montserrat:wght@400;700",
|
|
9190
|
-
Poppins: "Poppins:wght@400;700",
|
|
9191
|
-
Raleway: "Raleway:wght@400;700",
|
|
9192
|
-
Nunito: "Nunito:wght@400;700",
|
|
9193
|
-
"Playfair Display": "Playfair+Display:wght@400;700",
|
|
9194
|
-
"Source Sans Pro": "Source+Sans+Pro:wght@400;700",
|
|
9195
|
-
"PT Sans": "PT+Sans:wght@400;700",
|
|
9196
|
-
Merriweather: "Merriweather:wght@400;700",
|
|
9197
|
-
Ubuntu: "Ubuntu:wght@400;700",
|
|
9198
|
-
Oswald: "Oswald:wght@400;700",
|
|
9199
|
-
"Noto Sans": "Noto+Sans:wght@400;700",
|
|
9200
|
-
"Fira Sans": "Fira+Sans:wght@400;700",
|
|
9201
|
-
Inter: "Inter:wght@400;700",
|
|
9202
|
-
"Work Sans": "Work+Sans:wght@400;700",
|
|
9203
|
-
Quicksand: "Quicksand:wght@400;700",
|
|
9204
|
-
Cabin: "Cabin:wght@400;700"
|
|
9205
|
-
};
|
|
9206
8910
|
var EMBEDDED_FONTS_STYLE_ID = "pptx-embedded-fonts";
|
|
9207
8911
|
var GOOGLE_FONTS_LINK_ID = "pptx-google-fonts";
|
|
9208
8912
|
var SYMBOL_FONTS_STYLE_ID = "pptx-symbol-font-fallback";
|
|
@@ -9213,21 +8917,6 @@ var SYMBOL_FONT_FAMILIES = [
|
|
|
9213
8917
|
"Symbol",
|
|
9214
8918
|
"Webdings"
|
|
9215
8919
|
];
|
|
9216
|
-
function collectReferencedFontFamilies(slides) {
|
|
9217
|
-
const families = /* @__PURE__ */ new Set();
|
|
9218
|
-
for (const slide of slides) {
|
|
9219
|
-
for (const el of slide.elements) {
|
|
9220
|
-
if (chunkYDEEINER_js.hasTextProperties(el) && el.textSegments) {
|
|
9221
|
-
for (const seg of el.textSegments) {
|
|
9222
|
-
if (seg.style.fontFamily) {
|
|
9223
|
-
families.add(seg.style.fontFamily);
|
|
9224
|
-
}
|
|
9225
|
-
}
|
|
9226
|
-
}
|
|
9227
|
-
}
|
|
9228
|
-
}
|
|
9229
|
-
return families;
|
|
9230
|
-
}
|
|
9231
8920
|
var FONT_NAME_UNSAFE_CHARS = /["\\\n\r;}<>]/u;
|
|
9232
8921
|
var FONT_FORMAT_ALLOWED = /* @__PURE__ */ new Set([
|
|
9233
8922
|
"truetype",
|
|
@@ -9286,33 +8975,31 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9286
8975
|
}
|
|
9287
8976
|
};
|
|
9288
8977
|
}, [embeddedFonts]);
|
|
9289
|
-
const referencedFamilies = react.useMemo(() => collectReferencedFontFamilies(slides), [slides]);
|
|
8978
|
+
const referencedFamilies = react.useMemo(() => chunkK6R2JNCK_js.collectReferencedFontFamilies(slides), [slides]);
|
|
9290
8979
|
react.useEffect(() => {
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
|
|
9294
|
-
|
|
9295
|
-
continue;
|
|
8980
|
+
let cancelled = false;
|
|
8981
|
+
void chunkK6R2JNCK_js.resolveGoogleWebfontHref(slides, embeddedFonts).then((href) => {
|
|
8982
|
+
if (cancelled) {
|
|
8983
|
+
return null;
|
|
9296
8984
|
}
|
|
9297
|
-
if (
|
|
9298
|
-
|
|
8985
|
+
if (!href || document.getElementById(GOOGLE_FONTS_LINK_ID)) {
|
|
8986
|
+
return null;
|
|
9299
8987
|
}
|
|
9300
|
-
|
|
9301
|
-
|
|
9302
|
-
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
linkEl.href = `https://fonts.googleapis.com/css2?${googleFamilies.map((f) => `family=${encodeURIComponent(GOOGLE_FONTS_AVAILABLE[f])}`).join("&")}&display=swap`;
|
|
9308
|
-
document.head.appendChild(linkEl);
|
|
8988
|
+
const linkEl = document.createElement("link");
|
|
8989
|
+
linkEl.id = GOOGLE_FONTS_LINK_ID;
|
|
8990
|
+
linkEl.rel = "stylesheet";
|
|
8991
|
+
linkEl.href = href;
|
|
8992
|
+
document.head.appendChild(linkEl);
|
|
8993
|
+
return href;
|
|
8994
|
+
});
|
|
9309
8995
|
return () => {
|
|
8996
|
+
cancelled = true;
|
|
9310
8997
|
const existing = document.getElementById(GOOGLE_FONTS_LINK_ID);
|
|
9311
8998
|
if (existing) {
|
|
9312
8999
|
document.head.removeChild(existing);
|
|
9313
9000
|
}
|
|
9314
9001
|
};
|
|
9315
|
-
}, [embeddedFonts,
|
|
9002
|
+
}, [embeddedFonts, slides]);
|
|
9316
9003
|
react.useEffect(() => {
|
|
9317
9004
|
const neededSymbolFonts = SYMBOL_FONT_FAMILIES.filter((f) => referencedFamilies.has(f));
|
|
9318
9005
|
if (neededSymbolFonts.length === 0) {
|
|
@@ -9467,7 +9154,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9467
9154
|
inputRef.current = input;
|
|
9468
9155
|
const handleKeyDown = react.useCallback((e) => {
|
|
9469
9156
|
const current = inputRef.current;
|
|
9470
|
-
const { action, dx, dy } =
|
|
9157
|
+
const { action, dx, dy } = chunkK6R2JNCK_js.mapEditorKey(e, {
|
|
9471
9158
|
canEdit: current.canEdit,
|
|
9472
9159
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9473
9160
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9480,7 +9167,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9480
9167
|
hasSelection: current.hasSelection,
|
|
9481
9168
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9482
9169
|
isDrawing: current.activeTool !== "select",
|
|
9483
|
-
isTextInputTarget:
|
|
9170
|
+
isTextInputTarget: chunkK6R2JNCK_js.isEditorTextInputTarget(e.target)
|
|
9484
9171
|
});
|
|
9485
9172
|
if (action === null) {
|
|
9486
9173
|
return;
|
|
@@ -9791,7 +9478,7 @@ function useViewerIntegration(input) {
|
|
|
9791
9478
|
return zoom.scale;
|
|
9792
9479
|
},
|
|
9793
9480
|
setZoom(level) {
|
|
9794
|
-
zoom.setScale(
|
|
9481
|
+
zoom.setScale(chunkK6R2JNCK_js.clampZoomScale(level));
|
|
9795
9482
|
},
|
|
9796
9483
|
zoomIn() {
|
|
9797
9484
|
zoom.handleZoomIn();
|
|
@@ -10007,7 +9694,7 @@ function useReducedMotion() {
|
|
|
10007
9694
|
}
|
|
10008
9695
|
function useViewerOptions() {
|
|
10009
9696
|
const storeRef = react.useRef(null);
|
|
10010
|
-
storeRef.current ??=
|
|
9697
|
+
storeRef.current ??= chunkK6R2JNCK_js.createViewerOptionsStore();
|
|
10011
9698
|
const store = storeRef.current;
|
|
10012
9699
|
const options = react.useSyncExternalStore(
|
|
10013
9700
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -10016,9 +9703,9 @@ function useViewerOptions() {
|
|
|
10016
9703
|
);
|
|
10017
9704
|
return { optionsStore: store, options };
|
|
10018
9705
|
}
|
|
10019
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9706
|
+
var KNOWN_TAB_IDS = new Set(chunkK6R2JNCK_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10020
9707
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
10021
|
-
const isHidden = (id) =>
|
|
9708
|
+
const isHidden = (id) => chunkK6R2JNCK_js.isActionHidden(id, hiddenActions);
|
|
10022
9709
|
const userHidden = new Set(hiddenTabIds);
|
|
10023
9710
|
userHidden.delete("file");
|
|
10024
9711
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
|
|
@@ -10110,12 +9797,12 @@ function useYjsDocumentSync({
|
|
|
10110
9797
|
return;
|
|
10111
9798
|
}
|
|
10112
9799
|
try {
|
|
10113
|
-
const handler = new
|
|
9800
|
+
const handler = new chunkK6R2JNCK_js.PptxHandler();
|
|
10114
9801
|
await handler.load(sourceBytes.buffer);
|
|
10115
|
-
const currentSlides =
|
|
9802
|
+
const currentSlides = chunkK6R2JNCK_js.readSlidesFromYDoc(
|
|
10116
9803
|
doc
|
|
10117
9804
|
);
|
|
10118
|
-
const slidesToSave =
|
|
9805
|
+
const slidesToSave = chunkK6R2JNCK_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10119
9806
|
const bytes = await handler.save(slidesToSave);
|
|
10120
9807
|
config.onWriteBack(bytes);
|
|
10121
9808
|
} catch {
|
|
@@ -10130,10 +9817,10 @@ function useYjsDocumentSync({
|
|
|
10130
9817
|
if (!doc || !isConnected) {
|
|
10131
9818
|
return;
|
|
10132
9819
|
}
|
|
10133
|
-
const docSlides =
|
|
9820
|
+
const docSlides = chunkK6R2JNCK_js.readSlidesFromYDoc(
|
|
10134
9821
|
doc
|
|
10135
9822
|
);
|
|
10136
|
-
if (!
|
|
9823
|
+
if (!chunkK6R2JNCK_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10137
9824
|
return;
|
|
10138
9825
|
}
|
|
10139
9826
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10152,11 +9839,11 @@ function useYjsDocumentSync({
|
|
|
10152
9839
|
lastSyncedRef.current = serialized;
|
|
10153
9840
|
void (async () => {
|
|
10154
9841
|
const factories = await getFactories();
|
|
10155
|
-
|
|
9842
|
+
chunkK6R2JNCK_js.reconcileSlidesInYDoc(
|
|
10156
9843
|
slides,
|
|
10157
9844
|
doc,
|
|
10158
9845
|
factories,
|
|
10159
|
-
|
|
9846
|
+
chunkK6R2JNCK_js.LOCAL_SYNC_ORIGIN
|
|
10160
9847
|
);
|
|
10161
9848
|
scheduleWriteBack();
|
|
10162
9849
|
})();
|
|
@@ -10170,10 +9857,10 @@ function useYjsDocumentSync({
|
|
|
10170
9857
|
return;
|
|
10171
9858
|
}
|
|
10172
9859
|
const handleChange = (_events, transaction) => {
|
|
10173
|
-
if (transaction?.origin ===
|
|
9860
|
+
if (transaction?.origin === chunkK6R2JNCK_js.LOCAL_SYNC_ORIGIN) {
|
|
10174
9861
|
return;
|
|
10175
9862
|
}
|
|
10176
|
-
const remoteSlides =
|
|
9863
|
+
const remoteSlides = chunkK6R2JNCK_js.readSlidesFromYDoc(
|
|
10177
9864
|
doc
|
|
10178
9865
|
);
|
|
10179
9866
|
if (remoteSlides.length === 0) {
|
|
@@ -10189,7 +9876,7 @@ function useYjsDocumentSync({
|
|
|
10189
9876
|
isApplyingRemoteRef.current = false;
|
|
10190
9877
|
scheduleWriteBack();
|
|
10191
9878
|
};
|
|
10192
|
-
const unobserve =
|
|
9879
|
+
const unobserve = chunkK6R2JNCK_js.observeYDocSlides(
|
|
10193
9880
|
doc,
|
|
10194
9881
|
handleChange
|
|
10195
9882
|
);
|
|
@@ -10227,7 +9914,7 @@ function useBroadcastFollower({
|
|
|
10227
9914
|
if (!broadcaster) {
|
|
10228
9915
|
return;
|
|
10229
9916
|
}
|
|
10230
|
-
if (!
|
|
9917
|
+
if (!chunkK6R2JNCK_js.shouldAutoFollowBroadcaster({
|
|
10231
9918
|
localRole: collab.config.role,
|
|
10232
9919
|
broadcasterRole: broadcaster.role
|
|
10233
9920
|
})) {
|
|
@@ -10398,7 +10085,7 @@ function subscribeTouchCapability(callback) {
|
|
|
10398
10085
|
function useIsMobile() {
|
|
10399
10086
|
const isTouchDevice = react.useSyncExternalStore(
|
|
10400
10087
|
subscribeTouchCapability,
|
|
10401
|
-
|
|
10088
|
+
chunkK6R2JNCK_js.detectTouchDevice,
|
|
10402
10089
|
() => false
|
|
10403
10090
|
// server snapshot
|
|
10404
10091
|
);
|
|
@@ -10408,7 +10095,7 @@ function useIsMobile() {
|
|
|
10408
10095
|
const [viewportHeight, setViewportHeight] = react.useState(
|
|
10409
10096
|
() => typeof window === "undefined" ? 768 : window.innerHeight
|
|
10410
10097
|
);
|
|
10411
|
-
const [orientation, setOrientation] = react.useState(
|
|
10098
|
+
const [orientation, setOrientation] = react.useState(chunkK6R2JNCK_js.detectOrientation);
|
|
10412
10099
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
10413
10100
|
const [initialViewportHeight] = react.useState(
|
|
10414
10101
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -10429,7 +10116,7 @@ function useIsMobile() {
|
|
|
10429
10116
|
return;
|
|
10430
10117
|
}
|
|
10431
10118
|
const handleOrientationChange = () => {
|
|
10432
|
-
setOrientation(
|
|
10119
|
+
setOrientation(chunkK6R2JNCK_js.detectOrientation());
|
|
10433
10120
|
};
|
|
10434
10121
|
if (screen.orientation) {
|
|
10435
10122
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -10459,7 +10146,7 @@ function useIsMobile() {
|
|
|
10459
10146
|
window.addEventListener("resize", handleResize);
|
|
10460
10147
|
return () => window.removeEventListener("resize", handleResize);
|
|
10461
10148
|
}, [isTouchDevice, initialViewportHeight]);
|
|
10462
|
-
const { isMobile, isTablet, isDesktop } =
|
|
10149
|
+
const { isMobile, isTablet, isDesktop } = chunkK6R2JNCK_js.deriveViewportBreakpoints(
|
|
10463
10150
|
viewportWidth,
|
|
10464
10151
|
viewportHeight,
|
|
10465
10152
|
isTouchDevice
|
|
@@ -10490,10 +10177,10 @@ function useTouchGestures(input) {
|
|
|
10490
10177
|
if (!el || !enabled) {
|
|
10491
10178
|
return;
|
|
10492
10179
|
}
|
|
10493
|
-
const recognizer =
|
|
10180
|
+
const recognizer = chunkK6R2JNCK_js.createTouchGestureRecognizer({
|
|
10494
10181
|
getScale: () => scaleRef.current,
|
|
10495
|
-
minScale:
|
|
10496
|
-
maxScale:
|
|
10182
|
+
minScale: chunkK6R2JNCK_js.MIN_ZOOM_SCALE,
|
|
10183
|
+
maxScale: chunkK6R2JNCK_js.MAX_ZOOM_SCALE,
|
|
10497
10184
|
callbacks: {
|
|
10498
10185
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10499
10186
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10533,7 +10220,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10533
10220
|
return;
|
|
10534
10221
|
}
|
|
10535
10222
|
const rect = active.getBoundingClientRect();
|
|
10536
|
-
const delta =
|
|
10223
|
+
const delta = chunkK6R2JNCK_js.computeScrollDelta(
|
|
10537
10224
|
{ top: rect.top, bottom: rect.bottom },
|
|
10538
10225
|
window.innerHeight,
|
|
10539
10226
|
keyboardInset
|
|
@@ -10553,8 +10240,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10553
10240
|
return;
|
|
10554
10241
|
}
|
|
10555
10242
|
const update = () => {
|
|
10556
|
-
const metrics =
|
|
10557
|
-
const inset = metrics ?
|
|
10243
|
+
const metrics = chunkK6R2JNCK_js.readViewportMetrics(window);
|
|
10244
|
+
const inset = metrics ? chunkK6R2JNCK_js.computeKeyboardInset(metrics) : 0;
|
|
10558
10245
|
setKeyboardInset(inset);
|
|
10559
10246
|
if (inset > 0) {
|
|
10560
10247
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10565,8 +10252,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10565
10252
|
vv.addEventListener("scroll", update);
|
|
10566
10253
|
const onFocusIn = () => {
|
|
10567
10254
|
window.requestAnimationFrame(() => {
|
|
10568
|
-
const metrics =
|
|
10569
|
-
const inset = metrics ?
|
|
10255
|
+
const metrics = chunkK6R2JNCK_js.readViewportMetrics(window);
|
|
10256
|
+
const inset = metrics ? chunkK6R2JNCK_js.computeKeyboardInset(metrics) : 0;
|
|
10570
10257
|
if (inset > 0) {
|
|
10571
10258
|
scrollFocusedIntoView(inset);
|
|
10572
10259
|
}
|
|
@@ -10579,7 +10266,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10579
10266
|
document.removeEventListener("focusin", onFocusIn);
|
|
10580
10267
|
};
|
|
10581
10268
|
}, [enabled]);
|
|
10582
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10269
|
+
return { keyboardInset, isKeyboardOpen: chunkK6R2JNCK_js.isKeyboardOpen(keyboardInset) };
|
|
10583
10270
|
}
|
|
10584
10271
|
|
|
10585
10272
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10608,21 +10295,21 @@ function buildCanvasProps(input) {
|
|
|
10608
10295
|
} = input;
|
|
10609
10296
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10610
10297
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10611
|
-
const fieldContext =
|
|
10298
|
+
const fieldContext = chunkK6R2JNCK_js.buildFieldSubstitutionContext({
|
|
10612
10299
|
headerFooter: s.headerFooter,
|
|
10613
10300
|
customProperties: s.customProperties,
|
|
10614
10301
|
slide: activeSlide
|
|
10615
10302
|
});
|
|
10616
10303
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10617
10304
|
const openExternalUrl = (url) => {
|
|
10618
|
-
if (
|
|
10305
|
+
if (chunkK6R2JNCK_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
10619
10306
|
return;
|
|
10620
10307
|
}
|
|
10621
|
-
|
|
10308
|
+
chunkK6R2JNCK_js.safeOpenUrl(url);
|
|
10622
10309
|
};
|
|
10623
10310
|
const handleActionClick = (_elementId, action) => {
|
|
10624
10311
|
if (mode === "present") {
|
|
10625
|
-
const resolved =
|
|
10312
|
+
const resolved = chunkK6R2JNCK_js.resolvePresentationAction(action, { slideCount: slides.length });
|
|
10626
10313
|
if (resolved.intent.kind === "openUrl") {
|
|
10627
10314
|
openExternalUrl(resolved.intent.url);
|
|
10628
10315
|
return;
|
|
@@ -10633,9 +10320,9 @@ function buildCanvasProps(input) {
|
|
|
10633
10320
|
}
|
|
10634
10321
|
};
|
|
10635
10322
|
const handleHyperlinkClick = (url) => {
|
|
10636
|
-
if (
|
|
10323
|
+
if (chunkK6R2JNCK_js.isPpactionUrl(url)) {
|
|
10637
10324
|
if (mode === "present") {
|
|
10638
|
-
const parsed =
|
|
10325
|
+
const parsed = chunkK6R2JNCK_js.parsePpactionUrl(url);
|
|
10639
10326
|
if (parsed) {
|
|
10640
10327
|
presentation.handlePresentationAction({
|
|
10641
10328
|
action: parsed.action,
|
|
@@ -10741,7 +10428,7 @@ function buildCanvasProps(input) {
|
|
|
10741
10428
|
|
|
10742
10429
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10743
10430
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10744
|
-
return
|
|
10431
|
+
return chunkK6R2JNCK_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10745
10432
|
}
|
|
10746
10433
|
|
|
10747
10434
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10754,7 +10441,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10754
10441
|
const current = activeSlide.animations ?? [];
|
|
10755
10442
|
if (group === "motionPath") {
|
|
10756
10443
|
propertyHandlers.handleUpdateSlide({
|
|
10757
|
-
animations:
|
|
10444
|
+
animations: chunkK6R2JNCK_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10758
10445
|
});
|
|
10759
10446
|
return;
|
|
10760
10447
|
}
|
|
@@ -10948,7 +10635,7 @@ function buildToolbarProps(input) {
|
|
|
10948
10635
|
onOpenFile,
|
|
10949
10636
|
onOpenRecentFile,
|
|
10950
10637
|
onCreatePresentation: (templateId) => {
|
|
10951
|
-
s.setSlides(
|
|
10638
|
+
s.setSlides(chunkK6R2JNCK_js.createBackstagePresentation(templateId));
|
|
10952
10639
|
s.setActiveSlideIndex(0);
|
|
10953
10640
|
s.setSelectedElementId(null);
|
|
10954
10641
|
s.setSelectedElementIds([]);
|
|
@@ -10977,7 +10664,7 @@ function buildToolbarProps(input) {
|
|
|
10977
10664
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
10978
10665
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10979
10666
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10980
|
-
templateScheme:
|
|
10667
|
+
templateScheme: chunkK6R2JNCK_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10981
10668
|
customShows: s.customShows,
|
|
10982
10669
|
activeCustomShowId: s.activeCustomShowId,
|
|
10983
10670
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -11018,7 +10705,7 @@ function buildToolbarProps(input) {
|
|
|
11018
10705
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
11019
10706
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
11020
10707
|
formatPainterActive: s.formatPainterActive,
|
|
11021
|
-
canActivateFormatPainter:
|
|
10708
|
+
canActivateFormatPainter: chunkK6R2JNCK_js.hasCopyableFormat(selectedElement),
|
|
11022
10709
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
11023
10710
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
11024
10711
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11092,7 +10779,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11092
10779
|
headerFooter: state.headerFooter,
|
|
11093
10780
|
loading,
|
|
11094
10781
|
error,
|
|
11095
|
-
maxHistoryEntries:
|
|
10782
|
+
maxHistoryEntries: chunkK6R2JNCK_js.resolveHistoryDepth(viewerOptions),
|
|
11096
10783
|
hasActivePointerInteraction,
|
|
11097
10784
|
pointerCommitNonce: state.pointerCommitNonce,
|
|
11098
10785
|
setSlides: state.setSlides,
|
|
@@ -11157,7 +10844,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11157
10844
|
gridSpacingPx,
|
|
11158
10845
|
// Multiplied against the pre-existing 2x baseline; see the matching
|
|
11159
10846
|
// comment in `PowerPointViewer.tsx`.
|
|
11160
|
-
imageExportScale: 2 *
|
|
10847
|
+
imageExportScale: 2 * chunkK6R2JNCK_js.resolveImageResolutionScale(viewerOptions),
|
|
11161
10848
|
viewerOptions
|
|
11162
10849
|
};
|
|
11163
10850
|
}
|
|
@@ -11327,7 +11014,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11327
11014
|
}, [incomingContent]);
|
|
11328
11015
|
const onOpenFile = react.useCallback(() => {
|
|
11329
11016
|
void (async () => {
|
|
11330
|
-
const picked = await
|
|
11017
|
+
const picked = await chunkK6R2JNCK_js.openPptxFile();
|
|
11331
11018
|
if (picked) {
|
|
11332
11019
|
setContent(picked.buffer);
|
|
11333
11020
|
}
|
|
@@ -11335,7 +11022,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11335
11022
|
}, []);
|
|
11336
11023
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11337
11024
|
void (async () => {
|
|
11338
|
-
const bytes = await
|
|
11025
|
+
const bytes = await chunkK6R2JNCK_js.readBackstageRecentFile(key);
|
|
11339
11026
|
if (bytes) {
|
|
11340
11027
|
setContent(bytes);
|
|
11341
11028
|
}
|