@servicetitan/docs-anvil-uikit-contrib 37.0.1 → 37.0.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/docs/intl/index.mdx +10 -6
- package/package.json +2 -2
package/docs/intl/index.mdx
CHANGED
|
@@ -25,7 +25,7 @@ Wrap your application with [`<IntlProvider>`](./API/intl-provider.mdx) or [`<Mob
|
|
|
25
25
|
|
|
26
26
|
#### IntlProvider
|
|
27
27
|
|
|
28
|
-
[`IntlProvider`](./API/intl-provider.mdx) is the most basic provider, and should be used if you do not use
|
|
28
|
+
[`IntlProvider`](./API/intl-provider.mdx) is the most basic provider, and should be used if you do not use MobX.
|
|
29
29
|
|
|
30
30
|
```tsx
|
|
31
31
|
import { IntlProvider } from '@servicetitan/intl';
|
|
@@ -44,7 +44,7 @@ return (
|
|
|
44
44
|
|
|
45
45
|
#### MobxIntlProvider
|
|
46
46
|
|
|
47
|
-
[`MobxIntlProvider`](./API/mobx-intl-provider.mdx) should be used if you are using
|
|
47
|
+
[`MobxIntlProvider`](./API/mobx-intl-provider.mdx) should be used if you are using MobX, as it provides the [`IntlStore`](./API/intlstore.mdx) to access internationalization features in stores.
|
|
48
48
|
|
|
49
49
|
```tsx
|
|
50
50
|
import { MobxIntlProvider } from '@servicetitan/intl/mobx';
|
|
@@ -61,13 +61,17 @@ return (
|
|
|
61
61
|
);
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
### Monolith
|
|
65
|
+
|
|
66
|
+
If you are doing work in the monolith, `MobxIntlProvider` has already been implemented for you, providing the `currency`, `locale`, and `timeZone` from available Business Units, Culture, Features, and Tenant stores.
|
|
67
|
+
|
|
68
|
+
If you are using `@servicetitan/intl` formatters within a Shared React Component that is used within a Knockout template (`window.sharedReactComponent`), the library's context will not be available. Wrap your component directly with a provider to ensure the context is available within the component's tree. We recommend you use [the monolith's `IntlProvider`](https://github.com/search?q=repo:servicetitan/app+%22export+const+IntlProvider%22+path:%22/packages/desktop/%22&type=code), as it already provides the `currency`, `locale`, and `timezone`.
|
|
69
|
+
|
|
70
|
+
If you are instead implementing an MFE but would use the same monolith data, you should use the [`IntlProvider` from `@servicetitan/application-data/tanstack/intl`](/docs/frontend/application-data/intl-provider), which will likewise provide the `currency`, `locale`, and `timeZone` for you via monolith data stores.
|
|
67
71
|
|
|
68
72
|
## Features
|
|
69
73
|
|
|
70
|
-
`Format.js` and `react-intl` provide many components and utilities for handling internationalization, including caching and wrapping most of the [native `Intl` formatters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl). The following APIs are
|
|
74
|
+
`Format.js` and `react-intl` provide many components and utilities for handling internationalization, including caching and wrapping most of the [native `Intl` formatters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl). The following APIs are particularly useful to us at this stage:
|
|
71
75
|
|
|
72
76
|
- [Formatting currency](./currency.mdx)
|
|
73
77
|
- [Formatting dates](./dates.mdx)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/docs-anvil-uikit-contrib",
|
|
3
|
-
"version": "37.0.
|
|
3
|
+
"version": "37.0.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
"cli": {
|
|
17
17
|
"webpack": false
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "e5cc4337a19b32de0595e1f23d13029c40b350c2"
|
|
20
20
|
}
|