@evlop/native-components 1.0.275 → 1.0.276
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/dist/cjs/src/Text/customFontManager.d.ts +9 -16
- package/dist/cjs/src/Text/customFontManager.d.ts.map +1 -1
- package/dist/cjs/src/Text/customFontManager.js +15 -22
- package/dist/cjs/src/Text/customFontManager.js.map +1 -1
- package/dist/types/src/Text/customFontManager.d.ts +9 -16
- package/dist/types/src/Text/customFontManager.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -21,32 +21,25 @@ declare class CustomFontManager {
|
|
|
21
21
|
* Register a font family. Call this once during app bootstrap, before
|
|
22
22
|
* any component that uses the font is rendered.
|
|
23
23
|
*
|
|
24
|
-
* @param name - Logical name used to look up the font (e.g. "primary")
|
|
25
24
|
* @param config - Registration config with familyName and optional weight map
|
|
26
25
|
*/
|
|
27
|
-
registerFont(
|
|
26
|
+
registerFont(config: FontRegistration): void;
|
|
28
27
|
/**
|
|
29
|
-
* Returns the
|
|
28
|
+
* Returns the family names of all registered fonts.
|
|
30
29
|
*/
|
|
31
30
|
getAvailableFontFamilies(): string[];
|
|
32
31
|
/**
|
|
33
|
-
*
|
|
34
|
-
* name, weight, and italic flag.
|
|
35
|
-
*
|
|
36
|
-
* Returns `undefined` if the font is not registered, letting React Native
|
|
37
|
-
* fall back to the system font.
|
|
38
|
-
*
|
|
39
|
-
* @param name - Logical font name as passed to `registerFont`
|
|
40
|
-
* @param fontWeight - One of the FontWeight variants
|
|
41
|
-
* @param italic - Whether to use the italic variant (default: false)
|
|
32
|
+
* Returns `true` if the given familyName has been registered as a custom font.
|
|
42
33
|
*/
|
|
34
|
+
isCustomFont(familyName: string): boolean;
|
|
43
35
|
/**
|
|
44
|
-
*
|
|
36
|
+
* Resolves the React Native font family string for a given familyName,
|
|
37
|
+
* weight, and italic flag.
|
|
45
38
|
*
|
|
46
|
-
*
|
|
39
|
+
* Returns `undefined` if the font is not registered, letting React Native
|
|
40
|
+
* fall back to the system font.
|
|
47
41
|
*/
|
|
48
|
-
|
|
49
|
-
resolveFontFamily(name: string, fontWeight: FontWeight, italic?: boolean): string | undefined;
|
|
42
|
+
resolveFontFamily(familyName: string, fontWeight: FontWeight, italic?: boolean): string | undefined;
|
|
50
43
|
}
|
|
51
44
|
export declare const customFontManager: CustomFontManager;
|
|
52
45
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customFontManager.d.ts","sourceRoot":"","sources":["../../../../src/Text/customFontManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,aAAK,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,CAAA;AAE5C,UAAU,gBAAgB;IACxB,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;CAC3E;AAcD,cAAM,iBAAiB;IACrB,OAAO,CAAC,QAAQ,CAAuC;IAEvD
|
|
1
|
+
{"version":3,"file":"customFontManager.d.ts","sourceRoot":"","sources":["../../../../src/Text/customFontManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,aAAK,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,CAAA;AAE5C,UAAU,gBAAgB;IACxB,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;CAC3E;AAcD,cAAM,iBAAiB;IACrB,OAAO,CAAC,QAAQ,CAAuC;IAEvD;;;;;OAKG;IACH,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAI5C;;OAEG;IACH,wBAAwB,IAAI,MAAM,EAAE;IAIpC;;OAEG;IACH,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAIzC;;;;;;OAMG;IACH,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAQ,GAAG,MAAM,GAAG,SAAS;CAiBlG;AAED,eAAO,MAAM,iBAAiB,mBAA0B,CAAC"}
|
|
@@ -20,48 +20,41 @@ class CustomFontManager {
|
|
|
20
20
|
* Register a font family. Call this once during app bootstrap, before
|
|
21
21
|
* any component that uses the font is rendered.
|
|
22
22
|
*
|
|
23
|
-
* @param name - Logical name used to look up the font (e.g. "primary")
|
|
24
23
|
* @param config - Registration config with familyName and optional weight map
|
|
25
24
|
*/
|
|
26
|
-
registerFont(
|
|
27
|
-
this.registry.set(
|
|
25
|
+
registerFont(config) {
|
|
26
|
+
this.registry.set(config.familyName, config);
|
|
28
27
|
}
|
|
29
28
|
/**
|
|
30
|
-
* Returns the
|
|
29
|
+
* Returns the family names of all registered fonts.
|
|
31
30
|
*/
|
|
32
31
|
getAvailableFontFamilies() {
|
|
33
32
|
return Array.from(this.registry.keys());
|
|
34
33
|
}
|
|
35
34
|
/**
|
|
36
|
-
*
|
|
37
|
-
* name, weight, and italic flag.
|
|
38
|
-
*
|
|
39
|
-
* Returns `undefined` if the font is not registered, letting React Native
|
|
40
|
-
* fall back to the system font.
|
|
41
|
-
*
|
|
42
|
-
* @param name - Logical font name as passed to `registerFont`
|
|
43
|
-
* @param fontWeight - One of the FontWeight variants
|
|
44
|
-
* @param italic - Whether to use the italic variant (default: false)
|
|
35
|
+
* Returns `true` if the given familyName has been registered as a custom font.
|
|
45
36
|
*/
|
|
37
|
+
isCustomFont(familyName) {
|
|
38
|
+
return this.registry.has(familyName);
|
|
39
|
+
}
|
|
46
40
|
/**
|
|
47
|
-
*
|
|
41
|
+
* Resolves the React Native font family string for a given familyName,
|
|
42
|
+
* weight, and italic flag.
|
|
48
43
|
*
|
|
49
|
-
*
|
|
44
|
+
* Returns `undefined` if the font is not registered, letting React Native
|
|
45
|
+
* fall back to the system font.
|
|
50
46
|
*/
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
resolveFontFamily(name, fontWeight, italic = false) {
|
|
55
|
-
const registration = this.registry.get(name);
|
|
47
|
+
resolveFontFamily(familyName, fontWeight, italic = false) {
|
|
48
|
+
const registration = this.registry.get(familyName);
|
|
56
49
|
if (!registration) {
|
|
57
50
|
return undefined;
|
|
58
51
|
}
|
|
59
|
-
const {
|
|
52
|
+
const { weights } = registration;
|
|
60
53
|
const override = weights === null || weights === void 0 ? void 0 : weights[fontWeight];
|
|
61
54
|
if (override) {
|
|
62
55
|
return italic ? override.italic : override.normal;
|
|
63
56
|
}
|
|
64
|
-
const suffix = DEFAULT_WEIGHT_SUFFIXES[fontWeight];
|
|
57
|
+
const suffix = DEFAULT_WEIGHT_SUFFIXES[fontWeight] || DEFAULT_WEIGHT_SUFFIXES.Regular;
|
|
65
58
|
const variant = italic ? suffix.italic : suffix.normal;
|
|
66
59
|
return `${familyName}-${variant}`;
|
|
67
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customFontManager.js","sourceRoot":"","sources":["../../../../src/Text/customFontManager.ts"],"names":[],"mappings":";;;AAiBA,MAAM,uBAAuB,GAA2D;IACtF,IAAI,EAAQ,EAAE,MAAM,EAAE,MAAM,EAAQ,MAAM,EAAE,YAAY,EAAQ;IAChE,UAAU,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE;IAChE,KAAK,EAAO,EAAE,MAAM,EAAE,OAAO,EAAO,MAAM,EAAE,aAAa,EAAO;IAChE,OAAO,EAAK,EAAE,MAAM,EAAE,SAAS,EAAK,MAAM,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CACF;AAEY,QAAA,iBAAiB,GAAG,IAAI,iBAAiB,EAAE,CAAC"}
|
|
@@ -21,32 +21,25 @@ declare class CustomFontManager {
|
|
|
21
21
|
* Register a font family. Call this once during app bootstrap, before
|
|
22
22
|
* any component that uses the font is rendered.
|
|
23
23
|
*
|
|
24
|
-
* @param name - Logical name used to look up the font (e.g. "primary")
|
|
25
24
|
* @param config - Registration config with familyName and optional weight map
|
|
26
25
|
*/
|
|
27
|
-
registerFont(
|
|
26
|
+
registerFont(config: FontRegistration): void;
|
|
28
27
|
/**
|
|
29
|
-
* Returns the
|
|
28
|
+
* Returns the family names of all registered fonts.
|
|
30
29
|
*/
|
|
31
30
|
getAvailableFontFamilies(): string[];
|
|
32
31
|
/**
|
|
33
|
-
*
|
|
34
|
-
* name, weight, and italic flag.
|
|
35
|
-
*
|
|
36
|
-
* Returns `undefined` if the font is not registered, letting React Native
|
|
37
|
-
* fall back to the system font.
|
|
38
|
-
*
|
|
39
|
-
* @param name - Logical font name as passed to `registerFont`
|
|
40
|
-
* @param fontWeight - One of the FontWeight variants
|
|
41
|
-
* @param italic - Whether to use the italic variant (default: false)
|
|
32
|
+
* Returns `true` if the given familyName has been registered as a custom font.
|
|
42
33
|
*/
|
|
34
|
+
isCustomFont(familyName: string): boolean;
|
|
43
35
|
/**
|
|
44
|
-
*
|
|
36
|
+
* Resolves the React Native font family string for a given familyName,
|
|
37
|
+
* weight, and italic flag.
|
|
45
38
|
*
|
|
46
|
-
*
|
|
39
|
+
* Returns `undefined` if the font is not registered, letting React Native
|
|
40
|
+
* fall back to the system font.
|
|
47
41
|
*/
|
|
48
|
-
|
|
49
|
-
resolveFontFamily(name: string, fontWeight: FontWeight, italic?: boolean): string | undefined;
|
|
42
|
+
resolveFontFamily(familyName: string, fontWeight: FontWeight, italic?: boolean): string | undefined;
|
|
50
43
|
}
|
|
51
44
|
export declare const customFontManager: CustomFontManager;
|
|
52
45
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customFontManager.d.ts","sourceRoot":"","sources":["../../../../src/Text/customFontManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,aAAK,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,CAAA;AAE5C,UAAU,gBAAgB;IACxB,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;CAC3E;AAcD,cAAM,iBAAiB;IACrB,OAAO,CAAC,QAAQ,CAAuC;IAEvD
|
|
1
|
+
{"version":3,"file":"customFontManager.d.ts","sourceRoot":"","sources":["../../../../src/Text/customFontManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,aAAK,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,CAAA;AAE5C,UAAU,gBAAgB;IACxB,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;CAC3E;AAcD,cAAM,iBAAiB;IACrB,OAAO,CAAC,QAAQ,CAAuC;IAEvD;;;;;OAKG;IACH,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAI5C;;OAEG;IACH,wBAAwB,IAAI,MAAM,EAAE;IAIpC;;OAEG;IACH,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAIzC;;;;;;OAMG;IACH,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MA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