use-intl 2.11.0-alpha.2 → 2.11.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.
Files changed (102) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +32 -20
  3. package/dist/core/createFormatter.d.ts +17 -0
  4. package/dist/core/createIntl.d.ts +5 -15
  5. package/dist/core/index.d.ts +1 -0
  6. package/dist/core/use-intl.esm10.js +34 -0
  7. package/dist/core/use-intl.esm10.js.map +1 -0
  8. package/dist/core/use-intl.esm2.js +2 -2
  9. package/dist/core/use-intl.esm3.js +10 -10
  10. package/dist/core/use-intl.esm3.js.map +1 -1
  11. package/dist/core/use-intl.esm4.js +9 -53
  12. package/dist/core/use-intl.esm4.js.map +1 -1
  13. package/dist/core/use-intl.esm5.js +56 -12
  14. package/dist/core/use-intl.esm5.js.map +1 -1
  15. package/dist/core/use-intl.esm6.js +11 -209
  16. package/dist/core/use-intl.esm6.js.map +1 -1
  17. package/dist/core/use-intl.esm7.js +29 -7
  18. package/dist/core/use-intl.esm7.js.map +1 -1
  19. package/dist/core/use-intl.esm8.js +199 -18
  20. package/dist/core/use-intl.esm8.js.map +1 -1
  21. package/dist/core/use-intl.esm9.js +5 -29
  22. package/dist/core/use-intl.esm9.js.map +1 -1
  23. package/dist/react/IntlContext.d.ts +19 -2
  24. package/dist/react/IntlProvider.d.ts +16 -2
  25. package/dist/react/index.d.ts +2 -1
  26. package/dist/react/use-intl.esm.js +26 -7
  27. package/dist/react/use-intl.esm.js.map +1 -1
  28. package/dist/react/use-intl.esm10.js +2 -2
  29. package/dist/react/use-intl.esm2.js +20 -19
  30. package/dist/react/use-intl.esm2.js.map +1 -1
  31. package/dist/react/use-intl.esm3.js +3 -21
  32. package/dist/react/use-intl.esm3.js.map +1 -1
  33. package/dist/react/use-intl.esm4.js +45 -3
  34. package/dist/react/use-intl.esm4.js.map +1 -1
  35. package/dist/react/use-intl.esm6.js +18 -43
  36. package/dist/react/use-intl.esm6.js.map +1 -1
  37. package/dist/react/use-intl.esm7.js +30 -3
  38. package/dist/react/use-intl.esm7.js.map +1 -1
  39. package/dist/react/use-intl.esm8.js +3 -30
  40. package/dist/react/use-intl.esm8.js.map +1 -1
  41. package/dist/react/use-intl.esm9.js +1 -1
  42. package/dist/react/useFormatter.d.ts +5 -0
  43. package/dist/react/useIntl.d.ts +1 -0
  44. package/dist/react/useIntlContext.d.ts +1 -1
  45. package/dist/src/core/createBaseTranslator.js +11 -8
  46. package/dist/src/core/createBaseTranslator.js.map +1 -1
  47. package/dist/src/core/createFormatter.d.ts +17 -0
  48. package/dist/src/core/createFormatter.js +126 -0
  49. package/dist/src/core/createFormatter.js.map +1 -0
  50. package/dist/src/core/createIntl.d.ts +5 -15
  51. package/dist/src/core/createIntl.js +9 -124
  52. package/dist/src/core/createIntl.js.map +1 -1
  53. package/dist/src/core/index.d.ts +1 -0
  54. package/dist/src/core/index.js +2 -0
  55. package/dist/src/core/index.js.map +1 -1
  56. package/dist/src/react/IntlContext.d.ts +19 -2
  57. package/dist/src/react/IntlContext.js.map +1 -1
  58. package/dist/src/react/IntlProvider.d.ts +16 -2
  59. package/dist/src/react/IntlProvider.js +13 -4
  60. package/dist/src/react/IntlProvider.js.map +1 -1
  61. package/dist/src/react/index.d.ts +2 -1
  62. package/dist/src/react/index.js +3 -1
  63. package/dist/src/react/index.js.map +1 -1
  64. package/dist/src/react/useFormatter.d.ts +5 -0
  65. package/dist/src/react/useFormatter.js +14 -0
  66. package/dist/src/react/useFormatter.js.map +1 -0
  67. package/dist/src/react/useIntl.d.ts +1 -0
  68. package/dist/src/react/useIntl.js +6 -0
  69. package/dist/src/react/useIntl.js.map +1 -1
  70. package/dist/src/react/useIntlContext.d.ts +1 -1
  71. package/dist/use-intl.cjs.development.js +99 -68
  72. package/dist/use-intl.cjs.development.js.map +1 -1
  73. package/dist/use-intl.cjs.production.min.js +1 -1
  74. package/dist/use-intl.cjs.production.min.js.map +1 -1
  75. package/dist/use-intl.esm.js +7 -5
  76. package/dist/use-intl.esm.js.map +1 -1
  77. package/package.json +3 -2
  78. package/src/core/createBaseTranslator.tsx +15 -12
  79. package/src/core/createFormatter.tsx +181 -0
  80. package/src/core/createIntl.tsx +12 -180
  81. package/src/core/index.tsx +3 -0
  82. package/src/react/IntlContext.tsx +20 -2
  83. package/src/react/IntlProvider.tsx +36 -5
  84. package/src/react/index.tsx +4 -1
  85. package/src/react/useFormatter.tsx +19 -0
  86. package/src/react/useIntl.tsx +10 -0
  87. package/CHANGELOG.md +0 -501
  88. package/dist/react/IntlContextValue.d.ts +0 -19
  89. package/dist/react/IntlProviderProps.d.ts +0 -15
  90. package/dist/react/getIntlContextValue.d.ts +0 -18
  91. package/dist/src/react/IntlContextValue.d.ts +0 -19
  92. package/dist/src/react/IntlContextValue.js +0 -2
  93. package/dist/src/react/IntlContextValue.js.map +0 -1
  94. package/dist/src/react/IntlProviderProps.d.ts +0 -15
  95. package/dist/src/react/IntlProviderProps.js +0 -2
  96. package/dist/src/react/IntlProviderProps.js.map +0 -1
  97. package/dist/src/react/getIntlContextValue.d.ts +0 -18
  98. package/dist/src/react/getIntlContextValue.js +0 -21
  99. package/dist/src/react/getIntlContextValue.js.map +0 -1
  100. package/src/react/IntlContextValue.tsx +0 -21
  101. package/src/react/IntlProviderProps.tsx +0 -17
  102. package/src/react/getIntlContextValue.tsx +0 -30
package/CHANGELOG.md DELETED
@@ -1,501 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## 2.10.2 (2022-12-09)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * Remove magic `__DEV__` global ([#151](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/151)) ([7d5aa6a](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/7d5aa6a8fda0189adc6440214270e07a5593d98f))
12
-
13
-
14
-
15
-
16
-
17
- ## 2.10.1 (2022-12-09)
18
-
19
- **Note:** Version bump only for package use-intl
20
-
21
-
22
-
23
-
24
-
25
- # 2.10.0 (2022-12-09)
26
-
27
-
28
- ### Features
29
-
30
- * Add support for using `next-intl` in the `app` folder with Next.js 13 (see https://next-intl-docs.vercel.app/docs/next-13, [#144](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/144)) ([18c94d6](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/18c94d623a05afa7710fea83360f12f9811fb38d))
31
-
32
-
33
-
34
-
35
-
36
- ## 2.9.2 (2022-12-08)
37
-
38
- **Note:** Version bump only for package use-intl
39
-
40
-
41
-
42
-
43
-
44
- ## 2.9.1 (2022-11-03)
45
-
46
- **Note:** Version bump only for package use-intl
47
-
48
-
49
-
50
-
51
-
52
- # 2.9.0 (2022-10-27)
53
-
54
-
55
- ### Features
56
-
57
- * Next.js 13 compatibility ([#140](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/140)) ([65326a0](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/65326a0b47980f260df466a283a6e7a0aa5e1cd0)), closes [#139](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/139)
58
-
59
-
60
-
61
-
62
-
63
- # 2.8.0 (2022-10-18)
64
-
65
-
66
- ### Features
67
-
68
- * Provide `createTranslator` and `createIntl` by extracting a React-agnostic core library. Thanks to David Brands from Marvia for sponsoring the work on this feature, participating in discussion and providing feedback! ([#137](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/137)) ([91f7489](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/91f748972008b8587553b48aa36c95d7348b4b0c))
69
-
70
-
71
-
72
-
73
-
74
- ## 2.7.6 (2022-09-22)
75
-
76
- **Note:** Version bump only for package use-intl
77
-
78
-
79
-
80
-
81
-
82
- ## 2.7.5 (2022-08-30)
83
-
84
- **Note:** Version bump only for package use-intl
85
-
86
-
87
-
88
-
89
-
90
- ## 2.7.4 (2022-05-30)
91
-
92
-
93
- ### Bug Fixes
94
-
95
- * Adapt TypeScript validation to work with messages files that only have a single top-level namespace ([#115](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/115)) ([cf0b83e](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/cf0b83e3a591cfe87e17537c3ca0c7000cc70b1e))
96
-
97
-
98
-
99
-
100
-
101
- ## 2.7.3 (2022-05-20)
102
-
103
-
104
- ### Bug Fixes
105
-
106
- * Add back the ability to render the provider without messages ([#113](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/113)) ([8395822](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/8395822fa17cd0a04b88f8edce3b20e5e613fc78))
107
-
108
-
109
-
110
-
111
-
112
- ## 2.7.2 (2022-05-10)
113
-
114
-
115
- ### Bug Fixes
116
-
117
- * Enable tree-shaking ([#108](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/108)) ([157b0e2](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/157b0e28376055e7e34e86007c51d008c8e214aa))
118
-
119
-
120
-
121
-
122
-
123
- ## 2.7.1 (2022-04-28)
124
-
125
-
126
- ### Bug Fixes
127
-
128
- * Allow null message values ([#110](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/110)) ([14ae8ff](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/14ae8ffdf1b295873f14081e2c3709d0f9bd2b9e))
129
-
130
-
131
-
132
-
133
-
134
- # 2.7.0 (2022-04-28)
135
-
136
-
137
- ### Features
138
-
139
- * Warn for invalid namespace keys ([#106](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/106)) ([e86ab28](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/e86ab28b9180b866ce1a0a9173355d4b686b7d07))
140
-
141
-
142
-
143
-
144
-
145
- # 2.6.0 (2022-04-08)
146
-
147
-
148
- ### Features
149
-
150
- * Support React 18 ([#98](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/98)) ([38614eb](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/38614eb9c6d6fb96704424d7f3ff8a67a24b789e))
151
-
152
-
153
-
154
-
155
-
156
- # 2.5.0 (2022-04-01)
157
-
158
-
159
- ### Features
160
-
161
- * Type safe messages ([#93](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/93)) ([13b49b1](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/13b49b138bc0ec3adbe661af6a70dfabfe7e86b0))
162
-
163
-
164
-
165
-
166
-
167
-
168
-
169
-
170
-
171
- ## 2.4.1 (2022-03-24)
172
-
173
-
174
- ### Bug Fixes
175
-
176
- * Overwrite prerelease ([6caf5c4](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/6caf5c48a35179f802503bc6580469187765c837))
177
-
178
-
179
-
180
-
181
-
182
- # [2.4.0](https://github.com/amannn/next-intl/tree/main/packages/use-intl/compare/v2.3.5...v2.4.0) (2022-02-08)
183
-
184
-
185
- ### Features
186
-
187
- * Default translation values ([#86](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/86)) ([0ed5e70](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/0ed5e70ffc57dcdb1b7b9270dbce9e8475b3f478))
188
-
189
-
190
-
191
-
192
-
193
- ## 2.3.5 (2022-01-19)
194
-
195
-
196
- ### Bug Fixes
197
-
198
- * Support identical wrappers with identical text content in rich text ([#80](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/80)) ([b35bb9f](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/b35bb9ffc5fa56c6260b6b424be3cd875f199aef))
199
-
200
-
201
-
202
-
203
-
204
- ## 2.3.4 (2022-01-04)
205
-
206
-
207
- ### Bug Fixes
208
-
209
- * Allow usage outside of Next.js (e.g. Jest and Storybook) ([#76](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/76)) ([7c6925b](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/7c6925b39338be95c1c940c67a1ae2f5e3f85cdd))
210
-
211
-
212
-
213
-
214
-
215
- ## 2.3.3 (2021-12-23)
216
-
217
- **Note:** Version bump only for package use-intl
218
-
219
-
220
-
221
-
222
-
223
- ## 2.3.2 (2021-12-23)
224
-
225
- **Note:** Version bump only for package use-intl
226
-
227
-
228
-
229
-
230
-
231
- ## 2.3.1 (2021-12-23)
232
-
233
- **Note:** Version bump only for package use-intl
234
-
235
-
236
-
237
-
238
-
239
- # 2.3.0 (2021-11-24)
240
-
241
-
242
- ### Features
243
-
244
- * Add `useLocale` and `useTimeZone` ([#67](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/67)) ([7833f4a](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/7833f4adc1aadc937cbaa550a968ef6f7b4f5ee1))
245
-
246
-
247
-
248
-
249
-
250
- ## 2.2.1 (2021-11-23)
251
-
252
-
253
- ### Bug Fixes
254
-
255
- * Clearer error message when no messages are provided ([#66](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/66)) ([742729a](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/742729aaddd63367efc2b79ef0cdf93545abdfb0))
256
-
257
-
258
-
259
-
260
-
261
- # 2.2.0 (2021-11-02)
262
-
263
-
264
- ### Features
265
-
266
- * TypeScript improvements: Use enum type for `style` of `NumberFormatOptions`, only allow passing React children to messages rendered with `t.rich` and update `tslib` ([#63](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/63)) ([d73e935](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/d73e9358bf13c87c0a653bd9fbed35e41548ff1d))
267
-
268
-
269
-
270
-
271
-
272
- ## 2.1.1 (2021-10-28)
273
-
274
- **Note:** Version bump only for package use-intl
275
-
276
-
277
-
278
-
279
-
280
- # 2.1.0 (2021-10-27)
281
-
282
-
283
- ### Features
284
-
285
- * Support Next.js 12 ([#61](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/61)) ([0391cc8](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/0391cc85d3401bca9df29080a569957f6be93c85))
286
-
287
-
288
-
289
-
290
-
291
- ## 2.0.5 (2021-09-28)
292
-
293
- **Note:** Version bump only for package use-intl
294
-
295
-
296
-
297
-
298
-
299
- ## 2.0.4 (2021-09-28)
300
-
301
- **Note:** Version bump only for package use-intl
302
-
303
-
304
-
305
-
306
-
307
- ## 2.0.3 (2021-09-17)
308
-
309
- **Note:** Version bump only for package use-intl
310
-
311
-
312
-
313
-
314
-
315
- ## 2.0.2 (2021-09-17)
316
-
317
-
318
- ### Bug Fixes
319
-
320
- * Render correct messages when the namespace changes in `useTranslations` ([#58](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/58)) ([b8f7dab](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/b8f7dab0e3a213a91bdcd7929547cd01ba0b5f54))
321
-
322
-
323
-
324
-
325
-
326
- ## 2.0.1 (2021-09-04)
327
-
328
- **Note:** Version bump only for package use-intl
329
-
330
-
331
-
332
-
333
-
334
- # 2.0.0 (2021-08-26)
335
-
336
-
337
- * feat!: Use a separate API for rich text formatting to avoid type casting in TypeScript #54 ([4c13a64](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/4c13a644ce99992d9e57887afe35a09b8e3d6572)), closes [#54](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/54)
338
-
339
-
340
- ### BREAKING CHANGES
341
-
342
- * Instead of using the `t` function for formatting both regular messages and rich text, this function will only work for regular messages now. For rich text you can use `t.rich` instead now.
343
-
344
-
345
-
346
-
347
-
348
- ## 1.5.1 (2021-08-13)
349
-
350
-
351
- ### Bug Fixes
352
-
353
- * Improve API for rendering raw messages and add docs ([#51](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/51)) ([19f4a7e](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/19f4a7e4e81e1cff78dc7e3f337dce69800be280))
354
-
355
-
356
-
357
-
358
-
359
- # 1.5.0 (2021-08-10)
360
-
361
-
362
- ### Features
363
-
364
- * Add flag to return raw messages ([#48](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/48)) ([b34e19f](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/b34e19ff618308b7d0c01e7969975215d96ff608))
365
-
366
-
367
-
368
-
369
-
370
- ## 1.4.7 (2021-08-02)
371
-
372
-
373
- ### Bug Fixes
374
-
375
- * Adjust default for `onError` of the provider to log errors correctly ([#46](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/46)) ([d0a1986](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/d0a1986905e30acac40630e9ea6d099caad617fb))
376
-
377
-
378
-
379
-
380
-
381
- ## 1.4.6 (2021-08-02)
382
-
383
-
384
- ### Bug Fixes
385
-
386
- * Use `timeZone` in translation function from `useTranslations` ([#45](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/45)) ([ebf75f2](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/ebf75f2add0ddc46f89768e9481bb16c56f94720))
387
-
388
-
389
-
390
-
391
-
392
- ## 1.4.5 (2021-07-26)
393
-
394
- **Note:** Version bump only for package use-intl
395
-
396
-
397
-
398
-
399
-
400
- ## 1.4.4 (2021-07-08)
401
-
402
- **Note:** Version bump only for package use-intl
403
-
404
-
405
-
406
-
407
-
408
- ## 1.4.3 (2021-07-08)
409
-
410
- **Note:** Version bump only for package use-intl
411
-
412
-
413
-
414
-
415
-
416
- ## [1.4.2](https://github.com/amannn/next-intl/tree/main/packages/use-intl/compare/v1.4.1...v1.4.2) (2021-06-16)
417
-
418
-
419
- ### Bug Fixes
420
-
421
- * Don't require `react-dom` as a peer dependency ([#39](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/39)) ([39edfcd](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/39edfcd9091e09570fc2152cda6a1e9ae5e7c210))
422
-
423
-
424
-
425
-
426
-
427
- ## 1.3.11 (2021-05-07)
428
-
429
- **Note:** Version bump only for package use-intl
430
-
431
-
432
-
433
-
434
-
435
- ## 1.3.10 (2021-05-02)
436
-
437
- **Note:** Version bump only for package use-intl
438
-
439
-
440
-
441
-
442
-
443
- ## 1.3.9 (2021-05-02)
444
-
445
- **Note:** Version bump only for package use-intl
446
-
447
-
448
-
449
-
450
-
451
- ## 1.3.8 (2021-03-26)
452
-
453
- **Note:** Version bump only for package use-intl
454
-
455
-
456
-
457
-
458
-
459
- ## 1.3.7 (2021-02-12)
460
-
461
- **Note:** Version bump only for package use-intl
462
-
463
-
464
-
465
-
466
-
467
- ## 1.3.6 (2021-02-09)
468
-
469
- **Note:** Version bump only for package use-intl
470
-
471
-
472
-
473
-
474
-
475
- ## 1.3.5 (2021-02-09)
476
-
477
- **Note:** Version bump only for package use-intl
478
-
479
-
480
-
481
-
482
-
483
- ## 1.3.4 (2021-02-09)
484
-
485
- **Note:** Version bump only for package use-intl
486
-
487
-
488
-
489
-
490
-
491
- ## [1.3.3](https://github.com/amannn/next-intl/tree/main/packages/use-intl/compare/v1.3.2...v1.3.3) (2021-02-09)
492
-
493
-
494
- ### Bug Fixes
495
-
496
- * Update DateTimeFormatOptions ([#29](https://github.com/amannn/next-intl/tree/main/packages/use-intl/issues/29)) ([91a8f52](https://github.com/amannn/next-intl/tree/main/packages/use-intl/commit/91a8f5216a9ef2a0e76be6e3e8bd706f5c7496a3))
497
-
498
-
499
- ## Previous releases
500
-
501
- See [next-intl changelog](https://github.com/amannn/next-intl/blob/main/CHANGELOG.md).
@@ -1,19 +0,0 @@
1
- import AbstractIntlMessages from '../core/AbstractIntlMessages';
2
- import Formats from '../core/Formats';
3
- import IntlError from '../core/IntlError';
4
- import { RichTranslationValues } from '../core/TranslationValues';
5
- declare type IntlContextValue = {
6
- messages?: AbstractIntlMessages;
7
- locale: string;
8
- formats?: Partial<Formats>;
9
- timeZone?: string;
10
- onError(error: IntlError): void;
11
- getMessageFallback(info: {
12
- error: IntlError;
13
- key: string;
14
- namespace?: string;
15
- }): string;
16
- now?: Date;
17
- defaultTranslationValues?: RichTranslationValues;
18
- };
19
- export default IntlContextValue;
@@ -1,15 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { AbstractIntlMessages } from '../core';
3
- import IntlConfiguration from '../core/IntlConfiguration';
4
- import { RichTranslationValues } from '../core/TranslationValues';
5
- declare type IntlProviderProps = IntlConfiguration & {
6
- /** All components that use the provided hooks should be within this tree. */
7
- children: ReactNode;
8
- /** Global default values for translation values and rich text elements.
9
- * Can be used for consistent usage or styling of rich text elements.
10
- * Defaults will be overidden by locally provided values. */
11
- defaultTranslationValues?: RichTranslationValues;
12
- /** All messages that will be available in your components. */
13
- messages?: AbstractIntlMessages;
14
- };
15
- export default IntlProviderProps;
@@ -1,18 +0,0 @@
1
- import IntlProviderProps from './IntlProviderProps';
2
- /**
3
- * Enhances the incoming props with defaults.
4
- */
5
- export default function getIntlContextValue({ getMessageFallback, messages, onError, ...rest }: Omit<IntlProviderProps, 'children'>): {
6
- messages: import("../core/AbstractIntlMessages").default | undefined;
7
- onError: (error: import("..").IntlError) => void;
8
- getMessageFallback: (info: {
9
- error: import("..").IntlError;
10
- key: string;
11
- namespace?: string | undefined;
12
- }) => string;
13
- locale: string;
14
- formats?: Partial<import("../core/Formats").default> | undefined;
15
- timeZone?: string | undefined;
16
- now?: Date | undefined;
17
- defaultTranslationValues?: import("..").RichTranslationValues | undefined;
18
- };
@@ -1,19 +0,0 @@
1
- import AbstractIntlMessages from '../core/AbstractIntlMessages';
2
- import Formats from '../core/Formats';
3
- import IntlError from '../core/IntlError';
4
- import { RichTranslationValues } from '../core/TranslationValues';
5
- declare type IntlContextValue = {
6
- messages?: AbstractIntlMessages;
7
- locale: string;
8
- formats?: Partial<Formats>;
9
- timeZone?: string;
10
- onError(error: IntlError): void;
11
- getMessageFallback(info: {
12
- error: IntlError;
13
- key: string;
14
- namespace?: string;
15
- }): string;
16
- now?: Date;
17
- defaultTranslationValues?: RichTranslationValues;
18
- };
19
- export default IntlContextValue;
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=IntlContextValue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IntlContextValue.js","sourceRoot":"","sources":["../../../src/react/IntlContextValue.tsx"],"names":[],"mappings":""}
@@ -1,15 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { AbstractIntlMessages } from '../core';
3
- import IntlConfiguration from '../core/IntlConfiguration';
4
- import { RichTranslationValues } from '../core/TranslationValues';
5
- declare type IntlProviderProps = IntlConfiguration & {
6
- /** All components that use the provided hooks should be within this tree. */
7
- children: ReactNode;
8
- /** Global default values for translation values and rich text elements.
9
- * Can be used for consistent usage or styling of rich text elements.
10
- * Defaults will be overidden by locally provided values. */
11
- defaultTranslationValues?: RichTranslationValues;
12
- /** All messages that will be available in your components. */
13
- messages?: AbstractIntlMessages;
14
- };
15
- export default IntlProviderProps;
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=IntlProviderProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IntlProviderProps.js","sourceRoot":"","sources":["../../../src/react/IntlProviderProps.tsx"],"names":[],"mappings":""}
@@ -1,18 +0,0 @@
1
- import IntlProviderProps from './IntlProviderProps';
2
- /**
3
- * Enhances the incoming props with defaults.
4
- */
5
- export default function getIntlContextValue({ getMessageFallback, messages, onError, ...rest }: Omit<IntlProviderProps, 'children'>): {
6
- messages: import("../core/AbstractIntlMessages").default | undefined;
7
- onError: (error: import("..").IntlError) => void;
8
- getMessageFallback: (info: {
9
- error: import("..").IntlError;
10
- key: string;
11
- namespace?: string | undefined;
12
- }) => string;
13
- defaultTranslationValues?: import("..").RichTranslationValues | undefined;
14
- formats?: Partial<import("../core/Formats").default> | undefined;
15
- locale: string;
16
- timeZone?: string | undefined;
17
- now?: Date | undefined;
18
- };
@@ -1,21 +0,0 @@
1
- import { defaultGetMessageFallback, defaultOnError } from '../core/defaults';
2
- import validateMessages from '../core/validateMessages';
3
- /**
4
- * Enhances the incoming props with defaults.
5
- */
6
- export default function getIntlContextValue({ getMessageFallback, messages, onError, ...rest }) {
7
- const finalOnError = onError || defaultOnError;
8
- const finalGetMessageFallback = getMessageFallback || defaultGetMessageFallback;
9
- if (process.env.NODE_ENV !== 'production') {
10
- if (messages) {
11
- validateMessages(messages, finalOnError);
12
- }
13
- }
14
- return {
15
- ...rest,
16
- messages,
17
- onError: finalOnError,
18
- getMessageFallback: finalGetMessageFallback
19
- };
20
- }
21
- //# sourceMappingURL=getIntlContextValue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getIntlContextValue.js","sourceRoot":"","sources":["../../../src/react/getIntlContextValue.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,yBAAyB,EAAE,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAC3E,OAAO,gBAAgB,MAAM,0BAA0B,CAAC;AAGxD;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAC1C,kBAAkB,EAClB,QAAQ,EACR,OAAO,EACP,GAAG,IAAI,EAC6B;IACpC,MAAM,YAAY,GAAG,OAAO,IAAI,cAAc,CAAC;IAC/C,MAAM,uBAAuB,GAC3B,kBAAkB,IAAI,yBAAyB,CAAC;IAElD,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;QACzC,IAAI,QAAQ,EAAE;YACZ,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;SAC1C;KACF;IAED,OAAO;QACL,GAAG,IAAI;QACP,QAAQ;QACR,OAAO,EAAE,YAAY;QACrB,kBAAkB,EAAE,uBAAuB;KAC5C,CAAC;AACJ,CAAC"}
@@ -1,21 +0,0 @@
1
- import AbstractIntlMessages from '../core/AbstractIntlMessages';
2
- import Formats from '../core/Formats';
3
- import IntlError from '../core/IntlError';
4
- import {RichTranslationValues} from '../core/TranslationValues';
5
-
6
- type IntlContextValue = {
7
- messages?: AbstractIntlMessages;
8
- locale: string;
9
- formats?: Partial<Formats>;
10
- timeZone?: string;
11
- onError(error: IntlError): void;
12
- getMessageFallback(info: {
13
- error: IntlError;
14
- key: string;
15
- namespace?: string;
16
- }): string;
17
- now?: Date;
18
- defaultTranslationValues?: RichTranslationValues;
19
- };
20
-
21
- export default IntlContextValue;
@@ -1,17 +0,0 @@
1
- import {ReactNode} from 'react';
2
- import {AbstractIntlMessages} from '../core';
3
- import IntlConfiguration from '../core/IntlConfiguration';
4
- import {RichTranslationValues} from '../core/TranslationValues';
5
-
6
- type IntlProviderProps = IntlConfiguration & {
7
- /** All components that use the provided hooks should be within this tree. */
8
- children: ReactNode;
9
- /** Global default values for translation values and rich text elements.
10
- * Can be used for consistent usage or styling of rich text elements.
11
- * Defaults will be overidden by locally provided values. */
12
- defaultTranslationValues?: RichTranslationValues;
13
- /** All messages that will be available in your components. */
14
- messages?: AbstractIntlMessages;
15
- };
16
-
17
- export default IntlProviderProps;