pptx-react-viewer 4.46.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 +33 -0
- package/README.md +3 -0
- 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-UQFIRJGG.mjs → chunk-HDOR67HF.mjs} +226 -119
- 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-AMXSOQRH.js → chunk-MRSGNERC.js} +401 -292
- package/dist/chunk-MRSGNERC.js.br +0 -0
- package/dist/chunk-MRSGNERC.js.gz +0 -0
- package/dist/{chunk-CLHUOZSY.mjs → chunk-OWZSRPAH.mjs} +244 -160
- 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-2J3467IB.js → chunk-SSANGQ35.js} +546 -462
- 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 +42 -5
- 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 +66 -7
- 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 +44 -9
- 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-2J3467IB.js.br +0 -0
- package/dist/chunk-2J3467IB.js.gz +0 -0
- package/dist/chunk-AMXSOQRH.js.br +0 -0
- package/dist/chunk-AMXSOQRH.js.gz +0 -0
- package/dist/chunk-CLHUOZSY.mjs.br +0 -0
- package/dist/chunk-CLHUOZSY.mjs.gz +0 -0
- package/dist/chunk-FBN7UFW2.mjs.br +0 -0
- package/dist/chunk-FBN7UFW2.mjs.gz +0 -0
- package/dist/chunk-Q3DHYOLK.mjs.br +0 -0
- package/dist/chunk-Q3DHYOLK.mjs.gz +0 -0
- package/dist/chunk-UQFIRJGG.mjs.br +0 -0
- package/dist/chunk-UQFIRJGG.mjs.gz +0 -0
- package/dist/chunk-VJZJESNT.js.br +0 -0
- package/dist/chunk-VJZJESNT.js.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
|
}
|
|
@@ -601,7 +602,7 @@ function useCollaborativeState({
|
|
|
601
602
|
]
|
|
602
603
|
);
|
|
603
604
|
}
|
|
604
|
-
var CollaborationContext = React17.createContext(null);
|
|
605
|
+
var CollaborationContext = /* @__PURE__ */ React17.createContext(null);
|
|
605
606
|
function useCollaboration() {
|
|
606
607
|
return React17.useContext(CollaborationContext);
|
|
607
608
|
}
|
|
@@ -763,9 +764,9 @@ function serializeHistoryDocument(snapshot) {
|
|
|
763
764
|
}
|
|
764
765
|
function recordExplicitSlideUpdate(past, future, previous, before, label, maxDepth) {
|
|
765
766
|
if (previous && serializeHistoryDocument(previous) !== serializeHistoryDocument(before)) {
|
|
766
|
-
past.push(
|
|
767
|
+
past.push(chunkMA2BI7LX_js.cloneHistorySnapshot(previous));
|
|
767
768
|
}
|
|
768
|
-
past.push({ ...
|
|
769
|
+
past.push({ ...chunkMA2BI7LX_js.cloneHistorySnapshot(before), actionLabel: label });
|
|
769
770
|
while (past.length > Math.max(1, maxDepth)) {
|
|
770
771
|
past.shift();
|
|
771
772
|
}
|
|
@@ -855,8 +856,8 @@ function useEditorHistory(input) {
|
|
|
855
856
|
width: canvasSize.width,
|
|
856
857
|
height: canvasSize.height,
|
|
857
858
|
activeSlideIndex,
|
|
858
|
-
slides: slides.map(
|
|
859
|
-
templateElementsBySlideId:
|
|
859
|
+
slides: slides.map(chunkMA2BI7LX_js.cloneSlide),
|
|
860
|
+
templateElementsBySlideId: chunkMA2BI7LX_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
860
861
|
...actionLabel ? { actionLabel } : {}
|
|
861
862
|
};
|
|
862
863
|
},
|
|
@@ -869,9 +870,9 @@ function useEditorHistory(input) {
|
|
|
869
870
|
width: snapshot.width,
|
|
870
871
|
height: snapshot.height
|
|
871
872
|
});
|
|
872
|
-
setSlides(snapshot.slides.map(
|
|
873
|
+
setSlides(snapshot.slides.map(chunkMA2BI7LX_js.cloneSlide));
|
|
873
874
|
setTemplateElementsBySlideId(
|
|
874
|
-
|
|
875
|
+
chunkMA2BI7LX_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
875
876
|
);
|
|
876
877
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
877
878
|
setSelectedElementIds([]);
|
|
@@ -910,8 +911,8 @@ function useEditorHistory(input) {
|
|
|
910
911
|
const currentSnapshot = buildHistorySnapshot(previousSnapshot.actionLabel);
|
|
911
912
|
historyFutureRef.current.push(currentSnapshot);
|
|
912
913
|
isApplyingHistoryRef.current = true;
|
|
913
|
-
const nextSnapshot =
|
|
914
|
-
lastHistorySnapshotRef.current =
|
|
914
|
+
const nextSnapshot = chunkMA2BI7LX_js.cloneHistorySnapshot(previousSnapshot);
|
|
915
|
+
lastHistorySnapshotRef.current = chunkMA2BI7LX_js.cloneHistorySnapshot(nextSnapshot);
|
|
915
916
|
lastHistorySerializedRef.current = serializeHistoryDocument(nextSnapshot);
|
|
916
917
|
applyHistorySnapshot(nextSnapshot);
|
|
917
918
|
updateHistoryAvailability();
|
|
@@ -932,8 +933,8 @@ function useEditorHistory(input) {
|
|
|
932
933
|
const currentSnapshot = buildHistorySnapshot(nextSnapshot.actionLabel);
|
|
933
934
|
historyPastRef.current.push(currentSnapshot);
|
|
934
935
|
isApplyingHistoryRef.current = true;
|
|
935
|
-
const targetSnapshot =
|
|
936
|
-
lastHistorySnapshotRef.current =
|
|
936
|
+
const targetSnapshot = chunkMA2BI7LX_js.cloneHistorySnapshot(nextSnapshot);
|
|
937
|
+
lastHistorySnapshotRef.current = chunkMA2BI7LX_js.cloneHistorySnapshot(targetSnapshot);
|
|
937
938
|
lastHistorySerializedRef.current = serializeHistoryDocument(targetSnapshot);
|
|
938
939
|
applyHistorySnapshot(targetSnapshot);
|
|
939
940
|
updateHistoryAvailability();
|
|
@@ -951,7 +952,7 @@ function useEditorHistory(input) {
|
|
|
951
952
|
historyPastRef.current = [];
|
|
952
953
|
historyFutureRef.current = [];
|
|
953
954
|
if (initialSnapshot) {
|
|
954
|
-
const clonedInitial =
|
|
955
|
+
const clonedInitial = chunkMA2BI7LX_js.cloneHistorySnapshot(initialSnapshot);
|
|
955
956
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
956
957
|
lastHistorySerializedRef.current = serializeHistoryDocument(clonedInitial);
|
|
957
958
|
} else {
|
|
@@ -1033,8 +1034,8 @@ function useEditorHistory(input) {
|
|
|
1033
1034
|
updateHistoryAvailability
|
|
1034
1035
|
]);
|
|
1035
1036
|
const commitSlides = (nextSlides, label, beforeSlides = slides) => {
|
|
1036
|
-
const before = { ...buildHistorySnapshot(), slides: beforeSlides.map(
|
|
1037
|
-
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) };
|
|
1038
1039
|
recordExplicitSlideUpdate(
|
|
1039
1040
|
historyPastRef.current,
|
|
1040
1041
|
historyFutureRef.current,
|
|
@@ -1043,7 +1044,7 @@ function useEditorHistory(input) {
|
|
|
1043
1044
|
label,
|
|
1044
1045
|
maxHistoryEntries
|
|
1045
1046
|
);
|
|
1046
|
-
lastHistorySnapshotRef.current =
|
|
1047
|
+
lastHistorySnapshotRef.current = chunkMA2BI7LX_js.cloneHistorySnapshot(after);
|
|
1047
1048
|
lastHistorySerializedRef.current = serializeHistoryDocument(after);
|
|
1048
1049
|
isApplyingHistoryRef.current = false;
|
|
1049
1050
|
setSlides(nextSlides);
|
|
@@ -1086,6 +1087,7 @@ function useViewerStore(store, selector, isEqual = Object.is) {
|
|
|
1086
1087
|
);
|
|
1087
1088
|
return React17.useSyncExternalStore(subscribe2, getSnapshot2, getSnapshot2);
|
|
1088
1089
|
}
|
|
1090
|
+
var useBeforePaintEffect = typeof window === "undefined" ? React17.useEffect : React17.useLayoutEffect;
|
|
1089
1091
|
function useViewportFit(canvasSize, viewportRef, options, viewportNode) {
|
|
1090
1092
|
const [editorDimensions, setEditorDimensions] = React17.useState(null);
|
|
1091
1093
|
const { maxFitScale } = pptx.resolveViewportFitOptions(options, pptx.editorViewportFitFor(Infinity));
|
|
@@ -1098,7 +1100,7 @@ function useViewportFit(canvasSize, viewportRef, options, viewportNode) {
|
|
|
1098
1100
|
canvasHeight: canvasSize.height,
|
|
1099
1101
|
maxFitScale
|
|
1100
1102
|
});
|
|
1101
|
-
|
|
1103
|
+
useBeforePaintEffect(() => {
|
|
1102
1104
|
if (viewportNode === null) {
|
|
1103
1105
|
return;
|
|
1104
1106
|
}
|
|
@@ -1230,22 +1232,22 @@ function useZoomViewport({
|
|
|
1230
1232
|
selectedElements.forEach((element) => {
|
|
1231
1233
|
minX = Math.min(minX, element.x);
|
|
1232
1234
|
minY = Math.min(minY, element.y);
|
|
1233
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
1234
|
-
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));
|
|
1235
1237
|
});
|
|
1236
1238
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
1237
1239
|
return;
|
|
1238
1240
|
}
|
|
1239
1241
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
1240
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
1241
|
-
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);
|
|
1242
1244
|
const availableWidth = Math.max(
|
|
1243
|
-
effectiveEditorDimensions.width -
|
|
1244
|
-
|
|
1245
|
+
effectiveEditorDimensions.width - chunkMA2BI7LX_js.ZOOM_TO_SELECTION_PADDING,
|
|
1246
|
+
chunkMA2BI7LX_js.MIN_ELEMENT_SIZE
|
|
1245
1247
|
);
|
|
1246
1248
|
const availableHeight = Math.max(
|
|
1247
|
-
effectiveEditorDimensions.height -
|
|
1248
|
-
|
|
1249
|
+
effectiveEditorDimensions.height - chunkMA2BI7LX_js.ZOOM_TO_SELECTION_PADDING,
|
|
1250
|
+
chunkMA2BI7LX_js.MIN_ELEMENT_SIZE
|
|
1249
1251
|
);
|
|
1250
1252
|
const targetEditorScale = Math.min(
|
|
1251
1253
|
availableWidth / boundsWidth,
|
|
@@ -4212,8 +4214,8 @@ function useViewerCoreState(_input) {
|
|
|
4212
4214
|
const { slides, setSlides, slidesRef } = useSlideState();
|
|
4213
4215
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = React17.useState({});
|
|
4214
4216
|
const [canvasSize, setCanvasSize] = React17.useState({
|
|
4215
|
-
width:
|
|
4216
|
-
height:
|
|
4217
|
+
width: chunkMA2BI7LX_js.DEFAULT_CANVAS_WIDTH,
|
|
4218
|
+
height: chunkMA2BI7LX_js.DEFAULT_CANVAS_HEIGHT
|
|
4217
4219
|
});
|
|
4218
4220
|
const [slideSizeEmu, setSlideSizeEmu] = React17.useState();
|
|
4219
4221
|
const [activeSlideIndex, setActiveSlideIndex] = React17.useState(0);
|
|
@@ -4537,8 +4539,8 @@ function useViewerState(input) {
|
|
|
4537
4539
|
const crop = useCropSessionState();
|
|
4538
4540
|
return { ...core, ...ui, ...crop };
|
|
4539
4541
|
}
|
|
4540
|
-
var glyphOutlineFontCache = new pptx.GlyphOutlineFontCache();
|
|
4541
|
-
var getGlyphOutline = pptx.createGlyphOutlineLookup(glyphOutlineFontCache);
|
|
4542
|
+
var glyphOutlineFontCache = /* @__PURE__ */ new pptx.GlyphOutlineFontCache();
|
|
4543
|
+
var getGlyphOutline = /* @__PURE__ */ pptx.createGlyphOutlineLookup(glyphOutlineFontCache);
|
|
4542
4544
|
|
|
4543
4545
|
// src/viewer/hooks/useLoadContent.ts
|
|
4544
4546
|
function useLoadContent({
|
|
@@ -4601,7 +4603,7 @@ function useLoadContent({
|
|
|
4601
4603
|
}
|
|
4602
4604
|
let cancelled = false;
|
|
4603
4605
|
const token = ++renderTokenRef.current;
|
|
4604
|
-
const handler = new
|
|
4606
|
+
const handler = new pptx$1.PptxHandler();
|
|
4605
4607
|
const resources = pptx.createPresentationLoadResources(handler);
|
|
4606
4608
|
const loadBlobUrls = resources.blobUrls;
|
|
4607
4609
|
(async () => {
|
|
@@ -4686,12 +4688,12 @@ function useLoadContent({
|
|
|
4686
4688
|
}
|
|
4687
4689
|
resources.commit();
|
|
4688
4690
|
handlerRef.current = handler;
|
|
4689
|
-
const partition =
|
|
4691
|
+
const partition = chunkMA2BI7LX_js.partitionTemplateElements(nextSlides);
|
|
4690
4692
|
setSlides(partition.slides);
|
|
4691
4693
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4692
4694
|
setCanvasSize({
|
|
4693
|
-
width: parsed.width ??
|
|
4694
|
-
height: parsed.height ??
|
|
4695
|
+
width: parsed.width ?? chunkMA2BI7LX_js.DEFAULT_CANVAS_WIDTH,
|
|
4696
|
+
height: parsed.height ?? chunkMA2BI7LX_js.DEFAULT_CANVAS_HEIGHT
|
|
4695
4697
|
});
|
|
4696
4698
|
setSlideSizeEmu(
|
|
4697
4699
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4755,7 +4757,7 @@ function useLoadContent({
|
|
|
4755
4757
|
onContentApplied?.();
|
|
4756
4758
|
} catch (err) {
|
|
4757
4759
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4758
|
-
if (err instanceof
|
|
4760
|
+
if (err instanceof pptx$1.EncryptedFileError) {
|
|
4759
4761
|
setIsEncrypted(true);
|
|
4760
4762
|
} else {
|
|
4761
4763
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4794,9 +4796,15 @@ function useAutosave(input) {
|
|
|
4794
4796
|
const isDirtyRef = React17.useRef(isDirty);
|
|
4795
4797
|
const filePathRef = React17.useRef(filePath);
|
|
4796
4798
|
const serializeRef = React17.useRef(serializeSlides);
|
|
4799
|
+
const storageRef = React17.useRef(input.storage);
|
|
4800
|
+
storageRef.current = input.storage;
|
|
4797
4801
|
const isSavingRef = React17.useRef(false);
|
|
4798
4802
|
const changeSourcesRef = React17.useRef(getChangeSources);
|
|
4799
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]);
|
|
4800
4808
|
React17.useEffect(() => {
|
|
4801
4809
|
isDirtyRef.current = isDirty;
|
|
4802
4810
|
}, [isDirty]);
|
|
@@ -4833,9 +4841,10 @@ function useAutosave(input) {
|
|
|
4833
4841
|
isSavingRef.current = false;
|
|
4834
4842
|
return;
|
|
4835
4843
|
}
|
|
4836
|
-
await pptx.saveAutosaveSnapshot(path, data);
|
|
4844
|
+
await pptx.saveAutosaveSnapshot(path, data, storageRef.current);
|
|
4837
4845
|
lastSnapshotRef.current = pptx.autosaveSnapshotMark(path, sources);
|
|
4838
4846
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4847
|
+
onSavedRef.current?.(data);
|
|
4839
4848
|
} catch (err) {
|
|
4840
4849
|
setAutosaveStatus({
|
|
4841
4850
|
state: "error",
|
|
@@ -4880,7 +4889,7 @@ function useTextElementOperations(input) {
|
|
|
4880
4889
|
updateSelectedElement
|
|
4881
4890
|
} = input;
|
|
4882
4891
|
const liveTextSegments = React17.useCallback(() => {
|
|
4883
|
-
if (!selectedElement || !
|
|
4892
|
+
if (!selectedElement || !pptx$1.hasTextProperties(selectedElement)) {
|
|
4884
4893
|
return void 0;
|
|
4885
4894
|
}
|
|
4886
4895
|
if (selectedElement.id !== inlineEditingElementId) {
|
|
@@ -4898,7 +4907,7 @@ function useTextElementOperations(input) {
|
|
|
4898
4907
|
}, [selectedElement, inlineEditingElementId, inlineEditingText, inlineEditingSnapshotRef]);
|
|
4899
4908
|
const updateSelectedTextStyle = React17.useCallback(
|
|
4900
4909
|
(updates) => {
|
|
4901
|
-
if (!selectedElement || !
|
|
4910
|
+
if (!selectedElement || !pptx$1.hasTextProperties(selectedElement)) {
|
|
4902
4911
|
return;
|
|
4903
4912
|
}
|
|
4904
4913
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
@@ -4976,7 +4985,7 @@ function useTextElementOperations(input) {
|
|
|
4976
4985
|
);
|
|
4977
4986
|
const toggleSelectedBullets = React17.useCallback(
|
|
4978
4987
|
(kind) => {
|
|
4979
|
-
if (!selectedElement || !
|
|
4988
|
+
if (!selectedElement || !pptx$1.hasTextProperties(selectedElement)) {
|
|
4980
4989
|
return;
|
|
4981
4990
|
}
|
|
4982
4991
|
const currentSegments = liveTextSegments();
|
|
@@ -5027,7 +5036,7 @@ function useTextElementOperations(input) {
|
|
|
5027
5036
|
);
|
|
5028
5037
|
const updateSelectedTextCase = React17.useCallback(
|
|
5029
5038
|
(mode) => {
|
|
5030
|
-
if (!selectedElement || !
|
|
5039
|
+
if (!selectedElement || !pptx$1.hasTextProperties(selectedElement)) {
|
|
5031
5040
|
return;
|
|
5032
5041
|
}
|
|
5033
5042
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
@@ -5143,7 +5152,7 @@ function useElementOperations(input) {
|
|
|
5143
5152
|
);
|
|
5144
5153
|
return;
|
|
5145
5154
|
}
|
|
5146
|
-
if (
|
|
5155
|
+
if (chunkMA2BI7LX_js.isTemplateElementId(elementId)) {
|
|
5147
5156
|
const slideId = activeSlide?.id;
|
|
5148
5157
|
if (slideId) {
|
|
5149
5158
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -5179,7 +5188,7 @@ function useElementOperations(input) {
|
|
|
5179
5188
|
);
|
|
5180
5189
|
const updateSelectedShapeStyle = React17.useCallback(
|
|
5181
5190
|
(updates) => {
|
|
5182
|
-
if (!selectedElement || !
|
|
5191
|
+
if (!selectedElement || !pptx$1.hasShapeProperties(selectedElement)) {
|
|
5183
5192
|
return;
|
|
5184
5193
|
}
|
|
5185
5194
|
updateSelectedElement({
|
|
@@ -5383,15 +5392,15 @@ function syncSelectionHandleOverlay(elementNode, elementId, geometry) {
|
|
|
5383
5392
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
5384
5393
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
|
|
5385
5394
|
const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
|
|
5386
|
-
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 });
|
|
5387
5396
|
if (lockAspect) {
|
|
5388
|
-
resized = pptx.lockResizeAspect(resized, startBox, handle,
|
|
5397
|
+
resized = pptx.lockResizeAspect(resized, startBox, handle, chunkMA2BI7LX_js.MIN_ELEMENT_SIZE);
|
|
5389
5398
|
}
|
|
5390
5399
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
5391
5400
|
if (!snapToGrid) {
|
|
5392
5401
|
return box;
|
|
5393
5402
|
}
|
|
5394
|
-
return pptx.snapBoxToGrid(box, handle, gridSpacingPx,
|
|
5403
|
+
return pptx.snapBoxToGrid(box, handle, gridSpacingPx, chunkMA2BI7LX_js.MIN_ELEMENT_SIZE);
|
|
5395
5404
|
}
|
|
5396
5405
|
function resolveLiveTarget(input) {
|
|
5397
5406
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -5504,7 +5513,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
5504
5513
|
width: el.width,
|
|
5505
5514
|
height: el.height
|
|
5506
5515
|
}));
|
|
5507
|
-
const snapResult =
|
|
5516
|
+
const snapResult = chunkMA2BI7LX_js.computeSnapToShape(
|
|
5508
5517
|
targetX,
|
|
5509
5518
|
targetY,
|
|
5510
5519
|
primaryEl.width,
|
|
@@ -5578,8 +5587,8 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
5578
5587
|
rs.lastY = geo.y;
|
|
5579
5588
|
rs.lastWidth = geo.width;
|
|
5580
5589
|
rs.lastHeight = geo.height;
|
|
5581
|
-
const width = Math.max(geo.width,
|
|
5582
|
-
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);
|
|
5583
5592
|
if (rs.domEl) {
|
|
5584
5593
|
rs.domEl.style.left = `${geo.x}px`;
|
|
5585
5594
|
rs.domEl.style.top = `${geo.y}px`;
|
|
@@ -5672,13 +5681,13 @@ function processPointerUp(input) {
|
|
|
5672
5681
|
if (i !== activeSlideIndex) {
|
|
5673
5682
|
return s;
|
|
5674
5683
|
}
|
|
5675
|
-
const rerouted =
|
|
5684
|
+
const rerouted = chunkMA2BI7LX_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
5676
5685
|
if (rerouted.length === 0) {
|
|
5677
5686
|
return s;
|
|
5678
5687
|
}
|
|
5679
5688
|
return {
|
|
5680
5689
|
...s,
|
|
5681
|
-
elements:
|
|
5690
|
+
elements: chunkMA2BI7LX_js.applyReroutedConnectors(s.elements, rerouted)
|
|
5682
5691
|
};
|
|
5683
5692
|
})
|
|
5684
5693
|
);
|
|
@@ -5730,8 +5739,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
5730
5739
|
}
|
|
5731
5740
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
5732
5741
|
});
|
|
5733
|
-
const rerouted =
|
|
5734
|
-
return
|
|
5742
|
+
const rerouted = chunkMA2BI7LX_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
5743
|
+
return chunkMA2BI7LX_js.applyReroutedConnectors(movedElements, rerouted);
|
|
5735
5744
|
};
|
|
5736
5745
|
if (editTemplateMode) {
|
|
5737
5746
|
const slideId = activeSlide?.id;
|
|
@@ -5919,7 +5928,7 @@ function useCanvasInteractions(input) {
|
|
|
5919
5928
|
return;
|
|
5920
5929
|
}
|
|
5921
5930
|
const el = elementLookup.get(editId);
|
|
5922
|
-
if (el &&
|
|
5931
|
+
if (el && pptx$1.hasTextProperties(el)) {
|
|
5923
5932
|
const reader = inlineEditingReaderRef?.current;
|
|
5924
5933
|
const read = reader?.elementId === editId ? reader.read() : void 0;
|
|
5925
5934
|
if (read?.kind === "unsupported") {
|
|
@@ -5966,7 +5975,7 @@ function useCanvasInteractions(input) {
|
|
|
5966
5975
|
wasEditable.current = canEdit;
|
|
5967
5976
|
}, [canEdit]);
|
|
5968
5977
|
const openEquationEditorForElement = (el) => {
|
|
5969
|
-
if (!
|
|
5978
|
+
if (!pptx$1.hasTextProperties(el)) {
|
|
5970
5979
|
return false;
|
|
5971
5980
|
}
|
|
5972
5981
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5999,7 +6008,7 @@ function useCanvasInteractions(input) {
|
|
|
5999
6008
|
justInteractedRef.current = false;
|
|
6000
6009
|
} else {
|
|
6001
6010
|
const el = elementLookup.get(elementId);
|
|
6002
|
-
if (el &&
|
|
6011
|
+
if (el && pptx$1.hasTextProperties(el) && pptx.canInteractWithElement(el, "textEdit")) {
|
|
6003
6012
|
if (!openEquationEditorForElement(el)) {
|
|
6004
6013
|
pptx.setPendingCaretPoint(e);
|
|
6005
6014
|
setInlineEditingElementId(elementId);
|
|
@@ -6025,7 +6034,7 @@ function useCanvasInteractions(input) {
|
|
|
6025
6034
|
if (openEquationEditorForElement(el)) {
|
|
6026
6035
|
return;
|
|
6027
6036
|
}
|
|
6028
|
-
if (
|
|
6037
|
+
if (pptx$1.hasTextProperties(el) && pptx.canInteractWithElement(el, "textEdit")) {
|
|
6029
6038
|
setInlineEditingElementId(elementId);
|
|
6030
6039
|
setInlineEditingText(el.text ?? "");
|
|
6031
6040
|
}
|
|
@@ -6490,7 +6499,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
6490
6499
|
return;
|
|
6491
6500
|
}
|
|
6492
6501
|
const resolved = resolveHyperlinkEditResult(data);
|
|
6493
|
-
if (resolved.url && !
|
|
6502
|
+
if (resolved.url && !chunkMA2BI7LX_js.isUrlSafe(resolved.url)) {
|
|
6494
6503
|
return;
|
|
6495
6504
|
}
|
|
6496
6505
|
const actionClick = {
|
|
@@ -6536,11 +6545,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
6536
6545
|
if (!activeSlide) {
|
|
6537
6546
|
return;
|
|
6538
6547
|
}
|
|
6539
|
-
const preset =
|
|
6548
|
+
const preset = chunkMA2BI7LX_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
6540
6549
|
if (!preset) {
|
|
6541
6550
|
return;
|
|
6542
6551
|
}
|
|
6543
|
-
const defaultPptxAction =
|
|
6552
|
+
const defaultPptxAction = pptx$1.elementActionToPptxAction({
|
|
6544
6553
|
trigger: "click",
|
|
6545
6554
|
type: preset.defaultAction
|
|
6546
6555
|
});
|
|
@@ -6623,7 +6632,7 @@ function useInsertElements(input) {
|
|
|
6623
6632
|
width: 300,
|
|
6624
6633
|
height: 60,
|
|
6625
6634
|
text: "",
|
|
6626
|
-
textStyle: { fontSize:
|
|
6635
|
+
textStyle: { fontSize: chunkMA2BI7LX_js.DEFAULT_TEXT_FONT_SIZE }
|
|
6627
6636
|
});
|
|
6628
6637
|
};
|
|
6629
6638
|
const handleAddShape = () => {
|
|
@@ -6645,7 +6654,7 @@ function useInsertElements(input) {
|
|
|
6645
6654
|
}
|
|
6646
6655
|
});
|
|
6647
6656
|
};
|
|
6648
|
-
const handleAddTable = (rows =
|
|
6657
|
+
const handleAddTable = (rows = chunkMA2BI7LX_js.DEFAULT_TABLE_ROWS, columns = chunkMA2BI7LX_js.DEFAULT_TABLE_COLUMNS) => {
|
|
6649
6658
|
if (!activeSlide) {
|
|
6650
6659
|
return;
|
|
6651
6660
|
}
|
|
@@ -6819,7 +6828,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6819
6828
|
history
|
|
6820
6829
|
} = input;
|
|
6821
6830
|
const updateElementsOwning = (elementId, updater) => {
|
|
6822
|
-
if (editTemplateMode && !
|
|
6831
|
+
if (editTemplateMode && !chunkMA2BI7LX_js.isTemplateElementId(elementId)) {
|
|
6823
6832
|
ops.updateSlides(
|
|
6824
6833
|
(prev) => prev.map(
|
|
6825
6834
|
(slide, index) => index === activeSlideIndex ? { ...slide, elements: updater(slide.elements) } : slide
|
|
@@ -6853,9 +6862,9 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6853
6862
|
return;
|
|
6854
6863
|
}
|
|
6855
6864
|
const group = selectedElement;
|
|
6856
|
-
const intoTemplate =
|
|
6865
|
+
const intoTemplate = chunkMA2BI7LX_js.isTemplateElementId(group.id);
|
|
6857
6866
|
const childIds = group.children.map(
|
|
6858
|
-
(child) => intoTemplate ?
|
|
6867
|
+
(child) => intoTemplate ? chunkMA2BI7LX_js.makeCloneId(true, child.id || group.id) : child.id || pptx.generateElementId()
|
|
6859
6868
|
);
|
|
6860
6869
|
const { elements, childIds: usedIds } = pptx.ungroupElements(
|
|
6861
6870
|
ops.activeElements,
|
|
@@ -7187,7 +7196,7 @@ function useSlideManagement(input) {
|
|
|
7187
7196
|
if (!src) {
|
|
7188
7197
|
continue;
|
|
7189
7198
|
}
|
|
7190
|
-
const clone = { ...
|
|
7199
|
+
const clone = { ...pptx$1.duplicateSlide(src, next.length + 1), id: pptx.makeSlideId() };
|
|
7191
7200
|
next.splice(i + offset + 1, 0, clone);
|
|
7192
7201
|
offset++;
|
|
7193
7202
|
}
|
|
@@ -7291,7 +7300,7 @@ function createTableMergeHandlers(input) {
|
|
|
7291
7300
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
7292
7301
|
return;
|
|
7293
7302
|
}
|
|
7294
|
-
const newTableData =
|
|
7303
|
+
const newTableData = chunkMA2BI7LX_js.mergeCells(
|
|
7295
7304
|
[
|
|
7296
7305
|
{ row: rowIndex, col: columnIndex },
|
|
7297
7306
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -7299,7 +7308,7 @@ function createTableMergeHandlers(input) {
|
|
|
7299
7308
|
td
|
|
7300
7309
|
);
|
|
7301
7310
|
const updates = { tableData: newTableData };
|
|
7302
|
-
const newRawXml =
|
|
7311
|
+
const newRawXml = chunkMA2BI7LX_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7303
7312
|
if (newRawXml) {
|
|
7304
7313
|
updates.rawXml = newRawXml;
|
|
7305
7314
|
}
|
|
@@ -7325,7 +7334,7 @@ function createTableMergeHandlers(input) {
|
|
|
7325
7334
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
7326
7335
|
return;
|
|
7327
7336
|
}
|
|
7328
|
-
const newTableData =
|
|
7337
|
+
const newTableData = chunkMA2BI7LX_js.mergeCells(
|
|
7329
7338
|
[
|
|
7330
7339
|
{ row: rowIndex, col: columnIndex },
|
|
7331
7340
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -7333,7 +7342,7 @@ function createTableMergeHandlers(input) {
|
|
|
7333
7342
|
td
|
|
7334
7343
|
);
|
|
7335
7344
|
const updates = { tableData: newTableData };
|
|
7336
|
-
const newRawXml =
|
|
7345
|
+
const newRawXml = chunkMA2BI7LX_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7337
7346
|
if (newRawXml) {
|
|
7338
7347
|
updates.rawXml = newRawXml;
|
|
7339
7348
|
}
|
|
@@ -7348,9 +7357,9 @@ function createTableMergeHandlers(input) {
|
|
|
7348
7357
|
return;
|
|
7349
7358
|
}
|
|
7350
7359
|
const td = selectedElement.tableData;
|
|
7351
|
-
const newTableData =
|
|
7360
|
+
const newTableData = chunkMA2BI7LX_js.mergeCells(ts.selectedCells, td);
|
|
7352
7361
|
const updates = { tableData: newTableData };
|
|
7353
|
-
const newRawXml =
|
|
7362
|
+
const newRawXml = chunkMA2BI7LX_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7354
7363
|
if (newRawXml) {
|
|
7355
7364
|
updates.rawXml = newRawXml;
|
|
7356
7365
|
}
|
|
@@ -7367,9 +7376,9 @@ function createTableMergeHandlers(input) {
|
|
|
7367
7376
|
}
|
|
7368
7377
|
const { rowIndex, columnIndex } = ts;
|
|
7369
7378
|
const td = selectedElement.tableData;
|
|
7370
|
-
const newTableData =
|
|
7379
|
+
const newTableData = chunkMA2BI7LX_js.splitCell(rowIndex, columnIndex, td);
|
|
7371
7380
|
const updates = { tableData: newTableData };
|
|
7372
|
-
const newRawXml =
|
|
7381
|
+
const newRawXml = chunkMA2BI7LX_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7373
7382
|
if (newRawXml) {
|
|
7374
7383
|
updates.rawXml = newRawXml;
|
|
7375
7384
|
}
|
|
@@ -7404,7 +7413,7 @@ function createTableStructHandlers(input) {
|
|
|
7404
7413
|
updates.tableData = pptx.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
7405
7414
|
}
|
|
7406
7415
|
if (el.rawXml) {
|
|
7407
|
-
const newRawXml =
|
|
7416
|
+
const newRawXml = chunkMA2BI7LX_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
7408
7417
|
if (newRawXml) {
|
|
7409
7418
|
updates.rawXml = newRawXml;
|
|
7410
7419
|
}
|
|
@@ -7428,7 +7437,7 @@ function createTableStructHandlers(input) {
|
|
|
7428
7437
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
7429
7438
|
const updates = {};
|
|
7430
7439
|
if (selectedElement.rawXml) {
|
|
7431
|
-
const newRawXml =
|
|
7440
|
+
const newRawXml = chunkMA2BI7LX_js.updateCellTextStyleInRawXml(
|
|
7432
7441
|
selectedElement,
|
|
7433
7442
|
rowIndex,
|
|
7434
7443
|
colIndex,
|
|
@@ -7562,6 +7571,8 @@ function useExportSaveAs(input) {
|
|
|
7562
7571
|
slides,
|
|
7563
7572
|
templateElementsBySlideId,
|
|
7564
7573
|
filePath,
|
|
7574
|
+
storage,
|
|
7575
|
+
onSaveError,
|
|
7565
7576
|
serializeSlides,
|
|
7566
7577
|
headerFooter,
|
|
7567
7578
|
presentationProperties,
|
|
@@ -7577,25 +7588,32 @@ function useExportSaveAs(input) {
|
|
|
7577
7588
|
canvasSize,
|
|
7578
7589
|
slideSizeEmu
|
|
7579
7590
|
} = input;
|
|
7580
|
-
const handleSaveAsFormat = async (format) => {
|
|
7591
|
+
const handleSaveAsFormat = async (format, reason = "saveAs") => {
|
|
7581
7592
|
const downloadName = pptx.savedPresentationFileName(filePath, format);
|
|
7582
7593
|
try {
|
|
7583
7594
|
const data = await serializeSlides(format);
|
|
7584
7595
|
if (!data) {
|
|
7585
|
-
return;
|
|
7596
|
+
return false;
|
|
7586
7597
|
}
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7598
|
+
await pptx.deliverSavedPresentation({
|
|
7599
|
+
storage,
|
|
7600
|
+
bytes: data,
|
|
7601
|
+
format,
|
|
7602
|
+
fileName: downloadName,
|
|
7603
|
+
reason
|
|
7604
|
+
});
|
|
7605
|
+
return true;
|
|
7590
7606
|
} catch (err) {
|
|
7591
7607
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
7608
|
+
onSaveError?.(err);
|
|
7609
|
+
return false;
|
|
7592
7610
|
}
|
|
7593
7611
|
};
|
|
7594
7612
|
const handleExportJson = () => {
|
|
7595
7613
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7596
7614
|
const slideSize = pptx.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7597
7615
|
const data = {
|
|
7598
|
-
slides:
|
|
7616
|
+
slides: chunkMA2BI7LX_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7599
7617
|
width: canvasSize.width,
|
|
7600
7618
|
height: canvasSize.height,
|
|
7601
7619
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7619,6 +7637,9 @@ function useExportSaveAs(input) {
|
|
|
7619
7637
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7620
7638
|
}
|
|
7621
7639
|
};
|
|
7640
|
+
const handleSave = () => {
|
|
7641
|
+
void handleSaveAsFormat("pptx", "save");
|
|
7642
|
+
};
|
|
7622
7643
|
const handleSaveAsPptx = () => {
|
|
7623
7644
|
void handleSaveAsFormat("pptx");
|
|
7624
7645
|
};
|
|
@@ -7634,6 +7655,7 @@ function useExportSaveAs(input) {
|
|
|
7634
7655
|
return {
|
|
7635
7656
|
handleExportJson,
|
|
7636
7657
|
handleSaveAsFormat,
|
|
7658
|
+
handleSave,
|
|
7637
7659
|
handleSaveAsPptx,
|
|
7638
7660
|
handleSaveAsPpsx,
|
|
7639
7661
|
handleSaveAsPptm,
|
|
@@ -7753,7 +7775,7 @@ async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActi
|
|
|
7753
7775
|
}
|
|
7754
7776
|
function tilesToPdfPage(tilesResult) {
|
|
7755
7777
|
return tilesResult.tiles.map((tile) => ({
|
|
7756
|
-
image:
|
|
7778
|
+
image: chunkMA2BI7LX_js.canvasToJpegData(tile.canvas),
|
|
7757
7779
|
placement: pptx.placeTileOnPage(
|
|
7758
7780
|
tile,
|
|
7759
7781
|
tilesResult.fullWidth,
|
|
@@ -7786,7 +7808,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7786
7808
|
if (pages.length === 0) {
|
|
7787
7809
|
throw new Error(i18n.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7788
7810
|
}
|
|
7789
|
-
const pdfBlobUrl =
|
|
7811
|
+
const pdfBlobUrl = chunkMA2BI7LX_js.buildPdfFromTiledImageData(pages);
|
|
7790
7812
|
pptx.downloadDataUrl(pdfBlobUrl, filename);
|
|
7791
7813
|
}
|
|
7792
7814
|
async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, slideNotes, filename = "presentation-notes.pdf", options = {}) {
|
|
@@ -7816,7 +7838,7 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7816
7838
|
if (pages.length === 0) {
|
|
7817
7839
|
throw new Error(i18n.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7818
7840
|
}
|
|
7819
|
-
const pdfDataUrl =
|
|
7841
|
+
const pdfDataUrl = chunkMA2BI7LX_js.buildNotesPdf(pages);
|
|
7820
7842
|
pptx.downloadDataUrl(pdfDataUrl, filename);
|
|
7821
7843
|
}
|
|
7822
7844
|
async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
@@ -7963,8 +7985,6 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7963
7985
|
new Uint8Array(buf).set(gifBytes);
|
|
7964
7986
|
return new Blob([buf], { type: "image/gif" });
|
|
7965
7987
|
}
|
|
7966
|
-
|
|
7967
|
-
// src/viewer/utils/export-svg.ts
|
|
7968
7988
|
function injectFontFaces(svg, fontFaces) {
|
|
7969
7989
|
if (!fontFaces.length) {
|
|
7970
7990
|
return svg;
|
|
@@ -8011,7 +8031,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
8011
8031
|
continue;
|
|
8012
8032
|
}
|
|
8013
8033
|
onProgress?.(processedCount, data.slides.length);
|
|
8014
|
-
let svg =
|
|
8034
|
+
let svg = pptx$1.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
8015
8035
|
if (embedFonts && fontFaces?.length) {
|
|
8016
8036
|
svg = injectFontFaces(svg, fontFaces);
|
|
8017
8037
|
}
|
|
@@ -8241,6 +8261,8 @@ function useExportHandlers(input) {
|
|
|
8241
8261
|
activeSlide,
|
|
8242
8262
|
activeSlideIndex,
|
|
8243
8263
|
filePath,
|
|
8264
|
+
storage,
|
|
8265
|
+
onSaveError,
|
|
8244
8266
|
canvasStageRef,
|
|
8245
8267
|
setActiveSlideIndex,
|
|
8246
8268
|
serializeSlides,
|
|
@@ -8294,6 +8316,7 @@ function useExportHandlers(input) {
|
|
|
8294
8316
|
const {
|
|
8295
8317
|
handleExportJson,
|
|
8296
8318
|
handleSaveAsFormat,
|
|
8319
|
+
handleSave,
|
|
8297
8320
|
handleSaveAsPptx,
|
|
8298
8321
|
handleSaveAsPpsx,
|
|
8299
8322
|
handleSaveAsPptm,
|
|
@@ -8302,6 +8325,8 @@ function useExportHandlers(input) {
|
|
|
8302
8325
|
slides,
|
|
8303
8326
|
templateElementsBySlideId,
|
|
8304
8327
|
filePath,
|
|
8328
|
+
storage,
|
|
8329
|
+
onSaveError,
|
|
8305
8330
|
serializeSlides,
|
|
8306
8331
|
headerFooter,
|
|
8307
8332
|
presentationProperties,
|
|
@@ -8402,6 +8427,7 @@ function useExportHandlers(input) {
|
|
|
8402
8427
|
handleExportGif,
|
|
8403
8428
|
handleExportJson,
|
|
8404
8429
|
handleSaveAsFormat,
|
|
8430
|
+
handleSave,
|
|
8405
8431
|
handleSaveAsPptx,
|
|
8406
8432
|
handleSaveAsPpsx,
|
|
8407
8433
|
handleSaveAsPptm,
|
|
@@ -8413,8 +8439,10 @@ function useExportHandlers(input) {
|
|
|
8413
8439
|
exportStatusMessage
|
|
8414
8440
|
};
|
|
8415
8441
|
}
|
|
8416
|
-
var ViewerOptionsContext = React17.createContext(pptx.DEFAULT_VIEWER_OPTIONS);
|
|
8417
|
-
var ViewerOptionsStoreContext = React17.createContext(
|
|
8442
|
+
var ViewerOptionsContext = /* @__PURE__ */ React17.createContext(pptx.DEFAULT_VIEWER_OPTIONS);
|
|
8443
|
+
var ViewerOptionsStoreContext = /* @__PURE__ */ React17.createContext(
|
|
8444
|
+
null
|
|
8445
|
+
);
|
|
8418
8446
|
function useViewerOptionsContext() {
|
|
8419
8447
|
return React17.useContext(ViewerOptionsContext);
|
|
8420
8448
|
}
|
|
@@ -8583,8 +8611,6 @@ function usePrintHandlers(input) {
|
|
|
8583
8611
|
setIsPrintDialogOpen
|
|
8584
8612
|
};
|
|
8585
8613
|
}
|
|
8586
|
-
|
|
8587
|
-
// src/viewer/hooks/theme-editor-apply.ts
|
|
8588
8614
|
async function applyThemeEditorEdit(input, { colorScheme, fontScheme, name }) {
|
|
8589
8615
|
const {
|
|
8590
8616
|
handlerRef,
|
|
@@ -8600,10 +8626,10 @@ async function applyThemeEditorEdit(input, { colorScheme, fontScheme, name }) {
|
|
|
8600
8626
|
return;
|
|
8601
8627
|
}
|
|
8602
8628
|
await handler.applyTheme(colorScheme, fontScheme, name);
|
|
8603
|
-
const previousMap = theme?.colorScheme ?
|
|
8629
|
+
const previousMap = theme?.colorScheme ? pptx$1.buildThemeColorMap(theme.colorScheme) : {};
|
|
8604
8630
|
bumpHistory();
|
|
8605
8631
|
setSlides(
|
|
8606
|
-
(slides) =>
|
|
8632
|
+
(slides) => pptx$1.applyThemeToData(
|
|
8607
8633
|
{ slides, theme, themeColorMap: previousMap },
|
|
8608
8634
|
colorScheme,
|
|
8609
8635
|
fontScheme,
|
|
@@ -8614,8 +8640,8 @@ async function applyThemeEditorEdit(input, { colorScheme, fontScheme, name }) {
|
|
|
8614
8640
|
(prev) => Object.fromEntries(
|
|
8615
8641
|
Object.entries(prev).map(([id, elements]) => [
|
|
8616
8642
|
id,
|
|
8617
|
-
|
|
8618
|
-
|
|
8643
|
+
pptx$1.reResolveElementFonts(
|
|
8644
|
+
pptx$1.reResolveElementColors(elements, previousMap, colorScheme),
|
|
8619
8645
|
theme?.fontScheme,
|
|
8620
8646
|
fontScheme
|
|
8621
8647
|
)
|
|
@@ -8673,13 +8699,13 @@ function useThemeHandlers(input) {
|
|
|
8673
8699
|
return;
|
|
8674
8700
|
}
|
|
8675
8701
|
await handler.updateThemeColorScheme(colorScheme);
|
|
8676
|
-
const previousMap = theme?.colorScheme ?
|
|
8677
|
-
setSlides((prev) =>
|
|
8702
|
+
const previousMap = theme?.colorScheme ? pptx$1.buildThemeColorMap(theme.colorScheme) : {};
|
|
8703
|
+
setSlides((prev) => pptx$1.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
8678
8704
|
if (Object.keys(templateElementsBySlideId).length > 0) {
|
|
8679
8705
|
setTemplateElementsBySlideId((prev) => {
|
|
8680
8706
|
const next = {};
|
|
8681
8707
|
for (const [slideId, elements] of Object.entries(prev)) {
|
|
8682
|
-
next[slideId] =
|
|
8708
|
+
next[slideId] = pptx$1.reResolveElementColors(elements, previousMap, colorScheme);
|
|
8683
8709
|
}
|
|
8684
8710
|
return next;
|
|
8685
8711
|
});
|
|
@@ -8790,7 +8816,7 @@ function useThemeSwitching(input) {
|
|
|
8790
8816
|
}
|
|
8791
8817
|
try {
|
|
8792
8818
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
8793
|
-
const newData =
|
|
8819
|
+
const newData = pptx$1.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
8794
8820
|
onDataChange(newData);
|
|
8795
8821
|
onThemeChanged?.(preset);
|
|
8796
8822
|
} catch (error) {
|
|
@@ -8807,7 +8833,7 @@ function useThemeSwitching(input) {
|
|
|
8807
8833
|
}
|
|
8808
8834
|
try {
|
|
8809
8835
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
8810
|
-
const newData =
|
|
8836
|
+
const newData = pptx$1.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
8811
8837
|
onDataChange(newData);
|
|
8812
8838
|
} catch (error) {
|
|
8813
8839
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -8819,12 +8845,12 @@ function useThemeSwitching(input) {
|
|
|
8819
8845
|
if (!data?.theme?.colorScheme) {
|
|
8820
8846
|
return void 0;
|
|
8821
8847
|
}
|
|
8822
|
-
return
|
|
8823
|
-
(p) =>
|
|
8848
|
+
return pptx$1.THEME_PRESETS.find(
|
|
8849
|
+
(p) => pptx$1.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
8824
8850
|
);
|
|
8825
8851
|
}, [data?.theme?.colorScheme]);
|
|
8826
8852
|
return {
|
|
8827
|
-
presets:
|
|
8853
|
+
presets: pptx$1.THEME_PRESETS,
|
|
8828
8854
|
switchToPreset,
|
|
8829
8855
|
switchToCustom,
|
|
8830
8856
|
currentPreset
|
|
@@ -8845,7 +8871,9 @@ function usePropertyHandlers(input) {
|
|
|
8845
8871
|
setSlides,
|
|
8846
8872
|
setIsDirty,
|
|
8847
8873
|
ops,
|
|
8848
|
-
history
|
|
8874
|
+
history,
|
|
8875
|
+
onPropertiesChange,
|
|
8876
|
+
onNotesUpdate
|
|
8849
8877
|
} = input;
|
|
8850
8878
|
const [isVersionHistoryOpen, setIsVersionHistoryOpen] = React17.useState(false);
|
|
8851
8879
|
const [isComparePanelOpen, setIsComparePanelOpen] = React17.useState(false);
|
|
@@ -8861,6 +8889,7 @@ function usePropertyHandlers(input) {
|
|
|
8861
8889
|
)
|
|
8862
8890
|
);
|
|
8863
8891
|
history.markDirty();
|
|
8892
|
+
onNotesUpdate?.(text);
|
|
8864
8893
|
};
|
|
8865
8894
|
const handleUpdateSlide = (updates) => {
|
|
8866
8895
|
ops.updateSlides(
|
|
@@ -8875,6 +8904,7 @@ function usePropertyHandlers(input) {
|
|
|
8875
8904
|
const handleUpdateCoreProperties = (updates) => {
|
|
8876
8905
|
setCoreProperties((prev) => ({ ...prev, ...updates }));
|
|
8877
8906
|
history.markDirty();
|
|
8907
|
+
onPropertiesChange?.(updates);
|
|
8878
8908
|
};
|
|
8879
8909
|
const handleUpdateAppProperties = (updates) => {
|
|
8880
8910
|
setAppProperties((prev) => ({ ...prev, ...updates }));
|
|
@@ -8901,7 +8931,7 @@ function usePropertyHandlers(input) {
|
|
|
8901
8931
|
}
|
|
8902
8932
|
try {
|
|
8903
8933
|
const ab = await file.arrayBuffer();
|
|
8904
|
-
const h = new
|
|
8934
|
+
const h = new pptx$1.PptxHandler();
|
|
8905
8935
|
const other = await h.load(ab);
|
|
8906
8936
|
if (!other) {
|
|
8907
8937
|
return;
|
|
@@ -8911,7 +8941,7 @@ function usePropertyHandlers(input) {
|
|
|
8911
8941
|
width: canvasSize.width,
|
|
8912
8942
|
height: canvasSize.height
|
|
8913
8943
|
};
|
|
8914
|
-
setCompareResult(
|
|
8944
|
+
setCompareResult(chunkMA2BI7LX_js.comparePresentation(cur, other));
|
|
8915
8945
|
setIsComparePanelOpen(true);
|
|
8916
8946
|
} catch (err) {
|
|
8917
8947
|
console.warn("Compare failed:", err);
|
|
@@ -9264,7 +9294,7 @@ function useViewerDialogs(input) {
|
|
|
9264
9294
|
};
|
|
9265
9295
|
}
|
|
9266
9296
|
function computeGridSpacingPx(documentGridSpacing) {
|
|
9267
|
-
return pptx.computeGridSpacingPx(documentGridSpacing,
|
|
9297
|
+
return pptx.computeGridSpacingPx(documentGridSpacing, chunkMA2BI7LX_js.GRID_SIZE);
|
|
9268
9298
|
}
|
|
9269
9299
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
9270
9300
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
@@ -9273,7 +9303,7 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, pre
|
|
|
9273
9303
|
}
|
|
9274
9304
|
function computeSlideSectionGroups(slides, sections) {
|
|
9275
9305
|
return pptx.groupSlidesBySection(sections, slides).map((group) => ({
|
|
9276
|
-
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),
|
|
9277
9307
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
9278
9308
|
slideIndexes: group.slideIndexes,
|
|
9279
9309
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -9318,10 +9348,10 @@ function useDerivedSlideState(input) {
|
|
|
9318
9348
|
);
|
|
9319
9349
|
const slideSectionGroups = React17.useMemo(
|
|
9320
9350
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
9321
|
-
if (group.id ===
|
|
9351
|
+
if (group.id === chunkMA2BI7LX_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
9322
9352
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
9323
9353
|
}
|
|
9324
|
-
if (group.id ===
|
|
9354
|
+
if (group.id === chunkMA2BI7LX_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
9325
9355
|
return { ...group, label: t("pptx.sections.slides") };
|
|
9326
9356
|
}
|
|
9327
9357
|
return group;
|
|
@@ -9428,7 +9458,7 @@ function useAnnotationHandlers(input) {
|
|
|
9428
9458
|
if (nextMode === "present") {
|
|
9429
9459
|
presentation.enterPresentMode();
|
|
9430
9460
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
9431
|
-
|
|
9461
|
+
chunkMA2BI7LX_js.stopAllPersistentAudio();
|
|
9432
9462
|
if (promptKeepInkAnnotations) {
|
|
9433
9463
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
9434
9464
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -9438,7 +9468,7 @@ function useAnnotationHandlers(input) {
|
|
|
9438
9468
|
}
|
|
9439
9469
|
} else {
|
|
9440
9470
|
if (mode === "present") {
|
|
9441
|
-
|
|
9471
|
+
chunkMA2BI7LX_js.stopAllPersistentAudio();
|
|
9442
9472
|
}
|
|
9443
9473
|
setMode(nextMode);
|
|
9444
9474
|
}
|
|
@@ -9509,7 +9539,7 @@ function overlayPendingInlineEdit(document2, elementId, text, snapshot, transfor
|
|
|
9509
9539
|
(slide) => !elementId ? slide : {
|
|
9510
9540
|
...slide,
|
|
9511
9541
|
elements: slide.elements.map(
|
|
9512
|
-
(element) => element.id === elementId &&
|
|
9542
|
+
(element) => element.id === elementId && pptx$1.hasTextProperties(element) ? {
|
|
9513
9543
|
...element,
|
|
9514
9544
|
text,
|
|
9515
9545
|
textSegments: pptx.remapTextToSegments(
|
|
@@ -9598,14 +9628,14 @@ function useSerialize(input) {
|
|
|
9598
9628
|
const pptxGuides = guides.map((g) => ({
|
|
9599
9629
|
id: g.id,
|
|
9600
9630
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
9601
|
-
positionEmu:
|
|
9631
|
+
positionEmu: pptx$1.guidePxToEmu(g.position)
|
|
9602
9632
|
}));
|
|
9603
9633
|
return {
|
|
9604
9634
|
...slide,
|
|
9605
9635
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
9606
9636
|
};
|
|
9607
9637
|
});
|
|
9608
|
-
const slidesToSave =
|
|
9638
|
+
const slidesToSave = chunkMA2BI7LX_js.buildSaveSlides(slidesWithGuides, pending.templateElementsBySlideId);
|
|
9609
9639
|
const saveOptions = pptx.buildDeckSaveOptions({
|
|
9610
9640
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
9611
9641
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
@@ -9675,6 +9705,12 @@ function useRecoveryDetection(input) {
|
|
|
9675
9705
|
const [prompt, setPrompt] = React17.useState(null);
|
|
9676
9706
|
const [discarding, setDiscarding] = React17.useState(false);
|
|
9677
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]);
|
|
9678
9714
|
const openVersionHistory = input.openVersionHistory;
|
|
9679
9715
|
React17.useEffect(() => {
|
|
9680
9716
|
if (!pptx.shouldProbeAutosaveRecovery({
|
|
@@ -9689,12 +9725,18 @@ function useRecoveryDetection(input) {
|
|
|
9689
9725
|
}
|
|
9690
9726
|
recoveryCheckedRef.current = true;
|
|
9691
9727
|
void (async () => {
|
|
9692
|
-
const offer = await pptx.probeAutosaveRecovery(
|
|
9728
|
+
const offer = await pptx.probeAutosaveRecovery(
|
|
9729
|
+
filePath,
|
|
9730
|
+
Date.now(),
|
|
9731
|
+
fileName,
|
|
9732
|
+
storageRef.current
|
|
9733
|
+
);
|
|
9693
9734
|
if (!offer) {
|
|
9694
9735
|
return;
|
|
9695
9736
|
}
|
|
9696
9737
|
recordRef.current = offer.record;
|
|
9697
9738
|
setPrompt(offer.prompt);
|
|
9739
|
+
onOfferedRef.current?.(offer.record);
|
|
9698
9740
|
openVersionHistory?.();
|
|
9699
9741
|
})();
|
|
9700
9742
|
}, [filePath, fileName, loading, error, slideCount, autosaveAllowed, openVersionHistory]);
|
|
@@ -9724,7 +9766,7 @@ function useRecoveryDetection(input) {
|
|
|
9724
9766
|
setDiscarding(true);
|
|
9725
9767
|
void (async () => {
|
|
9726
9768
|
try {
|
|
9727
|
-
await pptx.discardAutosaveRecovery(record);
|
|
9769
|
+
await pptx.discardAutosaveRecovery(record, storageRef.current);
|
|
9728
9770
|
recordRef.current = null;
|
|
9729
9771
|
setPrompt(null);
|
|
9730
9772
|
} catch {
|
|
@@ -9786,7 +9828,7 @@ function usePresentationSetup(input) {
|
|
|
9786
9828
|
return;
|
|
9787
9829
|
}
|
|
9788
9830
|
if (mode === "present" && nextMode !== "present") {
|
|
9789
|
-
|
|
9831
|
+
chunkMA2BI7LX_js.stopAllPersistentAudio();
|
|
9790
9832
|
stopAnimationSound();
|
|
9791
9833
|
const exitHandler = exitModeHandlerRef.current;
|
|
9792
9834
|
if (exitHandler) {
|
|
@@ -9907,12 +9949,12 @@ function useCanvasImagePaste(input) {
|
|
|
9907
9949
|
);
|
|
9908
9950
|
}
|
|
9909
9951
|
function formatPatchFor(element, format) {
|
|
9910
|
-
const updated =
|
|
9952
|
+
const updated = chunkMA2BI7LX_js.applyFormatToElement(element, format);
|
|
9911
9953
|
const updates = {};
|
|
9912
|
-
if (
|
|
9954
|
+
if (pptx$1.hasShapeProperties(updated)) {
|
|
9913
9955
|
updates.shapeStyle = updated.shapeStyle;
|
|
9914
9956
|
}
|
|
9915
|
-
if (
|
|
9957
|
+
if (pptx$1.hasTextProperties(updated)) {
|
|
9916
9958
|
updates.textStyle = updated.textStyle;
|
|
9917
9959
|
}
|
|
9918
9960
|
return updates;
|
|
@@ -9930,7 +9972,7 @@ function useFormatPainterEditing(input) {
|
|
|
9930
9972
|
const prevFormatPainterRef = React17.useRef(false);
|
|
9931
9973
|
React17.useEffect(() => {
|
|
9932
9974
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9933
|
-
copiedFormatRef.current =
|
|
9975
|
+
copiedFormatRef.current = chunkMA2BI7LX_js.copyFormatFromElement(selectedElement);
|
|
9934
9976
|
} else if (!formatPainterActive) {
|
|
9935
9977
|
copiedFormatRef.current = null;
|
|
9936
9978
|
}
|
|
@@ -10372,6 +10414,8 @@ function useIOHandlers(input) {
|
|
|
10372
10414
|
activeSlideIndex,
|
|
10373
10415
|
canvasSize,
|
|
10374
10416
|
filePath,
|
|
10417
|
+
storage,
|
|
10418
|
+
onSaveError,
|
|
10375
10419
|
history,
|
|
10376
10420
|
ops,
|
|
10377
10421
|
zoom,
|
|
@@ -10380,6 +10424,8 @@ function useIOHandlers(input) {
|
|
|
10380
10424
|
serializeForRecovery,
|
|
10381
10425
|
setContent,
|
|
10382
10426
|
onContentChange,
|
|
10427
|
+
onPropertiesChange,
|
|
10428
|
+
onNotesUpdate,
|
|
10383
10429
|
imageExportScale,
|
|
10384
10430
|
imageResolutionScale
|
|
10385
10431
|
} = input;
|
|
@@ -10389,6 +10435,8 @@ function useIOHandlers(input) {
|
|
|
10389
10435
|
activeSlide: slides[activeSlideIndex],
|
|
10390
10436
|
activeSlideIndex,
|
|
10391
10437
|
filePath,
|
|
10438
|
+
storage,
|
|
10439
|
+
onSaveError,
|
|
10392
10440
|
canvasStageRef: zoom.canvasStageRef,
|
|
10393
10441
|
setActiveSlideIndex: state.setActiveSlideIndex,
|
|
10394
10442
|
serializeSlides,
|
|
@@ -10443,7 +10491,9 @@ function useIOHandlers(input) {
|
|
|
10443
10491
|
setSlides: state.setSlides,
|
|
10444
10492
|
setIsDirty: state.setIsDirty,
|
|
10445
10493
|
ops,
|
|
10446
|
-
history
|
|
10494
|
+
history,
|
|
10495
|
+
onPropertiesChange,
|
|
10496
|
+
onNotesUpdate
|
|
10447
10497
|
});
|
|
10448
10498
|
return { exportHandlers, printHandlers, themeHandlers, propertyHandlers };
|
|
10449
10499
|
}
|
|
@@ -10611,6 +10661,7 @@ function useContentLifecycle(input) {
|
|
|
10611
10661
|
filePath,
|
|
10612
10662
|
autosaveEnabled = true,
|
|
10613
10663
|
autosaveIntervalMs,
|
|
10664
|
+
storage,
|
|
10614
10665
|
embedFonts = true,
|
|
10615
10666
|
slides,
|
|
10616
10667
|
state,
|
|
@@ -10722,6 +10773,7 @@ function useContentLifecycle(input) {
|
|
|
10722
10773
|
const { autosaveStatus } = useAutosave({
|
|
10723
10774
|
isDirty: state.isDirty,
|
|
10724
10775
|
filePath,
|
|
10776
|
+
storage,
|
|
10725
10777
|
serializeSlides: serializeForRecovery,
|
|
10726
10778
|
enabled: autosaveEnabled,
|
|
10727
10779
|
...autosaveIntervalMs === void 0 ? {} : { intervalMs: autosaveIntervalMs },
|
|
@@ -10729,6 +10781,7 @@ function useContentLifecycle(input) {
|
|
|
10729
10781
|
// so a poll that finds all of them unchanged can skip re-serializing a
|
|
10730
10782
|
// deck it has already snapshotted. The two refs are read by `.current`
|
|
10731
10783
|
// because an inline edit in progress lives there and nowhere else yet.
|
|
10784
|
+
onSaved: input.onAutosave,
|
|
10732
10785
|
getChangeSources: () => [
|
|
10733
10786
|
slides,
|
|
10734
10787
|
state.templateElementsBySlideId,
|
|
@@ -11021,7 +11074,7 @@ function useKeyboardShortcutWiring(input) {
|
|
|
11021
11074
|
}
|
|
11022
11075
|
function stepSelectedFontSize(state, ops, direction) {
|
|
11023
11076
|
const selected = state.selectedElement;
|
|
11024
|
-
const currentPx = (selected &&
|
|
11077
|
+
const currentPx = (selected && pptx$1.hasTextProperties(selected) ? selected.textStyle?.fontSize : void 0) ?? pptx.textFontSizePtToPx(18);
|
|
11025
11078
|
const nextPt = pptx.stepFontSizePt(pptx.textFontSizePxToPt(currentPx), direction);
|
|
11026
11079
|
ops.updateSelectedTextStyle({ fontSize: pptx.textFontSizePtToPx(nextPt) });
|
|
11027
11080
|
}
|
|
@@ -11068,6 +11121,20 @@ function useElementUpdateBatch(input) {
|
|
|
11068
11121
|
);
|
|
11069
11122
|
}, []);
|
|
11070
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
|
+
}
|
|
11071
11138
|
|
|
11072
11139
|
// src/viewer/hooks/useViewerIntegration.ts
|
|
11073
11140
|
function useViewerIntegration(input) {
|
|
@@ -11084,6 +11151,7 @@ function useViewerIntegration(input) {
|
|
|
11084
11151
|
content,
|
|
11085
11152
|
filePath,
|
|
11086
11153
|
fileName,
|
|
11154
|
+
storage,
|
|
11087
11155
|
autosaveEnabled,
|
|
11088
11156
|
autosaveAllowed = true,
|
|
11089
11157
|
autosaveIntervalMs,
|
|
@@ -11112,7 +11180,13 @@ function useViewerIntegration(input) {
|
|
|
11112
11180
|
onModeChange,
|
|
11113
11181
|
onZoomChange,
|
|
11114
11182
|
onSelectionChange,
|
|
11115
|
-
onSlideCountChange
|
|
11183
|
+
onSlideCountChange,
|
|
11184
|
+
onAutosave,
|
|
11185
|
+
onAutosaveStatus,
|
|
11186
|
+
onAutosaveRecovery,
|
|
11187
|
+
onPropertiesChange,
|
|
11188
|
+
onNotesUpdate,
|
|
11189
|
+
onPresentationChange
|
|
11116
11190
|
} = input;
|
|
11117
11191
|
usePointerHandlers({
|
|
11118
11192
|
editorScale: zoom.editorScale,
|
|
@@ -11150,8 +11224,10 @@ function useViewerIntegration(input) {
|
|
|
11150
11224
|
{
|
|
11151
11225
|
content,
|
|
11152
11226
|
filePath,
|
|
11227
|
+
storage,
|
|
11153
11228
|
autosaveEnabled,
|
|
11154
11229
|
autosaveIntervalMs,
|
|
11230
|
+
onAutosave,
|
|
11155
11231
|
// The File > Fonts toggle, finally reaching a save call.
|
|
11156
11232
|
embedFonts: dialogs.embedFontsEnabled,
|
|
11157
11233
|
slides,
|
|
@@ -11176,6 +11252,8 @@ function useViewerIntegration(input) {
|
|
|
11176
11252
|
activeSlideIndex,
|
|
11177
11253
|
canvasSize,
|
|
11178
11254
|
filePath,
|
|
11255
|
+
storage,
|
|
11256
|
+
onSaveError: input.onSaveError,
|
|
11179
11257
|
history,
|
|
11180
11258
|
ops: editorOps.ops,
|
|
11181
11259
|
zoom,
|
|
@@ -11184,6 +11262,8 @@ function useViewerIntegration(input) {
|
|
|
11184
11262
|
serializeForRecovery,
|
|
11185
11263
|
setContent,
|
|
11186
11264
|
onContentChange,
|
|
11265
|
+
onPropertiesChange,
|
|
11266
|
+
onNotesUpdate,
|
|
11187
11267
|
imageExportScale,
|
|
11188
11268
|
imageResolutionScale
|
|
11189
11269
|
});
|
|
@@ -11210,6 +11290,8 @@ function useViewerIntegration(input) {
|
|
|
11210
11290
|
error,
|
|
11211
11291
|
slideCount: slides.length,
|
|
11212
11292
|
autosaveAllowed,
|
|
11293
|
+
storage,
|
|
11294
|
+
onOffered: onAutosaveRecovery,
|
|
11213
11295
|
onRestore: setContent
|
|
11214
11296
|
});
|
|
11215
11297
|
const updateElements = useElementUpdateBatch(input);
|
|
@@ -11432,6 +11514,8 @@ function useViewerIntegration(input) {
|
|
|
11432
11514
|
onSlideCountChange(slides.length);
|
|
11433
11515
|
}
|
|
11434
11516
|
}, [slides.length, onSlideCountChange]);
|
|
11517
|
+
useReportOnChange(pptx.autosaveStatusKind(autosaveStatus), onAutosaveStatus);
|
|
11518
|
+
useReportOnChange(mode === "present", onPresentationChange);
|
|
11435
11519
|
useKeyboardShortcutWiring({
|
|
11436
11520
|
state,
|
|
11437
11521
|
mode,
|
|
@@ -11525,7 +11609,9 @@ function useViewerOptions() {
|
|
|
11525
11609
|
);
|
|
11526
11610
|
return { optionsStore: store, options };
|
|
11527
11611
|
}
|
|
11528
|
-
var KNOWN_TAB_IDS = new Set(
|
|
11612
|
+
var KNOWN_TAB_IDS = /* @__PURE__ */ new Set(
|
|
11613
|
+
/* @__PURE__ */ pptx.TOOLBAR_TABS.map((tab) => tab.id)
|
|
11614
|
+
);
|
|
11529
11615
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
11530
11616
|
const isHidden = (id) => pptx.isActionHidden(id, hiddenActions);
|
|
11531
11617
|
const userHidden = new Set(hiddenTabIds);
|
|
@@ -11578,7 +11664,7 @@ function useCollaborationWriteBack(input) {
|
|
|
11578
11664
|
getSourceBytes: () => latest.current.getSourceBytes?.() ?? null,
|
|
11579
11665
|
getSaveOptions: () => latest.current.getSaveOptions?.(),
|
|
11580
11666
|
getTemplateElements: () => latest.current.templateElementsBySlideId,
|
|
11581
|
-
mergeTemplateElements:
|
|
11667
|
+
mergeTemplateElements: chunkMA2BI7LX_js.buildSaveSlides,
|
|
11582
11668
|
onWriteBackStatus: () => latest.current.onWriteBackStatus?.(
|
|
11583
11669
|
pptx.writeBackReport(latest.current.config, created.getState())
|
|
11584
11670
|
)
|
|
@@ -12137,8 +12223,8 @@ function useTouchGestures(input) {
|
|
|
12137
12223
|
}
|
|
12138
12224
|
const recognizer = pptx.createTouchGestureRecognizer({
|
|
12139
12225
|
getScale: () => scaleRef.current,
|
|
12140
|
-
minScale:
|
|
12141
|
-
maxScale:
|
|
12226
|
+
minScale: chunkMA2BI7LX_js.MIN_ZOOM_SCALE,
|
|
12227
|
+
maxScale: chunkMA2BI7LX_js.MAX_ZOOM_SCALE,
|
|
12142
12228
|
callbacks: {
|
|
12143
12229
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
12144
12230
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -12262,7 +12348,7 @@ function buildCanvasProps(input) {
|
|
|
12262
12348
|
if (pptx.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
12263
12349
|
return;
|
|
12264
12350
|
}
|
|
12265
|
-
|
|
12351
|
+
chunkMA2BI7LX_js.safeOpenUrl(url, target);
|
|
12266
12352
|
};
|
|
12267
12353
|
const handleActionClick = (elementId, action) => {
|
|
12268
12354
|
if (mode === "present") {
|
|
@@ -12277,9 +12363,9 @@ function buildCanvasProps(input) {
|
|
|
12277
12363
|
}
|
|
12278
12364
|
};
|
|
12279
12365
|
const handleHyperlinkClick = (url, target) => {
|
|
12280
|
-
if (
|
|
12366
|
+
if (chunkMA2BI7LX_js.isPpactionUrl(url)) {
|
|
12281
12367
|
if (mode === "present") {
|
|
12282
|
-
const parsed =
|
|
12368
|
+
const parsed = chunkMA2BI7LX_js.parsePpactionUrl(url);
|
|
12283
12369
|
if (parsed) {
|
|
12284
12370
|
presentation.handlePresentationAction({
|
|
12285
12371
|
action: parsed.action,
|
|
@@ -12627,6 +12713,7 @@ function buildToolbarProps(input) {
|
|
|
12627
12713
|
s.setIsDirty(true);
|
|
12628
12714
|
},
|
|
12629
12715
|
onOpenShareDialog,
|
|
12716
|
+
onSave: exportHandlers.handleSave,
|
|
12630
12717
|
onSaveAsPptx: exportHandlers.handleSaveAsPptx,
|
|
12631
12718
|
onSaveAsPpsx: exportHandlers.handleSaveAsPpsx,
|
|
12632
12719
|
onSaveAsPptm: exportHandlers.handleSaveAsPptm,
|
|
@@ -12705,7 +12792,7 @@ function buildToolbarProps(input) {
|
|
|
12705
12792
|
markDirty: history.markDirty
|
|
12706
12793
|
}),
|
|
12707
12794
|
formatPainterActive: s.formatPainterActive,
|
|
12708
|
-
canActivateFormatPainter:
|
|
12795
|
+
canActivateFormatPainter: chunkMA2BI7LX_js.hasCopyableFormat(selectedElement),
|
|
12709
12796
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
12710
12797
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
12711
12798
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -13029,7 +13116,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
13029
13116
|
documentGridSpacing: state.viewProperties?.gridSpacing
|
|
13030
13117
|
});
|
|
13031
13118
|
const themeColorMap = React17.useMemo(
|
|
13032
|
-
() => state.theme?.colorScheme ?
|
|
13119
|
+
() => state.theme?.colorScheme ? pptx$1.buildThemeColorMap(state.theme.colorScheme) : void 0,
|
|
13033
13120
|
[state.theme?.colorScheme]
|
|
13034
13121
|
);
|
|
13035
13122
|
const { presentation, annotations, actionSoundHandlerRef, setExitModeHandler } = usePresentationSetup({
|
|
@@ -13609,23 +13696,23 @@ function ColorChangedImage({
|
|
|
13609
13696
|
className,
|
|
13610
13697
|
alt
|
|
13611
13698
|
}) {
|
|
13612
|
-
const tolerance = tolerancePct ??
|
|
13613
|
-
const cacheKey =
|
|
13699
|
+
const tolerance = tolerancePct ?? chunkMA2BI7LX_js.DEFAULT_COLOR_CHANGE_TOLERANCE;
|
|
13700
|
+
const cacheKey = chunkMA2BI7LX_js.buildCacheKey(
|
|
13614
13701
|
src,
|
|
13615
13702
|
clrChange.clrFrom,
|
|
13616
13703
|
clrChange.clrTo,
|
|
13617
13704
|
tolerance,
|
|
13618
13705
|
Boolean(clrChange.clrToTransparent)
|
|
13619
13706
|
);
|
|
13620
|
-
const cached =
|
|
13707
|
+
const cached = chunkMA2BI7LX_js.getCachedResult(cacheKey);
|
|
13621
13708
|
const [processedSrc, setProcessedSrc] = React17.useState(cached ?? null);
|
|
13622
13709
|
React17.useEffect(() => {
|
|
13623
|
-
if (
|
|
13624
|
-
setProcessedSrc(
|
|
13710
|
+
if (chunkMA2BI7LX_js.getCachedResult(cacheKey)) {
|
|
13711
|
+
setProcessedSrc(chunkMA2BI7LX_js.getCachedResult(cacheKey) ?? null);
|
|
13625
13712
|
return;
|
|
13626
13713
|
}
|
|
13627
13714
|
let cancelled = false;
|
|
13628
|
-
|
|
13715
|
+
chunkMA2BI7LX_js.applyColorChange(
|
|
13629
13716
|
src,
|
|
13630
13717
|
clrChange.clrFrom,
|
|
13631
13718
|
clrChange.clrTo,
|
|
@@ -13633,7 +13720,7 @@ function ColorChangedImage({
|
|
|
13633
13720
|
Boolean(clrChange.clrToTransparent)
|
|
13634
13721
|
).then((result) => {
|
|
13635
13722
|
if (!cancelled) {
|
|
13636
|
-
|
|
13723
|
+
chunkMA2BI7LX_js.setCachedResult(cacheKey, result.dataUrl);
|
|
13637
13724
|
setProcessedSrc(result.dataUrl);
|
|
13638
13725
|
}
|
|
13639
13726
|
return void 0;
|
|
@@ -13725,7 +13812,7 @@ function TiledImageLayer({
|
|
|
13725
13812
|
cancelled = true;
|
|
13726
13813
|
};
|
|
13727
13814
|
}, [src]);
|
|
13728
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, style: { ...
|
|
13815
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, style: { ...chunkMA2BI7LX_js.getImageTilingStyle(element, nativeSize), ...style } });
|
|
13729
13816
|
}
|
|
13730
13817
|
function renderImageEffectDefinitions(element, excludeDuotone = false) {
|
|
13731
13818
|
return pptx.getImageSvgFilters(element).filter((definition) => !excludeDuotone || definition.id !== `duotone-${element.id}`).map((definition) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13794,7 +13881,7 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
13794
13881
|
...filter ? { filter } : {},
|
|
13795
13882
|
...opacity !== void 0 ? { opacity } : {}
|
|
13796
13883
|
};
|
|
13797
|
-
if (
|
|
13884
|
+
if (chunkMA2BI7LX_js.isImageTiled(el)) {
|
|
13798
13885
|
const tileSrc = imgSrc(el);
|
|
13799
13886
|
if (!tileSrc) {
|
|
13800
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" });
|
|
@@ -13813,12 +13900,12 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
13813
13900
|
] });
|
|
13814
13901
|
}
|
|
13815
13902
|
const colorWash = pptx.getImageColorWashStyle(
|
|
13816
|
-
|
|
13903
|
+
pptx$1.isImageLikeElement(el) ? el.imageEffects?.colorWash : void 0
|
|
13817
13904
|
);
|
|
13818
13905
|
const clrChange = "imageEffects" in el ? el.imageEffects?.clrChange : void 0;
|
|
13819
|
-
const duotoneColors =
|
|
13906
|
+
const duotoneColors = chunkMA2BI7LX_js.getDuotoneColors(el);
|
|
13820
13907
|
const useDuotoneCanvas = Boolean(duotoneColors && !clrChange);
|
|
13821
|
-
const filterForImg = useDuotoneCanvas ?
|
|
13908
|
+
const filterForImg = useDuotoneCanvas ? chunkMA2BI7LX_js.getImageEffectsFilter(el, { excludeDuotone: true }) : filter;
|
|
13822
13909
|
const canvasEffectStyles = {
|
|
13823
13910
|
...filterForImg ? { filter: filterForImg } : {},
|
|
13824
13911
|
...opacity !== void 0 ? { opacity } : {}
|
|
@@ -13894,19 +13981,25 @@ function SlideBackgroundImageLayer({
|
|
|
13894
13981
|
style: { zIndex: 0 },
|
|
13895
13982
|
children: renderImg(
|
|
13896
13983
|
backgroundElement,
|
|
13897
|
-
|
|
13898
|
-
|
|
13984
|
+
chunkMA2BI7LX_js.getImageRenderStyle(backgroundElement),
|
|
13985
|
+
chunkMA2BI7LX_js.getImageEffectsFilter(backgroundElement),
|
|
13899
13986
|
"",
|
|
13900
|
-
|
|
13987
|
+
chunkMA2BI7LX_js.getImageEffectsOpacity(backgroundElement)
|
|
13901
13988
|
)
|
|
13902
13989
|
}
|
|
13903
13990
|
);
|
|
13904
13991
|
}
|
|
13905
|
-
|
|
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);
|
|
13906
13999
|
function useChartFormatContext() {
|
|
13907
14000
|
return React17.useContext(ChartFormatContext);
|
|
13908
14001
|
}
|
|
13909
|
-
var ChartPartSelectionContext = React17.createContext({
|
|
14002
|
+
var ChartPartSelectionContext = /* @__PURE__ */ React17.createContext({
|
|
13910
14003
|
selection: null,
|
|
13911
14004
|
setSelection: () => {
|
|
13912
14005
|
}
|
|
@@ -13929,7 +14022,9 @@ var DEFAULT_RENDERING_3D_FLAGS = {
|
|
|
13929
14022
|
areaChart3D: false,
|
|
13930
14023
|
pieChart3D: false
|
|
13931
14024
|
};
|
|
13932
|
-
var Rendering3DFlagsContext = React17.createContext(
|
|
14025
|
+
var Rendering3DFlagsContext = /* @__PURE__ */ React17.createContext(
|
|
14026
|
+
DEFAULT_RENDERING_3D_FLAGS
|
|
14027
|
+
);
|
|
13933
14028
|
pptx.defineThreeViewElement();
|
|
13934
14029
|
function useThreeViewEvent(ref, type, handler) {
|
|
13935
14030
|
React17.useLayoutEffect(() => {
|
|
@@ -14175,7 +14270,7 @@ function ChartElementView({
|
|
|
14175
14270
|
pptx.getBarFacePicturePixelSampleVersion
|
|
14176
14271
|
);
|
|
14177
14272
|
const viewModel = React17.useMemo(() => {
|
|
14178
|
-
return canEdit ?
|
|
14273
|
+
return canEdit ? chunkMA2BI7LX_js.buildReactChartViewModel(element) : null;
|
|
14179
14274
|
}, [canEdit, element, barFacePictureSampleVersion]);
|
|
14180
14275
|
React17.useEffect(pptx.ensureChartInteractionStyles, []);
|
|
14181
14276
|
React17.useEffect(() => {
|
|
@@ -14280,9 +14375,9 @@ function ChartElementView({
|
|
|
14280
14375
|
textStyle: animationState?.textStyle,
|
|
14281
14376
|
onSelect: chart3D.onSelect,
|
|
14282
14377
|
onDrag: chart3D.onDrag,
|
|
14283
|
-
children:
|
|
14378
|
+
children: chunkMA2BI7LX_js.renderChartElement(renderedElement, (key) => t(key))
|
|
14284
14379
|
}
|
|
14285
|
-
) :
|
|
14380
|
+
) : chunkMA2BI7LX_js.renderChartElement(renderedElement, (key) => t(key)),
|
|
14286
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) }),
|
|
14287
14382
|
titleDraft !== null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14288
14383
|
"input",
|
|
@@ -14451,26 +14546,26 @@ var rotateSize = "var(--pptx-react-rotate-default, 20px)";
|
|
|
14451
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]";
|
|
14452
14547
|
var ROTATE_DEFAULT_CLASSES = "[--pptx-react-rotate-default:20px] max-md:[--pptx-react-rotate-default:28px]";
|
|
14453
14548
|
var RESIZE_ARTWORK = {
|
|
14454
|
-
corner: pptx.getSelectionControlArtworkStyle("corner", {
|
|
14549
|
+
corner: /* @__PURE__ */ pptx.getSelectionControlArtworkStyle("corner", {
|
|
14455
14550
|
...appearance,
|
|
14456
14551
|
width: cornerSize,
|
|
14457
14552
|
height: cornerSize,
|
|
14458
14553
|
radius: "9999px"
|
|
14459
14554
|
}),
|
|
14460
|
-
horizontal: pptx.getSelectionControlArtworkStyle("horizontal-edge", {
|
|
14555
|
+
horizontal: /* @__PURE__ */ pptx.getSelectionControlArtworkStyle("horizontal-edge", {
|
|
14461
14556
|
...appearance,
|
|
14462
14557
|
width: edgeLength,
|
|
14463
14558
|
height: edgeThickness,
|
|
14464
14559
|
radius: "var(--radius-sm, 0.25rem)"
|
|
14465
14560
|
}),
|
|
14466
|
-
vertical: pptx.getSelectionControlArtworkStyle("vertical-edge", {
|
|
14561
|
+
vertical: /* @__PURE__ */ pptx.getSelectionControlArtworkStyle("vertical-edge", {
|
|
14467
14562
|
...appearance,
|
|
14468
14563
|
width: edgeThickness,
|
|
14469
14564
|
height: edgeLength,
|
|
14470
14565
|
radius: "var(--radius-sm, 0.25rem)"
|
|
14471
14566
|
})
|
|
14472
14567
|
};
|
|
14473
|
-
var ROTATE_ARTWORK = pptx.getSelectionControlArtworkStyle("rotate", {
|
|
14568
|
+
var ROTATE_ARTWORK = /* @__PURE__ */ pptx.getSelectionControlArtworkStyle("rotate", {
|
|
14474
14569
|
...appearance,
|
|
14475
14570
|
width: rotateSize,
|
|
14476
14571
|
height: rotateSize,
|
|
@@ -14612,7 +14707,7 @@ function ResizeHandles({
|
|
|
14612
14707
|
"aria-label": t("pptx.selectionOverlay.resize", { handle }),
|
|
14613
14708
|
"data-pptx-handle-kind": "resize",
|
|
14614
14709
|
"data-pptx-compact": true,
|
|
14615
|
-
className:
|
|
14710
|
+
className: chunkMA2BI7LX_js.cn(
|
|
14616
14711
|
"absolute z-10 group border-0 bg-transparent p-0",
|
|
14617
14712
|
RESIZE_DEFAULT_CLASSES,
|
|
14618
14713
|
posClass,
|
|
@@ -14638,7 +14733,7 @@ function ResizeHandles({
|
|
|
14638
14733
|
"div",
|
|
14639
14734
|
{
|
|
14640
14735
|
"data-pptx-handle-hit": true,
|
|
14641
|
-
className:
|
|
14736
|
+
className: chunkMA2BI7LX_js.cn(
|
|
14642
14737
|
"absolute -inset-px pointer-events-auto [--pptx-handle-hit-inset:-1px]",
|
|
14643
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]"
|
|
14644
14739
|
),
|
|
@@ -14659,7 +14754,7 @@ function ResizeHandles({
|
|
|
14659
14754
|
"aria-label": t("pptx.selectionOverlay.rotate"),
|
|
14660
14755
|
"data-pptx-handle-kind": "rotate",
|
|
14661
14756
|
"data-pptx-compact": true,
|
|
14662
|
-
className:
|
|
14757
|
+
className: chunkMA2BI7LX_js.cn(
|
|
14663
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",
|
|
14664
14759
|
ROTATE_DEFAULT_CLASSES
|
|
14665
14760
|
),
|
|
@@ -14712,7 +14807,7 @@ function ResizeHandles({
|
|
|
14712
14807
|
))
|
|
14713
14808
|
] });
|
|
14714
14809
|
}
|
|
14715
|
-
var
|
|
14810
|
+
var ConnectorElementRendererMemo = /* @__PURE__ */ React17__default.default.memo(
|
|
14716
14811
|
// oxlint-disable-next-line prefer-arrow-callback -- named fn gives the memo component its displayName
|
|
14717
14812
|
function ConnectorElementRendererInner({
|
|
14718
14813
|
el,
|
|
@@ -14729,17 +14824,17 @@ var ConnectorElementRenderer = React17__default.default.memo(
|
|
|
14729
14824
|
animationState,
|
|
14730
14825
|
textStyleOverrideCss
|
|
14731
14826
|
}) {
|
|
14732
|
-
const shapeEl =
|
|
14827
|
+
const shapeEl = pptx$1.hasShapeProperties(el) ? el : void 0;
|
|
14733
14828
|
const viewWidth = Math.max(el.width, 0);
|
|
14734
14829
|
const viewHeight = Math.max(el.height, 0);
|
|
14735
14830
|
const svgWidth = Math.max(el.width, 1);
|
|
14736
14831
|
const svgHeight = Math.max(el.height, 1);
|
|
14737
14832
|
const ss = shapeEl?.shapeStyle;
|
|
14738
14833
|
const strokeWidth = Math.max(0, ss?.strokeWidth ?? 2);
|
|
14739
|
-
const strokeColor =
|
|
14740
|
-
const strokePaint =
|
|
14741
|
-
const dashType =
|
|
14742
|
-
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(
|
|
14743
14838
|
dashType,
|
|
14744
14839
|
Math.max(strokeWidth, 1),
|
|
14745
14840
|
ss?.customDashSegments
|
|
@@ -14750,14 +14845,14 @@ var ConnectorElementRenderer = React17__default.default.memo(
|
|
|
14750
14845
|
const markerSeed = el.id.replace(/[^a-zA-Z0-9_-]/gu, "_");
|
|
14751
14846
|
const startMarkerId = `${markerSeed}-sel-start`;
|
|
14752
14847
|
const endMarkerId = `${markerSeed}-sel-end`;
|
|
14753
|
-
const compoundOffsets =
|
|
14754
|
-
const compoundWidths =
|
|
14848
|
+
const compoundOffsets = chunkMA2BI7LX_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
14849
|
+
const compoundWidths = chunkMA2BI7LX_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
14755
14850
|
const strokeCap = pptx.svgLineCap(ss?.lineCap);
|
|
14756
|
-
const textEl =
|
|
14851
|
+
const textEl = pptx$1.hasTextProperties(el) ? el : void 0;
|
|
14757
14852
|
const connectorText = textEl?.text?.trim() ?? "";
|
|
14758
14853
|
const connectorTextSegments = textEl?.textSegments;
|
|
14759
14854
|
const connectorTextStyle = textEl?.textStyle;
|
|
14760
|
-
const pathGeometry = shapeEl ?
|
|
14855
|
+
const pathGeometry = shapeEl ? chunkMA2BI7LX_js.getConnectorPathGeometry(shapeEl) : {
|
|
14761
14856
|
pathData: `M 0 0 L ${viewWidth} ${viewHeight}`,
|
|
14762
14857
|
startX: 0,
|
|
14763
14858
|
startY: 0,
|
|
@@ -14766,16 +14861,16 @@ var ConnectorElementRenderer = React17__default.default.memo(
|
|
|
14766
14861
|
};
|
|
14767
14862
|
const hitTargetWidth = Math.max(strokeWidth * 3, 14);
|
|
14768
14863
|
const selColor = selClr === "blue-400" ? "#60a5fa" : "#3b82f6";
|
|
14769
|
-
const lineShadow =
|
|
14770
|
-
const lineGlow =
|
|
14864
|
+
const lineShadow = chunkMA2BI7LX_js.buildLineShadowCss(el);
|
|
14865
|
+
const lineGlow = chunkMA2BI7LX_js.buildLineGlowFilter(el);
|
|
14771
14866
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14772
14867
|
"div",
|
|
14773
14868
|
{
|
|
14774
14869
|
"data-pptx-element": "true",
|
|
14775
14870
|
"data-element-id": el.id,
|
|
14776
|
-
role:
|
|
14777
|
-
"aria-label":
|
|
14778
|
-
"aria-roledescription":
|
|
14871
|
+
role: chunkMA2BI7LX_js.getAriaRole(el, { actionable: false }),
|
|
14872
|
+
"aria-label": chunkMA2BI7LX_js.getAriaLabel(el),
|
|
14873
|
+
"aria-roledescription": chunkMA2BI7LX_js.getAriaRoleDescription(el),
|
|
14779
14874
|
"aria-selected": isSelected ? true : void 0,
|
|
14780
14875
|
className: "absolute",
|
|
14781
14876
|
style: {
|
|
@@ -14808,14 +14903,14 @@ var ConnectorElementRenderer = React17__default.default.memo(
|
|
|
14808
14903
|
style: { overflow: "visible", pointerEvents: "none" },
|
|
14809
14904
|
children: [
|
|
14810
14905
|
/* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
|
|
14811
|
-
|
|
14906
|
+
chunkMA2BI7LX_js.renderConnectorMarker(
|
|
14812
14907
|
startMarkerId,
|
|
14813
14908
|
startArrow,
|
|
14814
14909
|
strokePaint,
|
|
14815
14910
|
ss?.connectorStartArrowWidth,
|
|
14816
14911
|
ss?.connectorStartArrowLength
|
|
14817
14912
|
),
|
|
14818
|
-
|
|
14913
|
+
chunkMA2BI7LX_js.renderConnectorMarker(
|
|
14819
14914
|
endMarkerId,
|
|
14820
14915
|
endArrow,
|
|
14821
14916
|
strokePaint,
|
|
@@ -14956,7 +15051,10 @@ var ConnectorElementRenderer = React17__default.default.memo(
|
|
|
14956
15051
|
);
|
|
14957
15052
|
}
|
|
14958
15053
|
);
|
|
14959
|
-
ConnectorElementRenderer
|
|
15054
|
+
var ConnectorElementRenderer = /* @__PURE__ */ withDisplayName(
|
|
15055
|
+
ConnectorElementRendererMemo,
|
|
15056
|
+
"ConnectorElementRenderer"
|
|
15057
|
+
);
|
|
14960
15058
|
function getElementInteractionProps({
|
|
14961
15059
|
element,
|
|
14962
15060
|
isEditableText,
|
|
@@ -15021,14 +15119,14 @@ function getElementInteractionProps({
|
|
|
15021
15119
|
};
|
|
15022
15120
|
}
|
|
15023
15121
|
function renderDagDuotoneFilterForElement(el) {
|
|
15024
|
-
if (!
|
|
15122
|
+
if (!chunkMA2BI7LX_js.hasDagDuotoneEffect(el)) {
|
|
15025
15123
|
return null;
|
|
15026
15124
|
}
|
|
15027
15125
|
const duotone = el.shapeStyle?.dagDuotone;
|
|
15028
15126
|
if (!duotone) {
|
|
15029
15127
|
return null;
|
|
15030
15128
|
}
|
|
15031
|
-
return
|
|
15129
|
+
return chunkMA2BI7LX_js.renderDagDuotoneSvgFilter(el.id, duotone.color1, duotone.color2);
|
|
15032
15130
|
}
|
|
15033
15131
|
function getContainerStyle({
|
|
15034
15132
|
el,
|
|
@@ -15041,7 +15139,7 @@ function getContainerStyle({
|
|
|
15041
15139
|
has3DExtrusion,
|
|
15042
15140
|
templateEditing
|
|
15043
15141
|
}) {
|
|
15044
|
-
const ss =
|
|
15142
|
+
const ss = pptx$1.hasShapeProperties(el) ? el.shapeStyle : void 0;
|
|
15045
15143
|
const isPicture = el.type === "picture" || el.type === "image";
|
|
15046
15144
|
const blurGrowVisible = Boolean(
|
|
15047
15145
|
ss?.blurGrow && typeof ss.blurRadius === "number" && ss.blurRadius > 0
|
|
@@ -15055,10 +15153,10 @@ function getContainerStyle({
|
|
|
15055
15153
|
top: isFullscreenMedia ? fs.top : el.y,
|
|
15056
15154
|
width: isFullscreenMedia ? fs.width : painted.width,
|
|
15057
15155
|
...heightStyle,
|
|
15058
|
-
transform: isFullscreenMedia ? fs.transform :
|
|
15156
|
+
transform: isFullscreenMedia ? fs.transform : chunkMA2BI7LX_js.getElementTransform(el),
|
|
15059
15157
|
transformOrigin: "center",
|
|
15060
15158
|
overflow: overflowValue,
|
|
15061
|
-
clipPath: isPicture ? void 0 : isImg && !has3DExtrusion ?
|
|
15159
|
+
clipPath: isPicture ? void 0 : isImg && !has3DExtrusion ? chunkMA2BI7LX_js.getCropShapeClipPath(el) : void 0,
|
|
15062
15160
|
zIndex: isFullscreenMedia ? fs.zIndex : zIndex,
|
|
15063
15161
|
visibility: animationState?.visible === false ? "hidden" : "visible",
|
|
15064
15162
|
animation: animationState?.cssAnimation,
|
|
@@ -15093,14 +15191,14 @@ function getContainerStyle({
|
|
|
15093
15191
|
};
|
|
15094
15192
|
}
|
|
15095
15193
|
function shapeParams(element) {
|
|
15096
|
-
const style =
|
|
15194
|
+
const style = pptx$1.hasShapeProperties(element) ? element.shapeStyle : void 0;
|
|
15097
15195
|
const strokeWidth = pptx.paintedStrokeWidth(style);
|
|
15098
|
-
const strokeColor =
|
|
15099
|
-
const fillColor =
|
|
15100
|
-
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);
|
|
15101
15199
|
return { hf: hasFill, fc: fillColor, sw: strokeWidth, sc: strokeColor };
|
|
15102
15200
|
}
|
|
15103
|
-
var
|
|
15201
|
+
var Extrusion3DOverlayMemo = /* @__PURE__ */ React17__default.default.memo(
|
|
15104
15202
|
// oxlint-disable-next-line prefer-arrow-callback -- named fn gives the memo component its displayName
|
|
15105
15203
|
function Extrusion3DOverlayInner({ data }) {
|
|
15106
15204
|
if (!data.hasExtrusion || data.panels.length === 0) {
|
|
@@ -15135,7 +15233,10 @@ var Extrusion3DOverlay = React17__default.default.memo(
|
|
|
15135
15233
|
] });
|
|
15136
15234
|
}
|
|
15137
15235
|
);
|
|
15138
|
-
Extrusion3DOverlay
|
|
15236
|
+
var Extrusion3DOverlay = /* @__PURE__ */ withDisplayName(
|
|
15237
|
+
Extrusion3DOverlayMemo,
|
|
15238
|
+
"Extrusion3DOverlay"
|
|
15239
|
+
);
|
|
15139
15240
|
|
|
15140
15241
|
// src/viewer/components/elements/scoped-element-handlers.ts
|
|
15141
15242
|
function getScopedElementHandlers(elementId, options) {
|
|
@@ -15202,7 +15303,7 @@ function ShapeEffectOverlay({
|
|
|
15202
15303
|
const fillOverlayStyle = overlay ? {
|
|
15203
15304
|
position: "absolute",
|
|
15204
15305
|
inset: 0,
|
|
15205
|
-
...
|
|
15306
|
+
...pptx$1.isImageLikeElement(element) ? chunkMA2BI7LX_js.getImageSurfaceMaskStyle(element) : {},
|
|
15206
15307
|
background: overlay.color,
|
|
15207
15308
|
mixBlendMode: overlay.blendMode,
|
|
15208
15309
|
pointerEvents: "none"
|
|
@@ -15345,7 +15446,7 @@ function ShapeEffectOverlay({
|
|
|
15345
15446
|
) : null
|
|
15346
15447
|
] });
|
|
15347
15448
|
}
|
|
15348
|
-
var ElementRenderer = React17__default.default.memo(
|
|
15449
|
+
var ElementRenderer = /* @__PURE__ */ React17__default.default.memo(
|
|
15349
15450
|
// oxlint-disable-next-line prefer-arrow-callback -- named fn gives the memo component its displayName
|
|
15350
15451
|
function ElementRendererInner({
|
|
15351
15452
|
element: el,
|
|
@@ -15409,10 +15510,10 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15409
15510
|
const backgroundAnimationState = pptx.getBackgroundAnimationState(el, presentationElementStates);
|
|
15410
15511
|
const effectPlacement = pptx.getShapeEffectLayerPlacement(el);
|
|
15411
15512
|
const visualAnimationState = backgroundAnimationState ?? animationState;
|
|
15412
|
-
const isTxt =
|
|
15413
|
-
const txtSE =
|
|
15513
|
+
const isTxt = chunkMA2BI7LX_js.isEditableTextElement(el) && allow.textEditable;
|
|
15514
|
+
const txtSE = pptx$1.hasTextProperties(el) ? el.textStyle : void 0;
|
|
15414
15515
|
const textStyleOverrideCss = pptx.buildTextStyleOverrideCss(el.id, visualAnimationState?.textStyle);
|
|
15415
|
-
const ss =
|
|
15516
|
+
const ss = chunkMA2BI7LX_js.getShapeVisualStyle(
|
|
15416
15517
|
el,
|
|
15417
15518
|
hf,
|
|
15418
15519
|
fc,
|
|
@@ -15421,9 +15522,9 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15421
15522
|
visualAnimationState?.animatesFill,
|
|
15422
15523
|
visualAnimationState?.animatesStroke
|
|
15423
15524
|
);
|
|
15424
|
-
const ts =
|
|
15525
|
+
const ts = chunkMA2BI7LX_js.getTextStyleForElement(el, chunkMA2BI7LX_js.DEFAULT_TEXT_COLOR);
|
|
15425
15526
|
const isImg = el.type === "picture" || el.type === "image";
|
|
15426
|
-
const vs =
|
|
15527
|
+
const vs = chunkMA2BI7LX_js.renderVectorShape(
|
|
15427
15528
|
el,
|
|
15428
15529
|
isImg ? false : hf,
|
|
15429
15530
|
fc,
|
|
@@ -15433,10 +15534,10 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15433
15534
|
visualAnimationState?.animatesStroke
|
|
15434
15535
|
);
|
|
15435
15536
|
const isModel3D = el.type === "model3d";
|
|
15436
|
-
const isConn =
|
|
15437
|
-
const shapeStyle3d =
|
|
15537
|
+
const isConn = chunkMA2BI7LX_js.isConnectorOrLineElement(el);
|
|
15538
|
+
const shapeStyle3d = pptx$1.hasShapeProperties(el) ? el.shapeStyle : void 0;
|
|
15438
15539
|
const extrusionData = React17.useMemo(
|
|
15439
|
-
() =>
|
|
15540
|
+
() => chunkMA2BI7LX_js.build3DExtrusionData(shapeStyle3d?.shape3d, shapeStyle3d?.scene3d, fc, el.width, el.height),
|
|
15440
15541
|
[shapeStyle3d?.shape3d, shapeStyle3d?.scene3d, fc, el.width, el.height]
|
|
15441
15542
|
);
|
|
15442
15543
|
const actionAffordance = useActionAffordance(el, canInteract);
|
|
@@ -15526,7 +15627,7 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15526
15627
|
"aria-hidden": aria.hidden ? true : void 0,
|
|
15527
15628
|
"aria-selected": isSelected ? true : void 0,
|
|
15528
15629
|
tabIndex: isFocusable ? 0 : -1,
|
|
15529
|
-
className:
|
|
15630
|
+
className: chunkMA2BI7LX_js.cn(
|
|
15530
15631
|
"absolute",
|
|
15531
15632
|
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",
|
|
15532
15633
|
cur,
|
|
@@ -15599,9 +15700,9 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15599
15700
|
txtSE,
|
|
15600
15701
|
txtS: ts,
|
|
15601
15702
|
vecShape: backgroundAnimationState && !isImg ? null : vs,
|
|
15602
|
-
imgStyle:
|
|
15603
|
-
imgFilter:
|
|
15604
|
-
imgOpacity:
|
|
15703
|
+
imgStyle: chunkMA2BI7LX_js.getImageRenderStyle(el),
|
|
15704
|
+
imgFilter: chunkMA2BI7LX_js.getImageEffectsFilter(el),
|
|
15705
|
+
imgOpacity: chunkMA2BI7LX_js.getImageEffectsOpacity(el),
|
|
15605
15706
|
imgAlt: imageAltText,
|
|
15606
15707
|
isTxtEl: isTxt,
|
|
15607
15708
|
media: mediaDataUrls,
|
|
@@ -15738,10 +15839,10 @@ function renderStrokeView(view, pressureSensitive, replayStyle, key) {
|
|
|
15738
15839
|
}
|
|
15739
15840
|
function renderInk(el, options) {
|
|
15740
15841
|
const replay = options?.replay ?? false;
|
|
15741
|
-
const strokes =
|
|
15842
|
+
const strokes = chunkMA2BI7LX_js.buildInkGroupStrokes(el, { color: "#000", width: 3 });
|
|
15742
15843
|
strokes.some((s) => s.circles || s.nibMarks);
|
|
15743
15844
|
const pressureSensitive = options?.pressureSensitive;
|
|
15744
|
-
const replayStyles = replay ?
|
|
15845
|
+
const replayStyles = replay ? chunkMA2BI7LX_js.getInkReplayStyles(el, options?.replayConfig) : null;
|
|
15745
15846
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15746
15847
|
"svg",
|
|
15747
15848
|
{
|
|
@@ -15749,7 +15850,7 @@ function renderInk(el, options) {
|
|
|
15749
15850
|
viewBox: `0 0 ${Math.max(el.width, 1)} ${Math.max(el.height, 1)}`,
|
|
15750
15851
|
preserveAspectRatio: "none",
|
|
15751
15852
|
children: [
|
|
15752
|
-
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children:
|
|
15853
|
+
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children: chunkMA2BI7LX_js.INK_REPLAY_KEYFRAMES }),
|
|
15753
15854
|
strokes.map(
|
|
15754
15855
|
(s, i) => renderStrokeView(s, pressureSensitive, replayStyles?.[i], `${el.id}-ink-${i}`)
|
|
15755
15856
|
)
|
|
@@ -15760,7 +15861,7 @@ function renderInk(el, options) {
|
|
|
15760
15861
|
function renderGroup(children, parentGroupFill) {
|
|
15761
15862
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full h-full pointer-events-none", children: pptx.filterRenderedElements(children).map((c, childIndex) => {
|
|
15762
15863
|
const { hf, fc, sw, sc } = shapeParams(c);
|
|
15763
|
-
const baseSs =
|
|
15864
|
+
const baseSs = chunkMA2BI7LX_js.getShapeVisualStyle(c, hf, fc, sw, sc);
|
|
15764
15865
|
const inheritedFill = pptx.resolveGroupChildFill(c, parentGroupFill);
|
|
15765
15866
|
const ss = inheritedFill ? {
|
|
15766
15867
|
...baseSs,
|
|
@@ -15771,9 +15872,9 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15771
15872
|
backgroundPosition: inheritedFill.backgroundPosition
|
|
15772
15873
|
} : baseSs;
|
|
15773
15874
|
const isI = c.type === "picture" || c.type === "image";
|
|
15774
|
-
const vs =
|
|
15775
|
-
const ts =
|
|
15776
|
-
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);
|
|
15777
15878
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15778
15879
|
"div",
|
|
15779
15880
|
{
|
|
@@ -15782,9 +15883,9 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15782
15883
|
style: {
|
|
15783
15884
|
left: c.x,
|
|
15784
15885
|
top: c.y,
|
|
15785
|
-
width: Math.max(c.width,
|
|
15786
|
-
height: Math.max(c.height,
|
|
15787
|
-
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),
|
|
15788
15889
|
transformOrigin: "center",
|
|
15789
15890
|
...ss,
|
|
15790
15891
|
...isI ? {
|
|
@@ -15809,8 +15910,8 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15809
15910
|
// A nested group: recurse, chaining the inherited fill so a
|
|
15810
15911
|
// `grpFill` shape under a fill-less sub-group still paints.
|
|
15811
15912
|
renderGroup(c.children, pptx.getGroupChildParentFill(c, parentGroupFill))
|
|
15812
|
-
) : isI && ("svgData" in c && c.svgData || "imageData" in c && c.imageData) ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style:
|
|
15813
|
-
|
|
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(
|
|
15814
15915
|
TiledImageLayer,
|
|
15815
15916
|
{
|
|
15816
15917
|
element: c,
|
|
@@ -15823,7 +15924,7 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15823
15924
|
src: "svgData" in c && c.svgData ? c.svgData : c.imageData,
|
|
15824
15925
|
alt: i18n.translationsEn["pptx.ink.groupChildAlt"],
|
|
15825
15926
|
className: "pointer-events-none select-none",
|
|
15826
|
-
style:
|
|
15927
|
+
style: chunkMA2BI7LX_js.getImageRenderStyle(c),
|
|
15827
15928
|
draggable: false
|
|
15828
15929
|
}
|
|
15829
15930
|
),
|
|
@@ -15835,7 +15936,7 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15835
15936
|
{
|
|
15836
15937
|
className: "relative z-10 w-full h-full pointer-events-none whitespace-pre-wrap break-words leading-[1.3]",
|
|
15837
15938
|
style: ts,
|
|
15838
|
-
children:
|
|
15939
|
+
children: chunkMA2BI7LX_js.renderTextSegments(c, chunkMA2BI7LX_js.DEFAULT_TEXT_COLOR)
|
|
15839
15940
|
}
|
|
15840
15941
|
) : null
|
|
15841
15942
|
] })
|
|
@@ -15849,8 +15950,8 @@ function renderContentPart(el, options) {
|
|
|
15849
15950
|
if (el.inkStrokes && el.inkStrokes.length > 0) {
|
|
15850
15951
|
const replay = options?.replay ?? false;
|
|
15851
15952
|
const pressureSensitive = options?.pressureSensitive ?? true;
|
|
15852
|
-
const strokes =
|
|
15853
|
-
const replayStyles = replay ?
|
|
15953
|
+
const strokes = chunkMA2BI7LX_js.buildContentPartStrokes(el);
|
|
15954
|
+
const replayStyles = replay ? chunkMA2BI7LX_js.getContentPartReplayStyles(el.inkStrokes, options?.replayConfig) : null;
|
|
15854
15955
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15855
15956
|
"svg",
|
|
15856
15957
|
{
|
|
@@ -15858,7 +15959,7 @@ function renderContentPart(el, options) {
|
|
|
15858
15959
|
viewBox: `0 0 ${Math.max(el.width, 1)} ${Math.max(el.height, 1)}`,
|
|
15859
15960
|
preserveAspectRatio: "none",
|
|
15860
15961
|
children: [
|
|
15861
|
-
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children:
|
|
15962
|
+
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children: chunkMA2BI7LX_js.INK_REPLAY_KEYFRAMES }),
|
|
15862
15963
|
strokes.map(
|
|
15863
15964
|
(s, i) => renderStrokeView(s, pressureSensitive, replayStyles?.[i], `${el.id}-cp-ink-${i}`)
|
|
15864
15965
|
)
|
|
@@ -16058,7 +16159,7 @@ function renderOleBadge(oleType) {
|
|
|
16058
16159
|
)
|
|
16059
16160
|
] });
|
|
16060
16161
|
}
|
|
16061
|
-
var InlineCollaborationContext = React17.createContext(void 0);
|
|
16162
|
+
var InlineCollaborationContext = /* @__PURE__ */ React17.createContext(void 0);
|
|
16062
16163
|
|
|
16063
16164
|
// src/viewer/components/elements/useInlineListEditor.tsx
|
|
16064
16165
|
function useInlineListEditor(element, rootRef, onChange, onModelReplacement) {
|
|
@@ -16085,9 +16186,9 @@ function useInlineListEditor(element, rootRef, onChange, onModelReplacement) {
|
|
|
16085
16186
|
collaboration: connected,
|
|
16086
16187
|
model: pptx.createInlineListModelObserver(element),
|
|
16087
16188
|
activationSelection,
|
|
16088
|
-
children: seed && !connected ?
|
|
16189
|
+
children: seed && !connected ? chunkMA2BI7LX_js.renderTextSegments(
|
|
16089
16190
|
element,
|
|
16090
|
-
|
|
16191
|
+
chunkMA2BI7LX_js.DEFAULT_TEXT_COLOR,
|
|
16091
16192
|
void 0,
|
|
16092
16193
|
void 0,
|
|
16093
16194
|
void 0,
|
|
@@ -16257,7 +16358,7 @@ function InlineTextEditor({
|
|
|
16257
16358
|
seedRef.current = {
|
|
16258
16359
|
initialText,
|
|
16259
16360
|
hasRichSegments: Boolean(
|
|
16260
|
-
|
|
16361
|
+
pptx$1.hasTextProperties(element) && element.textSegments && element.textSegments.length > 0
|
|
16261
16362
|
)
|
|
16262
16363
|
};
|
|
16263
16364
|
}
|
|
@@ -16323,8 +16424,8 @@ function InlineTextEditor({
|
|
|
16323
16424
|
pending.endOffset
|
|
16324
16425
|
);
|
|
16325
16426
|
});
|
|
16326
|
-
const warpStyle =
|
|
16327
|
-
const compensationTransform =
|
|
16427
|
+
const warpStyle = chunkMA2BI7LX_js.getTextWarpStyle(textStyleRaw);
|
|
16428
|
+
const compensationTransform = chunkMA2BI7LX_js.getTextCompensationTransform(element);
|
|
16328
16429
|
const warpTransform = warpStyle?.transform;
|
|
16329
16430
|
const mergedTransform = [compensationTransform, warpTransform].filter(Boolean).join(" ") || void 0;
|
|
16330
16431
|
const wrapperStyle = {
|
|
@@ -16335,7 +16436,7 @@ function InlineTextEditor({
|
|
|
16335
16436
|
transformOrigin: warpStyle?.transformOrigin || "center"
|
|
16336
16437
|
};
|
|
16337
16438
|
const nextInlineStyleValue = (property) => {
|
|
16338
|
-
if (!
|
|
16439
|
+
if (!pptx$1.hasTextProperties(element)) {
|
|
16339
16440
|
return true;
|
|
16340
16441
|
}
|
|
16341
16442
|
const result = pptx.getInlineEditorSelectionResult(element.textSegments);
|
|
@@ -16412,7 +16513,7 @@ function InlineTextEditor({
|
|
|
16412
16513
|
const text = e.clipboardData.getData("text/plain");
|
|
16413
16514
|
document.execCommand("insertText", false, text);
|
|
16414
16515
|
},
|
|
16415
|
-
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
|
|
16416
16517
|
},
|
|
16417
16518
|
list.seed?.paragraphs[0].token ?? "plain"
|
|
16418
16519
|
);
|
|
@@ -16420,10 +16521,10 @@ function InlineTextEditor({
|
|
|
16420
16521
|
function FailedToLoad() {
|
|
16421
16522
|
return null;
|
|
16422
16523
|
}
|
|
16423
|
-
var LazyModel3DScene = React17__default.default.lazy(
|
|
16524
|
+
var LazyModel3DScene = /* @__PURE__ */ React17__default.default.lazy(
|
|
16424
16525
|
async () => {
|
|
16425
16526
|
try {
|
|
16426
|
-
return await import('./Model3DScene-
|
|
16527
|
+
return await import('./Model3DScene-CCIG67DJ.js');
|
|
16427
16528
|
} catch {
|
|
16428
16529
|
return { default: FailedToLoad };
|
|
16429
16530
|
}
|
|
@@ -16504,7 +16605,7 @@ function Model3DRenderer({ element, width, height, interactive }) {
|
|
|
16504
16605
|
const [threeAvailable, setThreeAvailable] = React17.useState(null);
|
|
16505
16606
|
React17.useEffect(() => {
|
|
16506
16607
|
let cancelled = false;
|
|
16507
|
-
import('./three.module-
|
|
16608
|
+
import('./three.module-MBFHAT6M.js').then(() => {
|
|
16508
16609
|
if (!cancelled) {
|
|
16509
16610
|
setThreeAvailable(true);
|
|
16510
16611
|
}
|
|
@@ -17349,7 +17450,7 @@ function SmartArtRendererImpl({
|
|
|
17349
17450
|
if (!onUpdateElement || !pptx.shouldCommitSmartArtNodeText(smartArtData, nodeId, text)) {
|
|
17350
17451
|
return;
|
|
17351
17452
|
}
|
|
17352
|
-
const updated =
|
|
17453
|
+
const updated = pptx$1.updateSmartArtNodeText(smartArtData, nodeId, text);
|
|
17353
17454
|
const box = { width: element.width, height: element.height };
|
|
17354
17455
|
const reflowed = pptx.rebuildDrawingShapesIfCleared(
|
|
17355
17456
|
updated,
|
|
@@ -17365,7 +17466,7 @@ function SmartArtRendererImpl({
|
|
|
17365
17466
|
if (!onUpdateElement) {
|
|
17366
17467
|
return;
|
|
17367
17468
|
}
|
|
17368
|
-
const next =
|
|
17469
|
+
const next = pptx$1.setSmartArtNodeStyle(smartArtData, nodeId, { fillColor: fill });
|
|
17369
17470
|
if (next !== smartArtData) {
|
|
17370
17471
|
const box = { width: element.width, height: element.height };
|
|
17371
17472
|
const reflowed = pptx.rebuildDrawingShapesIfCleared(
|
|
@@ -17475,7 +17576,7 @@ function sameDiagramReveal(prev, next) {
|
|
|
17475
17576
|
}
|
|
17476
17577
|
return true;
|
|
17477
17578
|
}
|
|
17478
|
-
var SmartArtRenderer = React17__default.default.memo(SmartArtRendererImpl, arePropsEqual);
|
|
17579
|
+
var SmartArtRenderer = /* @__PURE__ */ React17__default.default.memo(SmartArtRendererImpl, arePropsEqual);
|
|
17479
17580
|
function SmartArt3DView({
|
|
17480
17581
|
element,
|
|
17481
17582
|
className,
|
|
@@ -17559,7 +17660,7 @@ function groupIntoParagraphs(element, fieldContext) {
|
|
|
17559
17660
|
element,
|
|
17560
17661
|
fieldContext ? (seg) => {
|
|
17561
17662
|
if (seg.fieldType) {
|
|
17562
|
-
const substituted =
|
|
17663
|
+
const substituted = chunkMA2BI7LX_js.substituteFieldText(
|
|
17563
17664
|
seg.text,
|
|
17564
17665
|
seg.fieldType,
|
|
17565
17666
|
fieldContext,
|
|
@@ -17594,13 +17695,13 @@ function getSegmentTspanProps(segment, element, fallbackColor) {
|
|
|
17594
17695
|
if (s.strikethrough) {
|
|
17595
17696
|
decos.push("line-through");
|
|
17596
17697
|
}
|
|
17597
|
-
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);
|
|
17598
17699
|
return {
|
|
17599
17700
|
fill,
|
|
17600
|
-
fontSize: s.fontSize ?? element.textStyle?.fontSize ??
|
|
17701
|
+
fontSize: s.fontSize ?? element.textStyle?.fontSize ?? chunkMA2BI7LX_js.DEFAULT_TEXT_FONT_SIZE,
|
|
17601
17702
|
fontWeight: pptx.resolveFontWeight(s.fontFamily || element.textStyle?.fontFamily, s.bold),
|
|
17602
17703
|
fontStyle: pptx.resolveFontItalic(s.fontFamily || element.textStyle?.fontFamily, s.italic) ? "italic" : void 0,
|
|
17603
|
-
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,
|
|
17604
17705
|
textDecoration: decos.length > 0 ? decos.join(" ") : void 0
|
|
17605
17706
|
};
|
|
17606
17707
|
}
|
|
@@ -17608,8 +17709,8 @@ function resolveSegmentFont(segment, element) {
|
|
|
17608
17709
|
const s = segment.style || {};
|
|
17609
17710
|
const family = s.fontFamily || element.textStyle?.fontFamily;
|
|
17610
17711
|
return {
|
|
17611
|
-
fontFamily: family ?
|
|
17612
|
-
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,
|
|
17613
17714
|
bold: s.bold ?? element.textStyle?.bold,
|
|
17614
17715
|
italic: s.italic ?? element.textStyle?.italic
|
|
17615
17716
|
};
|
|
@@ -17675,7 +17776,7 @@ function WarpedText({
|
|
|
17675
17776
|
fallbackColor,
|
|
17676
17777
|
fieldContext
|
|
17677
17778
|
}) {
|
|
17678
|
-
if (!
|
|
17779
|
+
if (!pptx$1.hasTextProperties(element)) {
|
|
17679
17780
|
return null;
|
|
17680
17781
|
}
|
|
17681
17782
|
const textEl = element;
|
|
@@ -17693,9 +17794,9 @@ function WarpedText({
|
|
|
17693
17794
|
const warpAdj2 = textEl.textStyle?.textWarpAdj2;
|
|
17694
17795
|
const align = textEl.textStyle?.align ?? "center";
|
|
17695
17796
|
const { startOffset, textAnchor } = getAlignmentProps(align);
|
|
17696
|
-
const baseFontSize = textEl.textStyle?.fontSize ??
|
|
17697
|
-
const baseFontFamily = textEl.textStyle?.fontFamily ?
|
|
17698
|
-
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);
|
|
17699
17800
|
if (pptx.hasGlyphEnvelope(preset)) {
|
|
17700
17801
|
const perLine = pptx.buildGlyphEnvelopeBlock(
|
|
17701
17802
|
preset,
|
|
@@ -17794,11 +17895,15 @@ function WarpedText({
|
|
|
17794
17895
|
}
|
|
17795
17896
|
);
|
|
17796
17897
|
}
|
|
17797
|
-
var GLYPH_BY_SHAPE =
|
|
17798
|
-
|
|
17799
|
-
|
|
17800
|
-
|
|
17801
|
-
|
|
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
|
+
}
|
|
17802
17907
|
function isActionButtonShape(shapeType) {
|
|
17803
17908
|
return Boolean(shapeType && shapeType in GLYPH_BY_SHAPE);
|
|
17804
17909
|
}
|
|
@@ -17865,11 +17970,11 @@ function renderTextElementBody(options) {
|
|
|
17865
17970
|
const isLinkedTextBox = pptx.isLinkedTextBox(el);
|
|
17866
17971
|
const linkedSegments = pptx.getOverflowSegments(el, slideElements);
|
|
17867
17972
|
const useSvgWarp = pptx.shouldUseSvgWarp(
|
|
17868
|
-
|
|
17973
|
+
pptx$1.hasTextProperties(el) ? el.textStyle?.textWarpPreset : void 0
|
|
17869
17974
|
);
|
|
17870
|
-
const scene3dStyle =
|
|
17975
|
+
const scene3dStyle = pptx$1.hasTextProperties(el) ? chunkMA2BI7LX_js.buildTextBody3DSceneStyle(el.textStyle, { width: el.width, height: el.height }) : void 0;
|
|
17871
17976
|
const rotationTransform = pptx.getTextBodyRotationTransform(el);
|
|
17872
|
-
const composedTransform = [rotationTransform,
|
|
17977
|
+
const composedTransform = [rotationTransform, chunkMA2BI7LX_js.getTextCompensationTransform(el), scene3dStyle?.transform].filter(Boolean).join(" ") || void 0;
|
|
17873
17978
|
const transformStyle = {
|
|
17874
17979
|
transform: composedTransform,
|
|
17875
17980
|
// A COM-measured homography (`scene3dStyle.transformOrigin === '0 0'`)
|
|
@@ -17899,18 +18004,18 @@ function renderTextElementBody(options) {
|
|
|
17899
18004
|
shouldRenderText && (useSvgWarp ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
17900
18005
|
"div",
|
|
17901
18006
|
{
|
|
17902
|
-
className:
|
|
18007
|
+
className: chunkMA2BI7LX_js.cn(
|
|
17903
18008
|
"relative z-10 w-full h-full",
|
|
17904
18009
|
onHyperlinkClick ? "" : "pointer-events-none"
|
|
17905
18010
|
),
|
|
17906
|
-
style: { ...
|
|
18011
|
+
style: { ...chunkMA2BI7LX_js.getTextLayoutStyle(el), ...transformStyle },
|
|
17907
18012
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17908
18013
|
WarpedText,
|
|
17909
18014
|
{
|
|
17910
18015
|
element: el,
|
|
17911
18016
|
width: el.width,
|
|
17912
18017
|
height: el.height,
|
|
17913
|
-
fallbackColor:
|
|
18018
|
+
fallbackColor: chunkMA2BI7LX_js.DEFAULT_TEXT_COLOR,
|
|
17914
18019
|
findHighlights: findHl,
|
|
17915
18020
|
fieldContext
|
|
17916
18021
|
}
|
|
@@ -17919,19 +18024,19 @@ function renderTextElementBody(options) {
|
|
|
17919
18024
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
17920
18025
|
"div",
|
|
17921
18026
|
{
|
|
17922
|
-
className:
|
|
18027
|
+
className: chunkMA2BI7LX_js.cn(
|
|
17923
18028
|
"relative z-10 w-full h-full whitespace-pre-wrap break-words leading-[1.3]",
|
|
17924
18029
|
onHyperlinkClick ? "" : "pointer-events-none"
|
|
17925
18030
|
),
|
|
17926
18031
|
style: {
|
|
17927
|
-
...
|
|
18032
|
+
...chunkMA2BI7LX_js.getTextLayoutStyle(el),
|
|
17928
18033
|
...txtS,
|
|
17929
|
-
...
|
|
18034
|
+
...chunkMA2BI7LX_js.getTextWarpStyle(txtSE),
|
|
17930
18035
|
...transformStyle
|
|
17931
18036
|
},
|
|
17932
|
-
children:
|
|
18037
|
+
children: chunkMA2BI7LX_js.renderTextSegments(
|
|
17933
18038
|
el,
|
|
17934
|
-
|
|
18039
|
+
chunkMA2BI7LX_js.DEFAULT_TEXT_COLOR,
|
|
17935
18040
|
void 0,
|
|
17936
18041
|
findHl,
|
|
17937
18042
|
onHyperlinkClick,
|
|
@@ -18250,7 +18355,7 @@ function renderBody(options) {
|
|
|
18250
18355
|
);
|
|
18251
18356
|
}
|
|
18252
18357
|
if (isImg) {
|
|
18253
|
-
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: [
|
|
18254
18359
|
renderImg(el, imgStyle, imgFilter, imgAlt, imgOpacity),
|
|
18255
18360
|
vecShape ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none absolute inset-0", children: vecShape }) : null
|
|
18256
18361
|
] });
|
|
@@ -18267,7 +18372,7 @@ function renderBody(options) {
|
|
|
18267
18372
|
textDirection: txtSE?.textDirection,
|
|
18268
18373
|
textStyle: txtS,
|
|
18269
18374
|
textStyleRaw: txtSE,
|
|
18270
|
-
layoutStyle:
|
|
18375
|
+
layoutStyle: chunkMA2BI7LX_js.getTextLayoutStyle(el),
|
|
18271
18376
|
element: el,
|
|
18272
18377
|
onCommit,
|
|
18273
18378
|
onCancel,
|
|
@@ -18278,7 +18383,7 @@ function renderBody(options) {
|
|
|
18278
18383
|
] });
|
|
18279
18384
|
}
|
|
18280
18385
|
if (el.type === "table") {
|
|
18281
|
-
return
|
|
18386
|
+
return chunkMA2BI7LX_js.renderTableElement(el, txtS, {
|
|
18282
18387
|
editable: isSel,
|
|
18283
18388
|
selectedCell: isSel ? tableSt : null,
|
|
18284
18389
|
onSelectCell: onCellSel,
|
|
@@ -18311,7 +18416,7 @@ function renderBody(options) {
|
|
|
18311
18416
|
);
|
|
18312
18417
|
}
|
|
18313
18418
|
if (el.type === "media") {
|
|
18314
|
-
return
|
|
18419
|
+
return chunkMA2BI7LX_js.renderMediaElement(el, media, {
|
|
18315
18420
|
// Present mode autoplays every media element on the active slide,
|
|
18316
18421
|
// not only ones persisted with their own `autoPlay` flag (matching
|
|
18317
18422
|
// the other four bindings' unconditional `presenting`-gated
|
|
@@ -18334,7 +18439,7 @@ function renderBody(options) {
|
|
|
18334
18439
|
onPlayStateChange: handleMediaPlayStateChange
|
|
18335
18440
|
});
|
|
18336
18441
|
}
|
|
18337
|
-
if (doInk &&
|
|
18442
|
+
if (doInk && pptx$1.isInkElement(el)) {
|
|
18338
18443
|
return renderInk(el, {
|
|
18339
18444
|
replay: isPresentationPassive,
|
|
18340
18445
|
pressureSensitive: true
|
|
@@ -18363,27 +18468,27 @@ function renderBody(options) {
|
|
|
18363
18468
|
}
|
|
18364
18469
|
return renderGroup(el.children, pptx.getGroupChildParentFill(el));
|
|
18365
18470
|
}
|
|
18366
|
-
if (
|
|
18367
|
-
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) });
|
|
18368
18473
|
}
|
|
18369
18474
|
return renderTextElementBody(options);
|
|
18370
18475
|
}
|
|
18371
18476
|
function defaultTextColorForFill(fillColor) {
|
|
18372
18477
|
const hex = String(fillColor ?? "").replace(/^#/u, "");
|
|
18373
18478
|
if (!/^[0-9a-f]{6}$/iu.test(hex)) {
|
|
18374
|
-
return
|
|
18479
|
+
return chunkMA2BI7LX_js.DEFAULT_TEXT_COLOR;
|
|
18375
18480
|
}
|
|
18376
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);
|
|
18377
18482
|
const luminance = channels[0] * 0.2126 + channels[1] * 0.7152 + channels[2] * 0.0722;
|
|
18378
|
-
return luminance > 0.179 ?
|
|
18483
|
+
return luminance > 0.179 ? chunkMA2BI7LX_js.DEFAULT_TEXT_COLOR : "#ffffff";
|
|
18379
18484
|
}
|
|
18380
18485
|
function getStaticElementVisualState(element, parentGroupFill) {
|
|
18381
|
-
const style =
|
|
18382
|
-
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(
|
|
18383
|
-
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);
|
|
18384
18489
|
const strokeWidth = pptx.paintedStrokeWidth(style);
|
|
18385
|
-
const stroke =
|
|
18386
|
-
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);
|
|
18387
18492
|
const inheritedFill = pptx.resolveGroupChildFill(element, parentGroupFill);
|
|
18388
18493
|
const visualStyle = inheritedFill ? {
|
|
18389
18494
|
...baseVisualStyle,
|
|
@@ -18393,13 +18498,13 @@ function getStaticElementVisualState(element, parentGroupFill) {
|
|
|
18393
18498
|
backgroundSize: inheritedFill.backgroundSize,
|
|
18394
18499
|
backgroundPosition: inheritedFill.backgroundPosition
|
|
18395
18500
|
} : baseVisualStyle;
|
|
18396
|
-
const textStyle =
|
|
18501
|
+
const textStyle = chunkMA2BI7LX_js.getTextStyleForElement(
|
|
18397
18502
|
element,
|
|
18398
|
-
element.type === "shape" && hasFill ? defaultTextColorForFill(fill) :
|
|
18503
|
+
element.type === "shape" && hasFill ? defaultTextColorForFill(fill) : chunkMA2BI7LX_js.DEFAULT_TEXT_COLOR
|
|
18399
18504
|
);
|
|
18400
18505
|
const isImage = element.type === "picture" || element.type === "image";
|
|
18401
|
-
const letsTextOverflow =
|
|
18402
|
-
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;
|
|
18403
18508
|
const isCallout = pptx.isWedgeCalloutPresetShape(shapeType) || String(shapeType ?? "").toLowerCase().includes("callout");
|
|
18404
18509
|
return {
|
|
18405
18510
|
hasFill,
|
|
@@ -18420,7 +18525,7 @@ function getStaticElementInteractionState(element, hasActionHandler, exposeEleme
|
|
|
18420
18525
|
return { action, isActionable, contractRole };
|
|
18421
18526
|
}
|
|
18422
18527
|
function getStaticElementWrapperClassName(element, visual, positioned, isActionable) {
|
|
18423
|
-
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";
|
|
18424
18529
|
const pointerClass = isActionable ? "pointer-events-auto cursor-pointer" : "pointer-events-none";
|
|
18425
18530
|
return `${positioned ? "absolute" : "relative"} ${overflowClass} ${pointerClass}`;
|
|
18426
18531
|
}
|
|
@@ -18503,7 +18608,7 @@ function StaticElementRendererImpl({
|
|
|
18503
18608
|
top: positioned ? element.y : void 0,
|
|
18504
18609
|
width: positioned ? Math.max(element.width, 1) : "100%",
|
|
18505
18610
|
height: positioned ? Math.max(element.height, 1) : "100%",
|
|
18506
|
-
transform: positioned ?
|
|
18611
|
+
transform: positioned ? chunkMA2BI7LX_js.getElementTransform(element) : void 0,
|
|
18507
18612
|
transformOrigin: "center",
|
|
18508
18613
|
zIndex,
|
|
18509
18614
|
...visualStyle,
|
|
@@ -18544,20 +18649,20 @@ function StaticElementRendererImpl({
|
|
|
18544
18649
|
isEditing: false,
|
|
18545
18650
|
editText: "",
|
|
18546
18651
|
spellCheck: false,
|
|
18547
|
-
txtSE:
|
|
18652
|
+
txtSE: pptx$1.hasTextProperties(element) ? element.textStyle : void 0,
|
|
18548
18653
|
txtS: textStyle,
|
|
18549
|
-
vecShape:
|
|
18654
|
+
vecShape: chunkMA2BI7LX_js.renderVectorShape(
|
|
18550
18655
|
element,
|
|
18551
18656
|
isImage ? false : hasFill,
|
|
18552
18657
|
fill,
|
|
18553
18658
|
strokeWidth,
|
|
18554
18659
|
stroke
|
|
18555
18660
|
),
|
|
18556
|
-
imgStyle: imageAnimation ? { ...
|
|
18557
|
-
imgFilter:
|
|
18558
|
-
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),
|
|
18559
18664
|
imgAlt: "",
|
|
18560
|
-
isTxtEl:
|
|
18665
|
+
isTxtEl: chunkMA2BI7LX_js.isEditableTextElement(element),
|
|
18561
18666
|
media: mediaDataUrls,
|
|
18562
18667
|
tableSt: null,
|
|
18563
18668
|
isSel: false,
|
|
@@ -18586,8 +18691,10 @@ function StaticElementRendererImpl({
|
|
|
18586
18691
|
}
|
|
18587
18692
|
);
|
|
18588
18693
|
}
|
|
18589
|
-
var StaticElementRenderer =
|
|
18590
|
-
|
|
18694
|
+
var StaticElementRenderer = /* @__PURE__ */ withDisplayName(
|
|
18695
|
+
/* @__PURE__ */ React17__default.default.memo(StaticElementRendererImpl),
|
|
18696
|
+
"StaticElementRenderer"
|
|
18697
|
+
);
|
|
18591
18698
|
function SlideLayer({
|
|
18592
18699
|
slide,
|
|
18593
18700
|
templateElements,
|
|
@@ -18603,7 +18710,7 @@ function SlideLayer({
|
|
|
18603
18710
|
style: {
|
|
18604
18711
|
width: safeWidth,
|
|
18605
18712
|
height: safeHeight,
|
|
18606
|
-
backgroundColor: slide.backgroundColor ?
|
|
18713
|
+
backgroundColor: slide.backgroundColor ? chunkMA2BI7LX_js.normalizeHexColor(slide.backgroundColor, "#ffffff") : "#ffffff",
|
|
18607
18714
|
backgroundImage: slide.backgroundImage ? `url(${slide.backgroundImage})` : slide.backgroundGradient ? slide.backgroundGradient : void 0,
|
|
18608
18715
|
backgroundSize: slide.backgroundImage ? "cover" : void 0,
|
|
18609
18716
|
backgroundPosition: slide.backgroundImage ? "center" : void 0
|
|
@@ -19190,6 +19297,7 @@ exports.useReadOnlyRecommendationState = useReadOnlyRecommendationState;
|
|
|
19190
19297
|
exports.useRecoveryDetection = useRecoveryDetection;
|
|
19191
19298
|
exports.useReducedMotion = useReducedMotion;
|
|
19192
19299
|
exports.useRehearsalTimings = useRehearsalTimings;
|
|
19300
|
+
exports.useReportOnChange = useReportOnChange;
|
|
19193
19301
|
exports.useResizablePanels = useResizablePanels;
|
|
19194
19302
|
exports.useSectionOperations = useSectionOperations;
|
|
19195
19303
|
exports.useSerialize = useSerialize;
|
|
@@ -19216,3 +19324,4 @@ exports.useYjsDocumentSync = useYjsDocumentSync;
|
|
|
19216
19324
|
exports.useYjsProvider = useYjsProvider;
|
|
19217
19325
|
exports.useZoomNavigation = useZoomNavigation;
|
|
19218
19326
|
exports.useZoomViewport = useZoomViewport;
|
|
19327
|
+
exports.withDisplayName = withDisplayName;
|