@aixa-transformation/pptx-viewer 2.0.2 → 2.0.3
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/README.md +9 -9
- package/dist/{Model3DScene-VLHFNN5B.js → Model3DScene-AXKDOUCK.js} +3 -3
- package/dist/{Model3DScene-5ODZLKJM.mjs → Model3DScene-UD6SIIUP.mjs} +2 -2
- package/dist/{SurfaceChart3DScene-C6GQQQB7.mjs → SurfaceChart3DScene-JBEJR7Z4.mjs} +2 -2
- package/dist/{SurfaceChart3DScene-KHMGQAGP.js → SurfaceChart3DScene-JU2MS2BP.js} +3 -3
- package/dist/{chunk-XAVVR6OX.mjs → chunk-34H7NGLC.mjs} +1 -1
- package/dist/{chunk-F2HFXS2Z.mjs → chunk-3HJVAFGP.mjs} +47 -7
- package/dist/{chunk-KVM4DBEU.mjs → chunk-7H2BJF4H.mjs} +29 -1
- package/dist/{chunk-2TOLRBFU.js → chunk-CHHLFKT6.js} +41 -41
- package/dist/{chunk-TB5ZWNMX.mjs → chunk-E4CJYQAL.mjs} +46 -11
- package/dist/{chunk-HNI6JYAI.js → chunk-N57QTSTQ.js} +866 -831
- package/dist/{chunk-AD2CLKY6.js → chunk-ODMFBYAP.js} +29 -1
- package/dist/{chunk-MOEXMRVK.js → chunk-ZIXTDOJD.js} +524 -483
- package/dist/{dist-NVA3FEUV.js → dist-CPLP356W.js} +568 -568
- package/dist/{dist-LQJHTLHL.mjs → dist-OEO77LEX.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 +20 -20
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkCHHLFKT6_js = require('./chunk-CHHLFKT6.js');
|
|
4
4
|
var chunkCUUYYYC5_js = require('./chunk-CUUYYYC5.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkODMFBYAP_js = require('./chunk-ODMFBYAP.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 chunkCHHLFKT6_js.getAnimationInitialStyle(preset, nativeAnimation);
|
|
22
22
|
}
|
|
23
23
|
function useVirtualizedSlides({
|
|
24
24
|
totalItems,
|
|
25
25
|
itemHeight,
|
|
26
|
-
overscan =
|
|
26
|
+
overscan = chunkCHHLFKT6_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 = chunkCHHLFKT6_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 >= chunkCHHLFKT6_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
|
+
}, chunkCHHLFKT6_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 = chunkCHHLFKT6_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 = chunkCHHLFKT6_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(chunkCHHLFKT6_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 = chunkCHHLFKT6_js.validateRoomId(config.roomId);
|
|
286
|
+
const transport = config.transport ?? chunkCHHLFKT6_js.resolveTransportForServerUrl(config.serverUrl);
|
|
287
287
|
if (transport === "webrtc") {
|
|
288
288
|
await initWebrtc();
|
|
289
289
|
return;
|
|
290
290
|
}
|
|
291
|
-
if (
|
|
291
|
+
if (chunkCHHLFKT6_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
|
+
}, chunkCHHLFKT6_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 = chunkCHHLFKT6_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 chunkCHHLFKT6_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(chunkCHHLFKT6_js.cloneSlide),
|
|
514
|
+
templateElementsBySlideId: chunkCHHLFKT6_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(chunkCHHLFKT6_js.cloneSlide));
|
|
528
528
|
setTemplateElementsBySlideId(
|
|
529
|
-
|
|
529
|
+
chunkCHHLFKT6_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 = chunkCHHLFKT6_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 = chunkCHHLFKT6_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
|
+
chunkCHHLFKT6_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 = chunkCHHLFKT6_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 = chunkCHHLFKT6_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 = chunkCHHLFKT6_js.PRESENTATION_CHANNEL_NAME;
|
|
1438
|
+
var AUDIENCE_HASH = chunkCHHLFKT6_js.PRESENTATION_HASH;
|
|
1439
|
+
var PRESENTER_MSG_ORIGIN = chunkCHHLFKT6_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1440
|
+
var AUDIENCE_NONCE_KEY = chunkCHHLFKT6_js.PRESENTATION_NONCE_KEY;
|
|
1441
1441
|
function generateSessionId() {
|
|
1442
|
-
return
|
|
1442
|
+
return chunkCHHLFKT6_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 ? chunkCHHLFKT6_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 chunkCHHLFKT6_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 = chunkCHHLFKT6_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1561
|
+
void chunkCHHLFKT6_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1562
1562
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1563
|
-
|
|
1563
|
+
chunkCHHLFKT6_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 chunkCHHLFKT6_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 (chunkCHHLFKT6_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 chunkCHHLFKT6_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 (!chunkCHHLFKT6_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 chunkCHHLFKT6_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: chunkCHHLFKT6_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 (chunkCHHLFKT6_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 ? chunkCHHLFKT6_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(chunkCHHLFKT6_js.createPresenterTimer());
|
|
2249
|
+
const [snapshot, setSnapshot] = React4.useState(() => chunkCHHLFKT6_js.createInitialPresentationSnapshot(slideIndex));
|
|
2250
2250
|
const patch = React4.useCallback((value) => {
|
|
2251
|
-
setSnapshot((current) =>
|
|
2251
|
+
setSnapshot((current) => chunkCHHLFKT6_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: chunkCHHLFKT6_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 = chunkCHHLFKT6_js.togglePresenterTimer(timerRef.current);
|
|
2269
2269
|
patch({
|
|
2270
2270
|
paused: timerRef.current.paused,
|
|
2271
|
-
elapsedMs:
|
|
2271
|
+
elapsedMs: chunkCHHLFKT6_js.presenterElapsed(timerRef.current)
|
|
2272
2272
|
});
|
|
2273
2273
|
},
|
|
2274
2274
|
resetTimer: () => {
|
|
2275
|
-
timerRef.current =
|
|
2275
|
+
timerRef.current = chunkCHHLFKT6_js.resetPresenterTimer();
|
|
2276
2276
|
patch({ paused: false, elapsedMs: 0 });
|
|
2277
2277
|
},
|
|
2278
2278
|
stepZoom: (direction) => setSnapshot(
|
|
2279
|
-
(current) =>
|
|
2280
|
-
zoom:
|
|
2279
|
+
(current) => chunkCHHLFKT6_js.mergePresentationSnapshot(current, {
|
|
2280
|
+
zoom: chunkCHHLFKT6_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 (!chunkODMFBYAP_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 (!chunkODMFBYAP_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) => chunkCHHLFKT6_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) => !chunkCHHLFKT6_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 chunkODMFBYAP_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
|
+
chunkCHHLFKT6_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 } = chunkCHHLFKT6_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(chunkCHHLFKT6_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 chunkODMFBYAP_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 chunkCHHLFKT6_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 (!chunkODMFBYAP_js.hasTextProperties(element)) {
|
|
4140
4140
|
return { color: fallbackColor };
|
|
4141
4141
|
}
|
|
4142
4142
|
const textDecorationTokens = [];
|
|
@@ -4150,20 +4150,20 @@ 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 ? chunkCHHLFKT6_js.normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : chunkCHHLFKT6_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;
|
|
4157
4157
|
const bodyRight = element.textStyle?.bodyInsetRight ?? DEFAULT_BODY_INSET_LR_PX;
|
|
4158
|
-
const writingMode =
|
|
4159
|
-
const textOrientation =
|
|
4160
|
-
const verticalDirection =
|
|
4158
|
+
const writingMode = chunkCHHLFKT6_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
4159
|
+
const textOrientation = chunkCHHLFKT6_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
4160
|
+
const verticalDirection = chunkCHHLFKT6_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
4161
4161
|
const resolvedDirection = verticalDirection || (isRtl ? "rtl" : "ltr");
|
|
4162
4162
|
const resolvedUnicodeBidi = isRtl ? "plaintext" : void 0;
|
|
4163
4163
|
const hasSegments = (element.textSegments?.length ?? 0) > 0;
|
|
4164
4164
|
return {
|
|
4165
4165
|
color: resolvedTextColor,
|
|
4166
|
-
backgroundColor: !hasSegments && element.textStyle?.highlightColor ?
|
|
4166
|
+
backgroundColor: !hasSegments && element.textStyle?.highlightColor ? chunkCHHLFKT6_js.normalizeHexColor(element.textStyle.highlightColor, void 0) : void 0,
|
|
4167
4167
|
textAlign: (() => {
|
|
4168
4168
|
const a = element.textStyle?.align;
|
|
4169
4169
|
if (a === "justLow" || a === "dist" || a === "thaiDist") {
|
|
@@ -4179,7 +4179,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
4179
4179
|
textDecorationLine: textDecorationTokens.length > 0 ? textDecorationTokens.join(" ") : "none",
|
|
4180
4180
|
textDecorationStyle,
|
|
4181
4181
|
fontFamily: element.textStyle?.fontFamily || DEFAULT_FONT_FAMILY,
|
|
4182
|
-
lineHeight:
|
|
4182
|
+
lineHeight: chunkCHHLFKT6_js.resolveLineHeight(element.textStyle, hasItalicRuns),
|
|
4183
4183
|
paddingTop: bodyTop + (hasItalicRuns ? 1 : 0),
|
|
4184
4184
|
paddingBottom: bodyBottom + (hasItalicRuns ? 1 : 0),
|
|
4185
4185
|
paddingLeft: bodyLeft + (element.textStyle?.paragraphMarginLeft || 0),
|
|
@@ -4192,7 +4192,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
4192
4192
|
// Auto-fit: use OOXML-provided fontScale/lnSpcReduction when available,
|
|
4193
4193
|
// otherwise fall back to heuristic estimation. The pure font-scale maths
|
|
4194
4194
|
// now lives in pptx-viewer-shared (computeAutoFitTextStyle).
|
|
4195
|
-
...
|
|
4195
|
+
...chunkCHHLFKT6_js.computeAutoFitTextStyle({
|
|
4196
4196
|
textStyle: element.textStyle,
|
|
4197
4197
|
text: element.text ?? "",
|
|
4198
4198
|
width: element.width,
|
|
@@ -4226,13 +4226,13 @@ function computeTabSize(tabStops, defaultTabSize) {
|
|
|
4226
4226
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : fromDefault;
|
|
4227
4227
|
}
|
|
4228
4228
|
function getTextLayoutStyle(element) {
|
|
4229
|
-
if (!
|
|
4229
|
+
if (!chunkODMFBYAP_js.hasTextProperties(element)) {
|
|
4230
4230
|
return {};
|
|
4231
4231
|
}
|
|
4232
4232
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
4233
|
-
const writingMode =
|
|
4234
|
-
const textOrientation =
|
|
4235
|
-
const verticalDirection =
|
|
4233
|
+
const writingMode = chunkCHHLFKT6_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
4234
|
+
const textOrientation = chunkCHHLFKT6_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
4235
|
+
const verticalDirection = chunkCHHLFKT6_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
4236
4236
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
4237
4237
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
4238
4238
|
const hasColumns = columnCount > 1;
|
|
@@ -4240,7 +4240,7 @@ function getTextLayoutStyle(element) {
|
|
|
4240
4240
|
const tabStops = element.textStyle?.tabStops;
|
|
4241
4241
|
const tabSize = computeTabSize(tabStops, element.textStyle?.defaultTabSize);
|
|
4242
4242
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
4243
|
-
const hasParagraphIndents =
|
|
4243
|
+
const hasParagraphIndents = chunkODMFBYAP_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
4244
4244
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
4245
4245
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
4246
4246
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -4249,7 +4249,7 @@ function getTextLayoutStyle(element) {
|
|
|
4249
4249
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
4250
4250
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
4251
4251
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
4252
|
-
const kinsokuStyles =
|
|
4252
|
+
const kinsokuStyles = chunkCHHLFKT6_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
4253
4253
|
if (hasColumns) {
|
|
4254
4254
|
return {
|
|
4255
4255
|
display: "block",
|
|
@@ -4296,10 +4296,10 @@ function getTextLayoutStyle(element) {
|
|
|
4296
4296
|
|
|
4297
4297
|
// src/viewer/utils/text-effects.tsx
|
|
4298
4298
|
function buildTextFillCss2(style) {
|
|
4299
|
-
return
|
|
4299
|
+
return chunkCHHLFKT6_js.buildTextFillCss(style);
|
|
4300
4300
|
}
|
|
4301
4301
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
4302
|
-
return
|
|
4302
|
+
return chunkCHHLFKT6_js.buildTextBody3DSceneStyle(textStyle);
|
|
4303
4303
|
}
|
|
4304
4304
|
|
|
4305
4305
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -4484,17 +4484,17 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
4484
4484
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
4485
4485
|
return renderedSegments;
|
|
4486
4486
|
}
|
|
4487
|
-
const paraKey = `${elementId}${
|
|
4487
|
+
const paraKey = `${elementId}${chunkCHHLFKT6_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
4488
4488
|
const paraState = subElementAnimStates.get(paraKey);
|
|
4489
4489
|
if (paraState) {
|
|
4490
4490
|
const style = buildAnimStyle(paraState);
|
|
4491
4491
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
4492
4492
|
}
|
|
4493
|
-
const firstWordKey = `${elementId}${
|
|
4493
|
+
const firstWordKey = `${elementId}${chunkCHHLFKT6_js.TEXT_BUILD_ID_SEP}w${paraIndex}-0`;
|
|
4494
4494
|
if (subElementAnimStates.has(firstWordKey)) {
|
|
4495
4495
|
return wrapByWord(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
4496
4496
|
}
|
|
4497
|
-
const firstCharKey = `${elementId}${
|
|
4497
|
+
const firstCharKey = `${elementId}${chunkCHHLFKT6_js.TEXT_BUILD_ID_SEP}c${paraIndex}-0`;
|
|
4498
4498
|
if (subElementAnimStates.has(firstCharKey)) {
|
|
4499
4499
|
return wrapByChar(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
4500
4500
|
}
|
|
@@ -4515,7 +4515,7 @@ function wrapByWord(elementId, paraIndex, paraSegments, states) {
|
|
|
4515
4515
|
nodes.push(/* @__PURE__ */ jsxRuntime.jsx(React4__default.default.Fragment, { children: w }, `ws-${i}`));
|
|
4516
4516
|
continue;
|
|
4517
4517
|
}
|
|
4518
|
-
const key = `${elementId}${
|
|
4518
|
+
const key = `${elementId}${chunkCHHLFKT6_js.TEXT_BUILD_ID_SEP}w${paraIndex}-${wordIdx}`;
|
|
4519
4519
|
const state = states.get(key);
|
|
4520
4520
|
const style = buildAnimStyle(state);
|
|
4521
4521
|
nodes.push(
|
|
@@ -4529,7 +4529,7 @@ function wrapByChar(elementId, paraIndex, paraSegments, states) {
|
|
|
4529
4529
|
const fullText = paraSegments.map((e) => e.segment.text).join("");
|
|
4530
4530
|
const nodes = [];
|
|
4531
4531
|
for (let i = 0; i < fullText.length; i++) {
|
|
4532
|
-
const key = `${elementId}${
|
|
4532
|
+
const key = `${elementId}${chunkCHHLFKT6_js.TEXT_BUILD_ID_SEP}c${paraIndex}-${i}`;
|
|
4533
4533
|
const state = states.get(key);
|
|
4534
4534
|
const style = buildAnimStyle(state);
|
|
4535
4535
|
nodes.push(
|
|
@@ -4675,10 +4675,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
4675
4675
|
if (!needsScriptFonts || !text) {
|
|
4676
4676
|
return text;
|
|
4677
4677
|
}
|
|
4678
|
-
const runs =
|
|
4678
|
+
const runs = chunkCHHLFKT6_js.segmentByScript(text);
|
|
4679
4679
|
if (runs.length <= 1) {
|
|
4680
4680
|
if (runs.length === 1) {
|
|
4681
|
-
const font =
|
|
4681
|
+
const font = chunkCHHLFKT6_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
4682
4682
|
if (font && font !== baseFontFamily) {
|
|
4683
4683
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
4684
4684
|
}
|
|
@@ -4686,7 +4686,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
4686
4686
|
return text;
|
|
4687
4687
|
}
|
|
4688
4688
|
return runs.map((run, i) => {
|
|
4689
|
-
const font =
|
|
4689
|
+
const font = chunkCHHLFKT6_js.resolveFontForScript(run.script, scriptFonts);
|
|
4690
4690
|
if (!font || font === baseFontFamily) {
|
|
4691
4691
|
return /* @__PURE__ */ jsxRuntime.jsx(React4__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
4692
4692
|
}
|
|
@@ -4758,8 +4758,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
4758
4758
|
);
|
|
4759
4759
|
}
|
|
4760
4760
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
4761
|
-
const mathml =
|
|
4762
|
-
const safeMathml = mathml ?
|
|
4761
|
+
const mathml = chunkCHHLFKT6_js.convertOmmlToMathMl(equationXml);
|
|
4762
|
+
const safeMathml = mathml ? chunkCHHLFKT6_js.sanitizeMathMl(mathml) : "";
|
|
4763
4763
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4764
4764
|
"span",
|
|
4765
4765
|
{
|
|
@@ -4809,7 +4809,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
4809
4809
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
4810
4810
|
}
|
|
4811
4811
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
4812
|
-
const picture =
|
|
4812
|
+
const picture = chunkCHHLFKT6_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
4813
4813
|
sizePx: baseFontSize,
|
|
4814
4814
|
fallbackMarker: "\u2022",
|
|
4815
4815
|
accessibleLabel: "Bullet"
|
|
@@ -4859,7 +4859,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4859
4859
|
);
|
|
4860
4860
|
}
|
|
4861
4861
|
const segmentStyle = segment.style || {};
|
|
4862
|
-
const textValue =
|
|
4862
|
+
const textValue = chunkCHHLFKT6_js.substituteFieldText(segment.text || "", segment.fieldType, fieldContext);
|
|
4863
4863
|
const lines = textValue.split("\n");
|
|
4864
4864
|
const textDecorationTokens = [];
|
|
4865
4865
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -4869,8 +4869,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4869
4869
|
textDecorationTokens.push("line-through");
|
|
4870
4870
|
}
|
|
4871
4871
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
4872
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
4873
|
-
const underlineDecoration =
|
|
4872
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkCHHLFKT6_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkCHHLFKT6_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
4873
|
+
const underlineDecoration = chunkCHHLFKT6_js.resolveUnderlineDecorationStyle(
|
|
4874
4874
|
Boolean(isDoubleStrike),
|
|
4875
4875
|
segmentStyle.underlineStyle
|
|
4876
4876
|
);
|
|
@@ -4886,14 +4886,14 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4886
4886
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
4887
4887
|
const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
|
|
4888
4888
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
4889
|
-
const baseFontFamily = rawFontFamily ?
|
|
4889
|
+
const baseFontFamily = rawFontFamily ? chunkODMFBYAP_js.getSubstituteFontFamily(rawFontFamily) : DEFAULT_FONT_FAMILY;
|
|
4890
4890
|
const scriptFonts = {
|
|
4891
4891
|
latin: baseFontFamily,
|
|
4892
4892
|
eastAsia: segmentStyle.eastAsiaFont || element.textStyle?.eastAsiaFont || baseFontFamily,
|
|
4893
4893
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
4894
4894
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
4895
4895
|
};
|
|
4896
|
-
const needsScriptFonts =
|
|
4896
|
+
const needsScriptFonts = chunkCHHLFKT6_js.hasDistinctScriptFonts(scriptFonts);
|
|
4897
4897
|
const spanStyle = {
|
|
4898
4898
|
color: resolvedSegmentColor,
|
|
4899
4899
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -4911,15 +4911,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4911
4911
|
fontVariantCaps: segmentStyle.textCaps === "small" ? "small-caps" : void 0,
|
|
4912
4912
|
letterSpacing,
|
|
4913
4913
|
fontKerning,
|
|
4914
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
4914
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkCHHLFKT6_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
4915
4915
|
...textFillStyles,
|
|
4916
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
4917
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
4916
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkCHHLFKT6_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
4917
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkCHHLFKT6_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
4918
4918
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
4919
|
-
textShadow:
|
|
4920
|
-
filter:
|
|
4921
|
-
opacity:
|
|
4922
|
-
WebkitBoxReflect:
|
|
4919
|
+
textShadow: chunkCHHLFKT6_js.buildTextShadowCss(segmentStyle),
|
|
4920
|
+
filter: chunkCHHLFKT6_js.buildTextRunFilterChain(segmentStyle),
|
|
4921
|
+
opacity: chunkCHHLFKT6_js.getTextAlphaOpacity(segmentStyle),
|
|
4922
|
+
WebkitBoxReflect: chunkCHHLFKT6_js.buildTextReflectionCss(segmentStyle)
|
|
4923
4923
|
};
|
|
4924
4924
|
const runRtl = segmentStyle.rtl;
|
|
4925
4925
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -4939,7 +4939,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4939
4939
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
4940
4940
|
}
|
|
4941
4941
|
if (bulletInfo.color) {
|
|
4942
|
-
spanStyle.color =
|
|
4942
|
+
spanStyle.color = chunkCHHLFKT6_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
4943
4943
|
}
|
|
4944
4944
|
}
|
|
4945
4945
|
if (bulletInfo?.imageDataUrl || bulletInfo?.imageRelId) {
|
|
@@ -4979,7 +4979,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4979
4979
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
4980
4980
|
};
|
|
4981
4981
|
if (segment.rubyStyle?.color) {
|
|
4982
|
-
rubyStyle.color =
|
|
4982
|
+
rubyStyle.color = chunkCHHLFKT6_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
4983
4983
|
}
|
|
4984
4984
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
4985
4985
|
baseContent,
|
|
@@ -5074,7 +5074,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
5074
5074
|
return paragraphs;
|
|
5075
5075
|
}
|
|
5076
5076
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
5077
|
-
if (!
|
|
5077
|
+
if (!chunkODMFBYAP_js.hasTextProperties(element)) {
|
|
5078
5078
|
return emptyFallback || null;
|
|
5079
5079
|
}
|
|
5080
5080
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -5095,10 +5095,10 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
5095
5095
|
return element.text || emptyFallback || "";
|
|
5096
5096
|
}
|
|
5097
5097
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
5098
|
-
const paragraphIndents =
|
|
5099
|
-
const elementRtl =
|
|
5100
|
-
const elementAlign =
|
|
5101
|
-
const bodyStyle =
|
|
5098
|
+
const paragraphIndents = chunkODMFBYAP_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
5099
|
+
const elementRtl = chunkODMFBYAP_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
5100
|
+
const elementAlign = chunkODMFBYAP_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
5101
|
+
const bodyStyle = chunkODMFBYAP_js.hasTextProperties(element) ? element.textStyle : void 0;
|
|
5102
5102
|
const spaceFirstLast = bodyStyle?.spaceFirstLastParagraph !== false;
|
|
5103
5103
|
return paragraphs.map((paraSegments, paraIndex) => {
|
|
5104
5104
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
@@ -5118,14 +5118,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
5118
5118
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
5119
5119
|
});
|
|
5120
5120
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent && !hasDuplicateAuthoredAutoNumber;
|
|
5121
|
-
const paraRtl =
|
|
5121
|
+
const paraRtl = chunkCHHLFKT6_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
5122
5122
|
const isRtlParagraph = paraRtl === true;
|
|
5123
|
-
const paraAlign =
|
|
5124
|
-
const cssTextAlign =
|
|
5123
|
+
const paraAlign = chunkCHHLFKT6_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
5124
|
+
const cssTextAlign = chunkCHHLFKT6_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
5125
5125
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
5126
5126
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
5127
5127
|
const paraTextIndent = rawTextIndent;
|
|
5128
|
-
const paraKinsokuStyle =
|
|
5128
|
+
const paraKinsokuStyle = chunkCHHLFKT6_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
5129
5129
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
5130
5130
|
const paraProps = effectiveSegments[firstSeg?.globalIndex ?? -1]?.paragraphProperties;
|
|
5131
5131
|
const spacing = resolveParagraphSpacing({
|
|
@@ -5308,7 +5308,7 @@ function isConnectorOrLineElement(element) {
|
|
|
5308
5308
|
if (element.type === "connector") {
|
|
5309
5309
|
return true;
|
|
5310
5310
|
}
|
|
5311
|
-
if (!
|
|
5311
|
+
if (!chunkODMFBYAP_js.hasShapeProperties(element)) {
|
|
5312
5312
|
return false;
|
|
5313
5313
|
}
|
|
5314
5314
|
const st = getShapeType(element.shapeType);
|
|
@@ -5326,13 +5326,13 @@ function hexToRgbUnit(hex) {
|
|
|
5326
5326
|
};
|
|
5327
5327
|
}
|
|
5328
5328
|
function getDuotoneColors(element) {
|
|
5329
|
-
if (!
|
|
5329
|
+
if (!chunkODMFBYAP_js.isImageLikeElement(element)) {
|
|
5330
5330
|
return void 0;
|
|
5331
5331
|
}
|
|
5332
5332
|
return element.imageEffects?.duotone;
|
|
5333
5333
|
}
|
|
5334
5334
|
function buildLineShadowCss(element) {
|
|
5335
|
-
if (!
|
|
5335
|
+
if (!chunkODMFBYAP_js.hasShapeProperties(element)) {
|
|
5336
5336
|
return void 0;
|
|
5337
5337
|
}
|
|
5338
5338
|
const ss = element.shapeStyle;
|
|
@@ -5343,13 +5343,13 @@ function buildLineShadowCss(element) {
|
|
|
5343
5343
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
5344
5344
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
5345
5345
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
5346
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
5347
|
-
|
|
5346
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkCHHLFKT6_js.colorWithOpacity(
|
|
5347
|
+
chunkCHHLFKT6_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
5348
5348
|
opacity
|
|
5349
5349
|
)}`;
|
|
5350
5350
|
}
|
|
5351
5351
|
function buildLineGlowFilter(element) {
|
|
5352
|
-
if (!
|
|
5352
|
+
if (!chunkODMFBYAP_js.hasShapeProperties(element)) {
|
|
5353
5353
|
return void 0;
|
|
5354
5354
|
}
|
|
5355
5355
|
const ss = element.shapeStyle;
|
|
@@ -5358,7 +5358,7 @@ function buildLineGlowFilter(element) {
|
|
|
5358
5358
|
}
|
|
5359
5359
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
5360
5360
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
5361
|
-
const glowCol =
|
|
5361
|
+
const glowCol = chunkCHHLFKT6_js.colorWithOpacity(chunkCHHLFKT6_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
5362
5362
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
5363
5363
|
}
|
|
5364
5364
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -5382,7 +5382,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
5382
5382
|
return `dag-duotone-${elementId}`;
|
|
5383
5383
|
}
|
|
5384
5384
|
function hasDagDuotoneEffect(element) {
|
|
5385
|
-
if (!
|
|
5385
|
+
if (!chunkODMFBYAP_js.hasShapeProperties(element)) {
|
|
5386
5386
|
return false;
|
|
5387
5387
|
}
|
|
5388
5388
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -5445,7 +5445,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
5445
5445
|
|
|
5446
5446
|
// src/viewer/utils/shape-visual-3d.ts
|
|
5447
5447
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
5448
|
-
return
|
|
5448
|
+
return chunkCHHLFKT6_js.build3DExtrusionData(
|
|
5449
5449
|
shape3d,
|
|
5450
5450
|
scene3d,
|
|
5451
5451
|
fillColor,
|
|
@@ -5454,7 +5454,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
5454
5454
|
);
|
|
5455
5455
|
}
|
|
5456
5456
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
5457
|
-
|
|
5457
|
+
chunkCHHLFKT6_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
5458
5458
|
}
|
|
5459
5459
|
|
|
5460
5460
|
// src/viewer/utils/vector-subpath-paint.ts
|
|
@@ -5463,7 +5463,7 @@ function toHexByte(value) {
|
|
|
5463
5463
|
return clamped.toString(16).padStart(2, "0");
|
|
5464
5464
|
}
|
|
5465
5465
|
function shiftHex(hex, factor, towardsWhite) {
|
|
5466
|
-
const channels =
|
|
5466
|
+
const channels = chunkCHHLFKT6_js.hexToRgbChannels(hex);
|
|
5467
5467
|
if (!channels) {
|
|
5468
5468
|
return hex;
|
|
5469
5469
|
}
|
|
@@ -5489,13 +5489,13 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
5489
5489
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
5490
5490
|
return {
|
|
5491
5491
|
d: subpath.d,
|
|
5492
|
-
fill: fillOff ? "none" :
|
|
5492
|
+
fill: fillOff ? "none" : chunkCHHLFKT6_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
5493
5493
|
stroked: subpath.stroke !== false
|
|
5494
5494
|
};
|
|
5495
5495
|
});
|
|
5496
5496
|
}
|
|
5497
5497
|
function getStrokeOnlyPresetPaths(element) {
|
|
5498
|
-
if (element.type !== "shape" || !
|
|
5498
|
+
if (element.type !== "shape" || !chunkODMFBYAP_js.hasShapeProperties(element)) {
|
|
5499
5499
|
return void 0;
|
|
5500
5500
|
}
|
|
5501
5501
|
const shapeType = element.shapeType;
|
|
@@ -5505,7 +5505,7 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
5505
5505
|
if (element.pathData) {
|
|
5506
5506
|
return void 0;
|
|
5507
5507
|
}
|
|
5508
|
-
const result =
|
|
5508
|
+
const result = chunkODMFBYAP_js.evaluatePresetShape(
|
|
5509
5509
|
shapeType,
|
|
5510
5510
|
Math.max(element.width, 1),
|
|
5511
5511
|
Math.max(element.height, 1),
|
|
@@ -5520,27 +5520,27 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
5520
5520
|
|
|
5521
5521
|
// src/viewer/utils/shape-visual-style.ts
|
|
5522
5522
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
5523
|
-
if (!
|
|
5523
|
+
if (!chunkODMFBYAP_js.hasShapeProperties(element)) {
|
|
5524
5524
|
return {};
|
|
5525
5525
|
}
|
|
5526
5526
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
5527
|
-
const clipPath =
|
|
5527
|
+
const clipPath = chunkCHHLFKT6_js.getResolvedShapeClipPath(element);
|
|
5528
5528
|
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;
|
|
5529
5529
|
const rendersStrokeOnlyPreset = Boolean(getStrokeOnlyPresetPaths(element));
|
|
5530
5530
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
5531
5531
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
5532
|
-
const strokeDash =
|
|
5533
|
-
const fillGradient =
|
|
5534
|
-
const shadowCss =
|
|
5535
|
-
const innerShadowCss =
|
|
5536
|
-
const resolvedFillColor =
|
|
5537
|
-
const resolvedStrokeColor =
|
|
5532
|
+
const strokeDash = chunkCHHLFKT6_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
5533
|
+
const fillGradient = chunkCHHLFKT6_js.buildCssGradientFromShapeStyle(element.shapeStyle) || element.shapeStyle?.fillGradient;
|
|
5534
|
+
const shadowCss = chunkCHHLFKT6_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
5535
|
+
const innerShadowCss = chunkCHHLFKT6_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
5536
|
+
const resolvedFillColor = chunkCHHLFKT6_js.colorWithOpacity(fillColor, fillOpacity);
|
|
5537
|
+
const resolvedStrokeColor = chunkCHHLFKT6_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
5538
5538
|
const ss = element.shapeStyle;
|
|
5539
5539
|
const hasFillOverlayColor = Boolean(
|
|
5540
5540
|
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
5541
5541
|
);
|
|
5542
5542
|
const combinedShadowParts = [];
|
|
5543
|
-
const multiLayerShadow =
|
|
5543
|
+
const multiLayerShadow = chunkCHHLFKT6_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
5544
5544
|
if (multiLayerShadow) {
|
|
5545
5545
|
combinedShadowParts.push(multiLayerShadow);
|
|
5546
5546
|
} else if (shadowCss) {
|
|
@@ -5549,7 +5549,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5549
5549
|
if (innerShadowCss) {
|
|
5550
5550
|
combinedShadowParts.push(innerShadowCss);
|
|
5551
5551
|
}
|
|
5552
|
-
const glowBoxShadow =
|
|
5552
|
+
const glowBoxShadow = chunkCHHLFKT6_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
5553
5553
|
if (glowBoxShadow) {
|
|
5554
5554
|
combinedShadowParts.push(glowBoxShadow);
|
|
5555
5555
|
}
|
|
@@ -5557,7 +5557,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5557
5557
|
if (lineShadow) {
|
|
5558
5558
|
combinedShadowParts.push(lineShadow);
|
|
5559
5559
|
}
|
|
5560
|
-
const compoundLineShadow =
|
|
5560
|
+
const compoundLineShadow = chunkCHHLFKT6_js.getCompoundLineBoxShadow(
|
|
5561
5561
|
element.shapeStyle?.compoundLine,
|
|
5562
5562
|
strokeWidth,
|
|
5563
5563
|
resolvedStrokeColor
|
|
@@ -5570,11 +5570,11 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5570
5570
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
5571
5571
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
5572
5572
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
5573
|
-
const glowCol =
|
|
5573
|
+
const glowCol = chunkCHHLFKT6_js.colorWithOpacity(chunkCHHLFKT6_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
5574
5574
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
5575
5575
|
}
|
|
5576
5576
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
5577
|
-
filterParts.push(`url(#${
|
|
5577
|
+
filterParts.push(`url(#${chunkCHHLFKT6_js.getSoftEdgeFilterId(element.id)})`);
|
|
5578
5578
|
}
|
|
5579
5579
|
if (typeof ss?.blurRadius === "number" && ss.blurRadius > 0) {
|
|
5580
5580
|
filterParts.push(`blur(${Math.round(ss.blurRadius)}px)`);
|
|
@@ -5583,13 +5583,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5583
5583
|
if (lineGlowCss) {
|
|
5584
5584
|
filterParts.push(lineGlowCss);
|
|
5585
5585
|
}
|
|
5586
|
-
const dagFilter =
|
|
5586
|
+
const dagFilter = chunkCHHLFKT6_js.getEffectDagFilter(ss, element.id);
|
|
5587
5587
|
if (dagFilter) {
|
|
5588
5588
|
filterParts.push(dagFilter);
|
|
5589
5589
|
}
|
|
5590
5590
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : ss?.lineJoin === "miter" ? "miter" : void 0;
|
|
5591
5591
|
const miterLimitCss = ss?.lineJoin === "miter" && typeof ss?.miterLimit === "number" ? Math.max(ss.miterLimit / 1e5, 1) : void 0;
|
|
5592
|
-
const patternFill =
|
|
5592
|
+
const patternFill = chunkCHHLFKT6_js.buildPatternFillCss(element.shapeStyle);
|
|
5593
5593
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
5594
5594
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
5595
5595
|
let reflectCss;
|
|
@@ -5601,7 +5601,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5601
5601
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
5602
5602
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
5603
5603
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
5604
|
-
reflectCss =
|
|
5604
|
+
reflectCss = chunkCHHLFKT6_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
5605
5605
|
}
|
|
5606
5606
|
}
|
|
5607
5607
|
const base = {
|
|
@@ -5619,9 +5619,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5619
5619
|
// is present, `ShapeEffectOverlay` paints a separate blended tint layer so
|
|
5620
5620
|
// the colour is actually rendered (and text/children are not tinted).
|
|
5621
5621
|
mixBlendMode: hasFillOverlayColor ? void 0 : mapDagBlendModeToCss(ss?.dagFillOverlayBlend),
|
|
5622
|
-
borderWidth: strokeWidth > 0 ?
|
|
5622
|
+
borderWidth: strokeWidth > 0 ? chunkCHHLFKT6_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : void 0,
|
|
5623
5623
|
borderColor: strokeWidth > 0 ? resolvedStrokeColor : void 0,
|
|
5624
|
-
borderStyle: strokeWidth > 0 ?
|
|
5624
|
+
borderStyle: strokeWidth > 0 ? chunkCHHLFKT6_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
5625
5625
|
strokeLinejoin: lineJoinCss,
|
|
5626
5626
|
strokeMiterlimit: miterLimitCss,
|
|
5627
5627
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -5677,7 +5677,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5677
5677
|
borderWidth: 0,
|
|
5678
5678
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
5679
5679
|
borderTopColor: resolvedStrokeColor,
|
|
5680
|
-
borderTopStyle:
|
|
5680
|
+
borderTopStyle: chunkCHHLFKT6_js.getCssBorderDashStyle(strokeDash)
|
|
5681
5681
|
};
|
|
5682
5682
|
}
|
|
5683
5683
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -5691,13 +5691,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5691
5691
|
function getConnectorAdjustment(element, key, fallback) {
|
|
5692
5692
|
const direct = element.shapeAdjustments?.[key];
|
|
5693
5693
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
5694
|
-
return
|
|
5694
|
+
return chunkCHHLFKT6_js.clampUnitInterval(direct / 1e5);
|
|
5695
5695
|
}
|
|
5696
5696
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
5697
5697
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
5698
|
-
return
|
|
5698
|
+
return chunkCHHLFKT6_js.clampUnitInterval(fallbackKey / 1e5);
|
|
5699
5699
|
}
|
|
5700
|
-
return
|
|
5700
|
+
return chunkCHHLFKT6_js.clampUnitInterval(fallback);
|
|
5701
5701
|
}
|
|
5702
5702
|
function getConnectorPathGeometry(element) {
|
|
5703
5703
|
const width = Math.max(element.width, 1);
|
|
@@ -5834,11 +5834,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
5834
5834
|
strokePaint,
|
|
5835
5835
|
strokeWidth,
|
|
5836
5836
|
dashArray,
|
|
5837
|
-
lineCap:
|
|
5837
|
+
lineCap: chunkCHHLFKT6_js.svgLineCap(shapeStyle?.lineCap),
|
|
5838
5838
|
lineJoin,
|
|
5839
5839
|
miterLimit,
|
|
5840
|
-
offsets:
|
|
5841
|
-
widths:
|
|
5840
|
+
offsets: chunkCHHLFKT6_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
5841
|
+
widths: chunkCHHLFKT6_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
5842
5842
|
};
|
|
5843
5843
|
}
|
|
5844
5844
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -5861,7 +5861,7 @@ function strokeStrands(d, keyBase, ctx) {
|
|
|
5861
5861
|
}
|
|
5862
5862
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false) {
|
|
5863
5863
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
5864
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
5864
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkODMFBYAP_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
5865
5865
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
5866
5866
|
const nodes = [];
|
|
5867
5867
|
if (subpaths && needsPerSubpath) {
|
|
@@ -5892,7 +5892,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
5892
5892
|
"path",
|
|
5893
5893
|
{
|
|
5894
5894
|
d: pathData,
|
|
5895
|
-
fill: animatesFill ? "inherit" :
|
|
5895
|
+
fill: animatesFill ? "inherit" : chunkCHHLFKT6_js.colorWithOpacity(fillColor, fillOpacity),
|
|
5896
5896
|
stroke: "none",
|
|
5897
5897
|
vectorEffect: "non-scaling-stroke"
|
|
5898
5898
|
},
|
|
@@ -5934,14 +5934,14 @@ function renderStrokeOnlyPreset(presetPaths, width, height, shapeStyle, strokePa
|
|
|
5934
5934
|
);
|
|
5935
5935
|
}
|
|
5936
5936
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
5937
|
-
if (!
|
|
5937
|
+
if (!chunkODMFBYAP_js.hasShapeProperties(element)) {
|
|
5938
5938
|
return null;
|
|
5939
5939
|
}
|
|
5940
5940
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
5941
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
5942
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
5943
|
-
const dashType =
|
|
5944
|
-
const dashArray =
|
|
5941
|
+
const fillPaint = animatesFill ? "inherit" : chunkCHHLFKT6_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
5942
|
+
const strokePaint = animatesStroke ? "inherit" : chunkCHHLFKT6_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
5943
|
+
const dashType = chunkCHHLFKT6_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
5944
|
+
const dashArray = chunkCHHLFKT6_js.getSvgStrokeDasharray(
|
|
5945
5945
|
dashType,
|
|
5946
5946
|
Math.max(strokeWidth, 1),
|
|
5947
5947
|
element.shapeStyle?.customDashSegments
|
|
@@ -6020,18 +6020,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
6020
6020
|
Boolean(animatesFill)
|
|
6021
6021
|
);
|
|
6022
6022
|
}
|
|
6023
|
-
if (
|
|
6023
|
+
if (chunkODMFBYAP_js.isCalloutShape(normalizedType)) {
|
|
6024
6024
|
const width = Math.max(element.width, 1);
|
|
6025
6025
|
const height = Math.max(element.height, 1);
|
|
6026
|
-
const geometry =
|
|
6026
|
+
const geometry = chunkODMFBYAP_js.getCalloutLeaderLineGeometry(
|
|
6027
6027
|
normalizedType,
|
|
6028
6028
|
width,
|
|
6029
6029
|
height,
|
|
6030
6030
|
element.shapeAdjustments
|
|
6031
6031
|
);
|
|
6032
6032
|
if (geometry && geometry.points.length >= 2) {
|
|
6033
|
-
const leaderPath =
|
|
6034
|
-
const bounds =
|
|
6033
|
+
const leaderPath = chunkODMFBYAP_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
6034
|
+
const bounds = chunkODMFBYAP_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
6035
6035
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
6036
6036
|
const offsetLeft = bounds.minX;
|
|
6037
6037
|
const offsetTop = bounds.minY;
|
|
@@ -6094,10 +6094,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
6094
6094
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
6095
6095
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
6096
6096
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
6097
|
-
const connectorLineCap =
|
|
6097
|
+
const connectorLineCap = chunkCHHLFKT6_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
6098
6098
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
6099
|
-
const offsets =
|
|
6100
|
-
const widths =
|
|
6099
|
+
const offsets = chunkCHHLFKT6_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
6100
|
+
const widths = chunkCHHLFKT6_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
6101
6101
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6102
6102
|
"svg",
|
|
6103
6103
|
{
|
|
@@ -6163,7 +6163,7 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
6163
6163
|
|
|
6164
6164
|
// src/viewer/utils/image-style.ts
|
|
6165
6165
|
function getImageMaskStyle(element) {
|
|
6166
|
-
if (!
|
|
6166
|
+
if (!chunkODMFBYAP_js.hasShapeProperties(element)) {
|
|
6167
6167
|
return void 0;
|
|
6168
6168
|
}
|
|
6169
6169
|
const shapeType = element.shapeType;
|
|
@@ -6172,7 +6172,7 @@ function getImageMaskStyle(element) {
|
|
|
6172
6172
|
}
|
|
6173
6173
|
const normalized = shapeType.toLowerCase();
|
|
6174
6174
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
6175
|
-
const radiusPx =
|
|
6175
|
+
const radiusPx = chunkCHHLFKT6_js.getRoundRectRadiusPx(element);
|
|
6176
6176
|
if (radiusPx <= 0.01) {
|
|
6177
6177
|
return void 0;
|
|
6178
6178
|
}
|
|
@@ -6184,7 +6184,7 @@ function getImageMaskStyle(element) {
|
|
|
6184
6184
|
if (normalized === "can" || normalized === "cylinder") {
|
|
6185
6185
|
return { borderRadius: "48% / 12%" };
|
|
6186
6186
|
}
|
|
6187
|
-
const clipPath =
|
|
6187
|
+
const clipPath = chunkCHHLFKT6_js.getResolvedShapeClipPath(element);
|
|
6188
6188
|
if (!clipPath) {
|
|
6189
6189
|
return void 0;
|
|
6190
6190
|
}
|
|
@@ -6192,7 +6192,7 @@ function getImageMaskStyle(element) {
|
|
|
6192
6192
|
}
|
|
6193
6193
|
function getImageRenderStyle(element) {
|
|
6194
6194
|
const maskStyle = getImageMaskStyle(element) || {};
|
|
6195
|
-
if (!
|
|
6195
|
+
if (!chunkODMFBYAP_js.isImageLikeElement(element)) {
|
|
6196
6196
|
return {
|
|
6197
6197
|
...maskStyle,
|
|
6198
6198
|
width: "100%",
|
|
@@ -6200,10 +6200,10 @@ function getImageRenderStyle(element) {
|
|
|
6200
6200
|
objectFit: "cover"
|
|
6201
6201
|
};
|
|
6202
6202
|
}
|
|
6203
|
-
const cropLeft =
|
|
6204
|
-
const cropTop =
|
|
6205
|
-
const cropRight =
|
|
6206
|
-
const cropBottom =
|
|
6203
|
+
const cropLeft = chunkCHHLFKT6_js.clampCropValue(element.cropLeft);
|
|
6204
|
+
const cropTop = chunkCHHLFKT6_js.clampCropValue(element.cropTop);
|
|
6205
|
+
const cropRight = chunkCHHLFKT6_js.clampCropValue(element.cropRight);
|
|
6206
|
+
const cropBottom = chunkCHHLFKT6_js.clampCropValue(element.cropBottom);
|
|
6207
6207
|
const hasCrop = cropLeft + cropRight > 1e-4 || cropTop + cropBottom > 1e-4;
|
|
6208
6208
|
if (!hasCrop) {
|
|
6209
6209
|
return {
|
|
@@ -6215,10 +6215,10 @@ function getImageRenderStyle(element) {
|
|
|
6215
6215
|
}
|
|
6216
6216
|
const safeHorizontalScale = cropLeft + cropRight >= 0.99 ? 0.99 / (cropLeft + cropRight) : 1;
|
|
6217
6217
|
const safeVerticalScale = cropTop + cropBottom >= 0.99 ? 0.99 / (cropTop + cropBottom) : 1;
|
|
6218
|
-
const normalizedLeft =
|
|
6219
|
-
const normalizedRight =
|
|
6220
|
-
const normalizedTop =
|
|
6221
|
-
const normalizedBottom =
|
|
6218
|
+
const normalizedLeft = chunkCHHLFKT6_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
6219
|
+
const normalizedRight = chunkCHHLFKT6_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
6220
|
+
const normalizedTop = chunkCHHLFKT6_js.clampCropValue(cropTop * safeVerticalScale);
|
|
6221
|
+
const normalizedBottom = chunkCHHLFKT6_js.clampCropValue(cropBottom * safeVerticalScale);
|
|
6222
6222
|
const remainingWidth = Math.max(0.01, 1 - normalizedLeft - normalizedRight);
|
|
6223
6223
|
const remainingHeight = Math.max(0.01, 1 - normalizedTop - normalizedBottom);
|
|
6224
6224
|
const tx = Math.round(-normalizedLeft / remainingWidth * 1e4) / 100;
|
|
@@ -6247,7 +6247,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
6247
6247
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
6248
6248
|
};
|
|
6249
6249
|
function getCropShapeClipPath(element) {
|
|
6250
|
-
if (!
|
|
6250
|
+
if (!chunkODMFBYAP_js.isImageLikeElement(element)) {
|
|
6251
6251
|
return void 0;
|
|
6252
6252
|
}
|
|
6253
6253
|
const shape = element.cropShape;
|
|
@@ -6257,7 +6257,7 @@ function getCropShapeClipPath(element) {
|
|
|
6257
6257
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
6258
6258
|
}
|
|
6259
6259
|
function isImageTiled(element) {
|
|
6260
|
-
if (!
|
|
6260
|
+
if (!chunkODMFBYAP_js.isImageLikeElement(element)) {
|
|
6261
6261
|
return false;
|
|
6262
6262
|
}
|
|
6263
6263
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -6315,7 +6315,7 @@ function buildMirrorTiledBackground(src, flip, scaleX, scaleY) {
|
|
|
6315
6315
|
};
|
|
6316
6316
|
}
|
|
6317
6317
|
function getImageTilingStyle(element) {
|
|
6318
|
-
if (!
|
|
6318
|
+
if (!chunkODMFBYAP_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
6319
6319
|
return void 0;
|
|
6320
6320
|
}
|
|
6321
6321
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -6389,9 +6389,9 @@ function parseGradientFillCss(gradFill) {
|
|
|
6389
6389
|
}
|
|
6390
6390
|
const parsed = stops.map((gs) => {
|
|
6391
6391
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
6392
|
-
const color =
|
|
6393
|
-
const opacity =
|
|
6394
|
-
return { pos, color:
|
|
6392
|
+
const color = chunkCHHLFKT6_js.parseDrawingColor(gs) ?? "#888888";
|
|
6393
|
+
const opacity = chunkCHHLFKT6_js.parseDrawingColorOpacity(gs);
|
|
6394
|
+
return { pos, color: chunkCHHLFKT6_js.colorWithOpacity(color, opacity) };
|
|
6395
6395
|
}).sort((a, b) => a.pos - b.pos);
|
|
6396
6396
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
6397
6397
|
const lin = gradFill["a:lin"];
|
|
@@ -6432,8 +6432,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
6432
6432
|
if (!pattFill) {
|
|
6433
6433
|
return void 0;
|
|
6434
6434
|
}
|
|
6435
|
-
const fgColor =
|
|
6436
|
-
const bgColor =
|
|
6435
|
+
const fgColor = chunkCHHLFKT6_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
6436
|
+
const bgColor = chunkCHHLFKT6_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
6437
6437
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
6438
6438
|
switch (preset) {
|
|
6439
6439
|
case "ltHorz":
|
|
@@ -6544,11 +6544,11 @@ function parseCellBorders(cellProperties) {
|
|
|
6544
6544
|
const prstDash = ln["a:prstDash"];
|
|
6545
6545
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
6546
6546
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
6547
|
-
const color =
|
|
6547
|
+
const color = chunkCHHLFKT6_js.parseDrawingColor(ln["a:solidFill"]);
|
|
6548
6548
|
if (color) {
|
|
6549
|
-
const opacity =
|
|
6549
|
+
const opacity = chunkCHHLFKT6_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
6550
6550
|
const key = `${edge.prefix}`;
|
|
6551
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
6551
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkCHHLFKT6_js.colorWithOpacity(color, opacity)}`;
|
|
6552
6552
|
}
|
|
6553
6553
|
}
|
|
6554
6554
|
return borderStyle;
|
|
@@ -6561,7 +6561,7 @@ function parseCellTextEffects(runProps) {
|
|
|
6561
6561
|
const textShadowParts = [];
|
|
6562
6562
|
const outerShdw = effectLst["a:outerShdw"];
|
|
6563
6563
|
if (outerShdw) {
|
|
6564
|
-
const shdwColor =
|
|
6564
|
+
const shdwColor = chunkCHHLFKT6_js.parseDrawingColor(outerShdw);
|
|
6565
6565
|
if (shdwColor) {
|
|
6566
6566
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
6567
6567
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -6579,7 +6579,7 @@ function parseCellTextEffects(runProps) {
|
|
|
6579
6579
|
}
|
|
6580
6580
|
const glow = effectLst["a:glow"];
|
|
6581
6581
|
if (glow) {
|
|
6582
|
-
const glowColor =
|
|
6582
|
+
const glowColor = chunkCHHLFKT6_js.parseDrawingColor(glow);
|
|
6583
6583
|
if (glowColor) {
|
|
6584
6584
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
6585
6585
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -6658,10 +6658,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
6658
6658
|
if (runProps?.["@_u"] !== void 0) {
|
|
6659
6659
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
6660
6660
|
}
|
|
6661
|
-
const runColor =
|
|
6661
|
+
const runColor = chunkCHHLFKT6_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkCHHLFKT6_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
6662
6662
|
if (runColor) {
|
|
6663
|
-
const opacity =
|
|
6664
|
-
cellStyle.color =
|
|
6663
|
+
const opacity = chunkCHHLFKT6_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
6664
|
+
cellStyle.color = chunkCHHLFKT6_js.colorWithOpacity(runColor, opacity);
|
|
6665
6665
|
}
|
|
6666
6666
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
6667
6667
|
if (fontFamily) {
|
|
@@ -6671,15 +6671,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
6671
6671
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
6672
6672
|
}
|
|
6673
6673
|
const cellProperties = cellXml["a:tcPr"];
|
|
6674
|
-
const cellFill =
|
|
6674
|
+
const cellFill = chunkCHHLFKT6_js.parseDrawingColor(
|
|
6675
6675
|
cellProperties?.["a:solidFill"],
|
|
6676
6676
|
schemeColorOverrides
|
|
6677
6677
|
);
|
|
6678
6678
|
if (cellFill) {
|
|
6679
|
-
const opacity =
|
|
6679
|
+
const opacity = chunkCHHLFKT6_js.parseDrawingColorOpacity(
|
|
6680
6680
|
cellProperties?.["a:solidFill"]
|
|
6681
6681
|
);
|
|
6682
|
-
cellStyle.backgroundColor =
|
|
6682
|
+
cellStyle.backgroundColor = chunkCHHLFKT6_js.colorWithOpacity(cellFill, opacity);
|
|
6683
6683
|
} else {
|
|
6684
6684
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
6685
6685
|
if (gradCss) {
|
|
@@ -6694,16 +6694,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
6694
6694
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
6695
6695
|
Object.assign(cellStyle, edgeBorders);
|
|
6696
6696
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
6697
|
-
const borderColor =
|
|
6697
|
+
const borderColor = chunkCHHLFKT6_js.parseDrawingColor(
|
|
6698
6698
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
6699
6699
|
schemeColorOverrides
|
|
6700
|
-
) ||
|
|
6700
|
+
) || chunkCHHLFKT6_js.parseDrawingColor(
|
|
6701
6701
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
6702
6702
|
schemeColorOverrides
|
|
6703
|
-
) ||
|
|
6703
|
+
) || chunkCHHLFKT6_js.parseDrawingColor(
|
|
6704
6704
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
6705
6705
|
schemeColorOverrides
|
|
6706
|
-
) ||
|
|
6706
|
+
) || chunkCHHLFKT6_js.parseDrawingColor(
|
|
6707
6707
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
6708
6708
|
schemeColorOverrides
|
|
6709
6709
|
);
|
|
@@ -6782,10 +6782,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
6782
6782
|
}
|
|
6783
6783
|
let color = base;
|
|
6784
6784
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
6785
|
-
color =
|
|
6785
|
+
color = chunkCHHLFKT6_js.tintColor2(color, fill.tint / 1e5);
|
|
6786
6786
|
}
|
|
6787
6787
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
6788
|
-
color =
|
|
6788
|
+
color = chunkCHHLFKT6_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
6789
6789
|
}
|
|
6790
6790
|
return color;
|
|
6791
6791
|
}
|
|
@@ -6810,7 +6810,7 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
6810
6810
|
style.fontFamily = text.fontFace;
|
|
6811
6811
|
applied = true;
|
|
6812
6812
|
} else {
|
|
6813
|
-
const refFont =
|
|
6813
|
+
const refFont = chunkCHHLFKT6_js.resolveFontRefIdx(text.fontRefIdx, fontScheme);
|
|
6814
6814
|
if (refFont) {
|
|
6815
6815
|
style.fontFamily = refFont;
|
|
6816
6816
|
applied = true;
|
|
@@ -6821,10 +6821,10 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
6821
6821
|
if (base) {
|
|
6822
6822
|
let color = base;
|
|
6823
6823
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
6824
|
-
color =
|
|
6824
|
+
color = chunkCHHLFKT6_js.tintColor2(color, text.fontTint / 1e5);
|
|
6825
6825
|
}
|
|
6826
6826
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
6827
|
-
color =
|
|
6827
|
+
color = chunkCHHLFKT6_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
6828
6828
|
}
|
|
6829
6829
|
style.color = color;
|
|
6830
6830
|
applied = true;
|
|
@@ -7013,7 +7013,7 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
7013
7013
|
};
|
|
7014
7014
|
}
|
|
7015
7015
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
7016
|
-
return
|
|
7016
|
+
return chunkCHHLFKT6_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
7017
7017
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
7018
7018
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
7019
7019
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -7161,9 +7161,9 @@ function cellStyleToCss(style) {
|
|
|
7161
7161
|
if (style.gradientFillCss) {
|
|
7162
7162
|
css.background = style.gradientFillCss;
|
|
7163
7163
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
7164
|
-
const fg =
|
|
7165
|
-
const bg =
|
|
7166
|
-
const svgPattern =
|
|
7164
|
+
const fg = chunkCHHLFKT6_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
7165
|
+
const bg = chunkCHHLFKT6_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
7166
|
+
const svgPattern = chunkCHHLFKT6_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
7167
7167
|
if (svgPattern) {
|
|
7168
7168
|
const encoded = encodeURIComponent(svgPattern);
|
|
7169
7169
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -7239,7 +7239,7 @@ function cellStyleToCss(style) {
|
|
|
7239
7239
|
if (edge.width || edge.color) {
|
|
7240
7240
|
const w = edge.width ?? 1;
|
|
7241
7241
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
7242
|
-
const s =
|
|
7242
|
+
const s = chunkCHHLFKT6_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
7243
7243
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
7244
7244
|
}
|
|
7245
7245
|
}
|
|
@@ -7270,7 +7270,7 @@ function cellStyleToCss(style) {
|
|
|
7270
7270
|
css.textShadow = textShadowParts.join(", ");
|
|
7271
7271
|
}
|
|
7272
7272
|
if (style.cell3D) {
|
|
7273
|
-
Object.assign(css,
|
|
7273
|
+
Object.assign(css, chunkCHHLFKT6_js.cell3DBevelCss(style.cell3D));
|
|
7274
7274
|
}
|
|
7275
7275
|
return css;
|
|
7276
7276
|
}
|
|
@@ -7284,7 +7284,7 @@ function TableResizeOverlay({
|
|
|
7284
7284
|
const containerRef = React4.useRef(null);
|
|
7285
7285
|
const [rowBounds, setRowBounds] = React4.useState([]);
|
|
7286
7286
|
const dragRef = React4.useRef(null);
|
|
7287
|
-
const colBoundaries = React4.useMemo(() =>
|
|
7287
|
+
const colBoundaries = React4.useMemo(() => chunkCHHLFKT6_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
7288
7288
|
const measureRows = React4.useCallback(() => {
|
|
7289
7289
|
const container = containerRef.current;
|
|
7290
7290
|
if (!container) {
|
|
@@ -7331,11 +7331,11 @@ function TableResizeOverlay({
|
|
|
7331
7331
|
const rect = containerRef.current.getBoundingClientRect();
|
|
7332
7332
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
7333
7333
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
7334
|
-
onResizeColumns(
|
|
7334
|
+
onResizeColumns(chunkCHHLFKT6_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
7335
7335
|
} else if (drag.type === "row" && onResizeRow) {
|
|
7336
7336
|
const deltaY = e.clientY - drag.startPos;
|
|
7337
|
-
const newHeight =
|
|
7338
|
-
drag.initialRowHeight ??
|
|
7337
|
+
const newHeight = chunkCHHLFKT6_js.computeResizedRowHeight(
|
|
7338
|
+
drag.initialRowHeight ?? chunkCHHLFKT6_js.DEFAULT_ROW_HEIGHT,
|
|
7339
7339
|
deltaY
|
|
7340
7340
|
);
|
|
7341
7341
|
onResizeRow(drag.index, newHeight);
|
|
@@ -7373,7 +7373,7 @@ function TableResizeOverlay({
|
|
|
7373
7373
|
e.stopPropagation();
|
|
7374
7374
|
const table = containerRef.current?.querySelector("table");
|
|
7375
7375
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
7376
|
-
const actualHeight = tr?.offsetHeight ??
|
|
7376
|
+
const actualHeight = tr?.offsetHeight ?? chunkCHHLFKT6_js.DEFAULT_ROW_HEIGHT;
|
|
7377
7377
|
document.body.style.cursor = "row-resize";
|
|
7378
7378
|
document.body.style.userSelect = "none";
|
|
7379
7379
|
dragRef.current = {
|
|
@@ -7421,7 +7421,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
7421
7421
|
}
|
|
7422
7422
|
const first = selectedCell.selectedCells[0];
|
|
7423
7423
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
7424
|
-
return
|
|
7424
|
+
return chunkCHHLFKT6_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
7425
7425
|
})();
|
|
7426
7426
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7427
7427
|
TableResizeOverlay,
|
|
@@ -7454,7 +7454,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
7454
7454
|
return null;
|
|
7455
7455
|
}
|
|
7456
7456
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
7457
|
-
const isInMultiSelection =
|
|
7457
|
+
const isInMultiSelection = chunkCHHLFKT6_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
7458
7458
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
7459
7459
|
const diag = getCellDiagonalBorders2(
|
|
7460
7460
|
cell.style,
|
|
@@ -7484,7 +7484,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
7484
7484
|
}
|
|
7485
7485
|
event.stopPropagation();
|
|
7486
7486
|
if (event.shiftKey && selectedCell) {
|
|
7487
|
-
const rect =
|
|
7487
|
+
const rect = chunkCHHLFKT6_js.computeSelectionRect(
|
|
7488
7488
|
selectedCell.rowIndex,
|
|
7489
7489
|
selectedCell.columnIndex,
|
|
7490
7490
|
rowIndex,
|
|
@@ -7494,7 +7494,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
7494
7494
|
options?.onSelectCell?.({
|
|
7495
7495
|
rowIndex: selectedCell.rowIndex,
|
|
7496
7496
|
columnIndex: selectedCell.columnIndex,
|
|
7497
|
-
selectedCells:
|
|
7497
|
+
selectedCells: chunkCHHLFKT6_js.rectToCells(rect)
|
|
7498
7498
|
});
|
|
7499
7499
|
} else {
|
|
7500
7500
|
options?.onSelectCell?.({
|
|
@@ -7571,7 +7571,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7571
7571
|
}
|
|
7572
7572
|
const first = selectedCell.selectedCells[0];
|
|
7573
7573
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
7574
|
-
return
|
|
7574
|
+
return chunkCHHLFKT6_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
7575
7575
|
})();
|
|
7576
7576
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
7577
7577
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7648,7 +7648,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7648
7648
|
"border px-1 py-0.5 align-top",
|
|
7649
7649
|
isEditable2 && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
7650
7650
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
7651
|
-
|
|
7651
|
+
chunkCHHLFKT6_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
7652
7652
|
),
|
|
7653
7653
|
colSpan,
|
|
7654
7654
|
rowSpan: rSpan,
|
|
@@ -7659,7 +7659,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7659
7659
|
}
|
|
7660
7660
|
event.stopPropagation();
|
|
7661
7661
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
7662
|
-
const rect =
|
|
7662
|
+
const rect = chunkCHHLFKT6_js.computeSelectionRect(
|
|
7663
7663
|
selectedCell.rowIndex,
|
|
7664
7664
|
selectedCell.columnIndex,
|
|
7665
7665
|
rowIndex,
|
|
@@ -7669,7 +7669,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7669
7669
|
options?.onSelectCell?.({
|
|
7670
7670
|
rowIndex: selectedCell.rowIndex,
|
|
7671
7671
|
columnIndex: selectedCell.columnIndex,
|
|
7672
|
-
selectedCells:
|
|
7672
|
+
selectedCells: chunkCHHLFKT6_js.rectToCells(rect)
|
|
7673
7673
|
});
|
|
7674
7674
|
} else {
|
|
7675
7675
|
options?.onSelectCell?.({
|
|
@@ -7724,24 +7724,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7724
7724
|
}
|
|
7725
7725
|
var LEGEND_ITEM_WIDTH = 80;
|
|
7726
7726
|
function partAttrs(part) {
|
|
7727
|
-
return part ?
|
|
7727
|
+
return part ? chunkCHHLFKT6_js.chartPartToAttrs(part) : void 0;
|
|
7728
7728
|
}
|
|
7729
7729
|
function resolveReactPalette(chartData) {
|
|
7730
7730
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
7731
7731
|
return chartData.colorPalette;
|
|
7732
7732
|
}
|
|
7733
|
-
return [...
|
|
7733
|
+
return [...chunkCHHLFKT6_js.getChartStylePalette(chartData.style?.styleId)];
|
|
7734
7734
|
}
|
|
7735
7735
|
function buildReactChartViewModel(element) {
|
|
7736
7736
|
if (element.type !== "chart" || !element.chartData) {
|
|
7737
|
-
return
|
|
7737
|
+
return chunkCHHLFKT6_js.buildChartViewModel(element);
|
|
7738
7738
|
}
|
|
7739
7739
|
const palette = resolveReactPalette(element.chartData);
|
|
7740
7740
|
const themedElement = {
|
|
7741
7741
|
...element,
|
|
7742
7742
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
7743
7743
|
};
|
|
7744
|
-
return
|
|
7744
|
+
return chunkCHHLFKT6_js.buildChartViewModel(themedElement);
|
|
7745
7745
|
}
|
|
7746
7746
|
function renderPrimitive(prim, key) {
|
|
7747
7747
|
switch (prim.kind) {
|
|
@@ -8130,7 +8130,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8130
8130
|
const unmatchedRows = [];
|
|
8131
8131
|
categories.forEach((cat, i) => {
|
|
8132
8132
|
const value = values[i] ?? 0;
|
|
8133
|
-
const code =
|
|
8133
|
+
const code = chunkCHHLFKT6_js.resolveRegionCode(cat);
|
|
8134
8134
|
if (code) {
|
|
8135
8135
|
regionValueMap.set(code, { value, label: cat });
|
|
8136
8136
|
} else {
|
|
@@ -8168,8 +8168,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8168
8168
|
let fill = "#e2e8f0";
|
|
8169
8169
|
let dataLabel = null;
|
|
8170
8170
|
if (entry) {
|
|
8171
|
-
const t =
|
|
8172
|
-
fill =
|
|
8171
|
+
const t = chunkCHHLFKT6_js.normalizeValue(entry.value, minVal, maxVal);
|
|
8172
|
+
fill = chunkCHHLFKT6_js.sequentialColorScale(t);
|
|
8173
8173
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
8174
8174
|
"text",
|
|
8175
8175
|
{
|
|
@@ -8180,7 +8180,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8180
8180
|
fontWeight: 600,
|
|
8181
8181
|
fill: "#1e293b",
|
|
8182
8182
|
style: { pointerEvents: "none" },
|
|
8183
|
-
children:
|
|
8183
|
+
children: chunkCHHLFKT6_js.formatAxisValue(entry.value)
|
|
8184
8184
|
},
|
|
8185
8185
|
`${element.id}-map-dl-${region.code}`
|
|
8186
8186
|
);
|
|
@@ -8198,7 +8198,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8198
8198
|
opacity: 0.9,
|
|
8199
8199
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
8200
8200
|
region.name,
|
|
8201
|
-
entry ? `: ${
|
|
8201
|
+
entry ? `: ${chunkCHHLFKT6_js.formatAxisValue(entry.value)}` : ""
|
|
8202
8202
|
] })
|
|
8203
8203
|
}
|
|
8204
8204
|
),
|
|
@@ -8236,7 +8236,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8236
8236
|
fontSize: 7,
|
|
8237
8237
|
fill: "#64748b",
|
|
8238
8238
|
textAnchor: "middle",
|
|
8239
|
-
children:
|
|
8239
|
+
children: chunkCHHLFKT6_js.formatAxisValue(minVal)
|
|
8240
8240
|
},
|
|
8241
8241
|
`${element.id}-map-legend-min`
|
|
8242
8242
|
),
|
|
@@ -8248,7 +8248,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8248
8248
|
fontSize: 7,
|
|
8249
8249
|
fill: "#64748b",
|
|
8250
8250
|
textAnchor: "middle",
|
|
8251
|
-
children:
|
|
8251
|
+
children: chunkCHHLFKT6_js.formatAxisValue(maxVal)
|
|
8252
8252
|
},
|
|
8253
8253
|
`${element.id}-map-legend-max`
|
|
8254
8254
|
)
|
|
@@ -8314,7 +8314,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8314
8314
|
y,
|
|
8315
8315
|
fontSize,
|
|
8316
8316
|
fill: "#475569",
|
|
8317
|
-
children:
|
|
8317
|
+
children: chunkCHHLFKT6_js.formatAxisValue(row.value)
|
|
8318
8318
|
},
|
|
8319
8319
|
`${element.id}-map-ft-val-${i}`
|
|
8320
8320
|
)
|
|
@@ -8385,7 +8385,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
8385
8385
|
|
|
8386
8386
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
8387
8387
|
function sColor(series, idx) {
|
|
8388
|
-
return
|
|
8388
|
+
return chunkCHHLFKT6_js.seriesColor(series, idx);
|
|
8389
8389
|
}
|
|
8390
8390
|
function valToY(val, range, topY, bottomY) {
|
|
8391
8391
|
const usable = bottomY - topY;
|
|
@@ -8924,7 +8924,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
8924
8924
|
width: 10,
|
|
8925
8925
|
height: 10,
|
|
8926
8926
|
rx: 2,
|
|
8927
|
-
fill:
|
|
8927
|
+
fill: chunkCHHLFKT6_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
8928
8928
|
},
|
|
8929
8929
|
`${id}-leg-r-${i}`
|
|
8930
8930
|
)
|
|
@@ -8948,7 +8948,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
8948
8948
|
width: 10,
|
|
8949
8949
|
height: 10,
|
|
8950
8950
|
rx: 2,
|
|
8951
|
-
fill:
|
|
8951
|
+
fill: chunkCHHLFKT6_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
8952
8952
|
}
|
|
8953
8953
|
),
|
|
8954
8954
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -8961,9 +8961,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
8961
8961
|
}
|
|
8962
8962
|
const lines = [];
|
|
8963
8963
|
if (range.logScale && range.logBase) {
|
|
8964
|
-
const ticks =
|
|
8964
|
+
const ticks = chunkCHHLFKT6_js.generateLogTicks(range);
|
|
8965
8965
|
ticks.forEach((tickVal, i) => {
|
|
8966
|
-
const y =
|
|
8966
|
+
const y = chunkCHHLFKT6_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
8967
8967
|
lines.push(
|
|
8968
8968
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8969
8969
|
"line",
|
|
@@ -8984,7 +8984,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
8984
8984
|
const steps = 4;
|
|
8985
8985
|
for (let i = 0; i <= steps; i++) {
|
|
8986
8986
|
const val = range.min + range.span * i / steps;
|
|
8987
|
-
const y =
|
|
8987
|
+
const y = chunkCHHLFKT6_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8988
8988
|
lines.push(
|
|
8989
8989
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8990
8990
|
"line",
|
|
@@ -9008,9 +9008,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9008
9008
|
const labels = [];
|
|
9009
9009
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
9010
9010
|
if (range.logScale && range.logBase) {
|
|
9011
|
-
const ticks =
|
|
9011
|
+
const ticks = chunkCHHLFKT6_js.generateLogTicks(range);
|
|
9012
9012
|
ticks.forEach((tickVal, i) => {
|
|
9013
|
-
const y =
|
|
9013
|
+
const y = chunkCHHLFKT6_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
9014
9014
|
labels.push(
|
|
9015
9015
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9016
9016
|
"text",
|
|
@@ -9020,7 +9020,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9020
9020
|
textAnchor: "end",
|
|
9021
9021
|
fontSize: 8,
|
|
9022
9022
|
fill: "#64748b",
|
|
9023
|
-
children: hasDisplayUnits ?
|
|
9023
|
+
children: hasDisplayUnits ? chunkCHHLFKT6_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkCHHLFKT6_js.formatAxisValue(tickVal)
|
|
9024
9024
|
},
|
|
9025
9025
|
`${id}-vaxis-log-${i}`
|
|
9026
9026
|
)
|
|
@@ -9030,7 +9030,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9030
9030
|
const steps = 4;
|
|
9031
9031
|
for (let i = 0; i <= steps; i++) {
|
|
9032
9032
|
const val = range.min + range.span * i / steps;
|
|
9033
|
-
const y =
|
|
9033
|
+
const y = chunkCHHLFKT6_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
9034
9034
|
labels.push(
|
|
9035
9035
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9036
9036
|
"text",
|
|
@@ -9040,7 +9040,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9040
9040
|
textAnchor: "end",
|
|
9041
9041
|
fontSize: 8,
|
|
9042
9042
|
fill: "#64748b",
|
|
9043
|
-
children: hasDisplayUnits ?
|
|
9043
|
+
children: hasDisplayUnits ? chunkCHHLFKT6_js.formatAxisValueWithUnits(val, axisFormatting) : chunkCHHLFKT6_js.formatAxisValue(val)
|
|
9044
9044
|
},
|
|
9045
9045
|
`${id}-vaxis-${i}`
|
|
9046
9046
|
)
|
|
@@ -9048,7 +9048,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9048
9048
|
}
|
|
9049
9049
|
}
|
|
9050
9050
|
if (hasDisplayUnits) {
|
|
9051
|
-
const unitLabel =
|
|
9051
|
+
const unitLabel = chunkCHHLFKT6_js.getDisplayUnitLabel(
|
|
9052
9052
|
axisFormatting.displayUnits,
|
|
9053
9053
|
axisFormatting.displayUnitsLabel
|
|
9054
9054
|
);
|
|
@@ -9123,7 +9123,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
9123
9123
|
if (range.min >= 0) {
|
|
9124
9124
|
return null;
|
|
9125
9125
|
}
|
|
9126
|
-
const y =
|
|
9126
|
+
const y = chunkCHHLFKT6_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
9127
9127
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9128
9128
|
"line",
|
|
9129
9129
|
{
|
|
@@ -9147,7 +9147,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
9147
9147
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
9148
9148
|
for (let i = 0; i <= steps; i++) {
|
|
9149
9149
|
const val = range.min + range.span * i / steps;
|
|
9150
|
-
const y =
|
|
9150
|
+
const y = chunkCHHLFKT6_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
9151
9151
|
labels.push(
|
|
9152
9152
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9153
9153
|
"text",
|
|
@@ -9159,7 +9159,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
9159
9159
|
fontFamily,
|
|
9160
9160
|
fontWeight,
|
|
9161
9161
|
fill: fontColor,
|
|
9162
|
-
children: hasDisplayUnits ?
|
|
9162
|
+
children: hasDisplayUnits ? chunkCHHLFKT6_js.formatAxisValueWithUnits(val, axisFormatting) : chunkCHHLFKT6_js.formatAxisValue(val)
|
|
9163
9163
|
},
|
|
9164
9164
|
`${id}-sec-vaxis-${i}`
|
|
9165
9165
|
)
|
|
@@ -9183,7 +9183,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
9183
9183
|
);
|
|
9184
9184
|
}
|
|
9185
9185
|
if (hasDisplayUnits) {
|
|
9186
|
-
const unitLabel =
|
|
9186
|
+
const unitLabel = chunkCHHLFKT6_js.getDisplayUnitLabel(
|
|
9187
9187
|
axisFormatting.displayUnits,
|
|
9188
9188
|
axisFormatting.displayUnitsLabel
|
|
9189
9189
|
);
|
|
@@ -9214,7 +9214,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
9214
9214
|
const ticks = [];
|
|
9215
9215
|
for (let i = 0; i <= steps; i++) {
|
|
9216
9216
|
const val = range.min + range.span * i / steps;
|
|
9217
|
-
const y =
|
|
9217
|
+
const y = chunkCHHLFKT6_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
9218
9218
|
ticks.push(
|
|
9219
9219
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9220
9220
|
"line",
|
|
@@ -9241,7 +9241,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
9241
9241
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
9242
9242
|
for (let i = 0; i <= steps; i++) {
|
|
9243
9243
|
const val = range.min + range.span * i / steps;
|
|
9244
|
-
const y =
|
|
9244
|
+
const y = chunkCHHLFKT6_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
9245
9245
|
lines.push(
|
|
9246
9246
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9247
9247
|
"line",
|
|
@@ -9403,7 +9403,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
9403
9403
|
width: 8,
|
|
9404
9404
|
height: 8,
|
|
9405
9405
|
borderRadius: 2,
|
|
9406
|
-
backgroundColor:
|
|
9406
|
+
backgroundColor: chunkCHHLFKT6_js.seriesColor(
|
|
9407
9407
|
s,
|
|
9408
9408
|
si,
|
|
9409
9409
|
chartData.style?.styleId,
|
|
@@ -9442,8 +9442,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
9442
9442
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
9443
9443
|
const style = chartData.style;
|
|
9444
9444
|
const legendPos = style?.legendPosition || "b";
|
|
9445
|
-
const range =
|
|
9446
|
-
const layout =
|
|
9445
|
+
const range = chunkCHHLFKT6_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
9446
|
+
const layout = chunkCHHLFKT6_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
9447
9447
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
9448
9448
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
9449
9449
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -9464,10 +9464,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
9464
9464
|
const close = closeSeries.values[ci] ?? high;
|
|
9465
9465
|
const isUp = close >= open;
|
|
9466
9466
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
9467
|
-
const highY =
|
|
9468
|
-
const lowY =
|
|
9469
|
-
const openY =
|
|
9470
|
-
const closeY =
|
|
9467
|
+
const highY = chunkCHHLFKT6_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
9468
|
+
const lowY = chunkCHHLFKT6_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
9469
|
+
const openY = chunkCHHLFKT6_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
9470
|
+
const closeY = chunkCHHLFKT6_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
9471
9471
|
elements.push(
|
|
9472
9472
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9473
9473
|
"line",
|
|
@@ -9510,7 +9510,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
9510
9510
|
textAnchor: "middle",
|
|
9511
9511
|
fontSize: 7,
|
|
9512
9512
|
fill: "#334155",
|
|
9513
|
-
children:
|
|
9513
|
+
children: chunkCHHLFKT6_js.formatAxisValue(close)
|
|
9514
9514
|
},
|
|
9515
9515
|
`${element.id}-stock-dl-${ci}`
|
|
9516
9516
|
)
|
|
@@ -9552,7 +9552,7 @@ function FailedToLoad() {
|
|
|
9552
9552
|
var LazySurfaceChart3DScene = React4__default.default.lazy(
|
|
9553
9553
|
async () => {
|
|
9554
9554
|
try {
|
|
9555
|
-
return await import('./SurfaceChart3DScene-
|
|
9555
|
+
return await import('./SurfaceChart3DScene-JU2MS2BP.js');
|
|
9556
9556
|
} catch {
|
|
9557
9557
|
return { default: FailedToLoad };
|
|
9558
9558
|
}
|
|
@@ -9576,7 +9576,7 @@ var SurfaceChart3DErrorBoundary = class extends React4__default.default.Componen
|
|
|
9576
9576
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
9577
9577
|
const rows = chartData.series.length;
|
|
9578
9578
|
const cols = Math.max(categoryLabels.length, 1);
|
|
9579
|
-
const range =
|
|
9579
|
+
const range = chunkCHHLFKT6_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
9580
9580
|
const heightMap = new Float32Array(rows * cols);
|
|
9581
9581
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
9582
9582
|
for (let r = 0; r < rows; r++) {
|
|
@@ -9696,8 +9696,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
9696
9696
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
9697
9697
|
const style = chartData.style;
|
|
9698
9698
|
const legendPos = style?.legendPosition || "b";
|
|
9699
|
-
const layout =
|
|
9700
|
-
const range =
|
|
9699
|
+
const layout = chunkCHHLFKT6_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
9700
|
+
const range = chunkCHHLFKT6_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
9701
9701
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
9702
9702
|
const seriesCount = chartData.series.length;
|
|
9703
9703
|
const cols = catCount - 1;
|
|
@@ -9787,8 +9787,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
9787
9787
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
9788
9788
|
const style = chartData.style;
|
|
9789
9789
|
const legendPos = style?.legendPosition || "b";
|
|
9790
|
-
const layout =
|
|
9791
|
-
const range =
|
|
9790
|
+
const layout = chunkCHHLFKT6_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
9791
|
+
const range = chunkCHHLFKT6_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
9792
9792
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
9793
9793
|
const seriesCount = chartData.series.length;
|
|
9794
9794
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -9851,7 +9851,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
9851
9851
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
9852
9852
|
const style = chartData.style;
|
|
9853
9853
|
const legendPos = style?.legendPosition || "b";
|
|
9854
|
-
const layout =
|
|
9854
|
+
const layout = chunkCHHLFKT6_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
9855
9855
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
9856
9856
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
9857
9857
|
const rects = [];
|
|
@@ -9874,7 +9874,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
9874
9874
|
y: curY,
|
|
9875
9875
|
width: Math.max(w - 1, 1),
|
|
9876
9876
|
height: Math.max(h - 1, 1),
|
|
9877
|
-
fill:
|
|
9877
|
+
fill: chunkCHHLFKT6_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
9878
9878
|
rx: 2,
|
|
9879
9879
|
opacity: 0.85
|
|
9880
9880
|
},
|
|
@@ -9927,8 +9927,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
9927
9927
|
const style = chartData.style;
|
|
9928
9928
|
const legendPos = style?.legendPosition || "b";
|
|
9929
9929
|
const values = chartData.series[0]?.values ?? [];
|
|
9930
|
-
const range =
|
|
9931
|
-
const layout =
|
|
9930
|
+
const range = chunkCHHLFKT6_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
9931
|
+
const layout = chunkCHHLFKT6_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
9932
9932
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
9933
9933
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
9934
9934
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -9939,8 +9939,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
9939
9939
|
const isLast = i === values.length - 1;
|
|
9940
9940
|
const startVal = isLast ? 0 : runningTotal;
|
|
9941
9941
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
9942
|
-
const barStartY =
|
|
9943
|
-
const barEndY =
|
|
9942
|
+
const barStartY = chunkCHHLFKT6_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
9943
|
+
const barEndY = chunkCHHLFKT6_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
9944
9944
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
9945
9945
|
const y = Math.min(barStartY, barEndY);
|
|
9946
9946
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -9969,7 +9969,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
9969
9969
|
textAnchor: "middle",
|
|
9970
9970
|
fontSize: 7,
|
|
9971
9971
|
fill: "#334155",
|
|
9972
|
-
children:
|
|
9972
|
+
children: chunkCHHLFKT6_js.formatAxisValue(isLast ? endVal : val)
|
|
9973
9973
|
},
|
|
9974
9974
|
`${element.id}-wf-dl-${i}`
|
|
9975
9975
|
)
|
|
@@ -10017,18 +10017,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
10017
10017
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
10018
10018
|
const style = chartData.style;
|
|
10019
10019
|
const legendPos = style?.legendPosition || "b";
|
|
10020
|
-
const layoutOpts =
|
|
10020
|
+
const layoutOpts = chunkCHHLFKT6_js.computeLayoutOptions(
|
|
10021
10021
|
chartData.axes,
|
|
10022
10022
|
chartData.dataTable,
|
|
10023
10023
|
chartData.series.length
|
|
10024
10024
|
);
|
|
10025
|
-
const layout =
|
|
10026
|
-
const { primary, secondary } =
|
|
10025
|
+
const layout = chunkCHHLFKT6_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
10026
|
+
const { primary, secondary } = chunkCHHLFKT6_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
10027
10027
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
10028
10028
|
const secondarySeries = secondary.map((e) => e.series);
|
|
10029
|
-
const range =
|
|
10030
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
10031
|
-
const secondaryAxisFmt =
|
|
10029
|
+
const range = chunkCHHLFKT6_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
10030
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkCHHLFKT6_js.computeValueRange(secondarySeries) : void 0;
|
|
10031
|
+
const secondaryAxisFmt = chunkCHHLFKT6_js.getSecondaryValueAxis(chartData.axes);
|
|
10032
10032
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
10033
10033
|
const barSeriesCount = 1;
|
|
10034
10034
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -10044,8 +10044,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10044
10044
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
10045
10045
|
barSeries.values.forEach((val, vi) => {
|
|
10046
10046
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
10047
|
-
const zeroY =
|
|
10048
|
-
const valY =
|
|
10047
|
+
const zeroY = chunkCHHLFKT6_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
10048
|
+
const valY = chunkCHHLFKT6_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
10049
10049
|
const y = Math.min(zeroY, valY);
|
|
10050
10050
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
10051
10051
|
barElements.push(
|
|
@@ -10056,7 +10056,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10056
10056
|
y,
|
|
10057
10057
|
width: barWidth,
|
|
10058
10058
|
height: h,
|
|
10059
|
-
fill:
|
|
10059
|
+
fill: chunkCHHLFKT6_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
10060
10060
|
rx: 1
|
|
10061
10061
|
},
|
|
10062
10062
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -10072,7 +10072,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10072
10072
|
textAnchor: "middle",
|
|
10073
10073
|
fontSize: 7,
|
|
10074
10074
|
fill: "#334155",
|
|
10075
|
-
children:
|
|
10075
|
+
children: chunkCHHLFKT6_js.formatAxisValue(val)
|
|
10076
10076
|
},
|
|
10077
10077
|
`${element.id}-combo-bar-dl-${vi}`
|
|
10078
10078
|
)
|
|
@@ -10089,10 +10089,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10089
10089
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
10090
10090
|
const points = series.values.map((val, vi) => {
|
|
10091
10091
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
10092
|
-
const y =
|
|
10092
|
+
const y = chunkCHHLFKT6_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
10093
10093
|
return { x, y, val };
|
|
10094
10094
|
});
|
|
10095
|
-
const c =
|
|
10095
|
+
const c = chunkCHHLFKT6_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
10096
10096
|
lineElements.push(
|
|
10097
10097
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10098
10098
|
"polyline",
|
|
@@ -10119,7 +10119,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10119
10119
|
textAnchor: "middle",
|
|
10120
10120
|
fontSize: 7,
|
|
10121
10121
|
fill: "#334155",
|
|
10122
|
-
children:
|
|
10122
|
+
children: chunkCHHLFKT6_js.formatAxisValue(p.val)
|
|
10123
10123
|
},
|
|
10124
10124
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
10125
10125
|
)
|
|
@@ -10233,6 +10233,21 @@ var DEFAULT_PALETTE = PALETTES.colorful1;
|
|
|
10233
10233
|
function colour(index, palette = DEFAULT_PALETTE) {
|
|
10234
10234
|
return palette[index % palette.length];
|
|
10235
10235
|
}
|
|
10236
|
+
function contrastingTextColor(background) {
|
|
10237
|
+
if (!background) {
|
|
10238
|
+
return "#000000";
|
|
10239
|
+
}
|
|
10240
|
+
const match = /^#([\da-f]{3}|[\da-f]{6})$/iu.exec(background.trim());
|
|
10241
|
+
if (!match) {
|
|
10242
|
+
return "#000000";
|
|
10243
|
+
}
|
|
10244
|
+
const hex = match[1].length === 3 ? [...match[1]].map((component) => component + component).join("") : match[1];
|
|
10245
|
+
const red = Number.parseInt(hex.slice(0, 2), 16);
|
|
10246
|
+
const green = Number.parseInt(hex.slice(2, 4), 16);
|
|
10247
|
+
const blue = Number.parseInt(hex.slice(4, 6), 16);
|
|
10248
|
+
const luminance = (red * 299 + green * 587 + blue * 114) / 1e3;
|
|
10249
|
+
return luminance >= 160 ? "#000000" : "#FFFFFF";
|
|
10250
|
+
}
|
|
10236
10251
|
function nodeOpacity(index, total, style) {
|
|
10237
10252
|
const base = style === "intense" ? 1 : style === "moderate" ? 0.92 : 0.85;
|
|
10238
10253
|
if (total <= 1) {
|
|
@@ -10399,6 +10414,30 @@ function gearPath(cx, cy, outerR, innerR, teeth) {
|
|
|
10399
10414
|
segments.push("Z");
|
|
10400
10415
|
return segments.join(" ");
|
|
10401
10416
|
}
|
|
10417
|
+
function wrapSmartArtText(text, maxWidth, fontSize) {
|
|
10418
|
+
const estimatedCharacterWidth = Math.max(fontSize * 0.52, 1);
|
|
10419
|
+
const maxCharacters = Math.max(1, Math.floor(maxWidth / estimatedCharacterWidth));
|
|
10420
|
+
const lines = [];
|
|
10421
|
+
for (const authoredLine of text.split("\n")) {
|
|
10422
|
+
if (authoredLine.length <= maxCharacters) {
|
|
10423
|
+
if (authoredLine.length > 0) lines.push(authoredLine);
|
|
10424
|
+
continue;
|
|
10425
|
+
}
|
|
10426
|
+
const words = authoredLine.split(/\s+/u).filter(Boolean);
|
|
10427
|
+
let current = "";
|
|
10428
|
+
for (const word of words) {
|
|
10429
|
+
const candidate = current ? `${current} ${word}` : word;
|
|
10430
|
+
if (candidate.length <= maxCharacters || current.length === 0) {
|
|
10431
|
+
current = candidate;
|
|
10432
|
+
} else {
|
|
10433
|
+
lines.push(current);
|
|
10434
|
+
current = word;
|
|
10435
|
+
}
|
|
10436
|
+
}
|
|
10437
|
+
if (current) lines.push(current);
|
|
10438
|
+
}
|
|
10439
|
+
return lines;
|
|
10440
|
+
}
|
|
10402
10441
|
function SmartArtNodeText({
|
|
10403
10442
|
text,
|
|
10404
10443
|
x,
|
|
@@ -10408,9 +10447,10 @@ function SmartArtNodeText({
|
|
|
10408
10447
|
fontWeight,
|
|
10409
10448
|
fontStyle,
|
|
10410
10449
|
className,
|
|
10411
|
-
anchor = "middle"
|
|
10450
|
+
anchor = "middle",
|
|
10451
|
+
maxWidth
|
|
10412
10452
|
}) {
|
|
10413
|
-
const lines = text.split("\n").filter((l) => l.length > 0);
|
|
10453
|
+
const lines = maxWidth ? wrapSmartArtText(text, maxWidth, fontSize) : text.split("\n").filter((l) => l.length > 0);
|
|
10414
10454
|
const lineHeight = fontSize * 1.2;
|
|
10415
10455
|
let startY;
|
|
10416
10456
|
let dominantBaseline;
|
|
@@ -11880,14 +11920,14 @@ function buildNotesPdf(pages) {
|
|
|
11880
11920
|
notes: page.notes,
|
|
11881
11921
|
slideNumber: page.slideNumber
|
|
11882
11922
|
}));
|
|
11883
|
-
const bytes =
|
|
11923
|
+
const bytes = chunkCHHLFKT6_js.buildNotesPdfBytes(images, meta);
|
|
11884
11924
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
11885
11925
|
return URL.createObjectURL(blob);
|
|
11886
11926
|
}
|
|
11887
11927
|
|
|
11888
11928
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
11889
11929
|
function buildPdfFromImageData(images) {
|
|
11890
|
-
const bytes =
|
|
11930
|
+
const bytes = chunkCHHLFKT6_js.buildSlidesPdfBytes(images);
|
|
11891
11931
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
11892
11932
|
return URL.createObjectURL(blob);
|
|
11893
11933
|
}
|
|
@@ -11896,7 +11936,7 @@ function buildPdfFromImageData(images) {
|
|
|
11896
11936
|
var activePreview = null;
|
|
11897
11937
|
function startPreviewAnimation(elementId, preset, options) {
|
|
11898
11938
|
stopPreviewAnimation();
|
|
11899
|
-
const descriptor =
|
|
11939
|
+
const descriptor = chunkCHHLFKT6_js.buildPreviewAnimation(preset, options);
|
|
11900
11940
|
if (!descriptor) {
|
|
11901
11941
|
return;
|
|
11902
11942
|
}
|
|
@@ -11974,7 +12014,7 @@ function useElementOperations(input) {
|
|
|
11974
12014
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
11975
12015
|
const updateElementById = React4.useCallback(
|
|
11976
12016
|
(elementId, updates) => {
|
|
11977
|
-
if (
|
|
12017
|
+
if (chunkCHHLFKT6_js.isTemplateElementId(elementId)) {
|
|
11978
12018
|
const slideId = activeSlide?.id;
|
|
11979
12019
|
if (slideId) {
|
|
11980
12020
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -12014,7 +12054,7 @@ function useElementOperations(input) {
|
|
|
12014
12054
|
);
|
|
12015
12055
|
const updateSelectedShapeStyle = React4.useCallback(
|
|
12016
12056
|
(updates) => {
|
|
12017
|
-
if (!selectedElement || !
|
|
12057
|
+
if (!selectedElement || !chunkODMFBYAP_js.hasShapeProperties(selectedElement)) {
|
|
12018
12058
|
return;
|
|
12019
12059
|
}
|
|
12020
12060
|
updateSelectedElement({
|
|
@@ -12025,17 +12065,17 @@ function useElementOperations(input) {
|
|
|
12025
12065
|
);
|
|
12026
12066
|
const updateSelectedTextStyle = React4.useCallback(
|
|
12027
12067
|
(updates) => {
|
|
12028
|
-
if (!selectedElement || !
|
|
12068
|
+
if (!selectedElement || !chunkODMFBYAP_js.hasTextProperties(selectedElement)) {
|
|
12029
12069
|
return;
|
|
12030
12070
|
}
|
|
12031
|
-
const inlineSel =
|
|
12071
|
+
const inlineSel = chunkCHHLFKT6_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
12032
12072
|
if (inlineSel && selectedElement.textSegments) {
|
|
12033
|
-
const { newSegments: newSegments2, newSelection } =
|
|
12073
|
+
const { newSegments: newSegments2, newSelection } = chunkCHHLFKT6_js.applyStyleToSelectedSegments(
|
|
12034
12074
|
selectedElement.textSegments,
|
|
12035
12075
|
inlineSel,
|
|
12036
12076
|
updates
|
|
12037
12077
|
);
|
|
12038
|
-
|
|
12078
|
+
chunkCHHLFKT6_js.setPendingSelectionRestore(newSelection);
|
|
12039
12079
|
updateSelectedElement({
|
|
12040
12080
|
textSegments: newSegments2
|
|
12041
12081
|
});
|
|
@@ -12055,12 +12095,12 @@ function useElementOperations(input) {
|
|
|
12055
12095
|
);
|
|
12056
12096
|
const updateSelectedTextCase = React4.useCallback(
|
|
12057
12097
|
(mode) => {
|
|
12058
|
-
if (!selectedElement || !
|
|
12098
|
+
if (!selectedElement || !chunkODMFBYAP_js.hasTextProperties(selectedElement)) {
|
|
12059
12099
|
return;
|
|
12060
12100
|
}
|
|
12061
|
-
const inlineSel =
|
|
12101
|
+
const inlineSel = chunkCHHLFKT6_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
12062
12102
|
if (inlineSel && selectedElement.textSegments) {
|
|
12063
|
-
const newSegments =
|
|
12103
|
+
const newSegments = chunkCHHLFKT6_js.applyCaseTransformToSegments(
|
|
12064
12104
|
selectedElement.textSegments,
|
|
12065
12105
|
inlineSel,
|
|
12066
12106
|
mode
|
|
@@ -12070,14 +12110,14 @@ function useElementOperations(input) {
|
|
|
12070
12110
|
}
|
|
12071
12111
|
const updates = {};
|
|
12072
12112
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
12073
|
-
updates.textSegments =
|
|
12113
|
+
updates.textSegments = chunkCHHLFKT6_js.applyCaseTransformToSegments(
|
|
12074
12114
|
selectedElement.textSegments,
|
|
12075
12115
|
null,
|
|
12076
12116
|
mode
|
|
12077
12117
|
);
|
|
12078
12118
|
}
|
|
12079
12119
|
if (typeof selectedElement.text === "string") {
|
|
12080
|
-
updates.text =
|
|
12120
|
+
updates.text = chunkCHHLFKT6_js.transformTextCase(selectedElement.text, mode);
|
|
12081
12121
|
}
|
|
12082
12122
|
updateSelectedElement(updates);
|
|
12083
12123
|
},
|
|
@@ -12132,7 +12172,7 @@ function useSectionOperations(input) {
|
|
|
12132
12172
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
12133
12173
|
const addSection2 = React4.useCallback(
|
|
12134
12174
|
(name, afterSlideIndex) => {
|
|
12135
|
-
const result =
|
|
12175
|
+
const result = chunkCHHLFKT6_js.addSection(sections, slides, name, afterSlideIndex);
|
|
12136
12176
|
setSlides(result.slides);
|
|
12137
12177
|
setSections(result.sections);
|
|
12138
12178
|
markDirty();
|
|
@@ -12141,7 +12181,7 @@ function useSectionOperations(input) {
|
|
|
12141
12181
|
);
|
|
12142
12182
|
const renameSection2 = React4.useCallback(
|
|
12143
12183
|
(sectionId, newName) => {
|
|
12144
|
-
const result =
|
|
12184
|
+
const result = chunkCHHLFKT6_js.renameSection(sections, slides, sectionId, newName);
|
|
12145
12185
|
setSections(result.sections);
|
|
12146
12186
|
setSlides(result.slides);
|
|
12147
12187
|
markDirty();
|
|
@@ -12150,7 +12190,7 @@ function useSectionOperations(input) {
|
|
|
12150
12190
|
);
|
|
12151
12191
|
const deleteSection2 = React4.useCallback(
|
|
12152
12192
|
(sectionId) => {
|
|
12153
|
-
const result =
|
|
12193
|
+
const result = chunkCHHLFKT6_js.deleteSection(sections, slides, sectionId);
|
|
12154
12194
|
setSections(result.sections);
|
|
12155
12195
|
setSlides(result.slides);
|
|
12156
12196
|
markDirty();
|
|
@@ -12159,21 +12199,21 @@ function useSectionOperations(input) {
|
|
|
12159
12199
|
);
|
|
12160
12200
|
const moveSectionUp2 = React4.useCallback(
|
|
12161
12201
|
(sectionId) => {
|
|
12162
|
-
setSections(
|
|
12202
|
+
setSections(chunkCHHLFKT6_js.moveSectionUp(sections, sectionId));
|
|
12163
12203
|
markDirty();
|
|
12164
12204
|
},
|
|
12165
12205
|
[sections, setSections, markDirty]
|
|
12166
12206
|
);
|
|
12167
12207
|
const moveSectionDown2 = React4.useCallback(
|
|
12168
12208
|
(sectionId) => {
|
|
12169
|
-
setSections(
|
|
12209
|
+
setSections(chunkCHHLFKT6_js.moveSectionDown(sections, sectionId));
|
|
12170
12210
|
markDirty();
|
|
12171
12211
|
},
|
|
12172
12212
|
[sections, setSections, markDirty]
|
|
12173
12213
|
);
|
|
12174
12214
|
const moveSlidesToSection2 = React4.useCallback(
|
|
12175
12215
|
(slideIndexes, targetSectionId) => {
|
|
12176
|
-
const result =
|
|
12216
|
+
const result = chunkCHHLFKT6_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
12177
12217
|
setSlides(result.slides);
|
|
12178
12218
|
setSections(result.sections);
|
|
12179
12219
|
markDirty();
|
|
@@ -12192,7 +12232,7 @@ function useSectionOperations(input) {
|
|
|
12192
12232
|
|
|
12193
12233
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
12194
12234
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
12195
|
-
const resized =
|
|
12235
|
+
const resized = chunkCHHLFKT6_js.applyResize(
|
|
12196
12236
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
12197
12237
|
handle,
|
|
12198
12238
|
dx,
|
|
@@ -12204,7 +12244,7 @@ function computeResizeGeometry(handle, startX, startY, startWidth, startHeight,
|
|
|
12204
12244
|
if (!snapToGrid) {
|
|
12205
12245
|
return box;
|
|
12206
12246
|
}
|
|
12207
|
-
return
|
|
12247
|
+
return chunkCHHLFKT6_js.snapBoxToGrid(box, handle, gridSpacingPx, MIN_ELEMENT_SIZE);
|
|
12208
12248
|
}
|
|
12209
12249
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
12210
12250
|
const range = startWidth || 200;
|
|
@@ -12314,7 +12354,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
12314
12354
|
width: el.width,
|
|
12315
12355
|
height: el.height
|
|
12316
12356
|
}));
|
|
12317
|
-
const snapResult =
|
|
12357
|
+
const snapResult = chunkCHHLFKT6_js.computeSnapToShape(
|
|
12318
12358
|
targetX,
|
|
12319
12359
|
targetY,
|
|
12320
12360
|
primaryEl.width,
|
|
@@ -12457,13 +12497,13 @@ function processPointerUp(input) {
|
|
|
12457
12497
|
if (i !== activeSlideIndex) {
|
|
12458
12498
|
return s;
|
|
12459
12499
|
}
|
|
12460
|
-
const rerouted =
|
|
12500
|
+
const rerouted = chunkCHHLFKT6_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
12461
12501
|
if (rerouted.length === 0) {
|
|
12462
12502
|
return s;
|
|
12463
12503
|
}
|
|
12464
12504
|
return {
|
|
12465
12505
|
...s,
|
|
12466
|
-
elements:
|
|
12506
|
+
elements: chunkCHHLFKT6_js.applyReroutedConnectors(s.elements, rerouted)
|
|
12467
12507
|
};
|
|
12468
12508
|
})
|
|
12469
12509
|
);
|
|
@@ -12482,9 +12522,9 @@ function processPointerUp(input) {
|
|
|
12482
12522
|
}
|
|
12483
12523
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
12484
12524
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
12485
|
-
const hitIds =
|
|
12525
|
+
const hitIds = chunkCHHLFKT6_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
12486
12526
|
if (marquee.additive) {
|
|
12487
|
-
const merged =
|
|
12527
|
+
const merged = chunkCHHLFKT6_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
12488
12528
|
if (merged.length > 0) {
|
|
12489
12529
|
applySelection(merged[0], merged);
|
|
12490
12530
|
} else {
|
|
@@ -12507,8 +12547,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
12507
12547
|
}
|
|
12508
12548
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
12509
12549
|
});
|
|
12510
|
-
const rerouted =
|
|
12511
|
-
return
|
|
12550
|
+
const rerouted = chunkCHHLFKT6_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
12551
|
+
return chunkCHHLFKT6_js.applyReroutedConnectors(movedElements, rerouted);
|
|
12512
12552
|
};
|
|
12513
12553
|
if (editTemplateMode) {
|
|
12514
12554
|
const slideId = activeSlide?.id;
|
|
@@ -12659,9 +12699,9 @@ function useCanvasInteractions(input) {
|
|
|
12659
12699
|
return;
|
|
12660
12700
|
}
|
|
12661
12701
|
const el = elementLookup.get(editId);
|
|
12662
|
-
if (el &&
|
|
12702
|
+
if (el && chunkODMFBYAP_js.hasTextProperties(el)) {
|
|
12663
12703
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
12664
|
-
const newSegments =
|
|
12704
|
+
const newSegments = chunkCHHLFKT6_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
12665
12705
|
ops.updateElementById(editId, {
|
|
12666
12706
|
text: committedText,
|
|
12667
12707
|
textSegments: newSegments
|
|
@@ -12672,7 +12712,7 @@ function useCanvasInteractions(input) {
|
|
|
12672
12712
|
setInlineEditingText("");
|
|
12673
12713
|
};
|
|
12674
12714
|
const openEquationEditorForElement = (el) => {
|
|
12675
|
-
if (!
|
|
12715
|
+
if (!chunkODMFBYAP_js.hasTextProperties(el)) {
|
|
12676
12716
|
return false;
|
|
12677
12717
|
}
|
|
12678
12718
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -12701,7 +12741,7 @@ function useCanvasInteractions(input) {
|
|
|
12701
12741
|
justSelectedRef.current = false;
|
|
12702
12742
|
} else {
|
|
12703
12743
|
const el = elementLookup.get(elementId);
|
|
12704
|
-
if (el &&
|
|
12744
|
+
if (el && chunkODMFBYAP_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
12705
12745
|
if (!openEquationEditorForElement(el)) {
|
|
12706
12746
|
setInlineEditingElementId(elementId);
|
|
12707
12747
|
setInlineEditingText(el.text ?? "");
|
|
@@ -12720,7 +12760,7 @@ function useCanvasInteractions(input) {
|
|
|
12720
12760
|
if (openEquationEditorForElement(el)) {
|
|
12721
12761
|
return;
|
|
12722
12762
|
}
|
|
12723
|
-
if (
|
|
12763
|
+
if (chunkODMFBYAP_js.hasTextProperties(el)) {
|
|
12724
12764
|
setInlineEditingElementId(elementId);
|
|
12725
12765
|
setInlineEditingText(el.text ?? "");
|
|
12726
12766
|
}
|
|
@@ -12910,7 +12950,7 @@ function createFileHandlers(deps) {
|
|
|
12910
12950
|
h = Math.round(h * scale);
|
|
12911
12951
|
}
|
|
12912
12952
|
addElement({
|
|
12913
|
-
id:
|
|
12953
|
+
id: chunkCHHLFKT6_js.generateElementId(),
|
|
12914
12954
|
type: "image",
|
|
12915
12955
|
x: Math.round((canvasSize.width - w) / 2),
|
|
12916
12956
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -12921,7 +12961,7 @@ function createFileHandlers(deps) {
|
|
|
12921
12961
|
};
|
|
12922
12962
|
img.onerror = () => {
|
|
12923
12963
|
addElement({
|
|
12924
|
-
id:
|
|
12964
|
+
id: chunkCHHLFKT6_js.generateElementId(),
|
|
12925
12965
|
type: "image",
|
|
12926
12966
|
x: 100,
|
|
12927
12967
|
y: 100,
|
|
@@ -12947,7 +12987,7 @@ function createFileHandlers(deps) {
|
|
|
12947
12987
|
const elFilePath = file.path;
|
|
12948
12988
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
12949
12989
|
addElement({
|
|
12950
|
-
id:
|
|
12990
|
+
id: chunkCHHLFKT6_js.generateElementId(),
|
|
12951
12991
|
type: "media",
|
|
12952
12992
|
mediaType,
|
|
12953
12993
|
mediaMimeType: file.type || void 0,
|
|
@@ -13122,13 +13162,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
13122
13162
|
return;
|
|
13123
13163
|
}
|
|
13124
13164
|
addElement({
|
|
13125
|
-
id:
|
|
13165
|
+
id: chunkCHHLFKT6_js.generateElementId(),
|
|
13126
13166
|
type: "smartArt",
|
|
13127
13167
|
x: 100,
|
|
13128
13168
|
y: 120,
|
|
13129
13169
|
width: 600,
|
|
13130
13170
|
height: 340,
|
|
13131
|
-
smartArtData:
|
|
13171
|
+
smartArtData: chunkCHHLFKT6_js.buildSmartArtPresetData(
|
|
13132
13172
|
layout,
|
|
13133
13173
|
defaultItems,
|
|
13134
13174
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -13140,7 +13180,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
13140
13180
|
return;
|
|
13141
13181
|
}
|
|
13142
13182
|
addElement({
|
|
13143
|
-
id:
|
|
13183
|
+
id: chunkCHHLFKT6_js.generateElementId(),
|
|
13144
13184
|
type: "shape",
|
|
13145
13185
|
x: 120,
|
|
13146
13186
|
y: 200,
|
|
@@ -13199,7 +13239,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
13199
13239
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
13200
13240
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
13201
13241
|
addElement({
|
|
13202
|
-
id:
|
|
13242
|
+
id: chunkCHHLFKT6_js.generateElementId(),
|
|
13203
13243
|
type: "shape",
|
|
13204
13244
|
x: 120,
|
|
13205
13245
|
y: 200,
|
|
@@ -13221,11 +13261,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
13221
13261
|
if (!activeSlide) {
|
|
13222
13262
|
return;
|
|
13223
13263
|
}
|
|
13224
|
-
const preset =
|
|
13264
|
+
const preset = chunkCHHLFKT6_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
13225
13265
|
if (!preset) {
|
|
13226
13266
|
return;
|
|
13227
13267
|
}
|
|
13228
|
-
const defaultPptxAction =
|
|
13268
|
+
const defaultPptxAction = chunkODMFBYAP_js.elementActionToPptxAction({
|
|
13229
13269
|
trigger: "click",
|
|
13230
13270
|
type: preset.defaultAction
|
|
13231
13271
|
});
|
|
@@ -13234,7 +13274,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
13234
13274
|
defaultPptxAction.highlightClick = true;
|
|
13235
13275
|
}
|
|
13236
13276
|
addElement({
|
|
13237
|
-
id:
|
|
13277
|
+
id: chunkCHHLFKT6_js.generateElementId(),
|
|
13238
13278
|
type: "shape",
|
|
13239
13279
|
x: 150,
|
|
13240
13280
|
y: 150,
|
|
@@ -13301,7 +13341,7 @@ function useInsertElements(input) {
|
|
|
13301
13341
|
return;
|
|
13302
13342
|
}
|
|
13303
13343
|
addElement({
|
|
13304
|
-
id:
|
|
13344
|
+
id: chunkCHHLFKT6_js.generateElementId(),
|
|
13305
13345
|
type: "text",
|
|
13306
13346
|
x: 100,
|
|
13307
13347
|
y: 100,
|
|
@@ -13316,7 +13356,7 @@ function useInsertElements(input) {
|
|
|
13316
13356
|
return;
|
|
13317
13357
|
}
|
|
13318
13358
|
addElement({
|
|
13319
|
-
id:
|
|
13359
|
+
id: chunkCHHLFKT6_js.generateElementId(),
|
|
13320
13360
|
type: "shape",
|
|
13321
13361
|
x: 150,
|
|
13322
13362
|
y: 150,
|
|
@@ -13335,15 +13375,15 @@ function useInsertElements(input) {
|
|
|
13335
13375
|
return;
|
|
13336
13376
|
}
|
|
13337
13377
|
addElement({
|
|
13338
|
-
...
|
|
13339
|
-
id:
|
|
13378
|
+
...chunkCHHLFKT6_js.newTableElement(DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
13379
|
+
id: chunkCHHLFKT6_js.generateElementId()
|
|
13340
13380
|
});
|
|
13341
13381
|
};
|
|
13342
13382
|
const handleAddChart = (chartType) => {
|
|
13343
13383
|
if (!activeSlide) {
|
|
13344
13384
|
return;
|
|
13345
13385
|
}
|
|
13346
|
-
addElement(
|
|
13386
|
+
addElement(chunkCHHLFKT6_js.createDefaultChartElement(chartType));
|
|
13347
13387
|
};
|
|
13348
13388
|
const structured = createStructuredElementHandlers({
|
|
13349
13389
|
activeSlide,
|
|
@@ -13413,7 +13453,7 @@ function useClipboardHandlers(input) {
|
|
|
13413
13453
|
if (!selectedElement) {
|
|
13414
13454
|
return;
|
|
13415
13455
|
}
|
|
13416
|
-
setClipboardPayload(
|
|
13456
|
+
setClipboardPayload(chunkCHHLFKT6_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
13417
13457
|
};
|
|
13418
13458
|
const handleDelete = () => {
|
|
13419
13459
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -13430,7 +13470,7 @@ function useClipboardHandlers(input) {
|
|
|
13430
13470
|
handleDelete();
|
|
13431
13471
|
};
|
|
13432
13472
|
const insertClone = (source) => {
|
|
13433
|
-
const clone =
|
|
13473
|
+
const clone = chunkCHHLFKT6_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
13434
13474
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
13435
13475
|
ops.applySelection(clone.id);
|
|
13436
13476
|
history.markDirty();
|
|
@@ -13465,7 +13505,7 @@ function resolveShapePath(el) {
|
|
|
13465
13505
|
return el.pathData;
|
|
13466
13506
|
}
|
|
13467
13507
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
13468
|
-
const clipPath =
|
|
13508
|
+
const clipPath = chunkODMFBYAP_js.getPresetShapeClipPath(el.shapeType);
|
|
13469
13509
|
if (clipPath) {
|
|
13470
13510
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
13471
13511
|
if (svgPath) {
|
|
@@ -13516,7 +13556,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
13516
13556
|
return parts.join(" ");
|
|
13517
13557
|
}
|
|
13518
13558
|
function transformPathToGlobal(pathData, el) {
|
|
13519
|
-
const polys =
|
|
13559
|
+
const polys = chunkODMFBYAP_js.svgPathToPolygons(pathData);
|
|
13520
13560
|
if (polys.length === 0) {
|
|
13521
13561
|
return pathData;
|
|
13522
13562
|
}
|
|
@@ -13536,10 +13576,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
13536
13576
|
y: pt.y * scaleY + el.y
|
|
13537
13577
|
}))
|
|
13538
13578
|
);
|
|
13539
|
-
return
|
|
13579
|
+
return chunkODMFBYAP_js.polygonsToSvgPath(transformed);
|
|
13540
13580
|
}
|
|
13541
13581
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
13542
|
-
const polys =
|
|
13582
|
+
const polys = chunkODMFBYAP_js.svgPathToPolygons(pathData);
|
|
13543
13583
|
if (polys.length === 0) {
|
|
13544
13584
|
return pathData;
|
|
13545
13585
|
}
|
|
@@ -13549,10 +13589,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
13549
13589
|
y: pt.y - y
|
|
13550
13590
|
}))
|
|
13551
13591
|
);
|
|
13552
|
-
return
|
|
13592
|
+
return chunkODMFBYAP_js.polygonsToSvgPath(transformed);
|
|
13553
13593
|
}
|
|
13554
13594
|
function pathBounds(pathData) {
|
|
13555
|
-
const polys =
|
|
13595
|
+
const polys = chunkODMFBYAP_js.svgPathToPolygons(pathData);
|
|
13556
13596
|
let minX = Infinity;
|
|
13557
13597
|
let minY = Infinity;
|
|
13558
13598
|
let maxX = -Infinity;
|
|
@@ -13611,7 +13651,7 @@ function useMergeShapesHandler(input) {
|
|
|
13611
13651
|
let allFragments = [];
|
|
13612
13652
|
let remaining = globalPaths[0];
|
|
13613
13653
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
13614
|
-
const frags =
|
|
13654
|
+
const frags = chunkODMFBYAP_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
13615
13655
|
if (Array.isArray(frags)) {
|
|
13616
13656
|
allFragments = frags;
|
|
13617
13657
|
}
|
|
@@ -13640,7 +13680,7 @@ function useMergeShapesHandler(input) {
|
|
|
13640
13680
|
bounds.height
|
|
13641
13681
|
);
|
|
13642
13682
|
const newEl = {
|
|
13643
|
-
id:
|
|
13683
|
+
id: chunkCHHLFKT6_js.generateElementId(),
|
|
13644
13684
|
type: "shape",
|
|
13645
13685
|
x: bounds.x,
|
|
13646
13686
|
y: bounds.y,
|
|
@@ -13678,7 +13718,7 @@ function useMergeShapesHandler(input) {
|
|
|
13678
13718
|
} else {
|
|
13679
13719
|
let resultPath = globalPaths[0];
|
|
13680
13720
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
13681
|
-
const result =
|
|
13721
|
+
const result = chunkODMFBYAP_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
13682
13722
|
if (typeof result === "string") {
|
|
13683
13723
|
resultPath = result;
|
|
13684
13724
|
}
|
|
@@ -13699,7 +13739,7 @@ function useMergeShapesHandler(input) {
|
|
|
13699
13739
|
);
|
|
13700
13740
|
const primary = targets[0];
|
|
13701
13741
|
const newEl = {
|
|
13702
|
-
id:
|
|
13742
|
+
id: chunkCHHLFKT6_js.generateElementId(),
|
|
13703
13743
|
type: "shape",
|
|
13704
13744
|
x: bounds.x,
|
|
13705
13745
|
y: bounds.y,
|
|
@@ -13762,7 +13802,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13762
13802
|
if (ids.length < 2 || !activeSlide) {
|
|
13763
13803
|
return;
|
|
13764
13804
|
}
|
|
13765
|
-
const { elements, groupId } =
|
|
13805
|
+
const { elements, groupId } = chunkCHHLFKT6_js.groupElements(ops.activeElements, ids, chunkCHHLFKT6_js.generateElementId());
|
|
13766
13806
|
if (groupId === null) {
|
|
13767
13807
|
return;
|
|
13768
13808
|
}
|
|
@@ -13775,12 +13815,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13775
13815
|
return;
|
|
13776
13816
|
}
|
|
13777
13817
|
const group = selectedElement;
|
|
13778
|
-
const intoTemplate =
|
|
13818
|
+
const intoTemplate = chunkCHHLFKT6_js.isTemplateElementId(group.id);
|
|
13779
13819
|
const ungrouped = group.children.map((child) => ({
|
|
13780
13820
|
...structuredClone(child),
|
|
13781
13821
|
// Keep child ids in the same store as the group so later edits route
|
|
13782
13822
|
// correctly: template groups yield template-prefixed child ids.
|
|
13783
|
-
id: intoTemplate ?
|
|
13823
|
+
id: intoTemplate ? chunkCHHLFKT6_js.makeCloneId(true, child.id || group.id) : child.id || chunkCHHLFKT6_js.generateElementId(),
|
|
13784
13824
|
x: child.x + group.x,
|
|
13785
13825
|
y: child.y + group.y
|
|
13786
13826
|
}));
|
|
@@ -13804,7 +13844,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13804
13844
|
if (!edge) {
|
|
13805
13845
|
return;
|
|
13806
13846
|
}
|
|
13807
|
-
const positions =
|
|
13847
|
+
const positions = chunkCHHLFKT6_js.alignElements(selectedElements, edge);
|
|
13808
13848
|
for (const [id, pos] of positions) {
|
|
13809
13849
|
const el = elementLookup.get(id);
|
|
13810
13850
|
if (!el) {
|
|
@@ -13822,7 +13862,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13822
13862
|
if (!distAxis) {
|
|
13823
13863
|
return;
|
|
13824
13864
|
}
|
|
13825
|
-
const positions =
|
|
13865
|
+
const positions = chunkCHHLFKT6_js.distributeElements(selectedElements, distAxis);
|
|
13826
13866
|
for (const [id, pos] of positions) {
|
|
13827
13867
|
const el = elementLookup.get(id);
|
|
13828
13868
|
if (!el) {
|
|
@@ -13839,7 +13879,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13839
13879
|
}
|
|
13840
13880
|
const id = selectedElement.id;
|
|
13841
13881
|
ops.updateActiveElements(
|
|
13842
|
-
(els) => direction === "forward" ?
|
|
13882
|
+
(els) => direction === "forward" ? chunkCHHLFKT6_js.bringForward(els, id) : direction === "backward" ? chunkCHHLFKT6_js.sendBackward(els, id) : els
|
|
13843
13883
|
);
|
|
13844
13884
|
history.markDirty();
|
|
13845
13885
|
};
|
|
@@ -13849,7 +13889,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13849
13889
|
}
|
|
13850
13890
|
const id = selectedElement.id;
|
|
13851
13891
|
ops.updateActiveElements(
|
|
13852
|
-
(els) => direction === "front" ?
|
|
13892
|
+
(els) => direction === "front" ? chunkCHHLFKT6_js.bringToFront(els, id) : chunkCHHLFKT6_js.sendToBack(els, id)
|
|
13853
13893
|
);
|
|
13854
13894
|
history.markDirty();
|
|
13855
13895
|
};
|
|
@@ -13971,7 +14011,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
13971
14011
|
function useSlideManagement(input) {
|
|
13972
14012
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
13973
14013
|
const handleAddSlide = () => {
|
|
13974
|
-
const newSlide =
|
|
14014
|
+
const newSlide = chunkCHHLFKT6_js.createBlankSlide(slides.length + 1);
|
|
13975
14015
|
ops.updateSlides((prev) => {
|
|
13976
14016
|
const next = [...prev];
|
|
13977
14017
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -14034,7 +14074,7 @@ function useSlideManagement(input) {
|
|
|
14034
14074
|
}
|
|
14035
14075
|
const clone = {
|
|
14036
14076
|
...src,
|
|
14037
|
-
id:
|
|
14077
|
+
id: chunkCHHLFKT6_js.makeSlideId(),
|
|
14038
14078
|
elements: src.elements.map((el) => ({
|
|
14039
14079
|
...el,
|
|
14040
14080
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -14066,7 +14106,7 @@ function useSlideManagement(input) {
|
|
|
14066
14106
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
14067
14107
|
const insertAt = activeSlideIndex + 1;
|
|
14068
14108
|
const draft = {
|
|
14069
|
-
...
|
|
14109
|
+
...chunkCHHLFKT6_js.createBlankSlide(slides.length + 1),
|
|
14070
14110
|
layoutPath,
|
|
14071
14111
|
...layoutName ? { layoutName } : {}
|
|
14072
14112
|
};
|
|
@@ -14127,7 +14167,7 @@ function createTableMergeHandlers(input) {
|
|
|
14127
14167
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
14128
14168
|
return;
|
|
14129
14169
|
}
|
|
14130
|
-
const newTableData =
|
|
14170
|
+
const newTableData = chunkCHHLFKT6_js.mergeCells(
|
|
14131
14171
|
[
|
|
14132
14172
|
{ row: rowIndex, col: columnIndex },
|
|
14133
14173
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -14135,7 +14175,7 @@ function createTableMergeHandlers(input) {
|
|
|
14135
14175
|
td
|
|
14136
14176
|
);
|
|
14137
14177
|
const updates = { tableData: newTableData };
|
|
14138
|
-
const newRawXml =
|
|
14178
|
+
const newRawXml = chunkODMFBYAP_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
14139
14179
|
if (newRawXml) {
|
|
14140
14180
|
updates.rawXml = newRawXml;
|
|
14141
14181
|
}
|
|
@@ -14161,7 +14201,7 @@ function createTableMergeHandlers(input) {
|
|
|
14161
14201
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
14162
14202
|
return;
|
|
14163
14203
|
}
|
|
14164
|
-
const newTableData =
|
|
14204
|
+
const newTableData = chunkCHHLFKT6_js.mergeCells(
|
|
14165
14205
|
[
|
|
14166
14206
|
{ row: rowIndex, col: columnIndex },
|
|
14167
14207
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -14169,7 +14209,7 @@ function createTableMergeHandlers(input) {
|
|
|
14169
14209
|
td
|
|
14170
14210
|
);
|
|
14171
14211
|
const updates = { tableData: newTableData };
|
|
14172
|
-
const newRawXml =
|
|
14212
|
+
const newRawXml = chunkODMFBYAP_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
14173
14213
|
if (newRawXml) {
|
|
14174
14214
|
updates.rawXml = newRawXml;
|
|
14175
14215
|
}
|
|
@@ -14184,9 +14224,9 @@ function createTableMergeHandlers(input) {
|
|
|
14184
14224
|
return;
|
|
14185
14225
|
}
|
|
14186
14226
|
const td = selectedElement.tableData;
|
|
14187
|
-
const newTableData =
|
|
14227
|
+
const newTableData = chunkCHHLFKT6_js.mergeCells(ts.selectedCells, td);
|
|
14188
14228
|
const updates = { tableData: newTableData };
|
|
14189
|
-
const newRawXml =
|
|
14229
|
+
const newRawXml = chunkODMFBYAP_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
14190
14230
|
if (newRawXml) {
|
|
14191
14231
|
updates.rawXml = newRawXml;
|
|
14192
14232
|
}
|
|
@@ -14203,9 +14243,9 @@ function createTableMergeHandlers(input) {
|
|
|
14203
14243
|
}
|
|
14204
14244
|
const { rowIndex, columnIndex } = ts;
|
|
14205
14245
|
const td = selectedElement.tableData;
|
|
14206
|
-
const newTableData =
|
|
14246
|
+
const newTableData = chunkCHHLFKT6_js.splitCell(rowIndex, columnIndex, td);
|
|
14207
14247
|
const updates = { tableData: newTableData };
|
|
14208
|
-
const newRawXml =
|
|
14248
|
+
const newRawXml = chunkODMFBYAP_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
14209
14249
|
if (newRawXml) {
|
|
14210
14250
|
updates.rawXml = newRawXml;
|
|
14211
14251
|
}
|
|
@@ -14249,7 +14289,7 @@ function createTableStructHandlers(input) {
|
|
|
14249
14289
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
14250
14290
|
}
|
|
14251
14291
|
if (el.rawXml) {
|
|
14252
|
-
const newRawXml =
|
|
14292
|
+
const newRawXml = chunkODMFBYAP_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
14253
14293
|
if (newRawXml) {
|
|
14254
14294
|
updates.rawXml = newRawXml;
|
|
14255
14295
|
}
|
|
@@ -14273,7 +14313,7 @@ function createTableStructHandlers(input) {
|
|
|
14273
14313
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
14274
14314
|
const updates = {};
|
|
14275
14315
|
if (selectedElement.rawXml) {
|
|
14276
|
-
const newRawXml =
|
|
14316
|
+
const newRawXml = chunkODMFBYAP_js.updateCellTextStyleInRawXml(
|
|
14277
14317
|
selectedElement,
|
|
14278
14318
|
rowIndex,
|
|
14279
14319
|
colIndex,
|
|
@@ -14337,9 +14377,9 @@ function createTableStructHandlers(input) {
|
|
|
14337
14377
|
return;
|
|
14338
14378
|
}
|
|
14339
14379
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
14340
|
-
const newTableData =
|
|
14380
|
+
const newTableData = chunkCHHLFKT6_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
14341
14381
|
const updates = { tableData: newTableData };
|
|
14342
|
-
const newRawXml =
|
|
14382
|
+
const newRawXml = chunkODMFBYAP_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
14343
14383
|
if (newRawXml) {
|
|
14344
14384
|
updates.rawXml = newRawXml;
|
|
14345
14385
|
}
|
|
@@ -14352,12 +14392,12 @@ function createTableStructHandlers(input) {
|
|
|
14352
14392
|
}
|
|
14353
14393
|
const td = selectedElement.tableData;
|
|
14354
14394
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
14355
|
-
const newTableData =
|
|
14395
|
+
const newTableData = chunkCHHLFKT6_js.deleteTableRow(td, rowIdx);
|
|
14356
14396
|
if (newTableData === td) {
|
|
14357
14397
|
return;
|
|
14358
14398
|
}
|
|
14359
14399
|
const updates = { tableData: newTableData };
|
|
14360
|
-
const newRawXml =
|
|
14400
|
+
const newRawXml = chunkODMFBYAP_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
14361
14401
|
if (newRawXml) {
|
|
14362
14402
|
updates.rawXml = newRawXml;
|
|
14363
14403
|
}
|
|
@@ -14369,9 +14409,9 @@ function createTableStructHandlers(input) {
|
|
|
14369
14409
|
return;
|
|
14370
14410
|
}
|
|
14371
14411
|
const colIdx = ts?.columnIndex ?? 0;
|
|
14372
|
-
const newTableData =
|
|
14412
|
+
const newTableData = chunkCHHLFKT6_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
14373
14413
|
const updates = { tableData: newTableData };
|
|
14374
|
-
const newRawXml =
|
|
14414
|
+
const newRawXml = chunkODMFBYAP_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
14375
14415
|
if (newRawXml) {
|
|
14376
14416
|
updates.rawXml = newRawXml;
|
|
14377
14417
|
}
|
|
@@ -14384,12 +14424,12 @@ function createTableStructHandlers(input) {
|
|
|
14384
14424
|
}
|
|
14385
14425
|
const td = selectedElement.tableData;
|
|
14386
14426
|
const colIdx = ts?.columnIndex ?? 0;
|
|
14387
|
-
const newTableData =
|
|
14427
|
+
const newTableData = chunkCHHLFKT6_js.deleteTableColumn(td, colIdx);
|
|
14388
14428
|
if (newTableData === td) {
|
|
14389
14429
|
return;
|
|
14390
14430
|
}
|
|
14391
14431
|
const updates = { tableData: newTableData };
|
|
14392
|
-
const newRawXml =
|
|
14432
|
+
const newRawXml = chunkODMFBYAP_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
14393
14433
|
if (newRawXml) {
|
|
14394
14434
|
updates.rawXml = newRawXml;
|
|
14395
14435
|
}
|
|
@@ -14425,8 +14465,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
14425
14465
|
return html2canvasPro(element, {
|
|
14426
14466
|
...options,
|
|
14427
14467
|
onclone: async (doc, clonedEl) => {
|
|
14428
|
-
await
|
|
14429
|
-
|
|
14468
|
+
await chunkCHHLFKT6_js.normalizeColorsForCapture(doc, clonedEl);
|
|
14469
|
+
chunkCHHLFKT6_js.preprocessCssForCapture(clonedEl);
|
|
14430
14470
|
if (typeof userOnClone === "function") {
|
|
14431
14471
|
userOnClone(doc, clonedEl);
|
|
14432
14472
|
}
|
|
@@ -14482,7 +14522,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
14482
14522
|
}
|
|
14483
14523
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
14484
14524
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
14485
|
-
|
|
14525
|
+
chunkCHHLFKT6_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
14486
14526
|
}
|
|
14487
14527
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
14488
14528
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -14504,7 +14544,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
14504
14544
|
continue;
|
|
14505
14545
|
}
|
|
14506
14546
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
14507
|
-
images.push(
|
|
14547
|
+
images.push(chunkCHHLFKT6_js.canvasToJpegData(canvas));
|
|
14508
14548
|
}
|
|
14509
14549
|
onProgress?.(totalSlides, totalSlides);
|
|
14510
14550
|
setActiveSlide(currentSlideIndex);
|
|
@@ -14512,7 +14552,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
14512
14552
|
throw new Error(chunkCUUYYYC5_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
14513
14553
|
}
|
|
14514
14554
|
const pdfBlobUrl = buildPdfFromImageData(images);
|
|
14515
|
-
|
|
14555
|
+
chunkCHHLFKT6_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
14516
14556
|
}
|
|
14517
14557
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
14518
14558
|
const { scale = 2, onProgress } = options;
|
|
@@ -14561,7 +14601,7 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
14561
14601
|
throw new Error(chunkCUUYYYC5_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
14562
14602
|
}
|
|
14563
14603
|
const pdfDataUrl = buildNotesPdf(pages);
|
|
14564
|
-
|
|
14604
|
+
chunkCHHLFKT6_js.downloadDataUrl(pdfDataUrl, filename);
|
|
14565
14605
|
}
|
|
14566
14606
|
|
|
14567
14607
|
// src/viewer/utils/export-video.ts
|
|
@@ -14605,7 +14645,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
14605
14645
|
const fps = 30;
|
|
14606
14646
|
const stream = recordingCanvas.captureStream(fps);
|
|
14607
14647
|
const recorder = new MediaRecorder(stream, {
|
|
14608
|
-
mimeType:
|
|
14648
|
+
mimeType: chunkCHHLFKT6_js.pickSupportedMimeType([...chunkCHHLFKT6_js.WEBM_MIME_CANDIDATES]),
|
|
14609
14649
|
videoBitsPerSecond: 5e6
|
|
14610
14650
|
});
|
|
14611
14651
|
const chunks = [];
|
|
@@ -14628,8 +14668,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
14628
14668
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
14629
14669
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
14630
14670
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
14631
|
-
const frameInterval =
|
|
14632
|
-
const framesNeeded =
|
|
14671
|
+
const frameInterval = chunkCHHLFKT6_js.fpsToFrameIntervalMs(fps);
|
|
14672
|
+
const framesNeeded = chunkCHHLFKT6_js.segmentFrameCount(duration, fps);
|
|
14633
14673
|
for (let f = 0; f < framesNeeded; f++) {
|
|
14634
14674
|
if (signal?.aborted) {
|
|
14635
14675
|
recorder.stop();
|
|
@@ -14678,7 +14718,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
14678
14718
|
if (frames.length === 0) {
|
|
14679
14719
|
throw new Error(chunkCUUYYYC5_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
14680
14720
|
}
|
|
14681
|
-
const gifBytes =
|
|
14721
|
+
const gifBytes = chunkCHHLFKT6_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
14682
14722
|
onProgress?.(totalSlides, totalSlides);
|
|
14683
14723
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
14684
14724
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -14732,7 +14772,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
14732
14772
|
continue;
|
|
14733
14773
|
}
|
|
14734
14774
|
onProgress?.(processedCount, data.slides.length);
|
|
14735
|
-
let svg =
|
|
14775
|
+
let svg = chunkODMFBYAP_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
14736
14776
|
if (embedFonts && fontFaces?.length) {
|
|
14737
14777
|
svg = injectFontFaces(svg, fontFaces);
|
|
14738
14778
|
}
|
|
@@ -14792,7 +14832,7 @@ function useExportSaveAs(input) {
|
|
|
14792
14832
|
}
|
|
14793
14833
|
setExportProgress(70);
|
|
14794
14834
|
setExportStatusMessage("Writing README...");
|
|
14795
|
-
const readme =
|
|
14835
|
+
const readme = chunkCHHLFKT6_js.generatePackageReadme(pptxFilename);
|
|
14796
14836
|
pkgFolder.file("README.txt", readme);
|
|
14797
14837
|
if (abortCtrl.signal.aborted) {
|
|
14798
14838
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -14803,7 +14843,7 @@ function useExportSaveAs(input) {
|
|
|
14803
14843
|
setExportProgress(95);
|
|
14804
14844
|
setExportStatusMessage("Downloading...");
|
|
14805
14845
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
14806
|
-
|
|
14846
|
+
chunkCHHLFKT6_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
14807
14847
|
setExportProgress(100);
|
|
14808
14848
|
} catch (err) {
|
|
14809
14849
|
if (err.name !== "AbortError") {
|
|
@@ -14826,7 +14866,7 @@ function useExportSaveAs(input) {
|
|
|
14826
14866
|
const blob = new Blob([data], {
|
|
14827
14867
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
14828
14868
|
});
|
|
14829
|
-
|
|
14869
|
+
chunkCHHLFKT6_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
14830
14870
|
} catch (err) {
|
|
14831
14871
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
14832
14872
|
}
|
|
@@ -14839,7 +14879,7 @@ function useExportSaveAs(input) {
|
|
|
14839
14879
|
const pptxGuides = guides.map((g) => ({
|
|
14840
14880
|
id: g.id,
|
|
14841
14881
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
14842
|
-
positionEmu:
|
|
14882
|
+
positionEmu: chunkODMFBYAP_js.guidePxToEmu(g.position)
|
|
14843
14883
|
}));
|
|
14844
14884
|
return {
|
|
14845
14885
|
...slide,
|
|
@@ -14903,7 +14943,7 @@ function safeConfirm(message) {
|
|
|
14903
14943
|
}
|
|
14904
14944
|
}
|
|
14905
14945
|
function downloadBlob2(blob, filename) {
|
|
14906
|
-
|
|
14946
|
+
chunkCHHLFKT6_js.downloadBlob(blob, chunkCHHLFKT6_js.sanitizeDownloadFilename(filename));
|
|
14907
14947
|
}
|
|
14908
14948
|
|
|
14909
14949
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -15004,21 +15044,21 @@ function useExportHandlers(input) {
|
|
|
15004
15044
|
{
|
|
15005
15045
|
scale: 2,
|
|
15006
15046
|
onProgress: (current, total) => {
|
|
15007
|
-
setExportProgress(
|
|
15008
|
-
setExportStatusMessage(
|
|
15047
|
+
setExportProgress(chunkCHHLFKT6_js.slideProgressPercent(current, total));
|
|
15048
|
+
setExportStatusMessage(chunkCHHLFKT6_js.slideStatusLabel("Rendering", current, total));
|
|
15009
15049
|
},
|
|
15010
15050
|
signal: abortCtrl.signal
|
|
15011
15051
|
}
|
|
15012
15052
|
);
|
|
15013
|
-
setExportProgress(
|
|
15053
|
+
setExportProgress(chunkCHHLFKT6_js.EXPORT_ASSEMBLING_PERCENT);
|
|
15014
15054
|
setExportStatusMessage("Building PDF...");
|
|
15015
15055
|
await new Promise((r) => {
|
|
15016
15056
|
setTimeout(r, 100);
|
|
15017
15057
|
});
|
|
15018
|
-
setExportProgress(
|
|
15058
|
+
setExportProgress(chunkCHHLFKT6_js.EXPORT_DONE_PERCENT);
|
|
15019
15059
|
setExportStatusMessage("Done!");
|
|
15020
15060
|
} catch (err) {
|
|
15021
|
-
if (!
|
|
15061
|
+
if (!chunkCHHLFKT6_js.isExportAbortError(err)) {
|
|
15022
15062
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
15023
15063
|
}
|
|
15024
15064
|
} finally {
|
|
@@ -15048,21 +15088,21 @@ function useExportHandlers(input) {
|
|
|
15048
15088
|
{
|
|
15049
15089
|
scale: 2,
|
|
15050
15090
|
onProgress: (current, total) => {
|
|
15051
|
-
setExportProgress(
|
|
15052
|
-
setExportStatusMessage(
|
|
15091
|
+
setExportProgress(chunkCHHLFKT6_js.slideProgressPercent(current, total));
|
|
15092
|
+
setExportStatusMessage(chunkCHHLFKT6_js.slideStatusLabel("Rendering", current, total));
|
|
15053
15093
|
},
|
|
15054
15094
|
signal: abortCtrl.signal
|
|
15055
15095
|
}
|
|
15056
15096
|
);
|
|
15057
|
-
setExportProgress(
|
|
15097
|
+
setExportProgress(chunkCHHLFKT6_js.EXPORT_ASSEMBLING_PERCENT);
|
|
15058
15098
|
setExportStatusMessage("Building PDF...");
|
|
15059
15099
|
await new Promise((r) => {
|
|
15060
15100
|
setTimeout(r, 100);
|
|
15061
15101
|
});
|
|
15062
|
-
setExportProgress(
|
|
15102
|
+
setExportProgress(chunkCHHLFKT6_js.EXPORT_DONE_PERCENT);
|
|
15063
15103
|
setExportStatusMessage("Done!");
|
|
15064
15104
|
} catch (err) {
|
|
15065
|
-
if (!
|
|
15105
|
+
if (!chunkCHHLFKT6_js.isExportAbortError(err)) {
|
|
15066
15106
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
15067
15107
|
}
|
|
15068
15108
|
} finally {
|
|
@@ -15103,22 +15143,22 @@ function useExportHandlers(input) {
|
|
|
15103
15143
|
scale: 1,
|
|
15104
15144
|
slideDurationMs: 3e3,
|
|
15105
15145
|
onProgress: (current, total) => {
|
|
15106
|
-
setExportProgress(
|
|
15107
|
-
setExportStatusMessage(
|
|
15146
|
+
setExportProgress(chunkCHHLFKT6_js.slideProgressPercent(current, total, 45));
|
|
15147
|
+
setExportStatusMessage(chunkCHHLFKT6_js.slideStatusLabel("Capturing", current, total));
|
|
15108
15148
|
},
|
|
15109
15149
|
onRecordProgress: (current, total) => {
|
|
15110
|
-
setExportProgress(
|
|
15111
|
-
setExportStatusMessage(
|
|
15150
|
+
setExportProgress(chunkCHHLFKT6_js.recordProgressPercent(current, total));
|
|
15151
|
+
setExportStatusMessage(chunkCHHLFKT6_js.slideStatusLabel("Recording", current, total));
|
|
15112
15152
|
},
|
|
15113
15153
|
signal: abortCtrl.signal
|
|
15114
15154
|
}
|
|
15115
15155
|
);
|
|
15116
|
-
setExportProgress(
|
|
15156
|
+
setExportProgress(chunkCHHLFKT6_js.EXPORT_ASSEMBLING_PERCENT);
|
|
15117
15157
|
setExportStatusMessage("Saving file...");
|
|
15118
15158
|
downloadBlob2(blob, "presentation.webm");
|
|
15119
|
-
setExportProgress(
|
|
15159
|
+
setExportProgress(chunkCHHLFKT6_js.EXPORT_DONE_PERCENT);
|
|
15120
15160
|
} catch (err) {
|
|
15121
|
-
if (!
|
|
15161
|
+
if (!chunkCHHLFKT6_js.isExportAbortError(err)) {
|
|
15122
15162
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
15123
15163
|
}
|
|
15124
15164
|
} finally {
|
|
@@ -15146,18 +15186,18 @@ function useExportHandlers(input) {
|
|
|
15146
15186
|
scale: 0.5,
|
|
15147
15187
|
slideDurationMs: 2e3,
|
|
15148
15188
|
onProgress: (current, total) => {
|
|
15149
|
-
setExportProgress(
|
|
15150
|
-
setExportStatusMessage(
|
|
15189
|
+
setExportProgress(chunkCHHLFKT6_js.slideProgressPercent(current, total));
|
|
15190
|
+
setExportStatusMessage(chunkCHHLFKT6_js.slideStatusLabel("Encoding", current, total));
|
|
15151
15191
|
},
|
|
15152
15192
|
signal: abortCtrl.signal
|
|
15153
15193
|
}
|
|
15154
15194
|
);
|
|
15155
|
-
setExportProgress(
|
|
15195
|
+
setExportProgress(chunkCHHLFKT6_js.EXPORT_ASSEMBLING_PERCENT);
|
|
15156
15196
|
setExportStatusMessage("Saving file...");
|
|
15157
15197
|
downloadBlob2(blob, "presentation.gif");
|
|
15158
|
-
setExportProgress(
|
|
15198
|
+
setExportProgress(chunkCHHLFKT6_js.EXPORT_DONE_PERCENT);
|
|
15159
15199
|
} catch (err) {
|
|
15160
|
-
if (!
|
|
15200
|
+
if (!chunkCHHLFKT6_js.isExportAbortError(err)) {
|
|
15161
15201
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
15162
15202
|
}
|
|
15163
15203
|
} finally {
|
|
@@ -15197,7 +15237,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
15197
15237
|
}
|
|
15198
15238
|
printWindow.document.open();
|
|
15199
15239
|
printWindow.document.write(
|
|
15200
|
-
|
|
15240
|
+
chunkCHHLFKT6_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
15201
15241
|
);
|
|
15202
15242
|
printWindow.document.close();
|
|
15203
15243
|
printWindow.focus();
|
|
@@ -15258,7 +15298,7 @@ function usePrintHandlers(input) {
|
|
|
15258
15298
|
if (svgs.length === 0) {
|
|
15259
15299
|
return;
|
|
15260
15300
|
}
|
|
15261
|
-
const printDoc =
|
|
15301
|
+
const printDoc = chunkCHHLFKT6_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
15262
15302
|
title: "Slides (Vector)",
|
|
15263
15303
|
orientation: settings.orientation,
|
|
15264
15304
|
colorFilter
|
|
@@ -15294,7 +15334,7 @@ function usePrintHandlers(input) {
|
|
|
15294
15334
|
if (settings.printWhat === "outline") {
|
|
15295
15335
|
openPrintWindow(
|
|
15296
15336
|
"Outline",
|
|
15297
|
-
`<div class="outline-page">${
|
|
15337
|
+
`<div class="outline-page">${chunkCHHLFKT6_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
15298
15338
|
settings.orientation,
|
|
15299
15339
|
colorFilter,
|
|
15300
15340
|
settings.frameSlides
|
|
@@ -15319,7 +15359,7 @@ function usePrintHandlers(input) {
|
|
|
15319
15359
|
if (settings.printWhat === "slides") {
|
|
15320
15360
|
openPrintWindow(
|
|
15321
15361
|
"Slides",
|
|
15322
|
-
|
|
15362
|
+
chunkCHHLFKT6_js.buildSlidesHtml(slideImages, slideIndices),
|
|
15323
15363
|
settings.orientation,
|
|
15324
15364
|
colorFilter,
|
|
15325
15365
|
settings.frameSlides
|
|
@@ -15329,7 +15369,7 @@ function usePrintHandlers(input) {
|
|
|
15329
15369
|
if (settings.printWhat === "notes") {
|
|
15330
15370
|
openPrintWindow(
|
|
15331
15371
|
"Notes Pages",
|
|
15332
|
-
|
|
15372
|
+
chunkCHHLFKT6_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
15333
15373
|
"portrait",
|
|
15334
15374
|
colorFilter,
|
|
15335
15375
|
settings.frameSlides
|
|
@@ -15340,7 +15380,7 @@ function usePrintHandlers(input) {
|
|
|
15340
15380
|
const spp = settings.slidesPerPage;
|
|
15341
15381
|
openPrintWindow(
|
|
15342
15382
|
`Handout ${spp} per page`,
|
|
15343
|
-
|
|
15383
|
+
chunkCHHLFKT6_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
15344
15384
|
"portrait",
|
|
15345
15385
|
colorFilter,
|
|
15346
15386
|
settings.frameSlides
|
|
@@ -15404,8 +15444,8 @@ function useThemeHandlers(input) {
|
|
|
15404
15444
|
return;
|
|
15405
15445
|
}
|
|
15406
15446
|
await handler.updateThemeColorScheme(colorScheme);
|
|
15407
|
-
const previousMap = theme?.colorScheme ?
|
|
15408
|
-
setSlides((prev) =>
|
|
15447
|
+
const previousMap = theme?.colorScheme ? chunkODMFBYAP_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
15448
|
+
setSlides((prev) => chunkODMFBYAP_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
15409
15449
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
15410
15450
|
bumpHistory();
|
|
15411
15451
|
history.markDirty();
|
|
@@ -15510,7 +15550,7 @@ function useThemeSwitching(input) {
|
|
|
15510
15550
|
}
|
|
15511
15551
|
try {
|
|
15512
15552
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
15513
|
-
const newData =
|
|
15553
|
+
const newData = chunkODMFBYAP_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
15514
15554
|
onDataChange(newData);
|
|
15515
15555
|
onThemeChanged?.(preset);
|
|
15516
15556
|
} catch (error) {
|
|
@@ -15527,7 +15567,7 @@ function useThemeSwitching(input) {
|
|
|
15527
15567
|
}
|
|
15528
15568
|
try {
|
|
15529
15569
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
15530
|
-
const newData =
|
|
15570
|
+
const newData = chunkODMFBYAP_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
15531
15571
|
onDataChange(newData);
|
|
15532
15572
|
} catch (error) {
|
|
15533
15573
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -15539,12 +15579,12 @@ function useThemeSwitching(input) {
|
|
|
15539
15579
|
if (!data?.theme?.colorScheme) {
|
|
15540
15580
|
return void 0;
|
|
15541
15581
|
}
|
|
15542
|
-
return
|
|
15543
|
-
(p) =>
|
|
15582
|
+
return chunkODMFBYAP_js.THEME_PRESETS.find(
|
|
15583
|
+
(p) => chunkODMFBYAP_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
15544
15584
|
);
|
|
15545
15585
|
}, [data?.theme?.colorScheme]);
|
|
15546
15586
|
return {
|
|
15547
|
-
presets:
|
|
15587
|
+
presets: chunkODMFBYAP_js.THEME_PRESETS,
|
|
15548
15588
|
switchToPreset,
|
|
15549
15589
|
switchToCustom,
|
|
15550
15590
|
currentPreset
|
|
@@ -15619,7 +15659,7 @@ function usePropertyHandlers(input) {
|
|
|
15619
15659
|
}
|
|
15620
15660
|
try {
|
|
15621
15661
|
const ab = await file.arrayBuffer();
|
|
15622
|
-
const h = new
|
|
15662
|
+
const h = new chunkODMFBYAP_js.PptxHandler();
|
|
15623
15663
|
const other = await h.load(ab);
|
|
15624
15664
|
if (!other) {
|
|
15625
15665
|
return;
|
|
@@ -15629,7 +15669,7 @@ function usePropertyHandlers(input) {
|
|
|
15629
15669
|
width: canvasSize.width,
|
|
15630
15670
|
height: canvasSize.height
|
|
15631
15671
|
};
|
|
15632
|
-
setCompareResult(
|
|
15672
|
+
setCompareResult(chunkCHHLFKT6_js.comparePresentation(cur, other));
|
|
15633
15673
|
setIsComparePanelOpen(true);
|
|
15634
15674
|
} catch (err) {
|
|
15635
15675
|
console.warn("Compare failed:", err);
|
|
@@ -15646,7 +15686,7 @@ function usePropertyHandlers(input) {
|
|
|
15646
15686
|
if (!diff || diff.status === "unchanged") {
|
|
15647
15687
|
return;
|
|
15648
15688
|
}
|
|
15649
|
-
setSlides((prev) =>
|
|
15689
|
+
setSlides((prev) => chunkCHHLFKT6_js.applyAcceptSlide(prev, diff));
|
|
15650
15690
|
setIsDirty(true);
|
|
15651
15691
|
},
|
|
15652
15692
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -15657,10 +15697,10 @@ function usePropertyHandlers(input) {
|
|
|
15657
15697
|
if (!compareResult) {
|
|
15658
15698
|
return;
|
|
15659
15699
|
}
|
|
15660
|
-
setSlides((prev) =>
|
|
15700
|
+
setSlides((prev) => chunkCHHLFKT6_js.applyAcceptAllSlides(prev, compareResult));
|
|
15661
15701
|
setIsDirty(true);
|
|
15662
15702
|
}, [compareResult, setSlides, setIsDirty]);
|
|
15663
|
-
const usedFontFamilies = React4.useMemo(() =>
|
|
15703
|
+
const usedFontFamilies = React4.useMemo(() => chunkCHHLFKT6_js.collectUsedFonts(slides), [slides]);
|
|
15664
15704
|
return {
|
|
15665
15705
|
handleUpdateNotes,
|
|
15666
15706
|
handleUpdateSlide,
|
|
@@ -15779,7 +15819,7 @@ function useIsMobile(input) {
|
|
|
15779
15819
|
const containerRef = input?.containerRef;
|
|
15780
15820
|
const isTouchDevice = React4.useSyncExternalStore(
|
|
15781
15821
|
subscribeTouchCapability,
|
|
15782
|
-
|
|
15822
|
+
chunkCHHLFKT6_js.detectTouchDevice,
|
|
15783
15823
|
() => false
|
|
15784
15824
|
// server snapshot
|
|
15785
15825
|
);
|
|
@@ -15795,7 +15835,7 @@ function useIsMobile(input) {
|
|
|
15795
15835
|
}
|
|
15796
15836
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
15797
15837
|
});
|
|
15798
|
-
const [orientation, setOrientation] = React4.useState(
|
|
15838
|
+
const [orientation, setOrientation] = React4.useState(chunkCHHLFKT6_js.detectOrientation);
|
|
15799
15839
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = React4.useState(false);
|
|
15800
15840
|
const [initialViewportHeight] = React4.useState(
|
|
15801
15841
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -15839,7 +15879,7 @@ function useIsMobile(input) {
|
|
|
15839
15879
|
return;
|
|
15840
15880
|
}
|
|
15841
15881
|
const handleOrientationChange = () => {
|
|
15842
|
-
setOrientation(
|
|
15882
|
+
setOrientation(chunkCHHLFKT6_js.detectOrientation());
|
|
15843
15883
|
};
|
|
15844
15884
|
if (screen.orientation) {
|
|
15845
15885
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -15869,9 +15909,9 @@ function useIsMobile(input) {
|
|
|
15869
15909
|
window.addEventListener("resize", handleResize);
|
|
15870
15910
|
return () => window.removeEventListener("resize", handleResize);
|
|
15871
15911
|
}, [isTouchDevice, initialViewportHeight]);
|
|
15872
|
-
const isMobile =
|
|
15873
|
-
const isTablet = !isMobile && containerWidth >=
|
|
15874
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
15912
|
+
const isMobile = chunkCHHLFKT6_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
15913
|
+
const isTablet = !isMobile && containerWidth >= chunkCHHLFKT6_js.MOBILE_BREAKPOINT && containerWidth < chunkCHHLFKT6_js.TABLET_BREAKPOINT;
|
|
15914
|
+
const isDesktop = !isMobile && containerWidth >= chunkCHHLFKT6_js.TABLET_BREAKPOINT;
|
|
15875
15915
|
return {
|
|
15876
15916
|
isMobile,
|
|
15877
15917
|
isTablet,
|
|
@@ -15932,11 +15972,11 @@ function useViewerDialogs(input) {
|
|
|
15932
15972
|
);
|
|
15933
15973
|
const [embedFontsEnabled, setEmbedFontsEnabled] = React4.useState(false);
|
|
15934
15974
|
const [isNarrowViewport, setIsNarrowViewport] = React4.useState(
|
|
15935
|
-
() => typeof window !== "undefined" ?
|
|
15975
|
+
() => typeof window !== "undefined" ? chunkCHHLFKT6_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
15936
15976
|
);
|
|
15937
15977
|
React4.useEffect(() => {
|
|
15938
15978
|
const handleWindow = () => setIsNarrowViewport(
|
|
15939
|
-
|
|
15979
|
+
chunkCHHLFKT6_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
15940
15980
|
);
|
|
15941
15981
|
let observer = null;
|
|
15942
15982
|
let raf = 0;
|
|
@@ -15950,12 +15990,12 @@ function useViewerDialogs(input) {
|
|
|
15950
15990
|
const entry = entries[0];
|
|
15951
15991
|
if (entry) {
|
|
15952
15992
|
setIsNarrowViewport(
|
|
15953
|
-
|
|
15993
|
+
chunkCHHLFKT6_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
15954
15994
|
);
|
|
15955
15995
|
}
|
|
15956
15996
|
});
|
|
15957
15997
|
observer.observe(el);
|
|
15958
|
-
setIsNarrowViewport(
|
|
15998
|
+
setIsNarrowViewport(chunkCHHLFKT6_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
15959
15999
|
};
|
|
15960
16000
|
attach();
|
|
15961
16001
|
window.addEventListener("resize", handleWindow);
|
|
@@ -16132,7 +16172,7 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
|
16132
16172
|
return slides.map((_, i) => i).filter((i) => !slides[i]?.hidden);
|
|
16133
16173
|
}
|
|
16134
16174
|
function computeSlideSectionGroups(slides, sections) {
|
|
16135
|
-
return
|
|
16175
|
+
return chunkCHHLFKT6_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
16136
16176
|
id: group.section?.id ?? (sections.length > 0 ? UNGROUPED_SECTION_ID : "default"),
|
|
16137
16177
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
16138
16178
|
slideIndexes: group.slideIndexes,
|
|
@@ -16369,13 +16409,13 @@ function useSerialize(input) {
|
|
|
16369
16409
|
let processedSlide = slide;
|
|
16370
16410
|
if (pendingEditId) {
|
|
16371
16411
|
const updatedElements = slide.elements.map((el) => {
|
|
16372
|
-
if (el.id !== pendingEditId || !
|
|
16412
|
+
if (el.id !== pendingEditId || !chunkODMFBYAP_js.hasTextProperties(el)) {
|
|
16373
16413
|
return el;
|
|
16374
16414
|
}
|
|
16375
16415
|
return {
|
|
16376
16416
|
...el,
|
|
16377
16417
|
text: pendingEditText,
|
|
16378
|
-
textSegments:
|
|
16418
|
+
textSegments: chunkCHHLFKT6_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
16379
16419
|
};
|
|
16380
16420
|
});
|
|
16381
16421
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -16388,7 +16428,7 @@ function useSerialize(input) {
|
|
|
16388
16428
|
const pptxGuides = guides.map((g) => ({
|
|
16389
16429
|
id: g.id,
|
|
16390
16430
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
16391
|
-
positionEmu:
|
|
16431
|
+
positionEmu: chunkODMFBYAP_js.guidePxToEmu(g.position)
|
|
16392
16432
|
}));
|
|
16393
16433
|
return {
|
|
16394
16434
|
...processedSlide,
|
|
@@ -16622,10 +16662,10 @@ function usePresentationSetup(input) {
|
|
|
16622
16662
|
onToggleEraser: () => annotations.setPresentationTool("eraser"),
|
|
16623
16663
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
16624
16664
|
onSaveRehearsalTimings: (timings) => {
|
|
16625
|
-
setSlides((prev) =>
|
|
16665
|
+
setSlides((prev) => chunkCHHLFKT6_js.applyRehearsalTimings(prev, timings));
|
|
16626
16666
|
history.markDirty();
|
|
16627
16667
|
},
|
|
16628
|
-
loopContinuously:
|
|
16668
|
+
loopContinuously: chunkCHHLFKT6_js.shouldLoopContinuously(presentationProperties),
|
|
16629
16669
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
16630
16670
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
16631
16671
|
endWithBlackSlide
|
|
@@ -16787,7 +16827,7 @@ function useEditorOperations(input) {
|
|
|
16787
16827
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
16788
16828
|
React4.useEffect(() => {
|
|
16789
16829
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
16790
|
-
copiedFormatRef.current =
|
|
16830
|
+
copiedFormatRef.current = chunkCHHLFKT6_js.copyFormatFromElement(selectedElement);
|
|
16791
16831
|
} else if (!formatPainterActive) {
|
|
16792
16832
|
copiedFormatRef.current = null;
|
|
16793
16833
|
}
|
|
@@ -16813,12 +16853,12 @@ function useEditorOperations(input) {
|
|
|
16813
16853
|
e.stopPropagation();
|
|
16814
16854
|
const element = elementLookup.get(elementId);
|
|
16815
16855
|
if (element) {
|
|
16816
|
-
const updated =
|
|
16856
|
+
const updated = chunkCHHLFKT6_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
16817
16857
|
const updates = {};
|
|
16818
|
-
if (
|
|
16858
|
+
if (chunkODMFBYAP_js.hasShapeProperties(updated)) {
|
|
16819
16859
|
updates.shapeStyle = updated.shapeStyle;
|
|
16820
16860
|
}
|
|
16821
|
-
if (
|
|
16861
|
+
if (chunkODMFBYAP_js.hasTextProperties(updated)) {
|
|
16822
16862
|
updates.textStyle = updated.textStyle;
|
|
16823
16863
|
}
|
|
16824
16864
|
ops.updateElementById(elementId, updates);
|
|
@@ -16965,7 +17005,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
16965
17005
|
const families = /* @__PURE__ */ new Set();
|
|
16966
17006
|
for (const slide of slides) {
|
|
16967
17007
|
for (const el of slide.elements) {
|
|
16968
|
-
if (
|
|
17008
|
+
if (chunkODMFBYAP_js.hasTextProperties(el) && el.textSegments) {
|
|
16969
17009
|
for (const seg of el.textSegments) {
|
|
16970
17010
|
if (seg.style.fontFamily) {
|
|
16971
17011
|
families.add(seg.style.fontFamily);
|
|
@@ -17748,7 +17788,7 @@ function useReducedMotion() {
|
|
|
17748
17788
|
}
|
|
17749
17789
|
function useViewerOptions() {
|
|
17750
17790
|
const storeRef = React4.useRef(null);
|
|
17751
|
-
storeRef.current ??=
|
|
17791
|
+
storeRef.current ??= chunkCHHLFKT6_js.createViewerOptionsStore();
|
|
17752
17792
|
const store = storeRef.current;
|
|
17753
17793
|
const options = React4.useSyncExternalStore(
|
|
17754
17794
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -17757,9 +17797,9 @@ function useViewerOptions() {
|
|
|
17757
17797
|
);
|
|
17758
17798
|
return { optionsStore: store, options };
|
|
17759
17799
|
}
|
|
17760
|
-
var KNOWN_TAB_IDS = new Set(
|
|
17800
|
+
var KNOWN_TAB_IDS = new Set(chunkCHHLFKT6_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
17761
17801
|
function computeToolbarVisibility(hiddenActions) {
|
|
17762
|
-
const isHidden = (id) =>
|
|
17802
|
+
const isHidden = (id) => chunkCHHLFKT6_js.isActionHidden(id, hiddenActions);
|
|
17763
17803
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
17764
17804
|
return { isHidden, isTabVisible };
|
|
17765
17805
|
}
|
|
@@ -17844,10 +17884,10 @@ function useYjsDocumentSync({
|
|
|
17844
17884
|
return;
|
|
17845
17885
|
}
|
|
17846
17886
|
try {
|
|
17847
|
-
const { PptxHandler: PptxHandler2 } = await import('./dist-
|
|
17887
|
+
const { PptxHandler: PptxHandler2 } = await import('./dist-CPLP356W.js');
|
|
17848
17888
|
const handler = new PptxHandler2();
|
|
17849
17889
|
await handler.load(sourceBytes.buffer);
|
|
17850
|
-
const currentSlides =
|
|
17890
|
+
const currentSlides = chunkCHHLFKT6_js.readSlidesFromYDoc(
|
|
17851
17891
|
doc
|
|
17852
17892
|
);
|
|
17853
17893
|
const slidesToSave = buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
@@ -17865,7 +17905,7 @@ function useYjsDocumentSync({
|
|
|
17865
17905
|
if (!doc || !isConnected) {
|
|
17866
17906
|
return;
|
|
17867
17907
|
}
|
|
17868
|
-
const docSlides =
|
|
17908
|
+
const docSlides = chunkCHHLFKT6_js.readSlidesFromYDoc(
|
|
17869
17909
|
doc
|
|
17870
17910
|
);
|
|
17871
17911
|
if (docSlides.length === 0) {
|
|
@@ -17887,11 +17927,11 @@ function useYjsDocumentSync({
|
|
|
17887
17927
|
lastSyncedRef.current = serialized;
|
|
17888
17928
|
void (async () => {
|
|
17889
17929
|
const factories = await getFactories();
|
|
17890
|
-
|
|
17930
|
+
chunkCHHLFKT6_js.reconcileSlidesInYDoc(
|
|
17891
17931
|
slides,
|
|
17892
17932
|
doc,
|
|
17893
17933
|
factories,
|
|
17894
|
-
|
|
17934
|
+
chunkCHHLFKT6_js.LOCAL_SYNC_ORIGIN
|
|
17895
17935
|
);
|
|
17896
17936
|
scheduleWriteBack();
|
|
17897
17937
|
})();
|
|
@@ -17905,10 +17945,10 @@ function useYjsDocumentSync({
|
|
|
17905
17945
|
return;
|
|
17906
17946
|
}
|
|
17907
17947
|
const handleChange = (_events, transaction) => {
|
|
17908
|
-
if (transaction?.origin ===
|
|
17948
|
+
if (transaction?.origin === chunkCHHLFKT6_js.LOCAL_SYNC_ORIGIN) {
|
|
17909
17949
|
return;
|
|
17910
17950
|
}
|
|
17911
|
-
const remoteSlides =
|
|
17951
|
+
const remoteSlides = chunkCHHLFKT6_js.readSlidesFromYDoc(
|
|
17912
17952
|
doc
|
|
17913
17953
|
);
|
|
17914
17954
|
if (remoteSlides.length === 0) {
|
|
@@ -17924,7 +17964,7 @@ function useYjsDocumentSync({
|
|
|
17924
17964
|
isApplyingRemoteRef.current = false;
|
|
17925
17965
|
scheduleWriteBack();
|
|
17926
17966
|
};
|
|
17927
|
-
const unobserve =
|
|
17967
|
+
const unobserve = chunkCHHLFKT6_js.observeYDocSlides(
|
|
17928
17968
|
doc,
|
|
17929
17969
|
handleChange
|
|
17930
17970
|
);
|
|
@@ -17962,7 +18002,7 @@ function useBroadcastFollower({
|
|
|
17962
18002
|
if (!broadcaster) {
|
|
17963
18003
|
return;
|
|
17964
18004
|
}
|
|
17965
|
-
if (!
|
|
18005
|
+
if (!chunkCHHLFKT6_js.shouldAutoFollowBroadcaster({
|
|
17966
18006
|
localRole: collab.config.role,
|
|
17967
18007
|
broadcasterRole: broadcaster.role
|
|
17968
18008
|
})) {
|
|
@@ -18092,7 +18132,7 @@ function useTouchGestures(input) {
|
|
|
18092
18132
|
if (!el || !enabled) {
|
|
18093
18133
|
return;
|
|
18094
18134
|
}
|
|
18095
|
-
const recognizer =
|
|
18135
|
+
const recognizer = chunkCHHLFKT6_js.createTouchGestureRecognizer({
|
|
18096
18136
|
getScale: () => scaleRef.current,
|
|
18097
18137
|
minScale: MIN_ZOOM_SCALE,
|
|
18098
18138
|
maxScale: MAX_ZOOM_SCALE,
|
|
@@ -18135,7 +18175,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
18135
18175
|
return;
|
|
18136
18176
|
}
|
|
18137
18177
|
const rect = active.getBoundingClientRect();
|
|
18138
|
-
const delta =
|
|
18178
|
+
const delta = chunkCHHLFKT6_js.computeScrollDelta(
|
|
18139
18179
|
{ top: rect.top, bottom: rect.bottom },
|
|
18140
18180
|
window.innerHeight,
|
|
18141
18181
|
keyboardInset
|
|
@@ -18155,8 +18195,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18155
18195
|
return;
|
|
18156
18196
|
}
|
|
18157
18197
|
const update = () => {
|
|
18158
|
-
const metrics =
|
|
18159
|
-
const inset = metrics ?
|
|
18198
|
+
const metrics = chunkCHHLFKT6_js.readViewportMetrics(window);
|
|
18199
|
+
const inset = metrics ? chunkCHHLFKT6_js.computeKeyboardInset(metrics) : 0;
|
|
18160
18200
|
setKeyboardInset(inset);
|
|
18161
18201
|
if (inset > 0) {
|
|
18162
18202
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -18167,8 +18207,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18167
18207
|
vv.addEventListener("scroll", update);
|
|
18168
18208
|
const onFocusIn = () => {
|
|
18169
18209
|
window.requestAnimationFrame(() => {
|
|
18170
|
-
const metrics =
|
|
18171
|
-
const inset = metrics ?
|
|
18210
|
+
const metrics = chunkCHHLFKT6_js.readViewportMetrics(window);
|
|
18211
|
+
const inset = metrics ? chunkCHHLFKT6_js.computeKeyboardInset(metrics) : 0;
|
|
18172
18212
|
if (inset > 0) {
|
|
18173
18213
|
scrollFocusedIntoView(inset);
|
|
18174
18214
|
}
|
|
@@ -18181,7 +18221,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18181
18221
|
document.removeEventListener("focusin", onFocusIn);
|
|
18182
18222
|
};
|
|
18183
18223
|
}, [enabled]);
|
|
18184
|
-
return { keyboardInset, isKeyboardOpen:
|
|
18224
|
+
return { keyboardInset, isKeyboardOpen: chunkCHHLFKT6_js.isKeyboardOpen(keyboardInset) };
|
|
18185
18225
|
}
|
|
18186
18226
|
|
|
18187
18227
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -18236,13 +18276,13 @@ function buildCanvasProps(input) {
|
|
|
18236
18276
|
if (mode === "present") {
|
|
18237
18277
|
presentation.handlePresentationAction(action);
|
|
18238
18278
|
} else if (action.url) {
|
|
18239
|
-
|
|
18279
|
+
chunkCHHLFKT6_js.safeOpenUrl(action.url);
|
|
18240
18280
|
}
|
|
18241
18281
|
};
|
|
18242
18282
|
const handleHyperlinkClick = (url) => {
|
|
18243
|
-
if (
|
|
18283
|
+
if (chunkCHHLFKT6_js.isPpactionUrl(url)) {
|
|
18244
18284
|
if (mode === "present") {
|
|
18245
|
-
const parsed =
|
|
18285
|
+
const parsed = chunkCHHLFKT6_js.parsePpactionUrl(url);
|
|
18246
18286
|
if (parsed) {
|
|
18247
18287
|
presentation.handlePresentationAction({
|
|
18248
18288
|
action: parsed.action,
|
|
@@ -18252,7 +18292,7 @@ function buildCanvasProps(input) {
|
|
|
18252
18292
|
}
|
|
18253
18293
|
return;
|
|
18254
18294
|
}
|
|
18255
|
-
|
|
18295
|
+
chunkCHHLFKT6_js.safeOpenUrl(url);
|
|
18256
18296
|
};
|
|
18257
18297
|
return {
|
|
18258
18298
|
activeSlide: effectiveSlide,
|
|
@@ -18572,7 +18612,7 @@ function buildToolbarProps(input) {
|
|
|
18572
18612
|
onOpenFile,
|
|
18573
18613
|
onOpenRecentFile,
|
|
18574
18614
|
onCreatePresentation: (templateId) => {
|
|
18575
|
-
s.setSlides(
|
|
18615
|
+
s.setSlides(chunkCHHLFKT6_js.createBackstagePresentation(templateId));
|
|
18576
18616
|
s.setActiveSlideIndex(0);
|
|
18577
18617
|
s.setSelectedElementId(null);
|
|
18578
18618
|
s.setSelectedElementIds([]);
|
|
@@ -18627,7 +18667,7 @@ function buildToolbarProps(input) {
|
|
|
18627
18667
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
18628
18668
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
18629
18669
|
formatPainterActive: s.formatPainterActive,
|
|
18630
|
-
canActivateFormatPainter:
|
|
18670
|
+
canActivateFormatPainter: chunkCHHLFKT6_js.hasCopyableFormat(selectedElement),
|
|
18631
18671
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
18632
18672
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
18633
18673
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -18890,7 +18930,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
18890
18930
|
}, [incomingContent]);
|
|
18891
18931
|
const onOpenFile = React4.useCallback(() => {
|
|
18892
18932
|
void (async () => {
|
|
18893
|
-
const picked = await
|
|
18933
|
+
const picked = await chunkCHHLFKT6_js.openPptxFile();
|
|
18894
18934
|
if (picked) {
|
|
18895
18935
|
setContent(picked.buffer);
|
|
18896
18936
|
}
|
|
@@ -18898,7 +18938,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
18898
18938
|
}, []);
|
|
18899
18939
|
const onOpenRecentFile = React4.useCallback((key) => {
|
|
18900
18940
|
void (async () => {
|
|
18901
|
-
const bytes = await
|
|
18941
|
+
const bytes = await chunkCHHLFKT6_js.readBackstageRecentFile(key);
|
|
18902
18942
|
if (bytes) {
|
|
18903
18943
|
setContent(bytes);
|
|
18904
18944
|
}
|
|
@@ -19094,6 +19134,7 @@ exports.chevronPoints = chevronPoints;
|
|
|
19094
19134
|
exports.cn = cn;
|
|
19095
19135
|
exports.colour = colour;
|
|
19096
19136
|
exports.computeToolbarVisibility = computeToolbarVisibility;
|
|
19137
|
+
exports.contrastingTextColor = contrastingTextColor;
|
|
19097
19138
|
exports.detectTargetType = detectTargetType;
|
|
19098
19139
|
exports.fitFontSize = fitFontSize;
|
|
19099
19140
|
exports.gearPath = gearPath;
|