@semcore/utils
Advanced tools
Comparing version 3.7.0 to 3.8.0
@@ -5,2 +5,13 @@ # Changelog | ||
## [3.8.0] - 2020-02-12 | ||
### Added | ||
- Добавили возможность изменить свойство `getText` для компонентов, которые обернуты в `WithI18n` | ||
- Добавили новые функции `useEnhancedEffect, useEventCallback`, которые могут быть использованы вместо одноименных `useEffect, useLayoutEffect, useCallback`, но с небольшими модификациями для предсказуемости поведения | ||
### Changed | ||
- Убрали неиспользуемые цвета `violet`, `dark-violet` и добавили `keyborad-focus` в палитре цветов `sellerly` | ||
## [3.7.0] - 2020-02-04 | ||
@@ -7,0 +18,0 @@ |
@@ -11,6 +11,7 @@ import React from "react"; | ||
declare const I18nProvider: React.Provider<LocaleKeys>, I18nConsumer: React.Consumer<LocaleKeys>; | ||
declare function getText(dictionary: Dictionary, locale: LocaleKeys): (key: React.ReactText) => string; | ||
interface IWithI18nInjectedProps { | ||
getText: WithI18n['getText']; | ||
} | ||
interface IWithI18nProps { | ||
interface IWithI18nProps extends IWithI18nInjectedProps { | ||
locale?: LocaleKeys; | ||
@@ -22,3 +23,6 @@ children?(props: IWithI18nInjectedProps): React.ReactNode; | ||
static contextType: React.Context<LocaleKeys>; | ||
getText: (dictionary: Dictionary, selfLocale: any) => (key: React.ReactText) => string; | ||
static defaultProps: { | ||
getText: typeof getText; | ||
}; | ||
getText: (dictionary: Dictionary, selfLocale: any) => any; | ||
render(): React.ReactNode; | ||
@@ -25,0 +29,0 @@ } |
@@ -47,3 +47,5 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
_this.getText = function (dictionary, selfLocale) { | ||
var locale = _this.props.locale; | ||
var _this$props = _this.props, | ||
locale = _this$props.locale, | ||
getText = _this$props.getText; | ||
var contextLocale = _this.context; | ||
@@ -69,2 +71,5 @@ return getText(dictionary, selfLocale || locale || contextLocale); | ||
WithI18n.contextType = Context; | ||
WithI18n.defaultProps = { | ||
getText: getText | ||
}; | ||
@@ -71,0 +76,0 @@ var useI18n = function useI18n(dictionary) { |
@@ -23,3 +23,3 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
// @ts-ignore | ||
var version = "3.7.0"; | ||
var version = "3.8.0"; | ||
sh = document.createElement('style'); | ||
@@ -26,0 +26,0 @@ sh.setAttribute('data-ui-v', version); |
{ | ||
"name": "@semcore/utils", | ||
"description": "SEMRush Utils Component", | ||
"version": "3.7.0", | ||
"version": "3.8.0", | ||
"author": "Roman Lysov <r.lysov@semrush.com>", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
156691
141
2121