react-native-unistyles 3.0.11 → 3.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/commonjs/web-only/getWebProps.js +2 -2
- package/lib/commonjs/web-only/getWebProps.js.map +1 -1
- package/lib/module/web-only/getWebProps.js +2 -2
- package/lib/module/web-only/getWebProps.js.map +1 -1
- package/lib/typescript/src/web-only/getWebProps.d.ts +1 -1
- package/lib/typescript/src/web-only/getWebProps.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/web-only/getWebProps.ts +2 -2
package/README.md
CHANGED
@@ -21,14 +21,14 @@ yarn add react-native-unistyles
|
|
21
21
|
Install dependencies:
|
22
22
|
|
23
23
|
```shell
|
24
|
-
yarn add react-native-edge-to-edge react-native-nitro-modules@0.29.
|
24
|
+
yarn add react-native-edge-to-edge react-native-nitro-modules@0.29.4
|
25
25
|
```
|
26
26
|
|
27
27
|
> To avoid unexpected behavior, always use a fixed version of `react-native-nitro-modules`
|
28
28
|
|
29
29
|
| react-native-unistyles | react-native-nitro-modules |
|
30
30
|
|------------------------|----------------------------|
|
31
|
-
| 3.0.0 | 0.29.
|
31
|
+
| 3.0.0 | 0.29.4 |
|
32
32
|
|
33
33
|
Then follow [installation guides](https://unistyl.es/v3/start/getting-started) for your platform.
|
34
34
|
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.getWebProps = void 0;
|
7
7
|
var _core = require("../core");
|
8
8
|
var _createUnistylesRef = require("../web/utils/createUnistylesRef");
|
9
|
-
const getWebProps = style => {
|
9
|
+
const getWebProps = (style, forwardedRef) => {
|
10
10
|
const styles = (0, _core.getClassName)(style);
|
11
|
-
const ref = (0, _createUnistylesRef.createUnistylesRef)(styles);
|
11
|
+
const ref = (0, _createUnistylesRef.createUnistylesRef)(styles, forwardedRef);
|
12
12
|
const [generatedStyles] = styles ?? [];
|
13
13
|
return {
|
14
14
|
className: [generatedStyles?.hash, generatedStyles?.injectedClassName].filter(Boolean).join(' '),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_core","require","_createUnistylesRef","getWebProps","style","styles","getClassName","ref","createUnistylesRef","generatedStyles","className","hash","injectedClassName","filter","Boolean","join","exports"],"sourceRoot":"../../../src","sources":["web-only/getWebProps.ts"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,mBAAA,GAAAD,OAAA;AAEO,MAAME,WAAW,
|
1
|
+
{"version":3,"names":["_core","require","_createUnistylesRef","getWebProps","style","forwardedRef","styles","getClassName","ref","createUnistylesRef","generatedStyles","className","hash","injectedClassName","filter","Boolean","join","exports"],"sourceRoot":"../../../src","sources":["web-only/getWebProps.ts"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,mBAAA,GAAAD,OAAA;AAEO,MAAME,WAAW,GAAGA,CAAIC,KAAyB,EAAEC,YAAoC,KAAK;EAC/F,MAAMC,MAAM,GAAG,IAAAC,kBAAY,EAACH,KAAwB,CAAC;EACrD,MAAMI,GAAG,GAAG,IAAAC,sCAAkB,EAAIH,MAAM,EAAED,YAAY,CAAC;EACvD,MAAM,CAACK,eAAe,CAAC,GAAGJ,MAAM,IAAI,EAAE;EAEtC,OAAO;IACHK,SAAS,EAAE,CACPD,eAAe,EAAEE,IAAI,EACrBF,eAAe,EAAEG,iBAAiB,CACrC,CAACC,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;IAC3BR;EACJ,CAAC;AACL,CAAC;AAAAS,OAAA,CAAAd,WAAA,GAAAA,WAAA","ignoreList":[]}
|
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
import { getClassName } from '../core';
|
4
4
|
import { createUnistylesRef } from '../web/utils/createUnistylesRef';
|
5
|
-
export const getWebProps = style => {
|
5
|
+
export const getWebProps = (style, forwardedRef) => {
|
6
6
|
const styles = getClassName(style);
|
7
|
-
const ref = createUnistylesRef(styles);
|
7
|
+
const ref = createUnistylesRef(styles, forwardedRef);
|
8
8
|
const [generatedStyles] = styles ?? [];
|
9
9
|
return {
|
10
10
|
className: [generatedStyles?.hash, generatedStyles?.injectedClassName].filter(Boolean).join(' '),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["getClassName","createUnistylesRef","getWebProps","style","styles","ref","generatedStyles","className","hash","injectedClassName","filter","Boolean","join"],"sourceRoot":"../../../src","sources":["web-only/getWebProps.ts"],"mappings":";;AACA,SAASA,YAAY,QAAQ,SAAS;AAEtC,SAASC,kBAAkB,QAAQ,iCAAiC;AAEpE,OAAO,MAAMC,WAAW,
|
1
|
+
{"version":3,"names":["getClassName","createUnistylesRef","getWebProps","style","forwardedRef","styles","ref","generatedStyles","className","hash","injectedClassName","filter","Boolean","join"],"sourceRoot":"../../../src","sources":["web-only/getWebProps.ts"],"mappings":";;AACA,SAASA,YAAY,QAAQ,SAAS;AAEtC,SAASC,kBAAkB,QAAQ,iCAAiC;AAEpE,OAAO,MAAMC,WAAW,GAAGA,CAAIC,KAAyB,EAAEC,YAAoC,KAAK;EAC/F,MAAMC,MAAM,GAAGL,YAAY,CAACG,KAAwB,CAAC;EACrD,MAAMG,GAAG,GAAGL,kBAAkB,CAAII,MAAM,EAAED,YAAY,CAAC;EACvD,MAAM,CAACG,eAAe,CAAC,GAAGF,MAAM,IAAI,EAAE;EAEtC,OAAO;IACHG,SAAS,EAAE,CACPD,eAAe,EAAEE,IAAI,EACrBF,eAAe,EAAEG,iBAAiB,CACrC,CAACC,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;IAC3BP;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { StyleProp } from 'react-native';
|
2
2
|
import type { RNStyle } from '../types';
|
3
|
-
export declare const getWebProps: <T>(style: StyleProp<RNStyle>) => {
|
3
|
+
export declare const getWebProps: <T>(style: StyleProp<RNStyle>, forwardedRef?: React.ForwardedRef<T>) => {
|
4
4
|
className: string;
|
5
5
|
ref: ((ref: import("../types").Nullable<T>) => void) | undefined;
|
6
6
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getWebProps.d.ts","sourceRoot":"","sources":["../../../../src/web-only/getWebProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C,OAAO,KAAK,EAAE,OAAO,EAAmB,MAAM,UAAU,CAAA;AAGxD,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,OAAO,SAAS,CAAC,OAAO,CAAC;;;
|
1
|
+
{"version":3,"file":"getWebProps.d.ts","sourceRoot":"","sources":["../../../../src/web-only/getWebProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C,OAAO,KAAK,EAAE,OAAO,EAAmB,MAAM,UAAU,CAAA;AAGxD,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,OAAO,SAAS,CAAC,OAAO,CAAC,EAAE,eAAe,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;;;CAY7F,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-native-unistyles",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.12",
|
4
4
|
"description": "Level up your React Native StyleSheet",
|
5
5
|
"scripts": {
|
6
6
|
"test": "NODE_ENV=babel-test jest ./plugin",
|
@@ -148,11 +148,11 @@
|
|
148
148
|
"husky": "9.1.7",
|
149
149
|
"jest": "29.7.0",
|
150
150
|
"metro-react-native-babel-preset": "0.77.0",
|
151
|
-
"
|
151
|
+
"nitrogen": "0.29.4",
|
152
152
|
"react": "19.1.0",
|
153
153
|
"react-native": "0.79.2",
|
154
154
|
"react-native-builder-bob": "0.40.10",
|
155
|
-
"react-native-nitro-modules": "0.29.
|
155
|
+
"react-native-nitro-modules": "0.29.4",
|
156
156
|
"react-native-reanimated": "3.17.5",
|
157
157
|
"react-native-web": "0.20.0",
|
158
158
|
"react-test-renderer": "19.1.0",
|
@@ -3,9 +3,9 @@ import { getClassName } from '../core'
|
|
3
3
|
import type { RNStyle, UnistylesValues } from '../types'
|
4
4
|
import { createUnistylesRef } from '../web/utils/createUnistylesRef'
|
5
5
|
|
6
|
-
export const getWebProps = <T>(style: StyleProp<RNStyle>) => {
|
6
|
+
export const getWebProps = <T>(style: StyleProp<RNStyle>, forwardedRef?: React.ForwardedRef<T>) => {
|
7
7
|
const styles = getClassName(style as UnistylesValues)
|
8
|
-
const ref = createUnistylesRef<T>(styles)
|
8
|
+
const ref = createUnistylesRef<T>(styles, forwardedRef)
|
9
9
|
const [generatedStyles] = styles ?? []
|
10
10
|
|
11
11
|
return {
|