@emotion/native
Advanced tools
+10
-0
| # @emotion/native | ||
| ## 11.9.3 | ||
| ### Patch Changes | ||
| - [#2759](https://github.com/emotion-js/emotion/pull/2759) Thanks [@srmagura](https://github.com/srmagura), [@Andarist](https://github.com/Andarist)! - Change the argument of the `shouldForwardProp` option of `styled` from `PropertyKey` to `string` in the TypeScript definitions. | ||
| * [#2333](https://github.com/emotion-js/emotion/pull/2333) [`3055efdd`](https://github.com/emotion-js/emotion/commit/3055efddf8f9fb14b148fda466dcb4eb9affc525) Thanks [@Andarist](https://github.com/Andarist)! - `shouldForwardProp` has been changed from being a bivariant method to a contravariant function - it improves the type-safety for those that type this option. | ||
| - [#2333](https://github.com/emotion-js/emotion/pull/2333) [`3055efdd`](https://github.com/emotion-js/emotion/commit/3055efddf8f9fb14b148fda466dcb4eb9affc525) Thanks [@antongolub](https://github.com/antongolub)! - `FilteringStyledOptions` and `StyledOptions` types no longer require a type argument for the `Props` generic. | ||
| ## 11.0.0 | ||
@@ -4,0 +14,0 @@ |
@@ -1,8 +0,7 @@ | ||
| "use strict"; | ||
| 'use strict'; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: !0 | ||
| }); | ||
| Object.defineProperty(exports, '__esModule', { value: true }); | ||
| var reactNative = require("react-native"), primitivesCore = require("@emotion/primitives-core"); | ||
| var reactNative = require('react-native'); | ||
| var primitivesCore = require('@emotion/primitives-core'); | ||
@@ -12,25 +11,40 @@ function _interopNamespace(e) { | ||
| var n = Object.create(null); | ||
| return e && Object.keys(e).forEach((function(k) { | ||
| if ("default" !== k) { | ||
| var d = Object.getOwnPropertyDescriptor(e, k); | ||
| Object.defineProperty(n, k, d.get ? d : { | ||
| enumerable: !0, | ||
| get: function() { | ||
| return e[k]; | ||
| } | ||
| }); | ||
| } | ||
| })), n.default = e, Object.freeze(n); | ||
| if (e) { | ||
| Object.keys(e).forEach(function (k) { | ||
| if (k !== 'default') { | ||
| var d = Object.getOwnPropertyDescriptor(e, k); | ||
| Object.defineProperty(n, k, d.get ? d : { | ||
| enumerable: true, | ||
| get: function () { | ||
| return e[k]; | ||
| } | ||
| }); | ||
| } | ||
| }); | ||
| } | ||
| n['default'] = e; | ||
| return Object.freeze(n); | ||
| } | ||
| var reactNative__namespace = _interopNamespace(reactNative), styled = primitivesCore.createStyled(reactNative.StyleSheet), css = primitivesCore.createCss(reactNative.StyleSheet), components = [ "ActivityIndicator", "Button", "DatePickerIOS", "DrawerLayoutAndroid", "FlatList", "Image", "ImageBackground", "KeyboardAvoidingView", "ListView", "Modal", "NavigatorIOS", "Picker", "PickerIOS", "Pressable", "ProgressBarAndroid", "ProgressViewIOS", "RecyclerViewBackedScrollView", "RefreshControl", "SafeAreaView", "ScrollView", "SectionList", "SegmentedControlIOS", "Slider", "SnapshotViewIOS", "StatusBar", "SwipeableListView", "Switch", "SwitchIOS", "TabBarIOS", "Text", "TextInput", "ToolbarAndroid", "TouchableHighlight", "TouchableNativeFeedback", "TouchableOpacity", "TouchableWithoutFeedback", "View", "ViewPagerAndroid" ], index = components.reduce((function(acc, comp) { | ||
| var reactNative__namespace = /*#__PURE__*/_interopNamespace(reactNative); | ||
| /** | ||
| * a function that returns a styled component which render styles in React Native | ||
| */ | ||
| var styled = primitivesCore.createStyled(reactNative.StyleSheet); | ||
| var css = primitivesCore.createCss(reactNative.StyleSheet); | ||
| var components = ['ActivityIndicator', 'Button', 'DatePickerIOS', 'DrawerLayoutAndroid', 'FlatList', 'Image', 'ImageBackground', 'KeyboardAvoidingView', 'ListView', 'Modal', 'NavigatorIOS', 'Picker', 'PickerIOS', 'Pressable', 'ProgressBarAndroid', 'ProgressViewIOS', 'RecyclerViewBackedScrollView', 'RefreshControl', 'SafeAreaView', 'ScrollView', 'SectionList', 'SegmentedControlIOS', 'Slider', 'SnapshotViewIOS', 'StatusBar', 'SwipeableListView', 'Switch', 'SwitchIOS', 'TabBarIOS', 'Text', 'TextInput', 'ToolbarAndroid', 'TouchableHighlight', 'TouchableNativeFeedback', 'TouchableOpacity', 'TouchableWithoutFeedback', 'View', 'ViewPagerAndroid']; | ||
| var index = components.reduce(function (acc, comp) { | ||
| return Object.defineProperty(acc, comp, { | ||
| enumerable: !0, | ||
| configurable: !1, | ||
| get: function() { | ||
| enumerable: true, | ||
| configurable: false, | ||
| get: function get() { | ||
| return styled(reactNative__namespace[comp]); | ||
| } | ||
| }); | ||
| }), styled); | ||
| }, styled); | ||
| exports.css = css, exports.default = index; | ||
| exports.css = css; | ||
| exports.default = index; |
+6
-5
| { | ||
| "name": "@emotion/native", | ||
| "version": "11.0.0", | ||
| "version": "11.9.3", | ||
| "description": "Style and render React Native components using emotion", | ||
@@ -18,7 +18,8 @@ "main": "dist/emotion-native.cjs.js", | ||
| "devDependencies": { | ||
| "@babel/core": "^7.7.2", | ||
| "@babel/core": "^7.13.10", | ||
| "@definitelytyped/dtslint": "0.0.112", | ||
| "@types/react-native": "^0.63.2", | ||
| "dtslint": "^0.3.0", | ||
| "react": "16.14.0", | ||
| "react-native": "^0.63.2" | ||
| "react-native": "^0.63.2", | ||
| "typescript": "^4.5.5" | ||
| }, | ||
@@ -39,3 +40,3 @@ "dependencies": { | ||
| "license": "MIT", | ||
| "repository": "https://github.com/emotion-js/emotion/tree/master/packages/native", | ||
| "repository": "https://github.com/emotion-js/emotion/tree/main/packages/native", | ||
| "keywords": [ | ||
@@ -42,0 +43,0 @@ "styles", |
+2
-4
@@ -41,4 +41,3 @@ # @emotion/native | ||
| const emotionLogo = | ||
| 'https://cdn.rawgit.com/emotion-js/emotion/master/emotion.png' | ||
| const emotionLogo = 'https://cdn.rawgit.com/emotion-js/emotion/main/emotion.png' | ||
@@ -102,4 +101,3 @@ class App extends React.Component { | ||
| const emotionLogo = | ||
| 'https://cdn.rawgit.com/emotion-js/emotion/master/emotion.png' | ||
| const emotionLogo = 'https://cdn.rawgit.com/emotion-js/emotion/main/emotion.png' | ||
@@ -106,0 +104,0 @@ class App extends React.Component { |
+12
-12
@@ -14,3 +14,5 @@ // Definitions by: Pat Sissons <https://github.com/patsissons> | ||
| } | ||
| ? StyleType extends ReactNativeStyle ? StyleType : ReactNativeStyle | ||
| ? StyleType extends ReactNativeStyle | ||
| ? StyleType | ||
| : ReactNativeStyle | ||
| : ReactNativeStyle | ||
@@ -62,10 +64,10 @@ | ||
| export interface FilteringStyledOptions< | ||
| Props, | ||
| ForwardedProps extends keyof Props = keyof Props | ||
| Props = Record<string, any>, | ||
| ForwardedProps extends keyof Props & string = keyof Props & string | ||
| > { | ||
| shouldForwardProp?(propName: PropertyKey): propName is ForwardedProps | ||
| shouldForwardProp?: (propName: string) => propName is ForwardedProps | ||
| } | ||
| export interface StyledOptions<Props> { | ||
| shouldForwardProp?(propName: PropertyKey): boolean | ||
| export interface StyledOptions<Props = Record<string, any>> { | ||
| shouldForwardProp?: (propName: string) => boolean | ||
| } | ||
@@ -149,5 +151,4 @@ | ||
| C extends React.ComponentClass<React.ComponentProps<C>>, | ||
| ForwardedProps extends keyof React.ComponentProps< | ||
| C | ||
| > = keyof React.ComponentProps<C> | ||
| ForwardedProps extends keyof React.ComponentProps<C> & | ||
| string = keyof React.ComponentProps<C> & string | ||
| >( | ||
@@ -181,5 +182,4 @@ component: C, | ||
| C extends React.ComponentType<React.ComponentProps<C>>, | ||
| ForwardedProps extends keyof React.ComponentProps< | ||
| C | ||
| > = keyof React.ComponentProps<C> | ||
| ForwardedProps extends keyof React.ComponentProps<C> & | ||
| string = keyof React.ComponentProps<C> & string | ||
| >( | ||
@@ -186,0 +186,0 @@ component: C, |
+15
-16
@@ -21,2 +21,3 @@ // Definitions by: Pat Sissons <https://github.com/patsissons> | ||
| CSSInterpolation, | ||
| FilteringStyledOptions, | ||
| FunctionInterpolation, | ||
@@ -45,18 +46,16 @@ Interpolation, | ||
| // those 2 are just copies of the `BaseCreateStyled` with supplied `C` type argument | ||
| type HostClassComponent< | ||
| C extends React.ComponentClass<any> | ||
| > = CreateStyledComponent< | ||
| React.ComponentProps<C> & { theme?: Theme; as?: React.ElementType }, | ||
| {}, | ||
| { ref?: React.Ref<InstanceType<C>> }, | ||
| ReactNativeStyleType<React.ComponentProps<C>> | ||
| > | ||
| type HostFunctionComponent< | ||
| C extends React.FunctionComponent<any> | ||
| > = CreateStyledComponent< | ||
| React.ComponentProps<C> & { theme?: Theme; as?: React.ElementType }, | ||
| {}, | ||
| {}, | ||
| ReactNativeStyleType<React.ComponentProps<C>> | ||
| > | ||
| type HostClassComponent<C extends React.ComponentClass<any>> = | ||
| CreateStyledComponent< | ||
| React.ComponentProps<C> & { theme?: Theme; as?: React.ElementType }, | ||
| {}, | ||
| { ref?: React.Ref<InstanceType<C>> }, | ||
| ReactNativeStyleType<React.ComponentProps<C>> | ||
| > | ||
| type HostFunctionComponent<C extends React.FunctionComponent<any>> = | ||
| CreateStyledComponent< | ||
| React.ComponentProps<C> & { theme?: Theme; as?: React.ElementType }, | ||
| {}, | ||
| {}, | ||
| ReactNativeStyleType<React.ComponentProps<C>> | ||
| > | ||
@@ -63,0 +62,0 @@ export interface StyledComponents { |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
40290
3.47%529
1.73%6
20%182
-1.09%