react-native-unistyles 2.8.0-beta.5 → 2.8.0-rc.1
Sign up to get free protection for your applications and to get access to all the features.
- package/android/src/main/cxx/cpp-adapter.cpp +1 -1
- package/android/src/main/cxx/helpers.cpp +61 -0
- package/android/src/main/cxx/helpers.h +5 -0
- package/android/src/main/cxx/platform.cpp +51 -41
- package/android/src/main/cxx/platform.h +7 -4
- package/android/src/main/java/com/unistyles/Models.kt +13 -50
- package/android/src/main/java/com/unistyles/Platform.kt +175 -40
- package/android/src/main/java/com/unistyles/UnistylesModule.kt +17 -93
- package/cxx/UnistylesImpl.cpp +57 -2
- package/cxx/UnistylesModel.cpp +6 -2
- package/cxx/UnistylesModel.h +34 -8
- package/cxx/UnistylesRuntime.h +9 -1
- package/ios/platform/Platform_Shared.h +2 -0
- package/ios/platform/Platform_Shared.mm +84 -1
- package/ios/platform/Platform_iOS.h +2 -0
- package/ios/platform/Platform_iOS.mm +57 -14
- package/lib/commonjs/core/UnistylesModule.js +17 -2
- package/lib/commonjs/core/UnistylesModule.js.map +1 -1
- package/lib/commonjs/core/UnistylesRuntime.js +65 -4
- package/lib/commonjs/core/UnistylesRuntime.js.map +1 -1
- package/lib/commonjs/core/mocks/UnistylesMockedBridge.js +4 -0
- package/lib/commonjs/core/mocks/UnistylesMockedBridge.js.map +1 -1
- package/lib/commonjs/core/mocks/UnistylesMockedRuntime.js +12 -2
- package/lib/commonjs/core/mocks/UnistylesMockedRuntime.js.map +1 -1
- package/lib/commonjs/types/color.js +2 -0
- package/lib/commonjs/types/color.js.map +1 -0
- package/lib/commonjs/types/index.js +11 -0
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/commonjs/useStyles.js +1 -1
- package/lib/commonjs/useStyles.js.map +1 -1
- package/lib/commonjs/utils/index.js +7 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/parseColor.js +30 -0
- package/lib/commonjs/utils/parseColor.js.map +1 -0
- package/lib/module/core/UnistylesModule.js +17 -2
- package/lib/module/core/UnistylesModule.js.map +1 -1
- package/lib/module/core/UnistylesRuntime.js +66 -4
- package/lib/module/core/UnistylesRuntime.js.map +1 -1
- package/lib/module/core/index.js +2 -1
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/core/mocks/UnistylesMockedBridge.js +4 -0
- package/lib/module/core/mocks/UnistylesMockedBridge.js.map +1 -1
- package/lib/module/core/mocks/UnistylesMockedRuntime.js +12 -2
- package/lib/module/core/mocks/UnistylesMockedRuntime.js.map +1 -1
- package/lib/module/types/color.js +2 -0
- package/lib/module/types/color.js.map +1 -0
- package/lib/module/types/index.js +1 -0
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/useStyles.js +1 -1
- package/lib/module/useStyles.js.map +1 -1
- package/lib/module/utils/index.js +1 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/parseColor.js +23 -0
- package/lib/module/utils/parseColor.js.map +1 -0
- package/lib/typescript/src/core/UnistylesModule.d.ts +1 -0
- package/lib/typescript/src/core/UnistylesModule.d.ts.map +1 -1
- package/lib/typescript/src/core/UnistylesRuntime.d.ts +52 -5
- package/lib/typescript/src/core/UnistylesRuntime.d.ts.map +1 -1
- package/lib/typescript/src/core/index.d.ts +3 -1
- package/lib/typescript/src/core/index.d.ts.map +1 -1
- package/lib/typescript/src/core/mocks/UnistylesMockedBridge.d.ts +4 -0
- package/lib/typescript/src/core/mocks/UnistylesMockedBridge.d.ts.map +1 -1
- package/lib/typescript/src/core/mocks/UnistylesMockedRuntime.d.ts +7 -1
- package/lib/typescript/src/core/mocks/UnistylesMockedRuntime.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/breakpoints.d.ts +2 -2
- package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
- package/lib/typescript/src/types/color.d.ts +4 -0
- package/lib/typescript/src/types/color.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +1 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/types/stylesheet.d.ts +2 -2
- package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
- package/lib/typescript/src/types/unistyles.d.ts +8 -2
- package/lib/typescript/src/types/unistyles.d.ts.map +1 -1
- package/lib/typescript/src/utils/index.d.ts +1 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/parseColor.d.ts +3 -0
- package/lib/typescript/src/utils/parseColor.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/core/UnistylesModule.ts +19 -3
- package/src/core/UnistylesRuntime.ts +67 -5
- package/src/core/index.ts +7 -1
- package/src/core/mocks/UnistylesMockedBridge.ts +4 -0
- package/src/core/mocks/UnistylesMockedRuntime.ts +15 -3
- package/src/index.ts +3 -2
- package/src/types/breakpoints.ts +2 -2
- package/src/types/color.ts +26 -0
- package/src/types/index.ts +1 -0
- package/src/types/stylesheet.ts +2 -2
- package/src/types/unistyles.ts +10 -4
- package/src/useStyles.ts +1 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/parseColor.ts +27 -0
@@ -1,4 +1,6 @@
|
|
1
1
|
import { ScreenOrientation, UnistylesError } from '../common';
|
2
|
+
import { parseColor } from '../utils';
|
3
|
+
|
2
4
|
/**
|
3
5
|
* Utility to interact with the Unistyles during runtime
|
4
6
|
*/
|
@@ -8,6 +10,30 @@ export class UnistylesRuntime {
|
|
8
10
|
this.unistylesRegistry = unistylesRegistry;
|
9
11
|
}
|
10
12
|
|
13
|
+
/**
|
14
|
+
* Get the mini runtime injected to creteStyleSheet
|
15
|
+
* @returns - The mini runtime
|
16
|
+
*/
|
17
|
+
get miniRuntime() {
|
18
|
+
return {
|
19
|
+
contentSizeCategory: this.contentSizeCategory,
|
20
|
+
breakpoint: this.breakpoint,
|
21
|
+
screen: this.screen,
|
22
|
+
insets: this.insets,
|
23
|
+
statusBar: {
|
24
|
+
width: this.statusBar.width,
|
25
|
+
height: this.statusBar.height
|
26
|
+
},
|
27
|
+
navigationBar: {
|
28
|
+
width: this.navigationBar.width,
|
29
|
+
height: this.navigationBar.height
|
30
|
+
},
|
31
|
+
orientation: this.orientation,
|
32
|
+
pixelRatio: this.pixelRatio,
|
33
|
+
fontScale: this.fontScale
|
34
|
+
};
|
35
|
+
}
|
36
|
+
|
11
37
|
/**
|
12
38
|
* Get the current color scheme
|
13
39
|
* @returns - The current color scheme
|
@@ -85,25 +111,27 @@ export class UnistylesRuntime {
|
|
85
111
|
|
86
112
|
/**
|
87
113
|
* Get the status bar info
|
88
|
-
* @returns - The status bar api { width, height, setColor }
|
114
|
+
* @returns - The status bar api { width, height, setColor, setHidden }
|
89
115
|
*/
|
90
116
|
get statusBar() {
|
91
117
|
return {
|
92
118
|
width: this.unistylesBridge.statusBar.width,
|
93
119
|
height: this.unistylesBridge.statusBar.height,
|
94
|
-
setColor: color => this.unistylesBridge.statusBar.setColor(color
|
120
|
+
setColor: (color, alpha) => this.unistylesBridge.statusBar.setColor(...parseColor(color, alpha)),
|
121
|
+
setHidden: hidden => this.unistylesBridge.statusBar.setHidden(hidden)
|
95
122
|
};
|
96
123
|
}
|
97
124
|
|
98
125
|
/**
|
99
126
|
* Get the navigation bar info (Android)
|
100
|
-
* @returns - The navigation bar api { width, height, setColor }
|
127
|
+
* @returns - The navigation bar api { width, height, setColor, setHidden }
|
101
128
|
*/
|
102
129
|
get navigationBar() {
|
103
130
|
return {
|
104
131
|
width: this.unistylesBridge.navigationBar.width,
|
105
132
|
height: this.unistylesBridge.navigationBar.height,
|
106
|
-
setColor: color => this.unistylesBridge.navigationBar.setColor(color
|
133
|
+
setColor: (color, alpha) => this.unistylesBridge.navigationBar.setColor(...parseColor(color, alpha)),
|
134
|
+
setHidden: hidden => this.unistylesBridge.navigationBar.setHidden(hidden)
|
107
135
|
};
|
108
136
|
}
|
109
137
|
|
@@ -122,6 +150,40 @@ export class UnistylesRuntime {
|
|
122
150
|
return ScreenOrientation.Portrait;
|
123
151
|
}
|
124
152
|
|
153
|
+
/**
|
154
|
+
* Get the pixel ratio
|
155
|
+
* @returns - The pixel ratio
|
156
|
+
*/
|
157
|
+
get pixelRatio() {
|
158
|
+
return this.unistylesBridge.pixelRatio;
|
159
|
+
}
|
160
|
+
|
161
|
+
/**
|
162
|
+
* Get the font scale
|
163
|
+
* @returns - The font scale
|
164
|
+
*/
|
165
|
+
get fontScale() {
|
166
|
+
const fontScale = this.unistylesBridge.fontScale;
|
167
|
+
return fontScale === 1.0 ? 1 : fontScale.toFixed(2);
|
168
|
+
}
|
169
|
+
|
170
|
+
/**
|
171
|
+
* Get the immersive mode (both status bar and navigation bar hidden (Android))
|
172
|
+
* @param isEnabled
|
173
|
+
*/
|
174
|
+
setImmersiveMode(isEnabled) {
|
175
|
+
return this.unistylesBridge.setImmersiveMode(isEnabled);
|
176
|
+
}
|
177
|
+
|
178
|
+
/**
|
179
|
+
* Set the root view background color
|
180
|
+
* @param color - The color to set
|
181
|
+
* @param alpha - Color alpha - default is 1
|
182
|
+
*/
|
183
|
+
setRootViewBackgroundColor = (color, alpha) => {
|
184
|
+
this.unistylesBridge.setRootViewBackgroundColor(...parseColor(color, alpha));
|
185
|
+
};
|
186
|
+
|
125
187
|
/**
|
126
188
|
* Switch to a different theme
|
127
189
|
* @param name - The name of the theme to switch to
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ScreenOrientation","UnistylesError","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","
|
1
|
+
{"version":3,"names":["ScreenOrientation","UnistylesError","parseColor","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","miniRuntime","contentSizeCategory","breakpoint","screen","insets","statusBar","width","height","navigationBar","orientation","pixelRatio","fontScale","colorScheme","hasAdaptiveThemes","themeName","breakpoints","enabledPlugins","screenWidth","screenHeight","setColor","color","alpha","setHidden","hidden","Landscape","Portrait","toFixed","setImmersiveMode","isEnabled","setRootViewBackgroundColor","setTheme","name","hasTheme","useTheme","Error","ThemeNotRegistered","updateTheme","updater","getTheme","setAdaptiveThemes","enable","useAdaptiveThemes","addPlugin","plugin","removePlugin"],"sourceRoot":"../../../src","sources":["core/UnistylesRuntime.ts"],"mappings":"AAAA,SAASA,iBAAiB,EAAEC,cAAc,QAAQ,WAAW;AAI7D,SAASC,UAAU,QAAQ,UAAU;;AAErC;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,CAAC;EAC1BC,WAAWA,CAASC,eAAgC,EAAUC,iBAAmC,EAAE;IAAA,KAA/ED,eAAgC,GAAhCA,eAAgC;IAAA,KAAUC,iBAAmC,GAAnCA,iBAAmC;EAAG;;EAEpG;AACJ;AACA;AACA;EACI,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO;MACHC,mBAAmB,EAAE,IAAI,CAACA,mBAAmB;MAC7CC,UAAU,EAAE,IAAI,CAACA,UAAU;MAC3BC,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBC,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBC,SAAS,EAAE;QACPC,KAAK,EAAE,IAAI,CAACD,SAAS,CAACC,KAAK;QAC3BC,MAAM,EAAE,IAAI,CAACF,SAAS,CAACE;MAC3B,CAAC;MACDC,aAAa,EAAE;QACXF,KAAK,EAAE,IAAI,CAACE,aAAa,CAACF,KAAK;QAC/BC,MAAM,EAAE,IAAI,CAACC,aAAa,CAACD;MAC/B,CAAC;MACDE,WAAW,EAAE,IAAI,CAACA,WAAW;MAC7BC,UAAU,EAAE,IAAI,CAACA,UAAU;MAC3BC,SAAS,EAAE,IAAI,CAACA;IACpB,CAAC;EACL;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO,IAAI,CAACd,eAAe,CAACc,WAAW;EAC3C;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,iBAAiBA,CAAA,EAAG;IAC3B,OAAO,IAAI,CAACf,eAAe,CAACe,iBAAiB;EACjD;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,SAASA,CAAA,EAAG;IACnB,OAAO,IAA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C,UAAU,CAACyB,KAAK,EAAEC,KAAK,CAAC,CAAC;EAChF,CAAC;;EAED;AACJ;AACA;AACA;AACA;EACWS,QAAQ,GAAIC,IAA2B,IAAK;IAC/C,IAAIA,IAAI,KAAK,IAAI,CAACjB,SAAS,EAAE;MACzB;IACJ;IAEA,IAAI,IAAI,CAACf,iBAAiB,CAACiC,QAAQ,CAACD,IAAI,CAAC,EAAE;MACvC,IAAI,CAACjC,eAAe,CAACmC,QAAQ,CAACF,IAAI,CAAC;MAEnC,OAAO,IAAI;IACf;IAEA,MAAM,IAAIG,KAAK,CAACxC,cAAc,CAACyC,kBAAkB,CAAC;EACtD,CAAC;;EAED;AACJ;AACA;AACA;AACA;AACA;EACWC,WAAW,GAAGA,CAACL,IAA2B,EAAEM,OAAkG,KAAK;IACtJ,IAAI,CAACtC,iBAAiB,CAACqC,WAAW,CAACL,IAAI,EAAEM,OAAO,CAAC,IAAI,CAACtC,iBAAiB,CAACuC,QAAQ,CAACP,IAAI,CAAC,CAAC,CAAC;EAC5F,CAAC;;EAED;AACJ;AACA;AACA;EACWQ,iBAAiB,GAAIC,MAAe,IAAK;IAC5C,IAAI,CAAC1C,eAAe,CAAC2C,iBAAiB,CAACD,MAAM,CAAC;EAClD,CAAC;;EAED;AACJ;AACA;AACA;EACWE,SAAS,GAAIC,MAAuB,IAAK;IAC5C,IAAI,CAAC5C,iBAAiB,CAAC2C,SAAS,CAACC,MAAM,CAAC;EAC5C,CAAC;;EAED;AACJ;AACA;AACA;EACWC,YAAY,GAAID,MAAuB,IAAK;IAC/C,IAAI,CAAC5C,iBAAiB,CAAC6C,YAAY,CAACD,MAAM,CAAC;EAC/C,CAAC;AACL","ignoreList":[]}
|
package/lib/module/core/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["unistyles"],"sourceRoot":"../../../src","sources":["core/index.ts"],"mappings":"AAAA,SAASA,SAAS,QAAQ,aAAa","ignoreList":[]}
|
1
|
+
{"version":3,"names":["unistyles"],"sourceRoot":"../../../src","sources":["core/index.ts"],"mappings":"AAAA,SAASA,SAAS,QAAQ,aAAa;AAKvC,SACIA,SAAS","ignoreList":[]}
|
@@ -12,6 +12,8 @@ export class UnistylesMockedBridge {
|
|
12
12
|
contentSizeCategory() {}
|
13
13
|
sortedBreakpointPairs() {}
|
14
14
|
insets() {}
|
15
|
+
pixelRatio() {}
|
16
|
+
fontScale() {}
|
15
17
|
statusBar() {}
|
16
18
|
navigationBar() {}
|
17
19
|
themes(themes) {}
|
@@ -21,5 +23,7 @@ export class UnistylesMockedBridge {
|
|
21
23
|
useAdaptiveThemes(enable) {}
|
22
24
|
addPlugin(pluginName, notify) {}
|
23
25
|
removePlugin(pluginName) {}
|
26
|
+
setRootViewBackgroundColor(color, alpha) {}
|
27
|
+
setImmersiveMode(isEnabled) {}
|
24
28
|
}
|
25
29
|
//# sourceMappingURL=UnistylesMockedBridge.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["UnistylesMockedBridge","constructor","screenWidth","screenHeight","enabledPlugins","hasAdaptiveThemes","themeName","breakpoint","colorScheme","contentSizeCategory","sortedBreakpointPairs","insets","statusBar","navigationBar","themes","useBreakpoints","breakpoints","useTheme","name","updateTheme","useAdaptiveThemes","enable","addPlugin","pluginName","notify","removePlugin"],"sourceRoot":"../../../../src","sources":["core/mocks/UnistylesMockedBridge.ts"],"mappings":"AAAA;;AAGA,OAAO,MAAMA,qBAAqB,CAAC;EAC/BC,WAAWA,CAAA,EAAG,CAAC;EAERC,WAAWA,CAAA,EAAG,CAAC;EACfC,YAAYA,CAAA,EAAG,CAAC;EAChBC,cAAcA,CAAA,EAAG,CAAC;EAClBC,iBAAiBA,CAAA,EAAG,CAAC;EACrBC,SAASA,CAAA,EAAG,CAAC;EACbC,UAAUA,CAAA,EAAG,CAAC;EACdC,WAAWA,CAAA,EAAG,CAAC;EACfC,mBAAmBA,CAAA,EAAG,CAAC;EACvBC,qBAAqBA,CAAA,EAAG,CAAC;EACzBC,MAAMA,CAAA,EAAG,CAAC;EACVC,SAASA,CAAA,EAAG,CAAC;EACbC,aAAaA,CAAA,EAAG,CAAC;EACjBC,MAAMA,CAACA,MAAoC,EAAE,CAAC;EAC9CC,cAAcA,CAACC,WAAiC,EAAE,CAAC;EACnDC,QAAQA,CAACC,IAA2B,EAAE,CAAC;EACvCC,WAAWA,CAACD,IAA2B,EAAE,CAAC;EAC1CE,iBAAiBA,CAACC,MAAe,EAAE,CAAC;EACpCC,SAASA,CAACC,UAAkB,EAAEC,MAAe,EAAE,CAAC;EAChDC,YAAYA,CAACF,UAAkB,EAAE,CAAC;
|
1
|
+
{"version":3,"names":["UnistylesMockedBridge","constructor","screenWidth","screenHeight","enabledPlugins","hasAdaptiveThemes","themeName","breakpoint","colorScheme","contentSizeCategory","sortedBreakpointPairs","insets","pixelRatio","fontScale","statusBar","navigationBar","themes","useBreakpoints","breakpoints","useTheme","name","updateTheme","useAdaptiveThemes","enable","addPlugin","pluginName","notify","removePlugin","setRootViewBackgroundColor","color","alpha","setImmersiveMode","isEnabled"],"sourceRoot":"../../../../src","sources":["core/mocks/UnistylesMockedBridge.ts"],"mappings":"AAAA;;AAGA,OAAO,MAAMA,qBAAqB,CAAC;EAC/BC,WAAWA,CAAA,EAAG,CAAC;EAERC,WAAWA,CAAA,EAAG,CAAC;EACfC,YAAYA,CAAA,EAAG,CAAC;EAChBC,cAAcA,CAAA,EAAG,CAAC;EAClBC,iBAAiBA,CAAA,EAAG,CAAC;EACrBC,SAASA,CAAA,EAAG,CAAC;EACbC,UAAUA,CAAA,EAAG,CAAC;EACdC,WAAWA,CAAA,EAAG,CAAC;EACfC,mBAAmBA,CAAA,EAAG,CAAC;EACvBC,qBAAqBA,CAAA,EAAG,CAAC;EACzBC,MAAMA,CAAA,EAAG,CAAC;EACVC,UAAUA,CAAA,EAAG,CAAC;EACdC,SAASA,CAAA,EAAG,CAAC;EACbC,SAASA,CAAA,EAAG,CAAC;EACbC,aAAaA,CAAA,EAAG,CAAC;EACjBC,MAAMA,CAACA,MAAoC,EAAE,CAAC;EAC9CC,cAAcA,CAACC,WAAiC,EAAE,CAAC;EACnDC,QAAQA,CAACC,IAA2B,EAAE,CAAC;EACvCC,WAAWA,CAACD,IAA2B,EAAE,CAAC;EAC1CE,iBAAiBA,CAACC,MAAe,EAAE,CAAC;EACpCC,SAASA,CAACC,UAAkB,EAAEC,MAAe,EAAE,CAAC;EAChDC,YAAYA,CAACF,UAAkB,EAAE,CAAC;EAClCG,0BAA0BA,CAACC,KAAc,EAAEC,KAAc,EAAE,CAAC;EAC5DC,gBAAgBA,CAACC,SAAkB,EAAE,CAAC;AACjD","ignoreList":[]}
|
@@ -45,18 +45,26 @@ export class UnistylesMockedRuntime {
|
|
45
45
|
left: 0
|
46
46
|
};
|
47
47
|
}
|
48
|
+
get pixelRatio() {
|
49
|
+
return 1.0;
|
50
|
+
}
|
51
|
+
get fontScale() {
|
52
|
+
return 1.0;
|
53
|
+
}
|
48
54
|
get statusBar() {
|
49
55
|
return {
|
50
56
|
height: 24,
|
51
57
|
width: 800,
|
52
|
-
setColor: () => {}
|
58
|
+
setColor: () => {},
|
59
|
+
setHidden: () => {}
|
53
60
|
};
|
54
61
|
}
|
55
62
|
get navigationBar() {
|
56
63
|
return {
|
57
64
|
height: 0,
|
58
65
|
width: 0,
|
59
|
-
setColor: () => {}
|
66
|
+
setColor: () => {},
|
67
|
+
setHidden: () => {}
|
60
68
|
};
|
61
69
|
}
|
62
70
|
get orientation() {
|
@@ -67,5 +75,7 @@ export class UnistylesMockedRuntime {
|
|
67
75
|
setAdaptiveThemes = enabled => {};
|
68
76
|
addPlugin = plugin => {};
|
69
77
|
removePlugin = plugin => {};
|
78
|
+
setRootViewBackgroundColor = color => {};
|
79
|
+
setImmersiveMode = isEnabled => {};
|
70
80
|
}
|
71
81
|
//# sourceMappingURL=UnistylesMockedRuntime.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ScreenOrientation","UnistylesMockedRuntime","constructor","unistylesBridge","unistylesRegistry","colorScheme","hasAdaptiveThemes","themeName","themeNames","length","at","undefined","contentSizeCategory","breakpoint","sortedBreakpointPairs","firstBreakpoint","breakpoints","enabledPlugins","plugins","screen","width","height","insets","top","right","bottom","left","statusBar","setColor","navigationBar","orientation","Portrait","setTheme","name","updateTheme","theme","setAdaptiveThemes","enabled","addPlugin","plugin","removePlugin"],"sourceRoot":"../../../../src","sources":["core/mocks/UnistylesMockedRuntime.ts"],"mappings":"AAAA;AACA,SAASA,iBAAiB,QAAQ,cAAc;AAMhD,OAAO,MAAMC,sBAAsB,CAAC;EAGhCC,WAAWA,CAASC,eAAgC,EAAUC,iBAAmC,EAAE;IAAA,KAA/ED,eAAgC,GAAhCA,eAAgC;IAAA,KAAUC,iBAAmC,GAAnCA,iBAAmC;IAC7F,IAAI,CAACA,iBAAiB,GAAGA,iBAAuD;EACpF;EAEA,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO,MAAM;EACjB;EAEA,IAAWC,iBAAiBA,CAAA,EAAG;IAC3B,OAAO,IAAI;EACf;EAEA,IAAWC,SAASA,CAAA,EAAG;IACnB,OAAO,IAAI,CAACH,iBAAiB,CAACI,UAAU,CAACC,MAAM,GAAG,CAAC,GAC7C,IAAI,CAACL,iBAAiB,CAACI,UAAU,CAACE,EAAE,CAAC,CAAC,CAAC,GACvCC,SAAS;EACnB;EAEA,IAAWC,mBAAmBA,CAAA,EAAG;IAC7B,OAAO,aAAa;EACxB;EAEA,IAAWC,UAAUA,CAAA,EAAG;IACpB,IAAI,IAAI,CAACT,iBAAiB,CAACU,qBAAqB,CAACL,MAAM,KAAK,CAAC,EAAE;MAC3D,OAAOE,SAAS;IACpB;IAEA,MAAMI,eAAe,GAAG,IAAI,CAACX,iBAAiB,CAACU,qBAAqB,CAACJ,EAAE,CAAC,CAAC,CAAC;IAE1E,OAAOK,eAAe,GAChBA,eAAe,CAACL,EAAE,CAAC,CAAC,CAAC,GACrBC,SAAS;EACnB;EAEA,IAAWK,WAAWA,CAAA,EAAG;IACrB,OAAO,IAAI,CAACZ,iBAAiB,CAACY,WAAW;EAC7C;EAEA,IAAWC,cAAcA,CAAA,EAAG;IACxB,OAAO,IAAI,CAACb,iBAAiB,CAACc,OAAO;EACzC;EAEA,IAAWC,MAAMA,CAAA,EAAG;IAChB,OAAO;MACHC,KAAK,EAAE,GAAG;MACVC,MAAM,EAAE;IACZ,CAAC;EACL;EAEA,IAAWC,MAAMA,CAAA,EAAG;IAChB,OAAO;MACHC,GAAG,EAAE,CAAC;MACNC,KAAK,EAAE,CAAC;MACRC,MAAM,EAAE,CAAC;MACTC,IAAI,EAAE;IACV,CAAC;EACL;EAEA,IAAWC,SAASA,CAAA,EAAG;IACnB,OAAO;
|
1
|
+
{"version":3,"names":["ScreenOrientation","UnistylesMockedRuntime","constructor","unistylesBridge","unistylesRegistry","colorScheme","hasAdaptiveThemes","themeName","themeNames","length","at","undefined","contentSizeCategory","breakpoint","sortedBreakpointPairs","firstBreakpoint","breakpoints","enabledPlugins","plugins","screen","width","height","insets","top","right","bottom","left","pixelRatio","fontScale","statusBar","setColor","setHidden","navigationBar","orientation","Portrait","setTheme","name","updateTheme","theme","setAdaptiveThemes","enabled","addPlugin","plugin","removePlugin","setRootViewBackgroundColor","color","setImmersiveMode","isEnabled"],"sourceRoot":"../../../../src","sources":["core/mocks/UnistylesMockedRuntime.ts"],"mappings":"AAAA;AACA,SAASA,iBAAiB,QAAQ,cAAc;AAMhD,OAAO,MAAMC,sBAAsB,CAAC;EAGhCC,WAAWA,CAASC,eAAgC,EAAUC,iBAAmC,EAAE;IAAA,KAA/ED,eAAgC,GAAhCA,eAAgC;IAAA,KAAUC,iBAAmC,GAAnCA,iBAAmC;IAC7F,IAAI,CAACA,iBAAiB,GAAGA,iBAAuD;EACpF;EAEA,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO,MAAM;EACjB;EAEA,IAAWC,iBAAiBA,CAAA,EAAG;IAC3B,OAAO,IAAI;EACf;EA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SAAS,EAAEA,CAAA,KAAM,CAAC;IACtB,CAAC;EACL;EAEA,IAAWC,aAAaA,CAAA,EAAG;IACvB,OAAO;MACHX,MAAM,EAAE,CAAC;MACTD,KAAK,EAAE,CAAC;MACRU,QAAQ,EAAEA,CAAA,KAAM,CAAC,CAAC;MAClBC,SAAS,EAAEA,CAAA,KAAM,CAAC;IACtB,CAAC;EACL;EAEA,IAAWE,WAAWA,CAAA,EAAG;IACrB,OAAOjC,iBAAiB,CAACkC,QAAQ;EACrC;EAEOC,QAAQ,GAAIC,IAA2B,IAAK,IAAI;EAChDC,WAAW,GAAGA,CAACD,IAA2B,EAAEE,KAA6C,KAAK,CAAC,CAAC;EAChGC,iBAAiB,GAAIC,OAAgB,IAAK,CAAC,CAAC;EAC5CC,SAAS,GAAIC,MAAuB,IAAK,CAAC,CAAC;EAC3CC,YAAY,GAAID,MAAuB,IAAK,CAAC,CAAC;EAC9CE,0BAA0B,GAAIC,KAAsB,IAAK,CAAC,CAAC;EAC3DC,gBAAgB,GAAIC,SAAkB,IAAK,CAAC,CAAC;AACxD","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/color.ts"],"mappings":"","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,aAAa","ignoreList":[]}
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,aAAa;AAC3B,cAAc,SAAS","ignoreList":[]}
|
package/lib/module/useStyles.js
CHANGED
@@ -17,7 +17,7 @@ export const useStyles = (stylesheet, variantsMap) => {
|
|
17
17
|
plugins
|
18
18
|
} = useUnistyles();
|
19
19
|
const variants = useVariants(variantsMap);
|
20
|
-
const parsedStyles = useMemo(() => typeof stylesheet === 'function' ? stylesheet(theme, unistyles.runtime) : stylesheet, [theme, stylesheet, layout]);
|
20
|
+
const parsedStyles = useMemo(() => typeof stylesheet === 'function' ? stylesheet(theme, unistyles.runtime.miniRuntime) : stylesheet, [theme, stylesheet, layout]);
|
21
21
|
const dynamicStyleSheet = useMemo(() => Object.entries(parsedStyles || {}).reduce((acc, [key, value]) => {
|
22
22
|
if (typeof value === 'function') {
|
23
23
|
return {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["useMemo","StyleSheet","parseStyle","proxifyFunction","withPlugins","useCSS","useUnistyles","useVariants","unistyles","isWeb","useStyles","stylesheet","variantsMap","theme","layout","plugins","variants","parsedStyles","runtime","dynamicStyleSheet","Object","entries","reduce","acc","key","value","create","registry","config","experimentalCSSMediaQueries","breakpoint","styles"],"sourceRoot":"../../src","sources":["useStyles.ts"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,UAAU,EAAEC,eAAe,EAAEC,WAAW,QAAQ,SAAS;AAClE,SAASC,MAAM,EAAEC,YAAY,EAAEC,WAAW,QAAQ,SAAS;AAG3D,SAASC,SAAS,QAAQ,QAAQ;AAClC,SAASC,KAAK,QAAQ,UAAU;AAQhC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,GAAGA,CACrBC,UAAe,EACfC,WAAoD,KAC7B;EACvB,MAAM;IAAEC,KAAK;IAAEC,MAAM;IAAEC;EAAQ,CAAC,GAAGT,YAAY,CAAC,CAAC;EACjD,MAAMU,QAAQ,GAAGT,WAAW,CAACK,WAAW,CAAC;EACzC,MAAMK,YAAY,GAAGjB,OAAO,CAAC,MAAM,OAAOW,UAAU,KAAK,UAAU,GAC7DA,UAAU,CAACE,KAAK,EAAEL,SAAS,CAACU,OAAO,CAAC,
|
1
|
+
{"version":3,"names":["useMemo","StyleSheet","parseStyle","proxifyFunction","withPlugins","useCSS","useUnistyles","useVariants","unistyles","isWeb","useStyles","stylesheet","variantsMap","theme","layout","plugins","variants","parsedStyles","runtime","miniRuntime","dynamicStyleSheet","Object","entries","reduce","acc","key","value","create","registry","config","experimentalCSSMediaQueries","breakpoint","styles"],"sourceRoot":"../../src","sources":["useStyles.ts"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,UAAU,EAAEC,eAAe,EAAEC,WAAW,QAAQ,SAAS;AAClE,SAASC,MAAM,EAAEC,YAAY,EAAEC,WAAW,QAAQ,SAAS;AAG3D,SAASC,SAAS,QAAQ,QAAQ;AAClC,SAASC,KAAK,QAAQ,UAAU;AAQhC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,GAAGA,CACrBC,UAAe,EACfC,WAAoD,KAC7B;EACvB,MAAM;IAAEC,KAAK;IAAEC,MAAM;IAAEC;EAAQ,CAAC,GAAGT,YAAY,CAAC,CAAC;EACjD,MAAMU,QAAQ,GAAGT,WAAW,CAACK,WAAW,CAAC;EACzC,MAAMK,YAAY,GAAGjB,OAAO,CAAC,MAAM,OAAOW,UAAU,KAAK,UAAU,GAC7DA,UAAU,CAACE,KAAK,EAAEL,SAAS,CAACU,OAAO,CAACC,WAAW,CAAC,GAChDR,UAAU,EAAE,CAACE,KAAK,EAAEF,UAAU,EAAEG,MAAM,CAAC,CAAC;EAE9C,MAAMM,iBAAiB,GAAGpB,OAAO,CAAC,MAAMqB,MAAM,CACzCC,OAAO,CAACL,YAAY,IAAI,CAAC,CAAC,CAAC,CAC3BM,MAAM,CAAC,CAACC,GAAG,EAAE,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK;IAC3B,IAAI,OAAOA,KAAK,KAAK,UAAU,EAAE;MAC7B,OAAO;QACH,GAAGF,GAAG;QACN,CAACC,GAAG,GAAGtB,eAAe,CAACsB,GAAG,EAAEC,KAAK,EAAEV,QAAQ;MAC/C,CAAC;IACL;IAEA,OAAOf,UAAU,CAAC0B,MAAM,CAAC;MACrB,GAAGH,GAAG;MACN,CAACC,GAAG,GAAGrB,WAAW,CAACqB,GAAG,EAAEvB,UAAU,CAC9BwB,KAAK,EACLV,QAAQ,EACR,CAACP,KAAK,IAAI,CAACD,SAAS,CAACoB,QAAQ,CAACC,MAAM,CAACC,2BAA2B,CACpE;IACJ,CAAC,CAAC;EACN,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAACb,YAAY,EAAED,QAAQ,EAAED,OAAO,EAAED,MAAM,CACpD,CAAC;EAEDT,MAAM,CAACe,iBAA8C,CAAC;EAEtD,OAAO;IACHP,KAAK;IACLkB,UAAU,EAAEjB,MAAM,CAACiB,UAAU;IAC7BC,MAAM,EAAEZ;EACZ,CAAC;AACL,CAAC","ignoreList":[]}
|
@@ -4,4 +4,5 @@ export { getValueForBreakpoint } from './breakpoints';
|
|
4
4
|
export { proxifyFunction, parseStyle, isPlatformColor } from './styles';
|
5
5
|
export { withPlugins } from './withPlugins';
|
6
6
|
export { generateReactNativeWebId } from './generateId';
|
7
|
+
export { parseColor } from './parseColor';
|
7
8
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["mq","getKeyForUnistylesMediaQuery","isWithinTheWidthAndHeight","isValidMq","parseMq","isUnistylesMq","getValueForBreakpoint","proxifyFunction","parseStyle","isPlatformColor","withPlugins","generateReactNativeWebId"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":"AAAA,SAASA,EAAE,QAAQ,MAAM;AAEzB,SAASC,4BAA4B,EAAEC,yBAAyB,EAAEC,SAAS,EAAEC,OAAO,EAAEC,aAAa,QAAQ,YAAY;AACvH,SAASC,qBAAqB,QAAQ,eAAe;AACrD,SAASC,eAAe,EAAEC,UAAU,EAAEC,eAAe,QAAQ,UAAU;AACvE,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,wBAAwB,QAAQ,cAAc","ignoreList":[]}
|
1
|
+
{"version":3,"names":["mq","getKeyForUnistylesMediaQuery","isWithinTheWidthAndHeight","isValidMq","parseMq","isUnistylesMq","getValueForBreakpoint","proxifyFunction","parseStyle","isPlatformColor","withPlugins","generateReactNativeWebId","parseColor"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":"AAAA,SAASA,EAAE,QAAQ,MAAM;AAEzB,SAASC,4BAA4B,EAAEC,yBAAyB,EAAEC,SAAS,EAAEC,OAAO,EAAEC,aAAa,QAAQ,YAAY;AACvH,SAASC,qBAAqB,QAAQ,eAAe;AACrD,SAASC,eAAe,EAAEC,UAAU,EAAEC,eAAe,QAAQ,UAAU;AACvE,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,wBAAwB,QAAQ,cAAc;AACvD,SAASC,UAAU,QAAQ,cAAc","ignoreList":[]}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
const parseAlpha = alpha => {
|
2
|
+
if (alpha > 1 || alpha < 0) {
|
3
|
+
return 1;
|
4
|
+
}
|
5
|
+
return alpha;
|
6
|
+
};
|
7
|
+
export const parseColor = (color, alpha = 1) => {
|
8
|
+
if (!color) {
|
9
|
+
return ['', 1];
|
10
|
+
}
|
11
|
+
|
12
|
+
// ignore alpha for 8 digit hex colors
|
13
|
+
if (color.startsWith('#') && color.length === 9) {
|
14
|
+
return [color, 1];
|
15
|
+
}
|
16
|
+
if (color.startsWith('#') && color.length === 7) {
|
17
|
+
return [color, parseAlpha(alpha)];
|
18
|
+
}
|
19
|
+
|
20
|
+
// named colors
|
21
|
+
return [color, 1];
|
22
|
+
};
|
23
|
+
//# sourceMappingURL=parseColor.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["parseAlpha","alpha","parseColor","color","startsWith","length"],"sourceRoot":"../../../src","sources":["utils/parseColor.ts"],"mappings":"AAEA,MAAMA,UAAU,GAAIC,KAAa,IAAK;EAClC,IAAIA,KAAK,GAAG,CAAC,IAAIA,KAAK,GAAG,CAAC,EAAE;IACxB,OAAO,CAAC;EACZ;EAEA,OAAOA,KAAK;AAChB,CAAC;AAED,OAAO,MAAMC,UAAU,GAAGA,CAACC,KAAa,EAAEF,KAAa,GAAG,CAAC,KAAuB;EAC9E,IAAI,CAACE,KAAK,EAAE;IACR,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;EAClB;;EAEA;EACA,IAAIA,KAAK,CAACC,UAAU,CAAC,GAAG,CAAC,IAAID,KAAK,CAACE,MAAM,KAAK,CAAC,EAAE;IAC7C,OAAO,CAACF,KAAK,EAAE,CAAC,CAAC;EACrB;EAEA,IAAIA,KAAK,CAACC,UAAU,CAAC,GAAG,CAAC,IAAID,KAAK,CAACE,MAAM,KAAK,CAAC,EAAE;IAC7C,OAAO,CAACF,KAAK,EAAEH,UAAU,CAACC,KAAK,CAAC,CAAC;EACrC;;EAEA;EACA,OAAO,CAACE,KAAK,EAAE,CAAC,CAAC;AACrB,CAAC","ignoreList":[]}
|
@@ -12,6 +12,7 @@ export declare class UnistylesBridgeWeb {
|
|
12
12
|
private setupListeners;
|
13
13
|
private getBreakpointFromScreenWidth;
|
14
14
|
private getPreferredColorScheme;
|
15
|
+
private setRootViewBackgroundColor;
|
15
16
|
private emitPluginChange;
|
16
17
|
private emitThemeChange;
|
17
18
|
private emitLayoutChange;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UnistylesModule.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesModule.ts"],"names":[],"mappings":"AAMA,qBAAa,kBAAkB;;;
|
1
|
+
{"version":3,"file":"UnistylesModule.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesModule.ts"],"names":[],"mappings":"AAMA,qBAAa,kBAAkB;;;IA4CpB,OAAO;IA+Ed,OAAO,CAAC,QAAQ;IAKhB,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,QAAQ;IAQhB,OAAO,CAAC,cAAc;IA6BtB,OAAO,CAAC,4BAA4B;IAgBpC,OAAO,CAAC,uBAAuB;IAQ/B,OAAO,CAAC,0BAA0B;IAIlC,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,gBAAgB;CAe3B;AAED,eAAO,MAAM,eAAe,oBAA2B,CAAA"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { UnistylesBridge, UnistylesPlugin } from '../types';
|
1
|
+
import type { Color, UnistylesBridge, UnistylesPlugin } from '../types';
|
2
2
|
import type { UnistylesThemes } from '../global';
|
3
3
|
import type { UnistyleRegistry } from './UnistyleRegistry';
|
4
4
|
/**
|
@@ -8,6 +8,30 @@ export declare class UnistylesRuntime {
|
|
8
8
|
private unistylesBridge;
|
9
9
|
private unistylesRegistry;
|
10
10
|
constructor(unistylesBridge: UnistylesBridge, unistylesRegistry: UnistyleRegistry);
|
11
|
+
/**
|
12
|
+
* Get the mini runtime injected to creteStyleSheet
|
13
|
+
* @returns - The mini runtime
|
14
|
+
*/
|
15
|
+
get miniRuntime(): {
|
16
|
+
contentSizeCategory: import("../common").IOSContentSizeCategory | import("../common").AndroidContentSizeCategory;
|
17
|
+
breakpoint: keyof import("../global").UnistylesBreakpoints;
|
18
|
+
screen: {
|
19
|
+
width: number;
|
20
|
+
height: number;
|
21
|
+
};
|
22
|
+
insets: import("../types").ScreenInsets;
|
23
|
+
statusBar: {
|
24
|
+
width: number;
|
25
|
+
height: number;
|
26
|
+
};
|
27
|
+
navigationBar: {
|
28
|
+
width: number;
|
29
|
+
height: number;
|
30
|
+
};
|
31
|
+
orientation: "landscape" | "portrait";
|
32
|
+
pixelRatio: number;
|
33
|
+
fontScale: string | number;
|
34
|
+
};
|
11
35
|
/**
|
12
36
|
* Get the current color scheme
|
13
37
|
* @returns - The current color scheme
|
@@ -58,27 +82,50 @@ export declare class UnistylesRuntime {
|
|
58
82
|
get insets(): import("../types").ScreenInsets;
|
59
83
|
/**
|
60
84
|
* Get the status bar info
|
61
|
-
* @returns - The status bar api { width, height, setColor }
|
85
|
+
* @returns - The status bar api { width, height, setColor, setHidden }
|
62
86
|
*/
|
63
87
|
get statusBar(): {
|
64
88
|
width: number;
|
65
89
|
height: number;
|
66
|
-
setColor: (color?:
|
90
|
+
setColor: (color?: Color, alpha?: number) => void;
|
91
|
+
setHidden: (hidden: boolean) => void;
|
67
92
|
};
|
68
93
|
/**
|
69
94
|
* Get the navigation bar info (Android)
|
70
|
-
* @returns - The navigation bar api { width, height, setColor }
|
95
|
+
* @returns - The navigation bar api { width, height, setColor, setHidden }
|
71
96
|
*/
|
72
97
|
get navigationBar(): {
|
73
98
|
width: number;
|
74
99
|
height: number;
|
75
|
-
setColor: (color?:
|
100
|
+
setColor: (color?: Color, alpha?: number) => void;
|
101
|
+
setHidden: (hidden: boolean) => void;
|
76
102
|
};
|
77
103
|
/**
|
78
104
|
* Get the screen orientation
|
79
105
|
* @returns - The screen orientation
|
80
106
|
*/
|
81
107
|
get orientation(): "landscape" | "portrait";
|
108
|
+
/**
|
109
|
+
* Get the pixel ratio
|
110
|
+
* @returns - The pixel ratio
|
111
|
+
*/
|
112
|
+
get pixelRatio(): number;
|
113
|
+
/**
|
114
|
+
* Get the font scale
|
115
|
+
* @returns - The font scale
|
116
|
+
*/
|
117
|
+
get fontScale(): string | 1;
|
118
|
+
/**
|
119
|
+
* Get the immersive mode (both status bar and navigation bar hidden (Android))
|
120
|
+
* @param isEnabled
|
121
|
+
*/
|
122
|
+
setImmersiveMode(isEnabled: boolean): void;
|
123
|
+
/**
|
124
|
+
* Set the root view background color
|
125
|
+
* @param color - The color to set
|
126
|
+
* @param alpha - Color alpha - default is 1
|
127
|
+
*/
|
128
|
+
setRootViewBackgroundColor: (color?: Color, alpha?: number) => void;
|
82
129
|
/**
|
83
130
|
* Switch to a different theme
|
84
131
|
* @param name - The name of the theme to switch to
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UnistylesRuntime.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesRuntime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;
|
1
|
+
{"version":3,"file":"UnistylesRuntime.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesRuntime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAG1D;;GAEG;AACH,qBAAa,gBAAgB;IACb,OAAO,CAAC,eAAe;IAAmB,OAAO,CAAC,iBAAiB;gBAA3D,eAAe,EAAE,eAAe,EAAU,iBAAiB,EAAE,gBAAgB;IAEjG;;;OAGG;IACH,IAAW,WAAW;;;;;;;;;;;;;;;;;;;MAkBrB;IAED;;;OAGG;IACH,IAAW,WAAW,uCAErB;IAED;;;OAGG;IACH,IAAW,iBAAiB,YAE3B;IAED;;;OAGG;IACH,IAAW,SAAS,UAEnB;IAED;;;OAGG;IACH,IAAW,mBAAmB,gGAE7B;IAED;;;OAGG;IACH,IAAW,UAAU,mDAEpB;IAED;;;OAGG;IACH,IAAW,WAAW,6CAErB;IAED;;;OAGG;IACH,IAAW,cAAc,aAExB;IAED;;;OAGG;IACH,IAAW,MAAM;;;MAKhB;IAED;;;OAGG;IACH,IAAW,MAAM,oCAEhB;IAED;;;OAGG;IACH,IAAW,SAAS;;;2BAIO,KAAK,UAAU,MAAM;4BACpB,OAAO;MAElC;IAED;;;OAGG;IACH,IAAW,aAAa;;;2BAIG,KAAK,UAAU,MAAM;4BACpB,OAAO;MAElC;IAED;;;OAGG;IACH,IAAW,WAAW,6BAQrB;IAED;;;OAGG;IACH,IAAW,UAAU,WAEpB;IAED;;;OAGG;IACH,IAAW,SAAS,eAInB;IAED;;;OAGG;IACI,gBAAgB,CAAC,SAAS,EAAE,OAAO;IAI1C;;;;OAIG;IACI,0BAA0B,WAAY,KAAK,UAAU,MAAM,UAEjE;IAED;;;;OAIG;IACI,QAAQ,SAAU,MAAM,eAAe,sBAY7C;IAED;;;;;OAKG;IACI,WAAW,SAAU,MAAM,eAAe,mBAAmB,eAAe,CAAC,MAAM,eAAe,CAAC,KAAK,eAAe,CAAC,MAAM,eAAe,CAAC,UAEpJ;IAED;;;OAGG;IACI,iBAAiB,WAAY,OAAO,UAE1C;IAED;;;OAGG;IACI,SAAS,WAAY,eAAe,UAE1C;IAED;;;OAGG;IACI,YAAY,WAAY,eAAe,UAE7C;CACJ"}
|
@@ -1,3 +1,5 @@
|
|
1
|
-
|
1
|
+
import { unistyles } from './Unistyles';
|
2
2
|
export type { UnistylesRuntime } from './UnistylesRuntime';
|
3
|
+
export type UnistylesMiniRuntime = typeof unistyles.runtime.miniRuntime;
|
4
|
+
export { unistyles };
|
3
5
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAE1D,MAAM,MAAM,oBAAoB,GAAG,OAAO,SAAS,CAAC,OAAO,CAAC,WAAW,CAAA;AAEvE,OAAO,EACH,SAAS,EACZ,CAAA"}
|
@@ -11,6 +11,8 @@ export declare class UnistylesMockedBridge {
|
|
11
11
|
contentSizeCategory(): void;
|
12
12
|
sortedBreakpointPairs(): void;
|
13
13
|
insets(): void;
|
14
|
+
pixelRatio(): void;
|
15
|
+
fontScale(): void;
|
14
16
|
statusBar(): void;
|
15
17
|
navigationBar(): void;
|
16
18
|
themes(themes: Array<keyof UnistylesThemes>): void;
|
@@ -20,5 +22,7 @@ export declare class UnistylesMockedBridge {
|
|
20
22
|
useAdaptiveThemes(enable: boolean): void;
|
21
23
|
addPlugin(pluginName: string, notify: boolean): void;
|
22
24
|
removePlugin(pluginName: string): void;
|
25
|
+
setRootViewBackgroundColor(color?: string, alpha?: number): void;
|
26
|
+
setImmersiveMode(isEnabled: boolean): void;
|
23
27
|
}
|
24
28
|
//# sourceMappingURL=UnistylesMockedBridge.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UnistylesMockedBridge.d.ts","sourceRoot":"","sources":["../../../../../src/core/mocks/UnistylesMockedBridge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAEzE,qBAAa,qBAAqB;;IAGvB,WAAW;IACX,YAAY;IACZ,cAAc;IACd,iBAAiB;IACjB,SAAS;IACT,UAAU;IACV,WAAW;IACX,mBAAmB;IACnB,qBAAqB;IACrB,MAAM;IACN,SAAS;IACT,aAAa;IACb,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,eAAe,CAAC;IAC3C,cAAc,CAAC,WAAW,EAAE,oBAAoB;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,eAAe;IACpC,WAAW,CAAC,IAAI,EAAE,MAAM,eAAe;IACvC,iBAAiB,CAAC,MAAM,EAAE,OAAO;IACjC,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;IAC7C,YAAY,CAAC,UAAU,EAAE,MAAM;
|
1
|
+
{"version":3,"file":"UnistylesMockedBridge.d.ts","sourceRoot":"","sources":["../../../../../src/core/mocks/UnistylesMockedBridge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAEzE,qBAAa,qBAAqB;;IAGvB,WAAW;IACX,YAAY;IACZ,cAAc;IACd,iBAAiB;IACjB,SAAS;IACT,UAAU;IACV,WAAW;IACX,mBAAmB;IACnB,qBAAqB;IACrB,MAAM;IACN,UAAU;IACV,SAAS;IACT,SAAS;IACT,aAAa;IACb,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,eAAe,CAAC;IAC3C,cAAc,CAAC,WAAW,EAAE,oBAAoB;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,eAAe;IACpC,WAAW,CAAC,IAAI,EAAE,MAAM,eAAe;IACvC,iBAAiB,CAAC,MAAM,EAAE,OAAO;IACjC,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;IAC7C,YAAY,CAAC,UAAU,EAAE,MAAM;IAC/B,0BAA0B,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;IACzD,gBAAgB,CAAC,SAAS,EAAE,OAAO;CAC7C"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { UnistylesBridge, UnistylesPlugin } from '../../types';
|
1
|
+
import type { Color, UnistylesBridge, UnistylesPlugin } from '../../types';
|
2
2
|
import type { UnistylesThemes } from '../../global';
|
3
3
|
import type { UnistyleRegistry } from '../UnistyleRegistry';
|
4
4
|
export declare class UnistylesMockedRuntime {
|
@@ -23,15 +23,19 @@ export declare class UnistylesMockedRuntime {
|
|
23
23
|
bottom: number;
|
24
24
|
left: number;
|
25
25
|
};
|
26
|
+
get pixelRatio(): number;
|
27
|
+
get fontScale(): number;
|
26
28
|
get statusBar(): {
|
27
29
|
height: number;
|
28
30
|
width: number;
|
29
31
|
setColor: () => void;
|
32
|
+
setHidden: () => void;
|
30
33
|
};
|
31
34
|
get navigationBar(): {
|
32
35
|
height: number;
|
33
36
|
width: number;
|
34
37
|
setColor: () => void;
|
38
|
+
setHidden: () => void;
|
35
39
|
};
|
36
40
|
get orientation(): "portrait";
|
37
41
|
setTheme: (name: keyof UnistylesThemes) => boolean;
|
@@ -39,5 +43,7 @@ export declare class UnistylesMockedRuntime {
|
|
39
43
|
setAdaptiveThemes: (enabled: boolean) => void;
|
40
44
|
addPlugin: (plugin: UnistylesPlugin) => void;
|
41
45
|
removePlugin: (plugin: UnistylesPlugin) => void;
|
46
|
+
setRootViewBackgroundColor: (color?: Color | string) => void;
|
47
|
+
setImmersiveMode: (isEnabled: boolean) => void;
|
42
48
|
}
|
43
49
|
//# sourceMappingURL=UnistylesMockedRuntime.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UnistylesMockedRuntime.d.ts","sourceRoot":"","sources":["../../../../../src/core/mocks/UnistylesMockedRuntime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;
|
1
|
+
{"version":3,"file":"UnistylesMockedRuntime.d.ts","sourceRoot":"","sources":["../../../../../src/core/mocks/UnistylesMockedRuntime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAE3D,qBAAa,sBAAsB;IAGnB,OAAO,CAAC,eAAe;IAAmB,OAAO,CAAC,iBAAiB;IAF/E,OAAO,CAAC,iBAAiB,CAAyB;gBAE9B,eAAe,EAAE,eAAe,EAAU,iBAAiB,EAAE,gBAAgB;IAIjG,IAAW,WAAW,WAErB;IAED,IAAW,iBAAiB,YAE3B;IAED,IAAW,SAAS,cAInB;IAED,IAAW,mBAAmB,WAE7B;IAED,IAAW,UAAU,2EAUpB;IAED,IAAW,WAAW,gDAErB;IAED,IAAW,cAAc,sBAExB;IAED,IAAW,MAAM;;;MAKhB;IAED,IAAW,MAAM;;;;;MAOhB;IAED,IAAW,UAAU,WAEpB;IAED,IAAW,SAAS,WAEnB;IAED,IAAW,SAAS;;;;;MAOnB;IAED,IAAW,aAAa;;;;;MAOvB;IAED,IAAW,WAAW,eAErB;IAEM,QAAQ,SAAU,MAAM,eAAe,aAAS;IAChD,WAAW,SAAU,MAAM,eAAe,SAAS,eAAe,CAAC,MAAM,eAAe,CAAC,UAAO;IAChG,iBAAiB,YAAa,OAAO,UAAO;IAC5C,SAAS,WAAY,eAAe,UAAO;IAC3C,YAAY,WAAY,eAAe,UAAO;IAC9C,0BAA0B,WAAY,KAAK,GAAG,MAAM,UAAO;IAC3D,gBAAgB,cAAe,OAAO,UAAO;CACvD"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { mq } from './utils';
|
2
2
|
import { useInitialTheme } from './hooks';
|
3
|
-
import type { UnistylesPlugin, UnistylesValues } from './types';
|
3
|
+
import type { UnistylesPlugin, UnistylesValues, ExtractVariantNames } from './types';
|
4
4
|
import type { UnistylesThemes, UnistylesBreakpoints } from './global';
|
5
5
|
import { ScreenOrientation, AndroidContentSizeCategory, IOSContentSizeCategory } from './common';
|
6
6
|
import { useStyles } from './useStyles';
|
@@ -73,5 +73,5 @@ declare const UnistylesRegistry: {
|
|
73
73
|
};
|
74
74
|
declare const UnistylesRuntime: import("./core").UnistylesRuntime;
|
75
75
|
export { mq, useStyles, useInitialTheme, createStyleSheet, ScreenOrientation, AndroidContentSizeCategory, IOSContentSizeCategory, UnistylesRegistry, UnistylesRuntime };
|
76
|
-
export type { UnistylesThemes, UnistylesBreakpoints, UnistylesPlugin, UnistylesValues };
|
76
|
+
export type { UnistylesThemes, UnistylesBreakpoints, UnistylesPlugin, UnistylesValues, ExtractVariantNames as UnistylesVariants };
|
77
77
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AACpF,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD;;;GAGG;AACH,QAAA,MAAM,iBAAiB;IACnB;;;OAGG;;;;;;;;;;;;;;;;;IAEH;;;OAGG;;;;;;;;;;;;;;;;;IAEH;;;OAGG;;;;;;;;;;;;;;;;;CAEN,CAAA;AAED,QAAA,MAAM,gBAAgB,mCAAoB,CAAA;AAE1C,OAAO,EACH,EAAE,EACF,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EACnB,CAAA;AAED,YAAY,EACR,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,mBAAmB,IAAI,iBAAiB,EAC3C,CAAA"}
|
@@ -2,7 +2,7 @@ import type { ColorValue, OpaqueColorValue } from 'react-native';
|
|
2
2
|
import type { UnistylesTheme } from '../types';
|
3
3
|
import type { BreakpointsOrMediaQueries, ToDeepUnistyles } from './stylesheet';
|
4
4
|
import type { TransformStyles } from './core';
|
5
|
-
import type {
|
5
|
+
import type { UnistylesMiniRuntime } from '../core';
|
6
6
|
type ExtractTransformArray<T> = T extends object ? {
|
7
7
|
[K in keyof T]: ExtractBreakpoints<T[K]>;
|
8
8
|
} : never;
|
@@ -24,6 +24,6 @@ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
|
|
24
24
|
type ParseStyleKeys<T> = T extends object ? {
|
25
25
|
[K in keyof T]: ParseNestedObject<T[K]>;
|
26
26
|
} : never;
|
27
|
-
export type ReactNativeStyleSheet<T> = T extends (theme: UnistylesTheme, runtime:
|
27
|
+
export type ReactNativeStyleSheet<T> = T extends (theme: UnistylesTheme, runtime: UnistylesMiniRuntime) => infer R ? ParseStyleKeys<R> : ParseStyleKeys<T>;
|
28
28
|
export {};
|
29
29
|
//# sourceMappingURL=breakpoints.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../../../src/types/breakpoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../../../src/types/breakpoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9E,OAAO,KAAK,EAAE,eA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an' | 'magenta' | 'yellow' | 'light gray' | 'dark gray' | 'grey' | 'light grey' | 'dark grey' | 'aqua' | 'fuchsia' | 'lime' | 'maroon' | 'navy' | 'olive' | 'purple' | 'silver' | 'teal' | 'transparent';
|
2
|
+
export type Color = AndroidColor | string | undefined;
|
3
|
+
export {};
|
4
|
+
//# sourceMappingURL=color.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../../src/types/color.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG,KAAK,GACvB,MAAM,GACN,OAAO,GACP,OAAO,GACP,OAAO,GACP,MAAM,GACN,MAAM,GACN,SAAS,GACT,QAAQ,GACR,YAAY,GACZ,WAAW,GACX,MAAM,GACN,YAAY,GACZ,WAAW,GACX,MAAM,GACN,SAAS,GACT,MAAM,GACN,QAAQ,GACR,MAAM,GACN,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,aAAa,CAAA;AAEf,MAAM,MAAM,KAAK,GAAG,YAAY,GAAG,MAAM,GAAG,SAAS,CAAA"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
export * from './normalizer';
|
2
2
|
export * from './unistyles';
|
3
|
+
export * from './color';
|
3
4
|
export type { Optional, Nullable } from './common';
|
4
5
|
export type { NestedStylePairs, UnistylesTheme, ScreenSize, NestedStyle, RNValue, RNStyle } from './core';
|
5
6
|
export type { StyleSheetWithSuperPowers, StyleSheet, AllAvailableKeys, UnistylesValues } from './stylesheet';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAClD,YAAY,EACR,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,WAAW,EACX,OAAO,EACP,OAAO,EACV,MAAM,QAAQ,CAAA;AACf,YAAY,EACR,yBAAyB,EACzB,UAAU,EACV,gBAAgB,EAChB,eAAe,EAClB,MAAM,cAAc,CAAA;AACrB,YAAY,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC1D,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAClD,YAAY,EACR,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,WAAW,EACX,OAAO,EACP,OAAO,EACV,MAAM,QAAQ,CAAA;AACf,YAAY,EACR,yBAAyB,EACzB,UAAU,EACV,gBAAgB,EAChB,eAAe,EAClB,MAAM,cAAc,CAAA;AACrB,YAAY,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC1D,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { ImageStyle, TextStyle, ViewStyle } from 'react-native';
|
2
2
|
import type { ShadowOffset, TransformStyles, UnistylesTheme } from './core';
|
3
3
|
import type { UnistylesBreakpoints } from '../global';
|
4
|
-
import type {
|
4
|
+
import type { UnistylesMiniRuntime } from '../core';
|
5
5
|
type NestedKeys = 'shadowOffset' | 'transform' | 'textShadowOffset';
|
6
6
|
type UnistyleView = Omit<ViewStyle, NestedKeys>;
|
7
7
|
type UnistyleText = Omit<TextStyle, NestedKeys>;
|
@@ -36,6 +36,6 @@ export type UnistylesValues = {
|
|
36
36
|
export type StyleSheet = {
|
37
37
|
[styleName: string]: UnistylesValues | ((...args: any) => UnistylesValues);
|
38
38
|
};
|
39
|
-
export type StyleSheetWithSuperPowers = ((theme: UnistylesTheme,
|
39
|
+
export type StyleSheetWithSuperPowers = ((theme: UnistylesTheme, miniRuntime: UnistylesMiniRuntime) => StyleSheet) | StyleSheet;
|
40
40
|
export {};
|
41
41
|
//# sourceMappingURL=stylesheet.d.ts.map
|