@nativescript-community/text 1.5.7 → 1.5.8

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
@@ -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.5.8](https://github.com/nativescript-community/text/compare/v1.5.7...v1.5.8) (2022-09-14)
7
+
8
+ **Note:** Version bump only for package @nativescript-community/text
9
+
10
+
11
+
12
+
13
+
6
14
  ## [1.5.7](https://github.com/nativescript-community/text/compare/v1.5.6...v1.5.7) (2022-08-21)
7
15
 
8
16
  **Note:** Version bump only for package @nativescript-community/text
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './index.android';
package/index.js ADDED
@@ -0,0 +1,25 @@
1
+ import { InheritedCssProperty, makeParser, makeValidator, Style } from '@nativescript/core';
2
+ export const cssProperty = (target, key) => {
3
+ // property getter
4
+ const getter = function () {
5
+ return this.style[key];
6
+ };
7
+ // property setter
8
+ const setter = function (newVal) {
9
+ this.style[key] = newVal;
10
+ };
11
+ Object.defineProperty(target, key, {
12
+ get: getter,
13
+ set: setter,
14
+ enumerable: true,
15
+ configurable: true,
16
+ });
17
+ };
18
+ export const verticalTextAlignmentConverter = makeParser(makeValidator('initial', 'top', 'middle', 'bottom', 'center'));
19
+ export const verticalTextAlignmentProperty = new InheritedCssProperty({
20
+ name: 'verticalTextAlignment',
21
+ cssName: 'vertical-text-align',
22
+ valueConverter: verticalTextAlignmentConverter,
23
+ });
24
+ verticalTextAlignmentProperty.register(Style);
25
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAG5F,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAc,EAAE,GAAoB,EAAE,EAAE;IAChE,kBAAkB;IAClB,MAAM,MAAM,GAAG;QACX,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC,CAAC;IAEF,kBAAkB;IAClB,MAAM,MAAM,GAAG,UAAU,MAAM;QAC3B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;IAC7B,CAAC,CAAC;IAEF,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE;QAC/B,GAAG,EAAE,MAAM;QACX,GAAG,EAAE,MAAM;QACX,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,IAAI;KACrB,CAAC,CAAC;AACP,CAAC,CAAC;AAIF,MAAM,CAAC,MAAM,8BAA8B,GAAG,UAAU,CACpD,aAAa,CAAwB,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CACvF,CAAC;AACF,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,oBAAoB,CAA+B;IAChG,IAAI,EAAE,uBAAuB;IAC7B,OAAO,EAAE,qBAAqB;IAC9B,cAAc,EAAE,8BAA8B;CACjD,CAAC,CAAC;AACH,6BAA6B,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript-community/text",
3
- "version": "1.5.7",
3
+ "version": "1.5.8",
4
4
  "description": "Expands the capabilities of NativeScript's text property.",
5
5
  "main": "./index",
6
6
  "sideEffects": false,
@@ -30,5 +30,5 @@
30
30
  },
31
31
  "license": "Apache-2.0",
32
32
  "readmeFilename": "README.md",
33
- "gitHead": "1ed6e47473133d51b731ee6cd40bc90910167dc3"
33
+ "gitHead": "ead17826776014c96c991b7de51abcce98ec2851"
34
34
  }
Binary file
@@ -0,0 +1,22 @@
1
+ declare let DTDefaultTextAlignment: string;
2
+ declare let DTDefaultFontStyle: string;
3
+ declare let DTIgnoreLinkStyleOption: string;
4
+ declare let DTDefaultFontFamily: string;
5
+ declare let DTUseiOS6Attributes: string;
6
+ declare let DTDocumentPreserveTrailingSpaces: string;
7
+ declare let DTDefaultLineBreakMode: string;
8
+ declare let NSTextSizeMultiplierDocumentOption: string;
9
+ declare let kCTLineBreakByWordWrapping: string;
10
+ declare let kCTLeftTextAlignment: string;
11
+ declare let NSAttributedStringEnumerationReverse: number;
12
+
13
+ declare namespace DTCoreTextFontDescriptor {
14
+ function asyncPreloadFontLookupTable();
15
+ }
16
+
17
+ declare interface NSAttributedString {
18
+ initWithHTMLDataOptionsDocumentAttributes(data, options, attr);
19
+ }
20
+ declare interface NSMutableAttributedString {
21
+ initWithHTMLDataOptionsDocumentAttributes(data, options, attr);
22
+ }
@@ -0,0 +1,34 @@
1
+ declare namespace com {
2
+ export namespace nativescript {
3
+ export namespace text {
4
+ export class CustomTypefaceSpan extends globalAndroid.text.style.TypefaceSpan {
5
+ constructor(family: string, typeface: globalAndroid.graphics.Typeface);
6
+ }
7
+ export class CustomBackgroundSpan extends globalAndroid.text.style.ReplacementSpan {
8
+ constructor(radius: number, fillColor: number, strokeColor: number, strokeWidth: number);
9
+ }
10
+ export class BaselineAdjustedSpan extends globalAndroid.text.style.CharacterStyle {
11
+ constructor(fontSize: number, align: string, maxFontSize: number);
12
+ }
13
+ export class HeightSpan extends globalAndroid.text.style.CharacterStyle {
14
+ constructor(size: number);
15
+ }
16
+ export class URLSpanNoUnderline extends globalAndroid.text.style.URLSpan {
17
+ constructor(url: string, showUnderline: boolean);
18
+ }
19
+
20
+ export class Font {
21
+ static stringBuilderFromHtmlString(context: globalAndroid.content.Context, fontPath: string, parentFontFamily: string, text: string): globalAndroid.text.SpannableStringBuilder;
22
+ static stringBuilderFromFormattedString(context: globalAndroid.content.Context, fontPath: string, parentFontFamily: string, nativeString: string): any;
23
+ static createTypeface(
24
+ context: globalAndroid.content.Context,
25
+ fontFolder: string,
26
+ fontFamily: string,
27
+ fontWeight: string,
28
+ isBold: boolean,
29
+ isItalic: boolean
30
+ ): globalAndroid.graphics.Typeface;
31
+ }
32
+ }
33
+ }
34
+ }