PR bumping library to RN 0.70-rc3, which might make it not compatible with earlier versions of RN on Fabric. It should come with the same change in other libraries.
In this PR, I had to remove macos code from Example since it breaks @react-native-community/cli resolution. Hopefully we can bring it back soon.
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.
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
Props translateX and translateY are ignored on web. This PR is addressing it the same way as it is already done for originX and originY.
This PR is not addressing the issue of transform as stated in issue.
After #1800 merged, the refactoring 286c02f was performed and enum declaration was back to previous one.
So type error mentioned at #1210 for maskUnits should occurred again.
When the svg code has some blank in style attribute,like this style="white-space: pre; "
it was throw an error Cannot read property 'trim' of undefined.
Added missing component props and made Svg* component props extend SvgProps. Also removed custom Color type which is now just ColorValue from react-native.
PR refactoring the READMEs, removing outdated information and adding, removing CHANGELOG.md generated by semantic-release, moving usage of the library to USAGE.md.
* fix: lint problem
* fix: ignore malformed JSON file for FlowJS
* fix: add missing @types/jest package
* chore: update TypeScript version
* chore: update all eslint deps
Includes updating and installing missing/wrong peer deps
* chore: update all Jest deps
* chore: replace Jest config with jest.config.ts
* fix: make root Jest tests ignore Example folders
* chore: update css-select dep
* chore: update css-tree to latest 1.x version
2.x broke tests so left a 1.x
* chore: upgrade ansi-regex to close JS vuln
* chore: upgrade ejs to close JS vuln
* chore: upgrade async to close JS vuln
* chore: upgrade simple-plist to close JS vuln
PR removing extractColor.ts in favor of using the processColor implementation straight from react-native. It should handle all the cases from the previous implementation and the cases with PlatformColor and DynamicColorIOS. Normally we would just send the returned value to the native side, but in react-native-svg, e.g. fill prop can have more values than just color, e.g. currentColor. Because of it, we cannot use UIColor on iOS, NSColor on macOS and customType="Color" on Android as a prop type there and therefore we need to prepare the custom values on the JS side. It is done by passing the prop as an array with specific first element. In case of colors, it is 0. (hopefully I understood the code right).
Fix bug in extractPolyPoints where an uppercase exponent (E) in a polygon (e.g. 4.7E-17) wouldn't be considered an exponent, only a lowercase one (4.7e-17)
As described in #1471, each SVG element is focusable/tabable on web by default. This can create issues in keyboard navigation.
As explained by @jondkoon #1471 (comment), the TouchableMixin attaches blur handler which makes SVG elements focusable.
So, to solve this, we only attach touchable mixin handlers if the element has any touchable props.