pptx-react-viewer 4.50.0 → 4.51.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.md +38 -4
- package/dist/{AiChatPanel-WYAL24DX.js → AiChatPanel-EV22O7UO.js} +19 -20
- package/dist/AiChatPanel-EV22O7UO.js.br +0 -0
- package/dist/AiChatPanel-EV22O7UO.js.gz +0 -0
- package/dist/{AiChatPanel-VJV5OEG2.mjs → AiChatPanel-R323KNGN.mjs} +1 -2
- package/dist/AiChatPanel-R323KNGN.mjs.br +0 -0
- package/dist/AiChatPanel-R323KNGN.mjs.gz +0 -0
- package/dist/{chunk-5JJQLK7N.mjs → chunk-KCUXY7DE.mjs} +151 -48
- package/dist/chunk-KCUXY7DE.mjs.br +0 -0
- package/dist/chunk-KCUXY7DE.mjs.gz +0 -0
- package/dist/{chunk-QHGEPW5G.mjs → chunk-V4DY4IWP.mjs} +16 -19
- package/dist/chunk-V4DY4IWP.mjs.br +0 -0
- package/dist/chunk-V4DY4IWP.mjs.gz +0 -0
- package/dist/{chunk-4OF7X5EE.js → chunk-VRX5NJY2.js} +693 -589
- package/dist/chunk-VRX5NJY2.js.br +0 -0
- package/dist/chunk-VRX5NJY2.js.gz +0 -0
- package/dist/{chunk-D5NXYXPP.js → chunk-YJ4DAS4V.js} +214 -217
- package/dist/chunk-YJ4DAS4V.js.br +0 -0
- package/dist/chunk-YJ4DAS4V.js.gz +0 -0
- package/dist/{chunk-JWNBTFZZ.js → chunk-Z22RD3E2.js} +41 -6
- package/dist/chunk-Z22RD3E2.js.br +0 -0
- package/dist/chunk-Z22RD3E2.js.gz +0 -0
- package/dist/{chunk-77IXTLKU.mjs → chunk-ZCGYPCZM.mjs} +35 -5
- package/dist/chunk-ZCGYPCZM.mjs.br +0 -0
- package/dist/chunk-ZCGYPCZM.mjs.gz +0 -0
- package/dist/index.d.ts +51 -12
- package/dist/index.js +28 -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.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 +51 -12
- package/dist/viewer/index.js +23 -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-VJV5OEG2.mjs.br +0 -0
- package/dist/AiChatPanel-VJV5OEG2.mjs.gz +0 -0
- package/dist/AiChatPanel-WYAL24DX.js.br +0 -0
- package/dist/AiChatPanel-WYAL24DX.js.gz +0 -0
- package/dist/chunk-4OF7X5EE.js.br +0 -0
- package/dist/chunk-4OF7X5EE.js.gz +0 -0
- package/dist/chunk-5JJQLK7N.mjs.br +0 -0
- package/dist/chunk-5JJQLK7N.mjs.gz +0 -0
- package/dist/chunk-77IXTLKU.mjs.br +0 -0
- package/dist/chunk-77IXTLKU.mjs.gz +0 -0
- package/dist/chunk-D5NXYXPP.js.br +0 -0
- package/dist/chunk-D5NXYXPP.js.gz +0 -0
- package/dist/chunk-JWNBTFZZ.js.br +0 -0
- package/dist/chunk-JWNBTFZZ.js.gz +0 -0
- package/dist/chunk-QHGEPW5G.mjs.br +0 -0
- package/dist/chunk-QHGEPW5G.mjs.gz +0 -0
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkZ22RD3E2_js = require('./chunk-Z22RD3E2.js');
|
|
4
4
|
var pptx = require('ooxml-ui/pptx');
|
|
5
5
|
var React17 = require('react');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var pptx$1 = require('ooxml-core/pptx');
|
|
8
8
|
var i18n = require('ooxml-ui/pptx/i18n');
|
|
9
|
-
var reactI18next = require('react-i18next');
|
|
10
9
|
var reactDom = require('react-dom');
|
|
11
10
|
var lu = require('react-icons/lu');
|
|
12
11
|
|
|
@@ -583,9 +582,9 @@ function serializeHistoryDocument(snapshot) {
|
|
|
583
582
|
}
|
|
584
583
|
function recordExplicitSlideUpdate(history, previous, before, label) {
|
|
585
584
|
if (previous && serializeHistoryDocument(previous) !== serializeHistoryDocument(before)) {
|
|
586
|
-
history.record(
|
|
585
|
+
history.record(chunkZ22RD3E2_js.cloneHistorySnapshot(previous), previous.actionLabel);
|
|
587
586
|
}
|
|
588
|
-
history.record({ ...
|
|
587
|
+
history.record({ ...chunkZ22RD3E2_js.cloneHistorySnapshot(before), actionLabel: label }, label);
|
|
589
588
|
}
|
|
590
589
|
var POLL_INTERVAL_MS = 16;
|
|
591
590
|
function usePointerReleaseWakeup(hasActivePointerInteraction) {
|
|
@@ -663,8 +662,8 @@ function useEditorHistory(input) {
|
|
|
663
662
|
width: canvasSize.width,
|
|
664
663
|
height: canvasSize.height,
|
|
665
664
|
activeSlideIndex,
|
|
666
|
-
slides: slides.map(
|
|
667
|
-
templateElementsBySlideId:
|
|
665
|
+
slides: slides.map(chunkZ22RD3E2_js.cloneSlide),
|
|
666
|
+
templateElementsBySlideId: chunkZ22RD3E2_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
668
667
|
...actionLabel ? { actionLabel } : {}
|
|
669
668
|
};
|
|
670
669
|
},
|
|
@@ -677,9 +676,9 @@ function useEditorHistory(input) {
|
|
|
677
676
|
width: snapshot.width,
|
|
678
677
|
height: snapshot.height
|
|
679
678
|
});
|
|
680
|
-
setSlides(snapshot.slides.map(
|
|
679
|
+
setSlides(snapshot.slides.map(chunkZ22RD3E2_js.cloneSlide));
|
|
681
680
|
setTemplateElementsBySlideId(
|
|
682
|
-
|
|
681
|
+
chunkZ22RD3E2_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
683
682
|
);
|
|
684
683
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
685
684
|
setSelectedElementIds([]);
|
|
@@ -719,8 +718,8 @@ function useEditorHistory(input) {
|
|
|
719
718
|
return;
|
|
720
719
|
}
|
|
721
720
|
isApplyingHistoryRef.current = true;
|
|
722
|
-
const nextSnapshot =
|
|
723
|
-
lastHistorySnapshotRef.current =
|
|
721
|
+
const nextSnapshot = chunkZ22RD3E2_js.cloneHistorySnapshot(result.snapshot);
|
|
722
|
+
lastHistorySnapshotRef.current = chunkZ22RD3E2_js.cloneHistorySnapshot(nextSnapshot);
|
|
724
723
|
lastHistorySerializedRef.current = serializeHistoryDocument(nextSnapshot);
|
|
725
724
|
applyHistorySnapshot(nextSnapshot);
|
|
726
725
|
unlockHistoryTracking();
|
|
@@ -735,8 +734,8 @@ function useEditorHistory(input) {
|
|
|
735
734
|
return;
|
|
736
735
|
}
|
|
737
736
|
isApplyingHistoryRef.current = true;
|
|
738
|
-
const targetSnapshot =
|
|
739
|
-
lastHistorySnapshotRef.current =
|
|
737
|
+
const targetSnapshot = chunkZ22RD3E2_js.cloneHistorySnapshot(result.snapshot);
|
|
738
|
+
lastHistorySnapshotRef.current = chunkZ22RD3E2_js.cloneHistorySnapshot(targetSnapshot);
|
|
740
739
|
lastHistorySerializedRef.current = serializeHistoryDocument(targetSnapshot);
|
|
741
740
|
applyHistorySnapshot(targetSnapshot);
|
|
742
741
|
unlockHistoryTracking();
|
|
@@ -746,7 +745,7 @@ function useEditorHistory(input) {
|
|
|
746
745
|
(initialSnapshot) => {
|
|
747
746
|
history.clear();
|
|
748
747
|
if (initialSnapshot) {
|
|
749
|
-
const clonedInitial =
|
|
748
|
+
const clonedInitial = chunkZ22RD3E2_js.cloneHistorySnapshot(initialSnapshot);
|
|
750
749
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
751
750
|
lastHistorySerializedRef.current = serializeHistoryDocument(clonedInitial);
|
|
752
751
|
} else {
|
|
@@ -820,10 +819,10 @@ function useEditorHistory(input) {
|
|
|
820
819
|
slides
|
|
821
820
|
]);
|
|
822
821
|
const commitSlides = (nextSlides, label, beforeSlides = slides) => {
|
|
823
|
-
const before = { ...buildHistorySnapshot(), slides: beforeSlides.map(
|
|
824
|
-
const after = { ...before, slides: nextSlides.map(
|
|
822
|
+
const before = { ...buildHistorySnapshot(), slides: beforeSlides.map(chunkZ22RD3E2_js.cloneSlide) };
|
|
823
|
+
const after = { ...before, slides: nextSlides.map(chunkZ22RD3E2_js.cloneSlide) };
|
|
825
824
|
recordExplicitSlideUpdate(history, lastHistorySnapshotRef.current, before, label);
|
|
826
|
-
lastHistorySnapshotRef.current =
|
|
825
|
+
lastHistorySnapshotRef.current = chunkZ22RD3E2_js.cloneHistorySnapshot(after);
|
|
827
826
|
lastHistorySerializedRef.current = serializeHistoryDocument(after);
|
|
828
827
|
isApplyingHistoryRef.current = false;
|
|
829
828
|
setSlides(nextSlides);
|
|
@@ -1008,22 +1007,22 @@ function useZoomViewport({
|
|
|
1008
1007
|
selectedElements.forEach((element) => {
|
|
1009
1008
|
minX = Math.min(minX, element.x);
|
|
1010
1009
|
minY = Math.min(minY, element.y);
|
|
1011
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
1012
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
1010
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkZ22RD3E2_js.MIN_ELEMENT_SIZE));
|
|
1011
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkZ22RD3E2_js.MIN_ELEMENT_SIZE));
|
|
1013
1012
|
});
|
|
1014
1013
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
1015
1014
|
return;
|
|
1016
1015
|
}
|
|
1017
1016
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
1018
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
1019
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
1017
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkZ22RD3E2_js.MIN_ELEMENT_SIZE);
|
|
1018
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkZ22RD3E2_js.MIN_ELEMENT_SIZE);
|
|
1020
1019
|
const availableWidth = Math.max(
|
|
1021
|
-
effectiveEditorDimensions.width -
|
|
1022
|
-
|
|
1020
|
+
effectiveEditorDimensions.width - chunkZ22RD3E2_js.ZOOM_TO_SELECTION_PADDING,
|
|
1021
|
+
chunkZ22RD3E2_js.MIN_ELEMENT_SIZE
|
|
1023
1022
|
);
|
|
1024
1023
|
const availableHeight = Math.max(
|
|
1025
|
-
effectiveEditorDimensions.height -
|
|
1026
|
-
|
|
1024
|
+
effectiveEditorDimensions.height - chunkZ22RD3E2_js.ZOOM_TO_SELECTION_PADDING,
|
|
1025
|
+
chunkZ22RD3E2_js.MIN_ELEMENT_SIZE
|
|
1027
1026
|
);
|
|
1028
1027
|
const targetEditorScale = Math.min(
|
|
1029
1028
|
availableWidth / boundsWidth,
|
|
@@ -3975,8 +3974,8 @@ function useViewerCoreState(_input) {
|
|
|
3975
3974
|
const { slides, setSlides, slidesRef } = useSlideState();
|
|
3976
3975
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = React17.useState({});
|
|
3977
3976
|
const [canvasSize, setCanvasSize] = React17.useState({
|
|
3978
|
-
width:
|
|
3979
|
-
height:
|
|
3977
|
+
width: chunkZ22RD3E2_js.DEFAULT_CANVAS_WIDTH,
|
|
3978
|
+
height: chunkZ22RD3E2_js.DEFAULT_CANVAS_HEIGHT
|
|
3980
3979
|
});
|
|
3981
3980
|
const [slideSizeEmu, setSlideSizeEmu] = React17.useState();
|
|
3982
3981
|
const [activeSlideIndex, setActiveSlideIndex] = React17.useState(0);
|
|
@@ -4452,12 +4451,12 @@ function useLoadContent({
|
|
|
4452
4451
|
}
|
|
4453
4452
|
resources.commit();
|
|
4454
4453
|
handlerRef.current = handler;
|
|
4455
|
-
const partition =
|
|
4454
|
+
const partition = chunkZ22RD3E2_js.partitionTemplateElements(nextSlides);
|
|
4456
4455
|
setSlides(partition.slides);
|
|
4457
4456
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4458
4457
|
setCanvasSize({
|
|
4459
|
-
width: parsed.width ??
|
|
4460
|
-
height: parsed.height ??
|
|
4458
|
+
width: parsed.width ?? chunkZ22RD3E2_js.DEFAULT_CANVAS_WIDTH,
|
|
4459
|
+
height: parsed.height ?? chunkZ22RD3E2_js.DEFAULT_CANVAS_HEIGHT
|
|
4461
4460
|
});
|
|
4462
4461
|
setSlideSizeEmu(
|
|
4463
4462
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4863,7 +4862,7 @@ function useElementOperations(input) {
|
|
|
4863
4862
|
);
|
|
4864
4863
|
return;
|
|
4865
4864
|
}
|
|
4866
|
-
if (
|
|
4865
|
+
if (chunkZ22RD3E2_js.isTemplateElementId(elementId)) {
|
|
4867
4866
|
const slideId = activeSlide?.id;
|
|
4868
4867
|
if (slideId) {
|
|
4869
4868
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -5149,8 +5148,8 @@ function createCanvasGestures(getInput, frames = animationFrames) {
|
|
|
5149
5148
|
}
|
|
5150
5149
|
function paintResize(resize, transform) {
|
|
5151
5150
|
const { x, y } = transform;
|
|
5152
|
-
const width = Math.max(transform.width,
|
|
5153
|
-
const height = Math.max(transform.height,
|
|
5151
|
+
const width = Math.max(transform.width, chunkZ22RD3E2_js.MIN_ELEMENT_SIZE);
|
|
5152
|
+
const height = Math.max(transform.height, chunkZ22RD3E2_js.MIN_ELEMENT_SIZE);
|
|
5154
5153
|
resize.lastX = x;
|
|
5155
5154
|
resize.lastY = y;
|
|
5156
5155
|
resize.lastWidth = transform.width;
|
|
@@ -5207,7 +5206,7 @@ function createCanvasGestures(getInput, frames = animationFrames) {
|
|
|
5207
5206
|
getGridSize: () => getInput().gridSpacingPx,
|
|
5208
5207
|
getSnapToShape: () => getInput().snapToShape,
|
|
5209
5208
|
getGuides: () => getInput().guides.map(({ axis, position }) => ({ axis, position })),
|
|
5210
|
-
getMinSize: () =>
|
|
5209
|
+
getMinSize: () => chunkZ22RD3E2_js.MIN_ELEMENT_SIZE,
|
|
5211
5210
|
getSnapExcludeIds: () => armed?.kind === "move" ? Object.keys(armed.drag.startPositionsById) : [],
|
|
5212
5211
|
getStageOrigin: () => {
|
|
5213
5212
|
const rect = getInput().canvasStageRef.current?.getBoundingClientRect();
|
|
@@ -5288,7 +5287,7 @@ function commitMove(input, drag) {
|
|
|
5288
5287
|
const start = drag.startPositionsById[el.id];
|
|
5289
5288
|
return start ? { ...el, x: start.x + dx, y: start.y + dy } : el;
|
|
5290
5289
|
});
|
|
5291
|
-
return
|
|
5290
|
+
return chunkZ22RD3E2_js.applyReroutedConnectors(moved, chunkZ22RD3E2_js.rerouteConnectorsForMovedElements(moved, movedIds));
|
|
5292
5291
|
};
|
|
5293
5292
|
if (input.editTemplateMode) {
|
|
5294
5293
|
const slideId = input.activeSlide?.id;
|
|
@@ -5319,8 +5318,8 @@ function commitResize(input, resize) {
|
|
|
5319
5318
|
if (i !== input.activeSlideIndex) {
|
|
5320
5319
|
return s;
|
|
5321
5320
|
}
|
|
5322
|
-
const rerouted =
|
|
5323
|
-
return rerouted.length === 0 ? s : { ...s, elements:
|
|
5321
|
+
const rerouted = chunkZ22RD3E2_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
5322
|
+
return rerouted.length === 0 ? s : { ...s, elements: chunkZ22RD3E2_js.applyReroutedConnectors(s.elements, rerouted) };
|
|
5324
5323
|
})
|
|
5325
5324
|
);
|
|
5326
5325
|
}
|
|
@@ -6155,7 +6154,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
6155
6154
|
return;
|
|
6156
6155
|
}
|
|
6157
6156
|
const resolved = resolveHyperlinkEditResult(data);
|
|
6158
|
-
if (resolved.url && !
|
|
6157
|
+
if (resolved.url && !chunkZ22RD3E2_js.isUrlSafe(resolved.url)) {
|
|
6159
6158
|
return;
|
|
6160
6159
|
}
|
|
6161
6160
|
const actionClick = {
|
|
@@ -6201,7 +6200,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
6201
6200
|
if (!activeSlide) {
|
|
6202
6201
|
return;
|
|
6203
6202
|
}
|
|
6204
|
-
const preset =
|
|
6203
|
+
const preset = chunkZ22RD3E2_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
6205
6204
|
if (!preset) {
|
|
6206
6205
|
return;
|
|
6207
6206
|
}
|
|
@@ -6288,7 +6287,7 @@ function useInsertElements(input) {
|
|
|
6288
6287
|
width: 300,
|
|
6289
6288
|
height: 60,
|
|
6290
6289
|
text: "",
|
|
6291
|
-
textStyle: { fontSize:
|
|
6290
|
+
textStyle: { fontSize: chunkZ22RD3E2_js.DEFAULT_TEXT_FONT_SIZE }
|
|
6292
6291
|
});
|
|
6293
6292
|
};
|
|
6294
6293
|
const handleAddShape = () => {
|
|
@@ -6310,7 +6309,7 @@ function useInsertElements(input) {
|
|
|
6310
6309
|
}
|
|
6311
6310
|
});
|
|
6312
6311
|
};
|
|
6313
|
-
const handleAddTable = (rows =
|
|
6312
|
+
const handleAddTable = (rows = chunkZ22RD3E2_js.DEFAULT_TABLE_ROWS, columns = chunkZ22RD3E2_js.DEFAULT_TABLE_COLUMNS) => {
|
|
6314
6313
|
if (!activeSlide) {
|
|
6315
6314
|
return;
|
|
6316
6315
|
}
|
|
@@ -6484,7 +6483,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6484
6483
|
history
|
|
6485
6484
|
} = input;
|
|
6486
6485
|
const updateElementsOwning = (elementId, updater) => {
|
|
6487
|
-
if (editTemplateMode && !
|
|
6486
|
+
if (editTemplateMode && !chunkZ22RD3E2_js.isTemplateElementId(elementId)) {
|
|
6488
6487
|
ops.updateSlides(
|
|
6489
6488
|
(prev) => prev.map(
|
|
6490
6489
|
(slide, index) => index === activeSlideIndex ? { ...slide, elements: updater(slide.elements) } : slide
|
|
@@ -6518,9 +6517,9 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6518
6517
|
return;
|
|
6519
6518
|
}
|
|
6520
6519
|
const group = selectedElement;
|
|
6521
|
-
const intoTemplate =
|
|
6520
|
+
const intoTemplate = chunkZ22RD3E2_js.isTemplateElementId(group.id);
|
|
6522
6521
|
const childIds = group.children.map(
|
|
6523
|
-
(child) => intoTemplate ?
|
|
6522
|
+
(child) => intoTemplate ? chunkZ22RD3E2_js.makeCloneId(true, child.id || group.id) : child.id || pptx.generateElementId()
|
|
6524
6523
|
);
|
|
6525
6524
|
const { elements, childIds: usedIds } = pptx.ungroupElements(
|
|
6526
6525
|
ops.activeElements,
|
|
@@ -6956,7 +6955,7 @@ function createTableMergeHandlers(input) {
|
|
|
6956
6955
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6957
6956
|
return;
|
|
6958
6957
|
}
|
|
6959
|
-
const newTableData =
|
|
6958
|
+
const newTableData = chunkZ22RD3E2_js.mergeCells(
|
|
6960
6959
|
[
|
|
6961
6960
|
{ row: rowIndex, col: columnIndex },
|
|
6962
6961
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6964,7 +6963,7 @@ function createTableMergeHandlers(input) {
|
|
|
6964
6963
|
td
|
|
6965
6964
|
);
|
|
6966
6965
|
const updates = { tableData: newTableData };
|
|
6967
|
-
const newRawXml =
|
|
6966
|
+
const newRawXml = chunkZ22RD3E2_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6968
6967
|
if (newRawXml) {
|
|
6969
6968
|
updates.rawXml = newRawXml;
|
|
6970
6969
|
}
|
|
@@ -6990,7 +6989,7 @@ function createTableMergeHandlers(input) {
|
|
|
6990
6989
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6991
6990
|
return;
|
|
6992
6991
|
}
|
|
6993
|
-
const newTableData =
|
|
6992
|
+
const newTableData = chunkZ22RD3E2_js.mergeCells(
|
|
6994
6993
|
[
|
|
6995
6994
|
{ row: rowIndex, col: columnIndex },
|
|
6996
6995
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6998,7 +6997,7 @@ function createTableMergeHandlers(input) {
|
|
|
6998
6997
|
td
|
|
6999
6998
|
);
|
|
7000
6999
|
const updates = { tableData: newTableData };
|
|
7001
|
-
const newRawXml =
|
|
7000
|
+
const newRawXml = chunkZ22RD3E2_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7002
7001
|
if (newRawXml) {
|
|
7003
7002
|
updates.rawXml = newRawXml;
|
|
7004
7003
|
}
|
|
@@ -7013,9 +7012,9 @@ function createTableMergeHandlers(input) {
|
|
|
7013
7012
|
return;
|
|
7014
7013
|
}
|
|
7015
7014
|
const td = selectedElement.tableData;
|
|
7016
|
-
const newTableData =
|
|
7015
|
+
const newTableData = chunkZ22RD3E2_js.mergeCells(ts.selectedCells, td);
|
|
7017
7016
|
const updates = { tableData: newTableData };
|
|
7018
|
-
const newRawXml =
|
|
7017
|
+
const newRawXml = chunkZ22RD3E2_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7019
7018
|
if (newRawXml) {
|
|
7020
7019
|
updates.rawXml = newRawXml;
|
|
7021
7020
|
}
|
|
@@ -7032,9 +7031,9 @@ function createTableMergeHandlers(input) {
|
|
|
7032
7031
|
}
|
|
7033
7032
|
const { rowIndex, columnIndex } = ts;
|
|
7034
7033
|
const td = selectedElement.tableData;
|
|
7035
|
-
const newTableData =
|
|
7034
|
+
const newTableData = chunkZ22RD3E2_js.splitCell(rowIndex, columnIndex, td);
|
|
7036
7035
|
const updates = { tableData: newTableData };
|
|
7037
|
-
const newRawXml =
|
|
7036
|
+
const newRawXml = chunkZ22RD3E2_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7038
7037
|
if (newRawXml) {
|
|
7039
7038
|
updates.rawXml = newRawXml;
|
|
7040
7039
|
}
|
|
@@ -7069,7 +7068,7 @@ function createTableStructHandlers(input) {
|
|
|
7069
7068
|
updates.tableData = pptx.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
7070
7069
|
}
|
|
7071
7070
|
if (el.rawXml) {
|
|
7072
|
-
const newRawXml =
|
|
7071
|
+
const newRawXml = chunkZ22RD3E2_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
7073
7072
|
if (newRawXml) {
|
|
7074
7073
|
updates.rawXml = newRawXml;
|
|
7075
7074
|
}
|
|
@@ -7093,7 +7092,7 @@ function createTableStructHandlers(input) {
|
|
|
7093
7092
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
7094
7093
|
const updates = {};
|
|
7095
7094
|
if (selectedElement.rawXml) {
|
|
7096
|
-
const newRawXml =
|
|
7095
|
+
const newRawXml = chunkZ22RD3E2_js.updateCellTextStyleInRawXml(
|
|
7097
7096
|
selectedElement,
|
|
7098
7097
|
rowIndex,
|
|
7099
7098
|
colIndex,
|
|
@@ -7271,7 +7270,7 @@ function useExportSaveAs(input) {
|
|
|
7271
7270
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7272
7271
|
const slideSize = pptx.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7273
7272
|
const data = {
|
|
7274
|
-
slides:
|
|
7273
|
+
slides: chunkZ22RD3E2_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7275
7274
|
width: canvasSize.width,
|
|
7276
7275
|
height: canvasSize.height,
|
|
7277
7276
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7433,7 +7432,7 @@ async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActi
|
|
|
7433
7432
|
}
|
|
7434
7433
|
function tilesToPdfPage(tilesResult) {
|
|
7435
7434
|
return tilesResult.tiles.map((tile) => ({
|
|
7436
|
-
image:
|
|
7435
|
+
image: chunkZ22RD3E2_js.canvasToJpegData(tile.canvas),
|
|
7437
7436
|
placement: pptx.placeTileOnPage(
|
|
7438
7437
|
tile,
|
|
7439
7438
|
tilesResult.fullWidth,
|
|
@@ -7466,7 +7465,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7466
7465
|
if (pages.length === 0) {
|
|
7467
7466
|
throw new Error(i18n.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7468
7467
|
}
|
|
7469
|
-
const pdfBlobUrl =
|
|
7468
|
+
const pdfBlobUrl = chunkZ22RD3E2_js.buildPdfFromTiledImageData(pages);
|
|
7470
7469
|
pptx.downloadDataUrl(pdfBlobUrl, filename);
|
|
7471
7470
|
}
|
|
7472
7471
|
async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, slideNotes, filename = "presentation-notes.pdf", options = {}) {
|
|
@@ -7496,7 +7495,7 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7496
7495
|
if (pages.length === 0) {
|
|
7497
7496
|
throw new Error(i18n.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7498
7497
|
}
|
|
7499
|
-
const pdfDataUrl =
|
|
7498
|
+
const pdfDataUrl = chunkZ22RD3E2_js.buildNotesPdf(pages);
|
|
7500
7499
|
pptx.downloadDataUrl(pdfDataUrl, filename);
|
|
7501
7500
|
}
|
|
7502
7501
|
async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
@@ -8109,7 +8108,7 @@ function useViewerOptionsContext() {
|
|
|
8109
8108
|
function usePrintHandlers(input) {
|
|
8110
8109
|
const { slides, activeSlideIndex, canvasStageRef, setActiveSlideIndex, pptxData } = input;
|
|
8111
8110
|
const [isPrintDialogOpen, setIsPrintDialogOpen] = React17.useState(false);
|
|
8112
|
-
const { t } =
|
|
8111
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
8113
8112
|
const viewerOptions = useViewerOptionsContext();
|
|
8114
8113
|
const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
|
|
8115
8114
|
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * pptx.resolveImageResolutionScale(viewerOptions);
|
|
@@ -8378,8 +8377,19 @@ function useThemeHandlers(input) {
|
|
|
8378
8377
|
return;
|
|
8379
8378
|
}
|
|
8380
8379
|
await handler.updateThemeFontScheme(fontScheme);
|
|
8380
|
+
const previousFonts = theme?.fontScheme;
|
|
8381
|
+
bumpHistory();
|
|
8382
|
+
setSlides((prev) => pptx$1.reResolveSlideFonts(prev, previousFonts, fontScheme));
|
|
8383
|
+
setTemplateElementsBySlideId(
|
|
8384
|
+
(prev) => Object.fromEntries(
|
|
8385
|
+
Object.entries(prev).map(([slideId, elements]) => [
|
|
8386
|
+
slideId,
|
|
8387
|
+
pptx$1.reResolveElementFonts(elements, previousFonts, fontScheme)
|
|
8388
|
+
])
|
|
8389
|
+
)
|
|
8390
|
+
);
|
|
8381
8391
|
setTheme((prev) => prev ? { ...prev, fontScheme } : { fontScheme });
|
|
8382
|
-
|
|
8392
|
+
history.markDirty();
|
|
8383
8393
|
};
|
|
8384
8394
|
const handleUpdateThemeName = async (name) => {
|
|
8385
8395
|
const handler = handlerRef.current;
|
|
@@ -8401,20 +8411,7 @@ function useThemeHandlers(input) {
|
|
|
8401
8411
|
}
|
|
8402
8412
|
await refreshContentAfterThemeChange();
|
|
8403
8413
|
};
|
|
8404
|
-
const handleApplyThemeData =
|
|
8405
|
-
const handler = handlerRef.current;
|
|
8406
|
-
if (!handler) {
|
|
8407
|
-
return;
|
|
8408
|
-
}
|
|
8409
|
-
await handler.applyTheme(colorScheme, fontScheme, themeName);
|
|
8410
|
-
setTheme((prev) => ({
|
|
8411
|
-
...prev,
|
|
8412
|
-
colorScheme,
|
|
8413
|
-
fontScheme,
|
|
8414
|
-
...themeName && { name: themeName }
|
|
8415
|
-
}));
|
|
8416
|
-
await refreshContentAfterThemeChange();
|
|
8417
|
-
};
|
|
8414
|
+
const handleApplyThemeData = (colorScheme, fontScheme, themeName) => applyThemeEditorEdit(input, { colorScheme, fontScheme, name: themeName ?? theme?.name ?? "" });
|
|
8418
8415
|
const handleSetTemplateBackground = (path, backgroundColor) => {
|
|
8419
8416
|
const handler = handlerRef.current;
|
|
8420
8417
|
if (!handler) {
|
|
@@ -8599,7 +8596,7 @@ function usePropertyHandlers(input) {
|
|
|
8599
8596
|
width: canvasSize.width,
|
|
8600
8597
|
height: canvasSize.height
|
|
8601
8598
|
};
|
|
8602
|
-
setCompareResult(
|
|
8599
|
+
setCompareResult(chunkZ22RD3E2_js.comparePresentation(cur, other));
|
|
8603
8600
|
setIsComparePanelOpen(true);
|
|
8604
8601
|
} catch (err) {
|
|
8605
8602
|
console.warn("Compare failed:", err);
|
|
@@ -8955,7 +8952,7 @@ function useViewerDialogs(input) {
|
|
|
8955
8952
|
};
|
|
8956
8953
|
}
|
|
8957
8954
|
function computeGridSpacingPx(documentGridSpacing) {
|
|
8958
|
-
return pptx.computeGridSpacingPx(documentGridSpacing,
|
|
8955
|
+
return pptx.computeGridSpacingPx(documentGridSpacing, chunkZ22RD3E2_js.GRID_SIZE);
|
|
8959
8956
|
}
|
|
8960
8957
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
8961
8958
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
@@ -8964,7 +8961,7 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, pre
|
|
|
8964
8961
|
}
|
|
8965
8962
|
function computeSlideSectionGroups(slides, sections) {
|
|
8966
8963
|
return pptx.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8967
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8964
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkZ22RD3E2_js.UNGROUPED_SECTION_ID : chunkZ22RD3E2_js.DEFAULT_SECTION_GROUP_ID),
|
|
8968
8965
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8969
8966
|
slideIndexes: group.slideIndexes,
|
|
8970
8967
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8983,7 +8980,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8983
8980
|
});
|
|
8984
8981
|
}
|
|
8985
8982
|
function useDerivedSlideState(input) {
|
|
8986
|
-
const { t } =
|
|
8983
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
8987
8984
|
const {
|
|
8988
8985
|
slides,
|
|
8989
8986
|
sections,
|
|
@@ -9009,10 +9006,10 @@ function useDerivedSlideState(input) {
|
|
|
9009
9006
|
);
|
|
9010
9007
|
const slideSectionGroups = React17.useMemo(
|
|
9011
9008
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
9012
|
-
if (group.id ===
|
|
9009
|
+
if (group.id === chunkZ22RD3E2_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
9013
9010
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
9014
9011
|
}
|
|
9015
|
-
if (group.id ===
|
|
9012
|
+
if (group.id === chunkZ22RD3E2_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
9016
9013
|
return { ...group, label: t("pptx.sections.slides") };
|
|
9017
9014
|
}
|
|
9018
9015
|
return group;
|
|
@@ -9119,7 +9116,7 @@ function useAnnotationHandlers(input) {
|
|
|
9119
9116
|
if (nextMode === "present") {
|
|
9120
9117
|
presentation.enterPresentMode();
|
|
9121
9118
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
9122
|
-
|
|
9119
|
+
chunkZ22RD3E2_js.stopAllPersistentAudio();
|
|
9123
9120
|
if (promptKeepInkAnnotations) {
|
|
9124
9121
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
9125
9122
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -9129,7 +9126,7 @@ function useAnnotationHandlers(input) {
|
|
|
9129
9126
|
}
|
|
9130
9127
|
} else {
|
|
9131
9128
|
if (mode === "present") {
|
|
9132
|
-
|
|
9129
|
+
chunkZ22RD3E2_js.stopAllPersistentAudio();
|
|
9133
9130
|
}
|
|
9134
9131
|
setMode(nextMode);
|
|
9135
9132
|
}
|
|
@@ -9296,7 +9293,7 @@ function useSerialize(input) {
|
|
|
9296
9293
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
9297
9294
|
};
|
|
9298
9295
|
});
|
|
9299
|
-
const slidesToSave =
|
|
9296
|
+
const slidesToSave = chunkZ22RD3E2_js.buildSaveSlides(slidesWithGuides, pending.templateElementsBySlideId);
|
|
9300
9297
|
const saveOptions = pptx.buildDeckSaveOptions({
|
|
9301
9298
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
9302
9299
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
@@ -9440,7 +9437,7 @@ function usePresentationSetup(input) {
|
|
|
9440
9437
|
return;
|
|
9441
9438
|
}
|
|
9442
9439
|
if (mode === "present" && nextMode !== "present") {
|
|
9443
|
-
|
|
9440
|
+
chunkZ22RD3E2_js.stopAllPersistentAudio();
|
|
9444
9441
|
stopAnimationSound();
|
|
9445
9442
|
const exitHandler = exitModeHandlerRef.current;
|
|
9446
9443
|
if (exitHandler) {
|
|
@@ -9561,7 +9558,7 @@ function useCanvasImagePaste(input) {
|
|
|
9561
9558
|
);
|
|
9562
9559
|
}
|
|
9563
9560
|
function formatPatchFor(element, format) {
|
|
9564
|
-
const updated =
|
|
9561
|
+
const updated = chunkZ22RD3E2_js.applyFormatToElement(element, format);
|
|
9565
9562
|
const updates = {};
|
|
9566
9563
|
if (pptx$1.hasShapeProperties(updated)) {
|
|
9567
9564
|
updates.shapeStyle = updated.shapeStyle;
|
|
@@ -9584,7 +9581,7 @@ function useFormatPainterEditing(input) {
|
|
|
9584
9581
|
const prevFormatPainterRef = React17.useRef(false);
|
|
9585
9582
|
React17.useEffect(() => {
|
|
9586
9583
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9587
|
-
copiedFormatRef.current =
|
|
9584
|
+
copiedFormatRef.current = chunkZ22RD3E2_js.copyFormatFromElement(selectedElement);
|
|
9588
9585
|
} else if (!formatPainterActive) {
|
|
9589
9586
|
copiedFormatRef.current = null;
|
|
9590
9587
|
}
|
|
@@ -11206,7 +11203,7 @@ function useCollaborationWriteBack(input) {
|
|
|
11206
11203
|
getSourceBytes: () => latest.current.getSourceBytes?.() ?? null,
|
|
11207
11204
|
getSaveOptions: () => latest.current.getSaveOptions?.(),
|
|
11208
11205
|
getTemplateElements: () => latest.current.templateElementsBySlideId,
|
|
11209
|
-
mergeTemplateElements:
|
|
11206
|
+
mergeTemplateElements: chunkZ22RD3E2_js.buildSaveSlides,
|
|
11210
11207
|
onWriteBackStatus: () => latest.current.onWriteBackStatus?.(
|
|
11211
11208
|
pptx.writeBackReport(latest.current.config, created.getState())
|
|
11212
11209
|
)
|
|
@@ -11765,8 +11762,8 @@ function useTouchGestures(input) {
|
|
|
11765
11762
|
}
|
|
11766
11763
|
const recognizer = pptx.createTouchGestureRecognizer({
|
|
11767
11764
|
getScale: () => scaleRef.current,
|
|
11768
|
-
minScale:
|
|
11769
|
-
maxScale:
|
|
11765
|
+
minScale: chunkZ22RD3E2_js.MIN_ZOOM_SCALE,
|
|
11766
|
+
maxScale: chunkZ22RD3E2_js.MAX_ZOOM_SCALE,
|
|
11770
11767
|
callbacks: {
|
|
11771
11768
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
11772
11769
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -11890,7 +11887,7 @@ function buildCanvasProps(input) {
|
|
|
11890
11887
|
if (pptx.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
11891
11888
|
return;
|
|
11892
11889
|
}
|
|
11893
|
-
|
|
11890
|
+
chunkZ22RD3E2_js.safeOpenUrl(url, target);
|
|
11894
11891
|
};
|
|
11895
11892
|
const handleActionClick = (elementId, action) => {
|
|
11896
11893
|
if (mode === "present") {
|
|
@@ -11905,9 +11902,9 @@ function buildCanvasProps(input) {
|
|
|
11905
11902
|
}
|
|
11906
11903
|
};
|
|
11907
11904
|
const handleHyperlinkClick = (url, target) => {
|
|
11908
|
-
if (
|
|
11905
|
+
if (chunkZ22RD3E2_js.isPpactionUrl(url)) {
|
|
11909
11906
|
if (mode === "present") {
|
|
11910
|
-
const parsed =
|
|
11907
|
+
const parsed = chunkZ22RD3E2_js.parsePpactionUrl(url);
|
|
11911
11908
|
if (parsed) {
|
|
11912
11909
|
presentation.handlePresentationAction({
|
|
11913
11910
|
action: parsed.action,
|
|
@@ -12335,7 +12332,7 @@ function buildToolbarProps(input) {
|
|
|
12335
12332
|
markDirty: history.markDirty
|
|
12336
12333
|
}),
|
|
12337
12334
|
formatPainterActive: s.formatPainterActive,
|
|
12338
|
-
canActivateFormatPainter:
|
|
12335
|
+
canActivateFormatPainter: chunkZ22RD3E2_js.hasCopyableFormat(selectedElement),
|
|
12339
12336
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
12340
12337
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
12341
12338
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -13026,7 +13023,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
13026
13023
|
} = input;
|
|
13027
13024
|
const collaborationConfig = pptx.resolveCollaborationConfig(input.collaboration);
|
|
13028
13025
|
const [collaborationReadOnly, setCollaborationReadOnly] = React17.useState(Boolean(collaborationConfig));
|
|
13029
|
-
const { t } =
|
|
13026
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
13030
13027
|
const [content, setContent] = React17.useState(incomingContent ?? null);
|
|
13031
13028
|
const [loadOrigin, setLoadOrigin] = React17.useState("bootstrap");
|
|
13032
13029
|
React17.useEffect(() => {
|
|
@@ -13213,23 +13210,23 @@ function ColorChangedImage({
|
|
|
13213
13210
|
className,
|
|
13214
13211
|
alt
|
|
13215
13212
|
}) {
|
|
13216
|
-
const tolerance = tolerancePct ??
|
|
13217
|
-
const cacheKey =
|
|
13213
|
+
const tolerance = tolerancePct ?? chunkZ22RD3E2_js.DEFAULT_COLOR_CHANGE_TOLERANCE;
|
|
13214
|
+
const cacheKey = chunkZ22RD3E2_js.buildCacheKey(
|
|
13218
13215
|
src,
|
|
13219
13216
|
clrChange.clrFrom,
|
|
13220
13217
|
clrChange.clrTo,
|
|
13221
13218
|
tolerance,
|
|
13222
13219
|
Boolean(clrChange.clrToTransparent)
|
|
13223
13220
|
);
|
|
13224
|
-
const cached =
|
|
13221
|
+
const cached = chunkZ22RD3E2_js.getCachedResult(cacheKey);
|
|
13225
13222
|
const [processedSrc, setProcessedSrc] = React17.useState(cached ?? null);
|
|
13226
13223
|
React17.useEffect(() => {
|
|
13227
|
-
if (
|
|
13228
|
-
setProcessedSrc(
|
|
13224
|
+
if (chunkZ22RD3E2_js.getCachedResult(cacheKey)) {
|
|
13225
|
+
setProcessedSrc(chunkZ22RD3E2_js.getCachedResult(cacheKey) ?? null);
|
|
13229
13226
|
return;
|
|
13230
13227
|
}
|
|
13231
13228
|
let cancelled = false;
|
|
13232
|
-
|
|
13229
|
+
chunkZ22RD3E2_js.applyColorChange(
|
|
13233
13230
|
src,
|
|
13234
13231
|
clrChange.clrFrom,
|
|
13235
13232
|
clrChange.clrTo,
|
|
@@ -13237,7 +13234,7 @@ function ColorChangedImage({
|
|
|
13237
13234
|
Boolean(clrChange.clrToTransparent)
|
|
13238
13235
|
).then((result) => {
|
|
13239
13236
|
if (!cancelled) {
|
|
13240
|
-
|
|
13237
|
+
chunkZ22RD3E2_js.setCachedResult(cacheKey, result.dataUrl);
|
|
13241
13238
|
setProcessedSrc(result.dataUrl);
|
|
13242
13239
|
}
|
|
13243
13240
|
return void 0;
|
|
@@ -13329,7 +13326,7 @@ function TiledImageLayer({
|
|
|
13329
13326
|
cancelled = true;
|
|
13330
13327
|
};
|
|
13331
13328
|
}, [src]);
|
|
13332
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, style: { ...
|
|
13329
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, style: { ...chunkZ22RD3E2_js.getImageTilingStyle(element, nativeSize), ...style } });
|
|
13333
13330
|
}
|
|
13334
13331
|
function renderImageEffectDefinitions(element, excludeDuotone = false) {
|
|
13335
13332
|
return pptx.getImageSvgFilters(element).filter((definition) => !excludeDuotone || definition.id !== `duotone-${element.id}`).map((definition) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13398,7 +13395,7 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
13398
13395
|
...filter ? { filter } : {},
|
|
13399
13396
|
...opacity !== void 0 ? { opacity } : {}
|
|
13400
13397
|
};
|
|
13401
|
-
if (
|
|
13398
|
+
if (chunkZ22RD3E2_js.isImageTiled(el)) {
|
|
13402
13399
|
const tileSrc = imgSrc(el);
|
|
13403
13400
|
if (!tileSrc) {
|
|
13404
13401
|
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" });
|
|
@@ -13420,9 +13417,9 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
13420
13417
|
pptx$1.isImageLikeElement(el) ? el.imageEffects?.colorWash : void 0
|
|
13421
13418
|
);
|
|
13422
13419
|
const clrChange = "imageEffects" in el ? el.imageEffects?.clrChange : void 0;
|
|
13423
|
-
const duotoneColors =
|
|
13420
|
+
const duotoneColors = chunkZ22RD3E2_js.getDuotoneColors(el);
|
|
13424
13421
|
const useDuotoneCanvas = Boolean(duotoneColors && !clrChange);
|
|
13425
|
-
const filterForImg = useDuotoneCanvas ?
|
|
13422
|
+
const filterForImg = useDuotoneCanvas ? chunkZ22RD3E2_js.getImageEffectsFilter(el, { excludeDuotone: true }) : filter;
|
|
13426
13423
|
const canvasEffectStyles = {
|
|
13427
13424
|
...filterForImg ? { filter: filterForImg } : {},
|
|
13428
13425
|
...opacity !== void 0 ? { opacity } : {}
|
|
@@ -13498,10 +13495,10 @@ function SlideBackgroundImageLayer({
|
|
|
13498
13495
|
style: { zIndex: 0 },
|
|
13499
13496
|
children: renderImg(
|
|
13500
13497
|
backgroundElement,
|
|
13501
|
-
|
|
13502
|
-
|
|
13498
|
+
chunkZ22RD3E2_js.getImageRenderStyle(backgroundElement),
|
|
13499
|
+
chunkZ22RD3E2_js.getImageEffectsFilter(backgroundElement),
|
|
13503
13500
|
"",
|
|
13504
|
-
|
|
13501
|
+
chunkZ22RD3E2_js.getImageEffectsOpacity(backgroundElement)
|
|
13505
13502
|
)
|
|
13506
13503
|
}
|
|
13507
13504
|
);
|
|
@@ -13772,7 +13769,7 @@ function ChartElementView({
|
|
|
13772
13769
|
onUpdateElement,
|
|
13773
13770
|
animationState
|
|
13774
13771
|
}) {
|
|
13775
|
-
const { t } =
|
|
13772
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
13776
13773
|
const wrapperRef = React17.useRef(null);
|
|
13777
13774
|
const { selection, setSelection } = useChartPartSelection();
|
|
13778
13775
|
const [titleDraft, setTitleDraft] = React17.useState(null);
|
|
@@ -13787,7 +13784,7 @@ function ChartElementView({
|
|
|
13787
13784
|
pptx.getBarFacePicturePixelSampleVersion
|
|
13788
13785
|
);
|
|
13789
13786
|
const viewModel = React17.useMemo(() => {
|
|
13790
|
-
return canEdit ?
|
|
13787
|
+
return canEdit ? chunkZ22RD3E2_js.buildReactChartViewModel(element) : null;
|
|
13791
13788
|
}, [canEdit, element, barFacePictureSampleVersion]);
|
|
13792
13789
|
React17.useEffect(pptx.ensureChartInteractionStyles, []);
|
|
13793
13790
|
React17.useEffect(() => {
|
|
@@ -13892,9 +13889,9 @@ function ChartElementView({
|
|
|
13892
13889
|
textStyle: animationState?.textStyle,
|
|
13893
13890
|
onSelect: chart3D.onSelect,
|
|
13894
13891
|
onDrag: chart3D.onDrag,
|
|
13895
|
-
children:
|
|
13892
|
+
children: chunkZ22RD3E2_js.renderChartElement(renderedElement, (key) => t(key))
|
|
13896
13893
|
}
|
|
13897
|
-
) :
|
|
13894
|
+
) : chunkZ22RD3E2_js.renderChartElement(renderedElement, (key) => t(key)),
|
|
13898
13895
|
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) }),
|
|
13899
13896
|
titleDraft !== null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13900
13897
|
"input",
|
|
@@ -13922,7 +13919,7 @@ function ChartElementView({
|
|
|
13922
13919
|
);
|
|
13923
13920
|
}
|
|
13924
13921
|
function useActionAffordance(element, canInteract) {
|
|
13925
|
-
const { t } =
|
|
13922
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
13926
13923
|
pptx.ensureActionAffordanceStyles();
|
|
13927
13924
|
return React17.useMemo(
|
|
13928
13925
|
() => pptx.resolveElementActionAffordance(element, {
|
|
@@ -14200,7 +14197,7 @@ function ResizeHandles({
|
|
|
14200
14197
|
nonRotationTransform,
|
|
14201
14198
|
onRotate
|
|
14202
14199
|
}) {
|
|
14203
|
-
const { t } =
|
|
14200
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
14204
14201
|
const rotateRef = useRotateHandlePlacement(elementId, Boolean(onRotate));
|
|
14205
14202
|
const peStyle = forcePointerEvents ? { ...HANDLE_TOUCH_ACTION, pointerEvents: "auto" } : HANDLE_TOUCH_ACTION;
|
|
14206
14203
|
const resizeStyle = { ...HANDLE_TOUCH_ACTION, pointerEvents: "none" };
|
|
@@ -14233,7 +14230,7 @@ function ResizeHandles({
|
|
|
14233
14230
|
"aria-label": t("pptx.selectionOverlay.resize", { handle }),
|
|
14234
14231
|
"data-pptx-handle-kind": "resize",
|
|
14235
14232
|
"data-pptx-compact": true,
|
|
14236
|
-
className:
|
|
14233
|
+
className: chunkZ22RD3E2_js.cn(
|
|
14237
14234
|
"absolute z-10 group border-0 bg-transparent p-0",
|
|
14238
14235
|
RESIZE_DEFAULT_CLASSES,
|
|
14239
14236
|
posClass,
|
|
@@ -14259,7 +14256,7 @@ function ResizeHandles({
|
|
|
14259
14256
|
"div",
|
|
14260
14257
|
{
|
|
14261
14258
|
"data-pptx-handle-hit": true,
|
|
14262
|
-
className:
|
|
14259
|
+
className: chunkZ22RD3E2_js.cn(
|
|
14263
14260
|
"absolute -inset-px pointer-events-auto [--pptx-handle-hit-inset:-1px]",
|
|
14264
14261
|
corner ? "max-md:-inset-1.5 max-md:[--pptx-handle-hit-inset:-6px]" : "max-md:-inset-2 max-md:[--pptx-handle-hit-inset:-8px]"
|
|
14265
14262
|
),
|
|
@@ -14280,7 +14277,7 @@ function ResizeHandles({
|
|
|
14280
14277
|
"aria-label": t("pptx.selectionOverlay.rotate"),
|
|
14281
14278
|
"data-pptx-handle-kind": "rotate",
|
|
14282
14279
|
"data-pptx-compact": true,
|
|
14283
|
-
className:
|
|
14280
|
+
className: chunkZ22RD3E2_js.cn(
|
|
14284
14281
|
"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",
|
|
14285
14282
|
ROTATE_DEFAULT_CLASSES
|
|
14286
14283
|
),
|
|
@@ -14357,10 +14354,10 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17__default.default.memo
|
|
|
14357
14354
|
const svgHeight = Math.max(el.height, 1);
|
|
14358
14355
|
const ss = shapeEl?.shapeStyle;
|
|
14359
14356
|
const strokeWidth = Math.max(0, ss?.strokeWidth ?? 2);
|
|
14360
|
-
const strokeColor =
|
|
14361
|
-
const strokePaint =
|
|
14362
|
-
const dashType =
|
|
14363
|
-
const dashArray =
|
|
14357
|
+
const strokeColor = chunkZ22RD3E2_js.normalizeHexColor(ss?.strokeColor, chunkZ22RD3E2_js.DEFAULT_STROKE_COLOR);
|
|
14358
|
+
const strokePaint = chunkZ22RD3E2_js.colorWithOpacity(strokeColor, ss?.strokeOpacity);
|
|
14359
|
+
const dashType = chunkZ22RD3E2_js.normalizeStrokeDashType(ss?.strokeDash);
|
|
14360
|
+
const dashArray = chunkZ22RD3E2_js.getSvgStrokeDasharray(
|
|
14364
14361
|
dashType,
|
|
14365
14362
|
Math.max(strokeWidth, 1),
|
|
14366
14363
|
ss?.customDashSegments
|
|
@@ -14371,14 +14368,14 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17__default.default.memo
|
|
|
14371
14368
|
const markerSeed = el.id.replace(/[^a-zA-Z0-9_-]/gu, "_");
|
|
14372
14369
|
const startMarkerId = `${markerSeed}-sel-start`;
|
|
14373
14370
|
const endMarkerId = `${markerSeed}-sel-end`;
|
|
14374
|
-
const compoundOffsets =
|
|
14375
|
-
const compoundWidths =
|
|
14371
|
+
const compoundOffsets = chunkZ22RD3E2_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
14372
|
+
const compoundWidths = chunkZ22RD3E2_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
14376
14373
|
const strokeCap = pptx.svgLineCap(ss?.lineCap);
|
|
14377
14374
|
const textEl = pptx$1.hasTextProperties(el) ? el : void 0;
|
|
14378
14375
|
const connectorText = textEl?.text?.trim() ?? "";
|
|
14379
14376
|
const connectorTextSegments = textEl?.textSegments;
|
|
14380
14377
|
const connectorTextStyle = textEl?.textStyle;
|
|
14381
|
-
const pathGeometry = shapeEl ?
|
|
14378
|
+
const pathGeometry = shapeEl ? chunkZ22RD3E2_js.getConnectorPathGeometry(shapeEl) : {
|
|
14382
14379
|
pathData: `M 0 0 L ${viewWidth} ${viewHeight}`,
|
|
14383
14380
|
startX: 0,
|
|
14384
14381
|
startY: 0,
|
|
@@ -14387,16 +14384,16 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17__default.default.memo
|
|
|
14387
14384
|
};
|
|
14388
14385
|
const hitTargetWidth = Math.max(strokeWidth * 3, 14);
|
|
14389
14386
|
const selColor = selClr === "blue-400" ? "#60a5fa" : "#3b82f6";
|
|
14390
|
-
const lineShadow =
|
|
14391
|
-
const lineGlow =
|
|
14387
|
+
const lineShadow = chunkZ22RD3E2_js.buildLineShadowCss(el);
|
|
14388
|
+
const lineGlow = chunkZ22RD3E2_js.buildLineGlowFilter(el);
|
|
14392
14389
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14393
14390
|
"div",
|
|
14394
14391
|
{
|
|
14395
14392
|
"data-pptx-element": "true",
|
|
14396
14393
|
"data-element-id": el.id,
|
|
14397
|
-
role:
|
|
14398
|
-
"aria-label":
|
|
14399
|
-
"aria-roledescription":
|
|
14394
|
+
role: chunkZ22RD3E2_js.getAriaRole(el, { actionable: false }),
|
|
14395
|
+
"aria-label": chunkZ22RD3E2_js.getAriaLabel(el),
|
|
14396
|
+
"aria-roledescription": chunkZ22RD3E2_js.getAriaRoleDescription(el),
|
|
14400
14397
|
"aria-selected": isSelected ? true : void 0,
|
|
14401
14398
|
className: "absolute",
|
|
14402
14399
|
style: {
|
|
@@ -14429,14 +14426,14 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17__default.default.memo
|
|
|
14429
14426
|
style: { overflow: "visible", pointerEvents: "none" },
|
|
14430
14427
|
children: [
|
|
14431
14428
|
/* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
|
|
14432
|
-
|
|
14429
|
+
chunkZ22RD3E2_js.renderConnectorMarker(
|
|
14433
14430
|
startMarkerId,
|
|
14434
14431
|
startArrow,
|
|
14435
14432
|
strokePaint,
|
|
14436
14433
|
ss?.connectorStartArrowWidth,
|
|
14437
14434
|
ss?.connectorStartArrowLength
|
|
14438
14435
|
),
|
|
14439
|
-
|
|
14436
|
+
chunkZ22RD3E2_js.renderConnectorMarker(
|
|
14440
14437
|
endMarkerId,
|
|
14441
14438
|
endArrow,
|
|
14442
14439
|
strokePaint,
|
|
@@ -14645,14 +14642,14 @@ function getElementInteractionProps({
|
|
|
14645
14642
|
};
|
|
14646
14643
|
}
|
|
14647
14644
|
function renderDagDuotoneFilterForElement(el) {
|
|
14648
|
-
if (!
|
|
14645
|
+
if (!chunkZ22RD3E2_js.hasDagDuotoneEffect(el)) {
|
|
14649
14646
|
return null;
|
|
14650
14647
|
}
|
|
14651
14648
|
const duotone = el.shapeStyle?.dagDuotone;
|
|
14652
14649
|
if (!duotone) {
|
|
14653
14650
|
return null;
|
|
14654
14651
|
}
|
|
14655
|
-
return
|
|
14652
|
+
return chunkZ22RD3E2_js.renderDagDuotoneSvgFilter(el.id, duotone.color1, duotone.color2);
|
|
14656
14653
|
}
|
|
14657
14654
|
function getContainerStyle({
|
|
14658
14655
|
el,
|
|
@@ -14679,10 +14676,10 @@ function getContainerStyle({
|
|
|
14679
14676
|
top: isFullscreenMedia ? fs.top : el.y,
|
|
14680
14677
|
width: isFullscreenMedia ? fs.width : painted.width,
|
|
14681
14678
|
...heightStyle,
|
|
14682
|
-
transform: isFullscreenMedia ? fs.transform :
|
|
14679
|
+
transform: isFullscreenMedia ? fs.transform : chunkZ22RD3E2_js.getElementTransform(el),
|
|
14683
14680
|
transformOrigin: "center",
|
|
14684
14681
|
overflow: overflowValue,
|
|
14685
|
-
clipPath: isPicture ? void 0 : isImg && !has3DExtrusion ?
|
|
14682
|
+
clipPath: isPicture ? void 0 : isImg && !has3DExtrusion ? chunkZ22RD3E2_js.getCropShapeClipPath(el) : void 0,
|
|
14686
14683
|
zIndex: isFullscreenMedia ? fs.zIndex : zIndex,
|
|
14687
14684
|
visibility: animationState?.visible === false ? "hidden" : "visible",
|
|
14688
14685
|
animation: animationState?.cssAnimation,
|
|
@@ -14719,9 +14716,9 @@ function getContainerStyle({
|
|
|
14719
14716
|
function shapeParams(element) {
|
|
14720
14717
|
const style = pptx$1.hasShapeProperties(element) ? element.shapeStyle : void 0;
|
|
14721
14718
|
const strokeWidth = pptx.paintedStrokeWidth(style);
|
|
14722
|
-
const strokeColor =
|
|
14723
|
-
const fillColor =
|
|
14724
|
-
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(
|
|
14719
|
+
const strokeColor = chunkZ22RD3E2_js.normalizeHexColor(style?.strokeColor, chunkZ22RD3E2_js.DEFAULT_STROKE_COLOR);
|
|
14720
|
+
const fillColor = chunkZ22RD3E2_js.normalizeHexColor(style?.fillColor, chunkZ22RD3E2_js.DEFAULT_FILL_COLOR);
|
|
14721
|
+
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(chunkZ22RD3E2_js.buildCssGradientFromShapeStyle(style) || style?.fillGradient) || style?.fillMode === "pattern" && Boolean(style.fillPatternPreset);
|
|
14725
14722
|
return { hf: hasFill, fc: fillColor, sw: strokeWidth, sc: strokeColor };
|
|
14726
14723
|
}
|
|
14727
14724
|
var Extrusion3DOverlayMemo = /* @__PURE__ */ React17__default.default.memo(
|
|
@@ -14829,7 +14826,7 @@ function ShapeEffectOverlay({
|
|
|
14829
14826
|
const fillOverlayStyle = overlay ? {
|
|
14830
14827
|
position: "absolute",
|
|
14831
14828
|
inset: 0,
|
|
14832
|
-
...pptx$1.isImageLikeElement(element) ?
|
|
14829
|
+
...pptx$1.isImageLikeElement(element) ? chunkZ22RD3E2_js.getImageSurfaceMaskStyle(element) : {},
|
|
14833
14830
|
background: overlay.color,
|
|
14834
14831
|
mixBlendMode: overlay.blendMode,
|
|
14835
14832
|
pointerEvents: "none"
|
|
@@ -14913,7 +14910,7 @@ function ShapeEffectOverlay({
|
|
|
14913
14910
|
strokeOutline.strands.map((strand, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
14914
14911
|
"path",
|
|
14915
14912
|
{
|
|
14916
|
-
d: strokeOutline.d,
|
|
14913
|
+
d: strand.d ?? strokeOutline.d,
|
|
14917
14914
|
markerStart: idx === 0 ? strokeOutline.markers?.start : void 0,
|
|
14918
14915
|
markerEnd: idx === 0 ? strokeOutline.markers?.end : void 0,
|
|
14919
14916
|
fill: "none",
|
|
@@ -15036,10 +15033,10 @@ var ElementRenderer = /* @__PURE__ */ React17__default.default.memo(
|
|
|
15036
15033
|
const backgroundAnimationState = pptx.getBackgroundAnimationState(el, presentationElementStates);
|
|
15037
15034
|
const effectPlacement = pptx.getShapeEffectLayerPlacement(el);
|
|
15038
15035
|
const visualAnimationState = backgroundAnimationState ?? animationState;
|
|
15039
|
-
const isTxt =
|
|
15036
|
+
const isTxt = chunkZ22RD3E2_js.isEditableTextElement(el) && allow.textEditable;
|
|
15040
15037
|
const txtSE = pptx$1.hasTextProperties(el) ? el.textStyle : void 0;
|
|
15041
15038
|
const textStyleOverrideCss = pptx.buildTextStyleOverrideCss(el.id, visualAnimationState?.textStyle);
|
|
15042
|
-
const ss =
|
|
15039
|
+
const ss = chunkZ22RD3E2_js.getShapeVisualStyle(
|
|
15043
15040
|
el,
|
|
15044
15041
|
hf,
|
|
15045
15042
|
fc,
|
|
@@ -15048,9 +15045,9 @@ var ElementRenderer = /* @__PURE__ */ React17__default.default.memo(
|
|
|
15048
15045
|
visualAnimationState?.animatesFill,
|
|
15049
15046
|
visualAnimationState?.animatesStroke
|
|
15050
15047
|
);
|
|
15051
|
-
const ts =
|
|
15048
|
+
const ts = chunkZ22RD3E2_js.getTextStyleForElement(el, chunkZ22RD3E2_js.DEFAULT_TEXT_COLOR);
|
|
15052
15049
|
const isImg = el.type === "picture" || el.type === "image";
|
|
15053
|
-
const vs =
|
|
15050
|
+
const vs = chunkZ22RD3E2_js.renderVectorShape(
|
|
15054
15051
|
el,
|
|
15055
15052
|
isImg ? false : hf,
|
|
15056
15053
|
fc,
|
|
@@ -15060,10 +15057,10 @@ var ElementRenderer = /* @__PURE__ */ React17__default.default.memo(
|
|
|
15060
15057
|
visualAnimationState?.animatesStroke
|
|
15061
15058
|
);
|
|
15062
15059
|
const isModel3D = el.type === "model3d";
|
|
15063
|
-
const isConn =
|
|
15060
|
+
const isConn = chunkZ22RD3E2_js.isConnectorOrLineElement(el);
|
|
15064
15061
|
const shapeStyle3d = pptx$1.hasShapeProperties(el) ? el.shapeStyle : void 0;
|
|
15065
15062
|
const extrusionData = React17.useMemo(
|
|
15066
|
-
() =>
|
|
15063
|
+
() => chunkZ22RD3E2_js.build3DExtrusionData(shapeStyle3d?.shape3d, shapeStyle3d?.scene3d, fc, el.width, el.height),
|
|
15067
15064
|
[shapeStyle3d?.shape3d, shapeStyle3d?.scene3d, fc, el.width, el.height]
|
|
15068
15065
|
);
|
|
15069
15066
|
const actionAffordance = useActionAffordance(el, canInteract);
|
|
@@ -15153,7 +15150,7 @@ var ElementRenderer = /* @__PURE__ */ React17__default.default.memo(
|
|
|
15153
15150
|
"aria-hidden": aria.hidden ? true : void 0,
|
|
15154
15151
|
"aria-selected": isSelected ? true : void 0,
|
|
15155
15152
|
tabIndex: isFocusable ? 0 : -1,
|
|
15156
|
-
className:
|
|
15153
|
+
className: chunkZ22RD3E2_js.cn(
|
|
15157
15154
|
"absolute",
|
|
15158
15155
|
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",
|
|
15159
15156
|
cur,
|
|
@@ -15226,9 +15223,9 @@ var ElementRenderer = /* @__PURE__ */ React17__default.default.memo(
|
|
|
15226
15223
|
txtSE,
|
|
15227
15224
|
txtS: ts,
|
|
15228
15225
|
vecShape: backgroundAnimationState && !isImg ? null : vs,
|
|
15229
|
-
imgStyle:
|
|
15230
|
-
imgFilter:
|
|
15231
|
-
imgOpacity:
|
|
15226
|
+
imgStyle: chunkZ22RD3E2_js.getImageRenderStyle(el),
|
|
15227
|
+
imgFilter: chunkZ22RD3E2_js.getImageEffectsFilter(el),
|
|
15228
|
+
imgOpacity: chunkZ22RD3E2_js.getImageEffectsOpacity(el),
|
|
15232
15229
|
imgAlt: imageAltText,
|
|
15233
15230
|
isTxtEl: isTxt,
|
|
15234
15231
|
media: mediaDataUrls,
|
|
@@ -15365,10 +15362,10 @@ function renderStrokeView(view, pressureSensitive, replayStyle, key) {
|
|
|
15365
15362
|
}
|
|
15366
15363
|
function renderInk(el, options) {
|
|
15367
15364
|
const replay = options?.replay ?? false;
|
|
15368
|
-
const strokes =
|
|
15365
|
+
const strokes = chunkZ22RD3E2_js.buildInkGroupStrokes(el, { color: "#000", width: 3 });
|
|
15369
15366
|
strokes.some((s) => s.circles || s.nibMarks);
|
|
15370
15367
|
const pressureSensitive = options?.pressureSensitive;
|
|
15371
|
-
const replayStyles = replay ?
|
|
15368
|
+
const replayStyles = replay ? chunkZ22RD3E2_js.getInkReplayStyles(el, options?.replayConfig) : null;
|
|
15372
15369
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15373
15370
|
"svg",
|
|
15374
15371
|
{
|
|
@@ -15376,7 +15373,7 @@ function renderInk(el, options) {
|
|
|
15376
15373
|
viewBox: `0 0 ${Math.max(el.width, 1)} ${Math.max(el.height, 1)}`,
|
|
15377
15374
|
preserveAspectRatio: "none",
|
|
15378
15375
|
children: [
|
|
15379
|
-
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children:
|
|
15376
|
+
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children: chunkZ22RD3E2_js.INK_REPLAY_KEYFRAMES }),
|
|
15380
15377
|
strokes.map(
|
|
15381
15378
|
(s, i) => renderStrokeView(s, pressureSensitive, replayStyles?.[i], `${el.id}-ink-${i}`)
|
|
15382
15379
|
)
|
|
@@ -15387,7 +15384,7 @@ function renderInk(el, options) {
|
|
|
15387
15384
|
function renderGroup(children, parentGroupFill) {
|
|
15388
15385
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full h-full pointer-events-none", children: pptx.filterRenderedElements(children).map((c, childIndex) => {
|
|
15389
15386
|
const { hf, fc, sw, sc } = shapeParams(c);
|
|
15390
|
-
const baseSs =
|
|
15387
|
+
const baseSs = chunkZ22RD3E2_js.getShapeVisualStyle(c, hf, fc, sw, sc);
|
|
15391
15388
|
const inheritedFill = pptx.resolveGroupChildFill(c, parentGroupFill);
|
|
15392
15389
|
const ss = inheritedFill ? {
|
|
15393
15390
|
...baseSs,
|
|
@@ -15398,9 +15395,9 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15398
15395
|
backgroundPosition: inheritedFill.backgroundPosition
|
|
15399
15396
|
} : baseSs;
|
|
15400
15397
|
const isI = c.type === "picture" || c.type === "image";
|
|
15401
|
-
const vs =
|
|
15402
|
-
const ts =
|
|
15403
|
-
const isTxt =
|
|
15398
|
+
const vs = chunkZ22RD3E2_js.renderVectorShape(c, isI ? false : hf, fc, sw, sc);
|
|
15399
|
+
const ts = chunkZ22RD3E2_js.getTextStyleForElement(c, chunkZ22RD3E2_js.DEFAULT_TEXT_COLOR);
|
|
15400
|
+
const isTxt = chunkZ22RD3E2_js.isEditableTextElement(c);
|
|
15404
15401
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15405
15402
|
"div",
|
|
15406
15403
|
{
|
|
@@ -15409,9 +15406,9 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15409
15406
|
style: {
|
|
15410
15407
|
left: c.x,
|
|
15411
15408
|
top: c.y,
|
|
15412
|
-
width: Math.max(c.width,
|
|
15413
|
-
height: Math.max(c.height,
|
|
15414
|
-
transform:
|
|
15409
|
+
width: Math.max(c.width, chunkZ22RD3E2_js.MIN_ELEMENT_SIZE),
|
|
15410
|
+
height: Math.max(c.height, chunkZ22RD3E2_js.MIN_ELEMENT_SIZE),
|
|
15411
|
+
transform: chunkZ22RD3E2_js.getElementTransform(c),
|
|
15415
15412
|
transformOrigin: "center",
|
|
15416
15413
|
...ss,
|
|
15417
15414
|
...isI ? {
|
|
@@ -15436,8 +15433,8 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15436
15433
|
// A nested group: recurse, chaining the inherited fill so a
|
|
15437
15434
|
// `grpFill` shape under a fill-less sub-group still paints.
|
|
15438
15435
|
renderGroup(c.children, pptx.getGroupChildParentFill(c, parentGroupFill))
|
|
15439
|
-
) : isI && ("svgData" in c && c.svgData || "imageData" in c && c.imageData) ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style:
|
|
15440
|
-
|
|
15436
|
+
) : isI && ("svgData" in c && c.svgData || "imageData" in c && c.imageData) ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style: chunkZ22RD3E2_js.getImageSurfaceStyle(c), children: [
|
|
15437
|
+
chunkZ22RD3E2_js.isImageTiled(c) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
15441
15438
|
TiledImageLayer,
|
|
15442
15439
|
{
|
|
15443
15440
|
element: c,
|
|
@@ -15450,7 +15447,7 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15450
15447
|
src: "svgData" in c && c.svgData ? c.svgData : c.imageData,
|
|
15451
15448
|
alt: i18n.translationsEn["pptx.ink.groupChildAlt"],
|
|
15452
15449
|
className: "pointer-events-none select-none",
|
|
15453
|
-
style:
|
|
15450
|
+
style: chunkZ22RD3E2_js.getImageRenderStyle(c),
|
|
15454
15451
|
draggable: false
|
|
15455
15452
|
}
|
|
15456
15453
|
),
|
|
@@ -15462,7 +15459,7 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15462
15459
|
{
|
|
15463
15460
|
className: "relative z-10 w-full h-full pointer-events-none whitespace-pre-wrap break-words leading-[1.3]",
|
|
15464
15461
|
style: ts,
|
|
15465
|
-
children:
|
|
15462
|
+
children: chunkZ22RD3E2_js.renderTextSegments(c, chunkZ22RD3E2_js.DEFAULT_TEXT_COLOR)
|
|
15466
15463
|
}
|
|
15467
15464
|
) : null
|
|
15468
15465
|
] })
|
|
@@ -15476,8 +15473,8 @@ function renderContentPart(el, options) {
|
|
|
15476
15473
|
if (el.inkStrokes && el.inkStrokes.length > 0) {
|
|
15477
15474
|
const replay = options?.replay ?? false;
|
|
15478
15475
|
const pressureSensitive = options?.pressureSensitive ?? true;
|
|
15479
|
-
const strokes =
|
|
15480
|
-
const replayStyles = replay ?
|
|
15476
|
+
const strokes = chunkZ22RD3E2_js.buildContentPartStrokes(el);
|
|
15477
|
+
const replayStyles = replay ? chunkZ22RD3E2_js.getContentPartReplayStyles(el.inkStrokes, options?.replayConfig) : null;
|
|
15481
15478
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15482
15479
|
"svg",
|
|
15483
15480
|
{
|
|
@@ -15485,7 +15482,7 @@ function renderContentPart(el, options) {
|
|
|
15485
15482
|
viewBox: `0 0 ${Math.max(el.width, 1)} ${Math.max(el.height, 1)}`,
|
|
15486
15483
|
preserveAspectRatio: "none",
|
|
15487
15484
|
children: [
|
|
15488
|
-
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children:
|
|
15485
|
+
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children: chunkZ22RD3E2_js.INK_REPLAY_KEYFRAMES }),
|
|
15489
15486
|
strokes.map(
|
|
15490
15487
|
(s, i) => renderStrokeView(s, pressureSensitive, replayStyles?.[i], `${el.id}-cp-ink-${i}`)
|
|
15491
15488
|
)
|
|
@@ -15712,9 +15709,9 @@ function useInlineListEditor(element, rootRef, onChange, onModelReplacement) {
|
|
|
15712
15709
|
collaboration: connected,
|
|
15713
15710
|
model: pptx.createInlineListModelObserver(element),
|
|
15714
15711
|
activationSelection,
|
|
15715
|
-
children: seed && !connected ?
|
|
15712
|
+
children: seed && !connected ? chunkZ22RD3E2_js.renderTextSegments(
|
|
15716
15713
|
element,
|
|
15717
|
-
|
|
15714
|
+
chunkZ22RD3E2_js.DEFAULT_TEXT_COLOR,
|
|
15718
15715
|
void 0,
|
|
15719
15716
|
void 0,
|
|
15720
15717
|
void 0,
|
|
@@ -15950,8 +15947,8 @@ function InlineTextEditor({
|
|
|
15950
15947
|
pending.endOffset
|
|
15951
15948
|
);
|
|
15952
15949
|
});
|
|
15953
|
-
const warpStyle =
|
|
15954
|
-
const compensationTransform =
|
|
15950
|
+
const warpStyle = chunkZ22RD3E2_js.getTextWarpStyle(textStyleRaw);
|
|
15951
|
+
const compensationTransform = chunkZ22RD3E2_js.getTextCompensationTransform(element);
|
|
15955
15952
|
const warpTransform = warpStyle?.transform;
|
|
15956
15953
|
const mergedTransform = [compensationTransform, warpTransform].filter(Boolean).join(" ") || void 0;
|
|
15957
15954
|
const wrapperStyle = {
|
|
@@ -16039,7 +16036,7 @@ function InlineTextEditor({
|
|
|
16039
16036
|
const text = e.clipboardData.getData("text/plain");
|
|
16040
16037
|
document.execCommand("insertText", false, text);
|
|
16041
16038
|
},
|
|
16042
|
-
children: list.seed ? list.children : seed.hasRichSegments ?
|
|
16039
|
+
children: list.seed ? list.children : seed.hasRichSegments ? chunkZ22RD3E2_js.renderTextSegments(element, chunkZ22RD3E2_js.DEFAULT_TEXT_COLOR) : seed.initialText
|
|
16043
16040
|
},
|
|
16044
16041
|
list.seed?.paragraphs[0].token ?? "plain"
|
|
16045
16042
|
);
|
|
@@ -16204,7 +16201,7 @@ function OleActionFooter({
|
|
|
16204
16201
|
info,
|
|
16205
16202
|
showActions
|
|
16206
16203
|
}) {
|
|
16207
|
-
const { t } =
|
|
16204
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
16208
16205
|
if (!showActions || !info.canDownload || !el.oleEmbeddedData) {
|
|
16209
16206
|
return null;
|
|
16210
16207
|
}
|
|
@@ -16313,7 +16310,7 @@ function SmartArtInlineNodeEditor({
|
|
|
16313
16310
|
onCommit,
|
|
16314
16311
|
onCancel
|
|
16315
16312
|
}) {
|
|
16316
|
-
const { t } =
|
|
16313
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
16317
16314
|
const ref = React17__default.default.useRef(null);
|
|
16318
16315
|
const [value, setValue] = React17__default.default.useState(initialText);
|
|
16319
16316
|
const settled = React17__default.default.useRef(false);
|
|
@@ -16940,7 +16937,7 @@ function SmartArtRendererImpl({
|
|
|
16940
16937
|
onUpdateElement,
|
|
16941
16938
|
animationState
|
|
16942
16939
|
}) {
|
|
16943
|
-
const { t } =
|
|
16940
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
16944
16941
|
if (element.type !== "smartArt" || !element.smartArtData) {
|
|
16945
16942
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16946
16943
|
"div",
|
|
@@ -17186,7 +17183,7 @@ function groupIntoParagraphs(element, fieldContext) {
|
|
|
17186
17183
|
element,
|
|
17187
17184
|
fieldContext ? (seg) => {
|
|
17188
17185
|
if (seg.fieldType) {
|
|
17189
|
-
const substituted =
|
|
17186
|
+
const substituted = chunkZ22RD3E2_js.substituteFieldText(
|
|
17190
17187
|
seg.text,
|
|
17191
17188
|
seg.fieldType,
|
|
17192
17189
|
fieldContext,
|
|
@@ -17221,13 +17218,13 @@ function getSegmentTspanProps(segment, element, fallbackColor) {
|
|
|
17221
17218
|
if (s.strikethrough) {
|
|
17222
17219
|
decos.push("line-through");
|
|
17223
17220
|
}
|
|
17224
|
-
const fill = s.hyperlink ?
|
|
17221
|
+
const fill = s.hyperlink ? chunkZ22RD3E2_js.normalizeHexColor(s.color || element.textStyle?.color, chunkZ22RD3E2_js.HYPERLINK_COLOR) : chunkZ22RD3E2_js.normalizeHexColor(s.color || element.textStyle?.color, fallbackColor);
|
|
17225
17222
|
return {
|
|
17226
17223
|
fill,
|
|
17227
|
-
fontSize: s.fontSize ?? element.textStyle?.fontSize ??
|
|
17224
|
+
fontSize: s.fontSize ?? element.textStyle?.fontSize ?? chunkZ22RD3E2_js.DEFAULT_TEXT_FONT_SIZE,
|
|
17228
17225
|
fontWeight: pptx.resolveFontWeight(s.fontFamily || element.textStyle?.fontFamily, s.bold),
|
|
17229
17226
|
fontStyle: pptx.resolveFontItalic(s.fontFamily || element.textStyle?.fontFamily, s.italic) ? "italic" : void 0,
|
|
17230
|
-
fontFamily: s.fontFamily || element.textStyle?.fontFamily ? pptx$1.getSubstituteFontFamily(s.fontFamily || element.textStyle?.fontFamily || "") :
|
|
17227
|
+
fontFamily: s.fontFamily || element.textStyle?.fontFamily ? pptx$1.getSubstituteFontFamily(s.fontFamily || element.textStyle?.fontFamily || "") : chunkZ22RD3E2_js.DEFAULT_FONT_FAMILY,
|
|
17231
17228
|
textDecoration: decos.length > 0 ? decos.join(" ") : void 0
|
|
17232
17229
|
};
|
|
17233
17230
|
}
|
|
@@ -17235,8 +17232,8 @@ function resolveSegmentFont(segment, element) {
|
|
|
17235
17232
|
const s = segment.style || {};
|
|
17236
17233
|
const family = s.fontFamily || element.textStyle?.fontFamily;
|
|
17237
17234
|
return {
|
|
17238
|
-
fontFamily: family ? pptx$1.getSubstituteFontFamily(family) :
|
|
17239
|
-
fontSizePx: s.fontSize ?? element.textStyle?.fontSize ??
|
|
17235
|
+
fontFamily: family ? pptx$1.getSubstituteFontFamily(family) : chunkZ22RD3E2_js.DEFAULT_FONT_FAMILY,
|
|
17236
|
+
fontSizePx: s.fontSize ?? element.textStyle?.fontSize ?? chunkZ22RD3E2_js.DEFAULT_TEXT_FONT_SIZE,
|
|
17240
17237
|
bold: s.bold ?? element.textStyle?.bold,
|
|
17241
17238
|
italic: s.italic ?? element.textStyle?.italic
|
|
17242
17239
|
};
|
|
@@ -17320,9 +17317,9 @@ function WarpedText({
|
|
|
17320
17317
|
const warpAdj2 = textEl.textStyle?.textWarpAdj2;
|
|
17321
17318
|
const align = textEl.textStyle?.align ?? "center";
|
|
17322
17319
|
const { startOffset, textAnchor } = getAlignmentProps(align);
|
|
17323
|
-
const baseFontSize = textEl.textStyle?.fontSize ??
|
|
17324
|
-
const baseFontFamily = textEl.textStyle?.fontFamily ? pptx$1.getSubstituteFontFamily(textEl.textStyle.fontFamily) :
|
|
17325
|
-
const baseFill =
|
|
17320
|
+
const baseFontSize = textEl.textStyle?.fontSize ?? chunkZ22RD3E2_js.DEFAULT_TEXT_FONT_SIZE;
|
|
17321
|
+
const baseFontFamily = textEl.textStyle?.fontFamily ? pptx$1.getSubstituteFontFamily(textEl.textStyle.fontFamily) : chunkZ22RD3E2_js.DEFAULT_FONT_FAMILY;
|
|
17322
|
+
const baseFill = chunkZ22RD3E2_js.normalizeHexColor(textEl.textStyle?.color, fallbackColor);
|
|
17326
17323
|
if (pptx.hasGlyphEnvelope(preset)) {
|
|
17327
17324
|
const perLine = pptx.buildGlyphEnvelopeBlock(
|
|
17328
17325
|
preset,
|
|
@@ -17424,7 +17421,7 @@ function WarpedText({
|
|
|
17424
17421
|
var GLYPH_BY_SHAPE = /* @__PURE__ */ buildGlyphByShape();
|
|
17425
17422
|
function buildGlyphByShape() {
|
|
17426
17423
|
const glyphs = Object.fromEntries(
|
|
17427
|
-
|
|
17424
|
+
chunkZ22RD3E2_js.ACTION_BUTTON_PRESETS.map((p) => [p.shapeType, p.iconPath])
|
|
17428
17425
|
);
|
|
17429
17426
|
glyphs["actionButtonForwardOrNext"] = glyphs["actionButtonForwardNext"];
|
|
17430
17427
|
glyphs["actionButtonBackOrPrevious"] = glyphs["actionButtonBackPrevious"];
|
|
@@ -17498,9 +17495,9 @@ function renderTextElementBody(options) {
|
|
|
17498
17495
|
const useSvgWarp = pptx.shouldUseSvgWarp(
|
|
17499
17496
|
pptx$1.hasTextProperties(el) ? el.textStyle?.textWarpPreset : void 0
|
|
17500
17497
|
);
|
|
17501
|
-
const scene3dStyle = pptx$1.hasTextProperties(el) ?
|
|
17498
|
+
const scene3dStyle = pptx$1.hasTextProperties(el) ? chunkZ22RD3E2_js.buildTextBody3DSceneStyle(el.textStyle, { width: el.width, height: el.height }) : void 0;
|
|
17502
17499
|
const rotationTransform = pptx.getTextBodyRotationTransform(el);
|
|
17503
|
-
const composedTransform = [rotationTransform,
|
|
17500
|
+
const composedTransform = [rotationTransform, chunkZ22RD3E2_js.getTextCompensationTransform(el), scene3dStyle?.transform].filter(Boolean).join(" ") || void 0;
|
|
17504
17501
|
const transformStyle = {
|
|
17505
17502
|
transform: composedTransform,
|
|
17506
17503
|
// A COM-measured homography (`scene3dStyle.transformOrigin === '0 0'`)
|
|
@@ -17530,18 +17527,18 @@ function renderTextElementBody(options) {
|
|
|
17530
17527
|
shouldRenderText && (useSvgWarp ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
17531
17528
|
"div",
|
|
17532
17529
|
{
|
|
17533
|
-
className:
|
|
17530
|
+
className: chunkZ22RD3E2_js.cn(
|
|
17534
17531
|
"relative z-10 w-full h-full",
|
|
17535
17532
|
onHyperlinkClick ? "" : "pointer-events-none"
|
|
17536
17533
|
),
|
|
17537
|
-
style: { ...
|
|
17534
|
+
style: { ...chunkZ22RD3E2_js.getTextLayoutStyle(el), ...transformStyle },
|
|
17538
17535
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17539
17536
|
WarpedText,
|
|
17540
17537
|
{
|
|
17541
17538
|
element: el,
|
|
17542
17539
|
width: el.width,
|
|
17543
17540
|
height: el.height,
|
|
17544
|
-
fallbackColor:
|
|
17541
|
+
fallbackColor: chunkZ22RD3E2_js.DEFAULT_TEXT_COLOR,
|
|
17545
17542
|
findHighlights: findHl,
|
|
17546
17543
|
fieldContext
|
|
17547
17544
|
}
|
|
@@ -17550,19 +17547,19 @@ function renderTextElementBody(options) {
|
|
|
17550
17547
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
17551
17548
|
"div",
|
|
17552
17549
|
{
|
|
17553
|
-
className:
|
|
17550
|
+
className: chunkZ22RD3E2_js.cn(
|
|
17554
17551
|
"relative z-10 w-full h-full whitespace-pre-wrap break-words leading-[1.3]",
|
|
17555
17552
|
onHyperlinkClick ? "" : "pointer-events-none"
|
|
17556
17553
|
),
|
|
17557
17554
|
style: {
|
|
17558
|
-
...
|
|
17555
|
+
...chunkZ22RD3E2_js.getTextLayoutStyle(el),
|
|
17559
17556
|
...txtS,
|
|
17560
|
-
...
|
|
17557
|
+
...chunkZ22RD3E2_js.getTextWarpStyle(txtSE),
|
|
17561
17558
|
...transformStyle
|
|
17562
17559
|
},
|
|
17563
|
-
children:
|
|
17560
|
+
children: chunkZ22RD3E2_js.renderTextSegments(
|
|
17564
17561
|
el,
|
|
17565
|
-
|
|
17562
|
+
chunkZ22RD3E2_js.DEFAULT_TEXT_COLOR,
|
|
17566
17563
|
void 0,
|
|
17567
17564
|
findHl,
|
|
17568
17565
|
onHyperlinkClick,
|
|
@@ -17583,7 +17580,7 @@ function ZoomElementRenderer({
|
|
|
17583
17580
|
onZoomClick,
|
|
17584
17581
|
sourceSlideIndex
|
|
17585
17582
|
}) {
|
|
17586
|
-
const { t } =
|
|
17583
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
17587
17584
|
const summaryView = pptx.buildSummaryZoomView(
|
|
17588
17585
|
element,
|
|
17589
17586
|
(index) => {
|
|
@@ -17881,7 +17878,7 @@ function renderBody(options) {
|
|
|
17881
17878
|
);
|
|
17882
17879
|
}
|
|
17883
17880
|
if (isImg) {
|
|
17884
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style:
|
|
17881
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style: chunkZ22RD3E2_js.getImageSurfaceStyle(el), children: [
|
|
17885
17882
|
renderImg(el, imgStyle, imgFilter, imgAlt, imgOpacity),
|
|
17886
17883
|
vecShape ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none absolute inset-0", children: vecShape }) : null
|
|
17887
17884
|
] });
|
|
@@ -17898,7 +17895,7 @@ function renderBody(options) {
|
|
|
17898
17895
|
textDirection: txtSE?.textDirection,
|
|
17899
17896
|
textStyle: txtS,
|
|
17900
17897
|
textStyleRaw: txtSE,
|
|
17901
|
-
layoutStyle:
|
|
17898
|
+
layoutStyle: chunkZ22RD3E2_js.getTextLayoutStyle(el),
|
|
17902
17899
|
element: el,
|
|
17903
17900
|
onCommit,
|
|
17904
17901
|
onCancel,
|
|
@@ -17909,7 +17906,7 @@ function renderBody(options) {
|
|
|
17909
17906
|
] });
|
|
17910
17907
|
}
|
|
17911
17908
|
if (el.type === "table") {
|
|
17912
|
-
return
|
|
17909
|
+
return chunkZ22RD3E2_js.renderTableElement(el, txtS, {
|
|
17913
17910
|
editable: isSel,
|
|
17914
17911
|
selectedCell: isSel ? tableSt : null,
|
|
17915
17912
|
onSelectCell: onCellSel,
|
|
@@ -17942,7 +17939,7 @@ function renderBody(options) {
|
|
|
17942
17939
|
);
|
|
17943
17940
|
}
|
|
17944
17941
|
if (el.type === "media") {
|
|
17945
|
-
return
|
|
17942
|
+
return chunkZ22RD3E2_js.renderMediaElement(el, media, {
|
|
17946
17943
|
// Present mode autoplays every media element on the active slide,
|
|
17947
17944
|
// not only ones persisted with their own `autoPlay` flag (matching
|
|
17948
17945
|
// the other four bindings' unconditional `presenting`-gated
|
|
@@ -17994,27 +17991,27 @@ function renderBody(options) {
|
|
|
17994
17991
|
}
|
|
17995
17992
|
return renderGroup(el.children, pptx.getGroupChildParentFill(el));
|
|
17996
17993
|
}
|
|
17997
|
-
if (
|
|
17998
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
17994
|
+
if (chunkZ22RD3E2_js.shouldRenderFallbackLabel(el, isTxtEl)) {
|
|
17995
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkZ22RD3E2_js.getElementLabel(el) });
|
|
17999
17996
|
}
|
|
18000
17997
|
return renderTextElementBody(options);
|
|
18001
17998
|
}
|
|
18002
17999
|
function defaultTextColorForFill(fillColor) {
|
|
18003
18000
|
const hex = String(fillColor ?? "").replace(/^#/u, "");
|
|
18004
18001
|
if (!/^[0-9a-f]{6}$/iu.test(hex)) {
|
|
18005
|
-
return
|
|
18002
|
+
return chunkZ22RD3E2_js.DEFAULT_TEXT_COLOR;
|
|
18006
18003
|
}
|
|
18007
18004
|
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);
|
|
18008
18005
|
const luminance = channels[0] * 0.2126 + channels[1] * 0.7152 + channels[2] * 0.0722;
|
|
18009
|
-
return luminance > 0.179 ?
|
|
18006
|
+
return luminance > 0.179 ? chunkZ22RD3E2_js.DEFAULT_TEXT_COLOR : "#ffffff";
|
|
18010
18007
|
}
|
|
18011
18008
|
function getStaticElementVisualState(element, parentGroupFill) {
|
|
18012
18009
|
const style = pptx$1.hasShapeProperties(element) ? element.shapeStyle : void 0;
|
|
18013
|
-
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(
|
|
18014
|
-
const fill =
|
|
18010
|
+
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(chunkZ22RD3E2_js.buildCssGradientFromShapeStyle(style) || style?.fillGradient) || style?.fillMode === "pattern" && Boolean(style.fillPatternPreset);
|
|
18011
|
+
const fill = chunkZ22RD3E2_js.normalizeHexColor(style?.fillColor, chunkZ22RD3E2_js.DEFAULT_FILL_COLOR);
|
|
18015
18012
|
const strokeWidth = pptx.paintedStrokeWidth(style);
|
|
18016
|
-
const stroke =
|
|
18017
|
-
const baseVisualStyle =
|
|
18013
|
+
const stroke = chunkZ22RD3E2_js.normalizeHexColor(style?.strokeColor, chunkZ22RD3E2_js.DEFAULT_STROKE_COLOR);
|
|
18014
|
+
const baseVisualStyle = chunkZ22RD3E2_js.getShapeVisualStyle(element, hasFill, fill, strokeWidth, stroke);
|
|
18018
18015
|
const inheritedFill = pptx.resolveGroupChildFill(element, parentGroupFill);
|
|
18019
18016
|
const visualStyle = inheritedFill ? {
|
|
18020
18017
|
...baseVisualStyle,
|
|
@@ -18024,9 +18021,9 @@ function getStaticElementVisualState(element, parentGroupFill) {
|
|
|
18024
18021
|
backgroundSize: inheritedFill.backgroundSize,
|
|
18025
18022
|
backgroundPosition: inheritedFill.backgroundPosition
|
|
18026
18023
|
} : baseVisualStyle;
|
|
18027
|
-
const textStyle =
|
|
18024
|
+
const textStyle = chunkZ22RD3E2_js.getTextStyleForElement(
|
|
18028
18025
|
element,
|
|
18029
|
-
element.type === "shape" && hasFill ? defaultTextColorForFill(fill) :
|
|
18026
|
+
element.type === "shape" && hasFill ? defaultTextColorForFill(fill) : chunkZ22RD3E2_js.DEFAULT_TEXT_COLOR
|
|
18030
18027
|
);
|
|
18031
18028
|
const isImage = element.type === "picture" || element.type === "image";
|
|
18032
18029
|
const letsTextOverflow = pptx$1.hasTextProperties(element) && element.textStyle?.autoFitMode === "shrink" && (element.type === "text" || element.locks?.txBox === true);
|
|
@@ -18051,7 +18048,7 @@ function getStaticElementInteractionState(element, hasActionHandler, exposeEleme
|
|
|
18051
18048
|
return { action, isActionable, contractRole };
|
|
18052
18049
|
}
|
|
18053
18050
|
function getStaticElementWrapperClassName(element, visual, positioned, isActionable) {
|
|
18054
|
-
const overflowClass = visual.isImage || visual.strokeWidth > 0 || element.type === "group" ||
|
|
18051
|
+
const overflowClass = visual.isImage || visual.strokeWidth > 0 || element.type === "group" || chunkZ22RD3E2_js.isConnectorOrLineElement(element) || visual.isCallout || visual.letsTextOverflow ? "" : "overflow-hidden";
|
|
18055
18052
|
const pointerClass = isActionable ? "pointer-events-auto cursor-pointer" : "pointer-events-none";
|
|
18056
18053
|
return `${positioned ? "absolute" : "relative"} ${overflowClass} ${pointerClass}`;
|
|
18057
18054
|
}
|
|
@@ -18134,7 +18131,7 @@ function StaticElementRendererImpl({
|
|
|
18134
18131
|
top: positioned ? element.y : void 0,
|
|
18135
18132
|
width: positioned ? Math.max(element.width, 1) : "100%",
|
|
18136
18133
|
height: positioned ? Math.max(element.height, 1) : "100%",
|
|
18137
|
-
transform: positioned ?
|
|
18134
|
+
transform: positioned ? chunkZ22RD3E2_js.getElementTransform(element) : void 0,
|
|
18138
18135
|
transformOrigin: "center",
|
|
18139
18136
|
zIndex,
|
|
18140
18137
|
...visualStyle,
|
|
@@ -18177,18 +18174,18 @@ function StaticElementRendererImpl({
|
|
|
18177
18174
|
spellCheck: false,
|
|
18178
18175
|
txtSE: pptx$1.hasTextProperties(element) ? element.textStyle : void 0,
|
|
18179
18176
|
txtS: textStyle,
|
|
18180
|
-
vecShape:
|
|
18177
|
+
vecShape: chunkZ22RD3E2_js.renderVectorShape(
|
|
18181
18178
|
element,
|
|
18182
18179
|
isImage ? false : hasFill,
|
|
18183
18180
|
fill,
|
|
18184
18181
|
strokeWidth,
|
|
18185
18182
|
stroke
|
|
18186
18183
|
),
|
|
18187
|
-
imgStyle: imageAnimation ? { ...
|
|
18188
|
-
imgFilter:
|
|
18189
|
-
imgOpacity:
|
|
18184
|
+
imgStyle: imageAnimation ? { ...chunkZ22RD3E2_js.getImageRenderStyle(element), animation: imageAnimation } : chunkZ22RD3E2_js.getImageRenderStyle(element),
|
|
18185
|
+
imgFilter: chunkZ22RD3E2_js.getImageEffectsFilter(element),
|
|
18186
|
+
imgOpacity: chunkZ22RD3E2_js.getImageEffectsOpacity(element),
|
|
18190
18187
|
imgAlt: "",
|
|
18191
|
-
isTxtEl:
|
|
18188
|
+
isTxtEl: chunkZ22RD3E2_js.isEditableTextElement(element),
|
|
18192
18189
|
media: mediaDataUrls,
|
|
18193
18190
|
tableSt: null,
|
|
18194
18191
|
isSel: false,
|
|
@@ -18236,7 +18233,7 @@ function SlideLayer({
|
|
|
18236
18233
|
style: {
|
|
18237
18234
|
width: safeWidth,
|
|
18238
18235
|
height: safeHeight,
|
|
18239
|
-
backgroundColor: slide.backgroundColor ?
|
|
18236
|
+
backgroundColor: slide.backgroundColor ? chunkZ22RD3E2_js.normalizeHexColor(slide.backgroundColor, "#ffffff") : "#ffffff",
|
|
18240
18237
|
backgroundImage: slide.backgroundImage ? `url(${slide.backgroundImage})` : slide.backgroundGradient ? slide.backgroundGradient : void 0,
|
|
18241
18238
|
backgroundSize: slide.backgroundImage ? "cover" : void 0,
|
|
18242
18239
|
backgroundPosition: slide.backgroundImage ? "center" : void 0
|