193 Commits

Author SHA1 Message Date
Jakub Grzywacz
0c4f58d9f5 refactor: rename example to paper-example (#2509)
# Summary

Rename example app to match the pattern.
2024-10-25 17:15:00 +02:00
Jakub Grzywacz
451e681fed docs: add entry to supported react-native version (#2495)
# Summary

`react-native-svg@15.8.0` requires `react-native@0.73.0+` or above.
2024-10-17 14:42:39 +02:00
MrAdib
967886d40c docs: broken link in the readme file (#2443)
- simple fix for the example link in the root readme of the project
- removed todo link as it's not exist anymore in the readme
2024-09-10 13:58:44 +02:00
Jakub Grzywacz
08e92074b4 feat: filters support FeColorMatrix and FilterImage (#2316)
# Summary

Introducing the long-awaited **Filters** in `react-native-svg` 🎉

### Motivation

This PR is the beginning of bringing support of SVG Filters into
`react-native-svg`.

* **related issues**: This PR series will address the following issues:
#150, #176, #635, #883, #994, #996, #1216
* **feature overview**: This PR is a boilerplate for Filters
   * introducing `Filter` component and `FeColorMatrix` as a start. 
* It also introduces a new subdirectory called
`react-native-svg/filter-image` with a `FilterImage` component.

# Usage

## Filter and Fe...

Filters are compatible with the web familiar standard, so most things
should be compatible out-of-the-box and changes will be limited to using
a capital letter as it's component.

### Example

```tsx
import React from 'react';
import { FeColorMatrix, Filter, Rect, Svg } from 'react-native-svg';

export default () => {
  return (
    <Svg height="300" width="300">
      <Filter id="myFilter">
        <FeColorMatrix type="saturate" values="0.2" />
      </Filter>
      <Rect
        x="0"
        y="0"
        width="300"
        height="300"
        fill="red"
        filter="url(#myFilter)"
      />
    </Svg>
  );
};
```

![image](https://github.com/software-mansion/react-native-svg/assets/39670088/c36fb238-95f4-455d-b0aa-2a7d4038b828)

## Filter Image

`FilterImage` is a new component that is not strictly related to SVG.
Its behavior should be the same as a regular `Image` component from
React Native with one exception - the additional prop `filters`, which
accepts an array of filters to apply to the image.

### Example

```tsx
import React from 'react';
import { StyleSheet } from 'react-native';
import { FilterImage } from 'react-native-svg/filter-image';

const myImage = require('./myImage.jpg');

export default () => {
  return (
    <FilterImage
      style={styles.image}
      source={myImage}
      filters={[
        { name: 'colorMatrix', type: 'saturate', values: 0.2 },
        {
          name: 'colorMatrix',
          type: 'matrix',
          values: [
            0.2, 0.2, 0.2, 0, 0, 0.2, 0.2, 0.2, 0, 0, 0.2, 0.2, 0.2, 0, 0, 0, 0,
            0, 1, 0,
          ],
        },
      ]}
    />
  );
};
const styles = StyleSheet.create({
  image: {
    width: 200,
    height: 200,
  },
});
```


![image](https://github.com/software-mansion/react-native-svg/assets/39670088/666ed89f-68d8-491b-b97f-1eef112b7095)

## Test Plan

**Example App**: Updated the example app with various filter effects,
showcasing real-world usage.

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |         |
| Android |         |

## Checklist

- [x] I have tested this on a device and a simulator
- [x] I added documentation in `README.md` and `USAGE.md`
- [x] I updated the typed files (typescript)
2024-07-11 11:17:35 +02:00
Marlene Cota
2514ac4fdf feat(windows): add support for 74 and bump Example (#2315)
Added support for RNW 74.
Bumped windows Example to 74.
Updated README.md to remove instructions on how to import Win2D since we no longer use it.
2024-07-02 09:34:04 +02:00
Kacper Kapuściak
008422b575 chore: add hire us section to readme (#2295)
This PR adds a "Hire us" section to the README with a link to the
contact form.
2024-06-11 16:29:18 +02:00
Wojciech Lewicki
93ca4fe580 feat: bump minimal ios version to 12.4 (#2232)
# Summary

PR updating the minimal required version of `iOS` to `12.4`. Please
notice that it can be considered a ***BREAKING CHANGE***
2024-02-26 11:34:07 +01:00
Gabriel dos Santos Oliveira
234f7b7302 docs: Update deprecated expo install instructions to `npx expo install´ (#2128)
Changed expo install react-native-svg to npx expo install react-native-svg, because global expo-cli is deprecated [docs-expo-cli](https://docs.expo.dev/archive/expo-cli/)
2023-09-20 15:09:36 +02:00
Wojciech Lewicki
3ee73bd1f5 Update README.md 2023-08-07 18:43:44 +02:00
M.H.Pousti
3599c57e31 docs: update README.md (#2110)
Co-authored-by: Wojciech Lewicki <wojciech.lewicki@swmansion.com>
2023-08-02 15:20:34 +02:00
Mantas
76b742c24a fix: Call onLoad prop in SvgCssUri (#1927)
SvgCssUri calls onLoad if it's passed, just like in PR #1817 (with SvgUri).
2023-01-04 16:18:14 +01:00
Amit Kumar
1637580732 Include proguard config (#1842)
This will remove the requirement for people to add the proguard configs themselves. A lot of people first release to production with proguard and then realize why the app crashes. This will solve such issues.

This uses android's consumer proguard setting to enable specific proguard config.
2023-01-03 15:59:10 +01:00
Marlene Cota
1ef46af726 Fix windows build issues (#1923)
Addresses build issues seen in #1803, #1809, and #1863 by making updating RNSVG.vcxproj and making it more resilient to template/version changes in react-native-windows.
2022-11-30 14:50:32 +01:00
Wojciech Lewicki
3f621ae10f chore: bump supported RN version for Fabric (#1913)
PR bumping supported RN version for Fabric since it changed due to https://github.com/software-mansion/react-native-svg/pull/1847 having custom cpp state with linking working only from RN `0.70`
2022-11-15 12:44:48 +01:00
Wojciech Lewicki
9c0fa78d72 fix: update supported RN version to 0.64 (#1912)
Based on WoLewicki/libs-rn-version-tester/actions/runs/3410971949/jobs/5674595317 it seems that react-native-svg does not work for projects with RN < 0.64.
2022-11-08 12:10:03 +01:00
Kacper Kapuściak
15a62380bd chore: add react-native-svg banner to README (#1909) 2022-11-07 14:23:01 +01:00
Wojciech Lewicki
992cf19a68 chore: bump examples to rn 0.70 (#1858)
PR bumping Example and FabricExample apps to rn 0.70.
2022-09-06 15:32:00 +02:00
Wojciech Lewicki
a69cf7651d Update README.md 2022-08-17 16:35:11 +02:00
Wojciech Lewicki
06ac3491d1 feat: update readmes (#1716)
PR refactoring the READMEs, removing outdated information and adding, removing CHANGELOG.md generated by semantic-release, moving usage of the library to USAGE.md.
2022-07-25 17:04:03 +02:00
Moser José
c84b34535c update the readme for npm (#1523)
Co-authored-by: Moser José <moser.jose@outlook.com>
Co-authored-by: Wojciech Lewicki <wojciech.lewicki@swmansion.com>
2022-07-25 12:29:41 +02:00
Marlene Cota
28d51bdf06 Add Windows support (#1632)
Adds Windows support.

Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
Co-authored-by: REDMOND\agnel <agnel@microsoft.com>
2022-07-15 11:50:58 +02:00
Sanjeeban Mukhopadhyay
1dc42ea8a8 Fixed Typo (#1789) 2022-07-14 15:37:28 +02:00
Wojciech Lewicki
86f0be17fb Update README.md
Removed `Looking for maintainers` and added `Example` app to README.
2022-04-27 15:25:40 +02:00
Sjaak Schilperoort
69e1be7bbc Add support for setting an onError prop on SvgCssUri (#1718)
In PR #1266, support was added for setting an onError property on SvgUri. This PR adds the same to SvgCssUri.
2022-04-12 11:24:53 +02:00
klaz
f277c27dcd Fixed typo in README.md (#1448) 2022-02-28 19:45:19 +01:00
Anton Kuznetsov
cbc6d58774 Fix typo in README (#1427) 2022-02-28 19:36:39 +01:00
Hakan Akın
2826fd92cb Updated README.md (#1690) 2022-02-25 12:50:51 +01:00
Brent Vatne
5a16bffcb3 Fix README re: Expo usage
It is not any different to import react-native-svg in Expo apps than it is otherwise
2021-07-28 16:41:15 -07:00
Mikael Sand
9f9cde94a3 Looking for maintainers 2021-03-17 21:00:39 +02:00
Mikael Sand
b2e2c35520 Merge pull request #1370 from umairx97/patch-1
Update README.md
2020-06-09 10:54:27 +03:00
Evan Bacon
bfdf2190d8 Clean up expo instructions 2020-05-14 12:42:36 -07:00
Umair Ahmed
aca61e27f2 Update README.md 2020-05-04 17:40:39 +05:00
Mikael Sand
e390f87686 chore(readme): fix #1272 linearGradient example 2020-03-08 14:42:14 +02:00
Steven Vanderschaeve
fc4b9d54af Fix type in README.md 2020-01-30 09:21:41 +01:00
Mikael Sand
529b3bfaa0 feat: ForeignObject documentation 2020-01-12 19:10:17 +02:00
Mikael Sand
966881a67d feat!: Masks now support native elements
BREAKING CHANGE: If you had native elements inside any Svg root before,
Then your content might change appearance when upgrading,
as e.g. transforms and masks now take effect.
2020-01-04 07:37:20 +02:00
Mikael Sand
db76e6f22c feat!: note about masks and native elements as ancestors of svg
BREAKING CHANGE
2020-01-04 07:32:12 +02:00
moay
b092096450 Fixes readme
This line in the readme triggers a warning when running tests with jest. It should be updated to the new, correct import as promoted by expo.
2019-12-05 09:40:52 +01:00
Mikael Sand
8b578929bc Merge branch 'develop' 2019-10-25 21:35:57 +03:00
Mikael Sand
18036efc3c deps: upgrades 2019-10-25 21:34:32 +03:00
Tuomas Jaakola
98d27837f9 readme: css support 2019-10-24 00:43:08 +03:00
Tuomas Jaakola
efd4c012d9 cleaning readme 2019-10-24 00:04:02 +03:00
Aman Mittal
997b0c3580 docs: update with Expo installation steps
Resolves #1159
2019-10-21 20:44:34 +05:30
Mikael Sand
dc7d0768b0 refactor: run format / prettier, update readme 2019-10-19 22:57:44 +03:00
Mikael Sand
2852413697 Merge remote-tracking branch 'origin/master' into develop 2019-10-19 22:56:28 +03:00
Mikael Sand
cc1f835dc9 Update README.md
Add serialization example
2019-10-19 12:32:18 +03:00
Mikael Sand
88d7ebf360 chore: update readme 2019-10-04 17:50:46 +03:00
Mikael Sand
0c127dc6bc Update README.md 2019-10-03 14:18:48 +03:00
Mikael Sand
2af5b6cf29 Update README.md
Add more marker examples from svg 2.0 draft
2019-10-03 12:34:15 +03:00
Mikael Sand
1860a2fb18 Update README.md
Add intro to marker element and attributes
2019-10-03 12:06:35 +03:00