@team-monolith/cds 1.129.2-alpha.2 → 1.130.0-alpha

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 (105) hide show
  1. package/dist/emotion.d.ts +185 -0
  2. package/dist/index.d.ts +8 -1
  3. package/dist/patterns/LexicalEditor/LexicalCustomConfigContext.d.ts +1 -0
  4. package/dist/patterns/LexicalEditor/LexicalCustomConfigContext.js +2 -1
  5. package/dist/patterns/LexicalEditor/LexicalEditor.d.ts +4 -0
  6. package/dist/patterns/LexicalEditor/LexicalEditor.js +9 -7
  7. package/dist/patterns/LexicalEditor/Plugins.d.ts +1 -0
  8. package/dist/patterns/LexicalEditor/Plugins.js +65 -61
  9. package/dist/patterns/LexicalEditor/components/FileSelectInput.js +24 -23
  10. package/dist/patterns/LexicalEditor/components/UploadFileDialog/UploadFileDialog.js +2 -1
  11. package/dist/patterns/LexicalEditor/nodes/FileNode/CompactFileView.d.ts +7 -0
  12. package/dist/patterns/LexicalEditor/nodes/FileNode/CompactFileView.js +53 -0
  13. package/dist/patterns/LexicalEditor/nodes/FileNode/FileComponent.d.ts +0 -27
  14. package/dist/patterns/LexicalEditor/nodes/FileNode/FileComponent.js +44 -115
  15. package/dist/patterns/LexicalEditor/nodes/FileNode/FileDownloadButton.js +1 -1
  16. package/dist/patterns/LexicalEditor/nodes/FileNode/fileStyles.d.ts +27 -0
  17. package/dist/patterns/LexicalEditor/nodes/FileNode/fileStyles.js +85 -0
  18. package/dist/patterns/LexicalEditor/nodes/ImageNode/CompactImageView.d.ts +6 -0
  19. package/dist/patterns/LexicalEditor/nodes/ImageNode/CompactImageView.js +91 -0
  20. package/dist/patterns/LexicalEditor/nodes/ImageNode/ImageComponent.js +108 -102
  21. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/InputComponent.js +7 -7
  22. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectComponent.js +4 -4
  23. package/dist/patterns/LexicalEditor/nodes/SheetInputNode/InputComponent.js +4 -4
  24. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectComponent.js +4 -4
  25. package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/CompactToolbarPlugin.d.ts +1 -0
  26. package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/CompactToolbarPlugin.js +106 -0
  27. package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/compactAttachmentNodes.d.ts +8 -0
  28. package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/compactAttachmentNodes.js +6 -0
  29. package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/index.d.ts +1 -0
  30. package/dist/patterns/LexicalEditor/plugins/DragDropPastePlugin/index.js +15 -14
  31. package/dist/patterns/LexicalEditor/uploadConstants.d.ts +6 -0
  32. package/dist/patterns/LexicalEditor/uploadConstants.js +4 -0
  33. package/package.json +3 -7
  34. package/@types/emotion.d.ts +0 -197
  35. package/node_modules/react-i18next/.eslintrc.json +0 -74
  36. package/node_modules/react-i18next/.husky/pre-commit +0 -1
  37. package/node_modules/react-i18next/.prettierignore +0 -4
  38. package/node_modules/react-i18next/CHANGELOG.md +0 -1433
  39. package/node_modules/react-i18next/LICENSE +0 -22
  40. package/node_modules/react-i18next/README.md +0 -181
  41. package/node_modules/react-i18next/TransWithoutContext.d.mts +0 -1
  42. package/node_modules/react-i18next/TransWithoutContext.d.ts +0 -129
  43. package/node_modules/react-i18next/dist/amd/react-i18next.js +0 -867
  44. package/node_modules/react-i18next/dist/amd/react-i18next.min.js +0 -1
  45. package/node_modules/react-i18next/dist/commonjs/I18nextProvider.js +0 -21
  46. package/node_modules/react-i18next/dist/commonjs/Trans.js +0 -54
  47. package/node_modules/react-i18next/dist/commonjs/TransWithoutContext.js +0 -330
  48. package/node_modules/react-i18next/dist/commonjs/Translation.js +0 -19
  49. package/node_modules/react-i18next/dist/commonjs/context.js +0 -81
  50. package/node_modules/react-i18next/dist/commonjs/defaults.js +0 -26
  51. package/node_modules/react-i18next/dist/commonjs/i18nInstance.js +0 -13
  52. package/node_modules/react-i18next/dist/commonjs/index.js +0 -128
  53. package/node_modules/react-i18next/dist/commonjs/initReactI18next.js +0 -15
  54. package/node_modules/react-i18next/dist/commonjs/unescape.js +0 -32
  55. package/node_modules/react-i18next/dist/commonjs/useSSR.js +0 -34
  56. package/node_modules/react-i18next/dist/commonjs/useTranslation.js +0 -114
  57. package/node_modules/react-i18next/dist/commonjs/utils.js +0 -76
  58. package/node_modules/react-i18next/dist/commonjs/withSSR.js +0 -27
  59. package/node_modules/react-i18next/dist/commonjs/withTranslation.js +0 -39
  60. package/node_modules/react-i18next/dist/es/I18nextProvider.js +0 -15
  61. package/node_modules/react-i18next/dist/es/Trans.js +0 -43
  62. package/node_modules/react-i18next/dist/es/TransWithoutContext.js +0 -321
  63. package/node_modules/react-i18next/dist/es/Translation.js +0 -12
  64. package/node_modules/react-i18next/dist/es/context.js +0 -42
  65. package/node_modules/react-i18next/dist/es/defaults.js +0 -18
  66. package/node_modules/react-i18next/dist/es/i18nInstance.js +0 -5
  67. package/node_modules/react-i18next/dist/es/index.js +0 -18
  68. package/node_modules/react-i18next/dist/es/initReactI18next.js +0 -9
  69. package/node_modules/react-i18next/dist/es/package.json +0 -1
  70. package/node_modules/react-i18next/dist/es/unescape.js +0 -25
  71. package/node_modules/react-i18next/dist/es/useSSR.js +0 -27
  72. package/node_modules/react-i18next/dist/es/useTranslation.js +0 -107
  73. package/node_modules/react-i18next/dist/es/utils.js +0 -62
  74. package/node_modules/react-i18next/dist/es/withSSR.js +0 -20
  75. package/node_modules/react-i18next/dist/es/withTranslation.js +0 -32
  76. package/node_modules/react-i18next/dist/umd/react-i18next.js +0 -871
  77. package/node_modules/react-i18next/dist/umd/react-i18next.min.js +0 -1
  78. package/node_modules/react-i18next/helpers.d.ts +0 -3
  79. package/node_modules/react-i18next/icu.macro.d.mts +0 -1
  80. package/node_modules/react-i18next/icu.macro.d.ts +0 -103
  81. package/node_modules/react-i18next/icu.macro.js +0 -729
  82. package/node_modules/react-i18next/index.d.mts +0 -1
  83. package/node_modules/react-i18next/index.d.ts +0 -209
  84. package/node_modules/react-i18next/initReactI18next.d.mts +0 -1
  85. package/node_modules/react-i18next/initReactI18next.d.ts +0 -3
  86. package/node_modules/react-i18next/lint-staged.config.mjs +0 -4
  87. package/node_modules/react-i18next/package.json +0 -167
  88. package/node_modules/react-i18next/react-i18next.js +0 -871
  89. package/node_modules/react-i18next/react-i18next.min.js +0 -1
  90. package/node_modules/react-i18next/src/I18nextProvider.js +0 -7
  91. package/node_modules/react-i18next/src/Trans.js +0 -45
  92. package/node_modules/react-i18next/src/TransWithoutContext.js +0 -479
  93. package/node_modules/react-i18next/src/Translation.js +0 -14
  94. package/node_modules/react-i18next/src/context.js +0 -54
  95. package/node_modules/react-i18next/src/defaults.js +0 -20
  96. package/node_modules/react-i18next/src/i18nInstance.js +0 -7
  97. package/node_modules/react-i18next/src/index.js +0 -22
  98. package/node_modules/react-i18next/src/initReactI18next.js +0 -11
  99. package/node_modules/react-i18next/src/unescape.js +0 -31
  100. package/node_modules/react-i18next/src/useSSR.js +0 -33
  101. package/node_modules/react-i18next/src/useTranslation.js +0 -171
  102. package/node_modules/react-i18next/src/utils.js +0 -93
  103. package/node_modules/react-i18next/src/withSSR.js +0 -21
  104. package/node_modules/react-i18next/src/withTranslation.js +0 -35
  105. package/node_modules/react-i18next/vitest.workspace.typescript.mts +0 -52
@@ -1,22 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2025 i18next
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
22
-
@@ -1,181 +0,0 @@
1
- # react-i18next [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Awesome%20react-i18next%20for%20react.js%20based%20on%20i18next%20internationalization%20ecosystem%20&url=https://github.com/i18next/react-i18next&via=jamuhl&hashtags=i18n,reactjs,js,dev)
2
-
3
- [![CI](https://github.com/i18next/react-i18next/actions/workflows/CI.yml/badge.svg)](https://github.com/i18next/react-i18next/actions/workflows/CI.yml)
4
- [![Code Climate](https://codeclimate.com/github/codeclimate/codeclimate/badges/gpa.svg)](https://codeclimate.com/github/i18next/react-i18next)
5
- [![Coverage Status](https://coveralls.io/repos/github/i18next/react-i18next/badge.svg)](https://coveralls.io/github/i18next/react-i18next)
6
- [![Quality][quality-badge]][quality-url]
7
- [![npm][npm-dl-badge]][npm-url]
8
-
9
- [npm-icon]: https://nodei.co/npm/react-i18next.png?downloads=true
10
- [npm-url]: https://npmjs.org/package/react-i18next
11
- [quality-badge]: https://npm.packagequality.com/shield/react-i18next.svg
12
- [quality-url]: https://packagequality.com/#?package=react-i18next
13
- [npm-dl-badge]: https://img.shields.io/npm/dw/react-i18next
14
-
15
- ### IMPORTANT:
16
-
17
- Master Branch is the newest version using hooks (>= v10).
18
-
19
- ```bash
20
- $ >=v10.0.0
21
- npm i react-i18next
22
- ```
23
-
24
- **react-native: To use hooks within react-native, you must use react-native v0.59.0 or higher**
25
-
26
- For the legacy version please use the [v9.x.x Branch](https://github.com/i18next/react-i18next/tree/v9.x.x)
27
-
28
- ```bash
29
- $ v9.0.10 (legacy)
30
- npm i react-i18next@legacy
31
- ```
32
-
33
- ### Documentation
34
-
35
- The documentation is published on [react.i18next.com](https://react.i18next.com) and PR changes can be supplied [here](https://github.com/i18next/react-i18next-gitbook).
36
-
37
- The general i18next documentation is published on [www.i18next.com](https://www.i18next.com) and PR changes can be supplied [here](https://github.com/i18next/i18next-gitbook).
38
-
39
- ### What will my code look like?
40
-
41
- **Before:** Your react code would have looked something like:
42
-
43
- ```html
44
- ...
45
- <div>Just simple content</div>
46
- <div>
47
- Hello <strong title="this is your name">{name}</strong>, you have {count} unread message(s). <Link to="/msgs">Go to messages</Link>.
48
- </div>
49
- ...
50
- ```
51
-
52
- **After:** With the trans component just change it to:
53
-
54
- ```html
55
- ...
56
- <div>{t('simpleContent')}</div>
57
- <Trans i18nKey="userMessagesUnread" count={count}>
58
- Hello <strong title={t('nameTitle')}>{{name}}</strong>, you have {{count}} unread message. <Link to="/msgs">Go to messages</Link>.
59
- </Trans>
60
- ...
61
- ```
62
-
63
- ### 📖 What others say
64
-
65
- - [How to properly internationalize a React application using i18next](https://locize.com/blog/react-i18next/) by Adriano Raiano
66
- - [I18n with React and i18next](https://alligator.io/react/i18n-with-react-and-i18next) via Alligator.io by Danny Hurlburt
67
- - [Ultimate Localization of React (Mobx) App with i18next](https://itnext.io/ultimate-localization-of-react-mobx-app-with-i18next-efab77712149) via itnext.io by Viktor Shevchenko
68
- - [Internationalization for react done right Using the i18next i18n ecosystem](https://reactjsexample.com/internationalization-for-react-done-right-using-the-i18next-i18n-ecosystem/) via reactjsexample.com
69
- - [How to translate React application with react-i18next](https://codetain.com/blog/how-to-translate-react-application-with-react-i18next/) via codetain.co by Norbert Suski
70
- - [Building i18n with Gatsby](https://www.gatsbyjs.org/blog/2017-10-17-building-i18n-with-gatsby/) via gatsbyjs.org by Samuel Goudie
71
- - [Get your react.js application translated with style](https://medium.com/@jamuhl/get-your-react-js-application-translated-with-style-4ad090aefc2c) by Jan Mühlemann
72
- - [Translate your expo.io / react-native mobile application](https://medium.com/@jamuhl/translate-your-expo-io-react-native-mobile-application-aa220b2362d2) by Jan Mühlemann
73
- - You're welcome to share your story...
74
-
75
- ### Why i18next?
76
-
77
- - **Simplicity:** no need to change your webpack configuration or add additional babel transpilers, just use create-react-app and go.
78
- - **Production ready** we know there are more needs for production than just doing i18n on the clientside, so we offer wider support on [serverside](https://www.i18next.com/overview/supported-frameworks) too (nodejs, php, ruby, .net, ...). **Learn once - translate everywhere**.
79
- - **Beyond i18n** comes with [locize](https://locize.com) bridging the gap between development and translations - covering the whole translation process.
80
-
81
- ![ecosystem](https://raw.githubusercontent.com/i18next/i18next/master/assets/i18next-ecosystem.jpg)
82
-
83
- ### Localization workflow
84
-
85
- Want to learn more about how seamless your internationalization and translation process can be?
86
-
87
- [![video](example/locize/video_sample.png)](https://youtu.be/osScyaGMVqo)
88
-
89
- [watch the video](https://youtu.be/osScyaGMVqo)
90
-
91
- ### Installation
92
-
93
- Source can be loaded via [npm](https://www.npmjs.com/package/react-i18next) or [downloaded](https://github.com/i18next/react-i18next/blob/master/react-i18next.min.js) from this repo.
94
-
95
- ```
96
- # npm package
97
- $ npm install react-i18next
98
- ```
99
-
100
- - If you don't use a module loader it will be added to `window.reactI18next`
101
-
102
- ### Do you like to read a more complete step by step tutorial?
103
-
104
- [Here](https://locize.com/blog/react-i18next/) you'll find a simple tutorial on how to best use react-i18next.
105
- Some basics of i18next and some cool possibilities on how to optimize your localization workflow.
106
-
107
- ### Examples
108
-
109
- - [Example react](https://github.com/i18next/react-i18next/tree/master/example/react)
110
- - [React examples with typescript](https://github.com/i18next/react-i18next/tree/master/example/react-typescript)
111
- - [Example locize.com](https://github.com/i18next/react-i18next/tree/master/example/locize)
112
-
113
- #### v9 samples
114
-
115
- - [Example react](https://github.com/i18next/react-i18next/tree/v9.x.x/example/react)
116
- - [Example preact](https://github.com/i18next/react-i18next/tree/v9.x.x/example/preact)
117
- - [Example react-native](https://github.com/i18next/react-i18next/tree/v9.x.x/example/reactnative-expo)
118
- - [Example expo.io](https://github.com/i18next/react-i18next/tree/v9.x.x/example/reactnative-expo)
119
- - [Example next.js](https://github.com/i18next/react-i18next/tree/v9.x.x/example/nextjs)
120
- - [Example razzle](https://github.com/i18next/react-i18next/tree/v9.x.x/example/razzle-ssr)
121
- - [Example hashbase / beaker browser](https://github.com/i18next/react-i18next/tree/v9.x.x/example/dat)
122
- - [Example storybook](https://github.com/i18next/react-i18next/tree/v9.x.x/example/storybook)
123
- - [Example locize.com](https://github.com/i18next/react-i18next/tree/v9.x.x/example/locize)
124
- - [Example test with jest](https://github.com/i18next/react-i18next/tree/v9.x.x/example/test-jest)
125
-
126
- ### Requirements
127
-
128
- - react >= **16.8.0**
129
- - react-dom >= **16.8.0**
130
- - react-native >= **0.59.0**
131
- - i18next >= **10.0.0** (typescript users: >=17.0.9)
132
-
133
- #### v9
134
-
135
- - react >= **0.14.0** (in case of < v16 or preact you will need to define parent in [Trans component](https://react.i18next.com/legacy-v9/trans-component#trans-props) or globally in [i18next.react options](https://react.i18next.com/legacy-v9/trans-component#additional-options-on-i-18-next-init))
136
- - i18next >= **2.0.0**
137
-
138
- ## Core Contributors
139
-
140
- Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
141
-
142
- <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
143
- <!-- prettier-ignore-start -->
144
- <!-- markdownlint-disable -->
145
- <table>
146
- <tr>
147
- <td align="center"><a href="http://twitter.com/jamuhl"><img src="https://avatars3.githubusercontent.com/u/977772?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jan Mühlemann</b></sub></a><br /><a href="https://github.com/i18next/react-i18next/commits?author=jamuhl" title="Code">💻</a> <a href="#example-jamuhl" title="Examples">💡</a> <a href="https://github.com/i18next/react-i18next/pulls?q=is%3Apr+reviewed-by%3Ajamuhl+" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/i18next/react-i18next/commits?author=jamuhl" title="Documentation">📖</a> <a href="#question-jamuhl" title="Answering Questions">💬</a></td>
148
- <td align="center"><a href="http://twitter.com/#!/adrirai"><img src="https://avatars0.githubusercontent.com/u/1086194?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Adriano Raiano</b></sub></a><br /><a href="https://github.com/i18next/react-i18next/commits?author=adrai" title="Code">💻</a> <a href="#example-adrai" title="Examples">💡</a> <a href="https://github.com/i18next/react-i18next/pulls?q=is%3Apr+reviewed-by%3Aadrai+" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/i18next/react-i18next/commits?author=adrai" title="Documentation">📖</a> <a href="#question-adrai" title="Answering Questions">💬</a></td>
149
- <td align="center"><a href="https://github.com/pedrodurek"><img src="https://avatars1.githubusercontent.com/u/12190482?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Pedro Durek</b></sub></a><br /><a href="https://github.com/i18next/react-i18next/commits?author=pedrodurek" title="Code">💻</a> <a href="#example-pedrodurek" title="Examples">💡</a> <a href="https://github.com/i18next/react-i18next/pulls?q=is%3Apr+reviewed-by%3Apedrodurek+" title="Reviewed Pull Requests">👀</a> <a href="#question-pedrodurek" title="Answering Questions">💬</a></td>
150
- <td align="center"><a href="https://tigerabrodi.dev/"><img src="https://avatars1.githubusercontent.com/u/49603590?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tiger Abrodi</b></sub></a><br /><a href="https://github.com/i18next/react-i18next/commits?author=tigerabrodi" title="Code">💻</a> <a href="https://github.com/i18next/react-i18next/pulls?q=is%3Apr+reviewed-by%3Atigerabrodi" title="Reviewed Pull Requests">👀</a></td>
151
- </tr>
152
- </table>
153
-
154
- <!-- markdownlint-restore -->
155
- <!-- prettier-ignore-end -->
156
-
157
- <!-- ALL-CONTRIBUTORS-LIST:END -->
158
-
159
- This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind are welcome!
160
-
161
- ---
162
-
163
- <h3 align="center">Gold Sponsors</h3>
164
-
165
- <p align="center">
166
- <a href="https://locize.com/" target="_blank">
167
- <img src="https://raw.githubusercontent.com/i18next/i18next/master/assets/locize_sponsor_240.gif" width="240px">
168
- </a>
169
- </p>
170
-
171
- ---
172
-
173
- **localization as a service - locize.com**
174
-
175
- Needing a translation management? Want to edit your translations with an InContext Editor? Use the original provided to you by the maintainers of i18next!
176
-
177
- ![locize](https://cdn.prod.website-files.com/67a323e323a50df7f24f0a6f/67b8bbb29365c3a3c21c0898_github_locize.png)
178
-
179
- By using [locize](http://locize.com/?utm_source=react_i18next_readme&utm_medium=github) you directly support the future of i18next and react-i18next.
180
-
181
- ---
@@ -1 +0,0 @@
1
- export * from './TransWithoutContext.js';
@@ -1,129 +0,0 @@
1
- import type {
2
- i18n,
3
- ApplyTarget,
4
- ConstrainTarget,
5
- GetSource,
6
- ParseKeys,
7
- Namespace,
8
- SelectorFn,
9
- TypeOptions,
10
- TOptions,
11
- TFunction,
12
- } from 'i18next';
13
- import * as React from 'react';
14
-
15
- type _DefaultNamespace = TypeOptions['defaultNS'];
16
- type _EnableSelector = TypeOptions['enableSelector'];
17
-
18
- type TransChild = React.ReactNode | Record<string, unknown>;
19
- type $NoInfer<T> = [T][T extends T ? 0 : never];
20
-
21
- export type TransProps<
22
- Key extends ParseKeys<Ns, TOpt, KPrefix>,
23
- Ns extends Namespace = _DefaultNamespace,
24
- KPrefix = undefined,
25
- TContext extends string | undefined = undefined,
26
- TOpt extends TOptions & { context?: TContext } = { context: TContext },
27
- E = React.HTMLProps<HTMLDivElement>,
28
- > = E & {
29
- children?: TransChild | readonly TransChild[];
30
- components?: readonly React.ReactElement[] | { readonly [tagName: string]: React.ReactElement };
31
- count?: number;
32
- context?: TContext;
33
- defaults?: string;
34
- i18n?: i18n;
35
- i18nKey?: Key | Key[];
36
- ns?: Ns;
37
- parent?: string | React.ComponentType<any> | null; // used in React.createElement if not null
38
- tOptions?: TOpt;
39
- values?: {};
40
- shouldUnescape?: boolean;
41
- t?: TFunction<Ns, KPrefix>;
42
- };
43
-
44
- export interface TransLegacy {
45
- <
46
- Key extends ParseKeys<Ns, TOpt, KPrefix>,
47
- Ns extends Namespace = _DefaultNamespace,
48
- KPrefix = undefined,
49
- TContext extends string | undefined = undefined,
50
- TOpt extends TOptions & { context?: TContext } = { context: TContext },
51
- E = React.HTMLProps<HTMLDivElement>,
52
- >(
53
- props: TransProps<Key, Ns, KPrefix, TContext, TOpt, E>,
54
- ): React.ReactElement;
55
- }
56
-
57
- export interface TransSelectorProps<
58
- Key,
59
- Ns extends Namespace = _DefaultNamespace,
60
- KPrefix = undefined,
61
- TContext extends string | undefined = undefined,
62
- TOpt extends TOptions & { context?: TContext } = { context: TContext },
63
- > {
64
- children?: TransChild | readonly TransChild[];
65
- components?: readonly React.ReactElement[] | { readonly [tagName: string]: React.ReactElement };
66
- count?: number;
67
- context?: TContext;
68
- defaults?: string;
69
- i18n?: i18n;
70
- i18nKey?: Key;
71
- ns?: Ns;
72
- parent?: string | React.ComponentType<any> | null; // used in React.createElement if not null
73
- tOptions?: TOpt;
74
- values?: {};
75
- shouldUnescape?: boolean;
76
- t?: TFunction<Ns, KPrefix>;
77
- }
78
-
79
- export interface TransSelector {
80
- <
81
- Target extends ConstrainTarget<TOpt>,
82
- Key extends SelectorFn<GetSource<$NoInfer<Ns>, KPrefix>, ApplyTarget<Target, TOpt>, TOpt>,
83
- const Ns extends Namespace = _DefaultNamespace,
84
- KPrefix = undefined,
85
- TContext extends string | undefined = undefined,
86
- TOpt extends TOptions & { context?: TContext } = { context: TContext },
87
- E = React.HTMLProps<HTMLDivElement>,
88
- >(
89
- props: TransSelectorProps<Key, Ns, KPrefix, TContext, TOpt> & E,
90
- ): React.ReactElement;
91
- }
92
-
93
- export const Trans: _EnableSelector extends true | 'optimize' ? TransSelector : TransLegacy;
94
-
95
- export type ErrorCode =
96
- | 'NO_I18NEXT_INSTANCE'
97
- | 'NO_LANGUAGES'
98
- | 'DEPRECATED_OPTION'
99
- | 'TRANS_NULL_VALUE'
100
- | 'TRANS_INVALID_OBJ'
101
- | 'TRANS_INVALID_VAR'
102
- | 'TRANS_INVALID_COMPONENTS';
103
-
104
- export type ErrorMeta = {
105
- code: ErrorCode;
106
- i18nKey?: string;
107
- [x: string]: any;
108
- };
109
-
110
- /**
111
- * Use to type the logger arguments
112
- * @example
113
- * ```
114
- * import type { ErrorArgs } from 'react-i18next';
115
- *
116
- * const logger = {
117
- * // ....
118
- * warn: function (...args: ErrorArgs) {
119
- * if (args[1]?.code === 'TRANS_INVALID_OBJ') {
120
- * const [msg, { i18nKey, ...rest }] = args;
121
- * return log(i18nKey, msg, rest);
122
- * }
123
- * log(...args);
124
- * }
125
- * }
126
- * i18n.use(logger).use(i18nReactPlugin).init({...});
127
- * ```
128
- */
129
- export type ErrorArgs = readonly [string, ErrorMeta | undefined, ...any[]];