react-native-unistyles 2.8.3 → 2.9.0
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 +4 -1
- package/android/src/main/cxx/platform.cpp +16 -0
- package/android/src/main/cxx/platform.h +1 -0
- package/android/src/main/java/com/unistyles/Platform.kt +62 -9
- package/android/src/main/java/com/unistyles/UnistylesModule.kt +53 -1
- package/cxx/UnistylesImpl.cpp +4 -0
- package/cxx/UnistylesModel.cpp +0 -8
- package/cxx/UnistylesModel.h +1 -1
- package/cxx/UnistylesRuntime.h +3 -1
- package/ios/platform/Platform_iOS.mm +10 -0
- package/lib/commonjs/common.js +0 -1
- package/lib/commonjs/common.js.map +1 -1
- package/lib/commonjs/core/UnistylesModule.js +7 -0
- package/lib/commonjs/core/UnistylesModule.js.map +1 -1
- package/lib/commonjs/core/UnistylesRuntime.js +28 -5
- package/lib/commonjs/core/UnistylesRuntime.js.map +1 -1
- package/lib/commonjs/core/mocks/UnistylesMockedRuntime.js +9 -1
- package/lib/commonjs/core/mocks/UnistylesMockedRuntime.js.map +1 -1
- package/lib/commonjs/hooks/useUnistyles.js +1 -8
- package/lib/commonjs/hooks/useUnistyles.js.map +1 -1
- package/lib/module/common.js +0 -1
- package/lib/module/common.js.map +1 -1
- package/lib/module/core/UnistylesModule.js +7 -0
- package/lib/module/core/UnistylesModule.js.map +1 -1
- package/lib/module/core/UnistylesRuntime.js +25 -2
- package/lib/module/core/UnistylesRuntime.js.map +1 -1
- package/lib/module/core/mocks/UnistylesMockedRuntime.js +9 -1
- package/lib/module/core/mocks/UnistylesMockedRuntime.js.map +1 -1
- package/lib/module/hooks/useUnistyles.js +1 -8
- package/lib/module/hooks/useUnistyles.js.map +1 -1
- package/lib/typescript/src/common.d.ts +1 -2
- package/lib/typescript/src/common.d.ts.map +1 -1
- package/lib/typescript/src/core/UnistylesModule.d.ts.map +1 -1
- package/lib/typescript/src/core/UnistylesRuntime.d.ts +15 -0
- package/lib/typescript/src/core/UnistylesRuntime.d.ts.map +1 -1
- package/lib/typescript/src/core/mocks/UnistylesMockedRuntime.d.ts +4 -0
- package/lib/typescript/src/core/mocks/UnistylesMockedRuntime.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useUnistyles.d.ts +0 -1
- package/lib/typescript/src/hooks/useUnistyles.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +1 -1
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/types/stylesheet.d.ts +3 -3
- package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
- package/lib/typescript/src/types/unistyles.d.ts +2 -7
- package/lib/typescript/src/types/unistyles.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common.ts +1 -2
- package/src/core/UnistylesModule.ts +7 -0
- package/src/core/UnistylesRuntime.ts +26 -2
- package/src/core/mocks/UnistylesMockedRuntime.ts +11 -1
- package/src/hooks/useUnistyles.ts +2 -9
- package/src/index.ts +4 -1
- package/src/types/index.ts +4 -1
- package/src/types/stylesheet.ts +3 -3
- package/src/types/unistyles.ts +3 -9
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"unistyles.d.ts","sourceRoot":"","sources":["../../../../src/types/unistyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAA;AACrH,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,aAAa,CAAA;AAE9D,MAAM,MAAM,YAAY,GAAG;IACvB,GAAG,EAAE,MAAM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AU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACrD,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,0BAA0B,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjE,gBAAgB,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAA;IAG1C,6BAA6B,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACtD,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAC9B,IAAI,EAAE,kBAAkB,CAAC,KAAK,CAAC;IAC/B,OAAO,EAAE;QACL,SAAS,EAAE,MAAM,eAAe,CAAA;KACnC,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACrC,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC;IAChC,OAAO,EAAE;QACL,MAAM,EAAE,UAAU,CAAC;QACnB,SAAS,EAAE,gBAAgB,CAAC;QAC5B,aAAa,EAAE,gBAAgB,CAAC;QAChC,MAAM,EAAE,YAAY,CAAC;QACrB,UAAU,EAAE,MAAM,oBAAoB,CAAC;QACvC,WAAW,EAAE,OAAO,iBAAiB,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAA;KACxE,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IAC/B,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAA;CAClC,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,0BAA0B,GAAG,oBAAoB,CAAA"}
|
package/package.json
CHANGED
package/src/common.ts
CHANGED
@@ -40,12 +40,15 @@ export class UnistylesBridgeWeb {
|
|
40
40
|
}
|
41
41
|
#pixelRatio = 1.0
|
42
42
|
#fontScale = 1.0
|
43
|
+
#hairlineWidth = 1
|
44
|
+
#rtl = false
|
43
45
|
|
44
46
|
constructor() {
|
45
47
|
if (!isServer) {
|
46
48
|
this.setupListeners()
|
47
49
|
this.#screenWidth = window.innerWidth
|
48
50
|
this.#screenHeight = window.innerHeight
|
51
|
+
this.#rtl = window.getComputedStyle(document.documentElement).direction === 'rtl'
|
49
52
|
}
|
50
53
|
}
|
51
54
|
|
@@ -85,6 +88,10 @@ export class UnistylesBridgeWeb {
|
|
85
88
|
return this.#pixelRatio
|
86
89
|
case 'fontScale':
|
87
90
|
return this.#fontScale
|
91
|
+
case 'hairlineWidth':
|
92
|
+
return this.#hairlineWidth
|
93
|
+
case 'rtl':
|
94
|
+
return this.#rtl
|
88
95
|
case 'useTheme':
|
89
96
|
return (themeName: keyof UnistylesThemes) => this.useTheme(themeName)
|
90
97
|
case 'updateTheme':
|
@@ -2,7 +2,7 @@ import { ScreenOrientation, UnistylesError } from '../common'
|
|
2
2
|
import type { Color, UnistylesBridge, UnistylesPlugin } from '../types'
|
3
3
|
import type { UnistylesThemes } from '../global'
|
4
4
|
import type { UnistyleRegistry } from './UnistyleRegistry'
|
5
|
-
import { parseColor } from '../utils'
|
5
|
+
import { parseColor } from '../utils/parseColor'
|
6
6
|
|
7
7
|
/**
|
8
8
|
* Utility to interact with the Unistyles during runtime
|
@@ -30,7 +30,9 @@ export class UnistylesRuntime {
|
|
30
30
|
},
|
31
31
|
orientation: this.orientation,
|
32
32
|
pixelRatio: this.pixelRatio,
|
33
|
-
fontScale: this.fontScale
|
33
|
+
fontScale: this.fontScale,
|
34
|
+
hairlineWidth: this.hairlineWidth,
|
35
|
+
rtl: this.rtl
|
34
36
|
}
|
35
37
|
}
|
36
38
|
|
@@ -42,6 +44,14 @@ export class UnistylesRuntime {
|
|
42
44
|
return this.unistylesBridge.colorScheme
|
43
45
|
}
|
44
46
|
|
47
|
+
/**
|
48
|
+
* Get the layout direction
|
49
|
+
* @returns - Boolean indicating if the layout direction is RTL
|
50
|
+
*/
|
51
|
+
public get rtl() {
|
52
|
+
return this.unistylesBridge.rtl
|
53
|
+
}
|
54
|
+
|
45
55
|
/**
|
46
56
|
* Get info about adaptive themes
|
47
57
|
* @returns - boolean indicating if the adaptive themes are enabled
|
@@ -84,6 +94,7 @@ export class UnistylesRuntime {
|
|
84
94
|
|
85
95
|
/**
|
86
96
|
* Get the names of currently enabled plugins
|
97
|
+
* @deprecated - Plugins will be removed in the next major release
|
87
98
|
* @returns - The names of currently enabled plugins
|
88
99
|
*/
|
89
100
|
public get enabledPlugins() {
|
@@ -173,6 +184,17 @@ export class UnistylesRuntime {
|
|
173
184
|
return parseFloat(this.unistylesBridge.fontScale.toFixed(2))
|
174
185
|
}
|
175
186
|
|
187
|
+
/**
|
188
|
+
* Get the hairline width
|
189
|
+
* @returns - The thinnest width of the platform
|
190
|
+
*/
|
191
|
+
public get hairlineWidth() {
|
192
|
+
const pixelRatio = this.pixelRatio
|
193
|
+
const nearestPixel = Math.trunc(pixelRatio * 0.4) || 1
|
194
|
+
|
195
|
+
return nearestPixel / pixelRatio
|
196
|
+
}
|
197
|
+
|
176
198
|
/**
|
177
199
|
* Get the immersive mode (both status bar and navigation bar hidden (Android))
|
178
200
|
* @param isEnabled
|
@@ -231,6 +253,7 @@ export class UnistylesRuntime {
|
|
231
253
|
|
232
254
|
/**
|
233
255
|
* Enable a plugin
|
256
|
+
* @deprecated - Plugins will be removed in the next major release
|
234
257
|
* @param plugin - Plugin that conforms to UnistylesPlugin interface
|
235
258
|
*/
|
236
259
|
public addPlugin = (plugin: UnistylesPlugin) => {
|
@@ -239,6 +262,7 @@ export class UnistylesRuntime {
|
|
239
262
|
|
240
263
|
/**
|
241
264
|
* Disable a plugin
|
265
|
+
* @deprecated - Plugins will be removed in the next major release
|
242
266
|
* @param plugin - Plugin that conforms to UnistylesPlugin interface
|
243
267
|
*/
|
244
268
|
public removePlugin = (plugin: UnistylesPlugin) => {
|
@@ -28,7 +28,9 @@ export class UnistylesMockedRuntime {
|
|
28
28
|
},
|
29
29
|
orientation: this.orientation,
|
30
30
|
pixelRatio: this.pixelRatio,
|
31
|
-
fontScale: this.fontScale
|
31
|
+
fontScale: this.fontScale,
|
32
|
+
hairlineWidth: this.hairlineWidth,
|
33
|
+
rtl: this.rtl
|
32
34
|
}
|
33
35
|
}
|
34
36
|
|
@@ -62,6 +64,10 @@ export class UnistylesMockedRuntime {
|
|
62
64
|
: undefined
|
63
65
|
}
|
64
66
|
|
67
|
+
public get rtl() {
|
68
|
+
return false
|
69
|
+
}
|
70
|
+
|
65
71
|
public get breakpoints() {
|
66
72
|
return this.unistylesRegistry.breakpoints
|
67
73
|
}
|
@@ -90,6 +96,10 @@ export class UnistylesMockedRuntime {
|
|
90
96
|
return 1.0
|
91
97
|
}
|
92
98
|
|
99
|
+
public get hairlineWidth() {
|
100
|
+
return 0.333333
|
101
|
+
}
|
102
|
+
|
93
103
|
public get fontScale() {
|
94
104
|
return 1.0
|
95
105
|
}
|
@@ -2,14 +2,13 @@ import { NativeEventEmitter, NativeModules } from 'react-native'
|
|
2
2
|
import { useEffect, useState } from 'react'
|
3
3
|
import { unistyles } from '../core'
|
4
4
|
import { UnistylesEventType } from '../common'
|
5
|
-
import type {
|
5
|
+
import type { UnistylesEvents, UnistylesMobileLayoutEvent, UnistylesThemeEvent } from '../types'
|
6
6
|
|
7
7
|
const unistylesEvents = new NativeEventEmitter(NativeModules.Unistyles)
|
8
8
|
|
9
9
|
export const useUnistyles = () => {
|
10
10
|
const [plugins, setPlugins] = useState(unistyles.runtime.enabledPlugins)
|
11
11
|
const [theme, setTheme] = useState(unistyles.registry.getTheme(unistyles.runtime.themeName))
|
12
|
-
const [contentSizeCategory, setContentSizeCategory] = useState(unistyles.runtime.contentSizeCategory)
|
13
12
|
const [layout, setLayout] = useState({
|
14
13
|
breakpoint: unistyles.runtime.breakpoint,
|
15
14
|
orientation: unistyles.runtime.orientation,
|
@@ -58,11 +57,6 @@ export const useUnistyles = () => {
|
|
58
57
|
case UnistylesEventType.Plugin: {
|
59
58
|
return setPlugins(unistyles.runtime.enabledPlugins)
|
60
59
|
}
|
61
|
-
case UnistylesEventType.DynamicTypeSize: {
|
62
|
-
const dynamicTypeSizeEvent = event as UnistylesDynamicTypeSizeEvent
|
63
|
-
|
64
|
-
return setContentSizeCategory(dynamicTypeSizeEvent.payload.contentSizeCategory)
|
65
|
-
}
|
66
60
|
default:
|
67
61
|
return
|
68
62
|
}
|
@@ -75,7 +69,6 @@ export const useUnistyles = () => {
|
|
75
69
|
return {
|
76
70
|
plugins,
|
77
71
|
theme,
|
78
|
-
layout
|
79
|
-
contentSizeCategory
|
72
|
+
layout
|
80
73
|
}
|
81
74
|
}
|
package/src/index.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { unistyles } from './core'
|
2
2
|
import { mq } from './utils'
|
3
3
|
import { useInitialTheme } from './hooks'
|
4
|
-
import type { UnistylesPlugin, UnistylesValues, ExtractVariantNames } from './types'
|
4
|
+
import type { UnistylesPlugin, UnistylesValues, UnistyleText, UnistyleView, UnistyleImage, ExtractVariantNames } from './types'
|
5
5
|
import type { UnistylesThemes, UnistylesBreakpoints } from './global'
|
6
6
|
import { ScreenOrientation, AndroidContentSizeCategory, IOSContentSizeCategory } from './common'
|
7
7
|
import { useStyles } from './useStyles'
|
@@ -48,5 +48,8 @@ export type {
|
|
48
48
|
UnistylesBreakpoints,
|
49
49
|
UnistylesPlugin,
|
50
50
|
UnistylesValues,
|
51
|
+
UnistyleText,
|
52
|
+
UnistyleView,
|
53
|
+
UnistyleImage,
|
51
54
|
ExtractVariantNames as UnistylesVariants
|
52
55
|
}
|
package/src/types/index.ts
CHANGED
@@ -14,7 +14,10 @@ export type {
|
|
14
14
|
StyleSheetWithSuperPowers,
|
15
15
|
StyleSheet,
|
16
16
|
AllAvailableKeys,
|
17
|
-
UnistylesValues
|
17
|
+
UnistylesValues,
|
18
|
+
UnistyleText,
|
19
|
+
UnistyleView,
|
20
|
+
UnistyleImage
|
18
21
|
} from './stylesheet'
|
19
22
|
export type { ReactNativeStyleSheet } from './breakpoints'
|
20
23
|
export type { ExtractVariantNames } from './variants'
|
package/src/types/stylesheet.ts
CHANGED
@@ -6,9 +6,9 @@ import type { UnistylesMiniRuntime } from '../core'
|
|
6
6
|
// these props are treated differently to nest breakpoints and media queries
|
7
7
|
type NestedKeys = 'shadowOffset' | 'transform' | 'textShadowOffset'
|
8
8
|
|
9
|
-
type UnistyleView = Omit<ViewStyle, NestedKeys>
|
10
|
-
type UnistyleText = Omit<TextStyle, NestedKeys>
|
11
|
-
type UnistyleImage = Omit<ImageStyle, NestedKeys>
|
9
|
+
export type UnistyleView = Omit<ViewStyle, NestedKeys>
|
10
|
+
export type UnistyleText = Omit<TextStyle, NestedKeys>
|
11
|
+
export type UnistyleImage = Omit<ImageStyle, NestedKeys>
|
12
12
|
|
13
13
|
type UnistyleNestedStyles = {
|
14
14
|
shadowOffset?: ToDeepUnistyles<ShadowOffset>,
|
package/src/types/unistyles.ts
CHANGED
@@ -50,7 +50,8 @@ export type UnistylesBridge = {
|
|
50
50
|
statusBar: StatusBar,
|
51
51
|
navigationBar: NavigationBar,
|
52
52
|
pixelRatio: number,
|
53
|
-
fontScale: number
|
53
|
+
fontScale: number,
|
54
|
+
rtl: boolean
|
54
55
|
|
55
56
|
// setters
|
56
57
|
themes: Array<keyof UnistylesThemes>,
|
@@ -90,11 +91,4 @@ export type UnistylesPluginEvent = {
|
|
90
91
|
type: UnistylesEventType.Plugin
|
91
92
|
}
|
92
93
|
|
93
|
-
export type
|
94
|
-
type: UnistylesEventType.DynamicTypeSize,
|
95
|
-
payload: {
|
96
|
-
contentSizeCategory: IOSContentSizeCategory | AndroidContentSizeCategory
|
97
|
-
}
|
98
|
-
}
|
99
|
-
|
100
|
-
export type UnistylesEvents = UnistylesThemeEvent | UnistylesMobileLayoutEvent | UnistylesPluginEvent | UnistylesDynamicTypeSizeEvent
|
94
|
+
export type UnistylesEvents = UnistylesThemeEvent | UnistylesMobileLayoutEvent | UnistylesPluginEvent
|