@sheet-i18n/react 1.7.3 → 1.7.5
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/README.md +4 -2
- package/dist/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -4
- package/dist/index.mjs +0 -3
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package provides tools to handle translations in React applications using c
|
|
|
8
8
|
|
|
9
9
|
## ✨ Package Introduction
|
|
10
10
|
|
|
11
|
-
- **`I18nStore`**: _Core Store Creation Class_ for managing translation data.
|
|
11
|
+
- **`I18nStore`**: _Core Store Creation Class_ from `@sheet-i18n/core` for managing translation data.
|
|
12
12
|
- **`createI18nContext`**: _React Context_ to generate providers and hooks for translation.
|
|
13
13
|
- **`IntlProvider`**: _React Translation Provider_ for managing current locale.
|
|
14
14
|
- **`useTranslation`**: _Client Side Translation Hook_ for easy access to translation messages on the client side.
|
|
@@ -52,7 +52,7 @@ this store will be used as a core translations module.
|
|
|
52
52
|
import en from './en.json';
|
|
53
53
|
import ko from './ko.json';
|
|
54
54
|
|
|
55
|
-
import { I18nStore } from '@sheet-i18n/
|
|
55
|
+
import { I18nStore } from '@sheet-i18n/core';
|
|
56
56
|
|
|
57
57
|
export const i18nStore = new I18nStore({
|
|
58
58
|
supportedLocales: ['ko', 'en'],
|
|
@@ -127,6 +127,8 @@ const YourComponent = () => {
|
|
|
127
127
|
|
|
128
128
|
The `I18nStore` manages translation states, ensuring consistency across locales.
|
|
129
129
|
|
|
130
|
+
Import it from `@sheet-i18n/core`, then pass the created store to `createI18nContext` from `@sheet-i18n/react`.
|
|
131
|
+
|
|
130
132
|
#### Parameters:
|
|
131
133
|
|
|
132
134
|
### 🧠 I18nStore Configuration Options
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { I18nStore } from '@sheet-i18n/core';
|
|
2
|
-
export * from '@sheet-i18n/core';
|
|
3
1
|
import * as _sheet_i18n_shared_service from '@sheet-i18n/shared-service';
|
|
4
2
|
import { LocaleStorageManager, IStorageService } from '@sheet-i18n/shared-service';
|
|
5
3
|
export { LocaleStorageManager, IStorageService as Storage, ruleFactory } from '@sheet-i18n/shared-service';
|
|
4
|
+
import { I18nStore } from '@sheet-i18n/core';
|
|
6
5
|
import { MessageDescriptor, IntlShape } from 'react-intl';
|
|
7
6
|
import { SupportedLocales, LocaleSet, TypeSafe, SafeSheetTitle, SafeMessageId } from '@sheet-i18n/typescript';
|
|
8
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { I18nStore } from '@sheet-i18n/core';
|
|
2
|
-
export * from '@sheet-i18n/core';
|
|
3
1
|
import * as _sheet_i18n_shared_service from '@sheet-i18n/shared-service';
|
|
4
2
|
import { LocaleStorageManager, IStorageService } from '@sheet-i18n/shared-service';
|
|
5
3
|
export { LocaleStorageManager, IStorageService as Storage, ruleFactory } from '@sheet-i18n/shared-service';
|
|
4
|
+
import { I18nStore } from '@sheet-i18n/core';
|
|
6
5
|
import { MessageDescriptor, IntlShape } from 'react-intl';
|
|
7
6
|
import { SupportedLocales, LocaleSet, TypeSafe, SafeSheetTitle, SafeMessageId } from '@sheet-i18n/typescript';
|
|
8
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
32
32
|
}
|
|
33
33
|
return to;
|
|
34
34
|
};
|
|
35
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
36
35
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
36
|
|
|
38
37
|
// src/index.ts
|
|
@@ -43,7 +42,6 @@ __export(src_exports, {
|
|
|
43
42
|
ruleFactory: () => import_shared_service3.ruleFactory
|
|
44
43
|
});
|
|
45
44
|
module.exports = __toCommonJS(src_exports);
|
|
46
|
-
__reExport(src_exports, require("@sheet-i18n/core"), module.exports);
|
|
47
45
|
|
|
48
46
|
// src/createI18nContext.tsx
|
|
49
47
|
var import_shared_utils5 = require("@sheet-i18n/shared-utils");
|
|
@@ -427,6 +425,5 @@ var import_shared_service3 = require("@sheet-i18n/shared-service");
|
|
|
427
425
|
0 && (module.exports = {
|
|
428
426
|
LocaleStorageManager,
|
|
429
427
|
createI18nContext,
|
|
430
|
-
ruleFactory
|
|
431
|
-
...require("@sheet-i18n/core")
|
|
428
|
+
ruleFactory
|
|
432
429
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -18,9 +18,6 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
|
|
21
|
-
// src/index.ts
|
|
22
|
-
export * from "@sheet-i18n/core";
|
|
23
|
-
|
|
24
21
|
// src/createI18nContext.tsx
|
|
25
22
|
import { validator as validator5 } from "@sheet-i18n/shared-utils";
|
|
26
23
|
import { I18nStore } from "@sheet-i18n/core";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheet-i18n/react",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.5",
|
|
4
4
|
"description": "i18n client logic based on react",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"types": "./dist/index.d.mts",
|
|
13
14
|
"require": "./dist/index.js",
|
|
14
15
|
"import": "./dist/index.mjs"
|
|
15
16
|
}
|
|
@@ -36,11 +37,11 @@
|
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"react-intl": "^7.0.4",
|
|
39
|
-
"@sheet-i18n/core": "1.7.0",
|
|
40
|
-
"@sheet-i18n/errors": "1.8.2",
|
|
41
40
|
"@sheet-i18n/shared-service": "0.2.0",
|
|
42
|
-
"@sheet-i18n/
|
|
43
|
-
"@sheet-i18n/
|
|
41
|
+
"@sheet-i18n/errors": "1.8.2",
|
|
42
|
+
"@sheet-i18n/core": "1.7.0",
|
|
43
|
+
"@sheet-i18n/typescript": "0.4.0",
|
|
44
|
+
"@sheet-i18n/shared-utils": "1.8.3"
|
|
44
45
|
},
|
|
45
46
|
"peerDependencies": {
|
|
46
47
|
"react": "^18 || ^19 || ^20 || ^21",
|