@djangocfg/nextjs 2.1.109 → 2.1.111

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 (60) hide show
  1. package/README.md +176 -7
  2. package/dist/config/index.d.mts +16 -1
  3. package/dist/config/index.mjs +83 -14
  4. package/dist/config/index.mjs.map +1 -1
  5. package/dist/i18n/client.d.mts +123 -0
  6. package/dist/i18n/client.mjs +104 -0
  7. package/dist/i18n/client.mjs.map +1 -0
  8. package/dist/i18n/components.d.mts +22 -0
  9. package/dist/i18n/components.mjs +133 -0
  10. package/dist/i18n/components.mjs.map +1 -0
  11. package/dist/i18n/index.d.mts +17 -0
  12. package/dist/i18n/index.mjs +269 -0
  13. package/dist/i18n/index.mjs.map +1 -0
  14. package/dist/i18n/navigation.d.mts +1095 -0
  15. package/dist/i18n/navigation.mjs +45 -0
  16. package/dist/i18n/navigation.mjs.map +1 -0
  17. package/dist/i18n/plugin.d.mts +41 -0
  18. package/dist/i18n/plugin.mjs +17 -0
  19. package/dist/i18n/plugin.mjs.map +1 -0
  20. package/dist/i18n/provider.d.mts +18 -0
  21. package/dist/i18n/provider.mjs +54 -0
  22. package/dist/i18n/provider.mjs.map +1 -0
  23. package/dist/i18n/proxy.d.mts +40 -0
  24. package/dist/i18n/proxy.mjs +42 -0
  25. package/dist/i18n/proxy.mjs.map +1 -0
  26. package/dist/i18n/request.d.mts +42 -0
  27. package/dist/i18n/request.mjs +63 -0
  28. package/dist/i18n/request.mjs.map +1 -0
  29. package/dist/i18n/routing.d.mts +79 -0
  30. package/dist/i18n/routing.mjs +33 -0
  31. package/dist/i18n/routing.mjs.map +1 -0
  32. package/dist/i18n/server.d.mts +90 -0
  33. package/dist/i18n/server.mjs +79 -0
  34. package/dist/i18n/server.mjs.map +1 -0
  35. package/dist/index.d.mts +3 -1
  36. package/dist/index.mjs +176 -30
  37. package/dist/index.mjs.map +1 -1
  38. package/dist/sitemap/index.d.mts +22 -3
  39. package/dist/sitemap/index.mjs +92 -15
  40. package/dist/sitemap/index.mjs.map +1 -1
  41. package/dist/types-Cy349X20.d.mts +60 -0
  42. package/package.json +54 -4
  43. package/src/config/constants.ts +1 -0
  44. package/src/config/createNextConfig.ts +39 -17
  45. package/src/i18n/client.ts +221 -0
  46. package/src/i18n/components/LocaleSwitcher.tsx +124 -0
  47. package/src/i18n/components/index.ts +7 -0
  48. package/src/i18n/index.ts +149 -0
  49. package/src/i18n/navigation.ts +90 -0
  50. package/src/i18n/plugin.ts +66 -0
  51. package/src/i18n/provider.tsx +91 -0
  52. package/src/i18n/proxy.ts +81 -0
  53. package/src/i18n/request.ts +141 -0
  54. package/src/i18n/routing.ts +84 -0
  55. package/src/i18n/server.ts +175 -0
  56. package/src/i18n/types.ts +88 -0
  57. package/src/sitemap/generator.ts +84 -9
  58. package/src/sitemap/index.ts +1 -1
  59. package/src/sitemap/route.ts +71 -8
  60. package/src/sitemap/types.ts +9 -0
@@ -0,0 +1,123 @@
1
+ import * as next_intl from 'next-intl';
2
+ export { useFormatter, useMessages, useNow, useTimeZone } from 'next-intl';
3
+ import { LocaleCode } from '@djangocfg/i18n';
4
+
5
+ /**
6
+ * Get translations in Client Components
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * const t = useTranslations('HomePage');
11
+ * return <h1>{t('title')}</h1>;
12
+ *
13
+ * // With interpolation
14
+ * return <p>{t('greeting', { name: 'John' })}</p>;
15
+ * ```
16
+ */
17
+ declare function useTranslations<Namespace extends string = never>(namespace?: Namespace): next_intl._Translator<Record<string, any>, Namespace>;
18
+ /**
19
+ * Get current locale in Client Components
20
+ */
21
+ declare function useLocale(): LocaleCode;
22
+
23
+ /**
24
+ * Shorthand for useTranslations
25
+ * Alias for compatibility with @djangocfg/i18n
26
+ */
27
+ declare const useT: typeof useTranslations;
28
+ /**
29
+ * Get namespaced translations
30
+ *
31
+ * @example
32
+ * ```tsx
33
+ * const pt = useNamespacedTranslations('payments');
34
+ * return <span>{pt('balance.available')}</span>;
35
+ * ```
36
+ */
37
+ declare function useNamespacedTranslations(namespace: string): next_intl._Translator<Record<string, any>, string>;
38
+ /**
39
+ * Format a date according to locale
40
+ *
41
+ * @example
42
+ * ```tsx
43
+ * const formatDate = useDateFormatter();
44
+ * return <span>{formatDate(new Date())}</span>;
45
+ * ```
46
+ */
47
+ declare function useDateFormatter(): (date: Date | number, options?: Parameters<{
48
+ (value: Date | number, options?: next_intl.DateTimeFormatOptions): string;
49
+ (value: Date | number, format?: string, options?: next_intl.DateTimeFormatOptions): string;
50
+ }>[1]) => string;
51
+ /**
52
+ * Format a number according to locale
53
+ *
54
+ * @example
55
+ * ```tsx
56
+ * const formatNumber = useNumberFormatter();
57
+ * return <span>{formatNumber(1234.56)}</span>;
58
+ * ```
59
+ */
60
+ declare function useNumberFormatter(): (number: number, options?: Parameters<{
61
+ (value: number | bigint, options?: next_intl.NumberFormatOptions): string;
62
+ (value: number | bigint, format?: string, options?: next_intl.NumberFormatOptions): string;
63
+ }>[1]) => string;
64
+ /**
65
+ * Format relative time
66
+ *
67
+ * @example
68
+ * ```tsx
69
+ * const formatRelative = useRelativeTimeFormatter();
70
+ * return <span>{formatRelative(new Date())}</span>;
71
+ * ```
72
+ */
73
+ declare function useRelativeTimeFormatter(): (date: Date | number, options?: Parameters<{
74
+ (date: number | Date, now?: next_intl.RelativeTimeFormatOptions["now"]): string;
75
+ (date: number | Date, options?: next_intl.RelativeTimeFormatOptions): string;
76
+ }>[1]) => string;
77
+ /**
78
+ * Get list of available locales from routing config
79
+ *
80
+ * @example
81
+ * ```tsx
82
+ * const locales = useLocales();
83
+ * // ['en', 'ru', 'ko']
84
+ * ```
85
+ */
86
+ declare function useLocales(): LocaleCode[];
87
+ /**
88
+ * Get default locale from routing config
89
+ */
90
+ declare function useDefaultLocale(): LocaleCode;
91
+ /**
92
+ * Hook to change current locale
93
+ *
94
+ * @example
95
+ * ```tsx
96
+ * const changeLocale = useChangeLocale();
97
+ *
98
+ * <button onClick={() => changeLocale('ru')}>
99
+ * Switch to Russian
100
+ * </button>
101
+ * ```
102
+ */
103
+ declare function useChangeLocale(): (locale: LocaleCode) => void;
104
+ /**
105
+ * Combined hook for locale switching
106
+ * Returns current locale, available locales, and change function
107
+ *
108
+ * @example
109
+ * ```tsx
110
+ * const { locale, locales, changeLocale } = useLocaleSwitcher();
111
+ *
112
+ * <select value={locale} onChange={(e) => changeLocale(e.target.value)}>
113
+ * {locales.map(l => <option key={l} value={l}>{l}</option>)}
114
+ * </select>
115
+ * ```
116
+ */
117
+ declare function useLocaleSwitcher(): {
118
+ locale: string;
119
+ locales: string[];
120
+ changeLocale: (locale: LocaleCode) => void;
121
+ };
122
+
123
+ export { useChangeLocale, useDateFormatter, useDefaultLocale, useLocale, useLocaleSwitcher, useLocales, useNamespacedTranslations, useNumberFormatter, useRelativeTimeFormatter, useT, useTranslations };
@@ -0,0 +1,104 @@
1
+ "use client";
2
+
3
+ // src/i18n/client.ts
4
+ import {
5
+ useTranslations as useNextIntlTranslations,
6
+ useLocale as useNextIntlLocale,
7
+ useMessages,
8
+ useNow,
9
+ useTimeZone,
10
+ useFormatter
11
+ } from "next-intl";
12
+
13
+ // src/i18n/navigation.ts
14
+ import { createNavigation as createNextIntlNavigation } from "next-intl/navigation";
15
+
16
+ // src/i18n/routing.ts
17
+ import { defineRouting } from "next-intl/routing";
18
+ var DEFAULT_LOCALES = ["en", "ru", "ko"];
19
+ var DEFAULT_LOCALE = "en";
20
+ function createRouting(config) {
21
+ const locales = config?.locales ?? DEFAULT_LOCALES;
22
+ const defaultLocale = config?.defaultLocale ?? DEFAULT_LOCALE;
23
+ const localePrefix = config?.localePrefix ?? "always";
24
+ return defineRouting({
25
+ locales,
26
+ defaultLocale,
27
+ localePrefix
28
+ });
29
+ }
30
+ var routing = createRouting();
31
+
32
+ // src/i18n/navigation.ts
33
+ function createNavigation(routingConfig) {
34
+ const config = routingConfig ?? routing;
35
+ return createNextIntlNavigation(config);
36
+ }
37
+ var {
38
+ Link,
39
+ redirect,
40
+ usePathname,
41
+ useRouter,
42
+ getPathname
43
+ } = createNavigation();
44
+
45
+ // src/i18n/client.ts
46
+ function useTranslations(namespace) {
47
+ return useNextIntlTranslations(namespace);
48
+ }
49
+ function useLocale() {
50
+ return useNextIntlLocale();
51
+ }
52
+ var useT = useTranslations;
53
+ function useNamespacedTranslations(namespace) {
54
+ return useNextIntlTranslations(namespace);
55
+ }
56
+ function useDateFormatter() {
57
+ const formatter = useFormatter();
58
+ return (date, options) => formatter.dateTime(date, options);
59
+ }
60
+ function useNumberFormatter() {
61
+ const formatter = useFormatter();
62
+ return (number, options) => formatter.number(number, options);
63
+ }
64
+ function useRelativeTimeFormatter() {
65
+ const formatter = useFormatter();
66
+ return (date, options) => formatter.relativeTime(date, options);
67
+ }
68
+ function useLocales() {
69
+ return routing.locales;
70
+ }
71
+ function useDefaultLocale() {
72
+ return routing.defaultLocale;
73
+ }
74
+ function useChangeLocale() {
75
+ const router = useRouter();
76
+ const pathname = usePathname();
77
+ return (locale) => {
78
+ router.replace(pathname, { locale });
79
+ };
80
+ }
81
+ function useLocaleSwitcher() {
82
+ const locale = useLocale();
83
+ const locales = useLocales();
84
+ const changeLocale = useChangeLocale();
85
+ return { locale, locales, changeLocale };
86
+ }
87
+ export {
88
+ useChangeLocale,
89
+ useDateFormatter,
90
+ useDefaultLocale,
91
+ useFormatter,
92
+ useLocale,
93
+ useLocaleSwitcher,
94
+ useLocales,
95
+ useMessages,
96
+ useNamespacedTranslations,
97
+ useNow,
98
+ useNumberFormatter,
99
+ useRelativeTimeFormatter,
100
+ useT,
101
+ useTimeZone,
102
+ useTranslations
103
+ };
104
+ //# sourceMappingURL=client.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/i18n/client.ts","../../src/i18n/navigation.ts","../../src/i18n/routing.ts"],"sourcesContent":["/**\n * Client-side i18n Hooks\n *\n * For use in Client Components ('use client')\n *\n * @example\n * ```tsx\n * 'use client';\n *\n * import { useTranslations, useLocale } from '@djangocfg/nextjs/i18n/client';\n *\n * export function MyComponent() {\n * const t = useTranslations('HomePage');\n * const locale = useLocale();\n *\n * return <h1>{t('title')}</h1>;\n * }\n * ```\n */\n\n'use client';\n\nimport {\n useTranslations as useNextIntlTranslations,\n useLocale as useNextIntlLocale,\n useMessages,\n useNow,\n useTimeZone,\n useFormatter,\n} from 'next-intl';\nimport { useRouter, usePathname } from './navigation';\nimport { routing } from './routing';\nimport type { LocaleCode } from './types';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Core Client Hooks\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Get translations in Client Components\n *\n * @example\n * ```tsx\n * const t = useTranslations('HomePage');\n * return <h1>{t('title')}</h1>;\n *\n * // With interpolation\n * return <p>{t('greeting', { name: 'John' })}</p>;\n * ```\n */\nexport function useTranslations<Namespace extends string = never>(\n namespace?: Namespace\n) {\n return useNextIntlTranslations(namespace);\n}\n\n/**\n * Get current locale in Client Components\n */\nexport function useLocale(): LocaleCode {\n return useNextIntlLocale() as LocaleCode;\n}\n\n/**\n * Get all messages\n * Useful for passing to child providers\n */\nexport { useMessages };\n\n/**\n * Get current time\n */\nexport { useNow };\n\n/**\n * Get timezone\n */\nexport { useTimeZone };\n\n/**\n * Get formatter for dates, numbers, etc.\n */\nexport { useFormatter };\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Convenience Hooks\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Shorthand for useTranslations\n * Alias for compatibility with @djangocfg/i18n\n */\nexport const useT = useTranslations;\n\n/**\n * Get namespaced translations\n *\n * @example\n * ```tsx\n * const pt = useNamespacedTranslations('payments');\n * return <span>{pt('balance.available')}</span>;\n * ```\n */\nexport function useNamespacedTranslations(namespace: string) {\n return useNextIntlTranslations(namespace);\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Formatting Hooks\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Format a date according to locale\n *\n * @example\n * ```tsx\n * const formatDate = useDateFormatter();\n * return <span>{formatDate(new Date())}</span>;\n * ```\n */\nexport function useDateFormatter() {\n const formatter = useFormatter();\n return (date: Date | number, options?: Parameters<typeof formatter.dateTime>[1]) =>\n formatter.dateTime(date, options);\n}\n\n/**\n * Format a number according to locale\n *\n * @example\n * ```tsx\n * const formatNumber = useNumberFormatter();\n * return <span>{formatNumber(1234.56)}</span>;\n * ```\n */\nexport function useNumberFormatter() {\n const formatter = useFormatter();\n return (number: number, options?: Parameters<typeof formatter.number>[1]) =>\n formatter.number(number, options);\n}\n\n/**\n * Format relative time\n *\n * @example\n * ```tsx\n * const formatRelative = useRelativeTimeFormatter();\n * return <span>{formatRelative(new Date())}</span>;\n * ```\n */\nexport function useRelativeTimeFormatter() {\n const formatter = useFormatter();\n return (date: Date | number, options?: Parameters<typeof formatter.relativeTime>[1]) =>\n formatter.relativeTime(date, options);\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Locale Switching Hooks\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Get list of available locales from routing config\n *\n * @example\n * ```tsx\n * const locales = useLocales();\n * // ['en', 'ru', 'ko']\n * ```\n */\nexport function useLocales(): LocaleCode[] {\n return routing.locales as LocaleCode[];\n}\n\n/**\n * Get default locale from routing config\n */\nexport function useDefaultLocale(): LocaleCode {\n return routing.defaultLocale as LocaleCode;\n}\n\n/**\n * Hook to change current locale\n *\n * @example\n * ```tsx\n * const changeLocale = useChangeLocale();\n *\n * <button onClick={() => changeLocale('ru')}>\n * Switch to Russian\n * </button>\n * ```\n */\nexport function useChangeLocale() {\n const router = useRouter();\n const pathname = usePathname();\n\n return (locale: LocaleCode) => {\n router.replace(pathname, { locale });\n };\n}\n\n/**\n * Combined hook for locale switching\n * Returns current locale, available locales, and change function\n *\n * @example\n * ```tsx\n * const { locale, locales, changeLocale } = useLocaleSwitcher();\n *\n * <select value={locale} onChange={(e) => changeLocale(e.target.value)}>\n * {locales.map(l => <option key={l} value={l}>{l}</option>)}\n * </select>\n * ```\n */\nexport function useLocaleSwitcher() {\n const locale = useLocale();\n const locales = useLocales();\n const changeLocale = useChangeLocale();\n\n return { locale, locales, changeLocale };\n}\n","/**\n * i18n Navigation Utilities\n *\n * Provides locale-aware navigation components and functions\n *\n * @example\n * ```ts\n * // In your app's i18n/navigation.ts\n * import { createNavigation } from '@djangocfg/nextjs/i18n';\n * import { routing } from './routing';\n *\n * export const { Link, redirect, usePathname, useRouter } = createNavigation(routing);\n * ```\n *\n * @example\n * ```tsx\n * // Using in components\n * import { Link, usePathname } from '@/i18n/navigation';\n *\n * function Nav() {\n * const pathname = usePathname();\n * return <Link href=\"/about\">About</Link>;\n * }\n * ```\n */\n\nimport { createNavigation as createNextIntlNavigation } from 'next-intl/navigation';\nimport { routing, createRouting } from './routing';\nimport type { I18nConfig } from './types';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Navigation Factory\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Create navigation utilities with custom routing\n *\n * Returns locale-aware versions of:\n * - Link: Locale-prefixed links\n * - redirect: Server-side redirect with locale\n * - usePathname: Current pathname without locale prefix\n * - useRouter: Router with locale-aware navigation\n * - getPathname: Get pathname for a route\n */\nexport function createNavigation(routingConfig?: ReturnType<typeof createRouting>) {\n const config = routingConfig ?? routing;\n return createNextIntlNavigation(config);\n}\n\n/**\n * Create navigation from config options\n */\nexport function createNavigationFromConfig(config: Partial<I18nConfig>) {\n const routingConfig = createRouting(config);\n return createNextIntlNavigation(routingConfig);\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Default Navigation (using default routing)\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Default navigation utilities\n * Use these directly or create custom ones with createNavigation()\n */\nexport const {\n Link,\n redirect,\n usePathname,\n useRouter,\n getPathname,\n} = createNavigation();\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Types\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Props for locale-aware Link component\n */\nexport interface LinkProps {\n /** Target href */\n href: string;\n /** Target locale (optional, defaults to current) */\n locale?: string;\n /** Children */\n children?: React.ReactNode;\n /** Additional props passed to Next.js Link */\n [key: string]: unknown;\n}\n","/**\n * i18n Routing Configuration\n *\n * Creates routing configuration for next-intl\n * Used by proxy and navigation components\n */\n\nimport { defineRouting } from 'next-intl/routing';\nimport type { I18nConfig, LocaleCode } from './types';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Default Configuration\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst DEFAULT_LOCALES: LocaleCode[] = ['en', 'ru', 'ko'];\nconst DEFAULT_LOCALE: LocaleCode = 'en';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Routing Factory\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Create routing configuration for next-intl\n *\n * @example\n * ```ts\n * // i18n/routing.ts\n * import { createRouting } from '@djangocfg/nextjs/i18n';\n *\n * export const routing = createRouting({\n * locales: ['en', 'ru', 'ko'],\n * defaultLocale: 'en',\n * });\n * ```\n */\nexport function createRouting(config?: Partial<I18nConfig>) {\n const locales = config?.locales ?? DEFAULT_LOCALES;\n const defaultLocale = config?.defaultLocale ?? DEFAULT_LOCALE;\n const localePrefix = config?.localePrefix ?? 'always';\n\n return defineRouting({\n locales,\n defaultLocale,\n localePrefix,\n });\n}\n\n/**\n * Default routing configuration\n * Can be overridden by app-specific configuration\n */\nexport const routing = createRouting();\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Locale Utilities\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Check if a locale is supported\n */\nexport function isValidLocale(\n locale: string,\n supportedLocales: readonly string[] = DEFAULT_LOCALES\n): locale is LocaleCode {\n return supportedLocales.includes(locale as LocaleCode);\n}\n\n/**\n * Get locale from params (handles async params in Next.js 15+)\n */\nexport async function getLocaleFromParams(\n params: Promise<{ locale: string }> | { locale: string }\n): Promise<LocaleCode> {\n const resolved = await params;\n return resolved.locale as LocaleCode;\n}\n\n/**\n * Generate static params for all locales\n * Use in generateStaticParams for locale pages\n */\nexport function generateLocaleParams(locales: readonly string[] = DEFAULT_LOCALES) {\n return locales.map((locale) => ({ locale }));\n}\n"],"mappings":";;;AAsBA;AAAA,EACE,mBAAmB;AAAA,EACnB,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACHP,SAAS,oBAAoB,gCAAgC;;;ACnB7D,SAAS,qBAAqB;AAO9B,IAAM,kBAAgC,CAAC,MAAM,MAAM,IAAI;AACvD,IAAM,iBAA6B;AAoB5B,SAAS,cAAc,QAA8B;AAC1D,QAAM,UAAU,QAAQ,WAAW;AACnC,QAAM,gBAAgB,QAAQ,iBAAiB;AAC/C,QAAM,eAAe,QAAQ,gBAAgB;AAE7C,SAAO,cAAc;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAMO,IAAM,UAAU,cAAc;;;ADP9B,SAAS,iBAAiB,eAAkD;AACjF,QAAM,SAAS,iBAAiB;AAChC,SAAO,yBAAyB,MAAM;AACxC;AAkBO,IAAM;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,IAAI,iBAAiB;;;ADrBd,SAAS,gBACd,WACA;AACA,SAAO,wBAAwB,SAAS;AAC1C;AAKO,SAAS,YAAwB;AACtC,SAAO,kBAAkB;AAC3B;AA+BO,IAAM,OAAO;AAWb,SAAS,0BAA0B,WAAmB;AAC3D,SAAO,wBAAwB,SAAS;AAC1C;AAeO,SAAS,mBAAmB;AACjC,QAAM,YAAY,aAAa;AAC/B,SAAO,CAAC,MAAqB,YAC3B,UAAU,SAAS,MAAM,OAAO;AACpC;AAWO,SAAS,qBAAqB;AACnC,QAAM,YAAY,aAAa;AAC/B,SAAO,CAAC,QAAgB,YACtB,UAAU,OAAO,QAAQ,OAAO;AACpC;AAWO,SAAS,2BAA2B;AACzC,QAAM,YAAY,aAAa;AAC/B,SAAO,CAAC,MAAqB,YAC3B,UAAU,aAAa,MAAM,OAAO;AACxC;AAeO,SAAS,aAA2B;AACzC,SAAO,QAAQ;AACjB;AAKO,SAAS,mBAA+B;AAC7C,SAAO,QAAQ;AACjB;AAcO,SAAS,kBAAkB;AAChC,QAAM,SAAS,UAAU;AACzB,QAAM,WAAW,YAAY;AAE7B,SAAO,CAAC,WAAuB;AAC7B,WAAO,QAAQ,UAAU,EAAE,OAAO,CAAC;AAAA,EACrC;AACF;AAeO,SAAS,oBAAoB;AAClC,QAAM,SAAS,UAAU;AACzB,QAAM,UAAU,WAAW;AAC3B,QAAM,eAAe,gBAAgB;AAErC,SAAO,EAAE,QAAQ,SAAS,aAAa;AACzC;","names":[]}
@@ -0,0 +1,22 @@
1
+ import * as react from 'react';
2
+ import { LocaleCode } from '@djangocfg/i18n';
3
+
4
+ interface LocaleSwitcherProps {
5
+ /** Available locales (defaults to all from routing config) */
6
+ locales?: LocaleCode[];
7
+ /** Custom labels for locales */
8
+ labels?: Record<string, string>;
9
+ /** Show locale code instead of/with label */
10
+ showCode?: boolean;
11
+ /** Button variant */
12
+ variant?: 'ghost' | 'outline' | 'default';
13
+ /** Button size */
14
+ size?: 'sm' | 'default' | 'lg' | 'icon';
15
+ /** Show icon */
16
+ showIcon?: boolean;
17
+ /** Custom className */
18
+ className?: string;
19
+ }
20
+ declare function LocaleSwitcher({ locales: customLocales, labels, showCode, variant, size, showIcon, className, }: LocaleSwitcherProps): react.JSX.Element;
21
+
22
+ export { LocaleSwitcher, type LocaleSwitcherProps };
@@ -0,0 +1,133 @@
1
+ // src/i18n/components/LocaleSwitcher.tsx
2
+ import { Globe } from "lucide-react";
3
+ import {
4
+ Button,
5
+ DropdownMenu,
6
+ DropdownMenuContent,
7
+ DropdownMenuItem,
8
+ DropdownMenuTrigger
9
+ } from "@djangocfg/ui-core/components";
10
+
11
+ // src/i18n/client.ts
12
+ import {
13
+ useTranslations as useNextIntlTranslations,
14
+ useLocale as useNextIntlLocale,
15
+ useMessages,
16
+ useNow,
17
+ useTimeZone,
18
+ useFormatter
19
+ } from "next-intl";
20
+
21
+ // src/i18n/navigation.ts
22
+ import { createNavigation as createNextIntlNavigation } from "next-intl/navigation";
23
+
24
+ // src/i18n/routing.ts
25
+ import { defineRouting } from "next-intl/routing";
26
+ var DEFAULT_LOCALES = ["en", "ru", "ko"];
27
+ var DEFAULT_LOCALE = "en";
28
+ function createRouting(config) {
29
+ const locales = config?.locales ?? DEFAULT_LOCALES;
30
+ const defaultLocale = config?.defaultLocale ?? DEFAULT_LOCALE;
31
+ const localePrefix = config?.localePrefix ?? "always";
32
+ return defineRouting({
33
+ locales,
34
+ defaultLocale,
35
+ localePrefix
36
+ });
37
+ }
38
+ var routing = createRouting();
39
+
40
+ // src/i18n/navigation.ts
41
+ function createNavigation(routingConfig) {
42
+ const config = routingConfig ?? routing;
43
+ return createNextIntlNavigation(config);
44
+ }
45
+ var {
46
+ Link,
47
+ redirect,
48
+ usePathname,
49
+ useRouter,
50
+ getPathname
51
+ } = createNavigation();
52
+
53
+ // src/i18n/client.ts
54
+ function useLocale() {
55
+ return useNextIntlLocale();
56
+ }
57
+ function useLocales() {
58
+ return routing.locales;
59
+ }
60
+ function useChangeLocale() {
61
+ const router = useRouter();
62
+ const pathname = usePathname();
63
+ return (locale) => {
64
+ router.replace(pathname, { locale });
65
+ };
66
+ }
67
+ function useLocaleSwitcher() {
68
+ const locale = useLocale();
69
+ const locales = useLocales();
70
+ const changeLocale = useChangeLocale();
71
+ return { locale, locales, changeLocale };
72
+ }
73
+
74
+ // src/i18n/components/LocaleSwitcher.tsx
75
+ import { jsx, jsxs } from "react/jsx-runtime";
76
+ var DEFAULT_LABELS = {
77
+ en: "English",
78
+ ru: "\u0420\u0443\u0441\u0441\u043A\u0438\u0439",
79
+ ko: "\uD55C\uAD6D\uC5B4",
80
+ zh: "\u4E2D\u6587",
81
+ ja: "\u65E5\u672C\u8A9E",
82
+ es: "Espa\xF1ol",
83
+ fr: "Fran\xE7ais",
84
+ de: "Deutsch",
85
+ pt: "Portugu\xEAs",
86
+ it: "Italiano",
87
+ ar: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629",
88
+ hi: "\u0939\u093F\u0928\u094D\u0926\u0940",
89
+ tr: "T\xFCrk\xE7e",
90
+ pl: "Polski",
91
+ nl: "Nederlands",
92
+ uk: "\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430"
93
+ };
94
+ function LocaleSwitcher({
95
+ locales: customLocales,
96
+ labels = {},
97
+ showCode = false,
98
+ variant = "ghost",
99
+ size = "sm",
100
+ showIcon = true,
101
+ className
102
+ }) {
103
+ const { locale, locales: routingLocales, changeLocale } = useLocaleSwitcher();
104
+ const availableLocales = customLocales || routingLocales;
105
+ const allLabels = { ...DEFAULT_LABELS, ...labels };
106
+ const getLabel = (code) => {
107
+ const label = allLabels[code] || code.toUpperCase();
108
+ if (showCode) {
109
+ return `${code.toUpperCase()} - ${label}`;
110
+ }
111
+ return label;
112
+ };
113
+ const currentLabel = showCode ? locale.toUpperCase() : getLabel(locale);
114
+ return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
115
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant, size, className, children: [
116
+ showIcon && /* @__PURE__ */ jsx(Globe, { className: "h-4 w-4 mr-1" }),
117
+ /* @__PURE__ */ jsx("span", { children: currentLabel })
118
+ ] }) }),
119
+ /* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", children: availableLocales.map((code) => /* @__PURE__ */ jsx(
120
+ DropdownMenuItem,
121
+ {
122
+ onClick: () => changeLocale(code),
123
+ className: code === locale ? "bg-accent" : "",
124
+ children: getLabel(code)
125
+ },
126
+ code
127
+ )) })
128
+ ] });
129
+ }
130
+ export {
131
+ LocaleSwitcher
132
+ };
133
+ //# sourceMappingURL=components.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/i18n/components/LocaleSwitcher.tsx","../../src/i18n/client.ts","../../src/i18n/navigation.ts","../../src/i18n/routing.ts"],"sourcesContent":["/**\n * LocaleSwitcher Component\n *\n * Ready-to-use locale switcher dropdown using @djangocfg/ui-core components\n *\n * @example\n * ```tsx\n * import { LocaleSwitcher } from '@djangocfg/nextjs/i18n/components';\n *\n * // Basic usage (uses all locales from routing config)\n * <LocaleSwitcher />\n *\n * // With custom locales\n * <LocaleSwitcher locales={['en', 'ru']} />\n *\n * // With custom labels\n * <LocaleSwitcher\n * labels={{\n * en: 'English',\n * ru: 'Русский',\n * ko: '한국어',\n * }}\n * />\n * ```\n */\n\n'use client';\n\nimport { Globe } from 'lucide-react';\n\nimport {\n Button,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@djangocfg/ui-core/components';\n\nimport { useLocaleSwitcher } from '../client';\nimport type { LocaleCode } from '../types';\n\n// Default locale labels\nconst DEFAULT_LABELS: Record<string, string> = {\n en: 'English',\n ru: 'Русский',\n ko: '한국어',\n zh: '中文',\n ja: '日本語',\n es: 'Español',\n fr: 'Français',\n de: 'Deutsch',\n pt: 'Português',\n it: 'Italiano',\n ar: 'العربية',\n hi: 'हिन्दी',\n tr: 'Türkçe',\n pl: 'Polski',\n nl: 'Nederlands',\n uk: 'Українська',\n};\n\nexport interface LocaleSwitcherProps {\n /** Available locales (defaults to all from routing config) */\n locales?: LocaleCode[];\n /** Custom labels for locales */\n labels?: Record<string, string>;\n /** Show locale code instead of/with label */\n showCode?: boolean;\n /** Button variant */\n variant?: 'ghost' | 'outline' | 'default';\n /** Button size */\n size?: 'sm' | 'default' | 'lg' | 'icon';\n /** Show icon */\n showIcon?: boolean;\n /** Custom className */\n className?: string;\n}\n\nexport function LocaleSwitcher({\n locales: customLocales,\n labels = {},\n showCode = false,\n variant = 'ghost',\n size = 'sm',\n showIcon = true,\n className,\n}: LocaleSwitcherProps) {\n const { locale, locales: routingLocales, changeLocale } = useLocaleSwitcher();\n\n const availableLocales = customLocales || routingLocales;\n const allLabels = { ...DEFAULT_LABELS, ...labels };\n\n const getLabel = (code: LocaleCode) => {\n const label = allLabels[code] || code.toUpperCase();\n if (showCode) {\n return `${code.toUpperCase()} - ${label}`;\n }\n return label;\n };\n\n const currentLabel = showCode ? locale.toUpperCase() : getLabel(locale);\n\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant={variant} size={size} className={className}>\n {showIcon && <Globe className=\"h-4 w-4 mr-1\" />}\n <span>{currentLabel}</span>\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n {availableLocales.map((code) => (\n <DropdownMenuItem\n key={code}\n onClick={() => changeLocale(code)}\n className={code === locale ? 'bg-accent' : ''}\n >\n {getLabel(code)}\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n","/**\n * Client-side i18n Hooks\n *\n * For use in Client Components ('use client')\n *\n * @example\n * ```tsx\n * 'use client';\n *\n * import { useTranslations, useLocale } from '@djangocfg/nextjs/i18n/client';\n *\n * export function MyComponent() {\n * const t = useTranslations('HomePage');\n * const locale = useLocale();\n *\n * return <h1>{t('title')}</h1>;\n * }\n * ```\n */\n\n'use client';\n\nimport {\n useTranslations as useNextIntlTranslations,\n useLocale as useNextIntlLocale,\n useMessages,\n useNow,\n useTimeZone,\n useFormatter,\n} from 'next-intl';\nimport { useRouter, usePathname } from './navigation';\nimport { routing } from './routing';\nimport type { LocaleCode } from './types';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Core Client Hooks\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Get translations in Client Components\n *\n * @example\n * ```tsx\n * const t = useTranslations('HomePage');\n * return <h1>{t('title')}</h1>;\n *\n * // With interpolation\n * return <p>{t('greeting', { name: 'John' })}</p>;\n * ```\n */\nexport function useTranslations<Namespace extends string = never>(\n namespace?: Namespace\n) {\n return useNextIntlTranslations(namespace);\n}\n\n/**\n * Get current locale in Client Components\n */\nexport function useLocale(): LocaleCode {\n return useNextIntlLocale() as LocaleCode;\n}\n\n/**\n * Get all messages\n * Useful for passing to child providers\n */\nexport { useMessages };\n\n/**\n * Get current time\n */\nexport { useNow };\n\n/**\n * Get timezone\n */\nexport { useTimeZone };\n\n/**\n * Get formatter for dates, numbers, etc.\n */\nexport { useFormatter };\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Convenience Hooks\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Shorthand for useTranslations\n * Alias for compatibility with @djangocfg/i18n\n */\nexport const useT = useTranslations;\n\n/**\n * Get namespaced translations\n *\n * @example\n * ```tsx\n * const pt = useNamespacedTranslations('payments');\n * return <span>{pt('balance.available')}</span>;\n * ```\n */\nexport function useNamespacedTranslations(namespace: string) {\n return useNextIntlTranslations(namespace);\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Formatting Hooks\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Format a date according to locale\n *\n * @example\n * ```tsx\n * const formatDate = useDateFormatter();\n * return <span>{formatDate(new Date())}</span>;\n * ```\n */\nexport function useDateFormatter() {\n const formatter = useFormatter();\n return (date: Date | number, options?: Parameters<typeof formatter.dateTime>[1]) =>\n formatter.dateTime(date, options);\n}\n\n/**\n * Format a number according to locale\n *\n * @example\n * ```tsx\n * const formatNumber = useNumberFormatter();\n * return <span>{formatNumber(1234.56)}</span>;\n * ```\n */\nexport function useNumberFormatter() {\n const formatter = useFormatter();\n return (number: number, options?: Parameters<typeof formatter.number>[1]) =>\n formatter.number(number, options);\n}\n\n/**\n * Format relative time\n *\n * @example\n * ```tsx\n * const formatRelative = useRelativeTimeFormatter();\n * return <span>{formatRelative(new Date())}</span>;\n * ```\n */\nexport function useRelativeTimeFormatter() {\n const formatter = useFormatter();\n return (date: Date | number, options?: Parameters<typeof formatter.relativeTime>[1]) =>\n formatter.relativeTime(date, options);\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Locale Switching Hooks\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Get list of available locales from routing config\n *\n * @example\n * ```tsx\n * const locales = useLocales();\n * // ['en', 'ru', 'ko']\n * ```\n */\nexport function useLocales(): LocaleCode[] {\n return routing.locales as LocaleCode[];\n}\n\n/**\n * Get default locale from routing config\n */\nexport function useDefaultLocale(): LocaleCode {\n return routing.defaultLocale as LocaleCode;\n}\n\n/**\n * Hook to change current locale\n *\n * @example\n * ```tsx\n * const changeLocale = useChangeLocale();\n *\n * <button onClick={() => changeLocale('ru')}>\n * Switch to Russian\n * </button>\n * ```\n */\nexport function useChangeLocale() {\n const router = useRouter();\n const pathname = usePathname();\n\n return (locale: LocaleCode) => {\n router.replace(pathname, { locale });\n };\n}\n\n/**\n * Combined hook for locale switching\n * Returns current locale, available locales, and change function\n *\n * @example\n * ```tsx\n * const { locale, locales, changeLocale } = useLocaleSwitcher();\n *\n * <select value={locale} onChange={(e) => changeLocale(e.target.value)}>\n * {locales.map(l => <option key={l} value={l}>{l}</option>)}\n * </select>\n * ```\n */\nexport function useLocaleSwitcher() {\n const locale = useLocale();\n const locales = useLocales();\n const changeLocale = useChangeLocale();\n\n return { locale, locales, changeLocale };\n}\n","/**\n * i18n Navigation Utilities\n *\n * Provides locale-aware navigation components and functions\n *\n * @example\n * ```ts\n * // In your app's i18n/navigation.ts\n * import { createNavigation } from '@djangocfg/nextjs/i18n';\n * import { routing } from './routing';\n *\n * export const { Link, redirect, usePathname, useRouter } = createNavigation(routing);\n * ```\n *\n * @example\n * ```tsx\n * // Using in components\n * import { Link, usePathname } from '@/i18n/navigation';\n *\n * function Nav() {\n * const pathname = usePathname();\n * return <Link href=\"/about\">About</Link>;\n * }\n * ```\n */\n\nimport { createNavigation as createNextIntlNavigation } from 'next-intl/navigation';\nimport { routing, createRouting } from './routing';\nimport type { I18nConfig } from './types';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Navigation Factory\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Create navigation utilities with custom routing\n *\n * Returns locale-aware versions of:\n * - Link: Locale-prefixed links\n * - redirect: Server-side redirect with locale\n * - usePathname: Current pathname without locale prefix\n * - useRouter: Router with locale-aware navigation\n * - getPathname: Get pathname for a route\n */\nexport function createNavigation(routingConfig?: ReturnType<typeof createRouting>) {\n const config = routingConfig ?? routing;\n return createNextIntlNavigation(config);\n}\n\n/**\n * Create navigation from config options\n */\nexport function createNavigationFromConfig(config: Partial<I18nConfig>) {\n const routingConfig = createRouting(config);\n return createNextIntlNavigation(routingConfig);\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Default Navigation (using default routing)\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Default navigation utilities\n * Use these directly or create custom ones with createNavigation()\n */\nexport const {\n Link,\n redirect,\n usePathname,\n useRouter,\n getPathname,\n} = createNavigation();\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Types\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Props for locale-aware Link component\n */\nexport interface LinkProps {\n /** Target href */\n href: string;\n /** Target locale (optional, defaults to current) */\n locale?: string;\n /** Children */\n children?: React.ReactNode;\n /** Additional props passed to Next.js Link */\n [key: string]: unknown;\n}\n","/**\n * i18n Routing Configuration\n *\n * Creates routing configuration for next-intl\n * Used by proxy and navigation components\n */\n\nimport { defineRouting } from 'next-intl/routing';\nimport type { I18nConfig, LocaleCode } from './types';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Default Configuration\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst DEFAULT_LOCALES: LocaleCode[] = ['en', 'ru', 'ko'];\nconst DEFAULT_LOCALE: LocaleCode = 'en';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Routing Factory\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Create routing configuration for next-intl\n *\n * @example\n * ```ts\n * // i18n/routing.ts\n * import { createRouting } from '@djangocfg/nextjs/i18n';\n *\n * export const routing = createRouting({\n * locales: ['en', 'ru', 'ko'],\n * defaultLocale: 'en',\n * });\n * ```\n */\nexport function createRouting(config?: Partial<I18nConfig>) {\n const locales = config?.locales ?? DEFAULT_LOCALES;\n const defaultLocale = config?.defaultLocale ?? DEFAULT_LOCALE;\n const localePrefix = config?.localePrefix ?? 'always';\n\n return defineRouting({\n locales,\n defaultLocale,\n localePrefix,\n });\n}\n\n/**\n * Default routing configuration\n * Can be overridden by app-specific configuration\n */\nexport const routing = createRouting();\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Locale Utilities\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Check if a locale is supported\n */\nexport function isValidLocale(\n locale: string,\n supportedLocales: readonly string[] = DEFAULT_LOCALES\n): locale is LocaleCode {\n return supportedLocales.includes(locale as LocaleCode);\n}\n\n/**\n * Get locale from params (handles async params in Next.js 15+)\n */\nexport async function getLocaleFromParams(\n params: Promise<{ locale: string }> | { locale: string }\n): Promise<LocaleCode> {\n const resolved = await params;\n return resolved.locale as LocaleCode;\n}\n\n/**\n * Generate static params for all locales\n * Use in generateStaticParams for locale pages\n */\nexport function generateLocaleParams(locales: readonly string[] = DEFAULT_LOCALES) {\n return locales.map((locale) => ({ locale }));\n}\n"],"mappings":"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","names":[]}
@@ -0,0 +1,17 @@
1
+ export { E as ExtensionMessages, I as I18nConfig, a as I18nPluginOptions, b as I18nProviderProps, d as LocaleLayoutProps, e as LocalePageProps, L as LocaleParams, M as Messages, c as MessagesLoader } from '../types-Cy349X20.mjs';
2
+ export { createRouting, generateLocaleParams, getLocaleFromParams, isValidLocale, routing } from './routing.mjs';
3
+ export { Link, LinkProps, createNavigation, createNavigationFromConfig, getPathname, redirect, usePathname, useRouter } from './navigation.mjs';
4
+ export { I18nProvider, NextIntlProvider } from './provider.mjs';
5
+ export { RequestConfigOptions, createRequestConfig } from './request.mjs';
6
+ export { createProxy, createProxyFromConfig, proxy, config as proxyConfig } from './proxy.mjs';
7
+ export { LocaleSwitcher, LocaleSwitcherProps } from './components.mjs';
8
+ export { I18nTranslations, LocaleCode } from '@djangocfg/i18n';
9
+ import 'next-intl/routing';
10
+ import 'next/navigation';
11
+ import 'next/dist/shared/lib/app-router-context.shared-runtime';
12
+ import 'next-intl/navigation';
13
+ import 'url';
14
+ import 'next-intl';
15
+ import 'react';
16
+ import 'next-intl/server';
17
+ import 'next/server';