@intlayer/use-intl 9.5.0 → 9.5.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.
@@ -1,6 +1,6 @@
1
1
  import { Fragment } from "react";
2
2
  import { getIntlayer } from "@intlayer/core/interpreter";
3
- import { navigatePath, navigatePath as navigatePath$1, parseTaggedMessage, resolveMessage } from "@intlayer/core/messageFormat";
3
+ import { navigatePath, navigatePath as navigatePath$1, parseTaggedMessage, resolveMessageNodeToString } from "@intlayer/core/messageFormat";
4
4
  import { getDictionaries } from "@intlayer/dictionaries-entry";
5
5
  import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
6
6
 
@@ -106,7 +106,7 @@ const createLookupTranslator = (locale, lookup, missingKeyFallback) => {
106
106
  const resolveToString = (key, values = {}) => {
107
107
  const rawValue = lookup(key);
108
108
  if (rawValue === null || rawValue === void 0) return void 0;
109
- return resolveMessage(rawValue, values, locale, "icu");
109
+ return resolveMessageNodeToString(rawValue, values, locale);
110
110
  };
111
111
  const translate = (key, values) => resolveToString(key, values) ?? missingKeyFallback(key);
112
112
  return Object.assign(translate, {
@@ -1 +1 @@
1
- {"version":3,"file":"namespaceTranslator.mjs","names":["navigatePath"],"sources":["../../../src/shared/namespaceTranslator.tsx"],"sourcesContent":["import { getIntlayer } from '@intlayer/core/interpreter';\nimport {\n type MessageValues,\n navigatePath,\n parseTaggedMessage,\n resolveMessage,\n type TaggedMessageToken,\n} from '@intlayer/core/messageFormat';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\nimport type {\n DictionaryKeys,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { Fragment, type ReactNode } from 'react';\n\nexport { navigatePath } from '@intlayer/core/messageFormat';\n\n/** Chunk renderer used by `t.rich()` — maps tag children to a React node. */\nexport type RichChunkRenderer = (chunks: ReactNode) => ReactNode;\n\n/** Chunk renderer used by `t.markup()` — maps tag children to a string. */\nexport type MarkupChunkRenderer = (chunks: string) => string;\n\n/** Splits rich values into scalar interpolation values and tag renderers. */\nconst splitRichValues = (\n values: Record<string, unknown> = {}\n): { scalarValues: MessageValues; renderers: Record<string, unknown> } => {\n const scalarValues: MessageValues = {};\n const renderers: Record<string, unknown> = {};\n\n for (const [valueKey, value] of Object.entries(values)) {\n if (typeof value === 'function') renderers[valueKey] = value;\n else scalarValues[valueKey] = value;\n }\n\n return { scalarValues, renderers };\n};\n\nconst renderRichTokens = (\n tokens: TaggedMessageToken[],\n renderers: Record<string, unknown>\n): ReactNode[] =>\n tokens.map((token, tokenIndex) => {\n if (typeof token === 'string') return token;\n\n const children = renderRichTokens(token.children, renderers);\n const renderer = renderers[token.tag];\n\n if (typeof renderer === 'function') {\n return (\n <Fragment key={tokenIndex}>\n {(renderer as RichChunkRenderer)(children)}\n </Fragment>\n );\n }\n\n // No renderer provided for the tag — render its children unwrapped\n return <Fragment key={tokenIndex}>{children}</Fragment>;\n });\n\nconst renderMarkupTokens = (\n tokens: TaggedMessageToken[],\n renderers: Record<string, unknown>\n): string =>\n tokens\n .map((token) => {\n if (typeof token === 'string') return token;\n\n const children = renderMarkupTokens(token.children, renderers);\n const renderer = renderers[token.tag];\n\n if (typeof renderer === 'function') {\n return (renderer as MarkupChunkRenderer)(children);\n }\n\n return children;\n })\n .join('');\n\n/**\n * The untyped runtime translator shared by `useTranslations` (React hook) and\n * `createTranslator` (non-React core).\n *\n * Behaviour matches use-intl / next-intl:\n * - namespace `'about'` → keys resolved inside the `about` dictionary\n * - namespace `'about.counter'` → dictionary `about`, key prefix `counter`\n * - no namespace → the first segment of each key is the dictionary key\n * - messages support ICU syntax (plural, select, `#`, formatted arguments)\n * - `t.rich` / `t.markup` map `<tag>chunks</tag>` through the provided\n * renderers; `t.raw` returns the raw value; `t.has` checks existence\n *\n * @param locale - The locale dictionaries are resolved for.\n * @param namespace - Optional dictionary key, optionally with a nested scope.\n * @returns A translate function augmented with `has`, `raw`, `rich`, `markup`.\n */\nexport const createNamespaceTranslator = (\n locale: LocalesValues,\n namespace?: string\n) => {\n const [dictionaryKey, ...prefixSegments] = (namespace ?? '').split('.');\n const keyPrefix = prefixSegments.join('.');\n\n const lookup = (lookupKey: string): unknown =>\n lookupNamespaceKey(locale, dictionaryKey ?? '', keyPrefix, lookupKey);\n\n return createLookupTranslator(locale, lookup, (key) =>\n namespace ? `${namespace}.${key}` : key\n );\n};\n\n/**\n * Key-based lookup used by {@link createNamespaceTranslator}: resolves the\n * dictionary through the runtime registry (`getIntlayer`).\n */\nconst lookupNamespaceKey = (\n locale: LocalesValues,\n dictionaryKey: string,\n keyPrefix: string,\n key: string\n): unknown => {\n let targetDictionaryKey = dictionaryKey;\n let path = keyPrefix ? `${keyPrefix}.${key}` : key;\n\n const dictionaries = getDictionaries();\n\n if (!targetDictionaryKey) {\n // Root scope — the first key segment usually designates the dictionary\n const [firstSegment, ...restSegments] = key.split('.');\n targetDictionaryKey = firstSegment ?? key;\n path = restSegments.join('.');\n\n // If the assumed dictionary doesn't exist, we must fall back to searching all dictionaries.\n // This supports apps migrating from standard next-intl where all messages were grouped together.\n if (!dictionaries[targetDictionaryKey as DictionaryKeys]) {\n for (const dictKey of Object.keys(dictionaries)) {\n try {\n const dictionary = getIntlayer(dictKey as DictionaryKeys, locale);\n const result = navigatePath(dictionary, key);\n if (result !== undefined) {\n return result;\n }\n } catch {\n // Ignore if getIntlayer throws\n }\n }\n }\n }\n\n try {\n const dictionary = getIntlayer(\n targetDictionaryKey as DictionaryKeys,\n locale\n );\n return navigatePath(dictionary, path);\n } catch {\n return undefined;\n }\n};\n\n/**\n * Dictionary-bound translator used by the build-optimized `useDictionary` /\n * `getDictionary` variants: instead of resolving the dictionary by key at\n * runtime, the pre-resolved content is supplied directly (the babel/swc\n * optimize pass imports the dictionary JSON at build time).\n *\n * @param locale - The locale messages are resolved for.\n * @param content - The dictionary content, already resolved for `locale`.\n * @param namespacePrefix - Optional key prefix for nested namespaces\n * (`useTranslations('about.counter')` → content of `about`, prefix `counter`).\n * @returns A translate function augmented with `has`, `raw`, `rich`, `markup`.\n */\nexport const createDictionaryTranslator = (\n locale: LocalesValues,\n content: unknown,\n namespacePrefix?: string\n) => {\n const resolveKey = (key: string): string =>\n namespacePrefix ? `${namespacePrefix}.${key}` : key;\n\n return createLookupTranslator(\n locale,\n (key) => navigatePath(content, resolveKey(key)),\n resolveKey\n );\n};\n\n/**\n * The untyped runtime translator core shared by every factory above:\n * ICU message resolution plus the `has` / `raw` / `rich` / `markup` helpers.\n *\n * @param locale - The locale messages are resolved for.\n * @param lookup - Reads the raw content value for a message key.\n * @param missingKeyFallback - Builds the echoed key on lookup miss\n * (use-intl convention: `namespace.key`).\n */\nconst createLookupTranslator = (\n locale: LocalesValues,\n lookup: (key: string) => unknown,\n missingKeyFallback: (key: string) => string\n) => {\n const resolveToString = (\n key: string,\n values: MessageValues = {}\n ): string | undefined => {\n const rawValue = lookup(key);\n if (rawValue === null || rawValue === undefined) return undefined;\n return resolveMessage(rawValue, values, locale, 'icu');\n };\n\n const translate = (key: string, values?: MessageValues): string =>\n resolveToString(key, values) ?? missingKeyFallback(key);\n\n return Object.assign(translate, {\n /** Returns `true` if the given key exists in the namespace. */\n has: (key: string): boolean => lookup(key) !== undefined,\n\n /** Returns the raw unprocessed content for the given key. */\n raw: (key: string): unknown => lookup(key),\n\n /**\n * Resolves a message containing `<tag>chunks</tag>` markup, mapping each\n * tag through the matching renderer in `values`.\n */\n rich: (key: string, values?: Record<string, unknown>): ReactNode => {\n const { scalarValues, renderers } = splitRichValues(values);\n const message = resolveToString(key, scalarValues);\n if (message === undefined) return missingKeyFallback(key);\n return <>{renderRichTokens(parseTaggedMessage(message), renderers)}</>;\n },\n\n /**\n * Resolves a message containing `<tag>chunks</tag>` markup into a string,\n * mapping each tag through the matching string renderer in `values`.\n */\n markup: (key: string, values?: Record<string, unknown>): string => {\n const { scalarValues, renderers } = splitRichValues(values);\n const message = resolveToString(key, scalarValues);\n if (message === undefined) return missingKeyFallback(key);\n return renderMarkupTokens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,MAAM,UAAU,gBAAgB,KAAK,YAAY;GACjD,IAAI,YAAY,QAAW,OAAO,mBAAmB,GAAG;GACxD,OAAO,4CAAG,iBAAiB,mBAAmB,OAAO,GAAG,SAAS,EAAI;EACvE;;;;;EAMA,SAAS,KAAa,WAA6C;GACjE,MAAM,EAAE,cAAc,cAAc,gBAAgB,MAAM;GAC1D,MAAM,UAAU,gBAAgB,KAAK,YAAY;GACjD,IAAI,YAAY,QAAW,OAAO,mBAAmB,GAAG;GACxD,OAAO,mBAAmB,mBAAmB,OAAO,GAAG,SAAS;EAClE;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"namespaceTranslator.mjs","names":["navigatePath"],"sources":["../../../src/shared/namespaceTranslator.tsx"],"sourcesContent":["import { getIntlayer } from '@intlayer/core/interpreter';\nimport {\n type MessageValues,\n navigatePath,\n parseTaggedMessage,\n resolveMessageNodeToString,\n type TaggedMessageToken,\n} from '@intlayer/core/messageFormat';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\nimport type {\n DictionaryKeys,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { Fragment, type ReactNode } from 'react';\n\nexport { navigatePath } from '@intlayer/core/messageFormat';\n\n/** Chunk renderer used by `t.rich()` — maps tag children to a React node. */\nexport type RichChunkRenderer = (chunks: ReactNode) => ReactNode;\n\n/** Chunk renderer used by `t.markup()` — maps tag children to a string. */\nexport type MarkupChunkRenderer = (chunks: string) => string;\n\n/** Splits rich values into scalar interpolation values and tag renderers. */\nconst splitRichValues = (\n values: Record<string, unknown> = {}\n): { scalarValues: MessageValues; renderers: Record<string, unknown> } => {\n const scalarValues: MessageValues = {};\n const renderers: Record<string, unknown> = {};\n\n for (const [valueKey, value] of Object.entries(values)) {\n if (typeof value === 'function') renderers[valueKey] = value;\n else scalarValues[valueKey] = value;\n }\n\n return { scalarValues, renderers };\n};\n\nconst renderRichTokens = (\n tokens: TaggedMessageToken[],\n renderers: Record<string, unknown>\n): ReactNode[] =>\n tokens.map((token, tokenIndex) => {\n if (typeof token === 'string') return token;\n\n const children = renderRichTokens(token.children, renderers);\n const renderer = renderers[token.tag];\n\n if (typeof renderer === 'function') {\n return (\n <Fragment key={tokenIndex}>\n {(renderer as RichChunkRenderer)(children)}\n </Fragment>\n );\n }\n\n // No renderer provided for the tag — render its children unwrapped\n return <Fragment key={tokenIndex}>{children}</Fragment>;\n });\n\nconst renderMarkupTokens = (\n tokens: TaggedMessageToken[],\n renderers: Record<string, unknown>\n): string =>\n tokens\n .map((token) => {\n if (typeof token === 'string') return token;\n\n const children = renderMarkupTokens(token.children, renderers);\n const renderer = renderers[token.tag];\n\n if (typeof renderer === 'function') {\n return (renderer as MarkupChunkRenderer)(children);\n }\n\n return children;\n })\n .join('');\n\n/**\n * The untyped runtime translator shared by `useTranslations` (React hook) and\n * `createTranslator` (non-React core).\n *\n * Behaviour matches use-intl / next-intl:\n * - namespace `'about'` → keys resolved inside the `about` dictionary\n * - namespace `'about.counter'` → dictionary `about`, key prefix `counter`\n * - no namespace → the first segment of each key is the dictionary key\n * - messages support ICU syntax (plural, select, `#`, formatted arguments)\n * - `t.rich` / `t.markup` map `<tag>chunks</tag>` through the provided\n * renderers; `t.raw` returns the raw value; `t.has` checks existence\n *\n * @param locale - The locale dictionaries are resolved for.\n * @param namespace - Optional dictionary key, optionally with a nested scope.\n * @returns A translate function augmented with `has`, `raw`, `rich`, `markup`.\n */\nexport const createNamespaceTranslator = (\n locale: LocalesValues,\n namespace?: string\n) => {\n const [dictionaryKey, ...prefixSegments] = (namespace ?? '').split('.');\n const keyPrefix = prefixSegments.join('.');\n\n const lookup = (lookupKey: string): unknown =>\n lookupNamespaceKey(locale, dictionaryKey ?? '', keyPrefix, lookupKey);\n\n return createLookupTranslator(locale, lookup, (key) =>\n namespace ? `${namespace}.${key}` : key\n );\n};\n\n/**\n * Key-based lookup used by {@link createNamespaceTranslator}: resolves the\n * dictionary through the runtime registry (`getIntlayer`).\n */\nconst lookupNamespaceKey = (\n locale: LocalesValues,\n dictionaryKey: string,\n keyPrefix: string,\n key: string\n): unknown => {\n let targetDictionaryKey = dictionaryKey;\n let path = keyPrefix ? `${keyPrefix}.${key}` : key;\n\n const dictionaries = getDictionaries();\n\n if (!targetDictionaryKey) {\n // Root scope — the first key segment usually designates the dictionary\n const [firstSegment, ...restSegments] = key.split('.');\n targetDictionaryKey = firstSegment ?? key;\n path = restSegments.join('.');\n\n // If the assumed dictionary doesn't exist, we must fall back to searching all dictionaries.\n // This supports apps migrating from standard next-intl where all messages were grouped together.\n if (!dictionaries[targetDictionaryKey as DictionaryKeys]) {\n for (const dictKey of Object.keys(dictionaries)) {\n try {\n const dictionary = getIntlayer(dictKey as DictionaryKeys, locale);\n const result = navigatePath(dictionary, key);\n if (result !== undefined) {\n return result;\n }\n } catch {\n // Ignore if getIntlayer throws\n }\n }\n }\n }\n\n try {\n const dictionary = getIntlayer(\n targetDictionaryKey as DictionaryKeys,\n locale\n );\n return navigatePath(dictionary, path);\n } catch {\n return undefined;\n }\n};\n\n/**\n * Dictionary-bound translator used by the build-optimized `useDictionary` /\n * `getDictionary` variants: instead of resolving the dictionary by key at\n * runtime, the pre-resolved content is supplied directly (the babel/swc\n * optimize pass imports the dictionary JSON at build time).\n *\n * @param locale - The locale messages are resolved for.\n * @param content - The dictionary content, already resolved for `locale`.\n * @param namespacePrefix - Optional key prefix for nested namespaces\n * (`useTranslations('about.counter')` → content of `about`, prefix `counter`).\n * @returns A translate function augmented with `has`, `raw`, `rich`, `markup`.\n */\nexport const createDictionaryTranslator = (\n locale: LocalesValues,\n content: unknown,\n namespacePrefix?: string\n) => {\n const resolveKey = (key: string): string =>\n namespacePrefix ? `${namespacePrefix}.${key}` : key;\n\n return createLookupTranslator(\n locale,\n (key) => navigatePath(content, resolveKey(key)),\n resolveKey\n );\n};\n\n/**\n * The untyped runtime translator core shared by every factory above:\n * ICU message resolution plus the `has` / `raw` / `rich` / `markup` helpers.\n *\n * @param locale - The locale messages are resolved for.\n * @param lookup - Reads the raw content value for a message key.\n * @param missingKeyFallback - Builds the echoed key on lookup miss\n * (use-intl convention: `namespace.key`).\n */\nconst createLookupTranslator = (\n locale: LocalesValues,\n lookup: (key: string) => unknown,\n missingKeyFallback: (key: string) => string\n) => {\n const resolveToString = (\n key: string,\n values: MessageValues = {}\n ): string | undefined => {\n const rawValue = lookup(key);\n if (rawValue === null || rawValue === undefined) return undefined;\n // Dictionary content was converted to intlayer nodes at build time, so no\n // ICU parser is needed here — which keeps it out of the client bundle.\n return resolveMessageNodeToString(rawValue, values, locale);\n };\n\n const translate = (key: string, values?: MessageValues): string =>\n resolveToString(key, values) ?? missingKeyFallback(key);\n\n return Object.assign(translate, {\n /** Returns `true` if the given key exists in the namespace. */\n has: (key: string): boolean => lookup(key) !== undefined,\n\n /** Returns the raw unprocessed content for the given key. */\n raw: (key: string): unknown => lookup(key),\n\n /**\n * Resolves a message containing `<tag>chunks</tag>` markup, mapping each\n * tag through the matching renderer in `values`.\n */\n rich: (key: string, values?: Record<string, unknown>): ReactNode => {\n const { scalarValues, renderers } = splitRichValues(values);\n const message = resolveToString(key, scalarValues);\n if (message === undefined) return missingKeyFallback(key);\n return <>{renderRichTokens(parseTaggedMessage(message), renderers)}</>;\n },\n\n /**\n * Resolves a message containing `<tag>chunks</tag>` markup into a string,\n * mapping each tag through the matching string renderer in `values`.\n */\n markup: (key: string, values?: Record<string, unknown>): string => {\n const { scalarValues, renderers } = splitRichValues(values);\n const message = resolveToString(key, scalarValues);\n if (message === undefined) return missingKeyFallback(key);\n return renderMarkupTokens(parseTaggedMessage(message), renderers);\n },\n });\n};\n\nexport type CompatTranslator = ReturnType<typeof createNamespaceTranslator>;\n"],"mappings":";;;;;;;;AAwBA,MAAM,mBACJ,SAAkC,CAAC,MACqC;CACxE,MAAM,eAA8B,CAAC;CACrC,MAAM,YAAqC,CAAC;CAE5C,KAAK,MAAM,CAAC,UAAU,UAAU,OAAO,QAAQ,MAAM,GACnD,IAAI,OAAO,UAAU,YAAY,UAAU,Y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,OAAO,mBAAmB,GAAG;GACxD,OAAO,mBAAmB,mBAAmB,OAAO,GAAG,SAAS;EAClE;CACF,CAAC;AACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"namespaceTranslator.d.ts","names":[],"sources":["../../../src/shared/namespaceTranslator.tsx"],"mappings":";;;;;YAkBY,qBAAqB,QAAQ,cAAc;;YAG3C,uBAAuB;;;;;;;;;;;;;;;;;qBA0EtB,4BAAyB,QAC5B,eAAa,yBACH,aAgHY,SAAW;;EAK5B,MAAA;;EAGA,MAAA;;;;;EAMC,OAAA,aAAM,SAAW,4BAA0B;;;;;EAWzC,SAAA,aAAM,SAAW;;;;;;;;;;;;;;qBA/DtB,6BAA0B,QAC7B,eAAa,kBACL,+BACQ,aAmCM,SAAW;;EAK5B,MAAA;;EAGA,MAAA;;;;;EAMC,OAAA,aAAM,SAAW,4BAA0B;;;;;EAWzC,SAAA,aAAM,SAAW;;YASvB,mBAAmB,kBAAkB"}
1
+ {"version":3,"file":"namespaceTranslator.d.ts","names":[],"sources":["../../../src/shared/namespaceTranslator.tsx"],"mappings":";;;;;YAkBY,qBAAqB,QAAQ,cAAc;;YAG3C,uBAAuB;;;;;;;;;;;;;;;;;qBA0EtB,4BAAyB,QAC5B,eAAa,yBACH,aAkHY,SAAW;;EAK5B,MAAA;;EAGA,MAAA;;;;;EAMC,OAAA,aAAM,SAAW,4BAA0B;;;;;EAWzC,SAAA,aAAM,SAAW;;;;;;;;;;;;;;qBAjEtB,6BAA0B,QAC7B,eAAa,kBACL,+BACQ,aAqCM,SAAW;;EAK5B,MAAA;;EAGA,MAAA;;;;;EAMC,OAAA,aAAM,SAAW,4BAA0B;;;;;EAWzC,SAAA,aAAM,SAAW;;YASvB,mBAAmB,kBAAkB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/use-intl",
3
- "version": "9.5.0",
3
+ "version": "9.5.2",
4
4
  "private": false,
5
5
  "description": "use-intl API adapter for intlayer — useTranslations, useLocale, useFormatter, IntlProvider, createTranslator backed by react-intlayer",
6
6
  "keywords": [
@@ -89,17 +89,17 @@
89
89
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
90
90
  },
91
91
  "dependencies": {
92
- "@intlayer/config": "9.5.0",
93
- "@intlayer/core": "9.5.0",
94
- "@intlayer/dictionaries-entry": "9.5.0",
95
- "@intlayer/engine": "9.5.0",
96
- "@intlayer/types": "9.5.0",
97
- "react-intlayer": "9.5.0",
98
- "vite-intlayer": "9.5.0"
92
+ "@intlayer/config": "9.5.2",
93
+ "@intlayer/core": "9.5.2",
94
+ "@intlayer/dictionaries-entry": "9.5.2",
95
+ "@intlayer/engine": "9.5.2",
96
+ "@intlayer/types": "9.5.2",
97
+ "react-intlayer": "9.5.2",
98
+ "vite-intlayer": "9.5.2"
99
99
  },
100
100
  "devDependencies": {
101
- "@types/node": "26.5.0",
102
- "@types/react": "19.2.18",
101
+ "@types/node": "^22",
102
+ "@types/react": "19.3.0",
103
103
  "@utils/ts-config": "1.0.4",
104
104
  "@utils/ts-config-types": "1.0.4",
105
105
  "@utils/tsdown-config": "1.0.4",
@@ -107,7 +107,7 @@
107
107
  "tsdown": "0.23.0",
108
108
  "typescript": "7.0.2",
109
109
  "use-intl": "4.14.2",
110
- "vite": "8.2.2",
110
+ "vite": "8.3.0",
111
111
  "vitest": "5.0.0"
112
112
  },
113
113
  "peerDependencies": {