pptx-react-viewer 1.25.3 → 1.25.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/dist/{Model3DScene-IQLE5JLL.mjs → Model3DScene-DZFYJPUH.mjs} +2 -2
- package/dist/Model3DScene-DZFYJPUH.mjs.br +0 -0
- package/dist/Model3DScene-DZFYJPUH.mjs.gz +0 -0
- package/dist/{Model3DScene-F2GUSTZI.js → Model3DScene-SP6WOKSX.js} +3 -3
- package/dist/{Model3DScene-F2GUSTZI.js.br → Model3DScene-SP6WOKSX.js.br} +0 -0
- package/dist/Model3DScene-SP6WOKSX.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-JG26PJ7O.mjs → SurfaceChart3DScene-54BRNPQ5.mjs} +2 -2
- package/dist/SurfaceChart3DScene-54BRNPQ5.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-54BRNPQ5.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-4OMD7LWR.js → SurfaceChart3DScene-GISPZ4C2.js} +3 -3
- package/dist/SurfaceChart3DScene-GISPZ4C2.js.br +0 -0
- package/dist/SurfaceChart3DScene-GISPZ4C2.js.gz +0 -0
- package/dist/{chunk-5G3SPYQE.js → chunk-5VYVKFMS.js} +848 -807
- package/dist/chunk-5VYVKFMS.js.br +0 -0
- package/dist/chunk-5VYVKFMS.js.gz +0 -0
- package/dist/{chunk-UXVFNGJH.js → chunk-6F4WVHS3.js} +97 -59
- package/dist/chunk-6F4WVHS3.js.br +0 -0
- package/dist/chunk-6F4WVHS3.js.gz +0 -0
- package/dist/{chunk-ZUJHFLOR.js → chunk-7FE27DDH.js} +464 -464
- package/dist/chunk-7FE27DDH.js.br +0 -0
- package/dist/chunk-7FE27DDH.js.gz +0 -0
- package/dist/{chunk-2V6BD4JQ.js → chunk-FWF2SP6N.js} +631 -141
- package/dist/chunk-FWF2SP6N.js.br +0 -0
- package/dist/chunk-FWF2SP6N.js.gz +0 -0
- package/dist/{chunk-NYBERTS7.mjs → chunk-P72VQ7WE.mjs} +4 -4
- package/dist/chunk-P72VQ7WE.mjs.br +0 -0
- package/dist/chunk-P72VQ7WE.mjs.gz +0 -0
- package/dist/{chunk-GNXWU7UG.mjs → chunk-TPG2WKHQ.mjs} +47 -6
- package/dist/chunk-TPG2WKHQ.mjs.br +0 -0
- package/dist/chunk-TPG2WKHQ.mjs.gz +0 -0
- package/dist/{chunk-DAI4KM5W.mjs → chunk-UYNOPUSG.mjs} +631 -141
- package/dist/chunk-UYNOPUSG.mjs.br +0 -0
- package/dist/chunk-UYNOPUSG.mjs.gz +0 -0
- package/dist/{chunk-DVM75RMN.mjs → chunk-VUC3UPLM.mjs} +64 -26
- package/dist/chunk-VUC3UPLM.mjs.br +0 -0
- package/dist/chunk-VUC3UPLM.mjs.gz +0 -0
- package/dist/{dist-E3IHM3OU.mjs → dist-QNYKM7YS.mjs} +1 -1
- package/dist/dist-QNYKM7YS.mjs.br +0 -0
- package/dist/dist-QNYKM7YS.mjs.gz +0 -0
- package/dist/{dist-ZA77P2O5.js → dist-QU6JIDAF.js} +562 -562
- package/dist/dist-QU6JIDAF.js.br +0 -0
- package/dist/dist-QU6JIDAF.js.gz +0 -0
- package/dist/hooks-unstable.d.ts +107 -1
- package/dist/hooks-unstable.js +78 -78
- package/dist/hooks-unstable.js.br +0 -0
- package/dist/hooks-unstable.js.gz +0 -0
- package/dist/hooks-unstable.mjs +3 -3
- package/dist/hooks-unstable.mjs.br +0 -0
- package/dist/hooks-unstable.mjs.gz +0 -0
- package/dist/index.d.ts +107 -1
- package/dist/index.js +33 -33
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/viewer/index.d.ts +107 -1
- package/dist/viewer/index.js +20 -20
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +4 -4
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/Model3DScene-F2GUSTZI.js.gz +0 -0
- package/dist/Model3DScene-IQLE5JLL.mjs.br +0 -0
- package/dist/Model3DScene-IQLE5JLL.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-4OMD7LWR.js.br +0 -0
- package/dist/SurfaceChart3DScene-4OMD7LWR.js.gz +0 -0
- package/dist/SurfaceChart3DScene-JG26PJ7O.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-JG26PJ7O.mjs.gz +0 -0
- package/dist/chunk-2V6BD4JQ.js.br +0 -0
- package/dist/chunk-2V6BD4JQ.js.gz +0 -0
- package/dist/chunk-5G3SPYQE.js.br +0 -0
- package/dist/chunk-5G3SPYQE.js.gz +0 -0
- package/dist/chunk-DAI4KM5W.mjs.br +0 -0
- package/dist/chunk-DAI4KM5W.mjs.gz +0 -0
- package/dist/chunk-DVM75RMN.mjs.br +0 -0
- package/dist/chunk-DVM75RMN.mjs.gz +0 -0
- package/dist/chunk-GNXWU7UG.mjs.br +0 -0
- package/dist/chunk-GNXWU7UG.mjs.gz +0 -0
- package/dist/chunk-NYBERTS7.mjs.br +0 -0
- package/dist/chunk-NYBERTS7.mjs.gz +0 -0
- package/dist/chunk-UXVFNGJH.js.br +0 -0
- package/dist/chunk-UXVFNGJH.js.gz +0 -0
- package/dist/chunk-ZUJHFLOR.js.br +0 -0
- package/dist/chunk-ZUJHFLOR.js.gz +0 -0
- package/dist/dist-E3IHM3OU.mjs.br +0 -0
- package/dist/dist-E3IHM3OU.mjs.gz +0 -0
- package/dist/dist-ZA77P2O5.js.br +0 -0
- package/dist/dist-ZA77P2O5.js.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk6F4WVHS3_js = require('./chunk-6F4WVHS3.js');
|
|
4
4
|
var chunk2EFVXYNA_js = require('./chunk-2EFVXYNA.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkFWF2SP6N_js = require('./chunk-FWF2SP6N.js');
|
|
6
6
|
var React3 = require('react');
|
|
7
7
|
var lu = require('react-icons/lu');
|
|
8
8
|
var clsx = require('clsx');
|
|
@@ -18,7 +18,7 @@ var JSZip__default = /*#__PURE__*/_interopDefault(JSZip);
|
|
|
18
18
|
|
|
19
19
|
// src/viewer/utils/clone.ts
|
|
20
20
|
function cloneHistorySnapshot2(snapshot) {
|
|
21
|
-
return
|
|
21
|
+
return chunk6F4WVHS3_js.cloneHistorySnapshot(snapshot);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
// src/viewer/hooks/useEditorHistory.ts
|
|
@@ -67,8 +67,8 @@ function useEditorHistory(input) {
|
|
|
67
67
|
width: canvasSize.width,
|
|
68
68
|
height: canvasSize.height,
|
|
69
69
|
activeSlideIndex,
|
|
70
|
-
slides: slides.map(
|
|
71
|
-
templateElementsBySlideId:
|
|
70
|
+
slides: slides.map(chunk6F4WVHS3_js.cloneSlide),
|
|
71
|
+
templateElementsBySlideId: chunk6F4WVHS3_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
72
72
|
...actionLabel ? { actionLabel } : {}
|
|
73
73
|
};
|
|
74
74
|
},
|
|
@@ -81,9 +81,9 @@ function useEditorHistory(input) {
|
|
|
81
81
|
width: snapshot.width,
|
|
82
82
|
height: snapshot.height
|
|
83
83
|
});
|
|
84
|
-
setSlides(snapshot.slides.map(
|
|
84
|
+
setSlides(snapshot.slides.map(chunk6F4WVHS3_js.cloneSlide));
|
|
85
85
|
setTemplateElementsBySlideId(
|
|
86
|
-
|
|
86
|
+
chunk6F4WVHS3_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
87
87
|
);
|
|
88
88
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
89
89
|
setSelectedElementIds([]);
|
|
@@ -347,7 +347,7 @@ var GLYPH_COMPONENTS = {
|
|
|
347
347
|
plus: lu.LuPlus,
|
|
348
348
|
triangle: lu.LuTriangle
|
|
349
349
|
};
|
|
350
|
-
var SHAPE_PRESETS =
|
|
350
|
+
var SHAPE_PRESETS = chunk6F4WVHS3_js.SHAPE_PRESET_DEFS.map(
|
|
351
351
|
(def) => ({
|
|
352
352
|
type: def.type,
|
|
353
353
|
label: def.label,
|
|
@@ -663,20 +663,20 @@ function useAnimationPlayback(input) {
|
|
|
663
663
|
for (const anim of nativeAnims) {
|
|
664
664
|
if (anim.buildType && anim.buildType !== "allAtOnce" && anim.targetId) {
|
|
665
665
|
const el = slide.elements.find((e) => e.id === anim.targetId);
|
|
666
|
-
if (el &&
|
|
667
|
-
segmentCounts.set(anim.targetId,
|
|
666
|
+
if (el && chunkFWF2SP6N_js.hasTextProperties(el) && el.textSegments && el.textSegments.length > 0) {
|
|
667
|
+
segmentCounts.set(anim.targetId, chunk6F4WVHS3_js.countTextSegments(el.textSegments));
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
|
-
const expandedAnims = segmentCounts.size > 0 ?
|
|
672
|
-
const engine =
|
|
671
|
+
const expandedAnims = segmentCounts.size > 0 ? chunk6F4WVHS3_js.expandTextBuildAnimations(nativeAnims, segmentCounts) : nativeAnims;
|
|
672
|
+
const engine = chunk6F4WVHS3_js.TimelineEngine.fromAnimations(expandedAnims);
|
|
673
673
|
timelineEngineRef.current = engine;
|
|
674
674
|
setPresentationKeyframesCss(engine.getTimeline().keyframesCss);
|
|
675
675
|
setInteractiveTriggerShapeIds(engine.getInteractiveTriggerShapeIds());
|
|
676
676
|
setHoverTriggerShapeIds(engine.getHoverTriggerShapeIds());
|
|
677
677
|
const allIds = slide.elements.map((element) => element.id);
|
|
678
678
|
for (const anim of expandedAnims) {
|
|
679
|
-
if (anim.targetId && anim.targetId.includes(
|
|
679
|
+
if (anim.targetId && anim.targetId.includes(chunk6F4WVHS3_js.TEXT_BUILD_ID_SEP)) {
|
|
680
680
|
allIds.push(anim.targetId);
|
|
681
681
|
}
|
|
682
682
|
}
|
|
@@ -808,7 +808,7 @@ function useAnimationPlayback(input) {
|
|
|
808
808
|
}))
|
|
809
809
|
);
|
|
810
810
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
811
|
-
const delay =
|
|
811
|
+
const delay = chunk6F4WVHS3_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
812
812
|
const timer = window.setTimeout(() => {
|
|
813
813
|
setPresentationAnimations(
|
|
814
814
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -865,7 +865,7 @@ function openDb() {
|
|
|
865
865
|
}
|
|
866
866
|
async function storeAudienceContent(content, sessionId) {
|
|
867
867
|
if (sessionId) {
|
|
868
|
-
return
|
|
868
|
+
return chunk6F4WVHS3_js.storePresentationDeck(sessionId, content);
|
|
869
869
|
}
|
|
870
870
|
const db = await openDb();
|
|
871
871
|
return new Promise((resolve, reject) => {
|
|
@@ -886,7 +886,7 @@ async function storeAudienceContent(content, sessionId) {
|
|
|
886
886
|
}
|
|
887
887
|
async function loadAudienceContent(sessionId) {
|
|
888
888
|
if (sessionId) {
|
|
889
|
-
return
|
|
889
|
+
return chunk6F4WVHS3_js.loadPresentationDeck(sessionId);
|
|
890
890
|
}
|
|
891
891
|
try {
|
|
892
892
|
const db = await openDb();
|
|
@@ -927,7 +927,7 @@ async function loadAudienceContent(sessionId) {
|
|
|
927
927
|
}
|
|
928
928
|
async function clearAudienceContent(sessionId) {
|
|
929
929
|
if (sessionId) {
|
|
930
|
-
return
|
|
930
|
+
return chunk6F4WVHS3_js.clearPresentationDeck(sessionId);
|
|
931
931
|
}
|
|
932
932
|
try {
|
|
933
933
|
const db = await openDb();
|
|
@@ -947,12 +947,12 @@ async function clearAudienceContent(sessionId) {
|
|
|
947
947
|
} catch {
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
|
-
var PRESENTER_CHANNEL_NAME =
|
|
951
|
-
var AUDIENCE_HASH =
|
|
952
|
-
var PRESENTER_MSG_ORIGIN =
|
|
953
|
-
var AUDIENCE_NONCE_KEY =
|
|
950
|
+
var PRESENTER_CHANNEL_NAME = chunk6F4WVHS3_js.PRESENTATION_CHANNEL_NAME;
|
|
951
|
+
var AUDIENCE_HASH = chunk6F4WVHS3_js.PRESENTATION_HASH;
|
|
952
|
+
var PRESENTER_MSG_ORIGIN = chunk6F4WVHS3_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
953
|
+
var AUDIENCE_NONCE_KEY = chunk6F4WVHS3_js.PRESENTATION_NONCE_KEY;
|
|
954
954
|
function generateSessionId() {
|
|
955
|
-
return
|
|
955
|
+
return chunk6F4WVHS3_js.createPresentationSessionId();
|
|
956
956
|
}
|
|
957
957
|
function parseAudienceNonce() {
|
|
958
958
|
const hash = window.location.hash;
|
|
@@ -988,7 +988,7 @@ function usePresenterWindow(input) {
|
|
|
988
988
|
}, []);
|
|
989
989
|
const swapDisplays = React3.useCallback(async () => {
|
|
990
990
|
const audience = audienceWindowRef.current;
|
|
991
|
-
return audience && !audience.closed ?
|
|
991
|
+
return audience && !audience.closed ? chunk6F4WVHS3_js.swapPresentationWindows(window, audience) : false;
|
|
992
992
|
}, []);
|
|
993
993
|
const syncSlideToAudience = React3.useCallback(
|
|
994
994
|
(slideIndex) => {
|
|
@@ -1070,10 +1070,10 @@ function usePresenterWindow(input) {
|
|
|
1070
1070
|
audienceWindowRef.current = blankWin;
|
|
1071
1071
|
const sessionId = generateSessionId();
|
|
1072
1072
|
sessionIdRef.current = sessionId;
|
|
1073
|
-
const audienceUrl =
|
|
1074
|
-
void
|
|
1073
|
+
const audienceUrl = chunk6F4WVHS3_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1074
|
+
void chunk6F4WVHS3_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1075
1075
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1076
|
-
|
|
1076
|
+
chunk6F4WVHS3_js.placeAudienceWindow(blankWin, placement);
|
|
1077
1077
|
}
|
|
1078
1078
|
return void 0;
|
|
1079
1079
|
});
|
|
@@ -1129,7 +1129,7 @@ function usePresenterWindow(input) {
|
|
|
1129
1129
|
}
|
|
1130
1130
|
const handleMessage = (event) => {
|
|
1131
1131
|
const message = event.data;
|
|
1132
|
-
if (
|
|
1132
|
+
if (chunk6F4WVHS3_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1133
1133
|
syncStateToAudience(snapshotRef.current);
|
|
1134
1134
|
}
|
|
1135
1135
|
};
|
|
@@ -1211,7 +1211,7 @@ function useAudienceMode(input) {
|
|
|
1211
1211
|
}
|
|
1212
1212
|
channel.onmessage = (event) => {
|
|
1213
1213
|
const data = event.data;
|
|
1214
|
-
if (!
|
|
1214
|
+
if (!chunk6F4WVHS3_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1215
1215
|
return;
|
|
1216
1216
|
}
|
|
1217
1217
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1237,7 +1237,7 @@ function useAudienceMode(input) {
|
|
|
1237
1237
|
};
|
|
1238
1238
|
if (expectedSessionId) {
|
|
1239
1239
|
channel.postMessage({
|
|
1240
|
-
origin:
|
|
1240
|
+
origin: chunk6F4WVHS3_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1241
1241
|
type: "audience-ready",
|
|
1242
1242
|
sessionId: expectedSessionId
|
|
1243
1243
|
});
|
|
@@ -1502,7 +1502,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1502
1502
|
return;
|
|
1503
1503
|
}
|
|
1504
1504
|
if (action.url && !actionStr.includes("hlinksldjump")) {
|
|
1505
|
-
if (
|
|
1505
|
+
if (chunk6F4WVHS3_js.isUrlSafe(action.url)) {
|
|
1506
1506
|
window.open(action.url, "_blank", "noopener,noreferrer");
|
|
1507
1507
|
}
|
|
1508
1508
|
}
|
|
@@ -1512,7 +1512,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1512
1512
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1513
1513
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1514
1514
|
const transition = incomingSlide?.transition;
|
|
1515
|
-
const durationMs = deps.playTransition ?
|
|
1515
|
+
const durationMs = deps.playTransition ? chunk6F4WVHS3_js.resolveTransitionDurationMs(transition) : 0;
|
|
1516
1516
|
deps.clearPresentationTimers();
|
|
1517
1517
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1518
1518
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1752,17 +1752,17 @@ function useZoomNavigation(input) {
|
|
|
1752
1752
|
};
|
|
1753
1753
|
}
|
|
1754
1754
|
function usePresenterConsole(slideIndex) {
|
|
1755
|
-
const timerRef = React3.useRef(
|
|
1756
|
-
const [snapshot, setSnapshot] = React3.useState(() =>
|
|
1755
|
+
const timerRef = React3.useRef(chunk6F4WVHS3_js.createPresenterTimer());
|
|
1756
|
+
const [snapshot, setSnapshot] = React3.useState(() => chunk6F4WVHS3_js.createInitialPresentationSnapshot(slideIndex));
|
|
1757
1757
|
const patch = React3.useCallback((value) => {
|
|
1758
|
-
setSnapshot((current) =>
|
|
1758
|
+
setSnapshot((current) => chunk6F4WVHS3_js.mergePresentationSnapshot(current, value));
|
|
1759
1759
|
}, []);
|
|
1760
1760
|
React3.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
1761
1761
|
React3.useEffect(() => {
|
|
1762
1762
|
const timer = window.setInterval(() => {
|
|
1763
1763
|
patch({
|
|
1764
1764
|
paused: timerRef.current.paused,
|
|
1765
|
-
elapsedMs:
|
|
1765
|
+
elapsedMs: chunk6F4WVHS3_js.presenterElapsed(timerRef.current)
|
|
1766
1766
|
});
|
|
1767
1767
|
}, 1e3);
|
|
1768
1768
|
return () => window.clearInterval(timer);
|
|
@@ -1772,19 +1772,19 @@ function usePresenterConsole(slideIndex) {
|
|
|
1772
1772
|
applyAudienceSnapshot: setSnapshot,
|
|
1773
1773
|
setBlackout: (blackout) => patch({ blackout }),
|
|
1774
1774
|
toggleTimer: () => {
|
|
1775
|
-
timerRef.current =
|
|
1775
|
+
timerRef.current = chunk6F4WVHS3_js.togglePresenterTimer(timerRef.current);
|
|
1776
1776
|
patch({
|
|
1777
1777
|
paused: timerRef.current.paused,
|
|
1778
|
-
elapsedMs:
|
|
1778
|
+
elapsedMs: chunk6F4WVHS3_js.presenterElapsed(timerRef.current)
|
|
1779
1779
|
});
|
|
1780
1780
|
},
|
|
1781
1781
|
resetTimer: () => {
|
|
1782
|
-
timerRef.current =
|
|
1782
|
+
timerRef.current = chunk6F4WVHS3_js.resetPresenterTimer();
|
|
1783
1783
|
patch({ paused: false, elapsedMs: 0 });
|
|
1784
1784
|
},
|
|
1785
1785
|
stepZoom: (direction) => setSnapshot(
|
|
1786
|
-
(current) =>
|
|
1787
|
-
zoom:
|
|
1786
|
+
(current) => chunk6F4WVHS3_js.mergePresentationSnapshot(current, {
|
|
1787
|
+
zoom: chunk6F4WVHS3_js.stepPresenterZoom(
|
|
1788
1788
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
1789
1789
|
direction
|
|
1790
1790
|
)
|
|
@@ -2352,7 +2352,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2352
2352
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2353
2353
|
slides.forEach((slide, slideIndex) => {
|
|
2354
2354
|
for (const element of slide.elements || []) {
|
|
2355
|
-
if (!
|
|
2355
|
+
if (!chunkFWF2SP6N_js.hasTextProperties(element)) {
|
|
2356
2356
|
continue;
|
|
2357
2357
|
}
|
|
2358
2358
|
const segments = element.textSegments ?? [];
|
|
@@ -2403,7 +2403,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2403
2403
|
continue;
|
|
2404
2404
|
}
|
|
2405
2405
|
const element = slide.elements[elIdx];
|
|
2406
|
-
if (!
|
|
2406
|
+
if (!chunkFWF2SP6N_js.hasTextProperties(element)) {
|
|
2407
2407
|
continue;
|
|
2408
2408
|
}
|
|
2409
2409
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3328,12 +3328,12 @@ function useViewerState(input) {
|
|
|
3328
3328
|
function partitionTemplateElements(slides) {
|
|
3329
3329
|
const templateElementsBySlideId = {};
|
|
3330
3330
|
const nextSlides = slides.map((slide) => {
|
|
3331
|
-
const template = slide.elements.filter((el) =>
|
|
3331
|
+
const template = slide.elements.filter((el) => chunk6F4WVHS3_js.isTemplateElement(el));
|
|
3332
3332
|
if (template.length === 0) {
|
|
3333
3333
|
return slide;
|
|
3334
3334
|
}
|
|
3335
3335
|
templateElementsBySlideId[slide.id] = template;
|
|
3336
|
-
return { ...slide, elements: slide.elements.filter((el) => !
|
|
3336
|
+
return { ...slide, elements: slide.elements.filter((el) => !chunk6F4WVHS3_js.isTemplateElement(el)) };
|
|
3337
3337
|
});
|
|
3338
3338
|
return { slides: nextSlides, templateElementsBySlideId };
|
|
3339
3339
|
}
|
|
@@ -3407,7 +3407,7 @@ function useLoadContent({
|
|
|
3407
3407
|
);
|
|
3408
3408
|
}
|
|
3409
3409
|
const previousHandler = handlerRef.current;
|
|
3410
|
-
const handler = new
|
|
3410
|
+
const handler = new chunkFWF2SP6N_js.PptxHandler();
|
|
3411
3411
|
const parsed = await handler.load(buffer);
|
|
3412
3412
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3413
3413
|
handler.dispose();
|
|
@@ -3419,7 +3419,7 @@ function useLoadContent({
|
|
|
3419
3419
|
handlerRef.current = null;
|
|
3420
3420
|
const mediaElements = [];
|
|
3421
3421
|
for (const slide of parsed.slides) {
|
|
3422
|
-
|
|
3422
|
+
chunk6F4WVHS3_js.collectMediaElements(slide.elements, mediaElements);
|
|
3423
3423
|
}
|
|
3424
3424
|
for (const url of mediaDataUrls.values()) {
|
|
3425
3425
|
if (url.startsWith("blob:")) {
|
|
@@ -3460,7 +3460,7 @@ function useLoadContent({
|
|
|
3460
3460
|
}
|
|
3461
3461
|
})
|
|
3462
3462
|
);
|
|
3463
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3463
|
+
const { paths: imagePaths, refs: imageRefs } = chunk6F4WVHS3_js.collectImagePaths(parsed.slides);
|
|
3464
3464
|
let nextSlides = parsed.slides;
|
|
3465
3465
|
if (imagePaths.size > 0) {
|
|
3466
3466
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3549,7 +3549,7 @@ function useLoadContent({
|
|
|
3549
3549
|
setHasMacros(parsed.hasMacros === true);
|
|
3550
3550
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3551
3551
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3552
|
-
setGuides(
|
|
3552
|
+
setGuides(chunk6F4WVHS3_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3553
3553
|
setActiveSlideIndex(0);
|
|
3554
3554
|
clearSelection();
|
|
3555
3555
|
setIsDirty(false);
|
|
@@ -3557,7 +3557,7 @@ function useLoadContent({
|
|
|
3557
3557
|
onContentApplied?.();
|
|
3558
3558
|
} catch (err) {
|
|
3559
3559
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3560
|
-
if (err instanceof
|
|
3560
|
+
if (err instanceof chunkFWF2SP6N_js.EncryptedFileError) {
|
|
3561
3561
|
setIsEncrypted(true);
|
|
3562
3562
|
} else {
|
|
3563
3563
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3634,7 +3634,7 @@ function useAutosave(input) {
|
|
|
3634
3634
|
isSavingRef.current = false;
|
|
3635
3635
|
return;
|
|
3636
3636
|
}
|
|
3637
|
-
await
|
|
3637
|
+
await chunk6F4WVHS3_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
3638
3638
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
3639
3639
|
} catch (err) {
|
|
3640
3640
|
setAutosaveStatus({
|
|
@@ -3672,7 +3672,7 @@ function useAutosave(input) {
|
|
|
3672
3672
|
|
|
3673
3673
|
// src/viewer/utils/animation-effects.ts
|
|
3674
3674
|
function getAnimationInitialStyle2(preset, nativeAnimation) {
|
|
3675
|
-
return
|
|
3675
|
+
return chunk6F4WVHS3_js.getAnimationInitialStyle(preset, nativeAnimation);
|
|
3676
3676
|
}
|
|
3677
3677
|
function cn(...inputs) {
|
|
3678
3678
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
@@ -3680,7 +3680,7 @@ function cn(...inputs) {
|
|
|
3680
3680
|
|
|
3681
3681
|
// src/viewer/utils/text-utils.tsx
|
|
3682
3682
|
function getTextStyleForElement(element, fallbackColor) {
|
|
3683
|
-
if (!
|
|
3683
|
+
if (!chunkFWF2SP6N_js.hasTextProperties(element)) {
|
|
3684
3684
|
return { color: fallbackColor };
|
|
3685
3685
|
}
|
|
3686
3686
|
const textDecorationTokens = [];
|
|
@@ -3694,20 +3694,20 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3694
3694
|
const textDecorationStyle = isDoubleStrike ? "double" : void 0;
|
|
3695
3695
|
const hasItalicRuns = element.textStyle?.italic || Boolean(element.textSegments?.some((segment) => segment.style?.italic));
|
|
3696
3696
|
const isRtl = element.textStyle?.rtl === true;
|
|
3697
|
-
const resolvedTextColor = element.textStyle?.hyperlink ?
|
|
3697
|
+
const resolvedTextColor = element.textStyle?.hyperlink ? chunk6F4WVHS3_js.normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : chunk6F4WVHS3_js.normalizeHexColor(element.textStyle?.color, fallbackColor);
|
|
3698
3698
|
const bodyTop = element.textStyle?.bodyInsetTop ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3699
3699
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3700
3700
|
const bodyLeft = element.textStyle?.bodyInsetLeft ?? DEFAULT_BODY_INSET_LR_PX;
|
|
3701
3701
|
const bodyRight = element.textStyle?.bodyInsetRight ?? DEFAULT_BODY_INSET_LR_PX;
|
|
3702
|
-
const writingMode =
|
|
3703
|
-
const textOrientation =
|
|
3704
|
-
const verticalDirection =
|
|
3702
|
+
const writingMode = chunk6F4WVHS3_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
3703
|
+
const textOrientation = chunk6F4WVHS3_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
3704
|
+
const verticalDirection = chunk6F4WVHS3_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
3705
3705
|
const resolvedDirection = verticalDirection || (isRtl ? "rtl" : "ltr");
|
|
3706
3706
|
const resolvedUnicodeBidi = isRtl ? "plaintext" : void 0;
|
|
3707
3707
|
const hasSegments = (element.textSegments?.length ?? 0) > 0;
|
|
3708
3708
|
return {
|
|
3709
3709
|
color: resolvedTextColor,
|
|
3710
|
-
backgroundColor: !hasSegments && element.textStyle?.highlightColor ?
|
|
3710
|
+
backgroundColor: !hasSegments && element.textStyle?.highlightColor ? chunk6F4WVHS3_js.normalizeHexColor(element.textStyle.highlightColor, void 0) : void 0,
|
|
3711
3711
|
textAlign: (() => {
|
|
3712
3712
|
const a = element.textStyle?.align;
|
|
3713
3713
|
if (a === "justLow" || a === "dist" || a === "thaiDist") {
|
|
@@ -3723,7 +3723,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3723
3723
|
textDecorationLine: textDecorationTokens.length > 0 ? textDecorationTokens.join(" ") : "none",
|
|
3724
3724
|
textDecorationStyle,
|
|
3725
3725
|
fontFamily: element.textStyle?.fontFamily || DEFAULT_FONT_FAMILY,
|
|
3726
|
-
lineHeight:
|
|
3726
|
+
lineHeight: chunk6F4WVHS3_js.resolveLineHeight(element.textStyle, hasItalicRuns),
|
|
3727
3727
|
paddingTop: bodyTop + (hasItalicRuns ? 1 : 0),
|
|
3728
3728
|
paddingBottom: bodyBottom + (hasItalicRuns ? 1 : 0),
|
|
3729
3729
|
paddingLeft: bodyLeft + (element.textStyle?.paragraphMarginLeft || 0),
|
|
@@ -3736,7 +3736,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3736
3736
|
// Auto-fit: use OOXML-provided fontScale/lnSpcReduction when available,
|
|
3737
3737
|
// otherwise fall back to heuristic estimation. The pure font-scale maths
|
|
3738
3738
|
// now lives in pptx-viewer-shared (computeAutoFitTextStyle).
|
|
3739
|
-
...
|
|
3739
|
+
...chunk6F4WVHS3_js.computeAutoFitTextStyle({
|
|
3740
3740
|
textStyle: element.textStyle,
|
|
3741
3741
|
text: element.text ?? "",
|
|
3742
3742
|
width: element.width,
|
|
@@ -3769,13 +3769,13 @@ function computeTabSize(tabStops) {
|
|
|
3769
3769
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : void 0;
|
|
3770
3770
|
}
|
|
3771
3771
|
function getTextLayoutStyle(element) {
|
|
3772
|
-
if (!
|
|
3772
|
+
if (!chunkFWF2SP6N_js.hasTextProperties(element)) {
|
|
3773
3773
|
return {};
|
|
3774
3774
|
}
|
|
3775
3775
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
3776
|
-
const writingMode =
|
|
3777
|
-
const textOrientation =
|
|
3778
|
-
const verticalDirection =
|
|
3776
|
+
const writingMode = chunk6F4WVHS3_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
3777
|
+
const textOrientation = chunk6F4WVHS3_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
3778
|
+
const verticalDirection = chunk6F4WVHS3_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
3779
3779
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
3780
3780
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
3781
3781
|
const hasColumns = columnCount > 1;
|
|
@@ -3783,7 +3783,7 @@ function getTextLayoutStyle(element) {
|
|
|
3783
3783
|
const tabStops = element.textStyle?.tabStops;
|
|
3784
3784
|
const tabSize = computeTabSize(tabStops);
|
|
3785
3785
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
3786
|
-
const hasParagraphIndents =
|
|
3786
|
+
const hasParagraphIndents = chunkFWF2SP6N_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
3787
3787
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
3788
3788
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
3789
3789
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -3792,7 +3792,7 @@ function getTextLayoutStyle(element) {
|
|
|
3792
3792
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3793
3793
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
3794
3794
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
3795
|
-
const kinsokuStyles =
|
|
3795
|
+
const kinsokuStyles = chunk6F4WVHS3_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
3796
3796
|
if (hasColumns) {
|
|
3797
3797
|
return {
|
|
3798
3798
|
display: "block",
|
|
@@ -3835,10 +3835,10 @@ function getTextLayoutStyle(element) {
|
|
|
3835
3835
|
|
|
3836
3836
|
// src/viewer/utils/text-effects.tsx
|
|
3837
3837
|
function buildTextFillCss2(style) {
|
|
3838
|
-
return
|
|
3838
|
+
return chunk6F4WVHS3_js.buildTextFillCss(style);
|
|
3839
3839
|
}
|
|
3840
3840
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
3841
|
-
return
|
|
3841
|
+
return chunk6F4WVHS3_js.buildTextBody3DSceneStyle(textStyle);
|
|
3842
3842
|
}
|
|
3843
3843
|
|
|
3844
3844
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -4023,17 +4023,17 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
4023
4023
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
4024
4024
|
return renderedSegments;
|
|
4025
4025
|
}
|
|
4026
|
-
const paraKey = `${elementId}${
|
|
4026
|
+
const paraKey = `${elementId}${chunk6F4WVHS3_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
4027
4027
|
const paraState = subElementAnimStates.get(paraKey);
|
|
4028
4028
|
if (paraState) {
|
|
4029
4029
|
const style = buildAnimStyle(paraState);
|
|
4030
4030
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
4031
4031
|
}
|
|
4032
|
-
const firstWordKey = `${elementId}${
|
|
4032
|
+
const firstWordKey = `${elementId}${chunk6F4WVHS3_js.TEXT_BUILD_ID_SEP}w${paraIndex}-0`;
|
|
4033
4033
|
if (subElementAnimStates.has(firstWordKey)) {
|
|
4034
4034
|
return wrapByWord(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
4035
4035
|
}
|
|
4036
|
-
const firstCharKey = `${elementId}${
|
|
4036
|
+
const firstCharKey = `${elementId}${chunk6F4WVHS3_js.TEXT_BUILD_ID_SEP}c${paraIndex}-0`;
|
|
4037
4037
|
if (subElementAnimStates.has(firstCharKey)) {
|
|
4038
4038
|
return wrapByChar(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
4039
4039
|
}
|
|
@@ -4054,7 +4054,7 @@ function wrapByWord(elementId, paraIndex, paraSegments, states) {
|
|
|
4054
4054
|
nodes.push(/* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Fragment, { children: w }, `ws-${i}`));
|
|
4055
4055
|
continue;
|
|
4056
4056
|
}
|
|
4057
|
-
const key = `${elementId}${
|
|
4057
|
+
const key = `${elementId}${chunk6F4WVHS3_js.TEXT_BUILD_ID_SEP}w${paraIndex}-${wordIdx}`;
|
|
4058
4058
|
const state = states.get(key);
|
|
4059
4059
|
const style = buildAnimStyle(state);
|
|
4060
4060
|
nodes.push(
|
|
@@ -4068,7 +4068,7 @@ function wrapByChar(elementId, paraIndex, paraSegments, states) {
|
|
|
4068
4068
|
const fullText = paraSegments.map((e) => e.segment.text).join("");
|
|
4069
4069
|
const nodes = [];
|
|
4070
4070
|
for (let i = 0; i < fullText.length; i++) {
|
|
4071
|
-
const key = `${elementId}${
|
|
4071
|
+
const key = `${elementId}${chunk6F4WVHS3_js.TEXT_BUILD_ID_SEP}c${paraIndex}-${i}`;
|
|
4072
4072
|
const state = states.get(key);
|
|
4073
4073
|
const style = buildAnimStyle(state);
|
|
4074
4074
|
nodes.push(
|
|
@@ -4081,10 +4081,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
4081
4081
|
if (!needsScriptFonts || !text) {
|
|
4082
4082
|
return text;
|
|
4083
4083
|
}
|
|
4084
|
-
const runs =
|
|
4084
|
+
const runs = chunk6F4WVHS3_js.segmentByScript(text);
|
|
4085
4085
|
if (runs.length <= 1) {
|
|
4086
4086
|
if (runs.length === 1) {
|
|
4087
|
-
const font =
|
|
4087
|
+
const font = chunk6F4WVHS3_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
4088
4088
|
if (font && font !== baseFontFamily) {
|
|
4089
4089
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
4090
4090
|
}
|
|
@@ -4092,7 +4092,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
4092
4092
|
return text;
|
|
4093
4093
|
}
|
|
4094
4094
|
return runs.map((run, i) => {
|
|
4095
|
-
const font =
|
|
4095
|
+
const font = chunk6F4WVHS3_js.resolveFontForScript(run.script, scriptFonts);
|
|
4096
4096
|
if (!font || font === baseFontFamily) {
|
|
4097
4097
|
return /* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
4098
4098
|
}
|
|
@@ -4166,8 +4166,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
4166
4166
|
);
|
|
4167
4167
|
}
|
|
4168
4168
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
4169
|
-
const mathml =
|
|
4170
|
-
const safeMathml = mathml ?
|
|
4169
|
+
const mathml = chunk6F4WVHS3_js.convertOmmlToMathMl(equationXml);
|
|
4170
|
+
const safeMathml = mathml ? chunk6F4WVHS3_js.sanitizeMathMl(mathml) : "";
|
|
4171
4171
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4172
4172
|
"span",
|
|
4173
4173
|
{
|
|
@@ -4217,7 +4217,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
4217
4217
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
4218
4218
|
}
|
|
4219
4219
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
4220
|
-
const picture =
|
|
4220
|
+
const picture = chunk6F4WVHS3_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
4221
4221
|
sizePx: baseFontSize,
|
|
4222
4222
|
fallbackMarker: "\u2022",
|
|
4223
4223
|
accessibleLabel: "Bullet"
|
|
@@ -4267,7 +4267,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4267
4267
|
);
|
|
4268
4268
|
}
|
|
4269
4269
|
const segmentStyle = segment.style || {};
|
|
4270
|
-
const textValue =
|
|
4270
|
+
const textValue = chunk6F4WVHS3_js.substituteFieldText(segment.text || "", segment.fieldType, fieldContext);
|
|
4271
4271
|
const lines = textValue.split("\n");
|
|
4272
4272
|
const textDecorationTokens = [];
|
|
4273
4273
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -4277,8 +4277,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4277
4277
|
textDecorationTokens.push("line-through");
|
|
4278
4278
|
}
|
|
4279
4279
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
4280
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
4281
|
-
const underlineDecoration =
|
|
4280
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunk6F4WVHS3_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunk6F4WVHS3_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
4281
|
+
const underlineDecoration = chunk6F4WVHS3_js.resolveUnderlineDecorationStyle(
|
|
4282
4282
|
Boolean(isDoubleStrike),
|
|
4283
4283
|
segmentStyle.underlineStyle
|
|
4284
4284
|
);
|
|
@@ -4291,14 +4291,14 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4291
4291
|
const autoFitScale = element.textStyle?.autoFitFontScale !== void 0 && element.textStyle.autoFitFontScale > 0 && element.textStyle.autoFitFontScale < 1 ? element.textStyle.autoFitFontScale : 1;
|
|
4292
4292
|
const baseFontSize = rawFontSize * autoFitScale;
|
|
4293
4293
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
4294
|
-
const baseFontFamily = rawFontFamily ?
|
|
4294
|
+
const baseFontFamily = rawFontFamily ? chunkFWF2SP6N_js.getSubstituteFontFamily(rawFontFamily) : DEFAULT_FONT_FAMILY;
|
|
4295
4295
|
const scriptFonts = {
|
|
4296
4296
|
latin: baseFontFamily,
|
|
4297
4297
|
eastAsia: segmentStyle.eastAsiaFont || element.textStyle?.eastAsiaFont || baseFontFamily,
|
|
4298
4298
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
4299
4299
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
4300
4300
|
};
|
|
4301
|
-
const needsScriptFonts =
|
|
4301
|
+
const needsScriptFonts = chunk6F4WVHS3_js.hasDistinctScriptFonts(scriptFonts);
|
|
4302
4302
|
const spanStyle = {
|
|
4303
4303
|
color: resolvedSegmentColor,
|
|
4304
4304
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -4312,15 +4312,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4312
4312
|
verticalAlign: baselineShift,
|
|
4313
4313
|
letterSpacing,
|
|
4314
4314
|
fontKerning,
|
|
4315
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
4315
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunk6F4WVHS3_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
4316
4316
|
...textFillStyles,
|
|
4317
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
4318
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
4317
|
+
textDecorationColor: segmentStyle.underlineColor ? chunk6F4WVHS3_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
4318
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunk6F4WVHS3_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
4319
4319
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
4320
|
-
textShadow:
|
|
4321
|
-
filter:
|
|
4322
|
-
opacity:
|
|
4323
|
-
WebkitBoxReflect:
|
|
4320
|
+
textShadow: chunk6F4WVHS3_js.buildTextShadowCss(segmentStyle),
|
|
4321
|
+
filter: chunk6F4WVHS3_js.buildTextRunFilterChain(segmentStyle),
|
|
4322
|
+
opacity: chunk6F4WVHS3_js.getTextAlphaOpacity(segmentStyle),
|
|
4323
|
+
WebkitBoxReflect: chunk6F4WVHS3_js.buildTextReflectionCss(segmentStyle)
|
|
4324
4324
|
};
|
|
4325
4325
|
const runRtl = segmentStyle.rtl;
|
|
4326
4326
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -4340,7 +4340,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4340
4340
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
4341
4341
|
}
|
|
4342
4342
|
if (bulletInfo.color) {
|
|
4343
|
-
spanStyle.color =
|
|
4343
|
+
spanStyle.color = chunk6F4WVHS3_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
4344
4344
|
}
|
|
4345
4345
|
}
|
|
4346
4346
|
if (bulletInfo?.imageDataUrl || bulletInfo?.imageRelId) {
|
|
@@ -4372,7 +4372,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4372
4372
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
4373
4373
|
};
|
|
4374
4374
|
if (segment.rubyStyle?.color) {
|
|
4375
|
-
rubyStyle.color =
|
|
4375
|
+
rubyStyle.color = chunk6F4WVHS3_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
4376
4376
|
}
|
|
4377
4377
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
4378
4378
|
baseContent,
|
|
@@ -4442,7 +4442,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
4442
4442
|
return paragraphs;
|
|
4443
4443
|
}
|
|
4444
4444
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
4445
|
-
if (!
|
|
4445
|
+
if (!chunkFWF2SP6N_js.hasTextProperties(element)) {
|
|
4446
4446
|
return emptyFallback || null;
|
|
4447
4447
|
}
|
|
4448
4448
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -4463,9 +4463,9 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
4463
4463
|
return element.text || emptyFallback || "";
|
|
4464
4464
|
}
|
|
4465
4465
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
4466
|
-
const paragraphIndents =
|
|
4467
|
-
const elementRtl =
|
|
4468
|
-
const elementAlign =
|
|
4466
|
+
const paragraphIndents = chunkFWF2SP6N_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
4467
|
+
const elementRtl = chunkFWF2SP6N_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
4468
|
+
const elementAlign = chunkFWF2SP6N_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
4469
4469
|
return paragraphs.map((paraSegments, paraIndex) => {
|
|
4470
4470
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
4471
4471
|
const rawMarginLeft = typeof paraIndent?.marginLeft === "number" && paraIndent.marginLeft !== 0 ? paraIndent.marginLeft : void 0;
|
|
@@ -4479,14 +4479,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
4479
4479
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
4480
4480
|
});
|
|
4481
4481
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
4482
|
-
const paraRtl =
|
|
4482
|
+
const paraRtl = chunk6F4WVHS3_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
4483
4483
|
const isRtlParagraph = paraRtl === true;
|
|
4484
|
-
const paraAlign =
|
|
4485
|
-
const cssTextAlign =
|
|
4484
|
+
const paraAlign = chunk6F4WVHS3_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
4485
|
+
const cssTextAlign = chunk6F4WVHS3_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
4486
4486
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
4487
4487
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
4488
4488
|
const paraTextIndent = rawTextIndent;
|
|
4489
|
-
const paraKinsokuStyle =
|
|
4489
|
+
const paraKinsokuStyle = chunk6F4WVHS3_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
4490
4490
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
4491
4491
|
const paraStyle = {
|
|
4492
4492
|
...paraKinsokuStyle
|
|
@@ -4651,7 +4651,7 @@ function isConnectorOrLineElement(element) {
|
|
|
4651
4651
|
if (element.type === "connector") {
|
|
4652
4652
|
return true;
|
|
4653
4653
|
}
|
|
4654
|
-
if (!
|
|
4654
|
+
if (!chunkFWF2SP6N_js.hasShapeProperties(element)) {
|
|
4655
4655
|
return false;
|
|
4656
4656
|
}
|
|
4657
4657
|
const st = getShapeType(element.shapeType);
|
|
@@ -4669,13 +4669,13 @@ function hexToRgbUnit(hex) {
|
|
|
4669
4669
|
};
|
|
4670
4670
|
}
|
|
4671
4671
|
function getDuotoneColors(element) {
|
|
4672
|
-
if (!
|
|
4672
|
+
if (!chunkFWF2SP6N_js.isImageLikeElement(element)) {
|
|
4673
4673
|
return void 0;
|
|
4674
4674
|
}
|
|
4675
4675
|
return element.imageEffects?.duotone;
|
|
4676
4676
|
}
|
|
4677
4677
|
function buildLineShadowCss(element) {
|
|
4678
|
-
if (!
|
|
4678
|
+
if (!chunkFWF2SP6N_js.hasShapeProperties(element)) {
|
|
4679
4679
|
return void 0;
|
|
4680
4680
|
}
|
|
4681
4681
|
const ss = element.shapeStyle;
|
|
@@ -4686,13 +4686,13 @@ function buildLineShadowCss(element) {
|
|
|
4686
4686
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
4687
4687
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
4688
4688
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
4689
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
4690
|
-
|
|
4689
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunk6F4WVHS3_js.colorWithOpacity(
|
|
4690
|
+
chunk6F4WVHS3_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
4691
4691
|
opacity
|
|
4692
4692
|
)}`;
|
|
4693
4693
|
}
|
|
4694
4694
|
function buildLineGlowFilter(element) {
|
|
4695
|
-
if (!
|
|
4695
|
+
if (!chunkFWF2SP6N_js.hasShapeProperties(element)) {
|
|
4696
4696
|
return void 0;
|
|
4697
4697
|
}
|
|
4698
4698
|
const ss = element.shapeStyle;
|
|
@@ -4701,7 +4701,7 @@ function buildLineGlowFilter(element) {
|
|
|
4701
4701
|
}
|
|
4702
4702
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
4703
4703
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
4704
|
-
const glowCol =
|
|
4704
|
+
const glowCol = chunk6F4WVHS3_js.colorWithOpacity(chunk6F4WVHS3_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
4705
4705
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
4706
4706
|
}
|
|
4707
4707
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -4725,7 +4725,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
4725
4725
|
return `dag-duotone-${elementId}`;
|
|
4726
4726
|
}
|
|
4727
4727
|
function hasDagDuotoneEffect(element) {
|
|
4728
|
-
if (!
|
|
4728
|
+
if (!chunkFWF2SP6N_js.hasShapeProperties(element)) {
|
|
4729
4729
|
return false;
|
|
4730
4730
|
}
|
|
4731
4731
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -4788,7 +4788,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
4788
4788
|
|
|
4789
4789
|
// src/viewer/utils/shape-visual-3d.ts
|
|
4790
4790
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
4791
|
-
return
|
|
4791
|
+
return chunk6F4WVHS3_js.build3DExtrusionData(
|
|
4792
4792
|
shape3d,
|
|
4793
4793
|
scene3d,
|
|
4794
4794
|
fillColor,
|
|
@@ -4797,28 +4797,28 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
4797
4797
|
);
|
|
4798
4798
|
}
|
|
4799
4799
|
function apply3dEffects2(base, scene3d, shape3d) {
|
|
4800
|
-
|
|
4800
|
+
chunk6F4WVHS3_js.apply3dEffects(base, scene3d, shape3d);
|
|
4801
4801
|
}
|
|
4802
4802
|
|
|
4803
4803
|
// src/viewer/utils/shape-visual-style.ts
|
|
4804
4804
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor) {
|
|
4805
|
-
if (!
|
|
4805
|
+
if (!chunkFWF2SP6N_js.hasShapeProperties(element)) {
|
|
4806
4806
|
return {};
|
|
4807
4807
|
}
|
|
4808
4808
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
4809
|
-
const clipPath =
|
|
4809
|
+
const clipPath = chunk6F4WVHS3_js.getResolvedShapeClipPath(element);
|
|
4810
4810
|
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;
|
|
4811
4811
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
4812
4812
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
4813
|
-
const strokeDash =
|
|
4814
|
-
const fillGradient =
|
|
4815
|
-
const shadowCss =
|
|
4816
|
-
const innerShadowCss =
|
|
4817
|
-
const resolvedFillColor =
|
|
4818
|
-
const resolvedStrokeColor =
|
|
4813
|
+
const strokeDash = chunk6F4WVHS3_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
4814
|
+
const fillGradient = chunk6F4WVHS3_js.buildCssGradientFromShapeStyle(element.shapeStyle) || element.shapeStyle?.fillGradient;
|
|
4815
|
+
const shadowCss = chunk6F4WVHS3_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
4816
|
+
const innerShadowCss = chunk6F4WVHS3_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
4817
|
+
const resolvedFillColor = chunk6F4WVHS3_js.colorWithOpacity(fillColor, fillOpacity);
|
|
4818
|
+
const resolvedStrokeColor = chunk6F4WVHS3_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
4819
4819
|
const ss = element.shapeStyle;
|
|
4820
4820
|
const combinedShadowParts = [];
|
|
4821
|
-
const multiLayerShadow =
|
|
4821
|
+
const multiLayerShadow = chunk6F4WVHS3_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
4822
4822
|
if (multiLayerShadow) {
|
|
4823
4823
|
combinedShadowParts.push(multiLayerShadow);
|
|
4824
4824
|
} else if (shadowCss) {
|
|
@@ -4827,7 +4827,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4827
4827
|
if (innerShadowCss) {
|
|
4828
4828
|
combinedShadowParts.push(innerShadowCss);
|
|
4829
4829
|
}
|
|
4830
|
-
const glowBoxShadow =
|
|
4830
|
+
const glowBoxShadow = chunk6F4WVHS3_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
4831
4831
|
if (glowBoxShadow) {
|
|
4832
4832
|
combinedShadowParts.push(glowBoxShadow);
|
|
4833
4833
|
}
|
|
@@ -4835,7 +4835,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4835
4835
|
if (lineShadow) {
|
|
4836
4836
|
combinedShadowParts.push(lineShadow);
|
|
4837
4837
|
}
|
|
4838
|
-
const compoundLineShadow =
|
|
4838
|
+
const compoundLineShadow = chunk6F4WVHS3_js.getCompoundLineBoxShadow(
|
|
4839
4839
|
element.shapeStyle?.compoundLine,
|
|
4840
4840
|
strokeWidth,
|
|
4841
4841
|
resolvedStrokeColor
|
|
@@ -4848,7 +4848,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4848
4848
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
4849
4849
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
4850
4850
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
4851
|
-
const glowCol =
|
|
4851
|
+
const glowCol = chunk6F4WVHS3_js.colorWithOpacity(chunk6F4WVHS3_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
4852
4852
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
4853
4853
|
}
|
|
4854
4854
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
@@ -4861,12 +4861,12 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4861
4861
|
if (lineGlowCss) {
|
|
4862
4862
|
filterParts.push(lineGlowCss);
|
|
4863
4863
|
}
|
|
4864
|
-
const dagFilter =
|
|
4864
|
+
const dagFilter = chunk6F4WVHS3_js.getEffectDagFilter(ss, element.id);
|
|
4865
4865
|
if (dagFilter) {
|
|
4866
4866
|
filterParts.push(dagFilter);
|
|
4867
4867
|
}
|
|
4868
4868
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : void 0;
|
|
4869
|
-
const patternFill =
|
|
4869
|
+
const patternFill = chunk6F4WVHS3_js.buildPatternFillCss(element.shapeStyle);
|
|
4870
4870
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
4871
4871
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
4872
4872
|
let reflectCss;
|
|
@@ -4878,7 +4878,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4878
4878
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
4879
4879
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
4880
4880
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
4881
|
-
reflectCss =
|
|
4881
|
+
reflectCss = chunk6F4WVHS3_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
4882
4882
|
}
|
|
4883
4883
|
}
|
|
4884
4884
|
const base = {
|
|
@@ -4892,9 +4892,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4892
4892
|
filter: filterParts.length > 0 ? filterParts.join(" ") : void 0,
|
|
4893
4893
|
opacity: typeof ss?.dagAlphaModFix === "number" ? Math.max(0, Math.min(1, ss.dagAlphaModFix / 100)) : void 0,
|
|
4894
4894
|
mixBlendMode: mapDagBlendModeToCss(ss?.dagFillOverlayBlend),
|
|
4895
|
-
borderWidth: strokeWidth > 0 ?
|
|
4895
|
+
borderWidth: strokeWidth > 0 ? chunk6F4WVHS3_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : void 0,
|
|
4896
4896
|
borderColor: strokeWidth > 0 ? resolvedStrokeColor : void 0,
|
|
4897
|
-
borderStyle: strokeWidth > 0 ?
|
|
4897
|
+
borderStyle: strokeWidth > 0 ? chunk6F4WVHS3_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
4898
4898
|
strokeLinejoin: lineJoinCss,
|
|
4899
4899
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : void 0
|
|
4900
4900
|
};
|
|
@@ -4942,7 +4942,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4942
4942
|
borderWidth: 0,
|
|
4943
4943
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
4944
4944
|
borderTopColor: resolvedStrokeColor,
|
|
4945
|
-
borderTopStyle:
|
|
4945
|
+
borderTopStyle: chunk6F4WVHS3_js.getCssBorderDashStyle(strokeDash)
|
|
4946
4946
|
};
|
|
4947
4947
|
}
|
|
4948
4948
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -4956,13 +4956,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4956
4956
|
function getConnectorAdjustment(element, key, fallback) {
|
|
4957
4957
|
const direct = element.shapeAdjustments?.[key];
|
|
4958
4958
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
4959
|
-
return
|
|
4959
|
+
return chunk6F4WVHS3_js.clampUnitInterval(direct / 1e5);
|
|
4960
4960
|
}
|
|
4961
4961
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
4962
4962
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
4963
|
-
return
|
|
4963
|
+
return chunk6F4WVHS3_js.clampUnitInterval(fallbackKey / 1e5);
|
|
4964
4964
|
}
|
|
4965
|
-
return
|
|
4965
|
+
return chunk6F4WVHS3_js.clampUnitInterval(fallback);
|
|
4966
4966
|
}
|
|
4967
4967
|
function getConnectorPathGeometry(element) {
|
|
4968
4968
|
const width = Math.max(element.width, 1);
|
|
@@ -5089,14 +5089,14 @@ function renderConnectorMarker(markerId, arrowType, color, arrowWidth, arrowLeng
|
|
|
5089
5089
|
);
|
|
5090
5090
|
}
|
|
5091
5091
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor) {
|
|
5092
|
-
if (!
|
|
5092
|
+
if (!chunkFWF2SP6N_js.hasShapeProperties(element)) {
|
|
5093
5093
|
return null;
|
|
5094
5094
|
}
|
|
5095
5095
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
5096
|
-
const fillPaint =
|
|
5097
|
-
const strokePaint =
|
|
5098
|
-
const dashType =
|
|
5099
|
-
const dashArray =
|
|
5096
|
+
const fillPaint = chunk6F4WVHS3_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
5097
|
+
const strokePaint = chunk6F4WVHS3_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
5098
|
+
const dashType = chunk6F4WVHS3_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
5099
|
+
const dashArray = chunk6F4WVHS3_js.getSvgStrokeDasharray(
|
|
5100
5100
|
dashType,
|
|
5101
5101
|
Math.max(strokeWidth, 1),
|
|
5102
5102
|
element.shapeStyle?.customDashSegments
|
|
@@ -5180,18 +5180,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5180
5180
|
}
|
|
5181
5181
|
);
|
|
5182
5182
|
}
|
|
5183
|
-
if (
|
|
5183
|
+
if (chunkFWF2SP6N_js.isCalloutShape(normalizedType)) {
|
|
5184
5184
|
const width = Math.max(element.width, 1);
|
|
5185
5185
|
const height = Math.max(element.height, 1);
|
|
5186
|
-
const geometry =
|
|
5186
|
+
const geometry = chunkFWF2SP6N_js.getCalloutLeaderLineGeometry(
|
|
5187
5187
|
normalizedType,
|
|
5188
5188
|
width,
|
|
5189
5189
|
height,
|
|
5190
5190
|
element.shapeAdjustments
|
|
5191
5191
|
);
|
|
5192
5192
|
if (geometry && geometry.points.length >= 2) {
|
|
5193
|
-
const leaderPath =
|
|
5194
|
-
const bounds =
|
|
5193
|
+
const leaderPath = chunkFWF2SP6N_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
5194
|
+
const bounds = chunkFWF2SP6N_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
5195
5195
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
5196
5196
|
const offsetLeft = bounds.minX;
|
|
5197
5197
|
const offsetTop = bounds.minY;
|
|
@@ -5255,8 +5255,8 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5255
5255
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
5256
5256
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
5257
5257
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
5258
|
-
const offsets =
|
|
5259
|
-
const widths =
|
|
5258
|
+
const offsets = chunk6F4WVHS3_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
5259
|
+
const widths = chunk6F4WVHS3_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
5260
5260
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5261
5261
|
"svg",
|
|
5262
5262
|
{
|
|
@@ -5310,7 +5310,7 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5310
5310
|
|
|
5311
5311
|
// src/viewer/utils/image-style.ts
|
|
5312
5312
|
function getImageMaskStyle(element) {
|
|
5313
|
-
if (!
|
|
5313
|
+
if (!chunkFWF2SP6N_js.hasShapeProperties(element)) {
|
|
5314
5314
|
return void 0;
|
|
5315
5315
|
}
|
|
5316
5316
|
const shapeType = element.shapeType;
|
|
@@ -5319,7 +5319,7 @@ function getImageMaskStyle(element) {
|
|
|
5319
5319
|
}
|
|
5320
5320
|
const normalized = shapeType.toLowerCase();
|
|
5321
5321
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
5322
|
-
const radiusPx =
|
|
5322
|
+
const radiusPx = chunk6F4WVHS3_js.getRoundRectRadiusPx(element);
|
|
5323
5323
|
if (radiusPx <= 0.01) {
|
|
5324
5324
|
return void 0;
|
|
5325
5325
|
}
|
|
@@ -5331,7 +5331,7 @@ function getImageMaskStyle(element) {
|
|
|
5331
5331
|
if (normalized === "can" || normalized === "cylinder") {
|
|
5332
5332
|
return { borderRadius: "48% / 12%" };
|
|
5333
5333
|
}
|
|
5334
|
-
const clipPath =
|
|
5334
|
+
const clipPath = chunk6F4WVHS3_js.getResolvedShapeClipPath(element);
|
|
5335
5335
|
if (!clipPath) {
|
|
5336
5336
|
return void 0;
|
|
5337
5337
|
}
|
|
@@ -5339,7 +5339,7 @@ function getImageMaskStyle(element) {
|
|
|
5339
5339
|
}
|
|
5340
5340
|
function getImageRenderStyle(element) {
|
|
5341
5341
|
const maskStyle = getImageMaskStyle(element) || {};
|
|
5342
|
-
if (!
|
|
5342
|
+
if (!chunkFWF2SP6N_js.isImageLikeElement(element)) {
|
|
5343
5343
|
return {
|
|
5344
5344
|
...maskStyle,
|
|
5345
5345
|
width: "100%",
|
|
@@ -5347,10 +5347,10 @@ function getImageRenderStyle(element) {
|
|
|
5347
5347
|
objectFit: "cover"
|
|
5348
5348
|
};
|
|
5349
5349
|
}
|
|
5350
|
-
const cropLeft =
|
|
5351
|
-
const cropTop =
|
|
5352
|
-
const cropRight =
|
|
5353
|
-
const cropBottom =
|
|
5350
|
+
const cropLeft = chunk6F4WVHS3_js.clampCropValue(element.cropLeft);
|
|
5351
|
+
const cropTop = chunk6F4WVHS3_js.clampCropValue(element.cropTop);
|
|
5352
|
+
const cropRight = chunk6F4WVHS3_js.clampCropValue(element.cropRight);
|
|
5353
|
+
const cropBottom = chunk6F4WVHS3_js.clampCropValue(element.cropBottom);
|
|
5354
5354
|
const hasCrop = cropLeft + cropRight > 1e-4 || cropTop + cropBottom > 1e-4;
|
|
5355
5355
|
if (!hasCrop) {
|
|
5356
5356
|
return {
|
|
@@ -5362,10 +5362,10 @@ function getImageRenderStyle(element) {
|
|
|
5362
5362
|
}
|
|
5363
5363
|
const safeHorizontalScale = cropLeft + cropRight >= 0.99 ? 0.99 / (cropLeft + cropRight) : 1;
|
|
5364
5364
|
const safeVerticalScale = cropTop + cropBottom >= 0.99 ? 0.99 / (cropTop + cropBottom) : 1;
|
|
5365
|
-
const normalizedLeft =
|
|
5366
|
-
const normalizedRight =
|
|
5367
|
-
const normalizedTop =
|
|
5368
|
-
const normalizedBottom =
|
|
5365
|
+
const normalizedLeft = chunk6F4WVHS3_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
5366
|
+
const normalizedRight = chunk6F4WVHS3_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
5367
|
+
const normalizedTop = chunk6F4WVHS3_js.clampCropValue(cropTop * safeVerticalScale);
|
|
5368
|
+
const normalizedBottom = chunk6F4WVHS3_js.clampCropValue(cropBottom * safeVerticalScale);
|
|
5369
5369
|
const remainingWidth = Math.max(0.01, 1 - normalizedLeft - normalizedRight);
|
|
5370
5370
|
const remainingHeight = Math.max(0.01, 1 - normalizedTop - normalizedBottom);
|
|
5371
5371
|
const tx = Math.round(-normalizedLeft / remainingWidth * 1e4) / 100;
|
|
@@ -5394,7 +5394,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
5394
5394
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
5395
5395
|
};
|
|
5396
5396
|
function getCropShapeClipPath(element) {
|
|
5397
|
-
if (!
|
|
5397
|
+
if (!chunkFWF2SP6N_js.isImageLikeElement(element)) {
|
|
5398
5398
|
return void 0;
|
|
5399
5399
|
}
|
|
5400
5400
|
const shape = element.cropShape;
|
|
@@ -5404,7 +5404,7 @@ function getCropShapeClipPath(element) {
|
|
|
5404
5404
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
5405
5405
|
}
|
|
5406
5406
|
function isImageTiled(element) {
|
|
5407
|
-
if (!
|
|
5407
|
+
if (!chunkFWF2SP6N_js.isImageLikeElement(element)) {
|
|
5408
5408
|
return false;
|
|
5409
5409
|
}
|
|
5410
5410
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -5434,7 +5434,7 @@ function tileAlignmentToCssPosition(alignment) {
|
|
|
5434
5434
|
}
|
|
5435
5435
|
}
|
|
5436
5436
|
function getImageTilingStyle(element) {
|
|
5437
|
-
if (!
|
|
5437
|
+
if (!chunkFWF2SP6N_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
5438
5438
|
return void 0;
|
|
5439
5439
|
}
|
|
5440
5440
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -5505,9 +5505,9 @@ function parseGradientFillCss(gradFill) {
|
|
|
5505
5505
|
}
|
|
5506
5506
|
const parsed = stops.map((gs) => {
|
|
5507
5507
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
5508
|
-
const color =
|
|
5509
|
-
const opacity =
|
|
5510
|
-
return { pos, color:
|
|
5508
|
+
const color = chunk6F4WVHS3_js.parseDrawingColor(gs) ?? "#888888";
|
|
5509
|
+
const opacity = chunk6F4WVHS3_js.parseDrawingColorOpacity(gs);
|
|
5510
|
+
return { pos, color: chunk6F4WVHS3_js.colorWithOpacity(color, opacity) };
|
|
5511
5511
|
}).sort((a, b) => a.pos - b.pos);
|
|
5512
5512
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
5513
5513
|
const lin = gradFill["a:lin"];
|
|
@@ -5548,8 +5548,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
5548
5548
|
if (!pattFill) {
|
|
5549
5549
|
return void 0;
|
|
5550
5550
|
}
|
|
5551
|
-
const fgColor =
|
|
5552
|
-
const bgColor =
|
|
5551
|
+
const fgColor = chunk6F4WVHS3_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
5552
|
+
const bgColor = chunk6F4WVHS3_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
5553
5553
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
5554
5554
|
switch (preset) {
|
|
5555
5555
|
case "ltHorz":
|
|
@@ -5660,11 +5660,11 @@ function parseCellBorders(cellProperties) {
|
|
|
5660
5660
|
const prstDash = ln["a:prstDash"];
|
|
5661
5661
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
5662
5662
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
5663
|
-
const color =
|
|
5663
|
+
const color = chunk6F4WVHS3_js.parseDrawingColor(ln["a:solidFill"]);
|
|
5664
5664
|
if (color) {
|
|
5665
|
-
const opacity =
|
|
5665
|
+
const opacity = chunk6F4WVHS3_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
5666
5666
|
const key = `${edge.prefix}`;
|
|
5667
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
5667
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunk6F4WVHS3_js.colorWithOpacity(color, opacity)}`;
|
|
5668
5668
|
}
|
|
5669
5669
|
}
|
|
5670
5670
|
return borderStyle;
|
|
@@ -5677,7 +5677,7 @@ function parseCellTextEffects(runProps) {
|
|
|
5677
5677
|
const textShadowParts = [];
|
|
5678
5678
|
const outerShdw = effectLst["a:outerShdw"];
|
|
5679
5679
|
if (outerShdw) {
|
|
5680
|
-
const shdwColor =
|
|
5680
|
+
const shdwColor = chunk6F4WVHS3_js.parseDrawingColor(outerShdw);
|
|
5681
5681
|
if (shdwColor) {
|
|
5682
5682
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
5683
5683
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -5695,7 +5695,7 @@ function parseCellTextEffects(runProps) {
|
|
|
5695
5695
|
}
|
|
5696
5696
|
const glow = effectLst["a:glow"];
|
|
5697
5697
|
if (glow) {
|
|
5698
|
-
const glowColor =
|
|
5698
|
+
const glowColor = chunk6F4WVHS3_js.parseDrawingColor(glow);
|
|
5699
5699
|
if (glowColor) {
|
|
5700
5700
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
5701
5701
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -5774,10 +5774,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5774
5774
|
if (runProps?.["@_u"] !== void 0) {
|
|
5775
5775
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
5776
5776
|
}
|
|
5777
|
-
const runColor =
|
|
5777
|
+
const runColor = chunk6F4WVHS3_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunk6F4WVHS3_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
5778
5778
|
if (runColor) {
|
|
5779
|
-
const opacity =
|
|
5780
|
-
cellStyle.color =
|
|
5779
|
+
const opacity = chunk6F4WVHS3_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
5780
|
+
cellStyle.color = chunk6F4WVHS3_js.colorWithOpacity(runColor, opacity);
|
|
5781
5781
|
}
|
|
5782
5782
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
5783
5783
|
if (fontFamily) {
|
|
@@ -5787,15 +5787,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5787
5787
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
5788
5788
|
}
|
|
5789
5789
|
const cellProperties = cellXml["a:tcPr"];
|
|
5790
|
-
const cellFill =
|
|
5790
|
+
const cellFill = chunk6F4WVHS3_js.parseDrawingColor(
|
|
5791
5791
|
cellProperties?.["a:solidFill"],
|
|
5792
5792
|
schemeColorOverrides
|
|
5793
5793
|
);
|
|
5794
5794
|
if (cellFill) {
|
|
5795
|
-
const opacity =
|
|
5795
|
+
const opacity = chunk6F4WVHS3_js.parseDrawingColorOpacity(
|
|
5796
5796
|
cellProperties?.["a:solidFill"]
|
|
5797
5797
|
);
|
|
5798
|
-
cellStyle.backgroundColor =
|
|
5798
|
+
cellStyle.backgroundColor = chunk6F4WVHS3_js.colorWithOpacity(cellFill, opacity);
|
|
5799
5799
|
} else {
|
|
5800
5800
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
5801
5801
|
if (gradCss) {
|
|
@@ -5810,16 +5810,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5810
5810
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
5811
5811
|
Object.assign(cellStyle, edgeBorders);
|
|
5812
5812
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
5813
|
-
const borderColor =
|
|
5813
|
+
const borderColor = chunk6F4WVHS3_js.parseDrawingColor(
|
|
5814
5814
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
5815
5815
|
schemeColorOverrides
|
|
5816
|
-
) ||
|
|
5816
|
+
) || chunk6F4WVHS3_js.parseDrawingColor(
|
|
5817
5817
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
5818
5818
|
schemeColorOverrides
|
|
5819
|
-
) ||
|
|
5819
|
+
) || chunk6F4WVHS3_js.parseDrawingColor(
|
|
5820
5820
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
5821
5821
|
schemeColorOverrides
|
|
5822
|
-
) ||
|
|
5822
|
+
) || chunk6F4WVHS3_js.parseDrawingColor(
|
|
5823
5823
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
5824
5824
|
schemeColorOverrides
|
|
5825
5825
|
);
|
|
@@ -5898,10 +5898,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
5898
5898
|
}
|
|
5899
5899
|
let color = base;
|
|
5900
5900
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
5901
|
-
color =
|
|
5901
|
+
color = chunk6F4WVHS3_js.tintColor2(color, fill.tint / 1e5);
|
|
5902
5902
|
}
|
|
5903
5903
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
5904
|
-
color =
|
|
5904
|
+
color = chunk6F4WVHS3_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
5905
5905
|
}
|
|
5906
5906
|
return color;
|
|
5907
5907
|
}
|
|
@@ -5923,10 +5923,10 @@ function applyTableStyleText(text, colorScheme, style) {
|
|
|
5923
5923
|
if (base) {
|
|
5924
5924
|
let color = base;
|
|
5925
5925
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
5926
|
-
color =
|
|
5926
|
+
color = chunk6F4WVHS3_js.tintColor2(color, text.fontTint / 1e5);
|
|
5927
5927
|
}
|
|
5928
5928
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
5929
|
-
color =
|
|
5929
|
+
color = chunk6F4WVHS3_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
5930
5930
|
}
|
|
5931
5931
|
style.color = color;
|
|
5932
5932
|
applied = true;
|
|
@@ -6208,9 +6208,9 @@ function cellStyleToCss(style) {
|
|
|
6208
6208
|
if (style.gradientFillCss) {
|
|
6209
6209
|
css.background = style.gradientFillCss;
|
|
6210
6210
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
6211
|
-
const fg =
|
|
6212
|
-
const bg =
|
|
6213
|
-
const svgPattern =
|
|
6211
|
+
const fg = chunk6F4WVHS3_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
6212
|
+
const bg = chunk6F4WVHS3_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
6213
|
+
const svgPattern = chunk6F4WVHS3_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
6214
6214
|
if (svgPattern) {
|
|
6215
6215
|
const encoded = encodeURIComponent(svgPattern);
|
|
6216
6216
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -6279,7 +6279,7 @@ function cellStyleToCss(style) {
|
|
|
6279
6279
|
if (edge.width || edge.color) {
|
|
6280
6280
|
const w = edge.width ?? 1;
|
|
6281
6281
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
6282
|
-
const s =
|
|
6282
|
+
const s = chunk6F4WVHS3_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
6283
6283
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
6284
6284
|
}
|
|
6285
6285
|
}
|
|
@@ -6321,7 +6321,7 @@ function TableResizeOverlay({
|
|
|
6321
6321
|
const containerRef = React3.useRef(null);
|
|
6322
6322
|
const [rowBounds, setRowBounds] = React3.useState([]);
|
|
6323
6323
|
const dragRef = React3.useRef(null);
|
|
6324
|
-
const colBoundaries = React3.useMemo(() =>
|
|
6324
|
+
const colBoundaries = React3.useMemo(() => chunk6F4WVHS3_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
6325
6325
|
const measureRows = React3.useCallback(() => {
|
|
6326
6326
|
const container = containerRef.current;
|
|
6327
6327
|
if (!container) {
|
|
@@ -6368,11 +6368,11 @@ function TableResizeOverlay({
|
|
|
6368
6368
|
const rect = containerRef.current.getBoundingClientRect();
|
|
6369
6369
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
6370
6370
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
6371
|
-
onResizeColumns(
|
|
6371
|
+
onResizeColumns(chunk6F4WVHS3_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
6372
6372
|
} else if (drag.type === "row" && onResizeRow) {
|
|
6373
6373
|
const deltaY = e.clientY - drag.startPos;
|
|
6374
|
-
const newHeight =
|
|
6375
|
-
drag.initialRowHeight ??
|
|
6374
|
+
const newHeight = chunk6F4WVHS3_js.computeResizedRowHeight(
|
|
6375
|
+
drag.initialRowHeight ?? chunk6F4WVHS3_js.DEFAULT_ROW_HEIGHT,
|
|
6376
6376
|
deltaY
|
|
6377
6377
|
);
|
|
6378
6378
|
onResizeRow(drag.index, newHeight);
|
|
@@ -6410,7 +6410,7 @@ function TableResizeOverlay({
|
|
|
6410
6410
|
e.stopPropagation();
|
|
6411
6411
|
const table = containerRef.current?.querySelector("table");
|
|
6412
6412
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
6413
|
-
const actualHeight = tr?.offsetHeight ??
|
|
6413
|
+
const actualHeight = tr?.offsetHeight ?? chunk6F4WVHS3_js.DEFAULT_ROW_HEIGHT;
|
|
6414
6414
|
document.body.style.cursor = "row-resize";
|
|
6415
6415
|
document.body.style.userSelect = "none";
|
|
6416
6416
|
dragRef.current = {
|
|
@@ -6456,7 +6456,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6456
6456
|
}
|
|
6457
6457
|
const first = selectedCell.selectedCells[0];
|
|
6458
6458
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
6459
|
-
return
|
|
6459
|
+
return chunk6F4WVHS3_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
6460
6460
|
})();
|
|
6461
6461
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6462
6462
|
TableResizeOverlay,
|
|
@@ -6489,7 +6489,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6489
6489
|
return null;
|
|
6490
6490
|
}
|
|
6491
6491
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
6492
|
-
const isInMultiSelection =
|
|
6492
|
+
const isInMultiSelection = chunk6F4WVHS3_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
6493
6493
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
6494
6494
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6495
6495
|
"td",
|
|
@@ -6512,7 +6512,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6512
6512
|
}
|
|
6513
6513
|
event.stopPropagation();
|
|
6514
6514
|
if (event.shiftKey && selectedCell) {
|
|
6515
|
-
const rect =
|
|
6515
|
+
const rect = chunk6F4WVHS3_js.computeSelectionRect(
|
|
6516
6516
|
selectedCell.rowIndex,
|
|
6517
6517
|
selectedCell.columnIndex,
|
|
6518
6518
|
rowIndex,
|
|
@@ -6522,7 +6522,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6522
6522
|
options?.onSelectCell?.({
|
|
6523
6523
|
rowIndex: selectedCell.rowIndex,
|
|
6524
6524
|
columnIndex: selectedCell.columnIndex,
|
|
6525
|
-
selectedCells:
|
|
6525
|
+
selectedCells: chunk6F4WVHS3_js.rectToCells(rect)
|
|
6526
6526
|
});
|
|
6527
6527
|
} else {
|
|
6528
6528
|
options?.onSelectCell?.({
|
|
@@ -6596,7 +6596,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6596
6596
|
}
|
|
6597
6597
|
const first = selectedCell.selectedCells[0];
|
|
6598
6598
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
6599
|
-
return
|
|
6599
|
+
return chunk6F4WVHS3_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
6600
6600
|
})();
|
|
6601
6601
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
6602
6602
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6661,7 +6661,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6661
6661
|
"border px-1 py-0.5 align-top",
|
|
6662
6662
|
isEditable2 && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
6663
6663
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
6664
|
-
|
|
6664
|
+
chunk6F4WVHS3_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
6665
6665
|
),
|
|
6666
6666
|
colSpan,
|
|
6667
6667
|
rowSpan: rSpan,
|
|
@@ -6672,7 +6672,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6672
6672
|
}
|
|
6673
6673
|
event.stopPropagation();
|
|
6674
6674
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
6675
|
-
const rect =
|
|
6675
|
+
const rect = chunk6F4WVHS3_js.computeSelectionRect(
|
|
6676
6676
|
selectedCell.rowIndex,
|
|
6677
6677
|
selectedCell.columnIndex,
|
|
6678
6678
|
rowIndex,
|
|
@@ -6682,7 +6682,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6682
6682
|
options?.onSelectCell?.({
|
|
6683
6683
|
rowIndex: selectedCell.rowIndex,
|
|
6684
6684
|
columnIndex: selectedCell.columnIndex,
|
|
6685
|
-
selectedCells:
|
|
6685
|
+
selectedCells: chunk6F4WVHS3_js.rectToCells(rect)
|
|
6686
6686
|
});
|
|
6687
6687
|
} else {
|
|
6688
6688
|
options?.onSelectCell?.({
|
|
@@ -6734,24 +6734,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6734
6734
|
}
|
|
6735
6735
|
var LEGEND_ITEM_WIDTH = 80;
|
|
6736
6736
|
function partAttrs(part) {
|
|
6737
|
-
return part ?
|
|
6737
|
+
return part ? chunk6F4WVHS3_js.chartPartToAttrs(part) : void 0;
|
|
6738
6738
|
}
|
|
6739
6739
|
function resolveReactPalette(chartData) {
|
|
6740
6740
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
6741
6741
|
return chartData.colorPalette;
|
|
6742
6742
|
}
|
|
6743
|
-
return [...
|
|
6743
|
+
return [...chunk6F4WVHS3_js.getChartStylePalette(chartData.style?.styleId)];
|
|
6744
6744
|
}
|
|
6745
6745
|
function buildReactChartViewModel(element) {
|
|
6746
6746
|
if (element.type !== "chart" || !element.chartData) {
|
|
6747
|
-
return
|
|
6747
|
+
return chunk6F4WVHS3_js.buildChartViewModel(element);
|
|
6748
6748
|
}
|
|
6749
6749
|
const palette = resolveReactPalette(element.chartData);
|
|
6750
6750
|
const themedElement = {
|
|
6751
6751
|
...element,
|
|
6752
6752
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
6753
6753
|
};
|
|
6754
|
-
return
|
|
6754
|
+
return chunk6F4WVHS3_js.buildChartViewModel(themedElement);
|
|
6755
6755
|
}
|
|
6756
6756
|
function renderPrimitive(prim, key) {
|
|
6757
6757
|
switch (prim.kind) {
|
|
@@ -7140,7 +7140,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7140
7140
|
const unmatchedRows = [];
|
|
7141
7141
|
categories.forEach((cat, i) => {
|
|
7142
7142
|
const value = values[i] ?? 0;
|
|
7143
|
-
const code =
|
|
7143
|
+
const code = chunk6F4WVHS3_js.resolveRegionCode(cat);
|
|
7144
7144
|
if (code) {
|
|
7145
7145
|
regionValueMap.set(code, { value, label: cat });
|
|
7146
7146
|
} else {
|
|
@@ -7178,8 +7178,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7178
7178
|
let fill = "#e2e8f0";
|
|
7179
7179
|
let dataLabel = null;
|
|
7180
7180
|
if (entry) {
|
|
7181
|
-
const t =
|
|
7182
|
-
fill =
|
|
7181
|
+
const t = chunk6F4WVHS3_js.normalizeValue(entry.value, minVal, maxVal);
|
|
7182
|
+
fill = chunk6F4WVHS3_js.sequentialColorScale(t);
|
|
7183
7183
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
7184
7184
|
"text",
|
|
7185
7185
|
{
|
|
@@ -7190,7 +7190,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7190
7190
|
fontWeight: 600,
|
|
7191
7191
|
fill: "#1e293b",
|
|
7192
7192
|
style: { pointerEvents: "none" },
|
|
7193
|
-
children:
|
|
7193
|
+
children: chunk6F4WVHS3_js.formatAxisValue(entry.value)
|
|
7194
7194
|
},
|
|
7195
7195
|
`${element.id}-map-dl-${region.code}`
|
|
7196
7196
|
);
|
|
@@ -7208,7 +7208,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7208
7208
|
opacity: 0.9,
|
|
7209
7209
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
7210
7210
|
region.name,
|
|
7211
|
-
entry ? `: ${
|
|
7211
|
+
entry ? `: ${chunk6F4WVHS3_js.formatAxisValue(entry.value)}` : ""
|
|
7212
7212
|
] })
|
|
7213
7213
|
}
|
|
7214
7214
|
),
|
|
@@ -7246,7 +7246,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7246
7246
|
fontSize: 7,
|
|
7247
7247
|
fill: "#64748b",
|
|
7248
7248
|
textAnchor: "middle",
|
|
7249
|
-
children:
|
|
7249
|
+
children: chunk6F4WVHS3_js.formatAxisValue(minVal)
|
|
7250
7250
|
},
|
|
7251
7251
|
`${element.id}-map-legend-min`
|
|
7252
7252
|
),
|
|
@@ -7258,7 +7258,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7258
7258
|
fontSize: 7,
|
|
7259
7259
|
fill: "#64748b",
|
|
7260
7260
|
textAnchor: "middle",
|
|
7261
|
-
children:
|
|
7261
|
+
children: chunk6F4WVHS3_js.formatAxisValue(maxVal)
|
|
7262
7262
|
},
|
|
7263
7263
|
`${element.id}-map-legend-max`
|
|
7264
7264
|
)
|
|
@@ -7324,7 +7324,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7324
7324
|
y,
|
|
7325
7325
|
fontSize,
|
|
7326
7326
|
fill: "#475569",
|
|
7327
|
-
children:
|
|
7327
|
+
children: chunk6F4WVHS3_js.formatAxisValue(row.value)
|
|
7328
7328
|
},
|
|
7329
7329
|
`${element.id}-map-ft-val-${i}`
|
|
7330
7330
|
)
|
|
@@ -7395,7 +7395,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
7395
7395
|
|
|
7396
7396
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
7397
7397
|
function sColor(series, idx) {
|
|
7398
|
-
return
|
|
7398
|
+
return chunk6F4WVHS3_js.seriesColor(series, idx);
|
|
7399
7399
|
}
|
|
7400
7400
|
function valToY(val, range, topY, bottomY) {
|
|
7401
7401
|
const usable = bottomY - topY;
|
|
@@ -7890,7 +7890,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
7890
7890
|
width: 10,
|
|
7891
7891
|
height: 10,
|
|
7892
7892
|
rx: 2,
|
|
7893
|
-
fill:
|
|
7893
|
+
fill: chunk6F4WVHS3_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
7894
7894
|
},
|
|
7895
7895
|
`${id}-leg-r-${i}`
|
|
7896
7896
|
)
|
|
@@ -7914,7 +7914,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
7914
7914
|
width: 10,
|
|
7915
7915
|
height: 10,
|
|
7916
7916
|
rx: 2,
|
|
7917
|
-
fill:
|
|
7917
|
+
fill: chunk6F4WVHS3_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
7918
7918
|
}
|
|
7919
7919
|
),
|
|
7920
7920
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -7927,9 +7927,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
7927
7927
|
}
|
|
7928
7928
|
const lines = [];
|
|
7929
7929
|
if (range.logScale && range.logBase) {
|
|
7930
|
-
const ticks =
|
|
7930
|
+
const ticks = chunk6F4WVHS3_js.generateLogTicks(range);
|
|
7931
7931
|
ticks.forEach((tickVal, i) => {
|
|
7932
|
-
const y =
|
|
7932
|
+
const y = chunk6F4WVHS3_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
7933
7933
|
lines.push(
|
|
7934
7934
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7935
7935
|
"line",
|
|
@@ -7950,7 +7950,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
7950
7950
|
const steps = 4;
|
|
7951
7951
|
for (let i = 0; i <= steps; i++) {
|
|
7952
7952
|
const val = range.min + range.span * i / steps;
|
|
7953
|
-
const y =
|
|
7953
|
+
const y = chunk6F4WVHS3_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
7954
7954
|
lines.push(
|
|
7955
7955
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7956
7956
|
"line",
|
|
@@ -7974,9 +7974,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7974
7974
|
const labels = [];
|
|
7975
7975
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
7976
7976
|
if (range.logScale && range.logBase) {
|
|
7977
|
-
const ticks =
|
|
7977
|
+
const ticks = chunk6F4WVHS3_js.generateLogTicks(range);
|
|
7978
7978
|
ticks.forEach((tickVal, i) => {
|
|
7979
|
-
const y =
|
|
7979
|
+
const y = chunk6F4WVHS3_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
7980
7980
|
labels.push(
|
|
7981
7981
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7982
7982
|
"text",
|
|
@@ -7986,7 +7986,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7986
7986
|
textAnchor: "end",
|
|
7987
7987
|
fontSize: 8,
|
|
7988
7988
|
fill: "#64748b",
|
|
7989
|
-
children: hasDisplayUnits ?
|
|
7989
|
+
children: hasDisplayUnits ? chunk6F4WVHS3_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunk6F4WVHS3_js.formatAxisValue(tickVal)
|
|
7990
7990
|
},
|
|
7991
7991
|
`${id}-vaxis-log-${i}`
|
|
7992
7992
|
)
|
|
@@ -7996,7 +7996,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7996
7996
|
const steps = 4;
|
|
7997
7997
|
for (let i = 0; i <= steps; i++) {
|
|
7998
7998
|
const val = range.min + range.span * i / steps;
|
|
7999
|
-
const y =
|
|
7999
|
+
const y = chunk6F4WVHS3_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8000
8000
|
labels.push(
|
|
8001
8001
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8002
8002
|
"text",
|
|
@@ -8006,7 +8006,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
8006
8006
|
textAnchor: "end",
|
|
8007
8007
|
fontSize: 8,
|
|
8008
8008
|
fill: "#64748b",
|
|
8009
|
-
children: hasDisplayUnits ?
|
|
8009
|
+
children: hasDisplayUnits ? chunk6F4WVHS3_js.formatAxisValueWithUnits(val, axisFormatting) : chunk6F4WVHS3_js.formatAxisValue(val)
|
|
8010
8010
|
},
|
|
8011
8011
|
`${id}-vaxis-${i}`
|
|
8012
8012
|
)
|
|
@@ -8014,7 +8014,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
8014
8014
|
}
|
|
8015
8015
|
}
|
|
8016
8016
|
if (hasDisplayUnits) {
|
|
8017
|
-
const unitLabel =
|
|
8017
|
+
const unitLabel = chunk6F4WVHS3_js.getDisplayUnitLabel(
|
|
8018
8018
|
axisFormatting.displayUnits,
|
|
8019
8019
|
axisFormatting.displayUnitsLabel
|
|
8020
8020
|
);
|
|
@@ -8089,7 +8089,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
8089
8089
|
if (range.min >= 0) {
|
|
8090
8090
|
return null;
|
|
8091
8091
|
}
|
|
8092
|
-
const y =
|
|
8092
|
+
const y = chunk6F4WVHS3_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
8093
8093
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8094
8094
|
"line",
|
|
8095
8095
|
{
|
|
@@ -8113,7 +8113,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8113
8113
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
8114
8114
|
for (let i = 0; i <= steps; i++) {
|
|
8115
8115
|
const val = range.min + range.span * i / steps;
|
|
8116
|
-
const y =
|
|
8116
|
+
const y = chunk6F4WVHS3_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8117
8117
|
labels.push(
|
|
8118
8118
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8119
8119
|
"text",
|
|
@@ -8125,7 +8125,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8125
8125
|
fontFamily,
|
|
8126
8126
|
fontWeight,
|
|
8127
8127
|
fill: fontColor,
|
|
8128
|
-
children: hasDisplayUnits ?
|
|
8128
|
+
children: hasDisplayUnits ? chunk6F4WVHS3_js.formatAxisValueWithUnits(val, axisFormatting) : chunk6F4WVHS3_js.formatAxisValue(val)
|
|
8129
8129
|
},
|
|
8130
8130
|
`${id}-sec-vaxis-${i}`
|
|
8131
8131
|
)
|
|
@@ -8149,7 +8149,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8149
8149
|
);
|
|
8150
8150
|
}
|
|
8151
8151
|
if (hasDisplayUnits) {
|
|
8152
|
-
const unitLabel =
|
|
8152
|
+
const unitLabel = chunk6F4WVHS3_js.getDisplayUnitLabel(
|
|
8153
8153
|
axisFormatting.displayUnits,
|
|
8154
8154
|
axisFormatting.displayUnitsLabel
|
|
8155
8155
|
);
|
|
@@ -8180,7 +8180,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
8180
8180
|
const ticks = [];
|
|
8181
8181
|
for (let i = 0; i <= steps; i++) {
|
|
8182
8182
|
const val = range.min + range.span * i / steps;
|
|
8183
|
-
const y =
|
|
8183
|
+
const y = chunk6F4WVHS3_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8184
8184
|
ticks.push(
|
|
8185
8185
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8186
8186
|
"line",
|
|
@@ -8207,7 +8207,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
8207
8207
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
8208
8208
|
for (let i = 0; i <= steps; i++) {
|
|
8209
8209
|
const val = range.min + range.span * i / steps;
|
|
8210
|
-
const y =
|
|
8210
|
+
const y = chunk6F4WVHS3_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8211
8211
|
lines.push(
|
|
8212
8212
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8213
8213
|
"line",
|
|
@@ -8368,7 +8368,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
8368
8368
|
width: 8,
|
|
8369
8369
|
height: 8,
|
|
8370
8370
|
borderRadius: 2,
|
|
8371
|
-
backgroundColor:
|
|
8371
|
+
backgroundColor: chunk6F4WVHS3_js.seriesColor(
|
|
8372
8372
|
s,
|
|
8373
8373
|
si,
|
|
8374
8374
|
chartData.style?.styleId,
|
|
@@ -8407,8 +8407,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
8407
8407
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
8408
8408
|
const style = chartData.style;
|
|
8409
8409
|
const legendPos = style?.legendPosition || "b";
|
|
8410
|
-
const range =
|
|
8411
|
-
const layout =
|
|
8410
|
+
const range = chunk6F4WVHS3_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8411
|
+
const layout = chunk6F4WVHS3_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8412
8412
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8413
8413
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
8414
8414
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -8429,10 +8429,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
8429
8429
|
const close = closeSeries.values[ci] ?? high;
|
|
8430
8430
|
const isUp = close >= open;
|
|
8431
8431
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
8432
|
-
const highY =
|
|
8433
|
-
const lowY =
|
|
8434
|
-
const openY =
|
|
8435
|
-
const closeY =
|
|
8432
|
+
const highY = chunk6F4WVHS3_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
8433
|
+
const lowY = chunk6F4WVHS3_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
8434
|
+
const openY = chunk6F4WVHS3_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
8435
|
+
const closeY = chunk6F4WVHS3_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
8436
8436
|
elements.push(
|
|
8437
8437
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8438
8438
|
"line",
|
|
@@ -8475,7 +8475,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
8475
8475
|
textAnchor: "middle",
|
|
8476
8476
|
fontSize: 7,
|
|
8477
8477
|
fill: "#334155",
|
|
8478
|
-
children:
|
|
8478
|
+
children: chunk6F4WVHS3_js.formatAxisValue(close)
|
|
8479
8479
|
},
|
|
8480
8480
|
`${element.id}-stock-dl-${ci}`
|
|
8481
8481
|
)
|
|
@@ -8517,7 +8517,7 @@ function FailedToLoad() {
|
|
|
8517
8517
|
var LazySurfaceChart3DScene = React3__default.default.lazy(
|
|
8518
8518
|
async () => {
|
|
8519
8519
|
try {
|
|
8520
|
-
return await import('./SurfaceChart3DScene-
|
|
8520
|
+
return await import('./SurfaceChart3DScene-GISPZ4C2.js');
|
|
8521
8521
|
} catch {
|
|
8522
8522
|
return { default: FailedToLoad };
|
|
8523
8523
|
}
|
|
@@ -8541,7 +8541,7 @@ var SurfaceChart3DErrorBoundary = class extends React3__default.default.Componen
|
|
|
8541
8541
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
8542
8542
|
const rows = chartData.series.length;
|
|
8543
8543
|
const cols = Math.max(categoryLabels.length, 1);
|
|
8544
|
-
const range =
|
|
8544
|
+
const range = chunk6F4WVHS3_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8545
8545
|
const heightMap = new Float32Array(rows * cols);
|
|
8546
8546
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
8547
8547
|
for (let r = 0; r < rows; r++) {
|
|
@@ -8661,8 +8661,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
8661
8661
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
8662
8662
|
const style = chartData.style;
|
|
8663
8663
|
const legendPos = style?.legendPosition || "b";
|
|
8664
|
-
const layout =
|
|
8665
|
-
const range =
|
|
8664
|
+
const layout = chunk6F4WVHS3_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
8665
|
+
const range = chunk6F4WVHS3_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8666
8666
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8667
8667
|
const seriesCount = chartData.series.length;
|
|
8668
8668
|
const cols = catCount - 1;
|
|
@@ -8752,8 +8752,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
8752
8752
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
8753
8753
|
const style = chartData.style;
|
|
8754
8754
|
const legendPos = style?.legendPosition || "b";
|
|
8755
|
-
const layout =
|
|
8756
|
-
const range =
|
|
8755
|
+
const layout = chunk6F4WVHS3_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8756
|
+
const range = chunk6F4WVHS3_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8757
8757
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8758
8758
|
const seriesCount = chartData.series.length;
|
|
8759
8759
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -8816,7 +8816,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
8816
8816
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
8817
8817
|
const style = chartData.style;
|
|
8818
8818
|
const legendPos = style?.legendPosition || "b";
|
|
8819
|
-
const layout =
|
|
8819
|
+
const layout = chunk6F4WVHS3_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
8820
8820
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
8821
8821
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
8822
8822
|
const rects = [];
|
|
@@ -8839,7 +8839,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
8839
8839
|
y: curY,
|
|
8840
8840
|
width: Math.max(w - 1, 1),
|
|
8841
8841
|
height: Math.max(h - 1, 1),
|
|
8842
|
-
fill:
|
|
8842
|
+
fill: chunk6F4WVHS3_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
8843
8843
|
rx: 2,
|
|
8844
8844
|
opacity: 0.85
|
|
8845
8845
|
},
|
|
@@ -8892,8 +8892,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8892
8892
|
const style = chartData.style;
|
|
8893
8893
|
const legendPos = style?.legendPosition || "b";
|
|
8894
8894
|
const values = chartData.series[0]?.values ?? [];
|
|
8895
|
-
const range =
|
|
8896
|
-
const layout =
|
|
8895
|
+
const range = chunk6F4WVHS3_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8896
|
+
const layout = chunk6F4WVHS3_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8897
8897
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
8898
8898
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
8899
8899
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -8904,8 +8904,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8904
8904
|
const isLast = i === values.length - 1;
|
|
8905
8905
|
const startVal = isLast ? 0 : runningTotal;
|
|
8906
8906
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
8907
|
-
const barStartY =
|
|
8908
|
-
const barEndY =
|
|
8907
|
+
const barStartY = chunk6F4WVHS3_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
8908
|
+
const barEndY = chunk6F4WVHS3_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
8909
8909
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
8910
8910
|
const y = Math.min(barStartY, barEndY);
|
|
8911
8911
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -8934,7 +8934,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8934
8934
|
textAnchor: "middle",
|
|
8935
8935
|
fontSize: 7,
|
|
8936
8936
|
fill: "#334155",
|
|
8937
|
-
children:
|
|
8937
|
+
children: chunk6F4WVHS3_js.formatAxisValue(isLast ? endVal : val)
|
|
8938
8938
|
},
|
|
8939
8939
|
`${element.id}-wf-dl-${i}`
|
|
8940
8940
|
)
|
|
@@ -8982,18 +8982,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8982
8982
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
8983
8983
|
const style = chartData.style;
|
|
8984
8984
|
const legendPos = style?.legendPosition || "b";
|
|
8985
|
-
const layoutOpts =
|
|
8985
|
+
const layoutOpts = chunk6F4WVHS3_js.computeLayoutOptions(
|
|
8986
8986
|
chartData.axes,
|
|
8987
8987
|
chartData.dataTable,
|
|
8988
8988
|
chartData.series.length
|
|
8989
8989
|
);
|
|
8990
|
-
const layout =
|
|
8991
|
-
const { primary, secondary } =
|
|
8990
|
+
const layout = chunk6F4WVHS3_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
8991
|
+
const { primary, secondary } = chunk6F4WVHS3_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
8992
8992
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
8993
8993
|
const secondarySeries = secondary.map((e) => e.series);
|
|
8994
|
-
const range =
|
|
8995
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
8996
|
-
const secondaryAxisFmt =
|
|
8994
|
+
const range = chunk6F4WVHS3_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
8995
|
+
const secondaryRange = secondarySeries.length > 0 ? chunk6F4WVHS3_js.computeValueRange(secondarySeries) : void 0;
|
|
8996
|
+
const secondaryAxisFmt = chunk6F4WVHS3_js.getSecondaryValueAxis(chartData.axes);
|
|
8997
8997
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8998
8998
|
const barSeriesCount = 1;
|
|
8999
8999
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -9009,8 +9009,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9009
9009
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
9010
9010
|
barSeries.values.forEach((val, vi) => {
|
|
9011
9011
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
9012
|
-
const zeroY =
|
|
9013
|
-
const valY =
|
|
9012
|
+
const zeroY = chunk6F4WVHS3_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
9013
|
+
const valY = chunk6F4WVHS3_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
9014
9014
|
const y = Math.min(zeroY, valY);
|
|
9015
9015
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
9016
9016
|
barElements.push(
|
|
@@ -9021,7 +9021,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9021
9021
|
y,
|
|
9022
9022
|
width: barWidth,
|
|
9023
9023
|
height: h,
|
|
9024
|
-
fill:
|
|
9024
|
+
fill: chunk6F4WVHS3_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
9025
9025
|
rx: 1
|
|
9026
9026
|
},
|
|
9027
9027
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -9037,7 +9037,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9037
9037
|
textAnchor: "middle",
|
|
9038
9038
|
fontSize: 7,
|
|
9039
9039
|
fill: "#334155",
|
|
9040
|
-
children:
|
|
9040
|
+
children: chunk6F4WVHS3_js.formatAxisValue(val)
|
|
9041
9041
|
},
|
|
9042
9042
|
`${element.id}-combo-bar-dl-${vi}`
|
|
9043
9043
|
)
|
|
@@ -9054,10 +9054,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9054
9054
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
9055
9055
|
const points = series.values.map((val, vi) => {
|
|
9056
9056
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
9057
|
-
const y =
|
|
9057
|
+
const y = chunk6F4WVHS3_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
9058
9058
|
return { x, y, val };
|
|
9059
9059
|
});
|
|
9060
|
-
const c =
|
|
9060
|
+
const c = chunk6F4WVHS3_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
9061
9061
|
lineElements.push(
|
|
9062
9062
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9063
9063
|
"polyline",
|
|
@@ -9084,7 +9084,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9084
9084
|
textAnchor: "middle",
|
|
9085
9085
|
fontSize: 7,
|
|
9086
9086
|
fill: "#334155",
|
|
9087
|
-
children:
|
|
9087
|
+
children: chunk6F4WVHS3_js.formatAxisValue(p.val)
|
|
9088
9088
|
},
|
|
9089
9089
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
9090
9090
|
)
|
|
@@ -10838,14 +10838,14 @@ function buildNotesPdf(pages) {
|
|
|
10838
10838
|
notes: page.notes,
|
|
10839
10839
|
slideNumber: page.slideNumber
|
|
10840
10840
|
}));
|
|
10841
|
-
const bytes =
|
|
10841
|
+
const bytes = chunk6F4WVHS3_js.buildNotesPdfBytes(images, meta);
|
|
10842
10842
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
10843
10843
|
return URL.createObjectURL(blob);
|
|
10844
10844
|
}
|
|
10845
10845
|
|
|
10846
10846
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
10847
10847
|
function buildPdfFromImageData(images) {
|
|
10848
|
-
const bytes =
|
|
10848
|
+
const bytes = chunk6F4WVHS3_js.buildSlidesPdfBytes(images);
|
|
10849
10849
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
10850
10850
|
return URL.createObjectURL(blob);
|
|
10851
10851
|
}
|
|
@@ -10854,7 +10854,7 @@ function buildPdfFromImageData(images) {
|
|
|
10854
10854
|
var activePreview = null;
|
|
10855
10855
|
function startPreviewAnimation(elementId, preset, options) {
|
|
10856
10856
|
stopPreviewAnimation();
|
|
10857
|
-
const descriptor =
|
|
10857
|
+
const descriptor = chunk6F4WVHS3_js.buildPreviewAnimation(preset, options);
|
|
10858
10858
|
if (!descriptor) {
|
|
10859
10859
|
return;
|
|
10860
10860
|
}
|
|
@@ -10932,7 +10932,7 @@ function useElementOperations(input) {
|
|
|
10932
10932
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
10933
10933
|
const updateElementById = React3.useCallback(
|
|
10934
10934
|
(elementId, updates) => {
|
|
10935
|
-
if (
|
|
10935
|
+
if (chunk6F4WVHS3_js.isTemplateElementId(elementId)) {
|
|
10936
10936
|
const slideId = activeSlide?.id;
|
|
10937
10937
|
if (slideId) {
|
|
10938
10938
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -10972,7 +10972,7 @@ function useElementOperations(input) {
|
|
|
10972
10972
|
);
|
|
10973
10973
|
const updateSelectedShapeStyle = React3.useCallback(
|
|
10974
10974
|
(updates) => {
|
|
10975
|
-
if (!selectedElement || !
|
|
10975
|
+
if (!selectedElement || !chunkFWF2SP6N_js.hasShapeProperties(selectedElement)) {
|
|
10976
10976
|
return;
|
|
10977
10977
|
}
|
|
10978
10978
|
updateSelectedElement({
|
|
@@ -10983,17 +10983,17 @@ function useElementOperations(input) {
|
|
|
10983
10983
|
);
|
|
10984
10984
|
const updateSelectedTextStyle = React3.useCallback(
|
|
10985
10985
|
(updates) => {
|
|
10986
|
-
if (!selectedElement || !
|
|
10986
|
+
if (!selectedElement || !chunkFWF2SP6N_js.hasTextProperties(selectedElement)) {
|
|
10987
10987
|
return;
|
|
10988
10988
|
}
|
|
10989
|
-
const inlineSel =
|
|
10989
|
+
const inlineSel = chunk6F4WVHS3_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
10990
10990
|
if (inlineSel && selectedElement.textSegments) {
|
|
10991
|
-
const { newSegments: newSegments2, newSelection } =
|
|
10991
|
+
const { newSegments: newSegments2, newSelection } = chunk6F4WVHS3_js.applyStyleToSelectedSegments(
|
|
10992
10992
|
selectedElement.textSegments,
|
|
10993
10993
|
inlineSel,
|
|
10994
10994
|
updates
|
|
10995
10995
|
);
|
|
10996
|
-
|
|
10996
|
+
chunk6F4WVHS3_js.setPendingSelectionRestore(newSelection);
|
|
10997
10997
|
updateSelectedElement({
|
|
10998
10998
|
textSegments: newSegments2
|
|
10999
10999
|
});
|
|
@@ -11013,12 +11013,12 @@ function useElementOperations(input) {
|
|
|
11013
11013
|
);
|
|
11014
11014
|
const updateSelectedTextCase = React3.useCallback(
|
|
11015
11015
|
(mode) => {
|
|
11016
|
-
if (!selectedElement || !
|
|
11016
|
+
if (!selectedElement || !chunkFWF2SP6N_js.hasTextProperties(selectedElement)) {
|
|
11017
11017
|
return;
|
|
11018
11018
|
}
|
|
11019
|
-
const inlineSel =
|
|
11019
|
+
const inlineSel = chunk6F4WVHS3_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
11020
11020
|
if (inlineSel && selectedElement.textSegments) {
|
|
11021
|
-
const newSegments =
|
|
11021
|
+
const newSegments = chunk6F4WVHS3_js.applyCaseTransformToSegments(
|
|
11022
11022
|
selectedElement.textSegments,
|
|
11023
11023
|
inlineSel,
|
|
11024
11024
|
mode
|
|
@@ -11028,14 +11028,14 @@ function useElementOperations(input) {
|
|
|
11028
11028
|
}
|
|
11029
11029
|
const updates = {};
|
|
11030
11030
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
11031
|
-
updates.textSegments =
|
|
11031
|
+
updates.textSegments = chunk6F4WVHS3_js.applyCaseTransformToSegments(
|
|
11032
11032
|
selectedElement.textSegments,
|
|
11033
11033
|
null,
|
|
11034
11034
|
mode
|
|
11035
11035
|
);
|
|
11036
11036
|
}
|
|
11037
11037
|
if (typeof selectedElement.text === "string") {
|
|
11038
|
-
updates.text =
|
|
11038
|
+
updates.text = chunk6F4WVHS3_js.transformTextCase(selectedElement.text, mode);
|
|
11039
11039
|
}
|
|
11040
11040
|
updateSelectedElement(updates);
|
|
11041
11041
|
},
|
|
@@ -11090,7 +11090,7 @@ function useSectionOperations(input) {
|
|
|
11090
11090
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
11091
11091
|
const addSection2 = React3.useCallback(
|
|
11092
11092
|
(name, afterSlideIndex) => {
|
|
11093
|
-
const result =
|
|
11093
|
+
const result = chunk6F4WVHS3_js.addSection(sections, slides, name, afterSlideIndex);
|
|
11094
11094
|
setSlides(result.slides);
|
|
11095
11095
|
setSections(result.sections);
|
|
11096
11096
|
markDirty();
|
|
@@ -11099,7 +11099,7 @@ function useSectionOperations(input) {
|
|
|
11099
11099
|
);
|
|
11100
11100
|
const renameSection2 = React3.useCallback(
|
|
11101
11101
|
(sectionId, newName) => {
|
|
11102
|
-
const result =
|
|
11102
|
+
const result = chunk6F4WVHS3_js.renameSection(sections, slides, sectionId, newName);
|
|
11103
11103
|
setSections(result.sections);
|
|
11104
11104
|
setSlides(result.slides);
|
|
11105
11105
|
markDirty();
|
|
@@ -11108,7 +11108,7 @@ function useSectionOperations(input) {
|
|
|
11108
11108
|
);
|
|
11109
11109
|
const deleteSection2 = React3.useCallback(
|
|
11110
11110
|
(sectionId) => {
|
|
11111
|
-
const result =
|
|
11111
|
+
const result = chunk6F4WVHS3_js.deleteSection(sections, slides, sectionId);
|
|
11112
11112
|
setSections(result.sections);
|
|
11113
11113
|
setSlides(result.slides);
|
|
11114
11114
|
markDirty();
|
|
@@ -11117,21 +11117,21 @@ function useSectionOperations(input) {
|
|
|
11117
11117
|
);
|
|
11118
11118
|
const moveSectionUp2 = React3.useCallback(
|
|
11119
11119
|
(sectionId) => {
|
|
11120
|
-
setSections(
|
|
11120
|
+
setSections(chunk6F4WVHS3_js.moveSectionUp(sections, sectionId));
|
|
11121
11121
|
markDirty();
|
|
11122
11122
|
},
|
|
11123
11123
|
[sections, setSections, markDirty]
|
|
11124
11124
|
);
|
|
11125
11125
|
const moveSectionDown2 = React3.useCallback(
|
|
11126
11126
|
(sectionId) => {
|
|
11127
|
-
setSections(
|
|
11127
|
+
setSections(chunk6F4WVHS3_js.moveSectionDown(sections, sectionId));
|
|
11128
11128
|
markDirty();
|
|
11129
11129
|
},
|
|
11130
11130
|
[sections, setSections, markDirty]
|
|
11131
11131
|
);
|
|
11132
11132
|
const moveSlidesToSection2 = React3.useCallback(
|
|
11133
11133
|
(slideIndexes, targetSectionId) => {
|
|
11134
|
-
const result =
|
|
11134
|
+
const result = chunk6F4WVHS3_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
11135
11135
|
setSlides(result.slides);
|
|
11136
11136
|
setSections(result.sections);
|
|
11137
11137
|
markDirty();
|
|
@@ -11150,7 +11150,7 @@ function useSectionOperations(input) {
|
|
|
11150
11150
|
|
|
11151
11151
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
11152
11152
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
11153
|
-
const resized =
|
|
11153
|
+
const resized = chunk6F4WVHS3_js.applyResize(
|
|
11154
11154
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
11155
11155
|
handle,
|
|
11156
11156
|
dx,
|
|
@@ -11162,7 +11162,7 @@ function computeResizeGeometry(handle, startX, startY, startWidth, startHeight,
|
|
|
11162
11162
|
if (!snapToGrid) {
|
|
11163
11163
|
return box;
|
|
11164
11164
|
}
|
|
11165
|
-
return
|
|
11165
|
+
return chunk6F4WVHS3_js.snapBoxToGrid(box, handle, gridSpacingPx, MIN_ELEMENT_SIZE);
|
|
11166
11166
|
}
|
|
11167
11167
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
11168
11168
|
const range = startWidth || 200;
|
|
@@ -11272,7 +11272,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
11272
11272
|
width: el.width,
|
|
11273
11273
|
height: el.height
|
|
11274
11274
|
}));
|
|
11275
|
-
const snapResult =
|
|
11275
|
+
const snapResult = chunk6F4WVHS3_js.computeSnapToShape(
|
|
11276
11276
|
targetX,
|
|
11277
11277
|
targetY,
|
|
11278
11278
|
primaryEl.width,
|
|
@@ -11415,13 +11415,13 @@ function processPointerUp(input) {
|
|
|
11415
11415
|
if (i !== activeSlideIndex) {
|
|
11416
11416
|
return s;
|
|
11417
11417
|
}
|
|
11418
|
-
const rerouted =
|
|
11418
|
+
const rerouted = chunk6F4WVHS3_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
11419
11419
|
if (rerouted.length === 0) {
|
|
11420
11420
|
return s;
|
|
11421
11421
|
}
|
|
11422
11422
|
return {
|
|
11423
11423
|
...s,
|
|
11424
|
-
elements:
|
|
11424
|
+
elements: chunk6F4WVHS3_js.applyReroutedConnectors(s.elements, rerouted)
|
|
11425
11425
|
};
|
|
11426
11426
|
})
|
|
11427
11427
|
);
|
|
@@ -11440,9 +11440,9 @@ function processPointerUp(input) {
|
|
|
11440
11440
|
}
|
|
11441
11441
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
11442
11442
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
11443
|
-
const hitIds =
|
|
11443
|
+
const hitIds = chunk6F4WVHS3_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
11444
11444
|
if (marquee.additive) {
|
|
11445
|
-
const merged =
|
|
11445
|
+
const merged = chunk6F4WVHS3_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
11446
11446
|
if (merged.length > 0) {
|
|
11447
11447
|
applySelection(merged[0], merged);
|
|
11448
11448
|
} else {
|
|
@@ -11465,8 +11465,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
11465
11465
|
}
|
|
11466
11466
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
11467
11467
|
});
|
|
11468
|
-
const rerouted =
|
|
11469
|
-
return
|
|
11468
|
+
const rerouted = chunk6F4WVHS3_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
11469
|
+
return chunk6F4WVHS3_js.applyReroutedConnectors(movedElements, rerouted);
|
|
11470
11470
|
};
|
|
11471
11471
|
if (editTemplateMode) {
|
|
11472
11472
|
const slideId = activeSlide?.id;
|
|
@@ -11617,9 +11617,9 @@ function useCanvasInteractions(input) {
|
|
|
11617
11617
|
return;
|
|
11618
11618
|
}
|
|
11619
11619
|
const el = elementLookup.get(editId);
|
|
11620
|
-
if (el &&
|
|
11620
|
+
if (el && chunkFWF2SP6N_js.hasTextProperties(el)) {
|
|
11621
11621
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
11622
|
-
const newSegments =
|
|
11622
|
+
const newSegments = chunk6F4WVHS3_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
11623
11623
|
ops.updateElementById(editId, {
|
|
11624
11624
|
text: committedText,
|
|
11625
11625
|
textSegments: newSegments
|
|
@@ -11630,7 +11630,7 @@ function useCanvasInteractions(input) {
|
|
|
11630
11630
|
setInlineEditingText("");
|
|
11631
11631
|
};
|
|
11632
11632
|
const openEquationEditorForElement = (el) => {
|
|
11633
|
-
if (!
|
|
11633
|
+
if (!chunkFWF2SP6N_js.hasTextProperties(el)) {
|
|
11634
11634
|
return false;
|
|
11635
11635
|
}
|
|
11636
11636
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -11659,7 +11659,7 @@ function useCanvasInteractions(input) {
|
|
|
11659
11659
|
justSelectedRef.current = false;
|
|
11660
11660
|
} else {
|
|
11661
11661
|
const el = elementLookup.get(elementId);
|
|
11662
|
-
if (el &&
|
|
11662
|
+
if (el && chunkFWF2SP6N_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
11663
11663
|
if (!openEquationEditorForElement(el)) {
|
|
11664
11664
|
setInlineEditingElementId(elementId);
|
|
11665
11665
|
setInlineEditingText(el.text ?? "");
|
|
@@ -11678,7 +11678,7 @@ function useCanvasInteractions(input) {
|
|
|
11678
11678
|
if (openEquationEditorForElement(el)) {
|
|
11679
11679
|
return;
|
|
11680
11680
|
}
|
|
11681
|
-
if (
|
|
11681
|
+
if (chunkFWF2SP6N_js.hasTextProperties(el)) {
|
|
11682
11682
|
setInlineEditingElementId(elementId);
|
|
11683
11683
|
setInlineEditingText(el.text ?? "");
|
|
11684
11684
|
}
|
|
@@ -11868,7 +11868,7 @@ function createFileHandlers(deps) {
|
|
|
11868
11868
|
h = Math.round(h * scale);
|
|
11869
11869
|
}
|
|
11870
11870
|
addElement({
|
|
11871
|
-
id:
|
|
11871
|
+
id: chunk6F4WVHS3_js.generateElementId(),
|
|
11872
11872
|
type: "image",
|
|
11873
11873
|
x: Math.round((canvasSize.width - w) / 2),
|
|
11874
11874
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -11879,7 +11879,7 @@ function createFileHandlers(deps) {
|
|
|
11879
11879
|
};
|
|
11880
11880
|
img.onerror = () => {
|
|
11881
11881
|
addElement({
|
|
11882
|
-
id:
|
|
11882
|
+
id: chunk6F4WVHS3_js.generateElementId(),
|
|
11883
11883
|
type: "image",
|
|
11884
11884
|
x: 100,
|
|
11885
11885
|
y: 100,
|
|
@@ -11905,7 +11905,7 @@ function createFileHandlers(deps) {
|
|
|
11905
11905
|
const elFilePath = file.path;
|
|
11906
11906
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
11907
11907
|
addElement({
|
|
11908
|
-
id:
|
|
11908
|
+
id: chunk6F4WVHS3_js.generateElementId(),
|
|
11909
11909
|
type: "media",
|
|
11910
11910
|
mediaType,
|
|
11911
11911
|
mediaMimeType: file.type || void 0,
|
|
@@ -12080,13 +12080,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
12080
12080
|
return;
|
|
12081
12081
|
}
|
|
12082
12082
|
addElement({
|
|
12083
|
-
id:
|
|
12083
|
+
id: chunk6F4WVHS3_js.generateElementId(),
|
|
12084
12084
|
type: "smartArt",
|
|
12085
12085
|
x: 100,
|
|
12086
12086
|
y: 120,
|
|
12087
12087
|
width: 600,
|
|
12088
12088
|
height: 340,
|
|
12089
|
-
smartArtData:
|
|
12089
|
+
smartArtData: chunk6F4WVHS3_js.buildSmartArtPresetData(
|
|
12090
12090
|
layout,
|
|
12091
12091
|
defaultItems,
|
|
12092
12092
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -12098,7 +12098,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12098
12098
|
return;
|
|
12099
12099
|
}
|
|
12100
12100
|
addElement({
|
|
12101
|
-
id:
|
|
12101
|
+
id: chunk6F4WVHS3_js.generateElementId(),
|
|
12102
12102
|
type: "shape",
|
|
12103
12103
|
x: 120,
|
|
12104
12104
|
y: 200,
|
|
@@ -12157,7 +12157,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12157
12157
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
12158
12158
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
12159
12159
|
addElement({
|
|
12160
|
-
id:
|
|
12160
|
+
id: chunk6F4WVHS3_js.generateElementId(),
|
|
12161
12161
|
type: "shape",
|
|
12162
12162
|
x: 120,
|
|
12163
12163
|
y: 200,
|
|
@@ -12179,11 +12179,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
12179
12179
|
if (!activeSlide) {
|
|
12180
12180
|
return;
|
|
12181
12181
|
}
|
|
12182
|
-
const preset =
|
|
12182
|
+
const preset = chunk6F4WVHS3_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
12183
12183
|
if (!preset) {
|
|
12184
12184
|
return;
|
|
12185
12185
|
}
|
|
12186
|
-
const defaultPptxAction =
|
|
12186
|
+
const defaultPptxAction = chunkFWF2SP6N_js.elementActionToPptxAction({
|
|
12187
12187
|
trigger: "click",
|
|
12188
12188
|
type: preset.defaultAction
|
|
12189
12189
|
});
|
|
@@ -12192,7 +12192,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12192
12192
|
defaultPptxAction.highlightClick = true;
|
|
12193
12193
|
}
|
|
12194
12194
|
addElement({
|
|
12195
|
-
id:
|
|
12195
|
+
id: chunk6F4WVHS3_js.generateElementId(),
|
|
12196
12196
|
type: "shape",
|
|
12197
12197
|
x: 150,
|
|
12198
12198
|
y: 150,
|
|
@@ -12259,7 +12259,7 @@ function useInsertElements(input) {
|
|
|
12259
12259
|
return;
|
|
12260
12260
|
}
|
|
12261
12261
|
addElement({
|
|
12262
|
-
id:
|
|
12262
|
+
id: chunk6F4WVHS3_js.generateElementId(),
|
|
12263
12263
|
type: "text",
|
|
12264
12264
|
x: 100,
|
|
12265
12265
|
y: 100,
|
|
@@ -12274,7 +12274,7 @@ function useInsertElements(input) {
|
|
|
12274
12274
|
return;
|
|
12275
12275
|
}
|
|
12276
12276
|
addElement({
|
|
12277
|
-
id:
|
|
12277
|
+
id: chunk6F4WVHS3_js.generateElementId(),
|
|
12278
12278
|
type: "shape",
|
|
12279
12279
|
x: 150,
|
|
12280
12280
|
y: 150,
|
|
@@ -12293,15 +12293,15 @@ function useInsertElements(input) {
|
|
|
12293
12293
|
return;
|
|
12294
12294
|
}
|
|
12295
12295
|
addElement({
|
|
12296
|
-
...
|
|
12297
|
-
id:
|
|
12296
|
+
...chunk6F4WVHS3_js.newTableElement(DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
12297
|
+
id: chunk6F4WVHS3_js.generateElementId()
|
|
12298
12298
|
});
|
|
12299
12299
|
};
|
|
12300
12300
|
const handleAddChart = (chartType) => {
|
|
12301
12301
|
if (!activeSlide) {
|
|
12302
12302
|
return;
|
|
12303
12303
|
}
|
|
12304
|
-
addElement(
|
|
12304
|
+
addElement(chunk6F4WVHS3_js.createDefaultChartElement(chartType));
|
|
12305
12305
|
};
|
|
12306
12306
|
const structured = createStructuredElementHandlers({
|
|
12307
12307
|
activeSlide,
|
|
@@ -12371,7 +12371,7 @@ function useClipboardHandlers(input) {
|
|
|
12371
12371
|
if (!selectedElement) {
|
|
12372
12372
|
return;
|
|
12373
12373
|
}
|
|
12374
|
-
setClipboardPayload(
|
|
12374
|
+
setClipboardPayload(chunk6F4WVHS3_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
12375
12375
|
};
|
|
12376
12376
|
const handleDelete = () => {
|
|
12377
12377
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -12388,7 +12388,7 @@ function useClipboardHandlers(input) {
|
|
|
12388
12388
|
handleDelete();
|
|
12389
12389
|
};
|
|
12390
12390
|
const insertClone = (source) => {
|
|
12391
|
-
const clone =
|
|
12391
|
+
const clone = chunk6F4WVHS3_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
12392
12392
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
12393
12393
|
ops.applySelection(clone.id);
|
|
12394
12394
|
history.markDirty();
|
|
@@ -12423,7 +12423,7 @@ function resolveShapePath(el) {
|
|
|
12423
12423
|
return el.pathData;
|
|
12424
12424
|
}
|
|
12425
12425
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
12426
|
-
const clipPath =
|
|
12426
|
+
const clipPath = chunkFWF2SP6N_js.getPresetShapeClipPath(el.shapeType);
|
|
12427
12427
|
if (clipPath) {
|
|
12428
12428
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
12429
12429
|
if (svgPath) {
|
|
@@ -12474,7 +12474,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
12474
12474
|
return parts.join(" ");
|
|
12475
12475
|
}
|
|
12476
12476
|
function transformPathToGlobal(pathData, el) {
|
|
12477
|
-
const polys =
|
|
12477
|
+
const polys = chunkFWF2SP6N_js.svgPathToPolygons(pathData);
|
|
12478
12478
|
if (polys.length === 0) {
|
|
12479
12479
|
return pathData;
|
|
12480
12480
|
}
|
|
@@ -12494,10 +12494,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
12494
12494
|
y: pt.y * scaleY + el.y
|
|
12495
12495
|
}))
|
|
12496
12496
|
);
|
|
12497
|
-
return
|
|
12497
|
+
return chunkFWF2SP6N_js.polygonsToSvgPath(transformed);
|
|
12498
12498
|
}
|
|
12499
12499
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
12500
|
-
const polys =
|
|
12500
|
+
const polys = chunkFWF2SP6N_js.svgPathToPolygons(pathData);
|
|
12501
12501
|
if (polys.length === 0) {
|
|
12502
12502
|
return pathData;
|
|
12503
12503
|
}
|
|
@@ -12507,10 +12507,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
12507
12507
|
y: pt.y - y
|
|
12508
12508
|
}))
|
|
12509
12509
|
);
|
|
12510
|
-
return
|
|
12510
|
+
return chunkFWF2SP6N_js.polygonsToSvgPath(transformed);
|
|
12511
12511
|
}
|
|
12512
12512
|
function pathBounds(pathData) {
|
|
12513
|
-
const polys =
|
|
12513
|
+
const polys = chunkFWF2SP6N_js.svgPathToPolygons(pathData);
|
|
12514
12514
|
let minX = Infinity;
|
|
12515
12515
|
let minY = Infinity;
|
|
12516
12516
|
let maxX = -Infinity;
|
|
@@ -12569,7 +12569,7 @@ function useMergeShapesHandler(input) {
|
|
|
12569
12569
|
let allFragments = [];
|
|
12570
12570
|
let remaining = globalPaths[0];
|
|
12571
12571
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
12572
|
-
const frags =
|
|
12572
|
+
const frags = chunkFWF2SP6N_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
12573
12573
|
if (Array.isArray(frags)) {
|
|
12574
12574
|
allFragments = frags;
|
|
12575
12575
|
}
|
|
@@ -12598,7 +12598,7 @@ function useMergeShapesHandler(input) {
|
|
|
12598
12598
|
bounds.height
|
|
12599
12599
|
);
|
|
12600
12600
|
const newEl = {
|
|
12601
|
-
id:
|
|
12601
|
+
id: chunk6F4WVHS3_js.generateElementId(),
|
|
12602
12602
|
type: "shape",
|
|
12603
12603
|
x: bounds.x,
|
|
12604
12604
|
y: bounds.y,
|
|
@@ -12636,7 +12636,7 @@ function useMergeShapesHandler(input) {
|
|
|
12636
12636
|
} else {
|
|
12637
12637
|
let resultPath = globalPaths[0];
|
|
12638
12638
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
12639
|
-
const result =
|
|
12639
|
+
const result = chunkFWF2SP6N_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
12640
12640
|
if (typeof result === "string") {
|
|
12641
12641
|
resultPath = result;
|
|
12642
12642
|
}
|
|
@@ -12657,7 +12657,7 @@ function useMergeShapesHandler(input) {
|
|
|
12657
12657
|
);
|
|
12658
12658
|
const primary = targets[0];
|
|
12659
12659
|
const newEl = {
|
|
12660
|
-
id:
|
|
12660
|
+
id: chunk6F4WVHS3_js.generateElementId(),
|
|
12661
12661
|
type: "shape",
|
|
12662
12662
|
x: bounds.x,
|
|
12663
12663
|
y: bounds.y,
|
|
@@ -12720,7 +12720,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
12720
12720
|
if (ids.length < 2 || !activeSlide) {
|
|
12721
12721
|
return;
|
|
12722
12722
|
}
|
|
12723
|
-
const { elements, groupId } =
|
|
12723
|
+
const { elements, groupId } = chunk6F4WVHS3_js.groupElements(ops.activeElements, ids, chunk6F4WVHS3_js.generateElementId());
|
|
12724
12724
|
if (groupId === null) {
|
|
12725
12725
|
return;
|
|
12726
12726
|
}
|
|
@@ -12733,12 +12733,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
12733
12733
|
return;
|
|
12734
12734
|
}
|
|
12735
12735
|
const group = selectedElement;
|
|
12736
|
-
const intoTemplate =
|
|
12736
|
+
const intoTemplate = chunk6F4WVHS3_js.isTemplateElementId(group.id);
|
|
12737
12737
|
const ungrouped = group.children.map((child) => ({
|
|
12738
12738
|
...structuredClone(child),
|
|
12739
12739
|
// Keep child ids in the same store as the group so later edits route
|
|
12740
12740
|
// correctly: template groups yield template-prefixed child ids.
|
|
12741
|
-
id: intoTemplate ?
|
|
12741
|
+
id: intoTemplate ? chunk6F4WVHS3_js.makeCloneId(true, child.id || group.id) : child.id || chunk6F4WVHS3_js.generateElementId(),
|
|
12742
12742
|
x: child.x + group.x,
|
|
12743
12743
|
y: child.y + group.y
|
|
12744
12744
|
}));
|
|
@@ -12762,7 +12762,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
12762
12762
|
if (!edge) {
|
|
12763
12763
|
return;
|
|
12764
12764
|
}
|
|
12765
|
-
const positions =
|
|
12765
|
+
const positions = chunk6F4WVHS3_js.alignElements(selectedElements, edge);
|
|
12766
12766
|
for (const [id, pos] of positions) {
|
|
12767
12767
|
const el = elementLookup.get(id);
|
|
12768
12768
|
if (!el) {
|
|
@@ -12780,7 +12780,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
12780
12780
|
if (!distAxis) {
|
|
12781
12781
|
return;
|
|
12782
12782
|
}
|
|
12783
|
-
const positions =
|
|
12783
|
+
const positions = chunk6F4WVHS3_js.distributeElements(selectedElements, distAxis);
|
|
12784
12784
|
for (const [id, pos] of positions) {
|
|
12785
12785
|
const el = elementLookup.get(id);
|
|
12786
12786
|
if (!el) {
|
|
@@ -12797,7 +12797,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
12797
12797
|
}
|
|
12798
12798
|
const id = selectedElement.id;
|
|
12799
12799
|
ops.updateActiveElements(
|
|
12800
|
-
(els) => direction === "forward" ?
|
|
12800
|
+
(els) => direction === "forward" ? chunk6F4WVHS3_js.bringForward(els, id) : direction === "backward" ? chunk6F4WVHS3_js.sendBackward(els, id) : els
|
|
12801
12801
|
);
|
|
12802
12802
|
history.markDirty();
|
|
12803
12803
|
};
|
|
@@ -12807,7 +12807,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
12807
12807
|
}
|
|
12808
12808
|
const id = selectedElement.id;
|
|
12809
12809
|
ops.updateActiveElements(
|
|
12810
|
-
(els) => direction === "front" ?
|
|
12810
|
+
(els) => direction === "front" ? chunk6F4WVHS3_js.bringToFront(els, id) : chunk6F4WVHS3_js.sendToBack(els, id)
|
|
12811
12811
|
);
|
|
12812
12812
|
history.markDirty();
|
|
12813
12813
|
};
|
|
@@ -12929,7 +12929,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
12929
12929
|
function useSlideManagement(input) {
|
|
12930
12930
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
12931
12931
|
const handleAddSlide = () => {
|
|
12932
|
-
const newSlide =
|
|
12932
|
+
const newSlide = chunk6F4WVHS3_js.createBlankSlide(slides.length + 1);
|
|
12933
12933
|
ops.updateSlides((prev) => {
|
|
12934
12934
|
const next = [...prev];
|
|
12935
12935
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -12992,7 +12992,7 @@ function useSlideManagement(input) {
|
|
|
12992
12992
|
}
|
|
12993
12993
|
const clone = {
|
|
12994
12994
|
...src,
|
|
12995
|
-
id:
|
|
12995
|
+
id: chunk6F4WVHS3_js.makeSlideId(),
|
|
12996
12996
|
elements: src.elements.map((el) => ({
|
|
12997
12997
|
...el,
|
|
12998
12998
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -13024,7 +13024,7 @@ function useSlideManagement(input) {
|
|
|
13024
13024
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
13025
13025
|
const insertAt = activeSlideIndex + 1;
|
|
13026
13026
|
const draft = {
|
|
13027
|
-
...
|
|
13027
|
+
...chunk6F4WVHS3_js.createBlankSlide(slides.length + 1),
|
|
13028
13028
|
layoutPath,
|
|
13029
13029
|
...layoutName ? { layoutName } : {}
|
|
13030
13030
|
};
|
|
@@ -13085,7 +13085,7 @@ function createTableMergeHandlers(input) {
|
|
|
13085
13085
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
13086
13086
|
return;
|
|
13087
13087
|
}
|
|
13088
|
-
const newTableData =
|
|
13088
|
+
const newTableData = chunk6F4WVHS3_js.mergeCells(
|
|
13089
13089
|
[
|
|
13090
13090
|
{ row: rowIndex, col: columnIndex },
|
|
13091
13091
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -13093,7 +13093,7 @@ function createTableMergeHandlers(input) {
|
|
|
13093
13093
|
td
|
|
13094
13094
|
);
|
|
13095
13095
|
const updates = { tableData: newTableData };
|
|
13096
|
-
const newRawXml =
|
|
13096
|
+
const newRawXml = chunkFWF2SP6N_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13097
13097
|
if (newRawXml) {
|
|
13098
13098
|
updates.rawXml = newRawXml;
|
|
13099
13099
|
}
|
|
@@ -13119,7 +13119,7 @@ function createTableMergeHandlers(input) {
|
|
|
13119
13119
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
13120
13120
|
return;
|
|
13121
13121
|
}
|
|
13122
|
-
const newTableData =
|
|
13122
|
+
const newTableData = chunk6F4WVHS3_js.mergeCells(
|
|
13123
13123
|
[
|
|
13124
13124
|
{ row: rowIndex, col: columnIndex },
|
|
13125
13125
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -13127,7 +13127,7 @@ function createTableMergeHandlers(input) {
|
|
|
13127
13127
|
td
|
|
13128
13128
|
);
|
|
13129
13129
|
const updates = { tableData: newTableData };
|
|
13130
|
-
const newRawXml =
|
|
13130
|
+
const newRawXml = chunkFWF2SP6N_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13131
13131
|
if (newRawXml) {
|
|
13132
13132
|
updates.rawXml = newRawXml;
|
|
13133
13133
|
}
|
|
@@ -13142,9 +13142,9 @@ function createTableMergeHandlers(input) {
|
|
|
13142
13142
|
return;
|
|
13143
13143
|
}
|
|
13144
13144
|
const td = selectedElement.tableData;
|
|
13145
|
-
const newTableData =
|
|
13145
|
+
const newTableData = chunk6F4WVHS3_js.mergeCells(ts.selectedCells, td);
|
|
13146
13146
|
const updates = { tableData: newTableData };
|
|
13147
|
-
const newRawXml =
|
|
13147
|
+
const newRawXml = chunkFWF2SP6N_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13148
13148
|
if (newRawXml) {
|
|
13149
13149
|
updates.rawXml = newRawXml;
|
|
13150
13150
|
}
|
|
@@ -13161,9 +13161,9 @@ function createTableMergeHandlers(input) {
|
|
|
13161
13161
|
}
|
|
13162
13162
|
const { rowIndex, columnIndex } = ts;
|
|
13163
13163
|
const td = selectedElement.tableData;
|
|
13164
|
-
const newTableData =
|
|
13164
|
+
const newTableData = chunk6F4WVHS3_js.splitCell(rowIndex, columnIndex, td);
|
|
13165
13165
|
const updates = { tableData: newTableData };
|
|
13166
|
-
const newRawXml =
|
|
13166
|
+
const newRawXml = chunkFWF2SP6N_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13167
13167
|
if (newRawXml) {
|
|
13168
13168
|
updates.rawXml = newRawXml;
|
|
13169
13169
|
}
|
|
@@ -13207,7 +13207,7 @@ function createTableStructHandlers(input) {
|
|
|
13207
13207
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
13208
13208
|
}
|
|
13209
13209
|
if (el.rawXml) {
|
|
13210
|
-
const newRawXml =
|
|
13210
|
+
const newRawXml = chunkFWF2SP6N_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
13211
13211
|
if (newRawXml) {
|
|
13212
13212
|
updates.rawXml = newRawXml;
|
|
13213
13213
|
}
|
|
@@ -13231,7 +13231,7 @@ function createTableStructHandlers(input) {
|
|
|
13231
13231
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
13232
13232
|
const updates = {};
|
|
13233
13233
|
if (selectedElement.rawXml) {
|
|
13234
|
-
const newRawXml =
|
|
13234
|
+
const newRawXml = chunkFWF2SP6N_js.updateCellTextStyleInRawXml(
|
|
13235
13235
|
selectedElement,
|
|
13236
13236
|
rowIndex,
|
|
13237
13237
|
colIndex,
|
|
@@ -13295,9 +13295,9 @@ function createTableStructHandlers(input) {
|
|
|
13295
13295
|
return;
|
|
13296
13296
|
}
|
|
13297
13297
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
13298
|
-
const newTableData =
|
|
13298
|
+
const newTableData = chunk6F4WVHS3_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
13299
13299
|
const updates = { tableData: newTableData };
|
|
13300
|
-
const newRawXml =
|
|
13300
|
+
const newRawXml = chunkFWF2SP6N_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13301
13301
|
if (newRawXml) {
|
|
13302
13302
|
updates.rawXml = newRawXml;
|
|
13303
13303
|
}
|
|
@@ -13310,12 +13310,12 @@ function createTableStructHandlers(input) {
|
|
|
13310
13310
|
}
|
|
13311
13311
|
const td = selectedElement.tableData;
|
|
13312
13312
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
13313
|
-
const newTableData =
|
|
13313
|
+
const newTableData = chunk6F4WVHS3_js.deleteTableRow(td, rowIdx);
|
|
13314
13314
|
if (newTableData === td) {
|
|
13315
13315
|
return;
|
|
13316
13316
|
}
|
|
13317
13317
|
const updates = { tableData: newTableData };
|
|
13318
|
-
const newRawXml =
|
|
13318
|
+
const newRawXml = chunkFWF2SP6N_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13319
13319
|
if (newRawXml) {
|
|
13320
13320
|
updates.rawXml = newRawXml;
|
|
13321
13321
|
}
|
|
@@ -13327,9 +13327,9 @@ function createTableStructHandlers(input) {
|
|
|
13327
13327
|
return;
|
|
13328
13328
|
}
|
|
13329
13329
|
const colIdx = ts?.columnIndex ?? 0;
|
|
13330
|
-
const newTableData =
|
|
13330
|
+
const newTableData = chunk6F4WVHS3_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
13331
13331
|
const updates = { tableData: newTableData };
|
|
13332
|
-
const newRawXml =
|
|
13332
|
+
const newRawXml = chunkFWF2SP6N_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13333
13333
|
if (newRawXml) {
|
|
13334
13334
|
updates.rawXml = newRawXml;
|
|
13335
13335
|
}
|
|
@@ -13342,12 +13342,12 @@ function createTableStructHandlers(input) {
|
|
|
13342
13342
|
}
|
|
13343
13343
|
const td = selectedElement.tableData;
|
|
13344
13344
|
const colIdx = ts?.columnIndex ?? 0;
|
|
13345
|
-
const newTableData =
|
|
13345
|
+
const newTableData = chunk6F4WVHS3_js.deleteTableColumn(td, colIdx);
|
|
13346
13346
|
if (newTableData === td) {
|
|
13347
13347
|
return;
|
|
13348
13348
|
}
|
|
13349
13349
|
const updates = { tableData: newTableData };
|
|
13350
|
-
const newRawXml =
|
|
13350
|
+
const newRawXml = chunkFWF2SP6N_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13351
13351
|
if (newRawXml) {
|
|
13352
13352
|
updates.rawXml = newRawXml;
|
|
13353
13353
|
}
|
|
@@ -13383,8 +13383,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
13383
13383
|
return html2canvasPro(element, {
|
|
13384
13384
|
...options,
|
|
13385
13385
|
onclone: async (doc, clonedEl) => {
|
|
13386
|
-
await
|
|
13387
|
-
|
|
13386
|
+
await chunk6F4WVHS3_js.normalizeColorsForCapture(doc, clonedEl);
|
|
13387
|
+
chunk6F4WVHS3_js.preprocessCssForCapture(clonedEl);
|
|
13388
13388
|
if (typeof userOnClone === "function") {
|
|
13389
13389
|
userOnClone(doc, clonedEl);
|
|
13390
13390
|
}
|
|
@@ -13440,7 +13440,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
13440
13440
|
}
|
|
13441
13441
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
13442
13442
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
13443
|
-
|
|
13443
|
+
chunk6F4WVHS3_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
13444
13444
|
}
|
|
13445
13445
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
13446
13446
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -13462,7 +13462,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13462
13462
|
continue;
|
|
13463
13463
|
}
|
|
13464
13464
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
13465
|
-
images.push(
|
|
13465
|
+
images.push(chunk6F4WVHS3_js.canvasToJpegData(canvas));
|
|
13466
13466
|
}
|
|
13467
13467
|
onProgress?.(totalSlides, totalSlides);
|
|
13468
13468
|
setActiveSlide(currentSlideIndex);
|
|
@@ -13470,7 +13470,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13470
13470
|
throw new Error(chunk2EFVXYNA_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
13471
13471
|
}
|
|
13472
13472
|
const pdfBlobUrl = buildPdfFromImageData(images);
|
|
13473
|
-
|
|
13473
|
+
chunk6F4WVHS3_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
13474
13474
|
}
|
|
13475
13475
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
13476
13476
|
const { scale = 2, onProgress } = options;
|
|
@@ -13519,7 +13519,7 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
13519
13519
|
throw new Error(chunk2EFVXYNA_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
13520
13520
|
}
|
|
13521
13521
|
const pdfDataUrl = buildNotesPdf(pages);
|
|
13522
|
-
|
|
13522
|
+
chunk6F4WVHS3_js.downloadDataUrl(pdfDataUrl, filename);
|
|
13523
13523
|
}
|
|
13524
13524
|
|
|
13525
13525
|
// src/viewer/utils/export-video.ts
|
|
@@ -13563,7 +13563,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
13563
13563
|
const fps = 30;
|
|
13564
13564
|
const stream = recordingCanvas.captureStream(fps);
|
|
13565
13565
|
const recorder = new MediaRecorder(stream, {
|
|
13566
|
-
mimeType:
|
|
13566
|
+
mimeType: chunk6F4WVHS3_js.pickSupportedMimeType([...chunk6F4WVHS3_js.WEBM_MIME_CANDIDATES]),
|
|
13567
13567
|
videoBitsPerSecond: 5e6
|
|
13568
13568
|
});
|
|
13569
13569
|
const chunks = [];
|
|
@@ -13586,8 +13586,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
13586
13586
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
13587
13587
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
13588
13588
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
13589
|
-
const frameInterval =
|
|
13590
|
-
const framesNeeded =
|
|
13589
|
+
const frameInterval = chunk6F4WVHS3_js.fpsToFrameIntervalMs(fps);
|
|
13590
|
+
const framesNeeded = chunk6F4WVHS3_js.segmentFrameCount(duration, fps);
|
|
13591
13591
|
for (let f = 0; f < framesNeeded; f++) {
|
|
13592
13592
|
if (signal?.aborted) {
|
|
13593
13593
|
recorder.stop();
|
|
@@ -13636,7 +13636,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13636
13636
|
if (frames.length === 0) {
|
|
13637
13637
|
throw new Error(chunk2EFVXYNA_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
13638
13638
|
}
|
|
13639
|
-
const gifBytes =
|
|
13639
|
+
const gifBytes = chunk6F4WVHS3_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
13640
13640
|
onProgress?.(totalSlides, totalSlides);
|
|
13641
13641
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
13642
13642
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -13690,7 +13690,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
13690
13690
|
continue;
|
|
13691
13691
|
}
|
|
13692
13692
|
onProgress?.(processedCount, data.slides.length);
|
|
13693
|
-
let svg =
|
|
13693
|
+
let svg = chunkFWF2SP6N_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
13694
13694
|
if (embedFonts && fontFaces?.length) {
|
|
13695
13695
|
svg = injectFontFaces(svg, fontFaces);
|
|
13696
13696
|
}
|
|
@@ -13750,7 +13750,7 @@ function useExportSaveAs(input) {
|
|
|
13750
13750
|
}
|
|
13751
13751
|
setExportProgress(70);
|
|
13752
13752
|
setExportStatusMessage("Writing README...");
|
|
13753
|
-
const readme =
|
|
13753
|
+
const readme = chunk6F4WVHS3_js.generatePackageReadme(pptxFilename);
|
|
13754
13754
|
pkgFolder.file("README.txt", readme);
|
|
13755
13755
|
if (abortCtrl.signal.aborted) {
|
|
13756
13756
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -13761,7 +13761,7 @@ function useExportSaveAs(input) {
|
|
|
13761
13761
|
setExportProgress(95);
|
|
13762
13762
|
setExportStatusMessage("Downloading...");
|
|
13763
13763
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
13764
|
-
|
|
13764
|
+
chunk6F4WVHS3_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
13765
13765
|
setExportProgress(100);
|
|
13766
13766
|
} catch (err) {
|
|
13767
13767
|
if (err.name !== "AbortError") {
|
|
@@ -13784,7 +13784,7 @@ function useExportSaveAs(input) {
|
|
|
13784
13784
|
const blob = new Blob([data], {
|
|
13785
13785
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
13786
13786
|
});
|
|
13787
|
-
|
|
13787
|
+
chunk6F4WVHS3_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
13788
13788
|
} catch (err) {
|
|
13789
13789
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
13790
13790
|
}
|
|
@@ -13797,7 +13797,7 @@ function useExportSaveAs(input) {
|
|
|
13797
13797
|
const pptxGuides = guides.map((g) => ({
|
|
13798
13798
|
id: g.id,
|
|
13799
13799
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
13800
|
-
positionEmu:
|
|
13800
|
+
positionEmu: chunkFWF2SP6N_js.guidePxToEmu(g.position)
|
|
13801
13801
|
}));
|
|
13802
13802
|
return {
|
|
13803
13803
|
...slide,
|
|
@@ -13861,7 +13861,7 @@ function safeConfirm(message) {
|
|
|
13861
13861
|
}
|
|
13862
13862
|
}
|
|
13863
13863
|
function downloadBlob2(blob, filename) {
|
|
13864
|
-
|
|
13864
|
+
chunk6F4WVHS3_js.downloadBlob(blob, chunk6F4WVHS3_js.sanitizeDownloadFilename(filename));
|
|
13865
13865
|
}
|
|
13866
13866
|
|
|
13867
13867
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -13962,21 +13962,21 @@ function useExportHandlers(input) {
|
|
|
13962
13962
|
{
|
|
13963
13963
|
scale: 2,
|
|
13964
13964
|
onProgress: (current, total) => {
|
|
13965
|
-
setExportProgress(
|
|
13966
|
-
setExportStatusMessage(
|
|
13965
|
+
setExportProgress(chunk6F4WVHS3_js.slideProgressPercent(current, total));
|
|
13966
|
+
setExportStatusMessage(chunk6F4WVHS3_js.slideStatusLabel("Rendering", current, total));
|
|
13967
13967
|
},
|
|
13968
13968
|
signal: abortCtrl.signal
|
|
13969
13969
|
}
|
|
13970
13970
|
);
|
|
13971
|
-
setExportProgress(
|
|
13971
|
+
setExportProgress(chunk6F4WVHS3_js.EXPORT_ASSEMBLING_PERCENT);
|
|
13972
13972
|
setExportStatusMessage("Building PDF...");
|
|
13973
13973
|
await new Promise((r) => {
|
|
13974
13974
|
setTimeout(r, 100);
|
|
13975
13975
|
});
|
|
13976
|
-
setExportProgress(
|
|
13976
|
+
setExportProgress(chunk6F4WVHS3_js.EXPORT_DONE_PERCENT);
|
|
13977
13977
|
setExportStatusMessage("Done!");
|
|
13978
13978
|
} catch (err) {
|
|
13979
|
-
if (!
|
|
13979
|
+
if (!chunk6F4WVHS3_js.isExportAbortError(err)) {
|
|
13980
13980
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
13981
13981
|
}
|
|
13982
13982
|
} finally {
|
|
@@ -14006,21 +14006,21 @@ function useExportHandlers(input) {
|
|
|
14006
14006
|
{
|
|
14007
14007
|
scale: 2,
|
|
14008
14008
|
onProgress: (current, total) => {
|
|
14009
|
-
setExportProgress(
|
|
14010
|
-
setExportStatusMessage(
|
|
14009
|
+
setExportProgress(chunk6F4WVHS3_js.slideProgressPercent(current, total));
|
|
14010
|
+
setExportStatusMessage(chunk6F4WVHS3_js.slideStatusLabel("Rendering", current, total));
|
|
14011
14011
|
},
|
|
14012
14012
|
signal: abortCtrl.signal
|
|
14013
14013
|
}
|
|
14014
14014
|
);
|
|
14015
|
-
setExportProgress(
|
|
14015
|
+
setExportProgress(chunk6F4WVHS3_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14016
14016
|
setExportStatusMessage("Building PDF...");
|
|
14017
14017
|
await new Promise((r) => {
|
|
14018
14018
|
setTimeout(r, 100);
|
|
14019
14019
|
});
|
|
14020
|
-
setExportProgress(
|
|
14020
|
+
setExportProgress(chunk6F4WVHS3_js.EXPORT_DONE_PERCENT);
|
|
14021
14021
|
setExportStatusMessage("Done!");
|
|
14022
14022
|
} catch (err) {
|
|
14023
|
-
if (!
|
|
14023
|
+
if (!chunk6F4WVHS3_js.isExportAbortError(err)) {
|
|
14024
14024
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
14025
14025
|
}
|
|
14026
14026
|
} finally {
|
|
@@ -14061,22 +14061,22 @@ function useExportHandlers(input) {
|
|
|
14061
14061
|
scale: 1,
|
|
14062
14062
|
slideDurationMs: 3e3,
|
|
14063
14063
|
onProgress: (current, total) => {
|
|
14064
|
-
setExportProgress(
|
|
14065
|
-
setExportStatusMessage(
|
|
14064
|
+
setExportProgress(chunk6F4WVHS3_js.slideProgressPercent(current, total, 45));
|
|
14065
|
+
setExportStatusMessage(chunk6F4WVHS3_js.slideStatusLabel("Capturing", current, total));
|
|
14066
14066
|
},
|
|
14067
14067
|
onRecordProgress: (current, total) => {
|
|
14068
|
-
setExportProgress(
|
|
14069
|
-
setExportStatusMessage(
|
|
14068
|
+
setExportProgress(chunk6F4WVHS3_js.recordProgressPercent(current, total));
|
|
14069
|
+
setExportStatusMessage(chunk6F4WVHS3_js.slideStatusLabel("Recording", current, total));
|
|
14070
14070
|
},
|
|
14071
14071
|
signal: abortCtrl.signal
|
|
14072
14072
|
}
|
|
14073
14073
|
);
|
|
14074
|
-
setExportProgress(
|
|
14074
|
+
setExportProgress(chunk6F4WVHS3_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14075
14075
|
setExportStatusMessage("Saving file...");
|
|
14076
14076
|
downloadBlob2(blob, "presentation.webm");
|
|
14077
|
-
setExportProgress(
|
|
14077
|
+
setExportProgress(chunk6F4WVHS3_js.EXPORT_DONE_PERCENT);
|
|
14078
14078
|
} catch (err) {
|
|
14079
|
-
if (!
|
|
14079
|
+
if (!chunk6F4WVHS3_js.isExportAbortError(err)) {
|
|
14080
14080
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
14081
14081
|
}
|
|
14082
14082
|
} finally {
|
|
@@ -14104,18 +14104,18 @@ function useExportHandlers(input) {
|
|
|
14104
14104
|
scale: 0.5,
|
|
14105
14105
|
slideDurationMs: 2e3,
|
|
14106
14106
|
onProgress: (current, total) => {
|
|
14107
|
-
setExportProgress(
|
|
14108
|
-
setExportStatusMessage(
|
|
14107
|
+
setExportProgress(chunk6F4WVHS3_js.slideProgressPercent(current, total));
|
|
14108
|
+
setExportStatusMessage(chunk6F4WVHS3_js.slideStatusLabel("Encoding", current, total));
|
|
14109
14109
|
},
|
|
14110
14110
|
signal: abortCtrl.signal
|
|
14111
14111
|
}
|
|
14112
14112
|
);
|
|
14113
|
-
setExportProgress(
|
|
14113
|
+
setExportProgress(chunk6F4WVHS3_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14114
14114
|
setExportStatusMessage("Saving file...");
|
|
14115
14115
|
downloadBlob2(blob, "presentation.gif");
|
|
14116
|
-
setExportProgress(
|
|
14116
|
+
setExportProgress(chunk6F4WVHS3_js.EXPORT_DONE_PERCENT);
|
|
14117
14117
|
} catch (err) {
|
|
14118
|
-
if (!
|
|
14118
|
+
if (!chunk6F4WVHS3_js.isExportAbortError(err)) {
|
|
14119
14119
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
14120
14120
|
}
|
|
14121
14121
|
} finally {
|
|
@@ -14155,7 +14155,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
14155
14155
|
}
|
|
14156
14156
|
printWindow.document.open();
|
|
14157
14157
|
printWindow.document.write(
|
|
14158
|
-
|
|
14158
|
+
chunk6F4WVHS3_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
14159
14159
|
);
|
|
14160
14160
|
printWindow.document.close();
|
|
14161
14161
|
printWindow.focus();
|
|
@@ -14216,7 +14216,7 @@ function usePrintHandlers(input) {
|
|
|
14216
14216
|
if (svgs.length === 0) {
|
|
14217
14217
|
return;
|
|
14218
14218
|
}
|
|
14219
|
-
const printDoc =
|
|
14219
|
+
const printDoc = chunk6F4WVHS3_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
14220
14220
|
title: "Slides (Vector)",
|
|
14221
14221
|
orientation: settings.orientation,
|
|
14222
14222
|
colorFilter
|
|
@@ -14252,7 +14252,7 @@ function usePrintHandlers(input) {
|
|
|
14252
14252
|
if (settings.printWhat === "outline") {
|
|
14253
14253
|
openPrintWindow(
|
|
14254
14254
|
"Outline",
|
|
14255
|
-
`<div class="outline-page">${
|
|
14255
|
+
`<div class="outline-page">${chunk6F4WVHS3_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
14256
14256
|
settings.orientation,
|
|
14257
14257
|
colorFilter,
|
|
14258
14258
|
settings.frameSlides
|
|
@@ -14277,7 +14277,7 @@ function usePrintHandlers(input) {
|
|
|
14277
14277
|
if (settings.printWhat === "slides") {
|
|
14278
14278
|
openPrintWindow(
|
|
14279
14279
|
"Slides",
|
|
14280
|
-
|
|
14280
|
+
chunk6F4WVHS3_js.buildSlidesHtml(slideImages, slideIndices),
|
|
14281
14281
|
settings.orientation,
|
|
14282
14282
|
colorFilter,
|
|
14283
14283
|
settings.frameSlides
|
|
@@ -14287,7 +14287,7 @@ function usePrintHandlers(input) {
|
|
|
14287
14287
|
if (settings.printWhat === "notes") {
|
|
14288
14288
|
openPrintWindow(
|
|
14289
14289
|
"Notes Pages",
|
|
14290
|
-
|
|
14290
|
+
chunk6F4WVHS3_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
14291
14291
|
"portrait",
|
|
14292
14292
|
colorFilter,
|
|
14293
14293
|
settings.frameSlides
|
|
@@ -14298,7 +14298,7 @@ function usePrintHandlers(input) {
|
|
|
14298
14298
|
const spp = settings.slidesPerPage;
|
|
14299
14299
|
openPrintWindow(
|
|
14300
14300
|
`Handout ${spp} per page`,
|
|
14301
|
-
|
|
14301
|
+
chunk6F4WVHS3_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
14302
14302
|
"portrait",
|
|
14303
14303
|
colorFilter,
|
|
14304
14304
|
settings.frameSlides
|
|
@@ -14462,7 +14462,7 @@ function useThemeSwitching(input) {
|
|
|
14462
14462
|
}
|
|
14463
14463
|
try {
|
|
14464
14464
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
14465
|
-
const newData =
|
|
14465
|
+
const newData = chunkFWF2SP6N_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
14466
14466
|
onDataChange(newData);
|
|
14467
14467
|
onThemeChanged?.(preset);
|
|
14468
14468
|
} catch (error) {
|
|
@@ -14479,7 +14479,7 @@ function useThemeSwitching(input) {
|
|
|
14479
14479
|
}
|
|
14480
14480
|
try {
|
|
14481
14481
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
14482
|
-
const newData =
|
|
14482
|
+
const newData = chunkFWF2SP6N_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
14483
14483
|
onDataChange(newData);
|
|
14484
14484
|
} catch (error) {
|
|
14485
14485
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -14491,12 +14491,12 @@ function useThemeSwitching(input) {
|
|
|
14491
14491
|
if (!data?.theme?.colorScheme) {
|
|
14492
14492
|
return void 0;
|
|
14493
14493
|
}
|
|
14494
|
-
return
|
|
14495
|
-
(p) =>
|
|
14494
|
+
return chunkFWF2SP6N_js.THEME_PRESETS.find(
|
|
14495
|
+
(p) => chunkFWF2SP6N_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
14496
14496
|
);
|
|
14497
14497
|
}, [data?.theme?.colorScheme]);
|
|
14498
14498
|
return {
|
|
14499
|
-
presets:
|
|
14499
|
+
presets: chunkFWF2SP6N_js.THEME_PRESETS,
|
|
14500
14500
|
switchToPreset,
|
|
14501
14501
|
switchToCustom,
|
|
14502
14502
|
currentPreset
|
|
@@ -14571,7 +14571,7 @@ function usePropertyHandlers(input) {
|
|
|
14571
14571
|
}
|
|
14572
14572
|
try {
|
|
14573
14573
|
const ab = await file.arrayBuffer();
|
|
14574
|
-
const h = new
|
|
14574
|
+
const h = new chunkFWF2SP6N_js.PptxHandler();
|
|
14575
14575
|
const other = await h.load(ab);
|
|
14576
14576
|
if (!other) {
|
|
14577
14577
|
return;
|
|
@@ -14581,7 +14581,7 @@ function usePropertyHandlers(input) {
|
|
|
14581
14581
|
width: canvasSize.width,
|
|
14582
14582
|
height: canvasSize.height
|
|
14583
14583
|
};
|
|
14584
|
-
setCompareResult(
|
|
14584
|
+
setCompareResult(chunk6F4WVHS3_js.comparePresentation(cur, other));
|
|
14585
14585
|
setIsComparePanelOpen(true);
|
|
14586
14586
|
} catch (err) {
|
|
14587
14587
|
console.warn("Compare failed:", err);
|
|
@@ -14598,7 +14598,7 @@ function usePropertyHandlers(input) {
|
|
|
14598
14598
|
if (!diff || diff.status === "unchanged") {
|
|
14599
14599
|
return;
|
|
14600
14600
|
}
|
|
14601
|
-
setSlides((prev) =>
|
|
14601
|
+
setSlides((prev) => chunk6F4WVHS3_js.applyAcceptSlide(prev, diff));
|
|
14602
14602
|
setIsDirty(true);
|
|
14603
14603
|
},
|
|
14604
14604
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -14609,10 +14609,10 @@ function usePropertyHandlers(input) {
|
|
|
14609
14609
|
if (!compareResult) {
|
|
14610
14610
|
return;
|
|
14611
14611
|
}
|
|
14612
|
-
setSlides((prev) =>
|
|
14612
|
+
setSlides((prev) => chunk6F4WVHS3_js.applyAcceptAllSlides(prev, compareResult));
|
|
14613
14613
|
setIsDirty(true);
|
|
14614
14614
|
}, [compareResult, setSlides, setIsDirty]);
|
|
14615
|
-
const usedFontFamilies = React3.useMemo(() =>
|
|
14615
|
+
const usedFontFamilies = React3.useMemo(() => chunk6F4WVHS3_js.collectUsedFonts(slides), [slides]);
|
|
14616
14616
|
return {
|
|
14617
14617
|
handleUpdateNotes,
|
|
14618
14618
|
handleUpdateSlide,
|
|
@@ -14731,7 +14731,7 @@ function useIsMobile(input) {
|
|
|
14731
14731
|
const containerRef = input?.containerRef;
|
|
14732
14732
|
const isTouchDevice = React3.useSyncExternalStore(
|
|
14733
14733
|
subscribeTouchCapability,
|
|
14734
|
-
|
|
14734
|
+
chunk6F4WVHS3_js.detectTouchDevice,
|
|
14735
14735
|
() => false
|
|
14736
14736
|
// server snapshot
|
|
14737
14737
|
);
|
|
@@ -14747,7 +14747,7 @@ function useIsMobile(input) {
|
|
|
14747
14747
|
}
|
|
14748
14748
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
14749
14749
|
});
|
|
14750
|
-
const [orientation, setOrientation] = React3.useState(
|
|
14750
|
+
const [orientation, setOrientation] = React3.useState(chunk6F4WVHS3_js.detectOrientation);
|
|
14751
14751
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = React3.useState(false);
|
|
14752
14752
|
const [initialViewportHeight] = React3.useState(
|
|
14753
14753
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -14791,7 +14791,7 @@ function useIsMobile(input) {
|
|
|
14791
14791
|
return;
|
|
14792
14792
|
}
|
|
14793
14793
|
const handleOrientationChange = () => {
|
|
14794
|
-
setOrientation(
|
|
14794
|
+
setOrientation(chunk6F4WVHS3_js.detectOrientation());
|
|
14795
14795
|
};
|
|
14796
14796
|
if (screen.orientation) {
|
|
14797
14797
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -14821,9 +14821,9 @@ function useIsMobile(input) {
|
|
|
14821
14821
|
window.addEventListener("resize", handleResize);
|
|
14822
14822
|
return () => window.removeEventListener("resize", handleResize);
|
|
14823
14823
|
}, [isTouchDevice, initialViewportHeight]);
|
|
14824
|
-
const isMobile =
|
|
14825
|
-
const isTablet = !isMobile && containerWidth >=
|
|
14826
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
14824
|
+
const isMobile = chunk6F4WVHS3_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
14825
|
+
const isTablet = !isMobile && containerWidth >= chunk6F4WVHS3_js.MOBILE_BREAKPOINT && containerWidth < chunk6F4WVHS3_js.TABLET_BREAKPOINT;
|
|
14826
|
+
const isDesktop = !isMobile && containerWidth >= chunk6F4WVHS3_js.TABLET_BREAKPOINT;
|
|
14827
14827
|
return {
|
|
14828
14828
|
isMobile,
|
|
14829
14829
|
isTablet,
|
|
@@ -14884,11 +14884,11 @@ function useViewerDialogs(input) {
|
|
|
14884
14884
|
);
|
|
14885
14885
|
const [embedFontsEnabled, setEmbedFontsEnabled] = React3.useState(false);
|
|
14886
14886
|
const [isNarrowViewport, setIsNarrowViewport] = React3.useState(
|
|
14887
|
-
() => typeof window !== "undefined" ?
|
|
14887
|
+
() => typeof window !== "undefined" ? chunk6F4WVHS3_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
14888
14888
|
);
|
|
14889
14889
|
React3.useEffect(() => {
|
|
14890
14890
|
const handleWindow = () => setIsNarrowViewport(
|
|
14891
|
-
|
|
14891
|
+
chunk6F4WVHS3_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
14892
14892
|
);
|
|
14893
14893
|
let observer = null;
|
|
14894
14894
|
let raf = 0;
|
|
@@ -14902,12 +14902,12 @@ function useViewerDialogs(input) {
|
|
|
14902
14902
|
const entry = entries[0];
|
|
14903
14903
|
if (entry) {
|
|
14904
14904
|
setIsNarrowViewport(
|
|
14905
|
-
|
|
14905
|
+
chunk6F4WVHS3_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
14906
14906
|
);
|
|
14907
14907
|
}
|
|
14908
14908
|
});
|
|
14909
14909
|
observer.observe(el);
|
|
14910
|
-
setIsNarrowViewport(
|
|
14910
|
+
setIsNarrowViewport(chunk6F4WVHS3_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
14911
14911
|
};
|
|
14912
14912
|
attach();
|
|
14913
14913
|
window.addEventListener("resize", handleWindow);
|
|
@@ -15084,7 +15084,7 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
|
15084
15084
|
return slides.map((_, i) => i).filter((i) => !slides[i]?.hidden);
|
|
15085
15085
|
}
|
|
15086
15086
|
function computeSlideSectionGroups(slides, sections) {
|
|
15087
|
-
return
|
|
15087
|
+
return chunk6F4WVHS3_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
15088
15088
|
id: group.section?.id ?? (sections.length > 0 ? UNGROUPED_SECTION_ID : "default"),
|
|
15089
15089
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
15090
15090
|
slideIndexes: group.slideIndexes,
|
|
@@ -15321,13 +15321,13 @@ function useSerialize(input) {
|
|
|
15321
15321
|
let processedSlide = slide;
|
|
15322
15322
|
if (pendingEditId) {
|
|
15323
15323
|
const updatedElements = slide.elements.map((el) => {
|
|
15324
|
-
if (el.id !== pendingEditId || !
|
|
15324
|
+
if (el.id !== pendingEditId || !chunkFWF2SP6N_js.hasTextProperties(el)) {
|
|
15325
15325
|
return el;
|
|
15326
15326
|
}
|
|
15327
15327
|
return {
|
|
15328
15328
|
...el,
|
|
15329
15329
|
text: pendingEditText,
|
|
15330
|
-
textSegments:
|
|
15330
|
+
textSegments: chunk6F4WVHS3_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
15331
15331
|
};
|
|
15332
15332
|
});
|
|
15333
15333
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -15340,7 +15340,7 @@ function useSerialize(input) {
|
|
|
15340
15340
|
const pptxGuides = guides.map((g) => ({
|
|
15341
15341
|
id: g.id,
|
|
15342
15342
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
15343
|
-
positionEmu:
|
|
15343
|
+
positionEmu: chunkFWF2SP6N_js.guidePxToEmu(g.position)
|
|
15344
15344
|
}));
|
|
15345
15345
|
return {
|
|
15346
15346
|
...processedSlide,
|
|
@@ -15564,10 +15564,10 @@ function usePresentationSetup(input) {
|
|
|
15564
15564
|
onToggleEraser: () => annotations.setPresentationTool("eraser"),
|
|
15565
15565
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
15566
15566
|
onSaveRehearsalTimings: (timings) => {
|
|
15567
|
-
setSlides((prev) =>
|
|
15567
|
+
setSlides((prev) => chunk6F4WVHS3_js.applyRehearsalTimings(prev, timings));
|
|
15568
15568
|
history.markDirty();
|
|
15569
15569
|
},
|
|
15570
|
-
loopContinuously:
|
|
15570
|
+
loopContinuously: chunk6F4WVHS3_js.shouldLoopContinuously(presentationProperties),
|
|
15571
15571
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
15572
15572
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
15573
15573
|
endWithBlackSlide
|
|
@@ -15729,7 +15729,7 @@ function useEditorOperations(input) {
|
|
|
15729
15729
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
15730
15730
|
React3.useEffect(() => {
|
|
15731
15731
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
15732
|
-
copiedFormatRef.current =
|
|
15732
|
+
copiedFormatRef.current = chunk6F4WVHS3_js.copyFormatFromElement(selectedElement);
|
|
15733
15733
|
} else if (!formatPainterActive) {
|
|
15734
15734
|
copiedFormatRef.current = null;
|
|
15735
15735
|
}
|
|
@@ -15755,12 +15755,12 @@ function useEditorOperations(input) {
|
|
|
15755
15755
|
e.stopPropagation();
|
|
15756
15756
|
const element = elementLookup.get(elementId);
|
|
15757
15757
|
if (element) {
|
|
15758
|
-
const updated =
|
|
15758
|
+
const updated = chunk6F4WVHS3_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
15759
15759
|
const updates = {};
|
|
15760
|
-
if (
|
|
15760
|
+
if (chunkFWF2SP6N_js.hasShapeProperties(updated)) {
|
|
15761
15761
|
updates.shapeStyle = updated.shapeStyle;
|
|
15762
15762
|
}
|
|
15763
|
-
if (
|
|
15763
|
+
if (chunkFWF2SP6N_js.hasTextProperties(updated)) {
|
|
15764
15764
|
updates.textStyle = updated.textStyle;
|
|
15765
15765
|
}
|
|
15766
15766
|
ops.updateElementById(elementId, updates);
|
|
@@ -15904,7 +15904,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
15904
15904
|
const families = /* @__PURE__ */ new Set();
|
|
15905
15905
|
for (const slide of slides) {
|
|
15906
15906
|
for (const el of slide.elements) {
|
|
15907
|
-
if (
|
|
15907
|
+
if (chunkFWF2SP6N_js.hasTextProperties(el) && el.textSegments) {
|
|
15908
15908
|
for (const seg of el.textSegments) {
|
|
15909
15909
|
if (seg.style.fontFamily) {
|
|
15910
15910
|
families.add(seg.style.fontFamily);
|
|
@@ -16686,7 +16686,7 @@ function useReducedMotion() {
|
|
|
16686
16686
|
}
|
|
16687
16687
|
function useViewerOptions() {
|
|
16688
16688
|
const storeRef = React3.useRef(null);
|
|
16689
|
-
storeRef.current ??=
|
|
16689
|
+
storeRef.current ??= chunk6F4WVHS3_js.createViewerOptionsStore();
|
|
16690
16690
|
const store = storeRef.current;
|
|
16691
16691
|
const options = React3.useSyncExternalStore(
|
|
16692
16692
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -16695,9 +16695,9 @@ function useViewerOptions() {
|
|
|
16695
16695
|
);
|
|
16696
16696
|
return { optionsStore: store, options };
|
|
16697
16697
|
}
|
|
16698
|
-
var KNOWN_TAB_IDS = new Set(
|
|
16698
|
+
var KNOWN_TAB_IDS = new Set(chunk6F4WVHS3_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
16699
16699
|
function computeToolbarVisibility(hiddenActions) {
|
|
16700
|
-
const isHidden = (id) =>
|
|
16700
|
+
const isHidden = (id) => chunk6F4WVHS3_js.isActionHidden(id, hiddenActions);
|
|
16701
16701
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
16702
16702
|
return { isHidden, isTabVisible };
|
|
16703
16703
|
}
|
|
@@ -16714,7 +16714,7 @@ function useYjsProvider({ config }) {
|
|
|
16714
16714
|
const timeoutRef = React3.useRef(null);
|
|
16715
16715
|
const gateRef = React3.useRef(null);
|
|
16716
16716
|
if (!gateRef.current) {
|
|
16717
|
-
gateRef.current =
|
|
16717
|
+
gateRef.current = chunk6F4WVHS3_js.createSyncGate(() => setSynced(true));
|
|
16718
16718
|
}
|
|
16719
16719
|
const teardown = React3.useCallback(() => {
|
|
16720
16720
|
if (timeoutRef.current) {
|
|
@@ -16752,7 +16752,7 @@ function useYjsProvider({ config }) {
|
|
|
16752
16752
|
if (config.authToken) {
|
|
16753
16753
|
opts.password = config.authToken;
|
|
16754
16754
|
}
|
|
16755
|
-
const provider = new WebrtcProvider(
|
|
16755
|
+
const provider = new WebrtcProvider(chunk6F4WVHS3_js.validateRoomId(config.roomId), yDoc, opts);
|
|
16756
16756
|
setDoc(yDoc);
|
|
16757
16757
|
setAwareness(provider.awareness);
|
|
16758
16758
|
setClientId(provider.awareness.clientID);
|
|
@@ -16794,13 +16794,13 @@ function useYjsProvider({ config }) {
|
|
|
16794
16794
|
if (!config) {
|
|
16795
16795
|
return;
|
|
16796
16796
|
}
|
|
16797
|
-
const roomId =
|
|
16798
|
-
const transport = config.transport ??
|
|
16797
|
+
const roomId = chunk6F4WVHS3_js.validateRoomId(config.roomId);
|
|
16798
|
+
const transport = config.transport ?? chunk6F4WVHS3_js.resolveTransportForServerUrl(config.serverUrl);
|
|
16799
16799
|
if (transport === "webrtc") {
|
|
16800
16800
|
await initWebrtc();
|
|
16801
16801
|
return;
|
|
16802
16802
|
}
|
|
16803
|
-
if (
|
|
16803
|
+
if (chunk6F4WVHS3_js.isMixedContentBlocked(config.serverUrl)) {
|
|
16804
16804
|
console.warn(
|
|
16805
16805
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
16806
16806
|
);
|
|
@@ -16860,7 +16860,7 @@ function useYjsProvider({ config }) {
|
|
|
16860
16860
|
cleanupRef.current = null;
|
|
16861
16861
|
setStatus("error");
|
|
16862
16862
|
}
|
|
16863
|
-
},
|
|
16863
|
+
}, chunk6F4WVHS3_js.CONNECTION_TIMEOUT_MS);
|
|
16864
16864
|
}
|
|
16865
16865
|
setDoc(yDoc);
|
|
16866
16866
|
setAwareness(provider.awareness);
|
|
@@ -16933,7 +16933,7 @@ function usePresenceTracking({
|
|
|
16933
16933
|
awareness.setLocalStateField("presence", state);
|
|
16934
16934
|
lastBroadcastRef.current = Date.now();
|
|
16935
16935
|
};
|
|
16936
|
-
if (elapsed >=
|
|
16936
|
+
if (elapsed >= chunk6F4WVHS3_js.BROADCAST_THROTTLE_MS) {
|
|
16937
16937
|
if (pendingBroadcastRef.current) {
|
|
16938
16938
|
clearTimeout(pendingBroadcastRef.current);
|
|
16939
16939
|
pendingBroadcastRef.current = null;
|
|
@@ -16943,7 +16943,7 @@ function usePresenceTracking({
|
|
|
16943
16943
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
16944
16944
|
pendingBroadcastRef.current = null;
|
|
16945
16945
|
flush();
|
|
16946
|
-
},
|
|
16946
|
+
}, chunk6F4WVHS3_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
16947
16947
|
}
|
|
16948
16948
|
},
|
|
16949
16949
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -16968,7 +16968,7 @@ function usePresenceTracking({
|
|
|
16968
16968
|
return;
|
|
16969
16969
|
}
|
|
16970
16970
|
const handleChange = () => {
|
|
16971
|
-
const users =
|
|
16971
|
+
const users = chunk6F4WVHS3_js.derivePresenceList(
|
|
16972
16972
|
awareness.getStates(),
|
|
16973
16973
|
localClientId,
|
|
16974
16974
|
canvasWidth,
|
|
@@ -17016,7 +17016,7 @@ function useCollaborativeState({
|
|
|
17016
17016
|
canvasWidth,
|
|
17017
17017
|
canvasHeight
|
|
17018
17018
|
}) {
|
|
17019
|
-
const userColor =
|
|
17019
|
+
const userColor = chunk6F4WVHS3_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
17020
17020
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
17021
17021
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
17022
17022
|
awareness,
|
|
@@ -17121,10 +17121,10 @@ function useYjsDocumentSync({
|
|
|
17121
17121
|
return;
|
|
17122
17122
|
}
|
|
17123
17123
|
try {
|
|
17124
|
-
const { PptxHandler: PptxHandler2 } = await import('./dist-
|
|
17124
|
+
const { PptxHandler: PptxHandler2 } = await import('./dist-QU6JIDAF.js');
|
|
17125
17125
|
const handler = new PptxHandler2();
|
|
17126
17126
|
await handler.load(sourceBytes.buffer);
|
|
17127
|
-
const currentSlides =
|
|
17127
|
+
const currentSlides = chunk6F4WVHS3_js.readSlidesFromYDoc(
|
|
17128
17128
|
doc
|
|
17129
17129
|
);
|
|
17130
17130
|
const slidesToSave = buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
@@ -17142,7 +17142,7 @@ function useYjsDocumentSync({
|
|
|
17142
17142
|
if (!doc || !isConnected) {
|
|
17143
17143
|
return;
|
|
17144
17144
|
}
|
|
17145
|
-
const docSlides =
|
|
17145
|
+
const docSlides = chunk6F4WVHS3_js.readSlidesFromYDoc(
|
|
17146
17146
|
doc
|
|
17147
17147
|
);
|
|
17148
17148
|
if (docSlides.length === 0) {
|
|
@@ -17166,11 +17166,11 @@ function useYjsDocumentSync({
|
|
|
17166
17166
|
lastSyncedRef.current = serialized;
|
|
17167
17167
|
void (async () => {
|
|
17168
17168
|
const factories = await getFactories();
|
|
17169
|
-
|
|
17169
|
+
chunk6F4WVHS3_js.reconcileSlidesInYDoc(
|
|
17170
17170
|
slides,
|
|
17171
17171
|
doc,
|
|
17172
17172
|
factories,
|
|
17173
|
-
|
|
17173
|
+
chunk6F4WVHS3_js.LOCAL_SYNC_ORIGIN
|
|
17174
17174
|
);
|
|
17175
17175
|
scheduleWriteBack();
|
|
17176
17176
|
})();
|
|
@@ -17180,10 +17180,10 @@ function useYjsDocumentSync({
|
|
|
17180
17180
|
return;
|
|
17181
17181
|
}
|
|
17182
17182
|
const handleChange = (_events, transaction) => {
|
|
17183
|
-
if (transaction?.origin ===
|
|
17183
|
+
if (transaction?.origin === chunk6F4WVHS3_js.LOCAL_SYNC_ORIGIN) {
|
|
17184
17184
|
return;
|
|
17185
17185
|
}
|
|
17186
|
-
const remoteSlides =
|
|
17186
|
+
const remoteSlides = chunk6F4WVHS3_js.readSlidesFromYDoc(
|
|
17187
17187
|
doc
|
|
17188
17188
|
);
|
|
17189
17189
|
if (remoteSlides.length === 0) {
|
|
@@ -17201,7 +17201,7 @@ function useYjsDocumentSync({
|
|
|
17201
17201
|
});
|
|
17202
17202
|
scheduleWriteBack();
|
|
17203
17203
|
};
|
|
17204
|
-
const unobserve =
|
|
17204
|
+
const unobserve = chunk6F4WVHS3_js.observeYDocSlides(
|
|
17205
17205
|
doc,
|
|
17206
17206
|
handleChange
|
|
17207
17207
|
);
|
|
@@ -17352,7 +17352,7 @@ function useLayoutSwitching(input) {
|
|
|
17352
17352
|
function useVirtualizedSlides({
|
|
17353
17353
|
totalItems,
|
|
17354
17354
|
itemHeight,
|
|
17355
|
-
overscan =
|
|
17355
|
+
overscan = chunk6F4WVHS3_js.DEFAULT_VIRTUAL_OVERSCAN
|
|
17356
17356
|
}) {
|
|
17357
17357
|
const scrollContainerRef = React3.useRef(null);
|
|
17358
17358
|
const [scrollTop, setScrollTop] = React3.useState(0);
|
|
@@ -17382,7 +17382,7 @@ function useVirtualizedSlides({
|
|
|
17382
17382
|
resizeObserver?.disconnect();
|
|
17383
17383
|
};
|
|
17384
17384
|
}, []);
|
|
17385
|
-
const range =
|
|
17385
|
+
const range = chunk6F4WVHS3_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
|
|
17386
17386
|
const safeItemHeight = Math.max(itemHeight, 1);
|
|
17387
17387
|
const scrollToIndex = React3.useCallback(
|
|
17388
17388
|
(index, behavior = "smooth") => {
|
|
@@ -17428,7 +17428,7 @@ function useTouchGestures(input) {
|
|
|
17428
17428
|
if (!el || !enabled) {
|
|
17429
17429
|
return;
|
|
17430
17430
|
}
|
|
17431
|
-
const recognizer =
|
|
17431
|
+
const recognizer = chunk6F4WVHS3_js.createTouchGestureRecognizer({
|
|
17432
17432
|
getScale: () => scaleRef.current,
|
|
17433
17433
|
minScale: MIN_ZOOM_SCALE,
|
|
17434
17434
|
maxScale: MAX_ZOOM_SCALE,
|
|
@@ -17471,7 +17471,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
17471
17471
|
return;
|
|
17472
17472
|
}
|
|
17473
17473
|
const rect = active.getBoundingClientRect();
|
|
17474
|
-
const delta =
|
|
17474
|
+
const delta = chunk6F4WVHS3_js.computeScrollDelta(
|
|
17475
17475
|
{ top: rect.top, bottom: rect.bottom },
|
|
17476
17476
|
window.innerHeight,
|
|
17477
17477
|
keyboardInset
|
|
@@ -17491,8 +17491,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
17491
17491
|
return;
|
|
17492
17492
|
}
|
|
17493
17493
|
const update = () => {
|
|
17494
|
-
const metrics =
|
|
17495
|
-
const inset = metrics ?
|
|
17494
|
+
const metrics = chunk6F4WVHS3_js.readViewportMetrics(window);
|
|
17495
|
+
const inset = metrics ? chunk6F4WVHS3_js.computeKeyboardInset(metrics) : 0;
|
|
17496
17496
|
setKeyboardInset(inset);
|
|
17497
17497
|
if (inset > 0) {
|
|
17498
17498
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -17503,8 +17503,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
17503
17503
|
vv.addEventListener("scroll", update);
|
|
17504
17504
|
const onFocusIn = () => {
|
|
17505
17505
|
window.requestAnimationFrame(() => {
|
|
17506
|
-
const metrics =
|
|
17507
|
-
const inset = metrics ?
|
|
17506
|
+
const metrics = chunk6F4WVHS3_js.readViewportMetrics(window);
|
|
17507
|
+
const inset = metrics ? chunk6F4WVHS3_js.computeKeyboardInset(metrics) : 0;
|
|
17508
17508
|
if (inset > 0) {
|
|
17509
17509
|
scrollFocusedIntoView(inset);
|
|
17510
17510
|
}
|
|
@@ -17517,7 +17517,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
17517
17517
|
document.removeEventListener("focusin", onFocusIn);
|
|
17518
17518
|
};
|
|
17519
17519
|
}, [enabled]);
|
|
17520
|
-
return { keyboardInset, isKeyboardOpen:
|
|
17520
|
+
return { keyboardInset, isKeyboardOpen: chunk6F4WVHS3_js.isKeyboardOpen(keyboardInset) };
|
|
17521
17521
|
}
|
|
17522
17522
|
|
|
17523
17523
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -17572,13 +17572,13 @@ function buildCanvasProps(input) {
|
|
|
17572
17572
|
if (mode === "present") {
|
|
17573
17573
|
presentation.handlePresentationAction(action);
|
|
17574
17574
|
} else if (action.url) {
|
|
17575
|
-
|
|
17575
|
+
chunk6F4WVHS3_js.safeOpenUrl(action.url);
|
|
17576
17576
|
}
|
|
17577
17577
|
};
|
|
17578
17578
|
const handleHyperlinkClick = (url) => {
|
|
17579
|
-
if (
|
|
17579
|
+
if (chunk6F4WVHS3_js.isPpactionUrl(url)) {
|
|
17580
17580
|
if (mode === "present") {
|
|
17581
|
-
const parsed =
|
|
17581
|
+
const parsed = chunk6F4WVHS3_js.parsePpactionUrl(url);
|
|
17582
17582
|
if (parsed) {
|
|
17583
17583
|
presentation.handlePresentationAction({
|
|
17584
17584
|
action: parsed.action,
|
|
@@ -17588,7 +17588,7 @@ function buildCanvasProps(input) {
|
|
|
17588
17588
|
}
|
|
17589
17589
|
return;
|
|
17590
17590
|
}
|
|
17591
|
-
|
|
17591
|
+
chunk6F4WVHS3_js.safeOpenUrl(url);
|
|
17592
17592
|
};
|
|
17593
17593
|
return {
|
|
17594
17594
|
activeSlide: effectiveSlide,
|
|
@@ -17908,7 +17908,7 @@ function buildToolbarProps(input) {
|
|
|
17908
17908
|
onOpenFile,
|
|
17909
17909
|
onOpenRecentFile,
|
|
17910
17910
|
onCreatePresentation: (templateId) => {
|
|
17911
|
-
s.setSlides(
|
|
17911
|
+
s.setSlides(chunk6F4WVHS3_js.createBackstagePresentation(templateId));
|
|
17912
17912
|
s.setActiveSlideIndex(0);
|
|
17913
17913
|
s.setSelectedElementId(null);
|
|
17914
17914
|
s.setSelectedElementIds([]);
|
|
@@ -17963,7 +17963,7 @@ function buildToolbarProps(input) {
|
|
|
17963
17963
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
17964
17964
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
17965
17965
|
formatPainterActive: s.formatPainterActive,
|
|
17966
|
-
canActivateFormatPainter:
|
|
17966
|
+
canActivateFormatPainter: chunk6F4WVHS3_js.hasCopyableFormat(selectedElement),
|
|
17967
17967
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
17968
17968
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
17969
17969
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -18226,7 +18226,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
18226
18226
|
}, [incomingContent]);
|
|
18227
18227
|
const onOpenFile = React3.useCallback(() => {
|
|
18228
18228
|
void (async () => {
|
|
18229
|
-
const picked = await
|
|
18229
|
+
const picked = await chunk6F4WVHS3_js.openPptxFile();
|
|
18230
18230
|
if (picked) {
|
|
18231
18231
|
setContent(picked.buffer);
|
|
18232
18232
|
}
|
|
@@ -18234,7 +18234,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
18234
18234
|
}, []);
|
|
18235
18235
|
const onOpenRecentFile = React3.useCallback((key) => {
|
|
18236
18236
|
void (async () => {
|
|
18237
|
-
const bytes = await
|
|
18237
|
+
const bytes = await chunk6F4WVHS3_js.readBackstageRecentFile(key);
|
|
18238
18238
|
if (bytes) {
|
|
18239
18239
|
setContent(bytes);
|
|
18240
18240
|
}
|