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