pptx-react-viewer 1.14.1 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/dist/{Model3DScene-JUJB4MJX.mjs → Model3DScene-EF72C34A.mjs} +1 -1
- package/dist/{Model3DScene-JUJB4MJX.mjs.br → Model3DScene-EF72C34A.mjs.br} +0 -0
- package/dist/Model3DScene-EF72C34A.mjs.gz +0 -0
- package/dist/{Model3DScene-E2FDY2TX.js → Model3DScene-QIE7QZ7M.js} +2 -2
- package/dist/Model3DScene-QIE7QZ7M.js.br +0 -0
- package/dist/Model3DScene-QIE7QZ7M.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-Z64TSGR5.js → SurfaceChart3DScene-CBUOCCEN.js} +2 -2
- package/dist/SurfaceChart3DScene-CBUOCCEN.js.br +0 -0
- package/dist/SurfaceChart3DScene-CBUOCCEN.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-2DEB7NMW.mjs → SurfaceChart3DScene-JYCQ2DBR.mjs} +1 -1
- package/dist/SurfaceChart3DScene-JYCQ2DBR.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-JYCQ2DBR.mjs.gz +0 -0
- package/dist/{chunk-CHG7GPGB.js → chunk-BZVYWFHS.js} +365 -365
- package/dist/chunk-BZVYWFHS.js.br +0 -0
- package/dist/chunk-BZVYWFHS.js.gz +0 -0
- package/dist/{chunk-OSWE3VXS.mjs → chunk-HJQZJ3VE.mjs} +9 -0
- package/dist/chunk-HJQZJ3VE.mjs.br +0 -0
- package/dist/chunk-HJQZJ3VE.mjs.gz +0 -0
- package/dist/{chunk-CZOMQPLZ.mjs → chunk-POP5TS5L.mjs} +3 -3
- package/dist/chunk-POP5TS5L.mjs.br +0 -0
- package/dist/chunk-POP5TS5L.mjs.gz +0 -0
- package/dist/{chunk-K74UOJ6P.js → chunk-WGLJ32FW.js} +9 -0
- package/dist/chunk-WGLJ32FW.js.br +0 -0
- package/dist/chunk-WGLJ32FW.js.gz +0 -0
- package/dist/{chunk-MAXS6AU7.mjs → chunk-X2UMJTCM.mjs} +4 -4
- package/dist/chunk-X2UMJTCM.mjs.br +0 -0
- package/dist/chunk-X2UMJTCM.mjs.gz +0 -0
- package/dist/{chunk-RXIGJGJN.js → chunk-ZDV7QRGB.js} +745 -745
- package/dist/chunk-ZDV7QRGB.js.br +0 -0
- package/dist/chunk-ZDV7QRGB.js.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/i18n.js +3 -3
- package/dist/i18n.js.br +1 -1
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.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-E2FDY2TX.js.br +0 -0
- package/dist/Model3DScene-E2FDY2TX.js.gz +0 -0
- package/dist/Model3DScene-JUJB4MJX.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-2DEB7NMW.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-2DEB7NMW.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-Z64TSGR5.js.br +0 -0
- package/dist/SurfaceChart3DScene-Z64TSGR5.js.gz +0 -0
- package/dist/chunk-CHG7GPGB.js.br +0 -0
- package/dist/chunk-CHG7GPGB.js.gz +0 -0
- package/dist/chunk-CZOMQPLZ.mjs.br +0 -0
- package/dist/chunk-CZOMQPLZ.mjs.gz +0 -0
- package/dist/chunk-K74UOJ6P.js.br +0 -0
- package/dist/chunk-K74UOJ6P.js.gz +0 -0
- package/dist/chunk-MAXS6AU7.mjs.br +0 -0
- package/dist/chunk-MAXS6AU7.mjs.gz +0 -0
- package/dist/chunk-OSWE3VXS.mjs.br +0 -0
- package/dist/chunk-OSWE3VXS.mjs.gz +0 -0
- package/dist/chunk-RXIGJGJN.js.br +0 -0
- package/dist/chunk-RXIGJGJN.js.gz +0 -0
- /package/dist/{chunk-ZK4SPHDQ.mjs → chunk-FHOZRWAD.mjs} +0 -0
- /package/dist/{chunk-ZK4SPHDQ.mjs.br → chunk-FHOZRWAD.mjs.br} +0 -0
- /package/dist/{chunk-ZK4SPHDQ.mjs.gz → chunk-FHOZRWAD.mjs.gz} +0 -0
- /package/dist/{chunk-6CNJINIT.js → chunk-FQXZZBFJ.js} +0 -0
- /package/dist/{chunk-6CNJINIT.js.br → chunk-FQXZZBFJ.js.br} +0 -0
- /package/dist/{chunk-6CNJINIT.js.gz → chunk-FQXZZBFJ.js.gz} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkFQXZZBFJ_js = require('./chunk-FQXZZBFJ.js');
|
|
4
|
+
var chunkWGLJ32FW_js = require('./chunk-WGLJ32FW.js');
|
|
5
5
|
var chunkOBLHB72P_js = require('./chunk-OBLHB72P.js');
|
|
6
6
|
var React3 = require('react');
|
|
7
7
|
var lu = require('react-icons/lu');
|
|
@@ -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 chunkFQXZZBFJ_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(chunkFQXZZBFJ_js.cloneSlide),
|
|
72
|
+
templateElementsBySlideId: chunkFQXZZBFJ_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(chunkFQXZZBFJ_js.cloneSlide));
|
|
86
86
|
setTemplateElementsBySlideId(
|
|
87
|
-
|
|
87
|
+
chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.SHAPE_PRESET_DEFS.map(
|
|
351
351
|
(def) => ({
|
|
352
352
|
type: def.type,
|
|
353
353
|
label: def.label,
|
|
@@ -688,19 +688,19 @@ function useAnimationPlayback(input) {
|
|
|
688
688
|
if (anim.buildType && anim.buildType !== "allAtOnce" && anim.targetId) {
|
|
689
689
|
const el = slide.elements.find((e) => e.id === anim.targetId);
|
|
690
690
|
if (el && chunkOBLHB72P_js.hasTextProperties(el) && el.textSegments && el.textSegments.length > 0) {
|
|
691
|
-
segmentCounts.set(anim.targetId,
|
|
691
|
+
segmentCounts.set(anim.targetId, chunkFQXZZBFJ_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 ? chunkFQXZZBFJ_js.expandTextBuildAnimations(nativeAnims, segmentCounts) : nativeAnims;
|
|
696
|
+
const engine = chunkFQXZZBFJ_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(chunkFQXZZBFJ_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 chunkFQXZZBFJ_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 (chunkFQXZZBFJ_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 ? chunkFQXZZBFJ_js.resolveTransitionDurationMs(transition) : 0;
|
|
1449
1449
|
deps.clearPresentationTimers();
|
|
1450
1450
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1451
1451
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -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) => chunkFQXZZBFJ_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) => !chunkFQXZZBFJ_js.isTemplateElement(el)) };
|
|
3160
3160
|
});
|
|
3161
3161
|
return { slides: nextSlides, templateElementsBySlideId };
|
|
3162
3162
|
}
|
|
@@ -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
|
+
chunkFQXZZBFJ_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 } = chunkFQXZZBFJ_js.collectImagePaths(parsed.slides);
|
|
3286
3286
|
let nextSlides = parsed.slides;
|
|
3287
3287
|
if (imagePaths.size > 0) {
|
|
3288
3288
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3371,7 +3371,7 @@ function useLoadContent({
|
|
|
3371
3371
|
setHasMacros(parsed.hasMacros === true);
|
|
3372
3372
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3373
3373
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3374
|
-
setGuides(
|
|
3374
|
+
setGuides(chunkFQXZZBFJ_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3375
3375
|
setActiveSlideIndex(0);
|
|
3376
3376
|
clearSelection();
|
|
3377
3377
|
setIsDirty(false);
|
|
@@ -3455,7 +3455,7 @@ function useAutosave(input) {
|
|
|
3455
3455
|
isSavingRef.current = false;
|
|
3456
3456
|
return;
|
|
3457
3457
|
}
|
|
3458
|
-
await
|
|
3458
|
+
await chunkFQXZZBFJ_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 chunkFQXZZBFJ_js.getAnimationInitialStyle(preset, nativeAnimation);
|
|
3497
3497
|
}
|
|
3498
3498
|
function cn(...inputs) {
|
|
3499
3499
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
@@ -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 ? chunkFQXZZBFJ_js.normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
3524
|
+
const textOrientation = chunkFQXZZBFJ_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
3525
|
+
const verticalDirection = chunkFQXZZBFJ_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 ? chunkFQXZZBFJ_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: chunkFQXZZBFJ_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
|
+
...chunkFQXZZBFJ_js.computeAutoFitTextStyle({
|
|
3561
3561
|
textStyle: element.textStyle,
|
|
3562
3562
|
text: element.text ?? "",
|
|
3563
3563
|
width: element.width,
|
|
@@ -3594,9 +3594,9 @@ function getTextLayoutStyle(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 = chunkFQXZZBFJ_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
3598
|
+
const textOrientation = chunkFQXZZBFJ_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
3599
|
+
const verticalDirection = chunkFQXZZBFJ_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;
|
|
@@ -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 = chunkFQXZZBFJ_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 chunkFQXZZBFJ_js.buildTextFillCss(style);
|
|
3660
3660
|
}
|
|
3661
3661
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
3662
|
-
return
|
|
3662
|
+
return chunkFQXZZBFJ_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}${chunkFQXZZBFJ_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}${chunkFQXZZBFJ_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}${chunkFQXZZBFJ_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}${chunkFQXZZBFJ_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}${chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.segmentByScript(text);
|
|
3906
3906
|
if (runs.length <= 1) {
|
|
3907
3907
|
if (runs.length === 1) {
|
|
3908
|
-
const font =
|
|
3908
|
+
const font = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.convertOmmlToMathMl(equationXml);
|
|
3991
|
+
const safeMathml = mathml ? chunkFQXZZBFJ_js.sanitizeMathMl(mathml) : "";
|
|
3992
3992
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3993
3993
|
"span",
|
|
3994
3994
|
{
|
|
@@ -3998,7 +3998,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
3998
3998
|
},
|
|
3999
3999
|
dangerouslySetInnerHTML: { __html: safeMathml }
|
|
4000
4000
|
}
|
|
4001
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children:
|
|
4001
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children: chunkWGLJ32FW_js.translationsEn["pptx.textSegment.equationFallback"] });
|
|
4002
4002
|
if (equationNumber) {
|
|
4003
4003
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4004
4004
|
"span",
|
|
@@ -4051,7 +4051,7 @@ function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize)
|
|
|
4051
4051
|
color: bulletInfo.color || void 0,
|
|
4052
4052
|
fontFamily: bulletInfo.fontFamily || void 0
|
|
4053
4053
|
},
|
|
4054
|
-
"aria-label":
|
|
4054
|
+
"aria-label": chunkWGLJ32FW_js.translationsEn["pptx.textSegment.bulletAria"],
|
|
4055
4055
|
children: "\u2022 "
|
|
4056
4056
|
},
|
|
4057
4057
|
`${elementId}-seg-${segmentIndex}-bullet-fallback`
|
|
@@ -4061,7 +4061,7 @@ function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize)
|
|
|
4061
4061
|
"img",
|
|
4062
4062
|
{
|
|
4063
4063
|
src: bulletInfo.imageDataUrl,
|
|
4064
|
-
alt:
|
|
4064
|
+
alt: chunkWGLJ32FW_js.translationsEn["pptx.textSegment.bulletAria"],
|
|
4065
4065
|
style: {
|
|
4066
4066
|
width: bulletSize,
|
|
4067
4067
|
height: bulletSize,
|
|
@@ -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 = chunkFQXZZBFJ_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 ? chunkFQXZZBFJ_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkFQXZZBFJ_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
4098
|
+
const underlineDecoration = chunkFQXZZBFJ_js.resolveUnderlineDecorationStyle(
|
|
4099
4099
|
Boolean(isDoubleStrike),
|
|
4100
4100
|
segmentStyle.underlineStyle
|
|
4101
4101
|
);
|
|
@@ -4115,7 +4115,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
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 = chunkFQXZZBFJ_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 ? chunkFQXZZBFJ_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 ? chunkFQXZZBFJ_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
4135
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkFQXZZBFJ_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: chunkFQXZZBFJ_js.buildTextShadowCss(segmentStyle),
|
|
4138
|
+
filter: chunkFQXZZBFJ_js.buildTextRunFilterChain(segmentStyle),
|
|
4139
|
+
opacity: chunkFQXZZBFJ_js.getTextAlphaOpacity(segmentStyle),
|
|
4140
|
+
WebkitBoxReflect: chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
4193
4193
|
}
|
|
4194
4194
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
4195
4195
|
baseContent,
|
|
@@ -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 = chunkFQXZZBFJ_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
4300
4300
|
const isRtlParagraph = paraRtl === true;
|
|
4301
|
-
const paraAlign =
|
|
4302
|
-
const cssTextAlign =
|
|
4301
|
+
const paraAlign = chunkFQXZZBFJ_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
4302
|
+
const cssTextAlign = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
4307
4307
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
4308
4308
|
const paraStyle = {
|
|
4309
4309
|
...paraKinsokuStyle
|
|
@@ -4550,8 +4550,8 @@ 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 ${chunkFQXZZBFJ_js.colorWithOpacity(
|
|
4554
|
+
chunkFQXZZBFJ_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
4555
4555
|
opacity
|
|
4556
4556
|
)}`;
|
|
4557
4557
|
}
|
|
@@ -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 = chunkFQXZZBFJ_js.colorWithOpacity(chunkFQXZZBFJ_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
4569
4569
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
4570
4570
|
}
|
|
4571
4571
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -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 chunkFQXZZBFJ_js.build3DExtrusionData(
|
|
4778
4778
|
shape3d,
|
|
4779
4779
|
scene3d,
|
|
4780
4780
|
fillColor,
|
|
@@ -4783,7 +4783,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
4783
4783
|
);
|
|
4784
4784
|
}
|
|
4785
4785
|
function apply3dEffects2(base, scene3d, shape3d) {
|
|
4786
|
-
|
|
4786
|
+
chunkFQXZZBFJ_js.apply3dEffects(base, scene3d, shape3d);
|
|
4787
4787
|
}
|
|
4788
4788
|
|
|
4789
4789
|
// src/viewer/utils/shape-visual-style.ts
|
|
@@ -4792,18 +4792,18 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4792
4792
|
return {};
|
|
4793
4793
|
}
|
|
4794
4794
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
4795
|
-
const clipPath =
|
|
4795
|
+
const clipPath = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
4799
|
+
const fillGradient = chunkFQXZZBFJ_js.buildCssGradientFromShapeStyle(element.shapeStyle) || element.shapeStyle?.fillGradient;
|
|
4800
|
+
const shadowCss = chunkFQXZZBFJ_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
4801
|
+
const innerShadowCss = chunkFQXZZBFJ_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
4802
|
+
const resolvedFillColor = chunkFQXZZBFJ_js.colorWithOpacity(fillColor, fillOpacity);
|
|
4803
|
+
const resolvedStrokeColor = chunkFQXZZBFJ_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
4804
4804
|
const ss = element.shapeStyle;
|
|
4805
4805
|
const combinedShadowParts = [];
|
|
4806
|
-
const multiLayerShadow =
|
|
4806
|
+
const multiLayerShadow = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.colorWithOpacity(chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 ? chunkFQXZZBFJ_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : void 0,
|
|
4881
4881
|
borderColor: strokeWidth > 0 ? resolvedStrokeColor : void 0,
|
|
4882
|
-
borderStyle: strokeWidth > 0 ?
|
|
4882
|
+
borderStyle: strokeWidth > 0 ? chunkFQXZZBFJ_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: chunkFQXZZBFJ_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 chunkFQXZZBFJ_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 chunkFQXZZBFJ_js.clampUnitInterval(fallbackKey / 1e5);
|
|
4942
4942
|
}
|
|
4943
|
-
return
|
|
4943
|
+
return chunkFQXZZBFJ_js.clampUnitInterval(fallback);
|
|
4944
4944
|
}
|
|
4945
4945
|
function getConnectorPathGeometry(element) {
|
|
4946
4946
|
const width = Math.max(element.width, 1);
|
|
@@ -5071,10 +5071,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
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 = chunkFQXZZBFJ_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
5075
|
+
const strokePaint = chunkFQXZZBFJ_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
5076
|
+
const dashType = chunkFQXZZBFJ_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
5077
|
+
const dashArray = chunkFQXZZBFJ_js.getSvgStrokeDasharray(
|
|
5078
5078
|
dashType,
|
|
5079
5079
|
Math.max(strokeWidth, 1),
|
|
5080
5080
|
element.shapeStyle?.customDashSegments
|
|
@@ -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 = chunkFQXZZBFJ_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
5237
|
+
const widths = chunkFQXZZBFJ_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
5238
5238
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5239
5239
|
"svg",
|
|
5240
5240
|
{
|
|
@@ -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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.getResolvedShapeClipPath(element);
|
|
5313
5313
|
if (!clipPath) {
|
|
5314
5314
|
return void 0;
|
|
5315
5315
|
}
|
|
@@ -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 = chunkFQXZZBFJ_js.clampCropValue(element.cropLeft);
|
|
5329
|
+
const cropTop = chunkFQXZZBFJ_js.clampCropValue(element.cropTop);
|
|
5330
|
+
const cropRight = chunkFQXZZBFJ_js.clampCropValue(element.cropRight);
|
|
5331
|
+
const cropBottom = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
5344
|
+
const normalizedRight = chunkFQXZZBFJ_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
5345
|
+
const normalizedTop = chunkFQXZZBFJ_js.clampCropValue(cropTop * safeVerticalScale);
|
|
5346
|
+
const normalizedBottom = chunkFQXZZBFJ_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;
|
|
@@ -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 = chunkFQXZZBFJ_js.parseDrawingColor(gs) ?? "#888888";
|
|
5487
|
+
const opacity = chunkFQXZZBFJ_js.parseDrawingColorOpacity(gs);
|
|
5488
|
+
return { pos, color: chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
5530
|
+
const bgColor = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.parseDrawingColor(ln["a:solidFill"]);
|
|
5642
5642
|
if (color) {
|
|
5643
|
-
const opacity =
|
|
5643
|
+
const opacity = chunkFQXZZBFJ_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
5644
5644
|
const key = `${edge.prefix}`;
|
|
5645
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
5645
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkFQXZZBFJ_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
5756
5756
|
if (runColor) {
|
|
5757
|
-
const opacity =
|
|
5758
|
-
cellStyle.color =
|
|
5757
|
+
const opacity = chunkFQXZZBFJ_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
5758
|
+
cellStyle.color = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.parseDrawingColor(
|
|
5769
5769
|
cellProperties?.["a:solidFill"],
|
|
5770
5770
|
schemeColorOverrides
|
|
5771
5771
|
);
|
|
5772
5772
|
if (cellFill) {
|
|
5773
|
-
const opacity =
|
|
5773
|
+
const opacity = chunkFQXZZBFJ_js.parseDrawingColorOpacity(
|
|
5774
5774
|
cellProperties?.["a:solidFill"]
|
|
5775
5775
|
);
|
|
5776
|
-
cellStyle.backgroundColor =
|
|
5776
|
+
cellStyle.backgroundColor = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.parseDrawingColor(
|
|
5792
5792
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
5793
5793
|
schemeColorOverrides
|
|
5794
|
-
) ||
|
|
5794
|
+
) || chunkFQXZZBFJ_js.parseDrawingColor(
|
|
5795
5795
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
5796
5796
|
schemeColorOverrides
|
|
5797
|
-
) ||
|
|
5797
|
+
) || chunkFQXZZBFJ_js.parseDrawingColor(
|
|
5798
5798
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
5799
5799
|
schemeColorOverrides
|
|
5800
|
-
) ||
|
|
5800
|
+
) || chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.tintColor2(color, fill.tint / 1e5);
|
|
5880
5880
|
}
|
|
5881
5881
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
5882
|
-
color =
|
|
5882
|
+
color = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.tintColor2(color, text.fontTint / 1e5);
|
|
5905
5905
|
}
|
|
5906
5906
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
5907
|
-
color =
|
|
5907
|
+
color = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
6190
|
+
const bg = chunkFQXZZBFJ_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
6191
|
+
const svgPattern = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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(() => chunkFQXZZBFJ_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(chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.computeResizedRowHeight(
|
|
6353
|
+
drag.initialRowHeight ?? chunkFQXZZBFJ_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 ?? chunkFQXZZBFJ_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 chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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: chunkFQXZZBFJ_js.rectToCells(rect)
|
|
6504
6504
|
});
|
|
6505
6505
|
} else {
|
|
6506
6506
|
options?.onSelectCell?.({
|
|
@@ -6559,7 +6559,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6559
6559
|
if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
|
|
6560
6560
|
return renderTableFromTableData(tableEl2, textStyle, options);
|
|
6561
6561
|
}
|
|
6562
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
6562
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkWGLJ32FW_js.translationsEn["pptx.table.title"] });
|
|
6563
6563
|
}
|
|
6564
6564
|
const selectedCell = options?.selectedCell || null;
|
|
6565
6565
|
const isEditable2 = Boolean(options?.editable);
|
|
@@ -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 chunkFQXZZBFJ_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
|
+
chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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: chunkFQXZZBFJ_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 ? chunkFQXZZBFJ_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 [...chunkFQXZZBFJ_js.getChartStylePalette(chartData.style?.styleId)];
|
|
6722
6722
|
}
|
|
6723
6723
|
function buildReactChartViewModel(element) {
|
|
6724
6724
|
if (element.type !== "chart" || !element.chartData) {
|
|
6725
|
-
return
|
|
6725
|
+
return chunkFQXZZBFJ_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 chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.normalizeValue(entry.value, minVal, maxVal);
|
|
7160
|
+
fill = chunkFQXZZBFJ_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: chunkFQXZZBFJ_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 ? `: ${chunkFQXZZBFJ_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: chunkFQXZZBFJ_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: chunkFQXZZBFJ_js.formatAxisValue(maxVal)
|
|
7240
7240
|
},
|
|
7241
7241
|
`${element.id}-map-legend-max`
|
|
7242
7242
|
)
|
|
@@ -7255,7 +7255,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7255
7255
|
textAnchor: "middle",
|
|
7256
7256
|
fontSize: 7,
|
|
7257
7257
|
fill: "#94a3b8",
|
|
7258
|
-
children:
|
|
7258
|
+
children: chunkWGLJ32FW_js.translationsEn["pptx.chart.additionalRegionsFallback"]
|
|
7259
7259
|
},
|
|
7260
7260
|
`${element.id}-map-ft-hdr`
|
|
7261
7261
|
)
|
|
@@ -7302,7 +7302,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7302
7302
|
y,
|
|
7303
7303
|
fontSize,
|
|
7304
7304
|
fill: "#475569",
|
|
7305
|
-
children:
|
|
7305
|
+
children: chunkFQXZZBFJ_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 chunkFQXZZBFJ_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: chunkFQXZZBFJ_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: chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.generateLogTicks(range);
|
|
7909
7909
|
ticks.forEach((tickVal, i) => {
|
|
7910
|
-
const y =
|
|
7910
|
+
const y = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.generateLogTicks(range);
|
|
7956
7956
|
ticks.forEach((tickVal, i) => {
|
|
7957
|
-
const y =
|
|
7957
|
+
const y = chunkFQXZZBFJ_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 ? chunkFQXZZBFJ_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 ? chunkFQXZZBFJ_js.formatAxisValueWithUnits(val, axisFormatting) : chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 ? chunkFQXZZBFJ_js.formatAxisValueWithUnits(val, axisFormatting) : chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8189
8189
|
lines.push(
|
|
8190
8190
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8191
8191
|
"line",
|
|
@@ -8302,7 +8302,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
8302
8302
|
showK && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8303
8303
|
"th",
|
|
8304
8304
|
{
|
|
8305
|
-
"aria-label":
|
|
8305
|
+
"aria-label": chunkWGLJ32FW_js.translationsEn["pptx.chart.rowLabelsAria"],
|
|
8306
8306
|
style: {
|
|
8307
8307
|
padding: "1px 4px",
|
|
8308
8308
|
fontWeight: 400,
|
|
@@ -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: chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8389
|
+
const layout = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
8411
|
+
const lowY = chunkFQXZZBFJ_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
8412
|
+
const openY = chunkFQXZZBFJ_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
8413
|
+
const closeY = chunkFQXZZBFJ_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: chunkFQXZZBFJ_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-CBUOCCEN.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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
8643
|
+
const range = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8734
|
+
const range = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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: chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8874
|
+
const layout = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
8886
|
+
const barEndY = chunkFQXZZBFJ_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: chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
8969
|
+
const { primary, secondary } = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
8973
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkFQXZZBFJ_js.computeValueRange(secondarySeries) : void 0;
|
|
8974
|
+
const secondaryAxisFmt = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
8991
|
+
const valY = chunkFQXZZBFJ_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: chunkFQXZZBFJ_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: chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
9036
9036
|
return { x, y, val };
|
|
9037
9037
|
});
|
|
9038
|
-
const c =
|
|
9038
|
+
const c = chunkFQXZZBFJ_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: chunkFQXZZBFJ_js.formatAxisValue(p.val)
|
|
9066
9066
|
},
|
|
9067
9067
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
9068
9068
|
)
|
|
@@ -9100,11 +9100,11 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9100
9100
|
}
|
|
9101
9101
|
function renderChartElement(element) {
|
|
9102
9102
|
if (element.type !== "chart") {
|
|
9103
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
9103
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkWGLJ32FW_js.translationsEn["pptx.chart.heading"] });
|
|
9104
9104
|
}
|
|
9105
9105
|
const chartData = element.chartData;
|
|
9106
9106
|
if (!chartData || chartData.series.length === 0) {
|
|
9107
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
9107
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkWGLJ32FW_js.translationsEn["pptx.chart.heading"] });
|
|
9108
9108
|
}
|
|
9109
9109
|
const longestSeriesLength = chartData.series.reduce(
|
|
9110
9110
|
(maxLength, series) => Math.max(maxLength, series.values.length),
|
|
@@ -10621,7 +10621,7 @@ function PresentationMediaController({
|
|
|
10621
10621
|
}
|
|
10622
10622
|
function renderMediaElement(element, mediaDataUrls, options) {
|
|
10623
10623
|
if (element.type !== "media") {
|
|
10624
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
10624
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkWGLJ32FW_js.translationsEn["pptx.media.title"] });
|
|
10625
10625
|
}
|
|
10626
10626
|
const mediaType = element.mediaType;
|
|
10627
10627
|
const mediaPath = element.mediaPath;
|
|
@@ -10651,7 +10651,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
10651
10651
|
"img",
|
|
10652
10652
|
{
|
|
10653
10653
|
src: posterUrl,
|
|
10654
|
-
alt:
|
|
10654
|
+
alt: chunkWGLJ32FW_js.translationsEn["pptx.media.posterAlt"],
|
|
10655
10655
|
className: "w-full h-full object-contain opacity-50"
|
|
10656
10656
|
}
|
|
10657
10657
|
),
|
|
@@ -10672,7 +10672,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
10672
10672
|
]
|
|
10673
10673
|
}
|
|
10674
10674
|
),
|
|
10675
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children:
|
|
10675
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: chunkWGLJ32FW_js.translationsEn["pptx.media.notFound"] })
|
|
10676
10676
|
] })
|
|
10677
10677
|
] });
|
|
10678
10678
|
}
|
|
@@ -10713,7 +10713,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
10713
10713
|
"img",
|
|
10714
10714
|
{
|
|
10715
10715
|
src: posterUrl,
|
|
10716
|
-
alt:
|
|
10716
|
+
alt: chunkWGLJ32FW_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
10717
10717
|
className: "w-full h-full object-contain"
|
|
10718
10718
|
}
|
|
10719
10719
|
),
|
|
@@ -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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 (chunkFQXZZBFJ_js.isTemplateElementId(elementId)) {
|
|
11274
11274
|
const slideId = activeSlide?.id;
|
|
11275
11275
|
if (slideId) {
|
|
11276
11276
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -11324,14 +11324,14 @@ function useElementOperations(input) {
|
|
|
11324
11324
|
if (!selectedElement || !chunkOBLHB72P_js.hasTextProperties(selectedElement)) {
|
|
11325
11325
|
return;
|
|
11326
11326
|
}
|
|
11327
|
-
const inlineSel =
|
|
11327
|
+
const inlineSel = chunkFQXZZBFJ_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
11328
11328
|
if (inlineSel && selectedElement.textSegments) {
|
|
11329
|
-
const { newSegments: newSegments2, newSelection } =
|
|
11329
|
+
const { newSegments: newSegments2, newSelection } = chunkFQXZZBFJ_js.applyStyleToSelectedSegments(
|
|
11330
11330
|
selectedElement.textSegments,
|
|
11331
11331
|
inlineSel,
|
|
11332
11332
|
updates
|
|
11333
11333
|
);
|
|
11334
|
-
|
|
11334
|
+
chunkFQXZZBFJ_js.setPendingSelectionRestore(newSelection);
|
|
11335
11335
|
updateSelectedElement({
|
|
11336
11336
|
textSegments: newSegments2
|
|
11337
11337
|
});
|
|
@@ -11354,9 +11354,9 @@ function useElementOperations(input) {
|
|
|
11354
11354
|
if (!selectedElement || !chunkOBLHB72P_js.hasTextProperties(selectedElement)) {
|
|
11355
11355
|
return;
|
|
11356
11356
|
}
|
|
11357
|
-
const inlineSel =
|
|
11357
|
+
const inlineSel = chunkFQXZZBFJ_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
11358
11358
|
if (inlineSel && selectedElement.textSegments) {
|
|
11359
|
-
const newSegments =
|
|
11359
|
+
const newSegments = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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(chunkFQXZZBFJ_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(chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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: chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
11782
11782
|
if (marquee.additive) {
|
|
11783
|
-
const merged =
|
|
11783
|
+
const merged = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
11807
|
+
return chunkFQXZZBFJ_js.applyReroutedConnectors(movedElements, rerouted);
|
|
11808
11808
|
};
|
|
11809
11809
|
if (editTemplateMode) {
|
|
11810
11810
|
const slideId = activeSlide?.id;
|
|
@@ -11955,7 +11955,7 @@ function useCanvasInteractions(input) {
|
|
|
11955
11955
|
}
|
|
11956
11956
|
const el = elementLookup.get(editId);
|
|
11957
11957
|
if (el && chunkOBLHB72P_js.hasTextProperties(el)) {
|
|
11958
|
-
const newSegments =
|
|
11958
|
+
const newSegments = chunkFQXZZBFJ_js.remapTextToSegments(inlineEditingText, el.textSegments, el.textStyle);
|
|
11959
11959
|
ops.updateElementById(editId, {
|
|
11960
11960
|
text: inlineEditingText,
|
|
11961
11961
|
textSegments: newSegments
|
|
@@ -12201,7 +12201,7 @@ function createFileHandlers(deps) {
|
|
|
12201
12201
|
h = Math.round(h * scale);
|
|
12202
12202
|
}
|
|
12203
12203
|
addElement({
|
|
12204
|
-
id:
|
|
12204
|
+
id: chunkFQXZZBFJ_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: chunkFQXZZBFJ_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: chunkFQXZZBFJ_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: chunkFQXZZBFJ_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: chunkFQXZZBFJ_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: chunkFQXZZBFJ_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: chunkFQXZZBFJ_js.generateElementId(),
|
|
12494
12494
|
type: "shape",
|
|
12495
12495
|
x: 120,
|
|
12496
12496
|
y: 200,
|
|
@@ -12512,7 +12512,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12512
12512
|
if (!activeSlide) {
|
|
12513
12513
|
return;
|
|
12514
12514
|
}
|
|
12515
|
-
const preset =
|
|
12515
|
+
const preset = chunkFQXZZBFJ_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
12516
12516
|
if (!preset) {
|
|
12517
12517
|
return;
|
|
12518
12518
|
}
|
|
@@ -12525,7 +12525,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12525
12525
|
defaultPptxAction.highlightClick = true;
|
|
12526
12526
|
}
|
|
12527
12527
|
addElement({
|
|
12528
|
-
id:
|
|
12528
|
+
id: chunkFQXZZBFJ_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: chunkFQXZZBFJ_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: chunkFQXZZBFJ_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
|
+
...chunkFQXZZBFJ_js.newTableElement(DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
12630
|
+
id: chunkFQXZZBFJ_js.generateElementId()
|
|
12631
12631
|
});
|
|
12632
12632
|
};
|
|
12633
12633
|
const handleAddChart = (chartType) => {
|
|
12634
12634
|
if (!activeSlide) {
|
|
12635
12635
|
return;
|
|
12636
12636
|
}
|
|
12637
|
-
addElement(
|
|
12637
|
+
addElement(chunkFQXZZBFJ_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(chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
12725
12725
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
12726
12726
|
ops.applySelection(clone.id);
|
|
12727
12727
|
history.markDirty();
|
|
@@ -12931,7 +12931,7 @@ function useMergeShapesHandler(input) {
|
|
|
12931
12931
|
bounds.height
|
|
12932
12932
|
);
|
|
12933
12933
|
const newEl = {
|
|
12934
|
-
id:
|
|
12934
|
+
id: chunkFQXZZBFJ_js.generateElementId(),
|
|
12935
12935
|
type: "shape",
|
|
12936
12936
|
x: bounds.x,
|
|
12937
12937
|
y: bounds.y,
|
|
@@ -12990,7 +12990,7 @@ function useMergeShapesHandler(input) {
|
|
|
12990
12990
|
);
|
|
12991
12991
|
const primary = targets[0];
|
|
12992
12992
|
const newEl = {
|
|
12993
|
-
id:
|
|
12993
|
+
id: chunkFQXZZBFJ_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 } = chunkFQXZZBFJ_js.groupElements(ops.activeElements, ids, chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 ? chunkFQXZZBFJ_js.makeCloneId(true, child.id || group.id) : child.id || chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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" ? chunkFQXZZBFJ_js.bringForward(els, id) : direction === "backward" ? chunkFQXZZBFJ_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" ? chunkFQXZZBFJ_js.bringToFront(els, id) : chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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: chunkFQXZZBFJ_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
|
+
...chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.mergeCells(
|
|
13422
13422
|
[
|
|
13423
13423
|
{ row: rowIndex, col: columnIndex },
|
|
13424
13424
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -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 = chunkFQXZZBFJ_js.mergeCells(
|
|
13456
13456
|
[
|
|
13457
13457
|
{ row: rowIndex, col: columnIndex },
|
|
13458
13458
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -13475,7 +13475,7 @@ function createTableMergeHandlers(input) {
|
|
|
13475
13475
|
return;
|
|
13476
13476
|
}
|
|
13477
13477
|
const td = selectedElement.tableData;
|
|
13478
|
-
const newTableData =
|
|
13478
|
+
const newTableData = chunkFQXZZBFJ_js.mergeCells(ts.selectedCells, td);
|
|
13479
13479
|
const updates = { tableData: newTableData };
|
|
13480
13480
|
const newRawXml = chunkOBLHB72P_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13481
13481
|
if (newRawXml) {
|
|
@@ -13494,7 +13494,7 @@ function createTableMergeHandlers(input) {
|
|
|
13494
13494
|
}
|
|
13495
13495
|
const { rowIndex, columnIndex } = ts;
|
|
13496
13496
|
const td = selectedElement.tableData;
|
|
13497
|
-
const newTableData =
|
|
13497
|
+
const newTableData = chunkFQXZZBFJ_js.splitCell(rowIndex, columnIndex, td);
|
|
13498
13498
|
const updates = { tableData: newTableData };
|
|
13499
13499
|
const newRawXml = chunkOBLHB72P_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13500
13500
|
if (newRawXml) {
|
|
@@ -13628,7 +13628,7 @@ function createTableStructHandlers(input) {
|
|
|
13628
13628
|
return;
|
|
13629
13629
|
}
|
|
13630
13630
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
13631
|
-
const newTableData =
|
|
13631
|
+
const newTableData = chunkFQXZZBFJ_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
13632
13632
|
const updates = { tableData: newTableData };
|
|
13633
13633
|
const newRawXml = chunkOBLHB72P_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13634
13634
|
if (newRawXml) {
|
|
@@ -13643,7 +13643,7 @@ function createTableStructHandlers(input) {
|
|
|
13643
13643
|
}
|
|
13644
13644
|
const td = selectedElement.tableData;
|
|
13645
13645
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
13646
|
-
const newTableData =
|
|
13646
|
+
const newTableData = chunkFQXZZBFJ_js.deleteTableRow(td, rowIdx);
|
|
13647
13647
|
if (newTableData === td) {
|
|
13648
13648
|
return;
|
|
13649
13649
|
}
|
|
@@ -13660,7 +13660,7 @@ function createTableStructHandlers(input) {
|
|
|
13660
13660
|
return;
|
|
13661
13661
|
}
|
|
13662
13662
|
const colIdx = ts?.columnIndex ?? 0;
|
|
13663
|
-
const newTableData =
|
|
13663
|
+
const newTableData = chunkFQXZZBFJ_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
13664
13664
|
const updates = { tableData: newTableData };
|
|
13665
13665
|
const newRawXml = chunkOBLHB72P_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13666
13666
|
if (newRawXml) {
|
|
@@ -13675,7 +13675,7 @@ function createTableStructHandlers(input) {
|
|
|
13675
13675
|
}
|
|
13676
13676
|
const td = selectedElement.tableData;
|
|
13677
13677
|
const colIdx = ts?.columnIndex ?? 0;
|
|
13678
|
-
const newTableData =
|
|
13678
|
+
const newTableData = chunkFQXZZBFJ_js.deleteTableColumn(td, colIdx);
|
|
13679
13679
|
if (newTableData === td) {
|
|
13680
13680
|
return;
|
|
13681
13681
|
}
|
|
@@ -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 chunkFQXZZBFJ_js.normalizeColorsForCapture(doc, clonedEl);
|
|
13717
|
+
chunkFQXZZBFJ_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
|
+
chunkFQXZZBFJ_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,15 +13792,15 @@ 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(chunkFQXZZBFJ_js.canvasToJpegData(canvas));
|
|
13796
13796
|
}
|
|
13797
13797
|
onProgress?.(totalSlides, totalSlides);
|
|
13798
13798
|
setActiveSlide(currentSlideIndex);
|
|
13799
13799
|
if (images.length === 0) {
|
|
13800
|
-
throw new Error(
|
|
13800
|
+
throw new Error(chunkWGLJ32FW_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
13801
13801
|
}
|
|
13802
13802
|
const pdfBlobUrl = buildPdfFromImageData(images);
|
|
13803
|
-
|
|
13803
|
+
chunkFQXZZBFJ_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
13804
13804
|
}
|
|
13805
13805
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
13806
13806
|
const { scale = 2, onProgress } = options;
|
|
@@ -13846,10 +13846,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
13846
13846
|
onProgress?.(totalSlides, totalSlides);
|
|
13847
13847
|
setActiveSlide(currentSlideIndex);
|
|
13848
13848
|
if (pages.length === 0) {
|
|
13849
|
-
throw new Error(
|
|
13849
|
+
throw new Error(chunkWGLJ32FW_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
13850
13850
|
}
|
|
13851
13851
|
const pdfDataUrl = buildNotesPdf(pages);
|
|
13852
|
-
|
|
13852
|
+
chunkFQXZZBFJ_js.downloadDataUrl(pdfDataUrl, filename);
|
|
13853
13853
|
}
|
|
13854
13854
|
|
|
13855
13855
|
// src/viewer/utils/export-video.ts
|
|
@@ -13880,7 +13880,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
13880
13880
|
}
|
|
13881
13881
|
setActiveSlide(currentSlideIndex);
|
|
13882
13882
|
if (slideCanvases.length === 0) {
|
|
13883
|
-
throw new Error(
|
|
13883
|
+
throw new Error(chunkWGLJ32FW_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
13884
13884
|
}
|
|
13885
13885
|
const firstCanvas = slideCanvases[0];
|
|
13886
13886
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -13888,12 +13888,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
13888
13888
|
recordingCanvas.height = firstCanvas.height;
|
|
13889
13889
|
const ctx = recordingCanvas.getContext("2d");
|
|
13890
13890
|
if (!ctx) {
|
|
13891
|
-
throw new Error(
|
|
13891
|
+
throw new Error(chunkWGLJ32FW_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
13892
13892
|
}
|
|
13893
13893
|
const fps = 30;
|
|
13894
13894
|
const stream = recordingCanvas.captureStream(fps);
|
|
13895
13895
|
const recorder = new MediaRecorder(stream, {
|
|
13896
|
-
mimeType:
|
|
13896
|
+
mimeType: chunkFQXZZBFJ_js.pickSupportedMimeType([...chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.fpsToFrameIntervalMs(fps);
|
|
13920
|
+
const framesNeeded = chunkFQXZZBFJ_js.segmentFrameCount(duration, fps);
|
|
13921
13921
|
for (let f = 0; f < framesNeeded; f++) {
|
|
13922
13922
|
if (signal?.aborted) {
|
|
13923
13923
|
recorder.stop();
|
|
@@ -13964,9 +13964,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13964
13964
|
}
|
|
13965
13965
|
setActiveSlide(currentSlideIndex);
|
|
13966
13966
|
if (frames.length === 0) {
|
|
13967
|
-
throw new Error(
|
|
13967
|
+
throw new Error(chunkWGLJ32FW_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
13968
13968
|
}
|
|
13969
|
-
const gifBytes =
|
|
13969
|
+
const gifBytes = chunkFQXZZBFJ_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);
|
|
@@ -14108,7 +14108,7 @@ function useExportSaveAs(input) {
|
|
|
14108
14108
|
setExportProgress(95);
|
|
14109
14109
|
setExportStatusMessage("Downloading...");
|
|
14110
14110
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
14111
|
-
|
|
14111
|
+
chunkFQXZZBFJ_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
|
+
chunkFQXZZBFJ_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
14135
14135
|
} catch (err) {
|
|
14136
14136
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
14137
14137
|
}
|
|
@@ -14207,7 +14207,7 @@ function safeConfirm(message) {
|
|
|
14207
14207
|
}
|
|
14208
14208
|
}
|
|
14209
14209
|
function downloadBlob2(blob, filename) {
|
|
14210
|
-
|
|
14210
|
+
chunkFQXZZBFJ_js.downloadBlob(blob, chunkFQXZZBFJ_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(chunkFQXZZBFJ_js.slideProgressPercent(current, total));
|
|
14310
|
+
setExportStatusMessage(chunkFQXZZBFJ_js.slideStatusLabel("Rendering", current, total));
|
|
14311
14311
|
},
|
|
14312
14312
|
signal: abortCtrl.signal
|
|
14313
14313
|
}
|
|
14314
14314
|
);
|
|
14315
|
-
setExportProgress(
|
|
14315
|
+
setExportProgress(chunkFQXZZBFJ_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(chunkFQXZZBFJ_js.EXPORT_DONE_PERCENT);
|
|
14321
14321
|
setExportStatusMessage("Done!");
|
|
14322
14322
|
} catch (err) {
|
|
14323
|
-
if (!
|
|
14323
|
+
if (!chunkFQXZZBFJ_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(chunkFQXZZBFJ_js.slideProgressPercent(current, total));
|
|
14354
|
+
setExportStatusMessage(chunkFQXZZBFJ_js.slideStatusLabel("Rendering", current, total));
|
|
14355
14355
|
},
|
|
14356
14356
|
signal: abortCtrl.signal
|
|
14357
14357
|
}
|
|
14358
14358
|
);
|
|
14359
|
-
setExportProgress(
|
|
14359
|
+
setExportProgress(chunkFQXZZBFJ_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(chunkFQXZZBFJ_js.EXPORT_DONE_PERCENT);
|
|
14365
14365
|
setExportStatusMessage("Done!");
|
|
14366
14366
|
} catch (err) {
|
|
14367
|
-
if (!
|
|
14367
|
+
if (!chunkFQXZZBFJ_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(chunkFQXZZBFJ_js.slideProgressPercent(current, total, 45));
|
|
14409
|
+
setExportStatusMessage(chunkFQXZZBFJ_js.slideStatusLabel("Capturing", current, total));
|
|
14410
14410
|
},
|
|
14411
14411
|
onRecordProgress: (current, total) => {
|
|
14412
|
-
setExportProgress(
|
|
14413
|
-
setExportStatusMessage(
|
|
14412
|
+
setExportProgress(chunkFQXZZBFJ_js.recordProgressPercent(current, total));
|
|
14413
|
+
setExportStatusMessage(chunkFQXZZBFJ_js.slideStatusLabel("Recording", current, total));
|
|
14414
14414
|
},
|
|
14415
14415
|
signal: abortCtrl.signal
|
|
14416
14416
|
}
|
|
14417
14417
|
);
|
|
14418
|
-
setExportProgress(
|
|
14418
|
+
setExportProgress(chunkFQXZZBFJ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14419
14419
|
setExportStatusMessage("Saving file...");
|
|
14420
14420
|
downloadBlob2(blob, "presentation.webm");
|
|
14421
|
-
setExportProgress(
|
|
14421
|
+
setExportProgress(chunkFQXZZBFJ_js.EXPORT_DONE_PERCENT);
|
|
14422
14422
|
} catch (err) {
|
|
14423
|
-
if (!
|
|
14423
|
+
if (!chunkFQXZZBFJ_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(chunkFQXZZBFJ_js.slideProgressPercent(current, total));
|
|
14452
|
+
setExportStatusMessage(chunkFQXZZBFJ_js.slideStatusLabel("Encoding", current, total));
|
|
14453
14453
|
},
|
|
14454
14454
|
signal: abortCtrl.signal
|
|
14455
14455
|
}
|
|
14456
14456
|
);
|
|
14457
|
-
setExportProgress(
|
|
14457
|
+
setExportProgress(chunkFQXZZBFJ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14458
14458
|
setExportStatusMessage("Saving file...");
|
|
14459
14459
|
downloadBlob2(blob, "presentation.gif");
|
|
14460
|
-
setExportProgress(
|
|
14460
|
+
setExportProgress(chunkFQXZZBFJ_js.EXPORT_DONE_PERCENT);
|
|
14461
14461
|
} catch (err) {
|
|
14462
|
-
if (!
|
|
14462
|
+
if (!chunkFQXZZBFJ_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
|
+
chunkFQXZZBFJ_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 = chunkFQXZZBFJ_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">${chunkFQXZZBFJ_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
|
+
chunkFQXZZBFJ_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
|
+
chunkFQXZZBFJ_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
|
+
chunkFQXZZBFJ_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
14646
14646
|
"portrait",
|
|
14647
14647
|
colorFilter,
|
|
14648
14648
|
settings.frameSlides
|
|
@@ -14998,7 +14998,7 @@ function usePropertyHandlers(input) {
|
|
|
14998
14998
|
width: canvasSize.width,
|
|
14999
14999
|
height: canvasSize.height
|
|
15000
15000
|
};
|
|
15001
|
-
setCompareResult(
|
|
15001
|
+
setCompareResult(chunkFQXZZBFJ_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
|
+
chunkFQXZZBFJ_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(chunkFQXZZBFJ_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(chunkFQXZZBFJ_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 = chunkFQXZZBFJ_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
15242
|
+
const isTablet = !isMobile && containerWidth >= chunkFQXZZBFJ_js.MOBILE_BREAKPOINT && containerWidth < chunkFQXZZBFJ_js.TABLET_BREAKPOINT;
|
|
15243
|
+
const isDesktop = !isMobile && containerWidth >= chunkFQXZZBFJ_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" ? chunkFQXZZBFJ_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
15305
15305
|
);
|
|
15306
15306
|
React3.useEffect(() => {
|
|
15307
15307
|
const handleWindow = () => setIsNarrowViewport(
|
|
15308
|
-
|
|
15308
|
+
chunkFQXZZBFJ_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
|
+
chunkFQXZZBFJ_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
15323
15323
|
);
|
|
15324
15324
|
}
|
|
15325
15325
|
});
|
|
15326
15326
|
observer.observe(el);
|
|
15327
|
-
setIsNarrowViewport(
|
|
15327
|
+
setIsNarrowViewport(chunkFQXZZBFJ_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
15328
15328
|
};
|
|
15329
15329
|
attach();
|
|
15330
15330
|
window.addEventListener("resize", handleWindow);
|
|
@@ -15765,7 +15765,7 @@ function useSerialize(input) {
|
|
|
15765
15765
|
return {
|
|
15766
15766
|
...el,
|
|
15767
15767
|
text: pendingEditText,
|
|
15768
|
-
textSegments:
|
|
15768
|
+
textSegments: chunkFQXZZBFJ_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
15769
15769
|
};
|
|
15770
15770
|
});
|
|
15771
15771
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -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 = chunkFQXZZBFJ_js.copyFormatFromElement(selectedElement);
|
|
16162
16162
|
} else if (!formatPainterActive) {
|
|
16163
16163
|
copiedFormatRef.current = null;
|
|
16164
16164
|
}
|
|
@@ -16184,7 +16184,7 @@ function useEditorOperations(input) {
|
|
|
16184
16184
|
e.stopPropagation();
|
|
16185
16185
|
const element = elementLookup.get(elementId);
|
|
16186
16186
|
if (element) {
|
|
16187
|
-
const updated =
|
|
16187
|
+
const updated = chunkFQXZZBFJ_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
16188
16188
|
const updates = {};
|
|
16189
16189
|
if (chunkOBLHB72P_js.hasShapeProperties(updated)) {
|
|
16190
16190
|
updates.shapeStyle = updated.shapeStyle;
|
|
@@ -17130,7 +17130,7 @@ function useYjsProvider({ config }) {
|
|
|
17130
17130
|
syncGraceRef.current = setTimeout(() => {
|
|
17131
17131
|
syncGraceRef.current = null;
|
|
17132
17132
|
setSynced(true);
|
|
17133
|
-
},
|
|
17133
|
+
}, chunkFQXZZBFJ_js.INITIAL_SYNC_GRACE_MS);
|
|
17134
17134
|
}, [clearSyncGrace]);
|
|
17135
17135
|
const teardown = React3.useCallback(() => {
|
|
17136
17136
|
if (timeoutRef.current) {
|
|
@@ -17168,7 +17168,7 @@ function useYjsProvider({ config }) {
|
|
|
17168
17168
|
if (config.authToken) {
|
|
17169
17169
|
opts.password = config.authToken;
|
|
17170
17170
|
}
|
|
17171
|
-
const provider = new WebrtcProvider(
|
|
17171
|
+
const provider = new WebrtcProvider(chunkFQXZZBFJ_js.validateRoomId(config.roomId), yDoc, opts);
|
|
17172
17172
|
setDoc(yDoc);
|
|
17173
17173
|
setAwareness(provider.awareness);
|
|
17174
17174
|
setClientId(provider.awareness.clientID);
|
|
@@ -17205,12 +17205,12 @@ function useYjsProvider({ config }) {
|
|
|
17205
17205
|
if (!config) {
|
|
17206
17206
|
return;
|
|
17207
17207
|
}
|
|
17208
|
-
const roomId =
|
|
17208
|
+
const roomId = chunkFQXZZBFJ_js.validateRoomId(config.roomId);
|
|
17209
17209
|
if (config.transport === "webrtc") {
|
|
17210
17210
|
await initWebrtc();
|
|
17211
17211
|
return;
|
|
17212
17212
|
}
|
|
17213
|
-
if (
|
|
17213
|
+
if (chunkFQXZZBFJ_js.isMixedContentBlocked(config.serverUrl)) {
|
|
17214
17214
|
console.warn(
|
|
17215
17215
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
17216
17216
|
);
|
|
@@ -17267,7 +17267,7 @@ function useYjsProvider({ config }) {
|
|
|
17267
17267
|
cleanupRef.current = null;
|
|
17268
17268
|
setStatus("error");
|
|
17269
17269
|
}
|
|
17270
|
-
},
|
|
17270
|
+
}, chunkFQXZZBFJ_js.CONNECTION_TIMEOUT_MS);
|
|
17271
17271
|
}
|
|
17272
17272
|
setDoc(yDoc);
|
|
17273
17273
|
setAwareness(provider.awareness);
|
|
@@ -17342,7 +17342,7 @@ function usePresenceTracking({
|
|
|
17342
17342
|
awareness.setLocalStateField("presence", state);
|
|
17343
17343
|
lastBroadcastRef.current = Date.now();
|
|
17344
17344
|
};
|
|
17345
|
-
if (elapsed >=
|
|
17345
|
+
if (elapsed >= chunkFQXZZBFJ_js.BROADCAST_THROTTLE_MS) {
|
|
17346
17346
|
if (pendingBroadcastRef.current) {
|
|
17347
17347
|
clearTimeout(pendingBroadcastRef.current);
|
|
17348
17348
|
pendingBroadcastRef.current = null;
|
|
@@ -17352,7 +17352,7 @@ function usePresenceTracking({
|
|
|
17352
17352
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
17353
17353
|
pendingBroadcastRef.current = null;
|
|
17354
17354
|
flush();
|
|
17355
|
-
},
|
|
17355
|
+
}, chunkFQXZZBFJ_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
17356
17356
|
}
|
|
17357
17357
|
},
|
|
17358
17358
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -17377,7 +17377,7 @@ function usePresenceTracking({
|
|
|
17377
17377
|
return;
|
|
17378
17378
|
}
|
|
17379
17379
|
const handleChange = () => {
|
|
17380
|
-
const users =
|
|
17380
|
+
const users = chunkFQXZZBFJ_js.derivePresenceList(
|
|
17381
17381
|
awareness.getStates(),
|
|
17382
17382
|
localClientId,
|
|
17383
17383
|
canvasWidth,
|
|
@@ -17425,7 +17425,7 @@ function useCollaborativeState({
|
|
|
17425
17425
|
canvasWidth,
|
|
17426
17426
|
canvasHeight
|
|
17427
17427
|
}) {
|
|
17428
|
-
const userColor =
|
|
17428
|
+
const userColor = chunkFQXZZBFJ_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
17429
17429
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
17430
17430
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
17431
17431
|
awareness,
|
|
@@ -17531,7 +17531,7 @@ function useYjsDocumentSync({
|
|
|
17531
17531
|
const { PptxHandler: PptxHandler2 } = await import('./dist-MVSQ6PWP.js');
|
|
17532
17532
|
const handler = new PptxHandler2();
|
|
17533
17533
|
await handler.load(sourceBytes.buffer);
|
|
17534
|
-
const currentSlides =
|
|
17534
|
+
const currentSlides = chunkFQXZZBFJ_js.readSlidesFromYDoc(
|
|
17535
17535
|
doc
|
|
17536
17536
|
);
|
|
17537
17537
|
const slidesToSave = buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
@@ -17552,11 +17552,11 @@ function useYjsDocumentSync({
|
|
|
17552
17552
|
lastSyncedRef.current = serialized;
|
|
17553
17553
|
void (async () => {
|
|
17554
17554
|
const factories = await getFactories();
|
|
17555
|
-
|
|
17555
|
+
chunkFQXZZBFJ_js.reconcileSlidesInYDoc(
|
|
17556
17556
|
slides,
|
|
17557
17557
|
doc,
|
|
17558
17558
|
factories,
|
|
17559
|
-
|
|
17559
|
+
chunkFQXZZBFJ_js.LOCAL_SYNC_ORIGIN
|
|
17560
17560
|
);
|
|
17561
17561
|
scheduleWriteBack();
|
|
17562
17562
|
})();
|
|
@@ -17566,10 +17566,10 @@ function useYjsDocumentSync({
|
|
|
17566
17566
|
return;
|
|
17567
17567
|
}
|
|
17568
17568
|
const handleChange = (_events, transaction) => {
|
|
17569
|
-
if (transaction?.origin ===
|
|
17569
|
+
if (transaction?.origin === chunkFQXZZBFJ_js.LOCAL_SYNC_ORIGIN) {
|
|
17570
17570
|
return;
|
|
17571
17571
|
}
|
|
17572
|
-
const remoteSlides =
|
|
17572
|
+
const remoteSlides = chunkFQXZZBFJ_js.readSlidesFromYDoc(
|
|
17573
17573
|
doc
|
|
17574
17574
|
);
|
|
17575
17575
|
if (remoteSlides.length === 0) {
|
|
@@ -17587,7 +17587,7 @@ function useYjsDocumentSync({
|
|
|
17587
17587
|
});
|
|
17588
17588
|
scheduleWriteBack();
|
|
17589
17589
|
};
|
|
17590
|
-
const unobserve =
|
|
17590
|
+
const unobserve = chunkFQXZZBFJ_js.observeYDocSlides(
|
|
17591
17591
|
doc,
|
|
17592
17592
|
handleChange
|
|
17593
17593
|
);
|
|
@@ -17843,7 +17843,7 @@ function useTouchGestures(input) {
|
|
|
17843
17843
|
if (!el || !enabled) {
|
|
17844
17844
|
return;
|
|
17845
17845
|
}
|
|
17846
|
-
const recognizer =
|
|
17846
|
+
const recognizer = chunkFQXZZBFJ_js.createTouchGestureRecognizer({
|
|
17847
17847
|
getScale: () => scaleRef.current,
|
|
17848
17848
|
minScale: MIN_ZOOM_SCALE,
|
|
17849
17849
|
maxScale: MAX_ZOOM_SCALE,
|
|
@@ -17886,7 +17886,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
17886
17886
|
return;
|
|
17887
17887
|
}
|
|
17888
17888
|
const rect = active.getBoundingClientRect();
|
|
17889
|
-
const delta =
|
|
17889
|
+
const delta = chunkFQXZZBFJ_js.computeScrollDelta(
|
|
17890
17890
|
{ top: rect.top, bottom: rect.bottom },
|
|
17891
17891
|
window.innerHeight,
|
|
17892
17892
|
keyboardInset
|
|
@@ -17906,8 +17906,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
17906
17906
|
return;
|
|
17907
17907
|
}
|
|
17908
17908
|
const update = () => {
|
|
17909
|
-
const metrics =
|
|
17910
|
-
const inset = metrics ?
|
|
17909
|
+
const metrics = chunkFQXZZBFJ_js.readViewportMetrics(window);
|
|
17910
|
+
const inset = metrics ? chunkFQXZZBFJ_js.computeKeyboardInset(metrics) : 0;
|
|
17911
17911
|
setKeyboardInset(inset);
|
|
17912
17912
|
if (inset > 0) {
|
|
17913
17913
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -17918,8 +17918,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
17918
17918
|
vv.addEventListener("scroll", update);
|
|
17919
17919
|
const onFocusIn = () => {
|
|
17920
17920
|
window.requestAnimationFrame(() => {
|
|
17921
|
-
const metrics =
|
|
17922
|
-
const inset = metrics ?
|
|
17921
|
+
const metrics = chunkFQXZZBFJ_js.readViewportMetrics(window);
|
|
17922
|
+
const inset = metrics ? chunkFQXZZBFJ_js.computeKeyboardInset(metrics) : 0;
|
|
17923
17923
|
if (inset > 0) {
|
|
17924
17924
|
scrollFocusedIntoView(inset);
|
|
17925
17925
|
}
|
|
@@ -17932,7 +17932,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
17932
17932
|
document.removeEventListener("focusin", onFocusIn);
|
|
17933
17933
|
};
|
|
17934
17934
|
}, [enabled]);
|
|
17935
|
-
return { keyboardInset, isKeyboardOpen:
|
|
17935
|
+
return { keyboardInset, isKeyboardOpen: chunkFQXZZBFJ_js.isKeyboardOpen(keyboardInset) };
|
|
17936
17936
|
}
|
|
17937
17937
|
var LEFT_MIN = 120;
|
|
17938
17938
|
var LEFT_MAX = 400;
|