pptx-react-viewer 4.45.0 → 4.47.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 +50 -0
- package/README.md +5 -2
- package/dist/{AiChatPanel-Z5VHI4WA.mjs → AiChatPanel-6S4LWXGM.mjs} +2 -2
- package/dist/AiChatPanel-6S4LWXGM.mjs.br +0 -0
- package/dist/AiChatPanel-6S4LWXGM.mjs.gz +0 -0
- package/dist/{AiChatPanel-TGZQBH3L.js → AiChatPanel-IEM43TTZ.js} +10 -10
- package/dist/AiChatPanel-IEM43TTZ.js.br +0 -0
- package/dist/AiChatPanel-IEM43TTZ.js.gz +0 -0
- package/dist/{Model3DScene-5HLXSIIK.js → Model3DScene-CCIG67DJ.js} +1 -1
- package/dist/Model3DScene-CCIG67DJ.js.br +0 -0
- package/dist/Model3DScene-CCIG67DJ.js.gz +0 -0
- package/dist/{Model3DScene-MSC4LEKG.mjs → Model3DScene-NUJH2UKM.mjs} +1 -1
- package/dist/Model3DScene-NUJH2UKM.mjs.br +0 -0
- package/dist/Model3DScene-NUJH2UKM.mjs.gz +0 -0
- package/dist/{chunk-FBN7UFW2.mjs → chunk-BVQSH5SS.mjs} +36 -43
- package/dist/chunk-BVQSH5SS.mjs.br +0 -0
- package/dist/chunk-BVQSH5SS.mjs.gz +0 -0
- package/dist/{chunk-66APV3YZ.mjs → chunk-HDOR67HF.mjs} +258 -130
- package/dist/chunk-HDOR67HF.mjs.br +0 -0
- package/dist/chunk-HDOR67HF.mjs.gz +0 -0
- package/dist/{chunk-VJZJESNT.js → chunk-MA2BI7LX.js} +45 -61
- package/dist/chunk-MA2BI7LX.js.br +0 -0
- package/dist/chunk-MA2BI7LX.js.gz +0 -0
- package/dist/{chunk-2YCROYR6.js → chunk-MRSGNERC.js} +432 -302
- package/dist/chunk-MRSGNERC.js.br +0 -0
- package/dist/chunk-MRSGNERC.js.gz +0 -0
- package/dist/{chunk-VUE3EPTJ.mjs → chunk-OWZSRPAH.mjs} +248 -162
- package/dist/chunk-OWZSRPAH.mjs.br +0 -0
- package/dist/chunk-OWZSRPAH.mjs.gz +0 -0
- package/dist/{chunk-W2IMY5SY.js → chunk-PIRHQTI4.js} +0 -2
- package/dist/chunk-PIRHQTI4.js.br +0 -0
- package/dist/chunk-PIRHQTI4.js.gz +0 -0
- package/dist/{chunk-KUQRWMIK.js → chunk-SSANGQ35.js} +550 -464
- package/dist/chunk-SSANGQ35.js.br +0 -0
- package/dist/chunk-SSANGQ35.js.gz +0 -0
- package/dist/{chunk-Q3DHYOLK.mjs → chunk-UV2HVMKZ.mjs} +1 -2
- package/dist/chunk-UV2HVMKZ.mjs.br +0 -0
- package/dist/chunk-UV2HVMKZ.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 +1 -1
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +47 -6
- 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 +74 -8
- 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/pptx-viewer-canvas.css +2 -0
- package/dist/pptx-viewer-canvas.css.br +0 -0
- package/dist/pptx-viewer-canvas.css.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{three.module-JPZUM7AI.mjs → three.module-EBJVANGB.mjs} +1 -1
- package/dist/three.module-EBJVANGB.mjs.br +0 -0
- package/dist/three.module-EBJVANGB.mjs.gz +0 -0
- package/dist/{three.module-RIUI7P3J.js → three.module-MBFHAT6M.js} +1 -1
- package/dist/three.module-MBFHAT6M.js.br +0 -0
- package/dist/three.module-MBFHAT6M.js.gz +0 -0
- package/dist/viewer/index.d.ts +49 -10
- 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-CCA4HVZZ.mjs → y-webrtc-2H7UYAQD.mjs} +1 -1
- package/dist/y-webrtc-2H7UYAQD.mjs.br +0 -0
- package/dist/y-webrtc-2H7UYAQD.mjs.gz +0 -0
- package/dist/{y-webrtc-MB5ZXFBA.js → y-webrtc-DVPQNFLL.js} +5 -5
- package/dist/y-webrtc-DVPQNFLL.js.br +0 -0
- package/dist/y-webrtc-DVPQNFLL.js.gz +0 -0
- package/dist/{y-websocket-JQQZVAMX.js → y-websocket-TN4OKPXQ.js} +1 -1
- package/dist/y-websocket-TN4OKPXQ.js.br +0 -0
- package/dist/y-websocket-TN4OKPXQ.js.gz +0 -0
- package/dist/{y-websocket-SCLLNICY.mjs → y-websocket-WORVRRQS.mjs} +1 -1
- package/dist/y-websocket-WORVRRQS.mjs.br +0 -0
- package/dist/y-websocket-WORVRRQS.mjs.gz +0 -0
- package/package.json +7 -5
- package/dist/AiChatPanel-TGZQBH3L.js.br +0 -0
- package/dist/AiChatPanel-TGZQBH3L.js.gz +0 -0
- package/dist/AiChatPanel-Z5VHI4WA.mjs.br +0 -0
- package/dist/AiChatPanel-Z5VHI4WA.mjs.gz +0 -0
- package/dist/Model3DScene-5HLXSIIK.js.br +0 -0
- package/dist/Model3DScene-5HLXSIIK.js.gz +0 -0
- package/dist/Model3DScene-MSC4LEKG.mjs.br +0 -0
- package/dist/Model3DScene-MSC4LEKG.mjs.gz +0 -0
- package/dist/chunk-2YCROYR6.js.br +0 -0
- package/dist/chunk-2YCROYR6.js.gz +0 -0
- package/dist/chunk-66APV3YZ.mjs.br +0 -0
- package/dist/chunk-66APV3YZ.mjs.gz +0 -0
- package/dist/chunk-FBN7UFW2.mjs.br +0 -0
- package/dist/chunk-FBN7UFW2.mjs.gz +0 -0
- package/dist/chunk-KUQRWMIK.js.br +0 -0
- package/dist/chunk-KUQRWMIK.js.gz +0 -0
- package/dist/chunk-Q3DHYOLK.mjs.br +0 -0
- package/dist/chunk-Q3DHYOLK.mjs.gz +0 -0
- package/dist/chunk-VJZJESNT.js.br +0 -0
- package/dist/chunk-VJZJESNT.js.gz +0 -0
- package/dist/chunk-VUE3EPTJ.mjs.br +0 -0
- package/dist/chunk-VUE3EPTJ.mjs.gz +0 -0
- package/dist/chunk-W2IMY5SY.js.br +0 -0
- package/dist/chunk-W2IMY5SY.js.gz +0 -0
- package/dist/three.module-JPZUM7AI.mjs.br +0 -0
- package/dist/three.module-JPZUM7AI.mjs.gz +0 -0
- package/dist/three.module-RIUI7P3J.js.br +0 -0
- package/dist/three.module-RIUI7P3J.js.gz +0 -0
- package/dist/y-webrtc-CCA4HVZZ.mjs.br +0 -0
- package/dist/y-webrtc-CCA4HVZZ.mjs.gz +0 -0
- package/dist/y-webrtc-MB5ZXFBA.js.br +0 -0
- package/dist/y-webrtc-MB5ZXFBA.js.gz +0 -0
- package/dist/y-websocket-JQQZVAMX.js.br +0 -0
- package/dist/y-websocket-JQQZVAMX.js.gz +0 -0
- package/dist/y-websocket-SCLLNICY.mjs.br +0 -0
- package/dist/y-websocket-SCLLNICY.mjs.gz +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMA2BI7LX_js = require('./chunk-MA2BI7LX.js');
|
|
4
4
|
var pptx = require('ooxml-ui/pptx');
|
|
5
5
|
var React17 = require('react');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var pptx$1 = require('ooxml-core/pptx');
|
|
7
8
|
var i18n = require('ooxml-ui/pptx/i18n');
|
|
8
9
|
var reactI18next = require('react-i18next');
|
|
9
10
|
var reactDom = require('react-dom');
|
|
@@ -130,7 +131,7 @@ function useYjsProvider({ config: inputConfig }) {
|
|
|
130
131
|
}
|
|
131
132
|
setStatus("connecting");
|
|
132
133
|
try {
|
|
133
|
-
const [Y, { WebrtcProvider }] = await Promise.all([import('yjs'), import('./y-webrtc-
|
|
134
|
+
const [Y, { WebrtcProvider }] = await Promise.all([import('yjs'), import('./y-webrtc-DVPQNFLL.js')]);
|
|
134
135
|
if (generation !== generationRef.current) {
|
|
135
136
|
return;
|
|
136
137
|
}
|
|
@@ -205,7 +206,7 @@ function useYjsProvider({ config: inputConfig }) {
|
|
|
205
206
|
}
|
|
206
207
|
setStatus("connecting");
|
|
207
208
|
try {
|
|
208
|
-
const [Y, { WebsocketProvider }] = await Promise.all([import('yjs'), import('./y-websocket-
|
|
209
|
+
const [Y, { WebsocketProvider }] = await Promise.all([import('yjs'), import('./y-websocket-TN4OKPXQ.js')]);
|
|
209
210
|
if (generation !== generationRef.current) {
|
|
210
211
|
return;
|
|
211
212
|
}
|
|
@@ -571,6 +572,7 @@ function useCollaborativeState({
|
|
|
571
572
|
canvasWidth,
|
|
572
573
|
canvasHeight
|
|
573
574
|
});
|
|
575
|
+
const [writeBack, reportWriteBack] = React17.useState();
|
|
574
576
|
const connectedCount = status === "connected" ? remoteUsers.length + 1 : remoteUsers.length;
|
|
575
577
|
return React17.useMemo(
|
|
576
578
|
() => config ? {
|
|
@@ -582,12 +584,25 @@ function useCollaborativeState({
|
|
|
582
584
|
doc,
|
|
583
585
|
synced,
|
|
584
586
|
retry,
|
|
585
|
-
clientId
|
|
587
|
+
clientId,
|
|
588
|
+
writeBack,
|
|
589
|
+
reportWriteBack
|
|
586
590
|
} : null,
|
|
587
|
-
[
|
|
591
|
+
[
|
|
592
|
+
status,
|
|
593
|
+
remoteUsers,
|
|
594
|
+
broadcastPresence,
|
|
595
|
+
connectedCount,
|
|
596
|
+
config,
|
|
597
|
+
doc,
|
|
598
|
+
synced,
|
|
599
|
+
retry,
|
|
600
|
+
clientId,
|
|
601
|
+
writeBack
|
|
602
|
+
]
|
|
588
603
|
);
|
|
589
604
|
}
|
|
590
|
-
var CollaborationContext = React17.createContext(null);
|
|
605
|
+
var CollaborationContext = /* @__PURE__ */ React17.createContext(null);
|
|
591
606
|
function useCollaboration() {
|
|
592
607
|
return React17.useContext(CollaborationContext);
|
|
593
608
|
}
|
|
@@ -749,9 +764,9 @@ function serializeHistoryDocument(snapshot) {
|
|
|
749
764
|
}
|
|
750
765
|
function recordExplicitSlideUpdate(past, future, previous, before, label, maxDepth) {
|
|
751
766
|
if (previous && serializeHistoryDocument(previous) !== serializeHistoryDocument(before)) {
|
|
752
|
-
past.push(
|
|
767
|
+
past.push(chunkMA2BI7LX_js.cloneHistorySnapshot(previous));
|
|
753
768
|
}
|
|
754
|
-
past.push({ ...
|
|
769
|
+
past.push({ ...chunkMA2BI7LX_js.cloneHistorySnapshot(before), actionLabel: label });
|
|
755
770
|
while (past.length > Math.max(1, maxDepth)) {
|
|
756
771
|
past.shift();
|
|
757
772
|
}
|
|
@@ -841,8 +856,8 @@ function useEditorHistory(input) {
|
|
|
841
856
|
width: canvasSize.width,
|
|
842
857
|
height: canvasSize.height,
|
|
843
858
|
activeSlideIndex,
|
|
844
|
-
slides: slides.map(
|
|
845
|
-
templateElementsBySlideId:
|
|
859
|
+
slides: slides.map(chunkMA2BI7LX_js.cloneSlide),
|
|
860
|
+
templateElementsBySlideId: chunkMA2BI7LX_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
846
861
|
...actionLabel ? { actionLabel } : {}
|
|
847
862
|
};
|
|
848
863
|
},
|
|
@@ -855,9 +870,9 @@ function useEditorHistory(input) {
|
|
|
855
870
|
width: snapshot.width,
|
|
856
871
|
height: snapshot.height
|
|
857
872
|
});
|
|
858
|
-
setSlides(snapshot.slides.map(
|
|
873
|
+
setSlides(snapshot.slides.map(chunkMA2BI7LX_js.cloneSlide));
|
|
859
874
|
setTemplateElementsBySlideId(
|
|
860
|
-
|
|
875
|
+
chunkMA2BI7LX_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
861
876
|
);
|
|
862
877
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
863
878
|
setSelectedElementIds([]);
|
|
@@ -896,8 +911,8 @@ function useEditorHistory(input) {
|
|
|
896
911
|
const currentSnapshot = buildHistorySnapshot(previousSnapshot.actionLabel);
|
|
897
912
|
historyFutureRef.current.push(currentSnapshot);
|
|
898
913
|
isApplyingHistoryRef.current = true;
|
|
899
|
-
const nextSnapshot =
|
|
900
|
-
lastHistorySnapshotRef.current =
|
|
914
|
+
const nextSnapshot = chunkMA2BI7LX_js.cloneHistorySnapshot(previousSnapshot);
|
|
915
|
+
lastHistorySnapshotRef.current = chunkMA2BI7LX_js.cloneHistorySnapshot(nextSnapshot);
|
|
901
916
|
lastHistorySerializedRef.current = serializeHistoryDocument(nextSnapshot);
|
|
902
917
|
applyHistorySnapshot(nextSnapshot);
|
|
903
918
|
updateHistoryAvailability();
|
|
@@ -918,8 +933,8 @@ function useEditorHistory(input) {
|
|
|
918
933
|
const currentSnapshot = buildHistorySnapshot(nextSnapshot.actionLabel);
|
|
919
934
|
historyPastRef.current.push(currentSnapshot);
|
|
920
935
|
isApplyingHistoryRef.current = true;
|
|
921
|
-
const targetSnapshot =
|
|
922
|
-
lastHistorySnapshotRef.current =
|
|
936
|
+
const targetSnapshot = chunkMA2BI7LX_js.cloneHistorySnapshot(nextSnapshot);
|
|
937
|
+
lastHistorySnapshotRef.current = chunkMA2BI7LX_js.cloneHistorySnapshot(targetSnapshot);
|
|
923
938
|
lastHistorySerializedRef.current = serializeHistoryDocument(targetSnapshot);
|
|
924
939
|
applyHistorySnapshot(targetSnapshot);
|
|
925
940
|
updateHistoryAvailability();
|
|
@@ -937,7 +952,7 @@ function useEditorHistory(input) {
|
|
|
937
952
|
historyPastRef.current = [];
|
|
938
953
|
historyFutureRef.current = [];
|
|
939
954
|
if (initialSnapshot) {
|
|
940
|
-
const clonedInitial =
|
|
955
|
+
const clonedInitial = chunkMA2BI7LX_js.cloneHistorySnapshot(initialSnapshot);
|
|
941
956
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
942
957
|
lastHistorySerializedRef.current = serializeHistoryDocument(clonedInitial);
|
|
943
958
|
} else {
|
|
@@ -1019,8 +1034,8 @@ function useEditorHistory(input) {
|
|
|
1019
1034
|
updateHistoryAvailability
|
|
1020
1035
|
]);
|
|
1021
1036
|
const commitSlides = (nextSlides, label, beforeSlides = slides) => {
|
|
1022
|
-
const before = { ...buildHistorySnapshot(), slides: beforeSlides.map(
|
|
1023
|
-
const after = { ...before, slides: nextSlides.map(
|
|
1037
|
+
const before = { ...buildHistorySnapshot(), slides: beforeSlides.map(chunkMA2BI7LX_js.cloneSlide) };
|
|
1038
|
+
const after = { ...before, slides: nextSlides.map(chunkMA2BI7LX_js.cloneSlide) };
|
|
1024
1039
|
recordExplicitSlideUpdate(
|
|
1025
1040
|
historyPastRef.current,
|
|
1026
1041
|
historyFutureRef.current,
|
|
@@ -1029,7 +1044,7 @@ function useEditorHistory(input) {
|
|
|
1029
1044
|
label,
|
|
1030
1045
|
maxHistoryEntries
|
|
1031
1046
|
);
|
|
1032
|
-
lastHistorySnapshotRef.current =
|
|
1047
|
+
lastHistorySnapshotRef.current = chunkMA2BI7LX_js.cloneHistorySnapshot(after);
|
|
1033
1048
|
lastHistorySerializedRef.current = serializeHistoryDocument(after);
|
|
1034
1049
|
isApplyingHistoryRef.current = false;
|
|
1035
1050
|
setSlides(nextSlides);
|
|
@@ -1072,6 +1087,7 @@ function useViewerStore(store, selector, isEqual = Object.is) {
|
|
|
1072
1087
|
);
|
|
1073
1088
|
return React17.useSyncExternalStore(subscribe2, getSnapshot2, getSnapshot2);
|
|
1074
1089
|
}
|
|
1090
|
+
var useBeforePaintEffect = typeof window === "undefined" ? React17.useEffect : React17.useLayoutEffect;
|
|
1075
1091
|
function useViewportFit(canvasSize, viewportRef, options, viewportNode) {
|
|
1076
1092
|
const [editorDimensions, setEditorDimensions] = React17.useState(null);
|
|
1077
1093
|
const { maxFitScale } = pptx.resolveViewportFitOptions(options, pptx.editorViewportFitFor(Infinity));
|
|
@@ -1084,7 +1100,7 @@ function useViewportFit(canvasSize, viewportRef, options, viewportNode) {
|
|
|
1084
1100
|
canvasHeight: canvasSize.height,
|
|
1085
1101
|
maxFitScale
|
|
1086
1102
|
});
|
|
1087
|
-
|
|
1103
|
+
useBeforePaintEffect(() => {
|
|
1088
1104
|
if (viewportNode === null) {
|
|
1089
1105
|
return;
|
|
1090
1106
|
}
|
|
@@ -1216,22 +1232,22 @@ function useZoomViewport({
|
|
|
1216
1232
|
selectedElements.forEach((element) => {
|
|
1217
1233
|
minX = Math.min(minX, element.x);
|
|
1218
1234
|
minY = Math.min(minY, element.y);
|
|
1219
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
1220
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
1235
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkMA2BI7LX_js.MIN_ELEMENT_SIZE));
|
|
1236
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkMA2BI7LX_js.MIN_ELEMENT_SIZE));
|
|
1221
1237
|
});
|
|
1222
1238
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
1223
1239
|
return;
|
|
1224
1240
|
}
|
|
1225
1241
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
1226
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
1227
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
1242
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkMA2BI7LX_js.MIN_ELEMENT_SIZE);
|
|
1243
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkMA2BI7LX_js.MIN_ELEMENT_SIZE);
|
|
1228
1244
|
const availableWidth = Math.max(
|
|
1229
|
-
effectiveEditorDimensions.width -
|
|
1230
|
-
|
|
1245
|
+
effectiveEditorDimensions.width - chunkMA2BI7LX_js.ZOOM_TO_SELECTION_PADDING,
|
|
1246
|
+
chunkMA2BI7LX_js.MIN_ELEMENT_SIZE
|
|
1231
1247
|
);
|
|
1232
1248
|
const availableHeight = Math.max(
|
|
1233
|
-
effectiveEditorDimensions.height -
|
|
1234
|
-
|
|
1249
|
+
effectiveEditorDimensions.height - chunkMA2BI7LX_js.ZOOM_TO_SELECTION_PADDING,
|
|
1250
|
+
chunkMA2BI7LX_js.MIN_ELEMENT_SIZE
|
|
1235
1251
|
);
|
|
1236
1252
|
const targetEditorScale = Math.min(
|
|
1237
1253
|
availableWidth / boundsWidth,
|
|
@@ -4198,8 +4214,8 @@ function useViewerCoreState(_input) {
|
|
|
4198
4214
|
const { slides, setSlides, slidesRef } = useSlideState();
|
|
4199
4215
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = React17.useState({});
|
|
4200
4216
|
const [canvasSize, setCanvasSize] = React17.useState({
|
|
4201
|
-
width:
|
|
4202
|
-
height:
|
|
4217
|
+
width: chunkMA2BI7LX_js.DEFAULT_CANVAS_WIDTH,
|
|
4218
|
+
height: chunkMA2BI7LX_js.DEFAULT_CANVAS_HEIGHT
|
|
4203
4219
|
});
|
|
4204
4220
|
const [slideSizeEmu, setSlideSizeEmu] = React17.useState();
|
|
4205
4221
|
const [activeSlideIndex, setActiveSlideIndex] = React17.useState(0);
|
|
@@ -4523,8 +4539,8 @@ function useViewerState(input) {
|
|
|
4523
4539
|
const crop = useCropSessionState();
|
|
4524
4540
|
return { ...core, ...ui, ...crop };
|
|
4525
4541
|
}
|
|
4526
|
-
var glyphOutlineFontCache = new pptx.GlyphOutlineFontCache();
|
|
4527
|
-
var getGlyphOutline = pptx.createGlyphOutlineLookup(glyphOutlineFontCache);
|
|
4542
|
+
var glyphOutlineFontCache = /* @__PURE__ */ new pptx.GlyphOutlineFontCache();
|
|
4543
|
+
var getGlyphOutline = /* @__PURE__ */ pptx.createGlyphOutlineLookup(glyphOutlineFontCache);
|
|
4528
4544
|
|
|
4529
4545
|
// src/viewer/hooks/useLoadContent.ts
|
|
4530
4546
|
function useLoadContent({
|
|
@@ -4587,7 +4603,7 @@ function useLoadContent({
|
|
|
4587
4603
|
}
|
|
4588
4604
|
let cancelled = false;
|
|
4589
4605
|
const token = ++renderTokenRef.current;
|
|
4590
|
-
const handler = new
|
|
4606
|
+
const handler = new pptx$1.PptxHandler();
|
|
4591
4607
|
const resources = pptx.createPresentationLoadResources(handler);
|
|
4592
4608
|
const loadBlobUrls = resources.blobUrls;
|
|
4593
4609
|
(async () => {
|
|
@@ -4672,12 +4688,12 @@ function useLoadContent({
|
|
|
4672
4688
|
}
|
|
4673
4689
|
resources.commit();
|
|
4674
4690
|
handlerRef.current = handler;
|
|
4675
|
-
const partition =
|
|
4691
|
+
const partition = chunkMA2BI7LX_js.partitionTemplateElements(nextSlides);
|
|
4676
4692
|
setSlides(partition.slides);
|
|
4677
4693
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4678
4694
|
setCanvasSize({
|
|
4679
|
-
width: parsed.width ??
|
|
4680
|
-
height: parsed.height ??
|
|
4695
|
+
width: parsed.width ?? chunkMA2BI7LX_js.DEFAULT_CANVAS_WIDTH,
|
|
4696
|
+
height: parsed.height ?? chunkMA2BI7LX_js.DEFAULT_CANVAS_HEIGHT
|
|
4681
4697
|
});
|
|
4682
4698
|
setSlideSizeEmu(
|
|
4683
4699
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4741,7 +4757,7 @@ function useLoadContent({
|
|
|
4741
4757
|
onContentApplied?.();
|
|
4742
4758
|
} catch (err) {
|
|
4743
4759
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4744
|
-
if (err instanceof
|
|
4760
|
+
if (err instanceof pptx$1.EncryptedFileError) {
|
|
4745
4761
|
setIsEncrypted(true);
|
|
4746
4762
|
} else {
|
|
4747
4763
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4780,9 +4796,15 @@ function useAutosave(input) {
|
|
|
4780
4796
|
const isDirtyRef = React17.useRef(isDirty);
|
|
4781
4797
|
const filePathRef = React17.useRef(filePath);
|
|
4782
4798
|
const serializeRef = React17.useRef(serializeSlides);
|
|
4799
|
+
const storageRef = React17.useRef(input.storage);
|
|
4800
|
+
storageRef.current = input.storage;
|
|
4783
4801
|
const isSavingRef = React17.useRef(false);
|
|
4784
4802
|
const changeSourcesRef = React17.useRef(getChangeSources);
|
|
4785
4803
|
const lastSnapshotRef = React17.useRef(void 0);
|
|
4804
|
+
const onSavedRef = React17.useRef(input.onSaved);
|
|
4805
|
+
React17.useEffect(() => {
|
|
4806
|
+
onSavedRef.current = input.onSaved;
|
|
4807
|
+
}, [input.onSaved]);
|
|
4786
4808
|
React17.useEffect(() => {
|
|
4787
4809
|
isDirtyRef.current = isDirty;
|
|
4788
4810
|
}, [isDirty]);
|
|
@@ -4819,9 +4841,10 @@ function useAutosave(input) {
|
|
|
4819
4841
|
isSavingRef.current = false;
|
|
4820
4842
|
return;
|
|
4821
4843
|
}
|
|
4822
|
-
await pptx.saveAutosaveSnapshot(path, data);
|
|
4844
|
+
await pptx.saveAutosaveSnapshot(path, data, storageRef.current);
|
|
4823
4845
|
lastSnapshotRef.current = pptx.autosaveSnapshotMark(path, sources);
|
|
4824
4846
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4847
|
+
onSavedRef.current?.(data);
|
|
4825
4848
|
} catch (err) {
|
|
4826
4849
|
setAutosaveStatus({
|
|
4827
4850
|
state: "error",
|
|
@@ -4866,7 +4889,7 @@ function useTextElementOperations(input) {
|
|
|
4866
4889
|
updateSelectedElement
|
|
4867
4890
|
} = input;
|
|
4868
4891
|
const liveTextSegments = React17.useCallback(() => {
|
|
4869
|
-
if (!selectedElement || !
|
|
4892
|
+
if (!selectedElement || !pptx$1.hasTextProperties(selectedElement)) {
|
|
4870
4893
|
return void 0;
|
|
4871
4894
|
}
|
|
4872
4895
|
if (selectedElement.id !== inlineEditingElementId) {
|
|
@@ -4884,7 +4907,7 @@ function useTextElementOperations(input) {
|
|
|
4884
4907
|
}, [selectedElement, inlineEditingElementId, inlineEditingText, inlineEditingSnapshotRef]);
|
|
4885
4908
|
const updateSelectedTextStyle = React17.useCallback(
|
|
4886
4909
|
(updates) => {
|
|
4887
|
-
if (!selectedElement || !
|
|
4910
|
+
if (!selectedElement || !pptx$1.hasTextProperties(selectedElement)) {
|
|
4888
4911
|
return;
|
|
4889
4912
|
}
|
|
4890
4913
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
@@ -4962,7 +4985,7 @@ function useTextElementOperations(input) {
|
|
|
4962
4985
|
);
|
|
4963
4986
|
const toggleSelectedBullets = React17.useCallback(
|
|
4964
4987
|
(kind) => {
|
|
4965
|
-
if (!selectedElement || !
|
|
4988
|
+
if (!selectedElement || !pptx$1.hasTextProperties(selectedElement)) {
|
|
4966
4989
|
return;
|
|
4967
4990
|
}
|
|
4968
4991
|
const currentSegments = liveTextSegments();
|
|
@@ -5013,7 +5036,7 @@ function useTextElementOperations(input) {
|
|
|
5013
5036
|
);
|
|
5014
5037
|
const updateSelectedTextCase = React17.useCallback(
|
|
5015
5038
|
(mode) => {
|
|
5016
|
-
if (!selectedElement || !
|
|
5039
|
+
if (!selectedElement || !pptx$1.hasTextProperties(selectedElement)) {
|
|
5017
5040
|
return;
|
|
5018
5041
|
}
|
|
5019
5042
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
@@ -5129,7 +5152,7 @@ function useElementOperations(input) {
|
|
|
5129
5152
|
);
|
|
5130
5153
|
return;
|
|
5131
5154
|
}
|
|
5132
|
-
if (
|
|
5155
|
+
if (chunkMA2BI7LX_js.isTemplateElementId(elementId)) {
|
|
5133
5156
|
const slideId = activeSlide?.id;
|
|
5134
5157
|
if (slideId) {
|
|
5135
5158
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -5165,7 +5188,7 @@ function useElementOperations(input) {
|
|
|
5165
5188
|
);
|
|
5166
5189
|
const updateSelectedShapeStyle = React17.useCallback(
|
|
5167
5190
|
(updates) => {
|
|
5168
|
-
if (!selectedElement || !
|
|
5191
|
+
if (!selectedElement || !pptx$1.hasShapeProperties(selectedElement)) {
|
|
5169
5192
|
return;
|
|
5170
5193
|
}
|
|
5171
5194
|
updateSelectedElement({
|
|
@@ -5369,15 +5392,15 @@ function syncSelectionHandleOverlay(elementNode, elementId, geometry) {
|
|
|
5369
5392
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
5370
5393
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
|
|
5371
5394
|
const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
|
|
5372
|
-
let resized = pptx.applyResize(startBox, handle, dx, dy, 1, { minSize:
|
|
5395
|
+
let resized = pptx.applyResize(startBox, handle, dx, dy, 1, { minSize: chunkMA2BI7LX_js.MIN_ELEMENT_SIZE });
|
|
5373
5396
|
if (lockAspect) {
|
|
5374
|
-
resized = pptx.lockResizeAspect(resized, startBox, handle,
|
|
5397
|
+
resized = pptx.lockResizeAspect(resized, startBox, handle, chunkMA2BI7LX_js.MIN_ELEMENT_SIZE);
|
|
5375
5398
|
}
|
|
5376
5399
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
5377
5400
|
if (!snapToGrid) {
|
|
5378
5401
|
return box;
|
|
5379
5402
|
}
|
|
5380
|
-
return pptx.snapBoxToGrid(box, handle, gridSpacingPx,
|
|
5403
|
+
return pptx.snapBoxToGrid(box, handle, gridSpacingPx, chunkMA2BI7LX_js.MIN_ELEMENT_SIZE);
|
|
5381
5404
|
}
|
|
5382
5405
|
function resolveLiveTarget(input) {
|
|
5383
5406
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -5490,7 +5513,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
5490
5513
|
width: el.width,
|
|
5491
5514
|
height: el.height
|
|
5492
5515
|
}));
|
|
5493
|
-
const snapResult =
|
|
5516
|
+
const snapResult = chunkMA2BI7LX_js.computeSnapToShape(
|
|
5494
5517
|
targetX,
|
|
5495
5518
|
targetY,
|
|
5496
5519
|
primaryEl.width,
|
|
@@ -5564,8 +5587,8 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
5564
5587
|
rs.lastY = geo.y;
|
|
5565
5588
|
rs.lastWidth = geo.width;
|
|
5566
5589
|
rs.lastHeight = geo.height;
|
|
5567
|
-
const width = Math.max(geo.width,
|
|
5568
|
-
const height = Math.max(geo.height,
|
|
5590
|
+
const width = Math.max(geo.width, chunkMA2BI7LX_js.MIN_ELEMENT_SIZE);
|
|
5591
|
+
const height = Math.max(geo.height, chunkMA2BI7LX_js.MIN_ELEMENT_SIZE);
|
|
5569
5592
|
if (rs.domEl) {
|
|
5570
5593
|
rs.domEl.style.left = `${geo.x}px`;
|
|
5571
5594
|
rs.domEl.style.top = `${geo.y}px`;
|
|
@@ -5658,13 +5681,13 @@ function processPointerUp(input) {
|
|
|
5658
5681
|
if (i !== activeSlideIndex) {
|
|
5659
5682
|
return s;
|
|
5660
5683
|
}
|
|
5661
|
-
const rerouted =
|
|
5684
|
+
const rerouted = chunkMA2BI7LX_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
5662
5685
|
if (rerouted.length === 0) {
|
|
5663
5686
|
return s;
|
|
5664
5687
|
}
|
|
5665
5688
|
return {
|
|
5666
5689
|
...s,
|
|
5667
|
-
elements:
|
|
5690
|
+
elements: chunkMA2BI7LX_js.applyReroutedConnectors(s.elements, rerouted)
|
|
5668
5691
|
};
|
|
5669
5692
|
})
|
|
5670
5693
|
);
|
|
@@ -5716,8 +5739,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
5716
5739
|
}
|
|
5717
5740
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
5718
5741
|
});
|
|
5719
|
-
const rerouted =
|
|
5720
|
-
return
|
|
5742
|
+
const rerouted = chunkMA2BI7LX_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
5743
|
+
return chunkMA2BI7LX_js.applyReroutedConnectors(movedElements, rerouted);
|
|
5721
5744
|
};
|
|
5722
5745
|
if (editTemplateMode) {
|
|
5723
5746
|
const slideId = activeSlide?.id;
|
|
@@ -5905,7 +5928,7 @@ function useCanvasInteractions(input) {
|
|
|
5905
5928
|
return;
|
|
5906
5929
|
}
|
|
5907
5930
|
const el = elementLookup.get(editId);
|
|
5908
|
-
if (el &&
|
|
5931
|
+
if (el && pptx$1.hasTextProperties(el)) {
|
|
5909
5932
|
const reader = inlineEditingReaderRef?.current;
|
|
5910
5933
|
const read = reader?.elementId === editId ? reader.read() : void 0;
|
|
5911
5934
|
if (read?.kind === "unsupported") {
|
|
@@ -5952,7 +5975,7 @@ function useCanvasInteractions(input) {
|
|
|
5952
5975
|
wasEditable.current = canEdit;
|
|
5953
5976
|
}, [canEdit]);
|
|
5954
5977
|
const openEquationEditorForElement = (el) => {
|
|
5955
|
-
if (!
|
|
5978
|
+
if (!pptx$1.hasTextProperties(el)) {
|
|
5956
5979
|
return false;
|
|
5957
5980
|
}
|
|
5958
5981
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5985,7 +6008,7 @@ function useCanvasInteractions(input) {
|
|
|
5985
6008
|
justInteractedRef.current = false;
|
|
5986
6009
|
} else {
|
|
5987
6010
|
const el = elementLookup.get(elementId);
|
|
5988
|
-
if (el &&
|
|
6011
|
+
if (el && pptx$1.hasTextProperties(el) && pptx.canInteractWithElement(el, "textEdit")) {
|
|
5989
6012
|
if (!openEquationEditorForElement(el)) {
|
|
5990
6013
|
pptx.setPendingCaretPoint(e);
|
|
5991
6014
|
setInlineEditingElementId(elementId);
|
|
@@ -6011,7 +6034,7 @@ function useCanvasInteractions(input) {
|
|
|
6011
6034
|
if (openEquationEditorForElement(el)) {
|
|
6012
6035
|
return;
|
|
6013
6036
|
}
|
|
6014
|
-
if (
|
|
6037
|
+
if (pptx$1.hasTextProperties(el) && pptx.canInteractWithElement(el, "textEdit")) {
|
|
6015
6038
|
setInlineEditingElementId(elementId);
|
|
6016
6039
|
setInlineEditingText(el.text ?? "");
|
|
6017
6040
|
}
|
|
@@ -6476,7 +6499,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
6476
6499
|
return;
|
|
6477
6500
|
}
|
|
6478
6501
|
const resolved = resolveHyperlinkEditResult(data);
|
|
6479
|
-
if (resolved.url && !
|
|
6502
|
+
if (resolved.url && !chunkMA2BI7LX_js.isUrlSafe(resolved.url)) {
|
|
6480
6503
|
return;
|
|
6481
6504
|
}
|
|
6482
6505
|
const actionClick = {
|
|
@@ -6522,11 +6545,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
6522
6545
|
if (!activeSlide) {
|
|
6523
6546
|
return;
|
|
6524
6547
|
}
|
|
6525
|
-
const preset =
|
|
6548
|
+
const preset = chunkMA2BI7LX_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
6526
6549
|
if (!preset) {
|
|
6527
6550
|
return;
|
|
6528
6551
|
}
|
|
6529
|
-
const defaultPptxAction =
|
|
6552
|
+
const defaultPptxAction = pptx$1.elementActionToPptxAction({
|
|
6530
6553
|
trigger: "click",
|
|
6531
6554
|
type: preset.defaultAction
|
|
6532
6555
|
});
|
|
@@ -6609,7 +6632,7 @@ function useInsertElements(input) {
|
|
|
6609
6632
|
width: 300,
|
|
6610
6633
|
height: 60,
|
|
6611
6634
|
text: "",
|
|
6612
|
-
textStyle: { fontSize:
|
|
6635
|
+
textStyle: { fontSize: chunkMA2BI7LX_js.DEFAULT_TEXT_FONT_SIZE }
|
|
6613
6636
|
});
|
|
6614
6637
|
};
|
|
6615
6638
|
const handleAddShape = () => {
|
|
@@ -6631,7 +6654,7 @@ function useInsertElements(input) {
|
|
|
6631
6654
|
}
|
|
6632
6655
|
});
|
|
6633
6656
|
};
|
|
6634
|
-
const handleAddTable = (rows =
|
|
6657
|
+
const handleAddTable = (rows = chunkMA2BI7LX_js.DEFAULT_TABLE_ROWS, columns = chunkMA2BI7LX_js.DEFAULT_TABLE_COLUMNS) => {
|
|
6635
6658
|
if (!activeSlide) {
|
|
6636
6659
|
return;
|
|
6637
6660
|
}
|
|
@@ -6805,7 +6828,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6805
6828
|
history
|
|
6806
6829
|
} = input;
|
|
6807
6830
|
const updateElementsOwning = (elementId, updater) => {
|
|
6808
|
-
if (editTemplateMode && !
|
|
6831
|
+
if (editTemplateMode && !chunkMA2BI7LX_js.isTemplateElementId(elementId)) {
|
|
6809
6832
|
ops.updateSlides(
|
|
6810
6833
|
(prev) => prev.map(
|
|
6811
6834
|
(slide, index) => index === activeSlideIndex ? { ...slide, elements: updater(slide.elements) } : slide
|
|
@@ -6839,9 +6862,9 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6839
6862
|
return;
|
|
6840
6863
|
}
|
|
6841
6864
|
const group = selectedElement;
|
|
6842
|
-
const intoTemplate =
|
|
6865
|
+
const intoTemplate = chunkMA2BI7LX_js.isTemplateElementId(group.id);
|
|
6843
6866
|
const childIds = group.children.map(
|
|
6844
|
-
(child) => intoTemplate ?
|
|
6867
|
+
(child) => intoTemplate ? chunkMA2BI7LX_js.makeCloneId(true, child.id || group.id) : child.id || pptx.generateElementId()
|
|
6845
6868
|
);
|
|
6846
6869
|
const { elements, childIds: usedIds } = pptx.ungroupElements(
|
|
6847
6870
|
ops.activeElements,
|
|
@@ -7173,7 +7196,7 @@ function useSlideManagement(input) {
|
|
|
7173
7196
|
if (!src) {
|
|
7174
7197
|
continue;
|
|
7175
7198
|
}
|
|
7176
|
-
const clone = { ...
|
|
7199
|
+
const clone = { ...pptx$1.duplicateSlide(src, next.length + 1), id: pptx.makeSlideId() };
|
|
7177
7200
|
next.splice(i + offset + 1, 0, clone);
|
|
7178
7201
|
offset++;
|
|
7179
7202
|
}
|
|
@@ -7277,7 +7300,7 @@ function createTableMergeHandlers(input) {
|
|
|
7277
7300
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
7278
7301
|
return;
|
|
7279
7302
|
}
|
|
7280
|
-
const newTableData =
|
|
7303
|
+
const newTableData = chunkMA2BI7LX_js.mergeCells(
|
|
7281
7304
|
[
|
|
7282
7305
|
{ row: rowIndex, col: columnIndex },
|
|
7283
7306
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -7285,7 +7308,7 @@ function createTableMergeHandlers(input) {
|
|
|
7285
7308
|
td
|
|
7286
7309
|
);
|
|
7287
7310
|
const updates = { tableData: newTableData };
|
|
7288
|
-
const newRawXml =
|
|
7311
|
+
const newRawXml = chunkMA2BI7LX_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7289
7312
|
if (newRawXml) {
|
|
7290
7313
|
updates.rawXml = newRawXml;
|
|
7291
7314
|
}
|
|
@@ -7311,7 +7334,7 @@ function createTableMergeHandlers(input) {
|
|
|
7311
7334
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
7312
7335
|
return;
|
|
7313
7336
|
}
|
|
7314
|
-
const newTableData =
|
|
7337
|
+
const newTableData = chunkMA2BI7LX_js.mergeCells(
|
|
7315
7338
|
[
|
|
7316
7339
|
{ row: rowIndex, col: columnIndex },
|
|
7317
7340
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -7319,7 +7342,7 @@ function createTableMergeHandlers(input) {
|
|
|
7319
7342
|
td
|
|
7320
7343
|
);
|
|
7321
7344
|
const updates = { tableData: newTableData };
|
|
7322
|
-
const newRawXml =
|
|
7345
|
+
const newRawXml = chunkMA2BI7LX_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7323
7346
|
if (newRawXml) {
|
|
7324
7347
|
updates.rawXml = newRawXml;
|
|
7325
7348
|
}
|
|
@@ -7334,9 +7357,9 @@ function createTableMergeHandlers(input) {
|
|
|
7334
7357
|
return;
|
|
7335
7358
|
}
|
|
7336
7359
|
const td = selectedElement.tableData;
|
|
7337
|
-
const newTableData =
|
|
7360
|
+
const newTableData = chunkMA2BI7LX_js.mergeCells(ts.selectedCells, td);
|
|
7338
7361
|
const updates = { tableData: newTableData };
|
|
7339
|
-
const newRawXml =
|
|
7362
|
+
const newRawXml = chunkMA2BI7LX_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7340
7363
|
if (newRawXml) {
|
|
7341
7364
|
updates.rawXml = newRawXml;
|
|
7342
7365
|
}
|
|
@@ -7353,9 +7376,9 @@ function createTableMergeHandlers(input) {
|
|
|
7353
7376
|
}
|
|
7354
7377
|
const { rowIndex, columnIndex } = ts;
|
|
7355
7378
|
const td = selectedElement.tableData;
|
|
7356
|
-
const newTableData =
|
|
7379
|
+
const newTableData = chunkMA2BI7LX_js.splitCell(rowIndex, columnIndex, td);
|
|
7357
7380
|
const updates = { tableData: newTableData };
|
|
7358
|
-
const newRawXml =
|
|
7381
|
+
const newRawXml = chunkMA2BI7LX_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7359
7382
|
if (newRawXml) {
|
|
7360
7383
|
updates.rawXml = newRawXml;
|
|
7361
7384
|
}
|
|
@@ -7390,7 +7413,7 @@ function createTableStructHandlers(input) {
|
|
|
7390
7413
|
updates.tableData = pptx.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
7391
7414
|
}
|
|
7392
7415
|
if (el.rawXml) {
|
|
7393
|
-
const newRawXml =
|
|
7416
|
+
const newRawXml = chunkMA2BI7LX_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
7394
7417
|
if (newRawXml) {
|
|
7395
7418
|
updates.rawXml = newRawXml;
|
|
7396
7419
|
}
|
|
@@ -7414,7 +7437,7 @@ function createTableStructHandlers(input) {
|
|
|
7414
7437
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
7415
7438
|
const updates = {};
|
|
7416
7439
|
if (selectedElement.rawXml) {
|
|
7417
|
-
const newRawXml =
|
|
7440
|
+
const newRawXml = chunkMA2BI7LX_js.updateCellTextStyleInRawXml(
|
|
7418
7441
|
selectedElement,
|
|
7419
7442
|
rowIndex,
|
|
7420
7443
|
colIndex,
|
|
@@ -7548,6 +7571,8 @@ function useExportSaveAs(input) {
|
|
|
7548
7571
|
slides,
|
|
7549
7572
|
templateElementsBySlideId,
|
|
7550
7573
|
filePath,
|
|
7574
|
+
storage,
|
|
7575
|
+
onSaveError,
|
|
7551
7576
|
serializeSlides,
|
|
7552
7577
|
headerFooter,
|
|
7553
7578
|
presentationProperties,
|
|
@@ -7563,25 +7588,32 @@ function useExportSaveAs(input) {
|
|
|
7563
7588
|
canvasSize,
|
|
7564
7589
|
slideSizeEmu
|
|
7565
7590
|
} = input;
|
|
7566
|
-
const handleSaveAsFormat = async (format) => {
|
|
7591
|
+
const handleSaveAsFormat = async (format, reason = "saveAs") => {
|
|
7567
7592
|
const downloadName = pptx.savedPresentationFileName(filePath, format);
|
|
7568
7593
|
try {
|
|
7569
7594
|
const data = await serializeSlides(format);
|
|
7570
7595
|
if (!data) {
|
|
7571
|
-
return;
|
|
7596
|
+
return false;
|
|
7572
7597
|
}
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7598
|
+
await pptx.deliverSavedPresentation({
|
|
7599
|
+
storage,
|
|
7600
|
+
bytes: data,
|
|
7601
|
+
format,
|
|
7602
|
+
fileName: downloadName,
|
|
7603
|
+
reason
|
|
7604
|
+
});
|
|
7605
|
+
return true;
|
|
7576
7606
|
} catch (err) {
|
|
7577
7607
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
7608
|
+
onSaveError?.(err);
|
|
7609
|
+
return false;
|
|
7578
7610
|
}
|
|
7579
7611
|
};
|
|
7580
7612
|
const handleExportJson = () => {
|
|
7581
7613
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7582
7614
|
const slideSize = pptx.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7583
7615
|
const data = {
|
|
7584
|
-
slides:
|
|
7616
|
+
slides: chunkMA2BI7LX_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7585
7617
|
width: canvasSize.width,
|
|
7586
7618
|
height: canvasSize.height,
|
|
7587
7619
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7605,6 +7637,9 @@ function useExportSaveAs(input) {
|
|
|
7605
7637
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7606
7638
|
}
|
|
7607
7639
|
};
|
|
7640
|
+
const handleSave = () => {
|
|
7641
|
+
void handleSaveAsFormat("pptx", "save");
|
|
7642
|
+
};
|
|
7608
7643
|
const handleSaveAsPptx = () => {
|
|
7609
7644
|
void handleSaveAsFormat("pptx");
|
|
7610
7645
|
};
|
|
@@ -7620,6 +7655,7 @@ function useExportSaveAs(input) {
|
|
|
7620
7655
|
return {
|
|
7621
7656
|
handleExportJson,
|
|
7622
7657
|
handleSaveAsFormat,
|
|
7658
|
+
handleSave,
|
|
7623
7659
|
handleSaveAsPptx,
|
|
7624
7660
|
handleSaveAsPpsx,
|
|
7625
7661
|
handleSaveAsPptm,
|
|
@@ -7739,7 +7775,7 @@ async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActi
|
|
|
7739
7775
|
}
|
|
7740
7776
|
function tilesToPdfPage(tilesResult) {
|
|
7741
7777
|
return tilesResult.tiles.map((tile) => ({
|
|
7742
|
-
image:
|
|
7778
|
+
image: chunkMA2BI7LX_js.canvasToJpegData(tile.canvas),
|
|
7743
7779
|
placement: pptx.placeTileOnPage(
|
|
7744
7780
|
tile,
|
|
7745
7781
|
tilesResult.fullWidth,
|
|
@@ -7772,7 +7808,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7772
7808
|
if (pages.length === 0) {
|
|
7773
7809
|
throw new Error(i18n.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7774
7810
|
}
|
|
7775
|
-
const pdfBlobUrl =
|
|
7811
|
+
const pdfBlobUrl = chunkMA2BI7LX_js.buildPdfFromTiledImageData(pages);
|
|
7776
7812
|
pptx.downloadDataUrl(pdfBlobUrl, filename);
|
|
7777
7813
|
}
|
|
7778
7814
|
async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, slideNotes, filename = "presentation-notes.pdf", options = {}) {
|
|
@@ -7802,7 +7838,7 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7802
7838
|
if (pages.length === 0) {
|
|
7803
7839
|
throw new Error(i18n.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7804
7840
|
}
|
|
7805
|
-
const pdfDataUrl =
|
|
7841
|
+
const pdfDataUrl = chunkMA2BI7LX_js.buildNotesPdf(pages);
|
|
7806
7842
|
pptx.downloadDataUrl(pdfDataUrl, filename);
|
|
7807
7843
|
}
|
|
7808
7844
|
async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
@@ -7949,8 +7985,6 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7949
7985
|
new Uint8Array(buf).set(gifBytes);
|
|
7950
7986
|
return new Blob([buf], { type: "image/gif" });
|
|
7951
7987
|
}
|
|
7952
|
-
|
|
7953
|
-
// src/viewer/utils/export-svg.ts
|
|
7954
7988
|
function injectFontFaces(svg, fontFaces) {
|
|
7955
7989
|
if (!fontFaces.length) {
|
|
7956
7990
|
return svg;
|
|
@@ -7997,7 +8031,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7997
8031
|
continue;
|
|
7998
8032
|
}
|
|
7999
8033
|
onProgress?.(processedCount, data.slides.length);
|
|
8000
|
-
let svg =
|
|
8034
|
+
let svg = pptx$1.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
8001
8035
|
if (embedFonts && fontFaces?.length) {
|
|
8002
8036
|
svg = injectFontFaces(svg, fontFaces);
|
|
8003
8037
|
}
|
|
@@ -8227,6 +8261,8 @@ function useExportHandlers(input) {
|
|
|
8227
8261
|
activeSlide,
|
|
8228
8262
|
activeSlideIndex,
|
|
8229
8263
|
filePath,
|
|
8264
|
+
storage,
|
|
8265
|
+
onSaveError,
|
|
8230
8266
|
canvasStageRef,
|
|
8231
8267
|
setActiveSlideIndex,
|
|
8232
8268
|
serializeSlides,
|
|
@@ -8280,6 +8316,7 @@ function useExportHandlers(input) {
|
|
|
8280
8316
|
const {
|
|
8281
8317
|
handleExportJson,
|
|
8282
8318
|
handleSaveAsFormat,
|
|
8319
|
+
handleSave,
|
|
8283
8320
|
handleSaveAsPptx,
|
|
8284
8321
|
handleSaveAsPpsx,
|
|
8285
8322
|
handleSaveAsPptm,
|
|
@@ -8288,6 +8325,8 @@ function useExportHandlers(input) {
|
|
|
8288
8325
|
slides,
|
|
8289
8326
|
templateElementsBySlideId,
|
|
8290
8327
|
filePath,
|
|
8328
|
+
storage,
|
|
8329
|
+
onSaveError,
|
|
8291
8330
|
serializeSlides,
|
|
8292
8331
|
headerFooter,
|
|
8293
8332
|
presentationProperties,
|
|
@@ -8388,6 +8427,7 @@ function useExportHandlers(input) {
|
|
|
8388
8427
|
handleExportGif,
|
|
8389
8428
|
handleExportJson,
|
|
8390
8429
|
handleSaveAsFormat,
|
|
8430
|
+
handleSave,
|
|
8391
8431
|
handleSaveAsPptx,
|
|
8392
8432
|
handleSaveAsPpsx,
|
|
8393
8433
|
handleSaveAsPptm,
|
|
@@ -8399,8 +8439,10 @@ function useExportHandlers(input) {
|
|
|
8399
8439
|
exportStatusMessage
|
|
8400
8440
|
};
|
|
8401
8441
|
}
|
|
8402
|
-
var ViewerOptionsContext = React17.createContext(pptx.DEFAULT_VIEWER_OPTIONS);
|
|
8403
|
-
var ViewerOptionsStoreContext = React17.createContext(
|
|
8442
|
+
var ViewerOptionsContext = /* @__PURE__ */ React17.createContext(pptx.DEFAULT_VIEWER_OPTIONS);
|
|
8443
|
+
var ViewerOptionsStoreContext = /* @__PURE__ */ React17.createContext(
|
|
8444
|
+
null
|
|
8445
|
+
);
|
|
8404
8446
|
function useViewerOptionsContext() {
|
|
8405
8447
|
return React17.useContext(ViewerOptionsContext);
|
|
8406
8448
|
}
|
|
@@ -8569,8 +8611,6 @@ function usePrintHandlers(input) {
|
|
|
8569
8611
|
setIsPrintDialogOpen
|
|
8570
8612
|
};
|
|
8571
8613
|
}
|
|
8572
|
-
|
|
8573
|
-
// src/viewer/hooks/theme-editor-apply.ts
|
|
8574
8614
|
async function applyThemeEditorEdit(input, { colorScheme, fontScheme, name }) {
|
|
8575
8615
|
const {
|
|
8576
8616
|
handlerRef,
|
|
@@ -8586,10 +8626,10 @@ async function applyThemeEditorEdit(input, { colorScheme, fontScheme, name }) {
|
|
|
8586
8626
|
return;
|
|
8587
8627
|
}
|
|
8588
8628
|
await handler.applyTheme(colorScheme, fontScheme, name);
|
|
8589
|
-
const previousMap = theme?.colorScheme ?
|
|
8629
|
+
const previousMap = theme?.colorScheme ? pptx$1.buildThemeColorMap(theme.colorScheme) : {};
|
|
8590
8630
|
bumpHistory();
|
|
8591
8631
|
setSlides(
|
|
8592
|
-
(slides) =>
|
|
8632
|
+
(slides) => pptx$1.applyThemeToData(
|
|
8593
8633
|
{ slides, theme, themeColorMap: previousMap },
|
|
8594
8634
|
colorScheme,
|
|
8595
8635
|
fontScheme,
|
|
@@ -8600,8 +8640,8 @@ async function applyThemeEditorEdit(input, { colorScheme, fontScheme, name }) {
|
|
|
8600
8640
|
(prev) => Object.fromEntries(
|
|
8601
8641
|
Object.entries(prev).map(([id, elements]) => [
|
|
8602
8642
|
id,
|
|
8603
|
-
|
|
8604
|
-
|
|
8643
|
+
pptx$1.reResolveElementFonts(
|
|
8644
|
+
pptx$1.reResolveElementColors(elements, previousMap, colorScheme),
|
|
8605
8645
|
theme?.fontScheme,
|
|
8606
8646
|
fontScheme
|
|
8607
8647
|
)
|
|
@@ -8659,13 +8699,13 @@ function useThemeHandlers(input) {
|
|
|
8659
8699
|
return;
|
|
8660
8700
|
}
|
|
8661
8701
|
await handler.updateThemeColorScheme(colorScheme);
|
|
8662
|
-
const previousMap = theme?.colorScheme ?
|
|
8663
|
-
setSlides((prev) =>
|
|
8702
|
+
const previousMap = theme?.colorScheme ? pptx$1.buildThemeColorMap(theme.colorScheme) : {};
|
|
8703
|
+
setSlides((prev) => pptx$1.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
8664
8704
|
if (Object.keys(templateElementsBySlideId).length > 0) {
|
|
8665
8705
|
setTemplateElementsBySlideId((prev) => {
|
|
8666
8706
|
const next = {};
|
|
8667
8707
|
for (const [slideId, elements] of Object.entries(prev)) {
|
|
8668
|
-
next[slideId] =
|
|
8708
|
+
next[slideId] = pptx$1.reResolveElementColors(elements, previousMap, colorScheme);
|
|
8669
8709
|
}
|
|
8670
8710
|
return next;
|
|
8671
8711
|
});
|
|
@@ -8776,7 +8816,7 @@ function useThemeSwitching(input) {
|
|
|
8776
8816
|
}
|
|
8777
8817
|
try {
|
|
8778
8818
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
8779
|
-
const newData =
|
|
8819
|
+
const newData = pptx$1.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
8780
8820
|
onDataChange(newData);
|
|
8781
8821
|
onThemeChanged?.(preset);
|
|
8782
8822
|
} catch (error) {
|
|
@@ -8793,7 +8833,7 @@ function useThemeSwitching(input) {
|
|
|
8793
8833
|
}
|
|
8794
8834
|
try {
|
|
8795
8835
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
8796
|
-
const newData =
|
|
8836
|
+
const newData = pptx$1.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
8797
8837
|
onDataChange(newData);
|
|
8798
8838
|
} catch (error) {
|
|
8799
8839
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -8805,12 +8845,12 @@ function useThemeSwitching(input) {
|
|
|
8805
8845
|
if (!data?.theme?.colorScheme) {
|
|
8806
8846
|
return void 0;
|
|
8807
8847
|
}
|
|
8808
|
-
return
|
|
8809
|
-
(p) =>
|
|
8848
|
+
return pptx$1.THEME_PRESETS.find(
|
|
8849
|
+
(p) => pptx$1.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
8810
8850
|
);
|
|
8811
8851
|
}, [data?.theme?.colorScheme]);
|
|
8812
8852
|
return {
|
|
8813
|
-
presets:
|
|
8853
|
+
presets: pptx$1.THEME_PRESETS,
|
|
8814
8854
|
switchToPreset,
|
|
8815
8855
|
switchToCustom,
|
|
8816
8856
|
currentPreset
|
|
@@ -8831,7 +8871,9 @@ function usePropertyHandlers(input) {
|
|
|
8831
8871
|
setSlides,
|
|
8832
8872
|
setIsDirty,
|
|
8833
8873
|
ops,
|
|
8834
|
-
history
|
|
8874
|
+
history,
|
|
8875
|
+
onPropertiesChange,
|
|
8876
|
+
onNotesUpdate
|
|
8835
8877
|
} = input;
|
|
8836
8878
|
const [isVersionHistoryOpen, setIsVersionHistoryOpen] = React17.useState(false);
|
|
8837
8879
|
const [isComparePanelOpen, setIsComparePanelOpen] = React17.useState(false);
|
|
@@ -8847,6 +8889,7 @@ function usePropertyHandlers(input) {
|
|
|
8847
8889
|
)
|
|
8848
8890
|
);
|
|
8849
8891
|
history.markDirty();
|
|
8892
|
+
onNotesUpdate?.(text);
|
|
8850
8893
|
};
|
|
8851
8894
|
const handleUpdateSlide = (updates) => {
|
|
8852
8895
|
ops.updateSlides(
|
|
@@ -8861,6 +8904,7 @@ function usePropertyHandlers(input) {
|
|
|
8861
8904
|
const handleUpdateCoreProperties = (updates) => {
|
|
8862
8905
|
setCoreProperties((prev) => ({ ...prev, ...updates }));
|
|
8863
8906
|
history.markDirty();
|
|
8907
|
+
onPropertiesChange?.(updates);
|
|
8864
8908
|
};
|
|
8865
8909
|
const handleUpdateAppProperties = (updates) => {
|
|
8866
8910
|
setAppProperties((prev) => ({ ...prev, ...updates }));
|
|
@@ -8887,7 +8931,7 @@ function usePropertyHandlers(input) {
|
|
|
8887
8931
|
}
|
|
8888
8932
|
try {
|
|
8889
8933
|
const ab = await file.arrayBuffer();
|
|
8890
|
-
const h = new
|
|
8934
|
+
const h = new pptx$1.PptxHandler();
|
|
8891
8935
|
const other = await h.load(ab);
|
|
8892
8936
|
if (!other) {
|
|
8893
8937
|
return;
|
|
@@ -8897,7 +8941,7 @@ function usePropertyHandlers(input) {
|
|
|
8897
8941
|
width: canvasSize.width,
|
|
8898
8942
|
height: canvasSize.height
|
|
8899
8943
|
};
|
|
8900
|
-
setCompareResult(
|
|
8944
|
+
setCompareResult(chunkMA2BI7LX_js.comparePresentation(cur, other));
|
|
8901
8945
|
setIsComparePanelOpen(true);
|
|
8902
8946
|
} catch (err) {
|
|
8903
8947
|
console.warn("Compare failed:", err);
|
|
@@ -9250,7 +9294,7 @@ function useViewerDialogs(input) {
|
|
|
9250
9294
|
};
|
|
9251
9295
|
}
|
|
9252
9296
|
function computeGridSpacingPx(documentGridSpacing) {
|
|
9253
|
-
return pptx.computeGridSpacingPx(documentGridSpacing,
|
|
9297
|
+
return pptx.computeGridSpacingPx(documentGridSpacing, chunkMA2BI7LX_js.GRID_SIZE);
|
|
9254
9298
|
}
|
|
9255
9299
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
9256
9300
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
@@ -9259,7 +9303,7 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, pre
|
|
|
9259
9303
|
}
|
|
9260
9304
|
function computeSlideSectionGroups(slides, sections) {
|
|
9261
9305
|
return pptx.groupSlidesBySection(sections, slides).map((group) => ({
|
|
9262
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
9306
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkMA2BI7LX_js.UNGROUPED_SECTION_ID : chunkMA2BI7LX_js.DEFAULT_SECTION_GROUP_ID),
|
|
9263
9307
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
9264
9308
|
slideIndexes: group.slideIndexes,
|
|
9265
9309
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -9304,10 +9348,10 @@ function useDerivedSlideState(input) {
|
|
|
9304
9348
|
);
|
|
9305
9349
|
const slideSectionGroups = React17.useMemo(
|
|
9306
9350
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
9307
|
-
if (group.id ===
|
|
9351
|
+
if (group.id === chunkMA2BI7LX_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
9308
9352
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
9309
9353
|
}
|
|
9310
|
-
if (group.id ===
|
|
9354
|
+
if (group.id === chunkMA2BI7LX_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
9311
9355
|
return { ...group, label: t("pptx.sections.slides") };
|
|
9312
9356
|
}
|
|
9313
9357
|
return group;
|
|
@@ -9414,7 +9458,7 @@ function useAnnotationHandlers(input) {
|
|
|
9414
9458
|
if (nextMode === "present") {
|
|
9415
9459
|
presentation.enterPresentMode();
|
|
9416
9460
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
9417
|
-
|
|
9461
|
+
chunkMA2BI7LX_js.stopAllPersistentAudio();
|
|
9418
9462
|
if (promptKeepInkAnnotations) {
|
|
9419
9463
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
9420
9464
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -9424,7 +9468,7 @@ function useAnnotationHandlers(input) {
|
|
|
9424
9468
|
}
|
|
9425
9469
|
} else {
|
|
9426
9470
|
if (mode === "present") {
|
|
9427
|
-
|
|
9471
|
+
chunkMA2BI7LX_js.stopAllPersistentAudio();
|
|
9428
9472
|
}
|
|
9429
9473
|
setMode(nextMode);
|
|
9430
9474
|
}
|
|
@@ -9495,7 +9539,7 @@ function overlayPendingInlineEdit(document2, elementId, text, snapshot, transfor
|
|
|
9495
9539
|
(slide) => !elementId ? slide : {
|
|
9496
9540
|
...slide,
|
|
9497
9541
|
elements: slide.elements.map(
|
|
9498
|
-
(element) => element.id === elementId &&
|
|
9542
|
+
(element) => element.id === elementId && pptx$1.hasTextProperties(element) ? {
|
|
9499
9543
|
...element,
|
|
9500
9544
|
text,
|
|
9501
9545
|
textSegments: pptx.remapTextToSegments(
|
|
@@ -9584,14 +9628,14 @@ function useSerialize(input) {
|
|
|
9584
9628
|
const pptxGuides = guides.map((g) => ({
|
|
9585
9629
|
id: g.id,
|
|
9586
9630
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
9587
|
-
positionEmu:
|
|
9631
|
+
positionEmu: pptx$1.guidePxToEmu(g.position)
|
|
9588
9632
|
}));
|
|
9589
9633
|
return {
|
|
9590
9634
|
...slide,
|
|
9591
9635
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
9592
9636
|
};
|
|
9593
9637
|
});
|
|
9594
|
-
const slidesToSave =
|
|
9638
|
+
const slidesToSave = chunkMA2BI7LX_js.buildSaveSlides(slidesWithGuides, pending.templateElementsBySlideId);
|
|
9595
9639
|
const saveOptions = pptx.buildDeckSaveOptions({
|
|
9596
9640
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
9597
9641
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
@@ -9661,6 +9705,12 @@ function useRecoveryDetection(input) {
|
|
|
9661
9705
|
const [prompt, setPrompt] = React17.useState(null);
|
|
9662
9706
|
const [discarding, setDiscarding] = React17.useState(false);
|
|
9663
9707
|
const onRestore = input.onRestore;
|
|
9708
|
+
const storageRef = React17.useRef(input.storage);
|
|
9709
|
+
storageRef.current = input.storage;
|
|
9710
|
+
const onOfferedRef = React17.useRef(input.onOffered);
|
|
9711
|
+
React17.useEffect(() => {
|
|
9712
|
+
onOfferedRef.current = input.onOffered;
|
|
9713
|
+
}, [input.onOffered]);
|
|
9664
9714
|
const openVersionHistory = input.openVersionHistory;
|
|
9665
9715
|
React17.useEffect(() => {
|
|
9666
9716
|
if (!pptx.shouldProbeAutosaveRecovery({
|
|
@@ -9675,12 +9725,18 @@ function useRecoveryDetection(input) {
|
|
|
9675
9725
|
}
|
|
9676
9726
|
recoveryCheckedRef.current = true;
|
|
9677
9727
|
void (async () => {
|
|
9678
|
-
const offer = await pptx.probeAutosaveRecovery(
|
|
9728
|
+
const offer = await pptx.probeAutosaveRecovery(
|
|
9729
|
+
filePath,
|
|
9730
|
+
Date.now(),
|
|
9731
|
+
fileName,
|
|
9732
|
+
storageRef.current
|
|
9733
|
+
);
|
|
9679
9734
|
if (!offer) {
|
|
9680
9735
|
return;
|
|
9681
9736
|
}
|
|
9682
9737
|
recordRef.current = offer.record;
|
|
9683
9738
|
setPrompt(offer.prompt);
|
|
9739
|
+
onOfferedRef.current?.(offer.record);
|
|
9684
9740
|
openVersionHistory?.();
|
|
9685
9741
|
})();
|
|
9686
9742
|
}, [filePath, fileName, loading, error, slideCount, autosaveAllowed, openVersionHistory]);
|
|
@@ -9710,7 +9766,7 @@ function useRecoveryDetection(input) {
|
|
|
9710
9766
|
setDiscarding(true);
|
|
9711
9767
|
void (async () => {
|
|
9712
9768
|
try {
|
|
9713
|
-
await pptx.discardAutosaveRecovery(record);
|
|
9769
|
+
await pptx.discardAutosaveRecovery(record, storageRef.current);
|
|
9714
9770
|
recordRef.current = null;
|
|
9715
9771
|
setPrompt(null);
|
|
9716
9772
|
} catch {
|
|
@@ -9772,7 +9828,7 @@ function usePresentationSetup(input) {
|
|
|
9772
9828
|
return;
|
|
9773
9829
|
}
|
|
9774
9830
|
if (mode === "present" && nextMode !== "present") {
|
|
9775
|
-
|
|
9831
|
+
chunkMA2BI7LX_js.stopAllPersistentAudio();
|
|
9776
9832
|
stopAnimationSound();
|
|
9777
9833
|
const exitHandler = exitModeHandlerRef.current;
|
|
9778
9834
|
if (exitHandler) {
|
|
@@ -9893,12 +9949,12 @@ function useCanvasImagePaste(input) {
|
|
|
9893
9949
|
);
|
|
9894
9950
|
}
|
|
9895
9951
|
function formatPatchFor(element, format) {
|
|
9896
|
-
const updated =
|
|
9952
|
+
const updated = chunkMA2BI7LX_js.applyFormatToElement(element, format);
|
|
9897
9953
|
const updates = {};
|
|
9898
|
-
if (
|
|
9954
|
+
if (pptx$1.hasShapeProperties(updated)) {
|
|
9899
9955
|
updates.shapeStyle = updated.shapeStyle;
|
|
9900
9956
|
}
|
|
9901
|
-
if (
|
|
9957
|
+
if (pptx$1.hasTextProperties(updated)) {
|
|
9902
9958
|
updates.textStyle = updated.textStyle;
|
|
9903
9959
|
}
|
|
9904
9960
|
return updates;
|
|
@@ -9916,7 +9972,7 @@ function useFormatPainterEditing(input) {
|
|
|
9916
9972
|
const prevFormatPainterRef = React17.useRef(false);
|
|
9917
9973
|
React17.useEffect(() => {
|
|
9918
9974
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9919
|
-
copiedFormatRef.current =
|
|
9975
|
+
copiedFormatRef.current = chunkMA2BI7LX_js.copyFormatFromElement(selectedElement);
|
|
9920
9976
|
} else if (!formatPainterActive) {
|
|
9921
9977
|
copiedFormatRef.current = null;
|
|
9922
9978
|
}
|
|
@@ -10358,6 +10414,8 @@ function useIOHandlers(input) {
|
|
|
10358
10414
|
activeSlideIndex,
|
|
10359
10415
|
canvasSize,
|
|
10360
10416
|
filePath,
|
|
10417
|
+
storage,
|
|
10418
|
+
onSaveError,
|
|
10361
10419
|
history,
|
|
10362
10420
|
ops,
|
|
10363
10421
|
zoom,
|
|
@@ -10366,6 +10424,8 @@ function useIOHandlers(input) {
|
|
|
10366
10424
|
serializeForRecovery,
|
|
10367
10425
|
setContent,
|
|
10368
10426
|
onContentChange,
|
|
10427
|
+
onPropertiesChange,
|
|
10428
|
+
onNotesUpdate,
|
|
10369
10429
|
imageExportScale,
|
|
10370
10430
|
imageResolutionScale
|
|
10371
10431
|
} = input;
|
|
@@ -10375,6 +10435,8 @@ function useIOHandlers(input) {
|
|
|
10375
10435
|
activeSlide: slides[activeSlideIndex],
|
|
10376
10436
|
activeSlideIndex,
|
|
10377
10437
|
filePath,
|
|
10438
|
+
storage,
|
|
10439
|
+
onSaveError,
|
|
10378
10440
|
canvasStageRef: zoom.canvasStageRef,
|
|
10379
10441
|
setActiveSlideIndex: state.setActiveSlideIndex,
|
|
10380
10442
|
serializeSlides,
|
|
@@ -10429,7 +10491,9 @@ function useIOHandlers(input) {
|
|
|
10429
10491
|
setSlides: state.setSlides,
|
|
10430
10492
|
setIsDirty: state.setIsDirty,
|
|
10431
10493
|
ops,
|
|
10432
|
-
history
|
|
10494
|
+
history,
|
|
10495
|
+
onPropertiesChange,
|
|
10496
|
+
onNotesUpdate
|
|
10433
10497
|
});
|
|
10434
10498
|
return { exportHandlers, printHandlers, themeHandlers, propertyHandlers };
|
|
10435
10499
|
}
|
|
@@ -10597,6 +10661,7 @@ function useContentLifecycle(input) {
|
|
|
10597
10661
|
filePath,
|
|
10598
10662
|
autosaveEnabled = true,
|
|
10599
10663
|
autosaveIntervalMs,
|
|
10664
|
+
storage,
|
|
10600
10665
|
embedFonts = true,
|
|
10601
10666
|
slides,
|
|
10602
10667
|
state,
|
|
@@ -10708,6 +10773,7 @@ function useContentLifecycle(input) {
|
|
|
10708
10773
|
const { autosaveStatus } = useAutosave({
|
|
10709
10774
|
isDirty: state.isDirty,
|
|
10710
10775
|
filePath,
|
|
10776
|
+
storage,
|
|
10711
10777
|
serializeSlides: serializeForRecovery,
|
|
10712
10778
|
enabled: autosaveEnabled,
|
|
10713
10779
|
...autosaveIntervalMs === void 0 ? {} : { intervalMs: autosaveIntervalMs },
|
|
@@ -10715,6 +10781,7 @@ function useContentLifecycle(input) {
|
|
|
10715
10781
|
// so a poll that finds all of them unchanged can skip re-serializing a
|
|
10716
10782
|
// deck it has already snapshotted. The two refs are read by `.current`
|
|
10717
10783
|
// because an inline edit in progress lives there and nowhere else yet.
|
|
10784
|
+
onSaved: input.onAutosave,
|
|
10718
10785
|
getChangeSources: () => [
|
|
10719
10786
|
slides,
|
|
10720
10787
|
state.templateElementsBySlideId,
|
|
@@ -11007,7 +11074,7 @@ function useKeyboardShortcutWiring(input) {
|
|
|
11007
11074
|
}
|
|
11008
11075
|
function stepSelectedFontSize(state, ops, direction) {
|
|
11009
11076
|
const selected = state.selectedElement;
|
|
11010
|
-
const currentPx = (selected &&
|
|
11077
|
+
const currentPx = (selected && pptx$1.hasTextProperties(selected) ? selected.textStyle?.fontSize : void 0) ?? pptx.textFontSizePtToPx(18);
|
|
11011
11078
|
const nextPt = pptx.stepFontSizePt(pptx.textFontSizePxToPt(currentPx), direction);
|
|
11012
11079
|
ops.updateSelectedTextStyle({ fontSize: pptx.textFontSizePtToPx(nextPt) });
|
|
11013
11080
|
}
|
|
@@ -11054,6 +11121,20 @@ function useElementUpdateBatch(input) {
|
|
|
11054
11121
|
);
|
|
11055
11122
|
}, []);
|
|
11056
11123
|
}
|
|
11124
|
+
function useReportOnChange(value, report, initial = value) {
|
|
11125
|
+
const last = React17.useRef(initial);
|
|
11126
|
+
const callback = React17.useRef(report);
|
|
11127
|
+
React17.useEffect(() => {
|
|
11128
|
+
callback.current = report;
|
|
11129
|
+
}, [report]);
|
|
11130
|
+
React17.useEffect(() => {
|
|
11131
|
+
if (Object.is(last.current, value)) {
|
|
11132
|
+
return;
|
|
11133
|
+
}
|
|
11134
|
+
last.current = value;
|
|
11135
|
+
callback.current?.(value);
|
|
11136
|
+
}, [value]);
|
|
11137
|
+
}
|
|
11057
11138
|
|
|
11058
11139
|
// src/viewer/hooks/useViewerIntegration.ts
|
|
11059
11140
|
function useViewerIntegration(input) {
|
|
@@ -11070,6 +11151,7 @@ function useViewerIntegration(input) {
|
|
|
11070
11151
|
content,
|
|
11071
11152
|
filePath,
|
|
11072
11153
|
fileName,
|
|
11154
|
+
storage,
|
|
11073
11155
|
autosaveEnabled,
|
|
11074
11156
|
autosaveAllowed = true,
|
|
11075
11157
|
autosaveIntervalMs,
|
|
@@ -11098,7 +11180,13 @@ function useViewerIntegration(input) {
|
|
|
11098
11180
|
onModeChange,
|
|
11099
11181
|
onZoomChange,
|
|
11100
11182
|
onSelectionChange,
|
|
11101
|
-
onSlideCountChange
|
|
11183
|
+
onSlideCountChange,
|
|
11184
|
+
onAutosave,
|
|
11185
|
+
onAutosaveStatus,
|
|
11186
|
+
onAutosaveRecovery,
|
|
11187
|
+
onPropertiesChange,
|
|
11188
|
+
onNotesUpdate,
|
|
11189
|
+
onPresentationChange
|
|
11102
11190
|
} = input;
|
|
11103
11191
|
usePointerHandlers({
|
|
11104
11192
|
editorScale: zoom.editorScale,
|
|
@@ -11136,8 +11224,10 @@ function useViewerIntegration(input) {
|
|
|
11136
11224
|
{
|
|
11137
11225
|
content,
|
|
11138
11226
|
filePath,
|
|
11227
|
+
storage,
|
|
11139
11228
|
autosaveEnabled,
|
|
11140
11229
|
autosaveIntervalMs,
|
|
11230
|
+
onAutosave,
|
|
11141
11231
|
// The File > Fonts toggle, finally reaching a save call.
|
|
11142
11232
|
embedFonts: dialogs.embedFontsEnabled,
|
|
11143
11233
|
slides,
|
|
@@ -11162,6 +11252,8 @@ function useViewerIntegration(input) {
|
|
|
11162
11252
|
activeSlideIndex,
|
|
11163
11253
|
canvasSize,
|
|
11164
11254
|
filePath,
|
|
11255
|
+
storage,
|
|
11256
|
+
onSaveError: input.onSaveError,
|
|
11165
11257
|
history,
|
|
11166
11258
|
ops: editorOps.ops,
|
|
11167
11259
|
zoom,
|
|
@@ -11170,6 +11262,8 @@ function useViewerIntegration(input) {
|
|
|
11170
11262
|
serializeForRecovery,
|
|
11171
11263
|
setContent,
|
|
11172
11264
|
onContentChange,
|
|
11265
|
+
onPropertiesChange,
|
|
11266
|
+
onNotesUpdate,
|
|
11173
11267
|
imageExportScale,
|
|
11174
11268
|
imageResolutionScale
|
|
11175
11269
|
});
|
|
@@ -11196,6 +11290,8 @@ function useViewerIntegration(input) {
|
|
|
11196
11290
|
error,
|
|
11197
11291
|
slideCount: slides.length,
|
|
11198
11292
|
autosaveAllowed,
|
|
11293
|
+
storage,
|
|
11294
|
+
onOffered: onAutosaveRecovery,
|
|
11199
11295
|
onRestore: setContent
|
|
11200
11296
|
});
|
|
11201
11297
|
const updateElements = useElementUpdateBatch(input);
|
|
@@ -11418,6 +11514,8 @@ function useViewerIntegration(input) {
|
|
|
11418
11514
|
onSlideCountChange(slides.length);
|
|
11419
11515
|
}
|
|
11420
11516
|
}, [slides.length, onSlideCountChange]);
|
|
11517
|
+
useReportOnChange(pptx.autosaveStatusKind(autosaveStatus), onAutosaveStatus);
|
|
11518
|
+
useReportOnChange(mode === "present", onPresentationChange);
|
|
11421
11519
|
useKeyboardShortcutWiring({
|
|
11422
11520
|
state,
|
|
11423
11521
|
mode,
|
|
@@ -11511,7 +11609,9 @@ function useViewerOptions() {
|
|
|
11511
11609
|
);
|
|
11512
11610
|
return { optionsStore: store, options };
|
|
11513
11611
|
}
|
|
11514
|
-
var KNOWN_TAB_IDS = new Set(
|
|
11612
|
+
var KNOWN_TAB_IDS = /* @__PURE__ */ new Set(
|
|
11613
|
+
/* @__PURE__ */ pptx.TOOLBAR_TABS.map((tab) => tab.id)
|
|
11614
|
+
);
|
|
11515
11615
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
11516
11616
|
const isHidden = (id) => pptx.isActionHidden(id, hiddenActions);
|
|
11517
11617
|
const userHidden = new Set(hiddenTabIds);
|
|
@@ -11558,19 +11658,25 @@ function useCollaborativeHistory({
|
|
|
11558
11658
|
function useCollaborationWriteBack(input) {
|
|
11559
11659
|
const latest = React17.useRef(input);
|
|
11560
11660
|
latest.current = input;
|
|
11561
|
-
const scheduler = React17.useMemo(
|
|
11562
|
-
|
|
11661
|
+
const scheduler = React17.useMemo(() => {
|
|
11662
|
+
const created = pptx.createWriteBackScheduler({
|
|
11563
11663
|
getYDoc: () => latest.current.doc,
|
|
11564
11664
|
getSourceBytes: () => latest.current.getSourceBytes?.() ?? null,
|
|
11565
11665
|
getSaveOptions: () => latest.current.getSaveOptions?.(),
|
|
11566
11666
|
getTemplateElements: () => latest.current.templateElementsBySlideId,
|
|
11567
|
-
mergeTemplateElements:
|
|
11568
|
-
|
|
11569
|
-
|
|
11570
|
-
|
|
11667
|
+
mergeTemplateElements: chunkMA2BI7LX_js.buildSaveSlides,
|
|
11668
|
+
onWriteBackStatus: () => latest.current.onWriteBackStatus?.(
|
|
11669
|
+
pptx.writeBackReport(latest.current.config, created.getState())
|
|
11670
|
+
)
|
|
11671
|
+
});
|
|
11672
|
+
return created;
|
|
11673
|
+
}, [latest]);
|
|
11571
11674
|
const hasWriteBack = Boolean(input.config?.onWriteBack);
|
|
11572
11675
|
React17.useEffect(
|
|
11573
|
-
() => () =>
|
|
11676
|
+
() => () => {
|
|
11677
|
+
scheduler.cancel();
|
|
11678
|
+
latest.current.onWriteBackStatus?.(void 0);
|
|
11679
|
+
},
|
|
11574
11680
|
[scheduler, input.doc, input.config?.role, hasWriteBack, input.config?.externalSession]
|
|
11575
11681
|
);
|
|
11576
11682
|
return React17.useCallback(() => {
|
|
@@ -11584,7 +11690,7 @@ function useCollaborationWriteBack(input) {
|
|
|
11584
11690
|
onWriteBack: config.onWriteBack ? (bytes) => {
|
|
11585
11691
|
const current = latest.current;
|
|
11586
11692
|
if (current.doc === doc && current.config?.role === "owner" && current.config.externalSession === session) {
|
|
11587
|
-
current.config.onWriteBack?.(bytes);
|
|
11693
|
+
return current.config.onWriteBack?.(bytes);
|
|
11588
11694
|
}
|
|
11589
11695
|
} : void 0
|
|
11590
11696
|
});
|
|
@@ -12117,8 +12223,8 @@ function useTouchGestures(input) {
|
|
|
12117
12223
|
}
|
|
12118
12224
|
const recognizer = pptx.createTouchGestureRecognizer({
|
|
12119
12225
|
getScale: () => scaleRef.current,
|
|
12120
|
-
minScale:
|
|
12121
|
-
maxScale:
|
|
12226
|
+
minScale: chunkMA2BI7LX_js.MIN_ZOOM_SCALE,
|
|
12227
|
+
maxScale: chunkMA2BI7LX_js.MAX_ZOOM_SCALE,
|
|
12122
12228
|
callbacks: {
|
|
12123
12229
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
12124
12230
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -12242,7 +12348,7 @@ function buildCanvasProps(input) {
|
|
|
12242
12348
|
if (pptx.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
12243
12349
|
return;
|
|
12244
12350
|
}
|
|
12245
|
-
|
|
12351
|
+
chunkMA2BI7LX_js.safeOpenUrl(url, target);
|
|
12246
12352
|
};
|
|
12247
12353
|
const handleActionClick = (elementId, action) => {
|
|
12248
12354
|
if (mode === "present") {
|
|
@@ -12257,9 +12363,9 @@ function buildCanvasProps(input) {
|
|
|
12257
12363
|
}
|
|
12258
12364
|
};
|
|
12259
12365
|
const handleHyperlinkClick = (url, target) => {
|
|
12260
|
-
if (
|
|
12366
|
+
if (chunkMA2BI7LX_js.isPpactionUrl(url)) {
|
|
12261
12367
|
if (mode === "present") {
|
|
12262
|
-
const parsed =
|
|
12368
|
+
const parsed = chunkMA2BI7LX_js.parsePpactionUrl(url);
|
|
12263
12369
|
if (parsed) {
|
|
12264
12370
|
presentation.handlePresentationAction({
|
|
12265
12371
|
action: parsed.action,
|
|
@@ -12607,6 +12713,7 @@ function buildToolbarProps(input) {
|
|
|
12607
12713
|
s.setIsDirty(true);
|
|
12608
12714
|
},
|
|
12609
12715
|
onOpenShareDialog,
|
|
12716
|
+
onSave: exportHandlers.handleSave,
|
|
12610
12717
|
onSaveAsPptx: exportHandlers.handleSaveAsPptx,
|
|
12611
12718
|
onSaveAsPpsx: exportHandlers.handleSaveAsPpsx,
|
|
12612
12719
|
onSaveAsPptm: exportHandlers.handleSaveAsPptm,
|
|
@@ -12685,7 +12792,7 @@ function buildToolbarProps(input) {
|
|
|
12685
12792
|
markDirty: history.markDirty
|
|
12686
12793
|
}),
|
|
12687
12794
|
formatPainterActive: s.formatPainterActive,
|
|
12688
|
-
canActivateFormatPainter:
|
|
12795
|
+
canActivateFormatPainter: chunkMA2BI7LX_js.hasCopyableFormat(selectedElement),
|
|
12689
12796
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
12690
12797
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
12691
12798
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -12865,7 +12972,8 @@ function useCollaborationDocumentSync(input) {
|
|
|
12865
12972
|
config,
|
|
12866
12973
|
livePatcher: state.livePatcher,
|
|
12867
12974
|
getSourceBytes,
|
|
12868
|
-
getSaveOptions
|
|
12975
|
+
getSaveOptions,
|
|
12976
|
+
...collaboration?.reportWriteBack ? { onWriteBackStatus: collaboration.reportWriteBack } : {}
|
|
12869
12977
|
});
|
|
12870
12978
|
const initialized = useCollaborationLivePatch({
|
|
12871
12979
|
patcher: state.livePatcher,
|
|
@@ -13008,7 +13116,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
13008
13116
|
documentGridSpacing: state.viewProperties?.gridSpacing
|
|
13009
13117
|
});
|
|
13010
13118
|
const themeColorMap = React17.useMemo(
|
|
13011
|
-
() => state.theme?.colorScheme ?
|
|
13119
|
+
() => state.theme?.colorScheme ? pptx$1.buildThemeColorMap(state.theme.colorScheme) : void 0,
|
|
13012
13120
|
[state.theme?.colorScheme]
|
|
13013
13121
|
);
|
|
13014
13122
|
const { presentation, annotations, actionSoundHandlerRef, setExitModeHandler } = usePresentationSetup({
|
|
@@ -13588,23 +13696,23 @@ function ColorChangedImage({
|
|
|
13588
13696
|
className,
|
|
13589
13697
|
alt
|
|
13590
13698
|
}) {
|
|
13591
|
-
const tolerance = tolerancePct ??
|
|
13592
|
-
const cacheKey =
|
|
13699
|
+
const tolerance = tolerancePct ?? chunkMA2BI7LX_js.DEFAULT_COLOR_CHANGE_TOLERANCE;
|
|
13700
|
+
const cacheKey = chunkMA2BI7LX_js.buildCacheKey(
|
|
13593
13701
|
src,
|
|
13594
13702
|
clrChange.clrFrom,
|
|
13595
13703
|
clrChange.clrTo,
|
|
13596
13704
|
tolerance,
|
|
13597
13705
|
Boolean(clrChange.clrToTransparent)
|
|
13598
13706
|
);
|
|
13599
|
-
const cached =
|
|
13707
|
+
const cached = chunkMA2BI7LX_js.getCachedResult(cacheKey);
|
|
13600
13708
|
const [processedSrc, setProcessedSrc] = React17.useState(cached ?? null);
|
|
13601
13709
|
React17.useEffect(() => {
|
|
13602
|
-
if (
|
|
13603
|
-
setProcessedSrc(
|
|
13710
|
+
if (chunkMA2BI7LX_js.getCachedResult(cacheKey)) {
|
|
13711
|
+
setProcessedSrc(chunkMA2BI7LX_js.getCachedResult(cacheKey) ?? null);
|
|
13604
13712
|
return;
|
|
13605
13713
|
}
|
|
13606
13714
|
let cancelled = false;
|
|
13607
|
-
|
|
13715
|
+
chunkMA2BI7LX_js.applyColorChange(
|
|
13608
13716
|
src,
|
|
13609
13717
|
clrChange.clrFrom,
|
|
13610
13718
|
clrChange.clrTo,
|
|
@@ -13612,7 +13720,7 @@ function ColorChangedImage({
|
|
|
13612
13720
|
Boolean(clrChange.clrToTransparent)
|
|
13613
13721
|
).then((result) => {
|
|
13614
13722
|
if (!cancelled) {
|
|
13615
|
-
|
|
13723
|
+
chunkMA2BI7LX_js.setCachedResult(cacheKey, result.dataUrl);
|
|
13616
13724
|
setProcessedSrc(result.dataUrl);
|
|
13617
13725
|
}
|
|
13618
13726
|
return void 0;
|
|
@@ -13704,7 +13812,7 @@ function TiledImageLayer({
|
|
|
13704
13812
|
cancelled = true;
|
|
13705
13813
|
};
|
|
13706
13814
|
}, [src]);
|
|
13707
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, style: { ...
|
|
13815
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, style: { ...chunkMA2BI7LX_js.getImageTilingStyle(element, nativeSize), ...style } });
|
|
13708
13816
|
}
|
|
13709
13817
|
function renderImageEffectDefinitions(element, excludeDuotone = false) {
|
|
13710
13818
|
return pptx.getImageSvgFilters(element).filter((definition) => !excludeDuotone || definition.id !== `duotone-${element.id}`).map((definition) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13773,7 +13881,7 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
13773
13881
|
...filter ? { filter } : {},
|
|
13774
13882
|
...opacity !== void 0 ? { opacity } : {}
|
|
13775
13883
|
};
|
|
13776
|
-
if (
|
|
13884
|
+
if (chunkMA2BI7LX_js.isImageTiled(el)) {
|
|
13777
13885
|
const tileSrc = imgSrc(el);
|
|
13778
13886
|
if (!tileSrc) {
|
|
13779
13887
|
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" });
|
|
@@ -13792,12 +13900,12 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
13792
13900
|
] });
|
|
13793
13901
|
}
|
|
13794
13902
|
const colorWash = pptx.getImageColorWashStyle(
|
|
13795
|
-
|
|
13903
|
+
pptx$1.isImageLikeElement(el) ? el.imageEffects?.colorWash : void 0
|
|
13796
13904
|
);
|
|
13797
13905
|
const clrChange = "imageEffects" in el ? el.imageEffects?.clrChange : void 0;
|
|
13798
|
-
const duotoneColors =
|
|
13906
|
+
const duotoneColors = chunkMA2BI7LX_js.getDuotoneColors(el);
|
|
13799
13907
|
const useDuotoneCanvas = Boolean(duotoneColors && !clrChange);
|
|
13800
|
-
const filterForImg = useDuotoneCanvas ?
|
|
13908
|
+
const filterForImg = useDuotoneCanvas ? chunkMA2BI7LX_js.getImageEffectsFilter(el, { excludeDuotone: true }) : filter;
|
|
13801
13909
|
const canvasEffectStyles = {
|
|
13802
13910
|
...filterForImg ? { filter: filterForImg } : {},
|
|
13803
13911
|
...opacity !== void 0 ? { opacity } : {}
|
|
@@ -13873,19 +13981,25 @@ function SlideBackgroundImageLayer({
|
|
|
13873
13981
|
style: { zIndex: 0 },
|
|
13874
13982
|
children: renderImg(
|
|
13875
13983
|
backgroundElement,
|
|
13876
|
-
|
|
13877
|
-
|
|
13984
|
+
chunkMA2BI7LX_js.getImageRenderStyle(backgroundElement),
|
|
13985
|
+
chunkMA2BI7LX_js.getImageEffectsFilter(backgroundElement),
|
|
13878
13986
|
"",
|
|
13879
|
-
|
|
13987
|
+
chunkMA2BI7LX_js.getImageEffectsOpacity(backgroundElement)
|
|
13880
13988
|
)
|
|
13881
13989
|
}
|
|
13882
13990
|
);
|
|
13883
13991
|
}
|
|
13884
|
-
|
|
13992
|
+
|
|
13993
|
+
// src/viewer/utils/display-name.ts
|
|
13994
|
+
function withDisplayName(component, displayName) {
|
|
13995
|
+
component.displayName = displayName;
|
|
13996
|
+
return component;
|
|
13997
|
+
}
|
|
13998
|
+
var ChartFormatContext = /* @__PURE__ */ React17.createContext(null);
|
|
13885
13999
|
function useChartFormatContext() {
|
|
13886
14000
|
return React17.useContext(ChartFormatContext);
|
|
13887
14001
|
}
|
|
13888
|
-
var ChartPartSelectionContext = React17.createContext({
|
|
14002
|
+
var ChartPartSelectionContext = /* @__PURE__ */ React17.createContext({
|
|
13889
14003
|
selection: null,
|
|
13890
14004
|
setSelection: () => {
|
|
13891
14005
|
}
|
|
@@ -13908,7 +14022,9 @@ var DEFAULT_RENDERING_3D_FLAGS = {
|
|
|
13908
14022
|
areaChart3D: false,
|
|
13909
14023
|
pieChart3D: false
|
|
13910
14024
|
};
|
|
13911
|
-
var Rendering3DFlagsContext = React17.createContext(
|
|
14025
|
+
var Rendering3DFlagsContext = /* @__PURE__ */ React17.createContext(
|
|
14026
|
+
DEFAULT_RENDERING_3D_FLAGS
|
|
14027
|
+
);
|
|
13912
14028
|
pptx.defineThreeViewElement();
|
|
13913
14029
|
function useThreeViewEvent(ref, type, handler) {
|
|
13914
14030
|
React17.useLayoutEffect(() => {
|
|
@@ -14154,7 +14270,7 @@ function ChartElementView({
|
|
|
14154
14270
|
pptx.getBarFacePicturePixelSampleVersion
|
|
14155
14271
|
);
|
|
14156
14272
|
const viewModel = React17.useMemo(() => {
|
|
14157
|
-
return canEdit ?
|
|
14273
|
+
return canEdit ? chunkMA2BI7LX_js.buildReactChartViewModel(element) : null;
|
|
14158
14274
|
}, [canEdit, element, barFacePictureSampleVersion]);
|
|
14159
14275
|
React17.useEffect(pptx.ensureChartInteractionStyles, []);
|
|
14160
14276
|
React17.useEffect(() => {
|
|
@@ -14259,9 +14375,9 @@ function ChartElementView({
|
|
|
14259
14375
|
textStyle: animationState?.textStyle,
|
|
14260
14376
|
onSelect: chart3D.onSelect,
|
|
14261
14377
|
onDrag: chart3D.onDrag,
|
|
14262
|
-
children:
|
|
14378
|
+
children: chunkMA2BI7LX_js.renderChartElement(renderedElement, (key) => t(key))
|
|
14263
14379
|
}
|
|
14264
|
-
) :
|
|
14380
|
+
) : chunkMA2BI7LX_js.renderChartElement(renderedElement, (key) => t(key)),
|
|
14265
14381
|
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) }),
|
|
14266
14382
|
titleDraft !== null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14267
14383
|
"input",
|
|
@@ -14430,26 +14546,26 @@ var rotateSize = "var(--pptx-react-rotate-default, 20px)";
|
|
|
14430
14546
|
var RESIZE_DEFAULT_CLASSES = "[--pptx-react-corner-default:12px] max-md:[--pptx-react-corner-default:22px] [--pptx-react-edge-length-default:20px] max-md:[--pptx-react-edge-length-default:32px] [--pptx-react-edge-thickness-default:8px] max-md:[--pptx-react-edge-thickness-default:12px]";
|
|
14431
14547
|
var ROTATE_DEFAULT_CLASSES = "[--pptx-react-rotate-default:20px] max-md:[--pptx-react-rotate-default:28px]";
|
|
14432
14548
|
var RESIZE_ARTWORK = {
|
|
14433
|
-
corner: pptx.getSelectionControlArtworkStyle("corner", {
|
|
14549
|
+
corner: /* @__PURE__ */ pptx.getSelectionControlArtworkStyle("corner", {
|
|
14434
14550
|
...appearance,
|
|
14435
14551
|
width: cornerSize,
|
|
14436
14552
|
height: cornerSize,
|
|
14437
14553
|
radius: "9999px"
|
|
14438
14554
|
}),
|
|
14439
|
-
horizontal: pptx.getSelectionControlArtworkStyle("horizontal-edge", {
|
|
14555
|
+
horizontal: /* @__PURE__ */ pptx.getSelectionControlArtworkStyle("horizontal-edge", {
|
|
14440
14556
|
...appearance,
|
|
14441
14557
|
width: edgeLength,
|
|
14442
14558
|
height: edgeThickness,
|
|
14443
14559
|
radius: "var(--radius-sm, 0.25rem)"
|
|
14444
14560
|
}),
|
|
14445
|
-
vertical: pptx.getSelectionControlArtworkStyle("vertical-edge", {
|
|
14561
|
+
vertical: /* @__PURE__ */ pptx.getSelectionControlArtworkStyle("vertical-edge", {
|
|
14446
14562
|
...appearance,
|
|
14447
14563
|
width: edgeThickness,
|
|
14448
14564
|
height: edgeLength,
|
|
14449
14565
|
radius: "var(--radius-sm, 0.25rem)"
|
|
14450
14566
|
})
|
|
14451
14567
|
};
|
|
14452
|
-
var ROTATE_ARTWORK = pptx.getSelectionControlArtworkStyle("rotate", {
|
|
14568
|
+
var ROTATE_ARTWORK = /* @__PURE__ */ pptx.getSelectionControlArtworkStyle("rotate", {
|
|
14453
14569
|
...appearance,
|
|
14454
14570
|
width: rotateSize,
|
|
14455
14571
|
height: rotateSize,
|
|
@@ -14591,7 +14707,7 @@ function ResizeHandles({
|
|
|
14591
14707
|
"aria-label": t("pptx.selectionOverlay.resize", { handle }),
|
|
14592
14708
|
"data-pptx-handle-kind": "resize",
|
|
14593
14709
|
"data-pptx-compact": true,
|
|
14594
|
-
className:
|
|
14710
|
+
className: chunkMA2BI7LX_js.cn(
|
|
14595
14711
|
"absolute z-10 group border-0 bg-transparent p-0",
|
|
14596
14712
|
RESIZE_DEFAULT_CLASSES,
|
|
14597
14713
|
posClass,
|
|
@@ -14617,7 +14733,7 @@ function ResizeHandles({
|
|
|
14617
14733
|
"div",
|
|
14618
14734
|
{
|
|
14619
14735
|
"data-pptx-handle-hit": true,
|
|
14620
|
-
className:
|
|
14736
|
+
className: chunkMA2BI7LX_js.cn(
|
|
14621
14737
|
"absolute -inset-px pointer-events-auto [--pptx-handle-hit-inset:-1px]",
|
|
14622
14738
|
corner ? "max-md:-inset-1.5 max-md:[--pptx-handle-hit-inset:-6px]" : "max-md:-inset-2 max-md:[--pptx-handle-hit-inset:-8px]"
|
|
14623
14739
|
),
|
|
@@ -14638,7 +14754,7 @@ function ResizeHandles({
|
|
|
14638
14754
|
"aria-label": t("pptx.selectionOverlay.rotate"),
|
|
14639
14755
|
"data-pptx-handle-kind": "rotate",
|
|
14640
14756
|
"data-pptx-compact": true,
|
|
14641
|
-
className:
|
|
14757
|
+
className: chunkMA2BI7LX_js.cn(
|
|
14642
14758
|
"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",
|
|
14643
14759
|
ROTATE_DEFAULT_CLASSES
|
|
14644
14760
|
),
|
|
@@ -14691,7 +14807,7 @@ function ResizeHandles({
|
|
|
14691
14807
|
))
|
|
14692
14808
|
] });
|
|
14693
14809
|
}
|
|
14694
|
-
var
|
|
14810
|
+
var ConnectorElementRendererMemo = /* @__PURE__ */ React17__default.default.memo(
|
|
14695
14811
|
// oxlint-disable-next-line prefer-arrow-callback -- named fn gives the memo component its displayName
|
|
14696
14812
|
function ConnectorElementRendererInner({
|
|
14697
14813
|
el,
|
|
@@ -14708,17 +14824,17 @@ var ConnectorElementRenderer = React17__default.default.memo(
|
|
|
14708
14824
|
animationState,
|
|
14709
14825
|
textStyleOverrideCss
|
|
14710
14826
|
}) {
|
|
14711
|
-
const shapeEl =
|
|
14827
|
+
const shapeEl = pptx$1.hasShapeProperties(el) ? el : void 0;
|
|
14712
14828
|
const viewWidth = Math.max(el.width, 0);
|
|
14713
14829
|
const viewHeight = Math.max(el.height, 0);
|
|
14714
14830
|
const svgWidth = Math.max(el.width, 1);
|
|
14715
14831
|
const svgHeight = Math.max(el.height, 1);
|
|
14716
14832
|
const ss = shapeEl?.shapeStyle;
|
|
14717
14833
|
const strokeWidth = Math.max(0, ss?.strokeWidth ?? 2);
|
|
14718
|
-
const strokeColor =
|
|
14719
|
-
const strokePaint =
|
|
14720
|
-
const dashType =
|
|
14721
|
-
const dashArray =
|
|
14834
|
+
const strokeColor = chunkMA2BI7LX_js.normalizeHexColor(ss?.strokeColor, chunkMA2BI7LX_js.DEFAULT_STROKE_COLOR);
|
|
14835
|
+
const strokePaint = chunkMA2BI7LX_js.colorWithOpacity(strokeColor, ss?.strokeOpacity);
|
|
14836
|
+
const dashType = chunkMA2BI7LX_js.normalizeStrokeDashType(ss?.strokeDash);
|
|
14837
|
+
const dashArray = chunkMA2BI7LX_js.getSvgStrokeDasharray(
|
|
14722
14838
|
dashType,
|
|
14723
14839
|
Math.max(strokeWidth, 1),
|
|
14724
14840
|
ss?.customDashSegments
|
|
@@ -14729,14 +14845,14 @@ var ConnectorElementRenderer = React17__default.default.memo(
|
|
|
14729
14845
|
const markerSeed = el.id.replace(/[^a-zA-Z0-9_-]/gu, "_");
|
|
14730
14846
|
const startMarkerId = `${markerSeed}-sel-start`;
|
|
14731
14847
|
const endMarkerId = `${markerSeed}-sel-end`;
|
|
14732
|
-
const compoundOffsets =
|
|
14733
|
-
const compoundWidths =
|
|
14848
|
+
const compoundOffsets = chunkMA2BI7LX_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
14849
|
+
const compoundWidths = chunkMA2BI7LX_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
14734
14850
|
const strokeCap = pptx.svgLineCap(ss?.lineCap);
|
|
14735
|
-
const textEl =
|
|
14851
|
+
const textEl = pptx$1.hasTextProperties(el) ? el : void 0;
|
|
14736
14852
|
const connectorText = textEl?.text?.trim() ?? "";
|
|
14737
14853
|
const connectorTextSegments = textEl?.textSegments;
|
|
14738
14854
|
const connectorTextStyle = textEl?.textStyle;
|
|
14739
|
-
const pathGeometry = shapeEl ?
|
|
14855
|
+
const pathGeometry = shapeEl ? chunkMA2BI7LX_js.getConnectorPathGeometry(shapeEl) : {
|
|
14740
14856
|
pathData: `M 0 0 L ${viewWidth} ${viewHeight}`,
|
|
14741
14857
|
startX: 0,
|
|
14742
14858
|
startY: 0,
|
|
@@ -14745,16 +14861,16 @@ var ConnectorElementRenderer = React17__default.default.memo(
|
|
|
14745
14861
|
};
|
|
14746
14862
|
const hitTargetWidth = Math.max(strokeWidth * 3, 14);
|
|
14747
14863
|
const selColor = selClr === "blue-400" ? "#60a5fa" : "#3b82f6";
|
|
14748
|
-
const lineShadow =
|
|
14749
|
-
const lineGlow =
|
|
14864
|
+
const lineShadow = chunkMA2BI7LX_js.buildLineShadowCss(el);
|
|
14865
|
+
const lineGlow = chunkMA2BI7LX_js.buildLineGlowFilter(el);
|
|
14750
14866
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14751
14867
|
"div",
|
|
14752
14868
|
{
|
|
14753
14869
|
"data-pptx-element": "true",
|
|
14754
14870
|
"data-element-id": el.id,
|
|
14755
|
-
role:
|
|
14756
|
-
"aria-label":
|
|
14757
|
-
"aria-roledescription":
|
|
14871
|
+
role: chunkMA2BI7LX_js.getAriaRole(el, { actionable: false }),
|
|
14872
|
+
"aria-label": chunkMA2BI7LX_js.getAriaLabel(el),
|
|
14873
|
+
"aria-roledescription": chunkMA2BI7LX_js.getAriaRoleDescription(el),
|
|
14758
14874
|
"aria-selected": isSelected ? true : void 0,
|
|
14759
14875
|
className: "absolute",
|
|
14760
14876
|
style: {
|
|
@@ -14787,14 +14903,14 @@ var ConnectorElementRenderer = React17__default.default.memo(
|
|
|
14787
14903
|
style: { overflow: "visible", pointerEvents: "none" },
|
|
14788
14904
|
children: [
|
|
14789
14905
|
/* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
|
|
14790
|
-
|
|
14906
|
+
chunkMA2BI7LX_js.renderConnectorMarker(
|
|
14791
14907
|
startMarkerId,
|
|
14792
14908
|
startArrow,
|
|
14793
14909
|
strokePaint,
|
|
14794
14910
|
ss?.connectorStartArrowWidth,
|
|
14795
14911
|
ss?.connectorStartArrowLength
|
|
14796
14912
|
),
|
|
14797
|
-
|
|
14913
|
+
chunkMA2BI7LX_js.renderConnectorMarker(
|
|
14798
14914
|
endMarkerId,
|
|
14799
14915
|
endArrow,
|
|
14800
14916
|
strokePaint,
|
|
@@ -14935,7 +15051,10 @@ var ConnectorElementRenderer = React17__default.default.memo(
|
|
|
14935
15051
|
);
|
|
14936
15052
|
}
|
|
14937
15053
|
);
|
|
14938
|
-
ConnectorElementRenderer
|
|
15054
|
+
var ConnectorElementRenderer = /* @__PURE__ */ withDisplayName(
|
|
15055
|
+
ConnectorElementRendererMemo,
|
|
15056
|
+
"ConnectorElementRenderer"
|
|
15057
|
+
);
|
|
14939
15058
|
function getElementInteractionProps({
|
|
14940
15059
|
element,
|
|
14941
15060
|
isEditableText,
|
|
@@ -15000,14 +15119,14 @@ function getElementInteractionProps({
|
|
|
15000
15119
|
};
|
|
15001
15120
|
}
|
|
15002
15121
|
function renderDagDuotoneFilterForElement(el) {
|
|
15003
|
-
if (!
|
|
15122
|
+
if (!chunkMA2BI7LX_js.hasDagDuotoneEffect(el)) {
|
|
15004
15123
|
return null;
|
|
15005
15124
|
}
|
|
15006
15125
|
const duotone = el.shapeStyle?.dagDuotone;
|
|
15007
15126
|
if (!duotone) {
|
|
15008
15127
|
return null;
|
|
15009
15128
|
}
|
|
15010
|
-
return
|
|
15129
|
+
return chunkMA2BI7LX_js.renderDagDuotoneSvgFilter(el.id, duotone.color1, duotone.color2);
|
|
15011
15130
|
}
|
|
15012
15131
|
function getContainerStyle({
|
|
15013
15132
|
el,
|
|
@@ -15020,7 +15139,7 @@ function getContainerStyle({
|
|
|
15020
15139
|
has3DExtrusion,
|
|
15021
15140
|
templateEditing
|
|
15022
15141
|
}) {
|
|
15023
|
-
const ss =
|
|
15142
|
+
const ss = pptx$1.hasShapeProperties(el) ? el.shapeStyle : void 0;
|
|
15024
15143
|
const isPicture = el.type === "picture" || el.type === "image";
|
|
15025
15144
|
const blurGrowVisible = Boolean(
|
|
15026
15145
|
ss?.blurGrow && typeof ss.blurRadius === "number" && ss.blurRadius > 0
|
|
@@ -15034,10 +15153,10 @@ function getContainerStyle({
|
|
|
15034
15153
|
top: isFullscreenMedia ? fs.top : el.y,
|
|
15035
15154
|
width: isFullscreenMedia ? fs.width : painted.width,
|
|
15036
15155
|
...heightStyle,
|
|
15037
|
-
transform: isFullscreenMedia ? fs.transform :
|
|
15156
|
+
transform: isFullscreenMedia ? fs.transform : chunkMA2BI7LX_js.getElementTransform(el),
|
|
15038
15157
|
transformOrigin: "center",
|
|
15039
15158
|
overflow: overflowValue,
|
|
15040
|
-
clipPath: isPicture ? void 0 : isImg && !has3DExtrusion ?
|
|
15159
|
+
clipPath: isPicture ? void 0 : isImg && !has3DExtrusion ? chunkMA2BI7LX_js.getCropShapeClipPath(el) : void 0,
|
|
15041
15160
|
zIndex: isFullscreenMedia ? fs.zIndex : zIndex,
|
|
15042
15161
|
visibility: animationState?.visible === false ? "hidden" : "visible",
|
|
15043
15162
|
animation: animationState?.cssAnimation,
|
|
@@ -15072,14 +15191,14 @@ function getContainerStyle({
|
|
|
15072
15191
|
};
|
|
15073
15192
|
}
|
|
15074
15193
|
function shapeParams(element) {
|
|
15075
|
-
const style =
|
|
15194
|
+
const style = pptx$1.hasShapeProperties(element) ? element.shapeStyle : void 0;
|
|
15076
15195
|
const strokeWidth = pptx.paintedStrokeWidth(style);
|
|
15077
|
-
const strokeColor =
|
|
15078
|
-
const fillColor =
|
|
15079
|
-
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(
|
|
15196
|
+
const strokeColor = chunkMA2BI7LX_js.normalizeHexColor(style?.strokeColor, chunkMA2BI7LX_js.DEFAULT_STROKE_COLOR);
|
|
15197
|
+
const fillColor = chunkMA2BI7LX_js.normalizeHexColor(style?.fillColor, chunkMA2BI7LX_js.DEFAULT_FILL_COLOR);
|
|
15198
|
+
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(chunkMA2BI7LX_js.buildCssGradientFromShapeStyle(style) || style?.fillGradient) || style?.fillMode === "pattern" && Boolean(style.fillPatternPreset);
|
|
15080
15199
|
return { hf: hasFill, fc: fillColor, sw: strokeWidth, sc: strokeColor };
|
|
15081
15200
|
}
|
|
15082
|
-
var
|
|
15201
|
+
var Extrusion3DOverlayMemo = /* @__PURE__ */ React17__default.default.memo(
|
|
15083
15202
|
// oxlint-disable-next-line prefer-arrow-callback -- named fn gives the memo component its displayName
|
|
15084
15203
|
function Extrusion3DOverlayInner({ data }) {
|
|
15085
15204
|
if (!data.hasExtrusion || data.panels.length === 0) {
|
|
@@ -15114,7 +15233,10 @@ var Extrusion3DOverlay = React17__default.default.memo(
|
|
|
15114
15233
|
] });
|
|
15115
15234
|
}
|
|
15116
15235
|
);
|
|
15117
|
-
Extrusion3DOverlay
|
|
15236
|
+
var Extrusion3DOverlay = /* @__PURE__ */ withDisplayName(
|
|
15237
|
+
Extrusion3DOverlayMemo,
|
|
15238
|
+
"Extrusion3DOverlay"
|
|
15239
|
+
);
|
|
15118
15240
|
|
|
15119
15241
|
// src/viewer/components/elements/scoped-element-handlers.ts
|
|
15120
15242
|
function getScopedElementHandlers(elementId, options) {
|
|
@@ -15181,7 +15303,7 @@ function ShapeEffectOverlay({
|
|
|
15181
15303
|
const fillOverlayStyle = overlay ? {
|
|
15182
15304
|
position: "absolute",
|
|
15183
15305
|
inset: 0,
|
|
15184
|
-
...
|
|
15306
|
+
...pptx$1.isImageLikeElement(element) ? chunkMA2BI7LX_js.getImageSurfaceMaskStyle(element) : {},
|
|
15185
15307
|
background: overlay.color,
|
|
15186
15308
|
mixBlendMode: overlay.blendMode,
|
|
15187
15309
|
pointerEvents: "none"
|
|
@@ -15324,7 +15446,7 @@ function ShapeEffectOverlay({
|
|
|
15324
15446
|
) : null
|
|
15325
15447
|
] });
|
|
15326
15448
|
}
|
|
15327
|
-
var ElementRenderer = React17__default.default.memo(
|
|
15449
|
+
var ElementRenderer = /* @__PURE__ */ React17__default.default.memo(
|
|
15328
15450
|
// oxlint-disable-next-line prefer-arrow-callback -- named fn gives the memo component its displayName
|
|
15329
15451
|
function ElementRendererInner({
|
|
15330
15452
|
element: el,
|
|
@@ -15388,10 +15510,10 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15388
15510
|
const backgroundAnimationState = pptx.getBackgroundAnimationState(el, presentationElementStates);
|
|
15389
15511
|
const effectPlacement = pptx.getShapeEffectLayerPlacement(el);
|
|
15390
15512
|
const visualAnimationState = backgroundAnimationState ?? animationState;
|
|
15391
|
-
const isTxt =
|
|
15392
|
-
const txtSE =
|
|
15513
|
+
const isTxt = chunkMA2BI7LX_js.isEditableTextElement(el) && allow.textEditable;
|
|
15514
|
+
const txtSE = pptx$1.hasTextProperties(el) ? el.textStyle : void 0;
|
|
15393
15515
|
const textStyleOverrideCss = pptx.buildTextStyleOverrideCss(el.id, visualAnimationState?.textStyle);
|
|
15394
|
-
const ss =
|
|
15516
|
+
const ss = chunkMA2BI7LX_js.getShapeVisualStyle(
|
|
15395
15517
|
el,
|
|
15396
15518
|
hf,
|
|
15397
15519
|
fc,
|
|
@@ -15400,9 +15522,9 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15400
15522
|
visualAnimationState?.animatesFill,
|
|
15401
15523
|
visualAnimationState?.animatesStroke
|
|
15402
15524
|
);
|
|
15403
|
-
const ts =
|
|
15525
|
+
const ts = chunkMA2BI7LX_js.getTextStyleForElement(el, chunkMA2BI7LX_js.DEFAULT_TEXT_COLOR);
|
|
15404
15526
|
const isImg = el.type === "picture" || el.type === "image";
|
|
15405
|
-
const vs =
|
|
15527
|
+
const vs = chunkMA2BI7LX_js.renderVectorShape(
|
|
15406
15528
|
el,
|
|
15407
15529
|
isImg ? false : hf,
|
|
15408
15530
|
fc,
|
|
@@ -15412,10 +15534,10 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15412
15534
|
visualAnimationState?.animatesStroke
|
|
15413
15535
|
);
|
|
15414
15536
|
const isModel3D = el.type === "model3d";
|
|
15415
|
-
const isConn =
|
|
15416
|
-
const shapeStyle3d =
|
|
15537
|
+
const isConn = chunkMA2BI7LX_js.isConnectorOrLineElement(el);
|
|
15538
|
+
const shapeStyle3d = pptx$1.hasShapeProperties(el) ? el.shapeStyle : void 0;
|
|
15417
15539
|
const extrusionData = React17.useMemo(
|
|
15418
|
-
() =>
|
|
15540
|
+
() => chunkMA2BI7LX_js.build3DExtrusionData(shapeStyle3d?.shape3d, shapeStyle3d?.scene3d, fc, el.width, el.height),
|
|
15419
15541
|
[shapeStyle3d?.shape3d, shapeStyle3d?.scene3d, fc, el.width, el.height]
|
|
15420
15542
|
);
|
|
15421
15543
|
const actionAffordance = useActionAffordance(el, canInteract);
|
|
@@ -15505,7 +15627,7 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15505
15627
|
"aria-hidden": aria.hidden ? true : void 0,
|
|
15506
15628
|
"aria-selected": isSelected ? true : void 0,
|
|
15507
15629
|
tabIndex: isFocusable ? 0 : -1,
|
|
15508
|
-
className:
|
|
15630
|
+
className: chunkMA2BI7LX_js.cn(
|
|
15509
15631
|
"absolute",
|
|
15510
15632
|
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",
|
|
15511
15633
|
cur,
|
|
@@ -15578,9 +15700,9 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15578
15700
|
txtSE,
|
|
15579
15701
|
txtS: ts,
|
|
15580
15702
|
vecShape: backgroundAnimationState && !isImg ? null : vs,
|
|
15581
|
-
imgStyle:
|
|
15582
|
-
imgFilter:
|
|
15583
|
-
imgOpacity:
|
|
15703
|
+
imgStyle: chunkMA2BI7LX_js.getImageRenderStyle(el),
|
|
15704
|
+
imgFilter: chunkMA2BI7LX_js.getImageEffectsFilter(el),
|
|
15705
|
+
imgOpacity: chunkMA2BI7LX_js.getImageEffectsOpacity(el),
|
|
15584
15706
|
imgAlt: imageAltText,
|
|
15585
15707
|
isTxtEl: isTxt,
|
|
15586
15708
|
media: mediaDataUrls,
|
|
@@ -15717,10 +15839,10 @@ function renderStrokeView(view, pressureSensitive, replayStyle, key) {
|
|
|
15717
15839
|
}
|
|
15718
15840
|
function renderInk(el, options) {
|
|
15719
15841
|
const replay = options?.replay ?? false;
|
|
15720
|
-
const strokes =
|
|
15842
|
+
const strokes = chunkMA2BI7LX_js.buildInkGroupStrokes(el, { color: "#000", width: 3 });
|
|
15721
15843
|
strokes.some((s) => s.circles || s.nibMarks);
|
|
15722
15844
|
const pressureSensitive = options?.pressureSensitive;
|
|
15723
|
-
const replayStyles = replay ?
|
|
15845
|
+
const replayStyles = replay ? chunkMA2BI7LX_js.getInkReplayStyles(el, options?.replayConfig) : null;
|
|
15724
15846
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15725
15847
|
"svg",
|
|
15726
15848
|
{
|
|
@@ -15728,7 +15850,7 @@ function renderInk(el, options) {
|
|
|
15728
15850
|
viewBox: `0 0 ${Math.max(el.width, 1)} ${Math.max(el.height, 1)}`,
|
|
15729
15851
|
preserveAspectRatio: "none",
|
|
15730
15852
|
children: [
|
|
15731
|
-
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children:
|
|
15853
|
+
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children: chunkMA2BI7LX_js.INK_REPLAY_KEYFRAMES }),
|
|
15732
15854
|
strokes.map(
|
|
15733
15855
|
(s, i) => renderStrokeView(s, pressureSensitive, replayStyles?.[i], `${el.id}-ink-${i}`)
|
|
15734
15856
|
)
|
|
@@ -15739,7 +15861,7 @@ function renderInk(el, options) {
|
|
|
15739
15861
|
function renderGroup(children, parentGroupFill) {
|
|
15740
15862
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full h-full pointer-events-none", children: pptx.filterRenderedElements(children).map((c, childIndex) => {
|
|
15741
15863
|
const { hf, fc, sw, sc } = shapeParams(c);
|
|
15742
|
-
const baseSs =
|
|
15864
|
+
const baseSs = chunkMA2BI7LX_js.getShapeVisualStyle(c, hf, fc, sw, sc);
|
|
15743
15865
|
const inheritedFill = pptx.resolveGroupChildFill(c, parentGroupFill);
|
|
15744
15866
|
const ss = inheritedFill ? {
|
|
15745
15867
|
...baseSs,
|
|
@@ -15750,9 +15872,9 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15750
15872
|
backgroundPosition: inheritedFill.backgroundPosition
|
|
15751
15873
|
} : baseSs;
|
|
15752
15874
|
const isI = c.type === "picture" || c.type === "image";
|
|
15753
|
-
const vs =
|
|
15754
|
-
const ts =
|
|
15755
|
-
const isTxt =
|
|
15875
|
+
const vs = chunkMA2BI7LX_js.renderVectorShape(c, isI ? false : hf, fc, sw, sc);
|
|
15876
|
+
const ts = chunkMA2BI7LX_js.getTextStyleForElement(c, chunkMA2BI7LX_js.DEFAULT_TEXT_COLOR);
|
|
15877
|
+
const isTxt = chunkMA2BI7LX_js.isEditableTextElement(c);
|
|
15756
15878
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15757
15879
|
"div",
|
|
15758
15880
|
{
|
|
@@ -15761,9 +15883,9 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15761
15883
|
style: {
|
|
15762
15884
|
left: c.x,
|
|
15763
15885
|
top: c.y,
|
|
15764
|
-
width: Math.max(c.width,
|
|
15765
|
-
height: Math.max(c.height,
|
|
15766
|
-
transform:
|
|
15886
|
+
width: Math.max(c.width, chunkMA2BI7LX_js.MIN_ELEMENT_SIZE),
|
|
15887
|
+
height: Math.max(c.height, chunkMA2BI7LX_js.MIN_ELEMENT_SIZE),
|
|
15888
|
+
transform: chunkMA2BI7LX_js.getElementTransform(c),
|
|
15767
15889
|
transformOrigin: "center",
|
|
15768
15890
|
...ss,
|
|
15769
15891
|
...isI ? {
|
|
@@ -15788,8 +15910,8 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15788
15910
|
// A nested group: recurse, chaining the inherited fill so a
|
|
15789
15911
|
// `grpFill` shape under a fill-less sub-group still paints.
|
|
15790
15912
|
renderGroup(c.children, pptx.getGroupChildParentFill(c, parentGroupFill))
|
|
15791
|
-
) : isI && ("svgData" in c && c.svgData || "imageData" in c && c.imageData) ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style:
|
|
15792
|
-
|
|
15913
|
+
) : isI && ("svgData" in c && c.svgData || "imageData" in c && c.imageData) ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style: chunkMA2BI7LX_js.getImageSurfaceStyle(c), children: [
|
|
15914
|
+
chunkMA2BI7LX_js.isImageTiled(c) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
15793
15915
|
TiledImageLayer,
|
|
15794
15916
|
{
|
|
15795
15917
|
element: c,
|
|
@@ -15802,7 +15924,7 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15802
15924
|
src: "svgData" in c && c.svgData ? c.svgData : c.imageData,
|
|
15803
15925
|
alt: i18n.translationsEn["pptx.ink.groupChildAlt"],
|
|
15804
15926
|
className: "pointer-events-none select-none",
|
|
15805
|
-
style:
|
|
15927
|
+
style: chunkMA2BI7LX_js.getImageRenderStyle(c),
|
|
15806
15928
|
draggable: false
|
|
15807
15929
|
}
|
|
15808
15930
|
),
|
|
@@ -15814,7 +15936,7 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15814
15936
|
{
|
|
15815
15937
|
className: "relative z-10 w-full h-full pointer-events-none whitespace-pre-wrap break-words leading-[1.3]",
|
|
15816
15938
|
style: ts,
|
|
15817
|
-
children:
|
|
15939
|
+
children: chunkMA2BI7LX_js.renderTextSegments(c, chunkMA2BI7LX_js.DEFAULT_TEXT_COLOR)
|
|
15818
15940
|
}
|
|
15819
15941
|
) : null
|
|
15820
15942
|
] })
|
|
@@ -15828,8 +15950,8 @@ function renderContentPart(el, options) {
|
|
|
15828
15950
|
if (el.inkStrokes && el.inkStrokes.length > 0) {
|
|
15829
15951
|
const replay = options?.replay ?? false;
|
|
15830
15952
|
const pressureSensitive = options?.pressureSensitive ?? true;
|
|
15831
|
-
const strokes =
|
|
15832
|
-
const replayStyles = replay ?
|
|
15953
|
+
const strokes = chunkMA2BI7LX_js.buildContentPartStrokes(el);
|
|
15954
|
+
const replayStyles = replay ? chunkMA2BI7LX_js.getContentPartReplayStyles(el.inkStrokes, options?.replayConfig) : null;
|
|
15833
15955
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15834
15956
|
"svg",
|
|
15835
15957
|
{
|
|
@@ -15837,7 +15959,7 @@ function renderContentPart(el, options) {
|
|
|
15837
15959
|
viewBox: `0 0 ${Math.max(el.width, 1)} ${Math.max(el.height, 1)}`,
|
|
15838
15960
|
preserveAspectRatio: "none",
|
|
15839
15961
|
children: [
|
|
15840
|
-
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children:
|
|
15962
|
+
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children: chunkMA2BI7LX_js.INK_REPLAY_KEYFRAMES }),
|
|
15841
15963
|
strokes.map(
|
|
15842
15964
|
(s, i) => renderStrokeView(s, pressureSensitive, replayStyles?.[i], `${el.id}-cp-ink-${i}`)
|
|
15843
15965
|
)
|
|
@@ -16037,7 +16159,7 @@ function renderOleBadge(oleType) {
|
|
|
16037
16159
|
)
|
|
16038
16160
|
] });
|
|
16039
16161
|
}
|
|
16040
|
-
var InlineCollaborationContext = React17.createContext(void 0);
|
|
16162
|
+
var InlineCollaborationContext = /* @__PURE__ */ React17.createContext(void 0);
|
|
16041
16163
|
|
|
16042
16164
|
// src/viewer/components/elements/useInlineListEditor.tsx
|
|
16043
16165
|
function useInlineListEditor(element, rootRef, onChange, onModelReplacement) {
|
|
@@ -16064,9 +16186,9 @@ function useInlineListEditor(element, rootRef, onChange, onModelReplacement) {
|
|
|
16064
16186
|
collaboration: connected,
|
|
16065
16187
|
model: pptx.createInlineListModelObserver(element),
|
|
16066
16188
|
activationSelection,
|
|
16067
|
-
children: seed && !connected ?
|
|
16189
|
+
children: seed && !connected ? chunkMA2BI7LX_js.renderTextSegments(
|
|
16068
16190
|
element,
|
|
16069
|
-
|
|
16191
|
+
chunkMA2BI7LX_js.DEFAULT_TEXT_COLOR,
|
|
16070
16192
|
void 0,
|
|
16071
16193
|
void 0,
|
|
16072
16194
|
void 0,
|
|
@@ -16236,7 +16358,7 @@ function InlineTextEditor({
|
|
|
16236
16358
|
seedRef.current = {
|
|
16237
16359
|
initialText,
|
|
16238
16360
|
hasRichSegments: Boolean(
|
|
16239
|
-
|
|
16361
|
+
pptx$1.hasTextProperties(element) && element.textSegments && element.textSegments.length > 0
|
|
16240
16362
|
)
|
|
16241
16363
|
};
|
|
16242
16364
|
}
|
|
@@ -16302,8 +16424,8 @@ function InlineTextEditor({
|
|
|
16302
16424
|
pending.endOffset
|
|
16303
16425
|
);
|
|
16304
16426
|
});
|
|
16305
|
-
const warpStyle =
|
|
16306
|
-
const compensationTransform =
|
|
16427
|
+
const warpStyle = chunkMA2BI7LX_js.getTextWarpStyle(textStyleRaw);
|
|
16428
|
+
const compensationTransform = chunkMA2BI7LX_js.getTextCompensationTransform(element);
|
|
16307
16429
|
const warpTransform = warpStyle?.transform;
|
|
16308
16430
|
const mergedTransform = [compensationTransform, warpTransform].filter(Boolean).join(" ") || void 0;
|
|
16309
16431
|
const wrapperStyle = {
|
|
@@ -16314,7 +16436,7 @@ function InlineTextEditor({
|
|
|
16314
16436
|
transformOrigin: warpStyle?.transformOrigin || "center"
|
|
16315
16437
|
};
|
|
16316
16438
|
const nextInlineStyleValue = (property) => {
|
|
16317
|
-
if (!
|
|
16439
|
+
if (!pptx$1.hasTextProperties(element)) {
|
|
16318
16440
|
return true;
|
|
16319
16441
|
}
|
|
16320
16442
|
const result = pptx.getInlineEditorSelectionResult(element.textSegments);
|
|
@@ -16391,7 +16513,7 @@ function InlineTextEditor({
|
|
|
16391
16513
|
const text = e.clipboardData.getData("text/plain");
|
|
16392
16514
|
document.execCommand("insertText", false, text);
|
|
16393
16515
|
},
|
|
16394
|
-
children: list.seed ? list.children : seed.hasRichSegments ?
|
|
16516
|
+
children: list.seed ? list.children : seed.hasRichSegments ? chunkMA2BI7LX_js.renderTextSegments(element, chunkMA2BI7LX_js.DEFAULT_TEXT_COLOR) : seed.initialText
|
|
16395
16517
|
},
|
|
16396
16518
|
list.seed?.paragraphs[0].token ?? "plain"
|
|
16397
16519
|
);
|
|
@@ -16399,10 +16521,10 @@ function InlineTextEditor({
|
|
|
16399
16521
|
function FailedToLoad() {
|
|
16400
16522
|
return null;
|
|
16401
16523
|
}
|
|
16402
|
-
var LazyModel3DScene = React17__default.default.lazy(
|
|
16524
|
+
var LazyModel3DScene = /* @__PURE__ */ React17__default.default.lazy(
|
|
16403
16525
|
async () => {
|
|
16404
16526
|
try {
|
|
16405
|
-
return await import('./Model3DScene-
|
|
16527
|
+
return await import('./Model3DScene-CCIG67DJ.js');
|
|
16406
16528
|
} catch {
|
|
16407
16529
|
return { default: FailedToLoad };
|
|
16408
16530
|
}
|
|
@@ -16483,7 +16605,7 @@ function Model3DRenderer({ element, width, height, interactive }) {
|
|
|
16483
16605
|
const [threeAvailable, setThreeAvailable] = React17.useState(null);
|
|
16484
16606
|
React17.useEffect(() => {
|
|
16485
16607
|
let cancelled = false;
|
|
16486
|
-
import('./three.module-
|
|
16608
|
+
import('./three.module-MBFHAT6M.js').then(() => {
|
|
16487
16609
|
if (!cancelled) {
|
|
16488
16610
|
setThreeAvailable(true);
|
|
16489
16611
|
}
|
|
@@ -17328,7 +17450,7 @@ function SmartArtRendererImpl({
|
|
|
17328
17450
|
if (!onUpdateElement || !pptx.shouldCommitSmartArtNodeText(smartArtData, nodeId, text)) {
|
|
17329
17451
|
return;
|
|
17330
17452
|
}
|
|
17331
|
-
const updated =
|
|
17453
|
+
const updated = pptx$1.updateSmartArtNodeText(smartArtData, nodeId, text);
|
|
17332
17454
|
const box = { width: element.width, height: element.height };
|
|
17333
17455
|
const reflowed = pptx.rebuildDrawingShapesIfCleared(
|
|
17334
17456
|
updated,
|
|
@@ -17344,7 +17466,7 @@ function SmartArtRendererImpl({
|
|
|
17344
17466
|
if (!onUpdateElement) {
|
|
17345
17467
|
return;
|
|
17346
17468
|
}
|
|
17347
|
-
const next =
|
|
17469
|
+
const next = pptx$1.setSmartArtNodeStyle(smartArtData, nodeId, { fillColor: fill });
|
|
17348
17470
|
if (next !== smartArtData) {
|
|
17349
17471
|
const box = { width: element.width, height: element.height };
|
|
17350
17472
|
const reflowed = pptx.rebuildDrawingShapesIfCleared(
|
|
@@ -17454,7 +17576,7 @@ function sameDiagramReveal(prev, next) {
|
|
|
17454
17576
|
}
|
|
17455
17577
|
return true;
|
|
17456
17578
|
}
|
|
17457
|
-
var SmartArtRenderer = React17__default.default.memo(SmartArtRendererImpl, arePropsEqual);
|
|
17579
|
+
var SmartArtRenderer = /* @__PURE__ */ React17__default.default.memo(SmartArtRendererImpl, arePropsEqual);
|
|
17458
17580
|
function SmartArt3DView({
|
|
17459
17581
|
element,
|
|
17460
17582
|
className,
|
|
@@ -17538,7 +17660,7 @@ function groupIntoParagraphs(element, fieldContext) {
|
|
|
17538
17660
|
element,
|
|
17539
17661
|
fieldContext ? (seg) => {
|
|
17540
17662
|
if (seg.fieldType) {
|
|
17541
|
-
const substituted =
|
|
17663
|
+
const substituted = chunkMA2BI7LX_js.substituteFieldText(
|
|
17542
17664
|
seg.text,
|
|
17543
17665
|
seg.fieldType,
|
|
17544
17666
|
fieldContext,
|
|
@@ -17573,13 +17695,13 @@ function getSegmentTspanProps(segment, element, fallbackColor) {
|
|
|
17573
17695
|
if (s.strikethrough) {
|
|
17574
17696
|
decos.push("line-through");
|
|
17575
17697
|
}
|
|
17576
|
-
const fill = s.hyperlink ?
|
|
17698
|
+
const fill = s.hyperlink ? chunkMA2BI7LX_js.normalizeHexColor(s.color || element.textStyle?.color, chunkMA2BI7LX_js.HYPERLINK_COLOR) : chunkMA2BI7LX_js.normalizeHexColor(s.color || element.textStyle?.color, fallbackColor);
|
|
17577
17699
|
return {
|
|
17578
17700
|
fill,
|
|
17579
|
-
fontSize: s.fontSize ?? element.textStyle?.fontSize ??
|
|
17701
|
+
fontSize: s.fontSize ?? element.textStyle?.fontSize ?? chunkMA2BI7LX_js.DEFAULT_TEXT_FONT_SIZE,
|
|
17580
17702
|
fontWeight: pptx.resolveFontWeight(s.fontFamily || element.textStyle?.fontFamily, s.bold),
|
|
17581
17703
|
fontStyle: pptx.resolveFontItalic(s.fontFamily || element.textStyle?.fontFamily, s.italic) ? "italic" : void 0,
|
|
17582
|
-
fontFamily: s.fontFamily || element.textStyle?.fontFamily ?
|
|
17704
|
+
fontFamily: s.fontFamily || element.textStyle?.fontFamily ? pptx$1.getSubstituteFontFamily(s.fontFamily || element.textStyle?.fontFamily || "") : chunkMA2BI7LX_js.DEFAULT_FONT_FAMILY,
|
|
17583
17705
|
textDecoration: decos.length > 0 ? decos.join(" ") : void 0
|
|
17584
17706
|
};
|
|
17585
17707
|
}
|
|
@@ -17587,8 +17709,8 @@ function resolveSegmentFont(segment, element) {
|
|
|
17587
17709
|
const s = segment.style || {};
|
|
17588
17710
|
const family = s.fontFamily || element.textStyle?.fontFamily;
|
|
17589
17711
|
return {
|
|
17590
|
-
fontFamily: family ?
|
|
17591
|
-
fontSizePx: s.fontSize ?? element.textStyle?.fontSize ??
|
|
17712
|
+
fontFamily: family ? pptx$1.getSubstituteFontFamily(family) : chunkMA2BI7LX_js.DEFAULT_FONT_FAMILY,
|
|
17713
|
+
fontSizePx: s.fontSize ?? element.textStyle?.fontSize ?? chunkMA2BI7LX_js.DEFAULT_TEXT_FONT_SIZE,
|
|
17592
17714
|
bold: s.bold ?? element.textStyle?.bold,
|
|
17593
17715
|
italic: s.italic ?? element.textStyle?.italic
|
|
17594
17716
|
};
|
|
@@ -17654,7 +17776,7 @@ function WarpedText({
|
|
|
17654
17776
|
fallbackColor,
|
|
17655
17777
|
fieldContext
|
|
17656
17778
|
}) {
|
|
17657
|
-
if (!
|
|
17779
|
+
if (!pptx$1.hasTextProperties(element)) {
|
|
17658
17780
|
return null;
|
|
17659
17781
|
}
|
|
17660
17782
|
const textEl = element;
|
|
@@ -17672,9 +17794,9 @@ function WarpedText({
|
|
|
17672
17794
|
const warpAdj2 = textEl.textStyle?.textWarpAdj2;
|
|
17673
17795
|
const align = textEl.textStyle?.align ?? "center";
|
|
17674
17796
|
const { startOffset, textAnchor } = getAlignmentProps(align);
|
|
17675
|
-
const baseFontSize = textEl.textStyle?.fontSize ??
|
|
17676
|
-
const baseFontFamily = textEl.textStyle?.fontFamily ?
|
|
17677
|
-
const baseFill =
|
|
17797
|
+
const baseFontSize = textEl.textStyle?.fontSize ?? chunkMA2BI7LX_js.DEFAULT_TEXT_FONT_SIZE;
|
|
17798
|
+
const baseFontFamily = textEl.textStyle?.fontFamily ? pptx$1.getSubstituteFontFamily(textEl.textStyle.fontFamily) : chunkMA2BI7LX_js.DEFAULT_FONT_FAMILY;
|
|
17799
|
+
const baseFill = chunkMA2BI7LX_js.normalizeHexColor(textEl.textStyle?.color, fallbackColor);
|
|
17678
17800
|
if (pptx.hasGlyphEnvelope(preset)) {
|
|
17679
17801
|
const perLine = pptx.buildGlyphEnvelopeBlock(
|
|
17680
17802
|
preset,
|
|
@@ -17773,11 +17895,15 @@ function WarpedText({
|
|
|
17773
17895
|
}
|
|
17774
17896
|
);
|
|
17775
17897
|
}
|
|
17776
|
-
var GLYPH_BY_SHAPE =
|
|
17777
|
-
|
|
17778
|
-
|
|
17779
|
-
|
|
17780
|
-
|
|
17898
|
+
var GLYPH_BY_SHAPE = /* @__PURE__ */ buildGlyphByShape();
|
|
17899
|
+
function buildGlyphByShape() {
|
|
17900
|
+
const glyphs = Object.fromEntries(
|
|
17901
|
+
chunkMA2BI7LX_js.ACTION_BUTTON_PRESETS.map((p) => [p.shapeType, p.iconPath])
|
|
17902
|
+
);
|
|
17903
|
+
glyphs["actionButtonForwardOrNext"] = glyphs["actionButtonForwardNext"];
|
|
17904
|
+
glyphs["actionButtonBackOrPrevious"] = glyphs["actionButtonBackPrevious"];
|
|
17905
|
+
return glyphs;
|
|
17906
|
+
}
|
|
17781
17907
|
function isActionButtonShape(shapeType) {
|
|
17782
17908
|
return Boolean(shapeType && shapeType in GLYPH_BY_SHAPE);
|
|
17783
17909
|
}
|
|
@@ -17844,11 +17970,11 @@ function renderTextElementBody(options) {
|
|
|
17844
17970
|
const isLinkedTextBox = pptx.isLinkedTextBox(el);
|
|
17845
17971
|
const linkedSegments = pptx.getOverflowSegments(el, slideElements);
|
|
17846
17972
|
const useSvgWarp = pptx.shouldUseSvgWarp(
|
|
17847
|
-
|
|
17973
|
+
pptx$1.hasTextProperties(el) ? el.textStyle?.textWarpPreset : void 0
|
|
17848
17974
|
);
|
|
17849
|
-
const scene3dStyle =
|
|
17975
|
+
const scene3dStyle = pptx$1.hasTextProperties(el) ? chunkMA2BI7LX_js.buildTextBody3DSceneStyle(el.textStyle, { width: el.width, height: el.height }) : void 0;
|
|
17850
17976
|
const rotationTransform = pptx.getTextBodyRotationTransform(el);
|
|
17851
|
-
const composedTransform = [rotationTransform,
|
|
17977
|
+
const composedTransform = [rotationTransform, chunkMA2BI7LX_js.getTextCompensationTransform(el), scene3dStyle?.transform].filter(Boolean).join(" ") || void 0;
|
|
17852
17978
|
const transformStyle = {
|
|
17853
17979
|
transform: composedTransform,
|
|
17854
17980
|
// A COM-measured homography (`scene3dStyle.transformOrigin === '0 0'`)
|
|
@@ -17878,18 +18004,18 @@ function renderTextElementBody(options) {
|
|
|
17878
18004
|
shouldRenderText && (useSvgWarp ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
17879
18005
|
"div",
|
|
17880
18006
|
{
|
|
17881
|
-
className:
|
|
18007
|
+
className: chunkMA2BI7LX_js.cn(
|
|
17882
18008
|
"relative z-10 w-full h-full",
|
|
17883
18009
|
onHyperlinkClick ? "" : "pointer-events-none"
|
|
17884
18010
|
),
|
|
17885
|
-
style: { ...
|
|
18011
|
+
style: { ...chunkMA2BI7LX_js.getTextLayoutStyle(el), ...transformStyle },
|
|
17886
18012
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17887
18013
|
WarpedText,
|
|
17888
18014
|
{
|
|
17889
18015
|
element: el,
|
|
17890
18016
|
width: el.width,
|
|
17891
18017
|
height: el.height,
|
|
17892
|
-
fallbackColor:
|
|
18018
|
+
fallbackColor: chunkMA2BI7LX_js.DEFAULT_TEXT_COLOR,
|
|
17893
18019
|
findHighlights: findHl,
|
|
17894
18020
|
fieldContext
|
|
17895
18021
|
}
|
|
@@ -17898,19 +18024,19 @@ function renderTextElementBody(options) {
|
|
|
17898
18024
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
17899
18025
|
"div",
|
|
17900
18026
|
{
|
|
17901
|
-
className:
|
|
18027
|
+
className: chunkMA2BI7LX_js.cn(
|
|
17902
18028
|
"relative z-10 w-full h-full whitespace-pre-wrap break-words leading-[1.3]",
|
|
17903
18029
|
onHyperlinkClick ? "" : "pointer-events-none"
|
|
17904
18030
|
),
|
|
17905
18031
|
style: {
|
|
17906
|
-
...
|
|
18032
|
+
...chunkMA2BI7LX_js.getTextLayoutStyle(el),
|
|
17907
18033
|
...txtS,
|
|
17908
|
-
...
|
|
18034
|
+
...chunkMA2BI7LX_js.getTextWarpStyle(txtSE),
|
|
17909
18035
|
...transformStyle
|
|
17910
18036
|
},
|
|
17911
|
-
children:
|
|
18037
|
+
children: chunkMA2BI7LX_js.renderTextSegments(
|
|
17912
18038
|
el,
|
|
17913
|
-
|
|
18039
|
+
chunkMA2BI7LX_js.DEFAULT_TEXT_COLOR,
|
|
17914
18040
|
void 0,
|
|
17915
18041
|
findHl,
|
|
17916
18042
|
onHyperlinkClick,
|
|
@@ -18229,7 +18355,7 @@ function renderBody(options) {
|
|
|
18229
18355
|
);
|
|
18230
18356
|
}
|
|
18231
18357
|
if (isImg) {
|
|
18232
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style:
|
|
18358
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style: chunkMA2BI7LX_js.getImageSurfaceStyle(el), children: [
|
|
18233
18359
|
renderImg(el, imgStyle, imgFilter, imgAlt, imgOpacity),
|
|
18234
18360
|
vecShape ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none absolute inset-0", children: vecShape }) : null
|
|
18235
18361
|
] });
|
|
@@ -18246,7 +18372,7 @@ function renderBody(options) {
|
|
|
18246
18372
|
textDirection: txtSE?.textDirection,
|
|
18247
18373
|
textStyle: txtS,
|
|
18248
18374
|
textStyleRaw: txtSE,
|
|
18249
|
-
layoutStyle:
|
|
18375
|
+
layoutStyle: chunkMA2BI7LX_js.getTextLayoutStyle(el),
|
|
18250
18376
|
element: el,
|
|
18251
18377
|
onCommit,
|
|
18252
18378
|
onCancel,
|
|
@@ -18257,7 +18383,7 @@ function renderBody(options) {
|
|
|
18257
18383
|
] });
|
|
18258
18384
|
}
|
|
18259
18385
|
if (el.type === "table") {
|
|
18260
|
-
return
|
|
18386
|
+
return chunkMA2BI7LX_js.renderTableElement(el, txtS, {
|
|
18261
18387
|
editable: isSel,
|
|
18262
18388
|
selectedCell: isSel ? tableSt : null,
|
|
18263
18389
|
onSelectCell: onCellSel,
|
|
@@ -18290,7 +18416,7 @@ function renderBody(options) {
|
|
|
18290
18416
|
);
|
|
18291
18417
|
}
|
|
18292
18418
|
if (el.type === "media") {
|
|
18293
|
-
return
|
|
18419
|
+
return chunkMA2BI7LX_js.renderMediaElement(el, media, {
|
|
18294
18420
|
// Present mode autoplays every media element on the active slide,
|
|
18295
18421
|
// not only ones persisted with their own `autoPlay` flag (matching
|
|
18296
18422
|
// the other four bindings' unconditional `presenting`-gated
|
|
@@ -18313,7 +18439,7 @@ function renderBody(options) {
|
|
|
18313
18439
|
onPlayStateChange: handleMediaPlayStateChange
|
|
18314
18440
|
});
|
|
18315
18441
|
}
|
|
18316
|
-
if (doInk &&
|
|
18442
|
+
if (doInk && pptx$1.isInkElement(el)) {
|
|
18317
18443
|
return renderInk(el, {
|
|
18318
18444
|
replay: isPresentationPassive,
|
|
18319
18445
|
pressureSensitive: true
|
|
@@ -18342,27 +18468,27 @@ function renderBody(options) {
|
|
|
18342
18468
|
}
|
|
18343
18469
|
return renderGroup(el.children, pptx.getGroupChildParentFill(el));
|
|
18344
18470
|
}
|
|
18345
|
-
if (
|
|
18346
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
18471
|
+
if (chunkMA2BI7LX_js.shouldRenderFallbackLabel(el, isTxtEl)) {
|
|
18472
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkMA2BI7LX_js.getElementLabel(el) });
|
|
18347
18473
|
}
|
|
18348
18474
|
return renderTextElementBody(options);
|
|
18349
18475
|
}
|
|
18350
18476
|
function defaultTextColorForFill(fillColor) {
|
|
18351
18477
|
const hex = String(fillColor ?? "").replace(/^#/u, "");
|
|
18352
18478
|
if (!/^[0-9a-f]{6}$/iu.test(hex)) {
|
|
18353
|
-
return
|
|
18479
|
+
return chunkMA2BI7LX_js.DEFAULT_TEXT_COLOR;
|
|
18354
18480
|
}
|
|
18355
18481
|
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);
|
|
18356
18482
|
const luminance = channels[0] * 0.2126 + channels[1] * 0.7152 + channels[2] * 0.0722;
|
|
18357
|
-
return luminance > 0.179 ?
|
|
18483
|
+
return luminance > 0.179 ? chunkMA2BI7LX_js.DEFAULT_TEXT_COLOR : "#ffffff";
|
|
18358
18484
|
}
|
|
18359
18485
|
function getStaticElementVisualState(element, parentGroupFill) {
|
|
18360
|
-
const style =
|
|
18361
|
-
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(
|
|
18362
|
-
const fill =
|
|
18486
|
+
const style = pptx$1.hasShapeProperties(element) ? element.shapeStyle : void 0;
|
|
18487
|
+
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(chunkMA2BI7LX_js.buildCssGradientFromShapeStyle(style) || style?.fillGradient) || style?.fillMode === "pattern" && Boolean(style.fillPatternPreset);
|
|
18488
|
+
const fill = chunkMA2BI7LX_js.normalizeHexColor(style?.fillColor, chunkMA2BI7LX_js.DEFAULT_FILL_COLOR);
|
|
18363
18489
|
const strokeWidth = pptx.paintedStrokeWidth(style);
|
|
18364
|
-
const stroke =
|
|
18365
|
-
const baseVisualStyle =
|
|
18490
|
+
const stroke = chunkMA2BI7LX_js.normalizeHexColor(style?.strokeColor, chunkMA2BI7LX_js.DEFAULT_STROKE_COLOR);
|
|
18491
|
+
const baseVisualStyle = chunkMA2BI7LX_js.getShapeVisualStyle(element, hasFill, fill, strokeWidth, stroke);
|
|
18366
18492
|
const inheritedFill = pptx.resolveGroupChildFill(element, parentGroupFill);
|
|
18367
18493
|
const visualStyle = inheritedFill ? {
|
|
18368
18494
|
...baseVisualStyle,
|
|
@@ -18372,13 +18498,13 @@ function getStaticElementVisualState(element, parentGroupFill) {
|
|
|
18372
18498
|
backgroundSize: inheritedFill.backgroundSize,
|
|
18373
18499
|
backgroundPosition: inheritedFill.backgroundPosition
|
|
18374
18500
|
} : baseVisualStyle;
|
|
18375
|
-
const textStyle =
|
|
18501
|
+
const textStyle = chunkMA2BI7LX_js.getTextStyleForElement(
|
|
18376
18502
|
element,
|
|
18377
|
-
element.type === "shape" && hasFill ? defaultTextColorForFill(fill) :
|
|
18503
|
+
element.type === "shape" && hasFill ? defaultTextColorForFill(fill) : chunkMA2BI7LX_js.DEFAULT_TEXT_COLOR
|
|
18378
18504
|
);
|
|
18379
18505
|
const isImage = element.type === "picture" || element.type === "image";
|
|
18380
|
-
const letsTextOverflow =
|
|
18381
|
-
const shapeType =
|
|
18506
|
+
const letsTextOverflow = pptx$1.hasTextProperties(element) && element.textStyle?.autoFitMode === "shrink" && (element.type === "text" || element.locks?.txBox === true);
|
|
18507
|
+
const shapeType = pptx$1.hasShapeProperties(element) ? element.shapeType : void 0;
|
|
18382
18508
|
const isCallout = pptx.isWedgeCalloutPresetShape(shapeType) || String(shapeType ?? "").toLowerCase().includes("callout");
|
|
18383
18509
|
return {
|
|
18384
18510
|
hasFill,
|
|
@@ -18399,7 +18525,7 @@ function getStaticElementInteractionState(element, hasActionHandler, exposeEleme
|
|
|
18399
18525
|
return { action, isActionable, contractRole };
|
|
18400
18526
|
}
|
|
18401
18527
|
function getStaticElementWrapperClassName(element, visual, positioned, isActionable) {
|
|
18402
|
-
const overflowClass = visual.isImage || visual.strokeWidth > 0 || element.type === "group" ||
|
|
18528
|
+
const overflowClass = visual.isImage || visual.strokeWidth > 0 || element.type === "group" || chunkMA2BI7LX_js.isConnectorOrLineElement(element) || visual.isCallout || visual.letsTextOverflow ? "" : "overflow-hidden";
|
|
18403
18529
|
const pointerClass = isActionable ? "pointer-events-auto cursor-pointer" : "pointer-events-none";
|
|
18404
18530
|
return `${positioned ? "absolute" : "relative"} ${overflowClass} ${pointerClass}`;
|
|
18405
18531
|
}
|
|
@@ -18482,7 +18608,7 @@ function StaticElementRendererImpl({
|
|
|
18482
18608
|
top: positioned ? element.y : void 0,
|
|
18483
18609
|
width: positioned ? Math.max(element.width, 1) : "100%",
|
|
18484
18610
|
height: positioned ? Math.max(element.height, 1) : "100%",
|
|
18485
|
-
transform: positioned ?
|
|
18611
|
+
transform: positioned ? chunkMA2BI7LX_js.getElementTransform(element) : void 0,
|
|
18486
18612
|
transformOrigin: "center",
|
|
18487
18613
|
zIndex,
|
|
18488
18614
|
...visualStyle,
|
|
@@ -18523,20 +18649,20 @@ function StaticElementRendererImpl({
|
|
|
18523
18649
|
isEditing: false,
|
|
18524
18650
|
editText: "",
|
|
18525
18651
|
spellCheck: false,
|
|
18526
|
-
txtSE:
|
|
18652
|
+
txtSE: pptx$1.hasTextProperties(element) ? element.textStyle : void 0,
|
|
18527
18653
|
txtS: textStyle,
|
|
18528
|
-
vecShape:
|
|
18654
|
+
vecShape: chunkMA2BI7LX_js.renderVectorShape(
|
|
18529
18655
|
element,
|
|
18530
18656
|
isImage ? false : hasFill,
|
|
18531
18657
|
fill,
|
|
18532
18658
|
strokeWidth,
|
|
18533
18659
|
stroke
|
|
18534
18660
|
),
|
|
18535
|
-
imgStyle: imageAnimation ? { ...
|
|
18536
|
-
imgFilter:
|
|
18537
|
-
imgOpacity:
|
|
18661
|
+
imgStyle: imageAnimation ? { ...chunkMA2BI7LX_js.getImageRenderStyle(element), animation: imageAnimation } : chunkMA2BI7LX_js.getImageRenderStyle(element),
|
|
18662
|
+
imgFilter: chunkMA2BI7LX_js.getImageEffectsFilter(element),
|
|
18663
|
+
imgOpacity: chunkMA2BI7LX_js.getImageEffectsOpacity(element),
|
|
18538
18664
|
imgAlt: "",
|
|
18539
|
-
isTxtEl:
|
|
18665
|
+
isTxtEl: chunkMA2BI7LX_js.isEditableTextElement(element),
|
|
18540
18666
|
media: mediaDataUrls,
|
|
18541
18667
|
tableSt: null,
|
|
18542
18668
|
isSel: false,
|
|
@@ -18565,8 +18691,10 @@ function StaticElementRendererImpl({
|
|
|
18565
18691
|
}
|
|
18566
18692
|
);
|
|
18567
18693
|
}
|
|
18568
|
-
var StaticElementRenderer =
|
|
18569
|
-
|
|
18694
|
+
var StaticElementRenderer = /* @__PURE__ */ withDisplayName(
|
|
18695
|
+
/* @__PURE__ */ React17__default.default.memo(StaticElementRendererImpl),
|
|
18696
|
+
"StaticElementRenderer"
|
|
18697
|
+
);
|
|
18570
18698
|
function SlideLayer({
|
|
18571
18699
|
slide,
|
|
18572
18700
|
templateElements,
|
|
@@ -18582,7 +18710,7 @@ function SlideLayer({
|
|
|
18582
18710
|
style: {
|
|
18583
18711
|
width: safeWidth,
|
|
18584
18712
|
height: safeHeight,
|
|
18585
|
-
backgroundColor: slide.backgroundColor ?
|
|
18713
|
+
backgroundColor: slide.backgroundColor ? chunkMA2BI7LX_js.normalizeHexColor(slide.backgroundColor, "#ffffff") : "#ffffff",
|
|
18586
18714
|
backgroundImage: slide.backgroundImage ? `url(${slide.backgroundImage})` : slide.backgroundGradient ? slide.backgroundGradient : void 0,
|
|
18587
18715
|
backgroundSize: slide.backgroundImage ? "cover" : void 0,
|
|
18588
18716
|
backgroundPosition: slide.backgroundImage ? "center" : void 0
|
|
@@ -19169,6 +19297,7 @@ exports.useReadOnlyRecommendationState = useReadOnlyRecommendationState;
|
|
|
19169
19297
|
exports.useRecoveryDetection = useRecoveryDetection;
|
|
19170
19298
|
exports.useReducedMotion = useReducedMotion;
|
|
19171
19299
|
exports.useRehearsalTimings = useRehearsalTimings;
|
|
19300
|
+
exports.useReportOnChange = useReportOnChange;
|
|
19172
19301
|
exports.useResizablePanels = useResizablePanels;
|
|
19173
19302
|
exports.useSectionOperations = useSectionOperations;
|
|
19174
19303
|
exports.useSerialize = useSerialize;
|
|
@@ -19195,3 +19324,4 @@ exports.useYjsDocumentSync = useYjsDocumentSync;
|
|
|
19195
19324
|
exports.useYjsProvider = useYjsProvider;
|
|
19196
19325
|
exports.useZoomNavigation = useZoomNavigation;
|
|
19197
19326
|
exports.useZoomViewport = useZoomViewport;
|
|
19327
|
+
exports.withDisplayName = withDisplayName;
|