@semcore/core 16.6.0-prerelease.3 → 16.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core-types/Component.d.ts +33 -79
- package/lib/core-types/Component.js +14 -46
- package/lib/core-types/Component.js.map +1 -1
- package/lib/core-types/Component.mjs +11 -7
- package/lib/core-types/Component.mjs.map +1 -1
- package/lib/core-types/symbols.mjs +9 -9
- package/lib/coreFactory.d.ts +6 -23
- package/lib/coreFactory.js +53 -22
- package/lib/coreFactory.js.map +1 -1
- package/lib/coreFactory.mjs +54 -35
- package/lib/coreFactory.mjs.map +1 -1
- package/lib/decorators/propsObserver.d.ts +11 -0
- package/lib/decorators/propsObserver.js +77 -0
- package/lib/decorators/propsObserver.js.map +1 -0
- package/lib/decorators/propsObserver.mjs +70 -0
- package/lib/decorators/propsObserver.mjs.map +1 -0
- package/lib/decorators/reactive.d.ts +11 -0
- package/lib/decorators/reactive.js +51 -0
- package/lib/decorators/reactive.js.map +1 -0
- package/lib/decorators/reactive.mjs +45 -0
- package/lib/decorators/reactive.mjs.map +1 -0
- package/lib/enhancement/Children.mjs +1 -1
- package/lib/enhancement/staticChildren.mjs +3 -3
- package/lib/enhancement/style.mjs +2 -2
- package/lib/enhancement/uncontrolledProps.js +2 -1
- package/lib/enhancement/uncontrolledProps.js.map +1 -1
- package/lib/enhancement/uncontrolledProps.mjs +2 -1
- package/lib/enhancement/uncontrolledProps.mjs.map +1 -1
- package/lib/esm/core-types/Component.mjs +11 -7
- package/lib/esm/core-types/symbols.mjs +9 -9
- package/lib/esm/coreFactory.mjs +54 -35
- package/lib/esm/enhancement/Children.mjs +1 -1
- package/lib/esm/enhancement/staticChildren.mjs +3 -3
- package/lib/esm/enhancement/style.mjs +2 -2
- package/lib/esm/enhancement/uncontrolledProps.mjs +2 -1
- package/lib/esm/styled/sstyled.mjs +1 -1
- package/lib/esm/utils/enhances/WithI18n.mjs +1 -46
- package/lib/esm/utils/ref.mjs +0 -14
- package/lib/index.d.ts +3 -3
- package/lib/index.js.map +1 -1
- package/lib/index.mjs.map +1 -1
- package/lib/styled/index.d.ts +1 -5
- package/lib/styled/index.js.map +1 -1
- package/lib/styled/index.mjs.map +1 -1
- package/lib/styled/sstyled.mjs +1 -1
- package/lib/utils/enhances/WithCSS.d.ts +2 -30
- package/lib/utils/enhances/WithCSS.js +4 -57
- package/lib/utils/enhances/WithCSS.js.map +1 -1
- package/lib/utils/enhances/WithCSS.mjs +2 -53
- package/lib/utils/enhances/WithCSS.mjs.map +1 -1
- package/lib/utils/enhances/WithI18n.d.ts +1 -30
- package/lib/utils/enhances/WithI18n.js +1 -57
- package/lib/utils/enhances/WithI18n.js.map +1 -1
- package/lib/utils/enhances/WithI18n.mjs +1 -46
- package/lib/utils/enhances/WithI18n.mjs.map +1 -1
- package/lib/utils/enhances/animatedSizeEnhance.d.ts +0 -4
- package/lib/utils/enhances/animatedSizeEnhance.js +0 -2
- package/lib/utils/enhances/animatedSizeEnhance.js.map +1 -1
- package/lib/utils/enhances/animatedSizeEnhance.mjs +0 -3
- package/lib/utils/enhances/animatedSizeEnhance.mjs.map +1 -1
- package/lib/utils/enhances/i18nEnhance.d.ts +0 -4
- package/lib/utils/enhances/i18nEnhance.js +0 -2
- package/lib/utils/enhances/i18nEnhance.js.map +1 -1
- package/lib/utils/enhances/i18nEnhance.mjs.map +1 -1
- package/lib/utils/eventEmitter.d.ts +10 -6
- package/lib/utils/eventEmitter.js +55 -27
- package/lib/utils/eventEmitter.js.map +1 -1
- package/lib/utils/eventEmitter.mjs +55 -27
- package/lib/utils/eventEmitter.mjs.map +1 -1
- package/lib/utils/getDisplayName.mjs +3 -5
- package/lib/utils/indentStyles.d.ts +3 -0
- package/lib/utils/indentStyles.js +45 -0
- package/lib/utils/indentStyles.js.map +1 -0
- package/lib/utils/indentStyles.mjs +36 -0
- package/lib/utils/indentStyles.mjs.map +1 -0
- package/lib/utils/injectStyle.js +1 -1
- package/lib/utils/injectStyle.js.map +1 -1
- package/lib/utils/injectStyle.mjs +1 -1
- package/lib/utils/injectStyle.mjs.map +1 -1
- package/lib/utils/ref.d.ts +1 -3
- package/lib/utils/ref.js +0 -14
- package/lib/utils/ref.js.map +1 -1
- package/lib/utils/ref.mjs +0 -14
- package/lib/utils/ref.mjs.map +1 -1
- package/lib/utils/uniqueID.d.ts +0 -4
- package/lib/utils/uniqueID.js +1 -3
- package/lib/utils/uniqueID.js.map +1 -1
- package/lib/utils/uniqueID.mjs +1 -4
- package/lib/utils/uniqueID.mjs.map +1 -1
- package/lib/utils/use/useColorResolver.js +1 -1
- package/lib/utils/use/useColorResolver.js.map +1 -1
- package/lib/utils/use/useColorResolver.mjs +1 -1
- package/lib/utils/use/useColorResolver.mjs.map +1 -1
- package/lib/utils/use/useEnhancedEffect.d.ts +1 -1
- package/lib/utils/zIndexStacking.d.ts +3 -1
- package/lib/utils/zIndexStacking.js.map +1 -1
- package/lib/utils/zIndexStacking.mjs.map +1 -1
- package/package.json +2 -2
- package/lib/enhancement/bindHandler.d.ts +0 -5
- package/lib/enhancement/bindHandler.js +0 -53
- package/lib/enhancement/bindHandler.js.map +0 -1
- package/lib/enhancement/bindHandler.mjs +0 -48
- package/lib/enhancement/bindHandler.mjs.map +0 -1
- package/lib/enhancement/hoistProps.d.ts +0 -10
- package/lib/enhancement/hoistProps.js +0 -95
- package/lib/enhancement/hoistProps.js.map +0 -1
- package/lib/enhancement/hoistProps.mjs +0 -78
- package/lib/enhancement/hoistProps.mjs.map +0 -1
- package/lib/esm/enhancement/bindHandler.mjs +0 -48
- package/lib/esm/enhancement/hoistProps.mjs +0 -78
- package/lib/esm/utils/createHoc.mjs +0 -42
- package/lib/esm/utils/getDisplayName.mjs +0 -6
- package/lib/utils/ScreenReaderOnly.d.ts +0 -8
- package/lib/utils/ScreenReaderOnly.js +0 -30
- package/lib/utils/ScreenReaderOnly.js.map +0 -1
- package/lib/utils/ScreenReaderOnly.mjs +0 -24
- package/lib/utils/ScreenReaderOnly.mjs.map +0 -1
- package/lib/utils/createHoc.d.ts +0 -3
- package/lib/utils/createHoc.js +0 -52
- package/lib/utils/createHoc.js.map +0 -1
- package/lib/utils/createHoc.mjs +0 -42
- package/lib/utils/createHoc.mjs.map +0 -1
- package/lib/utils/enhances/WithAutoFocus.d.ts +0 -14
- package/lib/utils/enhances/WithAutoFocus.js +0 -72
- package/lib/utils/enhances/WithAutoFocus.js.map +0 -1
- package/lib/utils/enhances/WithAutoFocus.mjs +0 -66
- package/lib/utils/enhances/WithAutoFocus.mjs.map +0 -1
- package/lib/utils/enhances/WithKeyboardFocus.d.ts +0 -46
- package/lib/utils/enhances/WithKeyboardFocus.js +0 -94
- package/lib/utils/enhances/WithKeyboardFocus.js.map +0 -1
- package/lib/utils/enhances/WithKeyboardFocus.mjs +0 -88
- package/lib/utils/enhances/WithKeyboardFocus.mjs.map +0 -1
- package/lib/utils/enhances/WithRef.d.ts +0 -3
- package/lib/utils/enhances/WithRef.js +0 -25
- package/lib/utils/enhances/WithRef.js.map +0 -1
- package/lib/utils/enhances/WithRef.mjs +0 -18
- package/lib/utils/enhances/WithRef.mjs.map +0 -1
- package/lib/utils/enhances/autoFocusEnhance.d.ts +0 -10
- package/lib/utils/enhances/autoFocusEnhance.js +0 -45
- package/lib/utils/enhances/autoFocusEnhance.js.map +0 -1
- package/lib/utils/enhances/autoFocusEnhance.mjs +0 -38
- package/lib/utils/enhances/autoFocusEnhance.mjs.map +0 -1
- package/lib/utils/enhances/keyboardFocusEnhance.d.ts +0 -27
- package/lib/utils/enhances/keyboardFocusEnhance.js +0 -63
- package/lib/utils/enhances/keyboardFocusEnhance.js.map +0 -1
- package/lib/utils/enhances/keyboardFocusEnhance.mjs +0 -57
- package/lib/utils/enhances/keyboardFocusEnhance.mjs.map +0 -1
- package/lib/utils/if.d.ts +0 -11
- package/lib/utils/if.js +0 -15
- package/lib/utils/if.js.map +0 -1
- package/lib/utils/if.mjs +0 -9
- package/lib/utils/if.mjs.map +0 -1
- package/lib/utils/use/useCss.d.ts +0 -4
- package/lib/utils/use/useCss.js +0 -19
- package/lib/utils/use/useCss.js.map +0 -1
- package/lib/utils/use/useCss.mjs +0 -12
- package/lib/utils/use/useCss.mjs.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import type { UnknownProperties } from '../../core-types/UnknownProperties';
|
|
1
|
+
import React from 'react';
|
|
3
2
|
export type LocaleKeys = string;
|
|
4
3
|
export type DictionaryItem = {
|
|
5
4
|
[key: string]: string;
|
|
@@ -9,35 +8,7 @@ export type Dictionary = {
|
|
|
9
8
|
};
|
|
10
9
|
export declare const Context: React.Context<string | undefined>;
|
|
11
10
|
declare const I18nProvider: React.Provider<string | undefined>, I18nConsumer: React.Consumer<string | undefined>;
|
|
12
|
-
declare function getText(dictionaries: Dictionary, locale: LocaleKeys): (key: keyof DictionaryItem) => any;
|
|
13
|
-
/** @deprecated */
|
|
14
|
-
export interface IWithI18nInjectedProps extends WithI18nInjectedProps, UnknownProperties {
|
|
15
|
-
}
|
|
16
|
-
export type WithI18nInjectedProps = {
|
|
17
|
-
getText: WithI18n['getText'];
|
|
18
|
-
};
|
|
19
|
-
/** @deprecated */
|
|
20
|
-
export interface IWithI18nProps extends WithI18nProps, UnknownProperties {
|
|
21
|
-
}
|
|
22
|
-
export type WithI18nProps = WithI18nInjectedProps & {
|
|
23
|
-
locale?: LocaleKeys;
|
|
24
|
-
children?(props: IWithI18nInjectedProps): React.ReactNode;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* @deprecated use `useI18n` instead
|
|
28
|
-
*/
|
|
29
|
-
declare class WithI18n extends Component<IWithI18nProps> {
|
|
30
|
-
context: LocaleKeys;
|
|
31
|
-
static contextType: React.Context<string | undefined>;
|
|
32
|
-
static defaultProps: {
|
|
33
|
-
getText: typeof getText;
|
|
34
|
-
};
|
|
35
|
-
getText: (dictionary: Dictionary, selfLocale?: string) => string;
|
|
36
|
-
render(): any;
|
|
37
|
-
}
|
|
38
11
|
declare const useI18n: (dictionary: Dictionary, locale?: LocaleKeys, fallbackDictionary?: Dictionary) => (messageId: string, variables?: {
|
|
39
12
|
[key: string]: string | number | undefined;
|
|
40
13
|
}) => string;
|
|
41
|
-
declare const _default: (options?: {}) => (WrappedComponent: React.ComponentType) => React.ComponentClass;
|
|
42
|
-
export default _default;
|
|
43
14
|
export { useI18n, I18nProvider, I18nConsumer };
|
|
@@ -1,72 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports.useI18n = exports
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
|
+
exports.useI18n = exports.I18nProvider = exports.I18nConsumer = exports.Context = void 0;
|
|
14
8
|
var _intl = require("@formatjs/intl");
|
|
15
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
|
-
var _createHoc = _interopRequireDefault(require("../createHoc"));
|
|
17
10
|
var _i18nEnhance = require("./i18nEnhance");
|
|
18
11
|
var Context = exports.Context = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
19
12
|
var I18nProvider = exports.I18nProvider = Context.Provider,
|
|
20
13
|
I18nConsumer = exports.I18nConsumer = Context.Consumer;
|
|
21
14
|
var messagesCache = (0, _intl.createIntlCache)();
|
|
22
|
-
function getText(dictionaries, locale) {
|
|
23
|
-
return function (key) {
|
|
24
|
-
var dictionary = dictionaries[locale];
|
|
25
|
-
return dictionary ? dictionary[key] : dictionaries['en'][key];
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** @deprecated */
|
|
30
|
-
|
|
31
|
-
/** @deprecated */
|
|
32
|
-
/**
|
|
33
|
-
* @deprecated use `useI18n` instead
|
|
34
|
-
*/
|
|
35
|
-
var WithI18n = /*#__PURE__*/function (_Component) {
|
|
36
|
-
function WithI18n() {
|
|
37
|
-
var _this;
|
|
38
|
-
(0, _classCallCheck2["default"])(this, WithI18n);
|
|
39
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
40
|
-
args[_key] = arguments[_key];
|
|
41
|
-
}
|
|
42
|
-
_this = (0, _callSuper2["default"])(this, WithI18n, [].concat(args));
|
|
43
|
-
/* @ts-ignore */
|
|
44
|
-
(0, _defineProperty2["default"])(_this, "context", void 0);
|
|
45
|
-
(0, _defineProperty2["default"])(_this, "getText", function (dictionary, selfLocale) {
|
|
46
|
-
var _this$props = _this.props,
|
|
47
|
-
locale = _this$props.locale,
|
|
48
|
-
getText = _this$props.getText;
|
|
49
|
-
var contextLocale = _this.context;
|
|
50
|
-
return getText(dictionary, selfLocale || locale || contextLocale);
|
|
51
|
-
});
|
|
52
|
-
return _this;
|
|
53
|
-
}
|
|
54
|
-
(0, _inherits2["default"])(WithI18n, _Component);
|
|
55
|
-
return (0, _createClass2["default"])(WithI18n, [{
|
|
56
|
-
key: "render",
|
|
57
|
-
value: function render() {
|
|
58
|
-
var _ref = this.props,
|
|
59
|
-
children = _ref.children;
|
|
60
|
-
return children({
|
|
61
|
-
getText: this.getText
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}]);
|
|
65
|
-
}(_react.Component);
|
|
66
|
-
(0, _defineProperty2["default"])(WithI18n, "contextType", Context);
|
|
67
|
-
(0, _defineProperty2["default"])(WithI18n, "defaultProps", {
|
|
68
|
-
getText: getText
|
|
69
|
-
});
|
|
70
15
|
var useI18n = exports.useI18n = function useI18n(dictionary) {
|
|
71
16
|
var _React$useContext;
|
|
72
17
|
var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en';
|
|
@@ -85,5 +30,4 @@ var useI18n = exports.useI18n = function useI18n(dictionary) {
|
|
|
85
30
|
}, variables);
|
|
86
31
|
}, [intl]);
|
|
87
32
|
};
|
|
88
|
-
var _default = exports["default"] = (0, _createHoc["default"])(WithI18n);
|
|
89
33
|
//# sourceMappingURL=WithI18n.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WithI18n.js","names":["_intl","require","_react","_interopRequireWildcard","
|
|
1
|
+
{"version":3,"file":"WithI18n.js","names":["_intl","require","_react","_interopRequireWildcard","_i18nEnhance","Context","exports","createContext","undefined","I18nProvider","Provider","I18nConsumer","Consumer","messagesCache","createIntlCache","useI18n","dictionary","_React$useContext","locale","arguments","length","fallbackDictionary","lang","React","useContext","resolvedDictionary","useAsyncI18nMessages","intl","useMemo","createIntl","messages","useCallback","messageId","variables","formatMessage","id"],"sources":["../../../src/utils/enhances/WithI18n.tsx"],"sourcesContent":["import { createIntl, createIntlCache } from '@formatjs/intl';\nimport React, { createContext } from 'react';\n\nimport { useAsyncI18nMessages } from './i18nEnhance';\n\nexport type LocaleKeys = string;\nexport type DictionaryItem = { [key: string]: string };\nexport type Dictionary = { [locale: string]: DictionaryItem | (() => Promise<DictionaryItem>) };\nexport const Context = createContext<LocaleKeys | undefined>(undefined);\nconst { Provider: I18nProvider, Consumer: I18nConsumer } = Context;\nconst messagesCache = createIntlCache();\n\nconst useI18n = (\n dictionary: Dictionary,\n locale: LocaleKeys = 'en',\n fallbackDictionary?: Dictionary,\n) => {\n const lang = React.useContext(Context) ?? locale;\n const resolvedDictionary = useAsyncI18nMessages(dictionary, lang, fallbackDictionary);\n const intl = React.useMemo(\n () => createIntl({ locale: lang, messages: resolvedDictionary }, messagesCache),\n [resolvedDictionary, lang],\n );\n\n return React.useCallback(\n (messageId: string, variables?: { [key: string]: string | number | undefined }) => {\n return intl.formatMessage({ id: messageId ?? '' }, variables);\n },\n [intl],\n );\n};\n\nexport { useI18n, I18nProvider, I18nConsumer };\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AAKO,IAAMI,OAAO,GAAAC,OAAA,CAAAD,OAAA,gBAAG,IAAAE,oBAAa,EAAyBC,SAAS,CAAC;AACvE,IAAkBC,YAAY,GAAAH,OAAA,CAAAG,YAAA,GAA6BJ,OAAO,CAA1DK,QAAQ;EAA0BC,YAAY,GAAAL,OAAA,CAAAK,YAAA,GAAKN,OAAO,CAAlCO,QAAQ;AACxC,IAAMC,aAAa,GAAG,IAAAC,qBAAe,EAAC,CAAC;AAEvC,IAAMC,OAAO,GAAAT,OAAA,CAAAS,OAAA,GAAG,SAAVA,OAAOA,CACXC,UAAsB,EAGnB;EAAA,IAAAC,iBAAA;EAAA,IAFHC,MAAkB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAX,SAAA,GAAAW,SAAA,MAAG,IAAI;EAAA,IACzBE,kBAA+B,GAAAF,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAX,SAAA;EAE/B,IAAMc,IAAI,IAAAL,iBAAA,GAAGM,iBAAK,CAACC,UAAU,CAACnB,OAAO,CAAC,cAAAY,iBAAA,cAAAA,iBAAA,GAAIC,MAAM;EAChD,IAAMO,kBAAkB,GAAG,IAAAC,iCAAoB,EAACV,UAAU,EAAEM,IAAI,EAAED,kBAAkB,CAAC;EACrF,IAAMM,IAAI,GAAGJ,iBAAK,CAACK,OAAO,CACxB;IAAA,OAAM,IAAAC,gBAAU,EAAC;MAAEX,MAAM,EAAEI,IAAI;MAAEQ,QAAQ,EAAEL;IAAmB,CAAC,EAAEZ,aAAa,CAAC;EAAA,GAC/E,CAACY,kBAAkB,EAAEH,IAAI,CAC3B,CAAC;EAED,OAAOC,iBAAK,CAACQ,WAAW,CACtB,UAACC,SAAiB,EAAEC,SAA0D,EAAK;IACjF,OAAON,IAAI,CAACO,aAAa,CAAC;MAAEC,EAAE,EAAEH,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI;IAAG,CAAC,EAAEC,SAAS,CAAC;EAC/D,CAAC,EACD,CAACN,IAAI,CACP,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,52 +1,9 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
1
|
import { createIntlCache, createIntl } from "@formatjs/intl";
|
|
7
|
-
import React, { createContext
|
|
8
|
-
import createHoc from "../createHoc.mjs";
|
|
2
|
+
import React, { createContext } from "react";
|
|
9
3
|
import { useAsyncI18nMessages } from "./i18nEnhance.mjs";
|
|
10
4
|
var Context = /* @__PURE__ */ createContext(void 0);
|
|
11
5
|
var I18nProvider = Context.Provider, I18nConsumer = Context.Consumer;
|
|
12
6
|
var messagesCache = createIntlCache();
|
|
13
|
-
function getText(dictionaries, locale) {
|
|
14
|
-
return function(key) {
|
|
15
|
-
var dictionary = dictionaries[locale];
|
|
16
|
-
return dictionary ? dictionary[key] : dictionaries["en"][key];
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
var WithI18n = /* @__PURE__ */ (function(_Component) {
|
|
20
|
-
function WithI18n2() {
|
|
21
|
-
var _this;
|
|
22
|
-
_classCallCheck(this, WithI18n2);
|
|
23
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
24
|
-
args[_key] = arguments[_key];
|
|
25
|
-
}
|
|
26
|
-
_this = _callSuper(this, WithI18n2, [].concat(args));
|
|
27
|
-
_defineProperty(_this, "context", void 0);
|
|
28
|
-
_defineProperty(_this, "getText", function(dictionary, selfLocale) {
|
|
29
|
-
var _this$props = _this.props, locale = _this$props.locale, getText2 = _this$props.getText;
|
|
30
|
-
var contextLocale = _this.context;
|
|
31
|
-
return getText2(dictionary, selfLocale || locale || contextLocale);
|
|
32
|
-
});
|
|
33
|
-
return _this;
|
|
34
|
-
}
|
|
35
|
-
_inherits(WithI18n2, _Component);
|
|
36
|
-
return _createClass(WithI18n2, [{
|
|
37
|
-
key: "render",
|
|
38
|
-
value: function render() {
|
|
39
|
-
var _ref = this.props, children = _ref.children;
|
|
40
|
-
return children({
|
|
41
|
-
getText: this.getText
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}]);
|
|
45
|
-
})(Component);
|
|
46
|
-
_defineProperty(WithI18n, "contextType", Context);
|
|
47
|
-
_defineProperty(WithI18n, "defaultProps", {
|
|
48
|
-
getText
|
|
49
|
-
});
|
|
50
7
|
var useI18n = function useI18n2(dictionary) {
|
|
51
8
|
var _React$useContext;
|
|
52
9
|
var locale = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "en";
|
|
@@ -65,11 +22,9 @@ var useI18n = function useI18n2(dictionary) {
|
|
|
65
22
|
}, variables);
|
|
66
23
|
}, [intl]);
|
|
67
24
|
};
|
|
68
|
-
const WithI18n$1 = createHoc(WithI18n);
|
|
69
25
|
export {
|
|
70
26
|
Context,
|
|
71
27
|
I18nConsumer,
|
|
72
28
|
I18nProvider,
|
|
73
|
-
WithI18n$1 as default,
|
|
74
29
|
useI18n
|
|
75
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WithI18n.mjs","names":["createIntl","createIntlCache","React","
|
|
1
|
+
{"version":3,"file":"WithI18n.mjs","names":["createIntl","createIntlCache","React","createContext","useAsyncI18nMessages","Context","undefined","I18nProvider","Provider","I18nConsumer","Consumer","messagesCache","useI18n","dictionary","_React$useContext","locale","arguments","length","fallbackDictionary","lang","useContext","resolvedDictionary","intl","useMemo","messages","useCallback","messageId","variables","formatMessage","id"],"sources":["../../../src/utils/enhances/WithI18n.tsx"],"sourcesContent":["import { createIntl, createIntlCache } from '@formatjs/intl';\nimport React, { createContext } from 'react';\n\nimport { useAsyncI18nMessages } from './i18nEnhance';\n\nexport type LocaleKeys = string;\nexport type DictionaryItem = { [key: string]: string };\nexport type Dictionary = { [locale: string]: DictionaryItem | (() => Promise<DictionaryItem>) };\nexport const Context = createContext<LocaleKeys | undefined>(undefined);\nconst { Provider: I18nProvider, Consumer: I18nConsumer } = Context;\nconst messagesCache = createIntlCache();\n\nconst useI18n = (\n dictionary: Dictionary,\n locale: LocaleKeys = 'en',\n fallbackDictionary?: Dictionary,\n) => {\n const lang = React.useContext(Context) ?? locale;\n const resolvedDictionary = useAsyncI18nMessages(dictionary, lang, fallbackDictionary);\n const intl = React.useMemo(\n () => createIntl({ locale: lang, messages: resolvedDictionary }, messagesCache),\n [resolvedDictionary, lang],\n );\n\n return React.useCallback(\n (messageId: string, variables?: { [key: string]: string | number | undefined }) => {\n return intl.formatMessage({ id: messageId ?? '' }, variables);\n },\n [intl],\n );\n};\n\nexport { useI18n, I18nProvider, I18nConsumer };\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,eAAe,QAAQ,gBAAgB;AAC5D,OAAOC,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAE5C,SAASC,oBAAoB,QAAQ,mBAAe;AAKpD,OAAO,IAAMC,OAAO,gBAAGF,aAAa,CAAyBG,SAAS,CAAC;AACvE,IAAkBC,YAAY,GAA6BF,OAAO,CAA1DG,QAAQ;EAA0BC,YAAY,GAAKJ,OAAO,CAAlCK,QAAQ;AACxC,IAAMC,aAAa,GAAGV,eAAe,CAAC,CAAC;AAEvC,IAAMW,OAAO,GAAG,SAAVA,OAAOA,CACXC,UAAsB,EAGnB;EAAA,IAAAC,iBAAA;EAAA,IAFHC,MAAkB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAV,SAAA,GAAAU,SAAA,MAAG,IAAI;EAAA,IACzBE,kBAA+B,GAAAF,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAV,SAAA;EAE/B,IAAMa,IAAI,IAAAL,iBAAA,GAAGZ,KAAK,CAACkB,UAAU,CAACf,OAAO,CAAC,cAAAS,iBAAA,cAAAA,iBAAA,GAAIC,MAAM;EAChD,IAAMM,kBAAkB,GAAGjB,oBAAoB,CAACS,UAAU,EAAEM,IAAI,EAAED,kBAAkB,CAAC;EACrF,IAAMI,IAAI,GAAGpB,KAAK,CAACqB,OAAO,CACxB;IAAA,OAAMvB,UAAU,CAAC;MAAEe,MAAM,EAAEI,IAAI;MAAEK,QAAQ,EAAEH;IAAmB,CAAC,EAAEV,aAAa,CAAC;EAAA,GAC/E,CAACU,kBAAkB,EAAEF,IAAI,CAC3B,CAAC;EAED,OAAOjB,KAAK,CAACuB,WAAW,CACtB,UAACC,SAAiB,EAAEC,SAA0D,EAAK;IACjF,OAAOL,IAAI,CAACM,aAAa,CAAC;MAAEC,EAAE,EAAEH,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI;IAAG,CAAC,EAAEC,SAAS,CAAC;EAC/D,CAAC,EACD,CAACL,IAAI,CACP,CAAC;AACH,CAAC;AAED,SAASV,OAAO,EAAEL,YAAY,EAAEE,YAAY","ignoreList":[]}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type { UnknownProperties } from '../../core-types/UnknownProperties';
|
|
2
|
-
/** @deprecated */
|
|
3
|
-
export interface IWithAnimatedSizeEnhanceProps extends WithAnimatedSizeEnhanceProps, UnknownProperties {
|
|
4
|
-
}
|
|
5
1
|
export type WithAnimatedSizeEnhanceProps = {
|
|
6
2
|
animationsDisabled?: boolean;
|
|
7
3
|
};
|
|
@@ -12,8 +12,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
12
12
|
var _ref2 = require("../ref");
|
|
13
13
|
var _useEnhancedEffect = _interopRequireDefault(require("../use/useEnhancedEffect"));
|
|
14
14
|
var _excluded = ["ref", "__animatedEnhanceInstanceId", "duration"];
|
|
15
|
-
/** @deprecated */
|
|
16
|
-
|
|
17
15
|
var uniqueId = 0;
|
|
18
16
|
function animatedSizeEnhance(_ref) {
|
|
19
17
|
var _ref$animateProps = _ref.animateProps,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animatedSizeEnhance.js","names":["_react","_interopRequireDefault","require","_ref2","_useEnhancedEffect","_excluded","uniqueId","animatedSizeEnhance","_ref","_ref$animateProps","animateProps","_ref$onChangeOf","onChangeOf","props","ref","__animatedEnhanceInstanceId","duration","other","_objectWithoutProperties2","nodeRef","React","createRef","lastSizesRef","useRef","prevPropsRef","animatedSizeInstanceIdRef","current","useEnhancedEffect","animationsDisabled","undefined","node","every","value","i","length","getBoundingClientRect","sizes","Math","abs","style","getPropertyValue","endsWith","transition","concat","timeout","handleTransitionEnd","clearTimeout","removeEventListener","animationFrame","requestAnimationFrame","addEventListener","setTimeout","cancelAnimationFrame","_toConsumableArray2","map","propName","_objectSpread2","useForkRef","_default","exports"],"sources":["../../../src/utils/enhances/animatedSizeEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nimport
|
|
1
|
+
{"version":3,"file":"animatedSizeEnhance.js","names":["_react","_interopRequireDefault","require","_ref2","_useEnhancedEffect","_excluded","uniqueId","animatedSizeEnhance","_ref","_ref$animateProps","animateProps","_ref$onChangeOf","onChangeOf","props","ref","__animatedEnhanceInstanceId","duration","other","_objectWithoutProperties2","nodeRef","React","createRef","lastSizesRef","useRef","prevPropsRef","animatedSizeInstanceIdRef","current","useEnhancedEffect","animationsDisabled","undefined","node","every","value","i","length","getBoundingClientRect","sizes","Math","abs","style","getPropertyValue","endsWith","transition","concat","timeout","handleTransitionEnd","clearTimeout","removeEventListener","animationFrame","requestAnimationFrame","addEventListener","setTimeout","cancelAnimationFrame","_toConsumableArray2","map","propName","_objectSpread2","useForkRef","_default","exports"],"sources":["../../../src/utils/enhances/animatedSizeEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nimport { useForkRef } from '../ref';\nimport useEnhancedEffect from '../use/useEnhancedEffect';\n\nexport type WithAnimatedSizeEnhanceProps = {\n animationsDisabled?: boolean;\n};\n\nlet uniqueId = 0;\n\nfunction animatedSizeEnhance({\n animateProps = [],\n onChangeOf = [],\n}: {\n animateProps: ('width' | 'height')[];\n onChangeOf: string[];\n}) {\n return (props: any) => {\n const { ref, __animatedEnhanceInstanceId, duration, ...other } = props;\n const nodeRef = React.createRef<HTMLElement>();\n const lastSizesRef = React.useRef<(number | undefined)[]>([]);\n const prevPropsRef = React.useRef(props);\n const animatedSizeInstanceIdRef = React.useRef(uniqueId++);\n\n prevPropsRef.current = props;\n\n useEnhancedEffect(() => {\n if (props.animationsDisabled) return;\n if (\n __animatedEnhanceInstanceId !== undefined &&\n __animatedEnhanceInstanceId !== animatedSizeInstanceIdRef.current\n )\n return;\n if (!nodeRef.current) {\n return;\n }\n const node = nodeRef.current;\n if (lastSizesRef.current.every((value) => value === undefined)) {\n for (let i = 0; i < animateProps.length; i++) {\n // @ts-ignore\n lastSizesRef.current[i] = node.getBoundingClientRect()[animateProps[i]];\n }\n return;\n }\n\n const sizes: (number | undefined)[] = [];\n for (let i = 0; i < animateProps.length; i++) {\n sizes[i] = node.getBoundingClientRect()[animateProps[i]];\n if (\n Math.abs(lastSizesRef.current[i]! - sizes[i]!) < 3 ||\n node.style.getPropertyValue(animateProps[i]).endsWith('%')\n ) {\n lastSizesRef.current[i] = sizes[i];\n sizes[i] = undefined;\n }\n }\n if (sizes.every((value) => value === undefined)) return;\n\n node.style.transition = 'none';\n for (let i = 0; i < animateProps.length; i++) {\n node.style[animateProps[i]] = `${lastSizesRef.current[i]}px`;\n }\n let timeout = -1;\n const handleTransitionEnd = () => {\n clearTimeout(timeout);\n if (!node) return;\n node.style.transition = null as any;\n for (let i = 0; i < animateProps.length; i++) {\n node.style[animateProps[i]] = null as any;\n }\n node.removeEventListener('transitionend', handleTransitionEnd);\n node.removeEventListener('transitioncancel', handleTransitionEnd);\n };\n const animationFrame = requestAnimationFrame(() => {\n if (!node) return;\n node.addEventListener('transitionend', handleTransitionEnd);\n node.addEventListener('transitioncancel', handleTransitionEnd);\n node.style.transition = `${duration}ms all ease-in-out`;\n for (let i = 0; i < animateProps.length; i++) {\n lastSizesRef.current[i] = sizes[i];\n node.style[animateProps[i]] = `${sizes[i]}px`;\n }\n });\n timeout = setTimeout(handleTransitionEnd, 500) as any;\n return () => {\n cancelAnimationFrame(animationFrame);\n handleTransitionEnd();\n };\n }, [\n __animatedEnhanceInstanceId,\n props.animationsDisabled,\n duration,\n ...onChangeOf.map((propName) => props[propName]),\n ]);\n\n return {\n ref: useForkRef(ref, nodeRef),\n __animatedEnhanceInstanceId: __animatedEnhanceInstanceId ?? animatedSizeInstanceIdRef.current,\n ...other,\n };\n };\n}\n\nexport default animatedSizeEnhance;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAyD,IAAAG,SAAA;AAMzD,IAAIC,QAAQ,GAAG,CAAC;AAEhB,SAASC,mBAAmBA,CAAAC,IAAA,EAMzB;EAAA,IAAAC,iBAAA,GAAAD,IAAA,CALDE,YAAY;IAAZA,YAAY,GAAAD,iBAAA,cAAG,EAAE,GAAAA,iBAAA;IAAAE,eAAA,GAAAH,IAAA,CACjBI,UAAU;IAAVA,UAAU,GAAAD,eAAA,cAAG,EAAE,GAAAA,eAAA;EAKf,OAAO,UAACE,KAAU,EAAK;IACrB,IAAQC,GAAG,GAAsDD,KAAK,CAA9DC,GAAG;MAAEC,2BAA2B,GAAyBF,KAAK,CAAz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AAyB,CAACC;IAAO,GAC1FT,KAAK;EAEZ,CAAC;AACH;AAAC,IAAAyC,QAAA,GAAAC,OAAA,cAEcpD,mBAAmB","ignoreList":[]}
|
|
@@ -5,9 +5,6 @@ var _excluded = ["ref", "__animatedEnhanceInstanceId", "duration"];
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { useForkRef } from "../ref.mjs";
|
|
7
7
|
import useEnhancedEffect from "../use/useEnhancedEffect.mjs";
|
|
8
|
-
|
|
9
|
-
/** @deprecated */
|
|
10
|
-
|
|
11
8
|
var uniqueId = 0;
|
|
12
9
|
function animatedSizeEnhance(_ref) {
|
|
13
10
|
var _ref$animateProps = _ref.animateProps,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animatedSizeEnhance.mjs","names":["React","useForkRef","useEnhancedEffect","uniqueId","animatedSizeEnhance","_ref","_ref$animateProps","animateProps","_ref$onChangeOf","onChangeOf","props","ref","__animatedEnhanceInstanceId","duration","other","_objectWithoutProperties","_excluded","nodeRef","createRef","lastSizesRef","useRef","prevPropsRef","animatedSizeInstanceIdRef","current","animationsDisabled","undefined","node","every","value","i","length","getBoundingClientRect","sizes","Math","abs","style","getPropertyValue","endsWith","transition","concat","timeout","handleTransitionEnd","clearTimeout","removeEventListener","animationFrame","requestAnimationFrame","addEventListener","setTimeout","cancelAnimationFrame","_toConsumableArray","map","propName","_objectSpread"],"sources":["../../../src/utils/enhances/animatedSizeEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nimport
|
|
1
|
+
{"version":3,"file":"animatedSizeEnhance.mjs","names":["React","useForkRef","useEnhancedEffect","uniqueId","animatedSizeEnhance","_ref","_ref$animateProps","animateProps","_ref$onChangeOf","onChangeOf","props","ref","__animatedEnhanceInstanceId","duration","other","_objectWithoutProperties","_excluded","nodeRef","createRef","lastSizesRef","useRef","prevPropsRef","animatedSizeInstanceIdRef","current","animationsDisabled","undefined","node","every","value","i","length","getBoundingClientRect","sizes","Math","abs","style","getPropertyValue","endsWith","transition","concat","timeout","handleTransitionEnd","clearTimeout","removeEventListener","animationFrame","requestAnimationFrame","addEventListener","setTimeout","cancelAnimationFrame","_toConsumableArray","map","propName","_objectSpread"],"sources":["../../../src/utils/enhances/animatedSizeEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nimport { useForkRef } from '../ref';\nimport useEnhancedEffect from '../use/useEnhancedEffect';\n\nexport type WithAnimatedSizeEnhanceProps = {\n animationsDisabled?: boolean;\n};\n\nlet uniqueId = 0;\n\nfunction animatedSizeEnhance({\n animateProps = [],\n onChangeOf = [],\n}: {\n animateProps: ('width' | 'height')[];\n onChangeOf: string[];\n}) {\n return (props: any) => {\n const { ref, __animatedEnhanceInstanceId, duration, ...other } = props;\n const nodeRef = React.createRef<HTMLElement>();\n const lastSizesRef = React.useRef<(number | undefined)[]>([]);\n const prevPropsRef = React.useRef(props);\n const animatedSizeInstanceIdRef = React.useRef(uniqueId++);\n\n prevPropsRef.current = props;\n\n useEnhancedEffect(() => {\n if (props.animationsDisabled) return;\n if (\n __animatedEnhanceInstanceId !== undefined &&\n __animatedEnhanceInstanceId !== animatedSizeInstanceIdRef.current\n )\n return;\n if (!nodeRef.current) {\n return;\n }\n const node = nodeRef.current;\n if (lastSizesRef.current.every((value) => value === undefined)) {\n for (let i = 0; i < animateProps.length; i++) {\n // @ts-ignore\n lastSizesRef.current[i] = node.getBoundingClientRect()[animateProps[i]];\n }\n return;\n }\n\n const sizes: (number | undefined)[] = [];\n for (let i = 0; i < animateProps.length; i++) {\n sizes[i] = node.getBoundingClientRect()[animateProps[i]];\n if (\n Math.abs(lastSizesRef.current[i]! - sizes[i]!) < 3 ||\n node.style.getPropertyValue(animateProps[i]).endsWith('%')\n ) {\n lastSizesRef.current[i] = sizes[i];\n sizes[i] = undefined;\n }\n }\n if (sizes.every((value) => value === undefined)) return;\n\n node.style.transition = 'none';\n for (let i = 0; i < animateProps.length; i++) {\n node.style[animateProps[i]] = `${lastSizesRef.current[i]}px`;\n }\n let timeout = -1;\n const handleTransitionEnd = () => {\n clearTimeout(timeout);\n if (!node) return;\n node.style.transition = null as any;\n for (let i = 0; i < animateProps.length; i++) {\n node.style[animateProps[i]] = null as any;\n }\n node.removeEventListener('transitionend', handleTransitionEnd);\n node.removeEventListener('transitioncancel', handleTransitionEnd);\n };\n const animationFrame = requestAnimationFrame(() => {\n if (!node) return;\n node.addEventListener('transitionend', handleTransitionEnd);\n node.addEventListener('transitioncancel', handleTransitionEnd);\n node.style.transition = `${duration}ms all ease-in-out`;\n for (let i = 0; i < animateProps.length; i++) {\n lastSizesRef.current[i] = sizes[i];\n node.style[animateProps[i]] = `${sizes[i]}px`;\n }\n });\n timeout = setTimeout(handleTransitionEnd, 500) as any;\n return () => {\n cancelAnimationFrame(animationFrame);\n handleTransitionEnd();\n };\n }, [\n __animatedEnhanceInstanceId,\n props.animationsDisabled,\n duration,\n ...onChangeOf.map((propName) => props[propName]),\n ]);\n\n return {\n ref: useForkRef(ref, nodeRef),\n __animatedEnhanceInstanceId: __animatedEnhanceInstanceId ?? animatedSizeInstanceIdRef.current,\n ...other,\n };\n };\n}\n\nexport default animatedSizeEnhance;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,UAAU,QAAQ,YAAQ;AACnC,OAAOC,iBAAiB,MAAM,8BAA0B;AAMxD,IAAIC,QAAQ,GAAG,CAAC;AAEhB,SAASC,mBAAmBA,CAAAC,IAAA,EAMzB;EAAA,IAAAC,iBAAA,GAAAD,IAAA,CALDE,YAAY;IAAZA,YAAY,GAAAD,iBAAA,cAAG,EAAE,GAAAA,iBAAA;IAAAE,eAAA,GAAAH,IAAA,CACjBI,UAAU;IAAVA,UAAU,GAAAD,eAAA,cAAG,EAAE,GAAAA,eAAA;EAKf,OAAO,UAACE,KAAU,EAAK;IACrB,IAAQC,GAAG,GAAsDD,KAAK,CAA9DC,GAAG;MAAEC,2BAA2B,GAAyBF,KAAK,CAAzDE,2BAA2B;MAAEC,QAAQ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CAAC;AACH;AAEA,eAAeV,mBAAmB","ignoreList":[]}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { type LocaleKeys, useI18n } from './WithI18n';
|
|
2
|
-
import type { UnknownProperties } from '../../core-types/UnknownProperties';
|
|
3
|
-
/** @deprecated */
|
|
4
|
-
export interface IWithI18nEnhanceProps extends WithI18nEnhanceProps, UnknownProperties {
|
|
5
|
-
}
|
|
6
2
|
export type WithI18nEnhanceProps = {
|
|
7
3
|
getI18nText?: (key?: string, variables?: {}) => any;
|
|
8
4
|
i18n?: {
|
|
@@ -13,8 +13,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
13
13
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
var _WithI18n = require("./WithI18n");
|
|
16
|
-
/** @deprecated */
|
|
17
|
-
|
|
18
16
|
var useAsyncI18nMessages = exports.useAsyncI18nMessages = function useAsyncI18nMessages(primaryContainer, locale, fallbackContainer) {
|
|
19
17
|
var _store$locale;
|
|
20
18
|
var container = _react["default"].useMemo(function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18nEnhance.js","names":["_react","_interopRequireDefault","require","_WithI18n","useAsyncI18nMessages","exports","primaryContainer","locale","fallbackContainer","_store$locale","container","React","useMemo","_loop","_locale","_asyncToGenerator2","_regenerator2","m","_callee","_yield$Promise$all","_yield$Promise$all2","primary","fallback","w","_context","n","Promise","all","v","_slicedToArray2","a","_objectSpread3","_primaryContainer$_lo","_fallbackContainer$_l","initStore","store","_typeof2","_React$useState","useState","_React$useState2","setStore","lastLoadedLocaleRef","useRef","current","fallbackMessages","Object","values","loadingLocaleRef","useEffect","asyncMessages","then","module","messages","_defineProperty2","err","console","error","_default","props","i18n","getI18nText","useI18n"],"sources":["../../../src/utils/enhances/i18nEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nimport { type LocaleKeys, useI18n } from './WithI18n';\
|
|
1
|
+
{"version":3,"file":"i18nEnhance.js","names":["_react","_interopRequireDefault","require","_WithI18n","useAsyncI18nMessages","exports","primaryContainer","locale","fallbackContainer","_store$locale","container","React","useMemo","_loop","_locale","_asyncToGenerator2","_regenerator2","m","_callee","_yield$Promise$all","_yield$Promise$all2","primary","fallback","w","_context","n","Promise","all","v","_slicedToArray2","a","_objectSpread3","_primaryContainer$_lo","_fallbackContainer$_l","initStore","store","_typeof2","_React$useState","useState","_React$useState2","setStore","lastLoadedLocaleRef","useRef","current","fallbackMessages","Object","values","loadingLocaleRef","useEffect","asyncMessages","then","module","messages","_defineProperty2","err","console","error","_default","props","i18n","getI18nText","useI18n"],"sources":["../../../src/utils/enhances/i18nEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nimport { type LocaleKeys, useI18n } from './WithI18n';\n\nexport type WithI18nEnhanceProps = {\n /* Function for getting the required field from the translation dictionary */\n getI18nText?: (key?: string, variables?: {}) => any;\n /* Object with translations */\n i18n?: {\n [locale: string]: {\n [key: string]: string;\n };\n };\n /* Locale for translations */\n locale?: LocaleKeys;\n};\n\ntype Messages = { [messageId: string]: string };\ntype MessagesContainer = { [locale: string]: Messages | (() => Promise<Messages>) };\ntype MessagesStore = { [locale: string]: Messages };\nexport const useAsyncI18nMessages = (\n primaryContainer: MessagesContainer,\n locale: string,\n fallbackContainer?: MessagesContainer,\n) => {\n const container = React.useMemo(() => {\n if (!fallbackContainer) return primaryContainer;\n if (!primaryContainer) return fallbackContainer;\n if (primaryContainer === fallbackContainer) return primaryContainer;\n const container: MessagesContainer = {};\n for (const locale in primaryContainer) {\n if (\n typeof primaryContainer[locale] === 'function' ||\n typeof fallbackContainer[locale] === 'function'\n ) {\n container[locale] = async () => {\n const [primary, fallback] = await Promise.all([\n primaryContainer[locale],\n fallbackContainer[locale],\n ]);\n return { ...primary, ...fallback };\n };\n } else {\n container[locale] = {\n ...(primaryContainer[locale] ?? {}),\n ...(fallbackContainer[locale] ?? {}),\n };\n }\n }\n return container;\n }, [primaryContainer, fallbackContainer]);\n const initStore = React.useMemo(() => {\n const store: MessagesStore = {};\n for (const locale in container) {\n if (typeof container[locale] === 'object') {\n store[locale] = container[locale] as Messages;\n }\n }\n return store;\n }, [container]);\n const [store, setStore] = React.useState(initStore);\n const lastLoadedLocaleRef = React.useRef<string | null>(null);\n if (store[locale]) lastLoadedLocaleRef.current = locale;\n const fallbackMessages = React.useMemo(() => Object.values(store)[0], [store]);\n\n const loadingLocaleRef = React.useRef<string | null>(null);\n React.useEffect(() => {\n loadingLocaleRef.current = locale;\n const asyncMessages = container[locale];\n if (typeof asyncMessages === 'function') {\n asyncMessages()\n .then((module) => {\n if (loadingLocaleRef.current !== locale) return;\n let messages = module;\n if ('default' in module && typeof module.default === 'object') messages = module.default;\n setStore((store) => ({\n ...store,\n [locale]: messages,\n }));\n })\n\n .catch((err) => {\n // eslint-disable-next-line no-console\n console.error(err);\n });\n }\n }, [container, locale]);\n\n return store[locale] ?? fallbackMessages;\n};\nexport default (container?: MessagesContainer) => {\n return (props: any): { getI18nText: ReturnType<typeof useI18n> } => {\n const { i18n, locale } = props;\n const getI18nText = useI18n(i18n, locale, container);\n\n return { ...props, getI18nText };\n };\n};\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAkBO,IAAME,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,SAAvBA,oBAAoBA,CAC/BE,gBAAmC,EACnCC,MAAc,EACdC,iBAAqC,EAClC;EAAA,IAAAC,aAAA;EACH,IAAMC,SAAS,GAAGC,iBAAK,CAACC,OAAO,CAAC,YAAM;IACpC,IAAI,CAACJ,iBAAiB,EAAE,OAAOF,gBAAgB;IAC/C,IAAI,CAACA,gBAAgB,EAAE,OAAOE,iBAAiB;IAC/C,IAAIF,gBAAgB,KAAKE,iBAAiB,EAA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KAAK,UAAU,EAAE;MACvCA,aAAa,CAAC,CAAC,CACZC,IAAI,CAAC,UAACC,MAAM,EAAK;QAChB,IAAIJ,gBAAgB,CAACJ,OAAO,KAAKpC,MAAM,EAAE;QACzC,IAAI6C,QAAQ,GAAGD,MAAM;QACrB,IAAI,SAAS,IAAIA,MAAM,IAAI,IAAAf,QAAA,aAAOe,MAAM,WAAQ,MAAK,QAAQ,EAAEC,QAAQ,GAAGD,MAAM,WAAQ;QACxFX,QAAQ,CAAC,UAACL,KAAK;UAAA,WAAAJ,cAAA,iBAAAA,cAAA,iBACVI,KAAK,WAAAkB,gBAAA,iBACP9C,MAAM,EAAG6C,QAAQ;QAAA,CAClB,CAAC;MACL,CAAC,CAAC,SAEI,CAAC,UAACE,GAAG,EAAK;QACd;QACAC,OAAO,CAACC,KAAK,CAACF,GAAG,CAAC;MACpB,CAAC,CAAC;IACN;EACF,CAAC,EAAE,CAAC5C,SAAS,EAAEH,MAAM,CAAC,CAAC;EAEvB,QAAAE,aAAA,GAAO0B,KAAK,CAAC5B,MAAM,CAAC,cAAAE,aAAA,cAAAA,aAAA,GAAImC,gBAAgB;AAC1C,CAAC;AAAC,IAAAa,QAAA,GAAApD,OAAA,cACa,SAAAoD,SAAC/C,SAA6B,EAAK;EAChD,OAAO,UAACgD,KAAU,EAAkD;IAClE,IAAQC,IAAI,GAAaD,KAAK,CAAtBC,IAAI;MAAEpD,MAAM,GAAKmD,KAAK,CAAhBnD,MAAM;IACpB,IAAMqD,WAAW,GAAG,IAAAC,iBAAO,EAACF,IAAI,EAAEpD,MAAM,EAAEG,SAAS,CAAC;IAEpD,WAAAqB,cAAA,iBAAAA,cAAA,iBAAY2B,KAAK;MAAEE,WAAW,EAAXA;IAAW;EAChC,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18nEnhance.mjs","names":["React","useI18n","useAsyncI18nMessages","primaryContainer","locale","fallbackContainer","_store$locale","container","useMemo","_loop","_locale","_asyncToGenerator","_regenerator","m","_callee","_yield$Promise$all","_yield$Promise$all2","primary","fallback","w","_context","n","Promise","all","v","_slicedToArray","a","_objectSpread","_primaryContainer$_lo","_fallbackContainer$_l","initStore","store","_typeof","_React$useState","useState","_React$useState2","setStore","lastLoadedLocaleRef","useRef","current","fallbackMessages","Object","values","loadingLocaleRef","useEffect","asyncMessages","then","module","messages","_defineProperty","err","console","error","props","i18n","getI18nText"],"sources":["../../../src/utils/enhances/i18nEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nimport { type LocaleKeys, useI18n } from './WithI18n';\
|
|
1
|
+
{"version":3,"file":"i18nEnhance.mjs","names":["React","useI18n","useAsyncI18nMessages","primaryContainer","locale","fallbackContainer","_store$locale","container","useMemo","_loop","_locale","_asyncToGenerator","_regenerator","m","_callee","_yield$Promise$all","_yield$Promise$all2","primary","fallback","w","_context","n","Promise","all","v","_slicedToArray","a","_objectSpread","_primaryContainer$_lo","_fallbackContainer$_l","initStore","store","_typeof","_React$useState","useState","_React$useState2","setStore","lastLoadedLocaleRef","useRef","current","fallbackMessages","Object","values","loadingLocaleRef","useEffect","asyncMessages","then","module","messages","_defineProperty","err","console","error","props","i18n","getI18nText"],"sources":["../../../src/utils/enhances/i18nEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nimport { type LocaleKeys, useI18n } from './WithI18n';\n\nexport type WithI18nEnhanceProps = {\n /* Function for getting the required field from the translation dictionary */\n getI18nText?: (key?: string, variables?: {}) => any;\n /* Object with translations */\n i18n?: {\n [locale: string]: {\n [key: string]: string;\n };\n };\n /* Locale for translations */\n locale?: LocaleKeys;\n};\n\ntype Messages = { [messageId: string]: string };\ntype MessagesContainer = { [locale: string]: Messages | (() => Promise<Messages>) };\ntype MessagesStore = { [locale: string]: Messages };\nexport const useAsyncI18nMessages = (\n primaryContainer: MessagesContainer,\n locale: string,\n fallbackContainer?: MessagesContainer,\n) => {\n const container = React.useMemo(() => {\n if (!fallbackContainer) return primaryContainer;\n if (!primaryContainer) return fallbackContainer;\n if (primaryContainer === fallbackContainer) return primaryContainer;\n const container: MessagesContainer = {};\n for (const locale in primaryContainer) {\n if (\n typeof primaryContainer[locale] === 'function' ||\n typeof fallbackContainer[locale] === 'function'\n ) {\n container[locale] = async () => {\n const [primary, fallback] = await Promise.all([\n primaryContainer[locale],\n fallbackContainer[locale],\n ]);\n return { ...primary, ...fallback };\n };\n } else {\n container[locale] = {\n ...(primaryContainer[locale] ?? {}),\n ...(fallbackContainer[locale] ?? {}),\n };\n }\n }\n return container;\n }, [primaryContainer, fallbackContainer]);\n const initStore = React.useMemo(() => {\n const store: MessagesStore = {};\n for (const locale in container) {\n if (typeof container[locale] === 'object') {\n store[locale] = container[locale] as Messages;\n }\n }\n return store;\n }, [container]);\n const [store, setStore] = React.useState(initStore);\n const lastLoadedLocaleRef = React.useRef<string | null>(null);\n if (store[locale]) lastLoadedLocaleRef.current = locale;\n const fallbackMessages = React.useMemo(() => Object.values(store)[0], [store]);\n\n const loadingLocaleRef = React.useRef<string | null>(null);\n React.useEffect(() => {\n loadingLocaleRef.current = locale;\n const asyncMessages = container[locale];\n if (typeof asyncMessages === 'function') {\n asyncMessages()\n .then((module) => {\n if (loadingLocaleRef.current !== locale) return;\n let messages = module;\n if ('default' in module && typeof module.default === 'object') messages = module.default;\n setStore((store) => ({\n ...store,\n [locale]: messages,\n }));\n })\n\n .catch((err) => {\n // eslint-disable-next-line no-console\n console.error(err);\n });\n }\n }, [container, locale]);\n\n return store[locale] ?? fallbackMessages;\n};\nexport default (container?: MessagesContainer) => {\n return (props: any): { getI18nText: ReturnType<typeof useI18n> } => {\n const { i18n, locale } = props;\n const getI18nText = useI18n(i18n, locale, container);\n\n return { ...props, getI18nText };\n };\n};\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAA0BC,OAAO,QAAQ,gBAAY;AAkBrD,OAAO,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAC/BC,gBA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E,WAAW,EAAXA;IAAW;EAChC,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
type
|
|
2
|
-
type
|
|
3
|
-
export default class EventEmitter<
|
|
1
|
+
type Events = Record<string, (...args: any[]) => void>;
|
|
2
|
+
type Cleanup = () => void;
|
|
3
|
+
export default class EventEmitter<E extends Events, K extends keyof E = keyof E, H extends E[K] = E[K]> {
|
|
4
4
|
private events;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
on(eventName: K, fn: H): Cleanup;
|
|
6
|
+
off(eventName: K, fn: H): void;
|
|
7
|
+
emit(eventName: K, ...args: Parameters<H>): void;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated. Fallback to the `on` method for backward compatibility.
|
|
10
|
+
*/
|
|
11
|
+
subscribe(eventName: K, fn: H): Cleanup;
|
|
8
12
|
}
|
|
9
13
|
export {};
|
|
@@ -5,36 +5,64 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
var EventEmitter = exports["default"] = /*#__PURE__*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
(0,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
var EventEmitter = exports["default"] = /*#__PURE__*/function () {
|
|
13
|
+
function EventEmitter() {
|
|
14
|
+
(0, _classCallCheck2["default"])(this, EventEmitter);
|
|
15
|
+
(0, _defineProperty2["default"])(this, "events", new Map());
|
|
16
|
+
}
|
|
17
|
+
return (0, _createClass2["default"])(EventEmitter, [{
|
|
18
|
+
key: "on",
|
|
19
|
+
value: function on(eventName, fn) {
|
|
20
|
+
var _this$events$get,
|
|
21
|
+
_this = this;
|
|
22
|
+
var handlers = (_this$events$get = this.events.get(eventName)) !== null && _this$events$get !== void 0 ? _this$events$get : new Set();
|
|
23
|
+
handlers.add(fn);
|
|
24
|
+
this.events.set(eventName, handlers);
|
|
25
|
+
return function () {
|
|
26
|
+
_this.off(eventName, fn);
|
|
27
|
+
};
|
|
20
28
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
}, {
|
|
30
|
+
key: "off",
|
|
31
|
+
value: function off(eventName, fn) {
|
|
32
|
+
var _this$events$get2;
|
|
33
|
+
(_this$events$get2 = this.events.get(eventName)) === null || _this$events$get2 === void 0 || _this$events$get2["delete"](fn);
|
|
26
34
|
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
}, {
|
|
36
|
+
key: "emit",
|
|
37
|
+
value: function emit(eventName) {
|
|
38
|
+
var handlers = this.events.get(eventName);
|
|
39
|
+
if (handlers) {
|
|
40
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
41
|
+
args[_key - 1] = arguments[_key];
|
|
42
|
+
}
|
|
43
|
+
var _iterator = (0, _createForOfIteratorHelper2["default"])(handlers),
|
|
44
|
+
_step;
|
|
45
|
+
try {
|
|
46
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
47
|
+
var handler = _step.value;
|
|
48
|
+
handler.call.apply(handler, [null].concat(args));
|
|
49
|
+
}
|
|
50
|
+
} catch (err) {
|
|
51
|
+
_iterator.e(err);
|
|
52
|
+
} finally {
|
|
53
|
+
_iterator.f();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
31
56
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated. Fallback to the `on` method for backward compatibility.
|
|
60
|
+
*/
|
|
61
|
+
}, {
|
|
62
|
+
key: "subscribe",
|
|
63
|
+
value: function subscribe(eventName, fn) {
|
|
64
|
+
return this.on(eventName, fn);
|
|
65
|
+
}
|
|
66
|
+
}]);
|
|
67
|
+
}();
|
|
40
68
|
//# sourceMappingURL=eventEmitter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventEmitter.js","names":["EventEmitter","exports","_createClass2","_this","
|
|
1
|
+
{"version":3,"file":"eventEmitter.js","names":["EventEmitter","exports","_classCallCheck2","_defineProperty2","Map","_createClass2","key","value","on","eventName","fn","_this$events$get","_this","handlers","events","get","Set","add","set","off","_this$events$get2","emit","_len","arguments","length","args","Array","_key","_iterator","_createForOfIteratorHelper2","_step","s","n","done","handler","call","apply","concat","err","e","f","subscribe"],"sources":["../../src/utils/eventEmitter.ts"],"sourcesContent":["type Events = Record<string, (...args: any[]) => void>;\ntype Cleanup = () => void;\n\nexport default class EventEmitter<E extends Events, K extends keyof E = keyof E, H extends E[K] = E[K]> {\n private events = new Map<K, Set<H>>();\n\n public on(eventName: K, fn: H): Cleanup {\n const handlers = this.events.get(eventName) ?? new Set<H>();\n\n handlers.add(fn);\n\n this.events.set(eventName, handlers);\n\n return () => {\n this.off(eventName, fn);\n };\n }\n\n public off(eventName: K, fn: H): void {\n this.events.get(eventName)?.delete(fn);\n }\n\n public emit(eventName: K, ...args: Parameters<H>) {\n const handlers = this.events.get(eventName);\n\n if (handlers) {\n for (const handler of handlers) {\n handler.call(null, ...args);\n }\n }\n }\n\n /**\n * @deprecated. Fallback to the `on` method for backward compatibility.\n */\n public subscribe(eventName: K, fn: H): Cleanup {\n return this.on(eventName, fn);\n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