31 Commits

Author SHA1 Message Date
Jakub Grzywacz
6042b89b6b feat: use yoga::StyleLength instead of yoga::value on 77+ (#2582)
# Summary

With react-native@0.77 `yoga::value` is no longer available and we
should use `yoga::StyleLength`.

## Test Plan

App should build again on 0.77.rc-3
2024-12-19 14:34:55 +01:00
Jakub Grzywacz
596ba83454 remove: *.metal from podspec source_files (#2576)
# Summary

Fixes #2571.
Since filter shaders are already provided as compiled `*.metallib`
files, there is no need to include `*.metal` files in the `source_files`
list.

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |          |
2024-12-12 11:49:19 +01:00
Jakub Grzywacz
4637dee1e4 feat: FeComposite filter (#2433)
# Summary

<img width="324" alt="image"
src="https://github.com/user-attachments/assets/0a9b4a56-d093-49f7-aacd-c198ee00f256">

## Test Plan

Examples app -> Filters -> FeComposite

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |          |
| macOS   |    *      |
| Android |          |
| Web     |          |

_*_ macOS isn't working as:
* `CGBitmapContextCreateImage` always returns null
* FeFlood isn't aligned properly (will be fixed in the following PR)
2024-10-25 11:18:07 +02:00
Jihoon Seo
768466d8b0 fix: Fix pod install not working with lower version of Cocoapods due to visionOS (#2240)
<!-- Thanks for submitting a pull request! We appreciate you spending
the time to work on these changes. Please follow the template so that
the reviewers can easily understand what the code changes affect -->

# Summary
On Cocoapods versions of lower than 1.14.3, pod install fails due to it
not understanding the visionos field.
Our company cannot use a higher version of Cocoapods right now, so it
would be beneficial if we or other similar people can use the latest
version of react-native-svg without having to upgrade the Cocoapods
version.

I was able to find this solution from
https://github.com/getsentry/sentry-react-native/issues/3547#issuecomment-1907677879

## Compatibility

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

## Checklist

<!-- Check completed item, when applicable, via: [X] -->

- [x] I have tested this on a device and a simulator
- [ ] I added documentation in `README.md`
- [ ] I updated the typed files (typescript)
- [ ] I added a test for the API in the `__tests__` folder
2024-05-13 09:39:59 +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
Tomek Zawadzki
871549cca4 fix: visionOS support (#2218)
This PR fixes the following errors when compiling for visionOS:

Unknown type name 'NSColor'
2024-02-05 11:49:17 +01:00
Oskar Kwaśniewski
068820b3fa feat: add visionOS support (#2190)
This PR adds support for visionOS. I've migrated the `UIScreen` API to take `displayScale` from `currentTraitCollection` - same as I did in Core (https://github.com/facebook/react-native/pull/41214/files)
2023-12-06 14:37:54 +01:00
Nick Gerleman
27ee46a1ec Build renderer/components/rnsvg with -std=c++20 (#2141) 2023-10-25 16:33:30 +02:00
Wojciech Lewicki
f5503e2c9b feat: remove UIGraphicsBeginImageContextWithOptions from repo (#2117)
Since UIGraphicsBeginImageContextWithOptions will be depracated in iOS 17 (developer.apple.com/documentation/uikit/1623912-uigraphicsbeginimagecontextwitho), I changed the implementation to not use it and use UIGraphicsImageRenderer instead.

Also added Mask examples to be able to test it.
2023-08-21 11:35:50 +02:00
Wojciech Lewicki
416ccc8a86 fix: bump packages, eslint, tsconfig, prettier and resolve all conflicts (#2114)
PR bumping packages, eslint, tsconfig, prettier and resolving all conflicts connected to it.
2023-08-07 17:44:58 +02:00
sgabriel
a1090f25a1 fix: Updating iOS version #2038 (#2041)
Updated iOS version to 12.4 to be able to build on Xcode 14.3
2023-05-24 13:13:32 +02:00
Wojciech Lewicki
175a48f8c9 chore: change fabric flag (#1979)
Changed `RN_FABRIC_ENABLED` to `RCT_NEW_ARCH_ENABLED` since it is the current standard for this flag.
2023-01-31 16:15:59 +01:00
Wojciech Lewicki
1126079425 feat: use codegenNativeComponent to import native views (#1847)
Changed `requireNativeComponent` to `codegenNativeComponent` so that upcoming changes (Static View Configs, Bridgeless Mode and idk what more) in `react-native` are available in the library. Also, types and native components are now taken directly from `fabric` folder to make sure the values passed to the native components are the ones defined in props. It should work on all supported versions since `codegenNativeComponent` function exists from RN v. 0.61.0. Suggested by @RSNara and @cipolleschi

Reason for [`5394bbb` (#1847)](5394bbbced): 
- on `Paper`, `Animated` uses `setNativeProps` method when we set `useNativeDriver`  to `false`, and does not rerender the component. Therefore, new transform lands only in `SvgView` and is parsed in `RCTViewManager.m` .
- on `Fabric`, the same code makes the components rerender. Due to this, information about new transform is passed to the `SvgView` child: `G` , making it apply translations from the transform in its `updateProps` method.
- other than `Animated` use-case, on both archs, if we just passed `transform` prop to `Svg` component, it would end up in double transformations now as well. All of those changes are due to https://github.com/software-mansion/react-native-svg/pull/1895, which added proper parsing of RN style `transform` prop (array of transformations objects) therefore making `G` properly handle `transform` prop passed from `Svg`.

Reason for [`19bcb24` (#1847)](19bcb2464b): Same as https://github.com/software-mansion/react-native-screens/pull/1624
2022-11-03 15:47:29 +01:00
Alessandro Gerelli
bf74342afa Fixed RCT_NEW_ARCH_ENABLED in podspec (#1877)
RCT_NEW_ARCH_ENABLED seems to be always true (even when its value is '0') without an explicit check
2022-09-22 14:42:50 +02:00
Wojciech Lewicki
778703d8a3 feat: remove unused common folder (#1838)
PR removing common directory from library since it is not used currently due to no custom shadow nodes etc. in Fabric implementation.
2022-08-17 15:50:01 +02:00
Wojciech Lewicki
77267be5fc feat: support Fabric on Android (#1804)
Most of Android changes for Fabric and bump of FabricExample to RN 0.69.2. iOS and JS changes are available in #1821.
The most notable change on Android is adding methods to components that accept String values of each NumberProp instead of Dynamic. Another change is changed structure of RenderableViewManager.java since we needed to abstract methods that belong only to components inheriting from VirtualView in order to be able to properly override them in their children.
2022-08-12 11:42:44 +02:00
Wojciech Lewicki
8f1bda4856 feat: add Fabric on iOS without ComponentViews (#1821)
Version of #1754 without usage of ComponentViews. It seems like a more proper way, but introduces the necessity of clearing whole state of each component on recycling for it not to be used when view is recycled.

Still known problems:

We stringify props of type NumberProp since codegen only accepts props of a single type. It is the fastest way of dealing with it, but maybe there could be a better way to handle it.
Image resolving should be probably handled the same as in RN core
SvgView needs to set opaque = NO so it is does not have black background (it comes from the fact that RCTViewComponentView overrides backgroundColor setter which in turn somehow messes with the view being opaque). All other svg components do it already so maybe it is not such an issue.
transform prop won't work when set natively since it is not parsed in Fabric
2022-08-11 14:08:11 +02:00
Adam Gleitman
4123a46f58 Merge pull request #1584 from jhen0409/patch-1
Exclude macos files on tvOS
2021-07-01 14:37:00 -07:00
Max Thirouin
e8ed5e943f Xcode 12 compatibility fix 2021-06-22 10:07:21 +02:00
jhen
686930b1c6 Exclude macos files on tvOS 2021-05-09 18:34:28 +08:00
Adam Gleitman
a56d22a985 refactor: rename ios/ source folder to apple/ 2020-11-25 16:31:39 -08:00
Adam Gleitman
839ccd1908 feat: add macOS support 2020-11-25 14:55:50 -08:00
Mikael Sand
c4dba222a3 fix: react-native 0.59 compat 2020-03-05 12:30:00 +02:00
Mikael Sand
675df92407 fix(ios): pod install error
> pod install
Detected React Native module pod for RNSVG
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "React/RCTImage":
  In Podfile:
    RNSVG (from `../node_modules/react-native-svg`) was resolved to 11.0.1, which depends on
      React/RCTImage

None of your spec sources contain a spec satisfying the dependency: `React/RCTImage`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.
2020-03-04 17:42:02 +02:00
Kexin Zhang
a3c48fa284 add dependency for RCTImage 2020-01-21 16:37:34 -08:00
Mikael Sand
f5bf06afd2 Adopt changes from community guideline for repository setup
https://github.com/react-native-community/.github/blob/master/Guidelines/Repository%20Setup.md
2019-07-26 02:51:02 +03:00
Mikael Sand
732e5752de Refactor, hoist closure creation. 2019-01-06 02:19:41 +02:00
Andy Trevorah
d5a5e97b38 Fix tag mismatch in podspec (#477)
The tags for this repo *usually* dont have a `v` prefix, so doing a `pod install` with a direct dependency on the podspec fails. This fixes that mismatch.
2017-11-23 13:48:03 -08:00
dlowder-salesforce
bd18343e60 Podspec support for Apple TV 2017-08-03 14:50:31 -07:00
Or Yagel
31a01b6c46 update podspec 2016-08-30 15:08:47 +03:00
Horcrux
ce33cca89d add RNSVG.podspec 2016-07-27 15:07:47 +08:00