react-native-unistyles 3.0.0-alpha.20 → 3.0.0-alpha.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. package/cxx/common/Constants.h +1 -0
  2. package/cxx/core/UnistyleWrapper.h +21 -41
  3. package/cxx/hybridObjects/HybridStyleSheet.cpp +1 -1
  4. package/cxx/hybridObjects/HybridStyleSheet.h +1 -1
  5. package/lib/commonjs/web/convert/boxShadow.js +13 -13
  6. package/lib/commonjs/web/convert/boxShadow.js.map +1 -1
  7. package/lib/commonjs/web/convert/index.js +9 -11
  8. package/lib/commonjs/web/convert/index.js.map +1 -1
  9. package/lib/commonjs/web/convert/pseudo.js.map +1 -0
  10. package/lib/commonjs/web/convert/style.js +11 -7
  11. package/lib/commonjs/web/convert/style.js.map +1 -1
  12. package/lib/commonjs/web/convert/textShadow.js +12 -12
  13. package/lib/commonjs/web/convert/textShadow.js.map +1 -1
  14. package/lib/commonjs/web/convert/transform.js +5 -5
  15. package/lib/commonjs/web/convert/transform.js.map +1 -1
  16. package/lib/commonjs/web/{listener/listener.js → listener.js} +2 -2
  17. package/lib/commonjs/web/listener.js.map +1 -0
  18. package/lib/commonjs/web/mq.js.map +1 -1
  19. package/lib/commonjs/web/registry.js +159 -21
  20. package/lib/commonjs/web/registry.js.map +1 -1
  21. package/lib/commonjs/web/shadowRegistry.js +50 -48
  22. package/lib/commonjs/web/shadowRegistry.js.map +1 -1
  23. package/lib/commonjs/web/state.js +8 -16
  24. package/lib/commonjs/web/state.js.map +1 -1
  25. package/lib/commonjs/web/{utils.js → utils/common.js} +9 -47
  26. package/lib/commonjs/web/utils/common.js.map +1 -0
  27. package/lib/commonjs/web/utils/index.js +28 -0
  28. package/lib/commonjs/web/utils/index.js.map +1 -0
  29. package/lib/commonjs/web/utils/unistyle.js +82 -0
  30. package/lib/commonjs/web/utils/unistyle.js.map +1 -0
  31. package/lib/module/web/convert/boxShadow.js +13 -13
  32. package/lib/module/web/convert/boxShadow.js.map +1 -1
  33. package/lib/module/web/convert/index.js +7 -9
  34. package/lib/module/web/convert/index.js.map +1 -1
  35. package/lib/module/web/convert/pseudo.js.map +1 -0
  36. package/lib/module/web/convert/style.js +11 -7
  37. package/lib/module/web/convert/style.js.map +1 -1
  38. package/lib/module/web/convert/textShadow.js +12 -12
  39. package/lib/module/web/convert/textShadow.js.map +1 -1
  40. package/lib/module/web/convert/transform.js +5 -5
  41. package/lib/module/web/convert/transform.js.map +1 -1
  42. package/lib/module/web/{listener/listener.js → listener.js} +2 -2
  43. package/lib/module/web/listener.js.map +1 -0
  44. package/lib/module/web/mq.js.map +1 -1
  45. package/lib/module/web/registry.js +160 -22
  46. package/lib/module/web/registry.js.map +1 -1
  47. package/lib/module/web/shadowRegistry.js +51 -49
  48. package/lib/module/web/shadowRegistry.js.map +1 -1
  49. package/lib/module/web/state.js +8 -16
  50. package/lib/module/web/state.js.map +1 -1
  51. package/lib/module/web/{utils.js → utils/common.js} +7 -39
  52. package/lib/module/web/utils/common.js.map +1 -0
  53. package/lib/module/web/utils/index.js +5 -0
  54. package/lib/module/web/utils/index.js.map +1 -0
  55. package/lib/module/web/utils/unistyle.js +69 -0
  56. package/lib/module/web/utils/unistyle.js.map +1 -0
  57. package/lib/typescript/expo-example/app/(tabs)/_layout.d.ts +3 -0
  58. package/lib/typescript/expo-example/app/(tabs)/_layout.d.ts.map +1 -0
  59. package/lib/typescript/expo-example/app/(tabs)/explore.d.ts +3 -0
  60. package/lib/typescript/expo-example/app/(tabs)/explore.d.ts.map +1 -0
  61. package/lib/typescript/expo-example/app/(tabs)/index.d.ts +3 -0
  62. package/lib/typescript/expo-example/app/(tabs)/index.d.ts.map +1 -0
  63. package/lib/typescript/expo-example/app/+html.d.ts +4 -0
  64. package/lib/typescript/expo-example/app/+html.d.ts.map +1 -0
  65. package/lib/typescript/expo-example/app/+not-found.d.ts +3 -0
  66. package/lib/typescript/expo-example/app/+not-found.d.ts.map +1 -0
  67. package/lib/typescript/expo-example/app/_layout.d.ts +3 -0
  68. package/lib/typescript/expo-example/app/_layout.d.ts.map +1 -0
  69. package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts +1 -1
  70. package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts.map +1 -1
  71. package/lib/typescript/src/types/stylesheet.d.ts +1 -1
  72. package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
  73. package/lib/typescript/src/web/convert/boxShadow.d.ts +7 -2
  74. package/lib/typescript/src/web/convert/boxShadow.d.ts.map +1 -1
  75. package/lib/typescript/src/web/convert/index.d.ts +1 -2
  76. package/lib/typescript/src/web/convert/index.d.ts.map +1 -1
  77. package/lib/typescript/src/web/convert/pseudo.d.ts.map +1 -0
  78. package/lib/typescript/src/web/convert/style.d.ts +1 -2
  79. package/lib/typescript/src/web/convert/style.d.ts.map +1 -1
  80. package/lib/typescript/src/web/convert/textShadow.d.ts +7 -2
  81. package/lib/typescript/src/web/convert/textShadow.d.ts.map +1 -1
  82. package/lib/typescript/src/web/convert/transform.d.ts +1 -2
  83. package/lib/typescript/src/web/convert/transform.d.ts.map +1 -1
  84. package/lib/typescript/src/web/{listener/listener.d.ts → listener.d.ts} +1 -1
  85. package/lib/typescript/src/web/listener.d.ts.map +1 -0
  86. package/lib/typescript/src/web/mq.d.ts +6 -2
  87. package/lib/typescript/src/web/mq.d.ts.map +1 -1
  88. package/lib/typescript/src/web/registry.d.ts +21 -8
  89. package/lib/typescript/src/web/registry.d.ts.map +1 -1
  90. package/lib/typescript/src/web/shadowRegistry.d.ts +3 -4
  91. package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -1
  92. package/lib/typescript/src/web/state.d.ts +2 -2
  93. package/lib/typescript/src/web/state.d.ts.map +1 -1
  94. package/lib/typescript/src/web/{utils.d.ts → utils/common.d.ts} +2 -20
  95. package/lib/typescript/src/web/utils/common.d.ts.map +1 -0
  96. package/lib/typescript/src/web/utils/index.d.ts +3 -0
  97. package/lib/typescript/src/web/utils/index.d.ts.map +1 -0
  98. package/lib/typescript/src/web/utils/unistyle.d.ts +20 -0
  99. package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -0
  100. package/nitrogen/generated/android/c++/JColorScheme.hpp +1 -1
  101. package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency_.hpp +8 -8
  102. package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +22 -22
  103. package/nitrogen/generated/android/c++/JOrientation.hpp +1 -1
  104. package/nitrogen/generated/android/c++/JUnistyleDependency.hpp +1 -1
  105. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +2 -2
  106. package/nitrogen/generated/android/{UnistylesOnLoad.cpp → unistylesOnLoad.cpp} +2 -2
  107. package/nitrogen/generated/android/{UnistylesOnLoad.hpp → unistylesOnLoad.hpp} +1 -1
  108. package/nitrogen/generated/ios/Unistyles+autolinking.rb +5 -3
  109. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.cpp +25 -0
  110. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +32 -32
  111. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Umbrella.hpp +0 -29
  112. package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +0 -12
  113. package/nitrogen/generated/ios/swift/HybridNativePlatformSpecCxx.swift +134 -110
  114. package/nitrogen/generated/shared/c++/ColorScheme.hpp +2 -2
  115. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.cpp +1 -1
  116. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +1 -1
  117. package/nitrogen/generated/shared/c++/Orientation.hpp +2 -2
  118. package/package.json +4 -15
  119. package/src/specs/StyleSheet/UnistylesStyleSheet.nitro.ts +1 -1
  120. package/src/types/stylesheet.ts +1 -1
  121. package/src/web/convert/boxShadow.ts +14 -15
  122. package/src/web/convert/index.ts +6 -13
  123. package/src/web/convert/style.ts +61 -10
  124. package/src/web/convert/textShadow.ts +13 -14
  125. package/src/web/convert/transform.ts +7 -8
  126. package/src/web/{listener/listener.ts → listener.ts} +2 -2
  127. package/src/web/mq.ts +1 -3
  128. package/src/web/registry.ts +202 -23
  129. package/src/web/shadowRegistry.ts +49 -49
  130. package/src/web/state.ts +13 -23
  131. package/src/web/{utils.ts → utils/common.ts} +6 -68
  132. package/src/web/utils/index.ts +2 -0
  133. package/src/web/utils/unistyle.ts +104 -0
  134. package/lib/commonjs/web/convert/breakpoint.js +0 -25
  135. package/lib/commonjs/web/convert/breakpoint.js.map +0 -1
  136. package/lib/commonjs/web/createUnistylesComponent.js +0 -61
  137. package/lib/commonjs/web/createUnistylesComponent.js.map +0 -1
  138. package/lib/commonjs/web/listener/index.js +0 -20
  139. package/lib/commonjs/web/listener/index.js.map +0 -1
  140. package/lib/commonjs/web/listener/listenToDependencies.js +0 -38
  141. package/lib/commonjs/web/listener/listenToDependencies.js.map +0 -1
  142. package/lib/commonjs/web/listener/listener.js.map +0 -1
  143. package/lib/commonjs/web/pseudo.js.map +0 -1
  144. package/lib/commonjs/web/utils.js.map +0 -1
  145. package/lib/module/web/convert/breakpoint.js +0 -20
  146. package/lib/module/web/convert/breakpoint.js.map +0 -1
  147. package/lib/module/web/createUnistylesComponent.js +0 -54
  148. package/lib/module/web/createUnistylesComponent.js.map +0 -1
  149. package/lib/module/web/listener/index.js +0 -5
  150. package/lib/module/web/listener/index.js.map +0 -1
  151. package/lib/module/web/listener/listenToDependencies.js +0 -33
  152. package/lib/module/web/listener/listenToDependencies.js.map +0 -1
  153. package/lib/module/web/listener/listener.js.map +0 -1
  154. package/lib/module/web/pseudo.js.map +0 -1
  155. package/lib/module/web/utils.js.map +0 -1
  156. package/lib/typescript/src/web/convert/breakpoint.d.ts +0 -3
  157. package/lib/typescript/src/web/convert/breakpoint.d.ts.map +0 -1
  158. package/lib/typescript/src/web/createUnistylesComponent.d.ts +0 -3
  159. package/lib/typescript/src/web/createUnistylesComponent.d.ts.map +0 -1
  160. package/lib/typescript/src/web/listener/index.d.ts +0 -3
  161. package/lib/typescript/src/web/listener/index.d.ts.map +0 -1
  162. package/lib/typescript/src/web/listener/listenToDependencies.d.ts +0 -12
  163. package/lib/typescript/src/web/listener/listenToDependencies.d.ts.map +0 -1
  164. package/lib/typescript/src/web/listener/listener.d.ts.map +0 -1
  165. package/lib/typescript/src/web/pseudo.d.ts.map +0 -1
  166. package/lib/typescript/src/web/utils.d.ts.map +0 -1
  167. package/src/web/convert/breakpoint.ts +0 -21
  168. package/src/web/createUnistylesComponent.tsx +0 -54
  169. package/src/web/listener/index.ts +0 -2
  170. package/src/web/listener/listenToDependencies.ts +0 -45
  171. /package/lib/commonjs/web/{pseudo.js → convert/pseudo.js} +0 -0
  172. /package/lib/module/web/{pseudo.js → convert/pseudo.js} +0 -0
  173. /package/lib/typescript/src/web/{pseudo.d.ts → convert/pseudo.d.ts} +0 -0
  174. /package/nitrogen/generated/android/{UnistylesOnLoad.kt → unistylesOnLoad.kt} +0 -0
  175. /package/src/web/{pseudo.ts → convert/pseudo.ts} +0 -0
package/src/web/state.ts CHANGED
@@ -8,12 +8,19 @@ import { UnistylesListener } from './listener'
8
8
  import { UnistyleDependency } from '../specs/NativePlatform'
9
9
 
10
10
  class UnistylesStateBuilder {
11
- private readonly isSSR = isServer()
12
-
13
11
  themes = new Map<string, UnistylesTheme>()
14
12
  themeName?: AppThemeName
15
13
 
16
- breakpoint?: AppBreakpoint
14
+ private matchingBreakpoints = new Map<string, boolean>()
15
+
16
+ get breakpoint() {
17
+ const [currentBreakpoint] = Array.from(this.matchingBreakpoints)
18
+ .reverse()
19
+ .find(([_key, value]) => value) ?? []
20
+
21
+ return currentBreakpoint as AppBreakpoint | undefined
22
+ }
23
+
17
24
  breakpoints?: UnistylesBreakpoints
18
25
 
19
26
  hasAdaptiveThemes = false
@@ -23,7 +30,7 @@ class UnistylesStateBuilder {
23
30
  this.initBreakpoints(config.breakpoints)
24
31
  this.initSettings(config.settings)
25
32
 
26
- if (this.isSSR) {
33
+ if (isServer()) {
27
34
  return
28
35
  }
29
36
 
@@ -64,8 +71,6 @@ class UnistylesStateBuilder {
64
71
  }
65
72
 
66
73
  private initBreakpoints = (breakpoints = {} as UnistylesBreakpoints) => {
67
- const breakpointsMap = new Map<string, MediaQueryList>()
68
-
69
74
  this.breakpoints = breakpoints
70
75
 
71
76
  Object.entries(breakpoints)
@@ -76,25 +81,10 @@ class UnistylesStateBuilder {
76
81
  }
77
82
 
78
83
  const mediaQuery = window.matchMedia(`(min-width: ${value}px)`)
79
- breakpointsMap.set(breakpoint, mediaQuery)
80
-
81
- if (mediaQuery.matches) {
82
- this.breakpoint = breakpoint as AppBreakpoint
83
- }
84
+ this.matchingBreakpoints.set(breakpoint, mediaQuery.matches)
84
85
 
85
86
  mediaQuery.addEventListener('change', event => {
86
- if (!event.matches) {
87
- const [currentBreakpoint] = Array.from(breakpointsMap).find(([,mq]) => mq.matches) ?? []
88
-
89
- if (currentBreakpoint) {
90
- this.breakpoint = currentBreakpoint as AppBreakpoint
91
- UnistylesListener.emitChange(UnistyleDependency.Breakpoints)
92
- }
93
-
94
- return
95
- }
96
-
97
- this.breakpoint = breakpoint as AppBreakpoint
87
+ this.matchingBreakpoints.set(breakpoint, event.matches)
98
88
  UnistylesListener.emitChange(UnistyleDependency.Breakpoints)
99
89
  })
100
90
  })
@@ -1,6 +1,3 @@
1
- import { ColorScheme, type AppThemeName} from '../specs/types'
2
- import type { StyleSheet, StyleSheetWithSuperPowers, UnistylesValues } from '../types/stylesheet'
3
-
4
1
  export const reduceObject = <TObj extends Record<string, any>, TReducer>(
5
2
  obj: TObj,
6
3
  reducer: (value: TObj[keyof TObj], key: keyof TObj) => TReducer,
@@ -8,24 +5,6 @@ export const reduceObject = <TObj extends Record<string, any>, TReducer>(
8
5
 
9
6
  export const keyInObject = <T extends Record<string, any>>(obj: T, key: PropertyKey): key is keyof T => key in obj
10
7
 
11
- export const schemeToTheme = (scheme: ColorScheme): AppThemeName => {
12
- switch (scheme) {
13
- case ColorScheme.Dark:
14
- return 'dark'
15
- case ColorScheme.Light:
16
- default:
17
- return 'light'
18
- }
19
- }
20
-
21
- export const hexToRGBA = (hex: string, opacity: number) => hex
22
- .replace('#', '')
23
- .split(/(?=(?:..)*$)/)
24
- .map(x => parseInt(x, 16))
25
- .filter(num => !isNaN(num))
26
- .reduce((acc, color) => `${acc}${color},`, 'rgba(')
27
- .concat(`${opacity})`)
28
-
29
8
  export const isServer = () => typeof window === 'undefined'
30
9
 
31
10
  /**
@@ -79,43 +58,14 @@ export const equal = <T>(a: T, b: T) => {
79
58
  return keysA.every(key => Object.is(a[key], b[key]) && Object.prototype.hasOwnProperty.call(b, key))
80
59
  }
81
60
 
82
- type UnistyleSecrets = {
83
- __uni__stylesheet: StyleSheetWithSuperPowers<StyleSheet>,
84
- __uni__key: string,
85
- __uni__refs: Set<HTMLElement>
86
- __uni__variants: Record<string, any>
87
- __uni__args?: Array<any>
88
- }
61
+ export const generateHash = (value: any) => {
62
+ const str = JSON.stringify(value)
63
+ let hasher = 5381
64
+ let length = str.length
89
65
 
90
- export const assignSecrets = <T>(object: T, secrets: UnistyleSecrets) => {
91
- // @ts-expect-error - assign secrets to object
92
- object[`__uni__secrets__${Math.random().toString(16).slice(2)}`] = secrets
66
+ while (length--) hasher = (hasher * 33) ^ str.charCodeAt(length)
93
67
 
94
- return object
95
- }
96
-
97
- export const extractSecrets = (object: any) => {
98
- const secrets = Object.entries(object).reduce((acc, [key, value]) => {
99
- if (key.startsWith('__uni__secrets__')) {
100
- acc.push(value as UnistyleSecrets)
101
- }
102
-
103
- return acc
104
- }, [] as Array<UnistyleSecrets>)
105
-
106
- return secrets
107
- }
108
-
109
- export const getStyles = (values: UnistylesValues) => {
110
- const returnValue = {}
111
-
112
- Object.defineProperties(returnValue, reduceObject(values, value => ({
113
- value,
114
- enumerable: false,
115
- configurable: true
116
- })))
117
-
118
- return returnValue
68
+ return `unistyles-${(hasher >>> 0).toString(36)}`
119
69
  }
120
70
 
121
71
  export const createDoubleMap = <TKey, TSecondKey, TValue>() => {
@@ -155,15 +105,3 @@ export const createDoubleMap = <TKey, TSecondKey, TValue>() => {
155
105
  }
156
106
  }
157
107
  }
158
-
159
- export const extractHiddenProperties = (object: any) => {
160
- const hiddenProperties = Object.getOwnPropertyNames(object)
161
-
162
- return Object.fromEntries(
163
- hiddenProperties
164
- .filter(key => !key.startsWith('__uni__'))
165
- .map(key => [key, object[key]])
166
- )
167
- }
168
-
169
- export const isInDocument = (element: HTMLElement) => document.body.contains(element)
@@ -0,0 +1,2 @@
1
+ export * from './common'
2
+ export * from './unistyle'
@@ -0,0 +1,104 @@
1
+ import type { UnistyleDependency } from '../../specs/NativePlatform'
2
+ import { ColorScheme, Orientation, type AppThemeName } from '../../specs/types'
3
+ import type { StyleSheet, StyleSheetWithSuperPowers, UnistylesValues } from '../../types/stylesheet'
4
+ import { isUnistylesMq, parseMq } from '../mq'
5
+ import { UnistylesState } from '../state'
6
+ import { keyInObject, reduceObject } from './common'
7
+
8
+ export const schemeToTheme = (scheme: ColorScheme): AppThemeName => {
9
+ switch (scheme) {
10
+ case ColorScheme.Dark:
11
+ return 'dark'
12
+ case ColorScheme.Light:
13
+ default:
14
+ return 'light'
15
+ }
16
+ }
17
+
18
+ export const hexToRGBA = (hex: string, opacity: number) => hex
19
+ .replace('#', '')
20
+ .split(/(?=(?:..)*$)/)
21
+ .map(x => parseInt(x, 16))
22
+ .filter(num => !isNaN(num))
23
+ .reduce((acc, color) => `${acc}${color},`, 'rgba(')
24
+ .concat(`${opacity})`)
25
+
26
+ export type UnistyleSecrets = {
27
+ __uni__stylesheet: StyleSheetWithSuperPowers<StyleSheet>,
28
+ __uni__key: string,
29
+ __uni__refs: Set<HTMLElement>
30
+ __uni__variants: Record<string, any>
31
+ __uni__args?: Array<any>
32
+ }
33
+
34
+ export const assignSecrets = <T>(object: T, secrets: UnistyleSecrets) => {
35
+ // @ts-expect-error - assign secrets to object
36
+ object[`__uni__secrets__${Math.random().toString(16).slice(2)}`] = secrets
37
+
38
+ return object
39
+ }
40
+
41
+ export const extractSecrets = (object: any) => {
42
+ const secrets = Object.entries(object).reduce((acc, [key, value]) => {
43
+ if (key.startsWith('__uni__secrets__')) {
44
+ acc.push(value as UnistyleSecrets)
45
+ }
46
+
47
+ return acc
48
+ }, [] as Array<UnistyleSecrets>)
49
+
50
+ return secrets
51
+ }
52
+
53
+ export const getStyles = (values: UnistylesValues) => {
54
+ const returnValue = {}
55
+
56
+ Object.defineProperties(returnValue, reduceObject(values, value => ({
57
+ value,
58
+ enumerable: false,
59
+ configurable: true
60
+ })))
61
+
62
+ return returnValue
63
+ }
64
+
65
+ export const isInDocument = (element: HTMLElement) => document.body.contains(element)
66
+
67
+ export const extractMediaQueryValue = (query: string) => {
68
+ const [_, px] = query.match(/(\d+)px/) ?? []
69
+
70
+ if (!px) {
71
+ return undefined
72
+ }
73
+
74
+ const value = Number(px)
75
+
76
+ return isNaN(value) ? undefined : value
77
+ }
78
+
79
+ export const getMediaQuery = (query: string) => {
80
+ if (Object.values(Orientation).includes(query as Orientation)) {
81
+ return `(orientation: ${query})`
82
+ }
83
+
84
+ if (isUnistylesMq(query)) {
85
+ const { minWidth, maxWidth, minHeight, maxHeight } = parseMq(query)
86
+
87
+ return [
88
+ minWidth ? `(min-width: ${minWidth}px)` : undefined,
89
+ maxWidth ? `(max-width: ${maxWidth}px)` : undefined,
90
+ minHeight ? `(min-height: ${minHeight}px)` : undefined,
91
+ maxHeight ? `(max-height: ${maxHeight}px)` : undefined
92
+ ].filter(Boolean).join(' and ')
93
+ }
94
+
95
+ const minWidth = UnistylesState.breakpoints && keyInObject(UnistylesState.breakpoints, query) ? UnistylesState.breakpoints[query] : undefined
96
+
97
+ return `(min-width: ${minWidth ?? 0}px)`
98
+ }
99
+
100
+ export const extractUnistyleDependencies = (value: any) => {
101
+ const dependencies: Array<UnistyleDependency> = keyInObject(value, 'uni__dependencies') ? value.uni__dependencies : []
102
+
103
+ return dependencies
104
+ }
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.convertBreakpoint = void 0;
7
- var _state = require("../state");
8
- var _utils = require("../utils");
9
- var _mq = require("../mq");
10
- var _types = require("../../specs/types");
11
- const convertBreakpoint = breakpoint => {
12
- if (Object.values(_types.Orientation).includes(breakpoint)) {
13
- return {
14
- orientation: breakpoint
15
- };
16
- }
17
- if ((0, _mq.isUnistylesMq)(breakpoint)) {
18
- return (0, _mq.parseMq)(breakpoint);
19
- }
20
- return {
21
- minWidth: _state.UnistylesState.breakpoints && (0, _utils.keyInObject)(_state.UnistylesState.breakpoints, breakpoint) ? _state.UnistylesState.breakpoints[breakpoint] : undefined
22
- };
23
- };
24
- exports.convertBreakpoint = convertBreakpoint;
25
- //# sourceMappingURL=breakpoint.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_state","require","_utils","_mq","_types","convertBreakpoint","breakpoint","Object","values","Orientation","includes","orientation","isUnistylesMq","parseMq","minWidth","UnistylesState","breakpoints","keyInObject","undefined","exports"],"sourceRoot":"../../../../src","sources":["web/convert/breakpoint.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,GAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEO,MAAMI,iBAAiB,GAAIC,UAAkB,IAAiB;EACjE,IAAIC,MAAM,CAACC,MAAM,CAACC,kBAAW,CAAC,CAACC,QAAQ,CAACJ,UAAyB,CAAC,EAAE;IAChE,OAAO;MACHK,WAAW,EAAEL;IACjB,CAAC;EACL;EAEA,IAAI,IAAAM,iBAAa,EAACN,UAAU,CAAC,EAAE;IAC3B,OAAO,IAAAO,WAAO,EAACP,UAAU,CAAC;EAC9B;EAEA,OAAO;IACHQ,QAAQ,EAAEC,qBAAc,CAACC,WAAW,IAAI,IAAAC,kBAAW,EAACF,qBAAc,CAACC,WAAW,EAAEV,UAAU,CAAC,GAAGS,qBAAc,CAACC,WAAW,CAACV,UAAU,CAAC,GAAGY;EAC3I,CAAC;AACL,CAAC;AAAAC,OAAA,CAAAd,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -1,61 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createUnistylesComponent = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _utils = require("./utils");
9
- var _variants = require("./variants");
10
- var _listener = require("./listener");
11
- var _registry = require("./registry");
12
- var _jsxRuntime = require("react/jsx-runtime");
13
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
- const getStyles = value => {
16
- const secrets = (0, _utils.extractSecrets)(value);
17
- if (secrets.length === 0) {
18
- return undefined;
19
- }
20
- return secrets.reduce((acc, {
21
- __uni__stylesheet,
22
- __uni__key,
23
- __uni__args = [],
24
- __uni__variants
25
- }) => {
26
- const newComputedStylesheet = _registry.UnistylesRegistry.getComputedStylesheet(__uni__stylesheet);
27
- const style = newComputedStylesheet[__uni__key];
28
- const resultHidden = typeof style === 'function' ? style(...__uni__args) : style;
29
- const result = (0, _utils.extractHiddenProperties)(resultHidden);
30
- const {
31
- variants
32
- } = Object.fromEntries((0, _variants.getVariants)({
33
- variants: result
34
- }, __uni__variants));
35
- const resultWithVariants = {
36
- ...result,
37
- ...variants
38
- };
39
- return {
40
- ...acc,
41
- ...resultWithVariants
42
- };
43
- }, {});
44
- };
45
- const createUnistylesComponent = Component => props => {
46
- const passedStyles = props.style ?? {};
47
- const [style, setStyle] = (0, _react.useState)(getStyles(passedStyles));
48
- (0, _react.useEffect)(() => {
49
- const newStyles = getStyles(passedStyles);
50
- const dependencies = newStyles?.['uni__dependencies'] ?? [];
51
- const dispose = _listener.UnistylesListener.addListeners(dependencies, () => setStyle(getStyles(passedStyles)));
52
- setStyle(newStyles);
53
- return dispose;
54
- }, [passedStyles]);
55
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
56
- ...props,
57
- style: style
58
- });
59
- };
60
- exports.createUnistylesComponent = createUnistylesComponent;
61
- //# sourceMappingURL=createUnistylesComponent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_utils","_variants","_listener","_registry","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","getStyles","value","secrets","extractSecrets","length","undefined","reduce","acc","__uni__stylesheet","__uni__key","__uni__args","__uni__variants","newComputedStylesheet","UnistylesRegistry","getComputedStylesheet","style","resultHidden","result","extractHiddenProperties","variants","fromEntries","getVariants","resultWithVariants","createUnistylesComponent","Component","props","passedStyles","setStyle","useState","useEffect","newStyles","dependencies","dispose","UnistylesListener","addListeners","jsx","exports"],"sourceRoot":"../../../src","sources":["web/createUnistylesComponent.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAA8C,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,m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AAQ,CAACG,SAAS,CAAC;IAEnB,OAAOE,OAAO;EAClB,CAAC,EAAE,CAACN,YAAY,CAAC,CAAC;EAElB,oBACI,IAAA/C,WAAA,CAAAwD,GAAA,EAACX,SAAS;IAAA,GACFC,KAAK;IACTV,KAAK,EAAEA;EAAM,CAChB,CAAC;AAEV,CAAC;AAAAqB,OAAA,CAAAb,wBAAA,GAAAA,wBAAA","ignoreList":[]}
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "UnistylesListener", {
7
- enumerable: true,
8
- get: function () {
9
- return _listener.UnistylesListener;
10
- }
11
- });
12
- Object.defineProperty(exports, "listenToDependencies", {
13
- enumerable: true,
14
- get: function () {
15
- return _listenToDependencies.listenToDependencies;
16
- }
17
- });
18
- var _listener = require("./listener");
19
- var _listenToDependencies = require("./listenToDependencies");
20
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_listener","require","_listenToDependencies"],"sourceRoot":"../../../../src","sources":["web/listener/index.ts"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA","ignoreList":[]}
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.listenToDependencies = void 0;
7
- var _listener = require("./listener");
8
- var _utils = require("../utils");
9
- var _registry = require("../registry");
10
- const listenToDependencies = ({
11
- key,
12
- className,
13
- unistyles,
14
- args = [],
15
- stylesheet
16
- }) => {
17
- const newComputedStylesheet = _registry.UnistylesRegistry.getComputedStylesheet(stylesheet);
18
- const _value = (0, _utils.keyInObject)(newComputedStylesheet, key) ? newComputedStylesheet[key] : undefined;
19
- if (!_value) {
20
- return;
21
- }
22
- const value = typeof _value === 'function' ? _value(...args) : _value;
23
- const dependencies = 'uni__dependencies' in value ? value['uni__dependencies'] : [];
24
- if (dependencies.length === 0) {
25
- return;
26
- }
27
- return _listener.UnistylesListener.addListeners(dependencies, () => {
28
- const newComputedStylesheet = _registry.UnistylesRegistry.getComputedStylesheet(stylesheet);
29
- if (!(0, _utils.keyInObject)(newComputedStylesheet, key)) {
30
- return;
31
- }
32
- const value = newComputedStylesheet[key];
33
- const result = typeof value === 'function' ? value(...args) : value;
34
- _registry.UnistylesRegistry.updateStyles(unistyles, result, className);
35
- });
36
- };
37
- exports.listenToDependencies = listenToDependencies;
38
- //# sourceMappingURL=listenToDependencies.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_listener","require","_utils","_registry","listenToDependencies","key","className","unistyles","args","stylesheet","newComputedStylesheet","UnistylesRegistry","getComputedStylesheet","_value","keyInObject","undefined","value","dependencies","length","UnistylesListener","addListeners","result","updateStyles","exports"],"sourceRoot":"../../../../src","sources":["web/listener/listenToDependencies.ts"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAUO,MAAMG,oBAAoB,GAAGA,CAAC;EAAEC,GAAG;EAAEC,SAAS;EAAEC,SAAS;EAAEC,IAAI,GAAG,EAAE;EAAEC;AAAsC,CAAC,KAAK;EACrH,MAAMC,qBAAqB,GAAGC,2BAAiB,CAACC,qBAAqB,CAACH,UAAU,CAAC;EACjF,MAAMI,MAAM,GAAG,IAAAC,kBAAW,EAACJ,qBAAqB,EAAEL,GAAG,CAAC,GAAGK,qBAAqB,CAACL,GAAG,CAAC,GAAGU,SAAS;EAE/F,IAAI,CAACF,MAAM,EAAE;IACT;EACJ;EAEA,MAAMG,KAAK,GAAG,OAAOH,MAAM,KAAK,UAAU,GAAGA,MAAM,CAAC,GAAGL,IAAI,CAAC,GAAGK,MAAM;EACrE,MAAMI,YAAY,GAAI,mBAAmB,IAAID,KAAK,GAAGA,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAgC;EAElH,IAAIC,YAAY,CAACC,MAAM,KAAK,CAAC,EAAE;IAC3B;EACJ;EAEA,OAAOC,2BAAiB,CAACC,YAAY,CAACH,YAAY,EAAE,MAAM;IACtD,MAAMP,qBAAqB,GAAGC,2BAAiB,CAACC,qBAAqB,CAACH,UAAU,CAAC;IAEjF,IAAI,CAAC,IAAAK,kBAAW,EAACJ,qBAAqB,EAAEL,GAAG,CAAC,EAAE;MAC1C;IACJ;IAEA,MAAMW,KAAK,GAAGN,qBAAqB,CAACL,GAAG,CAAE;IACzC,MAAMgB,MAAM,GAAG,OAAOL,KAAK,KAAK,UAAU,GACpCA,KAAK,CAAC,GAAGR,IAAI,CAAC,GACdQ,KAAK;IAEXL,2BAAiB,CAACW,YAAY,CAACf,SAAS,EAAEc,MAAM,EAAEf,SAAS,CAAC;EAChE,CAAC,CAAC;AACN,CAAC;AAAAiB,OAAA,CAAAnB,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["_NativePlatform","require","_runtime","UnistylesListenerBuilder","isInitialized","listeners","Array","from","length","Object","keys","UnistyleDependency","Set","emitChange","dependency","forEach","listener","initListeners","UnistylesRuntime","darkMedia","addEventListener","ColorScheme","lightMedia","window","Orientation","Dimensions","addListeners","dependencies","add","delete","UnistylesListener","exports"],"sourceRoot":"../../../../src","sources":["web/listener/listener.ts"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,MAAME,wBAAwB,CAAC;EACnBC,aAAa,GAAG,KAAK;EACrBC,SAAS,GAAGC,KAAK,CAACC,IAAI,CAAC;IAAEC,MAAM,EAAEC,MAAM,CAACC,IAAI,CAACC,kCAAkB,CAAC,CAACH,MAAM,GAAG;EAAE,CAAC,EAAE,MAAM,IAAII,GAAG,CAAe,CAAC,CAAC;EAErHC,UAAU,GAAIC,UAA8B,IAAK;IAC7C,IAAI,CAACT,SAAS,CAACS,UAAU,CAAC,EAAEC,OAAO,CAACC,QAAQ,IAAIA,QAAQ,CAAC,CAAC,CAAC;EAC/D,CAAC;EAEDC,aAAa,GAAGA,CAAA,KAAM;IAClB,IAAI,IAAI,CAACb,aAAa,EAAE;MACpB;IACJ;IAEA,IAAI,CAACA,aAAa,GAAG,IAAI;IACzBc,yBAAgB,CAACC,SAAS,EAAEC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,CAACP,UAAU,CAACF,kCAAkB,CAACU,WAAW,CAAC,CAAC;IAC7GH,yBAAgB,CAACI,UAAU,EAAEF,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,CAACP,UAAU,CAACF,kCAAkB,CAACU,WAAW,CAAC,CAAC;IAC9GE,MAAM,CAACH,gBAAgB,CAAC,mBAAmB,EAAE,MAAM,IAAI,CAACP,UAAU,CAACF,kCAAkB,CAACa,WAAW,CAAC,CAAC;IACnGD,MAAM,CAACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,CAACP,UAAU,CAACF,kCAAkB,CAACc,UAAU,CAAC,CAAC;EAC3F,CAAC;EAEDC,YAAY,GAAGA,CAACC,YAAuC,EAAEX,QAAsB,KAAK;IAChFW,YAAY,CAACZ,OAAO,CAACD,UAAU,IAAI,IAAI,CAACT,SAAS,CAACS,UAAU,CAAC,EAAEc,GAAG,CAACZ,QAAQ,CAAC,CAAC;IAE7E,OAAO,MAAM;MACTW,YAAY,CAACZ,OAAO,CAACD,UAAU,IAAI,IAAI,CAACT,SAAS,CAACS,UAAU,CAAC,EAAEe,MAAM,CAACb,QAAQ,CAAC,CAAC;IACpF,CAAC;EACL,CAAC;AACL;AAEO,MAAMc,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAI3B,wBAAwB,CAAC,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["pseudos","exports","isPseudo","selector","some","pseudo","startsWith"],"sourceRoot":"../../../src","sources":["web/pseudo.ts"],"mappings":";;;;;;AAAO,M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rC,8BAA8B,EAC9B,8BAA8B,EAC9B,iCAAiC,EACjC,uBAAuB,EACvB,iCAAiC,EACjC,yBAAyB,EACzB,oBAAoB,EACpB,+BAA+B,EAC/B,gCAAgC,EAChC,gCAAgC,EAChC,uBAAuB,EACvB,QAAQ,EACR,WAAW,EACX,SAAS,EACT,MAAM,EACN,uBAAuB,EACvB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,6BAA6B,EAC7B,sBAAsB,EACtB,sBAAsB,CAChB;AAEH,MAAME,QAAQ,GAAIC,QAAgB,IAAKH,OAAO,CAACI,IAAI,CAACC,MAAM,IAAIF,QAAQ,CAACG,UAAU,CAACD,MAAM,CAAC,CAAC;AAAAJ,OAAA,CAAAC,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["_types","require","reduceObject","obj","reducer","Object","fromEntries","entries","map","key","value","exports","keyInObject","schemeToTheme","scheme","ColorScheme","Dark","Light","hexToRGBA","hex","opacity","replace","split","x","parseInt","filter","num","isNaN","reduce","acc","color","concat","isServer","window","deepMergeObjects","sources","target","forEach","source","keys","sourceValue","targetValue","warn","message","console","equal","a","b","is","keysA","length","every","prototype","hasOwnProperty","call","assignSecrets","object","secrets","Math","random","toString","slice","extractSecrets","startsWith","push","getStyles","values","returnValue","defineProperties","enumerable","configurable","createDoubleMap","Map","get","secondKey","mapForKey","undefined","set","delete","callback","extractHiddenProperties","hiddenProperties","getOwnPropertyNames","isInDocument","element","document","body","contains"],"sourceRoot":"../../../src","sources":["web/utils.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGO,MAAMC,YAAY,GAAGA,CACxBC,GAAS,EACTC,OAA+D,KAC9DC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,C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CAAC;IACN;EACJ,CAAC;AACL,CAAC;AAAAC,OAAA,CAAA4D,eAAA,GAAAA,eAAA;AAEM,MAAMS,uBAAuB,GAAIxB,MAAW,IAAK;EACpD,MAAMyB,gBAAgB,GAAG5E,MAAM,CAAC6E,mBAAmB,CAAC1B,MAAM,CAAC;EAE3D,OAAOnD,MAAM,CAACC,WAAW,CACrB2E,gBAAgB,CACXxD,MAAM,CAAChB,GAAG,IAAI,CAACA,GAAG,CAACsD,UAAU,CAAC,SAAS,CAAC,CAAC,CACzCvD,GAAG,CAACC,GAAG,IAAI,CAACA,GAAG,EAAE+C,MAAM,CAAC/C,GAAG,CAAC,CAAC,CACtC,CAAC;AACL,CAAC;AAAAE,OAAA,CAAAqE,uBAAA,GAAAA,uBAAA;AAEM,MAAMG,YAAY,GAAIC,OAAoB,IAAKC,QAAQ,CAACC,IAAI,CAACC,QAAQ,CAACH,OAAO,CAAC;AAAAzE,OAAA,CAAAwE,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- import { UnistylesState } from '../state';
4
- import { keyInObject } from '../utils';
5
- import { isUnistylesMq, parseMq } from '../mq';
6
- import { Orientation } from '../../specs/types';
7
- export const convertBreakpoint = breakpoint => {
8
- if (Object.values(Orientation).includes(breakpoint)) {
9
- return {
10
- orientation: breakpoint
11
- };
12
- }
13
- if (isUnistylesMq(breakpoint)) {
14
- return parseMq(breakpoint);
15
- }
16
- return {
17
- minWidth: UnistylesState.breakpoints && keyInObject(UnistylesState.breakpoints, breakpoint) ? UnistylesState.breakpoints[breakpoint] : undefined
18
- };
19
- };
20
- //# sourceMappingURL=breakpoint.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["UnistylesState","keyInObject","isUnistylesMq","parseMq","Orientation","convertBreakpoint","breakpoint","Object","values","includes","orientation","minWidth","breakpoints","undefined"],"sourceRoot":"../../../../src","sources":["web/convert/breakpoint.ts"],"mappings":";;AACA,SAASA,cAAc,QAAQ,UAAU;AACzC,SAASC,WAAW,QAAQ,UAAU;AACtC,SAASC,aAAa,EAAEC,OAAO,QAAQ,OAAO;AAC9C,SAASC,WAAW,QAAQ,mBAAmB;AAE/C,OAAO,MAAMC,iBAAiB,GAAIC,UAAkB,IAAiB;EACjE,IAAIC,MAAM,CAACC,MAAM,CAACJ,WAAW,CAAC,CAACK,QAAQ,CAACH,UAAyB,CAAC,EAAE;IAChE,OAAO;MACHI,WAAW,EAAEJ;IACjB,CAAC;EACL;EAEA,IAAIJ,aAAa,CAACI,UAAU,CAAC,EAAE;IAC3B,OAAOH,OAAO,CAACG,UAAU,CAAC;EAC9B;EAEA,OAAO;IACHK,QAAQ,EAAEX,cAAc,CAACY,WAAW,IAAIX,WAAW,CAACD,cAAc,CAACY,WAAW,EAAEN,UAAU,CAAC,GAAGN,cAAc,CAACY,WAAW,CAACN,UAAU,CAAC,GAAGO;EAC3I,CAAC;AACL,CAAC","ignoreList":[]}
@@ -1,54 +0,0 @@
1
- "use strict";
2
-
3
- import React, { useEffect, useState } from 'react';
4
- import { extractHiddenProperties, extractSecrets } from './utils';
5
- import { getVariants } from './variants';
6
- import { UnistylesListener } from './listener';
7
- import { UnistylesRegistry } from './registry';
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- const getStyles = value => {
10
- const secrets = extractSecrets(value);
11
- if (secrets.length === 0) {
12
- return undefined;
13
- }
14
- return secrets.reduce((acc, {
15
- __uni__stylesheet,
16
- __uni__key,
17
- __uni__args = [],
18
- __uni__variants
19
- }) => {
20
- const newComputedStylesheet = UnistylesRegistry.getComputedStylesheet(__uni__stylesheet);
21
- const style = newComputedStylesheet[__uni__key];
22
- const resultHidden = typeof style === 'function' ? style(...__uni__args) : style;
23
- const result = extractHiddenProperties(resultHidden);
24
- const {
25
- variants
26
- } = Object.fromEntries(getVariants({
27
- variants: result
28
- }, __uni__variants));
29
- const resultWithVariants = {
30
- ...result,
31
- ...variants
32
- };
33
- return {
34
- ...acc,
35
- ...resultWithVariants
36
- };
37
- }, {});
38
- };
39
- export const createUnistylesComponent = Component => props => {
40
- const passedStyles = props.style ?? {};
41
- const [style, setStyle] = useState(getStyles(passedStyles));
42
- useEffect(() => {
43
- const newStyles = getStyles(passedStyles);
44
- const dependencies = newStyles?.['uni__dependencies'] ?? [];
45
- const dispose = UnistylesListener.addListeners(dependencies, () => setStyle(getStyles(passedStyles)));
46
- setStyle(newStyles);
47
- return dispose;
48
- }, [passedStyles]);
49
- return /*#__PURE__*/_jsx(Component, {
50
- ...props,
51
- style: style
52
- });
53
- };
54
- //# sourceMappingURL=createUnistylesComponent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","useEffect","useState","extractHiddenProperties","extractSecrets","getVariants","UnistylesListener","UnistylesRegistry","jsx","_jsx","getStyles","value","secrets","length","undefined","reduce","acc","__uni__stylesheet","__uni__key","__uni__args","__uni__variants","newComputedStylesheet","getComputedStylesheet","style","resultHidden","result","variants","Object","fromEntries","resultWithVariants","createUnistylesComponent","Component","props","passedStyles","setStyle","newStyles","dependencies","dispose","addListeners"],"sourceRoot":"../../../src","sources":["web/createUnistylesComponent.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,uBAAuB,EAAEC,cAAc,QAAQ,SAAS;AACjE,SAASC,WAAW,QAAQ,YAAY;AACxC,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,iBAAiB,QAAQ,YAAY;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAE9C,MAAMC,SAAS,GAAIC,KAA0B,IAAK;EAC9C,MAAMC,OAAO,GAAGR,cAAc,CAACO,KAAK,CAAC;EAErC,IAAIC,OAAO,CAACC,MAAM,KAAK,CAAC,EAAE;IACtB,OAAOC,SAAS;EACpB;EAEA,OAAOF,OAAO,CAACG,MAAM,CAAC,CAACC,GAAG,EAAE;IAAEC,iBAAiB;IAAEC,UAAU;IAAEC,WAAW,GAAG,EAAE;IAAEC;E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SAAS;IAAA,GACFC,KAAK;IACTT,KAAK,EAAEA;EAAM,CAChB,CAAC;AAEV,CAAC","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- export { UnistylesListener } from './listener';
4
- export { listenToDependencies } from './listenToDependencies';
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["UnistylesListener","listenToDependencies"],"sourceRoot":"../../../../src","sources":["web/listener/index.ts"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,oBAAoB,QAAQ,wBAAwB","ignoreList":[]}
@@ -1,33 +0,0 @@
1
- "use strict";
2
-
3
- import { UnistylesListener } from './listener';
4
- import { keyInObject } from '../utils';
5
- import { UnistylesRegistry } from '../registry';
6
- export const listenToDependencies = ({
7
- key,
8
- className,
9
- unistyles,
10
- args = [],
11
- stylesheet
12
- }) => {
13
- const newComputedStylesheet = UnistylesRegistry.getComputedStylesheet(stylesheet);
14
- const _value = keyInObject(newComputedStylesheet, key) ? newComputedStylesheet[key] : undefined;
15
- if (!_value) {
16
- return;
17
- }
18
- const value = typeof _value === 'function' ? _value(...args) : _value;
19
- const dependencies = 'uni__dependencies' in value ? value['uni__dependencies'] : [];
20
- if (dependencies.length === 0) {
21
- return;
22
- }
23
- return UnistylesListener.addListeners(dependencies, () => {
24
- const newComputedStylesheet = UnistylesRegistry.getComputedStylesheet(stylesheet);
25
- if (!keyInObject(newComputedStylesheet, key)) {
26
- return;
27
- }
28
- const value = newComputedStylesheet[key];
29
- const result = typeof value === 'function' ? value(...args) : value;
30
- UnistylesRegistry.updateStyles(unistyles, result, className);
31
- });
32
- };
33
- //# sourceMappingURL=listenToDependencies.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["UnistylesListener","keyInObject","UnistylesRegistry","listenToDependencies","key","className","unistyles","args","stylesheet","newComputedStylesheet","getComputedStylesheet","_value","undefined","value","dependencies","length","addListeners","result","updateStyles"],"sourceRoot":"../../../../src","sources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@@ -1 +0,0 @@
1
- {"version":3,"names":["UnistyleDependency","UnistylesRuntime","UnistylesListenerBuilder","isInitialized","listeners","Array","from","length","Object","keys","Set","emitChange","dependency","forEach","listener","initListeners","darkMedia","addEventListener","ColorScheme","lightMedia","window","Orientation","Dimensions","addListeners","dependencies","add","delete","UnistylesListener"],"sourceRoot":"../../../../src","sources":["web/listener/listener.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,4BAA4B;AAC/D,SAASC,gBAAgB,QAAQ,YAAY;AAE7C,MAAMC,wBAAwB,CAAC;EACnBC,aAAa,GAAG,KAAK;EACrBC,SAAS,GAAGC,KAAK,CAACC,IAAI,CAAC;IAAEC,MAAM,EAAEC,MAAM,CAACC,IAAI,CAACT,kBAAkB,CAAC,CAACO,MAAM,GAAG;EAAE,CAAC,EAAE,MAAM,IAAIG,GAAG,CAAe,CAAC,CAAC;EAErHC,UAAU,GAAIC,UAA8B,IAAK;IAC7C,IAAI,CAACR,SAAS,CAACQ,UAAU,CAAC,EAAEC,OAAO,CAACC,QAAQ,IAAIA,QAAQ,CAAC,CAAC,CAAC;EAC/D,CAAC;EAEDC,aAAa,GAAGA,CAAA,KAAM;IAClB,IAAI,IAAI,CAACZ,aAAa,EAAE;MACpB;IACJ;IAEA,IAAI,CAACA,aAAa,GAAG,IAAI;IACzBF,gBAAgB,CAACe,SAAS,EAAEC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,CAACN,UAAU,CAACX,kBAAkB,CAACkB,WAAW,CAAC,CAAC;IAC7GjB,gBAAgB,CAACkB,UAAU,EAAEF,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,CAACN,UAAU,CAACX,kBAAkB,CAACkB,WAAW,CAAC,CAAC;IAC9GE,MAAM,CAACH,gBAAgB,CAAC,mBAAmB,EAAE,MAAM,IAAI,CAACN,UAAU,CAACX,kBAAkB,CAACqB,WAAW,CAAC,CAAC;IACnGD,MAAM,CAACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,CAACN,UAAU,CAACX,kBAAkB,CAACsB,UAAU,CAAC,CAAC;EAC3F,CAAC;EAEDC,YAAY,GAAGA,CAACC,YAAuC,EAAEV,QAAsB,KAAK;IAChFU,YAAY,CAACX,OAAO,CAACD,UAAU,IAAI,IAAI,CAACR,SAAS,CAACQ,UAAU,CAAC,EAAEa,GAAG,CAACX,QAAQ,CAAC,CAAC;IAE7E,OAAO,MAAM;MACTU,YAAY,CAACX,OAAO,CAACD,UAAU,IAAI,IAAI,CAACR,SAAS,CAACQ,UAAU,CAAC,EAAEc,MAAM,CAACZ,QAAQ,CAAC,CAAC;IACpF,CAAC;EACL,CAAC;AACL;AAEA,OAAO,MAAMa,iBAAiB,GAAG,IAAIzB,wBAAwB,CAAC,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["pseudos","isPseudo","selector","some","pseudo","startsWith"],"sourceRoot":"../../../src","sources":["web/pseudo.ts"],"mappings":";;AAAA,OAAO,MAAMA,OAAO,GAAG,CACnB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,SAAS,EACT,WAAW,EACX,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,OAAO,EACP,WAAW,EACX,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,SAAS,EACT,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,MAAM,EACN,QAAQ,EACR,aAAa,EACb,eAAe,EACf,OAAO,EACP,OAAO,EACP,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,eAAe,EACf,WAAW,EACX,eAAe,EACf,OAAO,EACP,SAAS,EACT,qBAAqB,EACrB,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,aAAa,EACb,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,4BAA4B,EAC5B,8BAA8B,EAC9B,qCAAqC,EACrC,8BAA8B,EAC9B,8BAA8B,EAC9B,iCAAiC,EACjC,uBAAuB,EACvB,iCAAiC,EACjC,yBAAyB,EACzB,oBAAoB,EACpB,+BAA+B,EAC/B,gCAAgC,EAChC,gCAAgC,EAChC,uBAAuB,EACvB,QAAQ,EACR,WAAW,EACX,SAAS,EACT,MAAM,EACN,uBAAuB,EACvB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,6BAA6B,EAC7B,sBAAsB,EACtB,sBAAsB,CAChB;AAEV,OAAO,MAAMC,QAAQ,GAAIC,QAAgB,IAAKF,OAAO,CAACG,IAAI,CAACC,MAAM,IAAIF,QAAQ,CAACG,UAAU,CAACD,MAAM,CAAC,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["ColorScheme","reduceObject","obj","reducer","Object","fromEntries","entries","map","key","value","keyInObject","schemeToTheme","scheme","Dark","Light","hexToRGBA","hex","opacity","replace","split","x","parseInt","filter","num","isNaN","reduce","acc","color","concat","isServer","window","deepMergeObjects","sources","target","forEach","source","keys","sourceValue","targetValue","warn","message","console","equal","a","b","is","keysA","length","every","prototype","hasOwnProperty","call","assignSecrets","object","secrets","Math","random","toString","slice","extractSecrets","startsWith","push","getStyles","values","returnValue","defineProperties","enumerable","configurable","createDoubleMap","Map","get","secondKey","mapForKey","undefined","set","delete","callback","extractHiddenProperties","hiddenProperties","getOwnPropertyNames","isInDocument","element","document","body","contains"],"sourceRoot":"../../../src","sources":["web/utils.ts"],"mappings":";;AAAA,SAASA,WAAW,QAA0B,gBAAgB;AAG9D,OAAO,MAAMC,YAAY,GAAGA,CACxBC,GAAS,EACTC,OAA+D,KAC9DC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACJ,GAAG,CAAC,CAACK,GAAG,CAAC,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK,CAACD,GAAG,EAAEL,OAAO,CAACM,KAAK,EAAsBD,GAAG,CAAC,CAAC,CAAC,CAAoC;AAErJ,OAAO,MAAME,WAAW,GAAGA,CAAgCR,GAAM,EAAEM,GAAgB,KAAqBA,GAAG,IAAIN,GAAG;AAElH,OAAO,MAAMS,aAAa,GAAIC,MAAmB,IAAmB;EAChE,QAAQA,MAAM;IACV,KAAKZ,WAAW,CAACa,IAAI;MACjB,OAAO,MAAM;IACjB,KAAKb,WAAW,CAACc,KAAK;IACtB;MACI,OAAO,OAAO;EACtB;AACJ,CAAC;AAED,OAAO,MAAMC,SAAS,GAAGA,CAACC,GAAW,EAAEC,OAAe,KAAKD,GAAG,CACzDE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAChBC,KAAK,CAAC,cAAc,CAAC,CACrBZ,GAAG,CAACa,CAAC,IAAIC,QAAQ,CAACD,CAAC,EAAE,EAAE,CAAC,CAAC,CACzBE,MAAM,CAACC,GAAG,IAA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