@lingo.dev/react 1.0.3 → 2.0.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.
package/dist/index.d.cts CHANGED
@@ -23,7 +23,6 @@ import * as react_jsx_runtime0 from "react/jsx-runtime";
23
23
  * Same source + different context = different key (disambiguation).
24
24
  */
25
25
  declare function computeKey(source: string, context?: string): string;
26
- //# sourceMappingURL=hash.d.ts.map
27
26
  //#endregion
28
27
  //#region src/icu.d.ts
29
28
  /**
@@ -323,7 +322,6 @@ type Lingo = {
323
322
  context: string;
324
323
  }) => string;
325
324
  } & FormatMethods;
326
- //# sourceMappingURL=types.d.ts.map
327
325
  //#endregion
328
326
  //#region src/lingo.d.ts
329
327
  /**
@@ -342,7 +340,6 @@ type Lingo = {
342
340
  * ```
343
341
  */
344
342
  declare function createLingo(locale: string, messages?: Messages): Lingo;
345
- //# sourceMappingURL=lingo.d.ts.map
346
343
  //#endregion
347
344
  //#region src/provider.d.ts
348
345
  type LingoProviderProps = {
@@ -388,8 +385,5 @@ declare function LingoProvider({
388
385
  * ```
389
386
  */
390
387
  declare function useLingo(): Lingo;
391
- //# sourceMappingURL=provider.d.ts.map
392
-
393
388
  //#endregion
394
- export { type FormatMethods, type Lingo, type LingoMessages, LingoProvider, type LingoProviderProps, type MessageKey, type Messages, type PluralForms, type RichOptions, type SelectForms, type TextOptions, computeKey, createLingo, useLingo };
395
- //# sourceMappingURL=index.d.cts.map
389
+ export { type FormatMethods, type Lingo, type LingoMessages, LingoProvider, type LingoProviderProps, type MessageKey, type Messages, type PluralForms, type RichOptions, type SelectForms, type TextOptions, computeKey, createLingo, useLingo };
package/dist/index.d.ts CHANGED
@@ -23,7 +23,6 @@ import * as react_jsx_runtime0 from "react/jsx-runtime";
23
23
  * Same source + different context = different key (disambiguation).
24
24
  */
25
25
  declare function computeKey(source: string, context?: string): string;
26
- //# sourceMappingURL=hash.d.ts.map
27
26
  //#endregion
28
27
  //#region src/icu.d.ts
29
28
  /**
@@ -323,7 +322,6 @@ type Lingo = {
323
322
  context: string;
324
323
  }) => string;
325
324
  } & FormatMethods;
326
- //# sourceMappingURL=types.d.ts.map
327
325
  //#endregion
328
326
  //#region src/lingo.d.ts
329
327
  /**
@@ -342,7 +340,6 @@ type Lingo = {
342
340
  * ```
343
341
  */
344
342
  declare function createLingo(locale: string, messages?: Messages): Lingo;
345
- //# sourceMappingURL=lingo.d.ts.map
346
343
  //#endregion
347
344
  //#region src/provider.d.ts
348
345
  type LingoProviderProps = {
@@ -388,8 +385,5 @@ declare function LingoProvider({
388
385
  * ```
389
386
  */
390
387
  declare function useLingo(): Lingo;
391
- //# sourceMappingURL=provider.d.ts.map
392
-
393
388
  //#endregion
394
- export { type FormatMethods, type Lingo, type LingoMessages, LingoProvider, type LingoProviderProps, type MessageKey, type Messages, type PluralForms, type RichOptions, type SelectForms, type TextOptions, computeKey, createLingo, useLingo };
395
- //# sourceMappingURL=index.d.ts.map
389
+ export { type FormatMethods, type Lingo, type LingoMessages, LingoProvider, type LingoProviderProps, type MessageKey, type Messages, type PluralForms, type RichOptions, type SelectForms, type TextOptions, computeKey, createLingo, useLingo };
package/dist/index.js CHANGED
@@ -309,5 +309,3 @@ function useLingo() {
309
309
  }
310
310
  //#endregion
311
311
  export { LingoProvider, computeKey, createLingo, useLingo };
312
-
313
- //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@lingo.dev/react",
3
- "version": "1.0.3",
3
+ "version": "2.0.0",
4
+ "files": [
5
+ "dist"
6
+ ],
4
7
  "type": "module",
8
+ "sideEffects": false,
5
9
  "main": "./dist/index.js",
6
10
  "exports": {
7
11
  ".": {
@@ -15,19 +19,16 @@
15
19
  }
16
20
  }
17
21
  },
18
- "files": [
19
- "dist"
20
- ],
21
- "sideEffects": false,
22
- "peerDependencies": {
23
- "react": "^18.0.0 || ^19.0.0",
24
- "react-dom": "^18.0.0 || ^19.0.0"
22
+ "dependencies": {
23
+ "intl-messageformat": "^11.1.3",
24
+ "@lingo.dev/spec": "2.0.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@testing-library/jest-dom": "^6.9.1",
28
28
  "@testing-library/react": "^16.3.2",
29
29
  "@types/react": "^19.0.0",
30
30
  "@types/react-dom": "^19.0.0",
31
+ "@typescript/native-preview": "7.0.0-dev.20260330.1",
31
32
  "jsdom": "^27.4.0",
32
33
  "react": "^19.0.0",
33
34
  "react-dom": "^19.0.0",
@@ -35,13 +36,13 @@
35
36
  "typescript": "^5.8.2",
36
37
  "vitest": "^4.0.18"
37
38
  },
38
- "dependencies": {
39
- "intl-messageformat": "^11.1.3",
40
- "@lingo.dev/spec": "1.0.3"
39
+ "peerDependencies": {
40
+ "react": "^18.0.0 || ^19.0.0",
41
+ "react-dom": "^18.0.0 || ^19.0.0"
41
42
  },
42
43
  "scripts": {
43
44
  "build": "tsdown",
44
- "typecheck": "tsc --noEmit",
45
- "test": "vitest run"
45
+ "test": "vitest run",
46
+ "typecheck": "tsgo"
46
47
  }
47
48
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","names":["computeKey","buildIcuPlural","Record","buildIcuSelect","EntryMetadata","LocaleEntry","LocaleFile","getActiveEntries","readLocaleFile"],"sources":["../../spec/dist/index.d.ts","../src/format.ts","../src/text.ts","../src/rich.ts","../src/types.ts","../src/lingo.ts","../src/provider.tsx"],"sourcesContent":["//#region src/hash.d.ts\n/**\n * Deterministic key generation from (source text, context) pairs.\n * Shared between runtime (message lookup) and build tools (extraction, JSONC generation).\n *\n * Uses MurmurHash3 x86_128 on NFC-normalized UTF-8 bytes.\n * Outputs an 8-character base62 string (e.g., \"aB3dEf9x\").\n *\n * Cross-platform deterministic: JS, Rust, Go, Python produce identical keys\n * when given the same (source, context) pair.\n *\n * 1% collision probability at ~2.4 million messages (48-bit effective entropy).\n */\n/**\n * Computes a deterministic short key from source text and optional context.\n *\n * Same source + same context = same key (deterministic).\n * Same source + different context = different key (disambiguation).\n */\ndeclare function computeKey(source: string, context?: string): string;\n//# sourceMappingURL=hash.d.ts.map\n//#endregion\n//#region src/icu.d.ts\n/**\n * Canonical ICU MessageFormat expression builders.\n * Shared between runtime (l.plural/l.select) and build tools (extraction).\n *\n * These must produce identical output everywhere so that computeKey()\n * generates matching hash keys at build time and runtime.\n */\ndeclare function buildIcuPlural(forms: Record<string, string>): string;\ndeclare function buildIcuSelect(forms: Record<string, string>): string;\n//# sourceMappingURL=icu.d.ts.map\n\n//#endregion\n//#region src/jsonc.d.ts\n/**\n * JSONC locale file reader with structured metadata comments.\n * Lives in @lingo.dev/spec so framework adapters can parse locale files\n * without depending on @lingo.dev/cli.\n *\n * File format:\n * ```jsonc\n * {\n * /*\n * * @context Hero heading\n * * @src app/hero.tsx:12\n * *​/\n * \"mK9xqZ\": \"Welcome to Acme\"\n * }\n * ```\n */\ntype EntryMetadata = {\n context?: string;\n src?: string;\n orphan?: boolean;\n};\ntype LocaleEntry = {\n key: string;\n value: string;\n metadata: EntryMetadata;\n};\ntype LocaleFile = {\n entries: LocaleEntry[];\n};\n/** Filters out orphaned entries, returning only active (non-orphaned) ones. */\ndeclare function getActiveEntries(entries: LocaleEntry[]): LocaleEntry[];\n/**\n * Parses a JSONC string into structured locale entries with metadata.\n * Extracts @context, @src, and @orphan from block comments preceding each key.\n * Pure function - no filesystem access. Works in Node.js and edge runtimes.\n */\ndeclare function readLocaleFile(content: string): LocaleFile;\n//# sourceMappingURL=jsonc.d.ts.map\n//#endregion\nexport { type EntryMetadata, type LocaleEntry, type LocaleFile, buildIcuPlural, buildIcuSelect, computeKey, getActiveEntries, readLocaleFile };\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;;;ACQA;;;;;;;;;;;iBDWiBA,UAAAA,CCoCY,MAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA;;;;;;;;;;AC3C7B;;;;;;;;KDJY,aAAA;;;AAAZ;;WA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computeKey","buildIcuPlural","Record","buildIcuSelect","EntryMetadata","LocaleEntry","LocaleFile","getActiveEntries","readLocaleFile"],"sources":["../../spec/dist/index.d.ts","../src/format.ts","../src/text.ts","../src/rich.ts","../src/types.ts","../src/lingo.ts","../src/provider.tsx"],"sourcesContent":["//#region src/hash.d.ts\n/**\n * Deterministic key generation from (source text, context) pairs.\n * Shared between runtime (message lookup) and build tools (extraction, JSONC generation).\n *\n * Uses MurmurHash3 x86_128 on NFC-normalized UTF-8 bytes.\n * Outputs an 8-character base62 string (e.g., \"aB3dEf9x\").\n *\n * Cross-platform deterministic: JS, Rust, Go, Python produce identical keys\n * when given the same (source, context) pair.\n *\n * 1% collision probability at ~2.4 million messages (48-bit effective entropy).\n */\n/**\n * Computes a deterministic short key from source text and optional context.\n *\n * Same source + same context = same key (deterministic).\n * Same source + different context = different key (disambiguation).\n */\ndeclare function computeKey(source: string, context?: string): string;\n//# sourceMappingURL=hash.d.ts.map\n//#endregion\n//#region src/icu.d.ts\n/**\n * Canonical ICU MessageFormat expression builders.\n * Shared between runtime (l.plural/l.select) and build tools (extraction).\n *\n * These must produce identical output everywhere so that computeKey()\n * generates matching hash keys at build time and runtime.\n */\ndeclare function buildIcuPlural(forms: Record<string, string>): string;\ndeclare function buildIcuSelect(forms: Record<string, string>): string;\n//# sourceMappingURL=icu.d.ts.map\n\n//#endregion\n//#region src/jsonc.d.ts\n/**\n * JSONC locale file reader with structured metadata comments.\n * Lives in @lingo.dev/spec so framework adapters can parse locale files\n * without depending on @lingo.dev/cli.\n *\n * File format:\n * ```jsonc\n * {\n * /*\n * * @context Hero heading\n * * @src app/hero.tsx:12\n * *​/\n * \"mK9xqZ\": \"Welcome to Acme\"\n * }\n * ```\n */\ntype EntryMetadata = {\n context?: string;\n src?: string;\n orphan?: boolean;\n};\ntype LocaleEntry = {\n key: string;\n value: string;\n metadata: EntryMetadata;\n};\ntype LocaleFile = {\n entries: LocaleEntry[];\n};\n/** Filters out orphaned entries, returning only active (non-orphaned) ones. */\ndeclare function getActiveEntries(entries: LocaleEntry[]): LocaleEntry[];\n/**\n * Parses a JSONC string into structured locale entries with metadata.\n * Extracts @context, @src, and @orphan from block comments preceding each key.\n * Pure function - no filesystem access. Works in Node.js and edge runtimes.\n */\ndeclare function readLocaleFile(content: string): LocaleFile;\n//# sourceMappingURL=jsonc.d.ts.map\n//#endregion\nexport { type EntryMetadata, type LocaleEntry, type LocaleFile, buildIcuPlural, buildIcuSelect, computeKey, getActiveEntries, readLocaleFile };\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;;;ACQA;;;;;;;;;;;iBDWiBA,UAAAA,CCoCY,MAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA;;;;;;;;;;AC3C7B;;;;;;;;KDJY,aAAA;;;AAAZ;;WAK+C,GAAA,EAAA,CAAA,KAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAAL,IAAA,CAAK,mBAAA,EAAA,GAAA,MAAA;;;;;WA8BtB,QAAA,EAAA,CAAA,KAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAxBwC,IAAA,CAAK,mBAwB7C,EAAA,GAAA,MAAA;;;;;WAYkC,OAAA,EAAA,CAAA,KAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EA9Bb,IAAA,CAAK,mBA8BQ,EAAA,GAAA,MAAA;;;;;EA6BM,SAAA,IAAA,EAAA,CAAA,KAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EArDR,IAAA,CAAK,mBAqDG,EAAA,GAAA,MAAA;;;;ACxEjE;8CDyB8C,IAAA,CAAK;;;AErBnD;;WAEmC,IAAA,EAAA,CAAA,KAAA,EFyBV,IEzBU,GAAA,MAAA,EAAA,OAAA,CAAA,EFyBe,IAAA,CAAK,qBEzBpB,EAAA,GAAA,MAAA;;;;;yBF+BV,yBAAyB,IAAA,CAAK;;;AGhCvD;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;;;;;;;;;4BFwEL,oBAAoB,YAAY,aAAa;;;;;;;;;;;;;4BAa7C,oBAAoB,YAAY,aAAa,OAAO;;;;;;;;;;;;0CAYtC;;;;;;;;;;;;;0CAWA;;;IACtC;;;;;;;;;;AHpKJ;;;;;;;;;AAyCyB,iBIAT,WAAA,CJAS,MAAA,EAAA,MAAA,EAAA,QAAA,CAAA,EIA6B,QJA7B,CAAA,EIA6C,KJA7C;;;;KKtCb,kBAAA;;ENQKA,MAAAA,EAAAA,MAAU;;aMJd;YACD;ALRZ,CAAA;;;;;;;;;;;;;;;;;;iBK4BgB,aAAA;;;;GAAmD,qBAAkB,kBAAA,CAAA,GAAA,CAAA;;;AJxBrF;;;;ACIA;;;;;;;iBG+CgB,QAAA,CAAA,GAAY"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/format.ts","../src/text.ts","../src/rich.ts","../src/lingo.ts","../src/provider.tsx"],"sourcesContent":["/**\n * Locale-aware formatting methods wrapping native Intl APIs.\n * Near-zero bundle cost - each method delegates to built-in browser/Node Intl formatters.\n * All methods are pure functions that take a locale string and return formatted strings.\n */\n\nconst FILE_SIZE_UNITS = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\"] as const;\n\nexport type FormatMethods = {\n /**\n * Format a number with locale-aware grouping and decimals.\n * @example l.num(1234567) // \"1,234,567\" (en) / \"1.234.567\" (de)\n */\n readonly num: (value: number, options?: Intl.NumberFormatOptions) => string;\n\n /**\n * Format a currency value with locale-aware symbol placement and decimals.\n * @example l.currency(29.99, \"USD\") // \"$29.99\" (en) / \"29,99 $US\" (fr)\n */\n readonly currency: (value: number, currency: string, options?: Intl.NumberFormatOptions) => string;\n\n /**\n * Format a decimal as a percentage.\n * @example l.percent(0.156) // \"16%\" (en) / \"16 %\" (fr)\n */\n readonly percent: (value: number, options?: Intl.NumberFormatOptions) => string;\n\n /**\n * Format a value with a measurement unit.\n * @example l.unit(32, \"celsius\") // \"32°C\" (en) / \"32 °C\" (de)\n */\n readonly unit: (value: number, unit: string, options?: Intl.NumberFormatOptions) => string;\n\n /**\n * Format a number in compact notation.\n * @example l.compact(1234567) // \"1.2M\" (en) / \"123万\" (ja)\n */\n readonly compact: (value: number, options?: Intl.NumberFormatOptions) => string;\n\n /**\n * Format a date.\n * @example l.date(new Date()) // \"3/16/2026\" (en) / \"16.03.2026\" (de)\n */\n readonly date: (value: Date | number, options?: Intl.DateTimeFormatOptions) => string;\n\n /**\n * Format a time.\n * @example l.time(new Date()) // \"3:45 PM\" (en) / \"15:45\" (de)\n */\n readonly time: (value: Date | number, options?: Intl.DateTimeFormatOptions) => string;\n\n /**\n * Format a date and time together.\n * @example l.datetime(new Date()) // \"3/16/2026, 3:45 PM\" (en)\n */\n readonly datetime: (value: Date | number, options?: Intl.DateTimeFormatOptions) => string;\n\n /**\n * Format a relative time span.\n * @example l.relative(-3, \"day\") // \"3 days ago\" (en) / \"vor 3 Tagen\" (de)\n */\n readonly relative: (\n value: number,\n unit: Intl.RelativeTimeFormatUnit,\n options?: Intl.RelativeTimeFormatOptions,\n ) => string;\n\n /**\n * Format a list of items with locale-aware conjunction.\n * @example l.list([\"A\", \"B\", \"C\"]) // \"A, B, and C\" (en) / \"A, B y C\" (es)\n */\n readonly list: (items: string[], options?: Intl.ListFormatOptions) => string;\n\n /**\n * Get the localized display name for a language, region, script, or currency code.\n * @example l.displayName(\"en\", \"language\") // \"English\" (en) / \"Englisch\" (de)\n */\n readonly displayName: (code: string, type: \"language\" | \"region\" | \"script\" | \"currency\") => string | undefined;\n\n /**\n * Sort an array of strings using locale-aware collation rules.\n * Returns a new sorted array. Does not mutate the input.\n * @example l.sort([\"ä\", \"z\", \"a\"]) // [\"a\", \"ä\", \"z\"] (de) vs [\"a\", \"z\", \"ä\"] (sv)\n */\n readonly sort: (items: string[], options?: Intl.CollatorOptions) => string[];\n\n /**\n * Segment text into graphemes, words, or sentences using locale-aware rules.\n * Essential for CJK text where spaces don't separate words.\n * @example l.segment(\"Hello world\", \"word\") // [\"Hello\", \" \", \"world\"]\n */\n readonly segment: (text: string, granularity?: \"grapheme\" | \"word\" | \"sentence\") => string[];\n\n /**\n * Format a byte count as a human-readable file size with locale-aware number formatting.\n * @example l.fileSize(1073741824) // \"1 GB\" (en) / \"1 Go\" (fr)\n */\n readonly fileSize: (bytes: number) => string;\n};\n\n/**\n * Creates all formatting methods bound to a specific locale.\n */\nexport function createFormatMethods(locale: string): FormatMethods {\n return {\n num: (value, options?) => new Intl.NumberFormat(locale, options).format(value),\n\n currency: (value, currency, options?) =>\n new Intl.NumberFormat(locale, { ...options, style: \"currency\", currency }).format(value),\n\n percent: (value, options?) => new Intl.NumberFormat(locale, { ...options, style: \"percent\" }).format(value),\n\n unit: (value, unit, options?) => new Intl.NumberFormat(locale, { ...options, style: \"unit\", unit }).format(value),\n\n compact: (value, options?) => new Intl.NumberFormat(locale, { ...options, notation: \"compact\" }).format(value),\n\n date: (value, options?) => new Intl.DateTimeFormat(locale, { dateStyle: \"medium\", ...options }).format(value),\n\n time: (value, options?) => new Intl.DateTimeFormat(locale, { timeStyle: \"short\", ...options }).format(value),\n\n datetime: (value, options?) =>\n new Intl.DateTimeFormat(locale, { dateStyle: \"medium\", timeStyle: \"short\", ...options }).format(value),\n\n relative: (value, unit, options?) => new Intl.RelativeTimeFormat(locale, options).format(value, unit),\n\n list: (items, options?) => new Intl.ListFormat(locale, { type: \"conjunction\", ...options }).format(items),\n\n displayName: (code, type) => {\n try {\n return new Intl.DisplayNames(locale, { type }).of(code);\n } catch {\n return undefined;\n }\n },\n\n sort: (items, options?) => {\n const collator = new Intl.Collator(locale, options);\n return [...items].sort(collator.compare);\n },\n\n segment: (text, granularity = \"grapheme\") =>\n [...new Intl.Segmenter(locale, { granularity }).segment(text)].map((s) => s.segment),\n\n fileSize: (bytes) => {\n if (bytes === 0) return `0 ${FILE_SIZE_UNITS[0]}`;\n const exp = Math.min(Math.floor(Math.log(bytes) / Math.log(1024)), FILE_SIZE_UNITS.length - 1);\n const value = bytes / 1024 ** exp;\n const formatted = new Intl.NumberFormat(locale, { maximumFractionDigits: exp === 0 ? 0 : 1 }).format(value);\n return `${formatted} ${FILE_SIZE_UNITS[exp]}`;\n },\n };\n}\n","import IntlMessageFormat from \"intl-messageformat\";\nimport { computeKey } from \"./hash\";\nimport type { Messages } from \"./types\";\n\n/**\n * Options for `l.text()` translation calls.\n *\n * @example\n * ```ts\n * l.text(\"Welcome, {name}!\", { values: { name: \"Max\" }, context: \"Dashboard\" })\n * ```\n */\nexport type TextOptions = {\n /** Interpolation values for `{placeholder}` substitution. */\n values?: Record<string, string | number>;\n /** Required context describing where/how this text is used. Improves translation quality and enables disambiguation. */\n context: string;\n};\n\nconst ICU_COMPLEX = /\\{[^}]+,\\s*(?:plural|select|selectordinal|number|date|time)\\s*[,}]/;\n\nconst formatCache = new Map<string, IntlMessageFormat>();\nconst warnedKeys = new Set<string>();\n\nfunction warnOnce(id: string, message: string, level: \"warn\" | \"error\" = \"warn\"): void {\n if (process.env.NODE_ENV === \"production\") return;\n if (warnedKeys.has(id)) return;\n warnedKeys.add(id);\n console[level](`[lingo] ${message}`);\n}\n\nexport function simpleInterpolate(template: string, values: Record<string, string | number>): string {\n return template.replace(/\\{(\\w+)\\}/g, (_, key) => {\n const val = values[key];\n return val !== undefined ? String(val) : `{${key}}`;\n });\n}\n\nfunction getFormatter(template: string, locale: string): IntlMessageFormat {\n const cacheKey = `${locale}\\0${template}`;\n let formatter = formatCache.get(cacheKey);\n if (!formatter) {\n formatter = new IntlMessageFormat(template, locale);\n formatCache.set(cacheKey, formatter);\n }\n return formatter;\n}\n\n/**\n * Looks up a translation by hash key with dev-mode diagnostics.\n * Falls back to source text when translation is missing or empty.\n */\nexport function lookupTemplate(source: string, messages: Messages, locale: string, context?: string): string {\n const key = computeKey(source, context);\n const raw = messages[key];\n\n if (process.env.NODE_ENV !== \"production\") {\n if (raw === undefined) {\n warnOnce(\n `missing:${key}:${locale}`,\n `Missing translation for \"${source}\"\\n Key: ${key}\\n Locale: ${locale}\\n → Run \\`lingo extract\\` to add this string to your locale files`,\n );\n } else if (raw === \"\") {\n warnOnce(\n `empty:${key}:${locale}`,\n `Empty translation for \"${source}\"\\n Key: ${key}\\n Locale: ${locale}\\n → This key exists in your locale file but has no translation`,\n );\n }\n }\n\n return raw || source;\n}\n\n/**\n * Resolves a translated string from messages by hash, falling back to source text.\n * Uses simple regex for {placeholder} substitution; loads ICU parser only for complex syntax.\n */\nexport function resolveText(source: string, messages: Messages, locale: string, options?: TextOptions): string {\n const template = lookupTemplate(source, messages, locale, options?.context);\n\n if (!options?.values) return template;\n\n // Fast path: simple {placeholder} interpolation\n if (!ICU_COMPLEX.test(template)) {\n return simpleInterpolate(template, options.values);\n }\n\n // Full ICU path (plural, select, number, date, time)\n try {\n const formatter = getFormatter(template, locale);\n return formatter.format(options.values) as string;\n } catch (error) {\n if (process.env.NODE_ENV !== \"production\") {\n const key = computeKey(source, options?.context);\n warnOnce(\n `icu:${key}:${locale}`,\n `Failed to format \"${template}\"\\n Key: ${key}\\n Locale: ${locale}\\n Error: ${error instanceof Error ? error.message : String(error)}\\n → Check the ICU MessageFormat syntax in your locale file`,\n \"error\",\n );\n }\n return template;\n }\n}\n","import { createElement, Fragment, type ReactNode } from \"react\";\nimport { lookupTemplate, simpleInterpolate } from \"./text\";\nimport type { Messages } from \"./types\";\n\n/**\n * Options for `l.rich()` rich text translation calls.\n *\n * @example\n * ```tsx\n * l.rich(\"Click <link>here</link> for {topic}\", {\n * tags: { link: (children) => <a href=\"/help\">{children}</a> },\n * values: { topic: \"details\" },\n * context: \"Footer\",\n * })\n * ```\n */\nexport type RichOptions = {\n /** Map tag names to React component renderers. `<tag>children</tag>` and `<tag/>` supported. */\n tags?: Record<string, (children: ReactNode) => ReactNode>;\n /** Interpolation values for `{placeholder}` substitution in text segments. */\n values?: Record<string, string | number>;\n /** Required context describing where/how this text is used. Improves translation quality and enables disambiguation. */\n context: string;\n};\n\nconst TAG_RE = /<(\\w+)>([\\s\\S]*?)<\\/\\1>|<(\\w+)\\s*\\/>/g;\n\nfunction renderTemplate(\n template: string,\n tags: Record<string, (children: ReactNode) => ReactNode>,\n values: Record<string, string | number>,\n): ReactNode {\n const parts: ReactNode[] = [];\n let lastIndex = 0;\n let keyCounter = 0;\n\n for (const match of template.matchAll(TAG_RE)) {\n if (match.index > lastIndex) {\n parts.push(simpleInterpolate(template.slice(lastIndex, match.index), values));\n }\n\n const tagName = match[1] ?? match[3];\n const content = match[2];\n const tagFn = tags[tagName];\n\n if (tagFn) {\n const children = content != null ? renderTemplate(content, tags, values) : null;\n parts.push(createElement(Fragment, { key: keyCounter++ }, tagFn(children)));\n } else {\n // No handler for this tag - render raw text\n parts.push(match[0]);\n }\n\n lastIndex = match.index + match[0].length;\n }\n\n if (lastIndex < template.length) {\n parts.push(simpleInterpolate(template.slice(lastIndex), values));\n }\n\n if (parts.length === 0) return \"\";\n if (parts.length === 1) return parts[0];\n return createElement(Fragment, null, ...parts);\n}\n\n/**\n * Resolves a translated string with rich text tag interpolation.\n * Parses <tag>children</tag> and <tag/> patterns, mapping them to React components.\n */\nexport function resolveRich(source: string, messages: Messages, locale: string, options?: RichOptions): ReactNode {\n const template = lookupTemplate(source, messages, locale, options?.context);\n return renderTemplate(template, options?.tags ?? {}, options?.values ?? {});\n}\n","import { buildIcuPlural, buildIcuSelect } from \"@lingo.dev/spec\";\nimport { createFormatMethods } from \"./format\";\nimport { resolveRich } from \"./rich\";\nimport { resolveText, type TextOptions } from \"./text\";\nimport type { Lingo, Messages, PluralForms, SelectForms } from \"./types\";\n\nconst RTL_LANGS = new Set([\"ar\", \"arc\", \"dv\", \"fa\", \"ha\", \"he\", \"khw\", \"ks\", \"ku\", \"ps\", \"ur\", \"yi\"]);\n\nfunction fallbackDirection(locale: string): \"ltr\" | \"rtl\" {\n const lang = locale.split(\"-\")[0].toLowerCase();\n return RTL_LANGS.has(lang) ? \"rtl\" : \"ltr\";\n}\n\nexport function resolveDirection(locale: string): \"ltr\" | \"rtl\" {\n try {\n const loc = new Intl.Locale(locale);\n // Intl.Locale.textInfo available in Node 21+, Chrome 99+, Safari 17.4+\n const direction = (loc as any).textInfo?.direction;\n if (direction === \"rtl\" || direction === \"ltr\") return direction;\n } catch {\n // Invalid locale or Intl.Locale not available\n }\n return fallbackDirection(locale);\n}\n\nfunction resolveLocaleInfo(locale: string): { script: string | undefined; region: string | undefined } {\n try {\n const loc = new Intl.Locale(locale).maximize();\n return { script: loc.script, region: loc.region };\n } catch {\n return { script: undefined, region: undefined };\n }\n}\n\n/**\n * Creates a `Lingo` object for translating text outside of React context.\n * Used by `@lingo.dev/react-next` for Server Components and internally by `LingoProvider`.\n *\n * @param locale - BCP-47 locale string (e.g., \"en\", \"es\", \"ar-SA\")\n * @param messages - Hash-keyed translations from JSONC locale files\n *\n * @example\n * ```ts\n * const l = createLingo(\"es\", messages);\n * l.text(\"Hello\", { context: \"Hero greeting\" });\n * l.direction; // \"ltr\"\n * l.script; // \"Latn\"\n * ```\n */\nexport function createLingo(locale: string, messages: Messages = {}): Lingo {\n const direction = resolveDirection(locale);\n const { script, region } = resolveLocaleInfo(locale);\n\n // Cast needed: implementation uses (source, options?) but Lingo type uses\n // conditional rest params (...args) to enforce required context + values per message key.\n // Runtime behavior is identical - rest params with one element === single param.\n return {\n locale,\n direction,\n script,\n region,\n text: (source: string, options?: TextOptions) => resolveText(source, messages, locale, options),\n rich: (source: string, options?: any) => resolveRich(source, messages, locale, options),\n plural: (count: number, forms: PluralForms, options?: { context: string }) => {\n const source = buildIcuPlural(forms);\n return resolveText(source, messages, locale, {\n context: options?.context ?? \"\",\n values: { count },\n });\n },\n select: (value: string, forms: SelectForms, options?: { context: string }) => {\n const source = buildIcuSelect(forms);\n return resolveText(source, messages, locale, {\n context: options?.context ?? \"\",\n values: { value },\n });\n },\n ...createFormatMethods(locale),\n } as Lingo;\n}\n","import { createContext, useContext, useMemo, type ReactNode } from \"react\";\nimport { createLingo } from \"./lingo\";\nimport type { Lingo, Messages } from \"./types\";\n\ntype LingoState = {\n lingo: Lingo;\n messages: Messages;\n};\n\nconst LingoContext = createContext<LingoState | null>(null);\n\nexport type LingoProviderProps = {\n /** BCP-47 locale string (e.g., \"en\", \"es\", \"ar-SA\") */\n locale: string;\n /** Hash-keyed translations loaded from JSONC/JSON locale files */\n messages?: Messages;\n children: ReactNode;\n};\n\n/**\n * Provides locale and translations to all descendant components via `useLingo()`.\n *\n * Nested providers with the **same locale** merge messages (child overrides parent,\n * missing keys fall through). Nested providers with **different locales** are standalone.\n *\n * @example\n * ```tsx\n * // Root layout: shared messages\n * <LingoProvider locale=\"es\" messages={sharedMessages}>\n * {/* Dashboard: adds route-specific messages *​/}\n * <LingoProvider locale=\"es\" messages={dashboardMessages}>\n * <App />\n * </LingoProvider>\n * </LingoProvider>\n * ```\n */\nexport function LingoProvider({ locale, messages = {}, children }: LingoProviderProps) {\n const parent = useContext(LingoContext);\n const parentMessages = parent?.messages;\n const parentLocale = parent?.lingo.locale;\n\n const state = useMemo<LingoState>(() => {\n // Merge with parent when same locale; standalone when locale differs or no parent\n const merged = parentMessages && parentLocale === locale ? { ...parentMessages, ...messages } : messages;\n return { lingo: createLingo(locale, merged), messages: merged };\n }, [parentMessages, parentLocale, locale, messages]);\n\n return <LingoContext value={state}>{children}</LingoContext>;\n}\n\n/**\n * Access the `Lingo` translation object from the nearest `LingoProvider`.\n *\n * @throws If called outside a `<LingoProvider>`.\n *\n * @example\n * ```tsx\n * function Greeting() {\n * const l = useLingo();\n * return <h1>{l.text(\"Hello\")}</h1>;\n * }\n * ```\n */\nexport function useLingo(): Lingo {\n const ctx = useContext(LingoContext);\n if (ctx === null) {\n throw new Error(\n \"useLingo() called outside <LingoProvider>. \" +\n 'Wrap your component tree with <LingoProvider locale=\"en\"> to fix this.',\n );\n }\n return ctx.lingo;\n}\n"],"mappings":";;;;;;;;;;AAMA,MAAM,kBAAkB;CAAC;CAAK;CAAM;CAAM;C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