react-native-unistyles 3.0.0-rc.2 → 3.0.0-rc.4
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 +17 -17
- package/Unistyles.podspec +1 -0
- package/components/native/ActivityIndicator/package.json +1 -0
- package/components/native/Animated/package.json +1 -0
- package/components/native/FlatList/package.json +1 -0
- package/components/native/Image/package.json +1 -0
- package/components/native/ImageBackground/package.json +1 -0
- package/components/native/KeyboardAvoidingView/package.json +1 -0
- package/components/native/NativeText/package.json +1 -0
- package/components/native/NativeView/package.json +1 -0
- package/components/native/Pressable/package.json +1 -0
- package/components/native/RefreshControl/package.json +1 -0
- package/components/native/ScrollView/package.json +1 -0
- package/components/native/SectionList/package.json +1 -0
- package/components/native/Switch/package.json +1 -0
- package/components/native/Text/package.json +1 -0
- package/components/native/TextInput/package.json +1 -0
- package/components/native/TouchableHighlight/package.json +1 -0
- package/components/native/TouchableOpacity/package.json +1 -0
- package/components/native/View/package.json +1 -0
- package/components/native/VirtualizedList/package.json +1 -0
- package/cxx/core/UnistylesCommitHook.cpp +8 -1
- package/cxx/core/UnistylesMountHook.cpp +1 -3
- package/ios/NativePlatform+ios.swift +1 -1
- package/ios/NativePlatformListener+ios.swift +12 -7
- package/lib/commonjs/components/native/Image.js +4 -3
- package/lib/commonjs/components/native/Image.js.map +1 -1
- package/lib/commonjs/components/native/ImageBackground.js +3 -2
- package/lib/commonjs/components/native/ImageBackground.js.map +1 -1
- package/lib/commonjs/core/createUnistylesElement.js +17 -5
- package/lib/commonjs/core/createUnistylesElement.js.map +1 -1
- package/lib/commonjs/core/getClassname.js +10 -4
- package/lib/commonjs/core/getClassname.js.map +1 -1
- package/lib/commonjs/core/useProxifiedUnistyles/listener.js +5 -3
- package/lib/commonjs/core/useProxifiedUnistyles/listener.js.map +1 -1
- package/lib/commonjs/core/withUnistyles/withUnistyles.js +2 -1
- package/lib/commonjs/core/withUnistyles/withUnistyles.js.map +1 -1
- package/lib/commonjs/hooks/useMedia.js +4 -4
- package/lib/commonjs/hooks/useMedia.js.map +1 -1
- package/lib/commonjs/hooks/useMedia.native.js +4 -4
- package/lib/commonjs/hooks/useMedia.native.js.map +1 -1
- package/lib/commonjs/mocks.js +203 -0
- package/lib/commonjs/mocks.js.map +1 -0
- package/lib/commonjs/mq.js +1 -23
- package/lib/commonjs/mq.js.map +1 -1
- package/lib/commonjs/reanimated/index.js +13 -0
- package/lib/commonjs/reanimated/index.js.map +1 -0
- package/lib/commonjs/reanimated/useAnimatedTheme.js +22 -0
- package/lib/commonjs/reanimated/useAnimatedTheme.js.map +1 -0
- package/lib/commonjs/reanimated/useAnimatedTheme.native.js +24 -0
- package/lib/commonjs/reanimated/useAnimatedTheme.native.js.map +1 -0
- package/lib/commonjs/server/getServerUnistyles.js +5 -3
- package/lib/commonjs/server/getServerUnistyles.js.map +1 -1
- package/lib/commonjs/server/hydrateServerUnistyles.js +4 -2
- package/lib/commonjs/server/hydrateServerUnistyles.js.map +1 -1
- package/lib/commonjs/server/resetServerUnistyles.js +4 -2
- package/lib/commonjs/server/resetServerUnistyles.js.map +1 -1
- package/lib/commonjs/utils.js +23 -1
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/convert/index.js +4 -7
- package/lib/commonjs/web/convert/index.js.map +1 -1
- package/lib/commonjs/web/convert/object/filter.js +7 -8
- package/lib/commonjs/web/convert/object/filter.js.map +1 -1
- package/lib/commonjs/web/create.js +6 -4
- package/lib/commonjs/web/create.js.map +1 -1
- package/lib/commonjs/web/css/state.js +1 -1
- package/lib/commonjs/web/css/state.js.map +1 -1
- package/lib/commonjs/web/index.js +7 -12
- package/lib/commonjs/web/index.js.map +1 -1
- package/lib/commonjs/web/services.js +7 -2
- package/lib/commonjs/web/services.js.map +1 -1
- package/lib/commonjs/web/shadowRegistry.js +18 -4
- package/lib/commonjs/web/shadowRegistry.js.map +1 -1
- package/lib/commonjs/web/types.js +2 -0
- package/lib/commonjs/web/types.js.map +1 -1
- package/lib/commonjs/web/utils/createUnistylesRef.js +7 -4
- package/lib/commonjs/web/utils/createUnistylesRef.js.map +1 -1
- package/lib/commonjs/web/utils/index.js +0 -11
- package/lib/commonjs/web/utils/index.js.map +1 -1
- package/lib/commonjs/web/utils/unistyle.js +40 -12
- package/lib/commonjs/web/utils/unistyle.js.map +1 -1
- package/lib/commonjs/web-only/getWebProps.js +19 -0
- package/lib/commonjs/web-only/getWebProps.js.map +1 -0
- package/lib/commonjs/web-only/index.js +13 -0
- package/lib/commonjs/web-only/index.js.map +1 -0
- package/lib/module/components/native/Image.js +4 -3
- package/lib/module/components/native/Image.js.map +1 -1
- package/lib/module/components/native/ImageBackground.js +2 -1
- package/lib/module/components/native/ImageBackground.js.map +1 -1
- package/lib/module/core/createUnistylesElement.js +18 -6
- package/lib/module/core/createUnistylesElement.js.map +1 -1
- package/lib/module/core/getClassname.js +8 -4
- package/lib/module/core/getClassname.js.map +1 -1
- package/lib/module/core/useProxifiedUnistyles/listener.js +3 -3
- package/lib/module/core/useProxifiedUnistyles/listener.js.map +1 -1
- package/lib/module/core/withUnistyles/withUnistyles.js +2 -1
- package/lib/module/core/withUnistyles/withUnistyles.js.map +1 -1
- package/lib/module/hooks/useMedia.js +1 -1
- package/lib/module/hooks/useMedia.js.map +1 -1
- package/lib/module/hooks/useMedia.native.js +1 -1
- package/lib/module/hooks/useMedia.native.js.map +1 -1
- package/lib/module/mocks.js +201 -0
- package/lib/module/mocks.js.map +1 -0
- package/lib/module/mq.js +0 -19
- package/lib/module/mq.js.map +1 -1
- package/lib/module/reanimated/index.js +4 -0
- package/lib/module/reanimated/index.js.map +1 -0
- package/lib/module/reanimated/useAnimatedTheme.js +17 -0
- package/lib/module/reanimated/useAnimatedTheme.js.map +1 -0
- package/lib/module/reanimated/useAnimatedTheme.native.js +19 -0
- package/lib/module/reanimated/useAnimatedTheme.native.js.map +1 -0
- package/lib/module/server/getServerUnistyles.js +3 -3
- package/lib/module/server/getServerUnistyles.js.map +1 -1
- package/lib/module/server/hydrateServerUnistyles.js +2 -2
- package/lib/module/server/hydrateServerUnistyles.js.map +1 -1
- package/lib/module/server/resetServerUnistyles.js +2 -2
- package/lib/module/server/resetServerUnistyles.js.map +1 -1
- package/lib/module/utils.js +19 -0
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/convert/index.js +4 -7
- package/lib/module/web/convert/index.js.map +1 -1
- package/lib/module/web/convert/object/filter.js +3 -4
- package/lib/module/web/convert/object/filter.js.map +1 -1
- package/lib/module/web/create.js +4 -4
- package/lib/module/web/create.js.map +1 -1
- package/lib/module/web/css/state.js +1 -1
- package/lib/module/web/css/state.js.map +1 -1
- package/lib/module/web/index.js +4 -10
- package/lib/module/web/index.js.map +1 -1
- package/lib/module/web/services.js +7 -1
- package/lib/module/web/services.js.map +1 -1
- package/lib/module/web/shadowRegistry.js +18 -4
- package/lib/module/web/shadowRegistry.js.map +1 -1
- package/lib/module/web/types.js +1 -1
- package/lib/module/web/types.js.map +1 -1
- package/lib/module/web/utils/createUnistylesRef.js +5 -4
- package/lib/module/web/utils/createUnistylesRef.js.map +1 -1
- package/lib/module/web/utils/index.js +0 -1
- package/lib/module/web/utils/index.js.map +1 -1
- package/lib/module/web/utils/unistyle.js +32 -9
- package/lib/module/web/utils/unistyle.js.map +1 -1
- package/lib/module/web-only/getWebProps.js +14 -0
- package/lib/module/web-only/getWebProps.js.map +1 -0
- package/lib/module/web-only/index.js +4 -0
- package/lib/module/web-only/index.js.map +1 -0
- package/lib/typescript/src/components/native/Image.d.ts.map +1 -1
- package/lib/typescript/src/components/native/ImageBackground.d.ts.map +1 -1
- package/lib/typescript/src/core/createUnistylesElement.d.ts.map +1 -1
- package/lib/typescript/src/core/getClassname.d.ts +5 -5
- package/lib/typescript/src/core/getClassname.d.ts.map +1 -1
- package/lib/typescript/src/core/withUnistyles/withUnistyles.d.ts.map +1 -1
- package/lib/typescript/src/mocks.d.ts +2 -0
- package/lib/typescript/src/mocks.d.ts.map +1 -0
- package/lib/typescript/src/mq.d.ts +0 -8
- package/lib/typescript/src/mq.d.ts.map +1 -1
- package/lib/typescript/src/reanimated/index.d.ts +2 -0
- package/lib/typescript/src/reanimated/index.d.ts.map +1 -0
- package/lib/typescript/src/reanimated/useAnimatedTheme.d.ts +4 -0
- package/lib/typescript/src/reanimated/useAnimatedTheme.d.ts.map +1 -0
- package/lib/typescript/src/reanimated/useAnimatedTheme.native.d.ts +4 -0
- package/lib/typescript/src/reanimated/useAnimatedTheme.native.d.ts.map +1 -0
- package/lib/typescript/src/server/hydrateServerUnistyles.d.ts +0 -1
- package/lib/typescript/src/server/hydrateServerUnistyles.d.ts.map +1 -1
- package/lib/typescript/src/server/resetServerUnistyles.d.ts.map +1 -1
- package/lib/typescript/src/utils.d.ts +8 -0
- package/lib/typescript/src/utils.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/index.d.ts +2 -1
- package/lib/typescript/src/web/convert/index.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/object/filter.d.ts +2 -1
- package/lib/typescript/src/web/convert/object/filter.d.ts.map +1 -1
- package/lib/typescript/src/web/index.d.ts +0 -5
- package/lib/typescript/src/web/index.d.ts.map +1 -1
- package/lib/typescript/src/web/services.d.ts +6 -1
- package/lib/typescript/src/web/services.d.ts.map +1 -1
- package/lib/typescript/src/web/shadowRegistry.d.ts +2 -2
- package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -1
- package/lib/typescript/src/web/types.d.ts +3 -0
- package/lib/typescript/src/web/types.d.ts.map +1 -1
- package/lib/typescript/src/web/utils/createUnistylesRef.d.ts +8 -5
- package/lib/typescript/src/web/utils/createUnistylesRef.d.ts.map +1 -1
- package/lib/typescript/src/web/utils/index.d.ts +0 -1
- package/lib/typescript/src/web/utils/index.d.ts.map +1 -1
- package/lib/typescript/src/web/utils/unistyle.d.ts +5 -1
- package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
- package/lib/typescript/src/web-only/getWebProps.d.ts +7 -0
- package/lib/typescript/src/web-only/getWebProps.d.ts.map +1 -0
- package/lib/typescript/src/web-only/index.d.ts +2 -0
- package/lib/typescript/src/web-only/index.d.ts.map +1 -0
- package/package.json +43 -7
- package/plugin/index.js +24 -17
- package/reanimated/package.json +6 -0
- package/src/components/native/Image.tsx +4 -3
- package/src/components/native/ImageBackground.tsx +2 -1
- package/src/core/createUnistylesElement.tsx +26 -9
- package/src/core/getClassname.ts +14 -4
- package/src/core/useProxifiedUnistyles/listener.ts +3 -3
- package/src/core/withUnistyles/withUnistyles.tsx +2 -1
- package/src/hooks/useMedia.native.ts +1 -1
- package/src/hooks/useMedia.ts +1 -1
- package/src/mocks.ts +217 -0
- package/src/mq.ts +0 -24
- package/src/reanimated/index.ts +1 -0
- package/src/reanimated/useAnimatedTheme.native.ts +21 -0
- package/src/reanimated/useAnimatedTheme.ts +19 -0
- package/src/server/getServerUnistyles.tsx +3 -3
- package/src/server/hydrateServerUnistyles.ts +3 -2
- package/src/server/resetServerUnistyles.ts +4 -3
- package/src/utils.ts +25 -0
- package/src/web/convert/index.ts +5 -7
- package/src/web/convert/object/filter.ts +4 -4
- package/src/web/create.ts +4 -4
- package/src/web/css/state.ts +1 -1
- package/src/web/index.ts +4 -16
- package/src/web/services.ts +14 -1
- package/src/web/shadowRegistry.ts +20 -5
- package/src/web/types.ts +9 -4
- package/src/web/utils/createUnistylesRef.ts +12 -8
- package/src/web/utils/index.ts +0 -1
- package/src/web/utils/unistyle.ts +47 -13
- package/src/web-only/getWebProps.ts +18 -0
- package/src/web-only/index.ts +2 -0
- package/web-only/package.json +6 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { UnistylesValues } from '../types';
|
2
|
-
export declare const getClassName: (unistyle: UnistylesValues | undefined | Array<UnistylesValues>, forChild?: boolean) => {
|
3
|
-
$$css:
|
4
|
-
hash: string;
|
5
|
-
injectedClassName: string;
|
6
|
-
} | undefined;
|
2
|
+
export declare const getClassName: (unistyle: UnistylesValues | undefined | Array<UnistylesValues>, forChild?: boolean) => readonly [{
|
3
|
+
readonly $$css: true;
|
4
|
+
readonly hash: string;
|
5
|
+
readonly injectedClassName: string;
|
6
|
+
}, UnistylesValues[]] | undefined;
|
7
7
|
//# sourceMappingURL=getClassname.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getClassname.d.ts","sourceRoot":"","sources":["../../../../src/core/getClassname.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;
|
1
|
+
{"version":3,"file":"getClassname.d.ts","sourceRoot":"","sources":["../../../../src/core/getClassname.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI/C,eAAO,MAAM,YAAY,aAAc,eAAe,GAAG,SAAS,GAAG,KAAK,CAAC,eAAe,CAAC,aAAa,OAAO;;;;iCAoB9G,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"withUnistyles.d.ts","sourceRoot":"","sources":["../../../../../src/core/withUnistyles/withUnistyles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAkC,KAAK,cAAc,EAAqB,MAAM,OAAO,CAAA;AAMrG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAGvC,KAAK,qBAAqB,CAAC,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,CAAA;AAIjD,eAAO,MAAM,aAAa,GAAI,UAAU,EAAE,SAAS,SAAS,qBAAqB,CAAC,UAAU,CAAC,aAAa,UAAU,aAAa,QAAQ,CAAC,SAAS,CAAC;eAGjI,QAAQ,kCAAQ;
|
1
|
+
{"version":3,"file":"withUnistyles.d.ts","sourceRoot":"","sources":["../../../../../src/core/withUnistyles/withUnistyles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAkC,KAAK,cAAc,EAAqB,MAAM,OAAO,CAAA;AAMrG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAGvC,KAAK,qBAAqB,CAAC,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,CAAA;AAIjD,eAAO,MAAM,aAAa,GAAI,UAAU,EAAE,SAAS,SAAS,qBAAqB,CAAC,UAAU,CAAC,aAAa,UAAU,aAAa,QAAQ,CAAC,SAAS,CAAC;eAGjI,QAAQ,kCAAQ;yDAqDlC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../../../src/mocks.ts"],"names":[],"mappings":""}
|
@@ -22,13 +22,5 @@ type MQHandler = {
|
|
22
22
|
* @returns - JavaScript symbol to be used in your stylesheet
|
23
23
|
*/
|
24
24
|
export declare const mq: MQHandler;
|
25
|
-
export declare const parseMq: (mq: string) => {
|
26
|
-
minWidth: number | undefined;
|
27
|
-
maxWidth: number | undefined;
|
28
|
-
minHeight: number | undefined;
|
29
|
-
maxHeight: number | undefined;
|
30
|
-
};
|
31
|
-
export declare const isUnistylesMq: (mq: string) => boolean;
|
32
|
-
export declare const isValidMq: (parsedMQ: ReturnType<typeof parseMq>) => boolean;
|
33
25
|
export {};
|
34
26
|
//# sourceMappingURL=mq.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mq.d.ts","sourceRoot":"","sources":["../../../src/mq.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAEpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;
|
1
|
+
{"version":3,"file":"mq.d.ts","sourceRoot":"","sources":["../../../src/mq.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAEpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,KAAK,OAAO,GAAG,MAAM,oBAAoB,GAAG,MAAM,CAAA;AAElD,KAAK,SAAS,GAAG;IACb,IAAI,EAAE;QACF,KAAK,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QACxD,MAAM,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;KAC5D,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG;QAC7C,GAAG,EAAE;YACD,MAAM,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;SAC3D,CAAA;KACJ,CAAC;IACF,MAAM,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG;QAC9C,GAAG,EAAE;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;SAC1D,CAAA;KACJ,CAAA;CACJ,CAAA;AAgBD;;;GAGG;AACH,eAAO,MAAM,EAAE,EAAE,SAiBhB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/reanimated/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useAnimatedTheme.d.ts","sourceRoot":"","sources":["../../../../src/reanimated/useAnimatedTheme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,yBAAyB,CAAA;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG9C,eAAO,MAAM,gBAAgB,QAWT,WAAW,CAAC,cAAc,CAC7C,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useAnimatedTheme.native.d.ts","sourceRoot":"","sources":["../../../../src/reanimated/useAnimatedTheme.native.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,yBAAyB,CAAA;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,eAAO,MAAM,gBAAgB,QAcT,WAAW,CAAC,cAAc,CAC7C,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hydrateServerUnistyles.d.ts","sourceRoot":"","sources":["../../../../src/server/hydrateServerUnistyles.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"hydrateServerUnistyles.d.ts","sourceRoot":"","sources":["../../../../src/server/hydrateServerUnistyles.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QAEZ,mBAAmB,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;KAC7E;CACJ;AAED,eAAO,MAAM,sBAAsB,YAOlC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"resetServerUnistyles.d.ts","sourceRoot":"","sources":["../../../../src/server/resetServerUnistyles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB,
|
1
|
+
{"version":3,"file":"resetServerUnistyles.d.ts","sourceRoot":"","sources":["../../../../src/server/resetServerUnistyles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB,YAMhC,CAAA"}
|
@@ -1,4 +1,12 @@
|
|
1
1
|
export declare const isDefined: <T>(value: T) => value is NonNullable<T>;
|
2
2
|
export declare const deepMergeObjects: <T extends Record<PropertyKey, any>>(...sources: Array<T>) => T;
|
3
3
|
export declare const copyComponentProperties: (Component: any, UnistylesComponent: any) => any;
|
4
|
+
export declare const isUnistylesMq: (mq: string) => boolean;
|
5
|
+
export declare const parseMq: (mq: string) => {
|
6
|
+
minWidth: number | undefined;
|
7
|
+
maxWidth: number | undefined;
|
8
|
+
minHeight: number | undefined;
|
9
|
+
maxHeight: number | undefined;
|
10
|
+
};
|
11
|
+
export declare const isValidMq: (parsedMQ: ReturnType<typeof parseMq>) => boolean;
|
4
12
|
//# sourceMappingURL=utils.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,CAAC,KAAG,KAAK,IAAI,WAAW,CAAC,CAAC,CAA0C,CAAA;AAExG,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,cAAc,KAAK,CAAC,CAAC,CAAC,MAuBxF,CAAA;AAED,eAAO,MAAM,uBAAuB,cAAe,GAAG,sBAAsB,GAAG,QAe9E,CAAA"}
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,CAAC,KAAG,KAAK,IAAI,WAAW,CAAC,CAAC,CAA0C,CAAA;AAExG,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,cAAc,KAAK,CAAC,CAAC,CAAC,MAuBxF,CAAA;AAED,eAAO,MAAM,uBAAuB,cAAe,GAAG,sBAAsB,GAAG,QAe9E,CAAA;AAMD,eAAO,MAAM,aAAa,OAAQ,MAAM,YAAgC,CAAA;AAExE,eAAO,MAAM,OAAO,OAAQ,MAAM;;;;;CAUjC,CAAA;AAED,eAAO,MAAM,SAAS,aAAc,UAAU,CAAC,OAAO,OAAO,CAAC,YAK7D,CAAA"}
|
@@ -1,3 +1,4 @@
|
|
1
1
|
import type { UnistylesValues } from '../../types';
|
2
|
-
|
2
|
+
import type { UnistylesRuntime } from '../runtime';
|
3
|
+
export declare const convertUnistyles: (value: UnistylesValues, runtime: UnistylesRuntime) => Record<string, any>;
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/web/convert/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/web/convert/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAOlD,eAAO,MAAM,gBAAgB,UAAW,eAAe,WAAW,gBAAgB,wBAkEjF,CAAA"}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import type { UnistylesRuntime } from '../../runtime';
|
1
2
|
import type { Filters } from '../types';
|
2
|
-
export declare const getFilterStyle: (filters: Array<Filters
|
3
|
+
export declare const getFilterStyle: (filters: Array<Filters>, runtime: UnistylesRuntime) => Record<string, any>;
|
3
4
|
//# sourceMappingURL=filter.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../../../../src/web/convert/object/filter.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../../../../src/web/convert/object/filter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAErD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAUvC,eAAO,MAAM,cAAc,YAAa,KAAK,CAAC,OAAO,CAAC,WAAW,gBAAgB,wBAwBhF,CAAA"}
|
@@ -1,11 +1,6 @@
|
|
1
1
|
import type { UnistylesShadowRegistry as NativeUnistylesShadowRegistry } from '../specs/ShadowRegistry';
|
2
2
|
import type { StyleSheet as NativeStyleSheet } from '../specs/StyleSheet';
|
3
3
|
import type { Runtime as NativeUnistylesRuntime } from '../specs/UnistylesRuntime';
|
4
|
-
import { UnistylesServices } from './services';
|
5
|
-
declare global {
|
6
|
-
var __unistyles__: UnistylesServices;
|
7
|
-
}
|
8
|
-
export declare const UnistylesWeb: UnistylesServices;
|
9
4
|
export declare const StyleSheet: typeof NativeStyleSheet;
|
10
5
|
export declare const UnistylesRuntime: typeof NativeUnistylesRuntime;
|
11
6
|
export declare const UnistylesShadowRegistry: typeof NativeUnistylesShadowRegistry;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,IAAI,6BAA6B,EAAE,MAAM,yBAAyB,CAAA;AACvG,OAAO,KAAK,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,KAAK,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,IAAI,6BAA6B,EAAE,MAAM,yBAAyB,CAAA;AACvG,OAAO,KAAK,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,KAAK,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAKlF,eAAO,MAAM,UAAU,EAoBP,OAAO,gBAAgB,CAAA;AAEvC,eAAO,MAAM,gBAAgB,EAA4C,OAAO,sBAAsB,CAAA;AACtG,eAAO,MAAM,uBAAuB,EAAmD,OAAO,6BAA6B,CAAA;AAE3H,cAAc,QAAQ,CAAA"}
|
@@ -3,7 +3,7 @@ import { UnistylesRegistry } from './registry';
|
|
3
3
|
import { UnistylesRuntime } from './runtime';
|
4
4
|
import { UnistylesShadowRegistry } from './shadowRegistry';
|
5
5
|
import { UnistylesState } from './state';
|
6
|
-
|
6
|
+
declare class UnistylesServices {
|
7
7
|
runtime: UnistylesRuntime;
|
8
8
|
registry: UnistylesRegistry;
|
9
9
|
shadowRegistry: UnistylesShadowRegistry;
|
@@ -12,4 +12,9 @@ export declare class UnistylesServices {
|
|
12
12
|
private services;
|
13
13
|
constructor();
|
14
14
|
}
|
15
|
+
declare global {
|
16
|
+
var __unistyles__: UnistylesServices;
|
17
|
+
}
|
18
|
+
export declare const services: UnistylesServices;
|
19
|
+
export {};
|
15
20
|
//# sourceMappingURL=services.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../src/web/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../src/web/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAGxC,cAAM,iBAAiB;IACnB,OAAO,EAAE,gBAAgB,CAAA;IACzB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,cAAc,EAAE,uBAAuB,CAAA;IACvC,KAAK,EAAE,cAAc,CAAA;IACrB,QAAQ,EAAE,iBAAiB,CAAA;IAE3B,OAAO,CAAC,QAAQ,CAA0B;;CAc7C;AAED,OAAO,CAAC,MAAM,CAAC;IAEX,IAAI,aAAa,EAAE,iBAAiB,CAAA;CACvC;AAOD,eAAO,MAAM,QAAQ,mBAAkE,CAAA"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { UnistylesTheme, UnistylesValues } from '../types';
|
2
|
-
import type { UnistylesServices } from './types';
|
2
|
+
import type { UniGeneratedStyle, UnistylesServices } from './types';
|
3
3
|
export declare class UnistylesShadowRegistry {
|
4
4
|
private services;
|
5
5
|
name: string;
|
@@ -11,7 +11,7 @@ export declare class UnistylesShadowRegistry {
|
|
11
11
|
private disposeMap;
|
12
12
|
constructor(services: UnistylesServices);
|
13
13
|
add: (ref: any, hash?: string) => void;
|
14
|
-
addStyles: (unistyles: Array<UnistylesValues>, forChild?: boolean) => {
|
14
|
+
addStyles: (unistyles: Array<UnistylesValues>, forChild?: boolean) => UniGeneratedStyle | {
|
15
15
|
injectedClassName: string;
|
16
16
|
hash: string;
|
17
17
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"shadowRegistry.d.ts","sourceRoot":"","sources":["../../../../src/web/shadowRegistry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;
|
1
|
+
{"version":3,"file":"shadowRegistry.d.ts","sourceRoot":"","sources":["../../../../src/web/shadowRegistry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAInE,qBAAa,uBAAuB;IAYpB,OAAO,CAAC,QAAQ;IAV5B,IAAI,SAA4B;IAChC,MAAM,SAAQ;IACd,MAAM,gBAAa;IACnB,QAAQ,eAAkC;IAC1C,OAAO,aAAW;IAGlB,OAAO,CAAC,WAAW,CAAwC;IAC3D,OAAO,CAAC,UAAU,CAAkC;gBAEhC,QAAQ,EAAE,iBAAiB;IAE/C,GAAG,QAAS,GAAG,SAAS,MAAM,UAM7B;IAED,SAAS,cAAe,KAAK,CAAC,eAAe,CAAC,aAAa,OAAO;;;MAoEjE;IAED,cAAc,WAAY,cAAc,UAEvC;IAED,cAAc,kBAAyB;IAEvC,MAAM,QAAS,GAAG,SAAS,MAAM,UAchC;CACJ"}
|
@@ -10,4 +10,7 @@ export type UnistylesServices = {
|
|
10
10
|
state: UnistylesState;
|
11
11
|
listener: UnistylesListener;
|
12
12
|
};
|
13
|
+
export declare const UNI_GENERATED_KEYS: readonly ["$$css", "hash", "injectedClassName"];
|
14
|
+
export type UniGeneratedKey = typeof UNI_GENERATED_KEYS[number];
|
15
|
+
export type UniGeneratedStyle = Record<UniGeneratedKey, string>;
|
13
16
|
//# sourceMappingURL=types.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/web/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/web/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,MAAM,MAAM,iBAAiB,GAAG;IAC5B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,cAAc,EAAE,uBAAuB,CAAC;IACxC,KAAK,EAAE,cAAc,CAAC;IACtB,QAAQ,EAAE,iBAAiB,CAAA;CAC9B,CAAA;AAED,eAAO,MAAM,kBAAkB,iDAAkD,CAAA;AACjF,MAAM,MAAM,eAAe,GAAG,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAA;AAE/D,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAA"}
|
@@ -1,8 +1,11 @@
|
|
1
1
|
import type React from 'react';
|
2
|
-
import type { Nullable } from '../../types';
|
3
|
-
type
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
import type { Nullable, UnistylesValues } from '../../types';
|
3
|
+
type Styles = readonly [
|
4
|
+
{
|
5
|
+
hash: string;
|
6
|
+
},
|
7
|
+
Array<UnistylesValues>
|
8
|
+
];
|
9
|
+
export declare const createUnistylesRef: <T>(styles?: Styles, forwardedRef?: React.ForwardedRef<T>) => ((ref: Nullable<T>) => void) | undefined;
|
7
10
|
export {};
|
8
11
|
//# sourceMappingURL=createUnistylesRef.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createUnistylesRef.d.ts","sourceRoot":"","sources":["../../../../../src/web/utils/createUnistylesRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;
|
1
|
+
{"version":3,"file":"createUnistylesRef.d.ts","sourceRoot":"","sources":["../../../../../src/web/utils/createUnistylesRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAI5D,KAAK,MAAM,GAAG,SAAS;IACnB;QACI,IAAI,EAAE,MAAM,CAAA;KACf;IACD,KAAK,CAAC,eAAe,CAAC;CACzB,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,CAAC,WAAW,MAAM,iBAAiB,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,YAIjD,QAAQ,CAAC,CAAC,CAAC,sBAgBpD,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/web/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/web/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA"}
|
@@ -1,6 +1,7 @@
|
|
1
|
-
import type { UnistyleDependency } from '../../specs/NativePlatform';
|
1
|
+
import type { UnistyleDependency } from '../../specs/NativePlatform/NativePlatform.nitro';
|
2
2
|
import { ColorScheme } from '../../specs/types';
|
3
3
|
import type { StyleSheet, StyleSheetWithSuperPowers, UnistylesValues } from '../../types/stylesheet';
|
4
|
+
import { type UniGeneratedStyle } from '../types';
|
4
5
|
export declare const schemeToTheme: (scheme: ColorScheme) => "light" | "dark";
|
5
6
|
export type UnistyleSecrets = {
|
6
7
|
__uni__stylesheet: StyleSheetWithSuperPowers<StyleSheet>;
|
@@ -15,4 +16,7 @@ export declare const extractSecrets: (object: any) => {
|
|
15
16
|
export declare const removeInlineStyles: (values: UnistylesValues) => {};
|
16
17
|
export declare const getMediaQuery: (query: string, allBreakpoints: Array<string>) => string;
|
17
18
|
export declare const extractUnistyleDependencies: (value: any) => UnistyleDependency[];
|
19
|
+
export declare const checkForProp: (value: any, prop: string) => boolean;
|
20
|
+
export declare const checkForAnimated: (value: any) => boolean;
|
21
|
+
export declare const isGeneratedUnistyle: (value: Record<string, any>) => value is UniGeneratedStyle;
|
18
22
|
//# sourceMappingURL=unistyle.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"unistyle.d.ts","sourceRoot":"","sources":["../../../../../src/web/utils/unistyle.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"unistyle.d.ts","sourceRoot":"","sources":["../../../../../src/web/utils/unistyle.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAA;AACzF,OAAO,EAAE,WAAW,EAAe,MAAM,mBAAmB,CAAA;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAGpG,OAAO,EAA4C,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAG3F,eAAO,MAAM,aAAa,WAAY,WAAW,qBAQhD,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC1B,iBAAiB,EAAE,yBAAyB,CAAC,UAAU,CAAC,CAAC;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAA;CAC/D,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,CAAC,UAAU,CAAC,WAAW,eAAe,MAanE,CAAA;AAED,eAAO,MAAM,cAAc,WAAY,GAAG;;aAYzC,CAAA;AAED,eAAO,MAAM,kBAAkB,WAAY,eAAe,OAUzD,CAAA;AAED,eAAO,MAAM,aAAa,UAAW,MAAM,kBAAkB,KAAK,CAAC,MAAM,CAAC,WA6BzE,CAAA;AAED,eAAO,MAAM,2BAA2B,UAAW,GAAG,yBAQrD,CAAA;AAED,eAAO,MAAM,YAAY,UAAW,GAAG,QAAQ,MAAM,KAAG,OAcvD,CAAA;AAED,eAAO,MAAM,gBAAgB,UAAW,GAAG,KAAG,OAgB7C,CAAA;AAED,eAAO,MAAM,mBAAmB,UAAW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAG,KAAK,IAAI,iBAEzE,CAAA"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { StyleProp } from 'react-native';
|
2
|
+
import type { RNStyle } from '../types';
|
3
|
+
export declare const getWebProps: <T>(style: StyleProp<RNStyle>) => {
|
4
|
+
className: string;
|
5
|
+
ref: ((ref: import("../types").Nullable<T>) => void) | undefined;
|
6
|
+
};
|
7
|
+
//# sourceMappingURL=getWebProps.d.ts.map
|
@@ -0,0 +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,SAAS,SAAS,CAAC,OAAO,CAAC;;;CAYvD,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/web-only/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA"}
|
package/package.json
CHANGED
@@ -1,32 +1,43 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-native-unistyles",
|
3
|
-
"version": "3.0.0-rc.
|
3
|
+
"version": "3.0.0-rc.4",
|
4
4
|
"description": "Level up your React Native StyleSheet",
|
5
5
|
"scripts": {
|
6
|
-
"test": "jest",
|
7
|
-
"test:coverage": "jest --passWithNoTests --coverage",
|
6
|
+
"test": "NODE_ENV=babel-test jest ./plugin",
|
7
|
+
"test:coverage": "NODE_ENV=babel-test jest --passWithNoTests --coverage",
|
8
8
|
"tsc": "node_modules/typescript/bin/tsc --noEmit",
|
9
9
|
"lint": "biome lint",
|
10
10
|
"check": "biome check --write",
|
11
11
|
"check:ci": "biome check",
|
12
12
|
"prepare": "husky && bob build && yarn plugin:build",
|
13
|
-
"precommit": "concurrently 'yarn tsc' 'yarn lint' 'yarn check' 'yarn test'",
|
13
|
+
"precommit": "concurrently 'yarn tsc' 'yarn lint' 'yarn check' 'yarn test' 'yarn circular:check'",
|
14
14
|
"release": "release-it",
|
15
|
-
"plugin:build": "node plugin/esbuild.js"
|
15
|
+
"plugin:build": "node plugin/esbuild.js",
|
16
|
+
"circular:check": "dpdm --no-warning --no-tree -T --exit-code circular:1 src/**/*.ts",
|
17
|
+
"components:build": "node build-components.js"
|
16
18
|
},
|
17
19
|
"main": "lib/commonjs/index.js",
|
18
20
|
"module": "lib/module/index.js",
|
21
|
+
"browser": "lib/module/index.js",
|
19
22
|
"types": "lib/typescript/src/index.d.ts",
|
20
23
|
"source": "src/index",
|
21
24
|
"exports": {
|
22
25
|
".": {
|
23
26
|
"types": "./lib/typescript/src/index.d.ts",
|
24
27
|
"import": "./lib/module/index.js",
|
28
|
+
"browser": "./lib/module/index.js",
|
25
29
|
"react-native": "./src/index.ts",
|
26
30
|
"default": "./lib/commonjs/index.js"
|
27
31
|
},
|
32
|
+
"./mocks": {
|
33
|
+
"import": "./lib/module/mocks.js",
|
34
|
+
"browser": "./lib/module/mocks.js",
|
35
|
+
"react-native": "./src/mocks.ts",
|
36
|
+
"default": "./lib/commonjs/mocks.js"
|
37
|
+
},
|
28
38
|
"./components/native/*": {
|
29
39
|
"import": "./lib/module/components/native/*",
|
40
|
+
"browser": "./lib/module/components/native/*",
|
30
41
|
"react-native": "./src/components/native/*",
|
31
42
|
"default": "./lib/commonjs/components/native/*"
|
32
43
|
},
|
@@ -39,8 +50,23 @@
|
|
39
50
|
"./server": {
|
40
51
|
"types": "./lib/typescript/src/server/index.d.ts",
|
41
52
|
"import": "./lib/module/server/index.js",
|
42
|
-
"
|
53
|
+
"browser": "./lib/module/server/index.js",
|
54
|
+
"react-native": "./src/server/index.ts",
|
43
55
|
"default": "./lib/commonjs/server/index.js"
|
56
|
+
},
|
57
|
+
"./web": {
|
58
|
+
"types": "./lib/typescript/src/web-only/index.d.ts",
|
59
|
+
"import": "./lib/module/web-only/index.js",
|
60
|
+
"browser": "./lib/module/web-only/index.js",
|
61
|
+
"react-native": "./src/web-only/index.ts",
|
62
|
+
"default": "./lib/commonjs/web-only/index.js"
|
63
|
+
},
|
64
|
+
"./reanimated": {
|
65
|
+
"types": "./lib/typescript/src/reanimated/index.d.ts",
|
66
|
+
"import": "./lib/module/reanimated/index.js",
|
67
|
+
"browser": "./lib/module/reanimated/index.js",
|
68
|
+
"react-native": "./src/reanimated/index.ts",
|
69
|
+
"default": "./lib/commonjs/reanimated/index.js"
|
44
70
|
}
|
45
71
|
},
|
46
72
|
"files": [
|
@@ -54,6 +80,8 @@
|
|
54
80
|
"web",
|
55
81
|
"components",
|
56
82
|
"server",
|
83
|
+
"web-only",
|
84
|
+
"reanimated",
|
57
85
|
"react-native.config.js",
|
58
86
|
"Unistyles.podspec",
|
59
87
|
"!plugin/__tests__",
|
@@ -102,6 +130,7 @@
|
|
102
130
|
"babel-plugin-tester": "11.0.4",
|
103
131
|
"commitlint": "19.7.1",
|
104
132
|
"concurrently": "9.1.2",
|
133
|
+
"dpdm": "3.14.0",
|
105
134
|
"esbuild": "0.25.0",
|
106
135
|
"husky": "9.1.7",
|
107
136
|
"jest": "29.7.0",
|
@@ -111,6 +140,7 @@
|
|
111
140
|
"react-native": "0.77.1",
|
112
141
|
"react-native-builder-bob": "0.37.0",
|
113
142
|
"react-native-nitro-modules": "0.25.2",
|
143
|
+
"react-native-reanimated": "3.17.5",
|
114
144
|
"react-native-web": "0.19.13",
|
115
145
|
"react-test-renderer": "18.3.1",
|
116
146
|
"release-it": "17.11.0",
|
@@ -121,7 +151,13 @@
|
|
121
151
|
"react": "*",
|
122
152
|
"react-native": ">=0.76.0",
|
123
153
|
"react-native-edge-to-edge": "*",
|
124
|
-
"react-native-nitro-modules": "*"
|
154
|
+
"react-native-nitro-modules": "*",
|
155
|
+
"react-native-reanimated": "*"
|
156
|
+
},
|
157
|
+
"peerDependenciesMeta": {
|
158
|
+
"react-native-reanimated": {
|
159
|
+
"optional": true
|
160
|
+
}
|
125
161
|
},
|
126
162
|
"workspaces": [
|
127
163
|
"example",
|
package/plugin/index.js
CHANGED
@@ -83,18 +83,6 @@ var NATIVE_COMPONENTS_PATHS = {
|
|
83
83
|
|
84
84
|
// plugin/src/exotic.ts
|
85
85
|
var t = __toESM(require("@babel/types"));
|
86
|
-
|
87
|
-
// plugin/src/paths.ts
|
88
|
-
var path = __toESM(require("node:path"));
|
89
|
-
var isWindows = process.platform === "win32";
|
90
|
-
var toWinPath = (pathString) => {
|
91
|
-
return path.normalize(pathString).replace(/\//g, "\\");
|
92
|
-
};
|
93
|
-
var toPlatformPath = (pathString) => {
|
94
|
-
return isWindows ? toWinPath(pathString) : pathString;
|
95
|
-
};
|
96
|
-
|
97
|
-
// plugin/src/exotic.ts
|
98
86
|
function handleExoticImport(path2, state, exoticImport) {
|
99
87
|
const specifiers = path2.node.specifiers;
|
100
88
|
const source = path2.node.source;
|
@@ -113,7 +101,7 @@ function handleExoticImport(path2, state, exoticImport) {
|
|
113
101
|
const newImport = t.importDeclaration(
|
114
102
|
[t.importDefaultSpecifier(t.identifier(specifier.local.name))],
|
115
103
|
t.stringLiteral(
|
116
|
-
state.opts.isLocal ? state.file.opts.filename?.split("react-native-unistyles").at(0)?.concat(
|
104
|
+
state.opts.isLocal ? state.file.opts.filename?.split("react-native-unistyles").at(0)?.concat(`react-native-unistyles/components/native/${rule.mapTo}`) ?? "" : `react-native-unistyles/components/native/${rule.mapTo}`
|
117
105
|
)
|
118
106
|
);
|
119
107
|
path2.replaceWith(newImport);
|
@@ -121,7 +109,7 @@ function handleExoticImport(path2, state, exoticImport) {
|
|
121
109
|
const newImport = t.importDeclaration(
|
122
110
|
[t.importSpecifier(t.identifier(rule.mapTo), t.identifier(rule.mapTo))],
|
123
111
|
t.stringLiteral(
|
124
|
-
state.opts.isLocal ? state.file.opts.filename?.split("react-native-unistyles").at(0)?.concat(
|
112
|
+
state.opts.isLocal ? state.file.opts.filename?.split("react-native-unistyles").at(0)?.concat(`react-native-unistyles/components/native/${rule.mapTo}`) ?? "" : `react-native-unistyles/components/native/${rule.mapTo}`
|
125
113
|
)
|
126
114
|
);
|
127
115
|
path2.node.specifiers = specifiers.filter((s) => s !== specifier);
|
@@ -152,7 +140,7 @@ function addUnistylesImport(path2, state) {
|
|
152
140
|
}
|
153
141
|
});
|
154
142
|
names.forEach((name) => {
|
155
|
-
const rnWebImport = path2.node.body.find((node) => t2.isImportDeclaration(node) && node.source.value ===
|
143
|
+
const rnWebImport = path2.node.body.find((node) => t2.isImportDeclaration(node) && node.source.value === `react-native-web/dist/exports/${name}`);
|
156
144
|
if (rnWebImport) {
|
157
145
|
rnWebImport.specifiers = [];
|
158
146
|
}
|
@@ -161,7 +149,7 @@ function addUnistylesImport(path2, state) {
|
|
161
149
|
const newImport = t2.importDeclaration(
|
162
150
|
[t2.importSpecifier(t2.identifier(localName), t2.identifier(name))],
|
163
151
|
t2.stringLiteral(
|
164
|
-
state.opts.isLocal ? state.file.opts.filename?.split("react-native-unistyles").at(0)?.concat(
|
152
|
+
state.opts.isLocal ? state.file.opts.filename?.split("react-native-unistyles").at(0)?.concat(`react-native-unistyles/src/components/native/${name}`) ?? "" : `react-native-unistyles/components/native/${name}`
|
165
153
|
)
|
166
154
|
);
|
167
155
|
path2.node.body.unshift(newImport);
|
@@ -185,6 +173,16 @@ function addUnistylesRequire(path2, state) {
|
|
185
173
|
});
|
186
174
|
}
|
187
175
|
|
176
|
+
// plugin/src/paths.ts
|
177
|
+
var import_node_path = __toESM(require("node:path"));
|
178
|
+
var isWindows = process.platform === "win32";
|
179
|
+
var toWinPath = (pathString) => {
|
180
|
+
return import_node_path.default.normalize(pathString).replace(/\//g, "\\");
|
181
|
+
};
|
182
|
+
var toPlatformPath = (pathString) => {
|
183
|
+
return isWindows ? toWinPath(pathString) : pathString;
|
184
|
+
};
|
185
|
+
|
188
186
|
// plugin/src/ref.ts
|
189
187
|
var t3 = __toESM(require("@babel/types"));
|
190
188
|
function hasStringRef(path2) {
|
@@ -715,6 +713,12 @@ function extractVariants(path2, state) {
|
|
715
713
|
|
716
714
|
// plugin/src/index.ts
|
717
715
|
function index_default() {
|
716
|
+
if (process.env.NODE_ENV === "test") {
|
717
|
+
return {
|
718
|
+
name: "babel-react-native-unistyles",
|
719
|
+
visitor: {}
|
720
|
+
};
|
721
|
+
}
|
718
722
|
return {
|
719
723
|
name: "babel-react-native-unistyles",
|
720
724
|
visitor: {
|
@@ -806,7 +810,7 @@ function index_default() {
|
|
806
810
|
}
|
807
811
|
});
|
808
812
|
}
|
809
|
-
if (importSource.includes(
|
813
|
+
if (importSource.includes("react-native/Libraries")) {
|
810
814
|
handleExoticImport(path2, state, NATIVE_COMPONENTS_PATHS);
|
811
815
|
}
|
812
816
|
if (!state.file.forceProcessing && Array.isArray(state.opts.autoProcessImports)) {
|
@@ -831,6 +835,9 @@ function index_default() {
|
|
831
835
|
if (path2.node.object.name !== state.file.reactNativeCommonJSName || !t6.isIdentifier(path2.node.property)) {
|
832
836
|
return;
|
833
837
|
}
|
838
|
+
if (!REACT_NATIVE_COMPONENT_NAMES.includes(path2.node.property.name)) {
|
839
|
+
return;
|
840
|
+
}
|
834
841
|
if (!state.reactNativeImports[path2.node.property.name]) {
|
835
842
|
const uniqueId = path2.scope.generateUidIdentifier(`reactNativeUnistyles_${path2.node.property.name}`);
|
836
843
|
state.reactNativeImports[path2.node.property.name] = uniqueId.name;
|
@@ -4,7 +4,8 @@ import { getClassName } from '../../core'
|
|
4
4
|
import { maybeWarnAboutMultipleUnistyles } from '../../core/warn'
|
5
5
|
import type { UnistylesValues } from '../../types'
|
6
6
|
import { copyComponentProperties } from '../../utils'
|
7
|
-
import {
|
7
|
+
import { checkForProp } from '../../web/utils'
|
8
|
+
import { createUnistylesRef } from '../../web/utils/createUnistylesRef'
|
8
9
|
|
9
10
|
type Props = ComponentProps<typeof NativeImage> & {
|
10
11
|
style?: UnistylesValues
|
@@ -14,8 +15,8 @@ type Props = ComponentProps<typeof NativeImage> & {
|
|
14
15
|
const UnistylesImage = forwardRef<unknown, Props>((props, forwardedRef) => {
|
15
16
|
const classNames = getClassName(props.style)
|
16
17
|
const ref = createUnistylesRef(classNames, forwardedRef)
|
17
|
-
const hasWidthStyle =
|
18
|
-
const hasHeightStyle =
|
18
|
+
const hasWidthStyle = checkForProp(props.style, 'width')
|
19
|
+
const hasHeightStyle = checkForProp(props.style, 'height')
|
19
20
|
|
20
21
|
maybeWarnAboutMultipleUnistyles(props.style as ViewStyle, 'Image')
|
21
22
|
|
@@ -5,7 +5,8 @@ import { getClassName } from '../../core'
|
|
5
5
|
import { maybeWarnAboutMultipleUnistyles } from '../../core/warn'
|
6
6
|
import type { UnistylesValues } from '../../types'
|
7
7
|
import { copyComponentProperties } from '../../utils'
|
8
|
-
import {
|
8
|
+
import { keyInObject } from '../../web/utils'
|
9
|
+
import { createUnistylesRef } from '../../web/utils/createUnistylesRef'
|
9
10
|
|
10
11
|
type Props = {
|
11
12
|
style?: UnistylesValues
|