pptx-react-viewer 1.13.1 → 1.14.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 +11 -0
- package/dist/{Model3DScene-C5O6LDSN.js → Model3DScene-2E4HO4RQ.js} +3 -3
- package/dist/{Model3DScene-C5O6LDSN.js.br → Model3DScene-2E4HO4RQ.js.br} +0 -0
- package/dist/Model3DScene-2E4HO4RQ.js.gz +0 -0
- package/dist/{Model3DScene-SGFNVFB2.mjs → Model3DScene-DX7S3IM7.mjs} +2 -2
- package/dist/Model3DScene-DX7S3IM7.mjs.br +0 -0
- package/dist/Model3DScene-DX7S3IM7.mjs.gz +0 -0
- package/dist/{PowerPointViewer-BzsjqMzg.d.mts → PowerPointViewer-Crgj0LoS.d.mts} +3 -3
- package/dist/{PowerPointViewer-C2a7iXAK.d.ts → PowerPointViewer-DCYB93o0.d.ts} +3 -3
- package/dist/{SurfaceChart3DScene-NWZ2GCPS.js → SurfaceChart3DScene-327DEJSK.js} +3 -3
- package/dist/SurfaceChart3DScene-327DEJSK.js.br +0 -0
- package/dist/SurfaceChart3DScene-327DEJSK.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-CDWIMU7C.mjs → SurfaceChart3DScene-C3D3F2NN.mjs} +2 -2
- package/dist/{SurfaceChart3DScene-CDWIMU7C.mjs.br → SurfaceChart3DScene-C3D3F2NN.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-C3D3F2NN.mjs.gz +0 -0
- package/dist/{chunk-4ZYUPWYP.mjs → chunk-45JY7DOB.mjs} +4 -4
- package/dist/chunk-45JY7DOB.mjs.br +0 -0
- package/dist/chunk-45JY7DOB.mjs.gz +0 -0
- package/dist/{chunk-3VVUDMB7.js → chunk-55OTTA3H.js} +822 -822
- package/dist/chunk-55OTTA3H.js.br +0 -0
- package/dist/chunk-55OTTA3H.js.gz +0 -0
- package/dist/{chunk-AMFNG44P.js → chunk-FMB2AJD7.js} +398 -398
- package/dist/chunk-FMB2AJD7.js.br +0 -0
- package/dist/chunk-FMB2AJD7.js.gz +0 -0
- package/dist/{chunk-LARZRLKB.js → chunk-H5KXQEQD.js} +27 -27
- package/dist/chunk-H5KXQEQD.js.br +0 -0
- package/dist/chunk-H5KXQEQD.js.gz +0 -0
- package/dist/{chunk-KULOGKNE.mjs → chunk-JZP5LYN3.mjs} +2 -2
- package/dist/chunk-JZP5LYN3.mjs.br +0 -0
- package/dist/chunk-JZP5LYN3.mjs.gz +0 -0
- package/dist/{chunk-S52XBUDM.js → chunk-OBLHB72P.js} +10 -0
- package/dist/chunk-OBLHB72P.js.br +0 -0
- package/dist/{chunk-S52XBUDM.js.gz → chunk-OBLHB72P.js.gz} +0 -0
- package/dist/{chunk-XBOHG5BO.mjs → chunk-QFRXMAFR.mjs} +10 -0
- package/dist/chunk-QFRXMAFR.mjs.br +0 -0
- package/dist/{chunk-XBOHG5BO.mjs.gz → chunk-QFRXMAFR.mjs.gz} +0 -0
- package/dist/{chunk-ASB757HI.mjs → chunk-TQD5XTOT.mjs} +4 -4
- package/dist/chunk-TQD5XTOT.mjs.br +0 -0
- package/dist/chunk-TQD5XTOT.mjs.gz +0 -0
- package/dist/{dist-JVXXDMU7.mjs → dist-D5LQ7PW7.mjs} +1 -1
- package/dist/dist-D5LQ7PW7.mjs.br +0 -0
- package/dist/dist-D5LQ7PW7.mjs.gz +0 -0
- package/dist/{dist-TRWOWXDT.js → dist-MVSQ6PWP.js} +505 -505
- package/dist/dist-MVSQ6PWP.js.br +0 -0
- package/dist/dist-MVSQ6PWP.js.gz +0 -0
- package/dist/hooks-unstable.d.mts +121 -121
- package/dist/hooks-unstable.d.ts +121 -121
- package/dist/hooks-unstable.js +74 -74
- package/dist/hooks-unstable.js.br +0 -0
- package/dist/hooks-unstable.js.gz +0 -0
- package/dist/hooks-unstable.mjs +3 -3
- package/dist/hooks-unstable.mjs.br +0 -0
- package/dist/hooks-unstable.mjs.gz +0 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +18 -18
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{types-ui-DlsqFx7_.d.mts → types-ui-Bagu4aYj.d.mts} +15 -15
- package/dist/{types-ui-DlsqFx7_.d.ts → types-ui-Bagu4aYj.d.ts} +15 -15
- package/dist/{usePresenterWindow-BQwzr87T.d.mts → usePresenterWindow-BarXkdvr.d.mts} +44 -44
- package/dist/{usePresenterWindow-BKx5DLJy.d.ts → usePresenterWindow-DxZUXXk_.d.ts} +44 -44
- package/dist/viewer/index.d.mts +6 -6
- package/dist/viewer/index.d.ts +6 -6
- package/dist/viewer/index.js +19 -19
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +4 -4
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/dist/y-webrtc-6CRYHAXH.mjs +2 -2
- package/dist/y-webrtc-6CRYHAXH.mjs.br +0 -0
- package/dist/y-webrtc-6CRYHAXH.mjs.gz +0 -0
- package/dist/y-webrtc-QCZF75JW.js +2 -2
- package/dist/y-webrtc-QCZF75JW.js.br +0 -0
- package/dist/y-webrtc-QCZF75JW.js.gz +0 -0
- package/package.json +1 -1
- package/dist/Model3DScene-C5O6LDSN.js.gz +0 -0
- package/dist/Model3DScene-SGFNVFB2.mjs.br +0 -0
- package/dist/Model3DScene-SGFNVFB2.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-CDWIMU7C.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-NWZ2GCPS.js.br +0 -0
- package/dist/SurfaceChart3DScene-NWZ2GCPS.js.gz +0 -0
- package/dist/chunk-3VVUDMB7.js.br +0 -0
- package/dist/chunk-3VVUDMB7.js.gz +0 -0
- package/dist/chunk-4ZYUPWYP.mjs.br +0 -0
- package/dist/chunk-4ZYUPWYP.mjs.gz +0 -0
- package/dist/chunk-AMFNG44P.js.br +0 -0
- package/dist/chunk-AMFNG44P.js.gz +0 -0
- package/dist/chunk-ASB757HI.mjs.br +0 -0
- package/dist/chunk-ASB757HI.mjs.gz +0 -0
- package/dist/chunk-KULOGKNE.mjs.br +0 -0
- package/dist/chunk-KULOGKNE.mjs.gz +0 -0
- package/dist/chunk-LARZRLKB.js.br +0 -0
- package/dist/chunk-LARZRLKB.js.gz +0 -0
- package/dist/chunk-S52XBUDM.js.br +0 -0
- package/dist/chunk-XBOHG5BO.mjs.br +0 -0
- package/dist/dist-JVXXDMU7.mjs.br +0 -0
- package/dist/dist-JVXXDMU7.mjs.gz +0 -0
- package/dist/dist-TRWOWXDT.js.br +0 -0
- package/dist/dist-TRWOWXDT.js.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkH5KXQEQD_js = require('./chunk-H5KXQEQD.js');
|
|
4
4
|
var chunkK74UOJ6P_js = require('./chunk-K74UOJ6P.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkOBLHB72P_js = require('./chunk-OBLHB72P.js');
|
|
6
6
|
var React3 = require('react');
|
|
7
7
|
var lu = require('react-icons/lu');
|
|
8
8
|
var clsx = require('clsx');
|
|
@@ -20,7 +20,7 @@ var JSZip__default = /*#__PURE__*/_interopDefault(JSZip);
|
|
|
20
20
|
|
|
21
21
|
// src/viewer/utils/clone.ts
|
|
22
22
|
function cloneHistorySnapshot2(snapshot) {
|
|
23
|
-
return
|
|
23
|
+
return chunkH5KXQEQD_js.cloneHistorySnapshot(snapshot);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
// src/viewer/hooks/useEditorHistory.ts
|
|
@@ -68,8 +68,8 @@ function useEditorHistory(input) {
|
|
|
68
68
|
width: canvasSize.width,
|
|
69
69
|
height: canvasSize.height,
|
|
70
70
|
activeSlideIndex,
|
|
71
|
-
slides: slides.map(
|
|
72
|
-
templateElementsBySlideId:
|
|
71
|
+
slides: slides.map(chunkH5KXQEQD_js.cloneSlide),
|
|
72
|
+
templateElementsBySlideId: chunkH5KXQEQD_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
73
73
|
...actionLabel ? { actionLabel } : {}
|
|
74
74
|
};
|
|
75
75
|
},
|
|
@@ -82,9 +82,9 @@ function useEditorHistory(input) {
|
|
|
82
82
|
width: snapshot.width,
|
|
83
83
|
height: snapshot.height
|
|
84
84
|
});
|
|
85
|
-
setSlides(snapshot.slides.map(
|
|
85
|
+
setSlides(snapshot.slides.map(chunkH5KXQEQD_js.cloneSlide));
|
|
86
86
|
setTemplateElementsBySlideId(
|
|
87
|
-
|
|
87
|
+
chunkH5KXQEQD_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
88
88
|
);
|
|
89
89
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
90
90
|
setSelectedElementIds([]);
|
|
@@ -850,20 +850,20 @@ function useAnimationPlayback(input) {
|
|
|
850
850
|
for (const anim of nativeAnims) {
|
|
851
851
|
if (anim.buildType && anim.buildType !== "allAtOnce" && anim.targetId) {
|
|
852
852
|
const el = slide.elements.find((e) => e.id === anim.targetId);
|
|
853
|
-
if (el &&
|
|
854
|
-
segmentCounts.set(anim.targetId,
|
|
853
|
+
if (el && chunkOBLHB72P_js.hasTextProperties(el) && el.textSegments && el.textSegments.length > 0) {
|
|
854
|
+
segmentCounts.set(anim.targetId, chunkH5KXQEQD_js.countTextSegments(el.textSegments));
|
|
855
855
|
}
|
|
856
856
|
}
|
|
857
857
|
}
|
|
858
|
-
const expandedAnims = segmentCounts.size > 0 ?
|
|
859
|
-
const engine =
|
|
858
|
+
const expandedAnims = segmentCounts.size > 0 ? chunkH5KXQEQD_js.expandTextBuildAnimations(nativeAnims, segmentCounts) : nativeAnims;
|
|
859
|
+
const engine = chunkH5KXQEQD_js.TimelineEngine.fromAnimations(expandedAnims);
|
|
860
860
|
timelineEngineRef.current = engine;
|
|
861
861
|
setPresentationKeyframesCss(engine.getTimeline().keyframesCss);
|
|
862
862
|
setInteractiveTriggerShapeIds(engine.getInteractiveTriggerShapeIds());
|
|
863
863
|
setHoverTriggerShapeIds(engine.getHoverTriggerShapeIds());
|
|
864
864
|
const allIds = slide.elements.map((element) => element.id);
|
|
865
865
|
for (const anim of expandedAnims) {
|
|
866
|
-
if (anim.targetId && anim.targetId.includes(
|
|
866
|
+
if (anim.targetId && anim.targetId.includes(chunkH5KXQEQD_js.TEXT_BUILD_ID_SEP)) {
|
|
867
867
|
allIds.push(anim.targetId);
|
|
868
868
|
}
|
|
869
869
|
}
|
|
@@ -1130,7 +1130,7 @@ var AUDIENCE_HASH = "#pptx-audience";
|
|
|
1130
1130
|
var PRESENTER_MSG_ORIGIN = "pptx-viewer-presenter";
|
|
1131
1131
|
var AUDIENCE_NONCE_KEY = "nonce";
|
|
1132
1132
|
function generateSessionId() {
|
|
1133
|
-
return
|
|
1133
|
+
return chunkH5KXQEQD_js.secureRandomUuid();
|
|
1134
1134
|
}
|
|
1135
1135
|
function parseAudienceNonce() {
|
|
1136
1136
|
const hash = window.location.hash;
|
|
@@ -1598,7 +1598,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1598
1598
|
return;
|
|
1599
1599
|
}
|
|
1600
1600
|
if (action.url && !actionStr.includes("hlinksldjump")) {
|
|
1601
|
-
if (
|
|
1601
|
+
if (chunkH5KXQEQD_js.isUrlSafe(action.url)) {
|
|
1602
1602
|
window.open(action.url, "_blank", "noopener,noreferrer");
|
|
1603
1603
|
}
|
|
1604
1604
|
}
|
|
@@ -1608,7 +1608,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1608
1608
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1609
1609
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1610
1610
|
const transition = incomingSlide?.transition;
|
|
1611
|
-
const durationMs = deps.playTransition ?
|
|
1611
|
+
const durationMs = deps.playTransition ? chunkH5KXQEQD_js.resolveTransitionDurationMs(transition) : 0;
|
|
1612
1612
|
deps.clearPresentationTimers();
|
|
1613
1613
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1614
1614
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -2338,7 +2338,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2338
2338
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2339
2339
|
slides.forEach((slide, slideIndex) => {
|
|
2340
2340
|
for (const element of slide.elements || []) {
|
|
2341
|
-
if (!
|
|
2341
|
+
if (!chunkOBLHB72P_js.hasTextProperties(element)) {
|
|
2342
2342
|
continue;
|
|
2343
2343
|
}
|
|
2344
2344
|
const segments = element.textSegments ?? [];
|
|
@@ -2389,7 +2389,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2389
2389
|
continue;
|
|
2390
2390
|
}
|
|
2391
2391
|
const element = slide.elements[elIdx];
|
|
2392
|
-
if (!
|
|
2392
|
+
if (!chunkOBLHB72P_js.hasTextProperties(element)) {
|
|
2393
2393
|
continue;
|
|
2394
2394
|
}
|
|
2395
2395
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3319,12 +3319,12 @@ function generateElementId() {
|
|
|
3319
3319
|
function partitionTemplateElements(slides) {
|
|
3320
3320
|
const templateElementsBySlideId = {};
|
|
3321
3321
|
const nextSlides = slides.map((slide) => {
|
|
3322
|
-
const template = slide.elements.filter((el) =>
|
|
3322
|
+
const template = slide.elements.filter((el) => chunkH5KXQEQD_js.isTemplateElement(el));
|
|
3323
3323
|
if (template.length === 0) {
|
|
3324
3324
|
return slide;
|
|
3325
3325
|
}
|
|
3326
3326
|
templateElementsBySlideId[slide.id] = template;
|
|
3327
|
-
return { ...slide, elements: slide.elements.filter((el) => !
|
|
3327
|
+
return { ...slide, elements: slide.elements.filter((el) => !chunkH5KXQEQD_js.isTemplateElement(el)) };
|
|
3328
3328
|
});
|
|
3329
3329
|
return { slides: nextSlides, templateElementsBySlideId };
|
|
3330
3330
|
}
|
|
@@ -3406,7 +3406,7 @@ function useLoadContent({
|
|
|
3406
3406
|
);
|
|
3407
3407
|
}
|
|
3408
3408
|
const previousHandler = handlerRef.current;
|
|
3409
|
-
const handler = new
|
|
3409
|
+
const handler = new chunkOBLHB72P_js.PptxHandler();
|
|
3410
3410
|
const parsed = await handler.load(buffer);
|
|
3411
3411
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3412
3412
|
handler.dispose();
|
|
@@ -3418,7 +3418,7 @@ function useLoadContent({
|
|
|
3418
3418
|
handlerRef.current = null;
|
|
3419
3419
|
const mediaElements = [];
|
|
3420
3420
|
for (const slide of parsed.slides) {
|
|
3421
|
-
|
|
3421
|
+
chunkH5KXQEQD_js.collectMediaElements(slide.elements, mediaElements);
|
|
3422
3422
|
}
|
|
3423
3423
|
for (const url of mediaDataUrls.values()) {
|
|
3424
3424
|
if (url.startsWith("blob:")) {
|
|
@@ -3459,7 +3459,7 @@ function useLoadContent({
|
|
|
3459
3459
|
}
|
|
3460
3460
|
})
|
|
3461
3461
|
);
|
|
3462
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3462
|
+
const { paths: imagePaths, refs: imageRefs } = chunkH5KXQEQD_js.collectImagePaths(parsed.slides);
|
|
3463
3463
|
let nextSlides = parsed.slides;
|
|
3464
3464
|
if (imagePaths.size > 0) {
|
|
3465
3465
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3548,14 +3548,14 @@ function useLoadContent({
|
|
|
3548
3548
|
setHasMacros(parsed.hasMacros === true);
|
|
3549
3549
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3550
3550
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3551
|
-
setGuides(
|
|
3551
|
+
setGuides(chunkH5KXQEQD_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3552
3552
|
setActiveSlideIndex(0);
|
|
3553
3553
|
clearSelection();
|
|
3554
3554
|
setIsDirty(false);
|
|
3555
3555
|
history.resetHistory();
|
|
3556
3556
|
} catch (err) {
|
|
3557
3557
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3558
|
-
if (err instanceof
|
|
3558
|
+
if (err instanceof chunkOBLHB72P_js.EncryptedFileError) {
|
|
3559
3559
|
setIsEncrypted(true);
|
|
3560
3560
|
} else {
|
|
3561
3561
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3632,7 +3632,7 @@ function useAutosave(input) {
|
|
|
3632
3632
|
isSavingRef.current = false;
|
|
3633
3633
|
return;
|
|
3634
3634
|
}
|
|
3635
|
-
await
|
|
3635
|
+
await chunkH5KXQEQD_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
3636
3636
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
3637
3637
|
} catch (err) {
|
|
3638
3638
|
setAutosaveStatus({
|
|
@@ -3670,7 +3670,7 @@ function useAutosave(input) {
|
|
|
3670
3670
|
|
|
3671
3671
|
// src/viewer/utils/animation-effects.ts
|
|
3672
3672
|
function getAnimationInitialStyle2(preset, nativeAnimation) {
|
|
3673
|
-
return
|
|
3673
|
+
return chunkH5KXQEQD_js.getAnimationInitialStyle(preset, nativeAnimation);
|
|
3674
3674
|
}
|
|
3675
3675
|
function cn(...inputs) {
|
|
3676
3676
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
@@ -3678,7 +3678,7 @@ function cn(...inputs) {
|
|
|
3678
3678
|
|
|
3679
3679
|
// src/viewer/utils/text-utils.tsx
|
|
3680
3680
|
function getTextStyleForElement(element, fallbackColor) {
|
|
3681
|
-
if (!
|
|
3681
|
+
if (!chunkOBLHB72P_js.hasTextProperties(element)) {
|
|
3682
3682
|
return { color: fallbackColor };
|
|
3683
3683
|
}
|
|
3684
3684
|
const textDecorationTokens = [];
|
|
@@ -3692,20 +3692,20 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3692
3692
|
const textDecorationStyle = isDoubleStrike ? "double" : void 0;
|
|
3693
3693
|
const hasItalicRuns = element.textStyle?.italic || Boolean(element.textSegments?.some((segment) => segment.style?.italic));
|
|
3694
3694
|
const isRtl = element.textStyle?.rtl === true;
|
|
3695
|
-
const resolvedTextColor = element.textStyle?.hyperlink ?
|
|
3695
|
+
const resolvedTextColor = element.textStyle?.hyperlink ? chunkH5KXQEQD_js.normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : chunkH5KXQEQD_js.normalizeHexColor(element.textStyle?.color, fallbackColor);
|
|
3696
3696
|
const bodyTop = element.textStyle?.bodyInsetTop ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3697
3697
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3698
3698
|
const bodyLeft = element.textStyle?.bodyInsetLeft ?? DEFAULT_BODY_INSET_LR_PX;
|
|
3699
3699
|
const bodyRight = element.textStyle?.bodyInsetRight ?? DEFAULT_BODY_INSET_LR_PX;
|
|
3700
|
-
const writingMode =
|
|
3701
|
-
const textOrientation =
|
|
3702
|
-
const verticalDirection =
|
|
3700
|
+
const writingMode = chunkH5KXQEQD_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
3701
|
+
const textOrientation = chunkH5KXQEQD_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
3702
|
+
const verticalDirection = chunkH5KXQEQD_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
3703
3703
|
const resolvedDirection = verticalDirection || (isRtl ? "rtl" : "ltr");
|
|
3704
3704
|
const resolvedUnicodeBidi = isRtl ? "plaintext" : void 0;
|
|
3705
3705
|
const hasSegments = (element.textSegments?.length ?? 0) > 0;
|
|
3706
3706
|
return {
|
|
3707
3707
|
color: resolvedTextColor,
|
|
3708
|
-
backgroundColor: !hasSegments && element.textStyle?.highlightColor ?
|
|
3708
|
+
backgroundColor: !hasSegments && element.textStyle?.highlightColor ? chunkH5KXQEQD_js.normalizeHexColor(element.textStyle.highlightColor, void 0) : void 0,
|
|
3709
3709
|
textAlign: (() => {
|
|
3710
3710
|
const a = element.textStyle?.align;
|
|
3711
3711
|
if (a === "justLow" || a === "dist" || a === "thaiDist") {
|
|
@@ -3721,7 +3721,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3721
3721
|
textDecorationLine: textDecorationTokens.length > 0 ? textDecorationTokens.join(" ") : "none",
|
|
3722
3722
|
textDecorationStyle,
|
|
3723
3723
|
fontFamily: element.textStyle?.fontFamily || DEFAULT_FONT_FAMILY,
|
|
3724
|
-
lineHeight:
|
|
3724
|
+
lineHeight: chunkH5KXQEQD_js.resolveLineHeight(element.textStyle, hasItalicRuns),
|
|
3725
3725
|
paddingTop: bodyTop + (hasItalicRuns ? 1 : 0),
|
|
3726
3726
|
paddingBottom: bodyBottom + (hasItalicRuns ? 1 : 0),
|
|
3727
3727
|
paddingLeft: bodyLeft + (element.textStyle?.paragraphMarginLeft || 0),
|
|
@@ -3734,7 +3734,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3734
3734
|
// Auto-fit: use OOXML-provided fontScale/lnSpcReduction when available,
|
|
3735
3735
|
// otherwise fall back to heuristic estimation. The pure font-scale maths
|
|
3736
3736
|
// now lives in pptx-viewer-shared (computeAutoFitTextStyle).
|
|
3737
|
-
...
|
|
3737
|
+
...chunkH5KXQEQD_js.computeAutoFitTextStyle({
|
|
3738
3738
|
textStyle: element.textStyle,
|
|
3739
3739
|
text: element.text ?? "",
|
|
3740
3740
|
width: element.width,
|
|
@@ -3767,13 +3767,13 @@ function computeTabSize(tabStops) {
|
|
|
3767
3767
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : void 0;
|
|
3768
3768
|
}
|
|
3769
3769
|
function getTextLayoutStyle(element) {
|
|
3770
|
-
if (!
|
|
3770
|
+
if (!chunkOBLHB72P_js.hasTextProperties(element)) {
|
|
3771
3771
|
return {};
|
|
3772
3772
|
}
|
|
3773
3773
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
3774
|
-
const writingMode =
|
|
3775
|
-
const textOrientation =
|
|
3776
|
-
const verticalDirection =
|
|
3774
|
+
const writingMode = chunkH5KXQEQD_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
3775
|
+
const textOrientation = chunkH5KXQEQD_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
3776
|
+
const verticalDirection = chunkH5KXQEQD_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
3777
3777
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
3778
3778
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
3779
3779
|
const hasColumns = columnCount > 1;
|
|
@@ -3781,7 +3781,7 @@ function getTextLayoutStyle(element) {
|
|
|
3781
3781
|
const tabStops = element.textStyle?.tabStops;
|
|
3782
3782
|
const tabSize = computeTabSize(tabStops);
|
|
3783
3783
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
3784
|
-
const hasParagraphIndents =
|
|
3784
|
+
const hasParagraphIndents = chunkOBLHB72P_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
3785
3785
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
3786
3786
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
3787
3787
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -3790,7 +3790,7 @@ function getTextLayoutStyle(element) {
|
|
|
3790
3790
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3791
3791
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
3792
3792
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
3793
|
-
const kinsokuStyles =
|
|
3793
|
+
const kinsokuStyles = chunkH5KXQEQD_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
3794
3794
|
if (hasColumns) {
|
|
3795
3795
|
return {
|
|
3796
3796
|
display: "block",
|
|
@@ -3833,10 +3833,10 @@ function getTextLayoutStyle(element) {
|
|
|
3833
3833
|
|
|
3834
3834
|
// src/viewer/utils/text-effects.tsx
|
|
3835
3835
|
function buildTextFillCss2(style) {
|
|
3836
|
-
return
|
|
3836
|
+
return chunkH5KXQEQD_js.buildTextFillCss(style);
|
|
3837
3837
|
}
|
|
3838
3838
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
3839
|
-
return
|
|
3839
|
+
return chunkH5KXQEQD_js.buildTextBody3DSceneStyle(textStyle);
|
|
3840
3840
|
}
|
|
3841
3841
|
|
|
3842
3842
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -4021,17 +4021,17 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
4021
4021
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
4022
4022
|
return renderedSegments;
|
|
4023
4023
|
}
|
|
4024
|
-
const paraKey = `${elementId}${
|
|
4024
|
+
const paraKey = `${elementId}${chunkH5KXQEQD_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
4025
4025
|
const paraState = subElementAnimStates.get(paraKey);
|
|
4026
4026
|
if (paraState) {
|
|
4027
4027
|
const style = buildAnimStyle(paraState);
|
|
4028
4028
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
4029
4029
|
}
|
|
4030
|
-
const firstWordKey = `${elementId}${
|
|
4030
|
+
const firstWordKey = `${elementId}${chunkH5KXQEQD_js.TEXT_BUILD_ID_SEP}w${paraIndex}-0`;
|
|
4031
4031
|
if (subElementAnimStates.has(firstWordKey)) {
|
|
4032
4032
|
return wrapByWord(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
4033
4033
|
}
|
|
4034
|
-
const firstCharKey = `${elementId}${
|
|
4034
|
+
const firstCharKey = `${elementId}${chunkH5KXQEQD_js.TEXT_BUILD_ID_SEP}c${paraIndex}-0`;
|
|
4035
4035
|
if (subElementAnimStates.has(firstCharKey)) {
|
|
4036
4036
|
return wrapByChar(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
4037
4037
|
}
|
|
@@ -4052,7 +4052,7 @@ function wrapByWord(elementId, paraIndex, paraSegments, states) {
|
|
|
4052
4052
|
nodes.push(/* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Fragment, { children: w }, `ws-${i}`));
|
|
4053
4053
|
continue;
|
|
4054
4054
|
}
|
|
4055
|
-
const key = `${elementId}${
|
|
4055
|
+
const key = `${elementId}${chunkH5KXQEQD_js.TEXT_BUILD_ID_SEP}w${paraIndex}-${wordIdx}`;
|
|
4056
4056
|
const state = states.get(key);
|
|
4057
4057
|
const style = buildAnimStyle(state);
|
|
4058
4058
|
nodes.push(
|
|
@@ -4066,7 +4066,7 @@ function wrapByChar(elementId, paraIndex, paraSegments, states) {
|
|
|
4066
4066
|
const fullText = paraSegments.map((e) => e.segment.text).join("");
|
|
4067
4067
|
const nodes = [];
|
|
4068
4068
|
for (let i = 0; i < fullText.length; i++) {
|
|
4069
|
-
const key = `${elementId}${
|
|
4069
|
+
const key = `${elementId}${chunkH5KXQEQD_js.TEXT_BUILD_ID_SEP}c${paraIndex}-${i}`;
|
|
4070
4070
|
const state = states.get(key);
|
|
4071
4071
|
const style = buildAnimStyle(state);
|
|
4072
4072
|
nodes.push(
|
|
@@ -4079,10 +4079,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
4079
4079
|
if (!needsScriptFonts || !text) {
|
|
4080
4080
|
return text;
|
|
4081
4081
|
}
|
|
4082
|
-
const runs =
|
|
4082
|
+
const runs = chunkH5KXQEQD_js.segmentByScript(text);
|
|
4083
4083
|
if (runs.length <= 1) {
|
|
4084
4084
|
if (runs.length === 1) {
|
|
4085
|
-
const font =
|
|
4085
|
+
const font = chunkH5KXQEQD_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
4086
4086
|
if (font && font !== baseFontFamily) {
|
|
4087
4087
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
4088
4088
|
}
|
|
@@ -4090,7 +4090,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
4090
4090
|
return text;
|
|
4091
4091
|
}
|
|
4092
4092
|
return runs.map((run, i) => {
|
|
4093
|
-
const font =
|
|
4093
|
+
const font = chunkH5KXQEQD_js.resolveFontForScript(run.script, scriptFonts);
|
|
4094
4094
|
if (!font || font === baseFontFamily) {
|
|
4095
4095
|
return /* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
4096
4096
|
}
|
|
@@ -4164,8 +4164,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
4164
4164
|
);
|
|
4165
4165
|
}
|
|
4166
4166
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
4167
|
-
const mathml =
|
|
4168
|
-
const safeMathml = mathml ?
|
|
4167
|
+
const mathml = chunkH5KXQEQD_js.convertOmmlToMathMl(equationXml);
|
|
4168
|
+
const safeMathml = mathml ? chunkH5KXQEQD_js.sanitizeMathMl(mathml) : "";
|
|
4169
4169
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4170
4170
|
"span",
|
|
4171
4171
|
{
|
|
@@ -4261,7 +4261,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4261
4261
|
);
|
|
4262
4262
|
}
|
|
4263
4263
|
const segmentStyle = segment.style || {};
|
|
4264
|
-
const textValue =
|
|
4264
|
+
const textValue = chunkH5KXQEQD_js.substituteFieldText(segment.text || "", segment.fieldType, fieldContext);
|
|
4265
4265
|
const lines = textValue.split("\n");
|
|
4266
4266
|
const textDecorationTokens = [];
|
|
4267
4267
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -4271,8 +4271,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4271
4271
|
textDecorationTokens.push("line-through");
|
|
4272
4272
|
}
|
|
4273
4273
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
4274
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
4275
|
-
const underlineDecoration =
|
|
4274
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkH5KXQEQD_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkH5KXQEQD_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
4275
|
+
const underlineDecoration = chunkH5KXQEQD_js.resolveUnderlineDecorationStyle(
|
|
4276
4276
|
Boolean(isDoubleStrike),
|
|
4277
4277
|
segmentStyle.underlineStyle
|
|
4278
4278
|
);
|
|
@@ -4285,14 +4285,14 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4285
4285
|
const autoFitScale = element.textStyle?.autoFitFontScale !== void 0 && element.textStyle.autoFitFontScale > 0 && element.textStyle.autoFitFontScale < 1 ? element.textStyle.autoFitFontScale : 1;
|
|
4286
4286
|
const baseFontSize = rawFontSize * autoFitScale;
|
|
4287
4287
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
4288
|
-
const baseFontFamily = rawFontFamily ?
|
|
4288
|
+
const baseFontFamily = rawFontFamily ? chunkOBLHB72P_js.getSubstituteFontFamily(rawFontFamily) : DEFAULT_FONT_FAMILY;
|
|
4289
4289
|
const scriptFonts = {
|
|
4290
4290
|
latin: baseFontFamily,
|
|
4291
4291
|
eastAsia: segmentStyle.eastAsiaFont || element.textStyle?.eastAsiaFont || baseFontFamily,
|
|
4292
4292
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
4293
4293
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
4294
4294
|
};
|
|
4295
|
-
const needsScriptFonts =
|
|
4295
|
+
const needsScriptFonts = chunkH5KXQEQD_js.hasDistinctScriptFonts(scriptFonts);
|
|
4296
4296
|
const spanStyle = {
|
|
4297
4297
|
color: resolvedSegmentColor,
|
|
4298
4298
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -4306,15 +4306,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4306
4306
|
verticalAlign: baselineShift,
|
|
4307
4307
|
letterSpacing,
|
|
4308
4308
|
fontKerning,
|
|
4309
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
4309
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkH5KXQEQD_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
4310
4310
|
...textFillStyles,
|
|
4311
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
4312
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
4311
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkH5KXQEQD_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
4312
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkH5KXQEQD_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
4313
4313
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
4314
|
-
textShadow:
|
|
4315
|
-
filter:
|
|
4316
|
-
opacity:
|
|
4317
|
-
WebkitBoxReflect:
|
|
4314
|
+
textShadow: chunkH5KXQEQD_js.buildTextShadowCss(segmentStyle),
|
|
4315
|
+
filter: chunkH5KXQEQD_js.buildTextRunFilterChain(segmentStyle),
|
|
4316
|
+
opacity: chunkH5KXQEQD_js.getTextAlphaOpacity(segmentStyle),
|
|
4317
|
+
WebkitBoxReflect: chunkH5KXQEQD_js.buildTextReflectionCss(segmentStyle)
|
|
4318
4318
|
};
|
|
4319
4319
|
const runRtl = segmentStyle.rtl;
|
|
4320
4320
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -4334,7 +4334,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4334
4334
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
4335
4335
|
}
|
|
4336
4336
|
if (bulletInfo.color) {
|
|
4337
|
-
spanStyle.color =
|
|
4337
|
+
spanStyle.color = chunkH5KXQEQD_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
4338
4338
|
}
|
|
4339
4339
|
}
|
|
4340
4340
|
if (bulletInfo?.imageDataUrl || bulletInfo?.imageRelId) {
|
|
@@ -4366,7 +4366,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4366
4366
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
4367
4367
|
};
|
|
4368
4368
|
if (segment.rubyStyle?.color) {
|
|
4369
|
-
rubyStyle.color =
|
|
4369
|
+
rubyStyle.color = chunkH5KXQEQD_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
4370
4370
|
}
|
|
4371
4371
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
4372
4372
|
baseContent,
|
|
@@ -4436,7 +4436,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
4436
4436
|
return paragraphs;
|
|
4437
4437
|
}
|
|
4438
4438
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
4439
|
-
if (!
|
|
4439
|
+
if (!chunkOBLHB72P_js.hasTextProperties(element)) {
|
|
4440
4440
|
return emptyFallback || null;
|
|
4441
4441
|
}
|
|
4442
4442
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -4457,9 +4457,9 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
4457
4457
|
return element.text || emptyFallback || "";
|
|
4458
4458
|
}
|
|
4459
4459
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
4460
|
-
const paragraphIndents =
|
|
4461
|
-
const elementRtl =
|
|
4462
|
-
const elementAlign =
|
|
4460
|
+
const paragraphIndents = chunkOBLHB72P_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
4461
|
+
const elementRtl = chunkOBLHB72P_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
4462
|
+
const elementAlign = chunkOBLHB72P_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
4463
4463
|
return paragraphs.map((paraSegments, paraIndex) => {
|
|
4464
4464
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
4465
4465
|
const rawMarginLeft = typeof paraIndent?.marginLeft === "number" && paraIndent.marginLeft !== 0 ? paraIndent.marginLeft : void 0;
|
|
@@ -4473,14 +4473,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
4473
4473
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
4474
4474
|
});
|
|
4475
4475
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
4476
|
-
const paraRtl =
|
|
4476
|
+
const paraRtl = chunkH5KXQEQD_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
4477
4477
|
const isRtlParagraph = paraRtl === true;
|
|
4478
|
-
const paraAlign =
|
|
4479
|
-
const cssTextAlign =
|
|
4478
|
+
const paraAlign = chunkH5KXQEQD_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
4479
|
+
const cssTextAlign = chunkH5KXQEQD_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
4480
4480
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
4481
4481
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
4482
4482
|
const paraTextIndent = rawTextIndent;
|
|
4483
|
-
const paraKinsokuStyle =
|
|
4483
|
+
const paraKinsokuStyle = chunkH5KXQEQD_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
4484
4484
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
4485
4485
|
const paraStyle = {
|
|
4486
4486
|
...paraKinsokuStyle
|
|
@@ -4645,7 +4645,7 @@ function isConnectorOrLineElement(element) {
|
|
|
4645
4645
|
if (element.type === "connector") {
|
|
4646
4646
|
return true;
|
|
4647
4647
|
}
|
|
4648
|
-
if (!
|
|
4648
|
+
if (!chunkOBLHB72P_js.hasShapeProperties(element)) {
|
|
4649
4649
|
return false;
|
|
4650
4650
|
}
|
|
4651
4651
|
const st = getShapeType(element.shapeType);
|
|
@@ -4710,13 +4710,13 @@ function renderDuotoneSvgFilter(elementId, color1, color2) {
|
|
|
4710
4710
|
);
|
|
4711
4711
|
}
|
|
4712
4712
|
function getDuotoneColors(element) {
|
|
4713
|
-
if (!
|
|
4713
|
+
if (!chunkOBLHB72P_js.isImageLikeElement(element)) {
|
|
4714
4714
|
return void 0;
|
|
4715
4715
|
}
|
|
4716
4716
|
return element.imageEffects?.duotone;
|
|
4717
4717
|
}
|
|
4718
4718
|
function buildLineShadowCss(element) {
|
|
4719
|
-
if (!
|
|
4719
|
+
if (!chunkOBLHB72P_js.hasShapeProperties(element)) {
|
|
4720
4720
|
return void 0;
|
|
4721
4721
|
}
|
|
4722
4722
|
const ss = element.shapeStyle;
|
|
@@ -4727,13 +4727,13 @@ function buildLineShadowCss(element) {
|
|
|
4727
4727
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
4728
4728
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
4729
4729
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
4730
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
4731
|
-
|
|
4730
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkH5KXQEQD_js.colorWithOpacity(
|
|
4731
|
+
chunkH5KXQEQD_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
4732
4732
|
opacity
|
|
4733
4733
|
)}`;
|
|
4734
4734
|
}
|
|
4735
4735
|
function buildLineGlowFilter(element) {
|
|
4736
|
-
if (!
|
|
4736
|
+
if (!chunkOBLHB72P_js.hasShapeProperties(element)) {
|
|
4737
4737
|
return void 0;
|
|
4738
4738
|
}
|
|
4739
4739
|
const ss = element.shapeStyle;
|
|
@@ -4742,7 +4742,7 @@ function buildLineGlowFilter(element) {
|
|
|
4742
4742
|
}
|
|
4743
4743
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
4744
4744
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
4745
|
-
const glowCol =
|
|
4745
|
+
const glowCol = chunkH5KXQEQD_js.colorWithOpacity(chunkH5KXQEQD_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
4746
4746
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
4747
4747
|
}
|
|
4748
4748
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -4766,7 +4766,7 @@ function getImageAlphaFilterId(elementId) {
|
|
|
4766
4766
|
return `imgalpha-${elementId}`;
|
|
4767
4767
|
}
|
|
4768
4768
|
function hasAdvancedImageAlphaEffects(element) {
|
|
4769
|
-
if (!
|
|
4769
|
+
if (!chunkOBLHB72P_js.isImageLikeElement(element)) {
|
|
4770
4770
|
return false;
|
|
4771
4771
|
}
|
|
4772
4772
|
const e = element.imageEffects;
|
|
@@ -4778,7 +4778,7 @@ function hasAdvancedImageAlphaEffects(element) {
|
|
|
4778
4778
|
);
|
|
4779
4779
|
}
|
|
4780
4780
|
function renderImageAlphaSvgFilter(element) {
|
|
4781
|
-
if (!
|
|
4781
|
+
if (!chunkOBLHB72P_js.isImageLikeElement(element)) {
|
|
4782
4782
|
return null;
|
|
4783
4783
|
}
|
|
4784
4784
|
const e = element.imageEffects;
|
|
@@ -4888,7 +4888,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
4888
4888
|
return `dag-duotone-${elementId}`;
|
|
4889
4889
|
}
|
|
4890
4890
|
function hasDagDuotoneEffect(element) {
|
|
4891
|
-
if (!
|
|
4891
|
+
if (!chunkOBLHB72P_js.hasShapeProperties(element)) {
|
|
4892
4892
|
return false;
|
|
4893
4893
|
}
|
|
4894
4894
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -4951,7 +4951,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
4951
4951
|
|
|
4952
4952
|
// src/viewer/utils/shape-visual-3d.ts
|
|
4953
4953
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
4954
|
-
return
|
|
4954
|
+
return chunkH5KXQEQD_js.build3DExtrusionData(
|
|
4955
4955
|
shape3d,
|
|
4956
4956
|
scene3d,
|
|
4957
4957
|
fillColor,
|
|
@@ -4960,27 +4960,27 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
4960
4960
|
);
|
|
4961
4961
|
}
|
|
4962
4962
|
function apply3dEffects2(base, scene3d, shape3d) {
|
|
4963
|
-
|
|
4963
|
+
chunkH5KXQEQD_js.apply3dEffects(base, scene3d, shape3d);
|
|
4964
4964
|
}
|
|
4965
4965
|
|
|
4966
4966
|
// src/viewer/utils/shape-visual-style.ts
|
|
4967
4967
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor) {
|
|
4968
|
-
if (!
|
|
4968
|
+
if (!chunkOBLHB72P_js.hasShapeProperties(element)) {
|
|
4969
4969
|
return {};
|
|
4970
4970
|
}
|
|
4971
4971
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
4972
|
-
const clipPath =
|
|
4972
|
+
const clipPath = chunkH5KXQEQD_js.getResolvedShapeClipPath(element);
|
|
4973
4973
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
4974
4974
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
4975
|
-
const strokeDash =
|
|
4976
|
-
const fillGradient =
|
|
4977
|
-
const shadowCss =
|
|
4978
|
-
const innerShadowCss =
|
|
4979
|
-
const resolvedFillColor =
|
|
4980
|
-
const resolvedStrokeColor =
|
|
4975
|
+
const strokeDash = chunkH5KXQEQD_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
4976
|
+
const fillGradient = chunkH5KXQEQD_js.buildCssGradientFromShapeStyle(element.shapeStyle) || element.shapeStyle?.fillGradient;
|
|
4977
|
+
const shadowCss = chunkH5KXQEQD_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
4978
|
+
const innerShadowCss = chunkH5KXQEQD_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
4979
|
+
const resolvedFillColor = chunkH5KXQEQD_js.colorWithOpacity(fillColor, fillOpacity);
|
|
4980
|
+
const resolvedStrokeColor = chunkH5KXQEQD_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
4981
4981
|
const ss = element.shapeStyle;
|
|
4982
4982
|
const combinedShadowParts = [];
|
|
4983
|
-
const multiLayerShadow =
|
|
4983
|
+
const multiLayerShadow = chunkH5KXQEQD_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
4984
4984
|
if (multiLayerShadow) {
|
|
4985
4985
|
combinedShadowParts.push(multiLayerShadow);
|
|
4986
4986
|
} else if (shadowCss) {
|
|
@@ -4989,7 +4989,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4989
4989
|
if (innerShadowCss) {
|
|
4990
4990
|
combinedShadowParts.push(innerShadowCss);
|
|
4991
4991
|
}
|
|
4992
|
-
const glowBoxShadow =
|
|
4992
|
+
const glowBoxShadow = chunkH5KXQEQD_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
4993
4993
|
if (glowBoxShadow) {
|
|
4994
4994
|
combinedShadowParts.push(glowBoxShadow);
|
|
4995
4995
|
}
|
|
@@ -4997,7 +4997,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4997
4997
|
if (lineShadow) {
|
|
4998
4998
|
combinedShadowParts.push(lineShadow);
|
|
4999
4999
|
}
|
|
5000
|
-
const compoundLineShadow =
|
|
5000
|
+
const compoundLineShadow = chunkH5KXQEQD_js.getCompoundLineBoxShadow(
|
|
5001
5001
|
element.shapeStyle?.compoundLine,
|
|
5002
5002
|
strokeWidth,
|
|
5003
5003
|
resolvedStrokeColor
|
|
@@ -5010,7 +5010,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5010
5010
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
5011
5011
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
5012
5012
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
5013
|
-
const glowCol =
|
|
5013
|
+
const glowCol = chunkH5KXQEQD_js.colorWithOpacity(chunkH5KXQEQD_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
5014
5014
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
5015
5015
|
}
|
|
5016
5016
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
@@ -5023,12 +5023,12 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5023
5023
|
if (lineGlowCss) {
|
|
5024
5024
|
filterParts.push(lineGlowCss);
|
|
5025
5025
|
}
|
|
5026
|
-
const dagFilter =
|
|
5026
|
+
const dagFilter = chunkH5KXQEQD_js.getEffectDagFilter(ss, element.id);
|
|
5027
5027
|
if (dagFilter) {
|
|
5028
5028
|
filterParts.push(dagFilter);
|
|
5029
5029
|
}
|
|
5030
5030
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : void 0;
|
|
5031
|
-
const patternFill =
|
|
5031
|
+
const patternFill = chunkH5KXQEQD_js.buildPatternFillCss(element.shapeStyle);
|
|
5032
5032
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
5033
5033
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
5034
5034
|
let reflectCss;
|
|
@@ -5040,7 +5040,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5040
5040
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
5041
5041
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
5042
5042
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
5043
|
-
reflectCss =
|
|
5043
|
+
reflectCss = chunkH5KXQEQD_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
5044
5044
|
}
|
|
5045
5045
|
}
|
|
5046
5046
|
const base = {
|
|
@@ -5054,9 +5054,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5054
5054
|
filter: filterParts.length > 0 ? filterParts.join(" ") : void 0,
|
|
5055
5055
|
opacity: typeof ss?.dagAlphaModFix === "number" ? Math.max(0, Math.min(1, ss.dagAlphaModFix / 100)) : void 0,
|
|
5056
5056
|
mixBlendMode: mapDagBlendModeToCss(ss?.dagFillOverlayBlend),
|
|
5057
|
-
borderWidth: strokeWidth > 0 ?
|
|
5057
|
+
borderWidth: strokeWidth > 0 ? chunkH5KXQEQD_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : void 0,
|
|
5058
5058
|
borderColor: strokeWidth > 0 ? resolvedStrokeColor : void 0,
|
|
5059
|
-
borderStyle: strokeWidth > 0 ?
|
|
5059
|
+
borderStyle: strokeWidth > 0 ? chunkH5KXQEQD_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
5060
5060
|
strokeLinejoin: lineJoinCss,
|
|
5061
5061
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : void 0
|
|
5062
5062
|
};
|
|
@@ -5097,7 +5097,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5097
5097
|
borderWidth: 0,
|
|
5098
5098
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
5099
5099
|
borderTopColor: resolvedStrokeColor,
|
|
5100
|
-
borderTopStyle:
|
|
5100
|
+
borderTopStyle: chunkH5KXQEQD_js.getCssBorderDashStyle(strokeDash)
|
|
5101
5101
|
};
|
|
5102
5102
|
}
|
|
5103
5103
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -5111,13 +5111,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5111
5111
|
function getConnectorAdjustment(element, key, fallback) {
|
|
5112
5112
|
const direct = element.shapeAdjustments?.[key];
|
|
5113
5113
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
5114
|
-
return
|
|
5114
|
+
return chunkH5KXQEQD_js.clampUnitInterval(direct / 1e5);
|
|
5115
5115
|
}
|
|
5116
5116
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
5117
5117
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
5118
|
-
return
|
|
5118
|
+
return chunkH5KXQEQD_js.clampUnitInterval(fallbackKey / 1e5);
|
|
5119
5119
|
}
|
|
5120
|
-
return
|
|
5120
|
+
return chunkH5KXQEQD_js.clampUnitInterval(fallback);
|
|
5121
5121
|
}
|
|
5122
5122
|
function getConnectorPathGeometry(element) {
|
|
5123
5123
|
const width = Math.max(element.width, 1);
|
|
@@ -5244,14 +5244,14 @@ function renderConnectorMarker(markerId, arrowType, color, arrowWidth, arrowLeng
|
|
|
5244
5244
|
);
|
|
5245
5245
|
}
|
|
5246
5246
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor) {
|
|
5247
|
-
if (!
|
|
5247
|
+
if (!chunkOBLHB72P_js.hasShapeProperties(element)) {
|
|
5248
5248
|
return null;
|
|
5249
5249
|
}
|
|
5250
5250
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
5251
|
-
const fillPaint =
|
|
5252
|
-
const strokePaint =
|
|
5253
|
-
const dashType =
|
|
5254
|
-
const dashArray =
|
|
5251
|
+
const fillPaint = chunkH5KXQEQD_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
5252
|
+
const strokePaint = chunkH5KXQEQD_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
5253
|
+
const dashType = chunkH5KXQEQD_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
5254
|
+
const dashArray = chunkH5KXQEQD_js.getSvgStrokeDasharray(
|
|
5255
5255
|
dashType,
|
|
5256
5256
|
Math.max(strokeWidth, 1),
|
|
5257
5257
|
element.shapeStyle?.customDashSegments
|
|
@@ -5335,18 +5335,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5335
5335
|
}
|
|
5336
5336
|
);
|
|
5337
5337
|
}
|
|
5338
|
-
if (
|
|
5338
|
+
if (chunkOBLHB72P_js.isCalloutShape(normalizedType)) {
|
|
5339
5339
|
const width = Math.max(element.width, 1);
|
|
5340
5340
|
const height = Math.max(element.height, 1);
|
|
5341
|
-
const geometry =
|
|
5341
|
+
const geometry = chunkOBLHB72P_js.getCalloutLeaderLineGeometry(
|
|
5342
5342
|
normalizedType,
|
|
5343
5343
|
width,
|
|
5344
5344
|
height,
|
|
5345
5345
|
element.shapeAdjustments
|
|
5346
5346
|
);
|
|
5347
5347
|
if (geometry && geometry.points.length >= 2) {
|
|
5348
|
-
const leaderPath =
|
|
5349
|
-
const bounds =
|
|
5348
|
+
const leaderPath = chunkOBLHB72P_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
5349
|
+
const bounds = chunkOBLHB72P_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
5350
5350
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
5351
5351
|
const offsetLeft = bounds.minX;
|
|
5352
5352
|
const offsetTop = bounds.minY;
|
|
@@ -5410,8 +5410,8 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5410
5410
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
5411
5411
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
5412
5412
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
5413
|
-
const offsets =
|
|
5414
|
-
const widths =
|
|
5413
|
+
const offsets = chunkH5KXQEQD_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
5414
|
+
const widths = chunkH5KXQEQD_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
5415
5415
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5416
5416
|
"svg",
|
|
5417
5417
|
{
|
|
@@ -5465,7 +5465,7 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5465
5465
|
|
|
5466
5466
|
// src/viewer/utils/image-style.ts
|
|
5467
5467
|
function getImageMaskStyle(element) {
|
|
5468
|
-
if (!
|
|
5468
|
+
if (!chunkOBLHB72P_js.hasShapeProperties(element)) {
|
|
5469
5469
|
return void 0;
|
|
5470
5470
|
}
|
|
5471
5471
|
const shapeType = element.shapeType;
|
|
@@ -5474,7 +5474,7 @@ function getImageMaskStyle(element) {
|
|
|
5474
5474
|
}
|
|
5475
5475
|
const normalized = shapeType.toLowerCase();
|
|
5476
5476
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
5477
|
-
const radiusPx =
|
|
5477
|
+
const radiusPx = chunkH5KXQEQD_js.getRoundRectRadiusPx(element);
|
|
5478
5478
|
if (radiusPx <= 0.01) {
|
|
5479
5479
|
return void 0;
|
|
5480
5480
|
}
|
|
@@ -5486,7 +5486,7 @@ function getImageMaskStyle(element) {
|
|
|
5486
5486
|
if (normalized === "can" || normalized === "cylinder") {
|
|
5487
5487
|
return { borderRadius: "48% / 12%" };
|
|
5488
5488
|
}
|
|
5489
|
-
const clipPath =
|
|
5489
|
+
const clipPath = chunkH5KXQEQD_js.getResolvedShapeClipPath(element);
|
|
5490
5490
|
if (!clipPath) {
|
|
5491
5491
|
return void 0;
|
|
5492
5492
|
}
|
|
@@ -5494,7 +5494,7 @@ function getImageMaskStyle(element) {
|
|
|
5494
5494
|
}
|
|
5495
5495
|
function getImageRenderStyle(element) {
|
|
5496
5496
|
const maskStyle = getImageMaskStyle(element) || {};
|
|
5497
|
-
if (!
|
|
5497
|
+
if (!chunkOBLHB72P_js.isImageLikeElement(element)) {
|
|
5498
5498
|
return {
|
|
5499
5499
|
...maskStyle,
|
|
5500
5500
|
width: "100%",
|
|
@@ -5502,10 +5502,10 @@ function getImageRenderStyle(element) {
|
|
|
5502
5502
|
objectFit: "cover"
|
|
5503
5503
|
};
|
|
5504
5504
|
}
|
|
5505
|
-
const cropLeft =
|
|
5506
|
-
const cropTop =
|
|
5507
|
-
const cropRight =
|
|
5508
|
-
const cropBottom =
|
|
5505
|
+
const cropLeft = chunkH5KXQEQD_js.clampCropValue(element.cropLeft);
|
|
5506
|
+
const cropTop = chunkH5KXQEQD_js.clampCropValue(element.cropTop);
|
|
5507
|
+
const cropRight = chunkH5KXQEQD_js.clampCropValue(element.cropRight);
|
|
5508
|
+
const cropBottom = chunkH5KXQEQD_js.clampCropValue(element.cropBottom);
|
|
5509
5509
|
const hasCrop = cropLeft + cropRight > 1e-4 || cropTop + cropBottom > 1e-4;
|
|
5510
5510
|
if (!hasCrop) {
|
|
5511
5511
|
return {
|
|
@@ -5517,10 +5517,10 @@ function getImageRenderStyle(element) {
|
|
|
5517
5517
|
}
|
|
5518
5518
|
const safeHorizontalScale = cropLeft + cropRight >= 0.99 ? 0.99 / (cropLeft + cropRight) : 1;
|
|
5519
5519
|
const safeVerticalScale = cropTop + cropBottom >= 0.99 ? 0.99 / (cropTop + cropBottom) : 1;
|
|
5520
|
-
const normalizedLeft =
|
|
5521
|
-
const normalizedRight =
|
|
5522
|
-
const normalizedTop =
|
|
5523
|
-
const normalizedBottom =
|
|
5520
|
+
const normalizedLeft = chunkH5KXQEQD_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
5521
|
+
const normalizedRight = chunkH5KXQEQD_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
5522
|
+
const normalizedTop = chunkH5KXQEQD_js.clampCropValue(cropTop * safeVerticalScale);
|
|
5523
|
+
const normalizedBottom = chunkH5KXQEQD_js.clampCropValue(cropBottom * safeVerticalScale);
|
|
5524
5524
|
const remainingWidth = Math.max(0.01, 1 - normalizedLeft - normalizedRight);
|
|
5525
5525
|
const remainingHeight = Math.max(0.01, 1 - normalizedTop - normalizedBottom);
|
|
5526
5526
|
const tx = Math.round(-normalizedLeft / remainingWidth * 1e4) / 100;
|
|
@@ -5549,7 +5549,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
5549
5549
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
5550
5550
|
};
|
|
5551
5551
|
function getCropShapeClipPath(element) {
|
|
5552
|
-
if (!
|
|
5552
|
+
if (!chunkOBLHB72P_js.isImageLikeElement(element)) {
|
|
5553
5553
|
return void 0;
|
|
5554
5554
|
}
|
|
5555
5555
|
const shape = element.cropShape;
|
|
@@ -5559,7 +5559,7 @@ function getCropShapeClipPath(element) {
|
|
|
5559
5559
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
5560
5560
|
}
|
|
5561
5561
|
function isImageTiled(element) {
|
|
5562
|
-
if (!
|
|
5562
|
+
if (!chunkOBLHB72P_js.isImageLikeElement(element)) {
|
|
5563
5563
|
return false;
|
|
5564
5564
|
}
|
|
5565
5565
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -5589,7 +5589,7 @@ function tileAlignmentToCssPosition(alignment) {
|
|
|
5589
5589
|
}
|
|
5590
5590
|
}
|
|
5591
5591
|
function getImageTilingStyle(element) {
|
|
5592
|
-
if (!
|
|
5592
|
+
if (!chunkOBLHB72P_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
5593
5593
|
return void 0;
|
|
5594
5594
|
}
|
|
5595
5595
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -5660,9 +5660,9 @@ function parseGradientFillCss(gradFill) {
|
|
|
5660
5660
|
}
|
|
5661
5661
|
const parsed = stops.map((gs) => {
|
|
5662
5662
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
5663
|
-
const color =
|
|
5664
|
-
const opacity =
|
|
5665
|
-
return { pos, color:
|
|
5663
|
+
const color = chunkH5KXQEQD_js.parseDrawingColor(gs) ?? "#888888";
|
|
5664
|
+
const opacity = chunkH5KXQEQD_js.parseDrawingColorOpacity(gs);
|
|
5665
|
+
return { pos, color: chunkH5KXQEQD_js.colorWithOpacity(color, opacity) };
|
|
5666
5666
|
}).sort((a, b) => a.pos - b.pos);
|
|
5667
5667
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
5668
5668
|
const lin = gradFill["a:lin"];
|
|
@@ -5703,8 +5703,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
5703
5703
|
if (!pattFill) {
|
|
5704
5704
|
return void 0;
|
|
5705
5705
|
}
|
|
5706
|
-
const fgColor =
|
|
5707
|
-
const bgColor =
|
|
5706
|
+
const fgColor = chunkH5KXQEQD_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
5707
|
+
const bgColor = chunkH5KXQEQD_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
5708
5708
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
5709
5709
|
switch (preset) {
|
|
5710
5710
|
case "ltHorz":
|
|
@@ -5815,11 +5815,11 @@ function parseCellBorders(cellProperties) {
|
|
|
5815
5815
|
const prstDash = ln["a:prstDash"];
|
|
5816
5816
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
5817
5817
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
5818
|
-
const color =
|
|
5818
|
+
const color = chunkH5KXQEQD_js.parseDrawingColor(ln["a:solidFill"]);
|
|
5819
5819
|
if (color) {
|
|
5820
|
-
const opacity =
|
|
5820
|
+
const opacity = chunkH5KXQEQD_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
5821
5821
|
const key = `${edge.prefix}`;
|
|
5822
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
5822
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkH5KXQEQD_js.colorWithOpacity(color, opacity)}`;
|
|
5823
5823
|
}
|
|
5824
5824
|
}
|
|
5825
5825
|
return borderStyle;
|
|
@@ -5832,7 +5832,7 @@ function parseCellTextEffects(runProps) {
|
|
|
5832
5832
|
const textShadowParts = [];
|
|
5833
5833
|
const outerShdw = effectLst["a:outerShdw"];
|
|
5834
5834
|
if (outerShdw) {
|
|
5835
|
-
const shdwColor =
|
|
5835
|
+
const shdwColor = chunkH5KXQEQD_js.parseDrawingColor(outerShdw);
|
|
5836
5836
|
if (shdwColor) {
|
|
5837
5837
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
5838
5838
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -5850,7 +5850,7 @@ function parseCellTextEffects(runProps) {
|
|
|
5850
5850
|
}
|
|
5851
5851
|
const glow = effectLst["a:glow"];
|
|
5852
5852
|
if (glow) {
|
|
5853
|
-
const glowColor =
|
|
5853
|
+
const glowColor = chunkH5KXQEQD_js.parseDrawingColor(glow);
|
|
5854
5854
|
if (glowColor) {
|
|
5855
5855
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
5856
5856
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -5929,10 +5929,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5929
5929
|
if (runProps?.["@_u"] !== void 0) {
|
|
5930
5930
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
5931
5931
|
}
|
|
5932
|
-
const runColor =
|
|
5932
|
+
const runColor = chunkH5KXQEQD_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkH5KXQEQD_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
5933
5933
|
if (runColor) {
|
|
5934
|
-
const opacity =
|
|
5935
|
-
cellStyle.color =
|
|
5934
|
+
const opacity = chunkH5KXQEQD_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
5935
|
+
cellStyle.color = chunkH5KXQEQD_js.colorWithOpacity(runColor, opacity);
|
|
5936
5936
|
}
|
|
5937
5937
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
5938
5938
|
if (fontFamily) {
|
|
@@ -5942,15 +5942,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5942
5942
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
5943
5943
|
}
|
|
5944
5944
|
const cellProperties = cellXml["a:tcPr"];
|
|
5945
|
-
const cellFill =
|
|
5945
|
+
const cellFill = chunkH5KXQEQD_js.parseDrawingColor(
|
|
5946
5946
|
cellProperties?.["a:solidFill"],
|
|
5947
5947
|
schemeColorOverrides
|
|
5948
5948
|
);
|
|
5949
5949
|
if (cellFill) {
|
|
5950
|
-
const opacity =
|
|
5950
|
+
const opacity = chunkH5KXQEQD_js.parseDrawingColorOpacity(
|
|
5951
5951
|
cellProperties?.["a:solidFill"]
|
|
5952
5952
|
);
|
|
5953
|
-
cellStyle.backgroundColor =
|
|
5953
|
+
cellStyle.backgroundColor = chunkH5KXQEQD_js.colorWithOpacity(cellFill, opacity);
|
|
5954
5954
|
} else {
|
|
5955
5955
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
5956
5956
|
if (gradCss) {
|
|
@@ -5965,16 +5965,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5965
5965
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
5966
5966
|
Object.assign(cellStyle, edgeBorders);
|
|
5967
5967
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
5968
|
-
const borderColor =
|
|
5968
|
+
const borderColor = chunkH5KXQEQD_js.parseDrawingColor(
|
|
5969
5969
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
5970
5970
|
schemeColorOverrides
|
|
5971
|
-
) ||
|
|
5971
|
+
) || chunkH5KXQEQD_js.parseDrawingColor(
|
|
5972
5972
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
5973
5973
|
schemeColorOverrides
|
|
5974
|
-
) ||
|
|
5974
|
+
) || chunkH5KXQEQD_js.parseDrawingColor(
|
|
5975
5975
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
5976
5976
|
schemeColorOverrides
|
|
5977
|
-
) ||
|
|
5977
|
+
) || chunkH5KXQEQD_js.parseDrawingColor(
|
|
5978
5978
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
5979
5979
|
schemeColorOverrides
|
|
5980
5980
|
);
|
|
@@ -6053,10 +6053,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
6053
6053
|
}
|
|
6054
6054
|
let color = base;
|
|
6055
6055
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
6056
|
-
color =
|
|
6056
|
+
color = chunkH5KXQEQD_js.tintColor2(color, fill.tint / 1e5);
|
|
6057
6057
|
}
|
|
6058
6058
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
6059
|
-
color =
|
|
6059
|
+
color = chunkH5KXQEQD_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
6060
6060
|
}
|
|
6061
6061
|
return color;
|
|
6062
6062
|
}
|
|
@@ -6078,10 +6078,10 @@ function applyTableStyleText(text, colorScheme, style) {
|
|
|
6078
6078
|
if (base) {
|
|
6079
6079
|
let color = base;
|
|
6080
6080
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
6081
|
-
color =
|
|
6081
|
+
color = chunkH5KXQEQD_js.tintColor2(color, text.fontTint / 1e5);
|
|
6082
6082
|
}
|
|
6083
6083
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
6084
|
-
color =
|
|
6084
|
+
color = chunkH5KXQEQD_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
6085
6085
|
}
|
|
6086
6086
|
style.color = color;
|
|
6087
6087
|
applied = true;
|
|
@@ -6363,9 +6363,9 @@ function cellStyleToCss(style) {
|
|
|
6363
6363
|
if (style.gradientFillCss) {
|
|
6364
6364
|
css.background = style.gradientFillCss;
|
|
6365
6365
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
6366
|
-
const fg =
|
|
6367
|
-
const bg =
|
|
6368
|
-
const svgPattern =
|
|
6366
|
+
const fg = chunkH5KXQEQD_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
6367
|
+
const bg = chunkH5KXQEQD_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
6368
|
+
const svgPattern = chunkH5KXQEQD_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
6369
6369
|
if (svgPattern) {
|
|
6370
6370
|
const encoded = encodeURIComponent(svgPattern);
|
|
6371
6371
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -6434,7 +6434,7 @@ function cellStyleToCss(style) {
|
|
|
6434
6434
|
if (edge.width || edge.color) {
|
|
6435
6435
|
const w = edge.width ?? 1;
|
|
6436
6436
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
6437
|
-
const s =
|
|
6437
|
+
const s = chunkH5KXQEQD_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
6438
6438
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
6439
6439
|
}
|
|
6440
6440
|
}
|
|
@@ -6476,7 +6476,7 @@ function TableResizeOverlay({
|
|
|
6476
6476
|
const containerRef = React3.useRef(null);
|
|
6477
6477
|
const [rowBounds, setRowBounds] = React3.useState([]);
|
|
6478
6478
|
const dragRef = React3.useRef(null);
|
|
6479
|
-
const colBoundaries = React3.useMemo(() =>
|
|
6479
|
+
const colBoundaries = React3.useMemo(() => chunkH5KXQEQD_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
6480
6480
|
const measureRows = React3.useCallback(() => {
|
|
6481
6481
|
const container = containerRef.current;
|
|
6482
6482
|
if (!container) {
|
|
@@ -6523,11 +6523,11 @@ function TableResizeOverlay({
|
|
|
6523
6523
|
const rect = containerRef.current.getBoundingClientRect();
|
|
6524
6524
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
6525
6525
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
6526
|
-
onResizeColumns(
|
|
6526
|
+
onResizeColumns(chunkH5KXQEQD_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
6527
6527
|
} else if (drag.type === "row" && onResizeRow) {
|
|
6528
6528
|
const deltaY = e.clientY - drag.startPos;
|
|
6529
|
-
const newHeight =
|
|
6530
|
-
drag.initialRowHeight ??
|
|
6529
|
+
const newHeight = chunkH5KXQEQD_js.computeResizedRowHeight(
|
|
6530
|
+
drag.initialRowHeight ?? chunkH5KXQEQD_js.DEFAULT_ROW_HEIGHT,
|
|
6531
6531
|
deltaY
|
|
6532
6532
|
);
|
|
6533
6533
|
onResizeRow(drag.index, newHeight);
|
|
@@ -6565,7 +6565,7 @@ function TableResizeOverlay({
|
|
|
6565
6565
|
e.stopPropagation();
|
|
6566
6566
|
const table = containerRef.current?.querySelector("table");
|
|
6567
6567
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
6568
|
-
const actualHeight = tr?.offsetHeight ??
|
|
6568
|
+
const actualHeight = tr?.offsetHeight ?? chunkH5KXQEQD_js.DEFAULT_ROW_HEIGHT;
|
|
6569
6569
|
document.body.style.cursor = "row-resize";
|
|
6570
6570
|
document.body.style.userSelect = "none";
|
|
6571
6571
|
dragRef.current = {
|
|
@@ -6611,7 +6611,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6611
6611
|
}
|
|
6612
6612
|
const first = selectedCell.selectedCells[0];
|
|
6613
6613
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
6614
|
-
return
|
|
6614
|
+
return chunkH5KXQEQD_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
6615
6615
|
})();
|
|
6616
6616
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6617
6617
|
TableResizeOverlay,
|
|
@@ -6644,7 +6644,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6644
6644
|
return null;
|
|
6645
6645
|
}
|
|
6646
6646
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
6647
|
-
const isInMultiSelection =
|
|
6647
|
+
const isInMultiSelection = chunkH5KXQEQD_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
6648
6648
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
6649
6649
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6650
6650
|
"td",
|
|
@@ -6667,7 +6667,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6667
6667
|
}
|
|
6668
6668
|
event.stopPropagation();
|
|
6669
6669
|
if (event.shiftKey && selectedCell) {
|
|
6670
|
-
const rect =
|
|
6670
|
+
const rect = chunkH5KXQEQD_js.computeSelectionRect(
|
|
6671
6671
|
selectedCell.rowIndex,
|
|
6672
6672
|
selectedCell.columnIndex,
|
|
6673
6673
|
rowIndex,
|
|
@@ -6677,7 +6677,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6677
6677
|
options?.onSelectCell?.({
|
|
6678
6678
|
rowIndex: selectedCell.rowIndex,
|
|
6679
6679
|
columnIndex: selectedCell.columnIndex,
|
|
6680
|
-
selectedCells:
|
|
6680
|
+
selectedCells: chunkH5KXQEQD_js.rectToCells(rect)
|
|
6681
6681
|
});
|
|
6682
6682
|
} else {
|
|
6683
6683
|
options?.onSelectCell?.({
|
|
@@ -6751,7 +6751,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6751
6751
|
}
|
|
6752
6752
|
const first = selectedCell.selectedCells[0];
|
|
6753
6753
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
6754
|
-
return
|
|
6754
|
+
return chunkH5KXQEQD_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
6755
6755
|
})();
|
|
6756
6756
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
6757
6757
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6816,7 +6816,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6816
6816
|
"border px-1 py-0.5 align-top",
|
|
6817
6817
|
isEditable2 && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
6818
6818
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
6819
|
-
|
|
6819
|
+
chunkH5KXQEQD_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
6820
6820
|
),
|
|
6821
6821
|
colSpan,
|
|
6822
6822
|
rowSpan: rSpan,
|
|
@@ -6827,7 +6827,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6827
6827
|
}
|
|
6828
6828
|
event.stopPropagation();
|
|
6829
6829
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
6830
|
-
const rect =
|
|
6830
|
+
const rect = chunkH5KXQEQD_js.computeSelectionRect(
|
|
6831
6831
|
selectedCell.rowIndex,
|
|
6832
6832
|
selectedCell.columnIndex,
|
|
6833
6833
|
rowIndex,
|
|
@@ -6837,7 +6837,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6837
6837
|
options?.onSelectCell?.({
|
|
6838
6838
|
rowIndex: selectedCell.rowIndex,
|
|
6839
6839
|
columnIndex: selectedCell.columnIndex,
|
|
6840
|
-
selectedCells:
|
|
6840
|
+
selectedCells: chunkH5KXQEQD_js.rectToCells(rect)
|
|
6841
6841
|
});
|
|
6842
6842
|
} else {
|
|
6843
6843
|
options?.onSelectCell?.({
|
|
@@ -6889,24 +6889,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6889
6889
|
}
|
|
6890
6890
|
var LEGEND_ITEM_WIDTH = 80;
|
|
6891
6891
|
function partAttrs(part) {
|
|
6892
|
-
return part ?
|
|
6892
|
+
return part ? chunkH5KXQEQD_js.chartPartToAttrs(part) : void 0;
|
|
6893
6893
|
}
|
|
6894
6894
|
function resolveReactPalette(chartData) {
|
|
6895
6895
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
6896
6896
|
return chartData.colorPalette;
|
|
6897
6897
|
}
|
|
6898
|
-
return [...
|
|
6898
|
+
return [...chunkH5KXQEQD_js.getChartStylePalette(chartData.style?.styleId)];
|
|
6899
6899
|
}
|
|
6900
6900
|
function buildReactChartViewModel(element) {
|
|
6901
6901
|
if (element.type !== "chart" || !element.chartData) {
|
|
6902
|
-
return
|
|
6902
|
+
return chunkH5KXQEQD_js.buildChartViewModel(element);
|
|
6903
6903
|
}
|
|
6904
6904
|
const palette = resolveReactPalette(element.chartData);
|
|
6905
6905
|
const themedElement = {
|
|
6906
6906
|
...element,
|
|
6907
6907
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
6908
6908
|
};
|
|
6909
|
-
return
|
|
6909
|
+
return chunkH5KXQEQD_js.buildChartViewModel(themedElement);
|
|
6910
6910
|
}
|
|
6911
6911
|
function renderPrimitive(prim, key) {
|
|
6912
6912
|
switch (prim.kind) {
|
|
@@ -7295,7 +7295,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7295
7295
|
const unmatchedRows = [];
|
|
7296
7296
|
categories.forEach((cat, i) => {
|
|
7297
7297
|
const value = values[i] ?? 0;
|
|
7298
|
-
const code =
|
|
7298
|
+
const code = chunkH5KXQEQD_js.resolveRegionCode(cat);
|
|
7299
7299
|
if (code) {
|
|
7300
7300
|
regionValueMap.set(code, { value, label: cat });
|
|
7301
7301
|
} else {
|
|
@@ -7333,8 +7333,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7333
7333
|
let fill = "#e2e8f0";
|
|
7334
7334
|
let dataLabel = null;
|
|
7335
7335
|
if (entry) {
|
|
7336
|
-
const t =
|
|
7337
|
-
fill =
|
|
7336
|
+
const t = chunkH5KXQEQD_js.normalizeValue(entry.value, minVal, maxVal);
|
|
7337
|
+
fill = chunkH5KXQEQD_js.sequentialColorScale(t);
|
|
7338
7338
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
7339
7339
|
"text",
|
|
7340
7340
|
{
|
|
@@ -7345,7 +7345,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7345
7345
|
fontWeight: 600,
|
|
7346
7346
|
fill: "#1e293b",
|
|
7347
7347
|
style: { pointerEvents: "none" },
|
|
7348
|
-
children:
|
|
7348
|
+
children: chunkH5KXQEQD_js.formatAxisValue(entry.value)
|
|
7349
7349
|
},
|
|
7350
7350
|
`${element.id}-map-dl-${region.code}`
|
|
7351
7351
|
);
|
|
@@ -7363,7 +7363,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7363
7363
|
opacity: 0.9,
|
|
7364
7364
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
7365
7365
|
region.name,
|
|
7366
|
-
entry ? `: ${
|
|
7366
|
+
entry ? `: ${chunkH5KXQEQD_js.formatAxisValue(entry.value)}` : ""
|
|
7367
7367
|
] })
|
|
7368
7368
|
}
|
|
7369
7369
|
),
|
|
@@ -7401,7 +7401,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7401
7401
|
fontSize: 7,
|
|
7402
7402
|
fill: "#64748b",
|
|
7403
7403
|
textAnchor: "middle",
|
|
7404
|
-
children:
|
|
7404
|
+
children: chunkH5KXQEQD_js.formatAxisValue(minVal)
|
|
7405
7405
|
},
|
|
7406
7406
|
`${element.id}-map-legend-min`
|
|
7407
7407
|
),
|
|
@@ -7413,7 +7413,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7413
7413
|
fontSize: 7,
|
|
7414
7414
|
fill: "#64748b",
|
|
7415
7415
|
textAnchor: "middle",
|
|
7416
|
-
children:
|
|
7416
|
+
children: chunkH5KXQEQD_js.formatAxisValue(maxVal)
|
|
7417
7417
|
},
|
|
7418
7418
|
`${element.id}-map-legend-max`
|
|
7419
7419
|
)
|
|
@@ -7479,7 +7479,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7479
7479
|
y,
|
|
7480
7480
|
fontSize,
|
|
7481
7481
|
fill: "#475569",
|
|
7482
|
-
children:
|
|
7482
|
+
children: chunkH5KXQEQD_js.formatAxisValue(row.value)
|
|
7483
7483
|
},
|
|
7484
7484
|
`${element.id}-map-ft-val-${i}`
|
|
7485
7485
|
)
|
|
@@ -7550,7 +7550,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
7550
7550
|
|
|
7551
7551
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
7552
7552
|
function sColor(series, idx) {
|
|
7553
|
-
return
|
|
7553
|
+
return chunkH5KXQEQD_js.seriesColor(series, idx);
|
|
7554
7554
|
}
|
|
7555
7555
|
function valToY(val, range, topY, bottomY) {
|
|
7556
7556
|
const usable = bottomY - topY;
|
|
@@ -8045,7 +8045,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
8045
8045
|
width: 10,
|
|
8046
8046
|
height: 10,
|
|
8047
8047
|
rx: 2,
|
|
8048
|
-
fill:
|
|
8048
|
+
fill: chunkH5KXQEQD_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
8049
8049
|
},
|
|
8050
8050
|
`${id}-leg-r-${i}`
|
|
8051
8051
|
)
|
|
@@ -8069,7 +8069,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
8069
8069
|
width: 10,
|
|
8070
8070
|
height: 10,
|
|
8071
8071
|
rx: 2,
|
|
8072
|
-
fill:
|
|
8072
|
+
fill: chunkH5KXQEQD_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
8073
8073
|
}
|
|
8074
8074
|
),
|
|
8075
8075
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -8082,9 +8082,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
8082
8082
|
}
|
|
8083
8083
|
const lines = [];
|
|
8084
8084
|
if (range.logScale && range.logBase) {
|
|
8085
|
-
const ticks =
|
|
8085
|
+
const ticks = chunkH5KXQEQD_js.generateLogTicks(range);
|
|
8086
8086
|
ticks.forEach((tickVal, i) => {
|
|
8087
|
-
const y =
|
|
8087
|
+
const y = chunkH5KXQEQD_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
8088
8088
|
lines.push(
|
|
8089
8089
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8090
8090
|
"line",
|
|
@@ -8105,7 +8105,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
8105
8105
|
const steps = 4;
|
|
8106
8106
|
for (let i = 0; i <= steps; i++) {
|
|
8107
8107
|
const val = range.min + range.span * i / steps;
|
|
8108
|
-
const y =
|
|
8108
|
+
const y = chunkH5KXQEQD_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8109
8109
|
lines.push(
|
|
8110
8110
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8111
8111
|
"line",
|
|
@@ -8129,9 +8129,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
8129
8129
|
const labels = [];
|
|
8130
8130
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
8131
8131
|
if (range.logScale && range.logBase) {
|
|
8132
|
-
const ticks =
|
|
8132
|
+
const ticks = chunkH5KXQEQD_js.generateLogTicks(range);
|
|
8133
8133
|
ticks.forEach((tickVal, i) => {
|
|
8134
|
-
const y =
|
|
8134
|
+
const y = chunkH5KXQEQD_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
8135
8135
|
labels.push(
|
|
8136
8136
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8137
8137
|
"text",
|
|
@@ -8141,7 +8141,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
8141
8141
|
textAnchor: "end",
|
|
8142
8142
|
fontSize: 8,
|
|
8143
8143
|
fill: "#64748b",
|
|
8144
|
-
children: hasDisplayUnits ?
|
|
8144
|
+
children: hasDisplayUnits ? chunkH5KXQEQD_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkH5KXQEQD_js.formatAxisValue(tickVal)
|
|
8145
8145
|
},
|
|
8146
8146
|
`${id}-vaxis-log-${i}`
|
|
8147
8147
|
)
|
|
@@ -8151,7 +8151,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
8151
8151
|
const steps = 4;
|
|
8152
8152
|
for (let i = 0; i <= steps; i++) {
|
|
8153
8153
|
const val = range.min + range.span * i / steps;
|
|
8154
|
-
const y =
|
|
8154
|
+
const y = chunkH5KXQEQD_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8155
8155
|
labels.push(
|
|
8156
8156
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8157
8157
|
"text",
|
|
@@ -8161,7 +8161,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
8161
8161
|
textAnchor: "end",
|
|
8162
8162
|
fontSize: 8,
|
|
8163
8163
|
fill: "#64748b",
|
|
8164
|
-
children: hasDisplayUnits ?
|
|
8164
|
+
children: hasDisplayUnits ? chunkH5KXQEQD_js.formatAxisValueWithUnits(val, axisFormatting) : chunkH5KXQEQD_js.formatAxisValue(val)
|
|
8165
8165
|
},
|
|
8166
8166
|
`${id}-vaxis-${i}`
|
|
8167
8167
|
)
|
|
@@ -8169,7 +8169,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
8169
8169
|
}
|
|
8170
8170
|
}
|
|
8171
8171
|
if (hasDisplayUnits) {
|
|
8172
|
-
const unitLabel =
|
|
8172
|
+
const unitLabel = chunkH5KXQEQD_js.getDisplayUnitLabel(
|
|
8173
8173
|
axisFormatting.displayUnits,
|
|
8174
8174
|
axisFormatting.displayUnitsLabel
|
|
8175
8175
|
);
|
|
@@ -8244,7 +8244,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
8244
8244
|
if (range.min >= 0) {
|
|
8245
8245
|
return null;
|
|
8246
8246
|
}
|
|
8247
|
-
const y =
|
|
8247
|
+
const y = chunkH5KXQEQD_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
8248
8248
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8249
8249
|
"line",
|
|
8250
8250
|
{
|
|
@@ -8268,7 +8268,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8268
8268
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
8269
8269
|
for (let i = 0; i <= steps; i++) {
|
|
8270
8270
|
const val = range.min + range.span * i / steps;
|
|
8271
|
-
const y =
|
|
8271
|
+
const y = chunkH5KXQEQD_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8272
8272
|
labels.push(
|
|
8273
8273
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8274
8274
|
"text",
|
|
@@ -8280,7 +8280,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8280
8280
|
fontFamily,
|
|
8281
8281
|
fontWeight,
|
|
8282
8282
|
fill: fontColor,
|
|
8283
|
-
children: hasDisplayUnits ?
|
|
8283
|
+
children: hasDisplayUnits ? chunkH5KXQEQD_js.formatAxisValueWithUnits(val, axisFormatting) : chunkH5KXQEQD_js.formatAxisValue(val)
|
|
8284
8284
|
},
|
|
8285
8285
|
`${id}-sec-vaxis-${i}`
|
|
8286
8286
|
)
|
|
@@ -8304,7 +8304,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8304
8304
|
);
|
|
8305
8305
|
}
|
|
8306
8306
|
if (hasDisplayUnits) {
|
|
8307
|
-
const unitLabel =
|
|
8307
|
+
const unitLabel = chunkH5KXQEQD_js.getDisplayUnitLabel(
|
|
8308
8308
|
axisFormatting.displayUnits,
|
|
8309
8309
|
axisFormatting.displayUnitsLabel
|
|
8310
8310
|
);
|
|
@@ -8335,7 +8335,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
8335
8335
|
const ticks = [];
|
|
8336
8336
|
for (let i = 0; i <= steps; i++) {
|
|
8337
8337
|
const val = range.min + range.span * i / steps;
|
|
8338
|
-
const y =
|
|
8338
|
+
const y = chunkH5KXQEQD_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8339
8339
|
ticks.push(
|
|
8340
8340
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8341
8341
|
"line",
|
|
@@ -8362,7 +8362,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
8362
8362
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
8363
8363
|
for (let i = 0; i <= steps; i++) {
|
|
8364
8364
|
const val = range.min + range.span * i / steps;
|
|
8365
|
-
const y =
|
|
8365
|
+
const y = chunkH5KXQEQD_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8366
8366
|
lines.push(
|
|
8367
8367
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8368
8368
|
"line",
|
|
@@ -8523,7 +8523,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
8523
8523
|
width: 8,
|
|
8524
8524
|
height: 8,
|
|
8525
8525
|
borderRadius: 2,
|
|
8526
|
-
backgroundColor:
|
|
8526
|
+
backgroundColor: chunkH5KXQEQD_js.seriesColor(
|
|
8527
8527
|
s,
|
|
8528
8528
|
si,
|
|
8529
8529
|
chartData.style?.styleId,
|
|
@@ -8562,8 +8562,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
8562
8562
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
8563
8563
|
const style = chartData.style;
|
|
8564
8564
|
const legendPos = style?.legendPosition || "b";
|
|
8565
|
-
const range =
|
|
8566
|
-
const layout =
|
|
8565
|
+
const range = chunkH5KXQEQD_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8566
|
+
const layout = chunkH5KXQEQD_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8567
8567
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8568
8568
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
8569
8569
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -8584,10 +8584,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
8584
8584
|
const close = closeSeries.values[ci] ?? high;
|
|
8585
8585
|
const isUp = close >= open;
|
|
8586
8586
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
8587
|
-
const highY =
|
|
8588
|
-
const lowY =
|
|
8589
|
-
const openY =
|
|
8590
|
-
const closeY =
|
|
8587
|
+
const highY = chunkH5KXQEQD_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
8588
|
+
const lowY = chunkH5KXQEQD_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
8589
|
+
const openY = chunkH5KXQEQD_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
8590
|
+
const closeY = chunkH5KXQEQD_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
8591
8591
|
elements.push(
|
|
8592
8592
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8593
8593
|
"line",
|
|
@@ -8630,7 +8630,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
8630
8630
|
textAnchor: "middle",
|
|
8631
8631
|
fontSize: 7,
|
|
8632
8632
|
fill: "#334155",
|
|
8633
|
-
children:
|
|
8633
|
+
children: chunkH5KXQEQD_js.formatAxisValue(close)
|
|
8634
8634
|
},
|
|
8635
8635
|
`${element.id}-stock-dl-${ci}`
|
|
8636
8636
|
)
|
|
@@ -8672,7 +8672,7 @@ function FailedToLoad() {
|
|
|
8672
8672
|
var LazySurfaceChart3DScene = React3__default.default.lazy(
|
|
8673
8673
|
async () => {
|
|
8674
8674
|
try {
|
|
8675
|
-
return await import('./SurfaceChart3DScene-
|
|
8675
|
+
return await import('./SurfaceChart3DScene-327DEJSK.js');
|
|
8676
8676
|
} catch {
|
|
8677
8677
|
return { default: FailedToLoad };
|
|
8678
8678
|
}
|
|
@@ -8696,7 +8696,7 @@ var SurfaceChart3DErrorBoundary = class extends React3__default.default.Componen
|
|
|
8696
8696
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
8697
8697
|
const rows = chartData.series.length;
|
|
8698
8698
|
const cols = Math.max(categoryLabels.length, 1);
|
|
8699
|
-
const range =
|
|
8699
|
+
const range = chunkH5KXQEQD_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8700
8700
|
const heightMap = new Float32Array(rows * cols);
|
|
8701
8701
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
8702
8702
|
for (let r = 0; r < rows; r++) {
|
|
@@ -8816,8 +8816,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
8816
8816
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
8817
8817
|
const style = chartData.style;
|
|
8818
8818
|
const legendPos = style?.legendPosition || "b";
|
|
8819
|
-
const layout =
|
|
8820
|
-
const range =
|
|
8819
|
+
const layout = chunkH5KXQEQD_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
8820
|
+
const range = chunkH5KXQEQD_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8821
8821
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8822
8822
|
const seriesCount = chartData.series.length;
|
|
8823
8823
|
const cols = catCount - 1;
|
|
@@ -8907,8 +8907,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
8907
8907
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
8908
8908
|
const style = chartData.style;
|
|
8909
8909
|
const legendPos = style?.legendPosition || "b";
|
|
8910
|
-
const layout =
|
|
8911
|
-
const range =
|
|
8910
|
+
const layout = chunkH5KXQEQD_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8911
|
+
const range = chunkH5KXQEQD_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8912
8912
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8913
8913
|
const seriesCount = chartData.series.length;
|
|
8914
8914
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -8971,7 +8971,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
8971
8971
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
8972
8972
|
const style = chartData.style;
|
|
8973
8973
|
const legendPos = style?.legendPosition || "b";
|
|
8974
|
-
const layout =
|
|
8974
|
+
const layout = chunkH5KXQEQD_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
8975
8975
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
8976
8976
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
8977
8977
|
const rects = [];
|
|
@@ -8994,7 +8994,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
8994
8994
|
y: curY,
|
|
8995
8995
|
width: Math.max(w - 1, 1),
|
|
8996
8996
|
height: Math.max(h - 1, 1),
|
|
8997
|
-
fill:
|
|
8997
|
+
fill: chunkH5KXQEQD_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
8998
8998
|
rx: 2,
|
|
8999
8999
|
opacity: 0.85
|
|
9000
9000
|
},
|
|
@@ -9047,8 +9047,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
9047
9047
|
const style = chartData.style;
|
|
9048
9048
|
const legendPos = style?.legendPosition || "b";
|
|
9049
9049
|
const values = chartData.series[0]?.values ?? [];
|
|
9050
|
-
const range =
|
|
9051
|
-
const layout =
|
|
9050
|
+
const range = chunkH5KXQEQD_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
9051
|
+
const layout = chunkH5KXQEQD_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
9052
9052
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
9053
9053
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
9054
9054
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -9059,8 +9059,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
9059
9059
|
const isLast = i === values.length - 1;
|
|
9060
9060
|
const startVal = isLast ? 0 : runningTotal;
|
|
9061
9061
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
9062
|
-
const barStartY =
|
|
9063
|
-
const barEndY =
|
|
9062
|
+
const barStartY = chunkH5KXQEQD_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
9063
|
+
const barEndY = chunkH5KXQEQD_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
9064
9064
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
9065
9065
|
const y = Math.min(barStartY, barEndY);
|
|
9066
9066
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -9089,7 +9089,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
9089
9089
|
textAnchor: "middle",
|
|
9090
9090
|
fontSize: 7,
|
|
9091
9091
|
fill: "#334155",
|
|
9092
|
-
children:
|
|
9092
|
+
children: chunkH5KXQEQD_js.formatAxisValue(isLast ? endVal : val)
|
|
9093
9093
|
},
|
|
9094
9094
|
`${element.id}-wf-dl-${i}`
|
|
9095
9095
|
)
|
|
@@ -9137,18 +9137,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
9137
9137
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
9138
9138
|
const style = chartData.style;
|
|
9139
9139
|
const legendPos = style?.legendPosition || "b";
|
|
9140
|
-
const layoutOpts =
|
|
9140
|
+
const layoutOpts = chunkH5KXQEQD_js.computeLayoutOptions(
|
|
9141
9141
|
chartData.axes,
|
|
9142
9142
|
chartData.dataTable,
|
|
9143
9143
|
chartData.series.length
|
|
9144
9144
|
);
|
|
9145
|
-
const layout =
|
|
9146
|
-
const { primary, secondary } =
|
|
9145
|
+
const layout = chunkH5KXQEQD_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
9146
|
+
const { primary, secondary } = chunkH5KXQEQD_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
9147
9147
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
9148
9148
|
const secondarySeries = secondary.map((e) => e.series);
|
|
9149
|
-
const range =
|
|
9150
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
9151
|
-
const secondaryAxisFmt =
|
|
9149
|
+
const range = chunkH5KXQEQD_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
9150
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkH5KXQEQD_js.computeValueRange(secondarySeries) : void 0;
|
|
9151
|
+
const secondaryAxisFmt = chunkH5KXQEQD_js.getSecondaryValueAxis(chartData.axes);
|
|
9152
9152
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
9153
9153
|
const barSeriesCount = 1;
|
|
9154
9154
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -9164,8 +9164,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9164
9164
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
9165
9165
|
barSeries.values.forEach((val, vi) => {
|
|
9166
9166
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
9167
|
-
const zeroY =
|
|
9168
|
-
const valY =
|
|
9167
|
+
const zeroY = chunkH5KXQEQD_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
9168
|
+
const valY = chunkH5KXQEQD_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
9169
9169
|
const y = Math.min(zeroY, valY);
|
|
9170
9170
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
9171
9171
|
barElements.push(
|
|
@@ -9176,7 +9176,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9176
9176
|
y,
|
|
9177
9177
|
width: barWidth,
|
|
9178
9178
|
height: h,
|
|
9179
|
-
fill:
|
|
9179
|
+
fill: chunkH5KXQEQD_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
9180
9180
|
rx: 1
|
|
9181
9181
|
},
|
|
9182
9182
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -9192,7 +9192,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9192
9192
|
textAnchor: "middle",
|
|
9193
9193
|
fontSize: 7,
|
|
9194
9194
|
fill: "#334155",
|
|
9195
|
-
children:
|
|
9195
|
+
children: chunkH5KXQEQD_js.formatAxisValue(val)
|
|
9196
9196
|
},
|
|
9197
9197
|
`${element.id}-combo-bar-dl-${vi}`
|
|
9198
9198
|
)
|
|
@@ -9209,10 +9209,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9209
9209
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
9210
9210
|
const points = series.values.map((val, vi) => {
|
|
9211
9211
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
9212
|
-
const y =
|
|
9212
|
+
const y = chunkH5KXQEQD_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
9213
9213
|
return { x, y, val };
|
|
9214
9214
|
});
|
|
9215
|
-
const c =
|
|
9215
|
+
const c = chunkH5KXQEQD_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
9216
9216
|
lineElements.push(
|
|
9217
9217
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9218
9218
|
"polyline",
|
|
@@ -9239,7 +9239,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9239
9239
|
textAnchor: "middle",
|
|
9240
9240
|
fontSize: 7,
|
|
9241
9241
|
fill: "#334155",
|
|
9242
|
-
children:
|
|
9242
|
+
children: chunkH5KXQEQD_js.formatAxisValue(p.val)
|
|
9243
9243
|
},
|
|
9244
9244
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
9245
9245
|
)
|
|
@@ -10993,14 +10993,14 @@ function buildNotesPdf(pages) {
|
|
|
10993
10993
|
notes: page.notes,
|
|
10994
10994
|
slideNumber: page.slideNumber
|
|
10995
10995
|
}));
|
|
10996
|
-
const bytes =
|
|
10996
|
+
const bytes = chunkH5KXQEQD_js.buildNotesPdfBytes(images, meta);
|
|
10997
10997
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
10998
10998
|
return URL.createObjectURL(blob);
|
|
10999
10999
|
}
|
|
11000
11000
|
|
|
11001
11001
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
11002
11002
|
function buildPdfFromImageData(images) {
|
|
11003
|
-
const bytes =
|
|
11003
|
+
const bytes = chunkH5KXQEQD_js.buildSlidesPdfBytes(images);
|
|
11004
11004
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
11005
11005
|
return URL.createObjectURL(blob);
|
|
11006
11006
|
}
|
|
@@ -11009,7 +11009,7 @@ function buildPdfFromImageData(images) {
|
|
|
11009
11009
|
var activePreview = null;
|
|
11010
11010
|
function startPreviewAnimation(elementId, preset, options) {
|
|
11011
11011
|
stopPreviewAnimation();
|
|
11012
|
-
const descriptor =
|
|
11012
|
+
const descriptor = chunkH5KXQEQD_js.buildPreviewAnimation(preset, options);
|
|
11013
11013
|
if (!descriptor) {
|
|
11014
11014
|
return;
|
|
11015
11015
|
}
|
|
@@ -11447,7 +11447,7 @@ function useElementOperations(input) {
|
|
|
11447
11447
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
11448
11448
|
const updateElementById = React3.useCallback(
|
|
11449
11449
|
(elementId, updates) => {
|
|
11450
|
-
if (
|
|
11450
|
+
if (chunkH5KXQEQD_js.isTemplateElementId(elementId)) {
|
|
11451
11451
|
const slideId = activeSlide?.id;
|
|
11452
11452
|
if (slideId) {
|
|
11453
11453
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -11487,7 +11487,7 @@ function useElementOperations(input) {
|
|
|
11487
11487
|
);
|
|
11488
11488
|
const updateSelectedShapeStyle = React3.useCallback(
|
|
11489
11489
|
(updates) => {
|
|
11490
|
-
if (!selectedElement || !
|
|
11490
|
+
if (!selectedElement || !chunkOBLHB72P_js.hasShapeProperties(selectedElement)) {
|
|
11491
11491
|
return;
|
|
11492
11492
|
}
|
|
11493
11493
|
updateSelectedElement({
|
|
@@ -11498,17 +11498,17 @@ function useElementOperations(input) {
|
|
|
11498
11498
|
);
|
|
11499
11499
|
const updateSelectedTextStyle = React3.useCallback(
|
|
11500
11500
|
(updates) => {
|
|
11501
|
-
if (!selectedElement || !
|
|
11501
|
+
if (!selectedElement || !chunkOBLHB72P_js.hasTextProperties(selectedElement)) {
|
|
11502
11502
|
return;
|
|
11503
11503
|
}
|
|
11504
|
-
const inlineSel =
|
|
11504
|
+
const inlineSel = chunkH5KXQEQD_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
11505
11505
|
if (inlineSel && selectedElement.textSegments) {
|
|
11506
|
-
const { newSegments: newSegments2, newSelection } =
|
|
11506
|
+
const { newSegments: newSegments2, newSelection } = chunkH5KXQEQD_js.applyStyleToSelectedSegments(
|
|
11507
11507
|
selectedElement.textSegments,
|
|
11508
11508
|
inlineSel,
|
|
11509
11509
|
updates
|
|
11510
11510
|
);
|
|
11511
|
-
|
|
11511
|
+
chunkH5KXQEQD_js.setPendingSelectionRestore(newSelection);
|
|
11512
11512
|
updateSelectedElement({
|
|
11513
11513
|
textSegments: newSegments2
|
|
11514
11514
|
});
|
|
@@ -11574,7 +11574,7 @@ function useSectionOperations(input) {
|
|
|
11574
11574
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
11575
11575
|
const addSection2 = React3.useCallback(
|
|
11576
11576
|
(name, afterSlideIndex) => {
|
|
11577
|
-
const result =
|
|
11577
|
+
const result = chunkH5KXQEQD_js.addSection(sections, slides, name, afterSlideIndex);
|
|
11578
11578
|
setSlides(result.slides);
|
|
11579
11579
|
setSections(result.sections);
|
|
11580
11580
|
markDirty();
|
|
@@ -11583,7 +11583,7 @@ function useSectionOperations(input) {
|
|
|
11583
11583
|
);
|
|
11584
11584
|
const renameSection2 = React3.useCallback(
|
|
11585
11585
|
(sectionId, newName) => {
|
|
11586
|
-
const result =
|
|
11586
|
+
const result = chunkH5KXQEQD_js.renameSection(sections, slides, sectionId, newName);
|
|
11587
11587
|
setSections(result.sections);
|
|
11588
11588
|
setSlides(result.slides);
|
|
11589
11589
|
markDirty();
|
|
@@ -11592,7 +11592,7 @@ function useSectionOperations(input) {
|
|
|
11592
11592
|
);
|
|
11593
11593
|
const deleteSection2 = React3.useCallback(
|
|
11594
11594
|
(sectionId) => {
|
|
11595
|
-
const result =
|
|
11595
|
+
const result = chunkH5KXQEQD_js.deleteSection(sections, slides, sectionId);
|
|
11596
11596
|
setSections(result.sections);
|
|
11597
11597
|
setSlides(result.slides);
|
|
11598
11598
|
markDirty();
|
|
@@ -11601,21 +11601,21 @@ function useSectionOperations(input) {
|
|
|
11601
11601
|
);
|
|
11602
11602
|
const moveSectionUp2 = React3.useCallback(
|
|
11603
11603
|
(sectionId) => {
|
|
11604
|
-
setSections(
|
|
11604
|
+
setSections(chunkH5KXQEQD_js.moveSectionUp(sections, sectionId));
|
|
11605
11605
|
markDirty();
|
|
11606
11606
|
},
|
|
11607
11607
|
[sections, setSections, markDirty]
|
|
11608
11608
|
);
|
|
11609
11609
|
const moveSectionDown2 = React3.useCallback(
|
|
11610
11610
|
(sectionId) => {
|
|
11611
|
-
setSections(
|
|
11611
|
+
setSections(chunkH5KXQEQD_js.moveSectionDown(sections, sectionId));
|
|
11612
11612
|
markDirty();
|
|
11613
11613
|
},
|
|
11614
11614
|
[sections, setSections, markDirty]
|
|
11615
11615
|
);
|
|
11616
11616
|
const moveSlidesToSection2 = React3.useCallback(
|
|
11617
11617
|
(slideIndexes, targetSectionId) => {
|
|
11618
|
-
const result =
|
|
11618
|
+
const result = chunkH5KXQEQD_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
11619
11619
|
setSlides(result.slides);
|
|
11620
11620
|
setSections(result.sections);
|
|
11621
11621
|
markDirty();
|
|
@@ -11634,7 +11634,7 @@ function useSectionOperations(input) {
|
|
|
11634
11634
|
|
|
11635
11635
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
11636
11636
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
11637
|
-
const resized =
|
|
11637
|
+
const resized = chunkH5KXQEQD_js.applyResize(
|
|
11638
11638
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
11639
11639
|
handle,
|
|
11640
11640
|
dx,
|
|
@@ -11646,7 +11646,7 @@ function computeResizeGeometry(handle, startX, startY, startWidth, startHeight,
|
|
|
11646
11646
|
if (!snapToGrid) {
|
|
11647
11647
|
return box;
|
|
11648
11648
|
}
|
|
11649
|
-
return
|
|
11649
|
+
return chunkH5KXQEQD_js.snapBoxToGrid(box, handle, gridSpacingPx, MIN_ELEMENT_SIZE);
|
|
11650
11650
|
}
|
|
11651
11651
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
11652
11652
|
const range = startWidth || 200;
|
|
@@ -11756,7 +11756,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
11756
11756
|
width: el.width,
|
|
11757
11757
|
height: el.height
|
|
11758
11758
|
}));
|
|
11759
|
-
const snapResult =
|
|
11759
|
+
const snapResult = chunkH5KXQEQD_js.computeSnapToShape(
|
|
11760
11760
|
targetX,
|
|
11761
11761
|
targetY,
|
|
11762
11762
|
primaryEl.width,
|
|
@@ -11899,13 +11899,13 @@ function processPointerUp(input) {
|
|
|
11899
11899
|
if (i !== activeSlideIndex) {
|
|
11900
11900
|
return s;
|
|
11901
11901
|
}
|
|
11902
|
-
const rerouted =
|
|
11902
|
+
const rerouted = chunkH5KXQEQD_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
11903
11903
|
if (rerouted.length === 0) {
|
|
11904
11904
|
return s;
|
|
11905
11905
|
}
|
|
11906
11906
|
return {
|
|
11907
11907
|
...s,
|
|
11908
|
-
elements:
|
|
11908
|
+
elements: chunkH5KXQEQD_js.applyReroutedConnectors(s.elements, rerouted)
|
|
11909
11909
|
};
|
|
11910
11910
|
})
|
|
11911
11911
|
);
|
|
@@ -11924,9 +11924,9 @@ function processPointerUp(input) {
|
|
|
11924
11924
|
}
|
|
11925
11925
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
11926
11926
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
11927
|
-
const hitIds =
|
|
11927
|
+
const hitIds = chunkH5KXQEQD_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
11928
11928
|
if (marquee.additive) {
|
|
11929
|
-
const merged =
|
|
11929
|
+
const merged = chunkH5KXQEQD_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
11930
11930
|
if (merged.length > 0) {
|
|
11931
11931
|
applySelection(merged[0], merged);
|
|
11932
11932
|
} else {
|
|
@@ -11949,8 +11949,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
11949
11949
|
}
|
|
11950
11950
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
11951
11951
|
});
|
|
11952
|
-
const rerouted =
|
|
11953
|
-
return
|
|
11952
|
+
const rerouted = chunkH5KXQEQD_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
11953
|
+
return chunkH5KXQEQD_js.applyReroutedConnectors(movedElements, rerouted);
|
|
11954
11954
|
};
|
|
11955
11955
|
if (editTemplateMode) {
|
|
11956
11956
|
const slideId = activeSlide?.id;
|
|
@@ -12100,8 +12100,8 @@ function useCanvasInteractions(input) {
|
|
|
12100
12100
|
return;
|
|
12101
12101
|
}
|
|
12102
12102
|
const el = elementLookup.get(editId);
|
|
12103
|
-
if (el &&
|
|
12104
|
-
const newSegments =
|
|
12103
|
+
if (el && chunkOBLHB72P_js.hasTextProperties(el)) {
|
|
12104
|
+
const newSegments = chunkH5KXQEQD_js.remapTextToSegments(inlineEditingText, el.textSegments, el.textStyle);
|
|
12105
12105
|
ops.updateElementById(editId, {
|
|
12106
12106
|
text: inlineEditingText,
|
|
12107
12107
|
textSegments: newSegments
|
|
@@ -12112,7 +12112,7 @@ function useCanvasInteractions(input) {
|
|
|
12112
12112
|
setInlineEditingText("");
|
|
12113
12113
|
};
|
|
12114
12114
|
const openEquationEditorForElement = (el) => {
|
|
12115
|
-
if (!
|
|
12115
|
+
if (!chunkOBLHB72P_js.hasTextProperties(el)) {
|
|
12116
12116
|
return false;
|
|
12117
12117
|
}
|
|
12118
12118
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -12141,7 +12141,7 @@ function useCanvasInteractions(input) {
|
|
|
12141
12141
|
justSelectedRef.current = false;
|
|
12142
12142
|
} else {
|
|
12143
12143
|
const el = elementLookup.get(elementId);
|
|
12144
|
-
if (el &&
|
|
12144
|
+
if (el && chunkOBLHB72P_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
12145
12145
|
if (!openEquationEditorForElement(el)) {
|
|
12146
12146
|
setInlineEditingElementId(elementId);
|
|
12147
12147
|
setInlineEditingText(el.text ?? "");
|
|
@@ -12160,7 +12160,7 @@ function useCanvasInteractions(input) {
|
|
|
12160
12160
|
if (openEquationEditorForElement(el)) {
|
|
12161
12161
|
return;
|
|
12162
12162
|
}
|
|
12163
|
-
if (
|
|
12163
|
+
if (chunkOBLHB72P_js.hasTextProperties(el)) {
|
|
12164
12164
|
setInlineEditingElementId(elementId);
|
|
12165
12165
|
setInlineEditingText(el.text ?? "");
|
|
12166
12166
|
}
|
|
@@ -12565,7 +12565,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12565
12565
|
y: 120,
|
|
12566
12566
|
width: 600,
|
|
12567
12567
|
height: 340,
|
|
12568
|
-
smartArtData:
|
|
12568
|
+
smartArtData: chunkH5KXQEQD_js.buildSmartArtPresetData(
|
|
12569
12569
|
layout,
|
|
12570
12570
|
defaultItems,
|
|
12571
12571
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -12658,11 +12658,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
12658
12658
|
if (!activeSlide) {
|
|
12659
12659
|
return;
|
|
12660
12660
|
}
|
|
12661
|
-
const preset =
|
|
12661
|
+
const preset = chunkH5KXQEQD_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
12662
12662
|
if (!preset) {
|
|
12663
12663
|
return;
|
|
12664
12664
|
}
|
|
12665
|
-
const defaultPptxAction =
|
|
12665
|
+
const defaultPptxAction = chunkOBLHB72P_js.elementActionToPptxAction({
|
|
12666
12666
|
trigger: "click",
|
|
12667
12667
|
type: preset.defaultAction
|
|
12668
12668
|
});
|
|
@@ -12772,7 +12772,7 @@ function useInsertElements(input) {
|
|
|
12772
12772
|
return;
|
|
12773
12773
|
}
|
|
12774
12774
|
addElement({
|
|
12775
|
-
...
|
|
12775
|
+
...chunkH5KXQEQD_js.newTableElement(DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
12776
12776
|
id: generateElementId()
|
|
12777
12777
|
});
|
|
12778
12778
|
};
|
|
@@ -12780,7 +12780,7 @@ function useInsertElements(input) {
|
|
|
12780
12780
|
if (!activeSlide) {
|
|
12781
12781
|
return;
|
|
12782
12782
|
}
|
|
12783
|
-
addElement(
|
|
12783
|
+
addElement(chunkH5KXQEQD_js.createDefaultChartElement(chartType));
|
|
12784
12784
|
};
|
|
12785
12785
|
const structured = createStructuredElementHandlers({
|
|
12786
12786
|
activeSlide,
|
|
@@ -12911,7 +12911,7 @@ function resolveShapePath(el) {
|
|
|
12911
12911
|
return el.pathData;
|
|
12912
12912
|
}
|
|
12913
12913
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
12914
|
-
const clipPath =
|
|
12914
|
+
const clipPath = chunkOBLHB72P_js.getPresetShapeClipPath(el.shapeType);
|
|
12915
12915
|
if (clipPath) {
|
|
12916
12916
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
12917
12917
|
if (svgPath) {
|
|
@@ -12962,7 +12962,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
12962
12962
|
return parts.join(" ");
|
|
12963
12963
|
}
|
|
12964
12964
|
function transformPathToGlobal(pathData, el) {
|
|
12965
|
-
const polys =
|
|
12965
|
+
const polys = chunkOBLHB72P_js.svgPathToPolygons(pathData);
|
|
12966
12966
|
if (polys.length === 0) {
|
|
12967
12967
|
return pathData;
|
|
12968
12968
|
}
|
|
@@ -12982,10 +12982,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
12982
12982
|
y: pt.y * scaleY + el.y
|
|
12983
12983
|
}))
|
|
12984
12984
|
);
|
|
12985
|
-
return
|
|
12985
|
+
return chunkOBLHB72P_js.polygonsToSvgPath(transformed);
|
|
12986
12986
|
}
|
|
12987
12987
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
12988
|
-
const polys =
|
|
12988
|
+
const polys = chunkOBLHB72P_js.svgPathToPolygons(pathData);
|
|
12989
12989
|
if (polys.length === 0) {
|
|
12990
12990
|
return pathData;
|
|
12991
12991
|
}
|
|
@@ -12995,10 +12995,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
12995
12995
|
y: pt.y - y
|
|
12996
12996
|
}))
|
|
12997
12997
|
);
|
|
12998
|
-
return
|
|
12998
|
+
return chunkOBLHB72P_js.polygonsToSvgPath(transformed);
|
|
12999
12999
|
}
|
|
13000
13000
|
function pathBounds(pathData) {
|
|
13001
|
-
const polys =
|
|
13001
|
+
const polys = chunkOBLHB72P_js.svgPathToPolygons(pathData);
|
|
13002
13002
|
let minX = Infinity;
|
|
13003
13003
|
let minY = Infinity;
|
|
13004
13004
|
let maxX = -Infinity;
|
|
@@ -13057,7 +13057,7 @@ function useMergeShapesHandler(input) {
|
|
|
13057
13057
|
let allFragments = [];
|
|
13058
13058
|
let remaining = globalPaths[0];
|
|
13059
13059
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
13060
|
-
const frags =
|
|
13060
|
+
const frags = chunkOBLHB72P_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
13061
13061
|
if (Array.isArray(frags)) {
|
|
13062
13062
|
allFragments = frags;
|
|
13063
13063
|
}
|
|
@@ -13124,7 +13124,7 @@ function useMergeShapesHandler(input) {
|
|
|
13124
13124
|
} else {
|
|
13125
13125
|
let resultPath = globalPaths[0];
|
|
13126
13126
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
13127
|
-
const result =
|
|
13127
|
+
const result = chunkOBLHB72P_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
13128
13128
|
if (typeof result === "string") {
|
|
13129
13129
|
resultPath = result;
|
|
13130
13130
|
}
|
|
@@ -13208,7 +13208,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13208
13208
|
if (ids.length < 2 || !activeSlide) {
|
|
13209
13209
|
return;
|
|
13210
13210
|
}
|
|
13211
|
-
const { elements, groupId } =
|
|
13211
|
+
const { elements, groupId } = chunkH5KXQEQD_js.groupElements(ops.activeElements, ids, generateElementId());
|
|
13212
13212
|
if (groupId === null) {
|
|
13213
13213
|
return;
|
|
13214
13214
|
}
|
|
@@ -13221,7 +13221,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13221
13221
|
return;
|
|
13222
13222
|
}
|
|
13223
13223
|
const group = selectedElement;
|
|
13224
|
-
const intoTemplate =
|
|
13224
|
+
const intoTemplate = chunkH5KXQEQD_js.isTemplateElementId(group.id);
|
|
13225
13225
|
const ungrouped = group.children.map((child) => ({
|
|
13226
13226
|
...structuredClone(child),
|
|
13227
13227
|
// Keep child ids in the same store as the group so later edits route
|
|
@@ -13250,7 +13250,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13250
13250
|
if (!edge) {
|
|
13251
13251
|
return;
|
|
13252
13252
|
}
|
|
13253
|
-
const positions =
|
|
13253
|
+
const positions = chunkH5KXQEQD_js.alignElements(selectedElements, edge);
|
|
13254
13254
|
for (const [id, pos] of positions) {
|
|
13255
13255
|
const el = elementLookup.get(id);
|
|
13256
13256
|
if (!el) {
|
|
@@ -13268,7 +13268,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13268
13268
|
if (!distAxis) {
|
|
13269
13269
|
return;
|
|
13270
13270
|
}
|
|
13271
|
-
const positions =
|
|
13271
|
+
const positions = chunkH5KXQEQD_js.distributeElements(selectedElements, distAxis);
|
|
13272
13272
|
for (const [id, pos] of positions) {
|
|
13273
13273
|
const el = elementLookup.get(id);
|
|
13274
13274
|
if (!el) {
|
|
@@ -13285,7 +13285,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13285
13285
|
}
|
|
13286
13286
|
const id = selectedElement.id;
|
|
13287
13287
|
ops.updateActiveElements(
|
|
13288
|
-
(els) => direction === "forward" ?
|
|
13288
|
+
(els) => direction === "forward" ? chunkH5KXQEQD_js.bringForward(els, id) : direction === "backward" ? chunkH5KXQEQD_js.sendBackward(els, id) : els
|
|
13289
13289
|
);
|
|
13290
13290
|
history.markDirty();
|
|
13291
13291
|
};
|
|
@@ -13295,7 +13295,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13295
13295
|
}
|
|
13296
13296
|
const id = selectedElement.id;
|
|
13297
13297
|
ops.updateActiveElements(
|
|
13298
|
-
(els) => direction === "front" ?
|
|
13298
|
+
(els) => direction === "front" ? chunkH5KXQEQD_js.bringToFront(els, id) : chunkH5KXQEQD_js.sendToBack(els, id)
|
|
13299
13299
|
);
|
|
13300
13300
|
history.markDirty();
|
|
13301
13301
|
};
|
|
@@ -13417,7 +13417,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
13417
13417
|
function useSlideManagement(input) {
|
|
13418
13418
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
13419
13419
|
const handleAddSlide = () => {
|
|
13420
|
-
const newSlide =
|
|
13420
|
+
const newSlide = chunkH5KXQEQD_js.createBlankSlide(slides.length + 1);
|
|
13421
13421
|
ops.updateSlides((prev) => {
|
|
13422
13422
|
const next = [...prev];
|
|
13423
13423
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -13480,7 +13480,7 @@ function useSlideManagement(input) {
|
|
|
13480
13480
|
}
|
|
13481
13481
|
const clone = {
|
|
13482
13482
|
...src,
|
|
13483
|
-
id:
|
|
13483
|
+
id: chunkH5KXQEQD_js.makeSlideId(),
|
|
13484
13484
|
elements: src.elements.map((el) => ({
|
|
13485
13485
|
...el,
|
|
13486
13486
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -13512,7 +13512,7 @@ function useSlideManagement(input) {
|
|
|
13512
13512
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
13513
13513
|
const insertAt = activeSlideIndex + 1;
|
|
13514
13514
|
const draft = {
|
|
13515
|
-
...
|
|
13515
|
+
...chunkH5KXQEQD_js.createBlankSlide(slides.length + 1),
|
|
13516
13516
|
layoutPath,
|
|
13517
13517
|
...layoutName ? { layoutName } : {}
|
|
13518
13518
|
};
|
|
@@ -13573,7 +13573,7 @@ function createTableMergeHandlers(input) {
|
|
|
13573
13573
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
13574
13574
|
return;
|
|
13575
13575
|
}
|
|
13576
|
-
const newTableData =
|
|
13576
|
+
const newTableData = chunkH5KXQEQD_js.mergeCells(
|
|
13577
13577
|
[
|
|
13578
13578
|
{ row: rowIndex, col: columnIndex },
|
|
13579
13579
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -13581,7 +13581,7 @@ function createTableMergeHandlers(input) {
|
|
|
13581
13581
|
td
|
|
13582
13582
|
);
|
|
13583
13583
|
const updates = { tableData: newTableData };
|
|
13584
|
-
const newRawXml =
|
|
13584
|
+
const newRawXml = chunkOBLHB72P_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13585
13585
|
if (newRawXml) {
|
|
13586
13586
|
updates.rawXml = newRawXml;
|
|
13587
13587
|
}
|
|
@@ -13607,7 +13607,7 @@ function createTableMergeHandlers(input) {
|
|
|
13607
13607
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
13608
13608
|
return;
|
|
13609
13609
|
}
|
|
13610
|
-
const newTableData =
|
|
13610
|
+
const newTableData = chunkH5KXQEQD_js.mergeCells(
|
|
13611
13611
|
[
|
|
13612
13612
|
{ row: rowIndex, col: columnIndex },
|
|
13613
13613
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -13615,7 +13615,7 @@ function createTableMergeHandlers(input) {
|
|
|
13615
13615
|
td
|
|
13616
13616
|
);
|
|
13617
13617
|
const updates = { tableData: newTableData };
|
|
13618
|
-
const newRawXml =
|
|
13618
|
+
const newRawXml = chunkOBLHB72P_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13619
13619
|
if (newRawXml) {
|
|
13620
13620
|
updates.rawXml = newRawXml;
|
|
13621
13621
|
}
|
|
@@ -13630,9 +13630,9 @@ function createTableMergeHandlers(input) {
|
|
|
13630
13630
|
return;
|
|
13631
13631
|
}
|
|
13632
13632
|
const td = selectedElement.tableData;
|
|
13633
|
-
const newTableData =
|
|
13633
|
+
const newTableData = chunkH5KXQEQD_js.mergeCells(ts.selectedCells, td);
|
|
13634
13634
|
const updates = { tableData: newTableData };
|
|
13635
|
-
const newRawXml =
|
|
13635
|
+
const newRawXml = chunkOBLHB72P_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13636
13636
|
if (newRawXml) {
|
|
13637
13637
|
updates.rawXml = newRawXml;
|
|
13638
13638
|
}
|
|
@@ -13649,9 +13649,9 @@ function createTableMergeHandlers(input) {
|
|
|
13649
13649
|
}
|
|
13650
13650
|
const { rowIndex, columnIndex } = ts;
|
|
13651
13651
|
const td = selectedElement.tableData;
|
|
13652
|
-
const newTableData =
|
|
13652
|
+
const newTableData = chunkH5KXQEQD_js.splitCell(rowIndex, columnIndex, td);
|
|
13653
13653
|
const updates = { tableData: newTableData };
|
|
13654
|
-
const newRawXml =
|
|
13654
|
+
const newRawXml = chunkOBLHB72P_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13655
13655
|
if (newRawXml) {
|
|
13656
13656
|
updates.rawXml = newRawXml;
|
|
13657
13657
|
}
|
|
@@ -13695,7 +13695,7 @@ function createTableStructHandlers(input) {
|
|
|
13695
13695
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
13696
13696
|
}
|
|
13697
13697
|
if (el.rawXml) {
|
|
13698
|
-
const newRawXml =
|
|
13698
|
+
const newRawXml = chunkOBLHB72P_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
13699
13699
|
if (newRawXml) {
|
|
13700
13700
|
updates.rawXml = newRawXml;
|
|
13701
13701
|
}
|
|
@@ -13719,7 +13719,7 @@ function createTableStructHandlers(input) {
|
|
|
13719
13719
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
13720
13720
|
const updates = {};
|
|
13721
13721
|
if (selectedElement.rawXml) {
|
|
13722
|
-
const newRawXml =
|
|
13722
|
+
const newRawXml = chunkOBLHB72P_js.updateCellTextStyleInRawXml(
|
|
13723
13723
|
selectedElement,
|
|
13724
13724
|
rowIndex,
|
|
13725
13725
|
colIndex,
|
|
@@ -13783,9 +13783,9 @@ function createTableStructHandlers(input) {
|
|
|
13783
13783
|
return;
|
|
13784
13784
|
}
|
|
13785
13785
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
13786
|
-
const newTableData =
|
|
13786
|
+
const newTableData = chunkH5KXQEQD_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
13787
13787
|
const updates = { tableData: newTableData };
|
|
13788
|
-
const newRawXml =
|
|
13788
|
+
const newRawXml = chunkOBLHB72P_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13789
13789
|
if (newRawXml) {
|
|
13790
13790
|
updates.rawXml = newRawXml;
|
|
13791
13791
|
}
|
|
@@ -13798,12 +13798,12 @@ function createTableStructHandlers(input) {
|
|
|
13798
13798
|
}
|
|
13799
13799
|
const td = selectedElement.tableData;
|
|
13800
13800
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
13801
|
-
const newTableData =
|
|
13801
|
+
const newTableData = chunkH5KXQEQD_js.deleteTableRow(td, rowIdx);
|
|
13802
13802
|
if (newTableData === td) {
|
|
13803
13803
|
return;
|
|
13804
13804
|
}
|
|
13805
13805
|
const updates = { tableData: newTableData };
|
|
13806
|
-
const newRawXml =
|
|
13806
|
+
const newRawXml = chunkOBLHB72P_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13807
13807
|
if (newRawXml) {
|
|
13808
13808
|
updates.rawXml = newRawXml;
|
|
13809
13809
|
}
|
|
@@ -13815,9 +13815,9 @@ function createTableStructHandlers(input) {
|
|
|
13815
13815
|
return;
|
|
13816
13816
|
}
|
|
13817
13817
|
const colIdx = ts?.columnIndex ?? 0;
|
|
13818
|
-
const newTableData =
|
|
13818
|
+
const newTableData = chunkH5KXQEQD_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
13819
13819
|
const updates = { tableData: newTableData };
|
|
13820
|
-
const newRawXml =
|
|
13820
|
+
const newRawXml = chunkOBLHB72P_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13821
13821
|
if (newRawXml) {
|
|
13822
13822
|
updates.rawXml = newRawXml;
|
|
13823
13823
|
}
|
|
@@ -13830,12 +13830,12 @@ function createTableStructHandlers(input) {
|
|
|
13830
13830
|
}
|
|
13831
13831
|
const td = selectedElement.tableData;
|
|
13832
13832
|
const colIdx = ts?.columnIndex ?? 0;
|
|
13833
|
-
const newTableData =
|
|
13833
|
+
const newTableData = chunkH5KXQEQD_js.deleteTableColumn(td, colIdx);
|
|
13834
13834
|
if (newTableData === td) {
|
|
13835
13835
|
return;
|
|
13836
13836
|
}
|
|
13837
13837
|
const updates = { tableData: newTableData };
|
|
13838
|
-
const newRawXml =
|
|
13838
|
+
const newRawXml = chunkOBLHB72P_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13839
13839
|
if (newRawXml) {
|
|
13840
13840
|
updates.rawXml = newRawXml;
|
|
13841
13841
|
}
|
|
@@ -13868,8 +13868,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
13868
13868
|
return html2canvasPro__default.default(element, {
|
|
13869
13869
|
...options,
|
|
13870
13870
|
onclone: async (doc, clonedEl) => {
|
|
13871
|
-
await
|
|
13872
|
-
|
|
13871
|
+
await chunkH5KXQEQD_js.normalizeColorsForCapture(doc, clonedEl);
|
|
13872
|
+
chunkH5KXQEQD_js.preprocessCssForCapture(clonedEl);
|
|
13873
13873
|
if (typeof userOnClone === "function") {
|
|
13874
13874
|
userOnClone(doc, clonedEl);
|
|
13875
13875
|
}
|
|
@@ -13925,7 +13925,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
13925
13925
|
}
|
|
13926
13926
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
13927
13927
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
13928
|
-
|
|
13928
|
+
chunkH5KXQEQD_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
13929
13929
|
}
|
|
13930
13930
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
13931
13931
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -13947,7 +13947,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13947
13947
|
continue;
|
|
13948
13948
|
}
|
|
13949
13949
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
13950
|
-
images.push(
|
|
13950
|
+
images.push(chunkH5KXQEQD_js.canvasToJpegData(canvas));
|
|
13951
13951
|
}
|
|
13952
13952
|
onProgress?.(totalSlides, totalSlides);
|
|
13953
13953
|
setActiveSlide(currentSlideIndex);
|
|
@@ -13955,7 +13955,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13955
13955
|
throw new Error(chunkK74UOJ6P_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
13956
13956
|
}
|
|
13957
13957
|
const pdfBlobUrl = buildPdfFromImageData(images);
|
|
13958
|
-
|
|
13958
|
+
chunkH5KXQEQD_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
13959
13959
|
}
|
|
13960
13960
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
13961
13961
|
const { scale = 2, onProgress } = options;
|
|
@@ -14004,7 +14004,7 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
14004
14004
|
throw new Error(chunkK74UOJ6P_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
14005
14005
|
}
|
|
14006
14006
|
const pdfDataUrl = buildNotesPdf(pages);
|
|
14007
|
-
|
|
14007
|
+
chunkH5KXQEQD_js.downloadDataUrl(pdfDataUrl, filename);
|
|
14008
14008
|
}
|
|
14009
14009
|
|
|
14010
14010
|
// src/viewer/utils/export-video.ts
|
|
@@ -14048,7 +14048,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
14048
14048
|
const fps = 30;
|
|
14049
14049
|
const stream = recordingCanvas.captureStream(fps);
|
|
14050
14050
|
const recorder = new MediaRecorder(stream, {
|
|
14051
|
-
mimeType:
|
|
14051
|
+
mimeType: chunkH5KXQEQD_js.pickSupportedMimeType([...chunkH5KXQEQD_js.WEBM_MIME_CANDIDATES]),
|
|
14052
14052
|
videoBitsPerSecond: 5e6
|
|
14053
14053
|
});
|
|
14054
14054
|
const chunks = [];
|
|
@@ -14071,8 +14071,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
14071
14071
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
14072
14072
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
14073
14073
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
14074
|
-
const frameInterval =
|
|
14075
|
-
const framesNeeded =
|
|
14074
|
+
const frameInterval = chunkH5KXQEQD_js.fpsToFrameIntervalMs(fps);
|
|
14075
|
+
const framesNeeded = chunkH5KXQEQD_js.segmentFrameCount(duration, fps);
|
|
14076
14076
|
for (let f = 0; f < framesNeeded; f++) {
|
|
14077
14077
|
if (signal?.aborted) {
|
|
14078
14078
|
recorder.stop();
|
|
@@ -14121,7 +14121,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
14121
14121
|
if (frames.length === 0) {
|
|
14122
14122
|
throw new Error(chunkK74UOJ6P_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
14123
14123
|
}
|
|
14124
|
-
const gifBytes =
|
|
14124
|
+
const gifBytes = chunkH5KXQEQD_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
14125
14125
|
onProgress?.(totalSlides, totalSlides);
|
|
14126
14126
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
14127
14127
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -14193,7 +14193,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
14193
14193
|
continue;
|
|
14194
14194
|
}
|
|
14195
14195
|
onProgress?.(processedCount, data.slides.length);
|
|
14196
|
-
let svg =
|
|
14196
|
+
let svg = chunkOBLHB72P_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
14197
14197
|
if (embedFonts && fontFaces?.length) {
|
|
14198
14198
|
svg = injectFontFaces(svg, fontFaces);
|
|
14199
14199
|
}
|
|
@@ -14263,7 +14263,7 @@ function useExportSaveAs(input) {
|
|
|
14263
14263
|
setExportProgress(95);
|
|
14264
14264
|
setExportStatusMessage("Downloading...");
|
|
14265
14265
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
14266
|
-
|
|
14266
|
+
chunkH5KXQEQD_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
14267
14267
|
setExportProgress(100);
|
|
14268
14268
|
} catch (err) {
|
|
14269
14269
|
if (err.name !== "AbortError") {
|
|
@@ -14286,7 +14286,7 @@ function useExportSaveAs(input) {
|
|
|
14286
14286
|
const blob = new Blob([data], {
|
|
14287
14287
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
14288
14288
|
});
|
|
14289
|
-
|
|
14289
|
+
chunkH5KXQEQD_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
14290
14290
|
} catch (err) {
|
|
14291
14291
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
14292
14292
|
}
|
|
@@ -14299,7 +14299,7 @@ function useExportSaveAs(input) {
|
|
|
14299
14299
|
const pptxGuides = guides.map((g) => ({
|
|
14300
14300
|
id: g.id,
|
|
14301
14301
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
14302
|
-
positionEmu:
|
|
14302
|
+
positionEmu: chunkOBLHB72P_js.guidePxToEmu(g.position)
|
|
14303
14303
|
}));
|
|
14304
14304
|
return {
|
|
14305
14305
|
...slide,
|
|
@@ -14362,7 +14362,7 @@ function safeConfirm(message) {
|
|
|
14362
14362
|
}
|
|
14363
14363
|
}
|
|
14364
14364
|
function downloadBlob2(blob, filename) {
|
|
14365
|
-
|
|
14365
|
+
chunkH5KXQEQD_js.downloadBlob(blob, chunkH5KXQEQD_js.sanitizeDownloadFilename(filename));
|
|
14366
14366
|
}
|
|
14367
14367
|
|
|
14368
14368
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -14461,21 +14461,21 @@ function useExportHandlers(input) {
|
|
|
14461
14461
|
{
|
|
14462
14462
|
scale: 2,
|
|
14463
14463
|
onProgress: (current, total) => {
|
|
14464
|
-
setExportProgress(
|
|
14465
|
-
setExportStatusMessage(
|
|
14464
|
+
setExportProgress(chunkH5KXQEQD_js.slideProgressPercent(current, total));
|
|
14465
|
+
setExportStatusMessage(chunkH5KXQEQD_js.slideStatusLabel("Rendering", current, total));
|
|
14466
14466
|
},
|
|
14467
14467
|
signal: abortCtrl.signal
|
|
14468
14468
|
}
|
|
14469
14469
|
);
|
|
14470
|
-
setExportProgress(
|
|
14470
|
+
setExportProgress(chunkH5KXQEQD_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14471
14471
|
setExportStatusMessage("Building PDF...");
|
|
14472
14472
|
await new Promise((r) => {
|
|
14473
14473
|
setTimeout(r, 100);
|
|
14474
14474
|
});
|
|
14475
|
-
setExportProgress(
|
|
14475
|
+
setExportProgress(chunkH5KXQEQD_js.EXPORT_DONE_PERCENT);
|
|
14476
14476
|
setExportStatusMessage("Done!");
|
|
14477
14477
|
} catch (err) {
|
|
14478
|
-
if (!
|
|
14478
|
+
if (!chunkH5KXQEQD_js.isExportAbortError(err)) {
|
|
14479
14479
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
14480
14480
|
}
|
|
14481
14481
|
} finally {
|
|
@@ -14505,21 +14505,21 @@ function useExportHandlers(input) {
|
|
|
14505
14505
|
{
|
|
14506
14506
|
scale: 2,
|
|
14507
14507
|
onProgress: (current, total) => {
|
|
14508
|
-
setExportProgress(
|
|
14509
|
-
setExportStatusMessage(
|
|
14508
|
+
setExportProgress(chunkH5KXQEQD_js.slideProgressPercent(current, total));
|
|
14509
|
+
setExportStatusMessage(chunkH5KXQEQD_js.slideStatusLabel("Rendering", current, total));
|
|
14510
14510
|
},
|
|
14511
14511
|
signal: abortCtrl.signal
|
|
14512
14512
|
}
|
|
14513
14513
|
);
|
|
14514
|
-
setExportProgress(
|
|
14514
|
+
setExportProgress(chunkH5KXQEQD_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14515
14515
|
setExportStatusMessage("Building PDF...");
|
|
14516
14516
|
await new Promise((r) => {
|
|
14517
14517
|
setTimeout(r, 100);
|
|
14518
14518
|
});
|
|
14519
|
-
setExportProgress(
|
|
14519
|
+
setExportProgress(chunkH5KXQEQD_js.EXPORT_DONE_PERCENT);
|
|
14520
14520
|
setExportStatusMessage("Done!");
|
|
14521
14521
|
} catch (err) {
|
|
14522
|
-
if (!
|
|
14522
|
+
if (!chunkH5KXQEQD_js.isExportAbortError(err)) {
|
|
14523
14523
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
14524
14524
|
}
|
|
14525
14525
|
} finally {
|
|
@@ -14560,22 +14560,22 @@ function useExportHandlers(input) {
|
|
|
14560
14560
|
scale: 1,
|
|
14561
14561
|
slideDurationMs: 3e3,
|
|
14562
14562
|
onProgress: (current, total) => {
|
|
14563
|
-
setExportProgress(
|
|
14564
|
-
setExportStatusMessage(
|
|
14563
|
+
setExportProgress(chunkH5KXQEQD_js.slideProgressPercent(current, total, 45));
|
|
14564
|
+
setExportStatusMessage(chunkH5KXQEQD_js.slideStatusLabel("Capturing", current, total));
|
|
14565
14565
|
},
|
|
14566
14566
|
onRecordProgress: (current, total) => {
|
|
14567
|
-
setExportProgress(
|
|
14568
|
-
setExportStatusMessage(
|
|
14567
|
+
setExportProgress(chunkH5KXQEQD_js.recordProgressPercent(current, total));
|
|
14568
|
+
setExportStatusMessage(chunkH5KXQEQD_js.slideStatusLabel("Recording", current, total));
|
|
14569
14569
|
},
|
|
14570
14570
|
signal: abortCtrl.signal
|
|
14571
14571
|
}
|
|
14572
14572
|
);
|
|
14573
|
-
setExportProgress(
|
|
14573
|
+
setExportProgress(chunkH5KXQEQD_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14574
14574
|
setExportStatusMessage("Saving file...");
|
|
14575
14575
|
downloadBlob2(blob, "presentation.webm");
|
|
14576
|
-
setExportProgress(
|
|
14576
|
+
setExportProgress(chunkH5KXQEQD_js.EXPORT_DONE_PERCENT);
|
|
14577
14577
|
} catch (err) {
|
|
14578
|
-
if (!
|
|
14578
|
+
if (!chunkH5KXQEQD_js.isExportAbortError(err)) {
|
|
14579
14579
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
14580
14580
|
}
|
|
14581
14581
|
} finally {
|
|
@@ -14603,18 +14603,18 @@ function useExportHandlers(input) {
|
|
|
14603
14603
|
scale: 0.5,
|
|
14604
14604
|
slideDurationMs: 2e3,
|
|
14605
14605
|
onProgress: (current, total) => {
|
|
14606
|
-
setExportProgress(
|
|
14607
|
-
setExportStatusMessage(
|
|
14606
|
+
setExportProgress(chunkH5KXQEQD_js.slideProgressPercent(current, total));
|
|
14607
|
+
setExportStatusMessage(chunkH5KXQEQD_js.slideStatusLabel("Encoding", current, total));
|
|
14608
14608
|
},
|
|
14609
14609
|
signal: abortCtrl.signal
|
|
14610
14610
|
}
|
|
14611
14611
|
);
|
|
14612
|
-
setExportProgress(
|
|
14612
|
+
setExportProgress(chunkH5KXQEQD_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14613
14613
|
setExportStatusMessage("Saving file...");
|
|
14614
14614
|
downloadBlob2(blob, "presentation.gif");
|
|
14615
|
-
setExportProgress(
|
|
14615
|
+
setExportProgress(chunkH5KXQEQD_js.EXPORT_DONE_PERCENT);
|
|
14616
14616
|
} catch (err) {
|
|
14617
|
-
if (!
|
|
14617
|
+
if (!chunkH5KXQEQD_js.isExportAbortError(err)) {
|
|
14618
14618
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
14619
14619
|
}
|
|
14620
14620
|
} finally {
|
|
@@ -14654,7 +14654,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
14654
14654
|
}
|
|
14655
14655
|
printWindow.document.open();
|
|
14656
14656
|
printWindow.document.write(
|
|
14657
|
-
|
|
14657
|
+
chunkH5KXQEQD_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
14658
14658
|
);
|
|
14659
14659
|
printWindow.document.close();
|
|
14660
14660
|
printWindow.focus();
|
|
@@ -14715,7 +14715,7 @@ function usePrintHandlers(input) {
|
|
|
14715
14715
|
if (svgs.length === 0) {
|
|
14716
14716
|
return;
|
|
14717
14717
|
}
|
|
14718
|
-
const printDoc =
|
|
14718
|
+
const printDoc = chunkH5KXQEQD_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
14719
14719
|
title: "Slides (Vector)",
|
|
14720
14720
|
orientation: settings.orientation,
|
|
14721
14721
|
colorFilter
|
|
@@ -14751,7 +14751,7 @@ function usePrintHandlers(input) {
|
|
|
14751
14751
|
if (settings.printWhat === "outline") {
|
|
14752
14752
|
openPrintWindow(
|
|
14753
14753
|
"Outline",
|
|
14754
|
-
`<div class="outline-page">${
|
|
14754
|
+
`<div class="outline-page">${chunkH5KXQEQD_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
14755
14755
|
settings.orientation,
|
|
14756
14756
|
colorFilter,
|
|
14757
14757
|
settings.frameSlides
|
|
@@ -14776,7 +14776,7 @@ function usePrintHandlers(input) {
|
|
|
14776
14776
|
if (settings.printWhat === "slides") {
|
|
14777
14777
|
openPrintWindow(
|
|
14778
14778
|
"Slides",
|
|
14779
|
-
|
|
14779
|
+
chunkH5KXQEQD_js.buildSlidesHtml(slideImages, slideIndices),
|
|
14780
14780
|
settings.orientation,
|
|
14781
14781
|
colorFilter,
|
|
14782
14782
|
settings.frameSlides
|
|
@@ -14786,7 +14786,7 @@ function usePrintHandlers(input) {
|
|
|
14786
14786
|
if (settings.printWhat === "notes") {
|
|
14787
14787
|
openPrintWindow(
|
|
14788
14788
|
"Notes Pages",
|
|
14789
|
-
|
|
14789
|
+
chunkH5KXQEQD_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
14790
14790
|
"portrait",
|
|
14791
14791
|
colorFilter,
|
|
14792
14792
|
settings.frameSlides
|
|
@@ -14797,7 +14797,7 @@ function usePrintHandlers(input) {
|
|
|
14797
14797
|
const spp = settings.slidesPerPage;
|
|
14798
14798
|
openPrintWindow(
|
|
14799
14799
|
`Handout ${spp} per page`,
|
|
14800
|
-
|
|
14800
|
+
chunkH5KXQEQD_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
14801
14801
|
"portrait",
|
|
14802
14802
|
colorFilter,
|
|
14803
14803
|
settings.frameSlides
|
|
@@ -14968,7 +14968,7 @@ function useThemeSwitching(input) {
|
|
|
14968
14968
|
}
|
|
14969
14969
|
try {
|
|
14970
14970
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
14971
|
-
const newData =
|
|
14971
|
+
const newData = chunkOBLHB72P_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
14972
14972
|
onDataChange(newData);
|
|
14973
14973
|
onThemeChanged?.(preset);
|
|
14974
14974
|
} catch (error) {
|
|
@@ -14985,7 +14985,7 @@ function useThemeSwitching(input) {
|
|
|
14985
14985
|
}
|
|
14986
14986
|
try {
|
|
14987
14987
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
14988
|
-
const newData =
|
|
14988
|
+
const newData = chunkOBLHB72P_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
14989
14989
|
onDataChange(newData);
|
|
14990
14990
|
} catch (error) {
|
|
14991
14991
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -14997,10 +14997,10 @@ function useThemeSwitching(input) {
|
|
|
14997
14997
|
if (!data?.theme?.colorScheme) {
|
|
14998
14998
|
return void 0;
|
|
14999
14999
|
}
|
|
15000
|
-
return
|
|
15000
|
+
return chunkOBLHB72P_js.THEME_PRESETS.find((p) => colorSchemesMatch(data.theme?.colorScheme, p.colorScheme));
|
|
15001
15001
|
}, [data?.theme?.colorScheme]);
|
|
15002
15002
|
return {
|
|
15003
|
-
presets:
|
|
15003
|
+
presets: chunkOBLHB72P_js.THEME_PRESETS,
|
|
15004
15004
|
switchToPreset,
|
|
15005
15005
|
switchToCustom,
|
|
15006
15006
|
currentPreset
|
|
@@ -15018,7 +15018,7 @@ function collectUsedFonts(slides) {
|
|
|
15018
15018
|
return Array.from(fonts).sort();
|
|
15019
15019
|
}
|
|
15020
15020
|
function collectFontsFromElement(el, fonts) {
|
|
15021
|
-
if (
|
|
15021
|
+
if (chunkOBLHB72P_js.hasTextProperties(el)) {
|
|
15022
15022
|
if (el.textStyle?.fontFamily) {
|
|
15023
15023
|
fonts.add(el.textStyle.fontFamily);
|
|
15024
15024
|
}
|
|
@@ -15143,7 +15143,7 @@ function usePropertyHandlers(input) {
|
|
|
15143
15143
|
}
|
|
15144
15144
|
try {
|
|
15145
15145
|
const ab = await file.arrayBuffer();
|
|
15146
|
-
const h = new
|
|
15146
|
+
const h = new chunkOBLHB72P_js.PptxHandler();
|
|
15147
15147
|
const other = await h.load(ab);
|
|
15148
15148
|
if (!other) {
|
|
15149
15149
|
return;
|
|
@@ -15153,7 +15153,7 @@ function usePropertyHandlers(input) {
|
|
|
15153
15153
|
width: canvasSize.width,
|
|
15154
15154
|
height: canvasSize.height
|
|
15155
15155
|
};
|
|
15156
|
-
setCompareResult(
|
|
15156
|
+
setCompareResult(chunkH5KXQEQD_js.comparePresentation(cur, other));
|
|
15157
15157
|
setIsComparePanelOpen(true);
|
|
15158
15158
|
} catch (err) {
|
|
15159
15159
|
console.warn("Compare failed:", err);
|
|
@@ -15303,7 +15303,7 @@ function useIsMobile(input) {
|
|
|
15303
15303
|
const containerRef = input?.containerRef;
|
|
15304
15304
|
const isTouchDevice = React3.useSyncExternalStore(
|
|
15305
15305
|
subscribeTouchCapability,
|
|
15306
|
-
|
|
15306
|
+
chunkH5KXQEQD_js.detectTouchDevice,
|
|
15307
15307
|
() => false
|
|
15308
15308
|
// server snapshot
|
|
15309
15309
|
);
|
|
@@ -15319,7 +15319,7 @@ function useIsMobile(input) {
|
|
|
15319
15319
|
}
|
|
15320
15320
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
15321
15321
|
});
|
|
15322
|
-
const [orientation, setOrientation] = React3.useState(
|
|
15322
|
+
const [orientation, setOrientation] = React3.useState(chunkH5KXQEQD_js.detectOrientation);
|
|
15323
15323
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = React3.useState(false);
|
|
15324
15324
|
const [initialViewportHeight] = React3.useState(
|
|
15325
15325
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -15363,7 +15363,7 @@ function useIsMobile(input) {
|
|
|
15363
15363
|
return;
|
|
15364
15364
|
}
|
|
15365
15365
|
const handleOrientationChange = () => {
|
|
15366
|
-
setOrientation(
|
|
15366
|
+
setOrientation(chunkH5KXQEQD_js.detectOrientation());
|
|
15367
15367
|
};
|
|
15368
15368
|
if (screen.orientation) {
|
|
15369
15369
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -15393,9 +15393,9 @@ function useIsMobile(input) {
|
|
|
15393
15393
|
window.addEventListener("resize", handleResize);
|
|
15394
15394
|
return () => window.removeEventListener("resize", handleResize);
|
|
15395
15395
|
}, [isTouchDevice, initialViewportHeight]);
|
|
15396
|
-
const isMobile =
|
|
15397
|
-
const isTablet = !isMobile && containerWidth >=
|
|
15398
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
15396
|
+
const isMobile = chunkH5KXQEQD_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
15397
|
+
const isTablet = !isMobile && containerWidth >= chunkH5KXQEQD_js.MOBILE_BREAKPOINT && containerWidth < chunkH5KXQEQD_js.TABLET_BREAKPOINT;
|
|
15398
|
+
const isDesktop = !isMobile && containerWidth >= chunkH5KXQEQD_js.TABLET_BREAKPOINT;
|
|
15399
15399
|
return {
|
|
15400
15400
|
isMobile,
|
|
15401
15401
|
isTablet,
|
|
@@ -15456,11 +15456,11 @@ function useViewerDialogs(input) {
|
|
|
15456
15456
|
);
|
|
15457
15457
|
const [embedFontsEnabled, setEmbedFontsEnabled] = React3.useState(false);
|
|
15458
15458
|
const [isNarrowViewport, setIsNarrowViewport] = React3.useState(
|
|
15459
|
-
() => typeof window !== "undefined" ?
|
|
15459
|
+
() => typeof window !== "undefined" ? chunkH5KXQEQD_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
15460
15460
|
);
|
|
15461
15461
|
React3.useEffect(() => {
|
|
15462
15462
|
const handleWindow = () => setIsNarrowViewport(
|
|
15463
|
-
|
|
15463
|
+
chunkH5KXQEQD_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
15464
15464
|
);
|
|
15465
15465
|
let observer = null;
|
|
15466
15466
|
let raf = 0;
|
|
@@ -15474,12 +15474,12 @@ function useViewerDialogs(input) {
|
|
|
15474
15474
|
const entry = entries[0];
|
|
15475
15475
|
if (entry) {
|
|
15476
15476
|
setIsNarrowViewport(
|
|
15477
|
-
|
|
15477
|
+
chunkH5KXQEQD_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
15478
15478
|
);
|
|
15479
15479
|
}
|
|
15480
15480
|
});
|
|
15481
15481
|
observer.observe(el);
|
|
15482
|
-
setIsNarrowViewport(
|
|
15482
|
+
setIsNarrowViewport(chunkH5KXQEQD_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
15483
15483
|
};
|
|
15484
15484
|
attach();
|
|
15485
15485
|
window.addEventListener("resize", handleWindow);
|
|
@@ -15914,13 +15914,13 @@ function useSerialize(input) {
|
|
|
15914
15914
|
let processedSlide = slide;
|
|
15915
15915
|
if (pendingEditId) {
|
|
15916
15916
|
const updatedElements = slide.elements.map((el) => {
|
|
15917
|
-
if (el.id !== pendingEditId || !
|
|
15917
|
+
if (el.id !== pendingEditId || !chunkOBLHB72P_js.hasTextProperties(el)) {
|
|
15918
15918
|
return el;
|
|
15919
15919
|
}
|
|
15920
15920
|
return {
|
|
15921
15921
|
...el,
|
|
15922
15922
|
text: pendingEditText,
|
|
15923
|
-
textSegments:
|
|
15923
|
+
textSegments: chunkH5KXQEQD_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
15924
15924
|
};
|
|
15925
15925
|
});
|
|
15926
15926
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -15933,7 +15933,7 @@ function useSerialize(input) {
|
|
|
15933
15933
|
const pptxGuides = guides.map((g) => ({
|
|
15934
15934
|
id: g.id,
|
|
15935
15935
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
15936
|
-
positionEmu:
|
|
15936
|
+
positionEmu: chunkOBLHB72P_js.guidePxToEmu(g.position)
|
|
15937
15937
|
}));
|
|
15938
15938
|
return {
|
|
15939
15939
|
...processedSlide,
|
|
@@ -16313,7 +16313,7 @@ function useEditorOperations(input) {
|
|
|
16313
16313
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
16314
16314
|
React3.useEffect(() => {
|
|
16315
16315
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
16316
|
-
copiedFormatRef.current =
|
|
16316
|
+
copiedFormatRef.current = chunkH5KXQEQD_js.copyFormatFromElement(selectedElement);
|
|
16317
16317
|
} else if (!formatPainterActive) {
|
|
16318
16318
|
copiedFormatRef.current = null;
|
|
16319
16319
|
}
|
|
@@ -16339,12 +16339,12 @@ function useEditorOperations(input) {
|
|
|
16339
16339
|
e.stopPropagation();
|
|
16340
16340
|
const element = elementLookup.get(elementId);
|
|
16341
16341
|
if (element) {
|
|
16342
|
-
const updated =
|
|
16342
|
+
const updated = chunkH5KXQEQD_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
16343
16343
|
const updates = {};
|
|
16344
|
-
if (
|
|
16344
|
+
if (chunkOBLHB72P_js.hasShapeProperties(updated)) {
|
|
16345
16345
|
updates.shapeStyle = updated.shapeStyle;
|
|
16346
16346
|
}
|
|
16347
|
-
if (
|
|
16347
|
+
if (chunkOBLHB72P_js.hasTextProperties(updated)) {
|
|
16348
16348
|
updates.textStyle = updated.textStyle;
|
|
16349
16349
|
}
|
|
16350
16350
|
ops.updateElementById(elementId, updates);
|
|
@@ -16487,7 +16487,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
16487
16487
|
const families = /* @__PURE__ */ new Set();
|
|
16488
16488
|
for (const slide of slides) {
|
|
16489
16489
|
for (const el of slide.elements) {
|
|
16490
|
-
if (
|
|
16490
|
+
if (chunkOBLHB72P_js.hasTextProperties(el) && el.textSegments) {
|
|
16491
16491
|
for (const seg of el.textSegments) {
|
|
16492
16492
|
if (seg.style.fontFamily) {
|
|
16493
16493
|
families.add(seg.style.fontFamily);
|
|
@@ -17285,7 +17285,7 @@ function useYjsProvider({ config }) {
|
|
|
17285
17285
|
syncGraceRef.current = setTimeout(() => {
|
|
17286
17286
|
syncGraceRef.current = null;
|
|
17287
17287
|
setSynced(true);
|
|
17288
|
-
},
|
|
17288
|
+
}, chunkH5KXQEQD_js.INITIAL_SYNC_GRACE_MS);
|
|
17289
17289
|
}, [clearSyncGrace]);
|
|
17290
17290
|
const teardown = React3.useCallback(() => {
|
|
17291
17291
|
if (timeoutRef.current) {
|
|
@@ -17323,7 +17323,7 @@ function useYjsProvider({ config }) {
|
|
|
17323
17323
|
if (config.authToken) {
|
|
17324
17324
|
opts.password = config.authToken;
|
|
17325
17325
|
}
|
|
17326
|
-
const provider = new WebrtcProvider(
|
|
17326
|
+
const provider = new WebrtcProvider(chunkH5KXQEQD_js.validateRoomId(config.roomId), yDoc, opts);
|
|
17327
17327
|
setDoc(yDoc);
|
|
17328
17328
|
setAwareness(provider.awareness);
|
|
17329
17329
|
setClientId(provider.awareness.clientID);
|
|
@@ -17360,12 +17360,12 @@ function useYjsProvider({ config }) {
|
|
|
17360
17360
|
if (!config) {
|
|
17361
17361
|
return;
|
|
17362
17362
|
}
|
|
17363
|
-
const roomId =
|
|
17363
|
+
const roomId = chunkH5KXQEQD_js.validateRoomId(config.roomId);
|
|
17364
17364
|
if (config.transport === "webrtc") {
|
|
17365
17365
|
await initWebrtc();
|
|
17366
17366
|
return;
|
|
17367
17367
|
}
|
|
17368
|
-
if (
|
|
17368
|
+
if (chunkH5KXQEQD_js.isMixedContentBlocked(config.serverUrl)) {
|
|
17369
17369
|
console.warn(
|
|
17370
17370
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
17371
17371
|
);
|
|
@@ -17422,7 +17422,7 @@ function useYjsProvider({ config }) {
|
|
|
17422
17422
|
cleanupRef.current = null;
|
|
17423
17423
|
setStatus("error");
|
|
17424
17424
|
}
|
|
17425
|
-
},
|
|
17425
|
+
}, chunkH5KXQEQD_js.CONNECTION_TIMEOUT_MS);
|
|
17426
17426
|
}
|
|
17427
17427
|
setDoc(yDoc);
|
|
17428
17428
|
setAwareness(provider.awareness);
|
|
@@ -17497,7 +17497,7 @@ function usePresenceTracking({
|
|
|
17497
17497
|
awareness.setLocalStateField("presence", state);
|
|
17498
17498
|
lastBroadcastRef.current = Date.now();
|
|
17499
17499
|
};
|
|
17500
|
-
if (elapsed >=
|
|
17500
|
+
if (elapsed >= chunkH5KXQEQD_js.BROADCAST_THROTTLE_MS) {
|
|
17501
17501
|
if (pendingBroadcastRef.current) {
|
|
17502
17502
|
clearTimeout(pendingBroadcastRef.current);
|
|
17503
17503
|
pendingBroadcastRef.current = null;
|
|
@@ -17507,7 +17507,7 @@ function usePresenceTracking({
|
|
|
17507
17507
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
17508
17508
|
pendingBroadcastRef.current = null;
|
|
17509
17509
|
flush();
|
|
17510
|
-
},
|
|
17510
|
+
}, chunkH5KXQEQD_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
17511
17511
|
}
|
|
17512
17512
|
},
|
|
17513
17513
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -17532,7 +17532,7 @@ function usePresenceTracking({
|
|
|
17532
17532
|
return;
|
|
17533
17533
|
}
|
|
17534
17534
|
const handleChange = () => {
|
|
17535
|
-
const users =
|
|
17535
|
+
const users = chunkH5KXQEQD_js.derivePresenceList(
|
|
17536
17536
|
awareness.getStates(),
|
|
17537
17537
|
localClientId,
|
|
17538
17538
|
canvasWidth,
|
|
@@ -17580,7 +17580,7 @@ function useCollaborativeState({
|
|
|
17580
17580
|
canvasWidth,
|
|
17581
17581
|
canvasHeight
|
|
17582
17582
|
}) {
|
|
17583
|
-
const userColor =
|
|
17583
|
+
const userColor = chunkH5KXQEQD_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
17584
17584
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
17585
17585
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
17586
17586
|
awareness,
|
|
@@ -17683,10 +17683,10 @@ function useYjsDocumentSync({
|
|
|
17683
17683
|
return;
|
|
17684
17684
|
}
|
|
17685
17685
|
try {
|
|
17686
|
-
const { PptxHandler: PptxHandler2 } = await import('./dist-
|
|
17686
|
+
const { PptxHandler: PptxHandler2 } = await import('./dist-MVSQ6PWP.js');
|
|
17687
17687
|
const handler = new PptxHandler2();
|
|
17688
17688
|
await handler.load(sourceBytes.buffer);
|
|
17689
|
-
const currentSlides =
|
|
17689
|
+
const currentSlides = chunkH5KXQEQD_js.readSlidesFromYDoc(
|
|
17690
17690
|
doc
|
|
17691
17691
|
);
|
|
17692
17692
|
const slidesToSave = buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
@@ -17707,11 +17707,11 @@ function useYjsDocumentSync({
|
|
|
17707
17707
|
lastSyncedRef.current = serialized;
|
|
17708
17708
|
void (async () => {
|
|
17709
17709
|
const factories = await getFactories();
|
|
17710
|
-
|
|
17710
|
+
chunkH5KXQEQD_js.reconcileSlidesInYDoc(
|
|
17711
17711
|
slides,
|
|
17712
17712
|
doc,
|
|
17713
17713
|
factories,
|
|
17714
|
-
|
|
17714
|
+
chunkH5KXQEQD_js.LOCAL_SYNC_ORIGIN
|
|
17715
17715
|
);
|
|
17716
17716
|
scheduleWriteBack();
|
|
17717
17717
|
})();
|
|
@@ -17721,10 +17721,10 @@ function useYjsDocumentSync({
|
|
|
17721
17721
|
return;
|
|
17722
17722
|
}
|
|
17723
17723
|
const handleChange = (_events, transaction) => {
|
|
17724
|
-
if (transaction?.origin ===
|
|
17724
|
+
if (transaction?.origin === chunkH5KXQEQD_js.LOCAL_SYNC_ORIGIN) {
|
|
17725
17725
|
return;
|
|
17726
17726
|
}
|
|
17727
|
-
const remoteSlides =
|
|
17727
|
+
const remoteSlides = chunkH5KXQEQD_js.readSlidesFromYDoc(
|
|
17728
17728
|
doc
|
|
17729
17729
|
);
|
|
17730
17730
|
if (remoteSlides.length === 0) {
|
|
@@ -17742,7 +17742,7 @@ function useYjsDocumentSync({
|
|
|
17742
17742
|
});
|
|
17743
17743
|
scheduleWriteBack();
|
|
17744
17744
|
};
|
|
17745
|
-
const unobserve =
|
|
17745
|
+
const unobserve = chunkH5KXQEQD_js.observeYDocSlides(
|
|
17746
17746
|
doc,
|
|
17747
17747
|
handleChange
|
|
17748
17748
|
);
|
|
@@ -17998,7 +17998,7 @@ function useTouchGestures(input) {
|
|
|
17998
17998
|
if (!el || !enabled) {
|
|
17999
17999
|
return;
|
|
18000
18000
|
}
|
|
18001
|
-
const recognizer =
|
|
18001
|
+
const recognizer = chunkH5KXQEQD_js.createTouchGestureRecognizer({
|
|
18002
18002
|
getScale: () => scaleRef.current,
|
|
18003
18003
|
minScale: MIN_ZOOM_SCALE,
|
|
18004
18004
|
maxScale: MAX_ZOOM_SCALE,
|
|
@@ -18041,7 +18041,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
18041
18041
|
return;
|
|
18042
18042
|
}
|
|
18043
18043
|
const rect = active.getBoundingClientRect();
|
|
18044
|
-
const delta =
|
|
18044
|
+
const delta = chunkH5KXQEQD_js.computeScrollDelta(
|
|
18045
18045
|
{ top: rect.top, bottom: rect.bottom },
|
|
18046
18046
|
window.innerHeight,
|
|
18047
18047
|
keyboardInset
|
|
@@ -18061,8 +18061,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18061
18061
|
return;
|
|
18062
18062
|
}
|
|
18063
18063
|
const update = () => {
|
|
18064
|
-
const metrics =
|
|
18065
|
-
const inset = metrics ?
|
|
18064
|
+
const metrics = chunkH5KXQEQD_js.readViewportMetrics(window);
|
|
18065
|
+
const inset = metrics ? chunkH5KXQEQD_js.computeKeyboardInset(metrics) : 0;
|
|
18066
18066
|
setKeyboardInset(inset);
|
|
18067
18067
|
if (inset > 0) {
|
|
18068
18068
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -18073,8 +18073,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18073
18073
|
vv.addEventListener("scroll", update);
|
|
18074
18074
|
const onFocusIn = () => {
|
|
18075
18075
|
window.requestAnimationFrame(() => {
|
|
18076
|
-
const metrics =
|
|
18077
|
-
const inset = metrics ?
|
|
18076
|
+
const metrics = chunkH5KXQEQD_js.readViewportMetrics(window);
|
|
18077
|
+
const inset = metrics ? chunkH5KXQEQD_js.computeKeyboardInset(metrics) : 0;
|
|
18078
18078
|
if (inset > 0) {
|
|
18079
18079
|
scrollFocusedIntoView(inset);
|
|
18080
18080
|
}
|
|
@@ -18087,7 +18087,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18087
18087
|
document.removeEventListener("focusin", onFocusIn);
|
|
18088
18088
|
};
|
|
18089
18089
|
}, [enabled]);
|
|
18090
|
-
return { keyboardInset, isKeyboardOpen:
|
|
18090
|
+
return { keyboardInset, isKeyboardOpen: chunkH5KXQEQD_js.isKeyboardOpen(keyboardInset) };
|
|
18091
18091
|
}
|
|
18092
18092
|
var LEFT_MIN = 120;
|
|
18093
18093
|
var LEFT_MAX = 400;
|