react-native-unistyles 2.0.0-alpha.2 → 2.0.0-alpha.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. package/ios/UnistylesHelpers.h +4 -0
  2. package/ios/UnistylesHelpers.mm +20 -0
  3. package/ios/UnistylesModule.h +2 -2
  4. package/ios/UnistylesModule.mm +83 -38
  5. package/lib/commonjs/UnistyleRegistry.js +15 -7
  6. package/lib/commonjs/UnistyleRegistry.js.map +1 -1
  7. package/lib/commonjs/UnistylesRuntime.js +29 -15
  8. package/lib/commonjs/UnistylesRuntime.js.map +1 -1
  9. package/lib/commonjs/hooks/useDimensions.web.js +7 -5
  10. package/lib/commonjs/hooks/useDimensions.web.js.map +1 -1
  11. package/lib/commonjs/index.js +4 -3
  12. package/lib/commonjs/index.js.map +1 -1
  13. package/lib/commonjs/types/cxx.js +9 -5
  14. package/lib/commonjs/types/cxx.js.map +1 -1
  15. package/lib/commonjs/useInitialTheme.js +1 -1
  16. package/lib/commonjs/useInitialTheme.js.map +1 -1
  17. package/lib/commonjs/useUnistyles.js +5 -7
  18. package/lib/commonjs/useUnistyles.js.map +1 -1
  19. package/lib/commonjs/utils/breakpoints.js.map +1 -1
  20. package/lib/module/UnistyleRegistry.js +15 -7
  21. package/lib/module/UnistyleRegistry.js.map +1 -1
  22. package/lib/module/UnistylesRuntime.js +30 -16
  23. package/lib/module/UnistylesRuntime.js.map +1 -1
  24. package/lib/module/hooks/useDimensions.web.js +8 -6
  25. package/lib/module/hooks/useDimensions.web.js.map +1 -1
  26. package/lib/module/index.js +3 -2
  27. package/lib/module/index.js.map +1 -1
  28. package/lib/module/types/cxx.js +8 -4
  29. package/lib/module/types/cxx.js.map +1 -1
  30. package/lib/module/useInitialTheme.js +2 -2
  31. package/lib/module/useInitialTheme.js.map +1 -1
  32. package/lib/module/useUnistyles.js +5 -7
  33. package/lib/module/useUnistyles.js.map +1 -1
  34. package/lib/module/utils/breakpoints.js.map +1 -1
  35. package/lib/typescript/src/UnistyleRegistry.d.ts +3 -2
  36. package/lib/typescript/src/UnistyleRegistry.d.ts.map +1 -1
  37. package/lib/typescript/src/UnistylesRuntime.d.ts +14 -46
  38. package/lib/typescript/src/UnistylesRuntime.d.ts.map +1 -1
  39. package/lib/typescript/src/global.d.ts +1 -0
  40. package/lib/typescript/src/global.d.ts.map +1 -1
  41. package/lib/typescript/src/hooks/useDimensions.web.d.ts.map +1 -1
  42. package/lib/typescript/src/index.d.ts +3 -2
  43. package/lib/typescript/src/index.d.ts.map +1 -1
  44. package/lib/typescript/src/types/cxx.d.ts +21 -13
  45. package/lib/typescript/src/types/cxx.d.ts.map +1 -1
  46. package/lib/typescript/src/useStyles.d.ts +3 -39
  47. package/lib/typescript/src/useStyles.d.ts.map +1 -1
  48. package/lib/typescript/src/useUnistyles.d.ts +2 -38
  49. package/lib/typescript/src/useUnistyles.d.ts.map +1 -1
  50. package/package.json +12 -13
  51. package/react-native-unistyles.podspec +2 -1
  52. package/src/UnistyleRegistry.ts +19 -8
  53. package/src/UnistylesRuntime.ts +31 -16
  54. package/src/global.ts +3 -1
  55. package/src/hooks/useDimensions.web.ts +9 -6
  56. package/src/index.ts +4 -2
  57. package/src/types/cxx.ts +25 -14
  58. package/src/useInitialTheme.ts +2 -2
  59. package/src/useUnistyles.ts +5 -6
  60. package/src/utils/breakpoints.ts +1 -1
  61. package/ios/UnistylesRuntime.h +0 -30
  62. package/ios/UnistylesRuntime.mm +0 -191
  63. package/lib/typescript/examples/expo/src/App.d.ts +0 -3
  64. package/lib/typescript/examples/expo/src/App.d.ts.map +0 -1
  65. package/lib/typescript/examples/expo/src/examples/Cxx.d.ts +0 -3
  66. package/lib/typescript/examples/expo/src/examples/Cxx.d.ts.map +0 -1
  67. package/lib/typescript/examples/expo/src/examples/index.d.ts +0 -2
  68. package/lib/typescript/examples/expo/src/examples/index.d.ts.map +0 -1
  69. package/lib/typescript/examples/expo/src/index.d.ts +0 -2
  70. package/lib/typescript/examples/expo/src/index.d.ts.map +0 -1
  71. package/lib/typescript/examples/expo/src/styles/breakpoints.d.ts +0 -8
  72. package/lib/typescript/examples/expo/src/styles/breakpoints.d.ts.map +0 -1
  73. package/lib/typescript/examples/expo/src/styles/index.d.ts +0 -16
  74. package/lib/typescript/examples/expo/src/styles/index.d.ts.map +0 -1
  75. package/lib/typescript/examples/expo/src/styles/theme.d.ts +0 -40
  76. package/lib/typescript/examples/expo/src/styles/theme.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- import { UnistylesError } from './types';
1
+ import { ScreenOrientation, UnistylesError } from './types';
2
2
  export class UnistylesRuntime {
3
3
  constructor(unistylesBridge, registry) {
4
4
  this.unistylesBridge = unistylesBridge;
@@ -7,39 +7,53 @@ export class UnistylesRuntime {
7
7
  get colorScheme() {
8
8
  return this.unistylesBridge.colorScheme;
9
9
  }
10
- get breakpoints() {
11
- return this.registry.breakpoints;
10
+ get hasAdaptiveThemes() {
11
+ return this.unistylesBridge.hasAdaptiveThemes;
12
12
  }
13
13
  get sortedBreakpoints() {
14
14
  return this.registry.sortedBreakpointPairs;
15
15
  }
16
- get config() {
17
- return this.registry.config;
16
+ get themeName() {
17
+ return this.unistylesBridge.themeName;
18
18
  }
19
- get theme() {
20
- return this.unistylesBridge.theme;
21
- }
22
- get currentBreakpoint() {
19
+ get breakpoint() {
23
20
  return this.unistylesBridge.breakpoint;
24
21
  }
25
- setColorScheme = scheme => {
26
- if (scheme !== this.colorScheme) {
27
- this.unistylesBridge.useColorScheme(scheme);
22
+ get screen() {
23
+ return {
24
+ width: this.unistylesBridge.screenWidth,
25
+ height: this.unistylesBridge.screenHeight
26
+ };
27
+ }
28
+ get orientation() {
29
+ const {
30
+ width,
31
+ height
32
+ } = this.screen;
33
+ if (width > height) {
34
+ return ScreenOrientation.Landscape;
28
35
  }
29
- };
36
+ return ScreenOrientation.Portrait;
37
+ }
30
38
  setTheme = name => {
31
- if (name !== this.theme && this.hasTheme(name)) {
39
+ if (name !== this.themeName && this.hasTheme(name)) {
32
40
  this.unistylesBridge.useTheme(name);
33
41
  return true;
34
42
  }
35
- return false;
43
+ throw new Error(UnistylesError.ThemeNotRegistered);
36
44
  };
37
- hasTheme = name => name in this.registry.themes;
38
45
  getTheme = forName => {
46
+ if (this.registry.themeNames.length === 0) {
47
+ return {};
48
+ }
39
49
  if (!this.hasTheme(forName)) {
40
50
  throw new Error(UnistylesError.ThemeNotFound);
41
51
  }
42
52
  return this.registry.themes[forName];
43
53
  };
54
+ setAdaptiveThemes = enable => {
55
+ this.unistylesBridge.useAdaptiveThemes(enable);
56
+ };
57
+ hasTheme = name => name in this.registry.themes;
44
58
  }
45
59
  //# sourceMappingURL=UnistylesRuntime.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["UnistylesError","UnistylesRuntime","constructor","unistylesBridge","registry","colorScheme","breakpoints","sortedBreakpoints","sortedBreakpointPairs","config","theme","currentBreakpoint","breakpoint","setColorScheme","scheme","useColorScheme","setTheme","name","hasTheme","useTheme","themes","getTheme","forName","Error","ThemeNotFound"],"sourceRoot":"../../src","sources":["UnistylesRuntime.ts"],"mappings":"AAEA,SAA+BA,cAAc,QAAQ,SAAS;AAG9D,OAAO,MAAMC,gBAAgB,CAAC;EAC1BC,WAAWA,CAASC,eAAgC,EAAUC,QAA0B,EAAE;IAAA,KAAtED,eAAgC,GAAhCA,eAAgC;IAAA,KAAUC,QAA0B,GAA1BA,QAA0B;EAAG;EAE3F,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO,IAAI,CAACF,eAAe,CAACE,WAAW;EAC3C;EAEA,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO,IAAI,CAACF,QAAQ,CAACE,WAAW;EACpC;EAEA,IAAWC,iBAAiBA,CAAA,EAAG;IAC3B,OAAO,IAAI,CAACH,QAAQ,CAACI,qBAAqB;EAC9C;EAEA,IAAWC,MAAMA,CAAA,EAAG;IAChB,OAAO,IAAI,CAACL,QAAQ,CAACK,MAAM;EAC/B;EAEA,IAAWC,KAAKA,CAAA,EAAG;IACf,OAAO,IAAI,CAACP,eAAe,CAACO,KAAK;EACrC;EAEA,IAAWC,iBAAiBA,CAAA,EAAG;IAC3B,OAAO,IAAI,CAACR,eAAe,CAACS,UAAU;EAC1C;EAEOC,cAAc,GAAIC,MAA4B,IAAK;IACtD,IAAIA,MAAM,KAAK,IAAI,CAACT,WAAW,EAAE;MAC7B,IAAI,CAACF,eAAe,CAACY,cAAc,CAACD,MAAM,CAAC;IAC/C;EACJ,CAAC;EAEME,QAAQ,GAAIC,IAA2B,IAAK;IAC/C,IAAIA,IAAI,KAAK,IAAI,CAACP,KAAK,IAAI,IAAI,CAACQ,QAAQ,CAACD,IAAI,CAAC,EAAE;MAC5C,IAAI,CAACd,eAAe,CAACgB,QAAQ,CAACF,IAAI,CAAC;MAEnC,OAAO,IAAI;IACf;IAEA,OAAO,KAAK;EAChB,CAAC;EAEMC,QAAQ,GAAID,IAA2B,IAAKA,IAAI,IAAI,IAAI,CAACb,QAAQ,CAACgB,MAAM;EAExEC,QAAQ,GAAIC,OAA8B,IAAK;IAClD,IAAI,CAAC,IAAI,CAACJ,QAAQ,CAACI,OAAO,CAAC,EAAE;MACzB,MAAM,IAAIC,KAAK,CAACvB,cAAc,CAACwB,aAAa,CAAC;IACjD;IAEA,OAAO,IAAI,CAACpB,QAAQ,CAACgB,MAAM,CAACE,OAAO,CAAC;EACxC,CAAC;AACL"}
1
+ {"version":3,"names":["ScreenOrientation","UnistylesError","UnistylesRuntime","constructor","unistylesBridge","registry","colorScheme","hasAdaptiveThemes","sortedBreakpoints","sortedBreakpointPairs","themeName","breakpoint","screen","width","screenWidth","height","screenHeight","orientation","Landscape","Portrait","setTheme","name","hasTheme","useTheme","Error","ThemeNotRegistered","getTheme","forName","themeNames","length","ThemeNotFound","themes","setAdaptiveThemes","enable","useAdaptiveThemes"],"sourceRoot":"../../src","sources":["UnistylesRuntime.ts"],"mappings":"AAEA,SAASA,iBAAiB,EAAEC,cAAc,QAAQ,SAAS;AAG3D,OAAO,MAAMC,gBAAgB,CAA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OAA8B,IAAK;IAClD,IAAI,IAAI,CAACtB,QAAQ,CAACuB,UAAU,CAACC,MAAM,KAAK,CAAC,EAAE;MACvC,OAAO,CAAC,CAAC;IACb;IAEA,IAAI,CAAC,IAAI,CAACP,QAAQ,CAACK,OAAO,CAAC,EAAE;MACzB,MAAM,IAAIH,KAAK,CAACvB,cAAc,CAAC6B,aAAa,CAAC;IACjD;IAEA,OAAO,IAAI,CAACzB,QAAQ,CAAC0B,MAAM,CAACJ,OAAO,CAAC;EACxC,CAAC;EAEMK,iBAAiB,GAAIC,MAAe,IAAK;IAC5C,IAAI,CAAC7B,eAAe,CAAC8B,iBAAiB,CAACD,MAAM,CAAC;EAClD,CAAC;EAEOX,QAAQ,GAAID,IAA2B,IAAKA,IAAI,IAAI,IAAI,CAAChB,QAAQ,CAAC0B,MAAM;AACpF"}
@@ -1,11 +1,13 @@
1
- import { useEffect, useRef, useState } from 'react';
2
- import { isServer } from '../utils';
1
+ import { useEffect, useLayoutEffect, useRef, useState } from 'react';
3
2
  export const useDimensions = () => {
4
3
  const timerRef = useRef();
5
- const [screenSize, setScreenSize] = useState({
6
- width: isServer ? 0 : window.innerWidth,
7
- height: isServer ? 0 : window.innerHeight
8
- });
4
+ const [screenSize, setScreenSize] = useState({});
5
+ useLayoutEffect(() => {
6
+ setScreenSize({
7
+ width: window.innerWidth,
8
+ height: window.innerHeight
9
+ });
10
+ }, []);
9
11
  useEffect(() => {
10
12
  const handleResize = () => {
11
13
  clearTimeout(timerRef.current);
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useRef","useState","isServer","useDimensions","timerRef","screenSize","setScreenSize","width","window","innerWidth","height","innerHeight","handleResize","clearTimeout","current","setTimeout","addEventListener","removeEventListener"],"sourceRoot":"../../../src","sources":["hooks/useDimensions.web.ts"],"mappings":"AAAA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAEnD,SAASC,QAAQ,QAAQ,UAAU;AAEnC,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAkB;EAC3C,MAAMC,QAAQ,GAAGJ,MAAM,CAAgC,CAAC;EACxD,MAAM,CAACK,UAAU,EAAEC,aAAa,CAAC,GAAGL,QAAQ,CAAa;IACrDM,KAAK,EAAEL,QAAQ,GAAG,CAAC,GAAGM,MAAM,CAACC,UAAU;IACvCC,MAAM,EAAER,QAAQ,GAAG,CAAC,GAAGM,MAAM,CAACG;EAClC,CAAC,CAAC;EAEFZ,SAAS,CAAC,MAAM;IACZ,MAAMa,YAAY,GAAGA,CAAA,KAAM;MACvBC,YAAY,CAACT,QAAQ,CAACU,OAAO,CAAC;MAE9BV,QAAQ,CAACU,OAAO,GAAGC,UAAU,CAAC,MAAMT,aAAa,CAAC;QAC9CC,KAAK,EAAEC,MAAM,CAACC,UAAU;QACxBC,MAAM,EAAEF,MAAM,CAACG;MACnB,CAAC,CAAC,EAAE,GAAG,CAAC;IACZ,CAAC;IAEDH,MAAM,CAACQ,gBAAgB,CAAC,QAAQ,EAAEJ,YAAY,CAAC;IAE/C,OAAO,MAAM;MACTJ,MAAM,CAACS,mBAAmB,CAAC,QAAQ,EAAEL,YAAY,CAAC;MAClDC,YAAY,CAACT,QAAQ,CAACU,OAAO,CAAC;IAClC,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOT,UAAU;AACrB,CAAC"}
1
+ {"version":3,"names":["useEffect","useLayoutEffect","useRef","useState","useDimensions","timerRef","screenSize","setScreenSize","width","window","innerWidth","height","innerHeight","handleResize","clearTimeout","current","setTimeout","addEventListener","removeEventListener"],"sourceRoot":"../../../src","sources":["hooks/useDimensions.web.ts"],"mappings":"AAAA,SAASA,SAAS,EAAEC,eAAe,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAGpE,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAkB;EAC3C,MAAMC,QAAQ,GAAGH,MAAM,CAAgC,CAAC;EACxD,MAAM,CAACI,UAAU,EAAEC,aAAa,CAAC,GAAGJ,QAAQ,CAAa,CAAC,CAAe,CAAC;EAE1EF,eAAe,CAAC,MAAM;IAClBM,aAAa,CAAC;MACVC,KAAK,EAAEC,MAAM,CAACC,UAAU;MACxBC,MAAM,EAAEF,MAAM,CAACG;IACnB,CAAC,CAAC;EACN,CAAC,EAAE,EAAE,CAAC;EAENZ,SAAS,CAAC,MAAM;IACZ,MAAMa,YAAY,GAAGA,CAAA,KAAM;MACvBC,YAAY,CAACT,QAAQ,CAACU,OAAO,CAAC;MAE9BV,QAAQ,CAACU,OAAO,GAAGC,UAAU,CAAC,MAAMT,aAAa,CAAC;QAC9CC,KAAK,EAAEC,MAAM,CAACC,UAAU;QACxBC,MAAM,EAAEF,MAAM,CAACG;MACnB,CAAC,CAAC,EAAE,GAAG,CAAC;IACZ,CAAC;IAEDH,MAAM,CAACQ,gBAAgB,CAAC,QAAQ,EAAEJ,YAAY,CAAC;IAE/C,OAAO,MAAM;MACTJ,MAAM,CAACS,mBAAmB,CAAC,QAAQ,EAAEL,YAAY,CAAC;MAClDC,YAAY,CAACT,QAAQ,CAACU,OAAO,CAAC;IAClC,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOT,UAAU;AACrB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { unistyles } from './Unistyles';
2
- import { UnistylesColorScheme } from './types';
2
+ import { ScreenOrientation } from './types';
3
3
  export { useInitialTheme } from './useInitialTheme';
4
4
  export { useStyles } from './useStyles';
5
5
  export { createStyleSheet } from './createStyleSheet';
@@ -14,6 +14,7 @@ const UnistylesRegistry = {
14
14
  addBreakpoints,
15
15
  addConfig
16
16
  };
17
+ export const __dangerouslyUnregister = unistyles.registry.dangerouslyUnregister;
17
18
  export { UnistylesRuntime, UnistylesRegistry };
18
- export { UnistylesColorScheme };
19
+ export { ScreenOrientation };
19
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["unistyles","UnistylesColorScheme","useInitialTheme","useStyles","createStyleSheet","addThemes","addBreakpoints","addConfig","registry","UnistylesRuntime","runtime","UnistylesRegistry"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,SAASA,SAAS,QAAQ,aAAa;AAEvC,SAASC,oBAAoB,QAAQ,SAAS;AAE9C,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,MAAM;EAAEC,SAAS;EAAEC,cAAc;EAAEC;AAAW,CAAC,GAAGP,SAAS,CAACQ,QAAQ;AACpE,MAAMC,gBAAgB,GAAGT,SAAS,CAACU,OAAO;AAC1C,MAAMC,iBAAiB,GAAG;EACtBN,SAAS;EACTC,cAAc;EACdC;AACJ,CAAC;AAED,SACIE,gBAAgB,EAChBE,iBAAiB;AAGrB,SACIV,oBAAoB"}
1
+ {"version":3,"names":["unistyles","ScreenOrientation","useInitialTheme","useStyles","createStyleSheet","addThemes","addBreakpoints","addConfig","registry","UnistylesRuntime","runtime","UnistylesRegistry","__dangerouslyUnregister","dangerouslyUnregister"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,SAASA,SAAS,QAAQ,aAAa;AAEvC,SAASC,iBAAiB,QAAQ,SAAS;AAE3C,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,MAAM;EAAEC,SAAS;EAAEC,cAAc;EAAEC;AAAW,CAAC,GAAGP,SAAS,CAACQ,QAAQ;AACpE,MAAMC,gBAAgB,GAAGT,SAAS,CAACU,OAAO;AAC1C,MAAMC,iBAAiB,GAAG;EACtBN,SAAS;EACTC,cAAc;EACdC;AACJ,CAAC;AAED,OAAO,MAAMK,uBAAuB,GAAGZ,SAAS,CAACQ,QAAQ,CAACK,qBAAqB;AAE/E,SACIJ,gBAAgB,EAChBE,iBAAiB;AAGrB,SACIV,iBAAiB"}
@@ -1,7 +1,7 @@
1
- export let UnistylesColorScheme = /*#__PURE__*/function (UnistylesColorScheme) {
2
- UnistylesColorScheme["System"] = "system";
3
- UnistylesColorScheme["Manual"] = "manual";
4
- return UnistylesColorScheme;
1
+ export let ScreenOrientation = /*#__PURE__*/function (ScreenOrientation) {
2
+ ScreenOrientation[ScreenOrientation["Portrait"] = 1] = "Portrait";
3
+ ScreenOrientation[ScreenOrientation["Landscape"] = 2] = "Landscape";
4
+ return ScreenOrientation;
5
5
  }({});
6
6
  export let CxxUnistylesEventTypes = /*#__PURE__*/function (CxxUnistylesEventTypes) {
7
7
  CxxUnistylesEventTypes["Theme"] = "theme";
@@ -12,6 +12,10 @@ export let CxxUnistylesEventTypes = /*#__PURE__*/function (CxxUnistylesEventType
12
12
  export let UnistylesError = /*#__PURE__*/function (UnistylesError) {
13
13
  UnistylesError["RuntimeUnavailable"] = "UNISTYLES_ERROR_RUNTIME_UNAVAILABLE";
14
14
  UnistylesError["ThemeNotFound"] = "UNISTYLES_ERROR_THEME_NOT_FOUND";
15
+ UnistylesError["ThemeNotRegistered"] = "UNISTYLES_ERROR_THEME_NOT_REGISTERED";
16
+ UnistylesError["ThemesCannotBeEmpty"] = "UNISTYLES_ERROR_THEMES_CANNOT_BE_EMPTY";
17
+ UnistylesError["BreakpointsCannotBeEmpty"] = "UNISTYLES_ERROR_BREAKPOINTS_CANNOT_BE_EMPTY";
18
+ UnistylesError["BreakpointsMustStartFromZero"] = "UNISTYLES_ERROR_BREAKPOINTS_MUST_START_FROM_ZERO";
15
19
  return UnistylesError;
16
20
  }({});
17
21
  //# sourceMappingURL=cxx.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["UnistylesColorScheme","CxxUnistylesEventTypes","UnistylesError"],"sourceRoot":"../../../src","sources":["types/cxx.ts"],"mappings":"AAGA,WAAYA,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAwBhC,WAAYC,sBAAsB,0BAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAA,OAAtBA,sBAAsB;AAAA;AA8BlC,WAAYC,cAAc,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA"}
1
+ {"version":3,"names":["ScreenOrientation","CxxUnistylesEventTypes","UnistylesError"],"sourceRoot":"../../../src","sources":["types/cxx.ts"],"mappings":"AASA,WAAYA,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;AAyB7B,WAAYC,sBAAsB,0BAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAA,OAAtBA,sBAAsB;AAAA;AA8BlC,WAAYC,cAAc,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA"}
@@ -1,6 +1,6 @@
1
- import { useRef } from 'react';
1
+ import { useMemo } from 'react';
2
2
  import { unistyles } from './Unistyles';
3
3
  export const useInitialTheme = forName => {
4
- useRef(unistyles.runtime.setTheme(forName));
4
+ useMemo(() => unistyles.runtime.setTheme(forName), []);
5
5
  };
6
6
  //# sourceMappingURL=useInitialTheme.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useRef","unistyles","useInitialTheme","forName","runtime","setTheme"],"sourceRoot":"../../src","sources":["useInitialTheme.ts"],"mappings":"AAAA,SAASA,MAAM,QAAQ,OAAO;AAC9B,SAASC,SAAS,QAAQ,aAAa;AAGvC,OAAO,MAAMC,eAAe,GAAIC,OAA8B,IAAK;EAC/DH,MAAM,CAACC,SAAS,CAACG,OAAO,CAACC,QAAQ,CAACF,OAAO,CAAC,CAAC;AAC/C,CAAC"}
1
+ {"version":3,"names":["useMemo","unistyles","useInitialTheme","forName","runtime","setTheme"],"sourceRoot":"../../src","sources":["useInitialTheme.ts"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,SAAS,QAAQ,aAAa;AAGvC,OAAO,MAAMC,eAAe,GAAIC,OAA8B,IAAK;EAC/DH,OAAO,CAAC,MAAMC,SAAS,CAACG,OAAO,CAACC,QAAQ,CAACF,OAAO,CAAC,EAAE,EAAE,CAAC;AAC1D,CAAC"}
@@ -4,8 +4,8 @@ import { CxxUnistylesEventTypes } from './types';
4
4
  import { unistyles } from './Unistyles';
5
5
  const unistylesEvents = new NativeEventEmitter(NativeModules.Unistyles);
6
6
  export const useUnistyles = () => {
7
- const [theme, setTheme] = useState(unistyles.runtime.getTheme(unistyles.runtime.theme));
8
- const [breakpoint, setBreakpoint] = useState(unistyles.runtime.currentBreakpoint);
7
+ const [theme, setTheme] = useState(unistyles.runtime.getTheme(unistyles.runtime.themeName));
8
+ const [breakpoint, setBreakpoint] = useState(unistyles.runtime.breakpoint);
9
9
  const [screenSize, setScreenSize] = useState({
10
10
  width: 0,
11
11
  height: 0
@@ -16,9 +16,10 @@ export const useUnistyles = () => {
16
16
  case CxxUnistylesEventTypes.Theme:
17
17
  {
18
18
  const themeEvent = event;
19
- setTheme(unistyles.runtime.getTheme(themeEvent.payload.currentTheme));
19
+ setTheme(unistyles.runtime.getTheme(themeEvent.payload.themeName));
20
20
  return;
21
21
  }
22
+ // this event is not available on mobile
22
23
  case CxxUnistylesEventTypes.Size:
23
24
  {
24
25
  const sizeEvent = event;
@@ -26,15 +27,12 @@ export const useUnistyles = () => {
26
27
  width: sizeEvent.payload.width,
27
28
  height: sizeEvent.payload.height
28
29
  });
29
- // todo
30
- // setBreakpoint(unistyles.runtime.currentBreakpoint)
31
-
32
30
  return;
33
31
  }
34
32
  case CxxUnistylesEventTypes.Breakpoint:
35
33
  {
36
34
  const breakpointEvent = event;
37
- setBreakpoint(breakpointEvent.payload.currentBreakpoint);
35
+ setBreakpoint(breakpointEvent.payload.breakpoint);
38
36
  return;
39
37
  }
40
38
  default:
@@ -1 +1 @@
1
- {"version":3,"names":["NativeEventEmitter","NativeModules","useEffect","useState","CxxUnistylesEventTypes","unistyles","unistylesEvents","Unistyles","useUnistyles","theme","setTheme","runtime","getTheme","breakpoint","setBreakpoint","currentBreakpoint","screenSize","setScreenSize","width","height","subscription","addListener","event","type","Theme","themeEvent","payload","currentTheme","Size","sizeEvent","Breakpoint","breakpointEvent","remove"],"sourceRoot":"../../src","sources":["useUnistyles.ts"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAChE,SAASC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAO3C,SAASC,sBAAsB,QAAQ,SAAS;AAChD,SAASC,SAAS,QAAQ,aAAa;AAEvC,MAAMC,eAAe,GAAG,IAAIN,kBAAkB,CAACC,aAAa,CAACM,SAAS,CAAC;AAEvE,OAAO,MAAMC,YAAY,GAAGA,CAAA,KAAM;EAC9B,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGP,QAAQ,CAACE,SAAS,CAACM,OAAO,CAACC,QAAQ,CAACP,SAAS,CAACM,OAAO,CAACF,KAAK,CAAC,CAAC;EACvF,MAAM,CAACI,UAAU,EAAEC,aAAa,CAAC,GAAGX,QAAQ,CAACE,SAAS,CAACM,OAAO,CAACI,iBAAiB,CAAC;EACjF,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGd,QAAQ,CAAC;IACzCe,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACZ,CAAC,CAAC;EAEFjB,SAAS,CAAC,MAAM;IACZ,MAAMkB,YAAY,GAAGd,eAAe,CAACe,WAAW,CAC5C,UAAU,EACTC,KAAsB,IAAK;MACxB,QAAQA,KAAK,CAACC,IAAI;QACd,KAAKnB,sBAAsB,CAACoB,KAAK;UAAE;YAC/B,MAAMC,UAAU,GAAGH,KAA+B;YAElDZ,QAAQ,CAACL,SAAS,CAACM,OAAO,CAACC,QAAQ,CAACa,UAAU,CAACC,OAAO,CAACC,YAAY,CAAC,CAAC;YAErE;UACJ;QACA,KAAKvB,sBAAsB,CAACwB,IAAI;UAAE;YAC9B,MAAMC,SAAS,GAAGP,KAA8B;YAEhDL,aAAa,CAAC;cACVC,KAAK,EAAEW,SAAS,CAACH,OAAO,CAACR,KAAK;cAC9BC,MAAM,EAAEU,SAAS,CAACH,OAAO,CAACP;YAC9B,CAAC,CAAC;YACF;YACA;;YAEA;UACJ;QACA,KAAKf,sBAAsB,CAAC0B,UAAU;UAAE;YACpC,MAAMC,eAAe,GAAGT,KAAoC;YAE5DR,aAAa,CAACiB,eAAe,CAACL,OAAO,CAACX,iBAAiB,CAAC;YAExD;UACJ;QACA;UACI;MACR;IACJ,CACJ,CAAC;IAED,OAAOK,YAAY,CAACY,MAAM;EAC9B,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACHvB,KAAK;IACLI,UAAU;IACVG;EACJ,CAAC;AACL,CAAC"}
1
+ {"version":3,"names":["NativeEventEmitter","NativeModules","useEffect","useState","CxxUnistylesEventTypes","unistyles","unistylesEvents","Unistyles","useUnistyles","theme","setTheme","runtime","getTheme","themeName","breakpoint","setBreakpoint","screenSize","setScreenSize","width","height","subscription","addListener","event","type","Theme","themeEvent","payload","Size","sizeEvent","Breakpoint","breakpointEvent","remove"],"sourceRoot":"../../src","sources":["useUnistyles.ts"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAChE,SAASC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAO3C,SAASC,sBAAsB,QAAQ,SAAS;AAChD,SAASC,SAAS,QAAQ,aAAa;AAEvC,MAAMC,eAAe,GAAG,IAAIN,kBAAkB,CAACC,aAAa,CAACM,SAAS,CAAC;AAEvE,OAAO,MAAMC,YAAY,GAAGA,CAAA,KAAM;EAC9B,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGP,QAAQ,CAACE,SAAS,CAACM,OAAO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ints","breakpoints","sortedPairs","Object","entries","sort","breakpoint1","breakpoint2","value1","value2","sortedBreakpoints","freeze","fromEntries","breakpointValues","values","firstBreakpoint","length","Set","size","getBreakpointFromScreenWidth","width","breakpointEntries","key","find","_ref","index","otherBreakpoints","value","minVal","maxVal","getValueForBreakpoint","breakpoint","screenSize","customMediaQueries","filter","_ref2","customMediaQueryKey","unifiedKey","toLowerCase","directBreakpoint","breakpointPairs","runtime","currentBreakpoint","findIndex","_ref3","availableBreakpoints","_ref4","map","_ref5","undefined"],"sourceRoot":"../../../src","sources":["utils/breakpoints.ts"],"mappings":"AAAA,SAASA,SAAS,QAAQ,cAAc;AACxC,SAASC,UAAU,QAAQ,UAAU;AAErC,SAASC,yBAAyB,EAAEC,YAAY,QAAQ,gBAAgB;AAGxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,0BAA0B,GAAIC,WAAiC,IAA2B;EACnG,MAAMC,WAAW,GAAGC,MAAM,CACrBC,OAAO,CAACH,WAAW,CAAC,CACpBI,IAAI,CAAC,CAACC,WAAW,EAAEC,WAAW,KAAK;IAChC,MAAM,GAAGC,MAAM,CAAC,GAAGF,WAAW;IAC9B,MAAM,GAAGG,MAAM,CAAC,GAAGF,WAAW;IAE9B,OAAQC,MAAM,GAAeC,MAAiB;EAClD,CAAC,CAAC;EAEN,MAAMC,iBAAiB,GAAIP,MAAM,CAACQ,MAAM,CAACR,MAAM,CAACS,WAAW,CAACV,WAAW,CAAC,CAAyB;EACjG,MAAMW,gBAAgB,GAAGV,MAAM,CAACW,MAAM,CAACJ,iBAAiB,CAAC;EACzD,MAAM,CAACK,eAAe,CAAC,GAAGF,gBAAgB;EAE1C,IAAIE,eAAe,KAAK,CAAC,EAAE;IACvBlB,UAAU,CAAC,oCAAoC,CAAC;EACpD;EAEA,IAAIgB,gBAAgB,CAACG,MAAM,KAAK,IAAIC,GAAG,CAACJ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,KAAK,CAACS,mBAAmB,CAAC;EACrC;;EAEA;EACA,MAAMC,UAAU,GAAGN,UAAU,EAAEO,WAAW,CAAC,CAAuB;EAClE,MAAMC,gBAAgB,GAAGZ,KAAK,CAACU,UAAU,CAAC;;EAE1C;EACA,IAAIE,gBAAgB,IAAKF,UAAU,IAAIV,KAAM,EAAE;IAC3C,OAAOY,gBAAgB;EAC3B;;EAEA;EACA,MAAMC,eAAe,GAAG5C,SAAS,CAAC6C,OAAO,CAAC/B,iBAAiB;EAC3D,MAAMgC,iBAAiB,GAAGF,eAAe,CACpCG,SAAS,CAACC,KAAA;IAAA,IAAC,CAACtB,GAAG,CAAC,GAAAsB,KAAA;IAAA,OAAKtB,GAAG,KAAKe,UAAU;EAAA,EAAC;EAE7C,MAAMQ,oBAAoB,GAAGL,eAAe,CACvCN,MAAM,CAAC,CAAAY,KAAA,EAAQrB,KAAK;IAAA,IAAZ,CAACH,GAAG,CAAC,GAAAwB,KAAA;IAAA,OAAYrB,KAAK,GAAGiB,iBAAiB,IAAIpB,GAAG,IAAIA,GAAG,IAAIK,KAAK;EAAA,EAAC,CAC1EoB,GAAG,CAACC,KAAA;IAAA,IAAC,CAAC1B,GAAG,CAAC,GAAA0B,KAAA;IAAA,OAAK1B,GAAG;EAAA,EAAC;EAExB,OAAOkB,eAAe,CAACxB,MAAM,GAAG,CAAC,GAC3BW,KAAK,CAACkB,oBAAoB,CAACA,oBAAoB,CAAC7B,MAAM,GAAG,CAAC,CAAC,CAAwC,GACnGiC,SAAS;AACnB,CAAC"}
1
+ {"version":3,"names":["unistyles","throwError","getKeyForCustomMediaQuery","isMediaQuery","sortAndValidateBreakpoints","breakpoints","sortedPairs","Object","entries","sort","breakpoint1","breakpoint2","value1","value2","sortedBreakpoints","freeze","fromEntries","breakpointValues","values","firstBreakpoint","length","Set","size","getBreakpointFromScreenWidth","width","breakpointEntries","key","find","_ref","index","otherBreakpoints","value","minVal","maxVal","getValueForBreakpoint","breakpoint","screenSize","customMediaQueries","filter","_ref2","customMediaQueryKey","unifiedKey","toLowerCase","directBreakpoint","breakpointPairs","runtime","currentBreakpoint","findIndex","_ref3","availableBreakpoints","_ref4","map","_ref5","undefined"],"sourceRoot":"../../../src","sources":["utils/breakpoints.ts"],"mappings":"AAAA,SAASA,SAAS,QAAQ,cAAc;AACxC,SAASC,UAAU,QAAQ,UAAU;AAErC,SAASC,yBAAyB,EAAEC,YAAY,QAAQ,gBAAgB;AAGxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,0BAA0B,GAAIC,WAAiC,IAA2B;EACnG,MAAMC,WAAW,GAAGC,MAAM,CACrBC,OAAO,CAACH,WAAW,CAAC,CACpBI,IAAI,CAAC,CAACC,WAAW,EAAEC,WAAW,KAAK;IAChC,MAAM,GAAGC,MAAM,CAAC,GAAGF,WAAW;IAC9B,MAAM,GAAGG,MAAM,CAAC,GAAGF,WAAW;IAE9B,OAAQC,MAAM,GAAeC,MAAiB;EAClD,CAAC,CAAC;EAEN,MAAMC,iBAAiB,GAAIP,MAAM,CAACQ,MAAM,CAACR,MAAM,CAACS,WAAW,CAACV,WAAW,CAAC,CAAyB;EACjG,MAAMW,gBAAgB,GAAGV,MAAM,CAACW,MAAM,CAACJ,iBAAiB,CAAC;EACzD,MAAM,CAACK,eAAe,CAAC,GAAGF,gBAAgB;EAE1C,IAAIE,eAAe,KAAK,CAAC,EAAE;IACvBlB,UAAU,CAAC,oCAAoC,CAAC;EACpD;EAEA,IAAIgB,gBAAgB,CAACG,MAAM,KAAK,IAAIC,GAAG,CAACJ,gBAAgB,CAAC,CAACK,IAAI,EAAE;IAC5DrB,UAAU,CAAC,kCAAkC,CAAC;EAClD;EAEA,OAAOa,iBAAiB;AAC5B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMS,4BA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M,EAAE;IAC3C,OAAOY,gBAAgB;EAC3B;;EAEA;EACA,MAAMC,eAAe,GAAG5C,SAAS,CAAC6C,OAAO,CAAC/B,iBAAiB;EAC3D,MAAMgC,iBAAiB,GAAGF,eAAe,CACpCG,SAAS,CAACC,KAAA;IAAA,IAAC,CAACtB,GAAG,CAAC,GAAAsB,KAAA;IAAA,OAAKtB,GAAG,KAAKe,UAAU;EAAA,EAAC;EAE7C,MAAMQ,oBAAoB,GAAGL,eAAe,CACvCN,MAAM,CAAC,CAAAY,KAAA,EAAQrB,KAAK;IAAA,IAAZ,CAACH,GAAG,CAAC,GAAAwB,KAAA;IAAA,OAAYrB,KAAK,GAAGiB,iBAAiB,IAAIpB,GAAG,IAAIA,GAAG,IAAIK,KAAK;EAAA,EAAC,CAC1EoB,GAAG,CAACC,KAAA;IAAA,IAAC,CAAC1B,GAAG,CAAC,GAAA0B,KAAA;IAAA,OAAK1B,GAAG;EAAA,EAAC;EAExB,OAAOkB,eAAe,CAACxB,MAAM,GAAG,CAAC,GAC3BW,KAAK,CAACkB,oBAAoB,CAACA,oBAAoB,CAAC7B,MAAM,GAAG,CAAC,CAAC,CAAwC,GACnGiC,SAAS;AACnB,CAAC"}
@@ -2,14 +2,15 @@ import type { UnistylesBridge, UnistylesConfig } from './types';
2
2
  import type { UnistylesThemes, UnistylesBreakpoints } from './global';
3
3
  export declare class UnistyleRegistry {
4
4
  private unistylesBridge;
5
- isClosed: boolean;
5
+ config: UnistylesConfig;
6
+ themeNames: Array<keyof UnistylesThemes>;
6
7
  themes: UnistylesThemes;
7
8
  breakpoints: UnistylesBreakpoints;
8
9
  sortedBreakpointPairs: Array<[keyof UnistylesBreakpoints, UnistylesBreakpoints[keyof UnistylesBreakpoints]]>;
9
- config: UnistylesConfig;
10
10
  constructor(unistylesBridge: UnistylesBridge);
11
11
  addThemes: (themes: UnistylesThemes) => this;
12
12
  addBreakpoints: (breakpoints: UnistylesBreakpoints) => this;
13
13
  addConfig: (config: UnistylesConfig) => this;
14
+ dangerouslyUnregister: () => void;
14
15
  }
15
16
  //# sourceMappingURL=UnistyleRegistry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UnistyleRegistry.d.ts","sourceRoot":"","sources":["../../../src/UnistyleRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAErE,qBAAa,gBAAgB;IAOb,OAAO,CAAC,eAAe;IAN5B,QAAQ,UAAQ;IAChB,MAAM,EAAE,eAAe,CAAwB;IAC/C,WAAW,EAAE,oBAAoB,CAA6B;IAC9D,qBAAqB,EAAE,KAAK,CAAC,CAAC,MAAM,oBAAoB,EAAE,oBAAoB,CAAC,MAAM,oBAAoB,CAAC,CAAC,CAAC,CAAK;IACjH,MAAM,EAAE,eAAe,CAAK;gBAEf,eAAe,EAAE,eAAe;IAE7C,SAAS,WAAY,eAAe,UAI1C;IAEM,cAAc,gBAAiB,oBAAoB,UAKzD;IAEM,SAAS,WAAY,eAAe,UAY1C;CACJ"}
1
+ {"version":3,"file":"UnistyleRegistry.d.ts","sourceRoot":"","sources":["../../../src/UnistyleRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAErE,qBAAa,gBAAgB;IAOb,OAAO,CAAC,eAAe;IAN5B,MAAM,EAAE,eAAe,CAAK;IAC5B,UAAU,EAAE,KAAK,CAAC,MAAM,eAAe,CAAC,CAAK;IAC7C,MAAM,EAAE,eAAe,CAAwB;IAC/C,WAAW,EAAE,oBAAoB,CAA6B;IAC9D,qBAAqB,EAAE,KAAK,CAAC,CAAC,MAAM,oBAAoB,EAAE,oBAAoB,CAAC,MAAM,oBAAoB,CAAC,CAAC,CAAC,CAAK;gBAEpG,eAAe,EAAE,eAAe;IAE7C,SAAS,WAAY,eAAe,UAS1C;IAEM,cAAc,gBAAiB,oBAAoB,UAKzD;IAEM,SAAS,WAAY,eAAe,UAQ1C;IAEM,qBAAqB,aAQ3B;CACJ"}
@@ -1,56 +1,24 @@
1
1
  import type { UnistylesBridge } from './types';
2
2
  import type { UnistyleRegistry } from './UnistyleRegistry';
3
- import { UnistylesColorScheme } from './types';
3
+ import { ScreenOrientation } from './types';
4
4
  import type { UnistylesThemes } from './global';
5
5
  export declare class UnistylesRuntime {
6
6
  private unistylesBridge;
7
7
  private registry;
8
8
  constructor(unistylesBridge: UnistylesBridge, registry: UnistyleRegistry);
9
- get colorScheme(): UnistylesColorScheme;
10
- get breakpoints(): import("./global").UnistylesBreakpoints;
11
- get sortedBreakpoints(): [keyof import("./global").UnistylesBreakpoints, number][];
12
- get config(): import("./types").UnistylesConfig;
13
- get theme(): keyof UnistylesThemes;
14
- get currentBreakpoint(): keyof import("./global").UnistylesBreakpoints;
15
- setColorScheme: (scheme: UnistylesColorScheme) => void;
16
- setTheme: (name: keyof UnistylesThemes) => boolean;
17
- hasTheme: (name: keyof UnistylesThemes) => boolean;
18
- getTheme: (forName: keyof UnistylesThemes) => {
19
- colors: {
20
- backgroundColor: string;
21
- typography: string;
22
- accent: string;
23
- barbie: string;
24
- oak: string;
25
- sky: string;
26
- fog: string;
27
- aloes: string;
28
- blood: string;
29
- };
30
- } | {
31
- colors: {
32
- backgroundColor: string;
33
- typography: string;
34
- accent: string;
35
- barbie: string;
36
- oak: string;
37
- sky: string;
38
- fog: string;
39
- aloes: string;
40
- blood: string;
41
- };
42
- } | {
43
- colors: {
44
- backgroundColor: string;
45
- typography: string;
46
- accent: string;
47
- barbie: string;
48
- oak: string;
49
- sky: string;
50
- fog: string;
51
- aloes: string;
52
- blood: string;
53
- };
9
+ get colorScheme(): import("./types").ColorSchemeName;
10
+ get hasAdaptiveThemes(): boolean;
11
+ get sortedBreakpoints(): ["default", 0 | undefined][];
12
+ get themeName(): never;
13
+ get breakpoint(): "default";
14
+ get screen(): {
15
+ width: number;
16
+ height: number;
54
17
  };
18
+ get orientation(): ScreenOrientation;
19
+ setTheme: (name: keyof UnistylesThemes) => boolean;
20
+ getTheme: (forName: keyof UnistylesThemes) => never;
21
+ setAdaptiveThemes: (enable: boolean) => void;
22
+ private hasTheme;
55
23
  }
56
24
  //# sourceMappingURL=UnistylesRuntime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UnistylesRuntime.d.ts","sourceRoot":"","sources":["../../../src/UnistylesRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAkB,MAAM,SAAS,CAAA;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,qBAAa,gBAAgB;IACb,OAAO,CAAC,eAAe;IAAmB,OAAO,CAAC,QAAQ;gBAAlD,eAAe,EAAE,eAAe,EAAU,QAAQ,EAAE,gBAAgB;IAExF,IAAW,WAAW,yBAErB;IAED,IAAW,WAAW,4CAErB;IAED,IAAW,iBAAiB,8DAE3B;IAED,IAAW,MAAM,sCAEhB;IAED,IAAW,KAAK,0BAEf;IAED,IAAW,iBAAiB,kDAE3B;IAEM,cAAc,WAAY,oBAAoB,UAIpD;IAEM,QAAQ,SAAU,MAAM,eAAe,aAQ7C;IAEM,QAAQ,SAAU,MAAM,eAAe,aAAiC;IAExE,QAAQ,YAAa,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAMhD;CACJ"}
1
+ {"version":3,"file":"UnistylesRuntime.d.ts","sourceRoot":"","sources":["../../../src/UnistylesRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAkB,MAAM,SAAS,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,qBAAa,gBAAgB;IACb,OAAO,CAAC,eAAe;IAAmB,OAAO,CAAC,QAAQ;gBAAlD,eAAe,EAAE,eAAe,EAAU,QAAQ,EAAE,gBAAgB;IAExF,IAAW,WAAW,sCAErB;IAED,IAAW,iBAAiB,YAE3B;IAED,IAAW,iBAAiB,iCAE3B;IAED,IAAW,SAAS,UAEnB;IAED,IAAW,UAAU,cAEpB;IAED,IAAW,MAAM;;;MAKhB;IAED,IAAW,WAAW,sBAQrB;IAEM,QAAQ,SAAU,MAAM,eAAe,aAQ7C;IAEM,QAAQ,YAAa,MAAM,eAAe,WAUhD;IAEM,iBAAiB,WAAY,OAAO,UAE1C;IAED,OAAO,CAAC,QAAQ,CAAgE;CACnF"}
@@ -1,5 +1,6 @@
1
1
  export interface UnistylesThemes {
2
2
  }
3
3
  export interface UnistylesBreakpoints {
4
+ default?: 0;
4
5
  }
5
6
  //# sourceMappingURL=global.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../src/global.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;CAAG;AACnC,MAAM,WAAW,oBAAoB;CAAG"}
1
+ {"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../src/global.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;CAAG;AACnC,MAAM,WAAW,oBAAoB;IACjC,OAAO,CAAC,EAAE,CAAC,CAAA;CACd"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDimensions.web.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDimensions.web.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAG1C,eAAO,MAAM,aAAa,QAAO,UA0BhC,CAAA"}
1
+ {"version":3,"file":"useDimensions.web.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDimensions.web.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,eAAO,MAAM,aAAa,QAAO,UA8BhC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import type { UnistylesThemes, UnistylesBreakpoints } from './global';
2
- import { UnistylesColorScheme } from './types';
2
+ import { ScreenOrientation } from './types';
3
3
  export { useInitialTheme } from './useInitialTheme';
4
4
  export { useStyles } from './useStyles';
5
5
  export { createStyleSheet } from './createStyleSheet';
@@ -9,7 +9,8 @@ declare const UnistylesRegistry: {
9
9
  addBreakpoints: (breakpoints: UnistylesBreakpoints) => import("./UnistyleRegistry").UnistyleRegistry;
10
10
  addConfig: (config: import("./types").UnistylesConfig) => import("./UnistyleRegistry").UnistyleRegistry;
11
11
  };
12
+ export declare const __dangerouslyUnregister: () => void;
12
13
  export { UnistylesRuntime, UnistylesRegistry };
13
- export { UnistylesColorScheme };
14
+ export { ScreenOrientation };
14
15
  export type { UnistylesThemes, UnistylesBreakpoints };
15
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAGrD,QAAA,MAAM,gBAAgB,+CAAoB,CAAA;AAC1C,QAAA,MAAM,iBAAiB;;;;CAItB,CAAA;AAED,OAAO,EACH,gBAAgB,EAChB,iBAAiB,EACpB,CAAA;AAED,OAAO,EACH,oBAAoB,EACvB,CAAA;AAED,YAAY,EACR,eAAe,EACf,oBAAoB,EACvB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAGrD,QAAA,MAAM,gBAAgB,+CAAoB,CAAA;AAC1C,QAAA,MAAM,iBAAiB;;;;CAItB,CAAA;AAED,eAAO,MAAM,uBAAuB,YAA2C,CAAA;AAE/E,OAAO,EACH,gBAAgB,EAChB,iBAAiB,EACpB,CAAA;AAED,OAAO,EACH,iBAAiB,EACpB,CAAA;AAED,YAAY,EACR,eAAe,EACf,oBAAoB,EACvB,CAAA"}
@@ -1,22 +1,26 @@
1
1
  import type { UnistylesThemes, UnistylesBreakpoints } from '../global';
2
2
  export type Nullable<T> = T | null;
3
- export declare enum UnistylesColorScheme {
4
- System = "system",
5
- Manual = "manual"
6
- }
3
+ export type ColorSchemeName = 'light' | 'dark' | undefined;
7
4
  export type UnistylesConfig = {
8
- colorScheme?: UnistylesColorScheme;
9
- featureFlags?: Array<string>;
5
+ adaptiveThemes?: boolean;
10
6
  };
7
+ export declare enum ScreenOrientation {
8
+ Portrait = 1,
9
+ Landscape = 2
10
+ }
11
11
  export type UnistylesBridge = {
12
- theme: keyof UnistylesThemes;
12
+ screenWidth: number;
13
+ screenHeight: number;
14
+ hasAdaptiveThemes: boolean;
15
+ themeName: keyof UnistylesThemes;
13
16
  breakpoint: keyof UnistylesBreakpoints;
14
- colorScheme: UnistylesColorScheme;
17
+ colorScheme: ColorSchemeName;
15
18
  sortedBreakpointPairs: Array<[keyof UnistylesBreakpoints, UnistylesBreakpoints[keyof UnistylesBreakpoints]]>;
19
+ themes: Array<keyof UnistylesThemes>;
16
20
  useBreakpoints(breakpoints: UnistylesBreakpoints): void;
17
21
  useTheme(name: keyof UnistylesThemes): void;
18
- useColorScheme(scheme: UnistylesColorScheme): void;
19
- useFeatureFlags(flags: Array<string>): void;
22
+ useAdaptiveThemes(enable: boolean): void;
23
+ unregister(): void;
20
24
  };
21
25
  export declare enum CxxUnistylesEventTypes {
22
26
  Theme = "theme",
@@ -26,7 +30,7 @@ export declare enum CxxUnistylesEventTypes {
26
30
  export type CxxUnistylesThemeEvent = {
27
31
  type: CxxUnistylesEventTypes.Theme;
28
32
  payload: {
29
- currentTheme: keyof UnistylesThemes;
33
+ themeName: keyof UnistylesThemes;
30
34
  };
31
35
  };
32
36
  export type CxxUnistylesSizeEvent = {
@@ -39,12 +43,16 @@ export type CxxUnistylesSizeEvent = {
39
43
  export type CxxUnistylesBreakpointEvent = {
40
44
  type: CxxUnistylesEventTypes.Breakpoint;
41
45
  payload: {
42
- currentBreakpoint: keyof UnistylesBreakpoints;
46
+ breakpoint: keyof UnistylesBreakpoints;
43
47
  };
44
48
  };
45
49
  export type UnistylesEvents = CxxUnistylesThemeEvent | CxxUnistylesSizeEvent | CxxUnistylesBreakpointEvent;
46
50
  export declare enum UnistylesError {
47
51
  RuntimeUnavailable = "UNISTYLES_ERROR_RUNTIME_UNAVAILABLE",
48
- ThemeNotFound = "UNISTYLES_ERROR_THEME_NOT_FOUND"
52
+ ThemeNotFound = "UNISTYLES_ERROR_THEME_NOT_FOUND",
53
+ ThemeNotRegistered = "UNISTYLES_ERROR_THEME_NOT_REGISTERED",
54
+ ThemesCannotBeEmpty = "UNISTYLES_ERROR_THEMES_CANNOT_BE_EMPTY",
55
+ BreakpointsCannotBeEmpty = "UNISTYLES_ERROR_BREAKPOINTS_CANNOT_BE_EMPTY",
56
+ BreakpointsMustStartFromZero = "UNISTYLES_ERROR_BREAKPOINTS_MUST_START_FROM_ZERO"
49
57
  }
50
58
  //# sourceMappingURL=cxx.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cxx.d.ts","sourceRoot":"","sources":["../../../../src/types/cxx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAEtE,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;AAClC,oBAAY,oBAAoB;IAC5B,MAAM,WAAW;IACjB,MAAM,WAAW;CACpB;AAED,MAAM,MAAM,eAAe,GAAG;IAC1B,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAE1B,KAAK,EAAE,MAAM,eAAe,CAAA;IAC5B,UAAU,EAAE,MAAM,oBAAoB,CAAC;IACvC,WAAW,EAAE,oBAAoB,CAAC;IAClC,qBAAqB,EAAE,KAAK,CAAC,CAAC,MAAM,oBAAoB,EAAE,oBAAoB,CAAC,MAAM,oBAAoB,CAAC,CAAC,CAAC,CAAA;IAG5G,cAAc,CAAC,WAAW,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,eAAe,GAAG,IAAI,CAAC;IAC5C,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACnD,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;CAC9C,CAAA;AAED,oBAAY,sBAAsB;IAC9B,KAAK,UAAU;IACf,IAAI,SAAS;IACb,UAAU,eAAe;CAC5B;AAED,MAAM,MAAM,sBAAsB,GAAG;IACjC,IAAI,EAAE,sBAAsB,CAAC,KAAK,CAAC;IACnC,OAAO,E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Prefix } from './types';
2
2
  import type { UnistylesThemes } from './global';
3
3
  type T = UnistylesThemes[keyof UnistylesThemes];
4
- export declare const useStyles: <ST extends CustomNamedStyles<ST>>(stylesheet?: ST | CreateStylesFactory<ST, T> | undefined) => {
5
- theme: {
6
- colors: {
7
- backgroundColor: string;
8
- typography: string;
9
- accent: string;
10
- barbie: string;
11
- oak: string;
12
- sky: string;
13
- fog: string;
14
- aloes: string;
15
- blood: string;
16
- };
17
- } | {
18
- colors: {
19
- backgroundColor: string;
20
- typography: string;
21
- accent: string;
22
- barbie: string;
23
- oak: string;
24
- sky: string;
25
- fog: string;
26
- aloes: string;
27
- blood: string;
28
- };
29
- } | {
30
- colors: {
31
- backgroundColor: string;
32
- typography: string;
33
- accent: string;
34
- barbie: string;
35
- oak: string;
36
- sky: string;
37
- fog: string;
38
- aloes: string;
39
- blood: string;
40
- };
41
- };
42
- breakpoint: "xs" | "sm" | "md" | "lg" | "xl";
4
+ export declare const useStyles: <ST extends CustomNamedStyles<ST>>(stylesheet?: ST | CreateStylesFactory<ST, never> | undefined) => {
5
+ theme: never;
6
+ breakpoint: "default";
43
7
  styles: ExtractBreakpoints<RemoveKeysWithPrefix<ST>>;
44
8
  };
45
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"useStyles.d.ts","sourceRoot":"","sources":["../../../src/useStyles.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAE/G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG/C,KAAK,CAAC,GAAG,eAAe,CAAC,MAAM,eAAe,CAAC,CAAA;AAE/C,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCrB,CAAA"}
1
+ {"version":3,"file":"useStyles.d.ts","sourceRoot":"","sources":["../../../src/useStyles.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAE/G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG/C,KAAK,CAAC,GAAG,eAAe,CAAC,MAAM,eAAe,CAAC,CAAA;AAE/C,eAAO,MAAM,SAAS;;;;CAsCrB,CAAA"}
@@ -1,42 +1,6 @@
1
1
  export declare const useUnistyles: () => {
2
- theme: {
3
- colors: {
4
- backgroundColor: string;
5
- typography: string;
6
- accent: string;
7
- barbie: string;
8
- oak: string;
9
- sky: string;
10
- fog: string;
11
- aloes: string;
12
- blood: string;
13
- };
14
- } | {
15
- colors: {
16
- backgroundColor: string;
17
- typography: string;
18
- accent: string;
19
- barbie: string;
20
- oak: string;
21
- sky: string;
22
- fog: string;
23
- aloes: string;
24
- blood: string;
25
- };
26
- } | {
27
- colors: {
28
- backgroundColor: string;
29
- typography: string;
30
- accent: string;
31
- barbie: string;
32
- oak: string;
33
- sky: string;
34
- fog: string;
35
- aloes: string;
36
- blood: string;
37
- };
38
- };
39
- breakpoint: "xs" | "sm" | "md" | "lg" | "xl";
2
+ theme: never;
3
+ breakpoint: "default";
40
4
  screenSize: {
41
5
  width: number;
42
6
  height: number;
@@ -1 +1 @@
1
- {"version":3,"file":"useUnistyles.d.ts","sourceRoot":"","sources":["../../../src/useUnistyles.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDxB,CAAA"}
1
+ {"version":3,"file":"useUnistyles.d.ts","sourceRoot":"","sources":["../../../src/useUnistyles.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,YAAY;;;;;;;CAoDxB,CAAA"}