-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(xml): extract tags map to separate entry point for mobile & web (#…
…1916) # Summary **What issues does the pull request solve? Please tag them so that they will get automatically closed once the PR is merged** When utilizing with `react-native-web`: SvgXml and SvgUri are not exported in the `src/ReactNativeSVG.web.ts` extension. The logic for SvgXml and SvgUri do not have native dependencies, so they are safe to consume on web. Issues: - #1279 - #1742 **What is the feature? (if applicable)** Add SvgXml and SvgUri as consumable exports for `react-native-web` **How did you implement the solution?** Extract `tags` to shapes map into separate `tags.tsx` file, where native shape elements and web shape elements can be provided to their respective envs. **What areas of the library does it impact?** `src` directory ## Test Plan Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. ### What's required for testing (prerequisites)? n/a ### What are the steps to reproduce (after prerequisites)? n/a ## Compatibility | OS | Implemented | | ------- | :---------: | | iOS | ✅ | | Android | ✅ | ## Checklist <!-- Check completed item, when applicable, via: [X] --> - [x] I have tested this on a device and a simulator - [x] I added documentation in `README.md` - [x] I updated the typed files (typescript) - [ ] I added a test for the API in the `__tests__` folder --------- Co-authored-by: bohdanprog <bohdan.artiukhov@swmansion.com>
- Loading branch information
1 parent
c5e601a
commit 360e0ee
Showing
9 changed files
with
123 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import Rect from './elements/Rect'; | ||
import Circle from './elements/Circle'; | ||
import Ellipse from './elements/Ellipse'; | ||
import Polygon from './elements/Polygon'; | ||
import Polyline from './elements/Polyline'; | ||
import Line from './elements/Line'; | ||
import Svg from './elements/Svg'; | ||
import Path from './elements/Path'; | ||
import G from './elements/G'; | ||
import Text from './elements/Text'; | ||
import TSpan from './elements/TSpan'; | ||
import TextPath from './elements/TextPath'; | ||
import Use from './elements/Use'; | ||
import Image from './elements/Image'; | ||
import Symbol from './elements/Symbol'; | ||
import Defs from './elements/Defs'; | ||
import LinearGradient from './elements/LinearGradient'; | ||
import RadialGradient from './elements/RadialGradient'; | ||
import Stop from './elements/Stop'; | ||
import ClipPath from './elements/ClipPath'; | ||
import Pattern from './elements/Pattern'; | ||
import Mask from './elements/Mask'; | ||
import Marker from './elements/Marker'; | ||
import Filter from './elements/filters/Filter'; | ||
import FeColorMatrix from './elements/filters/FeColorMatrix'; | ||
import FeGaussianBlur from './elements/filters/FeGaussianBlur'; | ||
import FeOffset from './elements/filters/FeOffset'; | ||
|
||
export const tags = { | ||
circle: Circle, | ||
clipPath: ClipPath, | ||
defs: Defs, | ||
ellipse: Ellipse, | ||
filter: Filter, | ||
feColorMatrix: FeColorMatrix, | ||
feGaussianBlur: FeGaussianBlur, | ||
feOffset: FeOffset, | ||
g: G, | ||
image: Image, | ||
line: Line, | ||
linearGradient: LinearGradient, | ||
marker: Marker, | ||
mask: Mask, | ||
path: Path, | ||
pattern: Pattern, | ||
polygon: Polygon, | ||
polyline: Polyline, | ||
radialGradient: RadialGradient, | ||
rect: Rect, | ||
stop: Stop, | ||
svg: Svg, | ||
symbol: Symbol, | ||
text: Text, | ||
textPath: TextPath, | ||
tspan: TSpan, | ||
use: Use, | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import Svg, { | ||
Circle, | ||
ClipPath, | ||
Defs, | ||
Ellipse, | ||
G, | ||
Image, | ||
Line, | ||
LinearGradient, | ||
Marker, | ||
Mask, | ||
Path, | ||
Pattern, | ||
Polygon, | ||
Polyline, | ||
RadialGradient, | ||
Rect, | ||
Stop, | ||
Text, | ||
TextPath, | ||
TSpan, | ||
Use, | ||
Symbol, | ||
} from './ReactNativeSVG.web'; | ||
|
||
export const tags = { | ||
circle: Circle, | ||
clipPath: ClipPath, | ||
defs: Defs, | ||
ellipse: Ellipse, | ||
g: G, | ||
image: Image, | ||
line: Line, | ||
linearGradient: LinearGradient, | ||
marker: Marker, | ||
mask: Mask, | ||
path: Path, | ||
pattern: Pattern, | ||
polygon: Polygon, | ||
polyline: Polyline, | ||
radialGradient: RadialGradient, | ||
rect: Rect, | ||
stop: Stop, | ||
svg: Svg, | ||
symbol: Symbol, | ||
text: Text, | ||
textPath: TextPath, | ||
tspan: TSpan, | ||
use: Use, | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters