pptx-react-viewer 3.1.1 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/{AiChatPanel-6PERJN7M.js → AiChatPanel-4EYZDQXM.js} +24 -24
- package/dist/AiChatPanel-4EYZDQXM.js.br +0 -0
- package/dist/AiChatPanel-4EYZDQXM.js.gz +0 -0
- package/dist/{AiChatPanel-EIENGCKW.mjs → AiChatPanel-UCFQIWOQ.mjs} +4 -4
- package/dist/AiChatPanel-UCFQIWOQ.mjs.br +0 -0
- package/dist/AiChatPanel-UCFQIWOQ.mjs.gz +0 -0
- package/dist/{Area3DChartScene-W6SVC235.mjs → Area3DChartScene-PMYXO4MR.mjs} +1 -1
- package/dist/Area3DChartScene-PMYXO4MR.mjs.br +0 -0
- package/dist/Area3DChartScene-PMYXO4MR.mjs.gz +0 -0
- package/dist/{Area3DChartScene-TXCLQLBQ.js → Area3DChartScene-YBMC6NKY.js} +2 -2
- package/dist/Area3DChartScene-YBMC6NKY.js.br +0 -0
- package/dist/Area3DChartScene-YBMC6NKY.js.gz +0 -0
- package/dist/{Bar3DChartScene-6RHPFLZT.js → Bar3DChartScene-75DCA2ZA.js} +2 -2
- package/dist/Bar3DChartScene-75DCA2ZA.js.br +0 -0
- package/dist/Bar3DChartScene-75DCA2ZA.js.gz +0 -0
- package/dist/{Bar3DChartScene-FCVUZIJ3.mjs → Bar3DChartScene-CEOI6SU6.mjs} +1 -1
- package/dist/Bar3DChartScene-CEOI6SU6.mjs.br +0 -0
- package/dist/Bar3DChartScene-CEOI6SU6.mjs.gz +0 -0
- package/dist/{Line3DChartScene-MJXFXSPW.mjs → Line3DChartScene-EZZKWUZR.mjs} +1 -1
- package/dist/Line3DChartScene-EZZKWUZR.mjs.br +0 -0
- package/dist/Line3DChartScene-EZZKWUZR.mjs.gz +0 -0
- package/dist/{Line3DChartScene-2ZFE53KO.js → Line3DChartScene-STGX6N6V.js} +2 -2
- package/dist/Line3DChartScene-STGX6N6V.js.br +0 -0
- package/dist/Line3DChartScene-STGX6N6V.js.gz +0 -0
- package/dist/{Model3DScene-7VQNRY5B.js → Model3DScene-DWRD63FH.js} +2 -2
- package/dist/Model3DScene-DWRD63FH.js.br +0 -0
- package/dist/Model3DScene-DWRD63FH.js.gz +0 -0
- package/dist/{Model3DScene-A5RV3KNJ.mjs → Model3DScene-FGQJKWL6.mjs} +1 -1
- package/dist/Model3DScene-FGQJKWL6.mjs.br +0 -0
- package/dist/Model3DScene-FGQJKWL6.mjs.gz +0 -0
- package/dist/{PieChart3DScene-UEVFZZVW.mjs → PieChart3DScene-DH6RSJO6.mjs} +1 -1
- package/dist/PieChart3DScene-DH6RSJO6.mjs.br +0 -0
- package/dist/PieChart3DScene-DH6RSJO6.mjs.gz +0 -0
- package/dist/{PieChart3DScene-JTHZESS3.js → PieChart3DScene-R3Y7OVVO.js} +2 -2
- package/dist/PieChart3DScene-R3Y7OVVO.js.br +0 -0
- package/dist/PieChart3DScene-R3Y7OVVO.js.gz +0 -0
- package/dist/PowerPointViewer-Cl6jBPNw.d.ts.map +1 -1
- package/dist/{SurfaceChart3DScene-WD65PAG4.mjs → SurfaceChart3DScene-BMBU5RKI.mjs} +1 -1
- package/dist/SurfaceChart3DScene-BMBU5RKI.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-BMBU5RKI.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-FXUNT5OK.js → SurfaceChart3DScene-UM5HA3VO.js} +2 -2
- package/dist/SurfaceChart3DScene-UM5HA3VO.js.br +0 -0
- package/dist/SurfaceChart3DScene-UM5HA3VO.js.gz +0 -0
- package/dist/{chunk-GCE2TYHF.js → chunk-2HLDBQH7.js} +157 -157
- package/dist/chunk-2HLDBQH7.js.br +0 -0
- package/dist/chunk-2HLDBQH7.js.gz +0 -0
- package/dist/{chunk-MAOUVROK.mjs → chunk-4VVOTEQ4.mjs} +359 -336
- package/dist/chunk-4VVOTEQ4.mjs.br +0 -0
- package/dist/chunk-4VVOTEQ4.mjs.gz +0 -0
- package/dist/{chunk-IDTNKL4S.js → chunk-7ZQ2FZXE.js} +300 -45
- package/dist/chunk-7ZQ2FZXE.js.br +0 -0
- package/dist/chunk-7ZQ2FZXE.js.gz +0 -0
- package/dist/{chunk-MKPSUHUH.mjs → chunk-ARJE3V6V.mjs} +5 -6
- package/dist/chunk-ARJE3V6V.mjs.br +0 -0
- package/dist/chunk-ARJE3V6V.mjs.gz +0 -0
- package/dist/{chunk-GIFQWIW5.js → chunk-MQEG5GOV.js} +1339 -1212
- package/dist/chunk-MQEG5GOV.js.br +0 -0
- package/dist/chunk-MQEG5GOV.js.gz +0 -0
- package/dist/{chunk-5ERW2B25.mjs → chunk-O5DKWJDK.mjs} +1 -1
- package/dist/chunk-O5DKWJDK.mjs.br +0 -0
- package/dist/chunk-O5DKWJDK.mjs.gz +0 -0
- package/dist/{chunk-ISDTM2V3.mjs → chunk-S546O4W2.mjs} +286 -45
- package/dist/chunk-S546O4W2.mjs.br +0 -0
- package/dist/chunk-S546O4W2.mjs.gz +0 -0
- package/dist/{chunk-PIUB7R2K.js → chunk-SWRY3SI5.js} +5 -6
- package/dist/chunk-SWRY3SI5.js.br +0 -0
- package/dist/chunk-SWRY3SI5.js.gz +0 -0
- package/dist/{chunk-ICAYXQVJ.mjs → chunk-VLLZ3QL2.mjs} +260 -133
- package/dist/chunk-VLLZ3QL2.mjs.br +0 -0
- package/dist/chunk-VLLZ3QL2.mjs.gz +0 -0
- package/dist/{chunk-OUX4O5XK.mjs → chunk-W3J6SNVE.mjs} +2 -2
- package/dist/chunk-W3J6SNVE.mjs.br +0 -0
- package/dist/chunk-W3J6SNVE.mjs.gz +0 -0
- package/dist/{chunk-OTBQBTTQ.js → chunk-WVIKFMNS.js} +725 -704
- package/dist/chunk-WVIKFMNS.js.br +0 -0
- package/dist/chunk-WVIKFMNS.js.gz +0 -0
- package/dist/{chunk-OZGFMZEX.js → chunk-YNUYFR2T.js} +3 -3
- package/dist/chunk-YNUYFR2T.js.br +0 -0
- package/dist/chunk-YNUYFR2T.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 +27 -1
- package/dist/index.d.ts.map +1 -1
- 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 +99 -22
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{useViewerBuildingBlocks-DC1O_op4.d.ts → useViewerBuildingBlocks-X1L8BjsQ.d.ts} +19 -2
- package/dist/useViewerBuildingBlocks-X1L8BjsQ.d.ts.map +1 -0
- 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-6PERJN7M.js.br +0 -0
- package/dist/AiChatPanel-6PERJN7M.js.gz +0 -0
- package/dist/AiChatPanel-EIENGCKW.mjs.br +0 -0
- package/dist/AiChatPanel-EIENGCKW.mjs.gz +0 -0
- package/dist/Area3DChartScene-TXCLQLBQ.js.br +0 -0
- package/dist/Area3DChartScene-TXCLQLBQ.js.gz +0 -0
- package/dist/Area3DChartScene-W6SVC235.mjs.br +0 -0
- package/dist/Area3DChartScene-W6SVC235.mjs.gz +0 -0
- package/dist/Bar3DChartScene-6RHPFLZT.js.br +0 -0
- package/dist/Bar3DChartScene-6RHPFLZT.js.gz +0 -0
- package/dist/Bar3DChartScene-FCVUZIJ3.mjs.br +0 -0
- package/dist/Bar3DChartScene-FCVUZIJ3.mjs.gz +0 -0
- package/dist/Line3DChartScene-2ZFE53KO.js.br +0 -0
- package/dist/Line3DChartScene-2ZFE53KO.js.gz +0 -0
- package/dist/Line3DChartScene-MJXFXSPW.mjs.br +0 -0
- package/dist/Line3DChartScene-MJXFXSPW.mjs.gz +0 -0
- package/dist/Model3DScene-7VQNRY5B.js.br +0 -0
- package/dist/Model3DScene-7VQNRY5B.js.gz +0 -0
- package/dist/Model3DScene-A5RV3KNJ.mjs.br +0 -0
- package/dist/Model3DScene-A5RV3KNJ.mjs.gz +0 -0
- package/dist/PieChart3DScene-JTHZESS3.js.br +0 -0
- package/dist/PieChart3DScene-JTHZESS3.js.gz +0 -0
- package/dist/PieChart3DScene-UEVFZZVW.mjs.br +0 -0
- package/dist/PieChart3DScene-UEVFZZVW.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-FXUNT5OK.js.br +0 -0
- package/dist/SurfaceChart3DScene-FXUNT5OK.js.gz +0 -0
- package/dist/SurfaceChart3DScene-WD65PAG4.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-WD65PAG4.mjs.gz +0 -0
- package/dist/chunk-5ERW2B25.mjs.br +0 -0
- package/dist/chunk-5ERW2B25.mjs.gz +0 -0
- package/dist/chunk-GCE2TYHF.js.br +0 -0
- package/dist/chunk-GCE2TYHF.js.gz +0 -0
- package/dist/chunk-GIFQWIW5.js.br +0 -0
- package/dist/chunk-GIFQWIW5.js.gz +0 -0
- package/dist/chunk-ICAYXQVJ.mjs.br +0 -0
- package/dist/chunk-ICAYXQVJ.mjs.gz +0 -0
- package/dist/chunk-IDTNKL4S.js.br +0 -0
- package/dist/chunk-IDTNKL4S.js.gz +0 -0
- package/dist/chunk-ISDTM2V3.mjs.br +0 -0
- package/dist/chunk-ISDTM2V3.mjs.gz +0 -0
- package/dist/chunk-MAOUVROK.mjs.br +0 -0
- package/dist/chunk-MAOUVROK.mjs.gz +0 -0
- package/dist/chunk-MKPSUHUH.mjs.br +0 -0
- package/dist/chunk-MKPSUHUH.mjs.gz +0 -0
- package/dist/chunk-OTBQBTTQ.js.br +0 -0
- package/dist/chunk-OTBQBTTQ.js.gz +0 -0
- package/dist/chunk-OUX4O5XK.mjs.br +0 -0
- package/dist/chunk-OUX4O5XK.mjs.gz +0 -0
- package/dist/chunk-OZGFMZEX.js.br +0 -0
- package/dist/chunk-OZGFMZEX.js.gz +0 -0
- package/dist/chunk-PIUB7R2K.js.br +0 -0
- package/dist/chunk-PIUB7R2K.js.gz +0 -0
- package/dist/useViewerBuildingBlocks-DC1O_op4.d.ts.map +0 -1
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunk2HLDBQH7_js = require('./chunk-2HLDBQH7.js');
|
|
4
|
+
var chunkSWRY3SI5_js = require('./chunk-SWRY3SI5.js');
|
|
5
|
+
var chunk7ZQ2FZXE_js = require('./chunk-7ZQ2FZXE.js');
|
|
6
6
|
var react = require('react');
|
|
7
|
-
var JSZip = require('jszip');
|
|
8
7
|
var reactI18next = require('react-i18next');
|
|
9
8
|
|
|
10
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
|
|
12
|
-
var JSZip__default = /*#__PURE__*/_interopDefault(JSZip);
|
|
13
|
-
|
|
14
9
|
function useVirtualizedSlides({
|
|
15
10
|
totalItems,
|
|
16
11
|
itemHeight,
|
|
17
|
-
overscan =
|
|
12
|
+
overscan = chunk7ZQ2FZXE_js.DEFAULT_VIRTUAL_OVERSCAN
|
|
18
13
|
}) {
|
|
19
14
|
const scrollContainerRef = react.useRef(null);
|
|
20
15
|
const [scrollTop, setScrollTop] = react.useState(0);
|
|
@@ -44,7 +39,7 @@ function useVirtualizedSlides({
|
|
|
44
39
|
resizeObserver?.disconnect();
|
|
45
40
|
};
|
|
46
41
|
}, []);
|
|
47
|
-
const range =
|
|
42
|
+
const range = chunk7ZQ2FZXE_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
|
|
48
43
|
const safeItemHeight = Math.max(itemHeight, 1);
|
|
49
44
|
const scrollToIndex = react.useCallback(
|
|
50
45
|
(index, behavior = "smooth") => {
|
|
@@ -85,7 +80,7 @@ function usePresenceTracking({
|
|
|
85
80
|
}) {
|
|
86
81
|
const [remoteUsers, setRemoteUsers] = react.useState([]);
|
|
87
82
|
const projectorRef = react.useRef(null);
|
|
88
|
-
projectorRef.current ??=
|
|
83
|
+
projectorRef.current ??= chunk7ZQ2FZXE_js.createPresenceProjector();
|
|
89
84
|
const projector = projectorRef.current;
|
|
90
85
|
const lastBroadcastRef = react.useRef(0);
|
|
91
86
|
const pendingBroadcastRef = react.useRef(null);
|
|
@@ -110,7 +105,7 @@ function usePresenceTracking({
|
|
|
110
105
|
awareness.setLocalStateField("presence", state);
|
|
111
106
|
lastBroadcastRef.current = Date.now();
|
|
112
107
|
};
|
|
113
|
-
if (elapsed >=
|
|
108
|
+
if (elapsed >= chunk7ZQ2FZXE_js.BROADCAST_THROTTLE_MS) {
|
|
114
109
|
if (pendingBroadcastRef.current) {
|
|
115
110
|
clearTimeout(pendingBroadcastRef.current);
|
|
116
111
|
pendingBroadcastRef.current = null;
|
|
@@ -120,7 +115,7 @@ function usePresenceTracking({
|
|
|
120
115
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
121
116
|
pendingBroadcastRef.current = null;
|
|
122
117
|
flush();
|
|
123
|
-
},
|
|
118
|
+
}, chunk7ZQ2FZXE_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
124
119
|
}
|
|
125
120
|
},
|
|
126
121
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -200,7 +195,7 @@ function useYjsProvider({ config }) {
|
|
|
200
195
|
const departureRef = react.useRef(null);
|
|
201
196
|
const gateRef = react.useRef(null);
|
|
202
197
|
if (!gateRef.current) {
|
|
203
|
-
gateRef.current =
|
|
198
|
+
gateRef.current = chunk7ZQ2FZXE_js.createSyncGate(() => setSynced(true));
|
|
204
199
|
}
|
|
205
200
|
const teardown = react.useCallback(() => {
|
|
206
201
|
if (timeoutRef.current) {
|
|
@@ -220,7 +215,7 @@ function useYjsProvider({ config }) {
|
|
|
220
215
|
const buildCleanup = react.useCallback(
|
|
221
216
|
(provider, yDoc) => () => {
|
|
222
217
|
announceDeparture();
|
|
223
|
-
|
|
218
|
+
chunk7ZQ2FZXE_js.clearLocalAwareness(provider.awareness);
|
|
224
219
|
provider.destroy();
|
|
225
220
|
yDoc.destroy();
|
|
226
221
|
setDoc(null);
|
|
@@ -245,9 +240,9 @@ function useYjsProvider({ config }) {
|
|
|
245
240
|
if (config.authToken) {
|
|
246
241
|
opts.password = config.authToken;
|
|
247
242
|
}
|
|
248
|
-
const roomId =
|
|
243
|
+
const roomId = chunk7ZQ2FZXE_js.validateRoomId(config.roomId);
|
|
249
244
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
250
|
-
departureRef.current =
|
|
245
|
+
departureRef.current = chunk7ZQ2FZXE_js.createDepartureChannel(roomId, provider.awareness);
|
|
251
246
|
setDoc(yDoc);
|
|
252
247
|
setAwareness(provider.awareness);
|
|
253
248
|
setClientId(provider.awareness.clientID);
|
|
@@ -289,13 +284,13 @@ function useYjsProvider({ config }) {
|
|
|
289
284
|
if (!config) {
|
|
290
285
|
return;
|
|
291
286
|
}
|
|
292
|
-
const roomId =
|
|
293
|
-
const transport = config.transport ??
|
|
287
|
+
const roomId = chunk7ZQ2FZXE_js.validateRoomId(config.roomId);
|
|
288
|
+
const transport = config.transport ?? chunk7ZQ2FZXE_js.resolveTransportForServerUrl(config.serverUrl);
|
|
294
289
|
if (transport === "webrtc") {
|
|
295
290
|
await initWebrtc();
|
|
296
291
|
return;
|
|
297
292
|
}
|
|
298
|
-
if (
|
|
293
|
+
if (chunk7ZQ2FZXE_js.isMixedContentBlocked(config.serverUrl)) {
|
|
299
294
|
console.warn(
|
|
300
295
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
301
296
|
);
|
|
@@ -309,7 +304,7 @@ function useYjsProvider({ config }) {
|
|
|
309
304
|
const provider = new WebsocketProvider(config.serverUrl, roomId, yDoc, {
|
|
310
305
|
params: config.authToken ? { token: config.authToken } : void 0
|
|
311
306
|
});
|
|
312
|
-
departureRef.current =
|
|
307
|
+
departureRef.current = chunk7ZQ2FZXE_js.createDepartureChannel(roomId, provider.awareness);
|
|
313
308
|
let connected = false;
|
|
314
309
|
const handleStatus = (event) => {
|
|
315
310
|
if (event.status === "connected") {
|
|
@@ -349,7 +344,7 @@ function useYjsProvider({ config }) {
|
|
|
349
344
|
provider.off("status", handleStatus);
|
|
350
345
|
provider.off("sync", handleSynced);
|
|
351
346
|
announceDeparture();
|
|
352
|
-
|
|
347
|
+
chunk7ZQ2FZXE_js.clearLocalAwareness(provider.awareness);
|
|
353
348
|
provider.destroy();
|
|
354
349
|
yDoc.destroy();
|
|
355
350
|
setDoc(null);
|
|
@@ -358,7 +353,7 @@ function useYjsProvider({ config }) {
|
|
|
358
353
|
cleanupRef.current = null;
|
|
359
354
|
setStatus("error");
|
|
360
355
|
}
|
|
361
|
-
},
|
|
356
|
+
}, chunk7ZQ2FZXE_js.CONNECTION_TIMEOUT_MS);
|
|
362
357
|
}
|
|
363
358
|
setDoc(yDoc);
|
|
364
359
|
setAwareness(provider.awareness);
|
|
@@ -367,7 +362,7 @@ function useYjsProvider({ config }) {
|
|
|
367
362
|
provider.off("status", handleStatus);
|
|
368
363
|
provider.off("sync", handleSynced);
|
|
369
364
|
announceDeparture();
|
|
370
|
-
|
|
365
|
+
chunk7ZQ2FZXE_js.clearLocalAwareness(provider.awareness);
|
|
371
366
|
provider.destroy();
|
|
372
367
|
yDoc.destroy();
|
|
373
368
|
setDoc(null);
|
|
@@ -393,7 +388,7 @@ function useYjsProvider({ config }) {
|
|
|
393
388
|
]);
|
|
394
389
|
react.useEffect(() => {
|
|
395
390
|
init();
|
|
396
|
-
const disposeTeardown =
|
|
391
|
+
const disposeTeardown = chunk7ZQ2FZXE_js.registerCollaborationTeardown({
|
|
397
392
|
leave: teardown,
|
|
398
393
|
rejoin: init
|
|
399
394
|
});
|
|
@@ -414,7 +409,7 @@ function useCollaborativeState({
|
|
|
414
409
|
canvasWidth,
|
|
415
410
|
canvasHeight
|
|
416
411
|
}) {
|
|
417
|
-
const userColor =
|
|
412
|
+
const userColor = chunk7ZQ2FZXE_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
418
413
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
419
414
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
420
415
|
awareness,
|
|
@@ -532,8 +527,8 @@ function useEditorHistory(input) {
|
|
|
532
527
|
width: canvasSize.width,
|
|
533
528
|
height: canvasSize.height,
|
|
534
529
|
activeSlideIndex,
|
|
535
|
-
slides: slides.map(
|
|
536
|
-
templateElementsBySlideId:
|
|
530
|
+
slides: slides.map(chunk7ZQ2FZXE_js.cloneSlide),
|
|
531
|
+
templateElementsBySlideId: chunk7ZQ2FZXE_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
537
532
|
...actionLabel ? { actionLabel } : {}
|
|
538
533
|
};
|
|
539
534
|
},
|
|
@@ -546,9 +541,9 @@ function useEditorHistory(input) {
|
|
|
546
541
|
width: snapshot.width,
|
|
547
542
|
height: snapshot.height
|
|
548
543
|
});
|
|
549
|
-
setSlides(snapshot.slides.map(
|
|
544
|
+
setSlides(snapshot.slides.map(chunk7ZQ2FZXE_js.cloneSlide));
|
|
550
545
|
setTemplateElementsBySlideId(
|
|
551
|
-
|
|
546
|
+
chunk7ZQ2FZXE_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
552
547
|
);
|
|
553
548
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
554
549
|
setSelectedElementIds([]);
|
|
@@ -587,8 +582,8 @@ function useEditorHistory(input) {
|
|
|
587
582
|
const currentSnapshot = buildHistorySnapshot();
|
|
588
583
|
historyFutureRef.current.push(currentSnapshot);
|
|
589
584
|
isApplyingHistoryRef.current = true;
|
|
590
|
-
const nextSnapshot =
|
|
591
|
-
lastHistorySnapshotRef.current =
|
|
585
|
+
const nextSnapshot = chunk2HLDBQH7_js.cloneHistorySnapshot(previousSnapshot);
|
|
586
|
+
lastHistorySnapshotRef.current = chunk2HLDBQH7_js.cloneHistorySnapshot(nextSnapshot);
|
|
592
587
|
lastHistorySerializedRef.current = serializeDocument(nextSnapshot);
|
|
593
588
|
applyHistorySnapshot(nextSnapshot);
|
|
594
589
|
updateHistoryAvailability();
|
|
@@ -609,8 +604,8 @@ function useEditorHistory(input) {
|
|
|
609
604
|
const currentSnapshot = buildHistorySnapshot();
|
|
610
605
|
historyPastRef.current.push(currentSnapshot);
|
|
611
606
|
isApplyingHistoryRef.current = true;
|
|
612
|
-
const targetSnapshot =
|
|
613
|
-
lastHistorySnapshotRef.current =
|
|
607
|
+
const targetSnapshot = chunk2HLDBQH7_js.cloneHistorySnapshot(nextSnapshot);
|
|
608
|
+
lastHistorySnapshotRef.current = chunk2HLDBQH7_js.cloneHistorySnapshot(targetSnapshot);
|
|
614
609
|
lastHistorySerializedRef.current = serializeDocument(targetSnapshot);
|
|
615
610
|
applyHistorySnapshot(targetSnapshot);
|
|
616
611
|
updateHistoryAvailability();
|
|
@@ -628,7 +623,7 @@ function useEditorHistory(input) {
|
|
|
628
623
|
historyPastRef.current = [];
|
|
629
624
|
historyFutureRef.current = [];
|
|
630
625
|
if (initialSnapshot) {
|
|
631
|
-
const clonedInitial =
|
|
626
|
+
const clonedInitial = chunk2HLDBQH7_js.cloneHistorySnapshot(initialSnapshot);
|
|
632
627
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
633
628
|
lastHistorySerializedRef.current = serializeDocument(clonedInitial);
|
|
634
629
|
} else {
|
|
@@ -676,19 +671,19 @@ function useEditorHistory(input) {
|
|
|
676
671
|
}
|
|
677
672
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
678
673
|
if (!previousSnapshot) {
|
|
679
|
-
lastHistorySnapshotRef.current =
|
|
674
|
+
lastHistorySnapshotRef.current = chunk2HLDBQH7_js.cloneHistorySnapshot(snapshot);
|
|
680
675
|
lastHistorySerializedRef.current = serialized;
|
|
681
676
|
lastCheapHashRef.current = cheapHash;
|
|
682
677
|
updateHistoryAvailability();
|
|
683
678
|
return;
|
|
684
679
|
}
|
|
685
680
|
onDirtyRef.current?.();
|
|
686
|
-
historyPastRef.current.push(
|
|
681
|
+
historyPastRef.current.push(chunk2HLDBQH7_js.cloneHistorySnapshot(previousSnapshot));
|
|
687
682
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
688
683
|
historyPastRef.current.shift();
|
|
689
684
|
}
|
|
690
685
|
historyFutureRef.current = [];
|
|
691
|
-
lastHistorySnapshotRef.current =
|
|
686
|
+
lastHistorySnapshotRef.current = chunk2HLDBQH7_js.cloneHistorySnapshot(snapshot);
|
|
692
687
|
lastHistorySerializedRef.current = serialized;
|
|
693
688
|
lastCheapHashRef.current = cheapHash;
|
|
694
689
|
updateHistoryAvailability();
|
|
@@ -748,9 +743,9 @@ function useZoomViewport({
|
|
|
748
743
|
const canvasStageRef = react.useRef(null);
|
|
749
744
|
const canvasViewportRef = react.useRef(null);
|
|
750
745
|
const renderScaleRef = react.useRef(1);
|
|
751
|
-
const wheelBufferRef = react.useRef(
|
|
746
|
+
const wheelBufferRef = react.useRef(chunk7ZQ2FZXE_js.createWheelStepBuffer());
|
|
752
747
|
const storeRef = react.useRef(null);
|
|
753
|
-
storeRef.current ??=
|
|
748
|
+
storeRef.current ??= chunk7ZQ2FZXE_js.createViewerZoomStore();
|
|
754
749
|
const store = storeRef.current;
|
|
755
750
|
const scale = useViewerStore(store, selectZoom);
|
|
756
751
|
const setScale = react.useCallback(
|
|
@@ -811,7 +806,7 @@ function useZoomViewport({
|
|
|
811
806
|
if (!wrapper || !canvasViewport) {
|
|
812
807
|
return;
|
|
813
808
|
}
|
|
814
|
-
const boundedScale =
|
|
809
|
+
const boundedScale = chunk7ZQ2FZXE_js.clampZoomScale(nextScale);
|
|
815
810
|
const nextEditorScale = fitScale * boundedScale;
|
|
816
811
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
817
812
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -848,29 +843,29 @@ function useZoomViewport({
|
|
|
848
843
|
selectedElements.forEach((element) => {
|
|
849
844
|
minX = Math.min(minX, element.x);
|
|
850
845
|
minY = Math.min(minY, element.y);
|
|
851
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
852
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
846
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunk2HLDBQH7_js.MIN_ELEMENT_SIZE));
|
|
847
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunk2HLDBQH7_js.MIN_ELEMENT_SIZE));
|
|
853
848
|
});
|
|
854
849
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
855
850
|
return;
|
|
856
851
|
}
|
|
857
852
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
858
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
859
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
853
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunk2HLDBQH7_js.MIN_ELEMENT_SIZE);
|
|
854
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunk2HLDBQH7_js.MIN_ELEMENT_SIZE);
|
|
860
855
|
const availableWidth = Math.max(
|
|
861
|
-
effectiveEditorDimensions.width -
|
|
862
|
-
|
|
856
|
+
effectiveEditorDimensions.width - chunk2HLDBQH7_js.ZOOM_TO_SELECTION_PADDING,
|
|
857
|
+
chunk2HLDBQH7_js.MIN_ELEMENT_SIZE
|
|
863
858
|
);
|
|
864
859
|
const availableHeight = Math.max(
|
|
865
|
-
effectiveEditorDimensions.height -
|
|
866
|
-
|
|
860
|
+
effectiveEditorDimensions.height - chunk2HLDBQH7_js.ZOOM_TO_SELECTION_PADDING,
|
|
861
|
+
chunk2HLDBQH7_js.MIN_ELEMENT_SIZE
|
|
867
862
|
);
|
|
868
863
|
const targetEditorScale = Math.min(
|
|
869
864
|
availableWidth / boundsWidth,
|
|
870
865
|
availableHeight / boundsHeight
|
|
871
866
|
);
|
|
872
867
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
873
|
-
const nextScale =
|
|
868
|
+
const nextScale = chunk7ZQ2FZXE_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
874
869
|
setScale(nextScale);
|
|
875
870
|
window.requestAnimationFrame(() => {
|
|
876
871
|
window.requestAnimationFrame(() => {
|
|
@@ -887,14 +882,14 @@ function useZoomViewport({
|
|
|
887
882
|
]);
|
|
888
883
|
const handleWheel = react.useCallback(
|
|
889
884
|
(event) => {
|
|
890
|
-
const mapped =
|
|
885
|
+
const mapped = chunk7ZQ2FZXE_js.mapEditingWheel(event, wheelBufferRef.current, true);
|
|
891
886
|
if (mapped.intent !== "zoom") {
|
|
892
887
|
return;
|
|
893
888
|
}
|
|
894
889
|
event.preventDefault();
|
|
895
890
|
store.dispatch({
|
|
896
891
|
type: "set-zoom",
|
|
897
|
-
zoom:
|
|
892
|
+
zoom: chunk7ZQ2FZXE_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
|
|
898
893
|
});
|
|
899
894
|
},
|
|
900
895
|
[store]
|
|
@@ -982,7 +977,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
982
977
|
const command = step.command;
|
|
983
978
|
const timer = window.setTimeout(
|
|
984
979
|
() => {
|
|
985
|
-
|
|
980
|
+
chunk2HLDBQH7_js.executeMediaCommand(command);
|
|
986
981
|
},
|
|
987
982
|
Math.max(0, step.delayMs)
|
|
988
983
|
);
|
|
@@ -1119,7 +1114,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1119
1114
|
}))
|
|
1120
1115
|
);
|
|
1121
1116
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1122
|
-
const delay =
|
|
1117
|
+
const delay = chunk7ZQ2FZXE_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1123
1118
|
const timer = window.setTimeout(() => {
|
|
1124
1119
|
setPresentationAnimations(
|
|
1125
1120
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1151,7 +1146,7 @@ function useAnimationPlayback(input) {
|
|
|
1151
1146
|
(controller, group) => {
|
|
1152
1147
|
driveBuildReveal(
|
|
1153
1148
|
controller,
|
|
1154
|
-
|
|
1149
|
+
chunk7ZQ2FZXE_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1155
1150
|
setPresentationElementStates,
|
|
1156
1151
|
buildRafRef
|
|
1157
1152
|
);
|
|
@@ -1220,7 +1215,7 @@ function useAnimationPlayback(input) {
|
|
|
1220
1215
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1221
1216
|
return;
|
|
1222
1217
|
}
|
|
1223
|
-
const controller =
|
|
1218
|
+
const controller = chunk7ZQ2FZXE_js.PresentationAnimationController.fromSlide(slide);
|
|
1224
1219
|
controllerRef.current = controller;
|
|
1225
1220
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1226
1221
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1378,12 +1373,12 @@ function useAnimationPlayback(input) {
|
|
|
1378
1373
|
presentationTimersRef
|
|
1379
1374
|
};
|
|
1380
1375
|
}
|
|
1381
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1382
|
-
var AUDIENCE_HASH =
|
|
1383
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1384
|
-
var AUDIENCE_NONCE_KEY =
|
|
1376
|
+
var PRESENTER_CHANNEL_NAME = chunk7ZQ2FZXE_js.PRESENTATION_CHANNEL_NAME;
|
|
1377
|
+
var AUDIENCE_HASH = chunk7ZQ2FZXE_js.PRESENTATION_HASH;
|
|
1378
|
+
var PRESENTER_MSG_ORIGIN = chunk7ZQ2FZXE_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1379
|
+
var AUDIENCE_NONCE_KEY = chunk7ZQ2FZXE_js.PRESENTATION_NONCE_KEY;
|
|
1385
1380
|
function generateSessionId() {
|
|
1386
|
-
return
|
|
1381
|
+
return chunk7ZQ2FZXE_js.createPresentationSessionId();
|
|
1387
1382
|
}
|
|
1388
1383
|
function parseAudienceNonce() {
|
|
1389
1384
|
const hash = window.location.hash;
|
|
@@ -1419,7 +1414,7 @@ function usePresenterWindow(input) {
|
|
|
1419
1414
|
}, []);
|
|
1420
1415
|
const swapDisplays = react.useCallback(async () => {
|
|
1421
1416
|
const audience = audienceWindowRef.current;
|
|
1422
|
-
return audience && !audience.closed ?
|
|
1417
|
+
return audience && !audience.closed ? chunk7ZQ2FZXE_js.swapPresentationWindows(window, audience) : false;
|
|
1423
1418
|
}, []);
|
|
1424
1419
|
const syncSlideToAudience = react.useCallback(
|
|
1425
1420
|
(slideIndex) => {
|
|
@@ -1483,7 +1478,7 @@ function usePresenterWindow(input) {
|
|
|
1483
1478
|
pollTimerRef.current = null;
|
|
1484
1479
|
}
|
|
1485
1480
|
if (closingSessionId) {
|
|
1486
|
-
void
|
|
1481
|
+
void chunk7ZQ2FZXE_js.clearAudienceContent(closingSessionId);
|
|
1487
1482
|
}
|
|
1488
1483
|
}, [getChannel]);
|
|
1489
1484
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1501,10 +1496,10 @@ function usePresenterWindow(input) {
|
|
|
1501
1496
|
audienceWindowRef.current = blankWin;
|
|
1502
1497
|
const sessionId = generateSessionId();
|
|
1503
1498
|
sessionIdRef.current = sessionId;
|
|
1504
|
-
const audienceUrl =
|
|
1505
|
-
void
|
|
1499
|
+
const audienceUrl = chunk7ZQ2FZXE_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1500
|
+
void chunk7ZQ2FZXE_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1506
1501
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1507
|
-
|
|
1502
|
+
chunk7ZQ2FZXE_js.placeAudienceWindow(blankWin, placement);
|
|
1508
1503
|
}
|
|
1509
1504
|
return void 0;
|
|
1510
1505
|
});
|
|
@@ -1534,7 +1529,7 @@ function usePresenterWindow(input) {
|
|
|
1534
1529
|
}
|
|
1535
1530
|
};
|
|
1536
1531
|
if (content) {
|
|
1537
|
-
void
|
|
1532
|
+
void chunk7ZQ2FZXE_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1538
1533
|
} else {
|
|
1539
1534
|
navigateOrClose(true);
|
|
1540
1535
|
}
|
|
@@ -1560,7 +1555,7 @@ function usePresenterWindow(input) {
|
|
|
1560
1555
|
}
|
|
1561
1556
|
const handleMessage = (event) => {
|
|
1562
1557
|
const message = event.data;
|
|
1563
|
-
if (
|
|
1558
|
+
if (chunk7ZQ2FZXE_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1564
1559
|
syncStateToAudience(snapshotRef.current);
|
|
1565
1560
|
}
|
|
1566
1561
|
};
|
|
@@ -1589,7 +1584,7 @@ function usePresenterWindow(input) {
|
|
|
1589
1584
|
react.useEffect(() => {
|
|
1590
1585
|
const handleBeforeUnload = () => {
|
|
1591
1586
|
if (sessionIdRef.current) {
|
|
1592
|
-
void
|
|
1587
|
+
void chunk7ZQ2FZXE_js.clearAudienceContent(sessionIdRef.current);
|
|
1593
1588
|
}
|
|
1594
1589
|
};
|
|
1595
1590
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1651,7 +1646,7 @@ function useAudienceMode(input) {
|
|
|
1651
1646
|
}
|
|
1652
1647
|
channel.onmessage = (event) => {
|
|
1653
1648
|
const data = event.data;
|
|
1654
|
-
if (!
|
|
1649
|
+
if (!chunk7ZQ2FZXE_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1655
1650
|
return;
|
|
1656
1651
|
}
|
|
1657
1652
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1667,16 +1662,16 @@ function useAudienceMode(input) {
|
|
|
1667
1662
|
}
|
|
1668
1663
|
if (data.type === "presenter-exit") {
|
|
1669
1664
|
if (expectedSessionId) {
|
|
1670
|
-
void
|
|
1665
|
+
void chunk7ZQ2FZXE_js.clearAudienceContent(expectedSessionId);
|
|
1671
1666
|
}
|
|
1672
|
-
if (
|
|
1667
|
+
if (chunk7ZQ2FZXE_js.endAudienceDisplay(window)) {
|
|
1673
1668
|
handlers.onPresenterEnded?.();
|
|
1674
1669
|
}
|
|
1675
1670
|
}
|
|
1676
1671
|
};
|
|
1677
1672
|
if (expectedSessionId) {
|
|
1678
1673
|
channel.postMessage({
|
|
1679
|
-
origin:
|
|
1674
|
+
origin: chunk7ZQ2FZXE_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1680
1675
|
type: "audience-ready",
|
|
1681
1676
|
sessionId: expectedSessionId
|
|
1682
1677
|
});
|
|
@@ -1690,7 +1685,7 @@ function useAudienceMode(input) {
|
|
|
1690
1685
|
}, []);
|
|
1691
1686
|
}
|
|
1692
1687
|
function usePresentationKeyboard(input) {
|
|
1693
|
-
const wheelBufferRef = react.useRef(
|
|
1688
|
+
const wheelBufferRef = react.useRef(chunk7ZQ2FZXE_js.createWheelStepBuffer());
|
|
1694
1689
|
const {
|
|
1695
1690
|
mode,
|
|
1696
1691
|
movePresentationSlide,
|
|
@@ -1711,14 +1706,14 @@ function usePresentationKeyboard(input) {
|
|
|
1711
1706
|
presentationSlideIndex,
|
|
1712
1707
|
setShowRehearsalSummary
|
|
1713
1708
|
} = input;
|
|
1714
|
-
const keyBufferRef = react.useRef(
|
|
1709
|
+
const keyBufferRef = react.useRef(chunk7ZQ2FZXE_js.createPresentationKeyBuffer());
|
|
1715
1710
|
react.useEffect(() => {
|
|
1716
|
-
if (mode !== "present" || !
|
|
1717
|
-
keyBufferRef.current =
|
|
1711
|
+
if (mode !== "present" || !chunk7ZQ2FZXE_js.acceptsPresentationInput()) {
|
|
1712
|
+
keyBufferRef.current = chunk7ZQ2FZXE_js.createPresentationKeyBuffer();
|
|
1718
1713
|
return;
|
|
1719
1714
|
}
|
|
1720
1715
|
const handleKeyDown = (event) => {
|
|
1721
|
-
const mapped =
|
|
1716
|
+
const mapped = chunk7ZQ2FZXE_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1722
1717
|
if (mapped.action === "none") {
|
|
1723
1718
|
return;
|
|
1724
1719
|
}
|
|
@@ -1738,12 +1733,12 @@ function usePresentationKeyboard(input) {
|
|
|
1738
1733
|
movePresentationSlide(-1);
|
|
1739
1734
|
return;
|
|
1740
1735
|
case "first": {
|
|
1741
|
-
const first =
|
|
1736
|
+
const first = chunk7ZQ2FZXE_js.firstShowSlideIndex(showSlideIndexes);
|
|
1742
1737
|
navigateToSlide(first ?? 0);
|
|
1743
1738
|
return;
|
|
1744
1739
|
}
|
|
1745
1740
|
case "last": {
|
|
1746
|
-
const last =
|
|
1741
|
+
const last = chunk7ZQ2FZXE_js.lastShowSlideIndex(showSlideIndexes);
|
|
1747
1742
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1748
1743
|
return;
|
|
1749
1744
|
}
|
|
@@ -1781,10 +1776,10 @@ function usePresentationKeyboard(input) {
|
|
|
1781
1776
|
}
|
|
1782
1777
|
};
|
|
1783
1778
|
const handleWheel = (event) => {
|
|
1784
|
-
if (mode !== "present" || !
|
|
1779
|
+
if (mode !== "present" || !chunk7ZQ2FZXE_js.acceptsPresentationInput()) {
|
|
1785
1780
|
return;
|
|
1786
1781
|
}
|
|
1787
|
-
const mapped =
|
|
1782
|
+
const mapped = chunk7ZQ2FZXE_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1788
1783
|
if (mapped.intent === "next-slide") {
|
|
1789
1784
|
event.preventDefault();
|
|
1790
1785
|
movePresentationSlide(1);
|
|
@@ -1917,7 +1912,7 @@ function useRehearsalTimings(input) {
|
|
|
1917
1912
|
|
|
1918
1913
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1919
1914
|
function handlePresentationActionImpl(action, deps) {
|
|
1920
|
-
|
|
1915
|
+
chunk7ZQ2FZXE_js.runPresentationAction(
|
|
1921
1916
|
action,
|
|
1922
1917
|
{ slideCount: deps.slidesLength },
|
|
1923
1918
|
{
|
|
@@ -1939,7 +1934,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1939
1934
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1940
1935
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1941
1936
|
const transition = incomingSlide?.transition;
|
|
1942
|
-
const durationMs = deps.playTransition ?
|
|
1937
|
+
const durationMs = deps.playTransition ? chunk7ZQ2FZXE_js.resolveTransitionDurationMs(transition) : 0;
|
|
1943
1938
|
deps.clearPresentationTimers();
|
|
1944
1939
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1945
1940
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1998,7 +1993,7 @@ function useSlideNavigation(input) {
|
|
|
1998
1993
|
});
|
|
1999
1994
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
2000
1995
|
(slideIndex) => {
|
|
2001
|
-
const delayMs =
|
|
1996
|
+
const delayMs = chunk7ZQ2FZXE_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
2002
1997
|
if (delayMs === void 0) {
|
|
2003
1998
|
return;
|
|
2004
1999
|
}
|
|
@@ -2021,7 +2016,7 @@ function useSlideNavigation(input) {
|
|
|
2021
2016
|
if (availableSlideIndexes.length === 0) {
|
|
2022
2017
|
return;
|
|
2023
2018
|
}
|
|
2024
|
-
const pastLastSlide = direction === 1 && !
|
|
2019
|
+
const pastLastSlide = direction === 1 && !chunk7ZQ2FZXE_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
2025
2020
|
if (rehearsing && pastLastSlide) {
|
|
2026
2021
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
2027
2022
|
try {
|
|
@@ -2039,9 +2034,9 @@ function useSlideNavigation(input) {
|
|
|
2039
2034
|
onAdvancePastLastSlide();
|
|
2040
2035
|
return;
|
|
2041
2036
|
}
|
|
2042
|
-
const nextSlideIndex = direction === 1 ?
|
|
2037
|
+
const nextSlideIndex = direction === 1 ? chunk7ZQ2FZXE_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
2043
2038
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
2044
|
-
}) :
|
|
2039
|
+
}) : chunk7ZQ2FZXE_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
2045
2040
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
2046
2041
|
return;
|
|
2047
2042
|
}
|
|
@@ -2186,22 +2181,22 @@ function useZoomNavigation(input) {
|
|
|
2186
2181
|
};
|
|
2187
2182
|
}
|
|
2188
2183
|
function usePresenterConsole(slideIndex, active) {
|
|
2189
|
-
const timerRef = react.useRef(
|
|
2190
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2184
|
+
const timerRef = react.useRef(chunk7ZQ2FZXE_js.createPresenterTimer());
|
|
2185
|
+
const [snapshot, setSnapshot] = react.useState(() => chunk7ZQ2FZXE_js.createInitialPresentationSnapshot(slideIndex));
|
|
2191
2186
|
const patch = react.useCallback((value) => {
|
|
2192
|
-
setSnapshot((current) =>
|
|
2187
|
+
setSnapshot((current) => chunk7ZQ2FZXE_js.mergePresentationSnapshot(current, value));
|
|
2193
2188
|
}, []);
|
|
2194
2189
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2195
2190
|
react.useEffect(() => {
|
|
2196
2191
|
if (!active) {
|
|
2197
2192
|
return;
|
|
2198
2193
|
}
|
|
2199
|
-
timerRef.current =
|
|
2194
|
+
timerRef.current = chunk7ZQ2FZXE_js.resetPresenterTimer();
|
|
2200
2195
|
patch({ paused: false, elapsedMs: 0 });
|
|
2201
2196
|
const timer = window.setInterval(() => {
|
|
2202
2197
|
patch({
|
|
2203
2198
|
paused: timerRef.current.paused,
|
|
2204
|
-
elapsedMs:
|
|
2199
|
+
elapsedMs: chunk7ZQ2FZXE_js.presenterElapsed(timerRef.current)
|
|
2205
2200
|
});
|
|
2206
2201
|
}, 1e3);
|
|
2207
2202
|
return () => window.clearInterval(timer);
|
|
@@ -2211,19 +2206,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2211
2206
|
applyAudienceSnapshot: setSnapshot,
|
|
2212
2207
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2213
2208
|
toggleTimer: () => {
|
|
2214
|
-
timerRef.current =
|
|
2209
|
+
timerRef.current = chunk7ZQ2FZXE_js.togglePresenterTimer(timerRef.current);
|
|
2215
2210
|
patch({
|
|
2216
2211
|
paused: timerRef.current.paused,
|
|
2217
|
-
elapsedMs:
|
|
2212
|
+
elapsedMs: chunk7ZQ2FZXE_js.presenterElapsed(timerRef.current)
|
|
2218
2213
|
});
|
|
2219
2214
|
},
|
|
2220
2215
|
resetTimer: () => {
|
|
2221
|
-
timerRef.current =
|
|
2216
|
+
timerRef.current = chunk7ZQ2FZXE_js.resetPresenterTimer();
|
|
2222
2217
|
patch({ paused: false, elapsedMs: 0 });
|
|
2223
2218
|
},
|
|
2224
2219
|
stepZoom: (direction) => setSnapshot(
|
|
2225
|
-
(current) =>
|
|
2226
|
-
zoom:
|
|
2220
|
+
(current) => chunk7ZQ2FZXE_js.mergePresentationSnapshot(current, {
|
|
2221
|
+
zoom: chunk7ZQ2FZXE_js.stepPresenterZoom(
|
|
2227
2222
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2228
2223
|
direction
|
|
2229
2224
|
)
|
|
@@ -2269,7 +2264,7 @@ function usePresentationMode(input) {
|
|
|
2269
2264
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2270
2265
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2271
2266
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2272
|
-
const showGuard = react.useMemo(() =>
|
|
2267
|
+
const showGuard = react.useMemo(() => chunk7ZQ2FZXE_js.createPresenterShowGuard(), []);
|
|
2273
2268
|
const {
|
|
2274
2269
|
presentationAnimations,
|
|
2275
2270
|
presentationElementStates,
|
|
@@ -2348,7 +2343,7 @@ function usePresentationMode(input) {
|
|
|
2348
2343
|
});
|
|
2349
2344
|
const movePresentationSlide = react.useCallback(
|
|
2350
2345
|
(direction, trigger = "explicit") => {
|
|
2351
|
-
if (!
|
|
2346
|
+
if (!chunk7ZQ2FZXE_js.acceptsPresentationInput()) {
|
|
2352
2347
|
return;
|
|
2353
2348
|
}
|
|
2354
2349
|
if (endOfShowVisible) {
|
|
@@ -2486,7 +2481,7 @@ function usePresentationMode(input) {
|
|
|
2486
2481
|
if (mode !== "present") {
|
|
2487
2482
|
return;
|
|
2488
2483
|
}
|
|
2489
|
-
return
|
|
2484
|
+
return chunk7ZQ2FZXE_js.attachPresentationVisibilityPause({
|
|
2490
2485
|
root: containerRef.current ?? void 0,
|
|
2491
2486
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2492
2487
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2566,11 +2561,11 @@ function usePresentationMode(input) {
|
|
|
2566
2561
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2567
2562
|
return void 0;
|
|
2568
2563
|
}
|
|
2569
|
-
return
|
|
2564
|
+
return chunk7ZQ2FZXE_js.buildMorphTransitionPlan(
|
|
2570
2565
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2571
2566
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2572
2567
|
transitionOverlay.durationMs,
|
|
2573
|
-
|
|
2568
|
+
chunk7ZQ2FZXE_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2574
2569
|
);
|
|
2575
2570
|
}, [transitionOverlay, slides]);
|
|
2576
2571
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2591,7 +2586,7 @@ function usePresentationMode(input) {
|
|
|
2591
2586
|
if (!morphPlan) {
|
|
2592
2587
|
return presentationKeyframesCss;
|
|
2593
2588
|
}
|
|
2594
|
-
const imageRules =
|
|
2589
|
+
const imageRules = chunk7ZQ2FZXE_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2595
2590
|
return `${presentationKeyframesCss ?? ""}
|
|
2596
2591
|
${morphPlan.keyframesCss}
|
|
2597
2592
|
${imageRules}`;
|
|
@@ -2887,7 +2882,7 @@ function useFindReplace({
|
|
|
2887
2882
|
const [findResults, setFindResults] = react.useState([]);
|
|
2888
2883
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
2889
2884
|
const performFind = react.useCallback(() => {
|
|
2890
|
-
const results =
|
|
2885
|
+
const results = chunk7ZQ2FZXE_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
2891
2886
|
if (!findQuery) {
|
|
2892
2887
|
setFindResults([]);
|
|
2893
2888
|
setFindResultIndex(-1);
|
|
@@ -2921,7 +2916,7 @@ function useFindReplace({
|
|
|
2921
2916
|
return;
|
|
2922
2917
|
}
|
|
2923
2918
|
onUpdateSlides(
|
|
2924
|
-
(prevSlides) =>
|
|
2919
|
+
(prevSlides) => chunk7ZQ2FZXE_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
2925
2920
|
);
|
|
2926
2921
|
onMarkDirty();
|
|
2927
2922
|
},
|
|
@@ -2943,9 +2938,9 @@ function useFindReplace({
|
|
|
2943
2938
|
}, [findResults, applyReplacements, performFind]);
|
|
2944
2939
|
react.useEffect(() => {
|
|
2945
2940
|
const handler = (event) => {
|
|
2946
|
-
const { action } =
|
|
2941
|
+
const { action } = chunk7ZQ2FZXE_js.mapEditorKey(event, {
|
|
2947
2942
|
canEdit: mode === "edit",
|
|
2948
|
-
isTextInputTarget:
|
|
2943
|
+
isTextInputTarget: chunk7ZQ2FZXE_js.isEditorTextInputTarget(event.target)
|
|
2949
2944
|
});
|
|
2950
2945
|
if (action !== "find") {
|
|
2951
2946
|
return;
|
|
@@ -3024,7 +3019,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId) {
|
|
|
3024
3019
|
if (!slide) {
|
|
3025
3020
|
return { slides, didAdd: false };
|
|
3026
3021
|
}
|
|
3027
|
-
const next =
|
|
3022
|
+
const next = chunk7ZQ2FZXE_js.addCommentToList(
|
|
3028
3023
|
slide.comments || [],
|
|
3029
3024
|
text,
|
|
3030
3025
|
authorName,
|
|
@@ -3042,7 +3037,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
|
3042
3037
|
if (!slide) {
|
|
3043
3038
|
return { slides, didDelete: false };
|
|
3044
3039
|
}
|
|
3045
|
-
const next =
|
|
3040
|
+
const next = chunk7ZQ2FZXE_js.removeCommentFromList(slide.comments || [], commentId);
|
|
3046
3041
|
if (!next) {
|
|
3047
3042
|
return { slides, didDelete: false };
|
|
3048
3043
|
}
|
|
@@ -3053,7 +3048,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
|
3053
3048
|
if (!slide) {
|
|
3054
3049
|
return { slides, didUpdate: false };
|
|
3055
3050
|
}
|
|
3056
|
-
const next =
|
|
3051
|
+
const next = chunk7ZQ2FZXE_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
3057
3052
|
if (!next) {
|
|
3058
3053
|
return { slides, didUpdate: false };
|
|
3059
3054
|
}
|
|
@@ -3064,7 +3059,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
|
3064
3059
|
if (!slide) {
|
|
3065
3060
|
return { slides, didUpdate: false };
|
|
3066
3061
|
}
|
|
3067
|
-
const next =
|
|
3062
|
+
const next = chunk7ZQ2FZXE_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
3068
3063
|
if (!next) {
|
|
3069
3064
|
return { slides, didUpdate: false };
|
|
3070
3065
|
}
|
|
@@ -3075,7 +3070,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName) {
|
|
|
3075
3070
|
if (!slide) {
|
|
3076
3071
|
return { slides, didAdd: false };
|
|
3077
3072
|
}
|
|
3078
|
-
const next =
|
|
3073
|
+
const next = chunk7ZQ2FZXE_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
3079
3074
|
if (!next) {
|
|
3080
3075
|
return { slides, didAdd: false };
|
|
3081
3076
|
}
|
|
@@ -3449,7 +3444,7 @@ function useViewerCoreState(_input) {
|
|
|
3449
3444
|
const marqueeStateRef = react.useRef(null);
|
|
3450
3445
|
const isDrawingRef = react.useRef(false);
|
|
3451
3446
|
const justInteractedRef = react.useRef(false);
|
|
3452
|
-
const livePatcher = react.useMemo(() =>
|
|
3447
|
+
const livePatcher = react.useMemo(() => chunk7ZQ2FZXE_js.createCollaborationLivePatcher(), []);
|
|
3453
3448
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3454
3449
|
const slidesRef = react.useRef([]);
|
|
3455
3450
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3458,8 +3453,8 @@ function useViewerCoreState(_input) {
|
|
|
3458
3453
|
const [slides, setSlides] = react.useState([]);
|
|
3459
3454
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3460
3455
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3461
|
-
width:
|
|
3462
|
-
height:
|
|
3456
|
+
width: chunk2HLDBQH7_js.DEFAULT_CANVAS_WIDTH,
|
|
3457
|
+
height: chunk2HLDBQH7_js.DEFAULT_CANVAS_HEIGHT
|
|
3463
3458
|
});
|
|
3464
3459
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3465
3460
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3480,7 +3475,7 @@ function useViewerCoreState(_input) {
|
|
|
3480
3475
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3481
3476
|
inlineEditingTextRef.current = resolved;
|
|
3482
3477
|
setInlineEditingTextBase(value);
|
|
3483
|
-
|
|
3478
|
+
chunk7ZQ2FZXE_js.publishLiveInlineText(
|
|
3484
3479
|
livePatcher,
|
|
3485
3480
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3486
3481
|
inlineEditingElementIdRef.current,
|
|
@@ -3798,7 +3793,8 @@ function useLoadContent({
|
|
|
3798
3793
|
setError,
|
|
3799
3794
|
setIsDirty,
|
|
3800
3795
|
setIsEncrypted,
|
|
3801
|
-
onContentApplied
|
|
3796
|
+
onContentApplied,
|
|
3797
|
+
allowExternalImages
|
|
3802
3798
|
}) {
|
|
3803
3799
|
const handlerRef = react.useRef(null);
|
|
3804
3800
|
const originalBufferRef = react.useRef(null);
|
|
@@ -3823,8 +3819,8 @@ function useLoadContent({
|
|
|
3823
3819
|
);
|
|
3824
3820
|
}
|
|
3825
3821
|
const previousHandler = handlerRef.current;
|
|
3826
|
-
const handler = new
|
|
3827
|
-
const parsed = await handler.load(buffer);
|
|
3822
|
+
const handler = new chunk7ZQ2FZXE_js.PptxHandler();
|
|
3823
|
+
const parsed = await handler.load(buffer, { allowExternalImages });
|
|
3828
3824
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3829
3825
|
handler.dispose();
|
|
3830
3826
|
return;
|
|
@@ -3835,7 +3831,7 @@ function useLoadContent({
|
|
|
3835
3831
|
handlerRef.current = null;
|
|
3836
3832
|
const mediaElements = [];
|
|
3837
3833
|
for (const slide of parsed.slides) {
|
|
3838
|
-
|
|
3834
|
+
chunk7ZQ2FZXE_js.collectMediaElements(slide.elements, mediaElements);
|
|
3839
3835
|
}
|
|
3840
3836
|
for (const url of mediaDataUrls.values()) {
|
|
3841
3837
|
if (url.startsWith("blob:")) {
|
|
@@ -3876,7 +3872,7 @@ function useLoadContent({
|
|
|
3876
3872
|
}
|
|
3877
3873
|
})
|
|
3878
3874
|
);
|
|
3879
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3875
|
+
const { paths: imagePaths, refs: imageRefs } = chunk7ZQ2FZXE_js.collectImagePaths(parsed.slides);
|
|
3880
3876
|
let nextSlides = parsed.slides;
|
|
3881
3877
|
if (imagePaths.size > 0) {
|
|
3882
3878
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3930,7 +3926,7 @@ function useLoadContent({
|
|
|
3930
3926
|
});
|
|
3931
3927
|
}
|
|
3932
3928
|
}
|
|
3933
|
-
const { paths: tableImagePaths, refs: tableImageRefs } =
|
|
3929
|
+
const { paths: tableImagePaths, refs: tableImageRefs } = chunk7ZQ2FZXE_js.collectTableCellImagePaths(nextSlides);
|
|
3934
3930
|
if (tableImagePaths.size > 0) {
|
|
3935
3931
|
const resolvedTableMap = /* @__PURE__ */ new Map();
|
|
3936
3932
|
await Promise.all(
|
|
@@ -3946,7 +3942,7 @@ function useLoadContent({
|
|
|
3946
3942
|
);
|
|
3947
3943
|
if (resolvedTableMap.size > 0) {
|
|
3948
3944
|
nextSlides = nextSlides.map((s) => {
|
|
3949
|
-
const newElements =
|
|
3945
|
+
const newElements = chunk7ZQ2FZXE_js.applyTableCellImagePatches(
|
|
3950
3946
|
s.elements,
|
|
3951
3947
|
resolvedTableMap,
|
|
3952
3948
|
tableImageRefs
|
|
@@ -3956,7 +3952,7 @@ function useLoadContent({
|
|
|
3956
3952
|
}
|
|
3957
3953
|
}
|
|
3958
3954
|
let nextTableStyleMap = parsed.tableStyleMap;
|
|
3959
|
-
const { paths: tableStyleImagePaths, refs: tableStyleImageRefs } =
|
|
3955
|
+
const { paths: tableStyleImagePaths, refs: tableStyleImageRefs } = chunk7ZQ2FZXE_js.collectTableStyleImagePaths(nextTableStyleMap);
|
|
3960
3956
|
if (tableStyleImagePaths.size > 0) {
|
|
3961
3957
|
const resolvedStyleMap = /* @__PURE__ */ new Map();
|
|
3962
3958
|
await Promise.all(
|
|
@@ -3971,7 +3967,7 @@ function useLoadContent({
|
|
|
3971
3967
|
})
|
|
3972
3968
|
);
|
|
3973
3969
|
if (resolvedStyleMap.size > 0 && nextTableStyleMap) {
|
|
3974
|
-
nextTableStyleMap =
|
|
3970
|
+
nextTableStyleMap = chunk7ZQ2FZXE_js.applyTableStyleImagePatches(
|
|
3975
3971
|
nextTableStyleMap,
|
|
3976
3972
|
resolvedStyleMap,
|
|
3977
3973
|
tableStyleImageRefs
|
|
@@ -3979,12 +3975,12 @@ function useLoadContent({
|
|
|
3979
3975
|
}
|
|
3980
3976
|
}
|
|
3981
3977
|
handlerRef.current = handler;
|
|
3982
|
-
const partition =
|
|
3978
|
+
const partition = chunk7ZQ2FZXE_js.partitionTemplateElements(nextSlides);
|
|
3983
3979
|
setSlides(partition.slides);
|
|
3984
3980
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3985
3981
|
setCanvasSize({
|
|
3986
|
-
width: parsed.width ??
|
|
3987
|
-
height: parsed.height ??
|
|
3982
|
+
width: parsed.width ?? chunk2HLDBQH7_js.DEFAULT_CANVAS_WIDTH,
|
|
3983
|
+
height: parsed.height ?? chunk2HLDBQH7_js.DEFAULT_CANVAS_HEIGHT
|
|
3988
3984
|
});
|
|
3989
3985
|
setSlideSizeEmu(
|
|
3990
3986
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4001,7 +3997,7 @@ function useLoadContent({
|
|
|
4001
3997
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
4002
3998
|
setCustomShows(parsed.customShows ?? []);
|
|
4003
3999
|
setActiveCustomShowId(
|
|
4004
|
-
|
|
4000
|
+
chunk7ZQ2FZXE_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
4005
4001
|
);
|
|
4006
4002
|
setSections(parsed.sections ?? []);
|
|
4007
4003
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -4024,7 +4020,7 @@ function useLoadContent({
|
|
|
4024
4020
|
setHasMacros(parsed.hasMacros === true);
|
|
4025
4021
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4026
4022
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4027
|
-
setGuides(
|
|
4023
|
+
setGuides(chunk7ZQ2FZXE_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4028
4024
|
setActiveSlideIndex(0);
|
|
4029
4025
|
clearSelection();
|
|
4030
4026
|
setIsDirty(false);
|
|
@@ -4032,7 +4028,7 @@ function useLoadContent({
|
|
|
4032
4028
|
onContentApplied?.();
|
|
4033
4029
|
} catch (err) {
|
|
4034
4030
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4035
|
-
if (err instanceof
|
|
4031
|
+
if (err instanceof chunk7ZQ2FZXE_js.EncryptedFileError) {
|
|
4036
4032
|
setIsEncrypted(true);
|
|
4037
4033
|
} else {
|
|
4038
4034
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4060,7 +4056,7 @@ function useLoadContent({
|
|
|
4060
4056
|
}
|
|
4061
4057
|
function useAutosave(input) {
|
|
4062
4058
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4063
|
-
const intervalMs =
|
|
4059
|
+
const intervalMs = chunk7ZQ2FZXE_js.resolveAutosaveIntervalMs({
|
|
4064
4060
|
hostIntervalMs: input.intervalMs,
|
|
4065
4061
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4066
4062
|
});
|
|
@@ -4091,7 +4087,7 @@ function useAutosave(input) {
|
|
|
4091
4087
|
return;
|
|
4092
4088
|
}
|
|
4093
4089
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4094
|
-
if (!
|
|
4090
|
+
if (!chunk7ZQ2FZXE_js.shouldWriteAutosaveSnapshot({
|
|
4095
4091
|
filePath: path,
|
|
4096
4092
|
isDirty: isDirtyRef.current,
|
|
4097
4093
|
saving: isSavingRef.current,
|
|
@@ -4109,8 +4105,8 @@ function useAutosave(input) {
|
|
|
4109
4105
|
isSavingRef.current = false;
|
|
4110
4106
|
return;
|
|
4111
4107
|
}
|
|
4112
|
-
await
|
|
4113
|
-
lastSnapshotRef.current =
|
|
4108
|
+
await chunk7ZQ2FZXE_js.saveAutosaveSnapshot(path, data);
|
|
4109
|
+
lastSnapshotRef.current = chunk7ZQ2FZXE_js.autosaveSnapshotMark(path, sources);
|
|
4114
4110
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4115
4111
|
} catch (err) {
|
|
4116
4112
|
setAutosaveStatus({
|
|
@@ -4196,11 +4192,11 @@ function useElementOperations(input) {
|
|
|
4196
4192
|
(elementId, updates) => {
|
|
4197
4193
|
if (masterView?.target) {
|
|
4198
4194
|
applyMasterViewWrite(
|
|
4199
|
-
|
|
4195
|
+
chunk7ZQ2FZXE_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4200
4196
|
);
|
|
4201
4197
|
return;
|
|
4202
4198
|
}
|
|
4203
|
-
if (
|
|
4199
|
+
if (chunk7ZQ2FZXE_js.isTemplateElementId(elementId)) {
|
|
4204
4200
|
const slideId = activeSlide?.id;
|
|
4205
4201
|
if (slideId) {
|
|
4206
4202
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4248,7 +4244,7 @@ function useElementOperations(input) {
|
|
|
4248
4244
|
);
|
|
4249
4245
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4250
4246
|
(updates) => {
|
|
4251
|
-
if (!selectedElement || !
|
|
4247
|
+
if (!selectedElement || !chunk7ZQ2FZXE_js.hasShapeProperties(selectedElement)) {
|
|
4252
4248
|
return;
|
|
4253
4249
|
}
|
|
4254
4250
|
updateSelectedElement({
|
|
@@ -4259,17 +4255,17 @@ function useElementOperations(input) {
|
|
|
4259
4255
|
);
|
|
4260
4256
|
const updateSelectedTextStyle = react.useCallback(
|
|
4261
4257
|
(updates) => {
|
|
4262
|
-
if (!selectedElement || !
|
|
4258
|
+
if (!selectedElement || !chunk7ZQ2FZXE_js.hasTextProperties(selectedElement)) {
|
|
4263
4259
|
return;
|
|
4264
4260
|
}
|
|
4265
|
-
const inlineSel =
|
|
4261
|
+
const inlineSel = chunk7ZQ2FZXE_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4266
4262
|
if (inlineSel && selectedElement.textSegments) {
|
|
4267
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4263
|
+
const { newSegments: newSegments2, newSelection } = chunk7ZQ2FZXE_js.applyStyleToSelectedSegments(
|
|
4268
4264
|
selectedElement.textSegments,
|
|
4269
4265
|
inlineSel,
|
|
4270
4266
|
updates
|
|
4271
4267
|
);
|
|
4272
|
-
|
|
4268
|
+
chunk7ZQ2FZXE_js.setPendingSelectionRestore(newSelection);
|
|
4273
4269
|
updateSelectedElement({
|
|
4274
4270
|
textSegments: newSegments2
|
|
4275
4271
|
});
|
|
@@ -4289,12 +4285,12 @@ function useElementOperations(input) {
|
|
|
4289
4285
|
);
|
|
4290
4286
|
const updateSelectedTextCase = react.useCallback(
|
|
4291
4287
|
(mode) => {
|
|
4292
|
-
if (!selectedElement || !
|
|
4288
|
+
if (!selectedElement || !chunk7ZQ2FZXE_js.hasTextProperties(selectedElement)) {
|
|
4293
4289
|
return;
|
|
4294
4290
|
}
|
|
4295
|
-
const inlineSel =
|
|
4291
|
+
const inlineSel = chunk7ZQ2FZXE_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4296
4292
|
if (inlineSel && selectedElement.textSegments) {
|
|
4297
|
-
const newSegments =
|
|
4293
|
+
const newSegments = chunk7ZQ2FZXE_js.applyCaseTransformToSegments(
|
|
4298
4294
|
selectedElement.textSegments,
|
|
4299
4295
|
inlineSel,
|
|
4300
4296
|
mode
|
|
@@ -4304,14 +4300,14 @@ function useElementOperations(input) {
|
|
|
4304
4300
|
}
|
|
4305
4301
|
const updates = {};
|
|
4306
4302
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4307
|
-
updates.textSegments =
|
|
4303
|
+
updates.textSegments = chunk7ZQ2FZXE_js.applyCaseTransformToSegments(
|
|
4308
4304
|
selectedElement.textSegments,
|
|
4309
4305
|
null,
|
|
4310
4306
|
mode
|
|
4311
4307
|
);
|
|
4312
4308
|
}
|
|
4313
4309
|
if (typeof selectedElement.text === "string") {
|
|
4314
|
-
updates.text =
|
|
4310
|
+
updates.text = chunk7ZQ2FZXE_js.transformTextCase(selectedElement.text, mode);
|
|
4315
4311
|
}
|
|
4316
4312
|
updateSelectedElement(updates);
|
|
4317
4313
|
},
|
|
@@ -4324,15 +4320,15 @@ function useElementOperations(input) {
|
|
|
4324
4320
|
[setSlides]
|
|
4325
4321
|
);
|
|
4326
4322
|
const masterViewTarget = masterView?.target ?? null;
|
|
4327
|
-
const activeElements = masterViewTarget ?
|
|
4323
|
+
const activeElements = masterViewTarget ? chunk7ZQ2FZXE_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4328
4324
|
const updateActiveElements = react.useCallback(
|
|
4329
4325
|
(updater) => {
|
|
4330
4326
|
if (masterView?.target) {
|
|
4331
4327
|
applyMasterViewWrite(
|
|
4332
|
-
|
|
4328
|
+
chunk7ZQ2FZXE_js.replaceMasterViewElements(
|
|
4333
4329
|
masterView,
|
|
4334
4330
|
masterView.target,
|
|
4335
|
-
updater(
|
|
4331
|
+
updater(chunk7ZQ2FZXE_js.masterViewElements(masterView, masterView.target))
|
|
4336
4332
|
)
|
|
4337
4333
|
);
|
|
4338
4334
|
return;
|
|
@@ -4385,7 +4381,7 @@ function useSectionOperations(input) {
|
|
|
4385
4381
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4386
4382
|
const addSection2 = react.useCallback(
|
|
4387
4383
|
(name, afterSlideIndex) => {
|
|
4388
|
-
const result =
|
|
4384
|
+
const result = chunk7ZQ2FZXE_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4389
4385
|
setSlides(result.slides);
|
|
4390
4386
|
setSections(result.sections);
|
|
4391
4387
|
markDirty();
|
|
@@ -4394,7 +4390,7 @@ function useSectionOperations(input) {
|
|
|
4394
4390
|
);
|
|
4395
4391
|
const renameSection2 = react.useCallback(
|
|
4396
4392
|
(sectionId, newName) => {
|
|
4397
|
-
const result =
|
|
4393
|
+
const result = chunk7ZQ2FZXE_js.renameSection(sections, slides, sectionId, newName);
|
|
4398
4394
|
setSections(result.sections);
|
|
4399
4395
|
setSlides(result.slides);
|
|
4400
4396
|
markDirty();
|
|
@@ -4403,7 +4399,7 @@ function useSectionOperations(input) {
|
|
|
4403
4399
|
);
|
|
4404
4400
|
const deleteSection2 = react.useCallback(
|
|
4405
4401
|
(sectionId) => {
|
|
4406
|
-
const result =
|
|
4402
|
+
const result = chunk7ZQ2FZXE_js.deleteSection(sections, slides, sectionId);
|
|
4407
4403
|
setSections(result.sections);
|
|
4408
4404
|
setSlides(result.slides);
|
|
4409
4405
|
markDirty();
|
|
@@ -4412,21 +4408,21 @@ function useSectionOperations(input) {
|
|
|
4412
4408
|
);
|
|
4413
4409
|
const moveSectionUp2 = react.useCallback(
|
|
4414
4410
|
(sectionId) => {
|
|
4415
|
-
setSections(
|
|
4411
|
+
setSections(chunk7ZQ2FZXE_js.moveSectionUp(sections, sectionId));
|
|
4416
4412
|
markDirty();
|
|
4417
4413
|
},
|
|
4418
4414
|
[sections, setSections, markDirty]
|
|
4419
4415
|
);
|
|
4420
4416
|
const moveSectionDown2 = react.useCallback(
|
|
4421
4417
|
(sectionId) => {
|
|
4422
|
-
setSections(
|
|
4418
|
+
setSections(chunk7ZQ2FZXE_js.moveSectionDown(sections, sectionId));
|
|
4423
4419
|
markDirty();
|
|
4424
4420
|
},
|
|
4425
4421
|
[sections, setSections, markDirty]
|
|
4426
4422
|
);
|
|
4427
4423
|
const moveSlidesToSection2 = react.useCallback(
|
|
4428
4424
|
(slideIndexes, targetSectionId) => {
|
|
4429
|
-
const result =
|
|
4425
|
+
const result = chunk7ZQ2FZXE_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4430
4426
|
setSlides(result.slides);
|
|
4431
4427
|
setSections(result.sections);
|
|
4432
4428
|
markDirty();
|
|
@@ -4455,19 +4451,19 @@ function useSectionOperations(input) {
|
|
|
4455
4451
|
|
|
4456
4452
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4457
4453
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4458
|
-
const resized =
|
|
4454
|
+
const resized = chunk7ZQ2FZXE_js.applyResize(
|
|
4459
4455
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4460
4456
|
handle,
|
|
4461
4457
|
dx,
|
|
4462
4458
|
dy,
|
|
4463
4459
|
1,
|
|
4464
|
-
{ minSize:
|
|
4460
|
+
{ minSize: chunk2HLDBQH7_js.MIN_ELEMENT_SIZE }
|
|
4465
4461
|
);
|
|
4466
4462
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4467
4463
|
if (!snapToGrid) {
|
|
4468
4464
|
return box;
|
|
4469
4465
|
}
|
|
4470
|
-
return
|
|
4466
|
+
return chunk7ZQ2FZXE_js.snapBoxToGrid(box, handle, gridSpacingPx, chunk2HLDBQH7_js.MIN_ELEMENT_SIZE);
|
|
4471
4467
|
}
|
|
4472
4468
|
function resolveLiveTarget(input) {
|
|
4473
4469
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4580,7 +4576,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4580
4576
|
width: el.width,
|
|
4581
4577
|
height: el.height
|
|
4582
4578
|
}));
|
|
4583
|
-
const snapResult =
|
|
4579
|
+
const snapResult = chunk7ZQ2FZXE_js.computeSnapToShape(
|
|
4584
4580
|
targetX,
|
|
4585
4581
|
targetY,
|
|
4586
4582
|
primaryEl.width,
|
|
@@ -4619,7 +4615,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4619
4615
|
if (live) {
|
|
4620
4616
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4621
4617
|
const start = drag.startPositionsById[id];
|
|
4622
|
-
|
|
4618
|
+
chunk7ZQ2FZXE_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4623
4619
|
x: start.x + appliedDx,
|
|
4624
4620
|
y: start.y + appliedDy
|
|
4625
4621
|
});
|
|
@@ -4653,22 +4649,22 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4653
4649
|
if (rs.domEl) {
|
|
4654
4650
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4655
4651
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4656
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4657
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4652
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunk2HLDBQH7_js.MIN_ELEMENT_SIZE)}px`;
|
|
4653
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunk2HLDBQH7_js.MIN_ELEMENT_SIZE)}px`;
|
|
4658
4654
|
}
|
|
4659
4655
|
if (live) {
|
|
4660
|
-
|
|
4656
|
+
chunk7ZQ2FZXE_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4661
4657
|
x: geo.x,
|
|
4662
4658
|
y: geo.y,
|
|
4663
|
-
width: Math.max(geo.width,
|
|
4664
|
-
height: Math.max(geo.height,
|
|
4659
|
+
width: Math.max(geo.width, chunk2HLDBQH7_js.MIN_ELEMENT_SIZE),
|
|
4660
|
+
height: Math.max(geo.height, chunk2HLDBQH7_js.MIN_ELEMENT_SIZE)
|
|
4665
4661
|
});
|
|
4666
4662
|
}
|
|
4667
4663
|
}
|
|
4668
4664
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4669
4665
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4670
4666
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4671
|
-
const adjustments =
|
|
4667
|
+
const adjustments = chunk7ZQ2FZXE_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4672
4668
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4673
4669
|
adj.moved = true;
|
|
4674
4670
|
}
|
|
@@ -4743,13 +4739,13 @@ function processPointerUp(input) {
|
|
|
4743
4739
|
if (i !== activeSlideIndex) {
|
|
4744
4740
|
return s;
|
|
4745
4741
|
}
|
|
4746
|
-
const rerouted =
|
|
4742
|
+
const rerouted = chunk7ZQ2FZXE_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4747
4743
|
if (rerouted.length === 0) {
|
|
4748
4744
|
return s;
|
|
4749
4745
|
}
|
|
4750
4746
|
return {
|
|
4751
4747
|
...s,
|
|
4752
|
-
elements:
|
|
4748
|
+
elements: chunk7ZQ2FZXE_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4753
4749
|
};
|
|
4754
4750
|
})
|
|
4755
4751
|
);
|
|
@@ -4774,9 +4770,9 @@ function processPointerUp(input) {
|
|
|
4774
4770
|
}
|
|
4775
4771
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4776
4772
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4777
|
-
const hitIds =
|
|
4773
|
+
const hitIds = chunk7ZQ2FZXE_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4778
4774
|
if (marquee.additive) {
|
|
4779
|
-
const merged =
|
|
4775
|
+
const merged = chunk7ZQ2FZXE_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4780
4776
|
if (merged.length > 0) {
|
|
4781
4777
|
applySelection(merged[0], merged);
|
|
4782
4778
|
} else {
|
|
@@ -4799,8 +4795,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4799
4795
|
}
|
|
4800
4796
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4801
4797
|
});
|
|
4802
|
-
const rerouted =
|
|
4803
|
-
return
|
|
4798
|
+
const rerouted = chunk7ZQ2FZXE_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4799
|
+
return chunk7ZQ2FZXE_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4804
4800
|
};
|
|
4805
4801
|
if (editTemplateMode) {
|
|
4806
4802
|
const slideId = activeSlide?.id;
|
|
@@ -4957,11 +4953,11 @@ function useCanvasInteractions(input) {
|
|
|
4957
4953
|
return;
|
|
4958
4954
|
}
|
|
4959
4955
|
const el = elementLookup.get(editId);
|
|
4960
|
-
if (el &&
|
|
4956
|
+
if (el && chunk7ZQ2FZXE_js.hasTextProperties(el)) {
|
|
4961
4957
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4962
|
-
const newSegments =
|
|
4958
|
+
const newSegments = chunk7ZQ2FZXE_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4963
4959
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
4964
|
-
const newHeight =
|
|
4960
|
+
const newHeight = chunk7ZQ2FZXE_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
4965
4961
|
ops.updateElementById(editId, {
|
|
4966
4962
|
text: committedText,
|
|
4967
4963
|
textSegments: newSegments,
|
|
@@ -4973,7 +4969,7 @@ function useCanvasInteractions(input) {
|
|
|
4973
4969
|
setInlineEditingText("");
|
|
4974
4970
|
};
|
|
4975
4971
|
const openEquationEditorForElement = (el) => {
|
|
4976
|
-
if (!
|
|
4972
|
+
if (!chunk7ZQ2FZXE_js.hasTextProperties(el)) {
|
|
4977
4973
|
return false;
|
|
4978
4974
|
}
|
|
4979
4975
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5003,7 +4999,7 @@ function useCanvasInteractions(input) {
|
|
|
5003
4999
|
justInteractedRef.current = false;
|
|
5004
5000
|
} else {
|
|
5005
5001
|
const el = elementLookup.get(elementId);
|
|
5006
|
-
if (el &&
|
|
5002
|
+
if (el && chunk7ZQ2FZXE_js.hasTextProperties(el) && chunk7ZQ2FZXE_js.canInteractWithElement(el, "textEdit")) {
|
|
5007
5003
|
if (!openEquationEditorForElement(el)) {
|
|
5008
5004
|
setInlineEditingElementId(elementId);
|
|
5009
5005
|
setInlineEditingText(el.text ?? "");
|
|
@@ -5022,7 +5018,7 @@ function useCanvasInteractions(input) {
|
|
|
5022
5018
|
if (openEquationEditorForElement(el)) {
|
|
5023
5019
|
return;
|
|
5024
5020
|
}
|
|
5025
|
-
if (
|
|
5021
|
+
if (chunk7ZQ2FZXE_js.hasTextProperties(el) && chunk7ZQ2FZXE_js.canInteractWithElement(el, "textEdit")) {
|
|
5026
5022
|
setInlineEditingElementId(elementId);
|
|
5027
5023
|
setInlineEditingText(el.text ?? "");
|
|
5028
5024
|
}
|
|
@@ -5045,7 +5041,7 @@ function useCanvasInteractions(input) {
|
|
|
5045
5041
|
justSelectedRef.current = false;
|
|
5046
5042
|
}
|
|
5047
5043
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
5048
|
-
const movableIds =
|
|
5044
|
+
const movableIds = chunk7ZQ2FZXE_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
5049
5045
|
if (movableIds.length === 0) {
|
|
5050
5046
|
return;
|
|
5051
5047
|
}
|
|
@@ -5115,7 +5111,7 @@ function useCanvasInteractions(input) {
|
|
|
5115
5111
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5116
5112
|
e.stopPropagation();
|
|
5117
5113
|
const el = elementLookup.get(elementId);
|
|
5118
|
-
if (!el || !
|
|
5114
|
+
if (!el || !chunk7ZQ2FZXE_js.canInteractWithElement(el, "resize")) {
|
|
5119
5115
|
return;
|
|
5120
5116
|
}
|
|
5121
5117
|
resizeStateRef.current = {
|
|
@@ -5137,7 +5133,7 @@ function useCanvasInteractions(input) {
|
|
|
5137
5133
|
};
|
|
5138
5134
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5139
5135
|
const el = elementLookup.get(elementId);
|
|
5140
|
-
if (!el || !
|
|
5136
|
+
if (!el || !chunk7ZQ2FZXE_js.canInteractWithElement(el, "rotate")) {
|
|
5141
5137
|
return;
|
|
5142
5138
|
}
|
|
5143
5139
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5157,10 +5153,10 @@ function useCanvasInteractions(input) {
|
|
|
5157
5153
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5158
5154
|
e.stopPropagation();
|
|
5159
5155
|
const el = elementLookup.get(elementId);
|
|
5160
|
-
if (!el || !
|
|
5156
|
+
if (!el || !chunk7ZQ2FZXE_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5161
5157
|
return;
|
|
5162
5158
|
}
|
|
5163
|
-
shapeAdjustmentDragStateRef.current =
|
|
5159
|
+
shapeAdjustmentDragStateRef.current = chunk7ZQ2FZXE_js.beginShapeAdjustment(
|
|
5164
5160
|
el,
|
|
5165
5161
|
descriptor,
|
|
5166
5162
|
e.clientX,
|
|
@@ -5207,7 +5203,7 @@ function createFileHandlers(deps) {
|
|
|
5207
5203
|
h = Math.round(h * scale);
|
|
5208
5204
|
}
|
|
5209
5205
|
addElement({
|
|
5210
|
-
id:
|
|
5206
|
+
id: chunk7ZQ2FZXE_js.generateElementId(),
|
|
5211
5207
|
type: "image",
|
|
5212
5208
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5213
5209
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5218,7 +5214,7 @@ function createFileHandlers(deps) {
|
|
|
5218
5214
|
};
|
|
5219
5215
|
img.onerror = () => {
|
|
5220
5216
|
addElement({
|
|
5221
|
-
id:
|
|
5217
|
+
id: chunk7ZQ2FZXE_js.generateElementId(),
|
|
5222
5218
|
type: "image",
|
|
5223
5219
|
x: 100,
|
|
5224
5220
|
y: 100,
|
|
@@ -5237,14 +5233,14 @@ function createFileHandlers(deps) {
|
|
|
5237
5233
|
return;
|
|
5238
5234
|
}
|
|
5239
5235
|
e.target.value = "";
|
|
5240
|
-
const mediaType =
|
|
5236
|
+
const mediaType = chunk7ZQ2FZXE_js.classifyMediaType(file.type);
|
|
5241
5237
|
if (!mediaType) {
|
|
5242
5238
|
return;
|
|
5243
5239
|
}
|
|
5244
5240
|
const elFilePath = file.path;
|
|
5245
5241
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5246
5242
|
addElement({
|
|
5247
|
-
id:
|
|
5243
|
+
id: chunk7ZQ2FZXE_js.generateElementId(),
|
|
5248
5244
|
type: "media",
|
|
5249
5245
|
mediaType,
|
|
5250
5246
|
mediaMimeType: file.type || void 0,
|
|
@@ -5419,13 +5415,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5419
5415
|
return;
|
|
5420
5416
|
}
|
|
5421
5417
|
addElement({
|
|
5422
|
-
id:
|
|
5418
|
+
id: chunk7ZQ2FZXE_js.generateElementId(),
|
|
5423
5419
|
type: "smartArt",
|
|
5424
5420
|
x: 100,
|
|
5425
5421
|
y: 120,
|
|
5426
5422
|
width: 600,
|
|
5427
5423
|
height: 340,
|
|
5428
|
-
smartArtData:
|
|
5424
|
+
smartArtData: chunk7ZQ2FZXE_js.buildSmartArtPresetData(
|
|
5429
5425
|
layout,
|
|
5430
5426
|
defaultItems,
|
|
5431
5427
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5437,7 +5433,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5437
5433
|
return;
|
|
5438
5434
|
}
|
|
5439
5435
|
addElement({
|
|
5440
|
-
id:
|
|
5436
|
+
id: chunk7ZQ2FZXE_js.generateElementId(),
|
|
5441
5437
|
type: "shape",
|
|
5442
5438
|
x: 120,
|
|
5443
5439
|
y: 200,
|
|
@@ -5475,7 +5471,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5475
5471
|
return;
|
|
5476
5472
|
}
|
|
5477
5473
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5478
|
-
if (resolved.url && !
|
|
5474
|
+
if (resolved.url && !chunk7ZQ2FZXE_js.isUrlSafe(resolved.url)) {
|
|
5479
5475
|
return;
|
|
5480
5476
|
}
|
|
5481
5477
|
const actionClick = {
|
|
@@ -5499,7 +5495,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5499
5495
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5500
5496
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5501
5497
|
addElement({
|
|
5502
|
-
id:
|
|
5498
|
+
id: chunk7ZQ2FZXE_js.generateElementId(),
|
|
5503
5499
|
type: "shape",
|
|
5504
5500
|
x: 120,
|
|
5505
5501
|
y: 200,
|
|
@@ -5521,11 +5517,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5521
5517
|
if (!activeSlide) {
|
|
5522
5518
|
return;
|
|
5523
5519
|
}
|
|
5524
|
-
const preset =
|
|
5520
|
+
const preset = chunk7ZQ2FZXE_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5525
5521
|
if (!preset) {
|
|
5526
5522
|
return;
|
|
5527
5523
|
}
|
|
5528
|
-
const defaultPptxAction =
|
|
5524
|
+
const defaultPptxAction = chunk7ZQ2FZXE_js.elementActionToPptxAction({
|
|
5529
5525
|
trigger: "click",
|
|
5530
5526
|
type: preset.defaultAction
|
|
5531
5527
|
});
|
|
@@ -5534,7 +5530,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5534
5530
|
defaultPptxAction.highlightClick = true;
|
|
5535
5531
|
}
|
|
5536
5532
|
addElement({
|
|
5537
|
-
id:
|
|
5533
|
+
id: chunk7ZQ2FZXE_js.generateElementId(),
|
|
5538
5534
|
type: "shape",
|
|
5539
5535
|
x: 150,
|
|
5540
5536
|
y: 150,
|
|
@@ -5601,14 +5597,14 @@ function useInsertElements(input) {
|
|
|
5601
5597
|
return;
|
|
5602
5598
|
}
|
|
5603
5599
|
addElement({
|
|
5604
|
-
id:
|
|
5600
|
+
id: chunk7ZQ2FZXE_js.generateElementId(),
|
|
5605
5601
|
type: "text",
|
|
5606
5602
|
x: 100,
|
|
5607
5603
|
y: 100,
|
|
5608
5604
|
width: 300,
|
|
5609
5605
|
height: 60,
|
|
5610
5606
|
text: "",
|
|
5611
|
-
textStyle: { fontSize:
|
|
5607
|
+
textStyle: { fontSize: chunk2HLDBQH7_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5612
5608
|
});
|
|
5613
5609
|
};
|
|
5614
5610
|
const handleAddShape = () => {
|
|
@@ -5616,7 +5612,7 @@ function useInsertElements(input) {
|
|
|
5616
5612
|
return;
|
|
5617
5613
|
}
|
|
5618
5614
|
addElement({
|
|
5619
|
-
id:
|
|
5615
|
+
id: chunk7ZQ2FZXE_js.generateElementId(),
|
|
5620
5616
|
type: "shape",
|
|
5621
5617
|
x: 150,
|
|
5622
5618
|
y: 150,
|
|
@@ -5635,15 +5631,15 @@ function useInsertElements(input) {
|
|
|
5635
5631
|
return;
|
|
5636
5632
|
}
|
|
5637
5633
|
addElement({
|
|
5638
|
-
...
|
|
5639
|
-
id:
|
|
5634
|
+
...chunk7ZQ2FZXE_js.newTableElement(chunk2HLDBQH7_js.DEFAULT_TABLE_ROWS, chunk2HLDBQH7_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5635
|
+
id: chunk7ZQ2FZXE_js.generateElementId()
|
|
5640
5636
|
});
|
|
5641
5637
|
};
|
|
5642
5638
|
const handleAddChart = (chartKind) => {
|
|
5643
5639
|
if (!activeSlide) {
|
|
5644
5640
|
return;
|
|
5645
5641
|
}
|
|
5646
|
-
addElement(
|
|
5642
|
+
addElement(chunk7ZQ2FZXE_js.createDefaultChartElement(chartKind));
|
|
5647
5643
|
};
|
|
5648
5644
|
const structured = createStructuredElementHandlers({
|
|
5649
5645
|
activeSlide,
|
|
@@ -5713,7 +5709,7 @@ function useClipboardHandlers(input) {
|
|
|
5713
5709
|
if (!selectedElement) {
|
|
5714
5710
|
return;
|
|
5715
5711
|
}
|
|
5716
|
-
setClipboardPayload(
|
|
5712
|
+
setClipboardPayload(chunk7ZQ2FZXE_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5717
5713
|
};
|
|
5718
5714
|
const handleDelete = () => {
|
|
5719
5715
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5730,7 +5726,7 @@ function useClipboardHandlers(input) {
|
|
|
5730
5726
|
handleDelete();
|
|
5731
5727
|
};
|
|
5732
5728
|
const insertClone = (source) => {
|
|
5733
|
-
const clone =
|
|
5729
|
+
const clone = chunk7ZQ2FZXE_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5734
5730
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5735
5731
|
ops.applySelection(clone.id);
|
|
5736
5732
|
history.markDirty();
|
|
@@ -5765,7 +5761,7 @@ function resolveShapePath(el) {
|
|
|
5765
5761
|
return el.pathData;
|
|
5766
5762
|
}
|
|
5767
5763
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5768
|
-
const clipPath =
|
|
5764
|
+
const clipPath = chunk7ZQ2FZXE_js.getPresetShapeClipPath(el.shapeType);
|
|
5769
5765
|
if (clipPath) {
|
|
5770
5766
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5771
5767
|
if (svgPath) {
|
|
@@ -5816,7 +5812,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5816
5812
|
return parts.join(" ");
|
|
5817
5813
|
}
|
|
5818
5814
|
function transformPathToGlobal(pathData, el) {
|
|
5819
|
-
const polys =
|
|
5815
|
+
const polys = chunk7ZQ2FZXE_js.svgPathToPolygons(pathData);
|
|
5820
5816
|
if (polys.length === 0) {
|
|
5821
5817
|
return pathData;
|
|
5822
5818
|
}
|
|
@@ -5836,10 +5832,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5836
5832
|
y: pt.y * scaleY + el.y
|
|
5837
5833
|
}))
|
|
5838
5834
|
);
|
|
5839
|
-
return
|
|
5835
|
+
return chunk7ZQ2FZXE_js.polygonsToSvgPath(transformed);
|
|
5840
5836
|
}
|
|
5841
5837
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5842
|
-
const polys =
|
|
5838
|
+
const polys = chunk7ZQ2FZXE_js.svgPathToPolygons(pathData);
|
|
5843
5839
|
if (polys.length === 0) {
|
|
5844
5840
|
return pathData;
|
|
5845
5841
|
}
|
|
@@ -5849,10 +5845,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5849
5845
|
y: pt.y - y
|
|
5850
5846
|
}))
|
|
5851
5847
|
);
|
|
5852
|
-
return
|
|
5848
|
+
return chunk7ZQ2FZXE_js.polygonsToSvgPath(transformed);
|
|
5853
5849
|
}
|
|
5854
5850
|
function pathBounds(pathData) {
|
|
5855
|
-
const polys =
|
|
5851
|
+
const polys = chunk7ZQ2FZXE_js.svgPathToPolygons(pathData);
|
|
5856
5852
|
let minX = Infinity;
|
|
5857
5853
|
let minY = Infinity;
|
|
5858
5854
|
let maxX = -Infinity;
|
|
@@ -5911,7 +5907,7 @@ function useMergeShapesHandler(input) {
|
|
|
5911
5907
|
let allFragments = [];
|
|
5912
5908
|
let remaining = globalPaths[0];
|
|
5913
5909
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5914
|
-
const frags =
|
|
5910
|
+
const frags = chunk7ZQ2FZXE_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5915
5911
|
if (Array.isArray(frags)) {
|
|
5916
5912
|
allFragments = frags;
|
|
5917
5913
|
}
|
|
@@ -5940,7 +5936,7 @@ function useMergeShapesHandler(input) {
|
|
|
5940
5936
|
bounds.height
|
|
5941
5937
|
);
|
|
5942
5938
|
const newEl = {
|
|
5943
|
-
id:
|
|
5939
|
+
id: chunk7ZQ2FZXE_js.generateElementId(),
|
|
5944
5940
|
type: "shape",
|
|
5945
5941
|
x: bounds.x,
|
|
5946
5942
|
y: bounds.y,
|
|
@@ -5978,7 +5974,7 @@ function useMergeShapesHandler(input) {
|
|
|
5978
5974
|
} else {
|
|
5979
5975
|
let resultPath = globalPaths[0];
|
|
5980
5976
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5981
|
-
const result =
|
|
5977
|
+
const result = chunk7ZQ2FZXE_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5982
5978
|
if (typeof result === "string") {
|
|
5983
5979
|
resultPath = result;
|
|
5984
5980
|
}
|
|
@@ -5999,7 +5995,7 @@ function useMergeShapesHandler(input) {
|
|
|
5999
5995
|
);
|
|
6000
5996
|
const primary = targets[0];
|
|
6001
5997
|
const newEl = {
|
|
6002
|
-
id:
|
|
5998
|
+
id: chunk7ZQ2FZXE_js.generateElementId(),
|
|
6003
5999
|
type: "shape",
|
|
6004
6000
|
x: bounds.x,
|
|
6005
6001
|
y: bounds.y,
|
|
@@ -6062,7 +6058,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6062
6058
|
if (ids.length < 2 || !activeSlide) {
|
|
6063
6059
|
return;
|
|
6064
6060
|
}
|
|
6065
|
-
const { elements, groupId } =
|
|
6061
|
+
const { elements, groupId } = chunk7ZQ2FZXE_js.groupElements(ops.activeElements, ids, chunk7ZQ2FZXE_js.generateElementId());
|
|
6066
6062
|
if (groupId === null) {
|
|
6067
6063
|
return;
|
|
6068
6064
|
}
|
|
@@ -6075,11 +6071,11 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6075
6071
|
return;
|
|
6076
6072
|
}
|
|
6077
6073
|
const group = selectedElement;
|
|
6078
|
-
const intoTemplate =
|
|
6074
|
+
const intoTemplate = chunk7ZQ2FZXE_js.isTemplateElementId(group.id);
|
|
6079
6075
|
const childIds = group.children.map(
|
|
6080
|
-
(child) => intoTemplate ?
|
|
6076
|
+
(child) => intoTemplate ? chunk7ZQ2FZXE_js.makeCloneId(true, child.id || group.id) : child.id || chunk7ZQ2FZXE_js.generateElementId()
|
|
6081
6077
|
);
|
|
6082
|
-
const { elements, childIds: usedIds } =
|
|
6078
|
+
const { elements, childIds: usedIds } = chunk7ZQ2FZXE_js.ungroupElements(
|
|
6083
6079
|
ops.activeElements,
|
|
6084
6080
|
group.id,
|
|
6085
6081
|
childIds,
|
|
@@ -6108,7 +6104,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6108
6104
|
if (!edge) {
|
|
6109
6105
|
return;
|
|
6110
6106
|
}
|
|
6111
|
-
const positions =
|
|
6107
|
+
const positions = chunk7ZQ2FZXE_js.alignElements(selectedElements, edge);
|
|
6112
6108
|
for (const [id, pos] of positions) {
|
|
6113
6109
|
const el = elementLookup.get(id);
|
|
6114
6110
|
if (!el) {
|
|
@@ -6126,7 +6122,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6126
6122
|
if (!distAxis) {
|
|
6127
6123
|
return;
|
|
6128
6124
|
}
|
|
6129
|
-
const positions =
|
|
6125
|
+
const positions = chunk7ZQ2FZXE_js.distributeElements(selectedElements, distAxis);
|
|
6130
6126
|
for (const [id, pos] of positions) {
|
|
6131
6127
|
const el = elementLookup.get(id);
|
|
6132
6128
|
if (!el) {
|
|
@@ -6143,7 +6139,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6143
6139
|
}
|
|
6144
6140
|
const id = selectedElement.id;
|
|
6145
6141
|
ops.updateActiveElements(
|
|
6146
|
-
(els) => direction === "forward" ?
|
|
6142
|
+
(els) => direction === "forward" ? chunk7ZQ2FZXE_js.bringForward(els, id) : direction === "backward" ? chunk7ZQ2FZXE_js.sendBackward(els, id) : els
|
|
6147
6143
|
);
|
|
6148
6144
|
history.markDirty();
|
|
6149
6145
|
};
|
|
@@ -6153,7 +6149,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6153
6149
|
}
|
|
6154
6150
|
const id = selectedElement.id;
|
|
6155
6151
|
ops.updateActiveElements(
|
|
6156
|
-
(els) => direction === "front" ?
|
|
6152
|
+
(els) => direction === "front" ? chunk7ZQ2FZXE_js.bringToFront(els, id) : chunk7ZQ2FZXE_js.sendToBack(els, id)
|
|
6157
6153
|
);
|
|
6158
6154
|
history.markDirty();
|
|
6159
6155
|
};
|
|
@@ -6284,7 +6280,7 @@ function useSlideManagement(input) {
|
|
|
6284
6280
|
theme
|
|
6285
6281
|
} = input;
|
|
6286
6282
|
const handleAddSlide = () => {
|
|
6287
|
-
const newSlide =
|
|
6283
|
+
const newSlide = chunk7ZQ2FZXE_js.createBlankSlide(slides.length + 1);
|
|
6288
6284
|
ops.updateSlides((prev) => {
|
|
6289
6285
|
const next = [...prev];
|
|
6290
6286
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6347,7 +6343,7 @@ function useSlideManagement(input) {
|
|
|
6347
6343
|
}
|
|
6348
6344
|
const clone = {
|
|
6349
6345
|
...src,
|
|
6350
|
-
id:
|
|
6346
|
+
id: chunk7ZQ2FZXE_js.makeSlideId(),
|
|
6351
6347
|
elements: src.elements.map((el) => ({
|
|
6352
6348
|
...el,
|
|
6353
6349
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6379,7 +6375,7 @@ function useSlideManagement(input) {
|
|
|
6379
6375
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6380
6376
|
const insertAt = activeSlideIndex + 1;
|
|
6381
6377
|
const draft = {
|
|
6382
|
-
...
|
|
6378
|
+
...chunk7ZQ2FZXE_js.createBlankSlide(slides.length + 1),
|
|
6383
6379
|
layoutPath,
|
|
6384
6380
|
...layoutName ? { layoutName } : {}
|
|
6385
6381
|
};
|
|
@@ -6412,9 +6408,9 @@ function useSlideManagement(input) {
|
|
|
6412
6408
|
};
|
|
6413
6409
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6414
6410
|
const insertAt = activeSlideIndex + 1;
|
|
6415
|
-
const draft =
|
|
6411
|
+
const draft = chunk7ZQ2FZXE_js.buildSlideTemplateSlide(templateId, chunk7ZQ2FZXE_js.makeSlideId(), slides.length + 1, {
|
|
6416
6412
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6417
|
-
scheme:
|
|
6413
|
+
scheme: chunk7ZQ2FZXE_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6418
6414
|
});
|
|
6419
6415
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6420
6416
|
setActiveSlideIndex(insertAt);
|
|
@@ -6451,7 +6447,7 @@ function createTableMergeHandlers(input) {
|
|
|
6451
6447
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6452
6448
|
return;
|
|
6453
6449
|
}
|
|
6454
|
-
const newTableData =
|
|
6450
|
+
const newTableData = chunk7ZQ2FZXE_js.mergeCells(
|
|
6455
6451
|
[
|
|
6456
6452
|
{ row: rowIndex, col: columnIndex },
|
|
6457
6453
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6459,7 +6455,7 @@ function createTableMergeHandlers(input) {
|
|
|
6459
6455
|
td
|
|
6460
6456
|
);
|
|
6461
6457
|
const updates = { tableData: newTableData };
|
|
6462
|
-
const newRawXml =
|
|
6458
|
+
const newRawXml = chunk7ZQ2FZXE_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6463
6459
|
if (newRawXml) {
|
|
6464
6460
|
updates.rawXml = newRawXml;
|
|
6465
6461
|
}
|
|
@@ -6485,7 +6481,7 @@ function createTableMergeHandlers(input) {
|
|
|
6485
6481
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6486
6482
|
return;
|
|
6487
6483
|
}
|
|
6488
|
-
const newTableData =
|
|
6484
|
+
const newTableData = chunk7ZQ2FZXE_js.mergeCells(
|
|
6489
6485
|
[
|
|
6490
6486
|
{ row: rowIndex, col: columnIndex },
|
|
6491
6487
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6493,7 +6489,7 @@ function createTableMergeHandlers(input) {
|
|
|
6493
6489
|
td
|
|
6494
6490
|
);
|
|
6495
6491
|
const updates = { tableData: newTableData };
|
|
6496
|
-
const newRawXml =
|
|
6492
|
+
const newRawXml = chunk7ZQ2FZXE_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6497
6493
|
if (newRawXml) {
|
|
6498
6494
|
updates.rawXml = newRawXml;
|
|
6499
6495
|
}
|
|
@@ -6508,9 +6504,9 @@ function createTableMergeHandlers(input) {
|
|
|
6508
6504
|
return;
|
|
6509
6505
|
}
|
|
6510
6506
|
const td = selectedElement.tableData;
|
|
6511
|
-
const newTableData =
|
|
6507
|
+
const newTableData = chunk7ZQ2FZXE_js.mergeCells(ts.selectedCells, td);
|
|
6512
6508
|
const updates = { tableData: newTableData };
|
|
6513
|
-
const newRawXml =
|
|
6509
|
+
const newRawXml = chunk7ZQ2FZXE_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6514
6510
|
if (newRawXml) {
|
|
6515
6511
|
updates.rawXml = newRawXml;
|
|
6516
6512
|
}
|
|
@@ -6527,9 +6523,9 @@ function createTableMergeHandlers(input) {
|
|
|
6527
6523
|
}
|
|
6528
6524
|
const { rowIndex, columnIndex } = ts;
|
|
6529
6525
|
const td = selectedElement.tableData;
|
|
6530
|
-
const newTableData =
|
|
6526
|
+
const newTableData = chunk7ZQ2FZXE_js.splitCell(rowIndex, columnIndex, td);
|
|
6531
6527
|
const updates = { tableData: newTableData };
|
|
6532
|
-
const newRawXml =
|
|
6528
|
+
const newRawXml = chunk7ZQ2FZXE_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6533
6529
|
if (newRawXml) {
|
|
6534
6530
|
updates.rawXml = newRawXml;
|
|
6535
6531
|
}
|
|
@@ -6552,19 +6548,21 @@ function createTableStructHandlers(input) {
|
|
|
6552
6548
|
elementLookup,
|
|
6553
6549
|
setTableEditorState,
|
|
6554
6550
|
ops,
|
|
6555
|
-
history
|
|
6551
|
+
history,
|
|
6552
|
+
transformCommittedText
|
|
6556
6553
|
} = input;
|
|
6557
|
-
const handleCommitCellEdit = (elementId, rowIndex, colIndex,
|
|
6554
|
+
const handleCommitCellEdit = (elementId, rowIndex, colIndex, rawText) => {
|
|
6558
6555
|
const el = elementLookup.get(elementId);
|
|
6559
6556
|
if (!el || el.type !== "table") {
|
|
6560
6557
|
return;
|
|
6561
6558
|
}
|
|
6559
|
+
const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
|
|
6562
6560
|
const updates = {};
|
|
6563
6561
|
if (el.tableData) {
|
|
6564
|
-
updates.tableData =
|
|
6562
|
+
updates.tableData = chunk7ZQ2FZXE_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6565
6563
|
}
|
|
6566
6564
|
if (el.rawXml) {
|
|
6567
|
-
const newRawXml =
|
|
6565
|
+
const newRawXml = chunk7ZQ2FZXE_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6568
6566
|
if (newRawXml) {
|
|
6569
6567
|
updates.rawXml = newRawXml;
|
|
6570
6568
|
}
|
|
@@ -6588,7 +6586,7 @@ function createTableStructHandlers(input) {
|
|
|
6588
6586
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6589
6587
|
const updates = {};
|
|
6590
6588
|
if (selectedElement.rawXml) {
|
|
6591
|
-
const newRawXml =
|
|
6589
|
+
const newRawXml = chunk7ZQ2FZXE_js.updateCellTextStyleInRawXml(
|
|
6592
6590
|
selectedElement,
|
|
6593
6591
|
rowIndex,
|
|
6594
6592
|
colIndex,
|
|
@@ -6652,9 +6650,9 @@ function createTableStructHandlers(input) {
|
|
|
6652
6650
|
return;
|
|
6653
6651
|
}
|
|
6654
6652
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6655
|
-
const newTableData =
|
|
6653
|
+
const newTableData = chunk7ZQ2FZXE_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6656
6654
|
const updates = { tableData: newTableData };
|
|
6657
|
-
const newRawXml =
|
|
6655
|
+
const newRawXml = chunk7ZQ2FZXE_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6658
6656
|
if (newRawXml) {
|
|
6659
6657
|
updates.rawXml = newRawXml;
|
|
6660
6658
|
}
|
|
@@ -6667,12 +6665,12 @@ function createTableStructHandlers(input) {
|
|
|
6667
6665
|
}
|
|
6668
6666
|
const td = selectedElement.tableData;
|
|
6669
6667
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6670
|
-
const newTableData =
|
|
6668
|
+
const newTableData = chunk7ZQ2FZXE_js.deleteTableRow(td, rowIdx);
|
|
6671
6669
|
if (newTableData === td) {
|
|
6672
6670
|
return;
|
|
6673
6671
|
}
|
|
6674
6672
|
const updates = { tableData: newTableData };
|
|
6675
|
-
const newRawXml =
|
|
6673
|
+
const newRawXml = chunk7ZQ2FZXE_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6676
6674
|
if (newRawXml) {
|
|
6677
6675
|
updates.rawXml = newRawXml;
|
|
6678
6676
|
}
|
|
@@ -6684,9 +6682,9 @@ function createTableStructHandlers(input) {
|
|
|
6684
6682
|
return;
|
|
6685
6683
|
}
|
|
6686
6684
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6687
|
-
const newTableData =
|
|
6685
|
+
const newTableData = chunk7ZQ2FZXE_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6688
6686
|
const updates = { tableData: newTableData };
|
|
6689
|
-
const newRawXml =
|
|
6687
|
+
const newRawXml = chunk7ZQ2FZXE_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6690
6688
|
if (newRawXml) {
|
|
6691
6689
|
updates.rawXml = newRawXml;
|
|
6692
6690
|
}
|
|
@@ -6699,12 +6697,12 @@ function createTableStructHandlers(input) {
|
|
|
6699
6697
|
}
|
|
6700
6698
|
const td = selectedElement.tableData;
|
|
6701
6699
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6702
|
-
const newTableData =
|
|
6700
|
+
const newTableData = chunk7ZQ2FZXE_js.deleteTableColumn(td, colIdx);
|
|
6703
6701
|
if (newTableData === td) {
|
|
6704
6702
|
return;
|
|
6705
6703
|
}
|
|
6706
6704
|
const updates = { tableData: newTableData };
|
|
6707
|
-
const newRawXml =
|
|
6705
|
+
const newRawXml = chunk7ZQ2FZXE_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6708
6706
|
if (newRawXml) {
|
|
6709
6707
|
updates.rawXml = newRawXml;
|
|
6710
6708
|
}
|
|
@@ -6740,8 +6738,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6740
6738
|
return html2canvasPro(element, {
|
|
6741
6739
|
...options,
|
|
6742
6740
|
onclone: async (doc, clonedEl) => {
|
|
6743
|
-
await
|
|
6744
|
-
|
|
6741
|
+
await chunk7ZQ2FZXE_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6742
|
+
chunk7ZQ2FZXE_js.preprocessCssForCapture(clonedEl);
|
|
6745
6743
|
if (typeof userOnClone === "function") {
|
|
6746
6744
|
userOnClone(doc, clonedEl);
|
|
6747
6745
|
}
|
|
@@ -6749,6 +6747,144 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6749
6747
|
});
|
|
6750
6748
|
}
|
|
6751
6749
|
|
|
6750
|
+
// src/viewer/hooks/useExportSaveAs.ts
|
|
6751
|
+
function useExportSaveAs(input) {
|
|
6752
|
+
const {
|
|
6753
|
+
slides,
|
|
6754
|
+
templateElementsBySlideId,
|
|
6755
|
+
filePath,
|
|
6756
|
+
handlerRef,
|
|
6757
|
+
headerFooter,
|
|
6758
|
+
presentationProperties,
|
|
6759
|
+
customShows,
|
|
6760
|
+
sections,
|
|
6761
|
+
coreProperties,
|
|
6762
|
+
appProperties,
|
|
6763
|
+
customProperties,
|
|
6764
|
+
tagCollections,
|
|
6765
|
+
slideMasters,
|
|
6766
|
+
notesMaster,
|
|
6767
|
+
handoutMaster,
|
|
6768
|
+
guides,
|
|
6769
|
+
activeSlideIndexForGuides,
|
|
6770
|
+
theme,
|
|
6771
|
+
canvasSize,
|
|
6772
|
+
slideSizeEmu,
|
|
6773
|
+
password
|
|
6774
|
+
} = input;
|
|
6775
|
+
const handleSaveAsFormat = async (format) => {
|
|
6776
|
+
const handler = handlerRef.current;
|
|
6777
|
+
if (!handler) {
|
|
6778
|
+
return;
|
|
6779
|
+
}
|
|
6780
|
+
const downloadName = chunk7ZQ2FZXE_js.savedPresentationFileName(filePath, format);
|
|
6781
|
+
try {
|
|
6782
|
+
const data = await buildSaveAsData(handler, format);
|
|
6783
|
+
const blob = new Blob([data], {
|
|
6784
|
+
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6785
|
+
});
|
|
6786
|
+
chunk7ZQ2FZXE_js.downloadBlob(blob, downloadName);
|
|
6787
|
+
} catch (err) {
|
|
6788
|
+
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
6789
|
+
}
|
|
6790
|
+
};
|
|
6791
|
+
const buildSaveAsData = async (handler, format) => {
|
|
6792
|
+
const slidesWithGuides = slides.map((slide, idx) => {
|
|
6793
|
+
if (idx !== activeSlideIndexForGuides) {
|
|
6794
|
+
return slide;
|
|
6795
|
+
}
|
|
6796
|
+
const pptxGuides = guides.map((g) => ({
|
|
6797
|
+
id: g.id,
|
|
6798
|
+
orientation: g.axis === "h" ? "horz" : "vert",
|
|
6799
|
+
positionEmu: chunk7ZQ2FZXE_js.guidePxToEmu(g.position)
|
|
6800
|
+
}));
|
|
6801
|
+
return {
|
|
6802
|
+
...slide,
|
|
6803
|
+
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
6804
|
+
};
|
|
6805
|
+
});
|
|
6806
|
+
const slidesToSave = chunk7ZQ2FZXE_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
6807
|
+
const saveOptions = {
|
|
6808
|
+
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
6809
|
+
// a preset picked in the inspector reached one save path and not the other.
|
|
6810
|
+
slideSize: chunk7ZQ2FZXE_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
6811
|
+
headerFooter,
|
|
6812
|
+
presentationProperties,
|
|
6813
|
+
customShows: customShows.length > 0 ? customShows : void 0,
|
|
6814
|
+
sections: sections.length > 0 ? sections : void 0,
|
|
6815
|
+
coreProperties: coreProperties ?? void 0,
|
|
6816
|
+
appProperties: appProperties ?? void 0,
|
|
6817
|
+
customProperties: customProperties.length > 0 ? customProperties : void 0,
|
|
6818
|
+
tags: tagCollections.length > 0 ? tagCollections : void 0,
|
|
6819
|
+
slideMasters,
|
|
6820
|
+
notesMaster,
|
|
6821
|
+
handoutMaster,
|
|
6822
|
+
outputFormat: format
|
|
6823
|
+
};
|
|
6824
|
+
return chunk7ZQ2FZXE_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
6825
|
+
};
|
|
6826
|
+
const handleExportJson = () => {
|
|
6827
|
+
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
6828
|
+
const slideSize = chunk7ZQ2FZXE_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
6829
|
+
const data = {
|
|
6830
|
+
slides: chunk7ZQ2FZXE_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
6831
|
+
width: canvasSize.width,
|
|
6832
|
+
height: canvasSize.height,
|
|
6833
|
+
widthEmu: slideSize.widthEmu,
|
|
6834
|
+
heightEmu: slideSize.heightEmu,
|
|
6835
|
+
slideSizeType: slideSize.type === "" ? void 0 : slideSize.type,
|
|
6836
|
+
theme,
|
|
6837
|
+
headerFooter,
|
|
6838
|
+
presentationProperties,
|
|
6839
|
+
customShows: customShows.length > 0 ? customShows : void 0,
|
|
6840
|
+
sections: sections.length > 0 ? sections : void 0,
|
|
6841
|
+
coreProperties: coreProperties ?? void 0,
|
|
6842
|
+
appProperties: appProperties ?? void 0,
|
|
6843
|
+
customProperties: customProperties.length > 0 ? customProperties : void 0,
|
|
6844
|
+
tags: tagCollections.length > 0 ? tagCollections : void 0,
|
|
6845
|
+
notesMaster,
|
|
6846
|
+
handoutMaster
|
|
6847
|
+
};
|
|
6848
|
+
try {
|
|
6849
|
+
chunk7ZQ2FZXE_js.exportDeckJson(data, sourceName);
|
|
6850
|
+
} catch (err) {
|
|
6851
|
+
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
6852
|
+
}
|
|
6853
|
+
};
|
|
6854
|
+
const handleSaveAsPptx = () => {
|
|
6855
|
+
void handleSaveAsFormat("pptx");
|
|
6856
|
+
};
|
|
6857
|
+
const handleSaveAsPpsx = () => {
|
|
6858
|
+
void handleSaveAsFormat("ppsx");
|
|
6859
|
+
};
|
|
6860
|
+
const handleSaveAsPptm = () => {
|
|
6861
|
+
void handleSaveAsFormat("pptm");
|
|
6862
|
+
};
|
|
6863
|
+
return {
|
|
6864
|
+
handleExportJson,
|
|
6865
|
+
handleSaveAsFormat,
|
|
6866
|
+
handleSaveAsPptx,
|
|
6867
|
+
handleSaveAsPpsx,
|
|
6868
|
+
handleSaveAsPptm
|
|
6869
|
+
};
|
|
6870
|
+
}
|
|
6871
|
+
|
|
6872
|
+
// src/viewer/utils/dom-helpers.ts
|
|
6873
|
+
function safePrompt(message, defaultValue) {
|
|
6874
|
+
try {
|
|
6875
|
+
return window.prompt(message, defaultValue);
|
|
6876
|
+
} catch {
|
|
6877
|
+
return null;
|
|
6878
|
+
}
|
|
6879
|
+
}
|
|
6880
|
+
function safeConfirm(message) {
|
|
6881
|
+
try {
|
|
6882
|
+
return window.confirm(message);
|
|
6883
|
+
} catch {
|
|
6884
|
+
return false;
|
|
6885
|
+
}
|
|
6886
|
+
}
|
|
6887
|
+
|
|
6752
6888
|
// src/viewer/utils/export-helpers.ts
|
|
6753
6889
|
async function renderElementToCanvas(element, scale = 2, backgroundColor) {
|
|
6754
6890
|
const canvas = await renderToCanvas(element, {
|
|
@@ -6797,7 +6933,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6797
6933
|
}
|
|
6798
6934
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6799
6935
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6800
|
-
|
|
6936
|
+
chunk7ZQ2FZXE_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6801
6937
|
}
|
|
6802
6938
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6803
6939
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6819,15 +6955,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6819
6955
|
continue;
|
|
6820
6956
|
}
|
|
6821
6957
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6822
|
-
images.push(
|
|
6958
|
+
images.push(chunk7ZQ2FZXE_js.canvasToJpegData(canvas));
|
|
6823
6959
|
}
|
|
6824
6960
|
onProgress?.(totalSlides, totalSlides);
|
|
6825
6961
|
setActiveSlide(currentSlideIndex);
|
|
6826
6962
|
if (images.length === 0) {
|
|
6827
|
-
throw new Error(
|
|
6963
|
+
throw new Error(chunkSWRY3SI5_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6828
6964
|
}
|
|
6829
|
-
const pdfBlobUrl =
|
|
6830
|
-
|
|
6965
|
+
const pdfBlobUrl = chunk2HLDBQH7_js.buildPdfFromImageData(images);
|
|
6966
|
+
chunk7ZQ2FZXE_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6831
6967
|
}
|
|
6832
6968
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6833
6969
|
const { scale = 2, onProgress } = options;
|
|
@@ -6873,10 +7009,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6873
7009
|
onProgress?.(totalSlides, totalSlides);
|
|
6874
7010
|
setActiveSlide(currentSlideIndex);
|
|
6875
7011
|
if (pages.length === 0) {
|
|
6876
|
-
throw new Error(
|
|
7012
|
+
throw new Error(chunkSWRY3SI5_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6877
7013
|
}
|
|
6878
|
-
const pdfDataUrl =
|
|
6879
|
-
|
|
7014
|
+
const pdfDataUrl = chunk2HLDBQH7_js.buildNotesPdf(pages);
|
|
7015
|
+
chunk7ZQ2FZXE_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6880
7016
|
}
|
|
6881
7017
|
|
|
6882
7018
|
// src/viewer/utils/export-video.ts
|
|
@@ -6907,7 +7043,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6907
7043
|
}
|
|
6908
7044
|
setActiveSlide(currentSlideIndex);
|
|
6909
7045
|
if (slideCanvases.length === 0) {
|
|
6910
|
-
throw new Error(
|
|
7046
|
+
throw new Error(chunkSWRY3SI5_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
6911
7047
|
}
|
|
6912
7048
|
const firstCanvas = slideCanvases[0];
|
|
6913
7049
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -6915,12 +7051,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6915
7051
|
recordingCanvas.height = firstCanvas.height;
|
|
6916
7052
|
const ctx = recordingCanvas.getContext("2d");
|
|
6917
7053
|
if (!ctx) {
|
|
6918
|
-
throw new Error(
|
|
7054
|
+
throw new Error(chunkSWRY3SI5_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
6919
7055
|
}
|
|
6920
7056
|
const fps = 30;
|
|
6921
7057
|
const stream = recordingCanvas.captureStream(fps);
|
|
6922
7058
|
const recorder = new MediaRecorder(stream, {
|
|
6923
|
-
mimeType:
|
|
7059
|
+
mimeType: chunk7ZQ2FZXE_js.pickSupportedMimeType([...chunk7ZQ2FZXE_js.WEBM_MIME_CANDIDATES]),
|
|
6924
7060
|
videoBitsPerSecond: 5e6
|
|
6925
7061
|
});
|
|
6926
7062
|
const chunks = [];
|
|
@@ -6943,8 +7079,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6943
7079
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6944
7080
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6945
7081
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6946
|
-
const frameInterval =
|
|
6947
|
-
const framesNeeded =
|
|
7082
|
+
const frameInterval = chunk7ZQ2FZXE_js.fpsToFrameIntervalMs(fps);
|
|
7083
|
+
const framesNeeded = chunk7ZQ2FZXE_js.segmentFrameCount(duration, fps);
|
|
6948
7084
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6949
7085
|
if (signal?.aborted) {
|
|
6950
7086
|
recorder.stop();
|
|
@@ -6991,9 +7127,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6991
7127
|
}
|
|
6992
7128
|
setActiveSlide(currentSlideIndex);
|
|
6993
7129
|
if (frames.length === 0) {
|
|
6994
|
-
throw new Error(
|
|
7130
|
+
throw new Error(chunkSWRY3SI5_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6995
7131
|
}
|
|
6996
|
-
const gifBytes =
|
|
7132
|
+
const gifBytes = chunk7ZQ2FZXE_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6997
7133
|
onProgress?.(totalSlides, totalSlides);
|
|
6998
7134
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6999
7135
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -7047,7 +7183,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7047
7183
|
continue;
|
|
7048
7184
|
}
|
|
7049
7185
|
onProgress?.(processedCount, data.slides.length);
|
|
7050
|
-
let svg =
|
|
7186
|
+
let svg = chunk7ZQ2FZXE_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7051
7187
|
if (embedFonts && fontFaces?.length) {
|
|
7052
7188
|
svg = injectFontFaces(svg, fontFaces);
|
|
7053
7189
|
}
|
|
@@ -7058,194 +7194,6 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7058
7194
|
return results;
|
|
7059
7195
|
}
|
|
7060
7196
|
|
|
7061
|
-
// src/viewer/hooks/useExportSaveAs.ts
|
|
7062
|
-
function useExportSaveAs(input) {
|
|
7063
|
-
const {
|
|
7064
|
-
slides,
|
|
7065
|
-
templateElementsBySlideId,
|
|
7066
|
-
filePath,
|
|
7067
|
-
handlerRef,
|
|
7068
|
-
serializeSlides,
|
|
7069
|
-
headerFooter,
|
|
7070
|
-
presentationProperties,
|
|
7071
|
-
customShows,
|
|
7072
|
-
sections,
|
|
7073
|
-
coreProperties,
|
|
7074
|
-
appProperties,
|
|
7075
|
-
customProperties,
|
|
7076
|
-
tagCollections,
|
|
7077
|
-
slideMasters,
|
|
7078
|
-
notesMaster,
|
|
7079
|
-
handoutMaster,
|
|
7080
|
-
guides,
|
|
7081
|
-
activeSlideIndexForGuides,
|
|
7082
|
-
theme,
|
|
7083
|
-
canvasSize,
|
|
7084
|
-
slideSizeEmu,
|
|
7085
|
-
modalControls,
|
|
7086
|
-
password
|
|
7087
|
-
} = input;
|
|
7088
|
-
const {
|
|
7089
|
-
setExportModalOpen,
|
|
7090
|
-
setExportModalTitle,
|
|
7091
|
-
setExportProgress,
|
|
7092
|
-
setExportStatusMessage,
|
|
7093
|
-
exportAbortRef
|
|
7094
|
-
} = modalControls;
|
|
7095
|
-
const handlePackageForSharing = async () => {
|
|
7096
|
-
const abortCtrl = new AbortController();
|
|
7097
|
-
exportAbortRef.current = abortCtrl;
|
|
7098
|
-
setExportModalTitle("Package for Sharing");
|
|
7099
|
-
setExportStatusMessage("Preparing package...");
|
|
7100
|
-
setExportProgress(0);
|
|
7101
|
-
setExportModalOpen(true);
|
|
7102
|
-
try {
|
|
7103
|
-
const zip = new JSZip__default.default();
|
|
7104
|
-
const pkgFolder = zip.folder("presentation-package");
|
|
7105
|
-
setExportProgress(10);
|
|
7106
|
-
setExportStatusMessage("Adding presentation...");
|
|
7107
|
-
const pptxData = await serializeSlides();
|
|
7108
|
-
const pptxFilename = chunkIDTNKL4S_js.savedPresentationFileName(filePath);
|
|
7109
|
-
if (pptxData) {
|
|
7110
|
-
pkgFolder.file(pptxFilename, pptxData);
|
|
7111
|
-
}
|
|
7112
|
-
setExportProgress(70);
|
|
7113
|
-
setExportStatusMessage("Writing README...");
|
|
7114
|
-
const readme = chunkIDTNKL4S_js.generatePackageReadme(pptxFilename);
|
|
7115
|
-
pkgFolder.file("README.txt", readme);
|
|
7116
|
-
if (abortCtrl.signal.aborted) {
|
|
7117
|
-
throw new DOMException("Export cancelled", "AbortError");
|
|
7118
|
-
}
|
|
7119
|
-
setExportProgress(85);
|
|
7120
|
-
setExportStatusMessage("Generating ZIP...");
|
|
7121
|
-
const zipBlob = await zip.generateAsync({ type: "blob" });
|
|
7122
|
-
setExportProgress(95);
|
|
7123
|
-
setExportStatusMessage("Downloading...");
|
|
7124
|
-
chunkIDTNKL4S_js.downloadBlob(zipBlob, `${chunkIDTNKL4S_js.presentationBaseName(pptxFilename)}-package.zip`);
|
|
7125
|
-
setExportProgress(100);
|
|
7126
|
-
} catch (err) {
|
|
7127
|
-
if (err.name !== "AbortError") {
|
|
7128
|
-
console.error("[PowerPointViewer] Package export failed:", err);
|
|
7129
|
-
}
|
|
7130
|
-
} finally {
|
|
7131
|
-
exportAbortRef.current = null;
|
|
7132
|
-
setExportModalOpen(false);
|
|
7133
|
-
}
|
|
7134
|
-
};
|
|
7135
|
-
const handleSaveAsFormat = async (format) => {
|
|
7136
|
-
const handler = handlerRef.current;
|
|
7137
|
-
if (!handler) {
|
|
7138
|
-
return;
|
|
7139
|
-
}
|
|
7140
|
-
const downloadName = chunkIDTNKL4S_js.savedPresentationFileName(filePath, format);
|
|
7141
|
-
try {
|
|
7142
|
-
const data = await buildSaveAsData(handler, format);
|
|
7143
|
-
const blob = new Blob([data], {
|
|
7144
|
-
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
7145
|
-
});
|
|
7146
|
-
chunkIDTNKL4S_js.downloadBlob(blob, downloadName);
|
|
7147
|
-
} catch (err) {
|
|
7148
|
-
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
7149
|
-
}
|
|
7150
|
-
};
|
|
7151
|
-
const buildSaveAsData = async (handler, format) => {
|
|
7152
|
-
const slidesWithGuides = slides.map((slide, idx) => {
|
|
7153
|
-
if (idx !== activeSlideIndexForGuides) {
|
|
7154
|
-
return slide;
|
|
7155
|
-
}
|
|
7156
|
-
const pptxGuides = guides.map((g) => ({
|
|
7157
|
-
id: g.id,
|
|
7158
|
-
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7159
|
-
positionEmu: chunkIDTNKL4S_js.guidePxToEmu(g.position)
|
|
7160
|
-
}));
|
|
7161
|
-
return {
|
|
7162
|
-
...slide,
|
|
7163
|
-
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7164
|
-
};
|
|
7165
|
-
});
|
|
7166
|
-
const slidesToSave = chunkIDTNKL4S_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7167
|
-
const saveOptions = {
|
|
7168
|
-
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
7169
|
-
// a preset picked in the inspector reached one save path and not the other.
|
|
7170
|
-
slideSize: chunkIDTNKL4S_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
7171
|
-
headerFooter,
|
|
7172
|
-
presentationProperties,
|
|
7173
|
-
customShows: customShows.length > 0 ? customShows : void 0,
|
|
7174
|
-
sections: sections.length > 0 ? sections : void 0,
|
|
7175
|
-
coreProperties: coreProperties ?? void 0,
|
|
7176
|
-
appProperties: appProperties ?? void 0,
|
|
7177
|
-
customProperties: customProperties.length > 0 ? customProperties : void 0,
|
|
7178
|
-
tags: tagCollections.length > 0 ? tagCollections : void 0,
|
|
7179
|
-
slideMasters,
|
|
7180
|
-
notesMaster,
|
|
7181
|
-
handoutMaster,
|
|
7182
|
-
outputFormat: format
|
|
7183
|
-
};
|
|
7184
|
-
return chunkIDTNKL4S_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
7185
|
-
};
|
|
7186
|
-
const handleExportJson = () => {
|
|
7187
|
-
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7188
|
-
const slideSize = chunkIDTNKL4S_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7189
|
-
const data = {
|
|
7190
|
-
slides: chunkIDTNKL4S_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7191
|
-
width: canvasSize.width,
|
|
7192
|
-
height: canvasSize.height,
|
|
7193
|
-
widthEmu: slideSize.widthEmu,
|
|
7194
|
-
heightEmu: slideSize.heightEmu,
|
|
7195
|
-
slideSizeType: slideSize.type === "" ? void 0 : slideSize.type,
|
|
7196
|
-
theme,
|
|
7197
|
-
headerFooter,
|
|
7198
|
-
presentationProperties,
|
|
7199
|
-
customShows: customShows.length > 0 ? customShows : void 0,
|
|
7200
|
-
sections: sections.length > 0 ? sections : void 0,
|
|
7201
|
-
coreProperties: coreProperties ?? void 0,
|
|
7202
|
-
appProperties: appProperties ?? void 0,
|
|
7203
|
-
customProperties: customProperties.length > 0 ? customProperties : void 0,
|
|
7204
|
-
tags: tagCollections.length > 0 ? tagCollections : void 0,
|
|
7205
|
-
notesMaster,
|
|
7206
|
-
handoutMaster
|
|
7207
|
-
};
|
|
7208
|
-
try {
|
|
7209
|
-
chunkIDTNKL4S_js.exportDeckJson(data, sourceName);
|
|
7210
|
-
} catch (err) {
|
|
7211
|
-
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7212
|
-
}
|
|
7213
|
-
};
|
|
7214
|
-
const handleSaveAsPptx = () => {
|
|
7215
|
-
void handleSaveAsFormat("pptx");
|
|
7216
|
-
};
|
|
7217
|
-
const handleSaveAsPpsx = () => {
|
|
7218
|
-
void handleSaveAsFormat("ppsx");
|
|
7219
|
-
};
|
|
7220
|
-
const handleSaveAsPptm = () => {
|
|
7221
|
-
void handleSaveAsFormat("pptm");
|
|
7222
|
-
};
|
|
7223
|
-
return {
|
|
7224
|
-
handleExportJson,
|
|
7225
|
-
handlePackageForSharing,
|
|
7226
|
-
handleSaveAsFormat,
|
|
7227
|
-
handleSaveAsPptx,
|
|
7228
|
-
handleSaveAsPpsx,
|
|
7229
|
-
handleSaveAsPptm
|
|
7230
|
-
};
|
|
7231
|
-
}
|
|
7232
|
-
|
|
7233
|
-
// src/viewer/utils/dom-helpers.ts
|
|
7234
|
-
function safePrompt(message, defaultValue) {
|
|
7235
|
-
try {
|
|
7236
|
-
return window.prompt(message, defaultValue);
|
|
7237
|
-
} catch {
|
|
7238
|
-
return null;
|
|
7239
|
-
}
|
|
7240
|
-
}
|
|
7241
|
-
function safeConfirm(message) {
|
|
7242
|
-
try {
|
|
7243
|
-
return window.confirm(message);
|
|
7244
|
-
} catch {
|
|
7245
|
-
return false;
|
|
7246
|
-
}
|
|
7247
|
-
}
|
|
7248
|
-
|
|
7249
7197
|
// src/viewer/hooks/useExportHandlers.ts
|
|
7250
7198
|
function useExportHandlers(input) {
|
|
7251
7199
|
const {
|
|
@@ -7257,7 +7205,6 @@ function useExportHandlers(input) {
|
|
|
7257
7205
|
canvasStageRef,
|
|
7258
7206
|
setActiveSlideIndex,
|
|
7259
7207
|
handlerRef,
|
|
7260
|
-
serializeSlides,
|
|
7261
7208
|
headerFooter,
|
|
7262
7209
|
presentationProperties,
|
|
7263
7210
|
customShows,
|
|
@@ -7274,23 +7221,16 @@ function useExportHandlers(input) {
|
|
|
7274
7221
|
theme,
|
|
7275
7222
|
canvasSize,
|
|
7276
7223
|
slideSizeEmu,
|
|
7277
|
-
password
|
|
7224
|
+
password,
|
|
7225
|
+
imageExportScale
|
|
7278
7226
|
} = input;
|
|
7279
7227
|
const [exportModalOpen, setExportModalOpen] = react.useState(false);
|
|
7280
7228
|
const [exportModalTitle, setExportModalTitle] = react.useState("");
|
|
7281
7229
|
const [exportProgress, setExportProgress] = react.useState(0);
|
|
7282
7230
|
const [exportStatusMessage, setExportStatusMessage] = react.useState("");
|
|
7283
7231
|
const exportAbortRef = react.useRef(null);
|
|
7284
|
-
const modalControls = {
|
|
7285
|
-
setExportModalOpen,
|
|
7286
|
-
setExportModalTitle,
|
|
7287
|
-
setExportProgress,
|
|
7288
|
-
setExportStatusMessage,
|
|
7289
|
-
exportAbortRef
|
|
7290
|
-
};
|
|
7291
7232
|
const {
|
|
7292
7233
|
handleExportJson,
|
|
7293
|
-
handlePackageForSharing,
|
|
7294
7234
|
handleSaveAsFormat,
|
|
7295
7235
|
handleSaveAsPptx,
|
|
7296
7236
|
handleSaveAsPpsx,
|
|
@@ -7300,7 +7240,6 @@ function useExportHandlers(input) {
|
|
|
7300
7240
|
templateElementsBySlideId,
|
|
7301
7241
|
filePath,
|
|
7302
7242
|
handlerRef,
|
|
7303
|
-
serializeSlides,
|
|
7304
7243
|
headerFooter,
|
|
7305
7244
|
presentationProperties,
|
|
7306
7245
|
customShows,
|
|
@@ -7317,7 +7256,6 @@ function useExportHandlers(input) {
|
|
|
7317
7256
|
theme,
|
|
7318
7257
|
canvasSize,
|
|
7319
7258
|
slideSizeEmu,
|
|
7320
|
-
modalControls,
|
|
7321
7259
|
password
|
|
7322
7260
|
});
|
|
7323
7261
|
const handleExportPng = react.useCallback(async () => {
|
|
@@ -7327,12 +7265,13 @@ function useExportHandlers(input) {
|
|
|
7327
7265
|
}
|
|
7328
7266
|
try {
|
|
7329
7267
|
await exportSlideAsPng(stageEl, activeSlideIndex, {
|
|
7330
|
-
backgroundColor: activeSlide?.backgroundColor
|
|
7268
|
+
backgroundColor: activeSlide?.backgroundColor,
|
|
7269
|
+
scale: imageExportScale
|
|
7331
7270
|
});
|
|
7332
7271
|
} catch (err) {
|
|
7333
7272
|
console.error("[PowerPointViewer] PNG export failed:", err);
|
|
7334
7273
|
}
|
|
7335
|
-
}, [canvasStageRef, activeSlideIndex, activeSlide?.backgroundColor]);
|
|
7274
|
+
}, [canvasStageRef, activeSlideIndex, activeSlide?.backgroundColor, imageExportScale]);
|
|
7336
7275
|
const handleExportPdf = react.useCallback(async () => {
|
|
7337
7276
|
if (!canvasStageRef.current) {
|
|
7338
7277
|
return;
|
|
@@ -7351,30 +7290,30 @@ function useExportHandlers(input) {
|
|
|
7351
7290
|
activeSlideIndex,
|
|
7352
7291
|
"presentation.pdf",
|
|
7353
7292
|
{
|
|
7354
|
-
scale:
|
|
7293
|
+
scale: imageExportScale,
|
|
7355
7294
|
onProgress: (current, total) => {
|
|
7356
|
-
setExportProgress(
|
|
7357
|
-
setExportStatusMessage(
|
|
7295
|
+
setExportProgress(chunk7ZQ2FZXE_js.slideProgressPercent(current, total));
|
|
7296
|
+
setExportStatusMessage(chunk7ZQ2FZXE_js.slideStatusLabel("Rendering", current, total));
|
|
7358
7297
|
},
|
|
7359
7298
|
signal: abortCtrl.signal
|
|
7360
7299
|
}
|
|
7361
7300
|
);
|
|
7362
|
-
setExportProgress(
|
|
7301
|
+
setExportProgress(chunk7ZQ2FZXE_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7363
7302
|
setExportStatusMessage("Building PDF...");
|
|
7364
7303
|
await new Promise((r) => {
|
|
7365
7304
|
setTimeout(r, 100);
|
|
7366
7305
|
});
|
|
7367
|
-
setExportProgress(
|
|
7306
|
+
setExportProgress(chunk7ZQ2FZXE_js.EXPORT_DONE_PERCENT);
|
|
7368
7307
|
setExportStatusMessage("Done!");
|
|
7369
7308
|
} catch (err) {
|
|
7370
|
-
if (!
|
|
7309
|
+
if (!chunk7ZQ2FZXE_js.isExportAbortError(err)) {
|
|
7371
7310
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7372
7311
|
}
|
|
7373
7312
|
} finally {
|
|
7374
7313
|
exportAbortRef.current = null;
|
|
7375
7314
|
setExportModalOpen(false);
|
|
7376
7315
|
}
|
|
7377
|
-
}, [canvasStageRef, slides.length, setActiveSlideIndex, activeSlideIndex]);
|
|
7316
|
+
}, [canvasStageRef, slides.length, setActiveSlideIndex, activeSlideIndex, imageExportScale]);
|
|
7378
7317
|
const handleExportNotesPdf = react.useCallback(async () => {
|
|
7379
7318
|
if (!canvasStageRef.current) {
|
|
7380
7319
|
return;
|
|
@@ -7395,30 +7334,30 @@ function useExportHandlers(input) {
|
|
|
7395
7334
|
slideNotes,
|
|
7396
7335
|
"presentation-notes.pdf",
|
|
7397
7336
|
{
|
|
7398
|
-
scale:
|
|
7337
|
+
scale: imageExportScale,
|
|
7399
7338
|
onProgress: (current, total) => {
|
|
7400
|
-
setExportProgress(
|
|
7401
|
-
setExportStatusMessage(
|
|
7339
|
+
setExportProgress(chunk7ZQ2FZXE_js.slideProgressPercent(current, total));
|
|
7340
|
+
setExportStatusMessage(chunk7ZQ2FZXE_js.slideStatusLabel("Rendering", current, total));
|
|
7402
7341
|
},
|
|
7403
7342
|
signal: abortCtrl.signal
|
|
7404
7343
|
}
|
|
7405
7344
|
);
|
|
7406
|
-
setExportProgress(
|
|
7345
|
+
setExportProgress(chunk7ZQ2FZXE_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7407
7346
|
setExportStatusMessage("Building PDF...");
|
|
7408
7347
|
await new Promise((r) => {
|
|
7409
7348
|
setTimeout(r, 100);
|
|
7410
7349
|
});
|
|
7411
|
-
setExportProgress(
|
|
7350
|
+
setExportProgress(chunk7ZQ2FZXE_js.EXPORT_DONE_PERCENT);
|
|
7412
7351
|
setExportStatusMessage("Done!");
|
|
7413
7352
|
} catch (err) {
|
|
7414
|
-
if (!
|
|
7353
|
+
if (!chunk7ZQ2FZXE_js.isExportAbortError(err)) {
|
|
7415
7354
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7416
7355
|
}
|
|
7417
7356
|
} finally {
|
|
7418
7357
|
exportAbortRef.current = null;
|
|
7419
7358
|
setExportModalOpen(false);
|
|
7420
7359
|
}
|
|
7421
|
-
}, [canvasStageRef, slides, setActiveSlideIndex, activeSlideIndex]);
|
|
7360
|
+
}, [canvasStageRef, slides, setActiveSlideIndex, activeSlideIndex, imageExportScale]);
|
|
7422
7361
|
const handleCopySlideAsImage = react.useCallback(async () => {
|
|
7423
7362
|
const stageEl = canvasStageRef.current;
|
|
7424
7363
|
if (!stageEl) {
|
|
@@ -7426,12 +7365,13 @@ function useExportHandlers(input) {
|
|
|
7426
7365
|
}
|
|
7427
7366
|
try {
|
|
7428
7367
|
await copySlideToClipboard(stageEl, {
|
|
7429
|
-
backgroundColor: activeSlide?.backgroundColor
|
|
7368
|
+
backgroundColor: activeSlide?.backgroundColor,
|
|
7369
|
+
scale: imageExportScale
|
|
7430
7370
|
});
|
|
7431
7371
|
} catch (err) {
|
|
7432
7372
|
console.error("[PowerPointViewer] Copy slide as image failed:", err);
|
|
7433
7373
|
}
|
|
7434
|
-
}, [canvasStageRef, activeSlide?.backgroundColor]);
|
|
7374
|
+
}, [canvasStageRef, activeSlide?.backgroundColor, imageExportScale]);
|
|
7435
7375
|
const handleExportVideo = react.useCallback(async () => {
|
|
7436
7376
|
if (!canvasStageRef.current) {
|
|
7437
7377
|
return;
|
|
@@ -7452,22 +7392,22 @@ function useExportHandlers(input) {
|
|
|
7452
7392
|
scale: 1,
|
|
7453
7393
|
slideDurationMs: 3e3,
|
|
7454
7394
|
onProgress: (current, total) => {
|
|
7455
|
-
setExportProgress(
|
|
7456
|
-
setExportStatusMessage(
|
|
7395
|
+
setExportProgress(chunk7ZQ2FZXE_js.slideProgressPercent(current, total, 45));
|
|
7396
|
+
setExportStatusMessage(chunk7ZQ2FZXE_js.slideStatusLabel("Capturing", current, total));
|
|
7457
7397
|
},
|
|
7458
7398
|
onRecordProgress: (current, total) => {
|
|
7459
|
-
setExportProgress(
|
|
7460
|
-
setExportStatusMessage(
|
|
7399
|
+
setExportProgress(chunk7ZQ2FZXE_js.recordProgressPercent(current, total));
|
|
7400
|
+
setExportStatusMessage(chunk7ZQ2FZXE_js.slideStatusLabel("Recording", current, total));
|
|
7461
7401
|
},
|
|
7462
7402
|
signal: abortCtrl.signal
|
|
7463
7403
|
}
|
|
7464
7404
|
);
|
|
7465
|
-
setExportProgress(
|
|
7405
|
+
setExportProgress(chunk7ZQ2FZXE_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7466
7406
|
setExportStatusMessage("Saving file...");
|
|
7467
|
-
|
|
7468
|
-
setExportProgress(
|
|
7407
|
+
chunk7ZQ2FZXE_js.downloadBlob(blob, "presentation.webm");
|
|
7408
|
+
setExportProgress(chunk7ZQ2FZXE_js.EXPORT_DONE_PERCENT);
|
|
7469
7409
|
} catch (err) {
|
|
7470
|
-
if (!
|
|
7410
|
+
if (!chunk7ZQ2FZXE_js.isExportAbortError(err)) {
|
|
7471
7411
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7472
7412
|
}
|
|
7473
7413
|
} finally {
|
|
@@ -7495,18 +7435,18 @@ function useExportHandlers(input) {
|
|
|
7495
7435
|
scale: 0.5,
|
|
7496
7436
|
slideDurationMs: 2e3,
|
|
7497
7437
|
onProgress: (current, total) => {
|
|
7498
|
-
setExportProgress(
|
|
7499
|
-
setExportStatusMessage(
|
|
7438
|
+
setExportProgress(chunk7ZQ2FZXE_js.slideProgressPercent(current, total));
|
|
7439
|
+
setExportStatusMessage(chunk7ZQ2FZXE_js.slideStatusLabel("Encoding", current, total));
|
|
7500
7440
|
},
|
|
7501
7441
|
signal: abortCtrl.signal
|
|
7502
7442
|
}
|
|
7503
7443
|
);
|
|
7504
|
-
setExportProgress(
|
|
7444
|
+
setExportProgress(chunk7ZQ2FZXE_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7505
7445
|
setExportStatusMessage("Saving file...");
|
|
7506
|
-
|
|
7507
|
-
setExportProgress(
|
|
7446
|
+
chunk7ZQ2FZXE_js.downloadBlob(blob, "presentation.gif");
|
|
7447
|
+
setExportProgress(chunk7ZQ2FZXE_js.EXPORT_DONE_PERCENT);
|
|
7508
7448
|
} catch (err) {
|
|
7509
|
-
if (!
|
|
7449
|
+
if (!chunk7ZQ2FZXE_js.isExportAbortError(err)) {
|
|
7510
7450
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7511
7451
|
}
|
|
7512
7452
|
} finally {
|
|
@@ -7528,7 +7468,6 @@ function useExportHandlers(input) {
|
|
|
7528
7468
|
handleExportVideo,
|
|
7529
7469
|
handleExportGif,
|
|
7530
7470
|
handleExportJson,
|
|
7531
|
-
handlePackageForSharing,
|
|
7532
7471
|
handleSaveAsFormat,
|
|
7533
7472
|
handleSaveAsPptx,
|
|
7534
7473
|
handleSaveAsPpsx,
|
|
@@ -7540,95 +7479,96 @@ function useExportHandlers(input) {
|
|
|
7540
7479
|
exportStatusMessage
|
|
7541
7480
|
};
|
|
7542
7481
|
}
|
|
7543
|
-
|
|
7544
|
-
|
|
7545
|
-
|
|
7546
|
-
return false;
|
|
7547
|
-
}
|
|
7548
|
-
printWindow.document.open();
|
|
7549
|
-
printWindow.document.write(
|
|
7550
|
-
chunkIDTNKL4S_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7551
|
-
);
|
|
7552
|
-
printWindow.document.close();
|
|
7553
|
-
printWindow.focus();
|
|
7554
|
-
setTimeout(() => {
|
|
7555
|
-
printWindow.print();
|
|
7556
|
-
}, 300);
|
|
7557
|
-
return true;
|
|
7558
|
-
}
|
|
7559
|
-
function openPrintWindowWithDocument(htmlDocument) {
|
|
7560
|
-
const printWindow = window.open("", "_blank", "noopener,noreferrer");
|
|
7561
|
-
if (!printWindow) {
|
|
7562
|
-
return false;
|
|
7563
|
-
}
|
|
7564
|
-
printWindow.document.open();
|
|
7565
|
-
printWindow.document.write(htmlDocument);
|
|
7566
|
-
printWindow.document.close();
|
|
7567
|
-
printWindow.focus();
|
|
7568
|
-
setTimeout(() => {
|
|
7569
|
-
printWindow.print();
|
|
7570
|
-
}, 300);
|
|
7571
|
-
return true;
|
|
7482
|
+
var ViewerOptionsContext = react.createContext(chunk7ZQ2FZXE_js.DEFAULT_VIEWER_OPTIONS);
|
|
7483
|
+
function useViewerOptionsContext() {
|
|
7484
|
+
return react.useContext(ViewerOptionsContext);
|
|
7572
7485
|
}
|
|
7486
|
+
|
|
7487
|
+
// src/viewer/hooks/usePrintHandlers.ts
|
|
7573
7488
|
function usePrintHandlers(input) {
|
|
7574
7489
|
const { slides, activeSlideIndex, canvasStageRef, setActiveSlideIndex, pptxData } = input;
|
|
7575
7490
|
const [isPrintDialogOpen, setIsPrintDialogOpen] = react.useState(false);
|
|
7491
|
+
const { t } = reactI18next.useTranslation();
|
|
7492
|
+
const viewerOptions = useViewerOptionsContext();
|
|
7493
|
+
const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
|
|
7494
|
+
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunk7ZQ2FZXE_js.resolveImageResolutionScale(viewerOptions);
|
|
7576
7495
|
const handlePrint = () => {
|
|
7577
7496
|
setIsPrintDialogOpen(true);
|
|
7578
7497
|
};
|
|
7579
7498
|
const handlePrintSvg = async (settings) => {
|
|
7580
7499
|
setIsPrintDialogOpen(false);
|
|
7500
|
+
const printWindow = chunk7ZQ2FZXE_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7501
|
+
if (!printWindow) {
|
|
7502
|
+
console.warn(
|
|
7503
|
+
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
7504
|
+
);
|
|
7505
|
+
return;
|
|
7506
|
+
}
|
|
7581
7507
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7582
|
-
return
|
|
7508
|
+
return runRasterPrint(printWindow, settings);
|
|
7583
7509
|
}
|
|
7584
|
-
const colorFilter =
|
|
7585
|
-
const slideIndices =
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7510
|
+
const colorFilter = chunk7ZQ2FZXE_js.computeColorFilter(settings.colorMode);
|
|
7511
|
+
const slideIndices = chunk7ZQ2FZXE_js.filterHiddenSlideIndices(
|
|
7512
|
+
chunk7ZQ2FZXE_js.computeSlideIndices(
|
|
7513
|
+
settings.slideRange,
|
|
7514
|
+
activeSlideIndex,
|
|
7515
|
+
slides.length,
|
|
7516
|
+
settings.customRangeFrom,
|
|
7517
|
+
settings.customRangeTo
|
|
7518
|
+
),
|
|
7519
|
+
slides,
|
|
7520
|
+
includeHiddenSlides
|
|
7591
7521
|
);
|
|
7592
7522
|
try {
|
|
7593
7523
|
const svgs = exportAllSlidesToSvg(pptxData, {
|
|
7594
7524
|
slideIndices
|
|
7595
7525
|
});
|
|
7596
7526
|
if (svgs.length === 0) {
|
|
7527
|
+
printWindow.close();
|
|
7597
7528
|
return;
|
|
7598
7529
|
}
|
|
7599
|
-
const printDoc =
|
|
7530
|
+
const printDoc = chunk7ZQ2FZXE_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7600
7531
|
title: "Slides (Vector)",
|
|
7601
7532
|
orientation: settings.orientation,
|
|
7602
|
-
colorFilter
|
|
7533
|
+
colorFilter,
|
|
7534
|
+
scaleToFit: settings.scaleToFit
|
|
7603
7535
|
});
|
|
7604
|
-
|
|
7536
|
+
chunk7ZQ2FZXE_js.finishPrintWindow(printWindow, printDoc);
|
|
7605
7537
|
} catch (err) {
|
|
7606
7538
|
console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
|
|
7607
|
-
return
|
|
7539
|
+
return runRasterPrint(printWindow, settings);
|
|
7608
7540
|
}
|
|
7609
7541
|
};
|
|
7610
|
-
const
|
|
7611
|
-
|
|
7612
|
-
const
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7542
|
+
const runRasterPrint = async (printWindow, settings) => {
|
|
7543
|
+
const colorFilter = chunk7ZQ2FZXE_js.computeColorFilter(settings.colorMode);
|
|
7544
|
+
const slideIndices = chunk7ZQ2FZXE_js.filterHiddenSlideIndices(
|
|
7545
|
+
chunk7ZQ2FZXE_js.computeSlideIndices(
|
|
7546
|
+
settings.slideRange,
|
|
7547
|
+
activeSlideIndex,
|
|
7548
|
+
slides.length,
|
|
7549
|
+
settings.customRangeFrom,
|
|
7550
|
+
settings.customRangeTo
|
|
7551
|
+
),
|
|
7552
|
+
slides,
|
|
7553
|
+
includeHiddenSlides
|
|
7619
7554
|
);
|
|
7620
7555
|
if (settings.printWhat === "outline") {
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
|
|
7556
|
+
chunk7ZQ2FZXE_js.finishPrintWindow(
|
|
7557
|
+
printWindow,
|
|
7558
|
+
chunk7ZQ2FZXE_js.buildPrintHtmlDocument({
|
|
7559
|
+
title: "Outline",
|
|
7560
|
+
bodyHtml: `<div class="outline-page">${chunk7ZQ2FZXE_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7561
|
+
orientation: settings.orientation,
|
|
7562
|
+
colorFilter,
|
|
7563
|
+
frameSlides: settings.frameSlides,
|
|
7564
|
+
scaleToFit: settings.scaleToFit
|
|
7565
|
+
})
|
|
7627
7566
|
);
|
|
7628
7567
|
return;
|
|
7629
7568
|
}
|
|
7630
7569
|
try {
|
|
7631
7570
|
if (!canvasStageRef.current) {
|
|
7571
|
+
printWindow.close();
|
|
7632
7572
|
return;
|
|
7633
7573
|
}
|
|
7634
7574
|
const allImages = await captureAllSlidesAsPngDataUrls(
|
|
@@ -7636,46 +7576,70 @@ function usePrintHandlers(input) {
|
|
|
7636
7576
|
slides.length,
|
|
7637
7577
|
setActiveSlideIndex,
|
|
7638
7578
|
activeSlideIndex,
|
|
7639
|
-
{ scale:
|
|
7579
|
+
{ scale: printRasterScale }
|
|
7640
7580
|
);
|
|
7641
7581
|
if (allImages.length === 0) {
|
|
7582
|
+
printWindow.close();
|
|
7642
7583
|
return;
|
|
7643
7584
|
}
|
|
7644
7585
|
const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
|
|
7645
7586
|
if (settings.printWhat === "slides") {
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7587
|
+
chunk7ZQ2FZXE_js.finishPrintWindow(
|
|
7588
|
+
printWindow,
|
|
7589
|
+
chunk7ZQ2FZXE_js.buildPrintHtmlDocument({
|
|
7590
|
+
title: "Slides",
|
|
7591
|
+
bodyHtml: chunk7ZQ2FZXE_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7592
|
+
orientation: settings.orientation,
|
|
7593
|
+
colorFilter,
|
|
7594
|
+
frameSlides: settings.frameSlides,
|
|
7595
|
+
scaleToFit: settings.scaleToFit
|
|
7596
|
+
})
|
|
7652
7597
|
);
|
|
7653
7598
|
return;
|
|
7654
7599
|
}
|
|
7655
7600
|
if (settings.printWhat === "notes") {
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7601
|
+
chunk7ZQ2FZXE_js.finishPrintWindow(
|
|
7602
|
+
printWindow,
|
|
7603
|
+
chunk7ZQ2FZXE_js.buildPrintHtmlDocument({
|
|
7604
|
+
title: "Notes Pages",
|
|
7605
|
+
bodyHtml: chunk7ZQ2FZXE_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7606
|
+
orientation: "portrait",
|
|
7607
|
+
colorFilter,
|
|
7608
|
+
frameSlides: settings.frameSlides,
|
|
7609
|
+
scaleToFit: settings.scaleToFit
|
|
7610
|
+
})
|
|
7662
7611
|
);
|
|
7663
7612
|
return;
|
|
7664
7613
|
}
|
|
7665
7614
|
if (settings.printWhat === "handouts") {
|
|
7666
7615
|
const spp = settings.slidesPerPage;
|
|
7667
|
-
|
|
7668
|
-
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7616
|
+
chunk7ZQ2FZXE_js.finishPrintWindow(
|
|
7617
|
+
printWindow,
|
|
7618
|
+
chunk7ZQ2FZXE_js.buildPrintHtmlDocument({
|
|
7619
|
+
title: `Handout ${spp} per page`,
|
|
7620
|
+
bodyHtml: chunk7ZQ2FZXE_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7621
|
+
orientation: "portrait",
|
|
7622
|
+
colorFilter,
|
|
7623
|
+
frameSlides: settings.frameSlides,
|
|
7624
|
+
scaleToFit: settings.scaleToFit
|
|
7625
|
+
})
|
|
7673
7626
|
);
|
|
7674
7627
|
}
|
|
7675
7628
|
} catch (err) {
|
|
7676
7629
|
console.error("[PowerPointViewer] Print layout failed:", err);
|
|
7677
7630
|
}
|
|
7678
7631
|
};
|
|
7632
|
+
const handlePrintWithSettings = async (settings) => {
|
|
7633
|
+
setIsPrintDialogOpen(false);
|
|
7634
|
+
const printWindow = chunk7ZQ2FZXE_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7635
|
+
if (!printWindow) {
|
|
7636
|
+
console.warn(
|
|
7637
|
+
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
7638
|
+
);
|
|
7639
|
+
return;
|
|
7640
|
+
}
|
|
7641
|
+
return runRasterPrint(printWindow, settings);
|
|
7642
|
+
};
|
|
7679
7643
|
return {
|
|
7680
7644
|
handlePrint,
|
|
7681
7645
|
handlePrintWithSettings,
|
|
@@ -7730,8 +7694,8 @@ function useThemeHandlers(input) {
|
|
|
7730
7694
|
return;
|
|
7731
7695
|
}
|
|
7732
7696
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7733
|
-
const previousMap = theme?.colorScheme ?
|
|
7734
|
-
setSlides((prev) =>
|
|
7697
|
+
const previousMap = theme?.colorScheme ? chunk7ZQ2FZXE_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7698
|
+
setSlides((prev) => chunk7ZQ2FZXE_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7735
7699
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7736
7700
|
bumpHistory();
|
|
7737
7701
|
history.markDirty();
|
|
@@ -7836,7 +7800,7 @@ function useThemeSwitching(input) {
|
|
|
7836
7800
|
}
|
|
7837
7801
|
try {
|
|
7838
7802
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7839
|
-
const newData =
|
|
7803
|
+
const newData = chunk7ZQ2FZXE_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7840
7804
|
onDataChange(newData);
|
|
7841
7805
|
onThemeChanged?.(preset);
|
|
7842
7806
|
} catch (error) {
|
|
@@ -7853,7 +7817,7 @@ function useThemeSwitching(input) {
|
|
|
7853
7817
|
}
|
|
7854
7818
|
try {
|
|
7855
7819
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7856
|
-
const newData =
|
|
7820
|
+
const newData = chunk7ZQ2FZXE_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7857
7821
|
onDataChange(newData);
|
|
7858
7822
|
} catch (error) {
|
|
7859
7823
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7865,12 +7829,12 @@ function useThemeSwitching(input) {
|
|
|
7865
7829
|
if (!data?.theme?.colorScheme) {
|
|
7866
7830
|
return void 0;
|
|
7867
7831
|
}
|
|
7868
|
-
return
|
|
7869
|
-
(p) =>
|
|
7832
|
+
return chunk7ZQ2FZXE_js.THEME_PRESETS.find(
|
|
7833
|
+
(p) => chunk7ZQ2FZXE_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7870
7834
|
);
|
|
7871
7835
|
}, [data?.theme?.colorScheme]);
|
|
7872
7836
|
return {
|
|
7873
|
-
presets:
|
|
7837
|
+
presets: chunk7ZQ2FZXE_js.THEME_PRESETS,
|
|
7874
7838
|
switchToPreset,
|
|
7875
7839
|
switchToCustom,
|
|
7876
7840
|
currentPreset
|
|
@@ -7945,7 +7909,7 @@ function usePropertyHandlers(input) {
|
|
|
7945
7909
|
}
|
|
7946
7910
|
try {
|
|
7947
7911
|
const ab = await file.arrayBuffer();
|
|
7948
|
-
const h = new
|
|
7912
|
+
const h = new chunk7ZQ2FZXE_js.PptxHandler();
|
|
7949
7913
|
const other = await h.load(ab);
|
|
7950
7914
|
if (!other) {
|
|
7951
7915
|
return;
|
|
@@ -7955,7 +7919,7 @@ function usePropertyHandlers(input) {
|
|
|
7955
7919
|
width: canvasSize.width,
|
|
7956
7920
|
height: canvasSize.height
|
|
7957
7921
|
};
|
|
7958
|
-
setCompareResult(
|
|
7922
|
+
setCompareResult(chunk7ZQ2FZXE_js.comparePresentation(cur, other));
|
|
7959
7923
|
setIsComparePanelOpen(true);
|
|
7960
7924
|
} catch (err) {
|
|
7961
7925
|
console.warn("Compare failed:", err);
|
|
@@ -7972,7 +7936,7 @@ function usePropertyHandlers(input) {
|
|
|
7972
7936
|
if (!diff || diff.status === "unchanged") {
|
|
7973
7937
|
return;
|
|
7974
7938
|
}
|
|
7975
|
-
setSlides((prev) =>
|
|
7939
|
+
setSlides((prev) => chunk7ZQ2FZXE_js.applyAcceptSlide(prev, diff));
|
|
7976
7940
|
setIsDirty(true);
|
|
7977
7941
|
},
|
|
7978
7942
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7983,10 +7947,10 @@ function usePropertyHandlers(input) {
|
|
|
7983
7947
|
if (!compareResult) {
|
|
7984
7948
|
return;
|
|
7985
7949
|
}
|
|
7986
|
-
setSlides((prev) =>
|
|
7950
|
+
setSlides((prev) => chunk7ZQ2FZXE_js.applyAcceptAllSlides(prev, compareResult));
|
|
7987
7951
|
setIsDirty(true);
|
|
7988
7952
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7989
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7953
|
+
const usedFontFamilies = react.useMemo(() => chunk7ZQ2FZXE_js.collectUsedFonts(slides), [slides]);
|
|
7990
7954
|
return {
|
|
7991
7955
|
handleUpdateNotes,
|
|
7992
7956
|
handleUpdateSlide,
|
|
@@ -8141,7 +8105,7 @@ function useViewerDialogs(input) {
|
|
|
8141
8105
|
);
|
|
8142
8106
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8143
8107
|
const fontEmbedding = react.useMemo(
|
|
8144
|
-
() =>
|
|
8108
|
+
() => chunk7ZQ2FZXE_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8145
8109
|
[embeddedFontKey]
|
|
8146
8110
|
);
|
|
8147
8111
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8151,11 +8115,11 @@ function useViewerDialogs(input) {
|
|
|
8151
8115
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8152
8116
|
}
|
|
8153
8117
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8154
|
-
() => typeof window !== "undefined" ?
|
|
8118
|
+
() => typeof window !== "undefined" ? chunk7ZQ2FZXE_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8155
8119
|
);
|
|
8156
8120
|
react.useEffect(() => {
|
|
8157
8121
|
const handleWindow = () => setIsNarrowViewport(
|
|
8158
|
-
|
|
8122
|
+
chunk7ZQ2FZXE_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8159
8123
|
);
|
|
8160
8124
|
window.addEventListener("resize", handleWindow);
|
|
8161
8125
|
return () => window.removeEventListener("resize", handleWindow);
|
|
@@ -8308,15 +8272,15 @@ function useViewerDialogs(input) {
|
|
|
8308
8272
|
};
|
|
8309
8273
|
}
|
|
8310
8274
|
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8311
|
-
return
|
|
8275
|
+
return chunk7ZQ2FZXE_js.computeGridSpacingPx(documentGridSpacing, chunk2HLDBQH7_js.GRID_SIZE);
|
|
8312
8276
|
}
|
|
8313
8277
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8314
8278
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8315
|
-
return
|
|
8279
|
+
return chunk7ZQ2FZXE_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8316
8280
|
}
|
|
8317
8281
|
function computeSlideSectionGroups(slides, sections) {
|
|
8318
|
-
return
|
|
8319
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8282
|
+
return chunk7ZQ2FZXE_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8283
|
+
id: group.section?.id ?? (sections.length > 0 ? chunk2HLDBQH7_js.UNGROUPED_SECTION_ID : chunk2HLDBQH7_js.DEFAULT_SECTION_GROUP_ID),
|
|
8320
8284
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8321
8285
|
slideIndexes: group.slideIndexes,
|
|
8322
8286
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8328,7 +8292,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8328
8292
|
return void 0;
|
|
8329
8293
|
}
|
|
8330
8294
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8331
|
-
return
|
|
8295
|
+
return chunk7ZQ2FZXE_js.masterViewPseudoSlide(document2, {
|
|
8332
8296
|
tab: "slides",
|
|
8333
8297
|
masterIndex: 0,
|
|
8334
8298
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8356,10 +8320,10 @@ function useDerivedSlideState(input) {
|
|
|
8356
8320
|
);
|
|
8357
8321
|
const slideSectionGroups = react.useMemo(
|
|
8358
8322
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8359
|
-
if (group.id ===
|
|
8323
|
+
if (group.id === chunk2HLDBQH7_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8360
8324
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8361
8325
|
}
|
|
8362
|
-
if (group.id ===
|
|
8326
|
+
if (group.id === chunk2HLDBQH7_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8363
8327
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8364
8328
|
}
|
|
8365
8329
|
return group;
|
|
@@ -8459,34 +8423,28 @@ function useAnnotationHandlers(input) {
|
|
|
8459
8423
|
}, [annotations, setMode, setSlides, history]);
|
|
8460
8424
|
const handleSetMode = react.useCallback(
|
|
8461
8425
|
(nextMode) => {
|
|
8462
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8426
|
+
if (mode === "present" && nextMode !== "present" && !chunk7ZQ2FZXE_js.mayLeaveSlideShow()) {
|
|
8463
8427
|
return;
|
|
8464
8428
|
}
|
|
8465
8429
|
if (nextMode === "present") {
|
|
8466
8430
|
presentation.enterPresentMode();
|
|
8467
8431
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8468
|
-
|
|
8469
|
-
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8432
|
+
chunk7ZQ2FZXE_js.stopAllPersistentAudio();
|
|
8470
8433
|
if (promptKeepInkAnnotations) {
|
|
8434
|
+
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8471
8435
|
setShowKeepAnnotationsDialog(true);
|
|
8472
8436
|
} else {
|
|
8473
|
-
|
|
8437
|
+
annotations.clearAllAnnotations();
|
|
8438
|
+
setMode(nextMode);
|
|
8474
8439
|
}
|
|
8475
8440
|
} else {
|
|
8476
8441
|
if (mode === "present") {
|
|
8477
|
-
|
|
8442
|
+
chunk7ZQ2FZXE_js.stopAllPersistentAudio();
|
|
8478
8443
|
}
|
|
8479
8444
|
setMode(nextMode);
|
|
8480
8445
|
}
|
|
8481
8446
|
},
|
|
8482
|
-
[
|
|
8483
|
-
presentation,
|
|
8484
|
-
mode,
|
|
8485
|
-
annotations.hasAnyAnnotations,
|
|
8486
|
-
promptKeepInkAnnotations,
|
|
8487
|
-
handleKeepAnnotations,
|
|
8488
|
-
setMode
|
|
8489
|
-
]
|
|
8447
|
+
[presentation, mode, annotations, promptKeepInkAnnotations, setMode]
|
|
8490
8448
|
);
|
|
8491
8449
|
const handleDiscardAnnotations = react.useCallback(() => {
|
|
8492
8450
|
annotations.clearAllAnnotations();
|
|
@@ -8545,13 +8503,13 @@ function useSerialize(input) {
|
|
|
8545
8503
|
let processedSlide = slide;
|
|
8546
8504
|
if (pendingEditId) {
|
|
8547
8505
|
const updatedElements = slide.elements.map((el) => {
|
|
8548
|
-
if (el.id !== pendingEditId || !
|
|
8506
|
+
if (el.id !== pendingEditId || !chunk7ZQ2FZXE_js.hasTextProperties(el)) {
|
|
8549
8507
|
return el;
|
|
8550
8508
|
}
|
|
8551
8509
|
return {
|
|
8552
8510
|
...el,
|
|
8553
8511
|
text: pendingEditText,
|
|
8554
|
-
textSegments:
|
|
8512
|
+
textSegments: chunk7ZQ2FZXE_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8555
8513
|
};
|
|
8556
8514
|
});
|
|
8557
8515
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8564,19 +8522,19 @@ function useSerialize(input) {
|
|
|
8564
8522
|
const pptxGuides = guides.map((g) => ({
|
|
8565
8523
|
id: g.id,
|
|
8566
8524
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8567
|
-
positionEmu:
|
|
8525
|
+
positionEmu: chunk7ZQ2FZXE_js.guidePxToEmu(g.position)
|
|
8568
8526
|
}));
|
|
8569
8527
|
return {
|
|
8570
8528
|
...processedSlide,
|
|
8571
8529
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8572
8530
|
};
|
|
8573
8531
|
});
|
|
8574
|
-
const slidesToSave =
|
|
8532
|
+
const slidesToSave = chunk7ZQ2FZXE_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8575
8533
|
const saveOptions = {
|
|
8576
8534
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8577
8535
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8578
8536
|
// slide-size edit reaches the file.
|
|
8579
|
-
slideSize:
|
|
8537
|
+
slideSize: chunk7ZQ2FZXE_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8580
8538
|
headerFooter,
|
|
8581
8539
|
presentationProperties,
|
|
8582
8540
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -8588,9 +8546,9 @@ function useSerialize(input) {
|
|
|
8588
8546
|
slideMasters,
|
|
8589
8547
|
notesMaster,
|
|
8590
8548
|
handoutMaster,
|
|
8591
|
-
...
|
|
8549
|
+
...chunk7ZQ2FZXE_js.embeddedFontSaveOptions(embedFonts)
|
|
8592
8550
|
};
|
|
8593
|
-
return
|
|
8551
|
+
return chunk7ZQ2FZXE_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8594
8552
|
}, [
|
|
8595
8553
|
slides,
|
|
8596
8554
|
templateElementsBySlideId,
|
|
@@ -8625,7 +8583,7 @@ function useRecoveryDetection(input) {
|
|
|
8625
8583
|
const onRestore = input.onRestore;
|
|
8626
8584
|
const openVersionHistory = input.openVersionHistory;
|
|
8627
8585
|
react.useEffect(() => {
|
|
8628
|
-
if (!
|
|
8586
|
+
if (!chunk7ZQ2FZXE_js.shouldProbeAutosaveRecovery({
|
|
8629
8587
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8630
8588
|
filePath,
|
|
8631
8589
|
loading,
|
|
@@ -8637,7 +8595,7 @@ function useRecoveryDetection(input) {
|
|
|
8637
8595
|
}
|
|
8638
8596
|
recoveryCheckedRef.current = true;
|
|
8639
8597
|
void (async () => {
|
|
8640
|
-
const offer = await
|
|
8598
|
+
const offer = await chunk7ZQ2FZXE_js.probeAutosaveRecovery(filePath);
|
|
8641
8599
|
if (!offer) {
|
|
8642
8600
|
return;
|
|
8643
8601
|
}
|
|
@@ -8650,7 +8608,7 @@ function useRecoveryDetection(input) {
|
|
|
8650
8608
|
const record = recordRef.current;
|
|
8651
8609
|
setPrompt(null);
|
|
8652
8610
|
if (record && onRestore) {
|
|
8653
|
-
onRestore(
|
|
8611
|
+
onRestore(chunk7ZQ2FZXE_js.acceptAutosaveRecovery(record));
|
|
8654
8612
|
}
|
|
8655
8613
|
recordRef.current = null;
|
|
8656
8614
|
}, [onRestore]);
|
|
@@ -8659,7 +8617,7 @@ function useRecoveryDetection(input) {
|
|
|
8659
8617
|
setPrompt(null);
|
|
8660
8618
|
recordRef.current = null;
|
|
8661
8619
|
if (record) {
|
|
8662
|
-
void
|
|
8620
|
+
void chunk7ZQ2FZXE_js.discardAutosaveRecovery(record);
|
|
8663
8621
|
}
|
|
8664
8622
|
}, []);
|
|
8665
8623
|
return { prompt, restore, discard };
|
|
@@ -8684,8 +8642,7 @@ function usePresentationSetup(input) {
|
|
|
8684
8642
|
onToggleSubtitles
|
|
8685
8643
|
} = input;
|
|
8686
8644
|
const actionSoundHandlerRef = react.useRef(null);
|
|
8687
|
-
const
|
|
8688
|
-
const pendingModeRef = react.useRef("edit");
|
|
8645
|
+
const exitModeHandlerRef = react.useRef(null);
|
|
8689
8646
|
const annotations = usePresentationAnnotations({
|
|
8690
8647
|
isActive: mode === "present",
|
|
8691
8648
|
activeSlideIndex,
|
|
@@ -8699,19 +8656,22 @@ function usePresentationSetup(input) {
|
|
|
8699
8656
|
containerRef,
|
|
8700
8657
|
content,
|
|
8701
8658
|
onSetMode: (nextMode) => {
|
|
8702
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8659
|
+
if (mode === "present" && nextMode !== "present" && !chunk7ZQ2FZXE_js.mayLeaveSlideShow()) {
|
|
8703
8660
|
return;
|
|
8704
8661
|
}
|
|
8705
|
-
if (mode === "present" && nextMode !== "present"
|
|
8706
|
-
|
|
8707
|
-
|
|
8708
|
-
|
|
8709
|
-
if (
|
|
8710
|
-
|
|
8711
|
-
|
|
8662
|
+
if (mode === "present" && nextMode !== "present") {
|
|
8663
|
+
chunk7ZQ2FZXE_js.stopAllPersistentAudio();
|
|
8664
|
+
stopAnimationSound();
|
|
8665
|
+
const exitHandler = exitModeHandlerRef.current;
|
|
8666
|
+
if (exitHandler) {
|
|
8667
|
+
exitHandler(nextMode);
|
|
8668
|
+
return;
|
|
8669
|
+
}
|
|
8670
|
+
if (annotations.hasAnyAnnotations && !promptKeepInkAnnotations) {
|
|
8671
|
+
annotations.clearAllAnnotations();
|
|
8712
8672
|
}
|
|
8713
|
-
setMode(nextMode);
|
|
8714
8673
|
}
|
|
8674
|
+
setMode(nextMode);
|
|
8715
8675
|
},
|
|
8716
8676
|
onSetActiveSlideIndex: setActiveSlideIndex,
|
|
8717
8677
|
onPlayActionSound: (soundPath, options) => {
|
|
@@ -8762,15 +8722,22 @@ function usePresentationSetup(input) {
|
|
|
8762
8722
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8763
8723
|
onToggleSubtitles,
|
|
8764
8724
|
onSaveRehearsalTimings: (timings) => {
|
|
8765
|
-
setSlides((prev) =>
|
|
8725
|
+
setSlides((prev) => chunk7ZQ2FZXE_js.applyRehearsalTimings(prev, timings));
|
|
8766
8726
|
history.markDirty();
|
|
8767
8727
|
},
|
|
8768
|
-
loopContinuously:
|
|
8728
|
+
loopContinuously: chunk7ZQ2FZXE_js.shouldLoopContinuously(presentationProperties),
|
|
8769
8729
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8770
8730
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8771
8731
|
endWithBlackSlide
|
|
8772
8732
|
});
|
|
8773
|
-
return {
|
|
8733
|
+
return {
|
|
8734
|
+
presentation,
|
|
8735
|
+
annotations,
|
|
8736
|
+
actionSoundHandlerRef,
|
|
8737
|
+
setExitModeHandler: (handler) => {
|
|
8738
|
+
exitModeHandlerRef.current = handler;
|
|
8739
|
+
}
|
|
8740
|
+
};
|
|
8774
8741
|
}
|
|
8775
8742
|
function useEditorOperations(input) {
|
|
8776
8743
|
const {
|
|
@@ -8934,7 +8901,8 @@ function useEditorOperations(input) {
|
|
|
8934
8901
|
tableEditorState: state.tableEditorState,
|
|
8935
8902
|
setTableEditorState: state.setTableEditorState,
|
|
8936
8903
|
ops,
|
|
8937
|
-
history
|
|
8904
|
+
history,
|
|
8905
|
+
transformCommittedText
|
|
8938
8906
|
});
|
|
8939
8907
|
const combinedUpdateTextStyle = react.useCallback(
|
|
8940
8908
|
(updates) => {
|
|
@@ -8958,7 +8926,7 @@ function useEditorOperations(input) {
|
|
|
8958
8926
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
8959
8927
|
react.useEffect(() => {
|
|
8960
8928
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
8961
|
-
copiedFormatRef.current =
|
|
8929
|
+
copiedFormatRef.current = chunk7ZQ2FZXE_js.copyFormatFromElement(selectedElement);
|
|
8962
8930
|
} else if (!formatPainterActive) {
|
|
8963
8931
|
copiedFormatRef.current = null;
|
|
8964
8932
|
}
|
|
@@ -8984,12 +8952,12 @@ function useEditorOperations(input) {
|
|
|
8984
8952
|
e.stopPropagation();
|
|
8985
8953
|
const element = elementLookup.get(elementId);
|
|
8986
8954
|
if (element) {
|
|
8987
|
-
const updated =
|
|
8955
|
+
const updated = chunk7ZQ2FZXE_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
8988
8956
|
const updates = {};
|
|
8989
|
-
if (
|
|
8957
|
+
if (chunk7ZQ2FZXE_js.hasShapeProperties(updated)) {
|
|
8990
8958
|
updates.shapeStyle = updated.shapeStyle;
|
|
8991
8959
|
}
|
|
8992
|
-
if (
|
|
8960
|
+
if (chunk7ZQ2FZXE_js.hasTextProperties(updated)) {
|
|
8993
8961
|
updates.textStyle = updated.textStyle;
|
|
8994
8962
|
}
|
|
8995
8963
|
ops.updateElementById(elementId, updates);
|
|
@@ -9036,11 +9004,11 @@ function useIOHandlers(input) {
|
|
|
9036
9004
|
ops,
|
|
9037
9005
|
zoom,
|
|
9038
9006
|
handlerRef,
|
|
9039
|
-
serializeSlides,
|
|
9040
9007
|
serializeForRecovery,
|
|
9041
9008
|
setContent,
|
|
9042
9009
|
onContentChange,
|
|
9043
|
-
password
|
|
9010
|
+
password,
|
|
9011
|
+
imageExportScale
|
|
9044
9012
|
} = input;
|
|
9045
9013
|
const exportHandlers = useExportHandlers({
|
|
9046
9014
|
slides,
|
|
@@ -9051,7 +9019,6 @@ function useIOHandlers(input) {
|
|
|
9051
9019
|
canvasStageRef: zoom.canvasStageRef,
|
|
9052
9020
|
setActiveSlideIndex: state.setActiveSlideIndex,
|
|
9053
9021
|
handlerRef,
|
|
9054
|
-
serializeSlides,
|
|
9055
9022
|
headerFooter: state.headerFooter,
|
|
9056
9023
|
presentationProperties: state.presentationProperties,
|
|
9057
9024
|
customShows: state.customShows,
|
|
@@ -9068,7 +9035,8 @@ function useIOHandlers(input) {
|
|
|
9068
9035
|
theme: state.theme,
|
|
9069
9036
|
canvasSize,
|
|
9070
9037
|
slideSizeEmu: state.slideSizeEmu,
|
|
9071
|
-
password
|
|
9038
|
+
password,
|
|
9039
|
+
imageExportScale
|
|
9072
9040
|
});
|
|
9073
9041
|
const printHandlers = usePrintHandlers({
|
|
9074
9042
|
slides,
|
|
@@ -9143,7 +9111,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9143
9111
|
const families = /* @__PURE__ */ new Set();
|
|
9144
9112
|
for (const slide of slides) {
|
|
9145
9113
|
for (const el of slide.elements) {
|
|
9146
|
-
if (
|
|
9114
|
+
if (chunk7ZQ2FZXE_js.hasTextProperties(el) && el.textSegments) {
|
|
9147
9115
|
for (const seg of el.textSegments) {
|
|
9148
9116
|
if (seg.style.fontFamily) {
|
|
9149
9117
|
families.add(seg.style.fontFamily);
|
|
@@ -9282,7 +9250,8 @@ function useContentLifecycle(input) {
|
|
|
9282
9250
|
actionSoundHandlerRef,
|
|
9283
9251
|
setIsEncryptedDialogOpen,
|
|
9284
9252
|
password,
|
|
9285
|
-
onContentApplied
|
|
9253
|
+
onContentApplied,
|
|
9254
|
+
allowExternalImages
|
|
9286
9255
|
} = input;
|
|
9287
9256
|
const { handlerRef } = useLoadContent({
|
|
9288
9257
|
content,
|
|
@@ -9321,7 +9290,8 @@ function useContentLifecycle(input) {
|
|
|
9321
9290
|
setError: state.setError,
|
|
9322
9291
|
setIsDirty: state.setIsDirty,
|
|
9323
9292
|
setIsEncrypted: setIsEncryptedDialogOpen,
|
|
9324
|
-
onContentApplied
|
|
9293
|
+
onContentApplied,
|
|
9294
|
+
allowExternalImages
|
|
9325
9295
|
});
|
|
9326
9296
|
react.useEffect(() => {
|
|
9327
9297
|
actionSoundHandlerRef.current = handlerRef.current;
|
|
@@ -9391,7 +9361,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9391
9361
|
inputRef.current = input;
|
|
9392
9362
|
const handleKeyDown = react.useCallback((e) => {
|
|
9393
9363
|
const current = inputRef.current;
|
|
9394
|
-
const { action, dx, dy } =
|
|
9364
|
+
const { action, dx, dy } = chunk7ZQ2FZXE_js.mapEditorKey(e, {
|
|
9395
9365
|
canEdit: current.canEdit,
|
|
9396
9366
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9397
9367
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9404,7 +9374,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9404
9374
|
hasSelection: current.hasSelection,
|
|
9405
9375
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9406
9376
|
isDrawing: current.activeTool !== "select",
|
|
9407
|
-
isTextInputTarget:
|
|
9377
|
+
isTextInputTarget: chunk7ZQ2FZXE_js.isEditorTextInputTarget(e.target)
|
|
9408
9378
|
});
|
|
9409
9379
|
if (action === null) {
|
|
9410
9380
|
return;
|
|
@@ -9560,7 +9530,10 @@ function useViewerIntegration(input) {
|
|
|
9560
9530
|
autosaveEnabled,
|
|
9561
9531
|
autosaveAllowed = true,
|
|
9562
9532
|
autosaveIntervalMs,
|
|
9533
|
+
allowExternalImages,
|
|
9563
9534
|
canEdit,
|
|
9535
|
+
promptKeepInkAnnotations,
|
|
9536
|
+
imageExportScale,
|
|
9564
9537
|
mode,
|
|
9565
9538
|
slides,
|
|
9566
9539
|
activeSlide,
|
|
@@ -9625,7 +9598,8 @@ function useViewerIntegration(input) {
|
|
|
9625
9598
|
actionSoundHandlerRef,
|
|
9626
9599
|
setIsEncryptedDialogOpen,
|
|
9627
9600
|
password: dialogs.presentationPassword ?? void 0,
|
|
9628
|
-
onContentApplied: () => setLoadVersion((v) => v + 1)
|
|
9601
|
+
onContentApplied: () => setLoadVersion((v) => v + 1),
|
|
9602
|
+
allowExternalImages
|
|
9629
9603
|
}
|
|
9630
9604
|
);
|
|
9631
9605
|
const { exportHandlers, printHandlers, themeHandlers, propertyHandlers } = useIOHandlers({
|
|
@@ -9638,11 +9612,11 @@ function useViewerIntegration(input) {
|
|
|
9638
9612
|
ops: editorOps.ops,
|
|
9639
9613
|
zoom,
|
|
9640
9614
|
handlerRef,
|
|
9641
|
-
serializeSlides,
|
|
9642
9615
|
serializeForRecovery,
|
|
9643
9616
|
setContent,
|
|
9644
9617
|
onContentChange,
|
|
9645
|
-
password: dialogs.presentationPassword ?? void 0
|
|
9618
|
+
password: dialogs.presentationPassword ?? void 0,
|
|
9619
|
+
imageExportScale
|
|
9646
9620
|
});
|
|
9647
9621
|
const {
|
|
9648
9622
|
showKeepAnnotationsDialog,
|
|
@@ -9657,7 +9631,8 @@ function useViewerIntegration(input) {
|
|
|
9657
9631
|
annotations,
|
|
9658
9632
|
history,
|
|
9659
9633
|
setMode: state.setMode,
|
|
9660
|
-
setSlides: state.setSlides
|
|
9634
|
+
setSlides: state.setSlides,
|
|
9635
|
+
promptKeepInkAnnotations
|
|
9661
9636
|
});
|
|
9662
9637
|
const recovery = useRecoveryDetection({
|
|
9663
9638
|
filePath,
|
|
@@ -9710,7 +9685,7 @@ function useViewerIntegration(input) {
|
|
|
9710
9685
|
return zoom.scale;
|
|
9711
9686
|
},
|
|
9712
9687
|
setZoom(level) {
|
|
9713
|
-
zoom.setScale(
|
|
9688
|
+
zoom.setScale(chunk7ZQ2FZXE_js.clampZoomScale(level));
|
|
9714
9689
|
},
|
|
9715
9690
|
zoomIn() {
|
|
9716
9691
|
zoom.handleZoomIn();
|
|
@@ -9926,7 +9901,7 @@ function useReducedMotion() {
|
|
|
9926
9901
|
}
|
|
9927
9902
|
function useViewerOptions() {
|
|
9928
9903
|
const storeRef = react.useRef(null);
|
|
9929
|
-
storeRef.current ??=
|
|
9904
|
+
storeRef.current ??= chunk7ZQ2FZXE_js.createViewerOptionsStore();
|
|
9930
9905
|
const store = storeRef.current;
|
|
9931
9906
|
const options = react.useSyncExternalStore(
|
|
9932
9907
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9935,14 +9910,20 @@ function useViewerOptions() {
|
|
|
9935
9910
|
);
|
|
9936
9911
|
return { optionsStore: store, options };
|
|
9937
9912
|
}
|
|
9938
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9939
|
-
function computeToolbarVisibility(hiddenActions) {
|
|
9940
|
-
const isHidden = (id) =>
|
|
9941
|
-
const
|
|
9913
|
+
var KNOWN_TAB_IDS = new Set(chunk7ZQ2FZXE_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9914
|
+
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
9915
|
+
const isHidden = (id) => chunk7ZQ2FZXE_js.isActionHidden(id, hiddenActions);
|
|
9916
|
+
const userHidden = new Set(hiddenTabIds);
|
|
9917
|
+
userHidden.delete("file");
|
|
9918
|
+
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
|
|
9942
9919
|
return { isHidden, isTabVisible };
|
|
9943
9920
|
}
|
|
9944
9921
|
function useToolbarVisibility(hiddenActions) {
|
|
9945
|
-
|
|
9922
|
+
const hiddenTabIds = useViewerOptionsContext().ribbon.hiddenTabIds;
|
|
9923
|
+
return react.useMemo(
|
|
9924
|
+
() => computeToolbarVisibility(hiddenActions, hiddenTabIds),
|
|
9925
|
+
[hiddenActions, hiddenTabIds]
|
|
9926
|
+
);
|
|
9946
9927
|
}
|
|
9947
9928
|
function useCollaborativeHistory({
|
|
9948
9929
|
localClientId: _localClientId,
|
|
@@ -10023,12 +10004,12 @@ function useYjsDocumentSync({
|
|
|
10023
10004
|
return;
|
|
10024
10005
|
}
|
|
10025
10006
|
try {
|
|
10026
|
-
const handler = new
|
|
10007
|
+
const handler = new chunk7ZQ2FZXE_js.PptxHandler();
|
|
10027
10008
|
await handler.load(sourceBytes.buffer);
|
|
10028
|
-
const currentSlides =
|
|
10009
|
+
const currentSlides = chunk7ZQ2FZXE_js.readSlidesFromYDoc(
|
|
10029
10010
|
doc
|
|
10030
10011
|
);
|
|
10031
|
-
const slidesToSave =
|
|
10012
|
+
const slidesToSave = chunk7ZQ2FZXE_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10032
10013
|
const bytes = await handler.save(slidesToSave);
|
|
10033
10014
|
config.onWriteBack(bytes);
|
|
10034
10015
|
} catch {
|
|
@@ -10043,10 +10024,10 @@ function useYjsDocumentSync({
|
|
|
10043
10024
|
if (!doc || !isConnected) {
|
|
10044
10025
|
return;
|
|
10045
10026
|
}
|
|
10046
|
-
const docSlides =
|
|
10027
|
+
const docSlides = chunk7ZQ2FZXE_js.readSlidesFromYDoc(
|
|
10047
10028
|
doc
|
|
10048
10029
|
);
|
|
10049
|
-
if (!
|
|
10030
|
+
if (!chunk7ZQ2FZXE_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10050
10031
|
return;
|
|
10051
10032
|
}
|
|
10052
10033
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10065,11 +10046,11 @@ function useYjsDocumentSync({
|
|
|
10065
10046
|
lastSyncedRef.current = serialized;
|
|
10066
10047
|
void (async () => {
|
|
10067
10048
|
const factories = await getFactories();
|
|
10068
|
-
|
|
10049
|
+
chunk7ZQ2FZXE_js.reconcileSlidesInYDoc(
|
|
10069
10050
|
slides,
|
|
10070
10051
|
doc,
|
|
10071
10052
|
factories,
|
|
10072
|
-
|
|
10053
|
+
chunk7ZQ2FZXE_js.LOCAL_SYNC_ORIGIN
|
|
10073
10054
|
);
|
|
10074
10055
|
scheduleWriteBack();
|
|
10075
10056
|
})();
|
|
@@ -10083,10 +10064,10 @@ function useYjsDocumentSync({
|
|
|
10083
10064
|
return;
|
|
10084
10065
|
}
|
|
10085
10066
|
const handleChange = (_events, transaction) => {
|
|
10086
|
-
if (transaction?.origin ===
|
|
10067
|
+
if (transaction?.origin === chunk7ZQ2FZXE_js.LOCAL_SYNC_ORIGIN) {
|
|
10087
10068
|
return;
|
|
10088
10069
|
}
|
|
10089
|
-
const remoteSlides =
|
|
10070
|
+
const remoteSlides = chunk7ZQ2FZXE_js.readSlidesFromYDoc(
|
|
10090
10071
|
doc
|
|
10091
10072
|
);
|
|
10092
10073
|
if (remoteSlides.length === 0) {
|
|
@@ -10102,7 +10083,7 @@ function useYjsDocumentSync({
|
|
|
10102
10083
|
isApplyingRemoteRef.current = false;
|
|
10103
10084
|
scheduleWriteBack();
|
|
10104
10085
|
};
|
|
10105
|
-
const unobserve =
|
|
10086
|
+
const unobserve = chunk7ZQ2FZXE_js.observeYDocSlides(
|
|
10106
10087
|
doc,
|
|
10107
10088
|
handleChange
|
|
10108
10089
|
);
|
|
@@ -10140,7 +10121,7 @@ function useBroadcastFollower({
|
|
|
10140
10121
|
if (!broadcaster) {
|
|
10141
10122
|
return;
|
|
10142
10123
|
}
|
|
10143
|
-
if (!
|
|
10124
|
+
if (!chunk7ZQ2FZXE_js.shouldAutoFollowBroadcaster({
|
|
10144
10125
|
localRole: collab.config.role,
|
|
10145
10126
|
broadcasterRole: broadcaster.role
|
|
10146
10127
|
})) {
|
|
@@ -10311,7 +10292,7 @@ function subscribeTouchCapability(callback) {
|
|
|
10311
10292
|
function useIsMobile() {
|
|
10312
10293
|
const isTouchDevice = react.useSyncExternalStore(
|
|
10313
10294
|
subscribeTouchCapability,
|
|
10314
|
-
|
|
10295
|
+
chunk7ZQ2FZXE_js.detectTouchDevice,
|
|
10315
10296
|
() => false
|
|
10316
10297
|
// server snapshot
|
|
10317
10298
|
);
|
|
@@ -10321,7 +10302,7 @@ function useIsMobile() {
|
|
|
10321
10302
|
const [viewportHeight, setViewportHeight] = react.useState(
|
|
10322
10303
|
() => typeof window === "undefined" ? 768 : window.innerHeight
|
|
10323
10304
|
);
|
|
10324
|
-
const [orientation, setOrientation] = react.useState(
|
|
10305
|
+
const [orientation, setOrientation] = react.useState(chunk7ZQ2FZXE_js.detectOrientation);
|
|
10325
10306
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
10326
10307
|
const [initialViewportHeight] = react.useState(
|
|
10327
10308
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -10342,7 +10323,7 @@ function useIsMobile() {
|
|
|
10342
10323
|
return;
|
|
10343
10324
|
}
|
|
10344
10325
|
const handleOrientationChange = () => {
|
|
10345
|
-
setOrientation(
|
|
10326
|
+
setOrientation(chunk7ZQ2FZXE_js.detectOrientation());
|
|
10346
10327
|
};
|
|
10347
10328
|
if (screen.orientation) {
|
|
10348
10329
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -10372,7 +10353,7 @@ function useIsMobile() {
|
|
|
10372
10353
|
window.addEventListener("resize", handleResize);
|
|
10373
10354
|
return () => window.removeEventListener("resize", handleResize);
|
|
10374
10355
|
}, [isTouchDevice, initialViewportHeight]);
|
|
10375
|
-
const { isMobile, isTablet, isDesktop } =
|
|
10356
|
+
const { isMobile, isTablet, isDesktop } = chunk7ZQ2FZXE_js.deriveViewportBreakpoints(
|
|
10376
10357
|
viewportWidth,
|
|
10377
10358
|
viewportHeight,
|
|
10378
10359
|
isTouchDevice
|
|
@@ -10403,10 +10384,10 @@ function useTouchGestures(input) {
|
|
|
10403
10384
|
if (!el || !enabled) {
|
|
10404
10385
|
return;
|
|
10405
10386
|
}
|
|
10406
|
-
const recognizer =
|
|
10387
|
+
const recognizer = chunk7ZQ2FZXE_js.createTouchGestureRecognizer({
|
|
10407
10388
|
getScale: () => scaleRef.current,
|
|
10408
|
-
minScale:
|
|
10409
|
-
maxScale:
|
|
10389
|
+
minScale: chunk7ZQ2FZXE_js.MIN_ZOOM_SCALE,
|
|
10390
|
+
maxScale: chunk7ZQ2FZXE_js.MAX_ZOOM_SCALE,
|
|
10410
10391
|
callbacks: {
|
|
10411
10392
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10412
10393
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10446,7 +10427,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10446
10427
|
return;
|
|
10447
10428
|
}
|
|
10448
10429
|
const rect = active.getBoundingClientRect();
|
|
10449
|
-
const delta =
|
|
10430
|
+
const delta = chunk7ZQ2FZXE_js.computeScrollDelta(
|
|
10450
10431
|
{ top: rect.top, bottom: rect.bottom },
|
|
10451
10432
|
window.innerHeight,
|
|
10452
10433
|
keyboardInset
|
|
@@ -10466,8 +10447,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10466
10447
|
return;
|
|
10467
10448
|
}
|
|
10468
10449
|
const update = () => {
|
|
10469
|
-
const metrics =
|
|
10470
|
-
const inset = metrics ?
|
|
10450
|
+
const metrics = chunk7ZQ2FZXE_js.readViewportMetrics(window);
|
|
10451
|
+
const inset = metrics ? chunk7ZQ2FZXE_js.computeKeyboardInset(metrics) : 0;
|
|
10471
10452
|
setKeyboardInset(inset);
|
|
10472
10453
|
if (inset > 0) {
|
|
10473
10454
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10478,8 +10459,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10478
10459
|
vv.addEventListener("scroll", update);
|
|
10479
10460
|
const onFocusIn = () => {
|
|
10480
10461
|
window.requestAnimationFrame(() => {
|
|
10481
|
-
const metrics =
|
|
10482
|
-
const inset = metrics ?
|
|
10462
|
+
const metrics = chunk7ZQ2FZXE_js.readViewportMetrics(window);
|
|
10463
|
+
const inset = metrics ? chunk7ZQ2FZXE_js.computeKeyboardInset(metrics) : 0;
|
|
10483
10464
|
if (inset > 0) {
|
|
10484
10465
|
scrollFocusedIntoView(inset);
|
|
10485
10466
|
}
|
|
@@ -10492,7 +10473,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10492
10473
|
document.removeEventListener("focusin", onFocusIn);
|
|
10493
10474
|
};
|
|
10494
10475
|
}, [enabled]);
|
|
10495
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10476
|
+
return { keyboardInset, isKeyboardOpen: chunk7ZQ2FZXE_js.isKeyboardOpen(keyboardInset) };
|
|
10496
10477
|
}
|
|
10497
10478
|
|
|
10498
10479
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10515,27 +10496,40 @@ function buildCanvasProps(input) {
|
|
|
10515
10496
|
tableOps,
|
|
10516
10497
|
presentation,
|
|
10517
10498
|
findResults,
|
|
10518
|
-
findResultIndex
|
|
10499
|
+
findResultIndex,
|
|
10500
|
+
viewerOptions,
|
|
10501
|
+
buildHyperlinkConfirmMessage
|
|
10519
10502
|
} = input;
|
|
10520
10503
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10521
10504
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10522
|
-
const fieldContext =
|
|
10505
|
+
const fieldContext = chunk7ZQ2FZXE_js.buildFieldSubstitutionContext({
|
|
10523
10506
|
headerFooter: s.headerFooter,
|
|
10524
10507
|
customProperties: s.customProperties,
|
|
10525
10508
|
slide: activeSlide
|
|
10526
10509
|
});
|
|
10527
10510
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10511
|
+
const openExternalUrl = (url) => {
|
|
10512
|
+
if (chunk7ZQ2FZXE_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
10513
|
+
return;
|
|
10514
|
+
}
|
|
10515
|
+
chunk7ZQ2FZXE_js.safeOpenUrl(url);
|
|
10516
|
+
};
|
|
10528
10517
|
const handleActionClick = (_elementId, action) => {
|
|
10529
10518
|
if (mode === "present") {
|
|
10519
|
+
const resolved = chunk7ZQ2FZXE_js.resolvePresentationAction(action, { slideCount: slides.length });
|
|
10520
|
+
if (resolved.intent.kind === "openUrl") {
|
|
10521
|
+
openExternalUrl(resolved.intent.url);
|
|
10522
|
+
return;
|
|
10523
|
+
}
|
|
10530
10524
|
presentation.handlePresentationAction(action);
|
|
10531
10525
|
} else if (action.url) {
|
|
10532
|
-
|
|
10526
|
+
openExternalUrl(action.url);
|
|
10533
10527
|
}
|
|
10534
10528
|
};
|
|
10535
10529
|
const handleHyperlinkClick = (url) => {
|
|
10536
|
-
if (
|
|
10530
|
+
if (chunk7ZQ2FZXE_js.isPpactionUrl(url)) {
|
|
10537
10531
|
if (mode === "present") {
|
|
10538
|
-
const parsed =
|
|
10532
|
+
const parsed = chunk7ZQ2FZXE_js.parsePpactionUrl(url);
|
|
10539
10533
|
if (parsed) {
|
|
10540
10534
|
presentation.handlePresentationAction({
|
|
10541
10535
|
action: parsed.action,
|
|
@@ -10545,7 +10539,7 @@ function buildCanvasProps(input) {
|
|
|
10545
10539
|
}
|
|
10546
10540
|
return;
|
|
10547
10541
|
}
|
|
10548
|
-
|
|
10542
|
+
openExternalUrl(url);
|
|
10549
10543
|
};
|
|
10550
10544
|
return {
|
|
10551
10545
|
activeSlide: effectiveSlide,
|
|
@@ -10641,7 +10635,7 @@ function buildCanvasProps(input) {
|
|
|
10641
10635
|
|
|
10642
10636
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10643
10637
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10644
|
-
return
|
|
10638
|
+
return chunk7ZQ2FZXE_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10645
10639
|
}
|
|
10646
10640
|
|
|
10647
10641
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10654,7 +10648,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10654
10648
|
const current = activeSlide.animations ?? [];
|
|
10655
10649
|
if (group === "motionPath") {
|
|
10656
10650
|
propertyHandlers.handleUpdateSlide({
|
|
10657
|
-
animations:
|
|
10651
|
+
animations: chunk7ZQ2FZXE_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10658
10652
|
});
|
|
10659
10653
|
return;
|
|
10660
10654
|
}
|
|
@@ -10845,11 +10839,10 @@ function buildToolbarProps(input) {
|
|
|
10845
10839
|
onExportVideo: exportHandlers.handleExportVideo,
|
|
10846
10840
|
onExportGif: exportHandlers.handleExportGif,
|
|
10847
10841
|
onExportJson: exportHandlers.handleExportJson,
|
|
10848
|
-
onPackageForSharing: exportHandlers.handlePackageForSharing,
|
|
10849
10842
|
onOpenFile,
|
|
10850
10843
|
onOpenRecentFile,
|
|
10851
10844
|
onCreatePresentation: (templateId) => {
|
|
10852
|
-
s.setSlides(
|
|
10845
|
+
s.setSlides(chunk7ZQ2FZXE_js.createBackstagePresentation(templateId));
|
|
10853
10846
|
s.setActiveSlideIndex(0);
|
|
10854
10847
|
s.setSelectedElementId(null);
|
|
10855
10848
|
s.setSelectedElementIds([]);
|
|
@@ -10878,7 +10871,7 @@ function buildToolbarProps(input) {
|
|
|
10878
10871
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
10879
10872
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10880
10873
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10881
|
-
templateScheme:
|
|
10874
|
+
templateScheme: chunk7ZQ2FZXE_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10882
10875
|
customShows: s.customShows,
|
|
10883
10876
|
activeCustomShowId: s.activeCustomShowId,
|
|
10884
10877
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -10919,7 +10912,7 @@ function buildToolbarProps(input) {
|
|
|
10919
10912
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10920
10913
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10921
10914
|
formatPainterActive: s.formatPainterActive,
|
|
10922
|
-
canActivateFormatPainter:
|
|
10915
|
+
canActivateFormatPainter: chunk7ZQ2FZXE_js.hasCopyableFormat(selectedElement),
|
|
10923
10916
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10924
10917
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10925
10918
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -10983,6 +10976,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
10983
10976
|
]
|
|
10984
10977
|
);
|
|
10985
10978
|
const zoom = useZoomViewport({ canvasSize, selectedElements: state.selectedElements });
|
|
10979
|
+
const { options: viewerOptions } = useViewerOptions();
|
|
10986
10980
|
const history = useEditorHistory({
|
|
10987
10981
|
slides,
|
|
10988
10982
|
canvasSize,
|
|
@@ -10992,6 +10986,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
10992
10986
|
headerFooter: state.headerFooter,
|
|
10993
10987
|
loading,
|
|
10994
10988
|
error,
|
|
10989
|
+
maxHistoryEntries: chunk7ZQ2FZXE_js.resolveHistoryDepth(viewerOptions),
|
|
10995
10990
|
hasActivePointerInteraction,
|
|
10996
10991
|
pointerCommitNonce: state.pointerCommitNonce,
|
|
10997
10992
|
setSlides: state.setSlides,
|
|
@@ -11013,12 +11008,15 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11013
11008
|
activeMaster: state.activeMaster,
|
|
11014
11009
|
documentGridSpacing: state.viewProperties?.gridSpacing
|
|
11015
11010
|
});
|
|
11016
|
-
const {
|
|
11017
|
-
const { presentation, annotations, actionSoundHandlerRef } = usePresentationSetup({
|
|
11011
|
+
const { presentation, annotations, actionSoundHandlerRef, setExitModeHandler } = usePresentationSetup({
|
|
11018
11012
|
mode,
|
|
11019
11013
|
slides,
|
|
11020
11014
|
visibleSlideIndexes,
|
|
11021
11015
|
endWithBlackSlide: viewerOptions.advanced.slideShowEndWithBlackSlide,
|
|
11016
|
+
// File > Options > Advanced > "Prompt to keep ink annotations when
|
|
11017
|
+
// exiting" / "Show popup toolbar" while presenting.
|
|
11018
|
+
promptKeepInkAnnotations: viewerOptions.advanced.slideShowPromptKeepInkAnnotations,
|
|
11019
|
+
popupToolbarEnabled: viewerOptions.advanced.slideShowShowPopupToolbar,
|
|
11022
11020
|
activeSlideIndex,
|
|
11023
11021
|
containerRef,
|
|
11024
11022
|
content,
|
|
@@ -11048,8 +11046,13 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11048
11046
|
presentation,
|
|
11049
11047
|
annotations,
|
|
11050
11048
|
actionSoundHandlerRef,
|
|
11049
|
+
setExitModeHandler,
|
|
11051
11050
|
masterPseudoSlide,
|
|
11052
|
-
gridSpacingPx
|
|
11051
|
+
gridSpacingPx,
|
|
11052
|
+
// Multiplied against the pre-existing 2x baseline; see the matching
|
|
11053
|
+
// comment in `PowerPointViewer.tsx`.
|
|
11054
|
+
imageExportScale: 2 * chunk7ZQ2FZXE_js.resolveImageResolutionScale(viewerOptions),
|
|
11055
|
+
viewerOptions
|
|
11053
11056
|
};
|
|
11054
11057
|
}
|
|
11055
11058
|
function useViewerBuildingBlocksState(input) {
|
|
@@ -11077,7 +11080,10 @@ function useViewerBuildingBlocksState(input) {
|
|
|
11077
11080
|
presentation,
|
|
11078
11081
|
annotations,
|
|
11079
11082
|
actionSoundHandlerRef,
|
|
11080
|
-
gridSpacingPx
|
|
11083
|
+
gridSpacingPx,
|
|
11084
|
+
imageExportScale,
|
|
11085
|
+
setExitModeHandler,
|
|
11086
|
+
viewerOptions
|
|
11081
11087
|
} = core;
|
|
11082
11088
|
const dialogs = useViewerDialogs({
|
|
11083
11089
|
mode,
|
|
@@ -11148,7 +11154,13 @@ function useViewerBuildingBlocksState(input) {
|
|
|
11148
11154
|
content,
|
|
11149
11155
|
filePath,
|
|
11150
11156
|
autosaveEnabled,
|
|
11157
|
+
// Trust Center > "Allow external content": same gate `PowerPointViewer`
|
|
11158
|
+
// applies, so the headless building-blocks API loads http(s) images
|
|
11159
|
+
// under the same default-off, core-side SSRF/privacy guard.
|
|
11160
|
+
allowExternalImages: viewerOptions.trust.allowExternalContent,
|
|
11151
11161
|
canEdit,
|
|
11162
|
+
promptKeepInkAnnotations: viewerOptions.advanced.slideShowPromptKeepInkAnnotations,
|
|
11163
|
+
imageExportScale,
|
|
11152
11164
|
mode,
|
|
11153
11165
|
slides,
|
|
11154
11166
|
activeSlide,
|
|
@@ -11166,6 +11178,7 @@ function useViewerBuildingBlocksState(input) {
|
|
|
11166
11178
|
onSelectionChange,
|
|
11167
11179
|
onSlideCountChange
|
|
11168
11180
|
});
|
|
11181
|
+
setExitModeHandler(handleSetMode);
|
|
11169
11182
|
return {
|
|
11170
11183
|
dialogs,
|
|
11171
11184
|
editorOps,
|
|
@@ -11201,13 +11214,14 @@ function useViewerBuildingBlocks(input) {
|
|
|
11201
11214
|
onOpenHeaderFooter,
|
|
11202
11215
|
onOpenShareDialog
|
|
11203
11216
|
} = input;
|
|
11217
|
+
const { t } = reactI18next.useTranslation();
|
|
11204
11218
|
const [content, setContent] = react.useState(incomingContent ?? null);
|
|
11205
11219
|
react.useEffect(() => {
|
|
11206
11220
|
setContent(incomingContent ?? null);
|
|
11207
11221
|
}, [incomingContent]);
|
|
11208
11222
|
const onOpenFile = react.useCallback(() => {
|
|
11209
11223
|
void (async () => {
|
|
11210
|
-
const picked = await
|
|
11224
|
+
const picked = await chunk7ZQ2FZXE_js.openPptxFile();
|
|
11211
11225
|
if (picked) {
|
|
11212
11226
|
setContent(picked.buffer);
|
|
11213
11227
|
}
|
|
@@ -11215,7 +11229,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11215
11229
|
}, []);
|
|
11216
11230
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11217
11231
|
void (async () => {
|
|
11218
|
-
const bytes = await
|
|
11232
|
+
const bytes = await chunk7ZQ2FZXE_js.readBackstageRecentFile(key);
|
|
11219
11233
|
if (bytes) {
|
|
11220
11234
|
setContent(bytes);
|
|
11221
11235
|
}
|
|
@@ -11235,7 +11249,8 @@ function useViewerBuildingBlocks(input) {
|
|
|
11235
11249
|
history,
|
|
11236
11250
|
presentation,
|
|
11237
11251
|
masterPseudoSlide,
|
|
11238
|
-
gridSpacingPx
|
|
11252
|
+
gridSpacingPx,
|
|
11253
|
+
viewerOptions
|
|
11239
11254
|
} = core;
|
|
11240
11255
|
const {
|
|
11241
11256
|
dialogs,
|
|
@@ -11311,7 +11326,11 @@ function useViewerBuildingBlocks(input) {
|
|
|
11311
11326
|
tableOps: editorOps.tableOps,
|
|
11312
11327
|
presentation,
|
|
11313
11328
|
findResults: editorOps.findReplace.findResults,
|
|
11314
|
-
findResultIndex: editorOps.findReplace.findResultIndex
|
|
11329
|
+
findResultIndex: editorOps.findReplace.findResultIndex,
|
|
11330
|
+
viewerOptions,
|
|
11331
|
+
buildHyperlinkConfirmMessage: (url) => `${t("pptx.options.trust.confirmHyperlinks")}
|
|
11332
|
+
|
|
11333
|
+
${url}`
|
|
11315
11334
|
});
|
|
11316
11335
|
return { toolbarProps, canvasProps, mode, loading, error, autosaveStatus };
|
|
11317
11336
|
}
|
|
@@ -11387,6 +11406,7 @@ function useResizablePanels() {
|
|
|
11387
11406
|
|
|
11388
11407
|
exports.ACTION_VERB_MAP = ACTION_VERB_MAP;
|
|
11389
11408
|
exports.MIN_TOUCH_TARGET = MIN_TOUCH_TARGET;
|
|
11409
|
+
exports.ViewerOptionsContext = ViewerOptionsContext;
|
|
11390
11410
|
exports.computeToolbarVisibility = computeToolbarVisibility;
|
|
11391
11411
|
exports.detectTargetType = detectTargetType;
|
|
11392
11412
|
exports.isAudienceTab = isAudienceTab;
|
|
@@ -11459,6 +11479,7 @@ exports.useViewerCoreState = useViewerCoreState;
|
|
|
11459
11479
|
exports.useViewerDialogs = useViewerDialogs;
|
|
11460
11480
|
exports.useViewerIntegration = useViewerIntegration;
|
|
11461
11481
|
exports.useViewerOptions = useViewerOptions;
|
|
11482
|
+
exports.useViewerOptionsContext = useViewerOptionsContext;
|
|
11462
11483
|
exports.useViewerState = useViewerState;
|
|
11463
11484
|
exports.useViewerUIState = useViewerUIState;
|
|
11464
11485
|
exports.useVirtualizedSlides = useVirtualizedSlides;
|