@fluenti/vue 0.2.1 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +5 -5
  2. package/dist/components/DateTime.d.ts +1 -1
  3. package/dist/components/DateTime.d.ts.map +1 -1
  4. package/dist/components/NumberFormat.d.ts +1 -1
  5. package/dist/components/NumberFormat.d.ts.map +1 -1
  6. package/dist/components/Plural.d.ts +12 -13
  7. package/dist/components/Plural.d.ts.map +1 -1
  8. package/dist/components/Select.d.ts +12 -13
  9. package/dist/components/Select.d.ts.map +1 -1
  10. package/dist/components/Trans.d.ts +7 -7
  11. package/dist/components/Trans.d.ts.map +1 -1
  12. package/dist/components/rich-text.d.ts +0 -6
  13. package/dist/components/rich-text.d.ts.map +1 -1
  14. package/dist/hooks/__useI18n.d.ts +2 -2
  15. package/dist/hooks/__useI18n.d.ts.map +1 -1
  16. package/dist/index.cjs +1 -1
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.ts +7 -7
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +155 -169
  21. package/dist/index.js.map +1 -1
  22. package/dist/plugin.d.ts +25 -14
  23. package/dist/plugin.d.ts.map +1 -1
  24. package/dist/server.cjs +2 -0
  25. package/dist/server.cjs.map +1 -0
  26. package/dist/server.d.ts +33 -13
  27. package/dist/server.d.ts.map +1 -1
  28. package/dist/server.js +54 -0
  29. package/dist/server.js.map +1 -0
  30. package/dist/use-i18n.d.ts +3 -3
  31. package/dist/use-i18n.d.ts.map +1 -1
  32. package/dist/vite-plugin.cjs +1 -111
  33. package/dist/vite-plugin.cjs.map +1 -1
  34. package/dist/vite-plugin.js +18 -126
  35. package/dist/vite-plugin.js.map +1 -1
  36. package/dist/vue-runtime.d.ts.map +1 -1
  37. package/llms-full.txt +220 -0
  38. package/llms-migration.txt +199 -0
  39. package/llms.txt +82 -0
  40. package/package.json +17 -5
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../src/use-i18n.ts","../src/components/rich-text.ts","../src/components/Trans.ts","../src/components/Plural.ts","../src/components/Select.ts","../src/components/DateTime.ts","../src/components/NumberFormat.ts","../src/plugin.ts","../src/compile-time-t.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { FLUENTI_KEY, type FluentVueContext } from './plugin'\n\n/**\n * Composable that returns the Fluenti i18n context.\n *\n * Must be called inside a component whose ancestor app has installed the\n * `createFluentVue()` plugin.\n *\n * @throws If the plugin has not been installed\n */\nexport function useI18n(): FluentVueContext {\n const ctx = inject(FLUENTI_KEY)\n if (!ctx) {\n throw new Error('[fluenti] useI18n() requires createFluentVue plugin')\n }\n return ctx\n}\n","import { Comment, Text, h, isVNode, type VNode, type VNodeChild } from 'vue'\n\nexport function offsetIndices(message: string, offset: number): string {\n if (offset === 0) return message\n return message\n .replace(/<(\\d+)(\\/?>)/g, (_match, index: string, suffix: string) => `<${Number(index) + offset}${suffix}`)\n .replace(/<\\/(\\d+)>/g, (_match, index: string) => `</${Number(index) + offset}>`)\n}\n\nexport function extractMessage(children: VNodeChild | VNodeChild[] | undefined): {\n message: string\n components: VNode[]\n} {\n const components: VNode[] = []\n let message = ''\n\n function visit(node: VNodeChild | VNodeChild[] | undefined): void {\n if (node === null || node === undefined || typeof node === 'boolean') return\n if (Array.isArray(node)) {\n for (const child of node) visit(child)\n return\n }\n if (typeof node === 'string' || typeof node === 'number') {\n message += String(node)\n return\n }\n if (!isVNode(node) || node.type === Comment) return\n if (node.type === Text) {\n message += typeof node.children === 'string' ? node.children : ''\n return\n }\n\n const idx = components.length\n const inner = extractMessage(node.children as VNodeChild | VNodeChild[] | undefined)\n components.push(node)\n components.push(...inner.components)\n message += `<${idx}>${offsetIndices(inner.message, idx + 1)}</${idx}>`\n }\n\n visit(children)\n return { message, components }\n}\n\nexport function reconstruct(\n translated: string,\n components: VNode[],\n): VNodeChild {\n const tagRe = /<(\\d+)>([\\s\\S]*?)<\\/\\1>/g\n const result: VNodeChild[] = []\n let lastIndex = 0\n let match: RegExpExecArray | null\n\n tagRe.lastIndex = 0\n match = tagRe.exec(translated)\n while (match !== null) {\n if (match.index > lastIndex) {\n result.push(translated.slice(lastIndex, match.index))\n }\n\n const idx = Number(match[1])\n const component = components[idx]\n const innerContent = reconstruct(match[2]!, components)\n if (component) {\n result.push(h(component.type as never, component.props ?? {}, Array.isArray(innerContent) ? innerContent : [innerContent]))\n } else {\n result.push(match[2]!)\n }\n\n lastIndex = tagRe.lastIndex\n match = tagRe.exec(translated)\n }\n\n if (lastIndex < translated.length) {\n result.push(translated.slice(lastIndex))\n }\n\n return result.length <= 1 ? (result[0] ?? '') : result\n}\n\nexport function serializeRichForms<T extends string>(\n keys: readonly T[],\n forms: Partial<Record<T, VNodeChild>> & Record<string, VNodeChild | undefined>,\n): {\n messages: Record<string, string>\n components: VNode[]\n} {\n const messages: Record<string, string> = {}\n const components: VNode[] = []\n\n for (const key of keys) {\n const value = forms[key]\n if (value === undefined) continue\n const extracted = extractMessage(value)\n messages[key] = offsetIndices(extracted.message, components.length)\n components.push(...extracted.components)\n }\n\n for (const [key, value] of Object.entries(forms)) {\n if (keys.includes(key as T) || value === undefined) continue\n const extracted = extractMessage(value)\n messages[key] = offsetIndices(extracted.message, components.length)\n components.push(...extracted.components)\n }\n\n return { messages, components }\n}\n\nexport function buildICUSelectMessage(forms: Record<string, string>): string {\n return `{value, select, ${Object.entries(forms).map(([key, text]) => `${key} {${text}}`).join(' ')}}`\n}\n\nexport function normalizeSelectForms(forms: Record<string, string>): {\n forms: Record<string, string>\n valueMap: Record<string, string>\n} {\n const normalized: Record<string, string> = {}\n const valueMap: Record<string, string> = {}\n let index = 0\n\n for (const [key, text] of Object.entries(forms)) {\n if (key === 'other') {\n normalized['other'] = text\n continue\n }\n\n const safeKey = /^[A-Za-z0-9_]+$/.test(key) ? key : `case_${index++}`\n normalized[safeKey] = text\n valueMap[key] = safeKey\n }\n\n if (normalized['other'] === undefined) {\n normalized['other'] = ''\n }\n\n return { forms: normalized, valueMap }\n}\n","import { defineComponent, h } from 'vue'\nimport type { ExtractPropTypes } from 'vue'\nimport { useI18n } from '../use-i18n'\nimport { extractMessage, reconstruct } from './rich-text'\n\n/**\n * `<Trans>` component for rich text with Vue components.\n *\n * @example\n * ```vue\n * <Trans>\n * Visit our <a href=\"/docs\">documentation</a> to learn more.\n * </Trans>\n * ```\n *\n * @example\n * ```vue\n * <Trans>\n * Click <RouterLink to=\"/next\">here</RouterLink> to continue.\n * </Trans>\n * ```\n */\nconst transProps = {\n /** Override auto-generated hash ID */\n id: String,\n /** Message context used for identity and translator disambiguation */\n context: String,\n /** Translator-facing note preserved in extraction catalogs */\n comment: String,\n /** Wrapper element tag name (default: `span`) */\n tag: { type: String, default: 'span' },\n} as const\n\nexport type TransProps = Readonly<ExtractPropTypes<typeof transProps>>\n\nexport const Trans = defineComponent({\n name: 'Trans',\n props: transProps,\n setup(props, { slots }) {\n const { t } = useI18n()\n\n return () => {\n const defaultSlot = slots['default']?.()\n if (!defaultSlot) return null\n const { message, components } = extractMessage(defaultSlot)\n const translated = t({\n ...(props.id !== undefined ? { id: props.id } : {}),\n message,\n ...(props.context !== undefined ? { context: props.context } : {}),\n ...(props.comment !== undefined ? { comment: props.comment } : {}),\n })\n const result = components.length > 0 ? reconstruct(translated, components) : translated\n if (Array.isArray(result)) {\n return result.length === 1 ? result[0]! : h(props.tag, null, result)\n }\n return result\n }\n },\n})\n","import { defineComponent, h } from 'vue'\nimport type { ExtractPropTypes, SetupContext, VNodeChild } from 'vue'\nimport { hashMessage } from '@fluenti/core'\nimport { useI18n } from '../use-i18n'\nimport { reconstruct, serializeRichForms } from './rich-text'\n\n/** Plural category names in a stable order for ICU message building. */\nconst PLURAL_CATEGORIES = ['zero', 'one', 'two', 'few', 'many', 'other'] as const\n\ntype PluralCategory = (typeof PLURAL_CATEGORIES)[number]\n\n/**\n * Build an ICU plural message string from individual category props.\n *\n * Given `{ zero: \"No items\", one: \"# item\", other: \"# items\" }`,\n * produces `\"{count, plural, =0 {No items} one {# item} other {# items}}\"`.\n *\n * @internal\n */\nfunction buildICUPluralMessage(\n forms: Partial<Record<PluralCategory, string>> & { other: string },\n offset?: number,\n): string {\n const parts: string[] = []\n for (const cat of PLURAL_CATEGORIES) {\n const text = forms[cat]\n if (text !== undefined) {\n // Map the `zero` prop to ICU `=0` exact match. In ICU MessageFormat,\n // `zero` is a CLDR plural category that only activates in languages\n // with a grammatical zero form (e.g. Arabic). The `=0` exact match\n // works universally for the common \"show this when count is 0\" intent.\n const key = cat === 'zero' ? '=0' : cat\n parts.push(`${key} {${text}}`)\n }\n }\n const offsetPrefix = offset ? `offset:${offset} ` : ''\n return `{count, plural, ${offsetPrefix}${parts.join(' ')}}`\n}\n\n/**\n * `<Plural>` component — shorthand for ICU plural patterns.\n *\n * Plural form props (`zero`, `one`, `two`, `few`, `many`, `other`) are treated\n * as source-language messages. The component builds an ICU plural message,\n * looks it up via `t()` in the catalog, and interpolates the translated result.\n *\n * When no catalog translation exists, the component falls back to interpolating\n * the source-language ICU message directly via the `message` field of the\n * MessageDescriptor.\n *\n * Rich text is supported via named slots:\n * ```vue\n * <Plural :value=\"count\">\n * <template #zero>No <strong>items</strong></template>\n * <template #one><em>1</em> item</template>\n * <template #other><strong>{{ count }}</strong> items</template>\n * </Plural>\n * ```\n *\n * String props still work (backward compatible):\n * ```vue\n * <Plural :value=\"count\" zero=\"No items\" one=\"# item\" other=\"# items\" />\n * ```\n */\nconst pluralProps = {\n /** The numeric value to pluralise on */\n value: { type: Number, required: true },\n /** Override the auto-generated synthetic ICU message id */\n id: String,\n /** Message context used for identity and translator disambiguation */\n context: String,\n /** Translator-facing note preserved in extraction catalogs */\n comment: String,\n /** Text for zero items (maps to `=0`) */\n zero: String,\n /** Text for singular (maps to `one`) */\n one: String,\n /** Text for dual (maps to `two`) */\n two: String,\n /** Text for few (maps to `few`) */\n few: String,\n /** Text for many (maps to `many`) */\n many: String,\n /** Text for the default/other category */\n other: { type: String, default: undefined },\n /** Offset from value before selecting form */\n offset: Number,\n /** Wrapper element tag name (default: `span`) */\n tag: { type: String, default: 'span' },\n} as const\n\nexport type PluralProps = Readonly<ExtractPropTypes<typeof pluralProps>>\n\nexport const Plural = defineComponent({\n name: 'Plural',\n props: pluralProps,\n setup(props, { slots }: SetupContext) {\n const { t } = useI18n()\n\n return () => {\n const forms: Partial<Record<PluralCategory, VNodeChild>> & Record<string, VNodeChild | undefined> = {\n zero: props.zero,\n one: props.one,\n two: props.two,\n few: props.few,\n many: props.many,\n other: props.other ?? '',\n }\n\n for (const cat of PLURAL_CATEGORIES) {\n const slot = slots[cat]\n if (slot) {\n forms[cat] = slot({ count: '#' })\n }\n }\n\n const { messages, components } = serializeRichForms(PLURAL_CATEGORIES, forms)\n const icuMessage = buildICUPluralMessage(\n {\n ...(messages['zero'] !== undefined && { zero: messages['zero'] }),\n ...(messages['one'] !== undefined && { one: messages['one'] }),\n ...(messages['two'] !== undefined && { two: messages['two'] }),\n ...(messages['few'] !== undefined && { few: messages['few'] }),\n ...(messages['many'] !== undefined && { many: messages['many'] }),\n other: messages['other'] ?? '',\n },\n props.offset,\n )\n const translated = t(\n {\n id: props.id ?? (props.context === undefined ? icuMessage : hashMessage(icuMessage, props.context)),\n message: icuMessage,\n ...(props.context !== undefined ? { context: props.context } : {}),\n ...(props.comment !== undefined ? { comment: props.comment } : {}),\n },\n { count: props.value },\n )\n\n const result = components.length > 0 ? reconstruct(translated, components) : translated\n return h(props.tag, undefined, result ?? undefined)\n }\n },\n})\n","import { defineComponent, h } from 'vue'\nimport type { ExtractPropTypes, PropType, SetupContext, VNodeChild } from 'vue'\nimport { hashMessage } from '@fluenti/core'\nimport { useI18n } from '../use-i18n'\nimport { buildICUSelectMessage, normalizeSelectForms, reconstruct, serializeRichForms } from './rich-text'\n\n/**\n * `<Select>` component — shorthand for ICU select patterns.\n *\n * Accepts a `value` string that selects among named options. Options can be\n * provided via the type-safe `options` prop (recommended), as direct attrs\n * (convenience), or as named slots (rich text).\n *\n * Falls back to `other` when no match is found.\n *\n * @example Type-safe usage (recommended):\n * ```vue\n * <Select\n * :value=\"gender\"\n * :options=\"{ male: 'He liked it', female: 'She liked it' }\"\n * other=\"They liked it\"\n * />\n * ```\n *\n * @example Rich text via named slots:\n * ```vue\n * <Select :value=\"gender\">\n * <template #male><strong>He</strong> liked this</template>\n * <template #female><strong>She</strong> liked this</template>\n * <template #other><em>They</em> liked this</template>\n * </Select>\n * ```\n */\nconst selectProps = {\n /** The value to select on (e.g. `\"male\"`, `\"female\"`) */\n value: { type: String, required: true },\n /** Override the auto-generated synthetic ICU message id */\n id: String,\n /** Message context used for identity and translator disambiguation */\n context: String,\n /** Translator-facing note preserved in extraction catalogs */\n comment: String,\n /** Fallback text when no option matches `value` */\n other: { type: String, default: undefined },\n /**\n * Named options map. Keys are match values, values are display strings.\n * Takes precedence over attrs when both are provided.\n *\n * @example `{ male: 'He', female: 'She' }`\n */\n options: {\n type: Object as PropType<Record<string, string>>,\n default: undefined,\n },\n /** Wrapper element tag name (default: `span`) */\n tag: { type: String, default: 'span' },\n} as const\n\nexport type SelectProps = Readonly<ExtractPropTypes<typeof selectProps>>\n\nexport const Select = defineComponent({\n name: 'Select',\n inheritAttrs: false,\n props: selectProps,\n setup(props, { attrs, slots }: SetupContext) {\n const { t } = useI18n()\n\n return () => {\n const forms: Record<string, VNodeChild | undefined> = {}\n\n if (props.options !== undefined) {\n for (const [key, value] of Object.entries(props.options)) {\n forms[key] = value\n }\n forms['other'] = props.other ?? ''\n } else {\n for (const [key, value] of Object.entries(attrs)) {\n if (typeof value === 'string') {\n forms[key] = value\n }\n }\n forms['other'] = props.other ?? ''\n }\n\n for (const [key, slot] of Object.entries(slots)) {\n if (key === 'default' || !slot) continue\n forms[key] = slot({ value: '{value}' })\n }\n\n const orderedKeys = [...Object.keys(forms).filter(key => key !== 'other'), 'other'] as const\n const { messages, components } = serializeRichForms(orderedKeys, forms)\n const normalized = normalizeSelectForms(\n Object.fromEntries(\n [...orderedKeys].map((key) => [key, messages[key] ?? '']),\n ),\n )\n const icuMessage = buildICUSelectMessage(normalized.forms)\n const translated = t(\n {\n id: props.id ?? (props.context === undefined ? icuMessage : hashMessage(icuMessage, props.context)),\n message: icuMessage,\n ...(props.context !== undefined ? { context: props.context } : {}),\n ...(props.comment !== undefined ? { comment: props.comment } : {}),\n },\n { value: normalized.valueMap[props.value] ?? 'other' },\n )\n const result = components.length > 0 ? reconstruct(translated, components) : translated\n return h(props.tag, undefined, result ?? undefined)\n }\n },\n})\n","import { defineComponent, h } from 'vue'\nimport type { ExtractPropTypes, PropType } from 'vue'\nimport { useI18n } from '../use-i18n'\n\n/**\n * `<DateTime>` component for formatting dates according to locale.\n *\n * @example\n * ```vue\n * <DateTime :value=\"new Date()\" />\n * <DateTime :value=\"Date.now()\" style=\"short\" />\n * <DateTime :value=\"event.date\" style=\"long\" tag=\"time\" />\n * ```\n */\nconst dateTimeProps = {\n value: { type: [Date, Number] as PropType<Date | number>, required: true },\n style: { type: String, default: undefined },\n tag: { type: String, default: 'span' },\n} as const\n\nexport type DateTimeProps = Readonly<ExtractPropTypes<typeof dateTimeProps>>\n\nexport const DateTime = defineComponent({\n name: 'DateTime',\n props: dateTimeProps,\n setup(props) {\n const { d } = useI18n()\n return () => h(props.tag, d(props.value as Date | number, props.style))\n },\n})\n","import { defineComponent, h } from 'vue'\nimport type { ExtractPropTypes } from 'vue'\nimport { useI18n } from '../use-i18n'\n\n/**\n * `<NumberFormat>` component for formatting numbers according to locale.\n *\n * @example\n * ```vue\n * <NumberFormat :value=\"1234.56\" />\n * <NumberFormat :value=\"0.75\" style=\"percent\" />\n * <NumberFormat :value=\"99.99\" style=\"currency\" tag=\"strong\" />\n * ```\n */\nconst numberFormatProps = {\n value: { type: Number, required: true },\n style: { type: String, default: undefined },\n tag: { type: String, default: 'span' },\n} as const\n\nexport type NumberFormatProps = Readonly<ExtractPropTypes<typeof numberFormatProps>>\n\nexport const NumberFormat = defineComponent({\n name: 'NumberFormat',\n props: numberFormatProps,\n setup(props) {\n const { n } = useI18n()\n return () => h(props.tag, n(props.value, props.style))\n },\n})\n","import { type App, type InjectionKey, type Ref, ref, shallowReactive } from 'vue'\nimport type { AllMessages, Locale, Messages, CompiledMessage, MessageDescriptor } from '@fluenti/core'\nimport { interpolate, formatDate, formatNumber, buildICUMessage, resolveDescriptorId } from '@fluenti/core'\nimport { Trans } from './components/Trans'\nimport { Plural } from './components/Plural'\nimport { Select } from './components/Select'\nimport { DateTime } from './components/DateTime'\nimport { NumberFormat } from './components/NumberFormat'\n\n/** Escape HTML special characters to prevent XSS. @internal */\nfunction escapeHtml(str: string): string {\n return str.replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;')\n}\n\n/** Compiled message chunk loader for lazy locale loading */\nexport type ChunkLoader = (\n locale: string,\n) => Promise<Record<string, CompiledMessage> | { default: Record<string, CompiledMessage> }>\n\ninterface SplitRuntimeModule {\n __switchLocale?: (locale: string) => Promise<void>\n __preloadLocale?: (locale: string) => Promise<void>\n}\n\nconst SPLIT_RUNTIME_KEY = Symbol.for('fluenti.runtime.vue')\n\nfunction getSplitRuntimeModule(): SplitRuntimeModule | null {\n const runtime = (globalThis as Record<PropertyKey, unknown>)[SPLIT_RUNTIME_KEY]\n return typeof runtime === 'object' && runtime !== null\n ? runtime as SplitRuntimeModule\n : null\n}\n\nfunction resolveChunkMessages(\n loaded: Record<string, CompiledMessage> | { default: Record<string, CompiledMessage> },\n): Record<string, CompiledMessage> {\n return typeof loaded === 'object' && loaded !== null && 'default' in loaded\n ? (loaded as { default: Record<string, CompiledMessage> }).default\n : loaded\n}\n\n/** Context object returned by `useI18n()` and available as `$t` etc. on globalProperties */\nexport interface FluentVueContext {\n /** Translate a message by id or MessageDescriptor, with optional interpolation values */\n t(id: string | MessageDescriptor, values?: Record<string, unknown>): string\n /** Tagged template form: t`Hello ${name}` */\n t(strings: TemplateStringsArray, ...exprs: unknown[]): string\n /** Reactive ref for current locale */\n locale: Readonly<Ref<Locale>>\n /** Change the active locale (async when lazy locale loading is enabled) */\n setLocale(locale: Locale): Promise<void>\n /** Dynamically load messages for a locale */\n loadMessages(locale: Locale, messages: Messages): void\n /** Get all locales that have loaded messages */\n getLocales(): Locale[]\n /** Format a date value according to locale */\n d(value: Date | number, style?: string): string\n /** Format a number according to locale */\n n(value: number, style?: string): string\n /** Format an ICU message string directly (no catalog lookup) */\n format(message: string, values?: Record<string, unknown>): string\n /** Whether a locale chunk is currently being loaded */\n isLoading: Readonly<Ref<boolean>>\n /** Set of locales whose messages have been loaded */\n loadedLocales: Readonly<Ref<ReadonlySet<string>>>\n /** Preload a locale in the background without switching to it */\n preloadLocale(locale: string): void\n /** Check if a translation key exists in the catalog */\n te(key: string, locale?: string): boolean\n /** Get the raw compiled message without interpolation */\n tm(key: string, locale?: string): CompiledMessage | undefined\n}\n\n/** Injection key for providing/injecting fluenti context */\nexport const FLUENTI_KEY: InjectionKey<FluentVueContext> = Symbol('fluenti')\n\n/** Options for creating the FluentVue plugin */\nexport interface FluentVueOptions {\n locale: string\n fallbackLocale?: string\n messages: AllMessages\n missing?: (locale: string, id: string) => string | undefined\n dateFormats?: Record<string, Intl.DateTimeFormatOptions | 'relative'>\n numberFormats?: Record<string, Intl.NumberFormatOptions | ((locale: string) => Intl.NumberFormatOptions)>\n fallbackChain?: Record<string, string[]>\n /** Async chunk loader for lazy locale loading */\n chunkLoader?: ChunkLoader\n /** Enable lazy locale loading through chunkLoader */\n lazyLocaleLoading?: boolean\n /**\n * Prefix for globally registered components (Trans, Plural, Select).\n *\n * Set this to avoid naming conflicts with other libraries.\n *\n * @example\n * componentPrefix: 'I18n'\n * // Registers: I18nTrans, I18nPlural, I18nSelect\n *\n * @example\n * componentPrefix: 'Fluenti'\n * // Registers: FluentiTrans, FluentiPlural, FluentiSelect\n *\n * @default '' (no prefix — Trans, Plural, Select)\n */\n componentPrefix?: string\n}\n\n/** Return value of `createFluentVue()` */\nexport interface FluentVuePlugin {\n /** Vue plugin install method */\n install(app: App): void\n /** The global fluenti context (same as what useI18n returns) */\n global: FluentVueContext\n}\n\n/**\n * Resolve a compiled message to a string, applying values if needed.\n * @internal\n */\nfunction resolveMessage(\n compiled: CompiledMessage,\n values?: Record<string, unknown>,\n locale?: string,\n): string {\n if (typeof compiled === 'function') {\n return compiled(values)\n }\n // Use core interpolate for ICU message parsing (handles plural, select, etc.)\n return interpolate(compiled, values, locale)\n}\n\n/** Extract the attribute name from v-t modifiers (e.g., v-t.alt → 'alt') */\nfunction getModifierAttr(modifiers: Partial<Record<string, boolean>>): string | undefined {\n const keys = Object.keys(modifiers).filter((k) => k !== 'plural')\n return keys.length > 0 ? keys[0] : undefined\n}\n\n/**\n * Create a Fluenti Vue plugin (SSR-safe, per-request instance).\n *\n * Each invocation creates entirely fresh state — no module-level singletons —\n * so it is safe to call once per SSR request.\n */\nexport function createFluentVue(options: FluentVueOptions): FluentVuePlugin {\n const lazyLocaleLoading = options.lazyLocaleLoading\n ?? (options as FluentVueOptions & { splitting?: boolean }).splitting\n ?? false\n const locale = ref(options.locale)\n // Intentional mutation: Vue's shallowReactive API requires in-place property assignment for reactivity\n const catalogs = shallowReactive<AllMessages>({ ...options.messages })\n const isLoading = ref(false)\n const loadedLocalesSet = new Set<string>([options.locale])\n const loadedLocales = ref<ReadonlySet<string>>(new Set(loadedLocalesSet))\n\n function lookup(\n loc: Locale,\n id: string,\n ): CompiledMessage | undefined {\n const msgs = catalogs[loc]\n if (!msgs) return undefined\n return msgs[id]\n }\n\n function t(strings: TemplateStringsArray, ...exprs: unknown[]): string\n function t(id: string | MessageDescriptor, values?: Record<string, unknown>): string\n function t(idOrStrings: string | MessageDescriptor | TemplateStringsArray, ...rest: unknown[]): string {\n // Tagged template form: t`Hello ${name}`\n if (Array.isArray(idOrStrings) && 'raw' in idOrStrings) {\n const strings = idOrStrings as TemplateStringsArray\n const icu = buildICUMessage(strings, rest)\n const values = Object.fromEntries(rest.map((v, i) => [String(i), v]))\n // Delegate to the function-call path with the ICU string as the id\n return t(icu, values)\n }\n\n // Function call form\n const id = idOrStrings as string | MessageDescriptor\n const values = rest[0] as Record<string, unknown> | undefined\n\n // Handle MessageDescriptor objects (from msg``)\n let messageId: string\n let fallbackMessage: string | undefined\n if (typeof id === 'object' && id !== null) {\n messageId = resolveDescriptorId(id) ?? ''\n fallbackMessage = id.message\n } else {\n messageId = id\n }\n\n // Read locale.value to register a Vue reactive dependency\n const currentLocale = locale.value\n\n // Build the chain of locales to try\n const chain: Locale[] = [currentLocale]\n\n if (options.fallbackLocale && !chain.includes(options.fallbackLocale)) {\n chain.push(options.fallbackLocale)\n }\n\n if (options.fallbackChain?.[currentLocale]) {\n for (const fallback of options.fallbackChain[currentLocale]) {\n if (!chain.includes(fallback)) {\n chain.push(fallback)\n }\n }\n } else if (options.fallbackChain?.['*']) {\n for (const fallback of options.fallbackChain['*']) {\n if (!chain.includes(fallback)) {\n chain.push(fallback)\n }\n }\n }\n\n for (const loc of chain) {\n const compiled = lookup(loc, messageId)\n if (compiled !== undefined) {\n return resolveMessage(compiled, values, loc)\n }\n }\n\n // Try the missing handler\n if (options.missing) {\n const result = options.missing(currentLocale, messageId)\n if (result !== undefined) return result\n }\n\n // If we have a fallback message from a MessageDescriptor, interpolate it\n if (fallbackMessage) {\n return interpolate(fallbackMessage, values, currentLocale)\n }\n\n // Final fallback — if the id looks like an ICU message, interpolate it\n // (compile-time transforms like <Plural> emit inline ICU as t() arguments)\n if (messageId.includes('{')) {\n return interpolate(messageId, values, currentLocale)\n }\n return messageId\n }\n\n async function setLocale(newLocale: Locale): Promise<void> {\n if (!lazyLocaleLoading || !options.chunkLoader) {\n locale.value = newLocale\n return\n }\n\n const splitRuntime = getSplitRuntimeModule()\n\n if (loadedLocalesSet.has(newLocale)) {\n // Already loaded, instant switch\n if (splitRuntime?.__switchLocale) {\n await splitRuntime.__switchLocale(newLocale)\n }\n locale.value = newLocale\n return\n }\n\n // Async load\n isLoading.value = true\n try {\n const messages = resolveChunkMessages(await options.chunkLoader(newLocale))\n // Intentional mutation: Vue's shallowReactive API requires in-place property assignment for reactivity\n catalogs[newLocale] = { ...catalogs[newLocale], ...messages }\n loadedLocalesSet.add(newLocale)\n loadedLocales.value = new Set(loadedLocalesSet)\n if (splitRuntime?.__switchLocale) {\n await splitRuntime.__switchLocale(newLocale)\n }\n locale.value = newLocale\n } finally {\n isLoading.value = false\n }\n }\n\n function loadMessages(loc: Locale, messages: Messages): void {\n // Intentional mutation: Vue's shallowReactive API requires in-place property assignment for reactivity\n catalogs[loc] = { ...catalogs[loc], ...messages }\n loadedLocalesSet.add(loc)\n loadedLocales.value = new Set(loadedLocalesSet)\n }\n\n function preloadLocale(loc: string): void {\n if (!lazyLocaleLoading || loadedLocalesSet.has(loc) || !options.chunkLoader) return\n const splitRuntime = getSplitRuntimeModule()\n options.chunkLoader(loc).then(async (loaded) => {\n const messages = resolveChunkMessages(loaded)\n // Intentional mutation: Vue's shallowReactive API requires in-place property assignment for reactivity\n catalogs[loc] = { ...catalogs[loc], ...messages }\n loadedLocalesSet.add(loc)\n loadedLocales.value = new Set(loadedLocalesSet)\n if (splitRuntime?.__preloadLocale) {\n await splitRuntime.__preloadLocale(loc)\n }\n }).catch((e: unknown) => {\n console.warn('[fluenti] preload failed:', loc, e)\n })\n }\n\n function getLocales(): Locale[] {\n return Object.keys(catalogs)\n }\n\n function d(value: Date | number, style?: string): string {\n const currentLocale = locale.value\n return formatDate(value, currentLocale, style, options.dateFormats)\n }\n\n function n(value: number, style?: string): string {\n const currentLocale = locale.value\n return formatNumber(value, currentLocale, style, options.numberFormats)\n }\n\n function format(message: string, values?: Record<string, unknown>): string {\n return resolveMessage(message, values, locale.value)\n }\n\n /**\n * Rich text helper for v-t with child elements.\n * Translates the message (which contains `<0>content</0>` placeholders),\n * then replaces each placeholder with the original HTML element.\n * Used via `v-html=\"$vtRich('msg', elements)\"` in compile-time transforms.\n * @internal\n */\n function vtRich(\n message: string | MessageDescriptor,\n elements: Array<{ tag: string; attrs: Record<string, string> }>,\n values?: Record<string, unknown>,\n ): string {\n const translated = values ? t(message, values) : t(message)\n // Escape the entire translated string first to neutralise any injected HTML\n const escaped = escapeHtml(translated)\n // Restore numbered placeholders (now escaped as &lt;0&gt;...&lt;/0&gt;) back to real HTML\n return escaped.replace(/&lt;(\\d+)&gt;([\\s\\S]*?)&lt;\\/\\1&gt;/g, (_match, idxStr: string, content: string) => {\n const el = elements[Number(idxStr)]\n if (!el) return content\n const attrs = Object.entries(el.attrs)\n .map(([k, v]) => v ? `${escapeHtml(k)}=\"${escapeHtml(v)}\"` : escapeHtml(k))\n .join(' ')\n const tag = escapeHtml(el.tag)\n return `<${tag}${attrs ? ' ' + attrs : ''}>${content}</${tag}>`\n })\n }\n\n function te(key: string, loc?: string): boolean {\n const targetLocale = loc ?? locale.value\n return lookup(targetLocale, key) !== undefined\n }\n\n function tm(key: string, loc?: string): CompiledMessage | undefined {\n const targetLocale = loc ?? locale.value\n return lookup(targetLocale, key)\n }\n\n const context: FluentVueContext = {\n t,\n locale,\n setLocale,\n loadMessages,\n getLocales,\n d,\n n,\n format,\n isLoading,\n loadedLocales,\n preloadLocale,\n te,\n tm,\n }\n\n return {\n install(app: App) {\n app.provide(FLUENTI_KEY, context)\n const prefix = options.componentPrefix ?? ''\n app.component(`${prefix}Trans`, Trans)\n app.component(`${prefix}Plural`, Plural)\n app.component(`${prefix}Select`, Select)\n app.component(`${prefix}DateTime`, DateTime)\n app.component(`${prefix}NumberFormat`, NumberFormat)\n app.config.globalProperties['$t'] = t\n app.config.globalProperties['$d'] = d\n app.config.globalProperties['$n'] = n\n app.config.globalProperties['$vtRich'] = vtRich\n\n // Runtime v-t directive (fallback when compile-time transform is not used)\n const vtOriginalIds = new WeakMap<HTMLElement, string>()\n app.directive('t', {\n mounted(el, binding) {\n const attrName = getModifierAttr(binding.modifiers)\n if (attrName) {\n // v-t.alt, v-t.placeholder, etc. — translate the attribute\n const original = el.getAttribute(attrName) ?? ''\n vtOriginalIds.set(el, original)\n el.setAttribute(attrName, t(original))\n } else {\n // v-t or v-t:id — translate text content\n const id = binding.arg ?? el.textContent ?? ''\n vtOriginalIds.set(el, id.trim())\n el.textContent = t(id.trim(), binding.value != null ? { ...binding.value } : undefined)\n }\n },\n updated(el, binding) {\n const attrName = getModifierAttr(binding.modifiers)\n if (attrName) {\n const original = vtOriginalIds.get(el) ?? el.getAttribute(attrName) ?? ''\n el.setAttribute(attrName, t(original))\n } else {\n const id = binding.arg ?? vtOriginalIds.get(el) ?? ''\n el.textContent = t(id.trim(), binding.value != null ? { ...binding.value } : undefined)\n }\n },\n })\n },\n global: context,\n }\n}\n","import type { CompileTimeT } from '@fluenti/core'\n\nexport const t: CompileTimeT = ((..._args: unknown[]) => {\n throw new Error(\n \"[fluenti] `t` imported from '@fluenti/vue' is a compile-time API. \" +\n 'Use it only with the Fluenti build transform inside <script setup> or setup(). ' +\n 'For runtime lookups, use useI18n().t(...).',\n )\n}) as CompileTimeT\n"],"mappings":"mHAWA,SAAgB,GAA4B,CAC1C,IAAM,GAAA,EAAA,EAAA,QAAa,EAAY,CAC/B,GAAI,CAAC,EACH,MAAU,MAAM,sDAAsD,CAExE,OAAO,ECdT,SAAgB,EAAc,EAAiB,EAAwB,CAErE,OADI,IAAW,EAAU,EAClB,EACJ,QAAQ,iBAAkB,EAAQ,EAAe,IAAmB,IAAI,OAAO,EAAM,CAAG,IAAS,IAAS,CAC1G,QAAQ,cAAe,EAAQ,IAAkB,KAAK,OAAO,EAAM,CAAG,EAAO,GAAG,CAGrF,SAAgB,EAAe,EAG7B,CACA,IAAM,EAAsB,EAAE,CAC1B,EAAU,GAEd,SAAS,EAAM,EAAmD,CAChE,GAAI,GAAS,MAA8B,OAAO,GAAS,UAAW,OACtE,GAAI,MAAM,QAAQ,EAAK,CAAE,CACvB,IAAK,IAAM,KAAS,EAAM,EAAM,EAAM,CACtC,OAEF,GAAI,OAA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CAAC,CAChC,EAAG,YAAc,EAAE,EAAG,MAAM,CAAE,EAAQ,OAAS,KAA8B,IAAA,GAAvB,CAAE,GAAG,EAAQ,MAAO,CAAa,GAG3F,QAAQ,EAAI,EAAS,CACnB,IAAM,EAAW,EAAgB,EAAQ,UAAU,CACnD,GAAI,EAAU,CACZ,IAAM,EAAW,EAAc,IAAI,EAAG,EAAI,EAAG,aAAa,EAAS,EAAI,GACvE,EAAG,aAAa,EAAU,EAAE,EAAS,CAAC,MAGtC,EAAG,YAAc,GADN,EAAQ,KAAO,EAAc,IAAI,EAAG,EAAI,IAC7B,MAAM,CAAE,EAAQ,OAAS,KAA8B,IAAA,GAAvB,CAAE,GAAG,EAAQ,MAAO,CAAa,EAG5F,CAAC,EAEJ,OAAQ,EACT,CC1ZH,IAAa,IAAoB,GAAG,IAAqB,CACvD,MAAU,MACR,8LAGD"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../src/use-i18n.ts","../src/components/rich-text.ts","../src/components/Trans.ts","../src/components/Plural.ts","../src/components/Select.ts","../src/components/DateTime.ts","../src/components/NumberFormat.ts","../src/plugin.ts","../src/compile-time-t.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { FLUENTI_KEY, type FluentiContext } from './plugin'\n\n/**\n * Composable that returns the Fluenti i18n context.\n *\n * Must be called inside a component whose ancestor app has installed the\n * `createFluenti()` plugin.\n *\n * @throws If the plugin has not been installed\n */\nexport function useI18n(): FluentiContext {\n const ctx = inject(FLUENTI_KEY)\n if (!ctx) {\n throw new Error('[fluenti] useI18n() requires createFluenti plugin')\n }\n return ctx\n}\n","import { Comment, Text, h, isVNode, type VNode, type VNodeChild } from 'vue'\nimport { offsetIndices } from '@fluenti/core/internal'\n\nexport function extractMessage(children: VNodeChild | VNodeChild[] | undefined): {\n message: string\n components: VNode[]\n} {\n const components: VNode[] = []\n let message = ''\n\n function visit(node: VNodeChild | VNodeChild[] | undefined): void {\n if (node === null || node === undefined || typeof node === 'boolean') return\n if (Array.isArray(node)) {\n for (const child of node) visit(child)\n return\n }\n if (typeof node === 'string' || typeof node === 'number') {\n message += String(node)\n return\n }\n if (!isVNode(node) || node.type === Comment) return\n if (node.type === Text) {\n message += typeof node.children === 'string' ? node.children : ''\n return\n }\n\n const idx = components.length\n const inner = extractMessage(node.children as VNodeChild | VNodeChild[] | undefined)\n components.push(node)\n components.push(...inner.components)\n message += `<${idx}>${offsetIndices(inner.message, idx + 1)}</${idx}>`\n }\n\n visit(children)\n return { message, components }\n}\n\nexport function reconstruct(\n translated: string,\n components: VNode[],\n): VNodeChild {\n const tagRe = /<(\\d+)>([\\s\\S]*?)<\\/\\1>/g\n const result: VNodeChild[] = []\n let lastIndex = 0\n let match: RegExpExecArray | null\n\n tagRe.lastIndex = 0\n match = tagRe.exec(translated)\n while (match !== null) {\n if (match.index > lastIndex) {\n result.push(translated.slice(lastIndex, match.index))\n }\n\n const idx = Number(match[1])\n const component = components[idx]\n const innerContent = reconstruct(match[2]!, components)\n if (component) {\n result.push(h(component.type as never, component.props ?? {}, Array.isArray(innerContent) ? innerContent : [innerContent]))\n } else {\n result.push(match[2]!)\n }\n\n lastIndex = tagRe.lastIndex\n match = tagRe.exec(translated)\n }\n\n if (lastIndex < translated.length) {\n result.push(translated.slice(lastIndex))\n }\n\n return result.length <= 1 ? (result[0] ?? '') : result\n}\n\nexport function serializeRichForms<T extends string>(\n keys: readonly T[],\n forms: Partial<Record<T, VNodeChild>> & Record<string, VNodeChild | undefined>,\n): {\n messages: Record<string, string>\n components: VNode[]\n} {\n const messages: Record<string, string> = {}\n const components: VNode[] = []\n\n for (const key of keys) {\n const value = forms[key]\n if (value === undefined) continue\n const extracted = extractMessage(value)\n messages[key] = offsetIndices(extracted.message, components.length)\n components.push(...extracted.components)\n }\n\n for (const [key, value] of Object.entries(forms)) {\n if (keys.includes(key as T) || value === undefined) continue\n const extracted = extractMessage(value)\n messages[key] = offsetIndices(extracted.message, components.length)\n components.push(...extracted.components)\n }\n\n return { messages, components }\n}\n\n","import { defineComponent, h } from 'vue'\nimport type { ExtractPropTypes } from 'vue'\nimport { useI18n } from '../use-i18n'\nimport { extractMessage, reconstruct } from './rich-text'\n\n/**\n * `<Trans>` component for rich text with Vue components.\n *\n * @example\n * ```vue\n * <Trans>\n * Visit our <a href=\"/docs\">documentation</a> to learn more.\n * </Trans>\n * ```\n *\n * @example\n * ```vue\n * <Trans>\n * Click <RouterLink to=\"/next\">here</RouterLink> to continue.\n * </Trans>\n * ```\n */\nconst transProps = {\n /** Override auto-generated hash ID */\n id: String,\n /** Message context used for identity and translator disambiguation */\n context: String,\n /** Translator-facing note preserved in extraction catalogs */\n comment: String,\n /** Wrapper element tag name. Defaults to no wrapper (Fragment). */\n tag: { type: String, default: undefined },\n} as const\n\nexport type FluentiTransProps = Readonly<ExtractPropTypes<typeof transProps>>\n\nexport const Trans = defineComponent({\n name: 'Trans',\n props: transProps,\n setup(props, { slots }) {\n const { t } = useI18n()\n\n return () => {\n const defaultSlot = slots['default']?.()\n if (!defaultSlot) return null\n const { message, components } = extractMessage(defaultSlot)\n const translated = t({\n ...(props.id !== undefined ? { id: props.id } : {}),\n message,\n ...(props.context !== undefined ? { context: props.context } : {}),\n ...(props.comment !== undefined ? { comment: props.comment } : {}),\n })\n const result = components.length > 0 ? reconstruct(translated, components) : translated\n if (Array.isArray(result)) {\n if (result.length === 1) return result[0]!\n return props.tag ? h(props.tag, null, result) : result\n }\n return result\n }\n },\n})\n","import { defineComponent, h } from 'vue'\nimport type { ExtractPropTypes, SetupContext, VNodeChild } from 'vue'\nimport { hashMessage, buildICUPluralMessage, PLURAL_CATEGORIES, type PluralCategory } from '@fluenti/core/internal'\nimport { useI18n } from '../use-i18n'\nimport { reconstruct, serializeRichForms } from './rich-text'\n\n/**\n * `<Plural>` component — shorthand for ICU plural patterns.\n *\n * Plural form props (`zero`, `one`, `two`, `few`, `many`, `other`) are treated\n * as source-language messages. The component builds an ICU plural message,\n * looks it up via `t()` in the catalog, and interpolates the translated result.\n *\n * When no catalog translation exists, the component falls back to interpolating\n * the source-language ICU message directly via the `message` field of the\n * MessageDescriptor.\n *\n * Rich text is supported via named slots:\n * ```vue\n * <Plural :value=\"count\">\n * <template #zero>No <strong>items</strong></template>\n * <template #one><em>1</em> item</template>\n * <template #other><strong>{{ count }}</strong> items</template>\n * </Plural>\n * ```\n *\n * String props still work (backward compatible):\n * ```vue\n * <Plural :value=\"count\" zero=\"No items\" one=\"# item\" other=\"# items\" />\n * ```\n */\nconst pluralProps = {\n /** The numeric value to pluralise on */\n value: { type: Number, required: true },\n /** Override the auto-generated synthetic ICU message id */\n id: String,\n /** Message context used for identity and translator disambiguation */\n context: String,\n /** Translator-facing note preserved in extraction catalogs */\n comment: String,\n /** Text for zero items (maps to `=0`) */\n zero: String,\n /** Text for singular (maps to `one`) */\n one: String,\n /** Text for dual (maps to `two`) */\n two: String,\n /** Text for few (maps to `few`) */\n few: String,\n /** Text for many (maps to `many`) */\n many: String,\n /** Text for the default/other category */\n other: { type: String, required: true },\n /** Offset from value before selecting form */\n offset: Number,\n /** Wrapper element tag name. Defaults to no wrapper (Fragment). */\n tag: { type: String, default: undefined },\n} as const\n\nexport type FluentiPluralProps = Readonly<ExtractPropTypes<typeof pluralProps>>\n\nexport const Plural = defineComponent({\n name: 'Plural',\n props: pluralProps,\n setup(props, { slots }: SetupContext) {\n const { t } = useI18n()\n\n return () => {\n const forms: Partial<Record<PluralCategory, VNodeChild>> & Record<string, VNodeChild | undefined> = {\n zero: props.zero,\n one: props.one,\n two: props.two,\n few: props.few,\n many: props.many,\n other: props.other,\n }\n\n for (const cat of PLURAL_CATEGORIES) {\n const slot = slots[cat]\n if (slot) {\n forms[cat] = slot({ count: '#' })\n }\n }\n\n const { messages, components } = serializeRichForms(PLURAL_CATEGORIES, forms)\n const icuMessage = buildICUPluralMessage(\n {\n ...(messages['zero'] !== undefined && { zero: messages['zero'] }),\n ...(messages['one'] !== undefined && { one: messages['one'] }),\n ...(messages['two'] !== undefined && { two: messages['two'] }),\n ...(messages['few'] !== undefined && { few: messages['few'] }),\n ...(messages['many'] !== undefined && { many: messages['many'] }),\n other: messages['other'] ?? '',\n },\n props.offset,\n )\n const translated = t(\n {\n id: props.id ?? (props.context === undefined ? icuMessage : hashMessage(icuMessage, props.context)),\n message: icuMessage,\n ...(props.context !== undefined ? { context: props.context } : {}),\n ...(props.comment !== undefined ? { comment: props.comment } : {}),\n },\n { count: props.value },\n )\n\n const result = components.length > 0 ? reconstruct(translated, components) : translated\n if (props.tag) return h(props.tag, undefined, result ?? undefined)\n return result ?? null\n }\n },\n})\n","import { defineComponent, h } from 'vue'\nimport type { ExtractPropTypes, PropType, SetupContext, VNodeChild } from 'vue'\nimport { hashMessage, buildICUSelectMessage, normalizeSelectForms } from '@fluenti/core/internal'\nimport { useI18n } from '../use-i18n'\nimport { reconstruct, serializeRichForms } from './rich-text'\n\n/**\n * `<Select>` component — shorthand for ICU select patterns.\n *\n * Accepts a `value` string that selects among named options. Options can be\n * provided via the type-safe `options` prop (recommended), as direct attrs\n * (convenience), or as named slots (rich text).\n *\n * Falls back to `other` when no match is found.\n *\n * @example Type-safe usage (recommended):\n * ```vue\n * <Select\n * :value=\"gender\"\n * :options=\"{ male: 'He liked it', female: 'She liked it' }\"\n * other=\"They liked it\"\n * />\n * ```\n *\n * @example Rich text via named slots:\n * ```vue\n * <Select :value=\"gender\">\n * <template #male><strong>He</strong> liked this</template>\n * <template #female><strong>She</strong> liked this</template>\n * <template #other><em>They</em> liked this</template>\n * </Select>\n * ```\n */\nconst selectProps = {\n /** The value to select on (e.g. `\"male\"`, `\"female\"`) */\n value: { type: String, required: true },\n /** Override the auto-generated synthetic ICU message id */\n id: String,\n /** Message context used for identity and translator disambiguation */\n context: String,\n /** Translator-facing note preserved in extraction catalogs */\n comment: String,\n /** Fallback text when no option matches `value` */\n other: { type: String, required: true },\n /**\n * Named options map. Keys are match values, values are display strings.\n * Takes precedence over attrs when both are provided.\n *\n * @example `{ male: 'He', female: 'She' }`\n */\n options: {\n type: Object as PropType<Record<string, string>>,\n default: undefined,\n },\n /** Wrapper element tag name. Defaults to no wrapper (Fragment). */\n tag: { type: String, default: undefined },\n} as const\n\nexport type FluentiSelectProps = Readonly<ExtractPropTypes<typeof selectProps>>\n\nexport const Select = defineComponent({\n name: 'Select',\n inheritAttrs: false,\n props: selectProps,\n setup(props, { attrs, slots }: SetupContext) {\n const { t } = useI18n()\n\n return () => {\n const forms: Record<string, VNodeChild | undefined> = {}\n\n if (props.options !== undefined) {\n for (const [key, value] of Object.entries(props.options)) {\n forms[key] = value\n }\n forms['other'] = props.other\n } else {\n for (const [key, value] of Object.entries(attrs)) {\n if (typeof value === 'string') {\n forms[key] = value\n }\n }\n forms['other'] = props.other\n }\n\n for (const [key, slot] of Object.entries(slots)) {\n if (key === 'default' || !slot) continue\n forms[key] = slot({ value: '{value}' })\n }\n\n const orderedKeys = [...Object.keys(forms).filter(key => key !== 'other'), 'other'] as const\n const { messages, components } = serializeRichForms(orderedKeys, forms)\n const normalized = normalizeSelectForms(\n Object.fromEntries(\n [...orderedKeys].map((key) => [key, messages[key] ?? '']),\n ),\n )\n const icuMessage = buildICUSelectMessage(normalized.forms)\n const translated = t(\n {\n id: props.id ?? (props.context === undefined ? icuMessage : hashMessage(icuMessage, props.context)),\n message: icuMessage,\n ...(props.context !== undefined ? { context: props.context } : {}),\n ...(props.comment !== undefined ? { comment: props.comment } : {}),\n },\n { value: normalized.valueMap[props.value] ?? 'other' },\n )\n const result = components.length > 0 ? reconstruct(translated, components) : translated\n if (props.tag) return h(props.tag, undefined, result ?? undefined)\n return result ?? null\n }\n },\n})\n","import { defineComponent, h } from 'vue'\nimport type { ExtractPropTypes, PropType } from 'vue'\nimport { useI18n } from '../use-i18n'\n\n/**\n * `<DateTime>` component for formatting dates according to locale.\n *\n * @example\n * ```vue\n * <DateTime :value=\"new Date()\" />\n * <DateTime :value=\"Date.now()\" style=\"short\" />\n * <DateTime :value=\"event.date\" style=\"long\" tag=\"time\" />\n * ```\n */\nconst dateTimeProps = {\n value: { type: [Date, Number] as PropType<Date | number>, required: true },\n style: { type: String, default: undefined },\n tag: { type: String, default: 'span' },\n} as const\n\nexport type FluentiDateTimeProps = Readonly<ExtractPropTypes<typeof dateTimeProps>>\n\nexport const DateTime = defineComponent({\n name: 'DateTime',\n props: dateTimeProps,\n setup(props) {\n const { d } = useI18n()\n return () => h(props.tag, d(props.value as Date | number, props.style))\n },\n})\n","import { defineComponent, h } from 'vue'\nimport type { ExtractPropTypes } from 'vue'\nimport { useI18n } from '../use-i18n'\n\n/**\n * `<NumberFormat>` component for formatting numbers according to locale.\n *\n * @example\n * ```vue\n * <NumberFormat :value=\"1234.56\" />\n * <NumberFormat :value=\"0.75\" style=\"percent\" />\n * <NumberFormat :value=\"99.99\" style=\"currency\" tag=\"strong\" />\n * ```\n */\nconst numberFormatProps = {\n value: { type: Number, required: true },\n style: { type: String, default: undefined },\n tag: { type: String, default: 'span' },\n} as const\n\nexport type FluentiNumberFormatProps = Readonly<ExtractPropTypes<typeof numberFormatProps>>\n\nexport const NumberFormat = defineComponent({\n name: 'NumberFormat',\n props: numberFormatProps,\n setup(props) {\n const { n } = useI18n()\n return () => h(props.tag, n(props.value, props.style))\n },\n})\n","import { type App, type InjectionKey, type Ref, ref, shallowReactive } from 'vue'\nimport type { AllMessages, Locale, LocalizedString, Messages, CompiledMessage, MessageDescriptor, DiagnosticsConfig } from '@fluenti/core'\nimport { createDiagnostics, formatDate, formatNumber } from '@fluenti/core'\nimport { interpolate, buildICUMessage, resolveDescriptorId } from '@fluenti/core/internal'\nimport { Trans } from './components/Trans'\nimport { Plural } from './components/Plural'\nimport { Select } from './components/Select'\nimport { DateTime } from './components/DateTime'\nimport { NumberFormat } from './components/NumberFormat'\n\n/** Escape HTML special characters to prevent XSS. @internal */\nfunction escapeHtml(str: string): string {\n return str.replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;')\n}\n\n/** Compiled message chunk loader for lazy locale loading */\nexport type ChunkLoader = (\n locale: string,\n) => Promise<Record<string, CompiledMessage> | { default: Record<string, CompiledMessage> }>\n\ninterface SplitRuntimeModule {\n __switchLocale?: (locale: string) => Promise<void>\n __preloadLocale?: (locale: string) => Promise<void>\n}\n\nconst SPLIT_RUNTIME_KEY = Symbol.for('fluenti.runtime.vue.v1')\n\nfunction getSplitRuntimeModule(): SplitRuntimeModule | null {\n const runtime = (globalThis as Record<PropertyKey, unknown>)[SPLIT_RUNTIME_KEY]\n return typeof runtime === 'object' && runtime !== null\n ? runtime as SplitRuntimeModule\n : null\n}\n\nfunction resolveChunkMessages(\n loaded: Record<string, CompiledMessage> | { default: Record<string, CompiledMessage> },\n): Record<string, CompiledMessage> {\n return typeof loaded === 'object' && loaded !== null && 'default' in loaded\n ? (loaded as { default: Record<string, CompiledMessage> }).default\n : loaded\n}\n\n/** Context object returned by `useI18n()` and available as `$t` etc. on globalProperties */\nexport interface FluentiContext {\n /** Translate a message by id or MessageDescriptor, with optional interpolation values */\n t(id: string | MessageDescriptor, values?: Record<string, unknown>): LocalizedString\n /** Tagged template form: t`Hello ${name}` */\n t(strings: TemplateStringsArray, ...exprs: unknown[]): LocalizedString\n /** Reactive ref for current locale */\n locale: Readonly<Ref<Locale>>\n /** Change the active locale (async when lazy locale loading is enabled) */\n setLocale(locale: Locale): Promise<void>\n /** Dynamically load messages for a locale */\n loadMessages(locale: Locale, messages: Messages): void\n /** Get all locales that have loaded messages */\n getLocales(): Locale[]\n /** Format a date value according to locale */\n d(value: Date | number, style?: string): LocalizedString\n /** Format a number according to locale */\n n(value: number, style?: string): LocalizedString\n /** Format an ICU message string directly (no catalog lookup) */\n format(message: string, values?: Record<string, unknown>): LocalizedString\n /** Whether a locale chunk is currently being loaded */\n isLoading: Readonly<Ref<boolean>>\n /** Set of locales whose messages have been loaded */\n loadedLocales: Readonly<Ref<ReadonlySet<string>>>\n /** Preload a locale in the background without switching to it */\n preloadLocale(locale: string): void\n /** Check if a translation key exists in the catalog */\n te(key: string, locale?: string): boolean\n /** Get the raw compiled message without interpolation */\n tm(key: string, locale?: string): CompiledMessage | undefined\n}\n\n/** Injection key for providing/injecting fluenti context */\nexport const FLUENTI_KEY: InjectionKey<FluentiContext> = Symbol('fluenti')\n\n/** Options for creating the Fluenti Vue plugin */\nexport interface FluentiConfig {\n locale: string\n fallbackLocale?: string\n messages: AllMessages\n missing?: (locale: string, id: string) => string | undefined\n dateFormats?: Record<string, Intl.DateTimeFormatOptions | 'relative'>\n numberFormats?: Record<string, Intl.NumberFormatOptions | ((locale: string) => Intl.NumberFormatOptions)>\n fallbackChain?: Record<string, string[]>\n /** Async chunk loader for lazy locale loading */\n chunkLoader?: ChunkLoader\n /** Enable lazy locale loading through chunkLoader */\n lazyLocaleLoading?: boolean\n /**\n * Prefix for globally registered components (Trans, Plural, Select).\n *\n * Set this to avoid naming conflicts with other libraries.\n *\n * @example\n * componentPrefix: 'I18n'\n * // Registers: I18nTrans, I18nPlural, I18nSelect\n *\n * @example\n * componentPrefix: 'Fluenti'\n * // Registers: FluentiTrans, FluentiPlural, FluentiSelect\n *\n * @default '' (no prefix — Trans, Plural, Select)\n */\n componentPrefix?: string\n /**\n * Whether to inject `$t`, `$d`, `$n`, `$vtRich` onto `app.config.globalProperties`.\n *\n * Set to `false` to avoid polluting the global namespace (e.g. when migrating from vue-i18n\n * or when using composition API exclusively via `useI18n()`).\n *\n * @default true\n */\n injectGlobalProperties?: boolean\n /** Runtime diagnostics configuration */\n diagnostics?: DiagnosticsConfig\n}\n\n/** Return value of `createFluenti()` */\nexport interface FluentiPlugin {\n /** Vue plugin install method */\n install(app: App): void\n /** The global fluenti context (same as what useI18n returns) */\n global: FluentiContext\n}\n\n/**\n * Resolve a compiled message to a string, applying values if needed.\n * @internal\n */\nfunction resolveMessage(\n compiled: CompiledMessage,\n values?: Record<string, unknown>,\n locale?: string,\n): LocalizedString {\n if (typeof compiled === 'function') {\n return compiled(values) as LocalizedString\n }\n // Use core interpolate for ICU message parsing (handles plural, select, etc.)\n return interpolate(compiled, values, locale) as LocalizedString\n}\n\n/** Extract the attribute name from v-t modifiers (e.g., v-t.alt → 'alt') */\nfunction getModifierAttr(modifiers: Partial<Record<string, boolean>>): string | undefined {\n const keys = Object.keys(modifiers).filter((k) => k !== 'plural')\n return keys.length > 0 ? keys[0] : undefined\n}\n\n/**\n * Create a Fluenti Vue plugin (SSR-safe, per-request instance).\n *\n * Each invocation creates entirely fresh state — no module-level singletons —\n * so it is safe to call once per SSR request.\n */\nexport function createFluenti(options: FluentiConfig): FluentiPlugin {\n const lazyLocaleLoading = options.lazyLocaleLoading\n ?? (options as FluentiConfig & { splitting?: boolean }).splitting\n ?? false\n const diagnostics = options.diagnostics ? createDiagnostics(options.diagnostics) : undefined\n const locale = ref(options.locale)\n // Intentional mutation: Vue's shallowReactive API requires in-place property assignment for reactivity\n const catalogs = shallowReactive<AllMessages>({ ...options.messages })\n const isLoading = ref(false)\n const loadedLocalesSet = new Set<string>([options.locale])\n const loadedLocales = ref<ReadonlySet<string>>(new Set(loadedLocalesSet))\n\n function lookup(\n loc: Locale,\n id: string,\n ): CompiledMessage | undefined {\n const msgs = catalogs[loc]\n if (!msgs) return undefined\n return msgs[id]\n }\n\n function t(strings: TemplateStringsArray, ...exprs: unknown[]): LocalizedString\n function t(id: string | MessageDescriptor, values?: Record<string, unknown>): LocalizedString\n function t(idOrStrings: string | MessageDescriptor | TemplateStringsArray, ...rest: unknown[]): LocalizedString {\n // Tagged template form: t`Hello ${name}`\n if (Array.isArray(idOrStrings) && 'raw' in idOrStrings) {\n const strings = idOrStrings as TemplateStringsArray\n const icu = buildICUMessage(strings, rest)\n const values = Object.fromEntries(rest.map((v, i) => [`arg${i}`, v]))\n // Delegate to the function-call path with the ICU string as the id\n return t(icu, values)\n }\n\n // Function call form\n const id = idOrStrings as string | MessageDescriptor\n const values = rest[0] as Record<string, unknown> | undefined\n\n // Handle MessageDescriptor objects (from msg``)\n let messageId: string\n let fallbackMessage: string | undefined\n if (typeof id === 'object' && id !== null) {\n messageId = resolveDescriptorId(id) ?? ''\n fallbackMessage = id.message\n } else {\n messageId = id\n }\n\n // Read locale.value to register a Vue reactive dependency\n const currentLocale = locale.value\n\n // Build the chain of locales to try\n const chain: Locale[] = [currentLocale]\n\n if (options.fallbackLocale && !chain.includes(options.fallbackLocale)) {\n chain.push(options.fallbackLocale)\n }\n\n if (options.fallbackChain?.[currentLocale]) {\n for (const fallback of options.fallbackChain[currentLocale]) {\n if (!chain.includes(fallback)) {\n chain.push(fallback)\n }\n }\n } else if (options.fallbackChain?.['*']) {\n for (const fallback of options.fallbackChain['*']) {\n if (!chain.includes(fallback)) {\n chain.push(fallback)\n }\n }\n }\n\n for (const loc of chain) {\n const compiled = lookup(loc, messageId)\n if (compiled !== undefined) {\n if (loc !== currentLocale) {\n diagnostics?.fallbackUsed(currentLocale, loc, messageId)\n }\n return resolveMessage(compiled, values, loc)\n }\n }\n\n // Report missing key via diagnostics\n diagnostics?.missingKey(currentLocale, messageId)\n\n // Try the missing handler\n if (options.missing) {\n const result = options.missing(currentLocale, messageId)\n if (result !== undefined) return result as LocalizedString\n }\n\n // If we have a fallback message from a MessageDescriptor, interpolate it\n if (fallbackMessage) {\n return interpolate(fallbackMessage, values, currentLocale) as LocalizedString\n }\n\n // Final fallback — if the id looks like an ICU message, interpolate it\n // (compile-time transforms like <Plural> emit inline ICU as t() arguments)\n if (messageId.includes('{')) {\n return interpolate(messageId, values, currentLocale) as LocalizedString\n }\n return messageId as LocalizedString\n }\n\n let _localeRequestId = 0\n\n async function setLocale(newLocale: Locale): Promise<void> {\n if (!lazyLocaleLoading || !options.chunkLoader) {\n locale.value = newLocale\n return\n }\n\n const splitRuntime = getSplitRuntimeModule()\n\n if (loadedLocalesSet.has(newLocale)) {\n // Already loaded, instant switch\n if (splitRuntime?.__switchLocale) {\n await splitRuntime.__switchLocale(newLocale)\n }\n locale.value = newLocale\n return\n }\n\n // Race-condition protection: track request ID\n const thisRequest = ++_localeRequestId\n isLoading.value = true\n try {\n const messages = resolveChunkMessages(await options.chunkLoader(newLocale))\n // Stale request — a newer setLocale call superseded this one\n if (thisRequest !== _localeRequestId) return\n // Intentional mutation: Vue's shallowReactive API requires in-place property assignment for reactivity\n catalogs[newLocale] = { ...catalogs[newLocale], ...messages }\n loadedLocalesSet.add(newLocale)\n loadedLocales.value = new Set(loadedLocalesSet)\n if (splitRuntime?.__switchLocale) {\n await splitRuntime.__switchLocale(newLocale)\n }\n locale.value = newLocale\n } finally {\n if (thisRequest === _localeRequestId) {\n isLoading.value = false\n }\n }\n }\n\n function loadMessages(loc: Locale, messages: Messages): void {\n // Intentional mutation: Vue's shallowReactive API requires in-place property assignment for reactivity\n catalogs[loc] = { ...catalogs[loc], ...messages }\n loadedLocalesSet.add(loc)\n loadedLocales.value = new Set(loadedLocalesSet)\n }\n\n const _preloadInFlight = new Set<string>()\n\n function preloadLocale(loc: string): void {\n if (!lazyLocaleLoading || loadedLocalesSet.has(loc) || !options.chunkLoader || _preloadInFlight.has(loc)) return\n _preloadInFlight.add(loc)\n const splitRuntime = getSplitRuntimeModule()\n options.chunkLoader(loc).then(async (loaded) => {\n const messages = resolveChunkMessages(loaded)\n // Intentional mutation: Vue's shallowReactive API requires in-place property assignment for reactivity\n catalogs[loc] = { ...catalogs[loc], ...messages }\n loadedLocalesSet.add(loc)\n loadedLocales.value = new Set(loadedLocalesSet)\n if (splitRuntime?.__preloadLocale) {\n await splitRuntime.__preloadLocale(loc)\n }\n }).catch((e: unknown) => {\n console.warn('[fluenti] preload failed:', loc, e)\n }).finally(() => {\n _preloadInFlight.delete(loc)\n })\n }\n\n function getLocales(): Locale[] {\n return Object.keys(catalogs)\n }\n\n function d(value: Date | number, style?: string): LocalizedString {\n const currentLocale = locale.value\n return formatDate(value, currentLocale, style, options.dateFormats) as LocalizedString\n }\n\n function n(value: number, style?: string): LocalizedString {\n const currentLocale = locale.value\n return formatNumber(value, currentLocale, style, options.numberFormats) as LocalizedString\n }\n\n function format(message: string, values?: Record<string, unknown>): LocalizedString {\n return resolveMessage(message, values, locale.value)\n }\n\n /**\n * Rich text helper for v-t with child elements.\n * Translates the message (which contains `<0>content</0>` placeholders),\n * then replaces each placeholder with the original HTML element.\n * Used via `v-html=\"$vtRich('msg', elements)\"` in compile-time transforms.\n * @internal\n */\n function vtRich(\n message: string | MessageDescriptor,\n elements: Array<{ tag: string; attrs?: Record<string, string>; rawAttrs?: string }>,\n values?: Record<string, unknown>,\n ): string {\n const translated = values ? t(message, values) : t(message)\n // Escape the entire translated string first to neutralise any injected HTML\n const escaped = escapeHtml(translated)\n\n // Helper to build attribute string from element.\n // Both rawAttrs and attrs are escaped to prevent XSS — even though rawAttrs\n // originates from compile-time transforms, $vtRich is exposed on globalProperties\n // so we apply defence-in-depth.\n function buildAttrs(el: { attrs?: Record<string, string>; rawAttrs?: string }): string {\n if (el.rawAttrs != null && el.rawAttrs !== '') {\n // Parse rawAttrs back into key/value pairs and escape each one.\n // Handles: key=\"val\", key='val', and bare key (boolean attribute).\n const parts: string[] = []\n const attrRe = /([\\w:@.!-]+)(?:\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'))?/g\n let m: RegExpExecArray | null\n while ((m = attrRe.exec(el.rawAttrs)) !== null) {\n const key = escapeHtml(m[1]!)\n const val = m[2] ?? m[3]\n parts.push(val !== undefined ? `${key}=\"${escapeHtml(val)}\"` : key)\n }\n return parts.join(' ')\n }\n if (!el.attrs) return ''\n return Object.entries(el.attrs)\n .map(([k, v]) => v ? `${escapeHtml(k)}=\"${escapeHtml(v)}\"` : escapeHtml(k))\n .join(' ')\n }\n\n // First: handle self-closing <idx/> (escaped as &lt;idx/&gt;)\n let result = escaped.replace(/&lt;(\\d+)\\/&gt;/g, (_match, idxStr: string) => {\n const el = elements[Number(idxStr)]\n if (!el) return ''\n const tag = escapeHtml(el.tag)\n const attrs = buildAttrs(el)\n return `<${tag}${attrs ? ' ' + attrs : ''} />`\n })\n\n // Then: handle paired <idx>content</idx>\n result = result.replace(/&lt;(\\d+)&gt;([\\s\\S]*?)&lt;\\/\\1&gt;/g, (_match, idxStr: string, content: string) => {\n const el = elements[Number(idxStr)]\n if (!el) return content\n const tag = escapeHtml(el.tag)\n const attrs = buildAttrs(el)\n return `<${tag}${attrs ? ' ' + attrs : ''}>${content}</${tag}>`\n })\n\n return result\n }\n\n function te(key: string, loc?: string): boolean {\n const targetLocale = loc ?? locale.value\n return lookup(targetLocale, key) !== undefined\n }\n\n function tm(key: string, loc?: string): CompiledMessage | undefined {\n const targetLocale = loc ?? locale.value\n return lookup(targetLocale, key)\n }\n\n const context: FluentiContext = {\n t,\n locale,\n setLocale,\n loadMessages,\n getLocales,\n d,\n n,\n format,\n isLoading,\n loadedLocales,\n preloadLocale,\n te,\n tm,\n }\n\n return {\n install(app: App) {\n app.provide(FLUENTI_KEY, context)\n const prefix = options.componentPrefix ?? ''\n app.component(`${prefix}Trans`, Trans)\n app.component(`${prefix}Plural`, Plural)\n app.component(`${prefix}Select`, Select)\n app.component(`${prefix}DateTime`, DateTime)\n app.component(`${prefix}NumberFormat`, NumberFormat)\n if (options.injectGlobalProperties !== false) {\n app.config.globalProperties['$t'] = t\n app.config.globalProperties['$d'] = d\n app.config.globalProperties['$n'] = n\n app.config.globalProperties['$vtRich'] = vtRich\n }\n\n // Runtime v-t directive (fallback when compile-time transform is not used)\n const vtOriginalIds = new WeakMap<HTMLElement, string>()\n app.directive('t', {\n mounted(el, binding) {\n const attrName = getModifierAttr(binding.modifiers)\n if (attrName) {\n // v-t.alt, v-t.placeholder, etc. — translate the attribute\n const original = el.getAttribute(attrName) ?? ''\n vtOriginalIds.set(el, original)\n el.setAttribute(attrName, t(original))\n } else {\n // v-t or v-t:id — translate text content\n const id = binding.arg ?? el.textContent ?? ''\n vtOriginalIds.set(el, id.trim())\n el.textContent = t(id.trim(), binding.value != null ? { ...binding.value } : undefined)\n }\n },\n updated(el, binding) {\n const attrName = getModifierAttr(binding.modifiers)\n if (attrName) {\n const original = vtOriginalIds.get(el) ?? el.getAttribute(attrName) ?? ''\n el.setAttribute(attrName, t(original))\n } else {\n const id = binding.arg ?? vtOriginalIds.get(el) ?? ''\n el.textContent = t(id.trim(), binding.value != null ? { ...binding.value } : undefined)\n }\n },\n })\n },\n global: context,\n }\n}\n","import type { CompileTimeT } from '@fluenti/core'\n\nexport const t: CompileTimeT = ((..._args: unknown[]) => {\n throw new Error(\n \"[fluenti] `t` imported from '@fluenti/vue' is a compile-time API. \" +\n 'Use it only with the Fluenti build transform inside <script setup> or setup(). ' +\n 'For runtime lookups, use useI18n().t(...).',\n )\n}) as CompileTimeT\n"],"mappings":"uJAWA,SAAgB,GAA0B,CACxC,IAAM,GAAA,EAAA,EAAA,QAAa,EAAY,CAC/B,GAAI,CAAC,EACH,MAAU,MAAM,oDAAoD,CAEtE,OAAO,ECbT,SAAgB,EAAe,EAG7B,CACA,IAAM,EAAsB,EAAE,CAC1B,EAAU,GAEd,SAAS,EAAM,EAAmD,CAChE,GAAI,GAAS,MAA8B,OAAO,GAAS,UAAW,OACtE,GAAI,MAAM,QAAQ,EAAK,CAAE,CACvB,IAAK,IAAM,KAAS,EAAM,EAAM,EAAM,CACtC,OAEF,GAAI,OAAO,GAAS,UAAY,OAAO,GAAS,SAAU,CACxD,GAAW,OAAO,EAAK,CACvB,OAEF,GAAI,EAAA,EAAA,EAAA,SAAS,EAAK,EAAI,EAAK,OAAS,EAAA,QAAS,OAC7C,GAAI,EAAK,OAAS,EAAA,KAAM,CACtB,GAAW,OAAO,EAAK,UAAa,SAAW,EAAK,SAAW,GAC/D,OAGF,IAAM,EAAM,EAAW,OACjB,EAAQ,EAAe,EAAK,SAAkD,CACpF,EAAW,KAAK,EAAK,CACrB,EAAW,KAAK,GAAG,EAAM,WAAW,CACpC,GAAW,IAAI,EAAI,IAAA,EAAA,EAAA,eAAiB,EAAM,QAAS,EAAM,EAAE,CAAC,IAAI,EAAI,GAItE,OADA,EAAM,EAAS,CACR,CA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gB,EAAQ,UAAU,CACnD,GAAI,EAAU,CACZ,IAAM,EAAW,EAAc,IAAI,EAAG,EAAI,EAAG,aAAa,EAAS,EAAI,GACvE,EAAG,aAAa,EAAU,EAAE,EAAS,CAAC,MAGtC,EAAG,YAAc,GADN,EAAQ,KAAO,EAAc,IAAI,EAAG,EAAI,IAC7B,MAAM,CAAE,EAAQ,OAAS,KAA8B,IAAA,GAAvB,CAAE,GAAG,EAAQ,MAAO,CAAa,EAG5F,CAAC,EAEJ,OAAQ,EACT,CC7dH,IAAa,IAAoB,GAAG,IAAqB,CACvD,MAAU,MACR,8LAGD"}
package/dist/index.d.ts CHANGED
@@ -1,16 +1,16 @@
1
- export { createFluentVue, FLUENTI_KEY } from './plugin';
2
- export type { FluentVueOptions, FluentVuePlugin, FluentVueContext } from './plugin';
1
+ export { createFluenti, FLUENTI_KEY } from './plugin';
2
+ export type { FluentiConfig, FluentiPlugin, FluentiContext } from './plugin';
3
3
  export { useI18n } from './use-i18n';
4
4
  export { t } from './compile-time-t';
5
5
  export { Trans } from './components/Trans';
6
- export type { TransProps } from './components/Trans';
6
+ export type { FluentiTransProps } from './components/Trans';
7
7
  export { Plural } from './components/Plural';
8
- export type { PluralProps } from './components/Plural';
8
+ export type { FluentiPluralProps } from './components/Plural';
9
9
  export { Select } from './components/Select';
10
- export type { SelectProps } from './components/Select';
10
+ export type { FluentiSelectProps } from './components/Select';
11
11
  export { DateTime } from './components/DateTime';
12
- export type { DateTimeProps } from './components/DateTime';
12
+ export type { FluentiDateTimeProps } from './components/DateTime';
13
13
  export { NumberFormat } from './components/NumberFormat';
14
- export type { NumberFormatProps } from './components/NumberFormat';
14
+ export type { FluentiNumberFormatProps } from './components/NumberFormat';
15
15
  export { msg } from './msg';
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,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