pptx-angular-viewer 1.3.0 → 1.3.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
CHANGED
|
@@ -4,6 +4,8 @@ All notable changes to this project are documented here.
|
|
|
4
4
|
This file is generated from [Conventional Commits](https://www.conventionalcommits.org)
|
|
5
5
|
by [git-cliff](https://git-cliff.org); do not edit it by hand.
|
|
6
6
|
|
|
7
|
+
## [1.3.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-angular-viewer@1.3.0) - 2026-07-04
|
|
8
|
+
|
|
7
9
|
## [1.2.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-angular-viewer@1.2.0) - 2026-07-04
|
|
8
10
|
|
|
9
11
|
## [1.1.66](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-angular-viewer@1.1.66) - 2026-07-04
|
|
@@ -22029,6 +22029,35 @@ function hasCopyableFormat(element) {
|
|
|
22029
22029
|
return hasShapeProperties(element) || hasTextProperties(element);
|
|
22030
22030
|
}
|
|
22031
22031
|
|
|
22032
|
+
/**
|
|
22033
|
+
* Copy segment-level metadata (equation, field) from an original segment onto
|
|
22034
|
+
* its remapped counterpart. Without this, entering and leaving inline text
|
|
22035
|
+
* editing destroys the data these fields carry even when nothing was typed:
|
|
22036
|
+
* an equation collapses to its literal "[Equation]" placeholder text and a
|
|
22037
|
+
* slide-number/date field degrades to frozen plain text. Hyperlink and other
|
|
22038
|
+
* style-level properties already survive via the copied `style` object.
|
|
22039
|
+
*/
|
|
22040
|
+
function copySegmentMetadata(from, to) {
|
|
22041
|
+
if (from.equationXml !== undefined) {
|
|
22042
|
+
to.equationXml = from.equationXml;
|
|
22043
|
+
}
|
|
22044
|
+
if (from.equationNumber !== undefined) {
|
|
22045
|
+
to.equationNumber = from.equationNumber;
|
|
22046
|
+
}
|
|
22047
|
+
if (from.fieldType !== undefined) {
|
|
22048
|
+
to.fieldType = from.fieldType;
|
|
22049
|
+
}
|
|
22050
|
+
if (from.fieldGuid !== undefined) {
|
|
22051
|
+
to.fieldGuid = from.fieldGuid;
|
|
22052
|
+
}
|
|
22053
|
+
if (from.fieldGuidAttr !== undefined) {
|
|
22054
|
+
to.fieldGuidAttr = from.fieldGuidAttr;
|
|
22055
|
+
}
|
|
22056
|
+
if (from.fieldParagraphPropertiesXml !== undefined) {
|
|
22057
|
+
to.fieldParagraphPropertiesXml = from.fieldParagraphPropertiesXml;
|
|
22058
|
+
}
|
|
22059
|
+
return to;
|
|
22060
|
+
}
|
|
22032
22061
|
/**
|
|
22033
22062
|
* Strategy:
|
|
22034
22063
|
* 1. Split both original segments and new text into paragraphs by "\n".
|
|
@@ -22074,7 +22103,10 @@ function remapTextToSegments(newText, originalSegments, elementTextStyle) {
|
|
|
22074
22103
|
const totalOrigLen = paraOrigSegments.reduce((sum, s) => sum + s.text.length, 0);
|
|
22075
22104
|
if (totalOrigLen === 0) {
|
|
22076
22105
|
const result = [
|
|
22077
|
-
|
|
22106
|
+
copySegmentMetadata(paraOrigSegments[0], {
|
|
22107
|
+
text: paraNewText,
|
|
22108
|
+
style: { ...paraOrigSegments[0].style },
|
|
22109
|
+
}),
|
|
22078
22110
|
];
|
|
22079
22111
|
if (paragraphBulletInfo) {
|
|
22080
22112
|
result[0].bulletInfo = paragraphBulletInfo;
|
|
@@ -22098,10 +22130,10 @@ function remapTextToSegments(newText, originalSegments, elementTextStyle) {
|
|
|
22098
22130
|
segText = paraNewText.slice(newPos, newPos + origLen);
|
|
22099
22131
|
}
|
|
22100
22132
|
if (segText.length > 0) {
|
|
22101
|
-
const outSeg = {
|
|
22133
|
+
const outSeg = copySegmentMetadata(origSeg, {
|
|
22102
22134
|
text: segText,
|
|
22103
22135
|
style: { ...origSeg.style },
|
|
22104
|
-
};
|
|
22136
|
+
});
|
|
22105
22137
|
if (remapped.length === 0 && paragraphBulletInfo) {
|
|
22106
22138
|
outSeg.bulletInfo = paragraphBulletInfo;
|
|
22107
22139
|
}
|
|
@@ -22110,10 +22142,10 @@ function remapTextToSegments(newText, originalSegments, elementTextStyle) {
|
|
|
22110
22142
|
newPos += isLastSeg ? segText.length : origLen;
|
|
22111
22143
|
}
|
|
22112
22144
|
if (remapped.length === 0) {
|
|
22113
|
-
const fallback = {
|
|
22145
|
+
const fallback = copySegmentMetadata(paraOrigSegments[0], {
|
|
22114
22146
|
text: paraNewText,
|
|
22115
22147
|
style: { ...paraOrigSegments[0].style },
|
|
22116
|
-
};
|
|
22148
|
+
});
|
|
22117
22149
|
if (paragraphBulletInfo) {
|
|
22118
22150
|
fallback.bulletInfo = paragraphBulletInfo;
|
|
22119
22151
|
}
|