pptx-react-viewer 1.25.1 → 1.25.2
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-AWSM6CYB.js → Model3DScene-PPHEUVGE.js} +3 -3
- package/dist/Model3DScene-PPHEUVGE.js.br +0 -0
- package/dist/Model3DScene-PPHEUVGE.js.gz +0 -0
- package/dist/{Model3DScene-2QZ7CADN.mjs → Model3DScene-VEL3LWME.mjs} +2 -2
- package/dist/Model3DScene-VEL3LWME.mjs.br +0 -0
- package/dist/Model3DScene-VEL3LWME.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-PJ36HRGC.js → SurfaceChart3DScene-TGSDRCUC.js} +3 -3
- package/dist/SurfaceChart3DScene-TGSDRCUC.js.br +0 -0
- package/dist/SurfaceChart3DScene-TGSDRCUC.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-IW4WGZHH.mjs → SurfaceChart3DScene-ZBBY6LVV.mjs} +2 -2
- package/dist/SurfaceChart3DScene-ZBBY6LVV.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-ZBBY6LVV.mjs.gz +0 -0
- package/dist/{chunk-NIWO2WYI.js → chunk-ML36DOIS.js} +34 -34
- package/dist/chunk-ML36DOIS.js.br +0 -0
- package/dist/chunk-ML36DOIS.js.gz +0 -0
- package/dist/{chunk-M7JHZV3P.mjs → chunk-Q2WHYUNV.mjs} +86 -20
- package/dist/chunk-Q2WHYUNV.mjs.br +0 -0
- package/dist/chunk-Q2WHYUNV.mjs.gz +0 -0
- package/dist/{chunk-CYZLRYJV.js → chunk-RPWTP6QP.js} +86 -20
- package/dist/chunk-RPWTP6QP.js.br +0 -0
- package/dist/chunk-RPWTP6QP.js.gz +0 -0
- package/dist/{chunk-PMGLZ7N4.mjs → chunk-UR4R3CH4.mjs} +1 -1
- package/dist/chunk-UR4R3CH4.mjs.br +0 -0
- package/dist/chunk-UR4R3CH4.mjs.gz +0 -0
- package/dist/{chunk-ASN2DZSP.js → chunk-VHKA4C7G.js} +810 -808
- package/dist/chunk-VHKA4C7G.js.br +0 -0
- package/dist/chunk-VHKA4C7G.js.gz +0 -0
- package/dist/{chunk-NT5FIWWU.js → chunk-WAG32RWG.js} +464 -464
- package/dist/chunk-WAG32RWG.js.br +0 -0
- package/dist/chunk-WAG32RWG.js.gz +0 -0
- package/dist/{chunk-QTIJWFJX.mjs → chunk-WTTSE7SZ.mjs} +4 -4
- package/dist/chunk-WTTSE7SZ.mjs.br +0 -0
- package/dist/chunk-WTTSE7SZ.mjs.gz +0 -0
- package/dist/{chunk-RVKPHAK5.mjs → chunk-XUYKQ4DI.mjs} +8 -6
- package/dist/chunk-XUYKQ4DI.mjs.br +0 -0
- package/dist/chunk-XUYKQ4DI.mjs.gz +0 -0
- package/dist/{dist-RHAXXX2R.mjs → dist-JFRKRKOK.mjs} +1 -1
- package/dist/dist-JFRKRKOK.mjs.br +0 -0
- package/dist/dist-JFRKRKOK.mjs.gz +0 -0
- package/dist/{dist-AFRACFHO.js → dist-NR7AZFQW.js} +562 -562
- package/dist/dist-NR7AZFQW.js.br +0 -0
- package/dist/dist-NR7AZFQW.js.gz +0 -0
- 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.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.js +20 -20
- package/dist/viewer/index.js.br +3 -2
- 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-2QZ7CADN.mjs.br +0 -0
- package/dist/Model3DScene-2QZ7CADN.mjs.gz +0 -0
- package/dist/Model3DScene-AWSM6CYB.js.br +0 -0
- package/dist/Model3DScene-AWSM6CYB.js.gz +0 -0
- package/dist/SurfaceChart3DScene-IW4WGZHH.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-IW4WGZHH.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-PJ36HRGC.js.br +0 -0
- package/dist/SurfaceChart3DScene-PJ36HRGC.js.gz +0 -0
- package/dist/chunk-ASN2DZSP.js.br +0 -0
- package/dist/chunk-ASN2DZSP.js.gz +0 -0
- package/dist/chunk-CYZLRYJV.js.br +0 -0
- package/dist/chunk-CYZLRYJV.js.gz +0 -0
- package/dist/chunk-M7JHZV3P.mjs.br +0 -0
- package/dist/chunk-M7JHZV3P.mjs.gz +0 -0
- package/dist/chunk-NIWO2WYI.js.br +0 -0
- package/dist/chunk-NIWO2WYI.js.gz +0 -0
- package/dist/chunk-NT5FIWWU.js.br +0 -0
- package/dist/chunk-NT5FIWWU.js.gz +0 -0
- package/dist/chunk-PMGLZ7N4.mjs.br +0 -0
- package/dist/chunk-PMGLZ7N4.mjs.gz +0 -0
- package/dist/chunk-QTIJWFJX.mjs.br +0 -0
- package/dist/chunk-QTIJWFJX.mjs.gz +0 -0
- package/dist/chunk-RVKPHAK5.mjs.br +0 -0
- package/dist/chunk-RVKPHAK5.mjs.gz +0 -0
- package/dist/dist-AFRACFHO.js.br +0 -0
- package/dist/dist-AFRACFHO.js.gz +0 -0
- package/dist/dist-RHAXXX2R.mjs.br +0 -0
- package/dist/dist-RHAXXX2R.mjs.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkML36DOIS_js = require('./chunk-ML36DOIS.js');
|
|
4
4
|
var chunk2EFVXYNA_js = require('./chunk-2EFVXYNA.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkRPWTP6QP_js = require('./chunk-RPWTP6QP.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 chunkML36DOIS_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(chunkML36DOIS_js.cloneSlide),
|
|
71
|
+
templateElementsBySlideId: chunkML36DOIS_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(chunkML36DOIS_js.cloneSlide));
|
|
85
85
|
setTemplateElementsBySlideId(
|
|
86
|
-
|
|
86
|
+
chunkML36DOIS_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 = chunkML36DOIS_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 && chunkRPWTP6QP_js.hasTextProperties(el) && el.textSegments && el.textSegments.length > 0) {
|
|
667
|
+
segmentCounts.set(anim.targetId, chunkML36DOIS_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 ? chunkML36DOIS_js.expandTextBuildAnimations(nativeAnims, segmentCounts) : nativeAnims;
|
|
672
|
+
const engine = chunkML36DOIS_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(chunkML36DOIS_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 = chunkML36DOIS_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 chunkML36DOIS_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 chunkML36DOIS_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 chunkML36DOIS_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 = chunkML36DOIS_js.PRESENTATION_CHANNEL_NAME;
|
|
951
|
+
var AUDIENCE_HASH = chunkML36DOIS_js.PRESENTATION_HASH;
|
|
952
|
+
var PRESENTER_MSG_ORIGIN = chunkML36DOIS_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
953
|
+
var AUDIENCE_NONCE_KEY = chunkML36DOIS_js.PRESENTATION_NONCE_KEY;
|
|
954
954
|
function generateSessionId() {
|
|
955
|
-
return
|
|
955
|
+
return chunkML36DOIS_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 ? chunkML36DOIS_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 = chunkML36DOIS_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1074
|
+
void chunkML36DOIS_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1075
1075
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1076
|
-
|
|
1076
|
+
chunkML36DOIS_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 (chunkML36DOIS_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 (!chunkML36DOIS_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: chunkML36DOIS_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 (chunkML36DOIS_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 ? chunkML36DOIS_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(chunkML36DOIS_js.createPresenterTimer());
|
|
1756
|
+
const [snapshot, setSnapshot] = React3.useState(() => chunkML36DOIS_js.createInitialPresentationSnapshot(slideIndex));
|
|
1757
1757
|
const patch = React3.useCallback((value) => {
|
|
1758
|
-
setSnapshot((current) =>
|
|
1758
|
+
setSnapshot((current) => chunkML36DOIS_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: chunkML36DOIS_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 = chunkML36DOIS_js.togglePresenterTimer(timerRef.current);
|
|
1776
1776
|
patch({
|
|
1777
1777
|
paused: timerRef.current.paused,
|
|
1778
|
-
elapsedMs:
|
|
1778
|
+
elapsedMs: chunkML36DOIS_js.presenterElapsed(timerRef.current)
|
|
1779
1779
|
});
|
|
1780
1780
|
},
|
|
1781
1781
|
resetTimer: () => {
|
|
1782
|
-
timerRef.current =
|
|
1782
|
+
timerRef.current = chunkML36DOIS_js.resetPresenterTimer();
|
|
1783
1783
|
patch({ paused: false, elapsedMs: 0 });
|
|
1784
1784
|
},
|
|
1785
1785
|
stepZoom: (direction) => setSnapshot(
|
|
1786
|
-
(current) =>
|
|
1787
|
-
zoom:
|
|
1786
|
+
(current) => chunkML36DOIS_js.mergePresentationSnapshot(current, {
|
|
1787
|
+
zoom: chunkML36DOIS_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 (!chunkRPWTP6QP_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 (!chunkRPWTP6QP_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) => chunkML36DOIS_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) => !chunkML36DOIS_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 chunkRPWTP6QP_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
|
+
chunkML36DOIS_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 } = chunkML36DOIS_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(chunkML36DOIS_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 chunkRPWTP6QP_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 chunkML36DOIS_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 chunkML36DOIS_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 (!chunkRPWTP6QP_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 ? chunkML36DOIS_js.normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : chunkML36DOIS_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 = chunkML36DOIS_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
3703
|
+
const textOrientation = chunkML36DOIS_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
3704
|
+
const verticalDirection = chunkML36DOIS_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 ? chunkML36DOIS_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: chunkML36DOIS_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
|
+
...chunkML36DOIS_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 (!chunkRPWTP6QP_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 = chunkML36DOIS_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
3777
|
+
const textOrientation = chunkML36DOIS_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
3778
|
+
const verticalDirection = chunkML36DOIS_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 = chunkRPWTP6QP_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 = chunkML36DOIS_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 chunkML36DOIS_js.buildTextFillCss(style);
|
|
3839
3839
|
}
|
|
3840
3840
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
3841
|
-
return
|
|
3841
|
+
return chunkML36DOIS_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}${chunkML36DOIS_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}${chunkML36DOIS_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}${chunkML36DOIS_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}${chunkML36DOIS_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}${chunkML36DOIS_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 = chunkML36DOIS_js.segmentByScript(text);
|
|
4085
4085
|
if (runs.length <= 1) {
|
|
4086
4086
|
if (runs.length === 1) {
|
|
4087
|
-
const font =
|
|
4087
|
+
const font = chunkML36DOIS_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 = chunkML36DOIS_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 = chunkML36DOIS_js.convertOmmlToMathMl(equationXml);
|
|
4170
|
+
const safeMathml = mathml ? chunkML36DOIS_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 = chunkML36DOIS_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 = chunkML36DOIS_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 ? chunkML36DOIS_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkML36DOIS_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
4281
|
+
const underlineDecoration = chunkML36DOIS_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 ? chunkRPWTP6QP_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 = chunkML36DOIS_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 ? chunkML36DOIS_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 ? chunkML36DOIS_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
4318
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkML36DOIS_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: chunkML36DOIS_js.buildTextShadowCss(segmentStyle),
|
|
4321
|
+
filter: chunkML36DOIS_js.buildTextRunFilterChain(segmentStyle),
|
|
4322
|
+
opacity: chunkML36DOIS_js.getTextAlphaOpacity(segmentStyle),
|
|
4323
|
+
WebkitBoxReflect: chunkML36DOIS_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 = chunkML36DOIS_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 = chunkML36DOIS_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 (!chunkRPWTP6QP_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 = chunkRPWTP6QP_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
4467
|
+
const elementRtl = chunkRPWTP6QP_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
4468
|
+
const elementAlign = chunkRPWTP6QP_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 = chunkML36DOIS_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
4483
4483
|
const isRtlParagraph = paraRtl === true;
|
|
4484
|
-
const paraAlign =
|
|
4485
|
-
const cssTextAlign =
|
|
4484
|
+
const paraAlign = chunkML36DOIS_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
4485
|
+
const cssTextAlign = chunkML36DOIS_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 = chunkML36DOIS_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 (!chunkRPWTP6QP_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 (!chunkRPWTP6QP_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 (!chunkRPWTP6QP_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 ${chunkML36DOIS_js.colorWithOpacity(
|
|
4690
|
+
chunkML36DOIS_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
4691
4691
|
opacity
|
|
4692
4692
|
)}`;
|
|
4693
4693
|
}
|
|
4694
4694
|
function buildLineGlowFilter(element) {
|
|
4695
|
-
if (!
|
|
4695
|
+
if (!chunkRPWTP6QP_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 = chunkML36DOIS_js.colorWithOpacity(chunkML36DOIS_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 (!chunkRPWTP6QP_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 chunkML36DOIS_js.build3DExtrusionData(
|
|
4792
4792
|
shape3d,
|
|
4793
4793
|
scene3d,
|
|
4794
4794
|
fillColor,
|
|
@@ -4797,27 +4797,27 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
4797
4797
|
);
|
|
4798
4798
|
}
|
|
4799
4799
|
function apply3dEffects2(base, scene3d, shape3d) {
|
|
4800
|
-
|
|
4800
|
+
chunkML36DOIS_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 (!chunkRPWTP6QP_js.hasShapeProperties(element)) {
|
|
4806
4806
|
return {};
|
|
4807
4807
|
}
|
|
4808
4808
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
4809
|
-
const clipPath =
|
|
4809
|
+
const clipPath = chunkML36DOIS_js.getResolvedShapeClipPath(element);
|
|
4810
4810
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
4811
4811
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
4812
|
-
const strokeDash =
|
|
4813
|
-
const fillGradient =
|
|
4814
|
-
const shadowCss =
|
|
4815
|
-
const innerShadowCss =
|
|
4816
|
-
const resolvedFillColor =
|
|
4817
|
-
const resolvedStrokeColor =
|
|
4812
|
+
const strokeDash = chunkML36DOIS_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
4813
|
+
const fillGradient = chunkML36DOIS_js.buildCssGradientFromShapeStyle(element.shapeStyle) || element.shapeStyle?.fillGradient;
|
|
4814
|
+
const shadowCss = chunkML36DOIS_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
4815
|
+
const innerShadowCss = chunkML36DOIS_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
4816
|
+
const resolvedFillColor = chunkML36DOIS_js.colorWithOpacity(fillColor, fillOpacity);
|
|
4817
|
+
const resolvedStrokeColor = chunkML36DOIS_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
4818
4818
|
const ss = element.shapeStyle;
|
|
4819
4819
|
const combinedShadowParts = [];
|
|
4820
|
-
const multiLayerShadow =
|
|
4820
|
+
const multiLayerShadow = chunkML36DOIS_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
4821
4821
|
if (multiLayerShadow) {
|
|
4822
4822
|
combinedShadowParts.push(multiLayerShadow);
|
|
4823
4823
|
} else if (shadowCss) {
|
|
@@ -4826,7 +4826,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4826
4826
|
if (innerShadowCss) {
|
|
4827
4827
|
combinedShadowParts.push(innerShadowCss);
|
|
4828
4828
|
}
|
|
4829
|
-
const glowBoxShadow =
|
|
4829
|
+
const glowBoxShadow = chunkML36DOIS_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
4830
4830
|
if (glowBoxShadow) {
|
|
4831
4831
|
combinedShadowParts.push(glowBoxShadow);
|
|
4832
4832
|
}
|
|
@@ -4834,7 +4834,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4834
4834
|
if (lineShadow) {
|
|
4835
4835
|
combinedShadowParts.push(lineShadow);
|
|
4836
4836
|
}
|
|
4837
|
-
const compoundLineShadow =
|
|
4837
|
+
const compoundLineShadow = chunkML36DOIS_js.getCompoundLineBoxShadow(
|
|
4838
4838
|
element.shapeStyle?.compoundLine,
|
|
4839
4839
|
strokeWidth,
|
|
4840
4840
|
resolvedStrokeColor
|
|
@@ -4847,7 +4847,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4847
4847
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
4848
4848
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
4849
4849
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
4850
|
-
const glowCol =
|
|
4850
|
+
const glowCol = chunkML36DOIS_js.colorWithOpacity(chunkML36DOIS_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
4851
4851
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
4852
4852
|
}
|
|
4853
4853
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
@@ -4860,12 +4860,12 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4860
4860
|
if (lineGlowCss) {
|
|
4861
4861
|
filterParts.push(lineGlowCss);
|
|
4862
4862
|
}
|
|
4863
|
-
const dagFilter =
|
|
4863
|
+
const dagFilter = chunkML36DOIS_js.getEffectDagFilter(ss, element.id);
|
|
4864
4864
|
if (dagFilter) {
|
|
4865
4865
|
filterParts.push(dagFilter);
|
|
4866
4866
|
}
|
|
4867
4867
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : void 0;
|
|
4868
|
-
const patternFill =
|
|
4868
|
+
const patternFill = chunkML36DOIS_js.buildPatternFillCss(element.shapeStyle);
|
|
4869
4869
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
4870
4870
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
4871
4871
|
let reflectCss;
|
|
@@ -4877,7 +4877,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4877
4877
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
4878
4878
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
4879
4879
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
4880
|
-
reflectCss =
|
|
4880
|
+
reflectCss = chunkML36DOIS_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
4881
4881
|
}
|
|
4882
4882
|
}
|
|
4883
4883
|
const base = {
|
|
@@ -4891,9 +4891,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4891
4891
|
filter: filterParts.length > 0 ? filterParts.join(" ") : void 0,
|
|
4892
4892
|
opacity: typeof ss?.dagAlphaModFix === "number" ? Math.max(0, Math.min(1, ss.dagAlphaModFix / 100)) : void 0,
|
|
4893
4893
|
mixBlendMode: mapDagBlendModeToCss(ss?.dagFillOverlayBlend),
|
|
4894
|
-
borderWidth: strokeWidth > 0 ?
|
|
4894
|
+
borderWidth: strokeWidth > 0 ? chunkML36DOIS_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : void 0,
|
|
4895
4895
|
borderColor: strokeWidth > 0 ? resolvedStrokeColor : void 0,
|
|
4896
|
-
borderStyle: strokeWidth > 0 ?
|
|
4896
|
+
borderStyle: strokeWidth > 0 ? chunkML36DOIS_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
4897
4897
|
strokeLinejoin: lineJoinCss,
|
|
4898
4898
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : void 0
|
|
4899
4899
|
};
|
|
@@ -4934,7 +4934,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4934
4934
|
borderWidth: 0,
|
|
4935
4935
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
4936
4936
|
borderTopColor: resolvedStrokeColor,
|
|
4937
|
-
borderTopStyle:
|
|
4937
|
+
borderTopStyle: chunkML36DOIS_js.getCssBorderDashStyle(strokeDash)
|
|
4938
4938
|
};
|
|
4939
4939
|
}
|
|
4940
4940
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -4948,13 +4948,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4948
4948
|
function getConnectorAdjustment(element, key, fallback) {
|
|
4949
4949
|
const direct = element.shapeAdjustments?.[key];
|
|
4950
4950
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
4951
|
-
return
|
|
4951
|
+
return chunkML36DOIS_js.clampUnitInterval(direct / 1e5);
|
|
4952
4952
|
}
|
|
4953
4953
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
4954
4954
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
4955
|
-
return
|
|
4955
|
+
return chunkML36DOIS_js.clampUnitInterval(fallbackKey / 1e5);
|
|
4956
4956
|
}
|
|
4957
|
-
return
|
|
4957
|
+
return chunkML36DOIS_js.clampUnitInterval(fallback);
|
|
4958
4958
|
}
|
|
4959
4959
|
function getConnectorPathGeometry(element) {
|
|
4960
4960
|
const width = Math.max(element.width, 1);
|
|
@@ -5081,14 +5081,14 @@ function renderConnectorMarker(markerId, arrowType, color, arrowWidth, arrowLeng
|
|
|
5081
5081
|
);
|
|
5082
5082
|
}
|
|
5083
5083
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor) {
|
|
5084
|
-
if (!
|
|
5084
|
+
if (!chunkRPWTP6QP_js.hasShapeProperties(element)) {
|
|
5085
5085
|
return null;
|
|
5086
5086
|
}
|
|
5087
5087
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
5088
|
-
const fillPaint =
|
|
5089
|
-
const strokePaint =
|
|
5090
|
-
const dashType =
|
|
5091
|
-
const dashArray =
|
|
5088
|
+
const fillPaint = chunkML36DOIS_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
5089
|
+
const strokePaint = chunkML36DOIS_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
5090
|
+
const dashType = chunkML36DOIS_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
5091
|
+
const dashArray = chunkML36DOIS_js.getSvgStrokeDasharray(
|
|
5092
5092
|
dashType,
|
|
5093
5093
|
Math.max(strokeWidth, 1),
|
|
5094
5094
|
element.shapeStyle?.customDashSegments
|
|
@@ -5172,18 +5172,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5172
5172
|
}
|
|
5173
5173
|
);
|
|
5174
5174
|
}
|
|
5175
|
-
if (
|
|
5175
|
+
if (chunkRPWTP6QP_js.isCalloutShape(normalizedType)) {
|
|
5176
5176
|
const width = Math.max(element.width, 1);
|
|
5177
5177
|
const height = Math.max(element.height, 1);
|
|
5178
|
-
const geometry =
|
|
5178
|
+
const geometry = chunkRPWTP6QP_js.getCalloutLeaderLineGeometry(
|
|
5179
5179
|
normalizedType,
|
|
5180
5180
|
width,
|
|
5181
5181
|
height,
|
|
5182
5182
|
element.shapeAdjustments
|
|
5183
5183
|
);
|
|
5184
5184
|
if (geometry && geometry.points.length >= 2) {
|
|
5185
|
-
const leaderPath =
|
|
5186
|
-
const bounds =
|
|
5185
|
+
const leaderPath = chunkRPWTP6QP_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
5186
|
+
const bounds = chunkRPWTP6QP_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
5187
5187
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
5188
5188
|
const offsetLeft = bounds.minX;
|
|
5189
5189
|
const offsetTop = bounds.minY;
|
|
@@ -5247,8 +5247,8 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5247
5247
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
5248
5248
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
5249
5249
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
5250
|
-
const offsets =
|
|
5251
|
-
const widths =
|
|
5250
|
+
const offsets = chunkML36DOIS_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
5251
|
+
const widths = chunkML36DOIS_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
5252
5252
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5253
5253
|
"svg",
|
|
5254
5254
|
{
|
|
@@ -5302,7 +5302,7 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5302
5302
|
|
|
5303
5303
|
// src/viewer/utils/image-style.ts
|
|
5304
5304
|
function getImageMaskStyle(element) {
|
|
5305
|
-
if (!
|
|
5305
|
+
if (!chunkRPWTP6QP_js.hasShapeProperties(element)) {
|
|
5306
5306
|
return void 0;
|
|
5307
5307
|
}
|
|
5308
5308
|
const shapeType = element.shapeType;
|
|
@@ -5311,7 +5311,7 @@ function getImageMaskStyle(element) {
|
|
|
5311
5311
|
}
|
|
5312
5312
|
const normalized = shapeType.toLowerCase();
|
|
5313
5313
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
5314
|
-
const radiusPx =
|
|
5314
|
+
const radiusPx = chunkML36DOIS_js.getRoundRectRadiusPx(element);
|
|
5315
5315
|
if (radiusPx <= 0.01) {
|
|
5316
5316
|
return void 0;
|
|
5317
5317
|
}
|
|
@@ -5323,7 +5323,7 @@ function getImageMaskStyle(element) {
|
|
|
5323
5323
|
if (normalized === "can" || normalized === "cylinder") {
|
|
5324
5324
|
return { borderRadius: "48% / 12%" };
|
|
5325
5325
|
}
|
|
5326
|
-
const clipPath =
|
|
5326
|
+
const clipPath = chunkML36DOIS_js.getResolvedShapeClipPath(element);
|
|
5327
5327
|
if (!clipPath) {
|
|
5328
5328
|
return void 0;
|
|
5329
5329
|
}
|
|
@@ -5331,7 +5331,7 @@ function getImageMaskStyle(element) {
|
|
|
5331
5331
|
}
|
|
5332
5332
|
function getImageRenderStyle(element) {
|
|
5333
5333
|
const maskStyle = getImageMaskStyle(element) || {};
|
|
5334
|
-
if (!
|
|
5334
|
+
if (!chunkRPWTP6QP_js.isImageLikeElement(element)) {
|
|
5335
5335
|
return {
|
|
5336
5336
|
...maskStyle,
|
|
5337
5337
|
width: "100%",
|
|
@@ -5339,10 +5339,10 @@ function getImageRenderStyle(element) {
|
|
|
5339
5339
|
objectFit: "cover"
|
|
5340
5340
|
};
|
|
5341
5341
|
}
|
|
5342
|
-
const cropLeft =
|
|
5343
|
-
const cropTop =
|
|
5344
|
-
const cropRight =
|
|
5345
|
-
const cropBottom =
|
|
5342
|
+
const cropLeft = chunkML36DOIS_js.clampCropValue(element.cropLeft);
|
|
5343
|
+
const cropTop = chunkML36DOIS_js.clampCropValue(element.cropTop);
|
|
5344
|
+
const cropRight = chunkML36DOIS_js.clampCropValue(element.cropRight);
|
|
5345
|
+
const cropBottom = chunkML36DOIS_js.clampCropValue(element.cropBottom);
|
|
5346
5346
|
const hasCrop = cropLeft + cropRight > 1e-4 || cropTop + cropBottom > 1e-4;
|
|
5347
5347
|
if (!hasCrop) {
|
|
5348
5348
|
return {
|
|
@@ -5354,10 +5354,10 @@ function getImageRenderStyle(element) {
|
|
|
5354
5354
|
}
|
|
5355
5355
|
const safeHorizontalScale = cropLeft + cropRight >= 0.99 ? 0.99 / (cropLeft + cropRight) : 1;
|
|
5356
5356
|
const safeVerticalScale = cropTop + cropBottom >= 0.99 ? 0.99 / (cropTop + cropBottom) : 1;
|
|
5357
|
-
const normalizedLeft =
|
|
5358
|
-
const normalizedRight =
|
|
5359
|
-
const normalizedTop =
|
|
5360
|
-
const normalizedBottom =
|
|
5357
|
+
const normalizedLeft = chunkML36DOIS_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
5358
|
+
const normalizedRight = chunkML36DOIS_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
5359
|
+
const normalizedTop = chunkML36DOIS_js.clampCropValue(cropTop * safeVerticalScale);
|
|
5360
|
+
const normalizedBottom = chunkML36DOIS_js.clampCropValue(cropBottom * safeVerticalScale);
|
|
5361
5361
|
const remainingWidth = Math.max(0.01, 1 - normalizedLeft - normalizedRight);
|
|
5362
5362
|
const remainingHeight = Math.max(0.01, 1 - normalizedTop - normalizedBottom);
|
|
5363
5363
|
const tx = Math.round(-normalizedLeft / remainingWidth * 1e4) / 100;
|
|
@@ -5386,7 +5386,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
5386
5386
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
5387
5387
|
};
|
|
5388
5388
|
function getCropShapeClipPath(element) {
|
|
5389
|
-
if (!
|
|
5389
|
+
if (!chunkRPWTP6QP_js.isImageLikeElement(element)) {
|
|
5390
5390
|
return void 0;
|
|
5391
5391
|
}
|
|
5392
5392
|
const shape = element.cropShape;
|
|
@@ -5396,7 +5396,7 @@ function getCropShapeClipPath(element) {
|
|
|
5396
5396
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
5397
5397
|
}
|
|
5398
5398
|
function isImageTiled(element) {
|
|
5399
|
-
if (!
|
|
5399
|
+
if (!chunkRPWTP6QP_js.isImageLikeElement(element)) {
|
|
5400
5400
|
return false;
|
|
5401
5401
|
}
|
|
5402
5402
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -5426,7 +5426,7 @@ function tileAlignmentToCssPosition(alignment) {
|
|
|
5426
5426
|
}
|
|
5427
5427
|
}
|
|
5428
5428
|
function getImageTilingStyle(element) {
|
|
5429
|
-
if (!
|
|
5429
|
+
if (!chunkRPWTP6QP_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
5430
5430
|
return void 0;
|
|
5431
5431
|
}
|
|
5432
5432
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -5497,9 +5497,9 @@ function parseGradientFillCss(gradFill) {
|
|
|
5497
5497
|
}
|
|
5498
5498
|
const parsed = stops.map((gs) => {
|
|
5499
5499
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
5500
|
-
const color =
|
|
5501
|
-
const opacity =
|
|
5502
|
-
return { pos, color:
|
|
5500
|
+
const color = chunkML36DOIS_js.parseDrawingColor(gs) ?? "#888888";
|
|
5501
|
+
const opacity = chunkML36DOIS_js.parseDrawingColorOpacity(gs);
|
|
5502
|
+
return { pos, color: chunkML36DOIS_js.colorWithOpacity(color, opacity) };
|
|
5503
5503
|
}).sort((a, b) => a.pos - b.pos);
|
|
5504
5504
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
5505
5505
|
const lin = gradFill["a:lin"];
|
|
@@ -5540,8 +5540,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
5540
5540
|
if (!pattFill) {
|
|
5541
5541
|
return void 0;
|
|
5542
5542
|
}
|
|
5543
|
-
const fgColor =
|
|
5544
|
-
const bgColor =
|
|
5543
|
+
const fgColor = chunkML36DOIS_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
5544
|
+
const bgColor = chunkML36DOIS_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
5545
5545
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
5546
5546
|
switch (preset) {
|
|
5547
5547
|
case "ltHorz":
|
|
@@ -5652,11 +5652,11 @@ function parseCellBorders(cellProperties) {
|
|
|
5652
5652
|
const prstDash = ln["a:prstDash"];
|
|
5653
5653
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
5654
5654
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
5655
|
-
const color =
|
|
5655
|
+
const color = chunkML36DOIS_js.parseDrawingColor(ln["a:solidFill"]);
|
|
5656
5656
|
if (color) {
|
|
5657
|
-
const opacity =
|
|
5657
|
+
const opacity = chunkML36DOIS_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
5658
5658
|
const key = `${edge.prefix}`;
|
|
5659
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
5659
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkML36DOIS_js.colorWithOpacity(color, opacity)}`;
|
|
5660
5660
|
}
|
|
5661
5661
|
}
|
|
5662
5662
|
return borderStyle;
|
|
@@ -5669,7 +5669,7 @@ function parseCellTextEffects(runProps) {
|
|
|
5669
5669
|
const textShadowParts = [];
|
|
5670
5670
|
const outerShdw = effectLst["a:outerShdw"];
|
|
5671
5671
|
if (outerShdw) {
|
|
5672
|
-
const shdwColor =
|
|
5672
|
+
const shdwColor = chunkML36DOIS_js.parseDrawingColor(outerShdw);
|
|
5673
5673
|
if (shdwColor) {
|
|
5674
5674
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
5675
5675
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -5687,7 +5687,7 @@ function parseCellTextEffects(runProps) {
|
|
|
5687
5687
|
}
|
|
5688
5688
|
const glow = effectLst["a:glow"];
|
|
5689
5689
|
if (glow) {
|
|
5690
|
-
const glowColor =
|
|
5690
|
+
const glowColor = chunkML36DOIS_js.parseDrawingColor(glow);
|
|
5691
5691
|
if (glowColor) {
|
|
5692
5692
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
5693
5693
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -5766,10 +5766,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5766
5766
|
if (runProps?.["@_u"] !== void 0) {
|
|
5767
5767
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
5768
5768
|
}
|
|
5769
|
-
const runColor =
|
|
5769
|
+
const runColor = chunkML36DOIS_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkML36DOIS_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
5770
5770
|
if (runColor) {
|
|
5771
|
-
const opacity =
|
|
5772
|
-
cellStyle.color =
|
|
5771
|
+
const opacity = chunkML36DOIS_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
5772
|
+
cellStyle.color = chunkML36DOIS_js.colorWithOpacity(runColor, opacity);
|
|
5773
5773
|
}
|
|
5774
5774
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
5775
5775
|
if (fontFamily) {
|
|
@@ -5779,15 +5779,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5779
5779
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
5780
5780
|
}
|
|
5781
5781
|
const cellProperties = cellXml["a:tcPr"];
|
|
5782
|
-
const cellFill =
|
|
5782
|
+
const cellFill = chunkML36DOIS_js.parseDrawingColor(
|
|
5783
5783
|
cellProperties?.["a:solidFill"],
|
|
5784
5784
|
schemeColorOverrides
|
|
5785
5785
|
);
|
|
5786
5786
|
if (cellFill) {
|
|
5787
|
-
const opacity =
|
|
5787
|
+
const opacity = chunkML36DOIS_js.parseDrawingColorOpacity(
|
|
5788
5788
|
cellProperties?.["a:solidFill"]
|
|
5789
5789
|
);
|
|
5790
|
-
cellStyle.backgroundColor =
|
|
5790
|
+
cellStyle.backgroundColor = chunkML36DOIS_js.colorWithOpacity(cellFill, opacity);
|
|
5791
5791
|
} else {
|
|
5792
5792
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
5793
5793
|
if (gradCss) {
|
|
@@ -5802,16 +5802,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5802
5802
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
5803
5803
|
Object.assign(cellStyle, edgeBorders);
|
|
5804
5804
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
5805
|
-
const borderColor =
|
|
5805
|
+
const borderColor = chunkML36DOIS_js.parseDrawingColor(
|
|
5806
5806
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
5807
5807
|
schemeColorOverrides
|
|
5808
|
-
) ||
|
|
5808
|
+
) || chunkML36DOIS_js.parseDrawingColor(
|
|
5809
5809
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
5810
5810
|
schemeColorOverrides
|
|
5811
|
-
) ||
|
|
5811
|
+
) || chunkML36DOIS_js.parseDrawingColor(
|
|
5812
5812
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
5813
5813
|
schemeColorOverrides
|
|
5814
|
-
) ||
|
|
5814
|
+
) || chunkML36DOIS_js.parseDrawingColor(
|
|
5815
5815
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
5816
5816
|
schemeColorOverrides
|
|
5817
5817
|
);
|
|
@@ -5890,10 +5890,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
5890
5890
|
}
|
|
5891
5891
|
let color = base;
|
|
5892
5892
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
5893
|
-
color =
|
|
5893
|
+
color = chunkML36DOIS_js.tintColor2(color, fill.tint / 1e5);
|
|
5894
5894
|
}
|
|
5895
5895
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
5896
|
-
color =
|
|
5896
|
+
color = chunkML36DOIS_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
5897
5897
|
}
|
|
5898
5898
|
return color;
|
|
5899
5899
|
}
|
|
@@ -5915,10 +5915,10 @@ function applyTableStyleText(text, colorScheme, style) {
|
|
|
5915
5915
|
if (base) {
|
|
5916
5916
|
let color = base;
|
|
5917
5917
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
5918
|
-
color =
|
|
5918
|
+
color = chunkML36DOIS_js.tintColor2(color, text.fontTint / 1e5);
|
|
5919
5919
|
}
|
|
5920
5920
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
5921
|
-
color =
|
|
5921
|
+
color = chunkML36DOIS_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
5922
5922
|
}
|
|
5923
5923
|
style.color = color;
|
|
5924
5924
|
applied = true;
|
|
@@ -6200,9 +6200,9 @@ function cellStyleToCss(style) {
|
|
|
6200
6200
|
if (style.gradientFillCss) {
|
|
6201
6201
|
css.background = style.gradientFillCss;
|
|
6202
6202
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
6203
|
-
const fg =
|
|
6204
|
-
const bg =
|
|
6205
|
-
const svgPattern =
|
|
6203
|
+
const fg = chunkML36DOIS_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
6204
|
+
const bg = chunkML36DOIS_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
6205
|
+
const svgPattern = chunkML36DOIS_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
6206
6206
|
if (svgPattern) {
|
|
6207
6207
|
const encoded = encodeURIComponent(svgPattern);
|
|
6208
6208
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -6271,7 +6271,7 @@ function cellStyleToCss(style) {
|
|
|
6271
6271
|
if (edge.width || edge.color) {
|
|
6272
6272
|
const w = edge.width ?? 1;
|
|
6273
6273
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
6274
|
-
const s =
|
|
6274
|
+
const s = chunkML36DOIS_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
6275
6275
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
6276
6276
|
}
|
|
6277
6277
|
}
|
|
@@ -6313,7 +6313,7 @@ function TableResizeOverlay({
|
|
|
6313
6313
|
const containerRef = React3.useRef(null);
|
|
6314
6314
|
const [rowBounds, setRowBounds] = React3.useState([]);
|
|
6315
6315
|
const dragRef = React3.useRef(null);
|
|
6316
|
-
const colBoundaries = React3.useMemo(() =>
|
|
6316
|
+
const colBoundaries = React3.useMemo(() => chunkML36DOIS_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
6317
6317
|
const measureRows = React3.useCallback(() => {
|
|
6318
6318
|
const container = containerRef.current;
|
|
6319
6319
|
if (!container) {
|
|
@@ -6360,11 +6360,11 @@ function TableResizeOverlay({
|
|
|
6360
6360
|
const rect = containerRef.current.getBoundingClientRect();
|
|
6361
6361
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
6362
6362
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
6363
|
-
onResizeColumns(
|
|
6363
|
+
onResizeColumns(chunkML36DOIS_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
6364
6364
|
} else if (drag.type === "row" && onResizeRow) {
|
|
6365
6365
|
const deltaY = e.clientY - drag.startPos;
|
|
6366
|
-
const newHeight =
|
|
6367
|
-
drag.initialRowHeight ??
|
|
6366
|
+
const newHeight = chunkML36DOIS_js.computeResizedRowHeight(
|
|
6367
|
+
drag.initialRowHeight ?? chunkML36DOIS_js.DEFAULT_ROW_HEIGHT,
|
|
6368
6368
|
deltaY
|
|
6369
6369
|
);
|
|
6370
6370
|
onResizeRow(drag.index, newHeight);
|
|
@@ -6402,7 +6402,7 @@ function TableResizeOverlay({
|
|
|
6402
6402
|
e.stopPropagation();
|
|
6403
6403
|
const table = containerRef.current?.querySelector("table");
|
|
6404
6404
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
6405
|
-
const actualHeight = tr?.offsetHeight ??
|
|
6405
|
+
const actualHeight = tr?.offsetHeight ?? chunkML36DOIS_js.DEFAULT_ROW_HEIGHT;
|
|
6406
6406
|
document.body.style.cursor = "row-resize";
|
|
6407
6407
|
document.body.style.userSelect = "none";
|
|
6408
6408
|
dragRef.current = {
|
|
@@ -6448,7 +6448,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6448
6448
|
}
|
|
6449
6449
|
const first = selectedCell.selectedCells[0];
|
|
6450
6450
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
6451
|
-
return
|
|
6451
|
+
return chunkML36DOIS_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
6452
6452
|
})();
|
|
6453
6453
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6454
6454
|
TableResizeOverlay,
|
|
@@ -6481,7 +6481,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6481
6481
|
return null;
|
|
6482
6482
|
}
|
|
6483
6483
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
6484
|
-
const isInMultiSelection =
|
|
6484
|
+
const isInMultiSelection = chunkML36DOIS_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
6485
6485
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
6486
6486
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6487
6487
|
"td",
|
|
@@ -6504,7 +6504,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6504
6504
|
}
|
|
6505
6505
|
event.stopPropagation();
|
|
6506
6506
|
if (event.shiftKey && selectedCell) {
|
|
6507
|
-
const rect =
|
|
6507
|
+
const rect = chunkML36DOIS_js.computeSelectionRect(
|
|
6508
6508
|
selectedCell.rowIndex,
|
|
6509
6509
|
selectedCell.columnIndex,
|
|
6510
6510
|
rowIndex,
|
|
@@ -6514,7 +6514,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6514
6514
|
options?.onSelectCell?.({
|
|
6515
6515
|
rowIndex: selectedCell.rowIndex,
|
|
6516
6516
|
columnIndex: selectedCell.columnIndex,
|
|
6517
|
-
selectedCells:
|
|
6517
|
+
selectedCells: chunkML36DOIS_js.rectToCells(rect)
|
|
6518
6518
|
});
|
|
6519
6519
|
} else {
|
|
6520
6520
|
options?.onSelectCell?.({
|
|
@@ -6588,7 +6588,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6588
6588
|
}
|
|
6589
6589
|
const first = selectedCell.selectedCells[0];
|
|
6590
6590
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
6591
|
-
return
|
|
6591
|
+
return chunkML36DOIS_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
6592
6592
|
})();
|
|
6593
6593
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
6594
6594
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6653,7 +6653,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6653
6653
|
"border px-1 py-0.5 align-top",
|
|
6654
6654
|
isEditable2 && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
6655
6655
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
6656
|
-
|
|
6656
|
+
chunkML36DOIS_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
6657
6657
|
),
|
|
6658
6658
|
colSpan,
|
|
6659
6659
|
rowSpan: rSpan,
|
|
@@ -6664,7 +6664,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6664
6664
|
}
|
|
6665
6665
|
event.stopPropagation();
|
|
6666
6666
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
6667
|
-
const rect =
|
|
6667
|
+
const rect = chunkML36DOIS_js.computeSelectionRect(
|
|
6668
6668
|
selectedCell.rowIndex,
|
|
6669
6669
|
selectedCell.columnIndex,
|
|
6670
6670
|
rowIndex,
|
|
@@ -6674,7 +6674,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6674
6674
|
options?.onSelectCell?.({
|
|
6675
6675
|
rowIndex: selectedCell.rowIndex,
|
|
6676
6676
|
columnIndex: selectedCell.columnIndex,
|
|
6677
|
-
selectedCells:
|
|
6677
|
+
selectedCells: chunkML36DOIS_js.rectToCells(rect)
|
|
6678
6678
|
});
|
|
6679
6679
|
} else {
|
|
6680
6680
|
options?.onSelectCell?.({
|
|
@@ -6726,24 +6726,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6726
6726
|
}
|
|
6727
6727
|
var LEGEND_ITEM_WIDTH = 80;
|
|
6728
6728
|
function partAttrs(part) {
|
|
6729
|
-
return part ?
|
|
6729
|
+
return part ? chunkML36DOIS_js.chartPartToAttrs(part) : void 0;
|
|
6730
6730
|
}
|
|
6731
6731
|
function resolveReactPalette(chartData) {
|
|
6732
6732
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
6733
6733
|
return chartData.colorPalette;
|
|
6734
6734
|
}
|
|
6735
|
-
return [...
|
|
6735
|
+
return [...chunkML36DOIS_js.getChartStylePalette(chartData.style?.styleId)];
|
|
6736
6736
|
}
|
|
6737
6737
|
function buildReactChartViewModel(element) {
|
|
6738
6738
|
if (element.type !== "chart" || !element.chartData) {
|
|
6739
|
-
return
|
|
6739
|
+
return chunkML36DOIS_js.buildChartViewModel(element);
|
|
6740
6740
|
}
|
|
6741
6741
|
const palette = resolveReactPalette(element.chartData);
|
|
6742
6742
|
const themedElement = {
|
|
6743
6743
|
...element,
|
|
6744
6744
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
6745
6745
|
};
|
|
6746
|
-
return
|
|
6746
|
+
return chunkML36DOIS_js.buildChartViewModel(themedElement);
|
|
6747
6747
|
}
|
|
6748
6748
|
function renderPrimitive(prim, key) {
|
|
6749
6749
|
switch (prim.kind) {
|
|
@@ -7132,7 +7132,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7132
7132
|
const unmatchedRows = [];
|
|
7133
7133
|
categories.forEach((cat, i) => {
|
|
7134
7134
|
const value = values[i] ?? 0;
|
|
7135
|
-
const code =
|
|
7135
|
+
const code = chunkML36DOIS_js.resolveRegionCode(cat);
|
|
7136
7136
|
if (code) {
|
|
7137
7137
|
regionValueMap.set(code, { value, label: cat });
|
|
7138
7138
|
} else {
|
|
@@ -7170,8 +7170,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7170
7170
|
let fill = "#e2e8f0";
|
|
7171
7171
|
let dataLabel = null;
|
|
7172
7172
|
if (entry) {
|
|
7173
|
-
const t =
|
|
7174
|
-
fill =
|
|
7173
|
+
const t = chunkML36DOIS_js.normalizeValue(entry.value, minVal, maxVal);
|
|
7174
|
+
fill = chunkML36DOIS_js.sequentialColorScale(t);
|
|
7175
7175
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
7176
7176
|
"text",
|
|
7177
7177
|
{
|
|
@@ -7182,7 +7182,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7182
7182
|
fontWeight: 600,
|
|
7183
7183
|
fill: "#1e293b",
|
|
7184
7184
|
style: { pointerEvents: "none" },
|
|
7185
|
-
children:
|
|
7185
|
+
children: chunkML36DOIS_js.formatAxisValue(entry.value)
|
|
7186
7186
|
},
|
|
7187
7187
|
`${element.id}-map-dl-${region.code}`
|
|
7188
7188
|
);
|
|
@@ -7200,7 +7200,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7200
7200
|
opacity: 0.9,
|
|
7201
7201
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
7202
7202
|
region.name,
|
|
7203
|
-
entry ? `: ${
|
|
7203
|
+
entry ? `: ${chunkML36DOIS_js.formatAxisValue(entry.value)}` : ""
|
|
7204
7204
|
] })
|
|
7205
7205
|
}
|
|
7206
7206
|
),
|
|
@@ -7238,7 +7238,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7238
7238
|
fontSize: 7,
|
|
7239
7239
|
fill: "#64748b",
|
|
7240
7240
|
textAnchor: "middle",
|
|
7241
|
-
children:
|
|
7241
|
+
children: chunkML36DOIS_js.formatAxisValue(minVal)
|
|
7242
7242
|
},
|
|
7243
7243
|
`${element.id}-map-legend-min`
|
|
7244
7244
|
),
|
|
@@ -7250,7 +7250,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7250
7250
|
fontSize: 7,
|
|
7251
7251
|
fill: "#64748b",
|
|
7252
7252
|
textAnchor: "middle",
|
|
7253
|
-
children:
|
|
7253
|
+
children: chunkML36DOIS_js.formatAxisValue(maxVal)
|
|
7254
7254
|
},
|
|
7255
7255
|
`${element.id}-map-legend-max`
|
|
7256
7256
|
)
|
|
@@ -7316,7 +7316,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7316
7316
|
y,
|
|
7317
7317
|
fontSize,
|
|
7318
7318
|
fill: "#475569",
|
|
7319
|
-
children:
|
|
7319
|
+
children: chunkML36DOIS_js.formatAxisValue(row.value)
|
|
7320
7320
|
},
|
|
7321
7321
|
`${element.id}-map-ft-val-${i}`
|
|
7322
7322
|
)
|
|
@@ -7387,7 +7387,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
7387
7387
|
|
|
7388
7388
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
7389
7389
|
function sColor(series, idx) {
|
|
7390
|
-
return
|
|
7390
|
+
return chunkML36DOIS_js.seriesColor(series, idx);
|
|
7391
7391
|
}
|
|
7392
7392
|
function valToY(val, range, topY, bottomY) {
|
|
7393
7393
|
const usable = bottomY - topY;
|
|
@@ -7882,7 +7882,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
7882
7882
|
width: 10,
|
|
7883
7883
|
height: 10,
|
|
7884
7884
|
rx: 2,
|
|
7885
|
-
fill:
|
|
7885
|
+
fill: chunkML36DOIS_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
7886
7886
|
},
|
|
7887
7887
|
`${id}-leg-r-${i}`
|
|
7888
7888
|
)
|
|
@@ -7906,7 +7906,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
7906
7906
|
width: 10,
|
|
7907
7907
|
height: 10,
|
|
7908
7908
|
rx: 2,
|
|
7909
|
-
fill:
|
|
7909
|
+
fill: chunkML36DOIS_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
7910
7910
|
}
|
|
7911
7911
|
),
|
|
7912
7912
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -7919,9 +7919,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
7919
7919
|
}
|
|
7920
7920
|
const lines = [];
|
|
7921
7921
|
if (range.logScale && range.logBase) {
|
|
7922
|
-
const ticks =
|
|
7922
|
+
const ticks = chunkML36DOIS_js.generateLogTicks(range);
|
|
7923
7923
|
ticks.forEach((tickVal, i) => {
|
|
7924
|
-
const y =
|
|
7924
|
+
const y = chunkML36DOIS_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
7925
7925
|
lines.push(
|
|
7926
7926
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7927
7927
|
"line",
|
|
@@ -7942,7 +7942,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
7942
7942
|
const steps = 4;
|
|
7943
7943
|
for (let i = 0; i <= steps; i++) {
|
|
7944
7944
|
const val = range.min + range.span * i / steps;
|
|
7945
|
-
const y =
|
|
7945
|
+
const y = chunkML36DOIS_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
7946
7946
|
lines.push(
|
|
7947
7947
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7948
7948
|
"line",
|
|
@@ -7966,9 +7966,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7966
7966
|
const labels = [];
|
|
7967
7967
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
7968
7968
|
if (range.logScale && range.logBase) {
|
|
7969
|
-
const ticks =
|
|
7969
|
+
const ticks = chunkML36DOIS_js.generateLogTicks(range);
|
|
7970
7970
|
ticks.forEach((tickVal, i) => {
|
|
7971
|
-
const y =
|
|
7971
|
+
const y = chunkML36DOIS_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
7972
7972
|
labels.push(
|
|
7973
7973
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7974
7974
|
"text",
|
|
@@ -7978,7 +7978,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7978
7978
|
textAnchor: "end",
|
|
7979
7979
|
fontSize: 8,
|
|
7980
7980
|
fill: "#64748b",
|
|
7981
|
-
children: hasDisplayUnits ?
|
|
7981
|
+
children: hasDisplayUnits ? chunkML36DOIS_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkML36DOIS_js.formatAxisValue(tickVal)
|
|
7982
7982
|
},
|
|
7983
7983
|
`${id}-vaxis-log-${i}`
|
|
7984
7984
|
)
|
|
@@ -7988,7 +7988,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7988
7988
|
const steps = 4;
|
|
7989
7989
|
for (let i = 0; i <= steps; i++) {
|
|
7990
7990
|
const val = range.min + range.span * i / steps;
|
|
7991
|
-
const y =
|
|
7991
|
+
const y = chunkML36DOIS_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
7992
7992
|
labels.push(
|
|
7993
7993
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7994
7994
|
"text",
|
|
@@ -7998,7 +7998,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7998
7998
|
textAnchor: "end",
|
|
7999
7999
|
fontSize: 8,
|
|
8000
8000
|
fill: "#64748b",
|
|
8001
|
-
children: hasDisplayUnits ?
|
|
8001
|
+
children: hasDisplayUnits ? chunkML36DOIS_js.formatAxisValueWithUnits(val, axisFormatting) : chunkML36DOIS_js.formatAxisValue(val)
|
|
8002
8002
|
},
|
|
8003
8003
|
`${id}-vaxis-${i}`
|
|
8004
8004
|
)
|
|
@@ -8006,7 +8006,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
8006
8006
|
}
|
|
8007
8007
|
}
|
|
8008
8008
|
if (hasDisplayUnits) {
|
|
8009
|
-
const unitLabel =
|
|
8009
|
+
const unitLabel = chunkML36DOIS_js.getDisplayUnitLabel(
|
|
8010
8010
|
axisFormatting.displayUnits,
|
|
8011
8011
|
axisFormatting.displayUnitsLabel
|
|
8012
8012
|
);
|
|
@@ -8081,7 +8081,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
8081
8081
|
if (range.min >= 0) {
|
|
8082
8082
|
return null;
|
|
8083
8083
|
}
|
|
8084
|
-
const y =
|
|
8084
|
+
const y = chunkML36DOIS_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
8085
8085
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8086
8086
|
"line",
|
|
8087
8087
|
{
|
|
@@ -8105,7 +8105,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8105
8105
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
8106
8106
|
for (let i = 0; i <= steps; i++) {
|
|
8107
8107
|
const val = range.min + range.span * i / steps;
|
|
8108
|
-
const y =
|
|
8108
|
+
const y = chunkML36DOIS_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8109
8109
|
labels.push(
|
|
8110
8110
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8111
8111
|
"text",
|
|
@@ -8117,7 +8117,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8117
8117
|
fontFamily,
|
|
8118
8118
|
fontWeight,
|
|
8119
8119
|
fill: fontColor,
|
|
8120
|
-
children: hasDisplayUnits ?
|
|
8120
|
+
children: hasDisplayUnits ? chunkML36DOIS_js.formatAxisValueWithUnits(val, axisFormatting) : chunkML36DOIS_js.formatAxisValue(val)
|
|
8121
8121
|
},
|
|
8122
8122
|
`${id}-sec-vaxis-${i}`
|
|
8123
8123
|
)
|
|
@@ -8141,7 +8141,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8141
8141
|
);
|
|
8142
8142
|
}
|
|
8143
8143
|
if (hasDisplayUnits) {
|
|
8144
|
-
const unitLabel =
|
|
8144
|
+
const unitLabel = chunkML36DOIS_js.getDisplayUnitLabel(
|
|
8145
8145
|
axisFormatting.displayUnits,
|
|
8146
8146
|
axisFormatting.displayUnitsLabel
|
|
8147
8147
|
);
|
|
@@ -8172,7 +8172,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
8172
8172
|
const ticks = [];
|
|
8173
8173
|
for (let i = 0; i <= steps; i++) {
|
|
8174
8174
|
const val = range.min + range.span * i / steps;
|
|
8175
|
-
const y =
|
|
8175
|
+
const y = chunkML36DOIS_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8176
8176
|
ticks.push(
|
|
8177
8177
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8178
8178
|
"line",
|
|
@@ -8199,7 +8199,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
8199
8199
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
8200
8200
|
for (let i = 0; i <= steps; i++) {
|
|
8201
8201
|
const val = range.min + range.span * i / steps;
|
|
8202
|
-
const y =
|
|
8202
|
+
const y = chunkML36DOIS_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8203
8203
|
lines.push(
|
|
8204
8204
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8205
8205
|
"line",
|
|
@@ -8360,7 +8360,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
8360
8360
|
width: 8,
|
|
8361
8361
|
height: 8,
|
|
8362
8362
|
borderRadius: 2,
|
|
8363
|
-
backgroundColor:
|
|
8363
|
+
backgroundColor: chunkML36DOIS_js.seriesColor(
|
|
8364
8364
|
s,
|
|
8365
8365
|
si,
|
|
8366
8366
|
chartData.style?.styleId,
|
|
@@ -8399,8 +8399,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
8399
8399
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
8400
8400
|
const style = chartData.style;
|
|
8401
8401
|
const legendPos = style?.legendPosition || "b";
|
|
8402
|
-
const range =
|
|
8403
|
-
const layout =
|
|
8402
|
+
const range = chunkML36DOIS_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8403
|
+
const layout = chunkML36DOIS_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8404
8404
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8405
8405
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
8406
8406
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -8421,10 +8421,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
8421
8421
|
const close = closeSeries.values[ci] ?? high;
|
|
8422
8422
|
const isUp = close >= open;
|
|
8423
8423
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
8424
|
-
const highY =
|
|
8425
|
-
const lowY =
|
|
8426
|
-
const openY =
|
|
8427
|
-
const closeY =
|
|
8424
|
+
const highY = chunkML36DOIS_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
8425
|
+
const lowY = chunkML36DOIS_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
8426
|
+
const openY = chunkML36DOIS_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
8427
|
+
const closeY = chunkML36DOIS_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
8428
8428
|
elements.push(
|
|
8429
8429
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8430
8430
|
"line",
|
|
@@ -8467,7 +8467,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
8467
8467
|
textAnchor: "middle",
|
|
8468
8468
|
fontSize: 7,
|
|
8469
8469
|
fill: "#334155",
|
|
8470
|
-
children:
|
|
8470
|
+
children: chunkML36DOIS_js.formatAxisValue(close)
|
|
8471
8471
|
},
|
|
8472
8472
|
`${element.id}-stock-dl-${ci}`
|
|
8473
8473
|
)
|
|
@@ -8509,7 +8509,7 @@ function FailedToLoad() {
|
|
|
8509
8509
|
var LazySurfaceChart3DScene = React3__default.default.lazy(
|
|
8510
8510
|
async () => {
|
|
8511
8511
|
try {
|
|
8512
|
-
return await import('./SurfaceChart3DScene-
|
|
8512
|
+
return await import('./SurfaceChart3DScene-TGSDRCUC.js');
|
|
8513
8513
|
} catch {
|
|
8514
8514
|
return { default: FailedToLoad };
|
|
8515
8515
|
}
|
|
@@ -8533,7 +8533,7 @@ var SurfaceChart3DErrorBoundary = class extends React3__default.default.Componen
|
|
|
8533
8533
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
8534
8534
|
const rows = chartData.series.length;
|
|
8535
8535
|
const cols = Math.max(categoryLabels.length, 1);
|
|
8536
|
-
const range =
|
|
8536
|
+
const range = chunkML36DOIS_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8537
8537
|
const heightMap = new Float32Array(rows * cols);
|
|
8538
8538
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
8539
8539
|
for (let r = 0; r < rows; r++) {
|
|
@@ -8653,8 +8653,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
8653
8653
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
8654
8654
|
const style = chartData.style;
|
|
8655
8655
|
const legendPos = style?.legendPosition || "b";
|
|
8656
|
-
const layout =
|
|
8657
|
-
const range =
|
|
8656
|
+
const layout = chunkML36DOIS_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
8657
|
+
const range = chunkML36DOIS_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8658
8658
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8659
8659
|
const seriesCount = chartData.series.length;
|
|
8660
8660
|
const cols = catCount - 1;
|
|
@@ -8744,8 +8744,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
8744
8744
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
8745
8745
|
const style = chartData.style;
|
|
8746
8746
|
const legendPos = style?.legendPosition || "b";
|
|
8747
|
-
const layout =
|
|
8748
|
-
const range =
|
|
8747
|
+
const layout = chunkML36DOIS_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8748
|
+
const range = chunkML36DOIS_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8749
8749
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8750
8750
|
const seriesCount = chartData.series.length;
|
|
8751
8751
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -8808,7 +8808,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
8808
8808
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
8809
8809
|
const style = chartData.style;
|
|
8810
8810
|
const legendPos = style?.legendPosition || "b";
|
|
8811
|
-
const layout =
|
|
8811
|
+
const layout = chunkML36DOIS_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
8812
8812
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
8813
8813
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
8814
8814
|
const rects = [];
|
|
@@ -8831,7 +8831,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
8831
8831
|
y: curY,
|
|
8832
8832
|
width: Math.max(w - 1, 1),
|
|
8833
8833
|
height: Math.max(h - 1, 1),
|
|
8834
|
-
fill:
|
|
8834
|
+
fill: chunkML36DOIS_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
8835
8835
|
rx: 2,
|
|
8836
8836
|
opacity: 0.85
|
|
8837
8837
|
},
|
|
@@ -8884,8 +8884,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8884
8884
|
const style = chartData.style;
|
|
8885
8885
|
const legendPos = style?.legendPosition || "b";
|
|
8886
8886
|
const values = chartData.series[0]?.values ?? [];
|
|
8887
|
-
const range =
|
|
8888
|
-
const layout =
|
|
8887
|
+
const range = chunkML36DOIS_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8888
|
+
const layout = chunkML36DOIS_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8889
8889
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
8890
8890
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
8891
8891
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -8896,8 +8896,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8896
8896
|
const isLast = i === values.length - 1;
|
|
8897
8897
|
const startVal = isLast ? 0 : runningTotal;
|
|
8898
8898
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
8899
|
-
const barStartY =
|
|
8900
|
-
const barEndY =
|
|
8899
|
+
const barStartY = chunkML36DOIS_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
8900
|
+
const barEndY = chunkML36DOIS_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
8901
8901
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
8902
8902
|
const y = Math.min(barStartY, barEndY);
|
|
8903
8903
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -8926,7 +8926,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8926
8926
|
textAnchor: "middle",
|
|
8927
8927
|
fontSize: 7,
|
|
8928
8928
|
fill: "#334155",
|
|
8929
|
-
children:
|
|
8929
|
+
children: chunkML36DOIS_js.formatAxisValue(isLast ? endVal : val)
|
|
8930
8930
|
},
|
|
8931
8931
|
`${element.id}-wf-dl-${i}`
|
|
8932
8932
|
)
|
|
@@ -8974,18 +8974,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8974
8974
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
8975
8975
|
const style = chartData.style;
|
|
8976
8976
|
const legendPos = style?.legendPosition || "b";
|
|
8977
|
-
const layoutOpts =
|
|
8977
|
+
const layoutOpts = chunkML36DOIS_js.computeLayoutOptions(
|
|
8978
8978
|
chartData.axes,
|
|
8979
8979
|
chartData.dataTable,
|
|
8980
8980
|
chartData.series.length
|
|
8981
8981
|
);
|
|
8982
|
-
const layout =
|
|
8983
|
-
const { primary, secondary } =
|
|
8982
|
+
const layout = chunkML36DOIS_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
8983
|
+
const { primary, secondary } = chunkML36DOIS_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
8984
8984
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
8985
8985
|
const secondarySeries = secondary.map((e) => e.series);
|
|
8986
|
-
const range =
|
|
8987
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
8988
|
-
const secondaryAxisFmt =
|
|
8986
|
+
const range = chunkML36DOIS_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
8987
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkML36DOIS_js.computeValueRange(secondarySeries) : void 0;
|
|
8988
|
+
const secondaryAxisFmt = chunkML36DOIS_js.getSecondaryValueAxis(chartData.axes);
|
|
8989
8989
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8990
8990
|
const barSeriesCount = 1;
|
|
8991
8991
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -9001,8 +9001,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9001
9001
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
9002
9002
|
barSeries.values.forEach((val, vi) => {
|
|
9003
9003
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
9004
|
-
const zeroY =
|
|
9005
|
-
const valY =
|
|
9004
|
+
const zeroY = chunkML36DOIS_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
9005
|
+
const valY = chunkML36DOIS_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
9006
9006
|
const y = Math.min(zeroY, valY);
|
|
9007
9007
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
9008
9008
|
barElements.push(
|
|
@@ -9013,7 +9013,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9013
9013
|
y,
|
|
9014
9014
|
width: barWidth,
|
|
9015
9015
|
height: h,
|
|
9016
|
-
fill:
|
|
9016
|
+
fill: chunkML36DOIS_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
9017
9017
|
rx: 1
|
|
9018
9018
|
},
|
|
9019
9019
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -9029,7 +9029,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9029
9029
|
textAnchor: "middle",
|
|
9030
9030
|
fontSize: 7,
|
|
9031
9031
|
fill: "#334155",
|
|
9032
|
-
children:
|
|
9032
|
+
children: chunkML36DOIS_js.formatAxisValue(val)
|
|
9033
9033
|
},
|
|
9034
9034
|
`${element.id}-combo-bar-dl-${vi}`
|
|
9035
9035
|
)
|
|
@@ -9046,10 +9046,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9046
9046
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
9047
9047
|
const points = series.values.map((val, vi) => {
|
|
9048
9048
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
9049
|
-
const y =
|
|
9049
|
+
const y = chunkML36DOIS_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
9050
9050
|
return { x, y, val };
|
|
9051
9051
|
});
|
|
9052
|
-
const c =
|
|
9052
|
+
const c = chunkML36DOIS_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
9053
9053
|
lineElements.push(
|
|
9054
9054
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9055
9055
|
"polyline",
|
|
@@ -9076,7 +9076,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9076
9076
|
textAnchor: "middle",
|
|
9077
9077
|
fontSize: 7,
|
|
9078
9078
|
fill: "#334155",
|
|
9079
|
-
children:
|
|
9079
|
+
children: chunkML36DOIS_js.formatAxisValue(p.val)
|
|
9080
9080
|
},
|
|
9081
9081
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
9082
9082
|
)
|
|
@@ -10830,14 +10830,14 @@ function buildNotesPdf(pages) {
|
|
|
10830
10830
|
notes: page.notes,
|
|
10831
10831
|
slideNumber: page.slideNumber
|
|
10832
10832
|
}));
|
|
10833
|
-
const bytes =
|
|
10833
|
+
const bytes = chunkML36DOIS_js.buildNotesPdfBytes(images, meta);
|
|
10834
10834
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
10835
10835
|
return URL.createObjectURL(blob);
|
|
10836
10836
|
}
|
|
10837
10837
|
|
|
10838
10838
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
10839
10839
|
function buildPdfFromImageData(images) {
|
|
10840
|
-
const bytes =
|
|
10840
|
+
const bytes = chunkML36DOIS_js.buildSlidesPdfBytes(images);
|
|
10841
10841
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
10842
10842
|
return URL.createObjectURL(blob);
|
|
10843
10843
|
}
|
|
@@ -10846,7 +10846,7 @@ function buildPdfFromImageData(images) {
|
|
|
10846
10846
|
var activePreview = null;
|
|
10847
10847
|
function startPreviewAnimation(elementId, preset, options) {
|
|
10848
10848
|
stopPreviewAnimation();
|
|
10849
|
-
const descriptor =
|
|
10849
|
+
const descriptor = chunkML36DOIS_js.buildPreviewAnimation(preset, options);
|
|
10850
10850
|
if (!descriptor) {
|
|
10851
10851
|
return;
|
|
10852
10852
|
}
|
|
@@ -10924,7 +10924,7 @@ function useElementOperations(input) {
|
|
|
10924
10924
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
10925
10925
|
const updateElementById = React3.useCallback(
|
|
10926
10926
|
(elementId, updates) => {
|
|
10927
|
-
if (
|
|
10927
|
+
if (chunkML36DOIS_js.isTemplateElementId(elementId)) {
|
|
10928
10928
|
const slideId = activeSlide?.id;
|
|
10929
10929
|
if (slideId) {
|
|
10930
10930
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -10964,7 +10964,7 @@ function useElementOperations(input) {
|
|
|
10964
10964
|
);
|
|
10965
10965
|
const updateSelectedShapeStyle = React3.useCallback(
|
|
10966
10966
|
(updates) => {
|
|
10967
|
-
if (!selectedElement || !
|
|
10967
|
+
if (!selectedElement || !chunkRPWTP6QP_js.hasShapeProperties(selectedElement)) {
|
|
10968
10968
|
return;
|
|
10969
10969
|
}
|
|
10970
10970
|
updateSelectedElement({
|
|
@@ -10975,17 +10975,17 @@ function useElementOperations(input) {
|
|
|
10975
10975
|
);
|
|
10976
10976
|
const updateSelectedTextStyle = React3.useCallback(
|
|
10977
10977
|
(updates) => {
|
|
10978
|
-
if (!selectedElement || !
|
|
10978
|
+
if (!selectedElement || !chunkRPWTP6QP_js.hasTextProperties(selectedElement)) {
|
|
10979
10979
|
return;
|
|
10980
10980
|
}
|
|
10981
|
-
const inlineSel =
|
|
10981
|
+
const inlineSel = chunkML36DOIS_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
10982
10982
|
if (inlineSel && selectedElement.textSegments) {
|
|
10983
|
-
const { newSegments: newSegments2, newSelection } =
|
|
10983
|
+
const { newSegments: newSegments2, newSelection } = chunkML36DOIS_js.applyStyleToSelectedSegments(
|
|
10984
10984
|
selectedElement.textSegments,
|
|
10985
10985
|
inlineSel,
|
|
10986
10986
|
updates
|
|
10987
10987
|
);
|
|
10988
|
-
|
|
10988
|
+
chunkML36DOIS_js.setPendingSelectionRestore(newSelection);
|
|
10989
10989
|
updateSelectedElement({
|
|
10990
10990
|
textSegments: newSegments2
|
|
10991
10991
|
});
|
|
@@ -11005,12 +11005,12 @@ function useElementOperations(input) {
|
|
|
11005
11005
|
);
|
|
11006
11006
|
const updateSelectedTextCase = React3.useCallback(
|
|
11007
11007
|
(mode) => {
|
|
11008
|
-
if (!selectedElement || !
|
|
11008
|
+
if (!selectedElement || !chunkRPWTP6QP_js.hasTextProperties(selectedElement)) {
|
|
11009
11009
|
return;
|
|
11010
11010
|
}
|
|
11011
|
-
const inlineSel =
|
|
11011
|
+
const inlineSel = chunkML36DOIS_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
11012
11012
|
if (inlineSel && selectedElement.textSegments) {
|
|
11013
|
-
const newSegments =
|
|
11013
|
+
const newSegments = chunkML36DOIS_js.applyCaseTransformToSegments(
|
|
11014
11014
|
selectedElement.textSegments,
|
|
11015
11015
|
inlineSel,
|
|
11016
11016
|
mode
|
|
@@ -11020,14 +11020,14 @@ function useElementOperations(input) {
|
|
|
11020
11020
|
}
|
|
11021
11021
|
const updates = {};
|
|
11022
11022
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
11023
|
-
updates.textSegments =
|
|
11023
|
+
updates.textSegments = chunkML36DOIS_js.applyCaseTransformToSegments(
|
|
11024
11024
|
selectedElement.textSegments,
|
|
11025
11025
|
null,
|
|
11026
11026
|
mode
|
|
11027
11027
|
);
|
|
11028
11028
|
}
|
|
11029
11029
|
if (typeof selectedElement.text === "string") {
|
|
11030
|
-
updates.text =
|
|
11030
|
+
updates.text = chunkML36DOIS_js.transformTextCase(selectedElement.text, mode);
|
|
11031
11031
|
}
|
|
11032
11032
|
updateSelectedElement(updates);
|
|
11033
11033
|
},
|
|
@@ -11082,7 +11082,7 @@ function useSectionOperations(input) {
|
|
|
11082
11082
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
11083
11083
|
const addSection2 = React3.useCallback(
|
|
11084
11084
|
(name, afterSlideIndex) => {
|
|
11085
|
-
const result =
|
|
11085
|
+
const result = chunkML36DOIS_js.addSection(sections, slides, name, afterSlideIndex);
|
|
11086
11086
|
setSlides(result.slides);
|
|
11087
11087
|
setSections(result.sections);
|
|
11088
11088
|
markDirty();
|
|
@@ -11091,7 +11091,7 @@ function useSectionOperations(input) {
|
|
|
11091
11091
|
);
|
|
11092
11092
|
const renameSection2 = React3.useCallback(
|
|
11093
11093
|
(sectionId, newName) => {
|
|
11094
|
-
const result =
|
|
11094
|
+
const result = chunkML36DOIS_js.renameSection(sections, slides, sectionId, newName);
|
|
11095
11095
|
setSections(result.sections);
|
|
11096
11096
|
setSlides(result.slides);
|
|
11097
11097
|
markDirty();
|
|
@@ -11100,7 +11100,7 @@ function useSectionOperations(input) {
|
|
|
11100
11100
|
);
|
|
11101
11101
|
const deleteSection2 = React3.useCallback(
|
|
11102
11102
|
(sectionId) => {
|
|
11103
|
-
const result =
|
|
11103
|
+
const result = chunkML36DOIS_js.deleteSection(sections, slides, sectionId);
|
|
11104
11104
|
setSections(result.sections);
|
|
11105
11105
|
setSlides(result.slides);
|
|
11106
11106
|
markDirty();
|
|
@@ -11109,21 +11109,21 @@ function useSectionOperations(input) {
|
|
|
11109
11109
|
);
|
|
11110
11110
|
const moveSectionUp2 = React3.useCallback(
|
|
11111
11111
|
(sectionId) => {
|
|
11112
|
-
setSections(
|
|
11112
|
+
setSections(chunkML36DOIS_js.moveSectionUp(sections, sectionId));
|
|
11113
11113
|
markDirty();
|
|
11114
11114
|
},
|
|
11115
11115
|
[sections, setSections, markDirty]
|
|
11116
11116
|
);
|
|
11117
11117
|
const moveSectionDown2 = React3.useCallback(
|
|
11118
11118
|
(sectionId) => {
|
|
11119
|
-
setSections(
|
|
11119
|
+
setSections(chunkML36DOIS_js.moveSectionDown(sections, sectionId));
|
|
11120
11120
|
markDirty();
|
|
11121
11121
|
},
|
|
11122
11122
|
[sections, setSections, markDirty]
|
|
11123
11123
|
);
|
|
11124
11124
|
const moveSlidesToSection2 = React3.useCallback(
|
|
11125
11125
|
(slideIndexes, targetSectionId) => {
|
|
11126
|
-
const result =
|
|
11126
|
+
const result = chunkML36DOIS_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
11127
11127
|
setSlides(result.slides);
|
|
11128
11128
|
setSections(result.sections);
|
|
11129
11129
|
markDirty();
|
|
@@ -11142,7 +11142,7 @@ function useSectionOperations(input) {
|
|
|
11142
11142
|
|
|
11143
11143
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
11144
11144
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
11145
|
-
const resized =
|
|
11145
|
+
const resized = chunkML36DOIS_js.applyResize(
|
|
11146
11146
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
11147
11147
|
handle,
|
|
11148
11148
|
dx,
|
|
@@ -11154,7 +11154,7 @@ function computeResizeGeometry(handle, startX, startY, startWidth, startHeight,
|
|
|
11154
11154
|
if (!snapToGrid) {
|
|
11155
11155
|
return box;
|
|
11156
11156
|
}
|
|
11157
|
-
return
|
|
11157
|
+
return chunkML36DOIS_js.snapBoxToGrid(box, handle, gridSpacingPx, MIN_ELEMENT_SIZE);
|
|
11158
11158
|
}
|
|
11159
11159
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
11160
11160
|
const range = startWidth || 200;
|
|
@@ -11264,7 +11264,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
11264
11264
|
width: el.width,
|
|
11265
11265
|
height: el.height
|
|
11266
11266
|
}));
|
|
11267
|
-
const snapResult =
|
|
11267
|
+
const snapResult = chunkML36DOIS_js.computeSnapToShape(
|
|
11268
11268
|
targetX,
|
|
11269
11269
|
targetY,
|
|
11270
11270
|
primaryEl.width,
|
|
@@ -11407,13 +11407,13 @@ function processPointerUp(input) {
|
|
|
11407
11407
|
if (i !== activeSlideIndex) {
|
|
11408
11408
|
return s;
|
|
11409
11409
|
}
|
|
11410
|
-
const rerouted =
|
|
11410
|
+
const rerouted = chunkML36DOIS_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
11411
11411
|
if (rerouted.length === 0) {
|
|
11412
11412
|
return s;
|
|
11413
11413
|
}
|
|
11414
11414
|
return {
|
|
11415
11415
|
...s,
|
|
11416
|
-
elements:
|
|
11416
|
+
elements: chunkML36DOIS_js.applyReroutedConnectors(s.elements, rerouted)
|
|
11417
11417
|
};
|
|
11418
11418
|
})
|
|
11419
11419
|
);
|
|
@@ -11432,9 +11432,9 @@ function processPointerUp(input) {
|
|
|
11432
11432
|
}
|
|
11433
11433
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
11434
11434
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
11435
|
-
const hitIds =
|
|
11435
|
+
const hitIds = chunkML36DOIS_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
11436
11436
|
if (marquee.additive) {
|
|
11437
|
-
const merged =
|
|
11437
|
+
const merged = chunkML36DOIS_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
11438
11438
|
if (merged.length > 0) {
|
|
11439
11439
|
applySelection(merged[0], merged);
|
|
11440
11440
|
} else {
|
|
@@ -11457,8 +11457,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
11457
11457
|
}
|
|
11458
11458
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
11459
11459
|
});
|
|
11460
|
-
const rerouted =
|
|
11461
|
-
return
|
|
11460
|
+
const rerouted = chunkML36DOIS_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
11461
|
+
return chunkML36DOIS_js.applyReroutedConnectors(movedElements, rerouted);
|
|
11462
11462
|
};
|
|
11463
11463
|
if (editTemplateMode) {
|
|
11464
11464
|
const slideId = activeSlide?.id;
|
|
@@ -11609,9 +11609,9 @@ function useCanvasInteractions(input) {
|
|
|
11609
11609
|
return;
|
|
11610
11610
|
}
|
|
11611
11611
|
const el = elementLookup.get(editId);
|
|
11612
|
-
if (el &&
|
|
11612
|
+
if (el && chunkRPWTP6QP_js.hasTextProperties(el)) {
|
|
11613
11613
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
11614
|
-
const newSegments =
|
|
11614
|
+
const newSegments = chunkML36DOIS_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
11615
11615
|
ops.updateElementById(editId, {
|
|
11616
11616
|
text: committedText,
|
|
11617
11617
|
textSegments: newSegments
|
|
@@ -11622,7 +11622,7 @@ function useCanvasInteractions(input) {
|
|
|
11622
11622
|
setInlineEditingText("");
|
|
11623
11623
|
};
|
|
11624
11624
|
const openEquationEditorForElement = (el) => {
|
|
11625
|
-
if (!
|
|
11625
|
+
if (!chunkRPWTP6QP_js.hasTextProperties(el)) {
|
|
11626
11626
|
return false;
|
|
11627
11627
|
}
|
|
11628
11628
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -11651,7 +11651,7 @@ function useCanvasInteractions(input) {
|
|
|
11651
11651
|
justSelectedRef.current = false;
|
|
11652
11652
|
} else {
|
|
11653
11653
|
const el = elementLookup.get(elementId);
|
|
11654
|
-
if (el &&
|
|
11654
|
+
if (el && chunkRPWTP6QP_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
11655
11655
|
if (!openEquationEditorForElement(el)) {
|
|
11656
11656
|
setInlineEditingElementId(elementId);
|
|
11657
11657
|
setInlineEditingText(el.text ?? "");
|
|
@@ -11670,7 +11670,7 @@ function useCanvasInteractions(input) {
|
|
|
11670
11670
|
if (openEquationEditorForElement(el)) {
|
|
11671
11671
|
return;
|
|
11672
11672
|
}
|
|
11673
|
-
if (
|
|
11673
|
+
if (chunkRPWTP6QP_js.hasTextProperties(el)) {
|
|
11674
11674
|
setInlineEditingElementId(elementId);
|
|
11675
11675
|
setInlineEditingText(el.text ?? "");
|
|
11676
11676
|
}
|
|
@@ -11860,7 +11860,7 @@ function createFileHandlers(deps) {
|
|
|
11860
11860
|
h = Math.round(h * scale);
|
|
11861
11861
|
}
|
|
11862
11862
|
addElement({
|
|
11863
|
-
id:
|
|
11863
|
+
id: chunkML36DOIS_js.generateElementId(),
|
|
11864
11864
|
type: "image",
|
|
11865
11865
|
x: Math.round((canvasSize.width - w) / 2),
|
|
11866
11866
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -11871,7 +11871,7 @@ function createFileHandlers(deps) {
|
|
|
11871
11871
|
};
|
|
11872
11872
|
img.onerror = () => {
|
|
11873
11873
|
addElement({
|
|
11874
|
-
id:
|
|
11874
|
+
id: chunkML36DOIS_js.generateElementId(),
|
|
11875
11875
|
type: "image",
|
|
11876
11876
|
x: 100,
|
|
11877
11877
|
y: 100,
|
|
@@ -11897,7 +11897,7 @@ function createFileHandlers(deps) {
|
|
|
11897
11897
|
const elFilePath = file.path;
|
|
11898
11898
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
11899
11899
|
addElement({
|
|
11900
|
-
id:
|
|
11900
|
+
id: chunkML36DOIS_js.generateElementId(),
|
|
11901
11901
|
type: "media",
|
|
11902
11902
|
mediaType,
|
|
11903
11903
|
mediaMimeType: file.type || void 0,
|
|
@@ -12072,13 +12072,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
12072
12072
|
return;
|
|
12073
12073
|
}
|
|
12074
12074
|
addElement({
|
|
12075
|
-
id:
|
|
12075
|
+
id: chunkML36DOIS_js.generateElementId(),
|
|
12076
12076
|
type: "smartArt",
|
|
12077
12077
|
x: 100,
|
|
12078
12078
|
y: 120,
|
|
12079
12079
|
width: 600,
|
|
12080
12080
|
height: 340,
|
|
12081
|
-
smartArtData:
|
|
12081
|
+
smartArtData: chunkML36DOIS_js.buildSmartArtPresetData(
|
|
12082
12082
|
layout,
|
|
12083
12083
|
defaultItems,
|
|
12084
12084
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -12090,7 +12090,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12090
12090
|
return;
|
|
12091
12091
|
}
|
|
12092
12092
|
addElement({
|
|
12093
|
-
id:
|
|
12093
|
+
id: chunkML36DOIS_js.generateElementId(),
|
|
12094
12094
|
type: "shape",
|
|
12095
12095
|
x: 120,
|
|
12096
12096
|
y: 200,
|
|
@@ -12149,7 +12149,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12149
12149
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
12150
12150
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
12151
12151
|
addElement({
|
|
12152
|
-
id:
|
|
12152
|
+
id: chunkML36DOIS_js.generateElementId(),
|
|
12153
12153
|
type: "shape",
|
|
12154
12154
|
x: 120,
|
|
12155
12155
|
y: 200,
|
|
@@ -12171,11 +12171,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
12171
12171
|
if (!activeSlide) {
|
|
12172
12172
|
return;
|
|
12173
12173
|
}
|
|
12174
|
-
const preset =
|
|
12174
|
+
const preset = chunkML36DOIS_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
12175
12175
|
if (!preset) {
|
|
12176
12176
|
return;
|
|
12177
12177
|
}
|
|
12178
|
-
const defaultPptxAction =
|
|
12178
|
+
const defaultPptxAction = chunkRPWTP6QP_js.elementActionToPptxAction({
|
|
12179
12179
|
trigger: "click",
|
|
12180
12180
|
type: preset.defaultAction
|
|
12181
12181
|
});
|
|
@@ -12184,7 +12184,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12184
12184
|
defaultPptxAction.highlightClick = true;
|
|
12185
12185
|
}
|
|
12186
12186
|
addElement({
|
|
12187
|
-
id:
|
|
12187
|
+
id: chunkML36DOIS_js.generateElementId(),
|
|
12188
12188
|
type: "shape",
|
|
12189
12189
|
x: 150,
|
|
12190
12190
|
y: 150,
|
|
@@ -12251,7 +12251,7 @@ function useInsertElements(input) {
|
|
|
12251
12251
|
return;
|
|
12252
12252
|
}
|
|
12253
12253
|
addElement({
|
|
12254
|
-
id:
|
|
12254
|
+
id: chunkML36DOIS_js.generateElementId(),
|
|
12255
12255
|
type: "text",
|
|
12256
12256
|
x: 100,
|
|
12257
12257
|
y: 100,
|
|
@@ -12266,7 +12266,7 @@ function useInsertElements(input) {
|
|
|
12266
12266
|
return;
|
|
12267
12267
|
}
|
|
12268
12268
|
addElement({
|
|
12269
|
-
id:
|
|
12269
|
+
id: chunkML36DOIS_js.generateElementId(),
|
|
12270
12270
|
type: "shape",
|
|
12271
12271
|
x: 150,
|
|
12272
12272
|
y: 150,
|
|
@@ -12285,15 +12285,15 @@ function useInsertElements(input) {
|
|
|
12285
12285
|
return;
|
|
12286
12286
|
}
|
|
12287
12287
|
addElement({
|
|
12288
|
-
...
|
|
12289
|
-
id:
|
|
12288
|
+
...chunkML36DOIS_js.newTableElement(DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
12289
|
+
id: chunkML36DOIS_js.generateElementId()
|
|
12290
12290
|
});
|
|
12291
12291
|
};
|
|
12292
12292
|
const handleAddChart = (chartType) => {
|
|
12293
12293
|
if (!activeSlide) {
|
|
12294
12294
|
return;
|
|
12295
12295
|
}
|
|
12296
|
-
addElement(
|
|
12296
|
+
addElement(chunkML36DOIS_js.createDefaultChartElement(chartType));
|
|
12297
12297
|
};
|
|
12298
12298
|
const structured = createStructuredElementHandlers({
|
|
12299
12299
|
activeSlide,
|
|
@@ -12363,7 +12363,7 @@ function useClipboardHandlers(input) {
|
|
|
12363
12363
|
if (!selectedElement) {
|
|
12364
12364
|
return;
|
|
12365
12365
|
}
|
|
12366
|
-
setClipboardPayload(
|
|
12366
|
+
setClipboardPayload(chunkML36DOIS_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
12367
12367
|
};
|
|
12368
12368
|
const handleDelete = () => {
|
|
12369
12369
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -12380,7 +12380,7 @@ function useClipboardHandlers(input) {
|
|
|
12380
12380
|
handleDelete();
|
|
12381
12381
|
};
|
|
12382
12382
|
const insertClone = (source) => {
|
|
12383
|
-
const clone =
|
|
12383
|
+
const clone = chunkML36DOIS_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
12384
12384
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
12385
12385
|
ops.applySelection(clone.id);
|
|
12386
12386
|
history.markDirty();
|
|
@@ -12415,7 +12415,7 @@ function resolveShapePath(el) {
|
|
|
12415
12415
|
return el.pathData;
|
|
12416
12416
|
}
|
|
12417
12417
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
12418
|
-
const clipPath =
|
|
12418
|
+
const clipPath = chunkRPWTP6QP_js.getPresetShapeClipPath(el.shapeType);
|
|
12419
12419
|
if (clipPath) {
|
|
12420
12420
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
12421
12421
|
if (svgPath) {
|
|
@@ -12466,7 +12466,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
12466
12466
|
return parts.join(" ");
|
|
12467
12467
|
}
|
|
12468
12468
|
function transformPathToGlobal(pathData, el) {
|
|
12469
|
-
const polys =
|
|
12469
|
+
const polys = chunkRPWTP6QP_js.svgPathToPolygons(pathData);
|
|
12470
12470
|
if (polys.length === 0) {
|
|
12471
12471
|
return pathData;
|
|
12472
12472
|
}
|
|
@@ -12486,10 +12486,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
12486
12486
|
y: pt.y * scaleY + el.y
|
|
12487
12487
|
}))
|
|
12488
12488
|
);
|
|
12489
|
-
return
|
|
12489
|
+
return chunkRPWTP6QP_js.polygonsToSvgPath(transformed);
|
|
12490
12490
|
}
|
|
12491
12491
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
12492
|
-
const polys =
|
|
12492
|
+
const polys = chunkRPWTP6QP_js.svgPathToPolygons(pathData);
|
|
12493
12493
|
if (polys.length === 0) {
|
|
12494
12494
|
return pathData;
|
|
12495
12495
|
}
|
|
@@ -12499,10 +12499,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
12499
12499
|
y: pt.y - y
|
|
12500
12500
|
}))
|
|
12501
12501
|
);
|
|
12502
|
-
return
|
|
12502
|
+
return chunkRPWTP6QP_js.polygonsToSvgPath(transformed);
|
|
12503
12503
|
}
|
|
12504
12504
|
function pathBounds(pathData) {
|
|
12505
|
-
const polys =
|
|
12505
|
+
const polys = chunkRPWTP6QP_js.svgPathToPolygons(pathData);
|
|
12506
12506
|
let minX = Infinity;
|
|
12507
12507
|
let minY = Infinity;
|
|
12508
12508
|
let maxX = -Infinity;
|
|
@@ -12561,7 +12561,7 @@ function useMergeShapesHandler(input) {
|
|
|
12561
12561
|
let allFragments = [];
|
|
12562
12562
|
let remaining = globalPaths[0];
|
|
12563
12563
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
12564
|
-
const frags =
|
|
12564
|
+
const frags = chunkRPWTP6QP_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
12565
12565
|
if (Array.isArray(frags)) {
|
|
12566
12566
|
allFragments = frags;
|
|
12567
12567
|
}
|
|
@@ -12590,7 +12590,7 @@ function useMergeShapesHandler(input) {
|
|
|
12590
12590
|
bounds.height
|
|
12591
12591
|
);
|
|
12592
12592
|
const newEl = {
|
|
12593
|
-
id:
|
|
12593
|
+
id: chunkML36DOIS_js.generateElementId(),
|
|
12594
12594
|
type: "shape",
|
|
12595
12595
|
x: bounds.x,
|
|
12596
12596
|
y: bounds.y,
|
|
@@ -12628,7 +12628,7 @@ function useMergeShapesHandler(input) {
|
|
|
12628
12628
|
} else {
|
|
12629
12629
|
let resultPath = globalPaths[0];
|
|
12630
12630
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
12631
|
-
const result =
|
|
12631
|
+
const result = chunkRPWTP6QP_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
12632
12632
|
if (typeof result === "string") {
|
|
12633
12633
|
resultPath = result;
|
|
12634
12634
|
}
|
|
@@ -12649,7 +12649,7 @@ function useMergeShapesHandler(input) {
|
|
|
12649
12649
|
);
|
|
12650
12650
|
const primary = targets[0];
|
|
12651
12651
|
const newEl = {
|
|
12652
|
-
id:
|
|
12652
|
+
id: chunkML36DOIS_js.generateElementId(),
|
|
12653
12653
|
type: "shape",
|
|
12654
12654
|
x: bounds.x,
|
|
12655
12655
|
y: bounds.y,
|
|
@@ -12712,7 +12712,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
12712
12712
|
if (ids.length < 2 || !activeSlide) {
|
|
12713
12713
|
return;
|
|
12714
12714
|
}
|
|
12715
|
-
const { elements, groupId } =
|
|
12715
|
+
const { elements, groupId } = chunkML36DOIS_js.groupElements(ops.activeElements, ids, chunkML36DOIS_js.generateElementId());
|
|
12716
12716
|
if (groupId === null) {
|
|
12717
12717
|
return;
|
|
12718
12718
|
}
|
|
@@ -12725,12 +12725,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
12725
12725
|
return;
|
|
12726
12726
|
}
|
|
12727
12727
|
const group = selectedElement;
|
|
12728
|
-
const intoTemplate =
|
|
12728
|
+
const intoTemplate = chunkML36DOIS_js.isTemplateElementId(group.id);
|
|
12729
12729
|
const ungrouped = group.children.map((child) => ({
|
|
12730
12730
|
...structuredClone(child),
|
|
12731
12731
|
// Keep child ids in the same store as the group so later edits route
|
|
12732
12732
|
// correctly: template groups yield template-prefixed child ids.
|
|
12733
|
-
id: intoTemplate ?
|
|
12733
|
+
id: intoTemplate ? chunkML36DOIS_js.makeCloneId(true, child.id || group.id) : child.id || chunkML36DOIS_js.generateElementId(),
|
|
12734
12734
|
x: child.x + group.x,
|
|
12735
12735
|
y: child.y + group.y
|
|
12736
12736
|
}));
|
|
@@ -12754,7 +12754,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
12754
12754
|
if (!edge) {
|
|
12755
12755
|
return;
|
|
12756
12756
|
}
|
|
12757
|
-
const positions =
|
|
12757
|
+
const positions = chunkML36DOIS_js.alignElements(selectedElements, edge);
|
|
12758
12758
|
for (const [id, pos] of positions) {
|
|
12759
12759
|
const el = elementLookup.get(id);
|
|
12760
12760
|
if (!el) {
|
|
@@ -12772,7 +12772,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
12772
12772
|
if (!distAxis) {
|
|
12773
12773
|
return;
|
|
12774
12774
|
}
|
|
12775
|
-
const positions =
|
|
12775
|
+
const positions = chunkML36DOIS_js.distributeElements(selectedElements, distAxis);
|
|
12776
12776
|
for (const [id, pos] of positions) {
|
|
12777
12777
|
const el = elementLookup.get(id);
|
|
12778
12778
|
if (!el) {
|
|
@@ -12789,7 +12789,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
12789
12789
|
}
|
|
12790
12790
|
const id = selectedElement.id;
|
|
12791
12791
|
ops.updateActiveElements(
|
|
12792
|
-
(els) => direction === "forward" ?
|
|
12792
|
+
(els) => direction === "forward" ? chunkML36DOIS_js.bringForward(els, id) : direction === "backward" ? chunkML36DOIS_js.sendBackward(els, id) : els
|
|
12793
12793
|
);
|
|
12794
12794
|
history.markDirty();
|
|
12795
12795
|
};
|
|
@@ -12799,7 +12799,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
12799
12799
|
}
|
|
12800
12800
|
const id = selectedElement.id;
|
|
12801
12801
|
ops.updateActiveElements(
|
|
12802
|
-
(els) => direction === "front" ?
|
|
12802
|
+
(els) => direction === "front" ? chunkML36DOIS_js.bringToFront(els, id) : chunkML36DOIS_js.sendToBack(els, id)
|
|
12803
12803
|
);
|
|
12804
12804
|
history.markDirty();
|
|
12805
12805
|
};
|
|
@@ -12921,7 +12921,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
12921
12921
|
function useSlideManagement(input) {
|
|
12922
12922
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
12923
12923
|
const handleAddSlide = () => {
|
|
12924
|
-
const newSlide =
|
|
12924
|
+
const newSlide = chunkML36DOIS_js.createBlankSlide(slides.length + 1);
|
|
12925
12925
|
ops.updateSlides((prev) => {
|
|
12926
12926
|
const next = [...prev];
|
|
12927
12927
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -12984,7 +12984,7 @@ function useSlideManagement(input) {
|
|
|
12984
12984
|
}
|
|
12985
12985
|
const clone = {
|
|
12986
12986
|
...src,
|
|
12987
|
-
id:
|
|
12987
|
+
id: chunkML36DOIS_js.makeSlideId(),
|
|
12988
12988
|
elements: src.elements.map((el) => ({
|
|
12989
12989
|
...el,
|
|
12990
12990
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -13016,7 +13016,7 @@ function useSlideManagement(input) {
|
|
|
13016
13016
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
13017
13017
|
const insertAt = activeSlideIndex + 1;
|
|
13018
13018
|
const draft = {
|
|
13019
|
-
...
|
|
13019
|
+
...chunkML36DOIS_js.createBlankSlide(slides.length + 1),
|
|
13020
13020
|
layoutPath,
|
|
13021
13021
|
...layoutName ? { layoutName } : {}
|
|
13022
13022
|
};
|
|
@@ -13077,7 +13077,7 @@ function createTableMergeHandlers(input) {
|
|
|
13077
13077
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
13078
13078
|
return;
|
|
13079
13079
|
}
|
|
13080
|
-
const newTableData =
|
|
13080
|
+
const newTableData = chunkML36DOIS_js.mergeCells(
|
|
13081
13081
|
[
|
|
13082
13082
|
{ row: rowIndex, col: columnIndex },
|
|
13083
13083
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -13085,7 +13085,7 @@ function createTableMergeHandlers(input) {
|
|
|
13085
13085
|
td
|
|
13086
13086
|
);
|
|
13087
13087
|
const updates = { tableData: newTableData };
|
|
13088
|
-
const newRawXml =
|
|
13088
|
+
const newRawXml = chunkRPWTP6QP_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13089
13089
|
if (newRawXml) {
|
|
13090
13090
|
updates.rawXml = newRawXml;
|
|
13091
13091
|
}
|
|
@@ -13111,7 +13111,7 @@ function createTableMergeHandlers(input) {
|
|
|
13111
13111
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
13112
13112
|
return;
|
|
13113
13113
|
}
|
|
13114
|
-
const newTableData =
|
|
13114
|
+
const newTableData = chunkML36DOIS_js.mergeCells(
|
|
13115
13115
|
[
|
|
13116
13116
|
{ row: rowIndex, col: columnIndex },
|
|
13117
13117
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -13119,7 +13119,7 @@ function createTableMergeHandlers(input) {
|
|
|
13119
13119
|
td
|
|
13120
13120
|
);
|
|
13121
13121
|
const updates = { tableData: newTableData };
|
|
13122
|
-
const newRawXml =
|
|
13122
|
+
const newRawXml = chunkRPWTP6QP_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13123
13123
|
if (newRawXml) {
|
|
13124
13124
|
updates.rawXml = newRawXml;
|
|
13125
13125
|
}
|
|
@@ -13134,9 +13134,9 @@ function createTableMergeHandlers(input) {
|
|
|
13134
13134
|
return;
|
|
13135
13135
|
}
|
|
13136
13136
|
const td = selectedElement.tableData;
|
|
13137
|
-
const newTableData =
|
|
13137
|
+
const newTableData = chunkML36DOIS_js.mergeCells(ts.selectedCells, td);
|
|
13138
13138
|
const updates = { tableData: newTableData };
|
|
13139
|
-
const newRawXml =
|
|
13139
|
+
const newRawXml = chunkRPWTP6QP_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13140
13140
|
if (newRawXml) {
|
|
13141
13141
|
updates.rawXml = newRawXml;
|
|
13142
13142
|
}
|
|
@@ -13153,9 +13153,9 @@ function createTableMergeHandlers(input) {
|
|
|
13153
13153
|
}
|
|
13154
13154
|
const { rowIndex, columnIndex } = ts;
|
|
13155
13155
|
const td = selectedElement.tableData;
|
|
13156
|
-
const newTableData =
|
|
13156
|
+
const newTableData = chunkML36DOIS_js.splitCell(rowIndex, columnIndex, td);
|
|
13157
13157
|
const updates = { tableData: newTableData };
|
|
13158
|
-
const newRawXml =
|
|
13158
|
+
const newRawXml = chunkRPWTP6QP_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13159
13159
|
if (newRawXml) {
|
|
13160
13160
|
updates.rawXml = newRawXml;
|
|
13161
13161
|
}
|
|
@@ -13199,7 +13199,7 @@ function createTableStructHandlers(input) {
|
|
|
13199
13199
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
13200
13200
|
}
|
|
13201
13201
|
if (el.rawXml) {
|
|
13202
|
-
const newRawXml =
|
|
13202
|
+
const newRawXml = chunkRPWTP6QP_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
13203
13203
|
if (newRawXml) {
|
|
13204
13204
|
updates.rawXml = newRawXml;
|
|
13205
13205
|
}
|
|
@@ -13223,7 +13223,7 @@ function createTableStructHandlers(input) {
|
|
|
13223
13223
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
13224
13224
|
const updates = {};
|
|
13225
13225
|
if (selectedElement.rawXml) {
|
|
13226
|
-
const newRawXml =
|
|
13226
|
+
const newRawXml = chunkRPWTP6QP_js.updateCellTextStyleInRawXml(
|
|
13227
13227
|
selectedElement,
|
|
13228
13228
|
rowIndex,
|
|
13229
13229
|
colIndex,
|
|
@@ -13287,9 +13287,9 @@ function createTableStructHandlers(input) {
|
|
|
13287
13287
|
return;
|
|
13288
13288
|
}
|
|
13289
13289
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
13290
|
-
const newTableData =
|
|
13290
|
+
const newTableData = chunkML36DOIS_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
13291
13291
|
const updates = { tableData: newTableData };
|
|
13292
|
-
const newRawXml =
|
|
13292
|
+
const newRawXml = chunkRPWTP6QP_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13293
13293
|
if (newRawXml) {
|
|
13294
13294
|
updates.rawXml = newRawXml;
|
|
13295
13295
|
}
|
|
@@ -13302,12 +13302,12 @@ function createTableStructHandlers(input) {
|
|
|
13302
13302
|
}
|
|
13303
13303
|
const td = selectedElement.tableData;
|
|
13304
13304
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
13305
|
-
const newTableData =
|
|
13305
|
+
const newTableData = chunkML36DOIS_js.deleteTableRow(td, rowIdx);
|
|
13306
13306
|
if (newTableData === td) {
|
|
13307
13307
|
return;
|
|
13308
13308
|
}
|
|
13309
13309
|
const updates = { tableData: newTableData };
|
|
13310
|
-
const newRawXml =
|
|
13310
|
+
const newRawXml = chunkRPWTP6QP_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13311
13311
|
if (newRawXml) {
|
|
13312
13312
|
updates.rawXml = newRawXml;
|
|
13313
13313
|
}
|
|
@@ -13319,9 +13319,9 @@ function createTableStructHandlers(input) {
|
|
|
13319
13319
|
return;
|
|
13320
13320
|
}
|
|
13321
13321
|
const colIdx = ts?.columnIndex ?? 0;
|
|
13322
|
-
const newTableData =
|
|
13322
|
+
const newTableData = chunkML36DOIS_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
13323
13323
|
const updates = { tableData: newTableData };
|
|
13324
|
-
const newRawXml =
|
|
13324
|
+
const newRawXml = chunkRPWTP6QP_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13325
13325
|
if (newRawXml) {
|
|
13326
13326
|
updates.rawXml = newRawXml;
|
|
13327
13327
|
}
|
|
@@ -13334,12 +13334,12 @@ function createTableStructHandlers(input) {
|
|
|
13334
13334
|
}
|
|
13335
13335
|
const td = selectedElement.tableData;
|
|
13336
13336
|
const colIdx = ts?.columnIndex ?? 0;
|
|
13337
|
-
const newTableData =
|
|
13337
|
+
const newTableData = chunkML36DOIS_js.deleteTableColumn(td, colIdx);
|
|
13338
13338
|
if (newTableData === td) {
|
|
13339
13339
|
return;
|
|
13340
13340
|
}
|
|
13341
13341
|
const updates = { tableData: newTableData };
|
|
13342
|
-
const newRawXml =
|
|
13342
|
+
const newRawXml = chunkRPWTP6QP_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13343
13343
|
if (newRawXml) {
|
|
13344
13344
|
updates.rawXml = newRawXml;
|
|
13345
13345
|
}
|
|
@@ -13375,8 +13375,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
13375
13375
|
return html2canvasPro(element, {
|
|
13376
13376
|
...options,
|
|
13377
13377
|
onclone: async (doc, clonedEl) => {
|
|
13378
|
-
await
|
|
13379
|
-
|
|
13378
|
+
await chunkML36DOIS_js.normalizeColorsForCapture(doc, clonedEl);
|
|
13379
|
+
chunkML36DOIS_js.preprocessCssForCapture(clonedEl);
|
|
13380
13380
|
if (typeof userOnClone === "function") {
|
|
13381
13381
|
userOnClone(doc, clonedEl);
|
|
13382
13382
|
}
|
|
@@ -13432,7 +13432,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
13432
13432
|
}
|
|
13433
13433
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
13434
13434
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
13435
|
-
|
|
13435
|
+
chunkML36DOIS_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
13436
13436
|
}
|
|
13437
13437
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
13438
13438
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -13454,7 +13454,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13454
13454
|
continue;
|
|
13455
13455
|
}
|
|
13456
13456
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
13457
|
-
images.push(
|
|
13457
|
+
images.push(chunkML36DOIS_js.canvasToJpegData(canvas));
|
|
13458
13458
|
}
|
|
13459
13459
|
onProgress?.(totalSlides, totalSlides);
|
|
13460
13460
|
setActiveSlide(currentSlideIndex);
|
|
@@ -13462,7 +13462,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13462
13462
|
throw new Error(chunk2EFVXYNA_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
13463
13463
|
}
|
|
13464
13464
|
const pdfBlobUrl = buildPdfFromImageData(images);
|
|
13465
|
-
|
|
13465
|
+
chunkML36DOIS_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
13466
13466
|
}
|
|
13467
13467
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
13468
13468
|
const { scale = 2, onProgress } = options;
|
|
@@ -13511,7 +13511,7 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
13511
13511
|
throw new Error(chunk2EFVXYNA_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
13512
13512
|
}
|
|
13513
13513
|
const pdfDataUrl = buildNotesPdf(pages);
|
|
13514
|
-
|
|
13514
|
+
chunkML36DOIS_js.downloadDataUrl(pdfDataUrl, filename);
|
|
13515
13515
|
}
|
|
13516
13516
|
|
|
13517
13517
|
// src/viewer/utils/export-video.ts
|
|
@@ -13555,7 +13555,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
13555
13555
|
const fps = 30;
|
|
13556
13556
|
const stream = recordingCanvas.captureStream(fps);
|
|
13557
13557
|
const recorder = new MediaRecorder(stream, {
|
|
13558
|
-
mimeType:
|
|
13558
|
+
mimeType: chunkML36DOIS_js.pickSupportedMimeType([...chunkML36DOIS_js.WEBM_MIME_CANDIDATES]),
|
|
13559
13559
|
videoBitsPerSecond: 5e6
|
|
13560
13560
|
});
|
|
13561
13561
|
const chunks = [];
|
|
@@ -13578,8 +13578,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
13578
13578
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
13579
13579
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
13580
13580
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
13581
|
-
const frameInterval =
|
|
13582
|
-
const framesNeeded =
|
|
13581
|
+
const frameInterval = chunkML36DOIS_js.fpsToFrameIntervalMs(fps);
|
|
13582
|
+
const framesNeeded = chunkML36DOIS_js.segmentFrameCount(duration, fps);
|
|
13583
13583
|
for (let f = 0; f < framesNeeded; f++) {
|
|
13584
13584
|
if (signal?.aborted) {
|
|
13585
13585
|
recorder.stop();
|
|
@@ -13628,7 +13628,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13628
13628
|
if (frames.length === 0) {
|
|
13629
13629
|
throw new Error(chunk2EFVXYNA_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
13630
13630
|
}
|
|
13631
|
-
const gifBytes =
|
|
13631
|
+
const gifBytes = chunkML36DOIS_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
13632
13632
|
onProgress?.(totalSlides, totalSlides);
|
|
13633
13633
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
13634
13634
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -13682,7 +13682,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
13682
13682
|
continue;
|
|
13683
13683
|
}
|
|
13684
13684
|
onProgress?.(processedCount, data.slides.length);
|
|
13685
|
-
let svg =
|
|
13685
|
+
let svg = chunkRPWTP6QP_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
13686
13686
|
if (embedFonts && fontFaces?.length) {
|
|
13687
13687
|
svg = injectFontFaces(svg, fontFaces);
|
|
13688
13688
|
}
|
|
@@ -13742,7 +13742,7 @@ function useExportSaveAs(input) {
|
|
|
13742
13742
|
}
|
|
13743
13743
|
setExportProgress(70);
|
|
13744
13744
|
setExportStatusMessage("Writing README...");
|
|
13745
|
-
const readme =
|
|
13745
|
+
const readme = chunkML36DOIS_js.generatePackageReadme(pptxFilename);
|
|
13746
13746
|
pkgFolder.file("README.txt", readme);
|
|
13747
13747
|
if (abortCtrl.signal.aborted) {
|
|
13748
13748
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -13753,7 +13753,7 @@ function useExportSaveAs(input) {
|
|
|
13753
13753
|
setExportProgress(95);
|
|
13754
13754
|
setExportStatusMessage("Downloading...");
|
|
13755
13755
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
13756
|
-
|
|
13756
|
+
chunkML36DOIS_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
13757
13757
|
setExportProgress(100);
|
|
13758
13758
|
} catch (err) {
|
|
13759
13759
|
if (err.name !== "AbortError") {
|
|
@@ -13776,7 +13776,7 @@ function useExportSaveAs(input) {
|
|
|
13776
13776
|
const blob = new Blob([data], {
|
|
13777
13777
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
13778
13778
|
});
|
|
13779
|
-
|
|
13779
|
+
chunkML36DOIS_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
13780
13780
|
} catch (err) {
|
|
13781
13781
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
13782
13782
|
}
|
|
@@ -13789,7 +13789,7 @@ function useExportSaveAs(input) {
|
|
|
13789
13789
|
const pptxGuides = guides.map((g) => ({
|
|
13790
13790
|
id: g.id,
|
|
13791
13791
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
13792
|
-
positionEmu:
|
|
13792
|
+
positionEmu: chunkRPWTP6QP_js.guidePxToEmu(g.position)
|
|
13793
13793
|
}));
|
|
13794
13794
|
return {
|
|
13795
13795
|
...slide,
|
|
@@ -13853,7 +13853,7 @@ function safeConfirm(message) {
|
|
|
13853
13853
|
}
|
|
13854
13854
|
}
|
|
13855
13855
|
function downloadBlob2(blob, filename) {
|
|
13856
|
-
|
|
13856
|
+
chunkML36DOIS_js.downloadBlob(blob, chunkML36DOIS_js.sanitizeDownloadFilename(filename));
|
|
13857
13857
|
}
|
|
13858
13858
|
|
|
13859
13859
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -13954,21 +13954,21 @@ function useExportHandlers(input) {
|
|
|
13954
13954
|
{
|
|
13955
13955
|
scale: 2,
|
|
13956
13956
|
onProgress: (current, total) => {
|
|
13957
|
-
setExportProgress(
|
|
13958
|
-
setExportStatusMessage(
|
|
13957
|
+
setExportProgress(chunkML36DOIS_js.slideProgressPercent(current, total));
|
|
13958
|
+
setExportStatusMessage(chunkML36DOIS_js.slideStatusLabel("Rendering", current, total));
|
|
13959
13959
|
},
|
|
13960
13960
|
signal: abortCtrl.signal
|
|
13961
13961
|
}
|
|
13962
13962
|
);
|
|
13963
|
-
setExportProgress(
|
|
13963
|
+
setExportProgress(chunkML36DOIS_js.EXPORT_ASSEMBLING_PERCENT);
|
|
13964
13964
|
setExportStatusMessage("Building PDF...");
|
|
13965
13965
|
await new Promise((r) => {
|
|
13966
13966
|
setTimeout(r, 100);
|
|
13967
13967
|
});
|
|
13968
|
-
setExportProgress(
|
|
13968
|
+
setExportProgress(chunkML36DOIS_js.EXPORT_DONE_PERCENT);
|
|
13969
13969
|
setExportStatusMessage("Done!");
|
|
13970
13970
|
} catch (err) {
|
|
13971
|
-
if (!
|
|
13971
|
+
if (!chunkML36DOIS_js.isExportAbortError(err)) {
|
|
13972
13972
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
13973
13973
|
}
|
|
13974
13974
|
} finally {
|
|
@@ -13998,21 +13998,21 @@ function useExportHandlers(input) {
|
|
|
13998
13998
|
{
|
|
13999
13999
|
scale: 2,
|
|
14000
14000
|
onProgress: (current, total) => {
|
|
14001
|
-
setExportProgress(
|
|
14002
|
-
setExportStatusMessage(
|
|
14001
|
+
setExportProgress(chunkML36DOIS_js.slideProgressPercent(current, total));
|
|
14002
|
+
setExportStatusMessage(chunkML36DOIS_js.slideStatusLabel("Rendering", current, total));
|
|
14003
14003
|
},
|
|
14004
14004
|
signal: abortCtrl.signal
|
|
14005
14005
|
}
|
|
14006
14006
|
);
|
|
14007
|
-
setExportProgress(
|
|
14007
|
+
setExportProgress(chunkML36DOIS_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14008
14008
|
setExportStatusMessage("Building PDF...");
|
|
14009
14009
|
await new Promise((r) => {
|
|
14010
14010
|
setTimeout(r, 100);
|
|
14011
14011
|
});
|
|
14012
|
-
setExportProgress(
|
|
14012
|
+
setExportProgress(chunkML36DOIS_js.EXPORT_DONE_PERCENT);
|
|
14013
14013
|
setExportStatusMessage("Done!");
|
|
14014
14014
|
} catch (err) {
|
|
14015
|
-
if (!
|
|
14015
|
+
if (!chunkML36DOIS_js.isExportAbortError(err)) {
|
|
14016
14016
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
14017
14017
|
}
|
|
14018
14018
|
} finally {
|
|
@@ -14053,22 +14053,22 @@ function useExportHandlers(input) {
|
|
|
14053
14053
|
scale: 1,
|
|
14054
14054
|
slideDurationMs: 3e3,
|
|
14055
14055
|
onProgress: (current, total) => {
|
|
14056
|
-
setExportProgress(
|
|
14057
|
-
setExportStatusMessage(
|
|
14056
|
+
setExportProgress(chunkML36DOIS_js.slideProgressPercent(current, total, 45));
|
|
14057
|
+
setExportStatusMessage(chunkML36DOIS_js.slideStatusLabel("Capturing", current, total));
|
|
14058
14058
|
},
|
|
14059
14059
|
onRecordProgress: (current, total) => {
|
|
14060
|
-
setExportProgress(
|
|
14061
|
-
setExportStatusMessage(
|
|
14060
|
+
setExportProgress(chunkML36DOIS_js.recordProgressPercent(current, total));
|
|
14061
|
+
setExportStatusMessage(chunkML36DOIS_js.slideStatusLabel("Recording", current, total));
|
|
14062
14062
|
},
|
|
14063
14063
|
signal: abortCtrl.signal
|
|
14064
14064
|
}
|
|
14065
14065
|
);
|
|
14066
|
-
setExportProgress(
|
|
14066
|
+
setExportProgress(chunkML36DOIS_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14067
14067
|
setExportStatusMessage("Saving file...");
|
|
14068
14068
|
downloadBlob2(blob, "presentation.webm");
|
|
14069
|
-
setExportProgress(
|
|
14069
|
+
setExportProgress(chunkML36DOIS_js.EXPORT_DONE_PERCENT);
|
|
14070
14070
|
} catch (err) {
|
|
14071
|
-
if (!
|
|
14071
|
+
if (!chunkML36DOIS_js.isExportAbortError(err)) {
|
|
14072
14072
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
14073
14073
|
}
|
|
14074
14074
|
} finally {
|
|
@@ -14096,18 +14096,18 @@ function useExportHandlers(input) {
|
|
|
14096
14096
|
scale: 0.5,
|
|
14097
14097
|
slideDurationMs: 2e3,
|
|
14098
14098
|
onProgress: (current, total) => {
|
|
14099
|
-
setExportProgress(
|
|
14100
|
-
setExportStatusMessage(
|
|
14099
|
+
setExportProgress(chunkML36DOIS_js.slideProgressPercent(current, total));
|
|
14100
|
+
setExportStatusMessage(chunkML36DOIS_js.slideStatusLabel("Encoding", current, total));
|
|
14101
14101
|
},
|
|
14102
14102
|
signal: abortCtrl.signal
|
|
14103
14103
|
}
|
|
14104
14104
|
);
|
|
14105
|
-
setExportProgress(
|
|
14105
|
+
setExportProgress(chunkML36DOIS_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14106
14106
|
setExportStatusMessage("Saving file...");
|
|
14107
14107
|
downloadBlob2(blob, "presentation.gif");
|
|
14108
|
-
setExportProgress(
|
|
14108
|
+
setExportProgress(chunkML36DOIS_js.EXPORT_DONE_PERCENT);
|
|
14109
14109
|
} catch (err) {
|
|
14110
|
-
if (!
|
|
14110
|
+
if (!chunkML36DOIS_js.isExportAbortError(err)) {
|
|
14111
14111
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
14112
14112
|
}
|
|
14113
14113
|
} finally {
|
|
@@ -14147,7 +14147,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
14147
14147
|
}
|
|
14148
14148
|
printWindow.document.open();
|
|
14149
14149
|
printWindow.document.write(
|
|
14150
|
-
|
|
14150
|
+
chunkML36DOIS_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
14151
14151
|
);
|
|
14152
14152
|
printWindow.document.close();
|
|
14153
14153
|
printWindow.focus();
|
|
@@ -14208,7 +14208,7 @@ function usePrintHandlers(input) {
|
|
|
14208
14208
|
if (svgs.length === 0) {
|
|
14209
14209
|
return;
|
|
14210
14210
|
}
|
|
14211
|
-
const printDoc =
|
|
14211
|
+
const printDoc = chunkML36DOIS_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
14212
14212
|
title: "Slides (Vector)",
|
|
14213
14213
|
orientation: settings.orientation,
|
|
14214
14214
|
colorFilter
|
|
@@ -14244,7 +14244,7 @@ function usePrintHandlers(input) {
|
|
|
14244
14244
|
if (settings.printWhat === "outline") {
|
|
14245
14245
|
openPrintWindow(
|
|
14246
14246
|
"Outline",
|
|
14247
|
-
`<div class="outline-page">${
|
|
14247
|
+
`<div class="outline-page">${chunkML36DOIS_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
14248
14248
|
settings.orientation,
|
|
14249
14249
|
colorFilter,
|
|
14250
14250
|
settings.frameSlides
|
|
@@ -14269,7 +14269,7 @@ function usePrintHandlers(input) {
|
|
|
14269
14269
|
if (settings.printWhat === "slides") {
|
|
14270
14270
|
openPrintWindow(
|
|
14271
14271
|
"Slides",
|
|
14272
|
-
|
|
14272
|
+
chunkML36DOIS_js.buildSlidesHtml(slideImages, slideIndices),
|
|
14273
14273
|
settings.orientation,
|
|
14274
14274
|
colorFilter,
|
|
14275
14275
|
settings.frameSlides
|
|
@@ -14279,7 +14279,7 @@ function usePrintHandlers(input) {
|
|
|
14279
14279
|
if (settings.printWhat === "notes") {
|
|
14280
14280
|
openPrintWindow(
|
|
14281
14281
|
"Notes Pages",
|
|
14282
|
-
|
|
14282
|
+
chunkML36DOIS_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
14283
14283
|
"portrait",
|
|
14284
14284
|
colorFilter,
|
|
14285
14285
|
settings.frameSlides
|
|
@@ -14290,7 +14290,7 @@ function usePrintHandlers(input) {
|
|
|
14290
14290
|
const spp = settings.slidesPerPage;
|
|
14291
14291
|
openPrintWindow(
|
|
14292
14292
|
`Handout ${spp} per page`,
|
|
14293
|
-
|
|
14293
|
+
chunkML36DOIS_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
14294
14294
|
"portrait",
|
|
14295
14295
|
colorFilter,
|
|
14296
14296
|
settings.frameSlides
|
|
@@ -14454,7 +14454,7 @@ function useThemeSwitching(input) {
|
|
|
14454
14454
|
}
|
|
14455
14455
|
try {
|
|
14456
14456
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
14457
|
-
const newData =
|
|
14457
|
+
const newData = chunkRPWTP6QP_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
14458
14458
|
onDataChange(newData);
|
|
14459
14459
|
onThemeChanged?.(preset);
|
|
14460
14460
|
} catch (error) {
|
|
@@ -14471,7 +14471,7 @@ function useThemeSwitching(input) {
|
|
|
14471
14471
|
}
|
|
14472
14472
|
try {
|
|
14473
14473
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
14474
|
-
const newData =
|
|
14474
|
+
const newData = chunkRPWTP6QP_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
14475
14475
|
onDataChange(newData);
|
|
14476
14476
|
} catch (error) {
|
|
14477
14477
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -14483,12 +14483,12 @@ function useThemeSwitching(input) {
|
|
|
14483
14483
|
if (!data?.theme?.colorScheme) {
|
|
14484
14484
|
return void 0;
|
|
14485
14485
|
}
|
|
14486
|
-
return
|
|
14487
|
-
(p) =>
|
|
14486
|
+
return chunkRPWTP6QP_js.THEME_PRESETS.find(
|
|
14487
|
+
(p) => chunkRPWTP6QP_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
14488
14488
|
);
|
|
14489
14489
|
}, [data?.theme?.colorScheme]);
|
|
14490
14490
|
return {
|
|
14491
|
-
presets:
|
|
14491
|
+
presets: chunkRPWTP6QP_js.THEME_PRESETS,
|
|
14492
14492
|
switchToPreset,
|
|
14493
14493
|
switchToCustom,
|
|
14494
14494
|
currentPreset
|
|
@@ -14563,7 +14563,7 @@ function usePropertyHandlers(input) {
|
|
|
14563
14563
|
}
|
|
14564
14564
|
try {
|
|
14565
14565
|
const ab = await file.arrayBuffer();
|
|
14566
|
-
const h = new
|
|
14566
|
+
const h = new chunkRPWTP6QP_js.PptxHandler();
|
|
14567
14567
|
const other = await h.load(ab);
|
|
14568
14568
|
if (!other) {
|
|
14569
14569
|
return;
|
|
@@ -14573,7 +14573,7 @@ function usePropertyHandlers(input) {
|
|
|
14573
14573
|
width: canvasSize.width,
|
|
14574
14574
|
height: canvasSize.height
|
|
14575
14575
|
};
|
|
14576
|
-
setCompareResult(
|
|
14576
|
+
setCompareResult(chunkML36DOIS_js.comparePresentation(cur, other));
|
|
14577
14577
|
setIsComparePanelOpen(true);
|
|
14578
14578
|
} catch (err) {
|
|
14579
14579
|
console.warn("Compare failed:", err);
|
|
@@ -14590,7 +14590,7 @@ function usePropertyHandlers(input) {
|
|
|
14590
14590
|
if (!diff || diff.status === "unchanged") {
|
|
14591
14591
|
return;
|
|
14592
14592
|
}
|
|
14593
|
-
setSlides((prev) =>
|
|
14593
|
+
setSlides((prev) => chunkML36DOIS_js.applyAcceptSlide(prev, diff));
|
|
14594
14594
|
setIsDirty(true);
|
|
14595
14595
|
},
|
|
14596
14596
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -14601,10 +14601,10 @@ function usePropertyHandlers(input) {
|
|
|
14601
14601
|
if (!compareResult) {
|
|
14602
14602
|
return;
|
|
14603
14603
|
}
|
|
14604
|
-
setSlides((prev) =>
|
|
14604
|
+
setSlides((prev) => chunkML36DOIS_js.applyAcceptAllSlides(prev, compareResult));
|
|
14605
14605
|
setIsDirty(true);
|
|
14606
14606
|
}, [compareResult, setSlides, setIsDirty]);
|
|
14607
|
-
const usedFontFamilies = React3.useMemo(() =>
|
|
14607
|
+
const usedFontFamilies = React3.useMemo(() => chunkML36DOIS_js.collectUsedFonts(slides), [slides]);
|
|
14608
14608
|
return {
|
|
14609
14609
|
handleUpdateNotes,
|
|
14610
14610
|
handleUpdateSlide,
|
|
@@ -14723,7 +14723,7 @@ function useIsMobile(input) {
|
|
|
14723
14723
|
const containerRef = input?.containerRef;
|
|
14724
14724
|
const isTouchDevice = React3.useSyncExternalStore(
|
|
14725
14725
|
subscribeTouchCapability,
|
|
14726
|
-
|
|
14726
|
+
chunkML36DOIS_js.detectTouchDevice,
|
|
14727
14727
|
() => false
|
|
14728
14728
|
// server snapshot
|
|
14729
14729
|
);
|
|
@@ -14739,7 +14739,7 @@ function useIsMobile(input) {
|
|
|
14739
14739
|
}
|
|
14740
14740
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
14741
14741
|
});
|
|
14742
|
-
const [orientation, setOrientation] = React3.useState(
|
|
14742
|
+
const [orientation, setOrientation] = React3.useState(chunkML36DOIS_js.detectOrientation);
|
|
14743
14743
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = React3.useState(false);
|
|
14744
14744
|
const [initialViewportHeight] = React3.useState(
|
|
14745
14745
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -14783,7 +14783,7 @@ function useIsMobile(input) {
|
|
|
14783
14783
|
return;
|
|
14784
14784
|
}
|
|
14785
14785
|
const handleOrientationChange = () => {
|
|
14786
|
-
setOrientation(
|
|
14786
|
+
setOrientation(chunkML36DOIS_js.detectOrientation());
|
|
14787
14787
|
};
|
|
14788
14788
|
if (screen.orientation) {
|
|
14789
14789
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -14813,9 +14813,9 @@ function useIsMobile(input) {
|
|
|
14813
14813
|
window.addEventListener("resize", handleResize);
|
|
14814
14814
|
return () => window.removeEventListener("resize", handleResize);
|
|
14815
14815
|
}, [isTouchDevice, initialViewportHeight]);
|
|
14816
|
-
const isMobile =
|
|
14817
|
-
const isTablet = !isMobile && containerWidth >=
|
|
14818
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
14816
|
+
const isMobile = chunkML36DOIS_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
14817
|
+
const isTablet = !isMobile && containerWidth >= chunkML36DOIS_js.MOBILE_BREAKPOINT && containerWidth < chunkML36DOIS_js.TABLET_BREAKPOINT;
|
|
14818
|
+
const isDesktop = !isMobile && containerWidth >= chunkML36DOIS_js.TABLET_BREAKPOINT;
|
|
14819
14819
|
return {
|
|
14820
14820
|
isMobile,
|
|
14821
14821
|
isTablet,
|
|
@@ -14876,11 +14876,11 @@ function useViewerDialogs(input) {
|
|
|
14876
14876
|
);
|
|
14877
14877
|
const [embedFontsEnabled, setEmbedFontsEnabled] = React3.useState(false);
|
|
14878
14878
|
const [isNarrowViewport, setIsNarrowViewport] = React3.useState(
|
|
14879
|
-
() => typeof window !== "undefined" ?
|
|
14879
|
+
() => typeof window !== "undefined" ? chunkML36DOIS_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
14880
14880
|
);
|
|
14881
14881
|
React3.useEffect(() => {
|
|
14882
14882
|
const handleWindow = () => setIsNarrowViewport(
|
|
14883
|
-
|
|
14883
|
+
chunkML36DOIS_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
14884
14884
|
);
|
|
14885
14885
|
let observer = null;
|
|
14886
14886
|
let raf = 0;
|
|
@@ -14894,12 +14894,12 @@ function useViewerDialogs(input) {
|
|
|
14894
14894
|
const entry = entries[0];
|
|
14895
14895
|
if (entry) {
|
|
14896
14896
|
setIsNarrowViewport(
|
|
14897
|
-
|
|
14897
|
+
chunkML36DOIS_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
14898
14898
|
);
|
|
14899
14899
|
}
|
|
14900
14900
|
});
|
|
14901
14901
|
observer.observe(el);
|
|
14902
|
-
setIsNarrowViewport(
|
|
14902
|
+
setIsNarrowViewport(chunkML36DOIS_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
14903
14903
|
};
|
|
14904
14904
|
attach();
|
|
14905
14905
|
window.addEventListener("resize", handleWindow);
|
|
@@ -15076,7 +15076,7 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
|
15076
15076
|
return slides.map((_, i) => i).filter((i) => !slides[i]?.hidden);
|
|
15077
15077
|
}
|
|
15078
15078
|
function computeSlideSectionGroups(slides, sections) {
|
|
15079
|
-
return
|
|
15079
|
+
return chunkML36DOIS_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
15080
15080
|
id: group.section?.id ?? (sections.length > 0 ? UNGROUPED_SECTION_ID : "default"),
|
|
15081
15081
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
15082
15082
|
slideIndexes: group.slideIndexes,
|
|
@@ -15313,13 +15313,13 @@ function useSerialize(input) {
|
|
|
15313
15313
|
let processedSlide = slide;
|
|
15314
15314
|
if (pendingEditId) {
|
|
15315
15315
|
const updatedElements = slide.elements.map((el) => {
|
|
15316
|
-
if (el.id !== pendingEditId || !
|
|
15316
|
+
if (el.id !== pendingEditId || !chunkRPWTP6QP_js.hasTextProperties(el)) {
|
|
15317
15317
|
return el;
|
|
15318
15318
|
}
|
|
15319
15319
|
return {
|
|
15320
15320
|
...el,
|
|
15321
15321
|
text: pendingEditText,
|
|
15322
|
-
textSegments:
|
|
15322
|
+
textSegments: chunkML36DOIS_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
15323
15323
|
};
|
|
15324
15324
|
});
|
|
15325
15325
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -15332,7 +15332,7 @@ function useSerialize(input) {
|
|
|
15332
15332
|
const pptxGuides = guides.map((g) => ({
|
|
15333
15333
|
id: g.id,
|
|
15334
15334
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
15335
|
-
positionEmu:
|
|
15335
|
+
positionEmu: chunkRPWTP6QP_js.guidePxToEmu(g.position)
|
|
15336
15336
|
}));
|
|
15337
15337
|
return {
|
|
15338
15338
|
...processedSlide,
|
|
@@ -15556,10 +15556,10 @@ function usePresentationSetup(input) {
|
|
|
15556
15556
|
onToggleEraser: () => annotations.setPresentationTool("eraser"),
|
|
15557
15557
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
15558
15558
|
onSaveRehearsalTimings: (timings) => {
|
|
15559
|
-
setSlides((prev) =>
|
|
15559
|
+
setSlides((prev) => chunkML36DOIS_js.applyRehearsalTimings(prev, timings));
|
|
15560
15560
|
history.markDirty();
|
|
15561
15561
|
},
|
|
15562
|
-
loopContinuously:
|
|
15562
|
+
loopContinuously: chunkML36DOIS_js.shouldLoopContinuously(presentationProperties),
|
|
15563
15563
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
15564
15564
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
15565
15565
|
endWithBlackSlide
|
|
@@ -15721,7 +15721,7 @@ function useEditorOperations(input) {
|
|
|
15721
15721
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
15722
15722
|
React3.useEffect(() => {
|
|
15723
15723
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
15724
|
-
copiedFormatRef.current =
|
|
15724
|
+
copiedFormatRef.current = chunkML36DOIS_js.copyFormatFromElement(selectedElement);
|
|
15725
15725
|
} else if (!formatPainterActive) {
|
|
15726
15726
|
copiedFormatRef.current = null;
|
|
15727
15727
|
}
|
|
@@ -15747,12 +15747,12 @@ function useEditorOperations(input) {
|
|
|
15747
15747
|
e.stopPropagation();
|
|
15748
15748
|
const element = elementLookup.get(elementId);
|
|
15749
15749
|
if (element) {
|
|
15750
|
-
const updated =
|
|
15750
|
+
const updated = chunkML36DOIS_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
15751
15751
|
const updates = {};
|
|
15752
|
-
if (
|
|
15752
|
+
if (chunkRPWTP6QP_js.hasShapeProperties(updated)) {
|
|
15753
15753
|
updates.shapeStyle = updated.shapeStyle;
|
|
15754
15754
|
}
|
|
15755
|
-
if (
|
|
15755
|
+
if (chunkRPWTP6QP_js.hasTextProperties(updated)) {
|
|
15756
15756
|
updates.textStyle = updated.textStyle;
|
|
15757
15757
|
}
|
|
15758
15758
|
ops.updateElementById(elementId, updates);
|
|
@@ -15896,7 +15896,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
15896
15896
|
const families = /* @__PURE__ */ new Set();
|
|
15897
15897
|
for (const slide of slides) {
|
|
15898
15898
|
for (const el of slide.elements) {
|
|
15899
|
-
if (
|
|
15899
|
+
if (chunkRPWTP6QP_js.hasTextProperties(el) && el.textSegments) {
|
|
15900
15900
|
for (const seg of el.textSegments) {
|
|
15901
15901
|
if (seg.style.fontFamily) {
|
|
15902
15902
|
families.add(seg.style.fontFamily);
|
|
@@ -16678,7 +16678,7 @@ function useReducedMotion() {
|
|
|
16678
16678
|
}
|
|
16679
16679
|
function useViewerOptions() {
|
|
16680
16680
|
const storeRef = React3.useRef(null);
|
|
16681
|
-
storeRef.current ??=
|
|
16681
|
+
storeRef.current ??= chunkML36DOIS_js.createViewerOptionsStore();
|
|
16682
16682
|
const store = storeRef.current;
|
|
16683
16683
|
const options = React3.useSyncExternalStore(
|
|
16684
16684
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -16687,9 +16687,9 @@ function useViewerOptions() {
|
|
|
16687
16687
|
);
|
|
16688
16688
|
return { optionsStore: store, options };
|
|
16689
16689
|
}
|
|
16690
|
-
var KNOWN_TAB_IDS = new Set(
|
|
16690
|
+
var KNOWN_TAB_IDS = new Set(chunkML36DOIS_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
16691
16691
|
function computeToolbarVisibility(hiddenActions) {
|
|
16692
|
-
const isHidden = (id) =>
|
|
16692
|
+
const isHidden = (id) => chunkML36DOIS_js.isActionHidden(id, hiddenActions);
|
|
16693
16693
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
16694
16694
|
return { isHidden, isTabVisible };
|
|
16695
16695
|
}
|
|
@@ -16706,7 +16706,7 @@ function useYjsProvider({ config }) {
|
|
|
16706
16706
|
const timeoutRef = React3.useRef(null);
|
|
16707
16707
|
const gateRef = React3.useRef(null);
|
|
16708
16708
|
if (!gateRef.current) {
|
|
16709
|
-
gateRef.current =
|
|
16709
|
+
gateRef.current = chunkML36DOIS_js.createSyncGate(() => setSynced(true));
|
|
16710
16710
|
}
|
|
16711
16711
|
const teardown = React3.useCallback(() => {
|
|
16712
16712
|
if (timeoutRef.current) {
|
|
@@ -16744,7 +16744,7 @@ function useYjsProvider({ config }) {
|
|
|
16744
16744
|
if (config.authToken) {
|
|
16745
16745
|
opts.password = config.authToken;
|
|
16746
16746
|
}
|
|
16747
|
-
const provider = new WebrtcProvider(
|
|
16747
|
+
const provider = new WebrtcProvider(chunkML36DOIS_js.validateRoomId(config.roomId), yDoc, opts);
|
|
16748
16748
|
setDoc(yDoc);
|
|
16749
16749
|
setAwareness(provider.awareness);
|
|
16750
16750
|
setClientId(provider.awareness.clientID);
|
|
@@ -16786,13 +16786,13 @@ function useYjsProvider({ config }) {
|
|
|
16786
16786
|
if (!config) {
|
|
16787
16787
|
return;
|
|
16788
16788
|
}
|
|
16789
|
-
const roomId =
|
|
16790
|
-
const transport = config.transport ??
|
|
16789
|
+
const roomId = chunkML36DOIS_js.validateRoomId(config.roomId);
|
|
16790
|
+
const transport = config.transport ?? chunkML36DOIS_js.resolveTransportForServerUrl(config.serverUrl);
|
|
16791
16791
|
if (transport === "webrtc") {
|
|
16792
16792
|
await initWebrtc();
|
|
16793
16793
|
return;
|
|
16794
16794
|
}
|
|
16795
|
-
if (
|
|
16795
|
+
if (chunkML36DOIS_js.isMixedContentBlocked(config.serverUrl)) {
|
|
16796
16796
|
console.warn(
|
|
16797
16797
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
16798
16798
|
);
|
|
@@ -16852,7 +16852,7 @@ function useYjsProvider({ config }) {
|
|
|
16852
16852
|
cleanupRef.current = null;
|
|
16853
16853
|
setStatus("error");
|
|
16854
16854
|
}
|
|
16855
|
-
},
|
|
16855
|
+
}, chunkML36DOIS_js.CONNECTION_TIMEOUT_MS);
|
|
16856
16856
|
}
|
|
16857
16857
|
setDoc(yDoc);
|
|
16858
16858
|
setAwareness(provider.awareness);
|
|
@@ -16925,7 +16925,7 @@ function usePresenceTracking({
|
|
|
16925
16925
|
awareness.setLocalStateField("presence", state);
|
|
16926
16926
|
lastBroadcastRef.current = Date.now();
|
|
16927
16927
|
};
|
|
16928
|
-
if (elapsed >=
|
|
16928
|
+
if (elapsed >= chunkML36DOIS_js.BROADCAST_THROTTLE_MS) {
|
|
16929
16929
|
if (pendingBroadcastRef.current) {
|
|
16930
16930
|
clearTimeout(pendingBroadcastRef.current);
|
|
16931
16931
|
pendingBroadcastRef.current = null;
|
|
@@ -16935,7 +16935,7 @@ function usePresenceTracking({
|
|
|
16935
16935
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
16936
16936
|
pendingBroadcastRef.current = null;
|
|
16937
16937
|
flush();
|
|
16938
|
-
},
|
|
16938
|
+
}, chunkML36DOIS_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
16939
16939
|
}
|
|
16940
16940
|
},
|
|
16941
16941
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -16960,7 +16960,7 @@ function usePresenceTracking({
|
|
|
16960
16960
|
return;
|
|
16961
16961
|
}
|
|
16962
16962
|
const handleChange = () => {
|
|
16963
|
-
const users =
|
|
16963
|
+
const users = chunkML36DOIS_js.derivePresenceList(
|
|
16964
16964
|
awareness.getStates(),
|
|
16965
16965
|
localClientId,
|
|
16966
16966
|
canvasWidth,
|
|
@@ -17008,7 +17008,7 @@ function useCollaborativeState({
|
|
|
17008
17008
|
canvasWidth,
|
|
17009
17009
|
canvasHeight
|
|
17010
17010
|
}) {
|
|
17011
|
-
const userColor =
|
|
17011
|
+
const userColor = chunkML36DOIS_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
17012
17012
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
17013
17013
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
17014
17014
|
awareness,
|
|
@@ -17113,10 +17113,10 @@ function useYjsDocumentSync({
|
|
|
17113
17113
|
return;
|
|
17114
17114
|
}
|
|
17115
17115
|
try {
|
|
17116
|
-
const { PptxHandler: PptxHandler2 } = await import('./dist-
|
|
17116
|
+
const { PptxHandler: PptxHandler2 } = await import('./dist-NR7AZFQW.js');
|
|
17117
17117
|
const handler = new PptxHandler2();
|
|
17118
17118
|
await handler.load(sourceBytes.buffer);
|
|
17119
|
-
const currentSlides =
|
|
17119
|
+
const currentSlides = chunkML36DOIS_js.readSlidesFromYDoc(
|
|
17120
17120
|
doc
|
|
17121
17121
|
);
|
|
17122
17122
|
const slidesToSave = buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
@@ -17134,7 +17134,7 @@ function useYjsDocumentSync({
|
|
|
17134
17134
|
if (!doc || !isConnected) {
|
|
17135
17135
|
return;
|
|
17136
17136
|
}
|
|
17137
|
-
const docSlides =
|
|
17137
|
+
const docSlides = chunkML36DOIS_js.readSlidesFromYDoc(
|
|
17138
17138
|
doc
|
|
17139
17139
|
);
|
|
17140
17140
|
if (docSlides.length === 0) {
|
|
@@ -17158,11 +17158,11 @@ function useYjsDocumentSync({
|
|
|
17158
17158
|
lastSyncedRef.current = serialized;
|
|
17159
17159
|
void (async () => {
|
|
17160
17160
|
const factories = await getFactories();
|
|
17161
|
-
|
|
17161
|
+
chunkML36DOIS_js.reconcileSlidesInYDoc(
|
|
17162
17162
|
slides,
|
|
17163
17163
|
doc,
|
|
17164
17164
|
factories,
|
|
17165
|
-
|
|
17165
|
+
chunkML36DOIS_js.LOCAL_SYNC_ORIGIN
|
|
17166
17166
|
);
|
|
17167
17167
|
scheduleWriteBack();
|
|
17168
17168
|
})();
|
|
@@ -17172,10 +17172,10 @@ function useYjsDocumentSync({
|
|
|
17172
17172
|
return;
|
|
17173
17173
|
}
|
|
17174
17174
|
const handleChange = (_events, transaction) => {
|
|
17175
|
-
if (transaction?.origin ===
|
|
17175
|
+
if (transaction?.origin === chunkML36DOIS_js.LOCAL_SYNC_ORIGIN) {
|
|
17176
17176
|
return;
|
|
17177
17177
|
}
|
|
17178
|
-
const remoteSlides =
|
|
17178
|
+
const remoteSlides = chunkML36DOIS_js.readSlidesFromYDoc(
|
|
17179
17179
|
doc
|
|
17180
17180
|
);
|
|
17181
17181
|
if (remoteSlides.length === 0) {
|
|
@@ -17193,7 +17193,7 @@ function useYjsDocumentSync({
|
|
|
17193
17193
|
});
|
|
17194
17194
|
scheduleWriteBack();
|
|
17195
17195
|
};
|
|
17196
|
-
const unobserve =
|
|
17196
|
+
const unobserve = chunkML36DOIS_js.observeYDocSlides(
|
|
17197
17197
|
doc,
|
|
17198
17198
|
handleChange
|
|
17199
17199
|
);
|
|
@@ -17344,7 +17344,7 @@ function useLayoutSwitching(input) {
|
|
|
17344
17344
|
function useVirtualizedSlides({
|
|
17345
17345
|
totalItems,
|
|
17346
17346
|
itemHeight,
|
|
17347
|
-
overscan =
|
|
17347
|
+
overscan = chunkML36DOIS_js.DEFAULT_VIRTUAL_OVERSCAN
|
|
17348
17348
|
}) {
|
|
17349
17349
|
const scrollContainerRef = React3.useRef(null);
|
|
17350
17350
|
const [scrollTop, setScrollTop] = React3.useState(0);
|
|
@@ -17374,7 +17374,7 @@ function useVirtualizedSlides({
|
|
|
17374
17374
|
resizeObserver?.disconnect();
|
|
17375
17375
|
};
|
|
17376
17376
|
}, []);
|
|
17377
|
-
const range =
|
|
17377
|
+
const range = chunkML36DOIS_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
|
|
17378
17378
|
const safeItemHeight = Math.max(itemHeight, 1);
|
|
17379
17379
|
const scrollToIndex = React3.useCallback(
|
|
17380
17380
|
(index, behavior = "smooth") => {
|
|
@@ -17420,7 +17420,7 @@ function useTouchGestures(input) {
|
|
|
17420
17420
|
if (!el || !enabled) {
|
|
17421
17421
|
return;
|
|
17422
17422
|
}
|
|
17423
|
-
const recognizer =
|
|
17423
|
+
const recognizer = chunkML36DOIS_js.createTouchGestureRecognizer({
|
|
17424
17424
|
getScale: () => scaleRef.current,
|
|
17425
17425
|
minScale: MIN_ZOOM_SCALE,
|
|
17426
17426
|
maxScale: MAX_ZOOM_SCALE,
|
|
@@ -17463,7 +17463,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
17463
17463
|
return;
|
|
17464
17464
|
}
|
|
17465
17465
|
const rect = active.getBoundingClientRect();
|
|
17466
|
-
const delta =
|
|
17466
|
+
const delta = chunkML36DOIS_js.computeScrollDelta(
|
|
17467
17467
|
{ top: rect.top, bottom: rect.bottom },
|
|
17468
17468
|
window.innerHeight,
|
|
17469
17469
|
keyboardInset
|
|
@@ -17483,8 +17483,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
17483
17483
|
return;
|
|
17484
17484
|
}
|
|
17485
17485
|
const update = () => {
|
|
17486
|
-
const metrics =
|
|
17487
|
-
const inset = metrics ?
|
|
17486
|
+
const metrics = chunkML36DOIS_js.readViewportMetrics(window);
|
|
17487
|
+
const inset = metrics ? chunkML36DOIS_js.computeKeyboardInset(metrics) : 0;
|
|
17488
17488
|
setKeyboardInset(inset);
|
|
17489
17489
|
if (inset > 0) {
|
|
17490
17490
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -17495,8 +17495,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
17495
17495
|
vv.addEventListener("scroll", update);
|
|
17496
17496
|
const onFocusIn = () => {
|
|
17497
17497
|
window.requestAnimationFrame(() => {
|
|
17498
|
-
const metrics =
|
|
17499
|
-
const inset = metrics ?
|
|
17498
|
+
const metrics = chunkML36DOIS_js.readViewportMetrics(window);
|
|
17499
|
+
const inset = metrics ? chunkML36DOIS_js.computeKeyboardInset(metrics) : 0;
|
|
17500
17500
|
if (inset > 0) {
|
|
17501
17501
|
scrollFocusedIntoView(inset);
|
|
17502
17502
|
}
|
|
@@ -17509,7 +17509,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
17509
17509
|
document.removeEventListener("focusin", onFocusIn);
|
|
17510
17510
|
};
|
|
17511
17511
|
}, [enabled]);
|
|
17512
|
-
return { keyboardInset, isKeyboardOpen:
|
|
17512
|
+
return { keyboardInset, isKeyboardOpen: chunkML36DOIS_js.isKeyboardOpen(keyboardInset) };
|
|
17513
17513
|
}
|
|
17514
17514
|
|
|
17515
17515
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -17564,13 +17564,13 @@ function buildCanvasProps(input) {
|
|
|
17564
17564
|
if (mode === "present") {
|
|
17565
17565
|
presentation.handlePresentationAction(action);
|
|
17566
17566
|
} else if (action.url) {
|
|
17567
|
-
|
|
17567
|
+
chunkML36DOIS_js.safeOpenUrl(action.url);
|
|
17568
17568
|
}
|
|
17569
17569
|
};
|
|
17570
17570
|
const handleHyperlinkClick = (url) => {
|
|
17571
|
-
if (
|
|
17571
|
+
if (chunkML36DOIS_js.isPpactionUrl(url)) {
|
|
17572
17572
|
if (mode === "present") {
|
|
17573
|
-
const parsed =
|
|
17573
|
+
const parsed = chunkML36DOIS_js.parsePpactionUrl(url);
|
|
17574
17574
|
if (parsed) {
|
|
17575
17575
|
presentation.handlePresentationAction({
|
|
17576
17576
|
action: parsed.action,
|
|
@@ -17580,7 +17580,7 @@ function buildCanvasProps(input) {
|
|
|
17580
17580
|
}
|
|
17581
17581
|
return;
|
|
17582
17582
|
}
|
|
17583
|
-
|
|
17583
|
+
chunkML36DOIS_js.safeOpenUrl(url);
|
|
17584
17584
|
};
|
|
17585
17585
|
return {
|
|
17586
17586
|
activeSlide: effectiveSlide,
|
|
@@ -17900,7 +17900,7 @@ function buildToolbarProps(input) {
|
|
|
17900
17900
|
onOpenFile,
|
|
17901
17901
|
onOpenRecentFile,
|
|
17902
17902
|
onCreatePresentation: (templateId) => {
|
|
17903
|
-
s.setSlides(
|
|
17903
|
+
s.setSlides(chunkML36DOIS_js.createBackstagePresentation(templateId));
|
|
17904
17904
|
s.setActiveSlideIndex(0);
|
|
17905
17905
|
s.setSelectedElementId(null);
|
|
17906
17906
|
s.setSelectedElementIds([]);
|
|
@@ -17955,7 +17955,7 @@ function buildToolbarProps(input) {
|
|
|
17955
17955
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
17956
17956
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
17957
17957
|
formatPainterActive: s.formatPainterActive,
|
|
17958
|
-
canActivateFormatPainter:
|
|
17958
|
+
canActivateFormatPainter: chunkML36DOIS_js.hasCopyableFormat(selectedElement),
|
|
17959
17959
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
17960
17960
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
17961
17961
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -18218,7 +18218,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
18218
18218
|
}, [incomingContent]);
|
|
18219
18219
|
const onOpenFile = React3.useCallback(() => {
|
|
18220
18220
|
void (async () => {
|
|
18221
|
-
const picked = await
|
|
18221
|
+
const picked = await chunkML36DOIS_js.openPptxFile();
|
|
18222
18222
|
if (picked) {
|
|
18223
18223
|
setContent(picked.buffer);
|
|
18224
18224
|
}
|
|
@@ -18226,7 +18226,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
18226
18226
|
}, []);
|
|
18227
18227
|
const onOpenRecentFile = React3.useCallback((key) => {
|
|
18228
18228
|
void (async () => {
|
|
18229
|
-
const bytes = await
|
|
18229
|
+
const bytes = await chunkML36DOIS_js.readBackstageRecentFile(key);
|
|
18230
18230
|
if (bytes) {
|
|
18231
18231
|
setContent(bytes);
|
|
18232
18232
|
}
|