@nativescript-community/ui-label 1.2.10 → 1.2.11
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 +8 -0
- package/label.ios.js +14 -10
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,14 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [1.2.11](https://github.com/nativescript-community/ui-label/compare/v1.2.10...v1.2.11) (2022-09-09)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @nativescript-community/ui-label
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
6
14
|
## [1.2.10](https://github.com/nativescript-community/ui-label/compare/v1.2.9...v1.2.10) (2022-09-01)
|
7
15
|
|
8
16
|
**Note:** Version bump only for package @nativescript-community/ui-label
|
package/label.ios.js
CHANGED
@@ -482,27 +482,31 @@ export class Label extends LabelBase {
|
|
482
482
|
default:
|
483
483
|
throw new Error(`Invalid text decoration value: ${style.textDecoration}. Valid values are: 'none', 'underline', 'line-through', 'underline line-through'.`);
|
484
484
|
}
|
485
|
+
let paragraphStyle;
|
486
|
+
const createParagraphStyle = () => {
|
487
|
+
if (!paragraphStyle) {
|
488
|
+
paragraphStyle = NSMutableParagraphStyle.alloc().init();
|
489
|
+
paragraphStyle.alignment = this.nativeTextViewProtected.textAlignment;
|
490
|
+
// make sure a possible previously set text alignment setting is not lost when line height is specified
|
491
|
+
dict.set(NSParagraphStyleAttributeName, paragraphStyle);
|
492
|
+
}
|
493
|
+
};
|
485
494
|
if (style.letterSpacing !== 0 && this.nativeTextViewProtected.font) {
|
486
495
|
const kern = style.letterSpacing * this.nativeTextViewProtected.font.pointSize;
|
487
496
|
dict.set(NSKernAttributeName, kern);
|
497
|
+
createParagraphStyle();
|
488
498
|
}
|
489
|
-
const isTextView = false;
|
499
|
+
// const isTextView = false;
|
490
500
|
if (style.lineHeight !== undefined) {
|
491
501
|
let lineHeight = style.lineHeight;
|
492
502
|
if (lineHeight === 0) {
|
493
503
|
lineHeight = 0.00001;
|
494
504
|
}
|
495
|
-
|
505
|
+
createParagraphStyle();
|
496
506
|
paragraphStyle.minimumLineHeight = lineHeight;
|
497
507
|
paragraphStyle.maximumLineHeight = lineHeight;
|
498
|
-
//
|
499
|
-
|
500
|
-
dict.set(NSParagraphStyleAttributeName, paragraphStyle);
|
501
|
-
}
|
502
|
-
else if (isTextView) {
|
503
|
-
const paragraphStyle = NSMutableParagraphStyle.alloc().init();
|
504
|
-
paragraphStyle.alignment = this.nativeTextViewProtected.textAlignment;
|
505
|
-
dict.set(NSParagraphStyleAttributeName, paragraphStyle);
|
508
|
+
// } else if (isTextView) {
|
509
|
+
// createParagraphStyle();
|
506
510
|
}
|
507
511
|
const source = getTransformedText(isNullOrUndefined(this.text) ? '' : `${this.text}`, this.textTransform);
|
508
512
|
if (dict.size > 0) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nativescript-community/ui-label",
|
3
|
-
"version": "1.2.
|
3
|
+
"version": "1.2.11",
|
4
4
|
"description": "Alternative to the built-in NativeScript Label but with better performance and additional features such as HTML rendering and more.",
|
5
5
|
"main": "./label",
|
6
6
|
"sideEffects": false,
|
@@ -34,5 +34,5 @@
|
|
34
34
|
"dependencies": {
|
35
35
|
"@nativescript-community/text": "^1.4.36"
|
36
36
|
},
|
37
|
-
"gitHead": "
|
37
|
+
"gitHead": "86f278fd95f98489d04c7050672f73e101863277"
|
38
38
|
}
|