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