@aixa-transformation/pptx-viewer 2.0.24 → 2.0.29
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/dist/{Model3DScene-VK4AKXGO.js → Model3DScene-7PC3BTGV.js} +3 -3
- package/dist/{Model3DScene-QPOSBRM4.mjs → Model3DScene-OOLYRN3I.mjs} +2 -2
- package/dist/{SurfaceChart3DScene-LBHZDSGV.js → SurfaceChart3DScene-NKUQTDRP.js} +3 -3
- package/dist/{SurfaceChart3DScene-GIAS6HZ7.mjs → SurfaceChart3DScene-ZZYDRV5N.mjs} +2 -2
- package/dist/{chunk-VFVF632V.js → chunk-E4API7OH.js} +977 -857
- package/dist/{chunk-LTBO2ZJC.mjs → chunk-JJ5MVLCK.mjs} +127 -104
- package/dist/{chunk-OUD7I3ER.mjs → chunk-LGPN7YBY.mjs} +154 -35
- package/dist/{chunk-HUD73YBT.js → chunk-N7OHVHBS.js} +127 -104
- package/dist/{chunk-ZSZ2WR4A.js → chunk-OGINKMSL.js} +547 -489
- package/dist/{chunk-RI6OBMEG.mjs → chunk-TYXOHBKR.mjs} +70 -12
- package/dist/{chunk-DHNQHQ66.js → chunk-XCLYIGHM.js} +41 -41
- package/dist/{chunk-45A3IISI.mjs → chunk-YVQPLQ3C.mjs} +1 -1
- package/dist/{dist-L2EUDG6W.js → dist-72WLGYVZ.js} +568 -568
- package/dist/{dist-DPZ5B7L7.mjs → dist-RTG3TU65.mjs} +1 -1
- package/dist/index.js +34 -34
- package/dist/index.mjs +4 -4
- package/dist/internals.js +78 -78
- package/dist/internals.mjs +3 -3
- package/dist/presentation.js +2 -2
- package/dist/presentation.mjs +1 -1
- package/dist/viewer/index.js +20 -20
- package/dist/viewer/index.mjs +4 -4
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXCLYIGHM_js = require('./chunk-XCLYIGHM.js');
|
|
4
4
|
var chunkCUUYYYC5_js = require('./chunk-CUUYYYC5.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkN7OHVHBS_js = require('./chunk-N7OHVHBS.js');
|
|
6
6
|
var React4 = require('react');
|
|
7
7
|
var lu = require('react-icons/lu');
|
|
8
8
|
var clsx = require('clsx');
|
|
@@ -18,12 +18,12 @@ var JSZip__default = /*#__PURE__*/_interopDefault(JSZip);
|
|
|
18
18
|
|
|
19
19
|
// src/viewer/utils/animation-effects.ts
|
|
20
20
|
function getAnimationInitialStyle2(preset, nativeAnimation) {
|
|
21
|
-
return
|
|
21
|
+
return chunkXCLYIGHM_js.getAnimationInitialStyle(preset, nativeAnimation);
|
|
22
22
|
}
|
|
23
23
|
function useVirtualizedSlides({
|
|
24
24
|
totalItems,
|
|
25
25
|
itemHeight,
|
|
26
|
-
overscan =
|
|
26
|
+
overscan = chunkXCLYIGHM_js.DEFAULT_VIRTUAL_OVERSCAN
|
|
27
27
|
}) {
|
|
28
28
|
const scrollContainerRef = React4.useRef(null);
|
|
29
29
|
const [scrollTop, setScrollTop] = React4.useState(0);
|
|
@@ -53,7 +53,7 @@ function useVirtualizedSlides({
|
|
|
53
53
|
resizeObserver?.disconnect();
|
|
54
54
|
};
|
|
55
55
|
}, []);
|
|
56
|
-
const range =
|
|
56
|
+
const range = chunkXCLYIGHM_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
|
|
57
57
|
const safeItemHeight = Math.max(itemHeight, 1);
|
|
58
58
|
const scrollToIndex = React4.useCallback(
|
|
59
59
|
(index, behavior = "smooth") => {
|
|
@@ -116,7 +116,7 @@ function usePresenceTracking({
|
|
|
116
116
|
awareness.setLocalStateField("presence", state);
|
|
117
117
|
lastBroadcastRef.current = Date.now();
|
|
118
118
|
};
|
|
119
|
-
if (elapsed >=
|
|
119
|
+
if (elapsed >= chunkXCLYIGHM_js.BROADCAST_THROTTLE_MS) {
|
|
120
120
|
if (pendingBroadcastRef.current) {
|
|
121
121
|
clearTimeout(pendingBroadcastRef.current);
|
|
122
122
|
pendingBroadcastRef.current = null;
|
|
@@ -126,7 +126,7 @@ function usePresenceTracking({
|
|
|
126
126
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
127
127
|
pendingBroadcastRef.current = null;
|
|
128
128
|
flush();
|
|
129
|
-
},
|
|
129
|
+
}, chunkXCLYIGHM_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
130
130
|
}
|
|
131
131
|
},
|
|
132
132
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -151,7 +151,7 @@ function usePresenceTracking({
|
|
|
151
151
|
return;
|
|
152
152
|
}
|
|
153
153
|
const handleChange = () => {
|
|
154
|
-
const users =
|
|
154
|
+
const users = chunkXCLYIGHM_js.derivePresenceList(
|
|
155
155
|
awareness.getStates(),
|
|
156
156
|
localClientId,
|
|
157
157
|
canvasWidth,
|
|
@@ -202,7 +202,7 @@ function useYjsProvider({ config }) {
|
|
|
202
202
|
const timeoutRef = React4.useRef(null);
|
|
203
203
|
const gateRef = React4.useRef(null);
|
|
204
204
|
if (!gateRef.current) {
|
|
205
|
-
gateRef.current =
|
|
205
|
+
gateRef.current = chunkXCLYIGHM_js.createSyncGate(() => setSynced(true));
|
|
206
206
|
}
|
|
207
207
|
const teardown = React4.useCallback(() => {
|
|
208
208
|
if (timeoutRef.current) {
|
|
@@ -240,7 +240,7 @@ function useYjsProvider({ config }) {
|
|
|
240
240
|
if (config.authToken) {
|
|
241
241
|
opts.password = config.authToken;
|
|
242
242
|
}
|
|
243
|
-
const provider = new WebrtcProvider(
|
|
243
|
+
const provider = new WebrtcProvider(chunkXCLYIGHM_js.validateRoomId(config.roomId), yDoc, opts);
|
|
244
244
|
setDoc(yDoc);
|
|
245
245
|
setAwareness(provider.awareness);
|
|
246
246
|
setClientId(provider.awareness.clientID);
|
|
@@ -282,13 +282,13 @@ function useYjsProvider({ config }) {
|
|
|
282
282
|
if (!config) {
|
|
283
283
|
return;
|
|
284
284
|
}
|
|
285
|
-
const roomId =
|
|
286
|
-
const transport = config.transport ??
|
|
285
|
+
const roomId = chunkXCLYIGHM_js.validateRoomId(config.roomId);
|
|
286
|
+
const transport = config.transport ?? chunkXCLYIGHM_js.resolveTransportForServerUrl(config.serverUrl);
|
|
287
287
|
if (transport === "webrtc") {
|
|
288
288
|
await initWebrtc();
|
|
289
289
|
return;
|
|
290
290
|
}
|
|
291
|
-
if (
|
|
291
|
+
if (chunkXCLYIGHM_js.isMixedContentBlocked(config.serverUrl)) {
|
|
292
292
|
console.warn(
|
|
293
293
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
294
294
|
);
|
|
@@ -348,7 +348,7 @@ function useYjsProvider({ config }) {
|
|
|
348
348
|
cleanupRef.current = null;
|
|
349
349
|
setStatus("error");
|
|
350
350
|
}
|
|
351
|
-
},
|
|
351
|
+
}, chunkXCLYIGHM_js.CONNECTION_TIMEOUT_MS);
|
|
352
352
|
}
|
|
353
353
|
setDoc(yDoc);
|
|
354
354
|
setAwareness(provider.awareness);
|
|
@@ -394,7 +394,7 @@ function useCollaborativeState({
|
|
|
394
394
|
canvasWidth,
|
|
395
395
|
canvasHeight
|
|
396
396
|
}) {
|
|
397
|
-
const userColor =
|
|
397
|
+
const userColor = chunkXCLYIGHM_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
398
398
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
399
399
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
400
400
|
awareness,
|
|
@@ -461,7 +461,7 @@ function useSheetDismissDrag(onClose, threshold = 120) {
|
|
|
461
461
|
|
|
462
462
|
// src/viewer/utils/clone.ts
|
|
463
463
|
function cloneHistorySnapshot2(snapshot) {
|
|
464
|
-
return
|
|
464
|
+
return chunkXCLYIGHM_js.cloneHistorySnapshot(snapshot);
|
|
465
465
|
}
|
|
466
466
|
|
|
467
467
|
// src/viewer/hooks/useEditorHistory.ts
|
|
@@ -510,8 +510,8 @@ function useEditorHistory(input) {
|
|
|
510
510
|
width: canvasSize.width,
|
|
511
511
|
height: canvasSize.height,
|
|
512
512
|
activeSlideIndex,
|
|
513
|
-
slides: slides.map(
|
|
514
|
-
templateElementsBySlideId:
|
|
513
|
+
slides: slides.map(chunkXCLYIGHM_js.cloneSlide),
|
|
514
|
+
templateElementsBySlideId: chunkXCLYIGHM_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
515
515
|
...actionLabel ? { actionLabel } : {}
|
|
516
516
|
};
|
|
517
517
|
},
|
|
@@ -524,9 +524,9 @@ function useEditorHistory(input) {
|
|
|
524
524
|
width: snapshot.width,
|
|
525
525
|
height: snapshot.height
|
|
526
526
|
});
|
|
527
|
-
setSlides(snapshot.slides.map(
|
|
527
|
+
setSlides(snapshot.slides.map(chunkXCLYIGHM_js.cloneSlide));
|
|
528
528
|
setTemplateElementsBySlideId(
|
|
529
|
-
|
|
529
|
+
chunkXCLYIGHM_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
530
530
|
);
|
|
531
531
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
532
532
|
setSelectedElementIds([]);
|
|
@@ -790,7 +790,7 @@ var GLYPH_COMPONENTS = {
|
|
|
790
790
|
plus: lu.LuPlus,
|
|
791
791
|
triangle: lu.LuTriangle
|
|
792
792
|
};
|
|
793
|
-
var SHAPE_PRESETS =
|
|
793
|
+
var SHAPE_PRESETS = chunkXCLYIGHM_js.SHAPE_PRESET_DEFS.map(
|
|
794
794
|
(def) => ({
|
|
795
795
|
type: def.type,
|
|
796
796
|
label: def.label,
|
|
@@ -1035,7 +1035,7 @@ function executeMediaCommand(command) {
|
|
|
1035
1035
|
if (!el) {
|
|
1036
1036
|
return false;
|
|
1037
1037
|
}
|
|
1038
|
-
const parsed =
|
|
1038
|
+
const parsed = chunkXCLYIGHM_js.parseMediaCommand(command.command);
|
|
1039
1039
|
if (!parsed) {
|
|
1040
1040
|
return false;
|
|
1041
1041
|
}
|
|
@@ -1198,7 +1198,7 @@ function useAnimationPlayback(input) {
|
|
|
1198
1198
|
(controller, group) => {
|
|
1199
1199
|
driveBuildReveal(
|
|
1200
1200
|
controller,
|
|
1201
|
-
|
|
1201
|
+
chunkXCLYIGHM_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1202
1202
|
setPresentationElementStates,
|
|
1203
1203
|
buildRafRef
|
|
1204
1204
|
);
|
|
@@ -1261,7 +1261,7 @@ function useAnimationPlayback(input) {
|
|
|
1261
1261
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1262
1262
|
return;
|
|
1263
1263
|
}
|
|
1264
|
-
const controller =
|
|
1264
|
+
const controller = chunkXCLYIGHM_js.PresentationAnimationController.fromSlide(slide);
|
|
1265
1265
|
controllerRef.current = controller;
|
|
1266
1266
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1267
1267
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1398,7 +1398,7 @@ function useAnimationPlayback(input) {
|
|
|
1398
1398
|
}))
|
|
1399
1399
|
);
|
|
1400
1400
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1401
|
-
const delay =
|
|
1401
|
+
const delay = chunkXCLYIGHM_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1402
1402
|
const timer = window.setTimeout(() => {
|
|
1403
1403
|
setPresentationAnimations(
|
|
1404
1404
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1434,12 +1434,12 @@ function useAnimationPlayback(input) {
|
|
|
1434
1434
|
presentationTimersRef
|
|
1435
1435
|
};
|
|
1436
1436
|
}
|
|
1437
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1438
|
-
var AUDIENCE_HASH =
|
|
1439
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1440
|
-
var AUDIENCE_NONCE_KEY =
|
|
1437
|
+
var PRESENTER_CHANNEL_NAME = chunkXCLYIGHM_js.PRESENTATION_CHANNEL_NAME;
|
|
1438
|
+
var AUDIENCE_HASH = chunkXCLYIGHM_js.PRESENTATION_HASH;
|
|
1439
|
+
var PRESENTER_MSG_ORIGIN = chunkXCLYIGHM_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1440
|
+
var AUDIENCE_NONCE_KEY = chunkXCLYIGHM_js.PRESENTATION_NONCE_KEY;
|
|
1441
1441
|
function generateSessionId() {
|
|
1442
|
-
return
|
|
1442
|
+
return chunkXCLYIGHM_js.createPresentationSessionId();
|
|
1443
1443
|
}
|
|
1444
1444
|
function parseAudienceNonce() {
|
|
1445
1445
|
const hash = window.location.hash;
|
|
@@ -1475,7 +1475,7 @@ function usePresenterWindow(input) {
|
|
|
1475
1475
|
}, []);
|
|
1476
1476
|
const swapDisplays = React4.useCallback(async () => {
|
|
1477
1477
|
const audience = audienceWindowRef.current;
|
|
1478
|
-
return audience && !audience.closed ?
|
|
1478
|
+
return audience && !audience.closed ? chunkXCLYIGHM_js.swapPresentationWindows(window, audience) : false;
|
|
1479
1479
|
}, []);
|
|
1480
1480
|
const syncSlideToAudience = React4.useCallback(
|
|
1481
1481
|
(slideIndex) => {
|
|
@@ -1539,7 +1539,7 @@ function usePresenterWindow(input) {
|
|
|
1539
1539
|
pollTimerRef.current = null;
|
|
1540
1540
|
}
|
|
1541
1541
|
if (closingSessionId) {
|
|
1542
|
-
void
|
|
1542
|
+
void chunkXCLYIGHM_js.clearAudienceContent(closingSessionId);
|
|
1543
1543
|
}
|
|
1544
1544
|
}, [getChannel]);
|
|
1545
1545
|
const openAudienceWindow = React4.useCallback(() => {
|
|
@@ -1557,10 +1557,10 @@ function usePresenterWindow(input) {
|
|
|
1557
1557
|
audienceWindowRef.current = blankWin;
|
|
1558
1558
|
const sessionId = generateSessionId();
|
|
1559
1559
|
sessionIdRef.current = sessionId;
|
|
1560
|
-
const audienceUrl =
|
|
1561
|
-
void
|
|
1560
|
+
const audienceUrl = chunkXCLYIGHM_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1561
|
+
void chunkXCLYIGHM_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1562
1562
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1563
|
-
|
|
1563
|
+
chunkXCLYIGHM_js.placeAudienceWindow(blankWin, placement);
|
|
1564
1564
|
}
|
|
1565
1565
|
return void 0;
|
|
1566
1566
|
});
|
|
@@ -1590,7 +1590,7 @@ function usePresenterWindow(input) {
|
|
|
1590
1590
|
}
|
|
1591
1591
|
};
|
|
1592
1592
|
if (content) {
|
|
1593
|
-
void
|
|
1593
|
+
void chunkXCLYIGHM_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1594
1594
|
} else {
|
|
1595
1595
|
navigateOrClose(true);
|
|
1596
1596
|
}
|
|
@@ -1616,7 +1616,7 @@ function usePresenterWindow(input) {
|
|
|
1616
1616
|
}
|
|
1617
1617
|
const handleMessage = (event) => {
|
|
1618
1618
|
const message = event.data;
|
|
1619
|
-
if (
|
|
1619
|
+
if (chunkXCLYIGHM_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1620
1620
|
syncStateToAudience(snapshotRef.current);
|
|
1621
1621
|
}
|
|
1622
1622
|
};
|
|
@@ -1645,7 +1645,7 @@ function usePresenterWindow(input) {
|
|
|
1645
1645
|
React4.useEffect(() => {
|
|
1646
1646
|
const handleBeforeUnload = () => {
|
|
1647
1647
|
if (sessionIdRef.current) {
|
|
1648
|
-
void
|
|
1648
|
+
void chunkXCLYIGHM_js.clearAudienceContent(sessionIdRef.current);
|
|
1649
1649
|
}
|
|
1650
1650
|
};
|
|
1651
1651
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1698,7 +1698,7 @@ function useAudienceMode(input) {
|
|
|
1698
1698
|
}
|
|
1699
1699
|
channel.onmessage = (event) => {
|
|
1700
1700
|
const data = event.data;
|
|
1701
|
-
if (!
|
|
1701
|
+
if (!chunkXCLYIGHM_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1702
1702
|
return;
|
|
1703
1703
|
}
|
|
1704
1704
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1713,7 +1713,7 @@ function useAudienceMode(input) {
|
|
|
1713
1713
|
}
|
|
1714
1714
|
if (data.type === "presenter-exit") {
|
|
1715
1715
|
if (expectedSessionId) {
|
|
1716
|
-
void
|
|
1716
|
+
void chunkXCLYIGHM_js.clearAudienceContent(expectedSessionId);
|
|
1717
1717
|
}
|
|
1718
1718
|
onSetMode("edit");
|
|
1719
1719
|
try {
|
|
@@ -1724,7 +1724,7 @@ function useAudienceMode(input) {
|
|
|
1724
1724
|
};
|
|
1725
1725
|
if (expectedSessionId) {
|
|
1726
1726
|
channel.postMessage({
|
|
1727
|
-
origin:
|
|
1727
|
+
origin: chunkXCLYIGHM_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1728
1728
|
type: "audience-ready",
|
|
1729
1729
|
sessionId: expectedSessionId
|
|
1730
1730
|
});
|
|
@@ -1989,7 +1989,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1989
1989
|
return;
|
|
1990
1990
|
}
|
|
1991
1991
|
if (action.url && !actionStr.includes("hlinksldjump")) {
|
|
1992
|
-
if (
|
|
1992
|
+
if (chunkXCLYIGHM_js.isUrlSafe(action.url)) {
|
|
1993
1993
|
window.open(action.url, "_blank", "noopener,noreferrer");
|
|
1994
1994
|
}
|
|
1995
1995
|
}
|
|
@@ -1999,7 +1999,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1999
1999
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
2000
2000
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
2001
2001
|
const transition = incomingSlide?.transition;
|
|
2002
|
-
const durationMs = deps.playTransition ?
|
|
2002
|
+
const durationMs = deps.playTransition ? chunkXCLYIGHM_js.resolveTransitionDurationMs(transition) : 0;
|
|
2003
2003
|
deps.clearPresentationTimers();
|
|
2004
2004
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
2005
2005
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -2245,17 +2245,17 @@ function useZoomNavigation(input) {
|
|
|
2245
2245
|
};
|
|
2246
2246
|
}
|
|
2247
2247
|
function usePresenterConsole(slideIndex) {
|
|
2248
|
-
const timerRef = React4.useRef(
|
|
2249
|
-
const [snapshot, setSnapshot] = React4.useState(() =>
|
|
2248
|
+
const timerRef = React4.useRef(chunkXCLYIGHM_js.createPresenterTimer());
|
|
2249
|
+
const [snapshot, setSnapshot] = React4.useState(() => chunkXCLYIGHM_js.createInitialPresentationSnapshot(slideIndex));
|
|
2250
2250
|
const patch = React4.useCallback((value) => {
|
|
2251
|
-
setSnapshot((current) =>
|
|
2251
|
+
setSnapshot((current) => chunkXCLYIGHM_js.mergePresentationSnapshot(current, value));
|
|
2252
2252
|
}, []);
|
|
2253
2253
|
React4.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2254
2254
|
React4.useEffect(() => {
|
|
2255
2255
|
const timer = window.setInterval(() => {
|
|
2256
2256
|
patch({
|
|
2257
2257
|
paused: timerRef.current.paused,
|
|
2258
|
-
elapsedMs:
|
|
2258
|
+
elapsedMs: chunkXCLYIGHM_js.presenterElapsed(timerRef.current)
|
|
2259
2259
|
});
|
|
2260
2260
|
}, 1e3);
|
|
2261
2261
|
return () => window.clearInterval(timer);
|
|
@@ -2265,19 +2265,19 @@ function usePresenterConsole(slideIndex) {
|
|
|
2265
2265
|
applyAudienceSnapshot: setSnapshot,
|
|
2266
2266
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2267
2267
|
toggleTimer: () => {
|
|
2268
|
-
timerRef.current =
|
|
2268
|
+
timerRef.current = chunkXCLYIGHM_js.togglePresenterTimer(timerRef.current);
|
|
2269
2269
|
patch({
|
|
2270
2270
|
paused: timerRef.current.paused,
|
|
2271
|
-
elapsedMs:
|
|
2271
|
+
elapsedMs: chunkXCLYIGHM_js.presenterElapsed(timerRef.current)
|
|
2272
2272
|
});
|
|
2273
2273
|
},
|
|
2274
2274
|
resetTimer: () => {
|
|
2275
|
-
timerRef.current =
|
|
2275
|
+
timerRef.current = chunkXCLYIGHM_js.resetPresenterTimer();
|
|
2276
2276
|
patch({ paused: false, elapsedMs: 0 });
|
|
2277
2277
|
},
|
|
2278
2278
|
stepZoom: (direction) => setSnapshot(
|
|
2279
|
-
(current) =>
|
|
2280
|
-
zoom:
|
|
2279
|
+
(current) => chunkXCLYIGHM_js.mergePresentationSnapshot(current, {
|
|
2280
|
+
zoom: chunkXCLYIGHM_js.stepPresenterZoom(
|
|
2281
2281
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2282
2282
|
direction
|
|
2283
2283
|
)
|
|
@@ -2845,7 +2845,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2845
2845
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2846
2846
|
slides.forEach((slide, slideIndex) => {
|
|
2847
2847
|
for (const element of slide.elements || []) {
|
|
2848
|
-
if (!
|
|
2848
|
+
if (!chunkN7OHVHBS_js.hasTextProperties(element)) {
|
|
2849
2849
|
continue;
|
|
2850
2850
|
}
|
|
2851
2851
|
const segments = element.textSegments ?? [];
|
|
@@ -2896,7 +2896,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2896
2896
|
continue;
|
|
2897
2897
|
}
|
|
2898
2898
|
const element = slide.elements[elIdx];
|
|
2899
|
-
if (!
|
|
2899
|
+
if (!chunkN7OHVHBS_js.hasTextProperties(element)) {
|
|
2900
2900
|
continue;
|
|
2901
2901
|
}
|
|
2902
2902
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3784,12 +3784,12 @@ function useViewerState(input) {
|
|
|
3784
3784
|
function partitionTemplateElements(slides) {
|
|
3785
3785
|
const templateElementsBySlideId = {};
|
|
3786
3786
|
const nextSlides = slides.map((slide) => {
|
|
3787
|
-
const template = slide.elements.filter((el) =>
|
|
3787
|
+
const template = slide.elements.filter((el) => chunkXCLYIGHM_js.isTemplateElement(el));
|
|
3788
3788
|
if (template.length === 0) {
|
|
3789
3789
|
return slide;
|
|
3790
3790
|
}
|
|
3791
3791
|
templateElementsBySlideId[slide.id] = template;
|
|
3792
|
-
return { ...slide, elements: slide.elements.filter((el) => !
|
|
3792
|
+
return { ...slide, elements: slide.elements.filter((el) => !chunkXCLYIGHM_js.isTemplateElement(el)) };
|
|
3793
3793
|
});
|
|
3794
3794
|
return { slides: nextSlides, templateElementsBySlideId };
|
|
3795
3795
|
}
|
|
@@ -3863,7 +3863,7 @@ function useLoadContent({
|
|
|
3863
3863
|
);
|
|
3864
3864
|
}
|
|
3865
3865
|
const previousHandler = handlerRef.current;
|
|
3866
|
-
const handler = new
|
|
3866
|
+
const handler = new chunkN7OHVHBS_js.PptxHandler();
|
|
3867
3867
|
const parsed = await handler.load(buffer, {
|
|
3868
3868
|
// PowerPoint supports externally linked pictures. The project upload is
|
|
3869
3869
|
// already security-scanned; allow the browser viewer to retain those
|
|
@@ -3880,7 +3880,7 @@ function useLoadContent({
|
|
|
3880
3880
|
handlerRef.current = null;
|
|
3881
3881
|
const mediaElements = [];
|
|
3882
3882
|
for (const slide of parsed.slides) {
|
|
3883
|
-
|
|
3883
|
+
chunkXCLYIGHM_js.collectMediaElements(slide.elements, mediaElements);
|
|
3884
3884
|
}
|
|
3885
3885
|
for (const url of mediaDataUrls.values()) {
|
|
3886
3886
|
if (url.startsWith("blob:")) {
|
|
@@ -3921,7 +3921,7 @@ function useLoadContent({
|
|
|
3921
3921
|
}
|
|
3922
3922
|
})
|
|
3923
3923
|
);
|
|
3924
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3924
|
+
const { paths: imagePaths, refs: imageRefs } = chunkXCLYIGHM_js.collectImagePaths(parsed.slides);
|
|
3925
3925
|
let nextSlides = parsed.slides;
|
|
3926
3926
|
if (imagePaths.size > 0) {
|
|
3927
3927
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -4010,7 +4010,7 @@ function useLoadContent({
|
|
|
4010
4010
|
setHasMacros(parsed.hasMacros === true);
|
|
4011
4011
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4012
4012
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4013
|
-
setGuides(
|
|
4013
|
+
setGuides(chunkXCLYIGHM_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4014
4014
|
setActiveSlideIndex(0);
|
|
4015
4015
|
clearSelection();
|
|
4016
4016
|
setIsDirty(false);
|
|
@@ -4018,7 +4018,7 @@ function useLoadContent({
|
|
|
4018
4018
|
onContentApplied?.();
|
|
4019
4019
|
} catch (err) {
|
|
4020
4020
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4021
|
-
if (err instanceof
|
|
4021
|
+
if (err instanceof chunkN7OHVHBS_js.EncryptedFileError) {
|
|
4022
4022
|
setIsEncrypted(true);
|
|
4023
4023
|
} else {
|
|
4024
4024
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -4095,7 +4095,7 @@ function useAutosave(input) {
|
|
|
4095
4095
|
isSavingRef.current = false;
|
|
4096
4096
|
return;
|
|
4097
4097
|
}
|
|
4098
|
-
await
|
|
4098
|
+
await chunkXCLYIGHM_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
4099
4099
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4100
4100
|
} catch (err) {
|
|
4101
4101
|
setAutosaveStatus({
|
|
@@ -4136,7 +4136,7 @@ function cn(...inputs) {
|
|
|
4136
4136
|
|
|
4137
4137
|
// src/viewer/utils/text-utils.tsx
|
|
4138
4138
|
function getTextStyleForElement(element, fallbackColor) {
|
|
4139
|
-
if (!
|
|
4139
|
+
if (!chunkN7OHVHBS_js.hasTextProperties(element)) {
|
|
4140
4140
|
return { color: fallbackColor };
|
|
4141
4141
|
}
|
|
4142
4142
|
const textDecorationTokens = [];
|
|
@@ -4150,7 +4150,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
4150
4150
|
const textDecorationStyle = isDoubleStrike ? "double" : void 0;
|
|
4151
4151
|
const hasItalicRuns = element.textStyle?.italic || Boolean(element.textSegments?.some((segment) => segment.style?.italic));
|
|
4152
4152
|
const isRtl = element.textStyle?.rtl === true;
|
|
4153
|
-
const resolvedTextColor = element.textStyle?.hyperlink ?
|
|
4153
|
+
const resolvedTextColor = element.textStyle?.hyperlink ? chunkXCLYIGHM_js.normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : chunkXCLYIGHM_js.normalizeHexColor(element.textStyle?.color, fallbackColor);
|
|
4154
4154
|
const bodyTop = element.textStyle?.bodyInsetTop ?? DEFAULT_BODY_INSET_TB_PX;
|
|
4155
4155
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
4156
4156
|
const bodyLeft = element.textStyle?.bodyInsetLeft ?? DEFAULT_BODY_INSET_LR_PX;
|
|
@@ -4159,15 +4159,15 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
4159
4159
|
const bodyParagraphMarginLeft = hasParagraphIndents ? 0 : element.textStyle?.paragraphMarginLeft ?? 0;
|
|
4160
4160
|
const bodyParagraphMarginRight = hasParagraphIndents ? 0 : element.textStyle?.paragraphMarginRight ?? 0;
|
|
4161
4161
|
const bodyParagraphIndent = hasParagraphIndents ? 0 : element.textStyle?.paragraphIndent ?? 0;
|
|
4162
|
-
const writingMode =
|
|
4163
|
-
const textOrientation =
|
|
4164
|
-
const verticalDirection =
|
|
4162
|
+
const writingMode = chunkXCLYIGHM_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
4163
|
+
const textOrientation = chunkXCLYIGHM_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
4164
|
+
const verticalDirection = chunkXCLYIGHM_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
4165
4165
|
const resolvedDirection = verticalDirection || (isRtl ? "rtl" : "ltr");
|
|
4166
4166
|
const resolvedUnicodeBidi = isRtl ? "plaintext" : void 0;
|
|
4167
4167
|
const hasSegments = (element.textSegments?.length ?? 0) > 0;
|
|
4168
4168
|
return {
|
|
4169
4169
|
color: resolvedTextColor,
|
|
4170
|
-
backgroundColor: !hasSegments && element.textStyle?.highlightColor ?
|
|
4170
|
+
backgroundColor: !hasSegments && element.textStyle?.highlightColor ? chunkXCLYIGHM_js.normalizeHexColor(element.textStyle.highlightColor, void 0) : void 0,
|
|
4171
4171
|
textAlign: (() => {
|
|
4172
4172
|
const a = element.textStyle?.align;
|
|
4173
4173
|
if (a === "justLow" || a === "dist" || a === "thaiDist") {
|
|
@@ -4183,7 +4183,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
4183
4183
|
textDecorationLine: textDecorationTokens.length > 0 ? textDecorationTokens.join(" ") : "none",
|
|
4184
4184
|
textDecorationStyle,
|
|
4185
4185
|
fontFamily: element.textStyle?.fontFamily || DEFAULT_FONT_FAMILY,
|
|
4186
|
-
lineHeight:
|
|
4186
|
+
lineHeight: chunkXCLYIGHM_js.resolveLineHeight(element.textStyle, hasItalicRuns),
|
|
4187
4187
|
paddingTop: bodyTop + (hasItalicRuns ? 1 : 0),
|
|
4188
4188
|
paddingBottom: bodyBottom + (hasItalicRuns ? 1 : 0),
|
|
4189
4189
|
paddingLeft: bodyLeft + bodyParagraphMarginLeft,
|
|
@@ -4196,7 +4196,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
4196
4196
|
// Auto-fit: use OOXML-provided fontScale/lnSpcReduction when available,
|
|
4197
4197
|
// otherwise fall back to heuristic estimation. The pure font-scale maths
|
|
4198
4198
|
// now lives in pptx-viewer-shared (computeAutoFitTextStyle).
|
|
4199
|
-
...
|
|
4199
|
+
...chunkXCLYIGHM_js.computeAutoFitTextStyle({
|
|
4200
4200
|
textStyle: element.textStyle,
|
|
4201
4201
|
text: element.text ?? "",
|
|
4202
4202
|
width: element.width,
|
|
@@ -4230,13 +4230,13 @@ function computeTabSize(tabStops, defaultTabSize) {
|
|
|
4230
4230
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : fromDefault;
|
|
4231
4231
|
}
|
|
4232
4232
|
function getTextLayoutStyle(element) {
|
|
4233
|
-
if (!
|
|
4233
|
+
if (!chunkN7OHVHBS_js.hasTextProperties(element)) {
|
|
4234
4234
|
return {};
|
|
4235
4235
|
}
|
|
4236
4236
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
4237
|
-
const writingMode =
|
|
4238
|
-
const textOrientation =
|
|
4239
|
-
const verticalDirection =
|
|
4237
|
+
const writingMode = chunkXCLYIGHM_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
4238
|
+
const textOrientation = chunkXCLYIGHM_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
4239
|
+
const verticalDirection = chunkXCLYIGHM_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
4240
4240
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
4241
4241
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
4242
4242
|
const hasColumns = columnCount > 1;
|
|
@@ -4244,7 +4244,7 @@ function getTextLayoutStyle(element) {
|
|
|
4244
4244
|
const tabStops = element.textStyle?.tabStops;
|
|
4245
4245
|
const tabSize = computeTabSize(tabStops, element.textStyle?.defaultTabSize);
|
|
4246
4246
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
4247
|
-
const hasParagraphIndents =
|
|
4247
|
+
const hasParagraphIndents = chunkN7OHVHBS_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
4248
4248
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
4249
4249
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
4250
4250
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -4253,7 +4253,7 @@ function getTextLayoutStyle(element) {
|
|
|
4253
4253
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
4254
4254
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
4255
4255
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
4256
|
-
const kinsokuStyles =
|
|
4256
|
+
const kinsokuStyles = chunkXCLYIGHM_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
4257
4257
|
if (hasColumns) {
|
|
4258
4258
|
return {
|
|
4259
4259
|
display: "block",
|
|
@@ -4300,10 +4300,10 @@ function getTextLayoutStyle(element) {
|
|
|
4300
4300
|
|
|
4301
4301
|
// src/viewer/utils/text-effects.tsx
|
|
4302
4302
|
function buildTextFillCss2(style) {
|
|
4303
|
-
return
|
|
4303
|
+
return chunkXCLYIGHM_js.buildTextFillCss(style);
|
|
4304
4304
|
}
|
|
4305
4305
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
4306
|
-
return
|
|
4306
|
+
return chunkXCLYIGHM_js.buildTextBody3DSceneStyle(textStyle);
|
|
4307
4307
|
}
|
|
4308
4308
|
|
|
4309
4309
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -4488,17 +4488,17 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
4488
4488
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
4489
4489
|
return renderedSegments;
|
|
4490
4490
|
}
|
|
4491
|
-
const paraKey = `${elementId}${
|
|
4491
|
+
const paraKey = `${elementId}${chunkXCLYIGHM_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
4492
4492
|
const paraState = subElementAnimStates.get(paraKey);
|
|
4493
4493
|
if (paraState) {
|
|
4494
4494
|
const style = buildAnimStyle(paraState);
|
|
4495
4495
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
4496
4496
|
}
|
|
4497
|
-
const firstWordKey = `${elementId}${
|
|
4497
|
+
const firstWordKey = `${elementId}${chunkXCLYIGHM_js.TEXT_BUILD_ID_SEP}w${paraIndex}-0`;
|
|
4498
4498
|
if (subElementAnimStates.has(firstWordKey)) {
|
|
4499
4499
|
return wrapByWord(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
4500
4500
|
}
|
|
4501
|
-
const firstCharKey = `${elementId}${
|
|
4501
|
+
const firstCharKey = `${elementId}${chunkXCLYIGHM_js.TEXT_BUILD_ID_SEP}c${paraIndex}-0`;
|
|
4502
4502
|
if (subElementAnimStates.has(firstCharKey)) {
|
|
4503
4503
|
return wrapByChar(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
4504
4504
|
}
|
|
@@ -4519,7 +4519,7 @@ function wrapByWord(elementId, paraIndex, paraSegments, states) {
|
|
|
4519
4519
|
nodes.push(/* @__PURE__ */ jsxRuntime.jsx(React4__default.default.Fragment, { children: w }, `ws-${i}`));
|
|
4520
4520
|
continue;
|
|
4521
4521
|
}
|
|
4522
|
-
const key = `${elementId}${
|
|
4522
|
+
const key = `${elementId}${chunkXCLYIGHM_js.TEXT_BUILD_ID_SEP}w${paraIndex}-${wordIdx}`;
|
|
4523
4523
|
const state = states.get(key);
|
|
4524
4524
|
const style = buildAnimStyle(state);
|
|
4525
4525
|
nodes.push(
|
|
@@ -4533,7 +4533,7 @@ function wrapByChar(elementId, paraIndex, paraSegments, states) {
|
|
|
4533
4533
|
const fullText = paraSegments.map((e) => e.segment.text).join("");
|
|
4534
4534
|
const nodes = [];
|
|
4535
4535
|
for (let i = 0; i < fullText.length; i++) {
|
|
4536
|
-
const key = `${elementId}${
|
|
4536
|
+
const key = `${elementId}${chunkXCLYIGHM_js.TEXT_BUILD_ID_SEP}c${paraIndex}-${i}`;
|
|
4537
4537
|
const state = states.get(key);
|
|
4538
4538
|
const style = buildAnimStyle(state);
|
|
4539
4539
|
nodes.push(
|
|
@@ -4679,10 +4679,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
4679
4679
|
if (!needsScriptFonts || !text) {
|
|
4680
4680
|
return text;
|
|
4681
4681
|
}
|
|
4682
|
-
const runs =
|
|
4682
|
+
const runs = chunkXCLYIGHM_js.segmentByScript(text);
|
|
4683
4683
|
if (runs.length <= 1) {
|
|
4684
4684
|
if (runs.length === 1) {
|
|
4685
|
-
const font =
|
|
4685
|
+
const font = chunkXCLYIGHM_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
4686
4686
|
if (font && font !== baseFontFamily) {
|
|
4687
4687
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
4688
4688
|
}
|
|
@@ -4690,7 +4690,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
4690
4690
|
return text;
|
|
4691
4691
|
}
|
|
4692
4692
|
return runs.map((run, i) => {
|
|
4693
|
-
const font =
|
|
4693
|
+
const font = chunkXCLYIGHM_js.resolveFontForScript(run.script, scriptFonts);
|
|
4694
4694
|
if (!font || font === baseFontFamily) {
|
|
4695
4695
|
return /* @__PURE__ */ jsxRuntime.jsx(React4__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
4696
4696
|
}
|
|
@@ -4762,8 +4762,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
4762
4762
|
);
|
|
4763
4763
|
}
|
|
4764
4764
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
4765
|
-
const mathml =
|
|
4766
|
-
const safeMathml = mathml ?
|
|
4765
|
+
const mathml = chunkXCLYIGHM_js.convertOmmlToMathMl(equationXml);
|
|
4766
|
+
const safeMathml = mathml ? chunkXCLYIGHM_js.sanitizeMathMl(mathml) : "";
|
|
4767
4767
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4768
4768
|
"span",
|
|
4769
4769
|
{
|
|
@@ -4813,7 +4813,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
4813
4813
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
4814
4814
|
}
|
|
4815
4815
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
4816
|
-
const picture =
|
|
4816
|
+
const picture = chunkXCLYIGHM_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
4817
4817
|
sizePx: baseFontSize,
|
|
4818
4818
|
fallbackMarker: "\u2022",
|
|
4819
4819
|
accessibleLabel: "Bullet"
|
|
@@ -4863,7 +4863,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4863
4863
|
);
|
|
4864
4864
|
}
|
|
4865
4865
|
const segmentStyle = segment.style || {};
|
|
4866
|
-
const textValue =
|
|
4866
|
+
const textValue = chunkXCLYIGHM_js.substituteFieldText(segment.text || "", segment.fieldType, fieldContext);
|
|
4867
4867
|
const lines = textValue.split("\n");
|
|
4868
4868
|
const textDecorationTokens = [];
|
|
4869
4869
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -4873,8 +4873,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4873
4873
|
textDecorationTokens.push("line-through");
|
|
4874
4874
|
}
|
|
4875
4875
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
4876
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
4877
|
-
const underlineDecoration =
|
|
4876
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkXCLYIGHM_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkXCLYIGHM_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
4877
|
+
const underlineDecoration = chunkXCLYIGHM_js.resolveUnderlineDecorationStyle(
|
|
4878
4878
|
Boolean(isDoubleStrike),
|
|
4879
4879
|
segmentStyle.underlineStyle
|
|
4880
4880
|
);
|
|
@@ -4890,14 +4890,14 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4890
4890
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
4891
4891
|
const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
|
|
4892
4892
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
4893
|
-
const baseFontFamily = rawFontFamily ?
|
|
4893
|
+
const baseFontFamily = rawFontFamily ? chunkN7OHVHBS_js.getSubstituteFontFamily(rawFontFamily) : DEFAULT_FONT_FAMILY;
|
|
4894
4894
|
const scriptFonts = {
|
|
4895
4895
|
latin: baseFontFamily,
|
|
4896
4896
|
eastAsia: segmentStyle.eastAsiaFont || element.textStyle?.eastAsiaFont || baseFontFamily,
|
|
4897
4897
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
4898
4898
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
4899
4899
|
};
|
|
4900
|
-
const needsScriptFonts =
|
|
4900
|
+
const needsScriptFonts = chunkXCLYIGHM_js.hasDistinctScriptFonts(scriptFonts);
|
|
4901
4901
|
const spanStyle = {
|
|
4902
4902
|
color: resolvedSegmentColor,
|
|
4903
4903
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -4915,15 +4915,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4915
4915
|
fontVariantCaps: segmentStyle.textCaps === "small" ? "small-caps" : void 0,
|
|
4916
4916
|
letterSpacing,
|
|
4917
4917
|
fontKerning,
|
|
4918
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
4918
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkXCLYIGHM_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
4919
4919
|
...textFillStyles,
|
|
4920
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
4921
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
4920
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkXCLYIGHM_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
4921
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkXCLYIGHM_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
4922
4922
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
4923
|
-
textShadow:
|
|
4924
|
-
filter:
|
|
4925
|
-
opacity:
|
|
4926
|
-
WebkitBoxReflect:
|
|
4923
|
+
textShadow: chunkXCLYIGHM_js.buildTextShadowCss(segmentStyle),
|
|
4924
|
+
filter: chunkXCLYIGHM_js.buildTextRunFilterChain(segmentStyle),
|
|
4925
|
+
opacity: chunkXCLYIGHM_js.getTextAlphaOpacity(segmentStyle),
|
|
4926
|
+
WebkitBoxReflect: chunkXCLYIGHM_js.buildTextReflectionCss(segmentStyle)
|
|
4927
4927
|
};
|
|
4928
4928
|
const runRtl = segmentStyle.rtl;
|
|
4929
4929
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -4949,7 +4949,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4949
4949
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
4950
4950
|
}
|
|
4951
4951
|
if (bulletInfo.color) {
|
|
4952
|
-
spanStyle.color =
|
|
4952
|
+
spanStyle.color = chunkXCLYIGHM_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
4953
4953
|
}
|
|
4954
4954
|
}
|
|
4955
4955
|
if (bulletInfo?.imageDataUrl || bulletInfo?.imageRelId) {
|
|
@@ -4989,7 +4989,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4989
4989
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
4990
4990
|
};
|
|
4991
4991
|
if (segment.rubyStyle?.color) {
|
|
4992
|
-
rubyStyle.color =
|
|
4992
|
+
rubyStyle.color = chunkXCLYIGHM_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
4993
4993
|
}
|
|
4994
4994
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
4995
4995
|
baseContent,
|
|
@@ -5044,6 +5044,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
5044
5044
|
|
|
5045
5045
|
// src/viewer/utils/text-paragraph-spacing.ts
|
|
5046
5046
|
var PT_TO_PX = 96 / 72;
|
|
5047
|
+
var DRAWINGML_SINGLE_LINE_HEIGHT = 1.2;
|
|
5047
5048
|
function resolveParagraphSpacing(input) {
|
|
5048
5049
|
const { paraProps, bodyStyle, isFirst, isLast, spaceFirstLast } = input;
|
|
5049
5050
|
const result = {};
|
|
@@ -5062,7 +5063,7 @@ function resolveParagraphSpacing(input) {
|
|
|
5062
5063
|
if (typeof exactPt === "number" && exactPt > 0) {
|
|
5063
5064
|
result.lineHeight = `${exactPt * PT_TO_PX}px`;
|
|
5064
5065
|
} else if (typeof multiplier === "number" && multiplier > 0) {
|
|
5065
|
-
result.lineHeight = multiplier;
|
|
5066
|
+
result.lineHeight = multiplier * DRAWINGML_SINGLE_LINE_HEIGHT;
|
|
5066
5067
|
}
|
|
5067
5068
|
return result;
|
|
5068
5069
|
}
|
|
@@ -5072,7 +5073,22 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
5072
5073
|
for (let i = 0; i < segments.length; i++) {
|
|
5073
5074
|
const seg = segments[i];
|
|
5074
5075
|
if (seg.text === "\n") {
|
|
5075
|
-
|
|
5076
|
+
const currentHasVisibleContent = current.some(
|
|
5077
|
+
({ segment }) => Boolean(segment.text && segment.text.trim().length > 0)
|
|
5078
|
+
);
|
|
5079
|
+
if (!currentHasVisibleContent && paragraphs.length === 0) {
|
|
5080
|
+
current = [];
|
|
5081
|
+
continue;
|
|
5082
|
+
}
|
|
5083
|
+
if (current.length === 0 && paragraphs.length > 0) {
|
|
5084
|
+
current.push({
|
|
5085
|
+
segment: { ...seg, text: "" },
|
|
5086
|
+
globalIndex: i
|
|
5087
|
+
});
|
|
5088
|
+
}
|
|
5089
|
+
if (current.length > 0) {
|
|
5090
|
+
paragraphs.push(current);
|
|
5091
|
+
}
|
|
5076
5092
|
current = [];
|
|
5077
5093
|
} else {
|
|
5078
5094
|
current.push({ segment: seg, globalIndex: i });
|
|
@@ -5081,10 +5097,15 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
5081
5097
|
if (current.length > 0 || paragraphs.length === 0) {
|
|
5082
5098
|
paragraphs.push(current);
|
|
5083
5099
|
}
|
|
5100
|
+
while (paragraphs.length > 1 && !paragraphs[paragraphs.length - 1].some(
|
|
5101
|
+
({ segment }) => !segment.bulletInfo && Boolean(segment.text && segment.text.trim().length > 0)
|
|
5102
|
+
)) {
|
|
5103
|
+
paragraphs.pop();
|
|
5104
|
+
}
|
|
5084
5105
|
return paragraphs;
|
|
5085
5106
|
}
|
|
5086
5107
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
5087
|
-
if (!
|
|
5108
|
+
if (!chunkN7OHVHBS_js.hasTextProperties(element)) {
|
|
5088
5109
|
return emptyFallback || null;
|
|
5089
5110
|
}
|
|
5090
5111
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -5105,10 +5126,10 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
5105
5126
|
return element.text || emptyFallback || "";
|
|
5106
5127
|
}
|
|
5107
5128
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
5108
|
-
const paragraphIndents =
|
|
5109
|
-
const elementRtl =
|
|
5110
|
-
const elementAlign =
|
|
5111
|
-
const bodyStyle =
|
|
5129
|
+
const paragraphIndents = chunkN7OHVHBS_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
5130
|
+
const elementRtl = chunkN7OHVHBS_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
5131
|
+
const elementAlign = chunkN7OHVHBS_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
5132
|
+
const bodyStyle = chunkN7OHVHBS_js.hasTextProperties(element) ? element.textStyle : void 0;
|
|
5112
5133
|
const spaceFirstLast = bodyStyle?.spaceFirstLastParagraph === true;
|
|
5113
5134
|
return paragraphs.map((paraSegments, paraIndex) => {
|
|
5114
5135
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
@@ -5128,20 +5149,21 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
5128
5149
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
5129
5150
|
});
|
|
5130
5151
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent && !hasDuplicateAuthoredAutoNumber;
|
|
5131
|
-
const paraRtl =
|
|
5152
|
+
const paraRtl = chunkXCLYIGHM_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
5132
5153
|
const isRtlParagraph = paraRtl === true;
|
|
5133
|
-
const paraAlign =
|
|
5134
|
-
const cssTextAlign =
|
|
5154
|
+
const paraAlign = chunkXCLYIGHM_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
5155
|
+
const cssTextAlign = chunkXCLYIGHM_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
5135
5156
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
5136
5157
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
5137
5158
|
const paraTextIndent = rawTextIndent;
|
|
5138
|
-
const paraKinsokuStyle =
|
|
5159
|
+
const paraKinsokuStyle = chunkXCLYIGHM_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
5139
5160
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
5140
5161
|
const paraProps = effectiveSegments[firstSeg?.globalIndex ?? -1]?.paragraphProperties;
|
|
5141
5162
|
const effectiveParaProps = {
|
|
5142
5163
|
...firstSeg?.segment.style,
|
|
5143
5164
|
...paraProps
|
|
5144
5165
|
};
|
|
5166
|
+
const paragraphAutoFitScale = typeof element.textStyle?.autoFitFontScale === "number" && element.textStyle.autoFitFontScale > 0 && element.textStyle.autoFitFontScale < 1 ? element.textStyle.autoFitFontScale : 1;
|
|
5145
5167
|
const spacing = resolveParagraphSpacing({
|
|
5146
5168
|
paraProps: effectiveParaProps,
|
|
5147
5169
|
bodyStyle,
|
|
@@ -5149,10 +5171,27 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
5149
5171
|
isLast: paraIndex === paragraphs.length - 1,
|
|
5150
5172
|
spaceFirstLast
|
|
5151
5173
|
});
|
|
5174
|
+
const hasAuthoredParagraphLineSpacing = paraProps?.lineSpacing !== void 0 || paraProps?.lineSpacingExactPt !== void 0;
|
|
5175
|
+
if (!hasAuthoredParagraphLineSpacing) {
|
|
5176
|
+
if (typeof spacing.marginTop === "number") {
|
|
5177
|
+
spacing.marginTop *= paragraphAutoFitScale;
|
|
5178
|
+
}
|
|
5179
|
+
if (typeof spacing.marginBottom === "number") {
|
|
5180
|
+
spacing.marginBottom *= paragraphAutoFitScale;
|
|
5181
|
+
}
|
|
5182
|
+
}
|
|
5183
|
+
const autoFitLineSpacingReduction = element.textStyle?.autoFitLineSpacingReduction;
|
|
5184
|
+
if (typeof spacing.lineHeight === "number" && typeof autoFitLineSpacingReduction === "number" && autoFitLineSpacingReduction > 0) {
|
|
5185
|
+
spacing.lineHeight = Math.max(1, spacing.lineHeight - autoFitLineSpacingReduction);
|
|
5186
|
+
}
|
|
5152
5187
|
const hasParaSpacing = spacing.marginTop !== void 0 || spacing.marginBottom !== void 0 || spacing.lineHeight !== void 0;
|
|
5153
5188
|
const paraStyle = {
|
|
5154
5189
|
...paraKinsokuStyle
|
|
5155
5190
|
};
|
|
5191
|
+
const paragraphFontSize = typeof effectiveParaProps.fontSize === "number" ? effectiveParaProps.fontSize * paragraphAutoFitScale : void 0;
|
|
5192
|
+
if (typeof paragraphFontSize === "number" && Number.isFinite(paragraphFontSize) && paragraphFontSize > 0) {
|
|
5193
|
+
paraStyle.fontSize = paragraphFontSize;
|
|
5194
|
+
}
|
|
5156
5195
|
if (spacing.marginTop !== void 0) {
|
|
5157
5196
|
paraStyle.marginTop = spacing.marginTop;
|
|
5158
5197
|
}
|
|
@@ -5200,10 +5239,11 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
5200
5239
|
hasBullet && globalIndex === firstSeg.globalIndex ? Math.max(0, -(rawTextIndent ?? 0)) : void 0
|
|
5201
5240
|
)
|
|
5202
5241
|
);
|
|
5242
|
+
const isAuthoredEmptyParagraph = paraSegments.length > 0 && paraSegments.every(({ segment }) => !segment.text || segment.text.trim().length === 0);
|
|
5203
5243
|
const wrappedContent = wrapWithTextBuildAnimation(
|
|
5204
5244
|
element.id,
|
|
5205
5245
|
paraIndex,
|
|
5206
|
-
renderedSegments,
|
|
5246
|
+
isAuthoredEmptyParagraph ? [/* @__PURE__ */ jsxRuntime.jsx("br", {}, `${element.id}-empty-${paraIndex}`)] : renderedSegments,
|
|
5207
5247
|
paraSegments,
|
|
5208
5248
|
subElementAnimStates
|
|
5209
5249
|
);
|
|
@@ -5324,7 +5364,7 @@ function isConnectorOrLineElement(element) {
|
|
|
5324
5364
|
if (element.type === "connector") {
|
|
5325
5365
|
return true;
|
|
5326
5366
|
}
|
|
5327
|
-
if (!
|
|
5367
|
+
if (!chunkN7OHVHBS_js.hasShapeProperties(element)) {
|
|
5328
5368
|
return false;
|
|
5329
5369
|
}
|
|
5330
5370
|
const st = getShapeType(element.shapeType);
|
|
@@ -5342,13 +5382,13 @@ function hexToRgbUnit(hex) {
|
|
|
5342
5382
|
};
|
|
5343
5383
|
}
|
|
5344
5384
|
function getDuotoneColors(element) {
|
|
5345
|
-
if (!
|
|
5385
|
+
if (!chunkN7OHVHBS_js.isImageLikeElement(element)) {
|
|
5346
5386
|
return void 0;
|
|
5347
5387
|
}
|
|
5348
5388
|
return element.imageEffects?.duotone;
|
|
5349
5389
|
}
|
|
5350
5390
|
function buildLineShadowCss(element) {
|
|
5351
|
-
if (!
|
|
5391
|
+
if (!chunkN7OHVHBS_js.hasShapeProperties(element)) {
|
|
5352
5392
|
return void 0;
|
|
5353
5393
|
}
|
|
5354
5394
|
const ss = element.shapeStyle;
|
|
@@ -5359,13 +5399,13 @@ function buildLineShadowCss(element) {
|
|
|
5359
5399
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
5360
5400
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
5361
5401
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
5362
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
5363
|
-
|
|
5402
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkXCLYIGHM_js.colorWithOpacity(
|
|
5403
|
+
chunkXCLYIGHM_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
5364
5404
|
opacity
|
|
5365
5405
|
)}`;
|
|
5366
5406
|
}
|
|
5367
5407
|
function buildLineGlowFilter(element) {
|
|
5368
|
-
if (!
|
|
5408
|
+
if (!chunkN7OHVHBS_js.hasShapeProperties(element)) {
|
|
5369
5409
|
return void 0;
|
|
5370
5410
|
}
|
|
5371
5411
|
const ss = element.shapeStyle;
|
|
@@ -5374,7 +5414,7 @@ function buildLineGlowFilter(element) {
|
|
|
5374
5414
|
}
|
|
5375
5415
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
5376
5416
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
5377
|
-
const glowCol =
|
|
5417
|
+
const glowCol = chunkXCLYIGHM_js.colorWithOpacity(chunkXCLYIGHM_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
5378
5418
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
5379
5419
|
}
|
|
5380
5420
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -5398,7 +5438,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
5398
5438
|
return `dag-duotone-${elementId}`;
|
|
5399
5439
|
}
|
|
5400
5440
|
function hasDagDuotoneEffect(element) {
|
|
5401
|
-
if (!
|
|
5441
|
+
if (!chunkN7OHVHBS_js.hasShapeProperties(element)) {
|
|
5402
5442
|
return false;
|
|
5403
5443
|
}
|
|
5404
5444
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -5461,7 +5501,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
5461
5501
|
|
|
5462
5502
|
// src/viewer/utils/shape-visual-3d.ts
|
|
5463
5503
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
5464
|
-
return
|
|
5504
|
+
return chunkXCLYIGHM_js.build3DExtrusionData(
|
|
5465
5505
|
shape3d,
|
|
5466
5506
|
scene3d,
|
|
5467
5507
|
fillColor,
|
|
@@ -5470,7 +5510,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
5470
5510
|
);
|
|
5471
5511
|
}
|
|
5472
5512
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
5473
|
-
|
|
5513
|
+
chunkXCLYIGHM_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
5474
5514
|
}
|
|
5475
5515
|
|
|
5476
5516
|
// src/viewer/utils/vector-subpath-paint.ts
|
|
@@ -5479,7 +5519,7 @@ function toHexByte(value) {
|
|
|
5479
5519
|
return clamped.toString(16).padStart(2, "0");
|
|
5480
5520
|
}
|
|
5481
5521
|
function shiftHex(hex, factor, towardsWhite) {
|
|
5482
|
-
const channels =
|
|
5522
|
+
const channels = chunkXCLYIGHM_js.hexToRgbChannels(hex);
|
|
5483
5523
|
if (!channels) {
|
|
5484
5524
|
return hex;
|
|
5485
5525
|
}
|
|
@@ -5505,13 +5545,13 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
5505
5545
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
5506
5546
|
return {
|
|
5507
5547
|
d: subpath.d,
|
|
5508
|
-
fill: fillOff ? "none" :
|
|
5548
|
+
fill: fillOff ? "none" : chunkXCLYIGHM_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
5509
5549
|
stroked: subpath.stroke !== false
|
|
5510
5550
|
};
|
|
5511
5551
|
});
|
|
5512
5552
|
}
|
|
5513
5553
|
function getStrokeOnlyPresetPaths(element) {
|
|
5514
|
-
if (element.type !== "shape" || !
|
|
5554
|
+
if (element.type !== "shape" || !chunkN7OHVHBS_js.hasShapeProperties(element)) {
|
|
5515
5555
|
return void 0;
|
|
5516
5556
|
}
|
|
5517
5557
|
const shapeType = element.shapeType;
|
|
@@ -5521,7 +5561,7 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
5521
5561
|
if (element.pathData) {
|
|
5522
5562
|
return void 0;
|
|
5523
5563
|
}
|
|
5524
|
-
const result =
|
|
5564
|
+
const result = chunkN7OHVHBS_js.evaluatePresetShape(
|
|
5525
5565
|
shapeType,
|
|
5526
5566
|
Math.max(element.width, 1),
|
|
5527
5567
|
Math.max(element.height, 1),
|
|
@@ -5536,27 +5576,27 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
5536
5576
|
|
|
5537
5577
|
// src/viewer/utils/shape-visual-style.ts
|
|
5538
5578
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
5539
|
-
if (!
|
|
5579
|
+
if (!chunkN7OHVHBS_js.hasShapeProperties(element)) {
|
|
5540
5580
|
return {};
|
|
5541
5581
|
}
|
|
5542
5582
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
5543
|
-
const clipPath =
|
|
5583
|
+
const clipPath = chunkXCLYIGHM_js.getResolvedShapeClipPath(element);
|
|
5544
5584
|
const rendersCustomVectorPath = (element.type === "shape" || element.type === "image" || element.type === "picture") && Boolean(element.pathData) && typeof element.pathWidth === "number" && element.pathWidth > 0 && typeof element.pathHeight === "number" && element.pathHeight > 0;
|
|
5545
5585
|
const rendersStrokeOnlyPreset = Boolean(getStrokeOnlyPresetPaths(element));
|
|
5546
5586
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
5547
5587
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
5548
|
-
const strokeDash =
|
|
5549
|
-
const fillGradient =
|
|
5550
|
-
const shadowCss =
|
|
5551
|
-
const innerShadowCss =
|
|
5552
|
-
const resolvedFillColor =
|
|
5553
|
-
const resolvedStrokeColor =
|
|
5588
|
+
const strokeDash = chunkXCLYIGHM_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
5589
|
+
const fillGradient = chunkXCLYIGHM_js.buildCssGradientFromShapeStyle(element.shapeStyle) || element.shapeStyle?.fillGradient;
|
|
5590
|
+
const shadowCss = chunkXCLYIGHM_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
5591
|
+
const innerShadowCss = chunkXCLYIGHM_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
5592
|
+
const resolvedFillColor = chunkXCLYIGHM_js.colorWithOpacity(fillColor, fillOpacity);
|
|
5593
|
+
const resolvedStrokeColor = chunkXCLYIGHM_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
5554
5594
|
const ss = element.shapeStyle;
|
|
5555
5595
|
const hasFillOverlayColor = Boolean(
|
|
5556
5596
|
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
5557
5597
|
);
|
|
5558
5598
|
const combinedShadowParts = [];
|
|
5559
|
-
const multiLayerShadow =
|
|
5599
|
+
const multiLayerShadow = chunkXCLYIGHM_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
5560
5600
|
if (multiLayerShadow) {
|
|
5561
5601
|
combinedShadowParts.push(multiLayerShadow);
|
|
5562
5602
|
} else if (shadowCss) {
|
|
@@ -5565,7 +5605,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5565
5605
|
if (innerShadowCss) {
|
|
5566
5606
|
combinedShadowParts.push(innerShadowCss);
|
|
5567
5607
|
}
|
|
5568
|
-
const glowBoxShadow =
|
|
5608
|
+
const glowBoxShadow = chunkXCLYIGHM_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
5569
5609
|
if (glowBoxShadow) {
|
|
5570
5610
|
combinedShadowParts.push(glowBoxShadow);
|
|
5571
5611
|
}
|
|
@@ -5573,7 +5613,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5573
5613
|
if (lineShadow) {
|
|
5574
5614
|
combinedShadowParts.push(lineShadow);
|
|
5575
5615
|
}
|
|
5576
|
-
const compoundLineShadow =
|
|
5616
|
+
const compoundLineShadow = chunkXCLYIGHM_js.getCompoundLineBoxShadow(
|
|
5577
5617
|
element.shapeStyle?.compoundLine,
|
|
5578
5618
|
strokeWidth,
|
|
5579
5619
|
resolvedStrokeColor
|
|
@@ -5586,11 +5626,11 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5586
5626
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
5587
5627
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
5588
5628
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
5589
|
-
const glowCol =
|
|
5629
|
+
const glowCol = chunkXCLYIGHM_js.colorWithOpacity(chunkXCLYIGHM_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
5590
5630
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
5591
5631
|
}
|
|
5592
5632
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
5593
|
-
filterParts.push(`url(#${
|
|
5633
|
+
filterParts.push(`url(#${chunkXCLYIGHM_js.getSoftEdgeFilterId(element.id)})`);
|
|
5594
5634
|
}
|
|
5595
5635
|
if (typeof ss?.blurRadius === "number" && ss.blurRadius > 0) {
|
|
5596
5636
|
filterParts.push(`blur(${Math.round(ss.blurRadius)}px)`);
|
|
@@ -5599,13 +5639,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5599
5639
|
if (lineGlowCss) {
|
|
5600
5640
|
filterParts.push(lineGlowCss);
|
|
5601
5641
|
}
|
|
5602
|
-
const dagFilter =
|
|
5642
|
+
const dagFilter = chunkXCLYIGHM_js.getEffectDagFilter(ss, element.id);
|
|
5603
5643
|
if (dagFilter) {
|
|
5604
5644
|
filterParts.push(dagFilter);
|
|
5605
5645
|
}
|
|
5606
5646
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : ss?.lineJoin === "miter" ? "miter" : void 0;
|
|
5607
5647
|
const miterLimitCss = ss?.lineJoin === "miter" && typeof ss?.miterLimit === "number" ? Math.max(ss.miterLimit / 1e5, 1) : void 0;
|
|
5608
|
-
const patternFill =
|
|
5648
|
+
const patternFill = chunkXCLYIGHM_js.buildPatternFillCss(element.shapeStyle);
|
|
5609
5649
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
5610
5650
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
5611
5651
|
let reflectCss;
|
|
@@ -5617,7 +5657,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5617
5657
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
5618
5658
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
5619
5659
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
5620
|
-
reflectCss =
|
|
5660
|
+
reflectCss = chunkXCLYIGHM_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
5621
5661
|
}
|
|
5622
5662
|
}
|
|
5623
5663
|
const base = {
|
|
@@ -5635,9 +5675,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5635
5675
|
// is present, `ShapeEffectOverlay` paints a separate blended tint layer so
|
|
5636
5676
|
// the colour is actually rendered (and text/children are not tinted).
|
|
5637
5677
|
mixBlendMode: hasFillOverlayColor ? void 0 : mapDagBlendModeToCss(ss?.dagFillOverlayBlend),
|
|
5638
|
-
borderWidth: strokeWidth > 0 ?
|
|
5678
|
+
borderWidth: strokeWidth > 0 ? chunkXCLYIGHM_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : void 0,
|
|
5639
5679
|
borderColor: strokeWidth > 0 ? resolvedStrokeColor : void 0,
|
|
5640
|
-
borderStyle: strokeWidth > 0 ?
|
|
5680
|
+
borderStyle: strokeWidth > 0 ? chunkXCLYIGHM_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
5641
5681
|
strokeLinejoin: lineJoinCss,
|
|
5642
5682
|
strokeMiterlimit: miterLimitCss,
|
|
5643
5683
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -5693,7 +5733,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5693
5733
|
borderWidth: 0,
|
|
5694
5734
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
5695
5735
|
borderTopColor: resolvedStrokeColor,
|
|
5696
|
-
borderTopStyle:
|
|
5736
|
+
borderTopStyle: chunkXCLYIGHM_js.getCssBorderDashStyle(strokeDash)
|
|
5697
5737
|
};
|
|
5698
5738
|
}
|
|
5699
5739
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -5707,13 +5747,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5707
5747
|
function getConnectorAdjustment(element, key, fallback) {
|
|
5708
5748
|
const direct = element.shapeAdjustments?.[key];
|
|
5709
5749
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
5710
|
-
return
|
|
5750
|
+
return chunkXCLYIGHM_js.clampUnitInterval(direct / 1e5);
|
|
5711
5751
|
}
|
|
5712
5752
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
5713
5753
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
5714
|
-
return
|
|
5754
|
+
return chunkXCLYIGHM_js.clampUnitInterval(fallbackKey / 1e5);
|
|
5715
5755
|
}
|
|
5716
|
-
return
|
|
5756
|
+
return chunkXCLYIGHM_js.clampUnitInterval(fallback);
|
|
5717
5757
|
}
|
|
5718
5758
|
function getConnectorPathGeometry(element) {
|
|
5719
5759
|
const width = Math.max(element.width, 1);
|
|
@@ -5850,11 +5890,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
5850
5890
|
strokePaint,
|
|
5851
5891
|
strokeWidth,
|
|
5852
5892
|
dashArray,
|
|
5853
|
-
lineCap:
|
|
5893
|
+
lineCap: chunkXCLYIGHM_js.svgLineCap(shapeStyle?.lineCap),
|
|
5854
5894
|
lineJoin,
|
|
5855
5895
|
miterLimit,
|
|
5856
|
-
offsets:
|
|
5857
|
-
widths:
|
|
5896
|
+
offsets: chunkXCLYIGHM_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
5897
|
+
widths: chunkXCLYIGHM_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
5858
5898
|
};
|
|
5859
5899
|
}
|
|
5860
5900
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -5912,7 +5952,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
5912
5952
|
) });
|
|
5913
5953
|
}
|
|
5914
5954
|
const customFillPaint = gradientId ? `url(#${gradientId})` : void 0;
|
|
5915
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
5955
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkN7OHVHBS_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
5916
5956
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
5917
5957
|
const nodes = [];
|
|
5918
5958
|
if (subpaths && needsPerSubpath) {
|
|
@@ -5943,7 +5983,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
5943
5983
|
"path",
|
|
5944
5984
|
{
|
|
5945
5985
|
d: pathData,
|
|
5946
|
-
fill: animatesFill ? "inherit" : customFillPaint ??
|
|
5986
|
+
fill: animatesFill ? "inherit" : customFillPaint ?? chunkXCLYIGHM_js.colorWithOpacity(fillColor, fillOpacity),
|
|
5947
5987
|
stroke: "none",
|
|
5948
5988
|
vectorEffect: "non-scaling-stroke"
|
|
5949
5989
|
},
|
|
@@ -5988,14 +6028,14 @@ function renderStrokeOnlyPreset(presetPaths, width, height, shapeStyle, strokePa
|
|
|
5988
6028
|
);
|
|
5989
6029
|
}
|
|
5990
6030
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
5991
|
-
if (!
|
|
6031
|
+
if (!chunkN7OHVHBS_js.hasShapeProperties(element)) {
|
|
5992
6032
|
return null;
|
|
5993
6033
|
}
|
|
5994
6034
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
5995
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
5996
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
5997
|
-
const dashType =
|
|
5998
|
-
const dashArray =
|
|
6035
|
+
const fillPaint = animatesFill ? "inherit" : chunkXCLYIGHM_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
6036
|
+
const strokePaint = animatesStroke ? "inherit" : chunkXCLYIGHM_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
6037
|
+
const dashType = chunkXCLYIGHM_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
6038
|
+
const dashArray = chunkXCLYIGHM_js.getSvgStrokeDasharray(
|
|
5999
6039
|
dashType,
|
|
6000
6040
|
Math.max(strokeWidth, 1),
|
|
6001
6041
|
element.shapeStyle?.customDashSegments
|
|
@@ -6074,18 +6114,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
6074
6114
|
Boolean(animatesFill)
|
|
6075
6115
|
);
|
|
6076
6116
|
}
|
|
6077
|
-
if (
|
|
6117
|
+
if (chunkN7OHVHBS_js.isCalloutShape(normalizedType)) {
|
|
6078
6118
|
const width = Math.max(element.width, 1);
|
|
6079
6119
|
const height = Math.max(element.height, 1);
|
|
6080
|
-
const geometry =
|
|
6120
|
+
const geometry = chunkN7OHVHBS_js.getCalloutLeaderLineGeometry(
|
|
6081
6121
|
normalizedType,
|
|
6082
6122
|
width,
|
|
6083
6123
|
height,
|
|
6084
6124
|
element.shapeAdjustments
|
|
6085
6125
|
);
|
|
6086
6126
|
if (geometry && geometry.points.length >= 2) {
|
|
6087
|
-
const leaderPath =
|
|
6088
|
-
const bounds =
|
|
6127
|
+
const leaderPath = chunkN7OHVHBS_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
6128
|
+
const bounds = chunkN7OHVHBS_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
6089
6129
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
6090
6130
|
const offsetLeft = bounds.minX;
|
|
6091
6131
|
const offsetTop = bounds.minY;
|
|
@@ -6148,10 +6188,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
6148
6188
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
6149
6189
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
6150
6190
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
6151
|
-
const connectorLineCap =
|
|
6191
|
+
const connectorLineCap = chunkXCLYIGHM_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
6152
6192
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
6153
|
-
const offsets =
|
|
6154
|
-
const widths =
|
|
6193
|
+
const offsets = chunkXCLYIGHM_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
6194
|
+
const widths = chunkXCLYIGHM_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
6155
6195
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6156
6196
|
"svg",
|
|
6157
6197
|
{
|
|
@@ -6217,7 +6257,7 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
6217
6257
|
|
|
6218
6258
|
// src/viewer/utils/image-style.ts
|
|
6219
6259
|
function getImageMaskStyle(element) {
|
|
6220
|
-
if (!
|
|
6260
|
+
if (!chunkN7OHVHBS_js.hasShapeProperties(element)) {
|
|
6221
6261
|
return void 0;
|
|
6222
6262
|
}
|
|
6223
6263
|
const shapeType = element.shapeType;
|
|
@@ -6226,7 +6266,7 @@ function getImageMaskStyle(element) {
|
|
|
6226
6266
|
}
|
|
6227
6267
|
const normalized = shapeType.toLowerCase();
|
|
6228
6268
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
6229
|
-
const radiusPx =
|
|
6269
|
+
const radiusPx = chunkXCLYIGHM_js.getRoundRectRadiusPx(element);
|
|
6230
6270
|
if (radiusPx <= 0.01) {
|
|
6231
6271
|
return void 0;
|
|
6232
6272
|
}
|
|
@@ -6238,7 +6278,7 @@ function getImageMaskStyle(element) {
|
|
|
6238
6278
|
if (normalized === "can" || normalized === "cylinder") {
|
|
6239
6279
|
return { borderRadius: "48% / 12%" };
|
|
6240
6280
|
}
|
|
6241
|
-
const clipPath =
|
|
6281
|
+
const clipPath = chunkXCLYIGHM_js.getResolvedShapeClipPath(element);
|
|
6242
6282
|
if (!clipPath) {
|
|
6243
6283
|
return void 0;
|
|
6244
6284
|
}
|
|
@@ -6246,7 +6286,7 @@ function getImageMaskStyle(element) {
|
|
|
6246
6286
|
}
|
|
6247
6287
|
function getImageRenderStyle(element) {
|
|
6248
6288
|
const maskStyle = getImageMaskStyle(element) || {};
|
|
6249
|
-
if (!
|
|
6289
|
+
if (!chunkN7OHVHBS_js.isImageLikeElement(element)) {
|
|
6250
6290
|
return {
|
|
6251
6291
|
...maskStyle,
|
|
6252
6292
|
width: "100%",
|
|
@@ -6254,25 +6294,29 @@ function getImageRenderStyle(element) {
|
|
|
6254
6294
|
objectFit: "cover"
|
|
6255
6295
|
};
|
|
6256
6296
|
}
|
|
6257
|
-
const cropLeft =
|
|
6258
|
-
const cropTop =
|
|
6259
|
-
const cropRight =
|
|
6260
|
-
const cropBottom =
|
|
6297
|
+
const cropLeft = chunkXCLYIGHM_js.clampCropValue(element.cropLeft);
|
|
6298
|
+
const cropTop = chunkXCLYIGHM_js.clampCropValue(element.cropTop);
|
|
6299
|
+
const cropRight = chunkXCLYIGHM_js.clampCropValue(element.cropRight);
|
|
6300
|
+
const cropBottom = chunkXCLYIGHM_js.clampCropValue(element.cropBottom);
|
|
6261
6301
|
const hasCrop = cropLeft + cropRight > 1e-4 || cropTop + cropBottom > 1e-4;
|
|
6262
6302
|
if (!hasCrop) {
|
|
6263
6303
|
return {
|
|
6264
6304
|
...maskStyle,
|
|
6265
6305
|
width: "100%",
|
|
6266
6306
|
height: "100%",
|
|
6267
|
-
|
|
6307
|
+
// DrawingML's default `a:stretch/a:fillRect` maps the complete bitmap
|
|
6308
|
+
// into the picture frame. Cropping is represented explicitly by
|
|
6309
|
+
// `a:srcRect`; using CSS `cover` here introduced an extra implicit crop
|
|
6310
|
+
// whenever the frame and bitmap aspect ratios differed slightly.
|
|
6311
|
+
objectFit: "fill"
|
|
6268
6312
|
};
|
|
6269
6313
|
}
|
|
6270
6314
|
const safeHorizontalScale = cropLeft + cropRight >= 0.99 ? 0.99 / (cropLeft + cropRight) : 1;
|
|
6271
6315
|
const safeVerticalScale = cropTop + cropBottom >= 0.99 ? 0.99 / (cropTop + cropBottom) : 1;
|
|
6272
|
-
const normalizedLeft =
|
|
6273
|
-
const normalizedRight =
|
|
6274
|
-
const normalizedTop =
|
|
6275
|
-
const normalizedBottom =
|
|
6316
|
+
const normalizedLeft = chunkXCLYIGHM_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
6317
|
+
const normalizedRight = chunkXCLYIGHM_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
6318
|
+
const normalizedTop = chunkXCLYIGHM_js.clampCropValue(cropTop * safeVerticalScale);
|
|
6319
|
+
const normalizedBottom = chunkXCLYIGHM_js.clampCropValue(cropBottom * safeVerticalScale);
|
|
6276
6320
|
const remainingWidth = Math.max(0.01, 1 - normalizedLeft - normalizedRight);
|
|
6277
6321
|
const remainingHeight = Math.max(0.01, 1 - normalizedTop - normalizedBottom);
|
|
6278
6322
|
const tx = Math.round(-normalizedLeft / remainingWidth * 1e4) / 100;
|
|
@@ -6301,7 +6345,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
6301
6345
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
6302
6346
|
};
|
|
6303
6347
|
function getCropShapeClipPath(element) {
|
|
6304
|
-
if (!
|
|
6348
|
+
if (!chunkN7OHVHBS_js.isImageLikeElement(element)) {
|
|
6305
6349
|
return void 0;
|
|
6306
6350
|
}
|
|
6307
6351
|
const shape = element.cropShape;
|
|
@@ -6311,7 +6355,7 @@ function getCropShapeClipPath(element) {
|
|
|
6311
6355
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
6312
6356
|
}
|
|
6313
6357
|
function isImageTiled(element) {
|
|
6314
|
-
if (!
|
|
6358
|
+
if (!chunkN7OHVHBS_js.isImageLikeElement(element)) {
|
|
6315
6359
|
return false;
|
|
6316
6360
|
}
|
|
6317
6361
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -6369,7 +6413,7 @@ function buildMirrorTiledBackground(src, flip, scaleX, scaleY) {
|
|
|
6369
6413
|
};
|
|
6370
6414
|
}
|
|
6371
6415
|
function getImageTilingStyle(element) {
|
|
6372
|
-
if (!
|
|
6416
|
+
if (!chunkN7OHVHBS_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
6373
6417
|
return void 0;
|
|
6374
6418
|
}
|
|
6375
6419
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -6443,9 +6487,9 @@ function parseGradientFillCss(gradFill) {
|
|
|
6443
6487
|
}
|
|
6444
6488
|
const parsed = stops.map((gs) => {
|
|
6445
6489
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
6446
|
-
const color =
|
|
6447
|
-
const opacity =
|
|
6448
|
-
return { pos, color:
|
|
6490
|
+
const color = chunkXCLYIGHM_js.parseDrawingColor(gs) ?? "#888888";
|
|
6491
|
+
const opacity = chunkXCLYIGHM_js.parseDrawingColorOpacity(gs);
|
|
6492
|
+
return { pos, color: chunkXCLYIGHM_js.colorWithOpacity(color, opacity) };
|
|
6449
6493
|
}).sort((a, b) => a.pos - b.pos);
|
|
6450
6494
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
6451
6495
|
const lin = gradFill["a:lin"];
|
|
@@ -6486,8 +6530,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
6486
6530
|
if (!pattFill) {
|
|
6487
6531
|
return void 0;
|
|
6488
6532
|
}
|
|
6489
|
-
const fgColor =
|
|
6490
|
-
const bgColor =
|
|
6533
|
+
const fgColor = chunkXCLYIGHM_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
6534
|
+
const bgColor = chunkXCLYIGHM_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
6491
6535
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
6492
6536
|
switch (preset) {
|
|
6493
6537
|
case "ltHorz":
|
|
@@ -6598,11 +6642,11 @@ function parseCellBorders(cellProperties) {
|
|
|
6598
6642
|
const prstDash = ln["a:prstDash"];
|
|
6599
6643
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
6600
6644
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
6601
|
-
const color =
|
|
6645
|
+
const color = chunkXCLYIGHM_js.parseDrawingColor(ln["a:solidFill"]);
|
|
6602
6646
|
if (color) {
|
|
6603
|
-
const opacity =
|
|
6647
|
+
const opacity = chunkXCLYIGHM_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
6604
6648
|
const key = `${edge.prefix}`;
|
|
6605
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
6649
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkXCLYIGHM_js.colorWithOpacity(color, opacity)}`;
|
|
6606
6650
|
}
|
|
6607
6651
|
}
|
|
6608
6652
|
return borderStyle;
|
|
@@ -6615,7 +6659,7 @@ function parseCellTextEffects(runProps) {
|
|
|
6615
6659
|
const textShadowParts = [];
|
|
6616
6660
|
const outerShdw = effectLst["a:outerShdw"];
|
|
6617
6661
|
if (outerShdw) {
|
|
6618
|
-
const shdwColor =
|
|
6662
|
+
const shdwColor = chunkXCLYIGHM_js.parseDrawingColor(outerShdw);
|
|
6619
6663
|
if (shdwColor) {
|
|
6620
6664
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
6621
6665
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -6633,7 +6677,7 @@ function parseCellTextEffects(runProps) {
|
|
|
6633
6677
|
}
|
|
6634
6678
|
const glow = effectLst["a:glow"];
|
|
6635
6679
|
if (glow) {
|
|
6636
|
-
const glowColor =
|
|
6680
|
+
const glowColor = chunkXCLYIGHM_js.parseDrawingColor(glow);
|
|
6637
6681
|
if (glowColor) {
|
|
6638
6682
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
6639
6683
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -6712,10 +6756,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
6712
6756
|
if (runProps?.["@_u"] !== void 0) {
|
|
6713
6757
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
6714
6758
|
}
|
|
6715
|
-
const runColor =
|
|
6759
|
+
const runColor = chunkXCLYIGHM_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkXCLYIGHM_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
6716
6760
|
if (runColor) {
|
|
6717
|
-
const opacity =
|
|
6718
|
-
cellStyle.color =
|
|
6761
|
+
const opacity = chunkXCLYIGHM_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
6762
|
+
cellStyle.color = chunkXCLYIGHM_js.colorWithOpacity(runColor, opacity);
|
|
6719
6763
|
}
|
|
6720
6764
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
6721
6765
|
if (fontFamily) {
|
|
@@ -6725,15 +6769,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
6725
6769
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
6726
6770
|
}
|
|
6727
6771
|
const cellProperties = cellXml["a:tcPr"];
|
|
6728
|
-
const cellFill =
|
|
6772
|
+
const cellFill = chunkXCLYIGHM_js.parseDrawingColor(
|
|
6729
6773
|
cellProperties?.["a:solidFill"],
|
|
6730
6774
|
schemeColorOverrides
|
|
6731
6775
|
);
|
|
6732
6776
|
if (cellFill) {
|
|
6733
|
-
const opacity =
|
|
6777
|
+
const opacity = chunkXCLYIGHM_js.parseDrawingColorOpacity(
|
|
6734
6778
|
cellProperties?.["a:solidFill"]
|
|
6735
6779
|
);
|
|
6736
|
-
cellStyle.backgroundColor =
|
|
6780
|
+
cellStyle.backgroundColor = chunkXCLYIGHM_js.colorWithOpacity(cellFill, opacity);
|
|
6737
6781
|
} else {
|
|
6738
6782
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
6739
6783
|
if (gradCss) {
|
|
@@ -6748,16 +6792,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
6748
6792
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
6749
6793
|
Object.assign(cellStyle, edgeBorders);
|
|
6750
6794
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
6751
|
-
const borderColor =
|
|
6795
|
+
const borderColor = chunkXCLYIGHM_js.parseDrawingColor(
|
|
6752
6796
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
6753
6797
|
schemeColorOverrides
|
|
6754
|
-
) ||
|
|
6798
|
+
) || chunkXCLYIGHM_js.parseDrawingColor(
|
|
6755
6799
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
6756
6800
|
schemeColorOverrides
|
|
6757
|
-
) ||
|
|
6801
|
+
) || chunkXCLYIGHM_js.parseDrawingColor(
|
|
6758
6802
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
6759
6803
|
schemeColorOverrides
|
|
6760
|
-
) ||
|
|
6804
|
+
) || chunkXCLYIGHM_js.parseDrawingColor(
|
|
6761
6805
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
6762
6806
|
schemeColorOverrides
|
|
6763
6807
|
);
|
|
@@ -6836,10 +6880,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
6836
6880
|
}
|
|
6837
6881
|
let color = base;
|
|
6838
6882
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
6839
|
-
color =
|
|
6883
|
+
color = chunkXCLYIGHM_js.tintColor2(color, fill.tint / 1e5);
|
|
6840
6884
|
}
|
|
6841
6885
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
6842
|
-
color =
|
|
6886
|
+
color = chunkXCLYIGHM_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
6843
6887
|
}
|
|
6844
6888
|
return color;
|
|
6845
6889
|
}
|
|
@@ -6864,7 +6908,7 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
6864
6908
|
style.fontFamily = text.fontFace;
|
|
6865
6909
|
applied = true;
|
|
6866
6910
|
} else {
|
|
6867
|
-
const refFont =
|
|
6911
|
+
const refFont = chunkXCLYIGHM_js.resolveFontRefIdx(text.fontRefIdx, fontScheme);
|
|
6868
6912
|
if (refFont) {
|
|
6869
6913
|
style.fontFamily = refFont;
|
|
6870
6914
|
applied = true;
|
|
@@ -6875,10 +6919,10 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
6875
6919
|
if (base) {
|
|
6876
6920
|
let color = base;
|
|
6877
6921
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
6878
|
-
color =
|
|
6922
|
+
color = chunkXCLYIGHM_js.tintColor2(color, text.fontTint / 1e5);
|
|
6879
6923
|
}
|
|
6880
6924
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
6881
|
-
color =
|
|
6925
|
+
color = chunkXCLYIGHM_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
6882
6926
|
}
|
|
6883
6927
|
style.color = color;
|
|
6884
6928
|
applied = true;
|
|
@@ -7070,7 +7114,7 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
7070
7114
|
};
|
|
7071
7115
|
}
|
|
7072
7116
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
7073
|
-
return
|
|
7117
|
+
return chunkXCLYIGHM_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
7074
7118
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
7075
7119
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
7076
7120
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -7218,9 +7262,9 @@ function cellStyleToCss(style) {
|
|
|
7218
7262
|
if (style.gradientFillCss) {
|
|
7219
7263
|
css.background = style.gradientFillCss;
|
|
7220
7264
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
7221
|
-
const fg =
|
|
7222
|
-
const bg =
|
|
7223
|
-
const svgPattern =
|
|
7265
|
+
const fg = chunkXCLYIGHM_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
7266
|
+
const bg = chunkXCLYIGHM_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
7267
|
+
const svgPattern = chunkXCLYIGHM_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
7224
7268
|
if (svgPattern) {
|
|
7225
7269
|
const encoded = encodeURIComponent(svgPattern);
|
|
7226
7270
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -7296,7 +7340,7 @@ function cellStyleToCss(style) {
|
|
|
7296
7340
|
if (edge.width || edge.color) {
|
|
7297
7341
|
const w = edge.width ?? 1;
|
|
7298
7342
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
7299
|
-
const s =
|
|
7343
|
+
const s = chunkXCLYIGHM_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
7300
7344
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
7301
7345
|
}
|
|
7302
7346
|
}
|
|
@@ -7327,7 +7371,7 @@ function cellStyleToCss(style) {
|
|
|
7327
7371
|
css.textShadow = textShadowParts.join(", ");
|
|
7328
7372
|
}
|
|
7329
7373
|
if (style.cell3D) {
|
|
7330
|
-
Object.assign(css,
|
|
7374
|
+
Object.assign(css, chunkXCLYIGHM_js.cell3DBevelCss(style.cell3D));
|
|
7331
7375
|
}
|
|
7332
7376
|
return css;
|
|
7333
7377
|
}
|
|
@@ -7341,7 +7385,7 @@ function TableResizeOverlay({
|
|
|
7341
7385
|
const containerRef = React4.useRef(null);
|
|
7342
7386
|
const [rowBounds, setRowBounds] = React4.useState([]);
|
|
7343
7387
|
const dragRef = React4.useRef(null);
|
|
7344
|
-
const colBoundaries = React4.useMemo(() =>
|
|
7388
|
+
const colBoundaries = React4.useMemo(() => chunkXCLYIGHM_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
7345
7389
|
const measureRows = React4.useCallback(() => {
|
|
7346
7390
|
const container = containerRef.current;
|
|
7347
7391
|
if (!container) {
|
|
@@ -7388,11 +7432,11 @@ function TableResizeOverlay({
|
|
|
7388
7432
|
const rect = containerRef.current.getBoundingClientRect();
|
|
7389
7433
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
7390
7434
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
7391
|
-
onResizeColumns(
|
|
7435
|
+
onResizeColumns(chunkXCLYIGHM_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
7392
7436
|
} else if (drag.type === "row" && onResizeRow) {
|
|
7393
7437
|
const deltaY = e.clientY - drag.startPos;
|
|
7394
|
-
const newHeight =
|
|
7395
|
-
drag.initialRowHeight ??
|
|
7438
|
+
const newHeight = chunkXCLYIGHM_js.computeResizedRowHeight(
|
|
7439
|
+
drag.initialRowHeight ?? chunkXCLYIGHM_js.DEFAULT_ROW_HEIGHT,
|
|
7396
7440
|
deltaY
|
|
7397
7441
|
);
|
|
7398
7442
|
onResizeRow(drag.index, newHeight);
|
|
@@ -7430,7 +7474,7 @@ function TableResizeOverlay({
|
|
|
7430
7474
|
e.stopPropagation();
|
|
7431
7475
|
const table = containerRef.current?.querySelector("table");
|
|
7432
7476
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
7433
|
-
const actualHeight = tr?.offsetHeight ??
|
|
7477
|
+
const actualHeight = tr?.offsetHeight ?? chunkXCLYIGHM_js.DEFAULT_ROW_HEIGHT;
|
|
7434
7478
|
document.body.style.cursor = "row-resize";
|
|
7435
7479
|
document.body.style.userSelect = "none";
|
|
7436
7480
|
dragRef.current = {
|
|
@@ -7478,7 +7522,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
7478
7522
|
}
|
|
7479
7523
|
const first = selectedCell.selectedCells[0];
|
|
7480
7524
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
7481
|
-
return
|
|
7525
|
+
return chunkXCLYIGHM_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
7482
7526
|
})();
|
|
7483
7527
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7484
7528
|
TableResizeOverlay,
|
|
@@ -7491,7 +7535,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
7491
7535
|
"div",
|
|
7492
7536
|
{
|
|
7493
7537
|
className: cn(
|
|
7494
|
-
"w-full h-full overflow-
|
|
7538
|
+
"w-full h-full overflow-visible",
|
|
7495
7539
|
isEditable2 && hasCellSelectionHandler ? "pointer-events-auto" : "pointer-events-none"
|
|
7496
7540
|
),
|
|
7497
7541
|
children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full h-full border-collapse table-fixed", children: [
|
|
@@ -7511,7 +7555,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
7511
7555
|
return null;
|
|
7512
7556
|
}
|
|
7513
7557
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
7514
|
-
const isInMultiSelection =
|
|
7558
|
+
const isInMultiSelection = chunkXCLYIGHM_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
7515
7559
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
7516
7560
|
const diag = getCellDiagonalBorders2(
|
|
7517
7561
|
cell.style,
|
|
@@ -7541,7 +7585,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
7541
7585
|
}
|
|
7542
7586
|
event.stopPropagation();
|
|
7543
7587
|
if (event.shiftKey && selectedCell) {
|
|
7544
|
-
const rect =
|
|
7588
|
+
const rect = chunkXCLYIGHM_js.computeSelectionRect(
|
|
7545
7589
|
selectedCell.rowIndex,
|
|
7546
7590
|
selectedCell.columnIndex,
|
|
7547
7591
|
rowIndex,
|
|
@@ -7551,7 +7595,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
7551
7595
|
options?.onSelectCell?.({
|
|
7552
7596
|
rowIndex: selectedCell.rowIndex,
|
|
7553
7597
|
columnIndex: selectedCell.columnIndex,
|
|
7554
|
-
selectedCells:
|
|
7598
|
+
selectedCells: chunkXCLYIGHM_js.rectToCells(rect)
|
|
7555
7599
|
});
|
|
7556
7600
|
} else {
|
|
7557
7601
|
options?.onSelectCell?.({
|
|
@@ -7628,7 +7672,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7628
7672
|
}
|
|
7629
7673
|
const first = selectedCell.selectedCells[0];
|
|
7630
7674
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
7631
|
-
return
|
|
7675
|
+
return chunkXCLYIGHM_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
7632
7676
|
})();
|
|
7633
7677
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
7634
7678
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7642,7 +7686,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7642
7686
|
"div",
|
|
7643
7687
|
{
|
|
7644
7688
|
className: cn(
|
|
7645
|
-
"w-full h-full overflow-
|
|
7689
|
+
"w-full h-full overflow-visible",
|
|
7646
7690
|
isEditable2 && hasCellSelectionHandler ? "pointer-events-auto" : "pointer-events-none"
|
|
7647
7691
|
),
|
|
7648
7692
|
children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full h-full border-collapse table-fixed", children: [
|
|
@@ -7705,7 +7749,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7705
7749
|
"border px-1 py-0.5 align-top",
|
|
7706
7750
|
isEditable2 && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
7707
7751
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
7708
|
-
|
|
7752
|
+
chunkXCLYIGHM_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
7709
7753
|
),
|
|
7710
7754
|
colSpan,
|
|
7711
7755
|
rowSpan: rSpan,
|
|
@@ -7716,7 +7760,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7716
7760
|
}
|
|
7717
7761
|
event.stopPropagation();
|
|
7718
7762
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
7719
|
-
const rect =
|
|
7763
|
+
const rect = chunkXCLYIGHM_js.computeSelectionRect(
|
|
7720
7764
|
selectedCell.rowIndex,
|
|
7721
7765
|
selectedCell.columnIndex,
|
|
7722
7766
|
rowIndex,
|
|
@@ -7726,7 +7770,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7726
7770
|
options?.onSelectCell?.({
|
|
7727
7771
|
rowIndex: selectedCell.rowIndex,
|
|
7728
7772
|
columnIndex: selectedCell.columnIndex,
|
|
7729
|
-
selectedCells:
|
|
7773
|
+
selectedCells: chunkXCLYIGHM_js.rectToCells(rect)
|
|
7730
7774
|
});
|
|
7731
7775
|
} else {
|
|
7732
7776
|
options?.onSelectCell?.({
|
|
@@ -7781,24 +7825,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7781
7825
|
}
|
|
7782
7826
|
var LEGEND_ITEM_WIDTH = 80;
|
|
7783
7827
|
function partAttrs(part) {
|
|
7784
|
-
return part ?
|
|
7828
|
+
return part ? chunkXCLYIGHM_js.chartPartToAttrs(part) : void 0;
|
|
7785
7829
|
}
|
|
7786
7830
|
function resolveReactPalette(chartData) {
|
|
7787
7831
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
7788
7832
|
return chartData.colorPalette;
|
|
7789
7833
|
}
|
|
7790
|
-
return [...
|
|
7834
|
+
return [...chunkXCLYIGHM_js.getChartStylePalette(chartData.style?.styleId)];
|
|
7791
7835
|
}
|
|
7792
7836
|
function buildReactChartViewModel(element) {
|
|
7793
7837
|
if (element.type !== "chart" || !element.chartData) {
|
|
7794
|
-
return
|
|
7838
|
+
return chunkXCLYIGHM_js.buildChartViewModel(element);
|
|
7795
7839
|
}
|
|
7796
7840
|
const palette = resolveReactPalette(element.chartData);
|
|
7797
7841
|
const themedElement = {
|
|
7798
7842
|
...element,
|
|
7799
7843
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
7800
7844
|
};
|
|
7801
|
-
return
|
|
7845
|
+
return chunkXCLYIGHM_js.buildChartViewModel(themedElement);
|
|
7802
7846
|
}
|
|
7803
7847
|
function renderPrimitive(prim, key) {
|
|
7804
7848
|
switch (prim.kind) {
|
|
@@ -8187,7 +8231,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8187
8231
|
const unmatchedRows = [];
|
|
8188
8232
|
categories.forEach((cat, i) => {
|
|
8189
8233
|
const value = values[i] ?? 0;
|
|
8190
|
-
const code =
|
|
8234
|
+
const code = chunkXCLYIGHM_js.resolveRegionCode(cat);
|
|
8191
8235
|
if (code) {
|
|
8192
8236
|
regionValueMap.set(code, { value, label: cat });
|
|
8193
8237
|
} else {
|
|
@@ -8225,8 +8269,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8225
8269
|
let fill = "#e2e8f0";
|
|
8226
8270
|
let dataLabel = null;
|
|
8227
8271
|
if (entry) {
|
|
8228
|
-
const t =
|
|
8229
|
-
fill =
|
|
8272
|
+
const t = chunkXCLYIGHM_js.normalizeValue(entry.value, minVal, maxVal);
|
|
8273
|
+
fill = chunkXCLYIGHM_js.sequentialColorScale(t);
|
|
8230
8274
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
8231
8275
|
"text",
|
|
8232
8276
|
{
|
|
@@ -8237,7 +8281,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8237
8281
|
fontWeight: 600,
|
|
8238
8282
|
fill: "#1e293b",
|
|
8239
8283
|
style: { pointerEvents: "none" },
|
|
8240
|
-
children:
|
|
8284
|
+
children: chunkXCLYIGHM_js.formatAxisValue(entry.value)
|
|
8241
8285
|
},
|
|
8242
8286
|
`${element.id}-map-dl-${region.code}`
|
|
8243
8287
|
);
|
|
@@ -8255,7 +8299,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8255
8299
|
opacity: 0.9,
|
|
8256
8300
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
8257
8301
|
region.name,
|
|
8258
|
-
entry ? `: ${
|
|
8302
|
+
entry ? `: ${chunkXCLYIGHM_js.formatAxisValue(entry.value)}` : ""
|
|
8259
8303
|
] })
|
|
8260
8304
|
}
|
|
8261
8305
|
),
|
|
@@ -8293,7 +8337,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8293
8337
|
fontSize: 7,
|
|
8294
8338
|
fill: "#64748b",
|
|
8295
8339
|
textAnchor: "middle",
|
|
8296
|
-
children:
|
|
8340
|
+
children: chunkXCLYIGHM_js.formatAxisValue(minVal)
|
|
8297
8341
|
},
|
|
8298
8342
|
`${element.id}-map-legend-min`
|
|
8299
8343
|
),
|
|
@@ -8305,7 +8349,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8305
8349
|
fontSize: 7,
|
|
8306
8350
|
fill: "#64748b",
|
|
8307
8351
|
textAnchor: "middle",
|
|
8308
|
-
children:
|
|
8352
|
+
children: chunkXCLYIGHM_js.formatAxisValue(maxVal)
|
|
8309
8353
|
},
|
|
8310
8354
|
`${element.id}-map-legend-max`
|
|
8311
8355
|
)
|
|
@@ -8371,7 +8415,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8371
8415
|
y,
|
|
8372
8416
|
fontSize,
|
|
8373
8417
|
fill: "#475569",
|
|
8374
|
-
children:
|
|
8418
|
+
children: chunkXCLYIGHM_js.formatAxisValue(row.value)
|
|
8375
8419
|
},
|
|
8376
8420
|
`${element.id}-map-ft-val-${i}`
|
|
8377
8421
|
)
|
|
@@ -8442,7 +8486,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
8442
8486
|
|
|
8443
8487
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
8444
8488
|
function sColor(series, idx) {
|
|
8445
|
-
return
|
|
8489
|
+
return chunkXCLYIGHM_js.seriesColor(series, idx);
|
|
8446
8490
|
}
|
|
8447
8491
|
function valToY(val, range, topY, bottomY) {
|
|
8448
8492
|
const usable = bottomY - topY;
|
|
@@ -8981,7 +9025,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
8981
9025
|
width: 10,
|
|
8982
9026
|
height: 10,
|
|
8983
9027
|
rx: 2,
|
|
8984
|
-
fill:
|
|
9028
|
+
fill: chunkXCLYIGHM_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
8985
9029
|
},
|
|
8986
9030
|
`${id}-leg-r-${i}`
|
|
8987
9031
|
)
|
|
@@ -9005,7 +9049,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
9005
9049
|
width: 10,
|
|
9006
9050
|
height: 10,
|
|
9007
9051
|
rx: 2,
|
|
9008
|
-
fill:
|
|
9052
|
+
fill: chunkXCLYIGHM_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
9009
9053
|
}
|
|
9010
9054
|
),
|
|
9011
9055
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -9018,9 +9062,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
9018
9062
|
}
|
|
9019
9063
|
const lines = [];
|
|
9020
9064
|
if (range.logScale && range.logBase) {
|
|
9021
|
-
const ticks =
|
|
9065
|
+
const ticks = chunkXCLYIGHM_js.generateLogTicks(range);
|
|
9022
9066
|
ticks.forEach((tickVal, i) => {
|
|
9023
|
-
const y =
|
|
9067
|
+
const y = chunkXCLYIGHM_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
9024
9068
|
lines.push(
|
|
9025
9069
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9026
9070
|
"line",
|
|
@@ -9041,7 +9085,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
9041
9085
|
const steps = 4;
|
|
9042
9086
|
for (let i = 0; i <= steps; i++) {
|
|
9043
9087
|
const val = range.min + range.span * i / steps;
|
|
9044
|
-
const y =
|
|
9088
|
+
const y = chunkXCLYIGHM_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
9045
9089
|
lines.push(
|
|
9046
9090
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9047
9091
|
"line",
|
|
@@ -9065,9 +9109,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9065
9109
|
const labels = [];
|
|
9066
9110
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
9067
9111
|
if (range.logScale && range.logBase) {
|
|
9068
|
-
const ticks =
|
|
9112
|
+
const ticks = chunkXCLYIGHM_js.generateLogTicks(range);
|
|
9069
9113
|
ticks.forEach((tickVal, i) => {
|
|
9070
|
-
const y =
|
|
9114
|
+
const y = chunkXCLYIGHM_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
9071
9115
|
labels.push(
|
|
9072
9116
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9073
9117
|
"text",
|
|
@@ -9077,7 +9121,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9077
9121
|
textAnchor: "end",
|
|
9078
9122
|
fontSize: 8,
|
|
9079
9123
|
fill: "#64748b",
|
|
9080
|
-
children: hasDisplayUnits ?
|
|
9124
|
+
children: hasDisplayUnits ? chunkXCLYIGHM_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkXCLYIGHM_js.formatAxisValue(tickVal)
|
|
9081
9125
|
},
|
|
9082
9126
|
`${id}-vaxis-log-${i}`
|
|
9083
9127
|
)
|
|
@@ -9087,7 +9131,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9087
9131
|
const steps = 4;
|
|
9088
9132
|
for (let i = 0; i <= steps; i++) {
|
|
9089
9133
|
const val = range.min + range.span * i / steps;
|
|
9090
|
-
const y =
|
|
9134
|
+
const y = chunkXCLYIGHM_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
9091
9135
|
labels.push(
|
|
9092
9136
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9093
9137
|
"text",
|
|
@@ -9097,7 +9141,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9097
9141
|
textAnchor: "end",
|
|
9098
9142
|
fontSize: 8,
|
|
9099
9143
|
fill: "#64748b",
|
|
9100
|
-
children: hasDisplayUnits ?
|
|
9144
|
+
children: hasDisplayUnits ? chunkXCLYIGHM_js.formatAxisValueWithUnits(val, axisFormatting) : chunkXCLYIGHM_js.formatAxisValue(val)
|
|
9101
9145
|
},
|
|
9102
9146
|
`${id}-vaxis-${i}`
|
|
9103
9147
|
)
|
|
@@ -9105,7 +9149,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9105
9149
|
}
|
|
9106
9150
|
}
|
|
9107
9151
|
if (hasDisplayUnits) {
|
|
9108
|
-
const unitLabel =
|
|
9152
|
+
const unitLabel = chunkXCLYIGHM_js.getDisplayUnitLabel(
|
|
9109
9153
|
axisFormatting.displayUnits,
|
|
9110
9154
|
axisFormatting.displayUnitsLabel
|
|
9111
9155
|
);
|
|
@@ -9180,7 +9224,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
9180
9224
|
if (range.min >= 0) {
|
|
9181
9225
|
return null;
|
|
9182
9226
|
}
|
|
9183
|
-
const y =
|
|
9227
|
+
const y = chunkXCLYIGHM_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
9184
9228
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9185
9229
|
"line",
|
|
9186
9230
|
{
|
|
@@ -9204,7 +9248,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
9204
9248
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
9205
9249
|
for (let i = 0; i <= steps; i++) {
|
|
9206
9250
|
const val = range.min + range.span * i / steps;
|
|
9207
|
-
const y =
|
|
9251
|
+
const y = chunkXCLYIGHM_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
9208
9252
|
labels.push(
|
|
9209
9253
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9210
9254
|
"text",
|
|
@@ -9216,7 +9260,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
9216
9260
|
fontFamily,
|
|
9217
9261
|
fontWeight,
|
|
9218
9262
|
fill: fontColor,
|
|
9219
|
-
children: hasDisplayUnits ?
|
|
9263
|
+
children: hasDisplayUnits ? chunkXCLYIGHM_js.formatAxisValueWithUnits(val, axisFormatting) : chunkXCLYIGHM_js.formatAxisValue(val)
|
|
9220
9264
|
},
|
|
9221
9265
|
`${id}-sec-vaxis-${i}`
|
|
9222
9266
|
)
|
|
@@ -9240,7 +9284,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
9240
9284
|
);
|
|
9241
9285
|
}
|
|
9242
9286
|
if (hasDisplayUnits) {
|
|
9243
|
-
const unitLabel =
|
|
9287
|
+
const unitLabel = chunkXCLYIGHM_js.getDisplayUnitLabel(
|
|
9244
9288
|
axisFormatting.displayUnits,
|
|
9245
9289
|
axisFormatting.displayUnitsLabel
|
|
9246
9290
|
);
|
|
@@ -9271,7 +9315,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
9271
9315
|
const ticks = [];
|
|
9272
9316
|
for (let i = 0; i <= steps; i++) {
|
|
9273
9317
|
const val = range.min + range.span * i / steps;
|
|
9274
|
-
const y =
|
|
9318
|
+
const y = chunkXCLYIGHM_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
9275
9319
|
ticks.push(
|
|
9276
9320
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9277
9321
|
"line",
|
|
@@ -9298,7 +9342,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
9298
9342
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
9299
9343
|
for (let i = 0; i <= steps; i++) {
|
|
9300
9344
|
const val = range.min + range.span * i / steps;
|
|
9301
|
-
const y =
|
|
9345
|
+
const y = chunkXCLYIGHM_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
9302
9346
|
lines.push(
|
|
9303
9347
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9304
9348
|
"line",
|
|
@@ -9460,7 +9504,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
9460
9504
|
width: 8,
|
|
9461
9505
|
height: 8,
|
|
9462
9506
|
borderRadius: 2,
|
|
9463
|
-
backgroundColor:
|
|
9507
|
+
backgroundColor: chunkXCLYIGHM_js.seriesColor(
|
|
9464
9508
|
s,
|
|
9465
9509
|
si,
|
|
9466
9510
|
chartData.style?.styleId,
|
|
@@ -9499,8 +9543,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
9499
9543
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
9500
9544
|
const style = chartData.style;
|
|
9501
9545
|
const legendPos = style?.legendPosition || "b";
|
|
9502
|
-
const range =
|
|
9503
|
-
const layout =
|
|
9546
|
+
const range = chunkXCLYIGHM_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
9547
|
+
const layout = chunkXCLYIGHM_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
9504
9548
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
9505
9549
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
9506
9550
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -9521,10 +9565,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
9521
9565
|
const close = closeSeries.values[ci] ?? high;
|
|
9522
9566
|
const isUp = close >= open;
|
|
9523
9567
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
9524
|
-
const highY =
|
|
9525
|
-
const lowY =
|
|
9526
|
-
const openY =
|
|
9527
|
-
const closeY =
|
|
9568
|
+
const highY = chunkXCLYIGHM_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
9569
|
+
const lowY = chunkXCLYIGHM_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
9570
|
+
const openY = chunkXCLYIGHM_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
9571
|
+
const closeY = chunkXCLYIGHM_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
9528
9572
|
elements.push(
|
|
9529
9573
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9530
9574
|
"line",
|
|
@@ -9567,7 +9611,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
9567
9611
|
textAnchor: "middle",
|
|
9568
9612
|
fontSize: 7,
|
|
9569
9613
|
fill: "#334155",
|
|
9570
|
-
children:
|
|
9614
|
+
children: chunkXCLYIGHM_js.formatAxisValue(close)
|
|
9571
9615
|
},
|
|
9572
9616
|
`${element.id}-stock-dl-${ci}`
|
|
9573
9617
|
)
|
|
@@ -9609,7 +9653,7 @@ function FailedToLoad() {
|
|
|
9609
9653
|
var LazySurfaceChart3DScene = React4__default.default.lazy(
|
|
9610
9654
|
async () => {
|
|
9611
9655
|
try {
|
|
9612
|
-
return await import('./SurfaceChart3DScene-
|
|
9656
|
+
return await import('./SurfaceChart3DScene-NKUQTDRP.js');
|
|
9613
9657
|
} catch {
|
|
9614
9658
|
return { default: FailedToLoad };
|
|
9615
9659
|
}
|
|
@@ -9633,7 +9677,7 @@ var SurfaceChart3DErrorBoundary = class extends React4__default.default.Componen
|
|
|
9633
9677
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
9634
9678
|
const rows = chartData.series.length;
|
|
9635
9679
|
const cols = Math.max(categoryLabels.length, 1);
|
|
9636
|
-
const range =
|
|
9680
|
+
const range = chunkXCLYIGHM_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
9637
9681
|
const heightMap = new Float32Array(rows * cols);
|
|
9638
9682
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
9639
9683
|
for (let r = 0; r < rows; r++) {
|
|
@@ -9753,8 +9797,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
9753
9797
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
9754
9798
|
const style = chartData.style;
|
|
9755
9799
|
const legendPos = style?.legendPosition || "b";
|
|
9756
|
-
const layout =
|
|
9757
|
-
const range =
|
|
9800
|
+
const layout = chunkXCLYIGHM_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
9801
|
+
const range = chunkXCLYIGHM_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
9758
9802
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
9759
9803
|
const seriesCount = chartData.series.length;
|
|
9760
9804
|
const cols = catCount - 1;
|
|
@@ -9844,8 +9888,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
9844
9888
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
9845
9889
|
const style = chartData.style;
|
|
9846
9890
|
const legendPos = style?.legendPosition || "b";
|
|
9847
|
-
const layout =
|
|
9848
|
-
const range =
|
|
9891
|
+
const layout = chunkXCLYIGHM_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
9892
|
+
const range = chunkXCLYIGHM_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
9849
9893
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
9850
9894
|
const seriesCount = chartData.series.length;
|
|
9851
9895
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -9908,7 +9952,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
9908
9952
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
9909
9953
|
const style = chartData.style;
|
|
9910
9954
|
const legendPos = style?.legendPosition || "b";
|
|
9911
|
-
const layout =
|
|
9955
|
+
const layout = chunkXCLYIGHM_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
9912
9956
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
9913
9957
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
9914
9958
|
const rects = [];
|
|
@@ -9931,7 +9975,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
9931
9975
|
y: curY,
|
|
9932
9976
|
width: Math.max(w - 1, 1),
|
|
9933
9977
|
height: Math.max(h - 1, 1),
|
|
9934
|
-
fill:
|
|
9978
|
+
fill: chunkXCLYIGHM_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
9935
9979
|
rx: 2,
|
|
9936
9980
|
opacity: 0.85
|
|
9937
9981
|
},
|
|
@@ -9984,8 +10028,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
9984
10028
|
const style = chartData.style;
|
|
9985
10029
|
const legendPos = style?.legendPosition || "b";
|
|
9986
10030
|
const values = chartData.series[0]?.values ?? [];
|
|
9987
|
-
const range =
|
|
9988
|
-
const layout =
|
|
10031
|
+
const range = chunkXCLYIGHM_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
10032
|
+
const layout = chunkXCLYIGHM_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
9989
10033
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
9990
10034
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
9991
10035
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -9996,8 +10040,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
9996
10040
|
const isLast = i === values.length - 1;
|
|
9997
10041
|
const startVal = isLast ? 0 : runningTotal;
|
|
9998
10042
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
9999
|
-
const barStartY =
|
|
10000
|
-
const barEndY =
|
|
10043
|
+
const barStartY = chunkXCLYIGHM_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
10044
|
+
const barEndY = chunkXCLYIGHM_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
10001
10045
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
10002
10046
|
const y = Math.min(barStartY, barEndY);
|
|
10003
10047
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -10026,7 +10070,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
10026
10070
|
textAnchor: "middle",
|
|
10027
10071
|
fontSize: 7,
|
|
10028
10072
|
fill: "#334155",
|
|
10029
|
-
children:
|
|
10073
|
+
children: chunkXCLYIGHM_js.formatAxisValue(isLast ? endVal : val)
|
|
10030
10074
|
},
|
|
10031
10075
|
`${element.id}-wf-dl-${i}`
|
|
10032
10076
|
)
|
|
@@ -10074,18 +10118,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
10074
10118
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
10075
10119
|
const style = chartData.style;
|
|
10076
10120
|
const legendPos = style?.legendPosition || "b";
|
|
10077
|
-
const layoutOpts =
|
|
10121
|
+
const layoutOpts = chunkXCLYIGHM_js.computeLayoutOptions(
|
|
10078
10122
|
chartData.axes,
|
|
10079
10123
|
chartData.dataTable,
|
|
10080
10124
|
chartData.series.length
|
|
10081
10125
|
);
|
|
10082
|
-
const layout =
|
|
10083
|
-
const { primary, secondary } =
|
|
10126
|
+
const layout = chunkXCLYIGHM_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
10127
|
+
const { primary, secondary } = chunkXCLYIGHM_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
10084
10128
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
10085
10129
|
const secondarySeries = secondary.map((e) => e.series);
|
|
10086
|
-
const range =
|
|
10087
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
10088
|
-
const secondaryAxisFmt =
|
|
10130
|
+
const range = chunkXCLYIGHM_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
10131
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkXCLYIGHM_js.computeValueRange(secondarySeries) : void 0;
|
|
10132
|
+
const secondaryAxisFmt = chunkXCLYIGHM_js.getSecondaryValueAxis(chartData.axes);
|
|
10089
10133
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
10090
10134
|
const barSeriesCount = 1;
|
|
10091
10135
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -10101,8 +10145,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10101
10145
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
10102
10146
|
barSeries.values.forEach((val, vi) => {
|
|
10103
10147
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
10104
|
-
const zeroY =
|
|
10105
|
-
const valY =
|
|
10148
|
+
const zeroY = chunkXCLYIGHM_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
10149
|
+
const valY = chunkXCLYIGHM_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
10106
10150
|
const y = Math.min(zeroY, valY);
|
|
10107
10151
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
10108
10152
|
barElements.push(
|
|
@@ -10113,7 +10157,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10113
10157
|
y,
|
|
10114
10158
|
width: barWidth,
|
|
10115
10159
|
height: h,
|
|
10116
|
-
fill:
|
|
10160
|
+
fill: chunkXCLYIGHM_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
10117
10161
|
rx: 1
|
|
10118
10162
|
},
|
|
10119
10163
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -10129,7 +10173,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10129
10173
|
textAnchor: "middle",
|
|
10130
10174
|
fontSize: 7,
|
|
10131
10175
|
fill: "#334155",
|
|
10132
|
-
children:
|
|
10176
|
+
children: chunkXCLYIGHM_js.formatAxisValue(val)
|
|
10133
10177
|
},
|
|
10134
10178
|
`${element.id}-combo-bar-dl-${vi}`
|
|
10135
10179
|
)
|
|
@@ -10146,10 +10190,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10146
10190
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
10147
10191
|
const points = series.values.map((val, vi) => {
|
|
10148
10192
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
10149
|
-
const y =
|
|
10193
|
+
const y = chunkXCLYIGHM_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
10150
10194
|
return { x, y, val };
|
|
10151
10195
|
});
|
|
10152
|
-
const c =
|
|
10196
|
+
const c = chunkXCLYIGHM_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
10153
10197
|
lineElements.push(
|
|
10154
10198
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10155
10199
|
"polyline",
|
|
@@ -10176,7 +10220,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10176
10220
|
textAnchor: "middle",
|
|
10177
10221
|
fontSize: 7,
|
|
10178
10222
|
fill: "#334155",
|
|
10179
|
-
children:
|
|
10223
|
+
children: chunkXCLYIGHM_js.formatAxisValue(p.val)
|
|
10180
10224
|
},
|
|
10181
10225
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
10182
10226
|
)
|
|
@@ -11807,6 +11851,16 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
11807
11851
|
}
|
|
11808
11852
|
if (element.mediaMissing) {
|
|
11809
11853
|
if (posterUrl) {
|
|
11854
|
+
if (isPresentationMode) {
|
|
11855
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11856
|
+
"img",
|
|
11857
|
+
{
|
|
11858
|
+
src: posterUrl,
|
|
11859
|
+
alt: chunkCUUYYYC5_js.translationsEn["pptx.media.posterAlt"],
|
|
11860
|
+
className: "w-full h-full object-contain pointer-events-none"
|
|
11861
|
+
}
|
|
11862
|
+
);
|
|
11863
|
+
}
|
|
11810
11864
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full relative pointer-events-none", children: [
|
|
11811
11865
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11812
11866
|
"img",
|
|
@@ -11977,14 +12031,14 @@ function buildNotesPdf(pages) {
|
|
|
11977
12031
|
notes: page.notes,
|
|
11978
12032
|
slideNumber: page.slideNumber
|
|
11979
12033
|
}));
|
|
11980
|
-
const bytes =
|
|
12034
|
+
const bytes = chunkXCLYIGHM_js.buildNotesPdfBytes(images, meta);
|
|
11981
12035
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
11982
12036
|
return URL.createObjectURL(blob);
|
|
11983
12037
|
}
|
|
11984
12038
|
|
|
11985
12039
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
11986
12040
|
function buildPdfFromImageData(images) {
|
|
11987
|
-
const bytes =
|
|
12041
|
+
const bytes = chunkXCLYIGHM_js.buildSlidesPdfBytes(images);
|
|
11988
12042
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
11989
12043
|
return URL.createObjectURL(blob);
|
|
11990
12044
|
}
|
|
@@ -11993,7 +12047,7 @@ function buildPdfFromImageData(images) {
|
|
|
11993
12047
|
var activePreview = null;
|
|
11994
12048
|
function startPreviewAnimation(elementId, preset, options) {
|
|
11995
12049
|
stopPreviewAnimation();
|
|
11996
|
-
const descriptor =
|
|
12050
|
+
const descriptor = chunkXCLYIGHM_js.buildPreviewAnimation(preset, options);
|
|
11997
12051
|
if (!descriptor) {
|
|
11998
12052
|
return;
|
|
11999
12053
|
}
|
|
@@ -12071,7 +12125,7 @@ function useElementOperations(input) {
|
|
|
12071
12125
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
12072
12126
|
const updateElementById = React4.useCallback(
|
|
12073
12127
|
(elementId, updates) => {
|
|
12074
|
-
if (
|
|
12128
|
+
if (chunkXCLYIGHM_js.isTemplateElementId(elementId)) {
|
|
12075
12129
|
const slideId = activeSlide?.id;
|
|
12076
12130
|
if (slideId) {
|
|
12077
12131
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -12111,7 +12165,7 @@ function useElementOperations(input) {
|
|
|
12111
12165
|
);
|
|
12112
12166
|
const updateSelectedShapeStyle = React4.useCallback(
|
|
12113
12167
|
(updates) => {
|
|
12114
|
-
if (!selectedElement || !
|
|
12168
|
+
if (!selectedElement || !chunkN7OHVHBS_js.hasShapeProperties(selectedElement)) {
|
|
12115
12169
|
return;
|
|
12116
12170
|
}
|
|
12117
12171
|
updateSelectedElement({
|
|
@@ -12122,17 +12176,17 @@ function useElementOperations(input) {
|
|
|
12122
12176
|
);
|
|
12123
12177
|
const updateSelectedTextStyle = React4.useCallback(
|
|
12124
12178
|
(updates) => {
|
|
12125
|
-
if (!selectedElement || !
|
|
12179
|
+
if (!selectedElement || !chunkN7OHVHBS_js.hasTextProperties(selectedElement)) {
|
|
12126
12180
|
return;
|
|
12127
12181
|
}
|
|
12128
|
-
const inlineSel =
|
|
12182
|
+
const inlineSel = chunkXCLYIGHM_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
12129
12183
|
if (inlineSel && selectedElement.textSegments) {
|
|
12130
|
-
const { newSegments: newSegments2, newSelection } =
|
|
12184
|
+
const { newSegments: newSegments2, newSelection } = chunkXCLYIGHM_js.applyStyleToSelectedSegments(
|
|
12131
12185
|
selectedElement.textSegments,
|
|
12132
12186
|
inlineSel,
|
|
12133
12187
|
updates
|
|
12134
12188
|
);
|
|
12135
|
-
|
|
12189
|
+
chunkXCLYIGHM_js.setPendingSelectionRestore(newSelection);
|
|
12136
12190
|
updateSelectedElement({
|
|
12137
12191
|
textSegments: newSegments2
|
|
12138
12192
|
});
|
|
@@ -12152,12 +12206,12 @@ function useElementOperations(input) {
|
|
|
12152
12206
|
);
|
|
12153
12207
|
const updateSelectedTextCase = React4.useCallback(
|
|
12154
12208
|
(mode) => {
|
|
12155
|
-
if (!selectedElement || !
|
|
12209
|
+
if (!selectedElement || !chunkN7OHVHBS_js.hasTextProperties(selectedElement)) {
|
|
12156
12210
|
return;
|
|
12157
12211
|
}
|
|
12158
|
-
const inlineSel =
|
|
12212
|
+
const inlineSel = chunkXCLYIGHM_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
12159
12213
|
if (inlineSel && selectedElement.textSegments) {
|
|
12160
|
-
const newSegments =
|
|
12214
|
+
const newSegments = chunkXCLYIGHM_js.applyCaseTransformToSegments(
|
|
12161
12215
|
selectedElement.textSegments,
|
|
12162
12216
|
inlineSel,
|
|
12163
12217
|
mode
|
|
@@ -12167,14 +12221,14 @@ function useElementOperations(input) {
|
|
|
12167
12221
|
}
|
|
12168
12222
|
const updates = {};
|
|
12169
12223
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
12170
|
-
updates.textSegments =
|
|
12224
|
+
updates.textSegments = chunkXCLYIGHM_js.applyCaseTransformToSegments(
|
|
12171
12225
|
selectedElement.textSegments,
|
|
12172
12226
|
null,
|
|
12173
12227
|
mode
|
|
12174
12228
|
);
|
|
12175
12229
|
}
|
|
12176
12230
|
if (typeof selectedElement.text === "string") {
|
|
12177
|
-
updates.text =
|
|
12231
|
+
updates.text = chunkXCLYIGHM_js.transformTextCase(selectedElement.text, mode);
|
|
12178
12232
|
}
|
|
12179
12233
|
updateSelectedElement(updates);
|
|
12180
12234
|
},
|
|
@@ -12229,7 +12283,7 @@ function useSectionOperations(input) {
|
|
|
12229
12283
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
12230
12284
|
const addSection2 = React4.useCallback(
|
|
12231
12285
|
(name, afterSlideIndex) => {
|
|
12232
|
-
const result =
|
|
12286
|
+
const result = chunkXCLYIGHM_js.addSection(sections, slides, name, afterSlideIndex);
|
|
12233
12287
|
setSlides(result.slides);
|
|
12234
12288
|
setSections(result.sections);
|
|
12235
12289
|
markDirty();
|
|
@@ -12238,7 +12292,7 @@ function useSectionOperations(input) {
|
|
|
12238
12292
|
);
|
|
12239
12293
|
const renameSection2 = React4.useCallback(
|
|
12240
12294
|
(sectionId, newName) => {
|
|
12241
|
-
const result =
|
|
12295
|
+
const result = chunkXCLYIGHM_js.renameSection(sections, slides, sectionId, newName);
|
|
12242
12296
|
setSections(result.sections);
|
|
12243
12297
|
setSlides(result.slides);
|
|
12244
12298
|
markDirty();
|
|
@@ -12247,7 +12301,7 @@ function useSectionOperations(input) {
|
|
|
12247
12301
|
);
|
|
12248
12302
|
const deleteSection2 = React4.useCallback(
|
|
12249
12303
|
(sectionId) => {
|
|
12250
|
-
const result =
|
|
12304
|
+
const result = chunkXCLYIGHM_js.deleteSection(sections, slides, sectionId);
|
|
12251
12305
|
setSections(result.sections);
|
|
12252
12306
|
setSlides(result.slides);
|
|
12253
12307
|
markDirty();
|
|
@@ -12256,21 +12310,21 @@ function useSectionOperations(input) {
|
|
|
12256
12310
|
);
|
|
12257
12311
|
const moveSectionUp2 = React4.useCallback(
|
|
12258
12312
|
(sectionId) => {
|
|
12259
|
-
setSections(
|
|
12313
|
+
setSections(chunkXCLYIGHM_js.moveSectionUp(sections, sectionId));
|
|
12260
12314
|
markDirty();
|
|
12261
12315
|
},
|
|
12262
12316
|
[sections, setSections, markDirty]
|
|
12263
12317
|
);
|
|
12264
12318
|
const moveSectionDown2 = React4.useCallback(
|
|
12265
12319
|
(sectionId) => {
|
|
12266
|
-
setSections(
|
|
12320
|
+
setSections(chunkXCLYIGHM_js.moveSectionDown(sections, sectionId));
|
|
12267
12321
|
markDirty();
|
|
12268
12322
|
},
|
|
12269
12323
|
[sections, setSections, markDirty]
|
|
12270
12324
|
);
|
|
12271
12325
|
const moveSlidesToSection2 = React4.useCallback(
|
|
12272
12326
|
(slideIndexes, targetSectionId) => {
|
|
12273
|
-
const result =
|
|
12327
|
+
const result = chunkXCLYIGHM_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
12274
12328
|
setSlides(result.slides);
|
|
12275
12329
|
setSections(result.sections);
|
|
12276
12330
|
markDirty();
|
|
@@ -12289,7 +12343,7 @@ function useSectionOperations(input) {
|
|
|
12289
12343
|
|
|
12290
12344
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
12291
12345
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
12292
|
-
const resized =
|
|
12346
|
+
const resized = chunkXCLYIGHM_js.applyResize(
|
|
12293
12347
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
12294
12348
|
handle,
|
|
12295
12349
|
dx,
|
|
@@ -12301,7 +12355,7 @@ function computeResizeGeometry(handle, startX, startY, startWidth, startHeight,
|
|
|
12301
12355
|
if (!snapToGrid) {
|
|
12302
12356
|
return box;
|
|
12303
12357
|
}
|
|
12304
|
-
return
|
|
12358
|
+
return chunkXCLYIGHM_js.snapBoxToGrid(box, handle, gridSpacingPx, MIN_ELEMENT_SIZE);
|
|
12305
12359
|
}
|
|
12306
12360
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
12307
12361
|
const range = startWidth || 200;
|
|
@@ -12411,7 +12465,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
12411
12465
|
width: el.width,
|
|
12412
12466
|
height: el.height
|
|
12413
12467
|
}));
|
|
12414
|
-
const snapResult =
|
|
12468
|
+
const snapResult = chunkXCLYIGHM_js.computeSnapToShape(
|
|
12415
12469
|
targetX,
|
|
12416
12470
|
targetY,
|
|
12417
12471
|
primaryEl.width,
|
|
@@ -12554,13 +12608,13 @@ function processPointerUp(input) {
|
|
|
12554
12608
|
if (i !== activeSlideIndex) {
|
|
12555
12609
|
return s;
|
|
12556
12610
|
}
|
|
12557
|
-
const rerouted =
|
|
12611
|
+
const rerouted = chunkXCLYIGHM_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
12558
12612
|
if (rerouted.length === 0) {
|
|
12559
12613
|
return s;
|
|
12560
12614
|
}
|
|
12561
12615
|
return {
|
|
12562
12616
|
...s,
|
|
12563
|
-
elements:
|
|
12617
|
+
elements: chunkXCLYIGHM_js.applyReroutedConnectors(s.elements, rerouted)
|
|
12564
12618
|
};
|
|
12565
12619
|
})
|
|
12566
12620
|
);
|
|
@@ -12579,9 +12633,9 @@ function processPointerUp(input) {
|
|
|
12579
12633
|
}
|
|
12580
12634
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
12581
12635
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
12582
|
-
const hitIds =
|
|
12636
|
+
const hitIds = chunkXCLYIGHM_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
12583
12637
|
if (marquee.additive) {
|
|
12584
|
-
const merged =
|
|
12638
|
+
const merged = chunkXCLYIGHM_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
12585
12639
|
if (merged.length > 0) {
|
|
12586
12640
|
applySelection(merged[0], merged);
|
|
12587
12641
|
} else {
|
|
@@ -12604,8 +12658,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
12604
12658
|
}
|
|
12605
12659
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
12606
12660
|
});
|
|
12607
|
-
const rerouted =
|
|
12608
|
-
return
|
|
12661
|
+
const rerouted = chunkXCLYIGHM_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
12662
|
+
return chunkXCLYIGHM_js.applyReroutedConnectors(movedElements, rerouted);
|
|
12609
12663
|
};
|
|
12610
12664
|
if (editTemplateMode) {
|
|
12611
12665
|
const slideId = activeSlide?.id;
|
|
@@ -12756,9 +12810,9 @@ function useCanvasInteractions(input) {
|
|
|
12756
12810
|
return;
|
|
12757
12811
|
}
|
|
12758
12812
|
const el = elementLookup.get(editId);
|
|
12759
|
-
if (el &&
|
|
12813
|
+
if (el && chunkN7OHVHBS_js.hasTextProperties(el)) {
|
|
12760
12814
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
12761
|
-
const newSegments =
|
|
12815
|
+
const newSegments = chunkXCLYIGHM_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
12762
12816
|
ops.updateElementById(editId, {
|
|
12763
12817
|
text: committedText,
|
|
12764
12818
|
textSegments: newSegments
|
|
@@ -12769,7 +12823,7 @@ function useCanvasInteractions(input) {
|
|
|
12769
12823
|
setInlineEditingText("");
|
|
12770
12824
|
};
|
|
12771
12825
|
const openEquationEditorForElement = (el) => {
|
|
12772
|
-
if (!
|
|
12826
|
+
if (!chunkN7OHVHBS_js.hasTextProperties(el)) {
|
|
12773
12827
|
return false;
|
|
12774
12828
|
}
|
|
12775
12829
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -12798,7 +12852,7 @@ function useCanvasInteractions(input) {
|
|
|
12798
12852
|
justSelectedRef.current = false;
|
|
12799
12853
|
} else {
|
|
12800
12854
|
const el = elementLookup.get(elementId);
|
|
12801
|
-
if (el &&
|
|
12855
|
+
if (el && chunkN7OHVHBS_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
12802
12856
|
if (!openEquationEditorForElement(el)) {
|
|
12803
12857
|
setInlineEditingElementId(elementId);
|
|
12804
12858
|
setInlineEditingText(el.text ?? "");
|
|
@@ -12817,7 +12871,7 @@ function useCanvasInteractions(input) {
|
|
|
12817
12871
|
if (openEquationEditorForElement(el)) {
|
|
12818
12872
|
return;
|
|
12819
12873
|
}
|
|
12820
|
-
if (
|
|
12874
|
+
if (chunkN7OHVHBS_js.hasTextProperties(el)) {
|
|
12821
12875
|
setInlineEditingElementId(elementId);
|
|
12822
12876
|
setInlineEditingText(el.text ?? "");
|
|
12823
12877
|
}
|
|
@@ -13007,7 +13061,7 @@ function createFileHandlers(deps) {
|
|
|
13007
13061
|
h = Math.round(h * scale);
|
|
13008
13062
|
}
|
|
13009
13063
|
addElement({
|
|
13010
|
-
id:
|
|
13064
|
+
id: chunkXCLYIGHM_js.generateElementId(),
|
|
13011
13065
|
type: "image",
|
|
13012
13066
|
x: Math.round((canvasSize.width - w) / 2),
|
|
13013
13067
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -13018,7 +13072,7 @@ function createFileHandlers(deps) {
|
|
|
13018
13072
|
};
|
|
13019
13073
|
img.onerror = () => {
|
|
13020
13074
|
addElement({
|
|
13021
|
-
id:
|
|
13075
|
+
id: chunkXCLYIGHM_js.generateElementId(),
|
|
13022
13076
|
type: "image",
|
|
13023
13077
|
x: 100,
|
|
13024
13078
|
y: 100,
|
|
@@ -13044,7 +13098,7 @@ function createFileHandlers(deps) {
|
|
|
13044
13098
|
const elFilePath = file.path;
|
|
13045
13099
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
13046
13100
|
addElement({
|
|
13047
|
-
id:
|
|
13101
|
+
id: chunkXCLYIGHM_js.generateElementId(),
|
|
13048
13102
|
type: "media",
|
|
13049
13103
|
mediaType,
|
|
13050
13104
|
mediaMimeType: file.type || void 0,
|
|
@@ -13219,13 +13273,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
13219
13273
|
return;
|
|
13220
13274
|
}
|
|
13221
13275
|
addElement({
|
|
13222
|
-
id:
|
|
13276
|
+
id: chunkXCLYIGHM_js.generateElementId(),
|
|
13223
13277
|
type: "smartArt",
|
|
13224
13278
|
x: 100,
|
|
13225
13279
|
y: 120,
|
|
13226
13280
|
width: 600,
|
|
13227
13281
|
height: 340,
|
|
13228
|
-
smartArtData:
|
|
13282
|
+
smartArtData: chunkXCLYIGHM_js.buildSmartArtPresetData(
|
|
13229
13283
|
layout,
|
|
13230
13284
|
defaultItems,
|
|
13231
13285
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -13237,7 +13291,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
13237
13291
|
return;
|
|
13238
13292
|
}
|
|
13239
13293
|
addElement({
|
|
13240
|
-
id:
|
|
13294
|
+
id: chunkXCLYIGHM_js.generateElementId(),
|
|
13241
13295
|
type: "shape",
|
|
13242
13296
|
x: 120,
|
|
13243
13297
|
y: 200,
|
|
@@ -13296,7 +13350,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
13296
13350
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
13297
13351
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
13298
13352
|
addElement({
|
|
13299
|
-
id:
|
|
13353
|
+
id: chunkXCLYIGHM_js.generateElementId(),
|
|
13300
13354
|
type: "shape",
|
|
13301
13355
|
x: 120,
|
|
13302
13356
|
y: 200,
|
|
@@ -13318,11 +13372,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
13318
13372
|
if (!activeSlide) {
|
|
13319
13373
|
return;
|
|
13320
13374
|
}
|
|
13321
|
-
const preset =
|
|
13375
|
+
const preset = chunkXCLYIGHM_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
13322
13376
|
if (!preset) {
|
|
13323
13377
|
return;
|
|
13324
13378
|
}
|
|
13325
|
-
const defaultPptxAction =
|
|
13379
|
+
const defaultPptxAction = chunkN7OHVHBS_js.elementActionToPptxAction({
|
|
13326
13380
|
trigger: "click",
|
|
13327
13381
|
type: preset.defaultAction
|
|
13328
13382
|
});
|
|
@@ -13331,7 +13385,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
13331
13385
|
defaultPptxAction.highlightClick = true;
|
|
13332
13386
|
}
|
|
13333
13387
|
addElement({
|
|
13334
|
-
id:
|
|
13388
|
+
id: chunkXCLYIGHM_js.generateElementId(),
|
|
13335
13389
|
type: "shape",
|
|
13336
13390
|
x: 150,
|
|
13337
13391
|
y: 150,
|
|
@@ -13398,7 +13452,7 @@ function useInsertElements(input) {
|
|
|
13398
13452
|
return;
|
|
13399
13453
|
}
|
|
13400
13454
|
addElement({
|
|
13401
|
-
id:
|
|
13455
|
+
id: chunkXCLYIGHM_js.generateElementId(),
|
|
13402
13456
|
type: "text",
|
|
13403
13457
|
x: 100,
|
|
13404
13458
|
y: 100,
|
|
@@ -13413,7 +13467,7 @@ function useInsertElements(input) {
|
|
|
13413
13467
|
return;
|
|
13414
13468
|
}
|
|
13415
13469
|
addElement({
|
|
13416
|
-
id:
|
|
13470
|
+
id: chunkXCLYIGHM_js.generateElementId(),
|
|
13417
13471
|
type: "shape",
|
|
13418
13472
|
x: 150,
|
|
13419
13473
|
y: 150,
|
|
@@ -13432,15 +13486,15 @@ function useInsertElements(input) {
|
|
|
13432
13486
|
return;
|
|
13433
13487
|
}
|
|
13434
13488
|
addElement({
|
|
13435
|
-
...
|
|
13436
|
-
id:
|
|
13489
|
+
...chunkXCLYIGHM_js.newTableElement(DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
13490
|
+
id: chunkXCLYIGHM_js.generateElementId()
|
|
13437
13491
|
});
|
|
13438
13492
|
};
|
|
13439
13493
|
const handleAddChart = (chartType) => {
|
|
13440
13494
|
if (!activeSlide) {
|
|
13441
13495
|
return;
|
|
13442
13496
|
}
|
|
13443
|
-
addElement(
|
|
13497
|
+
addElement(chunkXCLYIGHM_js.createDefaultChartElement(chartType));
|
|
13444
13498
|
};
|
|
13445
13499
|
const structured = createStructuredElementHandlers({
|
|
13446
13500
|
activeSlide,
|
|
@@ -13510,7 +13564,7 @@ function useClipboardHandlers(input) {
|
|
|
13510
13564
|
if (!selectedElement) {
|
|
13511
13565
|
return;
|
|
13512
13566
|
}
|
|
13513
|
-
setClipboardPayload(
|
|
13567
|
+
setClipboardPayload(chunkXCLYIGHM_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
13514
13568
|
};
|
|
13515
13569
|
const handleDelete = () => {
|
|
13516
13570
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -13527,7 +13581,7 @@ function useClipboardHandlers(input) {
|
|
|
13527
13581
|
handleDelete();
|
|
13528
13582
|
};
|
|
13529
13583
|
const insertClone = (source) => {
|
|
13530
|
-
const clone =
|
|
13584
|
+
const clone = chunkXCLYIGHM_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
13531
13585
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
13532
13586
|
ops.applySelection(clone.id);
|
|
13533
13587
|
history.markDirty();
|
|
@@ -13562,7 +13616,7 @@ function resolveShapePath(el) {
|
|
|
13562
13616
|
return el.pathData;
|
|
13563
13617
|
}
|
|
13564
13618
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
13565
|
-
const clipPath =
|
|
13619
|
+
const clipPath = chunkN7OHVHBS_js.getPresetShapeClipPath(el.shapeType);
|
|
13566
13620
|
if (clipPath) {
|
|
13567
13621
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
13568
13622
|
if (svgPath) {
|
|
@@ -13613,7 +13667,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
13613
13667
|
return parts.join(" ");
|
|
13614
13668
|
}
|
|
13615
13669
|
function transformPathToGlobal(pathData, el) {
|
|
13616
|
-
const polys =
|
|
13670
|
+
const polys = chunkN7OHVHBS_js.svgPathToPolygons(pathData);
|
|
13617
13671
|
if (polys.length === 0) {
|
|
13618
13672
|
return pathData;
|
|
13619
13673
|
}
|
|
@@ -13633,10 +13687,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
13633
13687
|
y: pt.y * scaleY + el.y
|
|
13634
13688
|
}))
|
|
13635
13689
|
);
|
|
13636
|
-
return
|
|
13690
|
+
return chunkN7OHVHBS_js.polygonsToSvgPath(transformed);
|
|
13637
13691
|
}
|
|
13638
13692
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
13639
|
-
const polys =
|
|
13693
|
+
const polys = chunkN7OHVHBS_js.svgPathToPolygons(pathData);
|
|
13640
13694
|
if (polys.length === 0) {
|
|
13641
13695
|
return pathData;
|
|
13642
13696
|
}
|
|
@@ -13646,10 +13700,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
13646
13700
|
y: pt.y - y
|
|
13647
13701
|
}))
|
|
13648
13702
|
);
|
|
13649
|
-
return
|
|
13703
|
+
return chunkN7OHVHBS_js.polygonsToSvgPath(transformed);
|
|
13650
13704
|
}
|
|
13651
13705
|
function pathBounds(pathData) {
|
|
13652
|
-
const polys =
|
|
13706
|
+
const polys = chunkN7OHVHBS_js.svgPathToPolygons(pathData);
|
|
13653
13707
|
let minX = Infinity;
|
|
13654
13708
|
let minY = Infinity;
|
|
13655
13709
|
let maxX = -Infinity;
|
|
@@ -13708,7 +13762,7 @@ function useMergeShapesHandler(input) {
|
|
|
13708
13762
|
let allFragments = [];
|
|
13709
13763
|
let remaining = globalPaths[0];
|
|
13710
13764
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
13711
|
-
const frags =
|
|
13765
|
+
const frags = chunkN7OHVHBS_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
13712
13766
|
if (Array.isArray(frags)) {
|
|
13713
13767
|
allFragments = frags;
|
|
13714
13768
|
}
|
|
@@ -13737,7 +13791,7 @@ function useMergeShapesHandler(input) {
|
|
|
13737
13791
|
bounds.height
|
|
13738
13792
|
);
|
|
13739
13793
|
const newEl = {
|
|
13740
|
-
id:
|
|
13794
|
+
id: chunkXCLYIGHM_js.generateElementId(),
|
|
13741
13795
|
type: "shape",
|
|
13742
13796
|
x: bounds.x,
|
|
13743
13797
|
y: bounds.y,
|
|
@@ -13775,7 +13829,7 @@ function useMergeShapesHandler(input) {
|
|
|
13775
13829
|
} else {
|
|
13776
13830
|
let resultPath = globalPaths[0];
|
|
13777
13831
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
13778
|
-
const result =
|
|
13832
|
+
const result = chunkN7OHVHBS_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
13779
13833
|
if (typeof result === "string") {
|
|
13780
13834
|
resultPath = result;
|
|
13781
13835
|
}
|
|
@@ -13796,7 +13850,7 @@ function useMergeShapesHandler(input) {
|
|
|
13796
13850
|
);
|
|
13797
13851
|
const primary = targets[0];
|
|
13798
13852
|
const newEl = {
|
|
13799
|
-
id:
|
|
13853
|
+
id: chunkXCLYIGHM_js.generateElementId(),
|
|
13800
13854
|
type: "shape",
|
|
13801
13855
|
x: bounds.x,
|
|
13802
13856
|
y: bounds.y,
|
|
@@ -13859,7 +13913,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13859
13913
|
if (ids.length < 2 || !activeSlide) {
|
|
13860
13914
|
return;
|
|
13861
13915
|
}
|
|
13862
|
-
const { elements, groupId } =
|
|
13916
|
+
const { elements, groupId } = chunkXCLYIGHM_js.groupElements(ops.activeElements, ids, chunkXCLYIGHM_js.generateElementId());
|
|
13863
13917
|
if (groupId === null) {
|
|
13864
13918
|
return;
|
|
13865
13919
|
}
|
|
@@ -13872,12 +13926,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13872
13926
|
return;
|
|
13873
13927
|
}
|
|
13874
13928
|
const group = selectedElement;
|
|
13875
|
-
const intoTemplate =
|
|
13929
|
+
const intoTemplate = chunkXCLYIGHM_js.isTemplateElementId(group.id);
|
|
13876
13930
|
const ungrouped = group.children.map((child) => ({
|
|
13877
13931
|
...structuredClone(child),
|
|
13878
13932
|
// Keep child ids in the same store as the group so later edits route
|
|
13879
13933
|
// correctly: template groups yield template-prefixed child ids.
|
|
13880
|
-
id: intoTemplate ?
|
|
13934
|
+
id: intoTemplate ? chunkXCLYIGHM_js.makeCloneId(true, child.id || group.id) : child.id || chunkXCLYIGHM_js.generateElementId(),
|
|
13881
13935
|
x: child.x + group.x,
|
|
13882
13936
|
y: child.y + group.y
|
|
13883
13937
|
}));
|
|
@@ -13901,7 +13955,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13901
13955
|
if (!edge) {
|
|
13902
13956
|
return;
|
|
13903
13957
|
}
|
|
13904
|
-
const positions =
|
|
13958
|
+
const positions = chunkXCLYIGHM_js.alignElements(selectedElements, edge);
|
|
13905
13959
|
for (const [id, pos] of positions) {
|
|
13906
13960
|
const el = elementLookup.get(id);
|
|
13907
13961
|
if (!el) {
|
|
@@ -13919,7 +13973,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13919
13973
|
if (!distAxis) {
|
|
13920
13974
|
return;
|
|
13921
13975
|
}
|
|
13922
|
-
const positions =
|
|
13976
|
+
const positions = chunkXCLYIGHM_js.distributeElements(selectedElements, distAxis);
|
|
13923
13977
|
for (const [id, pos] of positions) {
|
|
13924
13978
|
const el = elementLookup.get(id);
|
|
13925
13979
|
if (!el) {
|
|
@@ -13936,7 +13990,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13936
13990
|
}
|
|
13937
13991
|
const id = selectedElement.id;
|
|
13938
13992
|
ops.updateActiveElements(
|
|
13939
|
-
(els) => direction === "forward" ?
|
|
13993
|
+
(els) => direction === "forward" ? chunkXCLYIGHM_js.bringForward(els, id) : direction === "backward" ? chunkXCLYIGHM_js.sendBackward(els, id) : els
|
|
13940
13994
|
);
|
|
13941
13995
|
history.markDirty();
|
|
13942
13996
|
};
|
|
@@ -13946,7 +14000,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13946
14000
|
}
|
|
13947
14001
|
const id = selectedElement.id;
|
|
13948
14002
|
ops.updateActiveElements(
|
|
13949
|
-
(els) => direction === "front" ?
|
|
14003
|
+
(els) => direction === "front" ? chunkXCLYIGHM_js.bringToFront(els, id) : chunkXCLYIGHM_js.sendToBack(els, id)
|
|
13950
14004
|
);
|
|
13951
14005
|
history.markDirty();
|
|
13952
14006
|
};
|
|
@@ -14068,7 +14122,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
14068
14122
|
function useSlideManagement(input) {
|
|
14069
14123
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
14070
14124
|
const handleAddSlide = () => {
|
|
14071
|
-
const newSlide =
|
|
14125
|
+
const newSlide = chunkXCLYIGHM_js.createBlankSlide(slides.length + 1);
|
|
14072
14126
|
ops.updateSlides((prev) => {
|
|
14073
14127
|
const next = [...prev];
|
|
14074
14128
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -14131,7 +14185,7 @@ function useSlideManagement(input) {
|
|
|
14131
14185
|
}
|
|
14132
14186
|
const clone = {
|
|
14133
14187
|
...src,
|
|
14134
|
-
id:
|
|
14188
|
+
id: chunkXCLYIGHM_js.makeSlideId(),
|
|
14135
14189
|
elements: src.elements.map((el) => ({
|
|
14136
14190
|
...el,
|
|
14137
14191
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -14163,7 +14217,7 @@ function useSlideManagement(input) {
|
|
|
14163
14217
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
14164
14218
|
const insertAt = activeSlideIndex + 1;
|
|
14165
14219
|
const draft = {
|
|
14166
|
-
...
|
|
14220
|
+
...chunkXCLYIGHM_js.createBlankSlide(slides.length + 1),
|
|
14167
14221
|
layoutPath,
|
|
14168
14222
|
...layoutName ? { layoutName } : {}
|
|
14169
14223
|
};
|
|
@@ -14224,7 +14278,7 @@ function createTableMergeHandlers(input) {
|
|
|
14224
14278
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
14225
14279
|
return;
|
|
14226
14280
|
}
|
|
14227
|
-
const newTableData =
|
|
14281
|
+
const newTableData = chunkXCLYIGHM_js.mergeCells(
|
|
14228
14282
|
[
|
|
14229
14283
|
{ row: rowIndex, col: columnIndex },
|
|
14230
14284
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -14232,7 +14286,7 @@ function createTableMergeHandlers(input) {
|
|
|
14232
14286
|
td
|
|
14233
14287
|
);
|
|
14234
14288
|
const updates = { tableData: newTableData };
|
|
14235
|
-
const newRawXml =
|
|
14289
|
+
const newRawXml = chunkN7OHVHBS_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
14236
14290
|
if (newRawXml) {
|
|
14237
14291
|
updates.rawXml = newRawXml;
|
|
14238
14292
|
}
|
|
@@ -14258,7 +14312,7 @@ function createTableMergeHandlers(input) {
|
|
|
14258
14312
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
14259
14313
|
return;
|
|
14260
14314
|
}
|
|
14261
|
-
const newTableData =
|
|
14315
|
+
const newTableData = chunkXCLYIGHM_js.mergeCells(
|
|
14262
14316
|
[
|
|
14263
14317
|
{ row: rowIndex, col: columnIndex },
|
|
14264
14318
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -14266,7 +14320,7 @@ function createTableMergeHandlers(input) {
|
|
|
14266
14320
|
td
|
|
14267
14321
|
);
|
|
14268
14322
|
const updates = { tableData: newTableData };
|
|
14269
|
-
const newRawXml =
|
|
14323
|
+
const newRawXml = chunkN7OHVHBS_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
14270
14324
|
if (newRawXml) {
|
|
14271
14325
|
updates.rawXml = newRawXml;
|
|
14272
14326
|
}
|
|
@@ -14281,9 +14335,9 @@ function createTableMergeHandlers(input) {
|
|
|
14281
14335
|
return;
|
|
14282
14336
|
}
|
|
14283
14337
|
const td = selectedElement.tableData;
|
|
14284
|
-
const newTableData =
|
|
14338
|
+
const newTableData = chunkXCLYIGHM_js.mergeCells(ts.selectedCells, td);
|
|
14285
14339
|
const updates = { tableData: newTableData };
|
|
14286
|
-
const newRawXml =
|
|
14340
|
+
const newRawXml = chunkN7OHVHBS_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
14287
14341
|
if (newRawXml) {
|
|
14288
14342
|
updates.rawXml = newRawXml;
|
|
14289
14343
|
}
|
|
@@ -14300,9 +14354,9 @@ function createTableMergeHandlers(input) {
|
|
|
14300
14354
|
}
|
|
14301
14355
|
const { rowIndex, columnIndex } = ts;
|
|
14302
14356
|
const td = selectedElement.tableData;
|
|
14303
|
-
const newTableData =
|
|
14357
|
+
const newTableData = chunkXCLYIGHM_js.splitCell(rowIndex, columnIndex, td);
|
|
14304
14358
|
const updates = { tableData: newTableData };
|
|
14305
|
-
const newRawXml =
|
|
14359
|
+
const newRawXml = chunkN7OHVHBS_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
14306
14360
|
if (newRawXml) {
|
|
14307
14361
|
updates.rawXml = newRawXml;
|
|
14308
14362
|
}
|
|
@@ -14346,7 +14400,7 @@ function createTableStructHandlers(input) {
|
|
|
14346
14400
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
14347
14401
|
}
|
|
14348
14402
|
if (el.rawXml) {
|
|
14349
|
-
const newRawXml =
|
|
14403
|
+
const newRawXml = chunkN7OHVHBS_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
14350
14404
|
if (newRawXml) {
|
|
14351
14405
|
updates.rawXml = newRawXml;
|
|
14352
14406
|
}
|
|
@@ -14370,7 +14424,7 @@ function createTableStructHandlers(input) {
|
|
|
14370
14424
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
14371
14425
|
const updates = {};
|
|
14372
14426
|
if (selectedElement.rawXml) {
|
|
14373
|
-
const newRawXml =
|
|
14427
|
+
const newRawXml = chunkN7OHVHBS_js.updateCellTextStyleInRawXml(
|
|
14374
14428
|
selectedElement,
|
|
14375
14429
|
rowIndex,
|
|
14376
14430
|
colIndex,
|
|
@@ -14434,9 +14488,9 @@ function createTableStructHandlers(input) {
|
|
|
14434
14488
|
return;
|
|
14435
14489
|
}
|
|
14436
14490
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
14437
|
-
const newTableData =
|
|
14491
|
+
const newTableData = chunkXCLYIGHM_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
14438
14492
|
const updates = { tableData: newTableData };
|
|
14439
|
-
const newRawXml =
|
|
14493
|
+
const newRawXml = chunkN7OHVHBS_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
14440
14494
|
if (newRawXml) {
|
|
14441
14495
|
updates.rawXml = newRawXml;
|
|
14442
14496
|
}
|
|
@@ -14449,12 +14503,12 @@ function createTableStructHandlers(input) {
|
|
|
14449
14503
|
}
|
|
14450
14504
|
const td = selectedElement.tableData;
|
|
14451
14505
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
14452
|
-
const newTableData =
|
|
14506
|
+
const newTableData = chunkXCLYIGHM_js.deleteTableRow(td, rowIdx);
|
|
14453
14507
|
if (newTableData === td) {
|
|
14454
14508
|
return;
|
|
14455
14509
|
}
|
|
14456
14510
|
const updates = { tableData: newTableData };
|
|
14457
|
-
const newRawXml =
|
|
14511
|
+
const newRawXml = chunkN7OHVHBS_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
14458
14512
|
if (newRawXml) {
|
|
14459
14513
|
updates.rawXml = newRawXml;
|
|
14460
14514
|
}
|
|
@@ -14466,9 +14520,9 @@ function createTableStructHandlers(input) {
|
|
|
14466
14520
|
return;
|
|
14467
14521
|
}
|
|
14468
14522
|
const colIdx = ts?.columnIndex ?? 0;
|
|
14469
|
-
const newTableData =
|
|
14523
|
+
const newTableData = chunkXCLYIGHM_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
14470
14524
|
const updates = { tableData: newTableData };
|
|
14471
|
-
const newRawXml =
|
|
14525
|
+
const newRawXml = chunkN7OHVHBS_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
14472
14526
|
if (newRawXml) {
|
|
14473
14527
|
updates.rawXml = newRawXml;
|
|
14474
14528
|
}
|
|
@@ -14481,12 +14535,12 @@ function createTableStructHandlers(input) {
|
|
|
14481
14535
|
}
|
|
14482
14536
|
const td = selectedElement.tableData;
|
|
14483
14537
|
const colIdx = ts?.columnIndex ?? 0;
|
|
14484
|
-
const newTableData =
|
|
14538
|
+
const newTableData = chunkXCLYIGHM_js.deleteTableColumn(td, colIdx);
|
|
14485
14539
|
if (newTableData === td) {
|
|
14486
14540
|
return;
|
|
14487
14541
|
}
|
|
14488
14542
|
const updates = { tableData: newTableData };
|
|
14489
|
-
const newRawXml =
|
|
14543
|
+
const newRawXml = chunkN7OHVHBS_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
14490
14544
|
if (newRawXml) {
|
|
14491
14545
|
updates.rawXml = newRawXml;
|
|
14492
14546
|
}
|
|
@@ -14522,8 +14576,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
14522
14576
|
return html2canvasPro(element, {
|
|
14523
14577
|
...options,
|
|
14524
14578
|
onclone: async (doc, clonedEl) => {
|
|
14525
|
-
await
|
|
14526
|
-
|
|
14579
|
+
await chunkXCLYIGHM_js.normalizeColorsForCapture(doc, clonedEl);
|
|
14580
|
+
chunkXCLYIGHM_js.preprocessCssForCapture(clonedEl);
|
|
14527
14581
|
if (typeof userOnClone === "function") {
|
|
14528
14582
|
userOnClone(doc, clonedEl);
|
|
14529
14583
|
}
|
|
@@ -14579,7 +14633,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
14579
14633
|
}
|
|
14580
14634
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
14581
14635
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
14582
|
-
|
|
14636
|
+
chunkXCLYIGHM_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
14583
14637
|
}
|
|
14584
14638
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
14585
14639
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -14601,7 +14655,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
14601
14655
|
continue;
|
|
14602
14656
|
}
|
|
14603
14657
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
14604
|
-
images.push(
|
|
14658
|
+
images.push(chunkXCLYIGHM_js.canvasToJpegData(canvas));
|
|
14605
14659
|
}
|
|
14606
14660
|
onProgress?.(totalSlides, totalSlides);
|
|
14607
14661
|
setActiveSlide(currentSlideIndex);
|
|
@@ -14609,7 +14663,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
14609
14663
|
throw new Error(chunkCUUYYYC5_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
14610
14664
|
}
|
|
14611
14665
|
const pdfBlobUrl = buildPdfFromImageData(images);
|
|
14612
|
-
|
|
14666
|
+
chunkXCLYIGHM_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
14613
14667
|
}
|
|
14614
14668
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
14615
14669
|
const { scale = 2, onProgress } = options;
|
|
@@ -14658,7 +14712,7 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
14658
14712
|
throw new Error(chunkCUUYYYC5_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
14659
14713
|
}
|
|
14660
14714
|
const pdfDataUrl = buildNotesPdf(pages);
|
|
14661
|
-
|
|
14715
|
+
chunkXCLYIGHM_js.downloadDataUrl(pdfDataUrl, filename);
|
|
14662
14716
|
}
|
|
14663
14717
|
|
|
14664
14718
|
// src/viewer/utils/export-video.ts
|
|
@@ -14702,7 +14756,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
14702
14756
|
const fps = 30;
|
|
14703
14757
|
const stream = recordingCanvas.captureStream(fps);
|
|
14704
14758
|
const recorder = new MediaRecorder(stream, {
|
|
14705
|
-
mimeType:
|
|
14759
|
+
mimeType: chunkXCLYIGHM_js.pickSupportedMimeType([...chunkXCLYIGHM_js.WEBM_MIME_CANDIDATES]),
|
|
14706
14760
|
videoBitsPerSecond: 5e6
|
|
14707
14761
|
});
|
|
14708
14762
|
const chunks = [];
|
|
@@ -14725,8 +14779,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
14725
14779
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
14726
14780
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
14727
14781
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
14728
|
-
const frameInterval =
|
|
14729
|
-
const framesNeeded =
|
|
14782
|
+
const frameInterval = chunkXCLYIGHM_js.fpsToFrameIntervalMs(fps);
|
|
14783
|
+
const framesNeeded = chunkXCLYIGHM_js.segmentFrameCount(duration, fps);
|
|
14730
14784
|
for (let f = 0; f < framesNeeded; f++) {
|
|
14731
14785
|
if (signal?.aborted) {
|
|
14732
14786
|
recorder.stop();
|
|
@@ -14775,7 +14829,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
14775
14829
|
if (frames.length === 0) {
|
|
14776
14830
|
throw new Error(chunkCUUYYYC5_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
14777
14831
|
}
|
|
14778
|
-
const gifBytes =
|
|
14832
|
+
const gifBytes = chunkXCLYIGHM_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
14779
14833
|
onProgress?.(totalSlides, totalSlides);
|
|
14780
14834
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
14781
14835
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -14829,7 +14883,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
14829
14883
|
continue;
|
|
14830
14884
|
}
|
|
14831
14885
|
onProgress?.(processedCount, data.slides.length);
|
|
14832
|
-
let svg =
|
|
14886
|
+
let svg = chunkN7OHVHBS_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
14833
14887
|
if (embedFonts && fontFaces?.length) {
|
|
14834
14888
|
svg = injectFontFaces(svg, fontFaces);
|
|
14835
14889
|
}
|
|
@@ -14889,7 +14943,7 @@ function useExportSaveAs(input) {
|
|
|
14889
14943
|
}
|
|
14890
14944
|
setExportProgress(70);
|
|
14891
14945
|
setExportStatusMessage("Writing README...");
|
|
14892
|
-
const readme =
|
|
14946
|
+
const readme = chunkXCLYIGHM_js.generatePackageReadme(pptxFilename);
|
|
14893
14947
|
pkgFolder.file("README.txt", readme);
|
|
14894
14948
|
if (abortCtrl.signal.aborted) {
|
|
14895
14949
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -14900,7 +14954,7 @@ function useExportSaveAs(input) {
|
|
|
14900
14954
|
setExportProgress(95);
|
|
14901
14955
|
setExportStatusMessage("Downloading...");
|
|
14902
14956
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
14903
|
-
|
|
14957
|
+
chunkXCLYIGHM_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
14904
14958
|
setExportProgress(100);
|
|
14905
14959
|
} catch (err) {
|
|
14906
14960
|
if (err.name !== "AbortError") {
|
|
@@ -14923,7 +14977,7 @@ function useExportSaveAs(input) {
|
|
|
14923
14977
|
const blob = new Blob([data], {
|
|
14924
14978
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
14925
14979
|
});
|
|
14926
|
-
|
|
14980
|
+
chunkXCLYIGHM_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
14927
14981
|
} catch (err) {
|
|
14928
14982
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
14929
14983
|
}
|
|
@@ -14936,7 +14990,7 @@ function useExportSaveAs(input) {
|
|
|
14936
14990
|
const pptxGuides = guides.map((g) => ({
|
|
14937
14991
|
id: g.id,
|
|
14938
14992
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
14939
|
-
positionEmu:
|
|
14993
|
+
positionEmu: chunkN7OHVHBS_js.guidePxToEmu(g.position)
|
|
14940
14994
|
}));
|
|
14941
14995
|
return {
|
|
14942
14996
|
...slide,
|
|
@@ -15000,7 +15054,7 @@ function safeConfirm(message) {
|
|
|
15000
15054
|
}
|
|
15001
15055
|
}
|
|
15002
15056
|
function downloadBlob2(blob, filename) {
|
|
15003
|
-
|
|
15057
|
+
chunkXCLYIGHM_js.downloadBlob(blob, chunkXCLYIGHM_js.sanitizeDownloadFilename(filename));
|
|
15004
15058
|
}
|
|
15005
15059
|
|
|
15006
15060
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -15101,21 +15155,21 @@ function useExportHandlers(input) {
|
|
|
15101
15155
|
{
|
|
15102
15156
|
scale: 2,
|
|
15103
15157
|
onProgress: (current, total) => {
|
|
15104
|
-
setExportProgress(
|
|
15105
|
-
setExportStatusMessage(
|
|
15158
|
+
setExportProgress(chunkXCLYIGHM_js.slideProgressPercent(current, total));
|
|
15159
|
+
setExportStatusMessage(chunkXCLYIGHM_js.slideStatusLabel("Rendering", current, total));
|
|
15106
15160
|
},
|
|
15107
15161
|
signal: abortCtrl.signal
|
|
15108
15162
|
}
|
|
15109
15163
|
);
|
|
15110
|
-
setExportProgress(
|
|
15164
|
+
setExportProgress(chunkXCLYIGHM_js.EXPORT_ASSEMBLING_PERCENT);
|
|
15111
15165
|
setExportStatusMessage("Building PDF...");
|
|
15112
15166
|
await new Promise((r) => {
|
|
15113
15167
|
setTimeout(r, 100);
|
|
15114
15168
|
});
|
|
15115
|
-
setExportProgress(
|
|
15169
|
+
setExportProgress(chunkXCLYIGHM_js.EXPORT_DONE_PERCENT);
|
|
15116
15170
|
setExportStatusMessage("Done!");
|
|
15117
15171
|
} catch (err) {
|
|
15118
|
-
if (!
|
|
15172
|
+
if (!chunkXCLYIGHM_js.isExportAbortError(err)) {
|
|
15119
15173
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
15120
15174
|
}
|
|
15121
15175
|
} finally {
|
|
@@ -15145,21 +15199,21 @@ function useExportHandlers(input) {
|
|
|
15145
15199
|
{
|
|
15146
15200
|
scale: 2,
|
|
15147
15201
|
onProgress: (current, total) => {
|
|
15148
|
-
setExportProgress(
|
|
15149
|
-
setExportStatusMessage(
|
|
15202
|
+
setExportProgress(chunkXCLYIGHM_js.slideProgressPercent(current, total));
|
|
15203
|
+
setExportStatusMessage(chunkXCLYIGHM_js.slideStatusLabel("Rendering", current, total));
|
|
15150
15204
|
},
|
|
15151
15205
|
signal: abortCtrl.signal
|
|
15152
15206
|
}
|
|
15153
15207
|
);
|
|
15154
|
-
setExportProgress(
|
|
15208
|
+
setExportProgress(chunkXCLYIGHM_js.EXPORT_ASSEMBLING_PERCENT);
|
|
15155
15209
|
setExportStatusMessage("Building PDF...");
|
|
15156
15210
|
await new Promise((r) => {
|
|
15157
15211
|
setTimeout(r, 100);
|
|
15158
15212
|
});
|
|
15159
|
-
setExportProgress(
|
|
15213
|
+
setExportProgress(chunkXCLYIGHM_js.EXPORT_DONE_PERCENT);
|
|
15160
15214
|
setExportStatusMessage("Done!");
|
|
15161
15215
|
} catch (err) {
|
|
15162
|
-
if (!
|
|
15216
|
+
if (!chunkXCLYIGHM_js.isExportAbortError(err)) {
|
|
15163
15217
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
15164
15218
|
}
|
|
15165
15219
|
} finally {
|
|
@@ -15200,22 +15254,22 @@ function useExportHandlers(input) {
|
|
|
15200
15254
|
scale: 1,
|
|
15201
15255
|
slideDurationMs: 3e3,
|
|
15202
15256
|
onProgress: (current, total) => {
|
|
15203
|
-
setExportProgress(
|
|
15204
|
-
setExportStatusMessage(
|
|
15257
|
+
setExportProgress(chunkXCLYIGHM_js.slideProgressPercent(current, total, 45));
|
|
15258
|
+
setExportStatusMessage(chunkXCLYIGHM_js.slideStatusLabel("Capturing", current, total));
|
|
15205
15259
|
},
|
|
15206
15260
|
onRecordProgress: (current, total) => {
|
|
15207
|
-
setExportProgress(
|
|
15208
|
-
setExportStatusMessage(
|
|
15261
|
+
setExportProgress(chunkXCLYIGHM_js.recordProgressPercent(current, total));
|
|
15262
|
+
setExportStatusMessage(chunkXCLYIGHM_js.slideStatusLabel("Recording", current, total));
|
|
15209
15263
|
},
|
|
15210
15264
|
signal: abortCtrl.signal
|
|
15211
15265
|
}
|
|
15212
15266
|
);
|
|
15213
|
-
setExportProgress(
|
|
15267
|
+
setExportProgress(chunkXCLYIGHM_js.EXPORT_ASSEMBLING_PERCENT);
|
|
15214
15268
|
setExportStatusMessage("Saving file...");
|
|
15215
15269
|
downloadBlob2(blob, "presentation.webm");
|
|
15216
|
-
setExportProgress(
|
|
15270
|
+
setExportProgress(chunkXCLYIGHM_js.EXPORT_DONE_PERCENT);
|
|
15217
15271
|
} catch (err) {
|
|
15218
|
-
if (!
|
|
15272
|
+
if (!chunkXCLYIGHM_js.isExportAbortError(err)) {
|
|
15219
15273
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
15220
15274
|
}
|
|
15221
15275
|
} finally {
|
|
@@ -15243,18 +15297,18 @@ function useExportHandlers(input) {
|
|
|
15243
15297
|
scale: 0.5,
|
|
15244
15298
|
slideDurationMs: 2e3,
|
|
15245
15299
|
onProgress: (current, total) => {
|
|
15246
|
-
setExportProgress(
|
|
15247
|
-
setExportStatusMessage(
|
|
15300
|
+
setExportProgress(chunkXCLYIGHM_js.slideProgressPercent(current, total));
|
|
15301
|
+
setExportStatusMessage(chunkXCLYIGHM_js.slideStatusLabel("Encoding", current, total));
|
|
15248
15302
|
},
|
|
15249
15303
|
signal: abortCtrl.signal
|
|
15250
15304
|
}
|
|
15251
15305
|
);
|
|
15252
|
-
setExportProgress(
|
|
15306
|
+
setExportProgress(chunkXCLYIGHM_js.EXPORT_ASSEMBLING_PERCENT);
|
|
15253
15307
|
setExportStatusMessage("Saving file...");
|
|
15254
15308
|
downloadBlob2(blob, "presentation.gif");
|
|
15255
|
-
setExportProgress(
|
|
15309
|
+
setExportProgress(chunkXCLYIGHM_js.EXPORT_DONE_PERCENT);
|
|
15256
15310
|
} catch (err) {
|
|
15257
|
-
if (!
|
|
15311
|
+
if (!chunkXCLYIGHM_js.isExportAbortError(err)) {
|
|
15258
15312
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
15259
15313
|
}
|
|
15260
15314
|
} finally {
|
|
@@ -15294,7 +15348,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
15294
15348
|
}
|
|
15295
15349
|
printWindow.document.open();
|
|
15296
15350
|
printWindow.document.write(
|
|
15297
|
-
|
|
15351
|
+
chunkXCLYIGHM_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
15298
15352
|
);
|
|
15299
15353
|
printWindow.document.close();
|
|
15300
15354
|
printWindow.focus();
|
|
@@ -15355,7 +15409,7 @@ function usePrintHandlers(input) {
|
|
|
15355
15409
|
if (svgs.length === 0) {
|
|
15356
15410
|
return;
|
|
15357
15411
|
}
|
|
15358
|
-
const printDoc =
|
|
15412
|
+
const printDoc = chunkXCLYIGHM_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
15359
15413
|
title: "Slides (Vector)",
|
|
15360
15414
|
orientation: settings.orientation,
|
|
15361
15415
|
colorFilter
|
|
@@ -15391,7 +15445,7 @@ function usePrintHandlers(input) {
|
|
|
15391
15445
|
if (settings.printWhat === "outline") {
|
|
15392
15446
|
openPrintWindow(
|
|
15393
15447
|
"Outline",
|
|
15394
|
-
`<div class="outline-page">${
|
|
15448
|
+
`<div class="outline-page">${chunkXCLYIGHM_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
15395
15449
|
settings.orientation,
|
|
15396
15450
|
colorFilter,
|
|
15397
15451
|
settings.frameSlides
|
|
@@ -15416,7 +15470,7 @@ function usePrintHandlers(input) {
|
|
|
15416
15470
|
if (settings.printWhat === "slides") {
|
|
15417
15471
|
openPrintWindow(
|
|
15418
15472
|
"Slides",
|
|
15419
|
-
|
|
15473
|
+
chunkXCLYIGHM_js.buildSlidesHtml(slideImages, slideIndices),
|
|
15420
15474
|
settings.orientation,
|
|
15421
15475
|
colorFilter,
|
|
15422
15476
|
settings.frameSlides
|
|
@@ -15426,7 +15480,7 @@ function usePrintHandlers(input) {
|
|
|
15426
15480
|
if (settings.printWhat === "notes") {
|
|
15427
15481
|
openPrintWindow(
|
|
15428
15482
|
"Notes Pages",
|
|
15429
|
-
|
|
15483
|
+
chunkXCLYIGHM_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
15430
15484
|
"portrait",
|
|
15431
15485
|
colorFilter,
|
|
15432
15486
|
settings.frameSlides
|
|
@@ -15437,7 +15491,7 @@ function usePrintHandlers(input) {
|
|
|
15437
15491
|
const spp = settings.slidesPerPage;
|
|
15438
15492
|
openPrintWindow(
|
|
15439
15493
|
`Handout ${spp} per page`,
|
|
15440
|
-
|
|
15494
|
+
chunkXCLYIGHM_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
15441
15495
|
"portrait",
|
|
15442
15496
|
colorFilter,
|
|
15443
15497
|
settings.frameSlides
|
|
@@ -15501,8 +15555,8 @@ function useThemeHandlers(input) {
|
|
|
15501
15555
|
return;
|
|
15502
15556
|
}
|
|
15503
15557
|
await handler.updateThemeColorScheme(colorScheme);
|
|
15504
|
-
const previousMap = theme?.colorScheme ?
|
|
15505
|
-
setSlides((prev) =>
|
|
15558
|
+
const previousMap = theme?.colorScheme ? chunkN7OHVHBS_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
15559
|
+
setSlides((prev) => chunkN7OHVHBS_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
15506
15560
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
15507
15561
|
bumpHistory();
|
|
15508
15562
|
history.markDirty();
|
|
@@ -15607,7 +15661,7 @@ function useThemeSwitching(input) {
|
|
|
15607
15661
|
}
|
|
15608
15662
|
try {
|
|
15609
15663
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
15610
|
-
const newData =
|
|
15664
|
+
const newData = chunkN7OHVHBS_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
15611
15665
|
onDataChange(newData);
|
|
15612
15666
|
onThemeChanged?.(preset);
|
|
15613
15667
|
} catch (error) {
|
|
@@ -15624,7 +15678,7 @@ function useThemeSwitching(input) {
|
|
|
15624
15678
|
}
|
|
15625
15679
|
try {
|
|
15626
15680
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
15627
|
-
const newData =
|
|
15681
|
+
const newData = chunkN7OHVHBS_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
15628
15682
|
onDataChange(newData);
|
|
15629
15683
|
} catch (error) {
|
|
15630
15684
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -15636,12 +15690,12 @@ function useThemeSwitching(input) {
|
|
|
15636
15690
|
if (!data?.theme?.colorScheme) {
|
|
15637
15691
|
return void 0;
|
|
15638
15692
|
}
|
|
15639
|
-
return
|
|
15640
|
-
(p) =>
|
|
15693
|
+
return chunkN7OHVHBS_js.THEME_PRESETS.find(
|
|
15694
|
+
(p) => chunkN7OHVHBS_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
15641
15695
|
);
|
|
15642
15696
|
}, [data?.theme?.colorScheme]);
|
|
15643
15697
|
return {
|
|
15644
|
-
presets:
|
|
15698
|
+
presets: chunkN7OHVHBS_js.THEME_PRESETS,
|
|
15645
15699
|
switchToPreset,
|
|
15646
15700
|
switchToCustom,
|
|
15647
15701
|
currentPreset
|
|
@@ -15716,7 +15770,7 @@ function usePropertyHandlers(input) {
|
|
|
15716
15770
|
}
|
|
15717
15771
|
try {
|
|
15718
15772
|
const ab = await file.arrayBuffer();
|
|
15719
|
-
const h = new
|
|
15773
|
+
const h = new chunkN7OHVHBS_js.PptxHandler();
|
|
15720
15774
|
const other = await h.load(ab);
|
|
15721
15775
|
if (!other) {
|
|
15722
15776
|
return;
|
|
@@ -15726,7 +15780,7 @@ function usePropertyHandlers(input) {
|
|
|
15726
15780
|
width: canvasSize.width,
|
|
15727
15781
|
height: canvasSize.height
|
|
15728
15782
|
};
|
|
15729
|
-
setCompareResult(
|
|
15783
|
+
setCompareResult(chunkXCLYIGHM_js.comparePresentation(cur, other));
|
|
15730
15784
|
setIsComparePanelOpen(true);
|
|
15731
15785
|
} catch (err) {
|
|
15732
15786
|
console.warn("Compare failed:", err);
|
|
@@ -15743,7 +15797,7 @@ function usePropertyHandlers(input) {
|
|
|
15743
15797
|
if (!diff || diff.status === "unchanged") {
|
|
15744
15798
|
return;
|
|
15745
15799
|
}
|
|
15746
|
-
setSlides((prev) =>
|
|
15800
|
+
setSlides((prev) => chunkXCLYIGHM_js.applyAcceptSlide(prev, diff));
|
|
15747
15801
|
setIsDirty(true);
|
|
15748
15802
|
},
|
|
15749
15803
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -15754,10 +15808,10 @@ function usePropertyHandlers(input) {
|
|
|
15754
15808
|
if (!compareResult) {
|
|
15755
15809
|
return;
|
|
15756
15810
|
}
|
|
15757
|
-
setSlides((prev) =>
|
|
15811
|
+
setSlides((prev) => chunkXCLYIGHM_js.applyAcceptAllSlides(prev, compareResult));
|
|
15758
15812
|
setIsDirty(true);
|
|
15759
15813
|
}, [compareResult, setSlides, setIsDirty]);
|
|
15760
|
-
const usedFontFamilies = React4.useMemo(() =>
|
|
15814
|
+
const usedFontFamilies = React4.useMemo(() => chunkXCLYIGHM_js.collectUsedFonts(slides), [slides]);
|
|
15761
15815
|
return {
|
|
15762
15816
|
handleUpdateNotes,
|
|
15763
15817
|
handleUpdateSlide,
|
|
@@ -15876,7 +15930,7 @@ function useIsMobile(input) {
|
|
|
15876
15930
|
const containerRef = input?.containerRef;
|
|
15877
15931
|
const isTouchDevice = React4.useSyncExternalStore(
|
|
15878
15932
|
subscribeTouchCapability,
|
|
15879
|
-
|
|
15933
|
+
chunkXCLYIGHM_js.detectTouchDevice,
|
|
15880
15934
|
() => false
|
|
15881
15935
|
// server snapshot
|
|
15882
15936
|
);
|
|
@@ -15892,7 +15946,7 @@ function useIsMobile(input) {
|
|
|
15892
15946
|
}
|
|
15893
15947
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
15894
15948
|
});
|
|
15895
|
-
const [orientation, setOrientation] = React4.useState(
|
|
15949
|
+
const [orientation, setOrientation] = React4.useState(chunkXCLYIGHM_js.detectOrientation);
|
|
15896
15950
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = React4.useState(false);
|
|
15897
15951
|
const [initialViewportHeight] = React4.useState(
|
|
15898
15952
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -15936,7 +15990,7 @@ function useIsMobile(input) {
|
|
|
15936
15990
|
return;
|
|
15937
15991
|
}
|
|
15938
15992
|
const handleOrientationChange = () => {
|
|
15939
|
-
setOrientation(
|
|
15993
|
+
setOrientation(chunkXCLYIGHM_js.detectOrientation());
|
|
15940
15994
|
};
|
|
15941
15995
|
if (screen.orientation) {
|
|
15942
15996
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -15966,9 +16020,9 @@ function useIsMobile(input) {
|
|
|
15966
16020
|
window.addEventListener("resize", handleResize);
|
|
15967
16021
|
return () => window.removeEventListener("resize", handleResize);
|
|
15968
16022
|
}, [isTouchDevice, initialViewportHeight]);
|
|
15969
|
-
const isMobile =
|
|
15970
|
-
const isTablet = !isMobile && containerWidth >=
|
|
15971
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
16023
|
+
const isMobile = chunkXCLYIGHM_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
16024
|
+
const isTablet = !isMobile && containerWidth >= chunkXCLYIGHM_js.MOBILE_BREAKPOINT && containerWidth < chunkXCLYIGHM_js.TABLET_BREAKPOINT;
|
|
16025
|
+
const isDesktop = !isMobile && containerWidth >= chunkXCLYIGHM_js.TABLET_BREAKPOINT;
|
|
15972
16026
|
return {
|
|
15973
16027
|
isMobile,
|
|
15974
16028
|
isTablet,
|
|
@@ -16029,11 +16083,11 @@ function useViewerDialogs(input) {
|
|
|
16029
16083
|
);
|
|
16030
16084
|
const [embedFontsEnabled, setEmbedFontsEnabled] = React4.useState(false);
|
|
16031
16085
|
const [isNarrowViewport, setIsNarrowViewport] = React4.useState(
|
|
16032
|
-
() => typeof window !== "undefined" ?
|
|
16086
|
+
() => typeof window !== "undefined" ? chunkXCLYIGHM_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
16033
16087
|
);
|
|
16034
16088
|
React4.useEffect(() => {
|
|
16035
16089
|
const handleWindow = () => setIsNarrowViewport(
|
|
16036
|
-
|
|
16090
|
+
chunkXCLYIGHM_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
16037
16091
|
);
|
|
16038
16092
|
let observer = null;
|
|
16039
16093
|
let raf = 0;
|
|
@@ -16047,12 +16101,12 @@ function useViewerDialogs(input) {
|
|
|
16047
16101
|
const entry = entries[0];
|
|
16048
16102
|
if (entry) {
|
|
16049
16103
|
setIsNarrowViewport(
|
|
16050
|
-
|
|
16104
|
+
chunkXCLYIGHM_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
16051
16105
|
);
|
|
16052
16106
|
}
|
|
16053
16107
|
});
|
|
16054
16108
|
observer.observe(el);
|
|
16055
|
-
setIsNarrowViewport(
|
|
16109
|
+
setIsNarrowViewport(chunkXCLYIGHM_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
16056
16110
|
};
|
|
16057
16111
|
attach();
|
|
16058
16112
|
window.addEventListener("resize", handleWindow);
|
|
@@ -16229,7 +16283,7 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
|
16229
16283
|
return slides.map((_, i) => i).filter((i) => !slides[i]?.hidden);
|
|
16230
16284
|
}
|
|
16231
16285
|
function computeSlideSectionGroups(slides, sections) {
|
|
16232
|
-
return
|
|
16286
|
+
return chunkXCLYIGHM_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
16233
16287
|
id: group.section?.id ?? (sections.length > 0 ? UNGROUPED_SECTION_ID : "default"),
|
|
16234
16288
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
16235
16289
|
slideIndexes: group.slideIndexes,
|
|
@@ -16450,6 +16504,7 @@ function useSerialize(input) {
|
|
|
16450
16504
|
tagCollections,
|
|
16451
16505
|
notesMaster,
|
|
16452
16506
|
handoutMaster,
|
|
16507
|
+
embeddedFonts,
|
|
16453
16508
|
handlerRef,
|
|
16454
16509
|
inlineEditingElementIdRef,
|
|
16455
16510
|
inlineEditingTextRef,
|
|
@@ -16466,13 +16521,13 @@ function useSerialize(input) {
|
|
|
16466
16521
|
let processedSlide = slide;
|
|
16467
16522
|
if (pendingEditId) {
|
|
16468
16523
|
const updatedElements = slide.elements.map((el) => {
|
|
16469
|
-
if (el.id !== pendingEditId || !
|
|
16524
|
+
if (el.id !== pendingEditId || !chunkN7OHVHBS_js.hasTextProperties(el)) {
|
|
16470
16525
|
return el;
|
|
16471
16526
|
}
|
|
16472
16527
|
return {
|
|
16473
16528
|
...el,
|
|
16474
16529
|
text: pendingEditText,
|
|
16475
|
-
textSegments:
|
|
16530
|
+
textSegments: chunkXCLYIGHM_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
16476
16531
|
};
|
|
16477
16532
|
});
|
|
16478
16533
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -16485,7 +16540,7 @@ function useSerialize(input) {
|
|
|
16485
16540
|
const pptxGuides = guides.map((g) => ({
|
|
16486
16541
|
id: g.id,
|
|
16487
16542
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
16488
|
-
positionEmu:
|
|
16543
|
+
positionEmu: chunkN7OHVHBS_js.guidePxToEmu(g.position)
|
|
16489
16544
|
}));
|
|
16490
16545
|
return {
|
|
16491
16546
|
...processedSlide,
|
|
@@ -16503,7 +16558,8 @@ function useSerialize(input) {
|
|
|
16503
16558
|
customProperties: customProperties.length > 0 ? customProperties : void 0,
|
|
16504
16559
|
tags: tagCollections.length > 0 ? tagCollections : void 0,
|
|
16505
16560
|
notesMaster,
|
|
16506
|
-
handoutMaster
|
|
16561
|
+
handoutMaster,
|
|
16562
|
+
embeddedFonts: embeddedFonts.length > 0 ? embeddedFonts : void 0
|
|
16507
16563
|
};
|
|
16508
16564
|
if (password) {
|
|
16509
16565
|
return handler.saveEncrypted(slidesToSave, password, saveOptions);
|
|
@@ -16522,6 +16578,7 @@ function useSerialize(input) {
|
|
|
16522
16578
|
tagCollections,
|
|
16523
16579
|
notesMaster,
|
|
16524
16580
|
handoutMaster,
|
|
16581
|
+
embeddedFonts,
|
|
16525
16582
|
guides,
|
|
16526
16583
|
activeSlideIndex,
|
|
16527
16584
|
handlerRef,
|
|
@@ -16719,10 +16776,10 @@ function usePresentationSetup(input) {
|
|
|
16719
16776
|
onToggleEraser: () => annotations.setPresentationTool("eraser"),
|
|
16720
16777
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
16721
16778
|
onSaveRehearsalTimings: (timings) => {
|
|
16722
|
-
setSlides((prev) =>
|
|
16779
|
+
setSlides((prev) => chunkXCLYIGHM_js.applyRehearsalTimings(prev, timings));
|
|
16723
16780
|
history.markDirty();
|
|
16724
16781
|
},
|
|
16725
|
-
loopContinuously:
|
|
16782
|
+
loopContinuously: chunkXCLYIGHM_js.shouldLoopContinuously(presentationProperties),
|
|
16726
16783
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
16727
16784
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
16728
16785
|
endWithBlackSlide
|
|
@@ -16884,7 +16941,7 @@ function useEditorOperations(input) {
|
|
|
16884
16941
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
16885
16942
|
React4.useEffect(() => {
|
|
16886
16943
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
16887
|
-
copiedFormatRef.current =
|
|
16944
|
+
copiedFormatRef.current = chunkXCLYIGHM_js.copyFormatFromElement(selectedElement);
|
|
16888
16945
|
} else if (!formatPainterActive) {
|
|
16889
16946
|
copiedFormatRef.current = null;
|
|
16890
16947
|
}
|
|
@@ -16910,12 +16967,12 @@ function useEditorOperations(input) {
|
|
|
16910
16967
|
e.stopPropagation();
|
|
16911
16968
|
const element = elementLookup.get(elementId);
|
|
16912
16969
|
if (element) {
|
|
16913
|
-
const updated =
|
|
16970
|
+
const updated = chunkXCLYIGHM_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
16914
16971
|
const updates = {};
|
|
16915
|
-
if (
|
|
16972
|
+
if (chunkN7OHVHBS_js.hasShapeProperties(updated)) {
|
|
16916
16973
|
updates.shapeStyle = updated.shapeStyle;
|
|
16917
16974
|
}
|
|
16918
|
-
if (
|
|
16975
|
+
if (chunkN7OHVHBS_js.hasTextProperties(updated)) {
|
|
16919
16976
|
updates.textStyle = updated.textStyle;
|
|
16920
16977
|
}
|
|
16921
16978
|
ops.updateElementById(elementId, updates);
|
|
@@ -17062,7 +17119,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
17062
17119
|
const families = /* @__PURE__ */ new Set();
|
|
17063
17120
|
for (const slide of slides) {
|
|
17064
17121
|
for (const el of slide.elements) {
|
|
17065
|
-
if (
|
|
17122
|
+
if (chunkN7OHVHBS_js.hasTextProperties(el) && el.textSegments) {
|
|
17066
17123
|
for (const seg of el.textSegments) {
|
|
17067
17124
|
if (seg.style.fontFamily) {
|
|
17068
17125
|
families.add(seg.style.fontFamily);
|
|
@@ -17256,6 +17313,7 @@ function useContentLifecycle(input) {
|
|
|
17256
17313
|
tagCollections: state.tagCollections,
|
|
17257
17314
|
notesMaster: state.notesMaster,
|
|
17258
17315
|
handoutMaster: state.handoutMaster,
|
|
17316
|
+
embeddedFonts: state.embeddedFonts,
|
|
17259
17317
|
handlerRef,
|
|
17260
17318
|
inlineEditingElementIdRef: state.inlineEditingElementIdRef,
|
|
17261
17319
|
inlineEditingTextRef: state.inlineEditingTextRef,
|
|
@@ -17742,7 +17800,7 @@ function useViewerIntegration(input) {
|
|
|
17742
17800
|
if (onDirtyChange) {
|
|
17743
17801
|
onDirtyChange(state.isDirty);
|
|
17744
17802
|
}
|
|
17745
|
-
}, [state.isDirty, onDirtyChange]);
|
|
17803
|
+
}, [state.isDirty, state.slides, state.embeddedFonts, onDirtyChange]);
|
|
17746
17804
|
React4.useEffect(() => {
|
|
17747
17805
|
if (onActiveSlideChange) {
|
|
17748
17806
|
onActiveSlideChange(activeSlideIndex);
|
|
@@ -17845,7 +17903,7 @@ function useReducedMotion() {
|
|
|
17845
17903
|
}
|
|
17846
17904
|
function useViewerOptions() {
|
|
17847
17905
|
const storeRef = React4.useRef(null);
|
|
17848
|
-
storeRef.current ??=
|
|
17906
|
+
storeRef.current ??= chunkXCLYIGHM_js.createViewerOptionsStore();
|
|
17849
17907
|
const store = storeRef.current;
|
|
17850
17908
|
const options = React4.useSyncExternalStore(
|
|
17851
17909
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -17854,9 +17912,9 @@ function useViewerOptions() {
|
|
|
17854
17912
|
);
|
|
17855
17913
|
return { optionsStore: store, options };
|
|
17856
17914
|
}
|
|
17857
|
-
var KNOWN_TAB_IDS = new Set(
|
|
17915
|
+
var KNOWN_TAB_IDS = new Set(chunkXCLYIGHM_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
17858
17916
|
function computeToolbarVisibility(hiddenActions) {
|
|
17859
|
-
const isHidden = (id) =>
|
|
17917
|
+
const isHidden = (id) => chunkXCLYIGHM_js.isActionHidden(id, hiddenActions);
|
|
17860
17918
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
17861
17919
|
return { isHidden, isTabVisible };
|
|
17862
17920
|
}
|
|
@@ -17941,10 +17999,10 @@ function useYjsDocumentSync({
|
|
|
17941
17999
|
return;
|
|
17942
18000
|
}
|
|
17943
18001
|
try {
|
|
17944
|
-
const { PptxHandler: PptxHandler2 } = await import('./dist-
|
|
18002
|
+
const { PptxHandler: PptxHandler2 } = await import('./dist-72WLGYVZ.js');
|
|
17945
18003
|
const handler = new PptxHandler2();
|
|
17946
18004
|
await handler.load(sourceBytes.buffer);
|
|
17947
|
-
const currentSlides =
|
|
18005
|
+
const currentSlides = chunkXCLYIGHM_js.readSlidesFromYDoc(
|
|
17948
18006
|
doc
|
|
17949
18007
|
);
|
|
17950
18008
|
const slidesToSave = buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
@@ -17962,7 +18020,7 @@ function useYjsDocumentSync({
|
|
|
17962
18020
|
if (!doc || !isConnected) {
|
|
17963
18021
|
return;
|
|
17964
18022
|
}
|
|
17965
|
-
const docSlides =
|
|
18023
|
+
const docSlides = chunkXCLYIGHM_js.readSlidesFromYDoc(
|
|
17966
18024
|
doc
|
|
17967
18025
|
);
|
|
17968
18026
|
if (docSlides.length === 0) {
|
|
@@ -17984,11 +18042,11 @@ function useYjsDocumentSync({
|
|
|
17984
18042
|
lastSyncedRef.current = serialized;
|
|
17985
18043
|
void (async () => {
|
|
17986
18044
|
const factories = await getFactories();
|
|
17987
|
-
|
|
18045
|
+
chunkXCLYIGHM_js.reconcileSlidesInYDoc(
|
|
17988
18046
|
slides,
|
|
17989
18047
|
doc,
|
|
17990
18048
|
factories,
|
|
17991
|
-
|
|
18049
|
+
chunkXCLYIGHM_js.LOCAL_SYNC_ORIGIN
|
|
17992
18050
|
);
|
|
17993
18051
|
scheduleWriteBack();
|
|
17994
18052
|
})();
|
|
@@ -18002,10 +18060,10 @@ function useYjsDocumentSync({
|
|
|
18002
18060
|
return;
|
|
18003
18061
|
}
|
|
18004
18062
|
const handleChange = (_events, transaction) => {
|
|
18005
|
-
if (transaction?.origin ===
|
|
18063
|
+
if (transaction?.origin === chunkXCLYIGHM_js.LOCAL_SYNC_ORIGIN) {
|
|
18006
18064
|
return;
|
|
18007
18065
|
}
|
|
18008
|
-
const remoteSlides =
|
|
18066
|
+
const remoteSlides = chunkXCLYIGHM_js.readSlidesFromYDoc(
|
|
18009
18067
|
doc
|
|
18010
18068
|
);
|
|
18011
18069
|
if (remoteSlides.length === 0) {
|
|
@@ -18021,7 +18079,7 @@ function useYjsDocumentSync({
|
|
|
18021
18079
|
isApplyingRemoteRef.current = false;
|
|
18022
18080
|
scheduleWriteBack();
|
|
18023
18081
|
};
|
|
18024
|
-
const unobserve =
|
|
18082
|
+
const unobserve = chunkXCLYIGHM_js.observeYDocSlides(
|
|
18025
18083
|
doc,
|
|
18026
18084
|
handleChange
|
|
18027
18085
|
);
|
|
@@ -18059,7 +18117,7 @@ function useBroadcastFollower({
|
|
|
18059
18117
|
if (!broadcaster) {
|
|
18060
18118
|
return;
|
|
18061
18119
|
}
|
|
18062
|
-
if (!
|
|
18120
|
+
if (!chunkXCLYIGHM_js.shouldAutoFollowBroadcaster({
|
|
18063
18121
|
localRole: collab.config.role,
|
|
18064
18122
|
broadcasterRole: broadcaster.role
|
|
18065
18123
|
})) {
|
|
@@ -18194,7 +18252,7 @@ function useTouchGestures(input) {
|
|
|
18194
18252
|
if (!el || !enabled) {
|
|
18195
18253
|
return;
|
|
18196
18254
|
}
|
|
18197
|
-
const recognizer =
|
|
18255
|
+
const recognizer = chunkXCLYIGHM_js.createTouchGestureRecognizer({
|
|
18198
18256
|
getScale: () => scaleRef.current,
|
|
18199
18257
|
minScale: MIN_ZOOM_SCALE,
|
|
18200
18258
|
maxScale: MAX_ZOOM_SCALE,
|
|
@@ -18237,7 +18295,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
18237
18295
|
return;
|
|
18238
18296
|
}
|
|
18239
18297
|
const rect = active.getBoundingClientRect();
|
|
18240
|
-
const delta =
|
|
18298
|
+
const delta = chunkXCLYIGHM_js.computeScrollDelta(
|
|
18241
18299
|
{ top: rect.top, bottom: rect.bottom },
|
|
18242
18300
|
window.innerHeight,
|
|
18243
18301
|
keyboardInset
|
|
@@ -18257,8 +18315,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18257
18315
|
return;
|
|
18258
18316
|
}
|
|
18259
18317
|
const update = () => {
|
|
18260
|
-
const metrics =
|
|
18261
|
-
const inset = metrics ?
|
|
18318
|
+
const metrics = chunkXCLYIGHM_js.readViewportMetrics(window);
|
|
18319
|
+
const inset = metrics ? chunkXCLYIGHM_js.computeKeyboardInset(metrics) : 0;
|
|
18262
18320
|
setKeyboardInset(inset);
|
|
18263
18321
|
if (inset > 0) {
|
|
18264
18322
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -18269,8 +18327,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18269
18327
|
vv.addEventListener("scroll", update);
|
|
18270
18328
|
const onFocusIn = () => {
|
|
18271
18329
|
window.requestAnimationFrame(() => {
|
|
18272
|
-
const metrics =
|
|
18273
|
-
const inset = metrics ?
|
|
18330
|
+
const metrics = chunkXCLYIGHM_js.readViewportMetrics(window);
|
|
18331
|
+
const inset = metrics ? chunkXCLYIGHM_js.computeKeyboardInset(metrics) : 0;
|
|
18274
18332
|
if (inset > 0) {
|
|
18275
18333
|
scrollFocusedIntoView(inset);
|
|
18276
18334
|
}
|
|
@@ -18283,7 +18341,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18283
18341
|
document.removeEventListener("focusin", onFocusIn);
|
|
18284
18342
|
};
|
|
18285
18343
|
}, [enabled]);
|
|
18286
|
-
return { keyboardInset, isKeyboardOpen:
|
|
18344
|
+
return { keyboardInset, isKeyboardOpen: chunkXCLYIGHM_js.isKeyboardOpen(keyboardInset) };
|
|
18287
18345
|
}
|
|
18288
18346
|
|
|
18289
18347
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -18338,13 +18396,13 @@ function buildCanvasProps(input) {
|
|
|
18338
18396
|
if (mode === "present") {
|
|
18339
18397
|
presentation.handlePresentationAction(action);
|
|
18340
18398
|
} else if (action.url) {
|
|
18341
|
-
|
|
18399
|
+
chunkXCLYIGHM_js.safeOpenUrl(action.url);
|
|
18342
18400
|
}
|
|
18343
18401
|
};
|
|
18344
18402
|
const handleHyperlinkClick = (url) => {
|
|
18345
|
-
if (
|
|
18403
|
+
if (chunkXCLYIGHM_js.isPpactionUrl(url)) {
|
|
18346
18404
|
if (mode === "present") {
|
|
18347
|
-
const parsed =
|
|
18405
|
+
const parsed = chunkXCLYIGHM_js.parsePpactionUrl(url);
|
|
18348
18406
|
if (parsed) {
|
|
18349
18407
|
presentation.handlePresentationAction({
|
|
18350
18408
|
action: parsed.action,
|
|
@@ -18354,7 +18412,7 @@ function buildCanvasProps(input) {
|
|
|
18354
18412
|
}
|
|
18355
18413
|
return;
|
|
18356
18414
|
}
|
|
18357
|
-
|
|
18415
|
+
chunkXCLYIGHM_js.safeOpenUrl(url);
|
|
18358
18416
|
};
|
|
18359
18417
|
return {
|
|
18360
18418
|
activeSlide: effectiveSlide,
|
|
@@ -18674,7 +18732,7 @@ function buildToolbarProps(input) {
|
|
|
18674
18732
|
onOpenFile,
|
|
18675
18733
|
onOpenRecentFile,
|
|
18676
18734
|
onCreatePresentation: (templateId) => {
|
|
18677
|
-
s.setSlides(
|
|
18735
|
+
s.setSlides(chunkXCLYIGHM_js.createBackstagePresentation(templateId));
|
|
18678
18736
|
s.setActiveSlideIndex(0);
|
|
18679
18737
|
s.setSelectedElementId(null);
|
|
18680
18738
|
s.setSelectedElementIds([]);
|
|
@@ -18735,7 +18793,7 @@ function buildToolbarProps(input) {
|
|
|
18735
18793
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
18736
18794
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
18737
18795
|
formatPainterActive: s.formatPainterActive,
|
|
18738
|
-
canActivateFormatPainter:
|
|
18796
|
+
canActivateFormatPainter: chunkXCLYIGHM_js.hasCopyableFormat(selectedElement),
|
|
18739
18797
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
18740
18798
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
18741
18799
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -18998,7 +19056,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
18998
19056
|
}, [incomingContent]);
|
|
18999
19057
|
const onOpenFile = React4.useCallback(() => {
|
|
19000
19058
|
void (async () => {
|
|
19001
|
-
const picked = await
|
|
19059
|
+
const picked = await chunkXCLYIGHM_js.openPptxFile();
|
|
19002
19060
|
if (picked) {
|
|
19003
19061
|
setContent(picked.buffer);
|
|
19004
19062
|
}
|
|
@@ -19006,7 +19064,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
19006
19064
|
}, []);
|
|
19007
19065
|
const onOpenRecentFile = React4.useCallback((key) => {
|
|
19008
19066
|
void (async () => {
|
|
19009
|
-
const bytes = await
|
|
19067
|
+
const bytes = await chunkXCLYIGHM_js.readBackstageRecentFile(key);
|
|
19010
19068
|
if (bytes) {
|
|
19011
19069
|
setContent(bytes);
|
|
19012
19070
|
}
|