pptx-react-viewer 1.17.0 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +1 -1
- package/dist/{Model3DScene-YA4F63DT.js → Model3DScene-GVWQ6SOM.js} +3 -3
- package/dist/Model3DScene-GVWQ6SOM.js.br +0 -0
- package/dist/Model3DScene-GVWQ6SOM.js.gz +0 -0
- package/dist/{Model3DScene-QHDYQXL2.mjs → Model3DScene-JGVLIDLD.mjs} +2 -2
- package/dist/Model3DScene-JGVLIDLD.mjs.br +0 -0
- package/dist/Model3DScene-JGVLIDLD.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-GUAS2NWQ.mjs → SurfaceChart3DScene-DBWSDSKI.mjs} +2 -2
- package/dist/SurfaceChart3DScene-DBWSDSKI.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-DBWSDSKI.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-TGNJHTJQ.js → SurfaceChart3DScene-ZOTOHOIE.js} +3 -3
- package/dist/SurfaceChart3DScene-ZOTOHOIE.js.br +0 -0
- package/dist/SurfaceChart3DScene-ZOTOHOIE.js.gz +0 -0
- package/dist/{chunk-XW5OMXW6.js → chunk-73ST7AC6.js} +2269 -1651
- package/dist/chunk-73ST7AC6.js.br +0 -0
- package/dist/chunk-73ST7AC6.js.gz +0 -0
- package/dist/{chunk-WGLJ32FW.js → chunk-AALZCSY4.js} +8 -1
- package/dist/chunk-AALZCSY4.js.br +0 -0
- package/dist/chunk-AALZCSY4.js.gz +0 -0
- package/dist/{chunk-MGLRKGCH.js → chunk-EXDUEXTO.js} +26101 -15360
- package/dist/chunk-EXDUEXTO.js.br +0 -0
- package/dist/chunk-EXDUEXTO.js.gz +0 -0
- package/dist/{chunk-JWS3RQKN.js → chunk-HBXPK572.js} +584 -144
- package/dist/chunk-HBXPK572.js.br +0 -0
- package/dist/chunk-HBXPK572.js.gz +0 -0
- package/dist/{chunk-G22EWPLH.mjs → chunk-HHTZQHKZ.mjs} +532 -119
- package/dist/chunk-HHTZQHKZ.mjs.br +0 -0
- package/dist/chunk-HHTZQHKZ.mjs.gz +0 -0
- package/dist/{chunk-3P6O7ZDM.js → chunk-JDRC3PSY.js} +655 -491
- package/dist/chunk-JDRC3PSY.js.br +0 -0
- package/dist/chunk-JDRC3PSY.js.gz +0 -0
- package/dist/{chunk-LNSHC2Z5.mjs → chunk-KMLIWCNL.mjs} +1460 -842
- package/dist/chunk-KMLIWCNL.mjs.br +0 -0
- package/dist/chunk-KMLIWCNL.mjs.gz +0 -0
- package/dist/{chunk-HJQZJ3VE.mjs → chunk-RIRK64DM.mjs} +8 -1
- package/dist/chunk-RIRK64DM.mjs.br +0 -0
- package/dist/chunk-RIRK64DM.mjs.gz +0 -0
- package/dist/{chunk-XRYREYXC.mjs → chunk-SBNTEQUA.mjs} +26062 -15360
- package/dist/chunk-SBNTEQUA.mjs.br +0 -0
- package/dist/chunk-SBNTEQUA.mjs.gz +0 -0
- package/dist/{chunk-LLHFNGAF.mjs → chunk-Z4MDCPAY.mjs} +223 -59
- package/dist/chunk-Z4MDCPAY.mjs.br +0 -0
- package/dist/chunk-Z4MDCPAY.mjs.gz +0 -0
- package/dist/{dist-2ZAH7U6U.js → dist-KRRXYUGI.js} +663 -507
- package/dist/dist-KRRXYUGI.js.br +0 -0
- package/dist/dist-KRRXYUGI.js.gz +0 -0
- package/dist/dist-N6PAPXK6.mjs +2 -0
- package/dist/dist-N6PAPXK6.mjs.br +0 -0
- package/dist/dist-N6PAPXK6.mjs.gz +0 -0
- package/dist/hooks-unstable.d.ts +484 -117
- package/dist/hooks-unstable.d.ts.map +1 -1
- package/dist/hooks-unstable.js +75 -75
- package/dist/hooks-unstable.js.br +0 -0
- package/dist/hooks-unstable.js.gz +0 -0
- package/dist/hooks-unstable.mjs +4 -4
- package/dist/hooks-unstable.mjs.br +0 -0
- package/dist/hooks-unstable.mjs.gz +0 -0
- package/dist/i18n.js +3 -3
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/{index-XGt7MZpa.d.ts → index-DmHVR48M.d.ts} +25 -3
- package/dist/index-DmHVR48M.d.ts.map +1 -0
- package/dist/index.d.ts +412 -117
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -19
- package/dist/index.js.br +3 -1
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +3 -4
- package/dist/index.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/viewer/index.d.ts +438 -121
- package/dist/viewer/index.d.ts.map +1 -1
- package/dist/viewer/index.js +24 -20
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/Model3DScene-QHDYQXL2.mjs.br +0 -0
- package/dist/Model3DScene-QHDYQXL2.mjs.gz +0 -0
- package/dist/Model3DScene-YA4F63DT.js.br +0 -0
- package/dist/Model3DScene-YA4F63DT.js.gz +0 -0
- package/dist/SurfaceChart3DScene-GUAS2NWQ.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-GUAS2NWQ.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-TGNJHTJQ.js.br +0 -0
- package/dist/SurfaceChart3DScene-TGNJHTJQ.js.gz +0 -0
- package/dist/chunk-3P6O7ZDM.js.br +0 -0
- package/dist/chunk-3P6O7ZDM.js.gz +0 -0
- package/dist/chunk-G22EWPLH.mjs.br +0 -0
- package/dist/chunk-G22EWPLH.mjs.gz +0 -0
- package/dist/chunk-HJQZJ3VE.mjs.br +0 -0
- package/dist/chunk-HJQZJ3VE.mjs.gz +0 -0
- package/dist/chunk-JWS3RQKN.js.br +0 -0
- package/dist/chunk-JWS3RQKN.js.gz +0 -0
- package/dist/chunk-LLHFNGAF.mjs.br +0 -0
- package/dist/chunk-LLHFNGAF.mjs.gz +0 -0
- package/dist/chunk-LNSHC2Z5.mjs.br +0 -0
- package/dist/chunk-LNSHC2Z5.mjs.gz +0 -0
- package/dist/chunk-MGLRKGCH.js.br +0 -0
- package/dist/chunk-MGLRKGCH.js.gz +0 -0
- package/dist/chunk-WGLJ32FW.js.br +0 -0
- package/dist/chunk-WGLJ32FW.js.gz +0 -0
- package/dist/chunk-XRYREYXC.mjs.br +0 -0
- package/dist/chunk-XRYREYXC.mjs.gz +0 -0
- package/dist/chunk-XW5OMXW6.js.br +0 -0
- package/dist/chunk-XW5OMXW6.js.gz +0 -0
- package/dist/dist-2ZAH7U6U.js.br +0 -0
- package/dist/dist-2ZAH7U6U.js.gz +0 -0
- package/dist/dist-MXDC6YTS.mjs +0 -2
- package/dist/dist-MXDC6YTS.mjs.br +0 -0
- package/dist/dist-MXDC6YTS.mjs.gz +0 -0
- package/dist/index-XGt7MZpa.d.ts.map +0 -1
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkHBXPK572_js = require('./chunk-HBXPK572.js');
|
|
4
|
+
var chunkAALZCSY4_js = require('./chunk-AALZCSY4.js');
|
|
5
|
+
var chunkEXDUEXTO_js = require('./chunk-EXDUEXTO.js');
|
|
6
6
|
var React3 = require('react');
|
|
7
7
|
var lu = require('react-icons/lu');
|
|
8
8
|
var clsx = require('clsx');
|
|
9
9
|
var tailwindMerge = require('tailwind-merge');
|
|
10
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
11
|
var reactI18next = require('react-i18next');
|
|
12
|
-
var html2canvasPro = require('html2canvas-pro');
|
|
13
12
|
var JSZip = require('jszip');
|
|
14
13
|
|
|
15
14
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
15
|
|
|
17
16
|
var React3__default = /*#__PURE__*/_interopDefault(React3);
|
|
18
|
-
var html2canvasPro__default = /*#__PURE__*/_interopDefault(html2canvasPro);
|
|
19
17
|
var JSZip__default = /*#__PURE__*/_interopDefault(JSZip);
|
|
20
18
|
|
|
21
19
|
// src/viewer/utils/clone.ts
|
|
22
20
|
function cloneHistorySnapshot2(snapshot) {
|
|
23
|
-
return
|
|
21
|
+
return chunkHBXPK572_js.cloneHistorySnapshot(snapshot);
|
|
24
22
|
}
|
|
25
23
|
|
|
26
24
|
// src/viewer/hooks/useEditorHistory.ts
|
|
@@ -68,8 +66,8 @@ function useEditorHistory(input) {
|
|
|
68
66
|
width: canvasSize.width,
|
|
69
67
|
height: canvasSize.height,
|
|
70
68
|
activeSlideIndex,
|
|
71
|
-
slides: slides.map(
|
|
72
|
-
templateElementsBySlideId:
|
|
69
|
+
slides: slides.map(chunkHBXPK572_js.cloneSlide),
|
|
70
|
+
templateElementsBySlideId: chunkHBXPK572_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
73
71
|
...actionLabel ? { actionLabel } : {}
|
|
74
72
|
};
|
|
75
73
|
},
|
|
@@ -82,9 +80,9 @@ function useEditorHistory(input) {
|
|
|
82
80
|
width: snapshot.width,
|
|
83
81
|
height: snapshot.height
|
|
84
82
|
});
|
|
85
|
-
setSlides(snapshot.slides.map(
|
|
83
|
+
setSlides(snapshot.slides.map(chunkHBXPK572_js.cloneSlide));
|
|
86
84
|
setTemplateElementsBySlideId(
|
|
87
|
-
|
|
85
|
+
chunkHBXPK572_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
88
86
|
);
|
|
89
87
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
90
88
|
setSelectedElementIds([]);
|
|
@@ -347,7 +345,7 @@ var GLYPH_COMPONENTS = {
|
|
|
347
345
|
plus: lu.LuPlus,
|
|
348
346
|
triangle: lu.LuTriangle
|
|
349
347
|
};
|
|
350
|
-
var SHAPE_PRESETS =
|
|
348
|
+
var SHAPE_PRESETS = chunkHBXPK572_js.SHAPE_PRESET_DEFS.map(
|
|
351
349
|
(def) => ({
|
|
352
350
|
type: def.type,
|
|
353
351
|
label: def.label,
|
|
@@ -687,20 +685,20 @@ function useAnimationPlayback(input) {
|
|
|
687
685
|
for (const anim of nativeAnims) {
|
|
688
686
|
if (anim.buildType && anim.buildType !== "allAtOnce" && anim.targetId) {
|
|
689
687
|
const el = slide.elements.find((e) => e.id === anim.targetId);
|
|
690
|
-
if (el &&
|
|
691
|
-
segmentCounts.set(anim.targetId,
|
|
688
|
+
if (el && chunkEXDUEXTO_js.hasTextProperties(el) && el.textSegments && el.textSegments.length > 0) {
|
|
689
|
+
segmentCounts.set(anim.targetId, chunkHBXPK572_js.countTextSegments(el.textSegments));
|
|
692
690
|
}
|
|
693
691
|
}
|
|
694
692
|
}
|
|
695
|
-
const expandedAnims = segmentCounts.size > 0 ?
|
|
696
|
-
const engine =
|
|
693
|
+
const expandedAnims = segmentCounts.size > 0 ? chunkHBXPK572_js.expandTextBuildAnimations(nativeAnims, segmentCounts) : nativeAnims;
|
|
694
|
+
const engine = chunkHBXPK572_js.TimelineEngine.fromAnimations(expandedAnims);
|
|
697
695
|
timelineEngineRef.current = engine;
|
|
698
696
|
setPresentationKeyframesCss(engine.getTimeline().keyframesCss);
|
|
699
697
|
setInteractiveTriggerShapeIds(engine.getInteractiveTriggerShapeIds());
|
|
700
698
|
setHoverTriggerShapeIds(engine.getHoverTriggerShapeIds());
|
|
701
699
|
const allIds = slide.elements.map((element) => element.id);
|
|
702
700
|
for (const anim of expandedAnims) {
|
|
703
|
-
if (anim.targetId && anim.targetId.includes(
|
|
701
|
+
if (anim.targetId && anim.targetId.includes(chunkHBXPK572_js.TEXT_BUILD_ID_SEP)) {
|
|
704
702
|
allIds.push(anim.targetId);
|
|
705
703
|
}
|
|
706
704
|
}
|
|
@@ -887,7 +885,10 @@ function openDb() {
|
|
|
887
885
|
request.onerror = () => reject(request.error);
|
|
888
886
|
});
|
|
889
887
|
}
|
|
890
|
-
async function storeAudienceContent(content) {
|
|
888
|
+
async function storeAudienceContent(content, sessionId) {
|
|
889
|
+
if (sessionId) {
|
|
890
|
+
return chunkHBXPK572_js.storePresentationDeck(sessionId, content);
|
|
891
|
+
}
|
|
891
892
|
const db = await openDb();
|
|
892
893
|
return new Promise((resolve, reject) => {
|
|
893
894
|
const tx = db.transaction(STORE_NAME, "readwrite");
|
|
@@ -905,7 +906,10 @@ async function storeAudienceContent(content) {
|
|
|
905
906
|
};
|
|
906
907
|
});
|
|
907
908
|
}
|
|
908
|
-
async function loadAudienceContent() {
|
|
909
|
+
async function loadAudienceContent(sessionId) {
|
|
910
|
+
if (sessionId) {
|
|
911
|
+
return chunkHBXPK572_js.loadPresentationDeck(sessionId);
|
|
912
|
+
}
|
|
909
913
|
try {
|
|
910
914
|
const db = await openDb();
|
|
911
915
|
return new Promise((resolve, reject) => {
|
|
@@ -943,7 +947,10 @@ async function loadAudienceContent() {
|
|
|
943
947
|
return null;
|
|
944
948
|
}
|
|
945
949
|
}
|
|
946
|
-
async function clearAudienceContent() {
|
|
950
|
+
async function clearAudienceContent(sessionId) {
|
|
951
|
+
if (sessionId) {
|
|
952
|
+
return chunkHBXPK572_js.clearPresentationDeck(sessionId);
|
|
953
|
+
}
|
|
947
954
|
try {
|
|
948
955
|
const db = await openDb();
|
|
949
956
|
return new Promise((resolve) => {
|
|
@@ -962,12 +969,12 @@ async function clearAudienceContent() {
|
|
|
962
969
|
} catch {
|
|
963
970
|
}
|
|
964
971
|
}
|
|
965
|
-
var PRESENTER_CHANNEL_NAME =
|
|
966
|
-
var AUDIENCE_HASH =
|
|
967
|
-
var PRESENTER_MSG_ORIGIN =
|
|
968
|
-
var AUDIENCE_NONCE_KEY =
|
|
972
|
+
var PRESENTER_CHANNEL_NAME = chunkHBXPK572_js.PRESENTATION_CHANNEL_NAME;
|
|
973
|
+
var AUDIENCE_HASH = chunkHBXPK572_js.PRESENTATION_HASH;
|
|
974
|
+
var PRESENTER_MSG_ORIGIN = chunkHBXPK572_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
975
|
+
var AUDIENCE_NONCE_KEY = chunkHBXPK572_js.PRESENTATION_NONCE_KEY;
|
|
969
976
|
function generateSessionId() {
|
|
970
|
-
return
|
|
977
|
+
return chunkHBXPK572_js.createPresentationSessionId();
|
|
971
978
|
}
|
|
972
979
|
function parseAudienceNonce() {
|
|
973
980
|
const hash = window.location.hash;
|
|
@@ -985,11 +992,13 @@ function isAudienceTab() {
|
|
|
985
992
|
return window.location.hash.startsWith(AUDIENCE_HASH);
|
|
986
993
|
}
|
|
987
994
|
function usePresenterWindow(input) {
|
|
988
|
-
const {
|
|
995
|
+
const { isPresenterMode, content, snapshot } = input;
|
|
989
996
|
const audienceWindowRef = React3.useRef(null);
|
|
990
997
|
const channelRef = React3.useRef(null);
|
|
991
998
|
const pollTimerRef = React3.useRef(null);
|
|
992
999
|
const sessionIdRef = React3.useRef("");
|
|
1000
|
+
const snapshotRef = React3.useRef(snapshot);
|
|
1001
|
+
snapshotRef.current = snapshot;
|
|
993
1002
|
const getChannel = React3.useCallback(() => {
|
|
994
1003
|
if (!channelRef.current) {
|
|
995
1004
|
channelRef.current = new BroadcastChannel(PRESENTER_CHANNEL_NAME);
|
|
@@ -999,6 +1008,10 @@ function usePresenterWindow(input) {
|
|
|
999
1008
|
const isAudienceWindowOpen = React3.useCallback(() => {
|
|
1000
1009
|
return audienceWindowRef.current !== null && !audienceWindowRef.current.closed;
|
|
1001
1010
|
}, []);
|
|
1011
|
+
const swapDisplays = React3.useCallback(async () => {
|
|
1012
|
+
const audience = audienceWindowRef.current;
|
|
1013
|
+
return audience && !audience.closed ? chunkHBXPK572_js.swapPresentationWindows(window, audience) : false;
|
|
1014
|
+
}, []);
|
|
1002
1015
|
const syncSlideToAudience = React3.useCallback(
|
|
1003
1016
|
(slideIndex) => {
|
|
1004
1017
|
if (!sessionIdRef.current) {
|
|
@@ -1017,7 +1030,25 @@ function usePresenterWindow(input) {
|
|
|
1017
1030
|
},
|
|
1018
1031
|
[getChannel]
|
|
1019
1032
|
);
|
|
1033
|
+
const syncStateToAudience = React3.useCallback(
|
|
1034
|
+
(nextSnapshot) => {
|
|
1035
|
+
if (!sessionIdRef.current) {
|
|
1036
|
+
return;
|
|
1037
|
+
}
|
|
1038
|
+
try {
|
|
1039
|
+
getChannel().postMessage({
|
|
1040
|
+
origin: PRESENTER_MSG_ORIGIN,
|
|
1041
|
+
type: "presenter-state",
|
|
1042
|
+
sessionId: sessionIdRef.current,
|
|
1043
|
+
snapshot: nextSnapshot
|
|
1044
|
+
});
|
|
1045
|
+
} catch {
|
|
1046
|
+
}
|
|
1047
|
+
},
|
|
1048
|
+
[getChannel]
|
|
1049
|
+
);
|
|
1020
1050
|
const closeAudienceWindow = React3.useCallback(() => {
|
|
1051
|
+
const closingSessionId = sessionIdRef.current;
|
|
1021
1052
|
if (sessionIdRef.current) {
|
|
1022
1053
|
try {
|
|
1023
1054
|
const exitMsg = {
|
|
@@ -1042,23 +1073,32 @@ function usePresenterWindow(input) {
|
|
|
1042
1073
|
clearInterval(pollTimerRef.current);
|
|
1043
1074
|
pollTimerRef.current = null;
|
|
1044
1075
|
}
|
|
1045
|
-
|
|
1076
|
+
if (closingSessionId) {
|
|
1077
|
+
void clearAudienceContent(closingSessionId);
|
|
1078
|
+
}
|
|
1046
1079
|
}, [getChannel]);
|
|
1047
1080
|
const openAudienceWindow = React3.useCallback(() => {
|
|
1048
1081
|
if (isAudienceWindowOpen()) {
|
|
1049
1082
|
closeAudienceWindow();
|
|
1050
1083
|
}
|
|
1051
|
-
const blankWin = window.open(
|
|
1084
|
+
const blankWin = window.open(
|
|
1085
|
+
"about:blank",
|
|
1086
|
+
"pptx-viewer-audience",
|
|
1087
|
+
"popup=yes,width=1280,height=720"
|
|
1088
|
+
);
|
|
1052
1089
|
if (!blankWin) {
|
|
1053
1090
|
return false;
|
|
1054
1091
|
}
|
|
1055
1092
|
audienceWindowRef.current = blankWin;
|
|
1056
1093
|
const sessionId = generateSessionId();
|
|
1057
1094
|
sessionIdRef.current = sessionId;
|
|
1058
|
-
const audienceUrl =
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1095
|
+
const audienceUrl = chunkHBXPK572_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1096
|
+
void chunkHBXPK572_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1097
|
+
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1098
|
+
chunkHBXPK572_js.placeAudienceWindow(blankWin, placement);
|
|
1099
|
+
}
|
|
1100
|
+
return void 0;
|
|
1101
|
+
});
|
|
1062
1102
|
const navigateOrClose = (ok) => {
|
|
1063
1103
|
const win = audienceWindowRef.current;
|
|
1064
1104
|
if (!win || win.closed) {
|
|
@@ -1074,7 +1114,7 @@ function usePresenterWindow(input) {
|
|
|
1074
1114
|
return;
|
|
1075
1115
|
}
|
|
1076
1116
|
try {
|
|
1077
|
-
win.location.replace(audienceUrl
|
|
1117
|
+
win.location.replace(audienceUrl);
|
|
1078
1118
|
} catch {
|
|
1079
1119
|
try {
|
|
1080
1120
|
win.close();
|
|
@@ -1085,11 +1125,10 @@ function usePresenterWindow(input) {
|
|
|
1085
1125
|
}
|
|
1086
1126
|
};
|
|
1087
1127
|
if (content) {
|
|
1088
|
-
void storeAudienceContent(content).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1128
|
+
void storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1089
1129
|
} else {
|
|
1090
1130
|
navigateOrClose(true);
|
|
1091
1131
|
}
|
|
1092
|
-
window.setTimeout(() => syncSlideToAudience(currentSlideIndex), 1500);
|
|
1093
1132
|
pollTimerRef.current = setInterval(() => {
|
|
1094
1133
|
const win = audienceWindowRef.current;
|
|
1095
1134
|
if (!win || win.closed) {
|
|
@@ -1102,12 +1141,28 @@ function usePresenterWindow(input) {
|
|
|
1102
1141
|
}
|
|
1103
1142
|
}, 1e3);
|
|
1104
1143
|
return true;
|
|
1105
|
-
}, [isAudienceWindowOpen, closeAudienceWindow,
|
|
1144
|
+
}, [isAudienceWindowOpen, closeAudienceWindow, content]);
|
|
1145
|
+
React3.useEffect(() => {
|
|
1146
|
+
let channel;
|
|
1147
|
+
try {
|
|
1148
|
+
channel = getChannel();
|
|
1149
|
+
} catch {
|
|
1150
|
+
return;
|
|
1151
|
+
}
|
|
1152
|
+
const handleMessage = (event) => {
|
|
1153
|
+
const message = event.data;
|
|
1154
|
+
if (chunkHBXPK572_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1155
|
+
syncStateToAudience(snapshotRef.current);
|
|
1156
|
+
}
|
|
1157
|
+
};
|
|
1158
|
+
channel.addEventListener("message", handleMessage);
|
|
1159
|
+
return () => channel.removeEventListener("message", handleMessage);
|
|
1160
|
+
}, [getChannel, syncStateToAudience]);
|
|
1106
1161
|
React3.useEffect(() => {
|
|
1107
1162
|
if (isPresenterMode && isAudienceWindowOpen()) {
|
|
1108
|
-
|
|
1163
|
+
syncStateToAudience(snapshot);
|
|
1109
1164
|
}
|
|
1110
|
-
}, [
|
|
1165
|
+
}, [snapshot, isPresenterMode, isAudienceWindowOpen, syncStateToAudience]);
|
|
1111
1166
|
React3.useEffect(() => {
|
|
1112
1167
|
return () => {
|
|
1113
1168
|
closeAudienceWindow();
|
|
@@ -1124,7 +1179,9 @@ function usePresenterWindow(input) {
|
|
|
1124
1179
|
}, [isPresenterMode, closeAudienceWindow]);
|
|
1125
1180
|
React3.useEffect(() => {
|
|
1126
1181
|
const handleBeforeUnload = () => {
|
|
1127
|
-
|
|
1182
|
+
if (sessionIdRef.current) {
|
|
1183
|
+
void clearAudienceContent(sessionIdRef.current);
|
|
1184
|
+
}
|
|
1128
1185
|
};
|
|
1129
1186
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
1130
1187
|
return () => window.removeEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1133,11 +1190,13 @@ function usePresenterWindow(input) {
|
|
|
1133
1190
|
openAudienceWindow,
|
|
1134
1191
|
closeAudienceWindow,
|
|
1135
1192
|
isAudienceWindowOpen,
|
|
1136
|
-
syncSlideToAudience
|
|
1193
|
+
syncSlideToAudience,
|
|
1194
|
+
syncStateToAudience,
|
|
1195
|
+
swapDisplays
|
|
1137
1196
|
};
|
|
1138
1197
|
}
|
|
1139
1198
|
function useAudienceMode(input) {
|
|
1140
|
-
const { mode: _mode, onSetMode, onSetActiveSlideIndex, containerRef } = input;
|
|
1199
|
+
const { mode: _mode, onSetMode, onSetActiveSlideIndex, containerRef, onSnapshot } = input;
|
|
1141
1200
|
const initialised = React3.useRef(false);
|
|
1142
1201
|
React3.useEffect(() => {
|
|
1143
1202
|
if (!isAudienceTab()) {
|
|
@@ -1147,18 +1206,19 @@ function useAudienceMode(input) {
|
|
|
1147
1206
|
return;
|
|
1148
1207
|
}
|
|
1149
1208
|
initialised.current = true;
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
});
|
|
1156
|
-
}
|
|
1157
|
-
} catch {
|
|
1209
|
+
onSetMode("present");
|
|
1210
|
+
const requestAudienceFullscreen = () => {
|
|
1211
|
+
const wrapper = containerRef.current;
|
|
1212
|
+
if (!document.fullscreenElement && wrapper?.requestFullscreen) {
|
|
1213
|
+
void wrapper.requestFullscreen().catch(() => void 0);
|
|
1158
1214
|
}
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1215
|
+
};
|
|
1216
|
+
document.addEventListener("pointerdown", requestAudienceFullscreen, { once: true });
|
|
1217
|
+
document.addEventListener("keydown", requestAudienceFullscreen, { once: true });
|
|
1218
|
+
return () => {
|
|
1219
|
+
document.removeEventListener("pointerdown", requestAudienceFullscreen);
|
|
1220
|
+
document.removeEventListener("keydown", requestAudienceFullscreen);
|
|
1221
|
+
};
|
|
1162
1222
|
}, [containerRef, onSetMode]);
|
|
1163
1223
|
React3.useEffect(() => {
|
|
1164
1224
|
if (!isAudienceTab()) {
|
|
@@ -1173,7 +1233,7 @@ function useAudienceMode(input) {
|
|
|
1173
1233
|
}
|
|
1174
1234
|
channel.onmessage = (event) => {
|
|
1175
1235
|
const data = event.data;
|
|
1176
|
-
if (!data || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1236
|
+
if (!chunkHBXPK572_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1177
1237
|
return;
|
|
1178
1238
|
}
|
|
1179
1239
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1182,8 +1242,14 @@ function useAudienceMode(input) {
|
|
|
1182
1242
|
if (data.type === "presenter-slide-change") {
|
|
1183
1243
|
onSetActiveSlideIndex(data.slideIndex);
|
|
1184
1244
|
}
|
|
1245
|
+
if (data.type === "presenter-state") {
|
|
1246
|
+
onSetActiveSlideIndex(data.snapshot.slideIndex);
|
|
1247
|
+
onSnapshot?.(data.snapshot);
|
|
1248
|
+
}
|
|
1185
1249
|
if (data.type === "presenter-exit") {
|
|
1186
|
-
|
|
1250
|
+
if (expectedSessionId) {
|
|
1251
|
+
void clearAudienceContent(expectedSessionId);
|
|
1252
|
+
}
|
|
1187
1253
|
onSetMode("edit");
|
|
1188
1254
|
try {
|
|
1189
1255
|
window.close();
|
|
@@ -1191,13 +1257,20 @@ function useAudienceMode(input) {
|
|
|
1191
1257
|
}
|
|
1192
1258
|
}
|
|
1193
1259
|
};
|
|
1260
|
+
if (expectedSessionId) {
|
|
1261
|
+
channel.postMessage({
|
|
1262
|
+
origin: chunkHBXPK572_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1263
|
+
type: "audience-ready",
|
|
1264
|
+
sessionId: expectedSessionId
|
|
1265
|
+
});
|
|
1266
|
+
}
|
|
1194
1267
|
return () => {
|
|
1195
1268
|
try {
|
|
1196
1269
|
channel.close();
|
|
1197
1270
|
} catch {
|
|
1198
1271
|
}
|
|
1199
1272
|
};
|
|
1200
|
-
}, [onSetMode, onSetActiveSlideIndex]);
|
|
1273
|
+
}, [onSetMode, onSetActiveSlideIndex, onSnapshot]);
|
|
1201
1274
|
}
|
|
1202
1275
|
|
|
1203
1276
|
// src/viewer/hooks/presentation-mode/keyboard-helpers.ts
|
|
@@ -1220,6 +1293,12 @@ function mapKeyToPresentationAction(key, ctrlKey) {
|
|
|
1220
1293
|
if (key === "e" || key === "E") {
|
|
1221
1294
|
return { action: "toggleEraser" };
|
|
1222
1295
|
}
|
|
1296
|
+
if (key === "b" || key === "B") {
|
|
1297
|
+
return { action: "toggleBlackScreen" };
|
|
1298
|
+
}
|
|
1299
|
+
if (key === "w" || key === "W") {
|
|
1300
|
+
return { action: "toggleWhiteScreen" };
|
|
1301
|
+
}
|
|
1223
1302
|
if (key === "m" && ctrlKey) {
|
|
1224
1303
|
return { action: "toggleToolbar" };
|
|
1225
1304
|
}
|
|
@@ -1240,6 +1319,8 @@ function usePresentationKeyboard(input) {
|
|
|
1240
1319
|
onToggleEraser,
|
|
1241
1320
|
onToggleToolbar,
|
|
1242
1321
|
onTogglePresenterView,
|
|
1322
|
+
onToggleBlackScreen,
|
|
1323
|
+
onToggleWhiteScreen,
|
|
1243
1324
|
rehearsing,
|
|
1244
1325
|
recordCurrentSlideTime,
|
|
1245
1326
|
presentationSlideIndex,
|
|
@@ -1284,6 +1365,12 @@ function usePresentationKeyboard(input) {
|
|
|
1284
1365
|
case "togglePresenterView":
|
|
1285
1366
|
onTogglePresenterView?.();
|
|
1286
1367
|
break;
|
|
1368
|
+
case "toggleBlackScreen":
|
|
1369
|
+
onToggleBlackScreen?.();
|
|
1370
|
+
break;
|
|
1371
|
+
case "toggleWhiteScreen":
|
|
1372
|
+
onToggleWhiteScreen?.();
|
|
1373
|
+
break;
|
|
1287
1374
|
}
|
|
1288
1375
|
};
|
|
1289
1376
|
window.addEventListener("keydown", handleKeyDown);
|
|
@@ -1299,6 +1386,8 @@ function usePresentationKeyboard(input) {
|
|
|
1299
1386
|
onToggleEraser,
|
|
1300
1387
|
onToggleToolbar,
|
|
1301
1388
|
onTogglePresenterView,
|
|
1389
|
+
onToggleBlackScreen,
|
|
1390
|
+
onToggleWhiteScreen,
|
|
1302
1391
|
rehearsing,
|
|
1303
1392
|
recordCurrentSlideTime,
|
|
1304
1393
|
presentationSlideIndex,
|
|
@@ -1435,7 +1524,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1435
1524
|
return;
|
|
1436
1525
|
}
|
|
1437
1526
|
if (action.url && !actionStr.includes("hlinksldjump")) {
|
|
1438
|
-
if (
|
|
1527
|
+
if (chunkHBXPK572_js.isUrlSafe(action.url)) {
|
|
1439
1528
|
window.open(action.url, "_blank", "noopener,noreferrer");
|
|
1440
1529
|
}
|
|
1441
1530
|
}
|
|
@@ -1445,7 +1534,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1445
1534
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1446
1535
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1447
1536
|
const transition = incomingSlide?.transition;
|
|
1448
|
-
const durationMs = deps.playTransition ?
|
|
1537
|
+
const durationMs = deps.playTransition ? chunkHBXPK572_js.resolveTransitionDurationMs(transition) : 0;
|
|
1449
1538
|
deps.clearPresentationTimers();
|
|
1450
1539
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1451
1540
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1678,6 +1767,53 @@ function useZoomNavigation(input) {
|
|
|
1678
1767
|
clearZoomReturn
|
|
1679
1768
|
};
|
|
1680
1769
|
}
|
|
1770
|
+
function usePresenterConsole(slideIndex) {
|
|
1771
|
+
const timerRef = React3.useRef(chunkHBXPK572_js.createPresenterTimer());
|
|
1772
|
+
const [snapshot, setSnapshot] = React3.useState(() => chunkHBXPK572_js.createInitialPresentationSnapshot(slideIndex));
|
|
1773
|
+
const patch = React3.useCallback((value) => {
|
|
1774
|
+
setSnapshot((current) => chunkHBXPK572_js.mergePresentationSnapshot(current, value));
|
|
1775
|
+
}, []);
|
|
1776
|
+
React3.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
1777
|
+
React3.useEffect(() => {
|
|
1778
|
+
const timer = window.setInterval(() => {
|
|
1779
|
+
patch({
|
|
1780
|
+
paused: timerRef.current.paused,
|
|
1781
|
+
elapsedMs: chunkHBXPK572_js.presenterElapsed(timerRef.current)
|
|
1782
|
+
});
|
|
1783
|
+
}, 1e3);
|
|
1784
|
+
return () => window.clearInterval(timer);
|
|
1785
|
+
}, [patch]);
|
|
1786
|
+
return {
|
|
1787
|
+
snapshot,
|
|
1788
|
+
applyAudienceSnapshot: setSnapshot,
|
|
1789
|
+
setBlackout: (blackout) => patch({ blackout }),
|
|
1790
|
+
toggleTimer: () => {
|
|
1791
|
+
timerRef.current = chunkHBXPK572_js.togglePresenterTimer(timerRef.current);
|
|
1792
|
+
patch({
|
|
1793
|
+
paused: timerRef.current.paused,
|
|
1794
|
+
elapsedMs: chunkHBXPK572_js.presenterElapsed(timerRef.current)
|
|
1795
|
+
});
|
|
1796
|
+
},
|
|
1797
|
+
resetTimer: () => {
|
|
1798
|
+
timerRef.current = chunkHBXPK572_js.resetPresenterTimer();
|
|
1799
|
+
patch({ paused: false, elapsedMs: 0 });
|
|
1800
|
+
},
|
|
1801
|
+
stepZoom: (direction) => setSnapshot(
|
|
1802
|
+
(current) => chunkHBXPK572_js.mergePresentationSnapshot(current, {
|
|
1803
|
+
zoom: chunkHBXPK572_js.stepPresenterZoom(
|
|
1804
|
+
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
1805
|
+
direction
|
|
1806
|
+
)
|
|
1807
|
+
})
|
|
1808
|
+
),
|
|
1809
|
+
resetZoom: () => patch({ zoom: { scale: 1, originX: 0.5, originY: 0.5 } }),
|
|
1810
|
+
setCaption: (caption) => patch({ caption }),
|
|
1811
|
+
setSubtitlesVisible: (subtitlesVisible) => patch({ subtitlesVisible }),
|
|
1812
|
+
updateSnapshot: patch
|
|
1813
|
+
};
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
// src/viewer/hooks/usePresentationMode.ts
|
|
1681
1817
|
function usePresentationMode(input) {
|
|
1682
1818
|
const {
|
|
1683
1819
|
mode,
|
|
@@ -1767,16 +1903,28 @@ function usePresentationMode(input) {
|
|
|
1767
1903
|
setShowRehearsalSummary
|
|
1768
1904
|
});
|
|
1769
1905
|
const { handleZoomClick, zoomReturnSlideIndex, returnToZoomSlide, clearZoomReturn } = useZoomNavigation({ navigateToSlide });
|
|
1770
|
-
const
|
|
1771
|
-
|
|
1906
|
+
const presenterConsole = usePresenterConsole(presentationSlideIndex);
|
|
1907
|
+
const {
|
|
1908
|
+
openAudienceWindow,
|
|
1909
|
+
closeAudienceWindow,
|
|
1910
|
+
isAudienceWindowOpen,
|
|
1911
|
+
syncSlideToAudience,
|
|
1912
|
+
syncStateToAudience,
|
|
1913
|
+
swapDisplays
|
|
1914
|
+
} = usePresenterWindow({
|
|
1772
1915
|
isPresenterMode: presenterMode,
|
|
1773
|
-
content
|
|
1916
|
+
content,
|
|
1917
|
+
snapshot: presenterConsole.snapshot
|
|
1774
1918
|
});
|
|
1775
1919
|
useAudienceMode({
|
|
1776
1920
|
mode,
|
|
1777
1921
|
onSetMode,
|
|
1778
|
-
onSetActiveSlideIndex
|
|
1779
|
-
|
|
1922
|
+
onSetActiveSlideIndex: (index) => {
|
|
1923
|
+
onSetActiveSlideIndex(index);
|
|
1924
|
+
setPresentationSlideIndex(index);
|
|
1925
|
+
},
|
|
1926
|
+
containerRef,
|
|
1927
|
+
onSnapshot: presenterConsole.applyAudienceSnapshot
|
|
1780
1928
|
});
|
|
1781
1929
|
const enterPresentMode = React3.useCallback(() => {
|
|
1782
1930
|
setPresenterMode(false);
|
|
@@ -1833,6 +1981,12 @@ function usePresentationMode(input) {
|
|
|
1833
1981
|
onToggleEraser,
|
|
1834
1982
|
onToggleToolbar,
|
|
1835
1983
|
onTogglePresenterView: togglePresenterView,
|
|
1984
|
+
onToggleBlackScreen: () => presenterConsole.setBlackout(
|
|
1985
|
+
presenterConsole.snapshot.blackout === "black" ? "none" : "black"
|
|
1986
|
+
),
|
|
1987
|
+
onToggleWhiteScreen: () => presenterConsole.setBlackout(
|
|
1988
|
+
presenterConsole.snapshot.blackout === "white" ? "none" : "white"
|
|
1989
|
+
),
|
|
1836
1990
|
rehearsing,
|
|
1837
1991
|
recordCurrentSlideTime,
|
|
1838
1992
|
presentationSlideIndex,
|
|
@@ -1953,7 +2107,18 @@ function usePresentationMode(input) {
|
|
|
1953
2107
|
openAudienceWindow,
|
|
1954
2108
|
closeAudienceWindow,
|
|
1955
2109
|
isAudienceWindowOpen,
|
|
1956
|
-
syncSlideToAudience
|
|
2110
|
+
syncSlideToAudience,
|
|
2111
|
+
syncStateToAudience,
|
|
2112
|
+
swapPresenterDisplays: swapDisplays,
|
|
2113
|
+
presenterSnapshot: presenterConsole.snapshot,
|
|
2114
|
+
setPresenterBlackout: presenterConsole.setBlackout,
|
|
2115
|
+
togglePresenterTimer: presenterConsole.toggleTimer,
|
|
2116
|
+
resetPresenterTimer: presenterConsole.resetTimer,
|
|
2117
|
+
stepPresenterZoom: presenterConsole.stepZoom,
|
|
2118
|
+
resetPresenterZoom: presenterConsole.resetZoom,
|
|
2119
|
+
setPresenterCaption: presenterConsole.setCaption,
|
|
2120
|
+
setPresenterSubtitlesVisible: presenterConsole.setSubtitlesVisible,
|
|
2121
|
+
updatePresenterSnapshot: presenterConsole.updateSnapshot
|
|
1957
2122
|
};
|
|
1958
2123
|
}
|
|
1959
2124
|
var PEN_WIDTH = 2.5;
|
|
@@ -2175,7 +2340,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2175
2340
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2176
2341
|
slides.forEach((slide, slideIndex) => {
|
|
2177
2342
|
for (const element of slide.elements || []) {
|
|
2178
|
-
if (!
|
|
2343
|
+
if (!chunkEXDUEXTO_js.hasTextProperties(element)) {
|
|
2179
2344
|
continue;
|
|
2180
2345
|
}
|
|
2181
2346
|
const segments = element.textSegments ?? [];
|
|
@@ -2226,7 +2391,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2226
2391
|
continue;
|
|
2227
2392
|
}
|
|
2228
2393
|
const element = slide.elements[elIdx];
|
|
2229
|
-
if (!
|
|
2394
|
+
if (!chunkEXDUEXTO_js.hasTextProperties(element)) {
|
|
2230
2395
|
continue;
|
|
2231
2396
|
}
|
|
2232
2397
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3151,12 +3316,12 @@ function useViewerState(input) {
|
|
|
3151
3316
|
function partitionTemplateElements(slides) {
|
|
3152
3317
|
const templateElementsBySlideId = {};
|
|
3153
3318
|
const nextSlides = slides.map((slide) => {
|
|
3154
|
-
const template = slide.elements.filter((el) =>
|
|
3319
|
+
const template = slide.elements.filter((el) => chunkHBXPK572_js.isTemplateElement(el));
|
|
3155
3320
|
if (template.length === 0) {
|
|
3156
3321
|
return slide;
|
|
3157
3322
|
}
|
|
3158
3323
|
templateElementsBySlideId[slide.id] = template;
|
|
3159
|
-
return { ...slide, elements: slide.elements.filter((el) => !
|
|
3324
|
+
return { ...slide, elements: slide.elements.filter((el) => !chunkHBXPK572_js.isTemplateElement(el)) };
|
|
3160
3325
|
});
|
|
3161
3326
|
return { slides: nextSlides, templateElementsBySlideId };
|
|
3162
3327
|
}
|
|
@@ -3229,7 +3394,7 @@ function useLoadContent({
|
|
|
3229
3394
|
);
|
|
3230
3395
|
}
|
|
3231
3396
|
const previousHandler = handlerRef.current;
|
|
3232
|
-
const handler = new
|
|
3397
|
+
const handler = new chunkEXDUEXTO_js.PptxHandler();
|
|
3233
3398
|
const parsed = await handler.load(buffer);
|
|
3234
3399
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3235
3400
|
handler.dispose();
|
|
@@ -3241,7 +3406,7 @@ function useLoadContent({
|
|
|
3241
3406
|
handlerRef.current = null;
|
|
3242
3407
|
const mediaElements = [];
|
|
3243
3408
|
for (const slide of parsed.slides) {
|
|
3244
|
-
|
|
3409
|
+
chunkHBXPK572_js.collectMediaElements(slide.elements, mediaElements);
|
|
3245
3410
|
}
|
|
3246
3411
|
for (const url of mediaDataUrls.values()) {
|
|
3247
3412
|
if (url.startsWith("blob:")) {
|
|
@@ -3282,7 +3447,7 @@ function useLoadContent({
|
|
|
3282
3447
|
}
|
|
3283
3448
|
})
|
|
3284
3449
|
);
|
|
3285
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3450
|
+
const { paths: imagePaths, refs: imageRefs } = chunkHBXPK572_js.collectImagePaths(parsed.slides);
|
|
3286
3451
|
let nextSlides = parsed.slides;
|
|
3287
3452
|
if (imagePaths.size > 0) {
|
|
3288
3453
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3371,14 +3536,14 @@ function useLoadContent({
|
|
|
3371
3536
|
setHasMacros(parsed.hasMacros === true);
|
|
3372
3537
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3373
3538
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3374
|
-
setGuides(
|
|
3539
|
+
setGuides(chunkHBXPK572_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3375
3540
|
setActiveSlideIndex(0);
|
|
3376
3541
|
clearSelection();
|
|
3377
3542
|
setIsDirty(false);
|
|
3378
3543
|
history.resetHistory();
|
|
3379
3544
|
} catch (err) {
|
|
3380
3545
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3381
|
-
if (err instanceof
|
|
3546
|
+
if (err instanceof chunkEXDUEXTO_js.EncryptedFileError) {
|
|
3382
3547
|
setIsEncrypted(true);
|
|
3383
3548
|
} else {
|
|
3384
3549
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3455,7 +3620,7 @@ function useAutosave(input) {
|
|
|
3455
3620
|
isSavingRef.current = false;
|
|
3456
3621
|
return;
|
|
3457
3622
|
}
|
|
3458
|
-
await
|
|
3623
|
+
await chunkHBXPK572_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
3459
3624
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
3460
3625
|
} catch (err) {
|
|
3461
3626
|
setAutosaveStatus({
|
|
@@ -3493,7 +3658,7 @@ function useAutosave(input) {
|
|
|
3493
3658
|
|
|
3494
3659
|
// src/viewer/utils/animation-effects.ts
|
|
3495
3660
|
function getAnimationInitialStyle2(preset, nativeAnimation) {
|
|
3496
|
-
return
|
|
3661
|
+
return chunkHBXPK572_js.getAnimationInitialStyle(preset, nativeAnimation);
|
|
3497
3662
|
}
|
|
3498
3663
|
function cn(...inputs) {
|
|
3499
3664
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
@@ -3501,7 +3666,7 @@ function cn(...inputs) {
|
|
|
3501
3666
|
|
|
3502
3667
|
// src/viewer/utils/text-utils.tsx
|
|
3503
3668
|
function getTextStyleForElement(element, fallbackColor) {
|
|
3504
|
-
if (!
|
|
3669
|
+
if (!chunkEXDUEXTO_js.hasTextProperties(element)) {
|
|
3505
3670
|
return { color: fallbackColor };
|
|
3506
3671
|
}
|
|
3507
3672
|
const textDecorationTokens = [];
|
|
@@ -3515,20 +3680,20 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3515
3680
|
const textDecorationStyle = isDoubleStrike ? "double" : void 0;
|
|
3516
3681
|
const hasItalicRuns = element.textStyle?.italic || Boolean(element.textSegments?.some((segment) => segment.style?.italic));
|
|
3517
3682
|
const isRtl = element.textStyle?.rtl === true;
|
|
3518
|
-
const resolvedTextColor = element.textStyle?.hyperlink ?
|
|
3683
|
+
const resolvedTextColor = element.textStyle?.hyperlink ? chunkHBXPK572_js.normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : chunkHBXPK572_js.normalizeHexColor(element.textStyle?.color, fallbackColor);
|
|
3519
3684
|
const bodyTop = element.textStyle?.bodyInsetTop ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3520
3685
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3521
3686
|
const bodyLeft = element.textStyle?.bodyInsetLeft ?? DEFAULT_BODY_INSET_LR_PX;
|
|
3522
3687
|
const bodyRight = element.textStyle?.bodyInsetRight ?? DEFAULT_BODY_INSET_LR_PX;
|
|
3523
|
-
const writingMode =
|
|
3524
|
-
const textOrientation =
|
|
3525
|
-
const verticalDirection =
|
|
3688
|
+
const writingMode = chunkHBXPK572_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
3689
|
+
const textOrientation = chunkHBXPK572_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
3690
|
+
const verticalDirection = chunkHBXPK572_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
3526
3691
|
const resolvedDirection = verticalDirection || (isRtl ? "rtl" : "ltr");
|
|
3527
3692
|
const resolvedUnicodeBidi = isRtl ? "plaintext" : void 0;
|
|
3528
3693
|
const hasSegments = (element.textSegments?.length ?? 0) > 0;
|
|
3529
3694
|
return {
|
|
3530
3695
|
color: resolvedTextColor,
|
|
3531
|
-
backgroundColor: !hasSegments && element.textStyle?.highlightColor ?
|
|
3696
|
+
backgroundColor: !hasSegments && element.textStyle?.highlightColor ? chunkHBXPK572_js.normalizeHexColor(element.textStyle.highlightColor, void 0) : void 0,
|
|
3532
3697
|
textAlign: (() => {
|
|
3533
3698
|
const a = element.textStyle?.align;
|
|
3534
3699
|
if (a === "justLow" || a === "dist" || a === "thaiDist") {
|
|
@@ -3544,7 +3709,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3544
3709
|
textDecorationLine: textDecorationTokens.length > 0 ? textDecorationTokens.join(" ") : "none",
|
|
3545
3710
|
textDecorationStyle,
|
|
3546
3711
|
fontFamily: element.textStyle?.fontFamily || DEFAULT_FONT_FAMILY,
|
|
3547
|
-
lineHeight:
|
|
3712
|
+
lineHeight: chunkHBXPK572_js.resolveLineHeight(element.textStyle, hasItalicRuns),
|
|
3548
3713
|
paddingTop: bodyTop + (hasItalicRuns ? 1 : 0),
|
|
3549
3714
|
paddingBottom: bodyBottom + (hasItalicRuns ? 1 : 0),
|
|
3550
3715
|
paddingLeft: bodyLeft + (element.textStyle?.paragraphMarginLeft || 0),
|
|
@@ -3557,7 +3722,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3557
3722
|
// Auto-fit: use OOXML-provided fontScale/lnSpcReduction when available,
|
|
3558
3723
|
// otherwise fall back to heuristic estimation. The pure font-scale maths
|
|
3559
3724
|
// now lives in pptx-viewer-shared (computeAutoFitTextStyle).
|
|
3560
|
-
...
|
|
3725
|
+
...chunkHBXPK572_js.computeAutoFitTextStyle({
|
|
3561
3726
|
textStyle: element.textStyle,
|
|
3562
3727
|
text: element.text ?? "",
|
|
3563
3728
|
width: element.width,
|
|
@@ -3590,13 +3755,13 @@ function computeTabSize(tabStops) {
|
|
|
3590
3755
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : void 0;
|
|
3591
3756
|
}
|
|
3592
3757
|
function getTextLayoutStyle(element) {
|
|
3593
|
-
if (!
|
|
3758
|
+
if (!chunkEXDUEXTO_js.hasTextProperties(element)) {
|
|
3594
3759
|
return {};
|
|
3595
3760
|
}
|
|
3596
3761
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
3597
|
-
const writingMode =
|
|
3598
|
-
const textOrientation =
|
|
3599
|
-
const verticalDirection =
|
|
3762
|
+
const writingMode = chunkHBXPK572_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
3763
|
+
const textOrientation = chunkHBXPK572_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
3764
|
+
const verticalDirection = chunkHBXPK572_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
3600
3765
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
3601
3766
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
3602
3767
|
const hasColumns = columnCount > 1;
|
|
@@ -3604,7 +3769,7 @@ function getTextLayoutStyle(element) {
|
|
|
3604
3769
|
const tabStops = element.textStyle?.tabStops;
|
|
3605
3770
|
const tabSize = computeTabSize(tabStops);
|
|
3606
3771
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
3607
|
-
const hasParagraphIndents =
|
|
3772
|
+
const hasParagraphIndents = chunkEXDUEXTO_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
3608
3773
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
3609
3774
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
3610
3775
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -3613,7 +3778,7 @@ function getTextLayoutStyle(element) {
|
|
|
3613
3778
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3614
3779
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
3615
3780
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
3616
|
-
const kinsokuStyles =
|
|
3781
|
+
const kinsokuStyles = chunkHBXPK572_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
3617
3782
|
if (hasColumns) {
|
|
3618
3783
|
return {
|
|
3619
3784
|
display: "block",
|
|
@@ -3656,10 +3821,10 @@ function getTextLayoutStyle(element) {
|
|
|
3656
3821
|
|
|
3657
3822
|
// src/viewer/utils/text-effects.tsx
|
|
3658
3823
|
function buildTextFillCss2(style) {
|
|
3659
|
-
return
|
|
3824
|
+
return chunkHBXPK572_js.buildTextFillCss(style);
|
|
3660
3825
|
}
|
|
3661
3826
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
3662
|
-
return
|
|
3827
|
+
return chunkHBXPK572_js.buildTextBody3DSceneStyle(textStyle);
|
|
3663
3828
|
}
|
|
3664
3829
|
|
|
3665
3830
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -3844,17 +4009,17 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
3844
4009
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
3845
4010
|
return renderedSegments;
|
|
3846
4011
|
}
|
|
3847
|
-
const paraKey = `${elementId}${
|
|
4012
|
+
const paraKey = `${elementId}${chunkHBXPK572_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
3848
4013
|
const paraState = subElementAnimStates.get(paraKey);
|
|
3849
4014
|
if (paraState) {
|
|
3850
4015
|
const style = buildAnimStyle(paraState);
|
|
3851
4016
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
3852
4017
|
}
|
|
3853
|
-
const firstWordKey = `${elementId}${
|
|
4018
|
+
const firstWordKey = `${elementId}${chunkHBXPK572_js.TEXT_BUILD_ID_SEP}w${paraIndex}-0`;
|
|
3854
4019
|
if (subElementAnimStates.has(firstWordKey)) {
|
|
3855
4020
|
return wrapByWord(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
3856
4021
|
}
|
|
3857
|
-
const firstCharKey = `${elementId}${
|
|
4022
|
+
const firstCharKey = `${elementId}${chunkHBXPK572_js.TEXT_BUILD_ID_SEP}c${paraIndex}-0`;
|
|
3858
4023
|
if (subElementAnimStates.has(firstCharKey)) {
|
|
3859
4024
|
return wrapByChar(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
3860
4025
|
}
|
|
@@ -3875,7 +4040,7 @@ function wrapByWord(elementId, paraIndex, paraSegments, states) {
|
|
|
3875
4040
|
nodes.push(/* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Fragment, { children: w }, `ws-${i}`));
|
|
3876
4041
|
continue;
|
|
3877
4042
|
}
|
|
3878
|
-
const key = `${elementId}${
|
|
4043
|
+
const key = `${elementId}${chunkHBXPK572_js.TEXT_BUILD_ID_SEP}w${paraIndex}-${wordIdx}`;
|
|
3879
4044
|
const state = states.get(key);
|
|
3880
4045
|
const style = buildAnimStyle(state);
|
|
3881
4046
|
nodes.push(
|
|
@@ -3889,7 +4054,7 @@ function wrapByChar(elementId, paraIndex, paraSegments, states) {
|
|
|
3889
4054
|
const fullText = paraSegments.map((e) => e.segment.text).join("");
|
|
3890
4055
|
const nodes = [];
|
|
3891
4056
|
for (let i = 0; i < fullText.length; i++) {
|
|
3892
|
-
const key = `${elementId}${
|
|
4057
|
+
const key = `${elementId}${chunkHBXPK572_js.TEXT_BUILD_ID_SEP}c${paraIndex}-${i}`;
|
|
3893
4058
|
const state = states.get(key);
|
|
3894
4059
|
const style = buildAnimStyle(state);
|
|
3895
4060
|
nodes.push(
|
|
@@ -3902,10 +4067,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
3902
4067
|
if (!needsScriptFonts || !text) {
|
|
3903
4068
|
return text;
|
|
3904
4069
|
}
|
|
3905
|
-
const runs =
|
|
4070
|
+
const runs = chunkHBXPK572_js.segmentByScript(text);
|
|
3906
4071
|
if (runs.length <= 1) {
|
|
3907
4072
|
if (runs.length === 1) {
|
|
3908
|
-
const font =
|
|
4073
|
+
const font = chunkHBXPK572_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
3909
4074
|
if (font && font !== baseFontFamily) {
|
|
3910
4075
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
3911
4076
|
}
|
|
@@ -3913,7 +4078,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
3913
4078
|
return text;
|
|
3914
4079
|
}
|
|
3915
4080
|
return runs.map((run, i) => {
|
|
3916
|
-
const font =
|
|
4081
|
+
const font = chunkHBXPK572_js.resolveFontForScript(run.script, scriptFonts);
|
|
3917
4082
|
if (!font || font === baseFontFamily) {
|
|
3918
4083
|
return /* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
3919
4084
|
}
|
|
@@ -3987,8 +4152,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
3987
4152
|
);
|
|
3988
4153
|
}
|
|
3989
4154
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
3990
|
-
const mathml =
|
|
3991
|
-
const safeMathml = mathml ?
|
|
4155
|
+
const mathml = chunkHBXPK572_js.convertOmmlToMathMl(equationXml);
|
|
4156
|
+
const safeMathml = mathml ? chunkHBXPK572_js.sanitizeMathMl(mathml) : "";
|
|
3992
4157
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3993
4158
|
"span",
|
|
3994
4159
|
{
|
|
@@ -3998,7 +4163,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
3998
4163
|
},
|
|
3999
4164
|
dangerouslySetInnerHTML: { __html: safeMathml }
|
|
4000
4165
|
}
|
|
4001
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children:
|
|
4166
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children: chunkAALZCSY4_js.translationsEn["pptx.textSegment.equationFallback"] });
|
|
4002
4167
|
if (equationNumber) {
|
|
4003
4168
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4004
4169
|
"span",
|
|
@@ -4051,7 +4216,7 @@ function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize)
|
|
|
4051
4216
|
color: bulletInfo.color || void 0,
|
|
4052
4217
|
fontFamily: bulletInfo.fontFamily || void 0
|
|
4053
4218
|
},
|
|
4054
|
-
"aria-label":
|
|
4219
|
+
"aria-label": chunkAALZCSY4_js.translationsEn["pptx.textSegment.bulletAria"],
|
|
4055
4220
|
children: "\u2022 "
|
|
4056
4221
|
},
|
|
4057
4222
|
`${elementId}-seg-${segmentIndex}-bullet-fallback`
|
|
@@ -4061,7 +4226,7 @@ function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize)
|
|
|
4061
4226
|
"img",
|
|
4062
4227
|
{
|
|
4063
4228
|
src: bulletInfo.imageDataUrl,
|
|
4064
|
-
alt:
|
|
4229
|
+
alt: chunkAALZCSY4_js.translationsEn["pptx.textSegment.bulletAria"],
|
|
4065
4230
|
style: {
|
|
4066
4231
|
width: bulletSize,
|
|
4067
4232
|
height: bulletSize,
|
|
@@ -4084,7 +4249,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4084
4249
|
);
|
|
4085
4250
|
}
|
|
4086
4251
|
const segmentStyle = segment.style || {};
|
|
4087
|
-
const textValue =
|
|
4252
|
+
const textValue = chunkHBXPK572_js.substituteFieldText(segment.text || "", segment.fieldType, fieldContext);
|
|
4088
4253
|
const lines = textValue.split("\n");
|
|
4089
4254
|
const textDecorationTokens = [];
|
|
4090
4255
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -4094,8 +4259,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4094
4259
|
textDecorationTokens.push("line-through");
|
|
4095
4260
|
}
|
|
4096
4261
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
4097
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
4098
|
-
const underlineDecoration =
|
|
4262
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkHBXPK572_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkHBXPK572_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
4263
|
+
const underlineDecoration = chunkHBXPK572_js.resolveUnderlineDecorationStyle(
|
|
4099
4264
|
Boolean(isDoubleStrike),
|
|
4100
4265
|
segmentStyle.underlineStyle
|
|
4101
4266
|
);
|
|
@@ -4108,14 +4273,14 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4108
4273
|
const autoFitScale = element.textStyle?.autoFitFontScale !== void 0 && element.textStyle.autoFitFontScale > 0 && element.textStyle.autoFitFontScale < 1 ? element.textStyle.autoFitFontScale : 1;
|
|
4109
4274
|
const baseFontSize = rawFontSize * autoFitScale;
|
|
4110
4275
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
4111
|
-
const baseFontFamily = rawFontFamily ?
|
|
4276
|
+
const baseFontFamily = rawFontFamily ? chunkEXDUEXTO_js.getSubstituteFontFamily(rawFontFamily) : DEFAULT_FONT_FAMILY;
|
|
4112
4277
|
const scriptFonts = {
|
|
4113
4278
|
latin: baseFontFamily,
|
|
4114
4279
|
eastAsia: segmentStyle.eastAsiaFont || element.textStyle?.eastAsiaFont || baseFontFamily,
|
|
4115
4280
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
4116
4281
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
4117
4282
|
};
|
|
4118
|
-
const needsScriptFonts =
|
|
4283
|
+
const needsScriptFonts = chunkHBXPK572_js.hasDistinctScriptFonts(scriptFonts);
|
|
4119
4284
|
const spanStyle = {
|
|
4120
4285
|
color: resolvedSegmentColor,
|
|
4121
4286
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -4129,15 +4294,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4129
4294
|
verticalAlign: baselineShift,
|
|
4130
4295
|
letterSpacing,
|
|
4131
4296
|
fontKerning,
|
|
4132
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
4297
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkHBXPK572_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
4133
4298
|
...textFillStyles,
|
|
4134
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
4135
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
4299
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkHBXPK572_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
4300
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkHBXPK572_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
4136
4301
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
4137
|
-
textShadow:
|
|
4138
|
-
filter:
|
|
4139
|
-
opacity:
|
|
4140
|
-
WebkitBoxReflect:
|
|
4302
|
+
textShadow: chunkHBXPK572_js.buildTextShadowCss(segmentStyle),
|
|
4303
|
+
filter: chunkHBXPK572_js.buildTextRunFilterChain(segmentStyle),
|
|
4304
|
+
opacity: chunkHBXPK572_js.getTextAlphaOpacity(segmentStyle),
|
|
4305
|
+
WebkitBoxReflect: chunkHBXPK572_js.buildTextReflectionCss(segmentStyle)
|
|
4141
4306
|
};
|
|
4142
4307
|
const runRtl = segmentStyle.rtl;
|
|
4143
4308
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -4157,7 +4322,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4157
4322
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
4158
4323
|
}
|
|
4159
4324
|
if (bulletInfo.color) {
|
|
4160
|
-
spanStyle.color =
|
|
4325
|
+
spanStyle.color = chunkHBXPK572_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
4161
4326
|
}
|
|
4162
4327
|
}
|
|
4163
4328
|
if (bulletInfo?.imageDataUrl || bulletInfo?.imageRelId) {
|
|
@@ -4189,7 +4354,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4189
4354
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
4190
4355
|
};
|
|
4191
4356
|
if (segment.rubyStyle?.color) {
|
|
4192
|
-
rubyStyle.color =
|
|
4357
|
+
rubyStyle.color = chunkHBXPK572_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
4193
4358
|
}
|
|
4194
4359
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
4195
4360
|
baseContent,
|
|
@@ -4259,7 +4424,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
4259
4424
|
return paragraphs;
|
|
4260
4425
|
}
|
|
4261
4426
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
4262
|
-
if (!
|
|
4427
|
+
if (!chunkEXDUEXTO_js.hasTextProperties(element)) {
|
|
4263
4428
|
return emptyFallback || null;
|
|
4264
4429
|
}
|
|
4265
4430
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -4280,9 +4445,9 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
4280
4445
|
return element.text || emptyFallback || "";
|
|
4281
4446
|
}
|
|
4282
4447
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
4283
|
-
const paragraphIndents =
|
|
4284
|
-
const elementRtl =
|
|
4285
|
-
const elementAlign =
|
|
4448
|
+
const paragraphIndents = chunkEXDUEXTO_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
4449
|
+
const elementRtl = chunkEXDUEXTO_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
4450
|
+
const elementAlign = chunkEXDUEXTO_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
4286
4451
|
return paragraphs.map((paraSegments, paraIndex) => {
|
|
4287
4452
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
4288
4453
|
const rawMarginLeft = typeof paraIndent?.marginLeft === "number" && paraIndent.marginLeft !== 0 ? paraIndent.marginLeft : void 0;
|
|
@@ -4296,14 +4461,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
4296
4461
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
4297
4462
|
});
|
|
4298
4463
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
4299
|
-
const paraRtl =
|
|
4464
|
+
const paraRtl = chunkHBXPK572_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
4300
4465
|
const isRtlParagraph = paraRtl === true;
|
|
4301
|
-
const paraAlign =
|
|
4302
|
-
const cssTextAlign =
|
|
4466
|
+
const paraAlign = chunkHBXPK572_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
4467
|
+
const cssTextAlign = chunkHBXPK572_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
4303
4468
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
4304
4469
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
4305
4470
|
const paraTextIndent = rawTextIndent;
|
|
4306
|
-
const paraKinsokuStyle =
|
|
4471
|
+
const paraKinsokuStyle = chunkHBXPK572_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
4307
4472
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
4308
4473
|
const paraStyle = {
|
|
4309
4474
|
...paraKinsokuStyle
|
|
@@ -4468,7 +4633,7 @@ function isConnectorOrLineElement(element) {
|
|
|
4468
4633
|
if (element.type === "connector") {
|
|
4469
4634
|
return true;
|
|
4470
4635
|
}
|
|
4471
|
-
if (!
|
|
4636
|
+
if (!chunkEXDUEXTO_js.hasShapeProperties(element)) {
|
|
4472
4637
|
return false;
|
|
4473
4638
|
}
|
|
4474
4639
|
const st = getShapeType(element.shapeType);
|
|
@@ -4533,13 +4698,13 @@ function renderDuotoneSvgFilter(elementId, color1, color2) {
|
|
|
4533
4698
|
);
|
|
4534
4699
|
}
|
|
4535
4700
|
function getDuotoneColors(element) {
|
|
4536
|
-
if (!
|
|
4701
|
+
if (!chunkEXDUEXTO_js.isImageLikeElement(element)) {
|
|
4537
4702
|
return void 0;
|
|
4538
4703
|
}
|
|
4539
4704
|
return element.imageEffects?.duotone;
|
|
4540
4705
|
}
|
|
4541
4706
|
function buildLineShadowCss(element) {
|
|
4542
|
-
if (!
|
|
4707
|
+
if (!chunkEXDUEXTO_js.hasShapeProperties(element)) {
|
|
4543
4708
|
return void 0;
|
|
4544
4709
|
}
|
|
4545
4710
|
const ss = element.shapeStyle;
|
|
@@ -4550,13 +4715,13 @@ function buildLineShadowCss(element) {
|
|
|
4550
4715
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
4551
4716
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
4552
4717
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
4553
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
4554
|
-
|
|
4718
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkHBXPK572_js.colorWithOpacity(
|
|
4719
|
+
chunkHBXPK572_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
4555
4720
|
opacity
|
|
4556
4721
|
)}`;
|
|
4557
4722
|
}
|
|
4558
4723
|
function buildLineGlowFilter(element) {
|
|
4559
|
-
if (!
|
|
4724
|
+
if (!chunkEXDUEXTO_js.hasShapeProperties(element)) {
|
|
4560
4725
|
return void 0;
|
|
4561
4726
|
}
|
|
4562
4727
|
const ss = element.shapeStyle;
|
|
@@ -4565,7 +4730,7 @@ function buildLineGlowFilter(element) {
|
|
|
4565
4730
|
}
|
|
4566
4731
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
4567
4732
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
4568
|
-
const glowCol =
|
|
4733
|
+
const glowCol = chunkHBXPK572_js.colorWithOpacity(chunkHBXPK572_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
4569
4734
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
4570
4735
|
}
|
|
4571
4736
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -4589,7 +4754,7 @@ function getImageAlphaFilterId(elementId) {
|
|
|
4589
4754
|
return `imgalpha-${elementId}`;
|
|
4590
4755
|
}
|
|
4591
4756
|
function hasAdvancedImageAlphaEffects(element) {
|
|
4592
|
-
if (!
|
|
4757
|
+
if (!chunkEXDUEXTO_js.isImageLikeElement(element)) {
|
|
4593
4758
|
return false;
|
|
4594
4759
|
}
|
|
4595
4760
|
const e = element.imageEffects;
|
|
@@ -4601,7 +4766,7 @@ function hasAdvancedImageAlphaEffects(element) {
|
|
|
4601
4766
|
);
|
|
4602
4767
|
}
|
|
4603
4768
|
function renderImageAlphaSvgFilter(element) {
|
|
4604
|
-
if (!
|
|
4769
|
+
if (!chunkEXDUEXTO_js.isImageLikeElement(element)) {
|
|
4605
4770
|
return null;
|
|
4606
4771
|
}
|
|
4607
4772
|
const e = element.imageEffects;
|
|
@@ -4711,7 +4876,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
4711
4876
|
return `dag-duotone-${elementId}`;
|
|
4712
4877
|
}
|
|
4713
4878
|
function hasDagDuotoneEffect(element) {
|
|
4714
|
-
if (!
|
|
4879
|
+
if (!chunkEXDUEXTO_js.hasShapeProperties(element)) {
|
|
4715
4880
|
return false;
|
|
4716
4881
|
}
|
|
4717
4882
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -4774,7 +4939,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
4774
4939
|
|
|
4775
4940
|
// src/viewer/utils/shape-visual-3d.ts
|
|
4776
4941
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
4777
|
-
return
|
|
4942
|
+
return chunkHBXPK572_js.build3DExtrusionData(
|
|
4778
4943
|
shape3d,
|
|
4779
4944
|
scene3d,
|
|
4780
4945
|
fillColor,
|
|
@@ -4783,27 +4948,27 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
4783
4948
|
);
|
|
4784
4949
|
}
|
|
4785
4950
|
function apply3dEffects2(base, scene3d, shape3d) {
|
|
4786
|
-
|
|
4951
|
+
chunkHBXPK572_js.apply3dEffects(base, scene3d, shape3d);
|
|
4787
4952
|
}
|
|
4788
4953
|
|
|
4789
4954
|
// src/viewer/utils/shape-visual-style.ts
|
|
4790
4955
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor) {
|
|
4791
|
-
if (!
|
|
4956
|
+
if (!chunkEXDUEXTO_js.hasShapeProperties(element)) {
|
|
4792
4957
|
return {};
|
|
4793
4958
|
}
|
|
4794
4959
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
4795
|
-
const clipPath =
|
|
4960
|
+
const clipPath = chunkHBXPK572_js.getResolvedShapeClipPath(element);
|
|
4796
4961
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
4797
4962
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
4798
|
-
const strokeDash =
|
|
4799
|
-
const fillGradient =
|
|
4800
|
-
const shadowCss =
|
|
4801
|
-
const innerShadowCss =
|
|
4802
|
-
const resolvedFillColor =
|
|
4803
|
-
const resolvedStrokeColor =
|
|
4963
|
+
const strokeDash = chunkHBXPK572_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
4964
|
+
const fillGradient = chunkHBXPK572_js.buildCssGradientFromShapeStyle(element.shapeStyle) || element.shapeStyle?.fillGradient;
|
|
4965
|
+
const shadowCss = chunkHBXPK572_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
4966
|
+
const innerShadowCss = chunkHBXPK572_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
4967
|
+
const resolvedFillColor = chunkHBXPK572_js.colorWithOpacity(fillColor, fillOpacity);
|
|
4968
|
+
const resolvedStrokeColor = chunkHBXPK572_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
4804
4969
|
const ss = element.shapeStyle;
|
|
4805
4970
|
const combinedShadowParts = [];
|
|
4806
|
-
const multiLayerShadow =
|
|
4971
|
+
const multiLayerShadow = chunkHBXPK572_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
4807
4972
|
if (multiLayerShadow) {
|
|
4808
4973
|
combinedShadowParts.push(multiLayerShadow);
|
|
4809
4974
|
} else if (shadowCss) {
|
|
@@ -4812,7 +4977,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4812
4977
|
if (innerShadowCss) {
|
|
4813
4978
|
combinedShadowParts.push(innerShadowCss);
|
|
4814
4979
|
}
|
|
4815
|
-
const glowBoxShadow =
|
|
4980
|
+
const glowBoxShadow = chunkHBXPK572_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
4816
4981
|
if (glowBoxShadow) {
|
|
4817
4982
|
combinedShadowParts.push(glowBoxShadow);
|
|
4818
4983
|
}
|
|
@@ -4820,7 +4985,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4820
4985
|
if (lineShadow) {
|
|
4821
4986
|
combinedShadowParts.push(lineShadow);
|
|
4822
4987
|
}
|
|
4823
|
-
const compoundLineShadow =
|
|
4988
|
+
const compoundLineShadow = chunkHBXPK572_js.getCompoundLineBoxShadow(
|
|
4824
4989
|
element.shapeStyle?.compoundLine,
|
|
4825
4990
|
strokeWidth,
|
|
4826
4991
|
resolvedStrokeColor
|
|
@@ -4833,7 +4998,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4833
4998
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
4834
4999
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
4835
5000
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
4836
|
-
const glowCol =
|
|
5001
|
+
const glowCol = chunkHBXPK572_js.colorWithOpacity(chunkHBXPK572_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
4837
5002
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
4838
5003
|
}
|
|
4839
5004
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
@@ -4846,12 +5011,12 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4846
5011
|
if (lineGlowCss) {
|
|
4847
5012
|
filterParts.push(lineGlowCss);
|
|
4848
5013
|
}
|
|
4849
|
-
const dagFilter =
|
|
5014
|
+
const dagFilter = chunkHBXPK572_js.getEffectDagFilter(ss, element.id);
|
|
4850
5015
|
if (dagFilter) {
|
|
4851
5016
|
filterParts.push(dagFilter);
|
|
4852
5017
|
}
|
|
4853
5018
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : void 0;
|
|
4854
|
-
const patternFill =
|
|
5019
|
+
const patternFill = chunkHBXPK572_js.buildPatternFillCss(element.shapeStyle);
|
|
4855
5020
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
4856
5021
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
4857
5022
|
let reflectCss;
|
|
@@ -4863,7 +5028,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4863
5028
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
4864
5029
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
4865
5030
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
4866
|
-
reflectCss =
|
|
5031
|
+
reflectCss = chunkHBXPK572_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
4867
5032
|
}
|
|
4868
5033
|
}
|
|
4869
5034
|
const base = {
|
|
@@ -4877,9 +5042,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4877
5042
|
filter: filterParts.length > 0 ? filterParts.join(" ") : void 0,
|
|
4878
5043
|
opacity: typeof ss?.dagAlphaModFix === "number" ? Math.max(0, Math.min(1, ss.dagAlphaModFix / 100)) : void 0,
|
|
4879
5044
|
mixBlendMode: mapDagBlendModeToCss(ss?.dagFillOverlayBlend),
|
|
4880
|
-
borderWidth: strokeWidth > 0 ?
|
|
5045
|
+
borderWidth: strokeWidth > 0 ? chunkHBXPK572_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : void 0,
|
|
4881
5046
|
borderColor: strokeWidth > 0 ? resolvedStrokeColor : void 0,
|
|
4882
|
-
borderStyle: strokeWidth > 0 ?
|
|
5047
|
+
borderStyle: strokeWidth > 0 ? chunkHBXPK572_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
4883
5048
|
strokeLinejoin: lineJoinCss,
|
|
4884
5049
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : void 0
|
|
4885
5050
|
};
|
|
@@ -4920,7 +5085,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4920
5085
|
borderWidth: 0,
|
|
4921
5086
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
4922
5087
|
borderTopColor: resolvedStrokeColor,
|
|
4923
|
-
borderTopStyle:
|
|
5088
|
+
borderTopStyle: chunkHBXPK572_js.getCssBorderDashStyle(strokeDash)
|
|
4924
5089
|
};
|
|
4925
5090
|
}
|
|
4926
5091
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -4934,13 +5099,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4934
5099
|
function getConnectorAdjustment(element, key, fallback) {
|
|
4935
5100
|
const direct = element.shapeAdjustments?.[key];
|
|
4936
5101
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
4937
|
-
return
|
|
5102
|
+
return chunkHBXPK572_js.clampUnitInterval(direct / 1e5);
|
|
4938
5103
|
}
|
|
4939
5104
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
4940
5105
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
4941
|
-
return
|
|
5106
|
+
return chunkHBXPK572_js.clampUnitInterval(fallbackKey / 1e5);
|
|
4942
5107
|
}
|
|
4943
|
-
return
|
|
5108
|
+
return chunkHBXPK572_js.clampUnitInterval(fallback);
|
|
4944
5109
|
}
|
|
4945
5110
|
function getConnectorPathGeometry(element) {
|
|
4946
5111
|
const width = Math.max(element.width, 1);
|
|
@@ -5067,14 +5232,14 @@ function renderConnectorMarker(markerId, arrowType, color, arrowWidth, arrowLeng
|
|
|
5067
5232
|
);
|
|
5068
5233
|
}
|
|
5069
5234
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor) {
|
|
5070
|
-
if (!
|
|
5235
|
+
if (!chunkEXDUEXTO_js.hasShapeProperties(element)) {
|
|
5071
5236
|
return null;
|
|
5072
5237
|
}
|
|
5073
5238
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
5074
|
-
const fillPaint =
|
|
5075
|
-
const strokePaint =
|
|
5076
|
-
const dashType =
|
|
5077
|
-
const dashArray =
|
|
5239
|
+
const fillPaint = chunkHBXPK572_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
5240
|
+
const strokePaint = chunkHBXPK572_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
5241
|
+
const dashType = chunkHBXPK572_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
5242
|
+
const dashArray = chunkHBXPK572_js.getSvgStrokeDasharray(
|
|
5078
5243
|
dashType,
|
|
5079
5244
|
Math.max(strokeWidth, 1),
|
|
5080
5245
|
element.shapeStyle?.customDashSegments
|
|
@@ -5158,18 +5323,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5158
5323
|
}
|
|
5159
5324
|
);
|
|
5160
5325
|
}
|
|
5161
|
-
if (
|
|
5326
|
+
if (chunkEXDUEXTO_js.isCalloutShape(normalizedType)) {
|
|
5162
5327
|
const width = Math.max(element.width, 1);
|
|
5163
5328
|
const height = Math.max(element.height, 1);
|
|
5164
|
-
const geometry =
|
|
5329
|
+
const geometry = chunkEXDUEXTO_js.getCalloutLeaderLineGeometry(
|
|
5165
5330
|
normalizedType,
|
|
5166
5331
|
width,
|
|
5167
5332
|
height,
|
|
5168
5333
|
element.shapeAdjustments
|
|
5169
5334
|
);
|
|
5170
5335
|
if (geometry && geometry.points.length >= 2) {
|
|
5171
|
-
const leaderPath =
|
|
5172
|
-
const bounds =
|
|
5336
|
+
const leaderPath = chunkEXDUEXTO_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
5337
|
+
const bounds = chunkEXDUEXTO_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
5173
5338
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
5174
5339
|
const offsetLeft = bounds.minX;
|
|
5175
5340
|
const offsetTop = bounds.minY;
|
|
@@ -5233,8 +5398,8 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5233
5398
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
5234
5399
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
5235
5400
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
5236
|
-
const offsets =
|
|
5237
|
-
const widths =
|
|
5401
|
+
const offsets = chunkHBXPK572_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
5402
|
+
const widths = chunkHBXPK572_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
5238
5403
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5239
5404
|
"svg",
|
|
5240
5405
|
{
|
|
@@ -5288,7 +5453,7 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5288
5453
|
|
|
5289
5454
|
// src/viewer/utils/image-style.ts
|
|
5290
5455
|
function getImageMaskStyle(element) {
|
|
5291
|
-
if (!
|
|
5456
|
+
if (!chunkEXDUEXTO_js.hasShapeProperties(element)) {
|
|
5292
5457
|
return void 0;
|
|
5293
5458
|
}
|
|
5294
5459
|
const shapeType = element.shapeType;
|
|
@@ -5297,7 +5462,7 @@ function getImageMaskStyle(element) {
|
|
|
5297
5462
|
}
|
|
5298
5463
|
const normalized = shapeType.toLowerCase();
|
|
5299
5464
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
5300
|
-
const radiusPx =
|
|
5465
|
+
const radiusPx = chunkHBXPK572_js.getRoundRectRadiusPx(element);
|
|
5301
5466
|
if (radiusPx <= 0.01) {
|
|
5302
5467
|
return void 0;
|
|
5303
5468
|
}
|
|
@@ -5309,7 +5474,7 @@ function getImageMaskStyle(element) {
|
|
|
5309
5474
|
if (normalized === "can" || normalized === "cylinder") {
|
|
5310
5475
|
return { borderRadius: "48% / 12%" };
|
|
5311
5476
|
}
|
|
5312
|
-
const clipPath =
|
|
5477
|
+
const clipPath = chunkHBXPK572_js.getResolvedShapeClipPath(element);
|
|
5313
5478
|
if (!clipPath) {
|
|
5314
5479
|
return void 0;
|
|
5315
5480
|
}
|
|
@@ -5317,7 +5482,7 @@ function getImageMaskStyle(element) {
|
|
|
5317
5482
|
}
|
|
5318
5483
|
function getImageRenderStyle(element) {
|
|
5319
5484
|
const maskStyle = getImageMaskStyle(element) || {};
|
|
5320
|
-
if (!
|
|
5485
|
+
if (!chunkEXDUEXTO_js.isImageLikeElement(element)) {
|
|
5321
5486
|
return {
|
|
5322
5487
|
...maskStyle,
|
|
5323
5488
|
width: "100%",
|
|
@@ -5325,10 +5490,10 @@ function getImageRenderStyle(element) {
|
|
|
5325
5490
|
objectFit: "cover"
|
|
5326
5491
|
};
|
|
5327
5492
|
}
|
|
5328
|
-
const cropLeft =
|
|
5329
|
-
const cropTop =
|
|
5330
|
-
const cropRight =
|
|
5331
|
-
const cropBottom =
|
|
5493
|
+
const cropLeft = chunkHBXPK572_js.clampCropValue(element.cropLeft);
|
|
5494
|
+
const cropTop = chunkHBXPK572_js.clampCropValue(element.cropTop);
|
|
5495
|
+
const cropRight = chunkHBXPK572_js.clampCropValue(element.cropRight);
|
|
5496
|
+
const cropBottom = chunkHBXPK572_js.clampCropValue(element.cropBottom);
|
|
5332
5497
|
const hasCrop = cropLeft + cropRight > 1e-4 || cropTop + cropBottom > 1e-4;
|
|
5333
5498
|
if (!hasCrop) {
|
|
5334
5499
|
return {
|
|
@@ -5340,10 +5505,10 @@ function getImageRenderStyle(element) {
|
|
|
5340
5505
|
}
|
|
5341
5506
|
const safeHorizontalScale = cropLeft + cropRight >= 0.99 ? 0.99 / (cropLeft + cropRight) : 1;
|
|
5342
5507
|
const safeVerticalScale = cropTop + cropBottom >= 0.99 ? 0.99 / (cropTop + cropBottom) : 1;
|
|
5343
|
-
const normalizedLeft =
|
|
5344
|
-
const normalizedRight =
|
|
5345
|
-
const normalizedTop =
|
|
5346
|
-
const normalizedBottom =
|
|
5508
|
+
const normalizedLeft = chunkHBXPK572_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
5509
|
+
const normalizedRight = chunkHBXPK572_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
5510
|
+
const normalizedTop = chunkHBXPK572_js.clampCropValue(cropTop * safeVerticalScale);
|
|
5511
|
+
const normalizedBottom = chunkHBXPK572_js.clampCropValue(cropBottom * safeVerticalScale);
|
|
5347
5512
|
const remainingWidth = Math.max(0.01, 1 - normalizedLeft - normalizedRight);
|
|
5348
5513
|
const remainingHeight = Math.max(0.01, 1 - normalizedTop - normalizedBottom);
|
|
5349
5514
|
const tx = Math.round(-normalizedLeft / remainingWidth * 1e4) / 100;
|
|
@@ -5372,7 +5537,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
5372
5537
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
5373
5538
|
};
|
|
5374
5539
|
function getCropShapeClipPath(element) {
|
|
5375
|
-
if (!
|
|
5540
|
+
if (!chunkEXDUEXTO_js.isImageLikeElement(element)) {
|
|
5376
5541
|
return void 0;
|
|
5377
5542
|
}
|
|
5378
5543
|
const shape = element.cropShape;
|
|
@@ -5382,7 +5547,7 @@ function getCropShapeClipPath(element) {
|
|
|
5382
5547
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
5383
5548
|
}
|
|
5384
5549
|
function isImageTiled(element) {
|
|
5385
|
-
if (!
|
|
5550
|
+
if (!chunkEXDUEXTO_js.isImageLikeElement(element)) {
|
|
5386
5551
|
return false;
|
|
5387
5552
|
}
|
|
5388
5553
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -5412,7 +5577,7 @@ function tileAlignmentToCssPosition(alignment) {
|
|
|
5412
5577
|
}
|
|
5413
5578
|
}
|
|
5414
5579
|
function getImageTilingStyle(element) {
|
|
5415
|
-
if (!
|
|
5580
|
+
if (!chunkEXDUEXTO_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
5416
5581
|
return void 0;
|
|
5417
5582
|
}
|
|
5418
5583
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -5483,9 +5648,9 @@ function parseGradientFillCss(gradFill) {
|
|
|
5483
5648
|
}
|
|
5484
5649
|
const parsed = stops.map((gs) => {
|
|
5485
5650
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
5486
|
-
const color =
|
|
5487
|
-
const opacity =
|
|
5488
|
-
return { pos, color:
|
|
5651
|
+
const color = chunkHBXPK572_js.parseDrawingColor(gs) ?? "#888888";
|
|
5652
|
+
const opacity = chunkHBXPK572_js.parseDrawingColorOpacity(gs);
|
|
5653
|
+
return { pos, color: chunkHBXPK572_js.colorWithOpacity(color, opacity) };
|
|
5489
5654
|
}).sort((a, b) => a.pos - b.pos);
|
|
5490
5655
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
5491
5656
|
const lin = gradFill["a:lin"];
|
|
@@ -5526,8 +5691,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
5526
5691
|
if (!pattFill) {
|
|
5527
5692
|
return void 0;
|
|
5528
5693
|
}
|
|
5529
|
-
const fgColor =
|
|
5530
|
-
const bgColor =
|
|
5694
|
+
const fgColor = chunkHBXPK572_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
5695
|
+
const bgColor = chunkHBXPK572_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
5531
5696
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
5532
5697
|
switch (preset) {
|
|
5533
5698
|
case "ltHorz":
|
|
@@ -5638,11 +5803,11 @@ function parseCellBorders(cellProperties) {
|
|
|
5638
5803
|
const prstDash = ln["a:prstDash"];
|
|
5639
5804
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
5640
5805
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
5641
|
-
const color =
|
|
5806
|
+
const color = chunkHBXPK572_js.parseDrawingColor(ln["a:solidFill"]);
|
|
5642
5807
|
if (color) {
|
|
5643
|
-
const opacity =
|
|
5808
|
+
const opacity = chunkHBXPK572_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
5644
5809
|
const key = `${edge.prefix}`;
|
|
5645
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
5810
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkHBXPK572_js.colorWithOpacity(color, opacity)}`;
|
|
5646
5811
|
}
|
|
5647
5812
|
}
|
|
5648
5813
|
return borderStyle;
|
|
@@ -5655,7 +5820,7 @@ function parseCellTextEffects(runProps) {
|
|
|
5655
5820
|
const textShadowParts = [];
|
|
5656
5821
|
const outerShdw = effectLst["a:outerShdw"];
|
|
5657
5822
|
if (outerShdw) {
|
|
5658
|
-
const shdwColor =
|
|
5823
|
+
const shdwColor = chunkHBXPK572_js.parseDrawingColor(outerShdw);
|
|
5659
5824
|
if (shdwColor) {
|
|
5660
5825
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
5661
5826
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -5673,7 +5838,7 @@ function parseCellTextEffects(runProps) {
|
|
|
5673
5838
|
}
|
|
5674
5839
|
const glow = effectLst["a:glow"];
|
|
5675
5840
|
if (glow) {
|
|
5676
|
-
const glowColor =
|
|
5841
|
+
const glowColor = chunkHBXPK572_js.parseDrawingColor(glow);
|
|
5677
5842
|
if (glowColor) {
|
|
5678
5843
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
5679
5844
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -5752,10 +5917,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5752
5917
|
if (runProps?.["@_u"] !== void 0) {
|
|
5753
5918
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
5754
5919
|
}
|
|
5755
|
-
const runColor =
|
|
5920
|
+
const runColor = chunkHBXPK572_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkHBXPK572_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
5756
5921
|
if (runColor) {
|
|
5757
|
-
const opacity =
|
|
5758
|
-
cellStyle.color =
|
|
5922
|
+
const opacity = chunkHBXPK572_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
5923
|
+
cellStyle.color = chunkHBXPK572_js.colorWithOpacity(runColor, opacity);
|
|
5759
5924
|
}
|
|
5760
5925
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
5761
5926
|
if (fontFamily) {
|
|
@@ -5765,15 +5930,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5765
5930
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
5766
5931
|
}
|
|
5767
5932
|
const cellProperties = cellXml["a:tcPr"];
|
|
5768
|
-
const cellFill =
|
|
5933
|
+
const cellFill = chunkHBXPK572_js.parseDrawingColor(
|
|
5769
5934
|
cellProperties?.["a:solidFill"],
|
|
5770
5935
|
schemeColorOverrides
|
|
5771
5936
|
);
|
|
5772
5937
|
if (cellFill) {
|
|
5773
|
-
const opacity =
|
|
5938
|
+
const opacity = chunkHBXPK572_js.parseDrawingColorOpacity(
|
|
5774
5939
|
cellProperties?.["a:solidFill"]
|
|
5775
5940
|
);
|
|
5776
|
-
cellStyle.backgroundColor =
|
|
5941
|
+
cellStyle.backgroundColor = chunkHBXPK572_js.colorWithOpacity(cellFill, opacity);
|
|
5777
5942
|
} else {
|
|
5778
5943
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
5779
5944
|
if (gradCss) {
|
|
@@ -5788,16 +5953,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5788
5953
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
5789
5954
|
Object.assign(cellStyle, edgeBorders);
|
|
5790
5955
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
5791
|
-
const borderColor =
|
|
5956
|
+
const borderColor = chunkHBXPK572_js.parseDrawingColor(
|
|
5792
5957
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
5793
5958
|
schemeColorOverrides
|
|
5794
|
-
) ||
|
|
5959
|
+
) || chunkHBXPK572_js.parseDrawingColor(
|
|
5795
5960
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
5796
5961
|
schemeColorOverrides
|
|
5797
|
-
) ||
|
|
5962
|
+
) || chunkHBXPK572_js.parseDrawingColor(
|
|
5798
5963
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
5799
5964
|
schemeColorOverrides
|
|
5800
|
-
) ||
|
|
5965
|
+
) || chunkHBXPK572_js.parseDrawingColor(
|
|
5801
5966
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
5802
5967
|
schemeColorOverrides
|
|
5803
5968
|
);
|
|
@@ -5876,10 +6041,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
5876
6041
|
}
|
|
5877
6042
|
let color = base;
|
|
5878
6043
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
5879
|
-
color =
|
|
6044
|
+
color = chunkHBXPK572_js.tintColor2(color, fill.tint / 1e5);
|
|
5880
6045
|
}
|
|
5881
6046
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
5882
|
-
color =
|
|
6047
|
+
color = chunkHBXPK572_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
5883
6048
|
}
|
|
5884
6049
|
return color;
|
|
5885
6050
|
}
|
|
@@ -5901,10 +6066,10 @@ function applyTableStyleText(text, colorScheme, style) {
|
|
|
5901
6066
|
if (base) {
|
|
5902
6067
|
let color = base;
|
|
5903
6068
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
5904
|
-
color =
|
|
6069
|
+
color = chunkHBXPK572_js.tintColor2(color, text.fontTint / 1e5);
|
|
5905
6070
|
}
|
|
5906
6071
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
5907
|
-
color =
|
|
6072
|
+
color = chunkHBXPK572_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
5908
6073
|
}
|
|
5909
6074
|
style.color = color;
|
|
5910
6075
|
applied = true;
|
|
@@ -6186,9 +6351,9 @@ function cellStyleToCss(style) {
|
|
|
6186
6351
|
if (style.gradientFillCss) {
|
|
6187
6352
|
css.background = style.gradientFillCss;
|
|
6188
6353
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
6189
|
-
const fg =
|
|
6190
|
-
const bg =
|
|
6191
|
-
const svgPattern =
|
|
6354
|
+
const fg = chunkHBXPK572_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
6355
|
+
const bg = chunkHBXPK572_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
6356
|
+
const svgPattern = chunkHBXPK572_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
6192
6357
|
if (svgPattern) {
|
|
6193
6358
|
const encoded = encodeURIComponent(svgPattern);
|
|
6194
6359
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -6257,7 +6422,7 @@ function cellStyleToCss(style) {
|
|
|
6257
6422
|
if (edge.width || edge.color) {
|
|
6258
6423
|
const w = edge.width ?? 1;
|
|
6259
6424
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
6260
|
-
const s =
|
|
6425
|
+
const s = chunkHBXPK572_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
6261
6426
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
6262
6427
|
}
|
|
6263
6428
|
}
|
|
@@ -6299,7 +6464,7 @@ function TableResizeOverlay({
|
|
|
6299
6464
|
const containerRef = React3.useRef(null);
|
|
6300
6465
|
const [rowBounds, setRowBounds] = React3.useState([]);
|
|
6301
6466
|
const dragRef = React3.useRef(null);
|
|
6302
|
-
const colBoundaries = React3.useMemo(() =>
|
|
6467
|
+
const colBoundaries = React3.useMemo(() => chunkHBXPK572_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
6303
6468
|
const measureRows = React3.useCallback(() => {
|
|
6304
6469
|
const container = containerRef.current;
|
|
6305
6470
|
if (!container) {
|
|
@@ -6346,11 +6511,11 @@ function TableResizeOverlay({
|
|
|
6346
6511
|
const rect = containerRef.current.getBoundingClientRect();
|
|
6347
6512
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
6348
6513
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
6349
|
-
onResizeColumns(
|
|
6514
|
+
onResizeColumns(chunkHBXPK572_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
6350
6515
|
} else if (drag.type === "row" && onResizeRow) {
|
|
6351
6516
|
const deltaY = e.clientY - drag.startPos;
|
|
6352
|
-
const newHeight =
|
|
6353
|
-
drag.initialRowHeight ??
|
|
6517
|
+
const newHeight = chunkHBXPK572_js.computeResizedRowHeight(
|
|
6518
|
+
drag.initialRowHeight ?? chunkHBXPK572_js.DEFAULT_ROW_HEIGHT,
|
|
6354
6519
|
deltaY
|
|
6355
6520
|
);
|
|
6356
6521
|
onResizeRow(drag.index, newHeight);
|
|
@@ -6388,7 +6553,7 @@ function TableResizeOverlay({
|
|
|
6388
6553
|
e.stopPropagation();
|
|
6389
6554
|
const table = containerRef.current?.querySelector("table");
|
|
6390
6555
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
6391
|
-
const actualHeight = tr?.offsetHeight ??
|
|
6556
|
+
const actualHeight = tr?.offsetHeight ?? chunkHBXPK572_js.DEFAULT_ROW_HEIGHT;
|
|
6392
6557
|
document.body.style.cursor = "row-resize";
|
|
6393
6558
|
document.body.style.userSelect = "none";
|
|
6394
6559
|
dragRef.current = {
|
|
@@ -6434,7 +6599,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6434
6599
|
}
|
|
6435
6600
|
const first = selectedCell.selectedCells[0];
|
|
6436
6601
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
6437
|
-
return
|
|
6602
|
+
return chunkHBXPK572_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
6438
6603
|
})();
|
|
6439
6604
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6440
6605
|
TableResizeOverlay,
|
|
@@ -6467,7 +6632,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6467
6632
|
return null;
|
|
6468
6633
|
}
|
|
6469
6634
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
6470
|
-
const isInMultiSelection =
|
|
6635
|
+
const isInMultiSelection = chunkHBXPK572_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
6471
6636
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
6472
6637
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6473
6638
|
"td",
|
|
@@ -6490,7 +6655,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6490
6655
|
}
|
|
6491
6656
|
event.stopPropagation();
|
|
6492
6657
|
if (event.shiftKey && selectedCell) {
|
|
6493
|
-
const rect =
|
|
6658
|
+
const rect = chunkHBXPK572_js.computeSelectionRect(
|
|
6494
6659
|
selectedCell.rowIndex,
|
|
6495
6660
|
selectedCell.columnIndex,
|
|
6496
6661
|
rowIndex,
|
|
@@ -6500,7 +6665,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6500
6665
|
options?.onSelectCell?.({
|
|
6501
6666
|
rowIndex: selectedCell.rowIndex,
|
|
6502
6667
|
columnIndex: selectedCell.columnIndex,
|
|
6503
|
-
selectedCells:
|
|
6668
|
+
selectedCells: chunkHBXPK572_js.rectToCells(rect)
|
|
6504
6669
|
});
|
|
6505
6670
|
} else {
|
|
6506
6671
|
options?.onSelectCell?.({
|
|
@@ -6559,7 +6724,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6559
6724
|
if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
|
|
6560
6725
|
return renderTableFromTableData(tableEl2, textStyle, options);
|
|
6561
6726
|
}
|
|
6562
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
6727
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkAALZCSY4_js.translationsEn["pptx.table.title"] });
|
|
6563
6728
|
}
|
|
6564
6729
|
const selectedCell = options?.selectedCell || null;
|
|
6565
6730
|
const isEditable2 = Boolean(options?.editable);
|
|
@@ -6574,7 +6739,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6574
6739
|
}
|
|
6575
6740
|
const first = selectedCell.selectedCells[0];
|
|
6576
6741
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
6577
|
-
return
|
|
6742
|
+
return chunkHBXPK572_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
6578
6743
|
})();
|
|
6579
6744
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
6580
6745
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6639,7 +6804,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6639
6804
|
"border px-1 py-0.5 align-top",
|
|
6640
6805
|
isEditable2 && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
6641
6806
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
6642
|
-
|
|
6807
|
+
chunkHBXPK572_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
6643
6808
|
),
|
|
6644
6809
|
colSpan,
|
|
6645
6810
|
rowSpan: rSpan,
|
|
@@ -6650,7 +6815,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6650
6815
|
}
|
|
6651
6816
|
event.stopPropagation();
|
|
6652
6817
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
6653
|
-
const rect =
|
|
6818
|
+
const rect = chunkHBXPK572_js.computeSelectionRect(
|
|
6654
6819
|
selectedCell.rowIndex,
|
|
6655
6820
|
selectedCell.columnIndex,
|
|
6656
6821
|
rowIndex,
|
|
@@ -6660,7 +6825,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6660
6825
|
options?.onSelectCell?.({
|
|
6661
6826
|
rowIndex: selectedCell.rowIndex,
|
|
6662
6827
|
columnIndex: selectedCell.columnIndex,
|
|
6663
|
-
selectedCells:
|
|
6828
|
+
selectedCells: chunkHBXPK572_js.rectToCells(rect)
|
|
6664
6829
|
});
|
|
6665
6830
|
} else {
|
|
6666
6831
|
options?.onSelectCell?.({
|
|
@@ -6712,24 +6877,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6712
6877
|
}
|
|
6713
6878
|
var LEGEND_ITEM_WIDTH = 80;
|
|
6714
6879
|
function partAttrs(part) {
|
|
6715
|
-
return part ?
|
|
6880
|
+
return part ? chunkHBXPK572_js.chartPartToAttrs(part) : void 0;
|
|
6716
6881
|
}
|
|
6717
6882
|
function resolveReactPalette(chartData) {
|
|
6718
6883
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
6719
6884
|
return chartData.colorPalette;
|
|
6720
6885
|
}
|
|
6721
|
-
return [...
|
|
6886
|
+
return [...chunkHBXPK572_js.getChartStylePalette(chartData.style?.styleId)];
|
|
6722
6887
|
}
|
|
6723
6888
|
function buildReactChartViewModel(element) {
|
|
6724
6889
|
if (element.type !== "chart" || !element.chartData) {
|
|
6725
|
-
return
|
|
6890
|
+
return chunkHBXPK572_js.buildChartViewModel(element);
|
|
6726
6891
|
}
|
|
6727
6892
|
const palette = resolveReactPalette(element.chartData);
|
|
6728
6893
|
const themedElement = {
|
|
6729
6894
|
...element,
|
|
6730
6895
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
6731
6896
|
};
|
|
6732
|
-
return
|
|
6897
|
+
return chunkHBXPK572_js.buildChartViewModel(themedElement);
|
|
6733
6898
|
}
|
|
6734
6899
|
function renderPrimitive(prim, key) {
|
|
6735
6900
|
switch (prim.kind) {
|
|
@@ -7118,7 +7283,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7118
7283
|
const unmatchedRows = [];
|
|
7119
7284
|
categories.forEach((cat, i) => {
|
|
7120
7285
|
const value = values[i] ?? 0;
|
|
7121
|
-
const code =
|
|
7286
|
+
const code = chunkHBXPK572_js.resolveRegionCode(cat);
|
|
7122
7287
|
if (code) {
|
|
7123
7288
|
regionValueMap.set(code, { value, label: cat });
|
|
7124
7289
|
} else {
|
|
@@ -7156,8 +7321,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7156
7321
|
let fill = "#e2e8f0";
|
|
7157
7322
|
let dataLabel = null;
|
|
7158
7323
|
if (entry) {
|
|
7159
|
-
const t =
|
|
7160
|
-
fill =
|
|
7324
|
+
const t = chunkHBXPK572_js.normalizeValue(entry.value, minVal, maxVal);
|
|
7325
|
+
fill = chunkHBXPK572_js.sequentialColorScale(t);
|
|
7161
7326
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
7162
7327
|
"text",
|
|
7163
7328
|
{
|
|
@@ -7168,7 +7333,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7168
7333
|
fontWeight: 600,
|
|
7169
7334
|
fill: "#1e293b",
|
|
7170
7335
|
style: { pointerEvents: "none" },
|
|
7171
|
-
children:
|
|
7336
|
+
children: chunkHBXPK572_js.formatAxisValue(entry.value)
|
|
7172
7337
|
},
|
|
7173
7338
|
`${element.id}-map-dl-${region.code}`
|
|
7174
7339
|
);
|
|
@@ -7186,7 +7351,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7186
7351
|
opacity: 0.9,
|
|
7187
7352
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
7188
7353
|
region.name,
|
|
7189
|
-
entry ? `: ${
|
|
7354
|
+
entry ? `: ${chunkHBXPK572_js.formatAxisValue(entry.value)}` : ""
|
|
7190
7355
|
] })
|
|
7191
7356
|
}
|
|
7192
7357
|
),
|
|
@@ -7224,7 +7389,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7224
7389
|
fontSize: 7,
|
|
7225
7390
|
fill: "#64748b",
|
|
7226
7391
|
textAnchor: "middle",
|
|
7227
|
-
children:
|
|
7392
|
+
children: chunkHBXPK572_js.formatAxisValue(minVal)
|
|
7228
7393
|
},
|
|
7229
7394
|
`${element.id}-map-legend-min`
|
|
7230
7395
|
),
|
|
@@ -7236,7 +7401,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7236
7401
|
fontSize: 7,
|
|
7237
7402
|
fill: "#64748b",
|
|
7238
7403
|
textAnchor: "middle",
|
|
7239
|
-
children:
|
|
7404
|
+
children: chunkHBXPK572_js.formatAxisValue(maxVal)
|
|
7240
7405
|
},
|
|
7241
7406
|
`${element.id}-map-legend-max`
|
|
7242
7407
|
)
|
|
@@ -7255,7 +7420,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7255
7420
|
textAnchor: "middle",
|
|
7256
7421
|
fontSize: 7,
|
|
7257
7422
|
fill: "#94a3b8",
|
|
7258
|
-
children:
|
|
7423
|
+
children: chunkAALZCSY4_js.translationsEn["pptx.chart.additionalRegionsFallback"]
|
|
7259
7424
|
},
|
|
7260
7425
|
`${element.id}-map-ft-hdr`
|
|
7261
7426
|
)
|
|
@@ -7302,7 +7467,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7302
7467
|
y,
|
|
7303
7468
|
fontSize,
|
|
7304
7469
|
fill: "#475569",
|
|
7305
|
-
children:
|
|
7470
|
+
children: chunkHBXPK572_js.formatAxisValue(row.value)
|
|
7306
7471
|
},
|
|
7307
7472
|
`${element.id}-map-ft-val-${i}`
|
|
7308
7473
|
)
|
|
@@ -7373,7 +7538,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
7373
7538
|
|
|
7374
7539
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
7375
7540
|
function sColor(series, idx) {
|
|
7376
|
-
return
|
|
7541
|
+
return chunkHBXPK572_js.seriesColor(series, idx);
|
|
7377
7542
|
}
|
|
7378
7543
|
function valToY(val, range, topY, bottomY) {
|
|
7379
7544
|
const usable = bottomY - topY;
|
|
@@ -7868,7 +8033,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
7868
8033
|
width: 10,
|
|
7869
8034
|
height: 10,
|
|
7870
8035
|
rx: 2,
|
|
7871
|
-
fill:
|
|
8036
|
+
fill: chunkHBXPK572_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
7872
8037
|
},
|
|
7873
8038
|
`${id}-leg-r-${i}`
|
|
7874
8039
|
)
|
|
@@ -7892,7 +8057,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
7892
8057
|
width: 10,
|
|
7893
8058
|
height: 10,
|
|
7894
8059
|
rx: 2,
|
|
7895
|
-
fill:
|
|
8060
|
+
fill: chunkHBXPK572_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
7896
8061
|
}
|
|
7897
8062
|
),
|
|
7898
8063
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -7905,9 +8070,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
7905
8070
|
}
|
|
7906
8071
|
const lines = [];
|
|
7907
8072
|
if (range.logScale && range.logBase) {
|
|
7908
|
-
const ticks =
|
|
8073
|
+
const ticks = chunkHBXPK572_js.generateLogTicks(range);
|
|
7909
8074
|
ticks.forEach((tickVal, i) => {
|
|
7910
|
-
const y =
|
|
8075
|
+
const y = chunkHBXPK572_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
7911
8076
|
lines.push(
|
|
7912
8077
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7913
8078
|
"line",
|
|
@@ -7928,7 +8093,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
7928
8093
|
const steps = 4;
|
|
7929
8094
|
for (let i = 0; i <= steps; i++) {
|
|
7930
8095
|
const val = range.min + range.span * i / steps;
|
|
7931
|
-
const y =
|
|
8096
|
+
const y = chunkHBXPK572_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
7932
8097
|
lines.push(
|
|
7933
8098
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7934
8099
|
"line",
|
|
@@ -7952,9 +8117,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7952
8117
|
const labels = [];
|
|
7953
8118
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
7954
8119
|
if (range.logScale && range.logBase) {
|
|
7955
|
-
const ticks =
|
|
8120
|
+
const ticks = chunkHBXPK572_js.generateLogTicks(range);
|
|
7956
8121
|
ticks.forEach((tickVal, i) => {
|
|
7957
|
-
const y =
|
|
8122
|
+
const y = chunkHBXPK572_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
7958
8123
|
labels.push(
|
|
7959
8124
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7960
8125
|
"text",
|
|
@@ -7964,7 +8129,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7964
8129
|
textAnchor: "end",
|
|
7965
8130
|
fontSize: 8,
|
|
7966
8131
|
fill: "#64748b",
|
|
7967
|
-
children: hasDisplayUnits ?
|
|
8132
|
+
children: hasDisplayUnits ? chunkHBXPK572_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkHBXPK572_js.formatAxisValue(tickVal)
|
|
7968
8133
|
},
|
|
7969
8134
|
`${id}-vaxis-log-${i}`
|
|
7970
8135
|
)
|
|
@@ -7974,7 +8139,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7974
8139
|
const steps = 4;
|
|
7975
8140
|
for (let i = 0; i <= steps; i++) {
|
|
7976
8141
|
const val = range.min + range.span * i / steps;
|
|
7977
|
-
const y =
|
|
8142
|
+
const y = chunkHBXPK572_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
7978
8143
|
labels.push(
|
|
7979
8144
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7980
8145
|
"text",
|
|
@@ -7984,7 +8149,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7984
8149
|
textAnchor: "end",
|
|
7985
8150
|
fontSize: 8,
|
|
7986
8151
|
fill: "#64748b",
|
|
7987
|
-
children: hasDisplayUnits ?
|
|
8152
|
+
children: hasDisplayUnits ? chunkHBXPK572_js.formatAxisValueWithUnits(val, axisFormatting) : chunkHBXPK572_js.formatAxisValue(val)
|
|
7988
8153
|
},
|
|
7989
8154
|
`${id}-vaxis-${i}`
|
|
7990
8155
|
)
|
|
@@ -7992,7 +8157,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7992
8157
|
}
|
|
7993
8158
|
}
|
|
7994
8159
|
if (hasDisplayUnits) {
|
|
7995
|
-
const unitLabel =
|
|
8160
|
+
const unitLabel = chunkHBXPK572_js.getDisplayUnitLabel(
|
|
7996
8161
|
axisFormatting.displayUnits,
|
|
7997
8162
|
axisFormatting.displayUnitsLabel
|
|
7998
8163
|
);
|
|
@@ -8067,7 +8232,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
8067
8232
|
if (range.min >= 0) {
|
|
8068
8233
|
return null;
|
|
8069
8234
|
}
|
|
8070
|
-
const y =
|
|
8235
|
+
const y = chunkHBXPK572_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
8071
8236
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8072
8237
|
"line",
|
|
8073
8238
|
{
|
|
@@ -8091,7 +8256,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8091
8256
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
8092
8257
|
for (let i = 0; i <= steps; i++) {
|
|
8093
8258
|
const val = range.min + range.span * i / steps;
|
|
8094
|
-
const y =
|
|
8259
|
+
const y = chunkHBXPK572_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8095
8260
|
labels.push(
|
|
8096
8261
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8097
8262
|
"text",
|
|
@@ -8103,7 +8268,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8103
8268
|
fontFamily,
|
|
8104
8269
|
fontWeight,
|
|
8105
8270
|
fill: fontColor,
|
|
8106
|
-
children: hasDisplayUnits ?
|
|
8271
|
+
children: hasDisplayUnits ? chunkHBXPK572_js.formatAxisValueWithUnits(val, axisFormatting) : chunkHBXPK572_js.formatAxisValue(val)
|
|
8107
8272
|
},
|
|
8108
8273
|
`${id}-sec-vaxis-${i}`
|
|
8109
8274
|
)
|
|
@@ -8127,7 +8292,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8127
8292
|
);
|
|
8128
8293
|
}
|
|
8129
8294
|
if (hasDisplayUnits) {
|
|
8130
|
-
const unitLabel =
|
|
8295
|
+
const unitLabel = chunkHBXPK572_js.getDisplayUnitLabel(
|
|
8131
8296
|
axisFormatting.displayUnits,
|
|
8132
8297
|
axisFormatting.displayUnitsLabel
|
|
8133
8298
|
);
|
|
@@ -8158,7 +8323,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
8158
8323
|
const ticks = [];
|
|
8159
8324
|
for (let i = 0; i <= steps; i++) {
|
|
8160
8325
|
const val = range.min + range.span * i / steps;
|
|
8161
|
-
const y =
|
|
8326
|
+
const y = chunkHBXPK572_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8162
8327
|
ticks.push(
|
|
8163
8328
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8164
8329
|
"line",
|
|
@@ -8185,7 +8350,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
8185
8350
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
8186
8351
|
for (let i = 0; i <= steps; i++) {
|
|
8187
8352
|
const val = range.min + range.span * i / steps;
|
|
8188
|
-
const y =
|
|
8353
|
+
const y = chunkHBXPK572_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8189
8354
|
lines.push(
|
|
8190
8355
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8191
8356
|
"line",
|
|
@@ -8302,7 +8467,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
8302
8467
|
showK && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8303
8468
|
"th",
|
|
8304
8469
|
{
|
|
8305
|
-
"aria-label":
|
|
8470
|
+
"aria-label": chunkAALZCSY4_js.translationsEn["pptx.chart.rowLabelsAria"],
|
|
8306
8471
|
style: {
|
|
8307
8472
|
padding: "1px 4px",
|
|
8308
8473
|
fontWeight: 400,
|
|
@@ -8346,7 +8511,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
8346
8511
|
width: 8,
|
|
8347
8512
|
height: 8,
|
|
8348
8513
|
borderRadius: 2,
|
|
8349
|
-
backgroundColor:
|
|
8514
|
+
backgroundColor: chunkHBXPK572_js.seriesColor(
|
|
8350
8515
|
s,
|
|
8351
8516
|
si,
|
|
8352
8517
|
chartData.style?.styleId,
|
|
@@ -8385,8 +8550,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
8385
8550
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
8386
8551
|
const style = chartData.style;
|
|
8387
8552
|
const legendPos = style?.legendPosition || "b";
|
|
8388
|
-
const range =
|
|
8389
|
-
const layout =
|
|
8553
|
+
const range = chunkHBXPK572_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8554
|
+
const layout = chunkHBXPK572_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8390
8555
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8391
8556
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
8392
8557
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -8407,10 +8572,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
8407
8572
|
const close = closeSeries.values[ci] ?? high;
|
|
8408
8573
|
const isUp = close >= open;
|
|
8409
8574
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
8410
|
-
const highY =
|
|
8411
|
-
const lowY =
|
|
8412
|
-
const openY =
|
|
8413
|
-
const closeY =
|
|
8575
|
+
const highY = chunkHBXPK572_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
8576
|
+
const lowY = chunkHBXPK572_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
8577
|
+
const openY = chunkHBXPK572_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
8578
|
+
const closeY = chunkHBXPK572_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
8414
8579
|
elements.push(
|
|
8415
8580
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8416
8581
|
"line",
|
|
@@ -8453,7 +8618,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
8453
8618
|
textAnchor: "middle",
|
|
8454
8619
|
fontSize: 7,
|
|
8455
8620
|
fill: "#334155",
|
|
8456
|
-
children:
|
|
8621
|
+
children: chunkHBXPK572_js.formatAxisValue(close)
|
|
8457
8622
|
},
|
|
8458
8623
|
`${element.id}-stock-dl-${ci}`
|
|
8459
8624
|
)
|
|
@@ -8495,7 +8660,7 @@ function FailedToLoad() {
|
|
|
8495
8660
|
var LazySurfaceChart3DScene = React3__default.default.lazy(
|
|
8496
8661
|
async () => {
|
|
8497
8662
|
try {
|
|
8498
|
-
return await import('./SurfaceChart3DScene-
|
|
8663
|
+
return await import('./SurfaceChart3DScene-ZOTOHOIE.js');
|
|
8499
8664
|
} catch {
|
|
8500
8665
|
return { default: FailedToLoad };
|
|
8501
8666
|
}
|
|
@@ -8519,7 +8684,7 @@ var SurfaceChart3DErrorBoundary = class extends React3__default.default.Componen
|
|
|
8519
8684
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
8520
8685
|
const rows = chartData.series.length;
|
|
8521
8686
|
const cols = Math.max(categoryLabels.length, 1);
|
|
8522
|
-
const range =
|
|
8687
|
+
const range = chunkHBXPK572_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8523
8688
|
const heightMap = new Float32Array(rows * cols);
|
|
8524
8689
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
8525
8690
|
for (let r = 0; r < rows; r++) {
|
|
@@ -8639,8 +8804,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
8639
8804
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
8640
8805
|
const style = chartData.style;
|
|
8641
8806
|
const legendPos = style?.legendPosition || "b";
|
|
8642
|
-
const layout =
|
|
8643
|
-
const range =
|
|
8807
|
+
const layout = chunkHBXPK572_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
8808
|
+
const range = chunkHBXPK572_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8644
8809
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8645
8810
|
const seriesCount = chartData.series.length;
|
|
8646
8811
|
const cols = catCount - 1;
|
|
@@ -8730,8 +8895,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
8730
8895
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
8731
8896
|
const style = chartData.style;
|
|
8732
8897
|
const legendPos = style?.legendPosition || "b";
|
|
8733
|
-
const layout =
|
|
8734
|
-
const range =
|
|
8898
|
+
const layout = chunkHBXPK572_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8899
|
+
const range = chunkHBXPK572_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8735
8900
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8736
8901
|
const seriesCount = chartData.series.length;
|
|
8737
8902
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -8794,7 +8959,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
8794
8959
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
8795
8960
|
const style = chartData.style;
|
|
8796
8961
|
const legendPos = style?.legendPosition || "b";
|
|
8797
|
-
const layout =
|
|
8962
|
+
const layout = chunkHBXPK572_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
8798
8963
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
8799
8964
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
8800
8965
|
const rects = [];
|
|
@@ -8817,7 +8982,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
8817
8982
|
y: curY,
|
|
8818
8983
|
width: Math.max(w - 1, 1),
|
|
8819
8984
|
height: Math.max(h - 1, 1),
|
|
8820
|
-
fill:
|
|
8985
|
+
fill: chunkHBXPK572_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
8821
8986
|
rx: 2,
|
|
8822
8987
|
opacity: 0.85
|
|
8823
8988
|
},
|
|
@@ -8870,8 +9035,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8870
9035
|
const style = chartData.style;
|
|
8871
9036
|
const legendPos = style?.legendPosition || "b";
|
|
8872
9037
|
const values = chartData.series[0]?.values ?? [];
|
|
8873
|
-
const range =
|
|
8874
|
-
const layout =
|
|
9038
|
+
const range = chunkHBXPK572_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
9039
|
+
const layout = chunkHBXPK572_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8875
9040
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
8876
9041
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
8877
9042
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -8882,8 +9047,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8882
9047
|
const isLast = i === values.length - 1;
|
|
8883
9048
|
const startVal = isLast ? 0 : runningTotal;
|
|
8884
9049
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
8885
|
-
const barStartY =
|
|
8886
|
-
const barEndY =
|
|
9050
|
+
const barStartY = chunkHBXPK572_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
9051
|
+
const barEndY = chunkHBXPK572_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
8887
9052
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
8888
9053
|
const y = Math.min(barStartY, barEndY);
|
|
8889
9054
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -8912,7 +9077,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8912
9077
|
textAnchor: "middle",
|
|
8913
9078
|
fontSize: 7,
|
|
8914
9079
|
fill: "#334155",
|
|
8915
|
-
children:
|
|
9080
|
+
children: chunkHBXPK572_js.formatAxisValue(isLast ? endVal : val)
|
|
8916
9081
|
},
|
|
8917
9082
|
`${element.id}-wf-dl-${i}`
|
|
8918
9083
|
)
|
|
@@ -8960,18 +9125,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8960
9125
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
8961
9126
|
const style = chartData.style;
|
|
8962
9127
|
const legendPos = style?.legendPosition || "b";
|
|
8963
|
-
const layoutOpts =
|
|
9128
|
+
const layoutOpts = chunkHBXPK572_js.computeLayoutOptions(
|
|
8964
9129
|
chartData.axes,
|
|
8965
9130
|
chartData.dataTable,
|
|
8966
9131
|
chartData.series.length
|
|
8967
9132
|
);
|
|
8968
|
-
const layout =
|
|
8969
|
-
const { primary, secondary } =
|
|
9133
|
+
const layout = chunkHBXPK572_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
9134
|
+
const { primary, secondary } = chunkHBXPK572_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
8970
9135
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
8971
9136
|
const secondarySeries = secondary.map((e) => e.series);
|
|
8972
|
-
const range =
|
|
8973
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
8974
|
-
const secondaryAxisFmt =
|
|
9137
|
+
const range = chunkHBXPK572_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
9138
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkHBXPK572_js.computeValueRange(secondarySeries) : void 0;
|
|
9139
|
+
const secondaryAxisFmt = chunkHBXPK572_js.getSecondaryValueAxis(chartData.axes);
|
|
8975
9140
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8976
9141
|
const barSeriesCount = 1;
|
|
8977
9142
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -8987,8 +9152,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
8987
9152
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
8988
9153
|
barSeries.values.forEach((val, vi) => {
|
|
8989
9154
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
8990
|
-
const zeroY =
|
|
8991
|
-
const valY =
|
|
9155
|
+
const zeroY = chunkHBXPK572_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
9156
|
+
const valY = chunkHBXPK572_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
8992
9157
|
const y = Math.min(zeroY, valY);
|
|
8993
9158
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
8994
9159
|
barElements.push(
|
|
@@ -8999,7 +9164,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
8999
9164
|
y,
|
|
9000
9165
|
width: barWidth,
|
|
9001
9166
|
height: h,
|
|
9002
|
-
fill:
|
|
9167
|
+
fill: chunkHBXPK572_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
9003
9168
|
rx: 1
|
|
9004
9169
|
},
|
|
9005
9170
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -9015,7 +9180,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9015
9180
|
textAnchor: "middle",
|
|
9016
9181
|
fontSize: 7,
|
|
9017
9182
|
fill: "#334155",
|
|
9018
|
-
children:
|
|
9183
|
+
children: chunkHBXPK572_js.formatAxisValue(val)
|
|
9019
9184
|
},
|
|
9020
9185
|
`${element.id}-combo-bar-dl-${vi}`
|
|
9021
9186
|
)
|
|
@@ -9032,10 +9197,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9032
9197
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
9033
9198
|
const points = series.values.map((val, vi) => {
|
|
9034
9199
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
9035
|
-
const y =
|
|
9200
|
+
const y = chunkHBXPK572_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
9036
9201
|
return { x, y, val };
|
|
9037
9202
|
});
|
|
9038
|
-
const c =
|
|
9203
|
+
const c = chunkHBXPK572_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
9039
9204
|
lineElements.push(
|
|
9040
9205
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9041
9206
|
"polyline",
|
|
@@ -9062,7 +9227,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9062
9227
|
textAnchor: "middle",
|
|
9063
9228
|
fontSize: 7,
|
|
9064
9229
|
fill: "#334155",
|
|
9065
|
-
children:
|
|
9230
|
+
children: chunkHBXPK572_js.formatAxisValue(p.val)
|
|
9066
9231
|
},
|
|
9067
9232
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
9068
9233
|
)
|
|
@@ -9100,11 +9265,11 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9100
9265
|
}
|
|
9101
9266
|
function renderChartElement(element) {
|
|
9102
9267
|
if (element.type !== "chart") {
|
|
9103
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
9268
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkAALZCSY4_js.translationsEn["pptx.chart.heading"] });
|
|
9104
9269
|
}
|
|
9105
9270
|
const chartData = element.chartData;
|
|
9106
9271
|
if (!chartData || chartData.series.length === 0) {
|
|
9107
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
9272
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkAALZCSY4_js.translationsEn["pptx.chart.heading"] });
|
|
9108
9273
|
}
|
|
9109
9274
|
const longestSeriesLength = chartData.series.reduce(
|
|
9110
9275
|
(maxLength, series) => Math.max(maxLength, series.values.length),
|
|
@@ -10621,7 +10786,7 @@ function PresentationMediaController({
|
|
|
10621
10786
|
}
|
|
10622
10787
|
function renderMediaElement(element, mediaDataUrls, options) {
|
|
10623
10788
|
if (element.type !== "media") {
|
|
10624
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
10789
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkAALZCSY4_js.translationsEn["pptx.media.title"] });
|
|
10625
10790
|
}
|
|
10626
10791
|
const mediaType = element.mediaType;
|
|
10627
10792
|
const mediaPath = element.mediaPath;
|
|
@@ -10651,7 +10816,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
10651
10816
|
"img",
|
|
10652
10817
|
{
|
|
10653
10818
|
src: posterUrl,
|
|
10654
|
-
alt:
|
|
10819
|
+
alt: chunkAALZCSY4_js.translationsEn["pptx.media.posterAlt"],
|
|
10655
10820
|
className: "w-full h-full object-contain opacity-50"
|
|
10656
10821
|
}
|
|
10657
10822
|
),
|
|
@@ -10672,7 +10837,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
10672
10837
|
]
|
|
10673
10838
|
}
|
|
10674
10839
|
),
|
|
10675
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children:
|
|
10840
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: chunkAALZCSY4_js.translationsEn["pptx.media.notFound"] })
|
|
10676
10841
|
] })
|
|
10677
10842
|
] });
|
|
10678
10843
|
}
|
|
@@ -10713,7 +10878,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
10713
10878
|
"img",
|
|
10714
10879
|
{
|
|
10715
10880
|
src: posterUrl,
|
|
10716
|
-
alt:
|
|
10881
|
+
alt: chunkAALZCSY4_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
10717
10882
|
className: "w-full h-full object-contain"
|
|
10718
10883
|
}
|
|
10719
10884
|
),
|
|
@@ -10816,14 +10981,14 @@ function buildNotesPdf(pages) {
|
|
|
10816
10981
|
notes: page.notes,
|
|
10817
10982
|
slideNumber: page.slideNumber
|
|
10818
10983
|
}));
|
|
10819
|
-
const bytes =
|
|
10984
|
+
const bytes = chunkHBXPK572_js.buildNotesPdfBytes(images, meta);
|
|
10820
10985
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
10821
10986
|
return URL.createObjectURL(blob);
|
|
10822
10987
|
}
|
|
10823
10988
|
|
|
10824
10989
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
10825
10990
|
function buildPdfFromImageData(images) {
|
|
10826
|
-
const bytes =
|
|
10991
|
+
const bytes = chunkHBXPK572_js.buildSlidesPdfBytes(images);
|
|
10827
10992
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
10828
10993
|
return URL.createObjectURL(blob);
|
|
10829
10994
|
}
|
|
@@ -10832,7 +10997,7 @@ function buildPdfFromImageData(images) {
|
|
|
10832
10997
|
var activePreview = null;
|
|
10833
10998
|
function startPreviewAnimation(elementId, preset, options) {
|
|
10834
10999
|
stopPreviewAnimation();
|
|
10835
|
-
const descriptor =
|
|
11000
|
+
const descriptor = chunkHBXPK572_js.buildPreviewAnimation(preset, options);
|
|
10836
11001
|
if (!descriptor) {
|
|
10837
11002
|
return;
|
|
10838
11003
|
}
|
|
@@ -11270,7 +11435,7 @@ function useElementOperations(input) {
|
|
|
11270
11435
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
11271
11436
|
const updateElementById = React3.useCallback(
|
|
11272
11437
|
(elementId, updates) => {
|
|
11273
|
-
if (
|
|
11438
|
+
if (chunkHBXPK572_js.isTemplateElementId(elementId)) {
|
|
11274
11439
|
const slideId = activeSlide?.id;
|
|
11275
11440
|
if (slideId) {
|
|
11276
11441
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -11310,7 +11475,7 @@ function useElementOperations(input) {
|
|
|
11310
11475
|
);
|
|
11311
11476
|
const updateSelectedShapeStyle = React3.useCallback(
|
|
11312
11477
|
(updates) => {
|
|
11313
|
-
if (!selectedElement || !
|
|
11478
|
+
if (!selectedElement || !chunkEXDUEXTO_js.hasShapeProperties(selectedElement)) {
|
|
11314
11479
|
return;
|
|
11315
11480
|
}
|
|
11316
11481
|
updateSelectedElement({
|
|
@@ -11321,17 +11486,17 @@ function useElementOperations(input) {
|
|
|
11321
11486
|
);
|
|
11322
11487
|
const updateSelectedTextStyle = React3.useCallback(
|
|
11323
11488
|
(updates) => {
|
|
11324
|
-
if (!selectedElement || !
|
|
11489
|
+
if (!selectedElement || !chunkEXDUEXTO_js.hasTextProperties(selectedElement)) {
|
|
11325
11490
|
return;
|
|
11326
11491
|
}
|
|
11327
|
-
const inlineSel =
|
|
11492
|
+
const inlineSel = chunkHBXPK572_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
11328
11493
|
if (inlineSel && selectedElement.textSegments) {
|
|
11329
|
-
const { newSegments: newSegments2, newSelection } =
|
|
11494
|
+
const { newSegments: newSegments2, newSelection } = chunkHBXPK572_js.applyStyleToSelectedSegments(
|
|
11330
11495
|
selectedElement.textSegments,
|
|
11331
11496
|
inlineSel,
|
|
11332
11497
|
updates
|
|
11333
11498
|
);
|
|
11334
|
-
|
|
11499
|
+
chunkHBXPK572_js.setPendingSelectionRestore(newSelection);
|
|
11335
11500
|
updateSelectedElement({
|
|
11336
11501
|
textSegments: newSegments2
|
|
11337
11502
|
});
|
|
@@ -11351,12 +11516,12 @@ function useElementOperations(input) {
|
|
|
11351
11516
|
);
|
|
11352
11517
|
const updateSelectedTextCase = React3.useCallback(
|
|
11353
11518
|
(mode) => {
|
|
11354
|
-
if (!selectedElement || !
|
|
11519
|
+
if (!selectedElement || !chunkEXDUEXTO_js.hasTextProperties(selectedElement)) {
|
|
11355
11520
|
return;
|
|
11356
11521
|
}
|
|
11357
|
-
const inlineSel =
|
|
11522
|
+
const inlineSel = chunkHBXPK572_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
11358
11523
|
if (inlineSel && selectedElement.textSegments) {
|
|
11359
|
-
const newSegments =
|
|
11524
|
+
const newSegments = chunkHBXPK572_js.applyCaseTransformToSegments(
|
|
11360
11525
|
selectedElement.textSegments,
|
|
11361
11526
|
inlineSel,
|
|
11362
11527
|
mode
|
|
@@ -11366,14 +11531,14 @@ function useElementOperations(input) {
|
|
|
11366
11531
|
}
|
|
11367
11532
|
const updates = {};
|
|
11368
11533
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
11369
|
-
updates.textSegments =
|
|
11534
|
+
updates.textSegments = chunkHBXPK572_js.applyCaseTransformToSegments(
|
|
11370
11535
|
selectedElement.textSegments,
|
|
11371
11536
|
null,
|
|
11372
11537
|
mode
|
|
11373
11538
|
);
|
|
11374
11539
|
}
|
|
11375
11540
|
if (typeof selectedElement.text === "string") {
|
|
11376
|
-
updates.text =
|
|
11541
|
+
updates.text = chunkHBXPK572_js.transformTextCase(selectedElement.text, mode);
|
|
11377
11542
|
}
|
|
11378
11543
|
updateSelectedElement(updates);
|
|
11379
11544
|
},
|
|
@@ -11428,7 +11593,7 @@ function useSectionOperations(input) {
|
|
|
11428
11593
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
11429
11594
|
const addSection2 = React3.useCallback(
|
|
11430
11595
|
(name, afterSlideIndex) => {
|
|
11431
|
-
const result =
|
|
11596
|
+
const result = chunkHBXPK572_js.addSection(sections, slides, name, afterSlideIndex);
|
|
11432
11597
|
setSlides(result.slides);
|
|
11433
11598
|
setSections(result.sections);
|
|
11434
11599
|
markDirty();
|
|
@@ -11437,7 +11602,7 @@ function useSectionOperations(input) {
|
|
|
11437
11602
|
);
|
|
11438
11603
|
const renameSection2 = React3.useCallback(
|
|
11439
11604
|
(sectionId, newName) => {
|
|
11440
|
-
const result =
|
|
11605
|
+
const result = chunkHBXPK572_js.renameSection(sections, slides, sectionId, newName);
|
|
11441
11606
|
setSections(result.sections);
|
|
11442
11607
|
setSlides(result.slides);
|
|
11443
11608
|
markDirty();
|
|
@@ -11446,7 +11611,7 @@ function useSectionOperations(input) {
|
|
|
11446
11611
|
);
|
|
11447
11612
|
const deleteSection2 = React3.useCallback(
|
|
11448
11613
|
(sectionId) => {
|
|
11449
|
-
const result =
|
|
11614
|
+
const result = chunkHBXPK572_js.deleteSection(sections, slides, sectionId);
|
|
11450
11615
|
setSections(result.sections);
|
|
11451
11616
|
setSlides(result.slides);
|
|
11452
11617
|
markDirty();
|
|
@@ -11455,21 +11620,21 @@ function useSectionOperations(input) {
|
|
|
11455
11620
|
);
|
|
11456
11621
|
const moveSectionUp2 = React3.useCallback(
|
|
11457
11622
|
(sectionId) => {
|
|
11458
|
-
setSections(
|
|
11623
|
+
setSections(chunkHBXPK572_js.moveSectionUp(sections, sectionId));
|
|
11459
11624
|
markDirty();
|
|
11460
11625
|
},
|
|
11461
11626
|
[sections, setSections, markDirty]
|
|
11462
11627
|
);
|
|
11463
11628
|
const moveSectionDown2 = React3.useCallback(
|
|
11464
11629
|
(sectionId) => {
|
|
11465
|
-
setSections(
|
|
11630
|
+
setSections(chunkHBXPK572_js.moveSectionDown(sections, sectionId));
|
|
11466
11631
|
markDirty();
|
|
11467
11632
|
},
|
|
11468
11633
|
[sections, setSections, markDirty]
|
|
11469
11634
|
);
|
|
11470
11635
|
const moveSlidesToSection2 = React3.useCallback(
|
|
11471
11636
|
(slideIndexes, targetSectionId) => {
|
|
11472
|
-
const result =
|
|
11637
|
+
const result = chunkHBXPK572_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
11473
11638
|
setSlides(result.slides);
|
|
11474
11639
|
setSections(result.sections);
|
|
11475
11640
|
markDirty();
|
|
@@ -11488,7 +11653,7 @@ function useSectionOperations(input) {
|
|
|
11488
11653
|
|
|
11489
11654
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
11490
11655
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
11491
|
-
const resized =
|
|
11656
|
+
const resized = chunkHBXPK572_js.applyResize(
|
|
11492
11657
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
11493
11658
|
handle,
|
|
11494
11659
|
dx,
|
|
@@ -11500,7 +11665,7 @@ function computeResizeGeometry(handle, startX, startY, startWidth, startHeight,
|
|
|
11500
11665
|
if (!snapToGrid) {
|
|
11501
11666
|
return box;
|
|
11502
11667
|
}
|
|
11503
|
-
return
|
|
11668
|
+
return chunkHBXPK572_js.snapBoxToGrid(box, handle, gridSpacingPx, MIN_ELEMENT_SIZE);
|
|
11504
11669
|
}
|
|
11505
11670
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
11506
11671
|
const range = startWidth || 200;
|
|
@@ -11610,7 +11775,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
11610
11775
|
width: el.width,
|
|
11611
11776
|
height: el.height
|
|
11612
11777
|
}));
|
|
11613
|
-
const snapResult =
|
|
11778
|
+
const snapResult = chunkHBXPK572_js.computeSnapToShape(
|
|
11614
11779
|
targetX,
|
|
11615
11780
|
targetY,
|
|
11616
11781
|
primaryEl.width,
|
|
@@ -11753,13 +11918,13 @@ function processPointerUp(input) {
|
|
|
11753
11918
|
if (i !== activeSlideIndex) {
|
|
11754
11919
|
return s;
|
|
11755
11920
|
}
|
|
11756
|
-
const rerouted =
|
|
11921
|
+
const rerouted = chunkHBXPK572_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
11757
11922
|
if (rerouted.length === 0) {
|
|
11758
11923
|
return s;
|
|
11759
11924
|
}
|
|
11760
11925
|
return {
|
|
11761
11926
|
...s,
|
|
11762
|
-
elements:
|
|
11927
|
+
elements: chunkHBXPK572_js.applyReroutedConnectors(s.elements, rerouted)
|
|
11763
11928
|
};
|
|
11764
11929
|
})
|
|
11765
11930
|
);
|
|
@@ -11778,9 +11943,9 @@ function processPointerUp(input) {
|
|
|
11778
11943
|
}
|
|
11779
11944
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
11780
11945
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
11781
|
-
const hitIds =
|
|
11946
|
+
const hitIds = chunkHBXPK572_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
11782
11947
|
if (marquee.additive) {
|
|
11783
|
-
const merged =
|
|
11948
|
+
const merged = chunkHBXPK572_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
11784
11949
|
if (merged.length > 0) {
|
|
11785
11950
|
applySelection(merged[0], merged);
|
|
11786
11951
|
} else {
|
|
@@ -11803,8 +11968,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
11803
11968
|
}
|
|
11804
11969
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
11805
11970
|
});
|
|
11806
|
-
const rerouted =
|
|
11807
|
-
return
|
|
11971
|
+
const rerouted = chunkHBXPK572_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
11972
|
+
return chunkHBXPK572_js.applyReroutedConnectors(movedElements, rerouted);
|
|
11808
11973
|
};
|
|
11809
11974
|
if (editTemplateMode) {
|
|
11810
11975
|
const slideId = activeSlide?.id;
|
|
@@ -11954,8 +12119,8 @@ function useCanvasInteractions(input) {
|
|
|
11954
12119
|
return;
|
|
11955
12120
|
}
|
|
11956
12121
|
const el = elementLookup.get(editId);
|
|
11957
|
-
if (el &&
|
|
11958
|
-
const newSegments =
|
|
12122
|
+
if (el && chunkEXDUEXTO_js.hasTextProperties(el)) {
|
|
12123
|
+
const newSegments = chunkHBXPK572_js.remapTextToSegments(inlineEditingText, el.textSegments, el.textStyle);
|
|
11959
12124
|
ops.updateElementById(editId, {
|
|
11960
12125
|
text: inlineEditingText,
|
|
11961
12126
|
textSegments: newSegments
|
|
@@ -11966,7 +12131,7 @@ function useCanvasInteractions(input) {
|
|
|
11966
12131
|
setInlineEditingText("");
|
|
11967
12132
|
};
|
|
11968
12133
|
const openEquationEditorForElement = (el) => {
|
|
11969
|
-
if (!
|
|
12134
|
+
if (!chunkEXDUEXTO_js.hasTextProperties(el)) {
|
|
11970
12135
|
return false;
|
|
11971
12136
|
}
|
|
11972
12137
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -11995,7 +12160,7 @@ function useCanvasInteractions(input) {
|
|
|
11995
12160
|
justSelectedRef.current = false;
|
|
11996
12161
|
} else {
|
|
11997
12162
|
const el = elementLookup.get(elementId);
|
|
11998
|
-
if (el &&
|
|
12163
|
+
if (el && chunkEXDUEXTO_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
11999
12164
|
if (!openEquationEditorForElement(el)) {
|
|
12000
12165
|
setInlineEditingElementId(elementId);
|
|
12001
12166
|
setInlineEditingText(el.text ?? "");
|
|
@@ -12014,7 +12179,7 @@ function useCanvasInteractions(input) {
|
|
|
12014
12179
|
if (openEquationEditorForElement(el)) {
|
|
12015
12180
|
return;
|
|
12016
12181
|
}
|
|
12017
|
-
if (
|
|
12182
|
+
if (chunkEXDUEXTO_js.hasTextProperties(el)) {
|
|
12018
12183
|
setInlineEditingElementId(elementId);
|
|
12019
12184
|
setInlineEditingText(el.text ?? "");
|
|
12020
12185
|
}
|
|
@@ -12201,7 +12366,7 @@ function createFileHandlers(deps) {
|
|
|
12201
12366
|
h = Math.round(h * scale);
|
|
12202
12367
|
}
|
|
12203
12368
|
addElement({
|
|
12204
|
-
id:
|
|
12369
|
+
id: chunkHBXPK572_js.generateElementId(),
|
|
12205
12370
|
type: "image",
|
|
12206
12371
|
x: Math.round((canvasSize.width - w) / 2),
|
|
12207
12372
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -12212,7 +12377,7 @@ function createFileHandlers(deps) {
|
|
|
12212
12377
|
};
|
|
12213
12378
|
img.onerror = () => {
|
|
12214
12379
|
addElement({
|
|
12215
|
-
id:
|
|
12380
|
+
id: chunkHBXPK572_js.generateElementId(),
|
|
12216
12381
|
type: "image",
|
|
12217
12382
|
x: 100,
|
|
12218
12383
|
y: 100,
|
|
@@ -12238,7 +12403,7 @@ function createFileHandlers(deps) {
|
|
|
12238
12403
|
const elFilePath = file.path;
|
|
12239
12404
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
12240
12405
|
addElement({
|
|
12241
|
-
id:
|
|
12406
|
+
id: chunkHBXPK572_js.generateElementId(),
|
|
12242
12407
|
type: "media",
|
|
12243
12408
|
mediaType,
|
|
12244
12409
|
mediaMimeType: file.type || void 0,
|
|
@@ -12413,13 +12578,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
12413
12578
|
return;
|
|
12414
12579
|
}
|
|
12415
12580
|
addElement({
|
|
12416
|
-
id:
|
|
12581
|
+
id: chunkHBXPK572_js.generateElementId(),
|
|
12417
12582
|
type: "smartArt",
|
|
12418
12583
|
x: 100,
|
|
12419
12584
|
y: 120,
|
|
12420
12585
|
width: 600,
|
|
12421
12586
|
height: 340,
|
|
12422
|
-
smartArtData:
|
|
12587
|
+
smartArtData: chunkHBXPK572_js.buildSmartArtPresetData(
|
|
12423
12588
|
layout,
|
|
12424
12589
|
defaultItems,
|
|
12425
12590
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -12431,7 +12596,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12431
12596
|
return;
|
|
12432
12597
|
}
|
|
12433
12598
|
addElement({
|
|
12434
|
-
id:
|
|
12599
|
+
id: chunkHBXPK572_js.generateElementId(),
|
|
12435
12600
|
type: "shape",
|
|
12436
12601
|
x: 120,
|
|
12437
12602
|
y: 200,
|
|
@@ -12490,7 +12655,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12490
12655
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
12491
12656
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
12492
12657
|
addElement({
|
|
12493
|
-
id:
|
|
12658
|
+
id: chunkHBXPK572_js.generateElementId(),
|
|
12494
12659
|
type: "shape",
|
|
12495
12660
|
x: 120,
|
|
12496
12661
|
y: 200,
|
|
@@ -12512,11 +12677,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
12512
12677
|
if (!activeSlide) {
|
|
12513
12678
|
return;
|
|
12514
12679
|
}
|
|
12515
|
-
const preset =
|
|
12680
|
+
const preset = chunkHBXPK572_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
12516
12681
|
if (!preset) {
|
|
12517
12682
|
return;
|
|
12518
12683
|
}
|
|
12519
|
-
const defaultPptxAction =
|
|
12684
|
+
const defaultPptxAction = chunkEXDUEXTO_js.elementActionToPptxAction({
|
|
12520
12685
|
trigger: "click",
|
|
12521
12686
|
type: preset.defaultAction
|
|
12522
12687
|
});
|
|
@@ -12525,7 +12690,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12525
12690
|
defaultPptxAction.highlightClick = true;
|
|
12526
12691
|
}
|
|
12527
12692
|
addElement({
|
|
12528
|
-
id:
|
|
12693
|
+
id: chunkHBXPK572_js.generateElementId(),
|
|
12529
12694
|
type: "shape",
|
|
12530
12695
|
x: 150,
|
|
12531
12696
|
y: 150,
|
|
@@ -12592,7 +12757,7 @@ function useInsertElements(input) {
|
|
|
12592
12757
|
return;
|
|
12593
12758
|
}
|
|
12594
12759
|
addElement({
|
|
12595
|
-
id:
|
|
12760
|
+
id: chunkHBXPK572_js.generateElementId(),
|
|
12596
12761
|
type: "text",
|
|
12597
12762
|
x: 100,
|
|
12598
12763
|
y: 100,
|
|
@@ -12607,7 +12772,7 @@ function useInsertElements(input) {
|
|
|
12607
12772
|
return;
|
|
12608
12773
|
}
|
|
12609
12774
|
addElement({
|
|
12610
|
-
id:
|
|
12775
|
+
id: chunkHBXPK572_js.generateElementId(),
|
|
12611
12776
|
type: "shape",
|
|
12612
12777
|
x: 150,
|
|
12613
12778
|
y: 150,
|
|
@@ -12626,15 +12791,15 @@ function useInsertElements(input) {
|
|
|
12626
12791
|
return;
|
|
12627
12792
|
}
|
|
12628
12793
|
addElement({
|
|
12629
|
-
...
|
|
12630
|
-
id:
|
|
12794
|
+
...chunkHBXPK572_js.newTableElement(DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
12795
|
+
id: chunkHBXPK572_js.generateElementId()
|
|
12631
12796
|
});
|
|
12632
12797
|
};
|
|
12633
12798
|
const handleAddChart = (chartType) => {
|
|
12634
12799
|
if (!activeSlide) {
|
|
12635
12800
|
return;
|
|
12636
12801
|
}
|
|
12637
|
-
addElement(
|
|
12802
|
+
addElement(chunkHBXPK572_js.createDefaultChartElement(chartType));
|
|
12638
12803
|
};
|
|
12639
12804
|
const structured = createStructuredElementHandlers({
|
|
12640
12805
|
activeSlide,
|
|
@@ -12704,7 +12869,7 @@ function useClipboardHandlers(input) {
|
|
|
12704
12869
|
if (!selectedElement) {
|
|
12705
12870
|
return;
|
|
12706
12871
|
}
|
|
12707
|
-
setClipboardPayload(
|
|
12872
|
+
setClipboardPayload(chunkHBXPK572_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
12708
12873
|
};
|
|
12709
12874
|
const handleDelete = () => {
|
|
12710
12875
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -12721,7 +12886,7 @@ function useClipboardHandlers(input) {
|
|
|
12721
12886
|
handleDelete();
|
|
12722
12887
|
};
|
|
12723
12888
|
const insertClone = (source) => {
|
|
12724
|
-
const clone =
|
|
12889
|
+
const clone = chunkHBXPK572_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
12725
12890
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
12726
12891
|
ops.applySelection(clone.id);
|
|
12727
12892
|
history.markDirty();
|
|
@@ -12756,7 +12921,7 @@ function resolveShapePath(el) {
|
|
|
12756
12921
|
return el.pathData;
|
|
12757
12922
|
}
|
|
12758
12923
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
12759
|
-
const clipPath =
|
|
12924
|
+
const clipPath = chunkEXDUEXTO_js.getPresetShapeClipPath(el.shapeType);
|
|
12760
12925
|
if (clipPath) {
|
|
12761
12926
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
12762
12927
|
if (svgPath) {
|
|
@@ -12807,7 +12972,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
12807
12972
|
return parts.join(" ");
|
|
12808
12973
|
}
|
|
12809
12974
|
function transformPathToGlobal(pathData, el) {
|
|
12810
|
-
const polys =
|
|
12975
|
+
const polys = chunkEXDUEXTO_js.svgPathToPolygons(pathData);
|
|
12811
12976
|
if (polys.length === 0) {
|
|
12812
12977
|
return pathData;
|
|
12813
12978
|
}
|
|
@@ -12827,10 +12992,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
12827
12992
|
y: pt.y * scaleY + el.y
|
|
12828
12993
|
}))
|
|
12829
12994
|
);
|
|
12830
|
-
return
|
|
12995
|
+
return chunkEXDUEXTO_js.polygonsToSvgPath(transformed);
|
|
12831
12996
|
}
|
|
12832
12997
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
12833
|
-
const polys =
|
|
12998
|
+
const polys = chunkEXDUEXTO_js.svgPathToPolygons(pathData);
|
|
12834
12999
|
if (polys.length === 0) {
|
|
12835
13000
|
return pathData;
|
|
12836
13001
|
}
|
|
@@ -12840,10 +13005,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
12840
13005
|
y: pt.y - y
|
|
12841
13006
|
}))
|
|
12842
13007
|
);
|
|
12843
|
-
return
|
|
13008
|
+
return chunkEXDUEXTO_js.polygonsToSvgPath(transformed);
|
|
12844
13009
|
}
|
|
12845
13010
|
function pathBounds(pathData) {
|
|
12846
|
-
const polys =
|
|
13011
|
+
const polys = chunkEXDUEXTO_js.svgPathToPolygons(pathData);
|
|
12847
13012
|
let minX = Infinity;
|
|
12848
13013
|
let minY = Infinity;
|
|
12849
13014
|
let maxX = -Infinity;
|
|
@@ -12902,7 +13067,7 @@ function useMergeShapesHandler(input) {
|
|
|
12902
13067
|
let allFragments = [];
|
|
12903
13068
|
let remaining = globalPaths[0];
|
|
12904
13069
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
12905
|
-
const frags =
|
|
13070
|
+
const frags = chunkEXDUEXTO_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
12906
13071
|
if (Array.isArray(frags)) {
|
|
12907
13072
|
allFragments = frags;
|
|
12908
13073
|
}
|
|
@@ -12931,7 +13096,7 @@ function useMergeShapesHandler(input) {
|
|
|
12931
13096
|
bounds.height
|
|
12932
13097
|
);
|
|
12933
13098
|
const newEl = {
|
|
12934
|
-
id:
|
|
13099
|
+
id: chunkHBXPK572_js.generateElementId(),
|
|
12935
13100
|
type: "shape",
|
|
12936
13101
|
x: bounds.x,
|
|
12937
13102
|
y: bounds.y,
|
|
@@ -12969,7 +13134,7 @@ function useMergeShapesHandler(input) {
|
|
|
12969
13134
|
} else {
|
|
12970
13135
|
let resultPath = globalPaths[0];
|
|
12971
13136
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
12972
|
-
const result =
|
|
13137
|
+
const result = chunkEXDUEXTO_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
12973
13138
|
if (typeof result === "string") {
|
|
12974
13139
|
resultPath = result;
|
|
12975
13140
|
}
|
|
@@ -12990,7 +13155,7 @@ function useMergeShapesHandler(input) {
|
|
|
12990
13155
|
);
|
|
12991
13156
|
const primary = targets[0];
|
|
12992
13157
|
const newEl = {
|
|
12993
|
-
id:
|
|
13158
|
+
id: chunkHBXPK572_js.generateElementId(),
|
|
12994
13159
|
type: "shape",
|
|
12995
13160
|
x: bounds.x,
|
|
12996
13161
|
y: bounds.y,
|
|
@@ -13053,7 +13218,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13053
13218
|
if (ids.length < 2 || !activeSlide) {
|
|
13054
13219
|
return;
|
|
13055
13220
|
}
|
|
13056
|
-
const { elements, groupId } =
|
|
13221
|
+
const { elements, groupId } = chunkHBXPK572_js.groupElements(ops.activeElements, ids, chunkHBXPK572_js.generateElementId());
|
|
13057
13222
|
if (groupId === null) {
|
|
13058
13223
|
return;
|
|
13059
13224
|
}
|
|
@@ -13066,12 +13231,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13066
13231
|
return;
|
|
13067
13232
|
}
|
|
13068
13233
|
const group = selectedElement;
|
|
13069
|
-
const intoTemplate =
|
|
13234
|
+
const intoTemplate = chunkHBXPK572_js.isTemplateElementId(group.id);
|
|
13070
13235
|
const ungrouped = group.children.map((child) => ({
|
|
13071
13236
|
...structuredClone(child),
|
|
13072
13237
|
// Keep child ids in the same store as the group so later edits route
|
|
13073
13238
|
// correctly: template groups yield template-prefixed child ids.
|
|
13074
|
-
id: intoTemplate ?
|
|
13239
|
+
id: intoTemplate ? chunkHBXPK572_js.makeCloneId(true, child.id || group.id) : child.id || chunkHBXPK572_js.generateElementId(),
|
|
13075
13240
|
x: child.x + group.x,
|
|
13076
13241
|
y: child.y + group.y
|
|
13077
13242
|
}));
|
|
@@ -13095,7 +13260,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13095
13260
|
if (!edge) {
|
|
13096
13261
|
return;
|
|
13097
13262
|
}
|
|
13098
|
-
const positions =
|
|
13263
|
+
const positions = chunkHBXPK572_js.alignElements(selectedElements, edge);
|
|
13099
13264
|
for (const [id, pos] of positions) {
|
|
13100
13265
|
const el = elementLookup.get(id);
|
|
13101
13266
|
if (!el) {
|
|
@@ -13113,7 +13278,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13113
13278
|
if (!distAxis) {
|
|
13114
13279
|
return;
|
|
13115
13280
|
}
|
|
13116
|
-
const positions =
|
|
13281
|
+
const positions = chunkHBXPK572_js.distributeElements(selectedElements, distAxis);
|
|
13117
13282
|
for (const [id, pos] of positions) {
|
|
13118
13283
|
const el = elementLookup.get(id);
|
|
13119
13284
|
if (!el) {
|
|
@@ -13130,7 +13295,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13130
13295
|
}
|
|
13131
13296
|
const id = selectedElement.id;
|
|
13132
13297
|
ops.updateActiveElements(
|
|
13133
|
-
(els) => direction === "forward" ?
|
|
13298
|
+
(els) => direction === "forward" ? chunkHBXPK572_js.bringForward(els, id) : direction === "backward" ? chunkHBXPK572_js.sendBackward(els, id) : els
|
|
13134
13299
|
);
|
|
13135
13300
|
history.markDirty();
|
|
13136
13301
|
};
|
|
@@ -13140,7 +13305,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13140
13305
|
}
|
|
13141
13306
|
const id = selectedElement.id;
|
|
13142
13307
|
ops.updateActiveElements(
|
|
13143
|
-
(els) => direction === "front" ?
|
|
13308
|
+
(els) => direction === "front" ? chunkHBXPK572_js.bringToFront(els, id) : chunkHBXPK572_js.sendToBack(els, id)
|
|
13144
13309
|
);
|
|
13145
13310
|
history.markDirty();
|
|
13146
13311
|
};
|
|
@@ -13262,7 +13427,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
13262
13427
|
function useSlideManagement(input) {
|
|
13263
13428
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
13264
13429
|
const handleAddSlide = () => {
|
|
13265
|
-
const newSlide =
|
|
13430
|
+
const newSlide = chunkHBXPK572_js.createBlankSlide(slides.length + 1);
|
|
13266
13431
|
ops.updateSlides((prev) => {
|
|
13267
13432
|
const next = [...prev];
|
|
13268
13433
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -13325,7 +13490,7 @@ function useSlideManagement(input) {
|
|
|
13325
13490
|
}
|
|
13326
13491
|
const clone = {
|
|
13327
13492
|
...src,
|
|
13328
|
-
id:
|
|
13493
|
+
id: chunkHBXPK572_js.makeSlideId(),
|
|
13329
13494
|
elements: src.elements.map((el) => ({
|
|
13330
13495
|
...el,
|
|
13331
13496
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -13357,7 +13522,7 @@ function useSlideManagement(input) {
|
|
|
13357
13522
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
13358
13523
|
const insertAt = activeSlideIndex + 1;
|
|
13359
13524
|
const draft = {
|
|
13360
|
-
...
|
|
13525
|
+
...chunkHBXPK572_js.createBlankSlide(slides.length + 1),
|
|
13361
13526
|
layoutPath,
|
|
13362
13527
|
...layoutName ? { layoutName } : {}
|
|
13363
13528
|
};
|
|
@@ -13418,7 +13583,7 @@ function createTableMergeHandlers(input) {
|
|
|
13418
13583
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
13419
13584
|
return;
|
|
13420
13585
|
}
|
|
13421
|
-
const newTableData =
|
|
13586
|
+
const newTableData = chunkHBXPK572_js.mergeCells(
|
|
13422
13587
|
[
|
|
13423
13588
|
{ row: rowIndex, col: columnIndex },
|
|
13424
13589
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -13426,7 +13591,7 @@ function createTableMergeHandlers(input) {
|
|
|
13426
13591
|
td
|
|
13427
13592
|
);
|
|
13428
13593
|
const updates = { tableData: newTableData };
|
|
13429
|
-
const newRawXml =
|
|
13594
|
+
const newRawXml = chunkEXDUEXTO_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13430
13595
|
if (newRawXml) {
|
|
13431
13596
|
updates.rawXml = newRawXml;
|
|
13432
13597
|
}
|
|
@@ -13452,7 +13617,7 @@ function createTableMergeHandlers(input) {
|
|
|
13452
13617
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
13453
13618
|
return;
|
|
13454
13619
|
}
|
|
13455
|
-
const newTableData =
|
|
13620
|
+
const newTableData = chunkHBXPK572_js.mergeCells(
|
|
13456
13621
|
[
|
|
13457
13622
|
{ row: rowIndex, col: columnIndex },
|
|
13458
13623
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -13460,7 +13625,7 @@ function createTableMergeHandlers(input) {
|
|
|
13460
13625
|
td
|
|
13461
13626
|
);
|
|
13462
13627
|
const updates = { tableData: newTableData };
|
|
13463
|
-
const newRawXml =
|
|
13628
|
+
const newRawXml = chunkEXDUEXTO_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13464
13629
|
if (newRawXml) {
|
|
13465
13630
|
updates.rawXml = newRawXml;
|
|
13466
13631
|
}
|
|
@@ -13475,9 +13640,9 @@ function createTableMergeHandlers(input) {
|
|
|
13475
13640
|
return;
|
|
13476
13641
|
}
|
|
13477
13642
|
const td = selectedElement.tableData;
|
|
13478
|
-
const newTableData =
|
|
13643
|
+
const newTableData = chunkHBXPK572_js.mergeCells(ts.selectedCells, td);
|
|
13479
13644
|
const updates = { tableData: newTableData };
|
|
13480
|
-
const newRawXml =
|
|
13645
|
+
const newRawXml = chunkEXDUEXTO_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13481
13646
|
if (newRawXml) {
|
|
13482
13647
|
updates.rawXml = newRawXml;
|
|
13483
13648
|
}
|
|
@@ -13494,9 +13659,9 @@ function createTableMergeHandlers(input) {
|
|
|
13494
13659
|
}
|
|
13495
13660
|
const { rowIndex, columnIndex } = ts;
|
|
13496
13661
|
const td = selectedElement.tableData;
|
|
13497
|
-
const newTableData =
|
|
13662
|
+
const newTableData = chunkHBXPK572_js.splitCell(rowIndex, columnIndex, td);
|
|
13498
13663
|
const updates = { tableData: newTableData };
|
|
13499
|
-
const newRawXml =
|
|
13664
|
+
const newRawXml = chunkEXDUEXTO_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13500
13665
|
if (newRawXml) {
|
|
13501
13666
|
updates.rawXml = newRawXml;
|
|
13502
13667
|
}
|
|
@@ -13540,7 +13705,7 @@ function createTableStructHandlers(input) {
|
|
|
13540
13705
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
13541
13706
|
}
|
|
13542
13707
|
if (el.rawXml) {
|
|
13543
|
-
const newRawXml =
|
|
13708
|
+
const newRawXml = chunkEXDUEXTO_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
13544
13709
|
if (newRawXml) {
|
|
13545
13710
|
updates.rawXml = newRawXml;
|
|
13546
13711
|
}
|
|
@@ -13564,7 +13729,7 @@ function createTableStructHandlers(input) {
|
|
|
13564
13729
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
13565
13730
|
const updates = {};
|
|
13566
13731
|
if (selectedElement.rawXml) {
|
|
13567
|
-
const newRawXml =
|
|
13732
|
+
const newRawXml = chunkEXDUEXTO_js.updateCellTextStyleInRawXml(
|
|
13568
13733
|
selectedElement,
|
|
13569
13734
|
rowIndex,
|
|
13570
13735
|
colIndex,
|
|
@@ -13628,9 +13793,9 @@ function createTableStructHandlers(input) {
|
|
|
13628
13793
|
return;
|
|
13629
13794
|
}
|
|
13630
13795
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
13631
|
-
const newTableData =
|
|
13796
|
+
const newTableData = chunkHBXPK572_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
13632
13797
|
const updates = { tableData: newTableData };
|
|
13633
|
-
const newRawXml =
|
|
13798
|
+
const newRawXml = chunkEXDUEXTO_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13634
13799
|
if (newRawXml) {
|
|
13635
13800
|
updates.rawXml = newRawXml;
|
|
13636
13801
|
}
|
|
@@ -13643,12 +13808,12 @@ function createTableStructHandlers(input) {
|
|
|
13643
13808
|
}
|
|
13644
13809
|
const td = selectedElement.tableData;
|
|
13645
13810
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
13646
|
-
const newTableData =
|
|
13811
|
+
const newTableData = chunkHBXPK572_js.deleteTableRow(td, rowIdx);
|
|
13647
13812
|
if (newTableData === td) {
|
|
13648
13813
|
return;
|
|
13649
13814
|
}
|
|
13650
13815
|
const updates = { tableData: newTableData };
|
|
13651
|
-
const newRawXml =
|
|
13816
|
+
const newRawXml = chunkEXDUEXTO_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13652
13817
|
if (newRawXml) {
|
|
13653
13818
|
updates.rawXml = newRawXml;
|
|
13654
13819
|
}
|
|
@@ -13660,9 +13825,9 @@ function createTableStructHandlers(input) {
|
|
|
13660
13825
|
return;
|
|
13661
13826
|
}
|
|
13662
13827
|
const colIdx = ts?.columnIndex ?? 0;
|
|
13663
|
-
const newTableData =
|
|
13828
|
+
const newTableData = chunkHBXPK572_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
13664
13829
|
const updates = { tableData: newTableData };
|
|
13665
|
-
const newRawXml =
|
|
13830
|
+
const newRawXml = chunkEXDUEXTO_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13666
13831
|
if (newRawXml) {
|
|
13667
13832
|
updates.rawXml = newRawXml;
|
|
13668
13833
|
}
|
|
@@ -13675,12 +13840,12 @@ function createTableStructHandlers(input) {
|
|
|
13675
13840
|
}
|
|
13676
13841
|
const td = selectedElement.tableData;
|
|
13677
13842
|
const colIdx = ts?.columnIndex ?? 0;
|
|
13678
|
-
const newTableData =
|
|
13843
|
+
const newTableData = chunkHBXPK572_js.deleteTableColumn(td, colIdx);
|
|
13679
13844
|
if (newTableData === td) {
|
|
13680
13845
|
return;
|
|
13681
13846
|
}
|
|
13682
13847
|
const updates = { tableData: newTableData };
|
|
13683
|
-
const newRawXml =
|
|
13848
|
+
const newRawXml = chunkEXDUEXTO_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13684
13849
|
if (newRawXml) {
|
|
13685
13850
|
updates.rawXml = newRawXml;
|
|
13686
13851
|
}
|
|
@@ -13708,13 +13873,16 @@ function useTableOperations(input) {
|
|
|
13708
13873
|
...mergeHandlers
|
|
13709
13874
|
};
|
|
13710
13875
|
}
|
|
13876
|
+
|
|
13877
|
+
// src/lib/canvas-export.ts
|
|
13711
13878
|
async function renderToCanvas(element, options = {}) {
|
|
13712
13879
|
const userOnClone = options.onclone;
|
|
13713
|
-
|
|
13880
|
+
const { default: html2canvasPro } = await import('html2canvas-pro');
|
|
13881
|
+
return html2canvasPro(element, {
|
|
13714
13882
|
...options,
|
|
13715
13883
|
onclone: async (doc, clonedEl) => {
|
|
13716
|
-
await
|
|
13717
|
-
|
|
13884
|
+
await chunkHBXPK572_js.normalizeColorsForCapture(doc, clonedEl);
|
|
13885
|
+
chunkHBXPK572_js.preprocessCssForCapture(clonedEl);
|
|
13718
13886
|
if (typeof userOnClone === "function") {
|
|
13719
13887
|
userOnClone(doc, clonedEl);
|
|
13720
13888
|
}
|
|
@@ -13770,7 +13938,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
13770
13938
|
}
|
|
13771
13939
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
13772
13940
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
13773
|
-
|
|
13941
|
+
chunkHBXPK572_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
13774
13942
|
}
|
|
13775
13943
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
13776
13944
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -13792,15 +13960,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13792
13960
|
continue;
|
|
13793
13961
|
}
|
|
13794
13962
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
13795
|
-
images.push(
|
|
13963
|
+
images.push(chunkHBXPK572_js.canvasToJpegData(canvas));
|
|
13796
13964
|
}
|
|
13797
13965
|
onProgress?.(totalSlides, totalSlides);
|
|
13798
13966
|
setActiveSlide(currentSlideIndex);
|
|
13799
13967
|
if (images.length === 0) {
|
|
13800
|
-
throw new Error(
|
|
13968
|
+
throw new Error(chunkAALZCSY4_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
13801
13969
|
}
|
|
13802
13970
|
const pdfBlobUrl = buildPdfFromImageData(images);
|
|
13803
|
-
|
|
13971
|
+
chunkHBXPK572_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
13804
13972
|
}
|
|
13805
13973
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
13806
13974
|
const { scale = 2, onProgress } = options;
|
|
@@ -13846,10 +14014,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
13846
14014
|
onProgress?.(totalSlides, totalSlides);
|
|
13847
14015
|
setActiveSlide(currentSlideIndex);
|
|
13848
14016
|
if (pages.length === 0) {
|
|
13849
|
-
throw new Error(
|
|
14017
|
+
throw new Error(chunkAALZCSY4_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
13850
14018
|
}
|
|
13851
14019
|
const pdfDataUrl = buildNotesPdf(pages);
|
|
13852
|
-
|
|
14020
|
+
chunkHBXPK572_js.downloadDataUrl(pdfDataUrl, filename);
|
|
13853
14021
|
}
|
|
13854
14022
|
|
|
13855
14023
|
// src/viewer/utils/export-video.ts
|
|
@@ -13880,7 +14048,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
13880
14048
|
}
|
|
13881
14049
|
setActiveSlide(currentSlideIndex);
|
|
13882
14050
|
if (slideCanvases.length === 0) {
|
|
13883
|
-
throw new Error(
|
|
14051
|
+
throw new Error(chunkAALZCSY4_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
13884
14052
|
}
|
|
13885
14053
|
const firstCanvas = slideCanvases[0];
|
|
13886
14054
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -13888,12 +14056,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
13888
14056
|
recordingCanvas.height = firstCanvas.height;
|
|
13889
14057
|
const ctx = recordingCanvas.getContext("2d");
|
|
13890
14058
|
if (!ctx) {
|
|
13891
|
-
throw new Error(
|
|
14059
|
+
throw new Error(chunkAALZCSY4_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
13892
14060
|
}
|
|
13893
14061
|
const fps = 30;
|
|
13894
14062
|
const stream = recordingCanvas.captureStream(fps);
|
|
13895
14063
|
const recorder = new MediaRecorder(stream, {
|
|
13896
|
-
mimeType:
|
|
14064
|
+
mimeType: chunkHBXPK572_js.pickSupportedMimeType([...chunkHBXPK572_js.WEBM_MIME_CANDIDATES]),
|
|
13897
14065
|
videoBitsPerSecond: 5e6
|
|
13898
14066
|
});
|
|
13899
14067
|
const chunks = [];
|
|
@@ -13916,8 +14084,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
13916
14084
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
13917
14085
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
13918
14086
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
13919
|
-
const frameInterval =
|
|
13920
|
-
const framesNeeded =
|
|
14087
|
+
const frameInterval = chunkHBXPK572_js.fpsToFrameIntervalMs(fps);
|
|
14088
|
+
const framesNeeded = chunkHBXPK572_js.segmentFrameCount(duration, fps);
|
|
13921
14089
|
for (let f = 0; f < framesNeeded; f++) {
|
|
13922
14090
|
if (signal?.aborted) {
|
|
13923
14091
|
recorder.stop();
|
|
@@ -13964,9 +14132,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13964
14132
|
}
|
|
13965
14133
|
setActiveSlide(currentSlideIndex);
|
|
13966
14134
|
if (frames.length === 0) {
|
|
13967
|
-
throw new Error(
|
|
14135
|
+
throw new Error(chunkAALZCSY4_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
13968
14136
|
}
|
|
13969
|
-
const gifBytes =
|
|
14137
|
+
const gifBytes = chunkHBXPK572_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
13970
14138
|
onProgress?.(totalSlides, totalSlides);
|
|
13971
14139
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
13972
14140
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -14038,7 +14206,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
14038
14206
|
continue;
|
|
14039
14207
|
}
|
|
14040
14208
|
onProgress?.(processedCount, data.slides.length);
|
|
14041
|
-
let svg =
|
|
14209
|
+
let svg = chunkEXDUEXTO_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
14042
14210
|
if (embedFonts && fontFaces?.length) {
|
|
14043
14211
|
svg = injectFontFaces(svg, fontFaces);
|
|
14044
14212
|
}
|
|
@@ -14108,7 +14276,7 @@ function useExportSaveAs(input) {
|
|
|
14108
14276
|
setExportProgress(95);
|
|
14109
14277
|
setExportStatusMessage("Downloading...");
|
|
14110
14278
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
14111
|
-
|
|
14279
|
+
chunkHBXPK572_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
14112
14280
|
setExportProgress(100);
|
|
14113
14281
|
} catch (err) {
|
|
14114
14282
|
if (err.name !== "AbortError") {
|
|
@@ -14131,7 +14299,7 @@ function useExportSaveAs(input) {
|
|
|
14131
14299
|
const blob = new Blob([data], {
|
|
14132
14300
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
14133
14301
|
});
|
|
14134
|
-
|
|
14302
|
+
chunkHBXPK572_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
14135
14303
|
} catch (err) {
|
|
14136
14304
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
14137
14305
|
}
|
|
@@ -14144,7 +14312,7 @@ function useExportSaveAs(input) {
|
|
|
14144
14312
|
const pptxGuides = guides.map((g) => ({
|
|
14145
14313
|
id: g.id,
|
|
14146
14314
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
14147
|
-
positionEmu:
|
|
14315
|
+
positionEmu: chunkEXDUEXTO_js.guidePxToEmu(g.position)
|
|
14148
14316
|
}));
|
|
14149
14317
|
return {
|
|
14150
14318
|
...slide,
|
|
@@ -14207,7 +14375,7 @@ function safeConfirm(message) {
|
|
|
14207
14375
|
}
|
|
14208
14376
|
}
|
|
14209
14377
|
function downloadBlob2(blob, filename) {
|
|
14210
|
-
|
|
14378
|
+
chunkHBXPK572_js.downloadBlob(blob, chunkHBXPK572_js.sanitizeDownloadFilename(filename));
|
|
14211
14379
|
}
|
|
14212
14380
|
|
|
14213
14381
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -14306,21 +14474,21 @@ function useExportHandlers(input) {
|
|
|
14306
14474
|
{
|
|
14307
14475
|
scale: 2,
|
|
14308
14476
|
onProgress: (current, total) => {
|
|
14309
|
-
setExportProgress(
|
|
14310
|
-
setExportStatusMessage(
|
|
14477
|
+
setExportProgress(chunkHBXPK572_js.slideProgressPercent(current, total));
|
|
14478
|
+
setExportStatusMessage(chunkHBXPK572_js.slideStatusLabel("Rendering", current, total));
|
|
14311
14479
|
},
|
|
14312
14480
|
signal: abortCtrl.signal
|
|
14313
14481
|
}
|
|
14314
14482
|
);
|
|
14315
|
-
setExportProgress(
|
|
14483
|
+
setExportProgress(chunkHBXPK572_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14316
14484
|
setExportStatusMessage("Building PDF...");
|
|
14317
14485
|
await new Promise((r) => {
|
|
14318
14486
|
setTimeout(r, 100);
|
|
14319
14487
|
});
|
|
14320
|
-
setExportProgress(
|
|
14488
|
+
setExportProgress(chunkHBXPK572_js.EXPORT_DONE_PERCENT);
|
|
14321
14489
|
setExportStatusMessage("Done!");
|
|
14322
14490
|
} catch (err) {
|
|
14323
|
-
if (!
|
|
14491
|
+
if (!chunkHBXPK572_js.isExportAbortError(err)) {
|
|
14324
14492
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
14325
14493
|
}
|
|
14326
14494
|
} finally {
|
|
@@ -14350,21 +14518,21 @@ function useExportHandlers(input) {
|
|
|
14350
14518
|
{
|
|
14351
14519
|
scale: 2,
|
|
14352
14520
|
onProgress: (current, total) => {
|
|
14353
|
-
setExportProgress(
|
|
14354
|
-
setExportStatusMessage(
|
|
14521
|
+
setExportProgress(chunkHBXPK572_js.slideProgressPercent(current, total));
|
|
14522
|
+
setExportStatusMessage(chunkHBXPK572_js.slideStatusLabel("Rendering", current, total));
|
|
14355
14523
|
},
|
|
14356
14524
|
signal: abortCtrl.signal
|
|
14357
14525
|
}
|
|
14358
14526
|
);
|
|
14359
|
-
setExportProgress(
|
|
14527
|
+
setExportProgress(chunkHBXPK572_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14360
14528
|
setExportStatusMessage("Building PDF...");
|
|
14361
14529
|
await new Promise((r) => {
|
|
14362
14530
|
setTimeout(r, 100);
|
|
14363
14531
|
});
|
|
14364
|
-
setExportProgress(
|
|
14532
|
+
setExportProgress(chunkHBXPK572_js.EXPORT_DONE_PERCENT);
|
|
14365
14533
|
setExportStatusMessage("Done!");
|
|
14366
14534
|
} catch (err) {
|
|
14367
|
-
if (!
|
|
14535
|
+
if (!chunkHBXPK572_js.isExportAbortError(err)) {
|
|
14368
14536
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
14369
14537
|
}
|
|
14370
14538
|
} finally {
|
|
@@ -14405,22 +14573,22 @@ function useExportHandlers(input) {
|
|
|
14405
14573
|
scale: 1,
|
|
14406
14574
|
slideDurationMs: 3e3,
|
|
14407
14575
|
onProgress: (current, total) => {
|
|
14408
|
-
setExportProgress(
|
|
14409
|
-
setExportStatusMessage(
|
|
14576
|
+
setExportProgress(chunkHBXPK572_js.slideProgressPercent(current, total, 45));
|
|
14577
|
+
setExportStatusMessage(chunkHBXPK572_js.slideStatusLabel("Capturing", current, total));
|
|
14410
14578
|
},
|
|
14411
14579
|
onRecordProgress: (current, total) => {
|
|
14412
|
-
setExportProgress(
|
|
14413
|
-
setExportStatusMessage(
|
|
14580
|
+
setExportProgress(chunkHBXPK572_js.recordProgressPercent(current, total));
|
|
14581
|
+
setExportStatusMessage(chunkHBXPK572_js.slideStatusLabel("Recording", current, total));
|
|
14414
14582
|
},
|
|
14415
14583
|
signal: abortCtrl.signal
|
|
14416
14584
|
}
|
|
14417
14585
|
);
|
|
14418
|
-
setExportProgress(
|
|
14586
|
+
setExportProgress(chunkHBXPK572_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14419
14587
|
setExportStatusMessage("Saving file...");
|
|
14420
14588
|
downloadBlob2(blob, "presentation.webm");
|
|
14421
|
-
setExportProgress(
|
|
14589
|
+
setExportProgress(chunkHBXPK572_js.EXPORT_DONE_PERCENT);
|
|
14422
14590
|
} catch (err) {
|
|
14423
|
-
if (!
|
|
14591
|
+
if (!chunkHBXPK572_js.isExportAbortError(err)) {
|
|
14424
14592
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
14425
14593
|
}
|
|
14426
14594
|
} finally {
|
|
@@ -14448,18 +14616,18 @@ function useExportHandlers(input) {
|
|
|
14448
14616
|
scale: 0.5,
|
|
14449
14617
|
slideDurationMs: 2e3,
|
|
14450
14618
|
onProgress: (current, total) => {
|
|
14451
|
-
setExportProgress(
|
|
14452
|
-
setExportStatusMessage(
|
|
14619
|
+
setExportProgress(chunkHBXPK572_js.slideProgressPercent(current, total));
|
|
14620
|
+
setExportStatusMessage(chunkHBXPK572_js.slideStatusLabel("Encoding", current, total));
|
|
14453
14621
|
},
|
|
14454
14622
|
signal: abortCtrl.signal
|
|
14455
14623
|
}
|
|
14456
14624
|
);
|
|
14457
|
-
setExportProgress(
|
|
14625
|
+
setExportProgress(chunkHBXPK572_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14458
14626
|
setExportStatusMessage("Saving file...");
|
|
14459
14627
|
downloadBlob2(blob, "presentation.gif");
|
|
14460
|
-
setExportProgress(
|
|
14628
|
+
setExportProgress(chunkHBXPK572_js.EXPORT_DONE_PERCENT);
|
|
14461
14629
|
} catch (err) {
|
|
14462
|
-
if (!
|
|
14630
|
+
if (!chunkHBXPK572_js.isExportAbortError(err)) {
|
|
14463
14631
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
14464
14632
|
}
|
|
14465
14633
|
} finally {
|
|
@@ -14499,7 +14667,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
14499
14667
|
}
|
|
14500
14668
|
printWindow.document.open();
|
|
14501
14669
|
printWindow.document.write(
|
|
14502
|
-
|
|
14670
|
+
chunkHBXPK572_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
14503
14671
|
);
|
|
14504
14672
|
printWindow.document.close();
|
|
14505
14673
|
printWindow.focus();
|
|
@@ -14560,7 +14728,7 @@ function usePrintHandlers(input) {
|
|
|
14560
14728
|
if (svgs.length === 0) {
|
|
14561
14729
|
return;
|
|
14562
14730
|
}
|
|
14563
|
-
const printDoc =
|
|
14731
|
+
const printDoc = chunkHBXPK572_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
14564
14732
|
title: "Slides (Vector)",
|
|
14565
14733
|
orientation: settings.orientation,
|
|
14566
14734
|
colorFilter
|
|
@@ -14596,7 +14764,7 @@ function usePrintHandlers(input) {
|
|
|
14596
14764
|
if (settings.printWhat === "outline") {
|
|
14597
14765
|
openPrintWindow(
|
|
14598
14766
|
"Outline",
|
|
14599
|
-
`<div class="outline-page">${
|
|
14767
|
+
`<div class="outline-page">${chunkHBXPK572_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
14600
14768
|
settings.orientation,
|
|
14601
14769
|
colorFilter,
|
|
14602
14770
|
settings.frameSlides
|
|
@@ -14621,7 +14789,7 @@ function usePrintHandlers(input) {
|
|
|
14621
14789
|
if (settings.printWhat === "slides") {
|
|
14622
14790
|
openPrintWindow(
|
|
14623
14791
|
"Slides",
|
|
14624
|
-
|
|
14792
|
+
chunkHBXPK572_js.buildSlidesHtml(slideImages, slideIndices),
|
|
14625
14793
|
settings.orientation,
|
|
14626
14794
|
colorFilter,
|
|
14627
14795
|
settings.frameSlides
|
|
@@ -14631,7 +14799,7 @@ function usePrintHandlers(input) {
|
|
|
14631
14799
|
if (settings.printWhat === "notes") {
|
|
14632
14800
|
openPrintWindow(
|
|
14633
14801
|
"Notes Pages",
|
|
14634
|
-
|
|
14802
|
+
chunkHBXPK572_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
14635
14803
|
"portrait",
|
|
14636
14804
|
colorFilter,
|
|
14637
14805
|
settings.frameSlides
|
|
@@ -14642,7 +14810,7 @@ function usePrintHandlers(input) {
|
|
|
14642
14810
|
const spp = settings.slidesPerPage;
|
|
14643
14811
|
openPrintWindow(
|
|
14644
14812
|
`Handout ${spp} per page`,
|
|
14645
|
-
|
|
14813
|
+
chunkHBXPK572_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
14646
14814
|
"portrait",
|
|
14647
14815
|
colorFilter,
|
|
14648
14816
|
settings.frameSlides
|
|
@@ -14796,13 +14964,6 @@ function useThemeHandlers(input) {
|
|
|
14796
14964
|
handleSwitchTheme
|
|
14797
14965
|
};
|
|
14798
14966
|
}
|
|
14799
|
-
function colorSchemesMatch(a, b) {
|
|
14800
|
-
if (!a) {
|
|
14801
|
-
return false;
|
|
14802
|
-
}
|
|
14803
|
-
const normalize = (hex) => hex.replace(/^#/u, "").toUpperCase().slice(0, 6);
|
|
14804
|
-
return normalize(a.dk1) === normalize(b.dk1) && normalize(a.lt1) === normalize(b.lt1) && normalize(a.dk2) === normalize(b.dk2) && normalize(a.lt2) === normalize(b.lt2) && normalize(a.accent1) === normalize(b.accent1) && normalize(a.accent2) === normalize(b.accent2) && normalize(a.accent3) === normalize(b.accent3) && normalize(a.accent4) === normalize(b.accent4) && normalize(a.accent5) === normalize(b.accent5) && normalize(a.accent6) === normalize(b.accent6) && normalize(a.hlink) === normalize(b.hlink) && normalize(a.folHlink) === normalize(b.folHlink);
|
|
14805
|
-
}
|
|
14806
14967
|
function useThemeSwitching(input) {
|
|
14807
14968
|
const { handlerRef, data, onDataChange, onThemeChanged } = input;
|
|
14808
14969
|
const switchToPreset = React3.useCallback(
|
|
@@ -14813,7 +14974,7 @@ function useThemeSwitching(input) {
|
|
|
14813
14974
|
}
|
|
14814
14975
|
try {
|
|
14815
14976
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
14816
|
-
const newData =
|
|
14977
|
+
const newData = chunkEXDUEXTO_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
14817
14978
|
onDataChange(newData);
|
|
14818
14979
|
onThemeChanged?.(preset);
|
|
14819
14980
|
} catch (error) {
|
|
@@ -14830,7 +14991,7 @@ function useThemeSwitching(input) {
|
|
|
14830
14991
|
}
|
|
14831
14992
|
try {
|
|
14832
14993
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
14833
|
-
const newData =
|
|
14994
|
+
const newData = chunkEXDUEXTO_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
14834
14995
|
onDataChange(newData);
|
|
14835
14996
|
} catch (error) {
|
|
14836
14997
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -14842,10 +15003,12 @@ function useThemeSwitching(input) {
|
|
|
14842
15003
|
if (!data?.theme?.colorScheme) {
|
|
14843
15004
|
return void 0;
|
|
14844
15005
|
}
|
|
14845
|
-
return
|
|
15006
|
+
return chunkEXDUEXTO_js.THEME_PRESETS.find(
|
|
15007
|
+
(p) => chunkEXDUEXTO_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
15008
|
+
);
|
|
14846
15009
|
}, [data?.theme?.colorScheme]);
|
|
14847
15010
|
return {
|
|
14848
|
-
presets:
|
|
15011
|
+
presets: chunkEXDUEXTO_js.THEME_PRESETS,
|
|
14849
15012
|
switchToPreset,
|
|
14850
15013
|
switchToCustom,
|
|
14851
15014
|
currentPreset
|
|
@@ -14863,7 +15026,7 @@ function collectUsedFonts(slides) {
|
|
|
14863
15026
|
return Array.from(fonts).sort();
|
|
14864
15027
|
}
|
|
14865
15028
|
function collectFontsFromElement(el, fonts) {
|
|
14866
|
-
if (
|
|
15029
|
+
if (chunkEXDUEXTO_js.hasTextProperties(el)) {
|
|
14867
15030
|
if (el.textStyle?.fontFamily) {
|
|
14868
15031
|
fonts.add(el.textStyle.fontFamily);
|
|
14869
15032
|
}
|
|
@@ -14988,7 +15151,7 @@ function usePropertyHandlers(input) {
|
|
|
14988
15151
|
}
|
|
14989
15152
|
try {
|
|
14990
15153
|
const ab = await file.arrayBuffer();
|
|
14991
|
-
const h = new
|
|
15154
|
+
const h = new chunkEXDUEXTO_js.PptxHandler();
|
|
14992
15155
|
const other = await h.load(ab);
|
|
14993
15156
|
if (!other) {
|
|
14994
15157
|
return;
|
|
@@ -14998,7 +15161,7 @@ function usePropertyHandlers(input) {
|
|
|
14998
15161
|
width: canvasSize.width,
|
|
14999
15162
|
height: canvasSize.height
|
|
15000
15163
|
};
|
|
15001
|
-
setCompareResult(
|
|
15164
|
+
setCompareResult(chunkHBXPK572_js.comparePresentation(cur, other));
|
|
15002
15165
|
setIsComparePanelOpen(true);
|
|
15003
15166
|
} catch (err) {
|
|
15004
15167
|
console.warn("Compare failed:", err);
|
|
@@ -15148,7 +15311,7 @@ function useIsMobile(input) {
|
|
|
15148
15311
|
const containerRef = input?.containerRef;
|
|
15149
15312
|
const isTouchDevice = React3.useSyncExternalStore(
|
|
15150
15313
|
subscribeTouchCapability,
|
|
15151
|
-
|
|
15314
|
+
chunkHBXPK572_js.detectTouchDevice,
|
|
15152
15315
|
() => false
|
|
15153
15316
|
// server snapshot
|
|
15154
15317
|
);
|
|
@@ -15164,7 +15327,7 @@ function useIsMobile(input) {
|
|
|
15164
15327
|
}
|
|
15165
15328
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
15166
15329
|
});
|
|
15167
|
-
const [orientation, setOrientation] = React3.useState(
|
|
15330
|
+
const [orientation, setOrientation] = React3.useState(chunkHBXPK572_js.detectOrientation);
|
|
15168
15331
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = React3.useState(false);
|
|
15169
15332
|
const [initialViewportHeight] = React3.useState(
|
|
15170
15333
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -15208,7 +15371,7 @@ function useIsMobile(input) {
|
|
|
15208
15371
|
return;
|
|
15209
15372
|
}
|
|
15210
15373
|
const handleOrientationChange = () => {
|
|
15211
|
-
setOrientation(
|
|
15374
|
+
setOrientation(chunkHBXPK572_js.detectOrientation());
|
|
15212
15375
|
};
|
|
15213
15376
|
if (screen.orientation) {
|
|
15214
15377
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -15238,9 +15401,9 @@ function useIsMobile(input) {
|
|
|
15238
15401
|
window.addEventListener("resize", handleResize);
|
|
15239
15402
|
return () => window.removeEventListener("resize", handleResize);
|
|
15240
15403
|
}, [isTouchDevice, initialViewportHeight]);
|
|
15241
|
-
const isMobile =
|
|
15242
|
-
const isTablet = !isMobile && containerWidth >=
|
|
15243
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
15404
|
+
const isMobile = chunkHBXPK572_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
15405
|
+
const isTablet = !isMobile && containerWidth >= chunkHBXPK572_js.MOBILE_BREAKPOINT && containerWidth < chunkHBXPK572_js.TABLET_BREAKPOINT;
|
|
15406
|
+
const isDesktop = !isMobile && containerWidth >= chunkHBXPK572_js.TABLET_BREAKPOINT;
|
|
15244
15407
|
return {
|
|
15245
15408
|
isMobile,
|
|
15246
15409
|
isTablet,
|
|
@@ -15301,11 +15464,11 @@ function useViewerDialogs(input) {
|
|
|
15301
15464
|
);
|
|
15302
15465
|
const [embedFontsEnabled, setEmbedFontsEnabled] = React3.useState(false);
|
|
15303
15466
|
const [isNarrowViewport, setIsNarrowViewport] = React3.useState(
|
|
15304
|
-
() => typeof window !== "undefined" ?
|
|
15467
|
+
() => typeof window !== "undefined" ? chunkHBXPK572_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
15305
15468
|
);
|
|
15306
15469
|
React3.useEffect(() => {
|
|
15307
15470
|
const handleWindow = () => setIsNarrowViewport(
|
|
15308
|
-
|
|
15471
|
+
chunkHBXPK572_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
15309
15472
|
);
|
|
15310
15473
|
let observer = null;
|
|
15311
15474
|
let raf = 0;
|
|
@@ -15319,12 +15482,12 @@ function useViewerDialogs(input) {
|
|
|
15319
15482
|
const entry = entries[0];
|
|
15320
15483
|
if (entry) {
|
|
15321
15484
|
setIsNarrowViewport(
|
|
15322
|
-
|
|
15485
|
+
chunkHBXPK572_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
15323
15486
|
);
|
|
15324
15487
|
}
|
|
15325
15488
|
});
|
|
15326
15489
|
observer.observe(el);
|
|
15327
|
-
setIsNarrowViewport(
|
|
15490
|
+
setIsNarrowViewport(chunkHBXPK572_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
15328
15491
|
};
|
|
15329
15492
|
attach();
|
|
15330
15493
|
window.addEventListener("resize", handleWindow);
|
|
@@ -15759,13 +15922,13 @@ function useSerialize(input) {
|
|
|
15759
15922
|
let processedSlide = slide;
|
|
15760
15923
|
if (pendingEditId) {
|
|
15761
15924
|
const updatedElements = slide.elements.map((el) => {
|
|
15762
|
-
if (el.id !== pendingEditId || !
|
|
15925
|
+
if (el.id !== pendingEditId || !chunkEXDUEXTO_js.hasTextProperties(el)) {
|
|
15763
15926
|
return el;
|
|
15764
15927
|
}
|
|
15765
15928
|
return {
|
|
15766
15929
|
...el,
|
|
15767
15930
|
text: pendingEditText,
|
|
15768
|
-
textSegments:
|
|
15931
|
+
textSegments: chunkHBXPK572_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
15769
15932
|
};
|
|
15770
15933
|
});
|
|
15771
15934
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -15778,7 +15941,7 @@ function useSerialize(input) {
|
|
|
15778
15941
|
const pptxGuides = guides.map((g) => ({
|
|
15779
15942
|
id: g.id,
|
|
15780
15943
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
15781
|
-
positionEmu:
|
|
15944
|
+
positionEmu: chunkEXDUEXTO_js.guidePxToEmu(g.position)
|
|
15782
15945
|
}));
|
|
15783
15946
|
return {
|
|
15784
15947
|
...processedSlide,
|
|
@@ -16158,7 +16321,7 @@ function useEditorOperations(input) {
|
|
|
16158
16321
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
16159
16322
|
React3.useEffect(() => {
|
|
16160
16323
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
16161
|
-
copiedFormatRef.current =
|
|
16324
|
+
copiedFormatRef.current = chunkHBXPK572_js.copyFormatFromElement(selectedElement);
|
|
16162
16325
|
} else if (!formatPainterActive) {
|
|
16163
16326
|
copiedFormatRef.current = null;
|
|
16164
16327
|
}
|
|
@@ -16184,12 +16347,12 @@ function useEditorOperations(input) {
|
|
|
16184
16347
|
e.stopPropagation();
|
|
16185
16348
|
const element = elementLookup.get(elementId);
|
|
16186
16349
|
if (element) {
|
|
16187
|
-
const updated =
|
|
16350
|
+
const updated = chunkHBXPK572_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
16188
16351
|
const updates = {};
|
|
16189
|
-
if (
|
|
16352
|
+
if (chunkEXDUEXTO_js.hasShapeProperties(updated)) {
|
|
16190
16353
|
updates.shapeStyle = updated.shapeStyle;
|
|
16191
16354
|
}
|
|
16192
|
-
if (
|
|
16355
|
+
if (chunkEXDUEXTO_js.hasTextProperties(updated)) {
|
|
16193
16356
|
updates.textStyle = updated.textStyle;
|
|
16194
16357
|
}
|
|
16195
16358
|
ops.updateElementById(elementId, updates);
|
|
@@ -16332,7 +16495,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
16332
16495
|
const families = /* @__PURE__ */ new Set();
|
|
16333
16496
|
for (const slide of slides) {
|
|
16334
16497
|
for (const el of slide.elements) {
|
|
16335
|
-
if (
|
|
16498
|
+
if (chunkEXDUEXTO_js.hasTextProperties(el) && el.textSegments) {
|
|
16336
16499
|
for (const seg of el.textSegments) {
|
|
16337
16500
|
if (seg.style.fontFamily) {
|
|
16338
16501
|
families.add(seg.style.fontFamily);
|
|
@@ -17116,7 +17279,7 @@ function useYjsProvider({ config }) {
|
|
|
17116
17279
|
const timeoutRef = React3.useRef(null);
|
|
17117
17280
|
const gateRef = React3.useRef(null);
|
|
17118
17281
|
if (!gateRef.current) {
|
|
17119
|
-
gateRef.current =
|
|
17282
|
+
gateRef.current = chunkHBXPK572_js.createSyncGate(() => setSynced(true));
|
|
17120
17283
|
}
|
|
17121
17284
|
const teardown = React3.useCallback(() => {
|
|
17122
17285
|
if (timeoutRef.current) {
|
|
@@ -17154,7 +17317,7 @@ function useYjsProvider({ config }) {
|
|
|
17154
17317
|
if (config.authToken) {
|
|
17155
17318
|
opts.password = config.authToken;
|
|
17156
17319
|
}
|
|
17157
|
-
const provider = new WebrtcProvider(
|
|
17320
|
+
const provider = new WebrtcProvider(chunkHBXPK572_js.validateRoomId(config.roomId), yDoc, opts);
|
|
17158
17321
|
setDoc(yDoc);
|
|
17159
17322
|
setAwareness(provider.awareness);
|
|
17160
17323
|
setClientId(provider.awareness.clientID);
|
|
@@ -17196,13 +17359,13 @@ function useYjsProvider({ config }) {
|
|
|
17196
17359
|
if (!config) {
|
|
17197
17360
|
return;
|
|
17198
17361
|
}
|
|
17199
|
-
const roomId =
|
|
17200
|
-
const transport = config.transport ??
|
|
17362
|
+
const roomId = chunkHBXPK572_js.validateRoomId(config.roomId);
|
|
17363
|
+
const transport = config.transport ?? chunkHBXPK572_js.resolveTransportForServerUrl(config.serverUrl);
|
|
17201
17364
|
if (transport === "webrtc") {
|
|
17202
17365
|
await initWebrtc();
|
|
17203
17366
|
return;
|
|
17204
17367
|
}
|
|
17205
|
-
if (
|
|
17368
|
+
if (chunkHBXPK572_js.isMixedContentBlocked(config.serverUrl)) {
|
|
17206
17369
|
console.warn(
|
|
17207
17370
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
17208
17371
|
);
|
|
@@ -17262,7 +17425,7 @@ function useYjsProvider({ config }) {
|
|
|
17262
17425
|
cleanupRef.current = null;
|
|
17263
17426
|
setStatus("error");
|
|
17264
17427
|
}
|
|
17265
|
-
},
|
|
17428
|
+
}, chunkHBXPK572_js.CONNECTION_TIMEOUT_MS);
|
|
17266
17429
|
}
|
|
17267
17430
|
setDoc(yDoc);
|
|
17268
17431
|
setAwareness(provider.awareness);
|
|
@@ -17335,7 +17498,7 @@ function usePresenceTracking({
|
|
|
17335
17498
|
awareness.setLocalStateField("presence", state);
|
|
17336
17499
|
lastBroadcastRef.current = Date.now();
|
|
17337
17500
|
};
|
|
17338
|
-
if (elapsed >=
|
|
17501
|
+
if (elapsed >= chunkHBXPK572_js.BROADCAST_THROTTLE_MS) {
|
|
17339
17502
|
if (pendingBroadcastRef.current) {
|
|
17340
17503
|
clearTimeout(pendingBroadcastRef.current);
|
|
17341
17504
|
pendingBroadcastRef.current = null;
|
|
@@ -17345,7 +17508,7 @@ function usePresenceTracking({
|
|
|
17345
17508
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
17346
17509
|
pendingBroadcastRef.current = null;
|
|
17347
17510
|
flush();
|
|
17348
|
-
},
|
|
17511
|
+
}, chunkHBXPK572_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
17349
17512
|
}
|
|
17350
17513
|
},
|
|
17351
17514
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -17370,7 +17533,7 @@ function usePresenceTracking({
|
|
|
17370
17533
|
return;
|
|
17371
17534
|
}
|
|
17372
17535
|
const handleChange = () => {
|
|
17373
|
-
const users =
|
|
17536
|
+
const users = chunkHBXPK572_js.derivePresenceList(
|
|
17374
17537
|
awareness.getStates(),
|
|
17375
17538
|
localClientId,
|
|
17376
17539
|
canvasWidth,
|
|
@@ -17418,7 +17581,7 @@ function useCollaborativeState({
|
|
|
17418
17581
|
canvasWidth,
|
|
17419
17582
|
canvasHeight
|
|
17420
17583
|
}) {
|
|
17421
|
-
const userColor =
|
|
17584
|
+
const userColor = chunkHBXPK572_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
17422
17585
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
17423
17586
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
17424
17587
|
awareness,
|
|
@@ -17521,10 +17684,10 @@ function useYjsDocumentSync({
|
|
|
17521
17684
|
return;
|
|
17522
17685
|
}
|
|
17523
17686
|
try {
|
|
17524
|
-
const { PptxHandler: PptxHandler2 } = await import('./dist-
|
|
17687
|
+
const { PptxHandler: PptxHandler2 } = await import('./dist-KRRXYUGI.js');
|
|
17525
17688
|
const handler = new PptxHandler2();
|
|
17526
17689
|
await handler.load(sourceBytes.buffer);
|
|
17527
|
-
const currentSlides =
|
|
17690
|
+
const currentSlides = chunkHBXPK572_js.readSlidesFromYDoc(
|
|
17528
17691
|
doc
|
|
17529
17692
|
);
|
|
17530
17693
|
const slidesToSave = buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
@@ -17545,11 +17708,11 @@ function useYjsDocumentSync({
|
|
|
17545
17708
|
lastSyncedRef.current = serialized;
|
|
17546
17709
|
void (async () => {
|
|
17547
17710
|
const factories = await getFactories();
|
|
17548
|
-
|
|
17711
|
+
chunkHBXPK572_js.reconcileSlidesInYDoc(
|
|
17549
17712
|
slides,
|
|
17550
17713
|
doc,
|
|
17551
17714
|
factories,
|
|
17552
|
-
|
|
17715
|
+
chunkHBXPK572_js.LOCAL_SYNC_ORIGIN
|
|
17553
17716
|
);
|
|
17554
17717
|
scheduleWriteBack();
|
|
17555
17718
|
})();
|
|
@@ -17559,10 +17722,10 @@ function useYjsDocumentSync({
|
|
|
17559
17722
|
return;
|
|
17560
17723
|
}
|
|
17561
17724
|
const handleChange = (_events, transaction) => {
|
|
17562
|
-
if (transaction?.origin ===
|
|
17725
|
+
if (transaction?.origin === chunkHBXPK572_js.LOCAL_SYNC_ORIGIN) {
|
|
17563
17726
|
return;
|
|
17564
17727
|
}
|
|
17565
|
-
const remoteSlides =
|
|
17728
|
+
const remoteSlides = chunkHBXPK572_js.readSlidesFromYDoc(
|
|
17566
17729
|
doc
|
|
17567
17730
|
);
|
|
17568
17731
|
if (remoteSlides.length === 0) {
|
|
@@ -17580,7 +17743,7 @@ function useYjsDocumentSync({
|
|
|
17580
17743
|
});
|
|
17581
17744
|
scheduleWriteBack();
|
|
17582
17745
|
};
|
|
17583
|
-
const unobserve =
|
|
17746
|
+
const unobserve = chunkHBXPK572_js.observeYDocSlides(
|
|
17584
17747
|
doc,
|
|
17585
17748
|
handleChange
|
|
17586
17749
|
);
|
|
@@ -17836,7 +17999,7 @@ function useTouchGestures(input) {
|
|
|
17836
17999
|
if (!el || !enabled) {
|
|
17837
18000
|
return;
|
|
17838
18001
|
}
|
|
17839
|
-
const recognizer =
|
|
18002
|
+
const recognizer = chunkHBXPK572_js.createTouchGestureRecognizer({
|
|
17840
18003
|
getScale: () => scaleRef.current,
|
|
17841
18004
|
minScale: MIN_ZOOM_SCALE,
|
|
17842
18005
|
maxScale: MAX_ZOOM_SCALE,
|
|
@@ -17879,7 +18042,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
17879
18042
|
return;
|
|
17880
18043
|
}
|
|
17881
18044
|
const rect = active.getBoundingClientRect();
|
|
17882
|
-
const delta =
|
|
18045
|
+
const delta = chunkHBXPK572_js.computeScrollDelta(
|
|
17883
18046
|
{ top: rect.top, bottom: rect.bottom },
|
|
17884
18047
|
window.innerHeight,
|
|
17885
18048
|
keyboardInset
|
|
@@ -17899,8 +18062,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
17899
18062
|
return;
|
|
17900
18063
|
}
|
|
17901
18064
|
const update = () => {
|
|
17902
|
-
const metrics =
|
|
17903
|
-
const inset = metrics ?
|
|
18065
|
+
const metrics = chunkHBXPK572_js.readViewportMetrics(window);
|
|
18066
|
+
const inset = metrics ? chunkHBXPK572_js.computeKeyboardInset(metrics) : 0;
|
|
17904
18067
|
setKeyboardInset(inset);
|
|
17905
18068
|
if (inset > 0) {
|
|
17906
18069
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -17911,8 +18074,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
17911
18074
|
vv.addEventListener("scroll", update);
|
|
17912
18075
|
const onFocusIn = () => {
|
|
17913
18076
|
window.requestAnimationFrame(() => {
|
|
17914
|
-
const metrics =
|
|
17915
|
-
const inset = metrics ?
|
|
18077
|
+
const metrics = chunkHBXPK572_js.readViewportMetrics(window);
|
|
18078
|
+
const inset = metrics ? chunkHBXPK572_js.computeKeyboardInset(metrics) : 0;
|
|
17916
18079
|
if (inset > 0) {
|
|
17917
18080
|
scrollFocusedIntoView(inset);
|
|
17918
18081
|
}
|
|
@@ -17925,7 +18088,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
17925
18088
|
document.removeEventListener("focusin", onFocusIn);
|
|
17926
18089
|
};
|
|
17927
18090
|
}, [enabled]);
|
|
17928
|
-
return { keyboardInset, isKeyboardOpen:
|
|
18091
|
+
return { keyboardInset, isKeyboardOpen: chunkHBXPK572_js.isKeyboardOpen(keyboardInset) };
|
|
17929
18092
|
}
|
|
17930
18093
|
var LEFT_MIN = 120;
|
|
17931
18094
|
var LEFT_MAX = 400;
|
|
@@ -18051,6 +18214,7 @@ exports.isImageTiled = isImageTiled;
|
|
|
18051
18214
|
exports.layoutToCategory = layoutToCategory;
|
|
18052
18215
|
exports.loadAudienceContent = loadAudienceContent;
|
|
18053
18216
|
exports.nodeOpacity = nodeOpacity;
|
|
18217
|
+
exports.parseAudienceNonce = parseAudienceNonce;
|
|
18054
18218
|
exports.parseEmailUrl = parseEmailUrl;
|
|
18055
18219
|
exports.parseSlideFromUrl = parseSlideFromUrl;
|
|
18056
18220
|
exports.parseTableElementData = parseTableElementData;
|