fastapi-rtk 2.9.0 → 2.9.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.
Files changed (221) hide show
  1. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineObjectInput.cjs +2 -2
  2. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineTableControl/MantineTableControl.cjs +6 -11
  3. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/ExpandPanelRenderer.cjs +2 -2
  4. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/MantineArrayLayout.cjs +3 -5
  5. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/utils/layout.cjs +2 -2
  6. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineObjectInput.mjs +2 -2
  7. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineTableControl/MantineTableControl.mjs +7 -12
  8. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/ExpandPanelRenderer.mjs +2 -2
  9. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/MantineArrayLayout.mjs +3 -5
  10. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/utils/layout.mjs +2 -2
  11. package/dist/.external/cjs/html-parse-stringify@3.0.1/html-parse-stringify/dist/html-parse-stringify.module.cjs +59 -0
  12. package/dist/.external/cjs/lodash@4.17.23/lodash/_cloneBuffer.cjs +1 -1
  13. package/dist/.external/cjs/lodash@4.17.23/lodash/_freeGlobal.cjs +1 -1
  14. package/dist/.external/cjs/lodash@4.17.23/lodash/_nodeUtil.cjs +1 -1
  15. package/dist/.external/cjs/lodash@4.17.23/lodash/isBuffer.cjs +1 -1
  16. package/dist/.external/cjs/lodash@4.17.23/lodash/lodash.cjs +2 -2
  17. package/dist/.external/cjs/mantine-react-table@2.0.0-beta.9_patch_hash_b9fcaf5fc0698f1949127d6bfb1f154a5bd28d0d1fe_7b4bd73d03bc0c4b3e9706b344be0f5a/mantine-react-table/locales/de/index.cjs +1 -1
  18. package/dist/.external/cjs/mantine-react-table@2.0.0-beta.9_patch_hash_b9fcaf5fc0698f1949127d6bfb1f154a5bd28d0d1fe_7b4bd73d03bc0c4b3e9706b344be0f5a/mantine-react-table/locales/en/index.cjs +1 -1
  19. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/I18nextProvider.cjs +3 -3
  20. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/Trans.cjs +48 -0
  21. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/TransWithoutContext.cjs +331 -0
  22. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/Translation.cjs +15 -0
  23. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/context.cjs +32 -2
  24. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/index.cjs +42 -0
  25. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/useSSR.cjs +32 -0
  26. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/useTranslation.cjs +9 -9
  27. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/utils.cjs +2 -0
  28. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/withSSR.cjs +23 -0
  29. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/withTranslation.cjs +35 -0
  30. package/dist/.external/cjs/toposort@2.0.2/toposort/index.cjs +1 -1
  31. package/dist/.external/cjs/void-elements@3.1.0/void-elements/index.cjs +26 -0
  32. package/dist/.external/cjs/yup@1.7.1/yup/index.esm.cjs +2 -789
  33. package/dist/.external/cjs/zustand@5.0.10_@types_react@19.2.9_react@19.2.3/zustand/esm/index.cjs +7 -0
  34. package/dist/.external/esm/html-parse-stringify@3.0.1/html-parse-stringify/dist/html-parse-stringify.module.mjs +60 -0
  35. package/dist/.external/esm/lodash@4.17.23/lodash/_cloneBuffer.mjs +1 -1
  36. package/dist/.external/esm/lodash@4.17.23/lodash/_freeGlobal.mjs +1 -1
  37. package/dist/.external/esm/lodash@4.17.23/lodash/_nodeUtil.mjs +1 -1
  38. package/dist/.external/esm/lodash@4.17.23/lodash/isBuffer.mjs +1 -1
  39. package/dist/.external/esm/lodash@4.17.23/lodash/lodash.mjs +2 -2
  40. package/dist/.external/esm/mantine-react-table@2.0.0-beta.9_patch_hash_b9fcaf5fc0698f1949127d6bfb1f154a5bd28d0d1fe_7b4bd73d03bc0c4b3e9706b344be0f5a/mantine-react-table/locales/de/index.mjs +1 -1
  41. package/dist/.external/esm/mantine-react-table@2.0.0-beta.9_patch_hash_b9fcaf5fc0698f1949127d6bfb1f154a5bd28d0d1fe_7b4bd73d03bc0c4b3e9706b344be0f5a/mantine-react-table/locales/en/index.mjs +1 -1
  42. package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/Trans.mjs +49 -0
  43. package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/TransWithoutContext.mjs +331 -0
  44. package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/Translation.mjs +15 -0
  45. package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/context.mjs +32 -1
  46. package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/index.mjs +42 -0
  47. package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/useSSR.mjs +32 -0
  48. package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/utils.mjs +2 -0
  49. package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/withSSR.mjs +23 -0
  50. package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/withTranslation.mjs +35 -0
  51. package/dist/.external/esm/toposort@2.0.2/toposort/index.mjs +1 -1
  52. package/dist/.external/esm/void-elements@3.1.0/void-elements/index.mjs +26 -0
  53. package/dist/.external/esm/yup@1.7.1/yup/index.esm.mjs +3 -790
  54. package/dist/.external/esm/zustand@5.0.10_@types_react@19.2.9_react@19.2.3/zustand/esm/index.mjs +7 -0
  55. package/dist/.external/esm/zustand@5.0.10_@types_react@19.2.9_react@19.2.3/zustand/esm/react.mjs +5 -5
  56. package/dist/api/cjs/ApiProvider/hooks/useProvideApi.cjs +9 -7
  57. package/dist/api/cjs/ApiProvider/hooks/useProvideForm.cjs +2 -2
  58. package/dist/api/cjs/ApiProvider/hooks/utils/useStreamingData.cjs +2 -2
  59. package/dist/api/cjs/ApiProvider/utils/getValidationSchema.cjs +3 -3
  60. package/dist/api/cjs/Provider/Contexts/LangContext.cjs +2 -4
  61. package/dist/api/cjs/Provider/Provider.cjs +4 -3
  62. package/dist/api/cjs/Provider/hooks/useProvideAuth.cjs +4 -3
  63. package/dist/api/cjs/Provider/hooks/useProvideInfo.cjs +2 -2
  64. package/dist/api/cjs/Provider/hooks/useProvideLang.cjs +9 -7
  65. package/dist/api/cjs/index.cjs +2 -0
  66. package/dist/api/esm/ApiProvider/hooks/useProvideApi.mjs +3 -1
  67. package/dist/api/esm/ApiProvider/hooks/useProvideForm.mjs +2 -2
  68. package/dist/api/esm/ApiProvider/hooks/utils/useStreamingData.mjs +1 -1
  69. package/dist/api/esm/ApiProvider/utils/getValidationSchema.mjs +3 -4
  70. package/dist/api/esm/Provider/Contexts/LangContext.mjs +3 -5
  71. package/dist/api/esm/Provider/Provider.mjs +2 -1
  72. package/dist/api/esm/Provider/hooks/useProvideAuth.mjs +2 -1
  73. package/dist/api/esm/Provider/hooks/useProvideInfo.mjs +1 -1
  74. package/dist/api/esm/Provider/hooks/useProvideLang.mjs +10 -8
  75. package/dist/api/esm/index.mjs +2 -0
  76. package/dist/api/lib/ApiProvider/hooks/types.d.ts +1 -1
  77. package/dist/api/lib/ApiProvider/hooks/useProvideForm.d.ts +2 -1
  78. package/dist/api/lib/ApiProvider/hooks/utils/useStreamingData.d.ts +26 -26
  79. package/dist/api/lib/ApiProvider/types.d.ts +1 -1
  80. package/dist/api/lib/ApiProvider/utils/getValidationSchema.d.ts +1 -1
  81. package/dist/api/lib/Provider/hooks/useProvideAuth.d.ts +3 -3
  82. package/dist/api/lib/Provider/hooks/useProvideInfo.d.ts +1 -1
  83. package/dist/api/lib/Provider/types.d.ts +1 -1
  84. package/dist/api/lib/adapters/types.d.ts +10 -0
  85. package/dist/api/lib/hooks/auth/types.d.ts +1 -1
  86. package/dist/api/lib/index.d.ts +1 -0
  87. package/dist/constants/cjs/index.cjs +0 -5
  88. package/dist/constants/esm/index.mjs +0 -5
  89. package/dist/constants/lib/index.d.ts +1 -6
  90. package/dist/contexts/cjs/_virtual/index5.cjs +6 -0
  91. package/dist/contexts/cjs/index.cjs +4 -0
  92. package/dist/contexts/esm/_virtual/index5.mjs +7 -0
  93. package/dist/contexts/esm/index.mjs +5 -1
  94. package/dist/contexts/lib/index.d.ts +2 -0
  95. package/dist/core/cjs/Dialogs/EditDialog.cjs +1 -2
  96. package/dist/core/cjs/Tables/DataGrid/Toolbar/Filter/FilterMenu.cjs +8 -9
  97. package/dist/core/cjs/Tables/NextGenDataGrid/components/OptimizedMRT_RowSelectColumn/zustand.cjs +2 -2
  98. package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useOptimizations.cjs +1 -2
  99. package/dist/core/cjs/_virtual/index.cjs +25 -3
  100. package/dist/core/cjs/_virtual/index2.cjs +25 -3
  101. package/dist/core/cjs/_virtual/index3.cjs +3 -5
  102. package/dist/core/cjs/_virtual/index4.cjs +2 -2
  103. package/dist/core/cjs/_virtual/index5.cjs +5 -0
  104. package/dist/core/cjs/_virtual/index6.cjs +3 -0
  105. package/dist/{constants/cjs/_virtual/index4.cjs → core/cjs/_virtual/index7.cjs} +2 -2
  106. package/dist/core/cjs/adapters/web/index.cjs +4 -1
  107. package/dist/core/cjs/adapters/web/webLocalizationAdapter.cjs +13 -0
  108. package/dist/core/cjs/index.cjs +10 -5
  109. package/dist/core/esm/Dialogs/EditDialog.mjs +2 -3
  110. package/dist/core/esm/Tables/DataGrid/Toolbar/Filter/FilterMenu.mjs +8 -9
  111. package/dist/core/esm/Tables/NextGenDataGrid/components/OptimizedMRT_RowSelectColumn/zustand.mjs +2 -2
  112. package/dist/core/esm/Tables/NextGenDataGrid/hooks/useOptimizations.mjs +2 -3
  113. package/dist/core/esm/_virtual/index.mjs +25 -3
  114. package/dist/core/esm/_virtual/index2.mjs +25 -3
  115. package/dist/core/esm/_virtual/index3.mjs +2 -5
  116. package/dist/core/esm/_virtual/index4.mjs +2 -2
  117. package/dist/core/esm/_virtual/index5.mjs +5 -0
  118. package/dist/core/esm/_virtual/index6.mjs +2 -0
  119. package/dist/core/esm/_virtual/index7.mjs +4 -0
  120. package/dist/core/esm/adapters/web/index.mjs +4 -1
  121. package/dist/core/esm/adapters/web/webLocalizationAdapter.mjs +13 -0
  122. package/dist/core/esm/index.mjs +3 -4
  123. package/dist/core/lib/Tables/NextGenDataGrid/components/OptimizedMRT_RowSelectColumn/zustand.d.ts +3 -3
  124. package/dist/core/lib/Tables/NextGenDataGrid/types.d.ts +2 -2
  125. package/dist/core/lib/adapters/web/index.d.ts +2 -1
  126. package/dist/core/lib/adapters/web/webLocalizationAdapter.d.ts +2 -0
  127. package/dist/core/lib/index.d.ts +2 -2
  128. package/dist/jsonforms/cjs/MantineInputs/MantineObjectInput.cjs +2 -2
  129. package/dist/jsonforms/cjs/complex/MantineTableControl/MantineTableControl.cjs +6 -11
  130. package/dist/jsonforms/cjs/layouts/Array/ExpandPanelRenderer.cjs +2 -2
  131. package/dist/jsonforms/cjs/layouts/Array/MantineArrayLayout.cjs +3 -5
  132. package/dist/jsonforms/cjs/utils/layout.cjs +2 -2
  133. package/dist/jsonforms/esm/MantineInputs/MantineObjectInput.mjs +2 -2
  134. package/dist/jsonforms/esm/complex/MantineTableControl/MantineTableControl.mjs +7 -12
  135. package/dist/jsonforms/esm/layouts/Array/ExpandPanelRenderer.mjs +2 -2
  136. package/dist/jsonforms/esm/layouts/Array/MantineArrayLayout.mjs +3 -5
  137. package/dist/jsonforms/esm/utils/layout.mjs +2 -2
  138. package/dist/utils/cjs/_virtual/_commonjsHelpers.cjs +4 -0
  139. package/dist/utils/cjs/_virtual/lodash.cjs +6 -3
  140. package/dist/utils/cjs/index.cjs +2 -0
  141. package/dist/utils/esm/_virtual/_commonjsHelpers.mjs +5 -1
  142. package/dist/utils/esm/_virtual/lodash.mjs +3 -0
  143. package/dist/utils/esm/index.mjs +2 -0
  144. package/dist/utils/lib/index.d.ts +2 -0
  145. package/dist/zustand/cjs/index.cjs +2 -0
  146. package/dist/zustand/esm/index.mjs +3 -1
  147. package/dist/zustand/lib/index.d.ts +1 -0
  148. package/package.json +3 -2
  149. package/dist/.bundled/jsonforms/cjs/_virtual/lodash.cjs +0 -5
  150. package/dist/.bundled/jsonforms/cjs/_virtual/lodash2.cjs +0 -4
  151. package/dist/.bundled/jsonforms/cjs/_virtual/map.cjs +0 -6
  152. package/dist/.bundled/jsonforms/cjs/_virtual/union.cjs +0 -6
  153. package/dist/.bundled/jsonforms/esm/_virtual/lodash.mjs +0 -5
  154. package/dist/.bundled/jsonforms/esm/_virtual/lodash2.mjs +0 -4
  155. package/dist/.bundled/jsonforms/esm/_virtual/map.mjs +0 -7
  156. package/dist/.bundled/jsonforms/esm/_virtual/union.mjs +0 -7
  157. package/dist/.external/cjs/lodash@4.17.23/lodash/_arrayIncludesWith.cjs +0 -20
  158. package/dist/.external/cjs/lodash@4.17.23/lodash/_baseMap.cjs +0 -21
  159. package/dist/.external/cjs/lodash@4.17.23/lodash/_baseUniq.cjs +0 -59
  160. package/dist/.external/cjs/lodash@4.17.23/lodash/_createSet.cjs +0 -19
  161. package/dist/.external/cjs/lodash@4.17.23/lodash/map.cjs +0 -20
  162. package/dist/.external/cjs/lodash@4.17.23/lodash/union.cjs +0 -19
  163. package/dist/.external/esm/lodash@4.17.23/lodash/_arrayIncludesWith.mjs +0 -20
  164. package/dist/.external/esm/lodash@4.17.23/lodash/_baseMap.mjs +0 -21
  165. package/dist/.external/esm/lodash@4.17.23/lodash/_baseUniq.mjs +0 -59
  166. package/dist/.external/esm/lodash@4.17.23/lodash/_createSet.mjs +0 -19
  167. package/dist/.external/esm/lodash@4.17.23/lodash/map.mjs +0 -20
  168. package/dist/.external/esm/lodash@4.17.23/lodash/union.mjs +0 -19
  169. package/dist/constants/cjs/_virtual/index.cjs +0 -27
  170. package/dist/constants/cjs/_virtual/index2.cjs +0 -27
  171. package/dist/constants/cjs/_virtual/index3.cjs +0 -4
  172. package/dist/constants/esm/_virtual/index.mjs +0 -27
  173. package/dist/constants/esm/_virtual/index2.mjs +0 -27
  174. package/dist/constants/esm/_virtual/index3.mjs +0 -4
  175. package/dist/constants/esm/_virtual/index4.mjs +0 -4
  176. package/dist/core/cjs/_virtual/_commonjsHelpers.cjs +0 -8
  177. package/dist/core/cjs/_virtual/_nodeUtil.cjs +0 -4
  178. package/dist/core/cjs/_virtual/isBuffer.cjs +0 -4
  179. package/dist/core/cjs/_virtual/isEqual.cjs +0 -6
  180. package/dist/core/cjs/_virtual/lodash.cjs +0 -5
  181. package/dist/core/cjs/_virtual/lodash2.cjs +0 -4
  182. package/dist/core/esm/_virtual/_commonjsHelpers.mjs +0 -8
  183. package/dist/core/esm/_virtual/_nodeUtil.mjs +0 -4
  184. package/dist/core/esm/_virtual/isBuffer.mjs +0 -4
  185. package/dist/core/esm/_virtual/isEqual.mjs +0 -7
  186. package/dist/core/esm/_virtual/lodash.mjs +0 -5
  187. package/dist/core/esm/_virtual/lodash2.mjs +0 -4
  188. package/dist/jsonforms/cjs/_virtual/_cloneBuffer.cjs +0 -4
  189. package/dist/jsonforms/cjs/_virtual/_commonjsHelpers.cjs +0 -8
  190. package/dist/jsonforms/cjs/_virtual/_nodeUtil.cjs +0 -4
  191. package/dist/jsonforms/cjs/_virtual/isBuffer.cjs +0 -4
  192. package/dist/jsonforms/cjs/_virtual/isEmpty.cjs +0 -6
  193. package/dist/jsonforms/cjs/_virtual/lodash.cjs +0 -5
  194. package/dist/jsonforms/cjs/_virtual/lodash2.cjs +0 -4
  195. package/dist/jsonforms/cjs/_virtual/map.cjs +0 -6
  196. package/dist/jsonforms/cjs/_virtual/merge.cjs +0 -6
  197. package/dist/jsonforms/cjs/_virtual/range.cjs +0 -6
  198. package/dist/jsonforms/cjs/_virtual/startCase.cjs +0 -6
  199. package/dist/jsonforms/cjs/_virtual/union.cjs +0 -6
  200. package/dist/jsonforms/esm/_virtual/_cloneBuffer.mjs +0 -4
  201. package/dist/jsonforms/esm/_virtual/_commonjsHelpers.mjs +0 -8
  202. package/dist/jsonforms/esm/_virtual/_nodeUtil.mjs +0 -4
  203. package/dist/jsonforms/esm/_virtual/isBuffer.mjs +0 -4
  204. package/dist/jsonforms/esm/_virtual/isEmpty.mjs +0 -7
  205. package/dist/jsonforms/esm/_virtual/lodash.mjs +0 -5
  206. package/dist/jsonforms/esm/_virtual/lodash2.mjs +0 -4
  207. package/dist/jsonforms/esm/_virtual/map.mjs +0 -7
  208. package/dist/jsonforms/esm/_virtual/merge.mjs +0 -7
  209. package/dist/jsonforms/esm/_virtual/range.mjs +0 -7
  210. package/dist/jsonforms/esm/_virtual/startCase.mjs +0 -7
  211. package/dist/jsonforms/esm/_virtual/union.mjs +0 -7
  212. /package/dist/{api → contexts}/cjs/_virtual/_commonjsHelpers.cjs +0 -0
  213. /package/dist/{api → contexts}/cjs/_virtual/index.cjs +0 -0
  214. /package/dist/{api → contexts}/cjs/_virtual/index2.cjs +0 -0
  215. /package/dist/{api → contexts}/cjs/_virtual/index3.cjs +0 -0
  216. /package/dist/{api → contexts}/cjs/_virtual/index4.cjs +0 -0
  217. /package/dist/{api → contexts}/esm/_virtual/_commonjsHelpers.mjs +0 -0
  218. /package/dist/{api → contexts}/esm/_virtual/index.mjs +0 -0
  219. /package/dist/{api → contexts}/esm/_virtual/index2.mjs +0 -0
  220. /package/dist/{api → contexts}/esm/_virtual/index3.mjs +0 -0
  221. /package/dist/{api → contexts}/esm/_virtual/index4.mjs +0 -0
@@ -0,0 +1,331 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const react = require("react");
4
+ const htmlParseStringify_module = require("../../../../html-parse-stringify@3.0.1/html-parse-stringify/dist/html-parse-stringify.module.cjs");
5
+ const utils = require("./utils.cjs");
6
+ const defaults = require("./defaults.cjs");
7
+ const i18nInstance = require("./i18nInstance.cjs");
8
+ const hasChildren = (node, checkLength) => {
9
+ var _a;
10
+ if (!node) return false;
11
+ const base = ((_a = node.props) == null ? void 0 : _a.children) ?? node.children;
12
+ if (checkLength) return base.length > 0;
13
+ return !!base;
14
+ };
15
+ const getChildren = (node) => {
16
+ var _a, _b;
17
+ if (!node) return [];
18
+ const children = ((_a = node.props) == null ? void 0 : _a.children) ?? node.children;
19
+ return ((_b = node.props) == null ? void 0 : _b.i18nIsDynamicList) ? getAsArray(children) : children;
20
+ };
21
+ const hasValidReactChildren = (children) => Array.isArray(children) && children.every(react.isValidElement);
22
+ const getAsArray = (data) => Array.isArray(data) ? data : [data];
23
+ const mergeProps = (source, target) => {
24
+ const newTarget = {
25
+ ...target
26
+ };
27
+ newTarget.props = Object.assign(source.props, target.props);
28
+ return newTarget;
29
+ };
30
+ const nodesToString = (children, i18nOptions, i18n, i18nKey) => {
31
+ if (!children) return "";
32
+ let stringNode = "";
33
+ const childrenArray = getAsArray(children);
34
+ const keepArray = (i18nOptions == null ? void 0 : i18nOptions.transSupportBasicHtmlNodes) ? i18nOptions.transKeepBasicHtmlNodesFor ?? [] : [];
35
+ childrenArray.forEach((child, childIndex) => {
36
+ if (utils.isString(child)) {
37
+ stringNode += `${child}`;
38
+ return;
39
+ }
40
+ if (react.isValidElement(child)) {
41
+ const {
42
+ props,
43
+ type
44
+ } = child;
45
+ const childPropsCount = Object.keys(props).length;
46
+ const shouldKeepChild = keepArray.indexOf(type) > -1;
47
+ const childChildren = props.children;
48
+ if (!childChildren && shouldKeepChild && !childPropsCount) {
49
+ stringNode += `<${type}/>`;
50
+ return;
51
+ }
52
+ if (!childChildren && (!shouldKeepChild || childPropsCount) || props.i18nIsDynamicList) {
53
+ stringNode += `<${childIndex}></${childIndex}>`;
54
+ return;
55
+ }
56
+ if (shouldKeepChild && childPropsCount === 1 && utils.isString(childChildren)) {
57
+ stringNode += `<${type}>${childChildren}</${type}>`;
58
+ return;
59
+ }
60
+ const content = nodesToString(childChildren, i18nOptions, i18n, i18nKey);
61
+ stringNode += `<${childIndex}>${content}</${childIndex}>`;
62
+ return;
63
+ }
64
+ if (child === null) {
65
+ utils.warn(i18n, "TRANS_NULL_VALUE", `Passed in a null value as child`, {
66
+ i18nKey
67
+ });
68
+ return;
69
+ }
70
+ if (utils.isObject(child)) {
71
+ const {
72
+ format,
73
+ ...clone
74
+ } = child;
75
+ const keys = Object.keys(clone);
76
+ if (keys.length === 1) {
77
+ const value = format ? `${keys[0]}, ${format}` : keys[0];
78
+ stringNode += `{{${value}}}`;
79
+ return;
80
+ }
81
+ utils.warn(i18n, "TRANS_INVALID_OBJ", `Invalid child - Object should only have keys {{ value, format }} (format is optional).`, {
82
+ i18nKey,
83
+ child
84
+ });
85
+ return;
86
+ }
87
+ utils.warn(i18n, "TRANS_INVALID_VAR", `Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.`, {
88
+ i18nKey,
89
+ child
90
+ });
91
+ });
92
+ return stringNode;
93
+ };
94
+ const renderNodes = (children, knownComponentsMap, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) => {
95
+ if (targetString === "") return [];
96
+ const keepArray = i18nOptions.transKeepBasicHtmlNodesFor || [];
97
+ const emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.map((keep) => `<${keep}`).join("|")).test(targetString);
98
+ if (!children && !knownComponentsMap && !emptyChildrenButNeedsHandling && !shouldUnescape) return [targetString];
99
+ const data = knownComponentsMap ?? {};
100
+ const getData = (childs) => {
101
+ const childrenArray = getAsArray(childs);
102
+ childrenArray.forEach((child) => {
103
+ if (utils.isString(child)) return;
104
+ if (hasChildren(child)) getData(getChildren(child));
105
+ else if (utils.isObject(child) && !react.isValidElement(child)) Object.assign(data, child);
106
+ });
107
+ };
108
+ getData(children);
109
+ const ast = htmlParseStringify_module.parse(`<0>${targetString}</0>`);
110
+ const opts = {
111
+ ...data,
112
+ ...combinedTOpts
113
+ };
114
+ const renderInner = (child, node, rootReactNode) => {
115
+ var _a;
116
+ const childs = getChildren(child);
117
+ const mappedChildren = mapAST(childs, node.children, rootReactNode);
118
+ return hasValidReactChildren(childs) && mappedChildren.length === 0 || ((_a = child.props) == null ? void 0 : _a.i18nIsDynamicList) ? childs : mappedChildren;
119
+ };
120
+ const pushTranslatedJSX = (child, inner, mem, i, isVoid) => {
121
+ if (child.dummy) {
122
+ child.children = inner;
123
+ mem.push(react.cloneElement(child, {
124
+ key: i
125
+ }, isVoid ? void 0 : inner));
126
+ } else {
127
+ mem.push(...react.Children.map([child], (c) => {
128
+ const props = {
129
+ ...c.props
130
+ };
131
+ delete props.i18nIsDynamicList;
132
+ return react.createElement(c.type, {
133
+ ...props,
134
+ key: i,
135
+ ref: c.props.ref ?? c.ref
136
+ }, isVoid ? null : inner);
137
+ }));
138
+ }
139
+ };
140
+ const mapAST = (reactNode, astNode, rootReactNode) => {
141
+ const reactNodes = getAsArray(reactNode);
142
+ const astNodes = getAsArray(astNode);
143
+ return astNodes.reduce((mem, node, i) => {
144
+ var _a, _b;
145
+ const translationContent = ((_b = (_a = node.children) == null ? void 0 : _a[0]) == null ? void 0 : _b.content) && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);
146
+ if (node.type === "tag") {
147
+ let tmp = reactNodes[parseInt(node.name, 10)];
148
+ if (!tmp && knownComponentsMap) tmp = knownComponentsMap[node.name];
149
+ if (rootReactNode.length === 1 && !tmp) tmp = rootReactNode[0][node.name];
150
+ if (!tmp) tmp = {};
151
+ const child = Object.keys(node.attrs).length !== 0 ? mergeProps({
152
+ props: node.attrs
153
+ }, tmp) : tmp;
154
+ const isElement = react.isValidElement(child);
155
+ const isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;
156
+ const isEmptyTransWithHTML = emptyChildrenButNeedsHandling && utils.isObject(child) && child.dummy && !isElement;
157
+ const isKnownComponent = utils.isObject(knownComponentsMap) && Object.hasOwnProperty.call(knownComponentsMap, node.name);
158
+ if (utils.isString(child)) {
159
+ const value = i18n.services.interpolator.interpolate(child, opts, i18n.language);
160
+ mem.push(value);
161
+ } else if (hasChildren(child) || isValidTranslationWithChildren) {
162
+ const inner = renderInner(child, node, rootReactNode);
163
+ pushTranslatedJSX(child, inner, mem, i);
164
+ } else if (isEmptyTransWithHTML) {
165
+ const inner = mapAST(reactNodes, node.children, rootReactNode);
166
+ pushTranslatedJSX(child, inner, mem, i);
167
+ } else if (Number.isNaN(parseFloat(node.name))) {
168
+ if (isKnownComponent) {
169
+ const inner = renderInner(child, node, rootReactNode);
170
+ pushTranslatedJSX(child, inner, mem, i, node.voidElement);
171
+ } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {
172
+ if (node.voidElement) {
173
+ mem.push(react.createElement(node.name, {
174
+ key: `${node.name}-${i}`
175
+ }));
176
+ } else {
177
+ const inner = mapAST(reactNodes, node.children, rootReactNode);
178
+ mem.push(react.createElement(node.name, {
179
+ key: `${node.name}-${i}`
180
+ }, inner));
181
+ }
182
+ } else if (node.voidElement) {
183
+ mem.push(`<${node.name} />`);
184
+ } else {
185
+ const inner = mapAST(reactNodes, node.children, rootReactNode);
186
+ mem.push(`<${node.name}>${inner}</${node.name}>`);
187
+ }
188
+ } else if (utils.isObject(child) && !isElement) {
189
+ const content = node.children[0] ? translationContent : null;
190
+ if (content) mem.push(content);
191
+ } else {
192
+ pushTranslatedJSX(child, translationContent, mem, i, node.children.length !== 1 || !translationContent);
193
+ }
194
+ } else if (node.type === "text") {
195
+ const wrapTextNodes = i18nOptions.transWrapTextNodes;
196
+ const content = shouldUnescape ? i18nOptions.unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);
197
+ if (wrapTextNodes) {
198
+ mem.push(react.createElement(wrapTextNodes, {
199
+ key: `${node.name}-${i}`
200
+ }, content));
201
+ } else {
202
+ mem.push(content);
203
+ }
204
+ }
205
+ return mem;
206
+ }, []);
207
+ };
208
+ const result = mapAST([{
209
+ dummy: true,
210
+ children: children || []
211
+ }], ast, getAsArray(children || []));
212
+ return getChildren(result[0]);
213
+ };
214
+ const fixComponentProps = (component, index, translation) => {
215
+ const componentKey = component.key || index;
216
+ const comp = react.cloneElement(component, {
217
+ key: componentKey
218
+ });
219
+ if (!comp.props || !comp.props.children || translation.indexOf(`${index}/>`) < 0 && translation.indexOf(`${index} />`) < 0) {
220
+ return comp;
221
+ }
222
+ function Componentized() {
223
+ return react.createElement(react.Fragment, null, comp);
224
+ }
225
+ return react.createElement(Componentized, {
226
+ key: componentKey
227
+ });
228
+ };
229
+ const generateArrayComponents = (components, translation) => components.map((c, index) => fixComponentProps(c, index, translation));
230
+ const generateObjectComponents = (components, translation) => {
231
+ const componentMap = {};
232
+ Object.keys(components).forEach((c) => {
233
+ Object.assign(componentMap, {
234
+ [c]: fixComponentProps(components[c], c, translation)
235
+ });
236
+ });
237
+ return componentMap;
238
+ };
239
+ const generateComponents = (components, translation, i18n, i18nKey) => {
240
+ if (!components) return null;
241
+ if (Array.isArray(components)) {
242
+ return generateArrayComponents(components, translation);
243
+ }
244
+ if (utils.isObject(components)) {
245
+ return generateObjectComponents(components, translation);
246
+ }
247
+ utils.warnOnce(i18n, "TRANS_INVALID_COMPONENTS", `<Trans /> "components" prop expects an object or array`, {
248
+ i18nKey
249
+ });
250
+ return null;
251
+ };
252
+ const isComponentsMap = (object) => {
253
+ if (!utils.isObject(object)) return false;
254
+ if (Array.isArray(object)) return false;
255
+ return Object.keys(object).reduce((acc, key) => acc && Number.isNaN(Number.parseFloat(key)), true);
256
+ };
257
+ function Trans({
258
+ children,
259
+ count,
260
+ parent,
261
+ i18nKey,
262
+ context,
263
+ tOptions = {},
264
+ values,
265
+ defaults: defaults$1,
266
+ components,
267
+ ns,
268
+ i18n: i18nFromProps,
269
+ t: tFromProps,
270
+ shouldUnescape,
271
+ ...additionalProps
272
+ }) {
273
+ var _a, _b, _c, _d, _e, _f;
274
+ const i18n = i18nFromProps || i18nInstance.getI18n();
275
+ if (!i18n) {
276
+ utils.warnOnce(i18n, "NO_I18NEXT_INSTANCE", `Trans: You need to pass in an i18next instance using i18nextReactModule`, {
277
+ i18nKey
278
+ });
279
+ return children;
280
+ }
281
+ const t = tFromProps || i18n.t.bind(i18n) || ((k) => k);
282
+ const reactI18nextOptions = {
283
+ ...defaults.getDefaults(),
284
+ ...(_a = i18n.options) == null ? void 0 : _a.react
285
+ };
286
+ let namespaces = ns || t.ns || ((_b = i18n.options) == null ? void 0 : _b.defaultNS);
287
+ namespaces = utils.isString(namespaces) ? [namespaces] : namespaces || ["translation"];
288
+ const nodeAsString = nodesToString(children, reactI18nextOptions, i18n, i18nKey);
289
+ const defaultValue = defaults$1 || nodeAsString || reactI18nextOptions.transEmptyNodeValue || i18nKey;
290
+ const {
291
+ hashTransKey
292
+ } = reactI18nextOptions;
293
+ const key = i18nKey || (hashTransKey ? hashTransKey(nodeAsString || defaultValue) : nodeAsString || defaultValue);
294
+ if ((_d = (_c = i18n.options) == null ? void 0 : _c.interpolation) == null ? void 0 : _d.defaultVariables) {
295
+ values = values && Object.keys(values).length > 0 ? {
296
+ ...values,
297
+ ...i18n.options.interpolation.defaultVariables
298
+ } : {
299
+ ...i18n.options.interpolation.defaultVariables
300
+ };
301
+ }
302
+ const interpolationOverride = values || count !== void 0 && !((_f = (_e = i18n.options) == null ? void 0 : _e.interpolation) == null ? void 0 : _f.alwaysFormat) || !children ? tOptions.interpolation : {
303
+ interpolation: {
304
+ ...tOptions.interpolation,
305
+ prefix: "#$?",
306
+ suffix: "?$#"
307
+ }
308
+ };
309
+ const combinedTOpts = {
310
+ ...tOptions,
311
+ context: context || tOptions.context,
312
+ count,
313
+ ...values,
314
+ ...interpolationOverride,
315
+ defaultValue,
316
+ ns: namespaces
317
+ };
318
+ const translation = key ? t(key, combinedTOpts) : defaultValue;
319
+ const generatedComponents = generateComponents(components, translation, i18n, i18nKey);
320
+ let indexedChildren = generatedComponents || children;
321
+ let componentsMap = null;
322
+ if (isComponentsMap(generatedComponents)) {
323
+ componentsMap = generatedComponents;
324
+ indexedChildren = children;
325
+ }
326
+ const content = renderNodes(indexedChildren, componentsMap, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
327
+ const useAsParent = parent ?? reactI18nextOptions.defaultTransParent;
328
+ return useAsParent ? react.createElement(useAsParent, additionalProps, content) : content;
329
+ }
330
+ exports.Trans = Trans;
331
+ exports.nodesToString = nodesToString;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const useTranslation = require("./useTranslation.cjs");
4
+ const Translation = ({
5
+ ns,
6
+ children,
7
+ ...options
8
+ }) => {
9
+ const [t, i18n, ready] = useTranslation.useTranslation(ns, options);
10
+ return children(t, {
11
+ i18n,
12
+ lng: i18n.language
13
+ }, ready);
14
+ };
15
+ exports.Translation = Translation;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const React = require("react");
4
- const I18nContext = React.createContext();
3
+ const react = require("react");
4
+ const i18nInstance = require("./i18nInstance.cjs");
5
+ const I18nContext = react.createContext();
5
6
  class ReportNamespaces {
6
7
  constructor() {
7
8
  this.usedNamespaces = {};
@@ -15,5 +16,34 @@ class ReportNamespaces {
15
16
  return Object.keys(this.usedNamespaces);
16
17
  }
17
18
  }
19
+ const composeInitialProps = (ForComponent) => async (ctx) => {
20
+ var _a;
21
+ const componentsInitialProps = await ((_a = ForComponent.getInitialProps) == null ? void 0 : _a.call(ForComponent, ctx)) ?? {};
22
+ const i18nInitialProps = getInitialProps();
23
+ return {
24
+ ...componentsInitialProps,
25
+ ...i18nInitialProps
26
+ };
27
+ };
28
+ const getInitialProps = () => {
29
+ var _a;
30
+ const i18n = i18nInstance.getI18n();
31
+ const namespaces = ((_a = i18n.reportNamespaces) == null ? void 0 : _a.getUsedNamespaces()) ?? [];
32
+ const ret = {};
33
+ const initialI18nStore = {};
34
+ i18n.languages.forEach((l) => {
35
+ initialI18nStore[l] = {};
36
+ namespaces.forEach((ns) => {
37
+ initialI18nStore[l][ns] = i18n.getResourceBundle(l, ns) || {};
38
+ });
39
+ });
40
+ ret.initialI18nStore = initialI18nStore;
41
+ ret.initialLanguage = i18n.language;
42
+ return ret;
43
+ };
44
+ exports.getI18n = i18nInstance.getI18n;
45
+ exports.setI18n = i18nInstance.setI18n;
18
46
  exports.I18nContext = I18nContext;
19
47
  exports.ReportNamespaces = ReportNamespaces;
48
+ exports.composeInitialProps = composeInitialProps;
49
+ exports.getInitialProps = getInitialProps;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const Trans = require("./Trans.cjs");
4
+ const TransWithoutContext = require("./TransWithoutContext.cjs");
5
+ const useTranslation = require("./useTranslation.cjs");
6
+ const withTranslation = require("./withTranslation.cjs");
7
+ const Translation = require("./Translation.cjs");
8
+ const I18nextProvider = require("./I18nextProvider.cjs");
9
+ const withSSR = require("./withSSR.cjs");
10
+ const useSSR = require("./useSSR.cjs");
11
+ const initReactI18next = require("./initReactI18next.cjs");
12
+ const defaults = require("./defaults.cjs");
13
+ const i18nInstance = require("./i18nInstance.cjs");
14
+ const context = require("./context.cjs");
15
+ const date = () => "";
16
+ const time = () => "";
17
+ const number = () => "";
18
+ const select = () => "";
19
+ const plural = () => "";
20
+ const selectOrdinal = () => "";
21
+ exports.Trans = Trans.Trans;
22
+ exports.TransWithoutContext = TransWithoutContext.Trans;
23
+ exports.useTranslation = useTranslation.useTranslation;
24
+ exports.withTranslation = withTranslation.withTranslation;
25
+ exports.Translation = Translation.Translation;
26
+ exports.I18nextProvider = I18nextProvider.I18nextProvider;
27
+ exports.withSSR = withSSR.withSSR;
28
+ exports.useSSR = useSSR.useSSR;
29
+ exports.initReactI18next = initReactI18next.initReactI18next;
30
+ exports.getDefaults = defaults.getDefaults;
31
+ exports.setDefaults = defaults.setDefaults;
32
+ exports.getI18n = i18nInstance.getI18n;
33
+ exports.setI18n = i18nInstance.setI18n;
34
+ exports.I18nContext = context.I18nContext;
35
+ exports.composeInitialProps = context.composeInitialProps;
36
+ exports.getInitialProps = context.getInitialProps;
37
+ exports.date = date;
38
+ exports.number = number;
39
+ exports.plural = plural;
40
+ exports.select = select;
41
+ exports.selectOrdinal = selectOrdinal;
42
+ exports.time = time;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const react = require("react");
4
+ const context = require("./context.cjs");
5
+ const i18nInstance = require("./i18nInstance.cjs");
6
+ const useSSR = (initialI18nStore, initialLanguage, props = {}) => {
7
+ var _a;
8
+ const {
9
+ i18n: i18nFromProps
10
+ } = props;
11
+ const {
12
+ i18n: i18nFromContext
13
+ } = react.useContext(context.I18nContext) || {};
14
+ const i18n = i18nFromProps || i18nFromContext || i18nInstance.getI18n();
15
+ if ((_a = i18n.options) == null ? void 0 : _a.isClone) return;
16
+ if (initialI18nStore && !i18n.initializedStoreOnce) {
17
+ i18n.services.resourceStore.data = initialI18nStore;
18
+ i18n.options.ns = Object.values(initialI18nStore).reduce((mem, lngResources) => {
19
+ Object.keys(lngResources).forEach((ns) => {
20
+ if (mem.indexOf(ns) < 0) mem.push(ns);
21
+ });
22
+ return mem;
23
+ }, i18n.options.ns);
24
+ i18n.initializedStoreOnce = true;
25
+ i18n.isInitialized = true;
26
+ }
27
+ if (initialLanguage && !i18n.initializedLanguageOnce) {
28
+ i18n.changeLanguage(initialLanguage);
29
+ i18n.initializedLanguageOnce = true;
30
+ }
31
+ };
32
+ exports.useSSR = useSSR;
@@ -1,19 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const React = require("react");
3
+ const react = require("react");
4
4
  const context = require("./context.cjs");
5
5
  const utils = require("./utils.cjs");
6
6
  const defaults = require("./defaults.cjs");
7
7
  const i18nInstance = require("./i18nInstance.cjs");
8
8
  const usePrevious = (value, ignore) => {
9
- const ref = React.useRef();
10
- React.useEffect(() => {
9
+ const ref = react.useRef();
10
+ react.useEffect(() => {
11
11
  ref.current = value;
12
12
  }, [value, ignore]);
13
13
  return ref.current;
14
14
  };
15
15
  const alwaysNewT = (i18n, language, namespace, keyPrefix) => i18n.getFixedT(language, namespace, keyPrefix);
16
- const useMemoizedT = (i18n, language, namespace, keyPrefix) => React.useCallback(alwaysNewT(i18n, language, namespace, keyPrefix), [i18n, language, namespace, keyPrefix]);
16
+ const useMemoizedT = (i18n, language, namespace, keyPrefix) => react.useCallback(alwaysNewT(i18n, language, namespace, keyPrefix), [i18n, language, namespace, keyPrefix]);
17
17
  const useTranslation = (ns, props = {}) => {
18
18
  var _a, _b, _c, _d;
19
19
  const {
@@ -22,7 +22,7 @@ const useTranslation = (ns, props = {}) => {
22
22
  const {
23
23
  i18n: i18nFromContext,
24
24
  defaultNS: defaultNSFromContext
25
- } = React.useContext(context.I18nContext) || {};
25
+ } = react.useContext(context.I18nContext) || {};
26
26
  const i18n = i18nFromProps || i18nFromContext || i18nInstance.getI18n();
27
27
  if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new context.ReportNamespaces();
28
28
  if (!i18n) {
@@ -55,12 +55,12 @@ const useTranslation = (ns, props = {}) => {
55
55
  const memoGetT = useMemoizedT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
56
56
  const getT = () => memoGetT;
57
57
  const getNewT = () => alwaysNewT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
58
- const [t, setT] = React.useState(getT);
58
+ const [t, setT] = react.useState(getT);
59
59
  let joinedNS = namespaces.join();
60
60
  if (props.lng) joinedNS = `${props.lng}${joinedNS}`;
61
61
  const previousJoinedNS = usePrevious(joinedNS);
62
- const isMounted = React.useRef(true);
63
- React.useEffect(() => {
62
+ const isMounted = react.useRef(true);
63
+ react.useEffect(() => {
64
64
  const {
65
65
  bindI18n,
66
66
  bindI18nStore
@@ -91,7 +91,7 @@ const useTranslation = (ns, props = {}) => {
91
91
  if (bindI18nStore && i18n) bindI18nStore.split(" ").forEach((e) => i18n.store.off(e, boundReset));
92
92
  };
93
93
  }, [i18n, joinedNS]);
94
- React.useEffect(() => {
94
+ react.useEffect(() => {
95
95
  if (isMounted.current && ready) {
96
96
  setT(getT);
97
97
  }
@@ -60,8 +60,10 @@ const hasLoadedNamespace = (ns, i18n, options = {}) => {
60
60
  }
61
61
  });
62
62
  };
63
+ const getDisplayName = (Component) => Component.displayName || Component.name || (isString(Component) && Component.length > 0 ? Component : "Unknown");
63
64
  const isString = (obj) => typeof obj === "string";
64
65
  const isObject = (obj) => typeof obj === "object" && obj !== null;
66
+ exports.getDisplayName = getDisplayName;
65
67
  exports.hasLoadedNamespace = hasLoadedNamespace;
66
68
  exports.isObject = isObject;
67
69
  exports.isString = isString;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const react = require("react");
4
+ const useSSR = require("./useSSR.cjs");
5
+ const context = require("./context.cjs");
6
+ const utils = require("./utils.cjs");
7
+ const withSSR = () => function Extend(WrappedComponent) {
8
+ function I18nextWithSSR({
9
+ initialI18nStore,
10
+ initialLanguage,
11
+ ...rest
12
+ }) {
13
+ useSSR.useSSR(initialI18nStore, initialLanguage);
14
+ return react.createElement(WrappedComponent, {
15
+ ...rest
16
+ });
17
+ }
18
+ I18nextWithSSR.getInitialProps = context.composeInitialProps(WrappedComponent);
19
+ I18nextWithSSR.displayName = `withI18nextSSR(${utils.getDisplayName(WrappedComponent)})`;
20
+ I18nextWithSSR.WrappedComponent = WrappedComponent;
21
+ return I18nextWithSSR;
22
+ };
23
+ exports.withSSR = withSSR;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const react = require("react");
4
+ const useTranslation = require("./useTranslation.cjs");
5
+ const utils = require("./utils.cjs");
6
+ const withTranslation = (ns, options = {}) => function Extend(WrappedComponent) {
7
+ function I18nextWithTranslation({
8
+ forwardedRef,
9
+ ...rest
10
+ }) {
11
+ const [t, i18n, ready] = useTranslation.useTranslation(ns, {
12
+ ...rest,
13
+ keyPrefix: options.keyPrefix
14
+ });
15
+ const passDownProps = {
16
+ ...rest,
17
+ t,
18
+ i18n,
19
+ tReady: ready
20
+ };
21
+ if (options.withRef && forwardedRef) {
22
+ passDownProps.ref = forwardedRef;
23
+ } else if (!options.withRef && forwardedRef) {
24
+ passDownProps.forwardedRef = forwardedRef;
25
+ }
26
+ return react.createElement(WrappedComponent, passDownProps);
27
+ }
28
+ I18nextWithTranslation.displayName = `withI18nextTranslation(${utils.getDisplayName(WrappedComponent)})`;
29
+ I18nextWithTranslation.WrappedComponent = WrappedComponent;
30
+ const forwardRef = (props, ref) => react.createElement(I18nextWithTranslation, Object.assign({}, props, {
31
+ forwardedRef: ref
32
+ }));
33
+ return options.withRef ? react.forwardRef(forwardRef) : I18nextWithTranslation;
34
+ };
35
+ exports.withTranslation = withTranslation;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../../../../core/cjs/_virtual/index4.cjs");
3
+ const index = require("../../../../core/cjs/_virtual/index7.cjs");
4
4
  var hasRequiredToposort;
5
5
  function requireToposort() {
6
6
  if (hasRequiredToposort) return index.__module.exports;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ var voidElements;
4
+ var hasRequiredVoidElements;
5
+ function requireVoidElements() {
6
+ if (hasRequiredVoidElements) return voidElements;
7
+ hasRequiredVoidElements = 1;
8
+ voidElements = {
9
+ "area": true,
10
+ "base": true,
11
+ "br": true,
12
+ "col": true,
13
+ "embed": true,
14
+ "hr": true,
15
+ "img": true,
16
+ "input": true,
17
+ "link": true,
18
+ "meta": true,
19
+ "param": true,
20
+ "source": true,
21
+ "track": true,
22
+ "wbr": true
23
+ };
24
+ return voidElements;
25
+ }
26
+ exports.__require = requireVoidElements;