react-intlayer 8.9.2 → 8.9.4-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/dist/cjs/IntlayerNode.cjs.map +1 -1
  2. package/dist/cjs/UI/ContentSelector.cjs.map +1 -1
  3. package/dist/cjs/client/IntlayerProvider.cjs.map +1 -1
  4. package/dist/cjs/client/format/useCompact.cjs.map +1 -1
  5. package/dist/cjs/client/format/useCurrency.cjs.map +1 -1
  6. package/dist/cjs/client/format/useDate.cjs.map +1 -1
  7. package/dist/cjs/client/format/useIntl.cjs.map +1 -1
  8. package/dist/cjs/client/format/useList.cjs.map +1 -1
  9. package/dist/cjs/client/format/useNumber.cjs.map +1 -1
  10. package/dist/cjs/client/format/usePercentage.cjs.map +1 -1
  11. package/dist/cjs/client/format/useRelativeTime.cjs.map +1 -1
  12. package/dist/cjs/client/format/useUnit.cjs.map +1 -1
  13. package/dist/cjs/client/t.cjs.map +1 -1
  14. package/dist/cjs/client/useDictionary.cjs.map +1 -1
  15. package/dist/cjs/client/useDictionaryAsync.cjs.map +1 -1
  16. package/dist/cjs/client/useDictionaryDynamic.cjs.map +1 -1
  17. package/dist/cjs/client/useI18n.cjs.map +1 -1
  18. package/dist/cjs/client/useIntlayer.cjs.map +1 -1
  19. package/dist/cjs/client/useLoadDynamic.cjs.map +1 -1
  20. package/dist/cjs/client/useLocale.cjs.map +1 -1
  21. package/dist/cjs/client/useLocaleBase.cjs.map +1 -1
  22. package/dist/cjs/client/useRewriteURL.cjs.map +1 -1
  23. package/dist/cjs/client/useTraduction.cjs.map +1 -1
  24. package/dist/cjs/editor/ContentSelector.cjs.map +1 -1
  25. package/dist/cjs/editor/EditorProvider.cjs.map +1 -1
  26. package/dist/cjs/editor/useEditor.cjs.map +1 -1
  27. package/dist/cjs/html/HTMLRenderer.cjs.map +1 -1
  28. package/dist/cjs/html/HTMLRendererPlugin.cjs.map +1 -1
  29. package/dist/cjs/index.cjs.map +1 -1
  30. package/dist/cjs/markdown/MarkdownProvider.cjs.map +1 -1
  31. package/dist/cjs/markdown/MarkdownRenderer.cjs.map +1 -1
  32. package/dist/cjs/markdown/MarkdownRendererPlugin.cjs.map +1 -1
  33. package/dist/cjs/markdown/processor.cjs.map +1 -1
  34. package/dist/cjs/markdown/runtime.cjs.map +1 -1
  35. package/dist/cjs/plugins.cjs.map +1 -1
  36. package/dist/cjs/reactElement/renderReactElement.cjs.map +1 -1
  37. package/dist/cjs/server/format/useCompact.cjs.map +1 -1
  38. package/dist/cjs/server/format/useCurrency.cjs.map +1 -1
  39. package/dist/cjs/server/format/useDate.cjs.map +1 -1
  40. package/dist/cjs/server/format/useIntl.cjs.map +1 -1
  41. package/dist/cjs/server/format/useList.cjs.map +1 -1
  42. package/dist/cjs/server/format/useNumber.cjs.map +1 -1
  43. package/dist/cjs/server/format/usePercentage.cjs.map +1 -1
  44. package/dist/cjs/server/format/useRelativeTime.cjs.map +1 -1
  45. package/dist/cjs/server/format/useUnit.cjs.map +1 -1
  46. package/dist/cjs/server/serverContext.cjs.map +1 -1
  47. package/dist/cjs/server/t.cjs.map +1 -1
  48. package/dist/cjs/server/useDictionary.cjs.map +1 -1
  49. package/dist/cjs/server/useDictionaryAsync.cjs.map +1 -1
  50. package/dist/cjs/server/useDictionaryDynamic.cjs.map +1 -1
  51. package/dist/cjs/server/useI18n.cjs.map +1 -1
  52. package/dist/cjs/server/useIntlayer.cjs.map +1 -1
  53. package/dist/cjs/server/useLoadDynamic.cjs.map +1 -1
  54. package/dist/cjs/server/useLocale.cjs.map +1 -1
  55. package/dist/esm/IntlayerNode.mjs.map +1 -1
  56. package/dist/esm/UI/ContentSelector.mjs.map +1 -1
  57. package/dist/esm/client/IntlayerProvider.mjs.map +1 -1
  58. package/dist/esm/client/format/useCompact.mjs.map +1 -1
  59. package/dist/esm/client/format/useCurrency.mjs.map +1 -1
  60. package/dist/esm/client/format/useDate.mjs.map +1 -1
  61. package/dist/esm/client/format/useIntl.mjs.map +1 -1
  62. package/dist/esm/client/format/useList.mjs.map +1 -1
  63. package/dist/esm/client/format/useNumber.mjs.map +1 -1
  64. package/dist/esm/client/format/usePercentage.mjs.map +1 -1
  65. package/dist/esm/client/format/useRelativeTime.mjs.map +1 -1
  66. package/dist/esm/client/format/useUnit.mjs.map +1 -1
  67. package/dist/esm/client/t.mjs.map +1 -1
  68. package/dist/esm/client/useDictionary.mjs.map +1 -1
  69. package/dist/esm/client/useDictionaryAsync.mjs.map +1 -1
  70. package/dist/esm/client/useDictionaryDynamic.mjs.map +1 -1
  71. package/dist/esm/client/useI18n.mjs.map +1 -1
  72. package/dist/esm/client/useIntlayer.mjs.map +1 -1
  73. package/dist/esm/client/useLoadDynamic.mjs.map +1 -1
  74. package/dist/esm/client/useLocale.mjs.map +1 -1
  75. package/dist/esm/client/useLocaleBase.mjs.map +1 -1
  76. package/dist/esm/client/useRewriteURL.mjs.map +1 -1
  77. package/dist/esm/client/useTraduction.mjs.map +1 -1
  78. package/dist/esm/editor/ContentSelector.mjs.map +1 -1
  79. package/dist/esm/editor/EditorProvider.mjs.map +1 -1
  80. package/dist/esm/editor/useEditor.mjs.map +1 -1
  81. package/dist/esm/html/HTMLRenderer.mjs.map +1 -1
  82. package/dist/esm/html/HTMLRendererPlugin.mjs.map +1 -1
  83. package/dist/esm/index.mjs.map +1 -1
  84. package/dist/esm/markdown/MarkdownProvider.mjs.map +1 -1
  85. package/dist/esm/markdown/MarkdownRenderer.mjs.map +1 -1
  86. package/dist/esm/markdown/MarkdownRendererPlugin.mjs.map +1 -1
  87. package/dist/esm/markdown/processor.mjs.map +1 -1
  88. package/dist/esm/markdown/runtime.mjs.map +1 -1
  89. package/dist/esm/plugins.mjs.map +1 -1
  90. package/dist/esm/reactElement/renderReactElement.mjs.map +1 -1
  91. package/dist/esm/server/format/useCompact.mjs.map +1 -1
  92. package/dist/esm/server/format/useCurrency.mjs.map +1 -1
  93. package/dist/esm/server/format/useDate.mjs.map +1 -1
  94. package/dist/esm/server/format/useIntl.mjs.map +1 -1
  95. package/dist/esm/server/format/useList.mjs.map +1 -1
  96. package/dist/esm/server/format/useNumber.mjs.map +1 -1
  97. package/dist/esm/server/format/usePercentage.mjs.map +1 -1
  98. package/dist/esm/server/format/useRelativeTime.mjs.map +1 -1
  99. package/dist/esm/server/format/useUnit.mjs.map +1 -1
  100. package/dist/esm/server/serverContext.mjs.map +1 -1
  101. package/dist/esm/server/t.mjs.map +1 -1
  102. package/dist/esm/server/useDictionary.mjs.map +1 -1
  103. package/dist/esm/server/useDictionaryAsync.mjs.map +1 -1
  104. package/dist/esm/server/useDictionaryDynamic.mjs.map +1 -1
  105. package/dist/esm/server/useI18n.mjs.map +1 -1
  106. package/dist/esm/server/useIntlayer.mjs.map +1 -1
  107. package/dist/esm/server/useLoadDynamic.mjs.map +1 -1
  108. package/dist/esm/server/useLocale.mjs.map +1 -1
  109. package/dist/types/client/useDictionaryDynamic.d.ts +1 -1
  110. package/dist/types/client/useLocale.d.ts +6 -6
  111. package/dist/types/client/useLocale.d.ts.map +1 -1
  112. package/dist/types/index.d.ts +2 -2
  113. package/dist/types/index.d.ts.map +1 -1
  114. package/dist/types/server/useLocale.d.ts +1 -1
  115. package/dist/types/server/useLocale.d.ts.map +1 -1
  116. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"useList.mjs","names":[],"sources":["../../../../src/server/format/useList.ts"],"sourcesContent":["import { list } from '@intlayer/core/formatters';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { IntlayerServerContext } from '../IntlayerServerProvider';\nimport { getServerContext } from '../serverContext';\n\n/**\n * React server hook that provides a list formatter\n * bound to the current application locale.\n *\n * @example\n * ```tsx\n * const formatList = useList();\n *\n * formatList(['apple', 'banana', 'orange']);\n * // \"apple, banana, and orange\"\n *\n * formatList(['red', 'green', 'blue'], { type: 'disjunction' });\n * // \"red, green, or blue\"\n *\n * formatList([1, 2, 3], { type: 'unit', locale: 'de-DE' });\n * // \"1, 2 und 3\"\n * ```\n */\nexport const useList = () => {\n const locale = getServerContext<LocalesValues>(IntlayerServerContext);\n\n return (...args: Parameters<typeof list>) =>\n list(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,gBAAgB;CAC3B,MAAM,SAAS,iBAAgC,sBAAsB;AAErE,SAAQ,GAAG,SACT,KAAK,KAAK,IAAI;EACZ,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC"}
1
+ {"version":3,"file":"useList.mjs","names":[],"sources":["../../../../src/server/format/useList.ts"],"sourcesContent":["import { list } from '@intlayer/core/formatters';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { IntlayerServerContext } from '../IntlayerServerProvider';\nimport { getServerContext } from '../serverContext';\n\n/**\n * React server hook that provides a list formatter\n * bound to the current application locale.\n *\n * @example\n * ```tsx\n * const formatList = useList();\n *\n * formatList(['apple', 'banana', 'orange']);\n * // \"apple, banana, and orange\"\n *\n * formatList(['red', 'green', 'blue'], { type: 'disjunction' });\n * // \"red, green, or blue\"\n *\n * formatList([1, 2, 3], { type: 'unit', locale: 'de-DE' });\n * // \"1, 2 und 3\"\n * ```\n */\nexport const useList = () => {\n const locale = getServerContext<LocalesValues>(IntlayerServerContext);\n\n return (...args: Parameters<typeof list>) =>\n list(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,gBAAgB;CAC3B,MAAM,SAAS,iBAAgC,sBAAsB;CAErE,QAAQ,GAAG,SACT,KAAK,KAAK,IAAI;EACZ,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useNumber.mjs","names":[],"sources":["../../../../src/server/format/useNumber.ts"],"sourcesContent":["import { number } from '@intlayer/core/formatters';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { IntlayerServerContext } from '../IntlayerServerProvider';\nimport { getServerContext } from '../serverContext';\n\n/**\n * React client hook that provides a localized number formatter.\n *\n * Uses the current locale from {@link useLocaleBase} and returns\n * a function that can be used to format numbers consistently\n * according to the user's locale.\n *\n * @example\n * ```tsx\n * const formatNumber = useNumber();\n *\n * formatNumber(12345);\n * // e.g. \"12,345\" (en-US)\n * // e.g. \"12 345\" (fr-FR)\n *\n * formatNumber(0.75, { style: \"percent\" });\n * // e.g. \"75%\"\n * ```\n *\n * @returns {(value: string | number, options?: import(\"../createNumber\").NumberProps) => string}\n * A number formatting function bound to the active locale.\n */\nexport const useNumber = () => {\n const locale = getServerContext<LocalesValues>(IntlayerServerContext);\n\n return (...args: Parameters<typeof number>) =>\n number(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAa,kBAAkB;CAC7B,MAAM,SAAS,iBAAgC,sBAAsB;AAErE,SAAQ,GAAG,SACT,OAAO,KAAK,IAAI;EACd,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC"}
1
+ {"version":3,"file":"useNumber.mjs","names":[],"sources":["../../../../src/server/format/useNumber.ts"],"sourcesContent":["import { number } from '@intlayer/core/formatters';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { IntlayerServerContext } from '../IntlayerServerProvider';\nimport { getServerContext } from '../serverContext';\n\n/**\n * React client hook that provides a localized number formatter.\n *\n * Uses the current locale from {@link useLocaleBase} and returns\n * a function that can be used to format numbers consistently\n * according to the user's locale.\n *\n * @example\n * ```tsx\n * const formatNumber = useNumber();\n *\n * formatNumber(12345);\n * // e.g. \"12,345\" (en-US)\n * // e.g. \"12 345\" (fr-FR)\n *\n * formatNumber(0.75, { style: \"percent\" });\n * // e.g. \"75%\"\n * ```\n *\n * @returns {(value: string | number, options?: import(\"../createNumber\").NumberProps) => string}\n * A number formatting function bound to the active locale.\n */\nexport const useNumber = () => {\n const locale = getServerContext<LocalesValues>(IntlayerServerContext);\n\n return (...args: Parameters<typeof number>) =>\n number(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAa,kBAAkB;CAC7B,MAAM,SAAS,iBAAgC,sBAAsB;CAErE,QAAQ,GAAG,SACT,OAAO,KAAK,IAAI;EACd,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"usePercentage.mjs","names":[],"sources":["../../../../src/server/format/usePercentage.ts"],"sourcesContent":["import { percentage } from '@intlayer/core/formatters';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { IntlayerServerContext } from '../IntlayerServerProvider';\nimport { getServerContext } from '../serverContext';\n\n/**\n * React hook to provide a percentage formatter function\n * based on the current application locale.\n *\n * This hook retrieves the active locale using {@link useLocaleBase}\n * and memoizes a `createPercentage` instance for that locale.\n *\n * @example\n * ```tsx\n * const formatPercentage = usePercentage();\n *\n * const result = formatPercentage(0.875, { maximumFractionDigits: 1 });\n * // \"87.5%\" (depending on locale)\n * ```\n *\n * @returns {(value: string | number, options?: Omit<PercentageOptions, \"value\">) => string}\n * A function that formats numbers or numeric strings into localized percentages.\n */\nexport const usePercentage = () => {\n const locale = getServerContext<LocalesValues>(IntlayerServerContext);\n\n return (...args: Parameters<typeof percentage>) =>\n percentage(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,sBAAsB;CACjC,MAAM,SAAS,iBAAgC,sBAAsB;AAErE,SAAQ,GAAG,SACT,WAAW,KAAK,IAAI;EAClB,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC"}
1
+ {"version":3,"file":"usePercentage.mjs","names":[],"sources":["../../../../src/server/format/usePercentage.ts"],"sourcesContent":["import { percentage } from '@intlayer/core/formatters';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { IntlayerServerContext } from '../IntlayerServerProvider';\nimport { getServerContext } from '../serverContext';\n\n/**\n * React hook to provide a percentage formatter function\n * based on the current application locale.\n *\n * This hook retrieves the active locale using {@link useLocaleBase}\n * and memoizes a `createPercentage` instance for that locale.\n *\n * @example\n * ```tsx\n * const formatPercentage = usePercentage();\n *\n * const result = formatPercentage(0.875, { maximumFractionDigits: 1 });\n * // \"87.5%\" (depending on locale)\n * ```\n *\n * @returns {(value: string | number, options?: Omit<PercentageOptions, \"value\">) => string}\n * A function that formats numbers or numeric strings into localized percentages.\n */\nexport const usePercentage = () => {\n const locale = getServerContext<LocalesValues>(IntlayerServerContext);\n\n return (...args: Parameters<typeof percentage>) =>\n percentage(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,sBAAsB;CACjC,MAAM,SAAS,iBAAgC,sBAAsB;CAErE,QAAQ,GAAG,SACT,WAAW,KAAK,IAAI;EAClB,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useRelativeTime.mjs","names":[],"sources":["../../../../src/server/format/useRelativeTime.ts"],"sourcesContent":["import { relativeTime } from '@intlayer/core/formatters';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { IntlayerServerContext } from '../IntlayerServerProvider';\nimport { getServerContext } from '../serverContext';\n\n/**\n * Client-side React hook for accessing a localized relative time formatter.\n *\n * This hook:\n * - Reads the current locale from {@link useLocaleBase}.\n * - Creates a new relative time formatter with {@link createRelativeTime}.\n * - Returns a function that can format time differences into localized strings.\n *\n * Example:\n * ```tsx\n * const relativeTime = useRelativeTime();\n * const formatted = relativeTime(new Date(\"2024-08-01\"), new Date());\n * // e.g., \"2 weeks ago\"\n * ```\n *\n * @returns {ReturnType<typeof createRelativeTime>} A relative time formatting function\n * bound to the current client locale.\n */\nexport const useRelativeTime = () => {\n const locale = getServerContext<LocalesValues>(IntlayerServerContext);\n\n return (...args: Parameters<typeof relativeTime>) =>\n relativeTime(args[0], args[1] ?? new Date(), {\n ...args[2],\n locale: args[2]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,wBAAwB;CACnC,MAAM,SAAS,iBAAgC,sBAAsB;AAErE,SAAQ,GAAG,SACT,aAAa,KAAK,IAAI,KAAK,sBAAM,IAAI,MAAM,EAAE;EAC3C,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC"}
1
+ {"version":3,"file":"useRelativeTime.mjs","names":[],"sources":["../../../../src/server/format/useRelativeTime.ts"],"sourcesContent":["import { relativeTime } from '@intlayer/core/formatters';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { IntlayerServerContext } from '../IntlayerServerProvider';\nimport { getServerContext } from '../serverContext';\n\n/**\n * Client-side React hook for accessing a localized relative time formatter.\n *\n * This hook:\n * - Reads the current locale from {@link useLocaleBase}.\n * - Creates a new relative time formatter with {@link createRelativeTime}.\n * - Returns a function that can format time differences into localized strings.\n *\n * Example:\n * ```tsx\n * const relativeTime = useRelativeTime();\n * const formatted = relativeTime(new Date(\"2024-08-01\"), new Date());\n * // e.g., \"2 weeks ago\"\n * ```\n *\n * @returns {ReturnType<typeof createRelativeTime>} A relative time formatting function\n * bound to the current client locale.\n */\nexport const useRelativeTime = () => {\n const locale = getServerContext<LocalesValues>(IntlayerServerContext);\n\n return (...args: Parameters<typeof relativeTime>) =>\n relativeTime(args[0], args[1] ?? new Date(), {\n ...args[2],\n locale: args[2]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,wBAAwB;CACnC,MAAM,SAAS,iBAAgC,sBAAsB;CAErE,QAAQ,GAAG,SACT,aAAa,KAAK,IAAI,KAAK,sBAAM,IAAI,MAAM,EAAE;EAC3C,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useUnit.mjs","names":[],"sources":["../../../../src/server/format/useUnit.ts"],"sourcesContent":["import { units } from '@intlayer/core/formatters';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { IntlayerServerContext } from '../IntlayerServerProvider';\nimport { getServerContext } from '../serverContext';\n\n/**\n * React hook that provides a unit formatting function\n * based on the current locale from {@link useLocaleBase}.\n *\n * This hook wraps {@link createUnit} to return a formatter\n * that can convert values into human-readable localized units\n * (e.g., \"10 km\", \"5 lbs\").\n *\n * @example\n * ```tsx\n * const formatUnit = useUnit();\n * const distance = formatUnit(10, { unit: \"kilometer\" });\n * // \"10 km\" (depending on locale)\n * ```\n *\n * @returns {Function} A unit formatting function that accepts a value and optional formatting options.\n */\nexport const useUnit = () => {\n const locale = getServerContext<LocalesValues>(IntlayerServerContext);\n\n return (...args: Parameters<typeof units>) =>\n units(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,gBAAgB;CAC3B,MAAM,SAAS,iBAAgC,sBAAsB;AAErE,SAAQ,GAAG,SACT,MAAM,KAAK,IAAI;EACb,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC"}
1
+ {"version":3,"file":"useUnit.mjs","names":[],"sources":["../../../../src/server/format/useUnit.ts"],"sourcesContent":["import { units } from '@intlayer/core/formatters';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { IntlayerServerContext } from '../IntlayerServerProvider';\nimport { getServerContext } from '../serverContext';\n\n/**\n * React hook that provides a unit formatting function\n * based on the current locale from {@link useLocaleBase}.\n *\n * This hook wraps {@link createUnit} to return a formatter\n * that can convert values into human-readable localized units\n * (e.g., \"10 km\", \"5 lbs\").\n *\n * @example\n * ```tsx\n * const formatUnit = useUnit();\n * const distance = formatUnit(10, { unit: \"kilometer\" });\n * // \"10 km\" (depending on locale)\n * ```\n *\n * @returns {Function} A unit formatting function that accepts a value and optional formatting options.\n */\nexport const useUnit = () => {\n const locale = getServerContext<LocalesValues>(IntlayerServerContext);\n\n return (...args: Parameters<typeof units>) =>\n units(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,gBAAgB;CAC3B,MAAM,SAAS,iBAAgC,sBAAsB;CAErE,QAAQ,GAAG,SACT,MAAM,KAAK,IAAI;EACb,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU;EAC5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"serverContext.mjs","names":[],"sources":["../../../src/server/serverContext.tsx"],"sourcesContent":["/**\n * Creates a new datastore for a given server context.\n * Attempts to closely mimic the `createContext` API.\n *\n * @example\n * const IntlayerServer = createServerContext<string | null>(null);\n *\n * <IntlayerServer value={locale}>\n * {children}\n * </IntlayerServer>\n */\nimport react, { type FC, type PropsWithChildren, type ReactNode } from 'react';\n\ntype CacheType<T> = () => { value: T | undefined };\n\nconst cacheFallback = () => () => ({ value: undefined });\n\nexport const createServerContext = <T,>(defaultValue?: T): ServerContext<T> => {\n throwInClient();\n\n /** @ts-ignore remove error Property 'cache' does not exist on type 'typeof React'. */\n const cache = react.cache<CacheType<T>> ?? cacheFallback;\n\n const getCache = cache(() => ({\n value: undefined,\n }));\n\n const Provider: FC<PropsWithChildren<{ value?: T }>> = ({\n children,\n value,\n }) => {\n getCache().value = value;\n return children;\n };\n\n const ServerContext = Provider as ServerContext<T>;\n ServerContext.Provider = Provider;\n ServerContext.Consumer = (props) => {\n const store = getCache();\n return props.children(store ? store.value : defaultValue);\n };\n ServerContext._storage = getCache;\n ServerContext._defaultValue = defaultValue;\n\n return ServerContext;\n};\n\n/**\n * Fetches a value present in a given server context.\n * Attempts to closely mimic the `useContext` API.\n *\n * @example\n * getServerContext(IntlayerServer);\n */\nexport const getServerContext = <T,>({\n _storage,\n _defaultValue,\n}: ServerContext<T>) => {\n // throwInClient();\n const store = _storage();\n if (!store) return _defaultValue;\n return store.value;\n};\n\ntype ServerContext<T> = FC<PropsWithChildren<{ value?: T }>> & {\n Provider: FC<PropsWithChildren<{ value?: T }>>;\n Consumer: FC<\n PropsWithChildren<{ children: (context: T | undefined) => ReactNode }>\n >;\n _storage: () => { value: T | undefined };\n _defaultValue: T | undefined;\n};\n\n/**\n * Throws if called within a client component environment.\n * Useful to help prevent mistakes.\n */\nconst throwInClient = (): undefined | never => {\n // If window.document is defined we're in a client component\n if (typeof window !== 'undefined') {\n throw new Error(`createServerContext only works in Server Components`);\n }\n};\n"],"mappings":";;;;;;;;;;;;;;AAeA,MAAM,6BAA6B,EAAE,OAAO,QAAW;AAEvD,MAAa,uBAA2B,iBAAuC;AAC7E,gBAAe;CAKf,MAAM,YAFQ,MAAM,SAAuB,sBAEb,EAC5B,OAAO,QACR,EAAE;CAEH,MAAM,YAAkD,EACtD,UACA,YACI;AACJ,YAAU,CAAC,QAAQ;AACnB,SAAO;;CAGT,MAAM,gBAAgB;AACtB,eAAc,WAAW;AACzB,eAAc,YAAY,UAAU;EAClC,MAAM,QAAQ,UAAU;AACxB,SAAO,MAAM,SAAS,QAAQ,MAAM,QAAQ,aAAa;;AAE3D,eAAc,WAAW;AACzB,eAAc,gBAAgB;AAE9B,QAAO;;;;;;;;;AAUT,MAAa,oBAAwB,EACnC,UACA,oBACsB;CAEtB,MAAM,QAAQ,UAAU;AACxB,KAAI,CAAC,MAAO,QAAO;AACnB,QAAO,MAAM;;;;;;AAgBf,MAAM,sBAAyC;AAE7C,KAAI,OAAO,WAAW,YACpB,OAAM,IAAI,MAAM,sDAAsD"}
1
+ {"version":3,"file":"serverContext.mjs","names":[],"sources":["../../../src/server/serverContext.tsx"],"sourcesContent":["/**\n * Creates a new datastore for a given server context.\n * Attempts to closely mimic the `createContext` API.\n *\n * @example\n * const IntlayerServer = createServerContext<string | null>(null);\n *\n * <IntlayerServer value={locale}>\n * {children}\n * </IntlayerServer>\n */\nimport react, { type FC, type PropsWithChildren, type ReactNode } from 'react';\n\ntype CacheType<T> = () => { value: T | undefined };\n\nconst cacheFallback = () => () => ({ value: undefined });\n\nexport const createServerContext = <T,>(defaultValue?: T): ServerContext<T> => {\n throwInClient();\n\n /** @ts-ignore remove error Property 'cache' does not exist on type 'typeof React'. */\n const cache = react.cache<CacheType<T>> ?? cacheFallback;\n\n const getCache = cache(() => ({\n value: undefined,\n }));\n\n const Provider: FC<PropsWithChildren<{ value?: T }>> = ({\n children,\n value,\n }) => {\n getCache().value = value;\n return children;\n };\n\n const ServerContext = Provider as ServerContext<T>;\n ServerContext.Provider = Provider;\n ServerContext.Consumer = (props) => {\n const store = getCache();\n return props.children(store ? store.value : defaultValue);\n };\n ServerContext._storage = getCache;\n ServerContext._defaultValue = defaultValue;\n\n return ServerContext;\n};\n\n/**\n * Fetches a value present in a given server context.\n * Attempts to closely mimic the `useContext` API.\n *\n * @example\n * getServerContext(IntlayerServer);\n */\nexport const getServerContext = <T,>({\n _storage,\n _defaultValue,\n}: ServerContext<T>) => {\n // throwInClient();\n const store = _storage();\n if (!store) return _defaultValue;\n return store.value;\n};\n\ntype ServerContext<T> = FC<PropsWithChildren<{ value?: T }>> & {\n Provider: FC<PropsWithChildren<{ value?: T }>>;\n Consumer: FC<\n PropsWithChildren<{ children: (context: T | undefined) => ReactNode }>\n >;\n _storage: () => { value: T | undefined };\n _defaultValue: T | undefined;\n};\n\n/**\n * Throws if called within a client component environment.\n * Useful to help prevent mistakes.\n */\nconst throwInClient = (): undefined | never => {\n // If window.document is defined we're in a client component\n if (typeof window !== 'undefined') {\n throw new Error(`createServerContext only works in Server Components`);\n }\n};\n"],"mappings":";;;;;;;;;;;;;;AAeA,MAAM,6BAA6B,EAAE,OAAO,QAAW;AAEvD,MAAa,uBAA2B,iBAAuC;CAC7E,eAAe;CAKf,MAAM,YAFQ,MAAM,SAAuB,sBAEb,EAC5B,OAAO,QACR,EAAE;CAEH,MAAM,YAAkD,EACtD,UACA,YACI;EACJ,UAAU,CAAC,QAAQ;EACnB,OAAO;;CAGT,MAAM,gBAAgB;CACtB,cAAc,WAAW;CACzB,cAAc,YAAY,UAAU;EAClC,MAAM,QAAQ,UAAU;EACxB,OAAO,MAAM,SAAS,QAAQ,MAAM,QAAQ,aAAa;;CAE3D,cAAc,WAAW;CACzB,cAAc,gBAAgB;CAE9B,OAAO;;;;;;;;;AAUT,MAAa,oBAAwB,EACnC,UACA,oBACsB;CAEtB,MAAM,QAAQ,UAAU;CACxB,IAAI,CAAC,OAAO,OAAO;CACnB,OAAO,MAAM;;;;;;AAgBf,MAAM,sBAAyC;CAE7C,IAAI,OAAO,WAAW,aACpB,MAAM,IAAI,MAAM,sDAAsD"}
@@ -1 +1 @@
1
- {"version":3,"file":"t.mjs","names":[],"sources":["../../../src/server/t.ts"],"sourcesContent":["import { getTranslation } from '@intlayer/core/interpreter';\nimport type { DeclaredLocales, LocalesValues, StrictModeLocaleMap } from '@intlayer/types/module_augmentation';\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, L extends LocalesValues = DeclaredLocales>(\n multilangContent: StrictModeLocaleMap<Content>,\n locale?: L\n) => {\n const currentLocale = getServerContext<LocalesValues>(IntlayerServerContext);\n const localeTarget = locale ?? (currentLocale as LocalesValues);\n\n return getTranslation<Content>(multilangContent, localeTarget);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,KACX,kBACA,WACG;CACH,MAAM,gBAAgB,iBAAgC,sBAAsB;AAG5E,QAAO,eAAwB,kBAFV,UAAW,cAE8B"}
1
+ {"version":3,"file":"t.mjs","names":[],"sources":["../../../src/server/t.ts"],"sourcesContent":["import { getTranslation } from '@intlayer/core/interpreter';\nimport type { DeclaredLocales, LocalesValues, StrictModeLocaleMap } from '@intlayer/types/module_augmentation';\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, L extends LocalesValues = DeclaredLocales>(\n multilangContent: StrictModeLocaleMap<Content>,\n locale?: L\n) => {\n const currentLocale = getServerContext<LocalesValues>(IntlayerServerContext);\n const localeTarget = locale ?? (currentLocale as LocalesValues);\n\n return getTranslation<Content>(multilangContent, localeTarget);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,KACX,kBACA,WACG;CACH,MAAM,gBAAgB,iBAAgC,sBAAsB;CAG5E,OAAO,eAAwB,kBAFV,UAAW,cAE8B"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionary.mjs","names":[],"sources":["../../../src/server/useDictionary.ts"],"sourcesContent":["import type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\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 fallbackLocale?: DeclaredLocales\n) => {\n const localeTarget =\n locale ??\n getServerContext<LocalesValues>(IntlayerServerContext) ??\n fallbackLocale;\n\n return getDictionary<T, L>(dictionary, localeTarget as L);\n};\n"],"mappings":";;;;;;;;;;AAcA,MAAa,iBAIX,YACA,QACA,mBACG;AAMH,QAAO,cAAoB,YAJzB,UACA,iBAAgC,sBAAsB,IACtD,eAEuD"}
1
+ {"version":3,"file":"useDictionary.mjs","names":[],"sources":["../../../src/server/useDictionary.ts"],"sourcesContent":["import type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\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 fallbackLocale?: DeclaredLocales\n) => {\n const localeTarget =\n locale ??\n getServerContext<LocalesValues>(IntlayerServerContext) ??\n fallbackLocale;\n\n return getDictionary<T, L>(dictionary, localeTarget as L);\n};\n"],"mappings":";;;;;;;;;;AAcA,MAAa,iBAIX,YACA,QACA,mBACG;CAMH,OAAO,cAAoB,YAJzB,UACA,iBAAgC,sBAAsB,IACtD,eAEuD"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionaryAsync.mjs","names":[],"sources":["../../../src/server/useDictionaryAsync.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\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 fallbackLocale?: DeclaredLocales\n) => {\n const localeTarget =\n locale ??\n getServerContext<LocalesValues>(IntlayerServerContext) ??\n fallbackLocale ??\n 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,QACA,mBACG;CACH,MAAM,eACJ,UACA,iBAAgC,sBAAsB,IACtD,kBACA,qBAAqB;AAIvB,QAAO,cAAoB,MAFD,kBAA0B,iBAAiB,EAE9B,aAAkB"}
1
+ {"version":3,"file":"useDictionaryAsync.mjs","names":[],"sources":["../../../src/server/useDictionaryAsync.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\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 fallbackLocale?: DeclaredLocales\n) => {\n const localeTarget =\n locale ??\n getServerContext<LocalesValues>(IntlayerServerContext) ??\n fallbackLocale ??\n 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,QACA,mBACG;CACH,MAAM,eACJ,UACA,iBAAgC,sBAAsB,IACtD,kBACA,qBAAqB;CAIvB,OAAO,cAAoB,MAFD,kBAA0B,iBAAiB,EAE9B,aAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionaryDynamic.mjs","names":[],"sources":["../../../src/server/useDictionaryDynamic.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\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 fallbackLocale?: DeclaredLocales\n) => {\n const localeTarget =\n locale ??\n getServerContext<LocalesValues>(IntlayerServerContext) ??\n fallbackLocale ??\n 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,QACA,mBACG;CACH,MAAM,eACJ,UACA,iBAAgC,sBAAsB,IACtD,kBACA,qBAAqB;AAOvB,QAAO,cALY,eACjB,GAAG,OAAO,IAAI,CAAC,GAAG,gBACjB,kBAA0B,iBAAiB,CAGT,EAAE,aAAkB"}
1
+ {"version":3,"file":"useDictionaryDynamic.mjs","names":[],"sources":["../../../src/server/useDictionaryDynamic.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\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 fallbackLocale?: DeclaredLocales\n) => {\n const localeTarget =\n locale ??\n getServerContext<LocalesValues>(IntlayerServerContext) ??\n fallbackLocale ??\n 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,QACA,mBACG;CACH,MAAM,eACJ,UACA,iBAAgC,sBAAsB,IACtD,kBACA,qBAAqB;CAOvB,OAAO,cALY,eACjB,GAAG,OAAO,IAAI,CAAC,GAAG,gBACjB,kBAA0B,iBAAiB,CAGT,EAAE,aAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"useI18n.mjs","names":[],"sources":["../../../src/server/useI18n.ts"],"sourcesContent":["import type { ValidDotPathsFor } from '@intlayer/core/transpiler';\nimport type { DictionaryKeys, DictionaryRegistryContent, LocalesValues } from '@intlayer/types/module_augmentation';\nimport type { GetSubPath } from '@intlayer/types/dictionary';\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":";;;;;;;;;;;;;;;;;;;;AAuBA,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,IAAI,UAAe;AAEnB,OAAK,MAAM,OAAO,WAAW;AAC3B,aAAU,UAAU;AACpB,OAAI,YAAY,OAEd,QAAO;;AAIX,SAAO;;AAGT,QAAO"}
1
+ {"version":3,"file":"useI18n.mjs","names":[],"sources":["../../../src/server/useI18n.ts"],"sourcesContent":["import type { ValidDotPathsFor } from '@intlayer/core/transpiler';\nimport type { DictionaryKeys, DictionaryRegistryContent, LocalesValues } from '@intlayer/types/module_augmentation';\nimport type { GetSubPath } from '@intlayer/types/dictionary';\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":";;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,WACX,WACA,WACG;CAKH,MAAM,oBAAoB,YAAY,WAHpC,UAAU,iBAAgC,sBAAsB,CAGJ;CAI9D,MAAM,KACJ,SACsE;EACtE,IAAI,CAAC,MACH,OAAO;EAGT,MAAM,YAAa,KAAgB,MAAM,IAAI;EAC7C,IAAI,UAAe;EAEnB,KAAK,MAAM,OAAO,WAAW;GAC3B,UAAU,UAAU;GACpB,IAAI,YAAY,QAEd,OAAO;;EAIX,OAAO;;CAGT,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"useIntlayer.mjs","names":[],"sources":["../../../src/server/useIntlayer.ts"],"sourcesContent":["import type { DeclaredLocales, DictionaryKeys, LocalesValues } from '@intlayer/types/module_augmentation';\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 = <\n T extends DictionaryKeys,\n L extends LocalesValues = DeclaredLocales,\n>(\n key: T,\n locale?: L,\n fallbackLocale?: DeclaredLocales\n) => {\n const localeTarget =\n locale ??\n getServerContext<LocalesValues>(IntlayerServerContext) ??\n fallbackLocale;\n\n return getIntlayer<T, L>(key, localeTarget as L);\n};\n"],"mappings":";;;;;;;;;;AAUA,MAAa,eAIX,KACA,QACA,mBACG;AAMH,QAAO,YAAkB,KAJvB,UACA,iBAAgC,sBAAsB,IACtD,eAE8C"}
1
+ {"version":3,"file":"useIntlayer.mjs","names":[],"sources":["../../../src/server/useIntlayer.ts"],"sourcesContent":["import type { DeclaredLocales, DictionaryKeys, LocalesValues } from '@intlayer/types/module_augmentation';\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 = <\n T extends DictionaryKeys,\n L extends LocalesValues = DeclaredLocales,\n>(\n key: T,\n locale?: L,\n fallbackLocale?: DeclaredLocales\n) => {\n const localeTarget =\n locale ??\n getServerContext<LocalesValues>(IntlayerServerContext) ??\n fallbackLocale;\n\n return getIntlayer<T, L>(key, localeTarget as L);\n};\n"],"mappings":";;;;;;;;;;AAUA,MAAa,eAIX,KACA,QACA,mBACG;CAMH,OAAO,YAAkB,KAJvB,UACA,iBAAgC,sBAAsB,IACtD,eAE8C"}
@@ -1 +1 @@
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,cAEZ"}
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;CAK9D,OAFmB,MAAM,IAAI,cAEZ"}
@@ -1 +1 @@
1
- {"version":3,"file":"useLocale.mjs","names":[],"sources":["../../../src/server/useLocale.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\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 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,wBAAwB,EAAE;AAK5B,QAAO;EAAE,QAHO,iBAAiB,sBAAsB,IACrD;EAEe;EAAe;EAAkB"}
1
+ {"version":3,"file":"useLocale.mjs","names":[],"sources":["../../../src/server/useLocale.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { IntlayerServerContext } from './IntlayerServerProvider';\nimport { getServerContext } from './serverContext';\n\nexport type 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 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,wBAAwB,EAAE;CAK5B,OAAO;EAAE,QAHO,iBAAiB,sBAAsB,IACrD;EAEe;EAAe;EAAkB"}
@@ -9,7 +9,7 @@ import { Dictionary } from "@intlayer/types/dictionary";
9
9
  *
10
10
  * If the locale is not provided, it will use the locale from the client context
11
11
  */
12
- declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => _$_intlayer_core_interpreter0.DeepTransformContent<T["content"], IInterpreterPluginState$1, "tr" | "th" | "hr" | "id" | "is" | "af" | "af-ZA" | "sq" | "sq-AL" | "am" | "am-ET" | "ar" | "ar-DZ" | "ar-BH" | "ar-TD" | "ar-KM" | "ar-DJ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MR" | "ar-MA" | "ar-OM" | "ar-PS" | "ar-QA" | "ar-SA" | "ar-SO" | "ar-SD" | "ar-SY" | "ar-TN" | "ar-AE" | "ar-YE" | "hy" | "hy-AM" | "az" | "az-AZ" | "eu" | "eu-ES" | "be" | "be-BY" | "bn" | "bn-BD" | "bn-IN" | "bn-MM" | "bs" | "bs-BA" | "bg" | "bg-BG" | "my" | "my-MM" | "ca" | "ca-ES" | "zh" | "zh-HK" | "zh-MO" | "zh-Hans" | "zh-CN" | "zh-SG" | "zh-TW" | "zh-Hant" | "hr-BA" | "hr-HR" | "cs" | "cs-CZ" | "da" | "da-DK" | "dv" | "dv-MV" | "nl" | "nl-BE" | "nl-NL" | "en" | "en-AU" | "en-BZ" | "en-BW" | "en-CA" | "en-CB" | "en-GH" | "en-HK" | "en-IN" | "en-IE" | "en-JM" | "en-KE" | "en-MY" | "en-NZ" | "en-NG" | "en-PK" | "en-PH" | "en-SG" | "en-ZA" | "en-TZ" | "en-TT" | "en-UG" | "en-GB" | "en-US" | "en-ZW" | "eo" | "et" | "et-EE" | "fo" | "fo-FO" | "fa" | "fa-IR" | "fi" | "fi-FI" | "fr" | "fr-BE" | "fr-CA" | "fr-FR" | "fr-LU" | "fr-MC" | "fr-CH" | "mk" | "mk-MK" | "gl" | "gl-ES" | "ka" | "ka-GE" | "de" | "de-AT" | "de-DE" | "de-LI" | "de-LU" | "de-CH" | "el" | "el-GR" | "gu" | "gu-IN" | "he" | "he-IL" | "hi" | "hi-IN" | "hu" | "hu-HU" | "is-IS" | "id-ID" | "ga" | "ga-IE" | "it" | "it-IT" | "it-CH" | "ja" | "ja-JP" | "kn" | "kn-IN" | "kk" | "kk-KZ" | "km" | "km-KH" | "kok" | "kok-IN" | "ko" | "ko-KR" | "ku" | "ku-TR" | "ky" | "ky-KG" | "lo" | "lo-LA" | "lv" | "lv-LV" | "lt" | "lt-LT" | "dsb" | "dsb-DE" | "mg-MG" | "ms" | "ml" | "ml-IN" | "ms-BN" | "ms-MY" | "mt" | "mt-MT" | "mi" | "mi-NZ" | "mr" | "mr-IN" | "mn" | "mn-MN" | "ne" | "ne-NP" | "ns" | "ns-ZA" | "no" | "nb" | "nb-NO" | "nn" | "nn-NO" | "ps" | "ps-AR" | "pl" | "pl-PL" | "pt" | "pt-BR" | "pt-CV" | "pt-GW" | "pt-MO" | "pt-MZ" | "pt-PT" | "pt-ST" | "pt-TL" | "pa" | "pa-IN" | "qu" | "qu-BO" | "qu-EC" | "qu-PE" | "ro" | "ro-MD" | "ro-RO" | "rm" | "rm-CH" | "ru" | "ru-MD" | "ru-RU" | "se" | "se-FI" | "se-NO" | "se-SE" | "sa" | "sa-IN" | "gd" | "gd-GB" | "sr-Cyrl" | "sr-BA" | "sr-RS" | "sr" | "sr-SP" | "si" | "si-LK" | "sk" | "sk-SK" | "sl" | "sl-SI" | "es" | "es-AR" | "es-BO" | "es-CL" | "es-CO" | "es-CR" | "es-CU" | "es-DO" | "es-EC" | "es-SV" | "es-GT" | "es-HN" | "es-MX" | "es-NI" | "es-PA" | "es-PY" | "es-PE" | "es-PR" | "es-ES" | "es-US" | "es-UY" | "es-VE" | "sw" | "sw-KE" | "sv" | "sv-FI" | "sv-SE" | "syr" | "syr-SY" | "tl" | "tl-PH" | "ta" | "ta-IN" | "tt" | "tt-RU" | "te" | "te-IN" | "th-TH" | "ts" | "tn" | "tn-ZA" | "tr-TR" | "uk" | "uk-UA" | "hsb" | "hsb-DE" | "ur" | "ur-PK" | "uz" | "uz-UZ" | "ve" | "ve-ZA" | "vi" | "vi-VN" | "cy" | "cy-GB" | "xh" | "xh-ZA" | "yi" | "yi-001" | "yo" | "yo-NG" | "zu" | "zu-ZA" | (string & {})>;
12
+ declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => _$_intlayer_core_interpreter0.DeepTransformContent<T["content"], IInterpreterPluginState$1, "af" | "af-ZA" | "sq" | "sq-AL" | "am" | "am-ET" | "ar" | "ar-DZ" | "ar-BH" | "ar-TD" | "ar-KM" | "ar-DJ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MR" | "ar-MA" | "ar-OM" | "ar-PS" | "ar-QA" | "ar-SA" | "ar-SO" | "ar-SD" | "ar-SY" | "ar-TN" | "ar-AE" | "ar-YE" | "hy" | "hy-AM" | "az" | "az-AZ" | "eu" | "eu-ES" | "be" | "be-BY" | "bn" | "bn-BD" | "bn-IN" | "bn-MM" | "bs" | "bs-BA" | "bg" | "bg-BG" | "my" | "my-MM" | "ca" | "ca-ES" | "zh" | "zh-HK" | "zh-MO" | "zh-Hans" | "zh-CN" | "zh-SG" | "zh-TW" | "zh-Hant" | "hr" | "hr-BA" | "hr-HR" | "cs" | "cs-CZ" | "da" | "da-DK" | "dv" | "dv-MV" | "nl" | "nl-BE" | "nl-NL" | "en" | "en-AU" | "en-BZ" | "en-BW" | "en-CA" | "en-CB" | "en-GH" | "en-HK" | "en-IN" | "en-IE" | "en-JM" | "en-KE" | "en-MY" | "en-NZ" | "en-NG" | "en-PK" | "en-PH" | "en-SG" | "en-ZA" | "en-TZ" | "en-TT" | "en-UG" | "en-GB" | "en-US" | "en-ZW" | "eo" | "et" | "et-EE" | "fo" | "fo-FO" | "fa" | "fa-IR" | "fi" | "fi-FI" | "fr" | "fr-BE" | "fr-CA" | "fr-FR" | "fr-LU" | "fr-MC" | "fr-CH" | "mk" | "mk-MK" | "gl" | "gl-ES" | "ka" | "ka-GE" | "de" | "de-AT" | "de-DE" | "de-LI" | "de-LU" | "de-CH" | "el" | "el-GR" | "gu" | "gu-IN" | "he" | "he-IL" | "hi" | "hi-IN" | "hu" | "hu-HU" | "is" | "is-IS" | "id" | "id-ID" | "ga" | "ga-IE" | "it" | "it-IT" | "it-CH" | "ja" | "ja-JP" | "kn" | "kn-IN" | "kk" | "kk-KZ" | "km" | "km-KH" | "kok" | "kok-IN" | "ko" | "ko-KR" | "ku" | "ku-TR" | "ky" | "ky-KG" | "lo" | "lo-LA" | "lv" | "lv-LV" | "lt" | "lt-LT" | "dsb" | "dsb-DE" | "mg-MG" | "ms" | "ml" | "ml-IN" | "ms-BN" | "ms-MY" | "mt" | "mt-MT" | "mi" | "mi-NZ" | "mr" | "mr-IN" | "mn" | "mn-MN" | "ne" | "ne-NP" | "ns" | "ns-ZA" | "no" | "nb" | "nb-NO" | "nn" | "nn-NO" | "ps" | "ps-AR" | "pl" | "pl-PL" | "pt" | "pt-BR" | "pt-CV" | "pt-GW" | "pt-MO" | "pt-MZ" | "pt-PT" | "pt-ST" | "pt-TL" | "pa" | "pa-IN" | "qu" | "qu-BO" | "qu-EC" | "qu-PE" | "ro" | "ro-MD" | "ro-RO" | "rm" | "rm-CH" | "ru" | "ru-MD" | "ru-RU" | "se" | "se-FI" | "se-NO" | "se-SE" | "sa" | "sa-IN" | "gd" | "gd-GB" | "sr-Cyrl" | "sr-BA" | "sr-RS" | "sr" | "sr-SP" | "si" | "si-LK" | "sk" | "sk-SK" | "sl" | "sl-SI" | "es" | "es-AR" | "es-BO" | "es-CL" | "es-CO" | "es-CR" | "es-CU" | "es-DO" | "es-EC" | "es-SV" | "es-GT" | "es-HN" | "es-MX" | "es-NI" | "es-PA" | "es-PY" | "es-PE" | "es-PR" | "es-ES" | "es-US" | "es-UY" | "es-VE" | "sw" | "sw-KE" | "sv" | "sv-FI" | "sv-SE" | "syr" | "syr-SY" | "tl" | "tl-PH" | "ta" | "ta-IN" | "tt" | "tt-RU" | "te" | "te-IN" | "th" | "th-TH" | "ts" | "tn" | "tn-ZA" | "tr" | "tr-TR" | "uk" | "uk-UA" | "hsb" | "hsb-DE" | "ur" | "ur-PK" | "uz" | "uz-UZ" | "ve" | "ve-ZA" | "vi" | "vi-VN" | "cy" | "cy-GB" | "xh" | "xh-ZA" | "yi" | "yi-001" | "yo" | "yo-NG" | "zu" | "zu-ZA" | (string & {})>;
13
13
  //#endregion
14
14
  export { useDictionaryDynamic };
15
15
  //# sourceMappingURL=useDictionaryDynamic.d.ts.map
@@ -1,14 +1,14 @@
1
- import { LocalesValues } from "@intlayer/types/module_augmentation";
1
+ import { DeclaredLocales, LocalesValues } from "@intlayer/types/module_augmentation";
2
2
 
3
3
  //#region src/client/useLocale.d.ts
4
4
  type UseLocaleProps = {
5
5
  isCookieEnabled?: boolean;
6
- onLocaleChange?: (locale: LocalesValues) => void;
6
+ onLocaleChange?: (locale: DeclaredLocales) => void;
7
7
  };
8
8
  type UseLocaleResult = {
9
- locale: LocalesValues;
10
- defaultLocale: LocalesValues;
11
- availableLocales: LocalesValues[];
9
+ locale: DeclaredLocales;
10
+ defaultLocale: DeclaredLocales;
11
+ availableLocales: DeclaredLocales[];
12
12
  setLocale: (locale: LocalesValues) => void;
13
13
  };
14
14
  /**
@@ -39,5 +39,5 @@ declare const useLocale: ({
39
39
  onLocaleChange
40
40
  }?: UseLocaleProps) => UseLocaleResult;
41
41
  //#endregion
42
- export { useLocale };
42
+ export { UseLocaleProps, UseLocaleResult, useLocale };
43
43
  //# sourceMappingURL=useLocale.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLocale.d.ts","names":[],"sources":["../../../src/client/useLocale.ts"],"mappings":";;;KAWK,cAAA;EACH,eAAA;EACA,cAAA,IAAkB,MAAA,EAAQ,aAAA;AAAA;AAAA,KAGvB,eAAA;EACH,MAAA,EAAQ,aAAA;EACR,aAAA,EAAe,aAAA;EACf,gBAAA,EAAkB,aAAA;EAClB,SAAA,GAAY,MAAA,EAAQ,aAAA;AAAA;;;AAPmB;;;;;;;;;;;;;;;;;;;;AAiCzC;cAAa,SAAA;EAAa,eAAA;EAAA;AAAA,IAGvB,cAAA,KAAsB,eAAA"}
1
+ {"version":3,"file":"useLocale.d.ts","names":[],"sources":["../../../src/client/useLocale.ts"],"mappings":";;;KAWY,cAAA;EACV,eAAA;EACA,cAAA,IAAkB,MAAA,EAAQ,eAAA;AAAA;AAAA,KAGhB,eAAA;EACV,MAAA,EAAQ,eAAA;EACR,aAAA,EAAe,eAAA;EACf,gBAAA,EAAkB,eAAA;EAClB,SAAA,GAAY,MAAA,EAAQ,aAAA;AAAA;;;AAJtB;;;;;;;;;;;;;;;;;;;;AA8BA;cAAa,SAAA;EAAa,eAAA;EAAA;AAAA,IAGvB,cAAA,KAAsB,eAAA"}
@@ -10,7 +10,7 @@ import { useDictionaryDynamic } from "./client/useDictionaryDynamic.js";
10
10
  import { useI18n } from "./client/useI18n.js";
11
11
  import { useIntlayer } from "./client/useIntlayer.js";
12
12
  import { useLoadDynamic } from "./client/useLoadDynamic.js";
13
- import { useLocale } from "./client/useLocale.js";
13
+ import { UseLocaleProps, UseLocaleResult, useLocale } from "./client/useLocale.js";
14
14
  import { useLocaleBase } from "./client/useLocaleBase.js";
15
15
  import { localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, useLocaleCookie, useLocaleStorage } from "./client/useLocaleStorage.js";
16
16
  import { useRewriteURL } from "./client/useRewriteURL.js";
@@ -84,5 +84,5 @@ type RenderMarkdownProps = RenderMarkdownProps$1;
84
84
  */
85
85
  type MarkdownRendererProps = MarkdownRendererProps$1;
86
86
  //#endregion
87
- export { IntlayerClientContext, type IntlayerNode, IntlayerProvider, IntlayerProviderContent, type IntlayerProviderProps, MarkdownProvider, MarkdownProviderOptions, MarkdownRenderer, MarkdownRendererProps, RenderMarkdownProps, getDictionary, getIntlayer, localeCookie, localeInStorage, renderMarkdown, setLocaleCookie, setLocaleInStorage, t, useDictionary, useDictionaryAsync, useDictionaryDynamic, useI18n, useIntl, useIntlayer, useIntlayerContext, useLoadDynamic, useLocale, useLocaleBase, useLocaleCookie, useLocaleStorage, useMarkdownContext, useMarkdownRenderer, useRewriteURL };
87
+ export { IntlayerClientContext, type IntlayerNode, IntlayerProvider, IntlayerProviderContent, type IntlayerProviderProps, MarkdownProvider, MarkdownProviderOptions, MarkdownRenderer, MarkdownRendererProps, RenderMarkdownProps, type UseLocaleProps, type UseLocaleResult, getDictionary, getIntlayer, localeCookie, localeInStorage, renderMarkdown, setLocaleCookie, setLocaleInStorage, t, useDictionary, useDictionaryAsync, useDictionaryDynamic, useI18n, useIntl, useIntlayer, useIntlayerContext, useLoadDynamic, useLocale, useLocaleBase, useLocaleCookie, useLocaleStorage, useMarkdownContext, useMarkdownRenderer, useRewriteURL };
88
88
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;YAIY,kBAAA,iBAAmC,aAAA,UACnC,uBAAA,CAAwB,CAAA,EAAG,CAAA,EAAG,CAAA;AAAA;;;;AAJe;;;AAAA,cAwD5C,gBAAA,UAAgB,EAAA,CAAA,yBAAA;eAAA,cAAA;;gDAtBX,yBAAA,EAAA,UAAA,GAAA,cAAA,oBAEZ,OAAA,GACN,OAAA,CAAA,EAAA,CAAA,OAAA,CAAA,cAAA,CAAA,WAAA,OAAA,OAAA,CAAA,SAAA,GAAA,OAAA,CAAA,OAAA,CAAA,SAAA;AAAA;aAAA,OAAA,CAAA,SAAA;AAAA;;;;cAuBa,kBAAA;eAAwC,cAAA;+CAtCP,yBAAA,EAAA,UAAA,GAAA,cAAA,oBAC5B,OAAA,GACI,OAAA,CAAA,EAAA,CAAA,OAAA,CAAA,cAAA,CAAA,WAAA,OAAA,OAAA,CAAA,SAAA,GAAA,OAAA,CAAA,OAAA,CAAA,SAAA;AAAA;;;;KAwCV,uBAAA,GAA0B,yBAAA;;AARtC;;cAYa,cAAA,GAAc,OAAA;EAAA,UAAA;EAAA,OAAA;EAAA,UAAA;EAAA,WAAA;EAAA,mBAAA;EAAA;AAAA,IAAA,qBAAA,KAAA,OAAA,CAAA,GAAA,CAAA,OAAA;;;;cAId,mBAAA;EAAmB,UAAA;EAAA,OAAA;EAAA,UAAA;EAAA,WAAA;EAAA,mBAAA;EAAA;AAAA,IAAA,qBAAA,MAa44C,OAAA,kDAAe,QAAA,CAb35C,OAAA,CAa25C,SAAA,IAAA,OAAA,CAAA,OAAA,CAAA,SAAA,IAAA,OAAA,CAAA,GAAA,CAAA,OAAA;;;;cAT96C,gBAAA,EAAgB,OAAA,CAAA,EAAA,CAAA,uBAAA;;;;KAIjB,mBAAA,GAAsB,qBAAA;;;;KAItB,qBAAA,GAAwB,uBAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;YAIY,kBAAA,iBAAmC,aAAA,UACnC,uBAAA,CAAwB,CAAA,EAAG,CAAA,EAAG,CAAA;AAAA;;;;AAJe;;;AAAA,cA4D5C,gBAAA,UAAgB,EAAA,CAAA,yBAAA;eAAA,cAAA;;gDAxBpB,yBAAA,EAAA,UAAA,GAAA,cAAA,oBAEG,OAAA,GAEN,OAAA,CAAA,EAAA,CAAA,OAAA,CAAA,cAAA,CAAA,WAAA,OAAA,OAAA,CAAA,SAAA,GAAA,OAAA,CAAA,OAAA,CAAA,SAAA;AAAA;aAAA,OAAA,CAAA,SAAA;AAAA;;;;cAwBO,kBAAA;eAAwC,cAAA;+CA1CP,yBAAA,EAAA,UAAA,GAAA,cAAA,oBAC5B,OAAA,GACI,OAAA,CAAA,EAAA,CAAA,OAAA,CAAA,cAAA,CAAA,WAAA,OAAA,OAAA,CAAA,SAAA,GAAA,OAAA,CAAA,OAAA,CAAA,SAAA;AAAA;;;;KA4CV,uBAAA,GAA0B,yBAAA;;AARtC;;cAYa,cAAA,GAAc,OAAA;EAAA,UAAA;EAAA,OAAA;EAAA,UAAA;EAAA,WAAA;EAAA,mBAAA;EAAA;AAAA,IAAA,qBAAA,KAAA,OAAA,CAAA,GAAA,CAAA,OAAA;;;;cAId,mBAAA;EAAmB,UAAA;EAAA,OAAA;EAAA,UAAA;EAAA,WAAA;EAAA,mBAAA;EAAA;AAAA,IAAA,qBAAA,MAa01C,OAAA,kDAAe,QAAA,CAbz2C,OAAA,CAay2C,SAAA,IAAA,OAAA,CAAA,OAAA,CAAA,SAAA,IAAA,OAAA,CAAA,GAAA,CAAA,OAAA;;;;cAT53C,gBAAA,EAAgB,OAAA,CAAA,EAAA,CAAA,uBAAA;;;;KAIjB,mBAAA,GAAsB,qBAAA;;;;KAItB,qBAAA,GAAwB,uBAAA"}
@@ -13,5 +13,5 @@ type UseLocaleResult = {
13
13
  */
14
14
  declare const useLocale: () => UseLocaleResult;
15
15
  //#endregion
16
- export { useLocale };
16
+ export { UseLocaleResult, useLocale };
17
17
  //# sourceMappingURL=useLocale.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLocale.d.ts","names":[],"sources":["../../../src/server/useLocale.ts"],"mappings":";;;KAKK,eAAA;EACH,MAAA,EAAQ,eAAA;EACR,aAAA,EAAe,eAAA;EACf,gBAAA,EAAkB,eAAA;AAAA;;;;;;cAQP,SAAA,QAAgB,eAAA"}
1
+ {"version":3,"file":"useLocale.d.ts","names":[],"sources":["../../../src/server/useLocale.ts"],"mappings":";;;KAKY,eAAA;EACV,MAAA,EAAQ,eAAA;EACR,aAAA,EAAe,eAAA;EACf,gBAAA,EAAkB,eAAA;AAAA;;;;;;cAQP,SAAA,QAAgB,eAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-intlayer",
3
- "version": "8.9.2",
3
+ "version": "8.9.4-canary.0",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your React applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -123,25 +123,25 @@
123
123
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
124
124
  },
125
125
  "dependencies": {
126
- "@intlayer/api": "8.9.2",
127
- "@intlayer/config": "8.9.2",
128
- "@intlayer/core": "8.9.2",
129
- "@intlayer/dictionaries-entry": "8.9.2",
130
- "@intlayer/editor": "8.9.2",
131
- "@intlayer/editor-react": "8.9.2",
132
- "@intlayer/types": "8.9.2"
126
+ "@intlayer/api": "8.9.4-canary.0",
127
+ "@intlayer/config": "8.9.4-canary.0",
128
+ "@intlayer/core": "8.9.4-canary.0",
129
+ "@intlayer/dictionaries-entry": "8.9.4-canary.0",
130
+ "@intlayer/editor": "8.9.4-canary.0",
131
+ "@intlayer/editor-react": "8.9.4-canary.0",
132
+ "@intlayer/types": "8.9.4-canary.0"
133
133
  },
134
134
  "devDependencies": {
135
135
  "@craco/types": "7.1.0",
136
136
  "@testing-library/react": "16.3.2",
137
- "@types/node": "25.6.0",
137
+ "@types/node": "25.6.2",
138
138
  "@types/react": ">=16.0.0",
139
139
  "@types/react-dom": ">=16.0.0",
140
140
  "@utils/ts-config": "1.0.4",
141
141
  "@utils/ts-config-types": "1.0.4",
142
142
  "@utils/tsdown-config": "1.0.4",
143
143
  "rimraf": "6.1.3",
144
- "tsdown": "0.21.10",
144
+ "tsdown": "0.22.00",
145
145
  "typescript": "6.0.3",
146
146
  "vitest": "4.1.5"
147
147
  },