pptx-react-viewer 1.15.0 → 1.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/{Model3DScene-EF72C34A.mjs → Model3DScene-DDKQ372V.mjs} +2 -2
- package/dist/Model3DScene-DDKQ372V.mjs.br +0 -0
- package/dist/Model3DScene-DDKQ372V.mjs.gz +0 -0
- package/dist/{Model3DScene-QIE7QZ7M.js → Model3DScene-UBHBPNJ2.js} +3 -3
- package/dist/{Model3DScene-QIE7QZ7M.js.br → Model3DScene-UBHBPNJ2.js.br} +0 -0
- package/dist/Model3DScene-UBHBPNJ2.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-CBUOCCEN.js → SurfaceChart3DScene-MNFDDCYS.js} +3 -3
- package/dist/SurfaceChart3DScene-MNFDDCYS.js.br +0 -0
- package/dist/SurfaceChart3DScene-MNFDDCYS.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-JYCQ2DBR.mjs → SurfaceChart3DScene-VSUUH2MX.mjs} +2 -2
- package/dist/{SurfaceChart3DScene-JYCQ2DBR.mjs.br → SurfaceChart3DScene-VSUUH2MX.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-VSUUH2MX.mjs.gz +0 -0
- package/dist/{chunk-BZVYWFHS.js → chunk-4LRPKUP7.js} +449 -456
- package/dist/chunk-4LRPKUP7.js.br +0 -0
- package/dist/chunk-4LRPKUP7.js.gz +0 -0
- package/dist/{chunk-QFRXMAFR.mjs → chunk-AJPW5FS7.mjs} +171 -1
- package/dist/chunk-AJPW5FS7.mjs.br +0 -0
- package/dist/chunk-AJPW5FS7.mjs.gz +0 -0
- package/dist/{chunk-FQXZZBFJ.js → chunk-TLGPM7SI.js} +247 -53
- package/dist/chunk-TLGPM7SI.js.br +0 -0
- package/dist/chunk-TLGPM7SI.js.gz +0 -0
- package/dist/{chunk-OBLHB72P.js → chunk-VMQLQEGG.js} +172 -0
- package/dist/chunk-VMQLQEGG.js.br +0 -0
- package/dist/chunk-VMQLQEGG.js.gz +0 -0
- package/dist/{chunk-POP5TS5L.mjs → chunk-XOSQDCHZ.mjs} +35 -42
- package/dist/chunk-XOSQDCHZ.mjs.br +0 -0
- package/dist/chunk-XOSQDCHZ.mjs.gz +0 -0
- package/dist/{chunk-FHOZRWAD.mjs → chunk-YARAQWA4.mjs} +222 -28
- package/dist/chunk-YARAQWA4.mjs.br +0 -0
- package/dist/chunk-YARAQWA4.mjs.gz +0 -0
- package/dist/{chunk-ZDV7QRGB.js → chunk-YQHPV3VP.js} +825 -831
- package/dist/chunk-YQHPV3VP.js.br +0 -0
- package/dist/chunk-YQHPV3VP.js.gz +0 -0
- package/dist/{chunk-X2UMJTCM.mjs → chunk-YW23L4KK.mjs} +7 -13
- package/dist/chunk-YW23L4KK.mjs.br +0 -0
- package/dist/chunk-YW23L4KK.mjs.gz +0 -0
- package/dist/{dist-MVSQ6PWP.js → dist-55M4L5OI.js} +513 -505
- package/dist/dist-55M4L5OI.js.br +0 -0
- package/dist/dist-55M4L5OI.js.gz +0 -0
- package/dist/dist-C5CVVTDM.mjs +2 -0
- package/dist/dist-C5CVVTDM.mjs.br +0 -0
- package/dist/dist-C5CVVTDM.mjs.gz +0 -0
- 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.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/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/package.json +1 -1
- package/dist/Model3DScene-EF72C34A.mjs.br +0 -0
- package/dist/Model3DScene-EF72C34A.mjs.gz +0 -0
- package/dist/Model3DScene-QIE7QZ7M.js.gz +0 -0
- package/dist/SurfaceChart3DScene-CBUOCCEN.js.br +0 -0
- package/dist/SurfaceChart3DScene-CBUOCCEN.js.gz +0 -0
- package/dist/SurfaceChart3DScene-JYCQ2DBR.mjs.gz +0 -0
- package/dist/chunk-BZVYWFHS.js.br +0 -0
- package/dist/chunk-BZVYWFHS.js.gz +0 -0
- package/dist/chunk-FHOZRWAD.mjs.br +0 -0
- package/dist/chunk-FHOZRWAD.mjs.gz +0 -0
- package/dist/chunk-FQXZZBFJ.js.br +0 -0
- package/dist/chunk-FQXZZBFJ.js.gz +0 -0
- package/dist/chunk-OBLHB72P.js.br +0 -0
- package/dist/chunk-OBLHB72P.js.gz +0 -0
- package/dist/chunk-POP5TS5L.mjs.br +0 -0
- package/dist/chunk-POP5TS5L.mjs.gz +0 -0
- package/dist/chunk-QFRXMAFR.mjs.br +0 -0
- package/dist/chunk-QFRXMAFR.mjs.gz +0 -0
- package/dist/chunk-X2UMJTCM.mjs.br +0 -0
- package/dist/chunk-X2UMJTCM.mjs.gz +0 -0
- package/dist/chunk-ZDV7QRGB.js.br +0 -0
- package/dist/chunk-ZDV7QRGB.js.gz +0 -0
- package/dist/dist-D5LQ7PW7.mjs +0 -2
- package/dist/dist-D5LQ7PW7.mjs.br +0 -0
- package/dist/dist-D5LQ7PW7.mjs.gz +0 -0
- package/dist/dist-MVSQ6PWP.js.br +0 -0
- package/dist/dist-MVSQ6PWP.js.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkTLGPM7SI_js = require('./chunk-TLGPM7SI.js');
|
|
4
4
|
var chunkWGLJ32FW_js = require('./chunk-WGLJ32FW.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkVMQLQEGG_js = require('./chunk-VMQLQEGG.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 chunkTLGPM7SI_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(chunkTLGPM7SI_js.cloneSlide),
|
|
72
|
+
templateElementsBySlideId: chunkTLGPM7SI_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(chunkTLGPM7SI_js.cloneSlide));
|
|
86
86
|
setTemplateElementsBySlideId(
|
|
87
|
-
|
|
87
|
+
chunkTLGPM7SI_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
88
88
|
);
|
|
89
89
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
90
90
|
setSelectedElementIds([]);
|
|
@@ -347,7 +347,7 @@ var GLYPH_COMPONENTS = {
|
|
|
347
347
|
plus: lu.LuPlus,
|
|
348
348
|
triangle: lu.LuTriangle
|
|
349
349
|
};
|
|
350
|
-
var SHAPE_PRESETS =
|
|
350
|
+
var SHAPE_PRESETS = chunkTLGPM7SI_js.SHAPE_PRESET_DEFS.map(
|
|
351
351
|
(def) => ({
|
|
352
352
|
type: def.type,
|
|
353
353
|
label: def.label,
|
|
@@ -687,20 +687,20 @@ function useAnimationPlayback(input) {
|
|
|
687
687
|
for (const anim of nativeAnims) {
|
|
688
688
|
if (anim.buildType && anim.buildType !== "allAtOnce" && anim.targetId) {
|
|
689
689
|
const el = slide.elements.find((e) => e.id === anim.targetId);
|
|
690
|
-
if (el &&
|
|
691
|
-
segmentCounts.set(anim.targetId,
|
|
690
|
+
if (el && chunkVMQLQEGG_js.hasTextProperties(el) && el.textSegments && el.textSegments.length > 0) {
|
|
691
|
+
segmentCounts.set(anim.targetId, chunkTLGPM7SI_js.countTextSegments(el.textSegments));
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
|
-
const expandedAnims = segmentCounts.size > 0 ?
|
|
696
|
-
const engine =
|
|
695
|
+
const expandedAnims = segmentCounts.size > 0 ? chunkTLGPM7SI_js.expandTextBuildAnimations(nativeAnims, segmentCounts) : nativeAnims;
|
|
696
|
+
const engine = chunkTLGPM7SI_js.TimelineEngine.fromAnimations(expandedAnims);
|
|
697
697
|
timelineEngineRef.current = engine;
|
|
698
698
|
setPresentationKeyframesCss(engine.getTimeline().keyframesCss);
|
|
699
699
|
setInteractiveTriggerShapeIds(engine.getInteractiveTriggerShapeIds());
|
|
700
700
|
setHoverTriggerShapeIds(engine.getHoverTriggerShapeIds());
|
|
701
701
|
const allIds = slide.elements.map((element) => element.id);
|
|
702
702
|
for (const anim of expandedAnims) {
|
|
703
|
-
if (anim.targetId && anim.targetId.includes(
|
|
703
|
+
if (anim.targetId && anim.targetId.includes(chunkTLGPM7SI_js.TEXT_BUILD_ID_SEP)) {
|
|
704
704
|
allIds.push(anim.targetId);
|
|
705
705
|
}
|
|
706
706
|
}
|
|
@@ -967,7 +967,7 @@ var AUDIENCE_HASH = "#pptx-audience";
|
|
|
967
967
|
var PRESENTER_MSG_ORIGIN = "pptx-viewer-presenter";
|
|
968
968
|
var AUDIENCE_NONCE_KEY = "nonce";
|
|
969
969
|
function generateSessionId() {
|
|
970
|
-
return
|
|
970
|
+
return chunkTLGPM7SI_js.secureRandomUuid();
|
|
971
971
|
}
|
|
972
972
|
function parseAudienceNonce() {
|
|
973
973
|
const hash = window.location.hash;
|
|
@@ -1435,7 +1435,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1435
1435
|
return;
|
|
1436
1436
|
}
|
|
1437
1437
|
if (action.url && !actionStr.includes("hlinksldjump")) {
|
|
1438
|
-
if (
|
|
1438
|
+
if (chunkTLGPM7SI_js.isUrlSafe(action.url)) {
|
|
1439
1439
|
window.open(action.url, "_blank", "noopener,noreferrer");
|
|
1440
1440
|
}
|
|
1441
1441
|
}
|
|
@@ -1445,7 +1445,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1445
1445
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1446
1446
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1447
1447
|
const transition = incomingSlide?.transition;
|
|
1448
|
-
const durationMs = deps.playTransition ?
|
|
1448
|
+
const durationMs = deps.playTransition ? chunkTLGPM7SI_js.resolveTransitionDurationMs(transition) : 0;
|
|
1449
1449
|
deps.clearPresentationTimers();
|
|
1450
1450
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1451
1451
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -2175,7 +2175,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2175
2175
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2176
2176
|
slides.forEach((slide, slideIndex) => {
|
|
2177
2177
|
for (const element of slide.elements || []) {
|
|
2178
|
-
if (!
|
|
2178
|
+
if (!chunkVMQLQEGG_js.hasTextProperties(element)) {
|
|
2179
2179
|
continue;
|
|
2180
2180
|
}
|
|
2181
2181
|
const segments = element.textSegments ?? [];
|
|
@@ -2226,7 +2226,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2226
2226
|
continue;
|
|
2227
2227
|
}
|
|
2228
2228
|
const element = slide.elements[elIdx];
|
|
2229
|
-
if (!
|
|
2229
|
+
if (!chunkVMQLQEGG_js.hasTextProperties(element)) {
|
|
2230
2230
|
continue;
|
|
2231
2231
|
}
|
|
2232
2232
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3151,12 +3151,12 @@ function useViewerState(input) {
|
|
|
3151
3151
|
function partitionTemplateElements(slides) {
|
|
3152
3152
|
const templateElementsBySlideId = {};
|
|
3153
3153
|
const nextSlides = slides.map((slide) => {
|
|
3154
|
-
const template = slide.elements.filter((el) =>
|
|
3154
|
+
const template = slide.elements.filter((el) => chunkTLGPM7SI_js.isTemplateElement(el));
|
|
3155
3155
|
if (template.length === 0) {
|
|
3156
3156
|
return slide;
|
|
3157
3157
|
}
|
|
3158
3158
|
templateElementsBySlideId[slide.id] = template;
|
|
3159
|
-
return { ...slide, elements: slide.elements.filter((el) => !
|
|
3159
|
+
return { ...slide, elements: slide.elements.filter((el) => !chunkTLGPM7SI_js.isTemplateElement(el)) };
|
|
3160
3160
|
});
|
|
3161
3161
|
return { slides: nextSlides, templateElementsBySlideId };
|
|
3162
3162
|
}
|
|
@@ -3229,7 +3229,7 @@ function useLoadContent({
|
|
|
3229
3229
|
);
|
|
3230
3230
|
}
|
|
3231
3231
|
const previousHandler = handlerRef.current;
|
|
3232
|
-
const handler = new
|
|
3232
|
+
const handler = new chunkVMQLQEGG_js.PptxHandler();
|
|
3233
3233
|
const parsed = await handler.load(buffer);
|
|
3234
3234
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3235
3235
|
handler.dispose();
|
|
@@ -3241,7 +3241,7 @@ function useLoadContent({
|
|
|
3241
3241
|
handlerRef.current = null;
|
|
3242
3242
|
const mediaElements = [];
|
|
3243
3243
|
for (const slide of parsed.slides) {
|
|
3244
|
-
|
|
3244
|
+
chunkTLGPM7SI_js.collectMediaElements(slide.elements, mediaElements);
|
|
3245
3245
|
}
|
|
3246
3246
|
for (const url of mediaDataUrls.values()) {
|
|
3247
3247
|
if (url.startsWith("blob:")) {
|
|
@@ -3282,7 +3282,7 @@ function useLoadContent({
|
|
|
3282
3282
|
}
|
|
3283
3283
|
})
|
|
3284
3284
|
);
|
|
3285
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3285
|
+
const { paths: imagePaths, refs: imageRefs } = chunkTLGPM7SI_js.collectImagePaths(parsed.slides);
|
|
3286
3286
|
let nextSlides = parsed.slides;
|
|
3287
3287
|
if (imagePaths.size > 0) {
|
|
3288
3288
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3371,14 +3371,14 @@ function useLoadContent({
|
|
|
3371
3371
|
setHasMacros(parsed.hasMacros === true);
|
|
3372
3372
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3373
3373
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3374
|
-
setGuides(
|
|
3374
|
+
setGuides(chunkTLGPM7SI_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3375
3375
|
setActiveSlideIndex(0);
|
|
3376
3376
|
clearSelection();
|
|
3377
3377
|
setIsDirty(false);
|
|
3378
3378
|
history.resetHistory();
|
|
3379
3379
|
} catch (err) {
|
|
3380
3380
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3381
|
-
if (err instanceof
|
|
3381
|
+
if (err instanceof chunkVMQLQEGG_js.EncryptedFileError) {
|
|
3382
3382
|
setIsEncrypted(true);
|
|
3383
3383
|
} else {
|
|
3384
3384
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3455,7 +3455,7 @@ function useAutosave(input) {
|
|
|
3455
3455
|
isSavingRef.current = false;
|
|
3456
3456
|
return;
|
|
3457
3457
|
}
|
|
3458
|
-
await
|
|
3458
|
+
await chunkTLGPM7SI_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
3459
3459
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
3460
3460
|
} catch (err) {
|
|
3461
3461
|
setAutosaveStatus({
|
|
@@ -3493,7 +3493,7 @@ function useAutosave(input) {
|
|
|
3493
3493
|
|
|
3494
3494
|
// src/viewer/utils/animation-effects.ts
|
|
3495
3495
|
function getAnimationInitialStyle2(preset, nativeAnimation) {
|
|
3496
|
-
return
|
|
3496
|
+
return chunkTLGPM7SI_js.getAnimationInitialStyle(preset, nativeAnimation);
|
|
3497
3497
|
}
|
|
3498
3498
|
function cn(...inputs) {
|
|
3499
3499
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
@@ -3501,7 +3501,7 @@ function cn(...inputs) {
|
|
|
3501
3501
|
|
|
3502
3502
|
// src/viewer/utils/text-utils.tsx
|
|
3503
3503
|
function getTextStyleForElement(element, fallbackColor) {
|
|
3504
|
-
if (!
|
|
3504
|
+
if (!chunkVMQLQEGG_js.hasTextProperties(element)) {
|
|
3505
3505
|
return { color: fallbackColor };
|
|
3506
3506
|
}
|
|
3507
3507
|
const textDecorationTokens = [];
|
|
@@ -3515,20 +3515,20 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3515
3515
|
const textDecorationStyle = isDoubleStrike ? "double" : void 0;
|
|
3516
3516
|
const hasItalicRuns = element.textStyle?.italic || Boolean(element.textSegments?.some((segment) => segment.style?.italic));
|
|
3517
3517
|
const isRtl = element.textStyle?.rtl === true;
|
|
3518
|
-
const resolvedTextColor = element.textStyle?.hyperlink ?
|
|
3518
|
+
const resolvedTextColor = element.textStyle?.hyperlink ? chunkTLGPM7SI_js.normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : chunkTLGPM7SI_js.normalizeHexColor(element.textStyle?.color, fallbackColor);
|
|
3519
3519
|
const bodyTop = element.textStyle?.bodyInsetTop ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3520
3520
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3521
3521
|
const bodyLeft = element.textStyle?.bodyInsetLeft ?? DEFAULT_BODY_INSET_LR_PX;
|
|
3522
3522
|
const bodyRight = element.textStyle?.bodyInsetRight ?? DEFAULT_BODY_INSET_LR_PX;
|
|
3523
|
-
const writingMode =
|
|
3524
|
-
const textOrientation =
|
|
3525
|
-
const verticalDirection =
|
|
3523
|
+
const writingMode = chunkTLGPM7SI_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
3524
|
+
const textOrientation = chunkTLGPM7SI_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
3525
|
+
const verticalDirection = chunkTLGPM7SI_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
3526
3526
|
const resolvedDirection = verticalDirection || (isRtl ? "rtl" : "ltr");
|
|
3527
3527
|
const resolvedUnicodeBidi = isRtl ? "plaintext" : void 0;
|
|
3528
3528
|
const hasSegments = (element.textSegments?.length ?? 0) > 0;
|
|
3529
3529
|
return {
|
|
3530
3530
|
color: resolvedTextColor,
|
|
3531
|
-
backgroundColor: !hasSegments && element.textStyle?.highlightColor ?
|
|
3531
|
+
backgroundColor: !hasSegments && element.textStyle?.highlightColor ? chunkTLGPM7SI_js.normalizeHexColor(element.textStyle.highlightColor, void 0) : void 0,
|
|
3532
3532
|
textAlign: (() => {
|
|
3533
3533
|
const a = element.textStyle?.align;
|
|
3534
3534
|
if (a === "justLow" || a === "dist" || a === "thaiDist") {
|
|
@@ -3544,7 +3544,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3544
3544
|
textDecorationLine: textDecorationTokens.length > 0 ? textDecorationTokens.join(" ") : "none",
|
|
3545
3545
|
textDecorationStyle,
|
|
3546
3546
|
fontFamily: element.textStyle?.fontFamily || DEFAULT_FONT_FAMILY,
|
|
3547
|
-
lineHeight:
|
|
3547
|
+
lineHeight: chunkTLGPM7SI_js.resolveLineHeight(element.textStyle, hasItalicRuns),
|
|
3548
3548
|
paddingTop: bodyTop + (hasItalicRuns ? 1 : 0),
|
|
3549
3549
|
paddingBottom: bodyBottom + (hasItalicRuns ? 1 : 0),
|
|
3550
3550
|
paddingLeft: bodyLeft + (element.textStyle?.paragraphMarginLeft || 0),
|
|
@@ -3557,7 +3557,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3557
3557
|
// Auto-fit: use OOXML-provided fontScale/lnSpcReduction when available,
|
|
3558
3558
|
// otherwise fall back to heuristic estimation. The pure font-scale maths
|
|
3559
3559
|
// now lives in pptx-viewer-shared (computeAutoFitTextStyle).
|
|
3560
|
-
...
|
|
3560
|
+
...chunkTLGPM7SI_js.computeAutoFitTextStyle({
|
|
3561
3561
|
textStyle: element.textStyle,
|
|
3562
3562
|
text: element.text ?? "",
|
|
3563
3563
|
width: element.width,
|
|
@@ -3590,13 +3590,13 @@ function computeTabSize(tabStops) {
|
|
|
3590
3590
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : void 0;
|
|
3591
3591
|
}
|
|
3592
3592
|
function getTextLayoutStyle(element) {
|
|
3593
|
-
if (!
|
|
3593
|
+
if (!chunkVMQLQEGG_js.hasTextProperties(element)) {
|
|
3594
3594
|
return {};
|
|
3595
3595
|
}
|
|
3596
3596
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
3597
|
-
const writingMode =
|
|
3598
|
-
const textOrientation =
|
|
3599
|
-
const verticalDirection =
|
|
3597
|
+
const writingMode = chunkTLGPM7SI_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
3598
|
+
const textOrientation = chunkTLGPM7SI_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
3599
|
+
const verticalDirection = chunkTLGPM7SI_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
3600
3600
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
3601
3601
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
3602
3602
|
const hasColumns = columnCount > 1;
|
|
@@ -3604,7 +3604,7 @@ function getTextLayoutStyle(element) {
|
|
|
3604
3604
|
const tabStops = element.textStyle?.tabStops;
|
|
3605
3605
|
const tabSize = computeTabSize(tabStops);
|
|
3606
3606
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
3607
|
-
const hasParagraphIndents =
|
|
3607
|
+
const hasParagraphIndents = chunkVMQLQEGG_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
3608
3608
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
3609
3609
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
3610
3610
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -3613,7 +3613,7 @@ function getTextLayoutStyle(element) {
|
|
|
3613
3613
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3614
3614
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
3615
3615
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
3616
|
-
const kinsokuStyles =
|
|
3616
|
+
const kinsokuStyles = chunkTLGPM7SI_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
3617
3617
|
if (hasColumns) {
|
|
3618
3618
|
return {
|
|
3619
3619
|
display: "block",
|
|
@@ -3656,10 +3656,10 @@ function getTextLayoutStyle(element) {
|
|
|
3656
3656
|
|
|
3657
3657
|
// src/viewer/utils/text-effects.tsx
|
|
3658
3658
|
function buildTextFillCss2(style) {
|
|
3659
|
-
return
|
|
3659
|
+
return chunkTLGPM7SI_js.buildTextFillCss(style);
|
|
3660
3660
|
}
|
|
3661
3661
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
3662
|
-
return
|
|
3662
|
+
return chunkTLGPM7SI_js.buildTextBody3DSceneStyle(textStyle);
|
|
3663
3663
|
}
|
|
3664
3664
|
|
|
3665
3665
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -3844,17 +3844,17 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
3844
3844
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
3845
3845
|
return renderedSegments;
|
|
3846
3846
|
}
|
|
3847
|
-
const paraKey = `${elementId}${
|
|
3847
|
+
const paraKey = `${elementId}${chunkTLGPM7SI_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
3848
3848
|
const paraState = subElementAnimStates.get(paraKey);
|
|
3849
3849
|
if (paraState) {
|
|
3850
3850
|
const style = buildAnimStyle(paraState);
|
|
3851
3851
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
3852
3852
|
}
|
|
3853
|
-
const firstWordKey = `${elementId}${
|
|
3853
|
+
const firstWordKey = `${elementId}${chunkTLGPM7SI_js.TEXT_BUILD_ID_SEP}w${paraIndex}-0`;
|
|
3854
3854
|
if (subElementAnimStates.has(firstWordKey)) {
|
|
3855
3855
|
return wrapByWord(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
3856
3856
|
}
|
|
3857
|
-
const firstCharKey = `${elementId}${
|
|
3857
|
+
const firstCharKey = `${elementId}${chunkTLGPM7SI_js.TEXT_BUILD_ID_SEP}c${paraIndex}-0`;
|
|
3858
3858
|
if (subElementAnimStates.has(firstCharKey)) {
|
|
3859
3859
|
return wrapByChar(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
3860
3860
|
}
|
|
@@ -3875,7 +3875,7 @@ function wrapByWord(elementId, paraIndex, paraSegments, states) {
|
|
|
3875
3875
|
nodes.push(/* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Fragment, { children: w }, `ws-${i}`));
|
|
3876
3876
|
continue;
|
|
3877
3877
|
}
|
|
3878
|
-
const key = `${elementId}${
|
|
3878
|
+
const key = `${elementId}${chunkTLGPM7SI_js.TEXT_BUILD_ID_SEP}w${paraIndex}-${wordIdx}`;
|
|
3879
3879
|
const state = states.get(key);
|
|
3880
3880
|
const style = buildAnimStyle(state);
|
|
3881
3881
|
nodes.push(
|
|
@@ -3889,7 +3889,7 @@ function wrapByChar(elementId, paraIndex, paraSegments, states) {
|
|
|
3889
3889
|
const fullText = paraSegments.map((e) => e.segment.text).join("");
|
|
3890
3890
|
const nodes = [];
|
|
3891
3891
|
for (let i = 0; i < fullText.length; i++) {
|
|
3892
|
-
const key = `${elementId}${
|
|
3892
|
+
const key = `${elementId}${chunkTLGPM7SI_js.TEXT_BUILD_ID_SEP}c${paraIndex}-${i}`;
|
|
3893
3893
|
const state = states.get(key);
|
|
3894
3894
|
const style = buildAnimStyle(state);
|
|
3895
3895
|
nodes.push(
|
|
@@ -3902,10 +3902,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
3902
3902
|
if (!needsScriptFonts || !text) {
|
|
3903
3903
|
return text;
|
|
3904
3904
|
}
|
|
3905
|
-
const runs =
|
|
3905
|
+
const runs = chunkTLGPM7SI_js.segmentByScript(text);
|
|
3906
3906
|
if (runs.length <= 1) {
|
|
3907
3907
|
if (runs.length === 1) {
|
|
3908
|
-
const font =
|
|
3908
|
+
const font = chunkTLGPM7SI_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
3909
3909
|
if (font && font !== baseFontFamily) {
|
|
3910
3910
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
3911
3911
|
}
|
|
@@ -3913,7 +3913,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
3913
3913
|
return text;
|
|
3914
3914
|
}
|
|
3915
3915
|
return runs.map((run, i) => {
|
|
3916
|
-
const font =
|
|
3916
|
+
const font = chunkTLGPM7SI_js.resolveFontForScript(run.script, scriptFonts);
|
|
3917
3917
|
if (!font || font === baseFontFamily) {
|
|
3918
3918
|
return /* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
3919
3919
|
}
|
|
@@ -3987,8 +3987,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
3987
3987
|
);
|
|
3988
3988
|
}
|
|
3989
3989
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
3990
|
-
const mathml =
|
|
3991
|
-
const safeMathml = mathml ?
|
|
3990
|
+
const mathml = chunkTLGPM7SI_js.convertOmmlToMathMl(equationXml);
|
|
3991
|
+
const safeMathml = mathml ? chunkTLGPM7SI_js.sanitizeMathMl(mathml) : "";
|
|
3992
3992
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3993
3993
|
"span",
|
|
3994
3994
|
{
|
|
@@ -4084,7 +4084,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4084
4084
|
);
|
|
4085
4085
|
}
|
|
4086
4086
|
const segmentStyle = segment.style || {};
|
|
4087
|
-
const textValue =
|
|
4087
|
+
const textValue = chunkTLGPM7SI_js.substituteFieldText(segment.text || "", segment.fieldType, fieldContext);
|
|
4088
4088
|
const lines = textValue.split("\n");
|
|
4089
4089
|
const textDecorationTokens = [];
|
|
4090
4090
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -4094,8 +4094,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4094
4094
|
textDecorationTokens.push("line-through");
|
|
4095
4095
|
}
|
|
4096
4096
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
4097
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
4098
|
-
const underlineDecoration =
|
|
4097
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkTLGPM7SI_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkTLGPM7SI_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
4098
|
+
const underlineDecoration = chunkTLGPM7SI_js.resolveUnderlineDecorationStyle(
|
|
4099
4099
|
Boolean(isDoubleStrike),
|
|
4100
4100
|
segmentStyle.underlineStyle
|
|
4101
4101
|
);
|
|
@@ -4108,14 +4108,14 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4108
4108
|
const autoFitScale = element.textStyle?.autoFitFontScale !== void 0 && element.textStyle.autoFitFontScale > 0 && element.textStyle.autoFitFontScale < 1 ? element.textStyle.autoFitFontScale : 1;
|
|
4109
4109
|
const baseFontSize = rawFontSize * autoFitScale;
|
|
4110
4110
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
4111
|
-
const baseFontFamily = rawFontFamily ?
|
|
4111
|
+
const baseFontFamily = rawFontFamily ? chunkVMQLQEGG_js.getSubstituteFontFamily(rawFontFamily) : DEFAULT_FONT_FAMILY;
|
|
4112
4112
|
const scriptFonts = {
|
|
4113
4113
|
latin: baseFontFamily,
|
|
4114
4114
|
eastAsia: segmentStyle.eastAsiaFont || element.textStyle?.eastAsiaFont || baseFontFamily,
|
|
4115
4115
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
4116
4116
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
4117
4117
|
};
|
|
4118
|
-
const needsScriptFonts =
|
|
4118
|
+
const needsScriptFonts = chunkTLGPM7SI_js.hasDistinctScriptFonts(scriptFonts);
|
|
4119
4119
|
const spanStyle = {
|
|
4120
4120
|
color: resolvedSegmentColor,
|
|
4121
4121
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -4129,15 +4129,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4129
4129
|
verticalAlign: baselineShift,
|
|
4130
4130
|
letterSpacing,
|
|
4131
4131
|
fontKerning,
|
|
4132
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
4132
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkTLGPM7SI_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
4133
4133
|
...textFillStyles,
|
|
4134
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
4135
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
4134
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkTLGPM7SI_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
4135
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkTLGPM7SI_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
4136
4136
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
4137
|
-
textShadow:
|
|
4138
|
-
filter:
|
|
4139
|
-
opacity:
|
|
4140
|
-
WebkitBoxReflect:
|
|
4137
|
+
textShadow: chunkTLGPM7SI_js.buildTextShadowCss(segmentStyle),
|
|
4138
|
+
filter: chunkTLGPM7SI_js.buildTextRunFilterChain(segmentStyle),
|
|
4139
|
+
opacity: chunkTLGPM7SI_js.getTextAlphaOpacity(segmentStyle),
|
|
4140
|
+
WebkitBoxReflect: chunkTLGPM7SI_js.buildTextReflectionCss(segmentStyle)
|
|
4141
4141
|
};
|
|
4142
4142
|
const runRtl = segmentStyle.rtl;
|
|
4143
4143
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -4157,7 +4157,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4157
4157
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
4158
4158
|
}
|
|
4159
4159
|
if (bulletInfo.color) {
|
|
4160
|
-
spanStyle.color =
|
|
4160
|
+
spanStyle.color = chunkTLGPM7SI_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
4161
4161
|
}
|
|
4162
4162
|
}
|
|
4163
4163
|
if (bulletInfo?.imageDataUrl || bulletInfo?.imageRelId) {
|
|
@@ -4189,7 +4189,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4189
4189
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
4190
4190
|
};
|
|
4191
4191
|
if (segment.rubyStyle?.color) {
|
|
4192
|
-
rubyStyle.color =
|
|
4192
|
+
rubyStyle.color = chunkTLGPM7SI_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
4193
4193
|
}
|
|
4194
4194
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
4195
4195
|
baseContent,
|
|
@@ -4259,7 +4259,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
4259
4259
|
return paragraphs;
|
|
4260
4260
|
}
|
|
4261
4261
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
4262
|
-
if (!
|
|
4262
|
+
if (!chunkVMQLQEGG_js.hasTextProperties(element)) {
|
|
4263
4263
|
return emptyFallback || null;
|
|
4264
4264
|
}
|
|
4265
4265
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -4280,9 +4280,9 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
4280
4280
|
return element.text || emptyFallback || "";
|
|
4281
4281
|
}
|
|
4282
4282
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
4283
|
-
const paragraphIndents =
|
|
4284
|
-
const elementRtl =
|
|
4285
|
-
const elementAlign =
|
|
4283
|
+
const paragraphIndents = chunkVMQLQEGG_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
4284
|
+
const elementRtl = chunkVMQLQEGG_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
4285
|
+
const elementAlign = chunkVMQLQEGG_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
4286
4286
|
return paragraphs.map((paraSegments, paraIndex) => {
|
|
4287
4287
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
4288
4288
|
const rawMarginLeft = typeof paraIndent?.marginLeft === "number" && paraIndent.marginLeft !== 0 ? paraIndent.marginLeft : void 0;
|
|
@@ -4296,14 +4296,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
4296
4296
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
4297
4297
|
});
|
|
4298
4298
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
4299
|
-
const paraRtl =
|
|
4299
|
+
const paraRtl = chunkTLGPM7SI_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
4300
4300
|
const isRtlParagraph = paraRtl === true;
|
|
4301
|
-
const paraAlign =
|
|
4302
|
-
const cssTextAlign =
|
|
4301
|
+
const paraAlign = chunkTLGPM7SI_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
4302
|
+
const cssTextAlign = chunkTLGPM7SI_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
4303
4303
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
4304
4304
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
4305
4305
|
const paraTextIndent = rawTextIndent;
|
|
4306
|
-
const paraKinsokuStyle =
|
|
4306
|
+
const paraKinsokuStyle = chunkTLGPM7SI_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
4307
4307
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
4308
4308
|
const paraStyle = {
|
|
4309
4309
|
...paraKinsokuStyle
|
|
@@ -4468,7 +4468,7 @@ function isConnectorOrLineElement(element) {
|
|
|
4468
4468
|
if (element.type === "connector") {
|
|
4469
4469
|
return true;
|
|
4470
4470
|
}
|
|
4471
|
-
if (!
|
|
4471
|
+
if (!chunkVMQLQEGG_js.hasShapeProperties(element)) {
|
|
4472
4472
|
return false;
|
|
4473
4473
|
}
|
|
4474
4474
|
const st = getShapeType(element.shapeType);
|
|
@@ -4533,13 +4533,13 @@ function renderDuotoneSvgFilter(elementId, color1, color2) {
|
|
|
4533
4533
|
);
|
|
4534
4534
|
}
|
|
4535
4535
|
function getDuotoneColors(element) {
|
|
4536
|
-
if (!
|
|
4536
|
+
if (!chunkVMQLQEGG_js.isImageLikeElement(element)) {
|
|
4537
4537
|
return void 0;
|
|
4538
4538
|
}
|
|
4539
4539
|
return element.imageEffects?.duotone;
|
|
4540
4540
|
}
|
|
4541
4541
|
function buildLineShadowCss(element) {
|
|
4542
|
-
if (!
|
|
4542
|
+
if (!chunkVMQLQEGG_js.hasShapeProperties(element)) {
|
|
4543
4543
|
return void 0;
|
|
4544
4544
|
}
|
|
4545
4545
|
const ss = element.shapeStyle;
|
|
@@ -4550,13 +4550,13 @@ function buildLineShadowCss(element) {
|
|
|
4550
4550
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
4551
4551
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
4552
4552
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
4553
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
4554
|
-
|
|
4553
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkTLGPM7SI_js.colorWithOpacity(
|
|
4554
|
+
chunkTLGPM7SI_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
4555
4555
|
opacity
|
|
4556
4556
|
)}`;
|
|
4557
4557
|
}
|
|
4558
4558
|
function buildLineGlowFilter(element) {
|
|
4559
|
-
if (!
|
|
4559
|
+
if (!chunkVMQLQEGG_js.hasShapeProperties(element)) {
|
|
4560
4560
|
return void 0;
|
|
4561
4561
|
}
|
|
4562
4562
|
const ss = element.shapeStyle;
|
|
@@ -4565,7 +4565,7 @@ function buildLineGlowFilter(element) {
|
|
|
4565
4565
|
}
|
|
4566
4566
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
4567
4567
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
4568
|
-
const glowCol =
|
|
4568
|
+
const glowCol = chunkTLGPM7SI_js.colorWithOpacity(chunkTLGPM7SI_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
4569
4569
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
4570
4570
|
}
|
|
4571
4571
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -4589,7 +4589,7 @@ function getImageAlphaFilterId(elementId) {
|
|
|
4589
4589
|
return `imgalpha-${elementId}`;
|
|
4590
4590
|
}
|
|
4591
4591
|
function hasAdvancedImageAlphaEffects(element) {
|
|
4592
|
-
if (!
|
|
4592
|
+
if (!chunkVMQLQEGG_js.isImageLikeElement(element)) {
|
|
4593
4593
|
return false;
|
|
4594
4594
|
}
|
|
4595
4595
|
const e = element.imageEffects;
|
|
@@ -4601,7 +4601,7 @@ function hasAdvancedImageAlphaEffects(element) {
|
|
|
4601
4601
|
);
|
|
4602
4602
|
}
|
|
4603
4603
|
function renderImageAlphaSvgFilter(element) {
|
|
4604
|
-
if (!
|
|
4604
|
+
if (!chunkVMQLQEGG_js.isImageLikeElement(element)) {
|
|
4605
4605
|
return null;
|
|
4606
4606
|
}
|
|
4607
4607
|
const e = element.imageEffects;
|
|
@@ -4711,7 +4711,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
4711
4711
|
return `dag-duotone-${elementId}`;
|
|
4712
4712
|
}
|
|
4713
4713
|
function hasDagDuotoneEffect(element) {
|
|
4714
|
-
if (!
|
|
4714
|
+
if (!chunkVMQLQEGG_js.hasShapeProperties(element)) {
|
|
4715
4715
|
return false;
|
|
4716
4716
|
}
|
|
4717
4717
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -4774,7 +4774,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
4774
4774
|
|
|
4775
4775
|
// src/viewer/utils/shape-visual-3d.ts
|
|
4776
4776
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
4777
|
-
return
|
|
4777
|
+
return chunkTLGPM7SI_js.build3DExtrusionData(
|
|
4778
4778
|
shape3d,
|
|
4779
4779
|
scene3d,
|
|
4780
4780
|
fillColor,
|
|
@@ -4783,27 +4783,27 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
4783
4783
|
);
|
|
4784
4784
|
}
|
|
4785
4785
|
function apply3dEffects2(base, scene3d, shape3d) {
|
|
4786
|
-
|
|
4786
|
+
chunkTLGPM7SI_js.apply3dEffects(base, scene3d, shape3d);
|
|
4787
4787
|
}
|
|
4788
4788
|
|
|
4789
4789
|
// src/viewer/utils/shape-visual-style.ts
|
|
4790
4790
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor) {
|
|
4791
|
-
if (!
|
|
4791
|
+
if (!chunkVMQLQEGG_js.hasShapeProperties(element)) {
|
|
4792
4792
|
return {};
|
|
4793
4793
|
}
|
|
4794
4794
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
4795
|
-
const clipPath =
|
|
4795
|
+
const clipPath = chunkTLGPM7SI_js.getResolvedShapeClipPath(element);
|
|
4796
4796
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
4797
4797
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
4798
|
-
const strokeDash =
|
|
4799
|
-
const fillGradient =
|
|
4800
|
-
const shadowCss =
|
|
4801
|
-
const innerShadowCss =
|
|
4802
|
-
const resolvedFillColor =
|
|
4803
|
-
const resolvedStrokeColor =
|
|
4798
|
+
const strokeDash = chunkTLGPM7SI_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
4799
|
+
const fillGradient = chunkTLGPM7SI_js.buildCssGradientFromShapeStyle(element.shapeStyle) || element.shapeStyle?.fillGradient;
|
|
4800
|
+
const shadowCss = chunkTLGPM7SI_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
4801
|
+
const innerShadowCss = chunkTLGPM7SI_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
4802
|
+
const resolvedFillColor = chunkTLGPM7SI_js.colorWithOpacity(fillColor, fillOpacity);
|
|
4803
|
+
const resolvedStrokeColor = chunkTLGPM7SI_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
4804
4804
|
const ss = element.shapeStyle;
|
|
4805
4805
|
const combinedShadowParts = [];
|
|
4806
|
-
const multiLayerShadow =
|
|
4806
|
+
const multiLayerShadow = chunkTLGPM7SI_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
4807
4807
|
if (multiLayerShadow) {
|
|
4808
4808
|
combinedShadowParts.push(multiLayerShadow);
|
|
4809
4809
|
} else if (shadowCss) {
|
|
@@ -4812,7 +4812,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4812
4812
|
if (innerShadowCss) {
|
|
4813
4813
|
combinedShadowParts.push(innerShadowCss);
|
|
4814
4814
|
}
|
|
4815
|
-
const glowBoxShadow =
|
|
4815
|
+
const glowBoxShadow = chunkTLGPM7SI_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
4816
4816
|
if (glowBoxShadow) {
|
|
4817
4817
|
combinedShadowParts.push(glowBoxShadow);
|
|
4818
4818
|
}
|
|
@@ -4820,7 +4820,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4820
4820
|
if (lineShadow) {
|
|
4821
4821
|
combinedShadowParts.push(lineShadow);
|
|
4822
4822
|
}
|
|
4823
|
-
const compoundLineShadow =
|
|
4823
|
+
const compoundLineShadow = chunkTLGPM7SI_js.getCompoundLineBoxShadow(
|
|
4824
4824
|
element.shapeStyle?.compoundLine,
|
|
4825
4825
|
strokeWidth,
|
|
4826
4826
|
resolvedStrokeColor
|
|
@@ -4833,7 +4833,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4833
4833
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
4834
4834
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
4835
4835
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
4836
|
-
const glowCol =
|
|
4836
|
+
const glowCol = chunkTLGPM7SI_js.colorWithOpacity(chunkTLGPM7SI_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
4837
4837
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
4838
4838
|
}
|
|
4839
4839
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
@@ -4846,12 +4846,12 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4846
4846
|
if (lineGlowCss) {
|
|
4847
4847
|
filterParts.push(lineGlowCss);
|
|
4848
4848
|
}
|
|
4849
|
-
const dagFilter =
|
|
4849
|
+
const dagFilter = chunkTLGPM7SI_js.getEffectDagFilter(ss, element.id);
|
|
4850
4850
|
if (dagFilter) {
|
|
4851
4851
|
filterParts.push(dagFilter);
|
|
4852
4852
|
}
|
|
4853
4853
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : void 0;
|
|
4854
|
-
const patternFill =
|
|
4854
|
+
const patternFill = chunkTLGPM7SI_js.buildPatternFillCss(element.shapeStyle);
|
|
4855
4855
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
4856
4856
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
4857
4857
|
let reflectCss;
|
|
@@ -4863,7 +4863,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4863
4863
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
4864
4864
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
4865
4865
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
4866
|
-
reflectCss =
|
|
4866
|
+
reflectCss = chunkTLGPM7SI_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
4867
4867
|
}
|
|
4868
4868
|
}
|
|
4869
4869
|
const base = {
|
|
@@ -4877,9 +4877,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4877
4877
|
filter: filterParts.length > 0 ? filterParts.join(" ") : void 0,
|
|
4878
4878
|
opacity: typeof ss?.dagAlphaModFix === "number" ? Math.max(0, Math.min(1, ss.dagAlphaModFix / 100)) : void 0,
|
|
4879
4879
|
mixBlendMode: mapDagBlendModeToCss(ss?.dagFillOverlayBlend),
|
|
4880
|
-
borderWidth: strokeWidth > 0 ?
|
|
4880
|
+
borderWidth: strokeWidth > 0 ? chunkTLGPM7SI_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : void 0,
|
|
4881
4881
|
borderColor: strokeWidth > 0 ? resolvedStrokeColor : void 0,
|
|
4882
|
-
borderStyle: strokeWidth > 0 ?
|
|
4882
|
+
borderStyle: strokeWidth > 0 ? chunkTLGPM7SI_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
4883
4883
|
strokeLinejoin: lineJoinCss,
|
|
4884
4884
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : void 0
|
|
4885
4885
|
};
|
|
@@ -4920,7 +4920,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4920
4920
|
borderWidth: 0,
|
|
4921
4921
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
4922
4922
|
borderTopColor: resolvedStrokeColor,
|
|
4923
|
-
borderTopStyle:
|
|
4923
|
+
borderTopStyle: chunkTLGPM7SI_js.getCssBorderDashStyle(strokeDash)
|
|
4924
4924
|
};
|
|
4925
4925
|
}
|
|
4926
4926
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -4934,13 +4934,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4934
4934
|
function getConnectorAdjustment(element, key, fallback) {
|
|
4935
4935
|
const direct = element.shapeAdjustments?.[key];
|
|
4936
4936
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
4937
|
-
return
|
|
4937
|
+
return chunkTLGPM7SI_js.clampUnitInterval(direct / 1e5);
|
|
4938
4938
|
}
|
|
4939
4939
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
4940
4940
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
4941
|
-
return
|
|
4941
|
+
return chunkTLGPM7SI_js.clampUnitInterval(fallbackKey / 1e5);
|
|
4942
4942
|
}
|
|
4943
|
-
return
|
|
4943
|
+
return chunkTLGPM7SI_js.clampUnitInterval(fallback);
|
|
4944
4944
|
}
|
|
4945
4945
|
function getConnectorPathGeometry(element) {
|
|
4946
4946
|
const width = Math.max(element.width, 1);
|
|
@@ -5067,14 +5067,14 @@ function renderConnectorMarker(markerId, arrowType, color, arrowWidth, arrowLeng
|
|
|
5067
5067
|
);
|
|
5068
5068
|
}
|
|
5069
5069
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor) {
|
|
5070
|
-
if (!
|
|
5070
|
+
if (!chunkVMQLQEGG_js.hasShapeProperties(element)) {
|
|
5071
5071
|
return null;
|
|
5072
5072
|
}
|
|
5073
5073
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
5074
|
-
const fillPaint =
|
|
5075
|
-
const strokePaint =
|
|
5076
|
-
const dashType =
|
|
5077
|
-
const dashArray =
|
|
5074
|
+
const fillPaint = chunkTLGPM7SI_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
5075
|
+
const strokePaint = chunkTLGPM7SI_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
5076
|
+
const dashType = chunkTLGPM7SI_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
5077
|
+
const dashArray = chunkTLGPM7SI_js.getSvgStrokeDasharray(
|
|
5078
5078
|
dashType,
|
|
5079
5079
|
Math.max(strokeWidth, 1),
|
|
5080
5080
|
element.shapeStyle?.customDashSegments
|
|
@@ -5158,18 +5158,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5158
5158
|
}
|
|
5159
5159
|
);
|
|
5160
5160
|
}
|
|
5161
|
-
if (
|
|
5161
|
+
if (chunkVMQLQEGG_js.isCalloutShape(normalizedType)) {
|
|
5162
5162
|
const width = Math.max(element.width, 1);
|
|
5163
5163
|
const height = Math.max(element.height, 1);
|
|
5164
|
-
const geometry =
|
|
5164
|
+
const geometry = chunkVMQLQEGG_js.getCalloutLeaderLineGeometry(
|
|
5165
5165
|
normalizedType,
|
|
5166
5166
|
width,
|
|
5167
5167
|
height,
|
|
5168
5168
|
element.shapeAdjustments
|
|
5169
5169
|
);
|
|
5170
5170
|
if (geometry && geometry.points.length >= 2) {
|
|
5171
|
-
const leaderPath =
|
|
5172
|
-
const bounds =
|
|
5171
|
+
const leaderPath = chunkVMQLQEGG_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
5172
|
+
const bounds = chunkVMQLQEGG_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
5173
5173
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
5174
5174
|
const offsetLeft = bounds.minX;
|
|
5175
5175
|
const offsetTop = bounds.minY;
|
|
@@ -5233,8 +5233,8 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5233
5233
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
5234
5234
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
5235
5235
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
5236
|
-
const offsets =
|
|
5237
|
-
const widths =
|
|
5236
|
+
const offsets = chunkTLGPM7SI_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
5237
|
+
const widths = chunkTLGPM7SI_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
5238
5238
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5239
5239
|
"svg",
|
|
5240
5240
|
{
|
|
@@ -5288,7 +5288,7 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5288
5288
|
|
|
5289
5289
|
// src/viewer/utils/image-style.ts
|
|
5290
5290
|
function getImageMaskStyle(element) {
|
|
5291
|
-
if (!
|
|
5291
|
+
if (!chunkVMQLQEGG_js.hasShapeProperties(element)) {
|
|
5292
5292
|
return void 0;
|
|
5293
5293
|
}
|
|
5294
5294
|
const shapeType = element.shapeType;
|
|
@@ -5297,7 +5297,7 @@ function getImageMaskStyle(element) {
|
|
|
5297
5297
|
}
|
|
5298
5298
|
const normalized = shapeType.toLowerCase();
|
|
5299
5299
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
5300
|
-
const radiusPx =
|
|
5300
|
+
const radiusPx = chunkTLGPM7SI_js.getRoundRectRadiusPx(element);
|
|
5301
5301
|
if (radiusPx <= 0.01) {
|
|
5302
5302
|
return void 0;
|
|
5303
5303
|
}
|
|
@@ -5309,7 +5309,7 @@ function getImageMaskStyle(element) {
|
|
|
5309
5309
|
if (normalized === "can" || normalized === "cylinder") {
|
|
5310
5310
|
return { borderRadius: "48% / 12%" };
|
|
5311
5311
|
}
|
|
5312
|
-
const clipPath =
|
|
5312
|
+
const clipPath = chunkTLGPM7SI_js.getResolvedShapeClipPath(element);
|
|
5313
5313
|
if (!clipPath) {
|
|
5314
5314
|
return void 0;
|
|
5315
5315
|
}
|
|
@@ -5317,7 +5317,7 @@ function getImageMaskStyle(element) {
|
|
|
5317
5317
|
}
|
|
5318
5318
|
function getImageRenderStyle(element) {
|
|
5319
5319
|
const maskStyle = getImageMaskStyle(element) || {};
|
|
5320
|
-
if (!
|
|
5320
|
+
if (!chunkVMQLQEGG_js.isImageLikeElement(element)) {
|
|
5321
5321
|
return {
|
|
5322
5322
|
...maskStyle,
|
|
5323
5323
|
width: "100%",
|
|
@@ -5325,10 +5325,10 @@ function getImageRenderStyle(element) {
|
|
|
5325
5325
|
objectFit: "cover"
|
|
5326
5326
|
};
|
|
5327
5327
|
}
|
|
5328
|
-
const cropLeft =
|
|
5329
|
-
const cropTop =
|
|
5330
|
-
const cropRight =
|
|
5331
|
-
const cropBottom =
|
|
5328
|
+
const cropLeft = chunkTLGPM7SI_js.clampCropValue(element.cropLeft);
|
|
5329
|
+
const cropTop = chunkTLGPM7SI_js.clampCropValue(element.cropTop);
|
|
5330
|
+
const cropRight = chunkTLGPM7SI_js.clampCropValue(element.cropRight);
|
|
5331
|
+
const cropBottom = chunkTLGPM7SI_js.clampCropValue(element.cropBottom);
|
|
5332
5332
|
const hasCrop = cropLeft + cropRight > 1e-4 || cropTop + cropBottom > 1e-4;
|
|
5333
5333
|
if (!hasCrop) {
|
|
5334
5334
|
return {
|
|
@@ -5340,10 +5340,10 @@ function getImageRenderStyle(element) {
|
|
|
5340
5340
|
}
|
|
5341
5341
|
const safeHorizontalScale = cropLeft + cropRight >= 0.99 ? 0.99 / (cropLeft + cropRight) : 1;
|
|
5342
5342
|
const safeVerticalScale = cropTop + cropBottom >= 0.99 ? 0.99 / (cropTop + cropBottom) : 1;
|
|
5343
|
-
const normalizedLeft =
|
|
5344
|
-
const normalizedRight =
|
|
5345
|
-
const normalizedTop =
|
|
5346
|
-
const normalizedBottom =
|
|
5343
|
+
const normalizedLeft = chunkTLGPM7SI_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
5344
|
+
const normalizedRight = chunkTLGPM7SI_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
5345
|
+
const normalizedTop = chunkTLGPM7SI_js.clampCropValue(cropTop * safeVerticalScale);
|
|
5346
|
+
const normalizedBottom = chunkTLGPM7SI_js.clampCropValue(cropBottom * safeVerticalScale);
|
|
5347
5347
|
const remainingWidth = Math.max(0.01, 1 - normalizedLeft - normalizedRight);
|
|
5348
5348
|
const remainingHeight = Math.max(0.01, 1 - normalizedTop - normalizedBottom);
|
|
5349
5349
|
const tx = Math.round(-normalizedLeft / remainingWidth * 1e4) / 100;
|
|
@@ -5372,7 +5372,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
5372
5372
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
5373
5373
|
};
|
|
5374
5374
|
function getCropShapeClipPath(element) {
|
|
5375
|
-
if (!
|
|
5375
|
+
if (!chunkVMQLQEGG_js.isImageLikeElement(element)) {
|
|
5376
5376
|
return void 0;
|
|
5377
5377
|
}
|
|
5378
5378
|
const shape = element.cropShape;
|
|
@@ -5382,7 +5382,7 @@ function getCropShapeClipPath(element) {
|
|
|
5382
5382
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
5383
5383
|
}
|
|
5384
5384
|
function isImageTiled(element) {
|
|
5385
|
-
if (!
|
|
5385
|
+
if (!chunkVMQLQEGG_js.isImageLikeElement(element)) {
|
|
5386
5386
|
return false;
|
|
5387
5387
|
}
|
|
5388
5388
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -5412,7 +5412,7 @@ function tileAlignmentToCssPosition(alignment) {
|
|
|
5412
5412
|
}
|
|
5413
5413
|
}
|
|
5414
5414
|
function getImageTilingStyle(element) {
|
|
5415
|
-
if (!
|
|
5415
|
+
if (!chunkVMQLQEGG_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
5416
5416
|
return void 0;
|
|
5417
5417
|
}
|
|
5418
5418
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -5483,9 +5483,9 @@ function parseGradientFillCss(gradFill) {
|
|
|
5483
5483
|
}
|
|
5484
5484
|
const parsed = stops.map((gs) => {
|
|
5485
5485
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
5486
|
-
const color =
|
|
5487
|
-
const opacity =
|
|
5488
|
-
return { pos, color:
|
|
5486
|
+
const color = chunkTLGPM7SI_js.parseDrawingColor(gs) ?? "#888888";
|
|
5487
|
+
const opacity = chunkTLGPM7SI_js.parseDrawingColorOpacity(gs);
|
|
5488
|
+
return { pos, color: chunkTLGPM7SI_js.colorWithOpacity(color, opacity) };
|
|
5489
5489
|
}).sort((a, b) => a.pos - b.pos);
|
|
5490
5490
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
5491
5491
|
const lin = gradFill["a:lin"];
|
|
@@ -5526,8 +5526,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
5526
5526
|
if (!pattFill) {
|
|
5527
5527
|
return void 0;
|
|
5528
5528
|
}
|
|
5529
|
-
const fgColor =
|
|
5530
|
-
const bgColor =
|
|
5529
|
+
const fgColor = chunkTLGPM7SI_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
5530
|
+
const bgColor = chunkTLGPM7SI_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
5531
5531
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
5532
5532
|
switch (preset) {
|
|
5533
5533
|
case "ltHorz":
|
|
@@ -5638,11 +5638,11 @@ function parseCellBorders(cellProperties) {
|
|
|
5638
5638
|
const prstDash = ln["a:prstDash"];
|
|
5639
5639
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
5640
5640
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
5641
|
-
const color =
|
|
5641
|
+
const color = chunkTLGPM7SI_js.parseDrawingColor(ln["a:solidFill"]);
|
|
5642
5642
|
if (color) {
|
|
5643
|
-
const opacity =
|
|
5643
|
+
const opacity = chunkTLGPM7SI_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
5644
5644
|
const key = `${edge.prefix}`;
|
|
5645
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
5645
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkTLGPM7SI_js.colorWithOpacity(color, opacity)}`;
|
|
5646
5646
|
}
|
|
5647
5647
|
}
|
|
5648
5648
|
return borderStyle;
|
|
@@ -5655,7 +5655,7 @@ function parseCellTextEffects(runProps) {
|
|
|
5655
5655
|
const textShadowParts = [];
|
|
5656
5656
|
const outerShdw = effectLst["a:outerShdw"];
|
|
5657
5657
|
if (outerShdw) {
|
|
5658
|
-
const shdwColor =
|
|
5658
|
+
const shdwColor = chunkTLGPM7SI_js.parseDrawingColor(outerShdw);
|
|
5659
5659
|
if (shdwColor) {
|
|
5660
5660
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
5661
5661
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -5673,7 +5673,7 @@ function parseCellTextEffects(runProps) {
|
|
|
5673
5673
|
}
|
|
5674
5674
|
const glow = effectLst["a:glow"];
|
|
5675
5675
|
if (glow) {
|
|
5676
|
-
const glowColor =
|
|
5676
|
+
const glowColor = chunkTLGPM7SI_js.parseDrawingColor(glow);
|
|
5677
5677
|
if (glowColor) {
|
|
5678
5678
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
5679
5679
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -5752,10 +5752,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5752
5752
|
if (runProps?.["@_u"] !== void 0) {
|
|
5753
5753
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
5754
5754
|
}
|
|
5755
|
-
const runColor =
|
|
5755
|
+
const runColor = chunkTLGPM7SI_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkTLGPM7SI_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
5756
5756
|
if (runColor) {
|
|
5757
|
-
const opacity =
|
|
5758
|
-
cellStyle.color =
|
|
5757
|
+
const opacity = chunkTLGPM7SI_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
5758
|
+
cellStyle.color = chunkTLGPM7SI_js.colorWithOpacity(runColor, opacity);
|
|
5759
5759
|
}
|
|
5760
5760
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
5761
5761
|
if (fontFamily) {
|
|
@@ -5765,15 +5765,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5765
5765
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
5766
5766
|
}
|
|
5767
5767
|
const cellProperties = cellXml["a:tcPr"];
|
|
5768
|
-
const cellFill =
|
|
5768
|
+
const cellFill = chunkTLGPM7SI_js.parseDrawingColor(
|
|
5769
5769
|
cellProperties?.["a:solidFill"],
|
|
5770
5770
|
schemeColorOverrides
|
|
5771
5771
|
);
|
|
5772
5772
|
if (cellFill) {
|
|
5773
|
-
const opacity =
|
|
5773
|
+
const opacity = chunkTLGPM7SI_js.parseDrawingColorOpacity(
|
|
5774
5774
|
cellProperties?.["a:solidFill"]
|
|
5775
5775
|
);
|
|
5776
|
-
cellStyle.backgroundColor =
|
|
5776
|
+
cellStyle.backgroundColor = chunkTLGPM7SI_js.colorWithOpacity(cellFill, opacity);
|
|
5777
5777
|
} else {
|
|
5778
5778
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
5779
5779
|
if (gradCss) {
|
|
@@ -5788,16 +5788,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5788
5788
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
5789
5789
|
Object.assign(cellStyle, edgeBorders);
|
|
5790
5790
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
5791
|
-
const borderColor =
|
|
5791
|
+
const borderColor = chunkTLGPM7SI_js.parseDrawingColor(
|
|
5792
5792
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
5793
5793
|
schemeColorOverrides
|
|
5794
|
-
) ||
|
|
5794
|
+
) || chunkTLGPM7SI_js.parseDrawingColor(
|
|
5795
5795
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
5796
5796
|
schemeColorOverrides
|
|
5797
|
-
) ||
|
|
5797
|
+
) || chunkTLGPM7SI_js.parseDrawingColor(
|
|
5798
5798
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
5799
5799
|
schemeColorOverrides
|
|
5800
|
-
) ||
|
|
5800
|
+
) || chunkTLGPM7SI_js.parseDrawingColor(
|
|
5801
5801
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
5802
5802
|
schemeColorOverrides
|
|
5803
5803
|
);
|
|
@@ -5876,10 +5876,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
5876
5876
|
}
|
|
5877
5877
|
let color = base;
|
|
5878
5878
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
5879
|
-
color =
|
|
5879
|
+
color = chunkTLGPM7SI_js.tintColor2(color, fill.tint / 1e5);
|
|
5880
5880
|
}
|
|
5881
5881
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
5882
|
-
color =
|
|
5882
|
+
color = chunkTLGPM7SI_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
5883
5883
|
}
|
|
5884
5884
|
return color;
|
|
5885
5885
|
}
|
|
@@ -5901,10 +5901,10 @@ function applyTableStyleText(text, colorScheme, style) {
|
|
|
5901
5901
|
if (base) {
|
|
5902
5902
|
let color = base;
|
|
5903
5903
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
5904
|
-
color =
|
|
5904
|
+
color = chunkTLGPM7SI_js.tintColor2(color, text.fontTint / 1e5);
|
|
5905
5905
|
}
|
|
5906
5906
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
5907
|
-
color =
|
|
5907
|
+
color = chunkTLGPM7SI_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
5908
5908
|
}
|
|
5909
5909
|
style.color = color;
|
|
5910
5910
|
applied = true;
|
|
@@ -6186,9 +6186,9 @@ function cellStyleToCss(style) {
|
|
|
6186
6186
|
if (style.gradientFillCss) {
|
|
6187
6187
|
css.background = style.gradientFillCss;
|
|
6188
6188
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
6189
|
-
const fg =
|
|
6190
|
-
const bg =
|
|
6191
|
-
const svgPattern =
|
|
6189
|
+
const fg = chunkTLGPM7SI_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
6190
|
+
const bg = chunkTLGPM7SI_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
6191
|
+
const svgPattern = chunkTLGPM7SI_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
6192
6192
|
if (svgPattern) {
|
|
6193
6193
|
const encoded = encodeURIComponent(svgPattern);
|
|
6194
6194
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -6257,7 +6257,7 @@ function cellStyleToCss(style) {
|
|
|
6257
6257
|
if (edge.width || edge.color) {
|
|
6258
6258
|
const w = edge.width ?? 1;
|
|
6259
6259
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
6260
|
-
const s =
|
|
6260
|
+
const s = chunkTLGPM7SI_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
6261
6261
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
6262
6262
|
}
|
|
6263
6263
|
}
|
|
@@ -6299,7 +6299,7 @@ function TableResizeOverlay({
|
|
|
6299
6299
|
const containerRef = React3.useRef(null);
|
|
6300
6300
|
const [rowBounds, setRowBounds] = React3.useState([]);
|
|
6301
6301
|
const dragRef = React3.useRef(null);
|
|
6302
|
-
const colBoundaries = React3.useMemo(() =>
|
|
6302
|
+
const colBoundaries = React3.useMemo(() => chunkTLGPM7SI_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
6303
6303
|
const measureRows = React3.useCallback(() => {
|
|
6304
6304
|
const container = containerRef.current;
|
|
6305
6305
|
if (!container) {
|
|
@@ -6346,11 +6346,11 @@ function TableResizeOverlay({
|
|
|
6346
6346
|
const rect = containerRef.current.getBoundingClientRect();
|
|
6347
6347
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
6348
6348
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
6349
|
-
onResizeColumns(
|
|
6349
|
+
onResizeColumns(chunkTLGPM7SI_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
6350
6350
|
} else if (drag.type === "row" && onResizeRow) {
|
|
6351
6351
|
const deltaY = e.clientY - drag.startPos;
|
|
6352
|
-
const newHeight =
|
|
6353
|
-
drag.initialRowHeight ??
|
|
6352
|
+
const newHeight = chunkTLGPM7SI_js.computeResizedRowHeight(
|
|
6353
|
+
drag.initialRowHeight ?? chunkTLGPM7SI_js.DEFAULT_ROW_HEIGHT,
|
|
6354
6354
|
deltaY
|
|
6355
6355
|
);
|
|
6356
6356
|
onResizeRow(drag.index, newHeight);
|
|
@@ -6388,7 +6388,7 @@ function TableResizeOverlay({
|
|
|
6388
6388
|
e.stopPropagation();
|
|
6389
6389
|
const table = containerRef.current?.querySelector("table");
|
|
6390
6390
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
6391
|
-
const actualHeight = tr?.offsetHeight ??
|
|
6391
|
+
const actualHeight = tr?.offsetHeight ?? chunkTLGPM7SI_js.DEFAULT_ROW_HEIGHT;
|
|
6392
6392
|
document.body.style.cursor = "row-resize";
|
|
6393
6393
|
document.body.style.userSelect = "none";
|
|
6394
6394
|
dragRef.current = {
|
|
@@ -6434,7 +6434,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6434
6434
|
}
|
|
6435
6435
|
const first = selectedCell.selectedCells[0];
|
|
6436
6436
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
6437
|
-
return
|
|
6437
|
+
return chunkTLGPM7SI_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
6438
6438
|
})();
|
|
6439
6439
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6440
6440
|
TableResizeOverlay,
|
|
@@ -6467,7 +6467,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6467
6467
|
return null;
|
|
6468
6468
|
}
|
|
6469
6469
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
6470
|
-
const isInMultiSelection =
|
|
6470
|
+
const isInMultiSelection = chunkTLGPM7SI_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
6471
6471
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
6472
6472
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6473
6473
|
"td",
|
|
@@ -6490,7 +6490,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6490
6490
|
}
|
|
6491
6491
|
event.stopPropagation();
|
|
6492
6492
|
if (event.shiftKey && selectedCell) {
|
|
6493
|
-
const rect =
|
|
6493
|
+
const rect = chunkTLGPM7SI_js.computeSelectionRect(
|
|
6494
6494
|
selectedCell.rowIndex,
|
|
6495
6495
|
selectedCell.columnIndex,
|
|
6496
6496
|
rowIndex,
|
|
@@ -6500,7 +6500,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6500
6500
|
options?.onSelectCell?.({
|
|
6501
6501
|
rowIndex: selectedCell.rowIndex,
|
|
6502
6502
|
columnIndex: selectedCell.columnIndex,
|
|
6503
|
-
selectedCells:
|
|
6503
|
+
selectedCells: chunkTLGPM7SI_js.rectToCells(rect)
|
|
6504
6504
|
});
|
|
6505
6505
|
} else {
|
|
6506
6506
|
options?.onSelectCell?.({
|
|
@@ -6574,7 +6574,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6574
6574
|
}
|
|
6575
6575
|
const first = selectedCell.selectedCells[0];
|
|
6576
6576
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
6577
|
-
return
|
|
6577
|
+
return chunkTLGPM7SI_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
6578
6578
|
})();
|
|
6579
6579
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
6580
6580
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6639,7 +6639,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6639
6639
|
"border px-1 py-0.5 align-top",
|
|
6640
6640
|
isEditable2 && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
6641
6641
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
6642
|
-
|
|
6642
|
+
chunkTLGPM7SI_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
6643
6643
|
),
|
|
6644
6644
|
colSpan,
|
|
6645
6645
|
rowSpan: rSpan,
|
|
@@ -6650,7 +6650,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6650
6650
|
}
|
|
6651
6651
|
event.stopPropagation();
|
|
6652
6652
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
6653
|
-
const rect =
|
|
6653
|
+
const rect = chunkTLGPM7SI_js.computeSelectionRect(
|
|
6654
6654
|
selectedCell.rowIndex,
|
|
6655
6655
|
selectedCell.columnIndex,
|
|
6656
6656
|
rowIndex,
|
|
@@ -6660,7 +6660,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6660
6660
|
options?.onSelectCell?.({
|
|
6661
6661
|
rowIndex: selectedCell.rowIndex,
|
|
6662
6662
|
columnIndex: selectedCell.columnIndex,
|
|
6663
|
-
selectedCells:
|
|
6663
|
+
selectedCells: chunkTLGPM7SI_js.rectToCells(rect)
|
|
6664
6664
|
});
|
|
6665
6665
|
} else {
|
|
6666
6666
|
options?.onSelectCell?.({
|
|
@@ -6712,24 +6712,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6712
6712
|
}
|
|
6713
6713
|
var LEGEND_ITEM_WIDTH = 80;
|
|
6714
6714
|
function partAttrs(part) {
|
|
6715
|
-
return part ?
|
|
6715
|
+
return part ? chunkTLGPM7SI_js.chartPartToAttrs(part) : void 0;
|
|
6716
6716
|
}
|
|
6717
6717
|
function resolveReactPalette(chartData) {
|
|
6718
6718
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
6719
6719
|
return chartData.colorPalette;
|
|
6720
6720
|
}
|
|
6721
|
-
return [...
|
|
6721
|
+
return [...chunkTLGPM7SI_js.getChartStylePalette(chartData.style?.styleId)];
|
|
6722
6722
|
}
|
|
6723
6723
|
function buildReactChartViewModel(element) {
|
|
6724
6724
|
if (element.type !== "chart" || !element.chartData) {
|
|
6725
|
-
return
|
|
6725
|
+
return chunkTLGPM7SI_js.buildChartViewModel(element);
|
|
6726
6726
|
}
|
|
6727
6727
|
const palette = resolveReactPalette(element.chartData);
|
|
6728
6728
|
const themedElement = {
|
|
6729
6729
|
...element,
|
|
6730
6730
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
6731
6731
|
};
|
|
6732
|
-
return
|
|
6732
|
+
return chunkTLGPM7SI_js.buildChartViewModel(themedElement);
|
|
6733
6733
|
}
|
|
6734
6734
|
function renderPrimitive(prim, key) {
|
|
6735
6735
|
switch (prim.kind) {
|
|
@@ -7118,7 +7118,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7118
7118
|
const unmatchedRows = [];
|
|
7119
7119
|
categories.forEach((cat, i) => {
|
|
7120
7120
|
const value = values[i] ?? 0;
|
|
7121
|
-
const code =
|
|
7121
|
+
const code = chunkTLGPM7SI_js.resolveRegionCode(cat);
|
|
7122
7122
|
if (code) {
|
|
7123
7123
|
regionValueMap.set(code, { value, label: cat });
|
|
7124
7124
|
} else {
|
|
@@ -7156,8 +7156,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7156
7156
|
let fill = "#e2e8f0";
|
|
7157
7157
|
let dataLabel = null;
|
|
7158
7158
|
if (entry) {
|
|
7159
|
-
const t =
|
|
7160
|
-
fill =
|
|
7159
|
+
const t = chunkTLGPM7SI_js.normalizeValue(entry.value, minVal, maxVal);
|
|
7160
|
+
fill = chunkTLGPM7SI_js.sequentialColorScale(t);
|
|
7161
7161
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
7162
7162
|
"text",
|
|
7163
7163
|
{
|
|
@@ -7168,7 +7168,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7168
7168
|
fontWeight: 600,
|
|
7169
7169
|
fill: "#1e293b",
|
|
7170
7170
|
style: { pointerEvents: "none" },
|
|
7171
|
-
children:
|
|
7171
|
+
children: chunkTLGPM7SI_js.formatAxisValue(entry.value)
|
|
7172
7172
|
},
|
|
7173
7173
|
`${element.id}-map-dl-${region.code}`
|
|
7174
7174
|
);
|
|
@@ -7186,7 +7186,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7186
7186
|
opacity: 0.9,
|
|
7187
7187
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
7188
7188
|
region.name,
|
|
7189
|
-
entry ? `: ${
|
|
7189
|
+
entry ? `: ${chunkTLGPM7SI_js.formatAxisValue(entry.value)}` : ""
|
|
7190
7190
|
] })
|
|
7191
7191
|
}
|
|
7192
7192
|
),
|
|
@@ -7224,7 +7224,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7224
7224
|
fontSize: 7,
|
|
7225
7225
|
fill: "#64748b",
|
|
7226
7226
|
textAnchor: "middle",
|
|
7227
|
-
children:
|
|
7227
|
+
children: chunkTLGPM7SI_js.formatAxisValue(minVal)
|
|
7228
7228
|
},
|
|
7229
7229
|
`${element.id}-map-legend-min`
|
|
7230
7230
|
),
|
|
@@ -7236,7 +7236,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7236
7236
|
fontSize: 7,
|
|
7237
7237
|
fill: "#64748b",
|
|
7238
7238
|
textAnchor: "middle",
|
|
7239
|
-
children:
|
|
7239
|
+
children: chunkTLGPM7SI_js.formatAxisValue(maxVal)
|
|
7240
7240
|
},
|
|
7241
7241
|
`${element.id}-map-legend-max`
|
|
7242
7242
|
)
|
|
@@ -7302,7 +7302,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7302
7302
|
y,
|
|
7303
7303
|
fontSize,
|
|
7304
7304
|
fill: "#475569",
|
|
7305
|
-
children:
|
|
7305
|
+
children: chunkTLGPM7SI_js.formatAxisValue(row.value)
|
|
7306
7306
|
},
|
|
7307
7307
|
`${element.id}-map-ft-val-${i}`
|
|
7308
7308
|
)
|
|
@@ -7373,7 +7373,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
7373
7373
|
|
|
7374
7374
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
7375
7375
|
function sColor(series, idx) {
|
|
7376
|
-
return
|
|
7376
|
+
return chunkTLGPM7SI_js.seriesColor(series, idx);
|
|
7377
7377
|
}
|
|
7378
7378
|
function valToY(val, range, topY, bottomY) {
|
|
7379
7379
|
const usable = bottomY - topY;
|
|
@@ -7868,7 +7868,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
7868
7868
|
width: 10,
|
|
7869
7869
|
height: 10,
|
|
7870
7870
|
rx: 2,
|
|
7871
|
-
fill:
|
|
7871
|
+
fill: chunkTLGPM7SI_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
7872
7872
|
},
|
|
7873
7873
|
`${id}-leg-r-${i}`
|
|
7874
7874
|
)
|
|
@@ -7892,7 +7892,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
7892
7892
|
width: 10,
|
|
7893
7893
|
height: 10,
|
|
7894
7894
|
rx: 2,
|
|
7895
|
-
fill:
|
|
7895
|
+
fill: chunkTLGPM7SI_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
7896
7896
|
}
|
|
7897
7897
|
),
|
|
7898
7898
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -7905,9 +7905,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
7905
7905
|
}
|
|
7906
7906
|
const lines = [];
|
|
7907
7907
|
if (range.logScale && range.logBase) {
|
|
7908
|
-
const ticks =
|
|
7908
|
+
const ticks = chunkTLGPM7SI_js.generateLogTicks(range);
|
|
7909
7909
|
ticks.forEach((tickVal, i) => {
|
|
7910
|
-
const y =
|
|
7910
|
+
const y = chunkTLGPM7SI_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
7911
7911
|
lines.push(
|
|
7912
7912
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7913
7913
|
"line",
|
|
@@ -7928,7 +7928,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
7928
7928
|
const steps = 4;
|
|
7929
7929
|
for (let i = 0; i <= steps; i++) {
|
|
7930
7930
|
const val = range.min + range.span * i / steps;
|
|
7931
|
-
const y =
|
|
7931
|
+
const y = chunkTLGPM7SI_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
7932
7932
|
lines.push(
|
|
7933
7933
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7934
7934
|
"line",
|
|
@@ -7952,9 +7952,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7952
7952
|
const labels = [];
|
|
7953
7953
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
7954
7954
|
if (range.logScale && range.logBase) {
|
|
7955
|
-
const ticks =
|
|
7955
|
+
const ticks = chunkTLGPM7SI_js.generateLogTicks(range);
|
|
7956
7956
|
ticks.forEach((tickVal, i) => {
|
|
7957
|
-
const y =
|
|
7957
|
+
const y = chunkTLGPM7SI_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
7958
7958
|
labels.push(
|
|
7959
7959
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7960
7960
|
"text",
|
|
@@ -7964,7 +7964,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7964
7964
|
textAnchor: "end",
|
|
7965
7965
|
fontSize: 8,
|
|
7966
7966
|
fill: "#64748b",
|
|
7967
|
-
children: hasDisplayUnits ?
|
|
7967
|
+
children: hasDisplayUnits ? chunkTLGPM7SI_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkTLGPM7SI_js.formatAxisValue(tickVal)
|
|
7968
7968
|
},
|
|
7969
7969
|
`${id}-vaxis-log-${i}`
|
|
7970
7970
|
)
|
|
@@ -7974,7 +7974,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7974
7974
|
const steps = 4;
|
|
7975
7975
|
for (let i = 0; i <= steps; i++) {
|
|
7976
7976
|
const val = range.min + range.span * i / steps;
|
|
7977
|
-
const y =
|
|
7977
|
+
const y = chunkTLGPM7SI_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
7978
7978
|
labels.push(
|
|
7979
7979
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7980
7980
|
"text",
|
|
@@ -7984,7 +7984,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7984
7984
|
textAnchor: "end",
|
|
7985
7985
|
fontSize: 8,
|
|
7986
7986
|
fill: "#64748b",
|
|
7987
|
-
children: hasDisplayUnits ?
|
|
7987
|
+
children: hasDisplayUnits ? chunkTLGPM7SI_js.formatAxisValueWithUnits(val, axisFormatting) : chunkTLGPM7SI_js.formatAxisValue(val)
|
|
7988
7988
|
},
|
|
7989
7989
|
`${id}-vaxis-${i}`
|
|
7990
7990
|
)
|
|
@@ -7992,7 +7992,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
7992
7992
|
}
|
|
7993
7993
|
}
|
|
7994
7994
|
if (hasDisplayUnits) {
|
|
7995
|
-
const unitLabel =
|
|
7995
|
+
const unitLabel = chunkTLGPM7SI_js.getDisplayUnitLabel(
|
|
7996
7996
|
axisFormatting.displayUnits,
|
|
7997
7997
|
axisFormatting.displayUnitsLabel
|
|
7998
7998
|
);
|
|
@@ -8067,7 +8067,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
8067
8067
|
if (range.min >= 0) {
|
|
8068
8068
|
return null;
|
|
8069
8069
|
}
|
|
8070
|
-
const y =
|
|
8070
|
+
const y = chunkTLGPM7SI_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
8071
8071
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8072
8072
|
"line",
|
|
8073
8073
|
{
|
|
@@ -8091,7 +8091,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8091
8091
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
8092
8092
|
for (let i = 0; i <= steps; i++) {
|
|
8093
8093
|
const val = range.min + range.span * i / steps;
|
|
8094
|
-
const y =
|
|
8094
|
+
const y = chunkTLGPM7SI_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8095
8095
|
labels.push(
|
|
8096
8096
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8097
8097
|
"text",
|
|
@@ -8103,7 +8103,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8103
8103
|
fontFamily,
|
|
8104
8104
|
fontWeight,
|
|
8105
8105
|
fill: fontColor,
|
|
8106
|
-
children: hasDisplayUnits ?
|
|
8106
|
+
children: hasDisplayUnits ? chunkTLGPM7SI_js.formatAxisValueWithUnits(val, axisFormatting) : chunkTLGPM7SI_js.formatAxisValue(val)
|
|
8107
8107
|
},
|
|
8108
8108
|
`${id}-sec-vaxis-${i}`
|
|
8109
8109
|
)
|
|
@@ -8127,7 +8127,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8127
8127
|
);
|
|
8128
8128
|
}
|
|
8129
8129
|
if (hasDisplayUnits) {
|
|
8130
|
-
const unitLabel =
|
|
8130
|
+
const unitLabel = chunkTLGPM7SI_js.getDisplayUnitLabel(
|
|
8131
8131
|
axisFormatting.displayUnits,
|
|
8132
8132
|
axisFormatting.displayUnitsLabel
|
|
8133
8133
|
);
|
|
@@ -8158,7 +8158,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
8158
8158
|
const ticks = [];
|
|
8159
8159
|
for (let i = 0; i <= steps; i++) {
|
|
8160
8160
|
const val = range.min + range.span * i / steps;
|
|
8161
|
-
const y =
|
|
8161
|
+
const y = chunkTLGPM7SI_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8162
8162
|
ticks.push(
|
|
8163
8163
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8164
8164
|
"line",
|
|
@@ -8185,7 +8185,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
8185
8185
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
8186
8186
|
for (let i = 0; i <= steps; i++) {
|
|
8187
8187
|
const val = range.min + range.span * i / steps;
|
|
8188
|
-
const y =
|
|
8188
|
+
const y = chunkTLGPM7SI_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8189
8189
|
lines.push(
|
|
8190
8190
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8191
8191
|
"line",
|
|
@@ -8346,7 +8346,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
8346
8346
|
width: 8,
|
|
8347
8347
|
height: 8,
|
|
8348
8348
|
borderRadius: 2,
|
|
8349
|
-
backgroundColor:
|
|
8349
|
+
backgroundColor: chunkTLGPM7SI_js.seriesColor(
|
|
8350
8350
|
s,
|
|
8351
8351
|
si,
|
|
8352
8352
|
chartData.style?.styleId,
|
|
@@ -8385,8 +8385,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
8385
8385
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
8386
8386
|
const style = chartData.style;
|
|
8387
8387
|
const legendPos = style?.legendPosition || "b";
|
|
8388
|
-
const range =
|
|
8389
|
-
const layout =
|
|
8388
|
+
const range = chunkTLGPM7SI_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8389
|
+
const layout = chunkTLGPM7SI_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8390
8390
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8391
8391
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
8392
8392
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -8407,10 +8407,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
8407
8407
|
const close = closeSeries.values[ci] ?? high;
|
|
8408
8408
|
const isUp = close >= open;
|
|
8409
8409
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
8410
|
-
const highY =
|
|
8411
|
-
const lowY =
|
|
8412
|
-
const openY =
|
|
8413
|
-
const closeY =
|
|
8410
|
+
const highY = chunkTLGPM7SI_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
8411
|
+
const lowY = chunkTLGPM7SI_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
8412
|
+
const openY = chunkTLGPM7SI_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
8413
|
+
const closeY = chunkTLGPM7SI_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
8414
8414
|
elements.push(
|
|
8415
8415
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8416
8416
|
"line",
|
|
@@ -8453,7 +8453,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
8453
8453
|
textAnchor: "middle",
|
|
8454
8454
|
fontSize: 7,
|
|
8455
8455
|
fill: "#334155",
|
|
8456
|
-
children:
|
|
8456
|
+
children: chunkTLGPM7SI_js.formatAxisValue(close)
|
|
8457
8457
|
},
|
|
8458
8458
|
`${element.id}-stock-dl-${ci}`
|
|
8459
8459
|
)
|
|
@@ -8495,7 +8495,7 @@ function FailedToLoad() {
|
|
|
8495
8495
|
var LazySurfaceChart3DScene = React3__default.default.lazy(
|
|
8496
8496
|
async () => {
|
|
8497
8497
|
try {
|
|
8498
|
-
return await import('./SurfaceChart3DScene-
|
|
8498
|
+
return await import('./SurfaceChart3DScene-MNFDDCYS.js');
|
|
8499
8499
|
} catch {
|
|
8500
8500
|
return { default: FailedToLoad };
|
|
8501
8501
|
}
|
|
@@ -8519,7 +8519,7 @@ var SurfaceChart3DErrorBoundary = class extends React3__default.default.Componen
|
|
|
8519
8519
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
8520
8520
|
const rows = chartData.series.length;
|
|
8521
8521
|
const cols = Math.max(categoryLabels.length, 1);
|
|
8522
|
-
const range =
|
|
8522
|
+
const range = chunkTLGPM7SI_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8523
8523
|
const heightMap = new Float32Array(rows * cols);
|
|
8524
8524
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
8525
8525
|
for (let r = 0; r < rows; r++) {
|
|
@@ -8639,8 +8639,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
8639
8639
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
8640
8640
|
const style = chartData.style;
|
|
8641
8641
|
const legendPos = style?.legendPosition || "b";
|
|
8642
|
-
const layout =
|
|
8643
|
-
const range =
|
|
8642
|
+
const layout = chunkTLGPM7SI_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
8643
|
+
const range = chunkTLGPM7SI_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8644
8644
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8645
8645
|
const seriesCount = chartData.series.length;
|
|
8646
8646
|
const cols = catCount - 1;
|
|
@@ -8730,8 +8730,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
8730
8730
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
8731
8731
|
const style = chartData.style;
|
|
8732
8732
|
const legendPos = style?.legendPosition || "b";
|
|
8733
|
-
const layout =
|
|
8734
|
-
const range =
|
|
8733
|
+
const layout = chunkTLGPM7SI_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8734
|
+
const range = chunkTLGPM7SI_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8735
8735
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8736
8736
|
const seriesCount = chartData.series.length;
|
|
8737
8737
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -8794,7 +8794,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
8794
8794
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
8795
8795
|
const style = chartData.style;
|
|
8796
8796
|
const legendPos = style?.legendPosition || "b";
|
|
8797
|
-
const layout =
|
|
8797
|
+
const layout = chunkTLGPM7SI_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
8798
8798
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
8799
8799
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
8800
8800
|
const rects = [];
|
|
@@ -8817,7 +8817,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
8817
8817
|
y: curY,
|
|
8818
8818
|
width: Math.max(w - 1, 1),
|
|
8819
8819
|
height: Math.max(h - 1, 1),
|
|
8820
|
-
fill:
|
|
8820
|
+
fill: chunkTLGPM7SI_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
8821
8821
|
rx: 2,
|
|
8822
8822
|
opacity: 0.85
|
|
8823
8823
|
},
|
|
@@ -8870,8 +8870,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8870
8870
|
const style = chartData.style;
|
|
8871
8871
|
const legendPos = style?.legendPosition || "b";
|
|
8872
8872
|
const values = chartData.series[0]?.values ?? [];
|
|
8873
|
-
const range =
|
|
8874
|
-
const layout =
|
|
8873
|
+
const range = chunkTLGPM7SI_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8874
|
+
const layout = chunkTLGPM7SI_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8875
8875
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
8876
8876
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
8877
8877
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -8882,8 +8882,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8882
8882
|
const isLast = i === values.length - 1;
|
|
8883
8883
|
const startVal = isLast ? 0 : runningTotal;
|
|
8884
8884
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
8885
|
-
const barStartY =
|
|
8886
|
-
const barEndY =
|
|
8885
|
+
const barStartY = chunkTLGPM7SI_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
8886
|
+
const barEndY = chunkTLGPM7SI_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
8887
8887
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
8888
8888
|
const y = Math.min(barStartY, barEndY);
|
|
8889
8889
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -8912,7 +8912,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8912
8912
|
textAnchor: "middle",
|
|
8913
8913
|
fontSize: 7,
|
|
8914
8914
|
fill: "#334155",
|
|
8915
|
-
children:
|
|
8915
|
+
children: chunkTLGPM7SI_js.formatAxisValue(isLast ? endVal : val)
|
|
8916
8916
|
},
|
|
8917
8917
|
`${element.id}-wf-dl-${i}`
|
|
8918
8918
|
)
|
|
@@ -8960,18 +8960,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
8960
8960
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
8961
8961
|
const style = chartData.style;
|
|
8962
8962
|
const legendPos = style?.legendPosition || "b";
|
|
8963
|
-
const layoutOpts =
|
|
8963
|
+
const layoutOpts = chunkTLGPM7SI_js.computeLayoutOptions(
|
|
8964
8964
|
chartData.axes,
|
|
8965
8965
|
chartData.dataTable,
|
|
8966
8966
|
chartData.series.length
|
|
8967
8967
|
);
|
|
8968
|
-
const layout =
|
|
8969
|
-
const { primary, secondary } =
|
|
8968
|
+
const layout = chunkTLGPM7SI_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
8969
|
+
const { primary, secondary } = chunkTLGPM7SI_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
8970
8970
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
8971
8971
|
const secondarySeries = secondary.map((e) => e.series);
|
|
8972
|
-
const range =
|
|
8973
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
8974
|
-
const secondaryAxisFmt =
|
|
8972
|
+
const range = chunkTLGPM7SI_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
8973
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkTLGPM7SI_js.computeValueRange(secondarySeries) : void 0;
|
|
8974
|
+
const secondaryAxisFmt = chunkTLGPM7SI_js.getSecondaryValueAxis(chartData.axes);
|
|
8975
8975
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8976
8976
|
const barSeriesCount = 1;
|
|
8977
8977
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -8987,8 +8987,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
8987
8987
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
8988
8988
|
barSeries.values.forEach((val, vi) => {
|
|
8989
8989
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
8990
|
-
const zeroY =
|
|
8991
|
-
const valY =
|
|
8990
|
+
const zeroY = chunkTLGPM7SI_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
8991
|
+
const valY = chunkTLGPM7SI_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
8992
8992
|
const y = Math.min(zeroY, valY);
|
|
8993
8993
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
8994
8994
|
barElements.push(
|
|
@@ -8999,7 +8999,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
8999
8999
|
y,
|
|
9000
9000
|
width: barWidth,
|
|
9001
9001
|
height: h,
|
|
9002
|
-
fill:
|
|
9002
|
+
fill: chunkTLGPM7SI_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
9003
9003
|
rx: 1
|
|
9004
9004
|
},
|
|
9005
9005
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -9015,7 +9015,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9015
9015
|
textAnchor: "middle",
|
|
9016
9016
|
fontSize: 7,
|
|
9017
9017
|
fill: "#334155",
|
|
9018
|
-
children:
|
|
9018
|
+
children: chunkTLGPM7SI_js.formatAxisValue(val)
|
|
9019
9019
|
},
|
|
9020
9020
|
`${element.id}-combo-bar-dl-${vi}`
|
|
9021
9021
|
)
|
|
@@ -9032,10 +9032,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9032
9032
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
9033
9033
|
const points = series.values.map((val, vi) => {
|
|
9034
9034
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
9035
|
-
const y =
|
|
9035
|
+
const y = chunkTLGPM7SI_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
9036
9036
|
return { x, y, val };
|
|
9037
9037
|
});
|
|
9038
|
-
const c =
|
|
9038
|
+
const c = chunkTLGPM7SI_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
9039
9039
|
lineElements.push(
|
|
9040
9040
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9041
9041
|
"polyline",
|
|
@@ -9062,7 +9062,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9062
9062
|
textAnchor: "middle",
|
|
9063
9063
|
fontSize: 7,
|
|
9064
9064
|
fill: "#334155",
|
|
9065
|
-
children:
|
|
9065
|
+
children: chunkTLGPM7SI_js.formatAxisValue(p.val)
|
|
9066
9066
|
},
|
|
9067
9067
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
9068
9068
|
)
|
|
@@ -10816,14 +10816,14 @@ function buildNotesPdf(pages) {
|
|
|
10816
10816
|
notes: page.notes,
|
|
10817
10817
|
slideNumber: page.slideNumber
|
|
10818
10818
|
}));
|
|
10819
|
-
const bytes =
|
|
10819
|
+
const bytes = chunkTLGPM7SI_js.buildNotesPdfBytes(images, meta);
|
|
10820
10820
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
10821
10821
|
return URL.createObjectURL(blob);
|
|
10822
10822
|
}
|
|
10823
10823
|
|
|
10824
10824
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
10825
10825
|
function buildPdfFromImageData(images) {
|
|
10826
|
-
const bytes =
|
|
10826
|
+
const bytes = chunkTLGPM7SI_js.buildSlidesPdfBytes(images);
|
|
10827
10827
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
10828
10828
|
return URL.createObjectURL(blob);
|
|
10829
10829
|
}
|
|
@@ -10832,7 +10832,7 @@ function buildPdfFromImageData(images) {
|
|
|
10832
10832
|
var activePreview = null;
|
|
10833
10833
|
function startPreviewAnimation(elementId, preset, options) {
|
|
10834
10834
|
stopPreviewAnimation();
|
|
10835
|
-
const descriptor =
|
|
10835
|
+
const descriptor = chunkTLGPM7SI_js.buildPreviewAnimation(preset, options);
|
|
10836
10836
|
if (!descriptor) {
|
|
10837
10837
|
return;
|
|
10838
10838
|
}
|
|
@@ -11270,7 +11270,7 @@ function useElementOperations(input) {
|
|
|
11270
11270
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
11271
11271
|
const updateElementById = React3.useCallback(
|
|
11272
11272
|
(elementId, updates) => {
|
|
11273
|
-
if (
|
|
11273
|
+
if (chunkTLGPM7SI_js.isTemplateElementId(elementId)) {
|
|
11274
11274
|
const slideId = activeSlide?.id;
|
|
11275
11275
|
if (slideId) {
|
|
11276
11276
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -11310,7 +11310,7 @@ function useElementOperations(input) {
|
|
|
11310
11310
|
);
|
|
11311
11311
|
const updateSelectedShapeStyle = React3.useCallback(
|
|
11312
11312
|
(updates) => {
|
|
11313
|
-
if (!selectedElement || !
|
|
11313
|
+
if (!selectedElement || !chunkVMQLQEGG_js.hasShapeProperties(selectedElement)) {
|
|
11314
11314
|
return;
|
|
11315
11315
|
}
|
|
11316
11316
|
updateSelectedElement({
|
|
@@ -11321,17 +11321,17 @@ function useElementOperations(input) {
|
|
|
11321
11321
|
);
|
|
11322
11322
|
const updateSelectedTextStyle = React3.useCallback(
|
|
11323
11323
|
(updates) => {
|
|
11324
|
-
if (!selectedElement || !
|
|
11324
|
+
if (!selectedElement || !chunkVMQLQEGG_js.hasTextProperties(selectedElement)) {
|
|
11325
11325
|
return;
|
|
11326
11326
|
}
|
|
11327
|
-
const inlineSel =
|
|
11327
|
+
const inlineSel = chunkTLGPM7SI_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
11328
11328
|
if (inlineSel && selectedElement.textSegments) {
|
|
11329
|
-
const { newSegments: newSegments2, newSelection } =
|
|
11329
|
+
const { newSegments: newSegments2, newSelection } = chunkTLGPM7SI_js.applyStyleToSelectedSegments(
|
|
11330
11330
|
selectedElement.textSegments,
|
|
11331
11331
|
inlineSel,
|
|
11332
11332
|
updates
|
|
11333
11333
|
);
|
|
11334
|
-
|
|
11334
|
+
chunkTLGPM7SI_js.setPendingSelectionRestore(newSelection);
|
|
11335
11335
|
updateSelectedElement({
|
|
11336
11336
|
textSegments: newSegments2
|
|
11337
11337
|
});
|
|
@@ -11351,12 +11351,12 @@ function useElementOperations(input) {
|
|
|
11351
11351
|
);
|
|
11352
11352
|
const updateSelectedTextCase = React3.useCallback(
|
|
11353
11353
|
(mode) => {
|
|
11354
|
-
if (!selectedElement || !
|
|
11354
|
+
if (!selectedElement || !chunkVMQLQEGG_js.hasTextProperties(selectedElement)) {
|
|
11355
11355
|
return;
|
|
11356
11356
|
}
|
|
11357
|
-
const inlineSel =
|
|
11357
|
+
const inlineSel = chunkTLGPM7SI_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
11358
11358
|
if (inlineSel && selectedElement.textSegments) {
|
|
11359
|
-
const newSegments =
|
|
11359
|
+
const newSegments = chunkTLGPM7SI_js.applyCaseTransformToSegments(
|
|
11360
11360
|
selectedElement.textSegments,
|
|
11361
11361
|
inlineSel,
|
|
11362
11362
|
mode
|
|
@@ -11366,14 +11366,14 @@ function useElementOperations(input) {
|
|
|
11366
11366
|
}
|
|
11367
11367
|
const updates = {};
|
|
11368
11368
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
11369
|
-
updates.textSegments =
|
|
11369
|
+
updates.textSegments = chunkTLGPM7SI_js.applyCaseTransformToSegments(
|
|
11370
11370
|
selectedElement.textSegments,
|
|
11371
11371
|
null,
|
|
11372
11372
|
mode
|
|
11373
11373
|
);
|
|
11374
11374
|
}
|
|
11375
11375
|
if (typeof selectedElement.text === "string") {
|
|
11376
|
-
updates.text =
|
|
11376
|
+
updates.text = chunkTLGPM7SI_js.transformTextCase(selectedElement.text, mode);
|
|
11377
11377
|
}
|
|
11378
11378
|
updateSelectedElement(updates);
|
|
11379
11379
|
},
|
|
@@ -11428,7 +11428,7 @@ function useSectionOperations(input) {
|
|
|
11428
11428
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
11429
11429
|
const addSection2 = React3.useCallback(
|
|
11430
11430
|
(name, afterSlideIndex) => {
|
|
11431
|
-
const result =
|
|
11431
|
+
const result = chunkTLGPM7SI_js.addSection(sections, slides, name, afterSlideIndex);
|
|
11432
11432
|
setSlides(result.slides);
|
|
11433
11433
|
setSections(result.sections);
|
|
11434
11434
|
markDirty();
|
|
@@ -11437,7 +11437,7 @@ function useSectionOperations(input) {
|
|
|
11437
11437
|
);
|
|
11438
11438
|
const renameSection2 = React3.useCallback(
|
|
11439
11439
|
(sectionId, newName) => {
|
|
11440
|
-
const result =
|
|
11440
|
+
const result = chunkTLGPM7SI_js.renameSection(sections, slides, sectionId, newName);
|
|
11441
11441
|
setSections(result.sections);
|
|
11442
11442
|
setSlides(result.slides);
|
|
11443
11443
|
markDirty();
|
|
@@ -11446,7 +11446,7 @@ function useSectionOperations(input) {
|
|
|
11446
11446
|
);
|
|
11447
11447
|
const deleteSection2 = React3.useCallback(
|
|
11448
11448
|
(sectionId) => {
|
|
11449
|
-
const result =
|
|
11449
|
+
const result = chunkTLGPM7SI_js.deleteSection(sections, slides, sectionId);
|
|
11450
11450
|
setSections(result.sections);
|
|
11451
11451
|
setSlides(result.slides);
|
|
11452
11452
|
markDirty();
|
|
@@ -11455,21 +11455,21 @@ function useSectionOperations(input) {
|
|
|
11455
11455
|
);
|
|
11456
11456
|
const moveSectionUp2 = React3.useCallback(
|
|
11457
11457
|
(sectionId) => {
|
|
11458
|
-
setSections(
|
|
11458
|
+
setSections(chunkTLGPM7SI_js.moveSectionUp(sections, sectionId));
|
|
11459
11459
|
markDirty();
|
|
11460
11460
|
},
|
|
11461
11461
|
[sections, setSections, markDirty]
|
|
11462
11462
|
);
|
|
11463
11463
|
const moveSectionDown2 = React3.useCallback(
|
|
11464
11464
|
(sectionId) => {
|
|
11465
|
-
setSections(
|
|
11465
|
+
setSections(chunkTLGPM7SI_js.moveSectionDown(sections, sectionId));
|
|
11466
11466
|
markDirty();
|
|
11467
11467
|
},
|
|
11468
11468
|
[sections, setSections, markDirty]
|
|
11469
11469
|
);
|
|
11470
11470
|
const moveSlidesToSection2 = React3.useCallback(
|
|
11471
11471
|
(slideIndexes, targetSectionId) => {
|
|
11472
|
-
const result =
|
|
11472
|
+
const result = chunkTLGPM7SI_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
11473
11473
|
setSlides(result.slides);
|
|
11474
11474
|
setSections(result.sections);
|
|
11475
11475
|
markDirty();
|
|
@@ -11488,7 +11488,7 @@ function useSectionOperations(input) {
|
|
|
11488
11488
|
|
|
11489
11489
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
11490
11490
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
11491
|
-
const resized =
|
|
11491
|
+
const resized = chunkTLGPM7SI_js.applyResize(
|
|
11492
11492
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
11493
11493
|
handle,
|
|
11494
11494
|
dx,
|
|
@@ -11500,7 +11500,7 @@ function computeResizeGeometry(handle, startX, startY, startWidth, startHeight,
|
|
|
11500
11500
|
if (!snapToGrid) {
|
|
11501
11501
|
return box;
|
|
11502
11502
|
}
|
|
11503
|
-
return
|
|
11503
|
+
return chunkTLGPM7SI_js.snapBoxToGrid(box, handle, gridSpacingPx, MIN_ELEMENT_SIZE);
|
|
11504
11504
|
}
|
|
11505
11505
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
11506
11506
|
const range = startWidth || 200;
|
|
@@ -11610,7 +11610,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
11610
11610
|
width: el.width,
|
|
11611
11611
|
height: el.height
|
|
11612
11612
|
}));
|
|
11613
|
-
const snapResult =
|
|
11613
|
+
const snapResult = chunkTLGPM7SI_js.computeSnapToShape(
|
|
11614
11614
|
targetX,
|
|
11615
11615
|
targetY,
|
|
11616
11616
|
primaryEl.width,
|
|
@@ -11753,13 +11753,13 @@ function processPointerUp(input) {
|
|
|
11753
11753
|
if (i !== activeSlideIndex) {
|
|
11754
11754
|
return s;
|
|
11755
11755
|
}
|
|
11756
|
-
const rerouted =
|
|
11756
|
+
const rerouted = chunkTLGPM7SI_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
11757
11757
|
if (rerouted.length === 0) {
|
|
11758
11758
|
return s;
|
|
11759
11759
|
}
|
|
11760
11760
|
return {
|
|
11761
11761
|
...s,
|
|
11762
|
-
elements:
|
|
11762
|
+
elements: chunkTLGPM7SI_js.applyReroutedConnectors(s.elements, rerouted)
|
|
11763
11763
|
};
|
|
11764
11764
|
})
|
|
11765
11765
|
);
|
|
@@ -11778,9 +11778,9 @@ function processPointerUp(input) {
|
|
|
11778
11778
|
}
|
|
11779
11779
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
11780
11780
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
11781
|
-
const hitIds =
|
|
11781
|
+
const hitIds = chunkTLGPM7SI_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
11782
11782
|
if (marquee.additive) {
|
|
11783
|
-
const merged =
|
|
11783
|
+
const merged = chunkTLGPM7SI_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
11784
11784
|
if (merged.length > 0) {
|
|
11785
11785
|
applySelection(merged[0], merged);
|
|
11786
11786
|
} else {
|
|
@@ -11803,8 +11803,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
11803
11803
|
}
|
|
11804
11804
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
11805
11805
|
});
|
|
11806
|
-
const rerouted =
|
|
11807
|
-
return
|
|
11806
|
+
const rerouted = chunkTLGPM7SI_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
11807
|
+
return chunkTLGPM7SI_js.applyReroutedConnectors(movedElements, rerouted);
|
|
11808
11808
|
};
|
|
11809
11809
|
if (editTemplateMode) {
|
|
11810
11810
|
const slideId = activeSlide?.id;
|
|
@@ -11954,8 +11954,8 @@ function useCanvasInteractions(input) {
|
|
|
11954
11954
|
return;
|
|
11955
11955
|
}
|
|
11956
11956
|
const el = elementLookup.get(editId);
|
|
11957
|
-
if (el &&
|
|
11958
|
-
const newSegments =
|
|
11957
|
+
if (el && chunkVMQLQEGG_js.hasTextProperties(el)) {
|
|
11958
|
+
const newSegments = chunkTLGPM7SI_js.remapTextToSegments(inlineEditingText, el.textSegments, el.textStyle);
|
|
11959
11959
|
ops.updateElementById(editId, {
|
|
11960
11960
|
text: inlineEditingText,
|
|
11961
11961
|
textSegments: newSegments
|
|
@@ -11966,7 +11966,7 @@ function useCanvasInteractions(input) {
|
|
|
11966
11966
|
setInlineEditingText("");
|
|
11967
11967
|
};
|
|
11968
11968
|
const openEquationEditorForElement = (el) => {
|
|
11969
|
-
if (!
|
|
11969
|
+
if (!chunkVMQLQEGG_js.hasTextProperties(el)) {
|
|
11970
11970
|
return false;
|
|
11971
11971
|
}
|
|
11972
11972
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -11995,7 +11995,7 @@ function useCanvasInteractions(input) {
|
|
|
11995
11995
|
justSelectedRef.current = false;
|
|
11996
11996
|
} else {
|
|
11997
11997
|
const el = elementLookup.get(elementId);
|
|
11998
|
-
if (el &&
|
|
11998
|
+
if (el && chunkVMQLQEGG_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
11999
11999
|
if (!openEquationEditorForElement(el)) {
|
|
12000
12000
|
setInlineEditingElementId(elementId);
|
|
12001
12001
|
setInlineEditingText(el.text ?? "");
|
|
@@ -12014,7 +12014,7 @@ function useCanvasInteractions(input) {
|
|
|
12014
12014
|
if (openEquationEditorForElement(el)) {
|
|
12015
12015
|
return;
|
|
12016
12016
|
}
|
|
12017
|
-
if (
|
|
12017
|
+
if (chunkVMQLQEGG_js.hasTextProperties(el)) {
|
|
12018
12018
|
setInlineEditingElementId(elementId);
|
|
12019
12019
|
setInlineEditingText(el.text ?? "");
|
|
12020
12020
|
}
|
|
@@ -12201,7 +12201,7 @@ function createFileHandlers(deps) {
|
|
|
12201
12201
|
h = Math.round(h * scale);
|
|
12202
12202
|
}
|
|
12203
12203
|
addElement({
|
|
12204
|
-
id:
|
|
12204
|
+
id: chunkTLGPM7SI_js.generateElementId(),
|
|
12205
12205
|
type: "image",
|
|
12206
12206
|
x: Math.round((canvasSize.width - w) / 2),
|
|
12207
12207
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -12212,7 +12212,7 @@ function createFileHandlers(deps) {
|
|
|
12212
12212
|
};
|
|
12213
12213
|
img.onerror = () => {
|
|
12214
12214
|
addElement({
|
|
12215
|
-
id:
|
|
12215
|
+
id: chunkTLGPM7SI_js.generateElementId(),
|
|
12216
12216
|
type: "image",
|
|
12217
12217
|
x: 100,
|
|
12218
12218
|
y: 100,
|
|
@@ -12238,7 +12238,7 @@ function createFileHandlers(deps) {
|
|
|
12238
12238
|
const elFilePath = file.path;
|
|
12239
12239
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
12240
12240
|
addElement({
|
|
12241
|
-
id:
|
|
12241
|
+
id: chunkTLGPM7SI_js.generateElementId(),
|
|
12242
12242
|
type: "media",
|
|
12243
12243
|
mediaType,
|
|
12244
12244
|
mediaMimeType: file.type || void 0,
|
|
@@ -12413,13 +12413,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
12413
12413
|
return;
|
|
12414
12414
|
}
|
|
12415
12415
|
addElement({
|
|
12416
|
-
id:
|
|
12416
|
+
id: chunkTLGPM7SI_js.generateElementId(),
|
|
12417
12417
|
type: "smartArt",
|
|
12418
12418
|
x: 100,
|
|
12419
12419
|
y: 120,
|
|
12420
12420
|
width: 600,
|
|
12421
12421
|
height: 340,
|
|
12422
|
-
smartArtData:
|
|
12422
|
+
smartArtData: chunkTLGPM7SI_js.buildSmartArtPresetData(
|
|
12423
12423
|
layout,
|
|
12424
12424
|
defaultItems,
|
|
12425
12425
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -12431,7 +12431,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12431
12431
|
return;
|
|
12432
12432
|
}
|
|
12433
12433
|
addElement({
|
|
12434
|
-
id:
|
|
12434
|
+
id: chunkTLGPM7SI_js.generateElementId(),
|
|
12435
12435
|
type: "shape",
|
|
12436
12436
|
x: 120,
|
|
12437
12437
|
y: 200,
|
|
@@ -12490,7 +12490,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12490
12490
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
12491
12491
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
12492
12492
|
addElement({
|
|
12493
|
-
id:
|
|
12493
|
+
id: chunkTLGPM7SI_js.generateElementId(),
|
|
12494
12494
|
type: "shape",
|
|
12495
12495
|
x: 120,
|
|
12496
12496
|
y: 200,
|
|
@@ -12512,11 +12512,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
12512
12512
|
if (!activeSlide) {
|
|
12513
12513
|
return;
|
|
12514
12514
|
}
|
|
12515
|
-
const preset =
|
|
12515
|
+
const preset = chunkTLGPM7SI_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
12516
12516
|
if (!preset) {
|
|
12517
12517
|
return;
|
|
12518
12518
|
}
|
|
12519
|
-
const defaultPptxAction =
|
|
12519
|
+
const defaultPptxAction = chunkVMQLQEGG_js.elementActionToPptxAction({
|
|
12520
12520
|
trigger: "click",
|
|
12521
12521
|
type: preset.defaultAction
|
|
12522
12522
|
});
|
|
@@ -12525,7 +12525,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12525
12525
|
defaultPptxAction.highlightClick = true;
|
|
12526
12526
|
}
|
|
12527
12527
|
addElement({
|
|
12528
|
-
id:
|
|
12528
|
+
id: chunkTLGPM7SI_js.generateElementId(),
|
|
12529
12529
|
type: "shape",
|
|
12530
12530
|
x: 150,
|
|
12531
12531
|
y: 150,
|
|
@@ -12592,7 +12592,7 @@ function useInsertElements(input) {
|
|
|
12592
12592
|
return;
|
|
12593
12593
|
}
|
|
12594
12594
|
addElement({
|
|
12595
|
-
id:
|
|
12595
|
+
id: chunkTLGPM7SI_js.generateElementId(),
|
|
12596
12596
|
type: "text",
|
|
12597
12597
|
x: 100,
|
|
12598
12598
|
y: 100,
|
|
@@ -12607,7 +12607,7 @@ function useInsertElements(input) {
|
|
|
12607
12607
|
return;
|
|
12608
12608
|
}
|
|
12609
12609
|
addElement({
|
|
12610
|
-
id:
|
|
12610
|
+
id: chunkTLGPM7SI_js.generateElementId(),
|
|
12611
12611
|
type: "shape",
|
|
12612
12612
|
x: 150,
|
|
12613
12613
|
y: 150,
|
|
@@ -12626,15 +12626,15 @@ function useInsertElements(input) {
|
|
|
12626
12626
|
return;
|
|
12627
12627
|
}
|
|
12628
12628
|
addElement({
|
|
12629
|
-
...
|
|
12630
|
-
id:
|
|
12629
|
+
...chunkTLGPM7SI_js.newTableElement(DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
12630
|
+
id: chunkTLGPM7SI_js.generateElementId()
|
|
12631
12631
|
});
|
|
12632
12632
|
};
|
|
12633
12633
|
const handleAddChart = (chartType) => {
|
|
12634
12634
|
if (!activeSlide) {
|
|
12635
12635
|
return;
|
|
12636
12636
|
}
|
|
12637
|
-
addElement(
|
|
12637
|
+
addElement(chunkTLGPM7SI_js.createDefaultChartElement(chartType));
|
|
12638
12638
|
};
|
|
12639
12639
|
const structured = createStructuredElementHandlers({
|
|
12640
12640
|
activeSlide,
|
|
@@ -12704,7 +12704,7 @@ function useClipboardHandlers(input) {
|
|
|
12704
12704
|
if (!selectedElement) {
|
|
12705
12705
|
return;
|
|
12706
12706
|
}
|
|
12707
|
-
setClipboardPayload(
|
|
12707
|
+
setClipboardPayload(chunkTLGPM7SI_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
12708
12708
|
};
|
|
12709
12709
|
const handleDelete = () => {
|
|
12710
12710
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -12721,7 +12721,7 @@ function useClipboardHandlers(input) {
|
|
|
12721
12721
|
handleDelete();
|
|
12722
12722
|
};
|
|
12723
12723
|
const insertClone = (source) => {
|
|
12724
|
-
const clone =
|
|
12724
|
+
const clone = chunkTLGPM7SI_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
12725
12725
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
12726
12726
|
ops.applySelection(clone.id);
|
|
12727
12727
|
history.markDirty();
|
|
@@ -12756,7 +12756,7 @@ function resolveShapePath(el) {
|
|
|
12756
12756
|
return el.pathData;
|
|
12757
12757
|
}
|
|
12758
12758
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
12759
|
-
const clipPath =
|
|
12759
|
+
const clipPath = chunkVMQLQEGG_js.getPresetShapeClipPath(el.shapeType);
|
|
12760
12760
|
if (clipPath) {
|
|
12761
12761
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
12762
12762
|
if (svgPath) {
|
|
@@ -12807,7 +12807,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
12807
12807
|
return parts.join(" ");
|
|
12808
12808
|
}
|
|
12809
12809
|
function transformPathToGlobal(pathData, el) {
|
|
12810
|
-
const polys =
|
|
12810
|
+
const polys = chunkVMQLQEGG_js.svgPathToPolygons(pathData);
|
|
12811
12811
|
if (polys.length === 0) {
|
|
12812
12812
|
return pathData;
|
|
12813
12813
|
}
|
|
@@ -12827,10 +12827,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
12827
12827
|
y: pt.y * scaleY + el.y
|
|
12828
12828
|
}))
|
|
12829
12829
|
);
|
|
12830
|
-
return
|
|
12830
|
+
return chunkVMQLQEGG_js.polygonsToSvgPath(transformed);
|
|
12831
12831
|
}
|
|
12832
12832
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
12833
|
-
const polys =
|
|
12833
|
+
const polys = chunkVMQLQEGG_js.svgPathToPolygons(pathData);
|
|
12834
12834
|
if (polys.length === 0) {
|
|
12835
12835
|
return pathData;
|
|
12836
12836
|
}
|
|
@@ -12840,10 +12840,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
12840
12840
|
y: pt.y - y
|
|
12841
12841
|
}))
|
|
12842
12842
|
);
|
|
12843
|
-
return
|
|
12843
|
+
return chunkVMQLQEGG_js.polygonsToSvgPath(transformed);
|
|
12844
12844
|
}
|
|
12845
12845
|
function pathBounds(pathData) {
|
|
12846
|
-
const polys =
|
|
12846
|
+
const polys = chunkVMQLQEGG_js.svgPathToPolygons(pathData);
|
|
12847
12847
|
let minX = Infinity;
|
|
12848
12848
|
let minY = Infinity;
|
|
12849
12849
|
let maxX = -Infinity;
|
|
@@ -12902,7 +12902,7 @@ function useMergeShapesHandler(input) {
|
|
|
12902
12902
|
let allFragments = [];
|
|
12903
12903
|
let remaining = globalPaths[0];
|
|
12904
12904
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
12905
|
-
const frags =
|
|
12905
|
+
const frags = chunkVMQLQEGG_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
12906
12906
|
if (Array.isArray(frags)) {
|
|
12907
12907
|
allFragments = frags;
|
|
12908
12908
|
}
|
|
@@ -12931,7 +12931,7 @@ function useMergeShapesHandler(input) {
|
|
|
12931
12931
|
bounds.height
|
|
12932
12932
|
);
|
|
12933
12933
|
const newEl = {
|
|
12934
|
-
id:
|
|
12934
|
+
id: chunkTLGPM7SI_js.generateElementId(),
|
|
12935
12935
|
type: "shape",
|
|
12936
12936
|
x: bounds.x,
|
|
12937
12937
|
y: bounds.y,
|
|
@@ -12969,7 +12969,7 @@ function useMergeShapesHandler(input) {
|
|
|
12969
12969
|
} else {
|
|
12970
12970
|
let resultPath = globalPaths[0];
|
|
12971
12971
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
12972
|
-
const result =
|
|
12972
|
+
const result = chunkVMQLQEGG_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
12973
12973
|
if (typeof result === "string") {
|
|
12974
12974
|
resultPath = result;
|
|
12975
12975
|
}
|
|
@@ -12990,7 +12990,7 @@ function useMergeShapesHandler(input) {
|
|
|
12990
12990
|
);
|
|
12991
12991
|
const primary = targets[0];
|
|
12992
12992
|
const newEl = {
|
|
12993
|
-
id:
|
|
12993
|
+
id: chunkTLGPM7SI_js.generateElementId(),
|
|
12994
12994
|
type: "shape",
|
|
12995
12995
|
x: bounds.x,
|
|
12996
12996
|
y: bounds.y,
|
|
@@ -13053,7 +13053,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13053
13053
|
if (ids.length < 2 || !activeSlide) {
|
|
13054
13054
|
return;
|
|
13055
13055
|
}
|
|
13056
|
-
const { elements, groupId } =
|
|
13056
|
+
const { elements, groupId } = chunkTLGPM7SI_js.groupElements(ops.activeElements, ids, chunkTLGPM7SI_js.generateElementId());
|
|
13057
13057
|
if (groupId === null) {
|
|
13058
13058
|
return;
|
|
13059
13059
|
}
|
|
@@ -13066,12 +13066,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13066
13066
|
return;
|
|
13067
13067
|
}
|
|
13068
13068
|
const group = selectedElement;
|
|
13069
|
-
const intoTemplate =
|
|
13069
|
+
const intoTemplate = chunkTLGPM7SI_js.isTemplateElementId(group.id);
|
|
13070
13070
|
const ungrouped = group.children.map((child) => ({
|
|
13071
13071
|
...structuredClone(child),
|
|
13072
13072
|
// Keep child ids in the same store as the group so later edits route
|
|
13073
13073
|
// correctly: template groups yield template-prefixed child ids.
|
|
13074
|
-
id: intoTemplate ?
|
|
13074
|
+
id: intoTemplate ? chunkTLGPM7SI_js.makeCloneId(true, child.id || group.id) : child.id || chunkTLGPM7SI_js.generateElementId(),
|
|
13075
13075
|
x: child.x + group.x,
|
|
13076
13076
|
y: child.y + group.y
|
|
13077
13077
|
}));
|
|
@@ -13095,7 +13095,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13095
13095
|
if (!edge) {
|
|
13096
13096
|
return;
|
|
13097
13097
|
}
|
|
13098
|
-
const positions =
|
|
13098
|
+
const positions = chunkTLGPM7SI_js.alignElements(selectedElements, edge);
|
|
13099
13099
|
for (const [id, pos] of positions) {
|
|
13100
13100
|
const el = elementLookup.get(id);
|
|
13101
13101
|
if (!el) {
|
|
@@ -13113,7 +13113,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13113
13113
|
if (!distAxis) {
|
|
13114
13114
|
return;
|
|
13115
13115
|
}
|
|
13116
|
-
const positions =
|
|
13116
|
+
const positions = chunkTLGPM7SI_js.distributeElements(selectedElements, distAxis);
|
|
13117
13117
|
for (const [id, pos] of positions) {
|
|
13118
13118
|
const el = elementLookup.get(id);
|
|
13119
13119
|
if (!el) {
|
|
@@ -13130,7 +13130,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13130
13130
|
}
|
|
13131
13131
|
const id = selectedElement.id;
|
|
13132
13132
|
ops.updateActiveElements(
|
|
13133
|
-
(els) => direction === "forward" ?
|
|
13133
|
+
(els) => direction === "forward" ? chunkTLGPM7SI_js.bringForward(els, id) : direction === "backward" ? chunkTLGPM7SI_js.sendBackward(els, id) : els
|
|
13134
13134
|
);
|
|
13135
13135
|
history.markDirty();
|
|
13136
13136
|
};
|
|
@@ -13140,7 +13140,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13140
13140
|
}
|
|
13141
13141
|
const id = selectedElement.id;
|
|
13142
13142
|
ops.updateActiveElements(
|
|
13143
|
-
(els) => direction === "front" ?
|
|
13143
|
+
(els) => direction === "front" ? chunkTLGPM7SI_js.bringToFront(els, id) : chunkTLGPM7SI_js.sendToBack(els, id)
|
|
13144
13144
|
);
|
|
13145
13145
|
history.markDirty();
|
|
13146
13146
|
};
|
|
@@ -13262,7 +13262,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
13262
13262
|
function useSlideManagement(input) {
|
|
13263
13263
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
13264
13264
|
const handleAddSlide = () => {
|
|
13265
|
-
const newSlide =
|
|
13265
|
+
const newSlide = chunkTLGPM7SI_js.createBlankSlide(slides.length + 1);
|
|
13266
13266
|
ops.updateSlides((prev) => {
|
|
13267
13267
|
const next = [...prev];
|
|
13268
13268
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -13325,7 +13325,7 @@ function useSlideManagement(input) {
|
|
|
13325
13325
|
}
|
|
13326
13326
|
const clone = {
|
|
13327
13327
|
...src,
|
|
13328
|
-
id:
|
|
13328
|
+
id: chunkTLGPM7SI_js.makeSlideId(),
|
|
13329
13329
|
elements: src.elements.map((el) => ({
|
|
13330
13330
|
...el,
|
|
13331
13331
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -13357,7 +13357,7 @@ function useSlideManagement(input) {
|
|
|
13357
13357
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
13358
13358
|
const insertAt = activeSlideIndex + 1;
|
|
13359
13359
|
const draft = {
|
|
13360
|
-
...
|
|
13360
|
+
...chunkTLGPM7SI_js.createBlankSlide(slides.length + 1),
|
|
13361
13361
|
layoutPath,
|
|
13362
13362
|
...layoutName ? { layoutName } : {}
|
|
13363
13363
|
};
|
|
@@ -13418,7 +13418,7 @@ function createTableMergeHandlers(input) {
|
|
|
13418
13418
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
13419
13419
|
return;
|
|
13420
13420
|
}
|
|
13421
|
-
const newTableData =
|
|
13421
|
+
const newTableData = chunkTLGPM7SI_js.mergeCells(
|
|
13422
13422
|
[
|
|
13423
13423
|
{ row: rowIndex, col: columnIndex },
|
|
13424
13424
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -13426,7 +13426,7 @@ function createTableMergeHandlers(input) {
|
|
|
13426
13426
|
td
|
|
13427
13427
|
);
|
|
13428
13428
|
const updates = { tableData: newTableData };
|
|
13429
|
-
const newRawXml =
|
|
13429
|
+
const newRawXml = chunkVMQLQEGG_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13430
13430
|
if (newRawXml) {
|
|
13431
13431
|
updates.rawXml = newRawXml;
|
|
13432
13432
|
}
|
|
@@ -13452,7 +13452,7 @@ function createTableMergeHandlers(input) {
|
|
|
13452
13452
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
13453
13453
|
return;
|
|
13454
13454
|
}
|
|
13455
|
-
const newTableData =
|
|
13455
|
+
const newTableData = chunkTLGPM7SI_js.mergeCells(
|
|
13456
13456
|
[
|
|
13457
13457
|
{ row: rowIndex, col: columnIndex },
|
|
13458
13458
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -13460,7 +13460,7 @@ function createTableMergeHandlers(input) {
|
|
|
13460
13460
|
td
|
|
13461
13461
|
);
|
|
13462
13462
|
const updates = { tableData: newTableData };
|
|
13463
|
-
const newRawXml =
|
|
13463
|
+
const newRawXml = chunkVMQLQEGG_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13464
13464
|
if (newRawXml) {
|
|
13465
13465
|
updates.rawXml = newRawXml;
|
|
13466
13466
|
}
|
|
@@ -13475,9 +13475,9 @@ function createTableMergeHandlers(input) {
|
|
|
13475
13475
|
return;
|
|
13476
13476
|
}
|
|
13477
13477
|
const td = selectedElement.tableData;
|
|
13478
|
-
const newTableData =
|
|
13478
|
+
const newTableData = chunkTLGPM7SI_js.mergeCells(ts.selectedCells, td);
|
|
13479
13479
|
const updates = { tableData: newTableData };
|
|
13480
|
-
const newRawXml =
|
|
13480
|
+
const newRawXml = chunkVMQLQEGG_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13481
13481
|
if (newRawXml) {
|
|
13482
13482
|
updates.rawXml = newRawXml;
|
|
13483
13483
|
}
|
|
@@ -13494,9 +13494,9 @@ function createTableMergeHandlers(input) {
|
|
|
13494
13494
|
}
|
|
13495
13495
|
const { rowIndex, columnIndex } = ts;
|
|
13496
13496
|
const td = selectedElement.tableData;
|
|
13497
|
-
const newTableData =
|
|
13497
|
+
const newTableData = chunkTLGPM7SI_js.splitCell(rowIndex, columnIndex, td);
|
|
13498
13498
|
const updates = { tableData: newTableData };
|
|
13499
|
-
const newRawXml =
|
|
13499
|
+
const newRawXml = chunkVMQLQEGG_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13500
13500
|
if (newRawXml) {
|
|
13501
13501
|
updates.rawXml = newRawXml;
|
|
13502
13502
|
}
|
|
@@ -13540,7 +13540,7 @@ function createTableStructHandlers(input) {
|
|
|
13540
13540
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
13541
13541
|
}
|
|
13542
13542
|
if (el.rawXml) {
|
|
13543
|
-
const newRawXml =
|
|
13543
|
+
const newRawXml = chunkVMQLQEGG_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
13544
13544
|
if (newRawXml) {
|
|
13545
13545
|
updates.rawXml = newRawXml;
|
|
13546
13546
|
}
|
|
@@ -13564,7 +13564,7 @@ function createTableStructHandlers(input) {
|
|
|
13564
13564
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
13565
13565
|
const updates = {};
|
|
13566
13566
|
if (selectedElement.rawXml) {
|
|
13567
|
-
const newRawXml =
|
|
13567
|
+
const newRawXml = chunkVMQLQEGG_js.updateCellTextStyleInRawXml(
|
|
13568
13568
|
selectedElement,
|
|
13569
13569
|
rowIndex,
|
|
13570
13570
|
colIndex,
|
|
@@ -13628,9 +13628,9 @@ function createTableStructHandlers(input) {
|
|
|
13628
13628
|
return;
|
|
13629
13629
|
}
|
|
13630
13630
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
13631
|
-
const newTableData =
|
|
13631
|
+
const newTableData = chunkTLGPM7SI_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
13632
13632
|
const updates = { tableData: newTableData };
|
|
13633
|
-
const newRawXml =
|
|
13633
|
+
const newRawXml = chunkVMQLQEGG_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13634
13634
|
if (newRawXml) {
|
|
13635
13635
|
updates.rawXml = newRawXml;
|
|
13636
13636
|
}
|
|
@@ -13643,12 +13643,12 @@ function createTableStructHandlers(input) {
|
|
|
13643
13643
|
}
|
|
13644
13644
|
const td = selectedElement.tableData;
|
|
13645
13645
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
13646
|
-
const newTableData =
|
|
13646
|
+
const newTableData = chunkTLGPM7SI_js.deleteTableRow(td, rowIdx);
|
|
13647
13647
|
if (newTableData === td) {
|
|
13648
13648
|
return;
|
|
13649
13649
|
}
|
|
13650
13650
|
const updates = { tableData: newTableData };
|
|
13651
|
-
const newRawXml =
|
|
13651
|
+
const newRawXml = chunkVMQLQEGG_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13652
13652
|
if (newRawXml) {
|
|
13653
13653
|
updates.rawXml = newRawXml;
|
|
13654
13654
|
}
|
|
@@ -13660,9 +13660,9 @@ function createTableStructHandlers(input) {
|
|
|
13660
13660
|
return;
|
|
13661
13661
|
}
|
|
13662
13662
|
const colIdx = ts?.columnIndex ?? 0;
|
|
13663
|
-
const newTableData =
|
|
13663
|
+
const newTableData = chunkTLGPM7SI_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
13664
13664
|
const updates = { tableData: newTableData };
|
|
13665
|
-
const newRawXml =
|
|
13665
|
+
const newRawXml = chunkVMQLQEGG_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13666
13666
|
if (newRawXml) {
|
|
13667
13667
|
updates.rawXml = newRawXml;
|
|
13668
13668
|
}
|
|
@@ -13675,12 +13675,12 @@ function createTableStructHandlers(input) {
|
|
|
13675
13675
|
}
|
|
13676
13676
|
const td = selectedElement.tableData;
|
|
13677
13677
|
const colIdx = ts?.columnIndex ?? 0;
|
|
13678
|
-
const newTableData =
|
|
13678
|
+
const newTableData = chunkTLGPM7SI_js.deleteTableColumn(td, colIdx);
|
|
13679
13679
|
if (newTableData === td) {
|
|
13680
13680
|
return;
|
|
13681
13681
|
}
|
|
13682
13682
|
const updates = { tableData: newTableData };
|
|
13683
|
-
const newRawXml =
|
|
13683
|
+
const newRawXml = chunkVMQLQEGG_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13684
13684
|
if (newRawXml) {
|
|
13685
13685
|
updates.rawXml = newRawXml;
|
|
13686
13686
|
}
|
|
@@ -13713,8 +13713,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
13713
13713
|
return html2canvasPro__default.default(element, {
|
|
13714
13714
|
...options,
|
|
13715
13715
|
onclone: async (doc, clonedEl) => {
|
|
13716
|
-
await
|
|
13717
|
-
|
|
13716
|
+
await chunkTLGPM7SI_js.normalizeColorsForCapture(doc, clonedEl);
|
|
13717
|
+
chunkTLGPM7SI_js.preprocessCssForCapture(clonedEl);
|
|
13718
13718
|
if (typeof userOnClone === "function") {
|
|
13719
13719
|
userOnClone(doc, clonedEl);
|
|
13720
13720
|
}
|
|
@@ -13770,7 +13770,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
13770
13770
|
}
|
|
13771
13771
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
13772
13772
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
13773
|
-
|
|
13773
|
+
chunkTLGPM7SI_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
13774
13774
|
}
|
|
13775
13775
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
13776
13776
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -13792,7 +13792,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13792
13792
|
continue;
|
|
13793
13793
|
}
|
|
13794
13794
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
13795
|
-
images.push(
|
|
13795
|
+
images.push(chunkTLGPM7SI_js.canvasToJpegData(canvas));
|
|
13796
13796
|
}
|
|
13797
13797
|
onProgress?.(totalSlides, totalSlides);
|
|
13798
13798
|
setActiveSlide(currentSlideIndex);
|
|
@@ -13800,7 +13800,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13800
13800
|
throw new Error(chunkWGLJ32FW_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
13801
13801
|
}
|
|
13802
13802
|
const pdfBlobUrl = buildPdfFromImageData(images);
|
|
13803
|
-
|
|
13803
|
+
chunkTLGPM7SI_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
13804
13804
|
}
|
|
13805
13805
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
13806
13806
|
const { scale = 2, onProgress } = options;
|
|
@@ -13849,7 +13849,7 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
13849
13849
|
throw new Error(chunkWGLJ32FW_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
13850
13850
|
}
|
|
13851
13851
|
const pdfDataUrl = buildNotesPdf(pages);
|
|
13852
|
-
|
|
13852
|
+
chunkTLGPM7SI_js.downloadDataUrl(pdfDataUrl, filename);
|
|
13853
13853
|
}
|
|
13854
13854
|
|
|
13855
13855
|
// src/viewer/utils/export-video.ts
|
|
@@ -13893,7 +13893,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
13893
13893
|
const fps = 30;
|
|
13894
13894
|
const stream = recordingCanvas.captureStream(fps);
|
|
13895
13895
|
const recorder = new MediaRecorder(stream, {
|
|
13896
|
-
mimeType:
|
|
13896
|
+
mimeType: chunkTLGPM7SI_js.pickSupportedMimeType([...chunkTLGPM7SI_js.WEBM_MIME_CANDIDATES]),
|
|
13897
13897
|
videoBitsPerSecond: 5e6
|
|
13898
13898
|
});
|
|
13899
13899
|
const chunks = [];
|
|
@@ -13916,8 +13916,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
13916
13916
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
13917
13917
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
13918
13918
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
13919
|
-
const frameInterval =
|
|
13920
|
-
const framesNeeded =
|
|
13919
|
+
const frameInterval = chunkTLGPM7SI_js.fpsToFrameIntervalMs(fps);
|
|
13920
|
+
const framesNeeded = chunkTLGPM7SI_js.segmentFrameCount(duration, fps);
|
|
13921
13921
|
for (let f = 0; f < framesNeeded; f++) {
|
|
13922
13922
|
if (signal?.aborted) {
|
|
13923
13923
|
recorder.stop();
|
|
@@ -13966,7 +13966,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13966
13966
|
if (frames.length === 0) {
|
|
13967
13967
|
throw new Error(chunkWGLJ32FW_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
13968
13968
|
}
|
|
13969
|
-
const gifBytes =
|
|
13969
|
+
const gifBytes = chunkTLGPM7SI_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
13970
13970
|
onProgress?.(totalSlides, totalSlides);
|
|
13971
13971
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
13972
13972
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -14038,7 +14038,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
14038
14038
|
continue;
|
|
14039
14039
|
}
|
|
14040
14040
|
onProgress?.(processedCount, data.slides.length);
|
|
14041
|
-
let svg =
|
|
14041
|
+
let svg = chunkVMQLQEGG_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
14042
14042
|
if (embedFonts && fontFaces?.length) {
|
|
14043
14043
|
svg = injectFontFaces(svg, fontFaces);
|
|
14044
14044
|
}
|
|
@@ -14108,7 +14108,7 @@ function useExportSaveAs(input) {
|
|
|
14108
14108
|
setExportProgress(95);
|
|
14109
14109
|
setExportStatusMessage("Downloading...");
|
|
14110
14110
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
14111
|
-
|
|
14111
|
+
chunkTLGPM7SI_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
14112
14112
|
setExportProgress(100);
|
|
14113
14113
|
} catch (err) {
|
|
14114
14114
|
if (err.name !== "AbortError") {
|
|
@@ -14131,7 +14131,7 @@ function useExportSaveAs(input) {
|
|
|
14131
14131
|
const blob = new Blob([data], {
|
|
14132
14132
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
14133
14133
|
});
|
|
14134
|
-
|
|
14134
|
+
chunkTLGPM7SI_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
14135
14135
|
} catch (err) {
|
|
14136
14136
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
14137
14137
|
}
|
|
@@ -14144,7 +14144,7 @@ function useExportSaveAs(input) {
|
|
|
14144
14144
|
const pptxGuides = guides.map((g) => ({
|
|
14145
14145
|
id: g.id,
|
|
14146
14146
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
14147
|
-
positionEmu:
|
|
14147
|
+
positionEmu: chunkVMQLQEGG_js.guidePxToEmu(g.position)
|
|
14148
14148
|
}));
|
|
14149
14149
|
return {
|
|
14150
14150
|
...slide,
|
|
@@ -14207,7 +14207,7 @@ function safeConfirm(message) {
|
|
|
14207
14207
|
}
|
|
14208
14208
|
}
|
|
14209
14209
|
function downloadBlob2(blob, filename) {
|
|
14210
|
-
|
|
14210
|
+
chunkTLGPM7SI_js.downloadBlob(blob, chunkTLGPM7SI_js.sanitizeDownloadFilename(filename));
|
|
14211
14211
|
}
|
|
14212
14212
|
|
|
14213
14213
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -14306,21 +14306,21 @@ function useExportHandlers(input) {
|
|
|
14306
14306
|
{
|
|
14307
14307
|
scale: 2,
|
|
14308
14308
|
onProgress: (current, total) => {
|
|
14309
|
-
setExportProgress(
|
|
14310
|
-
setExportStatusMessage(
|
|
14309
|
+
setExportProgress(chunkTLGPM7SI_js.slideProgressPercent(current, total));
|
|
14310
|
+
setExportStatusMessage(chunkTLGPM7SI_js.slideStatusLabel("Rendering", current, total));
|
|
14311
14311
|
},
|
|
14312
14312
|
signal: abortCtrl.signal
|
|
14313
14313
|
}
|
|
14314
14314
|
);
|
|
14315
|
-
setExportProgress(
|
|
14315
|
+
setExportProgress(chunkTLGPM7SI_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14316
14316
|
setExportStatusMessage("Building PDF...");
|
|
14317
14317
|
await new Promise((r) => {
|
|
14318
14318
|
setTimeout(r, 100);
|
|
14319
14319
|
});
|
|
14320
|
-
setExportProgress(
|
|
14320
|
+
setExportProgress(chunkTLGPM7SI_js.EXPORT_DONE_PERCENT);
|
|
14321
14321
|
setExportStatusMessage("Done!");
|
|
14322
14322
|
} catch (err) {
|
|
14323
|
-
if (!
|
|
14323
|
+
if (!chunkTLGPM7SI_js.isExportAbortError(err)) {
|
|
14324
14324
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
14325
14325
|
}
|
|
14326
14326
|
} finally {
|
|
@@ -14350,21 +14350,21 @@ function useExportHandlers(input) {
|
|
|
14350
14350
|
{
|
|
14351
14351
|
scale: 2,
|
|
14352
14352
|
onProgress: (current, total) => {
|
|
14353
|
-
setExportProgress(
|
|
14354
|
-
setExportStatusMessage(
|
|
14353
|
+
setExportProgress(chunkTLGPM7SI_js.slideProgressPercent(current, total));
|
|
14354
|
+
setExportStatusMessage(chunkTLGPM7SI_js.slideStatusLabel("Rendering", current, total));
|
|
14355
14355
|
},
|
|
14356
14356
|
signal: abortCtrl.signal
|
|
14357
14357
|
}
|
|
14358
14358
|
);
|
|
14359
|
-
setExportProgress(
|
|
14359
|
+
setExportProgress(chunkTLGPM7SI_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14360
14360
|
setExportStatusMessage("Building PDF...");
|
|
14361
14361
|
await new Promise((r) => {
|
|
14362
14362
|
setTimeout(r, 100);
|
|
14363
14363
|
});
|
|
14364
|
-
setExportProgress(
|
|
14364
|
+
setExportProgress(chunkTLGPM7SI_js.EXPORT_DONE_PERCENT);
|
|
14365
14365
|
setExportStatusMessage("Done!");
|
|
14366
14366
|
} catch (err) {
|
|
14367
|
-
if (!
|
|
14367
|
+
if (!chunkTLGPM7SI_js.isExportAbortError(err)) {
|
|
14368
14368
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
14369
14369
|
}
|
|
14370
14370
|
} finally {
|
|
@@ -14405,22 +14405,22 @@ function useExportHandlers(input) {
|
|
|
14405
14405
|
scale: 1,
|
|
14406
14406
|
slideDurationMs: 3e3,
|
|
14407
14407
|
onProgress: (current, total) => {
|
|
14408
|
-
setExportProgress(
|
|
14409
|
-
setExportStatusMessage(
|
|
14408
|
+
setExportProgress(chunkTLGPM7SI_js.slideProgressPercent(current, total, 45));
|
|
14409
|
+
setExportStatusMessage(chunkTLGPM7SI_js.slideStatusLabel("Capturing", current, total));
|
|
14410
14410
|
},
|
|
14411
14411
|
onRecordProgress: (current, total) => {
|
|
14412
|
-
setExportProgress(
|
|
14413
|
-
setExportStatusMessage(
|
|
14412
|
+
setExportProgress(chunkTLGPM7SI_js.recordProgressPercent(current, total));
|
|
14413
|
+
setExportStatusMessage(chunkTLGPM7SI_js.slideStatusLabel("Recording", current, total));
|
|
14414
14414
|
},
|
|
14415
14415
|
signal: abortCtrl.signal
|
|
14416
14416
|
}
|
|
14417
14417
|
);
|
|
14418
|
-
setExportProgress(
|
|
14418
|
+
setExportProgress(chunkTLGPM7SI_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14419
14419
|
setExportStatusMessage("Saving file...");
|
|
14420
14420
|
downloadBlob2(blob, "presentation.webm");
|
|
14421
|
-
setExportProgress(
|
|
14421
|
+
setExportProgress(chunkTLGPM7SI_js.EXPORT_DONE_PERCENT);
|
|
14422
14422
|
} catch (err) {
|
|
14423
|
-
if (!
|
|
14423
|
+
if (!chunkTLGPM7SI_js.isExportAbortError(err)) {
|
|
14424
14424
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
14425
14425
|
}
|
|
14426
14426
|
} finally {
|
|
@@ -14448,18 +14448,18 @@ function useExportHandlers(input) {
|
|
|
14448
14448
|
scale: 0.5,
|
|
14449
14449
|
slideDurationMs: 2e3,
|
|
14450
14450
|
onProgress: (current, total) => {
|
|
14451
|
-
setExportProgress(
|
|
14452
|
-
setExportStatusMessage(
|
|
14451
|
+
setExportProgress(chunkTLGPM7SI_js.slideProgressPercent(current, total));
|
|
14452
|
+
setExportStatusMessage(chunkTLGPM7SI_js.slideStatusLabel("Encoding", current, total));
|
|
14453
14453
|
},
|
|
14454
14454
|
signal: abortCtrl.signal
|
|
14455
14455
|
}
|
|
14456
14456
|
);
|
|
14457
|
-
setExportProgress(
|
|
14457
|
+
setExportProgress(chunkTLGPM7SI_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14458
14458
|
setExportStatusMessage("Saving file...");
|
|
14459
14459
|
downloadBlob2(blob, "presentation.gif");
|
|
14460
|
-
setExportProgress(
|
|
14460
|
+
setExportProgress(chunkTLGPM7SI_js.EXPORT_DONE_PERCENT);
|
|
14461
14461
|
} catch (err) {
|
|
14462
|
-
if (!
|
|
14462
|
+
if (!chunkTLGPM7SI_js.isExportAbortError(err)) {
|
|
14463
14463
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
14464
14464
|
}
|
|
14465
14465
|
} finally {
|
|
@@ -14499,7 +14499,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
14499
14499
|
}
|
|
14500
14500
|
printWindow.document.open();
|
|
14501
14501
|
printWindow.document.write(
|
|
14502
|
-
|
|
14502
|
+
chunkTLGPM7SI_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
14503
14503
|
);
|
|
14504
14504
|
printWindow.document.close();
|
|
14505
14505
|
printWindow.focus();
|
|
@@ -14560,7 +14560,7 @@ function usePrintHandlers(input) {
|
|
|
14560
14560
|
if (svgs.length === 0) {
|
|
14561
14561
|
return;
|
|
14562
14562
|
}
|
|
14563
|
-
const printDoc =
|
|
14563
|
+
const printDoc = chunkTLGPM7SI_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
14564
14564
|
title: "Slides (Vector)",
|
|
14565
14565
|
orientation: settings.orientation,
|
|
14566
14566
|
colorFilter
|
|
@@ -14596,7 +14596,7 @@ function usePrintHandlers(input) {
|
|
|
14596
14596
|
if (settings.printWhat === "outline") {
|
|
14597
14597
|
openPrintWindow(
|
|
14598
14598
|
"Outline",
|
|
14599
|
-
`<div class="outline-page">${
|
|
14599
|
+
`<div class="outline-page">${chunkTLGPM7SI_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
14600
14600
|
settings.orientation,
|
|
14601
14601
|
colorFilter,
|
|
14602
14602
|
settings.frameSlides
|
|
@@ -14621,7 +14621,7 @@ function usePrintHandlers(input) {
|
|
|
14621
14621
|
if (settings.printWhat === "slides") {
|
|
14622
14622
|
openPrintWindow(
|
|
14623
14623
|
"Slides",
|
|
14624
|
-
|
|
14624
|
+
chunkTLGPM7SI_js.buildSlidesHtml(slideImages, slideIndices),
|
|
14625
14625
|
settings.orientation,
|
|
14626
14626
|
colorFilter,
|
|
14627
14627
|
settings.frameSlides
|
|
@@ -14631,7 +14631,7 @@ function usePrintHandlers(input) {
|
|
|
14631
14631
|
if (settings.printWhat === "notes") {
|
|
14632
14632
|
openPrintWindow(
|
|
14633
14633
|
"Notes Pages",
|
|
14634
|
-
|
|
14634
|
+
chunkTLGPM7SI_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
14635
14635
|
"portrait",
|
|
14636
14636
|
colorFilter,
|
|
14637
14637
|
settings.frameSlides
|
|
@@ -14642,7 +14642,7 @@ function usePrintHandlers(input) {
|
|
|
14642
14642
|
const spp = settings.slidesPerPage;
|
|
14643
14643
|
openPrintWindow(
|
|
14644
14644
|
`Handout ${spp} per page`,
|
|
14645
|
-
|
|
14645
|
+
chunkTLGPM7SI_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
14646
14646
|
"portrait",
|
|
14647
14647
|
colorFilter,
|
|
14648
14648
|
settings.frameSlides
|
|
@@ -14813,7 +14813,7 @@ function useThemeSwitching(input) {
|
|
|
14813
14813
|
}
|
|
14814
14814
|
try {
|
|
14815
14815
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
14816
|
-
const newData =
|
|
14816
|
+
const newData = chunkVMQLQEGG_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
14817
14817
|
onDataChange(newData);
|
|
14818
14818
|
onThemeChanged?.(preset);
|
|
14819
14819
|
} catch (error) {
|
|
@@ -14830,7 +14830,7 @@ function useThemeSwitching(input) {
|
|
|
14830
14830
|
}
|
|
14831
14831
|
try {
|
|
14832
14832
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
14833
|
-
const newData =
|
|
14833
|
+
const newData = chunkVMQLQEGG_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
14834
14834
|
onDataChange(newData);
|
|
14835
14835
|
} catch (error) {
|
|
14836
14836
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -14842,10 +14842,10 @@ function useThemeSwitching(input) {
|
|
|
14842
14842
|
if (!data?.theme?.colorScheme) {
|
|
14843
14843
|
return void 0;
|
|
14844
14844
|
}
|
|
14845
|
-
return
|
|
14845
|
+
return chunkVMQLQEGG_js.THEME_PRESETS.find((p) => colorSchemesMatch(data.theme?.colorScheme, p.colorScheme));
|
|
14846
14846
|
}, [data?.theme?.colorScheme]);
|
|
14847
14847
|
return {
|
|
14848
|
-
presets:
|
|
14848
|
+
presets: chunkVMQLQEGG_js.THEME_PRESETS,
|
|
14849
14849
|
switchToPreset,
|
|
14850
14850
|
switchToCustom,
|
|
14851
14851
|
currentPreset
|
|
@@ -14863,7 +14863,7 @@ function collectUsedFonts(slides) {
|
|
|
14863
14863
|
return Array.from(fonts).sort();
|
|
14864
14864
|
}
|
|
14865
14865
|
function collectFontsFromElement(el, fonts) {
|
|
14866
|
-
if (
|
|
14866
|
+
if (chunkVMQLQEGG_js.hasTextProperties(el)) {
|
|
14867
14867
|
if (el.textStyle?.fontFamily) {
|
|
14868
14868
|
fonts.add(el.textStyle.fontFamily);
|
|
14869
14869
|
}
|
|
@@ -14988,7 +14988,7 @@ function usePropertyHandlers(input) {
|
|
|
14988
14988
|
}
|
|
14989
14989
|
try {
|
|
14990
14990
|
const ab = await file.arrayBuffer();
|
|
14991
|
-
const h = new
|
|
14991
|
+
const h = new chunkVMQLQEGG_js.PptxHandler();
|
|
14992
14992
|
const other = await h.load(ab);
|
|
14993
14993
|
if (!other) {
|
|
14994
14994
|
return;
|
|
@@ -14998,7 +14998,7 @@ function usePropertyHandlers(input) {
|
|
|
14998
14998
|
width: canvasSize.width,
|
|
14999
14999
|
height: canvasSize.height
|
|
15000
15000
|
};
|
|
15001
|
-
setCompareResult(
|
|
15001
|
+
setCompareResult(chunkTLGPM7SI_js.comparePresentation(cur, other));
|
|
15002
15002
|
setIsComparePanelOpen(true);
|
|
15003
15003
|
} catch (err) {
|
|
15004
15004
|
console.warn("Compare failed:", err);
|
|
@@ -15148,7 +15148,7 @@ function useIsMobile(input) {
|
|
|
15148
15148
|
const containerRef = input?.containerRef;
|
|
15149
15149
|
const isTouchDevice = React3.useSyncExternalStore(
|
|
15150
15150
|
subscribeTouchCapability,
|
|
15151
|
-
|
|
15151
|
+
chunkTLGPM7SI_js.detectTouchDevice,
|
|
15152
15152
|
() => false
|
|
15153
15153
|
// server snapshot
|
|
15154
15154
|
);
|
|
@@ -15164,7 +15164,7 @@ function useIsMobile(input) {
|
|
|
15164
15164
|
}
|
|
15165
15165
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
15166
15166
|
});
|
|
15167
|
-
const [orientation, setOrientation] = React3.useState(
|
|
15167
|
+
const [orientation, setOrientation] = React3.useState(chunkTLGPM7SI_js.detectOrientation);
|
|
15168
15168
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = React3.useState(false);
|
|
15169
15169
|
const [initialViewportHeight] = React3.useState(
|
|
15170
15170
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -15208,7 +15208,7 @@ function useIsMobile(input) {
|
|
|
15208
15208
|
return;
|
|
15209
15209
|
}
|
|
15210
15210
|
const handleOrientationChange = () => {
|
|
15211
|
-
setOrientation(
|
|
15211
|
+
setOrientation(chunkTLGPM7SI_js.detectOrientation());
|
|
15212
15212
|
};
|
|
15213
15213
|
if (screen.orientation) {
|
|
15214
15214
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -15238,9 +15238,9 @@ function useIsMobile(input) {
|
|
|
15238
15238
|
window.addEventListener("resize", handleResize);
|
|
15239
15239
|
return () => window.removeEventListener("resize", handleResize);
|
|
15240
15240
|
}, [isTouchDevice, initialViewportHeight]);
|
|
15241
|
-
const isMobile =
|
|
15242
|
-
const isTablet = !isMobile && containerWidth >=
|
|
15243
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
15241
|
+
const isMobile = chunkTLGPM7SI_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
15242
|
+
const isTablet = !isMobile && containerWidth >= chunkTLGPM7SI_js.MOBILE_BREAKPOINT && containerWidth < chunkTLGPM7SI_js.TABLET_BREAKPOINT;
|
|
15243
|
+
const isDesktop = !isMobile && containerWidth >= chunkTLGPM7SI_js.TABLET_BREAKPOINT;
|
|
15244
15244
|
return {
|
|
15245
15245
|
isMobile,
|
|
15246
15246
|
isTablet,
|
|
@@ -15301,11 +15301,11 @@ function useViewerDialogs(input) {
|
|
|
15301
15301
|
);
|
|
15302
15302
|
const [embedFontsEnabled, setEmbedFontsEnabled] = React3.useState(false);
|
|
15303
15303
|
const [isNarrowViewport, setIsNarrowViewport] = React3.useState(
|
|
15304
|
-
() => typeof window !== "undefined" ?
|
|
15304
|
+
() => typeof window !== "undefined" ? chunkTLGPM7SI_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
15305
15305
|
);
|
|
15306
15306
|
React3.useEffect(() => {
|
|
15307
15307
|
const handleWindow = () => setIsNarrowViewport(
|
|
15308
|
-
|
|
15308
|
+
chunkTLGPM7SI_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
15309
15309
|
);
|
|
15310
15310
|
let observer = null;
|
|
15311
15311
|
let raf = 0;
|
|
@@ -15319,12 +15319,12 @@ function useViewerDialogs(input) {
|
|
|
15319
15319
|
const entry = entries[0];
|
|
15320
15320
|
if (entry) {
|
|
15321
15321
|
setIsNarrowViewport(
|
|
15322
|
-
|
|
15322
|
+
chunkTLGPM7SI_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
15323
15323
|
);
|
|
15324
15324
|
}
|
|
15325
15325
|
});
|
|
15326
15326
|
observer.observe(el);
|
|
15327
|
-
setIsNarrowViewport(
|
|
15327
|
+
setIsNarrowViewport(chunkTLGPM7SI_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
15328
15328
|
};
|
|
15329
15329
|
attach();
|
|
15330
15330
|
window.addEventListener("resize", handleWindow);
|
|
@@ -15759,13 +15759,13 @@ function useSerialize(input) {
|
|
|
15759
15759
|
let processedSlide = slide;
|
|
15760
15760
|
if (pendingEditId) {
|
|
15761
15761
|
const updatedElements = slide.elements.map((el) => {
|
|
15762
|
-
if (el.id !== pendingEditId || !
|
|
15762
|
+
if (el.id !== pendingEditId || !chunkVMQLQEGG_js.hasTextProperties(el)) {
|
|
15763
15763
|
return el;
|
|
15764
15764
|
}
|
|
15765
15765
|
return {
|
|
15766
15766
|
...el,
|
|
15767
15767
|
text: pendingEditText,
|
|
15768
|
-
textSegments:
|
|
15768
|
+
textSegments: chunkTLGPM7SI_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
15769
15769
|
};
|
|
15770
15770
|
});
|
|
15771
15771
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -15778,7 +15778,7 @@ function useSerialize(input) {
|
|
|
15778
15778
|
const pptxGuides = guides.map((g) => ({
|
|
15779
15779
|
id: g.id,
|
|
15780
15780
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
15781
|
-
positionEmu:
|
|
15781
|
+
positionEmu: chunkVMQLQEGG_js.guidePxToEmu(g.position)
|
|
15782
15782
|
}));
|
|
15783
15783
|
return {
|
|
15784
15784
|
...processedSlide,
|
|
@@ -16158,7 +16158,7 @@ function useEditorOperations(input) {
|
|
|
16158
16158
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
16159
16159
|
React3.useEffect(() => {
|
|
16160
16160
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
16161
|
-
copiedFormatRef.current =
|
|
16161
|
+
copiedFormatRef.current = chunkTLGPM7SI_js.copyFormatFromElement(selectedElement);
|
|
16162
16162
|
} else if (!formatPainterActive) {
|
|
16163
16163
|
copiedFormatRef.current = null;
|
|
16164
16164
|
}
|
|
@@ -16184,12 +16184,12 @@ function useEditorOperations(input) {
|
|
|
16184
16184
|
e.stopPropagation();
|
|
16185
16185
|
const element = elementLookup.get(elementId);
|
|
16186
16186
|
if (element) {
|
|
16187
|
-
const updated =
|
|
16187
|
+
const updated = chunkTLGPM7SI_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
16188
16188
|
const updates = {};
|
|
16189
|
-
if (
|
|
16189
|
+
if (chunkVMQLQEGG_js.hasShapeProperties(updated)) {
|
|
16190
16190
|
updates.shapeStyle = updated.shapeStyle;
|
|
16191
16191
|
}
|
|
16192
|
-
if (
|
|
16192
|
+
if (chunkVMQLQEGG_js.hasTextProperties(updated)) {
|
|
16193
16193
|
updates.textStyle = updated.textStyle;
|
|
16194
16194
|
}
|
|
16195
16195
|
ops.updateElementById(elementId, updates);
|
|
@@ -16332,7 +16332,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
16332
16332
|
const families = /* @__PURE__ */ new Set();
|
|
16333
16333
|
for (const slide of slides) {
|
|
16334
16334
|
for (const el of slide.elements) {
|
|
16335
|
-
if (
|
|
16335
|
+
if (chunkVMQLQEGG_js.hasTextProperties(el) && el.textSegments) {
|
|
16336
16336
|
for (const seg of el.textSegments) {
|
|
16337
16337
|
if (seg.style.fontFamily) {
|
|
16338
16338
|
families.add(seg.style.fontFamily);
|
|
@@ -17114,34 +17114,20 @@ function useYjsProvider({ config }) {
|
|
|
17114
17114
|
const [synced, setSynced] = React3.useState(false);
|
|
17115
17115
|
const cleanupRef = React3.useRef(null);
|
|
17116
17116
|
const timeoutRef = React3.useRef(null);
|
|
17117
|
-
const
|
|
17118
|
-
|
|
17119
|
-
|
|
17120
|
-
|
|
17121
|
-
syncGraceRef.current = null;
|
|
17122
|
-
}
|
|
17123
|
-
}, []);
|
|
17124
|
-
const markSynced = React3.useCallback(() => {
|
|
17125
|
-
clearSyncGrace();
|
|
17126
|
-
setSynced(true);
|
|
17127
|
-
}, [clearSyncGrace]);
|
|
17128
|
-
const armSyncGrace = React3.useCallback(() => {
|
|
17129
|
-
clearSyncGrace();
|
|
17130
|
-
syncGraceRef.current = setTimeout(() => {
|
|
17131
|
-
syncGraceRef.current = null;
|
|
17132
|
-
setSynced(true);
|
|
17133
|
-
}, chunkFQXZZBFJ_js.INITIAL_SYNC_GRACE_MS);
|
|
17134
|
-
}, [clearSyncGrace]);
|
|
17117
|
+
const gateRef = React3.useRef(null);
|
|
17118
|
+
if (!gateRef.current) {
|
|
17119
|
+
gateRef.current = chunkTLGPM7SI_js.createSyncGate(() => setSynced(true));
|
|
17120
|
+
}
|
|
17135
17121
|
const teardown = React3.useCallback(() => {
|
|
17136
17122
|
if (timeoutRef.current) {
|
|
17137
17123
|
clearTimeout(timeoutRef.current);
|
|
17138
17124
|
timeoutRef.current = null;
|
|
17139
17125
|
}
|
|
17140
|
-
|
|
17126
|
+
gateRef.current?.reset();
|
|
17141
17127
|
setSynced(false);
|
|
17142
17128
|
cleanupRef.current?.();
|
|
17143
17129
|
cleanupRef.current = null;
|
|
17144
|
-
}, [
|
|
17130
|
+
}, []);
|
|
17145
17131
|
const buildCleanup = React3.useCallback(
|
|
17146
17132
|
(provider, yDoc) => () => {
|
|
17147
17133
|
provider.destroy();
|
|
@@ -17168,21 +17154,33 @@ function useYjsProvider({ config }) {
|
|
|
17168
17154
|
if (config.authToken) {
|
|
17169
17155
|
opts.password = config.authToken;
|
|
17170
17156
|
}
|
|
17171
|
-
const provider = new WebrtcProvider(
|
|
17157
|
+
const provider = new WebrtcProvider(chunkTLGPM7SI_js.validateRoomId(config.roomId), yDoc, opts);
|
|
17172
17158
|
setDoc(yDoc);
|
|
17173
17159
|
setAwareness(provider.awareness);
|
|
17174
17160
|
setClientId(provider.awareness.clientID);
|
|
17175
17161
|
setStatus("connected");
|
|
17176
17162
|
const handleSynced = (event) => {
|
|
17177
17163
|
if (event?.synced !== false) {
|
|
17178
|
-
|
|
17164
|
+
gateRef.current?.open();
|
|
17179
17165
|
}
|
|
17180
17166
|
};
|
|
17181
17167
|
provider.on("synced", handleSynced);
|
|
17182
|
-
|
|
17168
|
+
gateRef.current?.arm();
|
|
17169
|
+
const handleStatus = (event) => {
|
|
17170
|
+
if (event.connected === false) {
|
|
17171
|
+
setStatus("disconnected");
|
|
17172
|
+
gateRef.current?.reset();
|
|
17173
|
+
setSynced(false);
|
|
17174
|
+
gateRef.current?.arm();
|
|
17175
|
+
} else if (event.connected) {
|
|
17176
|
+
setStatus("connected");
|
|
17177
|
+
}
|
|
17178
|
+
};
|
|
17179
|
+
provider.on("status", handleStatus);
|
|
17183
17180
|
const baseCleanup = buildCleanup(provider, yDoc);
|
|
17184
17181
|
cleanupRef.current = () => {
|
|
17185
17182
|
provider.off("synced", handleSynced);
|
|
17183
|
+
provider.off("status", handleStatus);
|
|
17186
17184
|
baseCleanup();
|
|
17187
17185
|
};
|
|
17188
17186
|
} catch (err) {
|
|
@@ -17192,25 +17190,19 @@ function useYjsProvider({ config }) {
|
|
|
17192
17190
|
);
|
|
17193
17191
|
setStatus("error");
|
|
17194
17192
|
}
|
|
17195
|
-
}, [
|
|
17196
|
-
config?.roomId,
|
|
17197
|
-
config?.authToken,
|
|
17198
|
-
config?.signaling,
|
|
17199
|
-
buildCleanup,
|
|
17200
|
-
armSyncGrace,
|
|
17201
|
-
markSynced
|
|
17202
|
-
]);
|
|
17193
|
+
}, [config?.roomId, config?.authToken, config?.signaling, buildCleanup]);
|
|
17203
17194
|
const init = React3.useCallback(async () => {
|
|
17204
17195
|
teardown();
|
|
17205
17196
|
if (!config) {
|
|
17206
17197
|
return;
|
|
17207
17198
|
}
|
|
17208
|
-
const roomId =
|
|
17209
|
-
|
|
17199
|
+
const roomId = chunkTLGPM7SI_js.validateRoomId(config.roomId);
|
|
17200
|
+
const transport = config.transport ?? chunkTLGPM7SI_js.resolveTransportForServerUrl(config.serverUrl);
|
|
17201
|
+
if (transport === "webrtc") {
|
|
17210
17202
|
await initWebrtc();
|
|
17211
17203
|
return;
|
|
17212
17204
|
}
|
|
17213
|
-
if (
|
|
17205
|
+
if (chunkTLGPM7SI_js.isMixedContentBlocked(config.serverUrl)) {
|
|
17214
17206
|
console.warn(
|
|
17215
17207
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
17216
17208
|
);
|
|
@@ -17233,14 +17225,17 @@ function useYjsProvider({ config }) {
|
|
|
17233
17225
|
timeoutRef.current = null;
|
|
17234
17226
|
}
|
|
17235
17227
|
setStatus("connected");
|
|
17236
|
-
|
|
17228
|
+
gateRef.current?.arm();
|
|
17237
17229
|
} else if (event.status === "disconnected") {
|
|
17238
17230
|
setStatus("disconnected");
|
|
17231
|
+
gateRef.current?.reset();
|
|
17232
|
+
setSynced(false);
|
|
17233
|
+
gateRef.current?.arm();
|
|
17239
17234
|
}
|
|
17240
17235
|
};
|
|
17241
17236
|
const handleSynced = (isSynced) => {
|
|
17242
17237
|
if (isSynced) {
|
|
17243
|
-
|
|
17238
|
+
gateRef.current?.open();
|
|
17244
17239
|
}
|
|
17245
17240
|
};
|
|
17246
17241
|
provider.on("status", handleStatus);
|
|
@@ -17248,10 +17243,10 @@ function useYjsProvider({ config }) {
|
|
|
17248
17243
|
if (provider.wsconnected) {
|
|
17249
17244
|
connected = true;
|
|
17250
17245
|
setStatus("connected");
|
|
17251
|
-
|
|
17246
|
+
gateRef.current?.arm();
|
|
17252
17247
|
}
|
|
17253
17248
|
if (provider.synced) {
|
|
17254
|
-
|
|
17249
|
+
gateRef.current?.open();
|
|
17255
17250
|
}
|
|
17256
17251
|
if (!connected) {
|
|
17257
17252
|
timeoutRef.current = setTimeout(() => {
|
|
@@ -17267,7 +17262,7 @@ function useYjsProvider({ config }) {
|
|
|
17267
17262
|
cleanupRef.current = null;
|
|
17268
17263
|
setStatus("error");
|
|
17269
17264
|
}
|
|
17270
|
-
},
|
|
17265
|
+
}, chunkTLGPM7SI_js.CONNECTION_TIMEOUT_MS);
|
|
17271
17266
|
}
|
|
17272
17267
|
setDoc(yDoc);
|
|
17273
17268
|
setAwareness(provider.awareness);
|
|
@@ -17295,9 +17290,7 @@ function useYjsProvider({ config }) {
|
|
|
17295
17290
|
config?.authToken,
|
|
17296
17291
|
config?.transport,
|
|
17297
17292
|
initWebrtc,
|
|
17298
|
-
teardown
|
|
17299
|
-
armSyncGrace,
|
|
17300
|
-
markSynced
|
|
17293
|
+
teardown
|
|
17301
17294
|
]);
|
|
17302
17295
|
React3.useEffect(() => {
|
|
17303
17296
|
init();
|
|
@@ -17342,7 +17335,7 @@ function usePresenceTracking({
|
|
|
17342
17335
|
awareness.setLocalStateField("presence", state);
|
|
17343
17336
|
lastBroadcastRef.current = Date.now();
|
|
17344
17337
|
};
|
|
17345
|
-
if (elapsed >=
|
|
17338
|
+
if (elapsed >= chunkTLGPM7SI_js.BROADCAST_THROTTLE_MS) {
|
|
17346
17339
|
if (pendingBroadcastRef.current) {
|
|
17347
17340
|
clearTimeout(pendingBroadcastRef.current);
|
|
17348
17341
|
pendingBroadcastRef.current = null;
|
|
@@ -17352,7 +17345,7 @@ function usePresenceTracking({
|
|
|
17352
17345
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
17353
17346
|
pendingBroadcastRef.current = null;
|
|
17354
17347
|
flush();
|
|
17355
|
-
},
|
|
17348
|
+
}, chunkTLGPM7SI_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
17356
17349
|
}
|
|
17357
17350
|
},
|
|
17358
17351
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -17377,7 +17370,7 @@ function usePresenceTracking({
|
|
|
17377
17370
|
return;
|
|
17378
17371
|
}
|
|
17379
17372
|
const handleChange = () => {
|
|
17380
|
-
const users =
|
|
17373
|
+
const users = chunkTLGPM7SI_js.derivePresenceList(
|
|
17381
17374
|
awareness.getStates(),
|
|
17382
17375
|
localClientId,
|
|
17383
17376
|
canvasWidth,
|
|
@@ -17425,7 +17418,7 @@ function useCollaborativeState({
|
|
|
17425
17418
|
canvasWidth,
|
|
17426
17419
|
canvasHeight
|
|
17427
17420
|
}) {
|
|
17428
|
-
const userColor =
|
|
17421
|
+
const userColor = chunkTLGPM7SI_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
17429
17422
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
17430
17423
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
17431
17424
|
awareness,
|
|
@@ -17528,10 +17521,10 @@ function useYjsDocumentSync({
|
|
|
17528
17521
|
return;
|
|
17529
17522
|
}
|
|
17530
17523
|
try {
|
|
17531
|
-
const { PptxHandler: PptxHandler2 } = await import('./dist-
|
|
17524
|
+
const { PptxHandler: PptxHandler2 } = await import('./dist-55M4L5OI.js');
|
|
17532
17525
|
const handler = new PptxHandler2();
|
|
17533
17526
|
await handler.load(sourceBytes.buffer);
|
|
17534
|
-
const currentSlides =
|
|
17527
|
+
const currentSlides = chunkTLGPM7SI_js.readSlidesFromYDoc(
|
|
17535
17528
|
doc
|
|
17536
17529
|
);
|
|
17537
17530
|
const slidesToSave = buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
@@ -17552,11 +17545,11 @@ function useYjsDocumentSync({
|
|
|
17552
17545
|
lastSyncedRef.current = serialized;
|
|
17553
17546
|
void (async () => {
|
|
17554
17547
|
const factories = await getFactories();
|
|
17555
|
-
|
|
17548
|
+
chunkTLGPM7SI_js.reconcileSlidesInYDoc(
|
|
17556
17549
|
slides,
|
|
17557
17550
|
doc,
|
|
17558
17551
|
factories,
|
|
17559
|
-
|
|
17552
|
+
chunkTLGPM7SI_js.LOCAL_SYNC_ORIGIN
|
|
17560
17553
|
);
|
|
17561
17554
|
scheduleWriteBack();
|
|
17562
17555
|
})();
|
|
@@ -17566,10 +17559,10 @@ function useYjsDocumentSync({
|
|
|
17566
17559
|
return;
|
|
17567
17560
|
}
|
|
17568
17561
|
const handleChange = (_events, transaction) => {
|
|
17569
|
-
if (transaction?.origin ===
|
|
17562
|
+
if (transaction?.origin === chunkTLGPM7SI_js.LOCAL_SYNC_ORIGIN) {
|
|
17570
17563
|
return;
|
|
17571
17564
|
}
|
|
17572
|
-
const remoteSlides =
|
|
17565
|
+
const remoteSlides = chunkTLGPM7SI_js.readSlidesFromYDoc(
|
|
17573
17566
|
doc
|
|
17574
17567
|
);
|
|
17575
17568
|
if (remoteSlides.length === 0) {
|
|
@@ -17587,7 +17580,7 @@ function useYjsDocumentSync({
|
|
|
17587
17580
|
});
|
|
17588
17581
|
scheduleWriteBack();
|
|
17589
17582
|
};
|
|
17590
|
-
const unobserve =
|
|
17583
|
+
const unobserve = chunkTLGPM7SI_js.observeYDocSlides(
|
|
17591
17584
|
doc,
|
|
17592
17585
|
handleChange
|
|
17593
17586
|
);
|
|
@@ -17843,7 +17836,7 @@ function useTouchGestures(input) {
|
|
|
17843
17836
|
if (!el || !enabled) {
|
|
17844
17837
|
return;
|
|
17845
17838
|
}
|
|
17846
|
-
const recognizer =
|
|
17839
|
+
const recognizer = chunkTLGPM7SI_js.createTouchGestureRecognizer({
|
|
17847
17840
|
getScale: () => scaleRef.current,
|
|
17848
17841
|
minScale: MIN_ZOOM_SCALE,
|
|
17849
17842
|
maxScale: MAX_ZOOM_SCALE,
|
|
@@ -17886,7 +17879,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
17886
17879
|
return;
|
|
17887
17880
|
}
|
|
17888
17881
|
const rect = active.getBoundingClientRect();
|
|
17889
|
-
const delta =
|
|
17882
|
+
const delta = chunkTLGPM7SI_js.computeScrollDelta(
|
|
17890
17883
|
{ top: rect.top, bottom: rect.bottom },
|
|
17891
17884
|
window.innerHeight,
|
|
17892
17885
|
keyboardInset
|
|
@@ -17906,8 +17899,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
17906
17899
|
return;
|
|
17907
17900
|
}
|
|
17908
17901
|
const update = () => {
|
|
17909
|
-
const metrics =
|
|
17910
|
-
const inset = metrics ?
|
|
17902
|
+
const metrics = chunkTLGPM7SI_js.readViewportMetrics(window);
|
|
17903
|
+
const inset = metrics ? chunkTLGPM7SI_js.computeKeyboardInset(metrics) : 0;
|
|
17911
17904
|
setKeyboardInset(inset);
|
|
17912
17905
|
if (inset > 0) {
|
|
17913
17906
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -17918,8 +17911,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
17918
17911
|
vv.addEventListener("scroll", update);
|
|
17919
17912
|
const onFocusIn = () => {
|
|
17920
17913
|
window.requestAnimationFrame(() => {
|
|
17921
|
-
const metrics =
|
|
17922
|
-
const inset = metrics ?
|
|
17914
|
+
const metrics = chunkTLGPM7SI_js.readViewportMetrics(window);
|
|
17915
|
+
const inset = metrics ? chunkTLGPM7SI_js.computeKeyboardInset(metrics) : 0;
|
|
17923
17916
|
if (inset > 0) {
|
|
17924
17917
|
scrollFocusedIntoView(inset);
|
|
17925
17918
|
}
|
|
@@ -17932,7 +17925,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
17932
17925
|
document.removeEventListener("focusin", onFocusIn);
|
|
17933
17926
|
};
|
|
17934
17927
|
}, [enabled]);
|
|
17935
|
-
return { keyboardInset, isKeyboardOpen:
|
|
17928
|
+
return { keyboardInset, isKeyboardOpen: chunkTLGPM7SI_js.isKeyboardOpen(keyboardInset) };
|
|
17936
17929
|
}
|
|
17937
17930
|
var LEFT_MIN = 120;
|
|
17938
17931
|
var LEFT_MAX = 400;
|