react-native-unistyles 2.0.0-alpha.14 → 2.0.0-alpha.16
Sign up to get free protection for your applications and to get access to all the features.
- package/cxx/UnistylesRuntime.h +6 -6
- package/lib/commonjs/common.js +15 -15
- package/lib/commonjs/common.js.map +1 -1
- package/lib/commonjs/core/UnistylesRuntime.js +1 -1
- package/lib/commonjs/core/UnistylesRuntime.js.map +1 -1
- package/lib/commonjs/createStyleSheet.js +1 -6
- package/lib/commonjs/createStyleSheet.js.map +1 -1
- package/lib/commonjs/hooks/index.js +7 -0
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/useUnistyles.js +4 -7
- package/lib/commonjs/hooks/useUnistyles.js.map +1 -1
- package/lib/commonjs/hooks/useVariants.js +24 -0
- package/lib/commonjs/hooks/useVariants.js.map +1 -0
- package/lib/commonjs/plugins/normalizer/normalizer.js +1 -1
- package/lib/commonjs/plugins/normalizer/normalizer.js.map +1 -1
- package/lib/commonjs/types/{mq.js → stylesheet.js} +1 -1
- package/lib/commonjs/types/{mq.js.map → stylesheet.js.map} +1 -1
- package/lib/commonjs/useStyles.js +5 -4
- package/lib/commonjs/useStyles.js.map +1 -1
- package/lib/commonjs/utils/index.js +0 -6
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/mq.js +36 -68
- package/lib/commonjs/utils/mq.js.map +1 -1
- package/lib/commonjs/utils/styles.js +14 -8
- package/lib/commonjs/utils/styles.js.map +1 -1
- package/lib/commonjs/utils/variants.js +33 -13
- package/lib/commonjs/utils/variants.js.map +1 -1
- package/lib/module/common.js +14 -14
- package/lib/module/common.js.map +1 -1
- package/lib/module/core/UnistylesRuntime.js +1 -1
- package/lib/module/core/UnistylesRuntime.js.map +1 -1
- package/lib/module/createStyleSheet.js +1 -6
- package/lib/module/createStyleSheet.js.map +1 -1
- package/lib/module/hooks/index.js +1 -0
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useUnistyles.js +5 -8
- package/lib/module/hooks/useUnistyles.js.map +1 -1
- package/lib/module/hooks/useVariants.js +17 -0
- package/lib/module/hooks/useVariants.js.map +1 -0
- package/lib/module/plugins/normalizer/normalizer.js +1 -1
- package/lib/module/plugins/normalizer/normalizer.js.map +1 -1
- package/lib/module/types/stylesheet.js +2 -0
- package/lib/module/types/{mq.js.map → stylesheet.js.map} +1 -1
- package/lib/module/useStyles.js +6 -5
- package/lib/module/useStyles.js.map +1 -1
- package/lib/module/utils/index.js +1 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/mq.js +35 -67
- package/lib/module/utils/mq.js.map +1 -1
- package/lib/module/utils/styles.js +15 -9
- package/lib/module/utils/styles.js.map +1 -1
- package/lib/module/utils/variants.js +31 -11
- package/lib/module/utils/variants.js.map +1 -1
- package/lib/typescript/src/common.d.ts +10 -10
- package/lib/typescript/src/common.d.ts.map +1 -1
- package/lib/typescript/src/createStyleSheet.d.ts +2 -2
- package/lib/typescript/src/createStyleSheet.d.ts.map +1 -1
- package/lib/typescript/src/global.d.ts.map +1 -1
- package/lib/typescript/src/hooks/index.d.ts +1 -0
- package/lib/typescript/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useUnistyles.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useVariants.d.ts +3 -0
- package/lib/typescript/src/hooks/useVariants.d.ts.map +1 -0
- package/lib/typescript/src/plugins/normalizer/normalizer.d.ts.map +1 -1
- package/lib/typescript/src/types/breakpoints.d.ts +24 -15
- package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
- package/lib/typescript/src/types/core.d.ts +5 -29
- package/lib/typescript/src/types/core.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +2 -2
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/types/stylesheet.d.ts +40 -0
- package/lib/typescript/src/types/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/types/unistyles.d.ts +5 -6
- package/lib/typescript/src/types/unistyles.d.ts.map +1 -1
- package/lib/typescript/src/types/variants.d.ts +13 -7
- package/lib/typescript/src/types/variants.d.ts.map +1 -1
- package/lib/typescript/src/useStyles.d.ts +3 -3
- package/lib/typescript/src/useStyles.d.ts.map +1 -1
- package/lib/typescript/src/utils/index.d.ts +1 -1
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/mq.d.ts +15 -14
- package/lib/typescript/src/utils/mq.d.ts.map +1 -1
- package/lib/typescript/src/utils/styles.d.ts +3 -3
- package/lib/typescript/src/utils/styles.d.ts.map +1 -1
- package/lib/typescript/src/utils/variants.d.ts +2 -2
- package/lib/typescript/src/utils/variants.d.ts.map +1 -1
- package/package.json +15 -15
- package/src/common.ts +10 -10
- package/src/core/UnistylesRuntime.ts +1 -1
- package/src/createStyleSheet.ts +2 -8
- package/src/global.ts +1 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useUnistyles.ts +5 -8
- package/src/hooks/useVariants.ts +23 -0
- package/src/plugins/normalizer/normalizer.ts +3 -3
- package/src/types/breakpoints.ts +51 -27
- package/src/types/core.ts +8 -45
- package/src/types/index.ts +1 -2
- package/src/types/stylesheet.ts +49 -0
- package/src/types/unistyles.ts +5 -6
- package/src/types/variants.ts +17 -9
- package/src/useStyles.ts +15 -15
- package/src/utils/index.ts +1 -1
- package/src/utils/mq.ts +31 -84
- package/src/utils/styles.ts +18 -17
- package/src/utils/variants.ts +41 -17
- package/lib/module/types/mq.js +0 -2
- package/lib/typescript/src/types/mq.d.ts +0 -3
- package/lib/typescript/src/types/mq.d.ts.map +0 -1
- package/src/types/mq.ts +0 -3
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["getKeysForVariants","value","variants","length","Object","entries","map","_ref","key","undefined","filter","Boolean","_ref2","variantKey","variantValue","variantStyle","getStyleWithVariants","style","variantValues","keys","variantsValues","_ref3","nestedKey","reduce","acc","styles","otherStyles","exports"],"sourceRoot":"../../../src","sources":["utils/variants.ts"],"mappings":";;;;;;AAEA,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AD,KAAA;IAAA,OAAOJ,KAAK,CAACf,QAAQ,CAAiDM,GAAG,CAAC,CAAiCc,SAAS,CAAC;EAAA,EAAC,CAC3IC,MAAM,CAAC,CAACC,GAAG,EAAEC,MAAM,MAAM;IAAE,GAAGD,GAAG;IAAE,GAAGC;EAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAEzD,MAAM;IAAEvB,QAAQ;IAAE,GAAGwB;EAAY,CAAC,GAAGT,KAAK;EAE1C,OAAO;IACH,GAAGS,WAAW;IACd,GAAGN;EACP,CAAC;AACL,CAAC;AAAAO,OAAA,CAAAX,oBAAA,GAAAA,oBAAA"}
|
package/lib/module/common.js
CHANGED
@@ -11,22 +11,22 @@ export const ScreenOrientation = {
|
|
11
11
|
Landscape: 'landscape',
|
12
12
|
Portrait: 'portrait'
|
13
13
|
};
|
14
|
-
export let
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
return
|
14
|
+
export let UnistylesEventType = /*#__PURE__*/function (UnistylesEventType) {
|
15
|
+
UnistylesEventType["Theme"] = "theme";
|
16
|
+
UnistylesEventType["Layout"] = "layout";
|
17
|
+
UnistylesEventType["Plugin"] = "plugin";
|
18
|
+
return UnistylesEventType;
|
19
19
|
}({});
|
20
20
|
export let UnistylesError = /*#__PURE__*/function (UnistylesError) {
|
21
|
-
UnistylesError["RuntimeUnavailable"] = "
|
22
|
-
UnistylesError["ThemeNotFound"] = "
|
23
|
-
UnistylesError["ThemeNotRegistered"] = "
|
24
|
-
UnistylesError["ThemesCannotBeEmpty"] = "
|
25
|
-
UnistylesError["BreakpointsCannotBeEmpty"] = "
|
26
|
-
UnistylesError["BreakpointsMustStartFromZero"] = "
|
27
|
-
UnistylesError["InvalidPluginName"] = "
|
28
|
-
UnistylesError["DuplicatePluginName"] = "
|
29
|
-
UnistylesError["CantRemoveInternalPlugin"] = "
|
21
|
+
UnistylesError["RuntimeUnavailable"] = "Unistyles runtime is not available. Make sure you followed the installation instructions.";
|
22
|
+
UnistylesError["ThemeNotFound"] = "You are trying to get a theme that is not registered.";
|
23
|
+
UnistylesError["ThemeNotRegistered"] = "You are trying to set a theme that is not registered.";
|
24
|
+
UnistylesError["ThemesCannotBeEmpty"] = "You are trying to register an empty themes object.";
|
25
|
+
UnistylesError["BreakpointsCannotBeEmpty"] = "You are trying to register an empty breakpoints object.";
|
26
|
+
UnistylesError["BreakpointsMustStartFromZero"] = "One breakpoint must start from 0.";
|
27
|
+
UnistylesError["InvalidPluginName"] = "Plugin name can't start from reserved prefix. Use another name.";
|
28
|
+
UnistylesError["DuplicatePluginName"] = "You are trying to register a plugin with a name that is already registered.";
|
29
|
+
UnistylesError["CantRemoveInternalPlugin"] = "You are trying to remove an internal unistyles plugin.";
|
30
30
|
return UnistylesError;
|
31
31
|
}({});
|
32
32
|
//# sourceMappingURL=common.js.map
|
package/lib/module/common.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Platform","warn","message","console","isMobile","OS","isWeb","isIOS","isAndroid","isServer","window","ScreenOrientation","Landscape","Portrait","
|
1
|
+
{"version":3,"names":["Platform","warn","message","console","isMobile","OS","isWeb","isIOS","isAndroid","isServer","window","ScreenOrientation","Landscape","Portrait","UnistylesEventType","UnistylesError"],"sourceRoot":"../../src","sources":["common.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,OAAO,MAAMC,IAAI,GAAIC,OAAe,IAAK;EACrCC,OAAO,CAACF,IAAI,CAAE,gCAA+BC,OAAQ,EAAC,CAAC;AAC3D,CAAC;AAED,OAAO,MAAME,QAAQ,GAAGJ,QAAQ,CAACK,EAAE,KAAK,SAAS,IAAIL,QAAQ,CAACK,EAAE,KAAK,KAAK;AAC1E,OAAO,MAAMC,KAAK,GAAGN,QAAQ,CAACK,EAAE,KAAK,KAAK;AAC1C,OAAO,MAAME,KAAK,GAAGP,QAAQ,CAACK,EAAE,KAAK,KAAK;AAC1C,OAAO,MAAMG,SAAS,GAAGR,QAAQ,CAACK,EAAE,KAAK,SAAS;AAClD,OAAO,MAAMI,QAAQ,GAAG,OAAOC,MAAM,KAAK,WAAW;AAErD,OAAO,MAAMC,iBAAiB,GAAG;EAC7BC,SAAS,EAAE,WAAW;EACtBC,QAAQ,EAAE;AACd,CAAU;AAEV,WAAYC,kBAAkB,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;AAM9B,WAAYC,cAAc,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA"}
|
@@ -36,7 +36,7 @@ export class UnistylesRuntime {
|
|
36
36
|
return ScreenOrientation.Portrait;
|
37
37
|
}
|
38
38
|
setTheme = name => {
|
39
|
-
if (this.unistylesRegistry.hasTheme(name)) {
|
39
|
+
if (name !== this.themeName && this.unistylesRegistry.hasTheme(name)) {
|
40
40
|
this.unistylesBridge.useTheme(name);
|
41
41
|
return true;
|
42
42
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ScreenOrientation","UnistylesError","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","colorScheme","hasAdaptiveThemes","themeName","breakpoint","enabledPlugins","screen","width","screenWidth","height","screenHeight","orientation","Landscape","Portrait","setTheme","name","hasTheme","useTheme","Error","ThemeNotRegistered","setAdaptiveThemes","enable","useAdaptiveThemes","addPlugin","plugin","removePlugin"],"sourceRoot":"../../../src","sources":["core/UnistylesRuntime.ts"],"mappings":"AAAA,SAASA,iBAAiB,EAAEC,cAAc,QAAQ,WAAW;AAK7D,OAAO,MAAMC,gBAAgB,CAAC;EAC1BC,WAAWA,CAASC,eAAgC,EAAUC,iBAAmC,EAAE;IAAA,KAA/ED,eAAgC,GAAhCA,eAAgC;IAAA,KAAUC,iBAAmC,GAAnCA,iBAAmC;EAAG;EAEpG,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO,IAAI,CAACF,eAAe,CAACE,WAAW;EAC3C;EAEA,IAAWC,iBAAiBA,CAAA,EAAG;IAC3B,OAAO,IAAI,CAACH,eAAe,CAACG,iBAAiB;EACjD;EAEA,IAAWC,SAASA,CAAA,EAAG;IACnB,OAAO,IAAI,CAACJ,eAAe,CAACI,SAAS;EACzC;EAEA,IAAWC,UAAUA,CAAA,EAAG;IACpB,OAAO,IAAI,CAACL,eAAe,CAACK,UAAU;EAC1C;EAEA,IAAWC,cAAcA,CAAA,EAAG;IACxB,OAAO,IAAI,CAACN,eAAe,CAACM,cAAc;EAC9C;EAEA,IAAWC,MAAMA,CAAA,EAAG;IAChB,OAAO;MACHC,KAAK,EAAE,IAAI,CAACR,eAAe,CAACS,WAAW;MACvCC,MAAM,EAAE,IAAI,CAACV,eAAe,CAACW;IACjC,CAAC;EACL;EAEA,IAAWC,WAAWA,CAAA,EAAG;IACrB,MAAM;MAAEJ,KAAK;MAAEE;IAAO,CAAC,GAAG,IAAI,CAACH,MAAM;IAErC,IAAIC,KAAK,GAAGE,MAAM,EAAE;MAChB,OAAOd,iBAAiB,CAACiB,SAAS;IACtC;IAEA,OAAOjB,iBAAiB,CAACkB,QAAQ;EACrC;EAEOC,QAAQ,GAAIC,IAA2B,IAAK;IAC/C,IAAI,IAAI,
|
1
|
+
{"version":3,"names":["ScreenOrientation","UnistylesError","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","colorScheme","hasAdaptiveThemes","themeName","breakpoint","enabledPlugins","screen","width","screenWidth","height","screenHeight","orientation","Landscape","Portrait","setTheme","name","hasTheme","useTheme","Error","ThemeNotRegistered","setAdaptiveThemes","enable","useAdaptiveThemes","addPlugin","plugin","removePlugin"],"sourceRoot":"../../../src","sources":["core/UnistylesRuntime.ts"],"mappings":"AAAA,SAASA,iBAAiB,EAAEC,cAAc,QAAQ,WAAW;AAK7D,OAAO,MAAMC,gBAA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;EAEMC,iBAAiB,GAAIC,MAAe,IAAK;IAC5C,IAAI,CAACtB,eAAe,CAACuB,iBAAiB,CAACD,MAAM,CAAC;EAClD,CAAC;EAEME,SAAS,GAAIC,MAAuB,IAAK;IAC5C,IAAI,CAACxB,iBAAiB,CAACuB,SAAS,CAACC,MAAM,CAAC;EAC5C,CAAC;EAEMC,YAAY,GAAID,MAAuB,IAAK;IAC/C,IAAI,CAACxB,iBAAiB,CAACyB,YAAY,CAACD,MAAM,CAAC;EAC/C,CAAC;AACL"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createStyleSheet","
|
1
|
+
{"version":3,"names":["createStyleSheet","stylesheet"],"sourceRoot":"../../src","sources":["createStyleSheet.ts"],"mappings":"AAEA,OAAO,MAAMA,gBAAgB,GAAyCC,UAAa,IAAQA,UAAU"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["useInitialTheme","useUnistyles"],"sourceRoot":"../../../src","sources":["hooks/index.ts"],"mappings":"AAAA,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,YAAY,QAAQ,gBAAgB"}
|
1
|
+
{"version":3,"names":["useInitialTheme","useUnistyles","useVariants"],"sourceRoot":"../../../src","sources":["hooks/index.ts"],"mappings":"AAAA,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,WAAW,QAAQ,eAAe"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { NativeEventEmitter, NativeModules } from 'react-native';
|
2
2
|
import { useEffect, useState } from 'react';
|
3
3
|
import { unistyles } from '../core';
|
4
|
-
import {
|
4
|
+
import { UnistylesEventType } from '../common';
|
5
5
|
const unistylesEvents = new NativeEventEmitter(NativeModules.Unistyles);
|
6
6
|
export const useUnistyles = () => {
|
7
7
|
const [plugins, setPlugins] = useState(unistyles.runtime.enabledPlugins);
|
@@ -17,24 +17,21 @@ export const useUnistyles = () => {
|
|
17
17
|
useEffect(() => {
|
18
18
|
const subscription = unistylesEvents.addListener('onChange', event => {
|
19
19
|
switch (event.type) {
|
20
|
-
case
|
20
|
+
case UnistylesEventType.Theme:
|
21
21
|
{
|
22
22
|
const themeEvent = event;
|
23
23
|
return setTheme(unistyles.registry.getTheme(themeEvent.payload.themeName));
|
24
24
|
}
|
25
|
-
case
|
25
|
+
case UnistylesEventType.Layout:
|
26
26
|
{
|
27
27
|
const layoutEvent = event;
|
28
28
|
return setLayout({
|
29
29
|
breakpoint: layoutEvent.payload.breakpoint,
|
30
30
|
orientation: layoutEvent.payload.orientation,
|
31
|
-
screenSize:
|
32
|
-
width: layoutEvent.payload.screen.width,
|
33
|
-
height: layoutEvent.payload.screen.height
|
34
|
-
}
|
31
|
+
screenSize: layoutEvent.payload.screen
|
35
32
|
});
|
36
33
|
}
|
37
|
-
case
|
34
|
+
case UnistylesEventType.Plugin:
|
38
35
|
{
|
39
36
|
return setPlugins(unistyles.runtime.enabledPlugins);
|
40
37
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["NativeEventEmitter","NativeModules","useEffect","useState","unistyles","
|
1
|
+
{"version":3,"names":["NativeEventEmitter","NativeModules","useEffect","useState","unistyles","UnistylesEventType","unistylesEvents","Unistyles","useUnistyles","plugins","setPlugins","runtime","enabledPlugins","theme","setTheme","registry","getTheme","themeName","layout","setLayout","breakpoint","orientation","screenSize","width","screen","height","subscription","addListener","event","type","Theme","themeEvent","payload","Layout","layoutEvent","Plugin","remove"],"sourceRoot":"../../../src","sources":["hooks/useUnistyles.ts"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAChE,SAASC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,SAAS,QAAQ,SAAS;AACnC,SAASC,kBAAkB,QAAQ,WAAW;AAG9C,MAAMC,eAAe,GAAG,IAAIN,kBAAkB,CAACC,aAAa,CAACM,SAAS,CAAC;AAEvE,OAAO,MAAMC,YAAY,GAAGA,CAAA,K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;YAC5B,OAAOzB,UAAU,CAACN,SAAS,CAACO,OAAO,CAACC,cAAc,CAAC;UACvD;QACA;UACI;MACR;IACJ,CACJ,CAAC;IAED,OAAOc,YAAY,CAACU,MAAM;EAC9B,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACH3B,OAAO;IACPI,KAAK;IACLK;EACJ,CAAC;AACL,CAAC"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { useRef } from 'react';
|
2
|
+
const compareVariants = (prevVariants, nextVariants) => {
|
3
|
+
const keysA = Object.keys(prevVariants ?? {});
|
4
|
+
const keysB = Object.keys(nextVariants ?? {});
|
5
|
+
if (keysA.length !== keysB.length) {
|
6
|
+
return false;
|
7
|
+
}
|
8
|
+
return keysA.every(key => prevVariants[key] === (nextVariants ?? {})[key]);
|
9
|
+
};
|
10
|
+
export const useVariants = variantsMap => {
|
11
|
+
const variantsRef = useRef(variantsMap);
|
12
|
+
if (!compareVariants(variantsRef.current, variantsMap)) {
|
13
|
+
variantsRef.current = variantsMap;
|
14
|
+
}
|
15
|
+
return variantsRef.current;
|
16
|
+
};
|
17
|
+
//# sourceMappingURL=useVariants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["useRef","compareVariants","prevVariants","nextVariants","keysA","Object","keys","keysB","length","every","key","useVariants","variantsMap","variantsRef","current"],"sourceRoot":"../../../src","sources":["hooks/useVariants.ts"],"mappings":"AAAA,SAASA,MAAM,QAAQ,OAAO;AAG9B,MAAMC,eAAe,GAAGA,CAACC,YAA+C,EAAEC,YAA+C,KAAK;EAC1H,MAAMC,KAAK,GAAGC,MAAM,CAACC,IAAI,CAACJ,YAAY,IAAI,CAAC,CAAC,CAAC;EAC7C,MAAMK,KAAK,GAAGF,MAAM,CAACC,IAAI,CAACH,YAAY,IAAI,CAAC,CAAC,CAAC;EAE7C,IAAIC,KAAK,CAACI,MAAM,KAAKD,KAAK,CAACC,MAAM,EAAE;IAC/B,OAAO,KAAK;EAChB;EAEA,OAAOJ,KAAK,CAACK,KAAK,CAACC,GAAG,IAAIR,YAAY,CAAEQ,GAAG,CAAC,KAAK,CAACP,YAAY,IAAI,CAAC,CAAC,EAAEO,GAAG,CAAC,CAAC;AAC/E,CAAC;AAED,OAAO,MAAMC,WAAW,GAAIC,WAA8C,IAAK;EAC3E,MAAMC,WAAW,GAAGb,MAAM,CAA6CY,WAAW,CAAC;EAEnF,IAAI,CAACX,eAAe,CAACY,WAAW,CAACC,OAAO,EAAEF,WAAW,CAAC,EAAE;IACpDC,WAAW,CAACC,OAAO,GAAGF,WAAW;EACrC;EAEA,OAAOC,WAAW,CAACC,OAAO;AAC9B,CAAC"}
|
@@ -9,7 +9,7 @@ export const normalizeColor = function (color) {
|
|
9
9
|
}
|
10
10
|
const integer = normalizeColors(color);
|
11
11
|
|
12
|
-
// If the
|
12
|
+
// If the color is an unknown format, the return value is null
|
13
13
|
if (integer === null) {
|
14
14
|
return color;
|
15
15
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["normalizeColors","normalizeColor","color","opacity","arguments","length","undefined","integer","hex","toString","padStart","r","g","b","a","split","map","x","parseInt","filter","num","isNaN","normalizeNumericValue","value","normalizeTransform","key","includes","createTextShadowValue","style","textShadowColor","textShadowOffset","textShadowRadius","offsetX","width","offsetY","height","radius","createBoxShadowValue","shadowColor","shadowOffset","shadowOpacity","shadowRadius","createTransformValue","transforms","transform","Object","keys","join","Boolean","preprocessor"],"sourceRoot":"../../../../src","sources":["plugins/normalizer/normalizer.ts"],"mappings":"AAAA;AACA;AACA,OAAOA,eAAe,MAAM,gCAAgC;AAS5D,OAAO,MAAMC,cAAc,GAAG,SAAAA,CAACC,KAAa,EAA0B;EAAA,IAAxBC,OAAe,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC;EAC7D;EACA,IAAID,OAAO,KAAK,CAAC,EAAE;IACf,OAAOD,KAAK;EAChB;EAEA,MAAMK,OAAO,GAAGP,eAAe,CAACE,KAAK,
|
1
|
+
{"version":3,"names":["normalizeColors","normalizeColor","color","opacity","arguments","length","undefined","integer","hex","toString","padStart","r","g","b","a","split","map","x","parseInt","filter","num","isNaN","normalizeNumericValue","value","normalizeTransform","key","includes","createTextShadowValue","style","textShadowColor","textShadowOffset","textShadowRadius","offsetX","width","offsetY","height","radius","createBoxShadowValue","shadowColor","shadowOffset","shadowOpacity","shadowRadius","createTransformValue","transforms","transform","Object","keys","join","Boolean","preprocessor"],"sourceRoot":"../../../../src","sources":["plugins/normalizer/normalizer.ts"],"mappings":"AAAA;AACA;AACA,OAAOA,eAAe,MAAM,gCAAgC;AAS5D,OAAO,MAAMC,cAAc,GAAG,SAAAA,CAACC,KAAa,EAA0B;EAAA,IAAxBC,OAAe,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC;EAC7D;EACA,IAAID,OAAO,KAAK,CAAC,EAAE;IACf,OAAOD,KAAK;EAChB;EAEA,MAAMK,OAAO,GAAGP,eAAe,CAACE,KAAK,CAAqB;;EAE1D;EACA,IAAIK,OAAO,KAAK,IAAI,EAAE;IAClB,OAAOL,KAAK;EAChB;EAEA,MAAMM,GAAG,GAAGD,OAAO,CAACE,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;EAEjD,IAAIF,GAAG,CAACH,MAAM,KAAK,CAAC,EAAE;IAClB,MAAM,CAACM,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAG,CAAC,CAAC,GAAGN,GAAG,CACnCO,KAAK,CAAC,cAAc,CAAC,CACrBC,GAAG,CAACC,CAAC,IAAIC,QAAQ,CAACD,CAAC,EAAE,EAAE,CAAC,CAAC,CACzBE,MAAM,CAACC,GAAG,IAAI,CAACC,KAAK,CAACD,GAAG,CAAC,CAAC;IAE/B,OAA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,GAAGd,qBAAqB,CAACmB,YAAY,CAAC;EAClD,MAAMvC,KAAK,GAAGD,cAAc,CAACqC,WAAW,EAAYE,aAAuB,CAAC;EAE5E,OAAQ,GAAER,OAAQ,IAAGE,OAAQ,IAAGE,MAAO,IAAGlC,KAAM,EAAC;AACrD,CAAC;AAED,MAAMwC,oBAAoB,GAAIC,UAAsB,IAAKA,UAAU,CAC9D3B,GAAG,CAAC4B,SAAS,IAAI;EACd,MAAM,CAACnB,GAAG,CAAC,GAAGoB,MAAM,CAACC,IAAI,CAACF,SAAS,CAAC;EAEpC,IAAI,CAACnB,GAAG,EAAE;IACN,OAAOnB,SAAS;EACpB;EAEA,MAAMiB,KAAK,GAAGqB,SAAS,CAACnB,GAAG,CAA2B;EAEtD,QAAOA,GAAG;IACN,KAAK,QAAQ;IACb,KAAK,UAAU;MACX,OAAQ,GAAEA,GAAI,IAAIF,KAAK,CAAmBwB,IAAI,CAAC,GAAG,CAAE,GAAE;IAC1D;MACI,OAAQ,GAAEtB,GAAI,IAAGD,kBAAkB,CAACC,GAAG,EAAEF,KAAK,CAAE,GAAE;EAC1D;AACJ,CAAC,CAAC,CACDJ,MAAM,CAAC6B,OAAO,CAAC,CACfD,IAAI,CAAC,GAAG,CAAC;AAEd,OAAO,MAAME,YAA0B,GAAG;EACtCtB,qBAAqB;EACrBU,oBAAoB;EACpBK;AACJ,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/stylesheet.ts"],"mappings":""}
|
package/lib/module/useStyles.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import { useMemo } from 'react';
|
2
2
|
import { StyleSheet } from 'react-native';
|
3
3
|
import { parseStyle, proxifyFunction } from './utils';
|
4
|
-
import { useUnistyles } from './hooks';
|
4
|
+
import { useUnistyles, useVariants } from './hooks';
|
5
5
|
import { unistyles } from './core';
|
6
|
-
export const useStyles = (stylesheet,
|
6
|
+
export const useStyles = (stylesheet, variantsMap) => {
|
7
7
|
const {
|
8
8
|
theme,
|
9
9
|
layout,
|
@@ -16,20 +16,21 @@ export const useStyles = (stylesheet, variant) => {
|
|
16
16
|
styles: {}
|
17
17
|
};
|
18
18
|
}
|
19
|
+
const variants = useVariants(variantsMap);
|
19
20
|
const parsedStyles = useMemo(() => typeof stylesheet === 'function' ? stylesheet(theme) : stylesheet, [theme, stylesheet, layout]);
|
20
21
|
const dynamicStyleSheet = useMemo(() => Object.entries(parsedStyles).reduce((acc, _ref) => {
|
21
22
|
let [key, value] = _ref;
|
22
23
|
if (typeof value === 'function') {
|
23
24
|
return {
|
24
25
|
...acc,
|
25
|
-
[key]: proxifyFunction(key, value, unistyles.registry.plugins, unistyles.runtime,
|
26
|
+
[key]: proxifyFunction(key, value, unistyles.registry.plugins, unistyles.runtime, variants)
|
26
27
|
};
|
27
28
|
}
|
28
29
|
return StyleSheet.create({
|
29
30
|
...acc,
|
30
|
-
[key]: parseStyle(key, value, unistyles.registry.plugins, unistyles.runtime,
|
31
|
+
[key]: parseStyle(key, value, unistyles.registry.plugins, unistyles.runtime, variants)
|
31
32
|
});
|
32
|
-
}, {}), [layout, parsedStyles,
|
33
|
+
}, {}), [layout, parsedStyles, variants, plugins]);
|
33
34
|
return {
|
34
35
|
theme,
|
35
36
|
breakpoint: layout.breakpoint,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["useMemo","StyleSheet","parseStyle","proxifyFunction","useUnistyles","unistyles","useStyles","stylesheet","
|
1
|
+
{"version":3,"names":["useMemo","StyleSheet","parseStyle","proxifyFunction","useUnistyles","useVariants","unistyles","useStyles","stylesheet","variantsMap","theme","layout","plugins","breakpoint","styles","variants","parsedStyles","dynamicStyleSheet","Object","entries","reduce","acc","_ref","key","value","registry","runtime","create"],"sourceRoot":"../../src","sources":["useStyles.ts"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,UA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O,EAC1BN,SAAS,CAACoB,OAAO,EACjBX,QACJ;IACJ,CAAC,CAAC;EACN,CAAC,EAAE,CAAC,CAAC,CAAC,EACV,CAACJ,MAAM,EAAEK,YAAY,EAAED,QAAQ,EAAEH,OAAO,CACxC,CAA8B;EAE9B,OAAO;IACHF,KAAK;IACLG,UAAU,EAAEF,MAAM,CAACE,UAAU;IAC7BC,MAAM,EAAEG;EACZ,CAAC;AACL,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export { mq
|
1
|
+
export { mq } from './mq';
|
2
2
|
export { getKeyForUnistylesMediaQuery, isWithinTheWidthAndHeight, isValidMq, parseMq } from './mqParser';
|
3
3
|
export { getValueForBreakpoint } from './breakpoints';
|
4
4
|
export { proxifyFunction, parseStyle } from './styles';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["mq","
|
1
|
+
{"version":3,"names":["mq","getKeyForUnistylesMediaQuery","isWithinTheWidthAndHeight","isValidMq","parseMq","getValueForBreakpoint","proxifyFunction","parseStyle"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":"AAAA,SAASA,EAAE,QAAQ,MAAM;AACzB,SAASC,4BAA4B,EAAEC,yBAAyB,EAAEC,SAAS,EAAEC,OAAO,QAAQ,YAAY;AACxG,SAASC,qBAAqB,QAAQ,eAAe;AACrD,SAASC,eAAe,EAAEC,UAAU,QAAQ,UAAU"}
|
package/lib/module/utils/mq.js
CHANGED
@@ -1,13 +1,4 @@
|
|
1
1
|
import { unistyles } from '../core';
|
2
|
-
export const MQSymbol = Symbol('unistyles-mq');
|
3
|
-
var MQProp = /*#__PURE__*/function (MQProp) {
|
4
|
-
MQProp["toString"] = "toString";
|
5
|
-
MQProp["width"] = "width";
|
6
|
-
MQProp["height"] = "height";
|
7
|
-
MQProp["shortW"] = "w";
|
8
|
-
MQProp["shortH"] = "h";
|
9
|
-
return MQProp;
|
10
|
-
}(MQProp || {});
|
11
2
|
const getMQValue = value => {
|
12
3
|
if (typeof value === 'number') {
|
13
4
|
return value;
|
@@ -17,67 +8,44 @@ const getMQValue = value => {
|
|
17
8
|
}
|
18
9
|
return unistyles.registry.breakpoints[value] ?? 0;
|
19
10
|
};
|
20
|
-
const
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
let wMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
32
|
-
return new Proxy({}, {
|
33
|
-
get: (target, prop, receiver) => {
|
34
|
-
if (prop === Symbol.toPrimitive || prop === MQProp.toString) {
|
35
|
-
return () => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
|
36
|
-
}
|
37
|
-
return Reflect.get(target, prop, receiver);
|
38
|
-
}
|
39
|
-
});
|
40
|
-
};
|
41
|
-
}
|
42
|
-
return Reflect.get(target, prop, receiver);
|
11
|
+
export const mq = {
|
12
|
+
only: {
|
13
|
+
width: function () {
|
14
|
+
let wMin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
15
|
+
let wMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
16
|
+
return `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]`;
|
17
|
+
},
|
18
|
+
height: function () {
|
19
|
+
let hMin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
20
|
+
let hMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
21
|
+
return `:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
|
43
22
|
}
|
44
|
-
}
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
if (prop === Symbol.toPrimitive || prop === MQProp.toString) {
|
52
|
-
return () => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]`;
|
53
|
-
}
|
54
|
-
if (prop === MQProp.height || prop === MQProp.shortH) {
|
55
|
-
return function () {
|
23
|
+
},
|
24
|
+
width: function () {
|
25
|
+
let wMin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
26
|
+
let wMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
27
|
+
return {
|
28
|
+
and: {
|
29
|
+
height: function () {
|
56
30
|
let hMin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
57
31
|
let hMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
58
|
-
return
|
59
|
-
|
60
|
-
if (prop === Symbol.toPrimitive || prop === MQProp.toString) {
|
61
|
-
return () => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
|
62
|
-
}
|
63
|
-
return Reflect.get(target, prop, receiver);
|
64
|
-
}
|
65
|
-
});
|
66
|
-
};
|
32
|
+
return `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
|
33
|
+
}
|
67
34
|
}
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
35
|
+
};
|
36
|
+
},
|
37
|
+
height: function () {
|
38
|
+
let hMin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
39
|
+
let hMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
40
|
+
return {
|
41
|
+
and: {
|
42
|
+
width: function () {
|
43
|
+
let wMin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
44
|
+
let wMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
45
|
+
return `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
};
|
81
49
|
}
|
82
|
-
}
|
50
|
+
};
|
83
51
|
//# sourceMappingURL=mq.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["unistyles","
|
1
|
+
{"version":3,"names":["unistyles","getMQValue","value","registry","breakpoints","mq","only","width","wMin","arguments","length","undefined","wMax","Infinity","height","hMin","hMax","and"],"sourceRoot":"../../../src","sources":["utils/mq.ts"],"mappings":"AAEA,SAASA,SAAS,QAAQ,SAAS;AAqBnC,MAAMC,UAAU,GAAIC,KAAwB,IAAK;EAC7C,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOA,KAAK;EAChB;EAEA,IAAIA,KAAK,KAAK,IAAI,EAAE;IAChB,OAAO,CAAC;EACZ;EAEA,OAAOF,SAAS,CAACG,QAAQ,CAACC,WAAW,CAACF,KAAK,CAAC,IAAI,CAAC;AACrD,CAAC;AAED,OAAO,MAAMG,EAAa,GAAG;EACzBC,IAAI,EAAE;IACFC,KAAK,EAAE,SAAAA,CAAA;MAAA,IAACC,IAAuB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC;MAAA,IAAEG,IAAa,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGI,QAAQ;MAAA,OAAO,MAAKZ,UAAU,CAACO,IAAI,CAAE,KAAIP,UAAU,CAACW,IAAI,CAAE,GAAE;IAAA,CAAsB;IACvIE,MAAM,EAAE,SAAAA,CAAA;MAAA,IAACC,IAAuB,GAAAN,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC;MAAA,IAAEO,IAAa,GAAAP,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGI,QAAQ;MAAA,OAAO,MAAKZ,UAAU,CAACc,IAAI,CAAE,KAAId,UAAU,CAACe,I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AAE,KAAIP,UAAU,CAACW,IAAI,CAAE,OAAMX,UAAU,CAACc,IAAI,CAAE,KAAId,UAAU,CAACe,IAAI,CAAE,GAAE;QAAA;MACnG;IACJ,CAAC;EAAA;AACL,CAAC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { getValueForBreakpoint } from './breakpoints';
|
2
2
|
import { isAndroid, isIOS } from '../common';
|
3
|
-
import {
|
3
|
+
import { getStyleWithVariants } from './variants';
|
4
4
|
import { withPlugins } from '../plugins';
|
5
5
|
export const proxifyFunction = (key, fn, plugins, runtime, variant) => new Proxy(fn, {
|
6
6
|
apply: (target, thisArg, argumentsList) => parseStyle(key, target.apply(thisArg, argumentsList), plugins, runtime, variant)
|
@@ -12,20 +12,26 @@ export const isPlatformColor = value => {
|
|
12
12
|
return isAndroid && 'resource_paths' in value && typeof value.resource_paths === 'object';
|
13
13
|
};
|
14
14
|
export const parseStyle = (key, style, plugins, runtime, variant) => {
|
15
|
-
const entries = Object.entries(
|
15
|
+
const entries = Object.entries(getStyleWithVariants(style || {}, variant));
|
16
16
|
const parsedStyles = Object.fromEntries(entries.map(_ref => {
|
17
17
|
let [key, value] = _ref;
|
18
|
-
|
19
|
-
if (
|
18
|
+
// dynamic functions
|
19
|
+
if (typeof value === 'function') {
|
20
|
+
return [key, value];
|
21
|
+
}
|
22
|
+
|
23
|
+
// nested objects
|
24
|
+
if (key === 'shadowOffset' || key === 'textShadowOffset') {
|
20
25
|
return [key, parseStyle(key, value, plugins, runtime, variant)];
|
21
26
|
}
|
22
|
-
|
23
|
-
|
27
|
+
|
28
|
+
// transforms
|
29
|
+
if (key === 'transform' && Array.isArray(value)) {
|
24
30
|
return [key, value.map(value => parseStyle(key, value, plugins, runtime, variant))];
|
25
31
|
}
|
26
|
-
|
27
|
-
|
28
|
-
if (
|
32
|
+
|
33
|
+
// values or platform colors
|
34
|
+
if (typeof value !== 'object' || isPlatformColor(value)) {
|
29
35
|
return [key, value];
|
30
36
|
}
|
31
37
|
return [key, getValueForBreakpoint(value)];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["getValueForBreakpoint","isAndroid","isIOS","
|
1
|
+
{"version":3,"names":["getValueForBreakpoint","isAndroid","isIOS","getStyleWithVariants","withPlugins","proxifyFunction","key","fn","plugins","runtime","variant","Proxy","apply","target","thisArg","argumentsList","parseStyle","isPlatformColor","value","semantic","resource_paths","style","entries","Object","parsedStyles","fromEntries","map","_ref","Array","isArray"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,eAAe;AAErD,SAASC,SAAS,EAAEC,KAAK,QAAQ,WAAW;AAC5C,SAASC,oBAAoB,QAAQ,YAAY;AACjD,SAASC,WAAW,QAAQ,YAAY;AAExC,OAAO,MAAMC,eAAe,GAAGA,CAC3BC,GAAW,EACXC,EAAY,EACZC,OAA+B,EAC/BC,OAAyB,EACzBC,OAA0C,KAC/B,IAAIC,KAAK,CAACJ,EAAE,EAAE;EACzBK,KAAK,EAAEA,CAACC,MAAM,EAAEC,OAAO,EAAEC,aAAa,KAClCC,UAAU,CAACV,GAAG,EAAEO,MAAM,CAACD,KAAK,CAACE,OAAO,EAAEC,aAAa,CAAC,EAAEP,OAAO,EAAEC,OAAO,EAAEC,OAAO;AACvF,CAAC,CAAC;AAEF,OAAO,MAAMO,eAAe,GAAkBC,KAAQ,IAAc;EAChE,IAAIhB,KAAK,EAAE;IACP,OAAO,UAAU,IAAIgB,KAAK,IAAI,OAAOA,KAAK,CAACC,QAAQ,KAAK,QAAQ;EACpE;EAEA,OAAOlB,SAAS,IAAI,gBAAgB,IAAIiB,KAAK,IAAI,OAAOA,KAAK,CAACE,cAAc,KAAK,QAAQ;AAC7F,CAAC;AAED,OAAO,MAAMJ,UAAU,GAAGA,CACtBV,GAAW,EACXe,KAAQ,EACRb,OAA+B,EAC/BC,OAAyB,EACzBC,OAA0C,KACtC;EACJ,MAAMY,OAAO,GAAGC,MAAM,CACjBD,OAAO,CAACnB,oBAAoB,CAACkB,KAAK,IAAI,CAAC,CAAC,EAAEX,OAAO,CAAC,CAAiC;EAExF,MAAMc,YAAY,GAAGD,MAAM,CACtBE,WAAW,CAACH,OAAO,CACfI,GAAG,CAACC,IAAA,IAAkB;IAAA,IAAjB,CAACrB,GAAG,EAAEY,KAAK,CAAC,GAAAS,IAAA;IACd;IACA,IAAI,OAAOT,KAAK,KAAK,UAAU,EAAE;MAC7B,OAAO,CAACZ,GAAG,EAAEY,KAAK,CAAC;IACvB;;IAEA;IACA,IAAIZ,GAAG,KAAK,cAAc,IAAIA,GAAG,KAAK,kBAAkB,EAAE;MACtD,OAAO,CACHA,GAAG,EACHU,UAAU,CAACV,GAAG,EAAEY,KAAK,EAAEV,OAAO,EAAEC,OAAO,EAAEC,OAAO,CAAC,CACpD;IACL;;IAEA;IACA,IAAIJ,GAAG,KAAK,WAAW,IAAIsB,KAAK,CAACC,OAAO,CAACX,KAAK,CAAC,EAAE;MAC7C,OAAO,CACHZ,GAAG,EACHY,KAAK,CAACQ,GAAG,CAACR,KAAK,IAAIF,UAAU,CAACV,GAAG,EAAEY,KAAK,EAAEV,OAAO,EAAEC,OAAO,EAAEC,OAAO,CAAC,CAAC,CACxE;IACL;;IAEA;IACA,IAAI,OAAOQ,KAAK,KAAK,QAAQ,IAAID,eAAe,CAACC,KAAK,CAAC,EAAE;MACrD,OAAO,CAACZ,GAAG,EAAEY,KAAK,CAAC;IACvB;IAEA,OAAO,CACHZ,GAAG,EACHN,qBAAqB,CAACkB,KAAoB,CAAC,CAC9C;EACL,CAAC,CACL,CAAM;EAEV,OAAOd,WAAW,CAACE,GAAG,EAAEkB,YAAY,EAAEhB,OAAO,EAAEC,OAAO,CAAC;AAC3D,CAAC"}
|
@@ -1,25 +1,45 @@
|
|
1
|
-
const
|
2
|
-
|
3
|
-
|
1
|
+
const getKeysForVariants = (value, variants) => {
|
2
|
+
// case for no specified variants by user, we should fallback to 'default'
|
3
|
+
if (!variants.length) {
|
4
|
+
return Object.entries(value).map(_ref => {
|
5
|
+
let [key, value] = _ref;
|
6
|
+
if ('default' in value) {
|
7
|
+
return [key, 'default'];
|
8
|
+
}
|
9
|
+
return undefined;
|
10
|
+
}).filter(Boolean);
|
4
11
|
}
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
12
|
+
return variants.map(_ref2 => {
|
13
|
+
let [variantKey, variantValue] = _ref2;
|
14
|
+
const variantStyle = value[variantKey];
|
15
|
+
if (variantStyle && variantValue && variantValue in variantStyle) {
|
16
|
+
return [variantKey, variantValue];
|
17
|
+
}
|
18
|
+
if (variantStyle && 'default' in variantStyle) {
|
19
|
+
return [variantKey, 'default'];
|
20
|
+
}
|
21
|
+
return undefined;
|
22
|
+
}).filter(Boolean);
|
9
23
|
};
|
10
|
-
export const
|
24
|
+
export const getStyleWithVariants = (style, variantValues) => {
|
11
25
|
if (!('variants' in style)) {
|
12
26
|
return style;
|
13
27
|
}
|
14
|
-
const
|
15
|
-
const
|
28
|
+
const keys = getKeysForVariants(style.variants, Object.entries(variantValues || {}));
|
29
|
+
const variantsValues = keys.map(_ref3 => {
|
30
|
+
let [key, nestedKey] = _ref3;
|
31
|
+
return style.variants[key][nestedKey];
|
32
|
+
}).reduce((acc, styles) => ({
|
33
|
+
...acc,
|
34
|
+
...styles
|
35
|
+
}), {});
|
16
36
|
const {
|
17
37
|
variants,
|
18
38
|
...otherStyles
|
19
39
|
} = style;
|
20
40
|
return {
|
21
41
|
...otherStyles,
|
22
|
-
...
|
42
|
+
...variantsValues
|
23
43
|
};
|
24
44
|
};
|
25
45
|
//# sourceMappingURL=variants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["getKeysForVariants","value","variants","length","Object","entries","map","_ref","key","undefined","filter","Boolean","_ref2","variantKey","variantValue","variantStyle","getStyleWithVariants","style","variantValues","keys","variantsValues","_ref3","nestedKey","reduce","acc","styles","otherStyles"],"sourceRoot":"../../../src","sources":["utils/variants.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AAEc,SAAS,CAAC,GAAAD,KAAA;IAAA,OAAOJ,KAAK,CAACf,QAAQ,CAAiDM,GAAG,CAAC,CAAiCc,SAAS,CAAC;EAAA,EAAC,CAC3IC,MAAM,CAAC,CAACC,GAAG,EAAEC,MAAM,MAAM;IAAE,GAAGD,GAAG;IAAE,GAAGC;EAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAEzD,MAAM;IAAEvB,QAAQ;IAAE,GAAGwB;EAAY,CAAC,GAAGT,KAAK;EAE1C,OAAO;IACH,GAAGS,WAAW;IACd,GAAGN;EACP,CAAC;AACL,CAAC"}
|
@@ -8,20 +8,20 @@ export declare const ScreenOrientation: {
|
|
8
8
|
readonly Landscape: "landscape";
|
9
9
|
readonly Portrait: "portrait";
|
10
10
|
};
|
11
|
-
export declare enum
|
11
|
+
export declare enum UnistylesEventType {
|
12
12
|
Theme = "theme",
|
13
13
|
Layout = "layout",
|
14
14
|
Plugin = "plugin"
|
15
15
|
}
|
16
16
|
export declare enum UnistylesError {
|
17
|
-
RuntimeUnavailable = "
|
18
|
-
ThemeNotFound = "
|
19
|
-
ThemeNotRegistered = "
|
20
|
-
ThemesCannotBeEmpty = "
|
21
|
-
BreakpointsCannotBeEmpty = "
|
22
|
-
BreakpointsMustStartFromZero = "
|
23
|
-
InvalidPluginName = "
|
24
|
-
DuplicatePluginName = "
|
25
|
-
CantRemoveInternalPlugin = "
|
17
|
+
RuntimeUnavailable = "Unistyles runtime is not available. Make sure you followed the installation instructions.",
|
18
|
+
ThemeNotFound = "You are trying to get a theme that is not registered.",
|
19
|
+
ThemeNotRegistered = "You are trying to set a theme that is not registered.",
|
20
|
+
ThemesCannotBeEmpty = "You are trying to register an empty themes object.",
|
21
|
+
BreakpointsCannotBeEmpty = "You are trying to register an empty breakpoints object.",
|
22
|
+
BreakpointsMustStartFromZero = "One breakpoint must start from 0.",
|
23
|
+
InvalidPluginName = "Plugin name can't start from reserved prefix. Use another name.",
|
24
|
+
DuplicatePluginName = "You are trying to register a plugin with a name that is already registered.",
|
25
|
+
CantRemoveInternalPlugin = "You are trying to remove an internal unistyles plugin."
|
26
26
|
}
|
27
27
|
//# sourceMappingURL=common.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/common.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,YAAa,MAAM,SAEnC,CAAA;AAED,eAAO,MAAM,QAAQ,SAAqD,CAAA;AAC1E,eAAO,MAAM,KAAK,SAAwB,CAAA;AAC1C,eAAO,MAAM,KAAK,SAAwB,CAAA;AAC1C,eAAO,MAAM,SAAS,SAA4B,CAAA;AAClD,eAAO,MAAM,QAAQ,SAAgC,CAAA;AAErD,eAAO,MAAM,iBAAiB;;;CAGpB,CAAA;AAEV,oBAAY,
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/common.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,YAAa,MAAM,SAEnC,CAAA;AAED,eAAO,MAAM,QAAQ,SAAqD,CAAA;AAC1E,eAAO,MAAM,KAAK,SAAwB,CAAA;AAC1C,eAAO,MAAM,KAAK,SAAwB,CAAA;AAC1C,eAAO,MAAM,SAAS,SAA4B,CAAA;AAClD,eAAO,MAAM,QAAQ,SAAgC,CAAA;AAErD,eAAO,MAAM,iBAAiB;;;CAGpB,CAAA;AAEV,oBAAY,kBAAkB;IAC1B,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,MAAM,WAAW;CACpB;AAED,oBAAY,cAAc;IACtB,kBAAkB,8FAA8F;IAChH,aAAa,0DAA0D;IACvE,kBAAkB,0DAA0D;IAC5E,mBAAmB,uDAAuD;IAC1E,wBAAwB,4DAA4D;IACpF,4BAA4B,sCAAsC;IAClE,iBAAiB,oEAAqE;IACtF,mBAAmB,gFAAgF;IACnG,wBAAwB,2DAA2D;CACtF"}
|