@sheet-i18n/react-client 0.3.2 → 0.4.2
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/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import { I18nStore } from '@sheet-i18n/react-core';
|
|
|
4
4
|
|
|
5
5
|
type UseIntlParams<D = MessageDescriptor> = Parameters<IntlShape['$t']> extends [D, ...infer R] ? [...R, Omit<D, 'id'>] : never;
|
|
6
6
|
type $TParams = Partial<UseIntlParams>;
|
|
7
|
-
type BigIntExcludedReactNode = Exclude<React.ReactNode, bigint>;
|
|
7
|
+
type BigIntExcludedReactNode = Exclude<React.ReactNode, bigint | null>;
|
|
8
8
|
type UseTranslationReturn<TSupportedLocales extends readonly string[], TLocaleSet extends Record<TSupportedLocales[number], Record<string, any>>, TTypeSafe extends boolean, TSheetTitle extends TTypeSafe extends true ? keyof TLocaleSet[TSupportedLocales[number]] : string> = {
|
|
9
9
|
t: <TMessageId extends TTypeSafe extends true ? keyof TLocaleSet[TSupportedLocales[number]][TSheetTitle] : string, TValues extends $TParams[0], TOpts extends $TParams[1], TDescriptor extends $TParams[2]>(id: TMessageId, values?: TValues, opts?: TOpts, _descriptor?: TDescriptor) => TTypeSafe extends true ? BigIntExcludedReactNode : any;
|
|
10
10
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { I18nStore } from '@sheet-i18n/react-core';
|
|
|
4
4
|
|
|
5
5
|
type UseIntlParams<D = MessageDescriptor> = Parameters<IntlShape['$t']> extends [D, ...infer R] ? [...R, Omit<D, 'id'>] : never;
|
|
6
6
|
type $TParams = Partial<UseIntlParams>;
|
|
7
|
-
type BigIntExcludedReactNode = Exclude<React.ReactNode, bigint>;
|
|
7
|
+
type BigIntExcludedReactNode = Exclude<React.ReactNode, bigint | null>;
|
|
8
8
|
type UseTranslationReturn<TSupportedLocales extends readonly string[], TLocaleSet extends Record<TSupportedLocales[number], Record<string, any>>, TTypeSafe extends boolean, TSheetTitle extends TTypeSafe extends true ? keyof TLocaleSet[TSupportedLocales[number]] : string> = {
|
|
9
9
|
t: <TMessageId extends TTypeSafe extends true ? keyof TLocaleSet[TSupportedLocales[number]][TSheetTitle] : string, TValues extends $TParams[0], TOpts extends $TParams[1], TDescriptor extends $TParams[2]>(id: TMessageId, values?: TValues, opts?: TOpts, _descriptor?: TDescriptor) => TTypeSafe extends true ? BigIntExcludedReactNode : any;
|
|
10
10
|
};
|
package/dist/index.js
CHANGED
|
@@ -68,7 +68,7 @@ function detectClientLanguage(i18nStore) {
|
|
|
68
68
|
const { defaultLocale, supportedLocales } = i18nStore;
|
|
69
69
|
if (typeof navigator !== "undefined" && (navigator == null ? void 0 : navigator.languages)) {
|
|
70
70
|
const preferredLocale = navigator.languages.find(
|
|
71
|
-
(lang) => supportedLocales.includes(lang)
|
|
71
|
+
(lang) => supportedLocales == null ? void 0 : supportedLocales.includes(lang)
|
|
72
72
|
);
|
|
73
73
|
return preferredLocale != null ? preferredLocale : defaultLocale;
|
|
74
74
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -45,7 +45,7 @@ function detectClientLanguage(i18nStore) {
|
|
|
45
45
|
const { defaultLocale, supportedLocales } = i18nStore;
|
|
46
46
|
if (typeof navigator !== "undefined" && (navigator == null ? void 0 : navigator.languages)) {
|
|
47
47
|
const preferredLocale = navigator.languages.find(
|
|
48
|
-
(lang) => supportedLocales.includes(lang)
|
|
48
|
+
(lang) => supportedLocales == null ? void 0 : supportedLocales.includes(lang)
|
|
49
49
|
);
|
|
50
50
|
return preferredLocale != null ? preferredLocale : defaultLocale;
|
|
51
51
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheet-i18n/react-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "a client package for react modules used by sheet-i18n",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"react": "^18.2.0",
|
|
29
29
|
"react-intl": "^7.0.4",
|
|
30
|
-
"@sheet-i18n/shared-utils": "1.2
|
|
31
|
-
"@sheet-i18n/errors": "1.2
|
|
32
|
-
"@sheet-i18n/react-core": "0.
|
|
30
|
+
"@sheet-i18n/shared-utils": "1.3.2",
|
|
31
|
+
"@sheet-i18n/errors": "1.3.2",
|
|
32
|
+
"@sheet-i18n/react-core": "0.4.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/react": "^19.0.2",
|
|
36
36
|
"@types/react-dom": "^19.0.2",
|
|
37
|
-
"@sheet-i18n/typescript-config": "1.2
|
|
37
|
+
"@sheet-i18n/typescript-config": "1.3.2"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "tsup",
|