Commit Graph

1799 Commits

Author SHA1 Message Date
Wojciech Lewicki 0a26639532 chore: bump library and examples to rn 0.70-rc3 (#1837)
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.
2022-08-17 14:24:50 +02:00
Wojciech Lewicki 98c14b4f45 chore: add CI for JS, iOS and Android formatting (#1782)
Added CI workflow and local pre-commit hook for formatting and linting the newly added JS, iOS and Android code.
2022-08-16 12:00:32 +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
Wojciech Lewicki f1fa606664 Release 12.4.4 2022-08-10 12:52:22 +02:00
Wojciech Lewicki 7a773654b1 feat: change ios CI (#1831)
Added improved iOS CI jobs
2022-08-10 11:54:21 +02:00
Robert Sasak 4062c2e2b8 Add support for translateX and translateY on web (#1825)
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.
2022-08-10 10:27:35 +02:00
Wojciech Lewicki b00579a957 fix: export types from lib which were available before (#1829)
Exported all types from lib/extract/types.tsx since most of them were available before refactor done in #1806.
2022-08-09 15:45:17 +02:00
tainakanchu 6d1110b9c0 feat: fix broken enum declaration (#1819)
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.
2022-08-09 14:20:33 +02:00
Hyo 8d0ae5e04e Fix constructor with deprecated context (#1822)
The constructor with context is deprecated and occurs types error in react-native@69+.
2022-08-09 14:08:07 +02:00
Wojciech Lewicki 34ece786b3 Release 12.4.3 2022-07-26 17:56:13 +02:00
Wojciech Lewicki 24cfaabe33 Add onLoad method to SvgUri (#1817)
Co-authored-by: Harvey Connor <harvey@smartguide.com.au>
2022-07-26 17:47:12 +02:00
Wojciech Lewicki c87f823bf0 fix: remove tsignore in LocalSvg and provide correct types (#1816)
PR adding proper typings for asset prop of LocalSvg based on Image.resolveAssetSource() typings. Based on #1593 by @pratyushok.
2022-07-26 16:50:42 +02:00
Wojciech Lewicki af68c93d04 add missing onLayout prop typings (#1815)
onLayout prop typings are missing. This PR simply adds missing onLayout prop to svg nodes.

Co-authored-by: Sergey Tshovrebov <sinxwal@gmail.com>
2022-07-26 16:03:38 +02:00
Wojciech Lewicki 9c1a8b1f71 fix: correctly export rest of the props and add onError to parsing (#1814)
PR correctly exporting rest of the props and adding onError to parsing in other Svg components.
2022-07-26 15:27:56 +02:00
Ollie 82717e656a fix style attribute space (#1639)
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.
2022-07-26 15:20:48 +02:00
Wojciech Lewicki 0722eedf2f Release 12.4.2 2022-07-26 12:05:45 +02:00
Wojciech Lewicki 556690e9f1 fix: types from lib folder (#1813)
Added missing component props and made Svg* component props extend SvgProps. Also removed custom Color type which is now just ColorValue from react-native.
2022-07-26 12:02:48 +02:00
Wojciech Lewicki de84df64ba Release 12.4.1 2022-07-25 17:29:29 +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
Zidane Hammouda 1cbf24922d Fixed some vocabulary issues in Contributing file (#1765)
Co-authored-by: Wojciech Lewicki <wojciech.lewicki@swmansion.com>
2022-07-25 16:05:08 +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
DominicTobias 211acf0040 Fix Stop.tsx error TS2612: Property 'props' will overwrite the base property in 'Component<StopProps, {}, any>' (#1777) 2022-07-25 12:10:43 +02:00
Wojciech Lewicki 286c02fac4 Refactor typescript code (#1806)
Co-authored-by: Eric Butler <eric@codebutler.com>
2022-07-22 17:41:30 +02:00
tainakanchu a7a31ca806 Change enum declaration in index.d.ts to UnionType (#1800)
Co-authored-by: Avery Pierce <avery.pierce@spin.pm>
2022-07-22 15:31:47 +02:00
Wojciech Lewicki 1a752999d9 Release 12.4.0 2022-07-15 12:51:41 +02:00
dependabot[bot] 05b3f28a84 chore(deps): bump async from 2.6.3 to 2.6.4 in /Example (#1759)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-15 12:21:13 +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
TikiTDO 4d3c521a22 Do not include build artifacts in the npm package (#1786)
* Fixes #1785
2022-07-14 17:14:48 +02:00
Stephen Pittman 2a44346049 Fix many JS vulns, fix tests (#1775)
* 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
2022-07-14 16:25:55 +02:00
Sanjeeban Mukhopadhyay 1dc42ea8a8 Fixed Typo (#1789) 2022-07-14 15:37:28 +02:00
Wojciech Lewicki 68de5f8170 Update README.md 2022-04-27 15:26:35 +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
dependabot[bot] cf3d817a2b chore(deps): bump ansi-regex from 4.1.0 to 4.1.1 in /Example (#1750)
bump some more deps from dependabot
2022-04-12 16:26:06 +02:00
dependabot[bot] 84e307433b chore(deps): bump many deps with dependabot
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-12 14:50:25 +02:00
Wojciech Lewicki 1b01381f28 feat: remove extractColor in favor of RN impl (#1726)
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).
2022-04-12 13:47:21 +02:00
Julian d859083687 duplicate symbol '_distance' with MobileVLCKit (#1508)
Fix duplicate symbol '_distance' with MobileVLCKit.
2022-04-12 11:31:57 +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
nitzanbueno 82f0f3a985 Fix issue #1418 (#1419)
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)
2022-03-08 13:48:18 +01:00
Mathieu Acthernoene 2fa9645cf6 Add web example (#1717)
Added web example to `Example`
2022-03-07 12:16:50 +01:00
Sjaak Schilperoort 7afd23665f Fix for SvgUri and SvgCssUri crashing on non-existing svg files (#1503)
Fix for interpreting an HTML error response as svg data, and then crash when this cannot be parsed as well formed XML
2022-03-04 15:38:33 +01:00
dependabot[bot] 650275fdf5 chore(deps-dev): bump react-native from 0.61.5 to 0.62.3 (#1617)
Bumps [react-native](https://github.com/facebook/react-native) from 0.61.5 to 0.62.3.
- [Release notes](https://github.com/facebook/react-native/releases)
- [Changelog](https://github.com/facebook/react-native/blob/main/Releases.md)
- [Commits](https://github.com/facebook/react-native/compare/v0.61.5...v0.62.3)

---
updated-dependencies:
- dependency-name: react-native
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-02 21:00:27 +01:00
Wojciech Lewicki cf808ae79d fix: change ci jobs to main (#1715)
PR changing CI jobs target to main branch since it was changed from develop.
2022-03-02 13:38:23 +01:00
Wojciech Lewicki 54e40251a4 Release 12.3.0 2022-03-02 12:29:26 +01:00
Wojciech Lewicki b2c86c72f9 feat: add release-it (#1714)
Changed semantic-release to release-it.
2022-03-02 12:23:44 +01:00
nishan (o^▽^o) 69ff5f0e98 fix#1471: every element is focusable on web (#1585)
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.
2022-03-02 11:40:41 +01:00
Wojciech Lewicki 2484baa8db feat: move Example to TS (#1712)
This PR changes all examples in Example app to ts in order to more easily check if types are correct and in future remove index.d.ts file.
2022-03-01 14:35:53 +01:00
Simon Trény 59a48e7a08 Fix low-quality masks on iOS (#1658)
This PR fixes low-quality masks on iOS.

This was caused by the bitmap for the mask being created with [CGBitmapContextCreate()](https://developer.apple.com/documentation/coregraphics/1455939-cgbitmapcontextcreate) which does not take into account the device's pixel-density, unlike [UIGraphicsBeginImageContextWithOptions()](https://developer.apple.com/documentation/uikit/1623912-uigraphicsbeginimagecontextwitho).

To fix it, the pixel-density is retrieved using `[[UIScreen mainScreen] scale]` and it is used as a scale factor for the mask bitmap.
2022-03-01 11:34:19 +01: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