pptx-react-viewer 1.23.0 → 1.24.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/README.md +27 -0
- package/dist/{Model3DScene-4XNBDASE.mjs → Model3DScene-QTNGCODM.mjs} +2 -2
- package/dist/Model3DScene-QTNGCODM.mjs.br +0 -0
- package/dist/Model3DScene-QTNGCODM.mjs.gz +0 -0
- package/dist/{Model3DScene-AQS7KDM4.js → Model3DScene-RD4XEC3F.js} +3 -3
- package/dist/Model3DScene-RD4XEC3F.js.br +0 -0
- package/dist/Model3DScene-RD4XEC3F.js.gz +0 -0
- package/dist/{PowerPointViewer-DFTatVS4.d.ts → PowerPointViewer-CnADroqZ.d.ts} +2 -2
- package/dist/{PowerPointViewer-DFTatVS4.d.ts.map → PowerPointViewer-CnADroqZ.d.ts.map} +1 -1
- package/dist/{SurfaceChart3DScene-K7ZDXDBL.mjs → SurfaceChart3DScene-VKS3ELTU.mjs} +2 -2
- package/dist/SurfaceChart3DScene-VKS3ELTU.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-VKS3ELTU.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-HA2SD6BY.js → SurfaceChart3DScene-YR3GX4X6.js} +3 -3
- package/dist/SurfaceChart3DScene-YR3GX4X6.js.br +0 -0
- package/dist/SurfaceChart3DScene-YR3GX4X6.js.gz +0 -0
- package/dist/{types-Da1M5VBY.d.ts → animation-timeline-CEJJLFqK.d.ts} +3 -3
- package/dist/animation-timeline-CEJJLFqK.d.ts.map +1 -0
- package/dist/{chunk-LS2AIX2H.js → chunk-3YMK5VLS.js} +26707 -26744
- package/dist/chunk-3YMK5VLS.js.br +0 -0
- package/dist/chunk-3YMK5VLS.js.gz +0 -0
- package/dist/{chunk-H5RREYCO.js → chunk-GKST4OS7.js} +1270 -454
- package/dist/chunk-GKST4OS7.js.br +0 -0
- package/dist/chunk-GKST4OS7.js.gz +0 -0
- package/dist/{chunk-2DXNTVFV.js → chunk-I5SO5OV4.js} +69 -71
- package/dist/chunk-I5SO5OV4.js.br +0 -0
- package/dist/chunk-I5SO5OV4.js.gz +0 -0
- package/dist/{chunk-I42XL2WU.mjs → chunk-KPT54MHG.mjs} +40 -42
- package/dist/chunk-KPT54MHG.mjs.br +0 -0
- package/dist/chunk-KPT54MHG.mjs.gz +0 -0
- package/dist/{chunk-MS6S6YYR.js → chunk-KV3EOLP3.js} +50785 -50553
- package/dist/chunk-KV3EOLP3.js.br +0 -0
- package/dist/chunk-KV3EOLP3.js.gz +0 -0
- package/dist/{chunk-AFWMAFWR.mjs → chunk-LDZQNYWL.mjs} +50784 -50554
- package/dist/chunk-LDZQNYWL.mjs.br +0 -0
- package/dist/chunk-LDZQNYWL.mjs.gz +0 -0
- package/dist/{chunk-36NC56XG.mjs → chunk-PUQ6GIOM.mjs} +26099 -26138
- package/dist/chunk-PUQ6GIOM.mjs.br +0 -0
- package/dist/chunk-PUQ6GIOM.mjs.gz +0 -0
- package/dist/{chunk-LFEVG3ED.mjs → chunk-YJVMOX2Y.mjs} +819 -5
- package/dist/chunk-YJVMOX2Y.mjs.br +0 -0
- package/dist/chunk-YJVMOX2Y.mjs.gz +0 -0
- package/dist/{dist-5KQQ6GP2.mjs → dist-A3OATMOE.mjs} +1 -1
- package/dist/dist-A3OATMOE.mjs.br +0 -0
- package/dist/dist-A3OATMOE.mjs.gz +0 -0
- package/dist/{dist-CVSSAFDL.js → dist-XF3QJAEF.js} +568 -560
- package/dist/dist-XF3QJAEF.js.br +0 -0
- package/dist/dist-XF3QJAEF.js.gz +0 -0
- package/dist/hooks-unstable.d.ts +407 -37
- package/dist/hooks-unstable.d.ts.map +1 -1
- package/dist/hooks-unstable.js +80 -76
- 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-COgh2UTL.d.ts → index-hm2FF-FU.d.ts} +3 -3
- package/dist/{index-COgh2UTL.d.ts.map → index-hm2FF-FU.d.ts.map} +1 -1
- package/dist/index.d.ts +865 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -30
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/useViewerBuildingBlocks-ll3_ncCH.d.ts +378 -0
- package/dist/useViewerBuildingBlocks-ll3_ncCH.d.ts.map +1 -0
- 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-4XNBDASE.mjs.br +0 -0
- package/dist/Model3DScene-4XNBDASE.mjs.gz +0 -0
- package/dist/Model3DScene-AQS7KDM4.js.br +0 -0
- package/dist/Model3DScene-AQS7KDM4.js.gz +0 -0
- package/dist/SurfaceChart3DScene-HA2SD6BY.js.br +0 -0
- package/dist/SurfaceChart3DScene-HA2SD6BY.js.gz +0 -0
- package/dist/SurfaceChart3DScene-K7ZDXDBL.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-K7ZDXDBL.mjs.gz +0 -0
- package/dist/chunk-2DXNTVFV.js.br +0 -0
- package/dist/chunk-2DXNTVFV.js.gz +0 -0
- package/dist/chunk-36NC56XG.mjs.br +0 -0
- package/dist/chunk-36NC56XG.mjs.gz +0 -0
- package/dist/chunk-AFWMAFWR.mjs.br +0 -0
- package/dist/chunk-AFWMAFWR.mjs.gz +0 -0
- package/dist/chunk-H5RREYCO.js.br +0 -0
- package/dist/chunk-H5RREYCO.js.gz +0 -0
- package/dist/chunk-I42XL2WU.mjs.br +0 -0
- package/dist/chunk-I42XL2WU.mjs.gz +0 -0
- package/dist/chunk-LFEVG3ED.mjs.br +0 -0
- package/dist/chunk-LFEVG3ED.mjs.gz +0 -0
- package/dist/chunk-LS2AIX2H.js.br +0 -0
- package/dist/chunk-LS2AIX2H.js.gz +0 -0
- package/dist/chunk-MS6S6YYR.js.br +0 -0
- package/dist/chunk-MS6S6YYR.js.gz +0 -0
- package/dist/dist-5KQQ6GP2.mjs.br +0 -0
- package/dist/dist-5KQQ6GP2.mjs.gz +0 -0
- package/dist/dist-CVSSAFDL.js.br +0 -0
- package/dist/dist-CVSSAFDL.js.gz +0 -0
- package/dist/types-Da1M5VBY.d.ts.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkI5SO5OV4_js = require('./chunk-I5SO5OV4.js');
|
|
4
4
|
var chunkZISXRMDJ_js = require('./chunk-ZISXRMDJ.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkKV3EOLP3_js = require('./chunk-KV3EOLP3.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 chunkI5SO5OV4_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(chunkI5SO5OV4_js.cloneSlide),
|
|
70
|
+
templateElementsBySlideId: chunkI5SO5OV4_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(chunkI5SO5OV4_js.cloneSlide));
|
|
84
84
|
setTemplateElementsBySlideId(
|
|
85
|
-
|
|
85
|
+
chunkI5SO5OV4_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 = chunkI5SO5OV4_js.SHAPE_PRESET_DEFS.map(
|
|
349
349
|
(def) => ({
|
|
350
350
|
type: def.type,
|
|
351
351
|
label: def.label,
|
|
@@ -661,20 +661,20 @@ function useAnimationPlayback(input) {
|
|
|
661
661
|
for (const anim of nativeAnims) {
|
|
662
662
|
if (anim.buildType && anim.buildType !== "allAtOnce" && anim.targetId) {
|
|
663
663
|
const el = slide.elements.find((e) => e.id === anim.targetId);
|
|
664
|
-
if (el &&
|
|
665
|
-
segmentCounts.set(anim.targetId,
|
|
664
|
+
if (el && chunkKV3EOLP3_js.hasTextProperties(el) && el.textSegments && el.textSegments.length > 0) {
|
|
665
|
+
segmentCounts.set(anim.targetId, chunkI5SO5OV4_js.countTextSegments(el.textSegments));
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
668
|
}
|
|
669
|
-
const expandedAnims = segmentCounts.size > 0 ?
|
|
670
|
-
const engine =
|
|
669
|
+
const expandedAnims = segmentCounts.size > 0 ? chunkI5SO5OV4_js.expandTextBuildAnimations(nativeAnims, segmentCounts) : nativeAnims;
|
|
670
|
+
const engine = chunkI5SO5OV4_js.TimelineEngine.fromAnimations(expandedAnims);
|
|
671
671
|
timelineEngineRef.current = engine;
|
|
672
672
|
setPresentationKeyframesCss(engine.getTimeline().keyframesCss);
|
|
673
673
|
setInteractiveTriggerShapeIds(engine.getInteractiveTriggerShapeIds());
|
|
674
674
|
setHoverTriggerShapeIds(engine.getHoverTriggerShapeIds());
|
|
675
675
|
const allIds = slide.elements.map((element) => element.id);
|
|
676
676
|
for (const anim of expandedAnims) {
|
|
677
|
-
if (anim.targetId && anim.targetId.includes(
|
|
677
|
+
if (anim.targetId && anim.targetId.includes(chunkI5SO5OV4_js.TEXT_BUILD_ID_SEP)) {
|
|
678
678
|
allIds.push(anim.targetId);
|
|
679
679
|
}
|
|
680
680
|
}
|
|
@@ -806,7 +806,7 @@ function useAnimationPlayback(input) {
|
|
|
806
806
|
}))
|
|
807
807
|
);
|
|
808
808
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
809
|
-
const delay =
|
|
809
|
+
const delay = chunkI5SO5OV4_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
810
810
|
const timer = window.setTimeout(() => {
|
|
811
811
|
setPresentationAnimations(
|
|
812
812
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -863,7 +863,7 @@ function openDb() {
|
|
|
863
863
|
}
|
|
864
864
|
async function storeAudienceContent(content, sessionId) {
|
|
865
865
|
if (sessionId) {
|
|
866
|
-
return
|
|
866
|
+
return chunkI5SO5OV4_js.storePresentationDeck(sessionId, content);
|
|
867
867
|
}
|
|
868
868
|
const db = await openDb();
|
|
869
869
|
return new Promise((resolve, reject) => {
|
|
@@ -884,7 +884,7 @@ async function storeAudienceContent(content, sessionId) {
|
|
|
884
884
|
}
|
|
885
885
|
async function loadAudienceContent(sessionId) {
|
|
886
886
|
if (sessionId) {
|
|
887
|
-
return
|
|
887
|
+
return chunkI5SO5OV4_js.loadPresentationDeck(sessionId);
|
|
888
888
|
}
|
|
889
889
|
try {
|
|
890
890
|
const db = await openDb();
|
|
@@ -925,7 +925,7 @@ async function loadAudienceContent(sessionId) {
|
|
|
925
925
|
}
|
|
926
926
|
async function clearAudienceContent(sessionId) {
|
|
927
927
|
if (sessionId) {
|
|
928
|
-
return
|
|
928
|
+
return chunkI5SO5OV4_js.clearPresentationDeck(sessionId);
|
|
929
929
|
}
|
|
930
930
|
try {
|
|
931
931
|
const db = await openDb();
|
|
@@ -945,12 +945,12 @@ async function clearAudienceContent(sessionId) {
|
|
|
945
945
|
} catch {
|
|
946
946
|
}
|
|
947
947
|
}
|
|
948
|
-
var PRESENTER_CHANNEL_NAME =
|
|
949
|
-
var AUDIENCE_HASH =
|
|
950
|
-
var PRESENTER_MSG_ORIGIN =
|
|
951
|
-
var AUDIENCE_NONCE_KEY =
|
|
948
|
+
var PRESENTER_CHANNEL_NAME = chunkI5SO5OV4_js.PRESENTATION_CHANNEL_NAME;
|
|
949
|
+
var AUDIENCE_HASH = chunkI5SO5OV4_js.PRESENTATION_HASH;
|
|
950
|
+
var PRESENTER_MSG_ORIGIN = chunkI5SO5OV4_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
951
|
+
var AUDIENCE_NONCE_KEY = chunkI5SO5OV4_js.PRESENTATION_NONCE_KEY;
|
|
952
952
|
function generateSessionId() {
|
|
953
|
-
return
|
|
953
|
+
return chunkI5SO5OV4_js.createPresentationSessionId();
|
|
954
954
|
}
|
|
955
955
|
function parseAudienceNonce() {
|
|
956
956
|
const hash = window.location.hash;
|
|
@@ -986,7 +986,7 @@ function usePresenterWindow(input) {
|
|
|
986
986
|
}, []);
|
|
987
987
|
const swapDisplays = React3.useCallback(async () => {
|
|
988
988
|
const audience = audienceWindowRef.current;
|
|
989
|
-
return audience && !audience.closed ?
|
|
989
|
+
return audience && !audience.closed ? chunkI5SO5OV4_js.swapPresentationWindows(window, audience) : false;
|
|
990
990
|
}, []);
|
|
991
991
|
const syncSlideToAudience = React3.useCallback(
|
|
992
992
|
(slideIndex) => {
|
|
@@ -1068,10 +1068,10 @@ function usePresenterWindow(input) {
|
|
|
1068
1068
|
audienceWindowRef.current = blankWin;
|
|
1069
1069
|
const sessionId = generateSessionId();
|
|
1070
1070
|
sessionIdRef.current = sessionId;
|
|
1071
|
-
const audienceUrl =
|
|
1072
|
-
void
|
|
1071
|
+
const audienceUrl = chunkI5SO5OV4_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1072
|
+
void chunkI5SO5OV4_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1073
1073
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1074
|
-
|
|
1074
|
+
chunkI5SO5OV4_js.placeAudienceWindow(blankWin, placement);
|
|
1075
1075
|
}
|
|
1076
1076
|
return void 0;
|
|
1077
1077
|
});
|
|
@@ -1127,7 +1127,7 @@ function usePresenterWindow(input) {
|
|
|
1127
1127
|
}
|
|
1128
1128
|
const handleMessage = (event) => {
|
|
1129
1129
|
const message = event.data;
|
|
1130
|
-
if (
|
|
1130
|
+
if (chunkI5SO5OV4_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1131
1131
|
syncStateToAudience(snapshotRef.current);
|
|
1132
1132
|
}
|
|
1133
1133
|
};
|
|
@@ -1209,7 +1209,7 @@ function useAudienceMode(input) {
|
|
|
1209
1209
|
}
|
|
1210
1210
|
channel.onmessage = (event) => {
|
|
1211
1211
|
const data = event.data;
|
|
1212
|
-
if (!
|
|
1212
|
+
if (!chunkI5SO5OV4_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1213
1213
|
return;
|
|
1214
1214
|
}
|
|
1215
1215
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1235,7 +1235,7 @@ function useAudienceMode(input) {
|
|
|
1235
1235
|
};
|
|
1236
1236
|
if (expectedSessionId) {
|
|
1237
1237
|
channel.postMessage({
|
|
1238
|
-
origin:
|
|
1238
|
+
origin: chunkI5SO5OV4_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1239
1239
|
type: "audience-ready",
|
|
1240
1240
|
sessionId: expectedSessionId
|
|
1241
1241
|
});
|
|
@@ -1500,7 +1500,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1500
1500
|
return;
|
|
1501
1501
|
}
|
|
1502
1502
|
if (action.url && !actionStr.includes("hlinksldjump")) {
|
|
1503
|
-
if (
|
|
1503
|
+
if (chunkI5SO5OV4_js.isUrlSafe(action.url)) {
|
|
1504
1504
|
window.open(action.url, "_blank", "noopener,noreferrer");
|
|
1505
1505
|
}
|
|
1506
1506
|
}
|
|
@@ -1510,7 +1510,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1510
1510
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1511
1511
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1512
1512
|
const transition = incomingSlide?.transition;
|
|
1513
|
-
const durationMs = deps.playTransition ?
|
|
1513
|
+
const durationMs = deps.playTransition ? chunkI5SO5OV4_js.resolveTransitionDurationMs(transition) : 0;
|
|
1514
1514
|
deps.clearPresentationTimers();
|
|
1515
1515
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1516
1516
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1744,17 +1744,17 @@ function useZoomNavigation(input) {
|
|
|
1744
1744
|
};
|
|
1745
1745
|
}
|
|
1746
1746
|
function usePresenterConsole(slideIndex) {
|
|
1747
|
-
const timerRef = React3.useRef(
|
|
1748
|
-
const [snapshot, setSnapshot] = React3.useState(() =>
|
|
1747
|
+
const timerRef = React3.useRef(chunkI5SO5OV4_js.createPresenterTimer());
|
|
1748
|
+
const [snapshot, setSnapshot] = React3.useState(() => chunkI5SO5OV4_js.createInitialPresentationSnapshot(slideIndex));
|
|
1749
1749
|
const patch = React3.useCallback((value) => {
|
|
1750
|
-
setSnapshot((current) =>
|
|
1750
|
+
setSnapshot((current) => chunkI5SO5OV4_js.mergePresentationSnapshot(current, value));
|
|
1751
1751
|
}, []);
|
|
1752
1752
|
React3.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
1753
1753
|
React3.useEffect(() => {
|
|
1754
1754
|
const timer = window.setInterval(() => {
|
|
1755
1755
|
patch({
|
|
1756
1756
|
paused: timerRef.current.paused,
|
|
1757
|
-
elapsedMs:
|
|
1757
|
+
elapsedMs: chunkI5SO5OV4_js.presenterElapsed(timerRef.current)
|
|
1758
1758
|
});
|
|
1759
1759
|
}, 1e3);
|
|
1760
1760
|
return () => window.clearInterval(timer);
|
|
@@ -1764,19 +1764,19 @@ function usePresenterConsole(slideIndex) {
|
|
|
1764
1764
|
applyAudienceSnapshot: setSnapshot,
|
|
1765
1765
|
setBlackout: (blackout) => patch({ blackout }),
|
|
1766
1766
|
toggleTimer: () => {
|
|
1767
|
-
timerRef.current =
|
|
1767
|
+
timerRef.current = chunkI5SO5OV4_js.togglePresenterTimer(timerRef.current);
|
|
1768
1768
|
patch({
|
|
1769
1769
|
paused: timerRef.current.paused,
|
|
1770
|
-
elapsedMs:
|
|
1770
|
+
elapsedMs: chunkI5SO5OV4_js.presenterElapsed(timerRef.current)
|
|
1771
1771
|
});
|
|
1772
1772
|
},
|
|
1773
1773
|
resetTimer: () => {
|
|
1774
|
-
timerRef.current =
|
|
1774
|
+
timerRef.current = chunkI5SO5OV4_js.resetPresenterTimer();
|
|
1775
1775
|
patch({ paused: false, elapsedMs: 0 });
|
|
1776
1776
|
},
|
|
1777
1777
|
stepZoom: (direction) => setSnapshot(
|
|
1778
|
-
(current) =>
|
|
1779
|
-
zoom:
|
|
1778
|
+
(current) => chunkI5SO5OV4_js.mergePresentationSnapshot(current, {
|
|
1779
|
+
zoom: chunkI5SO5OV4_js.stepPresenterZoom(
|
|
1780
1780
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
1781
1781
|
direction
|
|
1782
1782
|
)
|
|
@@ -2316,7 +2316,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2316
2316
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2317
2317
|
slides.forEach((slide, slideIndex) => {
|
|
2318
2318
|
for (const element of slide.elements || []) {
|
|
2319
|
-
if (!
|
|
2319
|
+
if (!chunkKV3EOLP3_js.hasTextProperties(element)) {
|
|
2320
2320
|
continue;
|
|
2321
2321
|
}
|
|
2322
2322
|
const segments = element.textSegments ?? [];
|
|
@@ -2367,7 +2367,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2367
2367
|
continue;
|
|
2368
2368
|
}
|
|
2369
2369
|
const element = slide.elements[elIdx];
|
|
2370
|
-
if (!
|
|
2370
|
+
if (!chunkKV3EOLP3_js.hasTextProperties(element)) {
|
|
2371
2371
|
continue;
|
|
2372
2372
|
}
|
|
2373
2373
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3292,12 +3292,12 @@ function useViewerState(input) {
|
|
|
3292
3292
|
function partitionTemplateElements(slides) {
|
|
3293
3293
|
const templateElementsBySlideId = {};
|
|
3294
3294
|
const nextSlides = slides.map((slide) => {
|
|
3295
|
-
const template = slide.elements.filter((el) =>
|
|
3295
|
+
const template = slide.elements.filter((el) => chunkI5SO5OV4_js.isTemplateElement(el));
|
|
3296
3296
|
if (template.length === 0) {
|
|
3297
3297
|
return slide;
|
|
3298
3298
|
}
|
|
3299
3299
|
templateElementsBySlideId[slide.id] = template;
|
|
3300
|
-
return { ...slide, elements: slide.elements.filter((el) => !
|
|
3300
|
+
return { ...slide, elements: slide.elements.filter((el) => !chunkI5SO5OV4_js.isTemplateElement(el)) };
|
|
3301
3301
|
});
|
|
3302
3302
|
return { slides: nextSlides, templateElementsBySlideId };
|
|
3303
3303
|
}
|
|
@@ -3370,7 +3370,7 @@ function useLoadContent({
|
|
|
3370
3370
|
);
|
|
3371
3371
|
}
|
|
3372
3372
|
const previousHandler = handlerRef.current;
|
|
3373
|
-
const handler = new
|
|
3373
|
+
const handler = new chunkKV3EOLP3_js.PptxHandler();
|
|
3374
3374
|
const parsed = await handler.load(buffer);
|
|
3375
3375
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3376
3376
|
handler.dispose();
|
|
@@ -3382,7 +3382,7 @@ function useLoadContent({
|
|
|
3382
3382
|
handlerRef.current = null;
|
|
3383
3383
|
const mediaElements = [];
|
|
3384
3384
|
for (const slide of parsed.slides) {
|
|
3385
|
-
|
|
3385
|
+
chunkI5SO5OV4_js.collectMediaElements(slide.elements, mediaElements);
|
|
3386
3386
|
}
|
|
3387
3387
|
for (const url of mediaDataUrls.values()) {
|
|
3388
3388
|
if (url.startsWith("blob:")) {
|
|
@@ -3423,7 +3423,7 @@ function useLoadContent({
|
|
|
3423
3423
|
}
|
|
3424
3424
|
})
|
|
3425
3425
|
);
|
|
3426
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3426
|
+
const { paths: imagePaths, refs: imageRefs } = chunkI5SO5OV4_js.collectImagePaths(parsed.slides);
|
|
3427
3427
|
let nextSlides = parsed.slides;
|
|
3428
3428
|
if (imagePaths.size > 0) {
|
|
3429
3429
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3512,14 +3512,14 @@ function useLoadContent({
|
|
|
3512
3512
|
setHasMacros(parsed.hasMacros === true);
|
|
3513
3513
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3514
3514
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3515
|
-
setGuides(
|
|
3515
|
+
setGuides(chunkI5SO5OV4_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3516
3516
|
setActiveSlideIndex(0);
|
|
3517
3517
|
clearSelection();
|
|
3518
3518
|
setIsDirty(false);
|
|
3519
3519
|
history.resetHistory();
|
|
3520
3520
|
} catch (err) {
|
|
3521
3521
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3522
|
-
if (err instanceof
|
|
3522
|
+
if (err instanceof chunkKV3EOLP3_js.EncryptedFileError) {
|
|
3523
3523
|
setIsEncrypted(true);
|
|
3524
3524
|
} else {
|
|
3525
3525
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3596,7 +3596,7 @@ function useAutosave(input) {
|
|
|
3596
3596
|
isSavingRef.current = false;
|
|
3597
3597
|
return;
|
|
3598
3598
|
}
|
|
3599
|
-
await
|
|
3599
|
+
await chunkI5SO5OV4_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
3600
3600
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
3601
3601
|
} catch (err) {
|
|
3602
3602
|
setAutosaveStatus({
|
|
@@ -3634,7 +3634,7 @@ function useAutosave(input) {
|
|
|
3634
3634
|
|
|
3635
3635
|
// src/viewer/utils/animation-effects.ts
|
|
3636
3636
|
function getAnimationInitialStyle2(preset, nativeAnimation) {
|
|
3637
|
-
return
|
|
3637
|
+
return chunkI5SO5OV4_js.getAnimationInitialStyle(preset, nativeAnimation);
|
|
3638
3638
|
}
|
|
3639
3639
|
function cn(...inputs) {
|
|
3640
3640
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
@@ -3642,7 +3642,7 @@ function cn(...inputs) {
|
|
|
3642
3642
|
|
|
3643
3643
|
// src/viewer/utils/text-utils.tsx
|
|
3644
3644
|
function getTextStyleForElement(element, fallbackColor) {
|
|
3645
|
-
if (!
|
|
3645
|
+
if (!chunkKV3EOLP3_js.hasTextProperties(element)) {
|
|
3646
3646
|
return { color: fallbackColor };
|
|
3647
3647
|
}
|
|
3648
3648
|
const textDecorationTokens = [];
|
|
@@ -3656,20 +3656,20 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3656
3656
|
const textDecorationStyle = isDoubleStrike ? "double" : void 0;
|
|
3657
3657
|
const hasItalicRuns = element.textStyle?.italic || Boolean(element.textSegments?.some((segment) => segment.style?.italic));
|
|
3658
3658
|
const isRtl = element.textStyle?.rtl === true;
|
|
3659
|
-
const resolvedTextColor = element.textStyle?.hyperlink ?
|
|
3659
|
+
const resolvedTextColor = element.textStyle?.hyperlink ? chunkI5SO5OV4_js.normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : chunkI5SO5OV4_js.normalizeHexColor(element.textStyle?.color, fallbackColor);
|
|
3660
3660
|
const bodyTop = element.textStyle?.bodyInsetTop ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3661
3661
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3662
3662
|
const bodyLeft = element.textStyle?.bodyInsetLeft ?? DEFAULT_BODY_INSET_LR_PX;
|
|
3663
3663
|
const bodyRight = element.textStyle?.bodyInsetRight ?? DEFAULT_BODY_INSET_LR_PX;
|
|
3664
|
-
const writingMode =
|
|
3665
|
-
const textOrientation =
|
|
3666
|
-
const verticalDirection =
|
|
3664
|
+
const writingMode = chunkI5SO5OV4_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
3665
|
+
const textOrientation = chunkI5SO5OV4_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
3666
|
+
const verticalDirection = chunkI5SO5OV4_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
3667
3667
|
const resolvedDirection = verticalDirection || (isRtl ? "rtl" : "ltr");
|
|
3668
3668
|
const resolvedUnicodeBidi = isRtl ? "plaintext" : void 0;
|
|
3669
3669
|
const hasSegments = (element.textSegments?.length ?? 0) > 0;
|
|
3670
3670
|
return {
|
|
3671
3671
|
color: resolvedTextColor,
|
|
3672
|
-
backgroundColor: !hasSegments && element.textStyle?.highlightColor ?
|
|
3672
|
+
backgroundColor: !hasSegments && element.textStyle?.highlightColor ? chunkI5SO5OV4_js.normalizeHexColor(element.textStyle.highlightColor, void 0) : void 0,
|
|
3673
3673
|
textAlign: (() => {
|
|
3674
3674
|
const a = element.textStyle?.align;
|
|
3675
3675
|
if (a === "justLow" || a === "dist" || a === "thaiDist") {
|
|
@@ -3685,7 +3685,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3685
3685
|
textDecorationLine: textDecorationTokens.length > 0 ? textDecorationTokens.join(" ") : "none",
|
|
3686
3686
|
textDecorationStyle,
|
|
3687
3687
|
fontFamily: element.textStyle?.fontFamily || DEFAULT_FONT_FAMILY,
|
|
3688
|
-
lineHeight:
|
|
3688
|
+
lineHeight: chunkI5SO5OV4_js.resolveLineHeight(element.textStyle, hasItalicRuns),
|
|
3689
3689
|
paddingTop: bodyTop + (hasItalicRuns ? 1 : 0),
|
|
3690
3690
|
paddingBottom: bodyBottom + (hasItalicRuns ? 1 : 0),
|
|
3691
3691
|
paddingLeft: bodyLeft + (element.textStyle?.paragraphMarginLeft || 0),
|
|
@@ -3698,7 +3698,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3698
3698
|
// Auto-fit: use OOXML-provided fontScale/lnSpcReduction when available,
|
|
3699
3699
|
// otherwise fall back to heuristic estimation. The pure font-scale maths
|
|
3700
3700
|
// now lives in pptx-viewer-shared (computeAutoFitTextStyle).
|
|
3701
|
-
...
|
|
3701
|
+
...chunkI5SO5OV4_js.computeAutoFitTextStyle({
|
|
3702
3702
|
textStyle: element.textStyle,
|
|
3703
3703
|
text: element.text ?? "",
|
|
3704
3704
|
width: element.width,
|
|
@@ -3731,13 +3731,13 @@ function computeTabSize(tabStops) {
|
|
|
3731
3731
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : void 0;
|
|
3732
3732
|
}
|
|
3733
3733
|
function getTextLayoutStyle(element) {
|
|
3734
|
-
if (!
|
|
3734
|
+
if (!chunkKV3EOLP3_js.hasTextProperties(element)) {
|
|
3735
3735
|
return {};
|
|
3736
3736
|
}
|
|
3737
3737
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
3738
|
-
const writingMode =
|
|
3739
|
-
const textOrientation =
|
|
3740
|
-
const verticalDirection =
|
|
3738
|
+
const writingMode = chunkI5SO5OV4_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
3739
|
+
const textOrientation = chunkI5SO5OV4_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
3740
|
+
const verticalDirection = chunkI5SO5OV4_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
3741
3741
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
3742
3742
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
3743
3743
|
const hasColumns = columnCount > 1;
|
|
@@ -3745,7 +3745,7 @@ function getTextLayoutStyle(element) {
|
|
|
3745
3745
|
const tabStops = element.textStyle?.tabStops;
|
|
3746
3746
|
const tabSize = computeTabSize(tabStops);
|
|
3747
3747
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
3748
|
-
const hasParagraphIndents =
|
|
3748
|
+
const hasParagraphIndents = chunkKV3EOLP3_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
3749
3749
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
3750
3750
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
3751
3751
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -3754,7 +3754,7 @@ function getTextLayoutStyle(element) {
|
|
|
3754
3754
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3755
3755
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
3756
3756
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
3757
|
-
const kinsokuStyles =
|
|
3757
|
+
const kinsokuStyles = chunkI5SO5OV4_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
3758
3758
|
if (hasColumns) {
|
|
3759
3759
|
return {
|
|
3760
3760
|
display: "block",
|
|
@@ -3797,10 +3797,10 @@ function getTextLayoutStyle(element) {
|
|
|
3797
3797
|
|
|
3798
3798
|
// src/viewer/utils/text-effects.tsx
|
|
3799
3799
|
function buildTextFillCss2(style) {
|
|
3800
|
-
return
|
|
3800
|
+
return chunkI5SO5OV4_js.buildTextFillCss(style);
|
|
3801
3801
|
}
|
|
3802
3802
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
3803
|
-
return
|
|
3803
|
+
return chunkI5SO5OV4_js.buildTextBody3DSceneStyle(textStyle);
|
|
3804
3804
|
}
|
|
3805
3805
|
|
|
3806
3806
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -3985,17 +3985,17 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
3985
3985
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
3986
3986
|
return renderedSegments;
|
|
3987
3987
|
}
|
|
3988
|
-
const paraKey = `${elementId}${
|
|
3988
|
+
const paraKey = `${elementId}${chunkI5SO5OV4_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
3989
3989
|
const paraState = subElementAnimStates.get(paraKey);
|
|
3990
3990
|
if (paraState) {
|
|
3991
3991
|
const style = buildAnimStyle(paraState);
|
|
3992
3992
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
3993
3993
|
}
|
|
3994
|
-
const firstWordKey = `${elementId}${
|
|
3994
|
+
const firstWordKey = `${elementId}${chunkI5SO5OV4_js.TEXT_BUILD_ID_SEP}w${paraIndex}-0`;
|
|
3995
3995
|
if (subElementAnimStates.has(firstWordKey)) {
|
|
3996
3996
|
return wrapByWord(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
3997
3997
|
}
|
|
3998
|
-
const firstCharKey = `${elementId}${
|
|
3998
|
+
const firstCharKey = `${elementId}${chunkI5SO5OV4_js.TEXT_BUILD_ID_SEP}c${paraIndex}-0`;
|
|
3999
3999
|
if (subElementAnimStates.has(firstCharKey)) {
|
|
4000
4000
|
return wrapByChar(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
4001
4001
|
}
|
|
@@ -4016,7 +4016,7 @@ function wrapByWord(elementId, paraIndex, paraSegments, states) {
|
|
|
4016
4016
|
nodes.push(/* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Fragment, { children: w }, `ws-${i}`));
|
|
4017
4017
|
continue;
|
|
4018
4018
|
}
|
|
4019
|
-
const key = `${elementId}${
|
|
4019
|
+
const key = `${elementId}${chunkI5SO5OV4_js.TEXT_BUILD_ID_SEP}w${paraIndex}-${wordIdx}`;
|
|
4020
4020
|
const state = states.get(key);
|
|
4021
4021
|
const style = buildAnimStyle(state);
|
|
4022
4022
|
nodes.push(
|
|
@@ -4030,7 +4030,7 @@ function wrapByChar(elementId, paraIndex, paraSegments, states) {
|
|
|
4030
4030
|
const fullText = paraSegments.map((e) => e.segment.text).join("");
|
|
4031
4031
|
const nodes = [];
|
|
4032
4032
|
for (let i = 0; i < fullText.length; i++) {
|
|
4033
|
-
const key = `${elementId}${
|
|
4033
|
+
const key = `${elementId}${chunkI5SO5OV4_js.TEXT_BUILD_ID_SEP}c${paraIndex}-${i}`;
|
|
4034
4034
|
const state = states.get(key);
|
|
4035
4035
|
const style = buildAnimStyle(state);
|
|
4036
4036
|
nodes.push(
|
|
@@ -4043,10 +4043,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
4043
4043
|
if (!needsScriptFonts || !text) {
|
|
4044
4044
|
return text;
|
|
4045
4045
|
}
|
|
4046
|
-
const runs =
|
|
4046
|
+
const runs = chunkI5SO5OV4_js.segmentByScript(text);
|
|
4047
4047
|
if (runs.length <= 1) {
|
|
4048
4048
|
if (runs.length === 1) {
|
|
4049
|
-
const font =
|
|
4049
|
+
const font = chunkI5SO5OV4_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
4050
4050
|
if (font && font !== baseFontFamily) {
|
|
4051
4051
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
4052
4052
|
}
|
|
@@ -4054,7 +4054,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
4054
4054
|
return text;
|
|
4055
4055
|
}
|
|
4056
4056
|
return runs.map((run, i) => {
|
|
4057
|
-
const font =
|
|
4057
|
+
const font = chunkI5SO5OV4_js.resolveFontForScript(run.script, scriptFonts);
|
|
4058
4058
|
if (!font || font === baseFontFamily) {
|
|
4059
4059
|
return /* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
4060
4060
|
}
|
|
@@ -4128,8 +4128,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
4128
4128
|
);
|
|
4129
4129
|
}
|
|
4130
4130
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
4131
|
-
const mathml =
|
|
4132
|
-
const safeMathml = mathml ?
|
|
4131
|
+
const mathml = chunkI5SO5OV4_js.convertOmmlToMathMl(equationXml);
|
|
4132
|
+
const safeMathml = mathml ? chunkI5SO5OV4_js.sanitizeMathMl(mathml) : "";
|
|
4133
4133
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4134
4134
|
"span",
|
|
4135
4135
|
{
|
|
@@ -4179,7 +4179,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
4179
4179
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
4180
4180
|
}
|
|
4181
4181
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
4182
|
-
const picture =
|
|
4182
|
+
const picture = chunkI5SO5OV4_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
4183
4183
|
sizePx: baseFontSize,
|
|
4184
4184
|
fallbackMarker: "\u2022",
|
|
4185
4185
|
accessibleLabel: "Bullet"
|
|
@@ -4229,7 +4229,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4229
4229
|
);
|
|
4230
4230
|
}
|
|
4231
4231
|
const segmentStyle = segment.style || {};
|
|
4232
|
-
const textValue =
|
|
4232
|
+
const textValue = chunkI5SO5OV4_js.substituteFieldText(segment.text || "", segment.fieldType, fieldContext);
|
|
4233
4233
|
const lines = textValue.split("\n");
|
|
4234
4234
|
const textDecorationTokens = [];
|
|
4235
4235
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -4239,8 +4239,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4239
4239
|
textDecorationTokens.push("line-through");
|
|
4240
4240
|
}
|
|
4241
4241
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
4242
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
4243
|
-
const underlineDecoration =
|
|
4242
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkI5SO5OV4_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkI5SO5OV4_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
4243
|
+
const underlineDecoration = chunkI5SO5OV4_js.resolveUnderlineDecorationStyle(
|
|
4244
4244
|
Boolean(isDoubleStrike),
|
|
4245
4245
|
segmentStyle.underlineStyle
|
|
4246
4246
|
);
|
|
@@ -4253,14 +4253,14 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4253
4253
|
const autoFitScale = element.textStyle?.autoFitFontScale !== void 0 && element.textStyle.autoFitFontScale > 0 && element.textStyle.autoFitFontScale < 1 ? element.textStyle.autoFitFontScale : 1;
|
|
4254
4254
|
const baseFontSize = rawFontSize * autoFitScale;
|
|
4255
4255
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
4256
|
-
const baseFontFamily = rawFontFamily ?
|
|
4256
|
+
const baseFontFamily = rawFontFamily ? chunkKV3EOLP3_js.getSubstituteFontFamily(rawFontFamily) : DEFAULT_FONT_FAMILY;
|
|
4257
4257
|
const scriptFonts = {
|
|
4258
4258
|
latin: baseFontFamily,
|
|
4259
4259
|
eastAsia: segmentStyle.eastAsiaFont || element.textStyle?.eastAsiaFont || baseFontFamily,
|
|
4260
4260
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
4261
4261
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
4262
4262
|
};
|
|
4263
|
-
const needsScriptFonts =
|
|
4263
|
+
const needsScriptFonts = chunkI5SO5OV4_js.hasDistinctScriptFonts(scriptFonts);
|
|
4264
4264
|
const spanStyle = {
|
|
4265
4265
|
color: resolvedSegmentColor,
|
|
4266
4266
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -4274,15 +4274,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4274
4274
|
verticalAlign: baselineShift,
|
|
4275
4275
|
letterSpacing,
|
|
4276
4276
|
fontKerning,
|
|
4277
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
4277
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkI5SO5OV4_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
4278
4278
|
...textFillStyles,
|
|
4279
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
4280
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
4279
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkI5SO5OV4_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
4280
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkI5SO5OV4_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
4281
4281
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
4282
|
-
textShadow:
|
|
4283
|
-
filter:
|
|
4284
|
-
opacity:
|
|
4285
|
-
WebkitBoxReflect:
|
|
4282
|
+
textShadow: chunkI5SO5OV4_js.buildTextShadowCss(segmentStyle),
|
|
4283
|
+
filter: chunkI5SO5OV4_js.buildTextRunFilterChain(segmentStyle),
|
|
4284
|
+
opacity: chunkI5SO5OV4_js.getTextAlphaOpacity(segmentStyle),
|
|
4285
|
+
WebkitBoxReflect: chunkI5SO5OV4_js.buildTextReflectionCss(segmentStyle)
|
|
4286
4286
|
};
|
|
4287
4287
|
const runRtl = segmentStyle.rtl;
|
|
4288
4288
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -4302,7 +4302,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4302
4302
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
4303
4303
|
}
|
|
4304
4304
|
if (bulletInfo.color) {
|
|
4305
|
-
spanStyle.color =
|
|
4305
|
+
spanStyle.color = chunkI5SO5OV4_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
4306
4306
|
}
|
|
4307
4307
|
}
|
|
4308
4308
|
if (bulletInfo?.imageDataUrl || bulletInfo?.imageRelId) {
|
|
@@ -4334,7 +4334,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4334
4334
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
4335
4335
|
};
|
|
4336
4336
|
if (segment.rubyStyle?.color) {
|
|
4337
|
-
rubyStyle.color =
|
|
4337
|
+
rubyStyle.color = chunkI5SO5OV4_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
4338
4338
|
}
|
|
4339
4339
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
4340
4340
|
baseContent,
|
|
@@ -4404,7 +4404,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
4404
4404
|
return paragraphs;
|
|
4405
4405
|
}
|
|
4406
4406
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
4407
|
-
if (!
|
|
4407
|
+
if (!chunkKV3EOLP3_js.hasTextProperties(element)) {
|
|
4408
4408
|
return emptyFallback || null;
|
|
4409
4409
|
}
|
|
4410
4410
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -4425,9 +4425,9 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
4425
4425
|
return element.text || emptyFallback || "";
|
|
4426
4426
|
}
|
|
4427
4427
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
4428
|
-
const paragraphIndents =
|
|
4429
|
-
const elementRtl =
|
|
4430
|
-
const elementAlign =
|
|
4428
|
+
const paragraphIndents = chunkKV3EOLP3_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
4429
|
+
const elementRtl = chunkKV3EOLP3_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
4430
|
+
const elementAlign = chunkKV3EOLP3_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
4431
4431
|
return paragraphs.map((paraSegments, paraIndex) => {
|
|
4432
4432
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
4433
4433
|
const rawMarginLeft = typeof paraIndent?.marginLeft === "number" && paraIndent.marginLeft !== 0 ? paraIndent.marginLeft : void 0;
|
|
@@ -4441,14 +4441,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
4441
4441
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
4442
4442
|
});
|
|
4443
4443
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
4444
|
-
const paraRtl =
|
|
4444
|
+
const paraRtl = chunkI5SO5OV4_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
4445
4445
|
const isRtlParagraph = paraRtl === true;
|
|
4446
|
-
const paraAlign =
|
|
4447
|
-
const cssTextAlign =
|
|
4446
|
+
const paraAlign = chunkI5SO5OV4_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
4447
|
+
const cssTextAlign = chunkI5SO5OV4_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
4448
4448
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
4449
4449
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
4450
4450
|
const paraTextIndent = rawTextIndent;
|
|
4451
|
-
const paraKinsokuStyle =
|
|
4451
|
+
const paraKinsokuStyle = chunkI5SO5OV4_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
4452
4452
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
4453
4453
|
const paraStyle = {
|
|
4454
4454
|
...paraKinsokuStyle
|
|
@@ -4613,7 +4613,7 @@ function isConnectorOrLineElement(element) {
|
|
|
4613
4613
|
if (element.type === "connector") {
|
|
4614
4614
|
return true;
|
|
4615
4615
|
}
|
|
4616
|
-
if (!
|
|
4616
|
+
if (!chunkKV3EOLP3_js.hasShapeProperties(element)) {
|
|
4617
4617
|
return false;
|
|
4618
4618
|
}
|
|
4619
4619
|
const st = getShapeType(element.shapeType);
|
|
@@ -4631,13 +4631,13 @@ function hexToRgbUnit(hex) {
|
|
|
4631
4631
|
};
|
|
4632
4632
|
}
|
|
4633
4633
|
function getDuotoneColors(element) {
|
|
4634
|
-
if (!
|
|
4634
|
+
if (!chunkKV3EOLP3_js.isImageLikeElement(element)) {
|
|
4635
4635
|
return void 0;
|
|
4636
4636
|
}
|
|
4637
4637
|
return element.imageEffects?.duotone;
|
|
4638
4638
|
}
|
|
4639
4639
|
function buildLineShadowCss(element) {
|
|
4640
|
-
if (!
|
|
4640
|
+
if (!chunkKV3EOLP3_js.hasShapeProperties(element)) {
|
|
4641
4641
|
return void 0;
|
|
4642
4642
|
}
|
|
4643
4643
|
const ss = element.shapeStyle;
|
|
@@ -4648,13 +4648,13 @@ function buildLineShadowCss(element) {
|
|
|
4648
4648
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
4649
4649
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
4650
4650
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
4651
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
4652
|
-
|
|
4651
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkI5SO5OV4_js.colorWithOpacity(
|
|
4652
|
+
chunkI5SO5OV4_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
4653
4653
|
opacity
|
|
4654
4654
|
)}`;
|
|
4655
4655
|
}
|
|
4656
4656
|
function buildLineGlowFilter(element) {
|
|
4657
|
-
if (!
|
|
4657
|
+
if (!chunkKV3EOLP3_js.hasShapeProperties(element)) {
|
|
4658
4658
|
return void 0;
|
|
4659
4659
|
}
|
|
4660
4660
|
const ss = element.shapeStyle;
|
|
@@ -4663,7 +4663,7 @@ function buildLineGlowFilter(element) {
|
|
|
4663
4663
|
}
|
|
4664
4664
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
4665
4665
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
4666
|
-
const glowCol =
|
|
4666
|
+
const glowCol = chunkI5SO5OV4_js.colorWithOpacity(chunkI5SO5OV4_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
4667
4667
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
4668
4668
|
}
|
|
4669
4669
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -4687,7 +4687,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
4687
4687
|
return `dag-duotone-${elementId}`;
|
|
4688
4688
|
}
|
|
4689
4689
|
function hasDagDuotoneEffect(element) {
|
|
4690
|
-
if (!
|
|
4690
|
+
if (!chunkKV3EOLP3_js.hasShapeProperties(element)) {
|
|
4691
4691
|
return false;
|
|
4692
4692
|
}
|
|
4693
4693
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -4750,7 +4750,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
4750
4750
|
|
|
4751
4751
|
// src/viewer/utils/shape-visual-3d.ts
|
|
4752
4752
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
4753
|
-
return
|
|
4753
|
+
return chunkI5SO5OV4_js.build3DExtrusionData(
|
|
4754
4754
|
shape3d,
|
|
4755
4755
|
scene3d,
|
|
4756
4756
|
fillColor,
|
|
@@ -4759,27 +4759,27 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
4759
4759
|
);
|
|
4760
4760
|
}
|
|
4761
4761
|
function apply3dEffects2(base, scene3d, shape3d) {
|
|
4762
|
-
|
|
4762
|
+
chunkI5SO5OV4_js.apply3dEffects(base, scene3d, shape3d);
|
|
4763
4763
|
}
|
|
4764
4764
|
|
|
4765
4765
|
// src/viewer/utils/shape-visual-style.ts
|
|
4766
4766
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor) {
|
|
4767
|
-
if (!
|
|
4767
|
+
if (!chunkKV3EOLP3_js.hasShapeProperties(element)) {
|
|
4768
4768
|
return {};
|
|
4769
4769
|
}
|
|
4770
4770
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
4771
|
-
const clipPath =
|
|
4771
|
+
const clipPath = chunkI5SO5OV4_js.getResolvedShapeClipPath(element);
|
|
4772
4772
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
4773
4773
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
4774
|
-
const strokeDash =
|
|
4775
|
-
const fillGradient =
|
|
4776
|
-
const shadowCss =
|
|
4777
|
-
const innerShadowCss =
|
|
4778
|
-
const resolvedFillColor =
|
|
4779
|
-
const resolvedStrokeColor =
|
|
4774
|
+
const strokeDash = chunkI5SO5OV4_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
4775
|
+
const fillGradient = chunkI5SO5OV4_js.buildCssGradientFromShapeStyle(element.shapeStyle) || element.shapeStyle?.fillGradient;
|
|
4776
|
+
const shadowCss = chunkI5SO5OV4_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
4777
|
+
const innerShadowCss = chunkI5SO5OV4_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
4778
|
+
const resolvedFillColor = chunkI5SO5OV4_js.colorWithOpacity(fillColor, fillOpacity);
|
|
4779
|
+
const resolvedStrokeColor = chunkI5SO5OV4_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
4780
4780
|
const ss = element.shapeStyle;
|
|
4781
4781
|
const combinedShadowParts = [];
|
|
4782
|
-
const multiLayerShadow =
|
|
4782
|
+
const multiLayerShadow = chunkI5SO5OV4_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
4783
4783
|
if (multiLayerShadow) {
|
|
4784
4784
|
combinedShadowParts.push(multiLayerShadow);
|
|
4785
4785
|
} else if (shadowCss) {
|
|
@@ -4788,7 +4788,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4788
4788
|
if (innerShadowCss) {
|
|
4789
4789
|
combinedShadowParts.push(innerShadowCss);
|
|
4790
4790
|
}
|
|
4791
|
-
const glowBoxShadow =
|
|
4791
|
+
const glowBoxShadow = chunkI5SO5OV4_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
4792
4792
|
if (glowBoxShadow) {
|
|
4793
4793
|
combinedShadowParts.push(glowBoxShadow);
|
|
4794
4794
|
}
|
|
@@ -4796,7 +4796,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4796
4796
|
if (lineShadow) {
|
|
4797
4797
|
combinedShadowParts.push(lineShadow);
|
|
4798
4798
|
}
|
|
4799
|
-
const compoundLineShadow =
|
|
4799
|
+
const compoundLineShadow = chunkI5SO5OV4_js.getCompoundLineBoxShadow(
|
|
4800
4800
|
element.shapeStyle?.compoundLine,
|
|
4801
4801
|
strokeWidth,
|
|
4802
4802
|
resolvedStrokeColor
|
|
@@ -4809,7 +4809,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4809
4809
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
4810
4810
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
4811
4811
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
4812
|
-
const glowCol =
|
|
4812
|
+
const glowCol = chunkI5SO5OV4_js.colorWithOpacity(chunkI5SO5OV4_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
4813
4813
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
4814
4814
|
}
|
|
4815
4815
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
@@ -4822,12 +4822,12 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4822
4822
|
if (lineGlowCss) {
|
|
4823
4823
|
filterParts.push(lineGlowCss);
|
|
4824
4824
|
}
|
|
4825
|
-
const dagFilter =
|
|
4825
|
+
const dagFilter = chunkI5SO5OV4_js.getEffectDagFilter(ss, element.id);
|
|
4826
4826
|
if (dagFilter) {
|
|
4827
4827
|
filterParts.push(dagFilter);
|
|
4828
4828
|
}
|
|
4829
4829
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : void 0;
|
|
4830
|
-
const patternFill =
|
|
4830
|
+
const patternFill = chunkI5SO5OV4_js.buildPatternFillCss(element.shapeStyle);
|
|
4831
4831
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
4832
4832
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
4833
4833
|
let reflectCss;
|
|
@@ -4839,7 +4839,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4839
4839
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
4840
4840
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
4841
4841
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
4842
|
-
reflectCss =
|
|
4842
|
+
reflectCss = chunkI5SO5OV4_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
4843
4843
|
}
|
|
4844
4844
|
}
|
|
4845
4845
|
const base = {
|
|
@@ -4853,9 +4853,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4853
4853
|
filter: filterParts.length > 0 ? filterParts.join(" ") : void 0,
|
|
4854
4854
|
opacity: typeof ss?.dagAlphaModFix === "number" ? Math.max(0, Math.min(1, ss.dagAlphaModFix / 100)) : void 0,
|
|
4855
4855
|
mixBlendMode: mapDagBlendModeToCss(ss?.dagFillOverlayBlend),
|
|
4856
|
-
borderWidth: strokeWidth > 0 ?
|
|
4856
|
+
borderWidth: strokeWidth > 0 ? chunkI5SO5OV4_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : void 0,
|
|
4857
4857
|
borderColor: strokeWidth > 0 ? resolvedStrokeColor : void 0,
|
|
4858
|
-
borderStyle: strokeWidth > 0 ?
|
|
4858
|
+
borderStyle: strokeWidth > 0 ? chunkI5SO5OV4_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
4859
4859
|
strokeLinejoin: lineJoinCss,
|
|
4860
4860
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : void 0
|
|
4861
4861
|
};
|
|
@@ -4896,7 +4896,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4896
4896
|
borderWidth: 0,
|
|
4897
4897
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
4898
4898
|
borderTopColor: resolvedStrokeColor,
|
|
4899
|
-
borderTopStyle:
|
|
4899
|
+
borderTopStyle: chunkI5SO5OV4_js.getCssBorderDashStyle(strokeDash)
|
|
4900
4900
|
};
|
|
4901
4901
|
}
|
|
4902
4902
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -4910,13 +4910,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4910
4910
|
function getConnectorAdjustment(element, key, fallback) {
|
|
4911
4911
|
const direct = element.shapeAdjustments?.[key];
|
|
4912
4912
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
4913
|
-
return
|
|
4913
|
+
return chunkI5SO5OV4_js.clampUnitInterval(direct / 1e5);
|
|
4914
4914
|
}
|
|
4915
4915
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
4916
4916
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
4917
|
-
return
|
|
4917
|
+
return chunkI5SO5OV4_js.clampUnitInterval(fallbackKey / 1e5);
|
|
4918
4918
|
}
|
|
4919
|
-
return
|
|
4919
|
+
return chunkI5SO5OV4_js.clampUnitInterval(fallback);
|
|
4920
4920
|
}
|
|
4921
4921
|
function getConnectorPathGeometry(element) {
|
|
4922
4922
|
const width = Math.max(element.width, 1);
|
|
@@ -5043,14 +5043,14 @@ function renderConnectorMarker(markerId, arrowType, color, arrowWidth, arrowLeng
|
|
|
5043
5043
|
);
|
|
5044
5044
|
}
|
|
5045
5045
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor) {
|
|
5046
|
-
if (!
|
|
5046
|
+
if (!chunkKV3EOLP3_js.hasShapeProperties(element)) {
|
|
5047
5047
|
return null;
|
|
5048
5048
|
}
|
|
5049
5049
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
5050
|
-
const fillPaint =
|
|
5051
|
-
const strokePaint =
|
|
5052
|
-
const dashType =
|
|
5053
|
-
const dashArray =
|
|
5050
|
+
const fillPaint = chunkI5SO5OV4_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
5051
|
+
const strokePaint = chunkI5SO5OV4_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
5052
|
+
const dashType = chunkI5SO5OV4_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
5053
|
+
const dashArray = chunkI5SO5OV4_js.getSvgStrokeDasharray(
|
|
5054
5054
|
dashType,
|
|
5055
5055
|
Math.max(strokeWidth, 1),
|
|
5056
5056
|
element.shapeStyle?.customDashSegments
|
|
@@ -5134,18 +5134,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5134
5134
|
}
|
|
5135
5135
|
);
|
|
5136
5136
|
}
|
|
5137
|
-
if (
|
|
5137
|
+
if (chunkKV3EOLP3_js.isCalloutShape(normalizedType)) {
|
|
5138
5138
|
const width = Math.max(element.width, 1);
|
|
5139
5139
|
const height = Math.max(element.height, 1);
|
|
5140
|
-
const geometry =
|
|
5140
|
+
const geometry = chunkKV3EOLP3_js.getCalloutLeaderLineGeometry(
|
|
5141
5141
|
normalizedType,
|
|
5142
5142
|
width,
|
|
5143
5143
|
height,
|
|
5144
5144
|
element.shapeAdjustments
|
|
5145
5145
|
);
|
|
5146
5146
|
if (geometry && geometry.points.length >= 2) {
|
|
5147
|
-
const leaderPath =
|
|
5148
|
-
const bounds =
|
|
5147
|
+
const leaderPath = chunkKV3EOLP3_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
5148
|
+
const bounds = chunkKV3EOLP3_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
5149
5149
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
5150
5150
|
const offsetLeft = bounds.minX;
|
|
5151
5151
|
const offsetTop = bounds.minY;
|
|
@@ -5209,8 +5209,8 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5209
5209
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
5210
5210
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
5211
5211
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
5212
|
-
const offsets =
|
|
5213
|
-
const widths =
|
|
5212
|
+
const offsets = chunkI5SO5OV4_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
5213
|
+
const widths = chunkI5SO5OV4_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
5214
5214
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5215
5215
|
"svg",
|
|
5216
5216
|
{
|
|
@@ -5264,7 +5264,7 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5264
5264
|
|
|
5265
5265
|
// src/viewer/utils/image-style.ts
|
|
5266
5266
|
function getImageMaskStyle(element) {
|
|
5267
|
-
if (!
|
|
5267
|
+
if (!chunkKV3EOLP3_js.hasShapeProperties(element)) {
|
|
5268
5268
|
return void 0;
|
|
5269
5269
|
}
|
|
5270
5270
|
const shapeType = element.shapeType;
|
|
@@ -5273,7 +5273,7 @@ function getImageMaskStyle(element) {
|
|
|
5273
5273
|
}
|
|
5274
5274
|
const normalized = shapeType.toLowerCase();
|
|
5275
5275
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
5276
|
-
const radiusPx =
|
|
5276
|
+
const radiusPx = chunkI5SO5OV4_js.getRoundRectRadiusPx(element);
|
|
5277
5277
|
if (radiusPx <= 0.01) {
|
|
5278
5278
|
return void 0;
|
|
5279
5279
|
}
|
|
@@ -5285,7 +5285,7 @@ function getImageMaskStyle(element) {
|
|
|
5285
5285
|
if (normalized === "can" || normalized === "cylinder") {
|
|
5286
5286
|
return { borderRadius: "48% / 12%" };
|
|
5287
5287
|
}
|
|
5288
|
-
const clipPath =
|
|
5288
|
+
const clipPath = chunkI5SO5OV4_js.getResolvedShapeClipPath(element);
|
|
5289
5289
|
if (!clipPath) {
|
|
5290
5290
|
return void 0;
|
|
5291
5291
|
}
|
|
@@ -5293,7 +5293,7 @@ function getImageMaskStyle(element) {
|
|
|
5293
5293
|
}
|
|
5294
5294
|
function getImageRenderStyle(element) {
|
|
5295
5295
|
const maskStyle = getImageMaskStyle(element) || {};
|
|
5296
|
-
if (!
|
|
5296
|
+
if (!chunkKV3EOLP3_js.isImageLikeElement(element)) {
|
|
5297
5297
|
return {
|
|
5298
5298
|
...maskStyle,
|
|
5299
5299
|
width: "100%",
|
|
@@ -5301,10 +5301,10 @@ function getImageRenderStyle(element) {
|
|
|
5301
5301
|
objectFit: "cover"
|
|
5302
5302
|
};
|
|
5303
5303
|
}
|
|
5304
|
-
const cropLeft =
|
|
5305
|
-
const cropTop =
|
|
5306
|
-
const cropRight =
|
|
5307
|
-
const cropBottom =
|
|
5304
|
+
const cropLeft = chunkI5SO5OV4_js.clampCropValue(element.cropLeft);
|
|
5305
|
+
const cropTop = chunkI5SO5OV4_js.clampCropValue(element.cropTop);
|
|
5306
|
+
const cropRight = chunkI5SO5OV4_js.clampCropValue(element.cropRight);
|
|
5307
|
+
const cropBottom = chunkI5SO5OV4_js.clampCropValue(element.cropBottom);
|
|
5308
5308
|
const hasCrop = cropLeft + cropRight > 1e-4 || cropTop + cropBottom > 1e-4;
|
|
5309
5309
|
if (!hasCrop) {
|
|
5310
5310
|
return {
|
|
@@ -5316,10 +5316,10 @@ function getImageRenderStyle(element) {
|
|
|
5316
5316
|
}
|
|
5317
5317
|
const safeHorizontalScale = cropLeft + cropRight >= 0.99 ? 0.99 / (cropLeft + cropRight) : 1;
|
|
5318
5318
|
const safeVerticalScale = cropTop + cropBottom >= 0.99 ? 0.99 / (cropTop + cropBottom) : 1;
|
|
5319
|
-
const normalizedLeft =
|
|
5320
|
-
const normalizedRight =
|
|
5321
|
-
const normalizedTop =
|
|
5322
|
-
const normalizedBottom =
|
|
5319
|
+
const normalizedLeft = chunkI5SO5OV4_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
5320
|
+
const normalizedRight = chunkI5SO5OV4_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
5321
|
+
const normalizedTop = chunkI5SO5OV4_js.clampCropValue(cropTop * safeVerticalScale);
|
|
5322
|
+
const normalizedBottom = chunkI5SO5OV4_js.clampCropValue(cropBottom * safeVerticalScale);
|
|
5323
5323
|
const remainingWidth = Math.max(0.01, 1 - normalizedLeft - normalizedRight);
|
|
5324
5324
|
const remainingHeight = Math.max(0.01, 1 - normalizedTop - normalizedBottom);
|
|
5325
5325
|
const tx = Math.round(-normalizedLeft / remainingWidth * 1e4) / 100;
|
|
@@ -5348,7 +5348,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
5348
5348
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
5349
5349
|
};
|
|
5350
5350
|
function getCropShapeClipPath(element) {
|
|
5351
|
-
if (!
|
|
5351
|
+
if (!chunkKV3EOLP3_js.isImageLikeElement(element)) {
|
|
5352
5352
|
return void 0;
|
|
5353
5353
|
}
|
|
5354
5354
|
const shape = element.cropShape;
|
|
@@ -5358,7 +5358,7 @@ function getCropShapeClipPath(element) {
|
|
|
5358
5358
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
5359
5359
|
}
|
|
5360
5360
|
function isImageTiled(element) {
|
|
5361
|
-
if (!
|
|
5361
|
+
if (!chunkKV3EOLP3_js.isImageLikeElement(element)) {
|
|
5362
5362
|
return false;
|
|
5363
5363
|
}
|
|
5364
5364
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -5388,7 +5388,7 @@ function tileAlignmentToCssPosition(alignment) {
|
|
|
5388
5388
|
}
|
|
5389
5389
|
}
|
|
5390
5390
|
function getImageTilingStyle(element) {
|
|
5391
|
-
if (!
|
|
5391
|
+
if (!chunkKV3EOLP3_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
5392
5392
|
return void 0;
|
|
5393
5393
|
}
|
|
5394
5394
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -5459,9 +5459,9 @@ function parseGradientFillCss(gradFill) {
|
|
|
5459
5459
|
}
|
|
5460
5460
|
const parsed = stops.map((gs) => {
|
|
5461
5461
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
5462
|
-
const color =
|
|
5463
|
-
const opacity =
|
|
5464
|
-
return { pos, color:
|
|
5462
|
+
const color = chunkI5SO5OV4_js.parseDrawingColor(gs) ?? "#888888";
|
|
5463
|
+
const opacity = chunkI5SO5OV4_js.parseDrawingColorOpacity(gs);
|
|
5464
|
+
return { pos, color: chunkI5SO5OV4_js.colorWithOpacity(color, opacity) };
|
|
5465
5465
|
}).sort((a, b) => a.pos - b.pos);
|
|
5466
5466
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
5467
5467
|
const lin = gradFill["a:lin"];
|
|
@@ -5502,8 +5502,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
5502
5502
|
if (!pattFill) {
|
|
5503
5503
|
return void 0;
|
|
5504
5504
|
}
|
|
5505
|
-
const fgColor =
|
|
5506
|
-
const bgColor =
|
|
5505
|
+
const fgColor = chunkI5SO5OV4_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
5506
|
+
const bgColor = chunkI5SO5OV4_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
5507
5507
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
5508
5508
|
switch (preset) {
|
|
5509
5509
|
case "ltHorz":
|
|
@@ -5614,11 +5614,11 @@ function parseCellBorders(cellProperties) {
|
|
|
5614
5614
|
const prstDash = ln["a:prstDash"];
|
|
5615
5615
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
5616
5616
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
5617
|
-
const color =
|
|
5617
|
+
const color = chunkI5SO5OV4_js.parseDrawingColor(ln["a:solidFill"]);
|
|
5618
5618
|
if (color) {
|
|
5619
|
-
const opacity =
|
|
5619
|
+
const opacity = chunkI5SO5OV4_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
5620
5620
|
const key = `${edge.prefix}`;
|
|
5621
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
5621
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkI5SO5OV4_js.colorWithOpacity(color, opacity)}`;
|
|
5622
5622
|
}
|
|
5623
5623
|
}
|
|
5624
5624
|
return borderStyle;
|
|
@@ -5631,7 +5631,7 @@ function parseCellTextEffects(runProps) {
|
|
|
5631
5631
|
const textShadowParts = [];
|
|
5632
5632
|
const outerShdw = effectLst["a:outerShdw"];
|
|
5633
5633
|
if (outerShdw) {
|
|
5634
|
-
const shdwColor =
|
|
5634
|
+
const shdwColor = chunkI5SO5OV4_js.parseDrawingColor(outerShdw);
|
|
5635
5635
|
if (shdwColor) {
|
|
5636
5636
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
5637
5637
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -5649,7 +5649,7 @@ function parseCellTextEffects(runProps) {
|
|
|
5649
5649
|
}
|
|
5650
5650
|
const glow = effectLst["a:glow"];
|
|
5651
5651
|
if (glow) {
|
|
5652
|
-
const glowColor =
|
|
5652
|
+
const glowColor = chunkI5SO5OV4_js.parseDrawingColor(glow);
|
|
5653
5653
|
if (glowColor) {
|
|
5654
5654
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
5655
5655
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -5728,10 +5728,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5728
5728
|
if (runProps?.["@_u"] !== void 0) {
|
|
5729
5729
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
5730
5730
|
}
|
|
5731
|
-
const runColor =
|
|
5731
|
+
const runColor = chunkI5SO5OV4_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkI5SO5OV4_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
5732
5732
|
if (runColor) {
|
|
5733
|
-
const opacity =
|
|
5734
|
-
cellStyle.color =
|
|
5733
|
+
const opacity = chunkI5SO5OV4_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
5734
|
+
cellStyle.color = chunkI5SO5OV4_js.colorWithOpacity(runColor, opacity);
|
|
5735
5735
|
}
|
|
5736
5736
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
5737
5737
|
if (fontFamily) {
|
|
@@ -5741,15 +5741,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5741
5741
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
5742
5742
|
}
|
|
5743
5743
|
const cellProperties = cellXml["a:tcPr"];
|
|
5744
|
-
const cellFill =
|
|
5744
|
+
const cellFill = chunkI5SO5OV4_js.parseDrawingColor(
|
|
5745
5745
|
cellProperties?.["a:solidFill"],
|
|
5746
5746
|
schemeColorOverrides
|
|
5747
5747
|
);
|
|
5748
5748
|
if (cellFill) {
|
|
5749
|
-
const opacity =
|
|
5749
|
+
const opacity = chunkI5SO5OV4_js.parseDrawingColorOpacity(
|
|
5750
5750
|
cellProperties?.["a:solidFill"]
|
|
5751
5751
|
);
|
|
5752
|
-
cellStyle.backgroundColor =
|
|
5752
|
+
cellStyle.backgroundColor = chunkI5SO5OV4_js.colorWithOpacity(cellFill, opacity);
|
|
5753
5753
|
} else {
|
|
5754
5754
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
5755
5755
|
if (gradCss) {
|
|
@@ -5764,16 +5764,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5764
5764
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
5765
5765
|
Object.assign(cellStyle, edgeBorders);
|
|
5766
5766
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
5767
|
-
const borderColor =
|
|
5767
|
+
const borderColor = chunkI5SO5OV4_js.parseDrawingColor(
|
|
5768
5768
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
5769
5769
|
schemeColorOverrides
|
|
5770
|
-
) ||
|
|
5770
|
+
) || chunkI5SO5OV4_js.parseDrawingColor(
|
|
5771
5771
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
5772
5772
|
schemeColorOverrides
|
|
5773
|
-
) ||
|
|
5773
|
+
) || chunkI5SO5OV4_js.parseDrawingColor(
|
|
5774
5774
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
5775
5775
|
schemeColorOverrides
|
|
5776
|
-
) ||
|
|
5776
|
+
) || chunkI5SO5OV4_js.parseDrawingColor(
|
|
5777
5777
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
5778
5778
|
schemeColorOverrides
|
|
5779
5779
|
);
|
|
@@ -5852,10 +5852,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
5852
5852
|
}
|
|
5853
5853
|
let color = base;
|
|
5854
5854
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
5855
|
-
color =
|
|
5855
|
+
color = chunkI5SO5OV4_js.tintColor2(color, fill.tint / 1e5);
|
|
5856
5856
|
}
|
|
5857
5857
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
5858
|
-
color =
|
|
5858
|
+
color = chunkI5SO5OV4_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
5859
5859
|
}
|
|
5860
5860
|
return color;
|
|
5861
5861
|
}
|
|
@@ -5877,10 +5877,10 @@ function applyTableStyleText(text, colorScheme, style) {
|
|
|
5877
5877
|
if (base) {
|
|
5878
5878
|
let color = base;
|
|
5879
5879
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
5880
|
-
color =
|
|
5880
|
+
color = chunkI5SO5OV4_js.tintColor2(color, text.fontTint / 1e5);
|
|
5881
5881
|
}
|
|
5882
5882
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
5883
|
-
color =
|
|
5883
|
+
color = chunkI5SO5OV4_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
5884
5884
|
}
|
|
5885
5885
|
style.color = color;
|
|
5886
5886
|
applied = true;
|
|
@@ -6162,9 +6162,9 @@ function cellStyleToCss(style) {
|
|
|
6162
6162
|
if (style.gradientFillCss) {
|
|
6163
6163
|
css.background = style.gradientFillCss;
|
|
6164
6164
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
6165
|
-
const fg =
|
|
6166
|
-
const bg =
|
|
6167
|
-
const svgPattern =
|
|
6165
|
+
const fg = chunkI5SO5OV4_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
6166
|
+
const bg = chunkI5SO5OV4_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
6167
|
+
const svgPattern = chunkI5SO5OV4_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
6168
6168
|
if (svgPattern) {
|
|
6169
6169
|
const encoded = encodeURIComponent(svgPattern);
|
|
6170
6170
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -6233,7 +6233,7 @@ function cellStyleToCss(style) {
|
|
|
6233
6233
|
if (edge.width || edge.color) {
|
|
6234
6234
|
const w = edge.width ?? 1;
|
|
6235
6235
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
6236
|
-
const s =
|
|
6236
|
+
const s = chunkI5SO5OV4_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
6237
6237
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
6238
6238
|
}
|
|
6239
6239
|
}
|
|
@@ -6275,7 +6275,7 @@ function TableResizeOverlay({
|
|
|
6275
6275
|
const containerRef = React3.useRef(null);
|
|
6276
6276
|
const [rowBounds, setRowBounds] = React3.useState([]);
|
|
6277
6277
|
const dragRef = React3.useRef(null);
|
|
6278
|
-
const colBoundaries = React3.useMemo(() =>
|
|
6278
|
+
const colBoundaries = React3.useMemo(() => chunkI5SO5OV4_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
6279
6279
|
const measureRows = React3.useCallback(() => {
|
|
6280
6280
|
const container = containerRef.current;
|
|
6281
6281
|
if (!container) {
|
|
@@ -6322,11 +6322,11 @@ function TableResizeOverlay({
|
|
|
6322
6322
|
const rect = containerRef.current.getBoundingClientRect();
|
|
6323
6323
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
6324
6324
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
6325
|
-
onResizeColumns(
|
|
6325
|
+
onResizeColumns(chunkI5SO5OV4_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
6326
6326
|
} else if (drag.type === "row" && onResizeRow) {
|
|
6327
6327
|
const deltaY = e.clientY - drag.startPos;
|
|
6328
|
-
const newHeight =
|
|
6329
|
-
drag.initialRowHeight ??
|
|
6328
|
+
const newHeight = chunkI5SO5OV4_js.computeResizedRowHeight(
|
|
6329
|
+
drag.initialRowHeight ?? chunkI5SO5OV4_js.DEFAULT_ROW_HEIGHT,
|
|
6330
6330
|
deltaY
|
|
6331
6331
|
);
|
|
6332
6332
|
onResizeRow(drag.index, newHeight);
|
|
@@ -6364,7 +6364,7 @@ function TableResizeOverlay({
|
|
|
6364
6364
|
e.stopPropagation();
|
|
6365
6365
|
const table = containerRef.current?.querySelector("table");
|
|
6366
6366
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
6367
|
-
const actualHeight = tr?.offsetHeight ??
|
|
6367
|
+
const actualHeight = tr?.offsetHeight ?? chunkI5SO5OV4_js.DEFAULT_ROW_HEIGHT;
|
|
6368
6368
|
document.body.style.cursor = "row-resize";
|
|
6369
6369
|
document.body.style.userSelect = "none";
|
|
6370
6370
|
dragRef.current = {
|
|
@@ -6410,7 +6410,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6410
6410
|
}
|
|
6411
6411
|
const first = selectedCell.selectedCells[0];
|
|
6412
6412
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
6413
|
-
return
|
|
6413
|
+
return chunkI5SO5OV4_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
6414
6414
|
})();
|
|
6415
6415
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6416
6416
|
TableResizeOverlay,
|
|
@@ -6443,7 +6443,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6443
6443
|
return null;
|
|
6444
6444
|
}
|
|
6445
6445
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
6446
|
-
const isInMultiSelection =
|
|
6446
|
+
const isInMultiSelection = chunkI5SO5OV4_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
6447
6447
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
6448
6448
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6449
6449
|
"td",
|
|
@@ -6466,7 +6466,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6466
6466
|
}
|
|
6467
6467
|
event.stopPropagation();
|
|
6468
6468
|
if (event.shiftKey && selectedCell) {
|
|
6469
|
-
const rect =
|
|
6469
|
+
const rect = chunkI5SO5OV4_js.computeSelectionRect(
|
|
6470
6470
|
selectedCell.rowIndex,
|
|
6471
6471
|
selectedCell.columnIndex,
|
|
6472
6472
|
rowIndex,
|
|
@@ -6476,7 +6476,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6476
6476
|
options?.onSelectCell?.({
|
|
6477
6477
|
rowIndex: selectedCell.rowIndex,
|
|
6478
6478
|
columnIndex: selectedCell.columnIndex,
|
|
6479
|
-
selectedCells:
|
|
6479
|
+
selectedCells: chunkI5SO5OV4_js.rectToCells(rect)
|
|
6480
6480
|
});
|
|
6481
6481
|
} else {
|
|
6482
6482
|
options?.onSelectCell?.({
|
|
@@ -6550,7 +6550,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6550
6550
|
}
|
|
6551
6551
|
const first = selectedCell.selectedCells[0];
|
|
6552
6552
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
6553
|
-
return
|
|
6553
|
+
return chunkI5SO5OV4_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
6554
6554
|
})();
|
|
6555
6555
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
6556
6556
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6615,7 +6615,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6615
6615
|
"border px-1 py-0.5 align-top",
|
|
6616
6616
|
isEditable2 && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
6617
6617
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
6618
|
-
|
|
6618
|
+
chunkI5SO5OV4_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
6619
6619
|
),
|
|
6620
6620
|
colSpan,
|
|
6621
6621
|
rowSpan: rSpan,
|
|
@@ -6626,7 +6626,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6626
6626
|
}
|
|
6627
6627
|
event.stopPropagation();
|
|
6628
6628
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
6629
|
-
const rect =
|
|
6629
|
+
const rect = chunkI5SO5OV4_js.computeSelectionRect(
|
|
6630
6630
|
selectedCell.rowIndex,
|
|
6631
6631
|
selectedCell.columnIndex,
|
|
6632
6632
|
rowIndex,
|
|
@@ -6636,7 +6636,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6636
6636
|
options?.onSelectCell?.({
|
|
6637
6637
|
rowIndex: selectedCell.rowIndex,
|
|
6638
6638
|
columnIndex: selectedCell.columnIndex,
|
|
6639
|
-
selectedCells:
|
|
6639
|
+
selectedCells: chunkI5SO5OV4_js.rectToCells(rect)
|
|
6640
6640
|
});
|
|
6641
6641
|
} else {
|
|
6642
6642
|
options?.onSelectCell?.({
|
|
@@ -6688,24 +6688,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6688
6688
|
}
|
|
6689
6689
|
var LEGEND_ITEM_WIDTH = 80;
|
|
6690
6690
|
function partAttrs(part) {
|
|
6691
|
-
return part ?
|
|
6691
|
+
return part ? chunkI5SO5OV4_js.chartPartToAttrs(part) : void 0;
|
|
6692
6692
|
}
|
|
6693
6693
|
function resolveReactPalette(chartData) {
|
|
6694
6694
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
6695
6695
|
return chartData.colorPalette;
|
|
6696
6696
|
}
|
|
6697
|
-
return [...
|
|
6697
|
+
return [...chunkI5SO5OV4_js.getChartStylePalette(chartData.style?.styleId)];
|
|
6698
6698
|
}
|
|
6699
6699
|
function buildReactChartViewModel(element) {
|
|
6700
6700
|
if (element.type !== "chart" || !element.chartData) {
|
|
6701
|
-
return
|
|
6701
|
+
return chunkI5SO5OV4_js.buildChartViewModel(element);
|
|
6702
6702
|
}
|
|
6703
6703
|
const palette = resolveReactPalette(element.chartData);
|
|
6704
6704
|
const themedElement = {
|
|
6705
6705
|
...element,
|
|
6706
6706
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
6707
6707
|
};
|
|
6708
|
-
return
|
|
6708
|
+
return chunkI5SO5OV4_js.buildChartViewModel(themedElement);
|
|
6709
6709
|
}
|
|
6710
6710
|
function renderPrimitive(prim, key) {
|
|
6711
6711
|
switch (prim.kind) {
|
|
@@ -7094,7 +7094,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7094
7094
|
const unmatchedRows = [];
|
|
7095
7095
|
categories.forEach((cat, i) => {
|
|
7096
7096
|
const value = values[i] ?? 0;
|
|
7097
|
-
const code =
|
|
7097
|
+
const code = chunkI5SO5OV4_js.resolveRegionCode(cat);
|
|
7098
7098
|
if (code) {
|
|
7099
7099
|
regionValueMap.set(code, { value, label: cat });
|
|
7100
7100
|
} else {
|
|
@@ -7132,8 +7132,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7132
7132
|
let fill = "#e2e8f0";
|
|
7133
7133
|
let dataLabel = null;
|
|
7134
7134
|
if (entry) {
|
|
7135
|
-
const t =
|
|
7136
|
-
fill =
|
|
7135
|
+
const t = chunkI5SO5OV4_js.normalizeValue(entry.value, minVal, maxVal);
|
|
7136
|
+
fill = chunkI5SO5OV4_js.sequentialColorScale(t);
|
|
7137
7137
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
7138
7138
|
"text",
|
|
7139
7139
|
{
|
|
@@ -7144,7 +7144,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7144
7144
|
fontWeight: 600,
|
|
7145
7145
|
fill: "#1e293b",
|
|
7146
7146
|
style: { pointerEvents: "none" },
|
|
7147
|
-
children:
|
|
7147
|
+
children: chunkI5SO5OV4_js.formatAxisValue(entry.value)
|
|
7148
7148
|
},
|
|
7149
7149
|
`${element.id}-map-dl-${region.code}`
|
|
7150
7150
|
);
|
|
@@ -7162,7 +7162,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7162
7162
|
opacity: 0.9,
|
|
7163
7163
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
7164
7164
|
region.name,
|
|
7165
|
-
entry ? `: ${
|
|
7165
|
+
entry ? `: ${chunkI5SO5OV4_js.formatAxisValue(entry.value)}` : ""
|
|
7166
7166
|
] })
|
|
7167
7167
|
}
|
|
7168
7168
|
),
|
|
@@ -7200,7 +7200,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7200
7200
|
fontSize: 7,
|
|
7201
7201
|
fill: "#64748b",
|
|
7202
7202
|
textAnchor: "middle",
|
|
7203
|
-
children:
|
|
7203
|
+
children: chunkI5SO5OV4_js.formatAxisValue(minVal)
|
|
7204
7204
|
},
|
|
7205
7205
|
`${element.id}-map-legend-min`
|
|
7206
7206
|
),
|
|
@@ -7212,7 +7212,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7212
7212
|
fontSize: 7,
|
|
7213
7213
|
fill: "#64748b",
|
|
7214
7214
|
textAnchor: "middle",
|
|
7215
|
-
children:
|
|
7215
|
+
children: chunkI5SO5OV4_js.formatAxisValue(maxVal)
|
|
7216
7216
|
},
|
|
7217
7217
|
`${element.id}-map-legend-max`
|
|
7218
7218
|
)
|
|
@@ -7278,7 +7278,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7278
7278
|
y,
|
|
7279
7279
|
fontSize,
|
|
7280
7280
|
fill: "#475569",
|
|
7281
|
-
children:
|
|
7281
|
+
children: chunkI5SO5OV4_js.formatAxisValue(row.value)
|
|
7282
7282
|
},
|
|
7283
7283
|
`${element.id}-map-ft-val-${i}`
|
|
7284
7284
|
)
|
|
@@ -7349,7 +7349,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
7349
7349
|
|
|
7350
7350
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
7351
7351
|
function sColor(series, idx) {
|
|
7352
|
-
return
|
|
7352
|
+
return chunkI5SO5OV4_js.seriesColor(series, idx);
|
|
7353
7353
|
}
|
|
7354
7354
|
function valToY(val, range, topY, bottomY) {
|
|
7355
7355
|
const usable = bottomY - topY;
|
|
@@ -7844,7 +7844,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
7844
7844
|
width: 10,
|
|
7845
7845
|
height: 10,
|
|
7846
7846
|
rx: 2,
|
|
7847
|
-
fill:
|
|
7847
|
+
fill: chunkI5SO5OV4_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
7848
7848
|
},
|
|
7849
7849
|
`${id}-leg-r-${i}`
|
|
7850
7850
|
)
|
|
@@ -7868,7 +7868,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
7868
7868
|
width: 10,
|
|
7869
7869
|
height: 10,
|
|
7870
7870
|
rx: 2,
|
|
7871
|
-
fill:
|
|
7871
|
+
fill: chunkI5SO5OV4_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
7872
7872
|
}
|
|
7873
7873
|
),
|
|
7874
7874
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -7881,9 +7881,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
7881
7881
|
}
|
|
7882
7882
|
const lines = [];
|
|
7883
7883
|
if (range.logScale && range.logBase) {
|
|
7884
|
-
const ticks =
|
|
7884
|
+
const ticks = chunkI5SO5OV4_js.generateLogTicks(range);
|
|
7885
7885
|
ticks.forEach((tickVal, i) => {
|
|
7886
|
-
const y =
|
|
7886
|
+
const y = chunkI5SO5OV4_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
7887
7887
|
lines.push(
|
|
7888
7888
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7889
7889
|
"line",
|
|
@@ -7904,7 +7904,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
7904
7904
|
const steps = 4;
|
|
7905
7905
|
for (let i = 0; i <= steps; i++) {
|
|
7906
7906
|
const val = range.min + range.span * i / steps;
|
|
7907
|
-
const y =
|
|
7907
|
+
const y = chunkI5SO5OV4_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
7908
7908
|
lines.push(
|
|
7909
7909
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7910
7910
|
"line",
|
|
@@ -7928,9 +7928,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7928
7928
|
const labels = [];
|
|
7929
7929
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
7930
7930
|
if (range.logScale && range.logBase) {
|
|
7931
|
-
const ticks =
|
|
7931
|
+
const ticks = chunkI5SO5OV4_js.generateLogTicks(range);
|
|
7932
7932
|
ticks.forEach((tickVal, i) => {
|
|
7933
|
-
const y =
|
|
7933
|
+
const y = chunkI5SO5OV4_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
7934
7934
|
labels.push(
|
|
7935
7935
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7936
7936
|
"text",
|
|
@@ -7940,7 +7940,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7940
7940
|
textAnchor: "end",
|
|
7941
7941
|
fontSize: 8,
|
|
7942
7942
|
fill: "#64748b",
|
|
7943
|
-
children: hasDisplayUnits ?
|
|
7943
|
+
children: hasDisplayUnits ? chunkI5SO5OV4_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkI5SO5OV4_js.formatAxisValue(tickVal)
|
|
7944
7944
|
},
|
|
7945
7945
|
`${id}-vaxis-log-${i}`
|
|
7946
7946
|
)
|
|
@@ -7950,7 +7950,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7950
7950
|
const steps = 4;
|
|
7951
7951
|
for (let i = 0; i <= steps; i++) {
|
|
7952
7952
|
const val = range.min + range.span * i / steps;
|
|
7953
|
-
const y =
|
|
7953
|
+
const y = chunkI5SO5OV4_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
7954
7954
|
labels.push(
|
|
7955
7955
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7956
7956
|
"text",
|
|
@@ -7960,7 +7960,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7960
7960
|
textAnchor: "end",
|
|
7961
7961
|
fontSize: 8,
|
|
7962
7962
|
fill: "#64748b",
|
|
7963
|
-
children: hasDisplayUnits ?
|
|
7963
|
+
children: hasDisplayUnits ? chunkI5SO5OV4_js.formatAxisValueWithUnits(val, axisFormatting) : chunkI5SO5OV4_js.formatAxisValue(val)
|
|
7964
7964
|
},
|
|
7965
7965
|
`${id}-vaxis-${i}`
|
|
7966
7966
|
)
|
|
@@ -7968,7 +7968,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7968
7968
|
}
|
|
7969
7969
|
}
|
|
7970
7970
|
if (hasDisplayUnits) {
|
|
7971
|
-
const unitLabel =
|
|
7971
|
+
const unitLabel = chunkI5SO5OV4_js.getDisplayUnitLabel(
|
|
7972
7972
|
axisFormatting.displayUnits,
|
|
7973
7973
|
axisFormatting.displayUnitsLabel
|
|
7974
7974
|
);
|
|
@@ -8043,7 +8043,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
8043
8043
|
if (range.min >= 0) {
|
|
8044
8044
|
return null;
|
|
8045
8045
|
}
|
|
8046
|
-
const y =
|
|
8046
|
+
const y = chunkI5SO5OV4_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
8047
8047
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8048
8048
|
"line",
|
|
8049
8049
|
{
|
|
@@ -8067,7 +8067,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8067
8067
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
8068
8068
|
for (let i = 0; i <= steps; i++) {
|
|
8069
8069
|
const val = range.min + range.span * i / steps;
|
|
8070
|
-
const y =
|
|
8070
|
+
const y = chunkI5SO5OV4_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8071
8071
|
labels.push(
|
|
8072
8072
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8073
8073
|
"text",
|
|
@@ -8079,7 +8079,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8079
8079
|
fontFamily,
|
|
8080
8080
|
fontWeight,
|
|
8081
8081
|
fill: fontColor,
|
|
8082
|
-
children: hasDisplayUnits ?
|
|
8082
|
+
children: hasDisplayUnits ? chunkI5SO5OV4_js.formatAxisValueWithUnits(val, axisFormatting) : chunkI5SO5OV4_js.formatAxisValue(val)
|
|
8083
8083
|
},
|
|
8084
8084
|
`${id}-sec-vaxis-${i}`
|
|
8085
8085
|
)
|
|
@@ -8103,7 +8103,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8103
8103
|
);
|
|
8104
8104
|
}
|
|
8105
8105
|
if (hasDisplayUnits) {
|
|
8106
|
-
const unitLabel =
|
|
8106
|
+
const unitLabel = chunkI5SO5OV4_js.getDisplayUnitLabel(
|
|
8107
8107
|
axisFormatting.displayUnits,
|
|
8108
8108
|
axisFormatting.displayUnitsLabel
|
|
8109
8109
|
);
|
|
@@ -8134,7 +8134,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
8134
8134
|
const ticks = [];
|
|
8135
8135
|
for (let i = 0; i <= steps; i++) {
|
|
8136
8136
|
const val = range.min + range.span * i / steps;
|
|
8137
|
-
const y =
|
|
8137
|
+
const y = chunkI5SO5OV4_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8138
8138
|
ticks.push(
|
|
8139
8139
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8140
8140
|
"line",
|
|
@@ -8161,7 +8161,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
8161
8161
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
8162
8162
|
for (let i = 0; i <= steps; i++) {
|
|
8163
8163
|
const val = range.min + range.span * i / steps;
|
|
8164
|
-
const y =
|
|
8164
|
+
const y = chunkI5SO5OV4_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8165
8165
|
lines.push(
|
|
8166
8166
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8167
8167
|
"line",
|
|
@@ -8322,7 +8322,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
8322
8322
|
width: 8,
|
|
8323
8323
|
height: 8,
|
|
8324
8324
|
borderRadius: 2,
|
|
8325
|
-
backgroundColor:
|
|
8325
|
+
backgroundColor: chunkI5SO5OV4_js.seriesColor(
|
|
8326
8326
|
s,
|
|
8327
8327
|
si,
|
|
8328
8328
|
chartData.style?.styleId,
|
|
@@ -8361,8 +8361,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
8361
8361
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
8362
8362
|
const style = chartData.style;
|
|
8363
8363
|
const legendPos = style?.legendPosition || "b";
|
|
8364
|
-
const range =
|
|
8365
|
-
const layout =
|
|
8364
|
+
const range = chunkI5SO5OV4_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8365
|
+
const layout = chunkI5SO5OV4_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8366
8366
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8367
8367
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
8368
8368
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -8383,10 +8383,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
8383
8383
|
const close = closeSeries.values[ci] ?? high;
|
|
8384
8384
|
const isUp = close >= open;
|
|
8385
8385
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
8386
|
-
const highY =
|
|
8387
|
-
const lowY =
|
|
8388
|
-
const openY =
|
|
8389
|
-
const closeY =
|
|
8386
|
+
const highY = chunkI5SO5OV4_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
8387
|
+
const lowY = chunkI5SO5OV4_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
8388
|
+
const openY = chunkI5SO5OV4_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
8389
|
+
const closeY = chunkI5SO5OV4_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
8390
8390
|
elements.push(
|
|
8391
8391
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8392
8392
|
"line",
|
|
@@ -8429,7 +8429,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
8429
8429
|
textAnchor: "middle",
|
|
8430
8430
|
fontSize: 7,
|
|
8431
8431
|
fill: "#334155",
|
|
8432
|
-
children:
|
|
8432
|
+
children: chunkI5SO5OV4_js.formatAxisValue(close)
|
|
8433
8433
|
},
|
|
8434
8434
|
`${element.id}-stock-dl-${ci}`
|
|
8435
8435
|
)
|
|
@@ -8471,7 +8471,7 @@ function FailedToLoad() {
|
|
|
8471
8471
|
var LazySurfaceChart3DScene = React3__default.default.lazy(
|
|
8472
8472
|
async () => {
|
|
8473
8473
|
try {
|
|
8474
|
-
return await import('./SurfaceChart3DScene-
|
|
8474
|
+
return await import('./SurfaceChart3DScene-YR3GX4X6.js');
|
|
8475
8475
|
} catch {
|
|
8476
8476
|
return { default: FailedToLoad };
|
|
8477
8477
|
}
|
|
@@ -8495,7 +8495,7 @@ var SurfaceChart3DErrorBoundary = class extends React3__default.default.Componen
|
|
|
8495
8495
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
8496
8496
|
const rows = chartData.series.length;
|
|
8497
8497
|
const cols = Math.max(categoryLabels.length, 1);
|
|
8498
|
-
const range =
|
|
8498
|
+
const range = chunkI5SO5OV4_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8499
8499
|
const heightMap = new Float32Array(rows * cols);
|
|
8500
8500
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
8501
8501
|
for (let r = 0; r < rows; r++) {
|
|
@@ -8615,8 +8615,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
8615
8615
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
8616
8616
|
const style = chartData.style;
|
|
8617
8617
|
const legendPos = style?.legendPosition || "b";
|
|
8618
|
-
const layout =
|
|
8619
|
-
const range =
|
|
8618
|
+
const layout = chunkI5SO5OV4_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
8619
|
+
const range = chunkI5SO5OV4_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8620
8620
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8621
8621
|
const seriesCount = chartData.series.length;
|
|
8622
8622
|
const cols = catCount - 1;
|
|
@@ -8706,8 +8706,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
8706
8706
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
8707
8707
|
const style = chartData.style;
|
|
8708
8708
|
const legendPos = style?.legendPosition || "b";
|
|
8709
|
-
const layout =
|
|
8710
|
-
const range =
|
|
8709
|
+
const layout = chunkI5SO5OV4_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8710
|
+
const range = chunkI5SO5OV4_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8711
8711
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8712
8712
|
const seriesCount = chartData.series.length;
|
|
8713
8713
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -8770,7 +8770,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
8770
8770
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
8771
8771
|
const style = chartData.style;
|
|
8772
8772
|
const legendPos = style?.legendPosition || "b";
|
|
8773
|
-
const layout =
|
|
8773
|
+
const layout = chunkI5SO5OV4_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
8774
8774
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
8775
8775
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
8776
8776
|
const rects = [];
|
|
@@ -8793,7 +8793,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
8793
8793
|
y: curY,
|
|
8794
8794
|
width: Math.max(w - 1, 1),
|
|
8795
8795
|
height: Math.max(h - 1, 1),
|
|
8796
|
-
fill:
|
|
8796
|
+
fill: chunkI5SO5OV4_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
8797
8797
|
rx: 2,
|
|
8798
8798
|
opacity: 0.85
|
|
8799
8799
|
},
|
|
@@ -8846,8 +8846,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8846
8846
|
const style = chartData.style;
|
|
8847
8847
|
const legendPos = style?.legendPosition || "b";
|
|
8848
8848
|
const values = chartData.series[0]?.values ?? [];
|
|
8849
|
-
const range =
|
|
8850
|
-
const layout =
|
|
8849
|
+
const range = chunkI5SO5OV4_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8850
|
+
const layout = chunkI5SO5OV4_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8851
8851
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
8852
8852
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
8853
8853
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -8858,8 +8858,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8858
8858
|
const isLast = i === values.length - 1;
|
|
8859
8859
|
const startVal = isLast ? 0 : runningTotal;
|
|
8860
8860
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
8861
|
-
const barStartY =
|
|
8862
|
-
const barEndY =
|
|
8861
|
+
const barStartY = chunkI5SO5OV4_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
8862
|
+
const barEndY = chunkI5SO5OV4_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
8863
8863
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
8864
8864
|
const y = Math.min(barStartY, barEndY);
|
|
8865
8865
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -8888,7 +8888,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8888
8888
|
textAnchor: "middle",
|
|
8889
8889
|
fontSize: 7,
|
|
8890
8890
|
fill: "#334155",
|
|
8891
|
-
children:
|
|
8891
|
+
children: chunkI5SO5OV4_js.formatAxisValue(isLast ? endVal : val)
|
|
8892
8892
|
},
|
|
8893
8893
|
`${element.id}-wf-dl-${i}`
|
|
8894
8894
|
)
|
|
@@ -8936,18 +8936,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8936
8936
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
8937
8937
|
const style = chartData.style;
|
|
8938
8938
|
const legendPos = style?.legendPosition || "b";
|
|
8939
|
-
const layoutOpts =
|
|
8939
|
+
const layoutOpts = chunkI5SO5OV4_js.computeLayoutOptions(
|
|
8940
8940
|
chartData.axes,
|
|
8941
8941
|
chartData.dataTable,
|
|
8942
8942
|
chartData.series.length
|
|
8943
8943
|
);
|
|
8944
|
-
const layout =
|
|
8945
|
-
const { primary, secondary } =
|
|
8944
|
+
const layout = chunkI5SO5OV4_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
8945
|
+
const { primary, secondary } = chunkI5SO5OV4_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
8946
8946
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
8947
8947
|
const secondarySeries = secondary.map((e) => e.series);
|
|
8948
|
-
const range =
|
|
8949
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
8950
|
-
const secondaryAxisFmt =
|
|
8948
|
+
const range = chunkI5SO5OV4_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
8949
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkI5SO5OV4_js.computeValueRange(secondarySeries) : void 0;
|
|
8950
|
+
const secondaryAxisFmt = chunkI5SO5OV4_js.getSecondaryValueAxis(chartData.axes);
|
|
8951
8951
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8952
8952
|
const barSeriesCount = 1;
|
|
8953
8953
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -8963,8 +8963,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
8963
8963
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
8964
8964
|
barSeries.values.forEach((val, vi) => {
|
|
8965
8965
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
8966
|
-
const zeroY =
|
|
8967
|
-
const valY =
|
|
8966
|
+
const zeroY = chunkI5SO5OV4_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
8967
|
+
const valY = chunkI5SO5OV4_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
8968
8968
|
const y = Math.min(zeroY, valY);
|
|
8969
8969
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
8970
8970
|
barElements.push(
|
|
@@ -8975,7 +8975,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
8975
8975
|
y,
|
|
8976
8976
|
width: barWidth,
|
|
8977
8977
|
height: h,
|
|
8978
|
-
fill:
|
|
8978
|
+
fill: chunkI5SO5OV4_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
8979
8979
|
rx: 1
|
|
8980
8980
|
},
|
|
8981
8981
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -8991,7 +8991,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
8991
8991
|
textAnchor: "middle",
|
|
8992
8992
|
fontSize: 7,
|
|
8993
8993
|
fill: "#334155",
|
|
8994
|
-
children:
|
|
8994
|
+
children: chunkI5SO5OV4_js.formatAxisValue(val)
|
|
8995
8995
|
},
|
|
8996
8996
|
`${element.id}-combo-bar-dl-${vi}`
|
|
8997
8997
|
)
|
|
@@ -9008,10 +9008,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9008
9008
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
9009
9009
|
const points = series.values.map((val, vi) => {
|
|
9010
9010
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
9011
|
-
const y =
|
|
9011
|
+
const y = chunkI5SO5OV4_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
9012
9012
|
return { x, y, val };
|
|
9013
9013
|
});
|
|
9014
|
-
const c =
|
|
9014
|
+
const c = chunkI5SO5OV4_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
9015
9015
|
lineElements.push(
|
|
9016
9016
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9017
9017
|
"polyline",
|
|
@@ -9038,7 +9038,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9038
9038
|
textAnchor: "middle",
|
|
9039
9039
|
fontSize: 7,
|
|
9040
9040
|
fill: "#334155",
|
|
9041
|
-
children:
|
|
9041
|
+
children: chunkI5SO5OV4_js.formatAxisValue(p.val)
|
|
9042
9042
|
},
|
|
9043
9043
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
9044
9044
|
)
|
|
@@ -10792,14 +10792,14 @@ function buildNotesPdf(pages) {
|
|
|
10792
10792
|
notes: page.notes,
|
|
10793
10793
|
slideNumber: page.slideNumber
|
|
10794
10794
|
}));
|
|
10795
|
-
const bytes =
|
|
10795
|
+
const bytes = chunkI5SO5OV4_js.buildNotesPdfBytes(images, meta);
|
|
10796
10796
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
10797
10797
|
return URL.createObjectURL(blob);
|
|
10798
10798
|
}
|
|
10799
10799
|
|
|
10800
10800
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
10801
10801
|
function buildPdfFromImageData(images) {
|
|
10802
|
-
const bytes =
|
|
10802
|
+
const bytes = chunkI5SO5OV4_js.buildSlidesPdfBytes(images);
|
|
10803
10803
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
10804
10804
|
return URL.createObjectURL(blob);
|
|
10805
10805
|
}
|
|
@@ -10808,7 +10808,7 @@ function buildPdfFromImageData(images) {
|
|
|
10808
10808
|
var activePreview = null;
|
|
10809
10809
|
function startPreviewAnimation(elementId, preset, options) {
|
|
10810
10810
|
stopPreviewAnimation();
|
|
10811
|
-
const descriptor =
|
|
10811
|
+
const descriptor = chunkI5SO5OV4_js.buildPreviewAnimation(preset, options);
|
|
10812
10812
|
if (!descriptor) {
|
|
10813
10813
|
return;
|
|
10814
10814
|
}
|
|
@@ -10886,7 +10886,7 @@ function useElementOperations(input) {
|
|
|
10886
10886
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
10887
10887
|
const updateElementById = React3.useCallback(
|
|
10888
10888
|
(elementId, updates) => {
|
|
10889
|
-
if (
|
|
10889
|
+
if (chunkI5SO5OV4_js.isTemplateElementId(elementId)) {
|
|
10890
10890
|
const slideId = activeSlide?.id;
|
|
10891
10891
|
if (slideId) {
|
|
10892
10892
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -10926,7 +10926,7 @@ function useElementOperations(input) {
|
|
|
10926
10926
|
);
|
|
10927
10927
|
const updateSelectedShapeStyle = React3.useCallback(
|
|
10928
10928
|
(updates) => {
|
|
10929
|
-
if (!selectedElement || !
|
|
10929
|
+
if (!selectedElement || !chunkKV3EOLP3_js.hasShapeProperties(selectedElement)) {
|
|
10930
10930
|
return;
|
|
10931
10931
|
}
|
|
10932
10932
|
updateSelectedElement({
|
|
@@ -10937,17 +10937,17 @@ function useElementOperations(input) {
|
|
|
10937
10937
|
);
|
|
10938
10938
|
const updateSelectedTextStyle = React3.useCallback(
|
|
10939
10939
|
(updates) => {
|
|
10940
|
-
if (!selectedElement || !
|
|
10940
|
+
if (!selectedElement || !chunkKV3EOLP3_js.hasTextProperties(selectedElement)) {
|
|
10941
10941
|
return;
|
|
10942
10942
|
}
|
|
10943
|
-
const inlineSel =
|
|
10943
|
+
const inlineSel = chunkI5SO5OV4_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
10944
10944
|
if (inlineSel && selectedElement.textSegments) {
|
|
10945
|
-
const { newSegments: newSegments2, newSelection } =
|
|
10945
|
+
const { newSegments: newSegments2, newSelection } = chunkI5SO5OV4_js.applyStyleToSelectedSegments(
|
|
10946
10946
|
selectedElement.textSegments,
|
|
10947
10947
|
inlineSel,
|
|
10948
10948
|
updates
|
|
10949
10949
|
);
|
|
10950
|
-
|
|
10950
|
+
chunkI5SO5OV4_js.setPendingSelectionRestore(newSelection);
|
|
10951
10951
|
updateSelectedElement({
|
|
10952
10952
|
textSegments: newSegments2
|
|
10953
10953
|
});
|
|
@@ -10967,12 +10967,12 @@ function useElementOperations(input) {
|
|
|
10967
10967
|
);
|
|
10968
10968
|
const updateSelectedTextCase = React3.useCallback(
|
|
10969
10969
|
(mode) => {
|
|
10970
|
-
if (!selectedElement || !
|
|
10970
|
+
if (!selectedElement || !chunkKV3EOLP3_js.hasTextProperties(selectedElement)) {
|
|
10971
10971
|
return;
|
|
10972
10972
|
}
|
|
10973
|
-
const inlineSel =
|
|
10973
|
+
const inlineSel = chunkI5SO5OV4_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
10974
10974
|
if (inlineSel && selectedElement.textSegments) {
|
|
10975
|
-
const newSegments =
|
|
10975
|
+
const newSegments = chunkI5SO5OV4_js.applyCaseTransformToSegments(
|
|
10976
10976
|
selectedElement.textSegments,
|
|
10977
10977
|
inlineSel,
|
|
10978
10978
|
mode
|
|
@@ -10982,14 +10982,14 @@ function useElementOperations(input) {
|
|
|
10982
10982
|
}
|
|
10983
10983
|
const updates = {};
|
|
10984
10984
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
10985
|
-
updates.textSegments =
|
|
10985
|
+
updates.textSegments = chunkI5SO5OV4_js.applyCaseTransformToSegments(
|
|
10986
10986
|
selectedElement.textSegments,
|
|
10987
10987
|
null,
|
|
10988
10988
|
mode
|
|
10989
10989
|
);
|
|
10990
10990
|
}
|
|
10991
10991
|
if (typeof selectedElement.text === "string") {
|
|
10992
|
-
updates.text =
|
|
10992
|
+
updates.text = chunkI5SO5OV4_js.transformTextCase(selectedElement.text, mode);
|
|
10993
10993
|
}
|
|
10994
10994
|
updateSelectedElement(updates);
|
|
10995
10995
|
},
|
|
@@ -11044,7 +11044,7 @@ function useSectionOperations(input) {
|
|
|
11044
11044
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
11045
11045
|
const addSection2 = React3.useCallback(
|
|
11046
11046
|
(name, afterSlideIndex) => {
|
|
11047
|
-
const result =
|
|
11047
|
+
const result = chunkI5SO5OV4_js.addSection(sections, slides, name, afterSlideIndex);
|
|
11048
11048
|
setSlides(result.slides);
|
|
11049
11049
|
setSections(result.sections);
|
|
11050
11050
|
markDirty();
|
|
@@ -11053,7 +11053,7 @@ function useSectionOperations(input) {
|
|
|
11053
11053
|
);
|
|
11054
11054
|
const renameSection2 = React3.useCallback(
|
|
11055
11055
|
(sectionId, newName) => {
|
|
11056
|
-
const result =
|
|
11056
|
+
const result = chunkI5SO5OV4_js.renameSection(sections, slides, sectionId, newName);
|
|
11057
11057
|
setSections(result.sections);
|
|
11058
11058
|
setSlides(result.slides);
|
|
11059
11059
|
markDirty();
|
|
@@ -11062,7 +11062,7 @@ function useSectionOperations(input) {
|
|
|
11062
11062
|
);
|
|
11063
11063
|
const deleteSection2 = React3.useCallback(
|
|
11064
11064
|
(sectionId) => {
|
|
11065
|
-
const result =
|
|
11065
|
+
const result = chunkI5SO5OV4_js.deleteSection(sections, slides, sectionId);
|
|
11066
11066
|
setSections(result.sections);
|
|
11067
11067
|
setSlides(result.slides);
|
|
11068
11068
|
markDirty();
|
|
@@ -11071,21 +11071,21 @@ function useSectionOperations(input) {
|
|
|
11071
11071
|
);
|
|
11072
11072
|
const moveSectionUp2 = React3.useCallback(
|
|
11073
11073
|
(sectionId) => {
|
|
11074
|
-
setSections(
|
|
11074
|
+
setSections(chunkI5SO5OV4_js.moveSectionUp(sections, sectionId));
|
|
11075
11075
|
markDirty();
|
|
11076
11076
|
},
|
|
11077
11077
|
[sections, setSections, markDirty]
|
|
11078
11078
|
);
|
|
11079
11079
|
const moveSectionDown2 = React3.useCallback(
|
|
11080
11080
|
(sectionId) => {
|
|
11081
|
-
setSections(
|
|
11081
|
+
setSections(chunkI5SO5OV4_js.moveSectionDown(sections, sectionId));
|
|
11082
11082
|
markDirty();
|
|
11083
11083
|
},
|
|
11084
11084
|
[sections, setSections, markDirty]
|
|
11085
11085
|
);
|
|
11086
11086
|
const moveSlidesToSection2 = React3.useCallback(
|
|
11087
11087
|
(slideIndexes, targetSectionId) => {
|
|
11088
|
-
const result =
|
|
11088
|
+
const result = chunkI5SO5OV4_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
11089
11089
|
setSlides(result.slides);
|
|
11090
11090
|
setSections(result.sections);
|
|
11091
11091
|
markDirty();
|
|
@@ -11104,7 +11104,7 @@ function useSectionOperations(input) {
|
|
|
11104
11104
|
|
|
11105
11105
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
11106
11106
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
11107
|
-
const resized =
|
|
11107
|
+
const resized = chunkI5SO5OV4_js.applyResize(
|
|
11108
11108
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
11109
11109
|
handle,
|
|
11110
11110
|
dx,
|
|
@@ -11116,7 +11116,7 @@ function computeResizeGeometry(handle, startX, startY, startWidth, startHeight,
|
|
|
11116
11116
|
if (!snapToGrid) {
|
|
11117
11117
|
return box;
|
|
11118
11118
|
}
|
|
11119
|
-
return
|
|
11119
|
+
return chunkI5SO5OV4_js.snapBoxToGrid(box, handle, gridSpacingPx, MIN_ELEMENT_SIZE);
|
|
11120
11120
|
}
|
|
11121
11121
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
11122
11122
|
const range = startWidth || 200;
|
|
@@ -11226,7 +11226,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
11226
11226
|
width: el.width,
|
|
11227
11227
|
height: el.height
|
|
11228
11228
|
}));
|
|
11229
|
-
const snapResult =
|
|
11229
|
+
const snapResult = chunkI5SO5OV4_js.computeSnapToShape(
|
|
11230
11230
|
targetX,
|
|
11231
11231
|
targetY,
|
|
11232
11232
|
primaryEl.width,
|
|
@@ -11369,13 +11369,13 @@ function processPointerUp(input) {
|
|
|
11369
11369
|
if (i !== activeSlideIndex) {
|
|
11370
11370
|
return s;
|
|
11371
11371
|
}
|
|
11372
|
-
const rerouted =
|
|
11372
|
+
const rerouted = chunkI5SO5OV4_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
11373
11373
|
if (rerouted.length === 0) {
|
|
11374
11374
|
return s;
|
|
11375
11375
|
}
|
|
11376
11376
|
return {
|
|
11377
11377
|
...s,
|
|
11378
|
-
elements:
|
|
11378
|
+
elements: chunkI5SO5OV4_js.applyReroutedConnectors(s.elements, rerouted)
|
|
11379
11379
|
};
|
|
11380
11380
|
})
|
|
11381
11381
|
);
|
|
@@ -11394,9 +11394,9 @@ function processPointerUp(input) {
|
|
|
11394
11394
|
}
|
|
11395
11395
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
11396
11396
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
11397
|
-
const hitIds =
|
|
11397
|
+
const hitIds = chunkI5SO5OV4_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
11398
11398
|
if (marquee.additive) {
|
|
11399
|
-
const merged =
|
|
11399
|
+
const merged = chunkI5SO5OV4_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
11400
11400
|
if (merged.length > 0) {
|
|
11401
11401
|
applySelection(merged[0], merged);
|
|
11402
11402
|
} else {
|
|
@@ -11419,8 +11419,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
11419
11419
|
}
|
|
11420
11420
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
11421
11421
|
});
|
|
11422
|
-
const rerouted =
|
|
11423
|
-
return
|
|
11422
|
+
const rerouted = chunkI5SO5OV4_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
11423
|
+
return chunkI5SO5OV4_js.applyReroutedConnectors(movedElements, rerouted);
|
|
11424
11424
|
};
|
|
11425
11425
|
if (editTemplateMode) {
|
|
11426
11426
|
const slideId = activeSlide?.id;
|
|
@@ -11570,8 +11570,8 @@ function useCanvasInteractions(input) {
|
|
|
11570
11570
|
return;
|
|
11571
11571
|
}
|
|
11572
11572
|
const el = elementLookup.get(editId);
|
|
11573
|
-
if (el &&
|
|
11574
|
-
const newSegments =
|
|
11573
|
+
if (el && chunkKV3EOLP3_js.hasTextProperties(el)) {
|
|
11574
|
+
const newSegments = chunkI5SO5OV4_js.remapTextToSegments(inlineEditingText, el.textSegments, el.textStyle);
|
|
11575
11575
|
ops.updateElementById(editId, {
|
|
11576
11576
|
text: inlineEditingText,
|
|
11577
11577
|
textSegments: newSegments
|
|
@@ -11582,7 +11582,7 @@ function useCanvasInteractions(input) {
|
|
|
11582
11582
|
setInlineEditingText("");
|
|
11583
11583
|
};
|
|
11584
11584
|
const openEquationEditorForElement = (el) => {
|
|
11585
|
-
if (!
|
|
11585
|
+
if (!chunkKV3EOLP3_js.hasTextProperties(el)) {
|
|
11586
11586
|
return false;
|
|
11587
11587
|
}
|
|
11588
11588
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -11611,7 +11611,7 @@ function useCanvasInteractions(input) {
|
|
|
11611
11611
|
justSelectedRef.current = false;
|
|
11612
11612
|
} else {
|
|
11613
11613
|
const el = elementLookup.get(elementId);
|
|
11614
|
-
if (el &&
|
|
11614
|
+
if (el && chunkKV3EOLP3_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
11615
11615
|
if (!openEquationEditorForElement(el)) {
|
|
11616
11616
|
setInlineEditingElementId(elementId);
|
|
11617
11617
|
setInlineEditingText(el.text ?? "");
|
|
@@ -11630,7 +11630,7 @@ function useCanvasInteractions(input) {
|
|
|
11630
11630
|
if (openEquationEditorForElement(el)) {
|
|
11631
11631
|
return;
|
|
11632
11632
|
}
|
|
11633
|
-
if (
|
|
11633
|
+
if (chunkKV3EOLP3_js.hasTextProperties(el)) {
|
|
11634
11634
|
setInlineEditingElementId(elementId);
|
|
11635
11635
|
setInlineEditingText(el.text ?? "");
|
|
11636
11636
|
}
|
|
@@ -11817,7 +11817,7 @@ function createFileHandlers(deps) {
|
|
|
11817
11817
|
h = Math.round(h * scale);
|
|
11818
11818
|
}
|
|
11819
11819
|
addElement({
|
|
11820
|
-
id:
|
|
11820
|
+
id: chunkI5SO5OV4_js.generateElementId(),
|
|
11821
11821
|
type: "image",
|
|
11822
11822
|
x: Math.round((canvasSize.width - w) / 2),
|
|
11823
11823
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -11828,7 +11828,7 @@ function createFileHandlers(deps) {
|
|
|
11828
11828
|
};
|
|
11829
11829
|
img.onerror = () => {
|
|
11830
11830
|
addElement({
|
|
11831
|
-
id:
|
|
11831
|
+
id: chunkI5SO5OV4_js.generateElementId(),
|
|
11832
11832
|
type: "image",
|
|
11833
11833
|
x: 100,
|
|
11834
11834
|
y: 100,
|
|
@@ -11854,7 +11854,7 @@ function createFileHandlers(deps) {
|
|
|
11854
11854
|
const elFilePath = file.path;
|
|
11855
11855
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
11856
11856
|
addElement({
|
|
11857
|
-
id:
|
|
11857
|
+
id: chunkI5SO5OV4_js.generateElementId(),
|
|
11858
11858
|
type: "media",
|
|
11859
11859
|
mediaType,
|
|
11860
11860
|
mediaMimeType: file.type || void 0,
|
|
@@ -12029,13 +12029,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
12029
12029
|
return;
|
|
12030
12030
|
}
|
|
12031
12031
|
addElement({
|
|
12032
|
-
id:
|
|
12032
|
+
id: chunkI5SO5OV4_js.generateElementId(),
|
|
12033
12033
|
type: "smartArt",
|
|
12034
12034
|
x: 100,
|
|
12035
12035
|
y: 120,
|
|
12036
12036
|
width: 600,
|
|
12037
12037
|
height: 340,
|
|
12038
|
-
smartArtData:
|
|
12038
|
+
smartArtData: chunkI5SO5OV4_js.buildSmartArtPresetData(
|
|
12039
12039
|
layout,
|
|
12040
12040
|
defaultItems,
|
|
12041
12041
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -12047,7 +12047,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12047
12047
|
return;
|
|
12048
12048
|
}
|
|
12049
12049
|
addElement({
|
|
12050
|
-
id:
|
|
12050
|
+
id: chunkI5SO5OV4_js.generateElementId(),
|
|
12051
12051
|
type: "shape",
|
|
12052
12052
|
x: 120,
|
|
12053
12053
|
y: 200,
|
|
@@ -12106,7 +12106,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12106
12106
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
12107
12107
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
12108
12108
|
addElement({
|
|
12109
|
-
id:
|
|
12109
|
+
id: chunkI5SO5OV4_js.generateElementId(),
|
|
12110
12110
|
type: "shape",
|
|
12111
12111
|
x: 120,
|
|
12112
12112
|
y: 200,
|
|
@@ -12128,11 +12128,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
12128
12128
|
if (!activeSlide) {
|
|
12129
12129
|
return;
|
|
12130
12130
|
}
|
|
12131
|
-
const preset =
|
|
12131
|
+
const preset = chunkI5SO5OV4_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
12132
12132
|
if (!preset) {
|
|
12133
12133
|
return;
|
|
12134
12134
|
}
|
|
12135
|
-
const defaultPptxAction =
|
|
12135
|
+
const defaultPptxAction = chunkKV3EOLP3_js.elementActionToPptxAction({
|
|
12136
12136
|
trigger: "click",
|
|
12137
12137
|
type: preset.defaultAction
|
|
12138
12138
|
});
|
|
@@ -12141,7 +12141,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12141
12141
|
defaultPptxAction.highlightClick = true;
|
|
12142
12142
|
}
|
|
12143
12143
|
addElement({
|
|
12144
|
-
id:
|
|
12144
|
+
id: chunkI5SO5OV4_js.generateElementId(),
|
|
12145
12145
|
type: "shape",
|
|
12146
12146
|
x: 150,
|
|
12147
12147
|
y: 150,
|
|
@@ -12208,7 +12208,7 @@ function useInsertElements(input) {
|
|
|
12208
12208
|
return;
|
|
12209
12209
|
}
|
|
12210
12210
|
addElement({
|
|
12211
|
-
id:
|
|
12211
|
+
id: chunkI5SO5OV4_js.generateElementId(),
|
|
12212
12212
|
type: "text",
|
|
12213
12213
|
x: 100,
|
|
12214
12214
|
y: 100,
|
|
@@ -12223,7 +12223,7 @@ function useInsertElements(input) {
|
|
|
12223
12223
|
return;
|
|
12224
12224
|
}
|
|
12225
12225
|
addElement({
|
|
12226
|
-
id:
|
|
12226
|
+
id: chunkI5SO5OV4_js.generateElementId(),
|
|
12227
12227
|
type: "shape",
|
|
12228
12228
|
x: 150,
|
|
12229
12229
|
y: 150,
|
|
@@ -12242,15 +12242,15 @@ function useInsertElements(input) {
|
|
|
12242
12242
|
return;
|
|
12243
12243
|
}
|
|
12244
12244
|
addElement({
|
|
12245
|
-
...
|
|
12246
|
-
id:
|
|
12245
|
+
...chunkI5SO5OV4_js.newTableElement(DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
12246
|
+
id: chunkI5SO5OV4_js.generateElementId()
|
|
12247
12247
|
});
|
|
12248
12248
|
};
|
|
12249
12249
|
const handleAddChart = (chartType) => {
|
|
12250
12250
|
if (!activeSlide) {
|
|
12251
12251
|
return;
|
|
12252
12252
|
}
|
|
12253
|
-
addElement(
|
|
12253
|
+
addElement(chunkI5SO5OV4_js.createDefaultChartElement(chartType));
|
|
12254
12254
|
};
|
|
12255
12255
|
const structured = createStructuredElementHandlers({
|
|
12256
12256
|
activeSlide,
|
|
@@ -12320,7 +12320,7 @@ function useClipboardHandlers(input) {
|
|
|
12320
12320
|
if (!selectedElement) {
|
|
12321
12321
|
return;
|
|
12322
12322
|
}
|
|
12323
|
-
setClipboardPayload(
|
|
12323
|
+
setClipboardPayload(chunkI5SO5OV4_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
12324
12324
|
};
|
|
12325
12325
|
const handleDelete = () => {
|
|
12326
12326
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -12337,7 +12337,7 @@ function useClipboardHandlers(input) {
|
|
|
12337
12337
|
handleDelete();
|
|
12338
12338
|
};
|
|
12339
12339
|
const insertClone = (source) => {
|
|
12340
|
-
const clone =
|
|
12340
|
+
const clone = chunkI5SO5OV4_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
12341
12341
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
12342
12342
|
ops.applySelection(clone.id);
|
|
12343
12343
|
history.markDirty();
|
|
@@ -12372,7 +12372,7 @@ function resolveShapePath(el) {
|
|
|
12372
12372
|
return el.pathData;
|
|
12373
12373
|
}
|
|
12374
12374
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
12375
|
-
const clipPath =
|
|
12375
|
+
const clipPath = chunkKV3EOLP3_js.getPresetShapeClipPath(el.shapeType);
|
|
12376
12376
|
if (clipPath) {
|
|
12377
12377
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
12378
12378
|
if (svgPath) {
|
|
@@ -12423,7 +12423,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
12423
12423
|
return parts.join(" ");
|
|
12424
12424
|
}
|
|
12425
12425
|
function transformPathToGlobal(pathData, el) {
|
|
12426
|
-
const polys =
|
|
12426
|
+
const polys = chunkKV3EOLP3_js.svgPathToPolygons(pathData);
|
|
12427
12427
|
if (polys.length === 0) {
|
|
12428
12428
|
return pathData;
|
|
12429
12429
|
}
|
|
@@ -12443,10 +12443,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
12443
12443
|
y: pt.y * scaleY + el.y
|
|
12444
12444
|
}))
|
|
12445
12445
|
);
|
|
12446
|
-
return
|
|
12446
|
+
return chunkKV3EOLP3_js.polygonsToSvgPath(transformed);
|
|
12447
12447
|
}
|
|
12448
12448
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
12449
|
-
const polys =
|
|
12449
|
+
const polys = chunkKV3EOLP3_js.svgPathToPolygons(pathData);
|
|
12450
12450
|
if (polys.length === 0) {
|
|
12451
12451
|
return pathData;
|
|
12452
12452
|
}
|
|
@@ -12456,10 +12456,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
12456
12456
|
y: pt.y - y
|
|
12457
12457
|
}))
|
|
12458
12458
|
);
|
|
12459
|
-
return
|
|
12459
|
+
return chunkKV3EOLP3_js.polygonsToSvgPath(transformed);
|
|
12460
12460
|
}
|
|
12461
12461
|
function pathBounds(pathData) {
|
|
12462
|
-
const polys =
|
|
12462
|
+
const polys = chunkKV3EOLP3_js.svgPathToPolygons(pathData);
|
|
12463
12463
|
let minX = Infinity;
|
|
12464
12464
|
let minY = Infinity;
|
|
12465
12465
|
let maxX = -Infinity;
|
|
@@ -12518,7 +12518,7 @@ function useMergeShapesHandler(input) {
|
|
|
12518
12518
|
let allFragments = [];
|
|
12519
12519
|
let remaining = globalPaths[0];
|
|
12520
12520
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
12521
|
-
const frags =
|
|
12521
|
+
const frags = chunkKV3EOLP3_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
12522
12522
|
if (Array.isArray(frags)) {
|
|
12523
12523
|
allFragments = frags;
|
|
12524
12524
|
}
|
|
@@ -12547,7 +12547,7 @@ function useMergeShapesHandler(input) {
|
|
|
12547
12547
|
bounds.height
|
|
12548
12548
|
);
|
|
12549
12549
|
const newEl = {
|
|
12550
|
-
id:
|
|
12550
|
+
id: chunkI5SO5OV4_js.generateElementId(),
|
|
12551
12551
|
type: "shape",
|
|
12552
12552
|
x: bounds.x,
|
|
12553
12553
|
y: bounds.y,
|
|
@@ -12585,7 +12585,7 @@ function useMergeShapesHandler(input) {
|
|
|
12585
12585
|
} else {
|
|
12586
12586
|
let resultPath = globalPaths[0];
|
|
12587
12587
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
12588
|
-
const result =
|
|
12588
|
+
const result = chunkKV3EOLP3_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
12589
12589
|
if (typeof result === "string") {
|
|
12590
12590
|
resultPath = result;
|
|
12591
12591
|
}
|
|
@@ -12606,7 +12606,7 @@ function useMergeShapesHandler(input) {
|
|
|
12606
12606
|
);
|
|
12607
12607
|
const primary = targets[0];
|
|
12608
12608
|
const newEl = {
|
|
12609
|
-
id:
|
|
12609
|
+
id: chunkI5SO5OV4_js.generateElementId(),
|
|
12610
12610
|
type: "shape",
|
|
12611
12611
|
x: bounds.x,
|
|
12612
12612
|
y: bounds.y,
|
|
@@ -12669,7 +12669,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
12669
12669
|
if (ids.length < 2 || !activeSlide) {
|
|
12670
12670
|
return;
|
|
12671
12671
|
}
|
|
12672
|
-
const { elements, groupId } =
|
|
12672
|
+
const { elements, groupId } = chunkI5SO5OV4_js.groupElements(ops.activeElements, ids, chunkI5SO5OV4_js.generateElementId());
|
|
12673
12673
|
if (groupId === null) {
|
|
12674
12674
|
return;
|
|
12675
12675
|
}
|
|
@@ -12682,12 +12682,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
12682
12682
|
return;
|
|
12683
12683
|
}
|
|
12684
12684
|
const group = selectedElement;
|
|
12685
|
-
const intoTemplate =
|
|
12685
|
+
const intoTemplate = chunkI5SO5OV4_js.isTemplateElementId(group.id);
|
|
12686
12686
|
const ungrouped = group.children.map((child) => ({
|
|
12687
12687
|
...structuredClone(child),
|
|
12688
12688
|
// Keep child ids in the same store as the group so later edits route
|
|
12689
12689
|
// correctly: template groups yield template-prefixed child ids.
|
|
12690
|
-
id: intoTemplate ?
|
|
12690
|
+
id: intoTemplate ? chunkI5SO5OV4_js.makeCloneId(true, child.id || group.id) : child.id || chunkI5SO5OV4_js.generateElementId(),
|
|
12691
12691
|
x: child.x + group.x,
|
|
12692
12692
|
y: child.y + group.y
|
|
12693
12693
|
}));
|
|
@@ -12711,7 +12711,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
12711
12711
|
if (!edge) {
|
|
12712
12712
|
return;
|
|
12713
12713
|
}
|
|
12714
|
-
const positions =
|
|
12714
|
+
const positions = chunkI5SO5OV4_js.alignElements(selectedElements, edge);
|
|
12715
12715
|
for (const [id, pos] of positions) {
|
|
12716
12716
|
const el = elementLookup.get(id);
|
|
12717
12717
|
if (!el) {
|
|
@@ -12729,7 +12729,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
12729
12729
|
if (!distAxis) {
|
|
12730
12730
|
return;
|
|
12731
12731
|
}
|
|
12732
|
-
const positions =
|
|
12732
|
+
const positions = chunkI5SO5OV4_js.distributeElements(selectedElements, distAxis);
|
|
12733
12733
|
for (const [id, pos] of positions) {
|
|
12734
12734
|
const el = elementLookup.get(id);
|
|
12735
12735
|
if (!el) {
|
|
@@ -12746,7 +12746,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
12746
12746
|
}
|
|
12747
12747
|
const id = selectedElement.id;
|
|
12748
12748
|
ops.updateActiveElements(
|
|
12749
|
-
(els) => direction === "forward" ?
|
|
12749
|
+
(els) => direction === "forward" ? chunkI5SO5OV4_js.bringForward(els, id) : direction === "backward" ? chunkI5SO5OV4_js.sendBackward(els, id) : els
|
|
12750
12750
|
);
|
|
12751
12751
|
history.markDirty();
|
|
12752
12752
|
};
|
|
@@ -12756,7 +12756,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
12756
12756
|
}
|
|
12757
12757
|
const id = selectedElement.id;
|
|
12758
12758
|
ops.updateActiveElements(
|
|
12759
|
-
(els) => direction === "front" ?
|
|
12759
|
+
(els) => direction === "front" ? chunkI5SO5OV4_js.bringToFront(els, id) : chunkI5SO5OV4_js.sendToBack(els, id)
|
|
12760
12760
|
);
|
|
12761
12761
|
history.markDirty();
|
|
12762
12762
|
};
|
|
@@ -12878,7 +12878,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
12878
12878
|
function useSlideManagement(input) {
|
|
12879
12879
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
12880
12880
|
const handleAddSlide = () => {
|
|
12881
|
-
const newSlide =
|
|
12881
|
+
const newSlide = chunkI5SO5OV4_js.createBlankSlide(slides.length + 1);
|
|
12882
12882
|
ops.updateSlides((prev) => {
|
|
12883
12883
|
const next = [...prev];
|
|
12884
12884
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -12941,7 +12941,7 @@ function useSlideManagement(input) {
|
|
|
12941
12941
|
}
|
|
12942
12942
|
const clone = {
|
|
12943
12943
|
...src,
|
|
12944
|
-
id:
|
|
12944
|
+
id: chunkI5SO5OV4_js.makeSlideId(),
|
|
12945
12945
|
elements: src.elements.map((el) => ({
|
|
12946
12946
|
...el,
|
|
12947
12947
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -12973,7 +12973,7 @@ function useSlideManagement(input) {
|
|
|
12973
12973
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
12974
12974
|
const insertAt = activeSlideIndex + 1;
|
|
12975
12975
|
const draft = {
|
|
12976
|
-
...
|
|
12976
|
+
...chunkI5SO5OV4_js.createBlankSlide(slides.length + 1),
|
|
12977
12977
|
layoutPath,
|
|
12978
12978
|
...layoutName ? { layoutName } : {}
|
|
12979
12979
|
};
|
|
@@ -13034,7 +13034,7 @@ function createTableMergeHandlers(input) {
|
|
|
13034
13034
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
13035
13035
|
return;
|
|
13036
13036
|
}
|
|
13037
|
-
const newTableData =
|
|
13037
|
+
const newTableData = chunkI5SO5OV4_js.mergeCells(
|
|
13038
13038
|
[
|
|
13039
13039
|
{ row: rowIndex, col: columnIndex },
|
|
13040
13040
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -13042,7 +13042,7 @@ function createTableMergeHandlers(input) {
|
|
|
13042
13042
|
td
|
|
13043
13043
|
);
|
|
13044
13044
|
const updates = { tableData: newTableData };
|
|
13045
|
-
const newRawXml =
|
|
13045
|
+
const newRawXml = chunkKV3EOLP3_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13046
13046
|
if (newRawXml) {
|
|
13047
13047
|
updates.rawXml = newRawXml;
|
|
13048
13048
|
}
|
|
@@ -13068,7 +13068,7 @@ function createTableMergeHandlers(input) {
|
|
|
13068
13068
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
13069
13069
|
return;
|
|
13070
13070
|
}
|
|
13071
|
-
const newTableData =
|
|
13071
|
+
const newTableData = chunkI5SO5OV4_js.mergeCells(
|
|
13072
13072
|
[
|
|
13073
13073
|
{ row: rowIndex, col: columnIndex },
|
|
13074
13074
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -13076,7 +13076,7 @@ function createTableMergeHandlers(input) {
|
|
|
13076
13076
|
td
|
|
13077
13077
|
);
|
|
13078
13078
|
const updates = { tableData: newTableData };
|
|
13079
|
-
const newRawXml =
|
|
13079
|
+
const newRawXml = chunkKV3EOLP3_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13080
13080
|
if (newRawXml) {
|
|
13081
13081
|
updates.rawXml = newRawXml;
|
|
13082
13082
|
}
|
|
@@ -13091,9 +13091,9 @@ function createTableMergeHandlers(input) {
|
|
|
13091
13091
|
return;
|
|
13092
13092
|
}
|
|
13093
13093
|
const td = selectedElement.tableData;
|
|
13094
|
-
const newTableData =
|
|
13094
|
+
const newTableData = chunkI5SO5OV4_js.mergeCells(ts.selectedCells, td);
|
|
13095
13095
|
const updates = { tableData: newTableData };
|
|
13096
|
-
const newRawXml =
|
|
13096
|
+
const newRawXml = chunkKV3EOLP3_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13097
13097
|
if (newRawXml) {
|
|
13098
13098
|
updates.rawXml = newRawXml;
|
|
13099
13099
|
}
|
|
@@ -13110,9 +13110,9 @@ function createTableMergeHandlers(input) {
|
|
|
13110
13110
|
}
|
|
13111
13111
|
const { rowIndex, columnIndex } = ts;
|
|
13112
13112
|
const td = selectedElement.tableData;
|
|
13113
|
-
const newTableData =
|
|
13113
|
+
const newTableData = chunkI5SO5OV4_js.splitCell(rowIndex, columnIndex, td);
|
|
13114
13114
|
const updates = { tableData: newTableData };
|
|
13115
|
-
const newRawXml =
|
|
13115
|
+
const newRawXml = chunkKV3EOLP3_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13116
13116
|
if (newRawXml) {
|
|
13117
13117
|
updates.rawXml = newRawXml;
|
|
13118
13118
|
}
|
|
@@ -13156,7 +13156,7 @@ function createTableStructHandlers(input) {
|
|
|
13156
13156
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
13157
13157
|
}
|
|
13158
13158
|
if (el.rawXml) {
|
|
13159
|
-
const newRawXml =
|
|
13159
|
+
const newRawXml = chunkKV3EOLP3_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
13160
13160
|
if (newRawXml) {
|
|
13161
13161
|
updates.rawXml = newRawXml;
|
|
13162
13162
|
}
|
|
@@ -13180,7 +13180,7 @@ function createTableStructHandlers(input) {
|
|
|
13180
13180
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
13181
13181
|
const updates = {};
|
|
13182
13182
|
if (selectedElement.rawXml) {
|
|
13183
|
-
const newRawXml =
|
|
13183
|
+
const newRawXml = chunkKV3EOLP3_js.updateCellTextStyleInRawXml(
|
|
13184
13184
|
selectedElement,
|
|
13185
13185
|
rowIndex,
|
|
13186
13186
|
colIndex,
|
|
@@ -13244,9 +13244,9 @@ function createTableStructHandlers(input) {
|
|
|
13244
13244
|
return;
|
|
13245
13245
|
}
|
|
13246
13246
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
13247
|
-
const newTableData =
|
|
13247
|
+
const newTableData = chunkI5SO5OV4_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
13248
13248
|
const updates = { tableData: newTableData };
|
|
13249
|
-
const newRawXml =
|
|
13249
|
+
const newRawXml = chunkKV3EOLP3_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13250
13250
|
if (newRawXml) {
|
|
13251
13251
|
updates.rawXml = newRawXml;
|
|
13252
13252
|
}
|
|
@@ -13259,12 +13259,12 @@ function createTableStructHandlers(input) {
|
|
|
13259
13259
|
}
|
|
13260
13260
|
const td = selectedElement.tableData;
|
|
13261
13261
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
13262
|
-
const newTableData =
|
|
13262
|
+
const newTableData = chunkI5SO5OV4_js.deleteTableRow(td, rowIdx);
|
|
13263
13263
|
if (newTableData === td) {
|
|
13264
13264
|
return;
|
|
13265
13265
|
}
|
|
13266
13266
|
const updates = { tableData: newTableData };
|
|
13267
|
-
const newRawXml =
|
|
13267
|
+
const newRawXml = chunkKV3EOLP3_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13268
13268
|
if (newRawXml) {
|
|
13269
13269
|
updates.rawXml = newRawXml;
|
|
13270
13270
|
}
|
|
@@ -13276,9 +13276,9 @@ function createTableStructHandlers(input) {
|
|
|
13276
13276
|
return;
|
|
13277
13277
|
}
|
|
13278
13278
|
const colIdx = ts?.columnIndex ?? 0;
|
|
13279
|
-
const newTableData =
|
|
13279
|
+
const newTableData = chunkI5SO5OV4_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
13280
13280
|
const updates = { tableData: newTableData };
|
|
13281
|
-
const newRawXml =
|
|
13281
|
+
const newRawXml = chunkKV3EOLP3_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13282
13282
|
if (newRawXml) {
|
|
13283
13283
|
updates.rawXml = newRawXml;
|
|
13284
13284
|
}
|
|
@@ -13291,12 +13291,12 @@ function createTableStructHandlers(input) {
|
|
|
13291
13291
|
}
|
|
13292
13292
|
const td = selectedElement.tableData;
|
|
13293
13293
|
const colIdx = ts?.columnIndex ?? 0;
|
|
13294
|
-
const newTableData =
|
|
13294
|
+
const newTableData = chunkI5SO5OV4_js.deleteTableColumn(td, colIdx);
|
|
13295
13295
|
if (newTableData === td) {
|
|
13296
13296
|
return;
|
|
13297
13297
|
}
|
|
13298
13298
|
const updates = { tableData: newTableData };
|
|
13299
|
-
const newRawXml =
|
|
13299
|
+
const newRawXml = chunkKV3EOLP3_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13300
13300
|
if (newRawXml) {
|
|
13301
13301
|
updates.rawXml = newRawXml;
|
|
13302
13302
|
}
|
|
@@ -13332,8 +13332,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
13332
13332
|
return html2canvasPro(element, {
|
|
13333
13333
|
...options,
|
|
13334
13334
|
onclone: async (doc, clonedEl) => {
|
|
13335
|
-
await
|
|
13336
|
-
|
|
13335
|
+
await chunkI5SO5OV4_js.normalizeColorsForCapture(doc, clonedEl);
|
|
13336
|
+
chunkI5SO5OV4_js.preprocessCssForCapture(clonedEl);
|
|
13337
13337
|
if (typeof userOnClone === "function") {
|
|
13338
13338
|
userOnClone(doc, clonedEl);
|
|
13339
13339
|
}
|
|
@@ -13389,7 +13389,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
13389
13389
|
}
|
|
13390
13390
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
13391
13391
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
13392
|
-
|
|
13392
|
+
chunkI5SO5OV4_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
13393
13393
|
}
|
|
13394
13394
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
13395
13395
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -13411,7 +13411,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13411
13411
|
continue;
|
|
13412
13412
|
}
|
|
13413
13413
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
13414
|
-
images.push(
|
|
13414
|
+
images.push(chunkI5SO5OV4_js.canvasToJpegData(canvas));
|
|
13415
13415
|
}
|
|
13416
13416
|
onProgress?.(totalSlides, totalSlides);
|
|
13417
13417
|
setActiveSlide(currentSlideIndex);
|
|
@@ -13419,7 +13419,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13419
13419
|
throw new Error(chunkZISXRMDJ_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
13420
13420
|
}
|
|
13421
13421
|
const pdfBlobUrl = buildPdfFromImageData(images);
|
|
13422
|
-
|
|
13422
|
+
chunkI5SO5OV4_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
13423
13423
|
}
|
|
13424
13424
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
13425
13425
|
const { scale = 2, onProgress } = options;
|
|
@@ -13468,7 +13468,7 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
13468
13468
|
throw new Error(chunkZISXRMDJ_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
13469
13469
|
}
|
|
13470
13470
|
const pdfDataUrl = buildNotesPdf(pages);
|
|
13471
|
-
|
|
13471
|
+
chunkI5SO5OV4_js.downloadDataUrl(pdfDataUrl, filename);
|
|
13472
13472
|
}
|
|
13473
13473
|
|
|
13474
13474
|
// src/viewer/utils/export-video.ts
|
|
@@ -13512,7 +13512,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
13512
13512
|
const fps = 30;
|
|
13513
13513
|
const stream = recordingCanvas.captureStream(fps);
|
|
13514
13514
|
const recorder = new MediaRecorder(stream, {
|
|
13515
|
-
mimeType:
|
|
13515
|
+
mimeType: chunkI5SO5OV4_js.pickSupportedMimeType([...chunkI5SO5OV4_js.WEBM_MIME_CANDIDATES]),
|
|
13516
13516
|
videoBitsPerSecond: 5e6
|
|
13517
13517
|
});
|
|
13518
13518
|
const chunks = [];
|
|
@@ -13535,8 +13535,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
13535
13535
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
13536
13536
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
13537
13537
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
13538
|
-
const frameInterval =
|
|
13539
|
-
const framesNeeded =
|
|
13538
|
+
const frameInterval = chunkI5SO5OV4_js.fpsToFrameIntervalMs(fps);
|
|
13539
|
+
const framesNeeded = chunkI5SO5OV4_js.segmentFrameCount(duration, fps);
|
|
13540
13540
|
for (let f = 0; f < framesNeeded; f++) {
|
|
13541
13541
|
if (signal?.aborted) {
|
|
13542
13542
|
recorder.stop();
|
|
@@ -13585,7 +13585,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13585
13585
|
if (frames.length === 0) {
|
|
13586
13586
|
throw new Error(chunkZISXRMDJ_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
13587
13587
|
}
|
|
13588
|
-
const gifBytes =
|
|
13588
|
+
const gifBytes = chunkI5SO5OV4_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
13589
13589
|
onProgress?.(totalSlides, totalSlides);
|
|
13590
13590
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
13591
13591
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -13639,7 +13639,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
13639
13639
|
continue;
|
|
13640
13640
|
}
|
|
13641
13641
|
onProgress?.(processedCount, data.slides.length);
|
|
13642
|
-
let svg =
|
|
13642
|
+
let svg = chunkKV3EOLP3_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
13643
13643
|
if (embedFonts && fontFaces?.length) {
|
|
13644
13644
|
svg = injectFontFaces(svg, fontFaces);
|
|
13645
13645
|
}
|
|
@@ -13699,7 +13699,7 @@ function useExportSaveAs(input) {
|
|
|
13699
13699
|
}
|
|
13700
13700
|
setExportProgress(70);
|
|
13701
13701
|
setExportStatusMessage("Writing README...");
|
|
13702
|
-
const readme =
|
|
13702
|
+
const readme = chunkI5SO5OV4_js.generatePackageReadme(pptxFilename);
|
|
13703
13703
|
pkgFolder.file("README.txt", readme);
|
|
13704
13704
|
if (abortCtrl.signal.aborted) {
|
|
13705
13705
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -13710,7 +13710,7 @@ function useExportSaveAs(input) {
|
|
|
13710
13710
|
setExportProgress(95);
|
|
13711
13711
|
setExportStatusMessage("Downloading...");
|
|
13712
13712
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
13713
|
-
|
|
13713
|
+
chunkI5SO5OV4_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
13714
13714
|
setExportProgress(100);
|
|
13715
13715
|
} catch (err) {
|
|
13716
13716
|
if (err.name !== "AbortError") {
|
|
@@ -13733,7 +13733,7 @@ function useExportSaveAs(input) {
|
|
|
13733
13733
|
const blob = new Blob([data], {
|
|
13734
13734
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
13735
13735
|
});
|
|
13736
|
-
|
|
13736
|
+
chunkI5SO5OV4_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
13737
13737
|
} catch (err) {
|
|
13738
13738
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
13739
13739
|
}
|
|
@@ -13746,7 +13746,7 @@ function useExportSaveAs(input) {
|
|
|
13746
13746
|
const pptxGuides = guides.map((g) => ({
|
|
13747
13747
|
id: g.id,
|
|
13748
13748
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
13749
|
-
positionEmu:
|
|
13749
|
+
positionEmu: chunkKV3EOLP3_js.guidePxToEmu(g.position)
|
|
13750
13750
|
}));
|
|
13751
13751
|
return {
|
|
13752
13752
|
...slide,
|
|
@@ -13810,7 +13810,7 @@ function safeConfirm(message) {
|
|
|
13810
13810
|
}
|
|
13811
13811
|
}
|
|
13812
13812
|
function downloadBlob2(blob, filename) {
|
|
13813
|
-
|
|
13813
|
+
chunkI5SO5OV4_js.downloadBlob(blob, chunkI5SO5OV4_js.sanitizeDownloadFilename(filename));
|
|
13814
13814
|
}
|
|
13815
13815
|
|
|
13816
13816
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -13911,21 +13911,21 @@ function useExportHandlers(input) {
|
|
|
13911
13911
|
{
|
|
13912
13912
|
scale: 2,
|
|
13913
13913
|
onProgress: (current, total) => {
|
|
13914
|
-
setExportProgress(
|
|
13915
|
-
setExportStatusMessage(
|
|
13914
|
+
setExportProgress(chunkI5SO5OV4_js.slideProgressPercent(current, total));
|
|
13915
|
+
setExportStatusMessage(chunkI5SO5OV4_js.slideStatusLabel("Rendering", current, total));
|
|
13916
13916
|
},
|
|
13917
13917
|
signal: abortCtrl.signal
|
|
13918
13918
|
}
|
|
13919
13919
|
);
|
|
13920
|
-
setExportProgress(
|
|
13920
|
+
setExportProgress(chunkI5SO5OV4_js.EXPORT_ASSEMBLING_PERCENT);
|
|
13921
13921
|
setExportStatusMessage("Building PDF...");
|
|
13922
13922
|
await new Promise((r) => {
|
|
13923
13923
|
setTimeout(r, 100);
|
|
13924
13924
|
});
|
|
13925
|
-
setExportProgress(
|
|
13925
|
+
setExportProgress(chunkI5SO5OV4_js.EXPORT_DONE_PERCENT);
|
|
13926
13926
|
setExportStatusMessage("Done!");
|
|
13927
13927
|
} catch (err) {
|
|
13928
|
-
if (!
|
|
13928
|
+
if (!chunkI5SO5OV4_js.isExportAbortError(err)) {
|
|
13929
13929
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
13930
13930
|
}
|
|
13931
13931
|
} finally {
|
|
@@ -13955,21 +13955,21 @@ function useExportHandlers(input) {
|
|
|
13955
13955
|
{
|
|
13956
13956
|
scale: 2,
|
|
13957
13957
|
onProgress: (current, total) => {
|
|
13958
|
-
setExportProgress(
|
|
13959
|
-
setExportStatusMessage(
|
|
13958
|
+
setExportProgress(chunkI5SO5OV4_js.slideProgressPercent(current, total));
|
|
13959
|
+
setExportStatusMessage(chunkI5SO5OV4_js.slideStatusLabel("Rendering", current, total));
|
|
13960
13960
|
},
|
|
13961
13961
|
signal: abortCtrl.signal
|
|
13962
13962
|
}
|
|
13963
13963
|
);
|
|
13964
|
-
setExportProgress(
|
|
13964
|
+
setExportProgress(chunkI5SO5OV4_js.EXPORT_ASSEMBLING_PERCENT);
|
|
13965
13965
|
setExportStatusMessage("Building PDF...");
|
|
13966
13966
|
await new Promise((r) => {
|
|
13967
13967
|
setTimeout(r, 100);
|
|
13968
13968
|
});
|
|
13969
|
-
setExportProgress(
|
|
13969
|
+
setExportProgress(chunkI5SO5OV4_js.EXPORT_DONE_PERCENT);
|
|
13970
13970
|
setExportStatusMessage("Done!");
|
|
13971
13971
|
} catch (err) {
|
|
13972
|
-
if (!
|
|
13972
|
+
if (!chunkI5SO5OV4_js.isExportAbortError(err)) {
|
|
13973
13973
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
13974
13974
|
}
|
|
13975
13975
|
} finally {
|
|
@@ -14010,22 +14010,22 @@ function useExportHandlers(input) {
|
|
|
14010
14010
|
scale: 1,
|
|
14011
14011
|
slideDurationMs: 3e3,
|
|
14012
14012
|
onProgress: (current, total) => {
|
|
14013
|
-
setExportProgress(
|
|
14014
|
-
setExportStatusMessage(
|
|
14013
|
+
setExportProgress(chunkI5SO5OV4_js.slideProgressPercent(current, total, 45));
|
|
14014
|
+
setExportStatusMessage(chunkI5SO5OV4_js.slideStatusLabel("Capturing", current, total));
|
|
14015
14015
|
},
|
|
14016
14016
|
onRecordProgress: (current, total) => {
|
|
14017
|
-
setExportProgress(
|
|
14018
|
-
setExportStatusMessage(
|
|
14017
|
+
setExportProgress(chunkI5SO5OV4_js.recordProgressPercent(current, total));
|
|
14018
|
+
setExportStatusMessage(chunkI5SO5OV4_js.slideStatusLabel("Recording", current, total));
|
|
14019
14019
|
},
|
|
14020
14020
|
signal: abortCtrl.signal
|
|
14021
14021
|
}
|
|
14022
14022
|
);
|
|
14023
|
-
setExportProgress(
|
|
14023
|
+
setExportProgress(chunkI5SO5OV4_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14024
14024
|
setExportStatusMessage("Saving file...");
|
|
14025
14025
|
downloadBlob2(blob, "presentation.webm");
|
|
14026
|
-
setExportProgress(
|
|
14026
|
+
setExportProgress(chunkI5SO5OV4_js.EXPORT_DONE_PERCENT);
|
|
14027
14027
|
} catch (err) {
|
|
14028
|
-
if (!
|
|
14028
|
+
if (!chunkI5SO5OV4_js.isExportAbortError(err)) {
|
|
14029
14029
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
14030
14030
|
}
|
|
14031
14031
|
} finally {
|
|
@@ -14053,18 +14053,18 @@ function useExportHandlers(input) {
|
|
|
14053
14053
|
scale: 0.5,
|
|
14054
14054
|
slideDurationMs: 2e3,
|
|
14055
14055
|
onProgress: (current, total) => {
|
|
14056
|
-
setExportProgress(
|
|
14057
|
-
setExportStatusMessage(
|
|
14056
|
+
setExportProgress(chunkI5SO5OV4_js.slideProgressPercent(current, total));
|
|
14057
|
+
setExportStatusMessage(chunkI5SO5OV4_js.slideStatusLabel("Encoding", current, total));
|
|
14058
14058
|
},
|
|
14059
14059
|
signal: abortCtrl.signal
|
|
14060
14060
|
}
|
|
14061
14061
|
);
|
|
14062
|
-
setExportProgress(
|
|
14062
|
+
setExportProgress(chunkI5SO5OV4_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14063
14063
|
setExportStatusMessage("Saving file...");
|
|
14064
14064
|
downloadBlob2(blob, "presentation.gif");
|
|
14065
|
-
setExportProgress(
|
|
14065
|
+
setExportProgress(chunkI5SO5OV4_js.EXPORT_DONE_PERCENT);
|
|
14066
14066
|
} catch (err) {
|
|
14067
|
-
if (!
|
|
14067
|
+
if (!chunkI5SO5OV4_js.isExportAbortError(err)) {
|
|
14068
14068
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
14069
14069
|
}
|
|
14070
14070
|
} finally {
|
|
@@ -14104,7 +14104,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
14104
14104
|
}
|
|
14105
14105
|
printWindow.document.open();
|
|
14106
14106
|
printWindow.document.write(
|
|
14107
|
-
|
|
14107
|
+
chunkI5SO5OV4_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
14108
14108
|
);
|
|
14109
14109
|
printWindow.document.close();
|
|
14110
14110
|
printWindow.focus();
|
|
@@ -14165,7 +14165,7 @@ function usePrintHandlers(input) {
|
|
|
14165
14165
|
if (svgs.length === 0) {
|
|
14166
14166
|
return;
|
|
14167
14167
|
}
|
|
14168
|
-
const printDoc =
|
|
14168
|
+
const printDoc = chunkI5SO5OV4_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
14169
14169
|
title: "Slides (Vector)",
|
|
14170
14170
|
orientation: settings.orientation,
|
|
14171
14171
|
colorFilter
|
|
@@ -14201,7 +14201,7 @@ function usePrintHandlers(input) {
|
|
|
14201
14201
|
if (settings.printWhat === "outline") {
|
|
14202
14202
|
openPrintWindow(
|
|
14203
14203
|
"Outline",
|
|
14204
|
-
`<div class="outline-page">${
|
|
14204
|
+
`<div class="outline-page">${chunkI5SO5OV4_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
14205
14205
|
settings.orientation,
|
|
14206
14206
|
colorFilter,
|
|
14207
14207
|
settings.frameSlides
|
|
@@ -14226,7 +14226,7 @@ function usePrintHandlers(input) {
|
|
|
14226
14226
|
if (settings.printWhat === "slides") {
|
|
14227
14227
|
openPrintWindow(
|
|
14228
14228
|
"Slides",
|
|
14229
|
-
|
|
14229
|
+
chunkI5SO5OV4_js.buildSlidesHtml(slideImages, slideIndices),
|
|
14230
14230
|
settings.orientation,
|
|
14231
14231
|
colorFilter,
|
|
14232
14232
|
settings.frameSlides
|
|
@@ -14236,7 +14236,7 @@ function usePrintHandlers(input) {
|
|
|
14236
14236
|
if (settings.printWhat === "notes") {
|
|
14237
14237
|
openPrintWindow(
|
|
14238
14238
|
"Notes Pages",
|
|
14239
|
-
|
|
14239
|
+
chunkI5SO5OV4_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
14240
14240
|
"portrait",
|
|
14241
14241
|
colorFilter,
|
|
14242
14242
|
settings.frameSlides
|
|
@@ -14247,7 +14247,7 @@ function usePrintHandlers(input) {
|
|
|
14247
14247
|
const spp = settings.slidesPerPage;
|
|
14248
14248
|
openPrintWindow(
|
|
14249
14249
|
`Handout ${spp} per page`,
|
|
14250
|
-
|
|
14250
|
+
chunkI5SO5OV4_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
14251
14251
|
"portrait",
|
|
14252
14252
|
colorFilter,
|
|
14253
14253
|
settings.frameSlides
|
|
@@ -14411,7 +14411,7 @@ function useThemeSwitching(input) {
|
|
|
14411
14411
|
}
|
|
14412
14412
|
try {
|
|
14413
14413
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
14414
|
-
const newData =
|
|
14414
|
+
const newData = chunkKV3EOLP3_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
14415
14415
|
onDataChange(newData);
|
|
14416
14416
|
onThemeChanged?.(preset);
|
|
14417
14417
|
} catch (error) {
|
|
@@ -14428,7 +14428,7 @@ function useThemeSwitching(input) {
|
|
|
14428
14428
|
}
|
|
14429
14429
|
try {
|
|
14430
14430
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
14431
|
-
const newData =
|
|
14431
|
+
const newData = chunkKV3EOLP3_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
14432
14432
|
onDataChange(newData);
|
|
14433
14433
|
} catch (error) {
|
|
14434
14434
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -14440,12 +14440,12 @@ function useThemeSwitching(input) {
|
|
|
14440
14440
|
if (!data?.theme?.colorScheme) {
|
|
14441
14441
|
return void 0;
|
|
14442
14442
|
}
|
|
14443
|
-
return
|
|
14444
|
-
(p) =>
|
|
14443
|
+
return chunkKV3EOLP3_js.THEME_PRESETS.find(
|
|
14444
|
+
(p) => chunkKV3EOLP3_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
14445
14445
|
);
|
|
14446
14446
|
}, [data?.theme?.colorScheme]);
|
|
14447
14447
|
return {
|
|
14448
|
-
presets:
|
|
14448
|
+
presets: chunkKV3EOLP3_js.THEME_PRESETS,
|
|
14449
14449
|
switchToPreset,
|
|
14450
14450
|
switchToCustom,
|
|
14451
14451
|
currentPreset
|
|
@@ -14520,7 +14520,7 @@ function usePropertyHandlers(input) {
|
|
|
14520
14520
|
}
|
|
14521
14521
|
try {
|
|
14522
14522
|
const ab = await file.arrayBuffer();
|
|
14523
|
-
const h = new
|
|
14523
|
+
const h = new chunkKV3EOLP3_js.PptxHandler();
|
|
14524
14524
|
const other = await h.load(ab);
|
|
14525
14525
|
if (!other) {
|
|
14526
14526
|
return;
|
|
@@ -14530,7 +14530,7 @@ function usePropertyHandlers(input) {
|
|
|
14530
14530
|
width: canvasSize.width,
|
|
14531
14531
|
height: canvasSize.height
|
|
14532
14532
|
};
|
|
14533
|
-
setCompareResult(
|
|
14533
|
+
setCompareResult(chunkI5SO5OV4_js.comparePresentation(cur, other));
|
|
14534
14534
|
setIsComparePanelOpen(true);
|
|
14535
14535
|
} catch (err) {
|
|
14536
14536
|
console.warn("Compare failed:", err);
|
|
@@ -14547,7 +14547,7 @@ function usePropertyHandlers(input) {
|
|
|
14547
14547
|
if (!diff || diff.status === "unchanged") {
|
|
14548
14548
|
return;
|
|
14549
14549
|
}
|
|
14550
|
-
setSlides((prev) =>
|
|
14550
|
+
setSlides((prev) => chunkI5SO5OV4_js.applyAcceptSlide(prev, diff));
|
|
14551
14551
|
setIsDirty(true);
|
|
14552
14552
|
},
|
|
14553
14553
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -14558,10 +14558,10 @@ function usePropertyHandlers(input) {
|
|
|
14558
14558
|
if (!compareResult) {
|
|
14559
14559
|
return;
|
|
14560
14560
|
}
|
|
14561
|
-
setSlides((prev) =>
|
|
14561
|
+
setSlides((prev) => chunkI5SO5OV4_js.applyAcceptAllSlides(prev, compareResult));
|
|
14562
14562
|
setIsDirty(true);
|
|
14563
14563
|
}, [compareResult, setSlides, setIsDirty]);
|
|
14564
|
-
const usedFontFamilies = React3.useMemo(() =>
|
|
14564
|
+
const usedFontFamilies = React3.useMemo(() => chunkI5SO5OV4_js.collectUsedFonts(slides), [slides]);
|
|
14565
14565
|
return {
|
|
14566
14566
|
handleUpdateNotes,
|
|
14567
14567
|
handleUpdateSlide,
|
|
@@ -14680,7 +14680,7 @@ function useIsMobile(input) {
|
|
|
14680
14680
|
const containerRef = input?.containerRef;
|
|
14681
14681
|
const isTouchDevice = React3.useSyncExternalStore(
|
|
14682
14682
|
subscribeTouchCapability,
|
|
14683
|
-
|
|
14683
|
+
chunkI5SO5OV4_js.detectTouchDevice,
|
|
14684
14684
|
() => false
|
|
14685
14685
|
// server snapshot
|
|
14686
14686
|
);
|
|
@@ -14696,7 +14696,7 @@ function useIsMobile(input) {
|
|
|
14696
14696
|
}
|
|
14697
14697
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
14698
14698
|
});
|
|
14699
|
-
const [orientation, setOrientation] = React3.useState(
|
|
14699
|
+
const [orientation, setOrientation] = React3.useState(chunkI5SO5OV4_js.detectOrientation);
|
|
14700
14700
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = React3.useState(false);
|
|
14701
14701
|
const [initialViewportHeight] = React3.useState(
|
|
14702
14702
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -14740,7 +14740,7 @@ function useIsMobile(input) {
|
|
|
14740
14740
|
return;
|
|
14741
14741
|
}
|
|
14742
14742
|
const handleOrientationChange = () => {
|
|
14743
|
-
setOrientation(
|
|
14743
|
+
setOrientation(chunkI5SO5OV4_js.detectOrientation());
|
|
14744
14744
|
};
|
|
14745
14745
|
if (screen.orientation) {
|
|
14746
14746
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -14770,9 +14770,9 @@ function useIsMobile(input) {
|
|
|
14770
14770
|
window.addEventListener("resize", handleResize);
|
|
14771
14771
|
return () => window.removeEventListener("resize", handleResize);
|
|
14772
14772
|
}, [isTouchDevice, initialViewportHeight]);
|
|
14773
|
-
const isMobile =
|
|
14774
|
-
const isTablet = !isMobile && containerWidth >=
|
|
14775
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
14773
|
+
const isMobile = chunkI5SO5OV4_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
14774
|
+
const isTablet = !isMobile && containerWidth >= chunkI5SO5OV4_js.MOBILE_BREAKPOINT && containerWidth < chunkI5SO5OV4_js.TABLET_BREAKPOINT;
|
|
14775
|
+
const isDesktop = !isMobile && containerWidth >= chunkI5SO5OV4_js.TABLET_BREAKPOINT;
|
|
14776
14776
|
return {
|
|
14777
14777
|
isMobile,
|
|
14778
14778
|
isTablet,
|
|
@@ -14833,11 +14833,11 @@ function useViewerDialogs(input) {
|
|
|
14833
14833
|
);
|
|
14834
14834
|
const [embedFontsEnabled, setEmbedFontsEnabled] = React3.useState(false);
|
|
14835
14835
|
const [isNarrowViewport, setIsNarrowViewport] = React3.useState(
|
|
14836
|
-
() => typeof window !== "undefined" ?
|
|
14836
|
+
() => typeof window !== "undefined" ? chunkI5SO5OV4_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
14837
14837
|
);
|
|
14838
14838
|
React3.useEffect(() => {
|
|
14839
14839
|
const handleWindow = () => setIsNarrowViewport(
|
|
14840
|
-
|
|
14840
|
+
chunkI5SO5OV4_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
14841
14841
|
);
|
|
14842
14842
|
let observer = null;
|
|
14843
14843
|
let raf = 0;
|
|
@@ -14851,12 +14851,12 @@ function useViewerDialogs(input) {
|
|
|
14851
14851
|
const entry = entries[0];
|
|
14852
14852
|
if (entry) {
|
|
14853
14853
|
setIsNarrowViewport(
|
|
14854
|
-
|
|
14854
|
+
chunkI5SO5OV4_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
14855
14855
|
);
|
|
14856
14856
|
}
|
|
14857
14857
|
});
|
|
14858
14858
|
observer.observe(el);
|
|
14859
|
-
setIsNarrowViewport(
|
|
14859
|
+
setIsNarrowViewport(chunkI5SO5OV4_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
14860
14860
|
};
|
|
14861
14861
|
attach();
|
|
14862
14862
|
window.addEventListener("resize", handleWindow);
|
|
@@ -15033,7 +15033,7 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
|
15033
15033
|
return slides.map((_, i) => i).filter((i) => !slides[i]?.hidden);
|
|
15034
15034
|
}
|
|
15035
15035
|
function computeSlideSectionGroups(slides, sections) {
|
|
15036
|
-
return
|
|
15036
|
+
return chunkI5SO5OV4_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
15037
15037
|
id: group.section?.id ?? (sections.length > 0 ? UNGROUPED_SECTION_ID : "default"),
|
|
15038
15038
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
15039
15039
|
slideIndexes: group.slideIndexes,
|
|
@@ -15251,13 +15251,13 @@ function useSerialize(input) {
|
|
|
15251
15251
|
let processedSlide = slide;
|
|
15252
15252
|
if (pendingEditId) {
|
|
15253
15253
|
const updatedElements = slide.elements.map((el) => {
|
|
15254
|
-
if (el.id !== pendingEditId || !
|
|
15254
|
+
if (el.id !== pendingEditId || !chunkKV3EOLP3_js.hasTextProperties(el)) {
|
|
15255
15255
|
return el;
|
|
15256
15256
|
}
|
|
15257
15257
|
return {
|
|
15258
15258
|
...el,
|
|
15259
15259
|
text: pendingEditText,
|
|
15260
|
-
textSegments:
|
|
15260
|
+
textSegments: chunkI5SO5OV4_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
15261
15261
|
};
|
|
15262
15262
|
});
|
|
15263
15263
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -15270,7 +15270,7 @@ function useSerialize(input) {
|
|
|
15270
15270
|
const pptxGuides = guides.map((g) => ({
|
|
15271
15271
|
id: g.id,
|
|
15272
15272
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
15273
|
-
positionEmu:
|
|
15273
|
+
positionEmu: chunkKV3EOLP3_js.guidePxToEmu(g.position)
|
|
15274
15274
|
}));
|
|
15275
15275
|
return {
|
|
15276
15276
|
...processedSlide,
|
|
@@ -15490,10 +15490,10 @@ function usePresentationSetup(input) {
|
|
|
15490
15490
|
onToggleEraser: () => annotations.setPresentationTool("eraser"),
|
|
15491
15491
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
15492
15492
|
onSaveRehearsalTimings: (timings) => {
|
|
15493
|
-
setSlides((prev) =>
|
|
15493
|
+
setSlides((prev) => chunkI5SO5OV4_js.applyRehearsalTimings(prev, timings));
|
|
15494
15494
|
history.markDirty();
|
|
15495
15495
|
},
|
|
15496
|
-
loopContinuously:
|
|
15496
|
+
loopContinuously: chunkI5SO5OV4_js.shouldLoopContinuously(presentationProperties),
|
|
15497
15497
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
15498
15498
|
useTimings: presentationProperties.advanceMode !== "manual"
|
|
15499
15499
|
});
|
|
@@ -15652,7 +15652,7 @@ function useEditorOperations(input) {
|
|
|
15652
15652
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
15653
15653
|
React3.useEffect(() => {
|
|
15654
15654
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
15655
|
-
copiedFormatRef.current =
|
|
15655
|
+
copiedFormatRef.current = chunkI5SO5OV4_js.copyFormatFromElement(selectedElement);
|
|
15656
15656
|
} else if (!formatPainterActive) {
|
|
15657
15657
|
copiedFormatRef.current = null;
|
|
15658
15658
|
}
|
|
@@ -15678,12 +15678,12 @@ function useEditorOperations(input) {
|
|
|
15678
15678
|
e.stopPropagation();
|
|
15679
15679
|
const element = elementLookup.get(elementId);
|
|
15680
15680
|
if (element) {
|
|
15681
|
-
const updated =
|
|
15681
|
+
const updated = chunkI5SO5OV4_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
15682
15682
|
const updates = {};
|
|
15683
|
-
if (
|
|
15683
|
+
if (chunkKV3EOLP3_js.hasShapeProperties(updated)) {
|
|
15684
15684
|
updates.shapeStyle = updated.shapeStyle;
|
|
15685
15685
|
}
|
|
15686
|
-
if (
|
|
15686
|
+
if (chunkKV3EOLP3_js.hasTextProperties(updated)) {
|
|
15687
15687
|
updates.textStyle = updated.textStyle;
|
|
15688
15688
|
}
|
|
15689
15689
|
ops.updateElementById(elementId, updates);
|
|
@@ -15827,7 +15827,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
15827
15827
|
const families = /* @__PURE__ */ new Set();
|
|
15828
15828
|
for (const slide of slides) {
|
|
15829
15829
|
for (const el of slide.elements) {
|
|
15830
|
-
if (
|
|
15830
|
+
if (chunkKV3EOLP3_js.hasTextProperties(el) && el.textSegments) {
|
|
15831
15831
|
for (const seg of el.textSegments) {
|
|
15832
15832
|
if (seg.style.fontFamily) {
|
|
15833
15833
|
families.add(seg.style.fontFamily);
|
|
@@ -16602,9 +16602,9 @@ function useReducedMotion() {
|
|
|
16602
16602
|
setManualReducedMotion
|
|
16603
16603
|
};
|
|
16604
16604
|
}
|
|
16605
|
-
var KNOWN_TAB_IDS = new Set(
|
|
16605
|
+
var KNOWN_TAB_IDS = new Set(chunkI5SO5OV4_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
16606
16606
|
function computeToolbarVisibility(hiddenActions) {
|
|
16607
|
-
const isHidden = (id) =>
|
|
16607
|
+
const isHidden = (id) => chunkI5SO5OV4_js.isActionHidden(id, hiddenActions);
|
|
16608
16608
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
16609
16609
|
return { isHidden, isTabVisible };
|
|
16610
16610
|
}
|
|
@@ -16621,7 +16621,7 @@ function useYjsProvider({ config }) {
|
|
|
16621
16621
|
const timeoutRef = React3.useRef(null);
|
|
16622
16622
|
const gateRef = React3.useRef(null);
|
|
16623
16623
|
if (!gateRef.current) {
|
|
16624
|
-
gateRef.current =
|
|
16624
|
+
gateRef.current = chunkI5SO5OV4_js.createSyncGate(() => setSynced(true));
|
|
16625
16625
|
}
|
|
16626
16626
|
const teardown = React3.useCallback(() => {
|
|
16627
16627
|
if (timeoutRef.current) {
|
|
@@ -16659,7 +16659,7 @@ function useYjsProvider({ config }) {
|
|
|
16659
16659
|
if (config.authToken) {
|
|
16660
16660
|
opts.password = config.authToken;
|
|
16661
16661
|
}
|
|
16662
|
-
const provider = new WebrtcProvider(
|
|
16662
|
+
const provider = new WebrtcProvider(chunkI5SO5OV4_js.validateRoomId(config.roomId), yDoc, opts);
|
|
16663
16663
|
setDoc(yDoc);
|
|
16664
16664
|
setAwareness(provider.awareness);
|
|
16665
16665
|
setClientId(provider.awareness.clientID);
|
|
@@ -16701,13 +16701,13 @@ function useYjsProvider({ config }) {
|
|
|
16701
16701
|
if (!config) {
|
|
16702
16702
|
return;
|
|
16703
16703
|
}
|
|
16704
|
-
const roomId =
|
|
16705
|
-
const transport = config.transport ??
|
|
16704
|
+
const roomId = chunkI5SO5OV4_js.validateRoomId(config.roomId);
|
|
16705
|
+
const transport = config.transport ?? chunkI5SO5OV4_js.resolveTransportForServerUrl(config.serverUrl);
|
|
16706
16706
|
if (transport === "webrtc") {
|
|
16707
16707
|
await initWebrtc();
|
|
16708
16708
|
return;
|
|
16709
16709
|
}
|
|
16710
|
-
if (
|
|
16710
|
+
if (chunkI5SO5OV4_js.isMixedContentBlocked(config.serverUrl)) {
|
|
16711
16711
|
console.warn(
|
|
16712
16712
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
16713
16713
|
);
|
|
@@ -16767,7 +16767,7 @@ function useYjsProvider({ config }) {
|
|
|
16767
16767
|
cleanupRef.current = null;
|
|
16768
16768
|
setStatus("error");
|
|
16769
16769
|
}
|
|
16770
|
-
},
|
|
16770
|
+
}, chunkI5SO5OV4_js.CONNECTION_TIMEOUT_MS);
|
|
16771
16771
|
}
|
|
16772
16772
|
setDoc(yDoc);
|
|
16773
16773
|
setAwareness(provider.awareness);
|
|
@@ -16840,7 +16840,7 @@ function usePresenceTracking({
|
|
|
16840
16840
|
awareness.setLocalStateField("presence", state);
|
|
16841
16841
|
lastBroadcastRef.current = Date.now();
|
|
16842
16842
|
};
|
|
16843
|
-
if (elapsed >=
|
|
16843
|
+
if (elapsed >= chunkI5SO5OV4_js.BROADCAST_THROTTLE_MS) {
|
|
16844
16844
|
if (pendingBroadcastRef.current) {
|
|
16845
16845
|
clearTimeout(pendingBroadcastRef.current);
|
|
16846
16846
|
pendingBroadcastRef.current = null;
|
|
@@ -16850,7 +16850,7 @@ function usePresenceTracking({
|
|
|
16850
16850
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
16851
16851
|
pendingBroadcastRef.current = null;
|
|
16852
16852
|
flush();
|
|
16853
|
-
},
|
|
16853
|
+
}, chunkI5SO5OV4_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
16854
16854
|
}
|
|
16855
16855
|
},
|
|
16856
16856
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -16875,7 +16875,7 @@ function usePresenceTracking({
|
|
|
16875
16875
|
return;
|
|
16876
16876
|
}
|
|
16877
16877
|
const handleChange = () => {
|
|
16878
|
-
const users =
|
|
16878
|
+
const users = chunkI5SO5OV4_js.derivePresenceList(
|
|
16879
16879
|
awareness.getStates(),
|
|
16880
16880
|
localClientId,
|
|
16881
16881
|
canvasWidth,
|
|
@@ -16923,7 +16923,7 @@ function useCollaborativeState({
|
|
|
16923
16923
|
canvasWidth,
|
|
16924
16924
|
canvasHeight
|
|
16925
16925
|
}) {
|
|
16926
|
-
const userColor =
|
|
16926
|
+
const userColor = chunkI5SO5OV4_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
16927
16927
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
16928
16928
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
16929
16929
|
awareness,
|
|
@@ -17026,10 +17026,10 @@ function useYjsDocumentSync({
|
|
|
17026
17026
|
return;
|
|
17027
17027
|
}
|
|
17028
17028
|
try {
|
|
17029
|
-
const { PptxHandler: PptxHandler2 } = await import('./dist-
|
|
17029
|
+
const { PptxHandler: PptxHandler2 } = await import('./dist-XF3QJAEF.js');
|
|
17030
17030
|
const handler = new PptxHandler2();
|
|
17031
17031
|
await handler.load(sourceBytes.buffer);
|
|
17032
|
-
const currentSlides =
|
|
17032
|
+
const currentSlides = chunkI5SO5OV4_js.readSlidesFromYDoc(
|
|
17033
17033
|
doc
|
|
17034
17034
|
);
|
|
17035
17035
|
const slidesToSave = buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
@@ -17050,11 +17050,11 @@ function useYjsDocumentSync({
|
|
|
17050
17050
|
lastSyncedRef.current = serialized;
|
|
17051
17051
|
void (async () => {
|
|
17052
17052
|
const factories = await getFactories();
|
|
17053
|
-
|
|
17053
|
+
chunkI5SO5OV4_js.reconcileSlidesInYDoc(
|
|
17054
17054
|
slides,
|
|
17055
17055
|
doc,
|
|
17056
17056
|
factories,
|
|
17057
|
-
|
|
17057
|
+
chunkI5SO5OV4_js.LOCAL_SYNC_ORIGIN
|
|
17058
17058
|
);
|
|
17059
17059
|
scheduleWriteBack();
|
|
17060
17060
|
})();
|
|
@@ -17064,10 +17064,10 @@ function useYjsDocumentSync({
|
|
|
17064
17064
|
return;
|
|
17065
17065
|
}
|
|
17066
17066
|
const handleChange = (_events, transaction) => {
|
|
17067
|
-
if (transaction?.origin ===
|
|
17067
|
+
if (transaction?.origin === chunkI5SO5OV4_js.LOCAL_SYNC_ORIGIN) {
|
|
17068
17068
|
return;
|
|
17069
17069
|
}
|
|
17070
|
-
const remoteSlides =
|
|
17070
|
+
const remoteSlides = chunkI5SO5OV4_js.readSlidesFromYDoc(
|
|
17071
17071
|
doc
|
|
17072
17072
|
);
|
|
17073
17073
|
if (remoteSlides.length === 0) {
|
|
@@ -17085,7 +17085,7 @@ function useYjsDocumentSync({
|
|
|
17085
17085
|
});
|
|
17086
17086
|
scheduleWriteBack();
|
|
17087
17087
|
};
|
|
17088
|
-
const unobserve =
|
|
17088
|
+
const unobserve = chunkI5SO5OV4_js.observeYDocSlides(
|
|
17089
17089
|
doc,
|
|
17090
17090
|
handleChange
|
|
17091
17091
|
);
|
|
@@ -17236,7 +17236,7 @@ function useLayoutSwitching(input) {
|
|
|
17236
17236
|
function useVirtualizedSlides({
|
|
17237
17237
|
totalItems,
|
|
17238
17238
|
itemHeight,
|
|
17239
|
-
overscan =
|
|
17239
|
+
overscan = chunkI5SO5OV4_js.DEFAULT_VIRTUAL_OVERSCAN
|
|
17240
17240
|
}) {
|
|
17241
17241
|
const scrollContainerRef = React3.useRef(null);
|
|
17242
17242
|
const [scrollTop, setScrollTop] = React3.useState(0);
|
|
@@ -17266,7 +17266,7 @@ function useVirtualizedSlides({
|
|
|
17266
17266
|
resizeObserver?.disconnect();
|
|
17267
17267
|
};
|
|
17268
17268
|
}, []);
|
|
17269
|
-
const range =
|
|
17269
|
+
const range = chunkI5SO5OV4_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
|
|
17270
17270
|
const safeItemHeight = Math.max(itemHeight, 1);
|
|
17271
17271
|
const scrollToIndex = React3.useCallback(
|
|
17272
17272
|
(index, behavior = "smooth") => {
|
|
@@ -17312,7 +17312,7 @@ function useTouchGestures(input) {
|
|
|
17312
17312
|
if (!el || !enabled) {
|
|
17313
17313
|
return;
|
|
17314
17314
|
}
|
|
17315
|
-
const recognizer =
|
|
17315
|
+
const recognizer = chunkI5SO5OV4_js.createTouchGestureRecognizer({
|
|
17316
17316
|
getScale: () => scaleRef.current,
|
|
17317
17317
|
minScale: MIN_ZOOM_SCALE,
|
|
17318
17318
|
maxScale: MAX_ZOOM_SCALE,
|
|
@@ -17355,7 +17355,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
17355
17355
|
return;
|
|
17356
17356
|
}
|
|
17357
17357
|
const rect = active.getBoundingClientRect();
|
|
17358
|
-
const delta =
|
|
17358
|
+
const delta = chunkI5SO5OV4_js.computeScrollDelta(
|
|
17359
17359
|
{ top: rect.top, bottom: rect.bottom },
|
|
17360
17360
|
window.innerHeight,
|
|
17361
17361
|
keyboardInset
|
|
@@ -17375,8 +17375,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
17375
17375
|
return;
|
|
17376
17376
|
}
|
|
17377
17377
|
const update = () => {
|
|
17378
|
-
const metrics =
|
|
17379
|
-
const inset = metrics ?
|
|
17378
|
+
const metrics = chunkI5SO5OV4_js.readViewportMetrics(window);
|
|
17379
|
+
const inset = metrics ? chunkI5SO5OV4_js.computeKeyboardInset(metrics) : 0;
|
|
17380
17380
|
setKeyboardInset(inset);
|
|
17381
17381
|
if (inset > 0) {
|
|
17382
17382
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -17387,8 +17387,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
17387
17387
|
vv.addEventListener("scroll", update);
|
|
17388
17388
|
const onFocusIn = () => {
|
|
17389
17389
|
window.requestAnimationFrame(() => {
|
|
17390
|
-
const metrics =
|
|
17391
|
-
const inset = metrics ?
|
|
17390
|
+
const metrics = chunkI5SO5OV4_js.readViewportMetrics(window);
|
|
17391
|
+
const inset = metrics ? chunkI5SO5OV4_js.computeKeyboardInset(metrics) : 0;
|
|
17392
17392
|
if (inset > 0) {
|
|
17393
17393
|
scrollFocusedIntoView(inset);
|
|
17394
17394
|
}
|
|
@@ -17401,7 +17401,821 @@ function useKeyboardInsets(enabled = true) {
|
|
|
17401
17401
|
document.removeEventListener("focusin", onFocusIn);
|
|
17402
17402
|
};
|
|
17403
17403
|
}, [enabled]);
|
|
17404
|
-
return { keyboardInset, isKeyboardOpen:
|
|
17404
|
+
return { keyboardInset, isKeyboardOpen: chunkI5SO5OV4_js.isKeyboardOpen(keyboardInset) };
|
|
17405
|
+
}
|
|
17406
|
+
|
|
17407
|
+
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
17408
|
+
function buildCanvasProps(input) {
|
|
17409
|
+
const {
|
|
17410
|
+
mode,
|
|
17411
|
+
canEdit,
|
|
17412
|
+
slides,
|
|
17413
|
+
activeSlide,
|
|
17414
|
+
masterPseudoSlide,
|
|
17415
|
+
templateElements,
|
|
17416
|
+
canvasSize,
|
|
17417
|
+
activeSlideIndex,
|
|
17418
|
+
gridSpacingPx,
|
|
17419
|
+
zoom,
|
|
17420
|
+
state: s,
|
|
17421
|
+
selectedElement,
|
|
17422
|
+
canvasHandlers,
|
|
17423
|
+
insertHandlers,
|
|
17424
|
+
tableOps,
|
|
17425
|
+
presentation,
|
|
17426
|
+
findResults,
|
|
17427
|
+
findResultIndex
|
|
17428
|
+
} = input;
|
|
17429
|
+
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
17430
|
+
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
17431
|
+
let slideTitle;
|
|
17432
|
+
if (activeSlide) {
|
|
17433
|
+
for (const el of activeSlide.elements) {
|
|
17434
|
+
const phType = el.placeholderType;
|
|
17435
|
+
if (phType === "title" || phType === "ctrTitle") {
|
|
17436
|
+
const txt = el.text;
|
|
17437
|
+
if (txt) {
|
|
17438
|
+
slideTitle = txt;
|
|
17439
|
+
break;
|
|
17440
|
+
}
|
|
17441
|
+
}
|
|
17442
|
+
}
|
|
17443
|
+
}
|
|
17444
|
+
const hf = s.headerFooter;
|
|
17445
|
+
const fieldContext = {
|
|
17446
|
+
slideNumber: activeSlide?.slideNumber,
|
|
17447
|
+
dateTimeText: hf.dateTimeText,
|
|
17448
|
+
dateFormat: hf.dateFormat,
|
|
17449
|
+
footerText: hf.footerText,
|
|
17450
|
+
headerText: hf.headerText,
|
|
17451
|
+
slideTitle,
|
|
17452
|
+
customProperties: s.customProperties.map((p) => ({ name: p.name, value: p.value }))
|
|
17453
|
+
};
|
|
17454
|
+
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
17455
|
+
const handleActionClick = (_elementId, action) => {
|
|
17456
|
+
if (mode === "present") {
|
|
17457
|
+
presentation.handlePresentationAction(action);
|
|
17458
|
+
} else if (action.url) {
|
|
17459
|
+
chunkI5SO5OV4_js.safeOpenUrl(action.url);
|
|
17460
|
+
}
|
|
17461
|
+
};
|
|
17462
|
+
const handleHyperlinkClick = (url) => {
|
|
17463
|
+
if (chunkI5SO5OV4_js.isPpactionUrl(url)) {
|
|
17464
|
+
if (mode === "present") {
|
|
17465
|
+
const parsed = chunkI5SO5OV4_js.parsePpactionUrl(url);
|
|
17466
|
+
if (parsed) {
|
|
17467
|
+
presentation.handlePresentationAction({
|
|
17468
|
+
action: parsed.action,
|
|
17469
|
+
targetSlideIndex: parsed.targetSlideIndex
|
|
17470
|
+
});
|
|
17471
|
+
}
|
|
17472
|
+
}
|
|
17473
|
+
return;
|
|
17474
|
+
}
|
|
17475
|
+
chunkI5SO5OV4_js.safeOpenUrl(url);
|
|
17476
|
+
};
|
|
17477
|
+
return {
|
|
17478
|
+
activeSlide: effectiveSlide,
|
|
17479
|
+
templateElements: effectiveTemplateElements,
|
|
17480
|
+
canvasSize,
|
|
17481
|
+
zoom,
|
|
17482
|
+
mode,
|
|
17483
|
+
canEdit,
|
|
17484
|
+
editTemplateMode: mode === "master" || s.editTemplateMode,
|
|
17485
|
+
selectedElementIdSet: s.selectedElementIdSet,
|
|
17486
|
+
selectedElement,
|
|
17487
|
+
inlineEditingElementId: s.inlineEditingElementId,
|
|
17488
|
+
inlineEditingText: s.inlineEditingText,
|
|
17489
|
+
spellCheckEnabled: s.spellCheckEnabled,
|
|
17490
|
+
mediaDataUrls: s.mediaDataUrls,
|
|
17491
|
+
tableEditorState: s.tableEditorState,
|
|
17492
|
+
marqueeSelectionState: s.marqueeSelectionState,
|
|
17493
|
+
snapLines: s.snapLines,
|
|
17494
|
+
showGrid: s.showGrid,
|
|
17495
|
+
gridSpacingPx,
|
|
17496
|
+
showRulers: s.showRulers,
|
|
17497
|
+
guides: s.guides,
|
|
17498
|
+
presentationElementStates: mode === "present" ? presentation.presentationElementStates : void 0,
|
|
17499
|
+
presentationKeyframesCss: mode === "present" ? presentation.presentationKeyframesCss : void 0,
|
|
17500
|
+
onClick: canvasHandlers.handleElementClick,
|
|
17501
|
+
onDoubleClick: canvasHandlers.handleElementDoubleClick,
|
|
17502
|
+
onMouseDown: canvasHandlers.handleElementMouseDown,
|
|
17503
|
+
onContextMenu: canvasHandlers.handleElementContextMenu,
|
|
17504
|
+
onCanvasMouseDown: canvasHandlers.handleCanvasMouseDown,
|
|
17505
|
+
onResizePointerDown: canvasHandlers.handleResizePointerDown,
|
|
17506
|
+
onAdjustmentPointerDown: canvasHandlers.handleAdjustmentPointerDown,
|
|
17507
|
+
onRotate: canvasHandlers.handleRotate,
|
|
17508
|
+
onInlineEditChange: s.setInlineEditingText,
|
|
17509
|
+
onInlineEditCommit: canvasHandlers.handleInlineEditCommit,
|
|
17510
|
+
onInlineEditCancel: () => s.setInlineEditingElementId(null),
|
|
17511
|
+
onTableCellSelect: (cell, elementId) => s.setTableEditorState(cell ? { ...cell, elementId } : null),
|
|
17512
|
+
onCommitCellEdit: tableOps.handleCommitCellEdit,
|
|
17513
|
+
onUpdateSmartArtElement: canvasHandlers.handleUpdateSmartArtElement,
|
|
17514
|
+
onFormatText: canvasHandlers.handleFormatText,
|
|
17515
|
+
onResizeTableColumns: tableOps.handleResizeTableColumns,
|
|
17516
|
+
onResizeTableRow: tableOps.handleResizeTableRow,
|
|
17517
|
+
findResults,
|
|
17518
|
+
findResultIndex,
|
|
17519
|
+
activeSlideIndex,
|
|
17520
|
+
activeTool: s.activeTool,
|
|
17521
|
+
drawingColor: s.drawingColor,
|
|
17522
|
+
drawingWidth: s.drawingWidth,
|
|
17523
|
+
isDrawingRef: s.isDrawingRef,
|
|
17524
|
+
onAddInkElement: insertHandlers.handleAddInkElement,
|
|
17525
|
+
onAddFreeformShape: insertHandlers.handleAddFreeformShape,
|
|
17526
|
+
onEraseInkElement: insertHandlers.handleEraseInkElement,
|
|
17527
|
+
onActionClick: handleActionClick,
|
|
17528
|
+
onHyperlinkClick: handleHyperlinkClick,
|
|
17529
|
+
allSlides: mode === "present" ? slides : void 0,
|
|
17530
|
+
onZoomClick: mode === "present" ? presentation.handleZoomClick : void 0,
|
|
17531
|
+
sourceSlideIndex: mode === "present" ? activeSlideIndex : void 0,
|
|
17532
|
+
fieldContext,
|
|
17533
|
+
tableStyleContext,
|
|
17534
|
+
// Collaboration cursor/selection overlays require a `CollaborationProvider`
|
|
17535
|
+
// ancestor, which these building blocks intentionally don't render (hosts
|
|
17536
|
+
// that need collaboration should use `PowerPointViewer` directly).
|
|
17537
|
+
collaborationOverlay: void 0,
|
|
17538
|
+
comments: activeSlide?.comments,
|
|
17539
|
+
showCommentMarkers: s.sidebarPanelMode === "comments",
|
|
17540
|
+
onCommentMarkerClick: () => s.setSidebarPanelMode("comments"),
|
|
17541
|
+
onMoveGuide: (guideId, position) => {
|
|
17542
|
+
s.setGuides(
|
|
17543
|
+
(prev) => prev.map(
|
|
17544
|
+
(guide) => guide.id === guideId ? {
|
|
17545
|
+
...guide,
|
|
17546
|
+
position: guide.axis === "h" ? Math.max(0, Math.min(canvasSize.height, position)) : Math.max(0, Math.min(canvasSize.width, position))
|
|
17547
|
+
} : guide
|
|
17548
|
+
)
|
|
17549
|
+
);
|
|
17550
|
+
},
|
|
17551
|
+
onDeleteGuide: (guideId) => {
|
|
17552
|
+
s.setGuides((prev) => prev.filter((guide) => guide.id !== guideId));
|
|
17553
|
+
},
|
|
17554
|
+
onCreateGuideFromRuler: (axis, positionPx) => {
|
|
17555
|
+
s.setGuides((prev) => [
|
|
17556
|
+
...prev,
|
|
17557
|
+
{
|
|
17558
|
+
id: `guide-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
|
17559
|
+
axis,
|
|
17560
|
+
position: positionPx
|
|
17561
|
+
}
|
|
17562
|
+
]);
|
|
17563
|
+
}
|
|
17564
|
+
};
|
|
17565
|
+
}
|
|
17566
|
+
|
|
17567
|
+
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
17568
|
+
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
17569
|
+
if (!activeSlide?.layoutPath) {
|
|
17570
|
+
return options;
|
|
17571
|
+
}
|
|
17572
|
+
const hasAnyMasterInfo = options.some((o) => o.masterPath);
|
|
17573
|
+
if (!hasAnyMasterInfo) {
|
|
17574
|
+
return options;
|
|
17575
|
+
}
|
|
17576
|
+
const activeOption = options.find((o) => o.path === activeSlide.layoutPath);
|
|
17577
|
+
const activeMaster = activeOption?.masterPath;
|
|
17578
|
+
if (!activeMaster) {
|
|
17579
|
+
return options;
|
|
17580
|
+
}
|
|
17581
|
+
const scoped = options.filter((o) => o.masterPath === activeMaster);
|
|
17582
|
+
const seen = /* @__PURE__ */ new Map();
|
|
17583
|
+
for (const opt of scoped) {
|
|
17584
|
+
const isActive = opt.path === activeSlide.layoutPath;
|
|
17585
|
+
const existing = seen.get(opt.name);
|
|
17586
|
+
if (!existing || isActive) {
|
|
17587
|
+
seen.set(opt.name, opt);
|
|
17588
|
+
}
|
|
17589
|
+
}
|
|
17590
|
+
const chosen = new Set(Array.from(seen.values()).map((o) => o.path));
|
|
17591
|
+
const result = [];
|
|
17592
|
+
const usedNames = /* @__PURE__ */ new Set();
|
|
17593
|
+
for (const opt of scoped) {
|
|
17594
|
+
if (!chosen.has(opt.path)) {
|
|
17595
|
+
continue;
|
|
17596
|
+
}
|
|
17597
|
+
if (usedNames.has(opt.name)) {
|
|
17598
|
+
continue;
|
|
17599
|
+
}
|
|
17600
|
+
usedNames.add(opt.name);
|
|
17601
|
+
result.push(opt);
|
|
17602
|
+
}
|
|
17603
|
+
return result;
|
|
17604
|
+
}
|
|
17605
|
+
|
|
17606
|
+
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
17607
|
+
function buildToolbarAnimationHandlers(input) {
|
|
17608
|
+
const { selectedElement, activeSlide, propertyHandlers, ops, history } = input;
|
|
17609
|
+
const handleAddAnimation = (preset, group) => {
|
|
17610
|
+
if (!selectedElement || !activeSlide) {
|
|
17611
|
+
return;
|
|
17612
|
+
}
|
|
17613
|
+
const current = activeSlide.animations ?? [];
|
|
17614
|
+
const existing = current.find((a) => a.elementId === selectedElement.id);
|
|
17615
|
+
const presetValue = preset;
|
|
17616
|
+
if (existing) {
|
|
17617
|
+
const updated = current.map(
|
|
17618
|
+
(a) => a.elementId === selectedElement.id ? { ...a, [group]: presetValue } : a
|
|
17619
|
+
);
|
|
17620
|
+
propertyHandlers.handleUpdateSlide({ animations: updated });
|
|
17621
|
+
} else {
|
|
17622
|
+
const newAnim = {
|
|
17623
|
+
elementId: selectedElement.id,
|
|
17624
|
+
[group]: presetValue,
|
|
17625
|
+
durationMs: 500,
|
|
17626
|
+
order: current.length,
|
|
17627
|
+
trigger: "onClick"
|
|
17628
|
+
};
|
|
17629
|
+
propertyHandlers.handleUpdateSlide({ animations: [...current, newAnim] });
|
|
17630
|
+
}
|
|
17631
|
+
};
|
|
17632
|
+
const handleRemoveAnimation = () => {
|
|
17633
|
+
if (!selectedElement || !activeSlide) {
|
|
17634
|
+
return;
|
|
17635
|
+
}
|
|
17636
|
+
const current = activeSlide.animations ?? [];
|
|
17637
|
+
const filtered = current.filter((a) => a.elementId !== selectedElement.id);
|
|
17638
|
+
propertyHandlers.handleUpdateSlide({ animations: filtered });
|
|
17639
|
+
};
|
|
17640
|
+
const handleTransitionChange = (updates) => {
|
|
17641
|
+
if (!activeSlide) {
|
|
17642
|
+
return;
|
|
17643
|
+
}
|
|
17644
|
+
const current = activeSlide.transition ?? { type: "none" };
|
|
17645
|
+
propertyHandlers.handleUpdateSlide({ transition: { ...current, ...updates } });
|
|
17646
|
+
};
|
|
17647
|
+
const handleApplyTransitionToAll = () => {
|
|
17648
|
+
const transition = activeSlide?.transition;
|
|
17649
|
+
if (!transition) {
|
|
17650
|
+
return;
|
|
17651
|
+
}
|
|
17652
|
+
ops.updateSlides((prev) => prev.map((sl) => ({ ...sl, transition })));
|
|
17653
|
+
history.markDirty();
|
|
17654
|
+
};
|
|
17655
|
+
return {
|
|
17656
|
+
handleAddAnimation,
|
|
17657
|
+
handleRemoveAnimation,
|
|
17658
|
+
handleTransitionChange,
|
|
17659
|
+
handleApplyTransitionToAll
|
|
17660
|
+
};
|
|
17661
|
+
}
|
|
17662
|
+
|
|
17663
|
+
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-props.ts
|
|
17664
|
+
function buildToolbarProps(input) {
|
|
17665
|
+
const {
|
|
17666
|
+
mode,
|
|
17667
|
+
canEdit,
|
|
17668
|
+
state: s,
|
|
17669
|
+
selectedElement,
|
|
17670
|
+
activeSlide,
|
|
17671
|
+
zoom,
|
|
17672
|
+
history,
|
|
17673
|
+
findReplace,
|
|
17674
|
+
manipulation,
|
|
17675
|
+
insertHandlers,
|
|
17676
|
+
exportHandlers,
|
|
17677
|
+
printHandlers,
|
|
17678
|
+
propertyHandlers,
|
|
17679
|
+
dialogs,
|
|
17680
|
+
slideOps,
|
|
17681
|
+
ops,
|
|
17682
|
+
onSetMode,
|
|
17683
|
+
onEnterPresenterView,
|
|
17684
|
+
onEnterRehearsalMode,
|
|
17685
|
+
onOpenSettings,
|
|
17686
|
+
onOpenHeaderFooter,
|
|
17687
|
+
onOpenShareDialog,
|
|
17688
|
+
onOpenFile,
|
|
17689
|
+
onOpenRecentFile,
|
|
17690
|
+
fileName,
|
|
17691
|
+
hiddenActions
|
|
17692
|
+
} = input;
|
|
17693
|
+
const {
|
|
17694
|
+
handleAddAnimation,
|
|
17695
|
+
handleRemoveAnimation,
|
|
17696
|
+
handleTransitionChange,
|
|
17697
|
+
handleApplyTransitionToAll
|
|
17698
|
+
} = buildToolbarAnimationHandlers({
|
|
17699
|
+
selectedElement,
|
|
17700
|
+
activeSlide,
|
|
17701
|
+
propertyHandlers,
|
|
17702
|
+
ops,
|
|
17703
|
+
history
|
|
17704
|
+
});
|
|
17705
|
+
const scopedLayoutOptions = scopeLayoutOptionsToActiveSlide(s.layoutOptions, activeSlide);
|
|
17706
|
+
return {
|
|
17707
|
+
fileName,
|
|
17708
|
+
mode,
|
|
17709
|
+
canEdit,
|
|
17710
|
+
isNarrowViewport: dialogs.isNarrowViewport,
|
|
17711
|
+
isSidebarCollapsed: !s.isSlidesPaneOpen,
|
|
17712
|
+
isInspectorPaneOpen: s.isInspectorPaneOpen,
|
|
17713
|
+
isCompactToolbarOpen: s.isCompactToolbarOpen,
|
|
17714
|
+
toolbarSection: s.toolbarSection,
|
|
17715
|
+
scale: zoom.scale,
|
|
17716
|
+
canUndo: history.canUndo,
|
|
17717
|
+
canRedo: history.canRedo,
|
|
17718
|
+
undoLabel: history.undoLabel,
|
|
17719
|
+
redoLabel: history.redoLabel,
|
|
17720
|
+
findReplaceOpen: findReplace.findReplaceOpen,
|
|
17721
|
+
selectedElement,
|
|
17722
|
+
tableEditorState: s.tableEditorState,
|
|
17723
|
+
editTemplateMode: s.editTemplateMode,
|
|
17724
|
+
newShapeType: s.newShapeType,
|
|
17725
|
+
activeTool: s.activeTool,
|
|
17726
|
+
drawingColor: s.drawingColor,
|
|
17727
|
+
drawingWidth: s.drawingWidth,
|
|
17728
|
+
clipboardPayload: s.clipboardPayload,
|
|
17729
|
+
onSetMode,
|
|
17730
|
+
onToggleSidebar: () => s.setIsSlidesPaneOpen((p) => !p),
|
|
17731
|
+
onToggleInspector: () => s.setIsInspectorPaneOpen((p) => !p),
|
|
17732
|
+
onOpenAnimationPanel: () => {
|
|
17733
|
+
s.setIsInspectorPaneOpen(true);
|
|
17734
|
+
s.setSidebarPanelMode("properties");
|
|
17735
|
+
},
|
|
17736
|
+
onAddAnimation: handleAddAnimation,
|
|
17737
|
+
onRemoveAnimation: handleRemoveAnimation,
|
|
17738
|
+
onToggleCompactToolbar: () => s.setIsCompactToolbarOpen((p) => !p),
|
|
17739
|
+
onSetToolbarSection: s.setToolbarSection,
|
|
17740
|
+
onZoomIn: zoom.handleZoomIn,
|
|
17741
|
+
onZoomOut: zoom.handleZoomOut,
|
|
17742
|
+
onZoomToFit: zoom.handleZoomToFit,
|
|
17743
|
+
onUndo: history.handleUndo,
|
|
17744
|
+
onRedo: history.handleRedo,
|
|
17745
|
+
onToggleFindReplace: () => findReplace.setFindReplaceOpen(!findReplace.findReplaceOpen),
|
|
17746
|
+
onSetNewShapeType: s.setNewShapeType,
|
|
17747
|
+
onAddTextBox: insertHandlers.handleAddTextBox,
|
|
17748
|
+
onAddShape: insertHandlers.handleAddShape,
|
|
17749
|
+
onAddTable: insertHandlers.handleAddTable,
|
|
17750
|
+
onAddChart: insertHandlers.handleAddChart,
|
|
17751
|
+
onAddSmartArt: () => dialogs.setIsSmartArtDialogOpen(true),
|
|
17752
|
+
onAddEquation: () => {
|
|
17753
|
+
dialogs.setEditingEquationOmml(null);
|
|
17754
|
+
dialogs.setIsEquationDialogOpen(true);
|
|
17755
|
+
},
|
|
17756
|
+
onAddActionButton: insertHandlers.handleAddActionButton,
|
|
17757
|
+
onInsertField: insertHandlers.handleInsertField,
|
|
17758
|
+
onOpenHeaderFooter,
|
|
17759
|
+
onOpenImagePicker: () => s.imageInputRef.current?.click(),
|
|
17760
|
+
onOpenMediaPicker: () => s.mediaInputRef.current?.click(),
|
|
17761
|
+
onSetActiveTool: s.setActiveTool,
|
|
17762
|
+
onSetDrawingColor: s.setDrawingColor,
|
|
17763
|
+
onSetDrawingWidth: s.setDrawingWidth,
|
|
17764
|
+
onSetEditTemplateMode: s.setEditTemplateMode,
|
|
17765
|
+
spellCheckEnabled: s.spellCheckEnabled,
|
|
17766
|
+
showGrid: s.showGrid,
|
|
17767
|
+
showRulers: s.showRulers,
|
|
17768
|
+
snapToGrid: s.snapToGrid,
|
|
17769
|
+
snapToShape: s.snapToShape,
|
|
17770
|
+
onSetSpellCheckEnabled: s.setSpellCheckEnabled,
|
|
17771
|
+
onSetShowGrid: s.setShowGrid,
|
|
17772
|
+
onSetShowRulers: s.setShowRulers,
|
|
17773
|
+
onSetSnapToGrid: s.setSnapToGrid,
|
|
17774
|
+
onSetSnapToShape: s.setSnapToShape,
|
|
17775
|
+
onAddGuide: dialogs.handleAddGuide,
|
|
17776
|
+
onAlignElements: manipulation.handleAlignElements,
|
|
17777
|
+
onDistributeElements: manipulation.handleDistributeElements,
|
|
17778
|
+
canDistribute: manipulation.canDistribute,
|
|
17779
|
+
onCopy: manipulation.handleCopy,
|
|
17780
|
+
onCut: manipulation.handleCut,
|
|
17781
|
+
onPaste: manipulation.handlePaste,
|
|
17782
|
+
onFlip: manipulation.handleFlip,
|
|
17783
|
+
onMoveLayer: manipulation.handleMoveLayer,
|
|
17784
|
+
onMoveLayerToEdge: manipulation.handleMoveLayerToEdge,
|
|
17785
|
+
onDuplicate: manipulation.handleDuplicate,
|
|
17786
|
+
onDelete: manipulation.handleDelete,
|
|
17787
|
+
onExportPng: exportHandlers.handleExportPng,
|
|
17788
|
+
onExportPdf: exportHandlers.handleExportPdf,
|
|
17789
|
+
onExportVideo: exportHandlers.handleExportVideo,
|
|
17790
|
+
onExportGif: exportHandlers.handleExportGif,
|
|
17791
|
+
onPackageForSharing: exportHandlers.handlePackageForSharing,
|
|
17792
|
+
onOpenFile,
|
|
17793
|
+
onOpenRecentFile,
|
|
17794
|
+
onCreatePresentation: (templateId) => {
|
|
17795
|
+
s.setSlides(chunkI5SO5OV4_js.createBackstagePresentation(templateId));
|
|
17796
|
+
s.setActiveSlideIndex(0);
|
|
17797
|
+
s.setSelectedElementId(null);
|
|
17798
|
+
s.setSelectedElementIds([]);
|
|
17799
|
+
s.setTemplateElementsBySlideId({});
|
|
17800
|
+
s.setIsDirty(true);
|
|
17801
|
+
},
|
|
17802
|
+
onOpenShareDialog,
|
|
17803
|
+
onSaveAsPptx: exportHandlers.handleSaveAsPptx,
|
|
17804
|
+
onSaveAsPpsx: exportHandlers.handleSaveAsPpsx,
|
|
17805
|
+
onSaveAsPptm: exportHandlers.handleSaveAsPptm,
|
|
17806
|
+
hasMacros: s.hasMacros,
|
|
17807
|
+
onCopySlideAsImage: exportHandlers.handleCopySlideAsImage,
|
|
17808
|
+
onPrint: printHandlers.handlePrint,
|
|
17809
|
+
onToggleShortcuts: () => s.setIsShortcutHelpOpen((p) => !p),
|
|
17810
|
+
onOpenSettings,
|
|
17811
|
+
onRunAccessibilityCheck: dialogs.handleRunAccessibilityCheck,
|
|
17812
|
+
onToggleSlideSorter: () => s.setShowSlideSorter((p) => !p),
|
|
17813
|
+
onUpdateTextStyle: ops.updateSelectedTextStyle,
|
|
17814
|
+
onTransformTextCase: ops.updateSelectedTextCase,
|
|
17815
|
+
isOverflowMenuOpen: s.isOverflowMenuOpen,
|
|
17816
|
+
onSetOverflowMenuOpen: s.setIsOverflowMenuOpen,
|
|
17817
|
+
layoutOptions: scopedLayoutOptions,
|
|
17818
|
+
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
17819
|
+
customShows: s.customShows,
|
|
17820
|
+
activeCustomShowId: s.activeCustomShowId,
|
|
17821
|
+
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
17822
|
+
onCreateCustomShow: dialogs.handleCreateCustomShow,
|
|
17823
|
+
onRenameActiveCustomShow: dialogs.handleRenameActiveCustomShow,
|
|
17824
|
+
onDeleteActiveCustomShow: dialogs.handleDeleteActiveCustomShow,
|
|
17825
|
+
onToggleCurrentSlideInActiveShow: dialogs.handleToggleCurrentSlideInActiveShow,
|
|
17826
|
+
isCurrentSlideInActiveShow: dialogs.isCurrentSlideInActiveShow,
|
|
17827
|
+
onEnterMasterView: dialogs.handleEnterMasterView,
|
|
17828
|
+
onCloseMasterView: dialogs.handleCloseMasterView,
|
|
17829
|
+
onToggleVersionHistory: () => propertyHandlers.setIsVersionHistoryOpen((p) => !p),
|
|
17830
|
+
onOpenPasswordProtection: () => dialogs.setIsPasswordDialogOpen(true),
|
|
17831
|
+
onOpenDocumentProperties: () => dialogs.setIsDocPropsDialogOpen(true),
|
|
17832
|
+
onOpenFontEmbedding: () => dialogs.setIsFontEmbeddingOpen(true),
|
|
17833
|
+
onOpenDigitalSignatures: () => dialogs.setIsDigitalSigDialogOpen(true),
|
|
17834
|
+
onEnterPresenterView,
|
|
17835
|
+
onEnterRehearsalMode,
|
|
17836
|
+
onToggleThemeEditor: () => s.setIsThemeEditorOpen((p) => !p),
|
|
17837
|
+
isThemeEditorOpen: s.isThemeEditorOpen,
|
|
17838
|
+
onToggleThemeGallery: () => s.setIsThemeGalleryOpen((p) => !p),
|
|
17839
|
+
isThemeGalleryOpen: s.isThemeGalleryOpen,
|
|
17840
|
+
onCompare: propertyHandlers.handleCompare,
|
|
17841
|
+
onToggleComments: () => {
|
|
17842
|
+
s.setSidebarPanelMode("comments");
|
|
17843
|
+
if (!s.isInspectorPaneOpen) {
|
|
17844
|
+
s.setIsInspectorPaneOpen(true);
|
|
17845
|
+
}
|
|
17846
|
+
},
|
|
17847
|
+
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
17848
|
+
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
17849
|
+
formatPainterActive: s.formatPainterActive,
|
|
17850
|
+
canActivateFormatPainter: chunkI5SO5OV4_js.hasCopyableFormat(selectedElement),
|
|
17851
|
+
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
17852
|
+
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
17853
|
+
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
17854
|
+
eyedropperActive: s.eyedropperActive,
|
|
17855
|
+
onToggleEyedropper: () => s.setEyedropperActive((p) => !p),
|
|
17856
|
+
onOpenSetUpSlideShow: () => dialogs.setIsSetUpSlideShowOpen(true),
|
|
17857
|
+
onOpenBroadcastDialog: () => dialogs.setIsBroadcastDialogOpen(true),
|
|
17858
|
+
onToggleSubtitles: dialogs.handleToggleSubtitles,
|
|
17859
|
+
showSubtitles: Boolean(s.presentationProperties.showSubtitles),
|
|
17860
|
+
activeSlide,
|
|
17861
|
+
onTransitionChange: handleTransitionChange,
|
|
17862
|
+
onApplyTransitionToAll: handleApplyTransitionToAll,
|
|
17863
|
+
hiddenActions
|
|
17864
|
+
};
|
|
17865
|
+
}
|
|
17866
|
+
function useViewerBuildingBlocksCore(input) {
|
|
17867
|
+
const { content} = input;
|
|
17868
|
+
const state = useViewerState();
|
|
17869
|
+
const {
|
|
17870
|
+
containerRef,
|
|
17871
|
+
mode,
|
|
17872
|
+
slides,
|
|
17873
|
+
canvasSize,
|
|
17874
|
+
loading,
|
|
17875
|
+
error,
|
|
17876
|
+
activeSlideIndex,
|
|
17877
|
+
selectedElementId,
|
|
17878
|
+
selectedElementIds,
|
|
17879
|
+
templateElementsBySlideId,
|
|
17880
|
+
activeSlide,
|
|
17881
|
+
selectedElement
|
|
17882
|
+
} = state;
|
|
17883
|
+
const hasActivePointerInteraction = React3.useCallback(
|
|
17884
|
+
() => Boolean(
|
|
17885
|
+
state.dragStateRef.current || state.resizeStateRef.current || state.marqueeStateRef.current || state.shapeAdjustmentDragStateRef.current || state.isDrawingRef.current
|
|
17886
|
+
),
|
|
17887
|
+
[
|
|
17888
|
+
state.dragStateRef,
|
|
17889
|
+
state.resizeStateRef,
|
|
17890
|
+
state.marqueeStateRef,
|
|
17891
|
+
state.shapeAdjustmentDragStateRef,
|
|
17892
|
+
state.isDrawingRef
|
|
17893
|
+
]
|
|
17894
|
+
);
|
|
17895
|
+
const zoom = useZoomViewport({ canvasSize, selectedElements: state.selectedElements });
|
|
17896
|
+
const history = useEditorHistory({
|
|
17897
|
+
slides,
|
|
17898
|
+
canvasSize,
|
|
17899
|
+
activeSlideIndex,
|
|
17900
|
+
templateElementsBySlideId,
|
|
17901
|
+
editTemplateMode: state.editTemplateMode,
|
|
17902
|
+
headerFooter: state.headerFooter,
|
|
17903
|
+
loading,
|
|
17904
|
+
error,
|
|
17905
|
+
hasActivePointerInteraction,
|
|
17906
|
+
pointerCommitNonce: state.pointerCommitNonce,
|
|
17907
|
+
setSlides: state.setSlides,
|
|
17908
|
+
setCanvasSize: state.setCanvasSize,
|
|
17909
|
+
setActiveSlideIndex: state.setActiveSlideIndex,
|
|
17910
|
+
setTemplateElementsBySlideId: state.setTemplateElementsBySlideId,
|
|
17911
|
+
setSelectedElementId: state.setSelectedElementId,
|
|
17912
|
+
setSelectedElementIds: state.setSelectedElementIds,
|
|
17913
|
+
setEditTemplateMode: state.setEditTemplateMode,
|
|
17914
|
+
setHeaderFooter: state.setHeaderFooter
|
|
17915
|
+
});
|
|
17916
|
+
const { gridSpacingPx, visibleSlideIndexes, masterPseudoSlide } = useDerivedSlideState({
|
|
17917
|
+
slides,
|
|
17918
|
+
sections: state.sections,
|
|
17919
|
+
customShows: state.customShows,
|
|
17920
|
+
activeCustomShowId: state.activeCustomShowId,
|
|
17921
|
+
mode,
|
|
17922
|
+
activeLayout: state.activeLayout,
|
|
17923
|
+
activeMaster: state.activeMaster,
|
|
17924
|
+
presentationGridSpacing: state.presentationProperties.gridSpacing
|
|
17925
|
+
});
|
|
17926
|
+
const { presentation, annotations, actionSoundHandlerRef } = usePresentationSetup({
|
|
17927
|
+
mode,
|
|
17928
|
+
slides,
|
|
17929
|
+
visibleSlideIndexes,
|
|
17930
|
+
activeSlideIndex,
|
|
17931
|
+
containerRef,
|
|
17932
|
+
content,
|
|
17933
|
+
mediaDataUrls: state.mediaDataUrls,
|
|
17934
|
+
presentationProperties: state.presentationProperties,
|
|
17935
|
+
setMode: state.setMode,
|
|
17936
|
+
setActiveSlideIndex: state.setActiveSlideIndex,
|
|
17937
|
+
setSlides: state.setSlides,
|
|
17938
|
+
history
|
|
17939
|
+
});
|
|
17940
|
+
return {
|
|
17941
|
+
state,
|
|
17942
|
+
mode,
|
|
17943
|
+
slides,
|
|
17944
|
+
loading,
|
|
17945
|
+
error,
|
|
17946
|
+
activeSlideIndex,
|
|
17947
|
+
activeSlide,
|
|
17948
|
+
selectedElement,
|
|
17949
|
+
zoom,
|
|
17950
|
+
history,
|
|
17951
|
+
presentation,
|
|
17952
|
+
annotations,
|
|
17953
|
+
actionSoundHandlerRef,
|
|
17954
|
+
masterPseudoSlide,
|
|
17955
|
+
gridSpacingPx
|
|
17956
|
+
};
|
|
17957
|
+
}
|
|
17958
|
+
function useViewerBuildingBlocksState(input) {
|
|
17959
|
+
const { core, content, canEdit, filePath, autosaveEnabled, userName, handle, setContent } = input;
|
|
17960
|
+
const {
|
|
17961
|
+
onContentChange,
|
|
17962
|
+
onDirtyChange,
|
|
17963
|
+
onActiveSlideChange,
|
|
17964
|
+
onModeChange,
|
|
17965
|
+
onZoomChange,
|
|
17966
|
+
onSelectionChange,
|
|
17967
|
+
onSlideCountChange
|
|
17968
|
+
} = input;
|
|
17969
|
+
const {
|
|
17970
|
+
state,
|
|
17971
|
+
mode,
|
|
17972
|
+
slides,
|
|
17973
|
+
loading,
|
|
17974
|
+
error,
|
|
17975
|
+
activeSlideIndex,
|
|
17976
|
+
activeSlide,
|
|
17977
|
+
selectedElement,
|
|
17978
|
+
zoom,
|
|
17979
|
+
history,
|
|
17980
|
+
presentation,
|
|
17981
|
+
annotations,
|
|
17982
|
+
actionSoundHandlerRef,
|
|
17983
|
+
gridSpacingPx
|
|
17984
|
+
} = core;
|
|
17985
|
+
const dialogs = useViewerDialogs({
|
|
17986
|
+
mode,
|
|
17987
|
+
slides,
|
|
17988
|
+
activeSlide,
|
|
17989
|
+
canvasSize: state.canvasSize,
|
|
17990
|
+
containerRef: state.containerRef,
|
|
17991
|
+
customShows: state.customShows,
|
|
17992
|
+
activeCustomShowId: state.activeCustomShowId,
|
|
17993
|
+
setCustomShows: state.setCustomShows,
|
|
17994
|
+
setActiveCustomShowId: state.setActiveCustomShowId,
|
|
17995
|
+
setGuides: state.setGuides,
|
|
17996
|
+
setPresentationProperties: state.setPresentationProperties,
|
|
17997
|
+
setAccessibilityIssues: state.setAccessibilityIssues,
|
|
17998
|
+
setIsAccessibilityPanelOpen: state.setIsAccessibilityPanelOpen,
|
|
17999
|
+
setMode: state.setMode,
|
|
18000
|
+
setPreMasterMode: state.setPreMasterMode,
|
|
18001
|
+
setActiveMasterIndex: state.setActiveMasterIndex,
|
|
18002
|
+
setActiveLayoutIndex: state.setActiveLayoutIndex,
|
|
18003
|
+
setSelectedElementId: state.setSelectedElementId,
|
|
18004
|
+
setSelectedElementIds: state.setSelectedElementIds,
|
|
18005
|
+
preMasterMode: state.preMasterMode,
|
|
18006
|
+
hasDigitalSignatures: state.hasDigitalSignatures,
|
|
18007
|
+
isDirty: state.isDirty,
|
|
18008
|
+
history
|
|
18009
|
+
});
|
|
18010
|
+
React3.useEffect(() => {
|
|
18011
|
+
state.setSelectedElementId(null);
|
|
18012
|
+
state.setSelectedElementIds([]);
|
|
18013
|
+
state.setInlineEditingElementId(null);
|
|
18014
|
+
}, [activeSlideIndex]);
|
|
18015
|
+
const editorOps = useEditorOperations({
|
|
18016
|
+
state,
|
|
18017
|
+
history,
|
|
18018
|
+
zoom,
|
|
18019
|
+
mode,
|
|
18020
|
+
canEdit,
|
|
18021
|
+
slides,
|
|
18022
|
+
activeSlide,
|
|
18023
|
+
activeSlideIndex,
|
|
18024
|
+
selectedElement,
|
|
18025
|
+
selectedElementId: state.selectedElementId,
|
|
18026
|
+
selectedElementIds: state.selectedElementIds,
|
|
18027
|
+
canvasSize: state.canvasSize,
|
|
18028
|
+
dialogs,
|
|
18029
|
+
presentation,
|
|
18030
|
+
userName,
|
|
18031
|
+
handlerRef: actionSoundHandlerRef
|
|
18032
|
+
});
|
|
18033
|
+
const {
|
|
18034
|
+
exportHandlers,
|
|
18035
|
+
printHandlers,
|
|
18036
|
+
propertyHandlers,
|
|
18037
|
+
handleSetMode,
|
|
18038
|
+
handleEnterPresenterView,
|
|
18039
|
+
handleEnterRehearsalMode,
|
|
18040
|
+
autosaveStatus
|
|
18041
|
+
} = useViewerIntegration({
|
|
18042
|
+
state,
|
|
18043
|
+
zoom,
|
|
18044
|
+
history,
|
|
18045
|
+
presentation,
|
|
18046
|
+
annotations,
|
|
18047
|
+
actionSoundHandlerRef,
|
|
18048
|
+
editorOps,
|
|
18049
|
+
dialogs,
|
|
18050
|
+
gridSpacingPx,
|
|
18051
|
+
content,
|
|
18052
|
+
filePath,
|
|
18053
|
+
autosaveEnabled,
|
|
18054
|
+
canEdit,
|
|
18055
|
+
mode,
|
|
18056
|
+
slides,
|
|
18057
|
+
activeSlide,
|
|
18058
|
+
activeSlideIndex,
|
|
18059
|
+
canvasSize: state.canvasSize,
|
|
18060
|
+
loading,
|
|
18061
|
+
error,
|
|
18062
|
+
ref: handle ?? null,
|
|
18063
|
+
setContent,
|
|
18064
|
+
onContentChange,
|
|
18065
|
+
onDirtyChange,
|
|
18066
|
+
onActiveSlideChange,
|
|
18067
|
+
onModeChange,
|
|
18068
|
+
onZoomChange,
|
|
18069
|
+
onSelectionChange,
|
|
18070
|
+
onSlideCountChange
|
|
18071
|
+
});
|
|
18072
|
+
return {
|
|
18073
|
+
dialogs,
|
|
18074
|
+
editorOps,
|
|
18075
|
+
exportHandlers,
|
|
18076
|
+
printHandlers,
|
|
18077
|
+
propertyHandlers,
|
|
18078
|
+
handleSetMode,
|
|
18079
|
+
handleEnterPresenterView,
|
|
18080
|
+
handleEnterRehearsalMode,
|
|
18081
|
+
autosaveStatus
|
|
18082
|
+
};
|
|
18083
|
+
}
|
|
18084
|
+
|
|
18085
|
+
// src/viewer/hooks/useViewerBuildingBlocks.ts
|
|
18086
|
+
function useViewerBuildingBlocks(input) {
|
|
18087
|
+
const {
|
|
18088
|
+
content: incomingContent,
|
|
18089
|
+
canEdit = false,
|
|
18090
|
+
filePath,
|
|
18091
|
+
fileName,
|
|
18092
|
+
autosaveEnabled = true,
|
|
18093
|
+
userName,
|
|
18094
|
+
hiddenActions,
|
|
18095
|
+
handle,
|
|
18096
|
+
onContentChange,
|
|
18097
|
+
onDirtyChange,
|
|
18098
|
+
onActiveSlideChange,
|
|
18099
|
+
onModeChange,
|
|
18100
|
+
onZoomChange,
|
|
18101
|
+
onSelectionChange,
|
|
18102
|
+
onSlideCountChange,
|
|
18103
|
+
onOpenSettings,
|
|
18104
|
+
onOpenHeaderFooter,
|
|
18105
|
+
onOpenShareDialog
|
|
18106
|
+
} = input;
|
|
18107
|
+
const [content, setContent] = React3.useState(incomingContent ?? null);
|
|
18108
|
+
React3.useEffect(() => {
|
|
18109
|
+
setContent(incomingContent ?? null);
|
|
18110
|
+
}, [incomingContent]);
|
|
18111
|
+
const onOpenFile = React3.useCallback(() => {
|
|
18112
|
+
void (async () => {
|
|
18113
|
+
const picked = await chunkI5SO5OV4_js.openPptxFile();
|
|
18114
|
+
if (picked) {
|
|
18115
|
+
setContent(picked.buffer);
|
|
18116
|
+
}
|
|
18117
|
+
})();
|
|
18118
|
+
}, []);
|
|
18119
|
+
const onOpenRecentFile = React3.useCallback((key) => {
|
|
18120
|
+
void (async () => {
|
|
18121
|
+
const bytes = await chunkI5SO5OV4_js.readBackstageRecentFile(key);
|
|
18122
|
+
if (bytes) {
|
|
18123
|
+
setContent(bytes);
|
|
18124
|
+
}
|
|
18125
|
+
})();
|
|
18126
|
+
}, []);
|
|
18127
|
+
const core = useViewerBuildingBlocksCore({ content});
|
|
18128
|
+
const {
|
|
18129
|
+
state,
|
|
18130
|
+
mode,
|
|
18131
|
+
slides,
|
|
18132
|
+
loading,
|
|
18133
|
+
error,
|
|
18134
|
+
activeSlideIndex,
|
|
18135
|
+
activeSlide,
|
|
18136
|
+
selectedElement,
|
|
18137
|
+
zoom,
|
|
18138
|
+
history,
|
|
18139
|
+
presentation,
|
|
18140
|
+
masterPseudoSlide,
|
|
18141
|
+
gridSpacingPx
|
|
18142
|
+
} = core;
|
|
18143
|
+
const {
|
|
18144
|
+
dialogs,
|
|
18145
|
+
editorOps,
|
|
18146
|
+
exportHandlers,
|
|
18147
|
+
printHandlers,
|
|
18148
|
+
propertyHandlers,
|
|
18149
|
+
handleSetMode,
|
|
18150
|
+
handleEnterPresenterView,
|
|
18151
|
+
handleEnterRehearsalMode,
|
|
18152
|
+
autosaveStatus
|
|
18153
|
+
} = useViewerBuildingBlocksState({
|
|
18154
|
+
core,
|
|
18155
|
+
content,
|
|
18156
|
+
canEdit,
|
|
18157
|
+
filePath,
|
|
18158
|
+
autosaveEnabled,
|
|
18159
|
+
userName,
|
|
18160
|
+
handle,
|
|
18161
|
+
setContent,
|
|
18162
|
+
onContentChange,
|
|
18163
|
+
onDirtyChange,
|
|
18164
|
+
onActiveSlideChange,
|
|
18165
|
+
onModeChange,
|
|
18166
|
+
onZoomChange,
|
|
18167
|
+
onSelectionChange,
|
|
18168
|
+
onSlideCountChange
|
|
18169
|
+
});
|
|
18170
|
+
const toolbarProps = buildToolbarProps({
|
|
18171
|
+
mode,
|
|
18172
|
+
canEdit,
|
|
18173
|
+
state,
|
|
18174
|
+
selectedElement,
|
|
18175
|
+
activeSlide,
|
|
18176
|
+
zoom,
|
|
18177
|
+
history,
|
|
18178
|
+
findReplace: editorOps.findReplace,
|
|
18179
|
+
manipulation: editorOps.manipulation,
|
|
18180
|
+
insertHandlers: editorOps.insertHandlers,
|
|
18181
|
+
exportHandlers,
|
|
18182
|
+
printHandlers,
|
|
18183
|
+
propertyHandlers,
|
|
18184
|
+
dialogs,
|
|
18185
|
+
slideOps: editorOps.slideOps,
|
|
18186
|
+
ops: editorOps.ops,
|
|
18187
|
+
onSetMode: handleSetMode,
|
|
18188
|
+
onEnterPresenterView: handleEnterPresenterView,
|
|
18189
|
+
onEnterRehearsalMode: handleEnterRehearsalMode,
|
|
18190
|
+
onOpenSettings,
|
|
18191
|
+
onOpenHeaderFooter,
|
|
18192
|
+
onOpenShareDialog,
|
|
18193
|
+
onOpenFile,
|
|
18194
|
+
onOpenRecentFile,
|
|
18195
|
+
fileName,
|
|
18196
|
+
hiddenActions
|
|
18197
|
+
});
|
|
18198
|
+
const canvasProps = buildCanvasProps({
|
|
18199
|
+
mode,
|
|
18200
|
+
canEdit,
|
|
18201
|
+
slides,
|
|
18202
|
+
activeSlide,
|
|
18203
|
+
masterPseudoSlide,
|
|
18204
|
+
templateElements: state.templateElements,
|
|
18205
|
+
canvasSize: state.canvasSize,
|
|
18206
|
+
activeSlideIndex,
|
|
18207
|
+
gridSpacingPx,
|
|
18208
|
+
zoom,
|
|
18209
|
+
state,
|
|
18210
|
+
selectedElement,
|
|
18211
|
+
canvasHandlers: editorOps.canvasHandlers,
|
|
18212
|
+
insertHandlers: editorOps.insertHandlers,
|
|
18213
|
+
tableOps: editorOps.tableOps,
|
|
18214
|
+
presentation,
|
|
18215
|
+
findResults: editorOps.findReplace.findResults,
|
|
18216
|
+
findResultIndex: editorOps.findReplace.findResultIndex
|
|
18217
|
+
});
|
|
18218
|
+
return { toolbarProps, canvasProps, mode, loading, error, autosaveStatus };
|
|
17405
18219
|
}
|
|
17406
18220
|
var LEFT_MIN = 120;
|
|
17407
18221
|
var LEFT_MAX = 400;
|
|
@@ -17545,6 +18359,7 @@ exports.renderVerticalChevronList = renderVerticalChevronList;
|
|
|
17545
18359
|
exports.resolvePalette = resolvePalette;
|
|
17546
18360
|
exports.resolveSmartArtDataPalette = resolveSmartArtDataPalette;
|
|
17547
18361
|
exports.resolveStyle = resolveStyle;
|
|
18362
|
+
exports.scopeLayoutOptionsToActiveSlide = scopeLayoutOptionsToActiveSlide;
|
|
17548
18363
|
exports.shouldRenderFallbackLabel = shouldRenderFallbackLabel;
|
|
17549
18364
|
exports.smartArtNodeGroupProps = smartArtNodeGroupProps;
|
|
17550
18365
|
exports.startPreviewAnimation = startPreviewAnimation;
|
|
@@ -17613,6 +18428,7 @@ exports.useThemeHandlers = useThemeHandlers;
|
|
|
17613
18428
|
exports.useThemeSwitching = useThemeSwitching;
|
|
17614
18429
|
exports.useToolbarVisibility = useToolbarVisibility;
|
|
17615
18430
|
exports.useTouchGestures = useTouchGestures;
|
|
18431
|
+
exports.useViewerBuildingBlocks = useViewerBuildingBlocks;
|
|
17616
18432
|
exports.useViewerCoreState = useViewerCoreState;
|
|
17617
18433
|
exports.useViewerDialogs = useViewerDialogs;
|
|
17618
18434
|
exports.useViewerIntegration = useViewerIntegration;
|