@react-native-vector-icons/common 12.0.0-alpha.14 → 12.0.0-alpha.21
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/LICENSE +20 -0
- package/README.md +22 -40
- package/lib/commonjs/create-icon-set.js +11 -6
- package/lib/commonjs/create-icon-set.js.map +1 -1
- package/lib/commonjs/dynamicLoading/dynamic-font-loading.js +2 -1
- package/lib/commonjs/dynamicLoading/dynamic-font-loading.js.map +1 -1
- package/lib/commonjs/get-image-library.js +22 -0
- package/lib/commonjs/get-image-library.js.map +1 -0
- package/lib/commonjs/index.js +0 -31
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/create-icon-set.js +8 -4
- package/lib/module/create-icon-set.js.map +1 -1
- package/lib/module/dynamicLoading/dynamic-font-loading.js +2 -1
- package/lib/module/dynamicLoading/dynamic-font-loading.js.map +1 -1
- package/lib/module/get-image-library.js +17 -0
- package/lib/module/get-image-library.js.map +1 -0
- package/lib/module/index.js +0 -29
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/create-icon-set.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/dynamicLoading/dynamic-font-loading.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/dynamicLoading/dynamic-loading-setting.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/get-image-library.d.ts +3 -0
- package/lib/typescript/commonjs/src/get-image-library.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +0 -2
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/scripts/common.d.ts.map +1 -1
- package/lib/typescript/module/src/create-icon-set.d.ts.map +1 -1
- package/lib/typescript/module/src/dynamicLoading/dynamic-font-loading.d.ts.map +1 -1
- package/lib/typescript/module/src/dynamicLoading/dynamic-loading-setting.d.ts.map +1 -1
- package/lib/typescript/module/src/get-image-library.d.ts +3 -0
- package/lib/typescript/module/src/get-image-library.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +0 -2
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/scripts/common.d.ts.map +1 -1
- package/package.json +16 -53
- package/src/create-icon-set.tsx +9 -6
- package/src/dynamicLoading/dynamic-font-loading.ts +2 -1
- package/src/get-image-library.ts +19 -0
- package/src/index.ts +0 -41
- package/android/build.gradle +0 -146
- package/android/gradle.properties +0 -5
- package/android/src/main/AndroidManifest.xml +0 -3
- package/android/src/main/AndroidManifestNew.xml +0 -2
- package/android/src/main/java/com/reactnativevectoricons/common/VectorIconsModule.kt +0 -90
- package/android/src/main/java/com/reactnativevectoricons/common/VectorIconsPackage.kt +0 -35
- package/android/src/newarch/VectorIconsSpec.kt +0 -7
- package/android/src/oldarch/VectorIconsSpec.kt +0 -38
- package/ios/VectorIcons.h +0 -24
- package/ios/VectorIcons.mm +0 -161
- package/lib/commonjs/NativeVectorIcons.js +0 -16
- package/lib/commonjs/NativeVectorIcons.js.map +0 -1
- package/lib/commonjs/NativeVectorIcons.web.js +0 -8
- package/lib/commonjs/NativeVectorIcons.web.js.map +0 -1
- package/lib/commonjs/ensure-native-module-available.js +0 -14
- package/lib/commonjs/ensure-native-module-available.js.map +0 -1
- package/lib/module/NativeVectorIcons.js +0 -12
- package/lib/module/NativeVectorIcons.js.map +0 -1
- package/lib/module/NativeVectorIcons.web.js +0 -4
- package/lib/module/NativeVectorIcons.web.js.map +0 -1
- package/lib/module/ensure-native-module-available.js +0 -9
- package/lib/module/ensure-native-module-available.js.map +0 -1
- package/lib/typescript/commonjs/src/NativeVectorIcons.d.ts +0 -8
- package/lib/typescript/commonjs/src/NativeVectorIcons.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/NativeVectorIcons.web.d.ts +0 -3
- package/lib/typescript/commonjs/src/NativeVectorIcons.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/ensure-native-module-available.d.ts +0 -2
- package/lib/typescript/commonjs/src/ensure-native-module-available.d.ts.map +0 -1
- package/lib/typescript/module/src/NativeVectorIcons.d.ts +0 -8
- package/lib/typescript/module/src/NativeVectorIcons.d.ts.map +0 -1
- package/lib/typescript/module/src/NativeVectorIcons.web.d.ts +0 -3
- package/lib/typescript/module/src/NativeVectorIcons.web.d.ts.map +0 -1
- package/lib/typescript/module/src/ensure-native-module-available.d.ts +0 -2
- package/lib/typescript/module/src/ensure-native-module-available.d.ts.map +0 -1
- package/react-native-vector-icons.podspec +0 -41
- package/react-native.config.js +0 -13
- package/src/NativeVectorIcons.ts +0 -16
- package/src/NativeVectorIcons.web.ts +0 -1
- package/src/ensure-native-module-available.ts +0 -9
package/ios/VectorIcons.mm
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
#import "VectorIcons.h"
|
|
2
|
-
|
|
3
|
-
#import <CoreText/CoreText.h>
|
|
4
|
-
#import <React/RCTBridge.h>
|
|
5
|
-
#import <React/RCTConvert.h>
|
|
6
|
-
#import <React/RCTFont.h>
|
|
7
|
-
#import <React/RCTUtils.h>
|
|
8
|
-
|
|
9
|
-
NSString *const RNVIErrorDomain = @"com.reactnativevectoricons.common";
|
|
10
|
-
enum {
|
|
11
|
-
RNVIGenericError = 1000,
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
@implementation VectorIcons
|
|
15
|
-
RCT_EXPORT_MODULE()
|
|
16
|
-
|
|
17
|
-
- (NSString *)hexStringFromColor:(UIColor *)color {
|
|
18
|
-
const CGFloat *components = CGColorGetComponents(color.CGColor);
|
|
19
|
-
|
|
20
|
-
CGFloat r = components[0];
|
|
21
|
-
CGFloat g = components[1];
|
|
22
|
-
CGFloat b = components[2];
|
|
23
|
-
|
|
24
|
-
return [NSString stringWithFormat:@"#%02lX%02lX%02lX", lroundf(r * 255),
|
|
25
|
-
lroundf(g * 255), lroundf(b * 255)];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
- (NSString *)generateFilePath:(NSString *)glyph
|
|
29
|
-
withFontName:(NSString *)fontName
|
|
30
|
-
withFontSize:(CGFloat)fontSize
|
|
31
|
-
withColor:(UIColor *)color
|
|
32
|
-
withExtraIdentifier:(NSString *)identifier {
|
|
33
|
-
CGFloat screenScale = RCTScreenScale();
|
|
34
|
-
NSString *hexColor = [self hexStringFromColor:color];
|
|
35
|
-
NSString *fileName =
|
|
36
|
-
[NSString stringWithFormat:@"%@RNVectorIcons_%@_%@_%@_%.f%@@%.fx.png",
|
|
37
|
-
NSTemporaryDirectory(), identifier, fontName,
|
|
38
|
-
glyph, fontSize, hexColor, screenScale];
|
|
39
|
-
|
|
40
|
-
return fileName;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
- (BOOL)createAndSaveGlyphImage:(NSString *)glyph
|
|
44
|
-
withFont:(UIFont *)font
|
|
45
|
-
withFilePath:(NSString *)filePath
|
|
46
|
-
withColor:(UIColor *)color {
|
|
47
|
-
if (![[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
|
|
48
|
-
// No cached icon exists, we need to create it and persist to disk
|
|
49
|
-
|
|
50
|
-
NSAttributedString *attributedString =
|
|
51
|
-
[[NSAttributedString alloc] initWithString:glyph
|
|
52
|
-
attributes:@{
|
|
53
|
-
NSFontAttributeName : font,
|
|
54
|
-
NSForegroundColorAttributeName : color
|
|
55
|
-
}];
|
|
56
|
-
|
|
57
|
-
CGSize iconSize = [attributedString size];
|
|
58
|
-
UIGraphicsBeginImageContextWithOptions(iconSize, NO, 0.0);
|
|
59
|
-
[attributedString drawAtPoint:CGPointMake(0, 0)];
|
|
60
|
-
|
|
61
|
-
UIImage *iconImage = UIGraphicsGetImageFromCurrentImageContext();
|
|
62
|
-
UIGraphicsEndImageContext();
|
|
63
|
-
|
|
64
|
-
NSData *imageData = UIImagePNGRepresentation(iconImage);
|
|
65
|
-
return [imageData writeToFile:filePath atomically:YES];
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return YES;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
- (NSString *)createGlyphImagePathForFont:(NSString *)fontName
|
|
72
|
-
withGlyph:(NSString *)glyph
|
|
73
|
-
withFontSize:(CGFloat)fontSize
|
|
74
|
-
withColor:(double)color
|
|
75
|
-
withError:(NSError **)error {
|
|
76
|
-
UIColor *parsedColor = [RCTConvert UIColor:@(color)];
|
|
77
|
-
UIFont *font = [UIFont fontWithName:fontName size:fontSize];
|
|
78
|
-
if (!font) {
|
|
79
|
-
*error = [NSError errorWithDomain:RNVIErrorDomain
|
|
80
|
-
code:RNVIGenericError
|
|
81
|
-
userInfo:@{
|
|
82
|
-
NSLocalizedDescriptionKey: [NSString stringWithFormat:@"No font found for font name \"%@\". Make sure the font is included in info.plist.", fontName]
|
|
83
|
-
}];
|
|
84
|
-
return nil;
|
|
85
|
-
}
|
|
86
|
-
NSString *filePath = [self generateFilePath:glyph
|
|
87
|
-
withFontName:fontName
|
|
88
|
-
withFontSize:fontSize
|
|
89
|
-
withColor:parsedColor
|
|
90
|
-
withExtraIdentifier:@""];
|
|
91
|
-
|
|
92
|
-
BOOL success = [self createAndSaveGlyphImage:glyph
|
|
93
|
-
withFont:font
|
|
94
|
-
withFilePath:filePath
|
|
95
|
-
withColor:parsedColor];
|
|
96
|
-
|
|
97
|
-
if (!success) {
|
|
98
|
-
*error = [NSError errorWithDomain:RNVIErrorDomain
|
|
99
|
-
code:RNVIGenericError
|
|
100
|
-
userInfo:@{
|
|
101
|
-
NSLocalizedDescriptionKey :
|
|
102
|
-
@"Failed to write rendered icon image"
|
|
103
|
-
}];
|
|
104
|
-
return nil;
|
|
105
|
-
}
|
|
106
|
-
return filePath;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
RCT_EXPORT_METHOD(getImageForFont
|
|
110
|
-
: (NSString *)fontName glyph
|
|
111
|
-
: (NSString *)glyph fontSize
|
|
112
|
-
: (CGFloat)fontSize color
|
|
113
|
-
: (double)color resolve
|
|
114
|
-
: (RCTPromiseResolveBlock)resolve reject
|
|
115
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
116
|
-
NSError *error = nil;
|
|
117
|
-
NSString *filePath = [self createGlyphImagePathForFont:fontName
|
|
118
|
-
withGlyph:glyph
|
|
119
|
-
withFontSize:fontSize
|
|
120
|
-
withColor:color
|
|
121
|
-
withError:&error];
|
|
122
|
-
if (error != nil) {
|
|
123
|
-
reject([NSString stringWithFormat:@"%ld", (long)error.code],
|
|
124
|
-
error.localizedDescription, error);
|
|
125
|
-
} else {
|
|
126
|
-
resolve(filePath);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(getImageForFontSync
|
|
131
|
-
: (NSString *)fontName glyph
|
|
132
|
-
: (NSString *)glyph fontSize
|
|
133
|
-
: (CGFloat)fontSize color
|
|
134
|
-
: (double)color) {
|
|
135
|
-
NSError *error = nil;
|
|
136
|
-
NSString* glyphImage = [self createGlyphImagePathForFont:fontName
|
|
137
|
-
withGlyph:glyph
|
|
138
|
-
withFontSize:fontSize
|
|
139
|
-
withColor:color
|
|
140
|
-
withError:&error];
|
|
141
|
-
if (error == nil && glyphImage != nil) {
|
|
142
|
-
return glyphImage;
|
|
143
|
-
} else {
|
|
144
|
-
NSString *reason = error ? error.localizedDescription : @"Failed to create glyph image";
|
|
145
|
-
|
|
146
|
-
@throw [NSException exceptionWithName:@"RNVectorIconsException"
|
|
147
|
-
reason:reason
|
|
148
|
-
userInfo:nil];
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// Don't compile this code when we build for the old architecture.
|
|
153
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
154
|
-
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
155
|
-
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
156
|
-
{
|
|
157
|
-
return std::make_shared<facebook::react::NativeVectorIconsSpecJSI>(params);
|
|
158
|
-
}
|
|
159
|
-
#endif
|
|
160
|
-
|
|
161
|
-
@end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _reactNative = require("react-native");
|
|
8
|
-
// TODO: We should return some defaults if this doesn't exist because we aren't linked now that we are optional
|
|
9
|
-
var _default = exports.default = _reactNative.TurboModuleRegistry.get('VectorIcons') || {
|
|
10
|
-
// @ts-expect-error: don't care about unused name
|
|
11
|
-
getImageForFont: async (fontFamilyName, glyph, fontSize, color) => '',
|
|
12
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
13
|
-
// @ts-expect-error: don't care about unused name
|
|
14
|
-
getImageForFontSync: (fontFamilyName, glyph, fontSize, color) => '' // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=NativeVectorIcons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get","getImageForFont","fontFamilyName","glyph","fontSize","color","getImageForFontSync"],"sourceRoot":"../../src","sources":["NativeVectorIcons.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAQA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACeC,gCAAmB,CAACC,GAAG,CAAO,aAAa,CAAC,IAAI;EAC7D;EACAC,eAAe,EAAE,MAAAA,CAAOC,cAAsB,EAAEC,KAAa,EAAEC,QAAgB,EAAEC,KAAa,KAAK,EAAE;EAAE;EACvG;EACAC,mBAAmB,EAAEA,CAACJ,cAAsB,EAAEC,KAAa,EAAEC,QAAgB,EAAEC,KAAa,KAAK,EAAE,CAAE;AACvG,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["NativeVectorIcons.web.ts"],"mappings":";;;;;;iCAAe,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = ensureNativeModuleAvailable;
|
|
7
|
-
var _NativeVectorIcons = _interopRequireDefault(require("./NativeVectorIcons"));
|
|
8
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
function ensureNativeModuleAvailable() {
|
|
10
|
-
if (!_NativeVectorIcons.default) {
|
|
11
|
-
throw new Error('The native RNVectorIcons API is not available, did you properly integrate the module? Please verify your autolinking setup and recompile.');
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=ensure-native-module-available.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_NativeVectorIcons","_interopRequireDefault","require","e","__esModule","default","ensureNativeModuleAvailable","NativeIconAPI","Error"],"sourceRoot":"../../src","sources":["ensure-native-module-available.ts"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAgD,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEjC,SAASG,2BAA2BA,CAAA,EAAG;EACpD,IAAI,CAACC,0BAAa,EAAE;IAClB,MAAM,IAAIC,KAAK,CACb,2IACF,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
-
// TODO: We should return some defaults if this doesn't exist because we aren't linked now that we are optional
|
|
5
|
-
export default TurboModuleRegistry.get('VectorIcons') || {
|
|
6
|
-
// @ts-expect-error: don't care about unused name
|
|
7
|
-
getImageForFont: async (fontFamilyName, glyph, fontSize, color) => '',
|
|
8
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
9
|
-
// @ts-expect-error: don't care about unused name
|
|
10
|
-
getImageForFontSync: (fontFamilyName, glyph, fontSize, color) => '' // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=NativeVectorIcons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","get","getImageForFont","fontFamilyName","glyph","fontSize","color","getImageForFontSync"],"sourceRoot":"../../src","sources":["NativeVectorIcons.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AAQlD;AACA,eAAeA,mBAAmB,CAACC,GAAG,CAAO,aAAa,CAAC,IAAI;EAC7D;EACAC,eAAe,EAAE,MAAAA,CAAOC,cAAsB,EAAEC,KAAa,EAAEC,QAAgB,EAAEC,KAAa,KAAK,EAAE;EAAE;EACvG;EACAC,mBAAmB,EAAEA,CAACJ,cAAsB,EAAEC,KAAa,EAAEC,QAAgB,EAAEC,KAAa,KAAK,EAAE,CAAE;AACvG,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["NativeVectorIcons.web.ts"],"mappings":";;AAAA,eAAe,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import NativeIconAPI from './NativeVectorIcons';
|
|
4
|
-
export default function ensureNativeModuleAvailable() {
|
|
5
|
-
if (!NativeIconAPI) {
|
|
6
|
-
throw new Error('The native RNVectorIcons API is not available, did you properly integrate the module? Please verify your autolinking setup and recompile.');
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=ensure-native-module-available.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["NativeIconAPI","ensureNativeModuleAvailable","Error"],"sourceRoot":"../../src","sources":["ensure-native-module-available.ts"],"mappings":";;AAAA,OAAOA,aAAa,MAAM,qBAAqB;AAE/C,eAAe,SAASC,2BAA2BA,CAAA,EAAG;EACpD,IAAI,CAACD,aAAa,EAAE;IAClB,MAAM,IAAIE,KAAK,CACb,2IACF,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { TurboModule } from 'react-native';
|
|
2
|
-
export interface Spec extends TurboModule {
|
|
3
|
-
getImageForFont(fontFamilyName: string, glyph: string, fontSize: number, color: number): Promise<string>;
|
|
4
|
-
getImageForFontSync(fontFamilyName: string, glyph: string, fontSize: number, color: number): string;
|
|
5
|
-
}
|
|
6
|
-
declare const _default: Spec;
|
|
7
|
-
export default _default;
|
|
8
|
-
//# sourceMappingURL=NativeVectorIcons.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NativeVectorIcons.d.ts","sourceRoot":"","sources":["../../../../src/NativeVectorIcons.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,eAAe,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzG,mBAAmB,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACrG;;AAGD,wBAKE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NativeVectorIcons.web.d.ts","sourceRoot":"","sources":["../../../../src/NativeVectorIcons.web.ts"],"names":[],"mappings":";AAAA,wBAAkB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ensure-native-module-available.d.ts","sourceRoot":"","sources":["../../../../src/ensure-native-module-available.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,2BAA2B,SAMlD"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { TurboModule } from 'react-native';
|
|
2
|
-
export interface Spec extends TurboModule {
|
|
3
|
-
getImageForFont(fontFamilyName: string, glyph: string, fontSize: number, color: number): Promise<string>;
|
|
4
|
-
getImageForFontSync(fontFamilyName: string, glyph: string, fontSize: number, color: number): string;
|
|
5
|
-
}
|
|
6
|
-
declare const _default: Spec;
|
|
7
|
-
export default _default;
|
|
8
|
-
//# sourceMappingURL=NativeVectorIcons.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NativeVectorIcons.d.ts","sourceRoot":"","sources":["../../../../src/NativeVectorIcons.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,eAAe,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzG,mBAAmB,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACrG;;AAGD,wBAKE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NativeVectorIcons.web.d.ts","sourceRoot":"","sources":["../../../../src/NativeVectorIcons.web.ts"],"names":[],"mappings":";AAAA,wBAAkB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ensure-native-module-available.d.ts","sourceRoot":"","sources":["../../../../src/ensure-native-module-available.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,2BAA2B,SAMlD"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
require "json"
|
|
2
|
-
|
|
3
|
-
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
-
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
5
|
-
|
|
6
|
-
Pod::Spec.new do |s|
|
|
7
|
-
s.name = "react-native-vector-icons"
|
|
8
|
-
s.version = package["version"]
|
|
9
|
-
s.summary = package["description"]
|
|
10
|
-
s.homepage = package["homepage"]
|
|
11
|
-
s.license = package["license"]
|
|
12
|
-
s.authors = package["author"]
|
|
13
|
-
|
|
14
|
-
s.platforms = { :ios => min_ios_version_supported, :tvos => "9.0", :visionos => "1.0" }
|
|
15
|
-
s.source = { :git => package["repository"]["url"], :tag => "v#{s.version}" }
|
|
16
|
-
|
|
17
|
-
s.source_files = "ios/**/*.{h,m,mm,cpp}"
|
|
18
|
-
|
|
19
|
-
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
20
|
-
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
21
|
-
if respond_to?(:install_modules_dependencies, true)
|
|
22
|
-
install_modules_dependencies(s)
|
|
23
|
-
else
|
|
24
|
-
s.dependency "React-Core"
|
|
25
|
-
|
|
26
|
-
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
27
|
-
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
28
|
-
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
29
|
-
s.pod_target_xcconfig = {
|
|
30
|
-
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
31
|
-
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
32
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
33
|
-
}
|
|
34
|
-
s.dependency "React-Codegen"
|
|
35
|
-
s.dependency "RCT-Folly"
|
|
36
|
-
s.dependency "RCTRequired"
|
|
37
|
-
s.dependency "RCTTypeSafety"
|
|
38
|
-
s.dependency "ReactCommon/turbomodule/core"
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
end
|
package/react-native.config.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @type {import('@react-native-community/cli-types').UserDependencyConfig}
|
|
3
|
-
*/
|
|
4
|
-
module.exports = {
|
|
5
|
-
dependency: {
|
|
6
|
-
platforms: {
|
|
7
|
-
android: {
|
|
8
|
-
// NOTE: We aren't shipping generated files as this eesm to break react 0.73 due to missing include paths for react-native
|
|
9
|
-
cmakeListsPath: 'build/generated/source/codegen/jni/CMakeLists.txt',
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
};
|
package/src/NativeVectorIcons.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { TurboModule } from 'react-native';
|
|
2
|
-
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
-
|
|
4
|
-
export interface Spec extends TurboModule {
|
|
5
|
-
getImageForFont(fontFamilyName: string, glyph: string, fontSize: number, color: number): Promise<string>;
|
|
6
|
-
|
|
7
|
-
getImageForFontSync(fontFamilyName: string, glyph: string, fontSize: number, color: number): string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// TODO: We should return some defaults if this doesn't exist because we aren't linked now that we are optional
|
|
11
|
-
export default TurboModuleRegistry.get<Spec>('VectorIcons') || {
|
|
12
|
-
// @ts-expect-error: don't care about unused name
|
|
13
|
-
getImageForFont: async (fontFamilyName: string, glyph: string, fontSize: number, color: number) => '', // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
14
|
-
// @ts-expect-error: don't care about unused name
|
|
15
|
-
getImageForFontSync: (fontFamilyName: string, glyph: string, fontSize: number, color: number) => '', // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
16
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import NativeIconAPI from './NativeVectorIcons';
|
|
2
|
-
|
|
3
|
-
export default function ensureNativeModuleAvailable() {
|
|
4
|
-
if (!NativeIconAPI) {
|
|
5
|
-
throw new Error(
|
|
6
|
-
'The native RNVectorIcons API is not available, did you properly integrate the module? Please verify your autolinking setup and recompile.',
|
|
7
|
-
);
|
|
8
|
-
}
|
|
9
|
-
}
|