react-intlayer 6.1.6 → 7.0.0-canary.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. package/dist/cjs/IntlayerNode.cjs +17 -46
  2. package/dist/cjs/IntlayerNode.cjs.map +1 -1
  3. package/dist/cjs/UI/ContentSelector.cjs +96 -128
  4. package/dist/cjs/UI/ContentSelector.cjs.map +1 -1
  5. package/dist/cjs/_virtual/rolldown_runtime.cjs +25 -0
  6. package/dist/cjs/client/IntlayerProvider.cjs +64 -93
  7. package/dist/cjs/client/IntlayerProvider.cjs.map +1 -1
  8. package/dist/cjs/client/format/index.cjs +17 -50
  9. package/dist/cjs/client/format/useCompact.cjs +29 -39
  10. package/dist/cjs/client/format/useCompact.cjs.map +1 -1
  11. package/dist/cjs/client/format/useCurrency.cjs +43 -39
  12. package/dist/cjs/client/format/useCurrency.cjs.map +1 -1
  13. package/dist/cjs/client/format/useDate.cjs +45 -36
  14. package/dist/cjs/client/format/useDate.cjs.map +1 -1
  15. package/dist/cjs/client/format/useList.cjs +40 -39
  16. package/dist/cjs/client/format/useList.cjs.map +1 -1
  17. package/dist/cjs/client/format/useNumber.cjs +41 -39
  18. package/dist/cjs/client/format/useNumber.cjs.map +1 -1
  19. package/dist/cjs/client/format/usePercentage.cjs +37 -39
  20. package/dist/cjs/client/format/usePercentage.cjs.map +1 -1
  21. package/dist/cjs/client/format/useRelativeTime.cjs +37 -39
  22. package/dist/cjs/client/format/useRelativeTime.cjs.map +1 -1
  23. package/dist/cjs/client/format/useUnit.cjs +36 -39
  24. package/dist/cjs/client/format/useUnit.cjs.map +1 -1
  25. package/dist/cjs/client/index.cjs +31 -72
  26. package/dist/cjs/client/t.cjs +21 -34
  27. package/dist/cjs/client/t.cjs.map +1 -1
  28. package/dist/cjs/client/useDictionary.cjs +26 -36
  29. package/dist/cjs/client/useDictionary.cjs.map +1 -1
  30. package/dist/cjs/client/useDictionaryAsync.cjs +23 -52
  31. package/dist/cjs/client/useDictionaryAsync.cjs.map +1 -1
  32. package/dist/cjs/client/useDictionaryDynamic.cjs +24 -53
  33. package/dist/cjs/client/useDictionaryDynamic.cjs.map +1 -1
  34. package/dist/cjs/client/useI18n.cjs +45 -55
  35. package/dist/cjs/client/useI18n.cjs.map +1 -1
  36. package/dist/cjs/client/useIntlayer.cjs +28 -36
  37. package/dist/cjs/client/useIntlayer.cjs.map +1 -1
  38. package/dist/cjs/client/useLoadDynamic.cjs +21 -50
  39. package/dist/cjs/client/useLoadDynamic.cjs.map +1 -1
  40. package/dist/cjs/client/useLocale.cjs +39 -70
  41. package/dist/cjs/client/useLocale.cjs.map +1 -1
  42. package/dist/cjs/client/useLocaleBase.cjs +25 -53
  43. package/dist/cjs/client/useLocaleBase.cjs.map +1 -1
  44. package/dist/cjs/client/useLocaleStorage.cjs +63 -0
  45. package/dist/cjs/client/useLocaleStorage.cjs.map +1 -0
  46. package/dist/cjs/client/useTraduction.cjs +34 -35
  47. package/dist/cjs/client/useTraduction.cjs.map +1 -1
  48. package/dist/cjs/editor/ContentSelectorWrapper.cjs +55 -91
  49. package/dist/cjs/editor/ContentSelectorWrapper.cjs.map +1 -1
  50. package/dist/cjs/editor/IntlayerEditorProvider.cjs +45 -92
  51. package/dist/cjs/editor/IntlayerEditorProvider.cjs.map +1 -1
  52. package/dist/cjs/editor/index.cjs +3 -23
  53. package/dist/cjs/editor/useEditedContentRenderer.cjs +40 -59
  54. package/dist/cjs/editor/useEditedContentRenderer.cjs.map +1 -1
  55. package/dist/cjs/getDictionary.cjs +15 -40
  56. package/dist/cjs/getDictionary.cjs.map +1 -1
  57. package/dist/cjs/getIntlayer.cjs +15 -36
  58. package/dist/cjs/getIntlayer.cjs.map +1 -1
  59. package/dist/cjs/index.cjs +33 -75
  60. package/dist/cjs/markdown/MarkdownProvider.cjs +19 -39
  61. package/dist/cjs/markdown/MarkdownProvider.cjs.map +1 -1
  62. package/dist/cjs/markdown/MarkdownRenderer.cjs +39 -80
  63. package/dist/cjs/markdown/MarkdownRenderer.cjs.map +1 -1
  64. package/dist/cjs/markdown/index.cjs +7 -25
  65. package/dist/cjs/plugins.cjs +92 -119
  66. package/dist/cjs/plugins.cjs.map +1 -1
  67. package/dist/cjs/reactElement/renderReactElement.cjs +39 -59
  68. package/dist/cjs/reactElement/renderReactElement.cjs.map +1 -1
  69. package/dist/cjs/server/IntlayerServerProvider.cjs +33 -53
  70. package/dist/cjs/server/IntlayerServerProvider.cjs.map +1 -1
  71. package/dist/cjs/server/format/index.cjs +17 -50
  72. package/dist/cjs/server/format/useCompact.cjs +25 -35
  73. package/dist/cjs/server/format/useCompact.cjs.map +1 -1
  74. package/dist/cjs/server/format/useCurrency.cjs +36 -35
  75. package/dist/cjs/server/format/useCurrency.cjs.map +1 -1
  76. package/dist/cjs/server/format/useDate.cjs +41 -35
  77. package/dist/cjs/server/format/useDate.cjs.map +1 -1
  78. package/dist/cjs/server/format/useList.cjs +33 -35
  79. package/dist/cjs/server/format/useList.cjs.map +1 -1
  80. package/dist/cjs/server/format/useNumber.cjs +37 -35
  81. package/dist/cjs/server/format/useNumber.cjs.map +1 -1
  82. package/dist/cjs/server/format/usePercentage.cjs +33 -35
  83. package/dist/cjs/server/format/usePercentage.cjs.map +1 -1
  84. package/dist/cjs/server/format/useRelativeTime.cjs +33 -35
  85. package/dist/cjs/server/format/useRelativeTime.cjs.map +1 -1
  86. package/dist/cjs/server/format/useUnit.cjs +32 -35
  87. package/dist/cjs/server/format/useUnit.cjs.map +1 -1
  88. package/dist/cjs/server/index.cjs +21 -57
  89. package/dist/cjs/server/serverContext.cjs +40 -71
  90. package/dist/cjs/server/serverContext.cjs.map +1 -1
  91. package/dist/cjs/server/t.cjs +33 -33
  92. package/dist/cjs/server/t.cjs.map +1 -1
  93. package/dist/cjs/server/useDictionary.cjs +14 -32
  94. package/dist/cjs/server/useDictionary.cjs.map +1 -1
  95. package/dist/cjs/server/useDictionaryAsync.cjs +18 -44
  96. package/dist/cjs/server/useDictionaryAsync.cjs.map +1 -1
  97. package/dist/cjs/server/useDictionaryDynamic.cjs +19 -48
  98. package/dist/cjs/server/useDictionaryDynamic.cjs.map +1 -1
  99. package/dist/cjs/server/useI18n.cjs +35 -47
  100. package/dist/cjs/server/useI18n.cjs.map +1 -1
  101. package/dist/cjs/server/useIntlayer.cjs +14 -32
  102. package/dist/cjs/server/useIntlayer.cjs.map +1 -1
  103. package/dist/cjs/server/useLoadDynamic.cjs +11 -41
  104. package/dist/cjs/server/useLoadDynamic.cjs.map +1 -1
  105. package/dist/cjs/server/useLocale.cjs +21 -43
  106. package/dist/cjs/server/useLocale.cjs.map +1 -1
  107. package/dist/esm/IntlayerNode.mjs +13 -23
  108. package/dist/esm/IntlayerNode.mjs.map +1 -1
  109. package/dist/esm/UI/ContentSelector.mjs +92 -108
  110. package/dist/esm/UI/ContentSelector.mjs.map +1 -1
  111. package/dist/esm/client/IntlayerProvider.mjs +49 -53
  112. package/dist/esm/client/IntlayerProvider.mjs.map +1 -1
  113. package/dist/esm/client/format/index.mjs +2 -11
  114. package/dist/esm/client/format/useCompact.mjs +25 -14
  115. package/dist/esm/client/format/useCompact.mjs.map +1 -1
  116. package/dist/esm/client/format/useCurrency.mjs +39 -14
  117. package/dist/esm/client/format/useCurrency.mjs.map +1 -1
  118. package/dist/esm/client/format/useDate.mjs +41 -11
  119. package/dist/esm/client/format/useDate.mjs.map +1 -1
  120. package/dist/esm/client/format/useList.mjs +36 -14
  121. package/dist/esm/client/format/useList.mjs.map +1 -1
  122. package/dist/esm/client/format/useNumber.mjs +37 -14
  123. package/dist/esm/client/format/useNumber.mjs.map +1 -1
  124. package/dist/esm/client/format/usePercentage.mjs +33 -14
  125. package/dist/esm/client/format/usePercentage.mjs.map +1 -1
  126. package/dist/esm/client/format/useRelativeTime.mjs +33 -14
  127. package/dist/esm/client/format/useRelativeTime.mjs.map +1 -1
  128. package/dist/esm/client/format/useUnit.mjs +32 -14
  129. package/dist/esm/client/format/useUnit.mjs.map +1 -1
  130. package/dist/esm/client/index.mjs +5 -33
  131. package/dist/esm/client/t.mjs +17 -9
  132. package/dist/esm/client/t.mjs.map +1 -1
  133. package/dist/esm/client/useDictionary.mjs +23 -11
  134. package/dist/esm/client/useDictionary.mjs.map +1 -1
  135. package/dist/esm/client/useDictionaryAsync.mjs +18 -16
  136. package/dist/esm/client/useDictionaryAsync.mjs.map +1 -1
  137. package/dist/esm/client/useDictionaryDynamic.mjs +18 -16
  138. package/dist/esm/client/useDictionaryDynamic.mjs.map +1 -1
  139. package/dist/esm/client/useI18n.mjs +41 -30
  140. package/dist/esm/client/useI18n.mjs.map +1 -1
  141. package/dist/esm/client/useIntlayer.mjs +25 -11
  142. package/dist/esm/client/useIntlayer.mjs.map +1 -1
  143. package/dist/esm/client/useLoadDynamic.mjs +20 -26
  144. package/dist/esm/client/useLoadDynamic.mjs.map +1 -1
  145. package/dist/esm/client/useLocale.mjs +35 -35
  146. package/dist/esm/client/useLocale.mjs.map +1 -1
  147. package/dist/esm/client/useLocaleBase.mjs +20 -17
  148. package/dist/esm/client/useLocaleBase.mjs.map +1 -1
  149. package/dist/esm/client/useLocaleStorage.mjs +55 -0
  150. package/dist/esm/client/useLocaleStorage.mjs.map +1 -0
  151. package/dist/esm/client/useTraduction.mjs +30 -10
  152. package/dist/esm/client/useTraduction.mjs.map +1 -1
  153. package/dist/esm/editor/ContentSelectorWrapper.mjs +48 -70
  154. package/dist/esm/editor/ContentSelectorWrapper.mjs.map +1 -1
  155. package/dist/esm/editor/IntlayerEditorProvider.mjs +39 -61
  156. package/dist/esm/editor/IntlayerEditorProvider.mjs.map +1 -1
  157. package/dist/esm/editor/index.mjs +3 -2
  158. package/dist/esm/editor/useEditedContentRenderer.mjs +33 -32
  159. package/dist/esm/editor/useEditedContentRenderer.mjs.map +1 -1
  160. package/dist/esm/getDictionary.mjs +13 -22
  161. package/dist/esm/getDictionary.mjs.map +1 -1
  162. package/dist/esm/getIntlayer.mjs +13 -18
  163. package/dist/esm/getIntlayer.mjs.map +1 -1
  164. package/dist/esm/index.mjs +6 -35
  165. package/dist/esm/markdown/MarkdownProvider.mjs +14 -16
  166. package/dist/esm/markdown/MarkdownProvider.mjs.map +1 -1
  167. package/dist/esm/markdown/MarkdownRenderer.mjs +34 -57
  168. package/dist/esm/markdown/MarkdownRenderer.mjs.map +1 -1
  169. package/dist/esm/markdown/index.mjs +4 -3
  170. package/dist/esm/plugins.mjs +82 -92
  171. package/dist/esm/plugins.mjs.map +1 -1
  172. package/dist/esm/reactElement/renderReactElement.mjs +36 -34
  173. package/dist/esm/reactElement/renderReactElement.mjs.map +1 -1
  174. package/dist/esm/server/IntlayerServerProvider.mjs +22 -11
  175. package/dist/esm/server/IntlayerServerProvider.mjs.map +1 -1
  176. package/dist/esm/server/format/index.mjs +2 -11
  177. package/dist/esm/server/format/useCompact.mjs +22 -10
  178. package/dist/esm/server/format/useCompact.mjs.map +1 -1
  179. package/dist/esm/server/format/useCurrency.mjs +33 -10
  180. package/dist/esm/server/format/useCurrency.mjs.map +1 -1
  181. package/dist/esm/server/format/useDate.mjs +38 -10
  182. package/dist/esm/server/format/useDate.mjs.map +1 -1
  183. package/dist/esm/server/format/useList.mjs +30 -10
  184. package/dist/esm/server/format/useList.mjs.map +1 -1
  185. package/dist/esm/server/format/useNumber.mjs +34 -10
  186. package/dist/esm/server/format/useNumber.mjs.map +1 -1
  187. package/dist/esm/server/format/usePercentage.mjs +30 -10
  188. package/dist/esm/server/format/usePercentage.mjs.map +1 -1
  189. package/dist/esm/server/format/useRelativeTime.mjs +30 -10
  190. package/dist/esm/server/format/useRelativeTime.mjs.map +1 -1
  191. package/dist/esm/server/format/useUnit.mjs +29 -10
  192. package/dist/esm/server/format/useUnit.mjs.map +1 -1
  193. package/dist/esm/server/index.mjs +4 -20
  194. package/dist/esm/server/serverContext.mjs +36 -35
  195. package/dist/esm/server/serverContext.mjs.map +1 -1
  196. package/dist/esm/server/t.mjs +30 -8
  197. package/dist/esm/server/t.mjs.map +1 -1
  198. package/dist/esm/server/useDictionary.mjs +12 -6
  199. package/dist/esm/server/useDictionary.mjs.map +1 -1
  200. package/dist/esm/server/useDictionaryAsync.mjs +14 -8
  201. package/dist/esm/server/useDictionaryAsync.mjs.map +1 -1
  202. package/dist/esm/server/useDictionaryDynamic.mjs +14 -11
  203. package/dist/esm/server/useDictionaryDynamic.mjs.map +1 -1
  204. package/dist/esm/server/useI18n.mjs +33 -21
  205. package/dist/esm/server/useI18n.mjs.map +1 -1
  206. package/dist/esm/server/useIntlayer.mjs +12 -6
  207. package/dist/esm/server/useIntlayer.mjs.map +1 -1
  208. package/dist/esm/server/useLoadDynamic.mjs +8 -6
  209. package/dist/esm/server/useLoadDynamic.mjs.map +1 -1
  210. package/dist/esm/server/useLocale.mjs +18 -8
  211. package/dist/esm/server/useLocale.mjs.map +1 -1
  212. package/dist/types/IntlayerNode.d.ts +19 -12
  213. package/dist/types/IntlayerNode.d.ts.map +1 -1
  214. package/dist/types/UI/ContentSelector.d.ts +12 -9
  215. package/dist/types/UI/ContentSelector.d.ts.map +1 -1
  216. package/dist/types/client/IntlayerProvider.d.ts +21 -15
  217. package/dist/types/client/IntlayerProvider.d.ts.map +1 -1
  218. package/dist/types/client/format/index.d.ts +9 -9
  219. package/dist/types/client/format/useCompact.d.ts +8 -2
  220. package/dist/types/client/format/useCompact.d.ts.map +1 -1
  221. package/dist/types/client/format/useCurrency.d.ts +8 -2
  222. package/dist/types/client/format/useCurrency.d.ts.map +1 -1
  223. package/dist/types/client/format/useDate.d.ts +7 -2
  224. package/dist/types/client/format/useDate.d.ts.map +1 -1
  225. package/dist/types/client/format/useList.d.ts +8 -2
  226. package/dist/types/client/format/useList.d.ts.map +1 -1
  227. package/dist/types/client/format/useNumber.d.ts +8 -2
  228. package/dist/types/client/format/useNumber.d.ts.map +1 -1
  229. package/dist/types/client/format/usePercentage.d.ts +8 -2
  230. package/dist/types/client/format/usePercentage.d.ts.map +1 -1
  231. package/dist/types/client/format/useRelativeTime.d.ts +9 -3
  232. package/dist/types/client/format/useRelativeTime.d.ts.map +1 -1
  233. package/dist/types/client/format/useUnit.d.ts +8 -2
  234. package/dist/types/client/format/useUnit.d.ts.map +1 -1
  235. package/dist/types/client/index.d.ts +12 -19
  236. package/dist/types/client/t.d.ts +7 -3
  237. package/dist/types/client/t.d.ts.map +1 -1
  238. package/dist/types/client/useDictionary.d.ts +9 -3
  239. package/dist/types/client/useDictionary.d.ts.map +1 -1
  240. package/dist/types/client/useDictionaryAsync.d.ts +7 -3
  241. package/dist/types/client/useDictionaryAsync.d.ts.map +1 -1
  242. package/dist/types/client/useDictionaryDynamic.d.ts +9 -3
  243. package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
  244. package/dist/types/client/useI18n.d.ts +9 -5
  245. package/dist/types/client/useI18n.d.ts.map +1 -1
  246. package/dist/types/client/useIntlayer.d.ts +10 -5
  247. package/dist/types/client/useIntlayer.d.ts.map +1 -1
  248. package/dist/types/client/useLoadDynamic.d.ts +4 -1
  249. package/dist/types/client/useLoadDynamic.d.ts.map +1 -1
  250. package/dist/types/client/useLocale.d.ts +18 -10
  251. package/dist/types/client/useLocale.d.ts.map +1 -1
  252. package/dist/types/client/useLocaleBase.d.ts +10 -5
  253. package/dist/types/client/useLocaleBase.d.ts.map +1 -1
  254. package/dist/types/client/useLocaleStorage.d.ts +49 -0
  255. package/dist/types/client/useLocaleStorage.d.ts.map +1 -0
  256. package/dist/types/client/useTraduction.d.ts +7 -2
  257. package/dist/types/client/useTraduction.d.ts.map +1 -1
  258. package/dist/types/editor/ContentSelectorWrapper.d.ts +8 -4
  259. package/dist/types/editor/ContentSelectorWrapper.d.ts.map +1 -1
  260. package/dist/types/editor/IntlayerEditorProvider.d.ts +6 -2
  261. package/dist/types/editor/IntlayerEditorProvider.d.ts.map +1 -1
  262. package/dist/types/editor/index.d.ts +2 -2
  263. package/dist/types/editor/useEditedContentRenderer.d.ts +16 -10
  264. package/dist/types/editor/useEditedContentRenderer.d.ts.map +1 -1
  265. package/dist/types/getDictionary.d.ts +8 -4
  266. package/dist/types/getDictionary.d.ts.map +1 -1
  267. package/dist/types/getIntlayer.d.ts +8 -4
  268. package/dist/types/getIntlayer.d.ts.map +1 -1
  269. package/dist/types/index.d.ts +19 -17
  270. package/dist/types/index.d.ts.map +1 -1
  271. package/dist/types/markdown/MarkdownProvider.d.ts +8 -5
  272. package/dist/types/markdown/MarkdownProvider.d.ts.map +1 -1
  273. package/dist/types/markdown/MarkdownRenderer.d.ts +13 -11
  274. package/dist/types/markdown/MarkdownRenderer.d.ts.map +1 -1
  275. package/dist/types/markdown/index.d.ts +3 -3
  276. package/dist/types/plugins.d.ts +33 -27
  277. package/dist/types/plugins.d.ts.map +1 -1
  278. package/dist/types/reactElement/renderReactElement.d.ts +7 -2
  279. package/dist/types/reactElement/renderReactElement.d.ts.map +1 -1
  280. package/dist/types/server/IntlayerServerProvider.d.ts +25 -19
  281. package/dist/types/server/IntlayerServerProvider.d.ts.map +1 -1
  282. package/dist/types/server/format/index.d.ts +9 -9
  283. package/dist/types/server/format/useCompact.d.ts +7 -2
  284. package/dist/types/server/format/useCompact.d.ts.map +1 -1
  285. package/dist/types/server/format/useCurrency.d.ts +7 -2
  286. package/dist/types/server/format/useCurrency.d.ts.map +1 -1
  287. package/dist/types/server/format/useDate.d.ts +7 -2
  288. package/dist/types/server/format/useDate.d.ts.map +1 -1
  289. package/dist/types/server/format/useList.d.ts +7 -2
  290. package/dist/types/server/format/useList.d.ts.map +1 -1
  291. package/dist/types/server/format/useNumber.d.ts +7 -2
  292. package/dist/types/server/format/useNumber.d.ts.map +1 -1
  293. package/dist/types/server/format/usePercentage.d.ts +7 -2
  294. package/dist/types/server/format/usePercentage.d.ts.map +1 -1
  295. package/dist/types/server/format/useRelativeTime.d.ts +7 -2
  296. package/dist/types/server/format/useRelativeTime.d.ts.map +1 -1
  297. package/dist/types/server/format/useUnit.d.ts +7 -2
  298. package/dist/types/server/format/useUnit.d.ts.map +1 -1
  299. package/dist/types/server/index.d.ts +10 -10
  300. package/dist/types/server/serverContext.d.ts +23 -27
  301. package/dist/types/server/serverContext.d.ts.map +1 -1
  302. package/dist/types/server/t.d.ts +7 -3
  303. package/dist/types/server/t.d.ts.map +1 -1
  304. package/dist/types/server/useDictionary.d.ts +9 -3
  305. package/dist/types/server/useDictionary.d.ts.map +1 -1
  306. package/dist/types/server/useDictionaryAsync.d.ts +9 -3
  307. package/dist/types/server/useDictionaryAsync.d.ts.map +1 -1
  308. package/dist/types/server/useDictionaryDynamic.d.ts +9 -3
  309. package/dist/types/server/useDictionaryDynamic.d.ts.map +1 -1
  310. package/dist/types/server/useI18n.d.ts +9 -5
  311. package/dist/types/server/useI18n.d.ts.map +1 -1
  312. package/dist/types/server/useIntlayer.d.ts +9 -3
  313. package/dist/types/server/useIntlayer.d.ts.map +1 -1
  314. package/dist/types/server/useLoadDynamic.d.ts +4 -1
  315. package/dist/types/server/useLoadDynamic.d.ts.map +1 -1
  316. package/dist/types/server/useLocale.d.ts +11 -4
  317. package/dist/types/server/useLocale.d.ts.map +1 -1
  318. package/package.json +43 -49
  319. package/LICENSE +0 -202
  320. package/dist/cjs/client/format/index.cjs.map +0 -1
  321. package/dist/cjs/client/getBrowserLocale.cjs +0 -173
  322. package/dist/cjs/client/getBrowserLocale.cjs.map +0 -1
  323. package/dist/cjs/client/index.cjs.map +0 -1
  324. package/dist/cjs/client/useLocaleCookie.cjs +0 -60
  325. package/dist/cjs/client/useLocaleCookie.cjs.map +0 -1
  326. package/dist/cjs/editor/index.cjs.map +0 -1
  327. package/dist/cjs/index.cjs.map +0 -1
  328. package/dist/cjs/markdown/index.cjs.map +0 -1
  329. package/dist/cjs/server/format/index.cjs.map +0 -1
  330. package/dist/cjs/server/index.cjs.map +0 -1
  331. package/dist/esm/client/format/index.mjs.map +0 -1
  332. package/dist/esm/client/getBrowserLocale.mjs +0 -138
  333. package/dist/esm/client/getBrowserLocale.mjs.map +0 -1
  334. package/dist/esm/client/index.mjs.map +0 -1
  335. package/dist/esm/client/useLocaleCookie.mjs +0 -24
  336. package/dist/esm/client/useLocaleCookie.mjs.map +0 -1
  337. package/dist/esm/editor/index.mjs.map +0 -1
  338. package/dist/esm/index.mjs.map +0 -1
  339. package/dist/esm/markdown/index.mjs.map +0 -1
  340. package/dist/esm/server/format/index.mjs.map +0 -1
  341. package/dist/esm/server/index.mjs.map +0 -1
  342. package/dist/types/client/format/index.d.ts.map +0 -1
  343. package/dist/types/client/getBrowserLocale.d.ts +0 -25
  344. package/dist/types/client/getBrowserLocale.d.ts.map +0 -1
  345. package/dist/types/client/index.d.ts.map +0 -1
  346. package/dist/types/client/useLocaleCookie.d.ts +0 -17
  347. package/dist/types/client/useLocaleCookie.d.ts.map +0 -1
  348. package/dist/types/editor/index.d.ts.map +0 -1
  349. package/dist/types/markdown/index.d.ts.map +0 -1
  350. package/dist/types/server/format/index.d.ts.map +0 -1
  351. package/dist/types/server/index.d.ts.map +0 -1
@@ -1,12 +1,34 @@
1
- import { getTranslation } from "@intlayer/core";
2
- import { IntlayerServerContext } from "./IntlayerServerProvider.mjs";
3
1
  import { getServerContext } from "./serverContext.mjs";
2
+ import { IntlayerServerContext } from "./IntlayerServerProvider.mjs";
3
+ import { getTranslation } from "@intlayer/core";
4
+
5
+ //#region src/server/t.ts
6
+ /**
7
+ * On the server side, hook to get the translation content based on the locale
8
+ *
9
+ * If not locale found, it will return the content related to the default locale.
10
+ *
11
+ * Return either the content editor, or the content itself depending on the configuration.
12
+ *
13
+ * Usage:
14
+ *
15
+ * ```ts
16
+ * const content = t<string>({
17
+ * en: 'Hello',
18
+ * fr: 'Bonjour',
19
+ * }, 'fr');
20
+ * // 'Bonjour'
21
+ * ```
22
+ *
23
+ * Using TypeScript:
24
+ * - this function will require each locale to be defined if defined in the project configuration.
25
+ * - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.
26
+ */
4
27
  const t = (multilangContent, locale) => {
5
- const currentLocale = getServerContext(IntlayerServerContext);
6
- const localeTarget = locale ?? currentLocale;
7
- return getTranslation(multilangContent, localeTarget);
8
- };
9
- export {
10
- t
28
+ const currentLocale = getServerContext(IntlayerServerContext);
29
+ return getTranslation(multilangContent, locale ?? currentLocale);
11
30
  };
31
+
32
+ //#endregion
33
+ export { t };
12
34
  //# sourceMappingURL=t.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/server/t.ts"],"sourcesContent":["import type { LocalesValues } from '@intlayer/config/client';\nimport { type LanguageContent, getTranslation } from '@intlayer/core';\nimport { IntlayerServerContext } from './IntlayerServerProvider';\nimport { getServerContext } from './serverContext';\n\n/**\n * On the server side, hook to get the translation content based on the locale\n *\n * If not locale found, it will return the content related to the default locale.\n *\n * Return either the content editor, or the content itself depending on the configuration.\n *\n * Usage:\n *\n * ```ts\n * const content = t<string>({\n * en: 'Hello',\n * fr: 'Bonjour',\n * }, 'fr');\n * // 'Bonjour'\n * ```\n *\n * Using TypeScript:\n * - this function will require each locale to be defined if defined in the project configuration.\n * - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.\n */\nexport const t = <Content = string>(\n multilangContent: LanguageContent<Content>,\n locale?: LocalesValues\n) => {\n const currentLocale = getServerContext<LocalesValues>(IntlayerServerContext);\n const localeTarget = locale ?? currentLocale;\n\n return getTranslation<Content>(multilangContent, localeTarget);\n};\n"],"mappings":"AACA,SAA+B,sBAAsB;AACrD,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AAuB1B,MAAM,IAAI,CACf,kBACA,WACG;AACH,QAAM,gBAAgB,iBAAgC,qBAAqB;AAC3E,QAAM,eAAe,UAAU;AAE/B,SAAO,eAAwB,kBAAkB,YAAY;AAC/D;","names":[]}
1
+ {"version":3,"file":"t.mjs","names":[],"sources":["../../../src/server/t.ts"],"sourcesContent":["import { getTranslation } from '@intlayer/core';\nimport type { LocalesValues, StrictModeLocaleMap } from '@intlayer/types';\nimport { IntlayerServerContext } from './IntlayerServerProvider';\nimport { getServerContext } from './serverContext';\n\n/**\n * On the server side, hook to get the translation content based on the locale\n *\n * If not locale found, it will return the content related to the default locale.\n *\n * Return either the content editor, or the content itself depending on the configuration.\n *\n * Usage:\n *\n * ```ts\n * const content = t<string>({\n * en: 'Hello',\n * fr: 'Bonjour',\n * }, 'fr');\n * // 'Bonjour'\n * ```\n *\n * Using TypeScript:\n * - this function will require each locale to be defined if defined in the project configuration.\n * - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.\n */\nexport const t = <Content = string>(\n multilangContent: StrictModeLocaleMap<Content>,\n locale?: LocalesValues\n) => {\n const currentLocale = getServerContext<LocalesValues>(IntlayerServerContext);\n const localeTarget = locale ?? currentLocale;\n\n return getTranslation<Content>(multilangContent, localeTarget);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,KACX,kBACA,WACG;CACH,MAAM,gBAAgB,iBAAgC,sBAAsB;AAG5E,QAAO,eAAwB,kBAFV,UAAU,cAE+B"}
@@ -1,11 +1,17 @@
1
1
  import { getDictionary } from "../getDictionary.mjs";
2
- import { IntlayerServerContext } from "./IntlayerServerProvider.mjs";
3
2
  import { getServerContext } from "./serverContext.mjs";
3
+ import { IntlayerServerContext } from "./IntlayerServerProvider.mjs";
4
+
5
+ //#region src/server/useDictionary.ts
6
+ /**
7
+ * On the server side, Hook that transform a dictionary and return the content
8
+ *
9
+ * If the locale is not provided, it will use the locale from the server context
10
+ */
4
11
  const useDictionary = (dictionary, locale) => {
5
- const localeTarget = locale ?? getServerContext(IntlayerServerContext);
6
- return getDictionary(dictionary, localeTarget);
7
- };
8
- export {
9
- useDictionary
12
+ return getDictionary(dictionary, locale ?? getServerContext(IntlayerServerContext));
10
13
  };
14
+
15
+ //#endregion
16
+ export { useDictionary };
11
17
  //# sourceMappingURL=useDictionary.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/server/useDictionary.ts"],"sourcesContent":["import type { LocalesValues } from '@intlayer/config/client';\nimport { type Dictionary } from '@intlayer/core';\nimport { getDictionary } from '../getDictionary';\nimport { IntlayerServerContext } from './IntlayerServerProvider';\nimport { getServerContext } from './serverContext';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the server context\n */\nexport const useDictionary = <T extends Dictionary>(\n dictionary: T,\n locale?: LocalesValues\n) => {\n const localeTarget =\n locale ?? getServerContext<LocalesValues>(IntlayerServerContext);\n\n return getDictionary<T, LocalesValues>(dictionary, localeTarget);\n};\n"],"mappings":"AAEA,SAAS,qBAAqB;AAC9B,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AAO1B,MAAM,gBAAgB,CAC3B,YACA,WACG;AACH,QAAM,eACJ,UAAU,iBAAgC,qBAAqB;AAEjE,SAAO,cAAgC,YAAY,YAAY;AACjE;","names":[]}
1
+ {"version":3,"file":"useDictionary.mjs","names":[],"sources":["../../../src/server/useDictionary.ts"],"sourcesContent":["import type {\n DeclaredLocales,\n Dictionary,\n LocalesValues,\n} from '@intlayer/types';\nimport { getDictionary } from '../getDictionary';\nimport { IntlayerServerContext } from './IntlayerServerProvider';\nimport { getServerContext } from './serverContext';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the server context\n */\nexport const useDictionary = <\n T extends Dictionary,\n L extends LocalesValues = DeclaredLocales,\n>(\n dictionary: T,\n locale?: L\n) => {\n const localeTarget =\n locale ?? getServerContext<LocalesValues>(IntlayerServerContext);\n\n return getDictionary<T, L>(dictionary, localeTarget as L);\n};\n"],"mappings":";;;;;;;;;;AAcA,MAAa,iBAIX,YACA,WACG;AAIH,QAAO,cAAoB,YAFzB,UAAU,iBAAgC,sBAAsB,CAET"}
@@ -1,13 +1,19 @@
1
- import configuration from "@intlayer/config/built";
2
- import { IntlayerServerContext } from "./IntlayerServerProvider.mjs";
3
1
  import { getServerContext } from "./serverContext.mjs";
2
+ import { IntlayerServerContext } from "./IntlayerServerProvider.mjs";
4
3
  import { useDictionary } from "./useDictionary.mjs";
4
+ import configuration from "@intlayer/config/built";
5
+
6
+ //#region src/server/useDictionaryAsync.ts
7
+ /**
8
+ * On the server side, Hook that transform a dictionary and return the content
9
+ *
10
+ * If the locale is not provided, it will use the locale from the server context
11
+ */
5
12
  const useDictionaryAsync = async (dictionaryPromise, locale) => {
6
- const localeTarget = locale ?? getServerContext(IntlayerServerContext) ?? configuration?.internationalization.defaultLocale;
7
- const dictionary = await dictionaryPromise[localeTarget]();
8
- return useDictionary(dictionary, localeTarget);
9
- };
10
- export {
11
- useDictionaryAsync
13
+ const localeTarget = locale ?? getServerContext(IntlayerServerContext) ?? configuration?.internationalization.defaultLocale;
14
+ return useDictionary(await dictionaryPromise[localeTarget]?.(), localeTarget);
12
15
  };
16
+
17
+ //#endregion
18
+ export { useDictionaryAsync };
13
19
  //# sourceMappingURL=useDictionaryAsync.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/server/useDictionaryAsync.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/config/client';\nimport { LanguageContent, type Dictionary } from '@intlayer/core';\nimport { IntlayerServerContext } from './IntlayerServerProvider';\nimport { getServerContext } from './serverContext';\nimport { useDictionary } from './useDictionary';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the server context\n */\nexport const useDictionaryAsync = async <T extends Dictionary>(\n dictionaryPromise: LanguageContent<() => Promise<T>>,\n locale?: LocalesValues\n) => {\n const localeTarget =\n locale ??\n getServerContext<LocalesValues>(IntlayerServerContext) ??\n configuration?.internationalization.defaultLocale;\n\n const dictionary = await dictionaryPromise[localeTarget]!();\n\n return useDictionary(dictionary, localeTarget) as any;\n};\n"],"mappings":"AAAA,OAAO,mBAAmB;AAG1B,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAOvB,MAAM,qBAAqB,OAChC,mBACA,WACG;AACH,QAAM,eACJ,UACA,iBAAgC,qBAAqB,KACrD,eAAe,qBAAqB;AAEtC,QAAM,aAAa,MAAM,kBAAkB,YAAY,EAAG;AAE1D,SAAO,cAAc,YAAY,YAAY;AAC/C;","names":[]}
1
+ {"version":3,"file":"useDictionaryAsync.mjs","names":[],"sources":["../../../src/server/useDictionaryAsync.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type {\n DeclaredLocales,\n Dictionary,\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types';\nimport { IntlayerServerContext } from './IntlayerServerProvider';\nimport { getServerContext } from './serverContext';\nimport { useDictionary } from './useDictionary';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the server context\n */\nexport const useDictionaryAsync = async <\n T extends Dictionary,\n L extends LocalesValues = DeclaredLocales,\n>(\n dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>,\n locale?: L\n) => {\n const localeTarget =\n locale ??\n getServerContext<LocalesValues>(IntlayerServerContext) ??\n configuration?.internationalization.defaultLocale;\n\n const dictionary = await (dictionaryPromise as any)[localeTarget]?.();\n\n return useDictionary<T, L>(dictionary, localeTarget as L);\n};\n"],"mappings":";;;;;;;;;;;AAgBA,MAAa,qBAAqB,OAIhC,mBACA,WACG;CACH,MAAM,eACJ,UACA,iBAAgC,sBAAsB,IACtD,eAAe,qBAAqB;AAItC,QAAO,cAFY,MAAO,kBAA0B,iBAAiB,EAE9B,aAAkB"}
@@ -1,17 +1,20 @@
1
- import configuration from "@intlayer/config/built";
2
- import { IntlayerServerContext } from "./IntlayerServerProvider.mjs";
3
1
  import { getServerContext } from "./serverContext.mjs";
2
+ import { IntlayerServerContext } from "./IntlayerServerProvider.mjs";
4
3
  import { useDictionary } from "./useDictionary.mjs";
5
4
  import { useLoadDynamic } from "./useLoadDynamic.mjs";
5
+ import configuration from "@intlayer/config/built";
6
+
7
+ //#region src/server/useDictionaryDynamic.ts
8
+ /**
9
+ * On the server side, Hook that transform a dictionary and return the content
10
+ *
11
+ * If the locale is not provided, it will use the locale from the server context
12
+ */
6
13
  const useDictionaryDynamic = (dictionaryPromise, key, locale) => {
7
- const localeTarget = locale ?? getServerContext(IntlayerServerContext) ?? configuration?.internationalization.defaultLocale;
8
- const dictionary = useLoadDynamic(
9
- `${String(key)}.${localeTarget}`,
10
- dictionaryPromise[localeTarget]()
11
- );
12
- return useDictionary(dictionary, localeTarget);
13
- };
14
- export {
15
- useDictionaryDynamic
14
+ const localeTarget = locale ?? getServerContext(IntlayerServerContext) ?? configuration?.internationalization.defaultLocale;
15
+ return useDictionary(useLoadDynamic(`${String(key)}.${localeTarget}`, dictionaryPromise[localeTarget]?.()), localeTarget);
16
16
  };
17
+
18
+ //#endregion
19
+ export { useDictionaryDynamic };
17
20
  //# sourceMappingURL=useDictionaryDynamic.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/server/useDictionaryDynamic.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/config/client';\nimport { LanguageContent, type Dictionary } from '@intlayer/core';\nimport { IntlayerServerContext } from './IntlayerServerProvider';\nimport { getServerContext } from './serverContext';\nimport { useDictionary } from './useDictionary';\nimport { useLoadDynamic } from './useLoadDynamic';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the server context\n */\nexport const useDictionaryDynamic = <T extends Dictionary>(\n dictionaryPromise: LanguageContent<() => Promise<T>>,\n key: string,\n locale?: LocalesValues\n) => {\n const localeTarget =\n locale ??\n getServerContext<LocalesValues>(IntlayerServerContext) ??\n configuration?.internationalization.defaultLocale;\n\n const dictionary = useLoadDynamic<T>(\n `${String(key)}.${localeTarget}`,\n dictionaryPromise[localeTarget]!()\n );\n\n return useDictionary(dictionary, localeTarget);\n};\n"],"mappings":"AAAA,OAAO,mBAAmB;AAG1B,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAOxB,MAAM,uBAAuB,CAClC,mBACA,KACA,WACG;AACH,QAAM,eACJ,UACA,iBAAgC,qBAAqB,KACrD,eAAe,qBAAqB;AAEtC,QAAM,aAAa;AAAA,IACjB,GAAG,OAAO,GAAG,CAAC,IAAI,YAAY;AAAA,IAC9B,kBAAkB,YAAY,EAAG;AAAA,EACnC;AAEA,SAAO,cAAc,YAAY,YAAY;AAC/C;","names":[]}
1
+ {"version":3,"file":"useDictionaryDynamic.mjs","names":[],"sources":["../../../src/server/useDictionaryDynamic.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type {\n DeclaredLocales,\n Dictionary,\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types';\nimport { IntlayerServerContext } from './IntlayerServerProvider';\nimport { getServerContext } from './serverContext';\nimport { useDictionary } from './useDictionary';\nimport { useLoadDynamic } from './useLoadDynamic';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the server context\n */\nexport const useDictionaryDynamic = <\n T extends Dictionary,\n L extends LocalesValues = DeclaredLocales,\n>(\n dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>,\n key: string,\n locale?: L\n) => {\n const localeTarget =\n locale ??\n getServerContext<LocalesValues>(IntlayerServerContext) ??\n configuration?.internationalization.defaultLocale;\n\n const dictionary = useLoadDynamic<T>(\n `${String(key)}.${localeTarget}`,\n (dictionaryPromise as any)[localeTarget]?.()\n );\n\n return useDictionary<T, L>(dictionary, localeTarget as L);\n};\n"],"mappings":";;;;;;;;;;;;AAiBA,MAAa,wBAIX,mBACA,KACA,WACG;CACH,MAAM,eACJ,UACA,iBAAgC,sBAAsB,IACtD,eAAe,qBAAqB;AAOtC,QAAO,cALY,eACjB,GAAG,OAAO,IAAI,CAAC,GAAG,gBACjB,kBAA0B,iBAAiB,CAC7C,EAEsC,aAAkB"}
@@ -1,26 +1,38 @@
1
1
  import { getIntlayer } from "../getIntlayer.mjs";
2
- import { IntlayerServerContext } from "./IntlayerServerProvider.mjs";
3
2
  import { getServerContext } from "./serverContext.mjs";
3
+ import { IntlayerServerContext } from "./IntlayerServerProvider.mjs";
4
+
5
+ //#region src/server/useI18n.ts
6
+ /**
7
+ * Hook that provides a translation function `t()` for accessing nested content by key.
8
+ * This hook mimics the pattern found in libraries like i18next, next-intl, and vue-i18n.
9
+ *
10
+ * @param namespace - The dictionary key to scope translations to
11
+ * @param locale - Optional locale override. If not provided, uses the current context locale
12
+ * @returns A translation function `t(key)` that returns the translated content for the given key
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * const t = useI18n('IndexPage');
17
+ * const title = t('title'); // Returns translated string for 'IndexPage.title'
18
+ * const nestedContent = t('section.subtitle'); // Returns 'IndexPage.section.subtitle'
19
+ * ```
20
+ */
4
21
  const useI18n = (namespace, locale) => {
5
- const localeTarget = locale ?? getServerContext(IntlayerServerContext);
6
- const dictionaryContent = getIntlayer(namespace, localeTarget);
7
- const t = (path) => {
8
- if (!path) {
9
- return dictionaryContent;
10
- }
11
- const pathArray = path.split(".");
12
- let current = dictionaryContent;
13
- for (const key of pathArray) {
14
- current = current?.[key];
15
- if (current === void 0) {
16
- return dictionaryContent;
17
- }
18
- }
19
- return current;
20
- };
21
- return t;
22
- };
23
- export {
24
- useI18n
22
+ const dictionaryContent = getIntlayer(namespace, locale ?? getServerContext(IntlayerServerContext));
23
+ const t = (path) => {
24
+ if (!path) return dictionaryContent;
25
+ const pathArray = path.split(".");
26
+ let current = dictionaryContent;
27
+ for (const key of pathArray) {
28
+ current = current?.[key];
29
+ if (current === void 0) return dictionaryContent;
30
+ }
31
+ return current;
32
+ };
33
+ return t;
25
34
  };
35
+
36
+ //#endregion
37
+ export { useI18n };
26
38
  //# sourceMappingURL=useI18n.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/server/useI18n.ts"],"sourcesContent":["import type { LocalesValues } from '@intlayer/config/client';\nimport type {\n DictionaryKeys,\n GetSubPath,\n ValidDotPathsFor,\n} from '@intlayer/core';\nimport type { DeepTransformContent } from '../plugins';\n// @ts-ignore intlayer declared for module augmentation\nimport type { IntlayerDictionaryTypesConnector } from 'intlayer';\nimport { getIntlayer } from '../getIntlayer';\nimport { IntlayerServerContext } from './IntlayerServerProvider';\nimport { getServerContext } from './serverContext';\n\n/**\n * Hook that provides a translation function `t()` for accessing nested content by key.\n * This hook mimics the pattern found in libraries like i18next, next-intl, and vue-i18n.\n *\n * @param namespace - The dictionary key to scope translations to\n * @param locale - Optional locale override. If not provided, uses the current context locale\n * @returns A translation function `t(key)` that returns the translated content for the given key\n *\n * @example\n * ```tsx\n * const t = useI18n('IndexPage');\n * const title = t('title'); // Returns translated string for 'IndexPage.title'\n * const nestedContent = t('section.subtitle'); // Returns 'IndexPage.section.subtitle'\n * ```\n */\nexport const useI18n = <T extends DictionaryKeys>(\n namespace: T,\n locale?: LocalesValues\n) => {\n const localeTarget =\n locale ?? getServerContext<LocalesValues>(IntlayerServerContext);\n\n // Get the dictionary content for the namespace\n const dictionaryContent = getIntlayer(namespace, localeTarget);\n\n // Return the translation function\n const t = <P extends ValidDotPathsFor<T>>(\n path: P\n ): GetSubPath<\n DeepTransformContent<IntlayerDictionaryTypesConnector[T]['content']>,\n P\n > => {\n if (!path) {\n return dictionaryContent as any;\n }\n\n const pathArray = (path as string).split('.');\n let current: any = dictionaryContent;\n\n for (const key of pathArray) {\n current = current?.[key];\n if (current === undefined) {\n // Return the whole dictionary as fallback if path is not found\n return dictionaryContent as any;\n }\n }\n\n return current;\n };\n\n return t;\n};\n"],"mappings":"AASA,SAAS,mBAAmB;AAC5B,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AAiB1B,MAAM,UAAU,CACrB,WACA,WACG;AACH,QAAM,eACJ,UAAU,iBAAgC,qBAAqB;AAGjE,QAAM,oBAAoB,YAAY,WAAW,YAAY;AAG7D,QAAM,IAAI,CACR,SAIG;AACH,QAAI,CAAC,MAAM;AACT,aAAO;AAAA,IACT;AAEA,UAAM,YAAa,KAAgB,MAAM,GAAG;AAC5C,QAAI,UAAe;AAEnB,eAAW,OAAO,WAAW;AAC3B,gBAAU,UAAU,GAAG;AACvB,UAAI,YAAY,QAAW;AAEzB,eAAO;AAAA,MACT;AAAA,IACF;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"file":"useI18n.mjs","names":["current: any"],"sources":["../../../src/server/useI18n.ts"],"sourcesContent":["import type { ValidDotPathsFor } from '@intlayer/core';\nimport type {\n DictionaryKeys,\n DictionaryRegistryContent,\n GetSubPath,\n LocalesValues,\n} from '@intlayer/types';\nimport { getIntlayer } from '../getIntlayer';\nimport type { DeepTransformContent } from '../plugins';\nimport { IntlayerServerContext } from './IntlayerServerProvider';\nimport { getServerContext } from './serverContext';\n\n/**\n * Hook that provides a translation function `t()` for accessing nested content by key.\n * This hook mimics the pattern found in libraries like i18next, next-intl, and vue-i18n.\n *\n * @param namespace - The dictionary key to scope translations to\n * @param locale - Optional locale override. If not provided, uses the current context locale\n * @returns A translation function `t(key)` that returns the translated content for the given key\n *\n * @example\n * ```tsx\n * const t = useI18n('IndexPage');\n * const title = t('title'); // Returns translated string for 'IndexPage.title'\n * const nestedContent = t('section.subtitle'); // Returns 'IndexPage.section.subtitle'\n * ```\n */\nexport const useI18n = <T extends DictionaryKeys>(\n namespace: T,\n locale?: LocalesValues\n) => {\n const localeTarget =\n locale ?? getServerContext<LocalesValues>(IntlayerServerContext);\n\n // Get the dictionary content for the namespace\n const dictionaryContent = getIntlayer(namespace, localeTarget);\n\n // Return the translation function\n // @ts-ignore Type instantiation is excessively deep and possibly infinite\n const t = <P extends ValidDotPathsFor<T>>(\n path: P\n ): GetSubPath<DeepTransformContent<DictionaryRegistryContent<T>>, P> => {\n if (!path) {\n return dictionaryContent as any;\n }\n\n const pathArray = (path as string).split('.');\n let current: any = dictionaryContent;\n\n for (const key of pathArray) {\n current = current?.[key];\n if (current === undefined) {\n // Return the whole dictionary as fallback if path is not found\n return dictionaryContent as any;\n }\n }\n\n return current;\n };\n\n return t;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BA,MAAa,WACX,WACA,WACG;CAKH,MAAM,oBAAoB,YAAY,WAHpC,UAAU,iBAAgC,sBAAsB,CAGJ;CAI9D,MAAM,KACJ,SACsE;AACtE,MAAI,CAAC,KACH,QAAO;EAGT,MAAM,YAAa,KAAgB,MAAM,IAAI;EAC7C,IAAIA,UAAe;AAEnB,OAAK,MAAM,OAAO,WAAW;AAC3B,aAAU,UAAU;AACpB,OAAI,YAAY,OAEd,QAAO;;AAIX,SAAO;;AAGT,QAAO"}
@@ -1,11 +1,17 @@
1
1
  import { getIntlayer } from "../getIntlayer.mjs";
2
- import { IntlayerServerContext } from "./IntlayerServerProvider.mjs";
3
2
  import { getServerContext } from "./serverContext.mjs";
3
+ import { IntlayerServerContext } from "./IntlayerServerProvider.mjs";
4
+
5
+ //#region src/server/useIntlayer.ts
6
+ /**
7
+ * On the server side, Hook that picking one dictionary by its key and return the content
8
+ *
9
+ * If the locale is not provided, it will use the locale from the server context
10
+ */
4
11
  const useIntlayer = (key, locale) => {
5
- const localeTarget = locale ?? getServerContext(IntlayerServerContext);
6
- return getIntlayer(key, localeTarget);
7
- };
8
- export {
9
- useIntlayer
12
+ return getIntlayer(key, locale ?? getServerContext(IntlayerServerContext));
10
13
  };
14
+
15
+ //#endregion
16
+ export { useIntlayer };
11
17
  //# sourceMappingURL=useIntlayer.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/server/useIntlayer.ts"],"sourcesContent":["import type { LocalesValues } from '@intlayer/config/client';\nimport { type DictionaryKeys } from '@intlayer/core';\nimport { getIntlayer } from '../getIntlayer';\nimport { IntlayerServerContext } from './IntlayerServerProvider';\nimport { getServerContext } from './serverContext';\n\n/**\n * On the server side, Hook that picking one dictionary by its key and return the content\n *\n * If the locale is not provided, it will use the locale from the server context\n */\nexport const useIntlayer = <T extends DictionaryKeys, K extends LocalesValues>(\n key: T,\n locale?: K\n) => {\n const localeTarget =\n locale ?? getServerContext<LocalesValues>(IntlayerServerContext);\n\n return getIntlayer(key, localeTarget);\n};\n"],"mappings":"AAEA,SAAS,mBAAmB;AAC5B,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AAO1B,MAAM,cAAc,CACzB,KACA,WACG;AACH,QAAM,eACJ,UAAU,iBAAgC,qBAAqB;AAEjE,SAAO,YAAY,KAAK,YAAY;AACtC;","names":[]}
1
+ {"version":3,"file":"useIntlayer.mjs","names":[],"sources":["../../../src/server/useIntlayer.ts"],"sourcesContent":["import type { DictionaryKeys, LocalesValues } from '@intlayer/types';\nimport { getIntlayer } from '../getIntlayer';\nimport { IntlayerServerContext } from './IntlayerServerProvider';\nimport { getServerContext } from './serverContext';\n\n/**\n * On the server side, Hook that picking one dictionary by its key and return the content\n *\n * If the locale is not provided, it will use the locale from the server context\n */\nexport const useIntlayer = <T extends DictionaryKeys, L extends LocalesValues>(\n key: T,\n locale?: L\n) => {\n const localeTarget =\n locale ?? getServerContext<LocalesValues>(IntlayerServerContext);\n\n return getIntlayer<T, L>(key, localeTarget as L);\n};\n"],"mappings":";;;;;;;;;;AAUA,MAAa,eACX,KACA,WACG;AAIH,QAAO,YAAkB,KAFvB,UAAU,iBAAgC,sBAAsB,CAElB"}
@@ -1,10 +1,12 @@
1
1
  import react from "react";
2
+
3
+ //#region src/server/useLoadDynamic.ts
2
4
  const useLoadDynamic = (_key, promise) => {
3
- const cachedPromise = react.cache(async () => await promise)();
4
- const dictionary = react.use(cachedPromise);
5
- return dictionary;
6
- };
7
- export {
8
- useLoadDynamic
5
+ /** @ts-ignore remove error Property 'cache' does not exist on type 'typeof React'. */
6
+ const cachedPromise = react.cache(async () => await promise)();
7
+ return react.use(cachedPromise);
9
8
  };
9
+
10
+ //#endregion
11
+ export { useLoadDynamic };
10
12
  //# sourceMappingURL=useLoadDynamic.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/server/useLoadDynamic.ts"],"sourcesContent":["import react from 'react';\n\nexport const useLoadDynamic = <T>(_key: string, promise: Promise<T>): T => {\n /** @ts-ignore remove error Property 'cache' does not exist on type 'typeof React'. */\n const cachedPromise = react.cache(async () => await promise)();\n\n /** @ts-ignore remove error Property 'use' does not exist on type 'typeof React'. */\n const dictionary = react.use(cachedPromise);\n\n return dictionary;\n};\n"],"mappings":"AAAA,OAAO,WAAW;AAEX,MAAM,iBAAiB,CAAI,MAAc,YAA2B;AAEzE,QAAM,gBAAgB,MAAM,MAAM,YAAY,MAAM,OAAO,EAAE;AAG7D,QAAM,aAAa,MAAM,IAAI,aAAa;AAE1C,SAAO;AACT;","names":[]}
1
+ {"version":3,"file":"useLoadDynamic.mjs","names":[],"sources":["../../../src/server/useLoadDynamic.ts"],"sourcesContent":["import react from 'react';\n\nexport const useLoadDynamic = <T>(_key: string, promise: Promise<T>): T => {\n /** @ts-ignore remove error Property 'cache' does not exist on type 'typeof React'. */\n const cachedPromise = react.cache(async () => await promise)();\n\n /** @ts-ignore remove error Property 'use' does not exist on type 'typeof React'. */\n const dictionary = react.use(cachedPromise);\n\n return dictionary;\n};\n"],"mappings":";;;AAEA,MAAa,kBAAqB,MAAc,YAA2B;;CAEzE,MAAM,gBAAgB,MAAM,MAAM,YAAY,MAAM,QAAQ,EAAE;AAK9D,QAFmB,MAAM,IAAI,cAAc"}
@@ -1,12 +1,22 @@
1
- import configuration from "@intlayer/config/built";
2
- import { IntlayerServerContext } from "./IntlayerServerProvider.mjs";
3
1
  import { getServerContext } from "./serverContext.mjs";
2
+ import { IntlayerServerContext } from "./IntlayerServerProvider.mjs";
3
+ import configuration from "@intlayer/config/built";
4
+
5
+ //#region src/server/useLocale.ts
6
+ /**
7
+ * On the server side, Hook that picking one dictionary by its key and return the content
8
+ *
9
+ * If the locale is not provided, it will use the locale from the server context
10
+ */
4
11
  const useLocale = () => {
5
- const { defaultLocale } = configuration?.internationalization ?? {};
6
- const locale = getServerContext(IntlayerServerContext) ?? defaultLocale;
7
- return { locale };
8
- };
9
- export {
10
- useLocale
12
+ const { defaultLocale, locales: availableLocales } = configuration?.internationalization ?? {};
13
+ return {
14
+ locale: getServerContext(IntlayerServerContext) ?? defaultLocale,
15
+ defaultLocale,
16
+ availableLocales
17
+ };
11
18
  };
19
+
20
+ //#endregion
21
+ export { useLocale };
12
22
  //# sourceMappingURL=useLocale.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/server/useLocale.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { Locales, LocalesValues } from '@intlayer/config/client';\nimport { IntlayerServerContext } from './IntlayerServerProvider';\nimport { getServerContext } from './serverContext';\n\n/**\n * On the server side, Hook that picking one dictionary by its key and return the content\n *\n * If the locale is not provided, it will use the locale from the server context\n */\nexport const useLocale = () => {\n const { defaultLocale } = configuration?.internationalization ?? {};\n const locale =\n (getServerContext<LocalesValues>(IntlayerServerContext) as Locales) ??\n (defaultLocale as Locales);\n\n return { locale };\n};\n"],"mappings":"AAAA,OAAO,mBAAmB;AAE1B,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AAO1B,MAAM,YAAY,MAAM;AAC7B,QAAM,EAAE,cAAc,IAAI,eAAe,wBAAwB,CAAC;AAClE,QAAM,SACH,iBAAgC,qBAAqB,KACrD;AAEH,SAAO,EAAE,OAAO;AAClB;","names":[]}
1
+ {"version":3,"file":"useLocale.mjs","names":[],"sources":["../../../src/server/useLocale.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { DeclaredLocales } from '@intlayer/types';\nimport { IntlayerServerContext } from './IntlayerServerProvider';\nimport { getServerContext } from './serverContext';\n\ntype UseLocaleResult = {\n locale: DeclaredLocales;\n defaultLocale: DeclaredLocales;\n availableLocales: DeclaredLocales[];\n};\n\n/**\n * On the server side, Hook that picking one dictionary by its key and return the content\n *\n * If the locale is not provided, it will use the locale from the server context\n */\nexport const useLocale = (): UseLocaleResult => {\n const { defaultLocale, locales: availableLocales } =\n configuration?.internationalization ?? {};\n\n const locale = (getServerContext(IntlayerServerContext) ??\n defaultLocale) as DeclaredLocales;\n\n return { locale, defaultLocale, availableLocales };\n};\n"],"mappings":";;;;;;;;;;AAgBA,MAAa,kBAAmC;CAC9C,MAAM,EAAE,eAAe,SAAS,qBAC9B,eAAe,wBAAwB,EAAE;AAK3C,QAAO;EAAE,QAHO,iBAAiB,sBAAsB,IACrD;EAEe;EAAe;EAAkB"}
@@ -1,15 +1,22 @@
1
- import type { NodeProps } from '@intlayer/core';
2
- import { type PropsWithChildren, type ReactNode } from 'react';
3
- export type IntlayerNode<T = NodeProps['children'], AdditionalProps = {}> = ReactNode & {
4
- value: T;
1
+ import { NodeProps } from "@intlayer/core";
2
+ import { PropsWithChildren, ReactNode } from "react";
3
+
4
+ //#region src/IntlayerNode.d.ts
5
+ type IntlayerNode<T$1 = NodeProps['children'], AdditionalProps = Record<string, never>> = ReactNode & {
6
+ value: T$1;
5
7
  } & AdditionalProps;
6
- type RenderIntlayerNodeProps<T> = PropsWithChildren<{
7
- value: T;
8
- children: ReactNode;
9
- additionalProps?: {
10
- [key: string]: any;
11
- };
8
+ type RenderIntlayerNodeProps<T$1> = PropsWithChildren<{
9
+ value: T$1;
10
+ children: ReactNode;
11
+ additionalProps?: {
12
+ [key: string]: any;
13
+ };
12
14
  }>;
13
- export declare const renderIntlayerNode: <T extends number | string | boolean | undefined | null>({ children, value, additionalProps, }: RenderIntlayerNodeProps<T>) => IntlayerNode<T>;
14
- export {};
15
+ declare const renderIntlayerNode: <T extends number | string | boolean | undefined | null>({
16
+ children,
17
+ value,
18
+ additionalProps
19
+ }: RenderIntlayerNodeProps<T>) => IntlayerNode<T>;
20
+ //#endregion
21
+ export { IntlayerNode, renderIntlayerNode };
15
22
  //# sourceMappingURL=IntlayerNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntlayerNode.d.ts","sourceRoot":"","sources":["../../src/IntlayerNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,YAAY,CACtB,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,EACzB,eAAe,GAAG,EAAE,IAClB,SAAS,GAAG;IACd,KAAK,EAAE,CAAC,CAAC;CACV,GAAG,eAAe,CAAC;AAEpB,KAAK,uBAAuB,CAAC,CAAC,IAAI,iBAAiB,CAAC;IAClD,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,SAAS,CAAC;IACpB,eAAe,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CAC1C,CAAC,CAAC;AAEH,eAAO,MAAM,kBAAkB,GAC7B,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,EACtD,uCAIC,uBAAuB,CAAC,CAAC,CAAC,KAAG,YAAY,CAAC,CAAC,CA0B7C,CAAC"}
1
+ {"version":3,"file":"IntlayerNode.d.ts","names":[],"sources":["../../src/IntlayerNode.tsx"],"sourcesContent":[],"mappings":";;;;KAQY,mBACN,yCACc,yBAChB;SACK;AAJT,CAAA,GAKI,eALoB;KAOnB,uBANC,CAAA,GAAA,CAAA,GAM4B,iBAN5B,CAAA;EACc,KAAA,EAMX,GANW;EAChB,QAAA,EAMQ,SANR;EACK,eAAA,CAAA,EAAA;IACL,CAAA,GAAA,EAAA,MAAA,CAAA,EAAA,GAAA;EAAe,CAAA;AAAC,CAAA,CAAA;AAGX,cAKI,kBALJ,EAAA,CAAA,UAAA,MAAA,GAAA,MAAA,GAAA,OAAA,GAAA,SAAA,GAAA,IAAA,CAAA,CAAA;EAAA,QAAA;EAAA,KAAA;EAAA;AAAA,CAAA,EAWN,uBAXM,CAWkB,CAXlB,CAAA,EAAA,GAWuB,YAXvB,CAWoC,CAXpC,CAAA"}
@@ -1,12 +1,15 @@
1
- import { type FC, type HTMLAttributes } from 'react';
1
+ import { FC, HTMLAttributes } from "react";
2
+
3
+ //#region src/UI/ContentSelector.d.ts
2
4
  type ContentSelectorProps = {
3
- onPress: () => void;
4
- onHover?: () => void;
5
- onUnhover?: () => void;
6
- onClickOutside?: () => void;
7
- pressDuration?: number;
8
- isSelecting?: boolean;
5
+ onPress: () => void;
6
+ onHover?: () => void;
7
+ onUnhover?: () => void;
8
+ onClickOutside?: () => void;
9
+ pressDuration?: number;
10
+ isSelecting?: boolean;
9
11
  } & Omit<HTMLAttributes<HTMLDivElement>, 'content'>;
10
- export declare const ContentSelector: FC<ContentSelectorProps>;
11
- export {};
12
+ declare const ContentSelector: FC<ContentSelectorProps>;
13
+ //#endregion
14
+ export { ContentSelector };
12
15
  //# sourceMappingURL=ContentSelector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContentSelector.d.ts","sourceRoot":"","sources":["../../../src/UI/ContentSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,EAAE,EACP,KAAK,cAAc,EAEpB,MAAM,OAAO,CAAC;AAIf,KAAK,oBAAoB,GAAG;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC,CAAC;AAEpD,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAsHpD,CAAC"}
1
+ {"version":3,"file":"ContentSelector.d.ts","names":[],"sources":["../../../src/UI/ContentSelector.tsx"],"sourcesContent":[],"mappings":";;;KAcK,oBAAA;;EAAA,OAAA,CAAA,EAAA,GAAA,GAAA,IAAA;EAOmB,SAAA,CAAA,EAAA,GAAA,GAAA,IAAA;EAAf,cAAA,CAAA,EAAA,GAAA,GAAA,IAAA;EAAL,aAAA,CAAA,EAAA,MAAA;EAAI,WAAA,CAAA,EAAA,OAAA;AAER,CAAA,GAFI,IAES,CAFJ,cAwHR,CAxHuB,cAES,CAAA,EAAA,SAAA,CAAA;cAApB,iBAAiB,GAAG"}
@@ -1,28 +1,34 @@
1
- import type { LocalesValues } from '@intlayer/config/client';
2
- import { type FC, type PropsWithChildren } from 'react';
1
+ import * as react0 from "react";
2
+ import { FC, PropsWithChildren } from "react";
3
+ import { LocalesValues } from "@intlayer/types";
4
+
5
+ //#region src/client/IntlayerProvider.d.ts
3
6
  type IntlayerValue = {
4
- locale: LocalesValues;
5
- setLocale: (newLocale: LocalesValues) => void;
6
- disableEditor?: boolean;
7
+ locale: LocalesValues;
8
+ setLocale: (newLocale: LocalesValues) => void;
9
+ disableEditor?: boolean;
10
+ isCookieEnabled?: boolean;
7
11
  };
8
12
  /**
9
13
  * Context that store the current locale on the client side
10
14
  */
11
- export declare const IntlayerClientContext: import("react").Context<IntlayerValue>;
15
+ declare const IntlayerClientContext: react0.Context<IntlayerValue>;
12
16
  /**
13
17
  * Hook that provides the current locale
14
18
  */
15
- export declare const useIntlayerContext: () => IntlayerValue;
16
- export type IntlayerProviderProps = PropsWithChildren<{
17
- locale?: LocalesValues;
18
- defaultLocale?: LocalesValues;
19
- setLocale?: (locale: LocalesValues) => void;
20
- disableEditor?: boolean;
19
+ declare const useIntlayerContext: () => IntlayerValue;
20
+ type IntlayerProviderProps = PropsWithChildren<{
21
+ locale?: LocalesValues;
22
+ defaultLocale?: LocalesValues;
23
+ setLocale?: (locale: LocalesValues) => void;
24
+ disableEditor?: boolean;
25
+ isCookieEnabled?: boolean;
21
26
  }>;
22
27
  /**
23
28
  * Provider that store the current locale on the client side
24
29
  */
25
- export declare const IntlayerProviderContent: FC<IntlayerProviderProps>;
26
- export declare const IntlayerProvider: FC<IntlayerProviderProps>;
27
- export {};
30
+ declare const IntlayerProviderContent: FC<IntlayerProviderProps>;
31
+ declare const IntlayerProvider: FC<IntlayerProviderProps>;
32
+ //#endregion
33
+ export { IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, IntlayerProviderProps, useIntlayerContext };
28
34
  //# sourceMappingURL=IntlayerProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntlayerProvider.d.ts","sourceRoot":"","sources":["../../../src/client/IntlayerProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAI7D,OAAO,EACL,KAAK,EAAE,EACP,KAAK,iBAAiB,EAGvB,MAAM,OAAO,CAAC;AAIf,KAAK,aAAa,GAAG;IACnB,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,CAAC,SAAS,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,wCAIhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB,qBAA0C,CAAC;AAE1E,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;IACpD,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC,qBAAqB,CA8C7D,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAItD,CAAC"}
1
+ {"version":3,"file":"IntlayerProvider.d.ts","names":[],"sources":["../../../src/client/IntlayerProvider.tsx"],"sourcesContent":[],"mappings":";;;;;KAeK,aAAA;UACK;yBACe;EAFpB,aAAA,CAAA,EAAa,OAAA;EAUL,eAAA,CAAA,EAAA,OAKX;AAKF,CAAA;AAEA;;;AAGuB,cAfV,qBAeU,EAfW,MAAA,CAAA,OAeX,CAfW,aAeX,CAAA;;;AAQvB;AAiDa,cA9DA,kBA8DqB,EAAA,GAAA,GA9DH,aA8DA;KA5DnB,qBAAA,GAAwB;WACzB;kBACO;uBACK;;;;;;;cAQV,yBAAyB,GAAG;cAiD5B,kBAAkB,GAAG"}
@@ -1,9 +1,9 @@
1
- export { useCompact } from './useCompact';
2
- export { useCurrency } from './useCurrency';
3
- export { useDate } from './useDate';
4
- export { useList } from './useList';
5
- export { useNumber } from './useNumber';
6
- export { usePercentage } from './usePercentage';
7
- export { useRelativeTime } from './useRelativeTime';
8
- export { useUnit } from './useUnit';
9
- //# sourceMappingURL=index.d.ts.map
1
+ import { useCompact } from "./useCompact.js";
2
+ import { useCurrency } from "./useCurrency.js";
3
+ import { useDate } from "./useDate.js";
4
+ import { useList } from "./useList.js";
5
+ import { useNumber } from "./useNumber.js";
6
+ import { usePercentage } from "./usePercentage.js";
7
+ import { useRelativeTime } from "./useRelativeTime.js";
8
+ import { useUnit } from "./useUnit.js";
9
+ export { useCompact, useCurrency, useDate, useList, useNumber, usePercentage, useRelativeTime, useUnit };
@@ -1,3 +1,7 @@
1
+ import * as intlayer16 from "intlayer";
2
+
3
+ //#region src/client/format/useCompact.d.ts
4
+
1
5
  /**
2
6
  * React client hook that provides a compact number formatter
3
7
  * bound to the current application locale.
@@ -8,7 +12,9 @@
8
12
  * formatCompact(1500); // "1.5K"
9
13
  * ```
10
14
  */
11
- export declare const useCompact: () => (value: string | number, options?: Intl.NumberFormatOptions & {
12
- locale?: import("intlayer").LocalesValues;
15
+ declare const useCompact: () => (value: string | number, options?: Intl.NumberFormatOptions & {
16
+ locale?: intlayer16.LocalesValues;
13
17
  }) => string;
18
+ //#endregion
19
+ export { useCompact };
14
20
  //# sourceMappingURL=useCompact.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCompact.d.ts","sourceRoot":"","sources":["../../../../src/client/format/useCompact.ts"],"names":[],"mappings":"AAMA;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU;;YAWtB,CAAC"}
1
+ {"version":3,"file":"useCompact.d.ts","names":[],"sources":["../../../../src/client/format/useCompact.ts"],"sourcesContent":[],"mappings":";;;;;;;AAgBA;;;;;;;cAAa,qDAAU,IAAA,CAAA;WAAA,UAAA,CAAA"}
@@ -1,3 +1,7 @@
1
+ import * as intlayer17 from "intlayer";
2
+
3
+ //#region src/client/format/useCurrency.d.ts
4
+
1
5
  /**
2
6
  * React client hook that provides a currency formatter
3
7
  * bound to the current application locale.
@@ -22,7 +26,9 @@
22
26
  * // "¥9,876,543"
23
27
  * ```
24
28
  */
25
- export declare const useCurrency: () => (value: string | number, options?: Intl.NumberFormatOptions & {
26
- locale?: import("intlayer").LocalesValues;
29
+ declare const useCurrency: () => (value: string | number, options?: Intl.NumberFormatOptions & {
30
+ locale?: intlayer17.LocalesValues;
27
31
  }) => string;
32
+ //#endregion
33
+ export { useCurrency };
28
34
  //# sourceMappingURL=useCurrency.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCurrency.d.ts","sourceRoot":"","sources":["../../../../src/client/format/useCurrency.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,WAAW;;YAWvB,CAAC"}
1
+ {"version":3,"file":"useCurrency.d.ts","names":[],"sources":["../../../../src/client/format/useCurrency.ts"],"sourcesContent":[],"mappings":";;;;;;;AA8BA;;;;;;;;;;;;;;;;;;;;;cAAa,sDAAW,IAAA,CAAA;WAAA,UAAA,CAAA"}
@@ -1,4 +1,7 @@
1
- import { date } from '@intlayer/core';
1
+ import { date } from "@intlayer/core";
2
+
3
+ //#region src/client/format/useDate.d.ts
4
+
2
5
  /**
3
6
  * React client hook that provides a localized date/time formatter
4
7
  * bound to the current application locale.
@@ -25,5 +28,7 @@ import { date } from '@intlayer/core';
25
28
  *
26
29
  * @see createDate
27
30
  */
28
- export declare const useDate: () => (...args: Parameters<typeof date>) => string;
31
+ declare const useDate: () => (...args: Parameters<typeof date>) => string;
32
+ //#endregion
33
+ export { useDate };
29
34
  //# sourceMappingURL=useDate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDate.d.ts","sourceRoot":"","sources":["../../../../src/client/format/useDate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAItC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,OAAO,SAGV,GAAG,MAAM,UAAU,CAAC,OAAO,IAAI,CAAC,WAKzC,CAAC"}
1
+ {"version":3,"file":"useDate.d.ts","names":[],"sources":["../../../../src/client/format/useDate.ts"],"sourcesContent":[],"mappings":";;;;;;AAgCA;;;;;;;;;;;;;;;;;;;;;;;;cAAa,yBAGM,kBAAkB"}
@@ -1,3 +1,7 @@
1
+ import * as intlayer21 from "intlayer";
2
+
3
+ //#region src/client/format/useList.d.ts
4
+
1
5
  /**
2
6
  * React client hook that provides a list formatter
3
7
  * bound to the current application locale.
@@ -19,7 +23,9 @@
19
23
  * // "1, 2 und 3"
20
24
  * ```
21
25
  */
22
- export declare const useList: () => (values: (string | number)[], options?: Intl.ListFormatOptions & {
23
- locale?: import("intlayer").LocalesValues;
26
+ declare const useList: () => (values: (string | number)[], options?: Intl.ListFormatOptions & {
27
+ locale?: intlayer21.LocalesValues;
24
28
  }) => string;
29
+ //#endregion
30
+ export { useList };
25
31
  //# sourceMappingURL=useList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useList.d.ts","sourceRoot":"","sources":["../../../../src/client/format/useList.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,OAAO;;YAWnB,CAAC"}
1
+ {"version":3,"file":"useList.d.ts","names":[],"sources":["../../../../src/client/format/useList.ts"],"sourcesContent":[],"mappings":";;;;;;;AA2BA;;;;;;;;;;;;;;;;;;cAAa,uDAAO,IAAA,CAAA;WAAA,UAAA,CAAA"}