@react-native-vector-icons/common 0.0.1-alpha.7 → 11.0.0-alpha.0
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 +1 -2
- package/README.md +49 -91
- package/android/build.gradle +37 -3
- package/android/generated/java/com/reactnativevectoricons/common/NativeVectorIconsSpec.java +42 -0
- package/android/generated/jni/CMakeLists.txt +49 -0
- package/android/generated/jni/RNVectorIconsSpec-generated.cpp +38 -0
- package/android/generated/jni/RNVectorIconsSpec.h +31 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/ComponentDescriptors.cpp +22 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/ComponentDescriptors.h +24 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/EventEmitters.cpp +16 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/EventEmitters.h +17 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/Props.cpp +19 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/Props.h +18 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/RNVectorIconsSpecJSI-generated.cpp +40 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/RNVectorIconsSpecJSI.h +76 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/ShadowNodes.cpp +17 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/ShadowNodes.h +23 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/States.cpp +16 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/States.h +19 -0
- package/android/src/main/AndroidManifestNew.xml +1 -1
- package/android/src/main/java/com/reactnativevectoricons/common/VectorIconsModule.kt +90 -0
- package/android/src/main/java/com/reactnativevectoricons/common/VectorIconsPackage.kt +35 -0
- package/android/src/newarch/VectorIconsSpec.kt +7 -0
- package/android/src/oldarch/VectorIconsSpec.kt +38 -0
- package/ios/VectorIcons.h +13 -17
- package/ios/VectorIcons.mm +76 -92
- package/ios/generated/RNVectorIconsSpec/ComponentDescriptors.cpp +22 -0
- package/ios/generated/RNVectorIconsSpec/ComponentDescriptors.h +24 -0
- package/ios/generated/RNVectorIconsSpec/EventEmitters.cpp +16 -0
- package/ios/generated/RNVectorIconsSpec/EventEmitters.h +17 -0
- package/ios/generated/RNVectorIconsSpec/Props.cpp +19 -0
- package/ios/generated/RNVectorIconsSpec/Props.h +18 -0
- package/ios/generated/RNVectorIconsSpec/RCTComponentViewHelpers.h +18 -0
- package/ios/generated/RNVectorIconsSpec/RNVectorIconsSpec-generated.mm +36 -0
- package/ios/generated/RNVectorIconsSpec/RNVectorIconsSpec.h +58 -0
- package/ios/generated/RNVectorIconsSpec/ShadowNodes.cpp +17 -0
- package/ios/generated/RNVectorIconsSpec/ShadowNodes.h +23 -0
- package/ios/generated/RNVectorIconsSpec/States.cpp +16 -0
- package/ios/generated/RNVectorIconsSpec/States.h +19 -0
- package/ios/generated/RNVectorIconsSpecJSI-generated.cpp +40 -0
- package/ios/generated/RNVectorIconsSpecJSI.h +76 -0
- package/lib/commonjs/NativeVectorIcons.js.map +1 -1
- package/lib/commonjs/create-icon-set.js +49 -36
- package/lib/commonjs/create-icon-set.js.map +1 -1
- package/lib/commonjs/dynamicLoading/dynamic-font-loading.js +92 -0
- package/lib/commonjs/dynamicLoading/dynamic-font-loading.js.map +1 -0
- package/lib/commonjs/dynamicLoading/dynamic-font-loading.web.js +20 -0
- package/lib/commonjs/dynamicLoading/dynamic-font-loading.web.js.map +1 -0
- package/lib/commonjs/dynamicLoading/dynamic-loading-setting.js +50 -0
- package/lib/commonjs/dynamicLoading/dynamic-loading-setting.js.map +1 -0
- package/lib/commonjs/dynamicLoading/types.js +2 -0
- package/lib/commonjs/dynamicLoading/types.js.map +1 -0
- package/lib/commonjs/ensure-native-module-available.js +1 -1
- package/lib/commonjs/ensure-native-module-available.js.map +1 -1
- package/lib/commonjs/index.js +57 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/scripts/common.js +49 -0
- package/lib/commonjs/scripts/common.js.map +1 -0
- package/lib/commonjs/scripts/getFonts.js +6 -40
- package/lib/commonjs/scripts/getFonts.js.map +1 -1
- package/lib/commonjs/scripts/updatePlist.js +54 -0
- package/lib/commonjs/scripts/updatePlist.js.map +1 -0
- package/lib/module/NativeVectorIcons.js +2 -0
- package/lib/module/NativeVectorIcons.js.map +1 -1
- package/lib/module/NativeVectorIcons.web.js +2 -0
- package/lib/module/NativeVectorIcons.web.js.map +1 -1
- package/lib/module/create-icon-set.js +49 -34
- package/lib/module/create-icon-set.js.map +1 -1
- package/lib/module/create-icon-source-cache.js +2 -0
- package/lib/module/create-icon-source-cache.js.map +1 -1
- package/lib/module/dynamicLoading/dynamic-font-loading.js +85 -0
- package/lib/module/dynamicLoading/dynamic-font-loading.js.map +1 -0
- package/lib/module/dynamicLoading/dynamic-font-loading.web.js +16 -0
- package/lib/module/dynamicLoading/dynamic-font-loading.web.js.map +1 -0
- package/lib/module/dynamicLoading/dynamic-loading-setting.js +41 -0
- package/lib/module/dynamicLoading/dynamic-loading-setting.js.map +1 -0
- package/lib/module/dynamicLoading/types.js +2 -0
- package/lib/module/dynamicLoading/types.js.map +1 -0
- package/lib/module/ensure-native-module-available.js +2 -0
- package/lib/module/ensure-native-module-available.js.map +1 -1
- package/lib/module/index.js +33 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/scripts/common.js +43 -0
- package/lib/module/scripts/common.js.map +1 -0
- package/lib/module/scripts/getFonts.js +8 -39
- package/lib/module/scripts/getFonts.js.map +1 -1
- package/lib/module/scripts/updatePlist.js +51 -0
- package/lib/module/scripts/updatePlist.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/NativeVectorIcons.d.ts +8 -0
- package/lib/typescript/commonjs/src/NativeVectorIcons.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/NativeVectorIcons.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/create-icon-set.d.ts +36 -0
- package/lib/typescript/commonjs/src/create-icon-set.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/create-icon-source-cache.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/dynamicLoading/dynamic-font-loading.d.ts +3 -0
- package/lib/typescript/commonjs/src/dynamicLoading/dynamic-font-loading.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/dynamicLoading/dynamic-font-loading.web.d.ts +6 -0
- package/lib/typescript/commonjs/src/dynamicLoading/dynamic-font-loading.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/dynamicLoading/dynamic-loading-setting.d.ts +41 -0
- package/lib/typescript/commonjs/src/dynamicLoading/dynamic-loading-setting.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/dynamicLoading/types.d.ts +9 -0
- package/lib/typescript/commonjs/src/dynamicLoading/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ensure-native-module-available.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +6 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/scripts/common.d.ts +2 -0
- package/lib/typescript/commonjs/src/scripts/common.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/scripts/getFonts.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/scripts/updatePlist.d.ts +3 -0
- package/lib/typescript/commonjs/src/scripts/updatePlist.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/NativeVectorIcons.d.ts +8 -0
- package/lib/typescript/module/src/NativeVectorIcons.d.ts.map +1 -0
- package/lib/typescript/module/src/NativeVectorIcons.web.d.ts +3 -0
- package/lib/typescript/module/src/NativeVectorIcons.web.d.ts.map +1 -0
- package/lib/typescript/module/src/create-icon-set.d.ts +36 -0
- package/lib/typescript/module/src/create-icon-set.d.ts.map +1 -0
- package/lib/typescript/module/src/create-icon-source-cache.d.ts +21 -0
- package/lib/typescript/module/src/create-icon-source-cache.d.ts.map +1 -0
- package/lib/typescript/module/src/dynamicLoading/dynamic-font-loading.d.ts +3 -0
- package/lib/typescript/module/src/dynamicLoading/dynamic-font-loading.d.ts.map +1 -0
- package/lib/typescript/module/src/dynamicLoading/dynamic-font-loading.web.d.ts +6 -0
- package/lib/typescript/module/src/dynamicLoading/dynamic-font-loading.web.d.ts.map +1 -0
- package/lib/typescript/module/src/dynamicLoading/dynamic-loading-setting.d.ts +41 -0
- package/lib/typescript/module/src/dynamicLoading/dynamic-loading-setting.d.ts.map +1 -0
- package/lib/typescript/module/src/dynamicLoading/types.d.ts +9 -0
- package/lib/typescript/module/src/dynamicLoading/types.d.ts.map +1 -0
- package/lib/typescript/module/src/ensure-native-module-available.d.ts +2 -0
- package/lib/typescript/module/src/ensure-native-module-available.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +6 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/scripts/common.d.ts +2 -0
- package/lib/typescript/module/src/scripts/common.d.ts.map +1 -0
- package/lib/typescript/module/src/scripts/getFonts.d.ts +3 -0
- package/lib/typescript/module/src/scripts/getFonts.d.ts.map +1 -0
- package/lib/typescript/module/src/scripts/updatePlist.d.ts +3 -0
- package/lib/typescript/module/src/scripts/updatePlist.d.ts.map +1 -0
- package/package.json +72 -44
- package/react-native-vector-icons.podspec +67 -42
- package/react-native.config.js +12 -0
- package/src/NativeVectorIcons.ts +2 -4
- package/src/create-icon-set.tsx +79 -32
- package/src/dynamicLoading/dynamic-font-loading.ts +97 -0
- package/src/dynamicLoading/dynamic-font-loading.web.ts +15 -0
- package/src/dynamicLoading/dynamic-loading-setting.ts +77 -0
- package/src/dynamicLoading/types.ts +10 -0
- package/src/index.ts +48 -1
- package/src/scripts/common.ts +52 -0
- package/src/scripts/getFonts.ts +6 -47
- package/src/scripts/updatePlist.ts +58 -0
- package/android/src/main/java/com/reactnativevectoricons/common/VectorIconsModule.java +0 -121
- package/android/src/main/java/com/reactnativevectoricons/common/VectorIconsPackage.java +0 -45
- package/android/src/newarch/VectorIconsSpec.java +0 -9
- package/android/src/oldarch/VectorIconsSpec.java +0 -18
- package/lib/typescript/src/NativeVectorIcons.d.ts +0 -9
- package/lib/typescript/src/NativeVectorIcons.d.ts.map +0 -1
- package/lib/typescript/src/NativeVectorIcons.web.d.ts.map +0 -1
- package/lib/typescript/src/create-icon-set.d.ts +0 -26
- package/lib/typescript/src/create-icon-set.d.ts.map +0 -1
- package/lib/typescript/src/create-icon-source-cache.d.ts.map +0 -1
- package/lib/typescript/src/ensure-native-module-available.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts +0 -3
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/lib/typescript/src/scripts/getFonts.d.ts.map +0 -1
- /package/lib/typescript/{src → commonjs/src}/NativeVectorIcons.web.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/create-icon-source-cache.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/ensure-native-module-available.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/scripts/getFonts.d.ts +0 -0
package/LICENSE
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2015 Joel Arvidsson
|
|
4
|
-
|
|
5
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
5
|
of this software and associated documentation files (the "Software"), to deal
|
|
7
6
|
in the Software without restriction, including without limitation the rights
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|

|
|
2
2
|
|
|
3
|
-
[](https://npmjs.com/package/@react-native-vector-icons/common.svg) [](https://npmjs.com/package/@react-native-vector-icons/common)
|
|
4
4
|
|
|
5
5
|
# React Native Vector Icons
|
|
6
6
|
|
|
@@ -11,22 +11,22 @@ extension and styling effortless.
|
|
|
11
11
|
|
|
12
12
|
For the integration of `.svg` files natively, you can explore [`react-native-vector-image`](https://github.com/oblador/react-native-vector-image).
|
|
13
13
|
|
|
14
|
+
> [!TIP]
|
|
15
|
+
> If you are still using the old single package `react-native-vector-icons` please visit https://github.com/oblador/react-native-vector-icons/tree/legacy
|
|
16
|
+
|
|
14
17
|
## Table of Contents
|
|
15
18
|
|
|
16
19
|
- [Sponsorship](#sponsorship)
|
|
17
20
|
- [Available Icon Sets](#available-icon-sets)
|
|
18
21
|
- [Installation](#installation)
|
|
19
|
-
|
|
20
|
-
- [macOS Setup](#macos-setup)
|
|
21
|
-
- [Windows Setup](#windows-setup)
|
|
22
|
-
- [Web Setup](#web-setup)
|
|
22
|
+
- [Setup](#setup)
|
|
23
23
|
- [Icon Component](#icon-component)
|
|
24
24
|
- [Usage as PNG Image/Source Object](#usage-as-png-imagesource-object)
|
|
25
25
|
- [Multi-Style Fonts](#multi-style-fonts)
|
|
26
26
|
- [Custom Fonts](#custom-fonts)
|
|
27
27
|
- [Animation](#animation)
|
|
28
|
+
- [Dynamic icon font loading](#dynamic-icon-font-loading)
|
|
28
29
|
- [Usage Examples](#usage-examples)
|
|
29
|
-
- [Generating Your Own Icon Package](#generating-your-own-icon-package)
|
|
30
30
|
- [Changelog](https://github.com/react-native-vector-icons/react-native-vector-icons/releases)
|
|
31
31
|
- [License](#license)
|
|
32
32
|
|
|
@@ -41,14 +41,14 @@ Should you find this library beneficial, kindly contemplate the option of
|
|
|
41
41
|
|
|
42
42
|
RNVI comes with the following supported icons. You can [search NPM](https://www.npmjs.com/search?q=keywords%3Areact-native-vector-icons-icon) for third party icons.
|
|
43
43
|
|
|
44
|
-
### Actively maintained
|
|
44
|
+
### Actively maintained
|
|
45
45
|
- [`AntDesign`](https://ant.design/components/icon) from Ant Group (v4.4.2 with _449_ icons)
|
|
46
46
|
- [`Feather`](http://feathericons.com) created by Cole Bemis & Contributors (v4.29.2 featuring _287_ icons)
|
|
47
|
-
- [`FontAwesome 6`](https://fontawesome.com/search) designed by Fonticons, Inc. (v6.
|
|
47
|
+
- [`FontAwesome 6`](https://fontawesome.com/search) designed by Fonticons, Inc. (v6.6.0 featuring _2050_ free and _30213_ pro icons)
|
|
48
48
|
- [`Foundation`](http://zurb.com/playground/foundation-icon-fonts-3) by ZURB, Inc. (v3.0 with _283_ icons)
|
|
49
49
|
- [`Ionicons`](https://ionic.io/ionicons) crafted by Ionic (v7.4.0 containing _1356_ icons)
|
|
50
50
|
- [`MaterialDesignIcons`](https://pictogrammers.com/library/mdi/) from MaterialDesignIcons.com (v7.4.47 including _7448_ icons)
|
|
51
|
-
- [`Octicons`](https://primer.style/foundations/icons) designed by
|
|
51
|
+
- [`Octicons`](https://primer.style/foundations/icons) designed by GitHub, Inc. (v19.11.0 with _331_ icons)
|
|
52
52
|
|
|
53
53
|
### No longer maintained upstream
|
|
54
54
|
- [`Entypo`](http://entypo.com) by Daniel Bruce (v1.0.1 with _411_ icons)
|
|
@@ -62,7 +62,7 @@ RNVI comes with the following supported icons. You can [search NPM](https://www.
|
|
|
62
62
|
|
|
63
63
|
## Migration
|
|
64
64
|
|
|
65
|
-
See [MIGRATION.md](MIGRATION.md) if you are migrating from `react-native-vector-icons`
|
|
65
|
+
See [MIGRATION.md](MIGRATION.md) if you are migrating from `react-native-vector-icons` to the package-per-icon-set approach.
|
|
66
66
|
|
|
67
67
|
## Installation
|
|
68
68
|
|
|
@@ -70,86 +70,22 @@ See [MIGRATION.md](MIGRATION.md) if you are migrating from `react-native-vector-
|
|
|
70
70
|
```sh
|
|
71
71
|
npm install --save @react-native-vector-icons/common
|
|
72
72
|
```
|
|
73
|
-
|
|
73
|
+
2. Install the packages for the icons you want use
|
|
74
74
|
```sh
|
|
75
75
|
npm install --save @react-native-vector-icons/fontawesome6 @react-native-vector-icons/evilicons
|
|
76
76
|
```
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
* [FontAwesome 5](packages/fontawesome5/README.md)
|
|
80
|
-
* [FontAwesome 5 Pro](packages/fontawesome5-pro/README.md)
|
|
77
|
+
3. Depending on the platform you're targeting (iOS/Android/Windows), follow the appropriate setup instructions below.
|
|
78
|
+
4. If you are using one of the following fonts refer to their guides for further instructions
|
|
81
79
|
* [FontAwesome 6](packages/fontawesome6/README.md)
|
|
82
80
|
* [FontAwesome 6 Pro](packages/fontawesome6-pro/README.md)
|
|
81
|
+
* [FontAwesome 5](packages/fontawesome5/README.md)
|
|
82
|
+
* [FontAwesome 5 Pro](packages/fontawesome5-pro/README.md)
|
|
83
83
|
* [Fontello](packages/fontello/README.md)
|
|
84
84
|
* [Icomoon](packages/icomoon/README.md)
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
Nothing else needed.
|
|
89
|
-
|
|
90
|
-
### iOS
|
|
91
|
-
|
|
92
|
-
To use the bundled icons on iOS, follow these steps:
|
|
93
|
-
|
|
94
|
-
1. Update your pods
|
|
95
|
-
```sh
|
|
96
|
-
cd ios && pod update
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### macOS
|
|
100
|
-
|
|
101
|
-
TBA: It should just work???
|
|
102
|
-
|
|
103
|
-
### Windows
|
|
104
|
-
|
|
105
|
-
TBA: It should just work???
|
|
106
|
-
|
|
107
|
-
### Web Setup
|
|
108
|
-
|
|
109
|
-
FIXME: Can we improve on this?
|
|
110
|
-
|
|
111
|
-
To integrate the library with your web project using [webpack](https://webpack.js.org/), follow these steps:
|
|
86
|
+
## Setup
|
|
112
87
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
```js
|
|
116
|
-
{
|
|
117
|
-
test: /\.ttf$/,
|
|
118
|
-
loader: "url-loader", // or directly file-loader
|
|
119
|
-
include: path.resolve(__dirname, "node_modules/react-native-vector-icons"),
|
|
120
|
-
}
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
2. In your JavaScript entry point, consume the font files and inject the necessary style tag:
|
|
124
|
-
|
|
125
|
-
```js
|
|
126
|
-
import Icon from '@react-native-vector-icons/fontAwesome';
|
|
127
|
-
|
|
128
|
-
// Generate the required CSS
|
|
129
|
-
import iconFont from '@react-native-vector-icons/fontawesome/fonts/FontAwesome.ttf';
|
|
130
|
-
const iconFontStyles = `@font-face {
|
|
131
|
-
src: url(${iconFont});
|
|
132
|
-
font-family: FontAwesome;
|
|
133
|
-
}`;
|
|
134
|
-
|
|
135
|
-
// Create a stylesheet
|
|
136
|
-
const style = document.createElement('style');
|
|
137
|
-
style.type = 'text/css';
|
|
138
|
-
|
|
139
|
-
// Append the iconFontStyles to the stylesheet
|
|
140
|
-
if (style.styleSheet) {
|
|
141
|
-
style.styleSheet.cssText = iconFontStyles;
|
|
142
|
-
} else {
|
|
143
|
-
style.appendChild(document.createTextNode(iconFontStyles));
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// Inject the stylesheet into the document head
|
|
147
|
-
document.head.appendChild(style);
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
By following these steps, you will seamlessly integrate the vector icons
|
|
151
|
-
library into your web project using [webpack](https://webpack.js.org/),
|
|
152
|
-
enabling you to effortlessly use the icons within your web application.
|
|
88
|
+
Please refer to the guide for [Expo](./docs/SETUP-EXPO.md), [React Native](./docs/SETUP-REACT-NATIVE.md) or [Web](./docs/SETUP-WEB.md) for further instructions.
|
|
153
89
|
|
|
154
90
|
## `Icon` Component
|
|
155
91
|
|
|
@@ -160,9 +96,9 @@ import Icon from '@react-native-vector-icons/fontawesome';
|
|
|
160
96
|
const myIcon = <Icon name="rocket" size={30} color="#900" />;
|
|
161
97
|
```
|
|
162
98
|
|
|
163
|
-
###
|
|
99
|
+
### Props
|
|
164
100
|
|
|
165
|
-
Any [Text
|
|
101
|
+
Any [Text props](https://reactnative.dev/docs/text.html#props) and the following:
|
|
166
102
|
|
|
167
103
|
| Prop | Description | Default |
|
|
168
104
|
| ----------- | ----------------------------------------------------------------------- | ----------- |
|
|
@@ -234,20 +170,25 @@ All static methods from `Icon` is supported by multi-styled fonts.
|
|
|
234
170
|
|
|
235
171
|
The best approach is to use our icon generator to create your own icon package.
|
|
236
172
|
|
|
237
|
-
See [CREATE_FONT_PACKAGE.md] to learn how to create your own font packages.
|
|
173
|
+
See [CREATE_FONT_PACKAGE.md](./docs/CREATE_FONT_PACKAGE.md) to learn how to create your own font packages.
|
|
238
174
|
|
|
239
|
-
You can also use `createIconSet(
|
|
175
|
+
You can also use `createIconSet()` directly in your project. This
|
|
240
176
|
returns your own custom font based on the `glyphMap` where the key is the icon
|
|
241
177
|
name and the value is either a UTF-8 character or it's character code.
|
|
242
|
-
`
|
|
243
|
-
Font Book.app or similar to learn the name.
|
|
244
|
-
`fontFile` argument for android support, it should be the custom font file
|
|
245
|
-
name.
|
|
178
|
+
`postScriptName` is the name of the postscript font. Open the font in https://fontdrop.info/,
|
|
179
|
+
Font Book.app or similar to learn the name. Also pass the `fontFileName` argument for Android support.
|
|
246
180
|
|
|
247
181
|
```js
|
|
248
182
|
import { createIconSet } from '@react-native-vector-icons/common';
|
|
249
183
|
const glyphMap = { 'icon-name': 1234, test: '∆' };
|
|
250
|
-
|
|
184
|
+
|
|
185
|
+
// use createIconSet() with object parameter
|
|
186
|
+
// or use positional parameters for compatibility with version <= 10: `createIconSet(glyphMap, fontFamily[, fontFile])`
|
|
187
|
+
const Icon = createIconSet(glyphMap, {
|
|
188
|
+
postScriptName: 'FontName',
|
|
189
|
+
fontFileName: 'font-name.ttf',
|
|
190
|
+
fontSource: require('../fonts/font-name.ttf') // optional, for dynamic loading. Can also be a local file uri.
|
|
191
|
+
})
|
|
251
192
|
```
|
|
252
193
|
|
|
253
194
|
You should place the font ttf file into `rnvi-fonts`. You can customise this location by adding the following snippet to your package.json
|
|
@@ -268,9 +209,26 @@ Animated.createAnimatedComponent(Icon)`. You can also use the higher level
|
|
|
268
209
|
animation library
|
|
269
210
|
[react-native-animatable](https://github.com/oblador/react-native-animatable).
|
|
270
211
|
|
|
212
|
+
## Dynamic icon font loading
|
|
213
|
+
|
|
214
|
+
> At the moment, dynamic loading is supported on native platforms (not on web) only if you use Expo. In the future, it should become available for all React Native projects via React Native core.
|
|
215
|
+
|
|
216
|
+
Fonts can be available in an app statically (since build time) or loaded dynamically at runtime. The latter can be useful e.g. for apps that use over-the-air updates and want to load new fonts with an update, or when you need to use a font from a remote location.
|
|
217
|
+
|
|
218
|
+
Dynamic loading in react-native-vector-icons is currently limited to those fonts that are bundled within the provided packages: it doesn't support Pro fonts (such as FontAwesome 5 Pro). However, loading of custom fonts is not difficult to implement: see any of the free font packages for reference.
|
|
219
|
+
|
|
220
|
+
By default, dynamic loading is enabled if supported by the version of Expo that you're using. It doesn't change the way you work with the package: If rendering an icon requires a font that is not known to the app, it will be loaded automatically and icon will render as expected.
|
|
221
|
+
|
|
222
|
+
`@react-native-vector-icons/common` exports several functions which you can use to control dynamic loading:
|
|
223
|
+
|
|
224
|
+
- `isDynamicLoadingEnabled`: Returns whether dynamic loading is enabled.
|
|
225
|
+
- `isDynamicLoadingSupported`: Returns whether dynamic loading is supported by your runtime (checks that necessary Expo features are present).
|
|
226
|
+
- `setDynamicLoadingEnabled`: Enables or disables dynamic loading.
|
|
227
|
+
- `setDynamicLoadingErrorCallback`: Sets a callback that is called (in the unlikely case) when an error occurs during dynamic loading. An example of when an error might happen is loading a misconfigured OTA update which doesn't include a necessary font file.
|
|
228
|
+
|
|
271
229
|
## Usage Examples
|
|
272
230
|
|
|
273
|
-
###
|
|
231
|
+
### Icon Explorer
|
|
274
232
|
|
|
275
233
|
Try the `IconExplorer` project in `Examples/IconExplorer` folder, there you can also search for any icon.
|
|
276
234
|
|
package/android/build.gradle
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
buildscript {
|
|
2
|
+
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
|
3
|
+
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["VectorIcons_kotlinVersion"]
|
|
4
|
+
|
|
2
5
|
repositories {
|
|
3
6
|
google()
|
|
4
7
|
mavenCentral()
|
|
@@ -6,14 +9,22 @@ buildscript {
|
|
|
6
9
|
|
|
7
10
|
dependencies {
|
|
8
11
|
classpath "com.android.tools.build:gradle:7.2.1"
|
|
12
|
+
// noinspection DifferentKotlinGradleVersion
|
|
13
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
9
14
|
}
|
|
10
15
|
}
|
|
11
16
|
|
|
17
|
+
def reactNativeArchitectures() {
|
|
18
|
+
def value = rootProject.getProperties().get("reactNativeArchitectures")
|
|
19
|
+
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
|
20
|
+
}
|
|
21
|
+
|
|
12
22
|
def isNewArchitectureEnabled() {
|
|
13
23
|
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
14
24
|
}
|
|
15
25
|
|
|
16
26
|
apply plugin: "com.android.library"
|
|
27
|
+
apply plugin: "kotlin-android"
|
|
17
28
|
|
|
18
29
|
if (isNewArchitectureEnabled()) {
|
|
19
30
|
apply plugin: "com.facebook.react"
|
|
@@ -36,6 +47,18 @@ def supportsNamespace() {
|
|
|
36
47
|
return (major == 7 && minor >= 3) || major >= 8
|
|
37
48
|
}
|
|
38
49
|
|
|
50
|
+
import groovy.json.JsonSlurper
|
|
51
|
+
|
|
52
|
+
def generatedCompat() {
|
|
53
|
+
def rnviProject = rootProject.allprojects.find { it.name == 'react-native-vector-icons_common' }
|
|
54
|
+
if (rnviProject == null) return false
|
|
55
|
+
|
|
56
|
+
def reactNativeManifest = file("${rnviProject.projectDir}/../../../react-native/package.json")
|
|
57
|
+
def reactNativeVersion = new JsonSlurper().parseText(reactNativeManifest.text).version as String
|
|
58
|
+
|
|
59
|
+
reactNativeVersion.matches('(0.71.*|0.72.*|0.73.*)')
|
|
60
|
+
}
|
|
61
|
+
|
|
39
62
|
android {
|
|
40
63
|
if (supportsNamespace()) {
|
|
41
64
|
namespace "com.reactnativevectoricons.common"
|
|
@@ -80,9 +103,18 @@ android {
|
|
|
80
103
|
if (isNewArchitectureEnabled()) {
|
|
81
104
|
java.srcDirs += [
|
|
82
105
|
"src/newarch",
|
|
83
|
-
// This is needed to build Kotlin project with NewArch enabled
|
|
84
|
-
"${project.buildDir}/generated/source/codegen/java"
|
|
85
106
|
]
|
|
107
|
+
if (!generatedCompat()) {
|
|
108
|
+
println("Adding generated directories")
|
|
109
|
+
println("Adding generated directories")
|
|
110
|
+
println("Adding generated directories")
|
|
111
|
+
// NOTE: create-react-native-library has these here but it breaks <= 0.73
|
|
112
|
+
java.srcDirs += [
|
|
113
|
+
// Codegen specs
|
|
114
|
+
"generated/java",
|
|
115
|
+
"generated/jni"
|
|
116
|
+
]
|
|
117
|
+
}
|
|
86
118
|
} else {
|
|
87
119
|
java.srcDirs += ["src/oldarch"]
|
|
88
120
|
}
|
|
@@ -95,12 +127,14 @@ repositories {
|
|
|
95
127
|
google()
|
|
96
128
|
}
|
|
97
129
|
|
|
130
|
+
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
98
131
|
|
|
99
132
|
dependencies {
|
|
100
133
|
// For < 0.71, this will be from the local maven repo
|
|
101
134
|
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
|
|
102
135
|
//noinspection GradleDynamicVersion
|
|
103
136
|
implementation "com.facebook.react:react-native:+"
|
|
137
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
104
138
|
}
|
|
105
139
|
|
|
106
140
|
if (isNewArchitectureEnabled()) {
|
|
@@ -114,7 +148,7 @@ if (isNewArchitectureEnabled()) {
|
|
|
114
148
|
android.sourceSets.main.assets.srcDirs += file("$buildDir/intermediates/RNVI")
|
|
115
149
|
|
|
116
150
|
task copyFonts(type: Exec) {
|
|
117
|
-
commandLine 'node', '../lib/commonjs/scripts/getFonts.js', rootDir.parentFile.absolutePath
|
|
151
|
+
commandLine 'node', '../lib/commonjs/scripts/getFonts.js', "${rootDir.parentFile.absolutePath}/package.json"
|
|
118
152
|
def fonts = new ByteArrayOutputStream()
|
|
119
153
|
standardOutput = fonts
|
|
120
154
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateModuleJavaSpec.js
|
|
9
|
+
*
|
|
10
|
+
* @nolint
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
package com.reactnativevectoricons.common;
|
|
14
|
+
|
|
15
|
+
import com.facebook.proguard.annotations.DoNotStrip;
|
|
16
|
+
import com.facebook.react.bridge.Promise;
|
|
17
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
18
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
19
|
+
import com.facebook.react.bridge.ReactMethod;
|
|
20
|
+
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
21
|
+
import javax.annotation.Nonnull;
|
|
22
|
+
|
|
23
|
+
public abstract class NativeVectorIconsSpec extends ReactContextBaseJavaModule implements TurboModule {
|
|
24
|
+
public static final String NAME = "VectorIcons";
|
|
25
|
+
|
|
26
|
+
public NativeVectorIconsSpec(ReactApplicationContext reactContext) {
|
|
27
|
+
super(reactContext);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@Override
|
|
31
|
+
public @Nonnull String getName() {
|
|
32
|
+
return NAME;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@ReactMethod
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
public abstract void getImageForFont(String fontFamilyName, String glyph, double fontSize, double color, Promise promise);
|
|
38
|
+
|
|
39
|
+
@ReactMethod(isBlockingSynchronousMethod = true)
|
|
40
|
+
@DoNotStrip
|
|
41
|
+
public abstract String getImageForFontSync(String fontFamilyName, String glyph, double fontSize, double color);
|
|
42
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
cmake_minimum_required(VERSION 3.13)
|
|
7
|
+
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
8
|
+
|
|
9
|
+
file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNVectorIconsSpec/*.cpp)
|
|
10
|
+
|
|
11
|
+
add_library(
|
|
12
|
+
react_codegen_RNVectorIconsSpec
|
|
13
|
+
SHARED
|
|
14
|
+
${react_codegen_SRCS}
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
target_include_directories(react_codegen_RNVectorIconsSpec PUBLIC . react/renderer/components/RNVectorIconsSpec)
|
|
18
|
+
|
|
19
|
+
target_link_libraries(
|
|
20
|
+
react_codegen_RNVectorIconsSpec
|
|
21
|
+
fbjni
|
|
22
|
+
folly_runtime
|
|
23
|
+
glog
|
|
24
|
+
jsi
|
|
25
|
+
react_codegen_rncore
|
|
26
|
+
react_debug
|
|
27
|
+
react_nativemodule_core
|
|
28
|
+
react_render_componentregistry
|
|
29
|
+
react_render_core
|
|
30
|
+
react_render_debug
|
|
31
|
+
react_render_graphics
|
|
32
|
+
react_render_imagemanager
|
|
33
|
+
react_render_mapbuffer
|
|
34
|
+
react_utils
|
|
35
|
+
rrc_image
|
|
36
|
+
rrc_view
|
|
37
|
+
turbomodulejsijni
|
|
38
|
+
yoga
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
target_compile_options(
|
|
42
|
+
react_codegen_RNVectorIconsSpec
|
|
43
|
+
PRIVATE
|
|
44
|
+
-DLOG_TAG=\"ReactNative\"
|
|
45
|
+
-fexceptions
|
|
46
|
+
-frtti
|
|
47
|
+
-std=c++20
|
|
48
|
+
-Wall
|
|
49
|
+
)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateModuleJniCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include "RNVectorIconsSpec.h"
|
|
12
|
+
|
|
13
|
+
namespace facebook::react {
|
|
14
|
+
|
|
15
|
+
static facebook::jsi::Value __hostFunction_NativeVectorIconsSpecJSI_getImageForFont(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
16
|
+
static jmethodID cachedMethodId = nullptr;
|
|
17
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "getImageForFont", "(Ljava/lang/String;Ljava/lang/String;DDLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static facebook::jsi::Value __hostFunction_NativeVectorIconsSpecJSI_getImageForFontSync(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
21
|
+
static jmethodID cachedMethodId = nullptr;
|
|
22
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, StringKind, "getImageForFontSync", "(Ljava/lang/String;Ljava/lang/String;DD)Ljava/lang/String;", args, count, cachedMethodId);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
NativeVectorIconsSpecJSI::NativeVectorIconsSpecJSI(const JavaTurboModule::InitParams ¶ms)
|
|
26
|
+
: JavaTurboModule(params) {
|
|
27
|
+
methodMap_["getImageForFont"] = MethodMetadata {4, __hostFunction_NativeVectorIconsSpecJSI_getImageForFont};
|
|
28
|
+
methodMap_["getImageForFontSync"] = MethodMetadata {4, __hostFunction_NativeVectorIconsSpecJSI_getImageForFontSync};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
std::shared_ptr<TurboModule> RNVectorIconsSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) {
|
|
32
|
+
if (moduleName == "VectorIcons") {
|
|
33
|
+
return std::make_shared<NativeVectorIconsSpecJSI>(params);
|
|
34
|
+
}
|
|
35
|
+
return nullptr;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateModuleJniH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include <ReactCommon/JavaTurboModule.h>
|
|
14
|
+
#include <ReactCommon/TurboModule.h>
|
|
15
|
+
#include <jsi/jsi.h>
|
|
16
|
+
|
|
17
|
+
namespace facebook::react {
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* JNI C++ class for module 'NativeVectorIcons'
|
|
21
|
+
*/
|
|
22
|
+
class JSI_EXPORT NativeVectorIconsSpecJSI : public JavaTurboModule {
|
|
23
|
+
public:
|
|
24
|
+
NativeVectorIconsSpecJSI(const JavaTurboModule::InitParams ¶ms);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
JSI_EXPORT
|
|
29
|
+
std::shared_ptr<TurboModule> RNVectorIconsSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms);
|
|
30
|
+
|
|
31
|
+
} // namespace facebook::react
|
package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/ComponentDescriptors.cpp
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include "ComponentDescriptors.h"
|
|
12
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
13
|
+
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
void RNVectorIconsSpec_registerComponentDescriptorsFromCodegen(
|
|
18
|
+
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
} // namespace facebook::react
|
package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/ComponentDescriptors.h
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateComponentDescriptorH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include "ShadowNodes.h"
|
|
14
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
+
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
16
|
+
|
|
17
|
+
namespace facebook::react {
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
void RNVectorIconsSpec_registerComponentDescriptorsFromCodegen(
|
|
22
|
+
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
|
23
|
+
|
|
24
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateEventEmitterCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include "EventEmitters.h"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
namespace facebook::react {
|
|
15
|
+
|
|
16
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateEventEmitterH.js
|
|
9
|
+
*/
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GeneratePropsCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include "Props.h"
|
|
12
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
13
|
+
#include <react/renderer/core/propsConversions.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GeneratePropsH.js
|
|
9
|
+
*/
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
namespace facebook::react {
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleCpp.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#include "RNVectorIconsSpecJSI.h"
|
|
11
|
+
|
|
12
|
+
namespace facebook::react {
|
|
13
|
+
|
|
14
|
+
static jsi::Value __hostFunction_NativeVectorIconsCxxSpecJSI_getImageForFont(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
15
|
+
return static_cast<NativeVectorIconsCxxSpecJSI *>(&turboModule)->getImageForFont(
|
|
16
|
+
rt,
|
|
17
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
18
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
19
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
|
|
20
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber()
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
static jsi::Value __hostFunction_NativeVectorIconsCxxSpecJSI_getImageForFontSync(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
24
|
+
return static_cast<NativeVectorIconsCxxSpecJSI *>(&turboModule)->getImageForFontSync(
|
|
25
|
+
rt,
|
|
26
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
27
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
28
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
|
|
29
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber()
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
NativeVectorIconsCxxSpecJSI::NativeVectorIconsCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
|
|
34
|
+
: TurboModule("VectorIcons", jsInvoker) {
|
|
35
|
+
methodMap_["getImageForFont"] = MethodMetadata {4, __hostFunction_NativeVectorIconsCxxSpecJSI_getImageForFont};
|
|
36
|
+
methodMap_["getImageForFontSync"] = MethodMetadata {4, __hostFunction_NativeVectorIconsCxxSpecJSI_getImageForFontSync};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
} // namespace facebook::react
|