pptx-react-viewer 4.43.0 → 4.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +52 -0
- package/dist/{AiChatPanel-VI2IQ7XU.js → AiChatPanel-TGZQBH3L.js} +9 -9
- package/dist/AiChatPanel-TGZQBH3L.js.br +0 -0
- package/dist/AiChatPanel-TGZQBH3L.js.gz +0 -0
- package/dist/{AiChatPanel-R5UTSMXU.mjs → AiChatPanel-Z5VHI4WA.mjs} +1 -1
- package/dist/AiChatPanel-Z5VHI4WA.mjs.br +0 -0
- package/dist/AiChatPanel-Z5VHI4WA.mjs.gz +0 -0
- package/dist/{chunk-GLWV52C6.js → chunk-2YCROYR6.js} +333 -263
- package/dist/chunk-2YCROYR6.js.br +0 -0
- package/dist/chunk-2YCROYR6.js.gz +0 -0
- package/dist/{chunk-UACDKMXF.mjs → chunk-66APV3YZ.mjs} +91 -21
- package/dist/chunk-66APV3YZ.mjs.br +0 -0
- package/dist/chunk-66APV3YZ.mjs.gz +0 -0
- package/dist/{chunk-3LIHPZKS.mjs → chunk-FBN7UFW2.mjs} +15 -9
- package/dist/chunk-FBN7UFW2.mjs.br +0 -0
- package/dist/chunk-FBN7UFW2.mjs.gz +0 -0
- package/dist/{chunk-CHPELGQD.js → chunk-KUQRWMIK.js} +1455 -1434
- package/dist/chunk-KUQRWMIK.js.br +0 -0
- package/dist/chunk-KUQRWMIK.js.gz +0 -0
- package/dist/{chunk-FKY33ZKL.js → chunk-VJZJESNT.js} +14 -8
- package/dist/chunk-VJZJESNT.js.br +0 -0
- package/dist/chunk-VJZJESNT.js.gz +0 -0
- package/dist/{chunk-ITV63NJ5.mjs → chunk-VUE3EPTJ.mjs} +148 -127
- package/dist/chunk-VUE3EPTJ.mjs.br +0 -0
- package/dist/chunk-VUE3EPTJ.mjs.gz +0 -0
- package/dist/index.d.ts +21 -3
- package/dist/index.js +24 -24
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +12 -3
- package/dist/internals.js +81 -81
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +2 -2
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.d.ts +14 -3
- package/dist/viewer/index.js +19 -19
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +3 -3
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +3 -3
- package/dist/AiChatPanel-R5UTSMXU.mjs.br +0 -0
- package/dist/AiChatPanel-R5UTSMXU.mjs.gz +0 -0
- package/dist/AiChatPanel-VI2IQ7XU.js.br +0 -0
- package/dist/AiChatPanel-VI2IQ7XU.js.gz +0 -0
- package/dist/chunk-3LIHPZKS.mjs.br +0 -0
- package/dist/chunk-3LIHPZKS.mjs.gz +0 -0
- package/dist/chunk-CHPELGQD.js.br +0 -0
- package/dist/chunk-CHPELGQD.js.gz +0 -0
- package/dist/chunk-FKY33ZKL.js.br +0 -0
- package/dist/chunk-FKY33ZKL.js.gz +0 -0
- package/dist/chunk-GLWV52C6.js.br +0 -0
- package/dist/chunk-GLWV52C6.js.gz +0 -0
- package/dist/chunk-ITV63NJ5.mjs.br +0 -0
- package/dist/chunk-ITV63NJ5.mjs.gz +0 -0
- package/dist/chunk-UACDKMXF.mjs.br +0 -0
- package/dist/chunk-UACDKMXF.mjs.gz +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkVJZJESNT_js = require('./chunk-VJZJESNT.js');
|
|
4
4
|
var pptx = require('ooxml-ui/pptx');
|
|
5
5
|
var React17 = require('react');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -497,15 +497,70 @@ function useCollaborationSession({ config }) {
|
|
|
497
497
|
const external = useExternalYjsSession(config?.externalSession);
|
|
498
498
|
return config?.externalSession ? external : owned;
|
|
499
499
|
}
|
|
500
|
+
function useOwnedCollaboration(config) {
|
|
501
|
+
const needs = Boolean(config && pptx.needsOwnedSession(config));
|
|
502
|
+
const [opened, setOpened] = React17.useState(null);
|
|
503
|
+
React17.useEffect(() => {
|
|
504
|
+
if (!config || !pptx.needsOwnedSession(config)) {
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
const owned = pptx.openOwnedCollaboration(config);
|
|
508
|
+
let live = true;
|
|
509
|
+
owned.ready.then(
|
|
510
|
+
(prepared) => {
|
|
511
|
+
if (live && prepared) {
|
|
512
|
+
setOpened({ source: config, prepared });
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
() => {
|
|
516
|
+
if (live) {
|
|
517
|
+
setOpened({ failed: true });
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
);
|
|
521
|
+
return () => {
|
|
522
|
+
live = false;
|
|
523
|
+
owned.release();
|
|
524
|
+
setOpened(null);
|
|
525
|
+
};
|
|
526
|
+
}, [
|
|
527
|
+
needs,
|
|
528
|
+
config?.roomId,
|
|
529
|
+
config?.provider,
|
|
530
|
+
config?.serverUrl,
|
|
531
|
+
config?.transport,
|
|
532
|
+
config?.role,
|
|
533
|
+
config?.userName,
|
|
534
|
+
config?.userColor,
|
|
535
|
+
config?.userAvatar
|
|
536
|
+
]);
|
|
537
|
+
return React17.useMemo(() => {
|
|
538
|
+
if (!needs) {
|
|
539
|
+
return { config, holding: false, status: void 0 };
|
|
540
|
+
}
|
|
541
|
+
if (opened && "prepared" in opened) {
|
|
542
|
+
return {
|
|
543
|
+
config: { ...config, externalSession: opened.prepared.externalSession },
|
|
544
|
+
holding: false,
|
|
545
|
+
status: void 0
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
return { config, holding: true, status: opened ? "error" : "connecting" };
|
|
549
|
+
}, [needs, config, opened]);
|
|
550
|
+
}
|
|
500
551
|
|
|
501
552
|
// src/viewer/hooks/collaboration/useCollaborativeState.ts
|
|
502
553
|
function useCollaborativeState({
|
|
503
|
-
config,
|
|
554
|
+
config: requested,
|
|
504
555
|
canvasWidth,
|
|
505
556
|
canvasHeight
|
|
506
557
|
}) {
|
|
558
|
+
const ownedSession = useOwnedCollaboration(requested);
|
|
559
|
+
const config = ownedSession.config;
|
|
507
560
|
const userColor = pptx.sanitizeColor(config?.userColor, "#6366f1");
|
|
508
|
-
const
|
|
561
|
+
const session = useCollaborationSession({ config: ownedSession.holding ? void 0 : config });
|
|
562
|
+
const { awareness, doc, clientId, synced, retry } = session;
|
|
563
|
+
const status = ownedSession.status ?? session.status;
|
|
509
564
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
510
565
|
awareness,
|
|
511
566
|
localClientId: clientId,
|
|
@@ -518,8 +573,18 @@ function useCollaborativeState({
|
|
|
518
573
|
});
|
|
519
574
|
const connectedCount = status === "connected" ? remoteUsers.length + 1 : remoteUsers.length;
|
|
520
575
|
return React17.useMemo(
|
|
521
|
-
() => config ? {
|
|
522
|
-
|
|
576
|
+
() => config ? {
|
|
577
|
+
status,
|
|
578
|
+
remoteUsers,
|
|
579
|
+
broadcastPresence,
|
|
580
|
+
connectedCount,
|
|
581
|
+
config,
|
|
582
|
+
doc,
|
|
583
|
+
synced,
|
|
584
|
+
retry,
|
|
585
|
+
clientId
|
|
586
|
+
} : null,
|
|
587
|
+
[status, remoteUsers, broadcastPresence, connectedCount, config, doc, synced, retry, clientId]
|
|
523
588
|
);
|
|
524
589
|
}
|
|
525
590
|
var CollaborationContext = React17.createContext(null);
|
|
@@ -684,9 +749,9 @@ function serializeHistoryDocument(snapshot) {
|
|
|
684
749
|
}
|
|
685
750
|
function recordExplicitSlideUpdate(past, future, previous, before, label, maxDepth) {
|
|
686
751
|
if (previous && serializeHistoryDocument(previous) !== serializeHistoryDocument(before)) {
|
|
687
|
-
past.push(
|
|
752
|
+
past.push(chunkVJZJESNT_js.cloneHistorySnapshot(previous));
|
|
688
753
|
}
|
|
689
|
-
past.push({ ...
|
|
754
|
+
past.push({ ...chunkVJZJESNT_js.cloneHistorySnapshot(before), actionLabel: label });
|
|
690
755
|
while (past.length > Math.max(1, maxDepth)) {
|
|
691
756
|
past.shift();
|
|
692
757
|
}
|
|
@@ -776,8 +841,8 @@ function useEditorHistory(input) {
|
|
|
776
841
|
width: canvasSize.width,
|
|
777
842
|
height: canvasSize.height,
|
|
778
843
|
activeSlideIndex,
|
|
779
|
-
slides: slides.map(
|
|
780
|
-
templateElementsBySlideId:
|
|
844
|
+
slides: slides.map(chunkVJZJESNT_js.cloneSlide),
|
|
845
|
+
templateElementsBySlideId: chunkVJZJESNT_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
781
846
|
...actionLabel ? { actionLabel } : {}
|
|
782
847
|
};
|
|
783
848
|
},
|
|
@@ -790,9 +855,9 @@ function useEditorHistory(input) {
|
|
|
790
855
|
width: snapshot.width,
|
|
791
856
|
height: snapshot.height
|
|
792
857
|
});
|
|
793
|
-
setSlides(snapshot.slides.map(
|
|
858
|
+
setSlides(snapshot.slides.map(chunkVJZJESNT_js.cloneSlide));
|
|
794
859
|
setTemplateElementsBySlideId(
|
|
795
|
-
|
|
860
|
+
chunkVJZJESNT_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
796
861
|
);
|
|
797
862
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
798
863
|
setSelectedElementIds([]);
|
|
@@ -831,8 +896,8 @@ function useEditorHistory(input) {
|
|
|
831
896
|
const currentSnapshot = buildHistorySnapshot(previousSnapshot.actionLabel);
|
|
832
897
|
historyFutureRef.current.push(currentSnapshot);
|
|
833
898
|
isApplyingHistoryRef.current = true;
|
|
834
|
-
const nextSnapshot =
|
|
835
|
-
lastHistorySnapshotRef.current =
|
|
899
|
+
const nextSnapshot = chunkVJZJESNT_js.cloneHistorySnapshot(previousSnapshot);
|
|
900
|
+
lastHistorySnapshotRef.current = chunkVJZJESNT_js.cloneHistorySnapshot(nextSnapshot);
|
|
836
901
|
lastHistorySerializedRef.current = serializeHistoryDocument(nextSnapshot);
|
|
837
902
|
applyHistorySnapshot(nextSnapshot);
|
|
838
903
|
updateHistoryAvailability();
|
|
@@ -853,8 +918,8 @@ function useEditorHistory(input) {
|
|
|
853
918
|
const currentSnapshot = buildHistorySnapshot(nextSnapshot.actionLabel);
|
|
854
919
|
historyPastRef.current.push(currentSnapshot);
|
|
855
920
|
isApplyingHistoryRef.current = true;
|
|
856
|
-
const targetSnapshot =
|
|
857
|
-
lastHistorySnapshotRef.current =
|
|
921
|
+
const targetSnapshot = chunkVJZJESNT_js.cloneHistorySnapshot(nextSnapshot);
|
|
922
|
+
lastHistorySnapshotRef.current = chunkVJZJESNT_js.cloneHistorySnapshot(targetSnapshot);
|
|
858
923
|
lastHistorySerializedRef.current = serializeHistoryDocument(targetSnapshot);
|
|
859
924
|
applyHistorySnapshot(targetSnapshot);
|
|
860
925
|
updateHistoryAvailability();
|
|
@@ -872,7 +937,7 @@ function useEditorHistory(input) {
|
|
|
872
937
|
historyPastRef.current = [];
|
|
873
938
|
historyFutureRef.current = [];
|
|
874
939
|
if (initialSnapshot) {
|
|
875
|
-
const clonedInitial =
|
|
940
|
+
const clonedInitial = chunkVJZJESNT_js.cloneHistorySnapshot(initialSnapshot);
|
|
876
941
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
877
942
|
lastHistorySerializedRef.current = serializeHistoryDocument(clonedInitial);
|
|
878
943
|
} else {
|
|
@@ -954,8 +1019,8 @@ function useEditorHistory(input) {
|
|
|
954
1019
|
updateHistoryAvailability
|
|
955
1020
|
]);
|
|
956
1021
|
const commitSlides = (nextSlides, label, beforeSlides = slides) => {
|
|
957
|
-
const before = { ...buildHistorySnapshot(), slides: beforeSlides.map(
|
|
958
|
-
const after = { ...before, slides: nextSlides.map(
|
|
1022
|
+
const before = { ...buildHistorySnapshot(), slides: beforeSlides.map(chunkVJZJESNT_js.cloneSlide) };
|
|
1023
|
+
const after = { ...before, slides: nextSlides.map(chunkVJZJESNT_js.cloneSlide) };
|
|
959
1024
|
recordExplicitSlideUpdate(
|
|
960
1025
|
historyPastRef.current,
|
|
961
1026
|
historyFutureRef.current,
|
|
@@ -964,7 +1029,7 @@ function useEditorHistory(input) {
|
|
|
964
1029
|
label,
|
|
965
1030
|
maxHistoryEntries
|
|
966
1031
|
);
|
|
967
|
-
lastHistorySnapshotRef.current =
|
|
1032
|
+
lastHistorySnapshotRef.current = chunkVJZJESNT_js.cloneHistorySnapshot(after);
|
|
968
1033
|
lastHistorySerializedRef.current = serializeHistoryDocument(after);
|
|
969
1034
|
isApplyingHistoryRef.current = false;
|
|
970
1035
|
setSlides(nextSlides);
|
|
@@ -1151,22 +1216,22 @@ function useZoomViewport({
|
|
|
1151
1216
|
selectedElements.forEach((element) => {
|
|
1152
1217
|
minX = Math.min(minX, element.x);
|
|
1153
1218
|
minY = Math.min(minY, element.y);
|
|
1154
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
1155
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
1219
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkVJZJESNT_js.MIN_ELEMENT_SIZE));
|
|
1220
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkVJZJESNT_js.MIN_ELEMENT_SIZE));
|
|
1156
1221
|
});
|
|
1157
1222
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
1158
1223
|
return;
|
|
1159
1224
|
}
|
|
1160
1225
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
1161
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
1162
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
1226
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkVJZJESNT_js.MIN_ELEMENT_SIZE);
|
|
1227
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkVJZJESNT_js.MIN_ELEMENT_SIZE);
|
|
1163
1228
|
const availableWidth = Math.max(
|
|
1164
|
-
effectiveEditorDimensions.width -
|
|
1165
|
-
|
|
1229
|
+
effectiveEditorDimensions.width - chunkVJZJESNT_js.ZOOM_TO_SELECTION_PADDING,
|
|
1230
|
+
chunkVJZJESNT_js.MIN_ELEMENT_SIZE
|
|
1166
1231
|
);
|
|
1167
1232
|
const availableHeight = Math.max(
|
|
1168
|
-
effectiveEditorDimensions.height -
|
|
1169
|
-
|
|
1233
|
+
effectiveEditorDimensions.height - chunkVJZJESNT_js.ZOOM_TO_SELECTION_PADDING,
|
|
1234
|
+
chunkVJZJESNT_js.MIN_ELEMENT_SIZE
|
|
1170
1235
|
);
|
|
1171
1236
|
const targetEditorScale = Math.min(
|
|
1172
1237
|
availableWidth / boundsWidth,
|
|
@@ -4133,8 +4198,8 @@ function useViewerCoreState(_input) {
|
|
|
4133
4198
|
const { slides, setSlides, slidesRef } = useSlideState();
|
|
4134
4199
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = React17.useState({});
|
|
4135
4200
|
const [canvasSize, setCanvasSize] = React17.useState({
|
|
4136
|
-
width:
|
|
4137
|
-
height:
|
|
4201
|
+
width: chunkVJZJESNT_js.DEFAULT_CANVAS_WIDTH,
|
|
4202
|
+
height: chunkVJZJESNT_js.DEFAULT_CANVAS_HEIGHT
|
|
4138
4203
|
});
|
|
4139
4204
|
const [slideSizeEmu, setSlideSizeEmu] = React17.useState();
|
|
4140
4205
|
const [activeSlideIndex, setActiveSlideIndex] = React17.useState(0);
|
|
@@ -4522,7 +4587,7 @@ function useLoadContent({
|
|
|
4522
4587
|
}
|
|
4523
4588
|
let cancelled = false;
|
|
4524
4589
|
const token = ++renderTokenRef.current;
|
|
4525
|
-
const handler = new
|
|
4590
|
+
const handler = new chunkVJZJESNT_js.dist_exports.PptxHandler();
|
|
4526
4591
|
const resources = pptx.createPresentationLoadResources(handler);
|
|
4527
4592
|
const loadBlobUrls = resources.blobUrls;
|
|
4528
4593
|
(async () => {
|
|
@@ -4607,12 +4672,12 @@ function useLoadContent({
|
|
|
4607
4672
|
}
|
|
4608
4673
|
resources.commit();
|
|
4609
4674
|
handlerRef.current = handler;
|
|
4610
|
-
const partition =
|
|
4675
|
+
const partition = chunkVJZJESNT_js.partitionTemplateElements(nextSlides);
|
|
4611
4676
|
setSlides(partition.slides);
|
|
4612
4677
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4613
4678
|
setCanvasSize({
|
|
4614
|
-
width: parsed.width ??
|
|
4615
|
-
height: parsed.height ??
|
|
4679
|
+
width: parsed.width ?? chunkVJZJESNT_js.DEFAULT_CANVAS_WIDTH,
|
|
4680
|
+
height: parsed.height ?? chunkVJZJESNT_js.DEFAULT_CANVAS_HEIGHT
|
|
4616
4681
|
});
|
|
4617
4682
|
setSlideSizeEmu(
|
|
4618
4683
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4676,7 +4741,7 @@ function useLoadContent({
|
|
|
4676
4741
|
onContentApplied?.();
|
|
4677
4742
|
} catch (err) {
|
|
4678
4743
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4679
|
-
if (err instanceof
|
|
4744
|
+
if (err instanceof chunkVJZJESNT_js.dist_exports.EncryptedFileError) {
|
|
4680
4745
|
setIsEncrypted(true);
|
|
4681
4746
|
} else {
|
|
4682
4747
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4801,7 +4866,7 @@ function useTextElementOperations(input) {
|
|
|
4801
4866
|
updateSelectedElement
|
|
4802
4867
|
} = input;
|
|
4803
4868
|
const liveTextSegments = React17.useCallback(() => {
|
|
4804
|
-
if (!selectedElement || !(0,
|
|
4869
|
+
if (!selectedElement || !(0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(selectedElement)) {
|
|
4805
4870
|
return void 0;
|
|
4806
4871
|
}
|
|
4807
4872
|
if (selectedElement.id !== inlineEditingElementId) {
|
|
@@ -4819,7 +4884,7 @@ function useTextElementOperations(input) {
|
|
|
4819
4884
|
}, [selectedElement, inlineEditingElementId, inlineEditingText, inlineEditingSnapshotRef]);
|
|
4820
4885
|
const updateSelectedTextStyle = React17.useCallback(
|
|
4821
4886
|
(updates) => {
|
|
4822
|
-
if (!selectedElement || !(0,
|
|
4887
|
+
if (!selectedElement || !(0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(selectedElement)) {
|
|
4823
4888
|
return;
|
|
4824
4889
|
}
|
|
4825
4890
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
@@ -4897,7 +4962,7 @@ function useTextElementOperations(input) {
|
|
|
4897
4962
|
);
|
|
4898
4963
|
const toggleSelectedBullets = React17.useCallback(
|
|
4899
4964
|
(kind) => {
|
|
4900
|
-
if (!selectedElement || !(0,
|
|
4965
|
+
if (!selectedElement || !(0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(selectedElement)) {
|
|
4901
4966
|
return;
|
|
4902
4967
|
}
|
|
4903
4968
|
const currentSegments = liveTextSegments();
|
|
@@ -4948,7 +5013,7 @@ function useTextElementOperations(input) {
|
|
|
4948
5013
|
);
|
|
4949
5014
|
const updateSelectedTextCase = React17.useCallback(
|
|
4950
5015
|
(mode) => {
|
|
4951
|
-
if (!selectedElement || !(0,
|
|
5016
|
+
if (!selectedElement || !(0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(selectedElement)) {
|
|
4952
5017
|
return;
|
|
4953
5018
|
}
|
|
4954
5019
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
@@ -5064,7 +5129,7 @@ function useElementOperations(input) {
|
|
|
5064
5129
|
);
|
|
5065
5130
|
return;
|
|
5066
5131
|
}
|
|
5067
|
-
if (
|
|
5132
|
+
if (chunkVJZJESNT_js.isTemplateElementId(elementId)) {
|
|
5068
5133
|
const slideId = activeSlide?.id;
|
|
5069
5134
|
if (slideId) {
|
|
5070
5135
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -5100,7 +5165,7 @@ function useElementOperations(input) {
|
|
|
5100
5165
|
);
|
|
5101
5166
|
const updateSelectedShapeStyle = React17.useCallback(
|
|
5102
5167
|
(updates) => {
|
|
5103
|
-
if (!selectedElement || !(0,
|
|
5168
|
+
if (!selectedElement || !(0, chunkVJZJESNT_js.dist_exports.hasShapeProperties)(selectedElement)) {
|
|
5104
5169
|
return;
|
|
5105
5170
|
}
|
|
5106
5171
|
updateSelectedElement({
|
|
@@ -5304,15 +5369,15 @@ function syncSelectionHandleOverlay(elementNode, elementId, geometry) {
|
|
|
5304
5369
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
5305
5370
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
|
|
5306
5371
|
const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
|
|
5307
|
-
let resized = pptx.applyResize(startBox, handle, dx, dy, 1, { minSize:
|
|
5372
|
+
let resized = pptx.applyResize(startBox, handle, dx, dy, 1, { minSize: chunkVJZJESNT_js.MIN_ELEMENT_SIZE });
|
|
5308
5373
|
if (lockAspect) {
|
|
5309
|
-
resized = pptx.lockResizeAspect(resized, startBox, handle,
|
|
5374
|
+
resized = pptx.lockResizeAspect(resized, startBox, handle, chunkVJZJESNT_js.MIN_ELEMENT_SIZE);
|
|
5310
5375
|
}
|
|
5311
5376
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
5312
5377
|
if (!snapToGrid) {
|
|
5313
5378
|
return box;
|
|
5314
5379
|
}
|
|
5315
|
-
return pptx.snapBoxToGrid(box, handle, gridSpacingPx,
|
|
5380
|
+
return pptx.snapBoxToGrid(box, handle, gridSpacingPx, chunkVJZJESNT_js.MIN_ELEMENT_SIZE);
|
|
5316
5381
|
}
|
|
5317
5382
|
function resolveLiveTarget(input) {
|
|
5318
5383
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -5425,7 +5490,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
5425
5490
|
width: el.width,
|
|
5426
5491
|
height: el.height
|
|
5427
5492
|
}));
|
|
5428
|
-
const snapResult =
|
|
5493
|
+
const snapResult = chunkVJZJESNT_js.computeSnapToShape(
|
|
5429
5494
|
targetX,
|
|
5430
5495
|
targetY,
|
|
5431
5496
|
primaryEl.width,
|
|
@@ -5499,8 +5564,8 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
5499
5564
|
rs.lastY = geo.y;
|
|
5500
5565
|
rs.lastWidth = geo.width;
|
|
5501
5566
|
rs.lastHeight = geo.height;
|
|
5502
|
-
const width = Math.max(geo.width,
|
|
5503
|
-
const height = Math.max(geo.height,
|
|
5567
|
+
const width = Math.max(geo.width, chunkVJZJESNT_js.MIN_ELEMENT_SIZE);
|
|
5568
|
+
const height = Math.max(geo.height, chunkVJZJESNT_js.MIN_ELEMENT_SIZE);
|
|
5504
5569
|
if (rs.domEl) {
|
|
5505
5570
|
rs.domEl.style.left = `${geo.x}px`;
|
|
5506
5571
|
rs.domEl.style.top = `${geo.y}px`;
|
|
@@ -5593,13 +5658,13 @@ function processPointerUp(input) {
|
|
|
5593
5658
|
if (i !== activeSlideIndex) {
|
|
5594
5659
|
return s;
|
|
5595
5660
|
}
|
|
5596
|
-
const rerouted =
|
|
5661
|
+
const rerouted = chunkVJZJESNT_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
5597
5662
|
if (rerouted.length === 0) {
|
|
5598
5663
|
return s;
|
|
5599
5664
|
}
|
|
5600
5665
|
return {
|
|
5601
5666
|
...s,
|
|
5602
|
-
elements:
|
|
5667
|
+
elements: chunkVJZJESNT_js.applyReroutedConnectors(s.elements, rerouted)
|
|
5603
5668
|
};
|
|
5604
5669
|
})
|
|
5605
5670
|
);
|
|
@@ -5651,8 +5716,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
5651
5716
|
}
|
|
5652
5717
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
5653
5718
|
});
|
|
5654
|
-
const rerouted =
|
|
5655
|
-
return
|
|
5719
|
+
const rerouted = chunkVJZJESNT_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
5720
|
+
return chunkVJZJESNT_js.applyReroutedConnectors(movedElements, rerouted);
|
|
5656
5721
|
};
|
|
5657
5722
|
if (editTemplateMode) {
|
|
5658
5723
|
const slideId = activeSlide?.id;
|
|
@@ -5840,7 +5905,7 @@ function useCanvasInteractions(input) {
|
|
|
5840
5905
|
return;
|
|
5841
5906
|
}
|
|
5842
5907
|
const el = elementLookup.get(editId);
|
|
5843
|
-
if (el && (0,
|
|
5908
|
+
if (el && (0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(el)) {
|
|
5844
5909
|
const reader = inlineEditingReaderRef?.current;
|
|
5845
5910
|
const read = reader?.elementId === editId ? reader.read() : void 0;
|
|
5846
5911
|
if (read?.kind === "unsupported") {
|
|
@@ -5887,7 +5952,7 @@ function useCanvasInteractions(input) {
|
|
|
5887
5952
|
wasEditable.current = canEdit;
|
|
5888
5953
|
}, [canEdit]);
|
|
5889
5954
|
const openEquationEditorForElement = (el) => {
|
|
5890
|
-
if (!(0,
|
|
5955
|
+
if (!(0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(el)) {
|
|
5891
5956
|
return false;
|
|
5892
5957
|
}
|
|
5893
5958
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5920,7 +5985,7 @@ function useCanvasInteractions(input) {
|
|
|
5920
5985
|
justInteractedRef.current = false;
|
|
5921
5986
|
} else {
|
|
5922
5987
|
const el = elementLookup.get(elementId);
|
|
5923
|
-
if (el && (0,
|
|
5988
|
+
if (el && (0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(el) && pptx.canInteractWithElement(el, "textEdit")) {
|
|
5924
5989
|
if (!openEquationEditorForElement(el)) {
|
|
5925
5990
|
pptx.setPendingCaretPoint(e);
|
|
5926
5991
|
setInlineEditingElementId(elementId);
|
|
@@ -5946,7 +6011,7 @@ function useCanvasInteractions(input) {
|
|
|
5946
6011
|
if (openEquationEditorForElement(el)) {
|
|
5947
6012
|
return;
|
|
5948
6013
|
}
|
|
5949
|
-
if ((0,
|
|
6014
|
+
if ((0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(el) && pptx.canInteractWithElement(el, "textEdit")) {
|
|
5950
6015
|
setInlineEditingElementId(elementId);
|
|
5951
6016
|
setInlineEditingText(el.text ?? "");
|
|
5952
6017
|
}
|
|
@@ -6411,7 +6476,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
6411
6476
|
return;
|
|
6412
6477
|
}
|
|
6413
6478
|
const resolved = resolveHyperlinkEditResult(data);
|
|
6414
|
-
if (resolved.url && !
|
|
6479
|
+
if (resolved.url && !chunkVJZJESNT_js.isUrlSafe(resolved.url)) {
|
|
6415
6480
|
return;
|
|
6416
6481
|
}
|
|
6417
6482
|
const actionClick = {
|
|
@@ -6457,11 +6522,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
6457
6522
|
if (!activeSlide) {
|
|
6458
6523
|
return;
|
|
6459
6524
|
}
|
|
6460
|
-
const preset =
|
|
6525
|
+
const preset = chunkVJZJESNT_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
6461
6526
|
if (!preset) {
|
|
6462
6527
|
return;
|
|
6463
6528
|
}
|
|
6464
|
-
const defaultPptxAction = (0,
|
|
6529
|
+
const defaultPptxAction = (0, chunkVJZJESNT_js.dist_exports.elementActionToPptxAction)({
|
|
6465
6530
|
trigger: "click",
|
|
6466
6531
|
type: preset.defaultAction
|
|
6467
6532
|
});
|
|
@@ -6544,7 +6609,7 @@ function useInsertElements(input) {
|
|
|
6544
6609
|
width: 300,
|
|
6545
6610
|
height: 60,
|
|
6546
6611
|
text: "",
|
|
6547
|
-
textStyle: { fontSize:
|
|
6612
|
+
textStyle: { fontSize: chunkVJZJESNT_js.DEFAULT_TEXT_FONT_SIZE }
|
|
6548
6613
|
});
|
|
6549
6614
|
};
|
|
6550
6615
|
const handleAddShape = () => {
|
|
@@ -6566,7 +6631,7 @@ function useInsertElements(input) {
|
|
|
6566
6631
|
}
|
|
6567
6632
|
});
|
|
6568
6633
|
};
|
|
6569
|
-
const handleAddTable = (rows =
|
|
6634
|
+
const handleAddTable = (rows = chunkVJZJESNT_js.DEFAULT_TABLE_ROWS, columns = chunkVJZJESNT_js.DEFAULT_TABLE_COLUMNS) => {
|
|
6570
6635
|
if (!activeSlide) {
|
|
6571
6636
|
return;
|
|
6572
6637
|
}
|
|
@@ -6740,7 +6805,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6740
6805
|
history
|
|
6741
6806
|
} = input;
|
|
6742
6807
|
const updateElementsOwning = (elementId, updater) => {
|
|
6743
|
-
if (editTemplateMode && !
|
|
6808
|
+
if (editTemplateMode && !chunkVJZJESNT_js.isTemplateElementId(elementId)) {
|
|
6744
6809
|
ops.updateSlides(
|
|
6745
6810
|
(prev) => prev.map(
|
|
6746
6811
|
(slide, index) => index === activeSlideIndex ? { ...slide, elements: updater(slide.elements) } : slide
|
|
@@ -6774,9 +6839,9 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6774
6839
|
return;
|
|
6775
6840
|
}
|
|
6776
6841
|
const group = selectedElement;
|
|
6777
|
-
const intoTemplate =
|
|
6842
|
+
const intoTemplate = chunkVJZJESNT_js.isTemplateElementId(group.id);
|
|
6778
6843
|
const childIds = group.children.map(
|
|
6779
|
-
(child) => intoTemplate ?
|
|
6844
|
+
(child) => intoTemplate ? chunkVJZJESNT_js.makeCloneId(true, child.id || group.id) : child.id || pptx.generateElementId()
|
|
6780
6845
|
);
|
|
6781
6846
|
const { elements, childIds: usedIds } = pptx.ungroupElements(
|
|
6782
6847
|
ops.activeElements,
|
|
@@ -7108,7 +7173,7 @@ function useSlideManagement(input) {
|
|
|
7108
7173
|
if (!src) {
|
|
7109
7174
|
continue;
|
|
7110
7175
|
}
|
|
7111
|
-
const clone = { ...(0,
|
|
7176
|
+
const clone = { ...(0, chunkVJZJESNT_js.dist_exports.duplicateSlide)(src, next.length + 1), id: pptx.makeSlideId() };
|
|
7112
7177
|
next.splice(i + offset + 1, 0, clone);
|
|
7113
7178
|
offset++;
|
|
7114
7179
|
}
|
|
@@ -7212,7 +7277,7 @@ function createTableMergeHandlers(input) {
|
|
|
7212
7277
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
7213
7278
|
return;
|
|
7214
7279
|
}
|
|
7215
|
-
const newTableData =
|
|
7280
|
+
const newTableData = chunkVJZJESNT_js.mergeCells(
|
|
7216
7281
|
[
|
|
7217
7282
|
{ row: rowIndex, col: columnIndex },
|
|
7218
7283
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -7220,7 +7285,7 @@ function createTableMergeHandlers(input) {
|
|
|
7220
7285
|
td
|
|
7221
7286
|
);
|
|
7222
7287
|
const updates = { tableData: newTableData };
|
|
7223
|
-
const newRawXml = (0,
|
|
7288
|
+
const newRawXml = (0, chunkVJZJESNT_js.dist_exports.updateMergeAttrsInRawXml)(selectedElement, newTableData);
|
|
7224
7289
|
if (newRawXml) {
|
|
7225
7290
|
updates.rawXml = newRawXml;
|
|
7226
7291
|
}
|
|
@@ -7246,7 +7311,7 @@ function createTableMergeHandlers(input) {
|
|
|
7246
7311
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
7247
7312
|
return;
|
|
7248
7313
|
}
|
|
7249
|
-
const newTableData =
|
|
7314
|
+
const newTableData = chunkVJZJESNT_js.mergeCells(
|
|
7250
7315
|
[
|
|
7251
7316
|
{ row: rowIndex, col: columnIndex },
|
|
7252
7317
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -7254,7 +7319,7 @@ function createTableMergeHandlers(input) {
|
|
|
7254
7319
|
td
|
|
7255
7320
|
);
|
|
7256
7321
|
const updates = { tableData: newTableData };
|
|
7257
|
-
const newRawXml = (0,
|
|
7322
|
+
const newRawXml = (0, chunkVJZJESNT_js.dist_exports.updateMergeAttrsInRawXml)(selectedElement, newTableData);
|
|
7258
7323
|
if (newRawXml) {
|
|
7259
7324
|
updates.rawXml = newRawXml;
|
|
7260
7325
|
}
|
|
@@ -7269,9 +7334,9 @@ function createTableMergeHandlers(input) {
|
|
|
7269
7334
|
return;
|
|
7270
7335
|
}
|
|
7271
7336
|
const td = selectedElement.tableData;
|
|
7272
|
-
const newTableData =
|
|
7337
|
+
const newTableData = chunkVJZJESNT_js.mergeCells(ts.selectedCells, td);
|
|
7273
7338
|
const updates = { tableData: newTableData };
|
|
7274
|
-
const newRawXml = (0,
|
|
7339
|
+
const newRawXml = (0, chunkVJZJESNT_js.dist_exports.updateMergeAttrsInRawXml)(selectedElement, newTableData);
|
|
7275
7340
|
if (newRawXml) {
|
|
7276
7341
|
updates.rawXml = newRawXml;
|
|
7277
7342
|
}
|
|
@@ -7288,9 +7353,9 @@ function createTableMergeHandlers(input) {
|
|
|
7288
7353
|
}
|
|
7289
7354
|
const { rowIndex, columnIndex } = ts;
|
|
7290
7355
|
const td = selectedElement.tableData;
|
|
7291
|
-
const newTableData =
|
|
7356
|
+
const newTableData = chunkVJZJESNT_js.splitCell(rowIndex, columnIndex, td);
|
|
7292
7357
|
const updates = { tableData: newTableData };
|
|
7293
|
-
const newRawXml = (0,
|
|
7358
|
+
const newRawXml = (0, chunkVJZJESNT_js.dist_exports.updateMergeAttrsInRawXml)(selectedElement, newTableData);
|
|
7294
7359
|
if (newRawXml) {
|
|
7295
7360
|
updates.rawXml = newRawXml;
|
|
7296
7361
|
}
|
|
@@ -7325,7 +7390,7 @@ function createTableStructHandlers(input) {
|
|
|
7325
7390
|
updates.tableData = pptx.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
7326
7391
|
}
|
|
7327
7392
|
if (el.rawXml) {
|
|
7328
|
-
const newRawXml = (0,
|
|
7393
|
+
const newRawXml = (0, chunkVJZJESNT_js.dist_exports.updateCellTextInRawXml)(el, rowIndex, colIndex, text);
|
|
7329
7394
|
if (newRawXml) {
|
|
7330
7395
|
updates.rawXml = newRawXml;
|
|
7331
7396
|
}
|
|
@@ -7349,7 +7414,7 @@ function createTableStructHandlers(input) {
|
|
|
7349
7414
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
7350
7415
|
const updates = {};
|
|
7351
7416
|
if (selectedElement.rawXml) {
|
|
7352
|
-
const newRawXml = (0,
|
|
7417
|
+
const newRawXml = (0, chunkVJZJESNT_js.dist_exports.updateCellTextStyleInRawXml)(
|
|
7353
7418
|
selectedElement,
|
|
7354
7419
|
rowIndex,
|
|
7355
7420
|
colIndex,
|
|
@@ -7516,7 +7581,7 @@ function useExportSaveAs(input) {
|
|
|
7516
7581
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7517
7582
|
const slideSize = pptx.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7518
7583
|
const data = {
|
|
7519
|
-
slides:
|
|
7584
|
+
slides: chunkVJZJESNT_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7520
7585
|
width: canvasSize.width,
|
|
7521
7586
|
height: canvasSize.height,
|
|
7522
7587
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7674,7 +7739,7 @@ async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActi
|
|
|
7674
7739
|
}
|
|
7675
7740
|
function tilesToPdfPage(tilesResult) {
|
|
7676
7741
|
return tilesResult.tiles.map((tile) => ({
|
|
7677
|
-
image:
|
|
7742
|
+
image: chunkVJZJESNT_js.canvasToJpegData(tile.canvas),
|
|
7678
7743
|
placement: pptx.placeTileOnPage(
|
|
7679
7744
|
tile,
|
|
7680
7745
|
tilesResult.fullWidth,
|
|
@@ -7707,7 +7772,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7707
7772
|
if (pages.length === 0) {
|
|
7708
7773
|
throw new Error(i18n.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7709
7774
|
}
|
|
7710
|
-
const pdfBlobUrl =
|
|
7775
|
+
const pdfBlobUrl = chunkVJZJESNT_js.buildPdfFromTiledImageData(pages);
|
|
7711
7776
|
pptx.downloadDataUrl(pdfBlobUrl, filename);
|
|
7712
7777
|
}
|
|
7713
7778
|
async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, slideNotes, filename = "presentation-notes.pdf", options = {}) {
|
|
@@ -7737,7 +7802,7 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7737
7802
|
if (pages.length === 0) {
|
|
7738
7803
|
throw new Error(i18n.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7739
7804
|
}
|
|
7740
|
-
const pdfDataUrl =
|
|
7805
|
+
const pdfDataUrl = chunkVJZJESNT_js.buildNotesPdf(pages);
|
|
7741
7806
|
pptx.downloadDataUrl(pdfDataUrl, filename);
|
|
7742
7807
|
}
|
|
7743
7808
|
async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
@@ -7932,7 +7997,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7932
7997
|
continue;
|
|
7933
7998
|
}
|
|
7934
7999
|
onProgress?.(processedCount, data.slides.length);
|
|
7935
|
-
let svg =
|
|
8000
|
+
let svg = chunkVJZJESNT_js.dist_exports.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7936
8001
|
if (embedFonts && fontFaces?.length) {
|
|
7937
8002
|
svg = injectFontFaces(svg, fontFaces);
|
|
7938
8003
|
}
|
|
@@ -8521,10 +8586,10 @@ async function applyThemeEditorEdit(input, { colorScheme, fontScheme, name }) {
|
|
|
8521
8586
|
return;
|
|
8522
8587
|
}
|
|
8523
8588
|
await handler.applyTheme(colorScheme, fontScheme, name);
|
|
8524
|
-
const previousMap = theme?.colorScheme ? (0,
|
|
8589
|
+
const previousMap = theme?.colorScheme ? (0, chunkVJZJESNT_js.dist_exports.buildThemeColorMap)(theme.colorScheme) : {};
|
|
8525
8590
|
bumpHistory();
|
|
8526
8591
|
setSlides(
|
|
8527
|
-
(slides) => (0,
|
|
8592
|
+
(slides) => (0, chunkVJZJESNT_js.dist_exports.applyThemeToData)(
|
|
8528
8593
|
{ slides, theme, themeColorMap: previousMap },
|
|
8529
8594
|
colorScheme,
|
|
8530
8595
|
fontScheme,
|
|
@@ -8535,8 +8600,8 @@ async function applyThemeEditorEdit(input, { colorScheme, fontScheme, name }) {
|
|
|
8535
8600
|
(prev) => Object.fromEntries(
|
|
8536
8601
|
Object.entries(prev).map(([id, elements]) => [
|
|
8537
8602
|
id,
|
|
8538
|
-
(0,
|
|
8539
|
-
(0,
|
|
8603
|
+
(0, chunkVJZJESNT_js.dist_exports.reResolveElementFonts)(
|
|
8604
|
+
(0, chunkVJZJESNT_js.dist_exports.reResolveElementColors)(elements, previousMap, colorScheme),
|
|
8540
8605
|
theme?.fontScheme,
|
|
8541
8606
|
fontScheme
|
|
8542
8607
|
)
|
|
@@ -8594,13 +8659,13 @@ function useThemeHandlers(input) {
|
|
|
8594
8659
|
return;
|
|
8595
8660
|
}
|
|
8596
8661
|
await handler.updateThemeColorScheme(colorScheme);
|
|
8597
|
-
const previousMap = theme?.colorScheme ? (0,
|
|
8598
|
-
setSlides((prev) => (0,
|
|
8662
|
+
const previousMap = theme?.colorScheme ? (0, chunkVJZJESNT_js.dist_exports.buildThemeColorMap)(theme.colorScheme) : {};
|
|
8663
|
+
setSlides((prev) => (0, chunkVJZJESNT_js.dist_exports.reResolveSlideColors)(prev, previousMap, colorScheme));
|
|
8599
8664
|
if (Object.keys(templateElementsBySlideId).length > 0) {
|
|
8600
8665
|
setTemplateElementsBySlideId((prev) => {
|
|
8601
8666
|
const next = {};
|
|
8602
8667
|
for (const [slideId, elements] of Object.entries(prev)) {
|
|
8603
|
-
next[slideId] = (0,
|
|
8668
|
+
next[slideId] = (0, chunkVJZJESNT_js.dist_exports.reResolveElementColors)(elements, previousMap, colorScheme);
|
|
8604
8669
|
}
|
|
8605
8670
|
return next;
|
|
8606
8671
|
});
|
|
@@ -8711,7 +8776,7 @@ function useThemeSwitching(input) {
|
|
|
8711
8776
|
}
|
|
8712
8777
|
try {
|
|
8713
8778
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
8714
|
-
const newData = (0,
|
|
8779
|
+
const newData = (0, chunkVJZJESNT_js.dist_exports.applyThemeToData)(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
8715
8780
|
onDataChange(newData);
|
|
8716
8781
|
onThemeChanged?.(preset);
|
|
8717
8782
|
} catch (error) {
|
|
@@ -8728,7 +8793,7 @@ function useThemeSwitching(input) {
|
|
|
8728
8793
|
}
|
|
8729
8794
|
try {
|
|
8730
8795
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
8731
|
-
const newData = (0,
|
|
8796
|
+
const newData = (0, chunkVJZJESNT_js.dist_exports.applyThemeToData)(data, colorScheme, fontScheme, themeName);
|
|
8732
8797
|
onDataChange(newData);
|
|
8733
8798
|
} catch (error) {
|
|
8734
8799
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -8740,12 +8805,12 @@ function useThemeSwitching(input) {
|
|
|
8740
8805
|
if (!data?.theme?.colorScheme) {
|
|
8741
8806
|
return void 0;
|
|
8742
8807
|
}
|
|
8743
|
-
return
|
|
8744
|
-
(p) => (0,
|
|
8808
|
+
return chunkVJZJESNT_js.dist_exports.THEME_PRESETS.find(
|
|
8809
|
+
(p) => (0, chunkVJZJESNT_js.dist_exports.themeColorSchemesEqual)(data.theme?.colorScheme, p.colorScheme)
|
|
8745
8810
|
);
|
|
8746
8811
|
}, [data?.theme?.colorScheme]);
|
|
8747
8812
|
return {
|
|
8748
|
-
presets:
|
|
8813
|
+
presets: chunkVJZJESNT_js.dist_exports.THEME_PRESETS,
|
|
8749
8814
|
switchToPreset,
|
|
8750
8815
|
switchToCustom,
|
|
8751
8816
|
currentPreset
|
|
@@ -8822,7 +8887,7 @@ function usePropertyHandlers(input) {
|
|
|
8822
8887
|
}
|
|
8823
8888
|
try {
|
|
8824
8889
|
const ab = await file.arrayBuffer();
|
|
8825
|
-
const h = new
|
|
8890
|
+
const h = new chunkVJZJESNT_js.dist_exports.PptxHandler();
|
|
8826
8891
|
const other = await h.load(ab);
|
|
8827
8892
|
if (!other) {
|
|
8828
8893
|
return;
|
|
@@ -8832,7 +8897,7 @@ function usePropertyHandlers(input) {
|
|
|
8832
8897
|
width: canvasSize.width,
|
|
8833
8898
|
height: canvasSize.height
|
|
8834
8899
|
};
|
|
8835
|
-
setCompareResult(
|
|
8900
|
+
setCompareResult(chunkVJZJESNT_js.comparePresentation(cur, other));
|
|
8836
8901
|
setIsComparePanelOpen(true);
|
|
8837
8902
|
} catch (err) {
|
|
8838
8903
|
console.warn("Compare failed:", err);
|
|
@@ -9185,7 +9250,7 @@ function useViewerDialogs(input) {
|
|
|
9185
9250
|
};
|
|
9186
9251
|
}
|
|
9187
9252
|
function computeGridSpacingPx(documentGridSpacing) {
|
|
9188
|
-
return pptx.computeGridSpacingPx(documentGridSpacing,
|
|
9253
|
+
return pptx.computeGridSpacingPx(documentGridSpacing, chunkVJZJESNT_js.GRID_SIZE);
|
|
9189
9254
|
}
|
|
9190
9255
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
9191
9256
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
@@ -9194,7 +9259,7 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, pre
|
|
|
9194
9259
|
}
|
|
9195
9260
|
function computeSlideSectionGroups(slides, sections) {
|
|
9196
9261
|
return pptx.groupSlidesBySection(sections, slides).map((group) => ({
|
|
9197
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
9262
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkVJZJESNT_js.UNGROUPED_SECTION_ID : chunkVJZJESNT_js.DEFAULT_SECTION_GROUP_ID),
|
|
9198
9263
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
9199
9264
|
slideIndexes: group.slideIndexes,
|
|
9200
9265
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -9239,10 +9304,10 @@ function useDerivedSlideState(input) {
|
|
|
9239
9304
|
);
|
|
9240
9305
|
const slideSectionGroups = React17.useMemo(
|
|
9241
9306
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
9242
|
-
if (group.id ===
|
|
9307
|
+
if (group.id === chunkVJZJESNT_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
9243
9308
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
9244
9309
|
}
|
|
9245
|
-
if (group.id ===
|
|
9310
|
+
if (group.id === chunkVJZJESNT_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
9246
9311
|
return { ...group, label: t("pptx.sections.slides") };
|
|
9247
9312
|
}
|
|
9248
9313
|
return group;
|
|
@@ -9349,7 +9414,7 @@ function useAnnotationHandlers(input) {
|
|
|
9349
9414
|
if (nextMode === "present") {
|
|
9350
9415
|
presentation.enterPresentMode();
|
|
9351
9416
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
9352
|
-
|
|
9417
|
+
chunkVJZJESNT_js.stopAllPersistentAudio();
|
|
9353
9418
|
if (promptKeepInkAnnotations) {
|
|
9354
9419
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
9355
9420
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -9359,7 +9424,7 @@ function useAnnotationHandlers(input) {
|
|
|
9359
9424
|
}
|
|
9360
9425
|
} else {
|
|
9361
9426
|
if (mode === "present") {
|
|
9362
|
-
|
|
9427
|
+
chunkVJZJESNT_js.stopAllPersistentAudio();
|
|
9363
9428
|
}
|
|
9364
9429
|
setMode(nextMode);
|
|
9365
9430
|
}
|
|
@@ -9430,7 +9495,7 @@ function overlayPendingInlineEdit(document2, elementId, text, snapshot, transfor
|
|
|
9430
9495
|
(slide) => !elementId ? slide : {
|
|
9431
9496
|
...slide,
|
|
9432
9497
|
elements: slide.elements.map(
|
|
9433
|
-
(element) => element.id === elementId && (0,
|
|
9498
|
+
(element) => element.id === elementId && (0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(element) ? {
|
|
9434
9499
|
...element,
|
|
9435
9500
|
text,
|
|
9436
9501
|
textSegments: pptx.remapTextToSegments(
|
|
@@ -9519,14 +9584,14 @@ function useSerialize(input) {
|
|
|
9519
9584
|
const pptxGuides = guides.map((g) => ({
|
|
9520
9585
|
id: g.id,
|
|
9521
9586
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
9522
|
-
positionEmu: (0,
|
|
9587
|
+
positionEmu: (0, chunkVJZJESNT_js.dist_exports.guidePxToEmu)(g.position)
|
|
9523
9588
|
}));
|
|
9524
9589
|
return {
|
|
9525
9590
|
...slide,
|
|
9526
9591
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
9527
9592
|
};
|
|
9528
9593
|
});
|
|
9529
|
-
const slidesToSave =
|
|
9594
|
+
const slidesToSave = chunkVJZJESNT_js.buildSaveSlides(slidesWithGuides, pending.templateElementsBySlideId);
|
|
9530
9595
|
const saveOptions = pptx.buildDeckSaveOptions({
|
|
9531
9596
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
9532
9597
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
@@ -9707,7 +9772,7 @@ function usePresentationSetup(input) {
|
|
|
9707
9772
|
return;
|
|
9708
9773
|
}
|
|
9709
9774
|
if (mode === "present" && nextMode !== "present") {
|
|
9710
|
-
|
|
9775
|
+
chunkVJZJESNT_js.stopAllPersistentAudio();
|
|
9711
9776
|
stopAnimationSound();
|
|
9712
9777
|
const exitHandler = exitModeHandlerRef.current;
|
|
9713
9778
|
if (exitHandler) {
|
|
@@ -9828,12 +9893,12 @@ function useCanvasImagePaste(input) {
|
|
|
9828
9893
|
);
|
|
9829
9894
|
}
|
|
9830
9895
|
function formatPatchFor(element, format) {
|
|
9831
|
-
const updated =
|
|
9896
|
+
const updated = chunkVJZJESNT_js.applyFormatToElement(element, format);
|
|
9832
9897
|
const updates = {};
|
|
9833
|
-
if ((0,
|
|
9898
|
+
if ((0, chunkVJZJESNT_js.dist_exports.hasShapeProperties)(updated)) {
|
|
9834
9899
|
updates.shapeStyle = updated.shapeStyle;
|
|
9835
9900
|
}
|
|
9836
|
-
if ((0,
|
|
9901
|
+
if ((0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(updated)) {
|
|
9837
9902
|
updates.textStyle = updated.textStyle;
|
|
9838
9903
|
}
|
|
9839
9904
|
return updates;
|
|
@@ -9851,7 +9916,7 @@ function useFormatPainterEditing(input) {
|
|
|
9851
9916
|
const prevFormatPainterRef = React17.useRef(false);
|
|
9852
9917
|
React17.useEffect(() => {
|
|
9853
9918
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9854
|
-
copiedFormatRef.current =
|
|
9919
|
+
copiedFormatRef.current = chunkVJZJESNT_js.copyFormatFromElement(selectedElement);
|
|
9855
9920
|
} else if (!formatPainterActive) {
|
|
9856
9921
|
copiedFormatRef.current = null;
|
|
9857
9922
|
}
|
|
@@ -10404,7 +10469,7 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
10404
10469
|
}
|
|
10405
10470
|
const styleEl = document.createElement("style");
|
|
10406
10471
|
styleEl.id = EMBEDDED_FONTS_STYLE_ID;
|
|
10407
|
-
const cssRules = embeddedFonts.flatMap((font) => {
|
|
10472
|
+
const cssRules = pptx.selectTrustedEmbeddedFonts(embeddedFonts).flatMap((font) => {
|
|
10408
10473
|
if (typeof font.name !== "string" || font.name.length === 0 || FONT_NAME_UNSAFE_CHARS.test(font.name)) {
|
|
10409
10474
|
return [];
|
|
10410
10475
|
}
|
|
@@ -10415,8 +10480,8 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
10415
10480
|
if (!FONT_FORMAT_ALLOWED.has(fontFormat)) {
|
|
10416
10481
|
return [];
|
|
10417
10482
|
}
|
|
10418
|
-
const fontWeight = font.bold
|
|
10419
|
-
const fontStyleCss = font.italic ? "italic" : "normal";
|
|
10483
|
+
const fontWeight = String(pptx.resolveFontWeight(font.name, font.bold));
|
|
10484
|
+
const fontStyleCss = pptx.resolveFontItalic(font.name, font.italic) ? "italic" : "normal";
|
|
10420
10485
|
return [
|
|
10421
10486
|
`@font-face {
|
|
10422
10487
|
font-family: "${font.name}";
|
|
@@ -10457,7 +10522,7 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
10457
10522
|
const referenced = pptx.collectReferencedFontFamilies(slides);
|
|
10458
10523
|
const candidates = pptx.selectGoogleWebfontFamilies(
|
|
10459
10524
|
referenced,
|
|
10460
|
-
embeddedFonts.map((font) => font.name)
|
|
10525
|
+
pptx.selectTrustedEmbeddedFonts(embeddedFonts).map((font) => font.name)
|
|
10461
10526
|
);
|
|
10462
10527
|
if (candidates.length === 0) {
|
|
10463
10528
|
return;
|
|
@@ -10942,7 +11007,7 @@ function useKeyboardShortcutWiring(input) {
|
|
|
10942
11007
|
}
|
|
10943
11008
|
function stepSelectedFontSize(state, ops, direction) {
|
|
10944
11009
|
const selected = state.selectedElement;
|
|
10945
|
-
const currentPx = (selected && (0,
|
|
11010
|
+
const currentPx = (selected && (0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(selected) ? selected.textStyle?.fontSize : void 0) ?? pptx.textFontSizePtToPx(18);
|
|
10946
11011
|
const nextPt = pptx.stepFontSizePt(pptx.textFontSizePxToPt(currentPx), direction);
|
|
10947
11012
|
ops.updateSelectedTextStyle({ fontSize: pptx.textFontSizePtToPx(nextPt) });
|
|
10948
11013
|
}
|
|
@@ -11499,7 +11564,7 @@ function useCollaborationWriteBack(input) {
|
|
|
11499
11564
|
getSourceBytes: () => latest.current.getSourceBytes?.() ?? null,
|
|
11500
11565
|
getSaveOptions: () => latest.current.getSaveOptions?.(),
|
|
11501
11566
|
getTemplateElements: () => latest.current.templateElementsBySlideId,
|
|
11502
|
-
mergeTemplateElements:
|
|
11567
|
+
mergeTemplateElements: chunkVJZJESNT_js.buildSaveSlides
|
|
11503
11568
|
}),
|
|
11504
11569
|
[latest]
|
|
11505
11570
|
);
|
|
@@ -12052,8 +12117,8 @@ function useTouchGestures(input) {
|
|
|
12052
12117
|
}
|
|
12053
12118
|
const recognizer = pptx.createTouchGestureRecognizer({
|
|
12054
12119
|
getScale: () => scaleRef.current,
|
|
12055
|
-
minScale:
|
|
12056
|
-
maxScale:
|
|
12120
|
+
minScale: chunkVJZJESNT_js.MIN_ZOOM_SCALE,
|
|
12121
|
+
maxScale: chunkVJZJESNT_js.MAX_ZOOM_SCALE,
|
|
12057
12122
|
callbacks: {
|
|
12058
12123
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
12059
12124
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -12177,7 +12242,7 @@ function buildCanvasProps(input) {
|
|
|
12177
12242
|
if (pptx.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
12178
12243
|
return;
|
|
12179
12244
|
}
|
|
12180
|
-
|
|
12245
|
+
chunkVJZJESNT_js.safeOpenUrl(url, target);
|
|
12181
12246
|
};
|
|
12182
12247
|
const handleActionClick = (elementId, action) => {
|
|
12183
12248
|
if (mode === "present") {
|
|
@@ -12192,9 +12257,9 @@ function buildCanvasProps(input) {
|
|
|
12192
12257
|
}
|
|
12193
12258
|
};
|
|
12194
12259
|
const handleHyperlinkClick = (url, target) => {
|
|
12195
|
-
if (
|
|
12260
|
+
if (chunkVJZJESNT_js.isPpactionUrl(url)) {
|
|
12196
12261
|
if (mode === "present") {
|
|
12197
|
-
const parsed =
|
|
12262
|
+
const parsed = chunkVJZJESNT_js.parsePpactionUrl(url);
|
|
12198
12263
|
if (parsed) {
|
|
12199
12264
|
presentation.handlePresentationAction({
|
|
12200
12265
|
action: parsed.action,
|
|
@@ -12620,7 +12685,7 @@ function buildToolbarProps(input) {
|
|
|
12620
12685
|
markDirty: history.markDirty
|
|
12621
12686
|
}),
|
|
12622
12687
|
formatPainterActive: s.formatPainterActive,
|
|
12623
|
-
canActivateFormatPainter:
|
|
12688
|
+
canActivateFormatPainter: chunkVJZJESNT_js.hasCopyableFormat(selectedElement),
|
|
12624
12689
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
12625
12690
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
12626
12691
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -12943,7 +13008,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
12943
13008
|
documentGridSpacing: state.viewProperties?.gridSpacing
|
|
12944
13009
|
});
|
|
12945
13010
|
const themeColorMap = React17.useMemo(
|
|
12946
|
-
() => state.theme?.colorScheme ? (0,
|
|
13011
|
+
() => state.theme?.colorScheme ? (0, chunkVJZJESNT_js.dist_exports.buildThemeColorMap)(state.theme.colorScheme) : void 0,
|
|
12947
13012
|
[state.theme?.colorScheme]
|
|
12948
13013
|
);
|
|
12949
13014
|
const { presentation, annotations, actionSoundHandlerRef, setExitModeHandler } = usePresentationSetup({
|
|
@@ -13151,6 +13216,7 @@ function useViewPreferencesSync(input) {
|
|
|
13151
13216
|
// src/viewer/hooks/useViewerBuildingBlocksState.ts
|
|
13152
13217
|
function useViewerBuildingBlocksState(input) {
|
|
13153
13218
|
const { core, content, canEdit, filePath, autosaveEnabled, userName, handle, setContent } = input;
|
|
13219
|
+
const { initialSlide } = input;
|
|
13154
13220
|
const {
|
|
13155
13221
|
onContentChange,
|
|
13156
13222
|
onDirtyChange,
|
|
@@ -13253,6 +13319,7 @@ function useViewerBuildingBlocksState(input) {
|
|
|
13253
13319
|
content,
|
|
13254
13320
|
filePath,
|
|
13255
13321
|
autosaveEnabled,
|
|
13322
|
+
initialSlide,
|
|
13256
13323
|
// Trust Center > "Allow external content": same gate `PowerPointViewer`
|
|
13257
13324
|
// applies, so the headless building-blocks API loads http(s) images
|
|
13258
13325
|
// under the same default-off, core-side SSRF/privacy guard.
|
|
@@ -13316,6 +13383,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
13316
13383
|
canEdit: requestedCanEdit = false,
|
|
13317
13384
|
filePath,
|
|
13318
13385
|
fileName,
|
|
13386
|
+
initialSlide,
|
|
13319
13387
|
autosaveEnabled = true,
|
|
13320
13388
|
userName,
|
|
13321
13389
|
hiddenActions,
|
|
@@ -13331,7 +13399,8 @@ function useViewerBuildingBlocks(input) {
|
|
|
13331
13399
|
onOpenHeaderFooter,
|
|
13332
13400
|
onOpenShareDialog
|
|
13333
13401
|
} = input;
|
|
13334
|
-
const
|
|
13402
|
+
const collaborationConfig = pptx.resolveCollaborationConfig(input.collaboration);
|
|
13403
|
+
const [collaborationReadOnly, setCollaborationReadOnly] = React17.useState(Boolean(collaborationConfig));
|
|
13335
13404
|
const { t } = reactI18next.useTranslation();
|
|
13336
13405
|
const [content, setContent] = React17.useState(incomingContent ?? null);
|
|
13337
13406
|
const [loadOrigin, setLoadOrigin] = React17.useState("bootstrap");
|
|
@@ -13380,7 +13449,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
13380
13449
|
} = core;
|
|
13381
13450
|
const canEdit = pptx.resolveCollaborationShellEditability({
|
|
13382
13451
|
authorizedCanEdit: requestedCanEdit,
|
|
13383
|
-
configured: Boolean(
|
|
13452
|
+
configured: Boolean(collaborationConfig),
|
|
13384
13453
|
readOnly: collaborationReadOnly,
|
|
13385
13454
|
sourcePending: Boolean(content) && loading,
|
|
13386
13455
|
sourceError: Boolean(error)
|
|
@@ -13402,6 +13471,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
13402
13471
|
content,
|
|
13403
13472
|
canEdit,
|
|
13404
13473
|
filePath,
|
|
13474
|
+
initialSlide,
|
|
13405
13475
|
autosaveEnabled,
|
|
13406
13476
|
userName,
|
|
13407
13477
|
handle,
|
|
@@ -13416,7 +13486,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
13416
13486
|
});
|
|
13417
13487
|
const { collaboration, overlay } = useViewerBuildingBlocksCollaboration({
|
|
13418
13488
|
core,
|
|
13419
|
-
config:
|
|
13489
|
+
config: collaborationConfig,
|
|
13420
13490
|
content,
|
|
13421
13491
|
loadOrigin,
|
|
13422
13492
|
loadVersion,
|
|
@@ -13481,7 +13551,7 @@ ${url}`
|
|
|
13481
13551
|
const shellState = React17.useMemo(
|
|
13482
13552
|
() => pptx.resolveCollaborationShellState({
|
|
13483
13553
|
authorizedCanEdit: requestedCanEdit,
|
|
13484
|
-
configured: Boolean(
|
|
13554
|
+
configured: Boolean(collaborationConfig),
|
|
13485
13555
|
readOnly: collaborationReadOnly,
|
|
13486
13556
|
sourcePending: Boolean(content) && loading,
|
|
13487
13557
|
sourceError: Boolean(error),
|
|
@@ -13490,7 +13560,7 @@ ${url}`
|
|
|
13490
13560
|
}),
|
|
13491
13561
|
[
|
|
13492
13562
|
requestedCanEdit,
|
|
13493
|
-
|
|
13563
|
+
collaborationConfig,
|
|
13494
13564
|
collaborationReadOnly,
|
|
13495
13565
|
content,
|
|
13496
13566
|
loading,
|
|
@@ -13518,23 +13588,23 @@ function ColorChangedImage({
|
|
|
13518
13588
|
className,
|
|
13519
13589
|
alt
|
|
13520
13590
|
}) {
|
|
13521
|
-
const tolerance = tolerancePct ??
|
|
13522
|
-
const cacheKey =
|
|
13591
|
+
const tolerance = tolerancePct ?? chunkVJZJESNT_js.DEFAULT_COLOR_CHANGE_TOLERANCE;
|
|
13592
|
+
const cacheKey = chunkVJZJESNT_js.buildCacheKey(
|
|
13523
13593
|
src,
|
|
13524
13594
|
clrChange.clrFrom,
|
|
13525
13595
|
clrChange.clrTo,
|
|
13526
13596
|
tolerance,
|
|
13527
13597
|
Boolean(clrChange.clrToTransparent)
|
|
13528
13598
|
);
|
|
13529
|
-
const cached =
|
|
13599
|
+
const cached = chunkVJZJESNT_js.getCachedResult(cacheKey);
|
|
13530
13600
|
const [processedSrc, setProcessedSrc] = React17.useState(cached ?? null);
|
|
13531
13601
|
React17.useEffect(() => {
|
|
13532
|
-
if (
|
|
13533
|
-
setProcessedSrc(
|
|
13602
|
+
if (chunkVJZJESNT_js.getCachedResult(cacheKey)) {
|
|
13603
|
+
setProcessedSrc(chunkVJZJESNT_js.getCachedResult(cacheKey) ?? null);
|
|
13534
13604
|
return;
|
|
13535
13605
|
}
|
|
13536
13606
|
let cancelled = false;
|
|
13537
|
-
|
|
13607
|
+
chunkVJZJESNT_js.applyColorChange(
|
|
13538
13608
|
src,
|
|
13539
13609
|
clrChange.clrFrom,
|
|
13540
13610
|
clrChange.clrTo,
|
|
@@ -13542,7 +13612,7 @@ function ColorChangedImage({
|
|
|
13542
13612
|
Boolean(clrChange.clrToTransparent)
|
|
13543
13613
|
).then((result) => {
|
|
13544
13614
|
if (!cancelled) {
|
|
13545
|
-
|
|
13615
|
+
chunkVJZJESNT_js.setCachedResult(cacheKey, result.dataUrl);
|
|
13546
13616
|
setProcessedSrc(result.dataUrl);
|
|
13547
13617
|
}
|
|
13548
13618
|
return void 0;
|
|
@@ -13634,7 +13704,7 @@ function TiledImageLayer({
|
|
|
13634
13704
|
cancelled = true;
|
|
13635
13705
|
};
|
|
13636
13706
|
}, [src]);
|
|
13637
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, style: { ...
|
|
13707
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, style: { ...chunkVJZJESNT_js.getImageTilingStyle(element, nativeSize), ...style } });
|
|
13638
13708
|
}
|
|
13639
13709
|
function renderImageEffectDefinitions(element, excludeDuotone = false) {
|
|
13640
13710
|
return pptx.getImageSvgFilters(element).filter((definition) => !excludeDuotone || definition.id !== `duotone-${element.id}`).map((definition) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13703,7 +13773,7 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
13703
13773
|
...filter ? { filter } : {},
|
|
13704
13774
|
...opacity !== void 0 ? { opacity } : {}
|
|
13705
13775
|
};
|
|
13706
|
-
if (
|
|
13776
|
+
if (chunkVJZJESNT_js.isImageTiled(el)) {
|
|
13707
13777
|
const tileSrc = imgSrc(el);
|
|
13708
13778
|
if (!tileSrc) {
|
|
13709
13779
|
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" });
|
|
@@ -13722,12 +13792,12 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
13722
13792
|
] });
|
|
13723
13793
|
}
|
|
13724
13794
|
const colorWash = pptx.getImageColorWashStyle(
|
|
13725
|
-
(0,
|
|
13795
|
+
(0, chunkVJZJESNT_js.dist_exports.isImageLikeElement)(el) ? el.imageEffects?.colorWash : void 0
|
|
13726
13796
|
);
|
|
13727
13797
|
const clrChange = "imageEffects" in el ? el.imageEffects?.clrChange : void 0;
|
|
13728
|
-
const duotoneColors =
|
|
13798
|
+
const duotoneColors = chunkVJZJESNT_js.getDuotoneColors(el);
|
|
13729
13799
|
const useDuotoneCanvas = Boolean(duotoneColors && !clrChange);
|
|
13730
|
-
const filterForImg = useDuotoneCanvas ?
|
|
13800
|
+
const filterForImg = useDuotoneCanvas ? chunkVJZJESNT_js.getImageEffectsFilter(el, { excludeDuotone: true }) : filter;
|
|
13731
13801
|
const canvasEffectStyles = {
|
|
13732
13802
|
...filterForImg ? { filter: filterForImg } : {},
|
|
13733
13803
|
...opacity !== void 0 ? { opacity } : {}
|
|
@@ -13803,10 +13873,10 @@ function SlideBackgroundImageLayer({
|
|
|
13803
13873
|
style: { zIndex: 0 },
|
|
13804
13874
|
children: renderImg(
|
|
13805
13875
|
backgroundElement,
|
|
13806
|
-
|
|
13807
|
-
|
|
13876
|
+
chunkVJZJESNT_js.getImageRenderStyle(backgroundElement),
|
|
13877
|
+
chunkVJZJESNT_js.getImageEffectsFilter(backgroundElement),
|
|
13808
13878
|
"",
|
|
13809
|
-
|
|
13879
|
+
chunkVJZJESNT_js.getImageEffectsOpacity(backgroundElement)
|
|
13810
13880
|
)
|
|
13811
13881
|
}
|
|
13812
13882
|
);
|
|
@@ -14084,7 +14154,7 @@ function ChartElementView({
|
|
|
14084
14154
|
pptx.getBarFacePicturePixelSampleVersion
|
|
14085
14155
|
);
|
|
14086
14156
|
const viewModel = React17.useMemo(() => {
|
|
14087
|
-
return canEdit ?
|
|
14157
|
+
return canEdit ? chunkVJZJESNT_js.buildReactChartViewModel(element) : null;
|
|
14088
14158
|
}, [canEdit, element, barFacePictureSampleVersion]);
|
|
14089
14159
|
React17.useEffect(pptx.ensureChartInteractionStyles, []);
|
|
14090
14160
|
React17.useEffect(() => {
|
|
@@ -14189,9 +14259,9 @@ function ChartElementView({
|
|
|
14189
14259
|
textStyle: animationState?.textStyle,
|
|
14190
14260
|
onSelect: chart3D.onSelect,
|
|
14191
14261
|
onDrag: chart3D.onDrag,
|
|
14192
|
-
children:
|
|
14262
|
+
children: chunkVJZJESNT_js.renderChartElement(renderedElement, (key) => t(key))
|
|
14193
14263
|
}
|
|
14194
|
-
) :
|
|
14264
|
+
) : chunkVJZJESNT_js.renderChartElement(renderedElement, (key) => t(key)),
|
|
14195
14265
|
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) }),
|
|
14196
14266
|
titleDraft !== null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14197
14267
|
"input",
|
|
@@ -14521,7 +14591,7 @@ function ResizeHandles({
|
|
|
14521
14591
|
"aria-label": t("pptx.selectionOverlay.resize", { handle }),
|
|
14522
14592
|
"data-pptx-handle-kind": "resize",
|
|
14523
14593
|
"data-pptx-compact": true,
|
|
14524
|
-
className:
|
|
14594
|
+
className: chunkVJZJESNT_js.cn(
|
|
14525
14595
|
"absolute z-10 group border-0 bg-transparent p-0",
|
|
14526
14596
|
RESIZE_DEFAULT_CLASSES,
|
|
14527
14597
|
posClass,
|
|
@@ -14547,7 +14617,7 @@ function ResizeHandles({
|
|
|
14547
14617
|
"div",
|
|
14548
14618
|
{
|
|
14549
14619
|
"data-pptx-handle-hit": true,
|
|
14550
|
-
className:
|
|
14620
|
+
className: chunkVJZJESNT_js.cn(
|
|
14551
14621
|
"absolute -inset-px pointer-events-auto [--pptx-handle-hit-inset:-1px]",
|
|
14552
14622
|
corner ? "max-md:-inset-1.5 max-md:[--pptx-handle-hit-inset:-6px]" : "max-md:-inset-2 max-md:[--pptx-handle-hit-inset:-8px]"
|
|
14553
14623
|
),
|
|
@@ -14568,7 +14638,7 @@ function ResizeHandles({
|
|
|
14568
14638
|
"aria-label": t("pptx.selectionOverlay.rotate"),
|
|
14569
14639
|
"data-pptx-handle-kind": "rotate",
|
|
14570
14640
|
"data-pptx-compact": true,
|
|
14571
|
-
className:
|
|
14641
|
+
className: chunkVJZJESNT_js.cn(
|
|
14572
14642
|
"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",
|
|
14573
14643
|
ROTATE_DEFAULT_CLASSES
|
|
14574
14644
|
),
|
|
@@ -14638,17 +14708,17 @@ var ConnectorElementRenderer = React17__default.default.memo(
|
|
|
14638
14708
|
animationState,
|
|
14639
14709
|
textStyleOverrideCss
|
|
14640
14710
|
}) {
|
|
14641
|
-
const shapeEl = (0,
|
|
14711
|
+
const shapeEl = (0, chunkVJZJESNT_js.dist_exports.hasShapeProperties)(el) ? el : void 0;
|
|
14642
14712
|
const viewWidth = Math.max(el.width, 0);
|
|
14643
14713
|
const viewHeight = Math.max(el.height, 0);
|
|
14644
14714
|
const svgWidth = Math.max(el.width, 1);
|
|
14645
14715
|
const svgHeight = Math.max(el.height, 1);
|
|
14646
14716
|
const ss = shapeEl?.shapeStyle;
|
|
14647
14717
|
const strokeWidth = Math.max(0, ss?.strokeWidth ?? 2);
|
|
14648
|
-
const strokeColor =
|
|
14649
|
-
const strokePaint =
|
|
14650
|
-
const dashType =
|
|
14651
|
-
const dashArray =
|
|
14718
|
+
const strokeColor = chunkVJZJESNT_js.normalizeHexColor(ss?.strokeColor, chunkVJZJESNT_js.DEFAULT_STROKE_COLOR);
|
|
14719
|
+
const strokePaint = chunkVJZJESNT_js.colorWithOpacity(strokeColor, ss?.strokeOpacity);
|
|
14720
|
+
const dashType = chunkVJZJESNT_js.normalizeStrokeDashType(ss?.strokeDash);
|
|
14721
|
+
const dashArray = chunkVJZJESNT_js.getSvgStrokeDasharray(
|
|
14652
14722
|
dashType,
|
|
14653
14723
|
Math.max(strokeWidth, 1),
|
|
14654
14724
|
ss?.customDashSegments
|
|
@@ -14659,14 +14729,14 @@ var ConnectorElementRenderer = React17__default.default.memo(
|
|
|
14659
14729
|
const markerSeed = el.id.replace(/[^a-zA-Z0-9_-]/gu, "_");
|
|
14660
14730
|
const startMarkerId = `${markerSeed}-sel-start`;
|
|
14661
14731
|
const endMarkerId = `${markerSeed}-sel-end`;
|
|
14662
|
-
const compoundOffsets =
|
|
14663
|
-
const compoundWidths =
|
|
14732
|
+
const compoundOffsets = chunkVJZJESNT_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
14733
|
+
const compoundWidths = chunkVJZJESNT_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
14664
14734
|
const strokeCap = pptx.svgLineCap(ss?.lineCap);
|
|
14665
|
-
const textEl = (0,
|
|
14735
|
+
const textEl = (0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(el) ? el : void 0;
|
|
14666
14736
|
const connectorText = textEl?.text?.trim() ?? "";
|
|
14667
14737
|
const connectorTextSegments = textEl?.textSegments;
|
|
14668
14738
|
const connectorTextStyle = textEl?.textStyle;
|
|
14669
|
-
const pathGeometry = shapeEl ?
|
|
14739
|
+
const pathGeometry = shapeEl ? chunkVJZJESNT_js.getConnectorPathGeometry(shapeEl) : {
|
|
14670
14740
|
pathData: `M 0 0 L ${viewWidth} ${viewHeight}`,
|
|
14671
14741
|
startX: 0,
|
|
14672
14742
|
startY: 0,
|
|
@@ -14675,16 +14745,16 @@ var ConnectorElementRenderer = React17__default.default.memo(
|
|
|
14675
14745
|
};
|
|
14676
14746
|
const hitTargetWidth = Math.max(strokeWidth * 3, 14);
|
|
14677
14747
|
const selColor = selClr === "blue-400" ? "#60a5fa" : "#3b82f6";
|
|
14678
|
-
const lineShadow =
|
|
14679
|
-
const lineGlow =
|
|
14748
|
+
const lineShadow = chunkVJZJESNT_js.buildLineShadowCss(el);
|
|
14749
|
+
const lineGlow = chunkVJZJESNT_js.buildLineGlowFilter(el);
|
|
14680
14750
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14681
14751
|
"div",
|
|
14682
14752
|
{
|
|
14683
14753
|
"data-pptx-element": "true",
|
|
14684
14754
|
"data-element-id": el.id,
|
|
14685
|
-
role:
|
|
14686
|
-
"aria-label":
|
|
14687
|
-
"aria-roledescription":
|
|
14755
|
+
role: chunkVJZJESNT_js.getAriaRole(el, { actionable: false }),
|
|
14756
|
+
"aria-label": chunkVJZJESNT_js.getAriaLabel(el),
|
|
14757
|
+
"aria-roledescription": chunkVJZJESNT_js.getAriaRoleDescription(el),
|
|
14688
14758
|
"aria-selected": isSelected ? true : void 0,
|
|
14689
14759
|
className: "absolute",
|
|
14690
14760
|
style: {
|
|
@@ -14717,14 +14787,14 @@ var ConnectorElementRenderer = React17__default.default.memo(
|
|
|
14717
14787
|
style: { overflow: "visible", pointerEvents: "none" },
|
|
14718
14788
|
children: [
|
|
14719
14789
|
/* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
|
|
14720
|
-
|
|
14790
|
+
chunkVJZJESNT_js.renderConnectorMarker(
|
|
14721
14791
|
startMarkerId,
|
|
14722
14792
|
startArrow,
|
|
14723
14793
|
strokePaint,
|
|
14724
14794
|
ss?.connectorStartArrowWidth,
|
|
14725
14795
|
ss?.connectorStartArrowLength
|
|
14726
14796
|
),
|
|
14727
|
-
|
|
14797
|
+
chunkVJZJESNT_js.renderConnectorMarker(
|
|
14728
14798
|
endMarkerId,
|
|
14729
14799
|
endArrow,
|
|
14730
14800
|
strokePaint,
|
|
@@ -14930,14 +15000,14 @@ function getElementInteractionProps({
|
|
|
14930
15000
|
};
|
|
14931
15001
|
}
|
|
14932
15002
|
function renderDagDuotoneFilterForElement(el) {
|
|
14933
|
-
if (!
|
|
15003
|
+
if (!chunkVJZJESNT_js.hasDagDuotoneEffect(el)) {
|
|
14934
15004
|
return null;
|
|
14935
15005
|
}
|
|
14936
15006
|
const duotone = el.shapeStyle?.dagDuotone;
|
|
14937
15007
|
if (!duotone) {
|
|
14938
15008
|
return null;
|
|
14939
15009
|
}
|
|
14940
|
-
return
|
|
15010
|
+
return chunkVJZJESNT_js.renderDagDuotoneSvgFilter(el.id, duotone.color1, duotone.color2);
|
|
14941
15011
|
}
|
|
14942
15012
|
function getContainerStyle({
|
|
14943
15013
|
el,
|
|
@@ -14950,7 +15020,7 @@ function getContainerStyle({
|
|
|
14950
15020
|
has3DExtrusion,
|
|
14951
15021
|
templateEditing
|
|
14952
15022
|
}) {
|
|
14953
|
-
const ss = (0,
|
|
15023
|
+
const ss = (0, chunkVJZJESNT_js.dist_exports.hasShapeProperties)(el) ? el.shapeStyle : void 0;
|
|
14954
15024
|
const isPicture = el.type === "picture" || el.type === "image";
|
|
14955
15025
|
const blurGrowVisible = Boolean(
|
|
14956
15026
|
ss?.blurGrow && typeof ss.blurRadius === "number" && ss.blurRadius > 0
|
|
@@ -14964,10 +15034,10 @@ function getContainerStyle({
|
|
|
14964
15034
|
top: isFullscreenMedia ? fs.top : el.y,
|
|
14965
15035
|
width: isFullscreenMedia ? fs.width : painted.width,
|
|
14966
15036
|
...heightStyle,
|
|
14967
|
-
transform: isFullscreenMedia ? fs.transform :
|
|
15037
|
+
transform: isFullscreenMedia ? fs.transform : chunkVJZJESNT_js.getElementTransform(el),
|
|
14968
15038
|
transformOrigin: "center",
|
|
14969
15039
|
overflow: overflowValue,
|
|
14970
|
-
clipPath: isPicture ? void 0 : isImg && !has3DExtrusion ?
|
|
15040
|
+
clipPath: isPicture ? void 0 : isImg && !has3DExtrusion ? chunkVJZJESNT_js.getCropShapeClipPath(el) : void 0,
|
|
14971
15041
|
zIndex: isFullscreenMedia ? fs.zIndex : zIndex,
|
|
14972
15042
|
visibility: animationState?.visible === false ? "hidden" : "visible",
|
|
14973
15043
|
animation: animationState?.cssAnimation,
|
|
@@ -15002,11 +15072,11 @@ function getContainerStyle({
|
|
|
15002
15072
|
};
|
|
15003
15073
|
}
|
|
15004
15074
|
function shapeParams(element) {
|
|
15005
|
-
const style = (0,
|
|
15075
|
+
const style = (0, chunkVJZJESNT_js.dist_exports.hasShapeProperties)(element) ? element.shapeStyle : void 0;
|
|
15006
15076
|
const strokeWidth = pptx.paintedStrokeWidth(style);
|
|
15007
|
-
const strokeColor =
|
|
15008
|
-
const fillColor =
|
|
15009
|
-
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(
|
|
15077
|
+
const strokeColor = chunkVJZJESNT_js.normalizeHexColor(style?.strokeColor, chunkVJZJESNT_js.DEFAULT_STROKE_COLOR);
|
|
15078
|
+
const fillColor = chunkVJZJESNT_js.normalizeHexColor(style?.fillColor, chunkVJZJESNT_js.DEFAULT_FILL_COLOR);
|
|
15079
|
+
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(chunkVJZJESNT_js.buildCssGradientFromShapeStyle(style) || style?.fillGradient) || style?.fillMode === "pattern" && Boolean(style.fillPatternPreset);
|
|
15010
15080
|
return { hf: hasFill, fc: fillColor, sw: strokeWidth, sc: strokeColor };
|
|
15011
15081
|
}
|
|
15012
15082
|
var Extrusion3DOverlay = React17__default.default.memo(
|
|
@@ -15111,7 +15181,7 @@ function ShapeEffectOverlay({
|
|
|
15111
15181
|
const fillOverlayStyle = overlay ? {
|
|
15112
15182
|
position: "absolute",
|
|
15113
15183
|
inset: 0,
|
|
15114
|
-
...(0,
|
|
15184
|
+
...(0, chunkVJZJESNT_js.dist_exports.isImageLikeElement)(element) ? chunkVJZJESNT_js.getImageSurfaceMaskStyle(element) : {},
|
|
15115
15185
|
background: overlay.color,
|
|
15116
15186
|
mixBlendMode: overlay.blendMode,
|
|
15117
15187
|
pointerEvents: "none"
|
|
@@ -15318,10 +15388,10 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15318
15388
|
const backgroundAnimationState = pptx.getBackgroundAnimationState(el, presentationElementStates);
|
|
15319
15389
|
const effectPlacement = pptx.getShapeEffectLayerPlacement(el);
|
|
15320
15390
|
const visualAnimationState = backgroundAnimationState ?? animationState;
|
|
15321
|
-
const isTxt =
|
|
15322
|
-
const txtSE = (0,
|
|
15391
|
+
const isTxt = chunkVJZJESNT_js.isEditableTextElement(el) && allow.textEditable;
|
|
15392
|
+
const txtSE = (0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(el) ? el.textStyle : void 0;
|
|
15323
15393
|
const textStyleOverrideCss = pptx.buildTextStyleOverrideCss(el.id, visualAnimationState?.textStyle);
|
|
15324
|
-
const ss =
|
|
15394
|
+
const ss = chunkVJZJESNT_js.getShapeVisualStyle(
|
|
15325
15395
|
el,
|
|
15326
15396
|
hf,
|
|
15327
15397
|
fc,
|
|
@@ -15330,9 +15400,9 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15330
15400
|
visualAnimationState?.animatesFill,
|
|
15331
15401
|
visualAnimationState?.animatesStroke
|
|
15332
15402
|
);
|
|
15333
|
-
const ts =
|
|
15403
|
+
const ts = chunkVJZJESNT_js.getTextStyleForElement(el, chunkVJZJESNT_js.DEFAULT_TEXT_COLOR);
|
|
15334
15404
|
const isImg = el.type === "picture" || el.type === "image";
|
|
15335
|
-
const vs =
|
|
15405
|
+
const vs = chunkVJZJESNT_js.renderVectorShape(
|
|
15336
15406
|
el,
|
|
15337
15407
|
isImg ? false : hf,
|
|
15338
15408
|
fc,
|
|
@@ -15342,10 +15412,10 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15342
15412
|
visualAnimationState?.animatesStroke
|
|
15343
15413
|
);
|
|
15344
15414
|
const isModel3D = el.type === "model3d";
|
|
15345
|
-
const isConn =
|
|
15346
|
-
const shapeStyle3d = (0,
|
|
15415
|
+
const isConn = chunkVJZJESNT_js.isConnectorOrLineElement(el);
|
|
15416
|
+
const shapeStyle3d = (0, chunkVJZJESNT_js.dist_exports.hasShapeProperties)(el) ? el.shapeStyle : void 0;
|
|
15347
15417
|
const extrusionData = React17.useMemo(
|
|
15348
|
-
() =>
|
|
15418
|
+
() => chunkVJZJESNT_js.build3DExtrusionData(shapeStyle3d?.shape3d, shapeStyle3d?.scene3d, fc, el.width, el.height),
|
|
15349
15419
|
[shapeStyle3d?.shape3d, shapeStyle3d?.scene3d, fc, el.width, el.height]
|
|
15350
15420
|
);
|
|
15351
15421
|
const actionAffordance = useActionAffordance(el, canInteract);
|
|
@@ -15435,7 +15505,7 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15435
15505
|
"aria-hidden": aria.hidden ? true : void 0,
|
|
15436
15506
|
"aria-selected": isSelected ? true : void 0,
|
|
15437
15507
|
tabIndex: isFocusable ? 0 : -1,
|
|
15438
|
-
className:
|
|
15508
|
+
className: chunkVJZJESNT_js.cn(
|
|
15439
15509
|
"absolute",
|
|
15440
15510
|
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",
|
|
15441
15511
|
cur,
|
|
@@ -15508,9 +15578,9 @@ var ElementRenderer = React17__default.default.memo(
|
|
|
15508
15578
|
txtSE,
|
|
15509
15579
|
txtS: ts,
|
|
15510
15580
|
vecShape: backgroundAnimationState && !isImg ? null : vs,
|
|
15511
|
-
imgStyle:
|
|
15512
|
-
imgFilter:
|
|
15513
|
-
imgOpacity:
|
|
15581
|
+
imgStyle: chunkVJZJESNT_js.getImageRenderStyle(el),
|
|
15582
|
+
imgFilter: chunkVJZJESNT_js.getImageEffectsFilter(el),
|
|
15583
|
+
imgOpacity: chunkVJZJESNT_js.getImageEffectsOpacity(el),
|
|
15514
15584
|
imgAlt: imageAltText,
|
|
15515
15585
|
isTxtEl: isTxt,
|
|
15516
15586
|
media: mediaDataUrls,
|
|
@@ -15647,10 +15717,10 @@ function renderStrokeView(view, pressureSensitive, replayStyle, key) {
|
|
|
15647
15717
|
}
|
|
15648
15718
|
function renderInk(el, options) {
|
|
15649
15719
|
const replay = options?.replay ?? false;
|
|
15650
|
-
const strokes =
|
|
15720
|
+
const strokes = chunkVJZJESNT_js.buildInkGroupStrokes(el, { color: "#000", width: 3 });
|
|
15651
15721
|
strokes.some((s) => s.circles || s.nibMarks);
|
|
15652
15722
|
const pressureSensitive = options?.pressureSensitive;
|
|
15653
|
-
const replayStyles = replay ?
|
|
15723
|
+
const replayStyles = replay ? chunkVJZJESNT_js.getInkReplayStyles(el, options?.replayConfig) : null;
|
|
15654
15724
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15655
15725
|
"svg",
|
|
15656
15726
|
{
|
|
@@ -15658,7 +15728,7 @@ function renderInk(el, options) {
|
|
|
15658
15728
|
viewBox: `0 0 ${Math.max(el.width, 1)} ${Math.max(el.height, 1)}`,
|
|
15659
15729
|
preserveAspectRatio: "none",
|
|
15660
15730
|
children: [
|
|
15661
|
-
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children:
|
|
15731
|
+
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children: chunkVJZJESNT_js.INK_REPLAY_KEYFRAMES }),
|
|
15662
15732
|
strokes.map(
|
|
15663
15733
|
(s, i) => renderStrokeView(s, pressureSensitive, replayStyles?.[i], `${el.id}-ink-${i}`)
|
|
15664
15734
|
)
|
|
@@ -15669,7 +15739,7 @@ function renderInk(el, options) {
|
|
|
15669
15739
|
function renderGroup(children, parentGroupFill) {
|
|
15670
15740
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full h-full pointer-events-none", children: pptx.filterRenderedElements(children).map((c, childIndex) => {
|
|
15671
15741
|
const { hf, fc, sw, sc } = shapeParams(c);
|
|
15672
|
-
const baseSs =
|
|
15742
|
+
const baseSs = chunkVJZJESNT_js.getShapeVisualStyle(c, hf, fc, sw, sc);
|
|
15673
15743
|
const inheritedFill = pptx.resolveGroupChildFill(c, parentGroupFill);
|
|
15674
15744
|
const ss = inheritedFill ? {
|
|
15675
15745
|
...baseSs,
|
|
@@ -15680,9 +15750,9 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15680
15750
|
backgroundPosition: inheritedFill.backgroundPosition
|
|
15681
15751
|
} : baseSs;
|
|
15682
15752
|
const isI = c.type === "picture" || c.type === "image";
|
|
15683
|
-
const vs =
|
|
15684
|
-
const ts =
|
|
15685
|
-
const isTxt =
|
|
15753
|
+
const vs = chunkVJZJESNT_js.renderVectorShape(c, isI ? false : hf, fc, sw, sc);
|
|
15754
|
+
const ts = chunkVJZJESNT_js.getTextStyleForElement(c, chunkVJZJESNT_js.DEFAULT_TEXT_COLOR);
|
|
15755
|
+
const isTxt = chunkVJZJESNT_js.isEditableTextElement(c);
|
|
15686
15756
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15687
15757
|
"div",
|
|
15688
15758
|
{
|
|
@@ -15691,9 +15761,9 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15691
15761
|
style: {
|
|
15692
15762
|
left: c.x,
|
|
15693
15763
|
top: c.y,
|
|
15694
|
-
width: Math.max(c.width,
|
|
15695
|
-
height: Math.max(c.height,
|
|
15696
|
-
transform:
|
|
15764
|
+
width: Math.max(c.width, chunkVJZJESNT_js.MIN_ELEMENT_SIZE),
|
|
15765
|
+
height: Math.max(c.height, chunkVJZJESNT_js.MIN_ELEMENT_SIZE),
|
|
15766
|
+
transform: chunkVJZJESNT_js.getElementTransform(c),
|
|
15697
15767
|
transformOrigin: "center",
|
|
15698
15768
|
...ss,
|
|
15699
15769
|
...isI ? {
|
|
@@ -15718,8 +15788,8 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15718
15788
|
// A nested group: recurse, chaining the inherited fill so a
|
|
15719
15789
|
// `grpFill` shape under a fill-less sub-group still paints.
|
|
15720
15790
|
renderGroup(c.children, pptx.getGroupChildParentFill(c, parentGroupFill))
|
|
15721
|
-
) : isI && ("svgData" in c && c.svgData || "imageData" in c && c.imageData) ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style:
|
|
15722
|
-
|
|
15791
|
+
) : isI && ("svgData" in c && c.svgData || "imageData" in c && c.imageData) ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style: chunkVJZJESNT_js.getImageSurfaceStyle(c), children: [
|
|
15792
|
+
chunkVJZJESNT_js.isImageTiled(c) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
15723
15793
|
TiledImageLayer,
|
|
15724
15794
|
{
|
|
15725
15795
|
element: c,
|
|
@@ -15732,7 +15802,7 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15732
15802
|
src: "svgData" in c && c.svgData ? c.svgData : c.imageData,
|
|
15733
15803
|
alt: i18n.translationsEn["pptx.ink.groupChildAlt"],
|
|
15734
15804
|
className: "pointer-events-none select-none",
|
|
15735
|
-
style:
|
|
15805
|
+
style: chunkVJZJESNT_js.getImageRenderStyle(c),
|
|
15736
15806
|
draggable: false
|
|
15737
15807
|
}
|
|
15738
15808
|
),
|
|
@@ -15744,7 +15814,7 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15744
15814
|
{
|
|
15745
15815
|
className: "relative z-10 w-full h-full pointer-events-none whitespace-pre-wrap break-words leading-[1.3]",
|
|
15746
15816
|
style: ts,
|
|
15747
|
-
children:
|
|
15817
|
+
children: chunkVJZJESNT_js.renderTextSegments(c, chunkVJZJESNT_js.DEFAULT_TEXT_COLOR)
|
|
15748
15818
|
}
|
|
15749
15819
|
) : null
|
|
15750
15820
|
] })
|
|
@@ -15758,8 +15828,8 @@ function renderContentPart(el, options) {
|
|
|
15758
15828
|
if (el.inkStrokes && el.inkStrokes.length > 0) {
|
|
15759
15829
|
const replay = options?.replay ?? false;
|
|
15760
15830
|
const pressureSensitive = options?.pressureSensitive ?? true;
|
|
15761
|
-
const strokes =
|
|
15762
|
-
const replayStyles = replay ?
|
|
15831
|
+
const strokes = chunkVJZJESNT_js.buildContentPartStrokes(el);
|
|
15832
|
+
const replayStyles = replay ? chunkVJZJESNT_js.getContentPartReplayStyles(el.inkStrokes, options?.replayConfig) : null;
|
|
15763
15833
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15764
15834
|
"svg",
|
|
15765
15835
|
{
|
|
@@ -15767,7 +15837,7 @@ function renderContentPart(el, options) {
|
|
|
15767
15837
|
viewBox: `0 0 ${Math.max(el.width, 1)} ${Math.max(el.height, 1)}`,
|
|
15768
15838
|
preserveAspectRatio: "none",
|
|
15769
15839
|
children: [
|
|
15770
|
-
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children:
|
|
15840
|
+
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children: chunkVJZJESNT_js.INK_REPLAY_KEYFRAMES }),
|
|
15771
15841
|
strokes.map(
|
|
15772
15842
|
(s, i) => renderStrokeView(s, pressureSensitive, replayStyles?.[i], `${el.id}-cp-ink-${i}`)
|
|
15773
15843
|
)
|
|
@@ -15994,9 +16064,9 @@ function useInlineListEditor(element, rootRef, onChange, onModelReplacement) {
|
|
|
15994
16064
|
collaboration: connected,
|
|
15995
16065
|
model: pptx.createInlineListModelObserver(element),
|
|
15996
16066
|
activationSelection,
|
|
15997
|
-
children: seed && !connected ?
|
|
16067
|
+
children: seed && !connected ? chunkVJZJESNT_js.renderTextSegments(
|
|
15998
16068
|
element,
|
|
15999
|
-
|
|
16069
|
+
chunkVJZJESNT_js.DEFAULT_TEXT_COLOR,
|
|
16000
16070
|
void 0,
|
|
16001
16071
|
void 0,
|
|
16002
16072
|
void 0,
|
|
@@ -16166,7 +16236,7 @@ function InlineTextEditor({
|
|
|
16166
16236
|
seedRef.current = {
|
|
16167
16237
|
initialText,
|
|
16168
16238
|
hasRichSegments: Boolean(
|
|
16169
|
-
(0,
|
|
16239
|
+
(0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(element) && element.textSegments && element.textSegments.length > 0
|
|
16170
16240
|
)
|
|
16171
16241
|
};
|
|
16172
16242
|
}
|
|
@@ -16232,8 +16302,8 @@ function InlineTextEditor({
|
|
|
16232
16302
|
pending.endOffset
|
|
16233
16303
|
);
|
|
16234
16304
|
});
|
|
16235
|
-
const warpStyle =
|
|
16236
|
-
const compensationTransform =
|
|
16305
|
+
const warpStyle = chunkVJZJESNT_js.getTextWarpStyle(textStyleRaw);
|
|
16306
|
+
const compensationTransform = chunkVJZJESNT_js.getTextCompensationTransform(element);
|
|
16237
16307
|
const warpTransform = warpStyle?.transform;
|
|
16238
16308
|
const mergedTransform = [compensationTransform, warpTransform].filter(Boolean).join(" ") || void 0;
|
|
16239
16309
|
const wrapperStyle = {
|
|
@@ -16244,7 +16314,7 @@ function InlineTextEditor({
|
|
|
16244
16314
|
transformOrigin: warpStyle?.transformOrigin || "center"
|
|
16245
16315
|
};
|
|
16246
16316
|
const nextInlineStyleValue = (property) => {
|
|
16247
|
-
if (!(0,
|
|
16317
|
+
if (!(0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(element)) {
|
|
16248
16318
|
return true;
|
|
16249
16319
|
}
|
|
16250
16320
|
const result = pptx.getInlineEditorSelectionResult(element.textSegments);
|
|
@@ -16321,7 +16391,7 @@ function InlineTextEditor({
|
|
|
16321
16391
|
const text = e.clipboardData.getData("text/plain");
|
|
16322
16392
|
document.execCommand("insertText", false, text);
|
|
16323
16393
|
},
|
|
16324
|
-
children: list.seed ? list.children : seed.hasRichSegments ?
|
|
16394
|
+
children: list.seed ? list.children : seed.hasRichSegments ? chunkVJZJESNT_js.renderTextSegments(element, chunkVJZJESNT_js.DEFAULT_TEXT_COLOR) : seed.initialText
|
|
16325
16395
|
},
|
|
16326
16396
|
list.seed?.paragraphs[0].token ?? "plain"
|
|
16327
16397
|
);
|
|
@@ -17258,7 +17328,7 @@ function SmartArtRendererImpl({
|
|
|
17258
17328
|
if (!onUpdateElement || !pptx.shouldCommitSmartArtNodeText(smartArtData, nodeId, text)) {
|
|
17259
17329
|
return;
|
|
17260
17330
|
}
|
|
17261
|
-
const updated = (0,
|
|
17331
|
+
const updated = (0, chunkVJZJESNT_js.dist_exports.updateSmartArtNodeText)(smartArtData, nodeId, text);
|
|
17262
17332
|
const box = { width: element.width, height: element.height };
|
|
17263
17333
|
const reflowed = pptx.rebuildDrawingShapesIfCleared(
|
|
17264
17334
|
updated,
|
|
@@ -17274,7 +17344,7 @@ function SmartArtRendererImpl({
|
|
|
17274
17344
|
if (!onUpdateElement) {
|
|
17275
17345
|
return;
|
|
17276
17346
|
}
|
|
17277
|
-
const next = (0,
|
|
17347
|
+
const next = (0, chunkVJZJESNT_js.dist_exports.setSmartArtNodeStyle)(smartArtData, nodeId, { fillColor: fill });
|
|
17278
17348
|
if (next !== smartArtData) {
|
|
17279
17349
|
const box = { width: element.width, height: element.height };
|
|
17280
17350
|
const reflowed = pptx.rebuildDrawingShapesIfCleared(
|
|
@@ -17468,7 +17538,7 @@ function groupIntoParagraphs(element, fieldContext) {
|
|
|
17468
17538
|
element,
|
|
17469
17539
|
fieldContext ? (seg) => {
|
|
17470
17540
|
if (seg.fieldType) {
|
|
17471
|
-
const substituted =
|
|
17541
|
+
const substituted = chunkVJZJESNT_js.substituteFieldText(
|
|
17472
17542
|
seg.text,
|
|
17473
17543
|
seg.fieldType,
|
|
17474
17544
|
fieldContext,
|
|
@@ -17503,13 +17573,13 @@ function getSegmentTspanProps(segment, element, fallbackColor) {
|
|
|
17503
17573
|
if (s.strikethrough) {
|
|
17504
17574
|
decos.push("line-through");
|
|
17505
17575
|
}
|
|
17506
|
-
const fill = s.hyperlink ?
|
|
17576
|
+
const fill = s.hyperlink ? chunkVJZJESNT_js.normalizeHexColor(s.color || element.textStyle?.color, chunkVJZJESNT_js.HYPERLINK_COLOR) : chunkVJZJESNT_js.normalizeHexColor(s.color || element.textStyle?.color, fallbackColor);
|
|
17507
17577
|
return {
|
|
17508
17578
|
fill,
|
|
17509
|
-
fontSize: s.fontSize ?? element.textStyle?.fontSize ??
|
|
17510
|
-
fontWeight: s.
|
|
17511
|
-
fontStyle: s.italic ? "italic" : void 0,
|
|
17512
|
-
fontFamily: s.fontFamily || element.textStyle?.fontFamily ? (0,
|
|
17579
|
+
fontSize: s.fontSize ?? element.textStyle?.fontSize ?? chunkVJZJESNT_js.DEFAULT_TEXT_FONT_SIZE,
|
|
17580
|
+
fontWeight: pptx.resolveFontWeight(s.fontFamily || element.textStyle?.fontFamily, s.bold),
|
|
17581
|
+
fontStyle: pptx.resolveFontItalic(s.fontFamily || element.textStyle?.fontFamily, s.italic) ? "italic" : void 0,
|
|
17582
|
+
fontFamily: s.fontFamily || element.textStyle?.fontFamily ? (0, chunkVJZJESNT_js.dist_exports.getSubstituteFontFamily)(s.fontFamily || element.textStyle?.fontFamily || "") : chunkVJZJESNT_js.DEFAULT_FONT_FAMILY,
|
|
17513
17583
|
textDecoration: decos.length > 0 ? decos.join(" ") : void 0
|
|
17514
17584
|
};
|
|
17515
17585
|
}
|
|
@@ -17517,8 +17587,8 @@ function resolveSegmentFont(segment, element) {
|
|
|
17517
17587
|
const s = segment.style || {};
|
|
17518
17588
|
const family = s.fontFamily || element.textStyle?.fontFamily;
|
|
17519
17589
|
return {
|
|
17520
|
-
fontFamily: family ? (0,
|
|
17521
|
-
fontSizePx: s.fontSize ?? element.textStyle?.fontSize ??
|
|
17590
|
+
fontFamily: family ? (0, chunkVJZJESNT_js.dist_exports.getSubstituteFontFamily)(family) : chunkVJZJESNT_js.DEFAULT_FONT_FAMILY,
|
|
17591
|
+
fontSizePx: s.fontSize ?? element.textStyle?.fontSize ?? chunkVJZJESNT_js.DEFAULT_TEXT_FONT_SIZE,
|
|
17522
17592
|
bold: s.bold ?? element.textStyle?.bold,
|
|
17523
17593
|
italic: s.italic ?? element.textStyle?.italic
|
|
17524
17594
|
};
|
|
@@ -17584,7 +17654,7 @@ function WarpedText({
|
|
|
17584
17654
|
fallbackColor,
|
|
17585
17655
|
fieldContext
|
|
17586
17656
|
}) {
|
|
17587
|
-
if (!(0,
|
|
17657
|
+
if (!(0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(element)) {
|
|
17588
17658
|
return null;
|
|
17589
17659
|
}
|
|
17590
17660
|
const textEl = element;
|
|
@@ -17602,9 +17672,9 @@ function WarpedText({
|
|
|
17602
17672
|
const warpAdj2 = textEl.textStyle?.textWarpAdj2;
|
|
17603
17673
|
const align = textEl.textStyle?.align ?? "center";
|
|
17604
17674
|
const { startOffset, textAnchor } = getAlignmentProps(align);
|
|
17605
|
-
const baseFontSize = textEl.textStyle?.fontSize ??
|
|
17606
|
-
const baseFontFamily = textEl.textStyle?.fontFamily ? (0,
|
|
17607
|
-
const baseFill =
|
|
17675
|
+
const baseFontSize = textEl.textStyle?.fontSize ?? chunkVJZJESNT_js.DEFAULT_TEXT_FONT_SIZE;
|
|
17676
|
+
const baseFontFamily = textEl.textStyle?.fontFamily ? (0, chunkVJZJESNT_js.dist_exports.getSubstituteFontFamily)(textEl.textStyle.fontFamily) : chunkVJZJESNT_js.DEFAULT_FONT_FAMILY;
|
|
17677
|
+
const baseFill = chunkVJZJESNT_js.normalizeHexColor(textEl.textStyle?.color, fallbackColor);
|
|
17608
17678
|
if (pptx.hasGlyphEnvelope(preset)) {
|
|
17609
17679
|
const perLine = pptx.buildGlyphEnvelopeBlock(
|
|
17610
17680
|
preset,
|
|
@@ -17678,8 +17748,8 @@ function WarpedText({
|
|
|
17678
17748
|
fontSize: baseFontSize,
|
|
17679
17749
|
fontFamily: baseFontFamily,
|
|
17680
17750
|
fill: baseFill,
|
|
17681
|
-
fontWeight: textEl.textStyle?.bold
|
|
17682
|
-
fontStyle: textEl.textStyle?.italic ? "italic" : "normal",
|
|
17751
|
+
fontWeight: pptx.resolveFontWeight(textEl.textStyle?.fontFamily, textEl.textStyle?.bold),
|
|
17752
|
+
fontStyle: pptx.resolveFontItalic(textEl.textStyle?.fontFamily, textEl.textStyle?.italic) ? "italic" : "normal",
|
|
17683
17753
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17684
17754
|
"textPath",
|
|
17685
17755
|
{
|
|
@@ -17704,7 +17774,7 @@ function WarpedText({
|
|
|
17704
17774
|
);
|
|
17705
17775
|
}
|
|
17706
17776
|
var GLYPH_BY_SHAPE = Object.fromEntries(
|
|
17707
|
-
|
|
17777
|
+
chunkVJZJESNT_js.ACTION_BUTTON_PRESETS.map((p) => [p.shapeType, p.iconPath])
|
|
17708
17778
|
);
|
|
17709
17779
|
GLYPH_BY_SHAPE["actionButtonForwardOrNext"] = GLYPH_BY_SHAPE["actionButtonForwardNext"];
|
|
17710
17780
|
GLYPH_BY_SHAPE["actionButtonBackOrPrevious"] = GLYPH_BY_SHAPE["actionButtonBackPrevious"];
|
|
@@ -17774,11 +17844,11 @@ function renderTextElementBody(options) {
|
|
|
17774
17844
|
const isLinkedTextBox = pptx.isLinkedTextBox(el);
|
|
17775
17845
|
const linkedSegments = pptx.getOverflowSegments(el, slideElements);
|
|
17776
17846
|
const useSvgWarp = pptx.shouldUseSvgWarp(
|
|
17777
|
-
(0,
|
|
17847
|
+
(0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(el) ? el.textStyle?.textWarpPreset : void 0
|
|
17778
17848
|
);
|
|
17779
|
-
const scene3dStyle = (0,
|
|
17849
|
+
const scene3dStyle = (0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(el) ? chunkVJZJESNT_js.buildTextBody3DSceneStyle(el.textStyle, { width: el.width, height: el.height }) : void 0;
|
|
17780
17850
|
const rotationTransform = pptx.getTextBodyRotationTransform(el);
|
|
17781
|
-
const composedTransform = [rotationTransform,
|
|
17851
|
+
const composedTransform = [rotationTransform, chunkVJZJESNT_js.getTextCompensationTransform(el), scene3dStyle?.transform].filter(Boolean).join(" ") || void 0;
|
|
17782
17852
|
const transformStyle = {
|
|
17783
17853
|
transform: composedTransform,
|
|
17784
17854
|
// A COM-measured homography (`scene3dStyle.transformOrigin === '0 0'`)
|
|
@@ -17808,18 +17878,18 @@ function renderTextElementBody(options) {
|
|
|
17808
17878
|
shouldRenderText && (useSvgWarp ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
17809
17879
|
"div",
|
|
17810
17880
|
{
|
|
17811
|
-
className:
|
|
17881
|
+
className: chunkVJZJESNT_js.cn(
|
|
17812
17882
|
"relative z-10 w-full h-full",
|
|
17813
17883
|
onHyperlinkClick ? "" : "pointer-events-none"
|
|
17814
17884
|
),
|
|
17815
|
-
style: { ...
|
|
17885
|
+
style: { ...chunkVJZJESNT_js.getTextLayoutStyle(el), ...transformStyle },
|
|
17816
17886
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17817
17887
|
WarpedText,
|
|
17818
17888
|
{
|
|
17819
17889
|
element: el,
|
|
17820
17890
|
width: el.width,
|
|
17821
17891
|
height: el.height,
|
|
17822
|
-
fallbackColor:
|
|
17892
|
+
fallbackColor: chunkVJZJESNT_js.DEFAULT_TEXT_COLOR,
|
|
17823
17893
|
findHighlights: findHl,
|
|
17824
17894
|
fieldContext
|
|
17825
17895
|
}
|
|
@@ -17828,19 +17898,19 @@ function renderTextElementBody(options) {
|
|
|
17828
17898
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
17829
17899
|
"div",
|
|
17830
17900
|
{
|
|
17831
|
-
className:
|
|
17901
|
+
className: chunkVJZJESNT_js.cn(
|
|
17832
17902
|
"relative z-10 w-full h-full whitespace-pre-wrap break-words leading-[1.3]",
|
|
17833
17903
|
onHyperlinkClick ? "" : "pointer-events-none"
|
|
17834
17904
|
),
|
|
17835
17905
|
style: {
|
|
17836
|
-
...
|
|
17906
|
+
...chunkVJZJESNT_js.getTextLayoutStyle(el),
|
|
17837
17907
|
...txtS,
|
|
17838
|
-
...
|
|
17908
|
+
...chunkVJZJESNT_js.getTextWarpStyle(txtSE),
|
|
17839
17909
|
...transformStyle
|
|
17840
17910
|
},
|
|
17841
|
-
children:
|
|
17911
|
+
children: chunkVJZJESNT_js.renderTextSegments(
|
|
17842
17912
|
el,
|
|
17843
|
-
|
|
17913
|
+
chunkVJZJESNT_js.DEFAULT_TEXT_COLOR,
|
|
17844
17914
|
void 0,
|
|
17845
17915
|
findHl,
|
|
17846
17916
|
onHyperlinkClick,
|
|
@@ -18159,7 +18229,7 @@ function renderBody(options) {
|
|
|
18159
18229
|
);
|
|
18160
18230
|
}
|
|
18161
18231
|
if (isImg) {
|
|
18162
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style:
|
|
18232
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style: chunkVJZJESNT_js.getImageSurfaceStyle(el), children: [
|
|
18163
18233
|
renderImg(el, imgStyle, imgFilter, imgAlt, imgOpacity),
|
|
18164
18234
|
vecShape ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none absolute inset-0", children: vecShape }) : null
|
|
18165
18235
|
] });
|
|
@@ -18176,7 +18246,7 @@ function renderBody(options) {
|
|
|
18176
18246
|
textDirection: txtSE?.textDirection,
|
|
18177
18247
|
textStyle: txtS,
|
|
18178
18248
|
textStyleRaw: txtSE,
|
|
18179
|
-
layoutStyle:
|
|
18249
|
+
layoutStyle: chunkVJZJESNT_js.getTextLayoutStyle(el),
|
|
18180
18250
|
element: el,
|
|
18181
18251
|
onCommit,
|
|
18182
18252
|
onCancel,
|
|
@@ -18187,7 +18257,7 @@ function renderBody(options) {
|
|
|
18187
18257
|
] });
|
|
18188
18258
|
}
|
|
18189
18259
|
if (el.type === "table") {
|
|
18190
|
-
return
|
|
18260
|
+
return chunkVJZJESNT_js.renderTableElement(el, txtS, {
|
|
18191
18261
|
editable: isSel,
|
|
18192
18262
|
selectedCell: isSel ? tableSt : null,
|
|
18193
18263
|
onSelectCell: onCellSel,
|
|
@@ -18220,7 +18290,7 @@ function renderBody(options) {
|
|
|
18220
18290
|
);
|
|
18221
18291
|
}
|
|
18222
18292
|
if (el.type === "media") {
|
|
18223
|
-
return
|
|
18293
|
+
return chunkVJZJESNT_js.renderMediaElement(el, media, {
|
|
18224
18294
|
// Present mode autoplays every media element on the active slide,
|
|
18225
18295
|
// not only ones persisted with their own `autoPlay` flag (matching
|
|
18226
18296
|
// the other four bindings' unconditional `presenting`-gated
|
|
@@ -18243,7 +18313,7 @@ function renderBody(options) {
|
|
|
18243
18313
|
onPlayStateChange: handleMediaPlayStateChange
|
|
18244
18314
|
});
|
|
18245
18315
|
}
|
|
18246
|
-
if (doInk && (0,
|
|
18316
|
+
if (doInk && (0, chunkVJZJESNT_js.dist_exports.isInkElement)(el)) {
|
|
18247
18317
|
return renderInk(el, {
|
|
18248
18318
|
replay: isPresentationPassive,
|
|
18249
18319
|
pressureSensitive: true
|
|
@@ -18272,27 +18342,27 @@ function renderBody(options) {
|
|
|
18272
18342
|
}
|
|
18273
18343
|
return renderGroup(el.children, pptx.getGroupChildParentFill(el));
|
|
18274
18344
|
}
|
|
18275
|
-
if (
|
|
18276
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
18345
|
+
if (chunkVJZJESNT_js.shouldRenderFallbackLabel(el, isTxtEl)) {
|
|
18346
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkVJZJESNT_js.getElementLabel(el) });
|
|
18277
18347
|
}
|
|
18278
18348
|
return renderTextElementBody(options);
|
|
18279
18349
|
}
|
|
18280
18350
|
function defaultTextColorForFill(fillColor) {
|
|
18281
18351
|
const hex = String(fillColor ?? "").replace(/^#/u, "");
|
|
18282
18352
|
if (!/^[0-9a-f]{6}$/iu.test(hex)) {
|
|
18283
|
-
return
|
|
18353
|
+
return chunkVJZJESNT_js.DEFAULT_TEXT_COLOR;
|
|
18284
18354
|
}
|
|
18285
18355
|
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);
|
|
18286
18356
|
const luminance = channels[0] * 0.2126 + channels[1] * 0.7152 + channels[2] * 0.0722;
|
|
18287
|
-
return luminance > 0.179 ?
|
|
18357
|
+
return luminance > 0.179 ? chunkVJZJESNT_js.DEFAULT_TEXT_COLOR : "#ffffff";
|
|
18288
18358
|
}
|
|
18289
18359
|
function getStaticElementVisualState(element, parentGroupFill) {
|
|
18290
|
-
const style = (0,
|
|
18291
|
-
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(
|
|
18292
|
-
const fill =
|
|
18360
|
+
const style = (0, chunkVJZJESNT_js.dist_exports.hasShapeProperties)(element) ? element.shapeStyle : void 0;
|
|
18361
|
+
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(chunkVJZJESNT_js.buildCssGradientFromShapeStyle(style) || style?.fillGradient) || style?.fillMode === "pattern" && Boolean(style.fillPatternPreset);
|
|
18362
|
+
const fill = chunkVJZJESNT_js.normalizeHexColor(style?.fillColor, chunkVJZJESNT_js.DEFAULT_FILL_COLOR);
|
|
18293
18363
|
const strokeWidth = pptx.paintedStrokeWidth(style);
|
|
18294
|
-
const stroke =
|
|
18295
|
-
const baseVisualStyle =
|
|
18364
|
+
const stroke = chunkVJZJESNT_js.normalizeHexColor(style?.strokeColor, chunkVJZJESNT_js.DEFAULT_STROKE_COLOR);
|
|
18365
|
+
const baseVisualStyle = chunkVJZJESNT_js.getShapeVisualStyle(element, hasFill, fill, strokeWidth, stroke);
|
|
18296
18366
|
const inheritedFill = pptx.resolveGroupChildFill(element, parentGroupFill);
|
|
18297
18367
|
const visualStyle = inheritedFill ? {
|
|
18298
18368
|
...baseVisualStyle,
|
|
@@ -18302,13 +18372,13 @@ function getStaticElementVisualState(element, parentGroupFill) {
|
|
|
18302
18372
|
backgroundSize: inheritedFill.backgroundSize,
|
|
18303
18373
|
backgroundPosition: inheritedFill.backgroundPosition
|
|
18304
18374
|
} : baseVisualStyle;
|
|
18305
|
-
const textStyle =
|
|
18375
|
+
const textStyle = chunkVJZJESNT_js.getTextStyleForElement(
|
|
18306
18376
|
element,
|
|
18307
|
-
element.type === "shape" && hasFill ? defaultTextColorForFill(fill) :
|
|
18377
|
+
element.type === "shape" && hasFill ? defaultTextColorForFill(fill) : chunkVJZJESNT_js.DEFAULT_TEXT_COLOR
|
|
18308
18378
|
);
|
|
18309
18379
|
const isImage = element.type === "picture" || element.type === "image";
|
|
18310
|
-
const letsTextOverflow = (0,
|
|
18311
|
-
const shapeType = (0,
|
|
18380
|
+
const letsTextOverflow = (0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(element) && element.textStyle?.autoFitMode === "shrink" && (element.type === "text" || element.locks?.txBox === true);
|
|
18381
|
+
const shapeType = (0, chunkVJZJESNT_js.dist_exports.hasShapeProperties)(element) ? element.shapeType : void 0;
|
|
18312
18382
|
const isCallout = pptx.isWedgeCalloutPresetShape(shapeType) || String(shapeType ?? "").toLowerCase().includes("callout");
|
|
18313
18383
|
return {
|
|
18314
18384
|
hasFill,
|
|
@@ -18329,7 +18399,7 @@ function getStaticElementInteractionState(element, hasActionHandler, exposeEleme
|
|
|
18329
18399
|
return { action, isActionable, contractRole };
|
|
18330
18400
|
}
|
|
18331
18401
|
function getStaticElementWrapperClassName(element, visual, positioned, isActionable) {
|
|
18332
|
-
const overflowClass = visual.isImage || element.type === "group" ||
|
|
18402
|
+
const overflowClass = visual.isImage || visual.strokeWidth > 0 || element.type === "group" || chunkVJZJESNT_js.isConnectorOrLineElement(element) || visual.isCallout || visual.letsTextOverflow ? "" : "overflow-hidden";
|
|
18333
18403
|
const pointerClass = isActionable ? "pointer-events-auto cursor-pointer" : "pointer-events-none";
|
|
18334
18404
|
return `${positioned ? "absolute" : "relative"} ${overflowClass} ${pointerClass}`;
|
|
18335
18405
|
}
|
|
@@ -18382,7 +18452,7 @@ function StaticElementRendererImpl({
|
|
|
18382
18452
|
"data-pptx-action": isActionable ? "click" : void 0,
|
|
18383
18453
|
className: getStaticElementWrapperClassName(
|
|
18384
18454
|
element,
|
|
18385
|
-
{ isImage, letsTextOverflow, isCallout },
|
|
18455
|
+
{ isImage, letsTextOverflow, isCallout, strokeWidth },
|
|
18386
18456
|
positioned,
|
|
18387
18457
|
isActionable
|
|
18388
18458
|
),
|
|
@@ -18412,7 +18482,7 @@ function StaticElementRendererImpl({
|
|
|
18412
18482
|
top: positioned ? element.y : void 0,
|
|
18413
18483
|
width: positioned ? Math.max(element.width, 1) : "100%",
|
|
18414
18484
|
height: positioned ? Math.max(element.height, 1) : "100%",
|
|
18415
|
-
transform: positioned ?
|
|
18485
|
+
transform: positioned ? chunkVJZJESNT_js.getElementTransform(element) : void 0,
|
|
18416
18486
|
transformOrigin: "center",
|
|
18417
18487
|
zIndex,
|
|
18418
18488
|
...visualStyle,
|
|
@@ -18453,20 +18523,20 @@ function StaticElementRendererImpl({
|
|
|
18453
18523
|
isEditing: false,
|
|
18454
18524
|
editText: "",
|
|
18455
18525
|
spellCheck: false,
|
|
18456
|
-
txtSE: (0,
|
|
18526
|
+
txtSE: (0, chunkVJZJESNT_js.dist_exports.hasTextProperties)(element) ? element.textStyle : void 0,
|
|
18457
18527
|
txtS: textStyle,
|
|
18458
|
-
vecShape:
|
|
18528
|
+
vecShape: chunkVJZJESNT_js.renderVectorShape(
|
|
18459
18529
|
element,
|
|
18460
18530
|
isImage ? false : hasFill,
|
|
18461
18531
|
fill,
|
|
18462
18532
|
strokeWidth,
|
|
18463
18533
|
stroke
|
|
18464
18534
|
),
|
|
18465
|
-
imgStyle: imageAnimation ? { ...
|
|
18466
|
-
imgFilter:
|
|
18467
|
-
imgOpacity:
|
|
18535
|
+
imgStyle: imageAnimation ? { ...chunkVJZJESNT_js.getImageRenderStyle(element), animation: imageAnimation } : chunkVJZJESNT_js.getImageRenderStyle(element),
|
|
18536
|
+
imgFilter: chunkVJZJESNT_js.getImageEffectsFilter(element),
|
|
18537
|
+
imgOpacity: chunkVJZJESNT_js.getImageEffectsOpacity(element),
|
|
18468
18538
|
imgAlt: "",
|
|
18469
|
-
isTxtEl:
|
|
18539
|
+
isTxtEl: chunkVJZJESNT_js.isEditableTextElement(element),
|
|
18470
18540
|
media: mediaDataUrls,
|
|
18471
18541
|
tableSt: null,
|
|
18472
18542
|
isSel: false,
|
|
@@ -18512,7 +18582,7 @@ function SlideLayer({
|
|
|
18512
18582
|
style: {
|
|
18513
18583
|
width: safeWidth,
|
|
18514
18584
|
height: safeHeight,
|
|
18515
|
-
backgroundColor: slide.backgroundColor ?
|
|
18585
|
+
backgroundColor: slide.backgroundColor ? chunkVJZJESNT_js.normalizeHexColor(slide.backgroundColor, "#ffffff") : "#ffffff",
|
|
18516
18586
|
backgroundImage: slide.backgroundImage ? `url(${slide.backgroundImage})` : slide.backgroundGradient ? slide.backgroundGradient : void 0,
|
|
18517
18587
|
backgroundSize: slide.backgroundImage ? "cover" : void 0,
|
|
18518
18588
|
backgroundPosition: slide.backgroundImage ? "center" : void 0
|