react-native-unistyles 2.0.0-beta.1 → 2.0.0-beta.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. package/android/src/main/java/com/unistyles/UnistylesModule.kt +3 -3
  2. package/ios/UnistylesModule.mm +5 -5
  3. package/lib/commonjs/core/UnistyleRegistry.js +6 -2
  4. package/lib/commonjs/core/UnistyleRegistry.js.map +1 -1
  5. package/lib/commonjs/core/Unistyles.js +1 -1
  6. package/lib/commonjs/core/Unistyles.js.map +1 -1
  7. package/lib/commonjs/core/UnistylesModule.web.js +191 -0
  8. package/lib/commonjs/core/UnistylesModule.web.js.map +1 -0
  9. package/lib/commonjs/core/UnistylesRuntime.js +3 -0
  10. package/lib/commonjs/core/UnistylesRuntime.js.map +1 -1
  11. package/lib/commonjs/hooks/index.js +7 -0
  12. package/lib/commonjs/hooks/index.js.map +1 -1
  13. package/lib/commonjs/hooks/useCSS.js +9 -0
  14. package/lib/commonjs/hooks/useCSS.js.map +1 -0
  15. package/lib/commonjs/hooks/useCSS.web.js +46 -0
  16. package/lib/commonjs/hooks/useCSS.web.js.map +1 -0
  17. package/lib/commonjs/hooks/useUnistyles.js +1 -1
  18. package/lib/commonjs/hooks/useUnistyles.js.map +1 -1
  19. package/lib/commonjs/normalizer/index.js.map +1 -0
  20. package/lib/commonjs/normalizer/module.d.js.map +1 -0
  21. package/lib/commonjs/{plugins/normalizer → normalizer}/normalizeStyle.js +1 -1
  22. package/lib/commonjs/normalizer/normalizeStyle.js.map +1 -0
  23. package/lib/commonjs/normalizer/normalizer.js.map +1 -0
  24. package/lib/commonjs/plugins/cssMediaQueriesPlugin.js +14 -0
  25. package/lib/commonjs/plugins/cssMediaQueriesPlugin.js.map +1 -0
  26. package/lib/commonjs/plugins/index.js +3 -21
  27. package/lib/commonjs/plugins/index.js.map +1 -1
  28. package/lib/commonjs/plugins/normalizeWebStylesPlugin.js +1 -1
  29. package/lib/commonjs/useStyles.js +4 -1
  30. package/lib/commonjs/useStyles.js.map +1 -1
  31. package/lib/commonjs/utils/cssMediaQuery.js +250 -0
  32. package/lib/commonjs/utils/cssMediaQuery.js.map +1 -0
  33. package/lib/commonjs/utils/generateId.js +15 -0
  34. package/lib/commonjs/utils/generateId.js.map +1 -0
  35. package/lib/commonjs/utils/hash32.js +43 -0
  36. package/lib/commonjs/utils/hash32.js.map +1 -0
  37. package/lib/commonjs/utils/index.js +13 -0
  38. package/lib/commonjs/utils/index.js.map +1 -1
  39. package/lib/commonjs/utils/mqParser.js +2 -1
  40. package/lib/commonjs/utils/mqParser.js.map +1 -1
  41. package/lib/commonjs/utils/styles.js +9 -0
  42. package/lib/commonjs/utils/styles.js.map +1 -1
  43. package/lib/commonjs/utils/withPlugins.js +1 -1
  44. package/lib/commonjs/utils/withPlugins.js.map +1 -1
  45. package/lib/module/core/UnistyleRegistry.js +7 -3
  46. package/lib/module/core/UnistyleRegistry.js.map +1 -1
  47. package/lib/module/core/Unistyles.js +2 -2
  48. package/lib/module/core/Unistyles.js.map +1 -1
  49. package/lib/module/core/UnistylesModule.web.js +184 -0
  50. package/lib/module/core/UnistylesModule.web.js.map +1 -0
  51. package/lib/module/core/UnistylesRuntime.js +3 -0
  52. package/lib/module/core/UnistylesRuntime.js.map +1 -1
  53. package/lib/module/hooks/index.js +1 -0
  54. package/lib/module/hooks/index.js.map +1 -1
  55. package/lib/module/hooks/useCSS.js +2 -0
  56. package/lib/module/hooks/useCSS.js.map +1 -0
  57. package/lib/module/hooks/useCSS.web.js +39 -0
  58. package/lib/module/hooks/useCSS.web.js.map +1 -0
  59. package/lib/module/hooks/useUnistyles.js +1 -1
  60. package/lib/module/hooks/useUnistyles.js.map +1 -1
  61. package/lib/module/normalizer/index.js.map +1 -0
  62. package/lib/module/normalizer/module.d.js.map +1 -0
  63. package/lib/module/{plugins/normalizer → normalizer}/normalizeStyle.js +1 -1
  64. package/lib/module/normalizer/normalizeStyle.js.map +1 -0
  65. package/lib/module/normalizer/normalizer.js.map +1 -0
  66. package/lib/module/plugins/cssMediaQueriesPlugin.js +7 -0
  67. package/lib/module/plugins/cssMediaQueriesPlugin.js.map +1 -0
  68. package/lib/module/plugins/index.js +1 -1
  69. package/lib/module/plugins/index.js.map +1 -1
  70. package/lib/module/plugins/normalizeWebStylesPlugin.js +1 -1
  71. package/lib/module/plugins/normalizeWebStylesPlugin.js.map +1 -1
  72. package/lib/module/useStyles.js +5 -2
  73. package/lib/module/useStyles.js.map +1 -1
  74. package/lib/module/utils/cssMediaQuery.js +243 -0
  75. package/lib/module/utils/cssMediaQuery.js.map +1 -0
  76. package/lib/module/utils/generateId.js +7 -0
  77. package/lib/module/utils/generateId.js.map +1 -0
  78. package/lib/module/utils/hash32.js +36 -0
  79. package/lib/module/utils/hash32.js.map +1 -0
  80. package/lib/module/utils/index.js +2 -1
  81. package/lib/module/utils/index.js.map +1 -1
  82. package/lib/module/utils/mqParser.js +1 -1
  83. package/lib/module/utils/mqParser.js.map +1 -1
  84. package/lib/module/utils/styles.js +9 -0
  85. package/lib/module/utils/styles.js.map +1 -1
  86. package/lib/module/utils/withPlugins.js +1 -1
  87. package/lib/module/utils/withPlugins.js.map +1 -1
  88. package/lib/typescript/src/core/UnistyleRegistry.d.ts.map +1 -1
  89. package/lib/typescript/src/core/UnistylesModule.web.d.ts +19 -0
  90. package/lib/typescript/src/core/UnistylesModule.web.d.ts.map +1 -0
  91. package/lib/typescript/src/core/UnistylesRuntime.d.ts +1 -0
  92. package/lib/typescript/src/core/UnistylesRuntime.d.ts.map +1 -1
  93. package/lib/typescript/src/hooks/index.d.ts +1 -0
  94. package/lib/typescript/src/hooks/index.d.ts.map +1 -1
  95. package/lib/typescript/src/hooks/useCSS.d.ts +3 -0
  96. package/lib/typescript/src/hooks/useCSS.d.ts.map +1 -0
  97. package/lib/typescript/src/hooks/useCSS.web.d.ts +3 -0
  98. package/lib/typescript/src/hooks/useCSS.web.d.ts.map +1 -0
  99. package/lib/typescript/src/normalizer/index.d.ts.map +1 -0
  100. package/lib/typescript/src/normalizer/normalizeStyle.d.ts +3 -0
  101. package/lib/typescript/src/normalizer/normalizeStyle.d.ts.map +1 -0
  102. package/lib/typescript/src/{plugins/normalizer → normalizer}/normalizer.d.ts +1 -1
  103. package/lib/typescript/src/normalizer/normalizer.d.ts.map +1 -0
  104. package/lib/typescript/src/plugins/cssMediaQueriesPlugin.d.ts +3 -0
  105. package/lib/typescript/src/plugins/cssMediaQueriesPlugin.d.ts.map +1 -0
  106. package/lib/typescript/src/plugins/index.d.ts +1 -1
  107. package/lib/typescript/src/plugins/index.d.ts.map +1 -1
  108. package/lib/typescript/src/types/unistyles.d.ts +2 -1
  109. package/lib/typescript/src/types/unistyles.d.ts.map +1 -1
  110. package/lib/typescript/src/useStyles.d.ts.map +1 -1
  111. package/lib/typescript/src/utils/cssMediaQuery.d.ts +4 -0
  112. package/lib/typescript/src/utils/cssMediaQuery.d.ts.map +1 -0
  113. package/lib/typescript/src/utils/generateId.d.ts +2 -0
  114. package/lib/typescript/src/utils/generateId.d.ts.map +1 -0
  115. package/lib/typescript/src/utils/hash32.d.ts +2 -0
  116. package/lib/typescript/src/utils/hash32.d.ts.map +1 -0
  117. package/lib/typescript/src/utils/index.d.ts +3 -1
  118. package/lib/typescript/src/utils/index.d.ts.map +1 -1
  119. package/lib/typescript/src/utils/mqParser.d.ts +2 -1
  120. package/lib/typescript/src/utils/mqParser.d.ts.map +1 -1
  121. package/lib/typescript/src/utils/styles.d.ts +1 -1
  122. package/lib/typescript/src/utils/styles.d.ts.map +1 -1
  123. package/package.json +3 -2
  124. package/src/core/UnistyleRegistry.ts +8 -3
  125. package/src/core/Unistyles.ts +2 -2
  126. package/src/core/UnistylesModule.web.ts +218 -0
  127. package/src/core/UnistylesRuntime.ts +4 -0
  128. package/src/hooks/index.ts +1 -0
  129. package/src/hooks/useCSS.ts +3 -0
  130. package/src/hooks/useCSS.web.ts +51 -0
  131. package/src/hooks/useUnistyles.ts +1 -1
  132. package/src/{plugins/normalizer → normalizer}/normalizeStyle.ts +2 -2
  133. package/src/{plugins/normalizer → normalizer}/normalizer.ts +2 -1
  134. package/src/plugins/cssMediaQueriesPlugin.ts +8 -0
  135. package/src/plugins/index.ts +1 -1
  136. package/src/plugins/normalizeWebStylesPlugin.ts +1 -1
  137. package/src/types/unistyles.ts +3 -2
  138. package/src/useStyles.ts +10 -2
  139. package/src/utils/cssMediaQuery.ts +268 -0
  140. package/src/utils/generateId.ts +10 -0
  141. package/src/utils/hash32.ts +53 -0
  142. package/src/utils/index.ts +3 -1
  143. package/src/utils/mqParser.ts +2 -2
  144. package/src/utils/styles.ts +10 -1
  145. package/src/utils/withPlugins.ts +1 -1
  146. package/lib/commonjs/plugins/normalizer/index.js.map +0 -1
  147. package/lib/commonjs/plugins/normalizer/module.d.js.map +0 -1
  148. package/lib/commonjs/plugins/normalizer/normalizeStyle.js.map +0 -1
  149. package/lib/commonjs/plugins/normalizer/normalizer.js.map +0 -1
  150. package/lib/module/plugins/normalizer/index.js.map +0 -1
  151. package/lib/module/plugins/normalizer/module.d.js.map +0 -1
  152. package/lib/module/plugins/normalizer/normalizeStyle.js.map +0 -1
  153. package/lib/module/plugins/normalizer/normalizer.js.map +0 -1
  154. package/lib/typescript/src/plugins/normalizer/index.d.ts.map +0 -1
  155. package/lib/typescript/src/plugins/normalizer/normalizeStyle.d.ts +0 -3
  156. package/lib/typescript/src/plugins/normalizer/normalizeStyle.d.ts.map +0 -1
  157. package/lib/typescript/src/plugins/normalizer/normalizer.d.ts.map +0 -1
  158. /package/lib/commonjs/{plugins/normalizer → normalizer}/index.js +0 -0
  159. /package/lib/commonjs/{plugins/normalizer → normalizer}/module.d.js +0 -0
  160. /package/lib/commonjs/{plugins/normalizer → normalizer}/normalizer.js +0 -0
  161. /package/lib/module/{plugins/normalizer → normalizer}/index.js +0 -0
  162. /package/lib/module/{plugins/normalizer → normalizer}/module.d.js +0 -0
  163. /package/lib/module/{plugins/normalizer → normalizer}/normalizer.js +0 -0
  164. /package/lib/typescript/src/{plugins/normalizer → normalizer}/index.d.ts +0 -0
  165. /package/src/{plugins/normalizer → normalizer}/index.ts +0 -0
  166. /package/src/{plugins/normalizer → normalizer}/module.d.ts +0 -0
@@ -0,0 +1,268 @@
1
+ import { normalizeColor } from '../normalizer'
2
+ import { isUnistylesMq, isValidMq, parseMq, type UnistylesParsedMq } from './mqParser'
3
+ import type { RNStyle, RNValue } from '../types'
4
+ import { generateReactNativeWebId } from './generateId'
5
+ import type { UnistylesRuntime } from '../core'
6
+
7
+ export const createMediaQueryForStyles = (styles: RNStyle, runtime: UnistylesRuntime): RNStyle => {
8
+ const withMediaQueries = Object
9
+ .entries(styles)
10
+ .filter(([, value]) => typeof value === 'object')
11
+ .reduce((acc, [prop, value]) => {
12
+ const objectKeys = Object.keys(value)
13
+ const mediaQueries = objectKeys.filter(key => isUnistylesMq(key))
14
+ const breakpoints = objectKeys.filter(key => runtime.breakpoints[key as keyof typeof runtime.breakpoints])
15
+
16
+ if (mediaQueries.length === 0 && breakpoints.length === 0) {
17
+ return acc
18
+ }
19
+
20
+ const className = generateReactNativeWebId(prop, '""')
21
+ const breakpointsStyles = getBreakpointsStyles(prop, value as Record<string, RNValue>, runtime, className)
22
+ const mediaQueriesStyles = getMediaQueriesFromMQ(prop, value as Record<string, RNValue>, className)
23
+
24
+ return {
25
+ ...acc,
26
+ [prop]: `
27
+ ${breakpointsStyles}
28
+ ${mediaQueriesStyles}
29
+ `.trim()
30
+ }
31
+ }, {})
32
+
33
+ return {
34
+ ...styles,
35
+ ...withMediaQueries
36
+ }
37
+ }
38
+
39
+ const getMaxWidthMediaQuery = (width: UnistylesParsedMq['width']): string => {
40
+ if (!width) {
41
+ return ''
42
+ }
43
+
44
+ if (width.to === Infinity) {
45
+ return ''
46
+ }
47
+
48
+ return `and (max-width: ${width.to}px)`
49
+ }
50
+
51
+ const getMaxHeightMediaQuery = (height: UnistylesParsedMq['height']): string => {
52
+ if (!height) {
53
+ return ''
54
+ }
55
+
56
+ if (height.to === Infinity) {
57
+ return ''
58
+ }
59
+
60
+ return `and (max-height: ${height.to}px)`
61
+ }
62
+
63
+ const getMediaQueriesFromMQ = (prop: string, value: Record<string, RNValue>, className: string): string => Object
64
+ .entries(value)
65
+ .reduce((acc, [key, value]) => {
66
+ const result = parseMq(key)
67
+
68
+ if (!isValidMq(result)) {
69
+ return acc
70
+ }
71
+
72
+ if (result.width && result.height) {
73
+ return `${acc}
74
+
75
+ @media screen and (min-width: ${result.width.from}px) and (min-height: ${result.height.from}px) ${getMaxWidthMediaQuery(result.width)} ${getMaxHeightMediaQuery(result.height)} {
76
+ .${className} {
77
+ ${normalizePropName(prop)}: ${normalizeWebValue(prop, value)};
78
+ }
79
+ }
80
+ `
81
+ }
82
+
83
+ if (result.width) {
84
+ return `${acc}
85
+
86
+ @media screen and (min-width: ${result.width.from}px) ${getMaxWidthMediaQuery(result.width)} {
87
+ .${className} {
88
+ ${normalizePropName(prop)}: ${normalizeWebValue(prop, value)};
89
+ }
90
+ }
91
+ `
92
+ }
93
+
94
+ if (result.height) {
95
+ return `${acc}
96
+
97
+ @media screen and (min-height: ${result.height.from}px) ${getMaxHeightMediaQuery(result.height)} {
98
+ .${className} {
99
+ ${normalizePropName(prop)}: ${normalizeWebValue(prop, value)};
100
+ }
101
+ }
102
+ `
103
+ }
104
+
105
+ return acc
106
+ }, '')
107
+
108
+ const getBreakpointsStyles = (prop: string, value: Record<string, RNValue>, runtime: UnistylesRuntime, className: string): string => Object
109
+ .entries(value)
110
+ .reduce((acc, [key, value]) => {
111
+ const breakpoint = runtime.breakpoints[key as keyof typeof runtime.breakpoints]
112
+
113
+ if (breakpoint === undefined) {
114
+ return acc
115
+ }
116
+
117
+ return `${acc}
118
+
119
+ @media screen and (min-width: ${breakpoint}px) {
120
+ .${className} {
121
+ ${normalizePropName(prop)}: ${normalizeWebValue(prop, value)};
122
+ }
123
+ }
124
+ `
125
+ }, '')
126
+
127
+ const normalizePropName = (prop: string) => prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase()
128
+
129
+ const normalizeWebValue = (prop: string, value: RNValue): string => {
130
+ if (value === undefined) {
131
+ return 'unset'
132
+ }
133
+
134
+ switch (prop) {
135
+ // colors
136
+ case 'color':
137
+ case 'backgroundColor':
138
+ case 'borderColor':
139
+ case 'borderBottomColor':
140
+ case 'borderLeftColor':
141
+ case 'borderRightColor':
142
+ case 'borderTopColor':
143
+ case 'borderBlockColor':
144
+ case 'borderBlockEndColor':
145
+ case 'borderBlockStartColor':
146
+ case 'textDecorationColor':
147
+ return normalizeColor(value as string)
148
+
149
+ // dimensions
150
+ case 'width':
151
+ case 'height':
152
+ case 'minWidth':
153
+ case 'minHeight':
154
+ case 'maxWidth':
155
+ case 'maxHeight':
156
+ case 'borderRadius':
157
+ case 'borderWidth':
158
+ case 'borderBottomLeftRadius':
159
+ case 'borderBottomRightRadius':
160
+ case 'borderEndEndRadius':
161
+ case 'borderEndStartRadius':
162
+ case 'borderStartEndRadius':
163
+ case 'borderStartStartRadius':
164
+ case 'borderTopLeftRadius':
165
+ case 'borderTopRightRadius':
166
+ case 'borderBottomWidth':
167
+ case 'borderLeftWidth':
168
+ case 'borderRightWidth':
169
+ case 'borderTopWidth':
170
+ case 'bottom':
171
+ case 'left':
172
+ case 'right':
173
+ case 'top':
174
+ case 'marginTop':
175
+ case 'marginBottom':
176
+ case 'marginLeft':
177
+ case 'marginRight':
178
+ case 'paddingTop':
179
+ case 'paddingBottom':
180
+ case 'paddingLeft':
181
+ case 'paddingRight':
182
+ case 'flexBasis':
183
+ case 'rowGap':
184
+ case 'columnGap':
185
+ case 'gap':
186
+ case 'margin':
187
+ case 'padding':
188
+ case 'fontSize':
189
+ case 'letterSpacing':
190
+ return `${value as string}px`
191
+
192
+ // without unit
193
+ case 'borderStyle':
194
+ case 'pointerEvents':
195
+ case 'backfaceVisibility':
196
+ case 'alignContent':
197
+ case 'alignItems':
198
+ case 'alignSelf':
199
+ case 'flexDirection':
200
+ case 'flexWrap':
201
+ case 'flex':
202
+ case 'aspectRatio':
203
+ case 'opacity':
204
+ case 'direction':
205
+ case 'zIndex':
206
+ case 'justifyContent':
207
+ case 'overflow':
208
+ case 'display':
209
+ case 'position':
210
+ case 'flexGrow':
211
+ case 'flexShrink':
212
+ case 'fontFamily':
213
+ case 'fontStyle':
214
+ case 'textDecorationLine':
215
+ case 'textAlign':
216
+ case 'textDecorationStyle':
217
+ case 'lineHeight':
218
+ case 'textTransform':
219
+ case 'fontVariant':
220
+ case 'verticalAlign':
221
+ case 'objectFit':
222
+ return value as string
223
+
224
+ // to be transformed for now
225
+ // not supported
226
+ case 'marginHorizontal':
227
+ case 'paddingHorizontal':
228
+ case 'marginVertical':
229
+ case 'paddingVertical':
230
+ case 'shadowColor':
231
+ case 'shadowOffset':
232
+ case 'shadowOpacity':
233
+ case 'shadowRadius':
234
+ case 'transform':
235
+ case 'transformMatrix':
236
+ case 'fontWeight':
237
+ case 'textShadowOffset':
238
+ case 'textShadowRadius':
239
+ case 'textShadowColor':
240
+ return ''
241
+
242
+ // unsupported
243
+ case 'borderStartColor':
244
+ case 'borderEndColor':
245
+ case 'borderEndWidth':
246
+ case 'borderBottomEndRadius':
247
+ case 'borderBottomStartRadius':
248
+ case 'borderCurve':
249
+ case 'elevation':
250
+ case 'borderTopEndRadius':
251
+ case 'borderTopStartRadius':
252
+ case 'borderStartWidth':
253
+ case 'start':
254
+ case 'end':
255
+ case 'margin-end':
256
+ case 'margin-start':
257
+ case 'padding-end':
258
+ case 'padding-start':
259
+ case 'writingDirection':
260
+ case 'textAlignVertical':
261
+ case 'includeFontPadding':
262
+ case 'resizeMode':
263
+ case 'overlayColor':
264
+ case 'tintColor':
265
+ default:
266
+ return ''
267
+ }
268
+ }
@@ -0,0 +1,10 @@
1
+ // eslint-disable-next-line camelcase
2
+ import { murmurhash2_32_gc } from './hash32'
3
+
4
+ export const generateReactNativeWebId = (key: string, value: string): string => {
5
+ const hashedString = murmurhash2_32_gc(key + value, 1).toString(36)
6
+
7
+ return process.env.NODE_ENV !== 'production'
8
+ ? `r-${key}-${hashedString}`
9
+ : `r-${hashedString}`
10
+ }
@@ -0,0 +1,53 @@
1
+ /*
2
+ Authors: Gary Court and Austin Appleby
3
+ Compatible with React Native Web
4
+ https://github.com/necolas/react-native-web/blob/master/packages/react-native-web/src/exports/StyleSheet/compiler/hash.js#L65
5
+ */
6
+ export const murmurhash2_32_gc = (str: string, seed: number) => {
7
+ let l = str.length
8
+ let h = seed ^ l
9
+ let i = 0
10
+ let k
11
+
12
+ while (l >= 4) {
13
+ k =
14
+ (str.charCodeAt(i) & 0xff) |
15
+ ((str.charCodeAt(++i) & 0xff) << 8) |
16
+ ((str.charCodeAt(++i) & 0xff) << 16) |
17
+ ((str.charCodeAt(++i) & 0xff) << 24)
18
+
19
+ k =
20
+ (k & 0xffff) * 0x5bd1e995 + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16)
21
+ k ^= k >>> 24
22
+ k =
23
+ (k & 0xffff) * 0x5bd1e995 + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16)
24
+
25
+ h =
26
+ ((h & 0xffff) * 0x5bd1e995 +
27
+ ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)) ^
28
+ k
29
+
30
+ l -= 4
31
+ ++i
32
+ }
33
+
34
+ switch (l) {
35
+ // @ts-ignore
36
+ case 3:
37
+ h ^= (str.charCodeAt(i + 2) & 0xff) << 16
38
+ // @ts-ignore
39
+ case 2:
40
+ h ^= (str.charCodeAt(i + 1) & 0xff) << 8
41
+ case 1:
42
+ h ^= str.charCodeAt(i) & 0xff
43
+ h =
44
+ (h & 0xffff) * 0x5bd1e995 +
45
+ ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)
46
+ }
47
+
48
+ h ^= h >>> 13
49
+ h = (h & 0xffff) * 0x5bd1e995 + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)
50
+ h ^= h >>> 15
51
+
52
+ return h >>> 0
53
+ }
@@ -1,5 +1,7 @@
1
1
  export { mq } from './mq'
2
- export { getKeyForUnistylesMediaQuery, isWithinTheWidthAndHeight, isValidMq, parseMq } from './mqParser'
2
+ export type { UnistylesParsedMq } from './mqParser'
3
+ export { getKeyForUnistylesMediaQuery, isWithinTheWidthAndHeight, isValidMq, parseMq, isUnistylesMq } from './mqParser'
3
4
  export { getValueForBreakpoint } from './breakpoints'
4
5
  export { proxifyFunction, parseStyle } from './styles'
5
6
  export { withPlugins } from './withPlugins'
7
+ export { generateReactNativeWebId } from './generateId'
@@ -9,7 +9,7 @@ type ParsedMqDimension = {
9
9
  to: number
10
10
  }
11
11
 
12
- type UnistylesParsedMq = {
12
+ export type UnistylesParsedMq = {
13
13
  width?: ParsedMqDimension,
14
14
  height?: ParsedMqDimension
15
15
  }
@@ -30,7 +30,7 @@ export const parseMq = (mq: string): UnistylesParsedMq => {
30
30
  }
31
31
  }
32
32
 
33
- const isUnistylesMq = (mq: string) => IS_UNISTYLES_REGEX.test(mq)
33
+ export const isUnistylesMq = (mq: string) => IS_UNISTYLES_REGEX.test(mq)
34
34
 
35
35
  export const isValidMq = (parsedMq: UnistylesParsedMq) => {
36
36
  const { width, height } = parsedMq
@@ -21,7 +21,8 @@ export const isPlatformColor = <T extends {}>(value: T): boolean => {
21
21
 
22
22
  export const parseStyle = <T extends RNStyle>(
23
23
  style: T,
24
- variant: Record<string, Optional<string>> = {}
24
+ variant: Record<string, Optional<string>> = {},
25
+ parseMediaQueries = true
25
26
  ): T => Object
26
27
  .entries(style || {})
27
28
  .reduce((acc, [key, value]) => {
@@ -58,6 +59,14 @@ export const parseStyle = <T extends RNStyle>(
58
59
  }
59
60
  }
60
61
 
62
+ // don't parse media queries and breakpoints
63
+ if (!parseMediaQueries) {
64
+ return {
65
+ ...acc,
66
+ [key]: value
67
+ }
68
+ }
69
+
61
70
  return {
62
71
  ...acc,
63
72
  [key]: getValueForBreakpoint(value as Record<string, RNValue>)
@@ -6,7 +6,7 @@ export const withPlugins = (
6
6
  style: RNStyle
7
7
  ) => unistyles.registry.plugins.reduce((acc, plugin) => {
8
8
  if (plugin.onParsedStyle) {
9
- return plugin.onParsedStyle(key, style, unistyles.runtime)
9
+ return plugin.onParsedStyle(key, acc, unistyles.runtime)
10
10
  }
11
11
 
12
12
  return acc
@@ -1 +0,0 @@
1
- {"version":3,"names":["_normalizeStyle","require","_normalizer"],"sourceRoot":"../../../../src","sources":["plugins/normalizer/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["plugins/normalizer/module.d.ts"],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"names":["_normalizer","require","_common","normalizeBoxShadow","style","requiredBoxShadowProperties","every","prop","warn","join","shadowColor","undefined","shadowOffset","shadowOpacity","shadowRadius","boxShadow","preprocessor","createBoxShadowValue","normalizeTextShadow","requiredTextShadowProperties","textShadowColor","textShadowOffset","textShadowRadius","textShadow","createTextShadowValue","normalizeStyle","normalizedTransform","Array","isArray","transform","createTransformValue","normalizedBoxShadow","normalizedTextShadow","exports"],"sourceRoot":"../../../../src","sources":["plugins/normalizer/normalizeStyle.ts"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAGA,MAAME,kBAAkB,GAAyBC,KAAQ,IAA0B;EAC/E,MAAMC,2BAA2B,GAAG,CAChC,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,CACjB;EAED,IAAI,CAACA,2BAA2B,CAACC,KAAK,CAACC,IAAI,IAAIA,IAAI,IAAIH,KAAK,CAAC,EAAE;IAC3D,IAAAI,YAAI,EAAE,wEAAuEH,2BAA2B,CAACI,IAAI,CAAC,IAAI,CAAE,EAAC,CAAC;IAEtH,OAAO;MACHC,WAAW,EAAEC,SAAS;MACtBC,YAAY,EAAED,SAAS;MACvBE,aAAa,EAAEF,SAAS;M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AC,CAAC;EAE/C,MAAM4B,oBAAoB,GACtB,iBAAiB,IAAI5B,KAAK,IAC1B,kBAAkB,IAAIA,KAAK,IAC3B,kBAAkB,IAAIA,KAAK,GAC3Bc,mBAAmB,CAACd,KAAmB,CAAC,GAAG,CAAC,CAAC;EAEjD,OAAO;IACH,GAAGA,KAAK;IACR,GAAGsB,mBAAmB;IACtB,GAAGK,mBAAmB;IACtB,GAAGC;EACP,CAAC;AACL,CAAC;AAAAC,OAAA,CAAAR,cAAA,GAAAA,cAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["_normalizeColors","_interopRequireDefault","require","obj","__esModule","default","normalizeColor","color","opacity","arguments","length","undefined","integer","normalizeColors","hex","toString","padStart","r","g","b","a","split","map","x","parseInt","filter","num","isNaN","exports","normalizeNumericValue","value","normalizeTransform","key","includes","createTextShadowValue","style","textShadowColor","textShadowOffset","textShadowRadius","offsetX","width","offsetY","height","radius","createBoxShadowValue","shadowColor","shadowOffset","shadowOpacity","shadowRadius","createTransformValue","transforms","transform","Object","keys","join","Boolean","preprocessor"],"sourceRoot":"../../../../src","sources":["plugins/normalizer/normalizer.ts"],"mappings":";;;;;;AAEA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA4D,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAF5D;AACA;;AAUO,MAAMG,cAAc,GAAG,SAAAA,CAACC,KAAa,EAA0B;EAAA,IAAxBC,OAAe,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC;EAC7D;EACA,IAAID,OAAO,KAAK,CAAC,EAAE;IACf,OAAOD,KAAK;EAChB;EAEA,MAAMK,OAAO,GAAG,IAAAC,wBAAe,EAACN,KAAK,CAAqB;;EAE1D;EACA,IAAIK,OAAO,KAAK,IAAI,EAAE;IAClB,OAAOL,KAAK;E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CAAE,GAAE;EAC1D;AACJ,CAAC,CAAC,CACDL,MAAM,CAAC8B,OAAO,CAAC,CACfD,IAAI,CAAC,GAAG,CAAC;AAEP,MAAME,YAA0B,GAAA5B,OAAA,CAAA4B,YAAA,GAAG;EACtCtB,qBAAqB;EACrBU,oBAAoB;EACpBK;AACJ,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["normalizeStyle","preprocessor","normalizeNumericValue","normalizeColor"],"sourceRoot":"../../../../src","sources":["plugins/normalizer/index.ts"],"mappings":"AAAA,SAASA,cAAc,QAAQ,kBAAkB;AACjD,SAASC,YAAY,EAAEC,qBAAqB,EAAEC,cAAc,QAAQ,cAAc"}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["plugins/normalizer/module.d.ts"],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"names":["preprocessor","warn","normalizeBoxShadow","style","requiredBoxShadowProperties","every","prop","join","shadowColor","undefined","shadowOffset","shadowOpacity","shadowRadius","boxShadow","createBoxShadowValue","normalizeTextShadow","requiredTextShadowProperties","textShadowColor","textShadowOffset","textShadowRadius","textShadow","createTextShadowValue","normalizeStyle","normalizedTransform","Array","isArray","transform","createTransformValue","normalizedBoxShadow","normalizedTextShadow"],"sourceRoot":"../../../../src","sources":["plugins/normalizer/normalizeStyle.ts"],"mappings":"AAAA,SAASA,YAAY,QAAQ,cAAc;AAC3C,SAASC,IAAI,QAAQ,cAAc;AAGnC,MAAMC,kBAAkB,GAAyBC,KAAQ,IAA0B;EAC/E,MAAMC,2BAA2B,GAAG,CAChC,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,CACjB;EAED,IAAI,CAACA,2BAA2B,CAACC,KAAK,CAACC,IAAI,IAAIA,IAAI,IAAIH,KAAK,CAAC,EAAE;IAC3DF,IAAI,CAAE,wEAAuEG,2BAA2B,CAACG,IAAI,CAAC,IAAI,CAAE,EAAC,CAAC;IAEtH,OAAO;MACHC,WAAW,EAAEC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IAAIA,KAAK,GACvBD,kBAAkB,CAACC,KAAkB,CAAC,GAAG,CAAC,CAAC;EAE/C,MAAM0B,oBAAoB,GACtB,iBAAiB,IAAI1B,KAAK,IAC1B,kBAAkB,IAAIA,KAAK,IAC3B,kBAAkB,IAAIA,KAAK,GAC3BY,mBAAmB,CAACZ,KAAmB,CAAC,GAAG,CAAC,CAAC;EAEjD,OAAO;IACH,GAAGA,KAAK;IACR,GAAGoB,mBAAmB;IACtB,GAAGK,mBAAmB;IACtB,GAAGC;EACP,CAAC;AACL,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["normalizeColors","normalizeColor","color","opacity","arguments","length","undefined","integer","hex","toString","padStart","r","g","b","a","split","map","x","parseInt","filter","num","isNaN","normalizeNumericValue","value","normalizeTransform","key","includes","createTextShadowValue","style","textShadowColor","textShadowOffset","textShadowRadius","offsetX","width","offsetY","height","radius","createBoxShadowValue","shadowColor","shadowOffset","shadowOpacity","shadowRadius","createTransformValue","transforms","transform","Object","keys","join","Boolean","preprocessor"],"sourceRoot":"../../../../src","sources":["plugins/normalizer/normalizer.ts"],"mappings":"AAAA;AACA;AACA,OAAOA,eAAe,MAAM,gCAAgC;AAS5D,OAAO,MAAMC,cAAc,GAAG,SAAAA,CAACC,KAAa,EAA0B;EAAA,IAAxBC,OAAe,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC;EAC7D;EACA,IAAID,OAAO,KAAK,CAAC,EAAE;IACf,OAAOD,KAAK;EAChB;EAEA,MAAMK,OAAO,GAAGP,eAAe,CAACE,KAAK,CAAqB;;EAE1D;EACA,IAAIK,OAAO,KAAK,IAAI,EAAE;IAClB,OAAOL,KAAK;EAChB;EAEA,MAAMM,GAAG,GAAGD,OAAO,CAACE,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;EAEjD,IAAIF,GAAG,CAACH,MAAM,KAAK,CAAC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"","sources":["../../../../../src/plugins/normalizer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { RNStyle } from '../../types';
2
- export declare const normalizeStyle: <T extends RNStyle>(style: T) => T;
3
- //# sourceMappingURL=normalizeStyle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalizeStyle.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/normalizer/normalizeStyle.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAoE,OAAO,EAAE,MAAM,aAAa,CAAA;AAuD5G,eAAO,MAAM,cAAc,oCAwB1B,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalizer.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/normalizer/normalizer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAY,MAAM,aAAa,CAAA;AAE9E,KAAK,YAAY,GAAG;IAChB,qBAAqB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAAC;IACjD,oBAAoB,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC;IACzD,oBAAoB,CAAC,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC;CAClE,CAAA;AAED,eAAO,MAAM,cAAc,UAAW,MAAM,YAAW,MAAM,WAyB5D,CAAA;AAED,eAAO,MAAM,qBAAqB,UAAW,MAAM,oBAAiC,CAAA;AAwDpF,eAAO,MAAM,YAAY,EAAE,YAI1B,CAAA"}
File without changes