@sheet-i18n/react-client 1.6.0 → 1.6.1
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 +2 -1
- package/dist/index.mjs +2 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -83,7 +83,7 @@ interface StorageBasedIntlProviderProps<TSupportedLocales extends readonly strin
|
|
|
83
83
|
i18nStore: I18nStore<TSupportedLocales, TLocaleSet, TTypeSafe>;
|
|
84
84
|
storageManager: LocaleStorageManager<TSupportedLocales, TLocaleSet, TTypeSafe>;
|
|
85
85
|
fallbackUI?: React.ReactNode;
|
|
86
|
-
children: React.ReactNode;
|
|
86
|
+
children: React.ReactNode | ((currentLocale?: TSupportedLocales[number]) => React.ReactNode);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
interface Plugins<TRules extends Rules> {
|
package/dist/index.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ interface StorageBasedIntlProviderProps<TSupportedLocales extends readonly strin
|
|
|
83
83
|
i18nStore: I18nStore<TSupportedLocales, TLocaleSet, TTypeSafe>;
|
|
84
84
|
storageManager: LocaleStorageManager<TSupportedLocales, TLocaleSet, TTypeSafe>;
|
|
85
85
|
fallbackUI?: React.ReactNode;
|
|
86
|
-
children: React.ReactNode;
|
|
86
|
+
children: React.ReactNode | ((currentLocale?: TSupportedLocales[number]) => React.ReactNode);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
interface Plugins<TRules extends Rules> {
|
package/dist/index.js
CHANGED
|
@@ -494,12 +494,13 @@ function StorageBasedIntlProvider({
|
|
|
494
494
|
i18nStore,
|
|
495
495
|
storageManager,
|
|
496
496
|
fallbackUI = null,
|
|
497
|
-
children
|
|
497
|
+
children: childrenFromProps
|
|
498
498
|
}) {
|
|
499
499
|
const { locale } = useLocaleStorage(storageManager);
|
|
500
500
|
if (import_shared_utils5.validator.isNullish(locale)) {
|
|
501
501
|
return fallbackUI;
|
|
502
502
|
}
|
|
503
|
+
const children = typeof childrenFromProps === "function" ? childrenFromProps(locale) : childrenFromProps;
|
|
503
504
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(IntlProvider, { currentLocale: locale, i18nStore, children });
|
|
504
505
|
}
|
|
505
506
|
|
package/dist/index.mjs
CHANGED
|
@@ -469,12 +469,13 @@ function StorageBasedIntlProvider({
|
|
|
469
469
|
i18nStore,
|
|
470
470
|
storageManager,
|
|
471
471
|
fallbackUI = null,
|
|
472
|
-
children
|
|
472
|
+
children: childrenFromProps
|
|
473
473
|
}) {
|
|
474
474
|
const { locale } = useLocaleStorage(storageManager);
|
|
475
475
|
if (validator4.isNullish(locale)) {
|
|
476
476
|
return fallbackUI;
|
|
477
477
|
}
|
|
478
|
+
const children = typeof childrenFromProps === "function" ? childrenFromProps(locale) : childrenFromProps;
|
|
478
479
|
return /* @__PURE__ */ jsx2(IntlProvider, { currentLocale: locale, i18nStore, children });
|
|
479
480
|
}
|
|
480
481
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheet-i18n/react-client",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.1",
|
|
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",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
},
|
|
26
26
|
"license": "ISC",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@sheet-i18n/shared-utils": "1.8.2",
|
|
29
28
|
"@sheet-i18n/errors": "1.8.1",
|
|
29
|
+
"@sheet-i18n/shared-utils": "1.8.2",
|
|
30
30
|
"@sheet-i18n/react-core": "1.6.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|