react-native-unistyles 3.0.0-nightly-20250219 → 3.0.0-nightly-20250221
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 +3 -0
- package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +5 -1
- package/cxx/parser/Parser.cpp +1 -0
- package/lib/commonjs/components/native/ImageBackground.js +26 -30
- package/lib/commonjs/components/native/ImageBackground.js.map +1 -1
- package/lib/commonjs/components/native/Pressable.native.js +1 -1
- package/lib/commonjs/components/native/Pressable.native.js.map +1 -1
- package/lib/commonjs/core/useProxifiedUnistyles/useProxifiedUnistyles.js +1 -1
- package/lib/commonjs/core/useProxifiedUnistyles/useProxifiedUnistyles.js.map +1 -1
- package/lib/module/components/native/ImageBackground.js +26 -30
- package/lib/module/components/native/ImageBackground.js.map +1 -1
- package/lib/module/components/native/Pressable.native.js +1 -1
- package/lib/module/components/native/Pressable.native.js.map +1 -1
- package/lib/module/core/useProxifiedUnistyles/useProxifiedUnistyles.js +1 -1
- package/lib/module/core/useProxifiedUnistyles/useProxifiedUnistyles.js.map +1 -1
- package/lib/typescript/src/components/native/ImageBackground.d.ts.map +1 -1
- package/package.json +10 -10
- package/src/components/native/ImageBackground.tsx +3 -4
- package/src/components/native/Pressable.native.tsx +1 -1
- package/src/core/useProxifiedUnistyles/useProxifiedUnistyles.ts +1 -1
package/README.md
CHANGED
@@ -77,6 +77,9 @@ Then follow [installation guides](https://unistyl.es/v3/start/getting-started) f
|
|
77
77
|
<a href="https://github.com/dacoto97">
|
78
78
|
<img src="https://avatars.githubusercontent.com/u/16915053?v=4" height="70px" width="70px" alt="dacoto97" />
|
79
79
|
</a>
|
80
|
+
<a href="https://github.com/chinamcafee">
|
81
|
+
<img src="https://avatars.githubusercontent.com/u/3439961?v=4" height="70px" width="70px" alt="chinamcafee" />
|
82
|
+
</a>
|
80
83
|
|
81
84
|
## Past sponsors
|
82
85
|
|
@@ -73,9 +73,13 @@ void HybridUnistylesRuntime::setTheme(const std::string &themeName) {
|
|
73
73
|
helpers::assertThat(*_rt, !this->getHasAdaptiveThemes(), "Unistyles: You're trying to set theme to: '" + themeName + "', but adaptiveThemes are enabled.");
|
74
74
|
|
75
75
|
auto& state = core::UnistylesRegistry::get().getState(*_rt);
|
76
|
+
auto& currentThemeName = state.getCurrentThemeName();
|
76
77
|
|
77
78
|
state.setTheme(themeName);
|
78
|
-
|
79
|
+
|
80
|
+
if (currentThemeName != themeName) {
|
81
|
+
this->_onDependenciesChange({UnistyleDependency::THEME, UnistyleDependency::THEMENAME});
|
82
|
+
}
|
79
83
|
};
|
80
84
|
|
81
85
|
void HybridUnistylesRuntime::setAdaptiveThemes(bool isEnabled) {
|
package/cxx/parser/Parser.cpp
CHANGED
@@ -305,6 +305,7 @@ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, Dependenc
|
|
305
305
|
unistyle->rawValue = parsedStyleSheetsWithDefaultTheme[unistyleStyleSheet].asObject(rt).getProperty(rt, unistyle->styleKey.c_str()).asObject(rt);
|
306
306
|
this->rebuildUnistyle(rt, unistyle, unistyleData->variants, unistyleData->dynamicFunctionMetadata);
|
307
307
|
unistyleData->parsedStyle = jsi::Value(rt, unistyle->parsedStyle.value()).asObject(rt);
|
308
|
+
unistyle->isDirty = true;
|
308
309
|
}
|
309
310
|
|
310
311
|
if (!parsedUnistyles.contains(unistyle)) {
|
@@ -18,39 +18,35 @@ const UnistylesImageBackground = /*#__PURE__*/(0, _react.forwardRef)((props, for
|
|
18
18
|
let storedImageRef = null;
|
19
19
|
const styleClassNames = (0, _core.getClassName)(props.style);
|
20
20
|
const imageClassNames = (0, _core.getClassName)(props.imageStyle);
|
21
|
-
return (
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
imageStyle: imageClassNames,
|
28
|
-
ref: (0, _utils2.isServer)() ? undefined : ref => {
|
29
|
-
if (!ref) {
|
30
|
-
// @ts-expect-error hidden from TS
|
31
|
-
_web.UnistylesShadowRegistry.remove(storedRef, styleClassNames?.hash);
|
32
|
-
}
|
33
|
-
storedRef = ref;
|
21
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ImageBackground, {
|
22
|
+
...props,
|
23
|
+
style: styleClassNames,
|
24
|
+
imageStyle: imageClassNames,
|
25
|
+
ref: (0, _utils2.isServer)() ? undefined : ref => {
|
26
|
+
if (!ref) {
|
34
27
|
// @ts-expect-error hidden from TS
|
35
|
-
_web.UnistylesShadowRegistry.
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
}
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
28
|
+
_web.UnistylesShadowRegistry.remove(storedRef, styleClassNames?.hash);
|
29
|
+
}
|
30
|
+
storedRef = ref;
|
31
|
+
// @ts-expect-error hidden from TS
|
32
|
+
_web.UnistylesShadowRegistry.add(ref, styleClassNames?.hash);
|
33
|
+
if (typeof forwardedRef === 'function') {
|
34
|
+
return forwardedRef(ref);
|
35
|
+
}
|
36
|
+
if (forwardedRef) {
|
37
|
+
forwardedRef.current = ref;
|
38
|
+
}
|
39
|
+
},
|
40
|
+
imageRef: (0, _utils2.isServer)() ? undefined : ref => {
|
41
|
+
if (!ref) {
|
49
42
|
// @ts-expect-error hidden from TS
|
50
|
-
_web.UnistylesShadowRegistry.
|
43
|
+
_web.UnistylesShadowRegistry.remove(storedImageRef, imageClassNames?.hash);
|
51
44
|
}
|
52
|
-
|
53
|
-
|
45
|
+
storedImageRef = ref;
|
46
|
+
// @ts-expect-error hidden from TS
|
47
|
+
_web.UnistylesShadowRegistry.add(ref, imageClassNames?.hash);
|
48
|
+
}
|
49
|
+
});
|
54
50
|
});
|
55
51
|
const ImageBackground = exports.ImageBackground = (0, _utils.copyComponentProperties)(_reactNative.ImageBackground, UnistylesImageBackground);
|
56
52
|
//# sourceMappingURL=ImageBackground.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_core","_utils","_web","_utils2","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","UnistylesImageBackground","forwardRef","props","forwardedRef","storedRef","storedImageRef","styleClassNames","getClassName","style","imageClassNames","imageStyle","jsx","ImageBackground","ref","isServer","undefined","UnistylesShadowRegistry","remove","hash","add","current","imageRef","exports","copyComponentProperties","NativeImageBackground"],"sourceRoot":"../../../../src","sources":["components/native/ImageBackground.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAA0C,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAO1C,MAAMW,wBAAwB,gBAAG,IAAAC,iBAAU,EAAiB,CAACC,KAAK,EAAEC,YAAY,KAAK;EACjF,IAAIC,SAAuC,GAAG,IAAI;EAClD,IAAIC,cAA4C,GAAG,IAAI;EACvD,MAAMC,eAAe,GAAG,IAAAC,kBAAY,EAACL,KAAK,CAACM,KAAK,CAAC;EACjD,MAAMC,eAAe,GAAG,IAAAF,kBAAY,EAACL,KAAK,CAACQ,UAAU,CAAC;EAEtD
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_core","_utils","_web","_utils2","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","UnistylesImageBackground","forwardRef","props","forwardedRef","storedRef","storedImageRef","styleClassNames","getClassName","style","imageClassNames","imageStyle","jsx","ImageBackground","ref","isServer","undefined","UnistylesShadowRegistry","remove","hash","add","current","imageRef","exports","copyComponentProperties","NativeImageBackground"],"sourceRoot":"../../../../src","sources":["components/native/ImageBackground.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;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AC3D;EAAE,CACL,CAAC;AAEV,CAAC,CAAC;AAEK,MAAMN,eAAe,GAAAU,OAAA,CAAAV,eAAA,GAAG,IAAAW,8BAAuB,EAACC,4BAAqB,EAAExB,wBAAwB,CAAC","ignoreList":[]}
|
@@ -27,7 +27,7 @@ const Pressable = exports.Pressable = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
27
27
|
style,
|
28
28
|
...props
|
29
29
|
}, forwardedRef) => {
|
30
|
-
const storedRef = (0, _react.useRef)();
|
30
|
+
const storedRef = (0, _react.useRef)(null);
|
31
31
|
const scopedTheme = _specs.UnistylesShadowRegistry.getScopedTheme();
|
32
32
|
(0, _react.useLayoutEffect)(() => {
|
33
33
|
return () => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_core","_specs","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","getStyles","styleProps","unistyleKey","keys","find","key","startsWith","uni__getStyles","Pressable","exports","forwardRef","variants","style","props","forwardedRef","storedRef","useRef","scopedTheme","UnistylesShadowRegistry","getScopedTheme","useLayoutEffect","current","remove","jsx","ref","isPropStyleAFunction","unistyles","pressed","add","passForwardedRef","state","previousScopedTheme","setScopedTheme"],"sourceRoot":"../../../../src","sources":["components/native/Pressable.native.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAqD,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAA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cAAc,CAAC,CAAC;IAC3C,CAACL,WAAW,GAAGD,UAAU,CAACC,WAAW;EACzC,CAAC;AACL,CAAC;AAEM,MAAMM,SAAS,GAAAC,OAAA,CAAAD,SAAA,gBAAG,IAAAE,iBAAU,EAAuB,CAAC;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,YAAY,KAAK;EACvG,MAAMC,SAAS,GAAG,IAAAC,aAAM,EAAc,CAAC;
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_core","_specs","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","getStyles","styleProps","unistyleKey","keys","find","key","startsWith","uni__getStyles","Pressable","exports","forwardRef","variants","style","props","forwardedRef","storedRef","useRef","scopedTheme","UnistylesShadowRegistry","getScopedTheme","useLayoutEffect","current","remove","jsx","ref","isPropStyleAFunction","unistyles","pressed","add","passForwardedRef","state","previousScopedTheme","setScopedTheme"],"sourceRoot":"../../../../src","sources":["components/native/Pressable.native.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAqD,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA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AAS,CAACY,KAAuC,CAAC;MAExD,IAAI,CAACG,SAAS,CAACM,OAAO,EAAE;QACpB,OAAOK,SAAS;MACpB;;MAEA;MACAR,8BAAuB,CAACI,MAAM,CAACP,SAAS,CAACM,OAAO,CAAC;;MAEjD;MACAH,8BAAuB,CAACU,GAAG,CAACb,SAAS,CAACM,OAAO,EAAEK,SAAS,CAAC;MAEzDR,8BAAuB,CAACc,cAAc,CAACD,mBAAmB,CAAC;MAE3D,OAAOL,SAAS;IACpB;EAAE,CACL,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
|
@@ -34,7 +34,7 @@ const useProxifiedUnistyles = forcedTheme => {
|
|
34
34
|
const [dependencies] = (0, _react.useState)(() => new Set());
|
35
35
|
const [theme, setTheme] = (0, _react.useState)(_specs.UnistylesRuntime.getTheme(scopedTheme));
|
36
36
|
const [_, runtimeChanged] = (0, _react.useReducer)(() => ({}), {});
|
37
|
-
const disposeRef = (0, _react.useRef)();
|
37
|
+
const disposeRef = (0, _react.useRef)(undefined);
|
38
38
|
const reinitListener = () => {
|
39
39
|
disposeRef.current?.();
|
40
40
|
disposeRef.current = (0, _listener.listener)({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","require","_specs","_NativePlatform","_listener","getMiniRuntime","UnistylesRuntime","miniRuntime","RTDependencyMap","breakpoint","UnistyleDependency","Breakpoints","colorScheme","ColorScheme","contentSizeCategory","ContentSizeCategory","hasAdaptiveThemes","AdaptiveThemes","insets","Insets","fontScale","FontScale","isLandscape","Orientation","isPortrait","navigationBar","NavigationBar","screen","Dimensions","statusBar","StatusBar","pixelRatio","PixelRatio","themeName","ThemeName","useProxifiedUnistyles","forcedTheme","scopedTheme","UnistylesShadowRegistry","getScopedTheme","dependencies","useState","Set","theme","setTheme","getTheme","_","runtimeChanged","useReducer","disposeRef","useRef","reinitListener","current","listener","Array","from","updateTheme","updateRuntime","useEffect","size","proxifiedTheme","Proxy","get","target","prop","add","Theme","proxifiedRuntime","addDependencies","newDependencies","dependenciesSize","forEach","dependency","exports"],"sourceRoot":"../../../../src","sources":["core/useProxifiedUnistyles/useProxifiedUnistyles.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AAHA;;AAKA,MAAMI,cAAc,GAAGA,CAAA,KAA4B;EAC/C;EACA,OAAOC,uBAAgB,CAACC,WAAW;AACvC,CAAC;AAED,MAAMC,eAAe,GAAG;EACpBC,UAAU,EAAEC,kCAAkB,CAACC,WAAW;EAC1CC,WAAW,EAAEF,kCAAkB,CAACG,WAAW;EAC3CC,mBAAmB,EAAEJ,kCAAkB,CAACK,mBAAmB;EAC3DC,iBAAiB,EAAEN,kCAAkB,CAACO,cAAc;EACpDC,MAAM,EAAER,kCAAkB,CAACS,MAAM;EACjCC,SAAS,EAAEV,kCAAkB,CAACW,SAAS;EACvCC,WAAW,EAAEZ,kCAAkB,CAACa,WAAW;EAC3CC,UAAU,EAAEd,kCAAkB,CAACa,WAAW;EAC1CE,aAAa,EAAEf,kCAAkB,CAACgB,aAAa;EAC/CC,MAAM,EAAEjB,kCAAkB,CAACkB,UAAU;EACrCC,SAAS,EAAEnB,kCAAkB,CAACoB,SAAS;EACvCC,UAAU,EAAErB,kCAAkB,CAACsB,UAAU;EACzCC,SAAS,EAAEvB,kCAAkB,CAACwB;AAClC,CAA2E;AAEpE,MAAMC,qBAAqB,GAAIC,WAA4B,IAAK;EACnE,MAAMC,WAAW,GAAGD,WAAW,IAAIE,8BAAuB,CAACC,cAAc,CAAC,CAAmB;EAC7F,MAAM,CAACC,YAAY,CAAC,GAAG,IAAAC,eAAQ,EAAC,MAAM,IAAIC,GAAG,CAAS,CAAC,CAAC;EACxD,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAG,IAAAH,eAAQ,EAACnC,uBAAgB,CAACuC,QAAQ,CAACR,WAAW,CAAC,CAAC;EAC1E,MAAM,CAACS,CAAC,EAAEC,cAAc,CAAC,GAAG,IAAAC,iBAAU,EAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EACtD,MAAMC,UAAU,GAAG,IAAAC,aAAM,
|
1
|
+
{"version":3,"names":["_react","require","_specs","_NativePlatform","_listener","getMiniRuntime","UnistylesRuntime","miniRuntime","RTDependencyMap","breakpoint","UnistyleDependency","Breakpoints","colorScheme","ColorScheme","contentSizeCategory","ContentSizeCategory","hasAdaptiveThemes","AdaptiveThemes","insets","Insets","fontScale","FontScale","isLandscape","Orientation","isPortrait","navigationBar","NavigationBar","screen","Dimensions","statusBar","StatusBar","pixelRatio","PixelRatio","themeName","ThemeName","useProxifiedUnistyles","forcedTheme","scopedTheme","UnistylesShadowRegistry","getScopedTheme","dependencies","useState","Set","theme","setTheme","getTheme","_","runtimeChanged","useReducer","disposeRef","useRef","undefined","reinitListener","current","listener","Array","from","updateTheme","updateRuntime","useEffect","size","proxifiedTheme","Proxy","get","target","prop","add","Theme","proxifiedRuntime","addDependencies","newDependencies","dependenciesSize","forEach","dependency","exports"],"sourceRoot":"../../../../src","sources":["core/useProxifiedUnistyles/useProxifiedUnistyles.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AAHA;;AAKA,MAAMI,cAAc,GAAGA,CAAA,KAA4B;EAC/C;EACA,OAAOC,uBAAgB,CAACC,WAAW;AACvC,CAAC;AAED,MAAMC,eAAe,GAAG;EACpBC,UAAU,EAAEC,kCAAkB,CAACC,WAAW;EAC1CC,WAAW,EAAEF,kCAAkB,CAACG,WAAW;EAC3CC,mBAAmB,EAAEJ,kCAAkB,CAACK,mBAAmB;EAC3DC,iBAAiB,EAAEN,kCAAkB,CAACO,cAAc;EACpDC,MAAM,EAAER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props, forwardedRef) =
|
|
13
13
|
let storedImageRef = null;
|
14
14
|
const styleClassNames = getClassName(props.style);
|
15
15
|
const imageClassNames = getClassName(props.imageStyle);
|
16
|
-
return (
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
imageStyle: imageClassNames,
|
23
|
-
ref: isServer() ? undefined : ref => {
|
24
|
-
if (!ref) {
|
25
|
-
// @ts-expect-error hidden from TS
|
26
|
-
UnistylesShadowRegistry.remove(storedRef, styleClassNames?.hash);
|
27
|
-
}
|
28
|
-
storedRef = ref;
|
16
|
+
return /*#__PURE__*/_jsx(NativeImageBackground, {
|
17
|
+
...props,
|
18
|
+
style: styleClassNames,
|
19
|
+
imageStyle: imageClassNames,
|
20
|
+
ref: isServer() ? undefined : ref => {
|
21
|
+
if (!ref) {
|
29
22
|
// @ts-expect-error hidden from TS
|
30
|
-
UnistylesShadowRegistry.
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
}
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
23
|
+
UnistylesShadowRegistry.remove(storedRef, styleClassNames?.hash);
|
24
|
+
}
|
25
|
+
storedRef = ref;
|
26
|
+
// @ts-expect-error hidden from TS
|
27
|
+
UnistylesShadowRegistry.add(ref, styleClassNames?.hash);
|
28
|
+
if (typeof forwardedRef === 'function') {
|
29
|
+
return forwardedRef(ref);
|
30
|
+
}
|
31
|
+
if (forwardedRef) {
|
32
|
+
forwardedRef.current = ref;
|
33
|
+
}
|
34
|
+
},
|
35
|
+
imageRef: isServer() ? undefined : ref => {
|
36
|
+
if (!ref) {
|
44
37
|
// @ts-expect-error hidden from TS
|
45
|
-
UnistylesShadowRegistry.
|
38
|
+
UnistylesShadowRegistry.remove(storedImageRef, imageClassNames?.hash);
|
46
39
|
}
|
47
|
-
|
48
|
-
|
40
|
+
storedImageRef = ref;
|
41
|
+
// @ts-expect-error hidden from TS
|
42
|
+
UnistylesShadowRegistry.add(ref, imageClassNames?.hash);
|
43
|
+
}
|
44
|
+
});
|
49
45
|
});
|
50
46
|
export const ImageBackground = copyComponentProperties(NativeImageBackground, UnistylesImageBackground);
|
51
47
|
//# sourceMappingURL=ImageBackground.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","forwardRef","ImageBackground","NativeImageBackground","getClassName","copyComponentProperties","UnistylesShadowRegistry","isServer","jsx","_jsx","UnistylesImageBackground","props","forwardedRef","storedRef","storedImageRef","styleClassNames","style","imageClassNames","imageStyle","ref","undefined","remove","hash","add","current","imageRef"],"sourceRoot":"../../../../src","sources":["components/native/ImageBackground.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,OAAO;AAClC,
|
1
|
+
{"version":3,"names":["React","forwardRef","ImageBackground","NativeImageBackground","getClassName","copyComponentProperties","UnistylesShadowRegistry","isServer","jsx","_jsx","UnistylesImageBackground","props","forwardedRef","storedRef","storedImageRef","styleClassNames","style","imageClassNames","imageStyle","ref","undefined","remove","hash","add","current","imageRef"],"sourceRoot":"../../../../src","sources":["components/native/ImageBackground.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,OAAO;AAClC,SAA0BC,eAAe,IAAIC,qBAAqB,QAAwC,cAAc;AACxH,SAASC,YAAY,QAAQ,YAAY;AAEzC,SAASC,uBAAuB,QAAQ,aAAa;AACrD,SAASC,uBAAuB,QAAQ,WAAW;AACnD,SAASC,QAAQ,QAAQ,iBAAiB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAO1C,MAAMC,wBAAwB,gBAAGT,UAAU,CAAiB,CAACU,KAAK,EAAEC,YAAY,KAAK;EACjF,IAAIC,SAAuC,GAAG,IAAI;EAClD,IAAIC,cAA4C,GAAG,IAAI;EACvD,MAAMC,eAAe,GAAGX,YAAY,CAACO,KAAK,CAACK,KAAK,CAAC;EACjD,MAAMC,eAAe,GAAGb,YAAY,CAACO,KAAK,CAACO,UAAU,CAAC;EAEtD,oBACIT,IAAA,CAACN,qBAAqB;IAAA,GACdQ,KAAK;IACTK,KAAK,EAAED,eAAwC;IAC/CG,UAAU,EAAED,eAAyC;IACrDE,GAAG,EAAEZ,QAAQ,CAAC,CAAC,GAAGa,SAAS,GAAGD,GAAG,IAAI;MACjC,IAAI,CAACA,GAAG,EAAE;QACN;QACAb,uBAAuB,CAACe,MAAM,CAACR,SAAS,EAAEE,eAAe,EAAEO,IAAI,CAAC;MACpE;MAEAT,SAAS,GAAGM,GAAG;MACf;MACAb,uBAAuB,CAACiB,GAAG,CAACJ,GAAG,EAAEJ,eAAe,EAAEO,IAAI,CAAC;MAEvD,IAAI,OAAOV,YAAY,KAAK,UAAU,EAAE;QACpC,OAAOA,YAAY,CAACO,GAAG,CAAC;MAC5B;MAEA,IAAIP,YAAY,EAAE;QACdA,YAAY,CAACY,OAAO,GAAGL,GAAG;MAC9B;IACJ,CAAE;IACFM,QAAQ,EAAElB,QAAQ,CAAC,CAAC,GAAGa,SAAS,GAAGD,GAAG,IAAI;MACtC,IAAI,CAACA,GAAG,EAAE;QACN;QACAb,uBAAuB,CAACe,MAAM,CAACP,cAAc,EAAEG,eAAe,EAAEK,IAAI,CAAC;MACzE;MAEAR,cAAc,GAAGK,GAAG;MACpB;MACAb,uBAAuB,CAACiB,GAAG,CAACJ,GAAG,EAAEF,eAAe,EAAEK,IAAI,CAAC;IAC3D;EAAE,CACL,CAAC;AAEV,CAAC,CAAC;AAEF,OAAO,MAAMpB,eAAe,GAAGG,uBAAuB,CAACF,qBAAqB,EAAEO,wBAAwB,CAAC","ignoreList":[]}
|
@@ -21,7 +21,7 @@ export const Pressable = /*#__PURE__*/forwardRef(({
|
|
21
21
|
style,
|
22
22
|
...props
|
23
23
|
}, forwardedRef) => {
|
24
|
-
const storedRef = useRef();
|
24
|
+
const storedRef = useRef(null);
|
25
25
|
const scopedTheme = UnistylesShadowRegistry.getScopedTheme();
|
26
26
|
useLayoutEffect(() => {
|
27
27
|
return () => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","forwardRef","useLayoutEffect","useRef","Pressable","NativePressableReactNative","passForwardedRef","UnistylesShadowRegistry","jsx","_jsx","getStyles","styleProps","unistyleKey","Object","keys","find","key","startsWith","uni__getStyles","variants","style","props","forwardedRef","storedRef","scopedTheme","getScopedTheme","current","remove","ref","isPropStyleAFunction","unistyles","call","pressed","add","state","previousScopedTheme","setScopedTheme"],"sourceRoot":"../../../../src","sources":["components/native/Pressable.native.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,eAAe,EAAEC,MAAM,QAAQ,OAAO;AAClE,SAASC,SAAS,IAAIC,0BAA0B,QAAQ,cAAc;AAEtE,SAASC,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,uBAAuB,QAAQ,aAAa;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAMrD,MAAMC,SAAS,GAAGA,CAACC,UAA+B,GAAG,CAAC,CAAC,KAAK;EACxD,MAAMC,WAAW,GAAGC,MAAM,CACrBC,IAAI,CAACH,UAAU,CAAC,CAChBI,IAAI,CAACC,GAAG,IAAIA,GAAG,CAACC,UAAU,CAAC,YAAY,CAAC,CAAC;EAE9C,IAAI,CAACL,WAAW,EAAE;IACd,OAAOD,UAAU;EACrB;EAEA,OAAO;IACH;IACA,GAAGA,UAAU,CAACC,WAAW,CAAC,CAACM,cAAc,CAAC,CAAC;IAC3C,CAACN,WAAW,GAAGD,UAAU,CAACC,WAAW;EACzC,CAAC;AACL,CAAC;AAED,OAAO,MAAMR,SAAS,gBAAGH,UAAU,CAAuB,CAAC;EAAEkB,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,YAAY,KAAK;EACvG,MAAMC,SAAS,GAAGpB,MAAM,CAAc,CAAC;
|
1
|
+
{"version":3,"names":["React","forwardRef","useLayoutEffect","useRef","Pressable","NativePressableReactNative","passForwardedRef","UnistylesShadowRegistry","jsx","_jsx","getStyles","styleProps","unistyleKey","Object","keys","find","key","startsWith","uni__getStyles","variants","style","props","forwardedRef","storedRef","scopedTheme","getScopedTheme","current","remove","ref","isPropStyleAFunction","unistyles","call","pressed","add","state","previousScopedTheme","setScopedTheme"],"sourceRoot":"../../../../src","sources":["components/native/Pressable.native.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,eAAe,EAAEC,MAAM,QAAQ,OAAO;AAClE,SAASC,SAAS,IAAIC,0BAA0B,QAAQ,cAAc;AAEtE,SAASC,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,uBAAuB,QAAQ,aAAa;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAMrD,MAAMC,SAAS,GAAGA,CAACC,UAA+B,GAAG,CAAC,CAAC,KAAK;EACxD,MAAMC,WAAW,GAAGC,MAAM,CACrBC,IAAI,CAACH,UAAU,CAAC,CAChBI,IAAI,CAACC,GAAG,IAAIA,GAAG,CAACC,UAAU,CAAC,YAAY,CAAC,CAAC;EAE9C,IAAI,CAACL,WAAW,EAAE;IACd,OAAOD,UAAU;EACrB;EAEA,OAAO;IACH;IACA,GAAGA,UAAU,CAACC,WAAW,CAAC,CAACM,cAAc,CAAC,CAAC;IAC3C,CAACN,WAAW,GAAGD,UAAU,CAACC,WAAW;EACzC,CAAC;AACL,CAAC;AAED,OAAO,MAAMR,SAAS,gBAAGH,UAAU,CAAuB,CAAC;EAAEkB,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,YAAY,KAAK;EACvG,MAAMC,SAAS,GAAGpB,MAAM,CAAc,IAAI,CAAC;EAC3C,MAAMqB,WAAW,GAAGjB,uBAAuB,CAACkB,cAAc,CAAC,CAAC;EAE5DvB,eAAe,CAAC,MAAM;IAClB,OAAO,MAAM;MACT,IAAIqB,SAAS,CAACG,OAAO,EAAE;QACnB;QACAnB,uBAAuB,CAACoB,MAAM,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C;AAEV,CAAC,CAAC","ignoreList":[]}
|
@@ -29,7 +29,7 @@ export const useProxifiedUnistyles = forcedTheme => {
|
|
29
29
|
const [dependencies] = useState(() => new Set());
|
30
30
|
const [theme, setTheme] = useState(UnistylesRuntime.getTheme(scopedTheme));
|
31
31
|
const [_, runtimeChanged] = useReducer(() => ({}), {});
|
32
|
-
const disposeRef = useRef();
|
32
|
+
const disposeRef = useRef(undefined);
|
33
33
|
const reinitListener = () => {
|
34
34
|
disposeRef.current?.();
|
35
35
|
disposeRef.current = listener({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["useEffect","useReducer","useRef","useState","UnistylesRuntime","UnistylesShadowRegistry","UnistyleDependency","listener","getMiniRuntime","miniRuntime","RTDependencyMap","breakpoint","Breakpoints","colorScheme","ColorScheme","contentSizeCategory","ContentSizeCategory","hasAdaptiveThemes","AdaptiveThemes","insets","Insets","fontScale","FontScale","isLandscape","Orientation","isPortrait","navigationBar","NavigationBar","screen","Dimensions","statusBar","StatusBar","pixelRatio","PixelRatio","themeName","ThemeName","useProxifiedUnistyles","forcedTheme","scopedTheme","getScopedTheme","dependencies","Set","theme","setTheme","getTheme","_","runtimeChanged","disposeRef","reinitListener","current","Array","from","updateTheme","updateRuntime","size","proxifiedTheme","Proxy","get","target","prop","add","Theme","proxifiedRuntime","addDependencies","newDependencies","dependenciesSize","forEach","dependency"],"sourceRoot":"../../../../src","sources":["core/useProxifiedUnistyles/useProxifiedUnistyles.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,UAAU,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC/D,SAAoCC,gBAAgB,EAAEC,uBAAuB,QAAQ,aAAa;AAClG;AACA,SAASC,kBAAkB,QAAQ,4BAA4B;AAE/D,SAASC,QAAQ,QAAQ,YAAY;AAErC,MAAMC,cAAc,GAAGA,CAAA,KAA4B;EAC/C;EACA,OAAOJ,gBAAgB,CAACK,WAAW;AACvC,CAAC;AAED,MAAMC,eAAe,GAAG;EACpBC,UAAU,EAAEL,kBAAkB,CAACM,WAAW;EAC1CC,WAAW,EAAEP,kBAAkB,CAACQ,WAAW;EAC3CC,mBAAmB,EAAET,kBAAkB,CAACU,mBAAmB;EAC3DC,iBAAiB,EAAEX,kBAAkB,CAACY,cAAc;EACpDC,MAAM,EAAEb,kBAAkB,CAACc,MAAM;EACjCC,SAAS,EAAEf,kBAAkB,CAACgB,SAAS;EACvCC,WAAW,EAAEjB,kBAAkB,CAACkB,WAAW;EAC3CC,UAAU,EAAEnB,kBAAkB,CAACkB,WAAW;EAC1CE,aAAa,EAAEpB,kBAAkB,CAACqB,aAAa;EAC/CC,MAAM,EAAEtB,kBAAkB,CAACuB,UAAU;EACrCC,SAAS,EAAExB,kBAAkB,CAACyB,SAAS;EACvCC,UAAU,EAAE1B,kBAAkB,CAAC2B,UAAU;EACzCC,SAAS,EAAE5B,kBAAkB,CAAC6B;AAClC,CAA2E;AAE3E,OAAO,MAAMC,qBAAqB,GAAIC,WAA4B,IAAK;EACnE,MAAMC,WAAW,GAAGD,WAAW,IAAIhC,uBAAuB,CAACkC,cAAc,CAAC,CAAmB;EAC7F,MAAM,CAACC,YAAY,CAAC,GAAGrC,QAAQ,CAAC,MAAM,IAAIsC,GAAG,CAAS,CAAC,CAAC;EACxD,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGxC,QAAQ,CAACC,gBAAgB,CAACwC,QAAQ,CAACN,WAAW,CAAC,CAAC;EAC1E,MAAM,CAACO,CAAC,EAAEC,cAAc,CAAC,GAAG7C,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EACtD,MAAM8C,UAAU,GAAG7C,MAAM,
|
1
|
+
{"version":3,"names":["useEffect","useReducer","useRef","useState","UnistylesRuntime","UnistylesShadowRegistry","UnistyleDependency","listener","getMiniRuntime","miniRuntime","RTDependencyMap","breakpoint","Breakpoints","colorScheme","ColorScheme","contentSizeCategory","ContentSizeCategory","hasAdaptiveThemes","AdaptiveThemes","insets","Insets","fontScale","FontScale","isLandscape","Orientation","isPortrait","navigationBar","NavigationBar","screen","Dimensions","statusBar","StatusBar","pixelRatio","PixelRatio","themeName","ThemeName","useProxifiedUnistyles","forcedTheme","scopedTheme","getScopedTheme","dependencies","Set","theme","setTheme","getTheme","_","runtimeChanged","disposeRef","undefined","reinitListener","current","Array","from","updateTheme","updateRuntime","size","proxifiedTheme","Proxy","get","target","prop","add","Theme","proxifiedRuntime","addDependencies","newDependencies","dependenciesSize","forEach","dependency"],"sourceRoot":"../../../../src","sources":["core/useProxifiedUnistyles/useProxifiedUnistyles.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,UAAU,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC/D,SAAoCC,gBAAgB,EAAEC,uBAAuB,QAAQ,aAAa;AAClG;AACA,SAASC,kBAAkB,QAAQ,4BAA4B;AAE/D,SAASC,QAAQ,QAAQ,YAAY;AAErC,MAAMC,cAAc,GAAGA,CAAA,KAA4B;EAC/C;EACA,OAAOJ,gBAAgB,CAACK,WAAW;AACvC,CAAC;AAED,MAAMC,eAAe,GAAG;EACpBC,UAAU,EAAEL,kBAAkB,CAACM,WAAW;EAC1CC,WAAW,EAAEP,kBAAkB,CAACQ,WAAW;EAC3CC,mBAAmB,EAAET,kBAAkB,CAACU,mBAAmB;EAC3DC,iBAAiB,EAAEX,kBAAkB,CAACY,cAAc;EACpDC,MAAM,EAAEb,kBAAkB,CAACc,MAAM;EACjCC,SAAS,EAAEf,kBAAkB,CAACgB,SAAS;EACvCC,WAAW,EAAEjB,kBAAkB,CAACkB,WAAW;EAC3CC,UAAU,EAAEnB,kBAAkB,CAACkB,WAAW;EAC1CE,aAAa,EAAEpB,kBAAkB,CAACqB,aAAa;EAC/CC,MAAM,EAAEtB,kBAAkB,CAACuB,UAAU;EACrCC,SAAS,EAAExB,kBAAkB,CAACyB,SAAS;EACvCC,UAAU,EAAE1B,kBAAkB,CAAC2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nBpB,YAAY,CAACqB,GAAG,CAACvD,kBAAkB,CAACwD,KAAK,CAAC;MAE1C,OAAOH,MAAM,CAACC,IAAI,CAAC;IACvB;EACJ,CAAC,CAAC;EACF,MAAMG,gBAAgB,GAAG,IAAIN,KAAK,CAACjD,cAAc,CAAC,CAAC,EAAE;IACjDkD,GAAG,EAAEA,CAACC,MAAM,EAAEC,IAAI,KAAK;MACnB,IAAIA,IAAI,IAAIlD,eAAe,EAAE;QACzB8B,YAAY,CAACqB,GAAG,CAACnD,eAAe,CAACkD,IAAI,CAAiC,CAAC;MAC3E;MAEA,OAAOD,MAAM,CAACC,IAAI,CAAwB;IAC9C;EACJ,CAAC,CAAC;EAEF,OAAO;IACHJ,cAAc;IACdO,gBAAgB;IAChBC,eAAe,EAAGC,eAA0C,IAAK;MAC7D,MAAMC,gBAAgB,GAAG1B,YAAY,CAACe,IAAI;MAE1CU,eAAe,CAACE,OAAO,CAACC,UAAU,IAAI;QAClC5B,YAAY,CAACqB,GAAG,CAACO,UAAU,CAAC;MAChC,CAAC,CAAC;MAEF,IAAIF,gBAAgB,KAAK1B,YAAY,CAACe,IAAI,EAAE;QACxC;MACJ;MAEAN,cAAc,CAAC,CAAC;IACpB;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ImageBackground.d.ts","sourceRoot":"","sources":["../../../../../src/components/native/ImageBackground.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"ImageBackground.d.ts","sourceRoot":"","sources":["../../../../../src/components/native/ImageBackground.tsx"],"names":[],"mappings":"AAyDA,eAAO,MAAM,eAAe,KAA2E,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-native-unistyles",
|
3
|
-
"version": "3.0.0-nightly-
|
3
|
+
"version": "3.0.0-nightly-20250221",
|
4
4
|
"description": "Level up your React Native StyleSheet",
|
5
5
|
"scripts": {
|
6
6
|
"test": "jest",
|
@@ -87,19 +87,19 @@
|
|
87
87
|
"registry": "https://registry.npmjs.org/"
|
88
88
|
},
|
89
89
|
"devDependencies": {
|
90
|
-
"@babel/core": "7.26.
|
90
|
+
"@babel/core": "7.26.9",
|
91
91
|
"@babel/plugin-syntax-jsx": "7.25.9",
|
92
92
|
"@babel/preset-flow": "7.25.9",
|
93
93
|
"@babel/preset-typescript": "7.26.0",
|
94
|
-
"@babel/types": "7.26.
|
94
|
+
"@babel/types": "7.26.9",
|
95
95
|
"@biomejs/biome": "1.9.4",
|
96
|
-
"@commitlint/config-conventional": "19.
|
97
|
-
"@react-native/normalize-colors": "0.
|
96
|
+
"@commitlint/config-conventional": "19.7.1",
|
97
|
+
"@react-native/normalize-colors": "0.78.0",
|
98
98
|
"@release-it/conventional-changelog": "8.0.2",
|
99
99
|
"@types/jest": "29.5.14",
|
100
|
-
"@types/react": "
|
100
|
+
"@types/react": "19.0.10",
|
101
101
|
"babel-plugin-tester": "11.0.4",
|
102
|
-
"commitlint": "19.
|
102
|
+
"commitlint": "19.7.1",
|
103
103
|
"concurrently": "9.1.2",
|
104
104
|
"esbuild": "0.25.0",
|
105
105
|
"husky": "9.1.7",
|
@@ -107,12 +107,12 @@
|
|
107
107
|
"metro-react-native-babel-preset": "0.77.0",
|
108
108
|
"nitro-codegen": "0.22.1",
|
109
109
|
"react": "18.3.1",
|
110
|
-
"react-native": "0.77.
|
111
|
-
"react-native-builder-bob": "0.
|
110
|
+
"react-native": "0.77.1",
|
111
|
+
"react-native-builder-bob": "0.37.0",
|
112
112
|
"react-native-nitro-modules": "0.22.1",
|
113
113
|
"react-native-web": "0.19.13",
|
114
114
|
"react-test-renderer": "18.3.1",
|
115
|
-
"release-it": "17.
|
115
|
+
"release-it": "17.11.0",
|
116
116
|
"typescript": "5.7.3"
|
117
117
|
},
|
118
118
|
"peerDependencies": {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import { forwardRef } from 'react'
|
3
|
-
import { ImageBackground as NativeImageBackground } from 'react-native'
|
3
|
+
import { type ImageStyle, ImageBackground as NativeImageBackground, type StyleProp, type ViewStyle } from 'react-native'
|
4
4
|
import { getClassName } from '../../core'
|
5
5
|
import type { UnistylesValues } from '../../types'
|
6
6
|
import { copyComponentProperties } from '../../utils'
|
@@ -19,11 +19,10 @@ const UnistylesImageBackground = forwardRef<unknown, Props>((props, forwardedRef
|
|
19
19
|
const imageClassNames = getClassName(props.imageStyle)
|
20
20
|
|
21
21
|
return (
|
22
|
-
// @ts-expect-error - RN types are not compatible with RNW styles
|
23
22
|
<NativeImageBackground
|
24
23
|
{...props}
|
25
|
-
style={styleClassNames}
|
26
|
-
imageStyle={imageClassNames}
|
24
|
+
style={styleClassNames as StyleProp<ViewStyle>}
|
25
|
+
imageStyle={imageClassNames as StyleProp<ImageStyle>}
|
27
26
|
ref={isServer() ? undefined : ref => {
|
28
27
|
if (!ref) {
|
29
28
|
// @ts-expect-error hidden from TS
|
@@ -25,7 +25,7 @@ const getStyles = (styleProps: Record<string, any> = {}) => {
|
|
25
25
|
}
|
26
26
|
|
27
27
|
export const Pressable = forwardRef<View, PressableProps>(({ variants, style, ...props }, forwardedRef) => {
|
28
|
-
const storedRef = useRef<View | null>()
|
28
|
+
const storedRef = useRef<View | null>(null)
|
29
29
|
const scopedTheme = UnistylesShadowRegistry.getScopedTheme()
|
30
30
|
|
31
31
|
useLayoutEffect(() => {
|
@@ -31,7 +31,7 @@ export const useProxifiedUnistyles = (forcedTheme?: UnistylesTheme) => {
|
|
31
31
|
const [dependencies] = useState(() => new Set<number>())
|
32
32
|
const [theme, setTheme] = useState(UnistylesRuntime.getTheme(scopedTheme))
|
33
33
|
const [_, runtimeChanged] = useReducer(() => ({}), {})
|
34
|
-
const disposeRef = useRef<VoidFunction>()
|
34
|
+
const disposeRef = useRef<VoidFunction>(undefined)
|
35
35
|
|
36
36
|
const reinitListener = () => {
|
37
37
|
disposeRef.current?.()
|