pptx-react-viewer 3.0.4 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/{AiChatPanel-GSTUOESI.mjs → AiChatPanel-5LCCN7FG.mjs} +4 -4
- package/dist/AiChatPanel-5LCCN7FG.mjs.br +0 -0
- package/dist/AiChatPanel-5LCCN7FG.mjs.gz +0 -0
- package/dist/{AiChatPanel-E4V3FYLR.js → AiChatPanel-WVORGKRT.js} +24 -24
- package/dist/AiChatPanel-WVORGKRT.js.br +0 -0
- package/dist/AiChatPanel-WVORGKRT.js.gz +0 -0
- package/dist/Area3DChartScene-DY5CSLE2.js +47 -0
- package/dist/Area3DChartScene-DY5CSLE2.js.br +0 -0
- package/dist/Area3DChartScene-DY5CSLE2.js.gz +0 -0
- package/dist/Area3DChartScene-W6UZTRDP.mjs +45 -0
- package/dist/Area3DChartScene-W6UZTRDP.mjs.br +0 -0
- package/dist/Area3DChartScene-W6UZTRDP.mjs.gz +0 -0
- package/dist/Bar3DChartScene-7HZSPYG4.js +47 -0
- package/dist/Bar3DChartScene-7HZSPYG4.js.br +0 -0
- package/dist/Bar3DChartScene-7HZSPYG4.js.gz +0 -0
- package/dist/Bar3DChartScene-FCWQEQLH.mjs +45 -0
- package/dist/Bar3DChartScene-FCWQEQLH.mjs.br +0 -0
- package/dist/Bar3DChartScene-FCWQEQLH.mjs.gz +0 -0
- package/dist/Line3DChartScene-BKO24WYO.js +47 -0
- package/dist/Line3DChartScene-BKO24WYO.js.br +0 -0
- package/dist/Line3DChartScene-BKO24WYO.js.gz +0 -0
- package/dist/Line3DChartScene-EPPWQOHS.mjs +45 -0
- package/dist/Line3DChartScene-EPPWQOHS.mjs.br +0 -0
- package/dist/Line3DChartScene-EPPWQOHS.mjs.gz +0 -0
- package/dist/{Model3DScene-634CXE46.mjs → Model3DScene-IAY33GO2.mjs} +1 -1
- package/dist/Model3DScene-IAY33GO2.mjs.br +0 -0
- package/dist/Model3DScene-IAY33GO2.mjs.gz +0 -0
- package/dist/{Model3DScene-45JR5NXN.js → Model3DScene-JFVRE5VL.js} +2 -2
- package/dist/Model3DScene-JFVRE5VL.js.br +0 -0
- package/dist/Model3DScene-JFVRE5VL.js.gz +0 -0
- package/dist/PieChart3DScene-IPH7GLKU.js +47 -0
- package/dist/PieChart3DScene-IPH7GLKU.js.br +0 -0
- package/dist/PieChart3DScene-IPH7GLKU.js.gz +0 -0
- package/dist/PieChart3DScene-ZP5TSL62.mjs +45 -0
- package/dist/PieChart3DScene-ZP5TSL62.mjs.br +0 -0
- package/dist/PieChart3DScene-ZP5TSL62.mjs.gz +0 -0
- package/dist/{PowerPointViewer-SkkxAGKa.d.ts → PowerPointViewer-Cl6jBPNw.d.ts} +2 -2
- package/dist/PowerPointViewer-Cl6jBPNw.d.ts.map +1 -0
- package/dist/{SurfaceChart3DScene-OBVXGXSD.mjs → SurfaceChart3DScene-DOMJGPAD.mjs} +1 -1
- package/dist/SurfaceChart3DScene-DOMJGPAD.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-DOMJGPAD.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-BBQFOGVR.js → SurfaceChart3DScene-TGDBVJSW.js} +2 -2
- package/dist/SurfaceChart3DScene-TGDBVJSW.js.br +0 -0
- package/dist/SurfaceChart3DScene-TGDBVJSW.js.gz +0 -0
- package/dist/{audience-content-store-Bx4Yj2pN.d.ts → audience-content-store-bR7Gs_1S.d.ts} +2 -2
- package/dist/{audience-content-store-Bx4Yj2pN.d.ts.map → audience-content-store-bR7Gs_1S.d.ts.map} +1 -1
- package/dist/{chunk-Z4F5BCQB.js → chunk-7JZLE56X.js} +170 -169
- package/dist/chunk-7JZLE56X.js.br +0 -0
- package/dist/chunk-7JZLE56X.js.gz +0 -0
- package/dist/{chunk-AX4JM6TW.js → chunk-A5EUD6UU.js} +2574 -1964
- package/dist/chunk-A5EUD6UU.js.br +0 -0
- package/dist/chunk-A5EUD6UU.js.gz +0 -0
- package/dist/{chunk-V7ZLEZ5W.mjs → chunk-BP2L2KOZ.mjs} +6167 -2447
- package/dist/chunk-BP2L2KOZ.mjs.br +0 -0
- package/dist/chunk-BP2L2KOZ.mjs.gz +0 -0
- package/dist/{chunk-L5MNLIQF.mjs → chunk-MKPSUHUH.mjs} +25 -0
- package/dist/chunk-MKPSUHUH.mjs.br +0 -0
- package/dist/chunk-MKPSUHUH.mjs.gz +0 -0
- package/dist/{chunk-U6A5FWWE.js → chunk-PIUB7R2K.js} +25 -0
- package/dist/chunk-PIUB7R2K.js.br +0 -0
- package/dist/chunk-PIUB7R2K.js.gz +0 -0
- package/dist/{chunk-XURJHY6K.js → chunk-POAZ53L5.js} +391 -391
- package/dist/chunk-POAZ53L5.js.br +0 -0
- package/dist/chunk-POAZ53L5.js.gz +0 -0
- package/dist/{chunk-J4KXCPQ3.mjs → chunk-PQNZCSB7.mjs} +1 -1
- package/dist/chunk-PQNZCSB7.mjs.br +0 -0
- package/dist/chunk-PQNZCSB7.mjs.gz +0 -0
- package/dist/{chunk-6ILXI752.mjs → chunk-SNWAM2XJ.mjs} +17 -16
- package/dist/chunk-SNWAM2XJ.mjs.br +0 -0
- package/dist/chunk-SNWAM2XJ.mjs.gz +0 -0
- package/dist/{chunk-7HPI5HBA.js → chunk-T7BAPZBY.js} +6196 -2447
- package/dist/chunk-T7BAPZBY.js.br +0 -0
- package/dist/chunk-T7BAPZBY.js.gz +0 -0
- package/dist/{chunk-NPA3EBET.mjs → chunk-TIEUZCYQ.mjs} +758 -148
- package/dist/chunk-TIEUZCYQ.mjs.br +0 -0
- package/dist/chunk-TIEUZCYQ.mjs.gz +0 -0
- package/dist/{chunk-ROWGR6GY.mjs → chunk-VMLKJDA5.mjs} +3 -3
- package/dist/chunk-VMLKJDA5.mjs.br +0 -0
- package/dist/chunk-VMLKJDA5.mjs.gz +0 -0
- package/dist/{chunk-5IYGA2HX.js → chunk-VQVC27WL.js} +3 -3
- package/dist/chunk-VQVC27WL.js.br +0 -0
- package/dist/chunk-VQVC27WL.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 +202 -9
- 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 +159 -9
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +7 -5
- 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/{types-kLpvSPxq.d.ts → types-Bzdkiakq.d.ts} +44 -1
- package/dist/{types-kLpvSPxq.d.ts.map → types-Bzdkiakq.d.ts.map} +1 -1
- package/dist/{useViewerBuildingBlocks-fh7rq4jc.d.ts → useViewerBuildingBlocks-DC1O_op4.d.ts} +2 -2
- package/dist/{useViewerBuildingBlocks-fh7rq4jc.d.ts.map → useViewerBuildingBlocks-DC1O_op4.d.ts.map} +1 -1
- package/dist/viewer/index.d.ts +196 -6
- 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 +2 -2
- package/dist/AiChatPanel-E4V3FYLR.js.br +0 -0
- package/dist/AiChatPanel-E4V3FYLR.js.gz +0 -0
- package/dist/AiChatPanel-GSTUOESI.mjs.br +0 -0
- package/dist/AiChatPanel-GSTUOESI.mjs.gz +0 -0
- package/dist/Model3DScene-45JR5NXN.js.br +0 -0
- package/dist/Model3DScene-45JR5NXN.js.gz +0 -0
- package/dist/Model3DScene-634CXE46.mjs.br +0 -0
- package/dist/Model3DScene-634CXE46.mjs.gz +0 -0
- package/dist/PowerPointViewer-SkkxAGKa.d.ts.map +0 -1
- package/dist/SurfaceChart3DScene-BBQFOGVR.js.br +0 -0
- package/dist/SurfaceChart3DScene-BBQFOGVR.js.gz +0 -0
- package/dist/SurfaceChart3DScene-OBVXGXSD.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-OBVXGXSD.mjs.gz +0 -0
- package/dist/chunk-5IYGA2HX.js.br +0 -0
- package/dist/chunk-5IYGA2HX.js.gz +0 -0
- package/dist/chunk-6ILXI752.mjs.br +0 -0
- package/dist/chunk-6ILXI752.mjs.gz +0 -0
- package/dist/chunk-7HPI5HBA.js.br +0 -0
- package/dist/chunk-7HPI5HBA.js.gz +0 -0
- package/dist/chunk-AX4JM6TW.js.br +0 -0
- package/dist/chunk-AX4JM6TW.js.gz +0 -0
- package/dist/chunk-J4KXCPQ3.mjs.br +0 -0
- package/dist/chunk-J4KXCPQ3.mjs.gz +0 -0
- package/dist/chunk-L5MNLIQF.mjs.br +0 -0
- package/dist/chunk-L5MNLIQF.mjs.gz +0 -0
- package/dist/chunk-NPA3EBET.mjs.br +0 -0
- package/dist/chunk-NPA3EBET.mjs.gz +0 -0
- package/dist/chunk-ROWGR6GY.mjs.br +0 -0
- package/dist/chunk-ROWGR6GY.mjs.gz +0 -0
- package/dist/chunk-U6A5FWWE.js.br +0 -0
- package/dist/chunk-U6A5FWWE.js.gz +0 -0
- package/dist/chunk-V7ZLEZ5W.mjs.br +0 -0
- package/dist/chunk-V7ZLEZ5W.mjs.gz +0 -0
- package/dist/chunk-XURJHY6K.js.br +0 -0
- package/dist/chunk-XURJHY6K.js.gz +0 -0
- package/dist/chunk-Z4F5BCQB.js.br +0 -0
- package/dist/chunk-Z4F5BCQB.js.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunk7JZLE56X_js = require('./chunk-7JZLE56X.js');
|
|
4
|
+
var chunkPIUB7R2K_js = require('./chunk-PIUB7R2K.js');
|
|
5
|
+
var chunkT7BAPZBY_js = require('./chunk-T7BAPZBY.js');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var JSZip = require('jszip');
|
|
8
8
|
var reactI18next = require('react-i18next');
|
|
@@ -14,7 +14,7 @@ var JSZip__default = /*#__PURE__*/_interopDefault(JSZip);
|
|
|
14
14
|
function useVirtualizedSlides({
|
|
15
15
|
totalItems,
|
|
16
16
|
itemHeight,
|
|
17
|
-
overscan =
|
|
17
|
+
overscan = chunkT7BAPZBY_js.DEFAULT_VIRTUAL_OVERSCAN
|
|
18
18
|
}) {
|
|
19
19
|
const scrollContainerRef = react.useRef(null);
|
|
20
20
|
const [scrollTop, setScrollTop] = react.useState(0);
|
|
@@ -44,7 +44,7 @@ function useVirtualizedSlides({
|
|
|
44
44
|
resizeObserver?.disconnect();
|
|
45
45
|
};
|
|
46
46
|
}, []);
|
|
47
|
-
const range =
|
|
47
|
+
const range = chunkT7BAPZBY_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
|
|
48
48
|
const safeItemHeight = Math.max(itemHeight, 1);
|
|
49
49
|
const scrollToIndex = react.useCallback(
|
|
50
50
|
(index, behavior = "smooth") => {
|
|
@@ -85,7 +85,7 @@ function usePresenceTracking({
|
|
|
85
85
|
}) {
|
|
86
86
|
const [remoteUsers, setRemoteUsers] = react.useState([]);
|
|
87
87
|
const projectorRef = react.useRef(null);
|
|
88
|
-
projectorRef.current ??=
|
|
88
|
+
projectorRef.current ??= chunkT7BAPZBY_js.createPresenceProjector();
|
|
89
89
|
const projector = projectorRef.current;
|
|
90
90
|
const lastBroadcastRef = react.useRef(0);
|
|
91
91
|
const pendingBroadcastRef = react.useRef(null);
|
|
@@ -110,7 +110,7 @@ function usePresenceTracking({
|
|
|
110
110
|
awareness.setLocalStateField("presence", state);
|
|
111
111
|
lastBroadcastRef.current = Date.now();
|
|
112
112
|
};
|
|
113
|
-
if (elapsed >=
|
|
113
|
+
if (elapsed >= chunkT7BAPZBY_js.BROADCAST_THROTTLE_MS) {
|
|
114
114
|
if (pendingBroadcastRef.current) {
|
|
115
115
|
clearTimeout(pendingBroadcastRef.current);
|
|
116
116
|
pendingBroadcastRef.current = null;
|
|
@@ -120,7 +120,7 @@ function usePresenceTracking({
|
|
|
120
120
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
121
121
|
pendingBroadcastRef.current = null;
|
|
122
122
|
flush();
|
|
123
|
-
},
|
|
123
|
+
}, chunkT7BAPZBY_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
124
124
|
}
|
|
125
125
|
},
|
|
126
126
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -200,7 +200,7 @@ function useYjsProvider({ config }) {
|
|
|
200
200
|
const departureRef = react.useRef(null);
|
|
201
201
|
const gateRef = react.useRef(null);
|
|
202
202
|
if (!gateRef.current) {
|
|
203
|
-
gateRef.current =
|
|
203
|
+
gateRef.current = chunkT7BAPZBY_js.createSyncGate(() => setSynced(true));
|
|
204
204
|
}
|
|
205
205
|
const teardown = react.useCallback(() => {
|
|
206
206
|
if (timeoutRef.current) {
|
|
@@ -220,7 +220,7 @@ function useYjsProvider({ config }) {
|
|
|
220
220
|
const buildCleanup = react.useCallback(
|
|
221
221
|
(provider, yDoc) => () => {
|
|
222
222
|
announceDeparture();
|
|
223
|
-
|
|
223
|
+
chunkT7BAPZBY_js.clearLocalAwareness(provider.awareness);
|
|
224
224
|
provider.destroy();
|
|
225
225
|
yDoc.destroy();
|
|
226
226
|
setDoc(null);
|
|
@@ -245,9 +245,9 @@ function useYjsProvider({ config }) {
|
|
|
245
245
|
if (config.authToken) {
|
|
246
246
|
opts.password = config.authToken;
|
|
247
247
|
}
|
|
248
|
-
const roomId =
|
|
248
|
+
const roomId = chunkT7BAPZBY_js.validateRoomId(config.roomId);
|
|
249
249
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
250
|
-
departureRef.current =
|
|
250
|
+
departureRef.current = chunkT7BAPZBY_js.createDepartureChannel(roomId, provider.awareness);
|
|
251
251
|
setDoc(yDoc);
|
|
252
252
|
setAwareness(provider.awareness);
|
|
253
253
|
setClientId(provider.awareness.clientID);
|
|
@@ -289,13 +289,13 @@ function useYjsProvider({ config }) {
|
|
|
289
289
|
if (!config) {
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
const roomId =
|
|
293
|
-
const transport = config.transport ??
|
|
292
|
+
const roomId = chunkT7BAPZBY_js.validateRoomId(config.roomId);
|
|
293
|
+
const transport = config.transport ?? chunkT7BAPZBY_js.resolveTransportForServerUrl(config.serverUrl);
|
|
294
294
|
if (transport === "webrtc") {
|
|
295
295
|
await initWebrtc();
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
if (
|
|
298
|
+
if (chunkT7BAPZBY_js.isMixedContentBlocked(config.serverUrl)) {
|
|
299
299
|
console.warn(
|
|
300
300
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
301
301
|
);
|
|
@@ -309,7 +309,7 @@ function useYjsProvider({ config }) {
|
|
|
309
309
|
const provider = new WebsocketProvider(config.serverUrl, roomId, yDoc, {
|
|
310
310
|
params: config.authToken ? { token: config.authToken } : void 0
|
|
311
311
|
});
|
|
312
|
-
departureRef.current =
|
|
312
|
+
departureRef.current = chunkT7BAPZBY_js.createDepartureChannel(roomId, provider.awareness);
|
|
313
313
|
let connected = false;
|
|
314
314
|
const handleStatus = (event) => {
|
|
315
315
|
if (event.status === "connected") {
|
|
@@ -349,7 +349,7 @@ function useYjsProvider({ config }) {
|
|
|
349
349
|
provider.off("status", handleStatus);
|
|
350
350
|
provider.off("sync", handleSynced);
|
|
351
351
|
announceDeparture();
|
|
352
|
-
|
|
352
|
+
chunkT7BAPZBY_js.clearLocalAwareness(provider.awareness);
|
|
353
353
|
provider.destroy();
|
|
354
354
|
yDoc.destroy();
|
|
355
355
|
setDoc(null);
|
|
@@ -358,7 +358,7 @@ function useYjsProvider({ config }) {
|
|
|
358
358
|
cleanupRef.current = null;
|
|
359
359
|
setStatus("error");
|
|
360
360
|
}
|
|
361
|
-
},
|
|
361
|
+
}, chunkT7BAPZBY_js.CONNECTION_TIMEOUT_MS);
|
|
362
362
|
}
|
|
363
363
|
setDoc(yDoc);
|
|
364
364
|
setAwareness(provider.awareness);
|
|
@@ -367,7 +367,7 @@ function useYjsProvider({ config }) {
|
|
|
367
367
|
provider.off("status", handleStatus);
|
|
368
368
|
provider.off("sync", handleSynced);
|
|
369
369
|
announceDeparture();
|
|
370
|
-
|
|
370
|
+
chunkT7BAPZBY_js.clearLocalAwareness(provider.awareness);
|
|
371
371
|
provider.destroy();
|
|
372
372
|
yDoc.destroy();
|
|
373
373
|
setDoc(null);
|
|
@@ -393,7 +393,7 @@ function useYjsProvider({ config }) {
|
|
|
393
393
|
]);
|
|
394
394
|
react.useEffect(() => {
|
|
395
395
|
init();
|
|
396
|
-
const disposeTeardown =
|
|
396
|
+
const disposeTeardown = chunkT7BAPZBY_js.registerCollaborationTeardown({
|
|
397
397
|
leave: teardown,
|
|
398
398
|
rejoin: init
|
|
399
399
|
});
|
|
@@ -414,7 +414,7 @@ function useCollaborativeState({
|
|
|
414
414
|
canvasWidth,
|
|
415
415
|
canvasHeight
|
|
416
416
|
}) {
|
|
417
|
-
const userColor =
|
|
417
|
+
const userColor = chunkT7BAPZBY_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
418
418
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
419
419
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
420
420
|
awareness,
|
|
@@ -532,8 +532,8 @@ function useEditorHistory(input) {
|
|
|
532
532
|
width: canvasSize.width,
|
|
533
533
|
height: canvasSize.height,
|
|
534
534
|
activeSlideIndex,
|
|
535
|
-
slides: slides.map(
|
|
536
|
-
templateElementsBySlideId:
|
|
535
|
+
slides: slides.map(chunkT7BAPZBY_js.cloneSlide),
|
|
536
|
+
templateElementsBySlideId: chunkT7BAPZBY_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
537
537
|
...actionLabel ? { actionLabel } : {}
|
|
538
538
|
};
|
|
539
539
|
},
|
|
@@ -546,9 +546,9 @@ function useEditorHistory(input) {
|
|
|
546
546
|
width: snapshot.width,
|
|
547
547
|
height: snapshot.height
|
|
548
548
|
});
|
|
549
|
-
setSlides(snapshot.slides.map(
|
|
549
|
+
setSlides(snapshot.slides.map(chunkT7BAPZBY_js.cloneSlide));
|
|
550
550
|
setTemplateElementsBySlideId(
|
|
551
|
-
|
|
551
|
+
chunkT7BAPZBY_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
552
552
|
);
|
|
553
553
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
554
554
|
setSelectedElementIds([]);
|
|
@@ -587,8 +587,8 @@ function useEditorHistory(input) {
|
|
|
587
587
|
const currentSnapshot = buildHistorySnapshot();
|
|
588
588
|
historyFutureRef.current.push(currentSnapshot);
|
|
589
589
|
isApplyingHistoryRef.current = true;
|
|
590
|
-
const nextSnapshot =
|
|
591
|
-
lastHistorySnapshotRef.current =
|
|
590
|
+
const nextSnapshot = chunk7JZLE56X_js.cloneHistorySnapshot(previousSnapshot);
|
|
591
|
+
lastHistorySnapshotRef.current = chunk7JZLE56X_js.cloneHistorySnapshot(nextSnapshot);
|
|
592
592
|
lastHistorySerializedRef.current = serializeDocument(nextSnapshot);
|
|
593
593
|
applyHistorySnapshot(nextSnapshot);
|
|
594
594
|
updateHistoryAvailability();
|
|
@@ -609,8 +609,8 @@ function useEditorHistory(input) {
|
|
|
609
609
|
const currentSnapshot = buildHistorySnapshot();
|
|
610
610
|
historyPastRef.current.push(currentSnapshot);
|
|
611
611
|
isApplyingHistoryRef.current = true;
|
|
612
|
-
const targetSnapshot =
|
|
613
|
-
lastHistorySnapshotRef.current =
|
|
612
|
+
const targetSnapshot = chunk7JZLE56X_js.cloneHistorySnapshot(nextSnapshot);
|
|
613
|
+
lastHistorySnapshotRef.current = chunk7JZLE56X_js.cloneHistorySnapshot(targetSnapshot);
|
|
614
614
|
lastHistorySerializedRef.current = serializeDocument(targetSnapshot);
|
|
615
615
|
applyHistorySnapshot(targetSnapshot);
|
|
616
616
|
updateHistoryAvailability();
|
|
@@ -628,7 +628,7 @@ function useEditorHistory(input) {
|
|
|
628
628
|
historyPastRef.current = [];
|
|
629
629
|
historyFutureRef.current = [];
|
|
630
630
|
if (initialSnapshot) {
|
|
631
|
-
const clonedInitial =
|
|
631
|
+
const clonedInitial = chunk7JZLE56X_js.cloneHistorySnapshot(initialSnapshot);
|
|
632
632
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
633
633
|
lastHistorySerializedRef.current = serializeDocument(clonedInitial);
|
|
634
634
|
} else {
|
|
@@ -676,19 +676,19 @@ function useEditorHistory(input) {
|
|
|
676
676
|
}
|
|
677
677
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
678
678
|
if (!previousSnapshot) {
|
|
679
|
-
lastHistorySnapshotRef.current =
|
|
679
|
+
lastHistorySnapshotRef.current = chunk7JZLE56X_js.cloneHistorySnapshot(snapshot);
|
|
680
680
|
lastHistorySerializedRef.current = serialized;
|
|
681
681
|
lastCheapHashRef.current = cheapHash;
|
|
682
682
|
updateHistoryAvailability();
|
|
683
683
|
return;
|
|
684
684
|
}
|
|
685
685
|
onDirtyRef.current?.();
|
|
686
|
-
historyPastRef.current.push(
|
|
686
|
+
historyPastRef.current.push(chunk7JZLE56X_js.cloneHistorySnapshot(previousSnapshot));
|
|
687
687
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
688
688
|
historyPastRef.current.shift();
|
|
689
689
|
}
|
|
690
690
|
historyFutureRef.current = [];
|
|
691
|
-
lastHistorySnapshotRef.current =
|
|
691
|
+
lastHistorySnapshotRef.current = chunk7JZLE56X_js.cloneHistorySnapshot(snapshot);
|
|
692
692
|
lastHistorySerializedRef.current = serialized;
|
|
693
693
|
lastCheapHashRef.current = cheapHash;
|
|
694
694
|
updateHistoryAvailability();
|
|
@@ -748,9 +748,9 @@ function useZoomViewport({
|
|
|
748
748
|
const canvasStageRef = react.useRef(null);
|
|
749
749
|
const canvasViewportRef = react.useRef(null);
|
|
750
750
|
const renderScaleRef = react.useRef(1);
|
|
751
|
-
const wheelBufferRef = react.useRef(
|
|
751
|
+
const wheelBufferRef = react.useRef(chunkT7BAPZBY_js.createWheelStepBuffer());
|
|
752
752
|
const storeRef = react.useRef(null);
|
|
753
|
-
storeRef.current ??=
|
|
753
|
+
storeRef.current ??= chunkT7BAPZBY_js.createViewerZoomStore();
|
|
754
754
|
const store = storeRef.current;
|
|
755
755
|
const scale = useViewerStore(store, selectZoom);
|
|
756
756
|
const setScale = react.useCallback(
|
|
@@ -811,7 +811,7 @@ function useZoomViewport({
|
|
|
811
811
|
if (!wrapper || !canvasViewport) {
|
|
812
812
|
return;
|
|
813
813
|
}
|
|
814
|
-
const boundedScale =
|
|
814
|
+
const boundedScale = chunkT7BAPZBY_js.clampZoomScale(nextScale);
|
|
815
815
|
const nextEditorScale = fitScale * boundedScale;
|
|
816
816
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
817
817
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -848,29 +848,29 @@ function useZoomViewport({
|
|
|
848
848
|
selectedElements.forEach((element) => {
|
|
849
849
|
minX = Math.min(minX, element.x);
|
|
850
850
|
minY = Math.min(minY, element.y);
|
|
851
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
852
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
851
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunk7JZLE56X_js.MIN_ELEMENT_SIZE));
|
|
852
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunk7JZLE56X_js.MIN_ELEMENT_SIZE));
|
|
853
853
|
});
|
|
854
854
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
855
855
|
return;
|
|
856
856
|
}
|
|
857
857
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
858
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
859
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
858
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunk7JZLE56X_js.MIN_ELEMENT_SIZE);
|
|
859
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunk7JZLE56X_js.MIN_ELEMENT_SIZE);
|
|
860
860
|
const availableWidth = Math.max(
|
|
861
|
-
effectiveEditorDimensions.width -
|
|
862
|
-
|
|
861
|
+
effectiveEditorDimensions.width - chunk7JZLE56X_js.ZOOM_TO_SELECTION_PADDING,
|
|
862
|
+
chunk7JZLE56X_js.MIN_ELEMENT_SIZE
|
|
863
863
|
);
|
|
864
864
|
const availableHeight = Math.max(
|
|
865
|
-
effectiveEditorDimensions.height -
|
|
866
|
-
|
|
865
|
+
effectiveEditorDimensions.height - chunk7JZLE56X_js.ZOOM_TO_SELECTION_PADDING,
|
|
866
|
+
chunk7JZLE56X_js.MIN_ELEMENT_SIZE
|
|
867
867
|
);
|
|
868
868
|
const targetEditorScale = Math.min(
|
|
869
869
|
availableWidth / boundsWidth,
|
|
870
870
|
availableHeight / boundsHeight
|
|
871
871
|
);
|
|
872
872
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
873
|
-
const nextScale =
|
|
873
|
+
const nextScale = chunkT7BAPZBY_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
874
874
|
setScale(nextScale);
|
|
875
875
|
window.requestAnimationFrame(() => {
|
|
876
876
|
window.requestAnimationFrame(() => {
|
|
@@ -887,14 +887,14 @@ function useZoomViewport({
|
|
|
887
887
|
]);
|
|
888
888
|
const handleWheel = react.useCallback(
|
|
889
889
|
(event) => {
|
|
890
|
-
const mapped =
|
|
890
|
+
const mapped = chunkT7BAPZBY_js.mapEditingWheel(event, wheelBufferRef.current, true);
|
|
891
891
|
if (mapped.intent !== "zoom") {
|
|
892
892
|
return;
|
|
893
893
|
}
|
|
894
894
|
event.preventDefault();
|
|
895
895
|
store.dispatch({
|
|
896
896
|
type: "set-zoom",
|
|
897
|
-
zoom:
|
|
897
|
+
zoom: chunkT7BAPZBY_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
|
|
898
898
|
});
|
|
899
899
|
},
|
|
900
900
|
[store]
|
|
@@ -982,7 +982,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
982
982
|
const command = step.command;
|
|
983
983
|
const timer = window.setTimeout(
|
|
984
984
|
() => {
|
|
985
|
-
|
|
985
|
+
chunk7JZLE56X_js.executeMediaCommand(command);
|
|
986
986
|
},
|
|
987
987
|
Math.max(0, step.delayMs)
|
|
988
988
|
);
|
|
@@ -1119,7 +1119,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1119
1119
|
}))
|
|
1120
1120
|
);
|
|
1121
1121
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1122
|
-
const delay =
|
|
1122
|
+
const delay = chunkT7BAPZBY_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1123
1123
|
const timer = window.setTimeout(() => {
|
|
1124
1124
|
setPresentationAnimations(
|
|
1125
1125
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1151,7 +1151,7 @@ function useAnimationPlayback(input) {
|
|
|
1151
1151
|
(controller, group) => {
|
|
1152
1152
|
driveBuildReveal(
|
|
1153
1153
|
controller,
|
|
1154
|
-
|
|
1154
|
+
chunkT7BAPZBY_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1155
1155
|
setPresentationElementStates,
|
|
1156
1156
|
buildRafRef
|
|
1157
1157
|
);
|
|
@@ -1220,7 +1220,7 @@ function useAnimationPlayback(input) {
|
|
|
1220
1220
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1221
1221
|
return;
|
|
1222
1222
|
}
|
|
1223
|
-
const controller =
|
|
1223
|
+
const controller = chunkT7BAPZBY_js.PresentationAnimationController.fromSlide(slide);
|
|
1224
1224
|
controllerRef.current = controller;
|
|
1225
1225
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1226
1226
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1378,12 +1378,12 @@ function useAnimationPlayback(input) {
|
|
|
1378
1378
|
presentationTimersRef
|
|
1379
1379
|
};
|
|
1380
1380
|
}
|
|
1381
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1382
|
-
var AUDIENCE_HASH =
|
|
1383
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1384
|
-
var AUDIENCE_NONCE_KEY =
|
|
1381
|
+
var PRESENTER_CHANNEL_NAME = chunkT7BAPZBY_js.PRESENTATION_CHANNEL_NAME;
|
|
1382
|
+
var AUDIENCE_HASH = chunkT7BAPZBY_js.PRESENTATION_HASH;
|
|
1383
|
+
var PRESENTER_MSG_ORIGIN = chunkT7BAPZBY_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1384
|
+
var AUDIENCE_NONCE_KEY = chunkT7BAPZBY_js.PRESENTATION_NONCE_KEY;
|
|
1385
1385
|
function generateSessionId() {
|
|
1386
|
-
return
|
|
1386
|
+
return chunkT7BAPZBY_js.createPresentationSessionId();
|
|
1387
1387
|
}
|
|
1388
1388
|
function parseAudienceNonce() {
|
|
1389
1389
|
const hash = window.location.hash;
|
|
@@ -1419,7 +1419,7 @@ function usePresenterWindow(input) {
|
|
|
1419
1419
|
}, []);
|
|
1420
1420
|
const swapDisplays = react.useCallback(async () => {
|
|
1421
1421
|
const audience = audienceWindowRef.current;
|
|
1422
|
-
return audience && !audience.closed ?
|
|
1422
|
+
return audience && !audience.closed ? chunkT7BAPZBY_js.swapPresentationWindows(window, audience) : false;
|
|
1423
1423
|
}, []);
|
|
1424
1424
|
const syncSlideToAudience = react.useCallback(
|
|
1425
1425
|
(slideIndex) => {
|
|
@@ -1483,7 +1483,7 @@ function usePresenterWindow(input) {
|
|
|
1483
1483
|
pollTimerRef.current = null;
|
|
1484
1484
|
}
|
|
1485
1485
|
if (closingSessionId) {
|
|
1486
|
-
void
|
|
1486
|
+
void chunkT7BAPZBY_js.clearAudienceContent(closingSessionId);
|
|
1487
1487
|
}
|
|
1488
1488
|
}, [getChannel]);
|
|
1489
1489
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1501,10 +1501,10 @@ function usePresenterWindow(input) {
|
|
|
1501
1501
|
audienceWindowRef.current = blankWin;
|
|
1502
1502
|
const sessionId = generateSessionId();
|
|
1503
1503
|
sessionIdRef.current = sessionId;
|
|
1504
|
-
const audienceUrl =
|
|
1505
|
-
void
|
|
1504
|
+
const audienceUrl = chunkT7BAPZBY_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1505
|
+
void chunkT7BAPZBY_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1506
1506
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1507
|
-
|
|
1507
|
+
chunkT7BAPZBY_js.placeAudienceWindow(blankWin, placement);
|
|
1508
1508
|
}
|
|
1509
1509
|
return void 0;
|
|
1510
1510
|
});
|
|
@@ -1534,7 +1534,7 @@ function usePresenterWindow(input) {
|
|
|
1534
1534
|
}
|
|
1535
1535
|
};
|
|
1536
1536
|
if (content) {
|
|
1537
|
-
void
|
|
1537
|
+
void chunkT7BAPZBY_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1538
1538
|
} else {
|
|
1539
1539
|
navigateOrClose(true);
|
|
1540
1540
|
}
|
|
@@ -1560,7 +1560,7 @@ function usePresenterWindow(input) {
|
|
|
1560
1560
|
}
|
|
1561
1561
|
const handleMessage = (event) => {
|
|
1562
1562
|
const message = event.data;
|
|
1563
|
-
if (
|
|
1563
|
+
if (chunkT7BAPZBY_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1564
1564
|
syncStateToAudience(snapshotRef.current);
|
|
1565
1565
|
}
|
|
1566
1566
|
};
|
|
@@ -1589,7 +1589,7 @@ function usePresenterWindow(input) {
|
|
|
1589
1589
|
react.useEffect(() => {
|
|
1590
1590
|
const handleBeforeUnload = () => {
|
|
1591
1591
|
if (sessionIdRef.current) {
|
|
1592
|
-
void
|
|
1592
|
+
void chunkT7BAPZBY_js.clearAudienceContent(sessionIdRef.current);
|
|
1593
1593
|
}
|
|
1594
1594
|
};
|
|
1595
1595
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1651,7 +1651,7 @@ function useAudienceMode(input) {
|
|
|
1651
1651
|
}
|
|
1652
1652
|
channel.onmessage = (event) => {
|
|
1653
1653
|
const data = event.data;
|
|
1654
|
-
if (!
|
|
1654
|
+
if (!chunkT7BAPZBY_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1655
1655
|
return;
|
|
1656
1656
|
}
|
|
1657
1657
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1667,16 +1667,16 @@ function useAudienceMode(input) {
|
|
|
1667
1667
|
}
|
|
1668
1668
|
if (data.type === "presenter-exit") {
|
|
1669
1669
|
if (expectedSessionId) {
|
|
1670
|
-
void
|
|
1670
|
+
void chunkT7BAPZBY_js.clearAudienceContent(expectedSessionId);
|
|
1671
1671
|
}
|
|
1672
|
-
if (
|
|
1672
|
+
if (chunkT7BAPZBY_js.endAudienceDisplay(window)) {
|
|
1673
1673
|
handlers.onPresenterEnded?.();
|
|
1674
1674
|
}
|
|
1675
1675
|
}
|
|
1676
1676
|
};
|
|
1677
1677
|
if (expectedSessionId) {
|
|
1678
1678
|
channel.postMessage({
|
|
1679
|
-
origin:
|
|
1679
|
+
origin: chunkT7BAPZBY_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1680
1680
|
type: "audience-ready",
|
|
1681
1681
|
sessionId: expectedSessionId
|
|
1682
1682
|
});
|
|
@@ -1690,7 +1690,7 @@ function useAudienceMode(input) {
|
|
|
1690
1690
|
}, []);
|
|
1691
1691
|
}
|
|
1692
1692
|
function usePresentationKeyboard(input) {
|
|
1693
|
-
const wheelBufferRef = react.useRef(
|
|
1693
|
+
const wheelBufferRef = react.useRef(chunkT7BAPZBY_js.createWheelStepBuffer());
|
|
1694
1694
|
const {
|
|
1695
1695
|
mode,
|
|
1696
1696
|
movePresentationSlide,
|
|
@@ -1711,14 +1711,14 @@ function usePresentationKeyboard(input) {
|
|
|
1711
1711
|
presentationSlideIndex,
|
|
1712
1712
|
setShowRehearsalSummary
|
|
1713
1713
|
} = input;
|
|
1714
|
-
const keyBufferRef = react.useRef(
|
|
1714
|
+
const keyBufferRef = react.useRef(chunkT7BAPZBY_js.createPresentationKeyBuffer());
|
|
1715
1715
|
react.useEffect(() => {
|
|
1716
|
-
if (mode !== "present" || !
|
|
1717
|
-
keyBufferRef.current =
|
|
1716
|
+
if (mode !== "present" || !chunkT7BAPZBY_js.acceptsPresentationInput()) {
|
|
1717
|
+
keyBufferRef.current = chunkT7BAPZBY_js.createPresentationKeyBuffer();
|
|
1718
1718
|
return;
|
|
1719
1719
|
}
|
|
1720
1720
|
const handleKeyDown = (event) => {
|
|
1721
|
-
const mapped =
|
|
1721
|
+
const mapped = chunkT7BAPZBY_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1722
1722
|
if (mapped.action === "none") {
|
|
1723
1723
|
return;
|
|
1724
1724
|
}
|
|
@@ -1738,12 +1738,12 @@ function usePresentationKeyboard(input) {
|
|
|
1738
1738
|
movePresentationSlide(-1);
|
|
1739
1739
|
return;
|
|
1740
1740
|
case "first": {
|
|
1741
|
-
const first =
|
|
1741
|
+
const first = chunkT7BAPZBY_js.firstShowSlideIndex(showSlideIndexes);
|
|
1742
1742
|
navigateToSlide(first ?? 0);
|
|
1743
1743
|
return;
|
|
1744
1744
|
}
|
|
1745
1745
|
case "last": {
|
|
1746
|
-
const last =
|
|
1746
|
+
const last = chunkT7BAPZBY_js.lastShowSlideIndex(showSlideIndexes);
|
|
1747
1747
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1748
1748
|
return;
|
|
1749
1749
|
}
|
|
@@ -1781,10 +1781,10 @@ function usePresentationKeyboard(input) {
|
|
|
1781
1781
|
}
|
|
1782
1782
|
};
|
|
1783
1783
|
const handleWheel = (event) => {
|
|
1784
|
-
if (mode !== "present" || !
|
|
1784
|
+
if (mode !== "present" || !chunkT7BAPZBY_js.acceptsPresentationInput()) {
|
|
1785
1785
|
return;
|
|
1786
1786
|
}
|
|
1787
|
-
const mapped =
|
|
1787
|
+
const mapped = chunkT7BAPZBY_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1788
1788
|
if (mapped.intent === "next-slide") {
|
|
1789
1789
|
event.preventDefault();
|
|
1790
1790
|
movePresentationSlide(1);
|
|
@@ -1917,7 +1917,7 @@ function useRehearsalTimings(input) {
|
|
|
1917
1917
|
|
|
1918
1918
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1919
1919
|
function handlePresentationActionImpl(action, deps) {
|
|
1920
|
-
|
|
1920
|
+
chunkT7BAPZBY_js.runPresentationAction(
|
|
1921
1921
|
action,
|
|
1922
1922
|
{ slideCount: deps.slidesLength },
|
|
1923
1923
|
{
|
|
@@ -1939,7 +1939,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1939
1939
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1940
1940
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1941
1941
|
const transition = incomingSlide?.transition;
|
|
1942
|
-
const durationMs = deps.playTransition ?
|
|
1942
|
+
const durationMs = deps.playTransition ? chunkT7BAPZBY_js.resolveTransitionDurationMs(transition) : 0;
|
|
1943
1943
|
deps.clearPresentationTimers();
|
|
1944
1944
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1945
1945
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1998,7 +1998,7 @@ function useSlideNavigation(input) {
|
|
|
1998
1998
|
});
|
|
1999
1999
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
2000
2000
|
(slideIndex) => {
|
|
2001
|
-
const delayMs =
|
|
2001
|
+
const delayMs = chunkT7BAPZBY_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
2002
2002
|
if (delayMs === void 0) {
|
|
2003
2003
|
return;
|
|
2004
2004
|
}
|
|
@@ -2021,7 +2021,7 @@ function useSlideNavigation(input) {
|
|
|
2021
2021
|
if (availableSlideIndexes.length === 0) {
|
|
2022
2022
|
return;
|
|
2023
2023
|
}
|
|
2024
|
-
const pastLastSlide = direction === 1 && !
|
|
2024
|
+
const pastLastSlide = direction === 1 && !chunkT7BAPZBY_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
2025
2025
|
if (rehearsing && pastLastSlide) {
|
|
2026
2026
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
2027
2027
|
try {
|
|
@@ -2039,9 +2039,9 @@ function useSlideNavigation(input) {
|
|
|
2039
2039
|
onAdvancePastLastSlide();
|
|
2040
2040
|
return;
|
|
2041
2041
|
}
|
|
2042
|
-
const nextSlideIndex = direction === 1 ?
|
|
2042
|
+
const nextSlideIndex = direction === 1 ? chunkT7BAPZBY_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
2043
2043
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
2044
|
-
}) :
|
|
2044
|
+
}) : chunkT7BAPZBY_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
2045
2045
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
2046
2046
|
return;
|
|
2047
2047
|
}
|
|
@@ -2186,22 +2186,22 @@ function useZoomNavigation(input) {
|
|
|
2186
2186
|
};
|
|
2187
2187
|
}
|
|
2188
2188
|
function usePresenterConsole(slideIndex, active) {
|
|
2189
|
-
const timerRef = react.useRef(
|
|
2190
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2189
|
+
const timerRef = react.useRef(chunkT7BAPZBY_js.createPresenterTimer());
|
|
2190
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkT7BAPZBY_js.createInitialPresentationSnapshot(slideIndex));
|
|
2191
2191
|
const patch = react.useCallback((value) => {
|
|
2192
|
-
setSnapshot((current) =>
|
|
2192
|
+
setSnapshot((current) => chunkT7BAPZBY_js.mergePresentationSnapshot(current, value));
|
|
2193
2193
|
}, []);
|
|
2194
2194
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2195
2195
|
react.useEffect(() => {
|
|
2196
2196
|
if (!active) {
|
|
2197
2197
|
return;
|
|
2198
2198
|
}
|
|
2199
|
-
timerRef.current =
|
|
2199
|
+
timerRef.current = chunkT7BAPZBY_js.resetPresenterTimer();
|
|
2200
2200
|
patch({ paused: false, elapsedMs: 0 });
|
|
2201
2201
|
const timer = window.setInterval(() => {
|
|
2202
2202
|
patch({
|
|
2203
2203
|
paused: timerRef.current.paused,
|
|
2204
|
-
elapsedMs:
|
|
2204
|
+
elapsedMs: chunkT7BAPZBY_js.presenterElapsed(timerRef.current)
|
|
2205
2205
|
});
|
|
2206
2206
|
}, 1e3);
|
|
2207
2207
|
return () => window.clearInterval(timer);
|
|
@@ -2211,19 +2211,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2211
2211
|
applyAudienceSnapshot: setSnapshot,
|
|
2212
2212
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2213
2213
|
toggleTimer: () => {
|
|
2214
|
-
timerRef.current =
|
|
2214
|
+
timerRef.current = chunkT7BAPZBY_js.togglePresenterTimer(timerRef.current);
|
|
2215
2215
|
patch({
|
|
2216
2216
|
paused: timerRef.current.paused,
|
|
2217
|
-
elapsedMs:
|
|
2217
|
+
elapsedMs: chunkT7BAPZBY_js.presenterElapsed(timerRef.current)
|
|
2218
2218
|
});
|
|
2219
2219
|
},
|
|
2220
2220
|
resetTimer: () => {
|
|
2221
|
-
timerRef.current =
|
|
2221
|
+
timerRef.current = chunkT7BAPZBY_js.resetPresenterTimer();
|
|
2222
2222
|
patch({ paused: false, elapsedMs: 0 });
|
|
2223
2223
|
},
|
|
2224
2224
|
stepZoom: (direction) => setSnapshot(
|
|
2225
|
-
(current) =>
|
|
2226
|
-
zoom:
|
|
2225
|
+
(current) => chunkT7BAPZBY_js.mergePresentationSnapshot(current, {
|
|
2226
|
+
zoom: chunkT7BAPZBY_js.stepPresenterZoom(
|
|
2227
2227
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2228
2228
|
direction
|
|
2229
2229
|
)
|
|
@@ -2269,7 +2269,7 @@ function usePresentationMode(input) {
|
|
|
2269
2269
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2270
2270
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2271
2271
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2272
|
-
const showGuard = react.useMemo(() =>
|
|
2272
|
+
const showGuard = react.useMemo(() => chunkT7BAPZBY_js.createPresenterShowGuard(), []);
|
|
2273
2273
|
const {
|
|
2274
2274
|
presentationAnimations,
|
|
2275
2275
|
presentationElementStates,
|
|
@@ -2348,7 +2348,7 @@ function usePresentationMode(input) {
|
|
|
2348
2348
|
});
|
|
2349
2349
|
const movePresentationSlide = react.useCallback(
|
|
2350
2350
|
(direction, trigger = "explicit") => {
|
|
2351
|
-
if (!
|
|
2351
|
+
if (!chunkT7BAPZBY_js.acceptsPresentationInput()) {
|
|
2352
2352
|
return;
|
|
2353
2353
|
}
|
|
2354
2354
|
if (endOfShowVisible) {
|
|
@@ -2486,7 +2486,7 @@ function usePresentationMode(input) {
|
|
|
2486
2486
|
if (mode !== "present") {
|
|
2487
2487
|
return;
|
|
2488
2488
|
}
|
|
2489
|
-
return
|
|
2489
|
+
return chunkT7BAPZBY_js.attachPresentationVisibilityPause({
|
|
2490
2490
|
root: containerRef.current ?? void 0,
|
|
2491
2491
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2492
2492
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2566,11 +2566,11 @@ function usePresentationMode(input) {
|
|
|
2566
2566
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2567
2567
|
return void 0;
|
|
2568
2568
|
}
|
|
2569
|
-
return
|
|
2569
|
+
return chunkT7BAPZBY_js.buildMorphTransitionPlan(
|
|
2570
2570
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2571
2571
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2572
2572
|
transitionOverlay.durationMs,
|
|
2573
|
-
|
|
2573
|
+
chunkT7BAPZBY_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2574
2574
|
);
|
|
2575
2575
|
}, [transitionOverlay, slides]);
|
|
2576
2576
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2591,7 +2591,7 @@ function usePresentationMode(input) {
|
|
|
2591
2591
|
if (!morphPlan) {
|
|
2592
2592
|
return presentationKeyframesCss;
|
|
2593
2593
|
}
|
|
2594
|
-
const imageRules =
|
|
2594
|
+
const imageRules = chunkT7BAPZBY_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2595
2595
|
return `${presentationKeyframesCss ?? ""}
|
|
2596
2596
|
${morphPlan.keyframesCss}
|
|
2597
2597
|
${imageRules}`;
|
|
@@ -2887,7 +2887,7 @@ function useFindReplace({
|
|
|
2887
2887
|
const [findResults, setFindResults] = react.useState([]);
|
|
2888
2888
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
2889
2889
|
const performFind = react.useCallback(() => {
|
|
2890
|
-
const results =
|
|
2890
|
+
const results = chunkT7BAPZBY_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
2891
2891
|
if (!findQuery) {
|
|
2892
2892
|
setFindResults([]);
|
|
2893
2893
|
setFindResultIndex(-1);
|
|
@@ -2921,7 +2921,7 @@ function useFindReplace({
|
|
|
2921
2921
|
return;
|
|
2922
2922
|
}
|
|
2923
2923
|
onUpdateSlides(
|
|
2924
|
-
(prevSlides) =>
|
|
2924
|
+
(prevSlides) => chunkT7BAPZBY_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
2925
2925
|
);
|
|
2926
2926
|
onMarkDirty();
|
|
2927
2927
|
},
|
|
@@ -2943,9 +2943,9 @@ function useFindReplace({
|
|
|
2943
2943
|
}, [findResults, applyReplacements, performFind]);
|
|
2944
2944
|
react.useEffect(() => {
|
|
2945
2945
|
const handler = (event) => {
|
|
2946
|
-
const { action } =
|
|
2946
|
+
const { action } = chunkT7BAPZBY_js.mapEditorKey(event, {
|
|
2947
2947
|
canEdit: mode === "edit",
|
|
2948
|
-
isTextInputTarget:
|
|
2948
|
+
isTextInputTarget: chunkT7BAPZBY_js.isEditorTextInputTarget(event.target)
|
|
2949
2949
|
});
|
|
2950
2950
|
if (action !== "find") {
|
|
2951
2951
|
return;
|
|
@@ -3024,7 +3024,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId) {
|
|
|
3024
3024
|
if (!slide) {
|
|
3025
3025
|
return { slides, didAdd: false };
|
|
3026
3026
|
}
|
|
3027
|
-
const next =
|
|
3027
|
+
const next = chunkT7BAPZBY_js.addCommentToList(
|
|
3028
3028
|
slide.comments || [],
|
|
3029
3029
|
text,
|
|
3030
3030
|
authorName,
|
|
@@ -3042,7 +3042,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
|
3042
3042
|
if (!slide) {
|
|
3043
3043
|
return { slides, didDelete: false };
|
|
3044
3044
|
}
|
|
3045
|
-
const next =
|
|
3045
|
+
const next = chunkT7BAPZBY_js.removeCommentFromList(slide.comments || [], commentId);
|
|
3046
3046
|
if (!next) {
|
|
3047
3047
|
return { slides, didDelete: false };
|
|
3048
3048
|
}
|
|
@@ -3053,7 +3053,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
|
3053
3053
|
if (!slide) {
|
|
3054
3054
|
return { slides, didUpdate: false };
|
|
3055
3055
|
}
|
|
3056
|
-
const next =
|
|
3056
|
+
const next = chunkT7BAPZBY_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
3057
3057
|
if (!next) {
|
|
3058
3058
|
return { slides, didUpdate: false };
|
|
3059
3059
|
}
|
|
@@ -3064,7 +3064,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
|
3064
3064
|
if (!slide) {
|
|
3065
3065
|
return { slides, didUpdate: false };
|
|
3066
3066
|
}
|
|
3067
|
-
const next =
|
|
3067
|
+
const next = chunkT7BAPZBY_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
3068
3068
|
if (!next) {
|
|
3069
3069
|
return { slides, didUpdate: false };
|
|
3070
3070
|
}
|
|
@@ -3075,7 +3075,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName) {
|
|
|
3075
3075
|
if (!slide) {
|
|
3076
3076
|
return { slides, didAdd: false };
|
|
3077
3077
|
}
|
|
3078
|
-
const next =
|
|
3078
|
+
const next = chunkT7BAPZBY_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
3079
3079
|
if (!next) {
|
|
3080
3080
|
return { slides, didAdd: false };
|
|
3081
3081
|
}
|
|
@@ -3449,7 +3449,7 @@ function useViewerCoreState(_input) {
|
|
|
3449
3449
|
const marqueeStateRef = react.useRef(null);
|
|
3450
3450
|
const isDrawingRef = react.useRef(false);
|
|
3451
3451
|
const justInteractedRef = react.useRef(false);
|
|
3452
|
-
const livePatcher = react.useMemo(() =>
|
|
3452
|
+
const livePatcher = react.useMemo(() => chunkT7BAPZBY_js.createCollaborationLivePatcher(), []);
|
|
3453
3453
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3454
3454
|
const slidesRef = react.useRef([]);
|
|
3455
3455
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3458,8 +3458,8 @@ function useViewerCoreState(_input) {
|
|
|
3458
3458
|
const [slides, setSlides] = react.useState([]);
|
|
3459
3459
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3460
3460
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3461
|
-
width:
|
|
3462
|
-
height:
|
|
3461
|
+
width: chunk7JZLE56X_js.DEFAULT_CANVAS_WIDTH,
|
|
3462
|
+
height: chunk7JZLE56X_js.DEFAULT_CANVAS_HEIGHT
|
|
3463
3463
|
});
|
|
3464
3464
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3465
3465
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3480,7 +3480,7 @@ function useViewerCoreState(_input) {
|
|
|
3480
3480
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3481
3481
|
inlineEditingTextRef.current = resolved;
|
|
3482
3482
|
setInlineEditingTextBase(value);
|
|
3483
|
-
|
|
3483
|
+
chunkT7BAPZBY_js.publishLiveInlineText(
|
|
3484
3484
|
livePatcher,
|
|
3485
3485
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3486
3486
|
inlineEditingElementIdRef.current,
|
|
@@ -3823,7 +3823,7 @@ function useLoadContent({
|
|
|
3823
3823
|
);
|
|
3824
3824
|
}
|
|
3825
3825
|
const previousHandler = handlerRef.current;
|
|
3826
|
-
const handler = new
|
|
3826
|
+
const handler = new chunkT7BAPZBY_js.PptxHandler();
|
|
3827
3827
|
const parsed = await handler.load(buffer);
|
|
3828
3828
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3829
3829
|
handler.dispose();
|
|
@@ -3835,7 +3835,7 @@ function useLoadContent({
|
|
|
3835
3835
|
handlerRef.current = null;
|
|
3836
3836
|
const mediaElements = [];
|
|
3837
3837
|
for (const slide of parsed.slides) {
|
|
3838
|
-
|
|
3838
|
+
chunkT7BAPZBY_js.collectMediaElements(slide.elements, mediaElements);
|
|
3839
3839
|
}
|
|
3840
3840
|
for (const url of mediaDataUrls.values()) {
|
|
3841
3841
|
if (url.startsWith("blob:")) {
|
|
@@ -3876,7 +3876,7 @@ function useLoadContent({
|
|
|
3876
3876
|
}
|
|
3877
3877
|
})
|
|
3878
3878
|
);
|
|
3879
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3879
|
+
const { paths: imagePaths, refs: imageRefs } = chunkT7BAPZBY_js.collectImagePaths(parsed.slides);
|
|
3880
3880
|
let nextSlides = parsed.slides;
|
|
3881
3881
|
if (imagePaths.size > 0) {
|
|
3882
3882
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3930,7 +3930,7 @@ function useLoadContent({
|
|
|
3930
3930
|
});
|
|
3931
3931
|
}
|
|
3932
3932
|
}
|
|
3933
|
-
const { paths: tableImagePaths, refs: tableImageRefs } =
|
|
3933
|
+
const { paths: tableImagePaths, refs: tableImageRefs } = chunkT7BAPZBY_js.collectTableCellImagePaths(nextSlides);
|
|
3934
3934
|
if (tableImagePaths.size > 0) {
|
|
3935
3935
|
const resolvedTableMap = /* @__PURE__ */ new Map();
|
|
3936
3936
|
await Promise.all(
|
|
@@ -3946,7 +3946,7 @@ function useLoadContent({
|
|
|
3946
3946
|
);
|
|
3947
3947
|
if (resolvedTableMap.size > 0) {
|
|
3948
3948
|
nextSlides = nextSlides.map((s) => {
|
|
3949
|
-
const newElements =
|
|
3949
|
+
const newElements = chunkT7BAPZBY_js.applyTableCellImagePatches(
|
|
3950
3950
|
s.elements,
|
|
3951
3951
|
resolvedTableMap,
|
|
3952
3952
|
tableImageRefs
|
|
@@ -3956,7 +3956,7 @@ function useLoadContent({
|
|
|
3956
3956
|
}
|
|
3957
3957
|
}
|
|
3958
3958
|
let nextTableStyleMap = parsed.tableStyleMap;
|
|
3959
|
-
const { paths: tableStyleImagePaths, refs: tableStyleImageRefs } =
|
|
3959
|
+
const { paths: tableStyleImagePaths, refs: tableStyleImageRefs } = chunkT7BAPZBY_js.collectTableStyleImagePaths(nextTableStyleMap);
|
|
3960
3960
|
if (tableStyleImagePaths.size > 0) {
|
|
3961
3961
|
const resolvedStyleMap = /* @__PURE__ */ new Map();
|
|
3962
3962
|
await Promise.all(
|
|
@@ -3971,7 +3971,7 @@ function useLoadContent({
|
|
|
3971
3971
|
})
|
|
3972
3972
|
);
|
|
3973
3973
|
if (resolvedStyleMap.size > 0 && nextTableStyleMap) {
|
|
3974
|
-
nextTableStyleMap =
|
|
3974
|
+
nextTableStyleMap = chunkT7BAPZBY_js.applyTableStyleImagePatches(
|
|
3975
3975
|
nextTableStyleMap,
|
|
3976
3976
|
resolvedStyleMap,
|
|
3977
3977
|
tableStyleImageRefs
|
|
@@ -3979,12 +3979,12 @@ function useLoadContent({
|
|
|
3979
3979
|
}
|
|
3980
3980
|
}
|
|
3981
3981
|
handlerRef.current = handler;
|
|
3982
|
-
const partition =
|
|
3982
|
+
const partition = chunkT7BAPZBY_js.partitionTemplateElements(nextSlides);
|
|
3983
3983
|
setSlides(partition.slides);
|
|
3984
3984
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3985
3985
|
setCanvasSize({
|
|
3986
|
-
width: parsed.width ??
|
|
3987
|
-
height: parsed.height ??
|
|
3986
|
+
width: parsed.width ?? chunk7JZLE56X_js.DEFAULT_CANVAS_WIDTH,
|
|
3987
|
+
height: parsed.height ?? chunk7JZLE56X_js.DEFAULT_CANVAS_HEIGHT
|
|
3988
3988
|
});
|
|
3989
3989
|
setSlideSizeEmu(
|
|
3990
3990
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4001,7 +4001,7 @@ function useLoadContent({
|
|
|
4001
4001
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
4002
4002
|
setCustomShows(parsed.customShows ?? []);
|
|
4003
4003
|
setActiveCustomShowId(
|
|
4004
|
-
|
|
4004
|
+
chunkT7BAPZBY_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
4005
4005
|
);
|
|
4006
4006
|
setSections(parsed.sections ?? []);
|
|
4007
4007
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -4024,7 +4024,7 @@ function useLoadContent({
|
|
|
4024
4024
|
setHasMacros(parsed.hasMacros === true);
|
|
4025
4025
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4026
4026
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4027
|
-
setGuides(
|
|
4027
|
+
setGuides(chunkT7BAPZBY_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4028
4028
|
setActiveSlideIndex(0);
|
|
4029
4029
|
clearSelection();
|
|
4030
4030
|
setIsDirty(false);
|
|
@@ -4032,7 +4032,7 @@ function useLoadContent({
|
|
|
4032
4032
|
onContentApplied?.();
|
|
4033
4033
|
} catch (err) {
|
|
4034
4034
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4035
|
-
if (err instanceof
|
|
4035
|
+
if (err instanceof chunkT7BAPZBY_js.EncryptedFileError) {
|
|
4036
4036
|
setIsEncrypted(true);
|
|
4037
4037
|
} else {
|
|
4038
4038
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4060,7 +4060,7 @@ function useLoadContent({
|
|
|
4060
4060
|
}
|
|
4061
4061
|
function useAutosave(input) {
|
|
4062
4062
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4063
|
-
const intervalMs =
|
|
4063
|
+
const intervalMs = chunkT7BAPZBY_js.resolveAutosaveIntervalMs({
|
|
4064
4064
|
hostIntervalMs: input.intervalMs,
|
|
4065
4065
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4066
4066
|
});
|
|
@@ -4091,7 +4091,7 @@ function useAutosave(input) {
|
|
|
4091
4091
|
return;
|
|
4092
4092
|
}
|
|
4093
4093
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4094
|
-
if (!
|
|
4094
|
+
if (!chunkT7BAPZBY_js.shouldWriteAutosaveSnapshot({
|
|
4095
4095
|
filePath: path,
|
|
4096
4096
|
isDirty: isDirtyRef.current,
|
|
4097
4097
|
saving: isSavingRef.current,
|
|
@@ -4109,8 +4109,8 @@ function useAutosave(input) {
|
|
|
4109
4109
|
isSavingRef.current = false;
|
|
4110
4110
|
return;
|
|
4111
4111
|
}
|
|
4112
|
-
await
|
|
4113
|
-
lastSnapshotRef.current =
|
|
4112
|
+
await chunkT7BAPZBY_js.saveAutosaveSnapshot(path, data);
|
|
4113
|
+
lastSnapshotRef.current = chunkT7BAPZBY_js.autosaveSnapshotMark(path, sources);
|
|
4114
4114
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4115
4115
|
} catch (err) {
|
|
4116
4116
|
setAutosaveStatus({
|
|
@@ -4196,11 +4196,11 @@ function useElementOperations(input) {
|
|
|
4196
4196
|
(elementId, updates) => {
|
|
4197
4197
|
if (masterView?.target) {
|
|
4198
4198
|
applyMasterViewWrite(
|
|
4199
|
-
|
|
4199
|
+
chunkT7BAPZBY_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4200
4200
|
);
|
|
4201
4201
|
return;
|
|
4202
4202
|
}
|
|
4203
|
-
if (
|
|
4203
|
+
if (chunkT7BAPZBY_js.isTemplateElementId(elementId)) {
|
|
4204
4204
|
const slideId = activeSlide?.id;
|
|
4205
4205
|
if (slideId) {
|
|
4206
4206
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4248,7 +4248,7 @@ function useElementOperations(input) {
|
|
|
4248
4248
|
);
|
|
4249
4249
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4250
4250
|
(updates) => {
|
|
4251
|
-
if (!selectedElement || !
|
|
4251
|
+
if (!selectedElement || !chunkT7BAPZBY_js.hasShapeProperties(selectedElement)) {
|
|
4252
4252
|
return;
|
|
4253
4253
|
}
|
|
4254
4254
|
updateSelectedElement({
|
|
@@ -4259,17 +4259,17 @@ function useElementOperations(input) {
|
|
|
4259
4259
|
);
|
|
4260
4260
|
const updateSelectedTextStyle = react.useCallback(
|
|
4261
4261
|
(updates) => {
|
|
4262
|
-
if (!selectedElement || !
|
|
4262
|
+
if (!selectedElement || !chunkT7BAPZBY_js.hasTextProperties(selectedElement)) {
|
|
4263
4263
|
return;
|
|
4264
4264
|
}
|
|
4265
|
-
const inlineSel =
|
|
4265
|
+
const inlineSel = chunkT7BAPZBY_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4266
4266
|
if (inlineSel && selectedElement.textSegments) {
|
|
4267
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4267
|
+
const { newSegments: newSegments2, newSelection } = chunkT7BAPZBY_js.applyStyleToSelectedSegments(
|
|
4268
4268
|
selectedElement.textSegments,
|
|
4269
4269
|
inlineSel,
|
|
4270
4270
|
updates
|
|
4271
4271
|
);
|
|
4272
|
-
|
|
4272
|
+
chunkT7BAPZBY_js.setPendingSelectionRestore(newSelection);
|
|
4273
4273
|
updateSelectedElement({
|
|
4274
4274
|
textSegments: newSegments2
|
|
4275
4275
|
});
|
|
@@ -4289,12 +4289,12 @@ function useElementOperations(input) {
|
|
|
4289
4289
|
);
|
|
4290
4290
|
const updateSelectedTextCase = react.useCallback(
|
|
4291
4291
|
(mode) => {
|
|
4292
|
-
if (!selectedElement || !
|
|
4292
|
+
if (!selectedElement || !chunkT7BAPZBY_js.hasTextProperties(selectedElement)) {
|
|
4293
4293
|
return;
|
|
4294
4294
|
}
|
|
4295
|
-
const inlineSel =
|
|
4295
|
+
const inlineSel = chunkT7BAPZBY_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4296
4296
|
if (inlineSel && selectedElement.textSegments) {
|
|
4297
|
-
const newSegments =
|
|
4297
|
+
const newSegments = chunkT7BAPZBY_js.applyCaseTransformToSegments(
|
|
4298
4298
|
selectedElement.textSegments,
|
|
4299
4299
|
inlineSel,
|
|
4300
4300
|
mode
|
|
@@ -4304,14 +4304,14 @@ function useElementOperations(input) {
|
|
|
4304
4304
|
}
|
|
4305
4305
|
const updates = {};
|
|
4306
4306
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4307
|
-
updates.textSegments =
|
|
4307
|
+
updates.textSegments = chunkT7BAPZBY_js.applyCaseTransformToSegments(
|
|
4308
4308
|
selectedElement.textSegments,
|
|
4309
4309
|
null,
|
|
4310
4310
|
mode
|
|
4311
4311
|
);
|
|
4312
4312
|
}
|
|
4313
4313
|
if (typeof selectedElement.text === "string") {
|
|
4314
|
-
updates.text =
|
|
4314
|
+
updates.text = chunkT7BAPZBY_js.transformTextCase(selectedElement.text, mode);
|
|
4315
4315
|
}
|
|
4316
4316
|
updateSelectedElement(updates);
|
|
4317
4317
|
},
|
|
@@ -4324,15 +4324,15 @@ function useElementOperations(input) {
|
|
|
4324
4324
|
[setSlides]
|
|
4325
4325
|
);
|
|
4326
4326
|
const masterViewTarget = masterView?.target ?? null;
|
|
4327
|
-
const activeElements = masterViewTarget ?
|
|
4327
|
+
const activeElements = masterViewTarget ? chunkT7BAPZBY_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4328
4328
|
const updateActiveElements = react.useCallback(
|
|
4329
4329
|
(updater) => {
|
|
4330
4330
|
if (masterView?.target) {
|
|
4331
4331
|
applyMasterViewWrite(
|
|
4332
|
-
|
|
4332
|
+
chunkT7BAPZBY_js.replaceMasterViewElements(
|
|
4333
4333
|
masterView,
|
|
4334
4334
|
masterView.target,
|
|
4335
|
-
updater(
|
|
4335
|
+
updater(chunkT7BAPZBY_js.masterViewElements(masterView, masterView.target))
|
|
4336
4336
|
)
|
|
4337
4337
|
);
|
|
4338
4338
|
return;
|
|
@@ -4385,7 +4385,7 @@ function useSectionOperations(input) {
|
|
|
4385
4385
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4386
4386
|
const addSection2 = react.useCallback(
|
|
4387
4387
|
(name, afterSlideIndex) => {
|
|
4388
|
-
const result =
|
|
4388
|
+
const result = chunkT7BAPZBY_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4389
4389
|
setSlides(result.slides);
|
|
4390
4390
|
setSections(result.sections);
|
|
4391
4391
|
markDirty();
|
|
@@ -4394,7 +4394,7 @@ function useSectionOperations(input) {
|
|
|
4394
4394
|
);
|
|
4395
4395
|
const renameSection2 = react.useCallback(
|
|
4396
4396
|
(sectionId, newName) => {
|
|
4397
|
-
const result =
|
|
4397
|
+
const result = chunkT7BAPZBY_js.renameSection(sections, slides, sectionId, newName);
|
|
4398
4398
|
setSections(result.sections);
|
|
4399
4399
|
setSlides(result.slides);
|
|
4400
4400
|
markDirty();
|
|
@@ -4403,7 +4403,7 @@ function useSectionOperations(input) {
|
|
|
4403
4403
|
);
|
|
4404
4404
|
const deleteSection2 = react.useCallback(
|
|
4405
4405
|
(sectionId) => {
|
|
4406
|
-
const result =
|
|
4406
|
+
const result = chunkT7BAPZBY_js.deleteSection(sections, slides, sectionId);
|
|
4407
4407
|
setSections(result.sections);
|
|
4408
4408
|
setSlides(result.slides);
|
|
4409
4409
|
markDirty();
|
|
@@ -4412,21 +4412,21 @@ function useSectionOperations(input) {
|
|
|
4412
4412
|
);
|
|
4413
4413
|
const moveSectionUp2 = react.useCallback(
|
|
4414
4414
|
(sectionId) => {
|
|
4415
|
-
setSections(
|
|
4415
|
+
setSections(chunkT7BAPZBY_js.moveSectionUp(sections, sectionId));
|
|
4416
4416
|
markDirty();
|
|
4417
4417
|
},
|
|
4418
4418
|
[sections, setSections, markDirty]
|
|
4419
4419
|
);
|
|
4420
4420
|
const moveSectionDown2 = react.useCallback(
|
|
4421
4421
|
(sectionId) => {
|
|
4422
|
-
setSections(
|
|
4422
|
+
setSections(chunkT7BAPZBY_js.moveSectionDown(sections, sectionId));
|
|
4423
4423
|
markDirty();
|
|
4424
4424
|
},
|
|
4425
4425
|
[sections, setSections, markDirty]
|
|
4426
4426
|
);
|
|
4427
4427
|
const moveSlidesToSection2 = react.useCallback(
|
|
4428
4428
|
(slideIndexes, targetSectionId) => {
|
|
4429
|
-
const result =
|
|
4429
|
+
const result = chunkT7BAPZBY_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4430
4430
|
setSlides(result.slides);
|
|
4431
4431
|
setSections(result.sections);
|
|
4432
4432
|
markDirty();
|
|
@@ -4455,19 +4455,19 @@ function useSectionOperations(input) {
|
|
|
4455
4455
|
|
|
4456
4456
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4457
4457
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4458
|
-
const resized =
|
|
4458
|
+
const resized = chunkT7BAPZBY_js.applyResize(
|
|
4459
4459
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4460
4460
|
handle,
|
|
4461
4461
|
dx,
|
|
4462
4462
|
dy,
|
|
4463
4463
|
1,
|
|
4464
|
-
{ minSize:
|
|
4464
|
+
{ minSize: chunk7JZLE56X_js.MIN_ELEMENT_SIZE }
|
|
4465
4465
|
);
|
|
4466
4466
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4467
4467
|
if (!snapToGrid) {
|
|
4468
4468
|
return box;
|
|
4469
4469
|
}
|
|
4470
|
-
return
|
|
4470
|
+
return chunkT7BAPZBY_js.snapBoxToGrid(box, handle, gridSpacingPx, chunk7JZLE56X_js.MIN_ELEMENT_SIZE);
|
|
4471
4471
|
}
|
|
4472
4472
|
function resolveLiveTarget(input) {
|
|
4473
4473
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4580,7 +4580,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4580
4580
|
width: el.width,
|
|
4581
4581
|
height: el.height
|
|
4582
4582
|
}));
|
|
4583
|
-
const snapResult =
|
|
4583
|
+
const snapResult = chunkT7BAPZBY_js.computeSnapToShape(
|
|
4584
4584
|
targetX,
|
|
4585
4585
|
targetY,
|
|
4586
4586
|
primaryEl.width,
|
|
@@ -4619,7 +4619,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4619
4619
|
if (live) {
|
|
4620
4620
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4621
4621
|
const start = drag.startPositionsById[id];
|
|
4622
|
-
|
|
4622
|
+
chunkT7BAPZBY_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4623
4623
|
x: start.x + appliedDx,
|
|
4624
4624
|
y: start.y + appliedDy
|
|
4625
4625
|
});
|
|
@@ -4653,22 +4653,22 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4653
4653
|
if (rs.domEl) {
|
|
4654
4654
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4655
4655
|
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,
|
|
4656
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunk7JZLE56X_js.MIN_ELEMENT_SIZE)}px`;
|
|
4657
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunk7JZLE56X_js.MIN_ELEMENT_SIZE)}px`;
|
|
4658
4658
|
}
|
|
4659
4659
|
if (live) {
|
|
4660
|
-
|
|
4660
|
+
chunkT7BAPZBY_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4661
4661
|
x: geo.x,
|
|
4662
4662
|
y: geo.y,
|
|
4663
|
-
width: Math.max(geo.width,
|
|
4664
|
-
height: Math.max(geo.height,
|
|
4663
|
+
width: Math.max(geo.width, chunk7JZLE56X_js.MIN_ELEMENT_SIZE),
|
|
4664
|
+
height: Math.max(geo.height, chunk7JZLE56X_js.MIN_ELEMENT_SIZE)
|
|
4665
4665
|
});
|
|
4666
4666
|
}
|
|
4667
4667
|
}
|
|
4668
4668
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4669
4669
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4670
4670
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4671
|
-
const adjustments =
|
|
4671
|
+
const adjustments = chunkT7BAPZBY_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4672
4672
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4673
4673
|
adj.moved = true;
|
|
4674
4674
|
}
|
|
@@ -4743,13 +4743,13 @@ function processPointerUp(input) {
|
|
|
4743
4743
|
if (i !== activeSlideIndex) {
|
|
4744
4744
|
return s;
|
|
4745
4745
|
}
|
|
4746
|
-
const rerouted =
|
|
4746
|
+
const rerouted = chunkT7BAPZBY_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4747
4747
|
if (rerouted.length === 0) {
|
|
4748
4748
|
return s;
|
|
4749
4749
|
}
|
|
4750
4750
|
return {
|
|
4751
4751
|
...s,
|
|
4752
|
-
elements:
|
|
4752
|
+
elements: chunkT7BAPZBY_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4753
4753
|
};
|
|
4754
4754
|
})
|
|
4755
4755
|
);
|
|
@@ -4774,9 +4774,9 @@ function processPointerUp(input) {
|
|
|
4774
4774
|
}
|
|
4775
4775
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4776
4776
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4777
|
-
const hitIds =
|
|
4777
|
+
const hitIds = chunkT7BAPZBY_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4778
4778
|
if (marquee.additive) {
|
|
4779
|
-
const merged =
|
|
4779
|
+
const merged = chunkT7BAPZBY_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4780
4780
|
if (merged.length > 0) {
|
|
4781
4781
|
applySelection(merged[0], merged);
|
|
4782
4782
|
} else {
|
|
@@ -4799,8 +4799,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4799
4799
|
}
|
|
4800
4800
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4801
4801
|
});
|
|
4802
|
-
const rerouted =
|
|
4803
|
-
return
|
|
4802
|
+
const rerouted = chunkT7BAPZBY_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4803
|
+
return chunkT7BAPZBY_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4804
4804
|
};
|
|
4805
4805
|
if (editTemplateMode) {
|
|
4806
4806
|
const slideId = activeSlide?.id;
|
|
@@ -4957,11 +4957,11 @@ function useCanvasInteractions(input) {
|
|
|
4957
4957
|
return;
|
|
4958
4958
|
}
|
|
4959
4959
|
const el = elementLookup.get(editId);
|
|
4960
|
-
if (el &&
|
|
4960
|
+
if (el && chunkT7BAPZBY_js.hasTextProperties(el)) {
|
|
4961
4961
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4962
|
-
const newSegments =
|
|
4962
|
+
const newSegments = chunkT7BAPZBY_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4963
4963
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
4964
|
-
const newHeight =
|
|
4964
|
+
const newHeight = chunkT7BAPZBY_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
4965
4965
|
ops.updateElementById(editId, {
|
|
4966
4966
|
text: committedText,
|
|
4967
4967
|
textSegments: newSegments,
|
|
@@ -4973,7 +4973,7 @@ function useCanvasInteractions(input) {
|
|
|
4973
4973
|
setInlineEditingText("");
|
|
4974
4974
|
};
|
|
4975
4975
|
const openEquationEditorForElement = (el) => {
|
|
4976
|
-
if (!
|
|
4976
|
+
if (!chunkT7BAPZBY_js.hasTextProperties(el)) {
|
|
4977
4977
|
return false;
|
|
4978
4978
|
}
|
|
4979
4979
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5003,7 +5003,7 @@ function useCanvasInteractions(input) {
|
|
|
5003
5003
|
justInteractedRef.current = false;
|
|
5004
5004
|
} else {
|
|
5005
5005
|
const el = elementLookup.get(elementId);
|
|
5006
|
-
if (el &&
|
|
5006
|
+
if (el && chunkT7BAPZBY_js.hasTextProperties(el) && chunkT7BAPZBY_js.canInteractWithElement(el, "textEdit")) {
|
|
5007
5007
|
if (!openEquationEditorForElement(el)) {
|
|
5008
5008
|
setInlineEditingElementId(elementId);
|
|
5009
5009
|
setInlineEditingText(el.text ?? "");
|
|
@@ -5022,7 +5022,7 @@ function useCanvasInteractions(input) {
|
|
|
5022
5022
|
if (openEquationEditorForElement(el)) {
|
|
5023
5023
|
return;
|
|
5024
5024
|
}
|
|
5025
|
-
if (
|
|
5025
|
+
if (chunkT7BAPZBY_js.hasTextProperties(el) && chunkT7BAPZBY_js.canInteractWithElement(el, "textEdit")) {
|
|
5026
5026
|
setInlineEditingElementId(elementId);
|
|
5027
5027
|
setInlineEditingText(el.text ?? "");
|
|
5028
5028
|
}
|
|
@@ -5045,7 +5045,7 @@ function useCanvasInteractions(input) {
|
|
|
5045
5045
|
justSelectedRef.current = false;
|
|
5046
5046
|
}
|
|
5047
5047
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
5048
|
-
const movableIds =
|
|
5048
|
+
const movableIds = chunkT7BAPZBY_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
5049
5049
|
if (movableIds.length === 0) {
|
|
5050
5050
|
return;
|
|
5051
5051
|
}
|
|
@@ -5115,7 +5115,7 @@ function useCanvasInteractions(input) {
|
|
|
5115
5115
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5116
5116
|
e.stopPropagation();
|
|
5117
5117
|
const el = elementLookup.get(elementId);
|
|
5118
|
-
if (!el || !
|
|
5118
|
+
if (!el || !chunkT7BAPZBY_js.canInteractWithElement(el, "resize")) {
|
|
5119
5119
|
return;
|
|
5120
5120
|
}
|
|
5121
5121
|
resizeStateRef.current = {
|
|
@@ -5137,7 +5137,7 @@ function useCanvasInteractions(input) {
|
|
|
5137
5137
|
};
|
|
5138
5138
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5139
5139
|
const el = elementLookup.get(elementId);
|
|
5140
|
-
if (!el || !
|
|
5140
|
+
if (!el || !chunkT7BAPZBY_js.canInteractWithElement(el, "rotate")) {
|
|
5141
5141
|
return;
|
|
5142
5142
|
}
|
|
5143
5143
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5157,10 +5157,10 @@ function useCanvasInteractions(input) {
|
|
|
5157
5157
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5158
5158
|
e.stopPropagation();
|
|
5159
5159
|
const el = elementLookup.get(elementId);
|
|
5160
|
-
if (!el || !
|
|
5160
|
+
if (!el || !chunkT7BAPZBY_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5161
5161
|
return;
|
|
5162
5162
|
}
|
|
5163
|
-
shapeAdjustmentDragStateRef.current =
|
|
5163
|
+
shapeAdjustmentDragStateRef.current = chunkT7BAPZBY_js.beginShapeAdjustment(
|
|
5164
5164
|
el,
|
|
5165
5165
|
descriptor,
|
|
5166
5166
|
e.clientX,
|
|
@@ -5207,7 +5207,7 @@ function createFileHandlers(deps) {
|
|
|
5207
5207
|
h = Math.round(h * scale);
|
|
5208
5208
|
}
|
|
5209
5209
|
addElement({
|
|
5210
|
-
id:
|
|
5210
|
+
id: chunkT7BAPZBY_js.generateElementId(),
|
|
5211
5211
|
type: "image",
|
|
5212
5212
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5213
5213
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5218,7 +5218,7 @@ function createFileHandlers(deps) {
|
|
|
5218
5218
|
};
|
|
5219
5219
|
img.onerror = () => {
|
|
5220
5220
|
addElement({
|
|
5221
|
-
id:
|
|
5221
|
+
id: chunkT7BAPZBY_js.generateElementId(),
|
|
5222
5222
|
type: "image",
|
|
5223
5223
|
x: 100,
|
|
5224
5224
|
y: 100,
|
|
@@ -5237,14 +5237,14 @@ function createFileHandlers(deps) {
|
|
|
5237
5237
|
return;
|
|
5238
5238
|
}
|
|
5239
5239
|
e.target.value = "";
|
|
5240
|
-
const mediaType =
|
|
5240
|
+
const mediaType = chunkT7BAPZBY_js.classifyMediaType(file.type);
|
|
5241
5241
|
if (!mediaType) {
|
|
5242
5242
|
return;
|
|
5243
5243
|
}
|
|
5244
5244
|
const elFilePath = file.path;
|
|
5245
5245
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5246
5246
|
addElement({
|
|
5247
|
-
id:
|
|
5247
|
+
id: chunkT7BAPZBY_js.generateElementId(),
|
|
5248
5248
|
type: "media",
|
|
5249
5249
|
mediaType,
|
|
5250
5250
|
mediaMimeType: file.type || void 0,
|
|
@@ -5419,13 +5419,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5419
5419
|
return;
|
|
5420
5420
|
}
|
|
5421
5421
|
addElement({
|
|
5422
|
-
id:
|
|
5422
|
+
id: chunkT7BAPZBY_js.generateElementId(),
|
|
5423
5423
|
type: "smartArt",
|
|
5424
5424
|
x: 100,
|
|
5425
5425
|
y: 120,
|
|
5426
5426
|
width: 600,
|
|
5427
5427
|
height: 340,
|
|
5428
|
-
smartArtData:
|
|
5428
|
+
smartArtData: chunkT7BAPZBY_js.buildSmartArtPresetData(
|
|
5429
5429
|
layout,
|
|
5430
5430
|
defaultItems,
|
|
5431
5431
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5437,7 +5437,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5437
5437
|
return;
|
|
5438
5438
|
}
|
|
5439
5439
|
addElement({
|
|
5440
|
-
id:
|
|
5440
|
+
id: chunkT7BAPZBY_js.generateElementId(),
|
|
5441
5441
|
type: "shape",
|
|
5442
5442
|
x: 120,
|
|
5443
5443
|
y: 200,
|
|
@@ -5475,7 +5475,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5475
5475
|
return;
|
|
5476
5476
|
}
|
|
5477
5477
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5478
|
-
if (resolved.url && !
|
|
5478
|
+
if (resolved.url && !chunkT7BAPZBY_js.isUrlSafe(resolved.url)) {
|
|
5479
5479
|
return;
|
|
5480
5480
|
}
|
|
5481
5481
|
const actionClick = {
|
|
@@ -5499,7 +5499,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5499
5499
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5500
5500
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5501
5501
|
addElement({
|
|
5502
|
-
id:
|
|
5502
|
+
id: chunkT7BAPZBY_js.generateElementId(),
|
|
5503
5503
|
type: "shape",
|
|
5504
5504
|
x: 120,
|
|
5505
5505
|
y: 200,
|
|
@@ -5521,11 +5521,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5521
5521
|
if (!activeSlide) {
|
|
5522
5522
|
return;
|
|
5523
5523
|
}
|
|
5524
|
-
const preset =
|
|
5524
|
+
const preset = chunkT7BAPZBY_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5525
5525
|
if (!preset) {
|
|
5526
5526
|
return;
|
|
5527
5527
|
}
|
|
5528
|
-
const defaultPptxAction =
|
|
5528
|
+
const defaultPptxAction = chunkT7BAPZBY_js.elementActionToPptxAction({
|
|
5529
5529
|
trigger: "click",
|
|
5530
5530
|
type: preset.defaultAction
|
|
5531
5531
|
});
|
|
@@ -5534,7 +5534,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5534
5534
|
defaultPptxAction.highlightClick = true;
|
|
5535
5535
|
}
|
|
5536
5536
|
addElement({
|
|
5537
|
-
id:
|
|
5537
|
+
id: chunkT7BAPZBY_js.generateElementId(),
|
|
5538
5538
|
type: "shape",
|
|
5539
5539
|
x: 150,
|
|
5540
5540
|
y: 150,
|
|
@@ -5601,14 +5601,14 @@ function useInsertElements(input) {
|
|
|
5601
5601
|
return;
|
|
5602
5602
|
}
|
|
5603
5603
|
addElement({
|
|
5604
|
-
id:
|
|
5604
|
+
id: chunkT7BAPZBY_js.generateElementId(),
|
|
5605
5605
|
type: "text",
|
|
5606
5606
|
x: 100,
|
|
5607
5607
|
y: 100,
|
|
5608
5608
|
width: 300,
|
|
5609
5609
|
height: 60,
|
|
5610
5610
|
text: "",
|
|
5611
|
-
textStyle: { fontSize:
|
|
5611
|
+
textStyle: { fontSize: chunk7JZLE56X_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5612
5612
|
});
|
|
5613
5613
|
};
|
|
5614
5614
|
const handleAddShape = () => {
|
|
@@ -5616,7 +5616,7 @@ function useInsertElements(input) {
|
|
|
5616
5616
|
return;
|
|
5617
5617
|
}
|
|
5618
5618
|
addElement({
|
|
5619
|
-
id:
|
|
5619
|
+
id: chunkT7BAPZBY_js.generateElementId(),
|
|
5620
5620
|
type: "shape",
|
|
5621
5621
|
x: 150,
|
|
5622
5622
|
y: 150,
|
|
@@ -5635,15 +5635,15 @@ function useInsertElements(input) {
|
|
|
5635
5635
|
return;
|
|
5636
5636
|
}
|
|
5637
5637
|
addElement({
|
|
5638
|
-
...
|
|
5639
|
-
id:
|
|
5638
|
+
...chunkT7BAPZBY_js.newTableElement(chunk7JZLE56X_js.DEFAULT_TABLE_ROWS, chunk7JZLE56X_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5639
|
+
id: chunkT7BAPZBY_js.generateElementId()
|
|
5640
5640
|
});
|
|
5641
5641
|
};
|
|
5642
5642
|
const handleAddChart = (chartKind) => {
|
|
5643
5643
|
if (!activeSlide) {
|
|
5644
5644
|
return;
|
|
5645
5645
|
}
|
|
5646
|
-
addElement(
|
|
5646
|
+
addElement(chunkT7BAPZBY_js.createDefaultChartElement(chartKind));
|
|
5647
5647
|
};
|
|
5648
5648
|
const structured = createStructuredElementHandlers({
|
|
5649
5649
|
activeSlide,
|
|
@@ -5713,7 +5713,7 @@ function useClipboardHandlers(input) {
|
|
|
5713
5713
|
if (!selectedElement) {
|
|
5714
5714
|
return;
|
|
5715
5715
|
}
|
|
5716
|
-
setClipboardPayload(
|
|
5716
|
+
setClipboardPayload(chunkT7BAPZBY_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5717
5717
|
};
|
|
5718
5718
|
const handleDelete = () => {
|
|
5719
5719
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5730,7 +5730,7 @@ function useClipboardHandlers(input) {
|
|
|
5730
5730
|
handleDelete();
|
|
5731
5731
|
};
|
|
5732
5732
|
const insertClone = (source) => {
|
|
5733
|
-
const clone =
|
|
5733
|
+
const clone = chunkT7BAPZBY_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5734
5734
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5735
5735
|
ops.applySelection(clone.id);
|
|
5736
5736
|
history.markDirty();
|
|
@@ -5765,7 +5765,7 @@ function resolveShapePath(el) {
|
|
|
5765
5765
|
return el.pathData;
|
|
5766
5766
|
}
|
|
5767
5767
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5768
|
-
const clipPath =
|
|
5768
|
+
const clipPath = chunkT7BAPZBY_js.getPresetShapeClipPath(el.shapeType);
|
|
5769
5769
|
if (clipPath) {
|
|
5770
5770
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5771
5771
|
if (svgPath) {
|
|
@@ -5816,7 +5816,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5816
5816
|
return parts.join(" ");
|
|
5817
5817
|
}
|
|
5818
5818
|
function transformPathToGlobal(pathData, el) {
|
|
5819
|
-
const polys =
|
|
5819
|
+
const polys = chunkT7BAPZBY_js.svgPathToPolygons(pathData);
|
|
5820
5820
|
if (polys.length === 0) {
|
|
5821
5821
|
return pathData;
|
|
5822
5822
|
}
|
|
@@ -5836,10 +5836,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5836
5836
|
y: pt.y * scaleY + el.y
|
|
5837
5837
|
}))
|
|
5838
5838
|
);
|
|
5839
|
-
return
|
|
5839
|
+
return chunkT7BAPZBY_js.polygonsToSvgPath(transformed);
|
|
5840
5840
|
}
|
|
5841
5841
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5842
|
-
const polys =
|
|
5842
|
+
const polys = chunkT7BAPZBY_js.svgPathToPolygons(pathData);
|
|
5843
5843
|
if (polys.length === 0) {
|
|
5844
5844
|
return pathData;
|
|
5845
5845
|
}
|
|
@@ -5849,10 +5849,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5849
5849
|
y: pt.y - y
|
|
5850
5850
|
}))
|
|
5851
5851
|
);
|
|
5852
|
-
return
|
|
5852
|
+
return chunkT7BAPZBY_js.polygonsToSvgPath(transformed);
|
|
5853
5853
|
}
|
|
5854
5854
|
function pathBounds(pathData) {
|
|
5855
|
-
const polys =
|
|
5855
|
+
const polys = chunkT7BAPZBY_js.svgPathToPolygons(pathData);
|
|
5856
5856
|
let minX = Infinity;
|
|
5857
5857
|
let minY = Infinity;
|
|
5858
5858
|
let maxX = -Infinity;
|
|
@@ -5911,7 +5911,7 @@ function useMergeShapesHandler(input) {
|
|
|
5911
5911
|
let allFragments = [];
|
|
5912
5912
|
let remaining = globalPaths[0];
|
|
5913
5913
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5914
|
-
const frags =
|
|
5914
|
+
const frags = chunkT7BAPZBY_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5915
5915
|
if (Array.isArray(frags)) {
|
|
5916
5916
|
allFragments = frags;
|
|
5917
5917
|
}
|
|
@@ -5940,7 +5940,7 @@ function useMergeShapesHandler(input) {
|
|
|
5940
5940
|
bounds.height
|
|
5941
5941
|
);
|
|
5942
5942
|
const newEl = {
|
|
5943
|
-
id:
|
|
5943
|
+
id: chunkT7BAPZBY_js.generateElementId(),
|
|
5944
5944
|
type: "shape",
|
|
5945
5945
|
x: bounds.x,
|
|
5946
5946
|
y: bounds.y,
|
|
@@ -5978,7 +5978,7 @@ function useMergeShapesHandler(input) {
|
|
|
5978
5978
|
} else {
|
|
5979
5979
|
let resultPath = globalPaths[0];
|
|
5980
5980
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5981
|
-
const result =
|
|
5981
|
+
const result = chunkT7BAPZBY_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5982
5982
|
if (typeof result === "string") {
|
|
5983
5983
|
resultPath = result;
|
|
5984
5984
|
}
|
|
@@ -5999,7 +5999,7 @@ function useMergeShapesHandler(input) {
|
|
|
5999
5999
|
);
|
|
6000
6000
|
const primary = targets[0];
|
|
6001
6001
|
const newEl = {
|
|
6002
|
-
id:
|
|
6002
|
+
id: chunkT7BAPZBY_js.generateElementId(),
|
|
6003
6003
|
type: "shape",
|
|
6004
6004
|
x: bounds.x,
|
|
6005
6005
|
y: bounds.y,
|
|
@@ -6062,7 +6062,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6062
6062
|
if (ids.length < 2 || !activeSlide) {
|
|
6063
6063
|
return;
|
|
6064
6064
|
}
|
|
6065
|
-
const { elements, groupId } =
|
|
6065
|
+
const { elements, groupId } = chunkT7BAPZBY_js.groupElements(ops.activeElements, ids, chunkT7BAPZBY_js.generateElementId());
|
|
6066
6066
|
if (groupId === null) {
|
|
6067
6067
|
return;
|
|
6068
6068
|
}
|
|
@@ -6075,11 +6075,11 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6075
6075
|
return;
|
|
6076
6076
|
}
|
|
6077
6077
|
const group = selectedElement;
|
|
6078
|
-
const intoTemplate =
|
|
6078
|
+
const intoTemplate = chunkT7BAPZBY_js.isTemplateElementId(group.id);
|
|
6079
6079
|
const childIds = group.children.map(
|
|
6080
|
-
(child) => intoTemplate ?
|
|
6080
|
+
(child) => intoTemplate ? chunkT7BAPZBY_js.makeCloneId(true, child.id || group.id) : child.id || chunkT7BAPZBY_js.generateElementId()
|
|
6081
6081
|
);
|
|
6082
|
-
const { elements, childIds: usedIds } =
|
|
6082
|
+
const { elements, childIds: usedIds } = chunkT7BAPZBY_js.ungroupElements(
|
|
6083
6083
|
ops.activeElements,
|
|
6084
6084
|
group.id,
|
|
6085
6085
|
childIds,
|
|
@@ -6108,7 +6108,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6108
6108
|
if (!edge) {
|
|
6109
6109
|
return;
|
|
6110
6110
|
}
|
|
6111
|
-
const positions =
|
|
6111
|
+
const positions = chunkT7BAPZBY_js.alignElements(selectedElements, edge);
|
|
6112
6112
|
for (const [id, pos] of positions) {
|
|
6113
6113
|
const el = elementLookup.get(id);
|
|
6114
6114
|
if (!el) {
|
|
@@ -6126,7 +6126,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6126
6126
|
if (!distAxis) {
|
|
6127
6127
|
return;
|
|
6128
6128
|
}
|
|
6129
|
-
const positions =
|
|
6129
|
+
const positions = chunkT7BAPZBY_js.distributeElements(selectedElements, distAxis);
|
|
6130
6130
|
for (const [id, pos] of positions) {
|
|
6131
6131
|
const el = elementLookup.get(id);
|
|
6132
6132
|
if (!el) {
|
|
@@ -6143,7 +6143,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6143
6143
|
}
|
|
6144
6144
|
const id = selectedElement.id;
|
|
6145
6145
|
ops.updateActiveElements(
|
|
6146
|
-
(els) => direction === "forward" ?
|
|
6146
|
+
(els) => direction === "forward" ? chunkT7BAPZBY_js.bringForward(els, id) : direction === "backward" ? chunkT7BAPZBY_js.sendBackward(els, id) : els
|
|
6147
6147
|
);
|
|
6148
6148
|
history.markDirty();
|
|
6149
6149
|
};
|
|
@@ -6153,7 +6153,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6153
6153
|
}
|
|
6154
6154
|
const id = selectedElement.id;
|
|
6155
6155
|
ops.updateActiveElements(
|
|
6156
|
-
(els) => direction === "front" ?
|
|
6156
|
+
(els) => direction === "front" ? chunkT7BAPZBY_js.bringToFront(els, id) : chunkT7BAPZBY_js.sendToBack(els, id)
|
|
6157
6157
|
);
|
|
6158
6158
|
history.markDirty();
|
|
6159
6159
|
};
|
|
@@ -6284,7 +6284,7 @@ function useSlideManagement(input) {
|
|
|
6284
6284
|
theme
|
|
6285
6285
|
} = input;
|
|
6286
6286
|
const handleAddSlide = () => {
|
|
6287
|
-
const newSlide =
|
|
6287
|
+
const newSlide = chunkT7BAPZBY_js.createBlankSlide(slides.length + 1);
|
|
6288
6288
|
ops.updateSlides((prev) => {
|
|
6289
6289
|
const next = [...prev];
|
|
6290
6290
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6347,7 +6347,7 @@ function useSlideManagement(input) {
|
|
|
6347
6347
|
}
|
|
6348
6348
|
const clone = {
|
|
6349
6349
|
...src,
|
|
6350
|
-
id:
|
|
6350
|
+
id: chunkT7BAPZBY_js.makeSlideId(),
|
|
6351
6351
|
elements: src.elements.map((el) => ({
|
|
6352
6352
|
...el,
|
|
6353
6353
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6379,7 +6379,7 @@ function useSlideManagement(input) {
|
|
|
6379
6379
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6380
6380
|
const insertAt = activeSlideIndex + 1;
|
|
6381
6381
|
const draft = {
|
|
6382
|
-
...
|
|
6382
|
+
...chunkT7BAPZBY_js.createBlankSlide(slides.length + 1),
|
|
6383
6383
|
layoutPath,
|
|
6384
6384
|
...layoutName ? { layoutName } : {}
|
|
6385
6385
|
};
|
|
@@ -6412,9 +6412,9 @@ function useSlideManagement(input) {
|
|
|
6412
6412
|
};
|
|
6413
6413
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6414
6414
|
const insertAt = activeSlideIndex + 1;
|
|
6415
|
-
const draft =
|
|
6415
|
+
const draft = chunkT7BAPZBY_js.buildSlideTemplateSlide(templateId, chunkT7BAPZBY_js.makeSlideId(), slides.length + 1, {
|
|
6416
6416
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6417
|
-
scheme:
|
|
6417
|
+
scheme: chunkT7BAPZBY_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6418
6418
|
});
|
|
6419
6419
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6420
6420
|
setActiveSlideIndex(insertAt);
|
|
@@ -6451,7 +6451,7 @@ function createTableMergeHandlers(input) {
|
|
|
6451
6451
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6452
6452
|
return;
|
|
6453
6453
|
}
|
|
6454
|
-
const newTableData =
|
|
6454
|
+
const newTableData = chunkT7BAPZBY_js.mergeCells(
|
|
6455
6455
|
[
|
|
6456
6456
|
{ row: rowIndex, col: columnIndex },
|
|
6457
6457
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6459,7 +6459,7 @@ function createTableMergeHandlers(input) {
|
|
|
6459
6459
|
td
|
|
6460
6460
|
);
|
|
6461
6461
|
const updates = { tableData: newTableData };
|
|
6462
|
-
const newRawXml =
|
|
6462
|
+
const newRawXml = chunkT7BAPZBY_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6463
6463
|
if (newRawXml) {
|
|
6464
6464
|
updates.rawXml = newRawXml;
|
|
6465
6465
|
}
|
|
@@ -6485,7 +6485,7 @@ function createTableMergeHandlers(input) {
|
|
|
6485
6485
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6486
6486
|
return;
|
|
6487
6487
|
}
|
|
6488
|
-
const newTableData =
|
|
6488
|
+
const newTableData = chunkT7BAPZBY_js.mergeCells(
|
|
6489
6489
|
[
|
|
6490
6490
|
{ row: rowIndex, col: columnIndex },
|
|
6491
6491
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6493,7 +6493,7 @@ function createTableMergeHandlers(input) {
|
|
|
6493
6493
|
td
|
|
6494
6494
|
);
|
|
6495
6495
|
const updates = { tableData: newTableData };
|
|
6496
|
-
const newRawXml =
|
|
6496
|
+
const newRawXml = chunkT7BAPZBY_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6497
6497
|
if (newRawXml) {
|
|
6498
6498
|
updates.rawXml = newRawXml;
|
|
6499
6499
|
}
|
|
@@ -6508,9 +6508,9 @@ function createTableMergeHandlers(input) {
|
|
|
6508
6508
|
return;
|
|
6509
6509
|
}
|
|
6510
6510
|
const td = selectedElement.tableData;
|
|
6511
|
-
const newTableData =
|
|
6511
|
+
const newTableData = chunkT7BAPZBY_js.mergeCells(ts.selectedCells, td);
|
|
6512
6512
|
const updates = { tableData: newTableData };
|
|
6513
|
-
const newRawXml =
|
|
6513
|
+
const newRawXml = chunkT7BAPZBY_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6514
6514
|
if (newRawXml) {
|
|
6515
6515
|
updates.rawXml = newRawXml;
|
|
6516
6516
|
}
|
|
@@ -6527,9 +6527,9 @@ function createTableMergeHandlers(input) {
|
|
|
6527
6527
|
}
|
|
6528
6528
|
const { rowIndex, columnIndex } = ts;
|
|
6529
6529
|
const td = selectedElement.tableData;
|
|
6530
|
-
const newTableData =
|
|
6530
|
+
const newTableData = chunkT7BAPZBY_js.splitCell(rowIndex, columnIndex, td);
|
|
6531
6531
|
const updates = { tableData: newTableData };
|
|
6532
|
-
const newRawXml =
|
|
6532
|
+
const newRawXml = chunkT7BAPZBY_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6533
6533
|
if (newRawXml) {
|
|
6534
6534
|
updates.rawXml = newRawXml;
|
|
6535
6535
|
}
|
|
@@ -6561,10 +6561,10 @@ function createTableStructHandlers(input) {
|
|
|
6561
6561
|
}
|
|
6562
6562
|
const updates = {};
|
|
6563
6563
|
if (el.tableData) {
|
|
6564
|
-
updates.tableData =
|
|
6564
|
+
updates.tableData = chunkT7BAPZBY_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6565
6565
|
}
|
|
6566
6566
|
if (el.rawXml) {
|
|
6567
|
-
const newRawXml =
|
|
6567
|
+
const newRawXml = chunkT7BAPZBY_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6568
6568
|
if (newRawXml) {
|
|
6569
6569
|
updates.rawXml = newRawXml;
|
|
6570
6570
|
}
|
|
@@ -6588,7 +6588,7 @@ function createTableStructHandlers(input) {
|
|
|
6588
6588
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6589
6589
|
const updates = {};
|
|
6590
6590
|
if (selectedElement.rawXml) {
|
|
6591
|
-
const newRawXml =
|
|
6591
|
+
const newRawXml = chunkT7BAPZBY_js.updateCellTextStyleInRawXml(
|
|
6592
6592
|
selectedElement,
|
|
6593
6593
|
rowIndex,
|
|
6594
6594
|
colIndex,
|
|
@@ -6652,9 +6652,9 @@ function createTableStructHandlers(input) {
|
|
|
6652
6652
|
return;
|
|
6653
6653
|
}
|
|
6654
6654
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6655
|
-
const newTableData =
|
|
6655
|
+
const newTableData = chunkT7BAPZBY_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6656
6656
|
const updates = { tableData: newTableData };
|
|
6657
|
-
const newRawXml =
|
|
6657
|
+
const newRawXml = chunkT7BAPZBY_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6658
6658
|
if (newRawXml) {
|
|
6659
6659
|
updates.rawXml = newRawXml;
|
|
6660
6660
|
}
|
|
@@ -6667,12 +6667,12 @@ function createTableStructHandlers(input) {
|
|
|
6667
6667
|
}
|
|
6668
6668
|
const td = selectedElement.tableData;
|
|
6669
6669
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6670
|
-
const newTableData =
|
|
6670
|
+
const newTableData = chunkT7BAPZBY_js.deleteTableRow(td, rowIdx);
|
|
6671
6671
|
if (newTableData === td) {
|
|
6672
6672
|
return;
|
|
6673
6673
|
}
|
|
6674
6674
|
const updates = { tableData: newTableData };
|
|
6675
|
-
const newRawXml =
|
|
6675
|
+
const newRawXml = chunkT7BAPZBY_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6676
6676
|
if (newRawXml) {
|
|
6677
6677
|
updates.rawXml = newRawXml;
|
|
6678
6678
|
}
|
|
@@ -6684,9 +6684,9 @@ function createTableStructHandlers(input) {
|
|
|
6684
6684
|
return;
|
|
6685
6685
|
}
|
|
6686
6686
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6687
|
-
const newTableData =
|
|
6687
|
+
const newTableData = chunkT7BAPZBY_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6688
6688
|
const updates = { tableData: newTableData };
|
|
6689
|
-
const newRawXml =
|
|
6689
|
+
const newRawXml = chunkT7BAPZBY_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6690
6690
|
if (newRawXml) {
|
|
6691
6691
|
updates.rawXml = newRawXml;
|
|
6692
6692
|
}
|
|
@@ -6699,12 +6699,12 @@ function createTableStructHandlers(input) {
|
|
|
6699
6699
|
}
|
|
6700
6700
|
const td = selectedElement.tableData;
|
|
6701
6701
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6702
|
-
const newTableData =
|
|
6702
|
+
const newTableData = chunkT7BAPZBY_js.deleteTableColumn(td, colIdx);
|
|
6703
6703
|
if (newTableData === td) {
|
|
6704
6704
|
return;
|
|
6705
6705
|
}
|
|
6706
6706
|
const updates = { tableData: newTableData };
|
|
6707
|
-
const newRawXml =
|
|
6707
|
+
const newRawXml = chunkT7BAPZBY_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6708
6708
|
if (newRawXml) {
|
|
6709
6709
|
updates.rawXml = newRawXml;
|
|
6710
6710
|
}
|
|
@@ -6740,8 +6740,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6740
6740
|
return html2canvasPro(element, {
|
|
6741
6741
|
...options,
|
|
6742
6742
|
onclone: async (doc, clonedEl) => {
|
|
6743
|
-
await
|
|
6744
|
-
|
|
6743
|
+
await chunkT7BAPZBY_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6744
|
+
chunkT7BAPZBY_js.preprocessCssForCapture(clonedEl);
|
|
6745
6745
|
if (typeof userOnClone === "function") {
|
|
6746
6746
|
userOnClone(doc, clonedEl);
|
|
6747
6747
|
}
|
|
@@ -6797,7 +6797,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6797
6797
|
}
|
|
6798
6798
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6799
6799
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6800
|
-
|
|
6800
|
+
chunkT7BAPZBY_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6801
6801
|
}
|
|
6802
6802
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6803
6803
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6819,15 +6819,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6819
6819
|
continue;
|
|
6820
6820
|
}
|
|
6821
6821
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6822
|
-
images.push(
|
|
6822
|
+
images.push(chunkT7BAPZBY_js.canvasToJpegData(canvas));
|
|
6823
6823
|
}
|
|
6824
6824
|
onProgress?.(totalSlides, totalSlides);
|
|
6825
6825
|
setActiveSlide(currentSlideIndex);
|
|
6826
6826
|
if (images.length === 0) {
|
|
6827
|
-
throw new Error(
|
|
6827
|
+
throw new Error(chunkPIUB7R2K_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6828
6828
|
}
|
|
6829
|
-
const pdfBlobUrl =
|
|
6830
|
-
|
|
6829
|
+
const pdfBlobUrl = chunk7JZLE56X_js.buildPdfFromImageData(images);
|
|
6830
|
+
chunkT7BAPZBY_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6831
6831
|
}
|
|
6832
6832
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6833
6833
|
const { scale = 2, onProgress } = options;
|
|
@@ -6873,10 +6873,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6873
6873
|
onProgress?.(totalSlides, totalSlides);
|
|
6874
6874
|
setActiveSlide(currentSlideIndex);
|
|
6875
6875
|
if (pages.length === 0) {
|
|
6876
|
-
throw new Error(
|
|
6876
|
+
throw new Error(chunkPIUB7R2K_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6877
6877
|
}
|
|
6878
|
-
const pdfDataUrl =
|
|
6879
|
-
|
|
6878
|
+
const pdfDataUrl = chunk7JZLE56X_js.buildNotesPdf(pages);
|
|
6879
|
+
chunkT7BAPZBY_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6880
6880
|
}
|
|
6881
6881
|
|
|
6882
6882
|
// src/viewer/utils/export-video.ts
|
|
@@ -6907,7 +6907,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6907
6907
|
}
|
|
6908
6908
|
setActiveSlide(currentSlideIndex);
|
|
6909
6909
|
if (slideCanvases.length === 0) {
|
|
6910
|
-
throw new Error(
|
|
6910
|
+
throw new Error(chunkPIUB7R2K_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
6911
6911
|
}
|
|
6912
6912
|
const firstCanvas = slideCanvases[0];
|
|
6913
6913
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -6915,12 +6915,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6915
6915
|
recordingCanvas.height = firstCanvas.height;
|
|
6916
6916
|
const ctx = recordingCanvas.getContext("2d");
|
|
6917
6917
|
if (!ctx) {
|
|
6918
|
-
throw new Error(
|
|
6918
|
+
throw new Error(chunkPIUB7R2K_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
6919
6919
|
}
|
|
6920
6920
|
const fps = 30;
|
|
6921
6921
|
const stream = recordingCanvas.captureStream(fps);
|
|
6922
6922
|
const recorder = new MediaRecorder(stream, {
|
|
6923
|
-
mimeType:
|
|
6923
|
+
mimeType: chunkT7BAPZBY_js.pickSupportedMimeType([...chunkT7BAPZBY_js.WEBM_MIME_CANDIDATES]),
|
|
6924
6924
|
videoBitsPerSecond: 5e6
|
|
6925
6925
|
});
|
|
6926
6926
|
const chunks = [];
|
|
@@ -6943,8 +6943,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6943
6943
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6944
6944
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6945
6945
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6946
|
-
const frameInterval =
|
|
6947
|
-
const framesNeeded =
|
|
6946
|
+
const frameInterval = chunkT7BAPZBY_js.fpsToFrameIntervalMs(fps);
|
|
6947
|
+
const framesNeeded = chunkT7BAPZBY_js.segmentFrameCount(duration, fps);
|
|
6948
6948
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6949
6949
|
if (signal?.aborted) {
|
|
6950
6950
|
recorder.stop();
|
|
@@ -6991,9 +6991,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6991
6991
|
}
|
|
6992
6992
|
setActiveSlide(currentSlideIndex);
|
|
6993
6993
|
if (frames.length === 0) {
|
|
6994
|
-
throw new Error(
|
|
6994
|
+
throw new Error(chunkPIUB7R2K_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6995
6995
|
}
|
|
6996
|
-
const gifBytes =
|
|
6996
|
+
const gifBytes = chunkT7BAPZBY_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6997
6997
|
onProgress?.(totalSlides, totalSlides);
|
|
6998
6998
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6999
6999
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -7047,7 +7047,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7047
7047
|
continue;
|
|
7048
7048
|
}
|
|
7049
7049
|
onProgress?.(processedCount, data.slides.length);
|
|
7050
|
-
let svg =
|
|
7050
|
+
let svg = chunkT7BAPZBY_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7051
7051
|
if (embedFonts && fontFaces?.length) {
|
|
7052
7052
|
svg = injectFontFaces(svg, fontFaces);
|
|
7053
7053
|
}
|
|
@@ -7105,13 +7105,13 @@ function useExportSaveAs(input) {
|
|
|
7105
7105
|
setExportProgress(10);
|
|
7106
7106
|
setExportStatusMessage("Adding presentation...");
|
|
7107
7107
|
const pptxData = await serializeSlides();
|
|
7108
|
-
const pptxFilename =
|
|
7108
|
+
const pptxFilename = chunkT7BAPZBY_js.savedPresentationFileName(filePath);
|
|
7109
7109
|
if (pptxData) {
|
|
7110
7110
|
pkgFolder.file(pptxFilename, pptxData);
|
|
7111
7111
|
}
|
|
7112
7112
|
setExportProgress(70);
|
|
7113
7113
|
setExportStatusMessage("Writing README...");
|
|
7114
|
-
const readme =
|
|
7114
|
+
const readme = chunkT7BAPZBY_js.generatePackageReadme(pptxFilename);
|
|
7115
7115
|
pkgFolder.file("README.txt", readme);
|
|
7116
7116
|
if (abortCtrl.signal.aborted) {
|
|
7117
7117
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -7121,7 +7121,7 @@ function useExportSaveAs(input) {
|
|
|
7121
7121
|
const zipBlob = await zip.generateAsync({ type: "blob" });
|
|
7122
7122
|
setExportProgress(95);
|
|
7123
7123
|
setExportStatusMessage("Downloading...");
|
|
7124
|
-
|
|
7124
|
+
chunkT7BAPZBY_js.downloadBlob(zipBlob, `${chunkT7BAPZBY_js.presentationBaseName(pptxFilename)}-package.zip`);
|
|
7125
7125
|
setExportProgress(100);
|
|
7126
7126
|
} catch (err) {
|
|
7127
7127
|
if (err.name !== "AbortError") {
|
|
@@ -7137,13 +7137,13 @@ function useExportSaveAs(input) {
|
|
|
7137
7137
|
if (!handler) {
|
|
7138
7138
|
return;
|
|
7139
7139
|
}
|
|
7140
|
-
const downloadName =
|
|
7140
|
+
const downloadName = chunkT7BAPZBY_js.savedPresentationFileName(filePath, format);
|
|
7141
7141
|
try {
|
|
7142
7142
|
const data = await buildSaveAsData(handler, format);
|
|
7143
7143
|
const blob = new Blob([data], {
|
|
7144
7144
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
7145
7145
|
});
|
|
7146
|
-
|
|
7146
|
+
chunkT7BAPZBY_js.downloadBlob(blob, downloadName);
|
|
7147
7147
|
} catch (err) {
|
|
7148
7148
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
7149
7149
|
}
|
|
@@ -7156,18 +7156,18 @@ function useExportSaveAs(input) {
|
|
|
7156
7156
|
const pptxGuides = guides.map((g) => ({
|
|
7157
7157
|
id: g.id,
|
|
7158
7158
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7159
|
-
positionEmu:
|
|
7159
|
+
positionEmu: chunkT7BAPZBY_js.guidePxToEmu(g.position)
|
|
7160
7160
|
}));
|
|
7161
7161
|
return {
|
|
7162
7162
|
...slide,
|
|
7163
7163
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7164
7164
|
};
|
|
7165
7165
|
});
|
|
7166
|
-
const slidesToSave =
|
|
7166
|
+
const slidesToSave = chunkT7BAPZBY_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7167
7167
|
const saveOptions = {
|
|
7168
7168
|
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
7169
7169
|
// a preset picked in the inspector reached one save path and not the other.
|
|
7170
|
-
slideSize:
|
|
7170
|
+
slideSize: chunkT7BAPZBY_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
7171
7171
|
headerFooter,
|
|
7172
7172
|
presentationProperties,
|
|
7173
7173
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -7181,13 +7181,13 @@ function useExportSaveAs(input) {
|
|
|
7181
7181
|
handoutMaster,
|
|
7182
7182
|
outputFormat: format
|
|
7183
7183
|
};
|
|
7184
|
-
return
|
|
7184
|
+
return chunkT7BAPZBY_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
7185
7185
|
};
|
|
7186
7186
|
const handleExportJson = () => {
|
|
7187
7187
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7188
|
-
const slideSize =
|
|
7188
|
+
const slideSize = chunkT7BAPZBY_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7189
7189
|
const data = {
|
|
7190
|
-
slides:
|
|
7190
|
+
slides: chunkT7BAPZBY_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7191
7191
|
width: canvasSize.width,
|
|
7192
7192
|
height: canvasSize.height,
|
|
7193
7193
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7206,7 +7206,7 @@ function useExportSaveAs(input) {
|
|
|
7206
7206
|
handoutMaster
|
|
7207
7207
|
};
|
|
7208
7208
|
try {
|
|
7209
|
-
|
|
7209
|
+
chunkT7BAPZBY_js.exportDeckJson(data, sourceName);
|
|
7210
7210
|
} catch (err) {
|
|
7211
7211
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7212
7212
|
}
|
|
@@ -7353,21 +7353,21 @@ function useExportHandlers(input) {
|
|
|
7353
7353
|
{
|
|
7354
7354
|
scale: 2,
|
|
7355
7355
|
onProgress: (current, total) => {
|
|
7356
|
-
setExportProgress(
|
|
7357
|
-
setExportStatusMessage(
|
|
7356
|
+
setExportProgress(chunkT7BAPZBY_js.slideProgressPercent(current, total));
|
|
7357
|
+
setExportStatusMessage(chunkT7BAPZBY_js.slideStatusLabel("Rendering", current, total));
|
|
7358
7358
|
},
|
|
7359
7359
|
signal: abortCtrl.signal
|
|
7360
7360
|
}
|
|
7361
7361
|
);
|
|
7362
|
-
setExportProgress(
|
|
7362
|
+
setExportProgress(chunkT7BAPZBY_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7363
7363
|
setExportStatusMessage("Building PDF...");
|
|
7364
7364
|
await new Promise((r) => {
|
|
7365
7365
|
setTimeout(r, 100);
|
|
7366
7366
|
});
|
|
7367
|
-
setExportProgress(
|
|
7367
|
+
setExportProgress(chunkT7BAPZBY_js.EXPORT_DONE_PERCENT);
|
|
7368
7368
|
setExportStatusMessage("Done!");
|
|
7369
7369
|
} catch (err) {
|
|
7370
|
-
if (!
|
|
7370
|
+
if (!chunkT7BAPZBY_js.isExportAbortError(err)) {
|
|
7371
7371
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7372
7372
|
}
|
|
7373
7373
|
} finally {
|
|
@@ -7397,21 +7397,21 @@ function useExportHandlers(input) {
|
|
|
7397
7397
|
{
|
|
7398
7398
|
scale: 2,
|
|
7399
7399
|
onProgress: (current, total) => {
|
|
7400
|
-
setExportProgress(
|
|
7401
|
-
setExportStatusMessage(
|
|
7400
|
+
setExportProgress(chunkT7BAPZBY_js.slideProgressPercent(current, total));
|
|
7401
|
+
setExportStatusMessage(chunkT7BAPZBY_js.slideStatusLabel("Rendering", current, total));
|
|
7402
7402
|
},
|
|
7403
7403
|
signal: abortCtrl.signal
|
|
7404
7404
|
}
|
|
7405
7405
|
);
|
|
7406
|
-
setExportProgress(
|
|
7406
|
+
setExportProgress(chunkT7BAPZBY_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7407
7407
|
setExportStatusMessage("Building PDF...");
|
|
7408
7408
|
await new Promise((r) => {
|
|
7409
7409
|
setTimeout(r, 100);
|
|
7410
7410
|
});
|
|
7411
|
-
setExportProgress(
|
|
7411
|
+
setExportProgress(chunkT7BAPZBY_js.EXPORT_DONE_PERCENT);
|
|
7412
7412
|
setExportStatusMessage("Done!");
|
|
7413
7413
|
} catch (err) {
|
|
7414
|
-
if (!
|
|
7414
|
+
if (!chunkT7BAPZBY_js.isExportAbortError(err)) {
|
|
7415
7415
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7416
7416
|
}
|
|
7417
7417
|
} finally {
|
|
@@ -7452,22 +7452,22 @@ function useExportHandlers(input) {
|
|
|
7452
7452
|
scale: 1,
|
|
7453
7453
|
slideDurationMs: 3e3,
|
|
7454
7454
|
onProgress: (current, total) => {
|
|
7455
|
-
setExportProgress(
|
|
7456
|
-
setExportStatusMessage(
|
|
7455
|
+
setExportProgress(chunkT7BAPZBY_js.slideProgressPercent(current, total, 45));
|
|
7456
|
+
setExportStatusMessage(chunkT7BAPZBY_js.slideStatusLabel("Capturing", current, total));
|
|
7457
7457
|
},
|
|
7458
7458
|
onRecordProgress: (current, total) => {
|
|
7459
|
-
setExportProgress(
|
|
7460
|
-
setExportStatusMessage(
|
|
7459
|
+
setExportProgress(chunkT7BAPZBY_js.recordProgressPercent(current, total));
|
|
7460
|
+
setExportStatusMessage(chunkT7BAPZBY_js.slideStatusLabel("Recording", current, total));
|
|
7461
7461
|
},
|
|
7462
7462
|
signal: abortCtrl.signal
|
|
7463
7463
|
}
|
|
7464
7464
|
);
|
|
7465
|
-
setExportProgress(
|
|
7465
|
+
setExportProgress(chunkT7BAPZBY_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7466
7466
|
setExportStatusMessage("Saving file...");
|
|
7467
|
-
|
|
7468
|
-
setExportProgress(
|
|
7467
|
+
chunkT7BAPZBY_js.downloadBlob(blob, "presentation.webm");
|
|
7468
|
+
setExportProgress(chunkT7BAPZBY_js.EXPORT_DONE_PERCENT);
|
|
7469
7469
|
} catch (err) {
|
|
7470
|
-
if (!
|
|
7470
|
+
if (!chunkT7BAPZBY_js.isExportAbortError(err)) {
|
|
7471
7471
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7472
7472
|
}
|
|
7473
7473
|
} finally {
|
|
@@ -7495,18 +7495,18 @@ function useExportHandlers(input) {
|
|
|
7495
7495
|
scale: 0.5,
|
|
7496
7496
|
slideDurationMs: 2e3,
|
|
7497
7497
|
onProgress: (current, total) => {
|
|
7498
|
-
setExportProgress(
|
|
7499
|
-
setExportStatusMessage(
|
|
7498
|
+
setExportProgress(chunkT7BAPZBY_js.slideProgressPercent(current, total));
|
|
7499
|
+
setExportStatusMessage(chunkT7BAPZBY_js.slideStatusLabel("Encoding", current, total));
|
|
7500
7500
|
},
|
|
7501
7501
|
signal: abortCtrl.signal
|
|
7502
7502
|
}
|
|
7503
7503
|
);
|
|
7504
|
-
setExportProgress(
|
|
7504
|
+
setExportProgress(chunkT7BAPZBY_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7505
7505
|
setExportStatusMessage("Saving file...");
|
|
7506
|
-
|
|
7507
|
-
setExportProgress(
|
|
7506
|
+
chunkT7BAPZBY_js.downloadBlob(blob, "presentation.gif");
|
|
7507
|
+
setExportProgress(chunkT7BAPZBY_js.EXPORT_DONE_PERCENT);
|
|
7508
7508
|
} catch (err) {
|
|
7509
|
-
if (!
|
|
7509
|
+
if (!chunkT7BAPZBY_js.isExportAbortError(err)) {
|
|
7510
7510
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7511
7511
|
}
|
|
7512
7512
|
} finally {
|
|
@@ -7547,7 +7547,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7547
7547
|
}
|
|
7548
7548
|
printWindow.document.open();
|
|
7549
7549
|
printWindow.document.write(
|
|
7550
|
-
|
|
7550
|
+
chunkT7BAPZBY_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7551
7551
|
);
|
|
7552
7552
|
printWindow.document.close();
|
|
7553
7553
|
printWindow.focus();
|
|
@@ -7581,8 +7581,8 @@ function usePrintHandlers(input) {
|
|
|
7581
7581
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7582
7582
|
return handlePrintWithSettings(settings);
|
|
7583
7583
|
}
|
|
7584
|
-
const colorFilter =
|
|
7585
|
-
const slideIndices =
|
|
7584
|
+
const colorFilter = chunkT7BAPZBY_js.computeColorFilter(settings.colorMode);
|
|
7585
|
+
const slideIndices = chunkT7BAPZBY_js.computeSlideIndices(
|
|
7586
7586
|
settings.slideRange,
|
|
7587
7587
|
activeSlideIndex,
|
|
7588
7588
|
slides.length,
|
|
@@ -7596,7 +7596,7 @@ function usePrintHandlers(input) {
|
|
|
7596
7596
|
if (svgs.length === 0) {
|
|
7597
7597
|
return;
|
|
7598
7598
|
}
|
|
7599
|
-
const printDoc =
|
|
7599
|
+
const printDoc = chunkT7BAPZBY_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7600
7600
|
title: "Slides (Vector)",
|
|
7601
7601
|
orientation: settings.orientation,
|
|
7602
7602
|
colorFilter
|
|
@@ -7609,8 +7609,8 @@ function usePrintHandlers(input) {
|
|
|
7609
7609
|
};
|
|
7610
7610
|
const handlePrintWithSettings = async (settings) => {
|
|
7611
7611
|
setIsPrintDialogOpen(false);
|
|
7612
|
-
const colorFilter =
|
|
7613
|
-
const slideIndices =
|
|
7612
|
+
const colorFilter = chunkT7BAPZBY_js.computeColorFilter(settings.colorMode);
|
|
7613
|
+
const slideIndices = chunkT7BAPZBY_js.computeSlideIndices(
|
|
7614
7614
|
settings.slideRange,
|
|
7615
7615
|
activeSlideIndex,
|
|
7616
7616
|
slides.length,
|
|
@@ -7620,7 +7620,7 @@ function usePrintHandlers(input) {
|
|
|
7620
7620
|
if (settings.printWhat === "outline") {
|
|
7621
7621
|
openPrintWindow(
|
|
7622
7622
|
"Outline",
|
|
7623
|
-
`<div class="outline-page">${
|
|
7623
|
+
`<div class="outline-page">${chunkT7BAPZBY_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7624
7624
|
settings.orientation,
|
|
7625
7625
|
colorFilter,
|
|
7626
7626
|
settings.frameSlides
|
|
@@ -7645,7 +7645,7 @@ function usePrintHandlers(input) {
|
|
|
7645
7645
|
if (settings.printWhat === "slides") {
|
|
7646
7646
|
openPrintWindow(
|
|
7647
7647
|
"Slides",
|
|
7648
|
-
|
|
7648
|
+
chunkT7BAPZBY_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7649
7649
|
settings.orientation,
|
|
7650
7650
|
colorFilter,
|
|
7651
7651
|
settings.frameSlides
|
|
@@ -7655,7 +7655,7 @@ function usePrintHandlers(input) {
|
|
|
7655
7655
|
if (settings.printWhat === "notes") {
|
|
7656
7656
|
openPrintWindow(
|
|
7657
7657
|
"Notes Pages",
|
|
7658
|
-
|
|
7658
|
+
chunkT7BAPZBY_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7659
7659
|
"portrait",
|
|
7660
7660
|
colorFilter,
|
|
7661
7661
|
settings.frameSlides
|
|
@@ -7666,7 +7666,7 @@ function usePrintHandlers(input) {
|
|
|
7666
7666
|
const spp = settings.slidesPerPage;
|
|
7667
7667
|
openPrintWindow(
|
|
7668
7668
|
`Handout ${spp} per page`,
|
|
7669
|
-
|
|
7669
|
+
chunkT7BAPZBY_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7670
7670
|
"portrait",
|
|
7671
7671
|
colorFilter,
|
|
7672
7672
|
settings.frameSlides
|
|
@@ -7730,8 +7730,8 @@ function useThemeHandlers(input) {
|
|
|
7730
7730
|
return;
|
|
7731
7731
|
}
|
|
7732
7732
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7733
|
-
const previousMap = theme?.colorScheme ?
|
|
7734
|
-
setSlides((prev) =>
|
|
7733
|
+
const previousMap = theme?.colorScheme ? chunkT7BAPZBY_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7734
|
+
setSlides((prev) => chunkT7BAPZBY_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7735
7735
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7736
7736
|
bumpHistory();
|
|
7737
7737
|
history.markDirty();
|
|
@@ -7836,7 +7836,7 @@ function useThemeSwitching(input) {
|
|
|
7836
7836
|
}
|
|
7837
7837
|
try {
|
|
7838
7838
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7839
|
-
const newData =
|
|
7839
|
+
const newData = chunkT7BAPZBY_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7840
7840
|
onDataChange(newData);
|
|
7841
7841
|
onThemeChanged?.(preset);
|
|
7842
7842
|
} catch (error) {
|
|
@@ -7853,7 +7853,7 @@ function useThemeSwitching(input) {
|
|
|
7853
7853
|
}
|
|
7854
7854
|
try {
|
|
7855
7855
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7856
|
-
const newData =
|
|
7856
|
+
const newData = chunkT7BAPZBY_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7857
7857
|
onDataChange(newData);
|
|
7858
7858
|
} catch (error) {
|
|
7859
7859
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7865,12 +7865,12 @@ function useThemeSwitching(input) {
|
|
|
7865
7865
|
if (!data?.theme?.colorScheme) {
|
|
7866
7866
|
return void 0;
|
|
7867
7867
|
}
|
|
7868
|
-
return
|
|
7869
|
-
(p) =>
|
|
7868
|
+
return chunkT7BAPZBY_js.THEME_PRESETS.find(
|
|
7869
|
+
(p) => chunkT7BAPZBY_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7870
7870
|
);
|
|
7871
7871
|
}, [data?.theme?.colorScheme]);
|
|
7872
7872
|
return {
|
|
7873
|
-
presets:
|
|
7873
|
+
presets: chunkT7BAPZBY_js.THEME_PRESETS,
|
|
7874
7874
|
switchToPreset,
|
|
7875
7875
|
switchToCustom,
|
|
7876
7876
|
currentPreset
|
|
@@ -7945,7 +7945,7 @@ function usePropertyHandlers(input) {
|
|
|
7945
7945
|
}
|
|
7946
7946
|
try {
|
|
7947
7947
|
const ab = await file.arrayBuffer();
|
|
7948
|
-
const h = new
|
|
7948
|
+
const h = new chunkT7BAPZBY_js.PptxHandler();
|
|
7949
7949
|
const other = await h.load(ab);
|
|
7950
7950
|
if (!other) {
|
|
7951
7951
|
return;
|
|
@@ -7955,7 +7955,7 @@ function usePropertyHandlers(input) {
|
|
|
7955
7955
|
width: canvasSize.width,
|
|
7956
7956
|
height: canvasSize.height
|
|
7957
7957
|
};
|
|
7958
|
-
setCompareResult(
|
|
7958
|
+
setCompareResult(chunkT7BAPZBY_js.comparePresentation(cur, other));
|
|
7959
7959
|
setIsComparePanelOpen(true);
|
|
7960
7960
|
} catch (err) {
|
|
7961
7961
|
console.warn("Compare failed:", err);
|
|
@@ -7972,7 +7972,7 @@ function usePropertyHandlers(input) {
|
|
|
7972
7972
|
if (!diff || diff.status === "unchanged") {
|
|
7973
7973
|
return;
|
|
7974
7974
|
}
|
|
7975
|
-
setSlides((prev) =>
|
|
7975
|
+
setSlides((prev) => chunkT7BAPZBY_js.applyAcceptSlide(prev, diff));
|
|
7976
7976
|
setIsDirty(true);
|
|
7977
7977
|
},
|
|
7978
7978
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7983,10 +7983,10 @@ function usePropertyHandlers(input) {
|
|
|
7983
7983
|
if (!compareResult) {
|
|
7984
7984
|
return;
|
|
7985
7985
|
}
|
|
7986
|
-
setSlides((prev) =>
|
|
7986
|
+
setSlides((prev) => chunkT7BAPZBY_js.applyAcceptAllSlides(prev, compareResult));
|
|
7987
7987
|
setIsDirty(true);
|
|
7988
7988
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7989
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7989
|
+
const usedFontFamilies = react.useMemo(() => chunkT7BAPZBY_js.collectUsedFonts(slides), [slides]);
|
|
7990
7990
|
return {
|
|
7991
7991
|
handleUpdateNotes,
|
|
7992
7992
|
handleUpdateSlide,
|
|
@@ -8141,7 +8141,7 @@ function useViewerDialogs(input) {
|
|
|
8141
8141
|
);
|
|
8142
8142
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8143
8143
|
const fontEmbedding = react.useMemo(
|
|
8144
|
-
() =>
|
|
8144
|
+
() => chunkT7BAPZBY_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8145
8145
|
[embeddedFontKey]
|
|
8146
8146
|
);
|
|
8147
8147
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8151,11 +8151,11 @@ function useViewerDialogs(input) {
|
|
|
8151
8151
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8152
8152
|
}
|
|
8153
8153
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8154
|
-
() => typeof window !== "undefined" ?
|
|
8154
|
+
() => typeof window !== "undefined" ? chunkT7BAPZBY_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8155
8155
|
);
|
|
8156
8156
|
react.useEffect(() => {
|
|
8157
8157
|
const handleWindow = () => setIsNarrowViewport(
|
|
8158
|
-
|
|
8158
|
+
chunkT7BAPZBY_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8159
8159
|
);
|
|
8160
8160
|
window.addEventListener("resize", handleWindow);
|
|
8161
8161
|
return () => window.removeEventListener("resize", handleWindow);
|
|
@@ -8308,15 +8308,15 @@ function useViewerDialogs(input) {
|
|
|
8308
8308
|
};
|
|
8309
8309
|
}
|
|
8310
8310
|
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8311
|
-
return
|
|
8311
|
+
return chunkT7BAPZBY_js.computeGridSpacingPx(documentGridSpacing, chunk7JZLE56X_js.GRID_SIZE);
|
|
8312
8312
|
}
|
|
8313
8313
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8314
8314
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8315
|
-
return
|
|
8315
|
+
return chunkT7BAPZBY_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8316
8316
|
}
|
|
8317
8317
|
function computeSlideSectionGroups(slides, sections) {
|
|
8318
|
-
return
|
|
8319
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8318
|
+
return chunkT7BAPZBY_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8319
|
+
id: group.section?.id ?? (sections.length > 0 ? chunk7JZLE56X_js.UNGROUPED_SECTION_ID : chunk7JZLE56X_js.DEFAULT_SECTION_GROUP_ID),
|
|
8320
8320
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8321
8321
|
slideIndexes: group.slideIndexes,
|
|
8322
8322
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8328,7 +8328,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8328
8328
|
return void 0;
|
|
8329
8329
|
}
|
|
8330
8330
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8331
|
-
return
|
|
8331
|
+
return chunkT7BAPZBY_js.masterViewPseudoSlide(document2, {
|
|
8332
8332
|
tab: "slides",
|
|
8333
8333
|
masterIndex: 0,
|
|
8334
8334
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8356,10 +8356,10 @@ function useDerivedSlideState(input) {
|
|
|
8356
8356
|
);
|
|
8357
8357
|
const slideSectionGroups = react.useMemo(
|
|
8358
8358
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8359
|
-
if (group.id ===
|
|
8359
|
+
if (group.id === chunk7JZLE56X_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8360
8360
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8361
8361
|
}
|
|
8362
|
-
if (group.id ===
|
|
8362
|
+
if (group.id === chunk7JZLE56X_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8363
8363
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8364
8364
|
}
|
|
8365
8365
|
return group;
|
|
@@ -8459,13 +8459,13 @@ function useAnnotationHandlers(input) {
|
|
|
8459
8459
|
}, [annotations, setMode, setSlides, history]);
|
|
8460
8460
|
const handleSetMode = react.useCallback(
|
|
8461
8461
|
(nextMode) => {
|
|
8462
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8462
|
+
if (mode === "present" && nextMode !== "present" && !chunkT7BAPZBY_js.mayLeaveSlideShow()) {
|
|
8463
8463
|
return;
|
|
8464
8464
|
}
|
|
8465
8465
|
if (nextMode === "present") {
|
|
8466
8466
|
presentation.enterPresentMode();
|
|
8467
8467
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8468
|
-
|
|
8468
|
+
chunkT7BAPZBY_js.stopAllPersistentAudio();
|
|
8469
8469
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8470
8470
|
if (promptKeepInkAnnotations) {
|
|
8471
8471
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8474,7 +8474,7 @@ function useAnnotationHandlers(input) {
|
|
|
8474
8474
|
}
|
|
8475
8475
|
} else {
|
|
8476
8476
|
if (mode === "present") {
|
|
8477
|
-
|
|
8477
|
+
chunkT7BAPZBY_js.stopAllPersistentAudio();
|
|
8478
8478
|
}
|
|
8479
8479
|
setMode(nextMode);
|
|
8480
8480
|
}
|
|
@@ -8545,13 +8545,13 @@ function useSerialize(input) {
|
|
|
8545
8545
|
let processedSlide = slide;
|
|
8546
8546
|
if (pendingEditId) {
|
|
8547
8547
|
const updatedElements = slide.elements.map((el) => {
|
|
8548
|
-
if (el.id !== pendingEditId || !
|
|
8548
|
+
if (el.id !== pendingEditId || !chunkT7BAPZBY_js.hasTextProperties(el)) {
|
|
8549
8549
|
return el;
|
|
8550
8550
|
}
|
|
8551
8551
|
return {
|
|
8552
8552
|
...el,
|
|
8553
8553
|
text: pendingEditText,
|
|
8554
|
-
textSegments:
|
|
8554
|
+
textSegments: chunkT7BAPZBY_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8555
8555
|
};
|
|
8556
8556
|
});
|
|
8557
8557
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8564,19 +8564,19 @@ function useSerialize(input) {
|
|
|
8564
8564
|
const pptxGuides = guides.map((g) => ({
|
|
8565
8565
|
id: g.id,
|
|
8566
8566
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8567
|
-
positionEmu:
|
|
8567
|
+
positionEmu: chunkT7BAPZBY_js.guidePxToEmu(g.position)
|
|
8568
8568
|
}));
|
|
8569
8569
|
return {
|
|
8570
8570
|
...processedSlide,
|
|
8571
8571
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8572
8572
|
};
|
|
8573
8573
|
});
|
|
8574
|
-
const slidesToSave =
|
|
8574
|
+
const slidesToSave = chunkT7BAPZBY_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8575
8575
|
const saveOptions = {
|
|
8576
8576
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8577
8577
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8578
8578
|
// slide-size edit reaches the file.
|
|
8579
|
-
slideSize:
|
|
8579
|
+
slideSize: chunkT7BAPZBY_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8580
8580
|
headerFooter,
|
|
8581
8581
|
presentationProperties,
|
|
8582
8582
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -8588,9 +8588,9 @@ function useSerialize(input) {
|
|
|
8588
8588
|
slideMasters,
|
|
8589
8589
|
notesMaster,
|
|
8590
8590
|
handoutMaster,
|
|
8591
|
-
...
|
|
8591
|
+
...chunkT7BAPZBY_js.embeddedFontSaveOptions(embedFonts)
|
|
8592
8592
|
};
|
|
8593
|
-
return
|
|
8593
|
+
return chunkT7BAPZBY_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8594
8594
|
}, [
|
|
8595
8595
|
slides,
|
|
8596
8596
|
templateElementsBySlideId,
|
|
@@ -8625,7 +8625,7 @@ function useRecoveryDetection(input) {
|
|
|
8625
8625
|
const onRestore = input.onRestore;
|
|
8626
8626
|
const openVersionHistory = input.openVersionHistory;
|
|
8627
8627
|
react.useEffect(() => {
|
|
8628
|
-
if (!
|
|
8628
|
+
if (!chunkT7BAPZBY_js.shouldProbeAutosaveRecovery({
|
|
8629
8629
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8630
8630
|
filePath,
|
|
8631
8631
|
loading,
|
|
@@ -8637,7 +8637,7 @@ function useRecoveryDetection(input) {
|
|
|
8637
8637
|
}
|
|
8638
8638
|
recoveryCheckedRef.current = true;
|
|
8639
8639
|
void (async () => {
|
|
8640
|
-
const offer = await
|
|
8640
|
+
const offer = await chunkT7BAPZBY_js.probeAutosaveRecovery(filePath);
|
|
8641
8641
|
if (!offer) {
|
|
8642
8642
|
return;
|
|
8643
8643
|
}
|
|
@@ -8650,7 +8650,7 @@ function useRecoveryDetection(input) {
|
|
|
8650
8650
|
const record = recordRef.current;
|
|
8651
8651
|
setPrompt(null);
|
|
8652
8652
|
if (record && onRestore) {
|
|
8653
|
-
onRestore(
|
|
8653
|
+
onRestore(chunkT7BAPZBY_js.acceptAutosaveRecovery(record));
|
|
8654
8654
|
}
|
|
8655
8655
|
recordRef.current = null;
|
|
8656
8656
|
}, [onRestore]);
|
|
@@ -8659,7 +8659,7 @@ function useRecoveryDetection(input) {
|
|
|
8659
8659
|
setPrompt(null);
|
|
8660
8660
|
recordRef.current = null;
|
|
8661
8661
|
if (record) {
|
|
8662
|
-
void
|
|
8662
|
+
void chunkT7BAPZBY_js.discardAutosaveRecovery(record);
|
|
8663
8663
|
}
|
|
8664
8664
|
}, []);
|
|
8665
8665
|
return { prompt, restore, discard };
|
|
@@ -8699,7 +8699,7 @@ function usePresentationSetup(input) {
|
|
|
8699
8699
|
containerRef,
|
|
8700
8700
|
content,
|
|
8701
8701
|
onSetMode: (nextMode) => {
|
|
8702
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8702
|
+
if (mode === "present" && nextMode !== "present" && !chunkT7BAPZBY_js.mayLeaveSlideShow()) {
|
|
8703
8703
|
return;
|
|
8704
8704
|
}
|
|
8705
8705
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8707,7 +8707,7 @@ function usePresentationSetup(input) {
|
|
|
8707
8707
|
setShowKeepAnnotationsDialog(true);
|
|
8708
8708
|
} else {
|
|
8709
8709
|
if (mode === "present" && nextMode !== "present") {
|
|
8710
|
-
|
|
8710
|
+
chunkT7BAPZBY_js.stopAllPersistentAudio();
|
|
8711
8711
|
stopAnimationSound();
|
|
8712
8712
|
}
|
|
8713
8713
|
setMode(nextMode);
|
|
@@ -8762,10 +8762,10 @@ function usePresentationSetup(input) {
|
|
|
8762
8762
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8763
8763
|
onToggleSubtitles,
|
|
8764
8764
|
onSaveRehearsalTimings: (timings) => {
|
|
8765
|
-
setSlides((prev) =>
|
|
8765
|
+
setSlides((prev) => chunkT7BAPZBY_js.applyRehearsalTimings(prev, timings));
|
|
8766
8766
|
history.markDirty();
|
|
8767
8767
|
},
|
|
8768
|
-
loopContinuously:
|
|
8768
|
+
loopContinuously: chunkT7BAPZBY_js.shouldLoopContinuously(presentationProperties),
|
|
8769
8769
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8770
8770
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8771
8771
|
endWithBlackSlide
|
|
@@ -8958,7 +8958,7 @@ function useEditorOperations(input) {
|
|
|
8958
8958
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
8959
8959
|
react.useEffect(() => {
|
|
8960
8960
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
8961
|
-
copiedFormatRef.current =
|
|
8961
|
+
copiedFormatRef.current = chunkT7BAPZBY_js.copyFormatFromElement(selectedElement);
|
|
8962
8962
|
} else if (!formatPainterActive) {
|
|
8963
8963
|
copiedFormatRef.current = null;
|
|
8964
8964
|
}
|
|
@@ -8984,12 +8984,12 @@ function useEditorOperations(input) {
|
|
|
8984
8984
|
e.stopPropagation();
|
|
8985
8985
|
const element = elementLookup.get(elementId);
|
|
8986
8986
|
if (element) {
|
|
8987
|
-
const updated =
|
|
8987
|
+
const updated = chunkT7BAPZBY_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
8988
8988
|
const updates = {};
|
|
8989
|
-
if (
|
|
8989
|
+
if (chunkT7BAPZBY_js.hasShapeProperties(updated)) {
|
|
8990
8990
|
updates.shapeStyle = updated.shapeStyle;
|
|
8991
8991
|
}
|
|
8992
|
-
if (
|
|
8992
|
+
if (chunkT7BAPZBY_js.hasTextProperties(updated)) {
|
|
8993
8993
|
updates.textStyle = updated.textStyle;
|
|
8994
8994
|
}
|
|
8995
8995
|
ops.updateElementById(elementId, updates);
|
|
@@ -9143,7 +9143,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9143
9143
|
const families = /* @__PURE__ */ new Set();
|
|
9144
9144
|
for (const slide of slides) {
|
|
9145
9145
|
for (const el of slide.elements) {
|
|
9146
|
-
if (
|
|
9146
|
+
if (chunkT7BAPZBY_js.hasTextProperties(el) && el.textSegments) {
|
|
9147
9147
|
for (const seg of el.textSegments) {
|
|
9148
9148
|
if (seg.style.fontFamily) {
|
|
9149
9149
|
families.add(seg.style.fontFamily);
|
|
@@ -9391,7 +9391,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9391
9391
|
inputRef.current = input;
|
|
9392
9392
|
const handleKeyDown = react.useCallback((e) => {
|
|
9393
9393
|
const current = inputRef.current;
|
|
9394
|
-
const { action, dx, dy } =
|
|
9394
|
+
const { action, dx, dy } = chunkT7BAPZBY_js.mapEditorKey(e, {
|
|
9395
9395
|
canEdit: current.canEdit,
|
|
9396
9396
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9397
9397
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9404,7 +9404,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9404
9404
|
hasSelection: current.hasSelection,
|
|
9405
9405
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9406
9406
|
isDrawing: current.activeTool !== "select",
|
|
9407
|
-
isTextInputTarget:
|
|
9407
|
+
isTextInputTarget: chunkT7BAPZBY_js.isEditorTextInputTarget(e.target)
|
|
9408
9408
|
});
|
|
9409
9409
|
if (action === null) {
|
|
9410
9410
|
return;
|
|
@@ -9710,7 +9710,7 @@ function useViewerIntegration(input) {
|
|
|
9710
9710
|
return zoom.scale;
|
|
9711
9711
|
},
|
|
9712
9712
|
setZoom(level) {
|
|
9713
|
-
zoom.setScale(
|
|
9713
|
+
zoom.setScale(chunkT7BAPZBY_js.clampZoomScale(level));
|
|
9714
9714
|
},
|
|
9715
9715
|
zoomIn() {
|
|
9716
9716
|
zoom.handleZoomIn();
|
|
@@ -9926,7 +9926,7 @@ function useReducedMotion() {
|
|
|
9926
9926
|
}
|
|
9927
9927
|
function useViewerOptions() {
|
|
9928
9928
|
const storeRef = react.useRef(null);
|
|
9929
|
-
storeRef.current ??=
|
|
9929
|
+
storeRef.current ??= chunkT7BAPZBY_js.createViewerOptionsStore();
|
|
9930
9930
|
const store = storeRef.current;
|
|
9931
9931
|
const options = react.useSyncExternalStore(
|
|
9932
9932
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9935,9 +9935,9 @@ function useViewerOptions() {
|
|
|
9935
9935
|
);
|
|
9936
9936
|
return { optionsStore: store, options };
|
|
9937
9937
|
}
|
|
9938
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9938
|
+
var KNOWN_TAB_IDS = new Set(chunkT7BAPZBY_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9939
9939
|
function computeToolbarVisibility(hiddenActions) {
|
|
9940
|
-
const isHidden = (id) =>
|
|
9940
|
+
const isHidden = (id) => chunkT7BAPZBY_js.isActionHidden(id, hiddenActions);
|
|
9941
9941
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
9942
9942
|
return { isHidden, isTabVisible };
|
|
9943
9943
|
}
|
|
@@ -10023,12 +10023,12 @@ function useYjsDocumentSync({
|
|
|
10023
10023
|
return;
|
|
10024
10024
|
}
|
|
10025
10025
|
try {
|
|
10026
|
-
const handler = new
|
|
10026
|
+
const handler = new chunkT7BAPZBY_js.PptxHandler();
|
|
10027
10027
|
await handler.load(sourceBytes.buffer);
|
|
10028
|
-
const currentSlides =
|
|
10028
|
+
const currentSlides = chunkT7BAPZBY_js.readSlidesFromYDoc(
|
|
10029
10029
|
doc
|
|
10030
10030
|
);
|
|
10031
|
-
const slidesToSave =
|
|
10031
|
+
const slidesToSave = chunkT7BAPZBY_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10032
10032
|
const bytes = await handler.save(slidesToSave);
|
|
10033
10033
|
config.onWriteBack(bytes);
|
|
10034
10034
|
} catch {
|
|
@@ -10043,10 +10043,10 @@ function useYjsDocumentSync({
|
|
|
10043
10043
|
if (!doc || !isConnected) {
|
|
10044
10044
|
return;
|
|
10045
10045
|
}
|
|
10046
|
-
const docSlides =
|
|
10046
|
+
const docSlides = chunkT7BAPZBY_js.readSlidesFromYDoc(
|
|
10047
10047
|
doc
|
|
10048
10048
|
);
|
|
10049
|
-
if (!
|
|
10049
|
+
if (!chunkT7BAPZBY_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10050
10050
|
return;
|
|
10051
10051
|
}
|
|
10052
10052
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10065,11 +10065,11 @@ function useYjsDocumentSync({
|
|
|
10065
10065
|
lastSyncedRef.current = serialized;
|
|
10066
10066
|
void (async () => {
|
|
10067
10067
|
const factories = await getFactories();
|
|
10068
|
-
|
|
10068
|
+
chunkT7BAPZBY_js.reconcileSlidesInYDoc(
|
|
10069
10069
|
slides,
|
|
10070
10070
|
doc,
|
|
10071
10071
|
factories,
|
|
10072
|
-
|
|
10072
|
+
chunkT7BAPZBY_js.LOCAL_SYNC_ORIGIN
|
|
10073
10073
|
);
|
|
10074
10074
|
scheduleWriteBack();
|
|
10075
10075
|
})();
|
|
@@ -10083,10 +10083,10 @@ function useYjsDocumentSync({
|
|
|
10083
10083
|
return;
|
|
10084
10084
|
}
|
|
10085
10085
|
const handleChange = (_events, transaction) => {
|
|
10086
|
-
if (transaction?.origin ===
|
|
10086
|
+
if (transaction?.origin === chunkT7BAPZBY_js.LOCAL_SYNC_ORIGIN) {
|
|
10087
10087
|
return;
|
|
10088
10088
|
}
|
|
10089
|
-
const remoteSlides =
|
|
10089
|
+
const remoteSlides = chunkT7BAPZBY_js.readSlidesFromYDoc(
|
|
10090
10090
|
doc
|
|
10091
10091
|
);
|
|
10092
10092
|
if (remoteSlides.length === 0) {
|
|
@@ -10102,7 +10102,7 @@ function useYjsDocumentSync({
|
|
|
10102
10102
|
isApplyingRemoteRef.current = false;
|
|
10103
10103
|
scheduleWriteBack();
|
|
10104
10104
|
};
|
|
10105
|
-
const unobserve =
|
|
10105
|
+
const unobserve = chunkT7BAPZBY_js.observeYDocSlides(
|
|
10106
10106
|
doc,
|
|
10107
10107
|
handleChange
|
|
10108
10108
|
);
|
|
@@ -10140,7 +10140,7 @@ function useBroadcastFollower({
|
|
|
10140
10140
|
if (!broadcaster) {
|
|
10141
10141
|
return;
|
|
10142
10142
|
}
|
|
10143
|
-
if (!
|
|
10143
|
+
if (!chunkT7BAPZBY_js.shouldAutoFollowBroadcaster({
|
|
10144
10144
|
localRole: collab.config.role,
|
|
10145
10145
|
broadcasterRole: broadcaster.role
|
|
10146
10146
|
})) {
|
|
@@ -10311,7 +10311,7 @@ function subscribeTouchCapability(callback) {
|
|
|
10311
10311
|
function useIsMobile() {
|
|
10312
10312
|
const isTouchDevice = react.useSyncExternalStore(
|
|
10313
10313
|
subscribeTouchCapability,
|
|
10314
|
-
|
|
10314
|
+
chunkT7BAPZBY_js.detectTouchDevice,
|
|
10315
10315
|
() => false
|
|
10316
10316
|
// server snapshot
|
|
10317
10317
|
);
|
|
@@ -10321,7 +10321,7 @@ function useIsMobile() {
|
|
|
10321
10321
|
const [viewportHeight, setViewportHeight] = react.useState(
|
|
10322
10322
|
() => typeof window === "undefined" ? 768 : window.innerHeight
|
|
10323
10323
|
);
|
|
10324
|
-
const [orientation, setOrientation] = react.useState(
|
|
10324
|
+
const [orientation, setOrientation] = react.useState(chunkT7BAPZBY_js.detectOrientation);
|
|
10325
10325
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
10326
10326
|
const [initialViewportHeight] = react.useState(
|
|
10327
10327
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -10342,7 +10342,7 @@ function useIsMobile() {
|
|
|
10342
10342
|
return;
|
|
10343
10343
|
}
|
|
10344
10344
|
const handleOrientationChange = () => {
|
|
10345
|
-
setOrientation(
|
|
10345
|
+
setOrientation(chunkT7BAPZBY_js.detectOrientation());
|
|
10346
10346
|
};
|
|
10347
10347
|
if (screen.orientation) {
|
|
10348
10348
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -10372,7 +10372,7 @@ function useIsMobile() {
|
|
|
10372
10372
|
window.addEventListener("resize", handleResize);
|
|
10373
10373
|
return () => window.removeEventListener("resize", handleResize);
|
|
10374
10374
|
}, [isTouchDevice, initialViewportHeight]);
|
|
10375
|
-
const { isMobile, isTablet, isDesktop } =
|
|
10375
|
+
const { isMobile, isTablet, isDesktop } = chunkT7BAPZBY_js.deriveViewportBreakpoints(
|
|
10376
10376
|
viewportWidth,
|
|
10377
10377
|
viewportHeight,
|
|
10378
10378
|
isTouchDevice
|
|
@@ -10403,10 +10403,10 @@ function useTouchGestures(input) {
|
|
|
10403
10403
|
if (!el || !enabled) {
|
|
10404
10404
|
return;
|
|
10405
10405
|
}
|
|
10406
|
-
const recognizer =
|
|
10406
|
+
const recognizer = chunkT7BAPZBY_js.createTouchGestureRecognizer({
|
|
10407
10407
|
getScale: () => scaleRef.current,
|
|
10408
|
-
minScale:
|
|
10409
|
-
maxScale:
|
|
10408
|
+
minScale: chunkT7BAPZBY_js.MIN_ZOOM_SCALE,
|
|
10409
|
+
maxScale: chunkT7BAPZBY_js.MAX_ZOOM_SCALE,
|
|
10410
10410
|
callbacks: {
|
|
10411
10411
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10412
10412
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10446,7 +10446,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10446
10446
|
return;
|
|
10447
10447
|
}
|
|
10448
10448
|
const rect = active.getBoundingClientRect();
|
|
10449
|
-
const delta =
|
|
10449
|
+
const delta = chunkT7BAPZBY_js.computeScrollDelta(
|
|
10450
10450
|
{ top: rect.top, bottom: rect.bottom },
|
|
10451
10451
|
window.innerHeight,
|
|
10452
10452
|
keyboardInset
|
|
@@ -10466,8 +10466,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10466
10466
|
return;
|
|
10467
10467
|
}
|
|
10468
10468
|
const update = () => {
|
|
10469
|
-
const metrics =
|
|
10470
|
-
const inset = metrics ?
|
|
10469
|
+
const metrics = chunkT7BAPZBY_js.readViewportMetrics(window);
|
|
10470
|
+
const inset = metrics ? chunkT7BAPZBY_js.computeKeyboardInset(metrics) : 0;
|
|
10471
10471
|
setKeyboardInset(inset);
|
|
10472
10472
|
if (inset > 0) {
|
|
10473
10473
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10478,8 +10478,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10478
10478
|
vv.addEventListener("scroll", update);
|
|
10479
10479
|
const onFocusIn = () => {
|
|
10480
10480
|
window.requestAnimationFrame(() => {
|
|
10481
|
-
const metrics =
|
|
10482
|
-
const inset = metrics ?
|
|
10481
|
+
const metrics = chunkT7BAPZBY_js.readViewportMetrics(window);
|
|
10482
|
+
const inset = metrics ? chunkT7BAPZBY_js.computeKeyboardInset(metrics) : 0;
|
|
10483
10483
|
if (inset > 0) {
|
|
10484
10484
|
scrollFocusedIntoView(inset);
|
|
10485
10485
|
}
|
|
@@ -10492,7 +10492,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10492
10492
|
document.removeEventListener("focusin", onFocusIn);
|
|
10493
10493
|
};
|
|
10494
10494
|
}, [enabled]);
|
|
10495
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10495
|
+
return { keyboardInset, isKeyboardOpen: chunkT7BAPZBY_js.isKeyboardOpen(keyboardInset) };
|
|
10496
10496
|
}
|
|
10497
10497
|
|
|
10498
10498
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10519,7 +10519,7 @@ function buildCanvasProps(input) {
|
|
|
10519
10519
|
} = input;
|
|
10520
10520
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10521
10521
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10522
|
-
const fieldContext =
|
|
10522
|
+
const fieldContext = chunkT7BAPZBY_js.buildFieldSubstitutionContext({
|
|
10523
10523
|
headerFooter: s.headerFooter,
|
|
10524
10524
|
customProperties: s.customProperties,
|
|
10525
10525
|
slide: activeSlide
|
|
@@ -10529,13 +10529,13 @@ function buildCanvasProps(input) {
|
|
|
10529
10529
|
if (mode === "present") {
|
|
10530
10530
|
presentation.handlePresentationAction(action);
|
|
10531
10531
|
} else if (action.url) {
|
|
10532
|
-
|
|
10532
|
+
chunkT7BAPZBY_js.safeOpenUrl(action.url);
|
|
10533
10533
|
}
|
|
10534
10534
|
};
|
|
10535
10535
|
const handleHyperlinkClick = (url) => {
|
|
10536
|
-
if (
|
|
10536
|
+
if (chunkT7BAPZBY_js.isPpactionUrl(url)) {
|
|
10537
10537
|
if (mode === "present") {
|
|
10538
|
-
const parsed =
|
|
10538
|
+
const parsed = chunkT7BAPZBY_js.parsePpactionUrl(url);
|
|
10539
10539
|
if (parsed) {
|
|
10540
10540
|
presentation.handlePresentationAction({
|
|
10541
10541
|
action: parsed.action,
|
|
@@ -10545,7 +10545,7 @@ function buildCanvasProps(input) {
|
|
|
10545
10545
|
}
|
|
10546
10546
|
return;
|
|
10547
10547
|
}
|
|
10548
|
-
|
|
10548
|
+
chunkT7BAPZBY_js.safeOpenUrl(url);
|
|
10549
10549
|
};
|
|
10550
10550
|
return {
|
|
10551
10551
|
activeSlide: effectiveSlide,
|
|
@@ -10641,7 +10641,7 @@ function buildCanvasProps(input) {
|
|
|
10641
10641
|
|
|
10642
10642
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10643
10643
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10644
|
-
return
|
|
10644
|
+
return chunkT7BAPZBY_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10645
10645
|
}
|
|
10646
10646
|
|
|
10647
10647
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10654,7 +10654,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10654
10654
|
const current = activeSlide.animations ?? [];
|
|
10655
10655
|
if (group === "motionPath") {
|
|
10656
10656
|
propertyHandlers.handleUpdateSlide({
|
|
10657
|
-
animations:
|
|
10657
|
+
animations: chunkT7BAPZBY_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10658
10658
|
});
|
|
10659
10659
|
return;
|
|
10660
10660
|
}
|
|
@@ -10849,7 +10849,7 @@ function buildToolbarProps(input) {
|
|
|
10849
10849
|
onOpenFile,
|
|
10850
10850
|
onOpenRecentFile,
|
|
10851
10851
|
onCreatePresentation: (templateId) => {
|
|
10852
|
-
s.setSlides(
|
|
10852
|
+
s.setSlides(chunkT7BAPZBY_js.createBackstagePresentation(templateId));
|
|
10853
10853
|
s.setActiveSlideIndex(0);
|
|
10854
10854
|
s.setSelectedElementId(null);
|
|
10855
10855
|
s.setSelectedElementIds([]);
|
|
@@ -10878,7 +10878,7 @@ function buildToolbarProps(input) {
|
|
|
10878
10878
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
10879
10879
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10880
10880
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10881
|
-
templateScheme:
|
|
10881
|
+
templateScheme: chunkT7BAPZBY_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10882
10882
|
customShows: s.customShows,
|
|
10883
10883
|
activeCustomShowId: s.activeCustomShowId,
|
|
10884
10884
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -10919,7 +10919,7 @@ function buildToolbarProps(input) {
|
|
|
10919
10919
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10920
10920
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10921
10921
|
formatPainterActive: s.formatPainterActive,
|
|
10922
|
-
canActivateFormatPainter:
|
|
10922
|
+
canActivateFormatPainter: chunkT7BAPZBY_js.hasCopyableFormat(selectedElement),
|
|
10923
10923
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10924
10924
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10925
10925
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11207,7 +11207,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11207
11207
|
}, [incomingContent]);
|
|
11208
11208
|
const onOpenFile = react.useCallback(() => {
|
|
11209
11209
|
void (async () => {
|
|
11210
|
-
const picked = await
|
|
11210
|
+
const picked = await chunkT7BAPZBY_js.openPptxFile();
|
|
11211
11211
|
if (picked) {
|
|
11212
11212
|
setContent(picked.buffer);
|
|
11213
11213
|
}
|
|
@@ -11215,7 +11215,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11215
11215
|
}, []);
|
|
11216
11216
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11217
11217
|
void (async () => {
|
|
11218
|
-
const bytes = await
|
|
11218
|
+
const bytes = await chunkT7BAPZBY_js.readBackstageRecentFile(key);
|
|
11219
11219
|
if (bytes) {
|
|
11220
11220
|
setContent(bytes);
|
|
11221
11221
|
}
|