pptx-react-viewer 1.18.0 → 1.19.0
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 +6 -0
- package/dist/{Model3DScene-GVWQ6SOM.js → Model3DScene-CQP7JLKK.js} +3 -3
- package/dist/{Model3DScene-GVWQ6SOM.js.br → Model3DScene-CQP7JLKK.js.br} +0 -0
- package/dist/Model3DScene-CQP7JLKK.js.gz +0 -0
- package/dist/{Model3DScene-JGVLIDLD.mjs → Model3DScene-J2KBVMEZ.mjs} +2 -2
- package/dist/Model3DScene-J2KBVMEZ.mjs.br +0 -0
- package/dist/Model3DScene-J2KBVMEZ.mjs.gz +0 -0
- package/dist/PowerPointViewer-C4d7SKZf.d.ts.map +1 -1
- package/dist/{SurfaceChart3DScene-DBWSDSKI.mjs → SurfaceChart3DScene-52VUVZSC.mjs} +2 -2
- package/dist/SurfaceChart3DScene-52VUVZSC.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-52VUVZSC.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-ZOTOHOIE.js → SurfaceChart3DScene-U6LVKSKR.js} +3 -3
- package/dist/SurfaceChart3DScene-U6LVKSKR.js.br +0 -0
- package/dist/SurfaceChart3DScene-U6LVKSKR.js.gz +0 -0
- package/dist/{chunk-SBNTEQUA.mjs → chunk-3ZGCM6RC.mjs} +20269 -12232
- package/dist/chunk-3ZGCM6RC.mjs.br +0 -0
- package/dist/chunk-3ZGCM6RC.mjs.gz +0 -0
- package/dist/{chunk-EXDUEXTO.js → chunk-AD3EAEY6.js} +20282 -12231
- package/dist/chunk-AD3EAEY6.js.br +0 -0
- package/dist/chunk-AD3EAEY6.js.gz +0 -0
- package/dist/{chunk-73ST7AC6.js → chunk-DBZLZMED.js} +6795 -6485
- package/dist/chunk-DBZLZMED.js.br +0 -0
- package/dist/chunk-DBZLZMED.js.gz +0 -0
- package/dist/{chunk-HBXPK572.js → chunk-P3T4E6JQ.js} +2969 -743
- package/dist/chunk-P3T4E6JQ.js.br +0 -0
- package/dist/chunk-P3T4E6JQ.js.gz +0 -0
- package/dist/{chunk-HHTZQHKZ.mjs → chunk-R7FTNSSP.mjs} +2922 -719
- package/dist/chunk-R7FTNSSP.mjs.br +0 -0
- package/dist/chunk-R7FTNSSP.mjs.gz +0 -0
- package/dist/{chunk-KMLIWCNL.mjs → chunk-SLJXGFZS.mjs} +5783 -5473
- package/dist/chunk-SLJXGFZS.mjs.br +0 -0
- package/dist/chunk-SLJXGFZS.mjs.gz +0 -0
- package/dist/{chunk-Z4MDCPAY.mjs → chunk-XGTMHQR7.mjs} +26 -731
- package/dist/chunk-XGTMHQR7.mjs.br +0 -0
- package/dist/chunk-XGTMHQR7.mjs.gz +0 -0
- package/dist/{chunk-JDRC3PSY.js → chunk-YF6JD4DO.js} +470 -1186
- package/dist/chunk-YF6JD4DO.js.br +0 -0
- package/dist/chunk-YF6JD4DO.js.gz +0 -0
- package/dist/dist-3YRZ26TL.mjs +2 -0
- package/dist/dist-3YRZ26TL.mjs.br +0 -0
- package/dist/dist-3YRZ26TL.mjs.gz +0 -0
- package/dist/{dist-KRRXYUGI.js → dist-M2P6HBG4.js} +602 -546
- package/dist/dist-M2P6HBG4.js.br +0 -0
- package/dist/dist-M2P6HBG4.js.gz +0 -0
- package/dist/hooks-unstable.d.ts +523 -49
- package/dist/hooks-unstable.d.ts.map +1 -1
- package/dist/hooks-unstable.js +77 -77
- package/dist/hooks-unstable.js.br +0 -0
- package/dist/hooks-unstable.js.gz +0 -0
- package/dist/hooks-unstable.mjs +3 -3
- package/dist/hooks-unstable.mjs.br +0 -0
- package/dist/hooks-unstable.mjs.gz +0 -0
- package/dist/index.d.ts +417 -21
- package/dist/index.js +18 -18
- package/dist/index.js.br +3 -3
- 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/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/viewer/index.d.ts +509 -27
- package/dist/viewer/index.js +20 -20
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +4 -4
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/Model3DScene-GVWQ6SOM.js.gz +0 -0
- package/dist/Model3DScene-JGVLIDLD.mjs.br +0 -0
- package/dist/Model3DScene-JGVLIDLD.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-DBWSDSKI.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-DBWSDSKI.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-ZOTOHOIE.js.br +0 -0
- package/dist/SurfaceChart3DScene-ZOTOHOIE.js.gz +0 -0
- package/dist/chunk-73ST7AC6.js.br +0 -0
- package/dist/chunk-73ST7AC6.js.gz +0 -0
- package/dist/chunk-EXDUEXTO.js.br +0 -0
- package/dist/chunk-EXDUEXTO.js.gz +0 -0
- package/dist/chunk-HBXPK572.js.br +0 -0
- package/dist/chunk-HBXPK572.js.gz +0 -0
- package/dist/chunk-HHTZQHKZ.mjs.br +0 -0
- package/dist/chunk-HHTZQHKZ.mjs.gz +0 -0
- package/dist/chunk-JDRC3PSY.js.br +0 -0
- package/dist/chunk-JDRC3PSY.js.gz +0 -0
- package/dist/chunk-KMLIWCNL.mjs.br +0 -0
- package/dist/chunk-KMLIWCNL.mjs.gz +0 -0
- package/dist/chunk-SBNTEQUA.mjs.br +0 -0
- package/dist/chunk-SBNTEQUA.mjs.gz +0 -0
- package/dist/chunk-Z4MDCPAY.mjs.br +0 -0
- package/dist/chunk-Z4MDCPAY.mjs.gz +0 -0
- package/dist/dist-KRRXYUGI.js.br +0 -0
- package/dist/dist-KRRXYUGI.js.gz +0 -0
- package/dist/dist-N6PAPXK6.mjs +0 -2
- package/dist/dist-N6PAPXK6.mjs.br +0 -0
- package/dist/dist-N6PAPXK6.mjs.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkP3T4E6JQ_js = require('./chunk-P3T4E6JQ.js');
|
|
4
4
|
var chunkAALZCSY4_js = require('./chunk-AALZCSY4.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkAD3EAEY6_js = require('./chunk-AD3EAEY6.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 chunkP3T4E6JQ_js.cloneHistorySnapshot(snapshot);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
// src/viewer/hooks/useEditorHistory.ts
|
|
@@ -66,8 +66,8 @@ function useEditorHistory(input) {
|
|
|
66
66
|
width: canvasSize.width,
|
|
67
67
|
height: canvasSize.height,
|
|
68
68
|
activeSlideIndex,
|
|
69
|
-
slides: slides.map(
|
|
70
|
-
templateElementsBySlideId:
|
|
69
|
+
slides: slides.map(chunkP3T4E6JQ_js.cloneSlide),
|
|
70
|
+
templateElementsBySlideId: chunkP3T4E6JQ_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
71
71
|
...actionLabel ? { actionLabel } : {}
|
|
72
72
|
};
|
|
73
73
|
},
|
|
@@ -80,9 +80,9 @@ function useEditorHistory(input) {
|
|
|
80
80
|
width: snapshot.width,
|
|
81
81
|
height: snapshot.height
|
|
82
82
|
});
|
|
83
|
-
setSlides(snapshot.slides.map(
|
|
83
|
+
setSlides(snapshot.slides.map(chunkP3T4E6JQ_js.cloneSlide));
|
|
84
84
|
setTemplateElementsBySlideId(
|
|
85
|
-
|
|
85
|
+
chunkP3T4E6JQ_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
86
86
|
);
|
|
87
87
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
88
88
|
setSelectedElementIds([]);
|
|
@@ -345,7 +345,7 @@ var GLYPH_COMPONENTS = {
|
|
|
345
345
|
plus: lu.LuPlus,
|
|
346
346
|
triangle: lu.LuTriangle
|
|
347
347
|
};
|
|
348
|
-
var SHAPE_PRESETS =
|
|
348
|
+
var SHAPE_PRESETS = chunkP3T4E6JQ_js.SHAPE_PRESET_DEFS.map(
|
|
349
349
|
(def) => ({
|
|
350
350
|
type: def.type,
|
|
351
351
|
label: def.label,
|
|
@@ -554,30 +554,6 @@ function useZoomViewport({
|
|
|
554
554
|
};
|
|
555
555
|
}
|
|
556
556
|
|
|
557
|
-
// src/viewer/hooks/usePresentationSetup-helpers.ts
|
|
558
|
-
function shouldLoopContinuously(input) {
|
|
559
|
-
return Boolean(input.loopContinuously) || input.showType === "kiosk";
|
|
560
|
-
}
|
|
561
|
-
function applyRehearsalTimings(slides, timings) {
|
|
562
|
-
return slides.map((slide, idx) => {
|
|
563
|
-
const ms = timings[idx];
|
|
564
|
-
if (typeof ms !== "number") {
|
|
565
|
-
return slide;
|
|
566
|
-
}
|
|
567
|
-
return {
|
|
568
|
-
...slide,
|
|
569
|
-
transition: {
|
|
570
|
-
...slide.transition,
|
|
571
|
-
type: slide.transition?.type ?? "none",
|
|
572
|
-
advanceAfterMs: ms
|
|
573
|
-
}
|
|
574
|
-
};
|
|
575
|
-
});
|
|
576
|
-
}
|
|
577
|
-
function computeEntranceAnimationDelay(delayMs, animationIndex) {
|
|
578
|
-
return Math.max(0, delayMs || 0) + animationIndex * 60;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
557
|
// src/viewer/hooks/presentation-mode/animation-helpers.ts
|
|
582
558
|
function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationElementStates, presentationTimersRef) {
|
|
583
559
|
for (const step of group.steps) {
|
|
@@ -685,20 +661,20 @@ function useAnimationPlayback(input) {
|
|
|
685
661
|
for (const anim of nativeAnims) {
|
|
686
662
|
if (anim.buildType && anim.buildType !== "allAtOnce" && anim.targetId) {
|
|
687
663
|
const el = slide.elements.find((e) => e.id === anim.targetId);
|
|
688
|
-
if (el &&
|
|
689
|
-
segmentCounts.set(anim.targetId,
|
|
664
|
+
if (el && chunkAD3EAEY6_js.hasTextProperties(el) && el.textSegments && el.textSegments.length > 0) {
|
|
665
|
+
segmentCounts.set(anim.targetId, chunkP3T4E6JQ_js.countTextSegments(el.textSegments));
|
|
690
666
|
}
|
|
691
667
|
}
|
|
692
668
|
}
|
|
693
|
-
const expandedAnims = segmentCounts.size > 0 ?
|
|
694
|
-
const engine =
|
|
669
|
+
const expandedAnims = segmentCounts.size > 0 ? chunkP3T4E6JQ_js.expandTextBuildAnimations(nativeAnims, segmentCounts) : nativeAnims;
|
|
670
|
+
const engine = chunkP3T4E6JQ_js.TimelineEngine.fromAnimations(expandedAnims);
|
|
695
671
|
timelineEngineRef.current = engine;
|
|
696
672
|
setPresentationKeyframesCss(engine.getTimeline().keyframesCss);
|
|
697
673
|
setInteractiveTriggerShapeIds(engine.getInteractiveTriggerShapeIds());
|
|
698
674
|
setHoverTriggerShapeIds(engine.getHoverTriggerShapeIds());
|
|
699
675
|
const allIds = slide.elements.map((element) => element.id);
|
|
700
676
|
for (const anim of expandedAnims) {
|
|
701
|
-
if (anim.targetId && anim.targetId.includes(
|
|
677
|
+
if (anim.targetId && anim.targetId.includes(chunkP3T4E6JQ_js.TEXT_BUILD_ID_SEP)) {
|
|
702
678
|
allIds.push(anim.targetId);
|
|
703
679
|
}
|
|
704
680
|
}
|
|
@@ -830,7 +806,7 @@ function useAnimationPlayback(input) {
|
|
|
830
806
|
}))
|
|
831
807
|
);
|
|
832
808
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
833
|
-
const delay = computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
809
|
+
const delay = chunkP3T4E6JQ_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
834
810
|
const timer = window.setTimeout(() => {
|
|
835
811
|
setPresentationAnimations(
|
|
836
812
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -887,7 +863,7 @@ function openDb() {
|
|
|
887
863
|
}
|
|
888
864
|
async function storeAudienceContent(content, sessionId) {
|
|
889
865
|
if (sessionId) {
|
|
890
|
-
return
|
|
866
|
+
return chunkP3T4E6JQ_js.storePresentationDeck(sessionId, content);
|
|
891
867
|
}
|
|
892
868
|
const db = await openDb();
|
|
893
869
|
return new Promise((resolve, reject) => {
|
|
@@ -908,7 +884,7 @@ async function storeAudienceContent(content, sessionId) {
|
|
|
908
884
|
}
|
|
909
885
|
async function loadAudienceContent(sessionId) {
|
|
910
886
|
if (sessionId) {
|
|
911
|
-
return
|
|
887
|
+
return chunkP3T4E6JQ_js.loadPresentationDeck(sessionId);
|
|
912
888
|
}
|
|
913
889
|
try {
|
|
914
890
|
const db = await openDb();
|
|
@@ -949,7 +925,7 @@ async function loadAudienceContent(sessionId) {
|
|
|
949
925
|
}
|
|
950
926
|
async function clearAudienceContent(sessionId) {
|
|
951
927
|
if (sessionId) {
|
|
952
|
-
return
|
|
928
|
+
return chunkP3T4E6JQ_js.clearPresentationDeck(sessionId);
|
|
953
929
|
}
|
|
954
930
|
try {
|
|
955
931
|
const db = await openDb();
|
|
@@ -969,12 +945,12 @@ async function clearAudienceContent(sessionId) {
|
|
|
969
945
|
} catch {
|
|
970
946
|
}
|
|
971
947
|
}
|
|
972
|
-
var PRESENTER_CHANNEL_NAME =
|
|
973
|
-
var AUDIENCE_HASH =
|
|
974
|
-
var PRESENTER_MSG_ORIGIN =
|
|
975
|
-
var AUDIENCE_NONCE_KEY =
|
|
948
|
+
var PRESENTER_CHANNEL_NAME = chunkP3T4E6JQ_js.PRESENTATION_CHANNEL_NAME;
|
|
949
|
+
var AUDIENCE_HASH = chunkP3T4E6JQ_js.PRESENTATION_HASH;
|
|
950
|
+
var PRESENTER_MSG_ORIGIN = chunkP3T4E6JQ_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
951
|
+
var AUDIENCE_NONCE_KEY = chunkP3T4E6JQ_js.PRESENTATION_NONCE_KEY;
|
|
976
952
|
function generateSessionId() {
|
|
977
|
-
return
|
|
953
|
+
return chunkP3T4E6JQ_js.createPresentationSessionId();
|
|
978
954
|
}
|
|
979
955
|
function parseAudienceNonce() {
|
|
980
956
|
const hash = window.location.hash;
|
|
@@ -1010,7 +986,7 @@ function usePresenterWindow(input) {
|
|
|
1010
986
|
}, []);
|
|
1011
987
|
const swapDisplays = React3.useCallback(async () => {
|
|
1012
988
|
const audience = audienceWindowRef.current;
|
|
1013
|
-
return audience && !audience.closed ?
|
|
989
|
+
return audience && !audience.closed ? chunkP3T4E6JQ_js.swapPresentationWindows(window, audience) : false;
|
|
1014
990
|
}, []);
|
|
1015
991
|
const syncSlideToAudience = React3.useCallback(
|
|
1016
992
|
(slideIndex) => {
|
|
@@ -1092,10 +1068,10 @@ function usePresenterWindow(input) {
|
|
|
1092
1068
|
audienceWindowRef.current = blankWin;
|
|
1093
1069
|
const sessionId = generateSessionId();
|
|
1094
1070
|
sessionIdRef.current = sessionId;
|
|
1095
|
-
const audienceUrl =
|
|
1096
|
-
void
|
|
1071
|
+
const audienceUrl = chunkP3T4E6JQ_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1072
|
+
void chunkP3T4E6JQ_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1097
1073
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1098
|
-
|
|
1074
|
+
chunkP3T4E6JQ_js.placeAudienceWindow(blankWin, placement);
|
|
1099
1075
|
}
|
|
1100
1076
|
return void 0;
|
|
1101
1077
|
});
|
|
@@ -1151,7 +1127,7 @@ function usePresenterWindow(input) {
|
|
|
1151
1127
|
}
|
|
1152
1128
|
const handleMessage = (event) => {
|
|
1153
1129
|
const message = event.data;
|
|
1154
|
-
if (
|
|
1130
|
+
if (chunkP3T4E6JQ_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1155
1131
|
syncStateToAudience(snapshotRef.current);
|
|
1156
1132
|
}
|
|
1157
1133
|
};
|
|
@@ -1233,7 +1209,7 @@ function useAudienceMode(input) {
|
|
|
1233
1209
|
}
|
|
1234
1210
|
channel.onmessage = (event) => {
|
|
1235
1211
|
const data = event.data;
|
|
1236
|
-
if (!
|
|
1212
|
+
if (!chunkP3T4E6JQ_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1237
1213
|
return;
|
|
1238
1214
|
}
|
|
1239
1215
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1259,7 +1235,7 @@ function useAudienceMode(input) {
|
|
|
1259
1235
|
};
|
|
1260
1236
|
if (expectedSessionId) {
|
|
1261
1237
|
channel.postMessage({
|
|
1262
|
-
origin:
|
|
1238
|
+
origin: chunkP3T4E6JQ_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1263
1239
|
type: "audience-ready",
|
|
1264
1240
|
sessionId: expectedSessionId
|
|
1265
1241
|
});
|
|
@@ -1524,7 +1500,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1524
1500
|
return;
|
|
1525
1501
|
}
|
|
1526
1502
|
if (action.url && !actionStr.includes("hlinksldjump")) {
|
|
1527
|
-
if (
|
|
1503
|
+
if (chunkP3T4E6JQ_js.isUrlSafe(action.url)) {
|
|
1528
1504
|
window.open(action.url, "_blank", "noopener,noreferrer");
|
|
1529
1505
|
}
|
|
1530
1506
|
}
|
|
@@ -1534,7 +1510,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1534
1510
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1535
1511
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1536
1512
|
const transition = incomingSlide?.transition;
|
|
1537
|
-
const durationMs = deps.playTransition ?
|
|
1513
|
+
const durationMs = deps.playTransition ? chunkP3T4E6JQ_js.resolveTransitionDurationMs(transition) : 0;
|
|
1538
1514
|
deps.clearPresentationTimers();
|
|
1539
1515
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1540
1516
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1768,17 +1744,17 @@ function useZoomNavigation(input) {
|
|
|
1768
1744
|
};
|
|
1769
1745
|
}
|
|
1770
1746
|
function usePresenterConsole(slideIndex) {
|
|
1771
|
-
const timerRef = React3.useRef(
|
|
1772
|
-
const [snapshot, setSnapshot] = React3.useState(() =>
|
|
1747
|
+
const timerRef = React3.useRef(chunkP3T4E6JQ_js.createPresenterTimer());
|
|
1748
|
+
const [snapshot, setSnapshot] = React3.useState(() => chunkP3T4E6JQ_js.createInitialPresentationSnapshot(slideIndex));
|
|
1773
1749
|
const patch = React3.useCallback((value) => {
|
|
1774
|
-
setSnapshot((current) =>
|
|
1750
|
+
setSnapshot((current) => chunkP3T4E6JQ_js.mergePresentationSnapshot(current, value));
|
|
1775
1751
|
}, []);
|
|
1776
1752
|
React3.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
1777
1753
|
React3.useEffect(() => {
|
|
1778
1754
|
const timer = window.setInterval(() => {
|
|
1779
1755
|
patch({
|
|
1780
1756
|
paused: timerRef.current.paused,
|
|
1781
|
-
elapsedMs:
|
|
1757
|
+
elapsedMs: chunkP3T4E6JQ_js.presenterElapsed(timerRef.current)
|
|
1782
1758
|
});
|
|
1783
1759
|
}, 1e3);
|
|
1784
1760
|
return () => window.clearInterval(timer);
|
|
@@ -1788,19 +1764,19 @@ function usePresenterConsole(slideIndex) {
|
|
|
1788
1764
|
applyAudienceSnapshot: setSnapshot,
|
|
1789
1765
|
setBlackout: (blackout) => patch({ blackout }),
|
|
1790
1766
|
toggleTimer: () => {
|
|
1791
|
-
timerRef.current =
|
|
1767
|
+
timerRef.current = chunkP3T4E6JQ_js.togglePresenterTimer(timerRef.current);
|
|
1792
1768
|
patch({
|
|
1793
1769
|
paused: timerRef.current.paused,
|
|
1794
|
-
elapsedMs:
|
|
1770
|
+
elapsedMs: chunkP3T4E6JQ_js.presenterElapsed(timerRef.current)
|
|
1795
1771
|
});
|
|
1796
1772
|
},
|
|
1797
1773
|
resetTimer: () => {
|
|
1798
|
-
timerRef.current =
|
|
1774
|
+
timerRef.current = chunkP3T4E6JQ_js.resetPresenterTimer();
|
|
1799
1775
|
patch({ paused: false, elapsedMs: 0 });
|
|
1800
1776
|
},
|
|
1801
1777
|
stepZoom: (direction) => setSnapshot(
|
|
1802
|
-
(current) =>
|
|
1803
|
-
zoom:
|
|
1778
|
+
(current) => chunkP3T4E6JQ_js.mergePresentationSnapshot(current, {
|
|
1779
|
+
zoom: chunkP3T4E6JQ_js.stepPresenterZoom(
|
|
1804
1780
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
1805
1781
|
direction
|
|
1806
1782
|
)
|
|
@@ -2340,7 +2316,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2340
2316
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2341
2317
|
slides.forEach((slide, slideIndex) => {
|
|
2342
2318
|
for (const element of slide.elements || []) {
|
|
2343
|
-
if (!
|
|
2319
|
+
if (!chunkAD3EAEY6_js.hasTextProperties(element)) {
|
|
2344
2320
|
continue;
|
|
2345
2321
|
}
|
|
2346
2322
|
const segments = element.textSegments ?? [];
|
|
@@ -2391,7 +2367,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2391
2367
|
continue;
|
|
2392
2368
|
}
|
|
2393
2369
|
const element = slide.elements[elIdx];
|
|
2394
|
-
if (!
|
|
2370
|
+
if (!chunkAD3EAEY6_js.hasTextProperties(element)) {
|
|
2395
2371
|
continue;
|
|
2396
2372
|
}
|
|
2397
2373
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3316,12 +3292,12 @@ function useViewerState(input) {
|
|
|
3316
3292
|
function partitionTemplateElements(slides) {
|
|
3317
3293
|
const templateElementsBySlideId = {};
|
|
3318
3294
|
const nextSlides = slides.map((slide) => {
|
|
3319
|
-
const template = slide.elements.filter((el) =>
|
|
3295
|
+
const template = slide.elements.filter((el) => chunkP3T4E6JQ_js.isTemplateElement(el));
|
|
3320
3296
|
if (template.length === 0) {
|
|
3321
3297
|
return slide;
|
|
3322
3298
|
}
|
|
3323
3299
|
templateElementsBySlideId[slide.id] = template;
|
|
3324
|
-
return { ...slide, elements: slide.elements.filter((el) => !
|
|
3300
|
+
return { ...slide, elements: slide.elements.filter((el) => !chunkP3T4E6JQ_js.isTemplateElement(el)) };
|
|
3325
3301
|
});
|
|
3326
3302
|
return { slides: nextSlides, templateElementsBySlideId };
|
|
3327
3303
|
}
|
|
@@ -3394,7 +3370,7 @@ function useLoadContent({
|
|
|
3394
3370
|
);
|
|
3395
3371
|
}
|
|
3396
3372
|
const previousHandler = handlerRef.current;
|
|
3397
|
-
const handler = new
|
|
3373
|
+
const handler = new chunkAD3EAEY6_js.PptxHandler();
|
|
3398
3374
|
const parsed = await handler.load(buffer);
|
|
3399
3375
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3400
3376
|
handler.dispose();
|
|
@@ -3406,7 +3382,7 @@ function useLoadContent({
|
|
|
3406
3382
|
handlerRef.current = null;
|
|
3407
3383
|
const mediaElements = [];
|
|
3408
3384
|
for (const slide of parsed.slides) {
|
|
3409
|
-
|
|
3385
|
+
chunkP3T4E6JQ_js.collectMediaElements(slide.elements, mediaElements);
|
|
3410
3386
|
}
|
|
3411
3387
|
for (const url of mediaDataUrls.values()) {
|
|
3412
3388
|
if (url.startsWith("blob:")) {
|
|
@@ -3447,7 +3423,7 @@ function useLoadContent({
|
|
|
3447
3423
|
}
|
|
3448
3424
|
})
|
|
3449
3425
|
);
|
|
3450
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3426
|
+
const { paths: imagePaths, refs: imageRefs } = chunkP3T4E6JQ_js.collectImagePaths(parsed.slides);
|
|
3451
3427
|
let nextSlides = parsed.slides;
|
|
3452
3428
|
if (imagePaths.size > 0) {
|
|
3453
3429
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3536,14 +3512,14 @@ function useLoadContent({
|
|
|
3536
3512
|
setHasMacros(parsed.hasMacros === true);
|
|
3537
3513
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3538
3514
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3539
|
-
setGuides(
|
|
3515
|
+
setGuides(chunkP3T4E6JQ_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3540
3516
|
setActiveSlideIndex(0);
|
|
3541
3517
|
clearSelection();
|
|
3542
3518
|
setIsDirty(false);
|
|
3543
3519
|
history.resetHistory();
|
|
3544
3520
|
} catch (err) {
|
|
3545
3521
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3546
|
-
if (err instanceof
|
|
3522
|
+
if (err instanceof chunkAD3EAEY6_js.EncryptedFileError) {
|
|
3547
3523
|
setIsEncrypted(true);
|
|
3548
3524
|
} else {
|
|
3549
3525
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3620,7 +3596,7 @@ function useAutosave(input) {
|
|
|
3620
3596
|
isSavingRef.current = false;
|
|
3621
3597
|
return;
|
|
3622
3598
|
}
|
|
3623
|
-
await
|
|
3599
|
+
await chunkP3T4E6JQ_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
3624
3600
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
3625
3601
|
} catch (err) {
|
|
3626
3602
|
setAutosaveStatus({
|
|
@@ -3658,7 +3634,7 @@ function useAutosave(input) {
|
|
|
3658
3634
|
|
|
3659
3635
|
// src/viewer/utils/animation-effects.ts
|
|
3660
3636
|
function getAnimationInitialStyle2(preset, nativeAnimation) {
|
|
3661
|
-
return
|
|
3637
|
+
return chunkP3T4E6JQ_js.getAnimationInitialStyle(preset, nativeAnimation);
|
|
3662
3638
|
}
|
|
3663
3639
|
function cn(...inputs) {
|
|
3664
3640
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
@@ -3666,7 +3642,7 @@ function cn(...inputs) {
|
|
|
3666
3642
|
|
|
3667
3643
|
// src/viewer/utils/text-utils.tsx
|
|
3668
3644
|
function getTextStyleForElement(element, fallbackColor) {
|
|
3669
|
-
if (!
|
|
3645
|
+
if (!chunkAD3EAEY6_js.hasTextProperties(element)) {
|
|
3670
3646
|
return { color: fallbackColor };
|
|
3671
3647
|
}
|
|
3672
3648
|
const textDecorationTokens = [];
|
|
@@ -3680,20 +3656,20 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3680
3656
|
const textDecorationStyle = isDoubleStrike ? "double" : void 0;
|
|
3681
3657
|
const hasItalicRuns = element.textStyle?.italic || Boolean(element.textSegments?.some((segment) => segment.style?.italic));
|
|
3682
3658
|
const isRtl = element.textStyle?.rtl === true;
|
|
3683
|
-
const resolvedTextColor = element.textStyle?.hyperlink ?
|
|
3659
|
+
const resolvedTextColor = element.textStyle?.hyperlink ? chunkP3T4E6JQ_js.normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : chunkP3T4E6JQ_js.normalizeHexColor(element.textStyle?.color, fallbackColor);
|
|
3684
3660
|
const bodyTop = element.textStyle?.bodyInsetTop ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3685
3661
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3686
3662
|
const bodyLeft = element.textStyle?.bodyInsetLeft ?? DEFAULT_BODY_INSET_LR_PX;
|
|
3687
3663
|
const bodyRight = element.textStyle?.bodyInsetRight ?? DEFAULT_BODY_INSET_LR_PX;
|
|
3688
|
-
const writingMode =
|
|
3689
|
-
const textOrientation =
|
|
3690
|
-
const verticalDirection =
|
|
3664
|
+
const writingMode = chunkP3T4E6JQ_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
3665
|
+
const textOrientation = chunkP3T4E6JQ_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
3666
|
+
const verticalDirection = chunkP3T4E6JQ_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
3691
3667
|
const resolvedDirection = verticalDirection || (isRtl ? "rtl" : "ltr");
|
|
3692
3668
|
const resolvedUnicodeBidi = isRtl ? "plaintext" : void 0;
|
|
3693
3669
|
const hasSegments = (element.textSegments?.length ?? 0) > 0;
|
|
3694
3670
|
return {
|
|
3695
3671
|
color: resolvedTextColor,
|
|
3696
|
-
backgroundColor: !hasSegments && element.textStyle?.highlightColor ?
|
|
3672
|
+
backgroundColor: !hasSegments && element.textStyle?.highlightColor ? chunkP3T4E6JQ_js.normalizeHexColor(element.textStyle.highlightColor, void 0) : void 0,
|
|
3697
3673
|
textAlign: (() => {
|
|
3698
3674
|
const a = element.textStyle?.align;
|
|
3699
3675
|
if (a === "justLow" || a === "dist" || a === "thaiDist") {
|
|
@@ -3709,7 +3685,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3709
3685
|
textDecorationLine: textDecorationTokens.length > 0 ? textDecorationTokens.join(" ") : "none",
|
|
3710
3686
|
textDecorationStyle,
|
|
3711
3687
|
fontFamily: element.textStyle?.fontFamily || DEFAULT_FONT_FAMILY,
|
|
3712
|
-
lineHeight:
|
|
3688
|
+
lineHeight: chunkP3T4E6JQ_js.resolveLineHeight(element.textStyle, hasItalicRuns),
|
|
3713
3689
|
paddingTop: bodyTop + (hasItalicRuns ? 1 : 0),
|
|
3714
3690
|
paddingBottom: bodyBottom + (hasItalicRuns ? 1 : 0),
|
|
3715
3691
|
paddingLeft: bodyLeft + (element.textStyle?.paragraphMarginLeft || 0),
|
|
@@ -3722,7 +3698,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3722
3698
|
// Auto-fit: use OOXML-provided fontScale/lnSpcReduction when available,
|
|
3723
3699
|
// otherwise fall back to heuristic estimation. The pure font-scale maths
|
|
3724
3700
|
// now lives in pptx-viewer-shared (computeAutoFitTextStyle).
|
|
3725
|
-
...
|
|
3701
|
+
...chunkP3T4E6JQ_js.computeAutoFitTextStyle({
|
|
3726
3702
|
textStyle: element.textStyle,
|
|
3727
3703
|
text: element.text ?? "",
|
|
3728
3704
|
width: element.width,
|
|
@@ -3755,13 +3731,13 @@ function computeTabSize(tabStops) {
|
|
|
3755
3731
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : void 0;
|
|
3756
3732
|
}
|
|
3757
3733
|
function getTextLayoutStyle(element) {
|
|
3758
|
-
if (!
|
|
3734
|
+
if (!chunkAD3EAEY6_js.hasTextProperties(element)) {
|
|
3759
3735
|
return {};
|
|
3760
3736
|
}
|
|
3761
3737
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
3762
|
-
const writingMode =
|
|
3763
|
-
const textOrientation =
|
|
3764
|
-
const verticalDirection =
|
|
3738
|
+
const writingMode = chunkP3T4E6JQ_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
3739
|
+
const textOrientation = chunkP3T4E6JQ_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
3740
|
+
const verticalDirection = chunkP3T4E6JQ_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
3765
3741
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
3766
3742
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
3767
3743
|
const hasColumns = columnCount > 1;
|
|
@@ -3769,7 +3745,7 @@ function getTextLayoutStyle(element) {
|
|
|
3769
3745
|
const tabStops = element.textStyle?.tabStops;
|
|
3770
3746
|
const tabSize = computeTabSize(tabStops);
|
|
3771
3747
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
3772
|
-
const hasParagraphIndents =
|
|
3748
|
+
const hasParagraphIndents = chunkAD3EAEY6_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
3773
3749
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
3774
3750
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
3775
3751
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -3778,7 +3754,7 @@ function getTextLayoutStyle(element) {
|
|
|
3778
3754
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3779
3755
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
3780
3756
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
3781
|
-
const kinsokuStyles =
|
|
3757
|
+
const kinsokuStyles = chunkP3T4E6JQ_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
3782
3758
|
if (hasColumns) {
|
|
3783
3759
|
return {
|
|
3784
3760
|
display: "block",
|
|
@@ -3821,10 +3797,10 @@ function getTextLayoutStyle(element) {
|
|
|
3821
3797
|
|
|
3822
3798
|
// src/viewer/utils/text-effects.tsx
|
|
3823
3799
|
function buildTextFillCss2(style) {
|
|
3824
|
-
return
|
|
3800
|
+
return chunkP3T4E6JQ_js.buildTextFillCss(style);
|
|
3825
3801
|
}
|
|
3826
3802
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
3827
|
-
return
|
|
3803
|
+
return chunkP3T4E6JQ_js.buildTextBody3DSceneStyle(textStyle);
|
|
3828
3804
|
}
|
|
3829
3805
|
|
|
3830
3806
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -4009,17 +3985,17 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
4009
3985
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
4010
3986
|
return renderedSegments;
|
|
4011
3987
|
}
|
|
4012
|
-
const paraKey = `${elementId}${
|
|
3988
|
+
const paraKey = `${elementId}${chunkP3T4E6JQ_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
4013
3989
|
const paraState = subElementAnimStates.get(paraKey);
|
|
4014
3990
|
if (paraState) {
|
|
4015
3991
|
const style = buildAnimStyle(paraState);
|
|
4016
3992
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
4017
3993
|
}
|
|
4018
|
-
const firstWordKey = `${elementId}${
|
|
3994
|
+
const firstWordKey = `${elementId}${chunkP3T4E6JQ_js.TEXT_BUILD_ID_SEP}w${paraIndex}-0`;
|
|
4019
3995
|
if (subElementAnimStates.has(firstWordKey)) {
|
|
4020
3996
|
return wrapByWord(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
4021
3997
|
}
|
|
4022
|
-
const firstCharKey = `${elementId}${
|
|
3998
|
+
const firstCharKey = `${elementId}${chunkP3T4E6JQ_js.TEXT_BUILD_ID_SEP}c${paraIndex}-0`;
|
|
4023
3999
|
if (subElementAnimStates.has(firstCharKey)) {
|
|
4024
4000
|
return wrapByChar(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
4025
4001
|
}
|
|
@@ -4040,7 +4016,7 @@ function wrapByWord(elementId, paraIndex, paraSegments, states) {
|
|
|
4040
4016
|
nodes.push(/* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Fragment, { children: w }, `ws-${i}`));
|
|
4041
4017
|
continue;
|
|
4042
4018
|
}
|
|
4043
|
-
const key = `${elementId}${
|
|
4019
|
+
const key = `${elementId}${chunkP3T4E6JQ_js.TEXT_BUILD_ID_SEP}w${paraIndex}-${wordIdx}`;
|
|
4044
4020
|
const state = states.get(key);
|
|
4045
4021
|
const style = buildAnimStyle(state);
|
|
4046
4022
|
nodes.push(
|
|
@@ -4054,7 +4030,7 @@ function wrapByChar(elementId, paraIndex, paraSegments, states) {
|
|
|
4054
4030
|
const fullText = paraSegments.map((e) => e.segment.text).join("");
|
|
4055
4031
|
const nodes = [];
|
|
4056
4032
|
for (let i = 0; i < fullText.length; i++) {
|
|
4057
|
-
const key = `${elementId}${
|
|
4033
|
+
const key = `${elementId}${chunkP3T4E6JQ_js.TEXT_BUILD_ID_SEP}c${paraIndex}-${i}`;
|
|
4058
4034
|
const state = states.get(key);
|
|
4059
4035
|
const style = buildAnimStyle(state);
|
|
4060
4036
|
nodes.push(
|
|
@@ -4067,10 +4043,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
4067
4043
|
if (!needsScriptFonts || !text) {
|
|
4068
4044
|
return text;
|
|
4069
4045
|
}
|
|
4070
|
-
const runs =
|
|
4046
|
+
const runs = chunkP3T4E6JQ_js.segmentByScript(text);
|
|
4071
4047
|
if (runs.length <= 1) {
|
|
4072
4048
|
if (runs.length === 1) {
|
|
4073
|
-
const font =
|
|
4049
|
+
const font = chunkP3T4E6JQ_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
4074
4050
|
if (font && font !== baseFontFamily) {
|
|
4075
4051
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
4076
4052
|
}
|
|
@@ -4078,7 +4054,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
4078
4054
|
return text;
|
|
4079
4055
|
}
|
|
4080
4056
|
return runs.map((run, i) => {
|
|
4081
|
-
const font =
|
|
4057
|
+
const font = chunkP3T4E6JQ_js.resolveFontForScript(run.script, scriptFonts);
|
|
4082
4058
|
if (!font || font === baseFontFamily) {
|
|
4083
4059
|
return /* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
4084
4060
|
}
|
|
@@ -4152,8 +4128,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
4152
4128
|
);
|
|
4153
4129
|
}
|
|
4154
4130
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
4155
|
-
const mathml =
|
|
4156
|
-
const safeMathml = mathml ?
|
|
4131
|
+
const mathml = chunkP3T4E6JQ_js.convertOmmlToMathMl(equationXml);
|
|
4132
|
+
const safeMathml = mathml ? chunkP3T4E6JQ_js.sanitizeMathMl(mathml) : "";
|
|
4157
4133
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4158
4134
|
"span",
|
|
4159
4135
|
{
|
|
@@ -4203,21 +4179,25 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
4203
4179
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
4204
4180
|
}
|
|
4205
4181
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
4206
|
-
const
|
|
4207
|
-
|
|
4182
|
+
const picture = chunkP3T4E6JQ_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
4183
|
+
sizePx: baseFontSize,
|
|
4184
|
+
fallbackMarker: "\u2022",
|
|
4185
|
+
accessibleLabel: "Bullet"
|
|
4186
|
+
};
|
|
4187
|
+
if (!picture.src) {
|
|
4208
4188
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4209
4189
|
"span",
|
|
4210
4190
|
{
|
|
4211
4191
|
style: {
|
|
4212
|
-
fontSize:
|
|
4192
|
+
fontSize: picture.sizePx,
|
|
4213
4193
|
display: "inline-block",
|
|
4214
4194
|
verticalAlign: "middle",
|
|
4215
4195
|
marginInlineEnd: 4,
|
|
4216
4196
|
color: bulletInfo.color || void 0,
|
|
4217
4197
|
fontFamily: bulletInfo.fontFamily || void 0
|
|
4218
4198
|
},
|
|
4219
|
-
"aria-label":
|
|
4220
|
-
children:
|
|
4199
|
+
"aria-label": picture.accessibleLabel,
|
|
4200
|
+
children: `${picture.fallbackMarker} `
|
|
4221
4201
|
},
|
|
4222
4202
|
`${elementId}-seg-${segmentIndex}-bullet-fallback`
|
|
4223
4203
|
);
|
|
@@ -4225,11 +4205,11 @@ function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize)
|
|
|
4225
4205
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4226
4206
|
"img",
|
|
4227
4207
|
{
|
|
4228
|
-
src:
|
|
4229
|
-
alt:
|
|
4208
|
+
src: picture.src,
|
|
4209
|
+
alt: picture.accessibleLabel,
|
|
4230
4210
|
style: {
|
|
4231
|
-
width:
|
|
4232
|
-
height:
|
|
4211
|
+
width: picture.sizePx,
|
|
4212
|
+
height: picture.sizePx,
|
|
4233
4213
|
display: "inline-block",
|
|
4234
4214
|
verticalAlign: "middle",
|
|
4235
4215
|
marginInlineEnd: 4,
|
|
@@ -4249,7 +4229,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4249
4229
|
);
|
|
4250
4230
|
}
|
|
4251
4231
|
const segmentStyle = segment.style || {};
|
|
4252
|
-
const textValue =
|
|
4232
|
+
const textValue = chunkP3T4E6JQ_js.substituteFieldText(segment.text || "", segment.fieldType, fieldContext);
|
|
4253
4233
|
const lines = textValue.split("\n");
|
|
4254
4234
|
const textDecorationTokens = [];
|
|
4255
4235
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -4259,8 +4239,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4259
4239
|
textDecorationTokens.push("line-through");
|
|
4260
4240
|
}
|
|
4261
4241
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
4262
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
4263
|
-
const underlineDecoration =
|
|
4242
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkP3T4E6JQ_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkP3T4E6JQ_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
4243
|
+
const underlineDecoration = chunkP3T4E6JQ_js.resolveUnderlineDecorationStyle(
|
|
4264
4244
|
Boolean(isDoubleStrike),
|
|
4265
4245
|
segmentStyle.underlineStyle
|
|
4266
4246
|
);
|
|
@@ -4273,14 +4253,14 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4273
4253
|
const autoFitScale = element.textStyle?.autoFitFontScale !== void 0 && element.textStyle.autoFitFontScale > 0 && element.textStyle.autoFitFontScale < 1 ? element.textStyle.autoFitFontScale : 1;
|
|
4274
4254
|
const baseFontSize = rawFontSize * autoFitScale;
|
|
4275
4255
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
4276
|
-
const baseFontFamily = rawFontFamily ?
|
|
4256
|
+
const baseFontFamily = rawFontFamily ? chunkAD3EAEY6_js.getSubstituteFontFamily(rawFontFamily) : DEFAULT_FONT_FAMILY;
|
|
4277
4257
|
const scriptFonts = {
|
|
4278
4258
|
latin: baseFontFamily,
|
|
4279
4259
|
eastAsia: segmentStyle.eastAsiaFont || element.textStyle?.eastAsiaFont || baseFontFamily,
|
|
4280
4260
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
4281
4261
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
4282
4262
|
};
|
|
4283
|
-
const needsScriptFonts =
|
|
4263
|
+
const needsScriptFonts = chunkP3T4E6JQ_js.hasDistinctScriptFonts(scriptFonts);
|
|
4284
4264
|
const spanStyle = {
|
|
4285
4265
|
color: resolvedSegmentColor,
|
|
4286
4266
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -4294,15 +4274,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4294
4274
|
verticalAlign: baselineShift,
|
|
4295
4275
|
letterSpacing,
|
|
4296
4276
|
fontKerning,
|
|
4297
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
4277
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkP3T4E6JQ_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
4298
4278
|
...textFillStyles,
|
|
4299
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
4300
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
4279
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkP3T4E6JQ_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
4280
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkP3T4E6JQ_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
4301
4281
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
4302
|
-
textShadow:
|
|
4303
|
-
filter:
|
|
4304
|
-
opacity:
|
|
4305
|
-
WebkitBoxReflect:
|
|
4282
|
+
textShadow: chunkP3T4E6JQ_js.buildTextShadowCss(segmentStyle),
|
|
4283
|
+
filter: chunkP3T4E6JQ_js.buildTextRunFilterChain(segmentStyle),
|
|
4284
|
+
opacity: chunkP3T4E6JQ_js.getTextAlphaOpacity(segmentStyle),
|
|
4285
|
+
WebkitBoxReflect: chunkP3T4E6JQ_js.buildTextReflectionCss(segmentStyle)
|
|
4306
4286
|
};
|
|
4307
4287
|
const runRtl = segmentStyle.rtl;
|
|
4308
4288
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -4322,7 +4302,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4322
4302
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
4323
4303
|
}
|
|
4324
4304
|
if (bulletInfo.color) {
|
|
4325
|
-
spanStyle.color =
|
|
4305
|
+
spanStyle.color = chunkP3T4E6JQ_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
4326
4306
|
}
|
|
4327
4307
|
}
|
|
4328
4308
|
if (bulletInfo?.imageDataUrl || bulletInfo?.imageRelId) {
|
|
@@ -4354,7 +4334,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4354
4334
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
4355
4335
|
};
|
|
4356
4336
|
if (segment.rubyStyle?.color) {
|
|
4357
|
-
rubyStyle.color =
|
|
4337
|
+
rubyStyle.color = chunkP3T4E6JQ_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
4358
4338
|
}
|
|
4359
4339
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
4360
4340
|
baseContent,
|
|
@@ -4424,7 +4404,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
4424
4404
|
return paragraphs;
|
|
4425
4405
|
}
|
|
4426
4406
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
4427
|
-
if (!
|
|
4407
|
+
if (!chunkAD3EAEY6_js.hasTextProperties(element)) {
|
|
4428
4408
|
return emptyFallback || null;
|
|
4429
4409
|
}
|
|
4430
4410
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -4445,9 +4425,9 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
4445
4425
|
return element.text || emptyFallback || "";
|
|
4446
4426
|
}
|
|
4447
4427
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
4448
|
-
const paragraphIndents =
|
|
4449
|
-
const elementRtl =
|
|
4450
|
-
const elementAlign =
|
|
4428
|
+
const paragraphIndents = chunkAD3EAEY6_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
4429
|
+
const elementRtl = chunkAD3EAEY6_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
4430
|
+
const elementAlign = chunkAD3EAEY6_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
4451
4431
|
return paragraphs.map((paraSegments, paraIndex) => {
|
|
4452
4432
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
4453
4433
|
const rawMarginLeft = typeof paraIndent?.marginLeft === "number" && paraIndent.marginLeft !== 0 ? paraIndent.marginLeft : void 0;
|
|
@@ -4461,14 +4441,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
4461
4441
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
4462
4442
|
});
|
|
4463
4443
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
4464
|
-
const paraRtl =
|
|
4444
|
+
const paraRtl = chunkP3T4E6JQ_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
4465
4445
|
const isRtlParagraph = paraRtl === true;
|
|
4466
|
-
const paraAlign =
|
|
4467
|
-
const cssTextAlign =
|
|
4446
|
+
const paraAlign = chunkP3T4E6JQ_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
4447
|
+
const cssTextAlign = chunkP3T4E6JQ_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
4468
4448
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
4469
4449
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
4470
4450
|
const paraTextIndent = rawTextIndent;
|
|
4471
|
-
const paraKinsokuStyle =
|
|
4451
|
+
const paraKinsokuStyle = chunkP3T4E6JQ_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
4472
4452
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
4473
4453
|
const paraStyle = {
|
|
4474
4454
|
...paraKinsokuStyle
|
|
@@ -4633,15 +4613,12 @@ function isConnectorOrLineElement(element) {
|
|
|
4633
4613
|
if (element.type === "connector") {
|
|
4634
4614
|
return true;
|
|
4635
4615
|
}
|
|
4636
|
-
if (!
|
|
4616
|
+
if (!chunkAD3EAEY6_js.hasShapeProperties(element)) {
|
|
4637
4617
|
return false;
|
|
4638
4618
|
}
|
|
4639
4619
|
const st = getShapeType(element.shapeType);
|
|
4640
4620
|
return st === "connector" || st === "line" || element.shapeType === "line";
|
|
4641
4621
|
}
|
|
4642
|
-
function getDuotoneFilterId(elementId) {
|
|
4643
|
-
return `duotone-${elementId}`;
|
|
4644
|
-
}
|
|
4645
4622
|
function hexToRgbUnit(hex) {
|
|
4646
4623
|
const clean = hex.replace("#", "");
|
|
4647
4624
|
const r = parseInt(clean.substring(0, 2), 16) / 255;
|
|
@@ -4653,58 +4630,14 @@ function hexToRgbUnit(hex) {
|
|
|
4653
4630
|
b: Number.isFinite(b) ? b : 0
|
|
4654
4631
|
};
|
|
4655
4632
|
}
|
|
4656
|
-
function renderDuotoneSvgFilter(elementId, color1, color2) {
|
|
4657
|
-
const filterId = getDuotoneFilterId(elementId);
|
|
4658
|
-
const c1 = hexToRgbUnit(color1);
|
|
4659
|
-
const c2 = hexToRgbUnit(color2);
|
|
4660
|
-
const grayscaleMatrix = [
|
|
4661
|
-
0.2126,
|
|
4662
|
-
0.7152,
|
|
4663
|
-
0.0722,
|
|
4664
|
-
0,
|
|
4665
|
-
0,
|
|
4666
|
-
0.2126,
|
|
4667
|
-
0.7152,
|
|
4668
|
-
0.0722,
|
|
4669
|
-
0,
|
|
4670
|
-
0,
|
|
4671
|
-
0.2126,
|
|
4672
|
-
0.7152,
|
|
4673
|
-
0.0722,
|
|
4674
|
-
0,
|
|
4675
|
-
0,
|
|
4676
|
-
0,
|
|
4677
|
-
0,
|
|
4678
|
-
0,
|
|
4679
|
-
1,
|
|
4680
|
-
0
|
|
4681
|
-
].join(" ");
|
|
4682
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4683
|
-
"svg",
|
|
4684
|
-
{
|
|
4685
|
-
width: 0,
|
|
4686
|
-
height: 0,
|
|
4687
|
-
style: { position: "absolute", overflow: "hidden" },
|
|
4688
|
-
"aria-hidden": "true",
|
|
4689
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("filter", { id: filterId, colorInterpolationFilters: "sRGB", children: [
|
|
4690
|
-
/* @__PURE__ */ jsxRuntime.jsx("feColorMatrix", { type: "matrix", values: grayscaleMatrix }),
|
|
4691
|
-
/* @__PURE__ */ jsxRuntime.jsxs("feComponentTransfer", { children: [
|
|
4692
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncR", { type: "linear", slope: c2.r - c1.r, intercept: c1.r }),
|
|
4693
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncG", { type: "linear", slope: c2.g - c1.g, intercept: c1.g }),
|
|
4694
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncB", { type: "linear", slope: c2.b - c1.b, intercept: c1.b })
|
|
4695
|
-
] })
|
|
4696
|
-
] }) })
|
|
4697
|
-
}
|
|
4698
|
-
);
|
|
4699
|
-
}
|
|
4700
4633
|
function getDuotoneColors(element) {
|
|
4701
|
-
if (!
|
|
4634
|
+
if (!chunkAD3EAEY6_js.isImageLikeElement(element)) {
|
|
4702
4635
|
return void 0;
|
|
4703
4636
|
}
|
|
4704
4637
|
return element.imageEffects?.duotone;
|
|
4705
4638
|
}
|
|
4706
4639
|
function buildLineShadowCss(element) {
|
|
4707
|
-
if (!
|
|
4640
|
+
if (!chunkAD3EAEY6_js.hasShapeProperties(element)) {
|
|
4708
4641
|
return void 0;
|
|
4709
4642
|
}
|
|
4710
4643
|
const ss = element.shapeStyle;
|
|
@@ -4715,13 +4648,13 @@ function buildLineShadowCss(element) {
|
|
|
4715
4648
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
4716
4649
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
4717
4650
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
4718
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
4719
|
-
|
|
4651
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkP3T4E6JQ_js.colorWithOpacity(
|
|
4652
|
+
chunkP3T4E6JQ_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
4720
4653
|
opacity
|
|
4721
4654
|
)}`;
|
|
4722
4655
|
}
|
|
4723
4656
|
function buildLineGlowFilter(element) {
|
|
4724
|
-
if (!
|
|
4657
|
+
if (!chunkAD3EAEY6_js.hasShapeProperties(element)) {
|
|
4725
4658
|
return void 0;
|
|
4726
4659
|
}
|
|
4727
4660
|
const ss = element.shapeStyle;
|
|
@@ -4730,7 +4663,7 @@ function buildLineGlowFilter(element) {
|
|
|
4730
4663
|
}
|
|
4731
4664
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
4732
4665
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
4733
|
-
const glowCol =
|
|
4666
|
+
const glowCol = chunkP3T4E6JQ_js.colorWithOpacity(chunkP3T4E6JQ_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
4734
4667
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
4735
4668
|
}
|
|
4736
4669
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -4750,133 +4683,11 @@ function mapDagBlendModeToCss(blend) {
|
|
|
4750
4683
|
return void 0;
|
|
4751
4684
|
}
|
|
4752
4685
|
}
|
|
4753
|
-
function getImageAlphaFilterId(elementId) {
|
|
4754
|
-
return `imgalpha-${elementId}`;
|
|
4755
|
-
}
|
|
4756
|
-
function hasAdvancedImageAlphaEffects(element) {
|
|
4757
|
-
if (!chunkEXDUEXTO_js.isImageLikeElement(element)) {
|
|
4758
|
-
return false;
|
|
4759
|
-
}
|
|
4760
|
-
const e = element.imageEffects;
|
|
4761
|
-
if (!e) {
|
|
4762
|
-
return false;
|
|
4763
|
-
}
|
|
4764
|
-
return Boolean(
|
|
4765
|
-
typeof e.alphaModFix === "number" || e.alphaInv || e.alphaCeiling || e.alphaFloor || typeof e.alphaRepl === "number" || typeof e.alphaBiLevel === "number" || typeof e.biLevel === "number" || e.lum && (typeof e.lum.bright === "number" || typeof e.lum.contrast === "number") || e.hsl && (typeof e.hsl.sat === "number" || typeof e.hsl.lum === "number") || e.tint && typeof e.tint.amt === "number" || e.clrRepl
|
|
4766
|
-
);
|
|
4767
|
-
}
|
|
4768
|
-
function renderImageAlphaSvgFilter(element) {
|
|
4769
|
-
if (!chunkEXDUEXTO_js.isImageLikeElement(element)) {
|
|
4770
|
-
return null;
|
|
4771
|
-
}
|
|
4772
|
-
const e = element.imageEffects;
|
|
4773
|
-
if (!e || !hasAdvancedImageAlphaEffects(element)) {
|
|
4774
|
-
return null;
|
|
4775
|
-
}
|
|
4776
|
-
const filterId = getImageAlphaFilterId(element.id);
|
|
4777
|
-
const primitives = [];
|
|
4778
|
-
let resultIdx = 0;
|
|
4779
|
-
let inputRef = "SourceGraphic";
|
|
4780
|
-
const next = (jsx42) => {
|
|
4781
|
-
const result = `r${resultIdx++}`;
|
|
4782
|
-
primitives.push(jsx42(inputRef, result));
|
|
4783
|
-
inputRef = result;
|
|
4784
|
-
};
|
|
4785
|
-
if (typeof e.alphaModFix === "number") {
|
|
4786
|
-
const mul = clamp(e.alphaModFix / 100, 0, 1);
|
|
4787
|
-
next((inp, out) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4788
|
-
"feColorMatrix",
|
|
4789
|
-
{
|
|
4790
|
-
in: inp,
|
|
4791
|
-
result: out,
|
|
4792
|
-
type: "matrix",
|
|
4793
|
-
values: `1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 ${mul} 0`
|
|
4794
|
-
},
|
|
4795
|
-
out
|
|
4796
|
-
));
|
|
4797
|
-
}
|
|
4798
|
-
if (e.alphaInv) {
|
|
4799
|
-
next((inp, out) => /* @__PURE__ */ jsxRuntime.jsx("feComponentTransfer", { in: inp, result: out, children: /* @__PURE__ */ jsxRuntime.jsx("feFuncA", { type: "linear", slope: -1, intercept: 1 }) }, out));
|
|
4800
|
-
}
|
|
4801
|
-
if (e.alphaCeiling) {
|
|
4802
|
-
next((inp, out) => /* @__PURE__ */ jsxRuntime.jsx("feComponentTransfer", { in: inp, result: out, children: /* @__PURE__ */ jsxRuntime.jsx("feFuncA", { type: "discrete", tableValues: "0 1 1 1 1 1 1 1 1 1" }) }, out));
|
|
4803
|
-
}
|
|
4804
|
-
if (e.alphaFloor) {
|
|
4805
|
-
next((inp, out) => /* @__PURE__ */ jsxRuntime.jsx("feComponentTransfer", { in: inp, result: out, children: /* @__PURE__ */ jsxRuntime.jsx("feFuncA", { type: "discrete", tableValues: "0 0 0 0 0 0 0 0 0 1" }) }, out));
|
|
4806
|
-
}
|
|
4807
|
-
if (typeof e.alphaRepl === "number") {
|
|
4808
|
-
const a = clamp(e.alphaRepl / 100, 0, 1);
|
|
4809
|
-
next((inp, out) => /* @__PURE__ */ jsxRuntime.jsx("feComponentTransfer", { in: inp, result: out, children: /* @__PURE__ */ jsxRuntime.jsx("feFuncA", { type: "linear", slope: 0, intercept: a }) }, out));
|
|
4810
|
-
}
|
|
4811
|
-
if (typeof e.alphaBiLevel === "number") {
|
|
4812
|
-
const t = clamp(e.alphaBiLevel / 100, 0, 1);
|
|
4813
|
-
const table = Array.from({ length: 10 }, (_, i) => i / 10 >= t ? "1" : "0").join(" ");
|
|
4814
|
-
next((inp, out) => /* @__PURE__ */ jsxRuntime.jsx("feComponentTransfer", { in: inp, result: out, children: /* @__PURE__ */ jsxRuntime.jsx("feFuncA", { type: "discrete", tableValues: table }) }, out));
|
|
4815
|
-
}
|
|
4816
|
-
if (typeof e.biLevel === "number") {
|
|
4817
|
-
next((inp, out) => /* @__PURE__ */ jsxRuntime.jsx("feColorMatrix", { in: inp, result: out, type: "saturate", values: "0" }, out));
|
|
4818
|
-
const t = clamp(e.biLevel / 100, 0, 1);
|
|
4819
|
-
const tbl = t < 0.5 ? "0 1" : "0 1";
|
|
4820
|
-
next((inp, out) => /* @__PURE__ */ jsxRuntime.jsxs("feComponentTransfer", { in: inp, result: out, children: [
|
|
4821
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncR", { type: "discrete", tableValues: tbl }),
|
|
4822
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncG", { type: "discrete", tableValues: tbl }),
|
|
4823
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncB", { type: "discrete", tableValues: tbl })
|
|
4824
|
-
] }, out));
|
|
4825
|
-
}
|
|
4826
|
-
if (e.lum && (typeof e.lum.bright === "number" || typeof e.lum.contrast === "number")) {
|
|
4827
|
-
const b = (e.lum.bright ?? 0) / 100;
|
|
4828
|
-
const c = 1 + (e.lum.contrast ?? 0) / 100;
|
|
4829
|
-
const slope = c;
|
|
4830
|
-
const intercept = b + (1 - c) / 2;
|
|
4831
|
-
next((inp, out) => /* @__PURE__ */ jsxRuntime.jsxs("feComponentTransfer", { in: inp, result: out, children: [
|
|
4832
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncR", { type: "linear", slope, intercept }),
|
|
4833
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncG", { type: "linear", slope, intercept }),
|
|
4834
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncB", { type: "linear", slope, intercept })
|
|
4835
|
-
] }, out));
|
|
4836
|
-
}
|
|
4837
|
-
if (e.hsl && typeof e.hsl.sat === "number") {
|
|
4838
|
-
const v = clamp(1 + e.hsl.sat / 100, 0, 2);
|
|
4839
|
-
next((inp, out) => /* @__PURE__ */ jsxRuntime.jsx("feColorMatrix", { in: inp, result: out, type: "saturate", values: String(v) }, out));
|
|
4840
|
-
}
|
|
4841
|
-
if (e.tint && typeof e.tint.amt === "number" && e.tint.amt < 0) {
|
|
4842
|
-
const v = clamp(1 + e.tint.amt / 100, 0, 1);
|
|
4843
|
-
next((inp, out) => /* @__PURE__ */ jsxRuntime.jsx("feColorMatrix", { in: inp, result: out, type: "saturate", values: String(v) }, out));
|
|
4844
|
-
}
|
|
4845
|
-
if (e.clrRepl) {
|
|
4846
|
-
const c = hexToRgbUnit(e.clrRepl.color);
|
|
4847
|
-
next((inp, out) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4848
|
-
"feColorMatrix",
|
|
4849
|
-
{
|
|
4850
|
-
in: inp,
|
|
4851
|
-
result: out,
|
|
4852
|
-
type: "matrix",
|
|
4853
|
-
values: `0 0 0 0 ${c.r} 0 0 0 0 ${c.g} 0 0 0 0 ${c.b} 0 0 0 1 0`
|
|
4854
|
-
},
|
|
4855
|
-
out
|
|
4856
|
-
));
|
|
4857
|
-
}
|
|
4858
|
-
if (primitives.length === 0) {
|
|
4859
|
-
return null;
|
|
4860
|
-
}
|
|
4861
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4862
|
-
"svg",
|
|
4863
|
-
{
|
|
4864
|
-
width: 0,
|
|
4865
|
-
height: 0,
|
|
4866
|
-
style: { position: "absolute", overflow: "hidden" },
|
|
4867
|
-
"aria-hidden": "true",
|
|
4868
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("filter", { id: filterId, colorInterpolationFilters: "sRGB", children: primitives }) })
|
|
4869
|
-
}
|
|
4870
|
-
);
|
|
4871
|
-
}
|
|
4872
|
-
function clamp(v, lo, hi) {
|
|
4873
|
-
return v < lo ? lo : v > hi ? hi : v;
|
|
4874
|
-
}
|
|
4875
4686
|
function getDagDuotoneFilterId(elementId) {
|
|
4876
4687
|
return `dag-duotone-${elementId}`;
|
|
4877
4688
|
}
|
|
4878
4689
|
function hasDagDuotoneEffect(element) {
|
|
4879
|
-
if (!
|
|
4690
|
+
if (!chunkAD3EAEY6_js.hasShapeProperties(element)) {
|
|
4880
4691
|
return false;
|
|
4881
4692
|
}
|
|
4882
4693
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -4939,7 +4750,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
4939
4750
|
|
|
4940
4751
|
// src/viewer/utils/shape-visual-3d.ts
|
|
4941
4752
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
4942
|
-
return
|
|
4753
|
+
return chunkP3T4E6JQ_js.build3DExtrusionData(
|
|
4943
4754
|
shape3d,
|
|
4944
4755
|
scene3d,
|
|
4945
4756
|
fillColor,
|
|
@@ -4948,27 +4759,27 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
4948
4759
|
);
|
|
4949
4760
|
}
|
|
4950
4761
|
function apply3dEffects2(base, scene3d, shape3d) {
|
|
4951
|
-
|
|
4762
|
+
chunkP3T4E6JQ_js.apply3dEffects(base, scene3d, shape3d);
|
|
4952
4763
|
}
|
|
4953
4764
|
|
|
4954
4765
|
// src/viewer/utils/shape-visual-style.ts
|
|
4955
4766
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor) {
|
|
4956
|
-
if (!
|
|
4767
|
+
if (!chunkAD3EAEY6_js.hasShapeProperties(element)) {
|
|
4957
4768
|
return {};
|
|
4958
4769
|
}
|
|
4959
4770
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
4960
|
-
const clipPath =
|
|
4771
|
+
const clipPath = chunkP3T4E6JQ_js.getResolvedShapeClipPath(element);
|
|
4961
4772
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
4962
4773
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
4963
|
-
const strokeDash =
|
|
4964
|
-
const fillGradient =
|
|
4965
|
-
const shadowCss =
|
|
4966
|
-
const innerShadowCss =
|
|
4967
|
-
const resolvedFillColor =
|
|
4968
|
-
const resolvedStrokeColor =
|
|
4774
|
+
const strokeDash = chunkP3T4E6JQ_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
4775
|
+
const fillGradient = chunkP3T4E6JQ_js.buildCssGradientFromShapeStyle(element.shapeStyle) || element.shapeStyle?.fillGradient;
|
|
4776
|
+
const shadowCss = chunkP3T4E6JQ_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
4777
|
+
const innerShadowCss = chunkP3T4E6JQ_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
4778
|
+
const resolvedFillColor = chunkP3T4E6JQ_js.colorWithOpacity(fillColor, fillOpacity);
|
|
4779
|
+
const resolvedStrokeColor = chunkP3T4E6JQ_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
4969
4780
|
const ss = element.shapeStyle;
|
|
4970
4781
|
const combinedShadowParts = [];
|
|
4971
|
-
const multiLayerShadow =
|
|
4782
|
+
const multiLayerShadow = chunkP3T4E6JQ_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
4972
4783
|
if (multiLayerShadow) {
|
|
4973
4784
|
combinedShadowParts.push(multiLayerShadow);
|
|
4974
4785
|
} else if (shadowCss) {
|
|
@@ -4977,7 +4788,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4977
4788
|
if (innerShadowCss) {
|
|
4978
4789
|
combinedShadowParts.push(innerShadowCss);
|
|
4979
4790
|
}
|
|
4980
|
-
const glowBoxShadow =
|
|
4791
|
+
const glowBoxShadow = chunkP3T4E6JQ_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
4981
4792
|
if (glowBoxShadow) {
|
|
4982
4793
|
combinedShadowParts.push(glowBoxShadow);
|
|
4983
4794
|
}
|
|
@@ -4985,7 +4796,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4985
4796
|
if (lineShadow) {
|
|
4986
4797
|
combinedShadowParts.push(lineShadow);
|
|
4987
4798
|
}
|
|
4988
|
-
const compoundLineShadow =
|
|
4799
|
+
const compoundLineShadow = chunkP3T4E6JQ_js.getCompoundLineBoxShadow(
|
|
4989
4800
|
element.shapeStyle?.compoundLine,
|
|
4990
4801
|
strokeWidth,
|
|
4991
4802
|
resolvedStrokeColor
|
|
@@ -4998,7 +4809,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4998
4809
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
4999
4810
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
5000
4811
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
5001
|
-
const glowCol =
|
|
4812
|
+
const glowCol = chunkP3T4E6JQ_js.colorWithOpacity(chunkP3T4E6JQ_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
5002
4813
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
5003
4814
|
}
|
|
5004
4815
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
@@ -5011,12 +4822,12 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5011
4822
|
if (lineGlowCss) {
|
|
5012
4823
|
filterParts.push(lineGlowCss);
|
|
5013
4824
|
}
|
|
5014
|
-
const dagFilter =
|
|
4825
|
+
const dagFilter = chunkP3T4E6JQ_js.getEffectDagFilter(ss, element.id);
|
|
5015
4826
|
if (dagFilter) {
|
|
5016
4827
|
filterParts.push(dagFilter);
|
|
5017
4828
|
}
|
|
5018
4829
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : void 0;
|
|
5019
|
-
const patternFill =
|
|
4830
|
+
const patternFill = chunkP3T4E6JQ_js.buildPatternFillCss(element.shapeStyle);
|
|
5020
4831
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
5021
4832
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
5022
4833
|
let reflectCss;
|
|
@@ -5028,7 +4839,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5028
4839
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
5029
4840
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
5030
4841
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
5031
|
-
reflectCss =
|
|
4842
|
+
reflectCss = chunkP3T4E6JQ_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
5032
4843
|
}
|
|
5033
4844
|
}
|
|
5034
4845
|
const base = {
|
|
@@ -5042,9 +4853,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5042
4853
|
filter: filterParts.length > 0 ? filterParts.join(" ") : void 0,
|
|
5043
4854
|
opacity: typeof ss?.dagAlphaModFix === "number" ? Math.max(0, Math.min(1, ss.dagAlphaModFix / 100)) : void 0,
|
|
5044
4855
|
mixBlendMode: mapDagBlendModeToCss(ss?.dagFillOverlayBlend),
|
|
5045
|
-
borderWidth: strokeWidth > 0 ?
|
|
4856
|
+
borderWidth: strokeWidth > 0 ? chunkP3T4E6JQ_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : void 0,
|
|
5046
4857
|
borderColor: strokeWidth > 0 ? resolvedStrokeColor : void 0,
|
|
5047
|
-
borderStyle: strokeWidth > 0 ?
|
|
4858
|
+
borderStyle: strokeWidth > 0 ? chunkP3T4E6JQ_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
5048
4859
|
strokeLinejoin: lineJoinCss,
|
|
5049
4860
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : void 0
|
|
5050
4861
|
};
|
|
@@ -5085,7 +4896,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5085
4896
|
borderWidth: 0,
|
|
5086
4897
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
5087
4898
|
borderTopColor: resolvedStrokeColor,
|
|
5088
|
-
borderTopStyle:
|
|
4899
|
+
borderTopStyle: chunkP3T4E6JQ_js.getCssBorderDashStyle(strokeDash)
|
|
5089
4900
|
};
|
|
5090
4901
|
}
|
|
5091
4902
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -5099,13 +4910,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5099
4910
|
function getConnectorAdjustment(element, key, fallback) {
|
|
5100
4911
|
const direct = element.shapeAdjustments?.[key];
|
|
5101
4912
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
5102
|
-
return
|
|
4913
|
+
return chunkP3T4E6JQ_js.clampUnitInterval(direct / 1e5);
|
|
5103
4914
|
}
|
|
5104
4915
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
5105
4916
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
5106
|
-
return
|
|
4917
|
+
return chunkP3T4E6JQ_js.clampUnitInterval(fallbackKey / 1e5);
|
|
5107
4918
|
}
|
|
5108
|
-
return
|
|
4919
|
+
return chunkP3T4E6JQ_js.clampUnitInterval(fallback);
|
|
5109
4920
|
}
|
|
5110
4921
|
function getConnectorPathGeometry(element) {
|
|
5111
4922
|
const width = Math.max(element.width, 1);
|
|
@@ -5232,14 +5043,14 @@ function renderConnectorMarker(markerId, arrowType, color, arrowWidth, arrowLeng
|
|
|
5232
5043
|
);
|
|
5233
5044
|
}
|
|
5234
5045
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor) {
|
|
5235
|
-
if (!
|
|
5046
|
+
if (!chunkAD3EAEY6_js.hasShapeProperties(element)) {
|
|
5236
5047
|
return null;
|
|
5237
5048
|
}
|
|
5238
5049
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
5239
|
-
const fillPaint =
|
|
5240
|
-
const strokePaint =
|
|
5241
|
-
const dashType =
|
|
5242
|
-
const dashArray =
|
|
5050
|
+
const fillPaint = chunkP3T4E6JQ_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
5051
|
+
const strokePaint = chunkP3T4E6JQ_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
5052
|
+
const dashType = chunkP3T4E6JQ_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
5053
|
+
const dashArray = chunkP3T4E6JQ_js.getSvgStrokeDasharray(
|
|
5243
5054
|
dashType,
|
|
5244
5055
|
Math.max(strokeWidth, 1),
|
|
5245
5056
|
element.shapeStyle?.customDashSegments
|
|
@@ -5323,18 +5134,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5323
5134
|
}
|
|
5324
5135
|
);
|
|
5325
5136
|
}
|
|
5326
|
-
if (
|
|
5137
|
+
if (chunkAD3EAEY6_js.isCalloutShape(normalizedType)) {
|
|
5327
5138
|
const width = Math.max(element.width, 1);
|
|
5328
5139
|
const height = Math.max(element.height, 1);
|
|
5329
|
-
const geometry =
|
|
5140
|
+
const geometry = chunkAD3EAEY6_js.getCalloutLeaderLineGeometry(
|
|
5330
5141
|
normalizedType,
|
|
5331
5142
|
width,
|
|
5332
5143
|
height,
|
|
5333
5144
|
element.shapeAdjustments
|
|
5334
5145
|
);
|
|
5335
5146
|
if (geometry && geometry.points.length >= 2) {
|
|
5336
|
-
const leaderPath =
|
|
5337
|
-
const bounds =
|
|
5147
|
+
const leaderPath = chunkAD3EAEY6_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
5148
|
+
const bounds = chunkAD3EAEY6_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
5338
5149
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
5339
5150
|
const offsetLeft = bounds.minX;
|
|
5340
5151
|
const offsetTop = bounds.minY;
|
|
@@ -5398,8 +5209,8 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5398
5209
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
5399
5210
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
5400
5211
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
5401
|
-
const offsets =
|
|
5402
|
-
const widths =
|
|
5212
|
+
const offsets = chunkP3T4E6JQ_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
5213
|
+
const widths = chunkP3T4E6JQ_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
5403
5214
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5404
5215
|
"svg",
|
|
5405
5216
|
{
|
|
@@ -5453,7 +5264,7 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5453
5264
|
|
|
5454
5265
|
// src/viewer/utils/image-style.ts
|
|
5455
5266
|
function getImageMaskStyle(element) {
|
|
5456
|
-
if (!
|
|
5267
|
+
if (!chunkAD3EAEY6_js.hasShapeProperties(element)) {
|
|
5457
5268
|
return void 0;
|
|
5458
5269
|
}
|
|
5459
5270
|
const shapeType = element.shapeType;
|
|
@@ -5462,7 +5273,7 @@ function getImageMaskStyle(element) {
|
|
|
5462
5273
|
}
|
|
5463
5274
|
const normalized = shapeType.toLowerCase();
|
|
5464
5275
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
5465
|
-
const radiusPx =
|
|
5276
|
+
const radiusPx = chunkP3T4E6JQ_js.getRoundRectRadiusPx(element);
|
|
5466
5277
|
if (radiusPx <= 0.01) {
|
|
5467
5278
|
return void 0;
|
|
5468
5279
|
}
|
|
@@ -5474,7 +5285,7 @@ function getImageMaskStyle(element) {
|
|
|
5474
5285
|
if (normalized === "can" || normalized === "cylinder") {
|
|
5475
5286
|
return { borderRadius: "48% / 12%" };
|
|
5476
5287
|
}
|
|
5477
|
-
const clipPath =
|
|
5288
|
+
const clipPath = chunkP3T4E6JQ_js.getResolvedShapeClipPath(element);
|
|
5478
5289
|
if (!clipPath) {
|
|
5479
5290
|
return void 0;
|
|
5480
5291
|
}
|
|
@@ -5482,7 +5293,7 @@ function getImageMaskStyle(element) {
|
|
|
5482
5293
|
}
|
|
5483
5294
|
function getImageRenderStyle(element) {
|
|
5484
5295
|
const maskStyle = getImageMaskStyle(element) || {};
|
|
5485
|
-
if (!
|
|
5296
|
+
if (!chunkAD3EAEY6_js.isImageLikeElement(element)) {
|
|
5486
5297
|
return {
|
|
5487
5298
|
...maskStyle,
|
|
5488
5299
|
width: "100%",
|
|
@@ -5490,10 +5301,10 @@ function getImageRenderStyle(element) {
|
|
|
5490
5301
|
objectFit: "cover"
|
|
5491
5302
|
};
|
|
5492
5303
|
}
|
|
5493
|
-
const cropLeft =
|
|
5494
|
-
const cropTop =
|
|
5495
|
-
const cropRight =
|
|
5496
|
-
const cropBottom =
|
|
5304
|
+
const cropLeft = chunkP3T4E6JQ_js.clampCropValue(element.cropLeft);
|
|
5305
|
+
const cropTop = chunkP3T4E6JQ_js.clampCropValue(element.cropTop);
|
|
5306
|
+
const cropRight = chunkP3T4E6JQ_js.clampCropValue(element.cropRight);
|
|
5307
|
+
const cropBottom = chunkP3T4E6JQ_js.clampCropValue(element.cropBottom);
|
|
5497
5308
|
const hasCrop = cropLeft + cropRight > 1e-4 || cropTop + cropBottom > 1e-4;
|
|
5498
5309
|
if (!hasCrop) {
|
|
5499
5310
|
return {
|
|
@@ -5505,10 +5316,10 @@ function getImageRenderStyle(element) {
|
|
|
5505
5316
|
}
|
|
5506
5317
|
const safeHorizontalScale = cropLeft + cropRight >= 0.99 ? 0.99 / (cropLeft + cropRight) : 1;
|
|
5507
5318
|
const safeVerticalScale = cropTop + cropBottom >= 0.99 ? 0.99 / (cropTop + cropBottom) : 1;
|
|
5508
|
-
const normalizedLeft =
|
|
5509
|
-
const normalizedRight =
|
|
5510
|
-
const normalizedTop =
|
|
5511
|
-
const normalizedBottom =
|
|
5319
|
+
const normalizedLeft = chunkP3T4E6JQ_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
5320
|
+
const normalizedRight = chunkP3T4E6JQ_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
5321
|
+
const normalizedTop = chunkP3T4E6JQ_js.clampCropValue(cropTop * safeVerticalScale);
|
|
5322
|
+
const normalizedBottom = chunkP3T4E6JQ_js.clampCropValue(cropBottom * safeVerticalScale);
|
|
5512
5323
|
const remainingWidth = Math.max(0.01, 1 - normalizedLeft - normalizedRight);
|
|
5513
5324
|
const remainingHeight = Math.max(0.01, 1 - normalizedTop - normalizedBottom);
|
|
5514
5325
|
const tx = Math.round(-normalizedLeft / remainingWidth * 1e4) / 100;
|
|
@@ -5537,7 +5348,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
5537
5348
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
5538
5349
|
};
|
|
5539
5350
|
function getCropShapeClipPath(element) {
|
|
5540
|
-
if (!
|
|
5351
|
+
if (!chunkAD3EAEY6_js.isImageLikeElement(element)) {
|
|
5541
5352
|
return void 0;
|
|
5542
5353
|
}
|
|
5543
5354
|
const shape = element.cropShape;
|
|
@@ -5547,7 +5358,7 @@ function getCropShapeClipPath(element) {
|
|
|
5547
5358
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
5548
5359
|
}
|
|
5549
5360
|
function isImageTiled(element) {
|
|
5550
|
-
if (!
|
|
5361
|
+
if (!chunkAD3EAEY6_js.isImageLikeElement(element)) {
|
|
5551
5362
|
return false;
|
|
5552
5363
|
}
|
|
5553
5364
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -5577,7 +5388,7 @@ function tileAlignmentToCssPosition(alignment) {
|
|
|
5577
5388
|
}
|
|
5578
5389
|
}
|
|
5579
5390
|
function getImageTilingStyle(element) {
|
|
5580
|
-
if (!
|
|
5391
|
+
if (!chunkAD3EAEY6_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
5581
5392
|
return void 0;
|
|
5582
5393
|
}
|
|
5583
5394
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -5648,9 +5459,9 @@ function parseGradientFillCss(gradFill) {
|
|
|
5648
5459
|
}
|
|
5649
5460
|
const parsed = stops.map((gs) => {
|
|
5650
5461
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
5651
|
-
const color =
|
|
5652
|
-
const opacity =
|
|
5653
|
-
return { pos, color:
|
|
5462
|
+
const color = chunkP3T4E6JQ_js.parseDrawingColor(gs) ?? "#888888";
|
|
5463
|
+
const opacity = chunkP3T4E6JQ_js.parseDrawingColorOpacity(gs);
|
|
5464
|
+
return { pos, color: chunkP3T4E6JQ_js.colorWithOpacity(color, opacity) };
|
|
5654
5465
|
}).sort((a, b) => a.pos - b.pos);
|
|
5655
5466
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
5656
5467
|
const lin = gradFill["a:lin"];
|
|
@@ -5691,8 +5502,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
5691
5502
|
if (!pattFill) {
|
|
5692
5503
|
return void 0;
|
|
5693
5504
|
}
|
|
5694
|
-
const fgColor =
|
|
5695
|
-
const bgColor =
|
|
5505
|
+
const fgColor = chunkP3T4E6JQ_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
5506
|
+
const bgColor = chunkP3T4E6JQ_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
5696
5507
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
5697
5508
|
switch (preset) {
|
|
5698
5509
|
case "ltHorz":
|
|
@@ -5803,11 +5614,11 @@ function parseCellBorders(cellProperties) {
|
|
|
5803
5614
|
const prstDash = ln["a:prstDash"];
|
|
5804
5615
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
5805
5616
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
5806
|
-
const color =
|
|
5617
|
+
const color = chunkP3T4E6JQ_js.parseDrawingColor(ln["a:solidFill"]);
|
|
5807
5618
|
if (color) {
|
|
5808
|
-
const opacity =
|
|
5619
|
+
const opacity = chunkP3T4E6JQ_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
5809
5620
|
const key = `${edge.prefix}`;
|
|
5810
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
5621
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkP3T4E6JQ_js.colorWithOpacity(color, opacity)}`;
|
|
5811
5622
|
}
|
|
5812
5623
|
}
|
|
5813
5624
|
return borderStyle;
|
|
@@ -5820,7 +5631,7 @@ function parseCellTextEffects(runProps) {
|
|
|
5820
5631
|
const textShadowParts = [];
|
|
5821
5632
|
const outerShdw = effectLst["a:outerShdw"];
|
|
5822
5633
|
if (outerShdw) {
|
|
5823
|
-
const shdwColor =
|
|
5634
|
+
const shdwColor = chunkP3T4E6JQ_js.parseDrawingColor(outerShdw);
|
|
5824
5635
|
if (shdwColor) {
|
|
5825
5636
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
5826
5637
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -5838,7 +5649,7 @@ function parseCellTextEffects(runProps) {
|
|
|
5838
5649
|
}
|
|
5839
5650
|
const glow = effectLst["a:glow"];
|
|
5840
5651
|
if (glow) {
|
|
5841
|
-
const glowColor =
|
|
5652
|
+
const glowColor = chunkP3T4E6JQ_js.parseDrawingColor(glow);
|
|
5842
5653
|
if (glowColor) {
|
|
5843
5654
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
5844
5655
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -5917,10 +5728,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5917
5728
|
if (runProps?.["@_u"] !== void 0) {
|
|
5918
5729
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
5919
5730
|
}
|
|
5920
|
-
const runColor =
|
|
5731
|
+
const runColor = chunkP3T4E6JQ_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkP3T4E6JQ_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
5921
5732
|
if (runColor) {
|
|
5922
|
-
const opacity =
|
|
5923
|
-
cellStyle.color =
|
|
5733
|
+
const opacity = chunkP3T4E6JQ_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
5734
|
+
cellStyle.color = chunkP3T4E6JQ_js.colorWithOpacity(runColor, opacity);
|
|
5924
5735
|
}
|
|
5925
5736
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
5926
5737
|
if (fontFamily) {
|
|
@@ -5930,15 +5741,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5930
5741
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
5931
5742
|
}
|
|
5932
5743
|
const cellProperties = cellXml["a:tcPr"];
|
|
5933
|
-
const cellFill =
|
|
5744
|
+
const cellFill = chunkP3T4E6JQ_js.parseDrawingColor(
|
|
5934
5745
|
cellProperties?.["a:solidFill"],
|
|
5935
5746
|
schemeColorOverrides
|
|
5936
5747
|
);
|
|
5937
5748
|
if (cellFill) {
|
|
5938
|
-
const opacity =
|
|
5749
|
+
const opacity = chunkP3T4E6JQ_js.parseDrawingColorOpacity(
|
|
5939
5750
|
cellProperties?.["a:solidFill"]
|
|
5940
5751
|
);
|
|
5941
|
-
cellStyle.backgroundColor =
|
|
5752
|
+
cellStyle.backgroundColor = chunkP3T4E6JQ_js.colorWithOpacity(cellFill, opacity);
|
|
5942
5753
|
} else {
|
|
5943
5754
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
5944
5755
|
if (gradCss) {
|
|
@@ -5953,16 +5764,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5953
5764
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
5954
5765
|
Object.assign(cellStyle, edgeBorders);
|
|
5955
5766
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
5956
|
-
const borderColor =
|
|
5767
|
+
const borderColor = chunkP3T4E6JQ_js.parseDrawingColor(
|
|
5957
5768
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
5958
5769
|
schemeColorOverrides
|
|
5959
|
-
) ||
|
|
5770
|
+
) || chunkP3T4E6JQ_js.parseDrawingColor(
|
|
5960
5771
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
5961
5772
|
schemeColorOverrides
|
|
5962
|
-
) ||
|
|
5773
|
+
) || chunkP3T4E6JQ_js.parseDrawingColor(
|
|
5963
5774
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
5964
5775
|
schemeColorOverrides
|
|
5965
|
-
) ||
|
|
5776
|
+
) || chunkP3T4E6JQ_js.parseDrawingColor(
|
|
5966
5777
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
5967
5778
|
schemeColorOverrides
|
|
5968
5779
|
);
|
|
@@ -6041,10 +5852,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
6041
5852
|
}
|
|
6042
5853
|
let color = base;
|
|
6043
5854
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
6044
|
-
color =
|
|
5855
|
+
color = chunkP3T4E6JQ_js.tintColor2(color, fill.tint / 1e5);
|
|
6045
5856
|
}
|
|
6046
5857
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
6047
|
-
color =
|
|
5858
|
+
color = chunkP3T4E6JQ_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
6048
5859
|
}
|
|
6049
5860
|
return color;
|
|
6050
5861
|
}
|
|
@@ -6066,10 +5877,10 @@ function applyTableStyleText(text, colorScheme, style) {
|
|
|
6066
5877
|
if (base) {
|
|
6067
5878
|
let color = base;
|
|
6068
5879
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
6069
|
-
color =
|
|
5880
|
+
color = chunkP3T4E6JQ_js.tintColor2(color, text.fontTint / 1e5);
|
|
6070
5881
|
}
|
|
6071
5882
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
6072
|
-
color =
|
|
5883
|
+
color = chunkP3T4E6JQ_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
6073
5884
|
}
|
|
6074
5885
|
style.color = color;
|
|
6075
5886
|
applied = true;
|
|
@@ -6351,9 +6162,9 @@ function cellStyleToCss(style) {
|
|
|
6351
6162
|
if (style.gradientFillCss) {
|
|
6352
6163
|
css.background = style.gradientFillCss;
|
|
6353
6164
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
6354
|
-
const fg =
|
|
6355
|
-
const bg =
|
|
6356
|
-
const svgPattern =
|
|
6165
|
+
const fg = chunkP3T4E6JQ_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
6166
|
+
const bg = chunkP3T4E6JQ_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
6167
|
+
const svgPattern = chunkP3T4E6JQ_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
6357
6168
|
if (svgPattern) {
|
|
6358
6169
|
const encoded = encodeURIComponent(svgPattern);
|
|
6359
6170
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -6422,7 +6233,7 @@ function cellStyleToCss(style) {
|
|
|
6422
6233
|
if (edge.width || edge.color) {
|
|
6423
6234
|
const w = edge.width ?? 1;
|
|
6424
6235
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
6425
|
-
const s =
|
|
6236
|
+
const s = chunkP3T4E6JQ_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
6426
6237
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
6427
6238
|
}
|
|
6428
6239
|
}
|
|
@@ -6464,7 +6275,7 @@ function TableResizeOverlay({
|
|
|
6464
6275
|
const containerRef = React3.useRef(null);
|
|
6465
6276
|
const [rowBounds, setRowBounds] = React3.useState([]);
|
|
6466
6277
|
const dragRef = React3.useRef(null);
|
|
6467
|
-
const colBoundaries = React3.useMemo(() =>
|
|
6278
|
+
const colBoundaries = React3.useMemo(() => chunkP3T4E6JQ_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
6468
6279
|
const measureRows = React3.useCallback(() => {
|
|
6469
6280
|
const container = containerRef.current;
|
|
6470
6281
|
if (!container) {
|
|
@@ -6511,11 +6322,11 @@ function TableResizeOverlay({
|
|
|
6511
6322
|
const rect = containerRef.current.getBoundingClientRect();
|
|
6512
6323
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
6513
6324
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
6514
|
-
onResizeColumns(
|
|
6325
|
+
onResizeColumns(chunkP3T4E6JQ_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
6515
6326
|
} else if (drag.type === "row" && onResizeRow) {
|
|
6516
6327
|
const deltaY = e.clientY - drag.startPos;
|
|
6517
|
-
const newHeight =
|
|
6518
|
-
drag.initialRowHeight ??
|
|
6328
|
+
const newHeight = chunkP3T4E6JQ_js.computeResizedRowHeight(
|
|
6329
|
+
drag.initialRowHeight ?? chunkP3T4E6JQ_js.DEFAULT_ROW_HEIGHT,
|
|
6519
6330
|
deltaY
|
|
6520
6331
|
);
|
|
6521
6332
|
onResizeRow(drag.index, newHeight);
|
|
@@ -6553,7 +6364,7 @@ function TableResizeOverlay({
|
|
|
6553
6364
|
e.stopPropagation();
|
|
6554
6365
|
const table = containerRef.current?.querySelector("table");
|
|
6555
6366
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
6556
|
-
const actualHeight = tr?.offsetHeight ??
|
|
6367
|
+
const actualHeight = tr?.offsetHeight ?? chunkP3T4E6JQ_js.DEFAULT_ROW_HEIGHT;
|
|
6557
6368
|
document.body.style.cursor = "row-resize";
|
|
6558
6369
|
document.body.style.userSelect = "none";
|
|
6559
6370
|
dragRef.current = {
|
|
@@ -6599,7 +6410,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6599
6410
|
}
|
|
6600
6411
|
const first = selectedCell.selectedCells[0];
|
|
6601
6412
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
6602
|
-
return
|
|
6413
|
+
return chunkP3T4E6JQ_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
6603
6414
|
})();
|
|
6604
6415
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6605
6416
|
TableResizeOverlay,
|
|
@@ -6632,7 +6443,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6632
6443
|
return null;
|
|
6633
6444
|
}
|
|
6634
6445
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
6635
|
-
const isInMultiSelection =
|
|
6446
|
+
const isInMultiSelection = chunkP3T4E6JQ_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
6636
6447
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
6637
6448
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6638
6449
|
"td",
|
|
@@ -6655,7 +6466,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6655
6466
|
}
|
|
6656
6467
|
event.stopPropagation();
|
|
6657
6468
|
if (event.shiftKey && selectedCell) {
|
|
6658
|
-
const rect =
|
|
6469
|
+
const rect = chunkP3T4E6JQ_js.computeSelectionRect(
|
|
6659
6470
|
selectedCell.rowIndex,
|
|
6660
6471
|
selectedCell.columnIndex,
|
|
6661
6472
|
rowIndex,
|
|
@@ -6665,7 +6476,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6665
6476
|
options?.onSelectCell?.({
|
|
6666
6477
|
rowIndex: selectedCell.rowIndex,
|
|
6667
6478
|
columnIndex: selectedCell.columnIndex,
|
|
6668
|
-
selectedCells:
|
|
6479
|
+
selectedCells: chunkP3T4E6JQ_js.rectToCells(rect)
|
|
6669
6480
|
});
|
|
6670
6481
|
} else {
|
|
6671
6482
|
options?.onSelectCell?.({
|
|
@@ -6739,7 +6550,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6739
6550
|
}
|
|
6740
6551
|
const first = selectedCell.selectedCells[0];
|
|
6741
6552
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
6742
|
-
return
|
|
6553
|
+
return chunkP3T4E6JQ_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
6743
6554
|
})();
|
|
6744
6555
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
6745
6556
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6804,7 +6615,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6804
6615
|
"border px-1 py-0.5 align-top",
|
|
6805
6616
|
isEditable2 && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
6806
6617
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
6807
|
-
|
|
6618
|
+
chunkP3T4E6JQ_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
6808
6619
|
),
|
|
6809
6620
|
colSpan,
|
|
6810
6621
|
rowSpan: rSpan,
|
|
@@ -6815,7 +6626,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6815
6626
|
}
|
|
6816
6627
|
event.stopPropagation();
|
|
6817
6628
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
6818
|
-
const rect =
|
|
6629
|
+
const rect = chunkP3T4E6JQ_js.computeSelectionRect(
|
|
6819
6630
|
selectedCell.rowIndex,
|
|
6820
6631
|
selectedCell.columnIndex,
|
|
6821
6632
|
rowIndex,
|
|
@@ -6825,7 +6636,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6825
6636
|
options?.onSelectCell?.({
|
|
6826
6637
|
rowIndex: selectedCell.rowIndex,
|
|
6827
6638
|
columnIndex: selectedCell.columnIndex,
|
|
6828
|
-
selectedCells:
|
|
6639
|
+
selectedCells: chunkP3T4E6JQ_js.rectToCells(rect)
|
|
6829
6640
|
});
|
|
6830
6641
|
} else {
|
|
6831
6642
|
options?.onSelectCell?.({
|
|
@@ -6877,24 +6688,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6877
6688
|
}
|
|
6878
6689
|
var LEGEND_ITEM_WIDTH = 80;
|
|
6879
6690
|
function partAttrs(part) {
|
|
6880
|
-
return part ?
|
|
6691
|
+
return part ? chunkP3T4E6JQ_js.chartPartToAttrs(part) : void 0;
|
|
6881
6692
|
}
|
|
6882
6693
|
function resolveReactPalette(chartData) {
|
|
6883
6694
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
6884
6695
|
return chartData.colorPalette;
|
|
6885
6696
|
}
|
|
6886
|
-
return [...
|
|
6697
|
+
return [...chunkP3T4E6JQ_js.getChartStylePalette(chartData.style?.styleId)];
|
|
6887
6698
|
}
|
|
6888
6699
|
function buildReactChartViewModel(element) {
|
|
6889
6700
|
if (element.type !== "chart" || !element.chartData) {
|
|
6890
|
-
return
|
|
6701
|
+
return chunkP3T4E6JQ_js.buildChartViewModel(element);
|
|
6891
6702
|
}
|
|
6892
6703
|
const palette = resolveReactPalette(element.chartData);
|
|
6893
6704
|
const themedElement = {
|
|
6894
6705
|
...element,
|
|
6895
6706
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
6896
6707
|
};
|
|
6897
|
-
return
|
|
6708
|
+
return chunkP3T4E6JQ_js.buildChartViewModel(themedElement);
|
|
6898
6709
|
}
|
|
6899
6710
|
function renderPrimitive(prim, key) {
|
|
6900
6711
|
switch (prim.kind) {
|
|
@@ -7283,7 +7094,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7283
7094
|
const unmatchedRows = [];
|
|
7284
7095
|
categories.forEach((cat, i) => {
|
|
7285
7096
|
const value = values[i] ?? 0;
|
|
7286
|
-
const code =
|
|
7097
|
+
const code = chunkP3T4E6JQ_js.resolveRegionCode(cat);
|
|
7287
7098
|
if (code) {
|
|
7288
7099
|
regionValueMap.set(code, { value, label: cat });
|
|
7289
7100
|
} else {
|
|
@@ -7321,8 +7132,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7321
7132
|
let fill = "#e2e8f0";
|
|
7322
7133
|
let dataLabel = null;
|
|
7323
7134
|
if (entry) {
|
|
7324
|
-
const t =
|
|
7325
|
-
fill =
|
|
7135
|
+
const t = chunkP3T4E6JQ_js.normalizeValue(entry.value, minVal, maxVal);
|
|
7136
|
+
fill = chunkP3T4E6JQ_js.sequentialColorScale(t);
|
|
7326
7137
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
7327
7138
|
"text",
|
|
7328
7139
|
{
|
|
@@ -7333,7 +7144,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7333
7144
|
fontWeight: 600,
|
|
7334
7145
|
fill: "#1e293b",
|
|
7335
7146
|
style: { pointerEvents: "none" },
|
|
7336
|
-
children:
|
|
7147
|
+
children: chunkP3T4E6JQ_js.formatAxisValue(entry.value)
|
|
7337
7148
|
},
|
|
7338
7149
|
`${element.id}-map-dl-${region.code}`
|
|
7339
7150
|
);
|
|
@@ -7351,7 +7162,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7351
7162
|
opacity: 0.9,
|
|
7352
7163
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
7353
7164
|
region.name,
|
|
7354
|
-
entry ? `: ${
|
|
7165
|
+
entry ? `: ${chunkP3T4E6JQ_js.formatAxisValue(entry.value)}` : ""
|
|
7355
7166
|
] })
|
|
7356
7167
|
}
|
|
7357
7168
|
),
|
|
@@ -7389,7 +7200,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7389
7200
|
fontSize: 7,
|
|
7390
7201
|
fill: "#64748b",
|
|
7391
7202
|
textAnchor: "middle",
|
|
7392
|
-
children:
|
|
7203
|
+
children: chunkP3T4E6JQ_js.formatAxisValue(minVal)
|
|
7393
7204
|
},
|
|
7394
7205
|
`${element.id}-map-legend-min`
|
|
7395
7206
|
),
|
|
@@ -7401,7 +7212,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7401
7212
|
fontSize: 7,
|
|
7402
7213
|
fill: "#64748b",
|
|
7403
7214
|
textAnchor: "middle",
|
|
7404
|
-
children:
|
|
7215
|
+
children: chunkP3T4E6JQ_js.formatAxisValue(maxVal)
|
|
7405
7216
|
},
|
|
7406
7217
|
`${element.id}-map-legend-max`
|
|
7407
7218
|
)
|
|
@@ -7467,7 +7278,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7467
7278
|
y,
|
|
7468
7279
|
fontSize,
|
|
7469
7280
|
fill: "#475569",
|
|
7470
|
-
children:
|
|
7281
|
+
children: chunkP3T4E6JQ_js.formatAxisValue(row.value)
|
|
7471
7282
|
},
|
|
7472
7283
|
`${element.id}-map-ft-val-${i}`
|
|
7473
7284
|
)
|
|
@@ -7538,7 +7349,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
7538
7349
|
|
|
7539
7350
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
7540
7351
|
function sColor(series, idx) {
|
|
7541
|
-
return
|
|
7352
|
+
return chunkP3T4E6JQ_js.seriesColor(series, idx);
|
|
7542
7353
|
}
|
|
7543
7354
|
function valToY(val, range, topY, bottomY) {
|
|
7544
7355
|
const usable = bottomY - topY;
|
|
@@ -8033,7 +7844,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
8033
7844
|
width: 10,
|
|
8034
7845
|
height: 10,
|
|
8035
7846
|
rx: 2,
|
|
8036
|
-
fill:
|
|
7847
|
+
fill: chunkP3T4E6JQ_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
8037
7848
|
},
|
|
8038
7849
|
`${id}-leg-r-${i}`
|
|
8039
7850
|
)
|
|
@@ -8057,7 +7868,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
8057
7868
|
width: 10,
|
|
8058
7869
|
height: 10,
|
|
8059
7870
|
rx: 2,
|
|
8060
|
-
fill:
|
|
7871
|
+
fill: chunkP3T4E6JQ_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
8061
7872
|
}
|
|
8062
7873
|
),
|
|
8063
7874
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -8070,9 +7881,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
8070
7881
|
}
|
|
8071
7882
|
const lines = [];
|
|
8072
7883
|
if (range.logScale && range.logBase) {
|
|
8073
|
-
const ticks =
|
|
7884
|
+
const ticks = chunkP3T4E6JQ_js.generateLogTicks(range);
|
|
8074
7885
|
ticks.forEach((tickVal, i) => {
|
|
8075
|
-
const y =
|
|
7886
|
+
const y = chunkP3T4E6JQ_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
8076
7887
|
lines.push(
|
|
8077
7888
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8078
7889
|
"line",
|
|
@@ -8093,7 +7904,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
8093
7904
|
const steps = 4;
|
|
8094
7905
|
for (let i = 0; i <= steps; i++) {
|
|
8095
7906
|
const val = range.min + range.span * i / steps;
|
|
8096
|
-
const y =
|
|
7907
|
+
const y = chunkP3T4E6JQ_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8097
7908
|
lines.push(
|
|
8098
7909
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8099
7910
|
"line",
|
|
@@ -8117,9 +7928,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
8117
7928
|
const labels = [];
|
|
8118
7929
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
8119
7930
|
if (range.logScale && range.logBase) {
|
|
8120
|
-
const ticks =
|
|
7931
|
+
const ticks = chunkP3T4E6JQ_js.generateLogTicks(range);
|
|
8121
7932
|
ticks.forEach((tickVal, i) => {
|
|
8122
|
-
const y =
|
|
7933
|
+
const y = chunkP3T4E6JQ_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
8123
7934
|
labels.push(
|
|
8124
7935
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8125
7936
|
"text",
|
|
@@ -8129,7 +7940,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
8129
7940
|
textAnchor: "end",
|
|
8130
7941
|
fontSize: 8,
|
|
8131
7942
|
fill: "#64748b",
|
|
8132
|
-
children: hasDisplayUnits ?
|
|
7943
|
+
children: hasDisplayUnits ? chunkP3T4E6JQ_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkP3T4E6JQ_js.formatAxisValue(tickVal)
|
|
8133
7944
|
},
|
|
8134
7945
|
`${id}-vaxis-log-${i}`
|
|
8135
7946
|
)
|
|
@@ -8139,7 +7950,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
8139
7950
|
const steps = 4;
|
|
8140
7951
|
for (let i = 0; i <= steps; i++) {
|
|
8141
7952
|
const val = range.min + range.span * i / steps;
|
|
8142
|
-
const y =
|
|
7953
|
+
const y = chunkP3T4E6JQ_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8143
7954
|
labels.push(
|
|
8144
7955
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8145
7956
|
"text",
|
|
@@ -8149,7 +7960,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
8149
7960
|
textAnchor: "end",
|
|
8150
7961
|
fontSize: 8,
|
|
8151
7962
|
fill: "#64748b",
|
|
8152
|
-
children: hasDisplayUnits ?
|
|
7963
|
+
children: hasDisplayUnits ? chunkP3T4E6JQ_js.formatAxisValueWithUnits(val, axisFormatting) : chunkP3T4E6JQ_js.formatAxisValue(val)
|
|
8153
7964
|
},
|
|
8154
7965
|
`${id}-vaxis-${i}`
|
|
8155
7966
|
)
|
|
@@ -8157,7 +7968,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
8157
7968
|
}
|
|
8158
7969
|
}
|
|
8159
7970
|
if (hasDisplayUnits) {
|
|
8160
|
-
const unitLabel =
|
|
7971
|
+
const unitLabel = chunkP3T4E6JQ_js.getDisplayUnitLabel(
|
|
8161
7972
|
axisFormatting.displayUnits,
|
|
8162
7973
|
axisFormatting.displayUnitsLabel
|
|
8163
7974
|
);
|
|
@@ -8232,7 +8043,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
8232
8043
|
if (range.min >= 0) {
|
|
8233
8044
|
return null;
|
|
8234
8045
|
}
|
|
8235
|
-
const y =
|
|
8046
|
+
const y = chunkP3T4E6JQ_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
8236
8047
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8237
8048
|
"line",
|
|
8238
8049
|
{
|
|
@@ -8256,7 +8067,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8256
8067
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
8257
8068
|
for (let i = 0; i <= steps; i++) {
|
|
8258
8069
|
const val = range.min + range.span * i / steps;
|
|
8259
|
-
const y =
|
|
8070
|
+
const y = chunkP3T4E6JQ_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8260
8071
|
labels.push(
|
|
8261
8072
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8262
8073
|
"text",
|
|
@@ -8268,7 +8079,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8268
8079
|
fontFamily,
|
|
8269
8080
|
fontWeight,
|
|
8270
8081
|
fill: fontColor,
|
|
8271
|
-
children: hasDisplayUnits ?
|
|
8082
|
+
children: hasDisplayUnits ? chunkP3T4E6JQ_js.formatAxisValueWithUnits(val, axisFormatting) : chunkP3T4E6JQ_js.formatAxisValue(val)
|
|
8272
8083
|
},
|
|
8273
8084
|
`${id}-sec-vaxis-${i}`
|
|
8274
8085
|
)
|
|
@@ -8292,7 +8103,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8292
8103
|
);
|
|
8293
8104
|
}
|
|
8294
8105
|
if (hasDisplayUnits) {
|
|
8295
|
-
const unitLabel =
|
|
8106
|
+
const unitLabel = chunkP3T4E6JQ_js.getDisplayUnitLabel(
|
|
8296
8107
|
axisFormatting.displayUnits,
|
|
8297
8108
|
axisFormatting.displayUnitsLabel
|
|
8298
8109
|
);
|
|
@@ -8323,7 +8134,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
8323
8134
|
const ticks = [];
|
|
8324
8135
|
for (let i = 0; i <= steps; i++) {
|
|
8325
8136
|
const val = range.min + range.span * i / steps;
|
|
8326
|
-
const y =
|
|
8137
|
+
const y = chunkP3T4E6JQ_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8327
8138
|
ticks.push(
|
|
8328
8139
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8329
8140
|
"line",
|
|
@@ -8350,7 +8161,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
8350
8161
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
8351
8162
|
for (let i = 0; i <= steps; i++) {
|
|
8352
8163
|
const val = range.min + range.span * i / steps;
|
|
8353
|
-
const y =
|
|
8164
|
+
const y = chunkP3T4E6JQ_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8354
8165
|
lines.push(
|
|
8355
8166
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8356
8167
|
"line",
|
|
@@ -8511,7 +8322,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
8511
8322
|
width: 8,
|
|
8512
8323
|
height: 8,
|
|
8513
8324
|
borderRadius: 2,
|
|
8514
|
-
backgroundColor:
|
|
8325
|
+
backgroundColor: chunkP3T4E6JQ_js.seriesColor(
|
|
8515
8326
|
s,
|
|
8516
8327
|
si,
|
|
8517
8328
|
chartData.style?.styleId,
|
|
@@ -8550,8 +8361,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
8550
8361
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
8551
8362
|
const style = chartData.style;
|
|
8552
8363
|
const legendPos = style?.legendPosition || "b";
|
|
8553
|
-
const range =
|
|
8554
|
-
const layout =
|
|
8364
|
+
const range = chunkP3T4E6JQ_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8365
|
+
const layout = chunkP3T4E6JQ_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8555
8366
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8556
8367
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
8557
8368
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -8572,10 +8383,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
8572
8383
|
const close = closeSeries.values[ci] ?? high;
|
|
8573
8384
|
const isUp = close >= open;
|
|
8574
8385
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
8575
|
-
const highY =
|
|
8576
|
-
const lowY =
|
|
8577
|
-
const openY =
|
|
8578
|
-
const closeY =
|
|
8386
|
+
const highY = chunkP3T4E6JQ_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
8387
|
+
const lowY = chunkP3T4E6JQ_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
8388
|
+
const openY = chunkP3T4E6JQ_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
8389
|
+
const closeY = chunkP3T4E6JQ_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
8579
8390
|
elements.push(
|
|
8580
8391
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8581
8392
|
"line",
|
|
@@ -8618,7 +8429,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
8618
8429
|
textAnchor: "middle",
|
|
8619
8430
|
fontSize: 7,
|
|
8620
8431
|
fill: "#334155",
|
|
8621
|
-
children:
|
|
8432
|
+
children: chunkP3T4E6JQ_js.formatAxisValue(close)
|
|
8622
8433
|
},
|
|
8623
8434
|
`${element.id}-stock-dl-${ci}`
|
|
8624
8435
|
)
|
|
@@ -8660,7 +8471,7 @@ function FailedToLoad() {
|
|
|
8660
8471
|
var LazySurfaceChart3DScene = React3__default.default.lazy(
|
|
8661
8472
|
async () => {
|
|
8662
8473
|
try {
|
|
8663
|
-
return await import('./SurfaceChart3DScene-
|
|
8474
|
+
return await import('./SurfaceChart3DScene-U6LVKSKR.js');
|
|
8664
8475
|
} catch {
|
|
8665
8476
|
return { default: FailedToLoad };
|
|
8666
8477
|
}
|
|
@@ -8684,7 +8495,7 @@ var SurfaceChart3DErrorBoundary = class extends React3__default.default.Componen
|
|
|
8684
8495
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
8685
8496
|
const rows = chartData.series.length;
|
|
8686
8497
|
const cols = Math.max(categoryLabels.length, 1);
|
|
8687
|
-
const range =
|
|
8498
|
+
const range = chunkP3T4E6JQ_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8688
8499
|
const heightMap = new Float32Array(rows * cols);
|
|
8689
8500
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
8690
8501
|
for (let r = 0; r < rows; r++) {
|
|
@@ -8804,8 +8615,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
8804
8615
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
8805
8616
|
const style = chartData.style;
|
|
8806
8617
|
const legendPos = style?.legendPosition || "b";
|
|
8807
|
-
const layout =
|
|
8808
|
-
const range =
|
|
8618
|
+
const layout = chunkP3T4E6JQ_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
8619
|
+
const range = chunkP3T4E6JQ_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8809
8620
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8810
8621
|
const seriesCount = chartData.series.length;
|
|
8811
8622
|
const cols = catCount - 1;
|
|
@@ -8895,8 +8706,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
8895
8706
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
8896
8707
|
const style = chartData.style;
|
|
8897
8708
|
const legendPos = style?.legendPosition || "b";
|
|
8898
|
-
const layout =
|
|
8899
|
-
const range =
|
|
8709
|
+
const layout = chunkP3T4E6JQ_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8710
|
+
const range = chunkP3T4E6JQ_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8900
8711
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8901
8712
|
const seriesCount = chartData.series.length;
|
|
8902
8713
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -8959,7 +8770,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
8959
8770
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
8960
8771
|
const style = chartData.style;
|
|
8961
8772
|
const legendPos = style?.legendPosition || "b";
|
|
8962
|
-
const layout =
|
|
8773
|
+
const layout = chunkP3T4E6JQ_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
8963
8774
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
8964
8775
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
8965
8776
|
const rects = [];
|
|
@@ -8982,7 +8793,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
8982
8793
|
y: curY,
|
|
8983
8794
|
width: Math.max(w - 1, 1),
|
|
8984
8795
|
height: Math.max(h - 1, 1),
|
|
8985
|
-
fill:
|
|
8796
|
+
fill: chunkP3T4E6JQ_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
8986
8797
|
rx: 2,
|
|
8987
8798
|
opacity: 0.85
|
|
8988
8799
|
},
|
|
@@ -9035,8 +8846,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
9035
8846
|
const style = chartData.style;
|
|
9036
8847
|
const legendPos = style?.legendPosition || "b";
|
|
9037
8848
|
const values = chartData.series[0]?.values ?? [];
|
|
9038
|
-
const range =
|
|
9039
|
-
const layout =
|
|
8849
|
+
const range = chunkP3T4E6JQ_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8850
|
+
const layout = chunkP3T4E6JQ_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
9040
8851
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
9041
8852
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
9042
8853
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -9047,8 +8858,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
9047
8858
|
const isLast = i === values.length - 1;
|
|
9048
8859
|
const startVal = isLast ? 0 : runningTotal;
|
|
9049
8860
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
9050
|
-
const barStartY =
|
|
9051
|
-
const barEndY =
|
|
8861
|
+
const barStartY = chunkP3T4E6JQ_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
8862
|
+
const barEndY = chunkP3T4E6JQ_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
9052
8863
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
9053
8864
|
const y = Math.min(barStartY, barEndY);
|
|
9054
8865
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -9077,7 +8888,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
9077
8888
|
textAnchor: "middle",
|
|
9078
8889
|
fontSize: 7,
|
|
9079
8890
|
fill: "#334155",
|
|
9080
|
-
children:
|
|
8891
|
+
children: chunkP3T4E6JQ_js.formatAxisValue(isLast ? endVal : val)
|
|
9081
8892
|
},
|
|
9082
8893
|
`${element.id}-wf-dl-${i}`
|
|
9083
8894
|
)
|
|
@@ -9125,18 +8936,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
9125
8936
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
9126
8937
|
const style = chartData.style;
|
|
9127
8938
|
const legendPos = style?.legendPosition || "b";
|
|
9128
|
-
const layoutOpts =
|
|
8939
|
+
const layoutOpts = chunkP3T4E6JQ_js.computeLayoutOptions(
|
|
9129
8940
|
chartData.axes,
|
|
9130
8941
|
chartData.dataTable,
|
|
9131
8942
|
chartData.series.length
|
|
9132
8943
|
);
|
|
9133
|
-
const layout =
|
|
9134
|
-
const { primary, secondary } =
|
|
8944
|
+
const layout = chunkP3T4E6JQ_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
8945
|
+
const { primary, secondary } = chunkP3T4E6JQ_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
9135
8946
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
9136
8947
|
const secondarySeries = secondary.map((e) => e.series);
|
|
9137
|
-
const range =
|
|
9138
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
9139
|
-
const secondaryAxisFmt =
|
|
8948
|
+
const range = chunkP3T4E6JQ_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
8949
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkP3T4E6JQ_js.computeValueRange(secondarySeries) : void 0;
|
|
8950
|
+
const secondaryAxisFmt = chunkP3T4E6JQ_js.getSecondaryValueAxis(chartData.axes);
|
|
9140
8951
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
9141
8952
|
const barSeriesCount = 1;
|
|
9142
8953
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -9152,8 +8963,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9152
8963
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
9153
8964
|
barSeries.values.forEach((val, vi) => {
|
|
9154
8965
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
9155
|
-
const zeroY =
|
|
9156
|
-
const valY =
|
|
8966
|
+
const zeroY = chunkP3T4E6JQ_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
8967
|
+
const valY = chunkP3T4E6JQ_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
9157
8968
|
const y = Math.min(zeroY, valY);
|
|
9158
8969
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
9159
8970
|
barElements.push(
|
|
@@ -9164,7 +8975,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9164
8975
|
y,
|
|
9165
8976
|
width: barWidth,
|
|
9166
8977
|
height: h,
|
|
9167
|
-
fill:
|
|
8978
|
+
fill: chunkP3T4E6JQ_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
9168
8979
|
rx: 1
|
|
9169
8980
|
},
|
|
9170
8981
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -9180,7 +8991,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9180
8991
|
textAnchor: "middle",
|
|
9181
8992
|
fontSize: 7,
|
|
9182
8993
|
fill: "#334155",
|
|
9183
|
-
children:
|
|
8994
|
+
children: chunkP3T4E6JQ_js.formatAxisValue(val)
|
|
9184
8995
|
},
|
|
9185
8996
|
`${element.id}-combo-bar-dl-${vi}`
|
|
9186
8997
|
)
|
|
@@ -9197,10 +9008,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9197
9008
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
9198
9009
|
const points = series.values.map((val, vi) => {
|
|
9199
9010
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
9200
|
-
const y =
|
|
9011
|
+
const y = chunkP3T4E6JQ_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
9201
9012
|
return { x, y, val };
|
|
9202
9013
|
});
|
|
9203
|
-
const c =
|
|
9014
|
+
const c = chunkP3T4E6JQ_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
9204
9015
|
lineElements.push(
|
|
9205
9016
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9206
9017
|
"polyline",
|
|
@@ -9227,7 +9038,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9227
9038
|
textAnchor: "middle",
|
|
9228
9039
|
fontSize: 7,
|
|
9229
9040
|
fill: "#334155",
|
|
9230
|
-
children:
|
|
9041
|
+
children: chunkP3T4E6JQ_js.formatAxisValue(p.val)
|
|
9231
9042
|
},
|
|
9232
9043
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
9233
9044
|
)
|
|
@@ -10981,14 +10792,14 @@ function buildNotesPdf(pages) {
|
|
|
10981
10792
|
notes: page.notes,
|
|
10982
10793
|
slideNumber: page.slideNumber
|
|
10983
10794
|
}));
|
|
10984
|
-
const bytes =
|
|
10795
|
+
const bytes = chunkP3T4E6JQ_js.buildNotesPdfBytes(images, meta);
|
|
10985
10796
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
10986
10797
|
return URL.createObjectURL(blob);
|
|
10987
10798
|
}
|
|
10988
10799
|
|
|
10989
10800
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
10990
10801
|
function buildPdfFromImageData(images) {
|
|
10991
|
-
const bytes =
|
|
10802
|
+
const bytes = chunkP3T4E6JQ_js.buildSlidesPdfBytes(images);
|
|
10992
10803
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
10993
10804
|
return URL.createObjectURL(blob);
|
|
10994
10805
|
}
|
|
@@ -10997,7 +10808,7 @@ function buildPdfFromImageData(images) {
|
|
|
10997
10808
|
var activePreview = null;
|
|
10998
10809
|
function startPreviewAnimation(elementId, preset, options) {
|
|
10999
10810
|
stopPreviewAnimation();
|
|
11000
|
-
const descriptor =
|
|
10811
|
+
const descriptor = chunkP3T4E6JQ_js.buildPreviewAnimation(preset, options);
|
|
11001
10812
|
if (!descriptor) {
|
|
11002
10813
|
return;
|
|
11003
10814
|
}
|
|
@@ -11043,366 +10854,6 @@ function stopPreviewAnimation() {
|
|
|
11043
10854
|
}
|
|
11044
10855
|
activePreview = null;
|
|
11045
10856
|
}
|
|
11046
|
-
var SVG_FILTER_EFFECTS = /* @__PURE__ */ new Set([
|
|
11047
|
-
"artisticFilmGrain",
|
|
11048
|
-
"filmGrain",
|
|
11049
|
-
"artisticCutout",
|
|
11050
|
-
"cutout",
|
|
11051
|
-
"artisticCement",
|
|
11052
|
-
"cement",
|
|
11053
|
-
"artisticTexturizer",
|
|
11054
|
-
"texturizer",
|
|
11055
|
-
"artisticCrisscrossEtching",
|
|
11056
|
-
"crisscrossEtching",
|
|
11057
|
-
"artisticMosaic",
|
|
11058
|
-
"artisticMosaicBubbles",
|
|
11059
|
-
"mosaicBubbles",
|
|
11060
|
-
"mosaic",
|
|
11061
|
-
"artisticGlowEdges",
|
|
11062
|
-
"glowEdges",
|
|
11063
|
-
"glow_edges",
|
|
11064
|
-
"artisticChalkSketch",
|
|
11065
|
-
"chalkSketch",
|
|
11066
|
-
"chalk",
|
|
11067
|
-
"artisticPencilSketch",
|
|
11068
|
-
"pencilSketch",
|
|
11069
|
-
"artisticPencilGrayscale",
|
|
11070
|
-
"pencilGrayscale",
|
|
11071
|
-
"grayPencil"
|
|
11072
|
-
]);
|
|
11073
|
-
function getArtisticFilterId(elementId) {
|
|
11074
|
-
return `artistic-fx-${elementId}`;
|
|
11075
|
-
}
|
|
11076
|
-
function needsSvgArtisticFilter(effectName) {
|
|
11077
|
-
if (!effectName) {
|
|
11078
|
-
return false;
|
|
11079
|
-
}
|
|
11080
|
-
return SVG_FILTER_EFFECTS.has(effectName);
|
|
11081
|
-
}
|
|
11082
|
-
function renderArtisticEffectSvgFilter(elementId, effectName, radius) {
|
|
11083
|
-
if (!effectName || !needsSvgArtisticFilter(effectName)) {
|
|
11084
|
-
return null;
|
|
11085
|
-
}
|
|
11086
|
-
const filterId = getArtisticFilterId(elementId);
|
|
11087
|
-
const filterContent = buildFilterPrimitives(effectName, radius);
|
|
11088
|
-
if (!filterContent) {
|
|
11089
|
-
return null;
|
|
11090
|
-
}
|
|
11091
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11092
|
-
"svg",
|
|
11093
|
-
{
|
|
11094
|
-
width: 0,
|
|
11095
|
-
height: 0,
|
|
11096
|
-
style: { position: "absolute", overflow: "hidden" },
|
|
11097
|
-
"aria-hidden": "true",
|
|
11098
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11099
|
-
"filter",
|
|
11100
|
-
{
|
|
11101
|
-
id: filterId,
|
|
11102
|
-
x: "0%",
|
|
11103
|
-
y: "0%",
|
|
11104
|
-
width: "100%",
|
|
11105
|
-
height: "100%",
|
|
11106
|
-
colorInterpolationFilters: "sRGB",
|
|
11107
|
-
children: filterContent
|
|
11108
|
-
}
|
|
11109
|
-
) })
|
|
11110
|
-
}
|
|
11111
|
-
);
|
|
11112
|
-
}
|
|
11113
|
-
function buildFilterPrimitives(effectName, radius) {
|
|
11114
|
-
const normalizedRadius = Math.max(0, Math.min(100, radius)) / 100;
|
|
11115
|
-
switch (effectName) {
|
|
11116
|
-
// ── Film Grain ──────────────────────────────────────────────────────
|
|
11117
|
-
// Subtle noise overlay using feTurbulence blended with the source.
|
|
11118
|
-
case "artisticFilmGrain":
|
|
11119
|
-
case "filmGrain": {
|
|
11120
|
-
const freq = 0.5 + normalizedRadius * 0.5;
|
|
11121
|
-
const opacity = 0.15 + normalizedRadius * 0.25;
|
|
11122
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11123
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11124
|
-
"feTurbulence",
|
|
11125
|
-
{
|
|
11126
|
-
type: "fractalNoise",
|
|
11127
|
-
baseFrequency: freq,
|
|
11128
|
-
numOctaves: 4,
|
|
11129
|
-
seed: 1,
|
|
11130
|
-
stitchTiles: "stitch",
|
|
11131
|
-
result: "grain"
|
|
11132
|
-
}
|
|
11133
|
-
),
|
|
11134
|
-
/* @__PURE__ */ jsxRuntime.jsx("feColorMatrix", { in: "grain", type: "saturate", values: "0", result: "grainGray" }),
|
|
11135
|
-
/* @__PURE__ */ jsxRuntime.jsx("feBlend", { in: "SourceGraphic", in2: "grainGray", mode: "overlay" }),
|
|
11136
|
-
/* @__PURE__ */ jsxRuntime.jsxs("feComponentTransfer", { children: [
|
|
11137
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncR", { type: "linear", slope: 1 + opacity * 0.3, intercept: opacity * 0.02 }),
|
|
11138
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncG", { type: "linear", slope: 1 + opacity * 0.3, intercept: opacity * 0.02 }),
|
|
11139
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncB", { type: "linear", slope: 1 + opacity * 0.3, intercept: opacity * 0.02 })
|
|
11140
|
-
] })
|
|
11141
|
-
] });
|
|
11142
|
-
}
|
|
11143
|
-
// ── Cutout ──────────────────────────────────────────────────────────
|
|
11144
|
-
// Posterization: reduce colours to discrete steps using feComponentTransfer
|
|
11145
|
-
// with `discrete` table values.
|
|
11146
|
-
case "artisticCutout":
|
|
11147
|
-
case "cutout": {
|
|
11148
|
-
const steps = Math.max(2, Math.round(4 + normalizedRadius * 4));
|
|
11149
|
-
const tableValues = buildDiscreteTable(steps);
|
|
11150
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("feComponentTransfer", { children: [
|
|
11151
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncR", { type: "discrete", tableValues }),
|
|
11152
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncG", { type: "discrete", tableValues }),
|
|
11153
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncB", { type: "discrete", tableValues })
|
|
11154
|
-
] });
|
|
11155
|
-
}
|
|
11156
|
-
// ── Cement ──────────────────────────────────────────────────────────
|
|
11157
|
-
// Desaturated image with a fine noise texture overlay.
|
|
11158
|
-
case "artisticCement":
|
|
11159
|
-
case "cement": {
|
|
11160
|
-
const freq = 1.5 + normalizedRadius * 2.5;
|
|
11161
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11162
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11163
|
-
"feColorMatrix",
|
|
11164
|
-
{
|
|
11165
|
-
type: "saturate",
|
|
11166
|
-
values: `${Math.max(0, 0.4 - normalizedRadius * 0.3)}`,
|
|
11167
|
-
result: "desat"
|
|
11168
|
-
}
|
|
11169
|
-
),
|
|
11170
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11171
|
-
"feTurbulence",
|
|
11172
|
-
{
|
|
11173
|
-
type: "fractalNoise",
|
|
11174
|
-
baseFrequency: freq,
|
|
11175
|
-
numOctaves: 5,
|
|
11176
|
-
seed: 2,
|
|
11177
|
-
stitchTiles: "stitch",
|
|
11178
|
-
result: "cementNoise"
|
|
11179
|
-
}
|
|
11180
|
-
),
|
|
11181
|
-
/* @__PURE__ */ jsxRuntime.jsx("feColorMatrix", { in: "cementNoise", type: "saturate", values: "0", result: "cementGray" }),
|
|
11182
|
-
/* @__PURE__ */ jsxRuntime.jsx("feBlend", { in: "desat", in2: "cementGray", mode: "multiply" }),
|
|
11183
|
-
/* @__PURE__ */ jsxRuntime.jsxs("feComponentTransfer", { children: [
|
|
11184
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncR", { type: "linear", slope: 1.2, intercept: 0 }),
|
|
11185
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncG", { type: "linear", slope: 1.2, intercept: 0 }),
|
|
11186
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncB", { type: "linear", slope: 1.2, intercept: 0 })
|
|
11187
|
-
] })
|
|
11188
|
-
] });
|
|
11189
|
-
}
|
|
11190
|
-
// ── Texturizer ─────────────────────────────────────────────────────
|
|
11191
|
-
// Fine noise texture overlay on the original image.
|
|
11192
|
-
case "artisticTexturizer":
|
|
11193
|
-
case "texturizer": {
|
|
11194
|
-
const freq = 2 + normalizedRadius * 3;
|
|
11195
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11196
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11197
|
-
"feTurbulence",
|
|
11198
|
-
{
|
|
11199
|
-
type: "fractalNoise",
|
|
11200
|
-
baseFrequency: freq,
|
|
11201
|
-
numOctaves: 3,
|
|
11202
|
-
seed: 3,
|
|
11203
|
-
stitchTiles: "stitch",
|
|
11204
|
-
result: "texNoise"
|
|
11205
|
-
}
|
|
11206
|
-
),
|
|
11207
|
-
/* @__PURE__ */ jsxRuntime.jsx("feColorMatrix", { in: "texNoise", type: "saturate", values: "0", result: "texGray" }),
|
|
11208
|
-
/* @__PURE__ */ jsxRuntime.jsx("feBlend", { in: "SourceGraphic", in2: "texGray", mode: "overlay" }),
|
|
11209
|
-
/* @__PURE__ */ jsxRuntime.jsxs("feComponentTransfer", { children: [
|
|
11210
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncR", { type: "linear", slope: 1.1, intercept: 0.02 }),
|
|
11211
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncG", { type: "linear", slope: 1.1, intercept: 0.02 }),
|
|
11212
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncB", { type: "linear", slope: 1.1, intercept: 0.02 })
|
|
11213
|
-
] })
|
|
11214
|
-
] });
|
|
11215
|
-
}
|
|
11216
|
-
// ── Crisscross Etching ─────────────────────────────────────────────
|
|
11217
|
-
// Grayscale image with a hatching-like line pattern overlay.
|
|
11218
|
-
case "artisticCrisscrossEtching":
|
|
11219
|
-
case "crisscrossEtching": {
|
|
11220
|
-
const freq = 0.08 + normalizedRadius * 0.12;
|
|
11221
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11222
|
-
/* @__PURE__ */ jsxRuntime.jsx("feColorMatrix", { type: "saturate", values: "0", result: "gray" }),
|
|
11223
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11224
|
-
"feTurbulence",
|
|
11225
|
-
{
|
|
11226
|
-
type: "turbulence",
|
|
11227
|
-
baseFrequency: `${freq} ${freq * 3}`,
|
|
11228
|
-
numOctaves: 1,
|
|
11229
|
-
seed: 7,
|
|
11230
|
-
result: "lines"
|
|
11231
|
-
}
|
|
11232
|
-
),
|
|
11233
|
-
/* @__PURE__ */ jsxRuntime.jsx("feColorMatrix", { in: "lines", type: "saturate", values: "0", result: "linesGray" }),
|
|
11234
|
-
/* @__PURE__ */ jsxRuntime.jsx("feBlend", { in: "gray", in2: "linesGray", mode: "multiply" }),
|
|
11235
|
-
/* @__PURE__ */ jsxRuntime.jsxs("feComponentTransfer", { children: [
|
|
11236
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncR", { type: "linear", slope: 1.3, intercept: -0.05 }),
|
|
11237
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncG", { type: "linear", slope: 1.3, intercept: -0.05 }),
|
|
11238
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncB", { type: "linear", slope: 1.3, intercept: -0.05 })
|
|
11239
|
-
] })
|
|
11240
|
-
] });
|
|
11241
|
-
}
|
|
11242
|
-
// ── Mosaic / Mosaic Bubbles ─────────────────────────────────────────
|
|
11243
|
-
// Pixelation effect: achieved via heavy blur + displacement noise.
|
|
11244
|
-
// True pixelation requires image-rendering: pixelated + downscale
|
|
11245
|
-
// but SVG filter gives a reasonable approximation.
|
|
11246
|
-
case "artisticMosaic":
|
|
11247
|
-
case "artisticMosaicBubbles":
|
|
11248
|
-
case "mosaicBubbles":
|
|
11249
|
-
case "mosaic": {
|
|
11250
|
-
const blurAmount = Math.max(2, Math.round(radius * 0.8));
|
|
11251
|
-
const freq = 0.02 + normalizedRadius * 0.03;
|
|
11252
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11253
|
-
/* @__PURE__ */ jsxRuntime.jsx("feGaussianBlur", { in: "SourceGraphic", stdDeviation: blurAmount, result: "blurred" }),
|
|
11254
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11255
|
-
"feTurbulence",
|
|
11256
|
-
{
|
|
11257
|
-
type: "turbulence",
|
|
11258
|
-
baseFrequency: freq,
|
|
11259
|
-
numOctaves: 1,
|
|
11260
|
-
seed: 4,
|
|
11261
|
-
result: "cells"
|
|
11262
|
-
}
|
|
11263
|
-
),
|
|
11264
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11265
|
-
"feDisplacementMap",
|
|
11266
|
-
{
|
|
11267
|
-
in: "blurred",
|
|
11268
|
-
in2: "cells",
|
|
11269
|
-
scale: blurAmount * 0.5,
|
|
11270
|
-
xChannelSelector: "R",
|
|
11271
|
-
yChannelSelector: "G",
|
|
11272
|
-
result: "mosaic"
|
|
11273
|
-
}
|
|
11274
|
-
),
|
|
11275
|
-
/* @__PURE__ */ jsxRuntime.jsxs("feComponentTransfer", { in: "mosaic", children: [
|
|
11276
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncR", { type: "linear", slope: 1.05, intercept: 0 }),
|
|
11277
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncG", { type: "linear", slope: 1.05, intercept: 0 }),
|
|
11278
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncB", { type: "linear", slope: 1.05, intercept: 0 })
|
|
11279
|
-
] })
|
|
11280
|
-
] });
|
|
11281
|
-
}
|
|
11282
|
-
// ── Glow Edges ─────────────────────────────────────────────────────
|
|
11283
|
-
// Edge detection with glow: invert, blur slightly, overlay to
|
|
11284
|
-
// create edge-glowing effect.
|
|
11285
|
-
case "artisticGlowEdges":
|
|
11286
|
-
case "glowEdges":
|
|
11287
|
-
case "glow_edges": {
|
|
11288
|
-
const edgeBlur = Math.max(1, Math.round(normalizedRadius * 3));
|
|
11289
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11290
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11291
|
-
"feColorMatrix",
|
|
11292
|
-
{
|
|
11293
|
-
type: "matrix",
|
|
11294
|
-
values: "-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0",
|
|
11295
|
-
result: "inverted"
|
|
11296
|
-
}
|
|
11297
|
-
),
|
|
11298
|
-
/* @__PURE__ */ jsxRuntime.jsx("feGaussianBlur", { in: "inverted", stdDeviation: edgeBlur, result: "blurredInv" }),
|
|
11299
|
-
/* @__PURE__ */ jsxRuntime.jsx("feBlend", { in: "SourceGraphic", in2: "blurredInv", mode: "screen" }),
|
|
11300
|
-
/* @__PURE__ */ jsxRuntime.jsxs("feComponentTransfer", { children: [
|
|
11301
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncR", { type: "linear", slope: 2, intercept: -0.3 }),
|
|
11302
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncG", { type: "linear", slope: 2, intercept: -0.3 }),
|
|
11303
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncB", { type: "linear", slope: 2, intercept: -0.3 })
|
|
11304
|
-
] })
|
|
11305
|
-
] });
|
|
11306
|
-
}
|
|
11307
|
-
// ── Chalk Sketch ───────────────────────────────────────────────────
|
|
11308
|
-
// Grayscale with high contrast and chalk-like noise texture.
|
|
11309
|
-
case "artisticChalkSketch":
|
|
11310
|
-
case "chalkSketch":
|
|
11311
|
-
case "chalk": {
|
|
11312
|
-
const freq = 1 + normalizedRadius * 2;
|
|
11313
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11314
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11315
|
-
"feColorMatrix",
|
|
11316
|
-
{
|
|
11317
|
-
type: "saturate",
|
|
11318
|
-
values: `${Math.max(0, 0.2 - normalizedRadius * 0.2)}`,
|
|
11319
|
-
result: "gray"
|
|
11320
|
-
}
|
|
11321
|
-
),
|
|
11322
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11323
|
-
"feTurbulence",
|
|
11324
|
-
{
|
|
11325
|
-
type: "fractalNoise",
|
|
11326
|
-
baseFrequency: freq,
|
|
11327
|
-
numOctaves: 4,
|
|
11328
|
-
seed: 5,
|
|
11329
|
-
stitchTiles: "stitch",
|
|
11330
|
-
result: "chalkTex"
|
|
11331
|
-
}
|
|
11332
|
-
),
|
|
11333
|
-
/* @__PURE__ */ jsxRuntime.jsx("feColorMatrix", { in: "chalkTex", type: "saturate", values: "0", result: "chalkGray" }),
|
|
11334
|
-
/* @__PURE__ */ jsxRuntime.jsx("feBlend", { in: "gray", in2: "chalkGray", mode: "overlay" }),
|
|
11335
|
-
/* @__PURE__ */ jsxRuntime.jsxs("feComponentTransfer", { children: [
|
|
11336
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncR", { type: "linear", slope: 1.5, intercept: 0.05 }),
|
|
11337
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncG", { type: "linear", slope: 1.5, intercept: 0.05 }),
|
|
11338
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncB", { type: "linear", slope: 1.5, intercept: 0.05 })
|
|
11339
|
-
] })
|
|
11340
|
-
] });
|
|
11341
|
-
}
|
|
11342
|
-
// ── Pencil Sketch ──────────────────────────────────────────────────
|
|
11343
|
-
// Grayscale with edge enhancement: invert + blur + blend (multiply)
|
|
11344
|
-
// to create pencil-drawing look.
|
|
11345
|
-
case "artisticPencilSketch":
|
|
11346
|
-
case "pencilSketch": {
|
|
11347
|
-
const blurAmt = Math.max(3, Math.round(4 + normalizedRadius * 8));
|
|
11348
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11349
|
-
/* @__PURE__ */ jsxRuntime.jsx("feColorMatrix", { type: "saturate", values: "0", result: "gray" }),
|
|
11350
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11351
|
-
"feColorMatrix",
|
|
11352
|
-
{
|
|
11353
|
-
in: "gray",
|
|
11354
|
-
type: "matrix",
|
|
11355
|
-
values: "-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0",
|
|
11356
|
-
result: "invGray"
|
|
11357
|
-
}
|
|
11358
|
-
),
|
|
11359
|
-
/* @__PURE__ */ jsxRuntime.jsx("feGaussianBlur", { in: "invGray", stdDeviation: blurAmt, result: "blurInv" }),
|
|
11360
|
-
/* @__PURE__ */ jsxRuntime.jsx("feBlend", { in: "blurInv", in2: "gray", mode: "screen", result: "sketch" }),
|
|
11361
|
-
/* @__PURE__ */ jsxRuntime.jsxs("feComponentTransfer", { in: "sketch", children: [
|
|
11362
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncR", { type: "linear", slope: 1.6, intercept: -0.15 }),
|
|
11363
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncG", { type: "linear", slope: 1.6, intercept: -0.15 }),
|
|
11364
|
-
/* @__PURE__ */ jsxRuntime.jsx("feFuncB", { type: "linear", slope: 1.6, intercept: -0.15 })
|
|
11365
|
-
] })
|
|
11366
|
-
] });
|
|
11367
|
-
}
|
|
11368
|
-
// ── Pencil Grayscale ───────────────────────────────────────────────
|
|
11369
|
-
// Desaturated image with enhanced edge contrast (sharpen effect).
|
|
11370
|
-
case "artisticPencilGrayscale":
|
|
11371
|
-
case "pencilGrayscale":
|
|
11372
|
-
case "grayPencil": {
|
|
11373
|
-
const sharpenBlur = Math.max(0.5, 1 + normalizedRadius * 2);
|
|
11374
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11375
|
-
/* @__PURE__ */ jsxRuntime.jsx("feColorMatrix", { type: "saturate", values: "0", result: "gray" }),
|
|
11376
|
-
/* @__PURE__ */ jsxRuntime.jsx("feGaussianBlur", { in: "gray", stdDeviation: sharpenBlur, result: "grayBlur" }),
|
|
11377
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11378
|
-
"feComposite",
|
|
11379
|
-
{
|
|
11380
|
-
in: "gray",
|
|
11381
|
-
in2: "grayBlur",
|
|
11382
|
-
operator: "arithmetic",
|
|
11383
|
-
k1: 0,
|
|
11384
|
-
k2: 1.5,
|
|
11385
|
-
k3: -0.5,
|
|
11386
|
-
k4: 0
|
|
11387
|
-
}
|
|
11388
|
-
)
|
|
11389
|
-
] });
|
|
11390
|
-
}
|
|
11391
|
-
default:
|
|
11392
|
-
return null;
|
|
11393
|
-
}
|
|
11394
|
-
}
|
|
11395
|
-
function buildDiscreteTable(steps) {
|
|
11396
|
-
const values = [];
|
|
11397
|
-
for (let i = 0; i < steps; i++) {
|
|
11398
|
-
const v = Math.round(i / (steps - 1) * 100) / 100;
|
|
11399
|
-
const count = Math.ceil(256 / steps);
|
|
11400
|
-
for (let j = 0; j < count; j++) {
|
|
11401
|
-
values.push(v);
|
|
11402
|
-
}
|
|
11403
|
-
}
|
|
11404
|
-
return values.slice(0, 256).join(" ");
|
|
11405
|
-
}
|
|
11406
10857
|
|
|
11407
10858
|
// src/viewer/hooks/useElementOperations.ts
|
|
11408
10859
|
function useElementOperations(input) {
|
|
@@ -11435,7 +10886,7 @@ function useElementOperations(input) {
|
|
|
11435
10886
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
11436
10887
|
const updateElementById = React3.useCallback(
|
|
11437
10888
|
(elementId, updates) => {
|
|
11438
|
-
if (
|
|
10889
|
+
if (chunkP3T4E6JQ_js.isTemplateElementId(elementId)) {
|
|
11439
10890
|
const slideId = activeSlide?.id;
|
|
11440
10891
|
if (slideId) {
|
|
11441
10892
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -11475,7 +10926,7 @@ function useElementOperations(input) {
|
|
|
11475
10926
|
);
|
|
11476
10927
|
const updateSelectedShapeStyle = React3.useCallback(
|
|
11477
10928
|
(updates) => {
|
|
11478
|
-
if (!selectedElement || !
|
|
10929
|
+
if (!selectedElement || !chunkAD3EAEY6_js.hasShapeProperties(selectedElement)) {
|
|
11479
10930
|
return;
|
|
11480
10931
|
}
|
|
11481
10932
|
updateSelectedElement({
|
|
@@ -11486,17 +10937,17 @@ function useElementOperations(input) {
|
|
|
11486
10937
|
);
|
|
11487
10938
|
const updateSelectedTextStyle = React3.useCallback(
|
|
11488
10939
|
(updates) => {
|
|
11489
|
-
if (!selectedElement || !
|
|
10940
|
+
if (!selectedElement || !chunkAD3EAEY6_js.hasTextProperties(selectedElement)) {
|
|
11490
10941
|
return;
|
|
11491
10942
|
}
|
|
11492
|
-
const inlineSel =
|
|
10943
|
+
const inlineSel = chunkP3T4E6JQ_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
11493
10944
|
if (inlineSel && selectedElement.textSegments) {
|
|
11494
|
-
const { newSegments: newSegments2, newSelection } =
|
|
10945
|
+
const { newSegments: newSegments2, newSelection } = chunkP3T4E6JQ_js.applyStyleToSelectedSegments(
|
|
11495
10946
|
selectedElement.textSegments,
|
|
11496
10947
|
inlineSel,
|
|
11497
10948
|
updates
|
|
11498
10949
|
);
|
|
11499
|
-
|
|
10950
|
+
chunkP3T4E6JQ_js.setPendingSelectionRestore(newSelection);
|
|
11500
10951
|
updateSelectedElement({
|
|
11501
10952
|
textSegments: newSegments2
|
|
11502
10953
|
});
|
|
@@ -11516,12 +10967,12 @@ function useElementOperations(input) {
|
|
|
11516
10967
|
);
|
|
11517
10968
|
const updateSelectedTextCase = React3.useCallback(
|
|
11518
10969
|
(mode) => {
|
|
11519
|
-
if (!selectedElement || !
|
|
10970
|
+
if (!selectedElement || !chunkAD3EAEY6_js.hasTextProperties(selectedElement)) {
|
|
11520
10971
|
return;
|
|
11521
10972
|
}
|
|
11522
|
-
const inlineSel =
|
|
10973
|
+
const inlineSel = chunkP3T4E6JQ_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
11523
10974
|
if (inlineSel && selectedElement.textSegments) {
|
|
11524
|
-
const newSegments =
|
|
10975
|
+
const newSegments = chunkP3T4E6JQ_js.applyCaseTransformToSegments(
|
|
11525
10976
|
selectedElement.textSegments,
|
|
11526
10977
|
inlineSel,
|
|
11527
10978
|
mode
|
|
@@ -11531,14 +10982,14 @@ function useElementOperations(input) {
|
|
|
11531
10982
|
}
|
|
11532
10983
|
const updates = {};
|
|
11533
10984
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
11534
|
-
updates.textSegments =
|
|
10985
|
+
updates.textSegments = chunkP3T4E6JQ_js.applyCaseTransformToSegments(
|
|
11535
10986
|
selectedElement.textSegments,
|
|
11536
10987
|
null,
|
|
11537
10988
|
mode
|
|
11538
10989
|
);
|
|
11539
10990
|
}
|
|
11540
10991
|
if (typeof selectedElement.text === "string") {
|
|
11541
|
-
updates.text =
|
|
10992
|
+
updates.text = chunkP3T4E6JQ_js.transformTextCase(selectedElement.text, mode);
|
|
11542
10993
|
}
|
|
11543
10994
|
updateSelectedElement(updates);
|
|
11544
10995
|
},
|
|
@@ -11593,7 +11044,7 @@ function useSectionOperations(input) {
|
|
|
11593
11044
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
11594
11045
|
const addSection2 = React3.useCallback(
|
|
11595
11046
|
(name, afterSlideIndex) => {
|
|
11596
|
-
const result =
|
|
11047
|
+
const result = chunkP3T4E6JQ_js.addSection(sections, slides, name, afterSlideIndex);
|
|
11597
11048
|
setSlides(result.slides);
|
|
11598
11049
|
setSections(result.sections);
|
|
11599
11050
|
markDirty();
|
|
@@ -11602,7 +11053,7 @@ function useSectionOperations(input) {
|
|
|
11602
11053
|
);
|
|
11603
11054
|
const renameSection2 = React3.useCallback(
|
|
11604
11055
|
(sectionId, newName) => {
|
|
11605
|
-
const result =
|
|
11056
|
+
const result = chunkP3T4E6JQ_js.renameSection(sections, slides, sectionId, newName);
|
|
11606
11057
|
setSections(result.sections);
|
|
11607
11058
|
setSlides(result.slides);
|
|
11608
11059
|
markDirty();
|
|
@@ -11611,7 +11062,7 @@ function useSectionOperations(input) {
|
|
|
11611
11062
|
);
|
|
11612
11063
|
const deleteSection2 = React3.useCallback(
|
|
11613
11064
|
(sectionId) => {
|
|
11614
|
-
const result =
|
|
11065
|
+
const result = chunkP3T4E6JQ_js.deleteSection(sections, slides, sectionId);
|
|
11615
11066
|
setSections(result.sections);
|
|
11616
11067
|
setSlides(result.slides);
|
|
11617
11068
|
markDirty();
|
|
@@ -11620,21 +11071,21 @@ function useSectionOperations(input) {
|
|
|
11620
11071
|
);
|
|
11621
11072
|
const moveSectionUp2 = React3.useCallback(
|
|
11622
11073
|
(sectionId) => {
|
|
11623
|
-
setSections(
|
|
11074
|
+
setSections(chunkP3T4E6JQ_js.moveSectionUp(sections, sectionId));
|
|
11624
11075
|
markDirty();
|
|
11625
11076
|
},
|
|
11626
11077
|
[sections, setSections, markDirty]
|
|
11627
11078
|
);
|
|
11628
11079
|
const moveSectionDown2 = React3.useCallback(
|
|
11629
11080
|
(sectionId) => {
|
|
11630
|
-
setSections(
|
|
11081
|
+
setSections(chunkP3T4E6JQ_js.moveSectionDown(sections, sectionId));
|
|
11631
11082
|
markDirty();
|
|
11632
11083
|
},
|
|
11633
11084
|
[sections, setSections, markDirty]
|
|
11634
11085
|
);
|
|
11635
11086
|
const moveSlidesToSection2 = React3.useCallback(
|
|
11636
11087
|
(slideIndexes, targetSectionId) => {
|
|
11637
|
-
const result =
|
|
11088
|
+
const result = chunkP3T4E6JQ_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
11638
11089
|
setSlides(result.slides);
|
|
11639
11090
|
setSections(result.sections);
|
|
11640
11091
|
markDirty();
|
|
@@ -11653,7 +11104,7 @@ function useSectionOperations(input) {
|
|
|
11653
11104
|
|
|
11654
11105
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
11655
11106
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
11656
|
-
const resized =
|
|
11107
|
+
const resized = chunkP3T4E6JQ_js.applyResize(
|
|
11657
11108
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
11658
11109
|
handle,
|
|
11659
11110
|
dx,
|
|
@@ -11665,7 +11116,7 @@ function computeResizeGeometry(handle, startX, startY, startWidth, startHeight,
|
|
|
11665
11116
|
if (!snapToGrid) {
|
|
11666
11117
|
return box;
|
|
11667
11118
|
}
|
|
11668
|
-
return
|
|
11119
|
+
return chunkP3T4E6JQ_js.snapBoxToGrid(box, handle, gridSpacingPx, MIN_ELEMENT_SIZE);
|
|
11669
11120
|
}
|
|
11670
11121
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
11671
11122
|
const range = startWidth || 200;
|
|
@@ -11775,7 +11226,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
11775
11226
|
width: el.width,
|
|
11776
11227
|
height: el.height
|
|
11777
11228
|
}));
|
|
11778
|
-
const snapResult =
|
|
11229
|
+
const snapResult = chunkP3T4E6JQ_js.computeSnapToShape(
|
|
11779
11230
|
targetX,
|
|
11780
11231
|
targetY,
|
|
11781
11232
|
primaryEl.width,
|
|
@@ -11918,13 +11369,13 @@ function processPointerUp(input) {
|
|
|
11918
11369
|
if (i !== activeSlideIndex) {
|
|
11919
11370
|
return s;
|
|
11920
11371
|
}
|
|
11921
|
-
const rerouted =
|
|
11372
|
+
const rerouted = chunkP3T4E6JQ_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
11922
11373
|
if (rerouted.length === 0) {
|
|
11923
11374
|
return s;
|
|
11924
11375
|
}
|
|
11925
11376
|
return {
|
|
11926
11377
|
...s,
|
|
11927
|
-
elements:
|
|
11378
|
+
elements: chunkP3T4E6JQ_js.applyReroutedConnectors(s.elements, rerouted)
|
|
11928
11379
|
};
|
|
11929
11380
|
})
|
|
11930
11381
|
);
|
|
@@ -11943,9 +11394,9 @@ function processPointerUp(input) {
|
|
|
11943
11394
|
}
|
|
11944
11395
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
11945
11396
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
11946
|
-
const hitIds =
|
|
11397
|
+
const hitIds = chunkP3T4E6JQ_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
11947
11398
|
if (marquee.additive) {
|
|
11948
|
-
const merged =
|
|
11399
|
+
const merged = chunkP3T4E6JQ_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
11949
11400
|
if (merged.length > 0) {
|
|
11950
11401
|
applySelection(merged[0], merged);
|
|
11951
11402
|
} else {
|
|
@@ -11968,8 +11419,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
11968
11419
|
}
|
|
11969
11420
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
11970
11421
|
});
|
|
11971
|
-
const rerouted =
|
|
11972
|
-
return
|
|
11422
|
+
const rerouted = chunkP3T4E6JQ_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
11423
|
+
return chunkP3T4E6JQ_js.applyReroutedConnectors(movedElements, rerouted);
|
|
11973
11424
|
};
|
|
11974
11425
|
if (editTemplateMode) {
|
|
11975
11426
|
const slideId = activeSlide?.id;
|
|
@@ -12119,8 +11570,8 @@ function useCanvasInteractions(input) {
|
|
|
12119
11570
|
return;
|
|
12120
11571
|
}
|
|
12121
11572
|
const el = elementLookup.get(editId);
|
|
12122
|
-
if (el &&
|
|
12123
|
-
const newSegments =
|
|
11573
|
+
if (el && chunkAD3EAEY6_js.hasTextProperties(el)) {
|
|
11574
|
+
const newSegments = chunkP3T4E6JQ_js.remapTextToSegments(inlineEditingText, el.textSegments, el.textStyle);
|
|
12124
11575
|
ops.updateElementById(editId, {
|
|
12125
11576
|
text: inlineEditingText,
|
|
12126
11577
|
textSegments: newSegments
|
|
@@ -12131,7 +11582,7 @@ function useCanvasInteractions(input) {
|
|
|
12131
11582
|
setInlineEditingText("");
|
|
12132
11583
|
};
|
|
12133
11584
|
const openEquationEditorForElement = (el) => {
|
|
12134
|
-
if (!
|
|
11585
|
+
if (!chunkAD3EAEY6_js.hasTextProperties(el)) {
|
|
12135
11586
|
return false;
|
|
12136
11587
|
}
|
|
12137
11588
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -12160,7 +11611,7 @@ function useCanvasInteractions(input) {
|
|
|
12160
11611
|
justSelectedRef.current = false;
|
|
12161
11612
|
} else {
|
|
12162
11613
|
const el = elementLookup.get(elementId);
|
|
12163
|
-
if (el &&
|
|
11614
|
+
if (el && chunkAD3EAEY6_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
12164
11615
|
if (!openEquationEditorForElement(el)) {
|
|
12165
11616
|
setInlineEditingElementId(elementId);
|
|
12166
11617
|
setInlineEditingText(el.text ?? "");
|
|
@@ -12179,7 +11630,7 @@ function useCanvasInteractions(input) {
|
|
|
12179
11630
|
if (openEquationEditorForElement(el)) {
|
|
12180
11631
|
return;
|
|
12181
11632
|
}
|
|
12182
|
-
if (
|
|
11633
|
+
if (chunkAD3EAEY6_js.hasTextProperties(el)) {
|
|
12183
11634
|
setInlineEditingElementId(elementId);
|
|
12184
11635
|
setInlineEditingText(el.text ?? "");
|
|
12185
11636
|
}
|
|
@@ -12366,7 +11817,7 @@ function createFileHandlers(deps) {
|
|
|
12366
11817
|
h = Math.round(h * scale);
|
|
12367
11818
|
}
|
|
12368
11819
|
addElement({
|
|
12369
|
-
id:
|
|
11820
|
+
id: chunkP3T4E6JQ_js.generateElementId(),
|
|
12370
11821
|
type: "image",
|
|
12371
11822
|
x: Math.round((canvasSize.width - w) / 2),
|
|
12372
11823
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -12377,7 +11828,7 @@ function createFileHandlers(deps) {
|
|
|
12377
11828
|
};
|
|
12378
11829
|
img.onerror = () => {
|
|
12379
11830
|
addElement({
|
|
12380
|
-
id:
|
|
11831
|
+
id: chunkP3T4E6JQ_js.generateElementId(),
|
|
12381
11832
|
type: "image",
|
|
12382
11833
|
x: 100,
|
|
12383
11834
|
y: 100,
|
|
@@ -12403,7 +11854,7 @@ function createFileHandlers(deps) {
|
|
|
12403
11854
|
const elFilePath = file.path;
|
|
12404
11855
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
12405
11856
|
addElement({
|
|
12406
|
-
id:
|
|
11857
|
+
id: chunkP3T4E6JQ_js.generateElementId(),
|
|
12407
11858
|
type: "media",
|
|
12408
11859
|
mediaType,
|
|
12409
11860
|
mediaMimeType: file.type || void 0,
|
|
@@ -12578,13 +12029,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
12578
12029
|
return;
|
|
12579
12030
|
}
|
|
12580
12031
|
addElement({
|
|
12581
|
-
id:
|
|
12032
|
+
id: chunkP3T4E6JQ_js.generateElementId(),
|
|
12582
12033
|
type: "smartArt",
|
|
12583
12034
|
x: 100,
|
|
12584
12035
|
y: 120,
|
|
12585
12036
|
width: 600,
|
|
12586
12037
|
height: 340,
|
|
12587
|
-
smartArtData:
|
|
12038
|
+
smartArtData: chunkP3T4E6JQ_js.buildSmartArtPresetData(
|
|
12588
12039
|
layout,
|
|
12589
12040
|
defaultItems,
|
|
12590
12041
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -12596,7 +12047,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12596
12047
|
return;
|
|
12597
12048
|
}
|
|
12598
12049
|
addElement({
|
|
12599
|
-
id:
|
|
12050
|
+
id: chunkP3T4E6JQ_js.generateElementId(),
|
|
12600
12051
|
type: "shape",
|
|
12601
12052
|
x: 120,
|
|
12602
12053
|
y: 200,
|
|
@@ -12655,7 +12106,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12655
12106
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
12656
12107
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
12657
12108
|
addElement({
|
|
12658
|
-
id:
|
|
12109
|
+
id: chunkP3T4E6JQ_js.generateElementId(),
|
|
12659
12110
|
type: "shape",
|
|
12660
12111
|
x: 120,
|
|
12661
12112
|
y: 200,
|
|
@@ -12677,11 +12128,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
12677
12128
|
if (!activeSlide) {
|
|
12678
12129
|
return;
|
|
12679
12130
|
}
|
|
12680
|
-
const preset =
|
|
12131
|
+
const preset = chunkP3T4E6JQ_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
12681
12132
|
if (!preset) {
|
|
12682
12133
|
return;
|
|
12683
12134
|
}
|
|
12684
|
-
const defaultPptxAction =
|
|
12135
|
+
const defaultPptxAction = chunkAD3EAEY6_js.elementActionToPptxAction({
|
|
12685
12136
|
trigger: "click",
|
|
12686
12137
|
type: preset.defaultAction
|
|
12687
12138
|
});
|
|
@@ -12690,7 +12141,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12690
12141
|
defaultPptxAction.highlightClick = true;
|
|
12691
12142
|
}
|
|
12692
12143
|
addElement({
|
|
12693
|
-
id:
|
|
12144
|
+
id: chunkP3T4E6JQ_js.generateElementId(),
|
|
12694
12145
|
type: "shape",
|
|
12695
12146
|
x: 150,
|
|
12696
12147
|
y: 150,
|
|
@@ -12757,7 +12208,7 @@ function useInsertElements(input) {
|
|
|
12757
12208
|
return;
|
|
12758
12209
|
}
|
|
12759
12210
|
addElement({
|
|
12760
|
-
id:
|
|
12211
|
+
id: chunkP3T4E6JQ_js.generateElementId(),
|
|
12761
12212
|
type: "text",
|
|
12762
12213
|
x: 100,
|
|
12763
12214
|
y: 100,
|
|
@@ -12772,7 +12223,7 @@ function useInsertElements(input) {
|
|
|
12772
12223
|
return;
|
|
12773
12224
|
}
|
|
12774
12225
|
addElement({
|
|
12775
|
-
id:
|
|
12226
|
+
id: chunkP3T4E6JQ_js.generateElementId(),
|
|
12776
12227
|
type: "shape",
|
|
12777
12228
|
x: 150,
|
|
12778
12229
|
y: 150,
|
|
@@ -12791,15 +12242,15 @@ function useInsertElements(input) {
|
|
|
12791
12242
|
return;
|
|
12792
12243
|
}
|
|
12793
12244
|
addElement({
|
|
12794
|
-
...
|
|
12795
|
-
id:
|
|
12245
|
+
...chunkP3T4E6JQ_js.newTableElement(DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
12246
|
+
id: chunkP3T4E6JQ_js.generateElementId()
|
|
12796
12247
|
});
|
|
12797
12248
|
};
|
|
12798
12249
|
const handleAddChart = (chartType) => {
|
|
12799
12250
|
if (!activeSlide) {
|
|
12800
12251
|
return;
|
|
12801
12252
|
}
|
|
12802
|
-
addElement(
|
|
12253
|
+
addElement(chunkP3T4E6JQ_js.createDefaultChartElement(chartType));
|
|
12803
12254
|
};
|
|
12804
12255
|
const structured = createStructuredElementHandlers({
|
|
12805
12256
|
activeSlide,
|
|
@@ -12869,7 +12320,7 @@ function useClipboardHandlers(input) {
|
|
|
12869
12320
|
if (!selectedElement) {
|
|
12870
12321
|
return;
|
|
12871
12322
|
}
|
|
12872
|
-
setClipboardPayload(
|
|
12323
|
+
setClipboardPayload(chunkP3T4E6JQ_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
12873
12324
|
};
|
|
12874
12325
|
const handleDelete = () => {
|
|
12875
12326
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -12886,7 +12337,7 @@ function useClipboardHandlers(input) {
|
|
|
12886
12337
|
handleDelete();
|
|
12887
12338
|
};
|
|
12888
12339
|
const insertClone = (source) => {
|
|
12889
|
-
const clone =
|
|
12340
|
+
const clone = chunkP3T4E6JQ_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
12890
12341
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
12891
12342
|
ops.applySelection(clone.id);
|
|
12892
12343
|
history.markDirty();
|
|
@@ -12921,7 +12372,7 @@ function resolveShapePath(el) {
|
|
|
12921
12372
|
return el.pathData;
|
|
12922
12373
|
}
|
|
12923
12374
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
12924
|
-
const clipPath =
|
|
12375
|
+
const clipPath = chunkAD3EAEY6_js.getPresetShapeClipPath(el.shapeType);
|
|
12925
12376
|
if (clipPath) {
|
|
12926
12377
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
12927
12378
|
if (svgPath) {
|
|
@@ -12972,7 +12423,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
12972
12423
|
return parts.join(" ");
|
|
12973
12424
|
}
|
|
12974
12425
|
function transformPathToGlobal(pathData, el) {
|
|
12975
|
-
const polys =
|
|
12426
|
+
const polys = chunkAD3EAEY6_js.svgPathToPolygons(pathData);
|
|
12976
12427
|
if (polys.length === 0) {
|
|
12977
12428
|
return pathData;
|
|
12978
12429
|
}
|
|
@@ -12992,10 +12443,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
12992
12443
|
y: pt.y * scaleY + el.y
|
|
12993
12444
|
}))
|
|
12994
12445
|
);
|
|
12995
|
-
return
|
|
12446
|
+
return chunkAD3EAEY6_js.polygonsToSvgPath(transformed);
|
|
12996
12447
|
}
|
|
12997
12448
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
12998
|
-
const polys =
|
|
12449
|
+
const polys = chunkAD3EAEY6_js.svgPathToPolygons(pathData);
|
|
12999
12450
|
if (polys.length === 0) {
|
|
13000
12451
|
return pathData;
|
|
13001
12452
|
}
|
|
@@ -13005,10 +12456,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
13005
12456
|
y: pt.y - y
|
|
13006
12457
|
}))
|
|
13007
12458
|
);
|
|
13008
|
-
return
|
|
12459
|
+
return chunkAD3EAEY6_js.polygonsToSvgPath(transformed);
|
|
13009
12460
|
}
|
|
13010
12461
|
function pathBounds(pathData) {
|
|
13011
|
-
const polys =
|
|
12462
|
+
const polys = chunkAD3EAEY6_js.svgPathToPolygons(pathData);
|
|
13012
12463
|
let minX = Infinity;
|
|
13013
12464
|
let minY = Infinity;
|
|
13014
12465
|
let maxX = -Infinity;
|
|
@@ -13067,7 +12518,7 @@ function useMergeShapesHandler(input) {
|
|
|
13067
12518
|
let allFragments = [];
|
|
13068
12519
|
let remaining = globalPaths[0];
|
|
13069
12520
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
13070
|
-
const frags =
|
|
12521
|
+
const frags = chunkAD3EAEY6_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
13071
12522
|
if (Array.isArray(frags)) {
|
|
13072
12523
|
allFragments = frags;
|
|
13073
12524
|
}
|
|
@@ -13096,7 +12547,7 @@ function useMergeShapesHandler(input) {
|
|
|
13096
12547
|
bounds.height
|
|
13097
12548
|
);
|
|
13098
12549
|
const newEl = {
|
|
13099
|
-
id:
|
|
12550
|
+
id: chunkP3T4E6JQ_js.generateElementId(),
|
|
13100
12551
|
type: "shape",
|
|
13101
12552
|
x: bounds.x,
|
|
13102
12553
|
y: bounds.y,
|
|
@@ -13134,7 +12585,7 @@ function useMergeShapesHandler(input) {
|
|
|
13134
12585
|
} else {
|
|
13135
12586
|
let resultPath = globalPaths[0];
|
|
13136
12587
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
13137
|
-
const result =
|
|
12588
|
+
const result = chunkAD3EAEY6_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
13138
12589
|
if (typeof result === "string") {
|
|
13139
12590
|
resultPath = result;
|
|
13140
12591
|
}
|
|
@@ -13155,7 +12606,7 @@ function useMergeShapesHandler(input) {
|
|
|
13155
12606
|
);
|
|
13156
12607
|
const primary = targets[0];
|
|
13157
12608
|
const newEl = {
|
|
13158
|
-
id:
|
|
12609
|
+
id: chunkP3T4E6JQ_js.generateElementId(),
|
|
13159
12610
|
type: "shape",
|
|
13160
12611
|
x: bounds.x,
|
|
13161
12612
|
y: bounds.y,
|
|
@@ -13218,7 +12669,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13218
12669
|
if (ids.length < 2 || !activeSlide) {
|
|
13219
12670
|
return;
|
|
13220
12671
|
}
|
|
13221
|
-
const { elements, groupId } =
|
|
12672
|
+
const { elements, groupId } = chunkP3T4E6JQ_js.groupElements(ops.activeElements, ids, chunkP3T4E6JQ_js.generateElementId());
|
|
13222
12673
|
if (groupId === null) {
|
|
13223
12674
|
return;
|
|
13224
12675
|
}
|
|
@@ -13231,12 +12682,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13231
12682
|
return;
|
|
13232
12683
|
}
|
|
13233
12684
|
const group = selectedElement;
|
|
13234
|
-
const intoTemplate =
|
|
12685
|
+
const intoTemplate = chunkP3T4E6JQ_js.isTemplateElementId(group.id);
|
|
13235
12686
|
const ungrouped = group.children.map((child) => ({
|
|
13236
12687
|
...structuredClone(child),
|
|
13237
12688
|
// Keep child ids in the same store as the group so later edits route
|
|
13238
12689
|
// correctly: template groups yield template-prefixed child ids.
|
|
13239
|
-
id: intoTemplate ?
|
|
12690
|
+
id: intoTemplate ? chunkP3T4E6JQ_js.makeCloneId(true, child.id || group.id) : child.id || chunkP3T4E6JQ_js.generateElementId(),
|
|
13240
12691
|
x: child.x + group.x,
|
|
13241
12692
|
y: child.y + group.y
|
|
13242
12693
|
}));
|
|
@@ -13260,7 +12711,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13260
12711
|
if (!edge) {
|
|
13261
12712
|
return;
|
|
13262
12713
|
}
|
|
13263
|
-
const positions =
|
|
12714
|
+
const positions = chunkP3T4E6JQ_js.alignElements(selectedElements, edge);
|
|
13264
12715
|
for (const [id, pos] of positions) {
|
|
13265
12716
|
const el = elementLookup.get(id);
|
|
13266
12717
|
if (!el) {
|
|
@@ -13278,7 +12729,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13278
12729
|
if (!distAxis) {
|
|
13279
12730
|
return;
|
|
13280
12731
|
}
|
|
13281
|
-
const positions =
|
|
12732
|
+
const positions = chunkP3T4E6JQ_js.distributeElements(selectedElements, distAxis);
|
|
13282
12733
|
for (const [id, pos] of positions) {
|
|
13283
12734
|
const el = elementLookup.get(id);
|
|
13284
12735
|
if (!el) {
|
|
@@ -13295,7 +12746,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13295
12746
|
}
|
|
13296
12747
|
const id = selectedElement.id;
|
|
13297
12748
|
ops.updateActiveElements(
|
|
13298
|
-
(els) => direction === "forward" ?
|
|
12749
|
+
(els) => direction === "forward" ? chunkP3T4E6JQ_js.bringForward(els, id) : direction === "backward" ? chunkP3T4E6JQ_js.sendBackward(els, id) : els
|
|
13299
12750
|
);
|
|
13300
12751
|
history.markDirty();
|
|
13301
12752
|
};
|
|
@@ -13305,7 +12756,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13305
12756
|
}
|
|
13306
12757
|
const id = selectedElement.id;
|
|
13307
12758
|
ops.updateActiveElements(
|
|
13308
|
-
(els) => direction === "front" ?
|
|
12759
|
+
(els) => direction === "front" ? chunkP3T4E6JQ_js.bringToFront(els, id) : chunkP3T4E6JQ_js.sendToBack(els, id)
|
|
13309
12760
|
);
|
|
13310
12761
|
history.markDirty();
|
|
13311
12762
|
};
|
|
@@ -13427,7 +12878,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
13427
12878
|
function useSlideManagement(input) {
|
|
13428
12879
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
13429
12880
|
const handleAddSlide = () => {
|
|
13430
|
-
const newSlide =
|
|
12881
|
+
const newSlide = chunkP3T4E6JQ_js.createBlankSlide(slides.length + 1);
|
|
13431
12882
|
ops.updateSlides((prev) => {
|
|
13432
12883
|
const next = [...prev];
|
|
13433
12884
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -13490,7 +12941,7 @@ function useSlideManagement(input) {
|
|
|
13490
12941
|
}
|
|
13491
12942
|
const clone = {
|
|
13492
12943
|
...src,
|
|
13493
|
-
id:
|
|
12944
|
+
id: chunkP3T4E6JQ_js.makeSlideId(),
|
|
13494
12945
|
elements: src.elements.map((el) => ({
|
|
13495
12946
|
...el,
|
|
13496
12947
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -13522,7 +12973,7 @@ function useSlideManagement(input) {
|
|
|
13522
12973
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
13523
12974
|
const insertAt = activeSlideIndex + 1;
|
|
13524
12975
|
const draft = {
|
|
13525
|
-
...
|
|
12976
|
+
...chunkP3T4E6JQ_js.createBlankSlide(slides.length + 1),
|
|
13526
12977
|
layoutPath,
|
|
13527
12978
|
...layoutName ? { layoutName } : {}
|
|
13528
12979
|
};
|
|
@@ -13583,7 +13034,7 @@ function createTableMergeHandlers(input) {
|
|
|
13583
13034
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
13584
13035
|
return;
|
|
13585
13036
|
}
|
|
13586
|
-
const newTableData =
|
|
13037
|
+
const newTableData = chunkP3T4E6JQ_js.mergeCells(
|
|
13587
13038
|
[
|
|
13588
13039
|
{ row: rowIndex, col: columnIndex },
|
|
13589
13040
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -13591,7 +13042,7 @@ function createTableMergeHandlers(input) {
|
|
|
13591
13042
|
td
|
|
13592
13043
|
);
|
|
13593
13044
|
const updates = { tableData: newTableData };
|
|
13594
|
-
const newRawXml =
|
|
13045
|
+
const newRawXml = chunkAD3EAEY6_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13595
13046
|
if (newRawXml) {
|
|
13596
13047
|
updates.rawXml = newRawXml;
|
|
13597
13048
|
}
|
|
@@ -13617,7 +13068,7 @@ function createTableMergeHandlers(input) {
|
|
|
13617
13068
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
13618
13069
|
return;
|
|
13619
13070
|
}
|
|
13620
|
-
const newTableData =
|
|
13071
|
+
const newTableData = chunkP3T4E6JQ_js.mergeCells(
|
|
13621
13072
|
[
|
|
13622
13073
|
{ row: rowIndex, col: columnIndex },
|
|
13623
13074
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -13625,7 +13076,7 @@ function createTableMergeHandlers(input) {
|
|
|
13625
13076
|
td
|
|
13626
13077
|
);
|
|
13627
13078
|
const updates = { tableData: newTableData };
|
|
13628
|
-
const newRawXml =
|
|
13079
|
+
const newRawXml = chunkAD3EAEY6_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13629
13080
|
if (newRawXml) {
|
|
13630
13081
|
updates.rawXml = newRawXml;
|
|
13631
13082
|
}
|
|
@@ -13640,9 +13091,9 @@ function createTableMergeHandlers(input) {
|
|
|
13640
13091
|
return;
|
|
13641
13092
|
}
|
|
13642
13093
|
const td = selectedElement.tableData;
|
|
13643
|
-
const newTableData =
|
|
13094
|
+
const newTableData = chunkP3T4E6JQ_js.mergeCells(ts.selectedCells, td);
|
|
13644
13095
|
const updates = { tableData: newTableData };
|
|
13645
|
-
const newRawXml =
|
|
13096
|
+
const newRawXml = chunkAD3EAEY6_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13646
13097
|
if (newRawXml) {
|
|
13647
13098
|
updates.rawXml = newRawXml;
|
|
13648
13099
|
}
|
|
@@ -13659,9 +13110,9 @@ function createTableMergeHandlers(input) {
|
|
|
13659
13110
|
}
|
|
13660
13111
|
const { rowIndex, columnIndex } = ts;
|
|
13661
13112
|
const td = selectedElement.tableData;
|
|
13662
|
-
const newTableData =
|
|
13113
|
+
const newTableData = chunkP3T4E6JQ_js.splitCell(rowIndex, columnIndex, td);
|
|
13663
13114
|
const updates = { tableData: newTableData };
|
|
13664
|
-
const newRawXml =
|
|
13115
|
+
const newRawXml = chunkAD3EAEY6_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13665
13116
|
if (newRawXml) {
|
|
13666
13117
|
updates.rawXml = newRawXml;
|
|
13667
13118
|
}
|
|
@@ -13705,7 +13156,7 @@ function createTableStructHandlers(input) {
|
|
|
13705
13156
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
13706
13157
|
}
|
|
13707
13158
|
if (el.rawXml) {
|
|
13708
|
-
const newRawXml =
|
|
13159
|
+
const newRawXml = chunkAD3EAEY6_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
13709
13160
|
if (newRawXml) {
|
|
13710
13161
|
updates.rawXml = newRawXml;
|
|
13711
13162
|
}
|
|
@@ -13729,7 +13180,7 @@ function createTableStructHandlers(input) {
|
|
|
13729
13180
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
13730
13181
|
const updates = {};
|
|
13731
13182
|
if (selectedElement.rawXml) {
|
|
13732
|
-
const newRawXml =
|
|
13183
|
+
const newRawXml = chunkAD3EAEY6_js.updateCellTextStyleInRawXml(
|
|
13733
13184
|
selectedElement,
|
|
13734
13185
|
rowIndex,
|
|
13735
13186
|
colIndex,
|
|
@@ -13793,9 +13244,9 @@ function createTableStructHandlers(input) {
|
|
|
13793
13244
|
return;
|
|
13794
13245
|
}
|
|
13795
13246
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
13796
|
-
const newTableData =
|
|
13247
|
+
const newTableData = chunkP3T4E6JQ_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
13797
13248
|
const updates = { tableData: newTableData };
|
|
13798
|
-
const newRawXml =
|
|
13249
|
+
const newRawXml = chunkAD3EAEY6_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13799
13250
|
if (newRawXml) {
|
|
13800
13251
|
updates.rawXml = newRawXml;
|
|
13801
13252
|
}
|
|
@@ -13808,12 +13259,12 @@ function createTableStructHandlers(input) {
|
|
|
13808
13259
|
}
|
|
13809
13260
|
const td = selectedElement.tableData;
|
|
13810
13261
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
13811
|
-
const newTableData =
|
|
13262
|
+
const newTableData = chunkP3T4E6JQ_js.deleteTableRow(td, rowIdx);
|
|
13812
13263
|
if (newTableData === td) {
|
|
13813
13264
|
return;
|
|
13814
13265
|
}
|
|
13815
13266
|
const updates = { tableData: newTableData };
|
|
13816
|
-
const newRawXml =
|
|
13267
|
+
const newRawXml = chunkAD3EAEY6_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13817
13268
|
if (newRawXml) {
|
|
13818
13269
|
updates.rawXml = newRawXml;
|
|
13819
13270
|
}
|
|
@@ -13825,9 +13276,9 @@ function createTableStructHandlers(input) {
|
|
|
13825
13276
|
return;
|
|
13826
13277
|
}
|
|
13827
13278
|
const colIdx = ts?.columnIndex ?? 0;
|
|
13828
|
-
const newTableData =
|
|
13279
|
+
const newTableData = chunkP3T4E6JQ_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
13829
13280
|
const updates = { tableData: newTableData };
|
|
13830
|
-
const newRawXml =
|
|
13281
|
+
const newRawXml = chunkAD3EAEY6_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13831
13282
|
if (newRawXml) {
|
|
13832
13283
|
updates.rawXml = newRawXml;
|
|
13833
13284
|
}
|
|
@@ -13840,12 +13291,12 @@ function createTableStructHandlers(input) {
|
|
|
13840
13291
|
}
|
|
13841
13292
|
const td = selectedElement.tableData;
|
|
13842
13293
|
const colIdx = ts?.columnIndex ?? 0;
|
|
13843
|
-
const newTableData =
|
|
13294
|
+
const newTableData = chunkP3T4E6JQ_js.deleteTableColumn(td, colIdx);
|
|
13844
13295
|
if (newTableData === td) {
|
|
13845
13296
|
return;
|
|
13846
13297
|
}
|
|
13847
13298
|
const updates = { tableData: newTableData };
|
|
13848
|
-
const newRawXml =
|
|
13299
|
+
const newRawXml = chunkAD3EAEY6_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13849
13300
|
if (newRawXml) {
|
|
13850
13301
|
updates.rawXml = newRawXml;
|
|
13851
13302
|
}
|
|
@@ -13881,8 +13332,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
13881
13332
|
return html2canvasPro(element, {
|
|
13882
13333
|
...options,
|
|
13883
13334
|
onclone: async (doc, clonedEl) => {
|
|
13884
|
-
await
|
|
13885
|
-
|
|
13335
|
+
await chunkP3T4E6JQ_js.normalizeColorsForCapture(doc, clonedEl);
|
|
13336
|
+
chunkP3T4E6JQ_js.preprocessCssForCapture(clonedEl);
|
|
13886
13337
|
if (typeof userOnClone === "function") {
|
|
13887
13338
|
userOnClone(doc, clonedEl);
|
|
13888
13339
|
}
|
|
@@ -13938,7 +13389,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
13938
13389
|
}
|
|
13939
13390
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
13940
13391
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
13941
|
-
|
|
13392
|
+
chunkP3T4E6JQ_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
13942
13393
|
}
|
|
13943
13394
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
13944
13395
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -13960,7 +13411,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13960
13411
|
continue;
|
|
13961
13412
|
}
|
|
13962
13413
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
13963
|
-
images.push(
|
|
13414
|
+
images.push(chunkP3T4E6JQ_js.canvasToJpegData(canvas));
|
|
13964
13415
|
}
|
|
13965
13416
|
onProgress?.(totalSlides, totalSlides);
|
|
13966
13417
|
setActiveSlide(currentSlideIndex);
|
|
@@ -13968,7 +13419,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13968
13419
|
throw new Error(chunkAALZCSY4_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
13969
13420
|
}
|
|
13970
13421
|
const pdfBlobUrl = buildPdfFromImageData(images);
|
|
13971
|
-
|
|
13422
|
+
chunkP3T4E6JQ_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
13972
13423
|
}
|
|
13973
13424
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
13974
13425
|
const { scale = 2, onProgress } = options;
|
|
@@ -14017,7 +13468,7 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
14017
13468
|
throw new Error(chunkAALZCSY4_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
14018
13469
|
}
|
|
14019
13470
|
const pdfDataUrl = buildNotesPdf(pages);
|
|
14020
|
-
|
|
13471
|
+
chunkP3T4E6JQ_js.downloadDataUrl(pdfDataUrl, filename);
|
|
14021
13472
|
}
|
|
14022
13473
|
|
|
14023
13474
|
// src/viewer/utils/export-video.ts
|
|
@@ -14061,7 +13512,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
14061
13512
|
const fps = 30;
|
|
14062
13513
|
const stream = recordingCanvas.captureStream(fps);
|
|
14063
13514
|
const recorder = new MediaRecorder(stream, {
|
|
14064
|
-
mimeType:
|
|
13515
|
+
mimeType: chunkP3T4E6JQ_js.pickSupportedMimeType([...chunkP3T4E6JQ_js.WEBM_MIME_CANDIDATES]),
|
|
14065
13516
|
videoBitsPerSecond: 5e6
|
|
14066
13517
|
});
|
|
14067
13518
|
const chunks = [];
|
|
@@ -14084,8 +13535,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
14084
13535
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
14085
13536
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
14086
13537
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
14087
|
-
const frameInterval =
|
|
14088
|
-
const framesNeeded =
|
|
13538
|
+
const frameInterval = chunkP3T4E6JQ_js.fpsToFrameIntervalMs(fps);
|
|
13539
|
+
const framesNeeded = chunkP3T4E6JQ_js.segmentFrameCount(duration, fps);
|
|
14089
13540
|
for (let f = 0; f < framesNeeded; f++) {
|
|
14090
13541
|
if (signal?.aborted) {
|
|
14091
13542
|
recorder.stop();
|
|
@@ -14134,31 +13585,13 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
14134
13585
|
if (frames.length === 0) {
|
|
14135
13586
|
throw new Error(chunkAALZCSY4_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
14136
13587
|
}
|
|
14137
|
-
const gifBytes =
|
|
13588
|
+
const gifBytes = chunkP3T4E6JQ_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
14138
13589
|
onProgress?.(totalSlides, totalSlides);
|
|
14139
13590
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
14140
13591
|
new Uint8Array(buf).set(gifBytes);
|
|
14141
13592
|
return new Blob([buf], { type: "image/gif" });
|
|
14142
13593
|
}
|
|
14143
13594
|
|
|
14144
|
-
// src/viewer/utils/export-package.ts
|
|
14145
|
-
function generatePackageReadme(presentationFilename) {
|
|
14146
|
-
return [
|
|
14147
|
-
"Presentation Package",
|
|
14148
|
-
"====================",
|
|
14149
|
-
"",
|
|
14150
|
-
`This folder contains the presentation "${presentationFilename}" along with`,
|
|
14151
|
-
"all linked media files (images, audio, video) in the /media subfolder.",
|
|
14152
|
-
"",
|
|
14153
|
-
"To view this presentation:",
|
|
14154
|
-
"1. Open the .pptx file with any compatible presentation software",
|
|
14155
|
-
"2. Ensure the /media folder remains alongside the .pptx file",
|
|
14156
|
-
"",
|
|
14157
|
-
`Packaged on ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`,
|
|
14158
|
-
""
|
|
14159
|
-
].join("\n");
|
|
14160
|
-
}
|
|
14161
|
-
|
|
14162
13595
|
// src/viewer/utils/export-svg.ts
|
|
14163
13596
|
function injectFontFaces(svg, fontFaces) {
|
|
14164
13597
|
if (!fontFaces.length) {
|
|
@@ -14206,7 +13639,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
14206
13639
|
continue;
|
|
14207
13640
|
}
|
|
14208
13641
|
onProgress?.(processedCount, data.slides.length);
|
|
14209
|
-
let svg =
|
|
13642
|
+
let svg = chunkAD3EAEY6_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
14210
13643
|
if (embedFonts && fontFaces?.length) {
|
|
14211
13644
|
svg = injectFontFaces(svg, fontFaces);
|
|
14212
13645
|
}
|
|
@@ -14265,7 +13698,7 @@ function useExportSaveAs(input) {
|
|
|
14265
13698
|
}
|
|
14266
13699
|
setExportProgress(70);
|
|
14267
13700
|
setExportStatusMessage("Writing README...");
|
|
14268
|
-
const readme = generatePackageReadme(pptxFilename);
|
|
13701
|
+
const readme = chunkP3T4E6JQ_js.generatePackageReadme(pptxFilename);
|
|
14269
13702
|
pkgFolder.file("README.txt", readme);
|
|
14270
13703
|
if (abortCtrl.signal.aborted) {
|
|
14271
13704
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -14276,7 +13709,7 @@ function useExportSaveAs(input) {
|
|
|
14276
13709
|
setExportProgress(95);
|
|
14277
13710
|
setExportStatusMessage("Downloading...");
|
|
14278
13711
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
14279
|
-
|
|
13712
|
+
chunkP3T4E6JQ_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
14280
13713
|
setExportProgress(100);
|
|
14281
13714
|
} catch (err) {
|
|
14282
13715
|
if (err.name !== "AbortError") {
|
|
@@ -14299,7 +13732,7 @@ function useExportSaveAs(input) {
|
|
|
14299
13732
|
const blob = new Blob([data], {
|
|
14300
13733
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
14301
13734
|
});
|
|
14302
|
-
|
|
13735
|
+
chunkP3T4E6JQ_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
14303
13736
|
} catch (err) {
|
|
14304
13737
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
14305
13738
|
}
|
|
@@ -14312,7 +13745,7 @@ function useExportSaveAs(input) {
|
|
|
14312
13745
|
const pptxGuides = guides.map((g) => ({
|
|
14313
13746
|
id: g.id,
|
|
14314
13747
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
14315
|
-
positionEmu:
|
|
13748
|
+
positionEmu: chunkAD3EAEY6_js.guidePxToEmu(g.position)
|
|
14316
13749
|
}));
|
|
14317
13750
|
return {
|
|
14318
13751
|
...slide,
|
|
@@ -14375,7 +13808,7 @@ function safeConfirm(message) {
|
|
|
14375
13808
|
}
|
|
14376
13809
|
}
|
|
14377
13810
|
function downloadBlob2(blob, filename) {
|
|
14378
|
-
|
|
13811
|
+
chunkP3T4E6JQ_js.downloadBlob(blob, chunkP3T4E6JQ_js.sanitizeDownloadFilename(filename));
|
|
14379
13812
|
}
|
|
14380
13813
|
|
|
14381
13814
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -14474,21 +13907,21 @@ function useExportHandlers(input) {
|
|
|
14474
13907
|
{
|
|
14475
13908
|
scale: 2,
|
|
14476
13909
|
onProgress: (current, total) => {
|
|
14477
|
-
setExportProgress(
|
|
14478
|
-
setExportStatusMessage(
|
|
13910
|
+
setExportProgress(chunkP3T4E6JQ_js.slideProgressPercent(current, total));
|
|
13911
|
+
setExportStatusMessage(chunkP3T4E6JQ_js.slideStatusLabel("Rendering", current, total));
|
|
14479
13912
|
},
|
|
14480
13913
|
signal: abortCtrl.signal
|
|
14481
13914
|
}
|
|
14482
13915
|
);
|
|
14483
|
-
setExportProgress(
|
|
13916
|
+
setExportProgress(chunkP3T4E6JQ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14484
13917
|
setExportStatusMessage("Building PDF...");
|
|
14485
13918
|
await new Promise((r) => {
|
|
14486
13919
|
setTimeout(r, 100);
|
|
14487
13920
|
});
|
|
14488
|
-
setExportProgress(
|
|
13921
|
+
setExportProgress(chunkP3T4E6JQ_js.EXPORT_DONE_PERCENT);
|
|
14489
13922
|
setExportStatusMessage("Done!");
|
|
14490
13923
|
} catch (err) {
|
|
14491
|
-
if (!
|
|
13924
|
+
if (!chunkP3T4E6JQ_js.isExportAbortError(err)) {
|
|
14492
13925
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
14493
13926
|
}
|
|
14494
13927
|
} finally {
|
|
@@ -14518,21 +13951,21 @@ function useExportHandlers(input) {
|
|
|
14518
13951
|
{
|
|
14519
13952
|
scale: 2,
|
|
14520
13953
|
onProgress: (current, total) => {
|
|
14521
|
-
setExportProgress(
|
|
14522
|
-
setExportStatusMessage(
|
|
13954
|
+
setExportProgress(chunkP3T4E6JQ_js.slideProgressPercent(current, total));
|
|
13955
|
+
setExportStatusMessage(chunkP3T4E6JQ_js.slideStatusLabel("Rendering", current, total));
|
|
14523
13956
|
},
|
|
14524
13957
|
signal: abortCtrl.signal
|
|
14525
13958
|
}
|
|
14526
13959
|
);
|
|
14527
|
-
setExportProgress(
|
|
13960
|
+
setExportProgress(chunkP3T4E6JQ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14528
13961
|
setExportStatusMessage("Building PDF...");
|
|
14529
13962
|
await new Promise((r) => {
|
|
14530
13963
|
setTimeout(r, 100);
|
|
14531
13964
|
});
|
|
14532
|
-
setExportProgress(
|
|
13965
|
+
setExportProgress(chunkP3T4E6JQ_js.EXPORT_DONE_PERCENT);
|
|
14533
13966
|
setExportStatusMessage("Done!");
|
|
14534
13967
|
} catch (err) {
|
|
14535
|
-
if (!
|
|
13968
|
+
if (!chunkP3T4E6JQ_js.isExportAbortError(err)) {
|
|
14536
13969
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
14537
13970
|
}
|
|
14538
13971
|
} finally {
|
|
@@ -14573,22 +14006,22 @@ function useExportHandlers(input) {
|
|
|
14573
14006
|
scale: 1,
|
|
14574
14007
|
slideDurationMs: 3e3,
|
|
14575
14008
|
onProgress: (current, total) => {
|
|
14576
|
-
setExportProgress(
|
|
14577
|
-
setExportStatusMessage(
|
|
14009
|
+
setExportProgress(chunkP3T4E6JQ_js.slideProgressPercent(current, total, 45));
|
|
14010
|
+
setExportStatusMessage(chunkP3T4E6JQ_js.slideStatusLabel("Capturing", current, total));
|
|
14578
14011
|
},
|
|
14579
14012
|
onRecordProgress: (current, total) => {
|
|
14580
|
-
setExportProgress(
|
|
14581
|
-
setExportStatusMessage(
|
|
14013
|
+
setExportProgress(chunkP3T4E6JQ_js.recordProgressPercent(current, total));
|
|
14014
|
+
setExportStatusMessage(chunkP3T4E6JQ_js.slideStatusLabel("Recording", current, total));
|
|
14582
14015
|
},
|
|
14583
14016
|
signal: abortCtrl.signal
|
|
14584
14017
|
}
|
|
14585
14018
|
);
|
|
14586
|
-
setExportProgress(
|
|
14019
|
+
setExportProgress(chunkP3T4E6JQ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14587
14020
|
setExportStatusMessage("Saving file...");
|
|
14588
14021
|
downloadBlob2(blob, "presentation.webm");
|
|
14589
|
-
setExportProgress(
|
|
14022
|
+
setExportProgress(chunkP3T4E6JQ_js.EXPORT_DONE_PERCENT);
|
|
14590
14023
|
} catch (err) {
|
|
14591
|
-
if (!
|
|
14024
|
+
if (!chunkP3T4E6JQ_js.isExportAbortError(err)) {
|
|
14592
14025
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
14593
14026
|
}
|
|
14594
14027
|
} finally {
|
|
@@ -14616,18 +14049,18 @@ function useExportHandlers(input) {
|
|
|
14616
14049
|
scale: 0.5,
|
|
14617
14050
|
slideDurationMs: 2e3,
|
|
14618
14051
|
onProgress: (current, total) => {
|
|
14619
|
-
setExportProgress(
|
|
14620
|
-
setExportStatusMessage(
|
|
14052
|
+
setExportProgress(chunkP3T4E6JQ_js.slideProgressPercent(current, total));
|
|
14053
|
+
setExportStatusMessage(chunkP3T4E6JQ_js.slideStatusLabel("Encoding", current, total));
|
|
14621
14054
|
},
|
|
14622
14055
|
signal: abortCtrl.signal
|
|
14623
14056
|
}
|
|
14624
14057
|
);
|
|
14625
|
-
setExportProgress(
|
|
14058
|
+
setExportProgress(chunkP3T4E6JQ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14626
14059
|
setExportStatusMessage("Saving file...");
|
|
14627
14060
|
downloadBlob2(blob, "presentation.gif");
|
|
14628
|
-
setExportProgress(
|
|
14061
|
+
setExportProgress(chunkP3T4E6JQ_js.EXPORT_DONE_PERCENT);
|
|
14629
14062
|
} catch (err) {
|
|
14630
|
-
if (!
|
|
14063
|
+
if (!chunkP3T4E6JQ_js.isExportAbortError(err)) {
|
|
14631
14064
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
14632
14065
|
}
|
|
14633
14066
|
} finally {
|
|
@@ -14667,7 +14100,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
14667
14100
|
}
|
|
14668
14101
|
printWindow.document.open();
|
|
14669
14102
|
printWindow.document.write(
|
|
14670
|
-
|
|
14103
|
+
chunkP3T4E6JQ_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
14671
14104
|
);
|
|
14672
14105
|
printWindow.document.close();
|
|
14673
14106
|
printWindow.focus();
|
|
@@ -14728,7 +14161,7 @@ function usePrintHandlers(input) {
|
|
|
14728
14161
|
if (svgs.length === 0) {
|
|
14729
14162
|
return;
|
|
14730
14163
|
}
|
|
14731
|
-
const printDoc =
|
|
14164
|
+
const printDoc = chunkP3T4E6JQ_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
14732
14165
|
title: "Slides (Vector)",
|
|
14733
14166
|
orientation: settings.orientation,
|
|
14734
14167
|
colorFilter
|
|
@@ -14764,7 +14197,7 @@ function usePrintHandlers(input) {
|
|
|
14764
14197
|
if (settings.printWhat === "outline") {
|
|
14765
14198
|
openPrintWindow(
|
|
14766
14199
|
"Outline",
|
|
14767
|
-
`<div class="outline-page">${
|
|
14200
|
+
`<div class="outline-page">${chunkP3T4E6JQ_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
14768
14201
|
settings.orientation,
|
|
14769
14202
|
colorFilter,
|
|
14770
14203
|
settings.frameSlides
|
|
@@ -14789,7 +14222,7 @@ function usePrintHandlers(input) {
|
|
|
14789
14222
|
if (settings.printWhat === "slides") {
|
|
14790
14223
|
openPrintWindow(
|
|
14791
14224
|
"Slides",
|
|
14792
|
-
|
|
14225
|
+
chunkP3T4E6JQ_js.buildSlidesHtml(slideImages, slideIndices),
|
|
14793
14226
|
settings.orientation,
|
|
14794
14227
|
colorFilter,
|
|
14795
14228
|
settings.frameSlides
|
|
@@ -14799,7 +14232,7 @@ function usePrintHandlers(input) {
|
|
|
14799
14232
|
if (settings.printWhat === "notes") {
|
|
14800
14233
|
openPrintWindow(
|
|
14801
14234
|
"Notes Pages",
|
|
14802
|
-
|
|
14235
|
+
chunkP3T4E6JQ_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
14803
14236
|
"portrait",
|
|
14804
14237
|
colorFilter,
|
|
14805
14238
|
settings.frameSlides
|
|
@@ -14810,7 +14243,7 @@ function usePrintHandlers(input) {
|
|
|
14810
14243
|
const spp = settings.slidesPerPage;
|
|
14811
14244
|
openPrintWindow(
|
|
14812
14245
|
`Handout ${spp} per page`,
|
|
14813
|
-
|
|
14246
|
+
chunkP3T4E6JQ_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
14814
14247
|
"portrait",
|
|
14815
14248
|
colorFilter,
|
|
14816
14249
|
settings.frameSlides
|
|
@@ -14974,7 +14407,7 @@ function useThemeSwitching(input) {
|
|
|
14974
14407
|
}
|
|
14975
14408
|
try {
|
|
14976
14409
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
14977
|
-
const newData =
|
|
14410
|
+
const newData = chunkAD3EAEY6_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
14978
14411
|
onDataChange(newData);
|
|
14979
14412
|
onThemeChanged?.(preset);
|
|
14980
14413
|
} catch (error) {
|
|
@@ -14991,7 +14424,7 @@ function useThemeSwitching(input) {
|
|
|
14991
14424
|
}
|
|
14992
14425
|
try {
|
|
14993
14426
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
14994
|
-
const newData =
|
|
14427
|
+
const newData = chunkAD3EAEY6_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
14995
14428
|
onDataChange(newData);
|
|
14996
14429
|
} catch (error) {
|
|
14997
14430
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -15003,85 +14436,17 @@ function useThemeSwitching(input) {
|
|
|
15003
14436
|
if (!data?.theme?.colorScheme) {
|
|
15004
14437
|
return void 0;
|
|
15005
14438
|
}
|
|
15006
|
-
return
|
|
15007
|
-
(p) =>
|
|
14439
|
+
return chunkAD3EAEY6_js.THEME_PRESETS.find(
|
|
14440
|
+
(p) => chunkAD3EAEY6_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
15008
14441
|
);
|
|
15009
14442
|
}, [data?.theme?.colorScheme]);
|
|
15010
14443
|
return {
|
|
15011
|
-
presets:
|
|
14444
|
+
presets: chunkAD3EAEY6_js.THEME_PRESETS,
|
|
15012
14445
|
switchToPreset,
|
|
15013
14446
|
switchToCustom,
|
|
15014
14447
|
currentPreset
|
|
15015
14448
|
};
|
|
15016
14449
|
}
|
|
15017
|
-
|
|
15018
|
-
// src/viewer/hooks/usePropertyHandlers-helpers.ts
|
|
15019
|
-
function collectUsedFonts(slides) {
|
|
15020
|
-
const fonts = /* @__PURE__ */ new Set();
|
|
15021
|
-
for (const slide of slides) {
|
|
15022
|
-
for (const el of slide.elements ?? []) {
|
|
15023
|
-
collectFontsFromElement(el, fonts);
|
|
15024
|
-
}
|
|
15025
|
-
}
|
|
15026
|
-
return Array.from(fonts).sort();
|
|
15027
|
-
}
|
|
15028
|
-
function collectFontsFromElement(el, fonts) {
|
|
15029
|
-
if (chunkEXDUEXTO_js.hasTextProperties(el)) {
|
|
15030
|
-
if (el.textStyle?.fontFamily) {
|
|
15031
|
-
fonts.add(el.textStyle.fontFamily);
|
|
15032
|
-
}
|
|
15033
|
-
if (el.textSegments) {
|
|
15034
|
-
for (const seg of el.textSegments) {
|
|
15035
|
-
if (seg.style?.fontFamily) {
|
|
15036
|
-
fonts.add(seg.style.fontFamily);
|
|
15037
|
-
}
|
|
15038
|
-
}
|
|
15039
|
-
}
|
|
15040
|
-
}
|
|
15041
|
-
if (el.type === "group" && el.children) {
|
|
15042
|
-
for (const child of el.children) {
|
|
15043
|
-
collectFontsFromElement(child, fonts);
|
|
15044
|
-
}
|
|
15045
|
-
}
|
|
15046
|
-
}
|
|
15047
|
-
function applyAcceptSlide(slides, diff) {
|
|
15048
|
-
const n = [...slides];
|
|
15049
|
-
if (diff.status === "added" && diff.compareSlide) {
|
|
15050
|
-
n.splice(Math.min(diff.compareIndex, n.length), 0, {
|
|
15051
|
-
...diff.compareSlide
|
|
15052
|
-
});
|
|
15053
|
-
} else if (diff.status === "changed" && diff.compareSlide && diff.baseIndex >= 0) {
|
|
15054
|
-
n[diff.baseIndex] = { ...diff.compareSlide };
|
|
15055
|
-
} else if (diff.status === "removed" && diff.baseIndex >= 0) {
|
|
15056
|
-
n.splice(diff.baseIndex, 1);
|
|
15057
|
-
}
|
|
15058
|
-
return n;
|
|
15059
|
-
}
|
|
15060
|
-
function applyAcceptAllSlides(slides, compareResult) {
|
|
15061
|
-
const n = [...slides];
|
|
15062
|
-
const dd = [...compareResult.diffs];
|
|
15063
|
-
for (let i = dd.length - 1; i >= 0; i--) {
|
|
15064
|
-
const x = dd[i];
|
|
15065
|
-
if (x.status === "removed" && x.baseIndex >= 0 && x.baseIndex < n.length) {
|
|
15066
|
-
n.splice(x.baseIndex, 1);
|
|
15067
|
-
}
|
|
15068
|
-
}
|
|
15069
|
-
for (const x of dd) {
|
|
15070
|
-
if (x.status === "changed" && x.compareSlide && x.baseIndex >= 0 && x.baseIndex < n.length) {
|
|
15071
|
-
n[x.baseIndex] = { ...x.compareSlide };
|
|
15072
|
-
}
|
|
15073
|
-
}
|
|
15074
|
-
for (const x of dd) {
|
|
15075
|
-
if (x.status === "added" && x.compareSlide) {
|
|
15076
|
-
n.splice(Math.min(x.compareIndex, n.length), 0, {
|
|
15077
|
-
...x.compareSlide
|
|
15078
|
-
});
|
|
15079
|
-
}
|
|
15080
|
-
}
|
|
15081
|
-
return n;
|
|
15082
|
-
}
|
|
15083
|
-
|
|
15084
|
-
// src/viewer/hooks/usePropertyHandlers.ts
|
|
15085
14450
|
function usePropertyHandlers(input) {
|
|
15086
14451
|
const {
|
|
15087
14452
|
slides,
|
|
@@ -15151,7 +14516,7 @@ function usePropertyHandlers(input) {
|
|
|
15151
14516
|
}
|
|
15152
14517
|
try {
|
|
15153
14518
|
const ab = await file.arrayBuffer();
|
|
15154
|
-
const h = new
|
|
14519
|
+
const h = new chunkAD3EAEY6_js.PptxHandler();
|
|
15155
14520
|
const other = await h.load(ab);
|
|
15156
14521
|
if (!other) {
|
|
15157
14522
|
return;
|
|
@@ -15161,7 +14526,7 @@ function usePropertyHandlers(input) {
|
|
|
15161
14526
|
width: canvasSize.width,
|
|
15162
14527
|
height: canvasSize.height
|
|
15163
14528
|
};
|
|
15164
|
-
setCompareResult(
|
|
14529
|
+
setCompareResult(chunkP3T4E6JQ_js.comparePresentation(cur, other));
|
|
15165
14530
|
setIsComparePanelOpen(true);
|
|
15166
14531
|
} catch (err) {
|
|
15167
14532
|
console.warn("Compare failed:", err);
|
|
@@ -15178,7 +14543,7 @@ function usePropertyHandlers(input) {
|
|
|
15178
14543
|
if (!diff || diff.status === "unchanged") {
|
|
15179
14544
|
return;
|
|
15180
14545
|
}
|
|
15181
|
-
setSlides((prev) => applyAcceptSlide(prev, diff));
|
|
14546
|
+
setSlides((prev) => chunkP3T4E6JQ_js.applyAcceptSlide(prev, diff));
|
|
15182
14547
|
setIsDirty(true);
|
|
15183
14548
|
},
|
|
15184
14549
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -15189,10 +14554,10 @@ function usePropertyHandlers(input) {
|
|
|
15189
14554
|
if (!compareResult) {
|
|
15190
14555
|
return;
|
|
15191
14556
|
}
|
|
15192
|
-
setSlides((prev) => applyAcceptAllSlides(prev, compareResult));
|
|
14557
|
+
setSlides((prev) => chunkP3T4E6JQ_js.applyAcceptAllSlides(prev, compareResult));
|
|
15193
14558
|
setIsDirty(true);
|
|
15194
14559
|
}, [compareResult, setSlides, setIsDirty]);
|
|
15195
|
-
const usedFontFamilies = React3.useMemo(() => collectUsedFonts(slides), [slides]);
|
|
14560
|
+
const usedFontFamilies = React3.useMemo(() => chunkP3T4E6JQ_js.collectUsedFonts(slides), [slides]);
|
|
15196
14561
|
return {
|
|
15197
14562
|
handleUpdateNotes,
|
|
15198
14563
|
handleUpdateSlide,
|
|
@@ -15311,7 +14676,7 @@ function useIsMobile(input) {
|
|
|
15311
14676
|
const containerRef = input?.containerRef;
|
|
15312
14677
|
const isTouchDevice = React3.useSyncExternalStore(
|
|
15313
14678
|
subscribeTouchCapability,
|
|
15314
|
-
|
|
14679
|
+
chunkP3T4E6JQ_js.detectTouchDevice,
|
|
15315
14680
|
() => false
|
|
15316
14681
|
// server snapshot
|
|
15317
14682
|
);
|
|
@@ -15327,7 +14692,7 @@ function useIsMobile(input) {
|
|
|
15327
14692
|
}
|
|
15328
14693
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
15329
14694
|
});
|
|
15330
|
-
const [orientation, setOrientation] = React3.useState(
|
|
14695
|
+
const [orientation, setOrientation] = React3.useState(chunkP3T4E6JQ_js.detectOrientation);
|
|
15331
14696
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = React3.useState(false);
|
|
15332
14697
|
const [initialViewportHeight] = React3.useState(
|
|
15333
14698
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -15371,7 +14736,7 @@ function useIsMobile(input) {
|
|
|
15371
14736
|
return;
|
|
15372
14737
|
}
|
|
15373
14738
|
const handleOrientationChange = () => {
|
|
15374
|
-
setOrientation(
|
|
14739
|
+
setOrientation(chunkP3T4E6JQ_js.detectOrientation());
|
|
15375
14740
|
};
|
|
15376
14741
|
if (screen.orientation) {
|
|
15377
14742
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -15401,9 +14766,9 @@ function useIsMobile(input) {
|
|
|
15401
14766
|
window.addEventListener("resize", handleResize);
|
|
15402
14767
|
return () => window.removeEventListener("resize", handleResize);
|
|
15403
14768
|
}, [isTouchDevice, initialViewportHeight]);
|
|
15404
|
-
const isMobile =
|
|
15405
|
-
const isTablet = !isMobile && containerWidth >=
|
|
15406
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
14769
|
+
const isMobile = chunkP3T4E6JQ_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
14770
|
+
const isTablet = !isMobile && containerWidth >= chunkP3T4E6JQ_js.MOBILE_BREAKPOINT && containerWidth < chunkP3T4E6JQ_js.TABLET_BREAKPOINT;
|
|
14771
|
+
const isDesktop = !isMobile && containerWidth >= chunkP3T4E6JQ_js.TABLET_BREAKPOINT;
|
|
15407
14772
|
return {
|
|
15408
14773
|
isMobile,
|
|
15409
14774
|
isTablet,
|
|
@@ -15464,11 +14829,11 @@ function useViewerDialogs(input) {
|
|
|
15464
14829
|
);
|
|
15465
14830
|
const [embedFontsEnabled, setEmbedFontsEnabled] = React3.useState(false);
|
|
15466
14831
|
const [isNarrowViewport, setIsNarrowViewport] = React3.useState(
|
|
15467
|
-
() => typeof window !== "undefined" ?
|
|
14832
|
+
() => typeof window !== "undefined" ? chunkP3T4E6JQ_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
15468
14833
|
);
|
|
15469
14834
|
React3.useEffect(() => {
|
|
15470
14835
|
const handleWindow = () => setIsNarrowViewport(
|
|
15471
|
-
|
|
14836
|
+
chunkP3T4E6JQ_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
15472
14837
|
);
|
|
15473
14838
|
let observer = null;
|
|
15474
14839
|
let raf = 0;
|
|
@@ -15482,12 +14847,12 @@ function useViewerDialogs(input) {
|
|
|
15482
14847
|
const entry = entries[0];
|
|
15483
14848
|
if (entry) {
|
|
15484
14849
|
setIsNarrowViewport(
|
|
15485
|
-
|
|
14850
|
+
chunkP3T4E6JQ_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
15486
14851
|
);
|
|
15487
14852
|
}
|
|
15488
14853
|
});
|
|
15489
14854
|
observer.observe(el);
|
|
15490
|
-
setIsNarrowViewport(
|
|
14855
|
+
setIsNarrowViewport(chunkP3T4E6JQ_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
15491
14856
|
};
|
|
15492
14857
|
attach();
|
|
15493
14858
|
window.addEventListener("resize", handleWindow);
|
|
@@ -15664,54 +15029,13 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
|
15664
15029
|
return slides.map((_, i) => i).filter((i) => !slides[i]?.hidden);
|
|
15665
15030
|
}
|
|
15666
15031
|
function computeSlideSectionGroups(slides, sections) {
|
|
15667
|
-
|
|
15668
|
-
|
|
15669
|
-
|
|
15670
|
-
|
|
15671
|
-
|
|
15672
|
-
|
|
15673
|
-
|
|
15674
|
-
const sid = slides[i].sectionId;
|
|
15675
|
-
if (sid) {
|
|
15676
|
-
const arr = sectionSlideMap.get(sid);
|
|
15677
|
-
if (arr) {
|
|
15678
|
-
arr.push(i);
|
|
15679
|
-
} else {
|
|
15680
|
-
sectionSlideMap.set(sid, [i]);
|
|
15681
|
-
}
|
|
15682
|
-
} else {
|
|
15683
|
-
ungroupedIndexes.push(i);
|
|
15684
|
-
}
|
|
15685
|
-
}
|
|
15686
|
-
const groups = sections.map((sec) => ({
|
|
15687
|
-
id: sec.id,
|
|
15688
|
-
label: sec.name,
|
|
15689
|
-
slideIndexes: sectionSlideMap.get(sec.id) ?? [],
|
|
15690
|
-
color: sec.color,
|
|
15691
|
-
defaultCollapsed: sec.collapsed
|
|
15692
|
-
})).filter((g) => g.slideIndexes.length > 0);
|
|
15693
|
-
if (ungroupedIndexes.length > 0) {
|
|
15694
|
-
groups.push({
|
|
15695
|
-
id: UNGROUPED_SECTION_ID,
|
|
15696
|
-
label: "Ungrouped Slides",
|
|
15697
|
-
slideIndexes: ungroupedIndexes
|
|
15698
|
-
});
|
|
15699
|
-
}
|
|
15700
|
-
return groups.length > 0 ? groups : [
|
|
15701
|
-
{
|
|
15702
|
-
id: "default",
|
|
15703
|
-
label: "Slides",
|
|
15704
|
-
slideIndexes: slides.map((_s, i) => i)
|
|
15705
|
-
}
|
|
15706
|
-
];
|
|
15707
|
-
}
|
|
15708
|
-
return [
|
|
15709
|
-
{
|
|
15710
|
-
id: "default",
|
|
15711
|
-
label: "Slides",
|
|
15712
|
-
slideIndexes: slides.map((_s, i) => i)
|
|
15713
|
-
}
|
|
15714
|
-
];
|
|
15032
|
+
return chunkP3T4E6JQ_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
15033
|
+
id: group.section?.id ?? (sections.length > 0 ? UNGROUPED_SECTION_ID : "default"),
|
|
15034
|
+
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
15035
|
+
slideIndexes: group.slideIndexes,
|
|
15036
|
+
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
15037
|
+
...group.section?.collapsed !== void 0 ? { defaultCollapsed: group.section.collapsed } : {}
|
|
15038
|
+
}));
|
|
15715
15039
|
}
|
|
15716
15040
|
function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
15717
15041
|
if (mode !== "master") {
|
|
@@ -15922,13 +15246,13 @@ function useSerialize(input) {
|
|
|
15922
15246
|
let processedSlide = slide;
|
|
15923
15247
|
if (pendingEditId) {
|
|
15924
15248
|
const updatedElements = slide.elements.map((el) => {
|
|
15925
|
-
if (el.id !== pendingEditId || !
|
|
15249
|
+
if (el.id !== pendingEditId || !chunkAD3EAEY6_js.hasTextProperties(el)) {
|
|
15926
15250
|
return el;
|
|
15927
15251
|
}
|
|
15928
15252
|
return {
|
|
15929
15253
|
...el,
|
|
15930
15254
|
text: pendingEditText,
|
|
15931
|
-
textSegments:
|
|
15255
|
+
textSegments: chunkP3T4E6JQ_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
15932
15256
|
};
|
|
15933
15257
|
});
|
|
15934
15258
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -15941,7 +15265,7 @@ function useSerialize(input) {
|
|
|
15941
15265
|
const pptxGuides = guides.map((g) => ({
|
|
15942
15266
|
id: g.id,
|
|
15943
15267
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
15944
|
-
positionEmu:
|
|
15268
|
+
positionEmu: chunkAD3EAEY6_js.guidePxToEmu(g.position)
|
|
15945
15269
|
}));
|
|
15946
15270
|
return {
|
|
15947
15271
|
...processedSlide,
|
|
@@ -16159,10 +15483,10 @@ function usePresentationSetup(input) {
|
|
|
16159
15483
|
onToggleEraser: () => annotations.setPresentationTool("eraser"),
|
|
16160
15484
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
16161
15485
|
onSaveRehearsalTimings: (timings) => {
|
|
16162
|
-
setSlides((prev) => applyRehearsalTimings(prev, timings));
|
|
15486
|
+
setSlides((prev) => chunkP3T4E6JQ_js.applyRehearsalTimings(prev, timings));
|
|
16163
15487
|
history.markDirty();
|
|
16164
15488
|
},
|
|
16165
|
-
loopContinuously: shouldLoopContinuously(presentationProperties),
|
|
15489
|
+
loopContinuously: chunkP3T4E6JQ_js.shouldLoopContinuously(presentationProperties),
|
|
16166
15490
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
16167
15491
|
useTimings: presentationProperties.advanceMode !== "manual"
|
|
16168
15492
|
});
|
|
@@ -16321,7 +15645,7 @@ function useEditorOperations(input) {
|
|
|
16321
15645
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
16322
15646
|
React3.useEffect(() => {
|
|
16323
15647
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
16324
|
-
copiedFormatRef.current =
|
|
15648
|
+
copiedFormatRef.current = chunkP3T4E6JQ_js.copyFormatFromElement(selectedElement);
|
|
16325
15649
|
} else if (!formatPainterActive) {
|
|
16326
15650
|
copiedFormatRef.current = null;
|
|
16327
15651
|
}
|
|
@@ -16347,12 +15671,12 @@ function useEditorOperations(input) {
|
|
|
16347
15671
|
e.stopPropagation();
|
|
16348
15672
|
const element = elementLookup.get(elementId);
|
|
16349
15673
|
if (element) {
|
|
16350
|
-
const updated =
|
|
15674
|
+
const updated = chunkP3T4E6JQ_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
16351
15675
|
const updates = {};
|
|
16352
|
-
if (
|
|
15676
|
+
if (chunkAD3EAEY6_js.hasShapeProperties(updated)) {
|
|
16353
15677
|
updates.shapeStyle = updated.shapeStyle;
|
|
16354
15678
|
}
|
|
16355
|
-
if (
|
|
15679
|
+
if (chunkAD3EAEY6_js.hasTextProperties(updated)) {
|
|
16356
15680
|
updates.textStyle = updated.textStyle;
|
|
16357
15681
|
}
|
|
16358
15682
|
ops.updateElementById(elementId, updates);
|
|
@@ -16495,7 +15819,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
16495
15819
|
const families = /* @__PURE__ */ new Set();
|
|
16496
15820
|
for (const slide of slides) {
|
|
16497
15821
|
for (const el of slide.elements) {
|
|
16498
|
-
if (
|
|
15822
|
+
if (chunkAD3EAEY6_js.hasTextProperties(el) && el.textSegments) {
|
|
16499
15823
|
for (const seg of el.textSegments) {
|
|
16500
15824
|
if (seg.style.fontFamily) {
|
|
16501
15825
|
families.add(seg.style.fontFamily);
|
|
@@ -17279,7 +16603,7 @@ function useYjsProvider({ config }) {
|
|
|
17279
16603
|
const timeoutRef = React3.useRef(null);
|
|
17280
16604
|
const gateRef = React3.useRef(null);
|
|
17281
16605
|
if (!gateRef.current) {
|
|
17282
|
-
gateRef.current =
|
|
16606
|
+
gateRef.current = chunkP3T4E6JQ_js.createSyncGate(() => setSynced(true));
|
|
17283
16607
|
}
|
|
17284
16608
|
const teardown = React3.useCallback(() => {
|
|
17285
16609
|
if (timeoutRef.current) {
|
|
@@ -17317,7 +16641,7 @@ function useYjsProvider({ config }) {
|
|
|
17317
16641
|
if (config.authToken) {
|
|
17318
16642
|
opts.password = config.authToken;
|
|
17319
16643
|
}
|
|
17320
|
-
const provider = new WebrtcProvider(
|
|
16644
|
+
const provider = new WebrtcProvider(chunkP3T4E6JQ_js.validateRoomId(config.roomId), yDoc, opts);
|
|
17321
16645
|
setDoc(yDoc);
|
|
17322
16646
|
setAwareness(provider.awareness);
|
|
17323
16647
|
setClientId(provider.awareness.clientID);
|
|
@@ -17359,13 +16683,13 @@ function useYjsProvider({ config }) {
|
|
|
17359
16683
|
if (!config) {
|
|
17360
16684
|
return;
|
|
17361
16685
|
}
|
|
17362
|
-
const roomId =
|
|
17363
|
-
const transport = config.transport ??
|
|
16686
|
+
const roomId = chunkP3T4E6JQ_js.validateRoomId(config.roomId);
|
|
16687
|
+
const transport = config.transport ?? chunkP3T4E6JQ_js.resolveTransportForServerUrl(config.serverUrl);
|
|
17364
16688
|
if (transport === "webrtc") {
|
|
17365
16689
|
await initWebrtc();
|
|
17366
16690
|
return;
|
|
17367
16691
|
}
|
|
17368
|
-
if (
|
|
16692
|
+
if (chunkP3T4E6JQ_js.isMixedContentBlocked(config.serverUrl)) {
|
|
17369
16693
|
console.warn(
|
|
17370
16694
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
17371
16695
|
);
|
|
@@ -17425,7 +16749,7 @@ function useYjsProvider({ config }) {
|
|
|
17425
16749
|
cleanupRef.current = null;
|
|
17426
16750
|
setStatus("error");
|
|
17427
16751
|
}
|
|
17428
|
-
},
|
|
16752
|
+
}, chunkP3T4E6JQ_js.CONNECTION_TIMEOUT_MS);
|
|
17429
16753
|
}
|
|
17430
16754
|
setDoc(yDoc);
|
|
17431
16755
|
setAwareness(provider.awareness);
|
|
@@ -17498,7 +16822,7 @@ function usePresenceTracking({
|
|
|
17498
16822
|
awareness.setLocalStateField("presence", state);
|
|
17499
16823
|
lastBroadcastRef.current = Date.now();
|
|
17500
16824
|
};
|
|
17501
|
-
if (elapsed >=
|
|
16825
|
+
if (elapsed >= chunkP3T4E6JQ_js.BROADCAST_THROTTLE_MS) {
|
|
17502
16826
|
if (pendingBroadcastRef.current) {
|
|
17503
16827
|
clearTimeout(pendingBroadcastRef.current);
|
|
17504
16828
|
pendingBroadcastRef.current = null;
|
|
@@ -17508,7 +16832,7 @@ function usePresenceTracking({
|
|
|
17508
16832
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
17509
16833
|
pendingBroadcastRef.current = null;
|
|
17510
16834
|
flush();
|
|
17511
|
-
},
|
|
16835
|
+
}, chunkP3T4E6JQ_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
17512
16836
|
}
|
|
17513
16837
|
},
|
|
17514
16838
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -17533,7 +16857,7 @@ function usePresenceTracking({
|
|
|
17533
16857
|
return;
|
|
17534
16858
|
}
|
|
17535
16859
|
const handleChange = () => {
|
|
17536
|
-
const users =
|
|
16860
|
+
const users = chunkP3T4E6JQ_js.derivePresenceList(
|
|
17537
16861
|
awareness.getStates(),
|
|
17538
16862
|
localClientId,
|
|
17539
16863
|
canvasWidth,
|
|
@@ -17581,7 +16905,7 @@ function useCollaborativeState({
|
|
|
17581
16905
|
canvasWidth,
|
|
17582
16906
|
canvasHeight
|
|
17583
16907
|
}) {
|
|
17584
|
-
const userColor =
|
|
16908
|
+
const userColor = chunkP3T4E6JQ_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
17585
16909
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
17586
16910
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
17587
16911
|
awareness,
|
|
@@ -17684,10 +17008,10 @@ function useYjsDocumentSync({
|
|
|
17684
17008
|
return;
|
|
17685
17009
|
}
|
|
17686
17010
|
try {
|
|
17687
|
-
const { PptxHandler: PptxHandler2 } = await import('./dist-
|
|
17011
|
+
const { PptxHandler: PptxHandler2 } = await import('./dist-M2P6HBG4.js');
|
|
17688
17012
|
const handler = new PptxHandler2();
|
|
17689
17013
|
await handler.load(sourceBytes.buffer);
|
|
17690
|
-
const currentSlides =
|
|
17014
|
+
const currentSlides = chunkP3T4E6JQ_js.readSlidesFromYDoc(
|
|
17691
17015
|
doc
|
|
17692
17016
|
);
|
|
17693
17017
|
const slidesToSave = buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
@@ -17708,11 +17032,11 @@ function useYjsDocumentSync({
|
|
|
17708
17032
|
lastSyncedRef.current = serialized;
|
|
17709
17033
|
void (async () => {
|
|
17710
17034
|
const factories = await getFactories();
|
|
17711
|
-
|
|
17035
|
+
chunkP3T4E6JQ_js.reconcileSlidesInYDoc(
|
|
17712
17036
|
slides,
|
|
17713
17037
|
doc,
|
|
17714
17038
|
factories,
|
|
17715
|
-
|
|
17039
|
+
chunkP3T4E6JQ_js.LOCAL_SYNC_ORIGIN
|
|
17716
17040
|
);
|
|
17717
17041
|
scheduleWriteBack();
|
|
17718
17042
|
})();
|
|
@@ -17722,10 +17046,10 @@ function useYjsDocumentSync({
|
|
|
17722
17046
|
return;
|
|
17723
17047
|
}
|
|
17724
17048
|
const handleChange = (_events, transaction) => {
|
|
17725
|
-
if (transaction?.origin ===
|
|
17049
|
+
if (transaction?.origin === chunkP3T4E6JQ_js.LOCAL_SYNC_ORIGIN) {
|
|
17726
17050
|
return;
|
|
17727
17051
|
}
|
|
17728
|
-
const remoteSlides =
|
|
17052
|
+
const remoteSlides = chunkP3T4E6JQ_js.readSlidesFromYDoc(
|
|
17729
17053
|
doc
|
|
17730
17054
|
);
|
|
17731
17055
|
if (remoteSlides.length === 0) {
|
|
@@ -17743,7 +17067,7 @@ function useYjsDocumentSync({
|
|
|
17743
17067
|
});
|
|
17744
17068
|
scheduleWriteBack();
|
|
17745
17069
|
};
|
|
17746
|
-
const unobserve =
|
|
17070
|
+
const unobserve = chunkP3T4E6JQ_js.observeYDocSlides(
|
|
17747
17071
|
doc,
|
|
17748
17072
|
handleChange
|
|
17749
17073
|
);
|
|
@@ -17891,39 +17215,10 @@ function useLayoutSwitching(input) {
|
|
|
17891
17215
|
currentLayoutPath
|
|
17892
17216
|
};
|
|
17893
17217
|
}
|
|
17894
|
-
var DEFAULT_OVERSCAN = 5;
|
|
17895
|
-
function computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan = DEFAULT_OVERSCAN) {
|
|
17896
|
-
const safeItemHeight = Math.max(itemHeight, 1);
|
|
17897
|
-
const totalHeight = totalItems * safeItemHeight;
|
|
17898
|
-
if (totalItems === 0) {
|
|
17899
|
-
return {
|
|
17900
|
-
startIndex: 0,
|
|
17901
|
-
endIndex: -1,
|
|
17902
|
-
totalHeight: 0,
|
|
17903
|
-
offsetY: 0,
|
|
17904
|
-
visibleRange: { start: 0, end: -1 }
|
|
17905
|
-
};
|
|
17906
|
-
}
|
|
17907
|
-
const visibleStart = Math.floor(scrollTop / safeItemHeight);
|
|
17908
|
-
const visibleEnd = Math.min(
|
|
17909
|
-
totalItems - 1,
|
|
17910
|
-
Math.floor((scrollTop + viewportHeight) / safeItemHeight)
|
|
17911
|
-
);
|
|
17912
|
-
const startIndex = Math.max(0, visibleStart - overscan);
|
|
17913
|
-
const endIndex = Math.min(totalItems - 1, visibleEnd + overscan);
|
|
17914
|
-
const offsetY = startIndex * safeItemHeight;
|
|
17915
|
-
return {
|
|
17916
|
-
startIndex,
|
|
17917
|
-
endIndex,
|
|
17918
|
-
totalHeight,
|
|
17919
|
-
offsetY,
|
|
17920
|
-
visibleRange: { start: visibleStart, end: visibleEnd }
|
|
17921
|
-
};
|
|
17922
|
-
}
|
|
17923
17218
|
function useVirtualizedSlides({
|
|
17924
17219
|
totalItems,
|
|
17925
17220
|
itemHeight,
|
|
17926
|
-
overscan =
|
|
17221
|
+
overscan = chunkP3T4E6JQ_js.DEFAULT_VIRTUAL_OVERSCAN
|
|
17927
17222
|
}) {
|
|
17928
17223
|
const scrollContainerRef = React3.useRef(null);
|
|
17929
17224
|
const [scrollTop, setScrollTop] = React3.useState(0);
|
|
@@ -17953,7 +17248,7 @@ function useVirtualizedSlides({
|
|
|
17953
17248
|
resizeObserver?.disconnect();
|
|
17954
17249
|
};
|
|
17955
17250
|
}, []);
|
|
17956
|
-
const range = computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
|
|
17251
|
+
const range = chunkP3T4E6JQ_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
|
|
17957
17252
|
const safeItemHeight = Math.max(itemHeight, 1);
|
|
17958
17253
|
const scrollToIndex = React3.useCallback(
|
|
17959
17254
|
(index, behavior = "smooth") => {
|
|
@@ -17999,7 +17294,7 @@ function useTouchGestures(input) {
|
|
|
17999
17294
|
if (!el || !enabled) {
|
|
18000
17295
|
return;
|
|
18001
17296
|
}
|
|
18002
|
-
const recognizer =
|
|
17297
|
+
const recognizer = chunkP3T4E6JQ_js.createTouchGestureRecognizer({
|
|
18003
17298
|
getScale: () => scaleRef.current,
|
|
18004
17299
|
minScale: MIN_ZOOM_SCALE,
|
|
18005
17300
|
maxScale: MAX_ZOOM_SCALE,
|
|
@@ -18042,7 +17337,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
18042
17337
|
return;
|
|
18043
17338
|
}
|
|
18044
17339
|
const rect = active.getBoundingClientRect();
|
|
18045
|
-
const delta =
|
|
17340
|
+
const delta = chunkP3T4E6JQ_js.computeScrollDelta(
|
|
18046
17341
|
{ top: rect.top, bottom: rect.bottom },
|
|
18047
17342
|
window.innerHeight,
|
|
18048
17343
|
keyboardInset
|
|
@@ -18062,8 +17357,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18062
17357
|
return;
|
|
18063
17358
|
}
|
|
18064
17359
|
const update = () => {
|
|
18065
|
-
const metrics =
|
|
18066
|
-
const inset = metrics ?
|
|
17360
|
+
const metrics = chunkP3T4E6JQ_js.readViewportMetrics(window);
|
|
17361
|
+
const inset = metrics ? chunkP3T4E6JQ_js.computeKeyboardInset(metrics) : 0;
|
|
18067
17362
|
setKeyboardInset(inset);
|
|
18068
17363
|
if (inset > 0) {
|
|
18069
17364
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -18074,8 +17369,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18074
17369
|
vv.addEventListener("scroll", update);
|
|
18075
17370
|
const onFocusIn = () => {
|
|
18076
17371
|
window.requestAnimationFrame(() => {
|
|
18077
|
-
const metrics =
|
|
18078
|
-
const inset = metrics ?
|
|
17372
|
+
const metrics = chunkP3T4E6JQ_js.readViewportMetrics(window);
|
|
17373
|
+
const inset = metrics ? chunkP3T4E6JQ_js.computeKeyboardInset(metrics) : 0;
|
|
18079
17374
|
if (inset > 0) {
|
|
18080
17375
|
scrollFocusedIntoView(inset);
|
|
18081
17376
|
}
|
|
@@ -18088,7 +17383,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18088
17383
|
document.removeEventListener("focusin", onFocusIn);
|
|
18089
17384
|
};
|
|
18090
17385
|
}, [enabled]);
|
|
18091
|
-
return { keyboardInset, isKeyboardOpen:
|
|
17386
|
+
return { keyboardInset, isKeyboardOpen: chunkP3T4E6JQ_js.isKeyboardOpen(keyboardInset) };
|
|
18092
17387
|
}
|
|
18093
17388
|
var LEFT_MIN = 120;
|
|
18094
17389
|
var LEFT_MAX = 400;
|
|
@@ -18167,7 +17462,6 @@ exports.DEFAULT_FONT_FAMILY = DEFAULT_FONT_FAMILY;
|
|
|
18167
17462
|
exports.DEFAULT_STROKE_COLOR = DEFAULT_STROKE_COLOR;
|
|
18168
17463
|
exports.DEFAULT_TEXT_COLOR = DEFAULT_TEXT_COLOR;
|
|
18169
17464
|
exports.DEFAULT_TEXT_FONT_SIZE = DEFAULT_TEXT_FONT_SIZE;
|
|
18170
|
-
exports.EMU_PER_PX = EMU_PER_PX;
|
|
18171
17465
|
exports.GRID_SIZE = GRID_SIZE;
|
|
18172
17466
|
exports.HYPERLINK_COLOR = HYPERLINK_COLOR;
|
|
18173
17467
|
exports.MIN_ELEMENT_SIZE = MIN_ELEMENT_SIZE;
|
|
@@ -18184,16 +17478,11 @@ exports.buildLineShadowCss = buildLineShadowCss;
|
|
|
18184
17478
|
exports.buildReactChartViewModel = buildReactChartViewModel;
|
|
18185
17479
|
exports.buildTextBody3DSceneStyle = buildTextBody3DSceneStyle2;
|
|
18186
17480
|
exports.buildTree = buildTree;
|
|
18187
|
-
exports.cellStyleToCss = cellStyleToCss;
|
|
18188
17481
|
exports.chevronPoints = chevronPoints;
|
|
18189
17482
|
exports.clearAudienceContent = clearAudienceContent;
|
|
18190
17483
|
exports.cn = cn;
|
|
18191
17484
|
exports.colour = colour;
|
|
18192
|
-
exports.computeVirtualRange = computeVirtualRange;
|
|
18193
17485
|
exports.detectTargetType = detectTargetType;
|
|
18194
|
-
exports.ensureArrayValue = ensureArrayValue;
|
|
18195
|
-
exports.extractCellText = extractCellText;
|
|
18196
|
-
exports.extractTableCellStyle = extractTableCellStyle;
|
|
18197
17486
|
exports.fitFontSize = fitFontSize;
|
|
18198
17487
|
exports.gearPath = gearPath;
|
|
18199
17488
|
exports.getAnimationInitialStyle = getAnimationInitialStyle2;
|
|
@@ -18203,7 +17492,6 @@ exports.getDuotoneColors = getDuotoneColors;
|
|
|
18203
17492
|
exports.getImageRenderStyle = getImageRenderStyle;
|
|
18204
17493
|
exports.getImageTilingStyle = getImageTilingStyle;
|
|
18205
17494
|
exports.getShapeVisualStyle = getShapeVisualStyle;
|
|
18206
|
-
exports.getTableCellBandStyle = getTableCellBandStyle;
|
|
18207
17495
|
exports.getTextLayoutStyle = getTextLayoutStyle;
|
|
18208
17496
|
exports.getTextStyleForElement = getTextStyleForElement;
|
|
18209
17497
|
exports.getTextWarpStyle = getTextWarpStyle;
|
|
@@ -18217,18 +17505,14 @@ exports.nodeOpacity = nodeOpacity;
|
|
|
18217
17505
|
exports.parseAudienceNonce = parseAudienceNonce;
|
|
18218
17506
|
exports.parseEmailUrl = parseEmailUrl;
|
|
18219
17507
|
exports.parseSlideFromUrl = parseSlideFromUrl;
|
|
18220
|
-
exports.parseTableElementData = parseTableElementData;
|
|
18221
17508
|
exports.renderAccentProcess = renderAccentProcess;
|
|
18222
17509
|
exports.renderAlternatingFlow = renderAlternatingFlow;
|
|
18223
|
-
exports.renderArtisticEffectSvgFilter = renderArtisticEffectSvgFilter;
|
|
18224
17510
|
exports.renderChartElement = renderChartElement;
|
|
18225
17511
|
exports.renderConnectorMarker = renderConnectorMarker;
|
|
18226
17512
|
exports.renderDagDuotoneSvgFilter = renderDagDuotoneSvgFilter;
|
|
18227
17513
|
exports.renderDescendingProcess = renderDescendingProcess;
|
|
18228
|
-
exports.renderDuotoneSvgFilter = renderDuotoneSvgFilter;
|
|
18229
17514
|
exports.renderGroupedList = renderGroupedList;
|
|
18230
17515
|
exports.renderHorizontalPictureList = renderHorizontalPictureList;
|
|
18231
|
-
exports.renderImageAlphaSvgFilter = renderImageAlphaSvgFilter;
|
|
18232
17516
|
exports.renderMediaElement = renderMediaElement;
|
|
18233
17517
|
exports.renderPictureAccentList = renderPictureAccentList;
|
|
18234
17518
|
exports.renderPyramidList = renderPyramidList;
|