@fortawesome/react-native-fontawesome 0.2.5 → 0.3.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/README.md +73 -62
- package/dist/components/FontAwesomeIcon.js +68 -49
- package/dist/converter.js +22 -28
- package/index.d.ts +2 -0
- package/package.json +26 -15
- package/CHANGELOG.md +0 -92
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/@fortawesome/react-native-fontawesome)
|
|
8
8
|
|
|
9
|
-
> Font Awesome
|
|
9
|
+
> Font Awesome React Native component using SVG with JS
|
|
10
10
|
|
|
11
11
|
<!-- toc -->
|
|
12
12
|
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
* [Explicit Import](#explicit-import)
|
|
22
22
|
* [Build a Library to Reference Icons Throughout Your App More Conveniently](#build-a-library-to-reference-icons-throughout-your-app-more-conveniently)
|
|
23
23
|
* [Color](#color)
|
|
24
|
-
+ [Color Prop](#color-prop)
|
|
24
|
+
+ [Color Prop](#color-prop)
|
|
25
25
|
+ [Change Color with a StyleSheet](#color-stylesheet-property)
|
|
26
|
-
* [Size](#size)
|
|
26
|
+
* [Size](#size)
|
|
27
27
|
- [Features](#features)
|
|
28
28
|
* [Duotone](#duotone)
|
|
29
29
|
* [Masking](#masking)
|
|
30
|
-
* [Power Transforms](#power-transforms)
|
|
30
|
+
* [Power Transforms](#power-transforms)
|
|
31
31
|
- [Frequent questions](#frequent-questions)
|
|
32
32
|
* [How do I import the same icon from two different styles?](#how-do-i-import-the-same-icon-from-two-different-styles)
|
|
33
33
|
* [I don't think tree-shaking is working; got any advice?](#i-dont-think-tree-shaking-is-working-got-any-advice)
|
|
@@ -42,24 +42,24 @@ Hey there! We're glad you're here...
|
|
|
42
42
|
|
|
43
43
|
#### Upgrading Font Awesome?
|
|
44
44
|
|
|
45
|
-
If you've used Font Awesome in the past (version
|
|
45
|
+
If you've used Font Awesome in the past (version 5 or older) there are some
|
|
46
46
|
things that you should learn before you dive in.
|
|
47
47
|
|
|
48
|
-
> https://fontawesome.com/
|
|
48
|
+
> https://fontawesome.com/v6/docs/web/setup/upgrade/
|
|
49
49
|
|
|
50
50
|
#### Get started
|
|
51
51
|
|
|
52
52
|
This package is for integrating with React Native. If you aren't using React Native then it's
|
|
53
53
|
not going to help you. Head over to our "Get Started" page for some guidance.
|
|
54
54
|
|
|
55
|
-
> https://fontawesome.com/
|
|
55
|
+
> https://fontawesome.com/v6/docs/web/setup/quick-start
|
|
56
56
|
|
|
57
57
|
#### Learn about our new SVG implementation
|
|
58
58
|
|
|
59
59
|
This package, under the hood, uses SVG with JS and the `@fortawesome/fontawesome-svg-core` library. This implementation differs drastically from
|
|
60
60
|
the web fonts implementation that was used in version 4 and older of Font Awesome. You might head over there to learn about how it works.
|
|
61
61
|
|
|
62
|
-
> https://fontawesome.com/
|
|
62
|
+
> https://fontawesome.com/v6/docs/web/dig-deeper/svg-core
|
|
63
63
|
|
|
64
64
|
## Installation
|
|
65
65
|
|
|
@@ -70,7 +70,7 @@ $ npm i --save @fortawesome/free-solid-svg-icons
|
|
|
70
70
|
$ npm i --save @fortawesome/react-native-fontawesome
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
** `create-react-native-app` uses Expo, which bundles `
|
|
73
|
+
** `create-react-native-app` uses Expo, which bundles `react-native-svg`. So if you're using `create-react-native-app`
|
|
74
74
|
you shouldn't try to add `react-native-svg`. At the time of writing, `create-react-native-app` bundles
|
|
75
75
|
`react-native-svg` version 6, which does not include support for SVG features such as `Mask`. In order to make use of `Mask`, make sure your dependencies have `react-native-svg` 7. The example app in this repo demonstrates.
|
|
76
76
|
|
|
@@ -92,7 +92,7 @@ $ npm i --save @fortawesome/free-brands-svg-icons
|
|
|
92
92
|
$ npm i --save @fortawesome/free-regular-svg-icons
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
If you are a [Font Awesome Pro](https://fontawesome.com/pro) subscriber you can install Pro packages; this requires [additional configuration](https://fontawesome.com/
|
|
95
|
+
If you are a [Font Awesome Pro](https://fontawesome.com/pro) subscriber you can install Pro packages; this requires [additional configuration](https://fontawesome.com/v6/docs/web/setup/packages).
|
|
96
96
|
|
|
97
97
|
```
|
|
98
98
|
$ npm i --save @fortawesome/pro-solid-svg-icons
|
|
@@ -120,13 +120,13 @@ $ yarn add @fortawesome/react-native-fontawesome
|
|
|
120
120
|
You can use Font Awesome icons in your React Native components as simply as this:
|
|
121
121
|
|
|
122
122
|
```javascript
|
|
123
|
-
<FontAwesomeIcon icon="
|
|
123
|
+
<FontAwesomeIcon icon="mug-saucer" />
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
That simple usage is made possible when you add the `"
|
|
126
|
+
That simple usage is made possible when you add the `"mug-saucer"` icon, to the
|
|
127
127
|
_library_.
|
|
128
128
|
|
|
129
|
-
This is one of the two ways you can use Font Awesome
|
|
129
|
+
This is one of the two ways you can use Font Awesome with React Native. We'll
|
|
130
130
|
summarize both ways briefly and then get into the details of each below.
|
|
131
131
|
|
|
132
132
|
1. **Explicit Import**
|
|
@@ -164,22 +164,22 @@ Now, a simple React Native component might look like this:
|
|
|
164
164
|
import React, { Component } from 'react'
|
|
165
165
|
import { View } from 'react-native'
|
|
166
166
|
import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome'
|
|
167
|
-
import {
|
|
167
|
+
import { faMugSaucer } from '@fortawesome/free-solid-svg-icons/faMugSaucer'
|
|
168
168
|
|
|
169
169
|
type Props = {}
|
|
170
170
|
export default class App extends Component<Props> {
|
|
171
171
|
render() {
|
|
172
172
|
return (
|
|
173
173
|
<View>
|
|
174
|
-
<FontAwesomeIcon icon={
|
|
174
|
+
<FontAwesomeIcon icon={ faMugSaucer } />
|
|
175
175
|
</View>
|
|
176
176
|
)
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
```
|
|
180
180
|
|
|
181
|
-
Notice that the `
|
|
182
|
-
`@fortawesome/free-solid-svg-icons` as an object and then provided to the
|
|
181
|
+
Notice that the `faMugSaucer` icon is imported from
|
|
182
|
+
`@fortawesome/free-solid-svg-icons/faMugSaucer` as an object and then provided to the
|
|
183
183
|
`icon` prop as an object.
|
|
184
184
|
|
|
185
185
|
Explicitly importing icons like this allows us to subset Font Awesome's
|
|
@@ -197,7 +197,7 @@ So, add them to the _library_. Do this setup once in some initializing module
|
|
|
197
197
|
of your app, adding all of the icons you'll use in your app's React components.
|
|
198
198
|
|
|
199
199
|
Suppose `App.js` initializes my app, including the library. For this example,
|
|
200
|
-
we'll add two individual icons, `
|
|
200
|
+
we'll add two individual icons, `faSquareCheck` and `faMugSaucer`. We also add all
|
|
201
201
|
of the brands in `@fortawesome/free-brands-svg-icons`. This example would
|
|
202
202
|
illustrate the benefits of building a library even more clearly if it involved
|
|
203
203
|
fifty or a hundred icons, but we'll keep the example brief and leave it to your
|
|
@@ -221,9 +221,10 @@ In `App.js`, where our app is initialized:
|
|
|
221
221
|
// ...
|
|
222
222
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
223
223
|
import { fab } from '@fortawesome/free-brands-svg-icons'
|
|
224
|
-
import {
|
|
224
|
+
import { faSquareCheck } from '@fortawesome/free-solid-svg-icons/faSquareCheck'
|
|
225
|
+
import { faMugEmpty } from '@fortawesome/free-solid-svg-icons/faMugEmpty'
|
|
225
226
|
|
|
226
|
-
library.add(fab,
|
|
227
|
+
library.add(fab, faSquareCheck, faMugSaucer)
|
|
227
228
|
```
|
|
228
229
|
|
|
229
230
|
OK, so what's happening here?
|
|
@@ -235,9 +236,9 @@ In our call to <span style="white-space:nowrap;">`library.add()`</span> we're pa
|
|
|
235
236
|
So any of the brand icons in that package may be referenced by icon name
|
|
236
237
|
as a string anywhere else in our app.
|
|
237
238
|
For example: `"apple"`, `"microsoft"`, or `"google"`.
|
|
238
|
-
- `
|
|
239
|
+
- `faSquareCheck` and `faMugSaucer`: Adding each of these icons individually
|
|
239
240
|
allows us to refer to them throughout our app by their icon string names,
|
|
240
|
-
`"check
|
|
241
|
+
`"square-check"` and `"mug-saucer"`, respectively.
|
|
241
242
|
|
|
242
243
|
Now, suppose you also have React Native components `Beverage` and `Gadget` in your app.
|
|
243
244
|
You don't have to re-import your icons into them. Just import the `FontAwesomeIcon`
|
|
@@ -252,8 +253,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome'
|
|
|
252
253
|
|
|
253
254
|
export const Beverage = () => (
|
|
254
255
|
<View>
|
|
255
|
-
<FontAwesomeIcon icon="check
|
|
256
|
-
<Text>Favorite beverage: </Text><FontAwesomeIcon icon="
|
|
256
|
+
<FontAwesomeIcon icon="square-check" />
|
|
257
|
+
<Text>Favorite beverage: </Text><FontAwesomeIcon icon="mug-saucer" />
|
|
257
258
|
</View>
|
|
258
259
|
)
|
|
259
260
|
```
|
|
@@ -272,7 +273,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome'
|
|
|
272
273
|
|
|
273
274
|
export const Gadget = () => (
|
|
274
275
|
<View>
|
|
275
|
-
<FontAwesomeIcon icon="check
|
|
276
|
+
<FontAwesomeIcon icon="square-check" />
|
|
276
277
|
<Text>Popular gadgets come from vendors like:</Text>
|
|
277
278
|
<FontAwesomeIcon icon={['fab', 'apple']} />
|
|
278
279
|
<FontAwesomeIcon icon={['fab', 'microsoft']} />
|
|
@@ -283,7 +284,7 @@ export const Gadget = () => (
|
|
|
283
284
|
|
|
284
285
|
Notice:
|
|
285
286
|
|
|
286
|
-
- We used the `"check
|
|
287
|
+
- We used the `"square-check"` icon name again in this component, though we
|
|
287
288
|
didn't have to explicitly import it into this component. With one explicit import of
|
|
288
289
|
that icon in `App.js`, and adding it to the library, we've managed to use
|
|
289
290
|
it by name in multiple components.
|
|
@@ -296,10 +297,10 @@ Notice:
|
|
|
296
297
|
Adding a prefix—and the syntax we used to do it—are new. So what's
|
|
297
298
|
going on here?
|
|
298
299
|
|
|
299
|
-
First, recall when we introduced `<FontAwesomeIcon icon="
|
|
300
|
-
that a prefix of `fas` was being added to `"
|
|
300
|
+
First, recall when we introduced `<FontAwesomeIcon icon="mug-saucer"/>` and learned
|
|
301
|
+
that a prefix of `fas` was being added to `"mug-saucer"` by default.
|
|
301
302
|
|
|
302
|
-
The `"check
|
|
303
|
+
The `"square-check"` icon is getting a default prefix of `fas` here too, which
|
|
303
304
|
is what we want, because that icon also lives in the
|
|
304
305
|
`@fortawesome/free-solid-svg-icons` package.
|
|
305
306
|
|
|
@@ -314,8 +315,8 @@ Now, what about that syntax?
|
|
|
314
315
|
|
|
315
316
|
The `icon` prop expects a single object:
|
|
316
317
|
|
|
317
|
-
- It could be an icon object, like `{
|
|
318
|
-
- It could a string object, like `"
|
|
318
|
+
- It could be an icon object, like `{faMugSaucer}`.
|
|
319
|
+
- It could a string object, like `"mug-saucer"`.
|
|
319
320
|
(The curly braces around a string object supplied to a prop are optional,
|
|
320
321
|
so we've omitted them.)
|
|
321
322
|
- Or it could be an `Array` of strings, where the first element is a prefix,
|
|
@@ -335,7 +336,7 @@ Using the color prop should be preferred over using the StyleSheet.
|
|
|
335
336
|
#### Color Prop
|
|
336
337
|
|
|
337
338
|
```javascript
|
|
338
|
-
<FontAwesomeIcon icon={
|
|
339
|
+
<FontAwesomeIcon icon={ faMugSaucer } color={ 'red' } />
|
|
339
340
|
```
|
|
340
341
|
|
|
341
342
|
#### Color StyleSheet property
|
|
@@ -346,8 +347,7 @@ To set the color of an icon, provide a `StyleSheet` like this:
|
|
|
346
347
|
import React, { Component } from 'react'
|
|
347
348
|
import { View, StyleSheet } from 'react-native'
|
|
348
349
|
import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome'
|
|
349
|
-
import {
|
|
350
|
-
|
|
350
|
+
import { faMugSaucer } from '@fortawesome/free-solid-svg-icons/faMugSaucer'
|
|
351
351
|
|
|
352
352
|
type Props = {}
|
|
353
353
|
|
|
@@ -361,7 +361,7 @@ export default class App extends Component<Props> {
|
|
|
361
361
|
render() {
|
|
362
362
|
return (
|
|
363
363
|
<View>
|
|
364
|
-
<FontAwesomeIcon icon={
|
|
364
|
+
<FontAwesomeIcon icon={ faMugSaucer } style={ style.icon } />
|
|
365
365
|
</View>
|
|
366
366
|
)
|
|
367
367
|
}
|
|
@@ -375,7 +375,7 @@ Default: 16
|
|
|
375
375
|
To adjust the size, use the `size` prop:
|
|
376
376
|
|
|
377
377
|
```javascript
|
|
378
|
-
<FontAwesomeIcon icon={
|
|
378
|
+
<FontAwesomeIcon icon={ faMugSaucer } size={ 32 } />
|
|
379
379
|
```
|
|
380
380
|
|
|
381
381
|
Note: the `height` and `width` props have been deprecated.
|
|
@@ -385,7 +385,7 @@ Note: the `height` and `width` props have been deprecated.
|
|
|
385
385
|
### Duotone
|
|
386
386
|
|
|
387
387
|
```javascript
|
|
388
|
-
<FontAwesomeIcon icon="
|
|
388
|
+
<FontAwesomeIcon icon="mug-saucer" color="blue" secondaryColor="red" secondaryOpacity={ 0.4 } />
|
|
389
389
|
```
|
|
390
390
|
|
|
391
391
|
You can specify the color and opacity for Duotone's secondary layer using the `secondaryColor` and `secondaryOpacity` props. Note that these are optional, and will simply default to using your primary color at 40% opacity.
|
|
@@ -393,19 +393,19 @@ You can specify the color and opacity for Duotone's secondary layer using the `s
|
|
|
393
393
|
### Masking
|
|
394
394
|
|
|
395
395
|
```javascript
|
|
396
|
-
<FontAwesomeIcon icon="
|
|
396
|
+
<FontAwesomeIcon icon="mug-saucer" mask={['far', 'circle']} />
|
|
397
397
|
```
|
|
398
398
|
|
|
399
|
-
[More on masking...](https://fontawesome.com/
|
|
399
|
+
[More on masking...](https://fontawesome.com/v6/docs/web/style/mask#contentHeader)
|
|
400
400
|
|
|
401
401
|
### Power Transforms
|
|
402
402
|
|
|
403
403
|
```javascript
|
|
404
|
-
<FontAwesomeIcon icon="arrows" transform="shrink-6 left-4" />
|
|
405
|
-
<FontAwesomeIcon icon="arrow-
|
|
404
|
+
<FontAwesomeIcon icon="arrows-up-down-left-right" transform="shrink-6 left-4" />
|
|
405
|
+
<FontAwesomeIcon icon="arrow-right" transform={{ rotate: 42 }} />
|
|
406
406
|
```
|
|
407
407
|
|
|
408
|
-
[More on power transforms...](https://fontawesome.com/
|
|
408
|
+
[More on power transforms...](https://fontawesome.com/v6/docs/web/style/power-transform#contentHeader)
|
|
409
409
|
|
|
410
410
|
## Frequent questions
|
|
411
411
|
|
|
@@ -415,15 +415,35 @@ With ES modules and `import` statements we can rename:
|
|
|
415
415
|
|
|
416
416
|
```javascript
|
|
417
417
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
418
|
-
import { faStroopwafel as fasFaStroopwafel } from '@fortawesome/pro-solid-svg-icons'
|
|
419
|
-
import { faStroopwafel as farFaStroopwafel } from '@fortawesome/pro-regular-svg-icons'
|
|
418
|
+
import { faStroopwafel as fasFaStroopwafel } from '@fortawesome/pro-solid-svg-icons/faStroopwafel'
|
|
419
|
+
import { faStroopwafel as farFaStroopwafel } from '@fortawesome/pro-regular-svg-icons/faStroopwafel'
|
|
420
420
|
|
|
421
421
|
library.add(fasFaStroopwafel, farFaStroopwafel)
|
|
422
422
|
```
|
|
423
423
|
|
|
424
424
|
### I don't think tree-shaking is working; got any advice?
|
|
425
425
|
|
|
426
|
-
Check out our [docs here](https://fontawesome.com/
|
|
426
|
+
Check out our [docs here](https://fontawesome.com/v6/docs/apis/javascript/tree-shaking).
|
|
427
|
+
|
|
428
|
+
If you find that your build times are taking forever, check the way that you are importing icons.
|
|
429
|
+
|
|
430
|
+
In past versions of `react-native-fontawesome` we've documented importing icons like this:
|
|
431
|
+
|
|
432
|
+
```javascript
|
|
433
|
+
import { faStroopwafel } from '@fortawesome/pro-solid-svg-icons'
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
This can cause build times for your project to skyrocket because React Native is trying to tree shake. The Font Awesome
|
|
437
|
+
packages are so large that we _highly_ recommend that you avoid this.
|
|
438
|
+
|
|
439
|
+
Instead, use "deep imports" by default.
|
|
440
|
+
|
|
441
|
+
```javascript
|
|
442
|
+
import { faStroopwafel } from '@fortawesome/pro-solid-svg-icons/faStroopwafel' // <- notice the additional module here?
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
By directly importing from the `faStroopwafel.js` module there is no additional work that tree shaking needs to do in order to
|
|
446
|
+
reduce your bundle size.
|
|
427
447
|
|
|
428
448
|
## How to Help
|
|
429
449
|
|
|
@@ -440,20 +460,11 @@ And then:
|
|
|
440
460
|
|
|
441
461
|
Community:
|
|
442
462
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
|
446
|
-
|
|
|
447
|
-
|
|
|
448
|
-
|
|
|
449
|
-
|
|
|
450
|
-
|
|
|
451
|
-
|
|
452
|
-
The Font Awesome team:
|
|
453
|
-
|
|
454
|
-
| | Name | GitHub |
|
|
455
|
-
| :--------------------------------------------------------: | -------------- | -------------------------------------------------- |
|
|
456
|
-
| <img src="https://github.com/supercodepoet.png?size=72" /> | Travis Chase | [@supercodepoet](https://github.com/supercodepoet) |
|
|
457
|
-
| <img src="https://github.com/robmadole.png?size=72" /> | Rob Madole | [@robmadole](https://github.com/robmadole) |
|
|
458
|
-
| <img src="https://github.com/mlwilkerson.png?size=72" /> | Mike Wilkerson | [@mlwilkerson](https://github.com/mlwilkerson) |
|
|
459
|
-
| <img src="https://github.com/talbs.png?size=72" /> | Brian Talbot | [@talbs](https://github.com/talbs) |
|
|
463
|
+
| Name | GitHub |
|
|
464
|
+
| ----------------- | --------------------------------------------------------- |
|
|
465
|
+
| Dizy | [@dizy](https://github.com/dizy) |
|
|
466
|
+
| David Martin | [@iamdavidmartin](https://github.com/iamdavidmartin) |
|
|
467
|
+
| Jeremey | [@puremana](https://github.com/puremana) |
|
|
468
|
+
| Michael Schonfeld | [@schonfeld](https://github.com/schonfeld) |
|
|
469
|
+
| Ádám Gólya | [@golya](https://github.com/golya) |
|
|
470
|
+
| Font Awesome Team | [@FortAwesome](https://github.com/orgs/FortAwesome/people)|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.DEFAULT_SIZE = exports.DEFAULT_SECONDARY_OPACITY = exports.DEFAULT_COLOR = void 0;
|
|
6
7
|
exports["default"] = FontAwesomeIcon;
|
|
7
|
-
exports.DEFAULT_SECONDARY_OPACITY = exports.DEFAULT_COLOR = exports.DEFAULT_SIZE = void 0;
|
|
8
8
|
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
|
|
@@ -18,45 +18,44 @@ var _fontawesomeSvgCore = require("@fortawesome/fontawesome-svg-core");
|
|
|
18
18
|
|
|
19
19
|
var _logger = _interopRequireDefault(require("../logger"));
|
|
20
20
|
|
|
21
|
+
var _excluded = ["color"];
|
|
22
|
+
|
|
21
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
22
24
|
|
|
23
25
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
24
26
|
|
|
25
27
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
26
28
|
|
|
27
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
29
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
28
30
|
|
|
29
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
31
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
30
32
|
|
|
31
|
-
function _typeof(obj) {
|
|
33
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
32
34
|
|
|
33
35
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
34
36
|
|
|
35
|
-
var _Dimensions$get = _reactNative.Dimensions.get('window'),
|
|
36
|
-
windowWidth = _Dimensions$get.width,
|
|
37
|
-
windowHeight = _Dimensions$get.height;
|
|
38
|
-
|
|
39
37
|
var DEFAULT_SIZE = 16;
|
|
40
38
|
exports.DEFAULT_SIZE = DEFAULT_SIZE;
|
|
41
39
|
var DEFAULT_COLOR = '#000';
|
|
42
40
|
exports.DEFAULT_COLOR = DEFAULT_COLOR;
|
|
43
|
-
var DEFAULT_SECONDARY_OPACITY = 0.4;
|
|
44
|
-
|
|
41
|
+
var DEFAULT_SECONDARY_OPACITY = 0.4;
|
|
45
42
|
exports.DEFAULT_SECONDARY_OPACITY = DEFAULT_SECONDARY_OPACITY;
|
|
46
|
-
var DEFAULT_HEIGHT = windowHeight * 0.1;
|
|
47
|
-
var DEFAULT_WIDTH = windowWidth * 0.1;
|
|
48
43
|
|
|
49
44
|
function objectWithKey(key, value) {
|
|
50
45
|
return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? _defineProperty({}, key, value) : {};
|
|
51
46
|
}
|
|
52
47
|
|
|
53
48
|
function normalizeIconArgs(icon) {
|
|
54
|
-
if (icon ===
|
|
55
|
-
return
|
|
49
|
+
if (icon && _typeof(icon) === 'object' && icon.prefix && icon.iconName && icon.icon) {
|
|
50
|
+
return icon;
|
|
56
51
|
}
|
|
57
52
|
|
|
58
|
-
if (
|
|
59
|
-
return icon;
|
|
53
|
+
if (_fontawesomeSvgCore.parse.icon) {
|
|
54
|
+
return _fontawesomeSvgCore.parse.icon(icon);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (icon === null) {
|
|
58
|
+
return null;
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
if (Array.isArray(icon) && icon.length === 2) {
|
|
@@ -77,6 +76,7 @@ function normalizeIconArgs(icon) {
|
|
|
77
76
|
function FontAwesomeIcon(props) {
|
|
78
77
|
var iconArgs = props.icon,
|
|
79
78
|
maskArgs = props.mask,
|
|
79
|
+
maskId = props.maskId,
|
|
80
80
|
height = props.height,
|
|
81
81
|
width = props.width,
|
|
82
82
|
size = props.size;
|
|
@@ -86,10 +86,12 @@ function FontAwesomeIcon(props) {
|
|
|
86
86
|
var iconLookup = normalizeIconArgs(iconArgs);
|
|
87
87
|
var transform = objectWithKey('transform', typeof props.transform === 'string' ? _fontawesomeSvgCore.parse.transform(props.transform) : props.transform);
|
|
88
88
|
var mask = objectWithKey('mask', normalizeIconArgs(maskArgs));
|
|
89
|
-
var renderedIcon = (0, _fontawesomeSvgCore.icon)(iconLookup, _objectSpread({}, transform, {},
|
|
89
|
+
var renderedIcon = (0, _fontawesomeSvgCore.icon)(iconLookup, _objectSpread(_objectSpread(_objectSpread({}, transform), mask), {}, {
|
|
90
|
+
maskId: maskId
|
|
91
|
+
}));
|
|
90
92
|
|
|
91
93
|
if (!renderedIcon) {
|
|
92
|
-
(0, _logger["default"])(
|
|
94
|
+
(0, _logger["default"])('ERROR: icon not found for icon = ', iconArgs);
|
|
93
95
|
return null;
|
|
94
96
|
}
|
|
95
97
|
|
|
@@ -98,44 +100,29 @@ function FontAwesomeIcon(props) {
|
|
|
98
100
|
var color = props.color || style.color || DEFAULT_COLOR; // This is the color that will be passed to the "fill" prop of the secondary Path element child (in Duotone Icons)
|
|
99
101
|
// `null` value will result in using the primary color, at 40% opacity
|
|
100
102
|
|
|
101
|
-
var secondaryColor = props.secondaryColor ||
|
|
103
|
+
var secondaryColor = props.secondaryColor || color; // Secondary layer opacity should default to 0.4, unless a specific opacity value or a specific secondary color was given
|
|
102
104
|
|
|
103
|
-
var secondaryOpacity = props.secondaryOpacity ||
|
|
105
|
+
var secondaryOpacity = props.secondaryOpacity || DEFAULT_SECONDARY_OPACITY; // To avoid confusion down the line, we'll remove properties from the StyleSheet, like color, that are being overridden
|
|
104
106
|
// or resolved in other ways, to avoid ambiguity as to which inputs cause which outputs in the underlying rendering process.
|
|
105
107
|
// In other words, we don't want color (for example) to be specified via two different inputs.
|
|
106
108
|
|
|
107
109
|
var styleColor = style.color,
|
|
108
|
-
modifiedStyle = _objectWithoutProperties(style,
|
|
110
|
+
modifiedStyle = _objectWithoutProperties(style, _excluded);
|
|
109
111
|
|
|
110
112
|
var resolvedHeight, resolvedWidth;
|
|
111
113
|
|
|
112
114
|
if (height || width) {
|
|
113
|
-
|
|
114
|
-
console.warn("DEPRECATION: height and width props on ".concat(FontAwesomeIcon.displayName, " have been deprecated. ") + "Since you've also provided a size prop, we'll use it to override the height and width props given. " + "You should probably go ahead and remove the height and width props to avoid confusion and resolve this warning.");
|
|
115
|
-
resolvedHeight = resolvedWidth = size;
|
|
116
|
-
} else {
|
|
117
|
-
console.warn("DEPRECATION: height and width props on ".concat(FontAwesomeIcon.displayName, " have been deprecated. ") + "Use the size prop instead.");
|
|
118
|
-
resolvedHeight = height || DEFAULT_HEIGHT;
|
|
119
|
-
resolvedWidth = width || DEFAULT_WIDTH;
|
|
120
|
-
}
|
|
115
|
+
throw new Error("Prop height and width for component ".concat(FontAwesomeIcon.displayName, " have been deprecated. ") + "Use the size prop instead like <".concat(FontAwesomeIcon.displayName, " size={").concat(width, "} />."));
|
|
121
116
|
} else {
|
|
122
117
|
resolvedHeight = resolvedWidth = size || DEFAULT_SIZE;
|
|
123
118
|
}
|
|
124
119
|
|
|
125
|
-
var
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
style: modifiedStyle
|
|
132
|
-
};
|
|
133
|
-
Object.keys(props).forEach(function (key) {
|
|
134
|
-
if (!FontAwesomeIcon.defaultProps.hasOwnProperty(key)) {
|
|
135
|
-
extraProps[key] = props[key];
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
return convertCurry(_abstract[0], extraProps);
|
|
120
|
+
var rootAttributes = _abstract[0].attributes;
|
|
121
|
+
rootAttributes.height = resolvedHeight;
|
|
122
|
+
rootAttributes.width = resolvedWidth;
|
|
123
|
+
rootAttributes.style = modifiedStyle;
|
|
124
|
+
replaceCurrentColor(_abstract[0], color, secondaryColor, secondaryOpacity);
|
|
125
|
+
return convertCurry(_abstract[0]);
|
|
139
126
|
}
|
|
140
127
|
|
|
141
128
|
FontAwesomeIcon.displayName = 'FontAwesomeIcon';
|
|
@@ -146,23 +133,55 @@ FontAwesomeIcon.propTypes = {
|
|
|
146
133
|
color: _propTypes["default"].string,
|
|
147
134
|
secondaryColor: _propTypes["default"].string,
|
|
148
135
|
secondaryOpacity: _propTypes["default"].number,
|
|
149
|
-
style: _propTypes["default"].oneOfType([_propTypes["default"].shape(
|
|
136
|
+
style: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
137
|
+
style: _propTypes["default"].any
|
|
138
|
+
}), _propTypes["default"].array]),
|
|
150
139
|
icon: _propTypes["default"].oneOfType([_propTypes["default"].object, _propTypes["default"].array, _propTypes["default"].string]),
|
|
151
140
|
mask: _propTypes["default"].oneOfType([_propTypes["default"].object, _propTypes["default"].array, _propTypes["default"].string]),
|
|
141
|
+
maskId: _propTypes["default"].string,
|
|
152
142
|
transform: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].object])
|
|
153
143
|
};
|
|
154
144
|
FontAwesomeIcon.defaultProps = {
|
|
155
145
|
icon: null,
|
|
156
146
|
mask: null,
|
|
147
|
+
maskId: null,
|
|
157
148
|
transform: null,
|
|
158
149
|
style: {},
|
|
159
150
|
color: null,
|
|
160
151
|
secondaryColor: null,
|
|
161
152
|
secondaryOpacity: null,
|
|
162
|
-
|
|
163
|
-
width: undefined // Once the deprecation of height and width props is complete, let's put the real default prop value for size here.
|
|
164
|
-
// For now, adding it breaks the default/override logic for height/width/size.
|
|
165
|
-
|
|
153
|
+
size: DEFAULT_SIZE
|
|
166
154
|
};
|
|
167
155
|
|
|
168
|
-
var convertCurry = _converter["default"].bind(null, _react["default"].createElement);
|
|
156
|
+
var convertCurry = _converter["default"].bind(null, _react["default"].createElement);
|
|
157
|
+
|
|
158
|
+
function replaceCurrentColor(obj, primaryColor, secondaryColor, secondaryOpacity) {
|
|
159
|
+
obj.children.forEach(function (child, childIndex) {
|
|
160
|
+
replaceFill(child, primaryColor, secondaryColor, secondaryOpacity);
|
|
161
|
+
|
|
162
|
+
if (Object.prototype.hasOwnProperty.call(child, 'attributes')) {
|
|
163
|
+
replaceFill(child.attributes, primaryColor, secondaryColor, secondaryOpacity);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (Array.isArray(child.children) && child.children.length > 0) {
|
|
167
|
+
replaceCurrentColor(child, primaryColor, secondaryColor, secondaryOpacity);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function replaceFill(obj, primaryColor, secondaryColor, secondaryOpacity) {
|
|
173
|
+
if (hasPropertySetToValue(obj, 'fill', 'currentColor')) {
|
|
174
|
+
if (hasPropertySetToValue(obj, 'class', 'fa-primary')) {
|
|
175
|
+
obj.fill = primaryColor;
|
|
176
|
+
} else if (hasPropertySetToValue(obj, 'class', 'fa-secondary')) {
|
|
177
|
+
obj.fill = secondaryColor;
|
|
178
|
+
obj.fillOpacity = secondaryOpacity;
|
|
179
|
+
} else {
|
|
180
|
+
obj.fill = primaryColor;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function hasPropertySetToValue(obj, property, value) {
|
|
186
|
+
return Object.prototype.hasOwnProperty.call(obj, property) && obj[property] === value;
|
|
187
|
+
}
|
package/dist/converter.js
CHANGED
|
@@ -11,46 +11,41 @@ var _reactNativeSvg = require("react-native-svg");
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
13
|
|
|
14
|
-
function
|
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
15
|
|
|
16
|
-
function
|
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
17
|
|
|
18
|
-
function
|
|
18
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
19
|
|
|
20
|
-
function
|
|
20
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
21
21
|
|
|
22
|
-
function
|
|
22
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
23
23
|
|
|
24
|
-
function
|
|
24
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
25
25
|
|
|
26
|
-
function
|
|
26
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
27
|
+
|
|
28
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
29
|
+
|
|
30
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
27
31
|
|
|
28
32
|
var svgObjectMap = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
svg: _reactNativeSvg.Svg,
|
|
34
|
+
path: _reactNativeSvg.Path,
|
|
35
|
+
rect: _reactNativeSvg.Rect,
|
|
36
|
+
defs: _reactNativeSvg.Defs,
|
|
37
|
+
mask: _reactNativeSvg.Mask,
|
|
38
|
+
g: _reactNativeSvg.G,
|
|
39
|
+
clipPath: _reactNativeSvg.ClipPath
|
|
36
40
|
};
|
|
37
41
|
|
|
38
42
|
function convert(createElement, element) {
|
|
39
|
-
var extraProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
40
|
-
|
|
41
43
|
if (typeof element === 'string') {
|
|
42
44
|
return element;
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
var isDuotone = (element.children || []).length === 2;
|
|
46
47
|
var children = (element.children || []).map(function (child, childIndex) {
|
|
47
|
-
|
|
48
|
-
var fill = isDuotoneSecondLayer ? extraProps.secondaryFill : extraProps.fill;
|
|
49
|
-
var fillOpacity = isDuotoneSecondLayer ? extraProps.secondaryOpacity : 1;
|
|
50
|
-
return convert(createElement, child, _objectSpread({}, extraProps, {
|
|
51
|
-
fill: fill,
|
|
52
|
-
fillOpacity: fillOpacity
|
|
53
|
-
}));
|
|
48
|
+
return convert(createElement, child);
|
|
54
49
|
});
|
|
55
50
|
var mixins = Object.keys(element.attributes || {}).reduce(function (acc, key) {
|
|
56
51
|
var val = element.attributes[key];
|
|
@@ -58,17 +53,16 @@ function convert(createElement, element) {
|
|
|
58
53
|
switch (key) {
|
|
59
54
|
case 'class':
|
|
60
55
|
case 'role':
|
|
61
|
-
case 'style':
|
|
62
56
|
case 'xmlns':
|
|
63
57
|
delete element.attributes[key];
|
|
64
58
|
break;
|
|
65
59
|
|
|
66
60
|
case 'focusable':
|
|
67
|
-
acc.attrs[key] = val === 'true'
|
|
61
|
+
acc.attrs[key] = val === 'true';
|
|
68
62
|
break;
|
|
69
63
|
|
|
70
64
|
default:
|
|
71
|
-
if (key.indexOf('aria-') === 0 || key.indexOf('data-') === 0 || 'fill'
|
|
65
|
+
if (key.indexOf('aria-') === 0 || key.indexOf('data-') === 0 || key === 'fill' && val === 'currentColor') {
|
|
72
66
|
delete element.attributes[key];
|
|
73
67
|
} else {
|
|
74
68
|
acc.attrs[_humps["default"].camelize(key)] = val;
|
|
@@ -80,7 +74,7 @@ function convert(createElement, element) {
|
|
|
80
74
|
}, {
|
|
81
75
|
attrs: {}
|
|
82
76
|
});
|
|
83
|
-
return createElement.apply(void 0, [svgObjectMap[element.tag], _objectSpread({}, mixins.attrs
|
|
77
|
+
return createElement.apply(void 0, [svgObjectMap[element.tag], _objectSpread({}, mixins.attrs)].concat(_toConsumableArray(children)));
|
|
84
78
|
}
|
|
85
79
|
|
|
86
80
|
var _default = convert;
|
package/index.d.ts
CHANGED
|
@@ -20,8 +20,10 @@ export interface Props {
|
|
|
20
20
|
secondaryColor?: string;
|
|
21
21
|
secondaryOpacity?: number;
|
|
22
22
|
mask?: IconProp;
|
|
23
|
+
maskId?: string;
|
|
23
24
|
transform?: string | Transform;
|
|
24
25
|
style?: FontAwesomeIconStyle;
|
|
26
|
+
testID?: string;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
export function FontAwesomeIcon(props: Props): JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fortawesome/react-native-fontawesome",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Official React Native component for Font Awesome
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Official React Native component for Font Awesome",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"test": "jest",
|
|
8
|
-
"
|
|
7
|
+
"test": "jest --forceExit",
|
|
8
|
+
"lint": "eslint src",
|
|
9
|
+
"dist:watch": "babel --watch --config-file ./babel.dist.config.js src --ignore src/components/__tests__ --out-dir dist",
|
|
10
|
+
"dist": "babel --config-file ./babel.dist.config.js src --ignore src/components/__tests__ --ignore src/components/__fixtures__ --out-dir dist",
|
|
9
11
|
"set.rnsvg": "yarn upgrade react-native-svg@$RNSVG_VERSION"
|
|
10
12
|
},
|
|
11
13
|
"types": "index.d.ts",
|
|
@@ -21,14 +23,16 @@
|
|
|
21
23
|
"Dizy <mhisf@vip.qq.com>",
|
|
22
24
|
"David Martin <github.com/iamdavidmartin>",
|
|
23
25
|
"Jeremy <github.com/puremana>",
|
|
24
|
-
"Michael Schonfeld <github.com/schonfeld>"
|
|
26
|
+
"Michael Schonfeld <github.com/schonfeld>",
|
|
27
|
+
"Ádám Gólya <github.com/golya>",
|
|
28
|
+
"Edward Emanuel <github.com/ej2>",
|
|
29
|
+
"Jason Lundien <github.com/jasonlundien>"
|
|
25
30
|
],
|
|
26
31
|
"license": "MIT",
|
|
27
32
|
"peerDependencies": {
|
|
28
|
-
"@fortawesome/fontawesome-svg-core": "
|
|
29
|
-
"react": "
|
|
30
|
-
"react-native": "
|
|
31
|
-
"react-native-svg": "> 7.0"
|
|
33
|
+
"@fortawesome/fontawesome-svg-core": "~1 || ~6",
|
|
34
|
+
"react-native": ">= 0.67",
|
|
35
|
+
"react-native-svg": ">= 11.x"
|
|
32
36
|
},
|
|
33
37
|
"devDependencies": {
|
|
34
38
|
"@babel/cli": "^7.7.5",
|
|
@@ -36,15 +40,22 @@
|
|
|
36
40
|
"@babel/preset-env": "^7.7.6",
|
|
37
41
|
"@babel/preset-react": "^7.7.4",
|
|
38
42
|
"@babel/runtime": "^7.7.6",
|
|
39
|
-
"@fortawesome/fontawesome-svg-core": "^
|
|
43
|
+
"@fortawesome/fontawesome-svg-core": "^6",
|
|
40
44
|
"babel-core": "^7.0.0-bridge",
|
|
41
45
|
"babel-jest": "^24.9.0",
|
|
42
|
-
"
|
|
46
|
+
"eslint": "^8.16.0",
|
|
47
|
+
"eslint-config-standard": "^17.0.0",
|
|
48
|
+
"eslint-plugin-import": "^2.26.0",
|
|
49
|
+
"eslint-plugin-jest": "^26.2.2",
|
|
50
|
+
"eslint-plugin-n": "^15.2.0",
|
|
51
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
52
|
+
"eslint-plugin-react": "^7.30.0",
|
|
53
|
+
"jest": "^28.1.0",
|
|
43
54
|
"metro-react-native-babel-preset": "^0.57.0",
|
|
44
|
-
"react": "
|
|
45
|
-
"react-native": "^0.
|
|
46
|
-
"react-native-svg": "^
|
|
47
|
-
"react-test-renderer": "^
|
|
55
|
+
"react": "^17",
|
|
56
|
+
"react-native": "^0.68.0",
|
|
57
|
+
"react-native-svg": "^12.3.0",
|
|
58
|
+
"react-test-renderer": "^17"
|
|
48
59
|
},
|
|
49
60
|
"dependencies": {
|
|
50
61
|
"humps": "^2.0.1",
|
package/CHANGELOG.md
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## [0.2.5](https://github.com/FortAwesome/react-native-fontawesome/releases/tag/0.2.5) - 2020-05-14
|
|
10
|
-
|
|
11
|
-
### Added
|
|
12
|
-
|
|
13
|
-
- Support for Duotone icons #59
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## [0.2.4](https://github.com/FortAwesome/react-native-fontawesome/releases/tag/0.2.4) - 2020-04-27
|
|
18
|
-
|
|
19
|
-
### Fixed
|
|
20
|
-
|
|
21
|
-
- Loosen peerDependencies versions to allow newer react-native and react-native-svg packages
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## [0.2.3](https://github.com/FortAwesome/react-native-fontawesome/releases/tag/0.2.3) - 2020-03-06
|
|
26
|
-
|
|
27
|
-
### Fixed
|
|
28
|
-
|
|
29
|
-
- Support arrays in style property #28 #40 #46
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## [0.2.2](https://github.com/FortAwesome/react-native-fontawesome/releases/tag/0.2.2) - 2020-02-17
|
|
34
|
-
|
|
35
|
-
### Fixed
|
|
36
|
-
|
|
37
|
-
- Add index.d.ts to the package.json files
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
## [0.2.1](https://github.com/FortAwesome/react-native-fontawesome/releases/tag/0.2.1) - 2020-02-06
|
|
42
|
-
|
|
43
|
-
### Fixed
|
|
44
|
-
|
|
45
|
-
- Convert 'focusable' attribute to boolean from string #42
|
|
46
|
-
|
|
47
|
-
## [0.2.0](https://github.com/FortAwesome/react-native-fontawesome/releases/tag/0.2.0) - 2019-12-13
|
|
48
|
-
|
|
49
|
-
### Added
|
|
50
|
-
|
|
51
|
-
- TypeScript definition file #17
|
|
52
|
-
|
|
53
|
-
### Changed
|
|
54
|
-
|
|
55
|
-
- Loosened peer dependencies to prevent incorrect version warnings
|
|
56
|
-
|
|
57
|
-
## [0.1.0](https://github.com/FortAwesome/react-native-fontawesome/releases/tag/0.1.0) - 2019-01-07
|
|
58
|
-
|
|
59
|
-
### Changed
|
|
60
|
-
|
|
61
|
-
- Add color prop
|
|
62
|
-
-- Delete color property on style object after resolving the fill color to avoid ambiguity
|
|
63
|
-
-- Remove any fill="currentColor" attributes returned by fontawesome-svg-core
|
|
64
|
-
|
|
65
|
-
- Add size prop
|
|
66
|
-
-- Deprecate height and width props
|
|
67
|
-
|
|
68
|
-
## [0.0.4](https://github.com/FortAwesome/react-native-fontawesome/releases/tag/0.0.4) - 2018-10-13
|
|
69
|
-
|
|
70
|
-
### Changed
|
|
71
|
-
|
|
72
|
-
- Internal clean-up, leveraging recent developments in react-native-svg
|
|
73
|
-
|
|
74
|
-
## [0.0.3](https://github.com/FortAwesome/react-native-fontawesome/releases/tag/0.0.3) - 2018-10-11
|
|
75
|
-
|
|
76
|
-
### Added
|
|
77
|
-
|
|
78
|
-
- Add support for masking and power transforms
|
|
79
|
-
|
|
80
|
-
## [0.0.2](https://github.com/FortAwesome/react-native-fontawesome/releases/tag/0.0.2) - 2018-10-11
|
|
81
|
-
|
|
82
|
-
### Added
|
|
83
|
-
|
|
84
|
-
- Add style prop with initial special-case support for setting icon color
|
|
85
|
-
|
|
86
|
-
- Re-initialize example app to allow for using it with `react-native-svg` 7.x
|
|
87
|
-
|
|
88
|
-
## [0.0.1](https://github.com/FortAwesome/react-native-fontawesome/releases/tag/0.0.1) - 2018-10-08
|
|
89
|
-
|
|
90
|
-
### Added
|
|
91
|
-
|
|
92
|
-
- Initial, minimal implementation, based on [@fortawesome/react-fontawesome](https://github.com/FortAwesome/react-fontawesome/)
|