pptx-react-viewer 4.63.0 → 4.64.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 +52 -0
- package/dist/{AiChatPanel-7DESUEAZ.js → AiChatPanel-DRY6JUQE.js} +19 -19
- package/dist/AiChatPanel-DRY6JUQE.js.br +0 -0
- package/dist/AiChatPanel-DRY6JUQE.js.gz +0 -0
- package/dist/{AiChatPanel-GQ64SIYP.mjs → AiChatPanel-KBSDSD5Y.mjs} +1 -1
- package/dist/AiChatPanel-KBSDSD5Y.mjs.br +0 -0
- package/dist/AiChatPanel-KBSDSD5Y.mjs.gz +0 -0
- package/dist/ai.js +2 -2
- package/dist/ai.js.br +0 -0
- package/dist/ai.js.gz +0 -0
- package/dist/ai.mjs +1 -1
- package/dist/ai.mjs.br +0 -0
- package/dist/ai.mjs.gz +0 -0
- package/dist/{chunk-MR3ZSEHS.mjs → chunk-46VMP4EH.mjs} +2 -1
- package/dist/chunk-46VMP4EH.mjs.br +0 -0
- package/dist/chunk-46VMP4EH.mjs.gz +0 -0
- package/dist/{chunk-TXVGYIO6.js → chunk-73SDWM6K.js} +440 -425
- package/dist/chunk-73SDWM6K.js.br +0 -0
- package/dist/chunk-73SDWM6K.js.gz +0 -0
- package/dist/{chunk-F6WCYCHV.js → chunk-7UFO4OZQ.js} +1 -1
- package/dist/chunk-7UFO4OZQ.js.br +0 -0
- package/dist/chunk-7UFO4OZQ.js.gz +0 -0
- package/dist/{chunk-FYQVCABH.mjs → chunk-FYYQ4OGF.mjs} +243 -227
- package/dist/chunk-FYYQ4OGF.mjs.br +0 -0
- package/dist/chunk-FYYQ4OGF.mjs.gz +0 -0
- package/dist/{chunk-5KFSMXI4.js → chunk-JKSUB7DR.js} +5 -0
- package/dist/chunk-JKSUB7DR.js.br +0 -0
- package/dist/{chunk-5KFSMXI4.js.gz → chunk-JKSUB7DR.js.gz} +0 -0
- package/dist/{chunk-G5XPJCS5.js → chunk-PX46BOMQ.js} +832 -651
- package/dist/chunk-PX46BOMQ.js.br +0 -0
- package/dist/chunk-PX46BOMQ.js.gz +0 -0
- package/dist/{chunk-NE5JQMED.mjs → chunk-SGWF6GUX.mjs} +1 -1
- package/dist/chunk-SGWF6GUX.mjs.br +0 -0
- package/dist/chunk-SGWF6GUX.mjs.gz +0 -0
- package/dist/{chunk-XCOYNPXR.mjs → chunk-SHI3PQ5F.mjs} +281 -100
- package/dist/chunk-SHI3PQ5F.mjs.br +0 -0
- package/dist/chunk-SHI3PQ5F.mjs.gz +0 -0
- package/dist/i18n/de.cjs +89 -43
- package/dist/i18n/de.cjs.br +0 -0
- package/dist/i18n/de.cjs.gz +0 -0
- package/dist/i18n/de.mjs +89 -43
- package/dist/i18n/de.mjs.br +0 -0
- package/dist/i18n/de.mjs.gz +0 -0
- package/dist/i18n/es.cjs +89 -43
- package/dist/i18n/es.cjs.br +0 -0
- package/dist/i18n/es.cjs.gz +0 -0
- package/dist/i18n/es.mjs +89 -43
- package/dist/i18n/es.mjs.br +0 -0
- package/dist/i18n/es.mjs.gz +0 -0
- package/dist/i18n/fr.cjs +89 -43
- package/dist/i18n/fr.cjs.br +0 -0
- package/dist/i18n/fr.cjs.gz +0 -0
- package/dist/i18n/fr.mjs +89 -43
- package/dist/i18n/fr.mjs.br +0 -0
- package/dist/i18n/fr.mjs.gz +0 -0
- package/dist/i18n/zh-CN.cjs +95 -49
- package/dist/i18n/zh-CN.cjs.br +0 -0
- package/dist/i18n/zh-CN.cjs.gz +0 -0
- package/dist/i18n/zh-CN.mjs +95 -49
- package/dist/i18n/zh-CN.mjs.br +0 -0
- package/dist/i18n/zh-CN.mjs.gz +0 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.js +27 -27
- 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/internals.d.ts +10 -0
- package/dist/internals.js +81 -81
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +2 -2
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer-canvas.css +1 -1
- package/dist/pptx-viewer-canvas.css.br +0 -0
- package/dist/pptx-viewer-canvas.css.gz +0 -0
- package/dist/viewer/index.d.ts +10 -1
- package/dist/viewer/index.js +21 -21
- 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 +3 -3
- package/dist/AiChatPanel-7DESUEAZ.js.br +0 -0
- package/dist/AiChatPanel-7DESUEAZ.js.gz +0 -0
- package/dist/AiChatPanel-GQ64SIYP.mjs.br +0 -0
- package/dist/AiChatPanel-GQ64SIYP.mjs.gz +0 -0
- package/dist/chunk-5KFSMXI4.js.br +0 -0
- package/dist/chunk-F6WCYCHV.js.br +0 -0
- package/dist/chunk-F6WCYCHV.js.gz +0 -0
- package/dist/chunk-FYQVCABH.mjs.br +0 -0
- package/dist/chunk-FYQVCABH.mjs.gz +0 -0
- package/dist/chunk-G5XPJCS5.js.br +0 -0
- package/dist/chunk-G5XPJCS5.js.gz +0 -0
- package/dist/chunk-MR3ZSEHS.mjs.br +0 -0
- package/dist/chunk-MR3ZSEHS.mjs.gz +0 -0
- package/dist/chunk-NE5JQMED.mjs.br +0 -0
- package/dist/chunk-NE5JQMED.mjs.gz +0 -0
- package/dist/chunk-TXVGYIO6.js.br +0 -0
- package/dist/chunk-TXVGYIO6.js.gz +0 -0
- package/dist/chunk-XCOYNPXR.mjs.br +0 -0
- package/dist/chunk-XCOYNPXR.mjs.gz +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkJKSUB7DR_js = require('./chunk-JKSUB7DR.js');
|
|
4
4
|
var pptx = require('ooxml-ui/pptx');
|
|
5
5
|
var React17 = require('react');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -604,9 +604,9 @@ function differsOnlyInMasterSet(previous, next) {
|
|
|
604
604
|
}
|
|
605
605
|
function recordExplicitSlideUpdate(history, previous, before, label) {
|
|
606
606
|
if (previous && serializeHistoryDocument(previous) !== serializeHistoryDocument(before)) {
|
|
607
|
-
history.record(
|
|
607
|
+
history.record(chunkJKSUB7DR_js.cloneHistorySnapshot(previous), previous.actionLabel);
|
|
608
608
|
}
|
|
609
|
-
history.record({ ...
|
|
609
|
+
history.record({ ...chunkJKSUB7DR_js.cloneHistorySnapshot(before), actionLabel: label }, label);
|
|
610
610
|
}
|
|
611
611
|
var POLL_INTERVAL_MS = 16;
|
|
612
612
|
function usePointerReleaseWakeup(hasActivePointerInteraction) {
|
|
@@ -688,8 +688,8 @@ function useEditorHistory(input) {
|
|
|
688
688
|
width: canvasSize.width,
|
|
689
689
|
height: canvasSize.height,
|
|
690
690
|
activeSlideIndex,
|
|
691
|
-
slides: slides.map(
|
|
692
|
-
templateElementsBySlideId:
|
|
691
|
+
slides: slides.map(chunkJKSUB7DR_js.cloneSlide),
|
|
692
|
+
templateElementsBySlideId: chunkJKSUB7DR_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
693
693
|
...recordedTheme ? { theme: recordedTheme } : {},
|
|
694
694
|
...actionLabel ? { actionLabel } : {}
|
|
695
695
|
};
|
|
@@ -703,9 +703,9 @@ function useEditorHistory(input) {
|
|
|
703
703
|
width: snapshot.width,
|
|
704
704
|
height: snapshot.height
|
|
705
705
|
});
|
|
706
|
-
setSlides(snapshot.slides.map(
|
|
706
|
+
setSlides(snapshot.slides.map(chunkJKSUB7DR_js.cloneSlide));
|
|
707
707
|
setTemplateElementsBySlideId(
|
|
708
|
-
|
|
708
|
+
chunkJKSUB7DR_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
709
709
|
);
|
|
710
710
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
711
711
|
setSelectedElementIds([]);
|
|
@@ -771,8 +771,8 @@ function useEditorHistory(input) {
|
|
|
771
771
|
return;
|
|
772
772
|
}
|
|
773
773
|
isApplyingHistoryRef.current = true;
|
|
774
|
-
const nextSnapshot =
|
|
775
|
-
lastHistorySnapshotRef.current =
|
|
774
|
+
const nextSnapshot = chunkJKSUB7DR_js.cloneHistorySnapshot(result.snapshot);
|
|
775
|
+
lastHistorySnapshotRef.current = chunkJKSUB7DR_js.cloneHistorySnapshot(nextSnapshot);
|
|
776
776
|
lastHistorySerializedRef.current = serializeHistoryDocument(nextSnapshot);
|
|
777
777
|
applyHistorySnapshot(nextSnapshot);
|
|
778
778
|
restoreTheme(currentSnapshot, nextSnapshot);
|
|
@@ -796,8 +796,8 @@ function useEditorHistory(input) {
|
|
|
796
796
|
return;
|
|
797
797
|
}
|
|
798
798
|
isApplyingHistoryRef.current = true;
|
|
799
|
-
const targetSnapshot =
|
|
800
|
-
lastHistorySnapshotRef.current =
|
|
799
|
+
const targetSnapshot = chunkJKSUB7DR_js.cloneHistorySnapshot(result.snapshot);
|
|
800
|
+
lastHistorySnapshotRef.current = chunkJKSUB7DR_js.cloneHistorySnapshot(targetSnapshot);
|
|
801
801
|
lastHistorySerializedRef.current = serializeHistoryDocument(targetSnapshot);
|
|
802
802
|
applyHistorySnapshot(targetSnapshot);
|
|
803
803
|
restoreTheme(currentSnapshot, targetSnapshot);
|
|
@@ -815,7 +815,7 @@ function useEditorHistory(input) {
|
|
|
815
815
|
(initialSnapshot) => {
|
|
816
816
|
history.clear();
|
|
817
817
|
if (initialSnapshot) {
|
|
818
|
-
const clonedInitial =
|
|
818
|
+
const clonedInitial = chunkJKSUB7DR_js.cloneHistorySnapshot(initialSnapshot);
|
|
819
819
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
820
820
|
lastHistorySerializedRef.current = serializeHistoryDocument(clonedInitial);
|
|
821
821
|
} else {
|
|
@@ -889,16 +889,16 @@ function useEditorHistory(input) {
|
|
|
889
889
|
slides
|
|
890
890
|
]);
|
|
891
891
|
const commitSlides = (nextSlides, label, beforeSlides = slides, nextSlideMasters) => {
|
|
892
|
-
const before = { ...buildHistorySnapshot(), slides: beforeSlides.map(
|
|
892
|
+
const before = { ...buildHistorySnapshot(), slides: beforeSlides.map(chunkJKSUB7DR_js.cloneSlide) };
|
|
893
893
|
const { theme: beforeTheme, ...unthemed } = before;
|
|
894
894
|
const afterTheme = nextSlideMasters ? pptx.historyTheme(theme, nextSlideMasters) : beforeTheme;
|
|
895
895
|
const after = {
|
|
896
896
|
...unthemed,
|
|
897
|
-
slides: nextSlides.map(
|
|
897
|
+
slides: nextSlides.map(chunkJKSUB7DR_js.cloneSlide),
|
|
898
898
|
...afterTheme ? { theme: afterTheme } : {}
|
|
899
899
|
};
|
|
900
900
|
recordExplicitSlideUpdate(history, lastHistorySnapshotRef.current, before, label);
|
|
901
|
-
lastHistorySnapshotRef.current =
|
|
901
|
+
lastHistorySnapshotRef.current = chunkJKSUB7DR_js.cloneHistorySnapshot(after);
|
|
902
902
|
lastHistorySerializedRef.current = serializeHistoryDocument(after);
|
|
903
903
|
isApplyingHistoryRef.current = false;
|
|
904
904
|
setSlides(nextSlides);
|
|
@@ -907,6 +907,11 @@ function useEditorHistory(input) {
|
|
|
907
907
|
const holdTracking = React17.useCallback((held) => {
|
|
908
908
|
trackingHeldRef.current = held;
|
|
909
909
|
}, []);
|
|
910
|
+
const markSaved = React17.useCallback(() => {
|
|
911
|
+
const snapshot = buildHistorySnapshot();
|
|
912
|
+
lastHistorySnapshotRef.current = snapshot;
|
|
913
|
+
lastHistorySerializedRef.current = serializeHistoryDocument(snapshot);
|
|
914
|
+
}, [buildHistorySnapshot]);
|
|
910
915
|
return {
|
|
911
916
|
commitSlides,
|
|
912
917
|
holdTracking,
|
|
@@ -920,6 +925,7 @@ function useEditorHistory(input) {
|
|
|
920
925
|
forgetHistory: history.forget,
|
|
921
926
|
attachCollaboration: history.attachCollaboration,
|
|
922
927
|
markDirty,
|
|
928
|
+
markSaved,
|
|
923
929
|
withoutUndoStep,
|
|
924
930
|
buildHistorySnapshot
|
|
925
931
|
};
|
|
@@ -1086,22 +1092,22 @@ function useZoomViewport({
|
|
|
1086
1092
|
selectedElements.forEach((element) => {
|
|
1087
1093
|
minX = Math.min(minX, element.x);
|
|
1088
1094
|
minY = Math.min(minY, element.y);
|
|
1089
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
1090
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
1095
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkJKSUB7DR_js.MIN_ELEMENT_SIZE));
|
|
1096
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkJKSUB7DR_js.MIN_ELEMENT_SIZE));
|
|
1091
1097
|
});
|
|
1092
1098
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
1093
1099
|
return;
|
|
1094
1100
|
}
|
|
1095
1101
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
1096
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
1097
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
1102
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkJKSUB7DR_js.MIN_ELEMENT_SIZE);
|
|
1103
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkJKSUB7DR_js.MIN_ELEMENT_SIZE);
|
|
1098
1104
|
const availableWidth = Math.max(
|
|
1099
|
-
effectiveEditorDimensions.width -
|
|
1100
|
-
|
|
1105
|
+
effectiveEditorDimensions.width - chunkJKSUB7DR_js.ZOOM_TO_SELECTION_PADDING,
|
|
1106
|
+
chunkJKSUB7DR_js.MIN_ELEMENT_SIZE
|
|
1101
1107
|
);
|
|
1102
1108
|
const availableHeight = Math.max(
|
|
1103
|
-
effectiveEditorDimensions.height -
|
|
1104
|
-
|
|
1109
|
+
effectiveEditorDimensions.height - chunkJKSUB7DR_js.ZOOM_TO_SELECTION_PADDING,
|
|
1110
|
+
chunkJKSUB7DR_js.MIN_ELEMENT_SIZE
|
|
1105
1111
|
);
|
|
1106
1112
|
const targetEditorScale = Math.min(
|
|
1107
1113
|
availableWidth / boundsWidth,
|
|
@@ -2915,9 +2921,13 @@ function usePresentationMode(input) {
|
|
|
2915
2921
|
// `PresentationStage` stacks the incoming slide's elements above its
|
|
2916
2922
|
// template shapes (`zIndex = templateElements.length + index`), so a
|
|
2917
2923
|
// z-index journey has to start counting where the stage does.
|
|
2918
|
-
|
|
2924
|
+
// A turning flip is seen from the slide's centre (shared `morph-flip-turn`).
|
|
2925
|
+
{
|
|
2926
|
+
zIndexBase: incoming ? templateElementsBySlideId?.[incoming.id]?.length ?? 0 : 0,
|
|
2927
|
+
...canvasSize ? { slideSize: canvasSize } : {}
|
|
2928
|
+
}
|
|
2919
2929
|
);
|
|
2920
|
-
}, [transitionOverlay, slides, templateElementsBySlideId]);
|
|
2930
|
+
}, [transitionOverlay, slides, templateElementsBySlideId, canvasSize]);
|
|
2921
2931
|
const morphedElementStates = React17.useMemo(() => {
|
|
2922
2932
|
if (!morphPlan || morphPlan.incomingAnimations.size === 0) {
|
|
2923
2933
|
return presentationElementStates;
|
|
@@ -4016,8 +4026,8 @@ function useViewerCoreState(_input) {
|
|
|
4016
4026
|
const { slides, setSlides, slidesRef } = useSlideState();
|
|
4017
4027
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = React17.useState({});
|
|
4018
4028
|
const [canvasSize, setCanvasSize] = React17.useState({
|
|
4019
|
-
width:
|
|
4020
|
-
height:
|
|
4029
|
+
width: chunkJKSUB7DR_js.DEFAULT_CANVAS_WIDTH,
|
|
4030
|
+
height: chunkJKSUB7DR_js.DEFAULT_CANVAS_HEIGHT
|
|
4021
4031
|
});
|
|
4022
4032
|
const [slideSizeEmu, setSlideSizeEmu] = React17.useState();
|
|
4023
4033
|
const [activeSlideIndex, setActiveSlideIndex] = React17.useState(0);
|
|
@@ -4409,7 +4419,7 @@ function useLoadContent({
|
|
|
4409
4419
|
initialSlideRef.current = initialSlide;
|
|
4410
4420
|
const limitsRef = React17.useRef(limits);
|
|
4411
4421
|
limitsRef.current = limits;
|
|
4412
|
-
const { t } =
|
|
4422
|
+
const { t } = chunkJKSUB7DR_js.useTranslation();
|
|
4413
4423
|
const translateRef = React17.useRef(t);
|
|
4414
4424
|
translateRef.current = t;
|
|
4415
4425
|
const originalBufferRef = React17.useRef(null);
|
|
@@ -4509,12 +4519,12 @@ function useLoadContent({
|
|
|
4509
4519
|
}
|
|
4510
4520
|
resources.commit();
|
|
4511
4521
|
handlerRef.current = handler;
|
|
4512
|
-
const partition =
|
|
4522
|
+
const partition = chunkJKSUB7DR_js.partitionTemplateElements(nextSlides);
|
|
4513
4523
|
setSlides(partition.slides);
|
|
4514
4524
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4515
4525
|
setCanvasSize({
|
|
4516
|
-
width: parsed.width ??
|
|
4517
|
-
height: parsed.height ??
|
|
4526
|
+
width: parsed.width ?? chunkJKSUB7DR_js.DEFAULT_CANVAS_WIDTH,
|
|
4527
|
+
height: parsed.height ?? chunkJKSUB7DR_js.DEFAULT_CANVAS_HEIGHT
|
|
4518
4528
|
});
|
|
4519
4529
|
setSlideSizeEmu(
|
|
4520
4530
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4930,7 +4940,7 @@ function useElementOperations(input) {
|
|
|
4930
4940
|
);
|
|
4931
4941
|
return;
|
|
4932
4942
|
}
|
|
4933
|
-
if (
|
|
4943
|
+
if (chunkJKSUB7DR_js.isTemplateElementId(elementId)) {
|
|
4934
4944
|
const slideId = activeSlide?.id;
|
|
4935
4945
|
if (slideId) {
|
|
4936
4946
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -5217,8 +5227,8 @@ function createCanvasGestures(getInput, frames = animationFrames) {
|
|
|
5217
5227
|
}
|
|
5218
5228
|
function paintResize(resize, transform) {
|
|
5219
5229
|
const { x, y } = transform;
|
|
5220
|
-
const width = Math.max(transform.width,
|
|
5221
|
-
const height = Math.max(transform.height,
|
|
5230
|
+
const width = Math.max(transform.width, chunkJKSUB7DR_js.MIN_ELEMENT_SIZE);
|
|
5231
|
+
const height = Math.max(transform.height, chunkJKSUB7DR_js.MIN_ELEMENT_SIZE);
|
|
5222
5232
|
resize.lastX = x;
|
|
5223
5233
|
resize.lastY = y;
|
|
5224
5234
|
resize.lastWidth = transform.width;
|
|
@@ -5275,7 +5285,7 @@ function createCanvasGestures(getInput, frames = animationFrames) {
|
|
|
5275
5285
|
getGridSize: () => getInput().gridSpacingPx,
|
|
5276
5286
|
getSnapToShape: () => getInput().snapToShape,
|
|
5277
5287
|
getGuides: () => getInput().guides.map(({ axis, position }) => ({ axis, position })),
|
|
5278
|
-
getMinSize: () =>
|
|
5288
|
+
getMinSize: () => chunkJKSUB7DR_js.MIN_ELEMENT_SIZE,
|
|
5279
5289
|
getSnapExcludeIds: () => armed?.kind === "move" ? Object.keys(armed.drag.startPositionsById) : [],
|
|
5280
5290
|
getStageOrigin: () => {
|
|
5281
5291
|
const rect = getInput().canvasStageRef.current?.getBoundingClientRect();
|
|
@@ -5356,7 +5366,7 @@ function commitMove(input, drag) {
|
|
|
5356
5366
|
const start = drag.startPositionsById[el.id];
|
|
5357
5367
|
return start ? { ...el, x: start.x + dx, y: start.y + dy } : el;
|
|
5358
5368
|
});
|
|
5359
|
-
return
|
|
5369
|
+
return chunkJKSUB7DR_js.applyReroutedConnectors(moved, chunkJKSUB7DR_js.rerouteConnectorsForMovedElements(moved, movedIds));
|
|
5360
5370
|
};
|
|
5361
5371
|
if (input.editTemplateMode) {
|
|
5362
5372
|
const slideId = input.activeSlide?.id;
|
|
@@ -5387,8 +5397,8 @@ function commitResize(input, resize) {
|
|
|
5387
5397
|
if (i !== input.activeSlideIndex) {
|
|
5388
5398
|
return s;
|
|
5389
5399
|
}
|
|
5390
|
-
const rerouted =
|
|
5391
|
-
return rerouted.length === 0 ? s : { ...s, elements:
|
|
5400
|
+
const rerouted = chunkJKSUB7DR_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
5401
|
+
return rerouted.length === 0 ? s : { ...s, elements: chunkJKSUB7DR_js.applyReroutedConnectors(s.elements, rerouted) };
|
|
5392
5402
|
})
|
|
5393
5403
|
);
|
|
5394
5404
|
}
|
|
@@ -6223,7 +6233,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
6223
6233
|
return;
|
|
6224
6234
|
}
|
|
6225
6235
|
const resolved = resolveHyperlinkEditResult(data);
|
|
6226
|
-
if (resolved.url && !
|
|
6236
|
+
if (resolved.url && !chunkJKSUB7DR_js.isUrlSafe(resolved.url)) {
|
|
6227
6237
|
return;
|
|
6228
6238
|
}
|
|
6229
6239
|
const actionClick = {
|
|
@@ -6269,7 +6279,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
6269
6279
|
if (!activeSlide) {
|
|
6270
6280
|
return;
|
|
6271
6281
|
}
|
|
6272
|
-
const preset =
|
|
6282
|
+
const preset = chunkJKSUB7DR_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
6273
6283
|
if (!preset) {
|
|
6274
6284
|
return;
|
|
6275
6285
|
}
|
|
@@ -6356,7 +6366,7 @@ function useInsertElements(input) {
|
|
|
6356
6366
|
width: 300,
|
|
6357
6367
|
height: 60,
|
|
6358
6368
|
text: "",
|
|
6359
|
-
textStyle: { fontSize:
|
|
6369
|
+
textStyle: { fontSize: chunkJKSUB7DR_js.DEFAULT_TEXT_FONT_SIZE }
|
|
6360
6370
|
});
|
|
6361
6371
|
};
|
|
6362
6372
|
const handleAddShape = () => {
|
|
@@ -6378,7 +6388,7 @@ function useInsertElements(input) {
|
|
|
6378
6388
|
}
|
|
6379
6389
|
});
|
|
6380
6390
|
};
|
|
6381
|
-
const handleAddTable = (rows =
|
|
6391
|
+
const handleAddTable = (rows = chunkJKSUB7DR_js.DEFAULT_TABLE_ROWS, columns = chunkJKSUB7DR_js.DEFAULT_TABLE_COLUMNS) => {
|
|
6382
6392
|
if (!activeSlide) {
|
|
6383
6393
|
return;
|
|
6384
6394
|
}
|
|
@@ -6552,7 +6562,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6552
6562
|
history
|
|
6553
6563
|
} = input;
|
|
6554
6564
|
const updateElementsOwning = (elementId, updater) => {
|
|
6555
|
-
if (editTemplateMode && !
|
|
6565
|
+
if (editTemplateMode && !chunkJKSUB7DR_js.isTemplateElementId(elementId)) {
|
|
6556
6566
|
ops.updateSlides(
|
|
6557
6567
|
(prev) => prev.map(
|
|
6558
6568
|
(slide, index) => index === activeSlideIndex ? { ...slide, elements: updater(slide.elements) } : slide
|
|
@@ -6586,9 +6596,9 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6586
6596
|
return;
|
|
6587
6597
|
}
|
|
6588
6598
|
const group = selectedElement;
|
|
6589
|
-
const intoTemplate =
|
|
6599
|
+
const intoTemplate = chunkJKSUB7DR_js.isTemplateElementId(group.id);
|
|
6590
6600
|
const childIds = group.children.map(
|
|
6591
|
-
(child) => intoTemplate ?
|
|
6601
|
+
(child) => intoTemplate ? chunkJKSUB7DR_js.makeCloneId(true, child.id || group.id) : child.id || pptx.generateElementId()
|
|
6592
6602
|
);
|
|
6593
6603
|
const { elements, childIds: usedIds } = pptx.ungroupElements(
|
|
6594
6604
|
ops.activeElements,
|
|
@@ -7024,7 +7034,7 @@ function createTableMergeHandlers(input) {
|
|
|
7024
7034
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
7025
7035
|
return;
|
|
7026
7036
|
}
|
|
7027
|
-
const newTableData =
|
|
7037
|
+
const newTableData = chunkJKSUB7DR_js.mergeCells(
|
|
7028
7038
|
[
|
|
7029
7039
|
{ row: rowIndex, col: columnIndex },
|
|
7030
7040
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -7032,7 +7042,7 @@ function createTableMergeHandlers(input) {
|
|
|
7032
7042
|
td
|
|
7033
7043
|
);
|
|
7034
7044
|
const updates = { tableData: newTableData };
|
|
7035
|
-
const newRawXml =
|
|
7045
|
+
const newRawXml = chunkJKSUB7DR_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7036
7046
|
if (newRawXml) {
|
|
7037
7047
|
updates.rawXml = newRawXml;
|
|
7038
7048
|
}
|
|
@@ -7058,7 +7068,7 @@ function createTableMergeHandlers(input) {
|
|
|
7058
7068
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
7059
7069
|
return;
|
|
7060
7070
|
}
|
|
7061
|
-
const newTableData =
|
|
7071
|
+
const newTableData = chunkJKSUB7DR_js.mergeCells(
|
|
7062
7072
|
[
|
|
7063
7073
|
{ row: rowIndex, col: columnIndex },
|
|
7064
7074
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -7066,7 +7076,7 @@ function createTableMergeHandlers(input) {
|
|
|
7066
7076
|
td
|
|
7067
7077
|
);
|
|
7068
7078
|
const updates = { tableData: newTableData };
|
|
7069
|
-
const newRawXml =
|
|
7079
|
+
const newRawXml = chunkJKSUB7DR_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7070
7080
|
if (newRawXml) {
|
|
7071
7081
|
updates.rawXml = newRawXml;
|
|
7072
7082
|
}
|
|
@@ -7081,9 +7091,9 @@ function createTableMergeHandlers(input) {
|
|
|
7081
7091
|
return;
|
|
7082
7092
|
}
|
|
7083
7093
|
const td = selectedElement.tableData;
|
|
7084
|
-
const newTableData =
|
|
7094
|
+
const newTableData = chunkJKSUB7DR_js.mergeCells(ts.selectedCells, td);
|
|
7085
7095
|
const updates = { tableData: newTableData };
|
|
7086
|
-
const newRawXml =
|
|
7096
|
+
const newRawXml = chunkJKSUB7DR_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7087
7097
|
if (newRawXml) {
|
|
7088
7098
|
updates.rawXml = newRawXml;
|
|
7089
7099
|
}
|
|
@@ -7100,9 +7110,9 @@ function createTableMergeHandlers(input) {
|
|
|
7100
7110
|
}
|
|
7101
7111
|
const { rowIndex, columnIndex } = ts;
|
|
7102
7112
|
const td = selectedElement.tableData;
|
|
7103
|
-
const newTableData =
|
|
7113
|
+
const newTableData = chunkJKSUB7DR_js.splitCell(rowIndex, columnIndex, td);
|
|
7104
7114
|
const updates = { tableData: newTableData };
|
|
7105
|
-
const newRawXml =
|
|
7115
|
+
const newRawXml = chunkJKSUB7DR_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7106
7116
|
if (newRawXml) {
|
|
7107
7117
|
updates.rawXml = newRawXml;
|
|
7108
7118
|
}
|
|
@@ -7137,7 +7147,7 @@ function createTableStructHandlers(input) {
|
|
|
7137
7147
|
updates.tableData = pptx.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
7138
7148
|
}
|
|
7139
7149
|
if (el.rawXml) {
|
|
7140
|
-
const newRawXml =
|
|
7150
|
+
const newRawXml = chunkJKSUB7DR_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
7141
7151
|
if (newRawXml) {
|
|
7142
7152
|
updates.rawXml = newRawXml;
|
|
7143
7153
|
}
|
|
@@ -7161,7 +7171,7 @@ function createTableStructHandlers(input) {
|
|
|
7161
7171
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
7162
7172
|
const updates = {};
|
|
7163
7173
|
if (selectedElement.rawXml) {
|
|
7164
|
-
const newRawXml =
|
|
7174
|
+
const newRawXml = chunkJKSUB7DR_js.updateCellTextStyleInRawXml(
|
|
7165
7175
|
selectedElement,
|
|
7166
7176
|
rowIndex,
|
|
7167
7177
|
colIndex,
|
|
@@ -7339,7 +7349,7 @@ function useExportSaveAs(input) {
|
|
|
7339
7349
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7340
7350
|
const slideSize = pptx.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7341
7351
|
const data = {
|
|
7342
|
-
slides:
|
|
7352
|
+
slides: chunkJKSUB7DR_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7343
7353
|
width: canvasSize.width,
|
|
7344
7354
|
height: canvasSize.height,
|
|
7345
7355
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7502,7 +7512,7 @@ async function captureSlidesAsPngDataUrls(slideStageRef, slideIndices, setActive
|
|
|
7502
7512
|
}
|
|
7503
7513
|
function tilesToPdfPage(tilesResult) {
|
|
7504
7514
|
return tilesResult.tiles.map((tile) => ({
|
|
7505
|
-
image:
|
|
7515
|
+
image: chunkJKSUB7DR_js.canvasToJpegData(tile.canvas),
|
|
7506
7516
|
placement: pptx.placeTileOnPage(
|
|
7507
7517
|
tile,
|
|
7508
7518
|
tilesResult.fullWidth,
|
|
@@ -7535,7 +7545,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7535
7545
|
if (pages.length === 0) {
|
|
7536
7546
|
throw new Error(i18n.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7537
7547
|
}
|
|
7538
|
-
const pdfBlobUrl =
|
|
7548
|
+
const pdfBlobUrl = chunkJKSUB7DR_js.buildPdfFromTiledImageData(pages);
|
|
7539
7549
|
pptx.downloadDataUrl(pdfBlobUrl, filename);
|
|
7540
7550
|
}
|
|
7541
7551
|
async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, slideNotes, filename = "presentation-notes.pdf", options = {}) {
|
|
@@ -7565,7 +7575,7 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7565
7575
|
if (pages.length === 0) {
|
|
7566
7576
|
throw new Error(i18n.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7567
7577
|
}
|
|
7568
|
-
const pdfDataUrl =
|
|
7578
|
+
const pdfDataUrl = chunkJKSUB7DR_js.buildNotesPdf(pages);
|
|
7569
7579
|
pptx.downloadDataUrl(pdfDataUrl, filename);
|
|
7570
7580
|
}
|
|
7571
7581
|
async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
@@ -7745,20 +7755,6 @@ function exportSlideToSvg(slide, width, height, options = {}) {
|
|
|
7745
7755
|
}
|
|
7746
7756
|
return svg;
|
|
7747
7757
|
}
|
|
7748
|
-
function safePrompt(message, defaultValue) {
|
|
7749
|
-
try {
|
|
7750
|
-
return window.prompt(message, defaultValue);
|
|
7751
|
-
} catch {
|
|
7752
|
-
return null;
|
|
7753
|
-
}
|
|
7754
|
-
}
|
|
7755
|
-
function safeConfirm(message) {
|
|
7756
|
-
try {
|
|
7757
|
-
return window.confirm(message);
|
|
7758
|
-
} catch {
|
|
7759
|
-
return false;
|
|
7760
|
-
}
|
|
7761
|
-
}
|
|
7762
7758
|
|
|
7763
7759
|
// src/viewer/hooks/useExportMediaHandlers.ts
|
|
7764
7760
|
function useExportMediaHandlers(input) {
|
|
@@ -8157,13 +8153,13 @@ function usePrintHandlers(input) {
|
|
|
8157
8153
|
const { slides, activeSlideIndex, canvasStageRef, setActiveSlideIndex, canvasSize } = input;
|
|
8158
8154
|
const handoutMaster = input.handoutMaster ?? input.pptxData?.handoutMaster;
|
|
8159
8155
|
const [isPrintDialogOpen, setIsPrintDialogOpen] = React17.useState(false);
|
|
8160
|
-
const { t } =
|
|
8156
|
+
const { t } = chunkJKSUB7DR_js.useTranslation();
|
|
8161
8157
|
const viewerOptions = useViewerOptionsContext();
|
|
8162
8158
|
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * pptx.resolveImageResolutionScale(viewerOptions);
|
|
8163
8159
|
const handlePrint = () => {
|
|
8164
8160
|
setIsPrintDialogOpen(true);
|
|
8165
8161
|
};
|
|
8166
|
-
const deckSlides = () => input.templateElementsBySlideId ?
|
|
8162
|
+
const deckSlides = () => input.templateElementsBySlideId ? chunkJKSUB7DR_js.buildSaveSlides(slides, input.templateElementsBySlideId) : slides;
|
|
8167
8163
|
const plan = (settings, deck) => pptx.planPrintJob(settings, {
|
|
8168
8164
|
slides: deck,
|
|
8169
8165
|
activeSlideIndex,
|
|
@@ -8578,7 +8574,7 @@ function usePropertyHandlers(input) {
|
|
|
8578
8574
|
width: canvasSize.width,
|
|
8579
8575
|
height: canvasSize.height
|
|
8580
8576
|
};
|
|
8581
|
-
setCompareResult(
|
|
8577
|
+
setCompareResult(chunkJKSUB7DR_js.comparePresentation(cur, other));
|
|
8582
8578
|
setIsComparePanelOpen(true);
|
|
8583
8579
|
} catch (err) {
|
|
8584
8580
|
console.warn("Compare failed:", err);
|
|
@@ -8631,6 +8627,7 @@ function usePropertyHandlers(input) {
|
|
|
8631
8627
|
};
|
|
8632
8628
|
}
|
|
8633
8629
|
function useDialogCustomShows(input) {
|
|
8630
|
+
const { t } = chunkJKSUB7DR_js.useTranslation();
|
|
8634
8631
|
const {
|
|
8635
8632
|
activeSlide,
|
|
8636
8633
|
customShows,
|
|
@@ -8650,16 +8647,20 @@ function useDialogCustomShows(input) {
|
|
|
8650
8647
|
);
|
|
8651
8648
|
history.markDirty();
|
|
8652
8649
|
};
|
|
8653
|
-
const handleCreateCustomShow = () => {
|
|
8654
|
-
const name =
|
|
8655
|
-
|
|
8650
|
+
const handleCreateCustomShow = async () => {
|
|
8651
|
+
const name = await pptx.promptNameDialog(
|
|
8652
|
+
t("pptx.customShows.newNameLabel"),
|
|
8653
|
+
t("pptx.customShows.newDefaultName"),
|
|
8654
|
+
{ t }
|
|
8655
|
+
);
|
|
8656
|
+
const safeName = name?.trim() || `${t("pptx.customShows.newDefaultName")} ${customShows.length + 1}`;
|
|
8656
8657
|
const id = pptx.generateCustomShowId(customShows);
|
|
8657
8658
|
const initialSlideRIds = activeSlide?.rId && activeSlide.rId.length > 0 ? [activeSlide.rId] : [];
|
|
8658
8659
|
setCustomShows((prev) => [...prev, { id, name: safeName, slideRIds: initialSlideRIds }]);
|
|
8659
8660
|
setActiveCustomShowId(id);
|
|
8660
8661
|
history.markDirty();
|
|
8661
8662
|
};
|
|
8662
|
-
const handleRenameActiveCustomShow = () => {
|
|
8663
|
+
const handleRenameActiveCustomShow = async () => {
|
|
8663
8664
|
if (!activeCustomShowId) {
|
|
8664
8665
|
return;
|
|
8665
8666
|
}
|
|
@@ -8667,14 +8668,14 @@ function useDialogCustomShows(input) {
|
|
|
8667
8668
|
if (!show) {
|
|
8668
8669
|
return;
|
|
8669
8670
|
}
|
|
8670
|
-
const nextName =
|
|
8671
|
+
const nextName = (await pptx.promptNameDialog(t("pptx.customShows.renamePrompt"), show.name, { t }))?.trim();
|
|
8671
8672
|
if (!nextName) {
|
|
8672
8673
|
return;
|
|
8673
8674
|
}
|
|
8674
8675
|
setCustomShows((prev) => prev.map((s) => s.id === show.id ? { ...s, name: nextName } : s));
|
|
8675
8676
|
history.markDirty();
|
|
8676
8677
|
};
|
|
8677
|
-
const handleDeleteActiveCustomShow = () => {
|
|
8678
|
+
const handleDeleteActiveCustomShow = async () => {
|
|
8678
8679
|
const showId = activeCustomShowId;
|
|
8679
8680
|
if (!showId) {
|
|
8680
8681
|
return;
|
|
@@ -8683,7 +8684,7 @@ function useDialogCustomShows(input) {
|
|
|
8683
8684
|
if (!show) {
|
|
8684
8685
|
return;
|
|
8685
8686
|
}
|
|
8686
|
-
if (!
|
|
8687
|
+
if (!await pptx.confirmDeleteDialog(t("pptx.customShows.deleteConfirm", { name: show.name }), { t })) {
|
|
8687
8688
|
return;
|
|
8688
8689
|
}
|
|
8689
8690
|
setCustomShows((prev) => prev.filter((s) => s.id !== showId));
|
|
@@ -8951,7 +8952,7 @@ function useViewerDialogs(input) {
|
|
|
8951
8952
|
};
|
|
8952
8953
|
}
|
|
8953
8954
|
function computeGridSpacingPx(documentGridSpacing) {
|
|
8954
|
-
return pptx.computeGridSpacingPx(documentGridSpacing,
|
|
8955
|
+
return pptx.computeGridSpacingPx(documentGridSpacing, chunkJKSUB7DR_js.GRID_SIZE);
|
|
8955
8956
|
}
|
|
8956
8957
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
8957
8958
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
@@ -8960,7 +8961,7 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, pre
|
|
|
8960
8961
|
}
|
|
8961
8962
|
function computeSlideSectionGroups(slides, sections) {
|
|
8962
8963
|
return pptx.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8963
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8964
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkJKSUB7DR_js.UNGROUPED_SECTION_ID : chunkJKSUB7DR_js.DEFAULT_SECTION_GROUP_ID),
|
|
8964
8965
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8965
8966
|
slideIndexes: group.slideIndexes,
|
|
8966
8967
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8979,7 +8980,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8979
8980
|
});
|
|
8980
8981
|
}
|
|
8981
8982
|
function useDerivedSlideState(input) {
|
|
8982
|
-
const { t } =
|
|
8983
|
+
const { t } = chunkJKSUB7DR_js.useTranslation();
|
|
8983
8984
|
const {
|
|
8984
8985
|
slides,
|
|
8985
8986
|
sections,
|
|
@@ -9005,10 +9006,10 @@ function useDerivedSlideState(input) {
|
|
|
9005
9006
|
);
|
|
9006
9007
|
const slideSectionGroups = React17.useMemo(
|
|
9007
9008
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
9008
|
-
if (group.id ===
|
|
9009
|
+
if (group.id === chunkJKSUB7DR_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
9009
9010
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
9010
9011
|
}
|
|
9011
|
-
if (group.id ===
|
|
9012
|
+
if (group.id === chunkJKSUB7DR_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
9012
9013
|
return { ...group, label: t("pptx.sections.slides") };
|
|
9013
9014
|
}
|
|
9014
9015
|
return group;
|
|
@@ -9115,7 +9116,7 @@ function useAnnotationHandlers(input) {
|
|
|
9115
9116
|
if (nextMode === "present") {
|
|
9116
9117
|
presentation.enterPresentMode();
|
|
9117
9118
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
9118
|
-
|
|
9119
|
+
chunkJKSUB7DR_js.stopAllPersistentAudio();
|
|
9119
9120
|
if (promptKeepInkAnnotations) {
|
|
9120
9121
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
9121
9122
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -9125,7 +9126,7 @@ function useAnnotationHandlers(input) {
|
|
|
9125
9126
|
}
|
|
9126
9127
|
} else {
|
|
9127
9128
|
if (mode === "present") {
|
|
9128
|
-
|
|
9129
|
+
chunkJKSUB7DR_js.stopAllPersistentAudio();
|
|
9129
9130
|
}
|
|
9130
9131
|
setMode(nextMode);
|
|
9131
9132
|
}
|
|
@@ -9293,7 +9294,7 @@ function useSerialize(input) {
|
|
|
9293
9294
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
9294
9295
|
};
|
|
9295
9296
|
});
|
|
9296
|
-
const slidesToSave =
|
|
9297
|
+
const slidesToSave = chunkJKSUB7DR_js.buildSaveSlides(slidesWithGuides, pending.templateElementsBySlideId);
|
|
9297
9298
|
const saveOptions = pptx.buildDeckSaveOptions({
|
|
9298
9299
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
9299
9300
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
@@ -9438,7 +9439,7 @@ function usePresentationSetup(input) {
|
|
|
9438
9439
|
return;
|
|
9439
9440
|
}
|
|
9440
9441
|
if (mode === "present" && nextMode !== "present") {
|
|
9441
|
-
|
|
9442
|
+
chunkJKSUB7DR_js.stopAllPersistentAudio();
|
|
9442
9443
|
stopAnimationSound();
|
|
9443
9444
|
const exitHandler = exitModeHandlerRef.current;
|
|
9444
9445
|
if (exitHandler) {
|
|
@@ -9559,7 +9560,7 @@ function useCanvasImagePaste(input) {
|
|
|
9559
9560
|
);
|
|
9560
9561
|
}
|
|
9561
9562
|
function formatPatchFor(element, format) {
|
|
9562
|
-
const updated =
|
|
9563
|
+
const updated = chunkJKSUB7DR_js.applyFormatToElement(element, format);
|
|
9563
9564
|
const updates = {};
|
|
9564
9565
|
if (pptx$1.hasShapeProperties(updated)) {
|
|
9565
9566
|
updates.shapeStyle = updated.shapeStyle;
|
|
@@ -9582,7 +9583,7 @@ function useFormatPainterEditing(input) {
|
|
|
9582
9583
|
const prevFormatPainterRef = React17.useRef(false);
|
|
9583
9584
|
React17.useEffect(() => {
|
|
9584
9585
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9585
|
-
copiedFormatRef.current =
|
|
9586
|
+
copiedFormatRef.current = chunkJKSUB7DR_js.copyFormatFromElement(selectedElement);
|
|
9586
9587
|
} else if (!formatPainterActive) {
|
|
9587
9588
|
copiedFormatRef.current = null;
|
|
9588
9589
|
}
|
|
@@ -10394,6 +10395,27 @@ function useContentLifecycle(input) {
|
|
|
10394
10395
|
};
|
|
10395
10396
|
const serializeSlides = useSerialize(serializeInput);
|
|
10396
10397
|
const serializeForRecovery = useSerialize({ ...serializeInput, purpose: "recovery-snapshot" });
|
|
10398
|
+
const getChangeSources = () => [
|
|
10399
|
+
slides,
|
|
10400
|
+
state.templateElementsBySlideId,
|
|
10401
|
+
state.guides,
|
|
10402
|
+
state.headerFooter,
|
|
10403
|
+
state.presentationProperties,
|
|
10404
|
+
state.customShows,
|
|
10405
|
+
state.sections,
|
|
10406
|
+
state.coreProperties,
|
|
10407
|
+
state.appProperties,
|
|
10408
|
+
state.customProperties,
|
|
10409
|
+
state.tagCollections,
|
|
10410
|
+
state.notesMaster,
|
|
10411
|
+
state.handoutMaster,
|
|
10412
|
+
state.embeddedFonts,
|
|
10413
|
+
embedFonts,
|
|
10414
|
+
password,
|
|
10415
|
+
state.inlineEditingElementIdRef.current,
|
|
10416
|
+
state.inlineEditingTextRef.current,
|
|
10417
|
+
state.inlineEditingSnapshotRef.current
|
|
10418
|
+
];
|
|
10397
10419
|
const { autosaveStatus } = useAutosave({
|
|
10398
10420
|
isDirty: state.isDirty,
|
|
10399
10421
|
filePath,
|
|
@@ -10401,36 +10423,12 @@ function useContentLifecycle(input) {
|
|
|
10401
10423
|
serializeSlides: serializeForRecovery,
|
|
10402
10424
|
enabled: autosaveEnabled,
|
|
10403
10425
|
...autosaveIntervalMs === void 0 ? {} : { intervalMs: autosaveIntervalMs },
|
|
10404
|
-
// Everything `serializeForRecovery` reads that changes by REASSIGNMENT,
|
|
10405
|
-
// so a poll that finds all of them unchanged can skip re-serializing a
|
|
10406
|
-
// deck it has already snapshotted. The two refs are read by `.current`
|
|
10407
|
-
// because an inline edit in progress lives there and nowhere else yet.
|
|
10408
10426
|
onSaved: input.onAutosave,
|
|
10409
10427
|
inlineDraftSinkRef: state.autosaveDraftSinkRef,
|
|
10410
10428
|
getInlineEditingId: () => state.inlineEditingElementIdRef.current,
|
|
10411
|
-
getChangeSources
|
|
10412
|
-
slides,
|
|
10413
|
-
state.templateElementsBySlideId,
|
|
10414
|
-
state.guides,
|
|
10415
|
-
state.headerFooter,
|
|
10416
|
-
state.presentationProperties,
|
|
10417
|
-
state.customShows,
|
|
10418
|
-
state.sections,
|
|
10419
|
-
state.coreProperties,
|
|
10420
|
-
state.appProperties,
|
|
10421
|
-
state.customProperties,
|
|
10422
|
-
state.tagCollections,
|
|
10423
|
-
state.notesMaster,
|
|
10424
|
-
state.handoutMaster,
|
|
10425
|
-
state.embeddedFonts,
|
|
10426
|
-
embedFonts,
|
|
10427
|
-
password,
|
|
10428
|
-
state.inlineEditingElementIdRef.current,
|
|
10429
|
-
state.inlineEditingTextRef.current,
|
|
10430
|
-
state.inlineEditingSnapshotRef.current
|
|
10431
|
-
]
|
|
10429
|
+
getChangeSources
|
|
10432
10430
|
});
|
|
10433
|
-
return { handlerRef, serializeSlides, serializeForRecovery, autosaveStatus };
|
|
10431
|
+
return { handlerRef, serializeSlides, serializeForRecovery, autosaveStatus, getChangeSources };
|
|
10434
10432
|
}
|
|
10435
10433
|
function useKeyboardShortcuts(input) {
|
|
10436
10434
|
const inputRef = React17.useRef(input);
|
|
@@ -10775,7 +10773,7 @@ function useViewerIntegration(input) {
|
|
|
10775
10773
|
});
|
|
10776
10774
|
const [isEncryptedDialogOpen, setIsEncryptedDialogOpen] = React17.useState(false);
|
|
10777
10775
|
const [loadVersion, setLoadVersion] = React17.useState(0);
|
|
10778
|
-
const { handlerRef, serializeSlides, autosaveStatus } = useContentLifecycle({
|
|
10776
|
+
const { handlerRef, serializeSlides, autosaveStatus, getChangeSources } = useContentLifecycle({
|
|
10779
10777
|
content,
|
|
10780
10778
|
filePath,
|
|
10781
10779
|
storage,
|
|
@@ -10858,164 +10856,167 @@ function useViewerIntegration(input) {
|
|
|
10858
10856
|
});
|
|
10859
10857
|
React17.useImperativeHandle(
|
|
10860
10858
|
ref,
|
|
10861
|
-
() => latestHandleRef.current =
|
|
10862
|
-
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
|
|
10868
|
-
|
|
10869
|
-
|
|
10870
|
-
|
|
10871
|
-
|
|
10872
|
-
|
|
10873
|
-
|
|
10874
|
-
|
|
10875
|
-
|
|
10876
|
-
|
|
10877
|
-
|
|
10878
|
-
|
|
10879
|
-
|
|
10880
|
-
|
|
10881
|
-
|
|
10882
|
-
|
|
10883
|
-
|
|
10884
|
-
|
|
10885
|
-
|
|
10886
|
-
|
|
10887
|
-
|
|
10888
|
-
|
|
10889
|
-
|
|
10890
|
-
|
|
10891
|
-
|
|
10892
|
-
|
|
10893
|
-
|
|
10894
|
-
|
|
10895
|
-
|
|
10896
|
-
|
|
10897
|
-
|
|
10898
|
-
|
|
10899
|
-
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
10906
|
-
|
|
10907
|
-
|
|
10908
|
-
|
|
10909
|
-
|
|
10910
|
-
|
|
10911
|
-
|
|
10912
|
-
|
|
10913
|
-
|
|
10914
|
-
|
|
10915
|
-
|
|
10916
|
-
|
|
10917
|
-
|
|
10918
|
-
|
|
10919
|
-
|
|
10920
|
-
|
|
10921
|
-
|
|
10922
|
-
|
|
10923
|
-
|
|
10924
|
-
|
|
10925
|
-
|
|
10926
|
-
|
|
10927
|
-
|
|
10928
|
-
|
|
10929
|
-
|
|
10930
|
-
|
|
10931
|
-
|
|
10932
|
-
|
|
10933
|
-
|
|
10934
|
-
|
|
10935
|
-
|
|
10936
|
-
|
|
10937
|
-
|
|
10938
|
-
|
|
10939
|
-
|
|
10940
|
-
|
|
10941
|
-
|
|
10942
|
-
|
|
10943
|
-
|
|
10944
|
-
|
|
10945
|
-
|
|
10946
|
-
|
|
10947
|
-
|
|
10948
|
-
|
|
10949
|
-
|
|
10950
|
-
|
|
10951
|
-
|
|
10952
|
-
|
|
10953
|
-
|
|
10954
|
-
|
|
10955
|
-
|
|
10956
|
-
|
|
10957
|
-
|
|
10958
|
-
|
|
10959
|
-
|
|
10960
|
-
|
|
10961
|
-
|
|
10962
|
-
|
|
10963
|
-
|
|
10964
|
-
|
|
10965
|
-
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
|
|
10969
|
-
|
|
10970
|
-
|
|
10971
|
-
|
|
10972
|
-
|
|
10973
|
-
|
|
10974
|
-
|
|
10975
|
-
|
|
10976
|
-
|
|
10977
|
-
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
|
|
10987
|
-
|
|
10988
|
-
|
|
10989
|
-
|
|
10990
|
-
|
|
10991
|
-
|
|
10992
|
-
|
|
10993
|
-
|
|
10994
|
-
|
|
10995
|
-
|
|
10996
|
-
|
|
10859
|
+
() => latestHandleRef.current = pptx.gateViewerEdits(
|
|
10860
|
+
{
|
|
10861
|
+
...customizationApi,
|
|
10862
|
+
async getContent() {
|
|
10863
|
+
const data = await serializeSlides();
|
|
10864
|
+
if (data && onContentChange) {
|
|
10865
|
+
onContentChange(data);
|
|
10866
|
+
}
|
|
10867
|
+
return data ?? new Uint8Array(0);
|
|
10868
|
+
},
|
|
10869
|
+
goTo(index) {
|
|
10870
|
+
if (index >= 0 && index < slides.length) {
|
|
10871
|
+
state.setActiveSlideIndex(index);
|
|
10872
|
+
}
|
|
10873
|
+
},
|
|
10874
|
+
goPrev() {
|
|
10875
|
+
const next = activeSlideIndex - 1;
|
|
10876
|
+
if (next >= 0) {
|
|
10877
|
+
state.setActiveSlideIndex(next);
|
|
10878
|
+
}
|
|
10879
|
+
},
|
|
10880
|
+
goNext() {
|
|
10881
|
+
const next = activeSlideIndex + 1;
|
|
10882
|
+
if (next < slides.length) {
|
|
10883
|
+
state.setActiveSlideIndex(next);
|
|
10884
|
+
}
|
|
10885
|
+
},
|
|
10886
|
+
undo() {
|
|
10887
|
+
history.handleUndo();
|
|
10888
|
+
},
|
|
10889
|
+
redo() {
|
|
10890
|
+
history.handleRedo();
|
|
10891
|
+
},
|
|
10892
|
+
canUndo() {
|
|
10893
|
+
return history.canUndo;
|
|
10894
|
+
},
|
|
10895
|
+
canRedo() {
|
|
10896
|
+
return history.canRedo;
|
|
10897
|
+
},
|
|
10898
|
+
getZoom() {
|
|
10899
|
+
return zoom.scale;
|
|
10900
|
+
},
|
|
10901
|
+
setZoom(level) {
|
|
10902
|
+
zoom.setScale(pptx.clampZoomScale(level));
|
|
10903
|
+
},
|
|
10904
|
+
zoomIn() {
|
|
10905
|
+
zoom.handleZoomIn();
|
|
10906
|
+
},
|
|
10907
|
+
zoomOut() {
|
|
10908
|
+
zoom.handleZoomOut();
|
|
10909
|
+
},
|
|
10910
|
+
zoomReset() {
|
|
10911
|
+
zoom.handleResetZoom();
|
|
10912
|
+
},
|
|
10913
|
+
getMode() {
|
|
10914
|
+
return pptx.resolveReportedViewerMode(mode, canEdit);
|
|
10915
|
+
},
|
|
10916
|
+
setMode(newMode) {
|
|
10917
|
+
state.setMode(newMode);
|
|
10918
|
+
},
|
|
10919
|
+
getActiveSlideIndex() {
|
|
10920
|
+
return activeSlideIndex;
|
|
10921
|
+
},
|
|
10922
|
+
getSlideCount() {
|
|
10923
|
+
return slides.length;
|
|
10924
|
+
},
|
|
10925
|
+
isDirty() {
|
|
10926
|
+
return state.isDirty;
|
|
10927
|
+
},
|
|
10928
|
+
getSelectedElementIds() {
|
|
10929
|
+
return state.effectiveSelectedIds;
|
|
10930
|
+
},
|
|
10931
|
+
selectElements(ids) {
|
|
10932
|
+
state.setSelectedElementIds(ids);
|
|
10933
|
+
state.setSelectedElementId(ids[0] ?? null);
|
|
10934
|
+
},
|
|
10935
|
+
clearSelection() {
|
|
10936
|
+
state.setSelectedElementIds([]);
|
|
10937
|
+
state.setSelectedElementId(null);
|
|
10938
|
+
},
|
|
10939
|
+
// -- Active slide (alias) --
|
|
10940
|
+
setActiveSlideIndex(index) {
|
|
10941
|
+
if (index >= 0 && index < slides.length) {
|
|
10942
|
+
state.setActiveSlideIndex(index);
|
|
10943
|
+
}
|
|
10944
|
+
},
|
|
10945
|
+
// -- Slide access --
|
|
10946
|
+
getSlides() {
|
|
10947
|
+
return slides;
|
|
10948
|
+
},
|
|
10949
|
+
getSlide(index) {
|
|
10950
|
+
return slides[index];
|
|
10951
|
+
},
|
|
10952
|
+
getActiveSlide() {
|
|
10953
|
+
return slides[activeSlideIndex];
|
|
10954
|
+
},
|
|
10955
|
+
// -- Slide manipulation --
|
|
10956
|
+
addSlide(afterIndex) {
|
|
10957
|
+
if (afterIndex === void 0) {
|
|
10958
|
+
editorOps.slideOps.handleAddSlide();
|
|
10959
|
+
} else {
|
|
10960
|
+
editorOps.slideOps.handleAddSlideAfter(afterIndex);
|
|
10961
|
+
}
|
|
10962
|
+
},
|
|
10963
|
+
deleteSlides(indexes) {
|
|
10964
|
+
editorOps.slideOps.handleDeleteSlides(indexes);
|
|
10965
|
+
},
|
|
10966
|
+
duplicateSlides(indexes) {
|
|
10967
|
+
editorOps.slideOps.handleDuplicateSlides(indexes);
|
|
10968
|
+
},
|
|
10969
|
+
moveSlide(fromIndex, toIndex) {
|
|
10970
|
+
editorOps.slideOps.handleMoveSlide(fromIndex, toIndex);
|
|
10971
|
+
},
|
|
10972
|
+
toggleHideSlides(indexes) {
|
|
10973
|
+
editorOps.slideOps.handleToggleHideSlides(indexes);
|
|
10974
|
+
},
|
|
10975
|
+
// -- Element access --
|
|
10976
|
+
getElements(slideIndex) {
|
|
10977
|
+
const idx = slideIndex ?? activeSlideIndex;
|
|
10978
|
+
const s = slides[idx];
|
|
10979
|
+
return s?.elements ?? [];
|
|
10980
|
+
},
|
|
10981
|
+
getElementById(elementId, slideIndex) {
|
|
10982
|
+
const idx = slideIndex ?? activeSlideIndex;
|
|
10983
|
+
const s = slides[idx];
|
|
10984
|
+
return s ? pptx.slideSpaceElement(s.elements, elementId) ?? void 0 : void 0;
|
|
10985
|
+
},
|
|
10986
|
+
// -- Element manipulation --
|
|
10987
|
+
addElement(element) {
|
|
10988
|
+
const inserted = pptx.prepareElementForInsertion(element, {
|
|
10989
|
+
canEdit: canEdit && canInsertElement,
|
|
10990
|
+
mode,
|
|
10991
|
+
hasActiveSlide: !loading && !error && Boolean(activeSlide),
|
|
10992
|
+
editTemplateMode: state.editTemplateMode
|
|
10993
|
+
});
|
|
10994
|
+
if (!inserted) {
|
|
10995
|
+
return void 0;
|
|
10996
|
+
}
|
|
10997
|
+
editorOps.canvasHandlers.handleInlineEditCommit();
|
|
10998
|
+
editorOps.insertHandlers.addElement(inserted);
|
|
10999
|
+
editorOps.ops.applySelection(inserted.id, [inserted.id]);
|
|
11000
|
+
return inserted.id;
|
|
11001
|
+
},
|
|
11002
|
+
updateElements,
|
|
11003
|
+
updateElement(elementId, updates) {
|
|
11004
|
+
editorOps.ops.updateElementById(elementId, updates);
|
|
11005
|
+
},
|
|
11006
|
+
deleteElements(elementIds) {
|
|
11007
|
+
state.setSelectedElementIds(elementIds);
|
|
11008
|
+
state.setSelectedElementId(elementIds[0] ?? null);
|
|
11009
|
+
editorOps.manipulation.handleDelete();
|
|
11010
|
+
},
|
|
11011
|
+
duplicateElement(elementId) {
|
|
11012
|
+
state.setSelectedElementIds([elementId]);
|
|
11013
|
+
state.setSelectedElementId(elementId);
|
|
11014
|
+
editorOps.manipulation.handleDuplicate();
|
|
11015
|
+
return state.selectedElementIds[0];
|
|
10997
11016
|
}
|
|
10998
|
-
editorOps.canvasHandlers.handleInlineEditCommit();
|
|
10999
|
-
editorOps.insertHandlers.addElement(inserted);
|
|
11000
|
-
editorOps.ops.applySelection(inserted.id, [inserted.id]);
|
|
11001
|
-
return inserted.id;
|
|
11002
11017
|
},
|
|
11003
|
-
|
|
11004
|
-
|
|
11005
|
-
editorOps.ops.updateElementById(elementId, updates);
|
|
11006
|
-
},
|
|
11007
|
-
deleteElements(elementIds) {
|
|
11008
|
-
state.setSelectedElementIds(elementIds);
|
|
11009
|
-
state.setSelectedElementId(elementIds[0] ?? null);
|
|
11010
|
-
editorOps.manipulation.handleDelete();
|
|
11011
|
-
},
|
|
11012
|
-
duplicateElement(elementId) {
|
|
11013
|
-
state.setSelectedElementIds([elementId]);
|
|
11014
|
-
state.setSelectedElementId(elementId);
|
|
11015
|
-
editorOps.manipulation.handleDuplicate();
|
|
11016
|
-
return state.selectedElementIds[0];
|
|
11017
|
-
}
|
|
11018
|
-
},
|
|
11018
|
+
() => canEdit
|
|
11019
|
+
),
|
|
11019
11020
|
[
|
|
11020
11021
|
updateElements,
|
|
11021
11022
|
serializeSlides,
|
|
@@ -11100,6 +11101,7 @@ function useViewerIntegration(input) {
|
|
|
11100
11101
|
handleEnterPresenterView,
|
|
11101
11102
|
handleEnterRehearsalMode,
|
|
11102
11103
|
autosaveStatus,
|
|
11104
|
+
getChangeSources,
|
|
11103
11105
|
recovery,
|
|
11104
11106
|
isEncryptedDialogOpen,
|
|
11105
11107
|
setIsEncryptedDialogOpen,
|
|
@@ -11218,7 +11220,7 @@ function useCollaborationWriteBack(input) {
|
|
|
11218
11220
|
getSourceBytes: () => latest.current.getSourceBytes?.() ?? null,
|
|
11219
11221
|
getSaveOptions: () => latest.current.getSaveOptions?.(),
|
|
11220
11222
|
getTemplateElements: () => latest.current.templateElementsBySlideId,
|
|
11221
|
-
mergeTemplateElements:
|
|
11223
|
+
mergeTemplateElements: chunkJKSUB7DR_js.buildSaveSlides,
|
|
11222
11224
|
onWriteBackStatus: () => latest.current.onWriteBackStatus?.(
|
|
11223
11225
|
pptx.writeBackReport(latest.current.config, created.getState())
|
|
11224
11226
|
)
|
|
@@ -11775,8 +11777,8 @@ function useTouchGestures(input) {
|
|
|
11775
11777
|
}
|
|
11776
11778
|
const recognizer = pptx.createTouchGestureRecognizer({
|
|
11777
11779
|
getScale: () => scaleRef.current,
|
|
11778
|
-
minScale:
|
|
11779
|
-
maxScale:
|
|
11780
|
+
minScale: chunkJKSUB7DR_js.MIN_ZOOM_SCALE,
|
|
11781
|
+
maxScale: chunkJKSUB7DR_js.MAX_ZOOM_SCALE,
|
|
11780
11782
|
callbacks: {
|
|
11781
11783
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
11782
11784
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -11885,7 +11887,7 @@ function buildCanvasProps(input) {
|
|
|
11885
11887
|
findResults,
|
|
11886
11888
|
findResultIndex,
|
|
11887
11889
|
viewerOptions,
|
|
11888
|
-
|
|
11890
|
+
t
|
|
11889
11891
|
} = input;
|
|
11890
11892
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
11891
11893
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
@@ -11897,10 +11899,7 @@ function buildCanvasProps(input) {
|
|
|
11897
11899
|
});
|
|
11898
11900
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
11899
11901
|
const openExternalUrl = (url, target) => {
|
|
11900
|
-
|
|
11901
|
-
return;
|
|
11902
|
-
}
|
|
11903
|
-
chunk5KFSMXI4_js.safeOpenUrl(url, target);
|
|
11902
|
+
void pptx.openExternalHyperlinkConfirmed(viewerOptions, url, { t }, target);
|
|
11904
11903
|
};
|
|
11905
11904
|
const handleActionClick = (elementId, action) => {
|
|
11906
11905
|
if (mode === "present") {
|
|
@@ -11915,9 +11914,9 @@ function buildCanvasProps(input) {
|
|
|
11915
11914
|
}
|
|
11916
11915
|
};
|
|
11917
11916
|
const handleHyperlinkClick = (url, target) => {
|
|
11918
|
-
if (
|
|
11917
|
+
if (chunkJKSUB7DR_js.isPpactionUrl(url)) {
|
|
11919
11918
|
if (mode === "present") {
|
|
11920
|
-
const parsed =
|
|
11919
|
+
const parsed = chunkJKSUB7DR_js.parsePpactionUrl(url);
|
|
11921
11920
|
if (parsed) {
|
|
11922
11921
|
presentation.handlePresentationAction({
|
|
11923
11922
|
action: parsed.action,
|
|
@@ -12409,7 +12408,7 @@ function buildToolbarProps(input) {
|
|
|
12409
12408
|
markDirty: history.markDirty
|
|
12410
12409
|
}),
|
|
12411
12410
|
formatPainterActive: s.formatPainterActive,
|
|
12412
|
-
canActivateFormatPainter:
|
|
12411
|
+
canActivateFormatPainter: chunkJKSUB7DR_js.hasCopyableFormat(selectedElement),
|
|
12413
12412
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
12414
12413
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
12415
12414
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -13134,7 +13133,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
13134
13133
|
} = input;
|
|
13135
13134
|
const collaborationConfig = pptx.resolveCollaborationConfig(input.collaboration);
|
|
13136
13135
|
const [collaborationReadOnly, setCollaborationReadOnly] = React17.useState(Boolean(collaborationConfig));
|
|
13137
|
-
const { t } =
|
|
13136
|
+
const { t } = chunkJKSUB7DR_js.useTranslation();
|
|
13138
13137
|
const [content, setContent] = React17.useState(incomingContent ?? null);
|
|
13139
13138
|
const [loadOrigin, setLoadOrigin] = React17.useState("bootstrap");
|
|
13140
13139
|
React17.useEffect(() => {
|
|
@@ -13281,9 +13280,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
13281
13280
|
findResults: editorOps.findReplace.findResults,
|
|
13282
13281
|
findResultIndex: editorOps.findReplace.findResultIndex,
|
|
13283
13282
|
viewerOptions,
|
|
13284
|
-
|
|
13285
|
-
|
|
13286
|
-
${url}`
|
|
13283
|
+
t
|
|
13287
13284
|
});
|
|
13288
13285
|
canvasProps.collaborationOverlay = overlay;
|
|
13289
13286
|
const slidesPaneProps = useSlidesPaneProps({
|
|
@@ -13338,23 +13335,23 @@ function ColorChangedImage({
|
|
|
13338
13335
|
className,
|
|
13339
13336
|
alt
|
|
13340
13337
|
}) {
|
|
13341
|
-
const tolerance = tolerancePct ??
|
|
13342
|
-
const cacheKey =
|
|
13338
|
+
const tolerance = tolerancePct ?? chunkJKSUB7DR_js.DEFAULT_COLOR_CHANGE_TOLERANCE;
|
|
13339
|
+
const cacheKey = chunkJKSUB7DR_js.buildCacheKey(
|
|
13343
13340
|
src,
|
|
13344
13341
|
clrChange.clrFrom,
|
|
13345
13342
|
clrChange.clrTo,
|
|
13346
13343
|
tolerance,
|
|
13347
13344
|
Boolean(clrChange.clrToTransparent)
|
|
13348
13345
|
);
|
|
13349
|
-
const cached =
|
|
13346
|
+
const cached = chunkJKSUB7DR_js.getCachedResult(cacheKey);
|
|
13350
13347
|
const [processedSrc, setProcessedSrc] = React17.useState(cached ?? null);
|
|
13351
13348
|
React17.useEffect(() => {
|
|
13352
|
-
if (
|
|
13353
|
-
setProcessedSrc(
|
|
13349
|
+
if (chunkJKSUB7DR_js.getCachedResult(cacheKey)) {
|
|
13350
|
+
setProcessedSrc(chunkJKSUB7DR_js.getCachedResult(cacheKey) ?? null);
|
|
13354
13351
|
return;
|
|
13355
13352
|
}
|
|
13356
13353
|
let cancelled = false;
|
|
13357
|
-
|
|
13354
|
+
chunkJKSUB7DR_js.applyColorChange(
|
|
13358
13355
|
src,
|
|
13359
13356
|
clrChange.clrFrom,
|
|
13360
13357
|
clrChange.clrTo,
|
|
@@ -13362,7 +13359,7 @@ function ColorChangedImage({
|
|
|
13362
13359
|
Boolean(clrChange.clrToTransparent)
|
|
13363
13360
|
).then((result) => {
|
|
13364
13361
|
if (!cancelled) {
|
|
13365
|
-
|
|
13362
|
+
chunkJKSUB7DR_js.setCachedResult(cacheKey, result.dataUrl);
|
|
13366
13363
|
setProcessedSrc(result.dataUrl);
|
|
13367
13364
|
}
|
|
13368
13365
|
return void 0;
|
|
@@ -13454,7 +13451,7 @@ function TiledImageLayer({
|
|
|
13454
13451
|
cancelled = true;
|
|
13455
13452
|
};
|
|
13456
13453
|
}, [src]);
|
|
13457
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, style: { ...
|
|
13454
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, style: { ...chunkJKSUB7DR_js.getImageTilingStyle(element, nativeSize), ...style } });
|
|
13458
13455
|
}
|
|
13459
13456
|
function renderImageEffectDefinitions(element, excludeDuotone = false) {
|
|
13460
13457
|
return pptx.getImageSvgFilters(element).filter((definition) => !excludeDuotone || definition.id !== `duotone-${element.id}`).map((definition) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13523,7 +13520,7 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
13523
13520
|
...filter ? { filter } : {},
|
|
13524
13521
|
...opacity !== void 0 ? { opacity } : {}
|
|
13525
13522
|
};
|
|
13526
|
-
if (
|
|
13523
|
+
if (chunkJKSUB7DR_js.isImageTiled(el)) {
|
|
13527
13524
|
const tileSrc = imgSrc(el);
|
|
13528
13525
|
if (!tileSrc) {
|
|
13529
13526
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-gray-500 bg-gray-100", children: "Image" });
|
|
@@ -13545,9 +13542,9 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
13545
13542
|
pptx$1.isImageLikeElement(el) ? el.imageEffects?.colorWash : void 0
|
|
13546
13543
|
);
|
|
13547
13544
|
const clrChange = "imageEffects" in el ? el.imageEffects?.clrChange : void 0;
|
|
13548
|
-
const duotoneColors =
|
|
13545
|
+
const duotoneColors = chunkJKSUB7DR_js.getDuotoneColors(el);
|
|
13549
13546
|
const useDuotoneCanvas = Boolean(duotoneColors && !clrChange);
|
|
13550
|
-
const filterForImg = useDuotoneCanvas ?
|
|
13547
|
+
const filterForImg = useDuotoneCanvas ? chunkJKSUB7DR_js.getImageEffectsFilter(el, { excludeDuotone: true }) : filter;
|
|
13551
13548
|
const canvasEffectStyles = {
|
|
13552
13549
|
...filterForImg ? { filter: filterForImg } : {},
|
|
13553
13550
|
...opacity !== void 0 ? { opacity } : {}
|
|
@@ -13623,10 +13620,10 @@ function SlideBackgroundImageLayer({
|
|
|
13623
13620
|
style: { zIndex: 0 },
|
|
13624
13621
|
children: renderImg(
|
|
13625
13622
|
backgroundElement,
|
|
13626
|
-
|
|
13627
|
-
|
|
13623
|
+
chunkJKSUB7DR_js.getImageRenderStyle(backgroundElement),
|
|
13624
|
+
chunkJKSUB7DR_js.getImageEffectsFilter(backgroundElement),
|
|
13628
13625
|
"",
|
|
13629
|
-
|
|
13626
|
+
chunkJKSUB7DR_js.getImageEffectsOpacity(backgroundElement)
|
|
13630
13627
|
)
|
|
13631
13628
|
}
|
|
13632
13629
|
);
|
|
@@ -13897,7 +13894,7 @@ function ChartElementView({
|
|
|
13897
13894
|
onUpdateElement,
|
|
13898
13895
|
animationState
|
|
13899
13896
|
}) {
|
|
13900
|
-
const { t } =
|
|
13897
|
+
const { t } = chunkJKSUB7DR_js.useTranslation();
|
|
13901
13898
|
const wrapperRef = React17.useRef(null);
|
|
13902
13899
|
const { selection, setSelection } = useChartPartSelection();
|
|
13903
13900
|
const [titleDraft, setTitleDraft] = React17.useState(null);
|
|
@@ -13912,7 +13909,7 @@ function ChartElementView({
|
|
|
13912
13909
|
pptx.getBarFacePicturePixelSampleVersion
|
|
13913
13910
|
);
|
|
13914
13911
|
const viewModel = React17.useMemo(() => {
|
|
13915
|
-
return canEdit ?
|
|
13912
|
+
return canEdit ? chunkJKSUB7DR_js.buildReactChartViewModel(element) : null;
|
|
13916
13913
|
}, [canEdit, element, barFacePictureSampleVersion]);
|
|
13917
13914
|
React17.useEffect(pptx.ensureChartInteractionStyles, []);
|
|
13918
13915
|
React17.useEffect(() => {
|
|
@@ -14017,9 +14014,9 @@ function ChartElementView({
|
|
|
14017
14014
|
textStyle: animationState?.textStyle,
|
|
14018
14015
|
onSelect: chart3D.onSelect,
|
|
14019
14016
|
onDrag: chart3D.onDrag,
|
|
14020
|
-
children:
|
|
14017
|
+
children: chunkJKSUB7DR_js.renderChartElement(renderedElement, (key) => t(key))
|
|
14021
14018
|
}
|
|
14022
|
-
) :
|
|
14019
|
+
) : chunkJKSUB7DR_js.renderChartElement(renderedElement, (key) => t(key)),
|
|
14023
14020
|
dragValue !== null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-1 right-1 z-10 rounded bg-primary/90 px-1.5 py-0.5 text-[10px] font-medium text-white pointer-events-none", children: pptx.formatAxisValue(dragValue) }),
|
|
14024
14021
|
titleDraft !== null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14025
14022
|
"input",
|
|
@@ -14047,7 +14044,7 @@ function ChartElementView({
|
|
|
14047
14044
|
);
|
|
14048
14045
|
}
|
|
14049
14046
|
function useActionAffordance(element, canInteract) {
|
|
14050
|
-
const { t } =
|
|
14047
|
+
const { t } = chunkJKSUB7DR_js.useTranslation();
|
|
14051
14048
|
pptx.ensureActionAffordanceStyles();
|
|
14052
14049
|
return React17.useMemo(
|
|
14053
14050
|
() => pptx.resolveElementActionAffordance(element, {
|
|
@@ -14325,7 +14322,7 @@ function ResizeHandles({
|
|
|
14325
14322
|
nonRotationTransform,
|
|
14326
14323
|
onRotate
|
|
14327
14324
|
}) {
|
|
14328
|
-
const { t } =
|
|
14325
|
+
const { t } = chunkJKSUB7DR_js.useTranslation();
|
|
14329
14326
|
const rotateRef = useRotateHandlePlacement(elementId, Boolean(onRotate));
|
|
14330
14327
|
const peStyle = forcePointerEvents ? { ...HANDLE_TOUCH_ACTION, pointerEvents: "auto" } : HANDLE_TOUCH_ACTION;
|
|
14331
14328
|
const resizeStyle = { ...HANDLE_TOUCH_ACTION, pointerEvents: "none" };
|
|
@@ -14358,7 +14355,7 @@ function ResizeHandles({
|
|
|
14358
14355
|
"aria-label": t("pptx.selectionOverlay.resize", { handle }),
|
|
14359
14356
|
"data-pptx-handle-kind": "resize",
|
|
14360
14357
|
"data-pptx-compact": true,
|
|
14361
|
-
className:
|
|
14358
|
+
className: chunkJKSUB7DR_js.cn(
|
|
14362
14359
|
"absolute z-10 group border-0 bg-transparent p-0",
|
|
14363
14360
|
RESIZE_DEFAULT_CLASSES,
|
|
14364
14361
|
posClass,
|
|
@@ -14384,7 +14381,7 @@ function ResizeHandles({
|
|
|
14384
14381
|
"div",
|
|
14385
14382
|
{
|
|
14386
14383
|
"data-pptx-handle-hit": true,
|
|
14387
|
-
className:
|
|
14384
|
+
className: chunkJKSUB7DR_js.cn(
|
|
14388
14385
|
"absolute -inset-px pointer-events-auto [--pptx-handle-hit-inset:-1px]",
|
|
14389
14386
|
corner ? "max-md:-inset-1.5 max-md:[--pptx-handle-hit-inset:-6px]" : "max-md:-inset-2 max-md:[--pptx-handle-hit-inset:-8px]"
|
|
14390
14387
|
),
|
|
@@ -14405,7 +14402,7 @@ function ResizeHandles({
|
|
|
14405
14402
|
"aria-label": t("pptx.selectionOverlay.rotate"),
|
|
14406
14403
|
"data-pptx-handle-kind": "rotate",
|
|
14407
14404
|
"data-pptx-compact": true,
|
|
14408
|
-
className:
|
|
14405
|
+
className: chunkJKSUB7DR_js.cn(
|
|
14409
14406
|
"absolute left-1/2 top-0 -translate-x-1/2 -translate-y-1/2 z-20 border-0 bg-transparent p-0 cursor-grab active:cursor-grabbing",
|
|
14410
14407
|
ROTATE_DEFAULT_CLASSES
|
|
14411
14408
|
),
|
|
@@ -14482,10 +14479,10 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17__default.default.memo
|
|
|
14482
14479
|
const svgHeight = Math.max(el.height, 1);
|
|
14483
14480
|
const ss = shapeEl?.shapeStyle;
|
|
14484
14481
|
const strokeWidth = Math.max(0, ss?.strokeWidth ?? 2);
|
|
14485
|
-
const strokeColor =
|
|
14486
|
-
const strokePaint =
|
|
14487
|
-
const dashType =
|
|
14488
|
-
const dashArray =
|
|
14482
|
+
const strokeColor = chunkJKSUB7DR_js.normalizeHexColor(ss?.strokeColor, chunkJKSUB7DR_js.DEFAULT_STROKE_COLOR);
|
|
14483
|
+
const strokePaint = chunkJKSUB7DR_js.colorWithOpacity(strokeColor, ss?.strokeOpacity);
|
|
14484
|
+
const dashType = chunkJKSUB7DR_js.normalizeStrokeDashType(ss?.strokeDash);
|
|
14485
|
+
const dashArray = chunkJKSUB7DR_js.getSvgStrokeDasharray(
|
|
14489
14486
|
dashType,
|
|
14490
14487
|
Math.max(strokeWidth, 1),
|
|
14491
14488
|
ss?.customDashSegments
|
|
@@ -14496,14 +14493,14 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17__default.default.memo
|
|
|
14496
14493
|
const markerSeed = el.id.replace(/[^a-zA-Z0-9_-]/gu, "_");
|
|
14497
14494
|
const startMarkerId = `${markerSeed}-sel-start`;
|
|
14498
14495
|
const endMarkerId = `${markerSeed}-sel-end`;
|
|
14499
|
-
const compoundOffsets =
|
|
14500
|
-
const compoundWidths =
|
|
14496
|
+
const compoundOffsets = chunkJKSUB7DR_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
14497
|
+
const compoundWidths = chunkJKSUB7DR_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
14501
14498
|
const strokeCap = pptx.svgLineCap(ss?.lineCap);
|
|
14502
14499
|
const textEl = pptx$1.hasTextProperties(el) ? el : void 0;
|
|
14503
14500
|
const connectorText = textEl?.text?.trim() ?? "";
|
|
14504
14501
|
const connectorTextSegments = textEl?.textSegments;
|
|
14505
14502
|
const connectorTextStyle = textEl?.textStyle;
|
|
14506
|
-
const pathGeometry = shapeEl ?
|
|
14503
|
+
const pathGeometry = shapeEl ? chunkJKSUB7DR_js.getConnectorPathGeometry(shapeEl) : {
|
|
14507
14504
|
pathData: `M 0 0 L ${viewWidth} ${viewHeight}`,
|
|
14508
14505
|
startX: 0,
|
|
14509
14506
|
startY: 0,
|
|
@@ -14512,16 +14509,16 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17__default.default.memo
|
|
|
14512
14509
|
};
|
|
14513
14510
|
const hitTargetWidth = Math.max(strokeWidth * 3, 14);
|
|
14514
14511
|
const selColor = selClr === "blue-400" ? "#60a5fa" : "#3b82f6";
|
|
14515
|
-
const lineShadow =
|
|
14516
|
-
const lineGlow =
|
|
14512
|
+
const lineShadow = chunkJKSUB7DR_js.buildLineShadowCss(el);
|
|
14513
|
+
const lineGlow = chunkJKSUB7DR_js.buildLineGlowFilter(el);
|
|
14517
14514
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14518
14515
|
"div",
|
|
14519
14516
|
{
|
|
14520
14517
|
"data-pptx-element": "true",
|
|
14521
14518
|
"data-element-id": el.id,
|
|
14522
|
-
role:
|
|
14523
|
-
"aria-label":
|
|
14524
|
-
"aria-roledescription":
|
|
14519
|
+
role: chunkJKSUB7DR_js.getAriaRole(el, { actionable: false }),
|
|
14520
|
+
"aria-label": chunkJKSUB7DR_js.getAriaLabel(el),
|
|
14521
|
+
"aria-roledescription": chunkJKSUB7DR_js.getAriaRoleDescription(el),
|
|
14525
14522
|
"aria-selected": isSelected ? true : void 0,
|
|
14526
14523
|
className: "absolute",
|
|
14527
14524
|
style: {
|
|
@@ -14554,14 +14551,14 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17__default.default.memo
|
|
|
14554
14551
|
style: { overflow: "visible", pointerEvents: "none" },
|
|
14555
14552
|
children: [
|
|
14556
14553
|
/* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
|
|
14557
|
-
|
|
14554
|
+
chunkJKSUB7DR_js.renderConnectorMarker(
|
|
14558
14555
|
startMarkerId,
|
|
14559
14556
|
startArrow,
|
|
14560
14557
|
strokePaint,
|
|
14561
14558
|
ss?.connectorStartArrowWidth,
|
|
14562
14559
|
ss?.connectorStartArrowLength
|
|
14563
14560
|
),
|
|
14564
|
-
|
|
14561
|
+
chunkJKSUB7DR_js.renderConnectorMarker(
|
|
14565
14562
|
endMarkerId,
|
|
14566
14563
|
endArrow,
|
|
14567
14564
|
strokePaint,
|
|
@@ -14770,14 +14767,14 @@ function getElementInteractionProps({
|
|
|
14770
14767
|
};
|
|
14771
14768
|
}
|
|
14772
14769
|
function renderDagDuotoneFilterForElement(el) {
|
|
14773
|
-
if (!
|
|
14770
|
+
if (!chunkJKSUB7DR_js.hasDagDuotoneEffect(el)) {
|
|
14774
14771
|
return null;
|
|
14775
14772
|
}
|
|
14776
14773
|
const duotone = el.shapeStyle?.dagDuotone;
|
|
14777
14774
|
if (!duotone) {
|
|
14778
14775
|
return null;
|
|
14779
14776
|
}
|
|
14780
|
-
return
|
|
14777
|
+
return chunkJKSUB7DR_js.renderDagDuotoneSvgFilter(el.id, duotone.color1, duotone.color2);
|
|
14781
14778
|
}
|
|
14782
14779
|
function getContainerStyle({
|
|
14783
14780
|
el,
|
|
@@ -14788,7 +14785,8 @@ function getContainerStyle({
|
|
|
14788
14785
|
animationState,
|
|
14789
14786
|
shapeVisualStyle,
|
|
14790
14787
|
has3DExtrusion,
|
|
14791
|
-
templateEditing
|
|
14788
|
+
templateEditing,
|
|
14789
|
+
edgeBleed
|
|
14792
14790
|
}) {
|
|
14793
14791
|
const ss = pptx$1.hasShapeProperties(el) ? el.shapeStyle : void 0;
|
|
14794
14792
|
const isPicture = el.type === "picture" || el.type === "image";
|
|
@@ -14799,15 +14797,15 @@ function getContainerStyle({
|
|
|
14799
14797
|
const painted = pptx.paintedElementSize(el);
|
|
14800
14798
|
const fs = pptx.MEDIA_FULLSCREEN_OVERLAY_STYLE;
|
|
14801
14799
|
const heightStyle = isFullscreenMedia ? { height: fs.height } : el.type === "table" ? pptx.elementContainerHeightStyle(el, painted.height) : { height: painted.height };
|
|
14802
|
-
|
|
14800
|
+
const style = {
|
|
14803
14801
|
left: isFullscreenMedia ? fs.left : el.x,
|
|
14804
14802
|
top: isFullscreenMedia ? fs.top : el.y,
|
|
14805
14803
|
width: isFullscreenMedia ? fs.width : painted.width,
|
|
14806
14804
|
...heightStyle,
|
|
14807
|
-
transform: isFullscreenMedia ? fs.transform :
|
|
14805
|
+
transform: isFullscreenMedia ? fs.transform : chunkJKSUB7DR_js.getElementTransform(el),
|
|
14808
14806
|
transformOrigin: "center",
|
|
14809
14807
|
overflow: overflowValue,
|
|
14810
|
-
clipPath: isPicture ? void 0 : isImg && !has3DExtrusion ?
|
|
14808
|
+
clipPath: isPicture ? void 0 : isImg && !has3DExtrusion ? chunkJKSUB7DR_js.getCropShapeClipPath(el) : void 0,
|
|
14811
14809
|
zIndex: isFullscreenMedia ? fs.zIndex : zIndex,
|
|
14812
14810
|
visibility: animationState?.visible === false ? "hidden" : "visible",
|
|
14813
14811
|
animation: animationState?.cssAnimation,
|
|
@@ -14840,13 +14838,21 @@ function getContainerStyle({
|
|
|
14840
14838
|
// set for normal slide content or while the mode is off.
|
|
14841
14839
|
...templateEditing ? { outline: "2px dashed rgb(217, 119, 6)", outlineOffset: "1px", opacity: opacity ?? 0.95 } : {}
|
|
14842
14840
|
};
|
|
14841
|
+
return {
|
|
14842
|
+
...style,
|
|
14843
|
+
...pptx.abuttingEdgeBleedStyle(
|
|
14844
|
+
el,
|
|
14845
|
+
edgeBleed,
|
|
14846
|
+
style
|
|
14847
|
+
)
|
|
14848
|
+
};
|
|
14843
14849
|
}
|
|
14844
14850
|
function shapeParams(element) {
|
|
14845
14851
|
const style = pptx$1.hasShapeProperties(element) ? element.shapeStyle : void 0;
|
|
14846
14852
|
const strokeWidth = pptx.paintedStrokeWidth(style);
|
|
14847
|
-
const strokeColor =
|
|
14848
|
-
const fillColor =
|
|
14849
|
-
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(
|
|
14853
|
+
const strokeColor = chunkJKSUB7DR_js.normalizeHexColor(style?.strokeColor, chunkJKSUB7DR_js.DEFAULT_STROKE_COLOR);
|
|
14854
|
+
const fillColor = chunkJKSUB7DR_js.normalizeHexColor(style?.fillColor, chunkJKSUB7DR_js.DEFAULT_FILL_COLOR);
|
|
14855
|
+
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(chunkJKSUB7DR_js.buildCssGradientFromShapeStyle(style) || style?.fillGradient) || style?.fillMode === "pattern" && Boolean(style.fillPatternPreset);
|
|
14850
14856
|
return { hf: hasFill, fc: fillColor, sw: strokeWidth, sc: strokeColor };
|
|
14851
14857
|
}
|
|
14852
14858
|
var Extrusion3DOverlayMemo = /* @__PURE__ */ React17__default.default.memo(
|
|
@@ -14954,7 +14960,7 @@ function ShapeEffectOverlay({
|
|
|
14954
14960
|
const fillOverlayStyle = overlay ? {
|
|
14955
14961
|
position: "absolute",
|
|
14956
14962
|
inset: 0,
|
|
14957
|
-
...pptx$1.isImageLikeElement(element) ?
|
|
14963
|
+
...pptx$1.isImageLikeElement(element) ? chunkJKSUB7DR_js.getImageSurfaceMaskStyle(element) : {},
|
|
14958
14964
|
background: overlay.color,
|
|
14959
14965
|
mixBlendMode: overlay.blendMode,
|
|
14960
14966
|
pointerEvents: "none"
|
|
@@ -15019,6 +15025,7 @@ function ShapeEffectOverlay({
|
|
|
15019
15025
|
"svg",
|
|
15020
15026
|
{
|
|
15021
15027
|
className: "pptx-react-gradient-outline",
|
|
15028
|
+
"data-pptx-outline": "",
|
|
15022
15029
|
"aria-hidden": "true",
|
|
15023
15030
|
viewBox: pptx.strokeOutlineViewBox(element),
|
|
15024
15031
|
preserveAspectRatio: "none",
|
|
@@ -15115,6 +15122,7 @@ var ElementRenderer = /* @__PURE__ */ React17__default.default.memo(
|
|
|
15115
15122
|
opacity,
|
|
15116
15123
|
templateEditing,
|
|
15117
15124
|
zIndex,
|
|
15125
|
+
edgeBleed,
|
|
15118
15126
|
imageAltText,
|
|
15119
15127
|
showResizeHandles,
|
|
15120
15128
|
renderInk: doInk,
|
|
@@ -15161,10 +15169,10 @@ var ElementRenderer = /* @__PURE__ */ React17__default.default.memo(
|
|
|
15161
15169
|
const backgroundAnimationState = pptx.getBackgroundAnimationState(el, presentationElementStates);
|
|
15162
15170
|
const effectPlacement = pptx.getShapeEffectLayerPlacement(el);
|
|
15163
15171
|
const visualAnimationState = backgroundAnimationState ?? animationState;
|
|
15164
|
-
const isTxt =
|
|
15172
|
+
const isTxt = chunkJKSUB7DR_js.isEditableTextElement(el) && allow.textEditable;
|
|
15165
15173
|
const txtSE = pptx$1.hasTextProperties(el) ? el.textStyle : void 0;
|
|
15166
15174
|
const textStyleOverrideCss = pptx.buildTextStyleOverrideCss(el.id, visualAnimationState?.textStyle);
|
|
15167
|
-
const ss =
|
|
15175
|
+
const ss = chunkJKSUB7DR_js.getShapeVisualStyle(
|
|
15168
15176
|
el,
|
|
15169
15177
|
hf,
|
|
15170
15178
|
fc,
|
|
@@ -15173,9 +15181,9 @@ var ElementRenderer = /* @__PURE__ */ React17__default.default.memo(
|
|
|
15173
15181
|
visualAnimationState?.animatesFill,
|
|
15174
15182
|
visualAnimationState?.animatesStroke
|
|
15175
15183
|
);
|
|
15176
|
-
const ts =
|
|
15184
|
+
const ts = chunkJKSUB7DR_js.getTextStyleForElement(el, chunkJKSUB7DR_js.DEFAULT_TEXT_COLOR);
|
|
15177
15185
|
const isImg = el.type === "picture" || el.type === "image";
|
|
15178
|
-
const vs =
|
|
15186
|
+
const vs = chunkJKSUB7DR_js.renderVectorShape(
|
|
15179
15187
|
el,
|
|
15180
15188
|
isImg ? false : hf,
|
|
15181
15189
|
fc,
|
|
@@ -15185,10 +15193,10 @@ var ElementRenderer = /* @__PURE__ */ React17__default.default.memo(
|
|
|
15185
15193
|
visualAnimationState?.animatesStroke
|
|
15186
15194
|
);
|
|
15187
15195
|
const isModel3D = el.type === "model3d";
|
|
15188
|
-
const isConn =
|
|
15196
|
+
const isConn = chunkJKSUB7DR_js.isConnectorOrLineElement(el);
|
|
15189
15197
|
const shapeStyle3d = pptx$1.hasShapeProperties(el) ? el.shapeStyle : void 0;
|
|
15190
15198
|
const extrusionData = React17.useMemo(
|
|
15191
|
-
() =>
|
|
15199
|
+
() => chunkJKSUB7DR_js.build3DExtrusionData(shapeStyle3d?.shape3d, shapeStyle3d?.scene3d, fc, el.width, el.height),
|
|
15192
15200
|
[shapeStyle3d?.shape3d, shapeStyle3d?.scene3d, fc, el.width, el.height]
|
|
15193
15201
|
);
|
|
15194
15202
|
const actionAffordance = useActionAffordance(el, canInteract);
|
|
@@ -15251,7 +15259,8 @@ var ElementRenderer = /* @__PURE__ */ React17__default.default.memo(
|
|
|
15251
15259
|
animationState,
|
|
15252
15260
|
shapeVisualStyle: backgroundAnimationState ? {} : ss,
|
|
15253
15261
|
has3DExtrusion: extrusionData.hasExtrusion,
|
|
15254
|
-
templateEditing
|
|
15262
|
+
templateEditing,
|
|
15263
|
+
edgeBleed
|
|
15255
15264
|
});
|
|
15256
15265
|
const interactionProps = getElementInteractionProps({
|
|
15257
15266
|
element: el,
|
|
@@ -15278,7 +15287,7 @@ var ElementRenderer = /* @__PURE__ */ React17__default.default.memo(
|
|
|
15278
15287
|
"aria-hidden": aria.hidden ? true : void 0,
|
|
15279
15288
|
"aria-selected": isSelected ? true : void 0,
|
|
15280
15289
|
tabIndex: isFocusable ? 0 : -1,
|
|
15281
|
-
className:
|
|
15290
|
+
className: chunkJKSUB7DR_js.cn(
|
|
15282
15291
|
"absolute",
|
|
15283
15292
|
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",
|
|
15284
15293
|
cur,
|
|
@@ -15351,9 +15360,9 @@ var ElementRenderer = /* @__PURE__ */ React17__default.default.memo(
|
|
|
15351
15360
|
txtSE,
|
|
15352
15361
|
txtS: ts,
|
|
15353
15362
|
vecShape: backgroundAnimationState && !isImg ? null : vs,
|
|
15354
|
-
imgStyle:
|
|
15355
|
-
imgFilter:
|
|
15356
|
-
imgOpacity:
|
|
15363
|
+
imgStyle: chunkJKSUB7DR_js.getImageRenderStyle(el),
|
|
15364
|
+
imgFilter: chunkJKSUB7DR_js.getImageEffectsFilter(el),
|
|
15365
|
+
imgOpacity: chunkJKSUB7DR_js.getImageEffectsOpacity(el),
|
|
15357
15366
|
imgAlt: imageAltText,
|
|
15358
15367
|
isTxtEl: isTxt,
|
|
15359
15368
|
media: mediaDataUrls,
|
|
@@ -15490,10 +15499,10 @@ function renderStrokeView(view, pressureSensitive, replayStyle, key) {
|
|
|
15490
15499
|
}
|
|
15491
15500
|
function renderInk(el, options) {
|
|
15492
15501
|
const replay = options?.replay ?? false;
|
|
15493
|
-
const strokes =
|
|
15502
|
+
const strokes = chunkJKSUB7DR_js.buildInkGroupStrokes(el, { color: "#000", width: 3 });
|
|
15494
15503
|
strokes.some((s) => s.circles || s.nibMarks);
|
|
15495
15504
|
const pressureSensitive = options?.pressureSensitive;
|
|
15496
|
-
const replayStyles = replay ?
|
|
15505
|
+
const replayStyles = replay ? chunkJKSUB7DR_js.getInkReplayStyles(el, options?.replayConfig) : null;
|
|
15497
15506
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15498
15507
|
"svg",
|
|
15499
15508
|
{
|
|
@@ -15501,7 +15510,7 @@ function renderInk(el, options) {
|
|
|
15501
15510
|
viewBox: `0 0 ${Math.max(el.width, 1)} ${Math.max(el.height, 1)}`,
|
|
15502
15511
|
preserveAspectRatio: "none",
|
|
15503
15512
|
children: [
|
|
15504
|
-
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children:
|
|
15513
|
+
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children: chunkJKSUB7DR_js.INK_REPLAY_KEYFRAMES }),
|
|
15505
15514
|
strokes.map(
|
|
15506
15515
|
(s, i) => renderStrokeView(s, pressureSensitive, replayStyles?.[i], `${el.id}-ink-${i}`)
|
|
15507
15516
|
)
|
|
@@ -15512,7 +15521,7 @@ function renderInk(el, options) {
|
|
|
15512
15521
|
function renderGroup(children, parentGroupFill) {
|
|
15513
15522
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full h-full pointer-events-none", children: pptx.filterRenderedElements(children).map((c, childIndex) => {
|
|
15514
15523
|
const { hf, fc, sw, sc } = shapeParams(c);
|
|
15515
|
-
const baseSs =
|
|
15524
|
+
const baseSs = chunkJKSUB7DR_js.getShapeVisualStyle(c, hf, fc, sw, sc);
|
|
15516
15525
|
const inheritedFill = pptx.resolveGroupChildFill(c, parentGroupFill);
|
|
15517
15526
|
const ss = inheritedFill ? {
|
|
15518
15527
|
...baseSs,
|
|
@@ -15523,9 +15532,9 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15523
15532
|
backgroundPosition: inheritedFill.backgroundPosition
|
|
15524
15533
|
} : baseSs;
|
|
15525
15534
|
const isI = c.type === "picture" || c.type === "image";
|
|
15526
|
-
const vs =
|
|
15527
|
-
const ts =
|
|
15528
|
-
const isTxt =
|
|
15535
|
+
const vs = chunkJKSUB7DR_js.renderVectorShape(c, isI ? false : hf, fc, sw, sc);
|
|
15536
|
+
const ts = chunkJKSUB7DR_js.getTextStyleForElement(c, chunkJKSUB7DR_js.DEFAULT_TEXT_COLOR);
|
|
15537
|
+
const isTxt = chunkJKSUB7DR_js.isEditableTextElement(c);
|
|
15529
15538
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15530
15539
|
"div",
|
|
15531
15540
|
{
|
|
@@ -15534,9 +15543,9 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15534
15543
|
style: {
|
|
15535
15544
|
left: c.x,
|
|
15536
15545
|
top: c.y,
|
|
15537
|
-
width: Math.max(c.width,
|
|
15538
|
-
height: Math.max(c.height,
|
|
15539
|
-
transform:
|
|
15546
|
+
width: Math.max(c.width, chunkJKSUB7DR_js.MIN_ELEMENT_SIZE),
|
|
15547
|
+
height: Math.max(c.height, chunkJKSUB7DR_js.MIN_ELEMENT_SIZE),
|
|
15548
|
+
transform: chunkJKSUB7DR_js.getElementTransform(c),
|
|
15540
15549
|
transformOrigin: "center",
|
|
15541
15550
|
...ss,
|
|
15542
15551
|
...isI ? {
|
|
@@ -15561,8 +15570,8 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15561
15570
|
// A nested group: recurse, chaining the inherited fill so a
|
|
15562
15571
|
// `grpFill` shape under a fill-less sub-group still paints.
|
|
15563
15572
|
renderGroup(c.children, pptx.getGroupChildParentFill(c, parentGroupFill))
|
|
15564
|
-
) : isI && ("svgData" in c && c.svgData || "imageData" in c && c.imageData) ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style:
|
|
15565
|
-
|
|
15573
|
+
) : isI && ("svgData" in c && c.svgData || "imageData" in c && c.imageData) ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style: chunkJKSUB7DR_js.getImageSurfaceStyle(c), children: [
|
|
15574
|
+
chunkJKSUB7DR_js.isImageTiled(c) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
15566
15575
|
TiledImageLayer,
|
|
15567
15576
|
{
|
|
15568
15577
|
element: c,
|
|
@@ -15575,7 +15584,7 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15575
15584
|
src: "svgData" in c && c.svgData ? c.svgData : c.imageData,
|
|
15576
15585
|
alt: i18n.translationsEn["pptx.ink.groupChildAlt"],
|
|
15577
15586
|
className: "pointer-events-none select-none",
|
|
15578
|
-
style:
|
|
15587
|
+
style: chunkJKSUB7DR_js.getImageRenderStyle(c),
|
|
15579
15588
|
draggable: false
|
|
15580
15589
|
}
|
|
15581
15590
|
),
|
|
@@ -15587,7 +15596,7 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15587
15596
|
{
|
|
15588
15597
|
className: "relative z-10 w-full h-full pointer-events-none whitespace-pre-wrap break-words leading-[1.3]",
|
|
15589
15598
|
style: ts,
|
|
15590
|
-
children:
|
|
15599
|
+
children: chunkJKSUB7DR_js.renderTextSegments(c, chunkJKSUB7DR_js.DEFAULT_TEXT_COLOR)
|
|
15591
15600
|
}
|
|
15592
15601
|
) : null
|
|
15593
15602
|
] })
|
|
@@ -15601,8 +15610,8 @@ function renderContentPart(el, options) {
|
|
|
15601
15610
|
if (el.inkStrokes && el.inkStrokes.length > 0) {
|
|
15602
15611
|
const replay = options?.replay ?? false;
|
|
15603
15612
|
const pressureSensitive = options?.pressureSensitive ?? true;
|
|
15604
|
-
const strokes =
|
|
15605
|
-
const replayStyles = replay ?
|
|
15613
|
+
const strokes = chunkJKSUB7DR_js.buildContentPartStrokes(el);
|
|
15614
|
+
const replayStyles = replay ? chunkJKSUB7DR_js.getContentPartReplayStyles(el.inkStrokes, options?.replayConfig) : null;
|
|
15606
15615
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15607
15616
|
"svg",
|
|
15608
15617
|
{
|
|
@@ -15610,7 +15619,7 @@ function renderContentPart(el, options) {
|
|
|
15610
15619
|
viewBox: `0 0 ${Math.max(el.width, 1)} ${Math.max(el.height, 1)}`,
|
|
15611
15620
|
preserveAspectRatio: "none",
|
|
15612
15621
|
children: [
|
|
15613
|
-
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children:
|
|
15622
|
+
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children: chunkJKSUB7DR_js.INK_REPLAY_KEYFRAMES }),
|
|
15614
15623
|
strokes.map(
|
|
15615
15624
|
(s, i) => renderStrokeView(s, pressureSensitive, replayStyles?.[i], `${el.id}-cp-ink-${i}`)
|
|
15616
15625
|
)
|
|
@@ -15837,9 +15846,9 @@ function useInlineListEditor(element, rootRef, onChange, onModelReplacement) {
|
|
|
15837
15846
|
collaboration: connected,
|
|
15838
15847
|
model: pptx.createInlineListModelObserver(element),
|
|
15839
15848
|
activationSelection,
|
|
15840
|
-
children: seed && !connected ?
|
|
15849
|
+
children: seed && !connected ? chunkJKSUB7DR_js.renderTextSegments(
|
|
15841
15850
|
element,
|
|
15842
|
-
|
|
15851
|
+
chunkJKSUB7DR_js.DEFAULT_TEXT_COLOR,
|
|
15843
15852
|
void 0,
|
|
15844
15853
|
void 0,
|
|
15845
15854
|
void 0,
|
|
@@ -16075,8 +16084,8 @@ function InlineTextEditor({
|
|
|
16075
16084
|
pending.endOffset
|
|
16076
16085
|
);
|
|
16077
16086
|
});
|
|
16078
|
-
const warpStyle =
|
|
16079
|
-
const compensationTransform =
|
|
16087
|
+
const warpStyle = chunkJKSUB7DR_js.getTextWarpStyle(textStyleRaw);
|
|
16088
|
+
const compensationTransform = chunkJKSUB7DR_js.getTextCompensationTransform(element);
|
|
16080
16089
|
const warpTransform = warpStyle?.transform;
|
|
16081
16090
|
const mergedTransform = [compensationTransform, warpTransform].filter(Boolean).join(" ") || void 0;
|
|
16082
16091
|
const wrapperStyle = {
|
|
@@ -16084,7 +16093,7 @@ function InlineTextEditor({
|
|
|
16084
16093
|
...textStyle,
|
|
16085
16094
|
...warpStyle,
|
|
16086
16095
|
transform: mergedTransform,
|
|
16087
|
-
transformOrigin: warpStyle?.transformOrigin || "center"
|
|
16096
|
+
transformOrigin: warpStyle?.transformOrigin || (compensationTransform ? chunkJKSUB7DR_js.getTextCompensationOrigin(element) : "center")
|
|
16088
16097
|
};
|
|
16089
16098
|
const nextInlineStyleValue = (property) => {
|
|
16090
16099
|
if (!pptx$1.hasTextProperties(element)) {
|
|
@@ -16159,7 +16168,7 @@ function InlineTextEditor({
|
|
|
16159
16168
|
const text = e.clipboardData.getData("text/plain");
|
|
16160
16169
|
document.execCommand("insertText", false, text);
|
|
16161
16170
|
},
|
|
16162
|
-
children: list.seed ? list.children : seed.hasRichSegments ?
|
|
16171
|
+
children: list.seed ? list.children : seed.hasRichSegments ? chunkJKSUB7DR_js.renderTextSegments(element, chunkJKSUB7DR_js.DEFAULT_TEXT_COLOR) : seed.initialText
|
|
16163
16172
|
},
|
|
16164
16173
|
list.seed?.paragraphs[0].token ?? "plain"
|
|
16165
16174
|
);
|
|
@@ -16324,7 +16333,7 @@ function OleActionFooter({
|
|
|
16324
16333
|
info,
|
|
16325
16334
|
showActions
|
|
16326
16335
|
}) {
|
|
16327
|
-
const { t } =
|
|
16336
|
+
const { t } = chunkJKSUB7DR_js.useTranslation();
|
|
16328
16337
|
if (!showActions || !info.canDownload || !el.oleEmbeddedData) {
|
|
16329
16338
|
return null;
|
|
16330
16339
|
}
|
|
@@ -16433,7 +16442,7 @@ function SmartArtInlineNodeEditor({
|
|
|
16433
16442
|
onCommit,
|
|
16434
16443
|
onCancel
|
|
16435
16444
|
}) {
|
|
16436
|
-
const { t } =
|
|
16445
|
+
const { t } = chunkJKSUB7DR_js.useTranslation();
|
|
16437
16446
|
const ref = React17__default.default.useRef(null);
|
|
16438
16447
|
const [value, setValue] = React17__default.default.useState(initialText);
|
|
16439
16448
|
const settled = React17__default.default.useRef(false);
|
|
@@ -17061,7 +17070,7 @@ function SmartArtRendererImpl({
|
|
|
17061
17070
|
onUpdateElement,
|
|
17062
17071
|
animationState
|
|
17063
17072
|
}) {
|
|
17064
|
-
const { t } =
|
|
17073
|
+
const { t } = chunkJKSUB7DR_js.useTranslation();
|
|
17065
17074
|
if (element.type !== "smartArt" || !element.smartArtData) {
|
|
17066
17075
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17067
17076
|
"div",
|
|
@@ -17307,7 +17316,7 @@ function groupIntoParagraphs(element, fieldContext) {
|
|
|
17307
17316
|
element,
|
|
17308
17317
|
fieldContext ? (seg) => {
|
|
17309
17318
|
if (seg.fieldType) {
|
|
17310
|
-
const substituted =
|
|
17319
|
+
const substituted = chunkJKSUB7DR_js.substituteFieldText(
|
|
17311
17320
|
seg.text,
|
|
17312
17321
|
seg.fieldType,
|
|
17313
17322
|
fieldContext,
|
|
@@ -17342,13 +17351,13 @@ function getSegmentTspanProps(segment, element, fallbackColor) {
|
|
|
17342
17351
|
if (s.strikethrough) {
|
|
17343
17352
|
decos.push("line-through");
|
|
17344
17353
|
}
|
|
17345
|
-
const fill = s.hyperlink ?
|
|
17354
|
+
const fill = s.hyperlink ? chunkJKSUB7DR_js.normalizeHexColor(s.color || element.textStyle?.color, chunkJKSUB7DR_js.HYPERLINK_COLOR) : chunkJKSUB7DR_js.normalizeHexColor(s.color || element.textStyle?.color, fallbackColor);
|
|
17346
17355
|
return {
|
|
17347
17356
|
fill,
|
|
17348
|
-
fontSize: s.fontSize ?? element.textStyle?.fontSize ??
|
|
17357
|
+
fontSize: s.fontSize ?? element.textStyle?.fontSize ?? chunkJKSUB7DR_js.DEFAULT_TEXT_FONT_SIZE,
|
|
17349
17358
|
fontWeight: pptx.resolveFontWeight(s.fontFamily || element.textStyle?.fontFamily, s.bold),
|
|
17350
17359
|
fontStyle: pptx.resolveFontItalic(s.fontFamily || element.textStyle?.fontFamily, s.italic) ? "italic" : void 0,
|
|
17351
|
-
fontFamily: s.fontFamily || element.textStyle?.fontFamily ? pptx$1.getSubstituteFontFamily(s.fontFamily || element.textStyle?.fontFamily || "") :
|
|
17360
|
+
fontFamily: s.fontFamily || element.textStyle?.fontFamily ? pptx$1.getSubstituteFontFamily(s.fontFamily || element.textStyle?.fontFamily || "") : chunkJKSUB7DR_js.DEFAULT_FONT_FAMILY,
|
|
17352
17361
|
textDecoration: decos.length > 0 ? decos.join(" ") : void 0
|
|
17353
17362
|
};
|
|
17354
17363
|
}
|
|
@@ -17356,8 +17365,8 @@ function resolveSegmentFont(segment, element) {
|
|
|
17356
17365
|
const s = segment.style || {};
|
|
17357
17366
|
const family = s.fontFamily || element.textStyle?.fontFamily;
|
|
17358
17367
|
return {
|
|
17359
|
-
fontFamily: family ? pptx$1.getSubstituteFontFamily(family) :
|
|
17360
|
-
fontSizePx: s.fontSize ?? element.textStyle?.fontSize ??
|
|
17368
|
+
fontFamily: family ? pptx$1.getSubstituteFontFamily(family) : chunkJKSUB7DR_js.DEFAULT_FONT_FAMILY,
|
|
17369
|
+
fontSizePx: s.fontSize ?? element.textStyle?.fontSize ?? chunkJKSUB7DR_js.DEFAULT_TEXT_FONT_SIZE,
|
|
17361
17370
|
bold: s.bold ?? element.textStyle?.bold,
|
|
17362
17371
|
italic: s.italic ?? element.textStyle?.italic
|
|
17363
17372
|
};
|
|
@@ -17446,9 +17455,9 @@ function WarpedText({
|
|
|
17446
17455
|
const warpAdj2 = textEl.textStyle?.textWarpAdj2;
|
|
17447
17456
|
const align = textEl.textStyle?.align ?? "center";
|
|
17448
17457
|
const { startOffset, textAnchor } = getAlignmentProps(align);
|
|
17449
|
-
const baseFontSize = textEl.textStyle?.fontSize ??
|
|
17450
|
-
const baseFontFamily = textEl.textStyle?.fontFamily ? pptx$1.getSubstituteFontFamily(textEl.textStyle.fontFamily) :
|
|
17451
|
-
const baseFill =
|
|
17458
|
+
const baseFontSize = textEl.textStyle?.fontSize ?? chunkJKSUB7DR_js.DEFAULT_TEXT_FONT_SIZE;
|
|
17459
|
+
const baseFontFamily = textEl.textStyle?.fontFamily ? pptx$1.getSubstituteFontFamily(textEl.textStyle.fontFamily) : chunkJKSUB7DR_js.DEFAULT_FONT_FAMILY;
|
|
17460
|
+
const baseFill = chunkJKSUB7DR_js.normalizeHexColor(textEl.textStyle?.color, fallbackColor);
|
|
17452
17461
|
if (pptx.hasGlyphEnvelope(preset)) {
|
|
17453
17462
|
const perLine = pptx.buildGlyphEnvelopeBlock(
|
|
17454
17463
|
preset,
|
|
@@ -17551,7 +17560,7 @@ function WarpedText({
|
|
|
17551
17560
|
var GLYPH_BY_SHAPE = /* @__PURE__ */ buildGlyphByShape();
|
|
17552
17561
|
function buildGlyphByShape() {
|
|
17553
17562
|
const glyphs = Object.fromEntries(
|
|
17554
|
-
|
|
17563
|
+
chunkJKSUB7DR_js.ACTION_BUTTON_PRESETS.map((p) => [p.shapeType, p.iconPath])
|
|
17555
17564
|
);
|
|
17556
17565
|
glyphs["actionButtonForwardOrNext"] = glyphs["actionButtonForwardNext"];
|
|
17557
17566
|
glyphs["actionButtonBackOrPrevious"] = glyphs["actionButtonBackPrevious"];
|
|
@@ -17625,9 +17634,10 @@ function renderTextElementBody(options) {
|
|
|
17625
17634
|
const useSvgWarp = pptx.shouldUseSvgWarp(
|
|
17626
17635
|
pptx$1.hasTextProperties(el) ? el.textStyle?.textWarpPreset : void 0
|
|
17627
17636
|
);
|
|
17628
|
-
const scene3dStyle = pptx$1.hasTextProperties(el) ?
|
|
17637
|
+
const scene3dStyle = pptx$1.hasTextProperties(el) ? chunkJKSUB7DR_js.buildTextBody3DSceneStyle(el.textStyle, { width: el.width, height: el.height }) : void 0;
|
|
17629
17638
|
const rotationTransform = pptx.getTextBodyRotationTransform(el);
|
|
17630
|
-
const
|
|
17639
|
+
const compensation = pptx.getTextCompensationStyle(el);
|
|
17640
|
+
const composedTransform = [rotationTransform, compensation?.transform, scene3dStyle?.transform].filter(Boolean).join(" ") || void 0;
|
|
17631
17641
|
const transformStyle = {
|
|
17632
17642
|
transform: composedTransform,
|
|
17633
17643
|
// A COM-measured homography (`scene3dStyle.transformOrigin === '0 0'`)
|
|
@@ -17638,7 +17648,7 @@ function renderTextElementBody(options) {
|
|
|
17638
17648
|
// hardcoded to `'center'` unconditionally, silently clobbering
|
|
17639
17649
|
// `scene3dStyle.transformOrigin` the same way Svelte's `ElementRenderer`
|
|
17640
17650
|
// once re-clobbered `pointerEvents` from its own interactive flag.
|
|
17641
|
-
transformOrigin: scene3dStyle?.transformOrigin ?? "center",
|
|
17651
|
+
transformOrigin: scene3dStyle?.transformOrigin ?? compensation?.transformOrigin ?? "center",
|
|
17642
17652
|
...scene3dStyle?.perspective ? { perspective: scene3dStyle.perspective } : {},
|
|
17643
17653
|
// COM-calibrated off-axis correction for a handful of camera presets
|
|
17644
17654
|
// (see `visual-3d-camera`'s module doc comment); only reachable when an
|
|
@@ -17657,18 +17667,18 @@ function renderTextElementBody(options) {
|
|
|
17657
17667
|
shouldRenderText && (useSvgWarp ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
17658
17668
|
"div",
|
|
17659
17669
|
{
|
|
17660
|
-
className:
|
|
17670
|
+
className: chunkJKSUB7DR_js.cn(
|
|
17661
17671
|
"relative z-10 w-full h-full",
|
|
17662
17672
|
onHyperlinkClick ? "" : "pointer-events-none"
|
|
17663
17673
|
),
|
|
17664
|
-
style: { ...
|
|
17674
|
+
style: { ...chunkJKSUB7DR_js.getTextLayoutStyle(el), ...transformStyle },
|
|
17665
17675
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17666
17676
|
WarpedText,
|
|
17667
17677
|
{
|
|
17668
17678
|
element: el,
|
|
17669
17679
|
width: el.width,
|
|
17670
17680
|
height: el.height,
|
|
17671
|
-
fallbackColor:
|
|
17681
|
+
fallbackColor: chunkJKSUB7DR_js.DEFAULT_TEXT_COLOR,
|
|
17672
17682
|
findHighlights: findHl,
|
|
17673
17683
|
fieldContext
|
|
17674
17684
|
}
|
|
@@ -17677,19 +17687,19 @@ function renderTextElementBody(options) {
|
|
|
17677
17687
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
17678
17688
|
"div",
|
|
17679
17689
|
{
|
|
17680
|
-
className:
|
|
17690
|
+
className: chunkJKSUB7DR_js.cn(
|
|
17681
17691
|
"relative z-10 w-full h-full whitespace-pre-wrap break-words leading-[1.3]",
|
|
17682
17692
|
onHyperlinkClick ? "" : "pointer-events-none"
|
|
17683
17693
|
),
|
|
17684
17694
|
style: {
|
|
17685
|
-
...
|
|
17695
|
+
...chunkJKSUB7DR_js.getTextLayoutStyle(el),
|
|
17686
17696
|
...txtS,
|
|
17687
|
-
...
|
|
17697
|
+
...chunkJKSUB7DR_js.getTextWarpStyle(txtSE),
|
|
17688
17698
|
...transformStyle
|
|
17689
17699
|
},
|
|
17690
|
-
children:
|
|
17700
|
+
children: chunkJKSUB7DR_js.renderTextSegments(
|
|
17691
17701
|
el,
|
|
17692
|
-
|
|
17702
|
+
chunkJKSUB7DR_js.DEFAULT_TEXT_COLOR,
|
|
17693
17703
|
void 0,
|
|
17694
17704
|
findHl,
|
|
17695
17705
|
onHyperlinkClick,
|
|
@@ -17710,7 +17720,7 @@ function ZoomElementRenderer({
|
|
|
17710
17720
|
onZoomClick,
|
|
17711
17721
|
sourceSlideIndex
|
|
17712
17722
|
}) {
|
|
17713
|
-
const { t } =
|
|
17723
|
+
const { t } = chunkJKSUB7DR_js.useTranslation();
|
|
17714
17724
|
const summaryView = pptx.buildSummaryZoomView(
|
|
17715
17725
|
element,
|
|
17716
17726
|
(index) => {
|
|
@@ -18008,7 +18018,7 @@ function renderBody(options) {
|
|
|
18008
18018
|
);
|
|
18009
18019
|
}
|
|
18010
18020
|
if (isImg) {
|
|
18011
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style:
|
|
18021
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style: chunkJKSUB7DR_js.getImageSurfaceStyle(el), children: [
|
|
18012
18022
|
renderImg(el, imgStyle, imgFilter, imgAlt, imgOpacity),
|
|
18013
18023
|
vecShape ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none absolute inset-0", children: vecShape }) : null
|
|
18014
18024
|
] });
|
|
@@ -18025,7 +18035,7 @@ function renderBody(options) {
|
|
|
18025
18035
|
textDirection: txtSE?.textDirection,
|
|
18026
18036
|
textStyle: txtS,
|
|
18027
18037
|
textStyleRaw: txtSE,
|
|
18028
|
-
layoutStyle:
|
|
18038
|
+
layoutStyle: chunkJKSUB7DR_js.getTextLayoutStyle(el),
|
|
18029
18039
|
element: el,
|
|
18030
18040
|
onCommit,
|
|
18031
18041
|
onCancel,
|
|
@@ -18036,7 +18046,7 @@ function renderBody(options) {
|
|
|
18036
18046
|
] });
|
|
18037
18047
|
}
|
|
18038
18048
|
if (el.type === "table") {
|
|
18039
|
-
return
|
|
18049
|
+
return chunkJKSUB7DR_js.renderTableElement(el, txtS, {
|
|
18040
18050
|
editable: isSel,
|
|
18041
18051
|
selectedCell: isSel ? tableSt : null,
|
|
18042
18052
|
onSelectCell: onCellSel,
|
|
@@ -18069,7 +18079,7 @@ function renderBody(options) {
|
|
|
18069
18079
|
);
|
|
18070
18080
|
}
|
|
18071
18081
|
if (el.type === "media") {
|
|
18072
|
-
return
|
|
18082
|
+
return chunkJKSUB7DR_js.renderMediaElement(el, media, {
|
|
18073
18083
|
// Present mode autoplays every media element on the active slide,
|
|
18074
18084
|
// not only ones persisted with their own `autoPlay` flag (matching
|
|
18075
18085
|
// the other four bindings' unconditional `presenting`-gated
|
|
@@ -18121,27 +18131,27 @@ function renderBody(options) {
|
|
|
18121
18131
|
}
|
|
18122
18132
|
return renderGroup(el.children, pptx.getGroupChildParentFill(el));
|
|
18123
18133
|
}
|
|
18124
|
-
if (
|
|
18125
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
18134
|
+
if (chunkJKSUB7DR_js.shouldRenderFallbackLabel(el, isTxtEl)) {
|
|
18135
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkJKSUB7DR_js.getElementLabel(el) });
|
|
18126
18136
|
}
|
|
18127
18137
|
return renderTextElementBody(options);
|
|
18128
18138
|
}
|
|
18129
18139
|
function defaultTextColorForFill(fillColor) {
|
|
18130
18140
|
const hex = String(fillColor ?? "").replace(/^#/u, "");
|
|
18131
18141
|
if (!/^[0-9a-f]{6}$/iu.test(hex)) {
|
|
18132
|
-
return
|
|
18142
|
+
return chunkJKSUB7DR_js.DEFAULT_TEXT_COLOR;
|
|
18133
18143
|
}
|
|
18134
18144
|
const channels = [0, 2, 4].map((offset) => Number.parseInt(hex.slice(offset, offset + 2), 16) / 255).map((channel) => channel <= 0.04045 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4);
|
|
18135
18145
|
const luminance = channels[0] * 0.2126 + channels[1] * 0.7152 + channels[2] * 0.0722;
|
|
18136
|
-
return luminance > 0.179 ?
|
|
18146
|
+
return luminance > 0.179 ? chunkJKSUB7DR_js.DEFAULT_TEXT_COLOR : "#ffffff";
|
|
18137
18147
|
}
|
|
18138
18148
|
function getStaticElementVisualState(element, parentGroupFill) {
|
|
18139
18149
|
const style = pptx$1.hasShapeProperties(element) ? element.shapeStyle : void 0;
|
|
18140
|
-
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(
|
|
18141
|
-
const fill =
|
|
18150
|
+
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(chunkJKSUB7DR_js.buildCssGradientFromShapeStyle(style) || style?.fillGradient) || style?.fillMode === "pattern" && Boolean(style.fillPatternPreset);
|
|
18151
|
+
const fill = chunkJKSUB7DR_js.normalizeHexColor(style?.fillColor, chunkJKSUB7DR_js.DEFAULT_FILL_COLOR);
|
|
18142
18152
|
const strokeWidth = pptx.paintedStrokeWidth(style);
|
|
18143
|
-
const stroke =
|
|
18144
|
-
const baseVisualStyle =
|
|
18153
|
+
const stroke = chunkJKSUB7DR_js.normalizeHexColor(style?.strokeColor, chunkJKSUB7DR_js.DEFAULT_STROKE_COLOR);
|
|
18154
|
+
const baseVisualStyle = chunkJKSUB7DR_js.getShapeVisualStyle(element, hasFill, fill, strokeWidth, stroke);
|
|
18145
18155
|
const inheritedFill = pptx.resolveGroupChildFill(element, parentGroupFill);
|
|
18146
18156
|
const visualStyle = inheritedFill ? {
|
|
18147
18157
|
...baseVisualStyle,
|
|
@@ -18151,12 +18161,12 @@ function getStaticElementVisualState(element, parentGroupFill) {
|
|
|
18151
18161
|
backgroundSize: inheritedFill.backgroundSize,
|
|
18152
18162
|
backgroundPosition: inheritedFill.backgroundPosition
|
|
18153
18163
|
} : baseVisualStyle;
|
|
18154
|
-
const textStyle =
|
|
18164
|
+
const textStyle = chunkJKSUB7DR_js.getTextStyleForElement(
|
|
18155
18165
|
element,
|
|
18156
|
-
element.type === "shape" && hasFill ? defaultTextColorForFill(fill) :
|
|
18166
|
+
element.type === "shape" && hasFill ? defaultTextColorForFill(fill) : chunkJKSUB7DR_js.DEFAULT_TEXT_COLOR
|
|
18157
18167
|
);
|
|
18158
18168
|
const isImage = element.type === "picture" || element.type === "image";
|
|
18159
|
-
const letsTextOverflow = pptx$1.hasTextProperties(element) &&
|
|
18169
|
+
const letsTextOverflow = pptx$1.hasTextProperties(element) && Boolean(element.text?.trim());
|
|
18160
18170
|
const shapeType = pptx$1.hasShapeProperties(element) ? element.shapeType : void 0;
|
|
18161
18171
|
const isCallout = pptx.isWedgeCalloutPresetShape(shapeType) || String(shapeType ?? "").toLowerCase().includes("callout");
|
|
18162
18172
|
return {
|
|
@@ -18178,7 +18188,7 @@ function getStaticElementInteractionState(element, hasActionHandler, exposeEleme
|
|
|
18178
18188
|
return { action, isActionable, contractRole };
|
|
18179
18189
|
}
|
|
18180
18190
|
function getStaticElementWrapperClassName(element, visual, positioned, isActionable) {
|
|
18181
|
-
const overflowClass = visual.isImage || visual.strokeWidth > 0 || element.type === "group" ||
|
|
18191
|
+
const overflowClass = visual.isImage || visual.strokeWidth > 0 || element.type === "group" || chunkJKSUB7DR_js.isConnectorOrLineElement(element) || visual.isCallout || visual.letsTextOverflow ? "" : "overflow-hidden";
|
|
18182
18192
|
const pointerClass = isActionable ? "pointer-events-auto cursor-pointer" : "pointer-events-none";
|
|
18183
18193
|
return `${positioned ? "absolute" : "relative"} ${overflowClass} ${pointerClass}`;
|
|
18184
18194
|
}
|
|
@@ -18261,7 +18271,7 @@ function StaticElementRendererImpl({
|
|
|
18261
18271
|
top: positioned ? element.y : void 0,
|
|
18262
18272
|
width: positioned ? Math.max(element.width, 1) : "100%",
|
|
18263
18273
|
height: positioned ? Math.max(element.height, 1) : "100%",
|
|
18264
|
-
transform: positioned ?
|
|
18274
|
+
transform: positioned ? chunkJKSUB7DR_js.getElementTransform(element) : void 0,
|
|
18265
18275
|
transformOrigin: "center",
|
|
18266
18276
|
zIndex,
|
|
18267
18277
|
...visualStyle,
|
|
@@ -18304,18 +18314,18 @@ function StaticElementRendererImpl({
|
|
|
18304
18314
|
spellCheck: false,
|
|
18305
18315
|
txtSE: pptx$1.hasTextProperties(element) ? element.textStyle : void 0,
|
|
18306
18316
|
txtS: textStyle,
|
|
18307
|
-
vecShape:
|
|
18317
|
+
vecShape: chunkJKSUB7DR_js.renderVectorShape(
|
|
18308
18318
|
element,
|
|
18309
18319
|
isImage ? false : hasFill,
|
|
18310
18320
|
fill,
|
|
18311
18321
|
strokeWidth,
|
|
18312
18322
|
stroke
|
|
18313
18323
|
),
|
|
18314
|
-
imgStyle: imageAnimation ? { ...
|
|
18315
|
-
imgFilter:
|
|
18316
|
-
imgOpacity:
|
|
18324
|
+
imgStyle: imageAnimation ? { ...chunkJKSUB7DR_js.getImageRenderStyle(element), animation: imageAnimation } : chunkJKSUB7DR_js.getImageRenderStyle(element),
|
|
18325
|
+
imgFilter: chunkJKSUB7DR_js.getImageEffectsFilter(element),
|
|
18326
|
+
imgOpacity: chunkJKSUB7DR_js.getImageEffectsOpacity(element),
|
|
18317
18327
|
imgAlt: "",
|
|
18318
|
-
isTxtEl:
|
|
18328
|
+
isTxtEl: chunkJKSUB7DR_js.isEditableTextElement(element),
|
|
18319
18329
|
media: mediaDataUrls,
|
|
18320
18330
|
tableSt: null,
|
|
18321
18331
|
isSel: false,
|
|
@@ -18363,7 +18373,7 @@ function SlideLayer({
|
|
|
18363
18373
|
style: {
|
|
18364
18374
|
width: safeWidth,
|
|
18365
18375
|
height: safeHeight,
|
|
18366
|
-
backgroundColor: slide.backgroundColor ?
|
|
18376
|
+
backgroundColor: slide.backgroundColor ? chunkJKSUB7DR_js.normalizeHexColor(slide.backgroundColor, "#ffffff") : "#ffffff",
|
|
18367
18377
|
backgroundImage: slide.backgroundImage ? `url(${slide.backgroundImage})` : slide.backgroundGradient ? slide.backgroundGradient : void 0,
|
|
18368
18378
|
backgroundSize: slide.backgroundImage ? "cover" : void 0,
|
|
18369
18379
|
backgroundPosition: slide.backgroundImage ? "center" : void 0
|
|
@@ -18437,7 +18447,8 @@ function FragmentedTransitionLayer({
|
|
|
18437
18447
|
);
|
|
18438
18448
|
}
|
|
18439
18449
|
function overlayEntries(plan, incomingSlide) {
|
|
18440
|
-
|
|
18450
|
+
const slots = pptx.morphOverlayElementSlots(plan);
|
|
18451
|
+
return plan.overlayLayers.filter((layer) => layer.side === "outgoing" || incomingSlide !== void 0).flatMap((layer) => layer.elements.map((element) => ({ element, side: layer.side }))).map((entry, index) => ({ ...entry, zIndex: slots.elements.get(entry.element.id) ?? index }));
|
|
18441
18452
|
}
|
|
18442
18453
|
function MorphTransitionOverlay({
|
|
18443
18454
|
canvasSize,
|
|
@@ -18447,6 +18458,7 @@ function MorphTransitionOverlay({
|
|
|
18447
18458
|
incomingSlide,
|
|
18448
18459
|
containerRef
|
|
18449
18460
|
}) {
|
|
18461
|
+
const groupSlots = pptx.morphOverlayElementSlots(morphPlan).groups;
|
|
18450
18462
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18451
18463
|
"div",
|
|
18452
18464
|
{
|
|
@@ -18456,7 +18468,11 @@ function MorphTransitionOverlay({
|
|
|
18456
18468
|
className: "pptx-react-transition-overlay absolute inset-0 pointer-events-none overflow-hidden",
|
|
18457
18469
|
style: { zIndex: 40 },
|
|
18458
18470
|
children: [
|
|
18459
|
-
/* @__PURE__ */ jsxRuntime.jsx("style", { children:
|
|
18471
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { children: [
|
|
18472
|
+
morphPlan.keyframesCss,
|
|
18473
|
+
pptx.buildMorphOutlineRules(morphPlan, "data-pptx-morph-outgoing"),
|
|
18474
|
+
pptx.buildMorphOutlineRules(morphPlan, "data-pptx-morph-lifted")
|
|
18475
|
+
].filter(Boolean).join("\n") }),
|
|
18460
18476
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18461
18477
|
"div",
|
|
18462
18478
|
{
|
|
@@ -18522,7 +18538,7 @@ function MorphTransitionOverlay({
|
|
|
18522
18538
|
"data-pptx-morph-crossfade": group.incoming.id,
|
|
18523
18539
|
style: {
|
|
18524
18540
|
...pptx.MORPH_CROSSFADE_GROUP_STYLE,
|
|
18525
|
-
zIndex: morphPlan.outgoingElements.length + morphPlan.overlayIncomingElements.length + index
|
|
18541
|
+
zIndex: groupSlots[index] ?? morphPlan.outgoingElements.length + morphPlan.overlayIncomingElements.length + index
|
|
18526
18542
|
},
|
|
18527
18543
|
children: [
|
|
18528
18544
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -18900,7 +18916,6 @@ exports.playAnimationSound = playAnimationSound;
|
|
|
18900
18916
|
exports.renderStrokeView = renderStrokeView;
|
|
18901
18917
|
exports.renderToCanvas = renderToCanvas;
|
|
18902
18918
|
exports.resolveSmartArtDataPalette = resolveSmartArtDataPalette;
|
|
18903
|
-
exports.safePrompt = safePrompt;
|
|
18904
18919
|
exports.scopeLayoutOptionsToActiveSlide = scopeLayoutOptionsToActiveSlide;
|
|
18905
18920
|
exports.useAnimationPlayback = useAnimationPlayback;
|
|
18906
18921
|
exports.useAnnotationHandlers = useAnnotationHandlers;
|