@aixa-transformation/pptx-viewer 2.0.35 → 2.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Model3DScene-TSBEZY4V.js → Model3DScene-PC56OC72.js} +3 -3
- package/dist/{Model3DScene-2GPBXNZQ.mjs → Model3DScene-TTKKQCNN.mjs} +2 -2
- package/dist/{SurfaceChart3DScene-UZJIMAM6.mjs → SurfaceChart3DScene-HVBOTUQT.mjs} +2 -2
- package/dist/{SurfaceChart3DScene-IT7MXL75.js → SurfaceChart3DScene-NS446YLK.js} +3 -3
- package/dist/{chunk-Q5EMZWLA.js → chunk-A6HCGZZB.js} +835 -835
- package/dist/{chunk-PWNYNDVP.mjs → chunk-KO6PR4DB.mjs} +1 -1
- package/dist/{chunk-ZKWWCC2U.mjs → chunk-PX7HPL7R.mjs} +0 -5
- package/dist/{chunk-JVIT6JD7.mjs → chunk-TZ6WZMSL.mjs} +8 -4
- package/dist/{chunk-F4FDQTWH.js → chunk-VG4NI3RU.js} +41 -41
- package/dist/{chunk-7UWYAMOP.js → chunk-WQZMNRYP.js} +485 -481
- package/dist/{chunk-X32L7B67.js → chunk-XRZ2U7KL.js} +0 -5
- package/dist/{chunk-XU7A5YCG.mjs → chunk-XV627I5V.mjs} +5 -5
- package/dist/{dist-GJSSSVHL.js → dist-SNAUH2AL.js} +568 -568
- package/dist/{dist-KNXTCBMV.mjs → dist-YQURUCQF.mjs} +1 -1
- package/dist/index.js +34 -34
- package/dist/index.mjs +4 -4
- package/dist/internals.js +78 -78
- package/dist/internals.mjs +3 -3
- package/dist/presentation.js +2 -2
- package/dist/presentation.mjs +1 -1
- package/dist/viewer/index.js +20 -20
- package/dist/viewer/index.mjs +4 -4
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkVG4NI3RU_js = require('./chunk-VG4NI3RU.js');
|
|
4
4
|
var chunkCUUYYYC5_js = require('./chunk-CUUYYYC5.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkXRZ2U7KL_js = require('./chunk-XRZ2U7KL.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 chunkVG4NI3RU_js.getAnimationInitialStyle(preset, nativeAnimation);
|
|
22
22
|
}
|
|
23
23
|
function useVirtualizedSlides({
|
|
24
24
|
totalItems,
|
|
25
25
|
itemHeight,
|
|
26
|
-
overscan =
|
|
26
|
+
overscan = chunkVG4NI3RU_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 = chunkVG4NI3RU_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 >= chunkVG4NI3RU_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
|
+
}, chunkVG4NI3RU_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 = chunkVG4NI3RU_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 = chunkVG4NI3RU_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(chunkVG4NI3RU_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 = chunkVG4NI3RU_js.validateRoomId(config.roomId);
|
|
286
|
+
const transport = config.transport ?? chunkVG4NI3RU_js.resolveTransportForServerUrl(config.serverUrl);
|
|
287
287
|
if (transport === "webrtc") {
|
|
288
288
|
await initWebrtc();
|
|
289
289
|
return;
|
|
290
290
|
}
|
|
291
|
-
if (
|
|
291
|
+
if (chunkVG4NI3RU_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
|
+
}, chunkVG4NI3RU_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 = chunkVG4NI3RU_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 chunkVG4NI3RU_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(chunkVG4NI3RU_js.cloneSlide),
|
|
514
|
+
templateElementsBySlideId: chunkVG4NI3RU_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(chunkVG4NI3RU_js.cloneSlide));
|
|
528
528
|
setTemplateElementsBySlideId(
|
|
529
|
-
|
|
529
|
+
chunkVG4NI3RU_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 = chunkVG4NI3RU_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 = chunkVG4NI3RU_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
|
+
chunkVG4NI3RU_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 = chunkVG4NI3RU_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 = chunkVG4NI3RU_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 = chunkVG4NI3RU_js.PRESENTATION_CHANNEL_NAME;
|
|
1438
|
+
var AUDIENCE_HASH = chunkVG4NI3RU_js.PRESENTATION_HASH;
|
|
1439
|
+
var PRESENTER_MSG_ORIGIN = chunkVG4NI3RU_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1440
|
+
var AUDIENCE_NONCE_KEY = chunkVG4NI3RU_js.PRESENTATION_NONCE_KEY;
|
|
1441
1441
|
function generateSessionId() {
|
|
1442
|
-
return
|
|
1442
|
+
return chunkVG4NI3RU_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 ? chunkVG4NI3RU_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 chunkVG4NI3RU_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 = chunkVG4NI3RU_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1561
|
+
void chunkVG4NI3RU_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1562
1562
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1563
|
-
|
|
1563
|
+
chunkVG4NI3RU_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 chunkVG4NI3RU_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 (chunkVG4NI3RU_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 chunkVG4NI3RU_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 (!chunkVG4NI3RU_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 chunkVG4NI3RU_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: chunkVG4NI3RU_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 (chunkVG4NI3RU_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 ? chunkVG4NI3RU_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(chunkVG4NI3RU_js.createPresenterTimer());
|
|
2249
|
+
const [snapshot, setSnapshot] = React4.useState(() => chunkVG4NI3RU_js.createInitialPresentationSnapshot(slideIndex));
|
|
2250
2250
|
const patch = React4.useCallback((value) => {
|
|
2251
|
-
setSnapshot((current) =>
|
|
2251
|
+
setSnapshot((current) => chunkVG4NI3RU_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: chunkVG4NI3RU_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 = chunkVG4NI3RU_js.togglePresenterTimer(timerRef.current);
|
|
2269
2269
|
patch({
|
|
2270
2270
|
paused: timerRef.current.paused,
|
|
2271
|
-
elapsedMs:
|
|
2271
|
+
elapsedMs: chunkVG4NI3RU_js.presenterElapsed(timerRef.current)
|
|
2272
2272
|
});
|
|
2273
2273
|
},
|
|
2274
2274
|
resetTimer: () => {
|
|
2275
|
-
timerRef.current =
|
|
2275
|
+
timerRef.current = chunkVG4NI3RU_js.resetPresenterTimer();
|
|
2276
2276
|
patch({ paused: false, elapsedMs: 0 });
|
|
2277
2277
|
},
|
|
2278
2278
|
stepZoom: (direction) => setSnapshot(
|
|
2279
|
-
(current) =>
|
|
2280
|
-
zoom:
|
|
2279
|
+
(current) => chunkVG4NI3RU_js.mergePresentationSnapshot(current, {
|
|
2280
|
+
zoom: chunkVG4NI3RU_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 (!chunkXRZ2U7KL_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 (!chunkXRZ2U7KL_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) => chunkVG4NI3RU_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) => !chunkVG4NI3RU_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 chunkXRZ2U7KL_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
|
+
chunkVG4NI3RU_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 } = chunkVG4NI3RU_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(chunkVG4NI3RU_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 chunkXRZ2U7KL_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 chunkVG4NI3RU_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 (!chunkXRZ2U7KL_js.hasTextProperties(element)) {
|
|
4140
4140
|
return { color: fallbackColor };
|
|
4141
4141
|
}
|
|
4142
4142
|
const textDecorationTokens = [];
|
|
@@ -4150,7 +4150,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
4150
4150
|
const textDecorationStyle = isDoubleStrike ? "double" : void 0;
|
|
4151
4151
|
const hasItalicRuns = element.textStyle?.italic || Boolean(element.textSegments?.some((segment) => segment.style?.italic));
|
|
4152
4152
|
const isRtl = element.textStyle?.rtl === true;
|
|
4153
|
-
const resolvedTextColor = element.textStyle?.hyperlink ?
|
|
4153
|
+
const resolvedTextColor = element.textStyle?.hyperlink ? chunkVG4NI3RU_js.normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : chunkVG4NI3RU_js.normalizeHexColor(element.textStyle?.color, fallbackColor);
|
|
4154
4154
|
const bodyTop = element.textStyle?.bodyInsetTop ?? DEFAULT_BODY_INSET_TB_PX;
|
|
4155
4155
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
4156
4156
|
const bodyLeft = element.textStyle?.bodyInsetLeft ?? DEFAULT_BODY_INSET_LR_PX;
|
|
@@ -4159,15 +4159,15 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
4159
4159
|
const bodyParagraphMarginLeft = hasParagraphIndents ? 0 : element.textStyle?.paragraphMarginLeft ?? 0;
|
|
4160
4160
|
const bodyParagraphMarginRight = hasParagraphIndents ? 0 : element.textStyle?.paragraphMarginRight ?? 0;
|
|
4161
4161
|
const bodyParagraphIndent = hasParagraphIndents ? 0 : element.textStyle?.paragraphIndent ?? 0;
|
|
4162
|
-
const writingMode =
|
|
4163
|
-
const textOrientation =
|
|
4164
|
-
const verticalDirection =
|
|
4162
|
+
const writingMode = chunkVG4NI3RU_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
4163
|
+
const textOrientation = chunkVG4NI3RU_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
4164
|
+
const verticalDirection = chunkVG4NI3RU_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
4165
4165
|
const resolvedDirection = verticalDirection || (isRtl ? "rtl" : "ltr");
|
|
4166
4166
|
const resolvedUnicodeBidi = isRtl ? "plaintext" : void 0;
|
|
4167
4167
|
const hasSegments = (element.textSegments?.length ?? 0) > 0;
|
|
4168
4168
|
return {
|
|
4169
4169
|
color: resolvedTextColor,
|
|
4170
|
-
backgroundColor: !hasSegments && element.textStyle?.highlightColor ?
|
|
4170
|
+
backgroundColor: !hasSegments && element.textStyle?.highlightColor ? chunkVG4NI3RU_js.normalizeHexColor(element.textStyle.highlightColor, void 0) : void 0,
|
|
4171
4171
|
textAlign: (() => {
|
|
4172
4172
|
const a = element.textStyle?.align;
|
|
4173
4173
|
if (a === "justLow" || a === "dist" || a === "thaiDist") {
|
|
@@ -4183,7 +4183,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
4183
4183
|
textDecorationLine: textDecorationTokens.length > 0 ? textDecorationTokens.join(" ") : "none",
|
|
4184
4184
|
textDecorationStyle,
|
|
4185
4185
|
fontFamily: element.textStyle?.fontFamily || DEFAULT_FONT_FAMILY,
|
|
4186
|
-
lineHeight:
|
|
4186
|
+
lineHeight: chunkVG4NI3RU_js.resolveLineHeight(element.textStyle, hasItalicRuns),
|
|
4187
4187
|
paddingTop: bodyTop + (hasItalicRuns ? 1 : 0),
|
|
4188
4188
|
paddingBottom: bodyBottom + (hasItalicRuns ? 1 : 0),
|
|
4189
4189
|
paddingLeft: bodyLeft + bodyParagraphMarginLeft,
|
|
@@ -4196,7 +4196,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
4196
4196
|
// Auto-fit: use OOXML-provided fontScale/lnSpcReduction when available,
|
|
4197
4197
|
// otherwise fall back to heuristic estimation. The pure font-scale maths
|
|
4198
4198
|
// now lives in pptx-viewer-shared (computeAutoFitTextStyle).
|
|
4199
|
-
...
|
|
4199
|
+
...chunkVG4NI3RU_js.computeAutoFitTextStyle({
|
|
4200
4200
|
textStyle: element.textStyle,
|
|
4201
4201
|
text: element.text ?? "",
|
|
4202
4202
|
width: element.width,
|
|
@@ -4230,13 +4230,13 @@ function computeTabSize(tabStops, defaultTabSize) {
|
|
|
4230
4230
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : fromDefault;
|
|
4231
4231
|
}
|
|
4232
4232
|
function getTextLayoutStyle(element) {
|
|
4233
|
-
if (!
|
|
4233
|
+
if (!chunkXRZ2U7KL_js.hasTextProperties(element)) {
|
|
4234
4234
|
return {};
|
|
4235
4235
|
}
|
|
4236
4236
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
4237
|
-
const writingMode =
|
|
4238
|
-
const textOrientation =
|
|
4239
|
-
const verticalDirection =
|
|
4237
|
+
const writingMode = chunkVG4NI3RU_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
4238
|
+
const textOrientation = chunkVG4NI3RU_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
4239
|
+
const verticalDirection = chunkVG4NI3RU_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
4240
4240
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
4241
4241
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
4242
4242
|
const hasColumns = columnCount > 1;
|
|
@@ -4244,7 +4244,7 @@ function getTextLayoutStyle(element) {
|
|
|
4244
4244
|
const tabStops = element.textStyle?.tabStops;
|
|
4245
4245
|
const tabSize = computeTabSize(tabStops, element.textStyle?.defaultTabSize);
|
|
4246
4246
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
4247
|
-
const hasParagraphIndents =
|
|
4247
|
+
const hasParagraphIndents = chunkXRZ2U7KL_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
4248
4248
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
4249
4249
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
4250
4250
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -4253,7 +4253,7 @@ function getTextLayoutStyle(element) {
|
|
|
4253
4253
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
4254
4254
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
4255
4255
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
4256
|
-
const kinsokuStyles =
|
|
4256
|
+
const kinsokuStyles = chunkVG4NI3RU_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
4257
4257
|
if (hasColumns) {
|
|
4258
4258
|
return {
|
|
4259
4259
|
display: "block",
|
|
@@ -4300,10 +4300,10 @@ function getTextLayoutStyle(element) {
|
|
|
4300
4300
|
|
|
4301
4301
|
// src/viewer/utils/text-effects.tsx
|
|
4302
4302
|
function buildTextFillCss2(style) {
|
|
4303
|
-
return
|
|
4303
|
+
return chunkVG4NI3RU_js.buildTextFillCss(style);
|
|
4304
4304
|
}
|
|
4305
4305
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
4306
|
-
return
|
|
4306
|
+
return chunkVG4NI3RU_js.buildTextBody3DSceneStyle(textStyle);
|
|
4307
4307
|
}
|
|
4308
4308
|
|
|
4309
4309
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -4488,17 +4488,17 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
4488
4488
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
4489
4489
|
return renderedSegments;
|
|
4490
4490
|
}
|
|
4491
|
-
const paraKey = `${elementId}${
|
|
4491
|
+
const paraKey = `${elementId}${chunkVG4NI3RU_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
4492
4492
|
const paraState = subElementAnimStates.get(paraKey);
|
|
4493
4493
|
if (paraState) {
|
|
4494
4494
|
const style = buildAnimStyle(paraState);
|
|
4495
4495
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
4496
4496
|
}
|
|
4497
|
-
const firstWordKey = `${elementId}${
|
|
4497
|
+
const firstWordKey = `${elementId}${chunkVG4NI3RU_js.TEXT_BUILD_ID_SEP}w${paraIndex}-0`;
|
|
4498
4498
|
if (subElementAnimStates.has(firstWordKey)) {
|
|
4499
4499
|
return wrapByWord(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
4500
4500
|
}
|
|
4501
|
-
const firstCharKey = `${elementId}${
|
|
4501
|
+
const firstCharKey = `${elementId}${chunkVG4NI3RU_js.TEXT_BUILD_ID_SEP}c${paraIndex}-0`;
|
|
4502
4502
|
if (subElementAnimStates.has(firstCharKey)) {
|
|
4503
4503
|
return wrapByChar(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
4504
4504
|
}
|
|
@@ -4519,7 +4519,7 @@ function wrapByWord(elementId, paraIndex, paraSegments, states) {
|
|
|
4519
4519
|
nodes.push(/* @__PURE__ */ jsxRuntime.jsx(React4__default.default.Fragment, { children: w }, `ws-${i}`));
|
|
4520
4520
|
continue;
|
|
4521
4521
|
}
|
|
4522
|
-
const key = `${elementId}${
|
|
4522
|
+
const key = `${elementId}${chunkVG4NI3RU_js.TEXT_BUILD_ID_SEP}w${paraIndex}-${wordIdx}`;
|
|
4523
4523
|
const state = states.get(key);
|
|
4524
4524
|
const style = buildAnimStyle(state);
|
|
4525
4525
|
nodes.push(
|
|
@@ -4533,7 +4533,7 @@ function wrapByChar(elementId, paraIndex, paraSegments, states) {
|
|
|
4533
4533
|
const fullText = paraSegments.map((e) => e.segment.text).join("");
|
|
4534
4534
|
const nodes = [];
|
|
4535
4535
|
for (let i = 0; i < fullText.length; i++) {
|
|
4536
|
-
const key = `${elementId}${
|
|
4536
|
+
const key = `${elementId}${chunkVG4NI3RU_js.TEXT_BUILD_ID_SEP}c${paraIndex}-${i}`;
|
|
4537
4537
|
const state = states.get(key);
|
|
4538
4538
|
const style = buildAnimStyle(state);
|
|
4539
4539
|
nodes.push(
|
|
@@ -4679,10 +4679,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
4679
4679
|
if (!needsScriptFonts || !text) {
|
|
4680
4680
|
return text;
|
|
4681
4681
|
}
|
|
4682
|
-
const runs =
|
|
4682
|
+
const runs = chunkVG4NI3RU_js.segmentByScript(text);
|
|
4683
4683
|
if (runs.length <= 1) {
|
|
4684
4684
|
if (runs.length === 1) {
|
|
4685
|
-
const font =
|
|
4685
|
+
const font = chunkVG4NI3RU_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
4686
4686
|
if (font && font !== baseFontFamily) {
|
|
4687
4687
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
4688
4688
|
}
|
|
@@ -4690,7 +4690,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
4690
4690
|
return text;
|
|
4691
4691
|
}
|
|
4692
4692
|
return runs.map((run, i) => {
|
|
4693
|
-
const font =
|
|
4693
|
+
const font = chunkVG4NI3RU_js.resolveFontForScript(run.script, scriptFonts);
|
|
4694
4694
|
if (!font || font === baseFontFamily) {
|
|
4695
4695
|
return /* @__PURE__ */ jsxRuntime.jsx(React4__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
4696
4696
|
}
|
|
@@ -4762,8 +4762,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
4762
4762
|
);
|
|
4763
4763
|
}
|
|
4764
4764
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
4765
|
-
const mathml =
|
|
4766
|
-
const safeMathml = mathml ?
|
|
4765
|
+
const mathml = chunkVG4NI3RU_js.convertOmmlToMathMl(equationXml);
|
|
4766
|
+
const safeMathml = mathml ? chunkVG4NI3RU_js.sanitizeMathMl(mathml) : "";
|
|
4767
4767
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4768
4768
|
"span",
|
|
4769
4769
|
{
|
|
@@ -4813,7 +4813,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
4813
4813
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
4814
4814
|
}
|
|
4815
4815
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
4816
|
-
const picture =
|
|
4816
|
+
const picture = chunkVG4NI3RU_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
4817
4817
|
sizePx: baseFontSize,
|
|
4818
4818
|
fallbackMarker: "\u2022",
|
|
4819
4819
|
accessibleLabel: "Bullet"
|
|
@@ -4863,7 +4863,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4863
4863
|
);
|
|
4864
4864
|
}
|
|
4865
4865
|
const segmentStyle = segment.style || {};
|
|
4866
|
-
const textValue =
|
|
4866
|
+
const textValue = chunkVG4NI3RU_js.substituteFieldText(segment.text || "", segment.fieldType, fieldContext);
|
|
4867
4867
|
const lines = textValue.split("\n");
|
|
4868
4868
|
const textDecorationTokens = [];
|
|
4869
4869
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -4873,8 +4873,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4873
4873
|
textDecorationTokens.push("line-through");
|
|
4874
4874
|
}
|
|
4875
4875
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
4876
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
4877
|
-
const underlineDecoration =
|
|
4876
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkVG4NI3RU_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkVG4NI3RU_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
4877
|
+
const underlineDecoration = chunkVG4NI3RU_js.resolveUnderlineDecorationStyle(
|
|
4878
4878
|
Boolean(isDoubleStrike),
|
|
4879
4879
|
segmentStyle.underlineStyle
|
|
4880
4880
|
);
|
|
@@ -4890,14 +4890,14 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4890
4890
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
4891
4891
|
const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
|
|
4892
4892
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
4893
|
-
const baseFontFamily = rawFontFamily ?
|
|
4893
|
+
const baseFontFamily = rawFontFamily ? chunkXRZ2U7KL_js.getSubstituteFontFamily(rawFontFamily) : DEFAULT_FONT_FAMILY;
|
|
4894
4894
|
const scriptFonts = {
|
|
4895
4895
|
latin: baseFontFamily,
|
|
4896
4896
|
eastAsia: segmentStyle.eastAsiaFont || element.textStyle?.eastAsiaFont || baseFontFamily,
|
|
4897
4897
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
4898
4898
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
4899
4899
|
};
|
|
4900
|
-
const needsScriptFonts =
|
|
4900
|
+
const needsScriptFonts = chunkVG4NI3RU_js.hasDistinctScriptFonts(scriptFonts);
|
|
4901
4901
|
const spanStyle = {
|
|
4902
4902
|
color: resolvedSegmentColor,
|
|
4903
4903
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -4915,15 +4915,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4915
4915
|
fontVariantCaps: segmentStyle.textCaps === "small" ? "small-caps" : void 0,
|
|
4916
4916
|
letterSpacing,
|
|
4917
4917
|
fontKerning,
|
|
4918
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
4918
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkVG4NI3RU_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
4919
4919
|
...textFillStyles,
|
|
4920
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
4921
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
4920
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkVG4NI3RU_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
4921
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkVG4NI3RU_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
4922
4922
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
4923
|
-
textShadow:
|
|
4924
|
-
filter:
|
|
4925
|
-
opacity:
|
|
4926
|
-
WebkitBoxReflect:
|
|
4923
|
+
textShadow: chunkVG4NI3RU_js.buildTextShadowCss(segmentStyle),
|
|
4924
|
+
filter: chunkVG4NI3RU_js.buildTextRunFilterChain(segmentStyle),
|
|
4925
|
+
opacity: chunkVG4NI3RU_js.getTextAlphaOpacity(segmentStyle),
|
|
4926
|
+
WebkitBoxReflect: chunkVG4NI3RU_js.buildTextReflectionCss(segmentStyle)
|
|
4927
4927
|
};
|
|
4928
4928
|
const runRtl = segmentStyle.rtl;
|
|
4929
4929
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -4949,7 +4949,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4949
4949
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
4950
4950
|
}
|
|
4951
4951
|
if (bulletInfo.color) {
|
|
4952
|
-
spanStyle.color =
|
|
4952
|
+
spanStyle.color = chunkVG4NI3RU_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
4953
4953
|
}
|
|
4954
4954
|
}
|
|
4955
4955
|
if (bulletInfo?.imageDataUrl || bulletInfo?.imageRelId) {
|
|
@@ -4989,7 +4989,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4989
4989
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
4990
4990
|
};
|
|
4991
4991
|
if (segment.rubyStyle?.color) {
|
|
4992
|
-
rubyStyle.color =
|
|
4992
|
+
rubyStyle.color = chunkVG4NI3RU_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
4993
4993
|
}
|
|
4994
4994
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
4995
4995
|
baseContent,
|
|
@@ -5105,7 +5105,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
5105
5105
|
return paragraphs;
|
|
5106
5106
|
}
|
|
5107
5107
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
5108
|
-
if (!
|
|
5108
|
+
if (!chunkXRZ2U7KL_js.hasTextProperties(element)) {
|
|
5109
5109
|
return emptyFallback || null;
|
|
5110
5110
|
}
|
|
5111
5111
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -5126,10 +5126,10 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
5126
5126
|
return element.text || emptyFallback || "";
|
|
5127
5127
|
}
|
|
5128
5128
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
5129
|
-
const paragraphIndents =
|
|
5130
|
-
const elementRtl =
|
|
5131
|
-
const elementAlign =
|
|
5132
|
-
const bodyStyle =
|
|
5129
|
+
const paragraphIndents = chunkXRZ2U7KL_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
5130
|
+
const elementRtl = chunkXRZ2U7KL_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
5131
|
+
const elementAlign = chunkXRZ2U7KL_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
5132
|
+
const bodyStyle = chunkXRZ2U7KL_js.hasTextProperties(element) ? element.textStyle : void 0;
|
|
5133
5133
|
const spaceFirstLast = bodyStyle?.spaceFirstLastParagraph === true;
|
|
5134
5134
|
return paragraphs.map((paraSegments, paraIndex) => {
|
|
5135
5135
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
@@ -5149,14 +5149,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
5149
5149
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
5150
5150
|
});
|
|
5151
5151
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent && !hasDuplicateAuthoredAutoNumber;
|
|
5152
|
-
const paraRtl =
|
|
5152
|
+
const paraRtl = chunkVG4NI3RU_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
5153
5153
|
const isRtlParagraph = paraRtl === true;
|
|
5154
|
-
const paraAlign =
|
|
5155
|
-
const cssTextAlign =
|
|
5154
|
+
const paraAlign = chunkVG4NI3RU_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
5155
|
+
const cssTextAlign = chunkVG4NI3RU_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
5156
5156
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
5157
5157
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
5158
5158
|
const paraTextIndent = rawTextIndent;
|
|
5159
|
-
const paraKinsokuStyle =
|
|
5159
|
+
const paraKinsokuStyle = chunkVG4NI3RU_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
5160
5160
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
5161
5161
|
const paraProps = effectiveSegments[firstSeg?.globalIndex ?? -1]?.paragraphProperties;
|
|
5162
5162
|
const effectiveParaProps = {
|
|
@@ -5364,7 +5364,7 @@ function isConnectorOrLineElement(element) {
|
|
|
5364
5364
|
if (element.type === "connector") {
|
|
5365
5365
|
return true;
|
|
5366
5366
|
}
|
|
5367
|
-
if (!
|
|
5367
|
+
if (!chunkXRZ2U7KL_js.hasShapeProperties(element)) {
|
|
5368
5368
|
return false;
|
|
5369
5369
|
}
|
|
5370
5370
|
const st = getShapeType(element.shapeType);
|
|
@@ -5382,13 +5382,13 @@ function hexToRgbUnit(hex) {
|
|
|
5382
5382
|
};
|
|
5383
5383
|
}
|
|
5384
5384
|
function getDuotoneColors(element) {
|
|
5385
|
-
if (!
|
|
5385
|
+
if (!chunkXRZ2U7KL_js.isImageLikeElement(element)) {
|
|
5386
5386
|
return void 0;
|
|
5387
5387
|
}
|
|
5388
5388
|
return element.imageEffects?.duotone;
|
|
5389
5389
|
}
|
|
5390
5390
|
function buildLineShadowCss(element) {
|
|
5391
|
-
if (!
|
|
5391
|
+
if (!chunkXRZ2U7KL_js.hasShapeProperties(element)) {
|
|
5392
5392
|
return void 0;
|
|
5393
5393
|
}
|
|
5394
5394
|
const ss = element.shapeStyle;
|
|
@@ -5399,13 +5399,13 @@ function buildLineShadowCss(element) {
|
|
|
5399
5399
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
5400
5400
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
5401
5401
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
5402
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
5403
|
-
|
|
5402
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkVG4NI3RU_js.colorWithOpacity(
|
|
5403
|
+
chunkVG4NI3RU_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
5404
5404
|
opacity
|
|
5405
5405
|
)}`;
|
|
5406
5406
|
}
|
|
5407
5407
|
function buildLineGlowFilter(element) {
|
|
5408
|
-
if (!
|
|
5408
|
+
if (!chunkXRZ2U7KL_js.hasShapeProperties(element)) {
|
|
5409
5409
|
return void 0;
|
|
5410
5410
|
}
|
|
5411
5411
|
const ss = element.shapeStyle;
|
|
@@ -5414,7 +5414,7 @@ function buildLineGlowFilter(element) {
|
|
|
5414
5414
|
}
|
|
5415
5415
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
5416
5416
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
5417
|
-
const glowCol =
|
|
5417
|
+
const glowCol = chunkVG4NI3RU_js.colorWithOpacity(chunkVG4NI3RU_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
5418
5418
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
5419
5419
|
}
|
|
5420
5420
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -5438,7 +5438,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
5438
5438
|
return `dag-duotone-${elementId}`;
|
|
5439
5439
|
}
|
|
5440
5440
|
function hasDagDuotoneEffect(element) {
|
|
5441
|
-
if (!
|
|
5441
|
+
if (!chunkXRZ2U7KL_js.hasShapeProperties(element)) {
|
|
5442
5442
|
return false;
|
|
5443
5443
|
}
|
|
5444
5444
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -5501,7 +5501,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
5501
5501
|
|
|
5502
5502
|
// src/viewer/utils/shape-visual-3d.ts
|
|
5503
5503
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
5504
|
-
return
|
|
5504
|
+
return chunkVG4NI3RU_js.build3DExtrusionData(
|
|
5505
5505
|
shape3d,
|
|
5506
5506
|
scene3d,
|
|
5507
5507
|
fillColor,
|
|
@@ -5510,7 +5510,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
5510
5510
|
);
|
|
5511
5511
|
}
|
|
5512
5512
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
5513
|
-
|
|
5513
|
+
chunkVG4NI3RU_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
5514
5514
|
}
|
|
5515
5515
|
|
|
5516
5516
|
// src/viewer/utils/vector-subpath-paint.ts
|
|
@@ -5519,7 +5519,7 @@ function toHexByte(value) {
|
|
|
5519
5519
|
return clamped.toString(16).padStart(2, "0");
|
|
5520
5520
|
}
|
|
5521
5521
|
function shiftHex(hex, factor, towardsWhite) {
|
|
5522
|
-
const channels =
|
|
5522
|
+
const channels = chunkVG4NI3RU_js.hexToRgbChannels(hex);
|
|
5523
5523
|
if (!channels) {
|
|
5524
5524
|
return hex;
|
|
5525
5525
|
}
|
|
@@ -5545,13 +5545,13 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
5545
5545
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
5546
5546
|
return {
|
|
5547
5547
|
d: subpath.d,
|
|
5548
|
-
fill: fillOff ? "none" :
|
|
5548
|
+
fill: fillOff ? "none" : chunkVG4NI3RU_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
5549
5549
|
stroked: subpath.stroke !== false
|
|
5550
5550
|
};
|
|
5551
5551
|
});
|
|
5552
5552
|
}
|
|
5553
5553
|
function getStrokeOnlyPresetPaths(element) {
|
|
5554
|
-
if (element.type !== "shape" || !
|
|
5554
|
+
if (element.type !== "shape" || !chunkXRZ2U7KL_js.hasShapeProperties(element)) {
|
|
5555
5555
|
return void 0;
|
|
5556
5556
|
}
|
|
5557
5557
|
const shapeType = element.shapeType;
|
|
@@ -5561,7 +5561,7 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
5561
5561
|
if (element.pathData) {
|
|
5562
5562
|
return void 0;
|
|
5563
5563
|
}
|
|
5564
|
-
const result =
|
|
5564
|
+
const result = chunkXRZ2U7KL_js.evaluatePresetShape(
|
|
5565
5565
|
shapeType,
|
|
5566
5566
|
Math.max(element.width, 1),
|
|
5567
5567
|
Math.max(element.height, 1),
|
|
@@ -5576,27 +5576,27 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
5576
5576
|
|
|
5577
5577
|
// src/viewer/utils/shape-visual-style.ts
|
|
5578
5578
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
5579
|
-
if (!
|
|
5579
|
+
if (!chunkXRZ2U7KL_js.hasShapeProperties(element)) {
|
|
5580
5580
|
return {};
|
|
5581
5581
|
}
|
|
5582
5582
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
5583
|
-
const clipPath =
|
|
5583
|
+
const clipPath = chunkVG4NI3RU_js.getResolvedShapeClipPath(element);
|
|
5584
5584
|
const rendersCustomVectorPath = (element.type === "shape" || element.type === "image" || element.type === "picture") && Boolean(element.pathData) && typeof element.pathWidth === "number" && element.pathWidth > 0 && typeof element.pathHeight === "number" && element.pathHeight > 0;
|
|
5585
5585
|
const rendersStrokeOnlyPreset = Boolean(getStrokeOnlyPresetPaths(element));
|
|
5586
5586
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
5587
5587
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
5588
|
-
const strokeDash =
|
|
5589
|
-
const fillGradient =
|
|
5590
|
-
const shadowCss =
|
|
5591
|
-
const innerShadowCss =
|
|
5592
|
-
const resolvedFillColor =
|
|
5593
|
-
const resolvedStrokeColor =
|
|
5588
|
+
const strokeDash = chunkVG4NI3RU_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
5589
|
+
const fillGradient = chunkVG4NI3RU_js.buildCssGradientFromShapeStyle(element.shapeStyle) || element.shapeStyle?.fillGradient;
|
|
5590
|
+
const shadowCss = chunkVG4NI3RU_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
5591
|
+
const innerShadowCss = chunkVG4NI3RU_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
5592
|
+
const resolvedFillColor = chunkVG4NI3RU_js.colorWithOpacity(fillColor, fillOpacity);
|
|
5593
|
+
const resolvedStrokeColor = chunkVG4NI3RU_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
5594
5594
|
const ss = element.shapeStyle;
|
|
5595
5595
|
const hasFillOverlayColor = Boolean(
|
|
5596
5596
|
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
5597
5597
|
);
|
|
5598
5598
|
const combinedShadowParts = [];
|
|
5599
|
-
const multiLayerShadow =
|
|
5599
|
+
const multiLayerShadow = chunkVG4NI3RU_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
5600
5600
|
if (multiLayerShadow) {
|
|
5601
5601
|
combinedShadowParts.push(multiLayerShadow);
|
|
5602
5602
|
} else if (shadowCss) {
|
|
@@ -5605,7 +5605,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5605
5605
|
if (innerShadowCss) {
|
|
5606
5606
|
combinedShadowParts.push(innerShadowCss);
|
|
5607
5607
|
}
|
|
5608
|
-
const glowBoxShadow =
|
|
5608
|
+
const glowBoxShadow = chunkVG4NI3RU_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
5609
5609
|
if (glowBoxShadow) {
|
|
5610
5610
|
combinedShadowParts.push(glowBoxShadow);
|
|
5611
5611
|
}
|
|
@@ -5613,7 +5613,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5613
5613
|
if (lineShadow) {
|
|
5614
5614
|
combinedShadowParts.push(lineShadow);
|
|
5615
5615
|
}
|
|
5616
|
-
const compoundLineShadow =
|
|
5616
|
+
const compoundLineShadow = chunkVG4NI3RU_js.getCompoundLineBoxShadow(
|
|
5617
5617
|
element.shapeStyle?.compoundLine,
|
|
5618
5618
|
strokeWidth,
|
|
5619
5619
|
resolvedStrokeColor
|
|
@@ -5626,11 +5626,11 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5626
5626
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
5627
5627
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
5628
5628
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
5629
|
-
const glowCol =
|
|
5629
|
+
const glowCol = chunkVG4NI3RU_js.colorWithOpacity(chunkVG4NI3RU_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
5630
5630
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
5631
5631
|
}
|
|
5632
5632
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
5633
|
-
filterParts.push(`url(#${
|
|
5633
|
+
filterParts.push(`url(#${chunkVG4NI3RU_js.getSoftEdgeFilterId(element.id)})`);
|
|
5634
5634
|
}
|
|
5635
5635
|
if (typeof ss?.blurRadius === "number" && ss.blurRadius > 0) {
|
|
5636
5636
|
filterParts.push(`blur(${Math.round(ss.blurRadius)}px)`);
|
|
@@ -5639,13 +5639,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5639
5639
|
if (lineGlowCss) {
|
|
5640
5640
|
filterParts.push(lineGlowCss);
|
|
5641
5641
|
}
|
|
5642
|
-
const dagFilter =
|
|
5642
|
+
const dagFilter = chunkVG4NI3RU_js.getEffectDagFilter(ss, element.id);
|
|
5643
5643
|
if (dagFilter) {
|
|
5644
5644
|
filterParts.push(dagFilter);
|
|
5645
5645
|
}
|
|
5646
5646
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : ss?.lineJoin === "miter" ? "miter" : void 0;
|
|
5647
5647
|
const miterLimitCss = ss?.lineJoin === "miter" && typeof ss?.miterLimit === "number" ? Math.max(ss.miterLimit / 1e5, 1) : void 0;
|
|
5648
|
-
const patternFill =
|
|
5648
|
+
const patternFill = chunkVG4NI3RU_js.buildPatternFillCss(element.shapeStyle);
|
|
5649
5649
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
5650
5650
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
5651
5651
|
let reflectCss;
|
|
@@ -5657,7 +5657,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5657
5657
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
5658
5658
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
5659
5659
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
5660
|
-
reflectCss =
|
|
5660
|
+
reflectCss = chunkVG4NI3RU_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
5661
5661
|
}
|
|
5662
5662
|
}
|
|
5663
5663
|
const base = {
|
|
@@ -5675,9 +5675,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5675
5675
|
// is present, `ShapeEffectOverlay` paints a separate blended tint layer so
|
|
5676
5676
|
// the colour is actually rendered (and text/children are not tinted).
|
|
5677
5677
|
mixBlendMode: hasFillOverlayColor ? void 0 : mapDagBlendModeToCss(ss?.dagFillOverlayBlend),
|
|
5678
|
-
borderWidth: strokeWidth > 0 ?
|
|
5678
|
+
borderWidth: strokeWidth > 0 ? chunkVG4NI3RU_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : void 0,
|
|
5679
5679
|
borderColor: strokeWidth > 0 ? resolvedStrokeColor : void 0,
|
|
5680
|
-
borderStyle: strokeWidth > 0 ?
|
|
5680
|
+
borderStyle: strokeWidth > 0 ? chunkVG4NI3RU_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
5681
5681
|
strokeLinejoin: lineJoinCss,
|
|
5682
5682
|
strokeMiterlimit: miterLimitCss,
|
|
5683
5683
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -5733,7 +5733,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5733
5733
|
borderWidth: 0,
|
|
5734
5734
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
5735
5735
|
borderTopColor: resolvedStrokeColor,
|
|
5736
|
-
borderTopStyle:
|
|
5736
|
+
borderTopStyle: chunkVG4NI3RU_js.getCssBorderDashStyle(strokeDash)
|
|
5737
5737
|
};
|
|
5738
5738
|
}
|
|
5739
5739
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -5747,13 +5747,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5747
5747
|
function getConnectorAdjustment(element, key, fallback) {
|
|
5748
5748
|
const direct = element.shapeAdjustments?.[key];
|
|
5749
5749
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
5750
|
-
return
|
|
5750
|
+
return chunkVG4NI3RU_js.clampUnitInterval(direct / 1e5);
|
|
5751
5751
|
}
|
|
5752
5752
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
5753
5753
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
5754
|
-
return
|
|
5754
|
+
return chunkVG4NI3RU_js.clampUnitInterval(fallbackKey / 1e5);
|
|
5755
5755
|
}
|
|
5756
|
-
return
|
|
5756
|
+
return chunkVG4NI3RU_js.clampUnitInterval(fallback);
|
|
5757
5757
|
}
|
|
5758
5758
|
function getConnectorPathGeometry(element) {
|
|
5759
5759
|
const width = Math.max(element.width, 1);
|
|
@@ -5890,11 +5890,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
5890
5890
|
strokePaint,
|
|
5891
5891
|
strokeWidth,
|
|
5892
5892
|
dashArray,
|
|
5893
|
-
lineCap:
|
|
5893
|
+
lineCap: chunkVG4NI3RU_js.svgLineCap(shapeStyle?.lineCap),
|
|
5894
5894
|
lineJoin,
|
|
5895
5895
|
miterLimit,
|
|
5896
|
-
offsets:
|
|
5897
|
-
widths:
|
|
5896
|
+
offsets: chunkVG4NI3RU_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
5897
|
+
widths: chunkVG4NI3RU_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
5898
5898
|
};
|
|
5899
5899
|
}
|
|
5900
5900
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -5952,7 +5952,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
5952
5952
|
) });
|
|
5953
5953
|
}
|
|
5954
5954
|
const customFillPaint = gradientId ? `url(#${gradientId})` : void 0;
|
|
5955
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
5955
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkXRZ2U7KL_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
5956
5956
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
5957
5957
|
const nodes = [];
|
|
5958
5958
|
if (subpaths && needsPerSubpath) {
|
|
@@ -5983,7 +5983,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
5983
5983
|
"path",
|
|
5984
5984
|
{
|
|
5985
5985
|
d: pathData,
|
|
5986
|
-
fill: animatesFill ? "inherit" : customFillPaint ??
|
|
5986
|
+
fill: animatesFill ? "inherit" : customFillPaint ?? chunkVG4NI3RU_js.colorWithOpacity(fillColor, fillOpacity),
|
|
5987
5987
|
stroke: "none",
|
|
5988
5988
|
vectorEffect: "non-scaling-stroke"
|
|
5989
5989
|
},
|
|
@@ -6028,14 +6028,14 @@ function renderStrokeOnlyPreset(presetPaths, width, height, shapeStyle, strokePa
|
|
|
6028
6028
|
);
|
|
6029
6029
|
}
|
|
6030
6030
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
6031
|
-
if (!
|
|
6031
|
+
if (!chunkXRZ2U7KL_js.hasShapeProperties(element)) {
|
|
6032
6032
|
return null;
|
|
6033
6033
|
}
|
|
6034
6034
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
6035
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
6036
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
6037
|
-
const dashType =
|
|
6038
|
-
const dashArray =
|
|
6035
|
+
const fillPaint = animatesFill ? "inherit" : chunkVG4NI3RU_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
6036
|
+
const strokePaint = animatesStroke ? "inherit" : chunkVG4NI3RU_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
6037
|
+
const dashType = chunkVG4NI3RU_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
6038
|
+
const dashArray = chunkVG4NI3RU_js.getSvgStrokeDasharray(
|
|
6039
6039
|
dashType,
|
|
6040
6040
|
Math.max(strokeWidth, 1),
|
|
6041
6041
|
element.shapeStyle?.customDashSegments
|
|
@@ -6114,18 +6114,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
6114
6114
|
Boolean(animatesFill)
|
|
6115
6115
|
);
|
|
6116
6116
|
}
|
|
6117
|
-
if (
|
|
6117
|
+
if (chunkXRZ2U7KL_js.isCalloutShape(normalizedType)) {
|
|
6118
6118
|
const width = Math.max(element.width, 1);
|
|
6119
6119
|
const height = Math.max(element.height, 1);
|
|
6120
|
-
const geometry =
|
|
6120
|
+
const geometry = chunkXRZ2U7KL_js.getCalloutLeaderLineGeometry(
|
|
6121
6121
|
normalizedType,
|
|
6122
6122
|
width,
|
|
6123
6123
|
height,
|
|
6124
6124
|
element.shapeAdjustments
|
|
6125
6125
|
);
|
|
6126
6126
|
if (geometry && geometry.points.length >= 2) {
|
|
6127
|
-
const leaderPath =
|
|
6128
|
-
const bounds =
|
|
6127
|
+
const leaderPath = chunkXRZ2U7KL_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
6128
|
+
const bounds = chunkXRZ2U7KL_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
6129
6129
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
6130
6130
|
const offsetLeft = bounds.minX;
|
|
6131
6131
|
const offsetTop = bounds.minY;
|
|
@@ -6188,10 +6188,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
6188
6188
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
6189
6189
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
6190
6190
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
6191
|
-
const connectorLineCap =
|
|
6191
|
+
const connectorLineCap = chunkVG4NI3RU_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
6192
6192
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
6193
|
-
const offsets =
|
|
6194
|
-
const widths =
|
|
6193
|
+
const offsets = chunkVG4NI3RU_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
6194
|
+
const widths = chunkVG4NI3RU_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
6195
6195
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6196
6196
|
"svg",
|
|
6197
6197
|
{
|
|
@@ -6257,7 +6257,7 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
6257
6257
|
|
|
6258
6258
|
// src/viewer/utils/image-style.ts
|
|
6259
6259
|
function getImageMaskStyle(element) {
|
|
6260
|
-
if (!
|
|
6260
|
+
if (!chunkXRZ2U7KL_js.hasShapeProperties(element)) {
|
|
6261
6261
|
return void 0;
|
|
6262
6262
|
}
|
|
6263
6263
|
const shapeType = element.shapeType;
|
|
@@ -6266,7 +6266,7 @@ function getImageMaskStyle(element) {
|
|
|
6266
6266
|
}
|
|
6267
6267
|
const normalized = shapeType.toLowerCase();
|
|
6268
6268
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
6269
|
-
const radiusPx =
|
|
6269
|
+
const radiusPx = chunkVG4NI3RU_js.getRoundRectRadiusPx(element);
|
|
6270
6270
|
if (radiusPx <= 0.01) {
|
|
6271
6271
|
return void 0;
|
|
6272
6272
|
}
|
|
@@ -6278,7 +6278,7 @@ function getImageMaskStyle(element) {
|
|
|
6278
6278
|
if (normalized === "can" || normalized === "cylinder") {
|
|
6279
6279
|
return { borderRadius: "48% / 12%" };
|
|
6280
6280
|
}
|
|
6281
|
-
const clipPath =
|
|
6281
|
+
const clipPath = chunkVG4NI3RU_js.getResolvedShapeClipPath(element);
|
|
6282
6282
|
if (!clipPath) {
|
|
6283
6283
|
return void 0;
|
|
6284
6284
|
}
|
|
@@ -6286,7 +6286,7 @@ function getImageMaskStyle(element) {
|
|
|
6286
6286
|
}
|
|
6287
6287
|
function getImageRenderStyle(element) {
|
|
6288
6288
|
const maskStyle = getImageMaskStyle(element) || {};
|
|
6289
|
-
if (!
|
|
6289
|
+
if (!chunkXRZ2U7KL_js.isImageLikeElement(element)) {
|
|
6290
6290
|
return {
|
|
6291
6291
|
...maskStyle,
|
|
6292
6292
|
width: "100%",
|
|
@@ -6294,10 +6294,10 @@ function getImageRenderStyle(element) {
|
|
|
6294
6294
|
objectFit: "cover"
|
|
6295
6295
|
};
|
|
6296
6296
|
}
|
|
6297
|
-
const cropLeft =
|
|
6298
|
-
const cropTop =
|
|
6299
|
-
const cropRight =
|
|
6300
|
-
const cropBottom =
|
|
6297
|
+
const cropLeft = chunkVG4NI3RU_js.clampCropValue(element.cropLeft);
|
|
6298
|
+
const cropTop = chunkVG4NI3RU_js.clampCropValue(element.cropTop);
|
|
6299
|
+
const cropRight = chunkVG4NI3RU_js.clampCropValue(element.cropRight);
|
|
6300
|
+
const cropBottom = chunkVG4NI3RU_js.clampCropValue(element.cropBottom);
|
|
6301
6301
|
const hasCrop = cropLeft + cropRight > 1e-4 || cropTop + cropBottom > 1e-4;
|
|
6302
6302
|
if (!hasCrop) {
|
|
6303
6303
|
return {
|
|
@@ -6313,10 +6313,10 @@ function getImageRenderStyle(element) {
|
|
|
6313
6313
|
}
|
|
6314
6314
|
const safeHorizontalScale = cropLeft + cropRight >= 0.99 ? 0.99 / (cropLeft + cropRight) : 1;
|
|
6315
6315
|
const safeVerticalScale = cropTop + cropBottom >= 0.99 ? 0.99 / (cropTop + cropBottom) : 1;
|
|
6316
|
-
const normalizedLeft =
|
|
6317
|
-
const normalizedRight =
|
|
6318
|
-
const normalizedTop =
|
|
6319
|
-
const normalizedBottom =
|
|
6316
|
+
const normalizedLeft = chunkVG4NI3RU_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
6317
|
+
const normalizedRight = chunkVG4NI3RU_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
6318
|
+
const normalizedTop = chunkVG4NI3RU_js.clampCropValue(cropTop * safeVerticalScale);
|
|
6319
|
+
const normalizedBottom = chunkVG4NI3RU_js.clampCropValue(cropBottom * safeVerticalScale);
|
|
6320
6320
|
const remainingWidth = Math.max(0.01, 1 - normalizedLeft - normalizedRight);
|
|
6321
6321
|
const remainingHeight = Math.max(0.01, 1 - normalizedTop - normalizedBottom);
|
|
6322
6322
|
const tx = Math.round(-normalizedLeft / remainingWidth * 1e4) / 100;
|
|
@@ -6345,7 +6345,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
6345
6345
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
6346
6346
|
};
|
|
6347
6347
|
function getCropShapeClipPath(element) {
|
|
6348
|
-
if (!
|
|
6348
|
+
if (!chunkXRZ2U7KL_js.isImageLikeElement(element)) {
|
|
6349
6349
|
return void 0;
|
|
6350
6350
|
}
|
|
6351
6351
|
const shape = element.cropShape;
|
|
@@ -6355,7 +6355,7 @@ function getCropShapeClipPath(element) {
|
|
|
6355
6355
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
6356
6356
|
}
|
|
6357
6357
|
function isImageTiled(element) {
|
|
6358
|
-
if (!
|
|
6358
|
+
if (!chunkXRZ2U7KL_js.isImageLikeElement(element)) {
|
|
6359
6359
|
return false;
|
|
6360
6360
|
}
|
|
6361
6361
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -6413,7 +6413,7 @@ function buildMirrorTiledBackground(src, flip, scaleX, scaleY) {
|
|
|
6413
6413
|
};
|
|
6414
6414
|
}
|
|
6415
6415
|
function getImageTilingStyle(element) {
|
|
6416
|
-
if (!
|
|
6416
|
+
if (!chunkXRZ2U7KL_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
6417
6417
|
return void 0;
|
|
6418
6418
|
}
|
|
6419
6419
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -6487,9 +6487,9 @@ function parseGradientFillCss(gradFill) {
|
|
|
6487
6487
|
}
|
|
6488
6488
|
const parsed = stops.map((gs) => {
|
|
6489
6489
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
6490
|
-
const color =
|
|
6491
|
-
const opacity =
|
|
6492
|
-
return { pos, color:
|
|
6490
|
+
const color = chunkVG4NI3RU_js.parseDrawingColor(gs) ?? "#888888";
|
|
6491
|
+
const opacity = chunkVG4NI3RU_js.parseDrawingColorOpacity(gs);
|
|
6492
|
+
return { pos, color: chunkVG4NI3RU_js.colorWithOpacity(color, opacity) };
|
|
6493
6493
|
}).sort((a, b) => a.pos - b.pos);
|
|
6494
6494
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
6495
6495
|
const lin = gradFill["a:lin"];
|
|
@@ -6530,8 +6530,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
6530
6530
|
if (!pattFill) {
|
|
6531
6531
|
return void 0;
|
|
6532
6532
|
}
|
|
6533
|
-
const fgColor =
|
|
6534
|
-
const bgColor =
|
|
6533
|
+
const fgColor = chunkVG4NI3RU_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
6534
|
+
const bgColor = chunkVG4NI3RU_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
6535
6535
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
6536
6536
|
switch (preset) {
|
|
6537
6537
|
case "ltHorz":
|
|
@@ -6642,11 +6642,11 @@ function parseCellBorders(cellProperties) {
|
|
|
6642
6642
|
const prstDash = ln["a:prstDash"];
|
|
6643
6643
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
6644
6644
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
6645
|
-
const color =
|
|
6645
|
+
const color = chunkVG4NI3RU_js.parseDrawingColor(ln["a:solidFill"]);
|
|
6646
6646
|
if (color) {
|
|
6647
|
-
const opacity =
|
|
6647
|
+
const opacity = chunkVG4NI3RU_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
6648
6648
|
const key = `${edge.prefix}`;
|
|
6649
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
6649
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkVG4NI3RU_js.colorWithOpacity(color, opacity)}`;
|
|
6650
6650
|
}
|
|
6651
6651
|
}
|
|
6652
6652
|
return borderStyle;
|
|
@@ -6659,7 +6659,7 @@ function parseCellTextEffects(runProps) {
|
|
|
6659
6659
|
const textShadowParts = [];
|
|
6660
6660
|
const outerShdw = effectLst["a:outerShdw"];
|
|
6661
6661
|
if (outerShdw) {
|
|
6662
|
-
const shdwColor =
|
|
6662
|
+
const shdwColor = chunkVG4NI3RU_js.parseDrawingColor(outerShdw);
|
|
6663
6663
|
if (shdwColor) {
|
|
6664
6664
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
6665
6665
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -6677,7 +6677,7 @@ function parseCellTextEffects(runProps) {
|
|
|
6677
6677
|
}
|
|
6678
6678
|
const glow = effectLst["a:glow"];
|
|
6679
6679
|
if (glow) {
|
|
6680
|
-
const glowColor =
|
|
6680
|
+
const glowColor = chunkVG4NI3RU_js.parseDrawingColor(glow);
|
|
6681
6681
|
if (glowColor) {
|
|
6682
6682
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
6683
6683
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -6756,10 +6756,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides, inc
|
|
|
6756
6756
|
if (runProps?.["@_u"] !== void 0) {
|
|
6757
6757
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
6758
6758
|
}
|
|
6759
|
-
const runColor =
|
|
6759
|
+
const runColor = chunkVG4NI3RU_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkVG4NI3RU_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
6760
6760
|
if (runColor) {
|
|
6761
|
-
const opacity =
|
|
6762
|
-
cellStyle.color =
|
|
6761
|
+
const opacity = chunkVG4NI3RU_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
6762
|
+
cellStyle.color = chunkVG4NI3RU_js.colorWithOpacity(runColor, opacity);
|
|
6763
6763
|
}
|
|
6764
6764
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
6765
6765
|
if (fontFamily) {
|
|
@@ -6769,15 +6769,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides, inc
|
|
|
6769
6769
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
6770
6770
|
}
|
|
6771
6771
|
const cellProperties = cellXml["a:tcPr"];
|
|
6772
|
-
const cellFill =
|
|
6772
|
+
const cellFill = chunkVG4NI3RU_js.parseDrawingColor(
|
|
6773
6773
|
cellProperties?.["a:solidFill"],
|
|
6774
6774
|
schemeColorOverrides
|
|
6775
6775
|
);
|
|
6776
6776
|
if (cellFill) {
|
|
6777
|
-
const opacity =
|
|
6777
|
+
const opacity = chunkVG4NI3RU_js.parseDrawingColorOpacity(
|
|
6778
6778
|
cellProperties?.["a:solidFill"]
|
|
6779
6779
|
);
|
|
6780
|
-
cellStyle.backgroundColor =
|
|
6780
|
+
cellStyle.backgroundColor = chunkVG4NI3RU_js.colorWithOpacity(cellFill, opacity);
|
|
6781
6781
|
} else {
|
|
6782
6782
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
6783
6783
|
if (gradCss) {
|
|
@@ -6792,16 +6792,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides, inc
|
|
|
6792
6792
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
6793
6793
|
Object.assign(cellStyle, edgeBorders);
|
|
6794
6794
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
6795
|
-
const borderColor =
|
|
6795
|
+
const borderColor = chunkVG4NI3RU_js.parseDrawingColor(
|
|
6796
6796
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
6797
6797
|
schemeColorOverrides
|
|
6798
|
-
) ||
|
|
6798
|
+
) || chunkVG4NI3RU_js.parseDrawingColor(
|
|
6799
6799
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
6800
6800
|
schemeColorOverrides
|
|
6801
|
-
) ||
|
|
6801
|
+
) || chunkVG4NI3RU_js.parseDrawingColor(
|
|
6802
6802
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
6803
6803
|
schemeColorOverrides
|
|
6804
|
-
) ||
|
|
6804
|
+
) || chunkVG4NI3RU_js.parseDrawingColor(
|
|
6805
6805
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
6806
6806
|
schemeColorOverrides
|
|
6807
6807
|
);
|
|
@@ -6880,10 +6880,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
6880
6880
|
}
|
|
6881
6881
|
let color = base;
|
|
6882
6882
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
6883
|
-
color =
|
|
6883
|
+
color = chunkVG4NI3RU_js.tintColor2(color, 1 - fill.tint / 1e5);
|
|
6884
6884
|
}
|
|
6885
6885
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
6886
|
-
color =
|
|
6886
|
+
color = chunkVG4NI3RU_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
6887
6887
|
}
|
|
6888
6888
|
return color;
|
|
6889
6889
|
}
|
|
@@ -6908,7 +6908,7 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
6908
6908
|
style.fontFamily = text.fontFace;
|
|
6909
6909
|
applied = true;
|
|
6910
6910
|
} else {
|
|
6911
|
-
const refFont =
|
|
6911
|
+
const refFont = chunkVG4NI3RU_js.resolveFontRefIdx(text.fontRefIdx, fontScheme);
|
|
6912
6912
|
if (refFont) {
|
|
6913
6913
|
style.fontFamily = refFont;
|
|
6914
6914
|
applied = true;
|
|
@@ -6919,10 +6919,10 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
6919
6919
|
if (base) {
|
|
6920
6920
|
let color = base;
|
|
6921
6921
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
6922
|
-
color =
|
|
6922
|
+
color = chunkVG4NI3RU_js.tintColor2(color, 1 - text.fontTint / 1e5);
|
|
6923
6923
|
}
|
|
6924
6924
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
6925
|
-
color =
|
|
6925
|
+
color = chunkVG4NI3RU_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
6926
6926
|
}
|
|
6927
6927
|
style.color = color;
|
|
6928
6928
|
applied = true;
|
|
@@ -7114,7 +7114,7 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
7114
7114
|
};
|
|
7115
7115
|
}
|
|
7116
7116
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
7117
|
-
return
|
|
7117
|
+
return chunkVG4NI3RU_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
7118
7118
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
7119
7119
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
7120
7120
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -7262,9 +7262,9 @@ function cellStyleToCss(style) {
|
|
|
7262
7262
|
if (style.gradientFillCss) {
|
|
7263
7263
|
css.background = style.gradientFillCss;
|
|
7264
7264
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
7265
|
-
const fg =
|
|
7266
|
-
const bg =
|
|
7267
|
-
const svgPattern =
|
|
7265
|
+
const fg = chunkVG4NI3RU_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
7266
|
+
const bg = chunkVG4NI3RU_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
7267
|
+
const svgPattern = chunkVG4NI3RU_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
7268
7268
|
if (svgPattern) {
|
|
7269
7269
|
const encoded = encodeURIComponent(svgPattern);
|
|
7270
7270
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -7340,7 +7340,7 @@ function cellStyleToCss(style) {
|
|
|
7340
7340
|
if (edge.width || edge.color) {
|
|
7341
7341
|
const w = edge.width ?? 1;
|
|
7342
7342
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
7343
|
-
const s =
|
|
7343
|
+
const s = chunkVG4NI3RU_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
7344
7344
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
7345
7345
|
}
|
|
7346
7346
|
}
|
|
@@ -7371,7 +7371,7 @@ function cellStyleToCss(style) {
|
|
|
7371
7371
|
css.textShadow = textShadowParts.join(", ");
|
|
7372
7372
|
}
|
|
7373
7373
|
if (style.cell3D) {
|
|
7374
|
-
Object.assign(css,
|
|
7374
|
+
Object.assign(css, chunkVG4NI3RU_js.cell3DBevelCss(style.cell3D));
|
|
7375
7375
|
}
|
|
7376
7376
|
return css;
|
|
7377
7377
|
}
|
|
@@ -7385,7 +7385,7 @@ function TableResizeOverlay({
|
|
|
7385
7385
|
const containerRef = React4.useRef(null);
|
|
7386
7386
|
const [rowBounds, setRowBounds] = React4.useState([]);
|
|
7387
7387
|
const dragRef = React4.useRef(null);
|
|
7388
|
-
const colBoundaries = React4.useMemo(() =>
|
|
7388
|
+
const colBoundaries = React4.useMemo(() => chunkVG4NI3RU_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
7389
7389
|
const measureRows = React4.useCallback(() => {
|
|
7390
7390
|
const container = containerRef.current;
|
|
7391
7391
|
if (!container) {
|
|
@@ -7432,11 +7432,11 @@ function TableResizeOverlay({
|
|
|
7432
7432
|
const rect = containerRef.current.getBoundingClientRect();
|
|
7433
7433
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
7434
7434
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
7435
|
-
onResizeColumns(
|
|
7435
|
+
onResizeColumns(chunkVG4NI3RU_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
7436
7436
|
} else if (drag.type === "row" && onResizeRow) {
|
|
7437
7437
|
const deltaY = e.clientY - drag.startPos;
|
|
7438
|
-
const newHeight =
|
|
7439
|
-
drag.initialRowHeight ??
|
|
7438
|
+
const newHeight = chunkVG4NI3RU_js.computeResizedRowHeight(
|
|
7439
|
+
drag.initialRowHeight ?? chunkVG4NI3RU_js.DEFAULT_ROW_HEIGHT,
|
|
7440
7440
|
deltaY
|
|
7441
7441
|
);
|
|
7442
7442
|
onResizeRow(drag.index, newHeight);
|
|
@@ -7474,7 +7474,7 @@ function TableResizeOverlay({
|
|
|
7474
7474
|
e.stopPropagation();
|
|
7475
7475
|
const table = containerRef.current?.querySelector("table");
|
|
7476
7476
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
7477
|
-
const actualHeight = tr?.offsetHeight ??
|
|
7477
|
+
const actualHeight = tr?.offsetHeight ?? chunkVG4NI3RU_js.DEFAULT_ROW_HEIGHT;
|
|
7478
7478
|
document.body.style.cursor = "row-resize";
|
|
7479
7479
|
document.body.style.userSelect = "none";
|
|
7480
7480
|
dragRef.current = {
|
|
@@ -7522,7 +7522,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
7522
7522
|
}
|
|
7523
7523
|
const first = selectedCell.selectedCells[0];
|
|
7524
7524
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
7525
|
-
return
|
|
7525
|
+
return chunkVG4NI3RU_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
7526
7526
|
})();
|
|
7527
7527
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7528
7528
|
TableResizeOverlay,
|
|
@@ -7555,7 +7555,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
7555
7555
|
return null;
|
|
7556
7556
|
}
|
|
7557
7557
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
7558
|
-
const isInMultiSelection =
|
|
7558
|
+
const isInMultiSelection = chunkVG4NI3RU_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
7559
7559
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
7560
7560
|
const diag = getCellDiagonalBorders2(
|
|
7561
7561
|
cell.style,
|
|
@@ -7585,7 +7585,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
7585
7585
|
}
|
|
7586
7586
|
event.stopPropagation();
|
|
7587
7587
|
if (event.shiftKey && selectedCell) {
|
|
7588
|
-
const rect =
|
|
7588
|
+
const rect = chunkVG4NI3RU_js.computeSelectionRect(
|
|
7589
7589
|
selectedCell.rowIndex,
|
|
7590
7590
|
selectedCell.columnIndex,
|
|
7591
7591
|
rowIndex,
|
|
@@ -7595,7 +7595,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
7595
7595
|
options?.onSelectCell?.({
|
|
7596
7596
|
rowIndex: selectedCell.rowIndex,
|
|
7597
7597
|
columnIndex: selectedCell.columnIndex,
|
|
7598
|
-
selectedCells:
|
|
7598
|
+
selectedCells: chunkVG4NI3RU_js.rectToCells(rect)
|
|
7599
7599
|
});
|
|
7600
7600
|
} else {
|
|
7601
7601
|
options?.onSelectCell?.({
|
|
@@ -7672,7 +7672,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7672
7672
|
}
|
|
7673
7673
|
const first = selectedCell.selectedCells[0];
|
|
7674
7674
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
7675
|
-
return
|
|
7675
|
+
return chunkVG4NI3RU_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
7676
7676
|
})();
|
|
7677
7677
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
7678
7678
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7755,7 +7755,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7755
7755
|
"border px-1 py-0.5 align-top",
|
|
7756
7756
|
isEditable2 && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
7757
7757
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
7758
|
-
|
|
7758
|
+
chunkVG4NI3RU_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
7759
7759
|
),
|
|
7760
7760
|
colSpan,
|
|
7761
7761
|
rowSpan: rSpan,
|
|
@@ -7766,7 +7766,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7766
7766
|
}
|
|
7767
7767
|
event.stopPropagation();
|
|
7768
7768
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
7769
|
-
const rect =
|
|
7769
|
+
const rect = chunkVG4NI3RU_js.computeSelectionRect(
|
|
7770
7770
|
selectedCell.rowIndex,
|
|
7771
7771
|
selectedCell.columnIndex,
|
|
7772
7772
|
rowIndex,
|
|
@@ -7776,7 +7776,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7776
7776
|
options?.onSelectCell?.({
|
|
7777
7777
|
rowIndex: selectedCell.rowIndex,
|
|
7778
7778
|
columnIndex: selectedCell.columnIndex,
|
|
7779
|
-
selectedCells:
|
|
7779
|
+
selectedCells: chunkVG4NI3RU_js.rectToCells(rect)
|
|
7780
7780
|
});
|
|
7781
7781
|
} else {
|
|
7782
7782
|
options?.onSelectCell?.({
|
|
@@ -7831,24 +7831,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7831
7831
|
}
|
|
7832
7832
|
var LEGEND_ITEM_WIDTH = 80;
|
|
7833
7833
|
function partAttrs(part) {
|
|
7834
|
-
return part ?
|
|
7834
|
+
return part ? chunkVG4NI3RU_js.chartPartToAttrs(part) : void 0;
|
|
7835
7835
|
}
|
|
7836
7836
|
function resolveReactPalette(chartData) {
|
|
7837
7837
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
7838
7838
|
return chartData.colorPalette;
|
|
7839
7839
|
}
|
|
7840
|
-
return [...
|
|
7840
|
+
return [...chunkVG4NI3RU_js.getChartStylePalette(chartData.style?.styleId)];
|
|
7841
7841
|
}
|
|
7842
7842
|
function buildReactChartViewModel(element) {
|
|
7843
7843
|
if (element.type !== "chart" || !element.chartData) {
|
|
7844
|
-
return
|
|
7844
|
+
return chunkVG4NI3RU_js.buildChartViewModel(element);
|
|
7845
7845
|
}
|
|
7846
7846
|
const palette = resolveReactPalette(element.chartData);
|
|
7847
7847
|
const themedElement = {
|
|
7848
7848
|
...element,
|
|
7849
7849
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
7850
7850
|
};
|
|
7851
|
-
return
|
|
7851
|
+
return chunkVG4NI3RU_js.buildChartViewModel(themedElement);
|
|
7852
7852
|
}
|
|
7853
7853
|
function renderPrimitive(prim, key) {
|
|
7854
7854
|
switch (prim.kind) {
|
|
@@ -8237,7 +8237,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8237
8237
|
const unmatchedRows = [];
|
|
8238
8238
|
categories.forEach((cat, i) => {
|
|
8239
8239
|
const value = values[i] ?? 0;
|
|
8240
|
-
const code =
|
|
8240
|
+
const code = chunkVG4NI3RU_js.resolveRegionCode(cat);
|
|
8241
8241
|
if (code) {
|
|
8242
8242
|
regionValueMap.set(code, { value, label: cat });
|
|
8243
8243
|
} else {
|
|
@@ -8275,8 +8275,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8275
8275
|
let fill = "#e2e8f0";
|
|
8276
8276
|
let dataLabel = null;
|
|
8277
8277
|
if (entry) {
|
|
8278
|
-
const t =
|
|
8279
|
-
fill =
|
|
8278
|
+
const t = chunkVG4NI3RU_js.normalizeValue(entry.value, minVal, maxVal);
|
|
8279
|
+
fill = chunkVG4NI3RU_js.sequentialColorScale(t);
|
|
8280
8280
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
8281
8281
|
"text",
|
|
8282
8282
|
{
|
|
@@ -8287,7 +8287,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8287
8287
|
fontWeight: 600,
|
|
8288
8288
|
fill: "#1e293b",
|
|
8289
8289
|
style: { pointerEvents: "none" },
|
|
8290
|
-
children:
|
|
8290
|
+
children: chunkVG4NI3RU_js.formatAxisValue(entry.value)
|
|
8291
8291
|
},
|
|
8292
8292
|
`${element.id}-map-dl-${region.code}`
|
|
8293
8293
|
);
|
|
@@ -8305,7 +8305,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8305
8305
|
opacity: 0.9,
|
|
8306
8306
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
8307
8307
|
region.name,
|
|
8308
|
-
entry ? `: ${
|
|
8308
|
+
entry ? `: ${chunkVG4NI3RU_js.formatAxisValue(entry.value)}` : ""
|
|
8309
8309
|
] })
|
|
8310
8310
|
}
|
|
8311
8311
|
),
|
|
@@ -8343,7 +8343,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8343
8343
|
fontSize: 7,
|
|
8344
8344
|
fill: "#64748b",
|
|
8345
8345
|
textAnchor: "middle",
|
|
8346
|
-
children:
|
|
8346
|
+
children: chunkVG4NI3RU_js.formatAxisValue(minVal)
|
|
8347
8347
|
},
|
|
8348
8348
|
`${element.id}-map-legend-min`
|
|
8349
8349
|
),
|
|
@@ -8355,7 +8355,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8355
8355
|
fontSize: 7,
|
|
8356
8356
|
fill: "#64748b",
|
|
8357
8357
|
textAnchor: "middle",
|
|
8358
|
-
children:
|
|
8358
|
+
children: chunkVG4NI3RU_js.formatAxisValue(maxVal)
|
|
8359
8359
|
},
|
|
8360
8360
|
`${element.id}-map-legend-max`
|
|
8361
8361
|
)
|
|
@@ -8421,7 +8421,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8421
8421
|
y,
|
|
8422
8422
|
fontSize,
|
|
8423
8423
|
fill: "#475569",
|
|
8424
|
-
children:
|
|
8424
|
+
children: chunkVG4NI3RU_js.formatAxisValue(row.value)
|
|
8425
8425
|
},
|
|
8426
8426
|
`${element.id}-map-ft-val-${i}`
|
|
8427
8427
|
)
|
|
@@ -8492,7 +8492,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
8492
8492
|
|
|
8493
8493
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
8494
8494
|
function sColor(series, idx) {
|
|
8495
|
-
return
|
|
8495
|
+
return chunkVG4NI3RU_js.seriesColor(series, idx);
|
|
8496
8496
|
}
|
|
8497
8497
|
function valToY(val, range, topY, bottomY) {
|
|
8498
8498
|
const usable = bottomY - topY;
|
|
@@ -9031,7 +9031,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
9031
9031
|
width: 10,
|
|
9032
9032
|
height: 10,
|
|
9033
9033
|
rx: 2,
|
|
9034
|
-
fill:
|
|
9034
|
+
fill: chunkVG4NI3RU_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
9035
9035
|
},
|
|
9036
9036
|
`${id}-leg-r-${i}`
|
|
9037
9037
|
)
|
|
@@ -9055,7 +9055,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
9055
9055
|
width: 10,
|
|
9056
9056
|
height: 10,
|
|
9057
9057
|
rx: 2,
|
|
9058
|
-
fill:
|
|
9058
|
+
fill: chunkVG4NI3RU_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
9059
9059
|
}
|
|
9060
9060
|
),
|
|
9061
9061
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -9068,9 +9068,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
9068
9068
|
}
|
|
9069
9069
|
const lines = [];
|
|
9070
9070
|
if (range.logScale && range.logBase) {
|
|
9071
|
-
const ticks =
|
|
9071
|
+
const ticks = chunkVG4NI3RU_js.generateLogTicks(range);
|
|
9072
9072
|
ticks.forEach((tickVal, i) => {
|
|
9073
|
-
const y =
|
|
9073
|
+
const y = chunkVG4NI3RU_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
9074
9074
|
lines.push(
|
|
9075
9075
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9076
9076
|
"line",
|
|
@@ -9091,7 +9091,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
9091
9091
|
const steps = 4;
|
|
9092
9092
|
for (let i = 0; i <= steps; i++) {
|
|
9093
9093
|
const val = range.min + range.span * i / steps;
|
|
9094
|
-
const y =
|
|
9094
|
+
const y = chunkVG4NI3RU_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
9095
9095
|
lines.push(
|
|
9096
9096
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9097
9097
|
"line",
|
|
@@ -9115,9 +9115,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9115
9115
|
const labels = [];
|
|
9116
9116
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
9117
9117
|
if (range.logScale && range.logBase) {
|
|
9118
|
-
const ticks =
|
|
9118
|
+
const ticks = chunkVG4NI3RU_js.generateLogTicks(range);
|
|
9119
9119
|
ticks.forEach((tickVal, i) => {
|
|
9120
|
-
const y =
|
|
9120
|
+
const y = chunkVG4NI3RU_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
9121
9121
|
labels.push(
|
|
9122
9122
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9123
9123
|
"text",
|
|
@@ -9127,7 +9127,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9127
9127
|
textAnchor: "end",
|
|
9128
9128
|
fontSize: 8,
|
|
9129
9129
|
fill: "#64748b",
|
|
9130
|
-
children: hasDisplayUnits ?
|
|
9130
|
+
children: hasDisplayUnits ? chunkVG4NI3RU_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkVG4NI3RU_js.formatAxisValue(tickVal)
|
|
9131
9131
|
},
|
|
9132
9132
|
`${id}-vaxis-log-${i}`
|
|
9133
9133
|
)
|
|
@@ -9137,7 +9137,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9137
9137
|
const steps = 4;
|
|
9138
9138
|
for (let i = 0; i <= steps; i++) {
|
|
9139
9139
|
const val = range.min + range.span * i / steps;
|
|
9140
|
-
const y =
|
|
9140
|
+
const y = chunkVG4NI3RU_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
9141
9141
|
labels.push(
|
|
9142
9142
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9143
9143
|
"text",
|
|
@@ -9147,7 +9147,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9147
9147
|
textAnchor: "end",
|
|
9148
9148
|
fontSize: 8,
|
|
9149
9149
|
fill: "#64748b",
|
|
9150
|
-
children: hasDisplayUnits ?
|
|
9150
|
+
children: hasDisplayUnits ? chunkVG4NI3RU_js.formatAxisValueWithUnits(val, axisFormatting) : chunkVG4NI3RU_js.formatAxisValue(val)
|
|
9151
9151
|
},
|
|
9152
9152
|
`${id}-vaxis-${i}`
|
|
9153
9153
|
)
|
|
@@ -9155,7 +9155,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9155
9155
|
}
|
|
9156
9156
|
}
|
|
9157
9157
|
if (hasDisplayUnits) {
|
|
9158
|
-
const unitLabel =
|
|
9158
|
+
const unitLabel = chunkVG4NI3RU_js.getDisplayUnitLabel(
|
|
9159
9159
|
axisFormatting.displayUnits,
|
|
9160
9160
|
axisFormatting.displayUnitsLabel
|
|
9161
9161
|
);
|
|
@@ -9230,7 +9230,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
9230
9230
|
if (range.min >= 0) {
|
|
9231
9231
|
return null;
|
|
9232
9232
|
}
|
|
9233
|
-
const y =
|
|
9233
|
+
const y = chunkVG4NI3RU_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
9234
9234
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9235
9235
|
"line",
|
|
9236
9236
|
{
|
|
@@ -9254,7 +9254,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
9254
9254
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
9255
9255
|
for (let i = 0; i <= steps; i++) {
|
|
9256
9256
|
const val = range.min + range.span * i / steps;
|
|
9257
|
-
const y =
|
|
9257
|
+
const y = chunkVG4NI3RU_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
9258
9258
|
labels.push(
|
|
9259
9259
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9260
9260
|
"text",
|
|
@@ -9266,7 +9266,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
9266
9266
|
fontFamily,
|
|
9267
9267
|
fontWeight,
|
|
9268
9268
|
fill: fontColor,
|
|
9269
|
-
children: hasDisplayUnits ?
|
|
9269
|
+
children: hasDisplayUnits ? chunkVG4NI3RU_js.formatAxisValueWithUnits(val, axisFormatting) : chunkVG4NI3RU_js.formatAxisValue(val)
|
|
9270
9270
|
},
|
|
9271
9271
|
`${id}-sec-vaxis-${i}`
|
|
9272
9272
|
)
|
|
@@ -9290,7 +9290,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
9290
9290
|
);
|
|
9291
9291
|
}
|
|
9292
9292
|
if (hasDisplayUnits) {
|
|
9293
|
-
const unitLabel =
|
|
9293
|
+
const unitLabel = chunkVG4NI3RU_js.getDisplayUnitLabel(
|
|
9294
9294
|
axisFormatting.displayUnits,
|
|
9295
9295
|
axisFormatting.displayUnitsLabel
|
|
9296
9296
|
);
|
|
@@ -9321,7 +9321,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
9321
9321
|
const ticks = [];
|
|
9322
9322
|
for (let i = 0; i <= steps; i++) {
|
|
9323
9323
|
const val = range.min + range.span * i / steps;
|
|
9324
|
-
const y =
|
|
9324
|
+
const y = chunkVG4NI3RU_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
9325
9325
|
ticks.push(
|
|
9326
9326
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9327
9327
|
"line",
|
|
@@ -9348,7 +9348,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
9348
9348
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
9349
9349
|
for (let i = 0; i <= steps; i++) {
|
|
9350
9350
|
const val = range.min + range.span * i / steps;
|
|
9351
|
-
const y =
|
|
9351
|
+
const y = chunkVG4NI3RU_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
9352
9352
|
lines.push(
|
|
9353
9353
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9354
9354
|
"line",
|
|
@@ -9510,7 +9510,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
9510
9510
|
width: 8,
|
|
9511
9511
|
height: 8,
|
|
9512
9512
|
borderRadius: 2,
|
|
9513
|
-
backgroundColor:
|
|
9513
|
+
backgroundColor: chunkVG4NI3RU_js.seriesColor(
|
|
9514
9514
|
s,
|
|
9515
9515
|
si,
|
|
9516
9516
|
chartData.style?.styleId,
|
|
@@ -9549,8 +9549,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
9549
9549
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
9550
9550
|
const style = chartData.style;
|
|
9551
9551
|
const legendPos = style?.legendPosition || "b";
|
|
9552
|
-
const range =
|
|
9553
|
-
const layout =
|
|
9552
|
+
const range = chunkVG4NI3RU_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
9553
|
+
const layout = chunkVG4NI3RU_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
9554
9554
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
9555
9555
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
9556
9556
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -9571,10 +9571,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
9571
9571
|
const close = closeSeries.values[ci] ?? high;
|
|
9572
9572
|
const isUp = close >= open;
|
|
9573
9573
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
9574
|
-
const highY =
|
|
9575
|
-
const lowY =
|
|
9576
|
-
const openY =
|
|
9577
|
-
const closeY =
|
|
9574
|
+
const highY = chunkVG4NI3RU_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
9575
|
+
const lowY = chunkVG4NI3RU_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
9576
|
+
const openY = chunkVG4NI3RU_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
9577
|
+
const closeY = chunkVG4NI3RU_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
9578
9578
|
elements.push(
|
|
9579
9579
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9580
9580
|
"line",
|
|
@@ -9617,7 +9617,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
9617
9617
|
textAnchor: "middle",
|
|
9618
9618
|
fontSize: 7,
|
|
9619
9619
|
fill: "#334155",
|
|
9620
|
-
children:
|
|
9620
|
+
children: chunkVG4NI3RU_js.formatAxisValue(close)
|
|
9621
9621
|
},
|
|
9622
9622
|
`${element.id}-stock-dl-${ci}`
|
|
9623
9623
|
)
|
|
@@ -9659,7 +9659,7 @@ function FailedToLoad() {
|
|
|
9659
9659
|
var LazySurfaceChart3DScene = React4__default.default.lazy(
|
|
9660
9660
|
async () => {
|
|
9661
9661
|
try {
|
|
9662
|
-
return await import('./SurfaceChart3DScene-
|
|
9662
|
+
return await import('./SurfaceChart3DScene-NS446YLK.js');
|
|
9663
9663
|
} catch {
|
|
9664
9664
|
return { default: FailedToLoad };
|
|
9665
9665
|
}
|
|
@@ -9683,7 +9683,7 @@ var SurfaceChart3DErrorBoundary = class extends React4__default.default.Componen
|
|
|
9683
9683
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
9684
9684
|
const rows = chartData.series.length;
|
|
9685
9685
|
const cols = Math.max(categoryLabels.length, 1);
|
|
9686
|
-
const range =
|
|
9686
|
+
const range = chunkVG4NI3RU_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
9687
9687
|
const heightMap = new Float32Array(rows * cols);
|
|
9688
9688
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
9689
9689
|
for (let r = 0; r < rows; r++) {
|
|
@@ -9803,8 +9803,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
9803
9803
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
9804
9804
|
const style = chartData.style;
|
|
9805
9805
|
const legendPos = style?.legendPosition || "b";
|
|
9806
|
-
const layout =
|
|
9807
|
-
const range =
|
|
9806
|
+
const layout = chunkVG4NI3RU_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
9807
|
+
const range = chunkVG4NI3RU_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
9808
9808
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
9809
9809
|
const seriesCount = chartData.series.length;
|
|
9810
9810
|
const cols = catCount - 1;
|
|
@@ -9894,8 +9894,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
9894
9894
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
9895
9895
|
const style = chartData.style;
|
|
9896
9896
|
const legendPos = style?.legendPosition || "b";
|
|
9897
|
-
const layout =
|
|
9898
|
-
const range =
|
|
9897
|
+
const layout = chunkVG4NI3RU_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
9898
|
+
const range = chunkVG4NI3RU_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
9899
9899
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
9900
9900
|
const seriesCount = chartData.series.length;
|
|
9901
9901
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -9958,7 +9958,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
9958
9958
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
9959
9959
|
const style = chartData.style;
|
|
9960
9960
|
const legendPos = style?.legendPosition || "b";
|
|
9961
|
-
const layout =
|
|
9961
|
+
const layout = chunkVG4NI3RU_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
9962
9962
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
9963
9963
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
9964
9964
|
const rects = [];
|
|
@@ -9981,7 +9981,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
9981
9981
|
y: curY,
|
|
9982
9982
|
width: Math.max(w - 1, 1),
|
|
9983
9983
|
height: Math.max(h - 1, 1),
|
|
9984
|
-
fill:
|
|
9984
|
+
fill: chunkVG4NI3RU_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
9985
9985
|
rx: 2,
|
|
9986
9986
|
opacity: 0.85
|
|
9987
9987
|
},
|
|
@@ -10034,8 +10034,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
10034
10034
|
const style = chartData.style;
|
|
10035
10035
|
const legendPos = style?.legendPosition || "b";
|
|
10036
10036
|
const values = chartData.series[0]?.values ?? [];
|
|
10037
|
-
const range =
|
|
10038
|
-
const layout =
|
|
10037
|
+
const range = chunkVG4NI3RU_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
10038
|
+
const layout = chunkVG4NI3RU_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
10039
10039
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
10040
10040
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
10041
10041
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -10046,8 +10046,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
10046
10046
|
const isLast = i === values.length - 1;
|
|
10047
10047
|
const startVal = isLast ? 0 : runningTotal;
|
|
10048
10048
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
10049
|
-
const barStartY =
|
|
10050
|
-
const barEndY =
|
|
10049
|
+
const barStartY = chunkVG4NI3RU_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
10050
|
+
const barEndY = chunkVG4NI3RU_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
10051
10051
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
10052
10052
|
const y = Math.min(barStartY, barEndY);
|
|
10053
10053
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -10076,7 +10076,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
10076
10076
|
textAnchor: "middle",
|
|
10077
10077
|
fontSize: 7,
|
|
10078
10078
|
fill: "#334155",
|
|
10079
|
-
children:
|
|
10079
|
+
children: chunkVG4NI3RU_js.formatAxisValue(isLast ? endVal : val)
|
|
10080
10080
|
},
|
|
10081
10081
|
`${element.id}-wf-dl-${i}`
|
|
10082
10082
|
)
|
|
@@ -10124,18 +10124,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
10124
10124
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
10125
10125
|
const style = chartData.style;
|
|
10126
10126
|
const legendPos = style?.legendPosition || "b";
|
|
10127
|
-
const layoutOpts =
|
|
10127
|
+
const layoutOpts = chunkVG4NI3RU_js.computeLayoutOptions(
|
|
10128
10128
|
chartData.axes,
|
|
10129
10129
|
chartData.dataTable,
|
|
10130
10130
|
chartData.series.length
|
|
10131
10131
|
);
|
|
10132
|
-
const layout =
|
|
10133
|
-
const { primary, secondary } =
|
|
10132
|
+
const layout = chunkVG4NI3RU_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
10133
|
+
const { primary, secondary } = chunkVG4NI3RU_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
10134
10134
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
10135
10135
|
const secondarySeries = secondary.map((e) => e.series);
|
|
10136
|
-
const range =
|
|
10137
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
10138
|
-
const secondaryAxisFmt =
|
|
10136
|
+
const range = chunkVG4NI3RU_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
10137
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkVG4NI3RU_js.computeValueRange(secondarySeries) : void 0;
|
|
10138
|
+
const secondaryAxisFmt = chunkVG4NI3RU_js.getSecondaryValueAxis(chartData.axes);
|
|
10139
10139
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
10140
10140
|
const barSeriesCount = 1;
|
|
10141
10141
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -10151,8 +10151,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10151
10151
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
10152
10152
|
barSeries.values.forEach((val, vi) => {
|
|
10153
10153
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
10154
|
-
const zeroY =
|
|
10155
|
-
const valY =
|
|
10154
|
+
const zeroY = chunkVG4NI3RU_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
10155
|
+
const valY = chunkVG4NI3RU_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
10156
10156
|
const y = Math.min(zeroY, valY);
|
|
10157
10157
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
10158
10158
|
barElements.push(
|
|
@@ -10163,7 +10163,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10163
10163
|
y,
|
|
10164
10164
|
width: barWidth,
|
|
10165
10165
|
height: h,
|
|
10166
|
-
fill:
|
|
10166
|
+
fill: chunkVG4NI3RU_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
10167
10167
|
rx: 1
|
|
10168
10168
|
},
|
|
10169
10169
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -10179,7 +10179,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10179
10179
|
textAnchor: "middle",
|
|
10180
10180
|
fontSize: 7,
|
|
10181
10181
|
fill: "#334155",
|
|
10182
|
-
children:
|
|
10182
|
+
children: chunkVG4NI3RU_js.formatAxisValue(val)
|
|
10183
10183
|
},
|
|
10184
10184
|
`${element.id}-combo-bar-dl-${vi}`
|
|
10185
10185
|
)
|
|
@@ -10196,10 +10196,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10196
10196
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
10197
10197
|
const points = series.values.map((val, vi) => {
|
|
10198
10198
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
10199
|
-
const y =
|
|
10199
|
+
const y = chunkVG4NI3RU_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
10200
10200
|
return { x, y, val };
|
|
10201
10201
|
});
|
|
10202
|
-
const c =
|
|
10202
|
+
const c = chunkVG4NI3RU_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
10203
10203
|
lineElements.push(
|
|
10204
10204
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10205
10205
|
"polyline",
|
|
@@ -10226,7 +10226,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10226
10226
|
textAnchor: "middle",
|
|
10227
10227
|
fontSize: 7,
|
|
10228
10228
|
fill: "#334155",
|
|
10229
|
-
children:
|
|
10229
|
+
children: chunkVG4NI3RU_js.formatAxisValue(p.val)
|
|
10230
10230
|
},
|
|
10231
10231
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
10232
10232
|
)
|
|
@@ -12037,14 +12037,14 @@ function buildNotesPdf(pages) {
|
|
|
12037
12037
|
notes: page.notes,
|
|
12038
12038
|
slideNumber: page.slideNumber
|
|
12039
12039
|
}));
|
|
12040
|
-
const bytes =
|
|
12040
|
+
const bytes = chunkVG4NI3RU_js.buildNotesPdfBytes(images, meta);
|
|
12041
12041
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
12042
12042
|
return URL.createObjectURL(blob);
|
|
12043
12043
|
}
|
|
12044
12044
|
|
|
12045
12045
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
12046
12046
|
function buildPdfFromImageData(images) {
|
|
12047
|
-
const bytes =
|
|
12047
|
+
const bytes = chunkVG4NI3RU_js.buildSlidesPdfBytes(images);
|
|
12048
12048
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
12049
12049
|
return URL.createObjectURL(blob);
|
|
12050
12050
|
}
|
|
@@ -12053,7 +12053,7 @@ function buildPdfFromImageData(images) {
|
|
|
12053
12053
|
var activePreview = null;
|
|
12054
12054
|
function startPreviewAnimation(elementId, preset, options) {
|
|
12055
12055
|
stopPreviewAnimation();
|
|
12056
|
-
const descriptor =
|
|
12056
|
+
const descriptor = chunkVG4NI3RU_js.buildPreviewAnimation(preset, options);
|
|
12057
12057
|
if (!descriptor) {
|
|
12058
12058
|
return;
|
|
12059
12059
|
}
|
|
@@ -12131,7 +12131,7 @@ function useElementOperations(input) {
|
|
|
12131
12131
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
12132
12132
|
const updateElementById = React4.useCallback(
|
|
12133
12133
|
(elementId, updates) => {
|
|
12134
|
-
if (
|
|
12134
|
+
if (chunkVG4NI3RU_js.isTemplateElementId(elementId)) {
|
|
12135
12135
|
const slideId = activeSlide?.id;
|
|
12136
12136
|
if (slideId) {
|
|
12137
12137
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -12171,7 +12171,7 @@ function useElementOperations(input) {
|
|
|
12171
12171
|
);
|
|
12172
12172
|
const updateSelectedShapeStyle = React4.useCallback(
|
|
12173
12173
|
(updates) => {
|
|
12174
|
-
if (!selectedElement || !
|
|
12174
|
+
if (!selectedElement || !chunkXRZ2U7KL_js.hasShapeProperties(selectedElement)) {
|
|
12175
12175
|
return;
|
|
12176
12176
|
}
|
|
12177
12177
|
updateSelectedElement({
|
|
@@ -12182,17 +12182,17 @@ function useElementOperations(input) {
|
|
|
12182
12182
|
);
|
|
12183
12183
|
const updateSelectedTextStyle = React4.useCallback(
|
|
12184
12184
|
(updates) => {
|
|
12185
|
-
if (!selectedElement || !
|
|
12185
|
+
if (!selectedElement || !chunkXRZ2U7KL_js.hasTextProperties(selectedElement)) {
|
|
12186
12186
|
return;
|
|
12187
12187
|
}
|
|
12188
|
-
const inlineSel =
|
|
12188
|
+
const inlineSel = chunkVG4NI3RU_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
12189
12189
|
if (inlineSel && selectedElement.textSegments) {
|
|
12190
|
-
const { newSegments: newSegments2, newSelection } =
|
|
12190
|
+
const { newSegments: newSegments2, newSelection } = chunkVG4NI3RU_js.applyStyleToSelectedSegments(
|
|
12191
12191
|
selectedElement.textSegments,
|
|
12192
12192
|
inlineSel,
|
|
12193
12193
|
updates
|
|
12194
12194
|
);
|
|
12195
|
-
|
|
12195
|
+
chunkVG4NI3RU_js.setPendingSelectionRestore(newSelection);
|
|
12196
12196
|
updateSelectedElement({
|
|
12197
12197
|
textSegments: newSegments2
|
|
12198
12198
|
});
|
|
@@ -12212,12 +12212,12 @@ function useElementOperations(input) {
|
|
|
12212
12212
|
);
|
|
12213
12213
|
const updateSelectedTextCase = React4.useCallback(
|
|
12214
12214
|
(mode) => {
|
|
12215
|
-
if (!selectedElement || !
|
|
12215
|
+
if (!selectedElement || !chunkXRZ2U7KL_js.hasTextProperties(selectedElement)) {
|
|
12216
12216
|
return;
|
|
12217
12217
|
}
|
|
12218
|
-
const inlineSel =
|
|
12218
|
+
const inlineSel = chunkVG4NI3RU_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
12219
12219
|
if (inlineSel && selectedElement.textSegments) {
|
|
12220
|
-
const newSegments =
|
|
12220
|
+
const newSegments = chunkVG4NI3RU_js.applyCaseTransformToSegments(
|
|
12221
12221
|
selectedElement.textSegments,
|
|
12222
12222
|
inlineSel,
|
|
12223
12223
|
mode
|
|
@@ -12227,14 +12227,14 @@ function useElementOperations(input) {
|
|
|
12227
12227
|
}
|
|
12228
12228
|
const updates = {};
|
|
12229
12229
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
12230
|
-
updates.textSegments =
|
|
12230
|
+
updates.textSegments = chunkVG4NI3RU_js.applyCaseTransformToSegments(
|
|
12231
12231
|
selectedElement.textSegments,
|
|
12232
12232
|
null,
|
|
12233
12233
|
mode
|
|
12234
12234
|
);
|
|
12235
12235
|
}
|
|
12236
12236
|
if (typeof selectedElement.text === "string") {
|
|
12237
|
-
updates.text =
|
|
12237
|
+
updates.text = chunkVG4NI3RU_js.transformTextCase(selectedElement.text, mode);
|
|
12238
12238
|
}
|
|
12239
12239
|
updateSelectedElement(updates);
|
|
12240
12240
|
},
|
|
@@ -12289,7 +12289,7 @@ function useSectionOperations(input) {
|
|
|
12289
12289
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
12290
12290
|
const addSection2 = React4.useCallback(
|
|
12291
12291
|
(name, afterSlideIndex) => {
|
|
12292
|
-
const result =
|
|
12292
|
+
const result = chunkVG4NI3RU_js.addSection(sections, slides, name, afterSlideIndex);
|
|
12293
12293
|
setSlides(result.slides);
|
|
12294
12294
|
setSections(result.sections);
|
|
12295
12295
|
markDirty();
|
|
@@ -12298,7 +12298,7 @@ function useSectionOperations(input) {
|
|
|
12298
12298
|
);
|
|
12299
12299
|
const renameSection2 = React4.useCallback(
|
|
12300
12300
|
(sectionId, newName) => {
|
|
12301
|
-
const result =
|
|
12301
|
+
const result = chunkVG4NI3RU_js.renameSection(sections, slides, sectionId, newName);
|
|
12302
12302
|
setSections(result.sections);
|
|
12303
12303
|
setSlides(result.slides);
|
|
12304
12304
|
markDirty();
|
|
@@ -12307,7 +12307,7 @@ function useSectionOperations(input) {
|
|
|
12307
12307
|
);
|
|
12308
12308
|
const deleteSection2 = React4.useCallback(
|
|
12309
12309
|
(sectionId) => {
|
|
12310
|
-
const result =
|
|
12310
|
+
const result = chunkVG4NI3RU_js.deleteSection(sections, slides, sectionId);
|
|
12311
12311
|
setSections(result.sections);
|
|
12312
12312
|
setSlides(result.slides);
|
|
12313
12313
|
markDirty();
|
|
@@ -12316,21 +12316,21 @@ function useSectionOperations(input) {
|
|
|
12316
12316
|
);
|
|
12317
12317
|
const moveSectionUp2 = React4.useCallback(
|
|
12318
12318
|
(sectionId) => {
|
|
12319
|
-
setSections(
|
|
12319
|
+
setSections(chunkVG4NI3RU_js.moveSectionUp(sections, sectionId));
|
|
12320
12320
|
markDirty();
|
|
12321
12321
|
},
|
|
12322
12322
|
[sections, setSections, markDirty]
|
|
12323
12323
|
);
|
|
12324
12324
|
const moveSectionDown2 = React4.useCallback(
|
|
12325
12325
|
(sectionId) => {
|
|
12326
|
-
setSections(
|
|
12326
|
+
setSections(chunkVG4NI3RU_js.moveSectionDown(sections, sectionId));
|
|
12327
12327
|
markDirty();
|
|
12328
12328
|
},
|
|
12329
12329
|
[sections, setSections, markDirty]
|
|
12330
12330
|
);
|
|
12331
12331
|
const moveSlidesToSection2 = React4.useCallback(
|
|
12332
12332
|
(slideIndexes, targetSectionId) => {
|
|
12333
|
-
const result =
|
|
12333
|
+
const result = chunkVG4NI3RU_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
12334
12334
|
setSlides(result.slides);
|
|
12335
12335
|
setSections(result.sections);
|
|
12336
12336
|
markDirty();
|
|
@@ -12349,7 +12349,7 @@ function useSectionOperations(input) {
|
|
|
12349
12349
|
|
|
12350
12350
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
12351
12351
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
12352
|
-
const resized =
|
|
12352
|
+
const resized = chunkVG4NI3RU_js.applyResize(
|
|
12353
12353
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
12354
12354
|
handle,
|
|
12355
12355
|
dx,
|
|
@@ -12361,7 +12361,7 @@ function computeResizeGeometry(handle, startX, startY, startWidth, startHeight,
|
|
|
12361
12361
|
if (!snapToGrid) {
|
|
12362
12362
|
return box;
|
|
12363
12363
|
}
|
|
12364
|
-
return
|
|
12364
|
+
return chunkVG4NI3RU_js.snapBoxToGrid(box, handle, gridSpacingPx, MIN_ELEMENT_SIZE);
|
|
12365
12365
|
}
|
|
12366
12366
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
12367
12367
|
const range = startWidth || 200;
|
|
@@ -12471,7 +12471,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
12471
12471
|
width: el.width,
|
|
12472
12472
|
height: el.height
|
|
12473
12473
|
}));
|
|
12474
|
-
const snapResult =
|
|
12474
|
+
const snapResult = chunkVG4NI3RU_js.computeSnapToShape(
|
|
12475
12475
|
targetX,
|
|
12476
12476
|
targetY,
|
|
12477
12477
|
primaryEl.width,
|
|
@@ -12614,13 +12614,13 @@ function processPointerUp(input) {
|
|
|
12614
12614
|
if (i !== activeSlideIndex) {
|
|
12615
12615
|
return s;
|
|
12616
12616
|
}
|
|
12617
|
-
const rerouted =
|
|
12617
|
+
const rerouted = chunkVG4NI3RU_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
12618
12618
|
if (rerouted.length === 0) {
|
|
12619
12619
|
return s;
|
|
12620
12620
|
}
|
|
12621
12621
|
return {
|
|
12622
12622
|
...s,
|
|
12623
|
-
elements:
|
|
12623
|
+
elements: chunkVG4NI3RU_js.applyReroutedConnectors(s.elements, rerouted)
|
|
12624
12624
|
};
|
|
12625
12625
|
})
|
|
12626
12626
|
);
|
|
@@ -12639,9 +12639,9 @@ function processPointerUp(input) {
|
|
|
12639
12639
|
}
|
|
12640
12640
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
12641
12641
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
12642
|
-
const hitIds =
|
|
12642
|
+
const hitIds = chunkVG4NI3RU_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
12643
12643
|
if (marquee.additive) {
|
|
12644
|
-
const merged =
|
|
12644
|
+
const merged = chunkVG4NI3RU_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
12645
12645
|
if (merged.length > 0) {
|
|
12646
12646
|
applySelection(merged[0], merged);
|
|
12647
12647
|
} else {
|
|
@@ -12664,8 +12664,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
12664
12664
|
}
|
|
12665
12665
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
12666
12666
|
});
|
|
12667
|
-
const rerouted =
|
|
12668
|
-
return
|
|
12667
|
+
const rerouted = chunkVG4NI3RU_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
12668
|
+
return chunkVG4NI3RU_js.applyReroutedConnectors(movedElements, rerouted);
|
|
12669
12669
|
};
|
|
12670
12670
|
if (editTemplateMode) {
|
|
12671
12671
|
const slideId = activeSlide?.id;
|
|
@@ -12816,9 +12816,9 @@ function useCanvasInteractions(input) {
|
|
|
12816
12816
|
return;
|
|
12817
12817
|
}
|
|
12818
12818
|
const el = elementLookup.get(editId);
|
|
12819
|
-
if (el &&
|
|
12819
|
+
if (el && chunkXRZ2U7KL_js.hasTextProperties(el)) {
|
|
12820
12820
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
12821
|
-
const newSegments =
|
|
12821
|
+
const newSegments = chunkVG4NI3RU_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
12822
12822
|
ops.updateElementById(editId, {
|
|
12823
12823
|
text: committedText,
|
|
12824
12824
|
textSegments: newSegments
|
|
@@ -12829,7 +12829,7 @@ function useCanvasInteractions(input) {
|
|
|
12829
12829
|
setInlineEditingText("");
|
|
12830
12830
|
};
|
|
12831
12831
|
const openEquationEditorForElement = (el) => {
|
|
12832
|
-
if (!
|
|
12832
|
+
if (!chunkXRZ2U7KL_js.hasTextProperties(el)) {
|
|
12833
12833
|
return false;
|
|
12834
12834
|
}
|
|
12835
12835
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -12858,7 +12858,7 @@ function useCanvasInteractions(input) {
|
|
|
12858
12858
|
justSelectedRef.current = false;
|
|
12859
12859
|
} else {
|
|
12860
12860
|
const el = elementLookup.get(elementId);
|
|
12861
|
-
if (el &&
|
|
12861
|
+
if (el && chunkXRZ2U7KL_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
12862
12862
|
if (!openEquationEditorForElement(el)) {
|
|
12863
12863
|
setInlineEditingElementId(elementId);
|
|
12864
12864
|
setInlineEditingText(el.text ?? "");
|
|
@@ -12877,7 +12877,7 @@ function useCanvasInteractions(input) {
|
|
|
12877
12877
|
if (openEquationEditorForElement(el)) {
|
|
12878
12878
|
return;
|
|
12879
12879
|
}
|
|
12880
|
-
if (
|
|
12880
|
+
if (chunkXRZ2U7KL_js.hasTextProperties(el)) {
|
|
12881
12881
|
setInlineEditingElementId(elementId);
|
|
12882
12882
|
setInlineEditingText(el.text ?? "");
|
|
12883
12883
|
}
|
|
@@ -13067,7 +13067,7 @@ function createFileHandlers(deps) {
|
|
|
13067
13067
|
h = Math.round(h * scale);
|
|
13068
13068
|
}
|
|
13069
13069
|
addElement({
|
|
13070
|
-
id:
|
|
13070
|
+
id: chunkVG4NI3RU_js.generateElementId(),
|
|
13071
13071
|
type: "image",
|
|
13072
13072
|
x: Math.round((canvasSize.width - w) / 2),
|
|
13073
13073
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -13078,7 +13078,7 @@ function createFileHandlers(deps) {
|
|
|
13078
13078
|
};
|
|
13079
13079
|
img.onerror = () => {
|
|
13080
13080
|
addElement({
|
|
13081
|
-
id:
|
|
13081
|
+
id: chunkVG4NI3RU_js.generateElementId(),
|
|
13082
13082
|
type: "image",
|
|
13083
13083
|
x: 100,
|
|
13084
13084
|
y: 100,
|
|
@@ -13104,7 +13104,7 @@ function createFileHandlers(deps) {
|
|
|
13104
13104
|
const elFilePath = file.path;
|
|
13105
13105
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
13106
13106
|
addElement({
|
|
13107
|
-
id:
|
|
13107
|
+
id: chunkVG4NI3RU_js.generateElementId(),
|
|
13108
13108
|
type: "media",
|
|
13109
13109
|
mediaType,
|
|
13110
13110
|
mediaMimeType: file.type || void 0,
|
|
@@ -13279,13 +13279,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
13279
13279
|
return;
|
|
13280
13280
|
}
|
|
13281
13281
|
addElement({
|
|
13282
|
-
id:
|
|
13282
|
+
id: chunkVG4NI3RU_js.generateElementId(),
|
|
13283
13283
|
type: "smartArt",
|
|
13284
13284
|
x: 100,
|
|
13285
13285
|
y: 120,
|
|
13286
13286
|
width: 600,
|
|
13287
13287
|
height: 340,
|
|
13288
|
-
smartArtData:
|
|
13288
|
+
smartArtData: chunkVG4NI3RU_js.buildSmartArtPresetData(
|
|
13289
13289
|
layout,
|
|
13290
13290
|
defaultItems,
|
|
13291
13291
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -13297,7 +13297,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
13297
13297
|
return;
|
|
13298
13298
|
}
|
|
13299
13299
|
addElement({
|
|
13300
|
-
id:
|
|
13300
|
+
id: chunkVG4NI3RU_js.generateElementId(),
|
|
13301
13301
|
type: "shape",
|
|
13302
13302
|
x: 120,
|
|
13303
13303
|
y: 200,
|
|
@@ -13356,7 +13356,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
13356
13356
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
13357
13357
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
13358
13358
|
addElement({
|
|
13359
|
-
id:
|
|
13359
|
+
id: chunkVG4NI3RU_js.generateElementId(),
|
|
13360
13360
|
type: "shape",
|
|
13361
13361
|
x: 120,
|
|
13362
13362
|
y: 200,
|
|
@@ -13378,11 +13378,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
13378
13378
|
if (!activeSlide) {
|
|
13379
13379
|
return;
|
|
13380
13380
|
}
|
|
13381
|
-
const preset =
|
|
13381
|
+
const preset = chunkVG4NI3RU_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
13382
13382
|
if (!preset) {
|
|
13383
13383
|
return;
|
|
13384
13384
|
}
|
|
13385
|
-
const defaultPptxAction =
|
|
13385
|
+
const defaultPptxAction = chunkXRZ2U7KL_js.elementActionToPptxAction({
|
|
13386
13386
|
trigger: "click",
|
|
13387
13387
|
type: preset.defaultAction
|
|
13388
13388
|
});
|
|
@@ -13391,7 +13391,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
13391
13391
|
defaultPptxAction.highlightClick = true;
|
|
13392
13392
|
}
|
|
13393
13393
|
addElement({
|
|
13394
|
-
id:
|
|
13394
|
+
id: chunkVG4NI3RU_js.generateElementId(),
|
|
13395
13395
|
type: "shape",
|
|
13396
13396
|
x: 150,
|
|
13397
13397
|
y: 150,
|
|
@@ -13458,7 +13458,7 @@ function useInsertElements(input) {
|
|
|
13458
13458
|
return;
|
|
13459
13459
|
}
|
|
13460
13460
|
addElement({
|
|
13461
|
-
id:
|
|
13461
|
+
id: chunkVG4NI3RU_js.generateElementId(),
|
|
13462
13462
|
type: "text",
|
|
13463
13463
|
x: 100,
|
|
13464
13464
|
y: 100,
|
|
@@ -13473,7 +13473,7 @@ function useInsertElements(input) {
|
|
|
13473
13473
|
return;
|
|
13474
13474
|
}
|
|
13475
13475
|
addElement({
|
|
13476
|
-
id:
|
|
13476
|
+
id: chunkVG4NI3RU_js.generateElementId(),
|
|
13477
13477
|
type: "shape",
|
|
13478
13478
|
x: 150,
|
|
13479
13479
|
y: 150,
|
|
@@ -13492,15 +13492,15 @@ function useInsertElements(input) {
|
|
|
13492
13492
|
return;
|
|
13493
13493
|
}
|
|
13494
13494
|
addElement({
|
|
13495
|
-
...
|
|
13496
|
-
id:
|
|
13495
|
+
...chunkVG4NI3RU_js.newTableElement(DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
13496
|
+
id: chunkVG4NI3RU_js.generateElementId()
|
|
13497
13497
|
});
|
|
13498
13498
|
};
|
|
13499
13499
|
const handleAddChart = (chartType) => {
|
|
13500
13500
|
if (!activeSlide) {
|
|
13501
13501
|
return;
|
|
13502
13502
|
}
|
|
13503
|
-
addElement(
|
|
13503
|
+
addElement(chunkVG4NI3RU_js.createDefaultChartElement(chartType));
|
|
13504
13504
|
};
|
|
13505
13505
|
const structured = createStructuredElementHandlers({
|
|
13506
13506
|
activeSlide,
|
|
@@ -13570,7 +13570,7 @@ function useClipboardHandlers(input) {
|
|
|
13570
13570
|
if (!selectedElement) {
|
|
13571
13571
|
return;
|
|
13572
13572
|
}
|
|
13573
|
-
setClipboardPayload(
|
|
13573
|
+
setClipboardPayload(chunkVG4NI3RU_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
13574
13574
|
};
|
|
13575
13575
|
const handleDelete = () => {
|
|
13576
13576
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -13587,7 +13587,7 @@ function useClipboardHandlers(input) {
|
|
|
13587
13587
|
handleDelete();
|
|
13588
13588
|
};
|
|
13589
13589
|
const insertClone = (source) => {
|
|
13590
|
-
const clone =
|
|
13590
|
+
const clone = chunkVG4NI3RU_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
13591
13591
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
13592
13592
|
ops.applySelection(clone.id);
|
|
13593
13593
|
history.markDirty();
|
|
@@ -13622,7 +13622,7 @@ function resolveShapePath(el) {
|
|
|
13622
13622
|
return el.pathData;
|
|
13623
13623
|
}
|
|
13624
13624
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
13625
|
-
const clipPath =
|
|
13625
|
+
const clipPath = chunkXRZ2U7KL_js.getPresetShapeClipPath(el.shapeType);
|
|
13626
13626
|
if (clipPath) {
|
|
13627
13627
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
13628
13628
|
if (svgPath) {
|
|
@@ -13673,7 +13673,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
13673
13673
|
return parts.join(" ");
|
|
13674
13674
|
}
|
|
13675
13675
|
function transformPathToGlobal(pathData, el) {
|
|
13676
|
-
const polys =
|
|
13676
|
+
const polys = chunkXRZ2U7KL_js.svgPathToPolygons(pathData);
|
|
13677
13677
|
if (polys.length === 0) {
|
|
13678
13678
|
return pathData;
|
|
13679
13679
|
}
|
|
@@ -13693,10 +13693,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
13693
13693
|
y: pt.y * scaleY + el.y
|
|
13694
13694
|
}))
|
|
13695
13695
|
);
|
|
13696
|
-
return
|
|
13696
|
+
return chunkXRZ2U7KL_js.polygonsToSvgPath(transformed);
|
|
13697
13697
|
}
|
|
13698
13698
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
13699
|
-
const polys =
|
|
13699
|
+
const polys = chunkXRZ2U7KL_js.svgPathToPolygons(pathData);
|
|
13700
13700
|
if (polys.length === 0) {
|
|
13701
13701
|
return pathData;
|
|
13702
13702
|
}
|
|
@@ -13706,10 +13706,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
13706
13706
|
y: pt.y - y
|
|
13707
13707
|
}))
|
|
13708
13708
|
);
|
|
13709
|
-
return
|
|
13709
|
+
return chunkXRZ2U7KL_js.polygonsToSvgPath(transformed);
|
|
13710
13710
|
}
|
|
13711
13711
|
function pathBounds(pathData) {
|
|
13712
|
-
const polys =
|
|
13712
|
+
const polys = chunkXRZ2U7KL_js.svgPathToPolygons(pathData);
|
|
13713
13713
|
let minX = Infinity;
|
|
13714
13714
|
let minY = Infinity;
|
|
13715
13715
|
let maxX = -Infinity;
|
|
@@ -13768,7 +13768,7 @@ function useMergeShapesHandler(input) {
|
|
|
13768
13768
|
let allFragments = [];
|
|
13769
13769
|
let remaining = globalPaths[0];
|
|
13770
13770
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
13771
|
-
const frags =
|
|
13771
|
+
const frags = chunkXRZ2U7KL_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
13772
13772
|
if (Array.isArray(frags)) {
|
|
13773
13773
|
allFragments = frags;
|
|
13774
13774
|
}
|
|
@@ -13797,7 +13797,7 @@ function useMergeShapesHandler(input) {
|
|
|
13797
13797
|
bounds.height
|
|
13798
13798
|
);
|
|
13799
13799
|
const newEl = {
|
|
13800
|
-
id:
|
|
13800
|
+
id: chunkVG4NI3RU_js.generateElementId(),
|
|
13801
13801
|
type: "shape",
|
|
13802
13802
|
x: bounds.x,
|
|
13803
13803
|
y: bounds.y,
|
|
@@ -13835,7 +13835,7 @@ function useMergeShapesHandler(input) {
|
|
|
13835
13835
|
} else {
|
|
13836
13836
|
let resultPath = globalPaths[0];
|
|
13837
13837
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
13838
|
-
const result =
|
|
13838
|
+
const result = chunkXRZ2U7KL_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
13839
13839
|
if (typeof result === "string") {
|
|
13840
13840
|
resultPath = result;
|
|
13841
13841
|
}
|
|
@@ -13856,7 +13856,7 @@ function useMergeShapesHandler(input) {
|
|
|
13856
13856
|
);
|
|
13857
13857
|
const primary = targets[0];
|
|
13858
13858
|
const newEl = {
|
|
13859
|
-
id:
|
|
13859
|
+
id: chunkVG4NI3RU_js.generateElementId(),
|
|
13860
13860
|
type: "shape",
|
|
13861
13861
|
x: bounds.x,
|
|
13862
13862
|
y: bounds.y,
|
|
@@ -13919,7 +13919,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13919
13919
|
if (ids.length < 2 || !activeSlide) {
|
|
13920
13920
|
return;
|
|
13921
13921
|
}
|
|
13922
|
-
const { elements, groupId } =
|
|
13922
|
+
const { elements, groupId } = chunkVG4NI3RU_js.groupElements(ops.activeElements, ids, chunkVG4NI3RU_js.generateElementId());
|
|
13923
13923
|
if (groupId === null) {
|
|
13924
13924
|
return;
|
|
13925
13925
|
}
|
|
@@ -13932,12 +13932,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13932
13932
|
return;
|
|
13933
13933
|
}
|
|
13934
13934
|
const group = selectedElement;
|
|
13935
|
-
const intoTemplate =
|
|
13935
|
+
const intoTemplate = chunkVG4NI3RU_js.isTemplateElementId(group.id);
|
|
13936
13936
|
const ungrouped = group.children.map((child) => ({
|
|
13937
13937
|
...structuredClone(child),
|
|
13938
13938
|
// Keep child ids in the same store as the group so later edits route
|
|
13939
13939
|
// correctly: template groups yield template-prefixed child ids.
|
|
13940
|
-
id: intoTemplate ?
|
|
13940
|
+
id: intoTemplate ? chunkVG4NI3RU_js.makeCloneId(true, child.id || group.id) : child.id || chunkVG4NI3RU_js.generateElementId(),
|
|
13941
13941
|
x: child.x + group.x,
|
|
13942
13942
|
y: child.y + group.y
|
|
13943
13943
|
}));
|
|
@@ -13961,7 +13961,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13961
13961
|
if (!edge) {
|
|
13962
13962
|
return;
|
|
13963
13963
|
}
|
|
13964
|
-
const positions =
|
|
13964
|
+
const positions = chunkVG4NI3RU_js.alignElements(selectedElements, edge);
|
|
13965
13965
|
for (const [id, pos] of positions) {
|
|
13966
13966
|
const el = elementLookup.get(id);
|
|
13967
13967
|
if (!el) {
|
|
@@ -13979,7 +13979,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13979
13979
|
if (!distAxis) {
|
|
13980
13980
|
return;
|
|
13981
13981
|
}
|
|
13982
|
-
const positions =
|
|
13982
|
+
const positions = chunkVG4NI3RU_js.distributeElements(selectedElements, distAxis);
|
|
13983
13983
|
for (const [id, pos] of positions) {
|
|
13984
13984
|
const el = elementLookup.get(id);
|
|
13985
13985
|
if (!el) {
|
|
@@ -13996,7 +13996,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13996
13996
|
}
|
|
13997
13997
|
const id = selectedElement.id;
|
|
13998
13998
|
ops.updateActiveElements(
|
|
13999
|
-
(els) => direction === "forward" ?
|
|
13999
|
+
(els) => direction === "forward" ? chunkVG4NI3RU_js.bringForward(els, id) : direction === "backward" ? chunkVG4NI3RU_js.sendBackward(els, id) : els
|
|
14000
14000
|
);
|
|
14001
14001
|
history.markDirty();
|
|
14002
14002
|
};
|
|
@@ -14006,7 +14006,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
14006
14006
|
}
|
|
14007
14007
|
const id = selectedElement.id;
|
|
14008
14008
|
ops.updateActiveElements(
|
|
14009
|
-
(els) => direction === "front" ?
|
|
14009
|
+
(els) => direction === "front" ? chunkVG4NI3RU_js.bringToFront(els, id) : chunkVG4NI3RU_js.sendToBack(els, id)
|
|
14010
14010
|
);
|
|
14011
14011
|
history.markDirty();
|
|
14012
14012
|
};
|
|
@@ -14128,7 +14128,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
14128
14128
|
function useSlideManagement(input) {
|
|
14129
14129
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
14130
14130
|
const handleAddSlide = () => {
|
|
14131
|
-
const newSlide =
|
|
14131
|
+
const newSlide = chunkVG4NI3RU_js.createBlankSlide(slides.length + 1);
|
|
14132
14132
|
ops.updateSlides((prev) => {
|
|
14133
14133
|
const next = [...prev];
|
|
14134
14134
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -14191,7 +14191,11 @@ function useSlideManagement(input) {
|
|
|
14191
14191
|
}
|
|
14192
14192
|
const clone = {
|
|
14193
14193
|
...src,
|
|
14194
|
-
id:
|
|
14194
|
+
id: chunkVG4NI3RU_js.makeSlideId(),
|
|
14195
|
+
rId: "",
|
|
14196
|
+
// Unlike a new blank slide, a duplicate must explicitly copy the
|
|
14197
|
+
// source slide's relationship part (images, charts, notes, etc.).
|
|
14198
|
+
sourceSlideId: src.id,
|
|
14195
14199
|
elements: src.elements.map((el) => ({
|
|
14196
14200
|
...el,
|
|
14197
14201
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -14223,7 +14227,7 @@ function useSlideManagement(input) {
|
|
|
14223
14227
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
14224
14228
|
const insertAt = activeSlideIndex + 1;
|
|
14225
14229
|
const draft = {
|
|
14226
|
-
...
|
|
14230
|
+
...chunkVG4NI3RU_js.createBlankSlide(slides.length + 1),
|
|
14227
14231
|
layoutPath,
|
|
14228
14232
|
...layoutName ? { layoutName } : {}
|
|
14229
14233
|
};
|
|
@@ -14284,7 +14288,7 @@ function createTableMergeHandlers(input) {
|
|
|
14284
14288
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
14285
14289
|
return;
|
|
14286
14290
|
}
|
|
14287
|
-
const newTableData =
|
|
14291
|
+
const newTableData = chunkVG4NI3RU_js.mergeCells(
|
|
14288
14292
|
[
|
|
14289
14293
|
{ row: rowIndex, col: columnIndex },
|
|
14290
14294
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -14292,7 +14296,7 @@ function createTableMergeHandlers(input) {
|
|
|
14292
14296
|
td
|
|
14293
14297
|
);
|
|
14294
14298
|
const updates = { tableData: newTableData };
|
|
14295
|
-
const newRawXml =
|
|
14299
|
+
const newRawXml = chunkXRZ2U7KL_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
14296
14300
|
if (newRawXml) {
|
|
14297
14301
|
updates.rawXml = newRawXml;
|
|
14298
14302
|
}
|
|
@@ -14318,7 +14322,7 @@ function createTableMergeHandlers(input) {
|
|
|
14318
14322
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
14319
14323
|
return;
|
|
14320
14324
|
}
|
|
14321
|
-
const newTableData =
|
|
14325
|
+
const newTableData = chunkVG4NI3RU_js.mergeCells(
|
|
14322
14326
|
[
|
|
14323
14327
|
{ row: rowIndex, col: columnIndex },
|
|
14324
14328
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -14326,7 +14330,7 @@ function createTableMergeHandlers(input) {
|
|
|
14326
14330
|
td
|
|
14327
14331
|
);
|
|
14328
14332
|
const updates = { tableData: newTableData };
|
|
14329
|
-
const newRawXml =
|
|
14333
|
+
const newRawXml = chunkXRZ2U7KL_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
14330
14334
|
if (newRawXml) {
|
|
14331
14335
|
updates.rawXml = newRawXml;
|
|
14332
14336
|
}
|
|
@@ -14341,9 +14345,9 @@ function createTableMergeHandlers(input) {
|
|
|
14341
14345
|
return;
|
|
14342
14346
|
}
|
|
14343
14347
|
const td = selectedElement.tableData;
|
|
14344
|
-
const newTableData =
|
|
14348
|
+
const newTableData = chunkVG4NI3RU_js.mergeCells(ts.selectedCells, td);
|
|
14345
14349
|
const updates = { tableData: newTableData };
|
|
14346
|
-
const newRawXml =
|
|
14350
|
+
const newRawXml = chunkXRZ2U7KL_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
14347
14351
|
if (newRawXml) {
|
|
14348
14352
|
updates.rawXml = newRawXml;
|
|
14349
14353
|
}
|
|
@@ -14360,9 +14364,9 @@ function createTableMergeHandlers(input) {
|
|
|
14360
14364
|
}
|
|
14361
14365
|
const { rowIndex, columnIndex } = ts;
|
|
14362
14366
|
const td = selectedElement.tableData;
|
|
14363
|
-
const newTableData =
|
|
14367
|
+
const newTableData = chunkVG4NI3RU_js.splitCell(rowIndex, columnIndex, td);
|
|
14364
14368
|
const updates = { tableData: newTableData };
|
|
14365
|
-
const newRawXml =
|
|
14369
|
+
const newRawXml = chunkXRZ2U7KL_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
14366
14370
|
if (newRawXml) {
|
|
14367
14371
|
updates.rawXml = newRawXml;
|
|
14368
14372
|
}
|
|
@@ -14406,7 +14410,7 @@ function createTableStructHandlers(input) {
|
|
|
14406
14410
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
14407
14411
|
}
|
|
14408
14412
|
if (el.rawXml) {
|
|
14409
|
-
const newRawXml =
|
|
14413
|
+
const newRawXml = chunkXRZ2U7KL_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
14410
14414
|
if (newRawXml) {
|
|
14411
14415
|
updates.rawXml = newRawXml;
|
|
14412
14416
|
}
|
|
@@ -14430,7 +14434,7 @@ function createTableStructHandlers(input) {
|
|
|
14430
14434
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
14431
14435
|
const updates = {};
|
|
14432
14436
|
if (selectedElement.rawXml) {
|
|
14433
|
-
const newRawXml =
|
|
14437
|
+
const newRawXml = chunkXRZ2U7KL_js.updateCellTextStyleInRawXml(
|
|
14434
14438
|
selectedElement,
|
|
14435
14439
|
rowIndex,
|
|
14436
14440
|
colIndex,
|
|
@@ -14494,9 +14498,9 @@ function createTableStructHandlers(input) {
|
|
|
14494
14498
|
return;
|
|
14495
14499
|
}
|
|
14496
14500
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
14497
|
-
const newTableData =
|
|
14501
|
+
const newTableData = chunkVG4NI3RU_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
14498
14502
|
const updates = { tableData: newTableData };
|
|
14499
|
-
const newRawXml =
|
|
14503
|
+
const newRawXml = chunkXRZ2U7KL_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
14500
14504
|
if (newRawXml) {
|
|
14501
14505
|
updates.rawXml = newRawXml;
|
|
14502
14506
|
}
|
|
@@ -14509,12 +14513,12 @@ function createTableStructHandlers(input) {
|
|
|
14509
14513
|
}
|
|
14510
14514
|
const td = selectedElement.tableData;
|
|
14511
14515
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
14512
|
-
const newTableData =
|
|
14516
|
+
const newTableData = chunkVG4NI3RU_js.deleteTableRow(td, rowIdx);
|
|
14513
14517
|
if (newTableData === td) {
|
|
14514
14518
|
return;
|
|
14515
14519
|
}
|
|
14516
14520
|
const updates = { tableData: newTableData };
|
|
14517
|
-
const newRawXml =
|
|
14521
|
+
const newRawXml = chunkXRZ2U7KL_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
14518
14522
|
if (newRawXml) {
|
|
14519
14523
|
updates.rawXml = newRawXml;
|
|
14520
14524
|
}
|
|
@@ -14526,9 +14530,9 @@ function createTableStructHandlers(input) {
|
|
|
14526
14530
|
return;
|
|
14527
14531
|
}
|
|
14528
14532
|
const colIdx = ts?.columnIndex ?? 0;
|
|
14529
|
-
const newTableData =
|
|
14533
|
+
const newTableData = chunkVG4NI3RU_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
14530
14534
|
const updates = { tableData: newTableData };
|
|
14531
|
-
const newRawXml =
|
|
14535
|
+
const newRawXml = chunkXRZ2U7KL_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
14532
14536
|
if (newRawXml) {
|
|
14533
14537
|
updates.rawXml = newRawXml;
|
|
14534
14538
|
}
|
|
@@ -14541,12 +14545,12 @@ function createTableStructHandlers(input) {
|
|
|
14541
14545
|
}
|
|
14542
14546
|
const td = selectedElement.tableData;
|
|
14543
14547
|
const colIdx = ts?.columnIndex ?? 0;
|
|
14544
|
-
const newTableData =
|
|
14548
|
+
const newTableData = chunkVG4NI3RU_js.deleteTableColumn(td, colIdx);
|
|
14545
14549
|
if (newTableData === td) {
|
|
14546
14550
|
return;
|
|
14547
14551
|
}
|
|
14548
14552
|
const updates = { tableData: newTableData };
|
|
14549
|
-
const newRawXml =
|
|
14553
|
+
const newRawXml = chunkXRZ2U7KL_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
14550
14554
|
if (newRawXml) {
|
|
14551
14555
|
updates.rawXml = newRawXml;
|
|
14552
14556
|
}
|
|
@@ -14582,8 +14586,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
14582
14586
|
return html2canvasPro(element, {
|
|
14583
14587
|
...options,
|
|
14584
14588
|
onclone: async (doc, clonedEl) => {
|
|
14585
|
-
await
|
|
14586
|
-
|
|
14589
|
+
await chunkVG4NI3RU_js.normalizeColorsForCapture(doc, clonedEl);
|
|
14590
|
+
chunkVG4NI3RU_js.preprocessCssForCapture(clonedEl);
|
|
14587
14591
|
if (typeof userOnClone === "function") {
|
|
14588
14592
|
userOnClone(doc, clonedEl);
|
|
14589
14593
|
}
|
|
@@ -14639,7 +14643,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
14639
14643
|
}
|
|
14640
14644
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
14641
14645
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
14642
|
-
|
|
14646
|
+
chunkVG4NI3RU_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
14643
14647
|
}
|
|
14644
14648
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
14645
14649
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -14661,7 +14665,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
14661
14665
|
continue;
|
|
14662
14666
|
}
|
|
14663
14667
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
14664
|
-
images.push(
|
|
14668
|
+
images.push(chunkVG4NI3RU_js.canvasToJpegData(canvas));
|
|
14665
14669
|
}
|
|
14666
14670
|
onProgress?.(totalSlides, totalSlides);
|
|
14667
14671
|
setActiveSlide(currentSlideIndex);
|
|
@@ -14669,7 +14673,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
14669
14673
|
throw new Error(chunkCUUYYYC5_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
14670
14674
|
}
|
|
14671
14675
|
const pdfBlobUrl = buildPdfFromImageData(images);
|
|
14672
|
-
|
|
14676
|
+
chunkVG4NI3RU_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
14673
14677
|
}
|
|
14674
14678
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
14675
14679
|
const { scale = 2, onProgress } = options;
|
|
@@ -14718,7 +14722,7 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
14718
14722
|
throw new Error(chunkCUUYYYC5_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
14719
14723
|
}
|
|
14720
14724
|
const pdfDataUrl = buildNotesPdf(pages);
|
|
14721
|
-
|
|
14725
|
+
chunkVG4NI3RU_js.downloadDataUrl(pdfDataUrl, filename);
|
|
14722
14726
|
}
|
|
14723
14727
|
|
|
14724
14728
|
// src/viewer/utils/export-video.ts
|
|
@@ -14762,7 +14766,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
14762
14766
|
const fps = 30;
|
|
14763
14767
|
const stream = recordingCanvas.captureStream(fps);
|
|
14764
14768
|
const recorder = new MediaRecorder(stream, {
|
|
14765
|
-
mimeType:
|
|
14769
|
+
mimeType: chunkVG4NI3RU_js.pickSupportedMimeType([...chunkVG4NI3RU_js.WEBM_MIME_CANDIDATES]),
|
|
14766
14770
|
videoBitsPerSecond: 5e6
|
|
14767
14771
|
});
|
|
14768
14772
|
const chunks = [];
|
|
@@ -14785,8 +14789,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
14785
14789
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
14786
14790
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
14787
14791
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
14788
|
-
const frameInterval =
|
|
14789
|
-
const framesNeeded =
|
|
14792
|
+
const frameInterval = chunkVG4NI3RU_js.fpsToFrameIntervalMs(fps);
|
|
14793
|
+
const framesNeeded = chunkVG4NI3RU_js.segmentFrameCount(duration, fps);
|
|
14790
14794
|
for (let f = 0; f < framesNeeded; f++) {
|
|
14791
14795
|
if (signal?.aborted) {
|
|
14792
14796
|
recorder.stop();
|
|
@@ -14835,7 +14839,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
14835
14839
|
if (frames.length === 0) {
|
|
14836
14840
|
throw new Error(chunkCUUYYYC5_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
14837
14841
|
}
|
|
14838
|
-
const gifBytes =
|
|
14842
|
+
const gifBytes = chunkVG4NI3RU_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
14839
14843
|
onProgress?.(totalSlides, totalSlides);
|
|
14840
14844
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
14841
14845
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -14889,7 +14893,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
14889
14893
|
continue;
|
|
14890
14894
|
}
|
|
14891
14895
|
onProgress?.(processedCount, data.slides.length);
|
|
14892
|
-
let svg =
|
|
14896
|
+
let svg = chunkXRZ2U7KL_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
14893
14897
|
if (embedFonts && fontFaces?.length) {
|
|
14894
14898
|
svg = injectFontFaces(svg, fontFaces);
|
|
14895
14899
|
}
|
|
@@ -14949,7 +14953,7 @@ function useExportSaveAs(input) {
|
|
|
14949
14953
|
}
|
|
14950
14954
|
setExportProgress(70);
|
|
14951
14955
|
setExportStatusMessage("Writing README...");
|
|
14952
|
-
const readme =
|
|
14956
|
+
const readme = chunkVG4NI3RU_js.generatePackageReadme(pptxFilename);
|
|
14953
14957
|
pkgFolder.file("README.txt", readme);
|
|
14954
14958
|
if (abortCtrl.signal.aborted) {
|
|
14955
14959
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -14960,7 +14964,7 @@ function useExportSaveAs(input) {
|
|
|
14960
14964
|
setExportProgress(95);
|
|
14961
14965
|
setExportStatusMessage("Downloading...");
|
|
14962
14966
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
14963
|
-
|
|
14967
|
+
chunkVG4NI3RU_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
14964
14968
|
setExportProgress(100);
|
|
14965
14969
|
} catch (err) {
|
|
14966
14970
|
if (err.name !== "AbortError") {
|
|
@@ -14983,7 +14987,7 @@ function useExportSaveAs(input) {
|
|
|
14983
14987
|
const blob = new Blob([data], {
|
|
14984
14988
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
14985
14989
|
});
|
|
14986
|
-
|
|
14990
|
+
chunkVG4NI3RU_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
14987
14991
|
} catch (err) {
|
|
14988
14992
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
14989
14993
|
}
|
|
@@ -14996,7 +15000,7 @@ function useExportSaveAs(input) {
|
|
|
14996
15000
|
const pptxGuides = guides.map((g) => ({
|
|
14997
15001
|
id: g.id,
|
|
14998
15002
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
14999
|
-
positionEmu:
|
|
15003
|
+
positionEmu: chunkXRZ2U7KL_js.guidePxToEmu(g.position)
|
|
15000
15004
|
}));
|
|
15001
15005
|
return {
|
|
15002
15006
|
...slide,
|
|
@@ -15060,7 +15064,7 @@ function safeConfirm(message) {
|
|
|
15060
15064
|
}
|
|
15061
15065
|
}
|
|
15062
15066
|
function downloadBlob2(blob, filename) {
|
|
15063
|
-
|
|
15067
|
+
chunkVG4NI3RU_js.downloadBlob(blob, chunkVG4NI3RU_js.sanitizeDownloadFilename(filename));
|
|
15064
15068
|
}
|
|
15065
15069
|
|
|
15066
15070
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -15161,21 +15165,21 @@ function useExportHandlers(input) {
|
|
|
15161
15165
|
{
|
|
15162
15166
|
scale: 2,
|
|
15163
15167
|
onProgress: (current, total) => {
|
|
15164
|
-
setExportProgress(
|
|
15165
|
-
setExportStatusMessage(
|
|
15168
|
+
setExportProgress(chunkVG4NI3RU_js.slideProgressPercent(current, total));
|
|
15169
|
+
setExportStatusMessage(chunkVG4NI3RU_js.slideStatusLabel("Rendering", current, total));
|
|
15166
15170
|
},
|
|
15167
15171
|
signal: abortCtrl.signal
|
|
15168
15172
|
}
|
|
15169
15173
|
);
|
|
15170
|
-
setExportProgress(
|
|
15174
|
+
setExportProgress(chunkVG4NI3RU_js.EXPORT_ASSEMBLING_PERCENT);
|
|
15171
15175
|
setExportStatusMessage("Building PDF...");
|
|
15172
15176
|
await new Promise((r) => {
|
|
15173
15177
|
setTimeout(r, 100);
|
|
15174
15178
|
});
|
|
15175
|
-
setExportProgress(
|
|
15179
|
+
setExportProgress(chunkVG4NI3RU_js.EXPORT_DONE_PERCENT);
|
|
15176
15180
|
setExportStatusMessage("Done!");
|
|
15177
15181
|
} catch (err) {
|
|
15178
|
-
if (!
|
|
15182
|
+
if (!chunkVG4NI3RU_js.isExportAbortError(err)) {
|
|
15179
15183
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
15180
15184
|
}
|
|
15181
15185
|
} finally {
|
|
@@ -15205,21 +15209,21 @@ function useExportHandlers(input) {
|
|
|
15205
15209
|
{
|
|
15206
15210
|
scale: 2,
|
|
15207
15211
|
onProgress: (current, total) => {
|
|
15208
|
-
setExportProgress(
|
|
15209
|
-
setExportStatusMessage(
|
|
15212
|
+
setExportProgress(chunkVG4NI3RU_js.slideProgressPercent(current, total));
|
|
15213
|
+
setExportStatusMessage(chunkVG4NI3RU_js.slideStatusLabel("Rendering", current, total));
|
|
15210
15214
|
},
|
|
15211
15215
|
signal: abortCtrl.signal
|
|
15212
15216
|
}
|
|
15213
15217
|
);
|
|
15214
|
-
setExportProgress(
|
|
15218
|
+
setExportProgress(chunkVG4NI3RU_js.EXPORT_ASSEMBLING_PERCENT);
|
|
15215
15219
|
setExportStatusMessage("Building PDF...");
|
|
15216
15220
|
await new Promise((r) => {
|
|
15217
15221
|
setTimeout(r, 100);
|
|
15218
15222
|
});
|
|
15219
|
-
setExportProgress(
|
|
15223
|
+
setExportProgress(chunkVG4NI3RU_js.EXPORT_DONE_PERCENT);
|
|
15220
15224
|
setExportStatusMessage("Done!");
|
|
15221
15225
|
} catch (err) {
|
|
15222
|
-
if (!
|
|
15226
|
+
if (!chunkVG4NI3RU_js.isExportAbortError(err)) {
|
|
15223
15227
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
15224
15228
|
}
|
|
15225
15229
|
} finally {
|
|
@@ -15260,22 +15264,22 @@ function useExportHandlers(input) {
|
|
|
15260
15264
|
scale: 1,
|
|
15261
15265
|
slideDurationMs: 3e3,
|
|
15262
15266
|
onProgress: (current, total) => {
|
|
15263
|
-
setExportProgress(
|
|
15264
|
-
setExportStatusMessage(
|
|
15267
|
+
setExportProgress(chunkVG4NI3RU_js.slideProgressPercent(current, total, 45));
|
|
15268
|
+
setExportStatusMessage(chunkVG4NI3RU_js.slideStatusLabel("Capturing", current, total));
|
|
15265
15269
|
},
|
|
15266
15270
|
onRecordProgress: (current, total) => {
|
|
15267
|
-
setExportProgress(
|
|
15268
|
-
setExportStatusMessage(
|
|
15271
|
+
setExportProgress(chunkVG4NI3RU_js.recordProgressPercent(current, total));
|
|
15272
|
+
setExportStatusMessage(chunkVG4NI3RU_js.slideStatusLabel("Recording", current, total));
|
|
15269
15273
|
},
|
|
15270
15274
|
signal: abortCtrl.signal
|
|
15271
15275
|
}
|
|
15272
15276
|
);
|
|
15273
|
-
setExportProgress(
|
|
15277
|
+
setExportProgress(chunkVG4NI3RU_js.EXPORT_ASSEMBLING_PERCENT);
|
|
15274
15278
|
setExportStatusMessage("Saving file...");
|
|
15275
15279
|
downloadBlob2(blob, "presentation.webm");
|
|
15276
|
-
setExportProgress(
|
|
15280
|
+
setExportProgress(chunkVG4NI3RU_js.EXPORT_DONE_PERCENT);
|
|
15277
15281
|
} catch (err) {
|
|
15278
|
-
if (!
|
|
15282
|
+
if (!chunkVG4NI3RU_js.isExportAbortError(err)) {
|
|
15279
15283
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
15280
15284
|
}
|
|
15281
15285
|
} finally {
|
|
@@ -15303,18 +15307,18 @@ function useExportHandlers(input) {
|
|
|
15303
15307
|
scale: 0.5,
|
|
15304
15308
|
slideDurationMs: 2e3,
|
|
15305
15309
|
onProgress: (current, total) => {
|
|
15306
|
-
setExportProgress(
|
|
15307
|
-
setExportStatusMessage(
|
|
15310
|
+
setExportProgress(chunkVG4NI3RU_js.slideProgressPercent(current, total));
|
|
15311
|
+
setExportStatusMessage(chunkVG4NI3RU_js.slideStatusLabel("Encoding", current, total));
|
|
15308
15312
|
},
|
|
15309
15313
|
signal: abortCtrl.signal
|
|
15310
15314
|
}
|
|
15311
15315
|
);
|
|
15312
|
-
setExportProgress(
|
|
15316
|
+
setExportProgress(chunkVG4NI3RU_js.EXPORT_ASSEMBLING_PERCENT);
|
|
15313
15317
|
setExportStatusMessage("Saving file...");
|
|
15314
15318
|
downloadBlob2(blob, "presentation.gif");
|
|
15315
|
-
setExportProgress(
|
|
15319
|
+
setExportProgress(chunkVG4NI3RU_js.EXPORT_DONE_PERCENT);
|
|
15316
15320
|
} catch (err) {
|
|
15317
|
-
if (!
|
|
15321
|
+
if (!chunkVG4NI3RU_js.isExportAbortError(err)) {
|
|
15318
15322
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
15319
15323
|
}
|
|
15320
15324
|
} finally {
|
|
@@ -15354,7 +15358,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
15354
15358
|
}
|
|
15355
15359
|
printWindow.document.open();
|
|
15356
15360
|
printWindow.document.write(
|
|
15357
|
-
|
|
15361
|
+
chunkVG4NI3RU_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
15358
15362
|
);
|
|
15359
15363
|
printWindow.document.close();
|
|
15360
15364
|
printWindow.focus();
|
|
@@ -15415,7 +15419,7 @@ function usePrintHandlers(input) {
|
|
|
15415
15419
|
if (svgs.length === 0) {
|
|
15416
15420
|
return;
|
|
15417
15421
|
}
|
|
15418
|
-
const printDoc =
|
|
15422
|
+
const printDoc = chunkVG4NI3RU_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
15419
15423
|
title: "Slides (Vector)",
|
|
15420
15424
|
orientation: settings.orientation,
|
|
15421
15425
|
colorFilter
|
|
@@ -15451,7 +15455,7 @@ function usePrintHandlers(input) {
|
|
|
15451
15455
|
if (settings.printWhat === "outline") {
|
|
15452
15456
|
openPrintWindow(
|
|
15453
15457
|
"Outline",
|
|
15454
|
-
`<div class="outline-page">${
|
|
15458
|
+
`<div class="outline-page">${chunkVG4NI3RU_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
15455
15459
|
settings.orientation,
|
|
15456
15460
|
colorFilter,
|
|
15457
15461
|
settings.frameSlides
|
|
@@ -15476,7 +15480,7 @@ function usePrintHandlers(input) {
|
|
|
15476
15480
|
if (settings.printWhat === "slides") {
|
|
15477
15481
|
openPrintWindow(
|
|
15478
15482
|
"Slides",
|
|
15479
|
-
|
|
15483
|
+
chunkVG4NI3RU_js.buildSlidesHtml(slideImages, slideIndices),
|
|
15480
15484
|
settings.orientation,
|
|
15481
15485
|
colorFilter,
|
|
15482
15486
|
settings.frameSlides
|
|
@@ -15486,7 +15490,7 @@ function usePrintHandlers(input) {
|
|
|
15486
15490
|
if (settings.printWhat === "notes") {
|
|
15487
15491
|
openPrintWindow(
|
|
15488
15492
|
"Notes Pages",
|
|
15489
|
-
|
|
15493
|
+
chunkVG4NI3RU_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
15490
15494
|
"portrait",
|
|
15491
15495
|
colorFilter,
|
|
15492
15496
|
settings.frameSlides
|
|
@@ -15497,7 +15501,7 @@ function usePrintHandlers(input) {
|
|
|
15497
15501
|
const spp = settings.slidesPerPage;
|
|
15498
15502
|
openPrintWindow(
|
|
15499
15503
|
`Handout ${spp} per page`,
|
|
15500
|
-
|
|
15504
|
+
chunkVG4NI3RU_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
15501
15505
|
"portrait",
|
|
15502
15506
|
colorFilter,
|
|
15503
15507
|
settings.frameSlides
|
|
@@ -15561,8 +15565,8 @@ function useThemeHandlers(input) {
|
|
|
15561
15565
|
return;
|
|
15562
15566
|
}
|
|
15563
15567
|
await handler.updateThemeColorScheme(colorScheme);
|
|
15564
|
-
const previousMap = theme?.colorScheme ?
|
|
15565
|
-
setSlides((prev) =>
|
|
15568
|
+
const previousMap = theme?.colorScheme ? chunkXRZ2U7KL_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
15569
|
+
setSlides((prev) => chunkXRZ2U7KL_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
15566
15570
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
15567
15571
|
bumpHistory();
|
|
15568
15572
|
history.markDirty();
|
|
@@ -15667,7 +15671,7 @@ function useThemeSwitching(input) {
|
|
|
15667
15671
|
}
|
|
15668
15672
|
try {
|
|
15669
15673
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
15670
|
-
const newData =
|
|
15674
|
+
const newData = chunkXRZ2U7KL_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
15671
15675
|
onDataChange(newData);
|
|
15672
15676
|
onThemeChanged?.(preset);
|
|
15673
15677
|
} catch (error) {
|
|
@@ -15684,7 +15688,7 @@ function useThemeSwitching(input) {
|
|
|
15684
15688
|
}
|
|
15685
15689
|
try {
|
|
15686
15690
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
15687
|
-
const newData =
|
|
15691
|
+
const newData = chunkXRZ2U7KL_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
15688
15692
|
onDataChange(newData);
|
|
15689
15693
|
} catch (error) {
|
|
15690
15694
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -15696,12 +15700,12 @@ function useThemeSwitching(input) {
|
|
|
15696
15700
|
if (!data?.theme?.colorScheme) {
|
|
15697
15701
|
return void 0;
|
|
15698
15702
|
}
|
|
15699
|
-
return
|
|
15700
|
-
(p) =>
|
|
15703
|
+
return chunkXRZ2U7KL_js.THEME_PRESETS.find(
|
|
15704
|
+
(p) => chunkXRZ2U7KL_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
15701
15705
|
);
|
|
15702
15706
|
}, [data?.theme?.colorScheme]);
|
|
15703
15707
|
return {
|
|
15704
|
-
presets:
|
|
15708
|
+
presets: chunkXRZ2U7KL_js.THEME_PRESETS,
|
|
15705
15709
|
switchToPreset,
|
|
15706
15710
|
switchToCustom,
|
|
15707
15711
|
currentPreset
|
|
@@ -15776,7 +15780,7 @@ function usePropertyHandlers(input) {
|
|
|
15776
15780
|
}
|
|
15777
15781
|
try {
|
|
15778
15782
|
const ab = await file.arrayBuffer();
|
|
15779
|
-
const h = new
|
|
15783
|
+
const h = new chunkXRZ2U7KL_js.PptxHandler();
|
|
15780
15784
|
const other = await h.load(ab);
|
|
15781
15785
|
if (!other) {
|
|
15782
15786
|
return;
|
|
@@ -15786,7 +15790,7 @@ function usePropertyHandlers(input) {
|
|
|
15786
15790
|
width: canvasSize.width,
|
|
15787
15791
|
height: canvasSize.height
|
|
15788
15792
|
};
|
|
15789
|
-
setCompareResult(
|
|
15793
|
+
setCompareResult(chunkVG4NI3RU_js.comparePresentation(cur, other));
|
|
15790
15794
|
setIsComparePanelOpen(true);
|
|
15791
15795
|
} catch (err) {
|
|
15792
15796
|
console.warn("Compare failed:", err);
|
|
@@ -15803,7 +15807,7 @@ function usePropertyHandlers(input) {
|
|
|
15803
15807
|
if (!diff || diff.status === "unchanged") {
|
|
15804
15808
|
return;
|
|
15805
15809
|
}
|
|
15806
|
-
setSlides((prev) =>
|
|
15810
|
+
setSlides((prev) => chunkVG4NI3RU_js.applyAcceptSlide(prev, diff));
|
|
15807
15811
|
setIsDirty(true);
|
|
15808
15812
|
},
|
|
15809
15813
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -15814,10 +15818,10 @@ function usePropertyHandlers(input) {
|
|
|
15814
15818
|
if (!compareResult) {
|
|
15815
15819
|
return;
|
|
15816
15820
|
}
|
|
15817
|
-
setSlides((prev) =>
|
|
15821
|
+
setSlides((prev) => chunkVG4NI3RU_js.applyAcceptAllSlides(prev, compareResult));
|
|
15818
15822
|
setIsDirty(true);
|
|
15819
15823
|
}, [compareResult, setSlides, setIsDirty]);
|
|
15820
|
-
const usedFontFamilies = React4.useMemo(() =>
|
|
15824
|
+
const usedFontFamilies = React4.useMemo(() => chunkVG4NI3RU_js.collectUsedFonts(slides), [slides]);
|
|
15821
15825
|
return {
|
|
15822
15826
|
handleUpdateNotes,
|
|
15823
15827
|
handleUpdateSlide,
|
|
@@ -15936,7 +15940,7 @@ function useIsMobile(input) {
|
|
|
15936
15940
|
const containerRef = input?.containerRef;
|
|
15937
15941
|
const isTouchDevice = React4.useSyncExternalStore(
|
|
15938
15942
|
subscribeTouchCapability,
|
|
15939
|
-
|
|
15943
|
+
chunkVG4NI3RU_js.detectTouchDevice,
|
|
15940
15944
|
() => false
|
|
15941
15945
|
// server snapshot
|
|
15942
15946
|
);
|
|
@@ -15952,7 +15956,7 @@ function useIsMobile(input) {
|
|
|
15952
15956
|
}
|
|
15953
15957
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
15954
15958
|
});
|
|
15955
|
-
const [orientation, setOrientation] = React4.useState(
|
|
15959
|
+
const [orientation, setOrientation] = React4.useState(chunkVG4NI3RU_js.detectOrientation);
|
|
15956
15960
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = React4.useState(false);
|
|
15957
15961
|
const [initialViewportHeight] = React4.useState(
|
|
15958
15962
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -15996,7 +16000,7 @@ function useIsMobile(input) {
|
|
|
15996
16000
|
return;
|
|
15997
16001
|
}
|
|
15998
16002
|
const handleOrientationChange = () => {
|
|
15999
|
-
setOrientation(
|
|
16003
|
+
setOrientation(chunkVG4NI3RU_js.detectOrientation());
|
|
16000
16004
|
};
|
|
16001
16005
|
if (screen.orientation) {
|
|
16002
16006
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -16026,9 +16030,9 @@ function useIsMobile(input) {
|
|
|
16026
16030
|
window.addEventListener("resize", handleResize);
|
|
16027
16031
|
return () => window.removeEventListener("resize", handleResize);
|
|
16028
16032
|
}, [isTouchDevice, initialViewportHeight]);
|
|
16029
|
-
const isMobile =
|
|
16030
|
-
const isTablet = !isMobile && containerWidth >=
|
|
16031
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
16033
|
+
const isMobile = chunkVG4NI3RU_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
16034
|
+
const isTablet = !isMobile && containerWidth >= chunkVG4NI3RU_js.MOBILE_BREAKPOINT && containerWidth < chunkVG4NI3RU_js.TABLET_BREAKPOINT;
|
|
16035
|
+
const isDesktop = !isMobile && containerWidth >= chunkVG4NI3RU_js.TABLET_BREAKPOINT;
|
|
16032
16036
|
return {
|
|
16033
16037
|
isMobile,
|
|
16034
16038
|
isTablet,
|
|
@@ -16089,11 +16093,11 @@ function useViewerDialogs(input) {
|
|
|
16089
16093
|
);
|
|
16090
16094
|
const [embedFontsEnabled, setEmbedFontsEnabled] = React4.useState(false);
|
|
16091
16095
|
const [isNarrowViewport, setIsNarrowViewport] = React4.useState(
|
|
16092
|
-
() => typeof window !== "undefined" ?
|
|
16096
|
+
() => typeof window !== "undefined" ? chunkVG4NI3RU_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
16093
16097
|
);
|
|
16094
16098
|
React4.useEffect(() => {
|
|
16095
16099
|
const handleWindow = () => setIsNarrowViewport(
|
|
16096
|
-
|
|
16100
|
+
chunkVG4NI3RU_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
16097
16101
|
);
|
|
16098
16102
|
let observer = null;
|
|
16099
16103
|
let raf = 0;
|
|
@@ -16107,12 +16111,12 @@ function useViewerDialogs(input) {
|
|
|
16107
16111
|
const entry = entries[0];
|
|
16108
16112
|
if (entry) {
|
|
16109
16113
|
setIsNarrowViewport(
|
|
16110
|
-
|
|
16114
|
+
chunkVG4NI3RU_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
16111
16115
|
);
|
|
16112
16116
|
}
|
|
16113
16117
|
});
|
|
16114
16118
|
observer.observe(el);
|
|
16115
|
-
setIsNarrowViewport(
|
|
16119
|
+
setIsNarrowViewport(chunkVG4NI3RU_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
16116
16120
|
};
|
|
16117
16121
|
attach();
|
|
16118
16122
|
window.addEventListener("resize", handleWindow);
|
|
@@ -16289,7 +16293,7 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
|
16289
16293
|
return slides.map((_, i) => i).filter((i) => !slides[i]?.hidden);
|
|
16290
16294
|
}
|
|
16291
16295
|
function computeSlideSectionGroups(slides, sections) {
|
|
16292
|
-
return
|
|
16296
|
+
return chunkVG4NI3RU_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
16293
16297
|
id: group.section?.id ?? (sections.length > 0 ? UNGROUPED_SECTION_ID : "default"),
|
|
16294
16298
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
16295
16299
|
slideIndexes: group.slideIndexes,
|
|
@@ -16527,13 +16531,13 @@ function useSerialize(input) {
|
|
|
16527
16531
|
let processedSlide = slide;
|
|
16528
16532
|
if (pendingEditId) {
|
|
16529
16533
|
const updatedElements = slide.elements.map((el) => {
|
|
16530
|
-
if (el.id !== pendingEditId || !
|
|
16534
|
+
if (el.id !== pendingEditId || !chunkXRZ2U7KL_js.hasTextProperties(el)) {
|
|
16531
16535
|
return el;
|
|
16532
16536
|
}
|
|
16533
16537
|
return {
|
|
16534
16538
|
...el,
|
|
16535
16539
|
text: pendingEditText,
|
|
16536
|
-
textSegments:
|
|
16540
|
+
textSegments: chunkVG4NI3RU_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
16537
16541
|
};
|
|
16538
16542
|
});
|
|
16539
16543
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -16546,7 +16550,7 @@ function useSerialize(input) {
|
|
|
16546
16550
|
const pptxGuides = guides.map((g) => ({
|
|
16547
16551
|
id: g.id,
|
|
16548
16552
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
16549
|
-
positionEmu:
|
|
16553
|
+
positionEmu: chunkXRZ2U7KL_js.guidePxToEmu(g.position)
|
|
16550
16554
|
}));
|
|
16551
16555
|
return {
|
|
16552
16556
|
...processedSlide,
|
|
@@ -16782,10 +16786,10 @@ function usePresentationSetup(input) {
|
|
|
16782
16786
|
onToggleEraser: () => annotations.setPresentationTool("eraser"),
|
|
16783
16787
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
16784
16788
|
onSaveRehearsalTimings: (timings) => {
|
|
16785
|
-
setSlides((prev) =>
|
|
16789
|
+
setSlides((prev) => chunkVG4NI3RU_js.applyRehearsalTimings(prev, timings));
|
|
16786
16790
|
history.markDirty();
|
|
16787
16791
|
},
|
|
16788
|
-
loopContinuously:
|
|
16792
|
+
loopContinuously: chunkVG4NI3RU_js.shouldLoopContinuously(presentationProperties),
|
|
16789
16793
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
16790
16794
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
16791
16795
|
endWithBlackSlide
|
|
@@ -16947,7 +16951,7 @@ function useEditorOperations(input) {
|
|
|
16947
16951
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
16948
16952
|
React4.useEffect(() => {
|
|
16949
16953
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
16950
|
-
copiedFormatRef.current =
|
|
16954
|
+
copiedFormatRef.current = chunkVG4NI3RU_js.copyFormatFromElement(selectedElement);
|
|
16951
16955
|
} else if (!formatPainterActive) {
|
|
16952
16956
|
copiedFormatRef.current = null;
|
|
16953
16957
|
}
|
|
@@ -16973,12 +16977,12 @@ function useEditorOperations(input) {
|
|
|
16973
16977
|
e.stopPropagation();
|
|
16974
16978
|
const element = elementLookup.get(elementId);
|
|
16975
16979
|
if (element) {
|
|
16976
|
-
const updated =
|
|
16980
|
+
const updated = chunkVG4NI3RU_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
16977
16981
|
const updates = {};
|
|
16978
|
-
if (
|
|
16982
|
+
if (chunkXRZ2U7KL_js.hasShapeProperties(updated)) {
|
|
16979
16983
|
updates.shapeStyle = updated.shapeStyle;
|
|
16980
16984
|
}
|
|
16981
|
-
if (
|
|
16985
|
+
if (chunkXRZ2U7KL_js.hasTextProperties(updated)) {
|
|
16982
16986
|
updates.textStyle = updated.textStyle;
|
|
16983
16987
|
}
|
|
16984
16988
|
ops.updateElementById(elementId, updates);
|
|
@@ -17125,7 +17129,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
17125
17129
|
const families = /* @__PURE__ */ new Set();
|
|
17126
17130
|
for (const slide of slides) {
|
|
17127
17131
|
for (const el of slide.elements) {
|
|
17128
|
-
if (
|
|
17132
|
+
if (chunkXRZ2U7KL_js.hasTextProperties(el) && el.textSegments) {
|
|
17129
17133
|
for (const seg of el.textSegments) {
|
|
17130
17134
|
if (seg.style.fontFamily) {
|
|
17131
17135
|
families.add(seg.style.fontFamily);
|
|
@@ -17909,7 +17913,7 @@ function useReducedMotion() {
|
|
|
17909
17913
|
}
|
|
17910
17914
|
function useViewerOptions() {
|
|
17911
17915
|
const storeRef = React4.useRef(null);
|
|
17912
|
-
storeRef.current ??=
|
|
17916
|
+
storeRef.current ??= chunkVG4NI3RU_js.createViewerOptionsStore();
|
|
17913
17917
|
const store = storeRef.current;
|
|
17914
17918
|
const options = React4.useSyncExternalStore(
|
|
17915
17919
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -17918,9 +17922,9 @@ function useViewerOptions() {
|
|
|
17918
17922
|
);
|
|
17919
17923
|
return { optionsStore: store, options };
|
|
17920
17924
|
}
|
|
17921
|
-
var KNOWN_TAB_IDS = new Set(
|
|
17925
|
+
var KNOWN_TAB_IDS = new Set(chunkVG4NI3RU_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
17922
17926
|
function computeToolbarVisibility(hiddenActions) {
|
|
17923
|
-
const isHidden = (id) =>
|
|
17927
|
+
const isHidden = (id) => chunkVG4NI3RU_js.isActionHidden(id, hiddenActions);
|
|
17924
17928
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
17925
17929
|
return { isHidden, isTabVisible };
|
|
17926
17930
|
}
|
|
@@ -18005,10 +18009,10 @@ function useYjsDocumentSync({
|
|
|
18005
18009
|
return;
|
|
18006
18010
|
}
|
|
18007
18011
|
try {
|
|
18008
|
-
const { PptxHandler: PptxHandler2 } = await import('./dist-
|
|
18012
|
+
const { PptxHandler: PptxHandler2 } = await import('./dist-SNAUH2AL.js');
|
|
18009
18013
|
const handler = new PptxHandler2();
|
|
18010
18014
|
await handler.load(sourceBytes.buffer);
|
|
18011
|
-
const currentSlides =
|
|
18015
|
+
const currentSlides = chunkVG4NI3RU_js.readSlidesFromYDoc(
|
|
18012
18016
|
doc
|
|
18013
18017
|
);
|
|
18014
18018
|
const slidesToSave = buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
@@ -18026,7 +18030,7 @@ function useYjsDocumentSync({
|
|
|
18026
18030
|
if (!doc || !isConnected) {
|
|
18027
18031
|
return;
|
|
18028
18032
|
}
|
|
18029
|
-
const docSlides =
|
|
18033
|
+
const docSlides = chunkVG4NI3RU_js.readSlidesFromYDoc(
|
|
18030
18034
|
doc
|
|
18031
18035
|
);
|
|
18032
18036
|
if (docSlides.length === 0) {
|
|
@@ -18048,11 +18052,11 @@ function useYjsDocumentSync({
|
|
|
18048
18052
|
lastSyncedRef.current = serialized;
|
|
18049
18053
|
void (async () => {
|
|
18050
18054
|
const factories = await getFactories();
|
|
18051
|
-
|
|
18055
|
+
chunkVG4NI3RU_js.reconcileSlidesInYDoc(
|
|
18052
18056
|
slides,
|
|
18053
18057
|
doc,
|
|
18054
18058
|
factories,
|
|
18055
|
-
|
|
18059
|
+
chunkVG4NI3RU_js.LOCAL_SYNC_ORIGIN
|
|
18056
18060
|
);
|
|
18057
18061
|
scheduleWriteBack();
|
|
18058
18062
|
})();
|
|
@@ -18066,10 +18070,10 @@ function useYjsDocumentSync({
|
|
|
18066
18070
|
return;
|
|
18067
18071
|
}
|
|
18068
18072
|
const handleChange = (_events, transaction) => {
|
|
18069
|
-
if (transaction?.origin ===
|
|
18073
|
+
if (transaction?.origin === chunkVG4NI3RU_js.LOCAL_SYNC_ORIGIN) {
|
|
18070
18074
|
return;
|
|
18071
18075
|
}
|
|
18072
|
-
const remoteSlides =
|
|
18076
|
+
const remoteSlides = chunkVG4NI3RU_js.readSlidesFromYDoc(
|
|
18073
18077
|
doc
|
|
18074
18078
|
);
|
|
18075
18079
|
if (remoteSlides.length === 0) {
|
|
@@ -18085,7 +18089,7 @@ function useYjsDocumentSync({
|
|
|
18085
18089
|
isApplyingRemoteRef.current = false;
|
|
18086
18090
|
scheduleWriteBack();
|
|
18087
18091
|
};
|
|
18088
|
-
const unobserve =
|
|
18092
|
+
const unobserve = chunkVG4NI3RU_js.observeYDocSlides(
|
|
18089
18093
|
doc,
|
|
18090
18094
|
handleChange
|
|
18091
18095
|
);
|
|
@@ -18123,7 +18127,7 @@ function useBroadcastFollower({
|
|
|
18123
18127
|
if (!broadcaster) {
|
|
18124
18128
|
return;
|
|
18125
18129
|
}
|
|
18126
|
-
if (!
|
|
18130
|
+
if (!chunkVG4NI3RU_js.shouldAutoFollowBroadcaster({
|
|
18127
18131
|
localRole: collab.config.role,
|
|
18128
18132
|
broadcasterRole: broadcaster.role
|
|
18129
18133
|
})) {
|
|
@@ -18258,7 +18262,7 @@ function useTouchGestures(input) {
|
|
|
18258
18262
|
if (!el || !enabled) {
|
|
18259
18263
|
return;
|
|
18260
18264
|
}
|
|
18261
|
-
const recognizer =
|
|
18265
|
+
const recognizer = chunkVG4NI3RU_js.createTouchGestureRecognizer({
|
|
18262
18266
|
getScale: () => scaleRef.current,
|
|
18263
18267
|
minScale: MIN_ZOOM_SCALE,
|
|
18264
18268
|
maxScale: MAX_ZOOM_SCALE,
|
|
@@ -18301,7 +18305,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
18301
18305
|
return;
|
|
18302
18306
|
}
|
|
18303
18307
|
const rect = active.getBoundingClientRect();
|
|
18304
|
-
const delta =
|
|
18308
|
+
const delta = chunkVG4NI3RU_js.computeScrollDelta(
|
|
18305
18309
|
{ top: rect.top, bottom: rect.bottom },
|
|
18306
18310
|
window.innerHeight,
|
|
18307
18311
|
keyboardInset
|
|
@@ -18321,8 +18325,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18321
18325
|
return;
|
|
18322
18326
|
}
|
|
18323
18327
|
const update = () => {
|
|
18324
|
-
const metrics =
|
|
18325
|
-
const inset = metrics ?
|
|
18328
|
+
const metrics = chunkVG4NI3RU_js.readViewportMetrics(window);
|
|
18329
|
+
const inset = metrics ? chunkVG4NI3RU_js.computeKeyboardInset(metrics) : 0;
|
|
18326
18330
|
setKeyboardInset(inset);
|
|
18327
18331
|
if (inset > 0) {
|
|
18328
18332
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -18333,8 +18337,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18333
18337
|
vv.addEventListener("scroll", update);
|
|
18334
18338
|
const onFocusIn = () => {
|
|
18335
18339
|
window.requestAnimationFrame(() => {
|
|
18336
|
-
const metrics =
|
|
18337
|
-
const inset = metrics ?
|
|
18340
|
+
const metrics = chunkVG4NI3RU_js.readViewportMetrics(window);
|
|
18341
|
+
const inset = metrics ? chunkVG4NI3RU_js.computeKeyboardInset(metrics) : 0;
|
|
18338
18342
|
if (inset > 0) {
|
|
18339
18343
|
scrollFocusedIntoView(inset);
|
|
18340
18344
|
}
|
|
@@ -18347,7 +18351,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18347
18351
|
document.removeEventListener("focusin", onFocusIn);
|
|
18348
18352
|
};
|
|
18349
18353
|
}, [enabled]);
|
|
18350
|
-
return { keyboardInset, isKeyboardOpen:
|
|
18354
|
+
return { keyboardInset, isKeyboardOpen: chunkVG4NI3RU_js.isKeyboardOpen(keyboardInset) };
|
|
18351
18355
|
}
|
|
18352
18356
|
|
|
18353
18357
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -18402,13 +18406,13 @@ function buildCanvasProps(input) {
|
|
|
18402
18406
|
if (mode === "present") {
|
|
18403
18407
|
presentation.handlePresentationAction(action);
|
|
18404
18408
|
} else if (action.url) {
|
|
18405
|
-
|
|
18409
|
+
chunkVG4NI3RU_js.safeOpenUrl(action.url);
|
|
18406
18410
|
}
|
|
18407
18411
|
};
|
|
18408
18412
|
const handleHyperlinkClick = (url) => {
|
|
18409
|
-
if (
|
|
18413
|
+
if (chunkVG4NI3RU_js.isPpactionUrl(url)) {
|
|
18410
18414
|
if (mode === "present") {
|
|
18411
|
-
const parsed =
|
|
18415
|
+
const parsed = chunkVG4NI3RU_js.parsePpactionUrl(url);
|
|
18412
18416
|
if (parsed) {
|
|
18413
18417
|
presentation.handlePresentationAction({
|
|
18414
18418
|
action: parsed.action,
|
|
@@ -18418,7 +18422,7 @@ function buildCanvasProps(input) {
|
|
|
18418
18422
|
}
|
|
18419
18423
|
return;
|
|
18420
18424
|
}
|
|
18421
|
-
|
|
18425
|
+
chunkVG4NI3RU_js.safeOpenUrl(url);
|
|
18422
18426
|
};
|
|
18423
18427
|
return {
|
|
18424
18428
|
activeSlide: effectiveSlide,
|
|
@@ -18738,7 +18742,7 @@ function buildToolbarProps(input) {
|
|
|
18738
18742
|
onOpenFile,
|
|
18739
18743
|
onOpenRecentFile,
|
|
18740
18744
|
onCreatePresentation: (templateId) => {
|
|
18741
|
-
s.setSlides(
|
|
18745
|
+
s.setSlides(chunkVG4NI3RU_js.createBackstagePresentation(templateId));
|
|
18742
18746
|
s.setActiveSlideIndex(0);
|
|
18743
18747
|
s.setSelectedElementId(null);
|
|
18744
18748
|
s.setSelectedElementIds([]);
|
|
@@ -18799,7 +18803,7 @@ function buildToolbarProps(input) {
|
|
|
18799
18803
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
18800
18804
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
18801
18805
|
formatPainterActive: s.formatPainterActive,
|
|
18802
|
-
canActivateFormatPainter:
|
|
18806
|
+
canActivateFormatPainter: chunkVG4NI3RU_js.hasCopyableFormat(selectedElement),
|
|
18803
18807
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
18804
18808
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
18805
18809
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -19062,7 +19066,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
19062
19066
|
}, [incomingContent]);
|
|
19063
19067
|
const onOpenFile = React4.useCallback(() => {
|
|
19064
19068
|
void (async () => {
|
|
19065
|
-
const picked = await
|
|
19069
|
+
const picked = await chunkVG4NI3RU_js.openPptxFile();
|
|
19066
19070
|
if (picked) {
|
|
19067
19071
|
setContent(picked.buffer);
|
|
19068
19072
|
}
|
|
@@ -19070,7 +19074,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
19070
19074
|
}, []);
|
|
19071
19075
|
const onOpenRecentFile = React4.useCallback((key) => {
|
|
19072
19076
|
void (async () => {
|
|
19073
|
-
const bytes = await
|
|
19077
|
+
const bytes = await chunkVG4NI3RU_js.readBackstageRecentFile(key);
|
|
19074
19078
|
if (bytes) {
|
|
19075
19079
|
setContent(bytes);
|
|
19076
19080
|
}
|