@aixa-transformation/pptx-viewer 2.0.30 → 2.0.31
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-7PC3BTGV.js → Model3DScene-7DX3ENQ6.js} +3 -3
- package/dist/{Model3DScene-OOLYRN3I.mjs → Model3DScene-BLJ7FKLP.mjs} +2 -2
- package/dist/{SurfaceChart3DScene-NKUQTDRP.js → SurfaceChart3DScene-63SAKPUY.js} +3 -3
- package/dist/{SurfaceChart3DScene-ZZYDRV5N.mjs → SurfaceChart3DScene-EQNT7LKA.mjs} +2 -2
- package/dist/{chunk-JJ5MVLCK.mjs → chunk-3IIMAKXR.mjs} +76 -20
- package/dist/{chunk-I5S57RYE.js → chunk-62Y7KDX7.js} +872 -835
- package/dist/{chunk-YVQPLQ3C.mjs → chunk-6SJP4DDM.mjs} +2 -2
- package/dist/{chunk-TYXOHBKR.mjs → chunk-FXXVW5YN.mjs} +15 -9
- package/dist/{chunk-XCLYIGHM.js → chunk-NG3CPWXD.js} +42 -42
- package/dist/{chunk-CKNLAQCV.mjs → chunk-RT4PSAEN.mjs} +45 -8
- package/dist/{chunk-OGINKMSL.js → chunk-UTBY3XQF.js} +490 -484
- package/dist/{chunk-N7OHVHBS.js → chunk-YOOFW6LR.js} +76 -20
- package/dist/{dist-72WLGYVZ.js → dist-DIPQCCIK.js} +568 -568
- package/dist/{dist-RTG3TU65.mjs → dist-YFPT5NJI.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 chunkNG3CPWXD_js = require('./chunk-NG3CPWXD.js');
|
|
4
4
|
var chunkCUUYYYC5_js = require('./chunk-CUUYYYC5.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkYOOFW6LR_js = require('./chunk-YOOFW6LR.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 chunkNG3CPWXD_js.getAnimationInitialStyle(preset, nativeAnimation);
|
|
22
22
|
}
|
|
23
23
|
function useVirtualizedSlides({
|
|
24
24
|
totalItems,
|
|
25
25
|
itemHeight,
|
|
26
|
-
overscan =
|
|
26
|
+
overscan = chunkNG3CPWXD_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 = chunkNG3CPWXD_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 >= chunkNG3CPWXD_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
|
+
}, chunkNG3CPWXD_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 = chunkNG3CPWXD_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 = chunkNG3CPWXD_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(chunkNG3CPWXD_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 = chunkNG3CPWXD_js.validateRoomId(config.roomId);
|
|
286
|
+
const transport = config.transport ?? chunkNG3CPWXD_js.resolveTransportForServerUrl(config.serverUrl);
|
|
287
287
|
if (transport === "webrtc") {
|
|
288
288
|
await initWebrtc();
|
|
289
289
|
return;
|
|
290
290
|
}
|
|
291
|
-
if (
|
|
291
|
+
if (chunkNG3CPWXD_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
|
+
}, chunkNG3CPWXD_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 = chunkNG3CPWXD_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 chunkNG3CPWXD_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(chunkNG3CPWXD_js.cloneSlide),
|
|
514
|
+
templateElementsBySlideId: chunkNG3CPWXD_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(chunkNG3CPWXD_js.cloneSlide));
|
|
528
528
|
setTemplateElementsBySlideId(
|
|
529
|
-
|
|
529
|
+
chunkNG3CPWXD_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 = chunkNG3CPWXD_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 = chunkNG3CPWXD_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
|
+
chunkNG3CPWXD_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 = chunkNG3CPWXD_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 = chunkNG3CPWXD_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 = chunkNG3CPWXD_js.PRESENTATION_CHANNEL_NAME;
|
|
1438
|
+
var AUDIENCE_HASH = chunkNG3CPWXD_js.PRESENTATION_HASH;
|
|
1439
|
+
var PRESENTER_MSG_ORIGIN = chunkNG3CPWXD_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1440
|
+
var AUDIENCE_NONCE_KEY = chunkNG3CPWXD_js.PRESENTATION_NONCE_KEY;
|
|
1441
1441
|
function generateSessionId() {
|
|
1442
|
-
return
|
|
1442
|
+
return chunkNG3CPWXD_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 ? chunkNG3CPWXD_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 chunkNG3CPWXD_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 = chunkNG3CPWXD_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1561
|
+
void chunkNG3CPWXD_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1562
1562
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1563
|
-
|
|
1563
|
+
chunkNG3CPWXD_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 chunkNG3CPWXD_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 (chunkNG3CPWXD_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 chunkNG3CPWXD_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 (!chunkNG3CPWXD_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 chunkNG3CPWXD_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: chunkNG3CPWXD_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 (chunkNG3CPWXD_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 ? chunkNG3CPWXD_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(chunkNG3CPWXD_js.createPresenterTimer());
|
|
2249
|
+
const [snapshot, setSnapshot] = React4.useState(() => chunkNG3CPWXD_js.createInitialPresentationSnapshot(slideIndex));
|
|
2250
2250
|
const patch = React4.useCallback((value) => {
|
|
2251
|
-
setSnapshot((current) =>
|
|
2251
|
+
setSnapshot((current) => chunkNG3CPWXD_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: chunkNG3CPWXD_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 = chunkNG3CPWXD_js.togglePresenterTimer(timerRef.current);
|
|
2269
2269
|
patch({
|
|
2270
2270
|
paused: timerRef.current.paused,
|
|
2271
|
-
elapsedMs:
|
|
2271
|
+
elapsedMs: chunkNG3CPWXD_js.presenterElapsed(timerRef.current)
|
|
2272
2272
|
});
|
|
2273
2273
|
},
|
|
2274
2274
|
resetTimer: () => {
|
|
2275
|
-
timerRef.current =
|
|
2275
|
+
timerRef.current = chunkNG3CPWXD_js.resetPresenterTimer();
|
|
2276
2276
|
patch({ paused: false, elapsedMs: 0 });
|
|
2277
2277
|
},
|
|
2278
2278
|
stepZoom: (direction) => setSnapshot(
|
|
2279
|
-
(current) =>
|
|
2280
|
-
zoom:
|
|
2279
|
+
(current) => chunkNG3CPWXD_js.mergePresentationSnapshot(current, {
|
|
2280
|
+
zoom: chunkNG3CPWXD_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 (!chunkYOOFW6LR_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 (!chunkYOOFW6LR_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) => chunkNG3CPWXD_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) => !chunkNG3CPWXD_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 chunkYOOFW6LR_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
|
+
chunkNG3CPWXD_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 } = chunkNG3CPWXD_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(chunkNG3CPWXD_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 chunkYOOFW6LR_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 chunkNG3CPWXD_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 (!chunkYOOFW6LR_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 ? chunkNG3CPWXD_js.normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : chunkNG3CPWXD_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 = chunkNG3CPWXD_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
4163
|
+
const textOrientation = chunkNG3CPWXD_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
4164
|
+
const verticalDirection = chunkNG3CPWXD_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 ? chunkNG3CPWXD_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: chunkNG3CPWXD_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
|
+
...chunkNG3CPWXD_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 (!chunkYOOFW6LR_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 = chunkNG3CPWXD_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
4238
|
+
const textOrientation = chunkNG3CPWXD_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
4239
|
+
const verticalDirection = chunkNG3CPWXD_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 = chunkYOOFW6LR_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 = chunkNG3CPWXD_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 chunkNG3CPWXD_js.buildTextFillCss(style);
|
|
4304
4304
|
}
|
|
4305
4305
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
4306
|
-
return
|
|
4306
|
+
return chunkNG3CPWXD_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}${chunkNG3CPWXD_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}${chunkNG3CPWXD_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}${chunkNG3CPWXD_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}${chunkNG3CPWXD_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}${chunkNG3CPWXD_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 = chunkNG3CPWXD_js.segmentByScript(text);
|
|
4683
4683
|
if (runs.length <= 1) {
|
|
4684
4684
|
if (runs.length === 1) {
|
|
4685
|
-
const font =
|
|
4685
|
+
const font = chunkNG3CPWXD_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 = chunkNG3CPWXD_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 = chunkNG3CPWXD_js.convertOmmlToMathMl(equationXml);
|
|
4766
|
+
const safeMathml = mathml ? chunkNG3CPWXD_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 = chunkNG3CPWXD_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 = chunkNG3CPWXD_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 ? chunkNG3CPWXD_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkNG3CPWXD_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
4877
|
+
const underlineDecoration = chunkNG3CPWXD_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 ? chunkYOOFW6LR_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 = chunkNG3CPWXD_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 ? chunkNG3CPWXD_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 ? chunkNG3CPWXD_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
4921
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkNG3CPWXD_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: chunkNG3CPWXD_js.buildTextShadowCss(segmentStyle),
|
|
4924
|
+
filter: chunkNG3CPWXD_js.buildTextRunFilterChain(segmentStyle),
|
|
4925
|
+
opacity: chunkNG3CPWXD_js.getTextAlphaOpacity(segmentStyle),
|
|
4926
|
+
WebkitBoxReflect: chunkNG3CPWXD_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 = chunkNG3CPWXD_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 = chunkNG3CPWXD_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 (!chunkYOOFW6LR_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 = chunkYOOFW6LR_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
5130
|
+
const elementRtl = chunkYOOFW6LR_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
5131
|
+
const elementAlign = chunkYOOFW6LR_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
5132
|
+
const bodyStyle = chunkYOOFW6LR_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 = chunkNG3CPWXD_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
5153
5153
|
const isRtlParagraph = paraRtl === true;
|
|
5154
|
-
const paraAlign =
|
|
5155
|
-
const cssTextAlign =
|
|
5154
|
+
const paraAlign = chunkNG3CPWXD_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
5155
|
+
const cssTextAlign = chunkNG3CPWXD_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 = chunkNG3CPWXD_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 (!chunkYOOFW6LR_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 (!chunkYOOFW6LR_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 (!chunkYOOFW6LR_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 ${chunkNG3CPWXD_js.colorWithOpacity(
|
|
5403
|
+
chunkNG3CPWXD_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
5404
5404
|
opacity
|
|
5405
5405
|
)}`;
|
|
5406
5406
|
}
|
|
5407
5407
|
function buildLineGlowFilter(element) {
|
|
5408
|
-
if (!
|
|
5408
|
+
if (!chunkYOOFW6LR_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 = chunkNG3CPWXD_js.colorWithOpacity(chunkNG3CPWXD_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 (!chunkYOOFW6LR_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 chunkNG3CPWXD_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
|
+
chunkNG3CPWXD_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 = chunkNG3CPWXD_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" : chunkNG3CPWXD_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" || !chunkYOOFW6LR_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 = chunkYOOFW6LR_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 (!chunkYOOFW6LR_js.hasShapeProperties(element)) {
|
|
5580
5580
|
return {};
|
|
5581
5581
|
}
|
|
5582
5582
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
5583
|
-
const clipPath =
|
|
5583
|
+
const clipPath = chunkNG3CPWXD_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 = chunkNG3CPWXD_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
5589
|
+
const fillGradient = chunkNG3CPWXD_js.buildCssGradientFromShapeStyle(element.shapeStyle) || element.shapeStyle?.fillGradient;
|
|
5590
|
+
const shadowCss = chunkNG3CPWXD_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
5591
|
+
const innerShadowCss = chunkNG3CPWXD_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
5592
|
+
const resolvedFillColor = chunkNG3CPWXD_js.colorWithOpacity(fillColor, fillOpacity);
|
|
5593
|
+
const resolvedStrokeColor = chunkNG3CPWXD_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 = chunkNG3CPWXD_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 = chunkNG3CPWXD_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 = chunkNG3CPWXD_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 = chunkNG3CPWXD_js.colorWithOpacity(chunkNG3CPWXD_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(#${chunkNG3CPWXD_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 = chunkNG3CPWXD_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 = chunkNG3CPWXD_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 = chunkNG3CPWXD_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 ? chunkNG3CPWXD_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : void 0,
|
|
5679
5679
|
borderColor: strokeWidth > 0 ? resolvedStrokeColor : void 0,
|
|
5680
|
-
borderStyle: strokeWidth > 0 ?
|
|
5680
|
+
borderStyle: strokeWidth > 0 ? chunkNG3CPWXD_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: chunkNG3CPWXD_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 chunkNG3CPWXD_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 chunkNG3CPWXD_js.clampUnitInterval(fallbackKey / 1e5);
|
|
5755
5755
|
}
|
|
5756
|
-
return
|
|
5756
|
+
return chunkNG3CPWXD_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: chunkNG3CPWXD_js.svgLineCap(shapeStyle?.lineCap),
|
|
5894
5894
|
lineJoin,
|
|
5895
5895
|
miterLimit,
|
|
5896
|
-
offsets:
|
|
5897
|
-
widths:
|
|
5896
|
+
offsets: chunkNG3CPWXD_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
5897
|
+
widths: chunkNG3CPWXD_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 ? chunkYOOFW6LR_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 ?? chunkNG3CPWXD_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 (!chunkYOOFW6LR_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" : chunkNG3CPWXD_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
6036
|
+
const strokePaint = animatesStroke ? "inherit" : chunkNG3CPWXD_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
6037
|
+
const dashType = chunkNG3CPWXD_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
6038
|
+
const dashArray = chunkNG3CPWXD_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 (chunkYOOFW6LR_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 = chunkYOOFW6LR_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 = chunkYOOFW6LR_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
6128
|
+
const bounds = chunkYOOFW6LR_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 = chunkNG3CPWXD_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
6192
6192
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
6193
|
-
const offsets =
|
|
6194
|
-
const widths =
|
|
6193
|
+
const offsets = chunkNG3CPWXD_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
6194
|
+
const widths = chunkNG3CPWXD_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 (!chunkYOOFW6LR_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 = chunkNG3CPWXD_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 = chunkNG3CPWXD_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 (!chunkYOOFW6LR_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 = chunkNG3CPWXD_js.clampCropValue(element.cropLeft);
|
|
6298
|
+
const cropTop = chunkNG3CPWXD_js.clampCropValue(element.cropTop);
|
|
6299
|
+
const cropRight = chunkNG3CPWXD_js.clampCropValue(element.cropRight);
|
|
6300
|
+
const cropBottom = chunkNG3CPWXD_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 = chunkNG3CPWXD_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
6317
|
+
const normalizedRight = chunkNG3CPWXD_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
6318
|
+
const normalizedTop = chunkNG3CPWXD_js.clampCropValue(cropTop * safeVerticalScale);
|
|
6319
|
+
const normalizedBottom = chunkNG3CPWXD_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 (!chunkYOOFW6LR_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 (!chunkYOOFW6LR_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 (!chunkYOOFW6LR_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 = chunkNG3CPWXD_js.parseDrawingColor(gs) ?? "#888888";
|
|
6491
|
+
const opacity = chunkNG3CPWXD_js.parseDrawingColorOpacity(gs);
|
|
6492
|
+
return { pos, color: chunkNG3CPWXD_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 = chunkNG3CPWXD_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
6534
|
+
const bgColor = chunkNG3CPWXD_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 = chunkNG3CPWXD_js.parseDrawingColor(ln["a:solidFill"]);
|
|
6646
6646
|
if (color) {
|
|
6647
|
-
const opacity =
|
|
6647
|
+
const opacity = chunkNG3CPWXD_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
6648
6648
|
const key = `${edge.prefix}`;
|
|
6649
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
6649
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkNG3CPWXD_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 = chunkNG3CPWXD_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 = chunkNG3CPWXD_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;
|
|
@@ -6732,8 +6732,8 @@ function parseParagraphAlignment(value) {
|
|
|
6732
6732
|
}
|
|
6733
6733
|
return "left";
|
|
6734
6734
|
}
|
|
6735
|
-
function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
6736
|
-
const cellStyle = { ...fallbackStyle };
|
|
6735
|
+
function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides, includeFallback = true) {
|
|
6736
|
+
const cellStyle = includeFallback ? { ...fallbackStyle } : {};
|
|
6737
6737
|
const txBody = cellXml["a:txBody"];
|
|
6738
6738
|
const paragraphs = ensureArrayValue(txBody?.["a:p"]);
|
|
6739
6739
|
const firstParagraph = paragraphs[0];
|
|
@@ -6756,10 +6756,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
6756
6756
|
if (runProps?.["@_u"] !== void 0) {
|
|
6757
6757
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
6758
6758
|
}
|
|
6759
|
-
const runColor =
|
|
6759
|
+
const runColor = chunkNG3CPWXD_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkNG3CPWXD_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
6760
6760
|
if (runColor) {
|
|
6761
|
-
const opacity =
|
|
6762
|
-
cellStyle.color =
|
|
6761
|
+
const opacity = chunkNG3CPWXD_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
6762
|
+
cellStyle.color = chunkNG3CPWXD_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) {
|
|
|
6769
6769
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
6770
6770
|
}
|
|
6771
6771
|
const cellProperties = cellXml["a:tcPr"];
|
|
6772
|
-
const cellFill =
|
|
6772
|
+
const cellFill = chunkNG3CPWXD_js.parseDrawingColor(
|
|
6773
6773
|
cellProperties?.["a:solidFill"],
|
|
6774
6774
|
schemeColorOverrides
|
|
6775
6775
|
);
|
|
6776
6776
|
if (cellFill) {
|
|
6777
|
-
const opacity =
|
|
6777
|
+
const opacity = chunkNG3CPWXD_js.parseDrawingColorOpacity(
|
|
6778
6778
|
cellProperties?.["a:solidFill"]
|
|
6779
6779
|
);
|
|
6780
|
-
cellStyle.backgroundColor =
|
|
6780
|
+
cellStyle.backgroundColor = chunkNG3CPWXD_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) {
|
|
|
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 = chunkNG3CPWXD_js.parseDrawingColor(
|
|
6796
6796
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
6797
6797
|
schemeColorOverrides
|
|
6798
|
-
) ||
|
|
6798
|
+
) || chunkNG3CPWXD_js.parseDrawingColor(
|
|
6799
6799
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
6800
6800
|
schemeColorOverrides
|
|
6801
|
-
) ||
|
|
6801
|
+
) || chunkNG3CPWXD_js.parseDrawingColor(
|
|
6802
6802
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
6803
6803
|
schemeColorOverrides
|
|
6804
|
-
) ||
|
|
6804
|
+
) || chunkNG3CPWXD_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 = chunkNG3CPWXD_js.tintColor2(color, 1 - fill.tint / 1e5);
|
|
6884
6884
|
}
|
|
6885
6885
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
6886
|
-
color =
|
|
6886
|
+
color = chunkNG3CPWXD_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 = chunkNG3CPWXD_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 = chunkNG3CPWXD_js.tintColor2(color, 1 - text.fontTint / 1e5);
|
|
6923
6923
|
}
|
|
6924
6924
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
6925
|
-
color =
|
|
6925
|
+
color = chunkNG3CPWXD_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 chunkNG3CPWXD_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 = chunkNG3CPWXD_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
7266
|
+
const bg = chunkNG3CPWXD_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
7267
|
+
const svgPattern = chunkNG3CPWXD_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 = chunkNG3CPWXD_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, chunkNG3CPWXD_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(() => chunkNG3CPWXD_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(chunkNG3CPWXD_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 = chunkNG3CPWXD_js.computeResizedRowHeight(
|
|
7439
|
+
drag.initialRowHeight ?? chunkNG3CPWXD_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 ?? chunkNG3CPWXD_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 chunkNG3CPWXD_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 = chunkNG3CPWXD_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 = chunkNG3CPWXD_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: chunkNG3CPWXD_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 chunkNG3CPWXD_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(
|
|
@@ -7723,7 +7723,12 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7723
7723
|
parsedTable.columnCount,
|
|
7724
7724
|
options?.styleCtx
|
|
7725
7725
|
);
|
|
7726
|
-
const xmlCellStyle = extractTableCellStyle(
|
|
7726
|
+
const xmlCellStyle = extractTableCellStyle(
|
|
7727
|
+
cell,
|
|
7728
|
+
textStyle,
|
|
7729
|
+
schemeOverrides,
|
|
7730
|
+
false
|
|
7731
|
+
);
|
|
7727
7732
|
const tdCellOverride = tableEl.tableData?.rows[rowIndex]?.cells[cellIndex]?.style;
|
|
7728
7733
|
const diag = getCellDiagonalBorders2(
|
|
7729
7734
|
tdCellOverride,
|
|
@@ -7737,6 +7742,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7737
7742
|
options?.styleCtx
|
|
7738
7743
|
);
|
|
7739
7744
|
const mergedStyle = {
|
|
7745
|
+
...textStyle,
|
|
7740
7746
|
...bandStyle,
|
|
7741
7747
|
...xmlCellStyle,
|
|
7742
7748
|
...tdCellOverride ? cellStyleToCss(tdCellOverride) : void 0,
|
|
@@ -7749,7 +7755,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7749
7755
|
"border px-1 py-0.5 align-top",
|
|
7750
7756
|
isEditable2 && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
7751
7757
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
7752
|
-
|
|
7758
|
+
chunkNG3CPWXD_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
7753
7759
|
),
|
|
7754
7760
|
colSpan,
|
|
7755
7761
|
rowSpan: rSpan,
|
|
@@ -7760,7 +7766,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7760
7766
|
}
|
|
7761
7767
|
event.stopPropagation();
|
|
7762
7768
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
7763
|
-
const rect =
|
|
7769
|
+
const rect = chunkNG3CPWXD_js.computeSelectionRect(
|
|
7764
7770
|
selectedCell.rowIndex,
|
|
7765
7771
|
selectedCell.columnIndex,
|
|
7766
7772
|
rowIndex,
|
|
@@ -7770,7 +7776,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7770
7776
|
options?.onSelectCell?.({
|
|
7771
7777
|
rowIndex: selectedCell.rowIndex,
|
|
7772
7778
|
columnIndex: selectedCell.columnIndex,
|
|
7773
|
-
selectedCells:
|
|
7779
|
+
selectedCells: chunkNG3CPWXD_js.rectToCells(rect)
|
|
7774
7780
|
});
|
|
7775
7781
|
} else {
|
|
7776
7782
|
options?.onSelectCell?.({
|
|
@@ -7825,24 +7831,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
7825
7831
|
}
|
|
7826
7832
|
var LEGEND_ITEM_WIDTH = 80;
|
|
7827
7833
|
function partAttrs(part) {
|
|
7828
|
-
return part ?
|
|
7834
|
+
return part ? chunkNG3CPWXD_js.chartPartToAttrs(part) : void 0;
|
|
7829
7835
|
}
|
|
7830
7836
|
function resolveReactPalette(chartData) {
|
|
7831
7837
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
7832
7838
|
return chartData.colorPalette;
|
|
7833
7839
|
}
|
|
7834
|
-
return [...
|
|
7840
|
+
return [...chunkNG3CPWXD_js.getChartStylePalette(chartData.style?.styleId)];
|
|
7835
7841
|
}
|
|
7836
7842
|
function buildReactChartViewModel(element) {
|
|
7837
7843
|
if (element.type !== "chart" || !element.chartData) {
|
|
7838
|
-
return
|
|
7844
|
+
return chunkNG3CPWXD_js.buildChartViewModel(element);
|
|
7839
7845
|
}
|
|
7840
7846
|
const palette = resolveReactPalette(element.chartData);
|
|
7841
7847
|
const themedElement = {
|
|
7842
7848
|
...element,
|
|
7843
7849
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
7844
7850
|
};
|
|
7845
|
-
return
|
|
7851
|
+
return chunkNG3CPWXD_js.buildChartViewModel(themedElement);
|
|
7846
7852
|
}
|
|
7847
7853
|
function renderPrimitive(prim, key) {
|
|
7848
7854
|
switch (prim.kind) {
|
|
@@ -8231,7 +8237,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8231
8237
|
const unmatchedRows = [];
|
|
8232
8238
|
categories.forEach((cat, i) => {
|
|
8233
8239
|
const value = values[i] ?? 0;
|
|
8234
|
-
const code =
|
|
8240
|
+
const code = chunkNG3CPWXD_js.resolveRegionCode(cat);
|
|
8235
8241
|
if (code) {
|
|
8236
8242
|
regionValueMap.set(code, { value, label: cat });
|
|
8237
8243
|
} else {
|
|
@@ -8269,8 +8275,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8269
8275
|
let fill = "#e2e8f0";
|
|
8270
8276
|
let dataLabel = null;
|
|
8271
8277
|
if (entry) {
|
|
8272
|
-
const t =
|
|
8273
|
-
fill =
|
|
8278
|
+
const t = chunkNG3CPWXD_js.normalizeValue(entry.value, minVal, maxVal);
|
|
8279
|
+
fill = chunkNG3CPWXD_js.sequentialColorScale(t);
|
|
8274
8280
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
8275
8281
|
"text",
|
|
8276
8282
|
{
|
|
@@ -8281,7 +8287,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8281
8287
|
fontWeight: 600,
|
|
8282
8288
|
fill: "#1e293b",
|
|
8283
8289
|
style: { pointerEvents: "none" },
|
|
8284
|
-
children:
|
|
8290
|
+
children: chunkNG3CPWXD_js.formatAxisValue(entry.value)
|
|
8285
8291
|
},
|
|
8286
8292
|
`${element.id}-map-dl-${region.code}`
|
|
8287
8293
|
);
|
|
@@ -8299,7 +8305,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8299
8305
|
opacity: 0.9,
|
|
8300
8306
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
8301
8307
|
region.name,
|
|
8302
|
-
entry ? `: ${
|
|
8308
|
+
entry ? `: ${chunkNG3CPWXD_js.formatAxisValue(entry.value)}` : ""
|
|
8303
8309
|
] })
|
|
8304
8310
|
}
|
|
8305
8311
|
),
|
|
@@ -8337,7 +8343,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8337
8343
|
fontSize: 7,
|
|
8338
8344
|
fill: "#64748b",
|
|
8339
8345
|
textAnchor: "middle",
|
|
8340
|
-
children:
|
|
8346
|
+
children: chunkNG3CPWXD_js.formatAxisValue(minVal)
|
|
8341
8347
|
},
|
|
8342
8348
|
`${element.id}-map-legend-min`
|
|
8343
8349
|
),
|
|
@@ -8349,7 +8355,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8349
8355
|
fontSize: 7,
|
|
8350
8356
|
fill: "#64748b",
|
|
8351
8357
|
textAnchor: "middle",
|
|
8352
|
-
children:
|
|
8358
|
+
children: chunkNG3CPWXD_js.formatAxisValue(maxVal)
|
|
8353
8359
|
},
|
|
8354
8360
|
`${element.id}-map-legend-max`
|
|
8355
8361
|
)
|
|
@@ -8415,7 +8421,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
8415
8421
|
y,
|
|
8416
8422
|
fontSize,
|
|
8417
8423
|
fill: "#475569",
|
|
8418
|
-
children:
|
|
8424
|
+
children: chunkNG3CPWXD_js.formatAxisValue(row.value)
|
|
8419
8425
|
},
|
|
8420
8426
|
`${element.id}-map-ft-val-${i}`
|
|
8421
8427
|
)
|
|
@@ -8486,7 +8492,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
8486
8492
|
|
|
8487
8493
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
8488
8494
|
function sColor(series, idx) {
|
|
8489
|
-
return
|
|
8495
|
+
return chunkNG3CPWXD_js.seriesColor(series, idx);
|
|
8490
8496
|
}
|
|
8491
8497
|
function valToY(val, range, topY, bottomY) {
|
|
8492
8498
|
const usable = bottomY - topY;
|
|
@@ -9025,7 +9031,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
9025
9031
|
width: 10,
|
|
9026
9032
|
height: 10,
|
|
9027
9033
|
rx: 2,
|
|
9028
|
-
fill:
|
|
9034
|
+
fill: chunkNG3CPWXD_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
9029
9035
|
},
|
|
9030
9036
|
`${id}-leg-r-${i}`
|
|
9031
9037
|
)
|
|
@@ -9049,7 +9055,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
9049
9055
|
width: 10,
|
|
9050
9056
|
height: 10,
|
|
9051
9057
|
rx: 2,
|
|
9052
|
-
fill:
|
|
9058
|
+
fill: chunkNG3CPWXD_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
9053
9059
|
}
|
|
9054
9060
|
),
|
|
9055
9061
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -9062,9 +9068,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
9062
9068
|
}
|
|
9063
9069
|
const lines = [];
|
|
9064
9070
|
if (range.logScale && range.logBase) {
|
|
9065
|
-
const ticks =
|
|
9071
|
+
const ticks = chunkNG3CPWXD_js.generateLogTicks(range);
|
|
9066
9072
|
ticks.forEach((tickVal, i) => {
|
|
9067
|
-
const y =
|
|
9073
|
+
const y = chunkNG3CPWXD_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
9068
9074
|
lines.push(
|
|
9069
9075
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9070
9076
|
"line",
|
|
@@ -9085,7 +9091,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
9085
9091
|
const steps = 4;
|
|
9086
9092
|
for (let i = 0; i <= steps; i++) {
|
|
9087
9093
|
const val = range.min + range.span * i / steps;
|
|
9088
|
-
const y =
|
|
9094
|
+
const y = chunkNG3CPWXD_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
9089
9095
|
lines.push(
|
|
9090
9096
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9091
9097
|
"line",
|
|
@@ -9109,9 +9115,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9109
9115
|
const labels = [];
|
|
9110
9116
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
9111
9117
|
if (range.logScale && range.logBase) {
|
|
9112
|
-
const ticks =
|
|
9118
|
+
const ticks = chunkNG3CPWXD_js.generateLogTicks(range);
|
|
9113
9119
|
ticks.forEach((tickVal, i) => {
|
|
9114
|
-
const y =
|
|
9120
|
+
const y = chunkNG3CPWXD_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
9115
9121
|
labels.push(
|
|
9116
9122
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9117
9123
|
"text",
|
|
@@ -9121,7 +9127,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9121
9127
|
textAnchor: "end",
|
|
9122
9128
|
fontSize: 8,
|
|
9123
9129
|
fill: "#64748b",
|
|
9124
|
-
children: hasDisplayUnits ?
|
|
9130
|
+
children: hasDisplayUnits ? chunkNG3CPWXD_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkNG3CPWXD_js.formatAxisValue(tickVal)
|
|
9125
9131
|
},
|
|
9126
9132
|
`${id}-vaxis-log-${i}`
|
|
9127
9133
|
)
|
|
@@ -9131,7 +9137,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9131
9137
|
const steps = 4;
|
|
9132
9138
|
for (let i = 0; i <= steps; i++) {
|
|
9133
9139
|
const val = range.min + range.span * i / steps;
|
|
9134
|
-
const y =
|
|
9140
|
+
const y = chunkNG3CPWXD_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
9135
9141
|
labels.push(
|
|
9136
9142
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9137
9143
|
"text",
|
|
@@ -9141,7 +9147,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9141
9147
|
textAnchor: "end",
|
|
9142
9148
|
fontSize: 8,
|
|
9143
9149
|
fill: "#64748b",
|
|
9144
|
-
children: hasDisplayUnits ?
|
|
9150
|
+
children: hasDisplayUnits ? chunkNG3CPWXD_js.formatAxisValueWithUnits(val, axisFormatting) : chunkNG3CPWXD_js.formatAxisValue(val)
|
|
9145
9151
|
},
|
|
9146
9152
|
`${id}-vaxis-${i}`
|
|
9147
9153
|
)
|
|
@@ -9149,7 +9155,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
9149
9155
|
}
|
|
9150
9156
|
}
|
|
9151
9157
|
if (hasDisplayUnits) {
|
|
9152
|
-
const unitLabel =
|
|
9158
|
+
const unitLabel = chunkNG3CPWXD_js.getDisplayUnitLabel(
|
|
9153
9159
|
axisFormatting.displayUnits,
|
|
9154
9160
|
axisFormatting.displayUnitsLabel
|
|
9155
9161
|
);
|
|
@@ -9224,7 +9230,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
9224
9230
|
if (range.min >= 0) {
|
|
9225
9231
|
return null;
|
|
9226
9232
|
}
|
|
9227
|
-
const y =
|
|
9233
|
+
const y = chunkNG3CPWXD_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
9228
9234
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9229
9235
|
"line",
|
|
9230
9236
|
{
|
|
@@ -9248,7 +9254,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
9248
9254
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
9249
9255
|
for (let i = 0; i <= steps; i++) {
|
|
9250
9256
|
const val = range.min + range.span * i / steps;
|
|
9251
|
-
const y =
|
|
9257
|
+
const y = chunkNG3CPWXD_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
9252
9258
|
labels.push(
|
|
9253
9259
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9254
9260
|
"text",
|
|
@@ -9260,7 +9266,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
9260
9266
|
fontFamily,
|
|
9261
9267
|
fontWeight,
|
|
9262
9268
|
fill: fontColor,
|
|
9263
|
-
children: hasDisplayUnits ?
|
|
9269
|
+
children: hasDisplayUnits ? chunkNG3CPWXD_js.formatAxisValueWithUnits(val, axisFormatting) : chunkNG3CPWXD_js.formatAxisValue(val)
|
|
9264
9270
|
},
|
|
9265
9271
|
`${id}-sec-vaxis-${i}`
|
|
9266
9272
|
)
|
|
@@ -9284,7 +9290,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
9284
9290
|
);
|
|
9285
9291
|
}
|
|
9286
9292
|
if (hasDisplayUnits) {
|
|
9287
|
-
const unitLabel =
|
|
9293
|
+
const unitLabel = chunkNG3CPWXD_js.getDisplayUnitLabel(
|
|
9288
9294
|
axisFormatting.displayUnits,
|
|
9289
9295
|
axisFormatting.displayUnitsLabel
|
|
9290
9296
|
);
|
|
@@ -9315,7 +9321,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
9315
9321
|
const ticks = [];
|
|
9316
9322
|
for (let i = 0; i <= steps; i++) {
|
|
9317
9323
|
const val = range.min + range.span * i / steps;
|
|
9318
|
-
const y =
|
|
9324
|
+
const y = chunkNG3CPWXD_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
9319
9325
|
ticks.push(
|
|
9320
9326
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9321
9327
|
"line",
|
|
@@ -9342,7 +9348,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
9342
9348
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
9343
9349
|
for (let i = 0; i <= steps; i++) {
|
|
9344
9350
|
const val = range.min + range.span * i / steps;
|
|
9345
|
-
const y =
|
|
9351
|
+
const y = chunkNG3CPWXD_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
9346
9352
|
lines.push(
|
|
9347
9353
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9348
9354
|
"line",
|
|
@@ -9504,7 +9510,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
9504
9510
|
width: 8,
|
|
9505
9511
|
height: 8,
|
|
9506
9512
|
borderRadius: 2,
|
|
9507
|
-
backgroundColor:
|
|
9513
|
+
backgroundColor: chunkNG3CPWXD_js.seriesColor(
|
|
9508
9514
|
s,
|
|
9509
9515
|
si,
|
|
9510
9516
|
chartData.style?.styleId,
|
|
@@ -9543,8 +9549,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
9543
9549
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
9544
9550
|
const style = chartData.style;
|
|
9545
9551
|
const legendPos = style?.legendPosition || "b";
|
|
9546
|
-
const range =
|
|
9547
|
-
const layout =
|
|
9552
|
+
const range = chunkNG3CPWXD_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
9553
|
+
const layout = chunkNG3CPWXD_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
9548
9554
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
9549
9555
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
9550
9556
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -9565,10 +9571,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
9565
9571
|
const close = closeSeries.values[ci] ?? high;
|
|
9566
9572
|
const isUp = close >= open;
|
|
9567
9573
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
9568
|
-
const highY =
|
|
9569
|
-
const lowY =
|
|
9570
|
-
const openY =
|
|
9571
|
-
const closeY =
|
|
9574
|
+
const highY = chunkNG3CPWXD_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
9575
|
+
const lowY = chunkNG3CPWXD_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
9576
|
+
const openY = chunkNG3CPWXD_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
9577
|
+
const closeY = chunkNG3CPWXD_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
9572
9578
|
elements.push(
|
|
9573
9579
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9574
9580
|
"line",
|
|
@@ -9611,7 +9617,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
9611
9617
|
textAnchor: "middle",
|
|
9612
9618
|
fontSize: 7,
|
|
9613
9619
|
fill: "#334155",
|
|
9614
|
-
children:
|
|
9620
|
+
children: chunkNG3CPWXD_js.formatAxisValue(close)
|
|
9615
9621
|
},
|
|
9616
9622
|
`${element.id}-stock-dl-${ci}`
|
|
9617
9623
|
)
|
|
@@ -9653,7 +9659,7 @@ function FailedToLoad() {
|
|
|
9653
9659
|
var LazySurfaceChart3DScene = React4__default.default.lazy(
|
|
9654
9660
|
async () => {
|
|
9655
9661
|
try {
|
|
9656
|
-
return await import('./SurfaceChart3DScene-
|
|
9662
|
+
return await import('./SurfaceChart3DScene-63SAKPUY.js');
|
|
9657
9663
|
} catch {
|
|
9658
9664
|
return { default: FailedToLoad };
|
|
9659
9665
|
}
|
|
@@ -9677,7 +9683,7 @@ var SurfaceChart3DErrorBoundary = class extends React4__default.default.Componen
|
|
|
9677
9683
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
9678
9684
|
const rows = chartData.series.length;
|
|
9679
9685
|
const cols = Math.max(categoryLabels.length, 1);
|
|
9680
|
-
const range =
|
|
9686
|
+
const range = chunkNG3CPWXD_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
9681
9687
|
const heightMap = new Float32Array(rows * cols);
|
|
9682
9688
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
9683
9689
|
for (let r = 0; r < rows; r++) {
|
|
@@ -9797,8 +9803,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
9797
9803
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
9798
9804
|
const style = chartData.style;
|
|
9799
9805
|
const legendPos = style?.legendPosition || "b";
|
|
9800
|
-
const layout =
|
|
9801
|
-
const range =
|
|
9806
|
+
const layout = chunkNG3CPWXD_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
9807
|
+
const range = chunkNG3CPWXD_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
9802
9808
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
9803
9809
|
const seriesCount = chartData.series.length;
|
|
9804
9810
|
const cols = catCount - 1;
|
|
@@ -9888,8 +9894,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
9888
9894
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
9889
9895
|
const style = chartData.style;
|
|
9890
9896
|
const legendPos = style?.legendPosition || "b";
|
|
9891
|
-
const layout =
|
|
9892
|
-
const range =
|
|
9897
|
+
const layout = chunkNG3CPWXD_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
9898
|
+
const range = chunkNG3CPWXD_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
9893
9899
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
9894
9900
|
const seriesCount = chartData.series.length;
|
|
9895
9901
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -9952,7 +9958,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
9952
9958
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
9953
9959
|
const style = chartData.style;
|
|
9954
9960
|
const legendPos = style?.legendPosition || "b";
|
|
9955
|
-
const layout =
|
|
9961
|
+
const layout = chunkNG3CPWXD_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
9956
9962
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
9957
9963
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
9958
9964
|
const rects = [];
|
|
@@ -9975,7 +9981,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
9975
9981
|
y: curY,
|
|
9976
9982
|
width: Math.max(w - 1, 1),
|
|
9977
9983
|
height: Math.max(h - 1, 1),
|
|
9978
|
-
fill:
|
|
9984
|
+
fill: chunkNG3CPWXD_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
9979
9985
|
rx: 2,
|
|
9980
9986
|
opacity: 0.85
|
|
9981
9987
|
},
|
|
@@ -10028,8 +10034,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
10028
10034
|
const style = chartData.style;
|
|
10029
10035
|
const legendPos = style?.legendPosition || "b";
|
|
10030
10036
|
const values = chartData.series[0]?.values ?? [];
|
|
10031
|
-
const range =
|
|
10032
|
-
const layout =
|
|
10037
|
+
const range = chunkNG3CPWXD_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
10038
|
+
const layout = chunkNG3CPWXD_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
10033
10039
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
10034
10040
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
10035
10041
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -10040,8 +10046,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
10040
10046
|
const isLast = i === values.length - 1;
|
|
10041
10047
|
const startVal = isLast ? 0 : runningTotal;
|
|
10042
10048
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
10043
|
-
const barStartY =
|
|
10044
|
-
const barEndY =
|
|
10049
|
+
const barStartY = chunkNG3CPWXD_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
10050
|
+
const barEndY = chunkNG3CPWXD_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
10045
10051
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
10046
10052
|
const y = Math.min(barStartY, barEndY);
|
|
10047
10053
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -10070,7 +10076,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
10070
10076
|
textAnchor: "middle",
|
|
10071
10077
|
fontSize: 7,
|
|
10072
10078
|
fill: "#334155",
|
|
10073
|
-
children:
|
|
10079
|
+
children: chunkNG3CPWXD_js.formatAxisValue(isLast ? endVal : val)
|
|
10074
10080
|
},
|
|
10075
10081
|
`${element.id}-wf-dl-${i}`
|
|
10076
10082
|
)
|
|
@@ -10118,18 +10124,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
10118
10124
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
10119
10125
|
const style = chartData.style;
|
|
10120
10126
|
const legendPos = style?.legendPosition || "b";
|
|
10121
|
-
const layoutOpts =
|
|
10127
|
+
const layoutOpts = chunkNG3CPWXD_js.computeLayoutOptions(
|
|
10122
10128
|
chartData.axes,
|
|
10123
10129
|
chartData.dataTable,
|
|
10124
10130
|
chartData.series.length
|
|
10125
10131
|
);
|
|
10126
|
-
const layout =
|
|
10127
|
-
const { primary, secondary } =
|
|
10132
|
+
const layout = chunkNG3CPWXD_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
10133
|
+
const { primary, secondary } = chunkNG3CPWXD_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
10128
10134
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
10129
10135
|
const secondarySeries = secondary.map((e) => e.series);
|
|
10130
|
-
const range =
|
|
10131
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
10132
|
-
const secondaryAxisFmt =
|
|
10136
|
+
const range = chunkNG3CPWXD_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
10137
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkNG3CPWXD_js.computeValueRange(secondarySeries) : void 0;
|
|
10138
|
+
const secondaryAxisFmt = chunkNG3CPWXD_js.getSecondaryValueAxis(chartData.axes);
|
|
10133
10139
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
10134
10140
|
const barSeriesCount = 1;
|
|
10135
10141
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -10145,8 +10151,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10145
10151
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
10146
10152
|
barSeries.values.forEach((val, vi) => {
|
|
10147
10153
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
10148
|
-
const zeroY =
|
|
10149
|
-
const valY =
|
|
10154
|
+
const zeroY = chunkNG3CPWXD_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
10155
|
+
const valY = chunkNG3CPWXD_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
10150
10156
|
const y = Math.min(zeroY, valY);
|
|
10151
10157
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
10152
10158
|
barElements.push(
|
|
@@ -10157,7 +10163,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10157
10163
|
y,
|
|
10158
10164
|
width: barWidth,
|
|
10159
10165
|
height: h,
|
|
10160
|
-
fill:
|
|
10166
|
+
fill: chunkNG3CPWXD_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
10161
10167
|
rx: 1
|
|
10162
10168
|
},
|
|
10163
10169
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -10173,7 +10179,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10173
10179
|
textAnchor: "middle",
|
|
10174
10180
|
fontSize: 7,
|
|
10175
10181
|
fill: "#334155",
|
|
10176
|
-
children:
|
|
10182
|
+
children: chunkNG3CPWXD_js.formatAxisValue(val)
|
|
10177
10183
|
},
|
|
10178
10184
|
`${element.id}-combo-bar-dl-${vi}`
|
|
10179
10185
|
)
|
|
@@ -10190,10 +10196,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10190
10196
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
10191
10197
|
const points = series.values.map((val, vi) => {
|
|
10192
10198
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
10193
|
-
const y =
|
|
10199
|
+
const y = chunkNG3CPWXD_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
10194
10200
|
return { x, y, val };
|
|
10195
10201
|
});
|
|
10196
|
-
const c =
|
|
10202
|
+
const c = chunkNG3CPWXD_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
10197
10203
|
lineElements.push(
|
|
10198
10204
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10199
10205
|
"polyline",
|
|
@@ -10220,7 +10226,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
10220
10226
|
textAnchor: "middle",
|
|
10221
10227
|
fontSize: 7,
|
|
10222
10228
|
fill: "#334155",
|
|
10223
|
-
children:
|
|
10229
|
+
children: chunkNG3CPWXD_js.formatAxisValue(p.val)
|
|
10224
10230
|
},
|
|
10225
10231
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
10226
10232
|
)
|
|
@@ -12031,14 +12037,14 @@ function buildNotesPdf(pages) {
|
|
|
12031
12037
|
notes: page.notes,
|
|
12032
12038
|
slideNumber: page.slideNumber
|
|
12033
12039
|
}));
|
|
12034
|
-
const bytes =
|
|
12040
|
+
const bytes = chunkNG3CPWXD_js.buildNotesPdfBytes(images, meta);
|
|
12035
12041
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
12036
12042
|
return URL.createObjectURL(blob);
|
|
12037
12043
|
}
|
|
12038
12044
|
|
|
12039
12045
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
12040
12046
|
function buildPdfFromImageData(images) {
|
|
12041
|
-
const bytes =
|
|
12047
|
+
const bytes = chunkNG3CPWXD_js.buildSlidesPdfBytes(images);
|
|
12042
12048
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
12043
12049
|
return URL.createObjectURL(blob);
|
|
12044
12050
|
}
|
|
@@ -12047,7 +12053,7 @@ function buildPdfFromImageData(images) {
|
|
|
12047
12053
|
var activePreview = null;
|
|
12048
12054
|
function startPreviewAnimation(elementId, preset, options) {
|
|
12049
12055
|
stopPreviewAnimation();
|
|
12050
|
-
const descriptor =
|
|
12056
|
+
const descriptor = chunkNG3CPWXD_js.buildPreviewAnimation(preset, options);
|
|
12051
12057
|
if (!descriptor) {
|
|
12052
12058
|
return;
|
|
12053
12059
|
}
|
|
@@ -12125,7 +12131,7 @@ function useElementOperations(input) {
|
|
|
12125
12131
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
12126
12132
|
const updateElementById = React4.useCallback(
|
|
12127
12133
|
(elementId, updates) => {
|
|
12128
|
-
if (
|
|
12134
|
+
if (chunkNG3CPWXD_js.isTemplateElementId(elementId)) {
|
|
12129
12135
|
const slideId = activeSlide?.id;
|
|
12130
12136
|
if (slideId) {
|
|
12131
12137
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -12165,7 +12171,7 @@ function useElementOperations(input) {
|
|
|
12165
12171
|
);
|
|
12166
12172
|
const updateSelectedShapeStyle = React4.useCallback(
|
|
12167
12173
|
(updates) => {
|
|
12168
|
-
if (!selectedElement || !
|
|
12174
|
+
if (!selectedElement || !chunkYOOFW6LR_js.hasShapeProperties(selectedElement)) {
|
|
12169
12175
|
return;
|
|
12170
12176
|
}
|
|
12171
12177
|
updateSelectedElement({
|
|
@@ -12176,17 +12182,17 @@ function useElementOperations(input) {
|
|
|
12176
12182
|
);
|
|
12177
12183
|
const updateSelectedTextStyle = React4.useCallback(
|
|
12178
12184
|
(updates) => {
|
|
12179
|
-
if (!selectedElement || !
|
|
12185
|
+
if (!selectedElement || !chunkYOOFW6LR_js.hasTextProperties(selectedElement)) {
|
|
12180
12186
|
return;
|
|
12181
12187
|
}
|
|
12182
|
-
const inlineSel =
|
|
12188
|
+
const inlineSel = chunkNG3CPWXD_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
12183
12189
|
if (inlineSel && selectedElement.textSegments) {
|
|
12184
|
-
const { newSegments: newSegments2, newSelection } =
|
|
12190
|
+
const { newSegments: newSegments2, newSelection } = chunkNG3CPWXD_js.applyStyleToSelectedSegments(
|
|
12185
12191
|
selectedElement.textSegments,
|
|
12186
12192
|
inlineSel,
|
|
12187
12193
|
updates
|
|
12188
12194
|
);
|
|
12189
|
-
|
|
12195
|
+
chunkNG3CPWXD_js.setPendingSelectionRestore(newSelection);
|
|
12190
12196
|
updateSelectedElement({
|
|
12191
12197
|
textSegments: newSegments2
|
|
12192
12198
|
});
|
|
@@ -12206,12 +12212,12 @@ function useElementOperations(input) {
|
|
|
12206
12212
|
);
|
|
12207
12213
|
const updateSelectedTextCase = React4.useCallback(
|
|
12208
12214
|
(mode) => {
|
|
12209
|
-
if (!selectedElement || !
|
|
12215
|
+
if (!selectedElement || !chunkYOOFW6LR_js.hasTextProperties(selectedElement)) {
|
|
12210
12216
|
return;
|
|
12211
12217
|
}
|
|
12212
|
-
const inlineSel =
|
|
12218
|
+
const inlineSel = chunkNG3CPWXD_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
12213
12219
|
if (inlineSel && selectedElement.textSegments) {
|
|
12214
|
-
const newSegments =
|
|
12220
|
+
const newSegments = chunkNG3CPWXD_js.applyCaseTransformToSegments(
|
|
12215
12221
|
selectedElement.textSegments,
|
|
12216
12222
|
inlineSel,
|
|
12217
12223
|
mode
|
|
@@ -12221,14 +12227,14 @@ function useElementOperations(input) {
|
|
|
12221
12227
|
}
|
|
12222
12228
|
const updates = {};
|
|
12223
12229
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
12224
|
-
updates.textSegments =
|
|
12230
|
+
updates.textSegments = chunkNG3CPWXD_js.applyCaseTransformToSegments(
|
|
12225
12231
|
selectedElement.textSegments,
|
|
12226
12232
|
null,
|
|
12227
12233
|
mode
|
|
12228
12234
|
);
|
|
12229
12235
|
}
|
|
12230
12236
|
if (typeof selectedElement.text === "string") {
|
|
12231
|
-
updates.text =
|
|
12237
|
+
updates.text = chunkNG3CPWXD_js.transformTextCase(selectedElement.text, mode);
|
|
12232
12238
|
}
|
|
12233
12239
|
updateSelectedElement(updates);
|
|
12234
12240
|
},
|
|
@@ -12283,7 +12289,7 @@ function useSectionOperations(input) {
|
|
|
12283
12289
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
12284
12290
|
const addSection2 = React4.useCallback(
|
|
12285
12291
|
(name, afterSlideIndex) => {
|
|
12286
|
-
const result =
|
|
12292
|
+
const result = chunkNG3CPWXD_js.addSection(sections, slides, name, afterSlideIndex);
|
|
12287
12293
|
setSlides(result.slides);
|
|
12288
12294
|
setSections(result.sections);
|
|
12289
12295
|
markDirty();
|
|
@@ -12292,7 +12298,7 @@ function useSectionOperations(input) {
|
|
|
12292
12298
|
);
|
|
12293
12299
|
const renameSection2 = React4.useCallback(
|
|
12294
12300
|
(sectionId, newName) => {
|
|
12295
|
-
const result =
|
|
12301
|
+
const result = chunkNG3CPWXD_js.renameSection(sections, slides, sectionId, newName);
|
|
12296
12302
|
setSections(result.sections);
|
|
12297
12303
|
setSlides(result.slides);
|
|
12298
12304
|
markDirty();
|
|
@@ -12301,7 +12307,7 @@ function useSectionOperations(input) {
|
|
|
12301
12307
|
);
|
|
12302
12308
|
const deleteSection2 = React4.useCallback(
|
|
12303
12309
|
(sectionId) => {
|
|
12304
|
-
const result =
|
|
12310
|
+
const result = chunkNG3CPWXD_js.deleteSection(sections, slides, sectionId);
|
|
12305
12311
|
setSections(result.sections);
|
|
12306
12312
|
setSlides(result.slides);
|
|
12307
12313
|
markDirty();
|
|
@@ -12310,21 +12316,21 @@ function useSectionOperations(input) {
|
|
|
12310
12316
|
);
|
|
12311
12317
|
const moveSectionUp2 = React4.useCallback(
|
|
12312
12318
|
(sectionId) => {
|
|
12313
|
-
setSections(
|
|
12319
|
+
setSections(chunkNG3CPWXD_js.moveSectionUp(sections, sectionId));
|
|
12314
12320
|
markDirty();
|
|
12315
12321
|
},
|
|
12316
12322
|
[sections, setSections, markDirty]
|
|
12317
12323
|
);
|
|
12318
12324
|
const moveSectionDown2 = React4.useCallback(
|
|
12319
12325
|
(sectionId) => {
|
|
12320
|
-
setSections(
|
|
12326
|
+
setSections(chunkNG3CPWXD_js.moveSectionDown(sections, sectionId));
|
|
12321
12327
|
markDirty();
|
|
12322
12328
|
},
|
|
12323
12329
|
[sections, setSections, markDirty]
|
|
12324
12330
|
);
|
|
12325
12331
|
const moveSlidesToSection2 = React4.useCallback(
|
|
12326
12332
|
(slideIndexes, targetSectionId) => {
|
|
12327
|
-
const result =
|
|
12333
|
+
const result = chunkNG3CPWXD_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
12328
12334
|
setSlides(result.slides);
|
|
12329
12335
|
setSections(result.sections);
|
|
12330
12336
|
markDirty();
|
|
@@ -12343,7 +12349,7 @@ function useSectionOperations(input) {
|
|
|
12343
12349
|
|
|
12344
12350
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
12345
12351
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
12346
|
-
const resized =
|
|
12352
|
+
const resized = chunkNG3CPWXD_js.applyResize(
|
|
12347
12353
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
12348
12354
|
handle,
|
|
12349
12355
|
dx,
|
|
@@ -12355,7 +12361,7 @@ function computeResizeGeometry(handle, startX, startY, startWidth, startHeight,
|
|
|
12355
12361
|
if (!snapToGrid) {
|
|
12356
12362
|
return box;
|
|
12357
12363
|
}
|
|
12358
|
-
return
|
|
12364
|
+
return chunkNG3CPWXD_js.snapBoxToGrid(box, handle, gridSpacingPx, MIN_ELEMENT_SIZE);
|
|
12359
12365
|
}
|
|
12360
12366
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
12361
12367
|
const range = startWidth || 200;
|
|
@@ -12465,7 +12471,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
12465
12471
|
width: el.width,
|
|
12466
12472
|
height: el.height
|
|
12467
12473
|
}));
|
|
12468
|
-
const snapResult =
|
|
12474
|
+
const snapResult = chunkNG3CPWXD_js.computeSnapToShape(
|
|
12469
12475
|
targetX,
|
|
12470
12476
|
targetY,
|
|
12471
12477
|
primaryEl.width,
|
|
@@ -12608,13 +12614,13 @@ function processPointerUp(input) {
|
|
|
12608
12614
|
if (i !== activeSlideIndex) {
|
|
12609
12615
|
return s;
|
|
12610
12616
|
}
|
|
12611
|
-
const rerouted =
|
|
12617
|
+
const rerouted = chunkNG3CPWXD_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
12612
12618
|
if (rerouted.length === 0) {
|
|
12613
12619
|
return s;
|
|
12614
12620
|
}
|
|
12615
12621
|
return {
|
|
12616
12622
|
...s,
|
|
12617
|
-
elements:
|
|
12623
|
+
elements: chunkNG3CPWXD_js.applyReroutedConnectors(s.elements, rerouted)
|
|
12618
12624
|
};
|
|
12619
12625
|
})
|
|
12620
12626
|
);
|
|
@@ -12633,9 +12639,9 @@ function processPointerUp(input) {
|
|
|
12633
12639
|
}
|
|
12634
12640
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
12635
12641
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
12636
|
-
const hitIds =
|
|
12642
|
+
const hitIds = chunkNG3CPWXD_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
12637
12643
|
if (marquee.additive) {
|
|
12638
|
-
const merged =
|
|
12644
|
+
const merged = chunkNG3CPWXD_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
12639
12645
|
if (merged.length > 0) {
|
|
12640
12646
|
applySelection(merged[0], merged);
|
|
12641
12647
|
} else {
|
|
@@ -12658,8 +12664,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
12658
12664
|
}
|
|
12659
12665
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
12660
12666
|
});
|
|
12661
|
-
const rerouted =
|
|
12662
|
-
return
|
|
12667
|
+
const rerouted = chunkNG3CPWXD_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
12668
|
+
return chunkNG3CPWXD_js.applyReroutedConnectors(movedElements, rerouted);
|
|
12663
12669
|
};
|
|
12664
12670
|
if (editTemplateMode) {
|
|
12665
12671
|
const slideId = activeSlide?.id;
|
|
@@ -12810,9 +12816,9 @@ function useCanvasInteractions(input) {
|
|
|
12810
12816
|
return;
|
|
12811
12817
|
}
|
|
12812
12818
|
const el = elementLookup.get(editId);
|
|
12813
|
-
if (el &&
|
|
12819
|
+
if (el && chunkYOOFW6LR_js.hasTextProperties(el)) {
|
|
12814
12820
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
12815
|
-
const newSegments =
|
|
12821
|
+
const newSegments = chunkNG3CPWXD_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
12816
12822
|
ops.updateElementById(editId, {
|
|
12817
12823
|
text: committedText,
|
|
12818
12824
|
textSegments: newSegments
|
|
@@ -12823,7 +12829,7 @@ function useCanvasInteractions(input) {
|
|
|
12823
12829
|
setInlineEditingText("");
|
|
12824
12830
|
};
|
|
12825
12831
|
const openEquationEditorForElement = (el) => {
|
|
12826
|
-
if (!
|
|
12832
|
+
if (!chunkYOOFW6LR_js.hasTextProperties(el)) {
|
|
12827
12833
|
return false;
|
|
12828
12834
|
}
|
|
12829
12835
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -12852,7 +12858,7 @@ function useCanvasInteractions(input) {
|
|
|
12852
12858
|
justSelectedRef.current = false;
|
|
12853
12859
|
} else {
|
|
12854
12860
|
const el = elementLookup.get(elementId);
|
|
12855
|
-
if (el &&
|
|
12861
|
+
if (el && chunkYOOFW6LR_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
12856
12862
|
if (!openEquationEditorForElement(el)) {
|
|
12857
12863
|
setInlineEditingElementId(elementId);
|
|
12858
12864
|
setInlineEditingText(el.text ?? "");
|
|
@@ -12871,7 +12877,7 @@ function useCanvasInteractions(input) {
|
|
|
12871
12877
|
if (openEquationEditorForElement(el)) {
|
|
12872
12878
|
return;
|
|
12873
12879
|
}
|
|
12874
|
-
if (
|
|
12880
|
+
if (chunkYOOFW6LR_js.hasTextProperties(el)) {
|
|
12875
12881
|
setInlineEditingElementId(elementId);
|
|
12876
12882
|
setInlineEditingText(el.text ?? "");
|
|
12877
12883
|
}
|
|
@@ -13061,7 +13067,7 @@ function createFileHandlers(deps) {
|
|
|
13061
13067
|
h = Math.round(h * scale);
|
|
13062
13068
|
}
|
|
13063
13069
|
addElement({
|
|
13064
|
-
id:
|
|
13070
|
+
id: chunkNG3CPWXD_js.generateElementId(),
|
|
13065
13071
|
type: "image",
|
|
13066
13072
|
x: Math.round((canvasSize.width - w) / 2),
|
|
13067
13073
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -13072,7 +13078,7 @@ function createFileHandlers(deps) {
|
|
|
13072
13078
|
};
|
|
13073
13079
|
img.onerror = () => {
|
|
13074
13080
|
addElement({
|
|
13075
|
-
id:
|
|
13081
|
+
id: chunkNG3CPWXD_js.generateElementId(),
|
|
13076
13082
|
type: "image",
|
|
13077
13083
|
x: 100,
|
|
13078
13084
|
y: 100,
|
|
@@ -13098,7 +13104,7 @@ function createFileHandlers(deps) {
|
|
|
13098
13104
|
const elFilePath = file.path;
|
|
13099
13105
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
13100
13106
|
addElement({
|
|
13101
|
-
id:
|
|
13107
|
+
id: chunkNG3CPWXD_js.generateElementId(),
|
|
13102
13108
|
type: "media",
|
|
13103
13109
|
mediaType,
|
|
13104
13110
|
mediaMimeType: file.type || void 0,
|
|
@@ -13273,13 +13279,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
13273
13279
|
return;
|
|
13274
13280
|
}
|
|
13275
13281
|
addElement({
|
|
13276
|
-
id:
|
|
13282
|
+
id: chunkNG3CPWXD_js.generateElementId(),
|
|
13277
13283
|
type: "smartArt",
|
|
13278
13284
|
x: 100,
|
|
13279
13285
|
y: 120,
|
|
13280
13286
|
width: 600,
|
|
13281
13287
|
height: 340,
|
|
13282
|
-
smartArtData:
|
|
13288
|
+
smartArtData: chunkNG3CPWXD_js.buildSmartArtPresetData(
|
|
13283
13289
|
layout,
|
|
13284
13290
|
defaultItems,
|
|
13285
13291
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -13291,7 +13297,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
13291
13297
|
return;
|
|
13292
13298
|
}
|
|
13293
13299
|
addElement({
|
|
13294
|
-
id:
|
|
13300
|
+
id: chunkNG3CPWXD_js.generateElementId(),
|
|
13295
13301
|
type: "shape",
|
|
13296
13302
|
x: 120,
|
|
13297
13303
|
y: 200,
|
|
@@ -13350,7 +13356,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
13350
13356
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
13351
13357
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
13352
13358
|
addElement({
|
|
13353
|
-
id:
|
|
13359
|
+
id: chunkNG3CPWXD_js.generateElementId(),
|
|
13354
13360
|
type: "shape",
|
|
13355
13361
|
x: 120,
|
|
13356
13362
|
y: 200,
|
|
@@ -13372,11 +13378,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
13372
13378
|
if (!activeSlide) {
|
|
13373
13379
|
return;
|
|
13374
13380
|
}
|
|
13375
|
-
const preset =
|
|
13381
|
+
const preset = chunkNG3CPWXD_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
13376
13382
|
if (!preset) {
|
|
13377
13383
|
return;
|
|
13378
13384
|
}
|
|
13379
|
-
const defaultPptxAction =
|
|
13385
|
+
const defaultPptxAction = chunkYOOFW6LR_js.elementActionToPptxAction({
|
|
13380
13386
|
trigger: "click",
|
|
13381
13387
|
type: preset.defaultAction
|
|
13382
13388
|
});
|
|
@@ -13385,7 +13391,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
13385
13391
|
defaultPptxAction.highlightClick = true;
|
|
13386
13392
|
}
|
|
13387
13393
|
addElement({
|
|
13388
|
-
id:
|
|
13394
|
+
id: chunkNG3CPWXD_js.generateElementId(),
|
|
13389
13395
|
type: "shape",
|
|
13390
13396
|
x: 150,
|
|
13391
13397
|
y: 150,
|
|
@@ -13452,7 +13458,7 @@ function useInsertElements(input) {
|
|
|
13452
13458
|
return;
|
|
13453
13459
|
}
|
|
13454
13460
|
addElement({
|
|
13455
|
-
id:
|
|
13461
|
+
id: chunkNG3CPWXD_js.generateElementId(),
|
|
13456
13462
|
type: "text",
|
|
13457
13463
|
x: 100,
|
|
13458
13464
|
y: 100,
|
|
@@ -13467,7 +13473,7 @@ function useInsertElements(input) {
|
|
|
13467
13473
|
return;
|
|
13468
13474
|
}
|
|
13469
13475
|
addElement({
|
|
13470
|
-
id:
|
|
13476
|
+
id: chunkNG3CPWXD_js.generateElementId(),
|
|
13471
13477
|
type: "shape",
|
|
13472
13478
|
x: 150,
|
|
13473
13479
|
y: 150,
|
|
@@ -13486,15 +13492,15 @@ function useInsertElements(input) {
|
|
|
13486
13492
|
return;
|
|
13487
13493
|
}
|
|
13488
13494
|
addElement({
|
|
13489
|
-
...
|
|
13490
|
-
id:
|
|
13495
|
+
...chunkNG3CPWXD_js.newTableElement(DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
13496
|
+
id: chunkNG3CPWXD_js.generateElementId()
|
|
13491
13497
|
});
|
|
13492
13498
|
};
|
|
13493
13499
|
const handleAddChart = (chartType) => {
|
|
13494
13500
|
if (!activeSlide) {
|
|
13495
13501
|
return;
|
|
13496
13502
|
}
|
|
13497
|
-
addElement(
|
|
13503
|
+
addElement(chunkNG3CPWXD_js.createDefaultChartElement(chartType));
|
|
13498
13504
|
};
|
|
13499
13505
|
const structured = createStructuredElementHandlers({
|
|
13500
13506
|
activeSlide,
|
|
@@ -13564,7 +13570,7 @@ function useClipboardHandlers(input) {
|
|
|
13564
13570
|
if (!selectedElement) {
|
|
13565
13571
|
return;
|
|
13566
13572
|
}
|
|
13567
|
-
setClipboardPayload(
|
|
13573
|
+
setClipboardPayload(chunkNG3CPWXD_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
13568
13574
|
};
|
|
13569
13575
|
const handleDelete = () => {
|
|
13570
13576
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -13581,7 +13587,7 @@ function useClipboardHandlers(input) {
|
|
|
13581
13587
|
handleDelete();
|
|
13582
13588
|
};
|
|
13583
13589
|
const insertClone = (source) => {
|
|
13584
|
-
const clone =
|
|
13590
|
+
const clone = chunkNG3CPWXD_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
13585
13591
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
13586
13592
|
ops.applySelection(clone.id);
|
|
13587
13593
|
history.markDirty();
|
|
@@ -13616,7 +13622,7 @@ function resolveShapePath(el) {
|
|
|
13616
13622
|
return el.pathData;
|
|
13617
13623
|
}
|
|
13618
13624
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
13619
|
-
const clipPath =
|
|
13625
|
+
const clipPath = chunkYOOFW6LR_js.getPresetShapeClipPath(el.shapeType);
|
|
13620
13626
|
if (clipPath) {
|
|
13621
13627
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
13622
13628
|
if (svgPath) {
|
|
@@ -13667,7 +13673,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
13667
13673
|
return parts.join(" ");
|
|
13668
13674
|
}
|
|
13669
13675
|
function transformPathToGlobal(pathData, el) {
|
|
13670
|
-
const polys =
|
|
13676
|
+
const polys = chunkYOOFW6LR_js.svgPathToPolygons(pathData);
|
|
13671
13677
|
if (polys.length === 0) {
|
|
13672
13678
|
return pathData;
|
|
13673
13679
|
}
|
|
@@ -13687,10 +13693,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
13687
13693
|
y: pt.y * scaleY + el.y
|
|
13688
13694
|
}))
|
|
13689
13695
|
);
|
|
13690
|
-
return
|
|
13696
|
+
return chunkYOOFW6LR_js.polygonsToSvgPath(transformed);
|
|
13691
13697
|
}
|
|
13692
13698
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
13693
|
-
const polys =
|
|
13699
|
+
const polys = chunkYOOFW6LR_js.svgPathToPolygons(pathData);
|
|
13694
13700
|
if (polys.length === 0) {
|
|
13695
13701
|
return pathData;
|
|
13696
13702
|
}
|
|
@@ -13700,10 +13706,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
13700
13706
|
y: pt.y - y
|
|
13701
13707
|
}))
|
|
13702
13708
|
);
|
|
13703
|
-
return
|
|
13709
|
+
return chunkYOOFW6LR_js.polygonsToSvgPath(transformed);
|
|
13704
13710
|
}
|
|
13705
13711
|
function pathBounds(pathData) {
|
|
13706
|
-
const polys =
|
|
13712
|
+
const polys = chunkYOOFW6LR_js.svgPathToPolygons(pathData);
|
|
13707
13713
|
let minX = Infinity;
|
|
13708
13714
|
let minY = Infinity;
|
|
13709
13715
|
let maxX = -Infinity;
|
|
@@ -13762,7 +13768,7 @@ function useMergeShapesHandler(input) {
|
|
|
13762
13768
|
let allFragments = [];
|
|
13763
13769
|
let remaining = globalPaths[0];
|
|
13764
13770
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
13765
|
-
const frags =
|
|
13771
|
+
const frags = chunkYOOFW6LR_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
13766
13772
|
if (Array.isArray(frags)) {
|
|
13767
13773
|
allFragments = frags;
|
|
13768
13774
|
}
|
|
@@ -13791,7 +13797,7 @@ function useMergeShapesHandler(input) {
|
|
|
13791
13797
|
bounds.height
|
|
13792
13798
|
);
|
|
13793
13799
|
const newEl = {
|
|
13794
|
-
id:
|
|
13800
|
+
id: chunkNG3CPWXD_js.generateElementId(),
|
|
13795
13801
|
type: "shape",
|
|
13796
13802
|
x: bounds.x,
|
|
13797
13803
|
y: bounds.y,
|
|
@@ -13829,7 +13835,7 @@ function useMergeShapesHandler(input) {
|
|
|
13829
13835
|
} else {
|
|
13830
13836
|
let resultPath = globalPaths[0];
|
|
13831
13837
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
13832
|
-
const result =
|
|
13838
|
+
const result = chunkYOOFW6LR_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
13833
13839
|
if (typeof result === "string") {
|
|
13834
13840
|
resultPath = result;
|
|
13835
13841
|
}
|
|
@@ -13850,7 +13856,7 @@ function useMergeShapesHandler(input) {
|
|
|
13850
13856
|
);
|
|
13851
13857
|
const primary = targets[0];
|
|
13852
13858
|
const newEl = {
|
|
13853
|
-
id:
|
|
13859
|
+
id: chunkNG3CPWXD_js.generateElementId(),
|
|
13854
13860
|
type: "shape",
|
|
13855
13861
|
x: bounds.x,
|
|
13856
13862
|
y: bounds.y,
|
|
@@ -13913,7 +13919,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13913
13919
|
if (ids.length < 2 || !activeSlide) {
|
|
13914
13920
|
return;
|
|
13915
13921
|
}
|
|
13916
|
-
const { elements, groupId } =
|
|
13922
|
+
const { elements, groupId } = chunkNG3CPWXD_js.groupElements(ops.activeElements, ids, chunkNG3CPWXD_js.generateElementId());
|
|
13917
13923
|
if (groupId === null) {
|
|
13918
13924
|
return;
|
|
13919
13925
|
}
|
|
@@ -13926,12 +13932,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13926
13932
|
return;
|
|
13927
13933
|
}
|
|
13928
13934
|
const group = selectedElement;
|
|
13929
|
-
const intoTemplate =
|
|
13935
|
+
const intoTemplate = chunkNG3CPWXD_js.isTemplateElementId(group.id);
|
|
13930
13936
|
const ungrouped = group.children.map((child) => ({
|
|
13931
13937
|
...structuredClone(child),
|
|
13932
13938
|
// Keep child ids in the same store as the group so later edits route
|
|
13933
13939
|
// correctly: template groups yield template-prefixed child ids.
|
|
13934
|
-
id: intoTemplate ?
|
|
13940
|
+
id: intoTemplate ? chunkNG3CPWXD_js.makeCloneId(true, child.id || group.id) : child.id || chunkNG3CPWXD_js.generateElementId(),
|
|
13935
13941
|
x: child.x + group.x,
|
|
13936
13942
|
y: child.y + group.y
|
|
13937
13943
|
}));
|
|
@@ -13955,7 +13961,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13955
13961
|
if (!edge) {
|
|
13956
13962
|
return;
|
|
13957
13963
|
}
|
|
13958
|
-
const positions =
|
|
13964
|
+
const positions = chunkNG3CPWXD_js.alignElements(selectedElements, edge);
|
|
13959
13965
|
for (const [id, pos] of positions) {
|
|
13960
13966
|
const el = elementLookup.get(id);
|
|
13961
13967
|
if (!el) {
|
|
@@ -13973,7 +13979,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13973
13979
|
if (!distAxis) {
|
|
13974
13980
|
return;
|
|
13975
13981
|
}
|
|
13976
|
-
const positions =
|
|
13982
|
+
const positions = chunkNG3CPWXD_js.distributeElements(selectedElements, distAxis);
|
|
13977
13983
|
for (const [id, pos] of positions) {
|
|
13978
13984
|
const el = elementLookup.get(id);
|
|
13979
13985
|
if (!el) {
|
|
@@ -13990,7 +13996,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13990
13996
|
}
|
|
13991
13997
|
const id = selectedElement.id;
|
|
13992
13998
|
ops.updateActiveElements(
|
|
13993
|
-
(els) => direction === "forward" ?
|
|
13999
|
+
(els) => direction === "forward" ? chunkNG3CPWXD_js.bringForward(els, id) : direction === "backward" ? chunkNG3CPWXD_js.sendBackward(els, id) : els
|
|
13994
14000
|
);
|
|
13995
14001
|
history.markDirty();
|
|
13996
14002
|
};
|
|
@@ -14000,7 +14006,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
14000
14006
|
}
|
|
14001
14007
|
const id = selectedElement.id;
|
|
14002
14008
|
ops.updateActiveElements(
|
|
14003
|
-
(els) => direction === "front" ?
|
|
14009
|
+
(els) => direction === "front" ? chunkNG3CPWXD_js.bringToFront(els, id) : chunkNG3CPWXD_js.sendToBack(els, id)
|
|
14004
14010
|
);
|
|
14005
14011
|
history.markDirty();
|
|
14006
14012
|
};
|
|
@@ -14122,7 +14128,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
14122
14128
|
function useSlideManagement(input) {
|
|
14123
14129
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
14124
14130
|
const handleAddSlide = () => {
|
|
14125
|
-
const newSlide =
|
|
14131
|
+
const newSlide = chunkNG3CPWXD_js.createBlankSlide(slides.length + 1);
|
|
14126
14132
|
ops.updateSlides((prev) => {
|
|
14127
14133
|
const next = [...prev];
|
|
14128
14134
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -14185,7 +14191,7 @@ function useSlideManagement(input) {
|
|
|
14185
14191
|
}
|
|
14186
14192
|
const clone = {
|
|
14187
14193
|
...src,
|
|
14188
|
-
id:
|
|
14194
|
+
id: chunkNG3CPWXD_js.makeSlideId(),
|
|
14189
14195
|
elements: src.elements.map((el) => ({
|
|
14190
14196
|
...el,
|
|
14191
14197
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -14217,7 +14223,7 @@ function useSlideManagement(input) {
|
|
|
14217
14223
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
14218
14224
|
const insertAt = activeSlideIndex + 1;
|
|
14219
14225
|
const draft = {
|
|
14220
|
-
...
|
|
14226
|
+
...chunkNG3CPWXD_js.createBlankSlide(slides.length + 1),
|
|
14221
14227
|
layoutPath,
|
|
14222
14228
|
...layoutName ? { layoutName } : {}
|
|
14223
14229
|
};
|
|
@@ -14278,7 +14284,7 @@ function createTableMergeHandlers(input) {
|
|
|
14278
14284
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
14279
14285
|
return;
|
|
14280
14286
|
}
|
|
14281
|
-
const newTableData =
|
|
14287
|
+
const newTableData = chunkNG3CPWXD_js.mergeCells(
|
|
14282
14288
|
[
|
|
14283
14289
|
{ row: rowIndex, col: columnIndex },
|
|
14284
14290
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -14286,7 +14292,7 @@ function createTableMergeHandlers(input) {
|
|
|
14286
14292
|
td
|
|
14287
14293
|
);
|
|
14288
14294
|
const updates = { tableData: newTableData };
|
|
14289
|
-
const newRawXml =
|
|
14295
|
+
const newRawXml = chunkYOOFW6LR_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
14290
14296
|
if (newRawXml) {
|
|
14291
14297
|
updates.rawXml = newRawXml;
|
|
14292
14298
|
}
|
|
@@ -14312,7 +14318,7 @@ function createTableMergeHandlers(input) {
|
|
|
14312
14318
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
14313
14319
|
return;
|
|
14314
14320
|
}
|
|
14315
|
-
const newTableData =
|
|
14321
|
+
const newTableData = chunkNG3CPWXD_js.mergeCells(
|
|
14316
14322
|
[
|
|
14317
14323
|
{ row: rowIndex, col: columnIndex },
|
|
14318
14324
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -14320,7 +14326,7 @@ function createTableMergeHandlers(input) {
|
|
|
14320
14326
|
td
|
|
14321
14327
|
);
|
|
14322
14328
|
const updates = { tableData: newTableData };
|
|
14323
|
-
const newRawXml =
|
|
14329
|
+
const newRawXml = chunkYOOFW6LR_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
14324
14330
|
if (newRawXml) {
|
|
14325
14331
|
updates.rawXml = newRawXml;
|
|
14326
14332
|
}
|
|
@@ -14335,9 +14341,9 @@ function createTableMergeHandlers(input) {
|
|
|
14335
14341
|
return;
|
|
14336
14342
|
}
|
|
14337
14343
|
const td = selectedElement.tableData;
|
|
14338
|
-
const newTableData =
|
|
14344
|
+
const newTableData = chunkNG3CPWXD_js.mergeCells(ts.selectedCells, td);
|
|
14339
14345
|
const updates = { tableData: newTableData };
|
|
14340
|
-
const newRawXml =
|
|
14346
|
+
const newRawXml = chunkYOOFW6LR_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
14341
14347
|
if (newRawXml) {
|
|
14342
14348
|
updates.rawXml = newRawXml;
|
|
14343
14349
|
}
|
|
@@ -14354,9 +14360,9 @@ function createTableMergeHandlers(input) {
|
|
|
14354
14360
|
}
|
|
14355
14361
|
const { rowIndex, columnIndex } = ts;
|
|
14356
14362
|
const td = selectedElement.tableData;
|
|
14357
|
-
const newTableData =
|
|
14363
|
+
const newTableData = chunkNG3CPWXD_js.splitCell(rowIndex, columnIndex, td);
|
|
14358
14364
|
const updates = { tableData: newTableData };
|
|
14359
|
-
const newRawXml =
|
|
14365
|
+
const newRawXml = chunkYOOFW6LR_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
14360
14366
|
if (newRawXml) {
|
|
14361
14367
|
updates.rawXml = newRawXml;
|
|
14362
14368
|
}
|
|
@@ -14400,7 +14406,7 @@ function createTableStructHandlers(input) {
|
|
|
14400
14406
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
14401
14407
|
}
|
|
14402
14408
|
if (el.rawXml) {
|
|
14403
|
-
const newRawXml =
|
|
14409
|
+
const newRawXml = chunkYOOFW6LR_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
14404
14410
|
if (newRawXml) {
|
|
14405
14411
|
updates.rawXml = newRawXml;
|
|
14406
14412
|
}
|
|
@@ -14424,7 +14430,7 @@ function createTableStructHandlers(input) {
|
|
|
14424
14430
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
14425
14431
|
const updates = {};
|
|
14426
14432
|
if (selectedElement.rawXml) {
|
|
14427
|
-
const newRawXml =
|
|
14433
|
+
const newRawXml = chunkYOOFW6LR_js.updateCellTextStyleInRawXml(
|
|
14428
14434
|
selectedElement,
|
|
14429
14435
|
rowIndex,
|
|
14430
14436
|
colIndex,
|
|
@@ -14488,9 +14494,9 @@ function createTableStructHandlers(input) {
|
|
|
14488
14494
|
return;
|
|
14489
14495
|
}
|
|
14490
14496
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
14491
|
-
const newTableData =
|
|
14497
|
+
const newTableData = chunkNG3CPWXD_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
14492
14498
|
const updates = { tableData: newTableData };
|
|
14493
|
-
const newRawXml =
|
|
14499
|
+
const newRawXml = chunkYOOFW6LR_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
14494
14500
|
if (newRawXml) {
|
|
14495
14501
|
updates.rawXml = newRawXml;
|
|
14496
14502
|
}
|
|
@@ -14503,12 +14509,12 @@ function createTableStructHandlers(input) {
|
|
|
14503
14509
|
}
|
|
14504
14510
|
const td = selectedElement.tableData;
|
|
14505
14511
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
14506
|
-
const newTableData =
|
|
14512
|
+
const newTableData = chunkNG3CPWXD_js.deleteTableRow(td, rowIdx);
|
|
14507
14513
|
if (newTableData === td) {
|
|
14508
14514
|
return;
|
|
14509
14515
|
}
|
|
14510
14516
|
const updates = { tableData: newTableData };
|
|
14511
|
-
const newRawXml =
|
|
14517
|
+
const newRawXml = chunkYOOFW6LR_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
14512
14518
|
if (newRawXml) {
|
|
14513
14519
|
updates.rawXml = newRawXml;
|
|
14514
14520
|
}
|
|
@@ -14520,9 +14526,9 @@ function createTableStructHandlers(input) {
|
|
|
14520
14526
|
return;
|
|
14521
14527
|
}
|
|
14522
14528
|
const colIdx = ts?.columnIndex ?? 0;
|
|
14523
|
-
const newTableData =
|
|
14529
|
+
const newTableData = chunkNG3CPWXD_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
14524
14530
|
const updates = { tableData: newTableData };
|
|
14525
|
-
const newRawXml =
|
|
14531
|
+
const newRawXml = chunkYOOFW6LR_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
14526
14532
|
if (newRawXml) {
|
|
14527
14533
|
updates.rawXml = newRawXml;
|
|
14528
14534
|
}
|
|
@@ -14535,12 +14541,12 @@ function createTableStructHandlers(input) {
|
|
|
14535
14541
|
}
|
|
14536
14542
|
const td = selectedElement.tableData;
|
|
14537
14543
|
const colIdx = ts?.columnIndex ?? 0;
|
|
14538
|
-
const newTableData =
|
|
14544
|
+
const newTableData = chunkNG3CPWXD_js.deleteTableColumn(td, colIdx);
|
|
14539
14545
|
if (newTableData === td) {
|
|
14540
14546
|
return;
|
|
14541
14547
|
}
|
|
14542
14548
|
const updates = { tableData: newTableData };
|
|
14543
|
-
const newRawXml =
|
|
14549
|
+
const newRawXml = chunkYOOFW6LR_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
14544
14550
|
if (newRawXml) {
|
|
14545
14551
|
updates.rawXml = newRawXml;
|
|
14546
14552
|
}
|
|
@@ -14576,8 +14582,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
14576
14582
|
return html2canvasPro(element, {
|
|
14577
14583
|
...options,
|
|
14578
14584
|
onclone: async (doc, clonedEl) => {
|
|
14579
|
-
await
|
|
14580
|
-
|
|
14585
|
+
await chunkNG3CPWXD_js.normalizeColorsForCapture(doc, clonedEl);
|
|
14586
|
+
chunkNG3CPWXD_js.preprocessCssForCapture(clonedEl);
|
|
14581
14587
|
if (typeof userOnClone === "function") {
|
|
14582
14588
|
userOnClone(doc, clonedEl);
|
|
14583
14589
|
}
|
|
@@ -14633,7 +14639,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
14633
14639
|
}
|
|
14634
14640
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
14635
14641
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
14636
|
-
|
|
14642
|
+
chunkNG3CPWXD_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
14637
14643
|
}
|
|
14638
14644
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
14639
14645
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -14655,7 +14661,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
14655
14661
|
continue;
|
|
14656
14662
|
}
|
|
14657
14663
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
14658
|
-
images.push(
|
|
14664
|
+
images.push(chunkNG3CPWXD_js.canvasToJpegData(canvas));
|
|
14659
14665
|
}
|
|
14660
14666
|
onProgress?.(totalSlides, totalSlides);
|
|
14661
14667
|
setActiveSlide(currentSlideIndex);
|
|
@@ -14663,7 +14669,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
14663
14669
|
throw new Error(chunkCUUYYYC5_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
14664
14670
|
}
|
|
14665
14671
|
const pdfBlobUrl = buildPdfFromImageData(images);
|
|
14666
|
-
|
|
14672
|
+
chunkNG3CPWXD_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
14667
14673
|
}
|
|
14668
14674
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
14669
14675
|
const { scale = 2, onProgress } = options;
|
|
@@ -14712,7 +14718,7 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
14712
14718
|
throw new Error(chunkCUUYYYC5_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
14713
14719
|
}
|
|
14714
14720
|
const pdfDataUrl = buildNotesPdf(pages);
|
|
14715
|
-
|
|
14721
|
+
chunkNG3CPWXD_js.downloadDataUrl(pdfDataUrl, filename);
|
|
14716
14722
|
}
|
|
14717
14723
|
|
|
14718
14724
|
// src/viewer/utils/export-video.ts
|
|
@@ -14756,7 +14762,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
14756
14762
|
const fps = 30;
|
|
14757
14763
|
const stream = recordingCanvas.captureStream(fps);
|
|
14758
14764
|
const recorder = new MediaRecorder(stream, {
|
|
14759
|
-
mimeType:
|
|
14765
|
+
mimeType: chunkNG3CPWXD_js.pickSupportedMimeType([...chunkNG3CPWXD_js.WEBM_MIME_CANDIDATES]),
|
|
14760
14766
|
videoBitsPerSecond: 5e6
|
|
14761
14767
|
});
|
|
14762
14768
|
const chunks = [];
|
|
@@ -14779,8 +14785,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
14779
14785
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
14780
14786
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
14781
14787
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
14782
|
-
const frameInterval =
|
|
14783
|
-
const framesNeeded =
|
|
14788
|
+
const frameInterval = chunkNG3CPWXD_js.fpsToFrameIntervalMs(fps);
|
|
14789
|
+
const framesNeeded = chunkNG3CPWXD_js.segmentFrameCount(duration, fps);
|
|
14784
14790
|
for (let f = 0; f < framesNeeded; f++) {
|
|
14785
14791
|
if (signal?.aborted) {
|
|
14786
14792
|
recorder.stop();
|
|
@@ -14829,7 +14835,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
14829
14835
|
if (frames.length === 0) {
|
|
14830
14836
|
throw new Error(chunkCUUYYYC5_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
14831
14837
|
}
|
|
14832
|
-
const gifBytes =
|
|
14838
|
+
const gifBytes = chunkNG3CPWXD_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
14833
14839
|
onProgress?.(totalSlides, totalSlides);
|
|
14834
14840
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
14835
14841
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -14883,7 +14889,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
14883
14889
|
continue;
|
|
14884
14890
|
}
|
|
14885
14891
|
onProgress?.(processedCount, data.slides.length);
|
|
14886
|
-
let svg =
|
|
14892
|
+
let svg = chunkYOOFW6LR_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
14887
14893
|
if (embedFonts && fontFaces?.length) {
|
|
14888
14894
|
svg = injectFontFaces(svg, fontFaces);
|
|
14889
14895
|
}
|
|
@@ -14943,7 +14949,7 @@ function useExportSaveAs(input) {
|
|
|
14943
14949
|
}
|
|
14944
14950
|
setExportProgress(70);
|
|
14945
14951
|
setExportStatusMessage("Writing README...");
|
|
14946
|
-
const readme =
|
|
14952
|
+
const readme = chunkNG3CPWXD_js.generatePackageReadme(pptxFilename);
|
|
14947
14953
|
pkgFolder.file("README.txt", readme);
|
|
14948
14954
|
if (abortCtrl.signal.aborted) {
|
|
14949
14955
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -14954,7 +14960,7 @@ function useExportSaveAs(input) {
|
|
|
14954
14960
|
setExportProgress(95);
|
|
14955
14961
|
setExportStatusMessage("Downloading...");
|
|
14956
14962
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
14957
|
-
|
|
14963
|
+
chunkNG3CPWXD_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
14958
14964
|
setExportProgress(100);
|
|
14959
14965
|
} catch (err) {
|
|
14960
14966
|
if (err.name !== "AbortError") {
|
|
@@ -14977,7 +14983,7 @@ function useExportSaveAs(input) {
|
|
|
14977
14983
|
const blob = new Blob([data], {
|
|
14978
14984
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
14979
14985
|
});
|
|
14980
|
-
|
|
14986
|
+
chunkNG3CPWXD_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
14981
14987
|
} catch (err) {
|
|
14982
14988
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
14983
14989
|
}
|
|
@@ -14990,7 +14996,7 @@ function useExportSaveAs(input) {
|
|
|
14990
14996
|
const pptxGuides = guides.map((g) => ({
|
|
14991
14997
|
id: g.id,
|
|
14992
14998
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
14993
|
-
positionEmu:
|
|
14999
|
+
positionEmu: chunkYOOFW6LR_js.guidePxToEmu(g.position)
|
|
14994
15000
|
}));
|
|
14995
15001
|
return {
|
|
14996
15002
|
...slide,
|
|
@@ -15054,7 +15060,7 @@ function safeConfirm(message) {
|
|
|
15054
15060
|
}
|
|
15055
15061
|
}
|
|
15056
15062
|
function downloadBlob2(blob, filename) {
|
|
15057
|
-
|
|
15063
|
+
chunkNG3CPWXD_js.downloadBlob(blob, chunkNG3CPWXD_js.sanitizeDownloadFilename(filename));
|
|
15058
15064
|
}
|
|
15059
15065
|
|
|
15060
15066
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -15155,21 +15161,21 @@ function useExportHandlers(input) {
|
|
|
15155
15161
|
{
|
|
15156
15162
|
scale: 2,
|
|
15157
15163
|
onProgress: (current, total) => {
|
|
15158
|
-
setExportProgress(
|
|
15159
|
-
setExportStatusMessage(
|
|
15164
|
+
setExportProgress(chunkNG3CPWXD_js.slideProgressPercent(current, total));
|
|
15165
|
+
setExportStatusMessage(chunkNG3CPWXD_js.slideStatusLabel("Rendering", current, total));
|
|
15160
15166
|
},
|
|
15161
15167
|
signal: abortCtrl.signal
|
|
15162
15168
|
}
|
|
15163
15169
|
);
|
|
15164
|
-
setExportProgress(
|
|
15170
|
+
setExportProgress(chunkNG3CPWXD_js.EXPORT_ASSEMBLING_PERCENT);
|
|
15165
15171
|
setExportStatusMessage("Building PDF...");
|
|
15166
15172
|
await new Promise((r) => {
|
|
15167
15173
|
setTimeout(r, 100);
|
|
15168
15174
|
});
|
|
15169
|
-
setExportProgress(
|
|
15175
|
+
setExportProgress(chunkNG3CPWXD_js.EXPORT_DONE_PERCENT);
|
|
15170
15176
|
setExportStatusMessage("Done!");
|
|
15171
15177
|
} catch (err) {
|
|
15172
|
-
if (!
|
|
15178
|
+
if (!chunkNG3CPWXD_js.isExportAbortError(err)) {
|
|
15173
15179
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
15174
15180
|
}
|
|
15175
15181
|
} finally {
|
|
@@ -15199,21 +15205,21 @@ function useExportHandlers(input) {
|
|
|
15199
15205
|
{
|
|
15200
15206
|
scale: 2,
|
|
15201
15207
|
onProgress: (current, total) => {
|
|
15202
|
-
setExportProgress(
|
|
15203
|
-
setExportStatusMessage(
|
|
15208
|
+
setExportProgress(chunkNG3CPWXD_js.slideProgressPercent(current, total));
|
|
15209
|
+
setExportStatusMessage(chunkNG3CPWXD_js.slideStatusLabel("Rendering", current, total));
|
|
15204
15210
|
},
|
|
15205
15211
|
signal: abortCtrl.signal
|
|
15206
15212
|
}
|
|
15207
15213
|
);
|
|
15208
|
-
setExportProgress(
|
|
15214
|
+
setExportProgress(chunkNG3CPWXD_js.EXPORT_ASSEMBLING_PERCENT);
|
|
15209
15215
|
setExportStatusMessage("Building PDF...");
|
|
15210
15216
|
await new Promise((r) => {
|
|
15211
15217
|
setTimeout(r, 100);
|
|
15212
15218
|
});
|
|
15213
|
-
setExportProgress(
|
|
15219
|
+
setExportProgress(chunkNG3CPWXD_js.EXPORT_DONE_PERCENT);
|
|
15214
15220
|
setExportStatusMessage("Done!");
|
|
15215
15221
|
} catch (err) {
|
|
15216
|
-
if (!
|
|
15222
|
+
if (!chunkNG3CPWXD_js.isExportAbortError(err)) {
|
|
15217
15223
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
15218
15224
|
}
|
|
15219
15225
|
} finally {
|
|
@@ -15254,22 +15260,22 @@ function useExportHandlers(input) {
|
|
|
15254
15260
|
scale: 1,
|
|
15255
15261
|
slideDurationMs: 3e3,
|
|
15256
15262
|
onProgress: (current, total) => {
|
|
15257
|
-
setExportProgress(
|
|
15258
|
-
setExportStatusMessage(
|
|
15263
|
+
setExportProgress(chunkNG3CPWXD_js.slideProgressPercent(current, total, 45));
|
|
15264
|
+
setExportStatusMessage(chunkNG3CPWXD_js.slideStatusLabel("Capturing", current, total));
|
|
15259
15265
|
},
|
|
15260
15266
|
onRecordProgress: (current, total) => {
|
|
15261
|
-
setExportProgress(
|
|
15262
|
-
setExportStatusMessage(
|
|
15267
|
+
setExportProgress(chunkNG3CPWXD_js.recordProgressPercent(current, total));
|
|
15268
|
+
setExportStatusMessage(chunkNG3CPWXD_js.slideStatusLabel("Recording", current, total));
|
|
15263
15269
|
},
|
|
15264
15270
|
signal: abortCtrl.signal
|
|
15265
15271
|
}
|
|
15266
15272
|
);
|
|
15267
|
-
setExportProgress(
|
|
15273
|
+
setExportProgress(chunkNG3CPWXD_js.EXPORT_ASSEMBLING_PERCENT);
|
|
15268
15274
|
setExportStatusMessage("Saving file...");
|
|
15269
15275
|
downloadBlob2(blob, "presentation.webm");
|
|
15270
|
-
setExportProgress(
|
|
15276
|
+
setExportProgress(chunkNG3CPWXD_js.EXPORT_DONE_PERCENT);
|
|
15271
15277
|
} catch (err) {
|
|
15272
|
-
if (!
|
|
15278
|
+
if (!chunkNG3CPWXD_js.isExportAbortError(err)) {
|
|
15273
15279
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
15274
15280
|
}
|
|
15275
15281
|
} finally {
|
|
@@ -15297,18 +15303,18 @@ function useExportHandlers(input) {
|
|
|
15297
15303
|
scale: 0.5,
|
|
15298
15304
|
slideDurationMs: 2e3,
|
|
15299
15305
|
onProgress: (current, total) => {
|
|
15300
|
-
setExportProgress(
|
|
15301
|
-
setExportStatusMessage(
|
|
15306
|
+
setExportProgress(chunkNG3CPWXD_js.slideProgressPercent(current, total));
|
|
15307
|
+
setExportStatusMessage(chunkNG3CPWXD_js.slideStatusLabel("Encoding", current, total));
|
|
15302
15308
|
},
|
|
15303
15309
|
signal: abortCtrl.signal
|
|
15304
15310
|
}
|
|
15305
15311
|
);
|
|
15306
|
-
setExportProgress(
|
|
15312
|
+
setExportProgress(chunkNG3CPWXD_js.EXPORT_ASSEMBLING_PERCENT);
|
|
15307
15313
|
setExportStatusMessage("Saving file...");
|
|
15308
15314
|
downloadBlob2(blob, "presentation.gif");
|
|
15309
|
-
setExportProgress(
|
|
15315
|
+
setExportProgress(chunkNG3CPWXD_js.EXPORT_DONE_PERCENT);
|
|
15310
15316
|
} catch (err) {
|
|
15311
|
-
if (!
|
|
15317
|
+
if (!chunkNG3CPWXD_js.isExportAbortError(err)) {
|
|
15312
15318
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
15313
15319
|
}
|
|
15314
15320
|
} finally {
|
|
@@ -15348,7 +15354,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
15348
15354
|
}
|
|
15349
15355
|
printWindow.document.open();
|
|
15350
15356
|
printWindow.document.write(
|
|
15351
|
-
|
|
15357
|
+
chunkNG3CPWXD_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
15352
15358
|
);
|
|
15353
15359
|
printWindow.document.close();
|
|
15354
15360
|
printWindow.focus();
|
|
@@ -15409,7 +15415,7 @@ function usePrintHandlers(input) {
|
|
|
15409
15415
|
if (svgs.length === 0) {
|
|
15410
15416
|
return;
|
|
15411
15417
|
}
|
|
15412
|
-
const printDoc =
|
|
15418
|
+
const printDoc = chunkNG3CPWXD_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
15413
15419
|
title: "Slides (Vector)",
|
|
15414
15420
|
orientation: settings.orientation,
|
|
15415
15421
|
colorFilter
|
|
@@ -15445,7 +15451,7 @@ function usePrintHandlers(input) {
|
|
|
15445
15451
|
if (settings.printWhat === "outline") {
|
|
15446
15452
|
openPrintWindow(
|
|
15447
15453
|
"Outline",
|
|
15448
|
-
`<div class="outline-page">${
|
|
15454
|
+
`<div class="outline-page">${chunkNG3CPWXD_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
15449
15455
|
settings.orientation,
|
|
15450
15456
|
colorFilter,
|
|
15451
15457
|
settings.frameSlides
|
|
@@ -15470,7 +15476,7 @@ function usePrintHandlers(input) {
|
|
|
15470
15476
|
if (settings.printWhat === "slides") {
|
|
15471
15477
|
openPrintWindow(
|
|
15472
15478
|
"Slides",
|
|
15473
|
-
|
|
15479
|
+
chunkNG3CPWXD_js.buildSlidesHtml(slideImages, slideIndices),
|
|
15474
15480
|
settings.orientation,
|
|
15475
15481
|
colorFilter,
|
|
15476
15482
|
settings.frameSlides
|
|
@@ -15480,7 +15486,7 @@ function usePrintHandlers(input) {
|
|
|
15480
15486
|
if (settings.printWhat === "notes") {
|
|
15481
15487
|
openPrintWindow(
|
|
15482
15488
|
"Notes Pages",
|
|
15483
|
-
|
|
15489
|
+
chunkNG3CPWXD_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
15484
15490
|
"portrait",
|
|
15485
15491
|
colorFilter,
|
|
15486
15492
|
settings.frameSlides
|
|
@@ -15491,7 +15497,7 @@ function usePrintHandlers(input) {
|
|
|
15491
15497
|
const spp = settings.slidesPerPage;
|
|
15492
15498
|
openPrintWindow(
|
|
15493
15499
|
`Handout ${spp} per page`,
|
|
15494
|
-
|
|
15500
|
+
chunkNG3CPWXD_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
15495
15501
|
"portrait",
|
|
15496
15502
|
colorFilter,
|
|
15497
15503
|
settings.frameSlides
|
|
@@ -15555,8 +15561,8 @@ function useThemeHandlers(input) {
|
|
|
15555
15561
|
return;
|
|
15556
15562
|
}
|
|
15557
15563
|
await handler.updateThemeColorScheme(colorScheme);
|
|
15558
|
-
const previousMap = theme?.colorScheme ?
|
|
15559
|
-
setSlides((prev) =>
|
|
15564
|
+
const previousMap = theme?.colorScheme ? chunkYOOFW6LR_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
15565
|
+
setSlides((prev) => chunkYOOFW6LR_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
15560
15566
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
15561
15567
|
bumpHistory();
|
|
15562
15568
|
history.markDirty();
|
|
@@ -15661,7 +15667,7 @@ function useThemeSwitching(input) {
|
|
|
15661
15667
|
}
|
|
15662
15668
|
try {
|
|
15663
15669
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
15664
|
-
const newData =
|
|
15670
|
+
const newData = chunkYOOFW6LR_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
15665
15671
|
onDataChange(newData);
|
|
15666
15672
|
onThemeChanged?.(preset);
|
|
15667
15673
|
} catch (error) {
|
|
@@ -15678,7 +15684,7 @@ function useThemeSwitching(input) {
|
|
|
15678
15684
|
}
|
|
15679
15685
|
try {
|
|
15680
15686
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
15681
|
-
const newData =
|
|
15687
|
+
const newData = chunkYOOFW6LR_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
15682
15688
|
onDataChange(newData);
|
|
15683
15689
|
} catch (error) {
|
|
15684
15690
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -15690,12 +15696,12 @@ function useThemeSwitching(input) {
|
|
|
15690
15696
|
if (!data?.theme?.colorScheme) {
|
|
15691
15697
|
return void 0;
|
|
15692
15698
|
}
|
|
15693
|
-
return
|
|
15694
|
-
(p) =>
|
|
15699
|
+
return chunkYOOFW6LR_js.THEME_PRESETS.find(
|
|
15700
|
+
(p) => chunkYOOFW6LR_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
15695
15701
|
);
|
|
15696
15702
|
}, [data?.theme?.colorScheme]);
|
|
15697
15703
|
return {
|
|
15698
|
-
presets:
|
|
15704
|
+
presets: chunkYOOFW6LR_js.THEME_PRESETS,
|
|
15699
15705
|
switchToPreset,
|
|
15700
15706
|
switchToCustom,
|
|
15701
15707
|
currentPreset
|
|
@@ -15770,7 +15776,7 @@ function usePropertyHandlers(input) {
|
|
|
15770
15776
|
}
|
|
15771
15777
|
try {
|
|
15772
15778
|
const ab = await file.arrayBuffer();
|
|
15773
|
-
const h = new
|
|
15779
|
+
const h = new chunkYOOFW6LR_js.PptxHandler();
|
|
15774
15780
|
const other = await h.load(ab);
|
|
15775
15781
|
if (!other) {
|
|
15776
15782
|
return;
|
|
@@ -15780,7 +15786,7 @@ function usePropertyHandlers(input) {
|
|
|
15780
15786
|
width: canvasSize.width,
|
|
15781
15787
|
height: canvasSize.height
|
|
15782
15788
|
};
|
|
15783
|
-
setCompareResult(
|
|
15789
|
+
setCompareResult(chunkNG3CPWXD_js.comparePresentation(cur, other));
|
|
15784
15790
|
setIsComparePanelOpen(true);
|
|
15785
15791
|
} catch (err) {
|
|
15786
15792
|
console.warn("Compare failed:", err);
|
|
@@ -15797,7 +15803,7 @@ function usePropertyHandlers(input) {
|
|
|
15797
15803
|
if (!diff || diff.status === "unchanged") {
|
|
15798
15804
|
return;
|
|
15799
15805
|
}
|
|
15800
|
-
setSlides((prev) =>
|
|
15806
|
+
setSlides((prev) => chunkNG3CPWXD_js.applyAcceptSlide(prev, diff));
|
|
15801
15807
|
setIsDirty(true);
|
|
15802
15808
|
},
|
|
15803
15809
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -15808,10 +15814,10 @@ function usePropertyHandlers(input) {
|
|
|
15808
15814
|
if (!compareResult) {
|
|
15809
15815
|
return;
|
|
15810
15816
|
}
|
|
15811
|
-
setSlides((prev) =>
|
|
15817
|
+
setSlides((prev) => chunkNG3CPWXD_js.applyAcceptAllSlides(prev, compareResult));
|
|
15812
15818
|
setIsDirty(true);
|
|
15813
15819
|
}, [compareResult, setSlides, setIsDirty]);
|
|
15814
|
-
const usedFontFamilies = React4.useMemo(() =>
|
|
15820
|
+
const usedFontFamilies = React4.useMemo(() => chunkNG3CPWXD_js.collectUsedFonts(slides), [slides]);
|
|
15815
15821
|
return {
|
|
15816
15822
|
handleUpdateNotes,
|
|
15817
15823
|
handleUpdateSlide,
|
|
@@ -15930,7 +15936,7 @@ function useIsMobile(input) {
|
|
|
15930
15936
|
const containerRef = input?.containerRef;
|
|
15931
15937
|
const isTouchDevice = React4.useSyncExternalStore(
|
|
15932
15938
|
subscribeTouchCapability,
|
|
15933
|
-
|
|
15939
|
+
chunkNG3CPWXD_js.detectTouchDevice,
|
|
15934
15940
|
() => false
|
|
15935
15941
|
// server snapshot
|
|
15936
15942
|
);
|
|
@@ -15946,7 +15952,7 @@ function useIsMobile(input) {
|
|
|
15946
15952
|
}
|
|
15947
15953
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
15948
15954
|
});
|
|
15949
|
-
const [orientation, setOrientation] = React4.useState(
|
|
15955
|
+
const [orientation, setOrientation] = React4.useState(chunkNG3CPWXD_js.detectOrientation);
|
|
15950
15956
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = React4.useState(false);
|
|
15951
15957
|
const [initialViewportHeight] = React4.useState(
|
|
15952
15958
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -15990,7 +15996,7 @@ function useIsMobile(input) {
|
|
|
15990
15996
|
return;
|
|
15991
15997
|
}
|
|
15992
15998
|
const handleOrientationChange = () => {
|
|
15993
|
-
setOrientation(
|
|
15999
|
+
setOrientation(chunkNG3CPWXD_js.detectOrientation());
|
|
15994
16000
|
};
|
|
15995
16001
|
if (screen.orientation) {
|
|
15996
16002
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -16020,9 +16026,9 @@ function useIsMobile(input) {
|
|
|
16020
16026
|
window.addEventListener("resize", handleResize);
|
|
16021
16027
|
return () => window.removeEventListener("resize", handleResize);
|
|
16022
16028
|
}, [isTouchDevice, initialViewportHeight]);
|
|
16023
|
-
const isMobile =
|
|
16024
|
-
const isTablet = !isMobile && containerWidth >=
|
|
16025
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
16029
|
+
const isMobile = chunkNG3CPWXD_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
16030
|
+
const isTablet = !isMobile && containerWidth >= chunkNG3CPWXD_js.MOBILE_BREAKPOINT && containerWidth < chunkNG3CPWXD_js.TABLET_BREAKPOINT;
|
|
16031
|
+
const isDesktop = !isMobile && containerWidth >= chunkNG3CPWXD_js.TABLET_BREAKPOINT;
|
|
16026
16032
|
return {
|
|
16027
16033
|
isMobile,
|
|
16028
16034
|
isTablet,
|
|
@@ -16083,11 +16089,11 @@ function useViewerDialogs(input) {
|
|
|
16083
16089
|
);
|
|
16084
16090
|
const [embedFontsEnabled, setEmbedFontsEnabled] = React4.useState(false);
|
|
16085
16091
|
const [isNarrowViewport, setIsNarrowViewport] = React4.useState(
|
|
16086
|
-
() => typeof window !== "undefined" ?
|
|
16092
|
+
() => typeof window !== "undefined" ? chunkNG3CPWXD_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
16087
16093
|
);
|
|
16088
16094
|
React4.useEffect(() => {
|
|
16089
16095
|
const handleWindow = () => setIsNarrowViewport(
|
|
16090
|
-
|
|
16096
|
+
chunkNG3CPWXD_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
16091
16097
|
);
|
|
16092
16098
|
let observer = null;
|
|
16093
16099
|
let raf = 0;
|
|
@@ -16101,12 +16107,12 @@ function useViewerDialogs(input) {
|
|
|
16101
16107
|
const entry = entries[0];
|
|
16102
16108
|
if (entry) {
|
|
16103
16109
|
setIsNarrowViewport(
|
|
16104
|
-
|
|
16110
|
+
chunkNG3CPWXD_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
16105
16111
|
);
|
|
16106
16112
|
}
|
|
16107
16113
|
});
|
|
16108
16114
|
observer.observe(el);
|
|
16109
|
-
setIsNarrowViewport(
|
|
16115
|
+
setIsNarrowViewport(chunkNG3CPWXD_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
16110
16116
|
};
|
|
16111
16117
|
attach();
|
|
16112
16118
|
window.addEventListener("resize", handleWindow);
|
|
@@ -16283,7 +16289,7 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
|
16283
16289
|
return slides.map((_, i) => i).filter((i) => !slides[i]?.hidden);
|
|
16284
16290
|
}
|
|
16285
16291
|
function computeSlideSectionGroups(slides, sections) {
|
|
16286
|
-
return
|
|
16292
|
+
return chunkNG3CPWXD_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
16287
16293
|
id: group.section?.id ?? (sections.length > 0 ? UNGROUPED_SECTION_ID : "default"),
|
|
16288
16294
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
16289
16295
|
slideIndexes: group.slideIndexes,
|
|
@@ -16521,13 +16527,13 @@ function useSerialize(input) {
|
|
|
16521
16527
|
let processedSlide = slide;
|
|
16522
16528
|
if (pendingEditId) {
|
|
16523
16529
|
const updatedElements = slide.elements.map((el) => {
|
|
16524
|
-
if (el.id !== pendingEditId || !
|
|
16530
|
+
if (el.id !== pendingEditId || !chunkYOOFW6LR_js.hasTextProperties(el)) {
|
|
16525
16531
|
return el;
|
|
16526
16532
|
}
|
|
16527
16533
|
return {
|
|
16528
16534
|
...el,
|
|
16529
16535
|
text: pendingEditText,
|
|
16530
|
-
textSegments:
|
|
16536
|
+
textSegments: chunkNG3CPWXD_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
16531
16537
|
};
|
|
16532
16538
|
});
|
|
16533
16539
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -16540,7 +16546,7 @@ function useSerialize(input) {
|
|
|
16540
16546
|
const pptxGuides = guides.map((g) => ({
|
|
16541
16547
|
id: g.id,
|
|
16542
16548
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
16543
|
-
positionEmu:
|
|
16549
|
+
positionEmu: chunkYOOFW6LR_js.guidePxToEmu(g.position)
|
|
16544
16550
|
}));
|
|
16545
16551
|
return {
|
|
16546
16552
|
...processedSlide,
|
|
@@ -16776,10 +16782,10 @@ function usePresentationSetup(input) {
|
|
|
16776
16782
|
onToggleEraser: () => annotations.setPresentationTool("eraser"),
|
|
16777
16783
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
16778
16784
|
onSaveRehearsalTimings: (timings) => {
|
|
16779
|
-
setSlides((prev) =>
|
|
16785
|
+
setSlides((prev) => chunkNG3CPWXD_js.applyRehearsalTimings(prev, timings));
|
|
16780
16786
|
history.markDirty();
|
|
16781
16787
|
},
|
|
16782
|
-
loopContinuously:
|
|
16788
|
+
loopContinuously: chunkNG3CPWXD_js.shouldLoopContinuously(presentationProperties),
|
|
16783
16789
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
16784
16790
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
16785
16791
|
endWithBlackSlide
|
|
@@ -16941,7 +16947,7 @@ function useEditorOperations(input) {
|
|
|
16941
16947
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
16942
16948
|
React4.useEffect(() => {
|
|
16943
16949
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
16944
|
-
copiedFormatRef.current =
|
|
16950
|
+
copiedFormatRef.current = chunkNG3CPWXD_js.copyFormatFromElement(selectedElement);
|
|
16945
16951
|
} else if (!formatPainterActive) {
|
|
16946
16952
|
copiedFormatRef.current = null;
|
|
16947
16953
|
}
|
|
@@ -16967,12 +16973,12 @@ function useEditorOperations(input) {
|
|
|
16967
16973
|
e.stopPropagation();
|
|
16968
16974
|
const element = elementLookup.get(elementId);
|
|
16969
16975
|
if (element) {
|
|
16970
|
-
const updated =
|
|
16976
|
+
const updated = chunkNG3CPWXD_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
16971
16977
|
const updates = {};
|
|
16972
|
-
if (
|
|
16978
|
+
if (chunkYOOFW6LR_js.hasShapeProperties(updated)) {
|
|
16973
16979
|
updates.shapeStyle = updated.shapeStyle;
|
|
16974
16980
|
}
|
|
16975
|
-
if (
|
|
16981
|
+
if (chunkYOOFW6LR_js.hasTextProperties(updated)) {
|
|
16976
16982
|
updates.textStyle = updated.textStyle;
|
|
16977
16983
|
}
|
|
16978
16984
|
ops.updateElementById(elementId, updates);
|
|
@@ -17119,7 +17125,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
17119
17125
|
const families = /* @__PURE__ */ new Set();
|
|
17120
17126
|
for (const slide of slides) {
|
|
17121
17127
|
for (const el of slide.elements) {
|
|
17122
|
-
if (
|
|
17128
|
+
if (chunkYOOFW6LR_js.hasTextProperties(el) && el.textSegments) {
|
|
17123
17129
|
for (const seg of el.textSegments) {
|
|
17124
17130
|
if (seg.style.fontFamily) {
|
|
17125
17131
|
families.add(seg.style.fontFamily);
|
|
@@ -17903,7 +17909,7 @@ function useReducedMotion() {
|
|
|
17903
17909
|
}
|
|
17904
17910
|
function useViewerOptions() {
|
|
17905
17911
|
const storeRef = React4.useRef(null);
|
|
17906
|
-
storeRef.current ??=
|
|
17912
|
+
storeRef.current ??= chunkNG3CPWXD_js.createViewerOptionsStore();
|
|
17907
17913
|
const store = storeRef.current;
|
|
17908
17914
|
const options = React4.useSyncExternalStore(
|
|
17909
17915
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -17912,9 +17918,9 @@ function useViewerOptions() {
|
|
|
17912
17918
|
);
|
|
17913
17919
|
return { optionsStore: store, options };
|
|
17914
17920
|
}
|
|
17915
|
-
var KNOWN_TAB_IDS = new Set(
|
|
17921
|
+
var KNOWN_TAB_IDS = new Set(chunkNG3CPWXD_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
17916
17922
|
function computeToolbarVisibility(hiddenActions) {
|
|
17917
|
-
const isHidden = (id) =>
|
|
17923
|
+
const isHidden = (id) => chunkNG3CPWXD_js.isActionHidden(id, hiddenActions);
|
|
17918
17924
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
17919
17925
|
return { isHidden, isTabVisible };
|
|
17920
17926
|
}
|
|
@@ -17999,10 +18005,10 @@ function useYjsDocumentSync({
|
|
|
17999
18005
|
return;
|
|
18000
18006
|
}
|
|
18001
18007
|
try {
|
|
18002
|
-
const { PptxHandler: PptxHandler2 } = await import('./dist-
|
|
18008
|
+
const { PptxHandler: PptxHandler2 } = await import('./dist-DIPQCCIK.js');
|
|
18003
18009
|
const handler = new PptxHandler2();
|
|
18004
18010
|
await handler.load(sourceBytes.buffer);
|
|
18005
|
-
const currentSlides =
|
|
18011
|
+
const currentSlides = chunkNG3CPWXD_js.readSlidesFromYDoc(
|
|
18006
18012
|
doc
|
|
18007
18013
|
);
|
|
18008
18014
|
const slidesToSave = buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
@@ -18020,7 +18026,7 @@ function useYjsDocumentSync({
|
|
|
18020
18026
|
if (!doc || !isConnected) {
|
|
18021
18027
|
return;
|
|
18022
18028
|
}
|
|
18023
|
-
const docSlides =
|
|
18029
|
+
const docSlides = chunkNG3CPWXD_js.readSlidesFromYDoc(
|
|
18024
18030
|
doc
|
|
18025
18031
|
);
|
|
18026
18032
|
if (docSlides.length === 0) {
|
|
@@ -18042,11 +18048,11 @@ function useYjsDocumentSync({
|
|
|
18042
18048
|
lastSyncedRef.current = serialized;
|
|
18043
18049
|
void (async () => {
|
|
18044
18050
|
const factories = await getFactories();
|
|
18045
|
-
|
|
18051
|
+
chunkNG3CPWXD_js.reconcileSlidesInYDoc(
|
|
18046
18052
|
slides,
|
|
18047
18053
|
doc,
|
|
18048
18054
|
factories,
|
|
18049
|
-
|
|
18055
|
+
chunkNG3CPWXD_js.LOCAL_SYNC_ORIGIN
|
|
18050
18056
|
);
|
|
18051
18057
|
scheduleWriteBack();
|
|
18052
18058
|
})();
|
|
@@ -18060,10 +18066,10 @@ function useYjsDocumentSync({
|
|
|
18060
18066
|
return;
|
|
18061
18067
|
}
|
|
18062
18068
|
const handleChange = (_events, transaction) => {
|
|
18063
|
-
if (transaction?.origin ===
|
|
18069
|
+
if (transaction?.origin === chunkNG3CPWXD_js.LOCAL_SYNC_ORIGIN) {
|
|
18064
18070
|
return;
|
|
18065
18071
|
}
|
|
18066
|
-
const remoteSlides =
|
|
18072
|
+
const remoteSlides = chunkNG3CPWXD_js.readSlidesFromYDoc(
|
|
18067
18073
|
doc
|
|
18068
18074
|
);
|
|
18069
18075
|
if (remoteSlides.length === 0) {
|
|
@@ -18079,7 +18085,7 @@ function useYjsDocumentSync({
|
|
|
18079
18085
|
isApplyingRemoteRef.current = false;
|
|
18080
18086
|
scheduleWriteBack();
|
|
18081
18087
|
};
|
|
18082
|
-
const unobserve =
|
|
18088
|
+
const unobserve = chunkNG3CPWXD_js.observeYDocSlides(
|
|
18083
18089
|
doc,
|
|
18084
18090
|
handleChange
|
|
18085
18091
|
);
|
|
@@ -18117,7 +18123,7 @@ function useBroadcastFollower({
|
|
|
18117
18123
|
if (!broadcaster) {
|
|
18118
18124
|
return;
|
|
18119
18125
|
}
|
|
18120
|
-
if (!
|
|
18126
|
+
if (!chunkNG3CPWXD_js.shouldAutoFollowBroadcaster({
|
|
18121
18127
|
localRole: collab.config.role,
|
|
18122
18128
|
broadcasterRole: broadcaster.role
|
|
18123
18129
|
})) {
|
|
@@ -18252,7 +18258,7 @@ function useTouchGestures(input) {
|
|
|
18252
18258
|
if (!el || !enabled) {
|
|
18253
18259
|
return;
|
|
18254
18260
|
}
|
|
18255
|
-
const recognizer =
|
|
18261
|
+
const recognizer = chunkNG3CPWXD_js.createTouchGestureRecognizer({
|
|
18256
18262
|
getScale: () => scaleRef.current,
|
|
18257
18263
|
minScale: MIN_ZOOM_SCALE,
|
|
18258
18264
|
maxScale: MAX_ZOOM_SCALE,
|
|
@@ -18295,7 +18301,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
18295
18301
|
return;
|
|
18296
18302
|
}
|
|
18297
18303
|
const rect = active.getBoundingClientRect();
|
|
18298
|
-
const delta =
|
|
18304
|
+
const delta = chunkNG3CPWXD_js.computeScrollDelta(
|
|
18299
18305
|
{ top: rect.top, bottom: rect.bottom },
|
|
18300
18306
|
window.innerHeight,
|
|
18301
18307
|
keyboardInset
|
|
@@ -18315,8 +18321,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18315
18321
|
return;
|
|
18316
18322
|
}
|
|
18317
18323
|
const update = () => {
|
|
18318
|
-
const metrics =
|
|
18319
|
-
const inset = metrics ?
|
|
18324
|
+
const metrics = chunkNG3CPWXD_js.readViewportMetrics(window);
|
|
18325
|
+
const inset = metrics ? chunkNG3CPWXD_js.computeKeyboardInset(metrics) : 0;
|
|
18320
18326
|
setKeyboardInset(inset);
|
|
18321
18327
|
if (inset > 0) {
|
|
18322
18328
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -18327,8 +18333,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18327
18333
|
vv.addEventListener("scroll", update);
|
|
18328
18334
|
const onFocusIn = () => {
|
|
18329
18335
|
window.requestAnimationFrame(() => {
|
|
18330
|
-
const metrics =
|
|
18331
|
-
const inset = metrics ?
|
|
18336
|
+
const metrics = chunkNG3CPWXD_js.readViewportMetrics(window);
|
|
18337
|
+
const inset = metrics ? chunkNG3CPWXD_js.computeKeyboardInset(metrics) : 0;
|
|
18332
18338
|
if (inset > 0) {
|
|
18333
18339
|
scrollFocusedIntoView(inset);
|
|
18334
18340
|
}
|
|
@@ -18341,7 +18347,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18341
18347
|
document.removeEventListener("focusin", onFocusIn);
|
|
18342
18348
|
};
|
|
18343
18349
|
}, [enabled]);
|
|
18344
|
-
return { keyboardInset, isKeyboardOpen:
|
|
18350
|
+
return { keyboardInset, isKeyboardOpen: chunkNG3CPWXD_js.isKeyboardOpen(keyboardInset) };
|
|
18345
18351
|
}
|
|
18346
18352
|
|
|
18347
18353
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -18396,13 +18402,13 @@ function buildCanvasProps(input) {
|
|
|
18396
18402
|
if (mode === "present") {
|
|
18397
18403
|
presentation.handlePresentationAction(action);
|
|
18398
18404
|
} else if (action.url) {
|
|
18399
|
-
|
|
18405
|
+
chunkNG3CPWXD_js.safeOpenUrl(action.url);
|
|
18400
18406
|
}
|
|
18401
18407
|
};
|
|
18402
18408
|
const handleHyperlinkClick = (url) => {
|
|
18403
|
-
if (
|
|
18409
|
+
if (chunkNG3CPWXD_js.isPpactionUrl(url)) {
|
|
18404
18410
|
if (mode === "present") {
|
|
18405
|
-
const parsed =
|
|
18411
|
+
const parsed = chunkNG3CPWXD_js.parsePpactionUrl(url);
|
|
18406
18412
|
if (parsed) {
|
|
18407
18413
|
presentation.handlePresentationAction({
|
|
18408
18414
|
action: parsed.action,
|
|
@@ -18412,7 +18418,7 @@ function buildCanvasProps(input) {
|
|
|
18412
18418
|
}
|
|
18413
18419
|
return;
|
|
18414
18420
|
}
|
|
18415
|
-
|
|
18421
|
+
chunkNG3CPWXD_js.safeOpenUrl(url);
|
|
18416
18422
|
};
|
|
18417
18423
|
return {
|
|
18418
18424
|
activeSlide: effectiveSlide,
|
|
@@ -18732,7 +18738,7 @@ function buildToolbarProps(input) {
|
|
|
18732
18738
|
onOpenFile,
|
|
18733
18739
|
onOpenRecentFile,
|
|
18734
18740
|
onCreatePresentation: (templateId) => {
|
|
18735
|
-
s.setSlides(
|
|
18741
|
+
s.setSlides(chunkNG3CPWXD_js.createBackstagePresentation(templateId));
|
|
18736
18742
|
s.setActiveSlideIndex(0);
|
|
18737
18743
|
s.setSelectedElementId(null);
|
|
18738
18744
|
s.setSelectedElementIds([]);
|
|
@@ -18793,7 +18799,7 @@ function buildToolbarProps(input) {
|
|
|
18793
18799
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
18794
18800
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
18795
18801
|
formatPainterActive: s.formatPainterActive,
|
|
18796
|
-
canActivateFormatPainter:
|
|
18802
|
+
canActivateFormatPainter: chunkNG3CPWXD_js.hasCopyableFormat(selectedElement),
|
|
18797
18803
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
18798
18804
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
18799
18805
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -19056,7 +19062,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
19056
19062
|
}, [incomingContent]);
|
|
19057
19063
|
const onOpenFile = React4.useCallback(() => {
|
|
19058
19064
|
void (async () => {
|
|
19059
|
-
const picked = await
|
|
19065
|
+
const picked = await chunkNG3CPWXD_js.openPptxFile();
|
|
19060
19066
|
if (picked) {
|
|
19061
19067
|
setContent(picked.buffer);
|
|
19062
19068
|
}
|
|
@@ -19064,7 +19070,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
19064
19070
|
}, []);
|
|
19065
19071
|
const onOpenRecentFile = React4.useCallback((key) => {
|
|
19066
19072
|
void (async () => {
|
|
19067
|
-
const bytes = await
|
|
19073
|
+
const bytes = await chunkNG3CPWXD_js.readBackstageRecentFile(key);
|
|
19068
19074
|
if (bytes) {
|
|
19069
19075
|
setContent(bytes);
|
|
19070
19076
|
}
|