pptx-react-viewer 4.27.0 → 4.30.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 +106 -0
- package/README.md +37 -33
- package/dist/{AiChatPanel-3J6XGIJ4.mjs → AiChatPanel-42FL4CPM.mjs} +2 -2
- package/dist/AiChatPanel-42FL4CPM.mjs.br +0 -0
- package/dist/AiChatPanel-42FL4CPM.mjs.gz +0 -0
- package/dist/{AiChatPanel-EGTSK4T5.js → AiChatPanel-6VWCT6NE.js} +10 -10
- package/dist/AiChatPanel-6VWCT6NE.js.br +0 -0
- package/dist/AiChatPanel-6VWCT6NE.js.gz +0 -0
- package/dist/{Model3DScene-2V2GQ6FY.mjs → Model3DScene-EZDCI7TT.mjs} +1 -1
- package/dist/Model3DScene-EZDCI7TT.mjs.br +0 -0
- package/dist/Model3DScene-EZDCI7TT.mjs.gz +0 -0
- package/dist/{Model3DScene-Q3XEZSWV.js → Model3DScene-KYIYYLMY.js} +1 -1
- package/dist/Model3DScene-KYIYYLMY.js.br +0 -0
- package/dist/Model3DScene-KYIYYLMY.js.gz +0 -0
- package/dist/{chunk-QGM4M3NI.js → chunk-DFFCFNK2.js} +2 -0
- package/dist/chunk-DFFCFNK2.js.br +0 -0
- package/dist/chunk-DFFCFNK2.js.gz +0 -0
- package/dist/{chunk-6DZX6EAA.mjs → chunk-GDQSMJQZ.mjs} +2 -1
- package/dist/chunk-GDQSMJQZ.mjs.br +0 -0
- package/dist/chunk-GDQSMJQZ.mjs.gz +0 -0
- package/dist/{chunk-ZK7UEEXE.mjs → chunk-GXMGJ5A3.mjs} +85 -87
- package/dist/chunk-GXMGJ5A3.mjs.br +0 -0
- package/dist/chunk-GXMGJ5A3.mjs.gz +0 -0
- package/dist/{chunk-34AXBLYH.mjs → chunk-KRXS36RB.mjs} +83 -87
- package/dist/chunk-KRXS36RB.mjs.br +0 -0
- package/dist/chunk-KRXS36RB.mjs.gz +0 -0
- package/dist/{chunk-MQCBMO6A.js → chunk-MFGD7XVJ.js} +264 -268
- package/dist/chunk-MFGD7XVJ.js.br +0 -0
- package/dist/chunk-MFGD7XVJ.js.gz +0 -0
- package/dist/chunk-RHNJ4IU2.js +4229 -0
- package/dist/chunk-RHNJ4IU2.js.br +0 -0
- package/dist/chunk-RHNJ4IU2.js.gz +0 -0
- package/dist/{chunk-5RQTZ376.js → chunk-XKV2QDAO.js} +396 -398
- package/dist/chunk-XKV2QDAO.js.br +0 -0
- package/dist/chunk-XKV2QDAO.js.gz +0 -0
- package/dist/chunk-ZIBAN7RL.mjs +3888 -0
- package/dist/chunk-ZIBAN7RL.mjs.br +0 -0
- package/dist/chunk-ZIBAN7RL.mjs.gz +0 -0
- package/dist/i18n.js +1 -1
- package/dist/i18n.js.br +2 -2
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +25 -25
- 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 +11 -1
- package/dist/internals.js +82 -82
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/{three.module-A6ACXOES.mjs → three.module-2R4ADL7W.mjs} +1 -1
- package/dist/three.module-2R4ADL7W.mjs.br +0 -0
- package/dist/three.module-2R4ADL7W.mjs.gz +0 -0
- package/dist/{three.module-IORLGCSX.js → three.module-LS32MK23.js} +1 -1
- package/dist/three.module-LS32MK23.js.br +0 -0
- package/dist/three.module-LS32MK23.js.gz +0 -0
- package/dist/viewer/index.d.ts +22 -0
- package/dist/viewer/index.js +20 -20
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +4 -4
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/dist/{y-webrtc-F5IA7T5S.mjs → y-webrtc-6DZI5KUK.mjs} +1 -1
- package/dist/y-webrtc-6DZI5KUK.mjs.br +0 -0
- package/dist/y-webrtc-6DZI5KUK.mjs.gz +0 -0
- package/dist/{y-webrtc-6LID3XZO.js → y-webrtc-OTRGEYOH.js} +5 -5
- package/dist/y-webrtc-OTRGEYOH.js.br +0 -0
- package/dist/y-webrtc-OTRGEYOH.js.gz +0 -0
- package/dist/{y-websocket-HOY2HFMH.js → y-websocket-AWBYMAHL.js} +1 -1
- package/dist/y-websocket-AWBYMAHL.js.br +0 -0
- package/dist/y-websocket-AWBYMAHL.js.gz +0 -0
- package/dist/{y-websocket-VGLBV2HJ.mjs → y-websocket-VAKUVRQT.mjs} +1 -1
- package/dist/y-websocket-VAKUVRQT.mjs.br +0 -0
- package/dist/y-websocket-VAKUVRQT.mjs.gz +0 -0
- package/package.json +4 -3
- package/dist/AiChatPanel-3J6XGIJ4.mjs.br +0 -0
- package/dist/AiChatPanel-3J6XGIJ4.mjs.gz +0 -0
- package/dist/AiChatPanel-EGTSK4T5.js.br +0 -0
- package/dist/AiChatPanel-EGTSK4T5.js.gz +0 -0
- package/dist/Model3DScene-2V2GQ6FY.mjs.br +0 -0
- package/dist/Model3DScene-2V2GQ6FY.mjs.gz +0 -0
- package/dist/Model3DScene-Q3XEZSWV.js.br +0 -2
- package/dist/Model3DScene-Q3XEZSWV.js.gz +0 -0
- package/dist/UTIF-RPFRSSC5.mjs +0 -6400
- package/dist/UTIF-RPFRSSC5.mjs.br +0 -0
- package/dist/UTIF-RPFRSSC5.mjs.gz +0 -0
- package/dist/UTIF-XWCKRN6V.js +0 -6402
- package/dist/UTIF-XWCKRN6V.js.br +0 -0
- package/dist/UTIF-XWCKRN6V.js.gz +0 -0
- package/dist/chunk-34AXBLYH.mjs.br +0 -0
- package/dist/chunk-34AXBLYH.mjs.gz +0 -0
- package/dist/chunk-5RQTZ376.js.br +0 -0
- package/dist/chunk-5RQTZ376.js.gz +0 -0
- package/dist/chunk-6DZX6EAA.mjs.br +0 -0
- package/dist/chunk-6DZX6EAA.mjs.gz +0 -0
- package/dist/chunk-MQCBMO6A.js.br +0 -0
- package/dist/chunk-MQCBMO6A.js.gz +0 -0
- package/dist/chunk-QGM4M3NI.js.br +0 -0
- package/dist/chunk-QGM4M3NI.js.gz +0 -0
- package/dist/chunk-TYJZJJZ6.mjs +0 -208183
- package/dist/chunk-TYJZJJZ6.mjs.br +0 -0
- package/dist/chunk-TYJZJJZ6.mjs.gz +0 -0
- package/dist/chunk-WK6JBJCT.js +0 -208548
- package/dist/chunk-WK6JBJCT.js.br +0 -0
- package/dist/chunk-WK6JBJCT.js.gz +0 -0
- package/dist/chunk-ZK7UEEXE.mjs.br +0 -0
- package/dist/chunk-ZK7UEEXE.mjs.gz +0 -0
- package/dist/three.module-A6ACXOES.mjs.br +0 -0
- package/dist/three.module-A6ACXOES.mjs.gz +0 -0
- package/dist/three.module-IORLGCSX.js.br +0 -0
- package/dist/three.module-IORLGCSX.js.gz +0 -0
- package/dist/y-webrtc-6LID3XZO.js.br +0 -0
- package/dist/y-webrtc-6LID3XZO.js.gz +0 -0
- package/dist/y-webrtc-F5IA7T5S.mjs.br +0 -0
- package/dist/y-webrtc-F5IA7T5S.mjs.gz +0 -0
- package/dist/y-websocket-HOY2HFMH.js.br +0 -0
- package/dist/y-websocket-HOY2HFMH.js.gz +0 -0
- package/dist/y-websocket-VGLBV2HJ.mjs.br +0 -0
- package/dist/y-websocket-VGLBV2HJ.mjs.gz +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkRHNJ4IU2_js = require('./chunk-RHNJ4IU2.js');
|
|
4
4
|
var pptx = require('ooxml-ui/pptx');
|
|
5
5
|
var React17 = require('react');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -130,7 +130,7 @@ function useYjsProvider({ config: inputConfig }) {
|
|
|
130
130
|
}
|
|
131
131
|
setStatus("connecting");
|
|
132
132
|
try {
|
|
133
|
-
const [Y, { WebrtcProvider }] = await Promise.all([import('yjs'), import('./y-webrtc-
|
|
133
|
+
const [Y, { WebrtcProvider }] = await Promise.all([import('yjs'), import('./y-webrtc-OTRGEYOH.js')]);
|
|
134
134
|
if (generation !== generationRef.current) {
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
@@ -205,7 +205,7 @@ function useYjsProvider({ config: inputConfig }) {
|
|
|
205
205
|
}
|
|
206
206
|
setStatus("connecting");
|
|
207
207
|
try {
|
|
208
|
-
const [Y, { WebsocketProvider }] = await Promise.all([import('yjs'), import('./y-websocket-
|
|
208
|
+
const [Y, { WebsocketProvider }] = await Promise.all([import('yjs'), import('./y-websocket-AWBYMAHL.js')]);
|
|
209
209
|
if (generation !== generationRef.current) {
|
|
210
210
|
return;
|
|
211
211
|
}
|
|
@@ -684,9 +684,9 @@ function serializeHistoryDocument(snapshot) {
|
|
|
684
684
|
}
|
|
685
685
|
function recordExplicitSlideUpdate(past, future, previous, before, label, maxDepth) {
|
|
686
686
|
if (previous && serializeHistoryDocument(previous) !== serializeHistoryDocument(before)) {
|
|
687
|
-
past.push(
|
|
687
|
+
past.push(chunkRHNJ4IU2_js.cloneHistorySnapshot(previous));
|
|
688
688
|
}
|
|
689
|
-
past.push({ ...
|
|
689
|
+
past.push({ ...chunkRHNJ4IU2_js.cloneHistorySnapshot(before), actionLabel: label });
|
|
690
690
|
while (past.length > Math.max(1, maxDepth)) {
|
|
691
691
|
past.shift();
|
|
692
692
|
}
|
|
@@ -775,8 +775,8 @@ function useEditorHistory(input) {
|
|
|
775
775
|
width: canvasSize.width,
|
|
776
776
|
height: canvasSize.height,
|
|
777
777
|
activeSlideIndex,
|
|
778
|
-
slides: slides.map(
|
|
779
|
-
templateElementsBySlideId:
|
|
778
|
+
slides: slides.map(chunkRHNJ4IU2_js.cloneSlide),
|
|
779
|
+
templateElementsBySlideId: chunkRHNJ4IU2_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
780
780
|
...actionLabel ? { actionLabel } : {}
|
|
781
781
|
};
|
|
782
782
|
},
|
|
@@ -789,9 +789,9 @@ function useEditorHistory(input) {
|
|
|
789
789
|
width: snapshot.width,
|
|
790
790
|
height: snapshot.height
|
|
791
791
|
});
|
|
792
|
-
setSlides(snapshot.slides.map(
|
|
792
|
+
setSlides(snapshot.slides.map(chunkRHNJ4IU2_js.cloneSlide));
|
|
793
793
|
setTemplateElementsBySlideId(
|
|
794
|
-
|
|
794
|
+
chunkRHNJ4IU2_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
795
795
|
);
|
|
796
796
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
797
797
|
setSelectedElementIds([]);
|
|
@@ -830,8 +830,8 @@ function useEditorHistory(input) {
|
|
|
830
830
|
const currentSnapshot = buildHistorySnapshot(previousSnapshot.actionLabel);
|
|
831
831
|
historyFutureRef.current.push(currentSnapshot);
|
|
832
832
|
isApplyingHistoryRef.current = true;
|
|
833
|
-
const nextSnapshot =
|
|
834
|
-
lastHistorySnapshotRef.current =
|
|
833
|
+
const nextSnapshot = chunkRHNJ4IU2_js.cloneHistorySnapshot(previousSnapshot);
|
|
834
|
+
lastHistorySnapshotRef.current = chunkRHNJ4IU2_js.cloneHistorySnapshot(nextSnapshot);
|
|
835
835
|
lastHistorySerializedRef.current = serializeHistoryDocument(nextSnapshot);
|
|
836
836
|
applyHistorySnapshot(nextSnapshot);
|
|
837
837
|
updateHistoryAvailability();
|
|
@@ -852,8 +852,8 @@ function useEditorHistory(input) {
|
|
|
852
852
|
const currentSnapshot = buildHistorySnapshot(nextSnapshot.actionLabel);
|
|
853
853
|
historyPastRef.current.push(currentSnapshot);
|
|
854
854
|
isApplyingHistoryRef.current = true;
|
|
855
|
-
const targetSnapshot =
|
|
856
|
-
lastHistorySnapshotRef.current =
|
|
855
|
+
const targetSnapshot = chunkRHNJ4IU2_js.cloneHistorySnapshot(nextSnapshot);
|
|
856
|
+
lastHistorySnapshotRef.current = chunkRHNJ4IU2_js.cloneHistorySnapshot(targetSnapshot);
|
|
857
857
|
lastHistorySerializedRef.current = serializeHistoryDocument(targetSnapshot);
|
|
858
858
|
applyHistorySnapshot(targetSnapshot);
|
|
859
859
|
updateHistoryAvailability();
|
|
@@ -871,7 +871,7 @@ function useEditorHistory(input) {
|
|
|
871
871
|
historyPastRef.current = [];
|
|
872
872
|
historyFutureRef.current = [];
|
|
873
873
|
if (initialSnapshot) {
|
|
874
|
-
const clonedInitial =
|
|
874
|
+
const clonedInitial = chunkRHNJ4IU2_js.cloneHistorySnapshot(initialSnapshot);
|
|
875
875
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
876
876
|
lastHistorySerializedRef.current = serializeHistoryDocument(clonedInitial);
|
|
877
877
|
} else {
|
|
@@ -953,8 +953,8 @@ function useEditorHistory(input) {
|
|
|
953
953
|
updateHistoryAvailability
|
|
954
954
|
]);
|
|
955
955
|
const commitSlides = (nextSlides, label, beforeSlides = slides) => {
|
|
956
|
-
const before = { ...buildHistorySnapshot(), slides: beforeSlides.map(
|
|
957
|
-
const after = { ...before, slides: nextSlides.map(
|
|
956
|
+
const before = { ...buildHistorySnapshot(), slides: beforeSlides.map(chunkRHNJ4IU2_js.cloneSlide) };
|
|
957
|
+
const after = { ...before, slides: nextSlides.map(chunkRHNJ4IU2_js.cloneSlide) };
|
|
958
958
|
recordExplicitSlideUpdate(
|
|
959
959
|
historyPastRef.current,
|
|
960
960
|
historyFutureRef.current,
|
|
@@ -963,7 +963,7 @@ function useEditorHistory(input) {
|
|
|
963
963
|
label,
|
|
964
964
|
maxHistoryEntries
|
|
965
965
|
);
|
|
966
|
-
lastHistorySnapshotRef.current =
|
|
966
|
+
lastHistorySnapshotRef.current = chunkRHNJ4IU2_js.cloneHistorySnapshot(after);
|
|
967
967
|
lastHistorySerializedRef.current = serializeHistoryDocument(after);
|
|
968
968
|
isApplyingHistoryRef.current = false;
|
|
969
969
|
setSlides(nextSlides);
|
|
@@ -1143,22 +1143,22 @@ function useZoomViewport({
|
|
|
1143
1143
|
selectedElements.forEach((element) => {
|
|
1144
1144
|
minX = Math.min(minX, element.x);
|
|
1145
1145
|
minY = Math.min(minY, element.y);
|
|
1146
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
1147
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
1146
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkRHNJ4IU2_js.MIN_ELEMENT_SIZE));
|
|
1147
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkRHNJ4IU2_js.MIN_ELEMENT_SIZE));
|
|
1148
1148
|
});
|
|
1149
1149
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
1150
1150
|
return;
|
|
1151
1151
|
}
|
|
1152
1152
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
1153
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
1154
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
1153
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkRHNJ4IU2_js.MIN_ELEMENT_SIZE);
|
|
1154
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkRHNJ4IU2_js.MIN_ELEMENT_SIZE);
|
|
1155
1155
|
const availableWidth = Math.max(
|
|
1156
|
-
effectiveEditorDimensions.width -
|
|
1157
|
-
|
|
1156
|
+
effectiveEditorDimensions.width - chunkRHNJ4IU2_js.ZOOM_TO_SELECTION_PADDING,
|
|
1157
|
+
chunkRHNJ4IU2_js.MIN_ELEMENT_SIZE
|
|
1158
1158
|
);
|
|
1159
1159
|
const availableHeight = Math.max(
|
|
1160
|
-
effectiveEditorDimensions.height -
|
|
1161
|
-
|
|
1160
|
+
effectiveEditorDimensions.height - chunkRHNJ4IU2_js.ZOOM_TO_SELECTION_PADDING,
|
|
1161
|
+
chunkRHNJ4IU2_js.MIN_ELEMENT_SIZE
|
|
1162
1162
|
);
|
|
1163
1163
|
const targetEditorScale = Math.min(
|
|
1164
1164
|
availableWidth / boundsWidth,
|
|
@@ -4097,8 +4097,8 @@ function useViewerCoreState(_input) {
|
|
|
4097
4097
|
const { slides, setSlides, slidesRef } = useSlideState();
|
|
4098
4098
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = React17.useState({});
|
|
4099
4099
|
const [canvasSize, setCanvasSize] = React17.useState({
|
|
4100
|
-
width:
|
|
4101
|
-
height:
|
|
4100
|
+
width: chunkRHNJ4IU2_js.DEFAULT_CANVAS_WIDTH,
|
|
4101
|
+
height: chunkRHNJ4IU2_js.DEFAULT_CANVAS_HEIGHT
|
|
4102
4102
|
});
|
|
4103
4103
|
const [slideSizeEmu, setSlideSizeEmu] = React17.useState();
|
|
4104
4104
|
const [activeSlideIndex, setActiveSlideIndex] = React17.useState(0);
|
|
@@ -4460,9 +4460,12 @@ function useLoadContent({
|
|
|
4460
4460
|
setIsDirty,
|
|
4461
4461
|
setIsEncrypted,
|
|
4462
4462
|
onContentApplied,
|
|
4463
|
-
allowExternalImages
|
|
4463
|
+
allowExternalImages,
|
|
4464
|
+
initialSlide
|
|
4464
4465
|
}) {
|
|
4465
4466
|
const handlerRef = React17.useRef(null);
|
|
4467
|
+
const initialSlideRef = React17.useRef(initialSlide);
|
|
4468
|
+
initialSlideRef.current = initialSlide;
|
|
4466
4469
|
const originalBufferRef = React17.useRef(null);
|
|
4467
4470
|
const renderTokenRef = React17.useRef(0);
|
|
4468
4471
|
React17.useEffect(() => {
|
|
@@ -4471,7 +4474,7 @@ function useLoadContent({
|
|
|
4471
4474
|
}
|
|
4472
4475
|
let cancelled = false;
|
|
4473
4476
|
const token = ++renderTokenRef.current;
|
|
4474
|
-
const handler = new
|
|
4477
|
+
const handler = new chunkRHNJ4IU2_js.dist_exports.PptxHandler();
|
|
4475
4478
|
const resources = pptx.createPresentationLoadResources(handler);
|
|
4476
4479
|
const loadBlobUrls = resources.blobUrls;
|
|
4477
4480
|
(async () => {
|
|
@@ -4556,12 +4559,12 @@ function useLoadContent({
|
|
|
4556
4559
|
}
|
|
4557
4560
|
resources.commit();
|
|
4558
4561
|
handlerRef.current = handler;
|
|
4559
|
-
const partition =
|
|
4562
|
+
const partition = chunkRHNJ4IU2_js.partitionTemplateElements(nextSlides);
|
|
4560
4563
|
setSlides(partition.slides);
|
|
4561
4564
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4562
4565
|
setCanvasSize({
|
|
4563
|
-
width: parsed.width ??
|
|
4564
|
-
height: parsed.height ??
|
|
4566
|
+
width: parsed.width ?? chunkRHNJ4IU2_js.DEFAULT_CANVAS_WIDTH,
|
|
4567
|
+
height: parsed.height ?? chunkRHNJ4IU2_js.DEFAULT_CANVAS_HEIGHT
|
|
4565
4568
|
});
|
|
4566
4569
|
setSlideSizeEmu(
|
|
4567
4570
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4615,14 +4618,16 @@ function useLoadContent({
|
|
|
4615
4618
|
...parsed.slides.flatMap((slide) => slide.warnings ?? [])
|
|
4616
4619
|
])
|
|
4617
4620
|
);
|
|
4618
|
-
setActiveSlideIndex(
|
|
4621
|
+
setActiveSlideIndex(
|
|
4622
|
+
pptx.resolveInitialSlideIndex(initialSlideRef.current, parsed.slides.length)
|
|
4623
|
+
);
|
|
4619
4624
|
clearSelection();
|
|
4620
4625
|
setIsDirty(false);
|
|
4621
4626
|
history.resetHistory();
|
|
4622
4627
|
onContentApplied?.();
|
|
4623
4628
|
} catch (err) {
|
|
4624
4629
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4625
|
-
if (err instanceof
|
|
4630
|
+
if (err instanceof chunkRHNJ4IU2_js.dist_exports.EncryptedFileError) {
|
|
4626
4631
|
setIsEncrypted(true);
|
|
4627
4632
|
} else {
|
|
4628
4633
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4747,7 +4752,7 @@ function useTextElementOperations(input) {
|
|
|
4747
4752
|
updateSelectedElement
|
|
4748
4753
|
} = input;
|
|
4749
4754
|
const liveTextSegments = React17.useCallback(() => {
|
|
4750
|
-
if (!selectedElement || !
|
|
4755
|
+
if (!selectedElement || !(0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(selectedElement)) {
|
|
4751
4756
|
return void 0;
|
|
4752
4757
|
}
|
|
4753
4758
|
if (selectedElement.id !== inlineEditingElementId) {
|
|
@@ -4765,7 +4770,7 @@ function useTextElementOperations(input) {
|
|
|
4765
4770
|
}, [selectedElement, inlineEditingElementId, inlineEditingText, inlineEditingSnapshotRef]);
|
|
4766
4771
|
const updateSelectedTextStyle = React17.useCallback(
|
|
4767
4772
|
(updates) => {
|
|
4768
|
-
if (!selectedElement || !
|
|
4773
|
+
if (!selectedElement || !(0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(selectedElement)) {
|
|
4769
4774
|
return;
|
|
4770
4775
|
}
|
|
4771
4776
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
@@ -4843,7 +4848,7 @@ function useTextElementOperations(input) {
|
|
|
4843
4848
|
);
|
|
4844
4849
|
const toggleSelectedBullets = React17.useCallback(
|
|
4845
4850
|
(kind) => {
|
|
4846
|
-
if (!selectedElement || !
|
|
4851
|
+
if (!selectedElement || !(0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(selectedElement)) {
|
|
4847
4852
|
return;
|
|
4848
4853
|
}
|
|
4849
4854
|
const currentSegments = liveTextSegments();
|
|
@@ -4894,7 +4899,7 @@ function useTextElementOperations(input) {
|
|
|
4894
4899
|
);
|
|
4895
4900
|
const updateSelectedTextCase = React17.useCallback(
|
|
4896
4901
|
(mode) => {
|
|
4897
|
-
if (!selectedElement || !
|
|
4902
|
+
if (!selectedElement || !(0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(selectedElement)) {
|
|
4898
4903
|
return;
|
|
4899
4904
|
}
|
|
4900
4905
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
@@ -5010,7 +5015,7 @@ function useElementOperations(input) {
|
|
|
5010
5015
|
);
|
|
5011
5016
|
return;
|
|
5012
5017
|
}
|
|
5013
|
-
if (
|
|
5018
|
+
if (chunkRHNJ4IU2_js.isTemplateElementId(elementId)) {
|
|
5014
5019
|
const slideId = activeSlide?.id;
|
|
5015
5020
|
if (slideId) {
|
|
5016
5021
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -5046,7 +5051,7 @@ function useElementOperations(input) {
|
|
|
5046
5051
|
);
|
|
5047
5052
|
const updateSelectedShapeStyle = React17.useCallback(
|
|
5048
5053
|
(updates) => {
|
|
5049
|
-
if (!selectedElement || !
|
|
5054
|
+
if (!selectedElement || !(0, chunkRHNJ4IU2_js.dist_exports.hasShapeProperties)(selectedElement)) {
|
|
5050
5055
|
return;
|
|
5051
5056
|
}
|
|
5052
5057
|
updateSelectedElement({
|
|
@@ -5250,15 +5255,15 @@ function syncSelectionHandleOverlay(elementNode, elementId, geometry) {
|
|
|
5250
5255
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
5251
5256
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
|
|
5252
5257
|
const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
|
|
5253
|
-
let resized = pptx.applyResize(startBox, handle, dx, dy, 1, { minSize:
|
|
5258
|
+
let resized = pptx.applyResize(startBox, handle, dx, dy, 1, { minSize: chunkRHNJ4IU2_js.MIN_ELEMENT_SIZE });
|
|
5254
5259
|
if (lockAspect) {
|
|
5255
|
-
resized = pptx.lockResizeAspect(resized, startBox, handle,
|
|
5260
|
+
resized = pptx.lockResizeAspect(resized, startBox, handle, chunkRHNJ4IU2_js.MIN_ELEMENT_SIZE);
|
|
5256
5261
|
}
|
|
5257
5262
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
5258
5263
|
if (!snapToGrid) {
|
|
5259
5264
|
return box;
|
|
5260
5265
|
}
|
|
5261
|
-
return pptx.snapBoxToGrid(box, handle, gridSpacingPx,
|
|
5266
|
+
return pptx.snapBoxToGrid(box, handle, gridSpacingPx, chunkRHNJ4IU2_js.MIN_ELEMENT_SIZE);
|
|
5262
5267
|
}
|
|
5263
5268
|
function resolveLiveTarget(input) {
|
|
5264
5269
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -5371,7 +5376,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
5371
5376
|
width: el.width,
|
|
5372
5377
|
height: el.height
|
|
5373
5378
|
}));
|
|
5374
|
-
const snapResult =
|
|
5379
|
+
const snapResult = chunkRHNJ4IU2_js.computeSnapToShape(
|
|
5375
5380
|
targetX,
|
|
5376
5381
|
targetY,
|
|
5377
5382
|
primaryEl.width,
|
|
@@ -5445,8 +5450,8 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
5445
5450
|
rs.lastY = geo.y;
|
|
5446
5451
|
rs.lastWidth = geo.width;
|
|
5447
5452
|
rs.lastHeight = geo.height;
|
|
5448
|
-
const width = Math.max(geo.width,
|
|
5449
|
-
const height = Math.max(geo.height,
|
|
5453
|
+
const width = Math.max(geo.width, chunkRHNJ4IU2_js.MIN_ELEMENT_SIZE);
|
|
5454
|
+
const height = Math.max(geo.height, chunkRHNJ4IU2_js.MIN_ELEMENT_SIZE);
|
|
5450
5455
|
if (rs.domEl) {
|
|
5451
5456
|
rs.domEl.style.left = `${geo.x}px`;
|
|
5452
5457
|
rs.domEl.style.top = `${geo.y}px`;
|
|
@@ -5539,13 +5544,13 @@ function processPointerUp(input) {
|
|
|
5539
5544
|
if (i !== activeSlideIndex) {
|
|
5540
5545
|
return s;
|
|
5541
5546
|
}
|
|
5542
|
-
const rerouted =
|
|
5547
|
+
const rerouted = chunkRHNJ4IU2_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
5543
5548
|
if (rerouted.length === 0) {
|
|
5544
5549
|
return s;
|
|
5545
5550
|
}
|
|
5546
5551
|
return {
|
|
5547
5552
|
...s,
|
|
5548
|
-
elements:
|
|
5553
|
+
elements: chunkRHNJ4IU2_js.applyReroutedConnectors(s.elements, rerouted)
|
|
5549
5554
|
};
|
|
5550
5555
|
})
|
|
5551
5556
|
);
|
|
@@ -5597,8 +5602,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
5597
5602
|
}
|
|
5598
5603
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
5599
5604
|
});
|
|
5600
|
-
const rerouted =
|
|
5601
|
-
return
|
|
5605
|
+
const rerouted = chunkRHNJ4IU2_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
5606
|
+
return chunkRHNJ4IU2_js.applyReroutedConnectors(movedElements, rerouted);
|
|
5602
5607
|
};
|
|
5603
5608
|
if (editTemplateMode) {
|
|
5604
5609
|
const slideId = activeSlide?.id;
|
|
@@ -5786,7 +5791,7 @@ function useCanvasInteractions(input) {
|
|
|
5786
5791
|
return;
|
|
5787
5792
|
}
|
|
5788
5793
|
const el = elementLookup.get(editId);
|
|
5789
|
-
if (el &&
|
|
5794
|
+
if (el && (0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(el)) {
|
|
5790
5795
|
const reader = inlineEditingReaderRef?.current;
|
|
5791
5796
|
const read = reader?.elementId === editId ? reader.read() : void 0;
|
|
5792
5797
|
if (read?.kind === "unsupported") {
|
|
@@ -5833,7 +5838,7 @@ function useCanvasInteractions(input) {
|
|
|
5833
5838
|
wasEditable.current = canEdit;
|
|
5834
5839
|
}, [canEdit]);
|
|
5835
5840
|
const openEquationEditorForElement = (el) => {
|
|
5836
|
-
if (!
|
|
5841
|
+
if (!(0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(el)) {
|
|
5837
5842
|
return false;
|
|
5838
5843
|
}
|
|
5839
5844
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5866,7 +5871,7 @@ function useCanvasInteractions(input) {
|
|
|
5866
5871
|
justInteractedRef.current = false;
|
|
5867
5872
|
} else {
|
|
5868
5873
|
const el = elementLookup.get(elementId);
|
|
5869
|
-
if (el &&
|
|
5874
|
+
if (el && (0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(el) && pptx.canInteractWithElement(el, "textEdit")) {
|
|
5870
5875
|
if (!openEquationEditorForElement(el)) {
|
|
5871
5876
|
pptx.setPendingCaretPoint(e);
|
|
5872
5877
|
setInlineEditingElementId(elementId);
|
|
@@ -5892,7 +5897,7 @@ function useCanvasInteractions(input) {
|
|
|
5892
5897
|
if (openEquationEditorForElement(el)) {
|
|
5893
5898
|
return;
|
|
5894
5899
|
}
|
|
5895
|
-
if (
|
|
5900
|
+
if ((0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(el) && pptx.canInteractWithElement(el, "textEdit")) {
|
|
5896
5901
|
setInlineEditingElementId(elementId);
|
|
5897
5902
|
setInlineEditingText(el.text ?? "");
|
|
5898
5903
|
}
|
|
@@ -6357,7 +6362,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
6357
6362
|
return;
|
|
6358
6363
|
}
|
|
6359
6364
|
const resolved = resolveHyperlinkEditResult(data);
|
|
6360
|
-
if (resolved.url && !
|
|
6365
|
+
if (resolved.url && !chunkRHNJ4IU2_js.isUrlSafe(resolved.url)) {
|
|
6361
6366
|
return;
|
|
6362
6367
|
}
|
|
6363
6368
|
const actionClick = {
|
|
@@ -6403,11 +6408,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
6403
6408
|
if (!activeSlide) {
|
|
6404
6409
|
return;
|
|
6405
6410
|
}
|
|
6406
|
-
const preset =
|
|
6411
|
+
const preset = chunkRHNJ4IU2_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
6407
6412
|
if (!preset) {
|
|
6408
6413
|
return;
|
|
6409
6414
|
}
|
|
6410
|
-
const defaultPptxAction =
|
|
6415
|
+
const defaultPptxAction = (0, chunkRHNJ4IU2_js.dist_exports.elementActionToPptxAction)({
|
|
6411
6416
|
trigger: "click",
|
|
6412
6417
|
type: preset.defaultAction
|
|
6413
6418
|
});
|
|
@@ -6490,7 +6495,7 @@ function useInsertElements(input) {
|
|
|
6490
6495
|
width: 300,
|
|
6491
6496
|
height: 60,
|
|
6492
6497
|
text: "",
|
|
6493
|
-
textStyle: { fontSize:
|
|
6498
|
+
textStyle: { fontSize: chunkRHNJ4IU2_js.DEFAULT_TEXT_FONT_SIZE }
|
|
6494
6499
|
});
|
|
6495
6500
|
};
|
|
6496
6501
|
const handleAddShape = () => {
|
|
@@ -6517,7 +6522,7 @@ function useInsertElements(input) {
|
|
|
6517
6522
|
return;
|
|
6518
6523
|
}
|
|
6519
6524
|
addElement({
|
|
6520
|
-
...pptx.newTableElement(
|
|
6525
|
+
...pptx.newTableElement(chunkRHNJ4IU2_js.DEFAULT_TABLE_ROWS, chunkRHNJ4IU2_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
6521
6526
|
id: pptx.generateElementId()
|
|
6522
6527
|
});
|
|
6523
6528
|
};
|
|
@@ -6686,7 +6691,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6686
6691
|
history
|
|
6687
6692
|
} = input;
|
|
6688
6693
|
const updateElementsOwning = (elementId, updater) => {
|
|
6689
|
-
if (editTemplateMode && !
|
|
6694
|
+
if (editTemplateMode && !chunkRHNJ4IU2_js.isTemplateElementId(elementId)) {
|
|
6690
6695
|
ops.updateSlides(
|
|
6691
6696
|
(prev) => prev.map(
|
|
6692
6697
|
(slide, index) => index === activeSlideIndex ? { ...slide, elements: updater(slide.elements) } : slide
|
|
@@ -6720,9 +6725,9 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6720
6725
|
return;
|
|
6721
6726
|
}
|
|
6722
6727
|
const group = selectedElement;
|
|
6723
|
-
const intoTemplate =
|
|
6728
|
+
const intoTemplate = chunkRHNJ4IU2_js.isTemplateElementId(group.id);
|
|
6724
6729
|
const childIds = group.children.map(
|
|
6725
|
-
(child) => intoTemplate ?
|
|
6730
|
+
(child) => intoTemplate ? chunkRHNJ4IU2_js.makeCloneId(true, child.id || group.id) : child.id || pptx.generateElementId()
|
|
6726
6731
|
);
|
|
6727
6732
|
const { elements, childIds: usedIds } = pptx.ungroupElements(
|
|
6728
6733
|
ops.activeElements,
|
|
@@ -7045,14 +7050,7 @@ function useSlideManagement(input) {
|
|
|
7045
7050
|
if (!src) {
|
|
7046
7051
|
continue;
|
|
7047
7052
|
}
|
|
7048
|
-
const clone = {
|
|
7049
|
-
...src,
|
|
7050
|
-
id: pptx.makeSlideId(),
|
|
7051
|
-
elements: src.elements.map((el) => ({
|
|
7052
|
-
...el,
|
|
7053
|
-
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
7054
|
-
}))
|
|
7055
|
-
};
|
|
7053
|
+
const clone = { ...(0, chunkRHNJ4IU2_js.dist_exports.duplicateSlide)(src, next.length + 1), id: pptx.makeSlideId() };
|
|
7056
7054
|
next.splice(i + offset + 1, 0, clone);
|
|
7057
7055
|
offset++;
|
|
7058
7056
|
}
|
|
@@ -7155,7 +7153,7 @@ function createTableMergeHandlers(input) {
|
|
|
7155
7153
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
7156
7154
|
return;
|
|
7157
7155
|
}
|
|
7158
|
-
const newTableData =
|
|
7156
|
+
const newTableData = chunkRHNJ4IU2_js.mergeCells(
|
|
7159
7157
|
[
|
|
7160
7158
|
{ row: rowIndex, col: columnIndex },
|
|
7161
7159
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -7163,7 +7161,7 @@ function createTableMergeHandlers(input) {
|
|
|
7163
7161
|
td
|
|
7164
7162
|
);
|
|
7165
7163
|
const updates = { tableData: newTableData };
|
|
7166
|
-
const newRawXml =
|
|
7164
|
+
const newRawXml = (0, chunkRHNJ4IU2_js.dist_exports.updateMergeAttrsInRawXml)(selectedElement, newTableData);
|
|
7167
7165
|
if (newRawXml) {
|
|
7168
7166
|
updates.rawXml = newRawXml;
|
|
7169
7167
|
}
|
|
@@ -7189,7 +7187,7 @@ function createTableMergeHandlers(input) {
|
|
|
7189
7187
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
7190
7188
|
return;
|
|
7191
7189
|
}
|
|
7192
|
-
const newTableData =
|
|
7190
|
+
const newTableData = chunkRHNJ4IU2_js.mergeCells(
|
|
7193
7191
|
[
|
|
7194
7192
|
{ row: rowIndex, col: columnIndex },
|
|
7195
7193
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -7197,7 +7195,7 @@ function createTableMergeHandlers(input) {
|
|
|
7197
7195
|
td
|
|
7198
7196
|
);
|
|
7199
7197
|
const updates = { tableData: newTableData };
|
|
7200
|
-
const newRawXml =
|
|
7198
|
+
const newRawXml = (0, chunkRHNJ4IU2_js.dist_exports.updateMergeAttrsInRawXml)(selectedElement, newTableData);
|
|
7201
7199
|
if (newRawXml) {
|
|
7202
7200
|
updates.rawXml = newRawXml;
|
|
7203
7201
|
}
|
|
@@ -7212,9 +7210,9 @@ function createTableMergeHandlers(input) {
|
|
|
7212
7210
|
return;
|
|
7213
7211
|
}
|
|
7214
7212
|
const td = selectedElement.tableData;
|
|
7215
|
-
const newTableData =
|
|
7213
|
+
const newTableData = chunkRHNJ4IU2_js.mergeCells(ts.selectedCells, td);
|
|
7216
7214
|
const updates = { tableData: newTableData };
|
|
7217
|
-
const newRawXml =
|
|
7215
|
+
const newRawXml = (0, chunkRHNJ4IU2_js.dist_exports.updateMergeAttrsInRawXml)(selectedElement, newTableData);
|
|
7218
7216
|
if (newRawXml) {
|
|
7219
7217
|
updates.rawXml = newRawXml;
|
|
7220
7218
|
}
|
|
@@ -7231,9 +7229,9 @@ function createTableMergeHandlers(input) {
|
|
|
7231
7229
|
}
|
|
7232
7230
|
const { rowIndex, columnIndex } = ts;
|
|
7233
7231
|
const td = selectedElement.tableData;
|
|
7234
|
-
const newTableData =
|
|
7232
|
+
const newTableData = chunkRHNJ4IU2_js.splitCell(rowIndex, columnIndex, td);
|
|
7235
7233
|
const updates = { tableData: newTableData };
|
|
7236
|
-
const newRawXml =
|
|
7234
|
+
const newRawXml = (0, chunkRHNJ4IU2_js.dist_exports.updateMergeAttrsInRawXml)(selectedElement, newTableData);
|
|
7237
7235
|
if (newRawXml) {
|
|
7238
7236
|
updates.rawXml = newRawXml;
|
|
7239
7237
|
}
|
|
@@ -7268,7 +7266,7 @@ function createTableStructHandlers(input) {
|
|
|
7268
7266
|
updates.tableData = pptx.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
7269
7267
|
}
|
|
7270
7268
|
if (el.rawXml) {
|
|
7271
|
-
const newRawXml =
|
|
7269
|
+
const newRawXml = (0, chunkRHNJ4IU2_js.dist_exports.updateCellTextInRawXml)(el, rowIndex, colIndex, text);
|
|
7272
7270
|
if (newRawXml) {
|
|
7273
7271
|
updates.rawXml = newRawXml;
|
|
7274
7272
|
}
|
|
@@ -7292,7 +7290,7 @@ function createTableStructHandlers(input) {
|
|
|
7292
7290
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
7293
7291
|
const updates = {};
|
|
7294
7292
|
if (selectedElement.rawXml) {
|
|
7295
|
-
const newRawXml =
|
|
7293
|
+
const newRawXml = (0, chunkRHNJ4IU2_js.dist_exports.updateCellTextStyleInRawXml)(
|
|
7296
7294
|
selectedElement,
|
|
7297
7295
|
rowIndex,
|
|
7298
7296
|
colIndex,
|
|
@@ -7309,15 +7307,9 @@ function createTableStructHandlers(input) {
|
|
|
7309
7307
|
}
|
|
7310
7308
|
return {
|
|
7311
7309
|
...row,
|
|
7312
|
-
cells: row.cells.map(
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
}
|
|
7316
|
-
return {
|
|
7317
|
-
...cell,
|
|
7318
|
-
style: { ...cell.style, ...styleUpdates }
|
|
7319
|
-
};
|
|
7320
|
-
})
|
|
7310
|
+
cells: row.cells.map(
|
|
7311
|
+
(cell, ci) => ci === colIndex ? pptx.withCellStyle(cell, styleUpdates) : cell
|
|
7312
|
+
)
|
|
7321
7313
|
};
|
|
7322
7314
|
});
|
|
7323
7315
|
updates.tableData = { ...selectedElement.tableData, rows: newRows };
|
|
@@ -7465,7 +7457,7 @@ function useExportSaveAs(input) {
|
|
|
7465
7457
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7466
7458
|
const slideSize = pptx.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7467
7459
|
const data = {
|
|
7468
|
-
slides:
|
|
7460
|
+
slides: chunkRHNJ4IU2_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7469
7461
|
width: canvasSize.width,
|
|
7470
7462
|
height: canvasSize.height,
|
|
7471
7463
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7623,7 +7615,7 @@ async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActi
|
|
|
7623
7615
|
}
|
|
7624
7616
|
function tilesToPdfPage(tilesResult) {
|
|
7625
7617
|
return tilesResult.tiles.map((tile) => ({
|
|
7626
|
-
image:
|
|
7618
|
+
image: chunkRHNJ4IU2_js.canvasToJpegData(tile.canvas),
|
|
7627
7619
|
placement: pptx.placeTileOnPage(
|
|
7628
7620
|
tile,
|
|
7629
7621
|
tilesResult.fullWidth,
|
|
@@ -7656,7 +7648,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7656
7648
|
if (pages.length === 0) {
|
|
7657
7649
|
throw new Error(i18n.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7658
7650
|
}
|
|
7659
|
-
const pdfBlobUrl =
|
|
7651
|
+
const pdfBlobUrl = chunkRHNJ4IU2_js.buildPdfFromTiledImageData(pages);
|
|
7660
7652
|
pptx.downloadDataUrl(pdfBlobUrl, filename);
|
|
7661
7653
|
}
|
|
7662
7654
|
async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, slideNotes, filename = "presentation-notes.pdf", options = {}) {
|
|
@@ -7686,7 +7678,7 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7686
7678
|
if (pages.length === 0) {
|
|
7687
7679
|
throw new Error(i18n.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7688
7680
|
}
|
|
7689
|
-
const pdfDataUrl =
|
|
7681
|
+
const pdfDataUrl = chunkRHNJ4IU2_js.buildNotesPdf(pages);
|
|
7690
7682
|
pptx.downloadDataUrl(pdfDataUrl, filename);
|
|
7691
7683
|
}
|
|
7692
7684
|
async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
@@ -7881,7 +7873,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7881
7873
|
continue;
|
|
7882
7874
|
}
|
|
7883
7875
|
onProgress?.(processedCount, data.slides.length);
|
|
7884
|
-
let svg =
|
|
7876
|
+
let svg = chunkRHNJ4IU2_js.dist_exports.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7885
7877
|
if (embedFonts && fontFaces?.length) {
|
|
7886
7878
|
svg = injectFontFaces(svg, fontFaces);
|
|
7887
7879
|
}
|
|
@@ -8470,10 +8462,10 @@ async function applyThemeEditorEdit(input, { colorScheme, fontScheme, name }) {
|
|
|
8470
8462
|
return;
|
|
8471
8463
|
}
|
|
8472
8464
|
await handler.applyTheme(colorScheme, fontScheme, name);
|
|
8473
|
-
const previousMap = theme?.colorScheme ?
|
|
8465
|
+
const previousMap = theme?.colorScheme ? (0, chunkRHNJ4IU2_js.dist_exports.buildThemeColorMap)(theme.colorScheme) : {};
|
|
8474
8466
|
bumpHistory();
|
|
8475
8467
|
setSlides(
|
|
8476
|
-
(slides) =>
|
|
8468
|
+
(slides) => (0, chunkRHNJ4IU2_js.dist_exports.applyThemeToData)(
|
|
8477
8469
|
{ slides, theme, themeColorMap: previousMap },
|
|
8478
8470
|
colorScheme,
|
|
8479
8471
|
fontScheme,
|
|
@@ -8484,8 +8476,8 @@ async function applyThemeEditorEdit(input, { colorScheme, fontScheme, name }) {
|
|
|
8484
8476
|
(prev) => Object.fromEntries(
|
|
8485
8477
|
Object.entries(prev).map(([id, elements]) => [
|
|
8486
8478
|
id,
|
|
8487
|
-
|
|
8488
|
-
|
|
8479
|
+
(0, chunkRHNJ4IU2_js.dist_exports.reResolveElementFonts)(
|
|
8480
|
+
(0, chunkRHNJ4IU2_js.dist_exports.reResolveElementColors)(elements, previousMap, colorScheme),
|
|
8489
8481
|
theme?.fontScheme,
|
|
8490
8482
|
fontScheme
|
|
8491
8483
|
)
|
|
@@ -8543,13 +8535,13 @@ function useThemeHandlers(input) {
|
|
|
8543
8535
|
return;
|
|
8544
8536
|
}
|
|
8545
8537
|
await handler.updateThemeColorScheme(colorScheme);
|
|
8546
|
-
const previousMap = theme?.colorScheme ?
|
|
8547
|
-
setSlides((prev) =>
|
|
8538
|
+
const previousMap = theme?.colorScheme ? (0, chunkRHNJ4IU2_js.dist_exports.buildThemeColorMap)(theme.colorScheme) : {};
|
|
8539
|
+
setSlides((prev) => (0, chunkRHNJ4IU2_js.dist_exports.reResolveSlideColors)(prev, previousMap, colorScheme));
|
|
8548
8540
|
if (Object.keys(templateElementsBySlideId).length > 0) {
|
|
8549
8541
|
setTemplateElementsBySlideId((prev) => {
|
|
8550
8542
|
const next = {};
|
|
8551
8543
|
for (const [slideId, elements] of Object.entries(prev)) {
|
|
8552
|
-
next[slideId] =
|
|
8544
|
+
next[slideId] = (0, chunkRHNJ4IU2_js.dist_exports.reResolveElementColors)(elements, previousMap, colorScheme);
|
|
8553
8545
|
}
|
|
8554
8546
|
return next;
|
|
8555
8547
|
});
|
|
@@ -8660,7 +8652,7 @@ function useThemeSwitching(input) {
|
|
|
8660
8652
|
}
|
|
8661
8653
|
try {
|
|
8662
8654
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
8663
|
-
const newData =
|
|
8655
|
+
const newData = (0, chunkRHNJ4IU2_js.dist_exports.applyThemeToData)(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
8664
8656
|
onDataChange(newData);
|
|
8665
8657
|
onThemeChanged?.(preset);
|
|
8666
8658
|
} catch (error) {
|
|
@@ -8677,7 +8669,7 @@ function useThemeSwitching(input) {
|
|
|
8677
8669
|
}
|
|
8678
8670
|
try {
|
|
8679
8671
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
8680
|
-
const newData =
|
|
8672
|
+
const newData = (0, chunkRHNJ4IU2_js.dist_exports.applyThemeToData)(data, colorScheme, fontScheme, themeName);
|
|
8681
8673
|
onDataChange(newData);
|
|
8682
8674
|
} catch (error) {
|
|
8683
8675
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -8689,12 +8681,12 @@ function useThemeSwitching(input) {
|
|
|
8689
8681
|
if (!data?.theme?.colorScheme) {
|
|
8690
8682
|
return void 0;
|
|
8691
8683
|
}
|
|
8692
|
-
return
|
|
8693
|
-
(p) =>
|
|
8684
|
+
return chunkRHNJ4IU2_js.dist_exports.THEME_PRESETS.find(
|
|
8685
|
+
(p) => (0, chunkRHNJ4IU2_js.dist_exports.themeColorSchemesEqual)(data.theme?.colorScheme, p.colorScheme)
|
|
8694
8686
|
);
|
|
8695
8687
|
}, [data?.theme?.colorScheme]);
|
|
8696
8688
|
return {
|
|
8697
|
-
presets:
|
|
8689
|
+
presets: chunkRHNJ4IU2_js.dist_exports.THEME_PRESETS,
|
|
8698
8690
|
switchToPreset,
|
|
8699
8691
|
switchToCustom,
|
|
8700
8692
|
currentPreset
|
|
@@ -8771,7 +8763,7 @@ function usePropertyHandlers(input) {
|
|
|
8771
8763
|
}
|
|
8772
8764
|
try {
|
|
8773
8765
|
const ab = await file.arrayBuffer();
|
|
8774
|
-
const h = new
|
|
8766
|
+
const h = new chunkRHNJ4IU2_js.dist_exports.PptxHandler();
|
|
8775
8767
|
const other = await h.load(ab);
|
|
8776
8768
|
if (!other) {
|
|
8777
8769
|
return;
|
|
@@ -8781,7 +8773,7 @@ function usePropertyHandlers(input) {
|
|
|
8781
8773
|
width: canvasSize.width,
|
|
8782
8774
|
height: canvasSize.height
|
|
8783
8775
|
};
|
|
8784
|
-
setCompareResult(
|
|
8776
|
+
setCompareResult(chunkRHNJ4IU2_js.comparePresentation(cur, other));
|
|
8785
8777
|
setIsComparePanelOpen(true);
|
|
8786
8778
|
} catch (err) {
|
|
8787
8779
|
console.warn("Compare failed:", err);
|
|
@@ -9134,7 +9126,7 @@ function useViewerDialogs(input) {
|
|
|
9134
9126
|
};
|
|
9135
9127
|
}
|
|
9136
9128
|
function computeGridSpacingPx(documentGridSpacing) {
|
|
9137
|
-
return pptx.computeGridSpacingPx(documentGridSpacing,
|
|
9129
|
+
return pptx.computeGridSpacingPx(documentGridSpacing, chunkRHNJ4IU2_js.GRID_SIZE);
|
|
9138
9130
|
}
|
|
9139
9131
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
9140
9132
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
@@ -9143,7 +9135,7 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, pre
|
|
|
9143
9135
|
}
|
|
9144
9136
|
function computeSlideSectionGroups(slides, sections) {
|
|
9145
9137
|
return pptx.groupSlidesBySection(sections, slides).map((group) => ({
|
|
9146
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
9138
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkRHNJ4IU2_js.UNGROUPED_SECTION_ID : chunkRHNJ4IU2_js.DEFAULT_SECTION_GROUP_ID),
|
|
9147
9139
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
9148
9140
|
slideIndexes: group.slideIndexes,
|
|
9149
9141
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -9188,10 +9180,10 @@ function useDerivedSlideState(input) {
|
|
|
9188
9180
|
);
|
|
9189
9181
|
const slideSectionGroups = React17.useMemo(
|
|
9190
9182
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
9191
|
-
if (group.id ===
|
|
9183
|
+
if (group.id === chunkRHNJ4IU2_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
9192
9184
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
9193
9185
|
}
|
|
9194
|
-
if (group.id ===
|
|
9186
|
+
if (group.id === chunkRHNJ4IU2_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
9195
9187
|
return { ...group, label: t("pptx.sections.slides") };
|
|
9196
9188
|
}
|
|
9197
9189
|
return group;
|
|
@@ -9298,7 +9290,7 @@ function useAnnotationHandlers(input) {
|
|
|
9298
9290
|
if (nextMode === "present") {
|
|
9299
9291
|
presentation.enterPresentMode();
|
|
9300
9292
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
9301
|
-
|
|
9293
|
+
chunkRHNJ4IU2_js.stopAllPersistentAudio();
|
|
9302
9294
|
if (promptKeepInkAnnotations) {
|
|
9303
9295
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
9304
9296
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -9308,7 +9300,7 @@ function useAnnotationHandlers(input) {
|
|
|
9308
9300
|
}
|
|
9309
9301
|
} else {
|
|
9310
9302
|
if (mode === "present") {
|
|
9311
|
-
|
|
9303
|
+
chunkRHNJ4IU2_js.stopAllPersistentAudio();
|
|
9312
9304
|
}
|
|
9313
9305
|
setMode(nextMode);
|
|
9314
9306
|
}
|
|
@@ -9379,7 +9371,7 @@ function overlayPendingInlineEdit(document2, elementId, text, snapshot, transfor
|
|
|
9379
9371
|
(slide) => !elementId ? slide : {
|
|
9380
9372
|
...slide,
|
|
9381
9373
|
elements: slide.elements.map(
|
|
9382
|
-
(element) => element.id === elementId &&
|
|
9374
|
+
(element) => element.id === elementId && (0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(element) ? {
|
|
9383
9375
|
...element,
|
|
9384
9376
|
text,
|
|
9385
9377
|
textSegments: pptx.remapTextToSegments(
|
|
@@ -9465,14 +9457,14 @@ function useSerialize(input) {
|
|
|
9465
9457
|
const pptxGuides = guides.map((g) => ({
|
|
9466
9458
|
id: g.id,
|
|
9467
9459
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
9468
|
-
positionEmu:
|
|
9460
|
+
positionEmu: (0, chunkRHNJ4IU2_js.dist_exports.guidePxToEmu)(g.position)
|
|
9469
9461
|
}));
|
|
9470
9462
|
return {
|
|
9471
9463
|
...slide,
|
|
9472
9464
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
9473
9465
|
};
|
|
9474
9466
|
});
|
|
9475
|
-
const slidesToSave =
|
|
9467
|
+
const slidesToSave = chunkRHNJ4IU2_js.buildSaveSlides(slidesWithGuides, pending.templateElementsBySlideId);
|
|
9476
9468
|
const saveOptions = pptx.buildDeckSaveOptions({
|
|
9477
9469
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
9478
9470
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
@@ -9653,7 +9645,7 @@ function usePresentationSetup(input) {
|
|
|
9653
9645
|
return;
|
|
9654
9646
|
}
|
|
9655
9647
|
if (mode === "present" && nextMode !== "present") {
|
|
9656
|
-
|
|
9648
|
+
chunkRHNJ4IU2_js.stopAllPersistentAudio();
|
|
9657
9649
|
stopAnimationSound();
|
|
9658
9650
|
const exitHandler = exitModeHandlerRef.current;
|
|
9659
9651
|
if (exitHandler) {
|
|
@@ -9774,12 +9766,12 @@ function useCanvasImagePaste(input) {
|
|
|
9774
9766
|
);
|
|
9775
9767
|
}
|
|
9776
9768
|
function formatPatchFor(element, format) {
|
|
9777
|
-
const updated =
|
|
9769
|
+
const updated = chunkRHNJ4IU2_js.applyFormatToElement(element, format);
|
|
9778
9770
|
const updates = {};
|
|
9779
|
-
if (
|
|
9771
|
+
if ((0, chunkRHNJ4IU2_js.dist_exports.hasShapeProperties)(updated)) {
|
|
9780
9772
|
updates.shapeStyle = updated.shapeStyle;
|
|
9781
9773
|
}
|
|
9782
|
-
if (
|
|
9774
|
+
if ((0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(updated)) {
|
|
9783
9775
|
updates.textStyle = updated.textStyle;
|
|
9784
9776
|
}
|
|
9785
9777
|
return updates;
|
|
@@ -9797,7 +9789,7 @@ function useFormatPainterEditing(input) {
|
|
|
9797
9789
|
const prevFormatPainterRef = React17.useRef(false);
|
|
9798
9790
|
React17.useEffect(() => {
|
|
9799
9791
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9800
|
-
copiedFormatRef.current =
|
|
9792
|
+
copiedFormatRef.current = chunkRHNJ4IU2_js.copyFormatFromElement(selectedElement);
|
|
9801
9793
|
} else if (!formatPainterActive) {
|
|
9802
9794
|
copiedFormatRef.current = null;
|
|
9803
9795
|
}
|
|
@@ -10488,6 +10480,7 @@ function useContentLifecycle(input) {
|
|
|
10488
10480
|
password,
|
|
10489
10481
|
onContentApplied,
|
|
10490
10482
|
allowExternalImages,
|
|
10483
|
+
initialSlide,
|
|
10491
10484
|
setReadOnlyRecommendation,
|
|
10492
10485
|
setModifyVerifier,
|
|
10493
10486
|
setCompatToasts
|
|
@@ -10537,7 +10530,8 @@ function useContentLifecycle(input) {
|
|
|
10537
10530
|
setIsDirty: state.setIsDirty,
|
|
10538
10531
|
setIsEncrypted: setIsEncryptedDialogOpen,
|
|
10539
10532
|
onContentApplied,
|
|
10540
|
-
allowExternalImages
|
|
10533
|
+
allowExternalImages,
|
|
10534
|
+
initialSlide
|
|
10541
10535
|
});
|
|
10542
10536
|
React17.useEffect(() => {
|
|
10543
10537
|
actionSoundHandlerRef.current = handlerRef.current;
|
|
@@ -10884,7 +10878,7 @@ function useKeyboardShortcutWiring(input) {
|
|
|
10884
10878
|
}
|
|
10885
10879
|
function stepSelectedFontSize(state, ops, direction) {
|
|
10886
10880
|
const selected = state.selectedElement;
|
|
10887
|
-
const currentPx = (selected &&
|
|
10881
|
+
const currentPx = (selected && (0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(selected) ? selected.textStyle?.fontSize : void 0) ?? pptx.textFontSizePtToPx(18);
|
|
10888
10882
|
const nextPt = pptx.stepFontSizePt(pptx.textFontSizePxToPt(currentPx), direction);
|
|
10889
10883
|
ops.updateSelectedTextStyle({ fontSize: pptx.textFontSizePtToPx(nextPt) });
|
|
10890
10884
|
}
|
|
@@ -10951,6 +10945,7 @@ function useViewerIntegration(input) {
|
|
|
10951
10945
|
autosaveAllowed = true,
|
|
10952
10946
|
autosaveIntervalMs,
|
|
10953
10947
|
allowExternalImages,
|
|
10948
|
+
initialSlide,
|
|
10954
10949
|
setReadOnlyRecommendation,
|
|
10955
10950
|
setModifyVerifier,
|
|
10956
10951
|
setCompatToasts,
|
|
@@ -11026,6 +11021,7 @@ function useViewerIntegration(input) {
|
|
|
11026
11021
|
password: dialogs.presentationPassword ?? void 0,
|
|
11027
11022
|
onContentApplied: () => setLoadVersion((v) => v + 1),
|
|
11028
11023
|
allowExternalImages,
|
|
11024
|
+
initialSlide,
|
|
11029
11025
|
setReadOnlyRecommendation,
|
|
11030
11026
|
setModifyVerifier,
|
|
11031
11027
|
setCompatToasts
|
|
@@ -11433,7 +11429,7 @@ function useCollaborationWriteBack(input) {
|
|
|
11433
11429
|
getSourceBytes: () => latest.current.getSourceBytes?.() ?? null,
|
|
11434
11430
|
getSaveOptions: () => latest.current.getSaveOptions?.(),
|
|
11435
11431
|
getTemplateElements: () => latest.current.templateElementsBySlideId,
|
|
11436
|
-
mergeTemplateElements:
|
|
11432
|
+
mergeTemplateElements: chunkRHNJ4IU2_js.buildSaveSlides
|
|
11437
11433
|
}),
|
|
11438
11434
|
[latest]
|
|
11439
11435
|
);
|
|
@@ -11986,8 +11982,8 @@ function useTouchGestures(input) {
|
|
|
11986
11982
|
}
|
|
11987
11983
|
const recognizer = pptx.createTouchGestureRecognizer({
|
|
11988
11984
|
getScale: () => scaleRef.current,
|
|
11989
|
-
minScale:
|
|
11990
|
-
maxScale:
|
|
11985
|
+
minScale: chunkRHNJ4IU2_js.MIN_ZOOM_SCALE,
|
|
11986
|
+
maxScale: chunkRHNJ4IU2_js.MAX_ZOOM_SCALE,
|
|
11991
11987
|
callbacks: {
|
|
11992
11988
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
11993
11989
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -12110,7 +12106,7 @@ function buildCanvasProps(input) {
|
|
|
12110
12106
|
if (pptx.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
12111
12107
|
return;
|
|
12112
12108
|
}
|
|
12113
|
-
|
|
12109
|
+
chunkRHNJ4IU2_js.safeOpenUrl(url, target);
|
|
12114
12110
|
};
|
|
12115
12111
|
const handleActionClick = (elementId, action) => {
|
|
12116
12112
|
if (mode === "present") {
|
|
@@ -12125,9 +12121,9 @@ function buildCanvasProps(input) {
|
|
|
12125
12121
|
}
|
|
12126
12122
|
};
|
|
12127
12123
|
const handleHyperlinkClick = (url, target) => {
|
|
12128
|
-
if (
|
|
12124
|
+
if (chunkRHNJ4IU2_js.isPpactionUrl(url)) {
|
|
12129
12125
|
if (mode === "present") {
|
|
12130
|
-
const parsed =
|
|
12126
|
+
const parsed = chunkRHNJ4IU2_js.parsePpactionUrl(url);
|
|
12131
12127
|
if (parsed) {
|
|
12132
12128
|
presentation.handlePresentationAction({
|
|
12133
12129
|
action: parsed.action,
|
|
@@ -12520,7 +12516,7 @@ function buildToolbarProps(input) {
|
|
|
12520
12516
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
12521
12517
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
12522
12518
|
formatPainterActive: s.formatPainterActive,
|
|
12523
|
-
canActivateFormatPainter:
|
|
12519
|
+
canActivateFormatPainter: chunkRHNJ4IU2_js.hasCopyableFormat(selectedElement),
|
|
12524
12520
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
12525
12521
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
12526
12522
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -12841,7 +12837,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
12841
12837
|
documentGridSpacing: state.viewProperties?.gridSpacing
|
|
12842
12838
|
});
|
|
12843
12839
|
const themeColorMap = React17.useMemo(
|
|
12844
|
-
() => state.theme?.colorScheme ?
|
|
12840
|
+
() => state.theme?.colorScheme ? (0, chunkRHNJ4IU2_js.dist_exports.buildThemeColorMap)(state.theme.colorScheme) : void 0,
|
|
12845
12841
|
[state.theme?.colorScheme]
|
|
12846
12842
|
);
|
|
12847
12843
|
const { presentation, annotations, actionSoundHandlerRef, setExitModeHandler } = usePresentationSetup({
|
|
@@ -13416,23 +13412,23 @@ function ColorChangedImage({
|
|
|
13416
13412
|
className,
|
|
13417
13413
|
alt
|
|
13418
13414
|
}) {
|
|
13419
|
-
const tolerance = tolerancePct ??
|
|
13420
|
-
const cacheKey =
|
|
13415
|
+
const tolerance = tolerancePct ?? chunkRHNJ4IU2_js.DEFAULT_COLOR_CHANGE_TOLERANCE;
|
|
13416
|
+
const cacheKey = chunkRHNJ4IU2_js.buildCacheKey(
|
|
13421
13417
|
src,
|
|
13422
13418
|
clrChange.clrFrom,
|
|
13423
13419
|
clrChange.clrTo,
|
|
13424
13420
|
tolerance,
|
|
13425
13421
|
Boolean(clrChange.clrToTransparent)
|
|
13426
13422
|
);
|
|
13427
|
-
const cached =
|
|
13423
|
+
const cached = chunkRHNJ4IU2_js.getCachedResult(cacheKey);
|
|
13428
13424
|
const [processedSrc, setProcessedSrc] = React17.useState(cached ?? null);
|
|
13429
13425
|
React17.useEffect(() => {
|
|
13430
|
-
if (
|
|
13431
|
-
setProcessedSrc(
|
|
13426
|
+
if (chunkRHNJ4IU2_js.getCachedResult(cacheKey)) {
|
|
13427
|
+
setProcessedSrc(chunkRHNJ4IU2_js.getCachedResult(cacheKey) ?? null);
|
|
13432
13428
|
return;
|
|
13433
13429
|
}
|
|
13434
13430
|
let cancelled = false;
|
|
13435
|
-
|
|
13431
|
+
chunkRHNJ4IU2_js.applyColorChange(
|
|
13436
13432
|
src,
|
|
13437
13433
|
clrChange.clrFrom,
|
|
13438
13434
|
clrChange.clrTo,
|
|
@@ -13440,7 +13436,7 @@ function ColorChangedImage({
|
|
|
13440
13436
|
Boolean(clrChange.clrToTransparent)
|
|
13441
13437
|
).then((result) => {
|
|
13442
13438
|
if (!cancelled) {
|
|
13443
|
-
|
|
13439
|
+
chunkRHNJ4IU2_js.setCachedResult(cacheKey, result.dataUrl);
|
|
13444
13440
|
setProcessedSrc(result.dataUrl);
|
|
13445
13441
|
}
|
|
13446
13442
|
return void 0;
|
|
@@ -13532,7 +13528,7 @@ function TiledImageLayer({
|
|
|
13532
13528
|
cancelled = true;
|
|
13533
13529
|
};
|
|
13534
13530
|
}, [src]);
|
|
13535
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, style: { ...
|
|
13531
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, style: { ...chunkRHNJ4IU2_js.getImageTilingStyle(element, nativeSize), ...style } });
|
|
13536
13532
|
}
|
|
13537
13533
|
function renderImageEffectDefinitions(element, excludeDuotone = false) {
|
|
13538
13534
|
return pptx.getImageSvgFilters(element).filter((definition) => !excludeDuotone || definition.id !== `duotone-${element.id}`).map((definition) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13601,7 +13597,7 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
13601
13597
|
...filter ? { filter } : {},
|
|
13602
13598
|
...opacity !== void 0 ? { opacity } : {}
|
|
13603
13599
|
};
|
|
13604
|
-
if (
|
|
13600
|
+
if (chunkRHNJ4IU2_js.isImageTiled(el)) {
|
|
13605
13601
|
const tileSrc = imgSrc(el);
|
|
13606
13602
|
if (!tileSrc) {
|
|
13607
13603
|
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" });
|
|
@@ -13620,12 +13616,12 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
13620
13616
|
] });
|
|
13621
13617
|
}
|
|
13622
13618
|
const colorWash = pptx.getImageColorWashStyle(
|
|
13623
|
-
|
|
13619
|
+
(0, chunkRHNJ4IU2_js.dist_exports.isImageLikeElement)(el) ? el.imageEffects?.colorWash : void 0
|
|
13624
13620
|
);
|
|
13625
13621
|
const clrChange = "imageEffects" in el ? el.imageEffects?.clrChange : void 0;
|
|
13626
|
-
const duotoneColors =
|
|
13622
|
+
const duotoneColors = chunkRHNJ4IU2_js.getDuotoneColors(el);
|
|
13627
13623
|
const useDuotoneCanvas = Boolean(duotoneColors && !clrChange);
|
|
13628
|
-
const filterForImg = useDuotoneCanvas ?
|
|
13624
|
+
const filterForImg = useDuotoneCanvas ? chunkRHNJ4IU2_js.getImageEffectsFilter(el, { excludeDuotone: true }) : filter;
|
|
13629
13625
|
const canvasEffectStyles = {
|
|
13630
13626
|
...filterForImg ? { filter: filterForImg } : {},
|
|
13631
13627
|
...opacity !== void 0 ? { opacity } : {}
|
|
@@ -13701,10 +13697,10 @@ function SlideBackgroundImageLayer({
|
|
|
13701
13697
|
style: { zIndex: 0 },
|
|
13702
13698
|
children: renderImg(
|
|
13703
13699
|
backgroundElement,
|
|
13704
|
-
|
|
13705
|
-
|
|
13700
|
+
chunkRHNJ4IU2_js.getImageRenderStyle(backgroundElement),
|
|
13701
|
+
chunkRHNJ4IU2_js.getImageEffectsFilter(backgroundElement),
|
|
13706
13702
|
"",
|
|
13707
|
-
|
|
13703
|
+
chunkRHNJ4IU2_js.getImageEffectsOpacity(backgroundElement)
|
|
13708
13704
|
)
|
|
13709
13705
|
}
|
|
13710
13706
|
);
|
|
@@ -13975,7 +13971,7 @@ function ChartElementView({
|
|
|
13975
13971
|
pptx.getBarFacePicturePixelSampleVersion
|
|
13976
13972
|
);
|
|
13977
13973
|
const viewModel = React17.useMemo(() => {
|
|
13978
|
-
return canEdit ?
|
|
13974
|
+
return canEdit ? chunkRHNJ4IU2_js.buildReactChartViewModel(element) : null;
|
|
13979
13975
|
}, [canEdit, element, barFacePictureSampleVersion]);
|
|
13980
13976
|
React17.useEffect(pptx.ensureChartInteractionStyles, []);
|
|
13981
13977
|
React17.useEffect(() => {
|
|
@@ -14060,9 +14056,9 @@ function ChartElementView({
|
|
|
14060
14056
|
textStyle: animationState?.textStyle,
|
|
14061
14057
|
onSelect: chart3D.onSelect,
|
|
14062
14058
|
onDrag: chart3D.onDrag,
|
|
14063
|
-
children:
|
|
14059
|
+
children: chunkRHNJ4IU2_js.renderChartElement(renderedElement)
|
|
14064
14060
|
}
|
|
14065
|
-
) :
|
|
14061
|
+
) : chunkRHNJ4IU2_js.renderChartElement(renderedElement),
|
|
14066
14062
|
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) }),
|
|
14067
14063
|
titleDraft !== null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14068
14064
|
"input",
|
|
@@ -14392,7 +14388,7 @@ function ResizeHandles({
|
|
|
14392
14388
|
"aria-label": t("pptx.selectionOverlay.resize", { handle }),
|
|
14393
14389
|
"data-pptx-handle-kind": "resize",
|
|
14394
14390
|
"data-pptx-compact": true,
|
|
14395
|
-
className:
|
|
14391
|
+
className: chunkRHNJ4IU2_js.cn(
|
|
14396
14392
|
"absolute z-10 group border-0 bg-transparent p-0",
|
|
14397
14393
|
RESIZE_DEFAULT_CLASSES,
|
|
14398
14394
|
posClass,
|
|
@@ -14418,7 +14414,7 @@ function ResizeHandles({
|
|
|
14418
14414
|
"div",
|
|
14419
14415
|
{
|
|
14420
14416
|
"data-pptx-handle-hit": true,
|
|
14421
|
-
className:
|
|
14417
|
+
className: chunkRHNJ4IU2_js.cn(
|
|
14422
14418
|
"absolute -inset-px pointer-events-auto [--pptx-handle-hit-inset:-1px]",
|
|
14423
14419
|
corner ? "max-md:-inset-1.5 max-md:[--pptx-handle-hit-inset:-6px]" : "max-md:-inset-2 max-md:[--pptx-handle-hit-inset:-8px]"
|
|
14424
14420
|
),
|
|
@@ -14439,7 +14435,7 @@ function ResizeHandles({
|
|
|
14439
14435
|
"aria-label": t("pptx.selectionOverlay.rotate"),
|
|
14440
14436
|
"data-pptx-handle-kind": "rotate",
|
|
14441
14437
|
"data-pptx-compact": true,
|
|
14442
|
-
className:
|
|
14438
|
+
className: chunkRHNJ4IU2_js.cn(
|
|
14443
14439
|
"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",
|
|
14444
14440
|
ROTATE_DEFAULT_CLASSES
|
|
14445
14441
|
),
|
|
@@ -14509,17 +14505,17 @@ var ConnectorElementRenderer = React17__default.default.memo(
|
|
|
14509
14505
|
animationState,
|
|
14510
14506
|
textStyleOverrideCss
|
|
14511
14507
|
}) {
|
|
14512
|
-
const shapeEl =
|
|
14508
|
+
const shapeEl = (0, chunkRHNJ4IU2_js.dist_exports.hasShapeProperties)(el) ? el : void 0;
|
|
14513
14509
|
const viewWidth = Math.max(el.width, 0);
|
|
14514
14510
|
const viewHeight = Math.max(el.height, 0);
|
|
14515
14511
|
const svgWidth = Math.max(el.width, 1);
|
|
14516
14512
|
const svgHeight = Math.max(el.height, 1);
|
|
14517
14513
|
const ss = shapeEl?.shapeStyle;
|
|
14518
14514
|
const strokeWidth = Math.max(0, ss?.strokeWidth ?? 2);
|
|
14519
|
-
const strokeColor =
|
|
14520
|
-
const strokePaint =
|
|
14521
|
-
const dashType =
|
|
14522
|
-
const dashArray =
|
|
14515
|
+
const strokeColor = chunkRHNJ4IU2_js.normalizeHexColor(ss?.strokeColor, chunkRHNJ4IU2_js.DEFAULT_STROKE_COLOR);
|
|
14516
|
+
const strokePaint = chunkRHNJ4IU2_js.colorWithOpacity(strokeColor, ss?.strokeOpacity);
|
|
14517
|
+
const dashType = chunkRHNJ4IU2_js.normalizeStrokeDashType(ss?.strokeDash);
|
|
14518
|
+
const dashArray = chunkRHNJ4IU2_js.getSvgStrokeDasharray(
|
|
14523
14519
|
dashType,
|
|
14524
14520
|
Math.max(strokeWidth, 1),
|
|
14525
14521
|
ss?.customDashSegments
|
|
@@ -14530,14 +14526,14 @@ var ConnectorElementRenderer = React17__default.default.memo(
|
|
|
14530
14526
|
const markerSeed = el.id.replace(/[^a-zA-Z0-9_-]/gu, "_");
|
|
14531
14527
|
const startMarkerId = `${markerSeed}-sel-start`;
|
|
14532
14528
|
const endMarkerId = `${markerSeed}-sel-end`;
|
|
14533
|
-
const compoundOffsets =
|
|
14534
|
-
const compoundWidths =
|
|
14529
|
+
const compoundOffsets = chunkRHNJ4IU2_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
14530
|
+
const compoundWidths = chunkRHNJ4IU2_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
14535
14531
|
const strokeCap = pptx.svgLineCap(ss?.lineCap);
|
|
14536
|
-
const textEl =
|
|
14532
|
+
const textEl = (0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(el) ? el : void 0;
|
|
14537
14533
|
const connectorText = textEl?.text?.trim() ?? "";
|
|
14538
14534
|
const connectorTextSegments = textEl?.textSegments;
|
|
14539
14535
|
const connectorTextStyle = textEl?.textStyle;
|
|
14540
|
-
const pathGeometry = shapeEl ?
|
|
14536
|
+
const pathGeometry = shapeEl ? chunkRHNJ4IU2_js.getConnectorPathGeometry(shapeEl) : {
|
|
14541
14537
|
pathData: `M 0 0 L ${viewWidth} ${viewHeight}`,
|
|
14542
14538
|
startX: 0,
|
|
14543
14539
|
startY: 0,
|
|
@@ -14546,16 +14542,16 @@ var ConnectorElementRenderer = React17__default.default.memo(
|
|
|
14546
14542
|
};
|
|
14547
14543
|
const hitTargetWidth = Math.max(strokeWidth * 3, 14);
|
|
14548
14544
|
const selColor = selClr === "blue-400" ? "#60a5fa" : "#3b82f6";
|
|
14549
|
-
const lineShadow =
|
|
14550
|
-
const lineGlow =
|
|
14545
|
+
const lineShadow = chunkRHNJ4IU2_js.buildLineShadowCss(el);
|
|
14546
|
+
const lineGlow = chunkRHNJ4IU2_js.buildLineGlowFilter(el);
|
|
14551
14547
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14552
14548
|
"div",
|
|
14553
14549
|
{
|
|
14554
14550
|
"data-pptx-element": "true",
|
|
14555
14551
|
"data-element-id": el.id,
|
|
14556
|
-
role:
|
|
14557
|
-
"aria-label":
|
|
14558
|
-
"aria-roledescription":
|
|
14552
|
+
role: chunkRHNJ4IU2_js.getAriaRole(el, { actionable: false }),
|
|
14553
|
+
"aria-label": chunkRHNJ4IU2_js.getAriaLabel(el),
|
|
14554
|
+
"aria-roledescription": chunkRHNJ4IU2_js.getAriaRoleDescription(el),
|
|
14559
14555
|
"aria-selected": isSelected ? true : void 0,
|
|
14560
14556
|
className: "absolute",
|
|
14561
14557
|
style: {
|
|
@@ -14588,14 +14584,14 @@ var ConnectorElementRenderer = React17__default.default.memo(
|
|
|
14588
14584
|
style: { overflow: "visible", pointerEvents: "none" },
|
|
14589
14585
|
children: [
|
|
14590
14586
|
/* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
|
|
14591
|
-
|
|
14587
|
+
chunkRHNJ4IU2_js.renderConnectorMarker(
|
|
14592
14588
|
startMarkerId,
|
|
14593
14589
|
startArrow,
|
|
14594
14590
|
strokePaint,
|
|
14595
14591
|
ss?.connectorStartArrowWidth,
|
|
14596
14592
|
ss?.connectorStartArrowLength
|
|
14597
14593
|
),
|
|
14598
|
-
|
|
14594
|
+
chunkRHNJ4IU2_js.renderConnectorMarker(
|
|
14599
14595
|
endMarkerId,
|
|
14600
14596
|
endArrow,
|
|
14601
14597
|
strokePaint,
|
|
@@ -14799,14 +14795,14 @@ function getElementInteractionProps({
|
|
|
14799
14795
|
};
|
|
14800
14796
|
}
|
|
14801
14797
|
function renderDagDuotoneFilterForElement(el) {
|
|
14802
|
-
if (!
|
|
14798
|
+
if (!chunkRHNJ4IU2_js.hasDagDuotoneEffect(el)) {
|
|
14803
14799
|
return null;
|
|
14804
14800
|
}
|
|
14805
14801
|
const duotone = el.shapeStyle?.dagDuotone;
|
|
14806
14802
|
if (!duotone) {
|
|
14807
14803
|
return null;
|
|
14808
14804
|
}
|
|
14809
|
-
return
|
|
14805
|
+
return chunkRHNJ4IU2_js.renderDagDuotoneSvgFilter(el.id, duotone.color1, duotone.color2);
|
|
14810
14806
|
}
|
|
14811
14807
|
function getContainerStyle({
|
|
14812
14808
|
el,
|
|
@@ -14819,7 +14815,7 @@ function getContainerStyle({
|
|
|
14819
14815
|
has3DExtrusion,
|
|
14820
14816
|
templateEditing
|
|
14821
14817
|
}) {
|
|
14822
|
-
const ss =
|
|
14818
|
+
const ss = (0, chunkRHNJ4IU2_js.dist_exports.hasShapeProperties)(el) ? el.shapeStyle : void 0;
|
|
14823
14819
|
const isPicture = el.type === "picture" || el.type === "image";
|
|
14824
14820
|
const blurGrowVisible = Boolean(
|
|
14825
14821
|
ss?.blurGrow && typeof ss.blurRadius === "number" && ss.blurRadius > 0
|
|
@@ -14833,10 +14829,10 @@ function getContainerStyle({
|
|
|
14833
14829
|
top: isFullscreenMedia ? fs.top : el.y,
|
|
14834
14830
|
width: isFullscreenMedia ? fs.width : painted.width,
|
|
14835
14831
|
...heightStyle,
|
|
14836
|
-
transform: isFullscreenMedia ? fs.transform :
|
|
14832
|
+
transform: isFullscreenMedia ? fs.transform : chunkRHNJ4IU2_js.getElementTransform(el),
|
|
14837
14833
|
transformOrigin: "center",
|
|
14838
14834
|
overflow: overflowValue,
|
|
14839
|
-
clipPath: isPicture ? void 0 : isImg && !has3DExtrusion ?
|
|
14835
|
+
clipPath: isPicture ? void 0 : isImg && !has3DExtrusion ? chunkRHNJ4IU2_js.getCropShapeClipPath(el) : void 0,
|
|
14840
14836
|
zIndex: isFullscreenMedia ? fs.zIndex : zIndex,
|
|
14841
14837
|
visibility: animationState?.visible === false ? "hidden" : "visible",
|
|
14842
14838
|
animation: animationState?.cssAnimation,
|
|
@@ -14868,11 +14864,11 @@ function getContainerStyle({
|
|
|
14868
14864
|
};
|
|
14869
14865
|
}
|
|
14870
14866
|
function shapeParams(element) {
|
|
14871
|
-
const style =
|
|
14867
|
+
const style = (0, chunkRHNJ4IU2_js.dist_exports.hasShapeProperties)(element) ? element.shapeStyle : void 0;
|
|
14872
14868
|
const strokeWidth = pptx.paintedStrokeWidth(style);
|
|
14873
|
-
const strokeColor =
|
|
14874
|
-
const fillColor =
|
|
14875
|
-
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(
|
|
14869
|
+
const strokeColor = chunkRHNJ4IU2_js.normalizeHexColor(style?.strokeColor, chunkRHNJ4IU2_js.DEFAULT_STROKE_COLOR);
|
|
14870
|
+
const fillColor = chunkRHNJ4IU2_js.normalizeHexColor(style?.fillColor, chunkRHNJ4IU2_js.DEFAULT_FILL_COLOR);
|
|
14871
|
+
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(chunkRHNJ4IU2_js.buildCssGradientFromShapeStyle(style) || style?.fillGradient) || style?.fillMode === "pattern" && Boolean(style.fillPatternPreset);
|
|
14876
14872
|
return { hf: hasFill, fc: fillColor, sw: strokeWidth, sc: strokeColor };
|
|
14877
14873
|
}
|
|
14878
14874
|
var Extrusion3DOverlay = React17__default.default.memo(
|
|
@@ -14977,7 +14973,7 @@ function ShapeEffectOverlay({
|
|
|
14977
14973
|
const fillOverlayStyle = overlay ? {
|
|
14978
14974
|
position: "absolute",
|
|
14979
14975
|
inset: 0,
|
|
14980
|
-
...
|
|
14976
|
+
...(0, chunkRHNJ4IU2_js.dist_exports.isImageLikeElement)(element) ? chunkRHNJ4IU2_js.getImageSurfaceMaskStyle(element) : {},
|
|
14981
14977
|
background: overlay.color,
|
|
14982
14978
|
mixBlendMode: overlay.blendMode,
|
|
14983
14979
|
pointerEvents: "none"
|
|
@@ -15176,10 +15172,10 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15176
15172
|
const allow = pptx.resolveElementInteractivity(el);
|
|
15177
15173
|
const backgroundAnimationState = presentationElementStates?.get(`${el.id}::pptx-bg`);
|
|
15178
15174
|
const visualAnimationState = backgroundAnimationState ?? animationState;
|
|
15179
|
-
const isTxt =
|
|
15180
|
-
const txtSE =
|
|
15175
|
+
const isTxt = chunkRHNJ4IU2_js.isEditableTextElement(el) && allow.textEditable;
|
|
15176
|
+
const txtSE = (0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(el) ? el.textStyle : void 0;
|
|
15181
15177
|
const textStyleOverrideCss = pptx.buildTextStyleOverrideCss(el.id, visualAnimationState?.textStyle);
|
|
15182
|
-
const ss =
|
|
15178
|
+
const ss = chunkRHNJ4IU2_js.getShapeVisualStyle(
|
|
15183
15179
|
el,
|
|
15184
15180
|
hf,
|
|
15185
15181
|
fc,
|
|
@@ -15188,9 +15184,9 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15188
15184
|
visualAnimationState?.animatesFill,
|
|
15189
15185
|
visualAnimationState?.animatesStroke
|
|
15190
15186
|
);
|
|
15191
|
-
const ts =
|
|
15187
|
+
const ts = chunkRHNJ4IU2_js.getTextStyleForElement(el, chunkRHNJ4IU2_js.DEFAULT_TEXT_COLOR);
|
|
15192
15188
|
const isImg = el.type === "picture" || el.type === "image";
|
|
15193
|
-
const vs =
|
|
15189
|
+
const vs = chunkRHNJ4IU2_js.renderVectorShape(
|
|
15194
15190
|
el,
|
|
15195
15191
|
isImg ? false : hf,
|
|
15196
15192
|
fc,
|
|
@@ -15200,10 +15196,10 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15200
15196
|
visualAnimationState?.animatesStroke
|
|
15201
15197
|
);
|
|
15202
15198
|
const isModel3D = el.type === "model3d";
|
|
15203
|
-
const isConn =
|
|
15204
|
-
const shapeStyle3d =
|
|
15199
|
+
const isConn = chunkRHNJ4IU2_js.isConnectorOrLineElement(el);
|
|
15200
|
+
const shapeStyle3d = (0, chunkRHNJ4IU2_js.dist_exports.hasShapeProperties)(el) ? el.shapeStyle : void 0;
|
|
15205
15201
|
const extrusionData = React17.useMemo(
|
|
15206
|
-
() =>
|
|
15202
|
+
() => chunkRHNJ4IU2_js.build3DExtrusionData(shapeStyle3d?.shape3d, shapeStyle3d?.scene3d, fc, el.width, el.height),
|
|
15207
15203
|
[shapeStyle3d?.shape3d, shapeStyle3d?.scene3d, fc, el.width, el.height]
|
|
15208
15204
|
);
|
|
15209
15205
|
const actionAffordance = useActionAffordance(el, canInteract);
|
|
@@ -15292,7 +15288,7 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15292
15288
|
"aria-hidden": aria.hidden ? true : void 0,
|
|
15293
15289
|
"aria-selected": isSelected ? true : void 0,
|
|
15294
15290
|
tabIndex: isFocusable ? 0 : -1,
|
|
15295
|
-
className:
|
|
15291
|
+
className: chunkRHNJ4IU2_js.cn(
|
|
15296
15292
|
"absolute",
|
|
15297
15293
|
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",
|
|
15298
15294
|
cur,
|
|
@@ -15380,9 +15376,9 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15380
15376
|
txtSE,
|
|
15381
15377
|
txtS: ts,
|
|
15382
15378
|
vecShape: backgroundAnimationState && !isImg ? null : vs,
|
|
15383
|
-
imgStyle:
|
|
15384
|
-
imgFilter:
|
|
15385
|
-
imgOpacity:
|
|
15379
|
+
imgStyle: chunkRHNJ4IU2_js.getImageRenderStyle(el),
|
|
15380
|
+
imgFilter: chunkRHNJ4IU2_js.getImageEffectsFilter(el),
|
|
15381
|
+
imgOpacity: chunkRHNJ4IU2_js.getImageEffectsOpacity(el),
|
|
15386
15382
|
imgAlt: imageAltText,
|
|
15387
15383
|
isTxtEl: isTxt,
|
|
15388
15384
|
media: mediaDataUrls,
|
|
@@ -15504,10 +15500,10 @@ function renderStrokeView(view, pressureSensitive, replayStyle, key) {
|
|
|
15504
15500
|
}
|
|
15505
15501
|
function renderInk(el, options) {
|
|
15506
15502
|
const replay = options?.replay ?? false;
|
|
15507
|
-
const strokes =
|
|
15503
|
+
const strokes = chunkRHNJ4IU2_js.buildInkGroupStrokes(el, { color: "#000", width: 3 });
|
|
15508
15504
|
strokes.some((s) => s.circles || s.nibMarks);
|
|
15509
15505
|
const pressureSensitive = options?.pressureSensitive;
|
|
15510
|
-
const replayStyles = replay ?
|
|
15506
|
+
const replayStyles = replay ? chunkRHNJ4IU2_js.getInkReplayStyles(el, options?.replayConfig) : null;
|
|
15511
15507
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15512
15508
|
"svg",
|
|
15513
15509
|
{
|
|
@@ -15515,7 +15511,7 @@ function renderInk(el, options) {
|
|
|
15515
15511
|
viewBox: `0 0 ${Math.max(el.width, 1)} ${Math.max(el.height, 1)}`,
|
|
15516
15512
|
preserveAspectRatio: "none",
|
|
15517
15513
|
children: [
|
|
15518
|
-
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children:
|
|
15514
|
+
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children: chunkRHNJ4IU2_js.INK_REPLAY_KEYFRAMES }),
|
|
15519
15515
|
strokes.map(
|
|
15520
15516
|
(s, i) => renderStrokeView(s, pressureSensitive, replayStyles?.[i], `${el.id}-ink-${i}`)
|
|
15521
15517
|
)
|
|
@@ -15526,7 +15522,7 @@ function renderInk(el, options) {
|
|
|
15526
15522
|
function renderGroup(children, parentGroupFill) {
|
|
15527
15523
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full h-full pointer-events-none", children: pptx.filterRenderedElements(children).map((c, childIndex) => {
|
|
15528
15524
|
const { hf, fc, sw, sc } = shapeParams(c);
|
|
15529
|
-
const baseSs =
|
|
15525
|
+
const baseSs = chunkRHNJ4IU2_js.getShapeVisualStyle(c, hf, fc, sw, sc);
|
|
15530
15526
|
const inheritedFill = pptx.resolveGroupChildFill(c, parentGroupFill);
|
|
15531
15527
|
const ss = inheritedFill ? {
|
|
15532
15528
|
...baseSs,
|
|
@@ -15537,9 +15533,9 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15537
15533
|
backgroundPosition: inheritedFill.backgroundPosition
|
|
15538
15534
|
} : baseSs;
|
|
15539
15535
|
const isI = c.type === "picture" || c.type === "image";
|
|
15540
|
-
const vs =
|
|
15541
|
-
const ts =
|
|
15542
|
-
const isTxt =
|
|
15536
|
+
const vs = chunkRHNJ4IU2_js.renderVectorShape(c, isI ? false : hf, fc, sw, sc);
|
|
15537
|
+
const ts = chunkRHNJ4IU2_js.getTextStyleForElement(c, chunkRHNJ4IU2_js.DEFAULT_TEXT_COLOR);
|
|
15538
|
+
const isTxt = chunkRHNJ4IU2_js.isEditableTextElement(c);
|
|
15543
15539
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15544
15540
|
"div",
|
|
15545
15541
|
{
|
|
@@ -15548,9 +15544,9 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15548
15544
|
style: {
|
|
15549
15545
|
left: c.x,
|
|
15550
15546
|
top: c.y,
|
|
15551
|
-
width: Math.max(c.width,
|
|
15552
|
-
height: Math.max(c.height,
|
|
15553
|
-
transform:
|
|
15547
|
+
width: Math.max(c.width, chunkRHNJ4IU2_js.MIN_ELEMENT_SIZE),
|
|
15548
|
+
height: Math.max(c.height, chunkRHNJ4IU2_js.MIN_ELEMENT_SIZE),
|
|
15549
|
+
transform: chunkRHNJ4IU2_js.getElementTransform(c),
|
|
15554
15550
|
transformOrigin: "center",
|
|
15555
15551
|
...ss,
|
|
15556
15552
|
...isI ? {
|
|
@@ -15575,8 +15571,8 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15575
15571
|
// A nested group: recurse, chaining the inherited fill so a
|
|
15576
15572
|
// `grpFill` shape under a fill-less sub-group still paints.
|
|
15577
15573
|
renderGroup(c.children, pptx.getGroupChildParentFill(c, parentGroupFill))
|
|
15578
|
-
) : isI && ("svgData" in c && c.svgData || "imageData" in c && c.imageData) ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style:
|
|
15579
|
-
|
|
15574
|
+
) : isI && ("svgData" in c && c.svgData || "imageData" in c && c.imageData) ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style: chunkRHNJ4IU2_js.getImageSurfaceStyle(c), children: [
|
|
15575
|
+
chunkRHNJ4IU2_js.isImageTiled(c) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
15580
15576
|
TiledImageLayer,
|
|
15581
15577
|
{
|
|
15582
15578
|
element: c,
|
|
@@ -15589,7 +15585,7 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15589
15585
|
src: "svgData" in c && c.svgData ? c.svgData : c.imageData,
|
|
15590
15586
|
alt: i18n.translationsEn["pptx.ink.groupChildAlt"],
|
|
15591
15587
|
className: "pointer-events-none select-none",
|
|
15592
|
-
style:
|
|
15588
|
+
style: chunkRHNJ4IU2_js.getImageRenderStyle(c),
|
|
15593
15589
|
draggable: false
|
|
15594
15590
|
}
|
|
15595
15591
|
),
|
|
@@ -15601,7 +15597,7 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15601
15597
|
{
|
|
15602
15598
|
className: "relative z-10 w-full h-full pointer-events-none whitespace-pre-wrap break-words leading-[1.3]",
|
|
15603
15599
|
style: ts,
|
|
15604
|
-
children:
|
|
15600
|
+
children: chunkRHNJ4IU2_js.renderTextSegments(c, chunkRHNJ4IU2_js.DEFAULT_TEXT_COLOR)
|
|
15605
15601
|
}
|
|
15606
15602
|
) : null
|
|
15607
15603
|
] })
|
|
@@ -15615,8 +15611,8 @@ function renderContentPart(el, options) {
|
|
|
15615
15611
|
if (el.inkStrokes && el.inkStrokes.length > 0) {
|
|
15616
15612
|
const replay = options?.replay ?? false;
|
|
15617
15613
|
const pressureSensitive = options?.pressureSensitive ?? true;
|
|
15618
|
-
const strokes =
|
|
15619
|
-
const replayStyles = replay ?
|
|
15614
|
+
const strokes = chunkRHNJ4IU2_js.buildContentPartStrokes(el);
|
|
15615
|
+
const replayStyles = replay ? chunkRHNJ4IU2_js.getContentPartReplayStyles(el.inkStrokes, options?.replayConfig) : null;
|
|
15620
15616
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15621
15617
|
"svg",
|
|
15622
15618
|
{
|
|
@@ -15624,7 +15620,7 @@ function renderContentPart(el, options) {
|
|
|
15624
15620
|
viewBox: `0 0 ${Math.max(el.width, 1)} ${Math.max(el.height, 1)}`,
|
|
15625
15621
|
preserveAspectRatio: "none",
|
|
15626
15622
|
children: [
|
|
15627
|
-
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children:
|
|
15623
|
+
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children: chunkRHNJ4IU2_js.INK_REPLAY_KEYFRAMES }),
|
|
15628
15624
|
strokes.map(
|
|
15629
15625
|
(s, i) => renderStrokeView(s, pressureSensitive, replayStyles?.[i], `${el.id}-cp-ink-${i}`)
|
|
15630
15626
|
)
|
|
@@ -15851,9 +15847,9 @@ function useInlineListEditor(element, rootRef, onChange, onModelReplacement) {
|
|
|
15851
15847
|
collaboration: connected,
|
|
15852
15848
|
model: pptx.createInlineListModelObserver(element),
|
|
15853
15849
|
activationSelection,
|
|
15854
|
-
children: seed && !connected ?
|
|
15850
|
+
children: seed && !connected ? chunkRHNJ4IU2_js.renderTextSegments(
|
|
15855
15851
|
element,
|
|
15856
|
-
|
|
15852
|
+
chunkRHNJ4IU2_js.DEFAULT_TEXT_COLOR,
|
|
15857
15853
|
void 0,
|
|
15858
15854
|
void 0,
|
|
15859
15855
|
void 0,
|
|
@@ -16023,7 +16019,7 @@ function InlineTextEditor({
|
|
|
16023
16019
|
seedRef.current = {
|
|
16024
16020
|
initialText,
|
|
16025
16021
|
hasRichSegments: Boolean(
|
|
16026
|
-
|
|
16022
|
+
(0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(element) && element.textSegments && element.textSegments.length > 0
|
|
16027
16023
|
)
|
|
16028
16024
|
};
|
|
16029
16025
|
}
|
|
@@ -16089,8 +16085,8 @@ function InlineTextEditor({
|
|
|
16089
16085
|
pending.endOffset
|
|
16090
16086
|
);
|
|
16091
16087
|
});
|
|
16092
|
-
const warpStyle =
|
|
16093
|
-
const compensationTransform =
|
|
16088
|
+
const warpStyle = chunkRHNJ4IU2_js.getTextWarpStyle(textStyleRaw);
|
|
16089
|
+
const compensationTransform = chunkRHNJ4IU2_js.getTextCompensationTransform(element);
|
|
16094
16090
|
const warpTransform = warpStyle?.transform;
|
|
16095
16091
|
const mergedTransform = [compensationTransform, warpTransform].filter(Boolean).join(" ") || void 0;
|
|
16096
16092
|
const wrapperStyle = {
|
|
@@ -16101,7 +16097,7 @@ function InlineTextEditor({
|
|
|
16101
16097
|
transformOrigin: warpStyle?.transformOrigin || "center"
|
|
16102
16098
|
};
|
|
16103
16099
|
const nextInlineStyleValue = (property) => {
|
|
16104
|
-
if (!
|
|
16100
|
+
if (!(0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(element)) {
|
|
16105
16101
|
return true;
|
|
16106
16102
|
}
|
|
16107
16103
|
const result = pptx.getInlineEditorSelectionResult(element.textSegments);
|
|
@@ -16177,7 +16173,7 @@ function InlineTextEditor({
|
|
|
16177
16173
|
const text = e.clipboardData.getData("text/plain");
|
|
16178
16174
|
document.execCommand("insertText", false, text);
|
|
16179
16175
|
},
|
|
16180
|
-
children: list.seed ? list.children : seed.hasRichSegments ?
|
|
16176
|
+
children: list.seed ? list.children : seed.hasRichSegments ? chunkRHNJ4IU2_js.renderTextSegments(element, chunkRHNJ4IU2_js.DEFAULT_TEXT_COLOR) : seed.initialText
|
|
16181
16177
|
},
|
|
16182
16178
|
list.seed?.paragraphs[0].token ?? "plain"
|
|
16183
16179
|
);
|
|
@@ -16188,7 +16184,7 @@ function FailedToLoad() {
|
|
|
16188
16184
|
var LazyModel3DScene = React17__default.default.lazy(
|
|
16189
16185
|
async () => {
|
|
16190
16186
|
try {
|
|
16191
|
-
return await import('./Model3DScene-
|
|
16187
|
+
return await import('./Model3DScene-KYIYYLMY.js');
|
|
16192
16188
|
} catch {
|
|
16193
16189
|
return { default: FailedToLoad };
|
|
16194
16190
|
}
|
|
@@ -16269,7 +16265,7 @@ function Model3DRenderer({ element, width, height, interactive }) {
|
|
|
16269
16265
|
const [threeAvailable, setThreeAvailable] = React17.useState(null);
|
|
16270
16266
|
React17.useEffect(() => {
|
|
16271
16267
|
let cancelled = false;
|
|
16272
|
-
import('./three.module-
|
|
16268
|
+
import('./three.module-LS32MK23.js').then(() => {
|
|
16273
16269
|
if (!cancelled) {
|
|
16274
16270
|
setThreeAvailable(true);
|
|
16275
16271
|
}
|
|
@@ -17114,7 +17110,7 @@ function SmartArtRendererImpl({
|
|
|
17114
17110
|
if (!onUpdateElement || !pptx.shouldCommitSmartArtNodeText(smartArtData, nodeId, text)) {
|
|
17115
17111
|
return;
|
|
17116
17112
|
}
|
|
17117
|
-
const updated =
|
|
17113
|
+
const updated = (0, chunkRHNJ4IU2_js.dist_exports.updateSmartArtNodeText)(smartArtData, nodeId, text);
|
|
17118
17114
|
const box = { width: element.width, height: element.height };
|
|
17119
17115
|
const reflowed = pptx.rebuildDrawingShapesIfCleared(
|
|
17120
17116
|
updated,
|
|
@@ -17130,7 +17126,7 @@ function SmartArtRendererImpl({
|
|
|
17130
17126
|
if (!onUpdateElement) {
|
|
17131
17127
|
return;
|
|
17132
17128
|
}
|
|
17133
|
-
const next =
|
|
17129
|
+
const next = (0, chunkRHNJ4IU2_js.dist_exports.setSmartArtNodeStyle)(smartArtData, nodeId, { fillColor: fill });
|
|
17134
17130
|
if (next !== smartArtData) {
|
|
17135
17131
|
const box = { width: element.width, height: element.height };
|
|
17136
17132
|
const reflowed = pptx.rebuildDrawingShapesIfCleared(
|
|
@@ -17324,7 +17320,7 @@ function groupIntoParagraphs(element, fieldContext) {
|
|
|
17324
17320
|
element,
|
|
17325
17321
|
fieldContext ? (seg) => {
|
|
17326
17322
|
if (seg.fieldType) {
|
|
17327
|
-
const substituted =
|
|
17323
|
+
const substituted = chunkRHNJ4IU2_js.substituteFieldText(
|
|
17328
17324
|
seg.text,
|
|
17329
17325
|
seg.fieldType,
|
|
17330
17326
|
fieldContext,
|
|
@@ -17359,13 +17355,13 @@ function getSegmentTspanProps(segment, element, fallbackColor) {
|
|
|
17359
17355
|
if (s.strikethrough) {
|
|
17360
17356
|
decos.push("line-through");
|
|
17361
17357
|
}
|
|
17362
|
-
const fill = s.hyperlink ?
|
|
17358
|
+
const fill = s.hyperlink ? chunkRHNJ4IU2_js.normalizeHexColor(s.color || element.textStyle?.color, chunkRHNJ4IU2_js.HYPERLINK_COLOR) : chunkRHNJ4IU2_js.normalizeHexColor(s.color || element.textStyle?.color, fallbackColor);
|
|
17363
17359
|
return {
|
|
17364
17360
|
fill,
|
|
17365
|
-
fontSize: s.fontSize ?? element.textStyle?.fontSize ??
|
|
17361
|
+
fontSize: s.fontSize ?? element.textStyle?.fontSize ?? chunkRHNJ4IU2_js.DEFAULT_TEXT_FONT_SIZE,
|
|
17366
17362
|
fontWeight: s.bold ? 700 : 400,
|
|
17367
17363
|
fontStyle: s.italic ? "italic" : void 0,
|
|
17368
|
-
fontFamily: s.fontFamily || element.textStyle?.fontFamily ?
|
|
17364
|
+
fontFamily: s.fontFamily || element.textStyle?.fontFamily ? (0, chunkRHNJ4IU2_js.dist_exports.getSubstituteFontFamily)(s.fontFamily || element.textStyle?.fontFamily || "") : chunkRHNJ4IU2_js.DEFAULT_FONT_FAMILY,
|
|
17369
17365
|
textDecoration: decos.length > 0 ? decos.join(" ") : void 0
|
|
17370
17366
|
};
|
|
17371
17367
|
}
|
|
@@ -17373,8 +17369,8 @@ function resolveSegmentFont(segment, element) {
|
|
|
17373
17369
|
const s = segment.style || {};
|
|
17374
17370
|
const family = s.fontFamily || element.textStyle?.fontFamily;
|
|
17375
17371
|
return {
|
|
17376
|
-
fontFamily: family ?
|
|
17377
|
-
fontSizePx: s.fontSize ?? element.textStyle?.fontSize ??
|
|
17372
|
+
fontFamily: family ? (0, chunkRHNJ4IU2_js.dist_exports.getSubstituteFontFamily)(family) : chunkRHNJ4IU2_js.DEFAULT_FONT_FAMILY,
|
|
17373
|
+
fontSizePx: s.fontSize ?? element.textStyle?.fontSize ?? chunkRHNJ4IU2_js.DEFAULT_TEXT_FONT_SIZE,
|
|
17378
17374
|
bold: s.bold ?? element.textStyle?.bold,
|
|
17379
17375
|
italic: s.italic ?? element.textStyle?.italic
|
|
17380
17376
|
};
|
|
@@ -17440,7 +17436,7 @@ function WarpedText({
|
|
|
17440
17436
|
fallbackColor,
|
|
17441
17437
|
fieldContext
|
|
17442
17438
|
}) {
|
|
17443
|
-
if (!
|
|
17439
|
+
if (!(0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(element)) {
|
|
17444
17440
|
return null;
|
|
17445
17441
|
}
|
|
17446
17442
|
const textEl = element;
|
|
@@ -17458,9 +17454,9 @@ function WarpedText({
|
|
|
17458
17454
|
const warpAdj2 = textEl.textStyle?.textWarpAdj2;
|
|
17459
17455
|
const align = textEl.textStyle?.align ?? "center";
|
|
17460
17456
|
const { startOffset, textAnchor } = getAlignmentProps(align);
|
|
17461
|
-
const baseFontSize = textEl.textStyle?.fontSize ??
|
|
17462
|
-
const baseFontFamily = textEl.textStyle?.fontFamily ?
|
|
17463
|
-
const baseFill =
|
|
17457
|
+
const baseFontSize = textEl.textStyle?.fontSize ?? chunkRHNJ4IU2_js.DEFAULT_TEXT_FONT_SIZE;
|
|
17458
|
+
const baseFontFamily = textEl.textStyle?.fontFamily ? (0, chunkRHNJ4IU2_js.dist_exports.getSubstituteFontFamily)(textEl.textStyle.fontFamily) : chunkRHNJ4IU2_js.DEFAULT_FONT_FAMILY;
|
|
17459
|
+
const baseFill = chunkRHNJ4IU2_js.normalizeHexColor(textEl.textStyle?.color, fallbackColor);
|
|
17464
17460
|
if (pptx.hasGlyphEnvelope(preset)) {
|
|
17465
17461
|
const perLine = pptx.buildGlyphEnvelopeBlock(
|
|
17466
17462
|
preset,
|
|
@@ -17560,7 +17556,7 @@ function WarpedText({
|
|
|
17560
17556
|
);
|
|
17561
17557
|
}
|
|
17562
17558
|
var GLYPH_BY_SHAPE = Object.fromEntries(
|
|
17563
|
-
|
|
17559
|
+
chunkRHNJ4IU2_js.ACTION_BUTTON_PRESETS.map((p) => [p.shapeType, p.iconPath])
|
|
17564
17560
|
);
|
|
17565
17561
|
GLYPH_BY_SHAPE["actionButtonForwardOrNext"] = GLYPH_BY_SHAPE["actionButtonForwardNext"];
|
|
17566
17562
|
GLYPH_BY_SHAPE["actionButtonBackOrPrevious"] = GLYPH_BY_SHAPE["actionButtonBackPrevious"];
|
|
@@ -17630,11 +17626,11 @@ function renderTextElementBody(options) {
|
|
|
17630
17626
|
const isLinkedTextBox = pptx.isLinkedTextBox(el);
|
|
17631
17627
|
const linkedSegments = pptx.getOverflowSegments(el, slideElements);
|
|
17632
17628
|
const useSvgWarp = pptx.shouldUseSvgWarp(
|
|
17633
|
-
|
|
17629
|
+
(0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(el) ? el.textStyle?.textWarpPreset : void 0
|
|
17634
17630
|
);
|
|
17635
|
-
const scene3dStyle =
|
|
17631
|
+
const scene3dStyle = (0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(el) ? chunkRHNJ4IU2_js.buildTextBody3DSceneStyle(el.textStyle, { width: el.width, height: el.height }) : void 0;
|
|
17636
17632
|
const rotationTransform = pptx.getTextBodyRotationTransform(el);
|
|
17637
|
-
const composedTransform = [rotationTransform,
|
|
17633
|
+
const composedTransform = [rotationTransform, chunkRHNJ4IU2_js.getTextCompensationTransform(el), scene3dStyle?.transform].filter(Boolean).join(" ") || void 0;
|
|
17638
17634
|
const transformStyle = {
|
|
17639
17635
|
transform: composedTransform,
|
|
17640
17636
|
// A COM-measured homography (`scene3dStyle.transformOrigin === '0 0'`)
|
|
@@ -17664,18 +17660,18 @@ function renderTextElementBody(options) {
|
|
|
17664
17660
|
shouldRenderText && (useSvgWarp ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
17665
17661
|
"div",
|
|
17666
17662
|
{
|
|
17667
|
-
className:
|
|
17663
|
+
className: chunkRHNJ4IU2_js.cn(
|
|
17668
17664
|
"relative z-10 w-full h-full",
|
|
17669
17665
|
onHyperlinkClick ? "" : "pointer-events-none"
|
|
17670
17666
|
),
|
|
17671
|
-
style: { ...
|
|
17667
|
+
style: { ...chunkRHNJ4IU2_js.getTextLayoutStyle(el), ...transformStyle },
|
|
17672
17668
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17673
17669
|
WarpedText,
|
|
17674
17670
|
{
|
|
17675
17671
|
element: el,
|
|
17676
17672
|
width: el.width,
|
|
17677
17673
|
height: el.height,
|
|
17678
|
-
fallbackColor:
|
|
17674
|
+
fallbackColor: chunkRHNJ4IU2_js.DEFAULT_TEXT_COLOR,
|
|
17679
17675
|
findHighlights: findHl,
|
|
17680
17676
|
fieldContext
|
|
17681
17677
|
}
|
|
@@ -17684,19 +17680,19 @@ function renderTextElementBody(options) {
|
|
|
17684
17680
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
17685
17681
|
"div",
|
|
17686
17682
|
{
|
|
17687
|
-
className:
|
|
17683
|
+
className: chunkRHNJ4IU2_js.cn(
|
|
17688
17684
|
"relative z-10 w-full h-full whitespace-pre-wrap break-words leading-[1.3]",
|
|
17689
17685
|
onHyperlinkClick ? "" : "pointer-events-none"
|
|
17690
17686
|
),
|
|
17691
17687
|
style: {
|
|
17692
|
-
...
|
|
17688
|
+
...chunkRHNJ4IU2_js.getTextLayoutStyle(el),
|
|
17693
17689
|
...txtS,
|
|
17694
|
-
...
|
|
17690
|
+
...chunkRHNJ4IU2_js.getTextWarpStyle(txtSE),
|
|
17695
17691
|
...transformStyle
|
|
17696
17692
|
},
|
|
17697
|
-
children:
|
|
17693
|
+
children: chunkRHNJ4IU2_js.renderTextSegments(
|
|
17698
17694
|
el,
|
|
17699
|
-
|
|
17695
|
+
chunkRHNJ4IU2_js.DEFAULT_TEXT_COLOR,
|
|
17700
17696
|
void 0,
|
|
17701
17697
|
findHl,
|
|
17702
17698
|
onHyperlinkClick,
|
|
@@ -18014,7 +18010,7 @@ function renderBody(options) {
|
|
|
18014
18010
|
);
|
|
18015
18011
|
}
|
|
18016
18012
|
if (isImg) {
|
|
18017
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style:
|
|
18013
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style: chunkRHNJ4IU2_js.getImageSurfaceStyle(el), children: [
|
|
18018
18014
|
renderImg(el, imgStyle, imgFilter, imgAlt, imgOpacity),
|
|
18019
18015
|
vecShape ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none absolute inset-0", children: vecShape }) : null
|
|
18020
18016
|
] });
|
|
@@ -18031,7 +18027,7 @@ function renderBody(options) {
|
|
|
18031
18027
|
textDirection: txtSE?.textDirection,
|
|
18032
18028
|
textStyle: txtS,
|
|
18033
18029
|
textStyleRaw: txtSE,
|
|
18034
|
-
layoutStyle:
|
|
18030
|
+
layoutStyle: chunkRHNJ4IU2_js.getTextLayoutStyle(el),
|
|
18035
18031
|
element: el,
|
|
18036
18032
|
onCommit,
|
|
18037
18033
|
onCancel,
|
|
@@ -18042,7 +18038,7 @@ function renderBody(options) {
|
|
|
18042
18038
|
] });
|
|
18043
18039
|
}
|
|
18044
18040
|
if (el.type === "table") {
|
|
18045
|
-
return
|
|
18041
|
+
return chunkRHNJ4IU2_js.renderTableElement(el, txtS, {
|
|
18046
18042
|
editable: isSel,
|
|
18047
18043
|
selectedCell: isSel ? tableSt : null,
|
|
18048
18044
|
onSelectCell: onCellSel,
|
|
@@ -18075,7 +18071,7 @@ function renderBody(options) {
|
|
|
18075
18071
|
);
|
|
18076
18072
|
}
|
|
18077
18073
|
if (el.type === "media") {
|
|
18078
|
-
return
|
|
18074
|
+
return chunkRHNJ4IU2_js.renderMediaElement(el, media, {
|
|
18079
18075
|
// Present mode autoplays every media element on the active slide,
|
|
18080
18076
|
// not only ones persisted with their own `autoPlay` flag (matching
|
|
18081
18077
|
// the other four bindings' unconditional `presenting`-gated
|
|
@@ -18098,7 +18094,7 @@ function renderBody(options) {
|
|
|
18098
18094
|
onPlayStateChange: handleMediaPlayStateChange
|
|
18099
18095
|
});
|
|
18100
18096
|
}
|
|
18101
|
-
if (doInk &&
|
|
18097
|
+
if (doInk && (0, chunkRHNJ4IU2_js.dist_exports.isInkElement)(el)) {
|
|
18102
18098
|
return renderInk(el, {
|
|
18103
18099
|
replay: isPresentationPassive,
|
|
18104
18100
|
pressureSensitive: true
|
|
@@ -18127,27 +18123,27 @@ function renderBody(options) {
|
|
|
18127
18123
|
}
|
|
18128
18124
|
return renderGroup(el.children, pptx.getGroupChildParentFill(el));
|
|
18129
18125
|
}
|
|
18130
|
-
if (
|
|
18131
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
18126
|
+
if (chunkRHNJ4IU2_js.shouldRenderFallbackLabel(el, isTxtEl)) {
|
|
18127
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkRHNJ4IU2_js.getElementLabel(el) });
|
|
18132
18128
|
}
|
|
18133
18129
|
return renderTextElementBody(options);
|
|
18134
18130
|
}
|
|
18135
18131
|
function defaultTextColorForFill(fillColor) {
|
|
18136
18132
|
const hex = String(fillColor ?? "").replace(/^#/u, "");
|
|
18137
18133
|
if (!/^[0-9a-f]{6}$/iu.test(hex)) {
|
|
18138
|
-
return
|
|
18134
|
+
return chunkRHNJ4IU2_js.DEFAULT_TEXT_COLOR;
|
|
18139
18135
|
}
|
|
18140
18136
|
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);
|
|
18141
18137
|
const luminance = channels[0] * 0.2126 + channels[1] * 0.7152 + channels[2] * 0.0722;
|
|
18142
|
-
return luminance > 0.179 ?
|
|
18138
|
+
return luminance > 0.179 ? chunkRHNJ4IU2_js.DEFAULT_TEXT_COLOR : "#ffffff";
|
|
18143
18139
|
}
|
|
18144
18140
|
function getStaticElementVisualState(element, parentGroupFill) {
|
|
18145
|
-
const style =
|
|
18146
|
-
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(
|
|
18147
|
-
const fill =
|
|
18141
|
+
const style = (0, chunkRHNJ4IU2_js.dist_exports.hasShapeProperties)(element) ? element.shapeStyle : void 0;
|
|
18142
|
+
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(chunkRHNJ4IU2_js.buildCssGradientFromShapeStyle(style) || style?.fillGradient) || style?.fillMode === "pattern" && Boolean(style.fillPatternPreset);
|
|
18143
|
+
const fill = chunkRHNJ4IU2_js.normalizeHexColor(style?.fillColor, chunkRHNJ4IU2_js.DEFAULT_FILL_COLOR);
|
|
18148
18144
|
const strokeWidth = pptx.paintedStrokeWidth(style);
|
|
18149
|
-
const stroke =
|
|
18150
|
-
const baseVisualStyle =
|
|
18145
|
+
const stroke = chunkRHNJ4IU2_js.normalizeHexColor(style?.strokeColor, chunkRHNJ4IU2_js.DEFAULT_STROKE_COLOR);
|
|
18146
|
+
const baseVisualStyle = chunkRHNJ4IU2_js.getShapeVisualStyle(element, hasFill, fill, strokeWidth, stroke);
|
|
18151
18147
|
const inheritedFill = pptx.resolveGroupChildFill(element, parentGroupFill);
|
|
18152
18148
|
const visualStyle = inheritedFill ? {
|
|
18153
18149
|
...baseVisualStyle,
|
|
@@ -18157,13 +18153,13 @@ function getStaticElementVisualState(element, parentGroupFill) {
|
|
|
18157
18153
|
backgroundSize: inheritedFill.backgroundSize,
|
|
18158
18154
|
backgroundPosition: inheritedFill.backgroundPosition
|
|
18159
18155
|
} : baseVisualStyle;
|
|
18160
|
-
const textStyle =
|
|
18156
|
+
const textStyle = chunkRHNJ4IU2_js.getTextStyleForElement(
|
|
18161
18157
|
element,
|
|
18162
|
-
element.type === "shape" && hasFill ? defaultTextColorForFill(fill) :
|
|
18158
|
+
element.type === "shape" && hasFill ? defaultTextColorForFill(fill) : chunkRHNJ4IU2_js.DEFAULT_TEXT_COLOR
|
|
18163
18159
|
);
|
|
18164
18160
|
const isImage = element.type === "picture" || element.type === "image";
|
|
18165
|
-
const letsTextOverflow =
|
|
18166
|
-
const shapeType =
|
|
18161
|
+
const letsTextOverflow = (0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(element) && element.textStyle?.autoFitMode === "shrink" && (element.type === "text" || element.locks?.txBox === true);
|
|
18162
|
+
const shapeType = (0, chunkRHNJ4IU2_js.dist_exports.hasShapeProperties)(element) ? element.shapeType : void 0;
|
|
18167
18163
|
const isCallout = pptx.isWedgeCalloutPresetShape(shapeType) || String(shapeType ?? "").toLowerCase().includes("callout");
|
|
18168
18164
|
return {
|
|
18169
18165
|
hasFill,
|
|
@@ -18184,7 +18180,7 @@ function getStaticElementInteractionState(element, hasActionHandler, exposeEleme
|
|
|
18184
18180
|
return { action, isActionable, contractRole };
|
|
18185
18181
|
}
|
|
18186
18182
|
function getStaticElementWrapperClassName(element, visual, positioned, isActionable) {
|
|
18187
|
-
const overflowClass = visual.isImage || element.type === "group" ||
|
|
18183
|
+
const overflowClass = visual.isImage || element.type === "group" || chunkRHNJ4IU2_js.isConnectorOrLineElement(element) || visual.isCallout || visual.letsTextOverflow ? "" : "overflow-hidden";
|
|
18188
18184
|
const pointerClass = isActionable ? "pointer-events-auto cursor-pointer" : "pointer-events-none";
|
|
18189
18185
|
return `${positioned ? "absolute" : "relative"} ${overflowClass} ${pointerClass}`;
|
|
18190
18186
|
}
|
|
@@ -18267,7 +18263,7 @@ function StaticElementRendererImpl({
|
|
|
18267
18263
|
top: positioned ? element.y : void 0,
|
|
18268
18264
|
width: positioned ? Math.max(element.width, 1) : "100%",
|
|
18269
18265
|
height: positioned ? Math.max(element.height, 1) : "100%",
|
|
18270
|
-
transform: positioned ?
|
|
18266
|
+
transform: positioned ? chunkRHNJ4IU2_js.getElementTransform(element) : void 0,
|
|
18271
18267
|
transformOrigin: "center",
|
|
18272
18268
|
zIndex,
|
|
18273
18269
|
...visualStyle,
|
|
@@ -18308,20 +18304,20 @@ function StaticElementRendererImpl({
|
|
|
18308
18304
|
isEditing: false,
|
|
18309
18305
|
editText: "",
|
|
18310
18306
|
spellCheck: false,
|
|
18311
|
-
txtSE:
|
|
18307
|
+
txtSE: (0, chunkRHNJ4IU2_js.dist_exports.hasTextProperties)(element) ? element.textStyle : void 0,
|
|
18312
18308
|
txtS: textStyle,
|
|
18313
|
-
vecShape:
|
|
18309
|
+
vecShape: chunkRHNJ4IU2_js.renderVectorShape(
|
|
18314
18310
|
element,
|
|
18315
18311
|
isImage ? false : hasFill,
|
|
18316
18312
|
fill,
|
|
18317
18313
|
strokeWidth,
|
|
18318
18314
|
stroke
|
|
18319
18315
|
),
|
|
18320
|
-
imgStyle: imageAnimation ? { ...
|
|
18321
|
-
imgFilter:
|
|
18322
|
-
imgOpacity:
|
|
18316
|
+
imgStyle: imageAnimation ? { ...chunkRHNJ4IU2_js.getImageRenderStyle(element), animation: imageAnimation } : chunkRHNJ4IU2_js.getImageRenderStyle(element),
|
|
18317
|
+
imgFilter: chunkRHNJ4IU2_js.getImageEffectsFilter(element),
|
|
18318
|
+
imgOpacity: chunkRHNJ4IU2_js.getImageEffectsOpacity(element),
|
|
18323
18319
|
imgAlt: "",
|
|
18324
|
-
isTxtEl:
|
|
18320
|
+
isTxtEl: chunkRHNJ4IU2_js.isEditableTextElement(element),
|
|
18325
18321
|
media: mediaDataUrls,
|
|
18326
18322
|
tableSt: null,
|
|
18327
18323
|
isSel: false,
|
|
@@ -18366,7 +18362,7 @@ function SlideLayer({
|
|
|
18366
18362
|
style: {
|
|
18367
18363
|
width: safeWidth,
|
|
18368
18364
|
height: safeHeight,
|
|
18369
|
-
backgroundColor: slide.backgroundColor ?
|
|
18365
|
+
backgroundColor: slide.backgroundColor ? chunkRHNJ4IU2_js.normalizeHexColor(slide.backgroundColor, "#ffffff") : "#ffffff",
|
|
18370
18366
|
backgroundImage: slide.backgroundImage ? `url(${slide.backgroundImage})` : slide.backgroundGradient ? slide.backgroundGradient : void 0,
|
|
18371
18367
|
backgroundSize: slide.backgroundImage ? "cover" : void 0,
|
|
18372
18368
|
backgroundPosition: slide.backgroundImage ? "center" : void 0
|